summaryrefslogtreecommitdiff
path: root/www/crm/wp-admin
diff options
context:
space:
mode:
authorYaco <franco@reevo.org>2020-06-04 11:01:00 -0300
committerYaco <franco@reevo.org>2020-06-04 11:01:00 -0300
commitfc7369835258467bf97eb64f184b93691f9a9fd5 (patch)
treedaabd60089d2dd76d9f5fb416b005fbe159c799d /www/crm/wp-admin
first commit
Diffstat (limited to 'www/crm/wp-admin')
-rw-r--r--www/crm/wp-admin/about.php283
-rw-r--r--www/crm/wp-admin/admin-ajax.php191
-rw-r--r--www/crm/wp-admin/admin-footer.php114
-rw-r--r--www/crm/wp-admin/admin-functions.php15
-rw-r--r--www/crm/wp-admin/admin-header.php293
-rw-r--r--www/crm/wp-admin/admin-post.php72
-rw-r--r--www/crm/wp-admin/admin.php400
-rw-r--r--www/crm/wp-admin/async-upload.php118
-rw-r--r--www/crm/wp-admin/comment.php356
-rw-r--r--www/crm/wp-admin/credits.php153
-rw-r--r--www/crm/wp-admin/css/about-rtl.css572
-rw-r--r--www/crm/wp-admin/css/about-rtl.min.css2
-rw-r--r--www/crm/wp-admin/css/about.css572
-rw-r--r--www/crm/wp-admin/css/about.min.css2
-rw-r--r--www/crm/wp-admin/css/admin-menu-rtl.css928
-rw-r--r--www/crm/wp-admin/css/admin-menu-rtl.min.css2
-rw-r--r--www/crm/wp-admin/css/admin-menu.css928
-rw-r--r--www/crm/wp-admin/css/admin-menu.min.css2
-rw-r--r--www/crm/wp-admin/css/code-editor-rtl.css76
-rw-r--r--www/crm/wp-admin/css/code-editor-rtl.min.css2
-rw-r--r--www/crm/wp-admin/css/code-editor.css76
-rw-r--r--www/crm/wp-admin/css/code-editor.min.css2
-rw-r--r--www/crm/wp-admin/css/color-picker-rtl.css174
-rw-r--r--www/crm/wp-admin/css/color-picker-rtl.min.css2
-rw-r--r--www/crm/wp-admin/css/color-picker.css174
-rw-r--r--www/crm/wp-admin/css/color-picker.min.css2
-rw-r--r--www/crm/wp-admin/css/colors/_admin.scss511
-rw-r--r--www/crm/wp-admin/css/colors/_mixins.scss54
-rw-r--r--www/crm/wp-admin/css/colors/_variables.scss62
-rw-r--r--www/crm/wp-admin/css/colors/blue/colors-rtl.css519
-rw-r--r--www/crm/wp-admin/css/colors/blue/colors-rtl.min.css2
-rw-r--r--www/crm/wp-admin/css/colors/blue/colors.css519
-rw-r--r--www/crm/wp-admin/css/colors/blue/colors.min.css2
-rw-r--r--www/crm/wp-admin/css/colors/blue/colors.scss11
-rw-r--r--www/crm/wp-admin/css/colors/coffee/colors-rtl.css519
-rw-r--r--www/crm/wp-admin/css/colors/coffee/colors-rtl.min.css2
-rw-r--r--www/crm/wp-admin/css/colors/coffee/colors.css519
-rw-r--r--www/crm/wp-admin/css/colors/coffee/colors.min.css2
-rw-r--r--www/crm/wp-admin/css/colors/coffee/colors.scss7
-rw-r--r--www/crm/wp-admin/css/colors/ectoplasm/colors-rtl.css519
-rw-r--r--www/crm/wp-admin/css/colors/ectoplasm/colors-rtl.min.css2
-rw-r--r--www/crm/wp-admin/css/colors/ectoplasm/colors.css519
-rw-r--r--www/crm/wp-admin/css/colors/ectoplasm/colors.min.css2
-rw-r--r--www/crm/wp-admin/css/colors/ectoplasm/colors.scss8
-rw-r--r--www/crm/wp-admin/css/colors/light/colors-rtl.css537
-rw-r--r--www/crm/wp-admin/css/colors/light/colors-rtl.min.css2
-rw-r--r--www/crm/wp-admin/css/colors/light/colors.css537
-rw-r--r--www/crm/wp-admin/css/colors/light/colors.min.css2
-rw-r--r--www/crm/wp-admin/css/colors/light/colors.scss38
-rw-r--r--www/crm/wp-admin/css/colors/midnight/colors-rtl.css519
-rw-r--r--www/crm/wp-admin/css/colors/midnight/colors-rtl.min.css2
-rw-r--r--www/crm/wp-admin/css/colors/midnight/colors.css519
-rw-r--r--www/crm/wp-admin/css/colors/midnight/colors.min.css2
-rw-r--r--www/crm/wp-admin/css/colors/midnight/colors.scss5
-rw-r--r--www/crm/wp-admin/css/colors/ocean/colors-rtl.css519
-rw-r--r--www/crm/wp-admin/css/colors/ocean/colors-rtl.min.css2
-rw-r--r--www/crm/wp-admin/css/colors/ocean/colors.css519
-rw-r--r--www/crm/wp-admin/css/colors/ocean/colors.min.css2
-rw-r--r--www/crm/wp-admin/css/colors/ocean/colors.scss8
-rw-r--r--www/crm/wp-admin/css/colors/sunrise/colors-rtl.css519
-rw-r--r--www/crm/wp-admin/css/colors/sunrise/colors-rtl.min.css2
-rw-r--r--www/crm/wp-admin/css/colors/sunrise/colors.css519
-rw-r--r--www/crm/wp-admin/css/colors/sunrise/colors.min.css2
-rw-r--r--www/crm/wp-admin/css/colors/sunrise/colors.scss6
-rw-r--r--www/crm/wp-admin/css/common-rtl.css4041
-rw-r--r--www/crm/wp-admin/css/common-rtl.min.css9
-rw-r--r--www/crm/wp-admin/css/common.css4041
-rw-r--r--www/crm/wp-admin/css/common.min.css9
-rw-r--r--www/crm/wp-admin/css/customize-controls-rtl.css2995
-rw-r--r--www/crm/wp-admin/css/customize-controls-rtl.min.css2
-rw-r--r--www/crm/wp-admin/css/customize-controls.css2995
-rw-r--r--www/crm/wp-admin/css/customize-controls.min.css2
-rw-r--r--www/crm/wp-admin/css/customize-nav-menus-rtl.css887
-rw-r--r--www/crm/wp-admin/css/customize-nav-menus-rtl.min.css2
-rw-r--r--www/crm/wp-admin/css/customize-nav-menus.css887
-rw-r--r--www/crm/wp-admin/css/customize-nav-menus.min.css2
-rw-r--r--www/crm/wp-admin/css/customize-widgets-rtl.css483
-rw-r--r--www/crm/wp-admin/css/customize-widgets-rtl.min.css2
-rw-r--r--www/crm/wp-admin/css/customize-widgets.css483
-rw-r--r--www/crm/wp-admin/css/customize-widgets.min.css2
-rw-r--r--www/crm/wp-admin/css/dashboard-rtl.css1282
-rw-r--r--www/crm/wp-admin/css/dashboard-rtl.min.css2
-rw-r--r--www/crm/wp-admin/css/dashboard.css1282
-rw-r--r--www/crm/wp-admin/css/dashboard.min.css2
-rw-r--r--www/crm/wp-admin/css/deprecated-media-rtl.css429
-rw-r--r--www/crm/wp-admin/css/deprecated-media-rtl.min.css2
-rw-r--r--www/crm/wp-admin/css/deprecated-media.css429
-rw-r--r--www/crm/wp-admin/css/deprecated-media.min.css2
-rw-r--r--www/crm/wp-admin/css/edit-rtl.css1651
-rw-r--r--www/crm/wp-admin/css/edit-rtl.min.css2
-rw-r--r--www/crm/wp-admin/css/edit.css1651
-rw-r--r--www/crm/wp-admin/css/edit.min.css2
-rw-r--r--www/crm/wp-admin/css/farbtastic-rtl.css41
-rw-r--r--www/crm/wp-admin/css/farbtastic-rtl.min.css2
-rw-r--r--www/crm/wp-admin/css/farbtastic.css41
-rw-r--r--www/crm/wp-admin/css/farbtastic.min.css2
-rw-r--r--www/crm/wp-admin/css/forms-rtl.css1604
-rw-r--r--www/crm/wp-admin/css/forms-rtl.min.css2
-rw-r--r--www/crm/wp-admin/css/forms.css1604
-rw-r--r--www/crm/wp-admin/css/forms.min.css2
-rw-r--r--www/crm/wp-admin/css/ie-rtl.css764
-rw-r--r--www/crm/wp-admin/css/ie-rtl.min.css2
-rw-r--r--www/crm/wp-admin/css/ie.css764
-rw-r--r--www/crm/wp-admin/css/ie.min.css2
-rw-r--r--www/crm/wp-admin/css/install-rtl.css374
-rw-r--r--www/crm/wp-admin/css/install-rtl.min.css2
-rw-r--r--www/crm/wp-admin/css/install.css374
-rw-r--r--www/crm/wp-admin/css/install.min.css2
-rw-r--r--www/crm/wp-admin/css/l10n-rtl.css120
-rw-r--r--www/crm/wp-admin/css/l10n-rtl.min.css2
-rw-r--r--www/crm/wp-admin/css/l10n.css120
-rw-r--r--www/crm/wp-admin/css/l10n.min.css2
-rw-r--r--www/crm/wp-admin/css/list-tables-rtl.css2186
-rw-r--r--www/crm/wp-admin/css/list-tables-rtl.min.css2
-rw-r--r--www/crm/wp-admin/css/list-tables.css2186
-rw-r--r--www/crm/wp-admin/css/list-tables.min.css2
-rw-r--r--www/crm/wp-admin/css/login-rtl.css311
-rw-r--r--www/crm/wp-admin/css/login-rtl.min.css2
-rw-r--r--www/crm/wp-admin/css/login.css311
-rw-r--r--www/crm/wp-admin/css/login.min.css2
-rw-r--r--www/crm/wp-admin/css/media-rtl.css1290
-rw-r--r--www/crm/wp-admin/css/media-rtl.min.css2
-rw-r--r--www/crm/wp-admin/css/media.css1290
-rw-r--r--www/crm/wp-admin/css/media.min.css2
-rw-r--r--www/crm/wp-admin/css/nav-menus-rtl.css905
-rw-r--r--www/crm/wp-admin/css/nav-menus-rtl.min.css2
-rw-r--r--www/crm/wp-admin/css/nav-menus.css905
-rw-r--r--www/crm/wp-admin/css/nav-menus.min.css2
-rw-r--r--www/crm/wp-admin/css/revisions-rtl.css601
-rw-r--r--www/crm/wp-admin/css/revisions-rtl.min.css2
-rw-r--r--www/crm/wp-admin/css/revisions.css601
-rw-r--r--www/crm/wp-admin/css/revisions.min.css2
-rw-r--r--www/crm/wp-admin/css/site-health-rtl.css454
-rw-r--r--www/crm/wp-admin/css/site-health-rtl.min.css2
-rw-r--r--www/crm/wp-admin/css/site-health.css454
-rw-r--r--www/crm/wp-admin/css/site-health.min.css2
-rw-r--r--www/crm/wp-admin/css/site-icon-rtl.css54
-rw-r--r--www/crm/wp-admin/css/site-icon-rtl.min.css2
-rw-r--r--www/crm/wp-admin/css/site-icon.css54
-rw-r--r--www/crm/wp-admin/css/site-icon.min.css2
-rw-r--r--www/crm/wp-admin/css/themes-rtl.css1922
-rw-r--r--www/crm/wp-admin/css/themes-rtl.min.css2
-rw-r--r--www/crm/wp-admin/css/themes.css1922
-rw-r--r--www/crm/wp-admin/css/themes.min.css2
-rw-r--r--www/crm/wp-admin/css/widgets-rtl.css851
-rw-r--r--www/crm/wp-admin/css/widgets-rtl.min.css2
-rw-r--r--www/crm/wp-admin/css/widgets.css851
-rw-r--r--www/crm/wp-admin/css/widgets.min.css2
-rw-r--r--www/crm/wp-admin/css/wp-admin-rtl.css15
-rw-r--r--www/crm/wp-admin/css/wp-admin-rtl.min.css16
-rw-r--r--www/crm/wp-admin/css/wp-admin.css15
-rw-r--r--www/crm/wp-admin/css/wp-admin.min.css16
-rw-r--r--www/crm/wp-admin/custom-background.php605
-rw-r--r--www/crm/wp-admin/custom-header.php1502
-rw-r--r--www/crm/wp-admin/customize.php269
-rw-r--r--www/crm/wp-admin/edit-comments.php358
-rw-r--r--www/crm/wp-admin/edit-form-advanced.php696
-rw-r--r--www/crm/wp-admin/edit-form-blocks.php433
-rw-r--r--www/crm/wp-admin/edit-form-comment.php232
-rw-r--r--www/crm/wp-admin/edit-link-form.php169
-rw-r--r--www/crm/wp-admin/edit-tag-form.php292
-rw-r--r--www/crm/wp-admin/edit-tags.php637
-rw-r--r--www/crm/wp-admin/edit.php431
-rw-r--r--www/crm/wp-admin/export.php324
-rw-r--r--www/crm/wp-admin/freedoms.php144
-rw-r--r--www/crm/wp-admin/images/align-center-2x.pngbin0 -> 147 bytes
-rw-r--r--www/crm/wp-admin/images/align-center.pngbin0 -> 546 bytes
-rw-r--r--www/crm/wp-admin/images/align-left-2x.pngbin0 -> 143 bytes
-rw-r--r--www/crm/wp-admin/images/align-left.pngbin0 -> 554 bytes
-rw-r--r--www/crm/wp-admin/images/align-none-2x.pngbin0 -> 121 bytes
-rw-r--r--www/crm/wp-admin/images/align-none.pngbin0 -> 417 bytes
-rw-r--r--www/crm/wp-admin/images/align-right-2x.pngbin0 -> 142 bytes
-rw-r--r--www/crm/wp-admin/images/align-right.pngbin0 -> 509 bytes
-rw-r--r--www/crm/wp-admin/images/arrows-2x.pngbin0 -> 863 bytes
-rw-r--r--www/crm/wp-admin/images/arrows.pngbin0 -> 243 bytes
-rw-r--r--www/crm/wp-admin/images/browser-rtl.pngbin0 -> 40170 bytes
-rw-r--r--www/crm/wp-admin/images/browser.pngbin0 -> 40626 bytes
-rw-r--r--www/crm/wp-admin/images/bubble_bg-2x.gifbin0 -> 424 bytes
-rw-r--r--www/crm/wp-admin/images/bubble_bg.gifbin0 -> 398 bytes
-rw-r--r--www/crm/wp-admin/images/comment-grey-bubble-2x.pngbin0 -> 258 bytes
-rw-r--r--www/crm/wp-admin/images/comment-grey-bubble.pngbin0 -> 114 bytes
-rw-r--r--www/crm/wp-admin/images/date-button-2x.gifbin0 -> 996 bytes
-rw-r--r--www/crm/wp-admin/images/date-button.gifbin0 -> 400 bytes
-rw-r--r--www/crm/wp-admin/images/generic.pngbin0 -> 719 bytes
-rw-r--r--www/crm/wp-admin/images/icons32-2x.pngbin0 -> 21770 bytes
-rw-r--r--www/crm/wp-admin/images/icons32-vs-2x.pngbin0 -> 21396 bytes
-rw-r--r--www/crm/wp-admin/images/icons32-vs.pngbin0 -> 8007 bytes
-rw-r--r--www/crm/wp-admin/images/icons32.pngbin0 -> 8023 bytes
-rw-r--r--www/crm/wp-admin/images/imgedit-icons-2x.pngbin0 -> 7664 bytes
-rw-r--r--www/crm/wp-admin/images/imgedit-icons.pngbin0 -> 4055 bytes
-rw-r--r--www/crm/wp-admin/images/list-2x.pngbin0 -> 1523 bytes
-rw-r--r--www/crm/wp-admin/images/list.pngbin0 -> 1003 bytes
-rw-r--r--www/crm/wp-admin/images/loading.gifbin0 -> 1373 bytes
-rw-r--r--www/crm/wp-admin/images/marker.pngbin0 -> 360 bytes
-rw-r--r--www/crm/wp-admin/images/mask.pngbin0 -> 2001 bytes
-rw-r--r--www/crm/wp-admin/images/media-button-2x.pngbin0 -> 850 bytes
-rw-r--r--www/crm/wp-admin/images/media-button-image.gifbin0 -> 200 bytes
-rw-r--r--www/crm/wp-admin/images/media-button-music.gifbin0 -> 206 bytes
-rw-r--r--www/crm/wp-admin/images/media-button-other.gifbin0 -> 248 bytes
-rw-r--r--www/crm/wp-admin/images/media-button-video.gifbin0 -> 133 bytes
-rw-r--r--www/crm/wp-admin/images/media-button.pngbin0 -> 323 bytes
-rw-r--r--www/crm/wp-admin/images/menu-2x.pngbin0 -> 12672 bytes
-rw-r--r--www/crm/wp-admin/images/menu-vs-2x.pngbin0 -> 12453 bytes
-rw-r--r--www/crm/wp-admin/images/menu-vs.pngbin0 -> 5086 bytes
-rw-r--r--www/crm/wp-admin/images/menu.pngbin0 -> 5039 bytes
-rw-r--r--www/crm/wp-admin/images/no.pngbin0 -> 755 bytes
-rw-r--r--www/crm/wp-admin/images/post-formats-vs.pngbin0 -> 2450 bytes
-rw-r--r--www/crm/wp-admin/images/post-formats.pngbin0 -> 2157 bytes
-rw-r--r--www/crm/wp-admin/images/post-formats32-vs.pngbin0 -> 5111 bytes
-rw-r--r--www/crm/wp-admin/images/post-formats32.pngbin0 -> 5142 bytes
-rw-r--r--www/crm/wp-admin/images/resize-2x.gifbin0 -> 151 bytes
-rw-r--r--www/crm/wp-admin/images/resize-rtl-2x.gifbin0 -> 150 bytes
-rw-r--r--www/crm/wp-admin/images/resize-rtl.gifbin0 -> 70 bytes
-rw-r--r--www/crm/wp-admin/images/resize.gifbin0 -> 64 bytes
-rw-r--r--www/crm/wp-admin/images/se.pngbin0 -> 120 bytes
-rw-r--r--www/crm/wp-admin/images/sort-2x.gifbin0 -> 97 bytes
-rw-r--r--www/crm/wp-admin/images/sort.gifbin0 -> 55 bytes
-rw-r--r--www/crm/wp-admin/images/spinner-2x.gifbin0 -> 7536 bytes
-rw-r--r--www/crm/wp-admin/images/spinner.gifbin0 -> 3656 bytes
-rw-r--r--www/crm/wp-admin/images/stars-2x.pngbin0 -> 1257 bytes
-rw-r--r--www/crm/wp-admin/images/stars.pngbin0 -> 924 bytes
-rw-r--r--www/crm/wp-admin/images/w-logo-blue.pngbin0 -> 3113 bytes
-rw-r--r--www/crm/wp-admin/images/w-logo-white.pngbin0 -> 5395 bytes
-rw-r--r--www/crm/wp-admin/images/wheel.pngbin0 -> 6047 bytes
-rw-r--r--www/crm/wp-admin/images/wordpress-logo-white.svg1
-rw-r--r--www/crm/wp-admin/images/wordpress-logo.pngbin0 -> 2480 bytes
-rw-r--r--www/crm/wp-admin/images/wordpress-logo.svg1
-rw-r--r--www/crm/wp-admin/images/wpspin_light-2x.gifbin0 -> 8875 bytes
-rw-r--r--www/crm/wp-admin/images/wpspin_light.gifbin0 -> 2052 bytes
-rw-r--r--www/crm/wp-admin/images/xit-2x.gifbin0 -> 825 bytes
-rw-r--r--www/crm/wp-admin/images/xit.gifbin0 -> 181 bytes
-rw-r--r--www/crm/wp-admin/images/yes.pngbin0 -> 539 bytes
-rw-r--r--www/crm/wp-admin/import.php235
-rw-r--r--www/crm/wp-admin/includes/admin-filters.php155
-rw-r--r--www/crm/wp-admin/includes/admin.php87
-rw-r--r--www/crm/wp-admin/includes/ajax-actions.php5014
-rw-r--r--www/crm/wp-admin/includes/bookmark.php327
-rw-r--r--www/crm/wp-admin/includes/class-automatic-upgrader-skin.php118
-rw-r--r--www/crm/wp-admin/includes/class-bulk-plugin-upgrader-skin.php68
-rw-r--r--www/crm/wp-admin/includes/class-bulk-theme-upgrader-skin.php68
-rw-r--r--www/crm/wp-admin/includes/class-bulk-upgrader-skin.php178
-rw-r--r--www/crm/wp-admin/includes/class-core-upgrader.php406
-rw-r--r--www/crm/wp-admin/includes/class-file-upload-upgrader.php132
-rw-r--r--www/crm/wp-admin/includes/class-ftp-pure.php186
-rw-r--r--www/crm/wp-admin/includes/class-ftp-sockets.php246
-rw-r--r--www/crm/wp-admin/includes/class-ftp.php912
-rw-r--r--www/crm/wp-admin/includes/class-language-pack-upgrader-skin.php89
-rw-r--r--www/crm/wp-admin/includes/class-language-pack-upgrader.php472
-rw-r--r--www/crm/wp-admin/includes/class-pclzip.php5692
-rw-r--r--www/crm/wp-admin/includes/class-plugin-installer-skin.php105
-rw-r--r--www/crm/wp-admin/includes/class-plugin-upgrader-skin.php76
-rw-r--r--www/crm/wp-admin/includes/class-plugin-upgrader.php487
-rw-r--r--www/crm/wp-admin/includes/class-theme-installer-skin.php124
-rw-r--r--www/crm/wp-admin/includes/class-theme-upgrader-skin.php107
-rw-r--r--www/crm/wp-admin/includes/class-theme-upgrader.php648
-rw-r--r--www/crm/wp-admin/includes/class-walker-category-checklist.php128
-rw-r--r--www/crm/wp-admin/includes/class-walker-nav-menu-checklist.php119
-rw-r--r--www/crm/wp-admin/includes/class-walker-nav-menu-edit.php266
-rw-r--r--www/crm/wp-admin/includes/class-wp-ajax-upgrader-skin.php128
-rw-r--r--www/crm/wp-admin/includes/class-wp-automatic-updater.php996
-rw-r--r--www/crm/wp-admin/includes/class-wp-comments-list-table.php861
-rw-r--r--www/crm/wp-admin/includes/class-wp-community-events.php464
-rw-r--r--www/crm/wp-admin/includes/class-wp-debug-data.php1238
-rw-r--r--www/crm/wp-admin/includes/class-wp-filesystem-base.php827
-rw-r--r--www/crm/wp-admin/includes/class-wp-filesystem-direct.php619
-rw-r--r--www/crm/wp-admin/includes/class-wp-filesystem-ftpext.php736
-rw-r--r--www/crm/wp-admin/includes/class-wp-filesystem-ftpsockets.php660
-rw-r--r--www/crm/wp-admin/includes/class-wp-filesystem-ssh2.php765
-rw-r--r--www/crm/wp-admin/includes/class-wp-importer.php333
-rw-r--r--www/crm/wp-admin/includes/class-wp-internal-pointers.php165
-rw-r--r--www/crm/wp-admin/includes/class-wp-links-list-table.php326
-rw-r--r--www/crm/wp-admin/includes/class-wp-list-table-compat.php50
-rw-r--r--www/crm/wp-admin/includes/class-wp-list-table.php1400
-rw-r--r--www/crm/wp-admin/includes/class-wp-media-list-table.php794
-rw-r--r--www/crm/wp-admin/includes/class-wp-ms-sites-list-table.php582
-rw-r--r--www/crm/wp-admin/includes/class-wp-ms-themes-list-table.php763
-rw-r--r--www/crm/wp-admin/includes/class-wp-ms-users-list-table.php488
-rw-r--r--www/crm/wp-admin/includes/class-wp-plugin-install-list-table.php765
-rw-r--r--www/crm/wp-admin/includes/class-wp-plugins-list-table.php954
-rw-r--r--www/crm/wp-admin/includes/class-wp-post-comments-list-table.php78
-rw-r--r--www/crm/wp-admin/includes/class-wp-posts-list-table.php1914
-rw-r--r--www/crm/wp-admin/includes/class-wp-screen.php1310
-rw-r--r--www/crm/wp-admin/includes/class-wp-site-health-auto-updates.php449
-rw-r--r--www/crm/wp-admin/includes/class-wp-site-health.php1990
-rw-r--r--www/crm/wp-admin/includes/class-wp-site-icon.php233
-rw-r--r--www/crm/wp-admin/includes/class-wp-terms-list-table.php676
-rw-r--r--www/crm/wp-admin/includes/class-wp-theme-install-list-table.php555
-rw-r--r--www/crm/wp-admin/includes/class-wp-themes-list-table.php321
-rw-r--r--www/crm/wp-admin/includes/class-wp-upgrader-skin.php209
-rw-r--r--www/crm/wp-admin/includes/class-wp-upgrader-skins.php43
-rw-r--r--www/crm/wp-admin/includes/class-wp-upgrader.php946
-rw-r--r--www/crm/wp-admin/includes/class-wp-users-list-table.php602
-rw-r--r--www/crm/wp-admin/includes/comment.php212
-rw-r--r--www/crm/wp-admin/includes/continents-cities.php554
-rw-r--r--www/crm/wp-admin/includes/credits.php78
-rw-r--r--www/crm/wp-admin/includes/dashboard.php1742
-rw-r--r--www/crm/wp-admin/includes/deprecated.php1516
-rw-r--r--www/crm/wp-admin/includes/edit-tag-messages.php58
-rw-r--r--www/crm/wp-admin/includes/export.php660
-rw-r--r--www/crm/wp-admin/includes/file.php2651
-rw-r--r--www/crm/wp-admin/includes/image-edit.php967
-rw-r--r--www/crm/wp-admin/includes/image.php731
-rw-r--r--www/crm/wp-admin/includes/import.php231
-rw-r--r--www/crm/wp-admin/includes/list-table.php86
-rw-r--r--www/crm/wp-admin/includes/media.php3524
-rw-r--r--www/crm/wp-admin/includes/menu.php351
-rw-r--r--www/crm/wp-admin/includes/meta-boxes.php1555
-rw-r--r--www/crm/wp-admin/includes/misc.php2096
-rw-r--r--www/crm/wp-admin/includes/ms-admin-filters.php44
-rw-r--r--www/crm/wp-admin/includes/ms-deprecated.php110
-rw-r--r--www/crm/wp-admin/includes/ms.php1177
-rw-r--r--www/crm/wp-admin/includes/nav-menu.php1250
-rw-r--r--www/crm/wp-admin/includes/network.php665
-rw-r--r--www/crm/wp-admin/includes/noop.php114
-rw-r--r--www/crm/wp-admin/includes/options.php133
-rw-r--r--www/crm/wp-admin/includes/plugin-install.php854
-rw-r--r--www/crm/wp-admin/includes/plugin.php2323
-rw-r--r--www/crm/wp-admin/includes/post.php2410
-rw-r--r--www/crm/wp-admin/includes/revision.php456
-rw-r--r--www/crm/wp-admin/includes/schema.php1332
-rw-r--r--www/crm/wp-admin/includes/screen.php242
-rw-r--r--www/crm/wp-admin/includes/taxonomy.php308
-rw-r--r--www/crm/wp-admin/includes/template.php2496
-rw-r--r--www/crm/wp-admin/includes/theme-install.php251
-rw-r--r--www/crm/wp-admin/includes/theme.php912
-rw-r--r--www/crm/wp-admin/includes/translation-install.php270
-rw-r--r--www/crm/wp-admin/includes/update-core.php1448
-rw-r--r--www/crm/wp-admin/includes/update.php861
-rw-r--r--www/crm/wp-admin/includes/upgrade.php3350
-rw-r--r--www/crm/wp-admin/includes/user.php1723
-rw-r--r--www/crm/wp-admin/includes/widgets.php316
-rw-r--r--www/crm/wp-admin/index.php156
-rw-r--r--www/crm/wp-admin/install-helper.php200
-rw-r--r--www/crm/wp-admin/install.php434
-rw-r--r--www/crm/wp-admin/js/accordion.js94
-rw-r--r--www/crm/wp-admin/js/accordion.min.js1
-rw-r--r--www/crm/wp-admin/js/code-editor.js342
-rw-r--r--www/crm/wp-admin/js/code-editor.min.js1
-rw-r--r--www/crm/wp-admin/js/color-picker.js359
-rw-r--r--www/crm/wp-admin/js/color-picker.min.js1
-rw-r--r--www/crm/wp-admin/js/comment.js101
-rw-r--r--www/crm/wp-admin/js/comment.min.js1
-rw-r--r--www/crm/wp-admin/js/common.js1623
-rw-r--r--www/crm/wp-admin/js/common.min.js1
-rw-r--r--www/crm/wp-admin/js/custom-background.js145
-rw-r--r--www/crm/wp-admin/js/custom-background.min.js1
-rw-r--r--www/crm/wp-admin/js/custom-header.js88
-rw-r--r--www/crm/wp-admin/js/customize-controls.js9270
-rw-r--r--www/crm/wp-admin/js/customize-controls.min.js4
-rw-r--r--www/crm/wp-admin/js/customize-nav-menus.js3464
-rw-r--r--www/crm/wp-admin/js/customize-nav-menus.min.js2
-rw-r--r--www/crm/wp-admin/js/customize-widgets.js2367
-rw-r--r--www/crm/wp-admin/js/customize-widgets.min.js1
-rw-r--r--www/crm/wp-admin/js/dashboard.js593
-rw-r--r--www/crm/wp-admin/js/dashboard.min.js1
-rw-r--r--www/crm/wp-admin/js/edit-comments.js1016
-rw-r--r--www/crm/wp-admin/js/edit-comments.min.js1
-rw-r--r--www/crm/wp-admin/js/editor-expand.js1616
-rw-r--r--www/crm/wp-admin/js/editor-expand.min.js1
-rw-r--r--www/crm/wp-admin/js/editor.js1414
-rw-r--r--www/crm/wp-admin/js/editor.min.js1
-rw-r--r--www/crm/wp-admin/js/farbtastic.js276
-rw-r--r--www/crm/wp-admin/js/gallery.js241
-rw-r--r--www/crm/wp-admin/js/gallery.min.js1
-rw-r--r--www/crm/wp-admin/js/image-edit.js1126
-rw-r--r--www/crm/wp-admin/js/image-edit.min.js1
-rw-r--r--www/crm/wp-admin/js/inline-edit-post.js556
-rw-r--r--www/crm/wp-admin/js/inline-edit-post.min.js1
-rw-r--r--www/crm/wp-admin/js/inline-edit-tax.js294
-rw-r--r--www/crm/wp-admin/js/inline-edit-tax.min.js1
-rw-r--r--www/crm/wp-admin/js/iris.min.js4
-rw-r--r--www/crm/wp-admin/js/language-chooser.js36
-rw-r--r--www/crm/wp-admin/js/language-chooser.min.js1
-rw-r--r--www/crm/wp-admin/js/link.js136
-rw-r--r--www/crm/wp-admin/js/link.min.js1
-rw-r--r--www/crm/wp-admin/js/media-gallery.js41
-rw-r--r--www/crm/wp-admin/js/media-gallery.min.js1
-rw-r--r--www/crm/wp-admin/js/media-upload.js113
-rw-r--r--www/crm/wp-admin/js/media-upload.min.js1
-rw-r--r--www/crm/wp-admin/js/media.js207
-rw-r--r--www/crm/wp-admin/js/media.min.js1
-rw-r--r--www/crm/wp-admin/js/nav-menu.js1302
-rw-r--r--www/crm/wp-admin/js/nav-menu.min.js1
-rw-r--r--www/crm/wp-admin/js/password-strength-meter.js121
-rw-r--r--www/crm/wp-admin/js/password-strength-meter.min.js1
-rw-r--r--www/crm/wp-admin/js/plugin-install.js222
-rw-r--r--www/crm/wp-admin/js/plugin-install.min.js1
-rw-r--r--www/crm/wp-admin/js/post.js1273
-rw-r--r--www/crm/wp-admin/js/post.min.js1
-rw-r--r--www/crm/wp-admin/js/postbox.js445
-rw-r--r--www/crm/wp-admin/js/postbox.min.js1
-rw-r--r--www/crm/wp-admin/js/revisions.js1171
-rw-r--r--www/crm/wp-admin/js/revisions.min.js1
-rw-r--r--www/crm/wp-admin/js/set-post-thumbnail.js28
-rw-r--r--www/crm/wp-admin/js/set-post-thumbnail.min.js1
-rw-r--r--www/crm/wp-admin/js/site-health.js316
-rw-r--r--www/crm/wp-admin/js/site-health.min.js1
-rw-r--r--www/crm/wp-admin/js/svg-painter.js241
-rw-r--r--www/crm/wp-admin/js/svg-painter.min.js1
-rw-r--r--www/crm/wp-admin/js/tags-box.js430
-rw-r--r--www/crm/wp-admin/js/tags-box.min.js1
-rw-r--r--www/crm/wp-admin/js/tags-suggest.js193
-rw-r--r--www/crm/wp-admin/js/tags-suggest.min.js1
-rw-r--r--www/crm/wp-admin/js/tags.js147
-rw-r--r--www/crm/wp-admin/js/tags.min.js1
-rw-r--r--www/crm/wp-admin/js/theme-plugin-editor.js1006
-rw-r--r--www/crm/wp-admin/js/theme-plugin-editor.min.js1
-rw-r--r--www/crm/wp-admin/js/theme.js2067
-rw-r--r--www/crm/wp-admin/js/theme.min.js1
-rw-r--r--www/crm/wp-admin/js/updates.js2465
-rw-r--r--www/crm/wp-admin/js/updates.min.js2
-rw-r--r--www/crm/wp-admin/js/user-profile.js462
-rw-r--r--www/crm/wp-admin/js/user-profile.min.js1
-rw-r--r--www/crm/wp-admin/js/user-suggest.js64
-rw-r--r--www/crm/wp-admin/js/user-suggest.min.js1
-rw-r--r--www/crm/wp-admin/js/widgets.js761
-rw-r--r--www/crm/wp-admin/js/widgets.min.js1
-rw-r--r--www/crm/wp-admin/js/widgets/custom-html-widgets.js456
-rw-r--r--www/crm/wp-admin/js/widgets/custom-html-widgets.min.js1
-rw-r--r--www/crm/wp-admin/js/widgets/media-audio-widget.js154
-rw-r--r--www/crm/wp-admin/js/widgets/media-audio-widget.min.js1
-rw-r--r--www/crm/wp-admin/js/widgets/media-gallery-widget.js341
-rw-r--r--www/crm/wp-admin/js/widgets/media-gallery-widget.min.js1
-rw-r--r--www/crm/wp-admin/js/widgets/media-image-widget.js170
-rw-r--r--www/crm/wp-admin/js/widgets/media-image-widget.min.js1
-rw-r--r--www/crm/wp-admin/js/widgets/media-video-widget.js256
-rw-r--r--www/crm/wp-admin/js/widgets/media-video-widget.min.js1
-rw-r--r--www/crm/wp-admin/js/widgets/media-widgets.js1334
-rw-r--r--www/crm/wp-admin/js/widgets/media-widgets.min.js1
-rw-r--r--www/crm/wp-admin/js/widgets/text-widgets.js552
-rw-r--r--www/crm/wp-admin/js/widgets/text-widgets.min.js1
-rw-r--r--www/crm/wp-admin/js/word-count.js218
-rw-r--r--www/crm/wp-admin/js/word-count.min.js1
-rw-r--r--www/crm/wp-admin/js/wp-fullscreen-stub.js40
-rw-r--r--www/crm/wp-admin/js/wp-fullscreen-stub.min.js1
-rw-r--r--www/crm/wp-admin/js/xfn.js279
-rw-r--r--www/crm/wp-admin/js/xfn.min.js1
-rw-r--r--www/crm/wp-admin/link-add.php31
-rw-r--r--www/crm/wp-admin/link-manager.php129
-rw-r--r--www/crm/wp-admin/link-parse-opml.php96
-rw-r--r--www/crm/wp-admin/link.php125
-rw-r--r--www/crm/wp-admin/load-scripts.php65
-rw-r--r--www/crm/wp-admin/load-styles.php84
-rw-r--r--www/crm/wp-admin/maint/repair.php170
-rw-r--r--www/crm/wp-admin/media-new.php89
-rw-r--r--www/crm/wp-admin/media-upload.php113
-rw-r--r--www/crm/wp-admin/media.php176
-rw-r--r--www/crm/wp-admin/menu-header.php283
-rw-r--r--www/crm/wp-admin/menu.php309
-rw-r--r--www/crm/wp-admin/moderation.php12
-rw-r--r--www/crm/wp-admin/ms-admin.php13
-rw-r--r--www/crm/wp-admin/ms-delete-site.php114
-rw-r--r--www/crm/wp-admin/ms-edit.php13
-rw-r--r--www/crm/wp-admin/ms-options.php12
-rw-r--r--www/crm/wp-admin/ms-sites.php13
-rw-r--r--www/crm/wp-admin/ms-themes.php13
-rw-r--r--www/crm/wp-admin/ms-upgrade-network.php13
-rw-r--r--www/crm/wp-admin/ms-users.php13
-rw-r--r--www/crm/wp-admin/my-sites.php160
-rw-r--r--www/crm/wp-admin/nav-menus.php1014
-rw-r--r--www/crm/wp-admin/network.php121
-rw-r--r--www/crm/wp-admin/network/about.php13
-rw-r--r--www/crm/wp-admin/network/admin.php34
-rw-r--r--www/crm/wp-admin/network/credits.php13
-rw-r--r--www/crm/wp-admin/network/edit.php41
-rw-r--r--www/crm/wp-admin/network/freedoms.php13
-rw-r--r--www/crm/wp-admin/network/index.php83
-rw-r--r--www/crm/wp-admin/network/menu.php74
-rw-r--r--www/crm/wp-admin/network/plugin-editor.php13
-rw-r--r--www/crm/wp-admin/network/plugin-install.php17
-rw-r--r--www/crm/wp-admin/network/plugins.php13
-rw-r--r--www/crm/wp-admin/network/privacy.php13
-rw-r--r--www/crm/wp-admin/network/profile.php13
-rw-r--r--www/crm/wp-admin/network/settings.php481
-rw-r--r--www/crm/wp-admin/network/setup.php13
-rw-r--r--www/crm/wp-admin/network/site-info.php209
-rw-r--r--www/crm/wp-admin/network/site-new.php301
-rw-r--r--www/crm/wp-admin/network/site-settings.php176
-rw-r--r--www/crm/wp-admin/network/site-themes.php227
-rw-r--r--www/crm/wp-admin/network/site-users.php366
-rw-r--r--www/crm/wp-admin/network/sites.php371
-rw-r--r--www/crm/wp-admin/network/theme-editor.php13
-rw-r--r--www/crm/wp-admin/network/theme-install.php17
-rw-r--r--www/crm/wp-admin/network/themes.php343
-rw-r--r--www/crm/wp-admin/network/update-core.php13
-rw-r--r--www/crm/wp-admin/network/update.php17
-rw-r--r--www/crm/wp-admin/network/upgrade.php155
-rw-r--r--www/crm/wp-admin/network/user-edit.php13
-rw-r--r--www/crm/wp-admin/network/user-new.php150
-rw-r--r--www/crm/wp-admin/network/users.php280
-rw-r--r--www/crm/wp-admin/options-discussion.php320
-rw-r--r--www/crm/wp-admin/options-general.php411
-rw-r--r--www/crm/wp-admin/options-head.php18
-rw-r--r--www/crm/wp-admin/options-media.php156
-rw-r--r--www/crm/wp-admin/options-permalink.php404
-rw-r--r--www/crm/wp-admin/options-reading.php188
-rw-r--r--www/crm/wp-admin/options-writing.php239
-rw-r--r--www/crm/wp-admin/options.php370
-rw-r--r--www/crm/wp-admin/plugin-editor.php321
-rw-r--r--www/crm/wp-admin/plugin-install.php183
-rw-r--r--www/crm/wp-admin/plugins.php630
-rw-r--r--www/crm/wp-admin/post-new.php83
-rw-r--r--www/crm/wp-admin/post.php350
-rw-r--r--www/crm/wp-admin/press-this.php87
-rw-r--r--www/crm/wp-admin/privacy.php263
-rw-r--r--www/crm/wp-admin/profile.php18
-rw-r--r--www/crm/wp-admin/revision.php155
-rw-r--r--www/crm/wp-admin/setup-config.php454
-rw-r--r--www/crm/wp-admin/site-health-info.php178
-rw-r--r--www/crm/wp-admin/site-health.php157
-rw-r--r--www/crm/wp-admin/term.php70
-rw-r--r--www/crm/wp-admin/theme-editor.php365
-rw-r--r--www/crm/wp-admin/theme-install.php374
-rw-r--r--www/crm/wp-admin/themes.php604
-rw-r--r--www/crm/wp-admin/tools.php79
-rw-r--r--www/crm/wp-admin/update-core.php879
-rw-r--r--www/crm/wp-admin/update.php300
-rw-r--r--www/crm/wp-admin/upgrade-functions.php12
-rw-r--r--www/crm/wp-admin/upgrade.php150
-rw-r--r--www/crm/wp-admin/upload.php373
-rw-r--r--www/crm/wp-admin/user-edit.php769
-rw-r--r--www/crm/wp-admin/user-new.php571
-rw-r--r--www/crm/wp-admin/user/about.php13
-rw-r--r--www/crm/wp-admin/user/admin.php32
-rw-r--r--www/crm/wp-admin/user/credits.php13
-rw-r--r--www/crm/wp-admin/user/freedoms.php13
-rw-r--r--www/crm/wp-admin/user/index.php13
-rw-r--r--www/crm/wp-admin/user/menu.php22
-rw-r--r--www/crm/wp-admin/user/privacy.php13
-rw-r--r--www/crm/wp-admin/user/profile.php13
-rw-r--r--www/crm/wp-admin/user/user-edit.php13
-rw-r--r--www/crm/wp-admin/users.php588
-rw-r--r--www/crm/wp-admin/widgets.php568
533 files changed, 206416 insertions, 0 deletions
diff --git a/www/crm/wp-admin/about.php b/www/crm/wp-admin/about.php
new file mode 100644
index 00000000..fb56d79f
--- /dev/null
+++ b/www/crm/wp-admin/about.php
@@ -0,0 +1,283 @@
+<?php
+/**
+ * About This Version administration panel.
+ *
+ * @package WordPress
+ * @subpackage Administration
+ */
+
+/** WordPress Administration Bootstrap */
+require_once( dirname( __FILE__ ) . '/admin.php' );
+
+/* translators: Page title of the About WordPress page in the admin. */
+$title = _x( 'About', 'page title' );
+
+list( $display_version ) = explode( '-', get_bloginfo( 'version' ) );
+
+include( ABSPATH . 'wp-admin/admin-header.php' );
+?>
+ <div class="wrap about-wrap full-width-layout">
+ <h1>
+ <?php
+ /* translators: %s: The current WordPress version number */
+ printf( __( 'Welcome to WordPress&nbsp;%s' ), $display_version );
+ ?>
+ </h1>
+
+ <p class="about-text">
+ <?php
+ printf(
+ /* translators: %s: The current WordPress version number */
+ __( 'Congratulations on updating to WordPress %s! This update makes it easier than ever to fix your site if something goes wrong.' ),
+ $display_version
+ );
+ ?>
+ </p>
+
+ <div class="wp-badge">
+ <?php
+ /* translators: %s: The current WordPress version number */
+ printf( __( 'Version %s' ), $display_version );
+ ?>
+ </div>
+
+ <nav class="nav-tab-wrapper wp-clearfix" aria-label="<?php esc_attr_e( 'Secondary menu' ); ?>">
+ <a href="about.php" class="nav-tab nav-tab-active" aria-current="page"><?php _e( 'What&#8217;s New' ); ?></a>
+ <a href="credits.php" class="nav-tab"><?php _e( 'Credits' ); ?></a>
+ <a href="freedoms.php" class="nav-tab"><?php _e( 'Freedoms' ); ?></a>
+ <a href="freedoms.php?privacy-notice" class="nav-tab"><?php _e( 'Privacy' ); ?></a>
+ </nav>
+
+ <div class="changelog point-releases">
+ <h3><?php _e( 'Maintenance and Security Releases' ); ?></h3>
+ <p>
+ <?php
+ printf(
+ /* translators: 1: WordPress version number, 2: plural number of bugs. More than one security issue. */
+ _n(
+ '<strong>Version %1$s</strong> addressed some security issues and fixed %2$s bug.',
+ '<strong>Version %1$s</strong> addressed some security issues and fixed %2$s bugs.',
+ 29
+ ),
+ '5.2.3',
+ number_format_i18n( 29 )
+ );
+ ?>
+ <?php
+ printf(
+ /* translators: %s: HelpHub URL */
+ __( 'For more information, see <a href="%s">the release notes</a>.' ),
+ sprintf(
+ /* translators: %s: WordPress version */
+ esc_url( __( 'https://wordpress.org/support/wordpress-version/version-%s/' ) ),
+ sanitize_title( '5.2.3' )
+ )
+ );
+ ?>
+ </p>
+ <p>
+ <?php
+ printf(
+ /* translators: 1: WordPress version number, 2: plural number of bugs. */
+ _n(
+ '<strong>Version %1$s</strong> addressed %2$s bug.',
+ '<strong>Version %1$s</strong> addressed %2$s bugs.',
+ 13
+ ),
+ '5.2.2',
+ number_format_i18n( 13 )
+ );
+ ?>
+ <?php
+ printf(
+ /* translators: %s: HelpHub URL */
+ __( 'For more information, see <a href="%s">the release notes</a>.' ),
+ sprintf(
+ /* translators: %s: WordPress version */
+ esc_url( __( 'https://wordpress.org/support/wordpress-version/version-%s/' ) ),
+ sanitize_title( '5.2.2' )
+ )
+ );
+ ?>
+ </p>
+ <p>
+ <?php
+ printf(
+ /* translators: 1: WordPress version number, 2: plural number of bugs. */
+ _n(
+ '<strong>Version %1$s</strong> addressed %2$s bug.',
+ '<strong>Version %1$s</strong> addressed %2$s bugs.',
+ 33
+ ),
+ '5.2.1',
+ number_format_i18n( 33 )
+ );
+ ?>
+ <?php
+ printf(
+ /* translators: %s: HelpHub URL */
+ __( 'For more information, see <a href="%s">the release notes</a>.' ),
+ sprintf(
+ /* translators: %s: WordPress version */
+ esc_url( __( 'https://wordpress.org/support/wordpress-version/version-%s/' ) ),
+ sanitize_title( '5.2.1' )
+ )
+ );
+ ?>
+ </p>
+ </div>
+
+ <div class="headline-feature">
+ <h2><?php _e( 'Keeping Your Site Safe' ); ?></h2>
+ <p class="lead-description"><?php _e( 'WordPress 5.2 gives you even more robust tools for identifying and fixing configuration issues and fatal errors. Whether you are a developer helping clients or you manage your site solo, these tools can help get you the right information when you need it.' ); ?></p>
+ <div class="inline-svg aligncenter">
+ <img src="https://s.w.org/images/core/5.2/about_maintain-wordpress-v2.svg" alt="">
+ </div>
+ </div>
+
+ <hr />
+
+ <div class="feature-section is-wide has-2-columns is-wider-left">
+ <div class="column is-vertically-aligned-center">
+ <h3><?php _e( 'Site Health Check' ); ?></h3>
+ <p>
+ <?php
+ printf(
+ /* translators: 1: link to the WordPress 5.1 release post */
+ __( 'Building on <a href="%1$s">the Site Health features introduced in 5.1</a>, this release adds two new pages to help debug common configuration issues. It also adds space where developers can include debugging information for site maintainers.' ),
+ __( 'https://wordpress.org/news/2019/02/betty/' )
+ );
+
+ if ( current_user_can( 'install_plugins' ) ) {
+ printf(
+ /* translators: 1: link to /wp-admin/site-health.php 2: link to /wp-admin/site-health.php?tab=debug */
+ __( ' <a href="%1$s">Check your site status</a>, and <a href="%2$s">learn how to debug issues</a>.' ),
+ admin_url( 'site-health.php' ),
+ admin_url( 'site-health.php?tab=debug' )
+ );
+ }
+ ?>
+ </p>
+ </div>
+ <div class="column">
+ <div class="inline-svg aligncenter">
+ <img src="https://s.w.org/images/core/5.2/about_site-health.svg" alt="">
+ </div>
+ </div>
+ </div>
+
+ <hr />
+
+ <div class="feature-section is-wide has-2-columns is-wider-right">
+ <div class="column">
+ <div class="inline-svg aligncenter">
+ <img src="https://s.w.org/images/core/5.2/about_error-protection.svg" alt="">
+ </div>
+ </div>
+ <div class="column is-vertically-aligned-center">
+ <h3><?php _e( 'PHP Error Protection' ); ?></h3>
+ <p><?php _e( 'This administrator-focused update will let you safely fix or manage fatal errors without requiring a developer. It features better handling of the so-called “white screen of death”, and a way to enter recovery mode, which pauses error-causing plugins or themes.' ); ?></p>
+ </div>
+ </div>
+
+ <hr />
+
+ <h3 class="aligncenter"><?php _e( 'Improvements for Everyone' ); ?></h3>
+
+ <div class="has-2-columns">
+ <div class="column aligncenter">
+ <h4><?php _e( 'Accessibility Updates' ); ?></h4>
+ <p><?php _e( 'A number of changes work together to improve contextual awareness and keyboard navigation flow for those using screen readers and other assistive technologies.' ); ?></p>
+ </div>
+ <div class="column aligncenter">
+ <h4><?php _e( 'New Dashboard Icons' ); ?></h4>
+ <p><?php _e( 'Thirteen new icons include Instagram, a suite of icons for BuddyPress, and rotated Earth icons for global inclusion. Find them in the Dashboard and have some fun!' ); ?></p>
+ </div>
+ </div>
+
+ <hr />
+
+ <h3 class="aligncenter"><?php _e( 'Developer Happiness' ); ?></h3>
+
+ <div class="has-2-columns is-fullwidth">
+ <div class="column">
+ <h4><a href="https://make.wordpress.org/core/2019/03/26/coding-standards-updates-for-php-5-6/"><?php _e( 'PHP Version Bump' ); ?></a></h4>
+ <p><?php _e( 'The minimum supported PHP version is now 5.6.20. As of WordPress 5.2, themes and plugins can safely take advantage of namespaces, anonymous functions, and more!' ); ?></p>
+ </div>
+ <div class="column">
+ <h4><a href="https://make.wordpress.org/core/2019/04/24/developer-focused-privacy-updates-in-5-2/"><?php _e( 'Privacy Updates' ); ?></a></h4>
+ <p><?php _e( 'A new theme page template, a conditional function, and two CSS classes make designing and customizing the Privacy Policy page easier.' ); ?></p>
+ </div>
+ </div>
+ <div class="has-2-columns is-fullwidth">
+ <div class="column">
+ <h4><a href="https://make.wordpress.org/core/2019/04/24/miscellaneous-developer-updates-in-5-2/"><?php _e( 'New Body Tag Hook' ); ?></a></h4>
+ <p>
+ <?php
+ printf(
+ /* translators: 1: wp_body_open 2: <body> */
+ __( '5.2 introduces a %1$s hook, which lets themes support injecting code right at the beginning of the %2$s element.' ),
+ '<code>wp_body_open</code>',
+ '<code>&lt;body&gt;</code>'
+ );
+ ?>
+ </p>
+ </div>
+ <div class="column">
+ <h4><a href="https://make.wordpress.org/core/2019/03/25/building-javascript/"><?php _e( 'Building JavaScript' ); ?></a></h4>
+ <p><?php _e( 'With the addition of webpack and Babel configurations in the @wordpress/scripts package, developers won&#8217;t have to worry about setting up complex build tools to write modern JavaScript.' ); ?></p>
+ </div>
+ </div>
+
+ <hr />
+
+ <div class="return-to-dashboard">
+ <?php if ( current_user_can( 'update_core' ) && isset( $_GET['updated'] ) ) : ?>
+ <a href="<?php echo esc_url( self_admin_url( 'update-core.php' ) ); ?>">
+ <?php is_multisite() ? _e( 'Return to Updates' ) : _e( 'Return to Dashboard &rarr; Updates' ); ?>
+ </a> |
+ <?php endif; ?>
+ <a href="<?php echo esc_url( self_admin_url() ); ?>"><?php is_blog_admin() ? _e( 'Go to Dashboard &rarr; Home' ) : _e( 'Go to Dashboard' ); ?></a>
+ </div>
+ </div>
+<?php
+
+include( ABSPATH . 'wp-admin/admin-footer.php' );
+
+// These are strings we may use to describe maintenance/security releases, where we aim for no new strings.
+return;
+
+__( 'Maintenance Release' );
+__( 'Maintenance Releases' );
+
+__( 'Security Release' );
+__( 'Security Releases' );
+
+__( 'Maintenance and Security Release' );
+__( 'Maintenance and Security Releases' );
+
+/* translators: %s: WordPress version number */
+__( '<strong>Version %s</strong> addressed one security issue.' );
+/* translators: %s: WordPress version number */
+__( '<strong>Version %s</strong> addressed some security issues.' );
+
+/* translators: 1: WordPress version number, 2: plural number of bugs. */
+_n_noop(
+ '<strong>Version %1$s</strong> addressed %2$s bug.',
+ '<strong>Version %1$s</strong> addressed %2$s bugs.'
+);
+
+/* translators: 1: WordPress version number, 2: plural number of bugs. Singular security issue. */
+_n_noop(
+ '<strong>Version %1$s</strong> addressed a security issue and fixed %2$s bug.',
+ '<strong>Version %1$s</strong> addressed a security issue and fixed %2$s bugs.'
+);
+
+/* translators: 1: WordPress version number, 2: plural number of bugs. More than one security issue. */
+_n_noop(
+ '<strong>Version %1$s</strong> addressed some security issues and fixed %2$s bug.',
+ '<strong>Version %1$s</strong> addressed some security issues and fixed %2$s bugs.'
+);
+
+/* translators: %s: Codex URL */
+__( 'For more information, see <a href="%s">the release notes</a>.' );
diff --git a/www/crm/wp-admin/admin-ajax.php b/www/crm/wp-admin/admin-ajax.php
new file mode 100644
index 00000000..8d412dd9
--- /dev/null
+++ b/www/crm/wp-admin/admin-ajax.php
@@ -0,0 +1,191 @@
+<?php
+/**
+ * WordPress Ajax Process Execution
+ *
+ * @package WordPress
+ * @subpackage Administration
+ *
+ * @link https://codex.wordpress.org/AJAX_in_Plugins
+ */
+
+/**
+ * Executing Ajax process.
+ *
+ * @since 2.1.0
+ */
+define( 'DOING_AJAX', true );
+if ( ! defined( 'WP_ADMIN' ) ) {
+ define( 'WP_ADMIN', true );
+}
+
+/** Load WordPress Bootstrap */
+require_once( dirname( dirname( __FILE__ ) ) . '/wp-load.php' );
+
+/** Allow for cross-domain requests (from the front end). */
+send_origin_headers();
+
+// Require an action parameter
+if ( empty( $_REQUEST['action'] ) ) {
+ wp_die( '0', 400 );
+}
+
+/** Load WordPress Administration APIs */
+require_once( ABSPATH . 'wp-admin/includes/admin.php' );
+
+/** Load Ajax Handlers for WordPress Core */
+require_once( ABSPATH . 'wp-admin/includes/ajax-actions.php' );
+
+@header( 'Content-Type: text/html; charset=' . get_option( 'blog_charset' ) );
+@header( 'X-Robots-Tag: noindex' );
+
+send_nosniff_header();
+nocache_headers();
+
+/** This action is documented in wp-admin/admin.php */
+do_action( 'admin_init' );
+
+$core_actions_get = array(
+ 'fetch-list',
+ 'ajax-tag-search',
+ 'wp-compression-test',
+ 'imgedit-preview',
+ 'oembed-cache',
+ 'autocomplete-user',
+ 'dashboard-widgets',
+ 'logged-in',
+);
+
+$core_actions_post = array(
+ 'oembed-cache',
+ 'image-editor',
+ 'delete-comment',
+ 'delete-tag',
+ 'delete-link',
+ 'delete-meta',
+ 'delete-post',
+ 'trash-post',
+ 'untrash-post',
+ 'delete-page',
+ 'dim-comment',
+ 'add-link-category',
+ 'add-tag',
+ 'get-tagcloud',
+ 'get-comments',
+ 'replyto-comment',
+ 'edit-comment',
+ 'add-menu-item',
+ 'add-meta',
+ 'add-user',
+ 'closed-postboxes',
+ 'hidden-columns',
+ 'update-welcome-panel',
+ 'menu-get-metabox',
+ 'wp-link-ajax',
+ 'menu-locations-save',
+ 'menu-quick-search',
+ 'meta-box-order',
+ 'get-permalink',
+ 'sample-permalink',
+ 'inline-save',
+ 'inline-save-tax',
+ 'find_posts',
+ 'widgets-order',
+ 'save-widget',
+ 'delete-inactive-widgets',
+ 'set-post-thumbnail',
+ 'date_format',
+ 'time_format',
+ 'wp-remove-post-lock',
+ 'dismiss-wp-pointer',
+ 'upload-attachment',
+ 'get-attachment',
+ 'query-attachments',
+ 'save-attachment',
+ 'save-attachment-compat',
+ 'send-link-to-editor',
+ 'send-attachment-to-editor',
+ 'save-attachment-order',
+ 'heartbeat',
+ 'get-revision-diffs',
+ 'save-user-color-scheme',
+ 'update-widget',
+ 'query-themes',
+ 'parse-embed',
+ 'set-attachment-thumbnail',
+ 'parse-media-shortcode',
+ 'destroy-sessions',
+ 'install-plugin',
+ 'update-plugin',
+ 'crop-image',
+ 'generate-password',
+ 'save-wporg-username',
+ 'delete-plugin',
+ 'search-plugins',
+ 'search-install-plugins',
+ 'activate-plugin',
+ 'update-theme',
+ 'delete-theme',
+ 'install-theme',
+ 'get-post-thumbnail-html',
+ 'get-community-events',
+ 'edit-theme-plugin-file',
+ 'wp-privacy-export-personal-data',
+ 'wp-privacy-erase-personal-data',
+ 'health-check-site-status-result',
+ 'health-check-dotorg-communication',
+ 'health-check-is-in-debug-mode',
+ 'health-check-background-updates',
+ 'health-check-loopback-requests',
+ 'health-check-get-sizes',
+);
+
+// Deprecated
+$core_actions_post_deprecated = array( 'wp-fullscreen-save-post', 'press-this-save-post', 'press-this-add-category' );
+$core_actions_post = array_merge( $core_actions_post, $core_actions_post_deprecated );
+
+// Register core Ajax calls.
+if ( ! empty( $_GET['action'] ) && in_array( $_GET['action'], $core_actions_get ) ) {
+ add_action( 'wp_ajax_' . $_GET['action'], 'wp_ajax_' . str_replace( '-', '_', $_GET['action'] ), 1 );
+}
+
+if ( ! empty( $_POST['action'] ) && in_array( $_POST['action'], $core_actions_post ) ) {
+ add_action( 'wp_ajax_' . $_POST['action'], 'wp_ajax_' . str_replace( '-', '_', $_POST['action'] ), 1 );
+}
+
+add_action( 'wp_ajax_nopriv_heartbeat', 'wp_ajax_nopriv_heartbeat', 1 );
+
+$action = ( isset( $_REQUEST['action'] ) ) ? $_REQUEST['action'] : '';
+
+if ( is_user_logged_in() ) {
+ // If no action is registered, return a Bad Request response.
+ if ( ! has_action( "wp_ajax_{$action}" ) ) {
+ wp_die( '0', 400 );
+ }
+
+ /**
+ * Fires authenticated Ajax actions for logged-in users.
+ *
+ * The dynamic portion of the hook name, `$action`, refers
+ * to the name of the Ajax action callback being fired.
+ *
+ * @since 2.1.0
+ */
+ do_action( "wp_ajax_{$action}" );
+} else {
+ // If no action is registered, return a Bad Request response.
+ if ( ! has_action( "wp_ajax_nopriv_{$action}" ) ) {
+ wp_die( '0', 400 );
+ }
+
+ /**
+ * Fires non-authenticated Ajax actions for logged-out users.
+ *
+ * The dynamic portion of the hook name, `$action`, refers
+ * to the name of the Ajax action callback being fired.
+ *
+ * @since 2.8.0
+ */
+ do_action( "wp_ajax_nopriv_{$action}" );
+}
+// Default status
+wp_die( '0' );
diff --git a/www/crm/wp-admin/admin-footer.php b/www/crm/wp-admin/admin-footer.php
new file mode 100644
index 00000000..6014d176
--- /dev/null
+++ b/www/crm/wp-admin/admin-footer.php
@@ -0,0 +1,114 @@
+<?php
+/**
+ * WordPress Administration Template Footer
+ *
+ * @package WordPress
+ * @subpackage Administration
+ */
+
+// don't load directly
+if ( ! defined( 'ABSPATH' ) ) {
+ die( '-1' );
+}
+
+/**
+ * @global string $hook_suffix
+ */
+global $hook_suffix;
+?>
+
+<div class="clear"></div></div><!-- wpbody-content -->
+<div class="clear"></div></div><!-- wpbody -->
+<div class="clear"></div></div><!-- wpcontent -->
+
+<div id="wpfooter" role="contentinfo">
+ <?php
+ /**
+ * Fires after the opening tag for the admin footer.
+ *
+ * @since 2.5.0
+ */
+ do_action( 'in_admin_footer' );
+ ?>
+ <p id="footer-left" class="alignleft">
+ <?php
+ $text = sprintf( __( 'Thank you for creating with <a href="%s">WordPress</a>.' ), __( 'https://wordpress.org/' ) );
+ /**
+ * Filters the "Thank you" text displayed in the admin footer.
+ *
+ * @since 2.8.0
+ *
+ * @param string $text The content that will be printed.
+ */
+ echo apply_filters( 'admin_footer_text', '<span id="footer-thankyou">' . $text . '</span>' );
+ ?>
+ </p>
+ <p id="footer-upgrade" class="alignright">
+ <?php
+ /**
+ * Filters the version/update text displayed in the admin footer.
+ *
+ * WordPress prints the current version and update information,
+ * using core_update_footer() at priority 10.
+ *
+ * @since 2.3.0
+ *
+ * @see core_update_footer()
+ *
+ * @param string $content The content that will be printed.
+ */
+ echo apply_filters( 'update_footer', '' );
+ ?>
+ </p>
+ <div class="clear"></div>
+</div>
+<?php
+/**
+ * Prints scripts or data before the default footer scripts.
+ *
+ * @since 1.2.0
+ *
+ * @param string $data The data to print.
+ */
+do_action( 'admin_footer', '' );
+
+/**
+ * Prints scripts and data queued for the footer.
+ *
+ * The dynamic portion of the hook name, `$hook_suffix`,
+ * refers to the global hook suffix of the current page.
+ *
+ * @since 4.6.0
+ */
+do_action( "admin_print_footer_scripts-{$hook_suffix}" );
+
+/**
+ * Prints any scripts and data queued for the footer.
+ *
+ * @since 2.8.0
+ */
+do_action( 'admin_print_footer_scripts' );
+
+/**
+ * Prints scripts or data after the default footer scripts.
+ *
+ * The dynamic portion of the hook name, `$hook_suffix`,
+ * refers to the global hook suffix of the current page.
+ *
+ * @since 2.8.0
+ */
+do_action( "admin_footer-{$hook_suffix}" );
+
+// get_site_option() won't exist when auto upgrading from <= 2.7
+if ( function_exists( 'get_site_option' ) ) {
+ if ( false === get_site_option( 'can_compress_scripts' ) ) {
+ compression_test();
+ }
+}
+
+?>
+
+<div class="clear"></div></div><!-- wpwrap -->
+<script type="text/javascript">if(typeof wpOnload=='function')wpOnload();</script>
+</body>
+</html>
diff --git a/www/crm/wp-admin/admin-functions.php b/www/crm/wp-admin/admin-functions.php
new file mode 100644
index 00000000..11852687
--- /dev/null
+++ b/www/crm/wp-admin/admin-functions.php
@@ -0,0 +1,15 @@
+<?php
+/**
+ * Administration Functions
+ *
+ * This file is deprecated, use 'wp-admin/includes/admin.php' instead.
+ *
+ * @deprecated 2.5.0
+ * @package WordPress
+ * @subpackage Administration
+ */
+
+_deprecated_file( basename( __FILE__ ), '2.5.0', 'wp-admin/includes/admin.php' );
+
+/** WordPress Administration API: Includes all Administration functions. */
+require_once( ABSPATH . 'wp-admin/includes/admin.php' );
diff --git a/www/crm/wp-admin/admin-header.php b/www/crm/wp-admin/admin-header.php
new file mode 100644
index 00000000..d8ebb794
--- /dev/null
+++ b/www/crm/wp-admin/admin-header.php
@@ -0,0 +1,293 @@
+<?php
+/**
+ * WordPress Administration Template Header
+ *
+ * @package WordPress
+ * @subpackage Administration
+ */
+
+@header( 'Content-Type: ' . get_option( 'html_type' ) . '; charset=' . get_option( 'blog_charset' ) );
+if ( ! defined( 'WP_ADMIN' ) ) {
+ require_once( dirname( __FILE__ ) . '/admin.php' );
+}
+
+/**
+ * In case admin-header.php is included in a function.
+ *
+ * @global string $title
+ * @global string $hook_suffix
+ * @global WP_Screen $current_screen
+ * @global WP_Locale $wp_locale
+ * @global string $pagenow
+ * @global string $update_title
+ * @global int $total_update_count
+ * @global string $parent_file
+ */
+global $title, $hook_suffix, $current_screen, $wp_locale, $pagenow,
+ $update_title, $total_update_count, $parent_file;
+
+// Catch plugins that include admin-header.php before admin.php completes.
+if ( empty( $current_screen ) ) {
+ set_current_screen();
+}
+
+get_admin_page_title();
+$title = esc_html( strip_tags( $title ) );
+
+if ( is_network_admin() ) {
+ /* translators: Network admin screen title. %s: Network name */
+ $admin_title = sprintf( __( 'Network Admin: %s' ), esc_html( get_network()->site_name ) );
+} elseif ( is_user_admin() ) {
+ /* translators: User dashboard screen title. %s: Network name */
+ $admin_title = sprintf( __( 'User Dashboard: %s' ), esc_html( get_network()->site_name ) );
+} else {
+ $admin_title = get_bloginfo( 'name' );
+}
+
+if ( $admin_title == $title ) {
+ /* translators: Admin screen title. %s: Admin screen name */
+ $admin_title = sprintf( __( '%s &#8212; WordPress' ), $title );
+} else {
+ /* translators: Admin screen title. 1: Admin screen name, 2: Network or site name */
+ $admin_title = sprintf( __( '%1$s &lsaquo; %2$s &#8212; WordPress' ), $title, $admin_title );
+}
+
+if ( wp_is_recovery_mode() ) {
+ /* translators: %s: Admin screen title. */
+ $admin_title = sprintf( __( 'Recovery Mode &#8212; %s' ), $admin_title );
+}
+
+/**
+ * Filters the title tag content for an admin page.
+ *
+ * @since 3.1.0
+ *
+ * @param string $admin_title The page title, with extra context added.
+ * @param string $title The original page title.
+ */
+$admin_title = apply_filters( 'admin_title', $admin_title, $title );
+
+wp_user_settings();
+
+_wp_admin_html_begin();
+?>
+<title><?php echo $admin_title; ?></title>
+<?php
+
+wp_enqueue_style( 'colors' );
+wp_enqueue_style( 'ie' );
+wp_enqueue_script( 'utils' );
+wp_enqueue_script( 'svg-painter' );
+
+$admin_body_class = preg_replace( '/[^a-z0-9_-]+/i', '-', $hook_suffix );
+?>
+<script type="text/javascript">
+addLoadEvent = function(func){if(typeof jQuery!="undefined")jQuery(document).ready(func);else if(typeof wpOnload!='function'){wpOnload=func;}else{var oldonload=wpOnload;wpOnload=function(){oldonload();func();}}};
+var ajaxurl = '<?php echo admin_url( 'admin-ajax.php', 'relative' ); ?>',
+ pagenow = '<?php echo $current_screen->id; ?>',
+ typenow = '<?php echo $current_screen->post_type; ?>',
+ adminpage = '<?php echo $admin_body_class; ?>',
+ thousandsSeparator = '<?php echo addslashes( $wp_locale->number_format['thousands_sep'] ); ?>',
+ decimalPoint = '<?php echo addslashes( $wp_locale->number_format['decimal_point'] ); ?>',
+ isRtl = <?php echo (int) is_rtl(); ?>;
+</script>
+<meta name="viewport" content="width=device-width,initial-scale=1.0">
+<?php
+
+/**
+ * Enqueue scripts for all admin pages.
+ *
+ * @since 2.8.0
+ *
+ * @param string $hook_suffix The current admin page.
+ */
+do_action( 'admin_enqueue_scripts', $hook_suffix );
+
+/**
+ * Fires when styles are printed for a specific admin page based on $hook_suffix.
+ *
+ * @since 2.6.0
+ */
+do_action( "admin_print_styles-{$hook_suffix}" );
+
+/**
+ * Fires when styles are printed for all admin pages.
+ *
+ * @since 2.6.0
+ */
+do_action( 'admin_print_styles' );
+
+/**
+ * Fires when scripts are printed for a specific admin page based on $hook_suffix.
+ *
+ * @since 2.1.0
+ */
+do_action( "admin_print_scripts-{$hook_suffix}" );
+
+/**
+ * Fires when scripts are printed for all admin pages.
+ *
+ * @since 2.1.0
+ */
+do_action( 'admin_print_scripts' );
+
+/**
+ * Fires in head section for a specific admin page.
+ *
+ * The dynamic portion of the hook, `$hook_suffix`, refers to the hook suffix
+ * for the admin page.
+ *
+ * @since 2.1.0
+ */
+do_action( "admin_head-{$hook_suffix}" );
+
+/**
+ * Fires in head section for all admin pages.
+ *
+ * @since 2.1.0
+ */
+do_action( 'admin_head' );
+
+if ( get_user_setting( 'mfold' ) == 'f' ) {
+ $admin_body_class .= ' folded';
+}
+
+if ( ! get_user_setting( 'unfold' ) ) {
+ $admin_body_class .= ' auto-fold';
+}
+
+if ( is_admin_bar_showing() ) {
+ $admin_body_class .= ' admin-bar';
+}
+
+if ( is_rtl() ) {
+ $admin_body_class .= ' rtl';
+}
+
+if ( $current_screen->post_type ) {
+ $admin_body_class .= ' post-type-' . $current_screen->post_type;
+}
+
+if ( $current_screen->taxonomy ) {
+ $admin_body_class .= ' taxonomy-' . $current_screen->taxonomy;
+}
+
+$admin_body_class .= ' branch-' . str_replace( array( '.', ',' ), '-', floatval( get_bloginfo( 'version' ) ) );
+$admin_body_class .= ' version-' . str_replace( '.', '-', preg_replace( '/^([.0-9]+).*/', '$1', get_bloginfo( 'version' ) ) );
+$admin_body_class .= ' admin-color-' . sanitize_html_class( get_user_option( 'admin_color' ), 'fresh' );
+$admin_body_class .= ' locale-' . sanitize_html_class( strtolower( str_replace( '_', '-', get_user_locale() ) ) );
+
+if ( wp_is_mobile() ) {
+ $admin_body_class .= ' mobile';
+}
+
+if ( is_multisite() ) {
+ $admin_body_class .= ' multisite';
+}
+
+if ( is_network_admin() ) {
+ $admin_body_class .= ' network-admin';
+}
+
+$admin_body_class .= ' no-customize-support no-svg';
+
+if ( $current_screen->is_block_editor() ) {
+ // Default to is-fullscreen-mode to avoid jumps in the UI.
+ $admin_body_class .= ' block-editor-page is-fullscreen-mode wp-embed-responsive';
+
+ if ( current_theme_supports( 'editor-styles' ) && current_theme_supports( 'dark-editor-style' ) ) {
+ $admin_body_class .= ' is-dark-theme';
+ }
+}
+
+?>
+</head>
+<?php
+/**
+ * Filters the CSS classes for the body tag in the admin.
+ *
+ * This filter differs from the {@see 'post_class'} and {@see 'body_class'} filters
+ * in two important ways:
+ *
+ * 1. `$classes` is a space-separated string of class names instead of an array.
+ * 2. Not all core admin classes are filterable, notably: wp-admin, wp-core-ui,
+ * and no-js cannot be removed.
+ *
+ * @since 2.3.0
+ *
+ * @param string $classes Space-separated list of CSS classes.
+ */
+$admin_body_classes = apply_filters( 'admin_body_class', '' );
+$admin_body_classes = ltrim( $admin_body_classes . ' ' . $admin_body_class );
+?>
+<body class="wp-admin wp-core-ui no-js <?php echo $admin_body_classes; ?>">
+<script type="text/javascript">
+ document.body.className = document.body.className.replace('no-js','js');
+</script>
+
+<?php
+// Make sure the customize body classes are correct as early as possible.
+if ( current_user_can( 'customize' ) ) {
+ wp_customize_support_script();
+}
+?>
+
+<div id="wpwrap">
+<?php require( ABSPATH . 'wp-admin/menu-header.php' ); ?>
+<div id="wpcontent">
+
+<?php
+/**
+ * Fires at the beginning of the content section in an admin page.
+ *
+ * @since 3.0.0
+ */
+do_action( 'in_admin_header' );
+?>
+
+<div id="wpbody" role="main">
+<?php
+unset( $blog_name, $total_update_count, $update_title );
+
+$current_screen->set_parentage( $parent_file );
+
+?>
+
+<div id="wpbody-content">
+<?php
+
+$current_screen->render_screen_meta();
+
+if ( is_network_admin() ) {
+ /**
+ * Prints network admin screen notices.
+ *
+ * @since 3.1.0
+ */
+ do_action( 'network_admin_notices' );
+} elseif ( is_user_admin() ) {
+ /**
+ * Prints user admin screen notices.
+ *
+ * @since 3.1.0
+ */
+ do_action( 'user_admin_notices' );
+} else {
+ /**
+ * Prints admin screen notices.
+ *
+ * @since 3.1.0
+ */
+ do_action( 'admin_notices' );
+}
+
+/**
+ * Prints generic admin screen notices.
+ *
+ * @since 3.1.0
+ */
+do_action( 'all_admin_notices' );
+
+if ( $parent_file == 'options-general.php' ) {
+ require( ABSPATH . 'wp-admin/options-head.php' );
+}
diff --git a/www/crm/wp-admin/admin-post.php b/www/crm/wp-admin/admin-post.php
new file mode 100644
index 00000000..48e76fee
--- /dev/null
+++ b/www/crm/wp-admin/admin-post.php
@@ -0,0 +1,72 @@
+<?php
+/**
+ * WordPress Generic Request (POST/GET) Handler
+ *
+ * Intended for form submission handling in themes and plugins.
+ *
+ * @package WordPress
+ * @subpackage Administration
+ */
+
+/** We are located in WordPress Administration Screens */
+if ( ! defined( 'WP_ADMIN' ) ) {
+ define( 'WP_ADMIN', true );
+}
+
+if ( defined( 'ABSPATH' ) ) {
+ require_once( ABSPATH . 'wp-load.php' );
+} else {
+ require_once( dirname( dirname( __FILE__ ) ) . '/wp-load.php' );
+}
+
+/** Allow for cross-domain requests (from the front end). */
+send_origin_headers();
+
+require_once( ABSPATH . 'wp-admin/includes/admin.php' );
+
+nocache_headers();
+
+/** This action is documented in wp-admin/admin.php */
+do_action( 'admin_init' );
+
+$action = empty( $_REQUEST['action'] ) ? '' : $_REQUEST['action'];
+
+if ( ! is_user_logged_in() ) {
+ if ( empty( $action ) ) {
+ /**
+ * Fires on a non-authenticated admin post request where no action is supplied.
+ *
+ * @since 2.6.0
+ */
+ do_action( 'admin_post_nopriv' );
+ } else {
+ /**
+ * Fires on a non-authenticated admin post request for the given action.
+ *
+ * The dynamic portion of the hook name, `$action`, refers to the given
+ * request action.
+ *
+ * @since 2.6.0
+ */
+ do_action( "admin_post_nopriv_{$action}" );
+ }
+} else {
+ if ( empty( $action ) ) {
+ /**
+ * Fires on an authenticated admin post request where no action is supplied.
+ *
+ * @since 2.6.0
+ */
+ do_action( 'admin_post' );
+ } else {
+ /**
+ * Fires on an authenticated admin post request for the given action.
+ *
+ * The dynamic portion of the hook name, `$action`, refers to the given
+ * request action.
+ *
+ * @since 2.6.0
+ */
+ do_action( "admin_post_{$action}" );
+ }
+}
diff --git a/www/crm/wp-admin/admin.php b/www/crm/wp-admin/admin.php
new file mode 100644
index 00000000..bac33a18
--- /dev/null
+++ b/www/crm/wp-admin/admin.php
@@ -0,0 +1,400 @@
+<?php
+/**
+ * WordPress Administration Bootstrap
+ *
+ * @package WordPress
+ * @subpackage Administration
+ */
+
+/**
+ * In WordPress Administration Screens
+ *
+ * @since 2.3.2
+ */
+if ( ! defined( 'WP_ADMIN' ) ) {
+ define( 'WP_ADMIN', true );
+}
+
+if ( ! defined( 'WP_NETWORK_ADMIN' ) ) {
+ define( 'WP_NETWORK_ADMIN', false );
+}
+
+if ( ! defined( 'WP_USER_ADMIN' ) ) {
+ define( 'WP_USER_ADMIN', false );
+}
+
+if ( ! WP_NETWORK_ADMIN && ! WP_USER_ADMIN ) {
+ define( 'WP_BLOG_ADMIN', true );
+}
+
+if ( isset( $_GET['import'] ) && ! defined( 'WP_LOAD_IMPORTERS' ) ) {
+ define( 'WP_LOAD_IMPORTERS', true );
+}
+
+require_once( dirname( dirname( __FILE__ ) ) . '/wp-load.php' );
+
+nocache_headers();
+
+if ( get_option( 'db_upgraded' ) ) {
+ flush_rewrite_rules();
+ update_option( 'db_upgraded', false );
+
+ /**
+ * Fires on the next page load after a successful DB upgrade.
+ *
+ * @since 2.8.0
+ */
+ do_action( 'after_db_upgrade' );
+} elseif ( get_option( 'db_version' ) != $wp_db_version && empty( $_POST ) ) {
+ if ( ! is_multisite() ) {
+ wp_redirect( admin_url( 'upgrade.php?_wp_http_referer=' . urlencode( wp_unslash( $_SERVER['REQUEST_URI'] ) ) ) );
+ exit;
+
+ /**
+ * Filters whether to attempt to perform the multisite DB upgrade routine.
+ *
+ * In single site, the user would be redirected to wp-admin/upgrade.php.
+ * In multisite, the DB upgrade routine is automatically fired, but only
+ * when this filter returns true.
+ *
+ * If the network is 50 sites or less, it will run every time. Otherwise,
+ * it will throttle itself to reduce load.
+ *
+ * @since 3.0.0
+ *
+ * @param bool $do_mu_upgrade Whether to perform the Multisite upgrade routine. Default true.
+ */
+ } elseif ( apply_filters( 'do_mu_upgrade', true ) ) {
+ $c = get_blog_count();
+
+ /*
+ * If there are 50 or fewer sites, run every time. Otherwise, throttle to reduce load:
+ * attempt to do no more than threshold value, with some +/- allowed.
+ */
+ if ( $c <= 50 || ( $c > 50 && mt_rand( 0, (int) ( $c / 50 ) ) == 1 ) ) {
+ require_once( ABSPATH . WPINC . '/http.php' );
+ $response = wp_remote_get(
+ admin_url( 'upgrade.php?step=1' ),
+ array(
+ 'timeout' => 120,
+ 'httpversion' => '1.1',
+ )
+ );
+ /** This action is documented in wp-admin/network/upgrade.php */
+ do_action( 'after_mu_upgrade', $response );
+ unset( $response );
+ }
+ unset( $c );
+ }
+}
+
+require_once( ABSPATH . 'wp-admin/includes/admin.php' );
+
+auth_redirect();
+
+// Schedule trash collection
+if ( ! wp_next_scheduled( 'wp_scheduled_delete' ) && ! wp_installing() ) {
+ wp_schedule_event( time(), 'daily', 'wp_scheduled_delete' );
+}
+
+// Schedule Transient cleanup.
+if ( ! wp_next_scheduled( 'delete_expired_transients' ) && ! wp_installing() ) {
+ wp_schedule_event( time(), 'daily', 'delete_expired_transients' );
+}
+
+set_screen_options();
+
+$date_format = __( 'F j, Y' );
+$time_format = __( 'g:i a' );
+
+wp_enqueue_script( 'common' );
+
+/**
+ * $pagenow is set in vars.php
+ * $wp_importers is sometimes set in wp-admin/includes/import.php
+ * The remaining variables are imported as globals elsewhere, declared as globals here
+ *
+ * @global string $pagenow
+ * @global array $wp_importers
+ * @global string $hook_suffix
+ * @global string $plugin_page
+ * @global string $typenow
+ * @global string $taxnow
+ */
+global $pagenow, $wp_importers, $hook_suffix, $plugin_page, $typenow, $taxnow;
+
+$page_hook = null;
+
+$editing = false;
+
+if ( isset( $_GET['page'] ) ) {
+ $plugin_page = wp_unslash( $_GET['page'] );
+ $plugin_page = plugin_basename( $plugin_page );
+}
+
+if ( isset( $_REQUEST['post_type'] ) && post_type_exists( $_REQUEST['post_type'] ) ) {
+ $typenow = $_REQUEST['post_type'];
+} else {
+ $typenow = '';
+}
+
+if ( isset( $_REQUEST['taxonomy'] ) && taxonomy_exists( $_REQUEST['taxonomy'] ) ) {
+ $taxnow = $_REQUEST['taxonomy'];
+} else {
+ $taxnow = '';
+}
+
+if ( WP_NETWORK_ADMIN ) {
+ require( ABSPATH . 'wp-admin/network/menu.php' );
+} elseif ( WP_USER_ADMIN ) {
+ require( ABSPATH . 'wp-admin/user/menu.php' );
+} else {
+ require( ABSPATH . 'wp-admin/menu.php' );
+}
+
+if ( current_user_can( 'manage_options' ) ) {
+ wp_raise_memory_limit( 'admin' );
+}
+
+/**
+ * Fires as an admin screen or script is being initialized.
+ *
+ * Note, this does not just run on user-facing admin screens.
+ * It runs on admin-ajax.php and admin-post.php as well.
+ *
+ * This is roughly analogous to the more general {@see 'init'} hook, which fires earlier.
+ *
+ * @since 2.5.0
+ */
+do_action( 'admin_init' );
+
+if ( isset( $plugin_page ) ) {
+ if ( ! empty( $typenow ) ) {
+ $the_parent = $pagenow . '?post_type=' . $typenow;
+ } else {
+ $the_parent = $pagenow;
+ }
+
+ $page_hook = get_plugin_page_hook( $plugin_page, $the_parent );
+ if ( ! $page_hook ) {
+ $page_hook = get_plugin_page_hook( $plugin_page, $plugin_page );
+
+ // Back-compat for plugins using add_management_page().
+ if ( empty( $page_hook ) && 'edit.php' == $pagenow && '' != get_plugin_page_hook( $plugin_page, 'tools.php' ) ) {
+ // There could be plugin specific params on the URL, so we need the whole query string
+ if ( ! empty( $_SERVER['QUERY_STRING'] ) ) {
+ $query_string = $_SERVER['QUERY_STRING'];
+ } else {
+ $query_string = 'page=' . $plugin_page;
+ }
+ wp_redirect( admin_url( 'tools.php?' . $query_string ) );
+ exit;
+ }
+ }
+ unset( $the_parent );
+}
+
+$hook_suffix = '';
+if ( isset( $page_hook ) ) {
+ $hook_suffix = $page_hook;
+} elseif ( isset( $plugin_page ) ) {
+ $hook_suffix = $plugin_page;
+} elseif ( isset( $pagenow ) ) {
+ $hook_suffix = $pagenow;
+}
+
+set_current_screen();
+
+// Handle plugin admin pages.
+if ( isset( $plugin_page ) ) {
+ if ( $page_hook ) {
+ /**
+ * Fires before a particular screen is loaded.
+ *
+ * The load-* hook fires in a number of contexts. This hook is for plugin screens
+ * where a callback is provided when the screen is registered.
+ *
+ * The dynamic portion of the hook name, `$page_hook`, refers to a mixture of plugin
+ * page information including:
+ * 1. The page type. If the plugin page is registered as a submenu page, such as for
+ * Settings, the page type would be 'settings'. Otherwise the type is 'toplevel'.
+ * 2. A separator of '_page_'.
+ * 3. The plugin basename minus the file extension.
+ *
+ * Together, the three parts form the `$page_hook`. Citing the example above,
+ * the hook name used would be 'load-settings_page_pluginbasename'.
+ *
+ * @see get_plugin_page_hook()
+ *
+ * @since 2.1.0
+ */
+ do_action( "load-{$page_hook}" );
+ if ( ! isset( $_GET['noheader'] ) ) {
+ require_once( ABSPATH . 'wp-admin/admin-header.php' );
+ }
+
+ /**
+ * Used to call the registered callback for a plugin screen.
+ *
+ * This hook uses a dynamic hook name, `$page_hook`, which refers to a mixture of plugin
+ * page information including:
+ * 1. The page type. If the plugin page is registered as a submenu page, such as for
+ * Settings, the page type would be 'settings'. Otherwise the type is 'toplevel'.
+ * 2. A separator of '_page_'.
+ * 3. The plugin basename minus the file extension.
+ *
+ * Together, the three parts form the `$page_hook`. Citing the example above,
+ * the hook name used would be 'settings_page_pluginbasename'.
+ *
+ * @see get_plugin_page_hook()
+ *
+ * @since 1.5.0
+ */
+ do_action( $page_hook );
+ } else {
+ if ( validate_file( $plugin_page ) ) {
+ wp_die( __( 'Invalid plugin page.' ) );
+ }
+
+ if ( ! ( file_exists( WP_PLUGIN_DIR . "/$plugin_page" ) && is_file( WP_PLUGIN_DIR . "/$plugin_page" ) ) && ! ( file_exists( WPMU_PLUGIN_DIR . "/$plugin_page" ) && is_file( WPMU_PLUGIN_DIR . "/$plugin_page" ) ) ) {
+ wp_die( sprintf( __( 'Cannot load %s.' ), htmlentities( $plugin_page ) ) );
+ }
+
+ /**
+ * Fires before a particular screen is loaded.
+ *
+ * The load-* hook fires in a number of contexts. This hook is for plugin screens
+ * where the file to load is directly included, rather than the use of a function.
+ *
+ * The dynamic portion of the hook name, `$plugin_page`, refers to the plugin basename.
+ *
+ * @see plugin_basename()
+ *
+ * @since 1.5.0
+ */
+ do_action( "load-{$plugin_page}" );
+
+ if ( ! isset( $_GET['noheader'] ) ) {
+ require_once( ABSPATH . 'wp-admin/admin-header.php' );
+ }
+
+ if ( file_exists( WPMU_PLUGIN_DIR . "/$plugin_page" ) ) {
+ include( WPMU_PLUGIN_DIR . "/$plugin_page" );
+ } else {
+ include( WP_PLUGIN_DIR . "/$plugin_page" );
+ }
+ }
+
+ include( ABSPATH . 'wp-admin/admin-footer.php' );
+
+ exit();
+} elseif ( isset( $_GET['import'] ) ) {
+
+ $importer = $_GET['import'];
+
+ if ( ! current_user_can( 'import' ) ) {
+ wp_die( __( 'Sorry, you are not allowed to import content.' ) );
+ }
+
+ if ( validate_file( $importer ) ) {
+ wp_redirect( admin_url( 'import.php?invalid=' . $importer ) );
+ exit;
+ }
+
+ if ( ! isset( $wp_importers[ $importer ] ) || ! is_callable( $wp_importers[ $importer ][2] ) ) {
+ wp_redirect( admin_url( 'import.php?invalid=' . $importer ) );
+ exit;
+ }
+
+ /**
+ * Fires before an importer screen is loaded.
+ *
+ * The dynamic portion of the hook name, `$importer`, refers to the importer slug.
+ *
+ * @since 3.5.0
+ */
+ do_action( "load-importer-{$importer}" );
+
+ $parent_file = 'tools.php';
+ $submenu_file = 'import.php';
+ $title = __( 'Import' );
+
+ if ( ! isset( $_GET['noheader'] ) ) {
+ require_once( ABSPATH . 'wp-admin/admin-header.php' );
+ }
+
+ require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
+
+ define( 'WP_IMPORTING', true );
+
+ /**
+ * Whether to filter imported data through kses on import.
+ *
+ * Multisite uses this hook to filter all data through kses by default,
+ * as a super administrator may be assisting an untrusted user.
+ *
+ * @since 3.1.0
+ *
+ * @param bool $force Whether to force data to be filtered through kses. Default false.
+ */
+ if ( apply_filters( 'force_filtered_html_on_import', false ) ) {
+ kses_init_filters(); // Always filter imported data with kses on multisite.
+ }
+
+ call_user_func( $wp_importers[ $importer ][2] );
+
+ include( ABSPATH . 'wp-admin/admin-footer.php' );
+
+ // Make sure rules are flushed
+ flush_rewrite_rules( false );
+
+ exit();
+} else {
+ /**
+ * Fires before a particular screen is loaded.
+ *
+ * The load-* hook fires in a number of contexts. This hook is for core screens.
+ *
+ * The dynamic portion of the hook name, `$pagenow`, is a global variable
+ * referring to the filename of the current page, such as 'admin.php',
+ * 'post-new.php' etc. A complete hook for the latter would be
+ * 'load-post-new.php'.
+ *
+ * @since 2.1.0
+ */
+ do_action( "load-{$pagenow}" );
+
+ /*
+ * The following hooks are fired to ensure backward compatibility.
+ * In all other cases, 'load-' . $pagenow should be used instead.
+ */
+ if ( $typenow == 'page' ) {
+ if ( $pagenow == 'post-new.php' ) {
+ do_action( 'load-page-new.php' );
+ } elseif ( $pagenow == 'post.php' ) {
+ do_action( 'load-page.php' );
+ }
+ } elseif ( $pagenow == 'edit-tags.php' ) {
+ if ( $taxnow == 'category' ) {
+ do_action( 'load-categories.php' );
+ } elseif ( $taxnow == 'link_category' ) {
+ do_action( 'load-edit-link-categories.php' );
+ }
+ } elseif ( 'term.php' === $pagenow ) {
+ do_action( 'load-edit-tags.php' );
+ }
+}
+
+if ( ! empty( $_REQUEST['action'] ) ) {
+ $action = $_REQUEST['action'];
+
+ /**
+ * Fires when an 'action' request variable is sent.
+ *
+ * The dynamic portion of the hook name, `$action`, refers to
+ * the action derived from the `GET` or `POST` request.
+ *
+ * @since 2.6.0
+ */
+ do_action( "admin_action_{$action}" );
+}
diff --git a/www/crm/wp-admin/async-upload.php b/www/crm/wp-admin/async-upload.php
new file mode 100644
index 00000000..81b0cc1a
--- /dev/null
+++ b/www/crm/wp-admin/async-upload.php
@@ -0,0 +1,118 @@
+<?php
+/**
+ * Server-side file upload handler from wp-plupload or other asynchronous upload methods.
+ *
+ * @package WordPress
+ * @subpackage Administration
+ */
+
+if ( isset( $_REQUEST['action'] ) && 'upload-attachment' === $_REQUEST['action'] ) {
+ define( 'DOING_AJAX', true );
+}
+
+if ( ! defined( 'WP_ADMIN' ) ) {
+ define( 'WP_ADMIN', true );
+}
+
+if ( defined( 'ABSPATH' ) ) {
+ require_once( ABSPATH . 'wp-load.php' );
+} else {
+ require_once( dirname( dirname( __FILE__ ) ) . '/wp-load.php' );
+}
+
+require_once( ABSPATH . 'wp-admin/admin.php' );
+
+header( 'Content-Type: text/plain; charset=' . get_option( 'blog_charset' ) );
+
+if ( isset( $_REQUEST['action'] ) && 'upload-attachment' === $_REQUEST['action'] ) {
+ include( ABSPATH . 'wp-admin/includes/ajax-actions.php' );
+
+ send_nosniff_header();
+ nocache_headers();
+
+ wp_ajax_upload_attachment();
+ die( '0' );
+}
+
+if ( ! current_user_can( 'upload_files' ) ) {
+ wp_die( __( 'Sorry, you are not allowed to upload files.' ) );
+}
+
+// just fetch the detail form for that attachment
+if ( isset( $_REQUEST['attachment_id'] ) && ( $id = intval( $_REQUEST['attachment_id'] ) ) && $_REQUEST['fetch'] ) {
+ $post = get_post( $id );
+ if ( 'attachment' != $post->post_type ) {
+ wp_die( __( 'Invalid post type.' ) );
+ }
+ if ( ! current_user_can( 'edit_post', $id ) ) {
+ wp_die( __( 'Sorry, you are not allowed to edit this item.' ) );
+ }
+
+ switch ( $_REQUEST['fetch'] ) {
+ case 3:
+ if ( $thumb_url = wp_get_attachment_image_src( $id, 'thumbnail', true ) ) {
+ echo '<img class="pinkynail" src="' . esc_url( $thumb_url[0] ) . '" alt="" />';
+ }
+ echo '<a class="edit-attachment" href="' . esc_url( get_edit_post_link( $id ) ) . '" target="_blank">' . _x( 'Edit', 'media item' ) . '</a>';
+
+ // Title shouldn't ever be empty, but use filename just in case.
+ $file = get_attached_file( $post->ID );
+ $title = $post->post_title ? $post->post_title : wp_basename( $file );
+ echo '<div class="filename new"><span class="title">' . esc_html( wp_html_excerpt( $title, 60, '&hellip;' ) ) . '</span></div>';
+ break;
+ case 2:
+ add_filter( 'attachment_fields_to_edit', 'media_single_attachment_fields_to_edit', 10, 2 );
+ echo get_media_item(
+ $id,
+ array(
+ 'send' => false,
+ 'delete' => true,
+ )
+ );
+ break;
+ default:
+ add_filter( 'attachment_fields_to_edit', 'media_post_single_attachment_fields_to_edit', 10, 2 );
+ echo get_media_item( $id );
+ break;
+ }
+ exit;
+}
+
+check_admin_referer( 'media-form' );
+
+$post_id = 0;
+if ( isset( $_REQUEST['post_id'] ) ) {
+ $post_id = absint( $_REQUEST['post_id'] );
+ if ( ! get_post( $post_id ) || ! current_user_can( 'edit_post', $post_id ) ) {
+ $post_id = 0;
+ }
+}
+
+$id = media_handle_upload( 'async-upload', $post_id );
+if ( is_wp_error( $id ) ) {
+ echo '<div class="error-div error">
+ <button type="button" class="dismiss button-link" onclick="jQuery(this).parents(\'div.media-item\').slideUp(200, function(){jQuery(this).remove();});">' . __( 'Dismiss' ) . '</button>
+ <strong>' . sprintf( __( '&#8220;%s&#8221; has failed to upload.' ), esc_html( $_FILES['async-upload']['name'] ) ) . '</strong><br />' .
+ esc_html( $id->get_error_message() ) . '</div>';
+ exit;
+}
+
+if ( $_REQUEST['short'] ) {
+ // Short form response - attachment ID only.
+ echo $id;
+} else {
+ // Long form response - big chunk of html.
+ $type = $_REQUEST['type'];
+
+ /**
+ * Filters the returned ID of an uploaded attachment.
+ *
+ * The dynamic portion of the hook name, `$type`, refers to the attachment type,
+ * such as 'image', 'audio', 'video', 'file', etc.
+ *
+ * @since 2.5.0
+ *
+ * @param int $id Uploaded attachment ID.
+ */
+ echo apply_filters( "async_upload_{$type}", $id );
+}
diff --git a/www/crm/wp-admin/comment.php b/www/crm/wp-admin/comment.php
new file mode 100644
index 00000000..0b405c57
--- /dev/null
+++ b/www/crm/wp-admin/comment.php
@@ -0,0 +1,356 @@
+<?php
+/**
+ * Comment Management Screen
+ *
+ * @package WordPress
+ * @subpackage Administration
+ */
+
+/** Load WordPress Bootstrap */
+require_once( dirname( __FILE__ ) . '/admin.php' );
+
+$parent_file = 'edit-comments.php';
+$submenu_file = 'edit-comments.php';
+
+/**
+ * @global string $action
+ */
+global $action;
+wp_reset_vars( array( 'action' ) );
+
+if ( isset( $_POST['deletecomment'] ) ) {
+ $action = 'deletecomment';
+}
+
+if ( 'cdc' == $action ) {
+ $action = 'delete';
+} elseif ( 'mac' == $action ) {
+ $action = 'approve';
+}
+
+if ( isset( $_GET['dt'] ) ) {
+ if ( 'spam' == $_GET['dt'] ) {
+ $action = 'spam';
+ } elseif ( 'trash' == $_GET['dt'] ) {
+ $action = 'trash';
+ }
+}
+
+switch ( $action ) {
+
+ case 'editcomment':
+ $title = __( 'Edit Comment' );
+
+ get_current_screen()->add_help_tab(
+ array(
+ 'id' => 'overview',
+ 'title' => __( 'Overview' ),
+ 'content' =>
+ '<p>' . __( 'You can edit the information left in a comment if needed. This is often useful when you notice that a commenter has made a typographical error.' ) . '</p>' .
+ '<p>' . __( 'You can also moderate the comment from this screen using the Status box, where you can also change the timestamp of the comment.' ) . '</p>',
+ )
+ );
+
+ get_current_screen()->set_help_sidebar(
+ '<p><strong>' . __( 'For more information:' ) . '</strong></p>' .
+ '<p>' . __( '<a href="https://codex.wordpress.org/Administration_Screens#Comments">Documentation on Comments</a>' ) . '</p>' .
+ '<p>' . __( '<a href="https://wordpress.org/support/">Support</a>' ) . '</p>'
+ );
+
+ wp_enqueue_script( 'comment' );
+ require_once( ABSPATH . 'wp-admin/admin-header.php' );
+
+ $comment_id = absint( $_GET['c'] );
+
+ if ( ! $comment = get_comment( $comment_id ) ) {
+ comment_footer_die( __( 'Invalid comment ID.' ) . sprintf( ' <a href="%s">' . __( 'Go back' ) . '</a>.', 'javascript:history.go(-1)' ) );
+ }
+
+ if ( ! current_user_can( 'edit_comment', $comment_id ) ) {
+ comment_footer_die( __( 'Sorry, you are not allowed to edit this comment.' ) );
+ }
+
+ if ( 'trash' == $comment->comment_approved ) {
+ comment_footer_die( __( 'This comment is in the Trash. Please move it out of the Trash if you want to edit it.' ) );
+ }
+
+ $comment = get_comment_to_edit( $comment_id );
+
+ include( ABSPATH . 'wp-admin/edit-form-comment.php' );
+
+ break;
+
+ case 'delete':
+ case 'approve':
+ case 'trash':
+ case 'spam':
+ $title = __( 'Moderate Comment' );
+
+ $comment_id = absint( $_GET['c'] );
+
+ if ( ! $comment = get_comment( $comment_id ) ) {
+ wp_redirect( admin_url( 'edit-comments.php?error=1' ) );
+ die();
+ }
+
+ if ( ! current_user_can( 'edit_comment', $comment->comment_ID ) ) {
+ wp_redirect( admin_url( 'edit-comments.php?error=2' ) );
+ die();
+ }
+
+ // No need to re-approve/re-trash/re-spam a comment.
+ if ( $action == str_replace( '1', 'approve', $comment->comment_approved ) ) {
+ wp_redirect( admin_url( 'edit-comments.php?same=' . $comment_id ) );
+ die();
+ }
+
+ require_once( ABSPATH . 'wp-admin/admin-header.php' );
+
+ $formaction = $action . 'comment';
+ $nonce_action = 'approve' == $action ? 'approve-comment_' : 'delete-comment_';
+ $nonce_action .= $comment_id;
+
+ ?>
+ <div class="wrap">
+
+ <h1><?php echo esc_html( $title ); ?></h1>
+
+ <?php
+ switch ( $action ) {
+ case 'spam':
+ $caution_msg = __( 'You are about to mark the following comment as spam:' );
+ $button = _x( 'Mark as Spam', 'comment' );
+ break;
+ case 'trash':
+ $caution_msg = __( 'You are about to move the following comment to the Trash:' );
+ $button = __( 'Move to Trash' );
+ break;
+ case 'delete':
+ $caution_msg = __( 'You are about to delete the following comment:' );
+ $button = __( 'Permanently Delete Comment' );
+ break;
+ default:
+ $caution_msg = __( 'You are about to approve the following comment:' );
+ $button = __( 'Approve Comment' );
+ break;
+ }
+
+ if ( $comment->comment_approved != '0' ) { // if not unapproved
+ $message = '';
+ switch ( $comment->comment_approved ) {
+ case '1':
+ $message = __( 'This comment is currently approved.' );
+ break;
+ case 'spam':
+ $message = __( 'This comment is currently marked as spam.' );
+ break;
+ case 'trash':
+ $message = __( 'This comment is currently in the Trash.' );
+ break;
+ }
+ if ( $message ) {
+ echo '<div id="message" class="notice notice-info"><p>' . $message . '</p></div>';
+ }
+ }
+ ?>
+<div id="message" class="notice notice-warning"><p><strong><?php _e( 'Caution:' ); ?></strong> <?php echo $caution_msg; ?></p></div>
+
+<table class="form-table comment-ays">
+<tr>
+<th scope="row"><?php _e( 'Author' ); ?></th>
+<td><?php comment_author( $comment ); ?></td>
+</tr>
+ <?php if ( get_comment_author_email( $comment ) ) { ?>
+<tr>
+<th scope="row"><?php _e( 'Email' ); ?></th>
+<td><?php comment_author_email( $comment ); ?></td>
+</tr>
+<?php } ?>
+ <?php if ( get_comment_author_url( $comment ) ) { ?>
+<tr>
+<th scope="row"><?php _e( 'URL' ); ?></th>
+<td><a href="<?php comment_author_url( $comment ); ?>"><?php comment_author_url( $comment ); ?></a></td>
+</tr>
+<?php } ?>
+<tr>
+ <th scope="row"><?php /* translators: column name or table row header */ _e( 'In Response To' ); ?></th>
+ <td>
+ <?php
+ $post_id = $comment->comment_post_ID;
+ if ( current_user_can( 'edit_post', $post_id ) ) {
+ $post_link = "<a href='" . esc_url( get_edit_post_link( $post_id ) ) . "'>";
+ $post_link .= esc_html( get_the_title( $post_id ) ) . '</a>';
+ } else {
+ $post_link = esc_html( get_the_title( $post_id ) );
+ }
+ echo $post_link;
+
+ if ( $comment->comment_parent ) {
+ $parent = get_comment( $comment->comment_parent );
+ $parent_link = esc_url( get_comment_link( $parent ) );
+ $name = get_comment_author( $parent );
+ printf(
+ /* translators: %s: comment link */
+ ' | ' . __( 'In reply to %s.' ),
+ '<a href="' . $parent_link . '">' . $name . '</a>'
+ );
+ }
+ ?>
+ </td>
+ </tr>
+ <tr>
+ <th scope="row"><?php _e( 'Submitted on' ); ?></th>
+ <td>
+ <?php
+ /* translators: 1: comment date, 2: comment time */
+ $submitted = sprintf(
+ __( '%1$s at %2$s' ),
+ /* translators: comment date format. See https://secure.php.net/date */
+ get_comment_date( __( 'Y/m/d' ), $comment ),
+ get_comment_date( __( 'g:i a' ), $comment )
+ );
+ if ( 'approved' === wp_get_comment_status( $comment ) && ! empty( $comment->comment_post_ID ) ) {
+ echo '<a href="' . esc_url( get_comment_link( $comment ) ) . '">' . $submitted . '</a>';
+ } else {
+ echo $submitted;
+ }
+ ?>
+ </td>
+ </tr>
+ <tr>
+ <th scope="row"><?php /* translators: field name in comment form */ _ex( 'Comment', 'noun' ); ?></th>
+ <td class="comment-content">
+ <?php comment_text( $comment ); ?>
+ <p class="edit-comment"><a href="<?php echo admin_url( "comment.php?action=editcomment&amp;c={$comment->comment_ID}" ); ?>"><?php esc_html_e( 'Edit' ); ?></a></p>
+ </td>
+ </tr>
+ </table>
+
+ <form action="comment.php" method="get" class="comment-ays-submit">
+
+ <p>
+ <?php submit_button( $button, 'primary', 'submit', false ); ?>
+ <a href="<?php echo admin_url( 'edit-comments.php' ); ?>" class="button-cancel"><?php esc_html_e( 'Cancel' ); ?></a>
+ </p>
+
+ <?php wp_nonce_field( $nonce_action ); ?>
+ <input type="hidden" name="action" value="<?php echo esc_attr( $formaction ); ?>" />
+ <input type="hidden" name="c" value="<?php echo esc_attr( $comment->comment_ID ); ?>" />
+ <input type="hidden" name="noredir" value="1" />
+ </form>
+
+ </div>
+ <?php
+ break;
+
+ case 'deletecomment':
+ case 'trashcomment':
+ case 'untrashcomment':
+ case 'spamcomment':
+ case 'unspamcomment':
+ case 'approvecomment':
+ case 'unapprovecomment':
+ $comment_id = absint( $_REQUEST['c'] );
+
+ if ( in_array( $action, array( 'approvecomment', 'unapprovecomment' ) ) ) {
+ check_admin_referer( 'approve-comment_' . $comment_id );
+ } else {
+ check_admin_referer( 'delete-comment_' . $comment_id );
+ }
+
+ $noredir = isset( $_REQUEST['noredir'] );
+
+ if ( ! $comment = get_comment( $comment_id ) ) {
+ comment_footer_die( __( 'Invalid comment ID.' ) . sprintf( ' <a href="%s">' . __( 'Go back' ) . '</a>.', 'edit-comments.php' ) );
+ }
+ if ( ! current_user_can( 'edit_comment', $comment->comment_ID ) ) {
+ comment_footer_die( __( 'Sorry, you are not allowed to edit comments on this post.' ) );
+ }
+
+ if ( '' != wp_get_referer() && ! $noredir && false === strpos( wp_get_referer(), 'comment.php' ) ) {
+ $redir = wp_get_referer();
+ } elseif ( '' != wp_get_original_referer() && ! $noredir ) {
+ $redir = wp_get_original_referer();
+ } elseif ( in_array( $action, array( 'approvecomment', 'unapprovecomment' ) ) ) {
+ $redir = admin_url( 'edit-comments.php?p=' . absint( $comment->comment_post_ID ) );
+ } else {
+ $redir = admin_url( 'edit-comments.php' );
+ }
+
+ $redir = remove_query_arg( array( 'spammed', 'unspammed', 'trashed', 'untrashed', 'deleted', 'ids', 'approved', 'unapproved' ), $redir );
+
+ switch ( $action ) {
+ case 'deletecomment':
+ wp_delete_comment( $comment );
+ $redir = add_query_arg( array( 'deleted' => '1' ), $redir );
+ break;
+ case 'trashcomment':
+ wp_trash_comment( $comment );
+ $redir = add_query_arg(
+ array(
+ 'trashed' => '1',
+ 'ids' => $comment_id,
+ ),
+ $redir
+ );
+ break;
+ case 'untrashcomment':
+ wp_untrash_comment( $comment );
+ $redir = add_query_arg( array( 'untrashed' => '1' ), $redir );
+ break;
+ case 'spamcomment':
+ wp_spam_comment( $comment );
+ $redir = add_query_arg(
+ array(
+ 'spammed' => '1',
+ 'ids' => $comment_id,
+ ),
+ $redir
+ );
+ break;
+ case 'unspamcomment':
+ wp_unspam_comment( $comment );
+ $redir = add_query_arg( array( 'unspammed' => '1' ), $redir );
+ break;
+ case 'approvecomment':
+ wp_set_comment_status( $comment, 'approve' );
+ $redir = add_query_arg( array( 'approved' => 1 ), $redir );
+ break;
+ case 'unapprovecomment':
+ wp_set_comment_status( $comment, 'hold' );
+ $redir = add_query_arg( array( 'unapproved' => 1 ), $redir );
+ break;
+ }
+
+ wp_redirect( $redir );
+ die;
+
+ case 'editedcomment':
+ $comment_id = absint( $_POST['comment_ID'] );
+ $comment_post_id = absint( $_POST['comment_post_ID'] );
+
+ check_admin_referer( 'update-comment_' . $comment_id );
+
+ edit_comment();
+
+ $location = ( empty( $_POST['referredby'] ) ? "edit-comments.php?p=$comment_post_id" : $_POST['referredby'] ) . '#comment-' . $comment_id;
+
+ /**
+ * Filters the URI the user is redirected to after editing a comment in the admin.
+ *
+ * @since 2.1.0
+ *
+ * @param string $location The URI the user will be redirected to.
+ * @param int $comment_id The ID of the comment being edited.
+ */
+ $location = apply_filters( 'comment_edit_redirect', $location, $comment_id );
+ wp_redirect( $location );
+
+ exit();
+
+ default:
+ wp_die( __( 'Unknown action.' ) );
+
+} // end switch
+
+include( ABSPATH . 'wp-admin/admin-footer.php' );
diff --git a/www/crm/wp-admin/credits.php b/www/crm/wp-admin/credits.php
new file mode 100644
index 00000000..4be28435
--- /dev/null
+++ b/www/crm/wp-admin/credits.php
@@ -0,0 +1,153 @@
+<?php
+/**
+ * Credits administration panel.
+ *
+ * @package WordPress
+ * @subpackage Administration
+ */
+
+/** WordPress Administration Bootstrap */
+require_once( dirname( __FILE__ ) . '/admin.php' );
+require_once( dirname( __FILE__ ) . '/includes/credits.php' );
+
+$title = __( 'Credits' );
+
+list( $display_version ) = explode( '-', get_bloginfo( 'version' ) );
+
+include( ABSPATH . 'wp-admin/admin-header.php' );
+?>
+<div class="wrap about-wrap full-width-layout">
+
+<h1>
+ <?php
+ /* translators: %s: The current WordPress version number */
+ printf( __( 'Welcome to WordPress&nbsp;%s' ), $display_version );
+ ?>
+</h1>
+
+<p class="about-text">
+ <?php
+ printf(
+ /* translators: %s: The current WordPress version number */
+ __( 'Congratulations on updating to WordPress %s! This update makes it easier than ever to fix your site if something goes wrong.' ),
+ $display_version
+ );
+ ?>
+</p>
+
+<div class="wp-badge">
+ <?php
+ /* translators: %s: The current WordPress version number */
+ printf( __( 'Version %s' ), $display_version );
+ ?>
+</div>
+
+<nav class="nav-tab-wrapper wp-clearfix" aria-label="<?php esc_attr_e( 'Secondary menu' ); ?>">
+ <a href="about.php" class="nav-tab"><?php _e( 'What&#8217;s New' ); ?></a>
+ <a href="credits.php" class="nav-tab nav-tab-active" aria-current="page"><?php _e( 'Credits' ); ?></a>
+ <a href="freedoms.php" class="nav-tab"><?php _e( 'Freedoms' ); ?></a>
+ <a href="freedoms.php?privacy-notice" class="nav-tab"><?php _e( 'Privacy' ); ?></a>
+</nav>
+
+<div class="about-wrap-content">
+<?php
+
+$credits = wp_credits();
+
+if ( ! $credits ) {
+ echo '<p class="about-description">';
+ printf(
+ /* translators: 1: https://wordpress.org/about/, 2: https://make.wordpress.org/ */
+ __( 'WordPress is created by a <a href="%1$s">worldwide team</a> of passionate individuals. <a href="%2$s">Get involved in WordPress</a>.' ),
+ 'https://wordpress.org/about/',
+ __( 'https://make.wordpress.org/' )
+ );
+ echo '</p>';
+ echo '</div>';
+ echo '</div>';
+ include( ABSPATH . 'wp-admin/admin-footer.php' );
+ exit;
+}
+
+echo '<p class="about-description">' . __( 'WordPress is created by a worldwide team of passionate individuals.' ) . "</p>\n";
+
+echo '<p>' . sprintf(
+ /* translators: %s: https://make.wordpress.org/ */
+ __( 'Want to see your name in lights on this page? <a href="%s">Get involved in WordPress</a>.' ),
+ __( 'https://make.wordpress.org/' )
+) . '</p>';
+
+foreach ( $credits['groups'] as $group_slug => $group_data ) {
+ if ( $group_data['name'] ) {
+ if ( 'Translators' == $group_data['name'] ) {
+ // Considered a special slug in the API response. (Also, will never be returned for en_US.)
+ $title = _x( 'Translators', 'Translate this to be the equivalent of English Translators in your language for the credits page Translators section' );
+ } elseif ( isset( $group_data['placeholders'] ) ) {
+ // phpcs:ignore WordPress.WP.I18n.LowLevelTranslationFunction,WordPress.WP.I18n.NonSingularStringLiteralText
+ $title = vsprintf( translate( $group_data['name'] ), $group_data['placeholders'] );
+ } else {
+ // phpcs:ignore WordPress.WP.I18n.LowLevelTranslationFunction,WordPress.WP.I18n.NonSingularStringLiteralText
+ $title = translate( $group_data['name'] );
+ }
+
+ echo '<h2 class="wp-people-group">' . esc_html( $title ) . "</h2>\n";
+ }
+
+ if ( ! empty( $group_data['shuffle'] ) ) {
+ shuffle( $group_data['data'] ); // We were going to sort by ability to pronounce "hierarchical," but that wouldn't be fair to Matt.
+ }
+
+ switch ( $group_data['type'] ) {
+ case 'list':
+ array_walk( $group_data['data'], '_wp_credits_add_profile_link', $credits['data']['profiles'] );
+ echo '<p class="wp-credits-list">' . wp_sprintf( '%l.', $group_data['data'] ) . "</p>\n\n";
+ break;
+ case 'libraries':
+ array_walk( $group_data['data'], '_wp_credits_build_object_link' );
+ echo '<p class="wp-credits-list">' . wp_sprintf( '%l.', $group_data['data'] ) . "</p>\n\n";
+ break;
+ default:
+ $compact = 'compact' == $group_data['type'];
+ $classes = 'wp-people-group ' . ( $compact ? 'compact' : '' );
+ echo '<ul class="' . $classes . '" id="wp-people-group-' . $group_slug . '">' . "\n";
+ foreach ( $group_data['data'] as $person_data ) {
+ echo '<li class="wp-person" id="wp-person-' . esc_attr( $person_data[2] ) . '">' . "\n\t";
+ echo '<a href="' . esc_url( sprintf( $credits['data']['profiles'], $person_data[2] ) ) . '" class="web">';
+ $size = 'compact' == $group_data['type'] ? 30 : 60;
+ $data = get_avatar_data( $person_data[1] . '@md5.gravatar.com', array( 'size' => $size ) );
+ $size *= 2;
+ $data2x = get_avatar_data( $person_data[1] . '@md5.gravatar.com', array( 'size' => $size ) );
+ echo '<img src="' . esc_url( $data['url'] ) . '" srcset="' . esc_url( $data2x['url'] ) . ' 2x" class="gravatar" alt="" />' . "\n";
+ echo esc_html( $person_data[0] ) . "</a>\n\t";
+ if ( ! $compact ) {
+ // phpcs:ignore WordPress.WP.I18n.LowLevelTranslationFunction,WordPress.WP.I18n.NonSingularStringLiteralText
+ echo '<span class="title">' . translate( $person_data[3] ) . "</span>\n";
+ }
+ echo "</li>\n";
+ }
+ echo "</ul>\n";
+ break;
+ }
+}
+
+?>
+</div>
+</div>
+<?php
+
+include( ABSPATH . 'wp-admin/admin-footer.php' );
+
+return;
+
+// These are strings returned by the API that we want to be translatable
+__( 'Project Leaders' );
+/* translators: %s: The current WordPress version number */
+__( 'Core Contributors to WordPress %s' );
+__( 'Noteworthy Contributors' );
+__( 'Cofounder, Project Lead' );
+__( 'Lead Developer' );
+__( 'Release Lead' );
+__( 'Release Design Lead' );
+__( 'Release Deputy' );
+__( 'Core Developer' );
+__( 'External Libraries' );
diff --git a/www/crm/wp-admin/css/about-rtl.css b/www/crm/wp-admin/css/about-rtl.css
new file mode 100644
index 00000000..982db4ad
--- /dev/null
+++ b/www/crm/wp-admin/css/about-rtl.css
@@ -0,0 +1,572 @@
+/*------------------------------------------------------------------------------
+ 22.0 - About Pages
+
+ 1.0 Global: About, Credits, Freedoms
+ 1.1 Typography
+ 1.2 Structure
+ 1.3 Point Releases
+ 2.0 About Page
+ 2.1 Typography
+ 2.2 Structure
+ 3.0 Credits & Freedoms Pages
+------------------------------------------------------------------------------*/
+
+/*------------------------------------------------------------------------------
+ 1.0 - Global: About, Credits, Freedoms
+------------------------------------------------------------------------------*/
+
+.about-wrap {
+ position: relative;
+ margin: 25px 20px 0 40px;
+ max-width: 1050px; /* readability */
+ font-size: 15px;
+}
+
+.about-wrap.full-width-layout {
+ max-width: 1200px;
+}
+
+.about-wrap-content {
+ max-width: 1050px;
+}
+
+.about-wrap div.updated,
+.about-wrap div.error,
+.about-wrap .notice {
+ display: none !important;
+}
+
+.about-wrap hr {
+ border: 0;
+ height: 0;
+ margin: 3em 0 0;
+ border-top: 1px solid rgba(0, 0, 0, 0.1);
+}
+
+.about-wrap img {
+ margin: 0;
+ width: 100%;
+ height: auto;
+ vertical-align: middle;
+}
+
+.about-wrap .inline-svg img {
+ max-width: 100%;
+ width: auto;
+ height: auto;
+}
+
+.about-wrap video {
+ margin: 1.5em auto;
+}
+
+/* WordPress Version Badge */
+
+.wp-badge {
+ background: #0073aa url(../images/w-logo-white.png?ver=20160308) no-repeat;
+ background-position: center 25px;
+ background-size: 80px 80px;
+ color: #fff;
+ font-size: 14px;
+ text-align: center;
+ font-weight: 600;
+ margin: 5px 0 0;
+ padding-top: 120px;
+ height: 40px;
+ display: inline-block;
+ width: 140px;
+ text-rendering: optimizeLegibility;
+ box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
+}
+
+.svg .wp-badge {
+ background-image: url(../images/wordpress-logo-white.svg?ver=20160308);
+}
+
+.about-wrap .wp-badge {
+ position: absolute;
+ top: 0;
+ left: 0;
+}
+
+/* Tabs */
+
+.about-wrap .nav-tab {
+ padding-left: 15px;
+ padding-right: 15px;
+ font-size: 18px;
+ line-height: 1.33333333;
+}
+
+/* 1.1 - Typography */
+
+.about-wrap h1 {
+ margin: 0.2em 0 0 200px;
+ padding: 0;
+ color: #32373c;
+ line-height: 1.2;
+ font-size: 2.8em;
+ font-weight: 400;
+}
+
+.about-wrap h2 {
+ margin: 40px 0 .6em;
+ font-size: 2.7em;
+ line-height: 1.3;
+ font-weight: 300;
+ text-align: center;
+}
+
+.about-wrap h3 {
+ margin: 1.25em 0 .6em;
+ font-size: 1.4em;
+ line-height: 1.5;
+}
+
+.about-wrap h4 {
+ font-size: 16px;
+ color: #23282d;
+}
+
+.about-wrap p {
+ line-height: 1.5;
+ font-size: 16px;
+}
+
+.about-wrap code,
+.about-wrap ol li p {
+ font-size: 14px;
+ font-weight: 400;
+}
+
+.about-wrap figcaption {
+ font-size: 13px;
+ text-align: center;
+ color: white;
+ text-overflow: ellipsis;
+}
+
+.about-wrap .about-description,
+.about-wrap .about-text {
+ margin-top: 1.4em;
+ font-weight: 400;
+ line-height: 1.6;
+ font-size: 19px;
+}
+
+.about-wrap .about-text {
+ margin: 1em 0 1em 200px;
+ color: #555d66;
+}
+
+/* 1.2 - Structure */
+
+.about-wrap .has-1-columns,
+.about-wrap .has-2-columns,
+.about-wrap .has-3-columns,
+.about-wrap .has-4-columns {
+ display: -ms-grid;
+ display: grid;
+ max-width: 800px;
+ margin-top: 40px;
+ margin-right: auto;
+ margin-left: auto;
+}
+
+.about-wrap .column {
+ margin-left: 20px;
+ margin-right: 20px;
+}
+
+.about-wrap .is-wide {
+ max-width: 760px;
+}
+
+.about-wrap .is-fullwidth {
+ max-width: 100%;
+}
+
+.about-wrap .has-1-columns {
+ display: block;
+ max-width: 680px;
+ margin: 0 auto 40px;
+}
+
+.about-wrap .has-2-columns {
+ -ms-grid-columns: 1fr 1fr;
+ grid-template-columns: 1fr 1fr;
+}
+
+.about-wrap .has-2-columns .column:nth-of-type(2n+1) {
+ -ms-grid-column: 1;
+ grid-column-start: 1;
+}
+
+.about-wrap .has-2-columns .column:nth-of-type(2n) {
+ -ms-grid-column: 2;
+ grid-column-start: 2;
+}
+
+.about-wrap .has-2-columns.is-wider-right {
+ -ms-grid-columns: 1fr 2fr;
+ grid-template-columns: 1fr 2fr;
+}
+
+.about-wrap .has-2-columns.is-wider-left {
+ -ms-grid-columns: 2fr 1fr;
+ grid-template-columns: 2fr 1fr;
+}
+
+.about-wrap .has-3-columns {
+ -ms-grid-columns: (1fr)[3];
+ grid-template-columns: repeat(3, 1fr);
+}
+
+.about-wrap .has-3-columns .column:nth-of-type(3n+1) {
+ -ms-grid-column: 1;
+ grid-column-start: 1;
+}
+
+.about-wrap .has-3-columns .column:nth-of-type(3n+2) {
+ -ms-grid-column: 2;
+ grid-column-start: 2;
+}
+
+.about-wrap .has-3-columns .column:nth-of-type(3n) {
+ -ms-grid-column: 3;
+ grid-column-start: 3;
+}
+
+.about-wrap .has-4-columns {
+ -ms-grid-columns: (1fr)[4];
+ grid-template-columns: repeat(4, 1fr);
+}
+
+.about-wrap .has-4-columns .column:nth-of-type(4n+1) {
+ -ms-grid-column: 1;
+ grid-column-start: 1;
+}
+
+.about-wrap .has-4-columns .column:nth-of-type(4n+2) {
+ -ms-grid-column: 2;
+ grid-column-start: 2;
+}
+
+.about-wrap .has-4-columns .column:nth-of-type(4n+3) {
+ -ms-grid-column: 3;
+ grid-column-start: 3;
+}
+
+.about-wrap .has-4-columns .column:nth-of-type(4n) {
+ -ms-grid-column: 4;
+ grid-column-start: 4;
+}
+
+.about-wrap .column :first-child {
+ margin-top: 0;
+}
+
+.about-wrap .aligncenter {
+ text-align: center;
+}
+
+.about-wrap .alignleft {
+ float: right;
+ margin-left: 40px;
+}
+
+.about-wrap .alignright {
+ float: left;
+ margin-right: 40px;
+}
+
+.about-wrap .is-vertically-aligned-top {
+ align-self: start;
+}
+
+.about-wrap .is-vertically-aligned-center {
+ align-self: center;
+}
+
+.about-wrap .is-vertically-aligned-bottom {
+ align-self: end;
+}
+
+/* 1.3 - Point Releases */
+
+.about-wrap .point-releases {
+ margin-top: 5px;
+ border-bottom: 1px solid #ddd;
+}
+
+.about-wrap .changelog {
+ margin-bottom: 40px;
+}
+
+.about-wrap .changelog.point-releases h3 {
+ padding-top: 35px;
+}
+
+.about-wrap .changelog.point-releases h3:first-child {
+ padding-top: 7px;
+}
+
+.about-wrap .changelog.feature-section .col {
+ margin-top: 40px;
+}
+
+/*------------------------------------------------------------------------------
+ 2.0 - About Page
+------------------------------------------------------------------------------*/
+
+/* 2.1 - Typography */
+
+.about-wrap .lead-description {
+ font-size: 1.5em;
+ text-align: center;
+}
+
+.about-wrap .feature-section p {
+ margin-top: 0.6em;
+}
+
+/* 2.2 - Structure */
+
+.about-wrap .headline-feature {
+ margin: 0 auto 40px;
+ max-width: 680px;
+}
+
+.about-wrap .headline-feature h2 {
+ margin: 50px 0 0;
+}
+
+.about-wrap .headline-feature img {
+ max-width: 600px;
+ width: 100%;
+}
+
+/* Return to Dashboard Home link */
+
+.about-wrap .return-to-dashboard {
+ margin: 30px -5px 0 0;
+ font-size: 14px;
+ font-weight: 600;
+}
+
+.about-wrap .return-to-dashboard a {
+ text-decoration: none;
+ padding: 0 5px;
+}
+
+/*------------------------------------------------------------------------------
+ 3.0 - Credits & Freedoms Pages
+------------------------------------------------------------------------------*/
+
+/* Credits */
+
+.about-wrap h2.wp-people-group {
+ margin: 2.6em 0 1.33em;
+ padding: 0;
+ font-size: 16px;
+ line-height: inherit;
+ font-weight: 600;
+ text-align: right;
+}
+
+.about-wrap .wp-people-group {
+ padding: 0 5px;
+ margin: 0 -5px 0 -15px;
+}
+
+.about-wrap .compact {
+ margin-bottom: 0;
+}
+
+.about-wrap .wp-person {
+ display: inline-block;
+ vertical-align: top;
+ margin-left: 10px;
+ padding-bottom: 15px;
+ height: 70px;
+ width: 280px;
+}
+
+.about-wrap .compact .wp-person {
+ height: auto;
+ width: 180px;
+ padding-bottom: 0;
+ margin-bottom: 0;
+}
+
+.about-wrap .wp-person .gravatar {
+ float: right;
+ margin: 0 0 10px 10px;
+ padding: 1px;
+ width: 60px;
+ height: 60px;
+}
+
+.about-wrap .compact .wp-person .gravatar {
+ width: 30px;
+ height: 30px;
+}
+
+.about-wrap .wp-person .web {
+ margin: 6px 0 2px;
+ font-size: 16px;
+ font-weight: 400;
+ line-height: 2;
+ text-decoration: none;
+}
+
+.about-wrap .wp-person .title {
+ display: block;
+}
+
+.about-wrap #wp-people-group-validators + p.wp-credits-list {
+ margin-top: 0;
+}
+
+.about-wrap p.wp-credits-list a {
+ white-space: nowrap;
+}
+
+/* Freedoms */
+
+.freedoms-php .about-wrap ol {
+ margin: 40px 60px;
+}
+
+.freedoms-php .about-wrap ol li {
+ list-style-type: decimal;
+ font-weight: 600;
+}
+
+.freedoms-php .about-wrap ol p {
+ font-weight: 400;
+ margin: 0.6em 0;
+}
+
+.freedoms-php .has-4-columns {
+ margin-bottom: 40px;
+}
+
+.freedoms-php .column .freedoms-image {
+ background-image: url('https://s.w.org/wp-content/themes/pub/wporg-main/images/freedoms-2x.png');
+ background-size: 100%;
+ padding-top: 100%;
+}
+
+.freedoms-php .column:nth-of-type(2) .freedoms-image {
+ background-position: 100% 34%;
+}
+
+.freedoms-php .column:nth-of-type(3) .freedoms-image {
+ background-position: 100% 66%;
+}
+
+.freedoms-php .column:nth-of-type(4) .freedoms-image {
+ background-position: 100% 100%;
+}
+
+/*------------------------------------------------------------------------------
+ 4.0 - Media Queries
+------------------------------------------------------------------------------*/
+
+@media screen and (max-width: 782px) {
+ .about-wrap .has-3-columns,
+ .about-wrap .has-4-columns {
+ -ms-grid-columns: 1fr 1fr;
+ grid-template-columns: 1fr 1fr;
+ }
+
+ .about-wrap .has-3-columns .column:nth-of-type(3n+1),
+ .about-wrap .has-4-columns .column:nth-of-type(4n+1) {
+ -ms-grid-column: 1;
+ grid-column-start: 1;
+ -ms-grid-row: 1;
+ grid-row-start: 1;
+ }
+
+ .about-wrap .has-3-columns .column:nth-of-type(3n+2),
+ .about-wrap .has-4-columns .column:nth-of-type(4n+2) {
+ -ms-grid-column: 2;
+ grid-column-start: 2;
+ -ms-grid-row: 1;
+ grid-row-start: 1;
+ }
+
+ .about-wrap .has-3-columns .column:nth-of-type(3n),
+ .about-wrap .has-4-columns .column:nth-of-type(4n+3) {
+ -ms-grid-column: 1;
+ grid-column-start: 1;
+ -ms-grid-row: 2;
+ grid-row-start: 2;
+ }
+
+ .about-wrap .has-4-columns .column:nth-of-type(4n) {
+ -ms-grid-column: 2;
+ grid-column-start: 2;
+ -ms-grid-row: 2;
+ grid-row-start: 2;
+ }
+}
+
+@media screen and (max-width: 600px) {
+ .about-wrap .has-2-columns,
+ .about-wrap .has-3-columns,
+ .about-wrap .has-4-columns {
+ display: block;
+ }
+
+ .about-wrap :not(.is-wider-right):not(.is-wider-left) .column {
+ margin-left: 0;
+ margin-right: 0;
+ }
+
+ .about-wrap .has-2-columns.is-wider-right,
+ .about-wrap .has-2-columns.is-wider-left {
+ display: -ms-grid;
+ display: grid;
+ }
+}
+
+@media only screen and (max-width: 500px) {
+ .about-wrap {
+ margin-left: 20px;
+ margin-right: 10px;
+ }
+
+ .about-wrap h1,
+ .about-wrap .about-text {
+ margin-left: 0;
+ }
+
+ .about-wrap .about-text {
+ margin-bottom: 0.25em;
+ }
+
+ .about-wrap .wp-badge {
+ position: relative;
+ margin-bottom: 1.5em;
+ width: 100%;
+ }
+}
+
+@media only screen and (max-width: 480px) {
+ .about-wrap .has-2-columns.is-wider-right,
+ .about-wrap .has-2-columns.is-wider-left {
+ display: block;
+ }
+
+ .about-wrap .column {
+ margin-left: 0;
+ margin-right: 0;
+ }
+
+ .about-wrap .has-2-columns.is-wider-right img,
+ .about-wrap .has-2-columns.is-wider-left img {
+ max-width: 160px;
+ }
+}
diff --git a/www/crm/wp-admin/css/about-rtl.min.css b/www/crm/wp-admin/css/about-rtl.min.css
new file mode 100644
index 00000000..1ca54a81
--- /dev/null
+++ b/www/crm/wp-admin/css/about-rtl.min.css
@@ -0,0 +1,2 @@
+/*! This file is auto-generated */
+.about-wrap{position:relative;margin:25px 20px 0 40px;max-width:1050px;font-size:15px}.about-wrap.full-width-layout{max-width:1200px}.about-wrap-content{max-width:1050px}.about-wrap .notice,.about-wrap div.error,.about-wrap div.updated{display:none!important}.about-wrap hr{border:0;height:0;margin:3em 0 0;border-top:1px solid rgba(0,0,0,.1)}.about-wrap img{margin:0;width:100%;height:auto;vertical-align:middle}.about-wrap .inline-svg img{max-width:100%;width:auto;height:auto}.about-wrap video{margin:1.5em auto}.wp-badge{background:#0073aa url(../images/w-logo-white.png?ver=20160308) no-repeat;background-position:center 25px;background-size:80px 80px;color:#fff;font-size:14px;text-align:center;font-weight:600;margin:5px 0 0;padding-top:120px;height:40px;display:inline-block;width:140px;text-rendering:optimizeLegibility;box-shadow:0 1px 3px rgba(0,0,0,.2)}.svg .wp-badge{background-image:url(../images/wordpress-logo-white.svg?ver=20160308)}.about-wrap .wp-badge{position:absolute;top:0;left:0}.about-wrap .nav-tab{padding-left:15px;padding-right:15px;font-size:18px;line-height:1.33333333}.about-wrap h1{margin:.2em 0 0 200px;padding:0;color:#32373c;line-height:1.2;font-size:2.8em;font-weight:400}.about-wrap h2{margin:40px 0 .6em;font-size:2.7em;line-height:1.3;font-weight:300;text-align:center}.about-wrap h3{margin:1.25em 0 .6em;font-size:1.4em;line-height:1.5}.about-wrap h4{font-size:16px;color:#23282d}.about-wrap p{line-height:1.5;font-size:16px}.about-wrap code,.about-wrap ol li p{font-size:14px;font-weight:400}.about-wrap figcaption{font-size:13px;text-align:center;color:#fff;text-overflow:ellipsis}.about-wrap .about-description,.about-wrap .about-text{margin-top:1.4em;font-weight:400;line-height:1.6;font-size:19px}.about-wrap .about-text{margin:1em 0 1em 200px;color:#555d66}.about-wrap .has-1-columns,.about-wrap .has-2-columns,.about-wrap .has-3-columns,.about-wrap .has-4-columns{display:-ms-grid;display:grid;max-width:800px;margin-top:40px;margin-right:auto;margin-left:auto}.about-wrap .column{margin-left:20px;margin-right:20px}.about-wrap .is-wide{max-width:760px}.about-wrap .is-fullwidth{max-width:100%}.about-wrap .has-1-columns{display:block;max-width:680px;margin:0 auto 40px}.about-wrap .has-2-columns{-ms-grid-columns:1fr 1fr;grid-template-columns:1fr 1fr}.about-wrap .has-2-columns .column:nth-of-type(2n+1){-ms-grid-column:1;grid-column-start:1}.about-wrap .has-2-columns .column:nth-of-type(2n){-ms-grid-column:2;grid-column-start:2}.about-wrap .has-2-columns.is-wider-right{-ms-grid-columns:1fr 2fr;grid-template-columns:1fr 2fr}.about-wrap .has-2-columns.is-wider-left{-ms-grid-columns:2fr 1fr;grid-template-columns:2fr 1fr}.about-wrap .has-3-columns{-ms-grid-columns:(1fr)[3];grid-template-columns:repeat(3,1fr)}.about-wrap .has-3-columns .column:nth-of-type(3n+1){-ms-grid-column:1;grid-column-start:1}.about-wrap .has-3-columns .column:nth-of-type(3n+2){-ms-grid-column:2;grid-column-start:2}.about-wrap .has-3-columns .column:nth-of-type(3n){-ms-grid-column:3;grid-column-start:3}.about-wrap .has-4-columns{-ms-grid-columns:(1fr)[4];grid-template-columns:repeat(4,1fr)}.about-wrap .has-4-columns .column:nth-of-type(4n+1){-ms-grid-column:1;grid-column-start:1}.about-wrap .has-4-columns .column:nth-of-type(4n+2){-ms-grid-column:2;grid-column-start:2}.about-wrap .has-4-columns .column:nth-of-type(4n+3){-ms-grid-column:3;grid-column-start:3}.about-wrap .has-4-columns .column:nth-of-type(4n){-ms-grid-column:4;grid-column-start:4}.about-wrap .column :first-child{margin-top:0}.about-wrap .aligncenter{text-align:center}.about-wrap .alignleft{float:right;margin-left:40px}.about-wrap .alignright{float:left;margin-right:40px}.about-wrap .is-vertically-aligned-top{align-self:start}.about-wrap .is-vertically-aligned-center{align-self:center}.about-wrap .is-vertically-aligned-bottom{align-self:end}.about-wrap .point-releases{margin-top:5px;border-bottom:1px solid #ddd}.about-wrap .changelog{margin-bottom:40px}.about-wrap .changelog.point-releases h3{padding-top:35px}.about-wrap .changelog.point-releases h3:first-child{padding-top:7px}.about-wrap .changelog.feature-section .col{margin-top:40px}.about-wrap .lead-description{font-size:1.5em;text-align:center}.about-wrap .feature-section p{margin-top:.6em}.about-wrap .headline-feature{margin:0 auto 40px;max-width:680px}.about-wrap .headline-feature h2{margin:50px 0 0}.about-wrap .headline-feature img{max-width:600px;width:100%}.about-wrap .return-to-dashboard{margin:30px -5px 0 0;font-size:14px;font-weight:600}.about-wrap .return-to-dashboard a{text-decoration:none;padding:0 5px}.about-wrap h2.wp-people-group{margin:2.6em 0 1.33em;padding:0;font-size:16px;line-height:inherit;font-weight:600;text-align:right}.about-wrap .wp-people-group{padding:0 5px;margin:0 -5px 0 -15px}.about-wrap .compact{margin-bottom:0}.about-wrap .wp-person{display:inline-block;vertical-align:top;margin-left:10px;padding-bottom:15px;height:70px;width:280px}.about-wrap .compact .wp-person{height:auto;width:180px;padding-bottom:0;margin-bottom:0}.about-wrap .wp-person .gravatar{float:right;margin:0 0 10px 10px;padding:1px;width:60px;height:60px}.about-wrap .compact .wp-person .gravatar{width:30px;height:30px}.about-wrap .wp-person .web{margin:6px 0 2px;font-size:16px;font-weight:400;line-height:2;text-decoration:none}.about-wrap .wp-person .title{display:block}.about-wrap #wp-people-group-validators+p.wp-credits-list{margin-top:0}.about-wrap p.wp-credits-list a{white-space:nowrap}.freedoms-php .about-wrap ol{margin:40px 60px}.freedoms-php .about-wrap ol li{list-style-type:decimal;font-weight:600}.freedoms-php .about-wrap ol p{font-weight:400;margin:.6em 0}.freedoms-php .has-4-columns{margin-bottom:40px}.freedoms-php .column .freedoms-image{background-image:url(https://s.w.org/wp-content/themes/pub/wporg-main/images/freedoms-2x.png);background-size:100%;padding-top:100%}.freedoms-php .column:nth-of-type(2) .freedoms-image{background-position:100% 34%}.freedoms-php .column:nth-of-type(3) .freedoms-image{background-position:100% 66%}.freedoms-php .column:nth-of-type(4) .freedoms-image{background-position:100% 100%}@media screen and (max-width:782px){.about-wrap .has-3-columns,.about-wrap .has-4-columns{-ms-grid-columns:1fr 1fr;grid-template-columns:1fr 1fr}.about-wrap .has-3-columns .column:nth-of-type(3n+1),.about-wrap .has-4-columns .column:nth-of-type(4n+1){-ms-grid-column:1;grid-column-start:1;-ms-grid-row:1;grid-row-start:1}.about-wrap .has-3-columns .column:nth-of-type(3n+2),.about-wrap .has-4-columns .column:nth-of-type(4n+2){-ms-grid-column:2;grid-column-start:2;-ms-grid-row:1;grid-row-start:1}.about-wrap .has-3-columns .column:nth-of-type(3n),.about-wrap .has-4-columns .column:nth-of-type(4n+3){-ms-grid-column:1;grid-column-start:1;-ms-grid-row:2;grid-row-start:2}.about-wrap .has-4-columns .column:nth-of-type(4n){-ms-grid-column:2;grid-column-start:2;-ms-grid-row:2;grid-row-start:2}}@media screen and (max-width:600px){.about-wrap .has-2-columns,.about-wrap .has-3-columns,.about-wrap .has-4-columns{display:block}.about-wrap :not(.is-wider-right):not(.is-wider-left) .column{margin-left:0;margin-right:0}.about-wrap .has-2-columns.is-wider-left,.about-wrap .has-2-columns.is-wider-right{display:-ms-grid;display:grid}}@media only screen and (max-width:500px){.about-wrap{margin-left:20px;margin-right:10px}.about-wrap .about-text,.about-wrap h1{margin-left:0}.about-wrap .about-text{margin-bottom:.25em}.about-wrap .wp-badge{position:relative;margin-bottom:1.5em;width:100%}}@media only screen and (max-width:480px){.about-wrap .has-2-columns.is-wider-left,.about-wrap .has-2-columns.is-wider-right{display:block}.about-wrap .column{margin-left:0;margin-right:0}.about-wrap .has-2-columns.is-wider-left img,.about-wrap .has-2-columns.is-wider-right img{max-width:160px}} \ No newline at end of file
diff --git a/www/crm/wp-admin/css/about.css b/www/crm/wp-admin/css/about.css
new file mode 100644
index 00000000..c6e7c5e2
--- /dev/null
+++ b/www/crm/wp-admin/css/about.css
@@ -0,0 +1,572 @@
+/*------------------------------------------------------------------------------
+ 22.0 - About Pages
+
+ 1.0 Global: About, Credits, Freedoms
+ 1.1 Typography
+ 1.2 Structure
+ 1.3 Point Releases
+ 2.0 About Page
+ 2.1 Typography
+ 2.2 Structure
+ 3.0 Credits & Freedoms Pages
+------------------------------------------------------------------------------*/
+
+/*------------------------------------------------------------------------------
+ 1.0 - Global: About, Credits, Freedoms
+------------------------------------------------------------------------------*/
+
+.about-wrap {
+ position: relative;
+ margin: 25px 40px 0 20px;
+ max-width: 1050px; /* readability */
+ font-size: 15px;
+}
+
+.about-wrap.full-width-layout {
+ max-width: 1200px;
+}
+
+.about-wrap-content {
+ max-width: 1050px;
+}
+
+.about-wrap div.updated,
+.about-wrap div.error,
+.about-wrap .notice {
+ display: none !important;
+}
+
+.about-wrap hr {
+ border: 0;
+ height: 0;
+ margin: 3em 0 0;
+ border-top: 1px solid rgba(0, 0, 0, 0.1);
+}
+
+.about-wrap img {
+ margin: 0;
+ width: 100%;
+ height: auto;
+ vertical-align: middle;
+}
+
+.about-wrap .inline-svg img {
+ max-width: 100%;
+ width: auto;
+ height: auto;
+}
+
+.about-wrap video {
+ margin: 1.5em auto;
+}
+
+/* WordPress Version Badge */
+
+.wp-badge {
+ background: #0073aa url(../images/w-logo-white.png?ver=20160308) no-repeat;
+ background-position: center 25px;
+ background-size: 80px 80px;
+ color: #fff;
+ font-size: 14px;
+ text-align: center;
+ font-weight: 600;
+ margin: 5px 0 0;
+ padding-top: 120px;
+ height: 40px;
+ display: inline-block;
+ width: 140px;
+ text-rendering: optimizeLegibility;
+ box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
+}
+
+.svg .wp-badge {
+ background-image: url(../images/wordpress-logo-white.svg?ver=20160308);
+}
+
+.about-wrap .wp-badge {
+ position: absolute;
+ top: 0;
+ right: 0;
+}
+
+/* Tabs */
+
+.about-wrap .nav-tab {
+ padding-right: 15px;
+ padding-left: 15px;
+ font-size: 18px;
+ line-height: 1.33333333;
+}
+
+/* 1.1 - Typography */
+
+.about-wrap h1 {
+ margin: 0.2em 200px 0 0;
+ padding: 0;
+ color: #32373c;
+ line-height: 1.2;
+ font-size: 2.8em;
+ font-weight: 400;
+}
+
+.about-wrap h2 {
+ margin: 40px 0 .6em;
+ font-size: 2.7em;
+ line-height: 1.3;
+ font-weight: 300;
+ text-align: center;
+}
+
+.about-wrap h3 {
+ margin: 1.25em 0 .6em;
+ font-size: 1.4em;
+ line-height: 1.5;
+}
+
+.about-wrap h4 {
+ font-size: 16px;
+ color: #23282d;
+}
+
+.about-wrap p {
+ line-height: 1.5;
+ font-size: 16px;
+}
+
+.about-wrap code,
+.about-wrap ol li p {
+ font-size: 14px;
+ font-weight: 400;
+}
+
+.about-wrap figcaption {
+ font-size: 13px;
+ text-align: center;
+ color: white;
+ text-overflow: ellipsis;
+}
+
+.about-wrap .about-description,
+.about-wrap .about-text {
+ margin-top: 1.4em;
+ font-weight: 400;
+ line-height: 1.6;
+ font-size: 19px;
+}
+
+.about-wrap .about-text {
+ margin: 1em 200px 1em 0;
+ color: #555d66;
+}
+
+/* 1.2 - Structure */
+
+.about-wrap .has-1-columns,
+.about-wrap .has-2-columns,
+.about-wrap .has-3-columns,
+.about-wrap .has-4-columns {
+ display: -ms-grid;
+ display: grid;
+ max-width: 800px;
+ margin-top: 40px;
+ margin-left: auto;
+ margin-right: auto;
+}
+
+.about-wrap .column {
+ margin-right: 20px;
+ margin-left: 20px;
+}
+
+.about-wrap .is-wide {
+ max-width: 760px;
+}
+
+.about-wrap .is-fullwidth {
+ max-width: 100%;
+}
+
+.about-wrap .has-1-columns {
+ display: block;
+ max-width: 680px;
+ margin: 0 auto 40px;
+}
+
+.about-wrap .has-2-columns {
+ -ms-grid-columns: 1fr 1fr;
+ grid-template-columns: 1fr 1fr;
+}
+
+.about-wrap .has-2-columns .column:nth-of-type(2n+1) {
+ -ms-grid-column: 1;
+ grid-column-start: 1;
+}
+
+.about-wrap .has-2-columns .column:nth-of-type(2n) {
+ -ms-grid-column: 2;
+ grid-column-start: 2;
+}
+
+.about-wrap .has-2-columns.is-wider-right {
+ -ms-grid-columns: 1fr 2fr;
+ grid-template-columns: 1fr 2fr;
+}
+
+.about-wrap .has-2-columns.is-wider-left {
+ -ms-grid-columns: 2fr 1fr;
+ grid-template-columns: 2fr 1fr;
+}
+
+.about-wrap .has-3-columns {
+ -ms-grid-columns: (1fr)[3];
+ grid-template-columns: repeat(3, 1fr);
+}
+
+.about-wrap .has-3-columns .column:nth-of-type(3n+1) {
+ -ms-grid-column: 1;
+ grid-column-start: 1;
+}
+
+.about-wrap .has-3-columns .column:nth-of-type(3n+2) {
+ -ms-grid-column: 2;
+ grid-column-start: 2;
+}
+
+.about-wrap .has-3-columns .column:nth-of-type(3n) {
+ -ms-grid-column: 3;
+ grid-column-start: 3;
+}
+
+.about-wrap .has-4-columns {
+ -ms-grid-columns: (1fr)[4];
+ grid-template-columns: repeat(4, 1fr);
+}
+
+.about-wrap .has-4-columns .column:nth-of-type(4n+1) {
+ -ms-grid-column: 1;
+ grid-column-start: 1;
+}
+
+.about-wrap .has-4-columns .column:nth-of-type(4n+2) {
+ -ms-grid-column: 2;
+ grid-column-start: 2;
+}
+
+.about-wrap .has-4-columns .column:nth-of-type(4n+3) {
+ -ms-grid-column: 3;
+ grid-column-start: 3;
+}
+
+.about-wrap .has-4-columns .column:nth-of-type(4n) {
+ -ms-grid-column: 4;
+ grid-column-start: 4;
+}
+
+.about-wrap .column :first-child {
+ margin-top: 0;
+}
+
+.about-wrap .aligncenter {
+ text-align: center;
+}
+
+.about-wrap .alignleft {
+ float: left;
+ margin-right: 40px;
+}
+
+.about-wrap .alignright {
+ float: right;
+ margin-left: 40px;
+}
+
+.about-wrap .is-vertically-aligned-top {
+ align-self: start;
+}
+
+.about-wrap .is-vertically-aligned-center {
+ align-self: center;
+}
+
+.about-wrap .is-vertically-aligned-bottom {
+ align-self: end;
+}
+
+/* 1.3 - Point Releases */
+
+.about-wrap .point-releases {
+ margin-top: 5px;
+ border-bottom: 1px solid #ddd;
+}
+
+.about-wrap .changelog {
+ margin-bottom: 40px;
+}
+
+.about-wrap .changelog.point-releases h3 {
+ padding-top: 35px;
+}
+
+.about-wrap .changelog.point-releases h3:first-child {
+ padding-top: 7px;
+}
+
+.about-wrap .changelog.feature-section .col {
+ margin-top: 40px;
+}
+
+/*------------------------------------------------------------------------------
+ 2.0 - About Page
+------------------------------------------------------------------------------*/
+
+/* 2.1 - Typography */
+
+.about-wrap .lead-description {
+ font-size: 1.5em;
+ text-align: center;
+}
+
+.about-wrap .feature-section p {
+ margin-top: 0.6em;
+}
+
+/* 2.2 - Structure */
+
+.about-wrap .headline-feature {
+ margin: 0 auto 40px;
+ max-width: 680px;
+}
+
+.about-wrap .headline-feature h2 {
+ margin: 50px 0 0;
+}
+
+.about-wrap .headline-feature img {
+ max-width: 600px;
+ width: 100%;
+}
+
+/* Return to Dashboard Home link */
+
+.about-wrap .return-to-dashboard {
+ margin: 30px 0 0 -5px;
+ font-size: 14px;
+ font-weight: 600;
+}
+
+.about-wrap .return-to-dashboard a {
+ text-decoration: none;
+ padding: 0 5px;
+}
+
+/*------------------------------------------------------------------------------
+ 3.0 - Credits & Freedoms Pages
+------------------------------------------------------------------------------*/
+
+/* Credits */
+
+.about-wrap h2.wp-people-group {
+ margin: 2.6em 0 1.33em;
+ padding: 0;
+ font-size: 16px;
+ line-height: inherit;
+ font-weight: 600;
+ text-align: left;
+}
+
+.about-wrap .wp-people-group {
+ padding: 0 5px;
+ margin: 0 -15px 0 -5px;
+}
+
+.about-wrap .compact {
+ margin-bottom: 0;
+}
+
+.about-wrap .wp-person {
+ display: inline-block;
+ vertical-align: top;
+ margin-right: 10px;
+ padding-bottom: 15px;
+ height: 70px;
+ width: 280px;
+}
+
+.about-wrap .compact .wp-person {
+ height: auto;
+ width: 180px;
+ padding-bottom: 0;
+ margin-bottom: 0;
+}
+
+.about-wrap .wp-person .gravatar {
+ float: left;
+ margin: 0 10px 10px 0;
+ padding: 1px;
+ width: 60px;
+ height: 60px;
+}
+
+.about-wrap .compact .wp-person .gravatar {
+ width: 30px;
+ height: 30px;
+}
+
+.about-wrap .wp-person .web {
+ margin: 6px 0 2px;
+ font-size: 16px;
+ font-weight: 400;
+ line-height: 2;
+ text-decoration: none;
+}
+
+.about-wrap .wp-person .title {
+ display: block;
+}
+
+.about-wrap #wp-people-group-validators + p.wp-credits-list {
+ margin-top: 0;
+}
+
+.about-wrap p.wp-credits-list a {
+ white-space: nowrap;
+}
+
+/* Freedoms */
+
+.freedoms-php .about-wrap ol {
+ margin: 40px 60px;
+}
+
+.freedoms-php .about-wrap ol li {
+ list-style-type: decimal;
+ font-weight: 600;
+}
+
+.freedoms-php .about-wrap ol p {
+ font-weight: 400;
+ margin: 0.6em 0;
+}
+
+.freedoms-php .has-4-columns {
+ margin-bottom: 40px;
+}
+
+.freedoms-php .column .freedoms-image {
+ background-image: url('https://s.w.org/wp-content/themes/pub/wporg-main/images/freedoms-2x.png');
+ background-size: 100%;
+ padding-top: 100%;
+}
+
+.freedoms-php .column:nth-of-type(2) .freedoms-image {
+ background-position: 0 34%;
+}
+
+.freedoms-php .column:nth-of-type(3) .freedoms-image {
+ background-position: 0 66%;
+}
+
+.freedoms-php .column:nth-of-type(4) .freedoms-image {
+ background-position: 0 100%;
+}
+
+/*------------------------------------------------------------------------------
+ 4.0 - Media Queries
+------------------------------------------------------------------------------*/
+
+@media screen and (max-width: 782px) {
+ .about-wrap .has-3-columns,
+ .about-wrap .has-4-columns {
+ -ms-grid-columns: 1fr 1fr;
+ grid-template-columns: 1fr 1fr;
+ }
+
+ .about-wrap .has-3-columns .column:nth-of-type(3n+1),
+ .about-wrap .has-4-columns .column:nth-of-type(4n+1) {
+ -ms-grid-column: 1;
+ grid-column-start: 1;
+ -ms-grid-row: 1;
+ grid-row-start: 1;
+ }
+
+ .about-wrap .has-3-columns .column:nth-of-type(3n+2),
+ .about-wrap .has-4-columns .column:nth-of-type(4n+2) {
+ -ms-grid-column: 2;
+ grid-column-start: 2;
+ -ms-grid-row: 1;
+ grid-row-start: 1;
+ }
+
+ .about-wrap .has-3-columns .column:nth-of-type(3n),
+ .about-wrap .has-4-columns .column:nth-of-type(4n+3) {
+ -ms-grid-column: 1;
+ grid-column-start: 1;
+ -ms-grid-row: 2;
+ grid-row-start: 2;
+ }
+
+ .about-wrap .has-4-columns .column:nth-of-type(4n) {
+ -ms-grid-column: 2;
+ grid-column-start: 2;
+ -ms-grid-row: 2;
+ grid-row-start: 2;
+ }
+}
+
+@media screen and (max-width: 600px) {
+ .about-wrap .has-2-columns,
+ .about-wrap .has-3-columns,
+ .about-wrap .has-4-columns {
+ display: block;
+ }
+
+ .about-wrap :not(.is-wider-right):not(.is-wider-left) .column {
+ margin-right: 0;
+ margin-left: 0;
+ }
+
+ .about-wrap .has-2-columns.is-wider-right,
+ .about-wrap .has-2-columns.is-wider-left {
+ display: -ms-grid;
+ display: grid;
+ }
+}
+
+@media only screen and (max-width: 500px) {
+ .about-wrap {
+ margin-right: 20px;
+ margin-left: 10px;
+ }
+
+ .about-wrap h1,
+ .about-wrap .about-text {
+ margin-right: 0;
+ }
+
+ .about-wrap .about-text {
+ margin-bottom: 0.25em;
+ }
+
+ .about-wrap .wp-badge {
+ position: relative;
+ margin-bottom: 1.5em;
+ width: 100%;
+ }
+}
+
+@media only screen and (max-width: 480px) {
+ .about-wrap .has-2-columns.is-wider-right,
+ .about-wrap .has-2-columns.is-wider-left {
+ display: block;
+ }
+
+ .about-wrap .column {
+ margin-right: 0;
+ margin-left: 0;
+ }
+
+ .about-wrap .has-2-columns.is-wider-right img,
+ .about-wrap .has-2-columns.is-wider-left img {
+ max-width: 160px;
+ }
+}
diff --git a/www/crm/wp-admin/css/about.min.css b/www/crm/wp-admin/css/about.min.css
new file mode 100644
index 00000000..bcfcd190
--- /dev/null
+++ b/www/crm/wp-admin/css/about.min.css
@@ -0,0 +1,2 @@
+/*! This file is auto-generated */
+.about-wrap{position:relative;margin:25px 40px 0 20px;max-width:1050px;font-size:15px}.about-wrap.full-width-layout{max-width:1200px}.about-wrap-content{max-width:1050px}.about-wrap .notice,.about-wrap div.error,.about-wrap div.updated{display:none!important}.about-wrap hr{border:0;height:0;margin:3em 0 0;border-top:1px solid rgba(0,0,0,.1)}.about-wrap img{margin:0;width:100%;height:auto;vertical-align:middle}.about-wrap .inline-svg img{max-width:100%;width:auto;height:auto}.about-wrap video{margin:1.5em auto}.wp-badge{background:#0073aa url(../images/w-logo-white.png?ver=20160308) no-repeat;background-position:center 25px;background-size:80px 80px;color:#fff;font-size:14px;text-align:center;font-weight:600;margin:5px 0 0;padding-top:120px;height:40px;display:inline-block;width:140px;text-rendering:optimizeLegibility;box-shadow:0 1px 3px rgba(0,0,0,.2)}.svg .wp-badge{background-image:url(../images/wordpress-logo-white.svg?ver=20160308)}.about-wrap .wp-badge{position:absolute;top:0;right:0}.about-wrap .nav-tab{padding-right:15px;padding-left:15px;font-size:18px;line-height:1.33333333}.about-wrap h1{margin:.2em 200px 0 0;padding:0;color:#32373c;line-height:1.2;font-size:2.8em;font-weight:400}.about-wrap h2{margin:40px 0 .6em;font-size:2.7em;line-height:1.3;font-weight:300;text-align:center}.about-wrap h3{margin:1.25em 0 .6em;font-size:1.4em;line-height:1.5}.about-wrap h4{font-size:16px;color:#23282d}.about-wrap p{line-height:1.5;font-size:16px}.about-wrap code,.about-wrap ol li p{font-size:14px;font-weight:400}.about-wrap figcaption{font-size:13px;text-align:center;color:#fff;text-overflow:ellipsis}.about-wrap .about-description,.about-wrap .about-text{margin-top:1.4em;font-weight:400;line-height:1.6;font-size:19px}.about-wrap .about-text{margin:1em 200px 1em 0;color:#555d66}.about-wrap .has-1-columns,.about-wrap .has-2-columns,.about-wrap .has-3-columns,.about-wrap .has-4-columns{display:-ms-grid;display:grid;max-width:800px;margin-top:40px;margin-left:auto;margin-right:auto}.about-wrap .column{margin-right:20px;margin-left:20px}.about-wrap .is-wide{max-width:760px}.about-wrap .is-fullwidth{max-width:100%}.about-wrap .has-1-columns{display:block;max-width:680px;margin:0 auto 40px}.about-wrap .has-2-columns{-ms-grid-columns:1fr 1fr;grid-template-columns:1fr 1fr}.about-wrap .has-2-columns .column:nth-of-type(2n+1){-ms-grid-column:1;grid-column-start:1}.about-wrap .has-2-columns .column:nth-of-type(2n){-ms-grid-column:2;grid-column-start:2}.about-wrap .has-2-columns.is-wider-right{-ms-grid-columns:1fr 2fr;grid-template-columns:1fr 2fr}.about-wrap .has-2-columns.is-wider-left{-ms-grid-columns:2fr 1fr;grid-template-columns:2fr 1fr}.about-wrap .has-3-columns{-ms-grid-columns:(1fr)[3];grid-template-columns:repeat(3,1fr)}.about-wrap .has-3-columns .column:nth-of-type(3n+1){-ms-grid-column:1;grid-column-start:1}.about-wrap .has-3-columns .column:nth-of-type(3n+2){-ms-grid-column:2;grid-column-start:2}.about-wrap .has-3-columns .column:nth-of-type(3n){-ms-grid-column:3;grid-column-start:3}.about-wrap .has-4-columns{-ms-grid-columns:(1fr)[4];grid-template-columns:repeat(4,1fr)}.about-wrap .has-4-columns .column:nth-of-type(4n+1){-ms-grid-column:1;grid-column-start:1}.about-wrap .has-4-columns .column:nth-of-type(4n+2){-ms-grid-column:2;grid-column-start:2}.about-wrap .has-4-columns .column:nth-of-type(4n+3){-ms-grid-column:3;grid-column-start:3}.about-wrap .has-4-columns .column:nth-of-type(4n){-ms-grid-column:4;grid-column-start:4}.about-wrap .column :first-child{margin-top:0}.about-wrap .aligncenter{text-align:center}.about-wrap .alignleft{float:left;margin-right:40px}.about-wrap .alignright{float:right;margin-left:40px}.about-wrap .is-vertically-aligned-top{align-self:start}.about-wrap .is-vertically-aligned-center{align-self:center}.about-wrap .is-vertically-aligned-bottom{align-self:end}.about-wrap .point-releases{margin-top:5px;border-bottom:1px solid #ddd}.about-wrap .changelog{margin-bottom:40px}.about-wrap .changelog.point-releases h3{padding-top:35px}.about-wrap .changelog.point-releases h3:first-child{padding-top:7px}.about-wrap .changelog.feature-section .col{margin-top:40px}.about-wrap .lead-description{font-size:1.5em;text-align:center}.about-wrap .feature-section p{margin-top:.6em}.about-wrap .headline-feature{margin:0 auto 40px;max-width:680px}.about-wrap .headline-feature h2{margin:50px 0 0}.about-wrap .headline-feature img{max-width:600px;width:100%}.about-wrap .return-to-dashboard{margin:30px 0 0 -5px;font-size:14px;font-weight:600}.about-wrap .return-to-dashboard a{text-decoration:none;padding:0 5px}.about-wrap h2.wp-people-group{margin:2.6em 0 1.33em;padding:0;font-size:16px;line-height:inherit;font-weight:600;text-align:left}.about-wrap .wp-people-group{padding:0 5px;margin:0 -15px 0 -5px}.about-wrap .compact{margin-bottom:0}.about-wrap .wp-person{display:inline-block;vertical-align:top;margin-right:10px;padding-bottom:15px;height:70px;width:280px}.about-wrap .compact .wp-person{height:auto;width:180px;padding-bottom:0;margin-bottom:0}.about-wrap .wp-person .gravatar{float:left;margin:0 10px 10px 0;padding:1px;width:60px;height:60px}.about-wrap .compact .wp-person .gravatar{width:30px;height:30px}.about-wrap .wp-person .web{margin:6px 0 2px;font-size:16px;font-weight:400;line-height:2;text-decoration:none}.about-wrap .wp-person .title{display:block}.about-wrap #wp-people-group-validators+p.wp-credits-list{margin-top:0}.about-wrap p.wp-credits-list a{white-space:nowrap}.freedoms-php .about-wrap ol{margin:40px 60px}.freedoms-php .about-wrap ol li{list-style-type:decimal;font-weight:600}.freedoms-php .about-wrap ol p{font-weight:400;margin:.6em 0}.freedoms-php .has-4-columns{margin-bottom:40px}.freedoms-php .column .freedoms-image{background-image:url(https://s.w.org/wp-content/themes/pub/wporg-main/images/freedoms-2x.png);background-size:100%;padding-top:100%}.freedoms-php .column:nth-of-type(2) .freedoms-image{background-position:0 34%}.freedoms-php .column:nth-of-type(3) .freedoms-image{background-position:0 66%}.freedoms-php .column:nth-of-type(4) .freedoms-image{background-position:0 100%}@media screen and (max-width:782px){.about-wrap .has-3-columns,.about-wrap .has-4-columns{-ms-grid-columns:1fr 1fr;grid-template-columns:1fr 1fr}.about-wrap .has-3-columns .column:nth-of-type(3n+1),.about-wrap .has-4-columns .column:nth-of-type(4n+1){-ms-grid-column:1;grid-column-start:1;-ms-grid-row:1;grid-row-start:1}.about-wrap .has-3-columns .column:nth-of-type(3n+2),.about-wrap .has-4-columns .column:nth-of-type(4n+2){-ms-grid-column:2;grid-column-start:2;-ms-grid-row:1;grid-row-start:1}.about-wrap .has-3-columns .column:nth-of-type(3n),.about-wrap .has-4-columns .column:nth-of-type(4n+3){-ms-grid-column:1;grid-column-start:1;-ms-grid-row:2;grid-row-start:2}.about-wrap .has-4-columns .column:nth-of-type(4n){-ms-grid-column:2;grid-column-start:2;-ms-grid-row:2;grid-row-start:2}}@media screen and (max-width:600px){.about-wrap .has-2-columns,.about-wrap .has-3-columns,.about-wrap .has-4-columns{display:block}.about-wrap :not(.is-wider-right):not(.is-wider-left) .column{margin-right:0;margin-left:0}.about-wrap .has-2-columns.is-wider-left,.about-wrap .has-2-columns.is-wider-right{display:-ms-grid;display:grid}}@media only screen and (max-width:500px){.about-wrap{margin-right:20px;margin-left:10px}.about-wrap .about-text,.about-wrap h1{margin-right:0}.about-wrap .about-text{margin-bottom:.25em}.about-wrap .wp-badge{position:relative;margin-bottom:1.5em;width:100%}}@media only screen and (max-width:480px){.about-wrap .has-2-columns.is-wider-left,.about-wrap .has-2-columns.is-wider-right{display:block}.about-wrap .column{margin-right:0;margin-left:0}.about-wrap .has-2-columns.is-wider-left img,.about-wrap .has-2-columns.is-wider-right img{max-width:160px}} \ No newline at end of file
diff --git a/www/crm/wp-admin/css/admin-menu-rtl.css b/www/crm/wp-admin/css/admin-menu-rtl.css
new file mode 100644
index 00000000..eb5852dc
--- /dev/null
+++ b/www/crm/wp-admin/css/admin-menu-rtl.css
@@ -0,0 +1,928 @@
+#adminmenuback,
+#adminmenuwrap,
+#adminmenu,
+#adminmenu .wp-submenu {
+ width: 160px;
+ background-color: #23282d;
+}
+
+#adminmenuback {
+ position: fixed;
+ top: 0;
+ bottom: -120px;
+ z-index: 1; /* positive z-index to avoid elastic scrolling woes in Safari */
+}
+
+#adminmenu {
+ clear: right;
+ margin: 12px 0;
+ padding: 0;
+ list-style: none;
+}
+
+.folded #adminmenuback,
+.folded #adminmenuwrap,
+.folded #adminmenu,
+.folded #adminmenu li.menu-top {
+ width: 36px;
+}
+
+.icon16 {
+ height: 18px;
+ width: 18px;
+ padding: 6px 6px;
+ margin: -6px -8px 0 0;
+ float: right;
+}
+
+/* New Menu icons */
+
+.icon16:before {
+ color: #82878c; /* same as new icons */
+ font: normal 20px/1 dashicons;
+ speak: none;
+ padding: 6px 0;
+ height: 34px;
+ width: 20px;
+ display: inline-block;
+ -webkit-font-smoothing: antialiased;
+ -moz-osx-font-smoothing: grayscale;
+ transition: all .1s ease-in-out;
+}
+
+.icon16.icon-dashboard:before {
+ content: "\f226";
+}
+
+.icon16.icon-post:before {
+ content: "\f109";
+}
+
+.icon16.icon-media:before {
+ content: "\f104";
+}
+
+.icon16.icon-links:before {
+ content: "\f103";
+}
+
+.icon16.icon-page:before {
+ content: "\f105";
+}
+
+.icon16.icon-comments:before {
+ content: "\f101";
+ margin-top: 1px;
+}
+
+.icon16.icon-appearance:before {
+ content: "\f100";
+}
+
+.icon16.icon-plugins:before {
+ content: "\f106";
+}
+
+.icon16.icon-users:before {
+ content: "\f110";
+}
+
+.icon16.icon-tools:before {
+ content: "\f107";
+}
+
+.icon16.icon-settings:before {
+ content: "\f108";
+}
+
+.icon16.icon-site:before {
+ content: "\f541";
+}
+
+.icon16.icon-generic:before {
+ content: "\f111";
+}
+
+/* hide background-image for icons above */
+.icon16.icon-dashboard,
+.menu-icon-dashboard div.wp-menu-image,
+.icon16.icon-post,
+.menu-icon-post div.wp-menu-image,
+.icon16.icon-media,
+.menu-icon-media div.wp-menu-image,
+.icon16.icon-links,
+.menu-icon-links div.wp-menu-image,
+.icon16.icon-page,
+.menu-icon-page div.wp-menu-image,
+.icon16.icon-comments,
+.menu-icon-comments div.wp-menu-image,
+.icon16.icon-appearance,
+.menu-icon-appearance div.wp-menu-image,
+.icon16.icon-plugins,
+.menu-icon-plugins div.wp-menu-image,
+.icon16.icon-users,
+.menu-icon-users div.wp-menu-image,
+.icon16.icon-tools,
+.menu-icon-tools div.wp-menu-image,
+.icon16.icon-settings,
+.menu-icon-settings div.wp-menu-image,
+.icon16.icon-site,
+.menu-icon-site div.wp-menu-image,
+.icon16.icon-generic,
+.menu-icon-generic div.wp-menu-image {
+ background-image: none !important;
+}
+
+/*------------------------------------------------------------------------------
+ 7.0 - Main Navigation (Left Menu)
+------------------------------------------------------------------------------*/
+
+#adminmenuwrap {
+ position: relative;
+ float: right;
+ z-index: 9990;
+}
+
+/* side admin menu */
+#adminmenu * {
+ -webkit-user-select: none;
+ -moz-user-select: none;
+ -ms-user-select: none;
+ user-select: none;
+}
+
+#adminmenu li {
+ margin: 0;
+ padding: 0;
+ cursor: pointer;
+}
+
+#adminmenu a {
+ display: block;
+ line-height: 1.3;
+ padding: 2px 5px;
+ color: #eee;
+}
+
+#adminmenu .wp-submenu a {
+ color: #b4b9be;
+ color: rgba(240, 245, 250, 0.7);
+}
+
+#adminmenu .wp-submenu a:hover,
+#adminmenu .wp-submenu a:focus {
+ background: none;
+}
+
+#adminmenu a:hover,
+#adminmenu li.menu-top > a:focus,
+#adminmenu .wp-submenu a:hover,
+#adminmenu .wp-submenu a:focus {
+ color: #00b9eb;
+}
+
+#adminmenu li.menu-top {
+ border: none;
+ min-height: 34px;
+ position: relative;
+}
+
+#adminmenu .wp-submenu {
+ list-style: none;
+ position: absolute;
+ top: -1000em;
+ right: 160px;
+ overflow: visible;
+ word-wrap: break-word;
+}
+
+#adminmenu .wp-submenu,
+.folded #adminmenu a.wp-has-current-submenu:focus + .wp-submenu,
+.folded #adminmenu .wp-has-current-submenu .wp-submenu {
+ padding: 7px 0 8px;
+ z-index: 9999;
+ background-color: #32373c;
+ box-shadow: 0 3px 5px rgba(0, 0, 0, 0.2);
+}
+
+.js #adminmenu .sub-open,
+.js #adminmenu .opensub .wp-submenu,
+#adminmenu a.menu-top:focus + .wp-submenu,
+.no-js li.wp-has-submenu:hover .wp-submenu {
+ top: -1px;
+}
+
+#adminmenu .wp-has-current-submenu .wp-submenu,
+.no-js li.wp-has-current-submenu:hover .wp-submenu,
+#adminmenu a.wp-has-current-submenu:focus + .wp-submenu,
+#adminmenu .wp-has-current-submenu .wp-submenu.sub-open,
+#adminmenu .wp-has-current-submenu.opensub .wp-submenu {
+ position: relative;
+ z-index: 3;
+ top: auto;
+ right: auto;
+ left: auto;
+ bottom: auto;
+ border: 0 none;
+ margin-top: 0;
+ box-shadow: none;
+ background-color: #32373c;
+}
+
+/* ensure that wp-submenu's box shadow doesn't appear on top of the focused menu item's background. */
+#adminmenu li.menu-top:hover,
+#adminmenu li.opensub > a.menu-top,
+#adminmenu li > a.menu-top:focus {
+ position: relative;
+ background-color: #191e23;
+ color: #00b9eb;
+}
+
+.folded #adminmenu li.menu-top:hover,
+.folded #adminmenu li.opensub > a.menu-top,
+.folded #adminmenu li > a.menu-top:focus {
+ z-index: 10000;
+}
+
+#adminmenu li.wp-has-current-submenu a.wp-has-current-submenu,
+#adminmenu li.current a.menu-top,
+.folded #adminmenu li.wp-has-current-submenu,
+.folded #adminmenu li.current.menu-top,
+#adminmenu .wp-menu-arrow,
+#adminmenu .wp-has-current-submenu .wp-submenu .wp-submenu-head,
+#adminmenu .wp-menu-arrow div {
+ background: #0073aa;
+ color: #fff;
+}
+
+.folded #adminmenu .wp-submenu.sub-open,
+.folded #adminmenu .opensub .wp-submenu,
+.folded #adminmenu .wp-has-current-submenu .wp-submenu.sub-open,
+.folded #adminmenu .wp-has-current-submenu.opensub .wp-submenu,
+.folded #adminmenu a.menu-top:focus + .wp-submenu,
+.folded #adminmenu .wp-has-current-submenu a.menu-top:focus + .wp-submenu,
+.no-js.folded #adminmenu .wp-has-submenu:hover .wp-submenu {
+ top: 0;
+ right: 36px;
+}
+
+.folded #adminmenu a.wp-has-current-submenu:focus + .wp-submenu,
+.folded #adminmenu .wp-has-current-submenu .wp-submenu {
+ position: absolute;
+ top: -1000em;
+}
+
+#adminmenu .wp-not-current-submenu .wp-submenu,
+.folded #adminmenu .wp-has-current-submenu .wp-submenu {
+ min-width: 160px;
+ width: auto;
+}
+
+#adminmenu .wp-submenu a {
+ font-size: 13px;
+ line-height: 1.4;
+ margin: 0;
+ padding: 5px 0;
+}
+
+#adminmenu .wp-submenu li.current,
+#adminmenu .wp-submenu li.current a,
+#adminmenu .opensub .wp-submenu li.current a,
+#adminmenu a.wp-has-current-submenu:focus + .wp-submenu li.current a,
+#adminmenu .wp-submenu li.current a:hover,
+#adminmenu .wp-submenu li.current a:focus {
+ color: #fff;
+}
+
+#adminmenu .wp-not-current-submenu li > a,
+.folded #adminmenu .wp-has-current-submenu li > a {
+ padding-left: 16px;
+ padding-right: 14px;
+ /* Exclude from the transition the outline for Windows High Contrast mode */
+ transition: all .1s ease-in-out, outline 0s;
+}
+
+#adminmenu .wp-has-current-submenu ul > li > a,
+.folded #adminmenu li.menu-top .wp-submenu > li > a {
+ padding: 5px 12px;
+}
+
+#adminmenu a.menu-top,
+#adminmenu .wp-submenu-head {
+ font-size: 14px;
+ font-weight: 400;
+ line-height: 1.3;
+ padding: 0;
+}
+
+#adminmenu .wp-submenu-head {
+ display: none;
+}
+
+.folded #adminmenu .wp-menu-name {
+ position: absolute;
+ right: -999px;
+}
+
+.folded #adminmenu .wp-submenu-head {
+ display: block;
+}
+
+#adminmenu .wp-submenu li {
+ padding: 0;
+ margin: 0;
+}
+
+#adminmenu .wp-menu-image img {
+ padding: 9px 0 0 0;
+ opacity: 0.6;
+ filter: alpha(opacity=60);
+}
+
+#adminmenu div.wp-menu-name {
+ padding: 8px 0;
+}
+
+#adminmenu div.wp-menu-image {
+ float: right;
+ width: 36px;
+ height: 34px;
+ margin: 0;
+ text-align: center;
+}
+
+#adminmenu div.wp-menu-image.svg {
+ background-repeat: no-repeat;
+ background-position: center;
+ background-size: 20px auto;
+}
+
+div.wp-menu-image:before {
+ color: #a0a5aa;
+ color: rgba(240, 245, 250, 0.6);
+ padding: 7px 0;
+ transition: all .1s ease-in-out;
+}
+
+#adminmenu div.wp-menu-image:before {
+ color: #a0a5aa;
+ color: rgba(240, 245, 250, 0.6);
+}
+
+#adminmenu li.wp-has-current-submenu:hover div.wp-menu-image:before,
+#adminmenu .wp-has-current-submenu div.wp-menu-image:before,
+#adminmenu .current div.wp-menu-image:before,
+#adminmenu a.wp-has-current-submenu:hover div.wp-menu-image:before,
+#adminmenu a.current:hover div.wp-menu-image:before,
+#adminmenu li.wp-has-current-submenu a:focus div.wp-menu-image:before,
+#adminmenu li.wp-has-current-submenu.opensub div.wp-menu-image:before {
+ color: #fff;
+}
+
+#adminmenu li:hover div.wp-menu-image:before,
+#adminmenu li a:focus div.wp-menu-image:before,
+#adminmenu li.opensub div.wp-menu-image:before {
+ color: #00b9eb;
+}
+
+/* IE8 doesn't redraw the pseudo elements unless you make a change to the content, this restore the initial color after hover */
+.ie8 #adminmenu li.opensub div.wp-menu-image:before {
+ color: #a0a5aa;
+}
+
+.folded #adminmenu div.wp-menu-image {
+ width: 35px;
+ height: 30px;
+ position: absolute;
+ z-index: 25;
+}
+
+.folded #adminmenu a.menu-top {
+ height: 34px;
+}
+
+/* No @font-face support */
+.no-font-face #adminmenu .wp-menu-image {
+ display: none;
+}
+
+.no-font-face #adminmenu div.wp-menu-name {
+ padding: 8px 12px;
+}
+
+.no-font-face.auto-fold #adminmenu .wp-menu-name {
+ margin-right: 0;
+}
+/* End no @font-face support */
+
+/* Sticky admin menu */
+.sticky-menu #adminmenuwrap {
+ position: fixed;
+}
+
+/* A new arrow */
+
+.wp-menu-arrow {
+ display: none !important;
+}
+
+ul#adminmenu a.wp-has-current-submenu {
+ position: relative;
+}
+
+ul#adminmenu a.wp-has-current-submenu:after,
+ul#adminmenu > li.current > a.current:after {
+ left: 0;
+ border: solid 8px transparent;
+ content: " ";
+ height: 0;
+ width: 0;
+ position: absolute;
+ pointer-events: none;
+ border-left-color: #f1f1f1;
+ top: 50%;
+ margin-top: -8px;
+}
+
+.folded ul#adminmenu li:hover a.wp-has-current-submenu:after {
+ display: none;
+}
+
+.folded ul#adminmenu a.wp-has-current-submenu:after,
+.folded ul#adminmenu > li a.current:after {
+ border-width: 4px;
+ margin-top: -4px;
+}
+
+/* flyout menu arrow */
+#adminmenu li.wp-has-submenu.wp-not-current-submenu:hover:after {
+ left: 0;
+ border: solid transparent;
+ content: " ";
+ height: 0;
+ width: 0;
+ position: absolute;
+ pointer-events: none;
+ border-width: 8px;
+ top: 10px;
+ z-index: 10000;
+}
+
+.folded ul#adminmenu li.wp-has-submenu.wp-not-current-submenu:hover:after {
+ border-width: 4px;
+ margin-top: -4px;
+ top: 18px;
+}
+
+#adminmenu li.wp-has-submenu.wp-not-current-submenu.opensub:hover:after {
+ border-left-color: #32373c;
+}
+
+#adminmenu li.menu-top:hover .wp-menu-image img,
+#adminmenu li.wp-has-current-submenu .wp-menu-image img {
+ opacity: 1;
+ filter: alpha(opacity=100);
+}
+
+#adminmenu li.wp-menu-separator {
+ height: 5px;
+ padding: 0;
+ margin: 0 0 6px 0;
+ cursor: inherit;
+}
+
+/* @todo: is this even needed given that it's nested beneath the above li.wp-menu-separator? */
+#adminmenu div.separator {
+ height: 2px;
+ padding: 0;
+}
+
+#adminmenu .wp-submenu .wp-submenu-head {
+ color: #fff;
+ font-weight: 400;
+ font-size: 14px;
+ padding: 8px 11px 8px 4px;
+ margin: -7px 0px 4px;
+}
+
+#adminmenu li.current,
+.folded #adminmenu li.wp-menu-open {
+ border: 0 none;
+}
+
+/* @todo: consider to use a single rule for these counters and the list table comments counters. */
+#adminmenu .awaiting-mod,
+#adminmenu .update-plugins {
+ display: inline-block;
+ vertical-align: top;
+ box-sizing: border-box;
+ margin: 1px 2px -1px 0;
+ padding: 0 5px;
+ min-width: 18px;
+ height: 18px;
+ border-radius: 9px;
+ background-color: #ca4a1f;
+ color: #fff;
+ font-size: 11px;
+ line-height: 1.6;
+ text-align: center;
+ z-index: 26;
+}
+
+#adminmenu li.current a .awaiting-mod,
+#adminmenu li a.wp-has-current-submenu .update-plugins {
+ background-color: #ca4a1f;
+ color: #fff;
+}
+
+#adminmenu li span.count-0 {
+ display: none;
+}
+
+#collapse-button {
+ display: block;
+ width: 100%;
+ height: 34px;
+ margin: 0;
+ border: none;
+ padding: 0;
+ position: relative;
+ overflow: visible;
+ background: none;
+ color: #aaa;
+ cursor: pointer;
+}
+
+#collapse-button:hover {
+ color: #00b9eb;
+}
+
+#collapse-button:focus {
+ color: #00b9eb;
+ /* Only visible in Windows High Contrast mode */
+ outline: 1px solid transparent;
+ outline-offset: -1px;
+}
+
+#collapse-button .collapse-button-icon,
+#collapse-button .collapse-button-label {
+ /* absolutely positioned to avoid 1px shift in IE when button is pressed */
+ display: block;
+ position: absolute;
+ top: 0;
+ right: 0;
+}
+
+#collapse-button .collapse-button-label {
+ top: 8px;
+}
+
+#collapse-button .collapse-button-icon {
+ width: 36px;
+ height: 34px;
+}
+
+#collapse-button .collapse-button-label {
+ padding: 0 36px 0 0;
+}
+
+.folded #collapse-button .collapse-button-label {
+ display: none;
+}
+
+#collapse-button .collapse-button-icon:after {
+ content: "\f148";
+ display: block;
+ position: relative;
+ top: 7px;
+ text-align: center;
+ font: normal 20px/1 dashicons !important;
+ speak: none;
+ -webkit-font-smoothing: antialiased;
+ -moz-osx-font-smoothing: grayscale;
+}
+
+/* rtl:ignore */
+.folded #collapse-button .collapse-button-icon:after,
+.rtl #collapse-button .collapse-button-icon:after {
+ transform: rotate(180deg);
+}
+
+.rtl.folded #collapse-button .collapse-button-icon:after {
+ transform: none;
+}
+
+#collapse-button .collapse-button-icon:after,
+#collapse-button .collapse-button-label {
+ transition: all .1s ease-in-out;
+}
+
+/**
+ * Toolbar menu toggle
+ */
+li#wp-admin-bar-menu-toggle {
+ display: none;
+}
+
+/* Hide-if-customize for items we can't add classes to */
+.customize-support #menu-appearance a[href="themes.php?page=custom-header"],
+.customize-support #menu-appearance a[href="themes.php?page=custom-background"] {
+ display: none;
+}
+
+/* Auto-folding of the admin menu */
+@media only screen and (max-width: 960px) {
+ .auto-fold #wpcontent,
+ .auto-fold #wpfooter {
+ margin-right: 36px;
+ }
+
+ .auto-fold #adminmenuback,
+ .auto-fold #adminmenuwrap,
+ .auto-fold #adminmenu,
+ .auto-fold #adminmenu li.menu-top {
+ width: 36px;
+ }
+
+ .auto-fold #adminmenu .wp-submenu.sub-open,
+ .auto-fold #adminmenu .opensub .wp-submenu,
+ .auto-fold #adminmenu .wp-has-current-submenu .wp-submenu.sub-open,
+ .auto-fold #adminmenu .wp-has-current-submenu.opensub .wp-submenu,
+ .auto-fold #adminmenu a.menu-top:focus + .wp-submenu,
+ .auto-fold #adminmenu .wp-has-current-submenu a.menu-top:focus + .wp-submenu {
+ top: 0px;
+ right: 36px;
+ }
+
+ .auto-fold #adminmenu a.wp-has-current-submenu:focus + .wp-submenu,
+ .auto-fold #adminmenu .wp-has-current-submenu .wp-submenu {
+ position: absolute;
+ top: -1000em;
+ margin-left: -1px;
+ padding: 7px 0 8px;
+ z-index: 9999;
+ }
+
+ .auto-fold #adminmenu .wp-has-current-submenu .wp-submenu {
+ min-width: 150px;
+ width: auto;
+ }
+
+ .auto-fold #adminmenu .wp-has-current-submenu li > a {
+ padding-left: 16px;
+ padding-right: 14px;
+ }
+
+
+ .auto-fold #adminmenu li.menu-top .wp-submenu > li > a {
+ padding-right: 12px;
+ }
+
+ .auto-fold #adminmenu .wp-menu-name {
+ position: absolute;
+ right: -999px;
+ }
+
+ .auto-fold #adminmenu .wp-submenu-head {
+ display: block;
+ }
+
+ .auto-fold #adminmenu div.wp-menu-image {
+ height: 30px;
+ width: 34px;
+ position: absolute;
+ z-index: 25;
+ }
+
+ .auto-fold #adminmenu a.menu-top {
+ height: 34px;
+ }
+
+ .auto-fold #adminmenu li.wp-menu-open {
+ border: 0 none;
+ }
+
+ .auto-fold #adminmenu .wp-has-current-submenu.menu-top-last {
+ margin-bottom: 0;
+ }
+
+ .auto-fold ul#adminmenu li:hover a.wp-has-current-submenu:after {
+ display: none;
+ }
+
+ .auto-fold ul#adminmenu li.wp-has-submenu.wp-not-current-submenu:hover:after {
+ border-width: 4px;
+ margin-top: -4px;
+ top: 16px;
+ }
+
+ .auto-fold ul#adminmenu a.wp-has-current-submenu:after,
+ .auto-fold ul#adminmenu > li a.current:after {
+ border-width: 4px;
+ margin-top: -4px;
+ }
+
+ .auto-fold #adminmenu li.menu-top:hover,
+ .auto-fold #adminmenu li.opensub > a.menu-top,
+ .auto-fold #adminmenu li > a.menu-top:focus {
+ z-index: 10000;
+ }
+
+ .auto-fold #collapse-menu .collapse-button-label {
+ display: none;
+ }
+
+ /* rtl:ignore */
+ .auto-fold #collapse-button .collapse-button-icon:after {
+ transform: rotate(180deg);
+ }
+
+ .rtl.auto-fold #collapse-button .collapse-button-icon:after {
+ transform: none;
+ }
+
+}
+
+@media screen and (max-width: 782px) {
+ .auto-fold #wpcontent {
+ position: relative;
+ margin-right: 0;
+ padding-right: 10px;
+ }
+
+ .sticky-menu #adminmenuwrap {
+ position: relative;
+ z-index: auto;
+ top: 0;
+ }
+
+ /* Sidebar Adjustments */
+ .auto-fold #adminmenu,
+ .auto-fold #adminmenuback,
+ .auto-fold #adminmenuwrap {
+ position: absolute;
+ width: 190px;
+ z-index: 100;
+ }
+
+ .auto-fold #adminmenuback,
+ .auto-fold #adminmenuwrap {
+ display: none;
+ }
+
+ .auto-fold .wp-responsive-open #adminmenuback,
+ .auto-fold .wp-responsive-open #adminmenuwrap {
+ display: block;
+ }
+
+ .auto-fold #adminmenu li.menu-top {
+ width: 100%;
+ }
+
+ /* Resize the admin menu items to a comfortable touch size */
+ .auto-fold #adminmenu li a {
+ font-size: 16px;
+ padding: 5px;
+ }
+
+ .auto-fold #adminmenu li.menu-top .wp-submenu > li > a {
+ padding: 10px 20px 10px 10px;
+ }
+
+ /* Restore the menu names */
+ .auto-fold #adminmenu .wp-menu-name {
+ position: static;
+ margin-right: 35px;
+ }
+
+ /* Switch the arrow side */
+ .auto-fold ul#adminmenu a.wp-has-current-submenu:after,
+ .auto-fold ul#adminmenu > li.current > a.current:after {
+ border-width: 8px;
+ margin-top: -8px;
+ }
+
+ .auto-fold ul#adminmenu li.wp-has-submenu.wp-not-current-submenu:hover:after {
+ display: none;
+ }
+
+ /* Make the submenus appear correctly when tapped. */
+ #adminmenu .wp-submenu {
+ position: relative;
+ display: none;
+ }
+
+ .auto-fold #adminmenu .selected .wp-submenu,
+ .auto-fold #adminmenu .wp-menu-open .wp-submenu {
+ position: relative;
+ display: block;
+ top: 0;
+ right: -1px;
+ box-shadow: none;
+ }
+
+ .auto-fold #adminmenu .selected .wp-submenu:after,
+ .auto-fold #adminmenu .wp-menu-open .wp-submenu:after {
+ display: none;
+ }
+
+ .auto-fold #adminmenu .opensub .wp-submenu {
+ display: none;
+ }
+
+ .auto-fold #adminmenu .selected .wp-submenu {
+ display: block;
+ }
+
+ .auto-fold ul#adminmenu li:hover a.wp-has-current-submenu:after {
+ display: block;
+ }
+
+ .auto-fold #adminmenu a.menu-top:focus + .wp-submenu,
+ .auto-fold #adminmenu .wp-has-current-submenu a.menu-top:focus + .wp-submenu {
+ position: relative;
+ right: -1px;
+ left: 0;
+ top: 0;
+ }
+
+ /* Remove submenu headers and adjust sub meu*/
+ #adminmenu .wp-submenu .wp-submenu-head {
+ display: none;
+ }
+
+ /* Toolbar menu toggle */
+ #wp-responsive-toggle {
+ position: fixed;
+ top: 5px;
+ right: 4px;
+ padding-left: 10px;
+ z-index: 99999;
+ border: none;
+ box-sizing: border-box;
+ }
+
+ #wpadminbar #wp-admin-bar-menu-toggle a {
+ display: block;
+ padding: 0;
+ overflow: hidden;
+ outline: none;
+ text-decoration: none;
+ border: 1px solid transparent;
+ background: none;
+ height: 44px;
+ margin-right: -1px;
+ }
+
+ .wp-responsive-open #wpadminbar #wp-admin-bar-menu-toggle a {
+ background: #32373c;
+ }
+
+ li#wp-admin-bar-menu-toggle {
+ display: block;
+ }
+
+ #wpadminbar #wp-admin-bar-menu-toggle a:hover {
+ border: 1px solid transparent;
+ }
+
+ #wpadminbar #wp-admin-bar-menu-toggle .ab-icon:before {
+ content: "\f228";
+ display: inline-block;
+ float: right;
+ font: normal 40px/45px dashicons;
+ vertical-align: middle;
+ outline: none;
+ margin: 0;
+ -webkit-font-smoothing: antialiased;
+ -moz-osx-font-smoothing: grayscale;
+ height: 44px;
+ width: 50px;
+ padding: 0;
+ border: none;
+ text-align: center;
+ text-decoration: none;
+ box-sizing: border-box;
+ }
+
+ .wp-responsive-open #wpadminbar #wp-admin-bar-menu-toggle .ab-icon:before {
+ color: #00b9eb;
+ }
+}
+
+/* Smartphone */
+@media screen and (max-width: 600px) {
+ #adminmenuwrap,
+ #adminmenuback {
+ display: none;
+ }
+
+ .wp-responsive-open #adminmenuwrap,
+ .wp-responsive-open #adminmenuback {
+ display: block;
+ }
+
+ .auto-fold #adminmenu {
+ top: 46px;
+ }
+}
diff --git a/www/crm/wp-admin/css/admin-menu-rtl.min.css b/www/crm/wp-admin/css/admin-menu-rtl.min.css
new file mode 100644
index 00000000..58b3fdc0
--- /dev/null
+++ b/www/crm/wp-admin/css/admin-menu-rtl.min.css
@@ -0,0 +1,2 @@
+/*! This file is auto-generated */
+#adminmenu,#adminmenu .wp-submenu,#adminmenuback,#adminmenuwrap{width:160px;background-color:#23282d}#adminmenuback{position:fixed;top:0;bottom:-120px;z-index:1}#adminmenu{clear:right;margin:12px 0;padding:0;list-style:none}.folded #adminmenu,.folded #adminmenu li.menu-top,.folded #adminmenuback,.folded #adminmenuwrap{width:36px}.icon16{height:18px;width:18px;padding:6px 6px;margin:-6px -8px 0 0;float:right}.icon16:before{color:#82878c;font:normal 20px/1 dashicons;speak:none;padding:6px 0;height:34px;width:20px;display:inline-block;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;transition:all .1s ease-in-out}.icon16.icon-dashboard:before{content:"\f226"}.icon16.icon-post:before{content:"\f109"}.icon16.icon-media:before{content:"\f104"}.icon16.icon-links:before{content:"\f103"}.icon16.icon-page:before{content:"\f105"}.icon16.icon-comments:before{content:"\f101";margin-top:1px}.icon16.icon-appearance:before{content:"\f100"}.icon16.icon-plugins:before{content:"\f106"}.icon16.icon-users:before{content:"\f110"}.icon16.icon-tools:before{content:"\f107"}.icon16.icon-settings:before{content:"\f108"}.icon16.icon-site:before{content:"\f541"}.icon16.icon-generic:before{content:"\f111"}.icon16.icon-appearance,.icon16.icon-comments,.icon16.icon-dashboard,.icon16.icon-generic,.icon16.icon-links,.icon16.icon-media,.icon16.icon-page,.icon16.icon-plugins,.icon16.icon-post,.icon16.icon-settings,.icon16.icon-site,.icon16.icon-tools,.icon16.icon-users,.menu-icon-appearance div.wp-menu-image,.menu-icon-comments div.wp-menu-image,.menu-icon-dashboard div.wp-menu-image,.menu-icon-generic div.wp-menu-image,.menu-icon-links div.wp-menu-image,.menu-icon-media div.wp-menu-image,.menu-icon-page div.wp-menu-image,.menu-icon-plugins div.wp-menu-image,.menu-icon-post div.wp-menu-image,.menu-icon-settings div.wp-menu-image,.menu-icon-site div.wp-menu-image,.menu-icon-tools div.wp-menu-image,.menu-icon-users div.wp-menu-image{background-image:none!important}#adminmenuwrap{position:relative;float:right;z-index:9990}#adminmenu *{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}#adminmenu li{margin:0;padding:0;cursor:pointer}#adminmenu a{display:block;line-height:1.3;padding:2px 5px;color:#eee}#adminmenu .wp-submenu a{color:#b4b9be;color:rgba(240,245,250,.7)}#adminmenu .wp-submenu a:focus,#adminmenu .wp-submenu a:hover{background:0 0}#adminmenu .wp-submenu a:focus,#adminmenu .wp-submenu a:hover,#adminmenu a:hover,#adminmenu li.menu-top>a:focus{color:#00b9eb}#adminmenu li.menu-top{border:none;min-height:34px;position:relative}#adminmenu .wp-submenu{list-style:none;position:absolute;top:-1000em;right:160px;overflow:visible;word-wrap:break-word}#adminmenu .wp-submenu,.folded #adminmenu .wp-has-current-submenu .wp-submenu,.folded #adminmenu a.wp-has-current-submenu:focus+.wp-submenu{padding:7px 0 8px;z-index:9999;background-color:#32373c;box-shadow:0 3px 5px rgba(0,0,0,.2)}#adminmenu a.menu-top:focus+.wp-submenu,.js #adminmenu .opensub .wp-submenu,.js #adminmenu .sub-open,.no-js li.wp-has-submenu:hover .wp-submenu{top:-1px}#adminmenu .wp-has-current-submenu .wp-submenu,#adminmenu .wp-has-current-submenu .wp-submenu.sub-open,#adminmenu .wp-has-current-submenu.opensub .wp-submenu,#adminmenu a.wp-has-current-submenu:focus+.wp-submenu,.no-js li.wp-has-current-submenu:hover .wp-submenu{position:relative;z-index:3;top:auto;right:auto;left:auto;bottom:auto;border:0 none;margin-top:0;box-shadow:none;background-color:#32373c}#adminmenu li.menu-top:hover,#adminmenu li.opensub>a.menu-top,#adminmenu li>a.menu-top:focus{position:relative;background-color:#191e23;color:#00b9eb}.folded #adminmenu li.menu-top:hover,.folded #adminmenu li.opensub>a.menu-top,.folded #adminmenu li>a.menu-top:focus{z-index:10000}#adminmenu .wp-has-current-submenu .wp-submenu .wp-submenu-head,#adminmenu .wp-menu-arrow,#adminmenu .wp-menu-arrow div,#adminmenu li.current a.menu-top,#adminmenu li.wp-has-current-submenu a.wp-has-current-submenu,.folded #adminmenu li.current.menu-top,.folded #adminmenu li.wp-has-current-submenu{background:#0073aa;color:#fff}.folded #adminmenu .opensub .wp-submenu,.folded #adminmenu .wp-has-current-submenu .wp-submenu.sub-open,.folded #adminmenu .wp-has-current-submenu a.menu-top:focus+.wp-submenu,.folded #adminmenu .wp-has-current-submenu.opensub .wp-submenu,.folded #adminmenu .wp-submenu.sub-open,.folded #adminmenu a.menu-top:focus+.wp-submenu,.no-js.folded #adminmenu .wp-has-submenu:hover .wp-submenu{top:0;right:36px}.folded #adminmenu .wp-has-current-submenu .wp-submenu,.folded #adminmenu a.wp-has-current-submenu:focus+.wp-submenu{position:absolute;top:-1000em}#adminmenu .wp-not-current-submenu .wp-submenu,.folded #adminmenu .wp-has-current-submenu .wp-submenu{min-width:160px;width:auto}#adminmenu .wp-submenu a{font-size:13px;line-height:1.4;margin:0;padding:5px 0}#adminmenu .opensub .wp-submenu li.current a,#adminmenu .wp-submenu li.current,#adminmenu .wp-submenu li.current a,#adminmenu .wp-submenu li.current a:focus,#adminmenu .wp-submenu li.current a:hover,#adminmenu a.wp-has-current-submenu:focus+.wp-submenu li.current a{color:#fff}#adminmenu .wp-not-current-submenu li>a,.folded #adminmenu .wp-has-current-submenu li>a{padding-left:16px;padding-right:14px;transition:all .1s ease-in-out,outline 0s}#adminmenu .wp-has-current-submenu ul>li>a,.folded #adminmenu li.menu-top .wp-submenu>li>a{padding:5px 12px}#adminmenu .wp-submenu-head,#adminmenu a.menu-top{font-size:14px;font-weight:400;line-height:1.3;padding:0}#adminmenu .wp-submenu-head{display:none}.folded #adminmenu .wp-menu-name{position:absolute;right:-999px}.folded #adminmenu .wp-submenu-head{display:block}#adminmenu .wp-submenu li{padding:0;margin:0}#adminmenu .wp-menu-image img{padding:9px 0 0 0;opacity:.6;filter:alpha(opacity=60)}#adminmenu div.wp-menu-name{padding:8px 0}#adminmenu div.wp-menu-image{float:right;width:36px;height:34px;margin:0;text-align:center}#adminmenu div.wp-menu-image.svg{background-repeat:no-repeat;background-position:center;background-size:20px auto}div.wp-menu-image:before{color:#a0a5aa;color:rgba(240,245,250,.6);padding:7px 0;transition:all .1s ease-in-out}#adminmenu div.wp-menu-image:before{color:#a0a5aa;color:rgba(240,245,250,.6)}#adminmenu .current div.wp-menu-image:before,#adminmenu .wp-has-current-submenu div.wp-menu-image:before,#adminmenu a.current:hover div.wp-menu-image:before,#adminmenu a.wp-has-current-submenu:hover div.wp-menu-image:before,#adminmenu li.wp-has-current-submenu a:focus div.wp-menu-image:before,#adminmenu li.wp-has-current-submenu.opensub div.wp-menu-image:before,#adminmenu li.wp-has-current-submenu:hover div.wp-menu-image:before{color:#fff}#adminmenu li a:focus div.wp-menu-image:before,#adminmenu li.opensub div.wp-menu-image:before,#adminmenu li:hover div.wp-menu-image:before{color:#00b9eb}.ie8 #adminmenu li.opensub div.wp-menu-image:before{color:#a0a5aa}.folded #adminmenu div.wp-menu-image{width:35px;height:30px;position:absolute;z-index:25}.folded #adminmenu a.menu-top{height:34px}.no-font-face #adminmenu .wp-menu-image{display:none}.no-font-face #adminmenu div.wp-menu-name{padding:8px 12px}.no-font-face.auto-fold #adminmenu .wp-menu-name{margin-right:0}.sticky-menu #adminmenuwrap{position:fixed}.wp-menu-arrow{display:none!important}ul#adminmenu a.wp-has-current-submenu{position:relative}ul#adminmenu a.wp-has-current-submenu:after,ul#adminmenu>li.current>a.current:after{left:0;border:solid 8px transparent;content:" ";height:0;width:0;position:absolute;pointer-events:none;border-left-color:#f1f1f1;top:50%;margin-top:-8px}.folded ul#adminmenu li:hover a.wp-has-current-submenu:after{display:none}.folded ul#adminmenu a.wp-has-current-submenu:after,.folded ul#adminmenu>li a.current:after{border-width:4px;margin-top:-4px}#adminmenu li.wp-has-submenu.wp-not-current-submenu:hover:after{left:0;border:solid transparent;content:" ";height:0;width:0;position:absolute;pointer-events:none;border-width:8px;top:10px;z-index:10000}.folded ul#adminmenu li.wp-has-submenu.wp-not-current-submenu:hover:after{border-width:4px;margin-top:-4px;top:18px}#adminmenu li.wp-has-submenu.wp-not-current-submenu.opensub:hover:after{border-left-color:#32373c}#adminmenu li.menu-top:hover .wp-menu-image img,#adminmenu li.wp-has-current-submenu .wp-menu-image img{opacity:1;filter:alpha(opacity=100)}#adminmenu li.wp-menu-separator{height:5px;padding:0;margin:0 0 6px 0;cursor:inherit}#adminmenu div.separator{height:2px;padding:0}#adminmenu .wp-submenu .wp-submenu-head{color:#fff;font-weight:400;font-size:14px;padding:8px 11px 8px 4px;margin:-7px 0 4px}#adminmenu li.current,.folded #adminmenu li.wp-menu-open{border:0 none}#adminmenu .awaiting-mod,#adminmenu .update-plugins{display:inline-block;vertical-align:top;box-sizing:border-box;margin:1px 2px -1px 0;padding:0 5px;min-width:18px;height:18px;border-radius:9px;background-color:#ca4a1f;color:#fff;font-size:11px;line-height:1.6;text-align:center;z-index:26}#adminmenu li a.wp-has-current-submenu .update-plugins,#adminmenu li.current a .awaiting-mod{background-color:#ca4a1f;color:#fff}#adminmenu li span.count-0{display:none}#collapse-button{display:block;width:100%;height:34px;margin:0;border:none;padding:0;position:relative;overflow:visible;background:0 0;color:#aaa;cursor:pointer}#collapse-button:hover{color:#00b9eb}#collapse-button:focus{color:#00b9eb;outline:1px solid transparent;outline-offset:-1px}#collapse-button .collapse-button-icon,#collapse-button .collapse-button-label{display:block;position:absolute;top:0;right:0}#collapse-button .collapse-button-label{top:8px}#collapse-button .collapse-button-icon{width:36px;height:34px}#collapse-button .collapse-button-label{padding:0 36px 0 0}.folded #collapse-button .collapse-button-label{display:none}#collapse-button .collapse-button-icon:after{content:"\f148";display:block;position:relative;top:7px;text-align:center;font:normal 20px/1 dashicons!important;speak:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.folded #collapse-button .collapse-button-icon:after,.rtl #collapse-button .collapse-button-icon:after{transform:rotate(180deg)}.rtl.folded #collapse-button .collapse-button-icon:after{transform:none}#collapse-button .collapse-button-icon:after,#collapse-button .collapse-button-label{transition:all .1s ease-in-out}li#wp-admin-bar-menu-toggle{display:none}.customize-support #menu-appearance a[href="themes.php?page=custom-background"],.customize-support #menu-appearance a[href="themes.php?page=custom-header"]{display:none}@media only screen and (max-width:960px){.auto-fold #wpcontent,.auto-fold #wpfooter{margin-right:36px}.auto-fold #adminmenu,.auto-fold #adminmenu li.menu-top,.auto-fold #adminmenuback,.auto-fold #adminmenuwrap{width:36px}.auto-fold #adminmenu .opensub .wp-submenu,.auto-fold #adminmenu .wp-has-current-submenu .wp-submenu.sub-open,.auto-fold #adminmenu .wp-has-current-submenu a.menu-top:focus+.wp-submenu,.auto-fold #adminmenu .wp-has-current-submenu.opensub .wp-submenu,.auto-fold #adminmenu .wp-submenu.sub-open,.auto-fold #adminmenu a.menu-top:focus+.wp-submenu{top:0;right:36px}.auto-fold #adminmenu .wp-has-current-submenu .wp-submenu,.auto-fold #adminmenu a.wp-has-current-submenu:focus+.wp-submenu{position:absolute;top:-1000em;margin-left:-1px;padding:7px 0 8px;z-index:9999}.auto-fold #adminmenu .wp-has-current-submenu .wp-submenu{min-width:150px;width:auto}.auto-fold #adminmenu .wp-has-current-submenu li>a{padding-left:16px;padding-right:14px}.auto-fold #adminmenu li.menu-top .wp-submenu>li>a{padding-right:12px}.auto-fold #adminmenu .wp-menu-name{position:absolute;right:-999px}.auto-fold #adminmenu .wp-submenu-head{display:block}.auto-fold #adminmenu div.wp-menu-image{height:30px;width:34px;position:absolute;z-index:25}.auto-fold #adminmenu a.menu-top{height:34px}.auto-fold #adminmenu li.wp-menu-open{border:0 none}.auto-fold #adminmenu .wp-has-current-submenu.menu-top-last{margin-bottom:0}.auto-fold ul#adminmenu li:hover a.wp-has-current-submenu:after{display:none}.auto-fold ul#adminmenu li.wp-has-submenu.wp-not-current-submenu:hover:after{border-width:4px;margin-top:-4px;top:16px}.auto-fold ul#adminmenu a.wp-has-current-submenu:after,.auto-fold ul#adminmenu>li a.current:after{border-width:4px;margin-top:-4px}.auto-fold #adminmenu li.menu-top:hover,.auto-fold #adminmenu li.opensub>a.menu-top,.auto-fold #adminmenu li>a.menu-top:focus{z-index:10000}.auto-fold #collapse-menu .collapse-button-label{display:none}.auto-fold #collapse-button .collapse-button-icon:after{transform:rotate(180deg)}.rtl.auto-fold #collapse-button .collapse-button-icon:after{transform:none}}@media screen and (max-width:782px){.auto-fold #wpcontent{position:relative;margin-right:0;padding-right:10px}.sticky-menu #adminmenuwrap{position:relative;z-index:auto;top:0}.auto-fold #adminmenu,.auto-fold #adminmenuback,.auto-fold #adminmenuwrap{position:absolute;width:190px;z-index:100}.auto-fold #adminmenuback,.auto-fold #adminmenuwrap{display:none}.auto-fold .wp-responsive-open #adminmenuback,.auto-fold .wp-responsive-open #adminmenuwrap{display:block}.auto-fold #adminmenu li.menu-top{width:100%}.auto-fold #adminmenu li a{font-size:16px;padding:5px}.auto-fold #adminmenu li.menu-top .wp-submenu>li>a{padding:10px 20px 10px 10px}.auto-fold #adminmenu .wp-menu-name{position:static;margin-right:35px}.auto-fold ul#adminmenu a.wp-has-current-submenu:after,.auto-fold ul#adminmenu>li.current>a.current:after{border-width:8px;margin-top:-8px}.auto-fold ul#adminmenu li.wp-has-submenu.wp-not-current-submenu:hover:after{display:none}#adminmenu .wp-submenu{position:relative;display:none}.auto-fold #adminmenu .selected .wp-submenu,.auto-fold #adminmenu .wp-menu-open .wp-submenu{position:relative;display:block;top:0;right:-1px;box-shadow:none}.auto-fold #adminmenu .selected .wp-submenu:after,.auto-fold #adminmenu .wp-menu-open .wp-submenu:after{display:none}.auto-fold #adminmenu .opensub .wp-submenu{display:none}.auto-fold #adminmenu .selected .wp-submenu{display:block}.auto-fold ul#adminmenu li:hover a.wp-has-current-submenu:after{display:block}.auto-fold #adminmenu .wp-has-current-submenu a.menu-top:focus+.wp-submenu,.auto-fold #adminmenu a.menu-top:focus+.wp-submenu{position:relative;right:-1px;left:0;top:0}#adminmenu .wp-submenu .wp-submenu-head{display:none}#wp-responsive-toggle{position:fixed;top:5px;right:4px;padding-left:10px;z-index:99999;border:none;box-sizing:border-box}#wpadminbar #wp-admin-bar-menu-toggle a{display:block;padding:0;overflow:hidden;outline:0;text-decoration:none;border:1px solid transparent;background:0 0;height:44px;margin-right:-1px}.wp-responsive-open #wpadminbar #wp-admin-bar-menu-toggle a{background:#32373c}li#wp-admin-bar-menu-toggle{display:block}#wpadminbar #wp-admin-bar-menu-toggle a:hover{border:1px solid transparent}#wpadminbar #wp-admin-bar-menu-toggle .ab-icon:before{content:"\f228";display:inline-block;float:right;font:normal 40px/45px dashicons;vertical-align:middle;outline:0;margin:0;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;height:44px;width:50px;padding:0;border:none;text-align:center;text-decoration:none;box-sizing:border-box}.wp-responsive-open #wpadminbar #wp-admin-bar-menu-toggle .ab-icon:before{color:#00b9eb}}@media screen and (max-width:600px){#adminmenuback,#adminmenuwrap{display:none}.wp-responsive-open #adminmenuback,.wp-responsive-open #adminmenuwrap{display:block}.auto-fold #adminmenu{top:46px}} \ No newline at end of file
diff --git a/www/crm/wp-admin/css/admin-menu.css b/www/crm/wp-admin/css/admin-menu.css
new file mode 100644
index 00000000..4e06ba31
--- /dev/null
+++ b/www/crm/wp-admin/css/admin-menu.css
@@ -0,0 +1,928 @@
+#adminmenuback,
+#adminmenuwrap,
+#adminmenu,
+#adminmenu .wp-submenu {
+ width: 160px;
+ background-color: #23282d;
+}
+
+#adminmenuback {
+ position: fixed;
+ top: 0;
+ bottom: -120px;
+ z-index: 1; /* positive z-index to avoid elastic scrolling woes in Safari */
+}
+
+#adminmenu {
+ clear: left;
+ margin: 12px 0;
+ padding: 0;
+ list-style: none;
+}
+
+.folded #adminmenuback,
+.folded #adminmenuwrap,
+.folded #adminmenu,
+.folded #adminmenu li.menu-top {
+ width: 36px;
+}
+
+.icon16 {
+ height: 18px;
+ width: 18px;
+ padding: 6px 6px;
+ margin: -6px 0 0 -8px;
+ float: left;
+}
+
+/* New Menu icons */
+
+.icon16:before {
+ color: #82878c; /* same as new icons */
+ font: normal 20px/1 dashicons;
+ speak: none;
+ padding: 6px 0;
+ height: 34px;
+ width: 20px;
+ display: inline-block;
+ -webkit-font-smoothing: antialiased;
+ -moz-osx-font-smoothing: grayscale;
+ transition: all .1s ease-in-out;
+}
+
+.icon16.icon-dashboard:before {
+ content: "\f226";
+}
+
+.icon16.icon-post:before {
+ content: "\f109";
+}
+
+.icon16.icon-media:before {
+ content: "\f104";
+}
+
+.icon16.icon-links:before {
+ content: "\f103";
+}
+
+.icon16.icon-page:before {
+ content: "\f105";
+}
+
+.icon16.icon-comments:before {
+ content: "\f101";
+ margin-top: 1px;
+}
+
+.icon16.icon-appearance:before {
+ content: "\f100";
+}
+
+.icon16.icon-plugins:before {
+ content: "\f106";
+}
+
+.icon16.icon-users:before {
+ content: "\f110";
+}
+
+.icon16.icon-tools:before {
+ content: "\f107";
+}
+
+.icon16.icon-settings:before {
+ content: "\f108";
+}
+
+.icon16.icon-site:before {
+ content: "\f541";
+}
+
+.icon16.icon-generic:before {
+ content: "\f111";
+}
+
+/* hide background-image for icons above */
+.icon16.icon-dashboard,
+.menu-icon-dashboard div.wp-menu-image,
+.icon16.icon-post,
+.menu-icon-post div.wp-menu-image,
+.icon16.icon-media,
+.menu-icon-media div.wp-menu-image,
+.icon16.icon-links,
+.menu-icon-links div.wp-menu-image,
+.icon16.icon-page,
+.menu-icon-page div.wp-menu-image,
+.icon16.icon-comments,
+.menu-icon-comments div.wp-menu-image,
+.icon16.icon-appearance,
+.menu-icon-appearance div.wp-menu-image,
+.icon16.icon-plugins,
+.menu-icon-plugins div.wp-menu-image,
+.icon16.icon-users,
+.menu-icon-users div.wp-menu-image,
+.icon16.icon-tools,
+.menu-icon-tools div.wp-menu-image,
+.icon16.icon-settings,
+.menu-icon-settings div.wp-menu-image,
+.icon16.icon-site,
+.menu-icon-site div.wp-menu-image,
+.icon16.icon-generic,
+.menu-icon-generic div.wp-menu-image {
+ background-image: none !important;
+}
+
+/*------------------------------------------------------------------------------
+ 7.0 - Main Navigation (Left Menu)
+------------------------------------------------------------------------------*/
+
+#adminmenuwrap {
+ position: relative;
+ float: left;
+ z-index: 9990;
+}
+
+/* side admin menu */
+#adminmenu * {
+ -webkit-user-select: none;
+ -moz-user-select: none;
+ -ms-user-select: none;
+ user-select: none;
+}
+
+#adminmenu li {
+ margin: 0;
+ padding: 0;
+ cursor: pointer;
+}
+
+#adminmenu a {
+ display: block;
+ line-height: 1.3;
+ padding: 2px 5px;
+ color: #eee;
+}
+
+#adminmenu .wp-submenu a {
+ color: #b4b9be;
+ color: rgba(240, 245, 250, 0.7);
+}
+
+#adminmenu .wp-submenu a:hover,
+#adminmenu .wp-submenu a:focus {
+ background: none;
+}
+
+#adminmenu a:hover,
+#adminmenu li.menu-top > a:focus,
+#adminmenu .wp-submenu a:hover,
+#adminmenu .wp-submenu a:focus {
+ color: #00b9eb;
+}
+
+#adminmenu li.menu-top {
+ border: none;
+ min-height: 34px;
+ position: relative;
+}
+
+#adminmenu .wp-submenu {
+ list-style: none;
+ position: absolute;
+ top: -1000em;
+ left: 160px;
+ overflow: visible;
+ word-wrap: break-word;
+}
+
+#adminmenu .wp-submenu,
+.folded #adminmenu a.wp-has-current-submenu:focus + .wp-submenu,
+.folded #adminmenu .wp-has-current-submenu .wp-submenu {
+ padding: 7px 0 8px;
+ z-index: 9999;
+ background-color: #32373c;
+ box-shadow: 0 3px 5px rgba(0, 0, 0, 0.2);
+}
+
+.js #adminmenu .sub-open,
+.js #adminmenu .opensub .wp-submenu,
+#adminmenu a.menu-top:focus + .wp-submenu,
+.no-js li.wp-has-submenu:hover .wp-submenu {
+ top: -1px;
+}
+
+#adminmenu .wp-has-current-submenu .wp-submenu,
+.no-js li.wp-has-current-submenu:hover .wp-submenu,
+#adminmenu a.wp-has-current-submenu:focus + .wp-submenu,
+#adminmenu .wp-has-current-submenu .wp-submenu.sub-open,
+#adminmenu .wp-has-current-submenu.opensub .wp-submenu {
+ position: relative;
+ z-index: 3;
+ top: auto;
+ left: auto;
+ right: auto;
+ bottom: auto;
+ border: 0 none;
+ margin-top: 0;
+ box-shadow: none;
+ background-color: #32373c;
+}
+
+/* ensure that wp-submenu's box shadow doesn't appear on top of the focused menu item's background. */
+#adminmenu li.menu-top:hover,
+#adminmenu li.opensub > a.menu-top,
+#adminmenu li > a.menu-top:focus {
+ position: relative;
+ background-color: #191e23;
+ color: #00b9eb;
+}
+
+.folded #adminmenu li.menu-top:hover,
+.folded #adminmenu li.opensub > a.menu-top,
+.folded #adminmenu li > a.menu-top:focus {
+ z-index: 10000;
+}
+
+#adminmenu li.wp-has-current-submenu a.wp-has-current-submenu,
+#adminmenu li.current a.menu-top,
+.folded #adminmenu li.wp-has-current-submenu,
+.folded #adminmenu li.current.menu-top,
+#adminmenu .wp-menu-arrow,
+#adminmenu .wp-has-current-submenu .wp-submenu .wp-submenu-head,
+#adminmenu .wp-menu-arrow div {
+ background: #0073aa;
+ color: #fff;
+}
+
+.folded #adminmenu .wp-submenu.sub-open,
+.folded #adminmenu .opensub .wp-submenu,
+.folded #adminmenu .wp-has-current-submenu .wp-submenu.sub-open,
+.folded #adminmenu .wp-has-current-submenu.opensub .wp-submenu,
+.folded #adminmenu a.menu-top:focus + .wp-submenu,
+.folded #adminmenu .wp-has-current-submenu a.menu-top:focus + .wp-submenu,
+.no-js.folded #adminmenu .wp-has-submenu:hover .wp-submenu {
+ top: 0;
+ left: 36px;
+}
+
+.folded #adminmenu a.wp-has-current-submenu:focus + .wp-submenu,
+.folded #adminmenu .wp-has-current-submenu .wp-submenu {
+ position: absolute;
+ top: -1000em;
+}
+
+#adminmenu .wp-not-current-submenu .wp-submenu,
+.folded #adminmenu .wp-has-current-submenu .wp-submenu {
+ min-width: 160px;
+ width: auto;
+}
+
+#adminmenu .wp-submenu a {
+ font-size: 13px;
+ line-height: 1.4;
+ margin: 0;
+ padding: 5px 0;
+}
+
+#adminmenu .wp-submenu li.current,
+#adminmenu .wp-submenu li.current a,
+#adminmenu .opensub .wp-submenu li.current a,
+#adminmenu a.wp-has-current-submenu:focus + .wp-submenu li.current a,
+#adminmenu .wp-submenu li.current a:hover,
+#adminmenu .wp-submenu li.current a:focus {
+ color: #fff;
+}
+
+#adminmenu .wp-not-current-submenu li > a,
+.folded #adminmenu .wp-has-current-submenu li > a {
+ padding-right: 16px;
+ padding-left: 14px;
+ /* Exclude from the transition the outline for Windows High Contrast mode */
+ transition: all .1s ease-in-out, outline 0s;
+}
+
+#adminmenu .wp-has-current-submenu ul > li > a,
+.folded #adminmenu li.menu-top .wp-submenu > li > a {
+ padding: 5px 12px;
+}
+
+#adminmenu a.menu-top,
+#adminmenu .wp-submenu-head {
+ font-size: 14px;
+ font-weight: 400;
+ line-height: 1.3;
+ padding: 0;
+}
+
+#adminmenu .wp-submenu-head {
+ display: none;
+}
+
+.folded #adminmenu .wp-menu-name {
+ position: absolute;
+ left: -999px;
+}
+
+.folded #adminmenu .wp-submenu-head {
+ display: block;
+}
+
+#adminmenu .wp-submenu li {
+ padding: 0;
+ margin: 0;
+}
+
+#adminmenu .wp-menu-image img {
+ padding: 9px 0 0 0;
+ opacity: 0.6;
+ filter: alpha(opacity=60);
+}
+
+#adminmenu div.wp-menu-name {
+ padding: 8px 0;
+}
+
+#adminmenu div.wp-menu-image {
+ float: left;
+ width: 36px;
+ height: 34px;
+ margin: 0;
+ text-align: center;
+}
+
+#adminmenu div.wp-menu-image.svg {
+ background-repeat: no-repeat;
+ background-position: center;
+ background-size: 20px auto;
+}
+
+div.wp-menu-image:before {
+ color: #a0a5aa;
+ color: rgba(240, 245, 250, 0.6);
+ padding: 7px 0;
+ transition: all .1s ease-in-out;
+}
+
+#adminmenu div.wp-menu-image:before {
+ color: #a0a5aa;
+ color: rgba(240, 245, 250, 0.6);
+}
+
+#adminmenu li.wp-has-current-submenu:hover div.wp-menu-image:before,
+#adminmenu .wp-has-current-submenu div.wp-menu-image:before,
+#adminmenu .current div.wp-menu-image:before,
+#adminmenu a.wp-has-current-submenu:hover div.wp-menu-image:before,
+#adminmenu a.current:hover div.wp-menu-image:before,
+#adminmenu li.wp-has-current-submenu a:focus div.wp-menu-image:before,
+#adminmenu li.wp-has-current-submenu.opensub div.wp-menu-image:before {
+ color: #fff;
+}
+
+#adminmenu li:hover div.wp-menu-image:before,
+#adminmenu li a:focus div.wp-menu-image:before,
+#adminmenu li.opensub div.wp-menu-image:before {
+ color: #00b9eb;
+}
+
+/* IE8 doesn't redraw the pseudo elements unless you make a change to the content, this restore the initial color after hover */
+.ie8 #adminmenu li.opensub div.wp-menu-image:before {
+ color: #a0a5aa;
+}
+
+.folded #adminmenu div.wp-menu-image {
+ width: 35px;
+ height: 30px;
+ position: absolute;
+ z-index: 25;
+}
+
+.folded #adminmenu a.menu-top {
+ height: 34px;
+}
+
+/* No @font-face support */
+.no-font-face #adminmenu .wp-menu-image {
+ display: none;
+}
+
+.no-font-face #adminmenu div.wp-menu-name {
+ padding: 8px 12px;
+}
+
+.no-font-face.auto-fold #adminmenu .wp-menu-name {
+ margin-left: 0;
+}
+/* End no @font-face support */
+
+/* Sticky admin menu */
+.sticky-menu #adminmenuwrap {
+ position: fixed;
+}
+
+/* A new arrow */
+
+.wp-menu-arrow {
+ display: none !important;
+}
+
+ul#adminmenu a.wp-has-current-submenu {
+ position: relative;
+}
+
+ul#adminmenu a.wp-has-current-submenu:after,
+ul#adminmenu > li.current > a.current:after {
+ right: 0;
+ border: solid 8px transparent;
+ content: " ";
+ height: 0;
+ width: 0;
+ position: absolute;
+ pointer-events: none;
+ border-right-color: #f1f1f1;
+ top: 50%;
+ margin-top: -8px;
+}
+
+.folded ul#adminmenu li:hover a.wp-has-current-submenu:after {
+ display: none;
+}
+
+.folded ul#adminmenu a.wp-has-current-submenu:after,
+.folded ul#adminmenu > li a.current:after {
+ border-width: 4px;
+ margin-top: -4px;
+}
+
+/* flyout menu arrow */
+#adminmenu li.wp-has-submenu.wp-not-current-submenu:hover:after {
+ right: 0;
+ border: solid transparent;
+ content: " ";
+ height: 0;
+ width: 0;
+ position: absolute;
+ pointer-events: none;
+ border-width: 8px;
+ top: 10px;
+ z-index: 10000;
+}
+
+.folded ul#adminmenu li.wp-has-submenu.wp-not-current-submenu:hover:after {
+ border-width: 4px;
+ margin-top: -4px;
+ top: 18px;
+}
+
+#adminmenu li.wp-has-submenu.wp-not-current-submenu.opensub:hover:after {
+ border-right-color: #32373c;
+}
+
+#adminmenu li.menu-top:hover .wp-menu-image img,
+#adminmenu li.wp-has-current-submenu .wp-menu-image img {
+ opacity: 1;
+ filter: alpha(opacity=100);
+}
+
+#adminmenu li.wp-menu-separator {
+ height: 5px;
+ padding: 0;
+ margin: 0 0 6px 0;
+ cursor: inherit;
+}
+
+/* @todo: is this even needed given that it's nested beneath the above li.wp-menu-separator? */
+#adminmenu div.separator {
+ height: 2px;
+ padding: 0;
+}
+
+#adminmenu .wp-submenu .wp-submenu-head {
+ color: #fff;
+ font-weight: 400;
+ font-size: 14px;
+ padding: 8px 4px 8px 11px;
+ margin: -7px 0px 4px;
+}
+
+#adminmenu li.current,
+.folded #adminmenu li.wp-menu-open {
+ border: 0 none;
+}
+
+/* @todo: consider to use a single rule for these counters and the list table comments counters. */
+#adminmenu .awaiting-mod,
+#adminmenu .update-plugins {
+ display: inline-block;
+ vertical-align: top;
+ box-sizing: border-box;
+ margin: 1px 0 -1px 2px;
+ padding: 0 5px;
+ min-width: 18px;
+ height: 18px;
+ border-radius: 9px;
+ background-color: #ca4a1f;
+ color: #fff;
+ font-size: 11px;
+ line-height: 1.6;
+ text-align: center;
+ z-index: 26;
+}
+
+#adminmenu li.current a .awaiting-mod,
+#adminmenu li a.wp-has-current-submenu .update-plugins {
+ background-color: #ca4a1f;
+ color: #fff;
+}
+
+#adminmenu li span.count-0 {
+ display: none;
+}
+
+#collapse-button {
+ display: block;
+ width: 100%;
+ height: 34px;
+ margin: 0;
+ border: none;
+ padding: 0;
+ position: relative;
+ overflow: visible;
+ background: none;
+ color: #aaa;
+ cursor: pointer;
+}
+
+#collapse-button:hover {
+ color: #00b9eb;
+}
+
+#collapse-button:focus {
+ color: #00b9eb;
+ /* Only visible in Windows High Contrast mode */
+ outline: 1px solid transparent;
+ outline-offset: -1px;
+}
+
+#collapse-button .collapse-button-icon,
+#collapse-button .collapse-button-label {
+ /* absolutely positioned to avoid 1px shift in IE when button is pressed */
+ display: block;
+ position: absolute;
+ top: 0;
+ left: 0;
+}
+
+#collapse-button .collapse-button-label {
+ top: 8px;
+}
+
+#collapse-button .collapse-button-icon {
+ width: 36px;
+ height: 34px;
+}
+
+#collapse-button .collapse-button-label {
+ padding: 0 0 0 36px;
+}
+
+.folded #collapse-button .collapse-button-label {
+ display: none;
+}
+
+#collapse-button .collapse-button-icon:after {
+ content: "\f148";
+ display: block;
+ position: relative;
+ top: 7px;
+ text-align: center;
+ font: normal 20px/1 dashicons !important;
+ speak: none;
+ -webkit-font-smoothing: antialiased;
+ -moz-osx-font-smoothing: grayscale;
+}
+
+/* rtl:ignore */
+.folded #collapse-button .collapse-button-icon:after,
+.rtl #collapse-button .collapse-button-icon:after {
+ transform: rotate(180deg);
+}
+
+.rtl.folded #collapse-button .collapse-button-icon:after {
+ transform: none;
+}
+
+#collapse-button .collapse-button-icon:after,
+#collapse-button .collapse-button-label {
+ transition: all .1s ease-in-out;
+}
+
+/**
+ * Toolbar menu toggle
+ */
+li#wp-admin-bar-menu-toggle {
+ display: none;
+}
+
+/* Hide-if-customize for items we can't add classes to */
+.customize-support #menu-appearance a[href="themes.php?page=custom-header"],
+.customize-support #menu-appearance a[href="themes.php?page=custom-background"] {
+ display: none;
+}
+
+/* Auto-folding of the admin menu */
+@media only screen and (max-width: 960px) {
+ .auto-fold #wpcontent,
+ .auto-fold #wpfooter {
+ margin-left: 36px;
+ }
+
+ .auto-fold #adminmenuback,
+ .auto-fold #adminmenuwrap,
+ .auto-fold #adminmenu,
+ .auto-fold #adminmenu li.menu-top {
+ width: 36px;
+ }
+
+ .auto-fold #adminmenu .wp-submenu.sub-open,
+ .auto-fold #adminmenu .opensub .wp-submenu,
+ .auto-fold #adminmenu .wp-has-current-submenu .wp-submenu.sub-open,
+ .auto-fold #adminmenu .wp-has-current-submenu.opensub .wp-submenu,
+ .auto-fold #adminmenu a.menu-top:focus + .wp-submenu,
+ .auto-fold #adminmenu .wp-has-current-submenu a.menu-top:focus + .wp-submenu {
+ top: 0px;
+ left: 36px;
+ }
+
+ .auto-fold #adminmenu a.wp-has-current-submenu:focus + .wp-submenu,
+ .auto-fold #adminmenu .wp-has-current-submenu .wp-submenu {
+ position: absolute;
+ top: -1000em;
+ margin-right: -1px;
+ padding: 7px 0 8px;
+ z-index: 9999;
+ }
+
+ .auto-fold #adminmenu .wp-has-current-submenu .wp-submenu {
+ min-width: 150px;
+ width: auto;
+ }
+
+ .auto-fold #adminmenu .wp-has-current-submenu li > a {
+ padding-right: 16px;
+ padding-left: 14px;
+ }
+
+
+ .auto-fold #adminmenu li.menu-top .wp-submenu > li > a {
+ padding-left: 12px;
+ }
+
+ .auto-fold #adminmenu .wp-menu-name {
+ position: absolute;
+ left: -999px;
+ }
+
+ .auto-fold #adminmenu .wp-submenu-head {
+ display: block;
+ }
+
+ .auto-fold #adminmenu div.wp-menu-image {
+ height: 30px;
+ width: 34px;
+ position: absolute;
+ z-index: 25;
+ }
+
+ .auto-fold #adminmenu a.menu-top {
+ height: 34px;
+ }
+
+ .auto-fold #adminmenu li.wp-menu-open {
+ border: 0 none;
+ }
+
+ .auto-fold #adminmenu .wp-has-current-submenu.menu-top-last {
+ margin-bottom: 0;
+ }
+
+ .auto-fold ul#adminmenu li:hover a.wp-has-current-submenu:after {
+ display: none;
+ }
+
+ .auto-fold ul#adminmenu li.wp-has-submenu.wp-not-current-submenu:hover:after {
+ border-width: 4px;
+ margin-top: -4px;
+ top: 16px;
+ }
+
+ .auto-fold ul#adminmenu a.wp-has-current-submenu:after,
+ .auto-fold ul#adminmenu > li a.current:after {
+ border-width: 4px;
+ margin-top: -4px;
+ }
+
+ .auto-fold #adminmenu li.menu-top:hover,
+ .auto-fold #adminmenu li.opensub > a.menu-top,
+ .auto-fold #adminmenu li > a.menu-top:focus {
+ z-index: 10000;
+ }
+
+ .auto-fold #collapse-menu .collapse-button-label {
+ display: none;
+ }
+
+ /* rtl:ignore */
+ .auto-fold #collapse-button .collapse-button-icon:after {
+ transform: rotate(180deg);
+ }
+
+ .rtl.auto-fold #collapse-button .collapse-button-icon:after {
+ transform: none;
+ }
+
+}
+
+@media screen and (max-width: 782px) {
+ .auto-fold #wpcontent {
+ position: relative;
+ margin-left: 0;
+ padding-left: 10px;
+ }
+
+ .sticky-menu #adminmenuwrap {
+ position: relative;
+ z-index: auto;
+ top: 0;
+ }
+
+ /* Sidebar Adjustments */
+ .auto-fold #adminmenu,
+ .auto-fold #adminmenuback,
+ .auto-fold #adminmenuwrap {
+ position: absolute;
+ width: 190px;
+ z-index: 100;
+ }
+
+ .auto-fold #adminmenuback,
+ .auto-fold #adminmenuwrap {
+ display: none;
+ }
+
+ .auto-fold .wp-responsive-open #adminmenuback,
+ .auto-fold .wp-responsive-open #adminmenuwrap {
+ display: block;
+ }
+
+ .auto-fold #adminmenu li.menu-top {
+ width: 100%;
+ }
+
+ /* Resize the admin menu items to a comfortable touch size */
+ .auto-fold #adminmenu li a {
+ font-size: 16px;
+ padding: 5px;
+ }
+
+ .auto-fold #adminmenu li.menu-top .wp-submenu > li > a {
+ padding: 10px 10px 10px 20px;
+ }
+
+ /* Restore the menu names */
+ .auto-fold #adminmenu .wp-menu-name {
+ position: static;
+ margin-left: 35px;
+ }
+
+ /* Switch the arrow side */
+ .auto-fold ul#adminmenu a.wp-has-current-submenu:after,
+ .auto-fold ul#adminmenu > li.current > a.current:after {
+ border-width: 8px;
+ margin-top: -8px;
+ }
+
+ .auto-fold ul#adminmenu li.wp-has-submenu.wp-not-current-submenu:hover:after {
+ display: none;
+ }
+
+ /* Make the submenus appear correctly when tapped. */
+ #adminmenu .wp-submenu {
+ position: relative;
+ display: none;
+ }
+
+ .auto-fold #adminmenu .selected .wp-submenu,
+ .auto-fold #adminmenu .wp-menu-open .wp-submenu {
+ position: relative;
+ display: block;
+ top: 0;
+ left: -1px;
+ box-shadow: none;
+ }
+
+ .auto-fold #adminmenu .selected .wp-submenu:after,
+ .auto-fold #adminmenu .wp-menu-open .wp-submenu:after {
+ display: none;
+ }
+
+ .auto-fold #adminmenu .opensub .wp-submenu {
+ display: none;
+ }
+
+ .auto-fold #adminmenu .selected .wp-submenu {
+ display: block;
+ }
+
+ .auto-fold ul#adminmenu li:hover a.wp-has-current-submenu:after {
+ display: block;
+ }
+
+ .auto-fold #adminmenu a.menu-top:focus + .wp-submenu,
+ .auto-fold #adminmenu .wp-has-current-submenu a.menu-top:focus + .wp-submenu {
+ position: relative;
+ left: -1px;
+ right: 0;
+ top: 0;
+ }
+
+ /* Remove submenu headers and adjust sub meu*/
+ #adminmenu .wp-submenu .wp-submenu-head {
+ display: none;
+ }
+
+ /* Toolbar menu toggle */
+ #wp-responsive-toggle {
+ position: fixed;
+ top: 5px;
+ left: 4px;
+ padding-right: 10px;
+ z-index: 99999;
+ border: none;
+ box-sizing: border-box;
+ }
+
+ #wpadminbar #wp-admin-bar-menu-toggle a {
+ display: block;
+ padding: 0;
+ overflow: hidden;
+ outline: none;
+ text-decoration: none;
+ border: 1px solid transparent;
+ background: none;
+ height: 44px;
+ margin-left: -1px;
+ }
+
+ .wp-responsive-open #wpadminbar #wp-admin-bar-menu-toggle a {
+ background: #32373c;
+ }
+
+ li#wp-admin-bar-menu-toggle {
+ display: block;
+ }
+
+ #wpadminbar #wp-admin-bar-menu-toggle a:hover {
+ border: 1px solid transparent;
+ }
+
+ #wpadminbar #wp-admin-bar-menu-toggle .ab-icon:before {
+ content: "\f228";
+ display: inline-block;
+ float: left;
+ font: normal 40px/45px dashicons;
+ vertical-align: middle;
+ outline: none;
+ margin: 0;
+ -webkit-font-smoothing: antialiased;
+ -moz-osx-font-smoothing: grayscale;
+ height: 44px;
+ width: 50px;
+ padding: 0;
+ border: none;
+ text-align: center;
+ text-decoration: none;
+ box-sizing: border-box;
+ }
+
+ .wp-responsive-open #wpadminbar #wp-admin-bar-menu-toggle .ab-icon:before {
+ color: #00b9eb;
+ }
+}
+
+/* Smartphone */
+@media screen and (max-width: 600px) {
+ #adminmenuwrap,
+ #adminmenuback {
+ display: none;
+ }
+
+ .wp-responsive-open #adminmenuwrap,
+ .wp-responsive-open #adminmenuback {
+ display: block;
+ }
+
+ .auto-fold #adminmenu {
+ top: 46px;
+ }
+}
diff --git a/www/crm/wp-admin/css/admin-menu.min.css b/www/crm/wp-admin/css/admin-menu.min.css
new file mode 100644
index 00000000..61fac660
--- /dev/null
+++ b/www/crm/wp-admin/css/admin-menu.min.css
@@ -0,0 +1,2 @@
+/*! This file is auto-generated */
+#adminmenu,#adminmenu .wp-submenu,#adminmenuback,#adminmenuwrap{width:160px;background-color:#23282d}#adminmenuback{position:fixed;top:0;bottom:-120px;z-index:1}#adminmenu{clear:left;margin:12px 0;padding:0;list-style:none}.folded #adminmenu,.folded #adminmenu li.menu-top,.folded #adminmenuback,.folded #adminmenuwrap{width:36px}.icon16{height:18px;width:18px;padding:6px 6px;margin:-6px 0 0 -8px;float:left}.icon16:before{color:#82878c;font:normal 20px/1 dashicons;speak:none;padding:6px 0;height:34px;width:20px;display:inline-block;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;transition:all .1s ease-in-out}.icon16.icon-dashboard:before{content:"\f226"}.icon16.icon-post:before{content:"\f109"}.icon16.icon-media:before{content:"\f104"}.icon16.icon-links:before{content:"\f103"}.icon16.icon-page:before{content:"\f105"}.icon16.icon-comments:before{content:"\f101";margin-top:1px}.icon16.icon-appearance:before{content:"\f100"}.icon16.icon-plugins:before{content:"\f106"}.icon16.icon-users:before{content:"\f110"}.icon16.icon-tools:before{content:"\f107"}.icon16.icon-settings:before{content:"\f108"}.icon16.icon-site:before{content:"\f541"}.icon16.icon-generic:before{content:"\f111"}.icon16.icon-appearance,.icon16.icon-comments,.icon16.icon-dashboard,.icon16.icon-generic,.icon16.icon-links,.icon16.icon-media,.icon16.icon-page,.icon16.icon-plugins,.icon16.icon-post,.icon16.icon-settings,.icon16.icon-site,.icon16.icon-tools,.icon16.icon-users,.menu-icon-appearance div.wp-menu-image,.menu-icon-comments div.wp-menu-image,.menu-icon-dashboard div.wp-menu-image,.menu-icon-generic div.wp-menu-image,.menu-icon-links div.wp-menu-image,.menu-icon-media div.wp-menu-image,.menu-icon-page div.wp-menu-image,.menu-icon-plugins div.wp-menu-image,.menu-icon-post div.wp-menu-image,.menu-icon-settings div.wp-menu-image,.menu-icon-site div.wp-menu-image,.menu-icon-tools div.wp-menu-image,.menu-icon-users div.wp-menu-image{background-image:none!important}#adminmenuwrap{position:relative;float:left;z-index:9990}#adminmenu *{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}#adminmenu li{margin:0;padding:0;cursor:pointer}#adminmenu a{display:block;line-height:1.3;padding:2px 5px;color:#eee}#adminmenu .wp-submenu a{color:#b4b9be;color:rgba(240,245,250,.7)}#adminmenu .wp-submenu a:focus,#adminmenu .wp-submenu a:hover{background:0 0}#adminmenu .wp-submenu a:focus,#adminmenu .wp-submenu a:hover,#adminmenu a:hover,#adminmenu li.menu-top>a:focus{color:#00b9eb}#adminmenu li.menu-top{border:none;min-height:34px;position:relative}#adminmenu .wp-submenu{list-style:none;position:absolute;top:-1000em;left:160px;overflow:visible;word-wrap:break-word}#adminmenu .wp-submenu,.folded #adminmenu .wp-has-current-submenu .wp-submenu,.folded #adminmenu a.wp-has-current-submenu:focus+.wp-submenu{padding:7px 0 8px;z-index:9999;background-color:#32373c;box-shadow:0 3px 5px rgba(0,0,0,.2)}#adminmenu a.menu-top:focus+.wp-submenu,.js #adminmenu .opensub .wp-submenu,.js #adminmenu .sub-open,.no-js li.wp-has-submenu:hover .wp-submenu{top:-1px}#adminmenu .wp-has-current-submenu .wp-submenu,#adminmenu .wp-has-current-submenu .wp-submenu.sub-open,#adminmenu .wp-has-current-submenu.opensub .wp-submenu,#adminmenu a.wp-has-current-submenu:focus+.wp-submenu,.no-js li.wp-has-current-submenu:hover .wp-submenu{position:relative;z-index:3;top:auto;left:auto;right:auto;bottom:auto;border:0 none;margin-top:0;box-shadow:none;background-color:#32373c}#adminmenu li.menu-top:hover,#adminmenu li.opensub>a.menu-top,#adminmenu li>a.menu-top:focus{position:relative;background-color:#191e23;color:#00b9eb}.folded #adminmenu li.menu-top:hover,.folded #adminmenu li.opensub>a.menu-top,.folded #adminmenu li>a.menu-top:focus{z-index:10000}#adminmenu .wp-has-current-submenu .wp-submenu .wp-submenu-head,#adminmenu .wp-menu-arrow,#adminmenu .wp-menu-arrow div,#adminmenu li.current a.menu-top,#adminmenu li.wp-has-current-submenu a.wp-has-current-submenu,.folded #adminmenu li.current.menu-top,.folded #adminmenu li.wp-has-current-submenu{background:#0073aa;color:#fff}.folded #adminmenu .opensub .wp-submenu,.folded #adminmenu .wp-has-current-submenu .wp-submenu.sub-open,.folded #adminmenu .wp-has-current-submenu a.menu-top:focus+.wp-submenu,.folded #adminmenu .wp-has-current-submenu.opensub .wp-submenu,.folded #adminmenu .wp-submenu.sub-open,.folded #adminmenu a.menu-top:focus+.wp-submenu,.no-js.folded #adminmenu .wp-has-submenu:hover .wp-submenu{top:0;left:36px}.folded #adminmenu .wp-has-current-submenu .wp-submenu,.folded #adminmenu a.wp-has-current-submenu:focus+.wp-submenu{position:absolute;top:-1000em}#adminmenu .wp-not-current-submenu .wp-submenu,.folded #adminmenu .wp-has-current-submenu .wp-submenu{min-width:160px;width:auto}#adminmenu .wp-submenu a{font-size:13px;line-height:1.4;margin:0;padding:5px 0}#adminmenu .opensub .wp-submenu li.current a,#adminmenu .wp-submenu li.current,#adminmenu .wp-submenu li.current a,#adminmenu .wp-submenu li.current a:focus,#adminmenu .wp-submenu li.current a:hover,#adminmenu a.wp-has-current-submenu:focus+.wp-submenu li.current a{color:#fff}#adminmenu .wp-not-current-submenu li>a,.folded #adminmenu .wp-has-current-submenu li>a{padding-right:16px;padding-left:14px;transition:all .1s ease-in-out,outline 0s}#adminmenu .wp-has-current-submenu ul>li>a,.folded #adminmenu li.menu-top .wp-submenu>li>a{padding:5px 12px}#adminmenu .wp-submenu-head,#adminmenu a.menu-top{font-size:14px;font-weight:400;line-height:1.3;padding:0}#adminmenu .wp-submenu-head{display:none}.folded #adminmenu .wp-menu-name{position:absolute;left:-999px}.folded #adminmenu .wp-submenu-head{display:block}#adminmenu .wp-submenu li{padding:0;margin:0}#adminmenu .wp-menu-image img{padding:9px 0 0 0;opacity:.6;filter:alpha(opacity=60)}#adminmenu div.wp-menu-name{padding:8px 0}#adminmenu div.wp-menu-image{float:left;width:36px;height:34px;margin:0;text-align:center}#adminmenu div.wp-menu-image.svg{background-repeat:no-repeat;background-position:center;background-size:20px auto}div.wp-menu-image:before{color:#a0a5aa;color:rgba(240,245,250,.6);padding:7px 0;transition:all .1s ease-in-out}#adminmenu div.wp-menu-image:before{color:#a0a5aa;color:rgba(240,245,250,.6)}#adminmenu .current div.wp-menu-image:before,#adminmenu .wp-has-current-submenu div.wp-menu-image:before,#adminmenu a.current:hover div.wp-menu-image:before,#adminmenu a.wp-has-current-submenu:hover div.wp-menu-image:before,#adminmenu li.wp-has-current-submenu a:focus div.wp-menu-image:before,#adminmenu li.wp-has-current-submenu.opensub div.wp-menu-image:before,#adminmenu li.wp-has-current-submenu:hover div.wp-menu-image:before{color:#fff}#adminmenu li a:focus div.wp-menu-image:before,#adminmenu li.opensub div.wp-menu-image:before,#adminmenu li:hover div.wp-menu-image:before{color:#00b9eb}.ie8 #adminmenu li.opensub div.wp-menu-image:before{color:#a0a5aa}.folded #adminmenu div.wp-menu-image{width:35px;height:30px;position:absolute;z-index:25}.folded #adminmenu a.menu-top{height:34px}.no-font-face #adminmenu .wp-menu-image{display:none}.no-font-face #adminmenu div.wp-menu-name{padding:8px 12px}.no-font-face.auto-fold #adminmenu .wp-menu-name{margin-left:0}.sticky-menu #adminmenuwrap{position:fixed}.wp-menu-arrow{display:none!important}ul#adminmenu a.wp-has-current-submenu{position:relative}ul#adminmenu a.wp-has-current-submenu:after,ul#adminmenu>li.current>a.current:after{right:0;border:solid 8px transparent;content:" ";height:0;width:0;position:absolute;pointer-events:none;border-right-color:#f1f1f1;top:50%;margin-top:-8px}.folded ul#adminmenu li:hover a.wp-has-current-submenu:after{display:none}.folded ul#adminmenu a.wp-has-current-submenu:after,.folded ul#adminmenu>li a.current:after{border-width:4px;margin-top:-4px}#adminmenu li.wp-has-submenu.wp-not-current-submenu:hover:after{right:0;border:solid transparent;content:" ";height:0;width:0;position:absolute;pointer-events:none;border-width:8px;top:10px;z-index:10000}.folded ul#adminmenu li.wp-has-submenu.wp-not-current-submenu:hover:after{border-width:4px;margin-top:-4px;top:18px}#adminmenu li.wp-has-submenu.wp-not-current-submenu.opensub:hover:after{border-right-color:#32373c}#adminmenu li.menu-top:hover .wp-menu-image img,#adminmenu li.wp-has-current-submenu .wp-menu-image img{opacity:1;filter:alpha(opacity=100)}#adminmenu li.wp-menu-separator{height:5px;padding:0;margin:0 0 6px 0;cursor:inherit}#adminmenu div.separator{height:2px;padding:0}#adminmenu .wp-submenu .wp-submenu-head{color:#fff;font-weight:400;font-size:14px;padding:8px 4px 8px 11px;margin:-7px 0 4px}#adminmenu li.current,.folded #adminmenu li.wp-menu-open{border:0 none}#adminmenu .awaiting-mod,#adminmenu .update-plugins{display:inline-block;vertical-align:top;box-sizing:border-box;margin:1px 0 -1px 2px;padding:0 5px;min-width:18px;height:18px;border-radius:9px;background-color:#ca4a1f;color:#fff;font-size:11px;line-height:1.6;text-align:center;z-index:26}#adminmenu li a.wp-has-current-submenu .update-plugins,#adminmenu li.current a .awaiting-mod{background-color:#ca4a1f;color:#fff}#adminmenu li span.count-0{display:none}#collapse-button{display:block;width:100%;height:34px;margin:0;border:none;padding:0;position:relative;overflow:visible;background:0 0;color:#aaa;cursor:pointer}#collapse-button:hover{color:#00b9eb}#collapse-button:focus{color:#00b9eb;outline:1px solid transparent;outline-offset:-1px}#collapse-button .collapse-button-icon,#collapse-button .collapse-button-label{display:block;position:absolute;top:0;left:0}#collapse-button .collapse-button-label{top:8px}#collapse-button .collapse-button-icon{width:36px;height:34px}#collapse-button .collapse-button-label{padding:0 0 0 36px}.folded #collapse-button .collapse-button-label{display:none}#collapse-button .collapse-button-icon:after{content:"\f148";display:block;position:relative;top:7px;text-align:center;font:normal 20px/1 dashicons!important;speak:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.folded #collapse-button .collapse-button-icon:after,.rtl #collapse-button .collapse-button-icon:after{transform:rotate(180deg)}.rtl.folded #collapse-button .collapse-button-icon:after{transform:none}#collapse-button .collapse-button-icon:after,#collapse-button .collapse-button-label{transition:all .1s ease-in-out}li#wp-admin-bar-menu-toggle{display:none}.customize-support #menu-appearance a[href="themes.php?page=custom-background"],.customize-support #menu-appearance a[href="themes.php?page=custom-header"]{display:none}@media only screen and (max-width:960px){.auto-fold #wpcontent,.auto-fold #wpfooter{margin-left:36px}.auto-fold #adminmenu,.auto-fold #adminmenu li.menu-top,.auto-fold #adminmenuback,.auto-fold #adminmenuwrap{width:36px}.auto-fold #adminmenu .opensub .wp-submenu,.auto-fold #adminmenu .wp-has-current-submenu .wp-submenu.sub-open,.auto-fold #adminmenu .wp-has-current-submenu a.menu-top:focus+.wp-submenu,.auto-fold #adminmenu .wp-has-current-submenu.opensub .wp-submenu,.auto-fold #adminmenu .wp-submenu.sub-open,.auto-fold #adminmenu a.menu-top:focus+.wp-submenu{top:0;left:36px}.auto-fold #adminmenu .wp-has-current-submenu .wp-submenu,.auto-fold #adminmenu a.wp-has-current-submenu:focus+.wp-submenu{position:absolute;top:-1000em;margin-right:-1px;padding:7px 0 8px;z-index:9999}.auto-fold #adminmenu .wp-has-current-submenu .wp-submenu{min-width:150px;width:auto}.auto-fold #adminmenu .wp-has-current-submenu li>a{padding-right:16px;padding-left:14px}.auto-fold #adminmenu li.menu-top .wp-submenu>li>a{padding-left:12px}.auto-fold #adminmenu .wp-menu-name{position:absolute;left:-999px}.auto-fold #adminmenu .wp-submenu-head{display:block}.auto-fold #adminmenu div.wp-menu-image{height:30px;width:34px;position:absolute;z-index:25}.auto-fold #adminmenu a.menu-top{height:34px}.auto-fold #adminmenu li.wp-menu-open{border:0 none}.auto-fold #adminmenu .wp-has-current-submenu.menu-top-last{margin-bottom:0}.auto-fold ul#adminmenu li:hover a.wp-has-current-submenu:after{display:none}.auto-fold ul#adminmenu li.wp-has-submenu.wp-not-current-submenu:hover:after{border-width:4px;margin-top:-4px;top:16px}.auto-fold ul#adminmenu a.wp-has-current-submenu:after,.auto-fold ul#adminmenu>li a.current:after{border-width:4px;margin-top:-4px}.auto-fold #adminmenu li.menu-top:hover,.auto-fold #adminmenu li.opensub>a.menu-top,.auto-fold #adminmenu li>a.menu-top:focus{z-index:10000}.auto-fold #collapse-menu .collapse-button-label{display:none}.auto-fold #collapse-button .collapse-button-icon:after{transform:rotate(180deg)}.rtl.auto-fold #collapse-button .collapse-button-icon:after{transform:none}}@media screen and (max-width:782px){.auto-fold #wpcontent{position:relative;margin-left:0;padding-left:10px}.sticky-menu #adminmenuwrap{position:relative;z-index:auto;top:0}.auto-fold #adminmenu,.auto-fold #adminmenuback,.auto-fold #adminmenuwrap{position:absolute;width:190px;z-index:100}.auto-fold #adminmenuback,.auto-fold #adminmenuwrap{display:none}.auto-fold .wp-responsive-open #adminmenuback,.auto-fold .wp-responsive-open #adminmenuwrap{display:block}.auto-fold #adminmenu li.menu-top{width:100%}.auto-fold #adminmenu li a{font-size:16px;padding:5px}.auto-fold #adminmenu li.menu-top .wp-submenu>li>a{padding:10px 10px 10px 20px}.auto-fold #adminmenu .wp-menu-name{position:static;margin-left:35px}.auto-fold ul#adminmenu a.wp-has-current-submenu:after,.auto-fold ul#adminmenu>li.current>a.current:after{border-width:8px;margin-top:-8px}.auto-fold ul#adminmenu li.wp-has-submenu.wp-not-current-submenu:hover:after{display:none}#adminmenu .wp-submenu{position:relative;display:none}.auto-fold #adminmenu .selected .wp-submenu,.auto-fold #adminmenu .wp-menu-open .wp-submenu{position:relative;display:block;top:0;left:-1px;box-shadow:none}.auto-fold #adminmenu .selected .wp-submenu:after,.auto-fold #adminmenu .wp-menu-open .wp-submenu:after{display:none}.auto-fold #adminmenu .opensub .wp-submenu{display:none}.auto-fold #adminmenu .selected .wp-submenu{display:block}.auto-fold ul#adminmenu li:hover a.wp-has-current-submenu:after{display:block}.auto-fold #adminmenu .wp-has-current-submenu a.menu-top:focus+.wp-submenu,.auto-fold #adminmenu a.menu-top:focus+.wp-submenu{position:relative;left:-1px;right:0;top:0}#adminmenu .wp-submenu .wp-submenu-head{display:none}#wp-responsive-toggle{position:fixed;top:5px;left:4px;padding-right:10px;z-index:99999;border:none;box-sizing:border-box}#wpadminbar #wp-admin-bar-menu-toggle a{display:block;padding:0;overflow:hidden;outline:0;text-decoration:none;border:1px solid transparent;background:0 0;height:44px;margin-left:-1px}.wp-responsive-open #wpadminbar #wp-admin-bar-menu-toggle a{background:#32373c}li#wp-admin-bar-menu-toggle{display:block}#wpadminbar #wp-admin-bar-menu-toggle a:hover{border:1px solid transparent}#wpadminbar #wp-admin-bar-menu-toggle .ab-icon:before{content:"\f228";display:inline-block;float:left;font:normal 40px/45px dashicons;vertical-align:middle;outline:0;margin:0;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;height:44px;width:50px;padding:0;border:none;text-align:center;text-decoration:none;box-sizing:border-box}.wp-responsive-open #wpadminbar #wp-admin-bar-menu-toggle .ab-icon:before{color:#00b9eb}}@media screen and (max-width:600px){#adminmenuback,#adminmenuwrap{display:none}.wp-responsive-open #adminmenuback,.wp-responsive-open #adminmenuwrap{display:block}.auto-fold #adminmenu{top:46px}} \ No newline at end of file
diff --git a/www/crm/wp-admin/css/code-editor-rtl.css b/www/crm/wp-admin/css/code-editor-rtl.css
new file mode 100644
index 00000000..57aa83b2
--- /dev/null
+++ b/www/crm/wp-admin/css/code-editor-rtl.css
@@ -0,0 +1,76 @@
+.wrap [class*="CodeMirror-lint-marker"],
+.wp-core-ui [class*="CodeMirror-lint-message"],
+.wrap .CodeMirror-lint-marker-multiple {
+ background-image: none;
+}
+
+.wp-core-ui .CodeMirror-lint-marker-error,
+.wp-core-ui .CodeMirror-lint-marker-warning {
+ cursor: help;
+}
+
+.wrap .CodeMirror-lint-marker-multiple {
+ position: absolute;
+ top: 0;
+}
+
+.wrap [class*="CodeMirror-lint-marker"]:before {
+ font: normal 18px/1 dashicons;
+ position: relative;
+ top: -2px;
+}
+
+.wp-core-ui [class*="CodeMirror-lint-message"]:before {
+ font: normal 16px/1 dashicons;
+ right: 16px;
+ position: absolute;
+}
+
+.wp-core-ui .CodeMirror-lint-message-error,
+.wp-core-ui .CodeMirror-lint-message-warning {
+ box-shadow: 0 1px 1px 0 rgba(0, 0, 0, 0.1);
+ margin: 5px 0 2px;
+ padding: 3px 28px 3px 12px;
+}
+
+.wp-core-ui .CodeMirror-lint-message-warning {
+ background-color: #fff8e5;
+ border-right: 4px solid #ffb900;
+}
+
+.wrap .CodeMirror-lint-marker-warning:before,
+.wp-core-ui .CodeMirror-lint-message-warning:before {
+ content: "\f534";
+ color: #f6a306;
+}
+
+.wp-core-ui .CodeMirror-lint-message-error {
+ background-color: #fbeaea;
+ border-right: 4px solid #dc3232;
+}
+
+.wrap .CodeMirror-lint-marker-error:before,
+.wp-core-ui .CodeMirror-lint-message-error:before {
+ content: "\f153";
+ color: #dc3232;
+}
+
+.wp-core-ui .CodeMirror-lint-tooltip {
+ background: none;
+ border: none;
+ border-radius: 0;
+ direction: rtl;
+}
+
+.wrap .CodeMirror .CodeMirror-matchingbracket {
+ background: rgba(255, 150, 0, 0.3);
+ color: inherit;
+}
+
+.CodeMirror {
+ text-align: right;
+}
+
+.wrap .CodeMirror .CodeMirror-linenumber {
+ color: #666;
+}
diff --git a/www/crm/wp-admin/css/code-editor-rtl.min.css b/www/crm/wp-admin/css/code-editor-rtl.min.css
new file mode 100644
index 00000000..b3cb2d95
--- /dev/null
+++ b/www/crm/wp-admin/css/code-editor-rtl.min.css
@@ -0,0 +1,2 @@
+/*! This file is auto-generated */
+.wp-core-ui [class*=CodeMirror-lint-message],.wrap .CodeMirror-lint-marker-multiple,.wrap [class*=CodeMirror-lint-marker]{background-image:none}.wp-core-ui .CodeMirror-lint-marker-error,.wp-core-ui .CodeMirror-lint-marker-warning{cursor:help}.wrap .CodeMirror-lint-marker-multiple{position:absolute;top:0}.wrap [class*=CodeMirror-lint-marker]:before{font:normal 18px/1 dashicons;position:relative;top:-2px}.wp-core-ui [class*=CodeMirror-lint-message]:before{font:normal 16px/1 dashicons;right:16px;position:absolute}.wp-core-ui .CodeMirror-lint-message-error,.wp-core-ui .CodeMirror-lint-message-warning{box-shadow:0 1px 1px 0 rgba(0,0,0,.1);margin:5px 0 2px;padding:3px 28px 3px 12px}.wp-core-ui .CodeMirror-lint-message-warning{background-color:#fff8e5;border-right:4px solid #ffb900}.wp-core-ui .CodeMirror-lint-message-warning:before,.wrap .CodeMirror-lint-marker-warning:before{content:"\f534";color:#f6a306}.wp-core-ui .CodeMirror-lint-message-error{background-color:#fbeaea;border-right:4px solid #dc3232}.wp-core-ui .CodeMirror-lint-message-error:before,.wrap .CodeMirror-lint-marker-error:before{content:"\f153";color:#dc3232}.wp-core-ui .CodeMirror-lint-tooltip{background:0 0;border:none;border-radius:0;direction:rtl}.wrap .CodeMirror .CodeMirror-matchingbracket{background:rgba(255,150,0,.3);color:inherit}.CodeMirror{text-align:right}.wrap .CodeMirror .CodeMirror-linenumber{color:#666} \ No newline at end of file
diff --git a/www/crm/wp-admin/css/code-editor.css b/www/crm/wp-admin/css/code-editor.css
new file mode 100644
index 00000000..27db1fd3
--- /dev/null
+++ b/www/crm/wp-admin/css/code-editor.css
@@ -0,0 +1,76 @@
+.wrap [class*="CodeMirror-lint-marker"],
+.wp-core-ui [class*="CodeMirror-lint-message"],
+.wrap .CodeMirror-lint-marker-multiple {
+ background-image: none;
+}
+
+.wp-core-ui .CodeMirror-lint-marker-error,
+.wp-core-ui .CodeMirror-lint-marker-warning {
+ cursor: help;
+}
+
+.wrap .CodeMirror-lint-marker-multiple {
+ position: absolute;
+ top: 0;
+}
+
+.wrap [class*="CodeMirror-lint-marker"]:before {
+ font: normal 18px/1 dashicons;
+ position: relative;
+ top: -2px;
+}
+
+.wp-core-ui [class*="CodeMirror-lint-message"]:before {
+ font: normal 16px/1 dashicons;
+ left: 16px;
+ position: absolute;
+}
+
+.wp-core-ui .CodeMirror-lint-message-error,
+.wp-core-ui .CodeMirror-lint-message-warning {
+ box-shadow: 0 1px 1px 0 rgba(0, 0, 0, 0.1);
+ margin: 5px 0 2px;
+ padding: 3px 12px 3px 28px;
+}
+
+.wp-core-ui .CodeMirror-lint-message-warning {
+ background-color: #fff8e5;
+ border-left: 4px solid #ffb900;
+}
+
+.wrap .CodeMirror-lint-marker-warning:before,
+.wp-core-ui .CodeMirror-lint-message-warning:before {
+ content: "\f534";
+ color: #f6a306;
+}
+
+.wp-core-ui .CodeMirror-lint-message-error {
+ background-color: #fbeaea;
+ border-left: 4px solid #dc3232;
+}
+
+.wrap .CodeMirror-lint-marker-error:before,
+.wp-core-ui .CodeMirror-lint-message-error:before {
+ content: "\f153";
+ color: #dc3232;
+}
+
+.wp-core-ui .CodeMirror-lint-tooltip {
+ background: none;
+ border: none;
+ border-radius: 0;
+ direction: ltr;
+}
+
+.wrap .CodeMirror .CodeMirror-matchingbracket {
+ background: rgba(255, 150, 0, 0.3);
+ color: inherit;
+}
+
+.CodeMirror {
+ text-align: left;
+}
+
+.wrap .CodeMirror .CodeMirror-linenumber {
+ color: #666;
+}
diff --git a/www/crm/wp-admin/css/code-editor.min.css b/www/crm/wp-admin/css/code-editor.min.css
new file mode 100644
index 00000000..1032975f
--- /dev/null
+++ b/www/crm/wp-admin/css/code-editor.min.css
@@ -0,0 +1,2 @@
+/*! This file is auto-generated */
+.wp-core-ui [class*=CodeMirror-lint-message],.wrap .CodeMirror-lint-marker-multiple,.wrap [class*=CodeMirror-lint-marker]{background-image:none}.wp-core-ui .CodeMirror-lint-marker-error,.wp-core-ui .CodeMirror-lint-marker-warning{cursor:help}.wrap .CodeMirror-lint-marker-multiple{position:absolute;top:0}.wrap [class*=CodeMirror-lint-marker]:before{font:normal 18px/1 dashicons;position:relative;top:-2px}.wp-core-ui [class*=CodeMirror-lint-message]:before{font:normal 16px/1 dashicons;left:16px;position:absolute}.wp-core-ui .CodeMirror-lint-message-error,.wp-core-ui .CodeMirror-lint-message-warning{box-shadow:0 1px 1px 0 rgba(0,0,0,.1);margin:5px 0 2px;padding:3px 12px 3px 28px}.wp-core-ui .CodeMirror-lint-message-warning{background-color:#fff8e5;border-left:4px solid #ffb900}.wp-core-ui .CodeMirror-lint-message-warning:before,.wrap .CodeMirror-lint-marker-warning:before{content:"\f534";color:#f6a306}.wp-core-ui .CodeMirror-lint-message-error{background-color:#fbeaea;border-left:4px solid #dc3232}.wp-core-ui .CodeMirror-lint-message-error:before,.wrap .CodeMirror-lint-marker-error:before{content:"\f153";color:#dc3232}.wp-core-ui .CodeMirror-lint-tooltip{background:0 0;border:none;border-radius:0;direction:ltr}.wrap .CodeMirror .CodeMirror-matchingbracket{background:rgba(255,150,0,.3);color:inherit}.CodeMirror{text-align:left}.wrap .CodeMirror .CodeMirror-linenumber{color:#666} \ No newline at end of file
diff --git a/www/crm/wp-admin/css/color-picker-rtl.css b/www/crm/wp-admin/css/color-picker-rtl.css
new file mode 100644
index 00000000..0c68c5a8
--- /dev/null
+++ b/www/crm/wp-admin/css/color-picker-rtl.css
@@ -0,0 +1,174 @@
+/* rtl:ignore */
+.wp-color-picker {
+ width: 80px;
+ direction: ltr;
+}
+
+.wp-picker-container .hidden {
+ display: none;
+}
+
+/* Needs higher specificiity. */
+.wp-picker-container .wp-color-result.button {
+ height: 24px;
+ margin: 0 0px 6px 6px;
+ padding: 0 30px 0 0;
+ font-size: 11px;
+}
+
+.wp-color-result-text {
+ background: #f7f7f7;
+ border-radius: 2px 0 0 2px;
+ border-right: 1px solid #ccc;
+ color: #555;
+ display: block;
+ line-height: 2;
+ padding: 0 6px;
+ text-align: center;
+}
+
+.wp-color-result:hover,
+.wp-color-result:focus {
+ background: #fafafa;
+ border-color: #999;
+ color: #23282d;
+}
+
+.wp-color-result:hover:after,
+.wp-color-result:focus:after {
+ color: #23282d;
+ border-color: #a0a5aa;
+ border-right: 1px solid #999;
+}
+
+.wp-picker-container {
+ display: inline-block;
+}
+
+.wp-color-result:focus {
+ border-color: #5b9dd9;
+ box-shadow: 0 0 3px rgba(0, 115, 170, 0.8);
+}
+
+.wp-color-result:active {
+ /* See Trac ticket #39662 */
+ transform: none !important;
+}
+
+.wp-picker-open + .wp-picker-input-wrap {
+ display: inline-block;
+ vertical-align: top;
+}
+
+.wp-picker-input-wrap label {
+ display: inline-block;
+ vertical-align: top;
+}
+
+/* For the old `custom-background` page, to override the inline-block and margins from `.form-table td fieldset label`. */
+.form-table .wp-picker-input-wrap label {
+ margin: 0 !important;
+}
+
+.wp-picker-input-wrap .button,
+.wp-customizer .wp-picker-input-wrap .button {
+ margin-right: 6px;
+}
+
+.wp-picker-container .iris-square-slider .ui-slider-handle:focus {
+ background-color: #555
+}
+
+.wp-picker-container .iris-picker {
+ border-radius: 0;
+ border-color: #ddd;
+ margin-top: 6px;
+}
+
+.wp-picker-container input[type="text"].wp-color-picker {
+ width: 65px;
+ font-size: 12px;
+ font-family: monospace;
+ line-height: 1.4;
+ margin: 0;
+ vertical-align: top;
+}
+
+.wp-color-picker::-webkit-input-placeholder {
+ color: #72777c;
+}
+
+.wp-color-picker::-moz-placeholder {
+ color: #72777c;
+ opacity: 1;
+}
+
+.wp-color-picker:-ms-input-placeholder {
+ color: #72777c;
+}
+
+.wp-picker-container input[type="text"].iris-error {
+ background-color: #ffebe8;
+ border-color: #c00;
+ color: #000;
+}
+
+.iris-picker .ui-square-handle:focus,
+.iris-picker .iris-strip .ui-slider-handle:focus {
+ box-shadow:
+ 0 0 0 1px #5b9dd9,
+ 0 0 2px 1px rgba(30, 140, 190, 0.8);
+}
+
+.iris-picker .iris-palette:focus {
+ box-shadow:
+ inset 0 0 5px rgba(0, 0, 0, 0.4),
+ 0 0 0 1px #5b9dd9,
+ 0 0 2px 1px rgba(30, 140, 190, 0.8);
+}
+
+@media screen and (max-width: 782px) {
+ .wp-picker-container input[type="text"].wp-color-picker {
+ width: 80px;
+ padding: 6px 5px 5px;
+ font-size: 16px;
+ line-height: 1.15;
+ }
+
+ .wp-customizer .wp-picker-container input[type="text"].wp-color-picker {
+ padding: 5px 5px 4px;
+ }
+
+ .wp-picker-container .wp-color-result.button {
+ height: auto;
+ padding: 0 40px 0 0;
+ font-size: 14px;
+ line-height: 2.1;
+ }
+
+ .wp-customizer .wp-picker-container .wp-color-result.button {
+ font-size: 13px;
+ line-height: 2;
+ }
+
+ .wp-picker-container .wp-color-result-text {
+ padding: 0 14px;
+ font-size: inherit;
+ line-height: inherit;
+ }
+
+ .wp-customizer .wp-picker-container .wp-color-result-text {
+ padding: 0 10px;
+ }
+}
+
+@media screen and (max-width: 640px) {
+ .wp-customizer .wp-picker-container .wp-color-result.button {
+ font-size: 14px;
+ line-height: 2.1;
+ }
+
+ .wp-customizer .wp-picker-container input[type="text"].wp-color-picker {
+ padding: 6px 5px;
+ }
+}
diff --git a/www/crm/wp-admin/css/color-picker-rtl.min.css b/www/crm/wp-admin/css/color-picker-rtl.min.css
new file mode 100644
index 00000000..e6477603
--- /dev/null
+++ b/www/crm/wp-admin/css/color-picker-rtl.min.css
@@ -0,0 +1,2 @@
+/*! This file is auto-generated */
+.wp-color-picker{width:80px;direction:ltr}.wp-picker-container .hidden{display:none}.wp-picker-container .wp-color-result.button{height:24px;margin:0 0 6px 6px;padding:0 30px 0 0;font-size:11px}.wp-color-result-text{background:#f7f7f7;border-radius:2px 0 0 2px;border-right:1px solid #ccc;color:#555;display:block;line-height:2;padding:0 6px;text-align:center}.wp-color-result:focus,.wp-color-result:hover{background:#fafafa;border-color:#999;color:#23282d}.wp-color-result:focus:after,.wp-color-result:hover:after{color:#23282d;border-color:#a0a5aa;border-right:1px solid #999}.wp-picker-container{display:inline-block}.wp-color-result:focus{border-color:#5b9dd9;box-shadow:0 0 3px rgba(0,115,170,.8)}.wp-color-result:active{transform:none!important}.wp-picker-open+.wp-picker-input-wrap{display:inline-block;vertical-align:top}.wp-picker-input-wrap label{display:inline-block;vertical-align:top}.form-table .wp-picker-input-wrap label{margin:0!important}.wp-customizer .wp-picker-input-wrap .button,.wp-picker-input-wrap .button{margin-right:6px}.wp-picker-container .iris-square-slider .ui-slider-handle:focus{background-color:#555}.wp-picker-container .iris-picker{border-radius:0;border-color:#ddd;margin-top:6px}.wp-picker-container input[type=text].wp-color-picker{width:65px;font-size:12px;font-family:monospace;line-height:1.4;margin:0;vertical-align:top}.wp-color-picker::-webkit-input-placeholder{color:#72777c}.wp-color-picker::-moz-placeholder{color:#72777c;opacity:1}.wp-color-picker:-ms-input-placeholder{color:#72777c}.wp-picker-container input[type=text].iris-error{background-color:#ffebe8;border-color:#c00;color:#000}.iris-picker .iris-strip .ui-slider-handle:focus,.iris-picker .ui-square-handle:focus{box-shadow:0 0 0 1px #5b9dd9,0 0 2px 1px rgba(30,140,190,.8)}.iris-picker .iris-palette:focus{box-shadow:inset 0 0 5px rgba(0,0,0,.4),0 0 0 1px #5b9dd9,0 0 2px 1px rgba(30,140,190,.8)}@media screen and (max-width:782px){.wp-picker-container input[type=text].wp-color-picker{width:80px;padding:6px 5px 5px;font-size:16px;line-height:1.15}.wp-customizer .wp-picker-container input[type=text].wp-color-picker{padding:5px 5px 4px}.wp-picker-container .wp-color-result.button{height:auto;padding:0 40px 0 0;font-size:14px;line-height:2.1}.wp-customizer .wp-picker-container .wp-color-result.button{font-size:13px;line-height:2}.wp-picker-container .wp-color-result-text{padding:0 14px;font-size:inherit;line-height:inherit}.wp-customizer .wp-picker-container .wp-color-result-text{padding:0 10px}}@media screen and (max-width:640px){.wp-customizer .wp-picker-container .wp-color-result.button{font-size:14px;line-height:2.1}.wp-customizer .wp-picker-container input[type=text].wp-color-picker{padding:6px 5px}} \ No newline at end of file
diff --git a/www/crm/wp-admin/css/color-picker.css b/www/crm/wp-admin/css/color-picker.css
new file mode 100644
index 00000000..29540153
--- /dev/null
+++ b/www/crm/wp-admin/css/color-picker.css
@@ -0,0 +1,174 @@
+/* rtl:ignore */
+.wp-color-picker {
+ width: 80px;
+ direction: ltr;
+}
+
+.wp-picker-container .hidden {
+ display: none;
+}
+
+/* Needs higher specificiity. */
+.wp-picker-container .wp-color-result.button {
+ height: 24px;
+ margin: 0 6px 6px 0px;
+ padding: 0 0 0 30px;
+ font-size: 11px;
+}
+
+.wp-color-result-text {
+ background: #f7f7f7;
+ border-radius: 0 2px 2px 0;
+ border-left: 1px solid #ccc;
+ color: #555;
+ display: block;
+ line-height: 2;
+ padding: 0 6px;
+ text-align: center;
+}
+
+.wp-color-result:hover,
+.wp-color-result:focus {
+ background: #fafafa;
+ border-color: #999;
+ color: #23282d;
+}
+
+.wp-color-result:hover:after,
+.wp-color-result:focus:after {
+ color: #23282d;
+ border-color: #a0a5aa;
+ border-left: 1px solid #999;
+}
+
+.wp-picker-container {
+ display: inline-block;
+}
+
+.wp-color-result:focus {
+ border-color: #5b9dd9;
+ box-shadow: 0 0 3px rgba(0, 115, 170, 0.8);
+}
+
+.wp-color-result:active {
+ /* See Trac ticket #39662 */
+ transform: none !important;
+}
+
+.wp-picker-open + .wp-picker-input-wrap {
+ display: inline-block;
+ vertical-align: top;
+}
+
+.wp-picker-input-wrap label {
+ display: inline-block;
+ vertical-align: top;
+}
+
+/* For the old `custom-background` page, to override the inline-block and margins from `.form-table td fieldset label`. */
+.form-table .wp-picker-input-wrap label {
+ margin: 0 !important;
+}
+
+.wp-picker-input-wrap .button,
+.wp-customizer .wp-picker-input-wrap .button {
+ margin-left: 6px;
+}
+
+.wp-picker-container .iris-square-slider .ui-slider-handle:focus {
+ background-color: #555
+}
+
+.wp-picker-container .iris-picker {
+ border-radius: 0;
+ border-color: #ddd;
+ margin-top: 6px;
+}
+
+.wp-picker-container input[type="text"].wp-color-picker {
+ width: 65px;
+ font-size: 12px;
+ font-family: monospace;
+ line-height: 1.4;
+ margin: 0;
+ vertical-align: top;
+}
+
+.wp-color-picker::-webkit-input-placeholder {
+ color: #72777c;
+}
+
+.wp-color-picker::-moz-placeholder {
+ color: #72777c;
+ opacity: 1;
+}
+
+.wp-color-picker:-ms-input-placeholder {
+ color: #72777c;
+}
+
+.wp-picker-container input[type="text"].iris-error {
+ background-color: #ffebe8;
+ border-color: #c00;
+ color: #000;
+}
+
+.iris-picker .ui-square-handle:focus,
+.iris-picker .iris-strip .ui-slider-handle:focus {
+ box-shadow:
+ 0 0 0 1px #5b9dd9,
+ 0 0 2px 1px rgba(30, 140, 190, 0.8);
+}
+
+.iris-picker .iris-palette:focus {
+ box-shadow:
+ inset 0 0 5px rgba(0, 0, 0, 0.4),
+ 0 0 0 1px #5b9dd9,
+ 0 0 2px 1px rgba(30, 140, 190, 0.8);
+}
+
+@media screen and (max-width: 782px) {
+ .wp-picker-container input[type="text"].wp-color-picker {
+ width: 80px;
+ padding: 6px 5px 5px;
+ font-size: 16px;
+ line-height: 1.15;
+ }
+
+ .wp-customizer .wp-picker-container input[type="text"].wp-color-picker {
+ padding: 5px 5px 4px;
+ }
+
+ .wp-picker-container .wp-color-result.button {
+ height: auto;
+ padding: 0 0 0 40px;
+ font-size: 14px;
+ line-height: 2.1;
+ }
+
+ .wp-customizer .wp-picker-container .wp-color-result.button {
+ font-size: 13px;
+ line-height: 2;
+ }
+
+ .wp-picker-container .wp-color-result-text {
+ padding: 0 14px;
+ font-size: inherit;
+ line-height: inherit;
+ }
+
+ .wp-customizer .wp-picker-container .wp-color-result-text {
+ padding: 0 10px;
+ }
+}
+
+@media screen and (max-width: 640px) {
+ .wp-customizer .wp-picker-container .wp-color-result.button {
+ font-size: 14px;
+ line-height: 2.1;
+ }
+
+ .wp-customizer .wp-picker-container input[type="text"].wp-color-picker {
+ padding: 6px 5px;
+ }
+}
diff --git a/www/crm/wp-admin/css/color-picker.min.css b/www/crm/wp-admin/css/color-picker.min.css
new file mode 100644
index 00000000..40ca1a3e
--- /dev/null
+++ b/www/crm/wp-admin/css/color-picker.min.css
@@ -0,0 +1,2 @@
+/*! This file is auto-generated */
+.wp-color-picker{width:80px;direction:ltr}.wp-picker-container .hidden{display:none}.wp-picker-container .wp-color-result.button{height:24px;margin:0 6px 6px 0;padding:0 0 0 30px;font-size:11px}.wp-color-result-text{background:#f7f7f7;border-radius:0 2px 2px 0;border-left:1px solid #ccc;color:#555;display:block;line-height:2;padding:0 6px;text-align:center}.wp-color-result:focus,.wp-color-result:hover{background:#fafafa;border-color:#999;color:#23282d}.wp-color-result:focus:after,.wp-color-result:hover:after{color:#23282d;border-color:#a0a5aa;border-left:1px solid #999}.wp-picker-container{display:inline-block}.wp-color-result:focus{border-color:#5b9dd9;box-shadow:0 0 3px rgba(0,115,170,.8)}.wp-color-result:active{transform:none!important}.wp-picker-open+.wp-picker-input-wrap{display:inline-block;vertical-align:top}.wp-picker-input-wrap label{display:inline-block;vertical-align:top}.form-table .wp-picker-input-wrap label{margin:0!important}.wp-customizer .wp-picker-input-wrap .button,.wp-picker-input-wrap .button{margin-left:6px}.wp-picker-container .iris-square-slider .ui-slider-handle:focus{background-color:#555}.wp-picker-container .iris-picker{border-radius:0;border-color:#ddd;margin-top:6px}.wp-picker-container input[type=text].wp-color-picker{width:65px;font-size:12px;font-family:monospace;line-height:1.4;margin:0;vertical-align:top}.wp-color-picker::-webkit-input-placeholder{color:#72777c}.wp-color-picker::-moz-placeholder{color:#72777c;opacity:1}.wp-color-picker:-ms-input-placeholder{color:#72777c}.wp-picker-container input[type=text].iris-error{background-color:#ffebe8;border-color:#c00;color:#000}.iris-picker .iris-strip .ui-slider-handle:focus,.iris-picker .ui-square-handle:focus{box-shadow:0 0 0 1px #5b9dd9,0 0 2px 1px rgba(30,140,190,.8)}.iris-picker .iris-palette:focus{box-shadow:inset 0 0 5px rgba(0,0,0,.4),0 0 0 1px #5b9dd9,0 0 2px 1px rgba(30,140,190,.8)}@media screen and (max-width:782px){.wp-picker-container input[type=text].wp-color-picker{width:80px;padding:6px 5px 5px;font-size:16px;line-height:1.15}.wp-customizer .wp-picker-container input[type=text].wp-color-picker{padding:5px 5px 4px}.wp-picker-container .wp-color-result.button{height:auto;padding:0 0 0 40px;font-size:14px;line-height:2.1}.wp-customizer .wp-picker-container .wp-color-result.button{font-size:13px;line-height:2}.wp-picker-container .wp-color-result-text{padding:0 14px;font-size:inherit;line-height:inherit}.wp-customizer .wp-picker-container .wp-color-result-text{padding:0 10px}}@media screen and (max-width:640px){.wp-customizer .wp-picker-container .wp-color-result.button{font-size:14px;line-height:2.1}.wp-customizer .wp-picker-container input[type=text].wp-color-picker{padding:6px 5px}} \ No newline at end of file
diff --git a/www/crm/wp-admin/css/colors/_admin.scss b/www/crm/wp-admin/css/colors/_admin.scss
new file mode 100644
index 00000000..4827ed6c
--- /dev/null
+++ b/www/crm/wp-admin/css/colors/_admin.scss
@@ -0,0 +1,511 @@
+
+@import 'variables';
+@import 'mixins';
+
+
+body {
+ background: $body-background;
+}
+
+
+/* Links */
+
+a {
+ color: $link;
+
+ &:hover,
+ &:active,
+ &:focus {
+ color: $link-focus;
+ }
+}
+
+#media-upload a.del-link:hover,
+div.dashboard-widget-submit input:hover,
+.subsubsub a:hover,
+.subsubsub a.current:hover {
+ color: $link-focus;
+}
+
+
+/* Forms */
+
+input[type=checkbox]:checked:before {
+ color: $form-checked;
+}
+
+input[type=radio]:checked:before {
+ background: $form-checked;
+}
+
+.wp-core-ui input[type="reset"]:hover,
+.wp-core-ui input[type="reset"]:active {
+ color: $link-focus;
+}
+
+
+/* Core UI */
+
+.wp-core-ui {
+ .button-primary {
+ @include button( $button-color );
+ }
+
+ .wp-ui-primary {
+ color: $text-color;
+ background-color: $base-color;
+ }
+ .wp-ui-text-primary {
+ color: $base-color;
+ }
+
+ .wp-ui-highlight {
+ color: $menu-highlight-text;
+ background-color: $menu-highlight-background;
+ }
+ .wp-ui-text-highlight {
+ color: $menu-highlight-background;
+ }
+
+ .wp-ui-notification {
+ color: $menu-bubble-text;
+ background-color: $menu-bubble-background;
+ }
+ .wp-ui-text-notification {
+ color: $menu-bubble-background;
+ }
+
+ .wp-ui-text-icon {
+ color: $menu-icon;
+ }
+}
+
+
+/* List tables */
+
+.wrap .add-new-h2:hover, /* deprecated */
+.wrap .page-title-action:hover {
+ color: $menu-text;
+ background-color: $menu-background;
+}
+
+.view-switch a.current:before {
+ color: $menu-background;
+}
+
+.view-switch a:hover:before {
+ color: $menu-bubble-background;
+}
+
+
+/* Admin Menu */
+
+#adminmenuback,
+#adminmenuwrap,
+#adminmenu {
+ background: $menu-background;
+}
+
+#adminmenu a {
+ color: $menu-text;
+}
+
+#adminmenu div.wp-menu-image:before {
+ color: $menu-icon;
+}
+
+#adminmenu a:hover,
+#adminmenu li.menu-top:hover,
+#adminmenu li.opensub > a.menu-top,
+#adminmenu li > a.menu-top:focus {
+ color: $menu-highlight-text;
+ background-color: $menu-highlight-background;
+}
+
+#adminmenu li.menu-top:hover div.wp-menu-image:before,
+#adminmenu li.opensub > a.menu-top div.wp-menu-image:before {
+ color: $menu-highlight-icon;
+}
+
+
+/* Active tabs use a bottom border color that matches the page background color. */
+
+.about-wrap .nav-tab-active,
+.nav-tab-active,
+.nav-tab-active:hover {
+ background-color: $body-background;
+ border-bottom-color: $body-background;
+}
+
+
+/* Admin Menu: submenu */
+
+#adminmenu .wp-submenu,
+#adminmenu .wp-has-current-submenu .wp-submenu,
+#adminmenu .wp-has-current-submenu.opensub .wp-submenu,
+.folded #adminmenu .wp-has-current-submenu .wp-submenu,
+#adminmenu a.wp-has-current-submenu:focus + .wp-submenu {
+ background: $menu-submenu-background;
+}
+
+#adminmenu li.wp-has-submenu.wp-not-current-submenu.opensub:hover:after {
+ border-right-color: $menu-submenu-background;
+}
+
+#adminmenu .wp-submenu .wp-submenu-head {
+ color: $menu-submenu-text;
+}
+
+#adminmenu .wp-submenu a,
+#adminmenu .wp-has-current-submenu .wp-submenu a,
+.folded #adminmenu .wp-has-current-submenu .wp-submenu a,
+#adminmenu a.wp-has-current-submenu:focus + .wp-submenu a,
+#adminmenu .wp-has-current-submenu.opensub .wp-submenu a {
+ color: $menu-submenu-text;
+
+ &:focus, &:hover {
+ color: $menu-submenu-focus-text;
+ }
+}
+
+
+/* Admin Menu: current */
+
+#adminmenu .wp-submenu li.current a,
+#adminmenu a.wp-has-current-submenu:focus + .wp-submenu li.current a,
+#adminmenu .wp-has-current-submenu.opensub .wp-submenu li.current a {
+ color: $menu-submenu-current-text;
+
+ &:hover, &:focus {
+ color: $menu-submenu-focus-text;
+ }
+}
+
+ul#adminmenu a.wp-has-current-submenu:after,
+ul#adminmenu > li.current > a.current:after {
+ border-right-color: $body-background;
+}
+
+#adminmenu li.current a.menu-top,
+#adminmenu li.wp-has-current-submenu a.wp-has-current-submenu,
+#adminmenu li.wp-has-current-submenu .wp-submenu .wp-submenu-head,
+.folded #adminmenu li.current.menu-top {
+ color: $menu-current-text;
+ background: $menu-current-background;
+}
+
+#adminmenu li.wp-has-current-submenu div.wp-menu-image:before,
+#adminmenu a.current:hover div.wp-menu-image:before,
+#adminmenu li.wp-has-current-submenu a:focus div.wp-menu-image:before,
+#adminmenu li.wp-has-current-submenu.opensub div.wp-menu-image:before,
+#adminmenu li:hover div.wp-menu-image:before,
+#adminmenu li a:focus div.wp-menu-image:before,
+#adminmenu li.opensub div.wp-menu-image:before,
+.ie8 #adminmenu li.opensub div.wp-menu-image:before {
+ color: $menu-current-icon;
+}
+
+
+/* Admin Menu: bubble */
+
+#adminmenu .awaiting-mod,
+#adminmenu .update-plugins {
+ color: $menu-bubble-text;
+ background: $menu-bubble-background;
+}
+
+#adminmenu li.current a .awaiting-mod,
+#adminmenu li a.wp-has-current-submenu .update-plugins,
+#adminmenu li:hover a .awaiting-mod,
+#adminmenu li.menu-top:hover > a .update-plugins {
+ color: $menu-bubble-current-text;
+ background: $menu-bubble-current-background;
+}
+
+
+/* Admin Menu: collapse button */
+
+#collapse-button {
+ color: $menu-collapse-text;
+}
+
+#collapse-button:hover,
+#collapse-button:focus {
+ color: $menu-submenu-focus-text;
+}
+
+/* Admin Bar */
+
+#wpadminbar {
+ color: $menu-text;
+ background: $menu-background;
+}
+
+#wpadminbar .ab-item,
+#wpadminbar a.ab-item,
+#wpadminbar > #wp-toolbar span.ab-label,
+#wpadminbar > #wp-toolbar span.noticon {
+ color: $menu-text;
+}
+
+#wpadminbar .ab-icon,
+#wpadminbar .ab-icon:before,
+#wpadminbar .ab-item:before,
+#wpadminbar .ab-item:after {
+ color: $menu-icon;
+}
+
+#wpadminbar:not(.mobile) .ab-top-menu > li:hover > .ab-item,
+#wpadminbar:not(.mobile) .ab-top-menu > li > .ab-item:focus,
+#wpadminbar.nojq .quicklinks .ab-top-menu > li > .ab-item:focus,
+#wpadminbar.nojs .ab-top-menu > li.menupop:hover > .ab-item,
+#wpadminbar .ab-top-menu > li.menupop.hover > .ab-item {
+ color: $menu-submenu-focus-text;
+ background: $menu-submenu-background;
+}
+
+#wpadminbar:not(.mobile) > #wp-toolbar li:hover span.ab-label,
+#wpadminbar:not(.mobile) > #wp-toolbar li.hover span.ab-label,
+#wpadminbar:not(.mobile) > #wp-toolbar a:focus span.ab-label {
+ color: $menu-submenu-focus-text;
+}
+
+#wpadminbar:not(.mobile) li:hover .ab-icon:before,
+#wpadminbar:not(.mobile) li:hover .ab-item:before,
+#wpadminbar:not(.mobile) li:hover .ab-item:after,
+#wpadminbar:not(.mobile) li:hover #adminbarsearch:before {
+ color: $menu-highlight-icon;
+}
+
+
+/* Admin Bar: submenu */
+
+#wpadminbar .menupop .ab-sub-wrapper {
+ background: $menu-submenu-background;
+}
+
+#wpadminbar .quicklinks .menupop ul.ab-sub-secondary,
+#wpadminbar .quicklinks .menupop ul.ab-sub-secondary .ab-submenu {
+ background: $menu-submenu-background-alt;
+}
+
+#wpadminbar .ab-submenu .ab-item,
+#wpadminbar .quicklinks .menupop ul li a,
+#wpadminbar .quicklinks .menupop.hover ul li a,
+#wpadminbar.nojs .quicklinks .menupop:hover ul li a {
+ color: $menu-submenu-text;
+}
+
+#wpadminbar .quicklinks li .blavatar,
+#wpadminbar .menupop .menupop > .ab-item:before {
+ color: $menu-icon;
+}
+
+#wpadminbar .quicklinks .menupop ul li a:hover,
+#wpadminbar .quicklinks .menupop ul li a:focus,
+#wpadminbar .quicklinks .menupop ul li a:hover strong,
+#wpadminbar .quicklinks .menupop ul li a:focus strong,
+#wpadminbar .quicklinks .ab-sub-wrapper .menupop.hover > a,
+#wpadminbar .quicklinks .menupop.hover ul li a:hover,
+#wpadminbar .quicklinks .menupop.hover ul li a:focus,
+#wpadminbar.nojs .quicklinks .menupop:hover ul li a:hover,
+#wpadminbar.nojs .quicklinks .menupop:hover ul li a:focus,
+#wpadminbar li:hover .ab-icon:before,
+#wpadminbar li:hover .ab-item:before,
+#wpadminbar li a:focus .ab-icon:before,
+#wpadminbar li .ab-item:focus:before,
+#wpadminbar li .ab-item:focus .ab-icon:before,
+#wpadminbar li.hover .ab-icon:before,
+#wpadminbar li.hover .ab-item:before,
+#wpadminbar li:hover #adminbarsearch:before,
+#wpadminbar li #adminbarsearch.adminbar-focused:before {
+ color: $menu-submenu-focus-text;
+}
+
+#wpadminbar .quicklinks li a:hover .blavatar,
+#wpadminbar .quicklinks li a:focus .blavatar,
+#wpadminbar .quicklinks .ab-sub-wrapper .menupop.hover > a .blavatar,
+#wpadminbar .menupop .menupop > .ab-item:hover:before,
+#wpadminbar.mobile .quicklinks .ab-icon:before,
+#wpadminbar.mobile .quicklinks .ab-item:before {
+ color: $menu-submenu-focus-text;
+}
+
+#wpadminbar.mobile .quicklinks .hover .ab-icon:before,
+#wpadminbar.mobile .quicklinks .hover .ab-item:before {
+ color: $menu-icon;
+}
+
+
+/* Admin Bar: search */
+
+#wpadminbar #adminbarsearch:before {
+ color: $menu-icon;
+}
+
+#wpadminbar > #wp-toolbar > #wp-admin-bar-top-secondary > #wp-admin-bar-search #adminbarsearch input.adminbar-input:focus {
+ color: $menu-text;
+ background: $adminbar-input-background;
+}
+
+/* Admin Bar: recovery mode */
+
+#wpadminbar #wp-admin-bar-recovery-mode {
+ color: $adminbar-recovery-exit-text;
+ background-color: $adminbar-recovery-exit-background;
+}
+
+#wpadminbar #wp-admin-bar-recovery-mode .ab-item,
+#wpadminbar #wp-admin-bar-recovery-mode a.ab-item {
+ color: $adminbar-recovery-exit-text;
+}
+
+#wpadminbar .ab-top-menu > #wp-admin-bar-recovery-mode.hover >.ab-item,
+#wpadminbar.nojq .quicklinks .ab-top-menu > #wp-admin-bar-recovery-mode > .ab-item:focus,
+#wpadminbar:not(.mobile) .ab-top-menu > #wp-admin-bar-recovery-mode:hover > .ab-item,
+#wpadminbar:not(.mobile) .ab-top-menu > #wp-admin-bar-recovery-mode > .ab-item:focus {
+ color: $adminbar-recovery-exit-text;
+ background-color: $adminbar-recovery-exit-background-alt;
+}
+
+/* Admin Bar: my account */
+
+#wpadminbar .quicklinks li#wp-admin-bar-my-account.with-avatar > a img {
+ border-color: $adminbar-avatar-frame;
+ background-color: $adminbar-avatar-frame;
+}
+
+#wpadminbar #wp-admin-bar-user-info .display-name {
+ color: $menu-text;
+}
+
+#wpadminbar #wp-admin-bar-user-info a:hover .display-name {
+ color: $menu-submenu-focus-text;
+}
+
+#wpadminbar #wp-admin-bar-user-info .username {
+ color: $menu-submenu-text;
+}
+
+
+/* Pointers */
+
+.wp-pointer .wp-pointer-content h3 {
+ background-color: $highlight-color;
+ border-color: darken( $highlight-color, 5% );
+}
+
+.wp-pointer .wp-pointer-content h3:before {
+ color: $highlight-color;
+}
+
+.wp-pointer.wp-pointer-top .wp-pointer-arrow,
+.wp-pointer.wp-pointer-top .wp-pointer-arrow-inner,
+.wp-pointer.wp-pointer-undefined .wp-pointer-arrow,
+.wp-pointer.wp-pointer-undefined .wp-pointer-arrow-inner {
+ border-bottom-color: $highlight-color;
+}
+
+
+/* Media */
+
+.media-item .bar,
+.media-progress-bar div {
+ background-color: $highlight-color;
+}
+
+.details.attachment {
+ box-shadow:
+ inset 0 0 0 3px #fff,
+ inset 0 0 0 7px $highlight-color;
+}
+
+.attachment.details .check {
+ background-color: $highlight-color;
+ box-shadow: 0 0 0 1px #fff, 0 0 0 2px $highlight-color;
+}
+
+.media-selection .attachment.selection.details .thumbnail {
+ box-shadow: 0 0 0 1px #fff, 0 0 0 3px $highlight-color;
+}
+
+
+/* Themes */
+
+.theme-browser .theme.active .theme-name,
+.theme-browser .theme.add-new-theme a:hover:after,
+.theme-browser .theme.add-new-theme a:focus:after {
+ background: $highlight-color;
+}
+
+.theme-browser .theme.add-new-theme a:hover span:after,
+.theme-browser .theme.add-new-theme a:focus span:after {
+ color: $highlight-color;
+}
+
+.theme-section.current,
+.theme-filter.current {
+ border-bottom-color: $menu-background;
+}
+
+body.more-filters-opened .more-filters {
+ color: $menu-text;
+ background-color: $menu-background;
+}
+
+body.more-filters-opened .more-filters:before {
+ color: $menu-text;
+}
+
+body.more-filters-opened .more-filters:hover,
+body.more-filters-opened .more-filters:focus {
+ background-color: $menu-highlight-background;
+ color: $menu-highlight-text;
+}
+
+body.more-filters-opened .more-filters:hover:before,
+body.more-filters-opened .more-filters:focus:before {
+ color: $menu-highlight-text;
+}
+
+/* Widgets */
+
+.widgets-chooser li.widgets-chooser-selected {
+ background-color: $menu-highlight-background;
+ color: $menu-highlight-text;
+}
+
+.widgets-chooser li.widgets-chooser-selected:before,
+.widgets-chooser li.widgets-chooser-selected:focus:before {
+ color: $menu-highlight-text;
+}
+
+/* Responsive Component */
+
+div#wp-responsive-toggle a:before {
+ color: $menu-icon;
+}
+
+.wp-responsive-open div#wp-responsive-toggle a {
+ // ToDo: make inset border
+ border-color: transparent;
+ background: $menu-highlight-background;
+}
+
+.wp-responsive-open #wpadminbar #wp-admin-bar-menu-toggle a {
+ background: $menu-submenu-background;
+}
+
+.wp-responsive-open #wpadminbar #wp-admin-bar-menu-toggle .ab-icon:before {
+ color: $menu-icon;
+}
+
+/* TinyMCE */
+
+.mce-container.mce-menu .mce-menu-item:hover,
+.mce-container.mce-menu .mce-menu-item.mce-selected,
+.mce-container.mce-menu .mce-menu-item:focus,
+.mce-container.mce-menu .mce-menu-item-normal.mce-active,
+.mce-container.mce-menu .mce-menu-item-preview.mce-active {
+ background: $highlight-color;
+}
diff --git a/www/crm/wp-admin/css/colors/_mixins.scss b/www/crm/wp-admin/css/colors/_mixins.scss
new file mode 100644
index 00000000..7a764ab0
--- /dev/null
+++ b/www/crm/wp-admin/css/colors/_mixins.scss
@@ -0,0 +1,54 @@
+/*
+ * Button mixin- creates 3d-ish button effect with correct
+ * highlights/shadows, based on a base color.
+ */
+@mixin button( $button-color, $text-color: #fff ) {
+ background: $button-color;
+ border-color: darken( $button-color, 10% ) darken( $button-color, 15% ) darken( $button-color, 15% );
+ color: $text-color;
+ box-shadow: 0 1px 0 darken( $button-color, 15% );
+ text-shadow: 0 -1px 1px darken( $button-color, 15% ),
+ 1px 0 1px darken( $button-color, 15% ),
+ 0 1px 1px darken( $button-color, 15% ),
+ -1px 0 1px darken( $button-color, 15% );
+
+ &:hover,
+ &:focus {
+ background: lighten( $button-color, 3% );
+ border-color: darken( $button-color, 15% );
+ color: $text-color;
+ box-shadow: 0 1px 0 darken( $button-color, 15% );
+ }
+
+ &:focus {
+ box-shadow: inset 0 1px 0 darken( $button-color, 10% ),
+ 0 0 2px 1px #33b3db;
+ }
+
+ &:active,
+ &.active,
+ &.active:focus,
+ &.active:hover {
+ background: darken( $button-color, 10% );
+ border-color: darken( $button-color, 15% );
+ box-shadow: inset 0 2px 0 darken( $button-color, 15% );
+ }
+
+ &[disabled],
+ &:disabled,
+ &.button-primary-disabled,
+ &.disabled {
+ color: hsl( hue( $button-color ), 10%, 80% ) !important;
+ background: darken( $button-color, 8% ) !important;
+ border-color: darken( $button-color, 15% ) !important;
+ text-shadow: none !important;
+ }
+
+ &.button-hero {
+ box-shadow: 0 2px 0 darken( $button-color, 15% ) !important;
+ &:active {
+ box-shadow: inset 0 3px 0 darken( $button-color, 15% ) !important;
+ }
+ }
+
+}
diff --git a/www/crm/wp-admin/css/colors/_variables.scss b/www/crm/wp-admin/css/colors/_variables.scss
new file mode 100644
index 00000000..91b57cce
--- /dev/null
+++ b/www/crm/wp-admin/css/colors/_variables.scss
@@ -0,0 +1,62 @@
+// assign default value to all undefined variables
+
+
+// core variables
+
+$text-color: #fff !default;
+$base-color: #23282d !default;
+$icon-color: hsl( hue( $base-color ), 7%, 95% ) !default;
+$highlight-color: #0073aa !default;
+$notification-color: #d54e21 !default;
+
+
+// global
+
+$body-background: #f1f1f1 !default;
+
+$link: #0073aa !default;
+$link-focus: lighten( $link, 10% ) !default;
+
+$button-color: $highlight-color !default;
+$form-checked: $highlight-color !default;
+
+
+// admin menu & admin-bar
+
+$menu-text: $text-color !default;
+$menu-icon: $icon-color !default;
+$menu-background: $base-color !default;
+
+$menu-highlight-text: $text-color !default;
+$menu-highlight-icon: $text-color !default;
+$menu-highlight-background: $highlight-color !default;
+
+$menu-current-text: $menu-highlight-text !default;
+$menu-current-icon: $menu-highlight-icon !default;
+$menu-current-background: $menu-highlight-background !default;
+
+$menu-submenu-text: mix( $base-color, $text-color, 30% ) !default;
+$menu-submenu-background: darken( $base-color, 7% ) !default;
+$menu-submenu-background-alt: desaturate( lighten( $menu-background, 7% ), 7% ) !default;
+
+$menu-submenu-focus-text: $highlight-color !default;
+$menu-submenu-current-text: $text-color !default;
+
+$menu-bubble-text: $text-color !default;
+$menu-bubble-background: $notification-color !default;
+$menu-bubble-current-text: $text-color !default;
+$menu-bubble-current-background: $menu-submenu-background !default;
+
+$menu-collapse-text: $menu-icon !default;
+$menu-collapse-icon: $menu-icon !default;
+$menu-collapse-focus-text: $text-color !default;
+$menu-collapse-focus-icon: $menu-highlight-icon !default;
+
+$adminbar-avatar-frame: lighten( $menu-background, 7% ) !default;
+$adminbar-input-background: lighten( $menu-background, 7% ) !default;
+
+$adminbar-recovery-exit-text: $menu-bubble-text !default;
+$adminbar-recovery-exit-background: $menu-bubble-background !default;
+$adminbar-recovery-exit-background-alt: mix(black, $adminbar-recovery-exit-background, 10%) !default;
+
+$menu-customizer-text: mix( $base-color, $text-color, 40% ) !default;
diff --git a/www/crm/wp-admin/css/colors/blue/colors-rtl.css b/www/crm/wp-admin/css/colors/blue/colors-rtl.css
new file mode 100644
index 00000000..dcc4072d
--- /dev/null
+++ b/www/crm/wp-admin/css/colors/blue/colors-rtl.css
@@ -0,0 +1,519 @@
+/*! This file is auto-generated */
+/*
+ * Button mixin- creates 3d-ish button effect with correct
+ * highlights/shadows, based on a base color.
+ */
+body {
+ background: #f1f1f1;
+}
+
+/* Links */
+a {
+ color: #0073aa;
+}
+
+a:hover, a:active, a:focus {
+ color: #0096dd;
+}
+
+#media-upload a.del-link:hover,
+div.dashboard-widget-submit input:hover,
+.subsubsub a:hover,
+.subsubsub a.current:hover {
+ color: #0096dd;
+}
+
+/* Forms */
+input[type=checkbox]:checked:before {
+ color: #096484;
+}
+
+input[type=radio]:checked:before {
+ background: #096484;
+}
+
+.wp-core-ui input[type="reset"]:hover,
+.wp-core-ui input[type="reset"]:active {
+ color: #0096dd;
+}
+
+/* Core UI */
+.wp-core-ui .button-primary {
+ background: #e1a948;
+ border-color: #d39323 #bd831f #bd831f;
+ color: #fff;
+ box-shadow: 0 1px 0 #bd831f;
+ text-shadow: 0 -1px 1px #bd831f, -1px 0 1px #bd831f, 0 1px 1px #bd831f, 1px 0 1px #bd831f;
+}
+
+.wp-core-ui .button-primary:hover, .wp-core-ui .button-primary:focus {
+ background: #e3af55;
+ border-color: #bd831f;
+ color: #fff;
+ box-shadow: 0 1px 0 #bd831f;
+}
+
+.wp-core-ui .button-primary:focus {
+ box-shadow: inset 0 1px 0 #d39323, 0 0 2px 1px #33b3db;
+}
+
+.wp-core-ui .button-primary:active, .wp-core-ui .button-primary.active, .wp-core-ui .button-primary.active:focus, .wp-core-ui .button-primary.active:hover {
+ background: #d39323;
+ border-color: #bd831f;
+ box-shadow: inset 0 2px 0 #bd831f;
+}
+
+.wp-core-ui .button-primary[disabled], .wp-core-ui .button-primary:disabled, .wp-core-ui .button-primary.button-primary-disabled, .wp-core-ui .button-primary.disabled {
+ color: #d1cdc7 !important;
+ background: #db9925 !important;
+ border-color: #bd831f !important;
+ text-shadow: none !important;
+}
+
+.wp-core-ui .button-primary.button-hero {
+ box-shadow: 0 2px 0 #bd831f !important;
+}
+
+.wp-core-ui .button-primary.button-hero:active {
+ box-shadow: inset 0 3px 0 #bd831f !important;
+}
+
+.wp-core-ui .wp-ui-primary {
+ color: #fff;
+ background-color: #52accc;
+}
+
+.wp-core-ui .wp-ui-text-primary {
+ color: #52accc;
+}
+
+.wp-core-ui .wp-ui-highlight {
+ color: #fff;
+ background-color: #096484;
+}
+
+.wp-core-ui .wp-ui-text-highlight {
+ color: #096484;
+}
+
+.wp-core-ui .wp-ui-notification {
+ color: #fff;
+ background-color: #e1a948;
+}
+
+.wp-core-ui .wp-ui-text-notification {
+ color: #e1a948;
+}
+
+.wp-core-ui .wp-ui-text-icon {
+ color: #e5f8ff;
+}
+
+/* List tables */
+.wrap .add-new-h2:hover,
+.wrap .page-title-action:hover {
+ color: #fff;
+ background-color: #52accc;
+}
+
+.view-switch a.current:before {
+ color: #52accc;
+}
+
+.view-switch a:hover:before {
+ color: #e1a948;
+}
+
+/* Admin Menu */
+#adminmenuback,
+#adminmenuwrap,
+#adminmenu {
+ background: #52accc;
+}
+
+#adminmenu a {
+ color: #fff;
+}
+
+#adminmenu div.wp-menu-image:before {
+ color: #e5f8ff;
+}
+
+#adminmenu a:hover,
+#adminmenu li.menu-top:hover,
+#adminmenu li.opensub > a.menu-top,
+#adminmenu li > a.menu-top:focus {
+ color: #fff;
+ background-color: #096484;
+}
+
+#adminmenu li.menu-top:hover div.wp-menu-image:before,
+#adminmenu li.opensub > a.menu-top div.wp-menu-image:before {
+ color: #fff;
+}
+
+/* Active tabs use a bottom border color that matches the page background color. */
+.about-wrap .nav-tab-active,
+.nav-tab-active,
+.nav-tab-active:hover {
+ background-color: #f1f1f1;
+ border-bottom-color: #f1f1f1;
+}
+
+/* Admin Menu: submenu */
+#adminmenu .wp-submenu,
+#adminmenu .wp-has-current-submenu .wp-submenu,
+#adminmenu .wp-has-current-submenu.opensub .wp-submenu,
+.folded #adminmenu .wp-has-current-submenu .wp-submenu,
+#adminmenu a.wp-has-current-submenu:focus + .wp-submenu {
+ background: #4796b3;
+}
+
+#adminmenu li.wp-has-submenu.wp-not-current-submenu.opensub:hover:after {
+ border-left-color: #4796b3;
+}
+
+#adminmenu .wp-submenu .wp-submenu-head {
+ color: #e2ecf1;
+}
+
+#adminmenu .wp-submenu a,
+#adminmenu .wp-has-current-submenu .wp-submenu a,
+.folded #adminmenu .wp-has-current-submenu .wp-submenu a,
+#adminmenu a.wp-has-current-submenu:focus + .wp-submenu a,
+#adminmenu .wp-has-current-submenu.opensub .wp-submenu a {
+ color: #e2ecf1;
+}
+
+#adminmenu .wp-submenu a:focus, #adminmenu .wp-submenu a:hover,
+#adminmenu .wp-has-current-submenu .wp-submenu a:focus,
+#adminmenu .wp-has-current-submenu .wp-submenu a:hover,
+.folded #adminmenu .wp-has-current-submenu .wp-submenu a:focus,
+.folded #adminmenu .wp-has-current-submenu .wp-submenu a:hover,
+#adminmenu a.wp-has-current-submenu:focus + .wp-submenu a:focus,
+#adminmenu a.wp-has-current-submenu:focus + .wp-submenu a:hover,
+#adminmenu .wp-has-current-submenu.opensub .wp-submenu a:focus,
+#adminmenu .wp-has-current-submenu.opensub .wp-submenu a:hover {
+ color: #fff;
+}
+
+/* Admin Menu: current */
+#adminmenu .wp-submenu li.current a,
+#adminmenu a.wp-has-current-submenu:focus + .wp-submenu li.current a,
+#adminmenu .wp-has-current-submenu.opensub .wp-submenu li.current a {
+ color: #fff;
+}
+
+#adminmenu .wp-submenu li.current a:hover, #adminmenu .wp-submenu li.current a:focus,
+#adminmenu a.wp-has-current-submenu:focus + .wp-submenu li.current a:hover,
+#adminmenu a.wp-has-current-submenu:focus + .wp-submenu li.current a:focus,
+#adminmenu .wp-has-current-submenu.opensub .wp-submenu li.current a:hover,
+#adminmenu .wp-has-current-submenu.opensub .wp-submenu li.current a:focus {
+ color: #fff;
+}
+
+ul#adminmenu a.wp-has-current-submenu:after,
+ul#adminmenu > li.current > a.current:after {
+ border-left-color: #f1f1f1;
+}
+
+#adminmenu li.current a.menu-top,
+#adminmenu li.wp-has-current-submenu a.wp-has-current-submenu,
+#adminmenu li.wp-has-current-submenu .wp-submenu .wp-submenu-head,
+.folded #adminmenu li.current.menu-top {
+ color: #fff;
+ background: #096484;
+}
+
+#adminmenu li.wp-has-current-submenu div.wp-menu-image:before,
+#adminmenu a.current:hover div.wp-menu-image:before,
+#adminmenu li.wp-has-current-submenu a:focus div.wp-menu-image:before,
+#adminmenu li.wp-has-current-submenu.opensub div.wp-menu-image:before,
+#adminmenu li:hover div.wp-menu-image:before,
+#adminmenu li a:focus div.wp-menu-image:before,
+#adminmenu li.opensub div.wp-menu-image:before,
+.ie8 #adminmenu li.opensub div.wp-menu-image:before {
+ color: #fff;
+}
+
+/* Admin Menu: bubble */
+#adminmenu .awaiting-mod,
+#adminmenu .update-plugins {
+ color: #fff;
+ background: #e1a948;
+}
+
+#adminmenu li.current a .awaiting-mod,
+#adminmenu li a.wp-has-current-submenu .update-plugins,
+#adminmenu li:hover a .awaiting-mod,
+#adminmenu li.menu-top:hover > a .update-plugins {
+ color: #fff;
+ background: #4796b3;
+}
+
+/* Admin Menu: collapse button */
+#collapse-button {
+ color: #e5f8ff;
+}
+
+#collapse-button:hover,
+#collapse-button:focus {
+ color: #fff;
+}
+
+/* Admin Bar */
+#wpadminbar {
+ color: #fff;
+ background: #52accc;
+}
+
+#wpadminbar .ab-item,
+#wpadminbar a.ab-item,
+#wpadminbar > #wp-toolbar span.ab-label,
+#wpadminbar > #wp-toolbar span.noticon {
+ color: #fff;
+}
+
+#wpadminbar .ab-icon,
+#wpadminbar .ab-icon:before,
+#wpadminbar .ab-item:before,
+#wpadminbar .ab-item:after {
+ color: #e5f8ff;
+}
+
+#wpadminbar:not(.mobile) .ab-top-menu > li:hover > .ab-item,
+#wpadminbar:not(.mobile) .ab-top-menu > li > .ab-item:focus,
+#wpadminbar.nojq .quicklinks .ab-top-menu > li > .ab-item:focus,
+#wpadminbar.nojs .ab-top-menu > li.menupop:hover > .ab-item,
+#wpadminbar .ab-top-menu > li.menupop.hover > .ab-item {
+ color: #fff;
+ background: #4796b3;
+}
+
+#wpadminbar:not(.mobile) > #wp-toolbar li:hover span.ab-label,
+#wpadminbar:not(.mobile) > #wp-toolbar li.hover span.ab-label,
+#wpadminbar:not(.mobile) > #wp-toolbar a:focus span.ab-label {
+ color: #fff;
+}
+
+#wpadminbar:not(.mobile) li:hover .ab-icon:before,
+#wpadminbar:not(.mobile) li:hover .ab-item:before,
+#wpadminbar:not(.mobile) li:hover .ab-item:after,
+#wpadminbar:not(.mobile) li:hover #adminbarsearch:before {
+ color: #fff;
+}
+
+/* Admin Bar: submenu */
+#wpadminbar .menupop .ab-sub-wrapper {
+ background: #4796b3;
+}
+
+#wpadminbar .quicklinks .menupop ul.ab-sub-secondary,
+#wpadminbar .quicklinks .menupop ul.ab-sub-secondary .ab-submenu {
+ background: #74b6ce;
+}
+
+#wpadminbar .ab-submenu .ab-item,
+#wpadminbar .quicklinks .menupop ul li a,
+#wpadminbar .quicklinks .menupop.hover ul li a,
+#wpadminbar.nojs .quicklinks .menupop:hover ul li a {
+ color: #e2ecf1;
+}
+
+#wpadminbar .quicklinks li .blavatar,
+#wpadminbar .menupop .menupop > .ab-item:before {
+ color: #e5f8ff;
+}
+
+#wpadminbar .quicklinks .menupop ul li a:hover,
+#wpadminbar .quicklinks .menupop ul li a:focus,
+#wpadminbar .quicklinks .menupop ul li a:hover strong,
+#wpadminbar .quicklinks .menupop ul li a:focus strong,
+#wpadminbar .quicklinks .ab-sub-wrapper .menupop.hover > a,
+#wpadminbar .quicklinks .menupop.hover ul li a:hover,
+#wpadminbar .quicklinks .menupop.hover ul li a:focus,
+#wpadminbar.nojs .quicklinks .menupop:hover ul li a:hover,
+#wpadminbar.nojs .quicklinks .menupop:hover ul li a:focus,
+#wpadminbar li:hover .ab-icon:before,
+#wpadminbar li:hover .ab-item:before,
+#wpadminbar li a:focus .ab-icon:before,
+#wpadminbar li .ab-item:focus:before,
+#wpadminbar li .ab-item:focus .ab-icon:before,
+#wpadminbar li.hover .ab-icon:before,
+#wpadminbar li.hover .ab-item:before,
+#wpadminbar li:hover #adminbarsearch:before,
+#wpadminbar li #adminbarsearch.adminbar-focused:before {
+ color: #fff;
+}
+
+#wpadminbar .quicklinks li a:hover .blavatar,
+#wpadminbar .quicklinks li a:focus .blavatar,
+#wpadminbar .quicklinks .ab-sub-wrapper .menupop.hover > a .blavatar,
+#wpadminbar .menupop .menupop > .ab-item:hover:before,
+#wpadminbar.mobile .quicklinks .ab-icon:before,
+#wpadminbar.mobile .quicklinks .ab-item:before {
+ color: #fff;
+}
+
+#wpadminbar.mobile .quicklinks .hover .ab-icon:before,
+#wpadminbar.mobile .quicklinks .hover .ab-item:before {
+ color: #e5f8ff;
+}
+
+/* Admin Bar: search */
+#wpadminbar #adminbarsearch:before {
+ color: #e5f8ff;
+}
+
+#wpadminbar > #wp-toolbar > #wp-admin-bar-top-secondary > #wp-admin-bar-search #adminbarsearch input.adminbar-input:focus {
+ color: #fff;
+ background: #6eb9d4;
+}
+
+/* Admin Bar: recovery mode */
+#wpadminbar #wp-admin-bar-recovery-mode {
+ color: #fff;
+ background-color: #e1a948;
+}
+
+#wpadminbar #wp-admin-bar-recovery-mode .ab-item,
+#wpadminbar #wp-admin-bar-recovery-mode a.ab-item {
+ color: #fff;
+}
+
+#wpadminbar .ab-top-menu > #wp-admin-bar-recovery-mode.hover > .ab-item,
+#wpadminbar.nojq .quicklinks .ab-top-menu > #wp-admin-bar-recovery-mode > .ab-item:focus,
+#wpadminbar:not(.mobile) .ab-top-menu > #wp-admin-bar-recovery-mode:hover > .ab-item,
+#wpadminbar:not(.mobile) .ab-top-menu > #wp-admin-bar-recovery-mode > .ab-item:focus {
+ color: #fff;
+ background-color: #cb9841;
+}
+
+/* Admin Bar: my account */
+#wpadminbar .quicklinks li#wp-admin-bar-my-account.with-avatar > a img {
+ border-color: #6eb9d4;
+ background-color: #6eb9d4;
+}
+
+#wpadminbar #wp-admin-bar-user-info .display-name {
+ color: #fff;
+}
+
+#wpadminbar #wp-admin-bar-user-info a:hover .display-name {
+ color: #fff;
+}
+
+#wpadminbar #wp-admin-bar-user-info .username {
+ color: #e2ecf1;
+}
+
+/* Pointers */
+.wp-pointer .wp-pointer-content h3 {
+ background-color: #096484;
+ border-color: #07526c;
+}
+
+.wp-pointer .wp-pointer-content h3:before {
+ color: #096484;
+}
+
+.wp-pointer.wp-pointer-top .wp-pointer-arrow,
+.wp-pointer.wp-pointer-top .wp-pointer-arrow-inner,
+.wp-pointer.wp-pointer-undefined .wp-pointer-arrow,
+.wp-pointer.wp-pointer-undefined .wp-pointer-arrow-inner {
+ border-bottom-color: #096484;
+}
+
+/* Media */
+.media-item .bar,
+.media-progress-bar div {
+ background-color: #096484;
+}
+
+.details.attachment {
+ box-shadow: inset 0 0 0 3px #fff, inset 0 0 0 7px #096484;
+}
+
+.attachment.details .check {
+ background-color: #096484;
+ box-shadow: 0 0 0 1px #fff, 0 0 0 2px #096484;
+}
+
+.media-selection .attachment.selection.details .thumbnail {
+ box-shadow: 0 0 0 1px #fff, 0 0 0 3px #096484;
+}
+
+/* Themes */
+.theme-browser .theme.active .theme-name,
+.theme-browser .theme.add-new-theme a:hover:after,
+.theme-browser .theme.add-new-theme a:focus:after {
+ background: #096484;
+}
+
+.theme-browser .theme.add-new-theme a:hover span:after,
+.theme-browser .theme.add-new-theme a:focus span:after {
+ color: #096484;
+}
+
+.theme-section.current,
+.theme-filter.current {
+ border-bottom-color: #52accc;
+}
+
+body.more-filters-opened .more-filters {
+ color: #fff;
+ background-color: #52accc;
+}
+
+body.more-filters-opened .more-filters:before {
+ color: #fff;
+}
+
+body.more-filters-opened .more-filters:hover,
+body.more-filters-opened .more-filters:focus {
+ background-color: #096484;
+ color: #fff;
+}
+
+body.more-filters-opened .more-filters:hover:before,
+body.more-filters-opened .more-filters:focus:before {
+ color: #fff;
+}
+
+/* Widgets */
+.widgets-chooser li.widgets-chooser-selected {
+ background-color: #096484;
+ color: #fff;
+}
+
+.widgets-chooser li.widgets-chooser-selected:before,
+.widgets-chooser li.widgets-chooser-selected:focus:before {
+ color: #fff;
+}
+
+/* Responsive Component */
+div#wp-responsive-toggle a:before {
+ color: #e5f8ff;
+}
+
+.wp-responsive-open div#wp-responsive-toggle a {
+ border-color: transparent;
+ background: #096484;
+}
+
+.wp-responsive-open #wpadminbar #wp-admin-bar-menu-toggle a {
+ background: #4796b3;
+}
+
+.wp-responsive-open #wpadminbar #wp-admin-bar-menu-toggle .ab-icon:before {
+ color: #e5f8ff;
+}
+
+/* TinyMCE */
+.mce-container.mce-menu .mce-menu-item:hover,
+.mce-container.mce-menu .mce-menu-item.mce-selected,
+.mce-container.mce-menu .mce-menu-item:focus,
+.mce-container.mce-menu .mce-menu-item-normal.mce-active,
+.mce-container.mce-menu .mce-menu-item-preview.mce-active {
+ background: #096484;
+}
diff --git a/www/crm/wp-admin/css/colors/blue/colors-rtl.min.css b/www/crm/wp-admin/css/colors/blue/colors-rtl.min.css
new file mode 100644
index 00000000..12bfff7e
--- /dev/null
+++ b/www/crm/wp-admin/css/colors/blue/colors-rtl.min.css
@@ -0,0 +1,2 @@
+/*! This file is auto-generated */
+body{background:#f1f1f1}a{color:#0073aa}a:active,a:focus,a:hover{color:#0096dd}#media-upload a.del-link:hover,.subsubsub a.current:hover,.subsubsub a:hover,div.dashboard-widget-submit input:hover{color:#0096dd}input[type=checkbox]:checked:before{color:#096484}input[type=radio]:checked:before{background:#096484}.wp-core-ui input[type=reset]:active,.wp-core-ui input[type=reset]:hover{color:#0096dd}.wp-core-ui .button-primary{background:#e1a948;border-color:#d39323 #bd831f #bd831f;color:#fff;box-shadow:0 1px 0 #bd831f;text-shadow:0 -1px 1px #bd831f,-1px 0 1px #bd831f,0 1px 1px #bd831f,1px 0 1px #bd831f}.wp-core-ui .button-primary:focus,.wp-core-ui .button-primary:hover{background:#e3af55;border-color:#bd831f;color:#fff;box-shadow:0 1px 0 #bd831f}.wp-core-ui .button-primary:focus{box-shadow:inset 0 1px 0 #d39323,0 0 2px 1px #33b3db}.wp-core-ui .button-primary.active,.wp-core-ui .button-primary.active:focus,.wp-core-ui .button-primary.active:hover,.wp-core-ui .button-primary:active{background:#d39323;border-color:#bd831f;box-shadow:inset 0 2px 0 #bd831f}.wp-core-ui .button-primary.button-primary-disabled,.wp-core-ui .button-primary.disabled,.wp-core-ui .button-primary:disabled,.wp-core-ui .button-primary[disabled]{color:#d1cdc7!important;background:#db9925!important;border-color:#bd831f!important;text-shadow:none!important}.wp-core-ui .button-primary.button-hero{box-shadow:0 2px 0 #bd831f!important}.wp-core-ui .button-primary.button-hero:active{box-shadow:inset 0 3px 0 #bd831f!important}.wp-core-ui .wp-ui-primary{color:#fff;background-color:#52accc}.wp-core-ui .wp-ui-text-primary{color:#52accc}.wp-core-ui .wp-ui-highlight{color:#fff;background-color:#096484}.wp-core-ui .wp-ui-text-highlight{color:#096484}.wp-core-ui .wp-ui-notification{color:#fff;background-color:#e1a948}.wp-core-ui .wp-ui-text-notification{color:#e1a948}.wp-core-ui .wp-ui-text-icon{color:#e5f8ff}.wrap .add-new-h2:hover,.wrap .page-title-action:hover{color:#fff;background-color:#52accc}.view-switch a.current:before{color:#52accc}.view-switch a:hover:before{color:#e1a948}#adminmenu,#adminmenuback,#adminmenuwrap{background:#52accc}#adminmenu a{color:#fff}#adminmenu div.wp-menu-image:before{color:#e5f8ff}#adminmenu a:hover,#adminmenu li.menu-top:hover,#adminmenu li.opensub>a.menu-top,#adminmenu li>a.menu-top:focus{color:#fff;background-color:#096484}#adminmenu li.menu-top:hover div.wp-menu-image:before,#adminmenu li.opensub>a.menu-top div.wp-menu-image:before{color:#fff}.about-wrap .nav-tab-active,.nav-tab-active,.nav-tab-active:hover{background-color:#f1f1f1;border-bottom-color:#f1f1f1}#adminmenu .wp-has-current-submenu .wp-submenu,#adminmenu .wp-has-current-submenu.opensub .wp-submenu,#adminmenu .wp-submenu,#adminmenu a.wp-has-current-submenu:focus+.wp-submenu,.folded #adminmenu .wp-has-current-submenu .wp-submenu{background:#4796b3}#adminmenu li.wp-has-submenu.wp-not-current-submenu.opensub:hover:after{border-left-color:#4796b3}#adminmenu .wp-submenu .wp-submenu-head{color:#e2ecf1}#adminmenu .wp-has-current-submenu .wp-submenu a,#adminmenu .wp-has-current-submenu.opensub .wp-submenu a,#adminmenu .wp-submenu a,#adminmenu a.wp-has-current-submenu:focus+.wp-submenu a,.folded #adminmenu .wp-has-current-submenu .wp-submenu a{color:#e2ecf1}#adminmenu .wp-has-current-submenu .wp-submenu a:focus,#adminmenu .wp-has-current-submenu .wp-submenu a:hover,#adminmenu .wp-has-current-submenu.opensub .wp-submenu a:focus,#adminmenu .wp-has-current-submenu.opensub .wp-submenu a:hover,#adminmenu .wp-submenu a:focus,#adminmenu .wp-submenu a:hover,#adminmenu a.wp-has-current-submenu:focus+.wp-submenu a:focus,#adminmenu a.wp-has-current-submenu:focus+.wp-submenu a:hover,.folded #adminmenu .wp-has-current-submenu .wp-submenu a:focus,.folded #adminmenu .wp-has-current-submenu .wp-submenu a:hover{color:#fff}#adminmenu .wp-has-current-submenu.opensub .wp-submenu li.current a,#adminmenu .wp-submenu li.current a,#adminmenu a.wp-has-current-submenu:focus+.wp-submenu li.current a{color:#fff}#adminmenu .wp-has-current-submenu.opensub .wp-submenu li.current a:focus,#adminmenu .wp-has-current-submenu.opensub .wp-submenu li.current a:hover,#adminmenu .wp-submenu li.current a:focus,#adminmenu .wp-submenu li.current a:hover,#adminmenu a.wp-has-current-submenu:focus+.wp-submenu li.current a:focus,#adminmenu a.wp-has-current-submenu:focus+.wp-submenu li.current a:hover{color:#fff}ul#adminmenu a.wp-has-current-submenu:after,ul#adminmenu>li.current>a.current:after{border-left-color:#f1f1f1}#adminmenu li.current a.menu-top,#adminmenu li.wp-has-current-submenu .wp-submenu .wp-submenu-head,#adminmenu li.wp-has-current-submenu a.wp-has-current-submenu,.folded #adminmenu li.current.menu-top{color:#fff;background:#096484}#adminmenu a.current:hover div.wp-menu-image:before,#adminmenu li a:focus div.wp-menu-image:before,#adminmenu li.opensub div.wp-menu-image:before,#adminmenu li.wp-has-current-submenu a:focus div.wp-menu-image:before,#adminmenu li.wp-has-current-submenu div.wp-menu-image:before,#adminmenu li.wp-has-current-submenu.opensub div.wp-menu-image:before,#adminmenu li:hover div.wp-menu-image:before,.ie8 #adminmenu li.opensub div.wp-menu-image:before{color:#fff}#adminmenu .awaiting-mod,#adminmenu .update-plugins{color:#fff;background:#e1a948}#adminmenu li a.wp-has-current-submenu .update-plugins,#adminmenu li.current a .awaiting-mod,#adminmenu li.menu-top:hover>a .update-plugins,#adminmenu li:hover a .awaiting-mod{color:#fff;background:#4796b3}#collapse-button{color:#e5f8ff}#collapse-button:focus,#collapse-button:hover{color:#fff}#wpadminbar{color:#fff;background:#52accc}#wpadminbar .ab-item,#wpadminbar a.ab-item,#wpadminbar>#wp-toolbar span.ab-label,#wpadminbar>#wp-toolbar span.noticon{color:#fff}#wpadminbar .ab-icon,#wpadminbar .ab-icon:before,#wpadminbar .ab-item:after,#wpadminbar .ab-item:before{color:#e5f8ff}#wpadminbar .ab-top-menu>li.menupop.hover>.ab-item,#wpadminbar.nojq .quicklinks .ab-top-menu>li>.ab-item:focus,#wpadminbar.nojs .ab-top-menu>li.menupop:hover>.ab-item,#wpadminbar:not(.mobile) .ab-top-menu>li:hover>.ab-item,#wpadminbar:not(.mobile) .ab-top-menu>li>.ab-item:focus{color:#fff;background:#4796b3}#wpadminbar:not(.mobile)>#wp-toolbar a:focus span.ab-label,#wpadminbar:not(.mobile)>#wp-toolbar li.hover span.ab-label,#wpadminbar:not(.mobile)>#wp-toolbar li:hover span.ab-label{color:#fff}#wpadminbar:not(.mobile) li:hover #adminbarsearch:before,#wpadminbar:not(.mobile) li:hover .ab-icon:before,#wpadminbar:not(.mobile) li:hover .ab-item:after,#wpadminbar:not(.mobile) li:hover .ab-item:before{color:#fff}#wpadminbar .menupop .ab-sub-wrapper{background:#4796b3}#wpadminbar .quicklinks .menupop ul.ab-sub-secondary,#wpadminbar .quicklinks .menupop ul.ab-sub-secondary .ab-submenu{background:#74b6ce}#wpadminbar .ab-submenu .ab-item,#wpadminbar .quicklinks .menupop ul li a,#wpadminbar .quicklinks .menupop.hover ul li a,#wpadminbar.nojs .quicklinks .menupop:hover ul li a{color:#e2ecf1}#wpadminbar .menupop .menupop>.ab-item:before,#wpadminbar .quicklinks li .blavatar{color:#e5f8ff}#wpadminbar .quicklinks .ab-sub-wrapper .menupop.hover>a,#wpadminbar .quicklinks .menupop ul li a:focus,#wpadminbar .quicklinks .menupop ul li a:focus strong,#wpadminbar .quicklinks .menupop ul li a:hover,#wpadminbar .quicklinks .menupop ul li a:hover strong,#wpadminbar .quicklinks .menupop.hover ul li a:focus,#wpadminbar .quicklinks .menupop.hover ul li a:hover,#wpadminbar li #adminbarsearch.adminbar-focused:before,#wpadminbar li .ab-item:focus .ab-icon:before,#wpadminbar li .ab-item:focus:before,#wpadminbar li a:focus .ab-icon:before,#wpadminbar li.hover .ab-icon:before,#wpadminbar li.hover .ab-item:before,#wpadminbar li:hover #adminbarsearch:before,#wpadminbar li:hover .ab-icon:before,#wpadminbar li:hover .ab-item:before,#wpadminbar.nojs .quicklinks .menupop:hover ul li a:focus,#wpadminbar.nojs .quicklinks .menupop:hover ul li a:hover{color:#fff}#wpadminbar .menupop .menupop>.ab-item:hover:before,#wpadminbar .quicklinks .ab-sub-wrapper .menupop.hover>a .blavatar,#wpadminbar .quicklinks li a:focus .blavatar,#wpadminbar .quicklinks li a:hover .blavatar,#wpadminbar.mobile .quicklinks .ab-icon:before,#wpadminbar.mobile .quicklinks .ab-item:before{color:#fff}#wpadminbar.mobile .quicklinks .hover .ab-icon:before,#wpadminbar.mobile .quicklinks .hover .ab-item:before{color:#e5f8ff}#wpadminbar #adminbarsearch:before{color:#e5f8ff}#wpadminbar>#wp-toolbar>#wp-admin-bar-top-secondary>#wp-admin-bar-search #adminbarsearch input.adminbar-input:focus{color:#fff;background:#6eb9d4}#wpadminbar #wp-admin-bar-recovery-mode{color:#fff;background-color:#e1a948}#wpadminbar #wp-admin-bar-recovery-mode .ab-item,#wpadminbar #wp-admin-bar-recovery-mode a.ab-item{color:#fff}#wpadminbar .ab-top-menu>#wp-admin-bar-recovery-mode.hover>.ab-item,#wpadminbar.nojq .quicklinks .ab-top-menu>#wp-admin-bar-recovery-mode>.ab-item:focus,#wpadminbar:not(.mobile) .ab-top-menu>#wp-admin-bar-recovery-mode:hover>.ab-item,#wpadminbar:not(.mobile) .ab-top-menu>#wp-admin-bar-recovery-mode>.ab-item:focus{color:#fff;background-color:#cb9841}#wpadminbar .quicklinks li#wp-admin-bar-my-account.with-avatar>a img{border-color:#6eb9d4;background-color:#6eb9d4}#wpadminbar #wp-admin-bar-user-info .display-name{color:#fff}#wpadminbar #wp-admin-bar-user-info a:hover .display-name{color:#fff}#wpadminbar #wp-admin-bar-user-info .username{color:#e2ecf1}.wp-pointer .wp-pointer-content h3{background-color:#096484;border-color:#07526c}.wp-pointer .wp-pointer-content h3:before{color:#096484}.wp-pointer.wp-pointer-top .wp-pointer-arrow,.wp-pointer.wp-pointer-top .wp-pointer-arrow-inner,.wp-pointer.wp-pointer-undefined .wp-pointer-arrow,.wp-pointer.wp-pointer-undefined .wp-pointer-arrow-inner{border-bottom-color:#096484}.media-item .bar,.media-progress-bar div{background-color:#096484}.details.attachment{box-shadow:inset 0 0 0 3px #fff,inset 0 0 0 7px #096484}.attachment.details .check{background-color:#096484;box-shadow:0 0 0 1px #fff,0 0 0 2px #096484}.media-selection .attachment.selection.details .thumbnail{box-shadow:0 0 0 1px #fff,0 0 0 3px #096484}.theme-browser .theme.active .theme-name,.theme-browser .theme.add-new-theme a:focus:after,.theme-browser .theme.add-new-theme a:hover:after{background:#096484}.theme-browser .theme.add-new-theme a:focus span:after,.theme-browser .theme.add-new-theme a:hover span:after{color:#096484}.theme-filter.current,.theme-section.current{border-bottom-color:#52accc}body.more-filters-opened .more-filters{color:#fff;background-color:#52accc}body.more-filters-opened .more-filters:before{color:#fff}body.more-filters-opened .more-filters:focus,body.more-filters-opened .more-filters:hover{background-color:#096484;color:#fff}body.more-filters-opened .more-filters:focus:before,body.more-filters-opened .more-filters:hover:before{color:#fff}.widgets-chooser li.widgets-chooser-selected{background-color:#096484;color:#fff}.widgets-chooser li.widgets-chooser-selected:before,.widgets-chooser li.widgets-chooser-selected:focus:before{color:#fff}div#wp-responsive-toggle a:before{color:#e5f8ff}.wp-responsive-open div#wp-responsive-toggle a{border-color:transparent;background:#096484}.wp-responsive-open #wpadminbar #wp-admin-bar-menu-toggle a{background:#4796b3}.wp-responsive-open #wpadminbar #wp-admin-bar-menu-toggle .ab-icon:before{color:#e5f8ff}.mce-container.mce-menu .mce-menu-item-normal.mce-active,.mce-container.mce-menu .mce-menu-item-preview.mce-active,.mce-container.mce-menu .mce-menu-item.mce-selected,.mce-container.mce-menu .mce-menu-item:focus,.mce-container.mce-menu .mce-menu-item:hover{background:#096484} \ No newline at end of file
diff --git a/www/crm/wp-admin/css/colors/blue/colors.css b/www/crm/wp-admin/css/colors/blue/colors.css
new file mode 100644
index 00000000..d3f9ac88
--- /dev/null
+++ b/www/crm/wp-admin/css/colors/blue/colors.css
@@ -0,0 +1,519 @@
+/*! This file is auto-generated */
+/*
+ * Button mixin- creates 3d-ish button effect with correct
+ * highlights/shadows, based on a base color.
+ */
+body {
+ background: #f1f1f1;
+}
+
+/* Links */
+a {
+ color: #0073aa;
+}
+
+a:hover, a:active, a:focus {
+ color: #0096dd;
+}
+
+#media-upload a.del-link:hover,
+div.dashboard-widget-submit input:hover,
+.subsubsub a:hover,
+.subsubsub a.current:hover {
+ color: #0096dd;
+}
+
+/* Forms */
+input[type=checkbox]:checked:before {
+ color: #096484;
+}
+
+input[type=radio]:checked:before {
+ background: #096484;
+}
+
+.wp-core-ui input[type="reset"]:hover,
+.wp-core-ui input[type="reset"]:active {
+ color: #0096dd;
+}
+
+/* Core UI */
+.wp-core-ui .button-primary {
+ background: #e1a948;
+ border-color: #d39323 #bd831f #bd831f;
+ color: #fff;
+ box-shadow: 0 1px 0 #bd831f;
+ text-shadow: 0 -1px 1px #bd831f, 1px 0 1px #bd831f, 0 1px 1px #bd831f, -1px 0 1px #bd831f;
+}
+
+.wp-core-ui .button-primary:hover, .wp-core-ui .button-primary:focus {
+ background: #e3af55;
+ border-color: #bd831f;
+ color: #fff;
+ box-shadow: 0 1px 0 #bd831f;
+}
+
+.wp-core-ui .button-primary:focus {
+ box-shadow: inset 0 1px 0 #d39323, 0 0 2px 1px #33b3db;
+}
+
+.wp-core-ui .button-primary:active, .wp-core-ui .button-primary.active, .wp-core-ui .button-primary.active:focus, .wp-core-ui .button-primary.active:hover {
+ background: #d39323;
+ border-color: #bd831f;
+ box-shadow: inset 0 2px 0 #bd831f;
+}
+
+.wp-core-ui .button-primary[disabled], .wp-core-ui .button-primary:disabled, .wp-core-ui .button-primary.button-primary-disabled, .wp-core-ui .button-primary.disabled {
+ color: #d1cdc7 !important;
+ background: #db9925 !important;
+ border-color: #bd831f !important;
+ text-shadow: none !important;
+}
+
+.wp-core-ui .button-primary.button-hero {
+ box-shadow: 0 2px 0 #bd831f !important;
+}
+
+.wp-core-ui .button-primary.button-hero:active {
+ box-shadow: inset 0 3px 0 #bd831f !important;
+}
+
+.wp-core-ui .wp-ui-primary {
+ color: #fff;
+ background-color: #52accc;
+}
+
+.wp-core-ui .wp-ui-text-primary {
+ color: #52accc;
+}
+
+.wp-core-ui .wp-ui-highlight {
+ color: #fff;
+ background-color: #096484;
+}
+
+.wp-core-ui .wp-ui-text-highlight {
+ color: #096484;
+}
+
+.wp-core-ui .wp-ui-notification {
+ color: #fff;
+ background-color: #e1a948;
+}
+
+.wp-core-ui .wp-ui-text-notification {
+ color: #e1a948;
+}
+
+.wp-core-ui .wp-ui-text-icon {
+ color: #e5f8ff;
+}
+
+/* List tables */
+.wrap .add-new-h2:hover,
+.wrap .page-title-action:hover {
+ color: #fff;
+ background-color: #52accc;
+}
+
+.view-switch a.current:before {
+ color: #52accc;
+}
+
+.view-switch a:hover:before {
+ color: #e1a948;
+}
+
+/* Admin Menu */
+#adminmenuback,
+#adminmenuwrap,
+#adminmenu {
+ background: #52accc;
+}
+
+#adminmenu a {
+ color: #fff;
+}
+
+#adminmenu div.wp-menu-image:before {
+ color: #e5f8ff;
+}
+
+#adminmenu a:hover,
+#adminmenu li.menu-top:hover,
+#adminmenu li.opensub > a.menu-top,
+#adminmenu li > a.menu-top:focus {
+ color: #fff;
+ background-color: #096484;
+}
+
+#adminmenu li.menu-top:hover div.wp-menu-image:before,
+#adminmenu li.opensub > a.menu-top div.wp-menu-image:before {
+ color: #fff;
+}
+
+/* Active tabs use a bottom border color that matches the page background color. */
+.about-wrap .nav-tab-active,
+.nav-tab-active,
+.nav-tab-active:hover {
+ background-color: #f1f1f1;
+ border-bottom-color: #f1f1f1;
+}
+
+/* Admin Menu: submenu */
+#adminmenu .wp-submenu,
+#adminmenu .wp-has-current-submenu .wp-submenu,
+#adminmenu .wp-has-current-submenu.opensub .wp-submenu,
+.folded #adminmenu .wp-has-current-submenu .wp-submenu,
+#adminmenu a.wp-has-current-submenu:focus + .wp-submenu {
+ background: #4796b3;
+}
+
+#adminmenu li.wp-has-submenu.wp-not-current-submenu.opensub:hover:after {
+ border-right-color: #4796b3;
+}
+
+#adminmenu .wp-submenu .wp-submenu-head {
+ color: #e2ecf1;
+}
+
+#adminmenu .wp-submenu a,
+#adminmenu .wp-has-current-submenu .wp-submenu a,
+.folded #adminmenu .wp-has-current-submenu .wp-submenu a,
+#adminmenu a.wp-has-current-submenu:focus + .wp-submenu a,
+#adminmenu .wp-has-current-submenu.opensub .wp-submenu a {
+ color: #e2ecf1;
+}
+
+#adminmenu .wp-submenu a:focus, #adminmenu .wp-submenu a:hover,
+#adminmenu .wp-has-current-submenu .wp-submenu a:focus,
+#adminmenu .wp-has-current-submenu .wp-submenu a:hover,
+.folded #adminmenu .wp-has-current-submenu .wp-submenu a:focus,
+.folded #adminmenu .wp-has-current-submenu .wp-submenu a:hover,
+#adminmenu a.wp-has-current-submenu:focus + .wp-submenu a:focus,
+#adminmenu a.wp-has-current-submenu:focus + .wp-submenu a:hover,
+#adminmenu .wp-has-current-submenu.opensub .wp-submenu a:focus,
+#adminmenu .wp-has-current-submenu.opensub .wp-submenu a:hover {
+ color: #fff;
+}
+
+/* Admin Menu: current */
+#adminmenu .wp-submenu li.current a,
+#adminmenu a.wp-has-current-submenu:focus + .wp-submenu li.current a,
+#adminmenu .wp-has-current-submenu.opensub .wp-submenu li.current a {
+ color: #fff;
+}
+
+#adminmenu .wp-submenu li.current a:hover, #adminmenu .wp-submenu li.current a:focus,
+#adminmenu a.wp-has-current-submenu:focus + .wp-submenu li.current a:hover,
+#adminmenu a.wp-has-current-submenu:focus + .wp-submenu li.current a:focus,
+#adminmenu .wp-has-current-submenu.opensub .wp-submenu li.current a:hover,
+#adminmenu .wp-has-current-submenu.opensub .wp-submenu li.current a:focus {
+ color: #fff;
+}
+
+ul#adminmenu a.wp-has-current-submenu:after,
+ul#adminmenu > li.current > a.current:after {
+ border-right-color: #f1f1f1;
+}
+
+#adminmenu li.current a.menu-top,
+#adminmenu li.wp-has-current-submenu a.wp-has-current-submenu,
+#adminmenu li.wp-has-current-submenu .wp-submenu .wp-submenu-head,
+.folded #adminmenu li.current.menu-top {
+ color: #fff;
+ background: #096484;
+}
+
+#adminmenu li.wp-has-current-submenu div.wp-menu-image:before,
+#adminmenu a.current:hover div.wp-menu-image:before,
+#adminmenu li.wp-has-current-submenu a:focus div.wp-menu-image:before,
+#adminmenu li.wp-has-current-submenu.opensub div.wp-menu-image:before,
+#adminmenu li:hover div.wp-menu-image:before,
+#adminmenu li a:focus div.wp-menu-image:before,
+#adminmenu li.opensub div.wp-menu-image:before,
+.ie8 #adminmenu li.opensub div.wp-menu-image:before {
+ color: #fff;
+}
+
+/* Admin Menu: bubble */
+#adminmenu .awaiting-mod,
+#adminmenu .update-plugins {
+ color: #fff;
+ background: #e1a948;
+}
+
+#adminmenu li.current a .awaiting-mod,
+#adminmenu li a.wp-has-current-submenu .update-plugins,
+#adminmenu li:hover a .awaiting-mod,
+#adminmenu li.menu-top:hover > a .update-plugins {
+ color: #fff;
+ background: #4796b3;
+}
+
+/* Admin Menu: collapse button */
+#collapse-button {
+ color: #e5f8ff;
+}
+
+#collapse-button:hover,
+#collapse-button:focus {
+ color: #fff;
+}
+
+/* Admin Bar */
+#wpadminbar {
+ color: #fff;
+ background: #52accc;
+}
+
+#wpadminbar .ab-item,
+#wpadminbar a.ab-item,
+#wpadminbar > #wp-toolbar span.ab-label,
+#wpadminbar > #wp-toolbar span.noticon {
+ color: #fff;
+}
+
+#wpadminbar .ab-icon,
+#wpadminbar .ab-icon:before,
+#wpadminbar .ab-item:before,
+#wpadminbar .ab-item:after {
+ color: #e5f8ff;
+}
+
+#wpadminbar:not(.mobile) .ab-top-menu > li:hover > .ab-item,
+#wpadminbar:not(.mobile) .ab-top-menu > li > .ab-item:focus,
+#wpadminbar.nojq .quicklinks .ab-top-menu > li > .ab-item:focus,
+#wpadminbar.nojs .ab-top-menu > li.menupop:hover > .ab-item,
+#wpadminbar .ab-top-menu > li.menupop.hover > .ab-item {
+ color: #fff;
+ background: #4796b3;
+}
+
+#wpadminbar:not(.mobile) > #wp-toolbar li:hover span.ab-label,
+#wpadminbar:not(.mobile) > #wp-toolbar li.hover span.ab-label,
+#wpadminbar:not(.mobile) > #wp-toolbar a:focus span.ab-label {
+ color: #fff;
+}
+
+#wpadminbar:not(.mobile) li:hover .ab-icon:before,
+#wpadminbar:not(.mobile) li:hover .ab-item:before,
+#wpadminbar:not(.mobile) li:hover .ab-item:after,
+#wpadminbar:not(.mobile) li:hover #adminbarsearch:before {
+ color: #fff;
+}
+
+/* Admin Bar: submenu */
+#wpadminbar .menupop .ab-sub-wrapper {
+ background: #4796b3;
+}
+
+#wpadminbar .quicklinks .menupop ul.ab-sub-secondary,
+#wpadminbar .quicklinks .menupop ul.ab-sub-secondary .ab-submenu {
+ background: #74b6ce;
+}
+
+#wpadminbar .ab-submenu .ab-item,
+#wpadminbar .quicklinks .menupop ul li a,
+#wpadminbar .quicklinks .menupop.hover ul li a,
+#wpadminbar.nojs .quicklinks .menupop:hover ul li a {
+ color: #e2ecf1;
+}
+
+#wpadminbar .quicklinks li .blavatar,
+#wpadminbar .menupop .menupop > .ab-item:before {
+ color: #e5f8ff;
+}
+
+#wpadminbar .quicklinks .menupop ul li a:hover,
+#wpadminbar .quicklinks .menupop ul li a:focus,
+#wpadminbar .quicklinks .menupop ul li a:hover strong,
+#wpadminbar .quicklinks .menupop ul li a:focus strong,
+#wpadminbar .quicklinks .ab-sub-wrapper .menupop.hover > a,
+#wpadminbar .quicklinks .menupop.hover ul li a:hover,
+#wpadminbar .quicklinks .menupop.hover ul li a:focus,
+#wpadminbar.nojs .quicklinks .menupop:hover ul li a:hover,
+#wpadminbar.nojs .quicklinks .menupop:hover ul li a:focus,
+#wpadminbar li:hover .ab-icon:before,
+#wpadminbar li:hover .ab-item:before,
+#wpadminbar li a:focus .ab-icon:before,
+#wpadminbar li .ab-item:focus:before,
+#wpadminbar li .ab-item:focus .ab-icon:before,
+#wpadminbar li.hover .ab-icon:before,
+#wpadminbar li.hover .ab-item:before,
+#wpadminbar li:hover #adminbarsearch:before,
+#wpadminbar li #adminbarsearch.adminbar-focused:before {
+ color: #fff;
+}
+
+#wpadminbar .quicklinks li a:hover .blavatar,
+#wpadminbar .quicklinks li a:focus .blavatar,
+#wpadminbar .quicklinks .ab-sub-wrapper .menupop.hover > a .blavatar,
+#wpadminbar .menupop .menupop > .ab-item:hover:before,
+#wpadminbar.mobile .quicklinks .ab-icon:before,
+#wpadminbar.mobile .quicklinks .ab-item:before {
+ color: #fff;
+}
+
+#wpadminbar.mobile .quicklinks .hover .ab-icon:before,
+#wpadminbar.mobile .quicklinks .hover .ab-item:before {
+ color: #e5f8ff;
+}
+
+/* Admin Bar: search */
+#wpadminbar #adminbarsearch:before {
+ color: #e5f8ff;
+}
+
+#wpadminbar > #wp-toolbar > #wp-admin-bar-top-secondary > #wp-admin-bar-search #adminbarsearch input.adminbar-input:focus {
+ color: #fff;
+ background: #6eb9d4;
+}
+
+/* Admin Bar: recovery mode */
+#wpadminbar #wp-admin-bar-recovery-mode {
+ color: #fff;
+ background-color: #e1a948;
+}
+
+#wpadminbar #wp-admin-bar-recovery-mode .ab-item,
+#wpadminbar #wp-admin-bar-recovery-mode a.ab-item {
+ color: #fff;
+}
+
+#wpadminbar .ab-top-menu > #wp-admin-bar-recovery-mode.hover > .ab-item,
+#wpadminbar.nojq .quicklinks .ab-top-menu > #wp-admin-bar-recovery-mode > .ab-item:focus,
+#wpadminbar:not(.mobile) .ab-top-menu > #wp-admin-bar-recovery-mode:hover > .ab-item,
+#wpadminbar:not(.mobile) .ab-top-menu > #wp-admin-bar-recovery-mode > .ab-item:focus {
+ color: #fff;
+ background-color: #cb9841;
+}
+
+/* Admin Bar: my account */
+#wpadminbar .quicklinks li#wp-admin-bar-my-account.with-avatar > a img {
+ border-color: #6eb9d4;
+ background-color: #6eb9d4;
+}
+
+#wpadminbar #wp-admin-bar-user-info .display-name {
+ color: #fff;
+}
+
+#wpadminbar #wp-admin-bar-user-info a:hover .display-name {
+ color: #fff;
+}
+
+#wpadminbar #wp-admin-bar-user-info .username {
+ color: #e2ecf1;
+}
+
+/* Pointers */
+.wp-pointer .wp-pointer-content h3 {
+ background-color: #096484;
+ border-color: #07526c;
+}
+
+.wp-pointer .wp-pointer-content h3:before {
+ color: #096484;
+}
+
+.wp-pointer.wp-pointer-top .wp-pointer-arrow,
+.wp-pointer.wp-pointer-top .wp-pointer-arrow-inner,
+.wp-pointer.wp-pointer-undefined .wp-pointer-arrow,
+.wp-pointer.wp-pointer-undefined .wp-pointer-arrow-inner {
+ border-bottom-color: #096484;
+}
+
+/* Media */
+.media-item .bar,
+.media-progress-bar div {
+ background-color: #096484;
+}
+
+.details.attachment {
+ box-shadow: inset 0 0 0 3px #fff, inset 0 0 0 7px #096484;
+}
+
+.attachment.details .check {
+ background-color: #096484;
+ box-shadow: 0 0 0 1px #fff, 0 0 0 2px #096484;
+}
+
+.media-selection .attachment.selection.details .thumbnail {
+ box-shadow: 0 0 0 1px #fff, 0 0 0 3px #096484;
+}
+
+/* Themes */
+.theme-browser .theme.active .theme-name,
+.theme-browser .theme.add-new-theme a:hover:after,
+.theme-browser .theme.add-new-theme a:focus:after {
+ background: #096484;
+}
+
+.theme-browser .theme.add-new-theme a:hover span:after,
+.theme-browser .theme.add-new-theme a:focus span:after {
+ color: #096484;
+}
+
+.theme-section.current,
+.theme-filter.current {
+ border-bottom-color: #52accc;
+}
+
+body.more-filters-opened .more-filters {
+ color: #fff;
+ background-color: #52accc;
+}
+
+body.more-filters-opened .more-filters:before {
+ color: #fff;
+}
+
+body.more-filters-opened .more-filters:hover,
+body.more-filters-opened .more-filters:focus {
+ background-color: #096484;
+ color: #fff;
+}
+
+body.more-filters-opened .more-filters:hover:before,
+body.more-filters-opened .more-filters:focus:before {
+ color: #fff;
+}
+
+/* Widgets */
+.widgets-chooser li.widgets-chooser-selected {
+ background-color: #096484;
+ color: #fff;
+}
+
+.widgets-chooser li.widgets-chooser-selected:before,
+.widgets-chooser li.widgets-chooser-selected:focus:before {
+ color: #fff;
+}
+
+/* Responsive Component */
+div#wp-responsive-toggle a:before {
+ color: #e5f8ff;
+}
+
+.wp-responsive-open div#wp-responsive-toggle a {
+ border-color: transparent;
+ background: #096484;
+}
+
+.wp-responsive-open #wpadminbar #wp-admin-bar-menu-toggle a {
+ background: #4796b3;
+}
+
+.wp-responsive-open #wpadminbar #wp-admin-bar-menu-toggle .ab-icon:before {
+ color: #e5f8ff;
+}
+
+/* TinyMCE */
+.mce-container.mce-menu .mce-menu-item:hover,
+.mce-container.mce-menu .mce-menu-item.mce-selected,
+.mce-container.mce-menu .mce-menu-item:focus,
+.mce-container.mce-menu .mce-menu-item-normal.mce-active,
+.mce-container.mce-menu .mce-menu-item-preview.mce-active {
+ background: #096484;
+}
diff --git a/www/crm/wp-admin/css/colors/blue/colors.min.css b/www/crm/wp-admin/css/colors/blue/colors.min.css
new file mode 100644
index 00000000..cc3cf458
--- /dev/null
+++ b/www/crm/wp-admin/css/colors/blue/colors.min.css
@@ -0,0 +1,2 @@
+/*! This file is auto-generated */
+body{background:#f1f1f1}a{color:#0073aa}a:active,a:focus,a:hover{color:#0096dd}#media-upload a.del-link:hover,.subsubsub a.current:hover,.subsubsub a:hover,div.dashboard-widget-submit input:hover{color:#0096dd}input[type=checkbox]:checked:before{color:#096484}input[type=radio]:checked:before{background:#096484}.wp-core-ui input[type=reset]:active,.wp-core-ui input[type=reset]:hover{color:#0096dd}.wp-core-ui .button-primary{background:#e1a948;border-color:#d39323 #bd831f #bd831f;color:#fff;box-shadow:0 1px 0 #bd831f;text-shadow:0 -1px 1px #bd831f,1px 0 1px #bd831f,0 1px 1px #bd831f,-1px 0 1px #bd831f}.wp-core-ui .button-primary:focus,.wp-core-ui .button-primary:hover{background:#e3af55;border-color:#bd831f;color:#fff;box-shadow:0 1px 0 #bd831f}.wp-core-ui .button-primary:focus{box-shadow:inset 0 1px 0 #d39323,0 0 2px 1px #33b3db}.wp-core-ui .button-primary.active,.wp-core-ui .button-primary.active:focus,.wp-core-ui .button-primary.active:hover,.wp-core-ui .button-primary:active{background:#d39323;border-color:#bd831f;box-shadow:inset 0 2px 0 #bd831f}.wp-core-ui .button-primary.button-primary-disabled,.wp-core-ui .button-primary.disabled,.wp-core-ui .button-primary:disabled,.wp-core-ui .button-primary[disabled]{color:#d1cdc7!important;background:#db9925!important;border-color:#bd831f!important;text-shadow:none!important}.wp-core-ui .button-primary.button-hero{box-shadow:0 2px 0 #bd831f!important}.wp-core-ui .button-primary.button-hero:active{box-shadow:inset 0 3px 0 #bd831f!important}.wp-core-ui .wp-ui-primary{color:#fff;background-color:#52accc}.wp-core-ui .wp-ui-text-primary{color:#52accc}.wp-core-ui .wp-ui-highlight{color:#fff;background-color:#096484}.wp-core-ui .wp-ui-text-highlight{color:#096484}.wp-core-ui .wp-ui-notification{color:#fff;background-color:#e1a948}.wp-core-ui .wp-ui-text-notification{color:#e1a948}.wp-core-ui .wp-ui-text-icon{color:#e5f8ff}.wrap .add-new-h2:hover,.wrap .page-title-action:hover{color:#fff;background-color:#52accc}.view-switch a.current:before{color:#52accc}.view-switch a:hover:before{color:#e1a948}#adminmenu,#adminmenuback,#adminmenuwrap{background:#52accc}#adminmenu a{color:#fff}#adminmenu div.wp-menu-image:before{color:#e5f8ff}#adminmenu a:hover,#adminmenu li.menu-top:hover,#adminmenu li.opensub>a.menu-top,#adminmenu li>a.menu-top:focus{color:#fff;background-color:#096484}#adminmenu li.menu-top:hover div.wp-menu-image:before,#adminmenu li.opensub>a.menu-top div.wp-menu-image:before{color:#fff}.about-wrap .nav-tab-active,.nav-tab-active,.nav-tab-active:hover{background-color:#f1f1f1;border-bottom-color:#f1f1f1}#adminmenu .wp-has-current-submenu .wp-submenu,#adminmenu .wp-has-current-submenu.opensub .wp-submenu,#adminmenu .wp-submenu,#adminmenu a.wp-has-current-submenu:focus+.wp-submenu,.folded #adminmenu .wp-has-current-submenu .wp-submenu{background:#4796b3}#adminmenu li.wp-has-submenu.wp-not-current-submenu.opensub:hover:after{border-right-color:#4796b3}#adminmenu .wp-submenu .wp-submenu-head{color:#e2ecf1}#adminmenu .wp-has-current-submenu .wp-submenu a,#adminmenu .wp-has-current-submenu.opensub .wp-submenu a,#adminmenu .wp-submenu a,#adminmenu a.wp-has-current-submenu:focus+.wp-submenu a,.folded #adminmenu .wp-has-current-submenu .wp-submenu a{color:#e2ecf1}#adminmenu .wp-has-current-submenu .wp-submenu a:focus,#adminmenu .wp-has-current-submenu .wp-submenu a:hover,#adminmenu .wp-has-current-submenu.opensub .wp-submenu a:focus,#adminmenu .wp-has-current-submenu.opensub .wp-submenu a:hover,#adminmenu .wp-submenu a:focus,#adminmenu .wp-submenu a:hover,#adminmenu a.wp-has-current-submenu:focus+.wp-submenu a:focus,#adminmenu a.wp-has-current-submenu:focus+.wp-submenu a:hover,.folded #adminmenu .wp-has-current-submenu .wp-submenu a:focus,.folded #adminmenu .wp-has-current-submenu .wp-submenu a:hover{color:#fff}#adminmenu .wp-has-current-submenu.opensub .wp-submenu li.current a,#adminmenu .wp-submenu li.current a,#adminmenu a.wp-has-current-submenu:focus+.wp-submenu li.current a{color:#fff}#adminmenu .wp-has-current-submenu.opensub .wp-submenu li.current a:focus,#adminmenu .wp-has-current-submenu.opensub .wp-submenu li.current a:hover,#adminmenu .wp-submenu li.current a:focus,#adminmenu .wp-submenu li.current a:hover,#adminmenu a.wp-has-current-submenu:focus+.wp-submenu li.current a:focus,#adminmenu a.wp-has-current-submenu:focus+.wp-submenu li.current a:hover{color:#fff}ul#adminmenu a.wp-has-current-submenu:after,ul#adminmenu>li.current>a.current:after{border-right-color:#f1f1f1}#adminmenu li.current a.menu-top,#adminmenu li.wp-has-current-submenu .wp-submenu .wp-submenu-head,#adminmenu li.wp-has-current-submenu a.wp-has-current-submenu,.folded #adminmenu li.current.menu-top{color:#fff;background:#096484}#adminmenu a.current:hover div.wp-menu-image:before,#adminmenu li a:focus div.wp-menu-image:before,#adminmenu li.opensub div.wp-menu-image:before,#adminmenu li.wp-has-current-submenu a:focus div.wp-menu-image:before,#adminmenu li.wp-has-current-submenu div.wp-menu-image:before,#adminmenu li.wp-has-current-submenu.opensub div.wp-menu-image:before,#adminmenu li:hover div.wp-menu-image:before,.ie8 #adminmenu li.opensub div.wp-menu-image:before{color:#fff}#adminmenu .awaiting-mod,#adminmenu .update-plugins{color:#fff;background:#e1a948}#adminmenu li a.wp-has-current-submenu .update-plugins,#adminmenu li.current a .awaiting-mod,#adminmenu li.menu-top:hover>a .update-plugins,#adminmenu li:hover a .awaiting-mod{color:#fff;background:#4796b3}#collapse-button{color:#e5f8ff}#collapse-button:focus,#collapse-button:hover{color:#fff}#wpadminbar{color:#fff;background:#52accc}#wpadminbar .ab-item,#wpadminbar a.ab-item,#wpadminbar>#wp-toolbar span.ab-label,#wpadminbar>#wp-toolbar span.noticon{color:#fff}#wpadminbar .ab-icon,#wpadminbar .ab-icon:before,#wpadminbar .ab-item:after,#wpadminbar .ab-item:before{color:#e5f8ff}#wpadminbar .ab-top-menu>li.menupop.hover>.ab-item,#wpadminbar.nojq .quicklinks .ab-top-menu>li>.ab-item:focus,#wpadminbar.nojs .ab-top-menu>li.menupop:hover>.ab-item,#wpadminbar:not(.mobile) .ab-top-menu>li:hover>.ab-item,#wpadminbar:not(.mobile) .ab-top-menu>li>.ab-item:focus{color:#fff;background:#4796b3}#wpadminbar:not(.mobile)>#wp-toolbar a:focus span.ab-label,#wpadminbar:not(.mobile)>#wp-toolbar li.hover span.ab-label,#wpadminbar:not(.mobile)>#wp-toolbar li:hover span.ab-label{color:#fff}#wpadminbar:not(.mobile) li:hover #adminbarsearch:before,#wpadminbar:not(.mobile) li:hover .ab-icon:before,#wpadminbar:not(.mobile) li:hover .ab-item:after,#wpadminbar:not(.mobile) li:hover .ab-item:before{color:#fff}#wpadminbar .menupop .ab-sub-wrapper{background:#4796b3}#wpadminbar .quicklinks .menupop ul.ab-sub-secondary,#wpadminbar .quicklinks .menupop ul.ab-sub-secondary .ab-submenu{background:#74b6ce}#wpadminbar .ab-submenu .ab-item,#wpadminbar .quicklinks .menupop ul li a,#wpadminbar .quicklinks .menupop.hover ul li a,#wpadminbar.nojs .quicklinks .menupop:hover ul li a{color:#e2ecf1}#wpadminbar .menupop .menupop>.ab-item:before,#wpadminbar .quicklinks li .blavatar{color:#e5f8ff}#wpadminbar .quicklinks .ab-sub-wrapper .menupop.hover>a,#wpadminbar .quicklinks .menupop ul li a:focus,#wpadminbar .quicklinks .menupop ul li a:focus strong,#wpadminbar .quicklinks .menupop ul li a:hover,#wpadminbar .quicklinks .menupop ul li a:hover strong,#wpadminbar .quicklinks .menupop.hover ul li a:focus,#wpadminbar .quicklinks .menupop.hover ul li a:hover,#wpadminbar li #adminbarsearch.adminbar-focused:before,#wpadminbar li .ab-item:focus .ab-icon:before,#wpadminbar li .ab-item:focus:before,#wpadminbar li a:focus .ab-icon:before,#wpadminbar li.hover .ab-icon:before,#wpadminbar li.hover .ab-item:before,#wpadminbar li:hover #adminbarsearch:before,#wpadminbar li:hover .ab-icon:before,#wpadminbar li:hover .ab-item:before,#wpadminbar.nojs .quicklinks .menupop:hover ul li a:focus,#wpadminbar.nojs .quicklinks .menupop:hover ul li a:hover{color:#fff}#wpadminbar .menupop .menupop>.ab-item:hover:before,#wpadminbar .quicklinks .ab-sub-wrapper .menupop.hover>a .blavatar,#wpadminbar .quicklinks li a:focus .blavatar,#wpadminbar .quicklinks li a:hover .blavatar,#wpadminbar.mobile .quicklinks .ab-icon:before,#wpadminbar.mobile .quicklinks .ab-item:before{color:#fff}#wpadminbar.mobile .quicklinks .hover .ab-icon:before,#wpadminbar.mobile .quicklinks .hover .ab-item:before{color:#e5f8ff}#wpadminbar #adminbarsearch:before{color:#e5f8ff}#wpadminbar>#wp-toolbar>#wp-admin-bar-top-secondary>#wp-admin-bar-search #adminbarsearch input.adminbar-input:focus{color:#fff;background:#6eb9d4}#wpadminbar #wp-admin-bar-recovery-mode{color:#fff;background-color:#e1a948}#wpadminbar #wp-admin-bar-recovery-mode .ab-item,#wpadminbar #wp-admin-bar-recovery-mode a.ab-item{color:#fff}#wpadminbar .ab-top-menu>#wp-admin-bar-recovery-mode.hover>.ab-item,#wpadminbar.nojq .quicklinks .ab-top-menu>#wp-admin-bar-recovery-mode>.ab-item:focus,#wpadminbar:not(.mobile) .ab-top-menu>#wp-admin-bar-recovery-mode:hover>.ab-item,#wpadminbar:not(.mobile) .ab-top-menu>#wp-admin-bar-recovery-mode>.ab-item:focus{color:#fff;background-color:#cb9841}#wpadminbar .quicklinks li#wp-admin-bar-my-account.with-avatar>a img{border-color:#6eb9d4;background-color:#6eb9d4}#wpadminbar #wp-admin-bar-user-info .display-name{color:#fff}#wpadminbar #wp-admin-bar-user-info a:hover .display-name{color:#fff}#wpadminbar #wp-admin-bar-user-info .username{color:#e2ecf1}.wp-pointer .wp-pointer-content h3{background-color:#096484;border-color:#07526c}.wp-pointer .wp-pointer-content h3:before{color:#096484}.wp-pointer.wp-pointer-top .wp-pointer-arrow,.wp-pointer.wp-pointer-top .wp-pointer-arrow-inner,.wp-pointer.wp-pointer-undefined .wp-pointer-arrow,.wp-pointer.wp-pointer-undefined .wp-pointer-arrow-inner{border-bottom-color:#096484}.media-item .bar,.media-progress-bar div{background-color:#096484}.details.attachment{box-shadow:inset 0 0 0 3px #fff,inset 0 0 0 7px #096484}.attachment.details .check{background-color:#096484;box-shadow:0 0 0 1px #fff,0 0 0 2px #096484}.media-selection .attachment.selection.details .thumbnail{box-shadow:0 0 0 1px #fff,0 0 0 3px #096484}.theme-browser .theme.active .theme-name,.theme-browser .theme.add-new-theme a:focus:after,.theme-browser .theme.add-new-theme a:hover:after{background:#096484}.theme-browser .theme.add-new-theme a:focus span:after,.theme-browser .theme.add-new-theme a:hover span:after{color:#096484}.theme-filter.current,.theme-section.current{border-bottom-color:#52accc}body.more-filters-opened .more-filters{color:#fff;background-color:#52accc}body.more-filters-opened .more-filters:before{color:#fff}body.more-filters-opened .more-filters:focus,body.more-filters-opened .more-filters:hover{background-color:#096484;color:#fff}body.more-filters-opened .more-filters:focus:before,body.more-filters-opened .more-filters:hover:before{color:#fff}.widgets-chooser li.widgets-chooser-selected{background-color:#096484;color:#fff}.widgets-chooser li.widgets-chooser-selected:before,.widgets-chooser li.widgets-chooser-selected:focus:before{color:#fff}div#wp-responsive-toggle a:before{color:#e5f8ff}.wp-responsive-open div#wp-responsive-toggle a{border-color:transparent;background:#096484}.wp-responsive-open #wpadminbar #wp-admin-bar-menu-toggle a{background:#4796b3}.wp-responsive-open #wpadminbar #wp-admin-bar-menu-toggle .ab-icon:before{color:#e5f8ff}.mce-container.mce-menu .mce-menu-item-normal.mce-active,.mce-container.mce-menu .mce-menu-item-preview.mce-active,.mce-container.mce-menu .mce-menu-item.mce-selected,.mce-container.mce-menu .mce-menu-item:focus,.mce-container.mce-menu .mce-menu-item:hover{background:#096484} \ No newline at end of file
diff --git a/www/crm/wp-admin/css/colors/blue/colors.scss b/www/crm/wp-admin/css/colors/blue/colors.scss
new file mode 100644
index 00000000..b254d73a
--- /dev/null
+++ b/www/crm/wp-admin/css/colors/blue/colors.scss
@@ -0,0 +1,11 @@
+$base-color: #52accc;
+$icon-color: #e5f8ff;
+$highlight-color: #096484;
+$notification-color: #e1a948;
+$button-color: #e1a948;
+
+$menu-submenu-text: #e2ecf1;
+$menu-submenu-focus-text: #fff;
+$menu-submenu-background: #4796b3;
+
+@import "../_admin.scss";
diff --git a/www/crm/wp-admin/css/colors/coffee/colors-rtl.css b/www/crm/wp-admin/css/colors/coffee/colors-rtl.css
new file mode 100644
index 00000000..faf3783e
--- /dev/null
+++ b/www/crm/wp-admin/css/colors/coffee/colors-rtl.css
@@ -0,0 +1,519 @@
+/*! This file is auto-generated */
+/*
+ * Button mixin- creates 3d-ish button effect with correct
+ * highlights/shadows, based on a base color.
+ */
+body {
+ background: #f1f1f1;
+}
+
+/* Links */
+a {
+ color: #0073aa;
+}
+
+a:hover, a:active, a:focus {
+ color: #0096dd;
+}
+
+#media-upload a.del-link:hover,
+div.dashboard-widget-submit input:hover,
+.subsubsub a:hover,
+.subsubsub a.current:hover {
+ color: #0096dd;
+}
+
+/* Forms */
+input[type=checkbox]:checked:before {
+ color: #59524c;
+}
+
+input[type=radio]:checked:before {
+ background: #59524c;
+}
+
+.wp-core-ui input[type="reset"]:hover,
+.wp-core-ui input[type="reset"]:active {
+ color: #0096dd;
+}
+
+/* Core UI */
+.wp-core-ui .button-primary {
+ background: #c7a589;
+ border-color: #b78b66 #ae7d55 #ae7d55;
+ color: #fff;
+ box-shadow: 0 1px 0 #ae7d55;
+ text-shadow: 0 -1px 1px #ae7d55, -1px 0 1px #ae7d55, 0 1px 1px #ae7d55, 1px 0 1px #ae7d55;
+}
+
+.wp-core-ui .button-primary:hover, .wp-core-ui .button-primary:focus {
+ background: #ccad93;
+ border-color: #ae7d55;
+ color: #fff;
+ box-shadow: 0 1px 0 #ae7d55;
+}
+
+.wp-core-ui .button-primary:focus {
+ box-shadow: inset 0 1px 0 #b78b66, 0 0 2px 1px #33b3db;
+}
+
+.wp-core-ui .button-primary:active, .wp-core-ui .button-primary.active, .wp-core-ui .button-primary.active:focus, .wp-core-ui .button-primary.active:hover {
+ background: #b78b66;
+ border-color: #ae7d55;
+ box-shadow: inset 0 2px 0 #ae7d55;
+}
+
+.wp-core-ui .button-primary[disabled], .wp-core-ui .button-primary:disabled, .wp-core-ui .button-primary.button-primary-disabled, .wp-core-ui .button-primary.disabled {
+ color: #d1ccc7 !important;
+ background: #ba906d !important;
+ border-color: #ae7d55 !important;
+ text-shadow: none !important;
+}
+
+.wp-core-ui .button-primary.button-hero {
+ box-shadow: 0 2px 0 #ae7d55 !important;
+}
+
+.wp-core-ui .button-primary.button-hero:active {
+ box-shadow: inset 0 3px 0 #ae7d55 !important;
+}
+
+.wp-core-ui .wp-ui-primary {
+ color: #fff;
+ background-color: #59524c;
+}
+
+.wp-core-ui .wp-ui-text-primary {
+ color: #59524c;
+}
+
+.wp-core-ui .wp-ui-highlight {
+ color: #fff;
+ background-color: #c7a589;
+}
+
+.wp-core-ui .wp-ui-text-highlight {
+ color: #c7a589;
+}
+
+.wp-core-ui .wp-ui-notification {
+ color: #fff;
+ background-color: #9ea476;
+}
+
+.wp-core-ui .wp-ui-text-notification {
+ color: #9ea476;
+}
+
+.wp-core-ui .wp-ui-text-icon {
+ color: #f3f2f1;
+}
+
+/* List tables */
+.wrap .add-new-h2:hover,
+.wrap .page-title-action:hover {
+ color: #fff;
+ background-color: #59524c;
+}
+
+.view-switch a.current:before {
+ color: #59524c;
+}
+
+.view-switch a:hover:before {
+ color: #9ea476;
+}
+
+/* Admin Menu */
+#adminmenuback,
+#adminmenuwrap,
+#adminmenu {
+ background: #59524c;
+}
+
+#adminmenu a {
+ color: #fff;
+}
+
+#adminmenu div.wp-menu-image:before {
+ color: #f3f2f1;
+}
+
+#adminmenu a:hover,
+#adminmenu li.menu-top:hover,
+#adminmenu li.opensub > a.menu-top,
+#adminmenu li > a.menu-top:focus {
+ color: #fff;
+ background-color: #c7a589;
+}
+
+#adminmenu li.menu-top:hover div.wp-menu-image:before,
+#adminmenu li.opensub > a.menu-top div.wp-menu-image:before {
+ color: #fff;
+}
+
+/* Active tabs use a bottom border color that matches the page background color. */
+.about-wrap .nav-tab-active,
+.nav-tab-active,
+.nav-tab-active:hover {
+ background-color: #f1f1f1;
+ border-bottom-color: #f1f1f1;
+}
+
+/* Admin Menu: submenu */
+#adminmenu .wp-submenu,
+#adminmenu .wp-has-current-submenu .wp-submenu,
+#adminmenu .wp-has-current-submenu.opensub .wp-submenu,
+.folded #adminmenu .wp-has-current-submenu .wp-submenu,
+#adminmenu a.wp-has-current-submenu:focus + .wp-submenu {
+ background: #46403c;
+}
+
+#adminmenu li.wp-has-submenu.wp-not-current-submenu.opensub:hover:after {
+ border-left-color: #46403c;
+}
+
+#adminmenu .wp-submenu .wp-submenu-head {
+ color: #cdcbc9;
+}
+
+#adminmenu .wp-submenu a,
+#adminmenu .wp-has-current-submenu .wp-submenu a,
+.folded #adminmenu .wp-has-current-submenu .wp-submenu a,
+#adminmenu a.wp-has-current-submenu:focus + .wp-submenu a,
+#adminmenu .wp-has-current-submenu.opensub .wp-submenu a {
+ color: #cdcbc9;
+}
+
+#adminmenu .wp-submenu a:focus, #adminmenu .wp-submenu a:hover,
+#adminmenu .wp-has-current-submenu .wp-submenu a:focus,
+#adminmenu .wp-has-current-submenu .wp-submenu a:hover,
+.folded #adminmenu .wp-has-current-submenu .wp-submenu a:focus,
+.folded #adminmenu .wp-has-current-submenu .wp-submenu a:hover,
+#adminmenu a.wp-has-current-submenu:focus + .wp-submenu a:focus,
+#adminmenu a.wp-has-current-submenu:focus + .wp-submenu a:hover,
+#adminmenu .wp-has-current-submenu.opensub .wp-submenu a:focus,
+#adminmenu .wp-has-current-submenu.opensub .wp-submenu a:hover {
+ color: #c7a589;
+}
+
+/* Admin Menu: current */
+#adminmenu .wp-submenu li.current a,
+#adminmenu a.wp-has-current-submenu:focus + .wp-submenu li.current a,
+#adminmenu .wp-has-current-submenu.opensub .wp-submenu li.current a {
+ color: #fff;
+}
+
+#adminmenu .wp-submenu li.current a:hover, #adminmenu .wp-submenu li.current a:focus,
+#adminmenu a.wp-has-current-submenu:focus + .wp-submenu li.current a:hover,
+#adminmenu a.wp-has-current-submenu:focus + .wp-submenu li.current a:focus,
+#adminmenu .wp-has-current-submenu.opensub .wp-submenu li.current a:hover,
+#adminmenu .wp-has-current-submenu.opensub .wp-submenu li.current a:focus {
+ color: #c7a589;
+}
+
+ul#adminmenu a.wp-has-current-submenu:after,
+ul#adminmenu > li.current > a.current:after {
+ border-left-color: #f1f1f1;
+}
+
+#adminmenu li.current a.menu-top,
+#adminmenu li.wp-has-current-submenu a.wp-has-current-submenu,
+#adminmenu li.wp-has-current-submenu .wp-submenu .wp-submenu-head,
+.folded #adminmenu li.current.menu-top {
+ color: #fff;
+ background: #c7a589;
+}
+
+#adminmenu li.wp-has-current-submenu div.wp-menu-image:before,
+#adminmenu a.current:hover div.wp-menu-image:before,
+#adminmenu li.wp-has-current-submenu a:focus div.wp-menu-image:before,
+#adminmenu li.wp-has-current-submenu.opensub div.wp-menu-image:before,
+#adminmenu li:hover div.wp-menu-image:before,
+#adminmenu li a:focus div.wp-menu-image:before,
+#adminmenu li.opensub div.wp-menu-image:before,
+.ie8 #adminmenu li.opensub div.wp-menu-image:before {
+ color: #fff;
+}
+
+/* Admin Menu: bubble */
+#adminmenu .awaiting-mod,
+#adminmenu .update-plugins {
+ color: #fff;
+ background: #9ea476;
+}
+
+#adminmenu li.current a .awaiting-mod,
+#adminmenu li a.wp-has-current-submenu .update-plugins,
+#adminmenu li:hover a .awaiting-mod,
+#adminmenu li.menu-top:hover > a .update-plugins {
+ color: #fff;
+ background: #46403c;
+}
+
+/* Admin Menu: collapse button */
+#collapse-button {
+ color: #f3f2f1;
+}
+
+#collapse-button:hover,
+#collapse-button:focus {
+ color: #c7a589;
+}
+
+/* Admin Bar */
+#wpadminbar {
+ color: #fff;
+ background: #59524c;
+}
+
+#wpadminbar .ab-item,
+#wpadminbar a.ab-item,
+#wpadminbar > #wp-toolbar span.ab-label,
+#wpadminbar > #wp-toolbar span.noticon {
+ color: #fff;
+}
+
+#wpadminbar .ab-icon,
+#wpadminbar .ab-icon:before,
+#wpadminbar .ab-item:before,
+#wpadminbar .ab-item:after {
+ color: #f3f2f1;
+}
+
+#wpadminbar:not(.mobile) .ab-top-menu > li:hover > .ab-item,
+#wpadminbar:not(.mobile) .ab-top-menu > li > .ab-item:focus,
+#wpadminbar.nojq .quicklinks .ab-top-menu > li > .ab-item:focus,
+#wpadminbar.nojs .ab-top-menu > li.menupop:hover > .ab-item,
+#wpadminbar .ab-top-menu > li.menupop.hover > .ab-item {
+ color: #c7a589;
+ background: #46403c;
+}
+
+#wpadminbar:not(.mobile) > #wp-toolbar li:hover span.ab-label,
+#wpadminbar:not(.mobile) > #wp-toolbar li.hover span.ab-label,
+#wpadminbar:not(.mobile) > #wp-toolbar a:focus span.ab-label {
+ color: #c7a589;
+}
+
+#wpadminbar:not(.mobile) li:hover .ab-icon:before,
+#wpadminbar:not(.mobile) li:hover .ab-item:before,
+#wpadminbar:not(.mobile) li:hover .ab-item:after,
+#wpadminbar:not(.mobile) li:hover #adminbarsearch:before {
+ color: #fff;
+}
+
+/* Admin Bar: submenu */
+#wpadminbar .menupop .ab-sub-wrapper {
+ background: #46403c;
+}
+
+#wpadminbar .quicklinks .menupop ul.ab-sub-secondary,
+#wpadminbar .quicklinks .menupop ul.ab-sub-secondary .ab-submenu {
+ background: #656463;
+}
+
+#wpadminbar .ab-submenu .ab-item,
+#wpadminbar .quicklinks .menupop ul li a,
+#wpadminbar .quicklinks .menupop.hover ul li a,
+#wpadminbar.nojs .quicklinks .menupop:hover ul li a {
+ color: #cdcbc9;
+}
+
+#wpadminbar .quicklinks li .blavatar,
+#wpadminbar .menupop .menupop > .ab-item:before {
+ color: #f3f2f1;
+}
+
+#wpadminbar .quicklinks .menupop ul li a:hover,
+#wpadminbar .quicklinks .menupop ul li a:focus,
+#wpadminbar .quicklinks .menupop ul li a:hover strong,
+#wpadminbar .quicklinks .menupop ul li a:focus strong,
+#wpadminbar .quicklinks .ab-sub-wrapper .menupop.hover > a,
+#wpadminbar .quicklinks .menupop.hover ul li a:hover,
+#wpadminbar .quicklinks .menupop.hover ul li a:focus,
+#wpadminbar.nojs .quicklinks .menupop:hover ul li a:hover,
+#wpadminbar.nojs .quicklinks .menupop:hover ul li a:focus,
+#wpadminbar li:hover .ab-icon:before,
+#wpadminbar li:hover .ab-item:before,
+#wpadminbar li a:focus .ab-icon:before,
+#wpadminbar li .ab-item:focus:before,
+#wpadminbar li .ab-item:focus .ab-icon:before,
+#wpadminbar li.hover .ab-icon:before,
+#wpadminbar li.hover .ab-item:before,
+#wpadminbar li:hover #adminbarsearch:before,
+#wpadminbar li #adminbarsearch.adminbar-focused:before {
+ color: #c7a589;
+}
+
+#wpadminbar .quicklinks li a:hover .blavatar,
+#wpadminbar .quicklinks li a:focus .blavatar,
+#wpadminbar .quicklinks .ab-sub-wrapper .menupop.hover > a .blavatar,
+#wpadminbar .menupop .menupop > .ab-item:hover:before,
+#wpadminbar.mobile .quicklinks .ab-icon:before,
+#wpadminbar.mobile .quicklinks .ab-item:before {
+ color: #c7a589;
+}
+
+#wpadminbar.mobile .quicklinks .hover .ab-icon:before,
+#wpadminbar.mobile .quicklinks .hover .ab-item:before {
+ color: #f3f2f1;
+}
+
+/* Admin Bar: search */
+#wpadminbar #adminbarsearch:before {
+ color: #f3f2f1;
+}
+
+#wpadminbar > #wp-toolbar > #wp-admin-bar-top-secondary > #wp-admin-bar-search #adminbarsearch input.adminbar-input:focus {
+ color: #fff;
+ background: #6c645c;
+}
+
+/* Admin Bar: recovery mode */
+#wpadminbar #wp-admin-bar-recovery-mode {
+ color: #fff;
+ background-color: #9ea476;
+}
+
+#wpadminbar #wp-admin-bar-recovery-mode .ab-item,
+#wpadminbar #wp-admin-bar-recovery-mode a.ab-item {
+ color: #fff;
+}
+
+#wpadminbar .ab-top-menu > #wp-admin-bar-recovery-mode.hover > .ab-item,
+#wpadminbar.nojq .quicklinks .ab-top-menu > #wp-admin-bar-recovery-mode > .ab-item:focus,
+#wpadminbar:not(.mobile) .ab-top-menu > #wp-admin-bar-recovery-mode:hover > .ab-item,
+#wpadminbar:not(.mobile) .ab-top-menu > #wp-admin-bar-recovery-mode > .ab-item:focus {
+ color: #fff;
+ background-color: #8e946a;
+}
+
+/* Admin Bar: my account */
+#wpadminbar .quicklinks li#wp-admin-bar-my-account.with-avatar > a img {
+ border-color: #6c645c;
+ background-color: #6c645c;
+}
+
+#wpadminbar #wp-admin-bar-user-info .display-name {
+ color: #fff;
+}
+
+#wpadminbar #wp-admin-bar-user-info a:hover .display-name {
+ color: #c7a589;
+}
+
+#wpadminbar #wp-admin-bar-user-info .username {
+ color: #cdcbc9;
+}
+
+/* Pointers */
+.wp-pointer .wp-pointer-content h3 {
+ background-color: #c7a589;
+ border-color: #bf9878;
+}
+
+.wp-pointer .wp-pointer-content h3:before {
+ color: #c7a589;
+}
+
+.wp-pointer.wp-pointer-top .wp-pointer-arrow,
+.wp-pointer.wp-pointer-top .wp-pointer-arrow-inner,
+.wp-pointer.wp-pointer-undefined .wp-pointer-arrow,
+.wp-pointer.wp-pointer-undefined .wp-pointer-arrow-inner {
+ border-bottom-color: #c7a589;
+}
+
+/* Media */
+.media-item .bar,
+.media-progress-bar div {
+ background-color: #c7a589;
+}
+
+.details.attachment {
+ box-shadow: inset 0 0 0 3px #fff, inset 0 0 0 7px #c7a589;
+}
+
+.attachment.details .check {
+ background-color: #c7a589;
+ box-shadow: 0 0 0 1px #fff, 0 0 0 2px #c7a589;
+}
+
+.media-selection .attachment.selection.details .thumbnail {
+ box-shadow: 0 0 0 1px #fff, 0 0 0 3px #c7a589;
+}
+
+/* Themes */
+.theme-browser .theme.active .theme-name,
+.theme-browser .theme.add-new-theme a:hover:after,
+.theme-browser .theme.add-new-theme a:focus:after {
+ background: #c7a589;
+}
+
+.theme-browser .theme.add-new-theme a:hover span:after,
+.theme-browser .theme.add-new-theme a:focus span:after {
+ color: #c7a589;
+}
+
+.theme-section.current,
+.theme-filter.current {
+ border-bottom-color: #59524c;
+}
+
+body.more-filters-opened .more-filters {
+ color: #fff;
+ background-color: #59524c;
+}
+
+body.more-filters-opened .more-filters:before {
+ color: #fff;
+}
+
+body.more-filters-opened .more-filters:hover,
+body.more-filters-opened .more-filters:focus {
+ background-color: #c7a589;
+ color: #fff;
+}
+
+body.more-filters-opened .more-filters:hover:before,
+body.more-filters-opened .more-filters:focus:before {
+ color: #fff;
+}
+
+/* Widgets */
+.widgets-chooser li.widgets-chooser-selected {
+ background-color: #c7a589;
+ color: #fff;
+}
+
+.widgets-chooser li.widgets-chooser-selected:before,
+.widgets-chooser li.widgets-chooser-selected:focus:before {
+ color: #fff;
+}
+
+/* Responsive Component */
+div#wp-responsive-toggle a:before {
+ color: #f3f2f1;
+}
+
+.wp-responsive-open div#wp-responsive-toggle a {
+ border-color: transparent;
+ background: #c7a589;
+}
+
+.wp-responsive-open #wpadminbar #wp-admin-bar-menu-toggle a {
+ background: #46403c;
+}
+
+.wp-responsive-open #wpadminbar #wp-admin-bar-menu-toggle .ab-icon:before {
+ color: #f3f2f1;
+}
+
+/* TinyMCE */
+.mce-container.mce-menu .mce-menu-item:hover,
+.mce-container.mce-menu .mce-menu-item.mce-selected,
+.mce-container.mce-menu .mce-menu-item:focus,
+.mce-container.mce-menu .mce-menu-item-normal.mce-active,
+.mce-container.mce-menu .mce-menu-item-preview.mce-active {
+ background: #c7a589;
+}
diff --git a/www/crm/wp-admin/css/colors/coffee/colors-rtl.min.css b/www/crm/wp-admin/css/colors/coffee/colors-rtl.min.css
new file mode 100644
index 00000000..eb41fb4c
--- /dev/null
+++ b/www/crm/wp-admin/css/colors/coffee/colors-rtl.min.css
@@ -0,0 +1,2 @@
+/*! This file is auto-generated */
+body{background:#f1f1f1}a{color:#0073aa}a:active,a:focus,a:hover{color:#0096dd}#media-upload a.del-link:hover,.subsubsub a.current:hover,.subsubsub a:hover,div.dashboard-widget-submit input:hover{color:#0096dd}input[type=checkbox]:checked:before{color:#59524c}input[type=radio]:checked:before{background:#59524c}.wp-core-ui input[type=reset]:active,.wp-core-ui input[type=reset]:hover{color:#0096dd}.wp-core-ui .button-primary{background:#c7a589;border-color:#b78b66 #ae7d55 #ae7d55;color:#fff;box-shadow:0 1px 0 #ae7d55;text-shadow:0 -1px 1px #ae7d55,-1px 0 1px #ae7d55,0 1px 1px #ae7d55,1px 0 1px #ae7d55}.wp-core-ui .button-primary:focus,.wp-core-ui .button-primary:hover{background:#ccad93;border-color:#ae7d55;color:#fff;box-shadow:0 1px 0 #ae7d55}.wp-core-ui .button-primary:focus{box-shadow:inset 0 1px 0 #b78b66,0 0 2px 1px #33b3db}.wp-core-ui .button-primary.active,.wp-core-ui .button-primary.active:focus,.wp-core-ui .button-primary.active:hover,.wp-core-ui .button-primary:active{background:#b78b66;border-color:#ae7d55;box-shadow:inset 0 2px 0 #ae7d55}.wp-core-ui .button-primary.button-primary-disabled,.wp-core-ui .button-primary.disabled,.wp-core-ui .button-primary:disabled,.wp-core-ui .button-primary[disabled]{color:#d1ccc7!important;background:#ba906d!important;border-color:#ae7d55!important;text-shadow:none!important}.wp-core-ui .button-primary.button-hero{box-shadow:0 2px 0 #ae7d55!important}.wp-core-ui .button-primary.button-hero:active{box-shadow:inset 0 3px 0 #ae7d55!important}.wp-core-ui .wp-ui-primary{color:#fff;background-color:#59524c}.wp-core-ui .wp-ui-text-primary{color:#59524c}.wp-core-ui .wp-ui-highlight{color:#fff;background-color:#c7a589}.wp-core-ui .wp-ui-text-highlight{color:#c7a589}.wp-core-ui .wp-ui-notification{color:#fff;background-color:#9ea476}.wp-core-ui .wp-ui-text-notification{color:#9ea476}.wp-core-ui .wp-ui-text-icon{color:#f3f2f1}.wrap .add-new-h2:hover,.wrap .page-title-action:hover{color:#fff;background-color:#59524c}.view-switch a.current:before{color:#59524c}.view-switch a:hover:before{color:#9ea476}#adminmenu,#adminmenuback,#adminmenuwrap{background:#59524c}#adminmenu a{color:#fff}#adminmenu div.wp-menu-image:before{color:#f3f2f1}#adminmenu a:hover,#adminmenu li.menu-top:hover,#adminmenu li.opensub>a.menu-top,#adminmenu li>a.menu-top:focus{color:#fff;background-color:#c7a589}#adminmenu li.menu-top:hover div.wp-menu-image:before,#adminmenu li.opensub>a.menu-top div.wp-menu-image:before{color:#fff}.about-wrap .nav-tab-active,.nav-tab-active,.nav-tab-active:hover{background-color:#f1f1f1;border-bottom-color:#f1f1f1}#adminmenu .wp-has-current-submenu .wp-submenu,#adminmenu .wp-has-current-submenu.opensub .wp-submenu,#adminmenu .wp-submenu,#adminmenu a.wp-has-current-submenu:focus+.wp-submenu,.folded #adminmenu .wp-has-current-submenu .wp-submenu{background:#46403c}#adminmenu li.wp-has-submenu.wp-not-current-submenu.opensub:hover:after{border-left-color:#46403c}#adminmenu .wp-submenu .wp-submenu-head{color:#cdcbc9}#adminmenu .wp-has-current-submenu .wp-submenu a,#adminmenu .wp-has-current-submenu.opensub .wp-submenu a,#adminmenu .wp-submenu a,#adminmenu a.wp-has-current-submenu:focus+.wp-submenu a,.folded #adminmenu .wp-has-current-submenu .wp-submenu a{color:#cdcbc9}#adminmenu .wp-has-current-submenu .wp-submenu a:focus,#adminmenu .wp-has-current-submenu .wp-submenu a:hover,#adminmenu .wp-has-current-submenu.opensub .wp-submenu a:focus,#adminmenu .wp-has-current-submenu.opensub .wp-submenu a:hover,#adminmenu .wp-submenu a:focus,#adminmenu .wp-submenu a:hover,#adminmenu a.wp-has-current-submenu:focus+.wp-submenu a:focus,#adminmenu a.wp-has-current-submenu:focus+.wp-submenu a:hover,.folded #adminmenu .wp-has-current-submenu .wp-submenu a:focus,.folded #adminmenu .wp-has-current-submenu .wp-submenu a:hover{color:#c7a589}#adminmenu .wp-has-current-submenu.opensub .wp-submenu li.current a,#adminmenu .wp-submenu li.current a,#adminmenu a.wp-has-current-submenu:focus+.wp-submenu li.current a{color:#fff}#adminmenu .wp-has-current-submenu.opensub .wp-submenu li.current a:focus,#adminmenu .wp-has-current-submenu.opensub .wp-submenu li.current a:hover,#adminmenu .wp-submenu li.current a:focus,#adminmenu .wp-submenu li.current a:hover,#adminmenu a.wp-has-current-submenu:focus+.wp-submenu li.current a:focus,#adminmenu a.wp-has-current-submenu:focus+.wp-submenu li.current a:hover{color:#c7a589}ul#adminmenu a.wp-has-current-submenu:after,ul#adminmenu>li.current>a.current:after{border-left-color:#f1f1f1}#adminmenu li.current a.menu-top,#adminmenu li.wp-has-current-submenu .wp-submenu .wp-submenu-head,#adminmenu li.wp-has-current-submenu a.wp-has-current-submenu,.folded #adminmenu li.current.menu-top{color:#fff;background:#c7a589}#adminmenu a.current:hover div.wp-menu-image:before,#adminmenu li a:focus div.wp-menu-image:before,#adminmenu li.opensub div.wp-menu-image:before,#adminmenu li.wp-has-current-submenu a:focus div.wp-menu-image:before,#adminmenu li.wp-has-current-submenu div.wp-menu-image:before,#adminmenu li.wp-has-current-submenu.opensub div.wp-menu-image:before,#adminmenu li:hover div.wp-menu-image:before,.ie8 #adminmenu li.opensub div.wp-menu-image:before{color:#fff}#adminmenu .awaiting-mod,#adminmenu .update-plugins{color:#fff;background:#9ea476}#adminmenu li a.wp-has-current-submenu .update-plugins,#adminmenu li.current a .awaiting-mod,#adminmenu li.menu-top:hover>a .update-plugins,#adminmenu li:hover a .awaiting-mod{color:#fff;background:#46403c}#collapse-button{color:#f3f2f1}#collapse-button:focus,#collapse-button:hover{color:#c7a589}#wpadminbar{color:#fff;background:#59524c}#wpadminbar .ab-item,#wpadminbar a.ab-item,#wpadminbar>#wp-toolbar span.ab-label,#wpadminbar>#wp-toolbar span.noticon{color:#fff}#wpadminbar .ab-icon,#wpadminbar .ab-icon:before,#wpadminbar .ab-item:after,#wpadminbar .ab-item:before{color:#f3f2f1}#wpadminbar .ab-top-menu>li.menupop.hover>.ab-item,#wpadminbar.nojq .quicklinks .ab-top-menu>li>.ab-item:focus,#wpadminbar.nojs .ab-top-menu>li.menupop:hover>.ab-item,#wpadminbar:not(.mobile) .ab-top-menu>li:hover>.ab-item,#wpadminbar:not(.mobile) .ab-top-menu>li>.ab-item:focus{color:#c7a589;background:#46403c}#wpadminbar:not(.mobile)>#wp-toolbar a:focus span.ab-label,#wpadminbar:not(.mobile)>#wp-toolbar li.hover span.ab-label,#wpadminbar:not(.mobile)>#wp-toolbar li:hover span.ab-label{color:#c7a589}#wpadminbar:not(.mobile) li:hover #adminbarsearch:before,#wpadminbar:not(.mobile) li:hover .ab-icon:before,#wpadminbar:not(.mobile) li:hover .ab-item:after,#wpadminbar:not(.mobile) li:hover .ab-item:before{color:#fff}#wpadminbar .menupop .ab-sub-wrapper{background:#46403c}#wpadminbar .quicklinks .menupop ul.ab-sub-secondary,#wpadminbar .quicklinks .menupop ul.ab-sub-secondary .ab-submenu{background:#656463}#wpadminbar .ab-submenu .ab-item,#wpadminbar .quicklinks .menupop ul li a,#wpadminbar .quicklinks .menupop.hover ul li a,#wpadminbar.nojs .quicklinks .menupop:hover ul li a{color:#cdcbc9}#wpadminbar .menupop .menupop>.ab-item:before,#wpadminbar .quicklinks li .blavatar{color:#f3f2f1}#wpadminbar .quicklinks .ab-sub-wrapper .menupop.hover>a,#wpadminbar .quicklinks .menupop ul li a:focus,#wpadminbar .quicklinks .menupop ul li a:focus strong,#wpadminbar .quicklinks .menupop ul li a:hover,#wpadminbar .quicklinks .menupop ul li a:hover strong,#wpadminbar .quicklinks .menupop.hover ul li a:focus,#wpadminbar .quicklinks .menupop.hover ul li a:hover,#wpadminbar li #adminbarsearch.adminbar-focused:before,#wpadminbar li .ab-item:focus .ab-icon:before,#wpadminbar li .ab-item:focus:before,#wpadminbar li a:focus .ab-icon:before,#wpadminbar li.hover .ab-icon:before,#wpadminbar li.hover .ab-item:before,#wpadminbar li:hover #adminbarsearch:before,#wpadminbar li:hover .ab-icon:before,#wpadminbar li:hover .ab-item:before,#wpadminbar.nojs .quicklinks .menupop:hover ul li a:focus,#wpadminbar.nojs .quicklinks .menupop:hover ul li a:hover{color:#c7a589}#wpadminbar .menupop .menupop>.ab-item:hover:before,#wpadminbar .quicklinks .ab-sub-wrapper .menupop.hover>a .blavatar,#wpadminbar .quicklinks li a:focus .blavatar,#wpadminbar .quicklinks li a:hover .blavatar,#wpadminbar.mobile .quicklinks .ab-icon:before,#wpadminbar.mobile .quicklinks .ab-item:before{color:#c7a589}#wpadminbar.mobile .quicklinks .hover .ab-icon:before,#wpadminbar.mobile .quicklinks .hover .ab-item:before{color:#f3f2f1}#wpadminbar #adminbarsearch:before{color:#f3f2f1}#wpadminbar>#wp-toolbar>#wp-admin-bar-top-secondary>#wp-admin-bar-search #adminbarsearch input.adminbar-input:focus{color:#fff;background:#6c645c}#wpadminbar #wp-admin-bar-recovery-mode{color:#fff;background-color:#9ea476}#wpadminbar #wp-admin-bar-recovery-mode .ab-item,#wpadminbar #wp-admin-bar-recovery-mode a.ab-item{color:#fff}#wpadminbar .ab-top-menu>#wp-admin-bar-recovery-mode.hover>.ab-item,#wpadminbar.nojq .quicklinks .ab-top-menu>#wp-admin-bar-recovery-mode>.ab-item:focus,#wpadminbar:not(.mobile) .ab-top-menu>#wp-admin-bar-recovery-mode:hover>.ab-item,#wpadminbar:not(.mobile) .ab-top-menu>#wp-admin-bar-recovery-mode>.ab-item:focus{color:#fff;background-color:#8e946a}#wpadminbar .quicklinks li#wp-admin-bar-my-account.with-avatar>a img{border-color:#6c645c;background-color:#6c645c}#wpadminbar #wp-admin-bar-user-info .display-name{color:#fff}#wpadminbar #wp-admin-bar-user-info a:hover .display-name{color:#c7a589}#wpadminbar #wp-admin-bar-user-info .username{color:#cdcbc9}.wp-pointer .wp-pointer-content h3{background-color:#c7a589;border-color:#bf9878}.wp-pointer .wp-pointer-content h3:before{color:#c7a589}.wp-pointer.wp-pointer-top .wp-pointer-arrow,.wp-pointer.wp-pointer-top .wp-pointer-arrow-inner,.wp-pointer.wp-pointer-undefined .wp-pointer-arrow,.wp-pointer.wp-pointer-undefined .wp-pointer-arrow-inner{border-bottom-color:#c7a589}.media-item .bar,.media-progress-bar div{background-color:#c7a589}.details.attachment{box-shadow:inset 0 0 0 3px #fff,inset 0 0 0 7px #c7a589}.attachment.details .check{background-color:#c7a589;box-shadow:0 0 0 1px #fff,0 0 0 2px #c7a589}.media-selection .attachment.selection.details .thumbnail{box-shadow:0 0 0 1px #fff,0 0 0 3px #c7a589}.theme-browser .theme.active .theme-name,.theme-browser .theme.add-new-theme a:focus:after,.theme-browser .theme.add-new-theme a:hover:after{background:#c7a589}.theme-browser .theme.add-new-theme a:focus span:after,.theme-browser .theme.add-new-theme a:hover span:after{color:#c7a589}.theme-filter.current,.theme-section.current{border-bottom-color:#59524c}body.more-filters-opened .more-filters{color:#fff;background-color:#59524c}body.more-filters-opened .more-filters:before{color:#fff}body.more-filters-opened .more-filters:focus,body.more-filters-opened .more-filters:hover{background-color:#c7a589;color:#fff}body.more-filters-opened .more-filters:focus:before,body.more-filters-opened .more-filters:hover:before{color:#fff}.widgets-chooser li.widgets-chooser-selected{background-color:#c7a589;color:#fff}.widgets-chooser li.widgets-chooser-selected:before,.widgets-chooser li.widgets-chooser-selected:focus:before{color:#fff}div#wp-responsive-toggle a:before{color:#f3f2f1}.wp-responsive-open div#wp-responsive-toggle a{border-color:transparent;background:#c7a589}.wp-responsive-open #wpadminbar #wp-admin-bar-menu-toggle a{background:#46403c}.wp-responsive-open #wpadminbar #wp-admin-bar-menu-toggle .ab-icon:before{color:#f3f2f1}.mce-container.mce-menu .mce-menu-item-normal.mce-active,.mce-container.mce-menu .mce-menu-item-preview.mce-active,.mce-container.mce-menu .mce-menu-item.mce-selected,.mce-container.mce-menu .mce-menu-item:focus,.mce-container.mce-menu .mce-menu-item:hover{background:#c7a589} \ No newline at end of file
diff --git a/www/crm/wp-admin/css/colors/coffee/colors.css b/www/crm/wp-admin/css/colors/coffee/colors.css
new file mode 100644
index 00000000..34f58810
--- /dev/null
+++ b/www/crm/wp-admin/css/colors/coffee/colors.css
@@ -0,0 +1,519 @@
+/*! This file is auto-generated */
+/*
+ * Button mixin- creates 3d-ish button effect with correct
+ * highlights/shadows, based on a base color.
+ */
+body {
+ background: #f1f1f1;
+}
+
+/* Links */
+a {
+ color: #0073aa;
+}
+
+a:hover, a:active, a:focus {
+ color: #0096dd;
+}
+
+#media-upload a.del-link:hover,
+div.dashboard-widget-submit input:hover,
+.subsubsub a:hover,
+.subsubsub a.current:hover {
+ color: #0096dd;
+}
+
+/* Forms */
+input[type=checkbox]:checked:before {
+ color: #59524c;
+}
+
+input[type=radio]:checked:before {
+ background: #59524c;
+}
+
+.wp-core-ui input[type="reset"]:hover,
+.wp-core-ui input[type="reset"]:active {
+ color: #0096dd;
+}
+
+/* Core UI */
+.wp-core-ui .button-primary {
+ background: #c7a589;
+ border-color: #b78b66 #ae7d55 #ae7d55;
+ color: #fff;
+ box-shadow: 0 1px 0 #ae7d55;
+ text-shadow: 0 -1px 1px #ae7d55, 1px 0 1px #ae7d55, 0 1px 1px #ae7d55, -1px 0 1px #ae7d55;
+}
+
+.wp-core-ui .button-primary:hover, .wp-core-ui .button-primary:focus {
+ background: #ccad93;
+ border-color: #ae7d55;
+ color: #fff;
+ box-shadow: 0 1px 0 #ae7d55;
+}
+
+.wp-core-ui .button-primary:focus {
+ box-shadow: inset 0 1px 0 #b78b66, 0 0 2px 1px #33b3db;
+}
+
+.wp-core-ui .button-primary:active, .wp-core-ui .button-primary.active, .wp-core-ui .button-primary.active:focus, .wp-core-ui .button-primary.active:hover {
+ background: #b78b66;
+ border-color: #ae7d55;
+ box-shadow: inset 0 2px 0 #ae7d55;
+}
+
+.wp-core-ui .button-primary[disabled], .wp-core-ui .button-primary:disabled, .wp-core-ui .button-primary.button-primary-disabled, .wp-core-ui .button-primary.disabled {
+ color: #d1ccc7 !important;
+ background: #ba906d !important;
+ border-color: #ae7d55 !important;
+ text-shadow: none !important;
+}
+
+.wp-core-ui .button-primary.button-hero {
+ box-shadow: 0 2px 0 #ae7d55 !important;
+}
+
+.wp-core-ui .button-primary.button-hero:active {
+ box-shadow: inset 0 3px 0 #ae7d55 !important;
+}
+
+.wp-core-ui .wp-ui-primary {
+ color: #fff;
+ background-color: #59524c;
+}
+
+.wp-core-ui .wp-ui-text-primary {
+ color: #59524c;
+}
+
+.wp-core-ui .wp-ui-highlight {
+ color: #fff;
+ background-color: #c7a589;
+}
+
+.wp-core-ui .wp-ui-text-highlight {
+ color: #c7a589;
+}
+
+.wp-core-ui .wp-ui-notification {
+ color: #fff;
+ background-color: #9ea476;
+}
+
+.wp-core-ui .wp-ui-text-notification {
+ color: #9ea476;
+}
+
+.wp-core-ui .wp-ui-text-icon {
+ color: #f3f2f1;
+}
+
+/* List tables */
+.wrap .add-new-h2:hover,
+.wrap .page-title-action:hover {
+ color: #fff;
+ background-color: #59524c;
+}
+
+.view-switch a.current:before {
+ color: #59524c;
+}
+
+.view-switch a:hover:before {
+ color: #9ea476;
+}
+
+/* Admin Menu */
+#adminmenuback,
+#adminmenuwrap,
+#adminmenu {
+ background: #59524c;
+}
+
+#adminmenu a {
+ color: #fff;
+}
+
+#adminmenu div.wp-menu-image:before {
+ color: #f3f2f1;
+}
+
+#adminmenu a:hover,
+#adminmenu li.menu-top:hover,
+#adminmenu li.opensub > a.menu-top,
+#adminmenu li > a.menu-top:focus {
+ color: #fff;
+ background-color: #c7a589;
+}
+
+#adminmenu li.menu-top:hover div.wp-menu-image:before,
+#adminmenu li.opensub > a.menu-top div.wp-menu-image:before {
+ color: #fff;
+}
+
+/* Active tabs use a bottom border color that matches the page background color. */
+.about-wrap .nav-tab-active,
+.nav-tab-active,
+.nav-tab-active:hover {
+ background-color: #f1f1f1;
+ border-bottom-color: #f1f1f1;
+}
+
+/* Admin Menu: submenu */
+#adminmenu .wp-submenu,
+#adminmenu .wp-has-current-submenu .wp-submenu,
+#adminmenu .wp-has-current-submenu.opensub .wp-submenu,
+.folded #adminmenu .wp-has-current-submenu .wp-submenu,
+#adminmenu a.wp-has-current-submenu:focus + .wp-submenu {
+ background: #46403c;
+}
+
+#adminmenu li.wp-has-submenu.wp-not-current-submenu.opensub:hover:after {
+ border-right-color: #46403c;
+}
+
+#adminmenu .wp-submenu .wp-submenu-head {
+ color: #cdcbc9;
+}
+
+#adminmenu .wp-submenu a,
+#adminmenu .wp-has-current-submenu .wp-submenu a,
+.folded #adminmenu .wp-has-current-submenu .wp-submenu a,
+#adminmenu a.wp-has-current-submenu:focus + .wp-submenu a,
+#adminmenu .wp-has-current-submenu.opensub .wp-submenu a {
+ color: #cdcbc9;
+}
+
+#adminmenu .wp-submenu a:focus, #adminmenu .wp-submenu a:hover,
+#adminmenu .wp-has-current-submenu .wp-submenu a:focus,
+#adminmenu .wp-has-current-submenu .wp-submenu a:hover,
+.folded #adminmenu .wp-has-current-submenu .wp-submenu a:focus,
+.folded #adminmenu .wp-has-current-submenu .wp-submenu a:hover,
+#adminmenu a.wp-has-current-submenu:focus + .wp-submenu a:focus,
+#adminmenu a.wp-has-current-submenu:focus + .wp-submenu a:hover,
+#adminmenu .wp-has-current-submenu.opensub .wp-submenu a:focus,
+#adminmenu .wp-has-current-submenu.opensub .wp-submenu a:hover {
+ color: #c7a589;
+}
+
+/* Admin Menu: current */
+#adminmenu .wp-submenu li.current a,
+#adminmenu a.wp-has-current-submenu:focus + .wp-submenu li.current a,
+#adminmenu .wp-has-current-submenu.opensub .wp-submenu li.current a {
+ color: #fff;
+}
+
+#adminmenu .wp-submenu li.current a:hover, #adminmenu .wp-submenu li.current a:focus,
+#adminmenu a.wp-has-current-submenu:focus + .wp-submenu li.current a:hover,
+#adminmenu a.wp-has-current-submenu:focus + .wp-submenu li.current a:focus,
+#adminmenu .wp-has-current-submenu.opensub .wp-submenu li.current a:hover,
+#adminmenu .wp-has-current-submenu.opensub .wp-submenu li.current a:focus {
+ color: #c7a589;
+}
+
+ul#adminmenu a.wp-has-current-submenu:after,
+ul#adminmenu > li.current > a.current:after {
+ border-right-color: #f1f1f1;
+}
+
+#adminmenu li.current a.menu-top,
+#adminmenu li.wp-has-current-submenu a.wp-has-current-submenu,
+#adminmenu li.wp-has-current-submenu .wp-submenu .wp-submenu-head,
+.folded #adminmenu li.current.menu-top {
+ color: #fff;
+ background: #c7a589;
+}
+
+#adminmenu li.wp-has-current-submenu div.wp-menu-image:before,
+#adminmenu a.current:hover div.wp-menu-image:before,
+#adminmenu li.wp-has-current-submenu a:focus div.wp-menu-image:before,
+#adminmenu li.wp-has-current-submenu.opensub div.wp-menu-image:before,
+#adminmenu li:hover div.wp-menu-image:before,
+#adminmenu li a:focus div.wp-menu-image:before,
+#adminmenu li.opensub div.wp-menu-image:before,
+.ie8 #adminmenu li.opensub div.wp-menu-image:before {
+ color: #fff;
+}
+
+/* Admin Menu: bubble */
+#adminmenu .awaiting-mod,
+#adminmenu .update-plugins {
+ color: #fff;
+ background: #9ea476;
+}
+
+#adminmenu li.current a .awaiting-mod,
+#adminmenu li a.wp-has-current-submenu .update-plugins,
+#adminmenu li:hover a .awaiting-mod,
+#adminmenu li.menu-top:hover > a .update-plugins {
+ color: #fff;
+ background: #46403c;
+}
+
+/* Admin Menu: collapse button */
+#collapse-button {
+ color: #f3f2f1;
+}
+
+#collapse-button:hover,
+#collapse-button:focus {
+ color: #c7a589;
+}
+
+/* Admin Bar */
+#wpadminbar {
+ color: #fff;
+ background: #59524c;
+}
+
+#wpadminbar .ab-item,
+#wpadminbar a.ab-item,
+#wpadminbar > #wp-toolbar span.ab-label,
+#wpadminbar > #wp-toolbar span.noticon {
+ color: #fff;
+}
+
+#wpadminbar .ab-icon,
+#wpadminbar .ab-icon:before,
+#wpadminbar .ab-item:before,
+#wpadminbar .ab-item:after {
+ color: #f3f2f1;
+}
+
+#wpadminbar:not(.mobile) .ab-top-menu > li:hover > .ab-item,
+#wpadminbar:not(.mobile) .ab-top-menu > li > .ab-item:focus,
+#wpadminbar.nojq .quicklinks .ab-top-menu > li > .ab-item:focus,
+#wpadminbar.nojs .ab-top-menu > li.menupop:hover > .ab-item,
+#wpadminbar .ab-top-menu > li.menupop.hover > .ab-item {
+ color: #c7a589;
+ background: #46403c;
+}
+
+#wpadminbar:not(.mobile) > #wp-toolbar li:hover span.ab-label,
+#wpadminbar:not(.mobile) > #wp-toolbar li.hover span.ab-label,
+#wpadminbar:not(.mobile) > #wp-toolbar a:focus span.ab-label {
+ color: #c7a589;
+}
+
+#wpadminbar:not(.mobile) li:hover .ab-icon:before,
+#wpadminbar:not(.mobile) li:hover .ab-item:before,
+#wpadminbar:not(.mobile) li:hover .ab-item:after,
+#wpadminbar:not(.mobile) li:hover #adminbarsearch:before {
+ color: #fff;
+}
+
+/* Admin Bar: submenu */
+#wpadminbar .menupop .ab-sub-wrapper {
+ background: #46403c;
+}
+
+#wpadminbar .quicklinks .menupop ul.ab-sub-secondary,
+#wpadminbar .quicklinks .menupop ul.ab-sub-secondary .ab-submenu {
+ background: #656463;
+}
+
+#wpadminbar .ab-submenu .ab-item,
+#wpadminbar .quicklinks .menupop ul li a,
+#wpadminbar .quicklinks .menupop.hover ul li a,
+#wpadminbar.nojs .quicklinks .menupop:hover ul li a {
+ color: #cdcbc9;
+}
+
+#wpadminbar .quicklinks li .blavatar,
+#wpadminbar .menupop .menupop > .ab-item:before {
+ color: #f3f2f1;
+}
+
+#wpadminbar .quicklinks .menupop ul li a:hover,
+#wpadminbar .quicklinks .menupop ul li a:focus,
+#wpadminbar .quicklinks .menupop ul li a:hover strong,
+#wpadminbar .quicklinks .menupop ul li a:focus strong,
+#wpadminbar .quicklinks .ab-sub-wrapper .menupop.hover > a,
+#wpadminbar .quicklinks .menupop.hover ul li a:hover,
+#wpadminbar .quicklinks .menupop.hover ul li a:focus,
+#wpadminbar.nojs .quicklinks .menupop:hover ul li a:hover,
+#wpadminbar.nojs .quicklinks .menupop:hover ul li a:focus,
+#wpadminbar li:hover .ab-icon:before,
+#wpadminbar li:hover .ab-item:before,
+#wpadminbar li a:focus .ab-icon:before,
+#wpadminbar li .ab-item:focus:before,
+#wpadminbar li .ab-item:focus .ab-icon:before,
+#wpadminbar li.hover .ab-icon:before,
+#wpadminbar li.hover .ab-item:before,
+#wpadminbar li:hover #adminbarsearch:before,
+#wpadminbar li #adminbarsearch.adminbar-focused:before {
+ color: #c7a589;
+}
+
+#wpadminbar .quicklinks li a:hover .blavatar,
+#wpadminbar .quicklinks li a:focus .blavatar,
+#wpadminbar .quicklinks .ab-sub-wrapper .menupop.hover > a .blavatar,
+#wpadminbar .menupop .menupop > .ab-item:hover:before,
+#wpadminbar.mobile .quicklinks .ab-icon:before,
+#wpadminbar.mobile .quicklinks .ab-item:before {
+ color: #c7a589;
+}
+
+#wpadminbar.mobile .quicklinks .hover .ab-icon:before,
+#wpadminbar.mobile .quicklinks .hover .ab-item:before {
+ color: #f3f2f1;
+}
+
+/* Admin Bar: search */
+#wpadminbar #adminbarsearch:before {
+ color: #f3f2f1;
+}
+
+#wpadminbar > #wp-toolbar > #wp-admin-bar-top-secondary > #wp-admin-bar-search #adminbarsearch input.adminbar-input:focus {
+ color: #fff;
+ background: #6c645c;
+}
+
+/* Admin Bar: recovery mode */
+#wpadminbar #wp-admin-bar-recovery-mode {
+ color: #fff;
+ background-color: #9ea476;
+}
+
+#wpadminbar #wp-admin-bar-recovery-mode .ab-item,
+#wpadminbar #wp-admin-bar-recovery-mode a.ab-item {
+ color: #fff;
+}
+
+#wpadminbar .ab-top-menu > #wp-admin-bar-recovery-mode.hover > .ab-item,
+#wpadminbar.nojq .quicklinks .ab-top-menu > #wp-admin-bar-recovery-mode > .ab-item:focus,
+#wpadminbar:not(.mobile) .ab-top-menu > #wp-admin-bar-recovery-mode:hover > .ab-item,
+#wpadminbar:not(.mobile) .ab-top-menu > #wp-admin-bar-recovery-mode > .ab-item:focus {
+ color: #fff;
+ background-color: #8e946a;
+}
+
+/* Admin Bar: my account */
+#wpadminbar .quicklinks li#wp-admin-bar-my-account.with-avatar > a img {
+ border-color: #6c645c;
+ background-color: #6c645c;
+}
+
+#wpadminbar #wp-admin-bar-user-info .display-name {
+ color: #fff;
+}
+
+#wpadminbar #wp-admin-bar-user-info a:hover .display-name {
+ color: #c7a589;
+}
+
+#wpadminbar #wp-admin-bar-user-info .username {
+ color: #cdcbc9;
+}
+
+/* Pointers */
+.wp-pointer .wp-pointer-content h3 {
+ background-color: #c7a589;
+ border-color: #bf9878;
+}
+
+.wp-pointer .wp-pointer-content h3:before {
+ color: #c7a589;
+}
+
+.wp-pointer.wp-pointer-top .wp-pointer-arrow,
+.wp-pointer.wp-pointer-top .wp-pointer-arrow-inner,
+.wp-pointer.wp-pointer-undefined .wp-pointer-arrow,
+.wp-pointer.wp-pointer-undefined .wp-pointer-arrow-inner {
+ border-bottom-color: #c7a589;
+}
+
+/* Media */
+.media-item .bar,
+.media-progress-bar div {
+ background-color: #c7a589;
+}
+
+.details.attachment {
+ box-shadow: inset 0 0 0 3px #fff, inset 0 0 0 7px #c7a589;
+}
+
+.attachment.details .check {
+ background-color: #c7a589;
+ box-shadow: 0 0 0 1px #fff, 0 0 0 2px #c7a589;
+}
+
+.media-selection .attachment.selection.details .thumbnail {
+ box-shadow: 0 0 0 1px #fff, 0 0 0 3px #c7a589;
+}
+
+/* Themes */
+.theme-browser .theme.active .theme-name,
+.theme-browser .theme.add-new-theme a:hover:after,
+.theme-browser .theme.add-new-theme a:focus:after {
+ background: #c7a589;
+}
+
+.theme-browser .theme.add-new-theme a:hover span:after,
+.theme-browser .theme.add-new-theme a:focus span:after {
+ color: #c7a589;
+}
+
+.theme-section.current,
+.theme-filter.current {
+ border-bottom-color: #59524c;
+}
+
+body.more-filters-opened .more-filters {
+ color: #fff;
+ background-color: #59524c;
+}
+
+body.more-filters-opened .more-filters:before {
+ color: #fff;
+}
+
+body.more-filters-opened .more-filters:hover,
+body.more-filters-opened .more-filters:focus {
+ background-color: #c7a589;
+ color: #fff;
+}
+
+body.more-filters-opened .more-filters:hover:before,
+body.more-filters-opened .more-filters:focus:before {
+ color: #fff;
+}
+
+/* Widgets */
+.widgets-chooser li.widgets-chooser-selected {
+ background-color: #c7a589;
+ color: #fff;
+}
+
+.widgets-chooser li.widgets-chooser-selected:before,
+.widgets-chooser li.widgets-chooser-selected:focus:before {
+ color: #fff;
+}
+
+/* Responsive Component */
+div#wp-responsive-toggle a:before {
+ color: #f3f2f1;
+}
+
+.wp-responsive-open div#wp-responsive-toggle a {
+ border-color: transparent;
+ background: #c7a589;
+}
+
+.wp-responsive-open #wpadminbar #wp-admin-bar-menu-toggle a {
+ background: #46403c;
+}
+
+.wp-responsive-open #wpadminbar #wp-admin-bar-menu-toggle .ab-icon:before {
+ color: #f3f2f1;
+}
+
+/* TinyMCE */
+.mce-container.mce-menu .mce-menu-item:hover,
+.mce-container.mce-menu .mce-menu-item.mce-selected,
+.mce-container.mce-menu .mce-menu-item:focus,
+.mce-container.mce-menu .mce-menu-item-normal.mce-active,
+.mce-container.mce-menu .mce-menu-item-preview.mce-active {
+ background: #c7a589;
+}
diff --git a/www/crm/wp-admin/css/colors/coffee/colors.min.css b/www/crm/wp-admin/css/colors/coffee/colors.min.css
new file mode 100644
index 00000000..c1df5885
--- /dev/null
+++ b/www/crm/wp-admin/css/colors/coffee/colors.min.css
@@ -0,0 +1,2 @@
+/*! This file is auto-generated */
+body{background:#f1f1f1}a{color:#0073aa}a:active,a:focus,a:hover{color:#0096dd}#media-upload a.del-link:hover,.subsubsub a.current:hover,.subsubsub a:hover,div.dashboard-widget-submit input:hover{color:#0096dd}input[type=checkbox]:checked:before{color:#59524c}input[type=radio]:checked:before{background:#59524c}.wp-core-ui input[type=reset]:active,.wp-core-ui input[type=reset]:hover{color:#0096dd}.wp-core-ui .button-primary{background:#c7a589;border-color:#b78b66 #ae7d55 #ae7d55;color:#fff;box-shadow:0 1px 0 #ae7d55;text-shadow:0 -1px 1px #ae7d55,1px 0 1px #ae7d55,0 1px 1px #ae7d55,-1px 0 1px #ae7d55}.wp-core-ui .button-primary:focus,.wp-core-ui .button-primary:hover{background:#ccad93;border-color:#ae7d55;color:#fff;box-shadow:0 1px 0 #ae7d55}.wp-core-ui .button-primary:focus{box-shadow:inset 0 1px 0 #b78b66,0 0 2px 1px #33b3db}.wp-core-ui .button-primary.active,.wp-core-ui .button-primary.active:focus,.wp-core-ui .button-primary.active:hover,.wp-core-ui .button-primary:active{background:#b78b66;border-color:#ae7d55;box-shadow:inset 0 2px 0 #ae7d55}.wp-core-ui .button-primary.button-primary-disabled,.wp-core-ui .button-primary.disabled,.wp-core-ui .button-primary:disabled,.wp-core-ui .button-primary[disabled]{color:#d1ccc7!important;background:#ba906d!important;border-color:#ae7d55!important;text-shadow:none!important}.wp-core-ui .button-primary.button-hero{box-shadow:0 2px 0 #ae7d55!important}.wp-core-ui .button-primary.button-hero:active{box-shadow:inset 0 3px 0 #ae7d55!important}.wp-core-ui .wp-ui-primary{color:#fff;background-color:#59524c}.wp-core-ui .wp-ui-text-primary{color:#59524c}.wp-core-ui .wp-ui-highlight{color:#fff;background-color:#c7a589}.wp-core-ui .wp-ui-text-highlight{color:#c7a589}.wp-core-ui .wp-ui-notification{color:#fff;background-color:#9ea476}.wp-core-ui .wp-ui-text-notification{color:#9ea476}.wp-core-ui .wp-ui-text-icon{color:#f3f2f1}.wrap .add-new-h2:hover,.wrap .page-title-action:hover{color:#fff;background-color:#59524c}.view-switch a.current:before{color:#59524c}.view-switch a:hover:before{color:#9ea476}#adminmenu,#adminmenuback,#adminmenuwrap{background:#59524c}#adminmenu a{color:#fff}#adminmenu div.wp-menu-image:before{color:#f3f2f1}#adminmenu a:hover,#adminmenu li.menu-top:hover,#adminmenu li.opensub>a.menu-top,#adminmenu li>a.menu-top:focus{color:#fff;background-color:#c7a589}#adminmenu li.menu-top:hover div.wp-menu-image:before,#adminmenu li.opensub>a.menu-top div.wp-menu-image:before{color:#fff}.about-wrap .nav-tab-active,.nav-tab-active,.nav-tab-active:hover{background-color:#f1f1f1;border-bottom-color:#f1f1f1}#adminmenu .wp-has-current-submenu .wp-submenu,#adminmenu .wp-has-current-submenu.opensub .wp-submenu,#adminmenu .wp-submenu,#adminmenu a.wp-has-current-submenu:focus+.wp-submenu,.folded #adminmenu .wp-has-current-submenu .wp-submenu{background:#46403c}#adminmenu li.wp-has-submenu.wp-not-current-submenu.opensub:hover:after{border-right-color:#46403c}#adminmenu .wp-submenu .wp-submenu-head{color:#cdcbc9}#adminmenu .wp-has-current-submenu .wp-submenu a,#adminmenu .wp-has-current-submenu.opensub .wp-submenu a,#adminmenu .wp-submenu a,#adminmenu a.wp-has-current-submenu:focus+.wp-submenu a,.folded #adminmenu .wp-has-current-submenu .wp-submenu a{color:#cdcbc9}#adminmenu .wp-has-current-submenu .wp-submenu a:focus,#adminmenu .wp-has-current-submenu .wp-submenu a:hover,#adminmenu .wp-has-current-submenu.opensub .wp-submenu a:focus,#adminmenu .wp-has-current-submenu.opensub .wp-submenu a:hover,#adminmenu .wp-submenu a:focus,#adminmenu .wp-submenu a:hover,#adminmenu a.wp-has-current-submenu:focus+.wp-submenu a:focus,#adminmenu a.wp-has-current-submenu:focus+.wp-submenu a:hover,.folded #adminmenu .wp-has-current-submenu .wp-submenu a:focus,.folded #adminmenu .wp-has-current-submenu .wp-submenu a:hover{color:#c7a589}#adminmenu .wp-has-current-submenu.opensub .wp-submenu li.current a,#adminmenu .wp-submenu li.current a,#adminmenu a.wp-has-current-submenu:focus+.wp-submenu li.current a{color:#fff}#adminmenu .wp-has-current-submenu.opensub .wp-submenu li.current a:focus,#adminmenu .wp-has-current-submenu.opensub .wp-submenu li.current a:hover,#adminmenu .wp-submenu li.current a:focus,#adminmenu .wp-submenu li.current a:hover,#adminmenu a.wp-has-current-submenu:focus+.wp-submenu li.current a:focus,#adminmenu a.wp-has-current-submenu:focus+.wp-submenu li.current a:hover{color:#c7a589}ul#adminmenu a.wp-has-current-submenu:after,ul#adminmenu>li.current>a.current:after{border-right-color:#f1f1f1}#adminmenu li.current a.menu-top,#adminmenu li.wp-has-current-submenu .wp-submenu .wp-submenu-head,#adminmenu li.wp-has-current-submenu a.wp-has-current-submenu,.folded #adminmenu li.current.menu-top{color:#fff;background:#c7a589}#adminmenu a.current:hover div.wp-menu-image:before,#adminmenu li a:focus div.wp-menu-image:before,#adminmenu li.opensub div.wp-menu-image:before,#adminmenu li.wp-has-current-submenu a:focus div.wp-menu-image:before,#adminmenu li.wp-has-current-submenu div.wp-menu-image:before,#adminmenu li.wp-has-current-submenu.opensub div.wp-menu-image:before,#adminmenu li:hover div.wp-menu-image:before,.ie8 #adminmenu li.opensub div.wp-menu-image:before{color:#fff}#adminmenu .awaiting-mod,#adminmenu .update-plugins{color:#fff;background:#9ea476}#adminmenu li a.wp-has-current-submenu .update-plugins,#adminmenu li.current a .awaiting-mod,#adminmenu li.menu-top:hover>a .update-plugins,#adminmenu li:hover a .awaiting-mod{color:#fff;background:#46403c}#collapse-button{color:#f3f2f1}#collapse-button:focus,#collapse-button:hover{color:#c7a589}#wpadminbar{color:#fff;background:#59524c}#wpadminbar .ab-item,#wpadminbar a.ab-item,#wpadminbar>#wp-toolbar span.ab-label,#wpadminbar>#wp-toolbar span.noticon{color:#fff}#wpadminbar .ab-icon,#wpadminbar .ab-icon:before,#wpadminbar .ab-item:after,#wpadminbar .ab-item:before{color:#f3f2f1}#wpadminbar .ab-top-menu>li.menupop.hover>.ab-item,#wpadminbar.nojq .quicklinks .ab-top-menu>li>.ab-item:focus,#wpadminbar.nojs .ab-top-menu>li.menupop:hover>.ab-item,#wpadminbar:not(.mobile) .ab-top-menu>li:hover>.ab-item,#wpadminbar:not(.mobile) .ab-top-menu>li>.ab-item:focus{color:#c7a589;background:#46403c}#wpadminbar:not(.mobile)>#wp-toolbar a:focus span.ab-label,#wpadminbar:not(.mobile)>#wp-toolbar li.hover span.ab-label,#wpadminbar:not(.mobile)>#wp-toolbar li:hover span.ab-label{color:#c7a589}#wpadminbar:not(.mobile) li:hover #adminbarsearch:before,#wpadminbar:not(.mobile) li:hover .ab-icon:before,#wpadminbar:not(.mobile) li:hover .ab-item:after,#wpadminbar:not(.mobile) li:hover .ab-item:before{color:#fff}#wpadminbar .menupop .ab-sub-wrapper{background:#46403c}#wpadminbar .quicklinks .menupop ul.ab-sub-secondary,#wpadminbar .quicklinks .menupop ul.ab-sub-secondary .ab-submenu{background:#656463}#wpadminbar .ab-submenu .ab-item,#wpadminbar .quicklinks .menupop ul li a,#wpadminbar .quicklinks .menupop.hover ul li a,#wpadminbar.nojs .quicklinks .menupop:hover ul li a{color:#cdcbc9}#wpadminbar .menupop .menupop>.ab-item:before,#wpadminbar .quicklinks li .blavatar{color:#f3f2f1}#wpadminbar .quicklinks .ab-sub-wrapper .menupop.hover>a,#wpadminbar .quicklinks .menupop ul li a:focus,#wpadminbar .quicklinks .menupop ul li a:focus strong,#wpadminbar .quicklinks .menupop ul li a:hover,#wpadminbar .quicklinks .menupop ul li a:hover strong,#wpadminbar .quicklinks .menupop.hover ul li a:focus,#wpadminbar .quicklinks .menupop.hover ul li a:hover,#wpadminbar li #adminbarsearch.adminbar-focused:before,#wpadminbar li .ab-item:focus .ab-icon:before,#wpadminbar li .ab-item:focus:before,#wpadminbar li a:focus .ab-icon:before,#wpadminbar li.hover .ab-icon:before,#wpadminbar li.hover .ab-item:before,#wpadminbar li:hover #adminbarsearch:before,#wpadminbar li:hover .ab-icon:before,#wpadminbar li:hover .ab-item:before,#wpadminbar.nojs .quicklinks .menupop:hover ul li a:focus,#wpadminbar.nojs .quicklinks .menupop:hover ul li a:hover{color:#c7a589}#wpadminbar .menupop .menupop>.ab-item:hover:before,#wpadminbar .quicklinks .ab-sub-wrapper .menupop.hover>a .blavatar,#wpadminbar .quicklinks li a:focus .blavatar,#wpadminbar .quicklinks li a:hover .blavatar,#wpadminbar.mobile .quicklinks .ab-icon:before,#wpadminbar.mobile .quicklinks .ab-item:before{color:#c7a589}#wpadminbar.mobile .quicklinks .hover .ab-icon:before,#wpadminbar.mobile .quicklinks .hover .ab-item:before{color:#f3f2f1}#wpadminbar #adminbarsearch:before{color:#f3f2f1}#wpadminbar>#wp-toolbar>#wp-admin-bar-top-secondary>#wp-admin-bar-search #adminbarsearch input.adminbar-input:focus{color:#fff;background:#6c645c}#wpadminbar #wp-admin-bar-recovery-mode{color:#fff;background-color:#9ea476}#wpadminbar #wp-admin-bar-recovery-mode .ab-item,#wpadminbar #wp-admin-bar-recovery-mode a.ab-item{color:#fff}#wpadminbar .ab-top-menu>#wp-admin-bar-recovery-mode.hover>.ab-item,#wpadminbar.nojq .quicklinks .ab-top-menu>#wp-admin-bar-recovery-mode>.ab-item:focus,#wpadminbar:not(.mobile) .ab-top-menu>#wp-admin-bar-recovery-mode:hover>.ab-item,#wpadminbar:not(.mobile) .ab-top-menu>#wp-admin-bar-recovery-mode>.ab-item:focus{color:#fff;background-color:#8e946a}#wpadminbar .quicklinks li#wp-admin-bar-my-account.with-avatar>a img{border-color:#6c645c;background-color:#6c645c}#wpadminbar #wp-admin-bar-user-info .display-name{color:#fff}#wpadminbar #wp-admin-bar-user-info a:hover .display-name{color:#c7a589}#wpadminbar #wp-admin-bar-user-info .username{color:#cdcbc9}.wp-pointer .wp-pointer-content h3{background-color:#c7a589;border-color:#bf9878}.wp-pointer .wp-pointer-content h3:before{color:#c7a589}.wp-pointer.wp-pointer-top .wp-pointer-arrow,.wp-pointer.wp-pointer-top .wp-pointer-arrow-inner,.wp-pointer.wp-pointer-undefined .wp-pointer-arrow,.wp-pointer.wp-pointer-undefined .wp-pointer-arrow-inner{border-bottom-color:#c7a589}.media-item .bar,.media-progress-bar div{background-color:#c7a589}.details.attachment{box-shadow:inset 0 0 0 3px #fff,inset 0 0 0 7px #c7a589}.attachment.details .check{background-color:#c7a589;box-shadow:0 0 0 1px #fff,0 0 0 2px #c7a589}.media-selection .attachment.selection.details .thumbnail{box-shadow:0 0 0 1px #fff,0 0 0 3px #c7a589}.theme-browser .theme.active .theme-name,.theme-browser .theme.add-new-theme a:focus:after,.theme-browser .theme.add-new-theme a:hover:after{background:#c7a589}.theme-browser .theme.add-new-theme a:focus span:after,.theme-browser .theme.add-new-theme a:hover span:after{color:#c7a589}.theme-filter.current,.theme-section.current{border-bottom-color:#59524c}body.more-filters-opened .more-filters{color:#fff;background-color:#59524c}body.more-filters-opened .more-filters:before{color:#fff}body.more-filters-opened .more-filters:focus,body.more-filters-opened .more-filters:hover{background-color:#c7a589;color:#fff}body.more-filters-opened .more-filters:focus:before,body.more-filters-opened .more-filters:hover:before{color:#fff}.widgets-chooser li.widgets-chooser-selected{background-color:#c7a589;color:#fff}.widgets-chooser li.widgets-chooser-selected:before,.widgets-chooser li.widgets-chooser-selected:focus:before{color:#fff}div#wp-responsive-toggle a:before{color:#f3f2f1}.wp-responsive-open div#wp-responsive-toggle a{border-color:transparent;background:#c7a589}.wp-responsive-open #wpadminbar #wp-admin-bar-menu-toggle a{background:#46403c}.wp-responsive-open #wpadminbar #wp-admin-bar-menu-toggle .ab-icon:before{color:#f3f2f1}.mce-container.mce-menu .mce-menu-item-normal.mce-active,.mce-container.mce-menu .mce-menu-item-preview.mce-active,.mce-container.mce-menu .mce-menu-item.mce-selected,.mce-container.mce-menu .mce-menu-item:focus,.mce-container.mce-menu .mce-menu-item:hover{background:#c7a589} \ No newline at end of file
diff --git a/www/crm/wp-admin/css/colors/coffee/colors.scss b/www/crm/wp-admin/css/colors/coffee/colors.scss
new file mode 100644
index 00000000..49bee9be
--- /dev/null
+++ b/www/crm/wp-admin/css/colors/coffee/colors.scss
@@ -0,0 +1,7 @@
+$base-color: #59524c;
+$highlight-color: #c7a589;
+$notification-color: #9ea476;
+
+$form-checked: $base-color;
+
+@import "../_admin.scss";
diff --git a/www/crm/wp-admin/css/colors/ectoplasm/colors-rtl.css b/www/crm/wp-admin/css/colors/ectoplasm/colors-rtl.css
new file mode 100644
index 00000000..a76c49e3
--- /dev/null
+++ b/www/crm/wp-admin/css/colors/ectoplasm/colors-rtl.css
@@ -0,0 +1,519 @@
+/*! This file is auto-generated */
+/*
+ * Button mixin- creates 3d-ish button effect with correct
+ * highlights/shadows, based on a base color.
+ */
+body {
+ background: #f1f1f1;
+}
+
+/* Links */
+a {
+ color: #0073aa;
+}
+
+a:hover, a:active, a:focus {
+ color: #0096dd;
+}
+
+#media-upload a.del-link:hover,
+div.dashboard-widget-submit input:hover,
+.subsubsub a:hover,
+.subsubsub a.current:hover {
+ color: #0096dd;
+}
+
+/* Forms */
+input[type=checkbox]:checked:before {
+ color: #523f6d;
+}
+
+input[type=radio]:checked:before {
+ background: #523f6d;
+}
+
+.wp-core-ui input[type="reset"]:hover,
+.wp-core-ui input[type="reset"]:active {
+ color: #0096dd;
+}
+
+/* Core UI */
+.wp-core-ui .button-primary {
+ background: #a3b745;
+ border-color: #829237 #727f30 #727f30;
+ color: #fff;
+ box-shadow: 0 1px 0 #727f30;
+ text-shadow: 0 -1px 1px #727f30, -1px 0 1px #727f30, 0 1px 1px #727f30, 1px 0 1px #727f30;
+}
+
+.wp-core-ui .button-primary:hover, .wp-core-ui .button-primary:focus {
+ background: #a9bd4f;
+ border-color: #727f30;
+ color: #fff;
+ box-shadow: 0 1px 0 #727f30;
+}
+
+.wp-core-ui .button-primary:focus {
+ box-shadow: inset 0 1px 0 #829237, 0 0 2px 1px #33b3db;
+}
+
+.wp-core-ui .button-primary:active, .wp-core-ui .button-primary.active, .wp-core-ui .button-primary.active:focus, .wp-core-ui .button-primary.active:hover {
+ background: #829237;
+ border-color: #727f30;
+ box-shadow: inset 0 2px 0 #727f30;
+}
+
+.wp-core-ui .button-primary[disabled], .wp-core-ui .button-primary:disabled, .wp-core-ui .button-primary.button-primary-disabled, .wp-core-ui .button-primary.disabled {
+ color: #cfd1c7 !important;
+ background: #89993a !important;
+ border-color: #727f30 !important;
+ text-shadow: none !important;
+}
+
+.wp-core-ui .button-primary.button-hero {
+ box-shadow: 0 2px 0 #727f30 !important;
+}
+
+.wp-core-ui .button-primary.button-hero:active {
+ box-shadow: inset 0 3px 0 #727f30 !important;
+}
+
+.wp-core-ui .wp-ui-primary {
+ color: #fff;
+ background-color: #523f6d;
+}
+
+.wp-core-ui .wp-ui-text-primary {
+ color: #523f6d;
+}
+
+.wp-core-ui .wp-ui-highlight {
+ color: #fff;
+ background-color: #a3b745;
+}
+
+.wp-core-ui .wp-ui-text-highlight {
+ color: #a3b745;
+}
+
+.wp-core-ui .wp-ui-notification {
+ color: #fff;
+ background-color: #d46f15;
+}
+
+.wp-core-ui .wp-ui-text-notification {
+ color: #d46f15;
+}
+
+.wp-core-ui .wp-ui-text-icon {
+ color: #ece6f6;
+}
+
+/* List tables */
+.wrap .add-new-h2:hover,
+.wrap .page-title-action:hover {
+ color: #fff;
+ background-color: #523f6d;
+}
+
+.view-switch a.current:before {
+ color: #523f6d;
+}
+
+.view-switch a:hover:before {
+ color: #d46f15;
+}
+
+/* Admin Menu */
+#adminmenuback,
+#adminmenuwrap,
+#adminmenu {
+ background: #523f6d;
+}
+
+#adminmenu a {
+ color: #fff;
+}
+
+#adminmenu div.wp-menu-image:before {
+ color: #ece6f6;
+}
+
+#adminmenu a:hover,
+#adminmenu li.menu-top:hover,
+#adminmenu li.opensub > a.menu-top,
+#adminmenu li > a.menu-top:focus {
+ color: #fff;
+ background-color: #a3b745;
+}
+
+#adminmenu li.menu-top:hover div.wp-menu-image:before,
+#adminmenu li.opensub > a.menu-top div.wp-menu-image:before {
+ color: #fff;
+}
+
+/* Active tabs use a bottom border color that matches the page background color. */
+.about-wrap .nav-tab-active,
+.nav-tab-active,
+.nav-tab-active:hover {
+ background-color: #f1f1f1;
+ border-bottom-color: #f1f1f1;
+}
+
+/* Admin Menu: submenu */
+#adminmenu .wp-submenu,
+#adminmenu .wp-has-current-submenu .wp-submenu,
+#adminmenu .wp-has-current-submenu.opensub .wp-submenu,
+.folded #adminmenu .wp-has-current-submenu .wp-submenu,
+#adminmenu a.wp-has-current-submenu:focus + .wp-submenu {
+ background: #413256;
+}
+
+#adminmenu li.wp-has-submenu.wp-not-current-submenu.opensub:hover:after {
+ border-left-color: #413256;
+}
+
+#adminmenu .wp-submenu .wp-submenu-head {
+ color: #cbc5d3;
+}
+
+#adminmenu .wp-submenu a,
+#adminmenu .wp-has-current-submenu .wp-submenu a,
+.folded #adminmenu .wp-has-current-submenu .wp-submenu a,
+#adminmenu a.wp-has-current-submenu:focus + .wp-submenu a,
+#adminmenu .wp-has-current-submenu.opensub .wp-submenu a {
+ color: #cbc5d3;
+}
+
+#adminmenu .wp-submenu a:focus, #adminmenu .wp-submenu a:hover,
+#adminmenu .wp-has-current-submenu .wp-submenu a:focus,
+#adminmenu .wp-has-current-submenu .wp-submenu a:hover,
+.folded #adminmenu .wp-has-current-submenu .wp-submenu a:focus,
+.folded #adminmenu .wp-has-current-submenu .wp-submenu a:hover,
+#adminmenu a.wp-has-current-submenu:focus + .wp-submenu a:focus,
+#adminmenu a.wp-has-current-submenu:focus + .wp-submenu a:hover,
+#adminmenu .wp-has-current-submenu.opensub .wp-submenu a:focus,
+#adminmenu .wp-has-current-submenu.opensub .wp-submenu a:hover {
+ color: #a3b745;
+}
+
+/* Admin Menu: current */
+#adminmenu .wp-submenu li.current a,
+#adminmenu a.wp-has-current-submenu:focus + .wp-submenu li.current a,
+#adminmenu .wp-has-current-submenu.opensub .wp-submenu li.current a {
+ color: #fff;
+}
+
+#adminmenu .wp-submenu li.current a:hover, #adminmenu .wp-submenu li.current a:focus,
+#adminmenu a.wp-has-current-submenu:focus + .wp-submenu li.current a:hover,
+#adminmenu a.wp-has-current-submenu:focus + .wp-submenu li.current a:focus,
+#adminmenu .wp-has-current-submenu.opensub .wp-submenu li.current a:hover,
+#adminmenu .wp-has-current-submenu.opensub .wp-submenu li.current a:focus {
+ color: #a3b745;
+}
+
+ul#adminmenu a.wp-has-current-submenu:after,
+ul#adminmenu > li.current > a.current:after {
+ border-left-color: #f1f1f1;
+}
+
+#adminmenu li.current a.menu-top,
+#adminmenu li.wp-has-current-submenu a.wp-has-current-submenu,
+#adminmenu li.wp-has-current-submenu .wp-submenu .wp-submenu-head,
+.folded #adminmenu li.current.menu-top {
+ color: #fff;
+ background: #a3b745;
+}
+
+#adminmenu li.wp-has-current-submenu div.wp-menu-image:before,
+#adminmenu a.current:hover div.wp-menu-image:before,
+#adminmenu li.wp-has-current-submenu a:focus div.wp-menu-image:before,
+#adminmenu li.wp-has-current-submenu.opensub div.wp-menu-image:before,
+#adminmenu li:hover div.wp-menu-image:before,
+#adminmenu li a:focus div.wp-menu-image:before,
+#adminmenu li.opensub div.wp-menu-image:before,
+.ie8 #adminmenu li.opensub div.wp-menu-image:before {
+ color: #fff;
+}
+
+/* Admin Menu: bubble */
+#adminmenu .awaiting-mod,
+#adminmenu .update-plugins {
+ color: #fff;
+ background: #d46f15;
+}
+
+#adminmenu li.current a .awaiting-mod,
+#adminmenu li a.wp-has-current-submenu .update-plugins,
+#adminmenu li:hover a .awaiting-mod,
+#adminmenu li.menu-top:hover > a .update-plugins {
+ color: #fff;
+ background: #413256;
+}
+
+/* Admin Menu: collapse button */
+#collapse-button {
+ color: #ece6f6;
+}
+
+#collapse-button:hover,
+#collapse-button:focus {
+ color: #a3b745;
+}
+
+/* Admin Bar */
+#wpadminbar {
+ color: #fff;
+ background: #523f6d;
+}
+
+#wpadminbar .ab-item,
+#wpadminbar a.ab-item,
+#wpadminbar > #wp-toolbar span.ab-label,
+#wpadminbar > #wp-toolbar span.noticon {
+ color: #fff;
+}
+
+#wpadminbar .ab-icon,
+#wpadminbar .ab-icon:before,
+#wpadminbar .ab-item:before,
+#wpadminbar .ab-item:after {
+ color: #ece6f6;
+}
+
+#wpadminbar:not(.mobile) .ab-top-menu > li:hover > .ab-item,
+#wpadminbar:not(.mobile) .ab-top-menu > li > .ab-item:focus,
+#wpadminbar.nojq .quicklinks .ab-top-menu > li > .ab-item:focus,
+#wpadminbar.nojs .ab-top-menu > li.menupop:hover > .ab-item,
+#wpadminbar .ab-top-menu > li.menupop.hover > .ab-item {
+ color: #a3b745;
+ background: #413256;
+}
+
+#wpadminbar:not(.mobile) > #wp-toolbar li:hover span.ab-label,
+#wpadminbar:not(.mobile) > #wp-toolbar li.hover span.ab-label,
+#wpadminbar:not(.mobile) > #wp-toolbar a:focus span.ab-label {
+ color: #a3b745;
+}
+
+#wpadminbar:not(.mobile) li:hover .ab-icon:before,
+#wpadminbar:not(.mobile) li:hover .ab-item:before,
+#wpadminbar:not(.mobile) li:hover .ab-item:after,
+#wpadminbar:not(.mobile) li:hover #adminbarsearch:before {
+ color: #fff;
+}
+
+/* Admin Bar: submenu */
+#wpadminbar .menupop .ab-sub-wrapper {
+ background: #413256;
+}
+
+#wpadminbar .quicklinks .menupop ul.ab-sub-secondary,
+#wpadminbar .quicklinks .menupop ul.ab-sub-secondary .ab-submenu {
+ background: #64537c;
+}
+
+#wpadminbar .ab-submenu .ab-item,
+#wpadminbar .quicklinks .menupop ul li a,
+#wpadminbar .quicklinks .menupop.hover ul li a,
+#wpadminbar.nojs .quicklinks .menupop:hover ul li a {
+ color: #cbc5d3;
+}
+
+#wpadminbar .quicklinks li .blavatar,
+#wpadminbar .menupop .menupop > .ab-item:before {
+ color: #ece6f6;
+}
+
+#wpadminbar .quicklinks .menupop ul li a:hover,
+#wpadminbar .quicklinks .menupop ul li a:focus,
+#wpadminbar .quicklinks .menupop ul li a:hover strong,
+#wpadminbar .quicklinks .menupop ul li a:focus strong,
+#wpadminbar .quicklinks .ab-sub-wrapper .menupop.hover > a,
+#wpadminbar .quicklinks .menupop.hover ul li a:hover,
+#wpadminbar .quicklinks .menupop.hover ul li a:focus,
+#wpadminbar.nojs .quicklinks .menupop:hover ul li a:hover,
+#wpadminbar.nojs .quicklinks .menupop:hover ul li a:focus,
+#wpadminbar li:hover .ab-icon:before,
+#wpadminbar li:hover .ab-item:before,
+#wpadminbar li a:focus .ab-icon:before,
+#wpadminbar li .ab-item:focus:before,
+#wpadminbar li .ab-item:focus .ab-icon:before,
+#wpadminbar li.hover .ab-icon:before,
+#wpadminbar li.hover .ab-item:before,
+#wpadminbar li:hover #adminbarsearch:before,
+#wpadminbar li #adminbarsearch.adminbar-focused:before {
+ color: #a3b745;
+}
+
+#wpadminbar .quicklinks li a:hover .blavatar,
+#wpadminbar .quicklinks li a:focus .blavatar,
+#wpadminbar .quicklinks .ab-sub-wrapper .menupop.hover > a .blavatar,
+#wpadminbar .menupop .menupop > .ab-item:hover:before,
+#wpadminbar.mobile .quicklinks .ab-icon:before,
+#wpadminbar.mobile .quicklinks .ab-item:before {
+ color: #a3b745;
+}
+
+#wpadminbar.mobile .quicklinks .hover .ab-icon:before,
+#wpadminbar.mobile .quicklinks .hover .ab-item:before {
+ color: #ece6f6;
+}
+
+/* Admin Bar: search */
+#wpadminbar #adminbarsearch:before {
+ color: #ece6f6;
+}
+
+#wpadminbar > #wp-toolbar > #wp-admin-bar-top-secondary > #wp-admin-bar-search #adminbarsearch input.adminbar-input:focus {
+ color: #fff;
+ background: #634c84;
+}
+
+/* Admin Bar: recovery mode */
+#wpadminbar #wp-admin-bar-recovery-mode {
+ color: #fff;
+ background-color: #d46f15;
+}
+
+#wpadminbar #wp-admin-bar-recovery-mode .ab-item,
+#wpadminbar #wp-admin-bar-recovery-mode a.ab-item {
+ color: #fff;
+}
+
+#wpadminbar .ab-top-menu > #wp-admin-bar-recovery-mode.hover > .ab-item,
+#wpadminbar.nojq .quicklinks .ab-top-menu > #wp-admin-bar-recovery-mode > .ab-item:focus,
+#wpadminbar:not(.mobile) .ab-top-menu > #wp-admin-bar-recovery-mode:hover > .ab-item,
+#wpadminbar:not(.mobile) .ab-top-menu > #wp-admin-bar-recovery-mode > .ab-item:focus {
+ color: #fff;
+ background-color: #bf6413;
+}
+
+/* Admin Bar: my account */
+#wpadminbar .quicklinks li#wp-admin-bar-my-account.with-avatar > a img {
+ border-color: #634c84;
+ background-color: #634c84;
+}
+
+#wpadminbar #wp-admin-bar-user-info .display-name {
+ color: #fff;
+}
+
+#wpadminbar #wp-admin-bar-user-info a:hover .display-name {
+ color: #a3b745;
+}
+
+#wpadminbar #wp-admin-bar-user-info .username {
+ color: #cbc5d3;
+}
+
+/* Pointers */
+.wp-pointer .wp-pointer-content h3 {
+ background-color: #a3b745;
+ border-color: #93a43e;
+}
+
+.wp-pointer .wp-pointer-content h3:before {
+ color: #a3b745;
+}
+
+.wp-pointer.wp-pointer-top .wp-pointer-arrow,
+.wp-pointer.wp-pointer-top .wp-pointer-arrow-inner,
+.wp-pointer.wp-pointer-undefined .wp-pointer-arrow,
+.wp-pointer.wp-pointer-undefined .wp-pointer-arrow-inner {
+ border-bottom-color: #a3b745;
+}
+
+/* Media */
+.media-item .bar,
+.media-progress-bar div {
+ background-color: #a3b745;
+}
+
+.details.attachment {
+ box-shadow: inset 0 0 0 3px #fff, inset 0 0 0 7px #a3b745;
+}
+
+.attachment.details .check {
+ background-color: #a3b745;
+ box-shadow: 0 0 0 1px #fff, 0 0 0 2px #a3b745;
+}
+
+.media-selection .attachment.selection.details .thumbnail {
+ box-shadow: 0 0 0 1px #fff, 0 0 0 3px #a3b745;
+}
+
+/* Themes */
+.theme-browser .theme.active .theme-name,
+.theme-browser .theme.add-new-theme a:hover:after,
+.theme-browser .theme.add-new-theme a:focus:after {
+ background: #a3b745;
+}
+
+.theme-browser .theme.add-new-theme a:hover span:after,
+.theme-browser .theme.add-new-theme a:focus span:after {
+ color: #a3b745;
+}
+
+.theme-section.current,
+.theme-filter.current {
+ border-bottom-color: #523f6d;
+}
+
+body.more-filters-opened .more-filters {
+ color: #fff;
+ background-color: #523f6d;
+}
+
+body.more-filters-opened .more-filters:before {
+ color: #fff;
+}
+
+body.more-filters-opened .more-filters:hover,
+body.more-filters-opened .more-filters:focus {
+ background-color: #a3b745;
+ color: #fff;
+}
+
+body.more-filters-opened .more-filters:hover:before,
+body.more-filters-opened .more-filters:focus:before {
+ color: #fff;
+}
+
+/* Widgets */
+.widgets-chooser li.widgets-chooser-selected {
+ background-color: #a3b745;
+ color: #fff;
+}
+
+.widgets-chooser li.widgets-chooser-selected:before,
+.widgets-chooser li.widgets-chooser-selected:focus:before {
+ color: #fff;
+}
+
+/* Responsive Component */
+div#wp-responsive-toggle a:before {
+ color: #ece6f6;
+}
+
+.wp-responsive-open div#wp-responsive-toggle a {
+ border-color: transparent;
+ background: #a3b745;
+}
+
+.wp-responsive-open #wpadminbar #wp-admin-bar-menu-toggle a {
+ background: #413256;
+}
+
+.wp-responsive-open #wpadminbar #wp-admin-bar-menu-toggle .ab-icon:before {
+ color: #ece6f6;
+}
+
+/* TinyMCE */
+.mce-container.mce-menu .mce-menu-item:hover,
+.mce-container.mce-menu .mce-menu-item.mce-selected,
+.mce-container.mce-menu .mce-menu-item:focus,
+.mce-container.mce-menu .mce-menu-item-normal.mce-active,
+.mce-container.mce-menu .mce-menu-item-preview.mce-active {
+ background: #a3b745;
+}
diff --git a/www/crm/wp-admin/css/colors/ectoplasm/colors-rtl.min.css b/www/crm/wp-admin/css/colors/ectoplasm/colors-rtl.min.css
new file mode 100644
index 00000000..f7d9f026
--- /dev/null
+++ b/www/crm/wp-admin/css/colors/ectoplasm/colors-rtl.min.css
@@ -0,0 +1,2 @@
+/*! This file is auto-generated */
+body{background:#f1f1f1}a{color:#0073aa}a:active,a:focus,a:hover{color:#0096dd}#media-upload a.del-link:hover,.subsubsub a.current:hover,.subsubsub a:hover,div.dashboard-widget-submit input:hover{color:#0096dd}input[type=checkbox]:checked:before{color:#523f6d}input[type=radio]:checked:before{background:#523f6d}.wp-core-ui input[type=reset]:active,.wp-core-ui input[type=reset]:hover{color:#0096dd}.wp-core-ui .button-primary{background:#a3b745;border-color:#829237 #727f30 #727f30;color:#fff;box-shadow:0 1px 0 #727f30;text-shadow:0 -1px 1px #727f30,-1px 0 1px #727f30,0 1px 1px #727f30,1px 0 1px #727f30}.wp-core-ui .button-primary:focus,.wp-core-ui .button-primary:hover{background:#a9bd4f;border-color:#727f30;color:#fff;box-shadow:0 1px 0 #727f30}.wp-core-ui .button-primary:focus{box-shadow:inset 0 1px 0 #829237,0 0 2px 1px #33b3db}.wp-core-ui .button-primary.active,.wp-core-ui .button-primary.active:focus,.wp-core-ui .button-primary.active:hover,.wp-core-ui .button-primary:active{background:#829237;border-color:#727f30;box-shadow:inset 0 2px 0 #727f30}.wp-core-ui .button-primary.button-primary-disabled,.wp-core-ui .button-primary.disabled,.wp-core-ui .button-primary:disabled,.wp-core-ui .button-primary[disabled]{color:#cfd1c7!important;background:#89993a!important;border-color:#727f30!important;text-shadow:none!important}.wp-core-ui .button-primary.button-hero{box-shadow:0 2px 0 #727f30!important}.wp-core-ui .button-primary.button-hero:active{box-shadow:inset 0 3px 0 #727f30!important}.wp-core-ui .wp-ui-primary{color:#fff;background-color:#523f6d}.wp-core-ui .wp-ui-text-primary{color:#523f6d}.wp-core-ui .wp-ui-highlight{color:#fff;background-color:#a3b745}.wp-core-ui .wp-ui-text-highlight{color:#a3b745}.wp-core-ui .wp-ui-notification{color:#fff;background-color:#d46f15}.wp-core-ui .wp-ui-text-notification{color:#d46f15}.wp-core-ui .wp-ui-text-icon{color:#ece6f6}.wrap .add-new-h2:hover,.wrap .page-title-action:hover{color:#fff;background-color:#523f6d}.view-switch a.current:before{color:#523f6d}.view-switch a:hover:before{color:#d46f15}#adminmenu,#adminmenuback,#adminmenuwrap{background:#523f6d}#adminmenu a{color:#fff}#adminmenu div.wp-menu-image:before{color:#ece6f6}#adminmenu a:hover,#adminmenu li.menu-top:hover,#adminmenu li.opensub>a.menu-top,#adminmenu li>a.menu-top:focus{color:#fff;background-color:#a3b745}#adminmenu li.menu-top:hover div.wp-menu-image:before,#adminmenu li.opensub>a.menu-top div.wp-menu-image:before{color:#fff}.about-wrap .nav-tab-active,.nav-tab-active,.nav-tab-active:hover{background-color:#f1f1f1;border-bottom-color:#f1f1f1}#adminmenu .wp-has-current-submenu .wp-submenu,#adminmenu .wp-has-current-submenu.opensub .wp-submenu,#adminmenu .wp-submenu,#adminmenu a.wp-has-current-submenu:focus+.wp-submenu,.folded #adminmenu .wp-has-current-submenu .wp-submenu{background:#413256}#adminmenu li.wp-has-submenu.wp-not-current-submenu.opensub:hover:after{border-left-color:#413256}#adminmenu .wp-submenu .wp-submenu-head{color:#cbc5d3}#adminmenu .wp-has-current-submenu .wp-submenu a,#adminmenu .wp-has-current-submenu.opensub .wp-submenu a,#adminmenu .wp-submenu a,#adminmenu a.wp-has-current-submenu:focus+.wp-submenu a,.folded #adminmenu .wp-has-current-submenu .wp-submenu a{color:#cbc5d3}#adminmenu .wp-has-current-submenu .wp-submenu a:focus,#adminmenu .wp-has-current-submenu .wp-submenu a:hover,#adminmenu .wp-has-current-submenu.opensub .wp-submenu a:focus,#adminmenu .wp-has-current-submenu.opensub .wp-submenu a:hover,#adminmenu .wp-submenu a:focus,#adminmenu .wp-submenu a:hover,#adminmenu a.wp-has-current-submenu:focus+.wp-submenu a:focus,#adminmenu a.wp-has-current-submenu:focus+.wp-submenu a:hover,.folded #adminmenu .wp-has-current-submenu .wp-submenu a:focus,.folded #adminmenu .wp-has-current-submenu .wp-submenu a:hover{color:#a3b745}#adminmenu .wp-has-current-submenu.opensub .wp-submenu li.current a,#adminmenu .wp-submenu li.current a,#adminmenu a.wp-has-current-submenu:focus+.wp-submenu li.current a{color:#fff}#adminmenu .wp-has-current-submenu.opensub .wp-submenu li.current a:focus,#adminmenu .wp-has-current-submenu.opensub .wp-submenu li.current a:hover,#adminmenu .wp-submenu li.current a:focus,#adminmenu .wp-submenu li.current a:hover,#adminmenu a.wp-has-current-submenu:focus+.wp-submenu li.current a:focus,#adminmenu a.wp-has-current-submenu:focus+.wp-submenu li.current a:hover{color:#a3b745}ul#adminmenu a.wp-has-current-submenu:after,ul#adminmenu>li.current>a.current:after{border-left-color:#f1f1f1}#adminmenu li.current a.menu-top,#adminmenu li.wp-has-current-submenu .wp-submenu .wp-submenu-head,#adminmenu li.wp-has-current-submenu a.wp-has-current-submenu,.folded #adminmenu li.current.menu-top{color:#fff;background:#a3b745}#adminmenu a.current:hover div.wp-menu-image:before,#adminmenu li a:focus div.wp-menu-image:before,#adminmenu li.opensub div.wp-menu-image:before,#adminmenu li.wp-has-current-submenu a:focus div.wp-menu-image:before,#adminmenu li.wp-has-current-submenu div.wp-menu-image:before,#adminmenu li.wp-has-current-submenu.opensub div.wp-menu-image:before,#adminmenu li:hover div.wp-menu-image:before,.ie8 #adminmenu li.opensub div.wp-menu-image:before{color:#fff}#adminmenu .awaiting-mod,#adminmenu .update-plugins{color:#fff;background:#d46f15}#adminmenu li a.wp-has-current-submenu .update-plugins,#adminmenu li.current a .awaiting-mod,#adminmenu li.menu-top:hover>a .update-plugins,#adminmenu li:hover a .awaiting-mod{color:#fff;background:#413256}#collapse-button{color:#ece6f6}#collapse-button:focus,#collapse-button:hover{color:#a3b745}#wpadminbar{color:#fff;background:#523f6d}#wpadminbar .ab-item,#wpadminbar a.ab-item,#wpadminbar>#wp-toolbar span.ab-label,#wpadminbar>#wp-toolbar span.noticon{color:#fff}#wpadminbar .ab-icon,#wpadminbar .ab-icon:before,#wpadminbar .ab-item:after,#wpadminbar .ab-item:before{color:#ece6f6}#wpadminbar .ab-top-menu>li.menupop.hover>.ab-item,#wpadminbar.nojq .quicklinks .ab-top-menu>li>.ab-item:focus,#wpadminbar.nojs .ab-top-menu>li.menupop:hover>.ab-item,#wpadminbar:not(.mobile) .ab-top-menu>li:hover>.ab-item,#wpadminbar:not(.mobile) .ab-top-menu>li>.ab-item:focus{color:#a3b745;background:#413256}#wpadminbar:not(.mobile)>#wp-toolbar a:focus span.ab-label,#wpadminbar:not(.mobile)>#wp-toolbar li.hover span.ab-label,#wpadminbar:not(.mobile)>#wp-toolbar li:hover span.ab-label{color:#a3b745}#wpadminbar:not(.mobile) li:hover #adminbarsearch:before,#wpadminbar:not(.mobile) li:hover .ab-icon:before,#wpadminbar:not(.mobile) li:hover .ab-item:after,#wpadminbar:not(.mobile) li:hover .ab-item:before{color:#fff}#wpadminbar .menupop .ab-sub-wrapper{background:#413256}#wpadminbar .quicklinks .menupop ul.ab-sub-secondary,#wpadminbar .quicklinks .menupop ul.ab-sub-secondary .ab-submenu{background:#64537c}#wpadminbar .ab-submenu .ab-item,#wpadminbar .quicklinks .menupop ul li a,#wpadminbar .quicklinks .menupop.hover ul li a,#wpadminbar.nojs .quicklinks .menupop:hover ul li a{color:#cbc5d3}#wpadminbar .menupop .menupop>.ab-item:before,#wpadminbar .quicklinks li .blavatar{color:#ece6f6}#wpadminbar .quicklinks .ab-sub-wrapper .menupop.hover>a,#wpadminbar .quicklinks .menupop ul li a:focus,#wpadminbar .quicklinks .menupop ul li a:focus strong,#wpadminbar .quicklinks .menupop ul li a:hover,#wpadminbar .quicklinks .menupop ul li a:hover strong,#wpadminbar .quicklinks .menupop.hover ul li a:focus,#wpadminbar .quicklinks .menupop.hover ul li a:hover,#wpadminbar li #adminbarsearch.adminbar-focused:before,#wpadminbar li .ab-item:focus .ab-icon:before,#wpadminbar li .ab-item:focus:before,#wpadminbar li a:focus .ab-icon:before,#wpadminbar li.hover .ab-icon:before,#wpadminbar li.hover .ab-item:before,#wpadminbar li:hover #adminbarsearch:before,#wpadminbar li:hover .ab-icon:before,#wpadminbar li:hover .ab-item:before,#wpadminbar.nojs .quicklinks .menupop:hover ul li a:focus,#wpadminbar.nojs .quicklinks .menupop:hover ul li a:hover{color:#a3b745}#wpadminbar .menupop .menupop>.ab-item:hover:before,#wpadminbar .quicklinks .ab-sub-wrapper .menupop.hover>a .blavatar,#wpadminbar .quicklinks li a:focus .blavatar,#wpadminbar .quicklinks li a:hover .blavatar,#wpadminbar.mobile .quicklinks .ab-icon:before,#wpadminbar.mobile .quicklinks .ab-item:before{color:#a3b745}#wpadminbar.mobile .quicklinks .hover .ab-icon:before,#wpadminbar.mobile .quicklinks .hover .ab-item:before{color:#ece6f6}#wpadminbar #adminbarsearch:before{color:#ece6f6}#wpadminbar>#wp-toolbar>#wp-admin-bar-top-secondary>#wp-admin-bar-search #adminbarsearch input.adminbar-input:focus{color:#fff;background:#634c84}#wpadminbar #wp-admin-bar-recovery-mode{color:#fff;background-color:#d46f15}#wpadminbar #wp-admin-bar-recovery-mode .ab-item,#wpadminbar #wp-admin-bar-recovery-mode a.ab-item{color:#fff}#wpadminbar .ab-top-menu>#wp-admin-bar-recovery-mode.hover>.ab-item,#wpadminbar.nojq .quicklinks .ab-top-menu>#wp-admin-bar-recovery-mode>.ab-item:focus,#wpadminbar:not(.mobile) .ab-top-menu>#wp-admin-bar-recovery-mode:hover>.ab-item,#wpadminbar:not(.mobile) .ab-top-menu>#wp-admin-bar-recovery-mode>.ab-item:focus{color:#fff;background-color:#bf6413}#wpadminbar .quicklinks li#wp-admin-bar-my-account.with-avatar>a img{border-color:#634c84;background-color:#634c84}#wpadminbar #wp-admin-bar-user-info .display-name{color:#fff}#wpadminbar #wp-admin-bar-user-info a:hover .display-name{color:#a3b745}#wpadminbar #wp-admin-bar-user-info .username{color:#cbc5d3}.wp-pointer .wp-pointer-content h3{background-color:#a3b745;border-color:#93a43e}.wp-pointer .wp-pointer-content h3:before{color:#a3b745}.wp-pointer.wp-pointer-top .wp-pointer-arrow,.wp-pointer.wp-pointer-top .wp-pointer-arrow-inner,.wp-pointer.wp-pointer-undefined .wp-pointer-arrow,.wp-pointer.wp-pointer-undefined .wp-pointer-arrow-inner{border-bottom-color:#a3b745}.media-item .bar,.media-progress-bar div{background-color:#a3b745}.details.attachment{box-shadow:inset 0 0 0 3px #fff,inset 0 0 0 7px #a3b745}.attachment.details .check{background-color:#a3b745;box-shadow:0 0 0 1px #fff,0 0 0 2px #a3b745}.media-selection .attachment.selection.details .thumbnail{box-shadow:0 0 0 1px #fff,0 0 0 3px #a3b745}.theme-browser .theme.active .theme-name,.theme-browser .theme.add-new-theme a:focus:after,.theme-browser .theme.add-new-theme a:hover:after{background:#a3b745}.theme-browser .theme.add-new-theme a:focus span:after,.theme-browser .theme.add-new-theme a:hover span:after{color:#a3b745}.theme-filter.current,.theme-section.current{border-bottom-color:#523f6d}body.more-filters-opened .more-filters{color:#fff;background-color:#523f6d}body.more-filters-opened .more-filters:before{color:#fff}body.more-filters-opened .more-filters:focus,body.more-filters-opened .more-filters:hover{background-color:#a3b745;color:#fff}body.more-filters-opened .more-filters:focus:before,body.more-filters-opened .more-filters:hover:before{color:#fff}.widgets-chooser li.widgets-chooser-selected{background-color:#a3b745;color:#fff}.widgets-chooser li.widgets-chooser-selected:before,.widgets-chooser li.widgets-chooser-selected:focus:before{color:#fff}div#wp-responsive-toggle a:before{color:#ece6f6}.wp-responsive-open div#wp-responsive-toggle a{border-color:transparent;background:#a3b745}.wp-responsive-open #wpadminbar #wp-admin-bar-menu-toggle a{background:#413256}.wp-responsive-open #wpadminbar #wp-admin-bar-menu-toggle .ab-icon:before{color:#ece6f6}.mce-container.mce-menu .mce-menu-item-normal.mce-active,.mce-container.mce-menu .mce-menu-item-preview.mce-active,.mce-container.mce-menu .mce-menu-item.mce-selected,.mce-container.mce-menu .mce-menu-item:focus,.mce-container.mce-menu .mce-menu-item:hover{background:#a3b745} \ No newline at end of file
diff --git a/www/crm/wp-admin/css/colors/ectoplasm/colors.css b/www/crm/wp-admin/css/colors/ectoplasm/colors.css
new file mode 100644
index 00000000..4c6422da
--- /dev/null
+++ b/www/crm/wp-admin/css/colors/ectoplasm/colors.css
@@ -0,0 +1,519 @@
+/*! This file is auto-generated */
+/*
+ * Button mixin- creates 3d-ish button effect with correct
+ * highlights/shadows, based on a base color.
+ */
+body {
+ background: #f1f1f1;
+}
+
+/* Links */
+a {
+ color: #0073aa;
+}
+
+a:hover, a:active, a:focus {
+ color: #0096dd;
+}
+
+#media-upload a.del-link:hover,
+div.dashboard-widget-submit input:hover,
+.subsubsub a:hover,
+.subsubsub a.current:hover {
+ color: #0096dd;
+}
+
+/* Forms */
+input[type=checkbox]:checked:before {
+ color: #523f6d;
+}
+
+input[type=radio]:checked:before {
+ background: #523f6d;
+}
+
+.wp-core-ui input[type="reset"]:hover,
+.wp-core-ui input[type="reset"]:active {
+ color: #0096dd;
+}
+
+/* Core UI */
+.wp-core-ui .button-primary {
+ background: #a3b745;
+ border-color: #829237 #727f30 #727f30;
+ color: #fff;
+ box-shadow: 0 1px 0 #727f30;
+ text-shadow: 0 -1px 1px #727f30, 1px 0 1px #727f30, 0 1px 1px #727f30, -1px 0 1px #727f30;
+}
+
+.wp-core-ui .button-primary:hover, .wp-core-ui .button-primary:focus {
+ background: #a9bd4f;
+ border-color: #727f30;
+ color: #fff;
+ box-shadow: 0 1px 0 #727f30;
+}
+
+.wp-core-ui .button-primary:focus {
+ box-shadow: inset 0 1px 0 #829237, 0 0 2px 1px #33b3db;
+}
+
+.wp-core-ui .button-primary:active, .wp-core-ui .button-primary.active, .wp-core-ui .button-primary.active:focus, .wp-core-ui .button-primary.active:hover {
+ background: #829237;
+ border-color: #727f30;
+ box-shadow: inset 0 2px 0 #727f30;
+}
+
+.wp-core-ui .button-primary[disabled], .wp-core-ui .button-primary:disabled, .wp-core-ui .button-primary.button-primary-disabled, .wp-core-ui .button-primary.disabled {
+ color: #cfd1c7 !important;
+ background: #89993a !important;
+ border-color: #727f30 !important;
+ text-shadow: none !important;
+}
+
+.wp-core-ui .button-primary.button-hero {
+ box-shadow: 0 2px 0 #727f30 !important;
+}
+
+.wp-core-ui .button-primary.button-hero:active {
+ box-shadow: inset 0 3px 0 #727f30 !important;
+}
+
+.wp-core-ui .wp-ui-primary {
+ color: #fff;
+ background-color: #523f6d;
+}
+
+.wp-core-ui .wp-ui-text-primary {
+ color: #523f6d;
+}
+
+.wp-core-ui .wp-ui-highlight {
+ color: #fff;
+ background-color: #a3b745;
+}
+
+.wp-core-ui .wp-ui-text-highlight {
+ color: #a3b745;
+}
+
+.wp-core-ui .wp-ui-notification {
+ color: #fff;
+ background-color: #d46f15;
+}
+
+.wp-core-ui .wp-ui-text-notification {
+ color: #d46f15;
+}
+
+.wp-core-ui .wp-ui-text-icon {
+ color: #ece6f6;
+}
+
+/* List tables */
+.wrap .add-new-h2:hover,
+.wrap .page-title-action:hover {
+ color: #fff;
+ background-color: #523f6d;
+}
+
+.view-switch a.current:before {
+ color: #523f6d;
+}
+
+.view-switch a:hover:before {
+ color: #d46f15;
+}
+
+/* Admin Menu */
+#adminmenuback,
+#adminmenuwrap,
+#adminmenu {
+ background: #523f6d;
+}
+
+#adminmenu a {
+ color: #fff;
+}
+
+#adminmenu div.wp-menu-image:before {
+ color: #ece6f6;
+}
+
+#adminmenu a:hover,
+#adminmenu li.menu-top:hover,
+#adminmenu li.opensub > a.menu-top,
+#adminmenu li > a.menu-top:focus {
+ color: #fff;
+ background-color: #a3b745;
+}
+
+#adminmenu li.menu-top:hover div.wp-menu-image:before,
+#adminmenu li.opensub > a.menu-top div.wp-menu-image:before {
+ color: #fff;
+}
+
+/* Active tabs use a bottom border color that matches the page background color. */
+.about-wrap .nav-tab-active,
+.nav-tab-active,
+.nav-tab-active:hover {
+ background-color: #f1f1f1;
+ border-bottom-color: #f1f1f1;
+}
+
+/* Admin Menu: submenu */
+#adminmenu .wp-submenu,
+#adminmenu .wp-has-current-submenu .wp-submenu,
+#adminmenu .wp-has-current-submenu.opensub .wp-submenu,
+.folded #adminmenu .wp-has-current-submenu .wp-submenu,
+#adminmenu a.wp-has-current-submenu:focus + .wp-submenu {
+ background: #413256;
+}
+
+#adminmenu li.wp-has-submenu.wp-not-current-submenu.opensub:hover:after {
+ border-right-color: #413256;
+}
+
+#adminmenu .wp-submenu .wp-submenu-head {
+ color: #cbc5d3;
+}
+
+#adminmenu .wp-submenu a,
+#adminmenu .wp-has-current-submenu .wp-submenu a,
+.folded #adminmenu .wp-has-current-submenu .wp-submenu a,
+#adminmenu a.wp-has-current-submenu:focus + .wp-submenu a,
+#adminmenu .wp-has-current-submenu.opensub .wp-submenu a {
+ color: #cbc5d3;
+}
+
+#adminmenu .wp-submenu a:focus, #adminmenu .wp-submenu a:hover,
+#adminmenu .wp-has-current-submenu .wp-submenu a:focus,
+#adminmenu .wp-has-current-submenu .wp-submenu a:hover,
+.folded #adminmenu .wp-has-current-submenu .wp-submenu a:focus,
+.folded #adminmenu .wp-has-current-submenu .wp-submenu a:hover,
+#adminmenu a.wp-has-current-submenu:focus + .wp-submenu a:focus,
+#adminmenu a.wp-has-current-submenu:focus + .wp-submenu a:hover,
+#adminmenu .wp-has-current-submenu.opensub .wp-submenu a:focus,
+#adminmenu .wp-has-current-submenu.opensub .wp-submenu a:hover {
+ color: #a3b745;
+}
+
+/* Admin Menu: current */
+#adminmenu .wp-submenu li.current a,
+#adminmenu a.wp-has-current-submenu:focus + .wp-submenu li.current a,
+#adminmenu .wp-has-current-submenu.opensub .wp-submenu li.current a {
+ color: #fff;
+}
+
+#adminmenu .wp-submenu li.current a:hover, #adminmenu .wp-submenu li.current a:focus,
+#adminmenu a.wp-has-current-submenu:focus + .wp-submenu li.current a:hover,
+#adminmenu a.wp-has-current-submenu:focus + .wp-submenu li.current a:focus,
+#adminmenu .wp-has-current-submenu.opensub .wp-submenu li.current a:hover,
+#adminmenu .wp-has-current-submenu.opensub .wp-submenu li.current a:focus {
+ color: #a3b745;
+}
+
+ul#adminmenu a.wp-has-current-submenu:after,
+ul#adminmenu > li.current > a.current:after {
+ border-right-color: #f1f1f1;
+}
+
+#adminmenu li.current a.menu-top,
+#adminmenu li.wp-has-current-submenu a.wp-has-current-submenu,
+#adminmenu li.wp-has-current-submenu .wp-submenu .wp-submenu-head,
+.folded #adminmenu li.current.menu-top {
+ color: #fff;
+ background: #a3b745;
+}
+
+#adminmenu li.wp-has-current-submenu div.wp-menu-image:before,
+#adminmenu a.current:hover div.wp-menu-image:before,
+#adminmenu li.wp-has-current-submenu a:focus div.wp-menu-image:before,
+#adminmenu li.wp-has-current-submenu.opensub div.wp-menu-image:before,
+#adminmenu li:hover div.wp-menu-image:before,
+#adminmenu li a:focus div.wp-menu-image:before,
+#adminmenu li.opensub div.wp-menu-image:before,
+.ie8 #adminmenu li.opensub div.wp-menu-image:before {
+ color: #fff;
+}
+
+/* Admin Menu: bubble */
+#adminmenu .awaiting-mod,
+#adminmenu .update-plugins {
+ color: #fff;
+ background: #d46f15;
+}
+
+#adminmenu li.current a .awaiting-mod,
+#adminmenu li a.wp-has-current-submenu .update-plugins,
+#adminmenu li:hover a .awaiting-mod,
+#adminmenu li.menu-top:hover > a .update-plugins {
+ color: #fff;
+ background: #413256;
+}
+
+/* Admin Menu: collapse button */
+#collapse-button {
+ color: #ece6f6;
+}
+
+#collapse-button:hover,
+#collapse-button:focus {
+ color: #a3b745;
+}
+
+/* Admin Bar */
+#wpadminbar {
+ color: #fff;
+ background: #523f6d;
+}
+
+#wpadminbar .ab-item,
+#wpadminbar a.ab-item,
+#wpadminbar > #wp-toolbar span.ab-label,
+#wpadminbar > #wp-toolbar span.noticon {
+ color: #fff;
+}
+
+#wpadminbar .ab-icon,
+#wpadminbar .ab-icon:before,
+#wpadminbar .ab-item:before,
+#wpadminbar .ab-item:after {
+ color: #ece6f6;
+}
+
+#wpadminbar:not(.mobile) .ab-top-menu > li:hover > .ab-item,
+#wpadminbar:not(.mobile) .ab-top-menu > li > .ab-item:focus,
+#wpadminbar.nojq .quicklinks .ab-top-menu > li > .ab-item:focus,
+#wpadminbar.nojs .ab-top-menu > li.menupop:hover > .ab-item,
+#wpadminbar .ab-top-menu > li.menupop.hover > .ab-item {
+ color: #a3b745;
+ background: #413256;
+}
+
+#wpadminbar:not(.mobile) > #wp-toolbar li:hover span.ab-label,
+#wpadminbar:not(.mobile) > #wp-toolbar li.hover span.ab-label,
+#wpadminbar:not(.mobile) > #wp-toolbar a:focus span.ab-label {
+ color: #a3b745;
+}
+
+#wpadminbar:not(.mobile) li:hover .ab-icon:before,
+#wpadminbar:not(.mobile) li:hover .ab-item:before,
+#wpadminbar:not(.mobile) li:hover .ab-item:after,
+#wpadminbar:not(.mobile) li:hover #adminbarsearch:before {
+ color: #fff;
+}
+
+/* Admin Bar: submenu */
+#wpadminbar .menupop .ab-sub-wrapper {
+ background: #413256;
+}
+
+#wpadminbar .quicklinks .menupop ul.ab-sub-secondary,
+#wpadminbar .quicklinks .menupop ul.ab-sub-secondary .ab-submenu {
+ background: #64537c;
+}
+
+#wpadminbar .ab-submenu .ab-item,
+#wpadminbar .quicklinks .menupop ul li a,
+#wpadminbar .quicklinks .menupop.hover ul li a,
+#wpadminbar.nojs .quicklinks .menupop:hover ul li a {
+ color: #cbc5d3;
+}
+
+#wpadminbar .quicklinks li .blavatar,
+#wpadminbar .menupop .menupop > .ab-item:before {
+ color: #ece6f6;
+}
+
+#wpadminbar .quicklinks .menupop ul li a:hover,
+#wpadminbar .quicklinks .menupop ul li a:focus,
+#wpadminbar .quicklinks .menupop ul li a:hover strong,
+#wpadminbar .quicklinks .menupop ul li a:focus strong,
+#wpadminbar .quicklinks .ab-sub-wrapper .menupop.hover > a,
+#wpadminbar .quicklinks .menupop.hover ul li a:hover,
+#wpadminbar .quicklinks .menupop.hover ul li a:focus,
+#wpadminbar.nojs .quicklinks .menupop:hover ul li a:hover,
+#wpadminbar.nojs .quicklinks .menupop:hover ul li a:focus,
+#wpadminbar li:hover .ab-icon:before,
+#wpadminbar li:hover .ab-item:before,
+#wpadminbar li a:focus .ab-icon:before,
+#wpadminbar li .ab-item:focus:before,
+#wpadminbar li .ab-item:focus .ab-icon:before,
+#wpadminbar li.hover .ab-icon:before,
+#wpadminbar li.hover .ab-item:before,
+#wpadminbar li:hover #adminbarsearch:before,
+#wpadminbar li #adminbarsearch.adminbar-focused:before {
+ color: #a3b745;
+}
+
+#wpadminbar .quicklinks li a:hover .blavatar,
+#wpadminbar .quicklinks li a:focus .blavatar,
+#wpadminbar .quicklinks .ab-sub-wrapper .menupop.hover > a .blavatar,
+#wpadminbar .menupop .menupop > .ab-item:hover:before,
+#wpadminbar.mobile .quicklinks .ab-icon:before,
+#wpadminbar.mobile .quicklinks .ab-item:before {
+ color: #a3b745;
+}
+
+#wpadminbar.mobile .quicklinks .hover .ab-icon:before,
+#wpadminbar.mobile .quicklinks .hover .ab-item:before {
+ color: #ece6f6;
+}
+
+/* Admin Bar: search */
+#wpadminbar #adminbarsearch:before {
+ color: #ece6f6;
+}
+
+#wpadminbar > #wp-toolbar > #wp-admin-bar-top-secondary > #wp-admin-bar-search #adminbarsearch input.adminbar-input:focus {
+ color: #fff;
+ background: #634c84;
+}
+
+/* Admin Bar: recovery mode */
+#wpadminbar #wp-admin-bar-recovery-mode {
+ color: #fff;
+ background-color: #d46f15;
+}
+
+#wpadminbar #wp-admin-bar-recovery-mode .ab-item,
+#wpadminbar #wp-admin-bar-recovery-mode a.ab-item {
+ color: #fff;
+}
+
+#wpadminbar .ab-top-menu > #wp-admin-bar-recovery-mode.hover > .ab-item,
+#wpadminbar.nojq .quicklinks .ab-top-menu > #wp-admin-bar-recovery-mode > .ab-item:focus,
+#wpadminbar:not(.mobile) .ab-top-menu > #wp-admin-bar-recovery-mode:hover > .ab-item,
+#wpadminbar:not(.mobile) .ab-top-menu > #wp-admin-bar-recovery-mode > .ab-item:focus {
+ color: #fff;
+ background-color: #bf6413;
+}
+
+/* Admin Bar: my account */
+#wpadminbar .quicklinks li#wp-admin-bar-my-account.with-avatar > a img {
+ border-color: #634c84;
+ background-color: #634c84;
+}
+
+#wpadminbar #wp-admin-bar-user-info .display-name {
+ color: #fff;
+}
+
+#wpadminbar #wp-admin-bar-user-info a:hover .display-name {
+ color: #a3b745;
+}
+
+#wpadminbar #wp-admin-bar-user-info .username {
+ color: #cbc5d3;
+}
+
+/* Pointers */
+.wp-pointer .wp-pointer-content h3 {
+ background-color: #a3b745;
+ border-color: #93a43e;
+}
+
+.wp-pointer .wp-pointer-content h3:before {
+ color: #a3b745;
+}
+
+.wp-pointer.wp-pointer-top .wp-pointer-arrow,
+.wp-pointer.wp-pointer-top .wp-pointer-arrow-inner,
+.wp-pointer.wp-pointer-undefined .wp-pointer-arrow,
+.wp-pointer.wp-pointer-undefined .wp-pointer-arrow-inner {
+ border-bottom-color: #a3b745;
+}
+
+/* Media */
+.media-item .bar,
+.media-progress-bar div {
+ background-color: #a3b745;
+}
+
+.details.attachment {
+ box-shadow: inset 0 0 0 3px #fff, inset 0 0 0 7px #a3b745;
+}
+
+.attachment.details .check {
+ background-color: #a3b745;
+ box-shadow: 0 0 0 1px #fff, 0 0 0 2px #a3b745;
+}
+
+.media-selection .attachment.selection.details .thumbnail {
+ box-shadow: 0 0 0 1px #fff, 0 0 0 3px #a3b745;
+}
+
+/* Themes */
+.theme-browser .theme.active .theme-name,
+.theme-browser .theme.add-new-theme a:hover:after,
+.theme-browser .theme.add-new-theme a:focus:after {
+ background: #a3b745;
+}
+
+.theme-browser .theme.add-new-theme a:hover span:after,
+.theme-browser .theme.add-new-theme a:focus span:after {
+ color: #a3b745;
+}
+
+.theme-section.current,
+.theme-filter.current {
+ border-bottom-color: #523f6d;
+}
+
+body.more-filters-opened .more-filters {
+ color: #fff;
+ background-color: #523f6d;
+}
+
+body.more-filters-opened .more-filters:before {
+ color: #fff;
+}
+
+body.more-filters-opened .more-filters:hover,
+body.more-filters-opened .more-filters:focus {
+ background-color: #a3b745;
+ color: #fff;
+}
+
+body.more-filters-opened .more-filters:hover:before,
+body.more-filters-opened .more-filters:focus:before {
+ color: #fff;
+}
+
+/* Widgets */
+.widgets-chooser li.widgets-chooser-selected {
+ background-color: #a3b745;
+ color: #fff;
+}
+
+.widgets-chooser li.widgets-chooser-selected:before,
+.widgets-chooser li.widgets-chooser-selected:focus:before {
+ color: #fff;
+}
+
+/* Responsive Component */
+div#wp-responsive-toggle a:before {
+ color: #ece6f6;
+}
+
+.wp-responsive-open div#wp-responsive-toggle a {
+ border-color: transparent;
+ background: #a3b745;
+}
+
+.wp-responsive-open #wpadminbar #wp-admin-bar-menu-toggle a {
+ background: #413256;
+}
+
+.wp-responsive-open #wpadminbar #wp-admin-bar-menu-toggle .ab-icon:before {
+ color: #ece6f6;
+}
+
+/* TinyMCE */
+.mce-container.mce-menu .mce-menu-item:hover,
+.mce-container.mce-menu .mce-menu-item.mce-selected,
+.mce-container.mce-menu .mce-menu-item:focus,
+.mce-container.mce-menu .mce-menu-item-normal.mce-active,
+.mce-container.mce-menu .mce-menu-item-preview.mce-active {
+ background: #a3b745;
+}
diff --git a/www/crm/wp-admin/css/colors/ectoplasm/colors.min.css b/www/crm/wp-admin/css/colors/ectoplasm/colors.min.css
new file mode 100644
index 00000000..4ea24782
--- /dev/null
+++ b/www/crm/wp-admin/css/colors/ectoplasm/colors.min.css
@@ -0,0 +1,2 @@
+/*! This file is auto-generated */
+body{background:#f1f1f1}a{color:#0073aa}a:active,a:focus,a:hover{color:#0096dd}#media-upload a.del-link:hover,.subsubsub a.current:hover,.subsubsub a:hover,div.dashboard-widget-submit input:hover{color:#0096dd}input[type=checkbox]:checked:before{color:#523f6d}input[type=radio]:checked:before{background:#523f6d}.wp-core-ui input[type=reset]:active,.wp-core-ui input[type=reset]:hover{color:#0096dd}.wp-core-ui .button-primary{background:#a3b745;border-color:#829237 #727f30 #727f30;color:#fff;box-shadow:0 1px 0 #727f30;text-shadow:0 -1px 1px #727f30,1px 0 1px #727f30,0 1px 1px #727f30,-1px 0 1px #727f30}.wp-core-ui .button-primary:focus,.wp-core-ui .button-primary:hover{background:#a9bd4f;border-color:#727f30;color:#fff;box-shadow:0 1px 0 #727f30}.wp-core-ui .button-primary:focus{box-shadow:inset 0 1px 0 #829237,0 0 2px 1px #33b3db}.wp-core-ui .button-primary.active,.wp-core-ui .button-primary.active:focus,.wp-core-ui .button-primary.active:hover,.wp-core-ui .button-primary:active{background:#829237;border-color:#727f30;box-shadow:inset 0 2px 0 #727f30}.wp-core-ui .button-primary.button-primary-disabled,.wp-core-ui .button-primary.disabled,.wp-core-ui .button-primary:disabled,.wp-core-ui .button-primary[disabled]{color:#cfd1c7!important;background:#89993a!important;border-color:#727f30!important;text-shadow:none!important}.wp-core-ui .button-primary.button-hero{box-shadow:0 2px 0 #727f30!important}.wp-core-ui .button-primary.button-hero:active{box-shadow:inset 0 3px 0 #727f30!important}.wp-core-ui .wp-ui-primary{color:#fff;background-color:#523f6d}.wp-core-ui .wp-ui-text-primary{color:#523f6d}.wp-core-ui .wp-ui-highlight{color:#fff;background-color:#a3b745}.wp-core-ui .wp-ui-text-highlight{color:#a3b745}.wp-core-ui .wp-ui-notification{color:#fff;background-color:#d46f15}.wp-core-ui .wp-ui-text-notification{color:#d46f15}.wp-core-ui .wp-ui-text-icon{color:#ece6f6}.wrap .add-new-h2:hover,.wrap .page-title-action:hover{color:#fff;background-color:#523f6d}.view-switch a.current:before{color:#523f6d}.view-switch a:hover:before{color:#d46f15}#adminmenu,#adminmenuback,#adminmenuwrap{background:#523f6d}#adminmenu a{color:#fff}#adminmenu div.wp-menu-image:before{color:#ece6f6}#adminmenu a:hover,#adminmenu li.menu-top:hover,#adminmenu li.opensub>a.menu-top,#adminmenu li>a.menu-top:focus{color:#fff;background-color:#a3b745}#adminmenu li.menu-top:hover div.wp-menu-image:before,#adminmenu li.opensub>a.menu-top div.wp-menu-image:before{color:#fff}.about-wrap .nav-tab-active,.nav-tab-active,.nav-tab-active:hover{background-color:#f1f1f1;border-bottom-color:#f1f1f1}#adminmenu .wp-has-current-submenu .wp-submenu,#adminmenu .wp-has-current-submenu.opensub .wp-submenu,#adminmenu .wp-submenu,#adminmenu a.wp-has-current-submenu:focus+.wp-submenu,.folded #adminmenu .wp-has-current-submenu .wp-submenu{background:#413256}#adminmenu li.wp-has-submenu.wp-not-current-submenu.opensub:hover:after{border-right-color:#413256}#adminmenu .wp-submenu .wp-submenu-head{color:#cbc5d3}#adminmenu .wp-has-current-submenu .wp-submenu a,#adminmenu .wp-has-current-submenu.opensub .wp-submenu a,#adminmenu .wp-submenu a,#adminmenu a.wp-has-current-submenu:focus+.wp-submenu a,.folded #adminmenu .wp-has-current-submenu .wp-submenu a{color:#cbc5d3}#adminmenu .wp-has-current-submenu .wp-submenu a:focus,#adminmenu .wp-has-current-submenu .wp-submenu a:hover,#adminmenu .wp-has-current-submenu.opensub .wp-submenu a:focus,#adminmenu .wp-has-current-submenu.opensub .wp-submenu a:hover,#adminmenu .wp-submenu a:focus,#adminmenu .wp-submenu a:hover,#adminmenu a.wp-has-current-submenu:focus+.wp-submenu a:focus,#adminmenu a.wp-has-current-submenu:focus+.wp-submenu a:hover,.folded #adminmenu .wp-has-current-submenu .wp-submenu a:focus,.folded #adminmenu .wp-has-current-submenu .wp-submenu a:hover{color:#a3b745}#adminmenu .wp-has-current-submenu.opensub .wp-submenu li.current a,#adminmenu .wp-submenu li.current a,#adminmenu a.wp-has-current-submenu:focus+.wp-submenu li.current a{color:#fff}#adminmenu .wp-has-current-submenu.opensub .wp-submenu li.current a:focus,#adminmenu .wp-has-current-submenu.opensub .wp-submenu li.current a:hover,#adminmenu .wp-submenu li.current a:focus,#adminmenu .wp-submenu li.current a:hover,#adminmenu a.wp-has-current-submenu:focus+.wp-submenu li.current a:focus,#adminmenu a.wp-has-current-submenu:focus+.wp-submenu li.current a:hover{color:#a3b745}ul#adminmenu a.wp-has-current-submenu:after,ul#adminmenu>li.current>a.current:after{border-right-color:#f1f1f1}#adminmenu li.current a.menu-top,#adminmenu li.wp-has-current-submenu .wp-submenu .wp-submenu-head,#adminmenu li.wp-has-current-submenu a.wp-has-current-submenu,.folded #adminmenu li.current.menu-top{color:#fff;background:#a3b745}#adminmenu a.current:hover div.wp-menu-image:before,#adminmenu li a:focus div.wp-menu-image:before,#adminmenu li.opensub div.wp-menu-image:before,#adminmenu li.wp-has-current-submenu a:focus div.wp-menu-image:before,#adminmenu li.wp-has-current-submenu div.wp-menu-image:before,#adminmenu li.wp-has-current-submenu.opensub div.wp-menu-image:before,#adminmenu li:hover div.wp-menu-image:before,.ie8 #adminmenu li.opensub div.wp-menu-image:before{color:#fff}#adminmenu .awaiting-mod,#adminmenu .update-plugins{color:#fff;background:#d46f15}#adminmenu li a.wp-has-current-submenu .update-plugins,#adminmenu li.current a .awaiting-mod,#adminmenu li.menu-top:hover>a .update-plugins,#adminmenu li:hover a .awaiting-mod{color:#fff;background:#413256}#collapse-button{color:#ece6f6}#collapse-button:focus,#collapse-button:hover{color:#a3b745}#wpadminbar{color:#fff;background:#523f6d}#wpadminbar .ab-item,#wpadminbar a.ab-item,#wpadminbar>#wp-toolbar span.ab-label,#wpadminbar>#wp-toolbar span.noticon{color:#fff}#wpadminbar .ab-icon,#wpadminbar .ab-icon:before,#wpadminbar .ab-item:after,#wpadminbar .ab-item:before{color:#ece6f6}#wpadminbar .ab-top-menu>li.menupop.hover>.ab-item,#wpadminbar.nojq .quicklinks .ab-top-menu>li>.ab-item:focus,#wpadminbar.nojs .ab-top-menu>li.menupop:hover>.ab-item,#wpadminbar:not(.mobile) .ab-top-menu>li:hover>.ab-item,#wpadminbar:not(.mobile) .ab-top-menu>li>.ab-item:focus{color:#a3b745;background:#413256}#wpadminbar:not(.mobile)>#wp-toolbar a:focus span.ab-label,#wpadminbar:not(.mobile)>#wp-toolbar li.hover span.ab-label,#wpadminbar:not(.mobile)>#wp-toolbar li:hover span.ab-label{color:#a3b745}#wpadminbar:not(.mobile) li:hover #adminbarsearch:before,#wpadminbar:not(.mobile) li:hover .ab-icon:before,#wpadminbar:not(.mobile) li:hover .ab-item:after,#wpadminbar:not(.mobile) li:hover .ab-item:before{color:#fff}#wpadminbar .menupop .ab-sub-wrapper{background:#413256}#wpadminbar .quicklinks .menupop ul.ab-sub-secondary,#wpadminbar .quicklinks .menupop ul.ab-sub-secondary .ab-submenu{background:#64537c}#wpadminbar .ab-submenu .ab-item,#wpadminbar .quicklinks .menupop ul li a,#wpadminbar .quicklinks .menupop.hover ul li a,#wpadminbar.nojs .quicklinks .menupop:hover ul li a{color:#cbc5d3}#wpadminbar .menupop .menupop>.ab-item:before,#wpadminbar .quicklinks li .blavatar{color:#ece6f6}#wpadminbar .quicklinks .ab-sub-wrapper .menupop.hover>a,#wpadminbar .quicklinks .menupop ul li a:focus,#wpadminbar .quicklinks .menupop ul li a:focus strong,#wpadminbar .quicklinks .menupop ul li a:hover,#wpadminbar .quicklinks .menupop ul li a:hover strong,#wpadminbar .quicklinks .menupop.hover ul li a:focus,#wpadminbar .quicklinks .menupop.hover ul li a:hover,#wpadminbar li #adminbarsearch.adminbar-focused:before,#wpadminbar li .ab-item:focus .ab-icon:before,#wpadminbar li .ab-item:focus:before,#wpadminbar li a:focus .ab-icon:before,#wpadminbar li.hover .ab-icon:before,#wpadminbar li.hover .ab-item:before,#wpadminbar li:hover #adminbarsearch:before,#wpadminbar li:hover .ab-icon:before,#wpadminbar li:hover .ab-item:before,#wpadminbar.nojs .quicklinks .menupop:hover ul li a:focus,#wpadminbar.nojs .quicklinks .menupop:hover ul li a:hover{color:#a3b745}#wpadminbar .menupop .menupop>.ab-item:hover:before,#wpadminbar .quicklinks .ab-sub-wrapper .menupop.hover>a .blavatar,#wpadminbar .quicklinks li a:focus .blavatar,#wpadminbar .quicklinks li a:hover .blavatar,#wpadminbar.mobile .quicklinks .ab-icon:before,#wpadminbar.mobile .quicklinks .ab-item:before{color:#a3b745}#wpadminbar.mobile .quicklinks .hover .ab-icon:before,#wpadminbar.mobile .quicklinks .hover .ab-item:before{color:#ece6f6}#wpadminbar #adminbarsearch:before{color:#ece6f6}#wpadminbar>#wp-toolbar>#wp-admin-bar-top-secondary>#wp-admin-bar-search #adminbarsearch input.adminbar-input:focus{color:#fff;background:#634c84}#wpadminbar #wp-admin-bar-recovery-mode{color:#fff;background-color:#d46f15}#wpadminbar #wp-admin-bar-recovery-mode .ab-item,#wpadminbar #wp-admin-bar-recovery-mode a.ab-item{color:#fff}#wpadminbar .ab-top-menu>#wp-admin-bar-recovery-mode.hover>.ab-item,#wpadminbar.nojq .quicklinks .ab-top-menu>#wp-admin-bar-recovery-mode>.ab-item:focus,#wpadminbar:not(.mobile) .ab-top-menu>#wp-admin-bar-recovery-mode:hover>.ab-item,#wpadminbar:not(.mobile) .ab-top-menu>#wp-admin-bar-recovery-mode>.ab-item:focus{color:#fff;background-color:#bf6413}#wpadminbar .quicklinks li#wp-admin-bar-my-account.with-avatar>a img{border-color:#634c84;background-color:#634c84}#wpadminbar #wp-admin-bar-user-info .display-name{color:#fff}#wpadminbar #wp-admin-bar-user-info a:hover .display-name{color:#a3b745}#wpadminbar #wp-admin-bar-user-info .username{color:#cbc5d3}.wp-pointer .wp-pointer-content h3{background-color:#a3b745;border-color:#93a43e}.wp-pointer .wp-pointer-content h3:before{color:#a3b745}.wp-pointer.wp-pointer-top .wp-pointer-arrow,.wp-pointer.wp-pointer-top .wp-pointer-arrow-inner,.wp-pointer.wp-pointer-undefined .wp-pointer-arrow,.wp-pointer.wp-pointer-undefined .wp-pointer-arrow-inner{border-bottom-color:#a3b745}.media-item .bar,.media-progress-bar div{background-color:#a3b745}.details.attachment{box-shadow:inset 0 0 0 3px #fff,inset 0 0 0 7px #a3b745}.attachment.details .check{background-color:#a3b745;box-shadow:0 0 0 1px #fff,0 0 0 2px #a3b745}.media-selection .attachment.selection.details .thumbnail{box-shadow:0 0 0 1px #fff,0 0 0 3px #a3b745}.theme-browser .theme.active .theme-name,.theme-browser .theme.add-new-theme a:focus:after,.theme-browser .theme.add-new-theme a:hover:after{background:#a3b745}.theme-browser .theme.add-new-theme a:focus span:after,.theme-browser .theme.add-new-theme a:hover span:after{color:#a3b745}.theme-filter.current,.theme-section.current{border-bottom-color:#523f6d}body.more-filters-opened .more-filters{color:#fff;background-color:#523f6d}body.more-filters-opened .more-filters:before{color:#fff}body.more-filters-opened .more-filters:focus,body.more-filters-opened .more-filters:hover{background-color:#a3b745;color:#fff}body.more-filters-opened .more-filters:focus:before,body.more-filters-opened .more-filters:hover:before{color:#fff}.widgets-chooser li.widgets-chooser-selected{background-color:#a3b745;color:#fff}.widgets-chooser li.widgets-chooser-selected:before,.widgets-chooser li.widgets-chooser-selected:focus:before{color:#fff}div#wp-responsive-toggle a:before{color:#ece6f6}.wp-responsive-open div#wp-responsive-toggle a{border-color:transparent;background:#a3b745}.wp-responsive-open #wpadminbar #wp-admin-bar-menu-toggle a{background:#413256}.wp-responsive-open #wpadminbar #wp-admin-bar-menu-toggle .ab-icon:before{color:#ece6f6}.mce-container.mce-menu .mce-menu-item-normal.mce-active,.mce-container.mce-menu .mce-menu-item-preview.mce-active,.mce-container.mce-menu .mce-menu-item.mce-selected,.mce-container.mce-menu .mce-menu-item:focus,.mce-container.mce-menu .mce-menu-item:hover{background:#a3b745} \ No newline at end of file
diff --git a/www/crm/wp-admin/css/colors/ectoplasm/colors.scss b/www/crm/wp-admin/css/colors/ectoplasm/colors.scss
new file mode 100644
index 00000000..8d145707
--- /dev/null
+++ b/www/crm/wp-admin/css/colors/ectoplasm/colors.scss
@@ -0,0 +1,8 @@
+$base-color: #523f6d;
+$icon-color: #ece6f6;
+$highlight-color: #a3b745;
+$notification-color: #d46f15;
+
+$form-checked: $base-color;
+
+@import "../_admin.scss";
diff --git a/www/crm/wp-admin/css/colors/light/colors-rtl.css b/www/crm/wp-admin/css/colors/light/colors-rtl.css
new file mode 100644
index 00000000..3394d7a2
--- /dev/null
+++ b/www/crm/wp-admin/css/colors/light/colors-rtl.css
@@ -0,0 +1,537 @@
+/*! This file is auto-generated */
+/*
+ * Button mixin- creates 3d-ish button effect with correct
+ * highlights/shadows, based on a base color.
+ */
+body {
+ background: #f5f5f5;
+}
+
+/* Links */
+a {
+ color: #0073aa;
+}
+
+a:hover, a:active, a:focus {
+ color: #0096dd;
+}
+
+#media-upload a.del-link:hover,
+div.dashboard-widget-submit input:hover,
+.subsubsub a:hover,
+.subsubsub a.current:hover {
+ color: #0096dd;
+}
+
+/* Forms */
+input[type=checkbox]:checked:before {
+ color: #04a4cc;
+}
+
+input[type=radio]:checked:before {
+ background: #04a4cc;
+}
+
+.wp-core-ui input[type="reset"]:hover,
+.wp-core-ui input[type="reset"]:active {
+ color: #0096dd;
+}
+
+/* Core UI */
+.wp-core-ui .button-primary {
+ background: #04a4cc;
+ border-color: #037c9a #036881 #036881;
+ color: #fff;
+ box-shadow: 0 1px 0 #036881;
+ text-shadow: 0 -1px 1px #036881, -1px 0 1px #036881, 0 1px 1px #036881, 1px 0 1px #036881;
+}
+
+.wp-core-ui .button-primary:hover, .wp-core-ui .button-primary:focus {
+ background: #04b0db;
+ border-color: #036881;
+ color: #fff;
+ box-shadow: 0 1px 0 #036881;
+}
+
+.wp-core-ui .button-primary:focus {
+ box-shadow: inset 0 1px 0 #037c9a, 0 0 2px 1px #33b3db;
+}
+
+.wp-core-ui .button-primary:active, .wp-core-ui .button-primary.active, .wp-core-ui .button-primary.active:focus, .wp-core-ui .button-primary.active:hover {
+ background: #037c9a;
+ border-color: #036881;
+ box-shadow: inset 0 2px 0 #036881;
+}
+
+.wp-core-ui .button-primary[disabled], .wp-core-ui .button-primary:disabled, .wp-core-ui .button-primary.button-primary-disabled, .wp-core-ui .button-primary.disabled {
+ color: #c7cfd1 !important;
+ background: #0384a4 !important;
+ border-color: #036881 !important;
+ text-shadow: none !important;
+}
+
+.wp-core-ui .button-primary.button-hero {
+ box-shadow: 0 2px 0 #036881 !important;
+}
+
+.wp-core-ui .button-primary.button-hero:active {
+ box-shadow: inset 0 3px 0 #036881 !important;
+}
+
+.wp-core-ui .wp-ui-primary {
+ color: #333;
+ background-color: #e5e5e5;
+}
+
+.wp-core-ui .wp-ui-text-primary {
+ color: #e5e5e5;
+}
+
+.wp-core-ui .wp-ui-highlight {
+ color: #fff;
+ background-color: #888;
+}
+
+.wp-core-ui .wp-ui-text-highlight {
+ color: #888;
+}
+
+.wp-core-ui .wp-ui-notification {
+ color: #fff;
+ background-color: #d64e07;
+}
+
+.wp-core-ui .wp-ui-text-notification {
+ color: #d64e07;
+}
+
+.wp-core-ui .wp-ui-text-icon {
+ color: #999;
+}
+
+/* List tables */
+.wrap .add-new-h2:hover,
+.wrap .page-title-action:hover {
+ color: #333;
+ background-color: #e5e5e5;
+}
+
+.view-switch a.current:before {
+ color: #e5e5e5;
+}
+
+.view-switch a:hover:before {
+ color: #d64e07;
+}
+
+/* Admin Menu */
+#adminmenuback,
+#adminmenuwrap,
+#adminmenu {
+ background: #e5e5e5;
+}
+
+#adminmenu a {
+ color: #333;
+}
+
+#adminmenu div.wp-menu-image:before {
+ color: #999;
+}
+
+#adminmenu a:hover,
+#adminmenu li.menu-top:hover,
+#adminmenu li.opensub > a.menu-top,
+#adminmenu li > a.menu-top:focus {
+ color: #fff;
+ background-color: #888;
+}
+
+#adminmenu li.menu-top:hover div.wp-menu-image:before,
+#adminmenu li.opensub > a.menu-top div.wp-menu-image:before {
+ color: #ccc;
+}
+
+/* Active tabs use a bottom border color that matches the page background color. */
+.about-wrap .nav-tab-active,
+.nav-tab-active,
+.nav-tab-active:hover {
+ background-color: #f5f5f5;
+ border-bottom-color: #f5f5f5;
+}
+
+/* Admin Menu: submenu */
+#adminmenu .wp-submenu,
+#adminmenu .wp-has-current-submenu .wp-submenu,
+#adminmenu .wp-has-current-submenu.opensub .wp-submenu,
+.folded #adminmenu .wp-has-current-submenu .wp-submenu,
+#adminmenu a.wp-has-current-submenu:focus + .wp-submenu {
+ background: #fff;
+}
+
+#adminmenu li.wp-has-submenu.wp-not-current-submenu.opensub:hover:after {
+ border-left-color: #fff;
+}
+
+#adminmenu .wp-submenu .wp-submenu-head {
+ color: #686868;
+}
+
+#adminmenu .wp-submenu a,
+#adminmenu .wp-has-current-submenu .wp-submenu a,
+.folded #adminmenu .wp-has-current-submenu .wp-submenu a,
+#adminmenu a.wp-has-current-submenu:focus + .wp-submenu a,
+#adminmenu .wp-has-current-submenu.opensub .wp-submenu a {
+ color: #686868;
+}
+
+#adminmenu .wp-submenu a:focus, #adminmenu .wp-submenu a:hover,
+#adminmenu .wp-has-current-submenu .wp-submenu a:focus,
+#adminmenu .wp-has-current-submenu .wp-submenu a:hover,
+.folded #adminmenu .wp-has-current-submenu .wp-submenu a:focus,
+.folded #adminmenu .wp-has-current-submenu .wp-submenu a:hover,
+#adminmenu a.wp-has-current-submenu:focus + .wp-submenu a:focus,
+#adminmenu a.wp-has-current-submenu:focus + .wp-submenu a:hover,
+#adminmenu .wp-has-current-submenu.opensub .wp-submenu a:focus,
+#adminmenu .wp-has-current-submenu.opensub .wp-submenu a:hover {
+ color: #04a4cc;
+}
+
+/* Admin Menu: current */
+#adminmenu .wp-submenu li.current a,
+#adminmenu a.wp-has-current-submenu:focus + .wp-submenu li.current a,
+#adminmenu .wp-has-current-submenu.opensub .wp-submenu li.current a {
+ color: #333;
+}
+
+#adminmenu .wp-submenu li.current a:hover, #adminmenu .wp-submenu li.current a:focus,
+#adminmenu a.wp-has-current-submenu:focus + .wp-submenu li.current a:hover,
+#adminmenu a.wp-has-current-submenu:focus + .wp-submenu li.current a:focus,
+#adminmenu .wp-has-current-submenu.opensub .wp-submenu li.current a:hover,
+#adminmenu .wp-has-current-submenu.opensub .wp-submenu li.current a:focus {
+ color: #04a4cc;
+}
+
+ul#adminmenu a.wp-has-current-submenu:after,
+ul#adminmenu > li.current > a.current:after {
+ border-left-color: #f5f5f5;
+}
+
+#adminmenu li.current a.menu-top,
+#adminmenu li.wp-has-current-submenu a.wp-has-current-submenu,
+#adminmenu li.wp-has-current-submenu .wp-submenu .wp-submenu-head,
+.folded #adminmenu li.current.menu-top {
+ color: #fff;
+ background: #888;
+}
+
+#adminmenu li.wp-has-current-submenu div.wp-menu-image:before,
+#adminmenu a.current:hover div.wp-menu-image:before,
+#adminmenu li.wp-has-current-submenu a:focus div.wp-menu-image:before,
+#adminmenu li.wp-has-current-submenu.opensub div.wp-menu-image:before,
+#adminmenu li:hover div.wp-menu-image:before,
+#adminmenu li a:focus div.wp-menu-image:before,
+#adminmenu li.opensub div.wp-menu-image:before,
+.ie8 #adminmenu li.opensub div.wp-menu-image:before {
+ color: #ccc;
+}
+
+/* Admin Menu: bubble */
+#adminmenu .awaiting-mod,
+#adminmenu .update-plugins {
+ color: #fff;
+ background: #d64e07;
+}
+
+#adminmenu li.current a .awaiting-mod,
+#adminmenu li a.wp-has-current-submenu .update-plugins,
+#adminmenu li:hover a .awaiting-mod,
+#adminmenu li.menu-top:hover > a .update-plugins {
+ color: #333;
+ background: #fff;
+}
+
+/* Admin Menu: collapse button */
+#collapse-button {
+ color: #777;
+}
+
+#collapse-button:hover,
+#collapse-button:focus {
+ color: #04a4cc;
+}
+
+/* Admin Bar */
+#wpadminbar {
+ color: #333;
+ background: #e5e5e5;
+}
+
+#wpadminbar .ab-item,
+#wpadminbar a.ab-item,
+#wpadminbar > #wp-toolbar span.ab-label,
+#wpadminbar > #wp-toolbar span.noticon {
+ color: #333;
+}
+
+#wpadminbar .ab-icon,
+#wpadminbar .ab-icon:before,
+#wpadminbar .ab-item:before,
+#wpadminbar .ab-item:after {
+ color: #999;
+}
+
+#wpadminbar:not(.mobile) .ab-top-menu > li:hover > .ab-item,
+#wpadminbar:not(.mobile) .ab-top-menu > li > .ab-item:focus,
+#wpadminbar.nojq .quicklinks .ab-top-menu > li > .ab-item:focus,
+#wpadminbar.nojs .ab-top-menu > li.menupop:hover > .ab-item,
+#wpadminbar .ab-top-menu > li.menupop.hover > .ab-item {
+ color: #04a4cc;
+ background: #fff;
+}
+
+#wpadminbar:not(.mobile) > #wp-toolbar li:hover span.ab-label,
+#wpadminbar:not(.mobile) > #wp-toolbar li.hover span.ab-label,
+#wpadminbar:not(.mobile) > #wp-toolbar a:focus span.ab-label {
+ color: #04a4cc;
+}
+
+#wpadminbar:not(.mobile) li:hover .ab-icon:before,
+#wpadminbar:not(.mobile) li:hover .ab-item:before,
+#wpadminbar:not(.mobile) li:hover .ab-item:after,
+#wpadminbar:not(.mobile) li:hover #adminbarsearch:before {
+ color: #ccc;
+}
+
+/* Admin Bar: submenu */
+#wpadminbar .menupop .ab-sub-wrapper {
+ background: #fff;
+}
+
+#wpadminbar .quicklinks .menupop ul.ab-sub-secondary,
+#wpadminbar .quicklinks .menupop ul.ab-sub-secondary .ab-submenu {
+ background: #f7f7f7;
+}
+
+#wpadminbar .ab-submenu .ab-item,
+#wpadminbar .quicklinks .menupop ul li a,
+#wpadminbar .quicklinks .menupop.hover ul li a,
+#wpadminbar.nojs .quicklinks .menupop:hover ul li a {
+ color: #686868;
+}
+
+#wpadminbar .quicklinks li .blavatar,
+#wpadminbar .menupop .menupop > .ab-item:before {
+ color: #999;
+}
+
+#wpadminbar .quicklinks .menupop ul li a:hover,
+#wpadminbar .quicklinks .menupop ul li a:focus,
+#wpadminbar .quicklinks .menupop ul li a:hover strong,
+#wpadminbar .quicklinks .menupop ul li a:focus strong,
+#wpadminbar .quicklinks .ab-sub-wrapper .menupop.hover > a,
+#wpadminbar .quicklinks .menupop.hover ul li a:hover,
+#wpadminbar .quicklinks .menupop.hover ul li a:focus,
+#wpadminbar.nojs .quicklinks .menupop:hover ul li a:hover,
+#wpadminbar.nojs .quicklinks .menupop:hover ul li a:focus,
+#wpadminbar li:hover .ab-icon:before,
+#wpadminbar li:hover .ab-item:before,
+#wpadminbar li a:focus .ab-icon:before,
+#wpadminbar li .ab-item:focus:before,
+#wpadminbar li .ab-item:focus .ab-icon:before,
+#wpadminbar li.hover .ab-icon:before,
+#wpadminbar li.hover .ab-item:before,
+#wpadminbar li:hover #adminbarsearch:before,
+#wpadminbar li #adminbarsearch.adminbar-focused:before {
+ color: #04a4cc;
+}
+
+#wpadminbar .quicklinks li a:hover .blavatar,
+#wpadminbar .quicklinks li a:focus .blavatar,
+#wpadminbar .quicklinks .ab-sub-wrapper .menupop.hover > a .blavatar,
+#wpadminbar .menupop .menupop > .ab-item:hover:before,
+#wpadminbar.mobile .quicklinks .ab-icon:before,
+#wpadminbar.mobile .quicklinks .ab-item:before {
+ color: #04a4cc;
+}
+
+#wpadminbar.mobile .quicklinks .hover .ab-icon:before,
+#wpadminbar.mobile .quicklinks .hover .ab-item:before {
+ color: #999;
+}
+
+/* Admin Bar: search */
+#wpadminbar #adminbarsearch:before {
+ color: #999;
+}
+
+#wpadminbar > #wp-toolbar > #wp-admin-bar-top-secondary > #wp-admin-bar-search #adminbarsearch input.adminbar-input:focus {
+ color: #333;
+ background: #f7f7f7;
+}
+
+/* Admin Bar: recovery mode */
+#wpadminbar #wp-admin-bar-recovery-mode {
+ color: #fff;
+ background-color: #d64e07;
+}
+
+#wpadminbar #wp-admin-bar-recovery-mode .ab-item,
+#wpadminbar #wp-admin-bar-recovery-mode a.ab-item {
+ color: #fff;
+}
+
+#wpadminbar .ab-top-menu > #wp-admin-bar-recovery-mode.hover > .ab-item,
+#wpadminbar.nojq .quicklinks .ab-top-menu > #wp-admin-bar-recovery-mode > .ab-item:focus,
+#wpadminbar:not(.mobile) .ab-top-menu > #wp-admin-bar-recovery-mode:hover > .ab-item,
+#wpadminbar:not(.mobile) .ab-top-menu > #wp-admin-bar-recovery-mode > .ab-item:focus {
+ color: #fff;
+ background-color: #c14606;
+}
+
+/* Admin Bar: my account */
+#wpadminbar .quicklinks li#wp-admin-bar-my-account.with-avatar > a img {
+ border-color: #f7f7f7;
+ background-color: #f7f7f7;
+}
+
+#wpadminbar #wp-admin-bar-user-info .display-name {
+ color: #333;
+}
+
+#wpadminbar #wp-admin-bar-user-info a:hover .display-name {
+ color: #04a4cc;
+}
+
+#wpadminbar #wp-admin-bar-user-info .username {
+ color: #686868;
+}
+
+/* Pointers */
+.wp-pointer .wp-pointer-content h3 {
+ background-color: #04a4cc;
+ border-color: #0490b3;
+}
+
+.wp-pointer .wp-pointer-content h3:before {
+ color: #04a4cc;
+}
+
+.wp-pointer.wp-pointer-top .wp-pointer-arrow,
+.wp-pointer.wp-pointer-top .wp-pointer-arrow-inner,
+.wp-pointer.wp-pointer-undefined .wp-pointer-arrow,
+.wp-pointer.wp-pointer-undefined .wp-pointer-arrow-inner {
+ border-bottom-color: #04a4cc;
+}
+
+/* Media */
+.media-item .bar,
+.media-progress-bar div {
+ background-color: #04a4cc;
+}
+
+.details.attachment {
+ box-shadow: inset 0 0 0 3px #fff, inset 0 0 0 7px #04a4cc;
+}
+
+.attachment.details .check {
+ background-color: #04a4cc;
+ box-shadow: 0 0 0 1px #fff, 0 0 0 2px #04a4cc;
+}
+
+.media-selection .attachment.selection.details .thumbnail {
+ box-shadow: 0 0 0 1px #fff, 0 0 0 3px #04a4cc;
+}
+
+/* Themes */
+.theme-browser .theme.active .theme-name,
+.theme-browser .theme.add-new-theme a:hover:after,
+.theme-browser .theme.add-new-theme a:focus:after {
+ background: #04a4cc;
+}
+
+.theme-browser .theme.add-new-theme a:hover span:after,
+.theme-browser .theme.add-new-theme a:focus span:after {
+ color: #04a4cc;
+}
+
+.theme-section.current,
+.theme-filter.current {
+ border-bottom-color: #e5e5e5;
+}
+
+body.more-filters-opened .more-filters {
+ color: #333;
+ background-color: #e5e5e5;
+}
+
+body.more-filters-opened .more-filters:before {
+ color: #333;
+}
+
+body.more-filters-opened .more-filters:hover,
+body.more-filters-opened .more-filters:focus {
+ background-color: #888;
+ color: #fff;
+}
+
+body.more-filters-opened .more-filters:hover:before,
+body.more-filters-opened .more-filters:focus:before {
+ color: #fff;
+}
+
+/* Widgets */
+.widgets-chooser li.widgets-chooser-selected {
+ background-color: #888;
+ color: #fff;
+}
+
+.widgets-chooser li.widgets-chooser-selected:before,
+.widgets-chooser li.widgets-chooser-selected:focus:before {
+ color: #fff;
+}
+
+/* Responsive Component */
+div#wp-responsive-toggle a:before {
+ color: #999;
+}
+
+.wp-responsive-open div#wp-responsive-toggle a {
+ border-color: transparent;
+ background: #888;
+}
+
+.wp-responsive-open #wpadminbar #wp-admin-bar-menu-toggle a {
+ background: #fff;
+}
+
+.wp-responsive-open #wpadminbar #wp-admin-bar-menu-toggle .ab-icon:before {
+ color: #999;
+}
+
+/* TinyMCE */
+.mce-container.mce-menu .mce-menu-item:hover,
+.mce-container.mce-menu .mce-menu-item.mce-selected,
+.mce-container.mce-menu .mce-menu-item:focus,
+.mce-container.mce-menu .mce-menu-item-normal.mce-active,
+.mce-container.mce-menu .mce-menu-item-preview.mce-active {
+ background: #04a4cc;
+}
+
+/* temporary fix for admin-bar hover color */
+#wpadminbar .ab-top-menu > li:hover > .ab-item,
+#wpadminbar .ab-top-menu > li.hover > .ab-item,
+#wpadminbar > #wp-toolbar > #wp-admin-bar-root-default li:hover span.ab-label,
+#wpadminbar > #wp-toolbar > #wp-admin-bar-top-secondary li.hover span.ab-label,
+#wpadminbar .ab-top-menu > li > .ab-item:focus,
+#wpadminbar.nojq .quicklinks .ab-top-menu > li > .ab-item:focus,
+#wpadminbar.nojs .ab-top-menu > li.menupop:hover > .ab-item,
+#wpadminbar .ab-top-menu > li.menupop.hover > .ab-item {
+ color: #333;
+}
+
+/* Override the theme filter highlight color for this scheme */
+.theme-section.current,
+.theme-filter.current {
+ border-bottom-color: #04a4cc;
+}
diff --git a/www/crm/wp-admin/css/colors/light/colors-rtl.min.css b/www/crm/wp-admin/css/colors/light/colors-rtl.min.css
new file mode 100644
index 00000000..2307a6b5
--- /dev/null
+++ b/www/crm/wp-admin/css/colors/light/colors-rtl.min.css
@@ -0,0 +1,2 @@
+/*! This file is auto-generated */
+body{background:#f5f5f5}a{color:#0073aa}a:active,a:focus,a:hover{color:#0096dd}#media-upload a.del-link:hover,.subsubsub a.current:hover,.subsubsub a:hover,div.dashboard-widget-submit input:hover{color:#0096dd}input[type=checkbox]:checked:before{color:#04a4cc}input[type=radio]:checked:before{background:#04a4cc}.wp-core-ui input[type=reset]:active,.wp-core-ui input[type=reset]:hover{color:#0096dd}.wp-core-ui .button-primary{background:#04a4cc;border-color:#037c9a #036881 #036881;color:#fff;box-shadow:0 1px 0 #036881;text-shadow:0 -1px 1px #036881,-1px 0 1px #036881,0 1px 1px #036881,1px 0 1px #036881}.wp-core-ui .button-primary:focus,.wp-core-ui .button-primary:hover{background:#04b0db;border-color:#036881;color:#fff;box-shadow:0 1px 0 #036881}.wp-core-ui .button-primary:focus{box-shadow:inset 0 1px 0 #037c9a,0 0 2px 1px #33b3db}.wp-core-ui .button-primary.active,.wp-core-ui .button-primary.active:focus,.wp-core-ui .button-primary.active:hover,.wp-core-ui .button-primary:active{background:#037c9a;border-color:#036881;box-shadow:inset 0 2px 0 #036881}.wp-core-ui .button-primary.button-primary-disabled,.wp-core-ui .button-primary.disabled,.wp-core-ui .button-primary:disabled,.wp-core-ui .button-primary[disabled]{color:#c7cfd1!important;background:#0384a4!important;border-color:#036881!important;text-shadow:none!important}.wp-core-ui .button-primary.button-hero{box-shadow:0 2px 0 #036881!important}.wp-core-ui .button-primary.button-hero:active{box-shadow:inset 0 3px 0 #036881!important}.wp-core-ui .wp-ui-primary{color:#333;background-color:#e5e5e5}.wp-core-ui .wp-ui-text-primary{color:#e5e5e5}.wp-core-ui .wp-ui-highlight{color:#fff;background-color:#888}.wp-core-ui .wp-ui-text-highlight{color:#888}.wp-core-ui .wp-ui-notification{color:#fff;background-color:#d64e07}.wp-core-ui .wp-ui-text-notification{color:#d64e07}.wp-core-ui .wp-ui-text-icon{color:#999}.wrap .add-new-h2:hover,.wrap .page-title-action:hover{color:#333;background-color:#e5e5e5}.view-switch a.current:before{color:#e5e5e5}.view-switch a:hover:before{color:#d64e07}#adminmenu,#adminmenuback,#adminmenuwrap{background:#e5e5e5}#adminmenu a{color:#333}#adminmenu div.wp-menu-image:before{color:#999}#adminmenu a:hover,#adminmenu li.menu-top:hover,#adminmenu li.opensub>a.menu-top,#adminmenu li>a.menu-top:focus{color:#fff;background-color:#888}#adminmenu li.menu-top:hover div.wp-menu-image:before,#adminmenu li.opensub>a.menu-top div.wp-menu-image:before{color:#ccc}.about-wrap .nav-tab-active,.nav-tab-active,.nav-tab-active:hover{background-color:#f5f5f5;border-bottom-color:#f5f5f5}#adminmenu .wp-has-current-submenu .wp-submenu,#adminmenu .wp-has-current-submenu.opensub .wp-submenu,#adminmenu .wp-submenu,#adminmenu a.wp-has-current-submenu:focus+.wp-submenu,.folded #adminmenu .wp-has-current-submenu .wp-submenu{background:#fff}#adminmenu li.wp-has-submenu.wp-not-current-submenu.opensub:hover:after{border-left-color:#fff}#adminmenu .wp-submenu .wp-submenu-head{color:#686868}#adminmenu .wp-has-current-submenu .wp-submenu a,#adminmenu .wp-has-current-submenu.opensub .wp-submenu a,#adminmenu .wp-submenu a,#adminmenu a.wp-has-current-submenu:focus+.wp-submenu a,.folded #adminmenu .wp-has-current-submenu .wp-submenu a{color:#686868}#adminmenu .wp-has-current-submenu .wp-submenu a:focus,#adminmenu .wp-has-current-submenu .wp-submenu a:hover,#adminmenu .wp-has-current-submenu.opensub .wp-submenu a:focus,#adminmenu .wp-has-current-submenu.opensub .wp-submenu a:hover,#adminmenu .wp-submenu a:focus,#adminmenu .wp-submenu a:hover,#adminmenu a.wp-has-current-submenu:focus+.wp-submenu a:focus,#adminmenu a.wp-has-current-submenu:focus+.wp-submenu a:hover,.folded #adminmenu .wp-has-current-submenu .wp-submenu a:focus,.folded #adminmenu .wp-has-current-submenu .wp-submenu a:hover{color:#04a4cc}#adminmenu .wp-has-current-submenu.opensub .wp-submenu li.current a,#adminmenu .wp-submenu li.current a,#adminmenu a.wp-has-current-submenu:focus+.wp-submenu li.current a{color:#333}#adminmenu .wp-has-current-submenu.opensub .wp-submenu li.current a:focus,#adminmenu .wp-has-current-submenu.opensub .wp-submenu li.current a:hover,#adminmenu .wp-submenu li.current a:focus,#adminmenu .wp-submenu li.current a:hover,#adminmenu a.wp-has-current-submenu:focus+.wp-submenu li.current a:focus,#adminmenu a.wp-has-current-submenu:focus+.wp-submenu li.current a:hover{color:#04a4cc}ul#adminmenu a.wp-has-current-submenu:after,ul#adminmenu>li.current>a.current:after{border-left-color:#f5f5f5}#adminmenu li.current a.menu-top,#adminmenu li.wp-has-current-submenu .wp-submenu .wp-submenu-head,#adminmenu li.wp-has-current-submenu a.wp-has-current-submenu,.folded #adminmenu li.current.menu-top{color:#fff;background:#888}#adminmenu a.current:hover div.wp-menu-image:before,#adminmenu li a:focus div.wp-menu-image:before,#adminmenu li.opensub div.wp-menu-image:before,#adminmenu li.wp-has-current-submenu a:focus div.wp-menu-image:before,#adminmenu li.wp-has-current-submenu div.wp-menu-image:before,#adminmenu li.wp-has-current-submenu.opensub div.wp-menu-image:before,#adminmenu li:hover div.wp-menu-image:before,.ie8 #adminmenu li.opensub div.wp-menu-image:before{color:#ccc}#adminmenu .awaiting-mod,#adminmenu .update-plugins{color:#fff;background:#d64e07}#adminmenu li a.wp-has-current-submenu .update-plugins,#adminmenu li.current a .awaiting-mod,#adminmenu li.menu-top:hover>a .update-plugins,#adminmenu li:hover a .awaiting-mod{color:#333;background:#fff}#collapse-button{color:#777}#collapse-button:focus,#collapse-button:hover{color:#04a4cc}#wpadminbar{color:#333;background:#e5e5e5}#wpadminbar .ab-item,#wpadminbar a.ab-item,#wpadminbar>#wp-toolbar span.ab-label,#wpadminbar>#wp-toolbar span.noticon{color:#333}#wpadminbar .ab-icon,#wpadminbar .ab-icon:before,#wpadminbar .ab-item:after,#wpadminbar .ab-item:before{color:#999}#wpadminbar .ab-top-menu>li.menupop.hover>.ab-item,#wpadminbar.nojq .quicklinks .ab-top-menu>li>.ab-item:focus,#wpadminbar.nojs .ab-top-menu>li.menupop:hover>.ab-item,#wpadminbar:not(.mobile) .ab-top-menu>li:hover>.ab-item,#wpadminbar:not(.mobile) .ab-top-menu>li>.ab-item:focus{color:#04a4cc;background:#fff}#wpadminbar:not(.mobile)>#wp-toolbar a:focus span.ab-label,#wpadminbar:not(.mobile)>#wp-toolbar li.hover span.ab-label,#wpadminbar:not(.mobile)>#wp-toolbar li:hover span.ab-label{color:#04a4cc}#wpadminbar:not(.mobile) li:hover #adminbarsearch:before,#wpadminbar:not(.mobile) li:hover .ab-icon:before,#wpadminbar:not(.mobile) li:hover .ab-item:after,#wpadminbar:not(.mobile) li:hover .ab-item:before{color:#ccc}#wpadminbar .menupop .ab-sub-wrapper{background:#fff}#wpadminbar .quicklinks .menupop ul.ab-sub-secondary,#wpadminbar .quicklinks .menupop ul.ab-sub-secondary .ab-submenu{background:#f7f7f7}#wpadminbar .ab-submenu .ab-item,#wpadminbar .quicklinks .menupop ul li a,#wpadminbar .quicklinks .menupop.hover ul li a,#wpadminbar.nojs .quicklinks .menupop:hover ul li a{color:#686868}#wpadminbar .menupop .menupop>.ab-item:before,#wpadminbar .quicklinks li .blavatar{color:#999}#wpadminbar .quicklinks .ab-sub-wrapper .menupop.hover>a,#wpadminbar .quicklinks .menupop ul li a:focus,#wpadminbar .quicklinks .menupop ul li a:focus strong,#wpadminbar .quicklinks .menupop ul li a:hover,#wpadminbar .quicklinks .menupop ul li a:hover strong,#wpadminbar .quicklinks .menupop.hover ul li a:focus,#wpadminbar .quicklinks .menupop.hover ul li a:hover,#wpadminbar li #adminbarsearch.adminbar-focused:before,#wpadminbar li .ab-item:focus .ab-icon:before,#wpadminbar li .ab-item:focus:before,#wpadminbar li a:focus .ab-icon:before,#wpadminbar li.hover .ab-icon:before,#wpadminbar li.hover .ab-item:before,#wpadminbar li:hover #adminbarsearch:before,#wpadminbar li:hover .ab-icon:before,#wpadminbar li:hover .ab-item:before,#wpadminbar.nojs .quicklinks .menupop:hover ul li a:focus,#wpadminbar.nojs .quicklinks .menupop:hover ul li a:hover{color:#04a4cc}#wpadminbar .menupop .menupop>.ab-item:hover:before,#wpadminbar .quicklinks .ab-sub-wrapper .menupop.hover>a .blavatar,#wpadminbar .quicklinks li a:focus .blavatar,#wpadminbar .quicklinks li a:hover .blavatar,#wpadminbar.mobile .quicklinks .ab-icon:before,#wpadminbar.mobile .quicklinks .ab-item:before{color:#04a4cc}#wpadminbar.mobile .quicklinks .hover .ab-icon:before,#wpadminbar.mobile .quicklinks .hover .ab-item:before{color:#999}#wpadminbar #adminbarsearch:before{color:#999}#wpadminbar>#wp-toolbar>#wp-admin-bar-top-secondary>#wp-admin-bar-search #adminbarsearch input.adminbar-input:focus{color:#333;background:#f7f7f7}#wpadminbar #wp-admin-bar-recovery-mode{color:#fff;background-color:#d64e07}#wpadminbar #wp-admin-bar-recovery-mode .ab-item,#wpadminbar #wp-admin-bar-recovery-mode a.ab-item{color:#fff}#wpadminbar .ab-top-menu>#wp-admin-bar-recovery-mode.hover>.ab-item,#wpadminbar.nojq .quicklinks .ab-top-menu>#wp-admin-bar-recovery-mode>.ab-item:focus,#wpadminbar:not(.mobile) .ab-top-menu>#wp-admin-bar-recovery-mode:hover>.ab-item,#wpadminbar:not(.mobile) .ab-top-menu>#wp-admin-bar-recovery-mode>.ab-item:focus{color:#fff;background-color:#c14606}#wpadminbar .quicklinks li#wp-admin-bar-my-account.with-avatar>a img{border-color:#f7f7f7;background-color:#f7f7f7}#wpadminbar #wp-admin-bar-user-info .display-name{color:#333}#wpadminbar #wp-admin-bar-user-info a:hover .display-name{color:#04a4cc}#wpadminbar #wp-admin-bar-user-info .username{color:#686868}.wp-pointer .wp-pointer-content h3{background-color:#04a4cc;border-color:#0490b3}.wp-pointer .wp-pointer-content h3:before{color:#04a4cc}.wp-pointer.wp-pointer-top .wp-pointer-arrow,.wp-pointer.wp-pointer-top .wp-pointer-arrow-inner,.wp-pointer.wp-pointer-undefined .wp-pointer-arrow,.wp-pointer.wp-pointer-undefined .wp-pointer-arrow-inner{border-bottom-color:#04a4cc}.media-item .bar,.media-progress-bar div{background-color:#04a4cc}.details.attachment{box-shadow:inset 0 0 0 3px #fff,inset 0 0 0 7px #04a4cc}.attachment.details .check{background-color:#04a4cc;box-shadow:0 0 0 1px #fff,0 0 0 2px #04a4cc}.media-selection .attachment.selection.details .thumbnail{box-shadow:0 0 0 1px #fff,0 0 0 3px #04a4cc}.theme-browser .theme.active .theme-name,.theme-browser .theme.add-new-theme a:focus:after,.theme-browser .theme.add-new-theme a:hover:after{background:#04a4cc}.theme-browser .theme.add-new-theme a:focus span:after,.theme-browser .theme.add-new-theme a:hover span:after{color:#04a4cc}.theme-filter.current,.theme-section.current{border-bottom-color:#e5e5e5}body.more-filters-opened .more-filters{color:#333;background-color:#e5e5e5}body.more-filters-opened .more-filters:before{color:#333}body.more-filters-opened .more-filters:focus,body.more-filters-opened .more-filters:hover{background-color:#888;color:#fff}body.more-filters-opened .more-filters:focus:before,body.more-filters-opened .more-filters:hover:before{color:#fff}.widgets-chooser li.widgets-chooser-selected{background-color:#888;color:#fff}.widgets-chooser li.widgets-chooser-selected:before,.widgets-chooser li.widgets-chooser-selected:focus:before{color:#fff}div#wp-responsive-toggle a:before{color:#999}.wp-responsive-open div#wp-responsive-toggle a{border-color:transparent;background:#888}.wp-responsive-open #wpadminbar #wp-admin-bar-menu-toggle a{background:#fff}.wp-responsive-open #wpadminbar #wp-admin-bar-menu-toggle .ab-icon:before{color:#999}.mce-container.mce-menu .mce-menu-item-normal.mce-active,.mce-container.mce-menu .mce-menu-item-preview.mce-active,.mce-container.mce-menu .mce-menu-item.mce-selected,.mce-container.mce-menu .mce-menu-item:focus,.mce-container.mce-menu .mce-menu-item:hover{background:#04a4cc}#wpadminbar .ab-top-menu>li.hover>.ab-item,#wpadminbar .ab-top-menu>li.menupop.hover>.ab-item,#wpadminbar .ab-top-menu>li:hover>.ab-item,#wpadminbar .ab-top-menu>li>.ab-item:focus,#wpadminbar.nojq .quicklinks .ab-top-menu>li>.ab-item:focus,#wpadminbar.nojs .ab-top-menu>li.menupop:hover>.ab-item,#wpadminbar>#wp-toolbar>#wp-admin-bar-root-default li:hover span.ab-label,#wpadminbar>#wp-toolbar>#wp-admin-bar-top-secondary li.hover span.ab-label{color:#333}.theme-filter.current,.theme-section.current{border-bottom-color:#04a4cc} \ No newline at end of file
diff --git a/www/crm/wp-admin/css/colors/light/colors.css b/www/crm/wp-admin/css/colors/light/colors.css
new file mode 100644
index 00000000..1d02d6d0
--- /dev/null
+++ b/www/crm/wp-admin/css/colors/light/colors.css
@@ -0,0 +1,537 @@
+/*! This file is auto-generated */
+/*
+ * Button mixin- creates 3d-ish button effect with correct
+ * highlights/shadows, based on a base color.
+ */
+body {
+ background: #f5f5f5;
+}
+
+/* Links */
+a {
+ color: #0073aa;
+}
+
+a:hover, a:active, a:focus {
+ color: #0096dd;
+}
+
+#media-upload a.del-link:hover,
+div.dashboard-widget-submit input:hover,
+.subsubsub a:hover,
+.subsubsub a.current:hover {
+ color: #0096dd;
+}
+
+/* Forms */
+input[type=checkbox]:checked:before {
+ color: #04a4cc;
+}
+
+input[type=radio]:checked:before {
+ background: #04a4cc;
+}
+
+.wp-core-ui input[type="reset"]:hover,
+.wp-core-ui input[type="reset"]:active {
+ color: #0096dd;
+}
+
+/* Core UI */
+.wp-core-ui .button-primary {
+ background: #04a4cc;
+ border-color: #037c9a #036881 #036881;
+ color: #fff;
+ box-shadow: 0 1px 0 #036881;
+ text-shadow: 0 -1px 1px #036881, 1px 0 1px #036881, 0 1px 1px #036881, -1px 0 1px #036881;
+}
+
+.wp-core-ui .button-primary:hover, .wp-core-ui .button-primary:focus {
+ background: #04b0db;
+ border-color: #036881;
+ color: #fff;
+ box-shadow: 0 1px 0 #036881;
+}
+
+.wp-core-ui .button-primary:focus {
+ box-shadow: inset 0 1px 0 #037c9a, 0 0 2px 1px #33b3db;
+}
+
+.wp-core-ui .button-primary:active, .wp-core-ui .button-primary.active, .wp-core-ui .button-primary.active:focus, .wp-core-ui .button-primary.active:hover {
+ background: #037c9a;
+ border-color: #036881;
+ box-shadow: inset 0 2px 0 #036881;
+}
+
+.wp-core-ui .button-primary[disabled], .wp-core-ui .button-primary:disabled, .wp-core-ui .button-primary.button-primary-disabled, .wp-core-ui .button-primary.disabled {
+ color: #c7cfd1 !important;
+ background: #0384a4 !important;
+ border-color: #036881 !important;
+ text-shadow: none !important;
+}
+
+.wp-core-ui .button-primary.button-hero {
+ box-shadow: 0 2px 0 #036881 !important;
+}
+
+.wp-core-ui .button-primary.button-hero:active {
+ box-shadow: inset 0 3px 0 #036881 !important;
+}
+
+.wp-core-ui .wp-ui-primary {
+ color: #333;
+ background-color: #e5e5e5;
+}
+
+.wp-core-ui .wp-ui-text-primary {
+ color: #e5e5e5;
+}
+
+.wp-core-ui .wp-ui-highlight {
+ color: #fff;
+ background-color: #888;
+}
+
+.wp-core-ui .wp-ui-text-highlight {
+ color: #888;
+}
+
+.wp-core-ui .wp-ui-notification {
+ color: #fff;
+ background-color: #d64e07;
+}
+
+.wp-core-ui .wp-ui-text-notification {
+ color: #d64e07;
+}
+
+.wp-core-ui .wp-ui-text-icon {
+ color: #999;
+}
+
+/* List tables */
+.wrap .add-new-h2:hover,
+.wrap .page-title-action:hover {
+ color: #333;
+ background-color: #e5e5e5;
+}
+
+.view-switch a.current:before {
+ color: #e5e5e5;
+}
+
+.view-switch a:hover:before {
+ color: #d64e07;
+}
+
+/* Admin Menu */
+#adminmenuback,
+#adminmenuwrap,
+#adminmenu {
+ background: #e5e5e5;
+}
+
+#adminmenu a {
+ color: #333;
+}
+
+#adminmenu div.wp-menu-image:before {
+ color: #999;
+}
+
+#adminmenu a:hover,
+#adminmenu li.menu-top:hover,
+#adminmenu li.opensub > a.menu-top,
+#adminmenu li > a.menu-top:focus {
+ color: #fff;
+ background-color: #888;
+}
+
+#adminmenu li.menu-top:hover div.wp-menu-image:before,
+#adminmenu li.opensub > a.menu-top div.wp-menu-image:before {
+ color: #ccc;
+}
+
+/* Active tabs use a bottom border color that matches the page background color. */
+.about-wrap .nav-tab-active,
+.nav-tab-active,
+.nav-tab-active:hover {
+ background-color: #f5f5f5;
+ border-bottom-color: #f5f5f5;
+}
+
+/* Admin Menu: submenu */
+#adminmenu .wp-submenu,
+#adminmenu .wp-has-current-submenu .wp-submenu,
+#adminmenu .wp-has-current-submenu.opensub .wp-submenu,
+.folded #adminmenu .wp-has-current-submenu .wp-submenu,
+#adminmenu a.wp-has-current-submenu:focus + .wp-submenu {
+ background: #fff;
+}
+
+#adminmenu li.wp-has-submenu.wp-not-current-submenu.opensub:hover:after {
+ border-right-color: #fff;
+}
+
+#adminmenu .wp-submenu .wp-submenu-head {
+ color: #686868;
+}
+
+#adminmenu .wp-submenu a,
+#adminmenu .wp-has-current-submenu .wp-submenu a,
+.folded #adminmenu .wp-has-current-submenu .wp-submenu a,
+#adminmenu a.wp-has-current-submenu:focus + .wp-submenu a,
+#adminmenu .wp-has-current-submenu.opensub .wp-submenu a {
+ color: #686868;
+}
+
+#adminmenu .wp-submenu a:focus, #adminmenu .wp-submenu a:hover,
+#adminmenu .wp-has-current-submenu .wp-submenu a:focus,
+#adminmenu .wp-has-current-submenu .wp-submenu a:hover,
+.folded #adminmenu .wp-has-current-submenu .wp-submenu a:focus,
+.folded #adminmenu .wp-has-current-submenu .wp-submenu a:hover,
+#adminmenu a.wp-has-current-submenu:focus + .wp-submenu a:focus,
+#adminmenu a.wp-has-current-submenu:focus + .wp-submenu a:hover,
+#adminmenu .wp-has-current-submenu.opensub .wp-submenu a:focus,
+#adminmenu .wp-has-current-submenu.opensub .wp-submenu a:hover {
+ color: #04a4cc;
+}
+
+/* Admin Menu: current */
+#adminmenu .wp-submenu li.current a,
+#adminmenu a.wp-has-current-submenu:focus + .wp-submenu li.current a,
+#adminmenu .wp-has-current-submenu.opensub .wp-submenu li.current a {
+ color: #333;
+}
+
+#adminmenu .wp-submenu li.current a:hover, #adminmenu .wp-submenu li.current a:focus,
+#adminmenu a.wp-has-current-submenu:focus + .wp-submenu li.current a:hover,
+#adminmenu a.wp-has-current-submenu:focus + .wp-submenu li.current a:focus,
+#adminmenu .wp-has-current-submenu.opensub .wp-submenu li.current a:hover,
+#adminmenu .wp-has-current-submenu.opensub .wp-submenu li.current a:focus {
+ color: #04a4cc;
+}
+
+ul#adminmenu a.wp-has-current-submenu:after,
+ul#adminmenu > li.current > a.current:after {
+ border-right-color: #f5f5f5;
+}
+
+#adminmenu li.current a.menu-top,
+#adminmenu li.wp-has-current-submenu a.wp-has-current-submenu,
+#adminmenu li.wp-has-current-submenu .wp-submenu .wp-submenu-head,
+.folded #adminmenu li.current.menu-top {
+ color: #fff;
+ background: #888;
+}
+
+#adminmenu li.wp-has-current-submenu div.wp-menu-image:before,
+#adminmenu a.current:hover div.wp-menu-image:before,
+#adminmenu li.wp-has-current-submenu a:focus div.wp-menu-image:before,
+#adminmenu li.wp-has-current-submenu.opensub div.wp-menu-image:before,
+#adminmenu li:hover div.wp-menu-image:before,
+#adminmenu li a:focus div.wp-menu-image:before,
+#adminmenu li.opensub div.wp-menu-image:before,
+.ie8 #adminmenu li.opensub div.wp-menu-image:before {
+ color: #ccc;
+}
+
+/* Admin Menu: bubble */
+#adminmenu .awaiting-mod,
+#adminmenu .update-plugins {
+ color: #fff;
+ background: #d64e07;
+}
+
+#adminmenu li.current a .awaiting-mod,
+#adminmenu li a.wp-has-current-submenu .update-plugins,
+#adminmenu li:hover a .awaiting-mod,
+#adminmenu li.menu-top:hover > a .update-plugins {
+ color: #333;
+ background: #fff;
+}
+
+/* Admin Menu: collapse button */
+#collapse-button {
+ color: #777;
+}
+
+#collapse-button:hover,
+#collapse-button:focus {
+ color: #04a4cc;
+}
+
+/* Admin Bar */
+#wpadminbar {
+ color: #333;
+ background: #e5e5e5;
+}
+
+#wpadminbar .ab-item,
+#wpadminbar a.ab-item,
+#wpadminbar > #wp-toolbar span.ab-label,
+#wpadminbar > #wp-toolbar span.noticon {
+ color: #333;
+}
+
+#wpadminbar .ab-icon,
+#wpadminbar .ab-icon:before,
+#wpadminbar .ab-item:before,
+#wpadminbar .ab-item:after {
+ color: #999;
+}
+
+#wpadminbar:not(.mobile) .ab-top-menu > li:hover > .ab-item,
+#wpadminbar:not(.mobile) .ab-top-menu > li > .ab-item:focus,
+#wpadminbar.nojq .quicklinks .ab-top-menu > li > .ab-item:focus,
+#wpadminbar.nojs .ab-top-menu > li.menupop:hover > .ab-item,
+#wpadminbar .ab-top-menu > li.menupop.hover > .ab-item {
+ color: #04a4cc;
+ background: #fff;
+}
+
+#wpadminbar:not(.mobile) > #wp-toolbar li:hover span.ab-label,
+#wpadminbar:not(.mobile) > #wp-toolbar li.hover span.ab-label,
+#wpadminbar:not(.mobile) > #wp-toolbar a:focus span.ab-label {
+ color: #04a4cc;
+}
+
+#wpadminbar:not(.mobile) li:hover .ab-icon:before,
+#wpadminbar:not(.mobile) li:hover .ab-item:before,
+#wpadminbar:not(.mobile) li:hover .ab-item:after,
+#wpadminbar:not(.mobile) li:hover #adminbarsearch:before {
+ color: #ccc;
+}
+
+/* Admin Bar: submenu */
+#wpadminbar .menupop .ab-sub-wrapper {
+ background: #fff;
+}
+
+#wpadminbar .quicklinks .menupop ul.ab-sub-secondary,
+#wpadminbar .quicklinks .menupop ul.ab-sub-secondary .ab-submenu {
+ background: #f7f7f7;
+}
+
+#wpadminbar .ab-submenu .ab-item,
+#wpadminbar .quicklinks .menupop ul li a,
+#wpadminbar .quicklinks .menupop.hover ul li a,
+#wpadminbar.nojs .quicklinks .menupop:hover ul li a {
+ color: #686868;
+}
+
+#wpadminbar .quicklinks li .blavatar,
+#wpadminbar .menupop .menupop > .ab-item:before {
+ color: #999;
+}
+
+#wpadminbar .quicklinks .menupop ul li a:hover,
+#wpadminbar .quicklinks .menupop ul li a:focus,
+#wpadminbar .quicklinks .menupop ul li a:hover strong,
+#wpadminbar .quicklinks .menupop ul li a:focus strong,
+#wpadminbar .quicklinks .ab-sub-wrapper .menupop.hover > a,
+#wpadminbar .quicklinks .menupop.hover ul li a:hover,
+#wpadminbar .quicklinks .menupop.hover ul li a:focus,
+#wpadminbar.nojs .quicklinks .menupop:hover ul li a:hover,
+#wpadminbar.nojs .quicklinks .menupop:hover ul li a:focus,
+#wpadminbar li:hover .ab-icon:before,
+#wpadminbar li:hover .ab-item:before,
+#wpadminbar li a:focus .ab-icon:before,
+#wpadminbar li .ab-item:focus:before,
+#wpadminbar li .ab-item:focus .ab-icon:before,
+#wpadminbar li.hover .ab-icon:before,
+#wpadminbar li.hover .ab-item:before,
+#wpadminbar li:hover #adminbarsearch:before,
+#wpadminbar li #adminbarsearch.adminbar-focused:before {
+ color: #04a4cc;
+}
+
+#wpadminbar .quicklinks li a:hover .blavatar,
+#wpadminbar .quicklinks li a:focus .blavatar,
+#wpadminbar .quicklinks .ab-sub-wrapper .menupop.hover > a .blavatar,
+#wpadminbar .menupop .menupop > .ab-item:hover:before,
+#wpadminbar.mobile .quicklinks .ab-icon:before,
+#wpadminbar.mobile .quicklinks .ab-item:before {
+ color: #04a4cc;
+}
+
+#wpadminbar.mobile .quicklinks .hover .ab-icon:before,
+#wpadminbar.mobile .quicklinks .hover .ab-item:before {
+ color: #999;
+}
+
+/* Admin Bar: search */
+#wpadminbar #adminbarsearch:before {
+ color: #999;
+}
+
+#wpadminbar > #wp-toolbar > #wp-admin-bar-top-secondary > #wp-admin-bar-search #adminbarsearch input.adminbar-input:focus {
+ color: #333;
+ background: #f7f7f7;
+}
+
+/* Admin Bar: recovery mode */
+#wpadminbar #wp-admin-bar-recovery-mode {
+ color: #fff;
+ background-color: #d64e07;
+}
+
+#wpadminbar #wp-admin-bar-recovery-mode .ab-item,
+#wpadminbar #wp-admin-bar-recovery-mode a.ab-item {
+ color: #fff;
+}
+
+#wpadminbar .ab-top-menu > #wp-admin-bar-recovery-mode.hover > .ab-item,
+#wpadminbar.nojq .quicklinks .ab-top-menu > #wp-admin-bar-recovery-mode > .ab-item:focus,
+#wpadminbar:not(.mobile) .ab-top-menu > #wp-admin-bar-recovery-mode:hover > .ab-item,
+#wpadminbar:not(.mobile) .ab-top-menu > #wp-admin-bar-recovery-mode > .ab-item:focus {
+ color: #fff;
+ background-color: #c14606;
+}
+
+/* Admin Bar: my account */
+#wpadminbar .quicklinks li#wp-admin-bar-my-account.with-avatar > a img {
+ border-color: #f7f7f7;
+ background-color: #f7f7f7;
+}
+
+#wpadminbar #wp-admin-bar-user-info .display-name {
+ color: #333;
+}
+
+#wpadminbar #wp-admin-bar-user-info a:hover .display-name {
+ color: #04a4cc;
+}
+
+#wpadminbar #wp-admin-bar-user-info .username {
+ color: #686868;
+}
+
+/* Pointers */
+.wp-pointer .wp-pointer-content h3 {
+ background-color: #04a4cc;
+ border-color: #0490b3;
+}
+
+.wp-pointer .wp-pointer-content h3:before {
+ color: #04a4cc;
+}
+
+.wp-pointer.wp-pointer-top .wp-pointer-arrow,
+.wp-pointer.wp-pointer-top .wp-pointer-arrow-inner,
+.wp-pointer.wp-pointer-undefined .wp-pointer-arrow,
+.wp-pointer.wp-pointer-undefined .wp-pointer-arrow-inner {
+ border-bottom-color: #04a4cc;
+}
+
+/* Media */
+.media-item .bar,
+.media-progress-bar div {
+ background-color: #04a4cc;
+}
+
+.details.attachment {
+ box-shadow: inset 0 0 0 3px #fff, inset 0 0 0 7px #04a4cc;
+}
+
+.attachment.details .check {
+ background-color: #04a4cc;
+ box-shadow: 0 0 0 1px #fff, 0 0 0 2px #04a4cc;
+}
+
+.media-selection .attachment.selection.details .thumbnail {
+ box-shadow: 0 0 0 1px #fff, 0 0 0 3px #04a4cc;
+}
+
+/* Themes */
+.theme-browser .theme.active .theme-name,
+.theme-browser .theme.add-new-theme a:hover:after,
+.theme-browser .theme.add-new-theme a:focus:after {
+ background: #04a4cc;
+}
+
+.theme-browser .theme.add-new-theme a:hover span:after,
+.theme-browser .theme.add-new-theme a:focus span:after {
+ color: #04a4cc;
+}
+
+.theme-section.current,
+.theme-filter.current {
+ border-bottom-color: #e5e5e5;
+}
+
+body.more-filters-opened .more-filters {
+ color: #333;
+ background-color: #e5e5e5;
+}
+
+body.more-filters-opened .more-filters:before {
+ color: #333;
+}
+
+body.more-filters-opened .more-filters:hover,
+body.more-filters-opened .more-filters:focus {
+ background-color: #888;
+ color: #fff;
+}
+
+body.more-filters-opened .more-filters:hover:before,
+body.more-filters-opened .more-filters:focus:before {
+ color: #fff;
+}
+
+/* Widgets */
+.widgets-chooser li.widgets-chooser-selected {
+ background-color: #888;
+ color: #fff;
+}
+
+.widgets-chooser li.widgets-chooser-selected:before,
+.widgets-chooser li.widgets-chooser-selected:focus:before {
+ color: #fff;
+}
+
+/* Responsive Component */
+div#wp-responsive-toggle a:before {
+ color: #999;
+}
+
+.wp-responsive-open div#wp-responsive-toggle a {
+ border-color: transparent;
+ background: #888;
+}
+
+.wp-responsive-open #wpadminbar #wp-admin-bar-menu-toggle a {
+ background: #fff;
+}
+
+.wp-responsive-open #wpadminbar #wp-admin-bar-menu-toggle .ab-icon:before {
+ color: #999;
+}
+
+/* TinyMCE */
+.mce-container.mce-menu .mce-menu-item:hover,
+.mce-container.mce-menu .mce-menu-item.mce-selected,
+.mce-container.mce-menu .mce-menu-item:focus,
+.mce-container.mce-menu .mce-menu-item-normal.mce-active,
+.mce-container.mce-menu .mce-menu-item-preview.mce-active {
+ background: #04a4cc;
+}
+
+/* temporary fix for admin-bar hover color */
+#wpadminbar .ab-top-menu > li:hover > .ab-item,
+#wpadminbar .ab-top-menu > li.hover > .ab-item,
+#wpadminbar > #wp-toolbar > #wp-admin-bar-root-default li:hover span.ab-label,
+#wpadminbar > #wp-toolbar > #wp-admin-bar-top-secondary li.hover span.ab-label,
+#wpadminbar .ab-top-menu > li > .ab-item:focus,
+#wpadminbar.nojq .quicklinks .ab-top-menu > li > .ab-item:focus,
+#wpadminbar.nojs .ab-top-menu > li.menupop:hover > .ab-item,
+#wpadminbar .ab-top-menu > li.menupop.hover > .ab-item {
+ color: #333;
+}
+
+/* Override the theme filter highlight color for this scheme */
+.theme-section.current,
+.theme-filter.current {
+ border-bottom-color: #04a4cc;
+}
diff --git a/www/crm/wp-admin/css/colors/light/colors.min.css b/www/crm/wp-admin/css/colors/light/colors.min.css
new file mode 100644
index 00000000..d2010d7d
--- /dev/null
+++ b/www/crm/wp-admin/css/colors/light/colors.min.css
@@ -0,0 +1,2 @@
+/*! This file is auto-generated */
+body{background:#f5f5f5}a{color:#0073aa}a:active,a:focus,a:hover{color:#0096dd}#media-upload a.del-link:hover,.subsubsub a.current:hover,.subsubsub a:hover,div.dashboard-widget-submit input:hover{color:#0096dd}input[type=checkbox]:checked:before{color:#04a4cc}input[type=radio]:checked:before{background:#04a4cc}.wp-core-ui input[type=reset]:active,.wp-core-ui input[type=reset]:hover{color:#0096dd}.wp-core-ui .button-primary{background:#04a4cc;border-color:#037c9a #036881 #036881;color:#fff;box-shadow:0 1px 0 #036881;text-shadow:0 -1px 1px #036881,1px 0 1px #036881,0 1px 1px #036881,-1px 0 1px #036881}.wp-core-ui .button-primary:focus,.wp-core-ui .button-primary:hover{background:#04b0db;border-color:#036881;color:#fff;box-shadow:0 1px 0 #036881}.wp-core-ui .button-primary:focus{box-shadow:inset 0 1px 0 #037c9a,0 0 2px 1px #33b3db}.wp-core-ui .button-primary.active,.wp-core-ui .button-primary.active:focus,.wp-core-ui .button-primary.active:hover,.wp-core-ui .button-primary:active{background:#037c9a;border-color:#036881;box-shadow:inset 0 2px 0 #036881}.wp-core-ui .button-primary.button-primary-disabled,.wp-core-ui .button-primary.disabled,.wp-core-ui .button-primary:disabled,.wp-core-ui .button-primary[disabled]{color:#c7cfd1!important;background:#0384a4!important;border-color:#036881!important;text-shadow:none!important}.wp-core-ui .button-primary.button-hero{box-shadow:0 2px 0 #036881!important}.wp-core-ui .button-primary.button-hero:active{box-shadow:inset 0 3px 0 #036881!important}.wp-core-ui .wp-ui-primary{color:#333;background-color:#e5e5e5}.wp-core-ui .wp-ui-text-primary{color:#e5e5e5}.wp-core-ui .wp-ui-highlight{color:#fff;background-color:#888}.wp-core-ui .wp-ui-text-highlight{color:#888}.wp-core-ui .wp-ui-notification{color:#fff;background-color:#d64e07}.wp-core-ui .wp-ui-text-notification{color:#d64e07}.wp-core-ui .wp-ui-text-icon{color:#999}.wrap .add-new-h2:hover,.wrap .page-title-action:hover{color:#333;background-color:#e5e5e5}.view-switch a.current:before{color:#e5e5e5}.view-switch a:hover:before{color:#d64e07}#adminmenu,#adminmenuback,#adminmenuwrap{background:#e5e5e5}#adminmenu a{color:#333}#adminmenu div.wp-menu-image:before{color:#999}#adminmenu a:hover,#adminmenu li.menu-top:hover,#adminmenu li.opensub>a.menu-top,#adminmenu li>a.menu-top:focus{color:#fff;background-color:#888}#adminmenu li.menu-top:hover div.wp-menu-image:before,#adminmenu li.opensub>a.menu-top div.wp-menu-image:before{color:#ccc}.about-wrap .nav-tab-active,.nav-tab-active,.nav-tab-active:hover{background-color:#f5f5f5;border-bottom-color:#f5f5f5}#adminmenu .wp-has-current-submenu .wp-submenu,#adminmenu .wp-has-current-submenu.opensub .wp-submenu,#adminmenu .wp-submenu,#adminmenu a.wp-has-current-submenu:focus+.wp-submenu,.folded #adminmenu .wp-has-current-submenu .wp-submenu{background:#fff}#adminmenu li.wp-has-submenu.wp-not-current-submenu.opensub:hover:after{border-right-color:#fff}#adminmenu .wp-submenu .wp-submenu-head{color:#686868}#adminmenu .wp-has-current-submenu .wp-submenu a,#adminmenu .wp-has-current-submenu.opensub .wp-submenu a,#adminmenu .wp-submenu a,#adminmenu a.wp-has-current-submenu:focus+.wp-submenu a,.folded #adminmenu .wp-has-current-submenu .wp-submenu a{color:#686868}#adminmenu .wp-has-current-submenu .wp-submenu a:focus,#adminmenu .wp-has-current-submenu .wp-submenu a:hover,#adminmenu .wp-has-current-submenu.opensub .wp-submenu a:focus,#adminmenu .wp-has-current-submenu.opensub .wp-submenu a:hover,#adminmenu .wp-submenu a:focus,#adminmenu .wp-submenu a:hover,#adminmenu a.wp-has-current-submenu:focus+.wp-submenu a:focus,#adminmenu a.wp-has-current-submenu:focus+.wp-submenu a:hover,.folded #adminmenu .wp-has-current-submenu .wp-submenu a:focus,.folded #adminmenu .wp-has-current-submenu .wp-submenu a:hover{color:#04a4cc}#adminmenu .wp-has-current-submenu.opensub .wp-submenu li.current a,#adminmenu .wp-submenu li.current a,#adminmenu a.wp-has-current-submenu:focus+.wp-submenu li.current a{color:#333}#adminmenu .wp-has-current-submenu.opensub .wp-submenu li.current a:focus,#adminmenu .wp-has-current-submenu.opensub .wp-submenu li.current a:hover,#adminmenu .wp-submenu li.current a:focus,#adminmenu .wp-submenu li.current a:hover,#adminmenu a.wp-has-current-submenu:focus+.wp-submenu li.current a:focus,#adminmenu a.wp-has-current-submenu:focus+.wp-submenu li.current a:hover{color:#04a4cc}ul#adminmenu a.wp-has-current-submenu:after,ul#adminmenu>li.current>a.current:after{border-right-color:#f5f5f5}#adminmenu li.current a.menu-top,#adminmenu li.wp-has-current-submenu .wp-submenu .wp-submenu-head,#adminmenu li.wp-has-current-submenu a.wp-has-current-submenu,.folded #adminmenu li.current.menu-top{color:#fff;background:#888}#adminmenu a.current:hover div.wp-menu-image:before,#adminmenu li a:focus div.wp-menu-image:before,#adminmenu li.opensub div.wp-menu-image:before,#adminmenu li.wp-has-current-submenu a:focus div.wp-menu-image:before,#adminmenu li.wp-has-current-submenu div.wp-menu-image:before,#adminmenu li.wp-has-current-submenu.opensub div.wp-menu-image:before,#adminmenu li:hover div.wp-menu-image:before,.ie8 #adminmenu li.opensub div.wp-menu-image:before{color:#ccc}#adminmenu .awaiting-mod,#adminmenu .update-plugins{color:#fff;background:#d64e07}#adminmenu li a.wp-has-current-submenu .update-plugins,#adminmenu li.current a .awaiting-mod,#adminmenu li.menu-top:hover>a .update-plugins,#adminmenu li:hover a .awaiting-mod{color:#333;background:#fff}#collapse-button{color:#777}#collapse-button:focus,#collapse-button:hover{color:#04a4cc}#wpadminbar{color:#333;background:#e5e5e5}#wpadminbar .ab-item,#wpadminbar a.ab-item,#wpadminbar>#wp-toolbar span.ab-label,#wpadminbar>#wp-toolbar span.noticon{color:#333}#wpadminbar .ab-icon,#wpadminbar .ab-icon:before,#wpadminbar .ab-item:after,#wpadminbar .ab-item:before{color:#999}#wpadminbar .ab-top-menu>li.menupop.hover>.ab-item,#wpadminbar.nojq .quicklinks .ab-top-menu>li>.ab-item:focus,#wpadminbar.nojs .ab-top-menu>li.menupop:hover>.ab-item,#wpadminbar:not(.mobile) .ab-top-menu>li:hover>.ab-item,#wpadminbar:not(.mobile) .ab-top-menu>li>.ab-item:focus{color:#04a4cc;background:#fff}#wpadminbar:not(.mobile)>#wp-toolbar a:focus span.ab-label,#wpadminbar:not(.mobile)>#wp-toolbar li.hover span.ab-label,#wpadminbar:not(.mobile)>#wp-toolbar li:hover span.ab-label{color:#04a4cc}#wpadminbar:not(.mobile) li:hover #adminbarsearch:before,#wpadminbar:not(.mobile) li:hover .ab-icon:before,#wpadminbar:not(.mobile) li:hover .ab-item:after,#wpadminbar:not(.mobile) li:hover .ab-item:before{color:#ccc}#wpadminbar .menupop .ab-sub-wrapper{background:#fff}#wpadminbar .quicklinks .menupop ul.ab-sub-secondary,#wpadminbar .quicklinks .menupop ul.ab-sub-secondary .ab-submenu{background:#f7f7f7}#wpadminbar .ab-submenu .ab-item,#wpadminbar .quicklinks .menupop ul li a,#wpadminbar .quicklinks .menupop.hover ul li a,#wpadminbar.nojs .quicklinks .menupop:hover ul li a{color:#686868}#wpadminbar .menupop .menupop>.ab-item:before,#wpadminbar .quicklinks li .blavatar{color:#999}#wpadminbar .quicklinks .ab-sub-wrapper .menupop.hover>a,#wpadminbar .quicklinks .menupop ul li a:focus,#wpadminbar .quicklinks .menupop ul li a:focus strong,#wpadminbar .quicklinks .menupop ul li a:hover,#wpadminbar .quicklinks .menupop ul li a:hover strong,#wpadminbar .quicklinks .menupop.hover ul li a:focus,#wpadminbar .quicklinks .menupop.hover ul li a:hover,#wpadminbar li #adminbarsearch.adminbar-focused:before,#wpadminbar li .ab-item:focus .ab-icon:before,#wpadminbar li .ab-item:focus:before,#wpadminbar li a:focus .ab-icon:before,#wpadminbar li.hover .ab-icon:before,#wpadminbar li.hover .ab-item:before,#wpadminbar li:hover #adminbarsearch:before,#wpadminbar li:hover .ab-icon:before,#wpadminbar li:hover .ab-item:before,#wpadminbar.nojs .quicklinks .menupop:hover ul li a:focus,#wpadminbar.nojs .quicklinks .menupop:hover ul li a:hover{color:#04a4cc}#wpadminbar .menupop .menupop>.ab-item:hover:before,#wpadminbar .quicklinks .ab-sub-wrapper .menupop.hover>a .blavatar,#wpadminbar .quicklinks li a:focus .blavatar,#wpadminbar .quicklinks li a:hover .blavatar,#wpadminbar.mobile .quicklinks .ab-icon:before,#wpadminbar.mobile .quicklinks .ab-item:before{color:#04a4cc}#wpadminbar.mobile .quicklinks .hover .ab-icon:before,#wpadminbar.mobile .quicklinks .hover .ab-item:before{color:#999}#wpadminbar #adminbarsearch:before{color:#999}#wpadminbar>#wp-toolbar>#wp-admin-bar-top-secondary>#wp-admin-bar-search #adminbarsearch input.adminbar-input:focus{color:#333;background:#f7f7f7}#wpadminbar #wp-admin-bar-recovery-mode{color:#fff;background-color:#d64e07}#wpadminbar #wp-admin-bar-recovery-mode .ab-item,#wpadminbar #wp-admin-bar-recovery-mode a.ab-item{color:#fff}#wpadminbar .ab-top-menu>#wp-admin-bar-recovery-mode.hover>.ab-item,#wpadminbar.nojq .quicklinks .ab-top-menu>#wp-admin-bar-recovery-mode>.ab-item:focus,#wpadminbar:not(.mobile) .ab-top-menu>#wp-admin-bar-recovery-mode:hover>.ab-item,#wpadminbar:not(.mobile) .ab-top-menu>#wp-admin-bar-recovery-mode>.ab-item:focus{color:#fff;background-color:#c14606}#wpadminbar .quicklinks li#wp-admin-bar-my-account.with-avatar>a img{border-color:#f7f7f7;background-color:#f7f7f7}#wpadminbar #wp-admin-bar-user-info .display-name{color:#333}#wpadminbar #wp-admin-bar-user-info a:hover .display-name{color:#04a4cc}#wpadminbar #wp-admin-bar-user-info .username{color:#686868}.wp-pointer .wp-pointer-content h3{background-color:#04a4cc;border-color:#0490b3}.wp-pointer .wp-pointer-content h3:before{color:#04a4cc}.wp-pointer.wp-pointer-top .wp-pointer-arrow,.wp-pointer.wp-pointer-top .wp-pointer-arrow-inner,.wp-pointer.wp-pointer-undefined .wp-pointer-arrow,.wp-pointer.wp-pointer-undefined .wp-pointer-arrow-inner{border-bottom-color:#04a4cc}.media-item .bar,.media-progress-bar div{background-color:#04a4cc}.details.attachment{box-shadow:inset 0 0 0 3px #fff,inset 0 0 0 7px #04a4cc}.attachment.details .check{background-color:#04a4cc;box-shadow:0 0 0 1px #fff,0 0 0 2px #04a4cc}.media-selection .attachment.selection.details .thumbnail{box-shadow:0 0 0 1px #fff,0 0 0 3px #04a4cc}.theme-browser .theme.active .theme-name,.theme-browser .theme.add-new-theme a:focus:after,.theme-browser .theme.add-new-theme a:hover:after{background:#04a4cc}.theme-browser .theme.add-new-theme a:focus span:after,.theme-browser .theme.add-new-theme a:hover span:after{color:#04a4cc}.theme-filter.current,.theme-section.current{border-bottom-color:#e5e5e5}body.more-filters-opened .more-filters{color:#333;background-color:#e5e5e5}body.more-filters-opened .more-filters:before{color:#333}body.more-filters-opened .more-filters:focus,body.more-filters-opened .more-filters:hover{background-color:#888;color:#fff}body.more-filters-opened .more-filters:focus:before,body.more-filters-opened .more-filters:hover:before{color:#fff}.widgets-chooser li.widgets-chooser-selected{background-color:#888;color:#fff}.widgets-chooser li.widgets-chooser-selected:before,.widgets-chooser li.widgets-chooser-selected:focus:before{color:#fff}div#wp-responsive-toggle a:before{color:#999}.wp-responsive-open div#wp-responsive-toggle a{border-color:transparent;background:#888}.wp-responsive-open #wpadminbar #wp-admin-bar-menu-toggle a{background:#fff}.wp-responsive-open #wpadminbar #wp-admin-bar-menu-toggle .ab-icon:before{color:#999}.mce-container.mce-menu .mce-menu-item-normal.mce-active,.mce-container.mce-menu .mce-menu-item-preview.mce-active,.mce-container.mce-menu .mce-menu-item.mce-selected,.mce-container.mce-menu .mce-menu-item:focus,.mce-container.mce-menu .mce-menu-item:hover{background:#04a4cc}#wpadminbar .ab-top-menu>li.hover>.ab-item,#wpadminbar .ab-top-menu>li.menupop.hover>.ab-item,#wpadminbar .ab-top-menu>li:hover>.ab-item,#wpadminbar .ab-top-menu>li>.ab-item:focus,#wpadminbar.nojq .quicklinks .ab-top-menu>li>.ab-item:focus,#wpadminbar.nojs .ab-top-menu>li.menupop:hover>.ab-item,#wpadminbar>#wp-toolbar>#wp-admin-bar-root-default li:hover span.ab-label,#wpadminbar>#wp-toolbar>#wp-admin-bar-top-secondary li.hover span.ab-label{color:#333}.theme-filter.current,.theme-section.current{border-bottom-color:#04a4cc} \ No newline at end of file
diff --git a/www/crm/wp-admin/css/colors/light/colors.scss b/www/crm/wp-admin/css/colors/light/colors.scss
new file mode 100644
index 00000000..ab4230b9
--- /dev/null
+++ b/www/crm/wp-admin/css/colors/light/colors.scss
@@ -0,0 +1,38 @@
+$base-color: #e5e5e5;
+$icon-color: #999;
+$text-color: #333;
+$highlight-color: #04a4cc;
+$notification-color: #d64e07;
+
+$body-background: #f5f5f5;
+
+$menu-highlight-text: #fff;
+$menu-highlight-icon: #ccc;
+$menu-highlight-background: #888;
+
+$menu-bubble-text: #fff;
+$menu-avatar-frame: #aaa;
+$menu-submenu-background: #fff;
+
+$menu-collapse-text: #777;
+$menu-collapse-focus-icon: #555;
+
+@import "../_admin.scss";
+
+/* temporary fix for admin-bar hover color */
+#wpadminbar .ab-top-menu > li:hover > .ab-item,
+#wpadminbar .ab-top-menu > li.hover > .ab-item,
+#wpadminbar > #wp-toolbar > #wp-admin-bar-root-default li:hover span.ab-label,
+#wpadminbar > #wp-toolbar > #wp-admin-bar-top-secondary li.hover span.ab-label,
+#wpadminbar .ab-top-menu > li > .ab-item:focus,
+#wpadminbar.nojq .quicklinks .ab-top-menu > li > .ab-item:focus,
+#wpadminbar.nojs .ab-top-menu > li.menupop:hover > .ab-item,
+#wpadminbar .ab-top-menu > li.menupop.hover > .ab-item {
+ color: $text-color;
+}
+
+/* Override the theme filter highlight color for this scheme */
+.theme-section.current,
+.theme-filter.current {
+ border-bottom-color: $highlight-color;
+}
diff --git a/www/crm/wp-admin/css/colors/midnight/colors-rtl.css b/www/crm/wp-admin/css/colors/midnight/colors-rtl.css
new file mode 100644
index 00000000..fd176831
--- /dev/null
+++ b/www/crm/wp-admin/css/colors/midnight/colors-rtl.css
@@ -0,0 +1,519 @@
+/*! This file is auto-generated */
+/*
+ * Button mixin- creates 3d-ish button effect with correct
+ * highlights/shadows, based on a base color.
+ */
+body {
+ background: #f1f1f1;
+}
+
+/* Links */
+a {
+ color: #0073aa;
+}
+
+a:hover, a:active, a:focus {
+ color: #0096dd;
+}
+
+#media-upload a.del-link:hover,
+div.dashboard-widget-submit input:hover,
+.subsubsub a:hover,
+.subsubsub a.current:hover {
+ color: #0096dd;
+}
+
+/* Forms */
+input[type=checkbox]:checked:before {
+ color: #e14d43;
+}
+
+input[type=radio]:checked:before {
+ background: #e14d43;
+}
+
+.wp-core-ui input[type="reset"]:hover,
+.wp-core-ui input[type="reset"]:active {
+ color: #0096dd;
+}
+
+/* Core UI */
+.wp-core-ui .button-primary {
+ background: #e14d43;
+ border-color: #d02c21 #ba281e #ba281e;
+ color: #fff;
+ box-shadow: 0 1px 0 #ba281e;
+ text-shadow: 0 -1px 1px #ba281e, -1px 0 1px #ba281e, 0 1px 1px #ba281e, 1px 0 1px #ba281e;
+}
+
+.wp-core-ui .button-primary:hover, .wp-core-ui .button-primary:focus {
+ background: #e35950;
+ border-color: #ba281e;
+ color: #fff;
+ box-shadow: 0 1px 0 #ba281e;
+}
+
+.wp-core-ui .button-primary:focus {
+ box-shadow: inset 0 1px 0 #d02c21, 0 0 2px 1px #33b3db;
+}
+
+.wp-core-ui .button-primary:active, .wp-core-ui .button-primary.active, .wp-core-ui .button-primary.active:focus, .wp-core-ui .button-primary.active:hover {
+ background: #d02c21;
+ border-color: #ba281e;
+ box-shadow: inset 0 2px 0 #ba281e;
+}
+
+.wp-core-ui .button-primary[disabled], .wp-core-ui .button-primary:disabled, .wp-core-ui .button-primary.button-primary-disabled, .wp-core-ui .button-primary.disabled {
+ color: #d1c8c7 !important;
+ background: #d92e23 !important;
+ border-color: #ba281e !important;
+ text-shadow: none !important;
+}
+
+.wp-core-ui .button-primary.button-hero {
+ box-shadow: 0 2px 0 #ba281e !important;
+}
+
+.wp-core-ui .button-primary.button-hero:active {
+ box-shadow: inset 0 3px 0 #ba281e !important;
+}
+
+.wp-core-ui .wp-ui-primary {
+ color: #fff;
+ background-color: #363b3f;
+}
+
+.wp-core-ui .wp-ui-text-primary {
+ color: #363b3f;
+}
+
+.wp-core-ui .wp-ui-highlight {
+ color: #fff;
+ background-color: #e14d43;
+}
+
+.wp-core-ui .wp-ui-text-highlight {
+ color: #e14d43;
+}
+
+.wp-core-ui .wp-ui-notification {
+ color: #fff;
+ background-color: #69a8bb;
+}
+
+.wp-core-ui .wp-ui-text-notification {
+ color: #69a8bb;
+}
+
+.wp-core-ui .wp-ui-text-icon {
+ color: #f1f2f3;
+}
+
+/* List tables */
+.wrap .add-new-h2:hover,
+.wrap .page-title-action:hover {
+ color: #fff;
+ background-color: #363b3f;
+}
+
+.view-switch a.current:before {
+ color: #363b3f;
+}
+
+.view-switch a:hover:before {
+ color: #69a8bb;
+}
+
+/* Admin Menu */
+#adminmenuback,
+#adminmenuwrap,
+#adminmenu {
+ background: #363b3f;
+}
+
+#adminmenu a {
+ color: #fff;
+}
+
+#adminmenu div.wp-menu-image:before {
+ color: #f1f2f3;
+}
+
+#adminmenu a:hover,
+#adminmenu li.menu-top:hover,
+#adminmenu li.opensub > a.menu-top,
+#adminmenu li > a.menu-top:focus {
+ color: #fff;
+ background-color: #e14d43;
+}
+
+#adminmenu li.menu-top:hover div.wp-menu-image:before,
+#adminmenu li.opensub > a.menu-top div.wp-menu-image:before {
+ color: #fff;
+}
+
+/* Active tabs use a bottom border color that matches the page background color. */
+.about-wrap .nav-tab-active,
+.nav-tab-active,
+.nav-tab-active:hover {
+ background-color: #f1f1f1;
+ border-bottom-color: #f1f1f1;
+}
+
+/* Admin Menu: submenu */
+#adminmenu .wp-submenu,
+#adminmenu .wp-has-current-submenu .wp-submenu,
+#adminmenu .wp-has-current-submenu.opensub .wp-submenu,
+.folded #adminmenu .wp-has-current-submenu .wp-submenu,
+#adminmenu a.wp-has-current-submenu:focus + .wp-submenu {
+ background: #26292c;
+}
+
+#adminmenu li.wp-has-submenu.wp-not-current-submenu.opensub:hover:after {
+ border-left-color: #26292c;
+}
+
+#adminmenu .wp-submenu .wp-submenu-head {
+ color: #c3c4c5;
+}
+
+#adminmenu .wp-submenu a,
+#adminmenu .wp-has-current-submenu .wp-submenu a,
+.folded #adminmenu .wp-has-current-submenu .wp-submenu a,
+#adminmenu a.wp-has-current-submenu:focus + .wp-submenu a,
+#adminmenu .wp-has-current-submenu.opensub .wp-submenu a {
+ color: #c3c4c5;
+}
+
+#adminmenu .wp-submenu a:focus, #adminmenu .wp-submenu a:hover,
+#adminmenu .wp-has-current-submenu .wp-submenu a:focus,
+#adminmenu .wp-has-current-submenu .wp-submenu a:hover,
+.folded #adminmenu .wp-has-current-submenu .wp-submenu a:focus,
+.folded #adminmenu .wp-has-current-submenu .wp-submenu a:hover,
+#adminmenu a.wp-has-current-submenu:focus + .wp-submenu a:focus,
+#adminmenu a.wp-has-current-submenu:focus + .wp-submenu a:hover,
+#adminmenu .wp-has-current-submenu.opensub .wp-submenu a:focus,
+#adminmenu .wp-has-current-submenu.opensub .wp-submenu a:hover {
+ color: #e14d43;
+}
+
+/* Admin Menu: current */
+#adminmenu .wp-submenu li.current a,
+#adminmenu a.wp-has-current-submenu:focus + .wp-submenu li.current a,
+#adminmenu .wp-has-current-submenu.opensub .wp-submenu li.current a {
+ color: #fff;
+}
+
+#adminmenu .wp-submenu li.current a:hover, #adminmenu .wp-submenu li.current a:focus,
+#adminmenu a.wp-has-current-submenu:focus + .wp-submenu li.current a:hover,
+#adminmenu a.wp-has-current-submenu:focus + .wp-submenu li.current a:focus,
+#adminmenu .wp-has-current-submenu.opensub .wp-submenu li.current a:hover,
+#adminmenu .wp-has-current-submenu.opensub .wp-submenu li.current a:focus {
+ color: #e14d43;
+}
+
+ul#adminmenu a.wp-has-current-submenu:after,
+ul#adminmenu > li.current > a.current:after {
+ border-left-color: #f1f1f1;
+}
+
+#adminmenu li.current a.menu-top,
+#adminmenu li.wp-has-current-submenu a.wp-has-current-submenu,
+#adminmenu li.wp-has-current-submenu .wp-submenu .wp-submenu-head,
+.folded #adminmenu li.current.menu-top {
+ color: #fff;
+ background: #e14d43;
+}
+
+#adminmenu li.wp-has-current-submenu div.wp-menu-image:before,
+#adminmenu a.current:hover div.wp-menu-image:before,
+#adminmenu li.wp-has-current-submenu a:focus div.wp-menu-image:before,
+#adminmenu li.wp-has-current-submenu.opensub div.wp-menu-image:before,
+#adminmenu li:hover div.wp-menu-image:before,
+#adminmenu li a:focus div.wp-menu-image:before,
+#adminmenu li.opensub div.wp-menu-image:before,
+.ie8 #adminmenu li.opensub div.wp-menu-image:before {
+ color: #fff;
+}
+
+/* Admin Menu: bubble */
+#adminmenu .awaiting-mod,
+#adminmenu .update-plugins {
+ color: #fff;
+ background: #69a8bb;
+}
+
+#adminmenu li.current a .awaiting-mod,
+#adminmenu li a.wp-has-current-submenu .update-plugins,
+#adminmenu li:hover a .awaiting-mod,
+#adminmenu li.menu-top:hover > a .update-plugins {
+ color: #fff;
+ background: #26292c;
+}
+
+/* Admin Menu: collapse button */
+#collapse-button {
+ color: #f1f2f3;
+}
+
+#collapse-button:hover,
+#collapse-button:focus {
+ color: #e14d43;
+}
+
+/* Admin Bar */
+#wpadminbar {
+ color: #fff;
+ background: #363b3f;
+}
+
+#wpadminbar .ab-item,
+#wpadminbar a.ab-item,
+#wpadminbar > #wp-toolbar span.ab-label,
+#wpadminbar > #wp-toolbar span.noticon {
+ color: #fff;
+}
+
+#wpadminbar .ab-icon,
+#wpadminbar .ab-icon:before,
+#wpadminbar .ab-item:before,
+#wpadminbar .ab-item:after {
+ color: #f1f2f3;
+}
+
+#wpadminbar:not(.mobile) .ab-top-menu > li:hover > .ab-item,
+#wpadminbar:not(.mobile) .ab-top-menu > li > .ab-item:focus,
+#wpadminbar.nojq .quicklinks .ab-top-menu > li > .ab-item:focus,
+#wpadminbar.nojs .ab-top-menu > li.menupop:hover > .ab-item,
+#wpadminbar .ab-top-menu > li.menupop.hover > .ab-item {
+ color: #e14d43;
+ background: #26292c;
+}
+
+#wpadminbar:not(.mobile) > #wp-toolbar li:hover span.ab-label,
+#wpadminbar:not(.mobile) > #wp-toolbar li.hover span.ab-label,
+#wpadminbar:not(.mobile) > #wp-toolbar a:focus span.ab-label {
+ color: #e14d43;
+}
+
+#wpadminbar:not(.mobile) li:hover .ab-icon:before,
+#wpadminbar:not(.mobile) li:hover .ab-item:before,
+#wpadminbar:not(.mobile) li:hover .ab-item:after,
+#wpadminbar:not(.mobile) li:hover #adminbarsearch:before {
+ color: #fff;
+}
+
+/* Admin Bar: submenu */
+#wpadminbar .menupop .ab-sub-wrapper {
+ background: #26292c;
+}
+
+#wpadminbar .quicklinks .menupop ul.ab-sub-secondary,
+#wpadminbar .quicklinks .menupop ul.ab-sub-secondary .ab-submenu {
+ background: #4c4c4d;
+}
+
+#wpadminbar .ab-submenu .ab-item,
+#wpadminbar .quicklinks .menupop ul li a,
+#wpadminbar .quicklinks .menupop.hover ul li a,
+#wpadminbar.nojs .quicklinks .menupop:hover ul li a {
+ color: #c3c4c5;
+}
+
+#wpadminbar .quicklinks li .blavatar,
+#wpadminbar .menupop .menupop > .ab-item:before {
+ color: #f1f2f3;
+}
+
+#wpadminbar .quicklinks .menupop ul li a:hover,
+#wpadminbar .quicklinks .menupop ul li a:focus,
+#wpadminbar .quicklinks .menupop ul li a:hover strong,
+#wpadminbar .quicklinks .menupop ul li a:focus strong,
+#wpadminbar .quicklinks .ab-sub-wrapper .menupop.hover > a,
+#wpadminbar .quicklinks .menupop.hover ul li a:hover,
+#wpadminbar .quicklinks .menupop.hover ul li a:focus,
+#wpadminbar.nojs .quicklinks .menupop:hover ul li a:hover,
+#wpadminbar.nojs .quicklinks .menupop:hover ul li a:focus,
+#wpadminbar li:hover .ab-icon:before,
+#wpadminbar li:hover .ab-item:before,
+#wpadminbar li a:focus .ab-icon:before,
+#wpadminbar li .ab-item:focus:before,
+#wpadminbar li .ab-item:focus .ab-icon:before,
+#wpadminbar li.hover .ab-icon:before,
+#wpadminbar li.hover .ab-item:before,
+#wpadminbar li:hover #adminbarsearch:before,
+#wpadminbar li #adminbarsearch.adminbar-focused:before {
+ color: #e14d43;
+}
+
+#wpadminbar .quicklinks li a:hover .blavatar,
+#wpadminbar .quicklinks li a:focus .blavatar,
+#wpadminbar .quicklinks .ab-sub-wrapper .menupop.hover > a .blavatar,
+#wpadminbar .menupop .menupop > .ab-item:hover:before,
+#wpadminbar.mobile .quicklinks .ab-icon:before,
+#wpadminbar.mobile .quicklinks .ab-item:before {
+ color: #e14d43;
+}
+
+#wpadminbar.mobile .quicklinks .hover .ab-icon:before,
+#wpadminbar.mobile .quicklinks .hover .ab-item:before {
+ color: #f1f2f3;
+}
+
+/* Admin Bar: search */
+#wpadminbar #adminbarsearch:before {
+ color: #f1f2f3;
+}
+
+#wpadminbar > #wp-toolbar > #wp-admin-bar-top-secondary > #wp-admin-bar-search #adminbarsearch input.adminbar-input:focus {
+ color: #fff;
+ background: #464d52;
+}
+
+/* Admin Bar: recovery mode */
+#wpadminbar #wp-admin-bar-recovery-mode {
+ color: #fff;
+ background-color: #69a8bb;
+}
+
+#wpadminbar #wp-admin-bar-recovery-mode .ab-item,
+#wpadminbar #wp-admin-bar-recovery-mode a.ab-item {
+ color: #fff;
+}
+
+#wpadminbar .ab-top-menu > #wp-admin-bar-recovery-mode.hover > .ab-item,
+#wpadminbar.nojq .quicklinks .ab-top-menu > #wp-admin-bar-recovery-mode > .ab-item:focus,
+#wpadminbar:not(.mobile) .ab-top-menu > #wp-admin-bar-recovery-mode:hover > .ab-item,
+#wpadminbar:not(.mobile) .ab-top-menu > #wp-admin-bar-recovery-mode > .ab-item:focus {
+ color: #fff;
+ background-color: #5f97a8;
+}
+
+/* Admin Bar: my account */
+#wpadminbar .quicklinks li#wp-admin-bar-my-account.with-avatar > a img {
+ border-color: #464d52;
+ background-color: #464d52;
+}
+
+#wpadminbar #wp-admin-bar-user-info .display-name {
+ color: #fff;
+}
+
+#wpadminbar #wp-admin-bar-user-info a:hover .display-name {
+ color: #e14d43;
+}
+
+#wpadminbar #wp-admin-bar-user-info .username {
+ color: #c3c4c5;
+}
+
+/* Pointers */
+.wp-pointer .wp-pointer-content h3 {
+ background-color: #e14d43;
+ border-color: #dd382d;
+}
+
+.wp-pointer .wp-pointer-content h3:before {
+ color: #e14d43;
+}
+
+.wp-pointer.wp-pointer-top .wp-pointer-arrow,
+.wp-pointer.wp-pointer-top .wp-pointer-arrow-inner,
+.wp-pointer.wp-pointer-undefined .wp-pointer-arrow,
+.wp-pointer.wp-pointer-undefined .wp-pointer-arrow-inner {
+ border-bottom-color: #e14d43;
+}
+
+/* Media */
+.media-item .bar,
+.media-progress-bar div {
+ background-color: #e14d43;
+}
+
+.details.attachment {
+ box-shadow: inset 0 0 0 3px #fff, inset 0 0 0 7px #e14d43;
+}
+
+.attachment.details .check {
+ background-color: #e14d43;
+ box-shadow: 0 0 0 1px #fff, 0 0 0 2px #e14d43;
+}
+
+.media-selection .attachment.selection.details .thumbnail {
+ box-shadow: 0 0 0 1px #fff, 0 0 0 3px #e14d43;
+}
+
+/* Themes */
+.theme-browser .theme.active .theme-name,
+.theme-browser .theme.add-new-theme a:hover:after,
+.theme-browser .theme.add-new-theme a:focus:after {
+ background: #e14d43;
+}
+
+.theme-browser .theme.add-new-theme a:hover span:after,
+.theme-browser .theme.add-new-theme a:focus span:after {
+ color: #e14d43;
+}
+
+.theme-section.current,
+.theme-filter.current {
+ border-bottom-color: #363b3f;
+}
+
+body.more-filters-opened .more-filters {
+ color: #fff;
+ background-color: #363b3f;
+}
+
+body.more-filters-opened .more-filters:before {
+ color: #fff;
+}
+
+body.more-filters-opened .more-filters:hover,
+body.more-filters-opened .more-filters:focus {
+ background-color: #e14d43;
+ color: #fff;
+}
+
+body.more-filters-opened .more-filters:hover:before,
+body.more-filters-opened .more-filters:focus:before {
+ color: #fff;
+}
+
+/* Widgets */
+.widgets-chooser li.widgets-chooser-selected {
+ background-color: #e14d43;
+ color: #fff;
+}
+
+.widgets-chooser li.widgets-chooser-selected:before,
+.widgets-chooser li.widgets-chooser-selected:focus:before {
+ color: #fff;
+}
+
+/* Responsive Component */
+div#wp-responsive-toggle a:before {
+ color: #f1f2f3;
+}
+
+.wp-responsive-open div#wp-responsive-toggle a {
+ border-color: transparent;
+ background: #e14d43;
+}
+
+.wp-responsive-open #wpadminbar #wp-admin-bar-menu-toggle a {
+ background: #26292c;
+}
+
+.wp-responsive-open #wpadminbar #wp-admin-bar-menu-toggle .ab-icon:before {
+ color: #f1f2f3;
+}
+
+/* TinyMCE */
+.mce-container.mce-menu .mce-menu-item:hover,
+.mce-container.mce-menu .mce-menu-item.mce-selected,
+.mce-container.mce-menu .mce-menu-item:focus,
+.mce-container.mce-menu .mce-menu-item-normal.mce-active,
+.mce-container.mce-menu .mce-menu-item-preview.mce-active {
+ background: #e14d43;
+}
diff --git a/www/crm/wp-admin/css/colors/midnight/colors-rtl.min.css b/www/crm/wp-admin/css/colors/midnight/colors-rtl.min.css
new file mode 100644
index 00000000..48621204
--- /dev/null
+++ b/www/crm/wp-admin/css/colors/midnight/colors-rtl.min.css
@@ -0,0 +1,2 @@
+/*! This file is auto-generated */
+body{background:#f1f1f1}a{color:#0073aa}a:active,a:focus,a:hover{color:#0096dd}#media-upload a.del-link:hover,.subsubsub a.current:hover,.subsubsub a:hover,div.dashboard-widget-submit input:hover{color:#0096dd}input[type=checkbox]:checked:before{color:#e14d43}input[type=radio]:checked:before{background:#e14d43}.wp-core-ui input[type=reset]:active,.wp-core-ui input[type=reset]:hover{color:#0096dd}.wp-core-ui .button-primary{background:#e14d43;border-color:#d02c21 #ba281e #ba281e;color:#fff;box-shadow:0 1px 0 #ba281e;text-shadow:0 -1px 1px #ba281e,-1px 0 1px #ba281e,0 1px 1px #ba281e,1px 0 1px #ba281e}.wp-core-ui .button-primary:focus,.wp-core-ui .button-primary:hover{background:#e35950;border-color:#ba281e;color:#fff;box-shadow:0 1px 0 #ba281e}.wp-core-ui .button-primary:focus{box-shadow:inset 0 1px 0 #d02c21,0 0 2px 1px #33b3db}.wp-core-ui .button-primary.active,.wp-core-ui .button-primary.active:focus,.wp-core-ui .button-primary.active:hover,.wp-core-ui .button-primary:active{background:#d02c21;border-color:#ba281e;box-shadow:inset 0 2px 0 #ba281e}.wp-core-ui .button-primary.button-primary-disabled,.wp-core-ui .button-primary.disabled,.wp-core-ui .button-primary:disabled,.wp-core-ui .button-primary[disabled]{color:#d1c8c7!important;background:#d92e23!important;border-color:#ba281e!important;text-shadow:none!important}.wp-core-ui .button-primary.button-hero{box-shadow:0 2px 0 #ba281e!important}.wp-core-ui .button-primary.button-hero:active{box-shadow:inset 0 3px 0 #ba281e!important}.wp-core-ui .wp-ui-primary{color:#fff;background-color:#363b3f}.wp-core-ui .wp-ui-text-primary{color:#363b3f}.wp-core-ui .wp-ui-highlight{color:#fff;background-color:#e14d43}.wp-core-ui .wp-ui-text-highlight{color:#e14d43}.wp-core-ui .wp-ui-notification{color:#fff;background-color:#69a8bb}.wp-core-ui .wp-ui-text-notification{color:#69a8bb}.wp-core-ui .wp-ui-text-icon{color:#f1f2f3}.wrap .add-new-h2:hover,.wrap .page-title-action:hover{color:#fff;background-color:#363b3f}.view-switch a.current:before{color:#363b3f}.view-switch a:hover:before{color:#69a8bb}#adminmenu,#adminmenuback,#adminmenuwrap{background:#363b3f}#adminmenu a{color:#fff}#adminmenu div.wp-menu-image:before{color:#f1f2f3}#adminmenu a:hover,#adminmenu li.menu-top:hover,#adminmenu li.opensub>a.menu-top,#adminmenu li>a.menu-top:focus{color:#fff;background-color:#e14d43}#adminmenu li.menu-top:hover div.wp-menu-image:before,#adminmenu li.opensub>a.menu-top div.wp-menu-image:before{color:#fff}.about-wrap .nav-tab-active,.nav-tab-active,.nav-tab-active:hover{background-color:#f1f1f1;border-bottom-color:#f1f1f1}#adminmenu .wp-has-current-submenu .wp-submenu,#adminmenu .wp-has-current-submenu.opensub .wp-submenu,#adminmenu .wp-submenu,#adminmenu a.wp-has-current-submenu:focus+.wp-submenu,.folded #adminmenu .wp-has-current-submenu .wp-submenu{background:#26292c}#adminmenu li.wp-has-submenu.wp-not-current-submenu.opensub:hover:after{border-left-color:#26292c}#adminmenu .wp-submenu .wp-submenu-head{color:#c3c4c5}#adminmenu .wp-has-current-submenu .wp-submenu a,#adminmenu .wp-has-current-submenu.opensub .wp-submenu a,#adminmenu .wp-submenu a,#adminmenu a.wp-has-current-submenu:focus+.wp-submenu a,.folded #adminmenu .wp-has-current-submenu .wp-submenu a{color:#c3c4c5}#adminmenu .wp-has-current-submenu .wp-submenu a:focus,#adminmenu .wp-has-current-submenu .wp-submenu a:hover,#adminmenu .wp-has-current-submenu.opensub .wp-submenu a:focus,#adminmenu .wp-has-current-submenu.opensub .wp-submenu a:hover,#adminmenu .wp-submenu a:focus,#adminmenu .wp-submenu a:hover,#adminmenu a.wp-has-current-submenu:focus+.wp-submenu a:focus,#adminmenu a.wp-has-current-submenu:focus+.wp-submenu a:hover,.folded #adminmenu .wp-has-current-submenu .wp-submenu a:focus,.folded #adminmenu .wp-has-current-submenu .wp-submenu a:hover{color:#e14d43}#adminmenu .wp-has-current-submenu.opensub .wp-submenu li.current a,#adminmenu .wp-submenu li.current a,#adminmenu a.wp-has-current-submenu:focus+.wp-submenu li.current a{color:#fff}#adminmenu .wp-has-current-submenu.opensub .wp-submenu li.current a:focus,#adminmenu .wp-has-current-submenu.opensub .wp-submenu li.current a:hover,#adminmenu .wp-submenu li.current a:focus,#adminmenu .wp-submenu li.current a:hover,#adminmenu a.wp-has-current-submenu:focus+.wp-submenu li.current a:focus,#adminmenu a.wp-has-current-submenu:focus+.wp-submenu li.current a:hover{color:#e14d43}ul#adminmenu a.wp-has-current-submenu:after,ul#adminmenu>li.current>a.current:after{border-left-color:#f1f1f1}#adminmenu li.current a.menu-top,#adminmenu li.wp-has-current-submenu .wp-submenu .wp-submenu-head,#adminmenu li.wp-has-current-submenu a.wp-has-current-submenu,.folded #adminmenu li.current.menu-top{color:#fff;background:#e14d43}#adminmenu a.current:hover div.wp-menu-image:before,#adminmenu li a:focus div.wp-menu-image:before,#adminmenu li.opensub div.wp-menu-image:before,#adminmenu li.wp-has-current-submenu a:focus div.wp-menu-image:before,#adminmenu li.wp-has-current-submenu div.wp-menu-image:before,#adminmenu li.wp-has-current-submenu.opensub div.wp-menu-image:before,#adminmenu li:hover div.wp-menu-image:before,.ie8 #adminmenu li.opensub div.wp-menu-image:before{color:#fff}#adminmenu .awaiting-mod,#adminmenu .update-plugins{color:#fff;background:#69a8bb}#adminmenu li a.wp-has-current-submenu .update-plugins,#adminmenu li.current a .awaiting-mod,#adminmenu li.menu-top:hover>a .update-plugins,#adminmenu li:hover a .awaiting-mod{color:#fff;background:#26292c}#collapse-button{color:#f1f2f3}#collapse-button:focus,#collapse-button:hover{color:#e14d43}#wpadminbar{color:#fff;background:#363b3f}#wpadminbar .ab-item,#wpadminbar a.ab-item,#wpadminbar>#wp-toolbar span.ab-label,#wpadminbar>#wp-toolbar span.noticon{color:#fff}#wpadminbar .ab-icon,#wpadminbar .ab-icon:before,#wpadminbar .ab-item:after,#wpadminbar .ab-item:before{color:#f1f2f3}#wpadminbar .ab-top-menu>li.menupop.hover>.ab-item,#wpadminbar.nojq .quicklinks .ab-top-menu>li>.ab-item:focus,#wpadminbar.nojs .ab-top-menu>li.menupop:hover>.ab-item,#wpadminbar:not(.mobile) .ab-top-menu>li:hover>.ab-item,#wpadminbar:not(.mobile) .ab-top-menu>li>.ab-item:focus{color:#e14d43;background:#26292c}#wpadminbar:not(.mobile)>#wp-toolbar a:focus span.ab-label,#wpadminbar:not(.mobile)>#wp-toolbar li.hover span.ab-label,#wpadminbar:not(.mobile)>#wp-toolbar li:hover span.ab-label{color:#e14d43}#wpadminbar:not(.mobile) li:hover #adminbarsearch:before,#wpadminbar:not(.mobile) li:hover .ab-icon:before,#wpadminbar:not(.mobile) li:hover .ab-item:after,#wpadminbar:not(.mobile) li:hover .ab-item:before{color:#fff}#wpadminbar .menupop .ab-sub-wrapper{background:#26292c}#wpadminbar .quicklinks .menupop ul.ab-sub-secondary,#wpadminbar .quicklinks .menupop ul.ab-sub-secondary .ab-submenu{background:#4c4c4d}#wpadminbar .ab-submenu .ab-item,#wpadminbar .quicklinks .menupop ul li a,#wpadminbar .quicklinks .menupop.hover ul li a,#wpadminbar.nojs .quicklinks .menupop:hover ul li a{color:#c3c4c5}#wpadminbar .menupop .menupop>.ab-item:before,#wpadminbar .quicklinks li .blavatar{color:#f1f2f3}#wpadminbar .quicklinks .ab-sub-wrapper .menupop.hover>a,#wpadminbar .quicklinks .menupop ul li a:focus,#wpadminbar .quicklinks .menupop ul li a:focus strong,#wpadminbar .quicklinks .menupop ul li a:hover,#wpadminbar .quicklinks .menupop ul li a:hover strong,#wpadminbar .quicklinks .menupop.hover ul li a:focus,#wpadminbar .quicklinks .menupop.hover ul li a:hover,#wpadminbar li #adminbarsearch.adminbar-focused:before,#wpadminbar li .ab-item:focus .ab-icon:before,#wpadminbar li .ab-item:focus:before,#wpadminbar li a:focus .ab-icon:before,#wpadminbar li.hover .ab-icon:before,#wpadminbar li.hover .ab-item:before,#wpadminbar li:hover #adminbarsearch:before,#wpadminbar li:hover .ab-icon:before,#wpadminbar li:hover .ab-item:before,#wpadminbar.nojs .quicklinks .menupop:hover ul li a:focus,#wpadminbar.nojs .quicklinks .menupop:hover ul li a:hover{color:#e14d43}#wpadminbar .menupop .menupop>.ab-item:hover:before,#wpadminbar .quicklinks .ab-sub-wrapper .menupop.hover>a .blavatar,#wpadminbar .quicklinks li a:focus .blavatar,#wpadminbar .quicklinks li a:hover .blavatar,#wpadminbar.mobile .quicklinks .ab-icon:before,#wpadminbar.mobile .quicklinks .ab-item:before{color:#e14d43}#wpadminbar.mobile .quicklinks .hover .ab-icon:before,#wpadminbar.mobile .quicklinks .hover .ab-item:before{color:#f1f2f3}#wpadminbar #adminbarsearch:before{color:#f1f2f3}#wpadminbar>#wp-toolbar>#wp-admin-bar-top-secondary>#wp-admin-bar-search #adminbarsearch input.adminbar-input:focus{color:#fff;background:#464d52}#wpadminbar #wp-admin-bar-recovery-mode{color:#fff;background-color:#69a8bb}#wpadminbar #wp-admin-bar-recovery-mode .ab-item,#wpadminbar #wp-admin-bar-recovery-mode a.ab-item{color:#fff}#wpadminbar .ab-top-menu>#wp-admin-bar-recovery-mode.hover>.ab-item,#wpadminbar.nojq .quicklinks .ab-top-menu>#wp-admin-bar-recovery-mode>.ab-item:focus,#wpadminbar:not(.mobile) .ab-top-menu>#wp-admin-bar-recovery-mode:hover>.ab-item,#wpadminbar:not(.mobile) .ab-top-menu>#wp-admin-bar-recovery-mode>.ab-item:focus{color:#fff;background-color:#5f97a8}#wpadminbar .quicklinks li#wp-admin-bar-my-account.with-avatar>a img{border-color:#464d52;background-color:#464d52}#wpadminbar #wp-admin-bar-user-info .display-name{color:#fff}#wpadminbar #wp-admin-bar-user-info a:hover .display-name{color:#e14d43}#wpadminbar #wp-admin-bar-user-info .username{color:#c3c4c5}.wp-pointer .wp-pointer-content h3{background-color:#e14d43;border-color:#dd382d}.wp-pointer .wp-pointer-content h3:before{color:#e14d43}.wp-pointer.wp-pointer-top .wp-pointer-arrow,.wp-pointer.wp-pointer-top .wp-pointer-arrow-inner,.wp-pointer.wp-pointer-undefined .wp-pointer-arrow,.wp-pointer.wp-pointer-undefined .wp-pointer-arrow-inner{border-bottom-color:#e14d43}.media-item .bar,.media-progress-bar div{background-color:#e14d43}.details.attachment{box-shadow:inset 0 0 0 3px #fff,inset 0 0 0 7px #e14d43}.attachment.details .check{background-color:#e14d43;box-shadow:0 0 0 1px #fff,0 0 0 2px #e14d43}.media-selection .attachment.selection.details .thumbnail{box-shadow:0 0 0 1px #fff,0 0 0 3px #e14d43}.theme-browser .theme.active .theme-name,.theme-browser .theme.add-new-theme a:focus:after,.theme-browser .theme.add-new-theme a:hover:after{background:#e14d43}.theme-browser .theme.add-new-theme a:focus span:after,.theme-browser .theme.add-new-theme a:hover span:after{color:#e14d43}.theme-filter.current,.theme-section.current{border-bottom-color:#363b3f}body.more-filters-opened .more-filters{color:#fff;background-color:#363b3f}body.more-filters-opened .more-filters:before{color:#fff}body.more-filters-opened .more-filters:focus,body.more-filters-opened .more-filters:hover{background-color:#e14d43;color:#fff}body.more-filters-opened .more-filters:focus:before,body.more-filters-opened .more-filters:hover:before{color:#fff}.widgets-chooser li.widgets-chooser-selected{background-color:#e14d43;color:#fff}.widgets-chooser li.widgets-chooser-selected:before,.widgets-chooser li.widgets-chooser-selected:focus:before{color:#fff}div#wp-responsive-toggle a:before{color:#f1f2f3}.wp-responsive-open div#wp-responsive-toggle a{border-color:transparent;background:#e14d43}.wp-responsive-open #wpadminbar #wp-admin-bar-menu-toggle a{background:#26292c}.wp-responsive-open #wpadminbar #wp-admin-bar-menu-toggle .ab-icon:before{color:#f1f2f3}.mce-container.mce-menu .mce-menu-item-normal.mce-active,.mce-container.mce-menu .mce-menu-item-preview.mce-active,.mce-container.mce-menu .mce-menu-item.mce-selected,.mce-container.mce-menu .mce-menu-item:focus,.mce-container.mce-menu .mce-menu-item:hover{background:#e14d43} \ No newline at end of file
diff --git a/www/crm/wp-admin/css/colors/midnight/colors.css b/www/crm/wp-admin/css/colors/midnight/colors.css
new file mode 100644
index 00000000..00b249a1
--- /dev/null
+++ b/www/crm/wp-admin/css/colors/midnight/colors.css
@@ -0,0 +1,519 @@
+/*! This file is auto-generated */
+/*
+ * Button mixin- creates 3d-ish button effect with correct
+ * highlights/shadows, based on a base color.
+ */
+body {
+ background: #f1f1f1;
+}
+
+/* Links */
+a {
+ color: #0073aa;
+}
+
+a:hover, a:active, a:focus {
+ color: #0096dd;
+}
+
+#media-upload a.del-link:hover,
+div.dashboard-widget-submit input:hover,
+.subsubsub a:hover,
+.subsubsub a.current:hover {
+ color: #0096dd;
+}
+
+/* Forms */
+input[type=checkbox]:checked:before {
+ color: #e14d43;
+}
+
+input[type=radio]:checked:before {
+ background: #e14d43;
+}
+
+.wp-core-ui input[type="reset"]:hover,
+.wp-core-ui input[type="reset"]:active {
+ color: #0096dd;
+}
+
+/* Core UI */
+.wp-core-ui .button-primary {
+ background: #e14d43;
+ border-color: #d02c21 #ba281e #ba281e;
+ color: #fff;
+ box-shadow: 0 1px 0 #ba281e;
+ text-shadow: 0 -1px 1px #ba281e, 1px 0 1px #ba281e, 0 1px 1px #ba281e, -1px 0 1px #ba281e;
+}
+
+.wp-core-ui .button-primary:hover, .wp-core-ui .button-primary:focus {
+ background: #e35950;
+ border-color: #ba281e;
+ color: #fff;
+ box-shadow: 0 1px 0 #ba281e;
+}
+
+.wp-core-ui .button-primary:focus {
+ box-shadow: inset 0 1px 0 #d02c21, 0 0 2px 1px #33b3db;
+}
+
+.wp-core-ui .button-primary:active, .wp-core-ui .button-primary.active, .wp-core-ui .button-primary.active:focus, .wp-core-ui .button-primary.active:hover {
+ background: #d02c21;
+ border-color: #ba281e;
+ box-shadow: inset 0 2px 0 #ba281e;
+}
+
+.wp-core-ui .button-primary[disabled], .wp-core-ui .button-primary:disabled, .wp-core-ui .button-primary.button-primary-disabled, .wp-core-ui .button-primary.disabled {
+ color: #d1c8c7 !important;
+ background: #d92e23 !important;
+ border-color: #ba281e !important;
+ text-shadow: none !important;
+}
+
+.wp-core-ui .button-primary.button-hero {
+ box-shadow: 0 2px 0 #ba281e !important;
+}
+
+.wp-core-ui .button-primary.button-hero:active {
+ box-shadow: inset 0 3px 0 #ba281e !important;
+}
+
+.wp-core-ui .wp-ui-primary {
+ color: #fff;
+ background-color: #363b3f;
+}
+
+.wp-core-ui .wp-ui-text-primary {
+ color: #363b3f;
+}
+
+.wp-core-ui .wp-ui-highlight {
+ color: #fff;
+ background-color: #e14d43;
+}
+
+.wp-core-ui .wp-ui-text-highlight {
+ color: #e14d43;
+}
+
+.wp-core-ui .wp-ui-notification {
+ color: #fff;
+ background-color: #69a8bb;
+}
+
+.wp-core-ui .wp-ui-text-notification {
+ color: #69a8bb;
+}
+
+.wp-core-ui .wp-ui-text-icon {
+ color: #f1f2f3;
+}
+
+/* List tables */
+.wrap .add-new-h2:hover,
+.wrap .page-title-action:hover {
+ color: #fff;
+ background-color: #363b3f;
+}
+
+.view-switch a.current:before {
+ color: #363b3f;
+}
+
+.view-switch a:hover:before {
+ color: #69a8bb;
+}
+
+/* Admin Menu */
+#adminmenuback,
+#adminmenuwrap,
+#adminmenu {
+ background: #363b3f;
+}
+
+#adminmenu a {
+ color: #fff;
+}
+
+#adminmenu div.wp-menu-image:before {
+ color: #f1f2f3;
+}
+
+#adminmenu a:hover,
+#adminmenu li.menu-top:hover,
+#adminmenu li.opensub > a.menu-top,
+#adminmenu li > a.menu-top:focus {
+ color: #fff;
+ background-color: #e14d43;
+}
+
+#adminmenu li.menu-top:hover div.wp-menu-image:before,
+#adminmenu li.opensub > a.menu-top div.wp-menu-image:before {
+ color: #fff;
+}
+
+/* Active tabs use a bottom border color that matches the page background color. */
+.about-wrap .nav-tab-active,
+.nav-tab-active,
+.nav-tab-active:hover {
+ background-color: #f1f1f1;
+ border-bottom-color: #f1f1f1;
+}
+
+/* Admin Menu: submenu */
+#adminmenu .wp-submenu,
+#adminmenu .wp-has-current-submenu .wp-submenu,
+#adminmenu .wp-has-current-submenu.opensub .wp-submenu,
+.folded #adminmenu .wp-has-current-submenu .wp-submenu,
+#adminmenu a.wp-has-current-submenu:focus + .wp-submenu {
+ background: #26292c;
+}
+
+#adminmenu li.wp-has-submenu.wp-not-current-submenu.opensub:hover:after {
+ border-right-color: #26292c;
+}
+
+#adminmenu .wp-submenu .wp-submenu-head {
+ color: #c3c4c5;
+}
+
+#adminmenu .wp-submenu a,
+#adminmenu .wp-has-current-submenu .wp-submenu a,
+.folded #adminmenu .wp-has-current-submenu .wp-submenu a,
+#adminmenu a.wp-has-current-submenu:focus + .wp-submenu a,
+#adminmenu .wp-has-current-submenu.opensub .wp-submenu a {
+ color: #c3c4c5;
+}
+
+#adminmenu .wp-submenu a:focus, #adminmenu .wp-submenu a:hover,
+#adminmenu .wp-has-current-submenu .wp-submenu a:focus,
+#adminmenu .wp-has-current-submenu .wp-submenu a:hover,
+.folded #adminmenu .wp-has-current-submenu .wp-submenu a:focus,
+.folded #adminmenu .wp-has-current-submenu .wp-submenu a:hover,
+#adminmenu a.wp-has-current-submenu:focus + .wp-submenu a:focus,
+#adminmenu a.wp-has-current-submenu:focus + .wp-submenu a:hover,
+#adminmenu .wp-has-current-submenu.opensub .wp-submenu a:focus,
+#adminmenu .wp-has-current-submenu.opensub .wp-submenu a:hover {
+ color: #e14d43;
+}
+
+/* Admin Menu: current */
+#adminmenu .wp-submenu li.current a,
+#adminmenu a.wp-has-current-submenu:focus + .wp-submenu li.current a,
+#adminmenu .wp-has-current-submenu.opensub .wp-submenu li.current a {
+ color: #fff;
+}
+
+#adminmenu .wp-submenu li.current a:hover, #adminmenu .wp-submenu li.current a:focus,
+#adminmenu a.wp-has-current-submenu:focus + .wp-submenu li.current a:hover,
+#adminmenu a.wp-has-current-submenu:focus + .wp-submenu li.current a:focus,
+#adminmenu .wp-has-current-submenu.opensub .wp-submenu li.current a:hover,
+#adminmenu .wp-has-current-submenu.opensub .wp-submenu li.current a:focus {
+ color: #e14d43;
+}
+
+ul#adminmenu a.wp-has-current-submenu:after,
+ul#adminmenu > li.current > a.current:after {
+ border-right-color: #f1f1f1;
+}
+
+#adminmenu li.current a.menu-top,
+#adminmenu li.wp-has-current-submenu a.wp-has-current-submenu,
+#adminmenu li.wp-has-current-submenu .wp-submenu .wp-submenu-head,
+.folded #adminmenu li.current.menu-top {
+ color: #fff;
+ background: #e14d43;
+}
+
+#adminmenu li.wp-has-current-submenu div.wp-menu-image:before,
+#adminmenu a.current:hover div.wp-menu-image:before,
+#adminmenu li.wp-has-current-submenu a:focus div.wp-menu-image:before,
+#adminmenu li.wp-has-current-submenu.opensub div.wp-menu-image:before,
+#adminmenu li:hover div.wp-menu-image:before,
+#adminmenu li a:focus div.wp-menu-image:before,
+#adminmenu li.opensub div.wp-menu-image:before,
+.ie8 #adminmenu li.opensub div.wp-menu-image:before {
+ color: #fff;
+}
+
+/* Admin Menu: bubble */
+#adminmenu .awaiting-mod,
+#adminmenu .update-plugins {
+ color: #fff;
+ background: #69a8bb;
+}
+
+#adminmenu li.current a .awaiting-mod,
+#adminmenu li a.wp-has-current-submenu .update-plugins,
+#adminmenu li:hover a .awaiting-mod,
+#adminmenu li.menu-top:hover > a .update-plugins {
+ color: #fff;
+ background: #26292c;
+}
+
+/* Admin Menu: collapse button */
+#collapse-button {
+ color: #f1f2f3;
+}
+
+#collapse-button:hover,
+#collapse-button:focus {
+ color: #e14d43;
+}
+
+/* Admin Bar */
+#wpadminbar {
+ color: #fff;
+ background: #363b3f;
+}
+
+#wpadminbar .ab-item,
+#wpadminbar a.ab-item,
+#wpadminbar > #wp-toolbar span.ab-label,
+#wpadminbar > #wp-toolbar span.noticon {
+ color: #fff;
+}
+
+#wpadminbar .ab-icon,
+#wpadminbar .ab-icon:before,
+#wpadminbar .ab-item:before,
+#wpadminbar .ab-item:after {
+ color: #f1f2f3;
+}
+
+#wpadminbar:not(.mobile) .ab-top-menu > li:hover > .ab-item,
+#wpadminbar:not(.mobile) .ab-top-menu > li > .ab-item:focus,
+#wpadminbar.nojq .quicklinks .ab-top-menu > li > .ab-item:focus,
+#wpadminbar.nojs .ab-top-menu > li.menupop:hover > .ab-item,
+#wpadminbar .ab-top-menu > li.menupop.hover > .ab-item {
+ color: #e14d43;
+ background: #26292c;
+}
+
+#wpadminbar:not(.mobile) > #wp-toolbar li:hover span.ab-label,
+#wpadminbar:not(.mobile) > #wp-toolbar li.hover span.ab-label,
+#wpadminbar:not(.mobile) > #wp-toolbar a:focus span.ab-label {
+ color: #e14d43;
+}
+
+#wpadminbar:not(.mobile) li:hover .ab-icon:before,
+#wpadminbar:not(.mobile) li:hover .ab-item:before,
+#wpadminbar:not(.mobile) li:hover .ab-item:after,
+#wpadminbar:not(.mobile) li:hover #adminbarsearch:before {
+ color: #fff;
+}
+
+/* Admin Bar: submenu */
+#wpadminbar .menupop .ab-sub-wrapper {
+ background: #26292c;
+}
+
+#wpadminbar .quicklinks .menupop ul.ab-sub-secondary,
+#wpadminbar .quicklinks .menupop ul.ab-sub-secondary .ab-submenu {
+ background: #4c4c4d;
+}
+
+#wpadminbar .ab-submenu .ab-item,
+#wpadminbar .quicklinks .menupop ul li a,
+#wpadminbar .quicklinks .menupop.hover ul li a,
+#wpadminbar.nojs .quicklinks .menupop:hover ul li a {
+ color: #c3c4c5;
+}
+
+#wpadminbar .quicklinks li .blavatar,
+#wpadminbar .menupop .menupop > .ab-item:before {
+ color: #f1f2f3;
+}
+
+#wpadminbar .quicklinks .menupop ul li a:hover,
+#wpadminbar .quicklinks .menupop ul li a:focus,
+#wpadminbar .quicklinks .menupop ul li a:hover strong,
+#wpadminbar .quicklinks .menupop ul li a:focus strong,
+#wpadminbar .quicklinks .ab-sub-wrapper .menupop.hover > a,
+#wpadminbar .quicklinks .menupop.hover ul li a:hover,
+#wpadminbar .quicklinks .menupop.hover ul li a:focus,
+#wpadminbar.nojs .quicklinks .menupop:hover ul li a:hover,
+#wpadminbar.nojs .quicklinks .menupop:hover ul li a:focus,
+#wpadminbar li:hover .ab-icon:before,
+#wpadminbar li:hover .ab-item:before,
+#wpadminbar li a:focus .ab-icon:before,
+#wpadminbar li .ab-item:focus:before,
+#wpadminbar li .ab-item:focus .ab-icon:before,
+#wpadminbar li.hover .ab-icon:before,
+#wpadminbar li.hover .ab-item:before,
+#wpadminbar li:hover #adminbarsearch:before,
+#wpadminbar li #adminbarsearch.adminbar-focused:before {
+ color: #e14d43;
+}
+
+#wpadminbar .quicklinks li a:hover .blavatar,
+#wpadminbar .quicklinks li a:focus .blavatar,
+#wpadminbar .quicklinks .ab-sub-wrapper .menupop.hover > a .blavatar,
+#wpadminbar .menupop .menupop > .ab-item:hover:before,
+#wpadminbar.mobile .quicklinks .ab-icon:before,
+#wpadminbar.mobile .quicklinks .ab-item:before {
+ color: #e14d43;
+}
+
+#wpadminbar.mobile .quicklinks .hover .ab-icon:before,
+#wpadminbar.mobile .quicklinks .hover .ab-item:before {
+ color: #f1f2f3;
+}
+
+/* Admin Bar: search */
+#wpadminbar #adminbarsearch:before {
+ color: #f1f2f3;
+}
+
+#wpadminbar > #wp-toolbar > #wp-admin-bar-top-secondary > #wp-admin-bar-search #adminbarsearch input.adminbar-input:focus {
+ color: #fff;
+ background: #464d52;
+}
+
+/* Admin Bar: recovery mode */
+#wpadminbar #wp-admin-bar-recovery-mode {
+ color: #fff;
+ background-color: #69a8bb;
+}
+
+#wpadminbar #wp-admin-bar-recovery-mode .ab-item,
+#wpadminbar #wp-admin-bar-recovery-mode a.ab-item {
+ color: #fff;
+}
+
+#wpadminbar .ab-top-menu > #wp-admin-bar-recovery-mode.hover > .ab-item,
+#wpadminbar.nojq .quicklinks .ab-top-menu > #wp-admin-bar-recovery-mode > .ab-item:focus,
+#wpadminbar:not(.mobile) .ab-top-menu > #wp-admin-bar-recovery-mode:hover > .ab-item,
+#wpadminbar:not(.mobile) .ab-top-menu > #wp-admin-bar-recovery-mode > .ab-item:focus {
+ color: #fff;
+ background-color: #5f97a8;
+}
+
+/* Admin Bar: my account */
+#wpadminbar .quicklinks li#wp-admin-bar-my-account.with-avatar > a img {
+ border-color: #464d52;
+ background-color: #464d52;
+}
+
+#wpadminbar #wp-admin-bar-user-info .display-name {
+ color: #fff;
+}
+
+#wpadminbar #wp-admin-bar-user-info a:hover .display-name {
+ color: #e14d43;
+}
+
+#wpadminbar #wp-admin-bar-user-info .username {
+ color: #c3c4c5;
+}
+
+/* Pointers */
+.wp-pointer .wp-pointer-content h3 {
+ background-color: #e14d43;
+ border-color: #dd382d;
+}
+
+.wp-pointer .wp-pointer-content h3:before {
+ color: #e14d43;
+}
+
+.wp-pointer.wp-pointer-top .wp-pointer-arrow,
+.wp-pointer.wp-pointer-top .wp-pointer-arrow-inner,
+.wp-pointer.wp-pointer-undefined .wp-pointer-arrow,
+.wp-pointer.wp-pointer-undefined .wp-pointer-arrow-inner {
+ border-bottom-color: #e14d43;
+}
+
+/* Media */
+.media-item .bar,
+.media-progress-bar div {
+ background-color: #e14d43;
+}
+
+.details.attachment {
+ box-shadow: inset 0 0 0 3px #fff, inset 0 0 0 7px #e14d43;
+}
+
+.attachment.details .check {
+ background-color: #e14d43;
+ box-shadow: 0 0 0 1px #fff, 0 0 0 2px #e14d43;
+}
+
+.media-selection .attachment.selection.details .thumbnail {
+ box-shadow: 0 0 0 1px #fff, 0 0 0 3px #e14d43;
+}
+
+/* Themes */
+.theme-browser .theme.active .theme-name,
+.theme-browser .theme.add-new-theme a:hover:after,
+.theme-browser .theme.add-new-theme a:focus:after {
+ background: #e14d43;
+}
+
+.theme-browser .theme.add-new-theme a:hover span:after,
+.theme-browser .theme.add-new-theme a:focus span:after {
+ color: #e14d43;
+}
+
+.theme-section.current,
+.theme-filter.current {
+ border-bottom-color: #363b3f;
+}
+
+body.more-filters-opened .more-filters {
+ color: #fff;
+ background-color: #363b3f;
+}
+
+body.more-filters-opened .more-filters:before {
+ color: #fff;
+}
+
+body.more-filters-opened .more-filters:hover,
+body.more-filters-opened .more-filters:focus {
+ background-color: #e14d43;
+ color: #fff;
+}
+
+body.more-filters-opened .more-filters:hover:before,
+body.more-filters-opened .more-filters:focus:before {
+ color: #fff;
+}
+
+/* Widgets */
+.widgets-chooser li.widgets-chooser-selected {
+ background-color: #e14d43;
+ color: #fff;
+}
+
+.widgets-chooser li.widgets-chooser-selected:before,
+.widgets-chooser li.widgets-chooser-selected:focus:before {
+ color: #fff;
+}
+
+/* Responsive Component */
+div#wp-responsive-toggle a:before {
+ color: #f1f2f3;
+}
+
+.wp-responsive-open div#wp-responsive-toggle a {
+ border-color: transparent;
+ background: #e14d43;
+}
+
+.wp-responsive-open #wpadminbar #wp-admin-bar-menu-toggle a {
+ background: #26292c;
+}
+
+.wp-responsive-open #wpadminbar #wp-admin-bar-menu-toggle .ab-icon:before {
+ color: #f1f2f3;
+}
+
+/* TinyMCE */
+.mce-container.mce-menu .mce-menu-item:hover,
+.mce-container.mce-menu .mce-menu-item.mce-selected,
+.mce-container.mce-menu .mce-menu-item:focus,
+.mce-container.mce-menu .mce-menu-item-normal.mce-active,
+.mce-container.mce-menu .mce-menu-item-preview.mce-active {
+ background: #e14d43;
+}
diff --git a/www/crm/wp-admin/css/colors/midnight/colors.min.css b/www/crm/wp-admin/css/colors/midnight/colors.min.css
new file mode 100644
index 00000000..b24c0ab5
--- /dev/null
+++ b/www/crm/wp-admin/css/colors/midnight/colors.min.css
@@ -0,0 +1,2 @@
+/*! This file is auto-generated */
+body{background:#f1f1f1}a{color:#0073aa}a:active,a:focus,a:hover{color:#0096dd}#media-upload a.del-link:hover,.subsubsub a.current:hover,.subsubsub a:hover,div.dashboard-widget-submit input:hover{color:#0096dd}input[type=checkbox]:checked:before{color:#e14d43}input[type=radio]:checked:before{background:#e14d43}.wp-core-ui input[type=reset]:active,.wp-core-ui input[type=reset]:hover{color:#0096dd}.wp-core-ui .button-primary{background:#e14d43;border-color:#d02c21 #ba281e #ba281e;color:#fff;box-shadow:0 1px 0 #ba281e;text-shadow:0 -1px 1px #ba281e,1px 0 1px #ba281e,0 1px 1px #ba281e,-1px 0 1px #ba281e}.wp-core-ui .button-primary:focus,.wp-core-ui .button-primary:hover{background:#e35950;border-color:#ba281e;color:#fff;box-shadow:0 1px 0 #ba281e}.wp-core-ui .button-primary:focus{box-shadow:inset 0 1px 0 #d02c21,0 0 2px 1px #33b3db}.wp-core-ui .button-primary.active,.wp-core-ui .button-primary.active:focus,.wp-core-ui .button-primary.active:hover,.wp-core-ui .button-primary:active{background:#d02c21;border-color:#ba281e;box-shadow:inset 0 2px 0 #ba281e}.wp-core-ui .button-primary.button-primary-disabled,.wp-core-ui .button-primary.disabled,.wp-core-ui .button-primary:disabled,.wp-core-ui .button-primary[disabled]{color:#d1c8c7!important;background:#d92e23!important;border-color:#ba281e!important;text-shadow:none!important}.wp-core-ui .button-primary.button-hero{box-shadow:0 2px 0 #ba281e!important}.wp-core-ui .button-primary.button-hero:active{box-shadow:inset 0 3px 0 #ba281e!important}.wp-core-ui .wp-ui-primary{color:#fff;background-color:#363b3f}.wp-core-ui .wp-ui-text-primary{color:#363b3f}.wp-core-ui .wp-ui-highlight{color:#fff;background-color:#e14d43}.wp-core-ui .wp-ui-text-highlight{color:#e14d43}.wp-core-ui .wp-ui-notification{color:#fff;background-color:#69a8bb}.wp-core-ui .wp-ui-text-notification{color:#69a8bb}.wp-core-ui .wp-ui-text-icon{color:#f1f2f3}.wrap .add-new-h2:hover,.wrap .page-title-action:hover{color:#fff;background-color:#363b3f}.view-switch a.current:before{color:#363b3f}.view-switch a:hover:before{color:#69a8bb}#adminmenu,#adminmenuback,#adminmenuwrap{background:#363b3f}#adminmenu a{color:#fff}#adminmenu div.wp-menu-image:before{color:#f1f2f3}#adminmenu a:hover,#adminmenu li.menu-top:hover,#adminmenu li.opensub>a.menu-top,#adminmenu li>a.menu-top:focus{color:#fff;background-color:#e14d43}#adminmenu li.menu-top:hover div.wp-menu-image:before,#adminmenu li.opensub>a.menu-top div.wp-menu-image:before{color:#fff}.about-wrap .nav-tab-active,.nav-tab-active,.nav-tab-active:hover{background-color:#f1f1f1;border-bottom-color:#f1f1f1}#adminmenu .wp-has-current-submenu .wp-submenu,#adminmenu .wp-has-current-submenu.opensub .wp-submenu,#adminmenu .wp-submenu,#adminmenu a.wp-has-current-submenu:focus+.wp-submenu,.folded #adminmenu .wp-has-current-submenu .wp-submenu{background:#26292c}#adminmenu li.wp-has-submenu.wp-not-current-submenu.opensub:hover:after{border-right-color:#26292c}#adminmenu .wp-submenu .wp-submenu-head{color:#c3c4c5}#adminmenu .wp-has-current-submenu .wp-submenu a,#adminmenu .wp-has-current-submenu.opensub .wp-submenu a,#adminmenu .wp-submenu a,#adminmenu a.wp-has-current-submenu:focus+.wp-submenu a,.folded #adminmenu .wp-has-current-submenu .wp-submenu a{color:#c3c4c5}#adminmenu .wp-has-current-submenu .wp-submenu a:focus,#adminmenu .wp-has-current-submenu .wp-submenu a:hover,#adminmenu .wp-has-current-submenu.opensub .wp-submenu a:focus,#adminmenu .wp-has-current-submenu.opensub .wp-submenu a:hover,#adminmenu .wp-submenu a:focus,#adminmenu .wp-submenu a:hover,#adminmenu a.wp-has-current-submenu:focus+.wp-submenu a:focus,#adminmenu a.wp-has-current-submenu:focus+.wp-submenu a:hover,.folded #adminmenu .wp-has-current-submenu .wp-submenu a:focus,.folded #adminmenu .wp-has-current-submenu .wp-submenu a:hover{color:#e14d43}#adminmenu .wp-has-current-submenu.opensub .wp-submenu li.current a,#adminmenu .wp-submenu li.current a,#adminmenu a.wp-has-current-submenu:focus+.wp-submenu li.current a{color:#fff}#adminmenu .wp-has-current-submenu.opensub .wp-submenu li.current a:focus,#adminmenu .wp-has-current-submenu.opensub .wp-submenu li.current a:hover,#adminmenu .wp-submenu li.current a:focus,#adminmenu .wp-submenu li.current a:hover,#adminmenu a.wp-has-current-submenu:focus+.wp-submenu li.current a:focus,#adminmenu a.wp-has-current-submenu:focus+.wp-submenu li.current a:hover{color:#e14d43}ul#adminmenu a.wp-has-current-submenu:after,ul#adminmenu>li.current>a.current:after{border-right-color:#f1f1f1}#adminmenu li.current a.menu-top,#adminmenu li.wp-has-current-submenu .wp-submenu .wp-submenu-head,#adminmenu li.wp-has-current-submenu a.wp-has-current-submenu,.folded #adminmenu li.current.menu-top{color:#fff;background:#e14d43}#adminmenu a.current:hover div.wp-menu-image:before,#adminmenu li a:focus div.wp-menu-image:before,#adminmenu li.opensub div.wp-menu-image:before,#adminmenu li.wp-has-current-submenu a:focus div.wp-menu-image:before,#adminmenu li.wp-has-current-submenu div.wp-menu-image:before,#adminmenu li.wp-has-current-submenu.opensub div.wp-menu-image:before,#adminmenu li:hover div.wp-menu-image:before,.ie8 #adminmenu li.opensub div.wp-menu-image:before{color:#fff}#adminmenu .awaiting-mod,#adminmenu .update-plugins{color:#fff;background:#69a8bb}#adminmenu li a.wp-has-current-submenu .update-plugins,#adminmenu li.current a .awaiting-mod,#adminmenu li.menu-top:hover>a .update-plugins,#adminmenu li:hover a .awaiting-mod{color:#fff;background:#26292c}#collapse-button{color:#f1f2f3}#collapse-button:focus,#collapse-button:hover{color:#e14d43}#wpadminbar{color:#fff;background:#363b3f}#wpadminbar .ab-item,#wpadminbar a.ab-item,#wpadminbar>#wp-toolbar span.ab-label,#wpadminbar>#wp-toolbar span.noticon{color:#fff}#wpadminbar .ab-icon,#wpadminbar .ab-icon:before,#wpadminbar .ab-item:after,#wpadminbar .ab-item:before{color:#f1f2f3}#wpadminbar .ab-top-menu>li.menupop.hover>.ab-item,#wpadminbar.nojq .quicklinks .ab-top-menu>li>.ab-item:focus,#wpadminbar.nojs .ab-top-menu>li.menupop:hover>.ab-item,#wpadminbar:not(.mobile) .ab-top-menu>li:hover>.ab-item,#wpadminbar:not(.mobile) .ab-top-menu>li>.ab-item:focus{color:#e14d43;background:#26292c}#wpadminbar:not(.mobile)>#wp-toolbar a:focus span.ab-label,#wpadminbar:not(.mobile)>#wp-toolbar li.hover span.ab-label,#wpadminbar:not(.mobile)>#wp-toolbar li:hover span.ab-label{color:#e14d43}#wpadminbar:not(.mobile) li:hover #adminbarsearch:before,#wpadminbar:not(.mobile) li:hover .ab-icon:before,#wpadminbar:not(.mobile) li:hover .ab-item:after,#wpadminbar:not(.mobile) li:hover .ab-item:before{color:#fff}#wpadminbar .menupop .ab-sub-wrapper{background:#26292c}#wpadminbar .quicklinks .menupop ul.ab-sub-secondary,#wpadminbar .quicklinks .menupop ul.ab-sub-secondary .ab-submenu{background:#4c4c4d}#wpadminbar .ab-submenu .ab-item,#wpadminbar .quicklinks .menupop ul li a,#wpadminbar .quicklinks .menupop.hover ul li a,#wpadminbar.nojs .quicklinks .menupop:hover ul li a{color:#c3c4c5}#wpadminbar .menupop .menupop>.ab-item:before,#wpadminbar .quicklinks li .blavatar{color:#f1f2f3}#wpadminbar .quicklinks .ab-sub-wrapper .menupop.hover>a,#wpadminbar .quicklinks .menupop ul li a:focus,#wpadminbar .quicklinks .menupop ul li a:focus strong,#wpadminbar .quicklinks .menupop ul li a:hover,#wpadminbar .quicklinks .menupop ul li a:hover strong,#wpadminbar .quicklinks .menupop.hover ul li a:focus,#wpadminbar .quicklinks .menupop.hover ul li a:hover,#wpadminbar li #adminbarsearch.adminbar-focused:before,#wpadminbar li .ab-item:focus .ab-icon:before,#wpadminbar li .ab-item:focus:before,#wpadminbar li a:focus .ab-icon:before,#wpadminbar li.hover .ab-icon:before,#wpadminbar li.hover .ab-item:before,#wpadminbar li:hover #adminbarsearch:before,#wpadminbar li:hover .ab-icon:before,#wpadminbar li:hover .ab-item:before,#wpadminbar.nojs .quicklinks .menupop:hover ul li a:focus,#wpadminbar.nojs .quicklinks .menupop:hover ul li a:hover{color:#e14d43}#wpadminbar .menupop .menupop>.ab-item:hover:before,#wpadminbar .quicklinks .ab-sub-wrapper .menupop.hover>a .blavatar,#wpadminbar .quicklinks li a:focus .blavatar,#wpadminbar .quicklinks li a:hover .blavatar,#wpadminbar.mobile .quicklinks .ab-icon:before,#wpadminbar.mobile .quicklinks .ab-item:before{color:#e14d43}#wpadminbar.mobile .quicklinks .hover .ab-icon:before,#wpadminbar.mobile .quicklinks .hover .ab-item:before{color:#f1f2f3}#wpadminbar #adminbarsearch:before{color:#f1f2f3}#wpadminbar>#wp-toolbar>#wp-admin-bar-top-secondary>#wp-admin-bar-search #adminbarsearch input.adminbar-input:focus{color:#fff;background:#464d52}#wpadminbar #wp-admin-bar-recovery-mode{color:#fff;background-color:#69a8bb}#wpadminbar #wp-admin-bar-recovery-mode .ab-item,#wpadminbar #wp-admin-bar-recovery-mode a.ab-item{color:#fff}#wpadminbar .ab-top-menu>#wp-admin-bar-recovery-mode.hover>.ab-item,#wpadminbar.nojq .quicklinks .ab-top-menu>#wp-admin-bar-recovery-mode>.ab-item:focus,#wpadminbar:not(.mobile) .ab-top-menu>#wp-admin-bar-recovery-mode:hover>.ab-item,#wpadminbar:not(.mobile) .ab-top-menu>#wp-admin-bar-recovery-mode>.ab-item:focus{color:#fff;background-color:#5f97a8}#wpadminbar .quicklinks li#wp-admin-bar-my-account.with-avatar>a img{border-color:#464d52;background-color:#464d52}#wpadminbar #wp-admin-bar-user-info .display-name{color:#fff}#wpadminbar #wp-admin-bar-user-info a:hover .display-name{color:#e14d43}#wpadminbar #wp-admin-bar-user-info .username{color:#c3c4c5}.wp-pointer .wp-pointer-content h3{background-color:#e14d43;border-color:#dd382d}.wp-pointer .wp-pointer-content h3:before{color:#e14d43}.wp-pointer.wp-pointer-top .wp-pointer-arrow,.wp-pointer.wp-pointer-top .wp-pointer-arrow-inner,.wp-pointer.wp-pointer-undefined .wp-pointer-arrow,.wp-pointer.wp-pointer-undefined .wp-pointer-arrow-inner{border-bottom-color:#e14d43}.media-item .bar,.media-progress-bar div{background-color:#e14d43}.details.attachment{box-shadow:inset 0 0 0 3px #fff,inset 0 0 0 7px #e14d43}.attachment.details .check{background-color:#e14d43;box-shadow:0 0 0 1px #fff,0 0 0 2px #e14d43}.media-selection .attachment.selection.details .thumbnail{box-shadow:0 0 0 1px #fff,0 0 0 3px #e14d43}.theme-browser .theme.active .theme-name,.theme-browser .theme.add-new-theme a:focus:after,.theme-browser .theme.add-new-theme a:hover:after{background:#e14d43}.theme-browser .theme.add-new-theme a:focus span:after,.theme-browser .theme.add-new-theme a:hover span:after{color:#e14d43}.theme-filter.current,.theme-section.current{border-bottom-color:#363b3f}body.more-filters-opened .more-filters{color:#fff;background-color:#363b3f}body.more-filters-opened .more-filters:before{color:#fff}body.more-filters-opened .more-filters:focus,body.more-filters-opened .more-filters:hover{background-color:#e14d43;color:#fff}body.more-filters-opened .more-filters:focus:before,body.more-filters-opened .more-filters:hover:before{color:#fff}.widgets-chooser li.widgets-chooser-selected{background-color:#e14d43;color:#fff}.widgets-chooser li.widgets-chooser-selected:before,.widgets-chooser li.widgets-chooser-selected:focus:before{color:#fff}div#wp-responsive-toggle a:before{color:#f1f2f3}.wp-responsive-open div#wp-responsive-toggle a{border-color:transparent;background:#e14d43}.wp-responsive-open #wpadminbar #wp-admin-bar-menu-toggle a{background:#26292c}.wp-responsive-open #wpadminbar #wp-admin-bar-menu-toggle .ab-icon:before{color:#f1f2f3}.mce-container.mce-menu .mce-menu-item-normal.mce-active,.mce-container.mce-menu .mce-menu-item-preview.mce-active,.mce-container.mce-menu .mce-menu-item.mce-selected,.mce-container.mce-menu .mce-menu-item:focus,.mce-container.mce-menu .mce-menu-item:hover{background:#e14d43} \ No newline at end of file
diff --git a/www/crm/wp-admin/css/colors/midnight/colors.scss b/www/crm/wp-admin/css/colors/midnight/colors.scss
new file mode 100644
index 00000000..591232b7
--- /dev/null
+++ b/www/crm/wp-admin/css/colors/midnight/colors.scss
@@ -0,0 +1,5 @@
+$base-color: #363b3f;
+$highlight-color: #e14d43;
+$notification-color: #69a8bb;
+
+@import "../_admin.scss";
diff --git a/www/crm/wp-admin/css/colors/ocean/colors-rtl.css b/www/crm/wp-admin/css/colors/ocean/colors-rtl.css
new file mode 100644
index 00000000..5ea4e96f
--- /dev/null
+++ b/www/crm/wp-admin/css/colors/ocean/colors-rtl.css
@@ -0,0 +1,519 @@
+/*! This file is auto-generated */
+/*
+ * Button mixin- creates 3d-ish button effect with correct
+ * highlights/shadows, based on a base color.
+ */
+body {
+ background: #f1f1f1;
+}
+
+/* Links */
+a {
+ color: #0073aa;
+}
+
+a:hover, a:active, a:focus {
+ color: #0096dd;
+}
+
+#media-upload a.del-link:hover,
+div.dashboard-widget-submit input:hover,
+.subsubsub a:hover,
+.subsubsub a.current:hover {
+ color: #0096dd;
+}
+
+/* Forms */
+input[type=checkbox]:checked:before {
+ color: #738e96;
+}
+
+input[type=radio]:checked:before {
+ background: #738e96;
+}
+
+.wp-core-ui input[type="reset"]:hover,
+.wp-core-ui input[type="reset"]:active {
+ color: #0096dd;
+}
+
+/* Core UI */
+.wp-core-ui .button-primary {
+ background: #9ebaa0;
+ border-color: #80a583 #719a74 #719a74;
+ color: #fff;
+ box-shadow: 0 1px 0 #719a74;
+ text-shadow: 0 -1px 1px #719a74, -1px 0 1px #719a74, 0 1px 1px #719a74, 1px 0 1px #719a74;
+}
+
+.wp-core-ui .button-primary:hover, .wp-core-ui .button-primary:focus {
+ background: #a7c0a9;
+ border-color: #719a74;
+ color: #fff;
+ box-shadow: 0 1px 0 #719a74;
+}
+
+.wp-core-ui .button-primary:focus {
+ box-shadow: inset 0 1px 0 #80a583, 0 0 2px 1px #33b3db;
+}
+
+.wp-core-ui .button-primary:active, .wp-core-ui .button-primary.active, .wp-core-ui .button-primary.active:focus, .wp-core-ui .button-primary.active:hover {
+ background: #80a583;
+ border-color: #719a74;
+ box-shadow: inset 0 2px 0 #719a74;
+}
+
+.wp-core-ui .button-primary[disabled], .wp-core-ui .button-primary:disabled, .wp-core-ui .button-primary.button-primary-disabled, .wp-core-ui .button-primary.disabled {
+ color: #c7d1c8 !important;
+ background: #86a989 !important;
+ border-color: #719a74 !important;
+ text-shadow: none !important;
+}
+
+.wp-core-ui .button-primary.button-hero {
+ box-shadow: 0 2px 0 #719a74 !important;
+}
+
+.wp-core-ui .button-primary.button-hero:active {
+ box-shadow: inset 0 3px 0 #719a74 !important;
+}
+
+.wp-core-ui .wp-ui-primary {
+ color: #fff;
+ background-color: #738e96;
+}
+
+.wp-core-ui .wp-ui-text-primary {
+ color: #738e96;
+}
+
+.wp-core-ui .wp-ui-highlight {
+ color: #fff;
+ background-color: #9ebaa0;
+}
+
+.wp-core-ui .wp-ui-text-highlight {
+ color: #9ebaa0;
+}
+
+.wp-core-ui .wp-ui-notification {
+ color: #fff;
+ background-color: #aa9d88;
+}
+
+.wp-core-ui .wp-ui-text-notification {
+ color: #aa9d88;
+}
+
+.wp-core-ui .wp-ui-text-icon {
+ color: #f2fcff;
+}
+
+/* List tables */
+.wrap .add-new-h2:hover,
+.wrap .page-title-action:hover {
+ color: #fff;
+ background-color: #738e96;
+}
+
+.view-switch a.current:before {
+ color: #738e96;
+}
+
+.view-switch a:hover:before {
+ color: #aa9d88;
+}
+
+/* Admin Menu */
+#adminmenuback,
+#adminmenuwrap,
+#adminmenu {
+ background: #738e96;
+}
+
+#adminmenu a {
+ color: #fff;
+}
+
+#adminmenu div.wp-menu-image:before {
+ color: #f2fcff;
+}
+
+#adminmenu a:hover,
+#adminmenu li.menu-top:hover,
+#adminmenu li.opensub > a.menu-top,
+#adminmenu li > a.menu-top:focus {
+ color: #fff;
+ background-color: #9ebaa0;
+}
+
+#adminmenu li.menu-top:hover div.wp-menu-image:before,
+#adminmenu li.opensub > a.menu-top div.wp-menu-image:before {
+ color: #fff;
+}
+
+/* Active tabs use a bottom border color that matches the page background color. */
+.about-wrap .nav-tab-active,
+.nav-tab-active,
+.nav-tab-active:hover {
+ background-color: #f1f1f1;
+ border-bottom-color: #f1f1f1;
+}
+
+/* Admin Menu: submenu */
+#adminmenu .wp-submenu,
+#adminmenu .wp-has-current-submenu .wp-submenu,
+#adminmenu .wp-has-current-submenu.opensub .wp-submenu,
+.folded #adminmenu .wp-has-current-submenu .wp-submenu,
+#adminmenu a.wp-has-current-submenu:focus + .wp-submenu {
+ background: #627c83;
+}
+
+#adminmenu li.wp-has-submenu.wp-not-current-submenu.opensub:hover:after {
+ border-left-color: #627c83;
+}
+
+#adminmenu .wp-submenu .wp-submenu-head {
+ color: #d5dde0;
+}
+
+#adminmenu .wp-submenu a,
+#adminmenu .wp-has-current-submenu .wp-submenu a,
+.folded #adminmenu .wp-has-current-submenu .wp-submenu a,
+#adminmenu a.wp-has-current-submenu:focus + .wp-submenu a,
+#adminmenu .wp-has-current-submenu.opensub .wp-submenu a {
+ color: #d5dde0;
+}
+
+#adminmenu .wp-submenu a:focus, #adminmenu .wp-submenu a:hover,
+#adminmenu .wp-has-current-submenu .wp-submenu a:focus,
+#adminmenu .wp-has-current-submenu .wp-submenu a:hover,
+.folded #adminmenu .wp-has-current-submenu .wp-submenu a:focus,
+.folded #adminmenu .wp-has-current-submenu .wp-submenu a:hover,
+#adminmenu a.wp-has-current-submenu:focus + .wp-submenu a:focus,
+#adminmenu a.wp-has-current-submenu:focus + .wp-submenu a:hover,
+#adminmenu .wp-has-current-submenu.opensub .wp-submenu a:focus,
+#adminmenu .wp-has-current-submenu.opensub .wp-submenu a:hover {
+ color: #9ebaa0;
+}
+
+/* Admin Menu: current */
+#adminmenu .wp-submenu li.current a,
+#adminmenu a.wp-has-current-submenu:focus + .wp-submenu li.current a,
+#adminmenu .wp-has-current-submenu.opensub .wp-submenu li.current a {
+ color: #fff;
+}
+
+#adminmenu .wp-submenu li.current a:hover, #adminmenu .wp-submenu li.current a:focus,
+#adminmenu a.wp-has-current-submenu:focus + .wp-submenu li.current a:hover,
+#adminmenu a.wp-has-current-submenu:focus + .wp-submenu li.current a:focus,
+#adminmenu .wp-has-current-submenu.opensub .wp-submenu li.current a:hover,
+#adminmenu .wp-has-current-submenu.opensub .wp-submenu li.current a:focus {
+ color: #9ebaa0;
+}
+
+ul#adminmenu a.wp-has-current-submenu:after,
+ul#adminmenu > li.current > a.current:after {
+ border-left-color: #f1f1f1;
+}
+
+#adminmenu li.current a.menu-top,
+#adminmenu li.wp-has-current-submenu a.wp-has-current-submenu,
+#adminmenu li.wp-has-current-submenu .wp-submenu .wp-submenu-head,
+.folded #adminmenu li.current.menu-top {
+ color: #fff;
+ background: #9ebaa0;
+}
+
+#adminmenu li.wp-has-current-submenu div.wp-menu-image:before,
+#adminmenu a.current:hover div.wp-menu-image:before,
+#adminmenu li.wp-has-current-submenu a:focus div.wp-menu-image:before,
+#adminmenu li.wp-has-current-submenu.opensub div.wp-menu-image:before,
+#adminmenu li:hover div.wp-menu-image:before,
+#adminmenu li a:focus div.wp-menu-image:before,
+#adminmenu li.opensub div.wp-menu-image:before,
+.ie8 #adminmenu li.opensub div.wp-menu-image:before {
+ color: #fff;
+}
+
+/* Admin Menu: bubble */
+#adminmenu .awaiting-mod,
+#adminmenu .update-plugins {
+ color: #fff;
+ background: #aa9d88;
+}
+
+#adminmenu li.current a .awaiting-mod,
+#adminmenu li a.wp-has-current-submenu .update-plugins,
+#adminmenu li:hover a .awaiting-mod,
+#adminmenu li.menu-top:hover > a .update-plugins {
+ color: #fff;
+ background: #627c83;
+}
+
+/* Admin Menu: collapse button */
+#collapse-button {
+ color: #f2fcff;
+}
+
+#collapse-button:hover,
+#collapse-button:focus {
+ color: #9ebaa0;
+}
+
+/* Admin Bar */
+#wpadminbar {
+ color: #fff;
+ background: #738e96;
+}
+
+#wpadminbar .ab-item,
+#wpadminbar a.ab-item,
+#wpadminbar > #wp-toolbar span.ab-label,
+#wpadminbar > #wp-toolbar span.noticon {
+ color: #fff;
+}
+
+#wpadminbar .ab-icon,
+#wpadminbar .ab-icon:before,
+#wpadminbar .ab-item:before,
+#wpadminbar .ab-item:after {
+ color: #f2fcff;
+}
+
+#wpadminbar:not(.mobile) .ab-top-menu > li:hover > .ab-item,
+#wpadminbar:not(.mobile) .ab-top-menu > li > .ab-item:focus,
+#wpadminbar.nojq .quicklinks .ab-top-menu > li > .ab-item:focus,
+#wpadminbar.nojs .ab-top-menu > li.menupop:hover > .ab-item,
+#wpadminbar .ab-top-menu > li.menupop.hover > .ab-item {
+ color: #9ebaa0;
+ background: #627c83;
+}
+
+#wpadminbar:not(.mobile) > #wp-toolbar li:hover span.ab-label,
+#wpadminbar:not(.mobile) > #wp-toolbar li.hover span.ab-label,
+#wpadminbar:not(.mobile) > #wp-toolbar a:focus span.ab-label {
+ color: #9ebaa0;
+}
+
+#wpadminbar:not(.mobile) li:hover .ab-icon:before,
+#wpadminbar:not(.mobile) li:hover .ab-item:before,
+#wpadminbar:not(.mobile) li:hover .ab-item:after,
+#wpadminbar:not(.mobile) li:hover #adminbarsearch:before {
+ color: #fff;
+}
+
+/* Admin Bar: submenu */
+#wpadminbar .menupop .ab-sub-wrapper {
+ background: #627c83;
+}
+
+#wpadminbar .quicklinks .menupop ul.ab-sub-secondary,
+#wpadminbar .quicklinks .menupop ul.ab-sub-secondary .ab-submenu {
+ background: #8f9a9e;
+}
+
+#wpadminbar .ab-submenu .ab-item,
+#wpadminbar .quicklinks .menupop ul li a,
+#wpadminbar .quicklinks .menupop.hover ul li a,
+#wpadminbar.nojs .quicklinks .menupop:hover ul li a {
+ color: #d5dde0;
+}
+
+#wpadminbar .quicklinks li .blavatar,
+#wpadminbar .menupop .menupop > .ab-item:before {
+ color: #f2fcff;
+}
+
+#wpadminbar .quicklinks .menupop ul li a:hover,
+#wpadminbar .quicklinks .menupop ul li a:focus,
+#wpadminbar .quicklinks .menupop ul li a:hover strong,
+#wpadminbar .quicklinks .menupop ul li a:focus strong,
+#wpadminbar .quicklinks .ab-sub-wrapper .menupop.hover > a,
+#wpadminbar .quicklinks .menupop.hover ul li a:hover,
+#wpadminbar .quicklinks .menupop.hover ul li a:focus,
+#wpadminbar.nojs .quicklinks .menupop:hover ul li a:hover,
+#wpadminbar.nojs .quicklinks .menupop:hover ul li a:focus,
+#wpadminbar li:hover .ab-icon:before,
+#wpadminbar li:hover .ab-item:before,
+#wpadminbar li a:focus .ab-icon:before,
+#wpadminbar li .ab-item:focus:before,
+#wpadminbar li .ab-item:focus .ab-icon:before,
+#wpadminbar li.hover .ab-icon:before,
+#wpadminbar li.hover .ab-item:before,
+#wpadminbar li:hover #adminbarsearch:before,
+#wpadminbar li #adminbarsearch.adminbar-focused:before {
+ color: #9ebaa0;
+}
+
+#wpadminbar .quicklinks li a:hover .blavatar,
+#wpadminbar .quicklinks li a:focus .blavatar,
+#wpadminbar .quicklinks .ab-sub-wrapper .menupop.hover > a .blavatar,
+#wpadminbar .menupop .menupop > .ab-item:hover:before,
+#wpadminbar.mobile .quicklinks .ab-icon:before,
+#wpadminbar.mobile .quicklinks .ab-item:before {
+ color: #9ebaa0;
+}
+
+#wpadminbar.mobile .quicklinks .hover .ab-icon:before,
+#wpadminbar.mobile .quicklinks .hover .ab-item:before {
+ color: #f2fcff;
+}
+
+/* Admin Bar: search */
+#wpadminbar #adminbarsearch:before {
+ color: #f2fcff;
+}
+
+#wpadminbar > #wp-toolbar > #wp-admin-bar-top-secondary > #wp-admin-bar-search #adminbarsearch input.adminbar-input:focus {
+ color: #fff;
+ background: #879ea5;
+}
+
+/* Admin Bar: recovery mode */
+#wpadminbar #wp-admin-bar-recovery-mode {
+ color: #fff;
+ background-color: #aa9d88;
+}
+
+#wpadminbar #wp-admin-bar-recovery-mode .ab-item,
+#wpadminbar #wp-admin-bar-recovery-mode a.ab-item {
+ color: #fff;
+}
+
+#wpadminbar .ab-top-menu > #wp-admin-bar-recovery-mode.hover > .ab-item,
+#wpadminbar.nojq .quicklinks .ab-top-menu > #wp-admin-bar-recovery-mode > .ab-item:focus,
+#wpadminbar:not(.mobile) .ab-top-menu > #wp-admin-bar-recovery-mode:hover > .ab-item,
+#wpadminbar:not(.mobile) .ab-top-menu > #wp-admin-bar-recovery-mode > .ab-item:focus {
+ color: #fff;
+ background-color: #998d7a;
+}
+
+/* Admin Bar: my account */
+#wpadminbar .quicklinks li#wp-admin-bar-my-account.with-avatar > a img {
+ border-color: #879ea5;
+ background-color: #879ea5;
+}
+
+#wpadminbar #wp-admin-bar-user-info .display-name {
+ color: #fff;
+}
+
+#wpadminbar #wp-admin-bar-user-info a:hover .display-name {
+ color: #9ebaa0;
+}
+
+#wpadminbar #wp-admin-bar-user-info .username {
+ color: #d5dde0;
+}
+
+/* Pointers */
+.wp-pointer .wp-pointer-content h3 {
+ background-color: #9ebaa0;
+ border-color: #8faf91;
+}
+
+.wp-pointer .wp-pointer-content h3:before {
+ color: #9ebaa0;
+}
+
+.wp-pointer.wp-pointer-top .wp-pointer-arrow,
+.wp-pointer.wp-pointer-top .wp-pointer-arrow-inner,
+.wp-pointer.wp-pointer-undefined .wp-pointer-arrow,
+.wp-pointer.wp-pointer-undefined .wp-pointer-arrow-inner {
+ border-bottom-color: #9ebaa0;
+}
+
+/* Media */
+.media-item .bar,
+.media-progress-bar div {
+ background-color: #9ebaa0;
+}
+
+.details.attachment {
+ box-shadow: inset 0 0 0 3px #fff, inset 0 0 0 7px #9ebaa0;
+}
+
+.attachment.details .check {
+ background-color: #9ebaa0;
+ box-shadow: 0 0 0 1px #fff, 0 0 0 2px #9ebaa0;
+}
+
+.media-selection .attachment.selection.details .thumbnail {
+ box-shadow: 0 0 0 1px #fff, 0 0 0 3px #9ebaa0;
+}
+
+/* Themes */
+.theme-browser .theme.active .theme-name,
+.theme-browser .theme.add-new-theme a:hover:after,
+.theme-browser .theme.add-new-theme a:focus:after {
+ background: #9ebaa0;
+}
+
+.theme-browser .theme.add-new-theme a:hover span:after,
+.theme-browser .theme.add-new-theme a:focus span:after {
+ color: #9ebaa0;
+}
+
+.theme-section.current,
+.theme-filter.current {
+ border-bottom-color: #738e96;
+}
+
+body.more-filters-opened .more-filters {
+ color: #fff;
+ background-color: #738e96;
+}
+
+body.more-filters-opened .more-filters:before {
+ color: #fff;
+}
+
+body.more-filters-opened .more-filters:hover,
+body.more-filters-opened .more-filters:focus {
+ background-color: #9ebaa0;
+ color: #fff;
+}
+
+body.more-filters-opened .more-filters:hover:before,
+body.more-filters-opened .more-filters:focus:before {
+ color: #fff;
+}
+
+/* Widgets */
+.widgets-chooser li.widgets-chooser-selected {
+ background-color: #9ebaa0;
+ color: #fff;
+}
+
+.widgets-chooser li.widgets-chooser-selected:before,
+.widgets-chooser li.widgets-chooser-selected:focus:before {
+ color: #fff;
+}
+
+/* Responsive Component */
+div#wp-responsive-toggle a:before {
+ color: #f2fcff;
+}
+
+.wp-responsive-open div#wp-responsive-toggle a {
+ border-color: transparent;
+ background: #9ebaa0;
+}
+
+.wp-responsive-open #wpadminbar #wp-admin-bar-menu-toggle a {
+ background: #627c83;
+}
+
+.wp-responsive-open #wpadminbar #wp-admin-bar-menu-toggle .ab-icon:before {
+ color: #f2fcff;
+}
+
+/* TinyMCE */
+.mce-container.mce-menu .mce-menu-item:hover,
+.mce-container.mce-menu .mce-menu-item.mce-selected,
+.mce-container.mce-menu .mce-menu-item:focus,
+.mce-container.mce-menu .mce-menu-item-normal.mce-active,
+.mce-container.mce-menu .mce-menu-item-preview.mce-active {
+ background: #9ebaa0;
+}
diff --git a/www/crm/wp-admin/css/colors/ocean/colors-rtl.min.css b/www/crm/wp-admin/css/colors/ocean/colors-rtl.min.css
new file mode 100644
index 00000000..8c9b472c
--- /dev/null
+++ b/www/crm/wp-admin/css/colors/ocean/colors-rtl.min.css
@@ -0,0 +1,2 @@
+/*! This file is auto-generated */
+body{background:#f1f1f1}a{color:#0073aa}a:active,a:focus,a:hover{color:#0096dd}#media-upload a.del-link:hover,.subsubsub a.current:hover,.subsubsub a:hover,div.dashboard-widget-submit input:hover{color:#0096dd}input[type=checkbox]:checked:before{color:#738e96}input[type=radio]:checked:before{background:#738e96}.wp-core-ui input[type=reset]:active,.wp-core-ui input[type=reset]:hover{color:#0096dd}.wp-core-ui .button-primary{background:#9ebaa0;border-color:#80a583 #719a74 #719a74;color:#fff;box-shadow:0 1px 0 #719a74;text-shadow:0 -1px 1px #719a74,-1px 0 1px #719a74,0 1px 1px #719a74,1px 0 1px #719a74}.wp-core-ui .button-primary:focus,.wp-core-ui .button-primary:hover{background:#a7c0a9;border-color:#719a74;color:#fff;box-shadow:0 1px 0 #719a74}.wp-core-ui .button-primary:focus{box-shadow:inset 0 1px 0 #80a583,0 0 2px 1px #33b3db}.wp-core-ui .button-primary.active,.wp-core-ui .button-primary.active:focus,.wp-core-ui .button-primary.active:hover,.wp-core-ui .button-primary:active{background:#80a583;border-color:#719a74;box-shadow:inset 0 2px 0 #719a74}.wp-core-ui .button-primary.button-primary-disabled,.wp-core-ui .button-primary.disabled,.wp-core-ui .button-primary:disabled,.wp-core-ui .button-primary[disabled]{color:#c7d1c8!important;background:#86a989!important;border-color:#719a74!important;text-shadow:none!important}.wp-core-ui .button-primary.button-hero{box-shadow:0 2px 0 #719a74!important}.wp-core-ui .button-primary.button-hero:active{box-shadow:inset 0 3px 0 #719a74!important}.wp-core-ui .wp-ui-primary{color:#fff;background-color:#738e96}.wp-core-ui .wp-ui-text-primary{color:#738e96}.wp-core-ui .wp-ui-highlight{color:#fff;background-color:#9ebaa0}.wp-core-ui .wp-ui-text-highlight{color:#9ebaa0}.wp-core-ui .wp-ui-notification{color:#fff;background-color:#aa9d88}.wp-core-ui .wp-ui-text-notification{color:#aa9d88}.wp-core-ui .wp-ui-text-icon{color:#f2fcff}.wrap .add-new-h2:hover,.wrap .page-title-action:hover{color:#fff;background-color:#738e96}.view-switch a.current:before{color:#738e96}.view-switch a:hover:before{color:#aa9d88}#adminmenu,#adminmenuback,#adminmenuwrap{background:#738e96}#adminmenu a{color:#fff}#adminmenu div.wp-menu-image:before{color:#f2fcff}#adminmenu a:hover,#adminmenu li.menu-top:hover,#adminmenu li.opensub>a.menu-top,#adminmenu li>a.menu-top:focus{color:#fff;background-color:#9ebaa0}#adminmenu li.menu-top:hover div.wp-menu-image:before,#adminmenu li.opensub>a.menu-top div.wp-menu-image:before{color:#fff}.about-wrap .nav-tab-active,.nav-tab-active,.nav-tab-active:hover{background-color:#f1f1f1;border-bottom-color:#f1f1f1}#adminmenu .wp-has-current-submenu .wp-submenu,#adminmenu .wp-has-current-submenu.opensub .wp-submenu,#adminmenu .wp-submenu,#adminmenu a.wp-has-current-submenu:focus+.wp-submenu,.folded #adminmenu .wp-has-current-submenu .wp-submenu{background:#627c83}#adminmenu li.wp-has-submenu.wp-not-current-submenu.opensub:hover:after{border-left-color:#627c83}#adminmenu .wp-submenu .wp-submenu-head{color:#d5dde0}#adminmenu .wp-has-current-submenu .wp-submenu a,#adminmenu .wp-has-current-submenu.opensub .wp-submenu a,#adminmenu .wp-submenu a,#adminmenu a.wp-has-current-submenu:focus+.wp-submenu a,.folded #adminmenu .wp-has-current-submenu .wp-submenu a{color:#d5dde0}#adminmenu .wp-has-current-submenu .wp-submenu a:focus,#adminmenu .wp-has-current-submenu .wp-submenu a:hover,#adminmenu .wp-has-current-submenu.opensub .wp-submenu a:focus,#adminmenu .wp-has-current-submenu.opensub .wp-submenu a:hover,#adminmenu .wp-submenu a:focus,#adminmenu .wp-submenu a:hover,#adminmenu a.wp-has-current-submenu:focus+.wp-submenu a:focus,#adminmenu a.wp-has-current-submenu:focus+.wp-submenu a:hover,.folded #adminmenu .wp-has-current-submenu .wp-submenu a:focus,.folded #adminmenu .wp-has-current-submenu .wp-submenu a:hover{color:#9ebaa0}#adminmenu .wp-has-current-submenu.opensub .wp-submenu li.current a,#adminmenu .wp-submenu li.current a,#adminmenu a.wp-has-current-submenu:focus+.wp-submenu li.current a{color:#fff}#adminmenu .wp-has-current-submenu.opensub .wp-submenu li.current a:focus,#adminmenu .wp-has-current-submenu.opensub .wp-submenu li.current a:hover,#adminmenu .wp-submenu li.current a:focus,#adminmenu .wp-submenu li.current a:hover,#adminmenu a.wp-has-current-submenu:focus+.wp-submenu li.current a:focus,#adminmenu a.wp-has-current-submenu:focus+.wp-submenu li.current a:hover{color:#9ebaa0}ul#adminmenu a.wp-has-current-submenu:after,ul#adminmenu>li.current>a.current:after{border-left-color:#f1f1f1}#adminmenu li.current a.menu-top,#adminmenu li.wp-has-current-submenu .wp-submenu .wp-submenu-head,#adminmenu li.wp-has-current-submenu a.wp-has-current-submenu,.folded #adminmenu li.current.menu-top{color:#fff;background:#9ebaa0}#adminmenu a.current:hover div.wp-menu-image:before,#adminmenu li a:focus div.wp-menu-image:before,#adminmenu li.opensub div.wp-menu-image:before,#adminmenu li.wp-has-current-submenu a:focus div.wp-menu-image:before,#adminmenu li.wp-has-current-submenu div.wp-menu-image:before,#adminmenu li.wp-has-current-submenu.opensub div.wp-menu-image:before,#adminmenu li:hover div.wp-menu-image:before,.ie8 #adminmenu li.opensub div.wp-menu-image:before{color:#fff}#adminmenu .awaiting-mod,#adminmenu .update-plugins{color:#fff;background:#aa9d88}#adminmenu li a.wp-has-current-submenu .update-plugins,#adminmenu li.current a .awaiting-mod,#adminmenu li.menu-top:hover>a .update-plugins,#adminmenu li:hover a .awaiting-mod{color:#fff;background:#627c83}#collapse-button{color:#f2fcff}#collapse-button:focus,#collapse-button:hover{color:#9ebaa0}#wpadminbar{color:#fff;background:#738e96}#wpadminbar .ab-item,#wpadminbar a.ab-item,#wpadminbar>#wp-toolbar span.ab-label,#wpadminbar>#wp-toolbar span.noticon{color:#fff}#wpadminbar .ab-icon,#wpadminbar .ab-icon:before,#wpadminbar .ab-item:after,#wpadminbar .ab-item:before{color:#f2fcff}#wpadminbar .ab-top-menu>li.menupop.hover>.ab-item,#wpadminbar.nojq .quicklinks .ab-top-menu>li>.ab-item:focus,#wpadminbar.nojs .ab-top-menu>li.menupop:hover>.ab-item,#wpadminbar:not(.mobile) .ab-top-menu>li:hover>.ab-item,#wpadminbar:not(.mobile) .ab-top-menu>li>.ab-item:focus{color:#9ebaa0;background:#627c83}#wpadminbar:not(.mobile)>#wp-toolbar a:focus span.ab-label,#wpadminbar:not(.mobile)>#wp-toolbar li.hover span.ab-label,#wpadminbar:not(.mobile)>#wp-toolbar li:hover span.ab-label{color:#9ebaa0}#wpadminbar:not(.mobile) li:hover #adminbarsearch:before,#wpadminbar:not(.mobile) li:hover .ab-icon:before,#wpadminbar:not(.mobile) li:hover .ab-item:after,#wpadminbar:not(.mobile) li:hover .ab-item:before{color:#fff}#wpadminbar .menupop .ab-sub-wrapper{background:#627c83}#wpadminbar .quicklinks .menupop ul.ab-sub-secondary,#wpadminbar .quicklinks .menupop ul.ab-sub-secondary .ab-submenu{background:#8f9a9e}#wpadminbar .ab-submenu .ab-item,#wpadminbar .quicklinks .menupop ul li a,#wpadminbar .quicklinks .menupop.hover ul li a,#wpadminbar.nojs .quicklinks .menupop:hover ul li a{color:#d5dde0}#wpadminbar .menupop .menupop>.ab-item:before,#wpadminbar .quicklinks li .blavatar{color:#f2fcff}#wpadminbar .quicklinks .ab-sub-wrapper .menupop.hover>a,#wpadminbar .quicklinks .menupop ul li a:focus,#wpadminbar .quicklinks .menupop ul li a:focus strong,#wpadminbar .quicklinks .menupop ul li a:hover,#wpadminbar .quicklinks .menupop ul li a:hover strong,#wpadminbar .quicklinks .menupop.hover ul li a:focus,#wpadminbar .quicklinks .menupop.hover ul li a:hover,#wpadminbar li #adminbarsearch.adminbar-focused:before,#wpadminbar li .ab-item:focus .ab-icon:before,#wpadminbar li .ab-item:focus:before,#wpadminbar li a:focus .ab-icon:before,#wpadminbar li.hover .ab-icon:before,#wpadminbar li.hover .ab-item:before,#wpadminbar li:hover #adminbarsearch:before,#wpadminbar li:hover .ab-icon:before,#wpadminbar li:hover .ab-item:before,#wpadminbar.nojs .quicklinks .menupop:hover ul li a:focus,#wpadminbar.nojs .quicklinks .menupop:hover ul li a:hover{color:#9ebaa0}#wpadminbar .menupop .menupop>.ab-item:hover:before,#wpadminbar .quicklinks .ab-sub-wrapper .menupop.hover>a .blavatar,#wpadminbar .quicklinks li a:focus .blavatar,#wpadminbar .quicklinks li a:hover .blavatar,#wpadminbar.mobile .quicklinks .ab-icon:before,#wpadminbar.mobile .quicklinks .ab-item:before{color:#9ebaa0}#wpadminbar.mobile .quicklinks .hover .ab-icon:before,#wpadminbar.mobile .quicklinks .hover .ab-item:before{color:#f2fcff}#wpadminbar #adminbarsearch:before{color:#f2fcff}#wpadminbar>#wp-toolbar>#wp-admin-bar-top-secondary>#wp-admin-bar-search #adminbarsearch input.adminbar-input:focus{color:#fff;background:#879ea5}#wpadminbar #wp-admin-bar-recovery-mode{color:#fff;background-color:#aa9d88}#wpadminbar #wp-admin-bar-recovery-mode .ab-item,#wpadminbar #wp-admin-bar-recovery-mode a.ab-item{color:#fff}#wpadminbar .ab-top-menu>#wp-admin-bar-recovery-mode.hover>.ab-item,#wpadminbar.nojq .quicklinks .ab-top-menu>#wp-admin-bar-recovery-mode>.ab-item:focus,#wpadminbar:not(.mobile) .ab-top-menu>#wp-admin-bar-recovery-mode:hover>.ab-item,#wpadminbar:not(.mobile) .ab-top-menu>#wp-admin-bar-recovery-mode>.ab-item:focus{color:#fff;background-color:#998d7a}#wpadminbar .quicklinks li#wp-admin-bar-my-account.with-avatar>a img{border-color:#879ea5;background-color:#879ea5}#wpadminbar #wp-admin-bar-user-info .display-name{color:#fff}#wpadminbar #wp-admin-bar-user-info a:hover .display-name{color:#9ebaa0}#wpadminbar #wp-admin-bar-user-info .username{color:#d5dde0}.wp-pointer .wp-pointer-content h3{background-color:#9ebaa0;border-color:#8faf91}.wp-pointer .wp-pointer-content h3:before{color:#9ebaa0}.wp-pointer.wp-pointer-top .wp-pointer-arrow,.wp-pointer.wp-pointer-top .wp-pointer-arrow-inner,.wp-pointer.wp-pointer-undefined .wp-pointer-arrow,.wp-pointer.wp-pointer-undefined .wp-pointer-arrow-inner{border-bottom-color:#9ebaa0}.media-item .bar,.media-progress-bar div{background-color:#9ebaa0}.details.attachment{box-shadow:inset 0 0 0 3px #fff,inset 0 0 0 7px #9ebaa0}.attachment.details .check{background-color:#9ebaa0;box-shadow:0 0 0 1px #fff,0 0 0 2px #9ebaa0}.media-selection .attachment.selection.details .thumbnail{box-shadow:0 0 0 1px #fff,0 0 0 3px #9ebaa0}.theme-browser .theme.active .theme-name,.theme-browser .theme.add-new-theme a:focus:after,.theme-browser .theme.add-new-theme a:hover:after{background:#9ebaa0}.theme-browser .theme.add-new-theme a:focus span:after,.theme-browser .theme.add-new-theme a:hover span:after{color:#9ebaa0}.theme-filter.current,.theme-section.current{border-bottom-color:#738e96}body.more-filters-opened .more-filters{color:#fff;background-color:#738e96}body.more-filters-opened .more-filters:before{color:#fff}body.more-filters-opened .more-filters:focus,body.more-filters-opened .more-filters:hover{background-color:#9ebaa0;color:#fff}body.more-filters-opened .more-filters:focus:before,body.more-filters-opened .more-filters:hover:before{color:#fff}.widgets-chooser li.widgets-chooser-selected{background-color:#9ebaa0;color:#fff}.widgets-chooser li.widgets-chooser-selected:before,.widgets-chooser li.widgets-chooser-selected:focus:before{color:#fff}div#wp-responsive-toggle a:before{color:#f2fcff}.wp-responsive-open div#wp-responsive-toggle a{border-color:transparent;background:#9ebaa0}.wp-responsive-open #wpadminbar #wp-admin-bar-menu-toggle a{background:#627c83}.wp-responsive-open #wpadminbar #wp-admin-bar-menu-toggle .ab-icon:before{color:#f2fcff}.mce-container.mce-menu .mce-menu-item-normal.mce-active,.mce-container.mce-menu .mce-menu-item-preview.mce-active,.mce-container.mce-menu .mce-menu-item.mce-selected,.mce-container.mce-menu .mce-menu-item:focus,.mce-container.mce-menu .mce-menu-item:hover{background:#9ebaa0} \ No newline at end of file
diff --git a/www/crm/wp-admin/css/colors/ocean/colors.css b/www/crm/wp-admin/css/colors/ocean/colors.css
new file mode 100644
index 00000000..7977609d
--- /dev/null
+++ b/www/crm/wp-admin/css/colors/ocean/colors.css
@@ -0,0 +1,519 @@
+/*! This file is auto-generated */
+/*
+ * Button mixin- creates 3d-ish button effect with correct
+ * highlights/shadows, based on a base color.
+ */
+body {
+ background: #f1f1f1;
+}
+
+/* Links */
+a {
+ color: #0073aa;
+}
+
+a:hover, a:active, a:focus {
+ color: #0096dd;
+}
+
+#media-upload a.del-link:hover,
+div.dashboard-widget-submit input:hover,
+.subsubsub a:hover,
+.subsubsub a.current:hover {
+ color: #0096dd;
+}
+
+/* Forms */
+input[type=checkbox]:checked:before {
+ color: #738e96;
+}
+
+input[type=radio]:checked:before {
+ background: #738e96;
+}
+
+.wp-core-ui input[type="reset"]:hover,
+.wp-core-ui input[type="reset"]:active {
+ color: #0096dd;
+}
+
+/* Core UI */
+.wp-core-ui .button-primary {
+ background: #9ebaa0;
+ border-color: #80a583 #719a74 #719a74;
+ color: #fff;
+ box-shadow: 0 1px 0 #719a74;
+ text-shadow: 0 -1px 1px #719a74, 1px 0 1px #719a74, 0 1px 1px #719a74, -1px 0 1px #719a74;
+}
+
+.wp-core-ui .button-primary:hover, .wp-core-ui .button-primary:focus {
+ background: #a7c0a9;
+ border-color: #719a74;
+ color: #fff;
+ box-shadow: 0 1px 0 #719a74;
+}
+
+.wp-core-ui .button-primary:focus {
+ box-shadow: inset 0 1px 0 #80a583, 0 0 2px 1px #33b3db;
+}
+
+.wp-core-ui .button-primary:active, .wp-core-ui .button-primary.active, .wp-core-ui .button-primary.active:focus, .wp-core-ui .button-primary.active:hover {
+ background: #80a583;
+ border-color: #719a74;
+ box-shadow: inset 0 2px 0 #719a74;
+}
+
+.wp-core-ui .button-primary[disabled], .wp-core-ui .button-primary:disabled, .wp-core-ui .button-primary.button-primary-disabled, .wp-core-ui .button-primary.disabled {
+ color: #c7d1c8 !important;
+ background: #86a989 !important;
+ border-color: #719a74 !important;
+ text-shadow: none !important;
+}
+
+.wp-core-ui .button-primary.button-hero {
+ box-shadow: 0 2px 0 #719a74 !important;
+}
+
+.wp-core-ui .button-primary.button-hero:active {
+ box-shadow: inset 0 3px 0 #719a74 !important;
+}
+
+.wp-core-ui .wp-ui-primary {
+ color: #fff;
+ background-color: #738e96;
+}
+
+.wp-core-ui .wp-ui-text-primary {
+ color: #738e96;
+}
+
+.wp-core-ui .wp-ui-highlight {
+ color: #fff;
+ background-color: #9ebaa0;
+}
+
+.wp-core-ui .wp-ui-text-highlight {
+ color: #9ebaa0;
+}
+
+.wp-core-ui .wp-ui-notification {
+ color: #fff;
+ background-color: #aa9d88;
+}
+
+.wp-core-ui .wp-ui-text-notification {
+ color: #aa9d88;
+}
+
+.wp-core-ui .wp-ui-text-icon {
+ color: #f2fcff;
+}
+
+/* List tables */
+.wrap .add-new-h2:hover,
+.wrap .page-title-action:hover {
+ color: #fff;
+ background-color: #738e96;
+}
+
+.view-switch a.current:before {
+ color: #738e96;
+}
+
+.view-switch a:hover:before {
+ color: #aa9d88;
+}
+
+/* Admin Menu */
+#adminmenuback,
+#adminmenuwrap,
+#adminmenu {
+ background: #738e96;
+}
+
+#adminmenu a {
+ color: #fff;
+}
+
+#adminmenu div.wp-menu-image:before {
+ color: #f2fcff;
+}
+
+#adminmenu a:hover,
+#adminmenu li.menu-top:hover,
+#adminmenu li.opensub > a.menu-top,
+#adminmenu li > a.menu-top:focus {
+ color: #fff;
+ background-color: #9ebaa0;
+}
+
+#adminmenu li.menu-top:hover div.wp-menu-image:before,
+#adminmenu li.opensub > a.menu-top div.wp-menu-image:before {
+ color: #fff;
+}
+
+/* Active tabs use a bottom border color that matches the page background color. */
+.about-wrap .nav-tab-active,
+.nav-tab-active,
+.nav-tab-active:hover {
+ background-color: #f1f1f1;
+ border-bottom-color: #f1f1f1;
+}
+
+/* Admin Menu: submenu */
+#adminmenu .wp-submenu,
+#adminmenu .wp-has-current-submenu .wp-submenu,
+#adminmenu .wp-has-current-submenu.opensub .wp-submenu,
+.folded #adminmenu .wp-has-current-submenu .wp-submenu,
+#adminmenu a.wp-has-current-submenu:focus + .wp-submenu {
+ background: #627c83;
+}
+
+#adminmenu li.wp-has-submenu.wp-not-current-submenu.opensub:hover:after {
+ border-right-color: #627c83;
+}
+
+#adminmenu .wp-submenu .wp-submenu-head {
+ color: #d5dde0;
+}
+
+#adminmenu .wp-submenu a,
+#adminmenu .wp-has-current-submenu .wp-submenu a,
+.folded #adminmenu .wp-has-current-submenu .wp-submenu a,
+#adminmenu a.wp-has-current-submenu:focus + .wp-submenu a,
+#adminmenu .wp-has-current-submenu.opensub .wp-submenu a {
+ color: #d5dde0;
+}
+
+#adminmenu .wp-submenu a:focus, #adminmenu .wp-submenu a:hover,
+#adminmenu .wp-has-current-submenu .wp-submenu a:focus,
+#adminmenu .wp-has-current-submenu .wp-submenu a:hover,
+.folded #adminmenu .wp-has-current-submenu .wp-submenu a:focus,
+.folded #adminmenu .wp-has-current-submenu .wp-submenu a:hover,
+#adminmenu a.wp-has-current-submenu:focus + .wp-submenu a:focus,
+#adminmenu a.wp-has-current-submenu:focus + .wp-submenu a:hover,
+#adminmenu .wp-has-current-submenu.opensub .wp-submenu a:focus,
+#adminmenu .wp-has-current-submenu.opensub .wp-submenu a:hover {
+ color: #9ebaa0;
+}
+
+/* Admin Menu: current */
+#adminmenu .wp-submenu li.current a,
+#adminmenu a.wp-has-current-submenu:focus + .wp-submenu li.current a,
+#adminmenu .wp-has-current-submenu.opensub .wp-submenu li.current a {
+ color: #fff;
+}
+
+#adminmenu .wp-submenu li.current a:hover, #adminmenu .wp-submenu li.current a:focus,
+#adminmenu a.wp-has-current-submenu:focus + .wp-submenu li.current a:hover,
+#adminmenu a.wp-has-current-submenu:focus + .wp-submenu li.current a:focus,
+#adminmenu .wp-has-current-submenu.opensub .wp-submenu li.current a:hover,
+#adminmenu .wp-has-current-submenu.opensub .wp-submenu li.current a:focus {
+ color: #9ebaa0;
+}
+
+ul#adminmenu a.wp-has-current-submenu:after,
+ul#adminmenu > li.current > a.current:after {
+ border-right-color: #f1f1f1;
+}
+
+#adminmenu li.current a.menu-top,
+#adminmenu li.wp-has-current-submenu a.wp-has-current-submenu,
+#adminmenu li.wp-has-current-submenu .wp-submenu .wp-submenu-head,
+.folded #adminmenu li.current.menu-top {
+ color: #fff;
+ background: #9ebaa0;
+}
+
+#adminmenu li.wp-has-current-submenu div.wp-menu-image:before,
+#adminmenu a.current:hover div.wp-menu-image:before,
+#adminmenu li.wp-has-current-submenu a:focus div.wp-menu-image:before,
+#adminmenu li.wp-has-current-submenu.opensub div.wp-menu-image:before,
+#adminmenu li:hover div.wp-menu-image:before,
+#adminmenu li a:focus div.wp-menu-image:before,
+#adminmenu li.opensub div.wp-menu-image:before,
+.ie8 #adminmenu li.opensub div.wp-menu-image:before {
+ color: #fff;
+}
+
+/* Admin Menu: bubble */
+#adminmenu .awaiting-mod,
+#adminmenu .update-plugins {
+ color: #fff;
+ background: #aa9d88;
+}
+
+#adminmenu li.current a .awaiting-mod,
+#adminmenu li a.wp-has-current-submenu .update-plugins,
+#adminmenu li:hover a .awaiting-mod,
+#adminmenu li.menu-top:hover > a .update-plugins {
+ color: #fff;
+ background: #627c83;
+}
+
+/* Admin Menu: collapse button */
+#collapse-button {
+ color: #f2fcff;
+}
+
+#collapse-button:hover,
+#collapse-button:focus {
+ color: #9ebaa0;
+}
+
+/* Admin Bar */
+#wpadminbar {
+ color: #fff;
+ background: #738e96;
+}
+
+#wpadminbar .ab-item,
+#wpadminbar a.ab-item,
+#wpadminbar > #wp-toolbar span.ab-label,
+#wpadminbar > #wp-toolbar span.noticon {
+ color: #fff;
+}
+
+#wpadminbar .ab-icon,
+#wpadminbar .ab-icon:before,
+#wpadminbar .ab-item:before,
+#wpadminbar .ab-item:after {
+ color: #f2fcff;
+}
+
+#wpadminbar:not(.mobile) .ab-top-menu > li:hover > .ab-item,
+#wpadminbar:not(.mobile) .ab-top-menu > li > .ab-item:focus,
+#wpadminbar.nojq .quicklinks .ab-top-menu > li > .ab-item:focus,
+#wpadminbar.nojs .ab-top-menu > li.menupop:hover > .ab-item,
+#wpadminbar .ab-top-menu > li.menupop.hover > .ab-item {
+ color: #9ebaa0;
+ background: #627c83;
+}
+
+#wpadminbar:not(.mobile) > #wp-toolbar li:hover span.ab-label,
+#wpadminbar:not(.mobile) > #wp-toolbar li.hover span.ab-label,
+#wpadminbar:not(.mobile) > #wp-toolbar a:focus span.ab-label {
+ color: #9ebaa0;
+}
+
+#wpadminbar:not(.mobile) li:hover .ab-icon:before,
+#wpadminbar:not(.mobile) li:hover .ab-item:before,
+#wpadminbar:not(.mobile) li:hover .ab-item:after,
+#wpadminbar:not(.mobile) li:hover #adminbarsearch:before {
+ color: #fff;
+}
+
+/* Admin Bar: submenu */
+#wpadminbar .menupop .ab-sub-wrapper {
+ background: #627c83;
+}
+
+#wpadminbar .quicklinks .menupop ul.ab-sub-secondary,
+#wpadminbar .quicklinks .menupop ul.ab-sub-secondary .ab-submenu {
+ background: #8f9a9e;
+}
+
+#wpadminbar .ab-submenu .ab-item,
+#wpadminbar .quicklinks .menupop ul li a,
+#wpadminbar .quicklinks .menupop.hover ul li a,
+#wpadminbar.nojs .quicklinks .menupop:hover ul li a {
+ color: #d5dde0;
+}
+
+#wpadminbar .quicklinks li .blavatar,
+#wpadminbar .menupop .menupop > .ab-item:before {
+ color: #f2fcff;
+}
+
+#wpadminbar .quicklinks .menupop ul li a:hover,
+#wpadminbar .quicklinks .menupop ul li a:focus,
+#wpadminbar .quicklinks .menupop ul li a:hover strong,
+#wpadminbar .quicklinks .menupop ul li a:focus strong,
+#wpadminbar .quicklinks .ab-sub-wrapper .menupop.hover > a,
+#wpadminbar .quicklinks .menupop.hover ul li a:hover,
+#wpadminbar .quicklinks .menupop.hover ul li a:focus,
+#wpadminbar.nojs .quicklinks .menupop:hover ul li a:hover,
+#wpadminbar.nojs .quicklinks .menupop:hover ul li a:focus,
+#wpadminbar li:hover .ab-icon:before,
+#wpadminbar li:hover .ab-item:before,
+#wpadminbar li a:focus .ab-icon:before,
+#wpadminbar li .ab-item:focus:before,
+#wpadminbar li .ab-item:focus .ab-icon:before,
+#wpadminbar li.hover .ab-icon:before,
+#wpadminbar li.hover .ab-item:before,
+#wpadminbar li:hover #adminbarsearch:before,
+#wpadminbar li #adminbarsearch.adminbar-focused:before {
+ color: #9ebaa0;
+}
+
+#wpadminbar .quicklinks li a:hover .blavatar,
+#wpadminbar .quicklinks li a:focus .blavatar,
+#wpadminbar .quicklinks .ab-sub-wrapper .menupop.hover > a .blavatar,
+#wpadminbar .menupop .menupop > .ab-item:hover:before,
+#wpadminbar.mobile .quicklinks .ab-icon:before,
+#wpadminbar.mobile .quicklinks .ab-item:before {
+ color: #9ebaa0;
+}
+
+#wpadminbar.mobile .quicklinks .hover .ab-icon:before,
+#wpadminbar.mobile .quicklinks .hover .ab-item:before {
+ color: #f2fcff;
+}
+
+/* Admin Bar: search */
+#wpadminbar #adminbarsearch:before {
+ color: #f2fcff;
+}
+
+#wpadminbar > #wp-toolbar > #wp-admin-bar-top-secondary > #wp-admin-bar-search #adminbarsearch input.adminbar-input:focus {
+ color: #fff;
+ background: #879ea5;
+}
+
+/* Admin Bar: recovery mode */
+#wpadminbar #wp-admin-bar-recovery-mode {
+ color: #fff;
+ background-color: #aa9d88;
+}
+
+#wpadminbar #wp-admin-bar-recovery-mode .ab-item,
+#wpadminbar #wp-admin-bar-recovery-mode a.ab-item {
+ color: #fff;
+}
+
+#wpadminbar .ab-top-menu > #wp-admin-bar-recovery-mode.hover > .ab-item,
+#wpadminbar.nojq .quicklinks .ab-top-menu > #wp-admin-bar-recovery-mode > .ab-item:focus,
+#wpadminbar:not(.mobile) .ab-top-menu > #wp-admin-bar-recovery-mode:hover > .ab-item,
+#wpadminbar:not(.mobile) .ab-top-menu > #wp-admin-bar-recovery-mode > .ab-item:focus {
+ color: #fff;
+ background-color: #998d7a;
+}
+
+/* Admin Bar: my account */
+#wpadminbar .quicklinks li#wp-admin-bar-my-account.with-avatar > a img {
+ border-color: #879ea5;
+ background-color: #879ea5;
+}
+
+#wpadminbar #wp-admin-bar-user-info .display-name {
+ color: #fff;
+}
+
+#wpadminbar #wp-admin-bar-user-info a:hover .display-name {
+ color: #9ebaa0;
+}
+
+#wpadminbar #wp-admin-bar-user-info .username {
+ color: #d5dde0;
+}
+
+/* Pointers */
+.wp-pointer .wp-pointer-content h3 {
+ background-color: #9ebaa0;
+ border-color: #8faf91;
+}
+
+.wp-pointer .wp-pointer-content h3:before {
+ color: #9ebaa0;
+}
+
+.wp-pointer.wp-pointer-top .wp-pointer-arrow,
+.wp-pointer.wp-pointer-top .wp-pointer-arrow-inner,
+.wp-pointer.wp-pointer-undefined .wp-pointer-arrow,
+.wp-pointer.wp-pointer-undefined .wp-pointer-arrow-inner {
+ border-bottom-color: #9ebaa0;
+}
+
+/* Media */
+.media-item .bar,
+.media-progress-bar div {
+ background-color: #9ebaa0;
+}
+
+.details.attachment {
+ box-shadow: inset 0 0 0 3px #fff, inset 0 0 0 7px #9ebaa0;
+}
+
+.attachment.details .check {
+ background-color: #9ebaa0;
+ box-shadow: 0 0 0 1px #fff, 0 0 0 2px #9ebaa0;
+}
+
+.media-selection .attachment.selection.details .thumbnail {
+ box-shadow: 0 0 0 1px #fff, 0 0 0 3px #9ebaa0;
+}
+
+/* Themes */
+.theme-browser .theme.active .theme-name,
+.theme-browser .theme.add-new-theme a:hover:after,
+.theme-browser .theme.add-new-theme a:focus:after {
+ background: #9ebaa0;
+}
+
+.theme-browser .theme.add-new-theme a:hover span:after,
+.theme-browser .theme.add-new-theme a:focus span:after {
+ color: #9ebaa0;
+}
+
+.theme-section.current,
+.theme-filter.current {
+ border-bottom-color: #738e96;
+}
+
+body.more-filters-opened .more-filters {
+ color: #fff;
+ background-color: #738e96;
+}
+
+body.more-filters-opened .more-filters:before {
+ color: #fff;
+}
+
+body.more-filters-opened .more-filters:hover,
+body.more-filters-opened .more-filters:focus {
+ background-color: #9ebaa0;
+ color: #fff;
+}
+
+body.more-filters-opened .more-filters:hover:before,
+body.more-filters-opened .more-filters:focus:before {
+ color: #fff;
+}
+
+/* Widgets */
+.widgets-chooser li.widgets-chooser-selected {
+ background-color: #9ebaa0;
+ color: #fff;
+}
+
+.widgets-chooser li.widgets-chooser-selected:before,
+.widgets-chooser li.widgets-chooser-selected:focus:before {
+ color: #fff;
+}
+
+/* Responsive Component */
+div#wp-responsive-toggle a:before {
+ color: #f2fcff;
+}
+
+.wp-responsive-open div#wp-responsive-toggle a {
+ border-color: transparent;
+ background: #9ebaa0;
+}
+
+.wp-responsive-open #wpadminbar #wp-admin-bar-menu-toggle a {
+ background: #627c83;
+}
+
+.wp-responsive-open #wpadminbar #wp-admin-bar-menu-toggle .ab-icon:before {
+ color: #f2fcff;
+}
+
+/* TinyMCE */
+.mce-container.mce-menu .mce-menu-item:hover,
+.mce-container.mce-menu .mce-menu-item.mce-selected,
+.mce-container.mce-menu .mce-menu-item:focus,
+.mce-container.mce-menu .mce-menu-item-normal.mce-active,
+.mce-container.mce-menu .mce-menu-item-preview.mce-active {
+ background: #9ebaa0;
+}
diff --git a/www/crm/wp-admin/css/colors/ocean/colors.min.css b/www/crm/wp-admin/css/colors/ocean/colors.min.css
new file mode 100644
index 00000000..d752e006
--- /dev/null
+++ b/www/crm/wp-admin/css/colors/ocean/colors.min.css
@@ -0,0 +1,2 @@
+/*! This file is auto-generated */
+body{background:#f1f1f1}a{color:#0073aa}a:active,a:focus,a:hover{color:#0096dd}#media-upload a.del-link:hover,.subsubsub a.current:hover,.subsubsub a:hover,div.dashboard-widget-submit input:hover{color:#0096dd}input[type=checkbox]:checked:before{color:#738e96}input[type=radio]:checked:before{background:#738e96}.wp-core-ui input[type=reset]:active,.wp-core-ui input[type=reset]:hover{color:#0096dd}.wp-core-ui .button-primary{background:#9ebaa0;border-color:#80a583 #719a74 #719a74;color:#fff;box-shadow:0 1px 0 #719a74;text-shadow:0 -1px 1px #719a74,1px 0 1px #719a74,0 1px 1px #719a74,-1px 0 1px #719a74}.wp-core-ui .button-primary:focus,.wp-core-ui .button-primary:hover{background:#a7c0a9;border-color:#719a74;color:#fff;box-shadow:0 1px 0 #719a74}.wp-core-ui .button-primary:focus{box-shadow:inset 0 1px 0 #80a583,0 0 2px 1px #33b3db}.wp-core-ui .button-primary.active,.wp-core-ui .button-primary.active:focus,.wp-core-ui .button-primary.active:hover,.wp-core-ui .button-primary:active{background:#80a583;border-color:#719a74;box-shadow:inset 0 2px 0 #719a74}.wp-core-ui .button-primary.button-primary-disabled,.wp-core-ui .button-primary.disabled,.wp-core-ui .button-primary:disabled,.wp-core-ui .button-primary[disabled]{color:#c7d1c8!important;background:#86a989!important;border-color:#719a74!important;text-shadow:none!important}.wp-core-ui .button-primary.button-hero{box-shadow:0 2px 0 #719a74!important}.wp-core-ui .button-primary.button-hero:active{box-shadow:inset 0 3px 0 #719a74!important}.wp-core-ui .wp-ui-primary{color:#fff;background-color:#738e96}.wp-core-ui .wp-ui-text-primary{color:#738e96}.wp-core-ui .wp-ui-highlight{color:#fff;background-color:#9ebaa0}.wp-core-ui .wp-ui-text-highlight{color:#9ebaa0}.wp-core-ui .wp-ui-notification{color:#fff;background-color:#aa9d88}.wp-core-ui .wp-ui-text-notification{color:#aa9d88}.wp-core-ui .wp-ui-text-icon{color:#f2fcff}.wrap .add-new-h2:hover,.wrap .page-title-action:hover{color:#fff;background-color:#738e96}.view-switch a.current:before{color:#738e96}.view-switch a:hover:before{color:#aa9d88}#adminmenu,#adminmenuback,#adminmenuwrap{background:#738e96}#adminmenu a{color:#fff}#adminmenu div.wp-menu-image:before{color:#f2fcff}#adminmenu a:hover,#adminmenu li.menu-top:hover,#adminmenu li.opensub>a.menu-top,#adminmenu li>a.menu-top:focus{color:#fff;background-color:#9ebaa0}#adminmenu li.menu-top:hover div.wp-menu-image:before,#adminmenu li.opensub>a.menu-top div.wp-menu-image:before{color:#fff}.about-wrap .nav-tab-active,.nav-tab-active,.nav-tab-active:hover{background-color:#f1f1f1;border-bottom-color:#f1f1f1}#adminmenu .wp-has-current-submenu .wp-submenu,#adminmenu .wp-has-current-submenu.opensub .wp-submenu,#adminmenu .wp-submenu,#adminmenu a.wp-has-current-submenu:focus+.wp-submenu,.folded #adminmenu .wp-has-current-submenu .wp-submenu{background:#627c83}#adminmenu li.wp-has-submenu.wp-not-current-submenu.opensub:hover:after{border-right-color:#627c83}#adminmenu .wp-submenu .wp-submenu-head{color:#d5dde0}#adminmenu .wp-has-current-submenu .wp-submenu a,#adminmenu .wp-has-current-submenu.opensub .wp-submenu a,#adminmenu .wp-submenu a,#adminmenu a.wp-has-current-submenu:focus+.wp-submenu a,.folded #adminmenu .wp-has-current-submenu .wp-submenu a{color:#d5dde0}#adminmenu .wp-has-current-submenu .wp-submenu a:focus,#adminmenu .wp-has-current-submenu .wp-submenu a:hover,#adminmenu .wp-has-current-submenu.opensub .wp-submenu a:focus,#adminmenu .wp-has-current-submenu.opensub .wp-submenu a:hover,#adminmenu .wp-submenu a:focus,#adminmenu .wp-submenu a:hover,#adminmenu a.wp-has-current-submenu:focus+.wp-submenu a:focus,#adminmenu a.wp-has-current-submenu:focus+.wp-submenu a:hover,.folded #adminmenu .wp-has-current-submenu .wp-submenu a:focus,.folded #adminmenu .wp-has-current-submenu .wp-submenu a:hover{color:#9ebaa0}#adminmenu .wp-has-current-submenu.opensub .wp-submenu li.current a,#adminmenu .wp-submenu li.current a,#adminmenu a.wp-has-current-submenu:focus+.wp-submenu li.current a{color:#fff}#adminmenu .wp-has-current-submenu.opensub .wp-submenu li.current a:focus,#adminmenu .wp-has-current-submenu.opensub .wp-submenu li.current a:hover,#adminmenu .wp-submenu li.current a:focus,#adminmenu .wp-submenu li.current a:hover,#adminmenu a.wp-has-current-submenu:focus+.wp-submenu li.current a:focus,#adminmenu a.wp-has-current-submenu:focus+.wp-submenu li.current a:hover{color:#9ebaa0}ul#adminmenu a.wp-has-current-submenu:after,ul#adminmenu>li.current>a.current:after{border-right-color:#f1f1f1}#adminmenu li.current a.menu-top,#adminmenu li.wp-has-current-submenu .wp-submenu .wp-submenu-head,#adminmenu li.wp-has-current-submenu a.wp-has-current-submenu,.folded #adminmenu li.current.menu-top{color:#fff;background:#9ebaa0}#adminmenu a.current:hover div.wp-menu-image:before,#adminmenu li a:focus div.wp-menu-image:before,#adminmenu li.opensub div.wp-menu-image:before,#adminmenu li.wp-has-current-submenu a:focus div.wp-menu-image:before,#adminmenu li.wp-has-current-submenu div.wp-menu-image:before,#adminmenu li.wp-has-current-submenu.opensub div.wp-menu-image:before,#adminmenu li:hover div.wp-menu-image:before,.ie8 #adminmenu li.opensub div.wp-menu-image:before{color:#fff}#adminmenu .awaiting-mod,#adminmenu .update-plugins{color:#fff;background:#aa9d88}#adminmenu li a.wp-has-current-submenu .update-plugins,#adminmenu li.current a .awaiting-mod,#adminmenu li.menu-top:hover>a .update-plugins,#adminmenu li:hover a .awaiting-mod{color:#fff;background:#627c83}#collapse-button{color:#f2fcff}#collapse-button:focus,#collapse-button:hover{color:#9ebaa0}#wpadminbar{color:#fff;background:#738e96}#wpadminbar .ab-item,#wpadminbar a.ab-item,#wpadminbar>#wp-toolbar span.ab-label,#wpadminbar>#wp-toolbar span.noticon{color:#fff}#wpadminbar .ab-icon,#wpadminbar .ab-icon:before,#wpadminbar .ab-item:after,#wpadminbar .ab-item:before{color:#f2fcff}#wpadminbar .ab-top-menu>li.menupop.hover>.ab-item,#wpadminbar.nojq .quicklinks .ab-top-menu>li>.ab-item:focus,#wpadminbar.nojs .ab-top-menu>li.menupop:hover>.ab-item,#wpadminbar:not(.mobile) .ab-top-menu>li:hover>.ab-item,#wpadminbar:not(.mobile) .ab-top-menu>li>.ab-item:focus{color:#9ebaa0;background:#627c83}#wpadminbar:not(.mobile)>#wp-toolbar a:focus span.ab-label,#wpadminbar:not(.mobile)>#wp-toolbar li.hover span.ab-label,#wpadminbar:not(.mobile)>#wp-toolbar li:hover span.ab-label{color:#9ebaa0}#wpadminbar:not(.mobile) li:hover #adminbarsearch:before,#wpadminbar:not(.mobile) li:hover .ab-icon:before,#wpadminbar:not(.mobile) li:hover .ab-item:after,#wpadminbar:not(.mobile) li:hover .ab-item:before{color:#fff}#wpadminbar .menupop .ab-sub-wrapper{background:#627c83}#wpadminbar .quicklinks .menupop ul.ab-sub-secondary,#wpadminbar .quicklinks .menupop ul.ab-sub-secondary .ab-submenu{background:#8f9a9e}#wpadminbar .ab-submenu .ab-item,#wpadminbar .quicklinks .menupop ul li a,#wpadminbar .quicklinks .menupop.hover ul li a,#wpadminbar.nojs .quicklinks .menupop:hover ul li a{color:#d5dde0}#wpadminbar .menupop .menupop>.ab-item:before,#wpadminbar .quicklinks li .blavatar{color:#f2fcff}#wpadminbar .quicklinks .ab-sub-wrapper .menupop.hover>a,#wpadminbar .quicklinks .menupop ul li a:focus,#wpadminbar .quicklinks .menupop ul li a:focus strong,#wpadminbar .quicklinks .menupop ul li a:hover,#wpadminbar .quicklinks .menupop ul li a:hover strong,#wpadminbar .quicklinks .menupop.hover ul li a:focus,#wpadminbar .quicklinks .menupop.hover ul li a:hover,#wpadminbar li #adminbarsearch.adminbar-focused:before,#wpadminbar li .ab-item:focus .ab-icon:before,#wpadminbar li .ab-item:focus:before,#wpadminbar li a:focus .ab-icon:before,#wpadminbar li.hover .ab-icon:before,#wpadminbar li.hover .ab-item:before,#wpadminbar li:hover #adminbarsearch:before,#wpadminbar li:hover .ab-icon:before,#wpadminbar li:hover .ab-item:before,#wpadminbar.nojs .quicklinks .menupop:hover ul li a:focus,#wpadminbar.nojs .quicklinks .menupop:hover ul li a:hover{color:#9ebaa0}#wpadminbar .menupop .menupop>.ab-item:hover:before,#wpadminbar .quicklinks .ab-sub-wrapper .menupop.hover>a .blavatar,#wpadminbar .quicklinks li a:focus .blavatar,#wpadminbar .quicklinks li a:hover .blavatar,#wpadminbar.mobile .quicklinks .ab-icon:before,#wpadminbar.mobile .quicklinks .ab-item:before{color:#9ebaa0}#wpadminbar.mobile .quicklinks .hover .ab-icon:before,#wpadminbar.mobile .quicklinks .hover .ab-item:before{color:#f2fcff}#wpadminbar #adminbarsearch:before{color:#f2fcff}#wpadminbar>#wp-toolbar>#wp-admin-bar-top-secondary>#wp-admin-bar-search #adminbarsearch input.adminbar-input:focus{color:#fff;background:#879ea5}#wpadminbar #wp-admin-bar-recovery-mode{color:#fff;background-color:#aa9d88}#wpadminbar #wp-admin-bar-recovery-mode .ab-item,#wpadminbar #wp-admin-bar-recovery-mode a.ab-item{color:#fff}#wpadminbar .ab-top-menu>#wp-admin-bar-recovery-mode.hover>.ab-item,#wpadminbar.nojq .quicklinks .ab-top-menu>#wp-admin-bar-recovery-mode>.ab-item:focus,#wpadminbar:not(.mobile) .ab-top-menu>#wp-admin-bar-recovery-mode:hover>.ab-item,#wpadminbar:not(.mobile) .ab-top-menu>#wp-admin-bar-recovery-mode>.ab-item:focus{color:#fff;background-color:#998d7a}#wpadminbar .quicklinks li#wp-admin-bar-my-account.with-avatar>a img{border-color:#879ea5;background-color:#879ea5}#wpadminbar #wp-admin-bar-user-info .display-name{color:#fff}#wpadminbar #wp-admin-bar-user-info a:hover .display-name{color:#9ebaa0}#wpadminbar #wp-admin-bar-user-info .username{color:#d5dde0}.wp-pointer .wp-pointer-content h3{background-color:#9ebaa0;border-color:#8faf91}.wp-pointer .wp-pointer-content h3:before{color:#9ebaa0}.wp-pointer.wp-pointer-top .wp-pointer-arrow,.wp-pointer.wp-pointer-top .wp-pointer-arrow-inner,.wp-pointer.wp-pointer-undefined .wp-pointer-arrow,.wp-pointer.wp-pointer-undefined .wp-pointer-arrow-inner{border-bottom-color:#9ebaa0}.media-item .bar,.media-progress-bar div{background-color:#9ebaa0}.details.attachment{box-shadow:inset 0 0 0 3px #fff,inset 0 0 0 7px #9ebaa0}.attachment.details .check{background-color:#9ebaa0;box-shadow:0 0 0 1px #fff,0 0 0 2px #9ebaa0}.media-selection .attachment.selection.details .thumbnail{box-shadow:0 0 0 1px #fff,0 0 0 3px #9ebaa0}.theme-browser .theme.active .theme-name,.theme-browser .theme.add-new-theme a:focus:after,.theme-browser .theme.add-new-theme a:hover:after{background:#9ebaa0}.theme-browser .theme.add-new-theme a:focus span:after,.theme-browser .theme.add-new-theme a:hover span:after{color:#9ebaa0}.theme-filter.current,.theme-section.current{border-bottom-color:#738e96}body.more-filters-opened .more-filters{color:#fff;background-color:#738e96}body.more-filters-opened .more-filters:before{color:#fff}body.more-filters-opened .more-filters:focus,body.more-filters-opened .more-filters:hover{background-color:#9ebaa0;color:#fff}body.more-filters-opened .more-filters:focus:before,body.more-filters-opened .more-filters:hover:before{color:#fff}.widgets-chooser li.widgets-chooser-selected{background-color:#9ebaa0;color:#fff}.widgets-chooser li.widgets-chooser-selected:before,.widgets-chooser li.widgets-chooser-selected:focus:before{color:#fff}div#wp-responsive-toggle a:before{color:#f2fcff}.wp-responsive-open div#wp-responsive-toggle a{border-color:transparent;background:#9ebaa0}.wp-responsive-open #wpadminbar #wp-admin-bar-menu-toggle a{background:#627c83}.wp-responsive-open #wpadminbar #wp-admin-bar-menu-toggle .ab-icon:before{color:#f2fcff}.mce-container.mce-menu .mce-menu-item-normal.mce-active,.mce-container.mce-menu .mce-menu-item-preview.mce-active,.mce-container.mce-menu .mce-menu-item.mce-selected,.mce-container.mce-menu .mce-menu-item:focus,.mce-container.mce-menu .mce-menu-item:hover{background:#9ebaa0} \ No newline at end of file
diff --git a/www/crm/wp-admin/css/colors/ocean/colors.scss b/www/crm/wp-admin/css/colors/ocean/colors.scss
new file mode 100644
index 00000000..d52339c6
--- /dev/null
+++ b/www/crm/wp-admin/css/colors/ocean/colors.scss
@@ -0,0 +1,8 @@
+$base-color: #738e96;
+$icon-color: #f2fcff;
+$highlight-color: #9ebaa0;
+$notification-color: #aa9d88;
+
+$form-checked: $base-color;
+
+@import "../_admin.scss";
diff --git a/www/crm/wp-admin/css/colors/sunrise/colors-rtl.css b/www/crm/wp-admin/css/colors/sunrise/colors-rtl.css
new file mode 100644
index 00000000..3b048e47
--- /dev/null
+++ b/www/crm/wp-admin/css/colors/sunrise/colors-rtl.css
@@ -0,0 +1,519 @@
+/*! This file is auto-generated */
+/*
+ * Button mixin- creates 3d-ish button effect with correct
+ * highlights/shadows, based on a base color.
+ */
+body {
+ background: #f1f1f1;
+}
+
+/* Links */
+a {
+ color: #0073aa;
+}
+
+a:hover, a:active, a:focus {
+ color: #0096dd;
+}
+
+#media-upload a.del-link:hover,
+div.dashboard-widget-submit input:hover,
+.subsubsub a:hover,
+.subsubsub a.current:hover {
+ color: #0096dd;
+}
+
+/* Forms */
+input[type=checkbox]:checked:before {
+ color: #dd823b;
+}
+
+input[type=radio]:checked:before {
+ background: #dd823b;
+}
+
+.wp-core-ui input[type="reset"]:hover,
+.wp-core-ui input[type="reset"]:active {
+ color: #0096dd;
+}
+
+/* Core UI */
+.wp-core-ui .button-primary {
+ background: #dd823b;
+ border-color: #c36922 #ad5d1e #ad5d1e;
+ color: #fff;
+ box-shadow: 0 1px 0 #ad5d1e;
+ text-shadow: 0 -1px 1px #ad5d1e, -1px 0 1px #ad5d1e, 0 1px 1px #ad5d1e, 1px 0 1px #ad5d1e;
+}
+
+.wp-core-ui .button-primary:hover, .wp-core-ui .button-primary:focus {
+ background: #df8a48;
+ border-color: #ad5d1e;
+ color: #fff;
+ box-shadow: 0 1px 0 #ad5d1e;
+}
+
+.wp-core-ui .button-primary:focus {
+ box-shadow: inset 0 1px 0 #c36922, 0 0 2px 1px #33b3db;
+}
+
+.wp-core-ui .button-primary:active, .wp-core-ui .button-primary.active, .wp-core-ui .button-primary.active:focus, .wp-core-ui .button-primary.active:hover {
+ background: #c36922;
+ border-color: #ad5d1e;
+ box-shadow: inset 0 2px 0 #ad5d1e;
+}
+
+.wp-core-ui .button-primary[disabled], .wp-core-ui .button-primary:disabled, .wp-core-ui .button-primary.button-primary-disabled, .wp-core-ui .button-primary.disabled {
+ color: #d1cbc7 !important;
+ background: #cc6d23 !important;
+ border-color: #ad5d1e !important;
+ text-shadow: none !important;
+}
+
+.wp-core-ui .button-primary.button-hero {
+ box-shadow: 0 2px 0 #ad5d1e !important;
+}
+
+.wp-core-ui .button-primary.button-hero:active {
+ box-shadow: inset 0 3px 0 #ad5d1e !important;
+}
+
+.wp-core-ui .wp-ui-primary {
+ color: #fff;
+ background-color: #cf4944;
+}
+
+.wp-core-ui .wp-ui-text-primary {
+ color: #cf4944;
+}
+
+.wp-core-ui .wp-ui-highlight {
+ color: #fff;
+ background-color: #dd823b;
+}
+
+.wp-core-ui .wp-ui-text-highlight {
+ color: #dd823b;
+}
+
+.wp-core-ui .wp-ui-notification {
+ color: #fff;
+ background-color: #ccaf0b;
+}
+
+.wp-core-ui .wp-ui-text-notification {
+ color: #ccaf0b;
+}
+
+.wp-core-ui .wp-ui-text-icon {
+ color: #f3f1f1;
+}
+
+/* List tables */
+.wrap .add-new-h2:hover,
+.wrap .page-title-action:hover {
+ color: #fff;
+ background-color: #cf4944;
+}
+
+.view-switch a.current:before {
+ color: #cf4944;
+}
+
+.view-switch a:hover:before {
+ color: #ccaf0b;
+}
+
+/* Admin Menu */
+#adminmenuback,
+#adminmenuwrap,
+#adminmenu {
+ background: #cf4944;
+}
+
+#adminmenu a {
+ color: #fff;
+}
+
+#adminmenu div.wp-menu-image:before {
+ color: #f3f1f1;
+}
+
+#adminmenu a:hover,
+#adminmenu li.menu-top:hover,
+#adminmenu li.opensub > a.menu-top,
+#adminmenu li > a.menu-top:focus {
+ color: #fff;
+ background-color: #dd823b;
+}
+
+#adminmenu li.menu-top:hover div.wp-menu-image:before,
+#adminmenu li.opensub > a.menu-top div.wp-menu-image:before {
+ color: #fff;
+}
+
+/* Active tabs use a bottom border color that matches the page background color. */
+.about-wrap .nav-tab-active,
+.nav-tab-active,
+.nav-tab-active:hover {
+ background-color: #f1f1f1;
+ border-bottom-color: #f1f1f1;
+}
+
+/* Admin Menu: submenu */
+#adminmenu .wp-submenu,
+#adminmenu .wp-has-current-submenu .wp-submenu,
+#adminmenu .wp-has-current-submenu.opensub .wp-submenu,
+.folded #adminmenu .wp-has-current-submenu .wp-submenu,
+#adminmenu a.wp-has-current-submenu:focus + .wp-submenu {
+ background: #be3631;
+}
+
+#adminmenu li.wp-has-submenu.wp-not-current-submenu.opensub:hover:after {
+ border-left-color: #be3631;
+}
+
+#adminmenu .wp-submenu .wp-submenu-head {
+ color: #f1c8c7;
+}
+
+#adminmenu .wp-submenu a,
+#adminmenu .wp-has-current-submenu .wp-submenu a,
+.folded #adminmenu .wp-has-current-submenu .wp-submenu a,
+#adminmenu a.wp-has-current-submenu:focus + .wp-submenu a,
+#adminmenu .wp-has-current-submenu.opensub .wp-submenu a {
+ color: #f1c8c7;
+}
+
+#adminmenu .wp-submenu a:focus, #adminmenu .wp-submenu a:hover,
+#adminmenu .wp-has-current-submenu .wp-submenu a:focus,
+#adminmenu .wp-has-current-submenu .wp-submenu a:hover,
+.folded #adminmenu .wp-has-current-submenu .wp-submenu a:focus,
+.folded #adminmenu .wp-has-current-submenu .wp-submenu a:hover,
+#adminmenu a.wp-has-current-submenu:focus + .wp-submenu a:focus,
+#adminmenu a.wp-has-current-submenu:focus + .wp-submenu a:hover,
+#adminmenu .wp-has-current-submenu.opensub .wp-submenu a:focus,
+#adminmenu .wp-has-current-submenu.opensub .wp-submenu a:hover {
+ color: #f7e3d3;
+}
+
+/* Admin Menu: current */
+#adminmenu .wp-submenu li.current a,
+#adminmenu a.wp-has-current-submenu:focus + .wp-submenu li.current a,
+#adminmenu .wp-has-current-submenu.opensub .wp-submenu li.current a {
+ color: #fff;
+}
+
+#adminmenu .wp-submenu li.current a:hover, #adminmenu .wp-submenu li.current a:focus,
+#adminmenu a.wp-has-current-submenu:focus + .wp-submenu li.current a:hover,
+#adminmenu a.wp-has-current-submenu:focus + .wp-submenu li.current a:focus,
+#adminmenu .wp-has-current-submenu.opensub .wp-submenu li.current a:hover,
+#adminmenu .wp-has-current-submenu.opensub .wp-submenu li.current a:focus {
+ color: #f7e3d3;
+}
+
+ul#adminmenu a.wp-has-current-submenu:after,
+ul#adminmenu > li.current > a.current:after {
+ border-left-color: #f1f1f1;
+}
+
+#adminmenu li.current a.menu-top,
+#adminmenu li.wp-has-current-submenu a.wp-has-current-submenu,
+#adminmenu li.wp-has-current-submenu .wp-submenu .wp-submenu-head,
+.folded #adminmenu li.current.menu-top {
+ color: #fff;
+ background: #dd823b;
+}
+
+#adminmenu li.wp-has-current-submenu div.wp-menu-image:before,
+#adminmenu a.current:hover div.wp-menu-image:before,
+#adminmenu li.wp-has-current-submenu a:focus div.wp-menu-image:before,
+#adminmenu li.wp-has-current-submenu.opensub div.wp-menu-image:before,
+#adminmenu li:hover div.wp-menu-image:before,
+#adminmenu li a:focus div.wp-menu-image:before,
+#adminmenu li.opensub div.wp-menu-image:before,
+.ie8 #adminmenu li.opensub div.wp-menu-image:before {
+ color: #fff;
+}
+
+/* Admin Menu: bubble */
+#adminmenu .awaiting-mod,
+#adminmenu .update-plugins {
+ color: #fff;
+ background: #ccaf0b;
+}
+
+#adminmenu li.current a .awaiting-mod,
+#adminmenu li a.wp-has-current-submenu .update-plugins,
+#adminmenu li:hover a .awaiting-mod,
+#adminmenu li.menu-top:hover > a .update-plugins {
+ color: #fff;
+ background: #be3631;
+}
+
+/* Admin Menu: collapse button */
+#collapse-button {
+ color: #f3f1f1;
+}
+
+#collapse-button:hover,
+#collapse-button:focus {
+ color: #f7e3d3;
+}
+
+/* Admin Bar */
+#wpadminbar {
+ color: #fff;
+ background: #cf4944;
+}
+
+#wpadminbar .ab-item,
+#wpadminbar a.ab-item,
+#wpadminbar > #wp-toolbar span.ab-label,
+#wpadminbar > #wp-toolbar span.noticon {
+ color: #fff;
+}
+
+#wpadminbar .ab-icon,
+#wpadminbar .ab-icon:before,
+#wpadminbar .ab-item:before,
+#wpadminbar .ab-item:after {
+ color: #f3f1f1;
+}
+
+#wpadminbar:not(.mobile) .ab-top-menu > li:hover > .ab-item,
+#wpadminbar:not(.mobile) .ab-top-menu > li > .ab-item:focus,
+#wpadminbar.nojq .quicklinks .ab-top-menu > li > .ab-item:focus,
+#wpadminbar.nojs .ab-top-menu > li.menupop:hover > .ab-item,
+#wpadminbar .ab-top-menu > li.menupop.hover > .ab-item {
+ color: #f7e3d3;
+ background: #be3631;
+}
+
+#wpadminbar:not(.mobile) > #wp-toolbar li:hover span.ab-label,
+#wpadminbar:not(.mobile) > #wp-toolbar li.hover span.ab-label,
+#wpadminbar:not(.mobile) > #wp-toolbar a:focus span.ab-label {
+ color: #f7e3d3;
+}
+
+#wpadminbar:not(.mobile) li:hover .ab-icon:before,
+#wpadminbar:not(.mobile) li:hover .ab-item:before,
+#wpadminbar:not(.mobile) li:hover .ab-item:after,
+#wpadminbar:not(.mobile) li:hover #adminbarsearch:before {
+ color: #fff;
+}
+
+/* Admin Bar: submenu */
+#wpadminbar .menupop .ab-sub-wrapper {
+ background: #be3631;
+}
+
+#wpadminbar .quicklinks .menupop ul.ab-sub-secondary,
+#wpadminbar .quicklinks .menupop ul.ab-sub-secondary .ab-submenu {
+ background: #cf6b67;
+}
+
+#wpadminbar .ab-submenu .ab-item,
+#wpadminbar .quicklinks .menupop ul li a,
+#wpadminbar .quicklinks .menupop.hover ul li a,
+#wpadminbar.nojs .quicklinks .menupop:hover ul li a {
+ color: #f1c8c7;
+}
+
+#wpadminbar .quicklinks li .blavatar,
+#wpadminbar .menupop .menupop > .ab-item:before {
+ color: #f3f1f1;
+}
+
+#wpadminbar .quicklinks .menupop ul li a:hover,
+#wpadminbar .quicklinks .menupop ul li a:focus,
+#wpadminbar .quicklinks .menupop ul li a:hover strong,
+#wpadminbar .quicklinks .menupop ul li a:focus strong,
+#wpadminbar .quicklinks .ab-sub-wrapper .menupop.hover > a,
+#wpadminbar .quicklinks .menupop.hover ul li a:hover,
+#wpadminbar .quicklinks .menupop.hover ul li a:focus,
+#wpadminbar.nojs .quicklinks .menupop:hover ul li a:hover,
+#wpadminbar.nojs .quicklinks .menupop:hover ul li a:focus,
+#wpadminbar li:hover .ab-icon:before,
+#wpadminbar li:hover .ab-item:before,
+#wpadminbar li a:focus .ab-icon:before,
+#wpadminbar li .ab-item:focus:before,
+#wpadminbar li .ab-item:focus .ab-icon:before,
+#wpadminbar li.hover .ab-icon:before,
+#wpadminbar li.hover .ab-item:before,
+#wpadminbar li:hover #adminbarsearch:before,
+#wpadminbar li #adminbarsearch.adminbar-focused:before {
+ color: #f7e3d3;
+}
+
+#wpadminbar .quicklinks li a:hover .blavatar,
+#wpadminbar .quicklinks li a:focus .blavatar,
+#wpadminbar .quicklinks .ab-sub-wrapper .menupop.hover > a .blavatar,
+#wpadminbar .menupop .menupop > .ab-item:hover:before,
+#wpadminbar.mobile .quicklinks .ab-icon:before,
+#wpadminbar.mobile .quicklinks .ab-item:before {
+ color: #f7e3d3;
+}
+
+#wpadminbar.mobile .quicklinks .hover .ab-icon:before,
+#wpadminbar.mobile .quicklinks .hover .ab-item:before {
+ color: #f3f1f1;
+}
+
+/* Admin Bar: search */
+#wpadminbar #adminbarsearch:before {
+ color: #f3f1f1;
+}
+
+#wpadminbar > #wp-toolbar > #wp-admin-bar-top-secondary > #wp-admin-bar-search #adminbarsearch input.adminbar-input:focus {
+ color: #fff;
+ background: #d66560;
+}
+
+/* Admin Bar: recovery mode */
+#wpadminbar #wp-admin-bar-recovery-mode {
+ color: #fff;
+ background-color: #ccaf0b;
+}
+
+#wpadminbar #wp-admin-bar-recovery-mode .ab-item,
+#wpadminbar #wp-admin-bar-recovery-mode a.ab-item {
+ color: #fff;
+}
+
+#wpadminbar .ab-top-menu > #wp-admin-bar-recovery-mode.hover > .ab-item,
+#wpadminbar.nojq .quicklinks .ab-top-menu > #wp-admin-bar-recovery-mode > .ab-item:focus,
+#wpadminbar:not(.mobile) .ab-top-menu > #wp-admin-bar-recovery-mode:hover > .ab-item,
+#wpadminbar:not(.mobile) .ab-top-menu > #wp-admin-bar-recovery-mode > .ab-item:focus {
+ color: #fff;
+ background-color: #b89e0a;
+}
+
+/* Admin Bar: my account */
+#wpadminbar .quicklinks li#wp-admin-bar-my-account.with-avatar > a img {
+ border-color: #d66560;
+ background-color: #d66560;
+}
+
+#wpadminbar #wp-admin-bar-user-info .display-name {
+ color: #fff;
+}
+
+#wpadminbar #wp-admin-bar-user-info a:hover .display-name {
+ color: #f7e3d3;
+}
+
+#wpadminbar #wp-admin-bar-user-info .username {
+ color: #f1c8c7;
+}
+
+/* Pointers */
+.wp-pointer .wp-pointer-content h3 {
+ background-color: #dd823b;
+ border-color: #d97426;
+}
+
+.wp-pointer .wp-pointer-content h3:before {
+ color: #dd823b;
+}
+
+.wp-pointer.wp-pointer-top .wp-pointer-arrow,
+.wp-pointer.wp-pointer-top .wp-pointer-arrow-inner,
+.wp-pointer.wp-pointer-undefined .wp-pointer-arrow,
+.wp-pointer.wp-pointer-undefined .wp-pointer-arrow-inner {
+ border-bottom-color: #dd823b;
+}
+
+/* Media */
+.media-item .bar,
+.media-progress-bar div {
+ background-color: #dd823b;
+}
+
+.details.attachment {
+ box-shadow: inset 0 0 0 3px #fff, inset 0 0 0 7px #dd823b;
+}
+
+.attachment.details .check {
+ background-color: #dd823b;
+ box-shadow: 0 0 0 1px #fff, 0 0 0 2px #dd823b;
+}
+
+.media-selection .attachment.selection.details .thumbnail {
+ box-shadow: 0 0 0 1px #fff, 0 0 0 3px #dd823b;
+}
+
+/* Themes */
+.theme-browser .theme.active .theme-name,
+.theme-browser .theme.add-new-theme a:hover:after,
+.theme-browser .theme.add-new-theme a:focus:after {
+ background: #dd823b;
+}
+
+.theme-browser .theme.add-new-theme a:hover span:after,
+.theme-browser .theme.add-new-theme a:focus span:after {
+ color: #dd823b;
+}
+
+.theme-section.current,
+.theme-filter.current {
+ border-bottom-color: #cf4944;
+}
+
+body.more-filters-opened .more-filters {
+ color: #fff;
+ background-color: #cf4944;
+}
+
+body.more-filters-opened .more-filters:before {
+ color: #fff;
+}
+
+body.more-filters-opened .more-filters:hover,
+body.more-filters-opened .more-filters:focus {
+ background-color: #dd823b;
+ color: #fff;
+}
+
+body.more-filters-opened .more-filters:hover:before,
+body.more-filters-opened .more-filters:focus:before {
+ color: #fff;
+}
+
+/* Widgets */
+.widgets-chooser li.widgets-chooser-selected {
+ background-color: #dd823b;
+ color: #fff;
+}
+
+.widgets-chooser li.widgets-chooser-selected:before,
+.widgets-chooser li.widgets-chooser-selected:focus:before {
+ color: #fff;
+}
+
+/* Responsive Component */
+div#wp-responsive-toggle a:before {
+ color: #f3f1f1;
+}
+
+.wp-responsive-open div#wp-responsive-toggle a {
+ border-color: transparent;
+ background: #dd823b;
+}
+
+.wp-responsive-open #wpadminbar #wp-admin-bar-menu-toggle a {
+ background: #be3631;
+}
+
+.wp-responsive-open #wpadminbar #wp-admin-bar-menu-toggle .ab-icon:before {
+ color: #f3f1f1;
+}
+
+/* TinyMCE */
+.mce-container.mce-menu .mce-menu-item:hover,
+.mce-container.mce-menu .mce-menu-item.mce-selected,
+.mce-container.mce-menu .mce-menu-item:focus,
+.mce-container.mce-menu .mce-menu-item-normal.mce-active,
+.mce-container.mce-menu .mce-menu-item-preview.mce-active {
+ background: #dd823b;
+}
diff --git a/www/crm/wp-admin/css/colors/sunrise/colors-rtl.min.css b/www/crm/wp-admin/css/colors/sunrise/colors-rtl.min.css
new file mode 100644
index 00000000..316630c4
--- /dev/null
+++ b/www/crm/wp-admin/css/colors/sunrise/colors-rtl.min.css
@@ -0,0 +1,2 @@
+/*! This file is auto-generated */
+body{background:#f1f1f1}a{color:#0073aa}a:active,a:focus,a:hover{color:#0096dd}#media-upload a.del-link:hover,.subsubsub a.current:hover,.subsubsub a:hover,div.dashboard-widget-submit input:hover{color:#0096dd}input[type=checkbox]:checked:before{color:#dd823b}input[type=radio]:checked:before{background:#dd823b}.wp-core-ui input[type=reset]:active,.wp-core-ui input[type=reset]:hover{color:#0096dd}.wp-core-ui .button-primary{background:#dd823b;border-color:#c36922 #ad5d1e #ad5d1e;color:#fff;box-shadow:0 1px 0 #ad5d1e;text-shadow:0 -1px 1px #ad5d1e,-1px 0 1px #ad5d1e,0 1px 1px #ad5d1e,1px 0 1px #ad5d1e}.wp-core-ui .button-primary:focus,.wp-core-ui .button-primary:hover{background:#df8a48;border-color:#ad5d1e;color:#fff;box-shadow:0 1px 0 #ad5d1e}.wp-core-ui .button-primary:focus{box-shadow:inset 0 1px 0 #c36922,0 0 2px 1px #33b3db}.wp-core-ui .button-primary.active,.wp-core-ui .button-primary.active:focus,.wp-core-ui .button-primary.active:hover,.wp-core-ui .button-primary:active{background:#c36922;border-color:#ad5d1e;box-shadow:inset 0 2px 0 #ad5d1e}.wp-core-ui .button-primary.button-primary-disabled,.wp-core-ui .button-primary.disabled,.wp-core-ui .button-primary:disabled,.wp-core-ui .button-primary[disabled]{color:#d1cbc7!important;background:#cc6d23!important;border-color:#ad5d1e!important;text-shadow:none!important}.wp-core-ui .button-primary.button-hero{box-shadow:0 2px 0 #ad5d1e!important}.wp-core-ui .button-primary.button-hero:active{box-shadow:inset 0 3px 0 #ad5d1e!important}.wp-core-ui .wp-ui-primary{color:#fff;background-color:#cf4944}.wp-core-ui .wp-ui-text-primary{color:#cf4944}.wp-core-ui .wp-ui-highlight{color:#fff;background-color:#dd823b}.wp-core-ui .wp-ui-text-highlight{color:#dd823b}.wp-core-ui .wp-ui-notification{color:#fff;background-color:#ccaf0b}.wp-core-ui .wp-ui-text-notification{color:#ccaf0b}.wp-core-ui .wp-ui-text-icon{color:#f3f1f1}.wrap .add-new-h2:hover,.wrap .page-title-action:hover{color:#fff;background-color:#cf4944}.view-switch a.current:before{color:#cf4944}.view-switch a:hover:before{color:#ccaf0b}#adminmenu,#adminmenuback,#adminmenuwrap{background:#cf4944}#adminmenu a{color:#fff}#adminmenu div.wp-menu-image:before{color:#f3f1f1}#adminmenu a:hover,#adminmenu li.menu-top:hover,#adminmenu li.opensub>a.menu-top,#adminmenu li>a.menu-top:focus{color:#fff;background-color:#dd823b}#adminmenu li.menu-top:hover div.wp-menu-image:before,#adminmenu li.opensub>a.menu-top div.wp-menu-image:before{color:#fff}.about-wrap .nav-tab-active,.nav-tab-active,.nav-tab-active:hover{background-color:#f1f1f1;border-bottom-color:#f1f1f1}#adminmenu .wp-has-current-submenu .wp-submenu,#adminmenu .wp-has-current-submenu.opensub .wp-submenu,#adminmenu .wp-submenu,#adminmenu a.wp-has-current-submenu:focus+.wp-submenu,.folded #adminmenu .wp-has-current-submenu .wp-submenu{background:#be3631}#adminmenu li.wp-has-submenu.wp-not-current-submenu.opensub:hover:after{border-left-color:#be3631}#adminmenu .wp-submenu .wp-submenu-head{color:#f1c8c7}#adminmenu .wp-has-current-submenu .wp-submenu a,#adminmenu .wp-has-current-submenu.opensub .wp-submenu a,#adminmenu .wp-submenu a,#adminmenu a.wp-has-current-submenu:focus+.wp-submenu a,.folded #adminmenu .wp-has-current-submenu .wp-submenu a{color:#f1c8c7}#adminmenu .wp-has-current-submenu .wp-submenu a:focus,#adminmenu .wp-has-current-submenu .wp-submenu a:hover,#adminmenu .wp-has-current-submenu.opensub .wp-submenu a:focus,#adminmenu .wp-has-current-submenu.opensub .wp-submenu a:hover,#adminmenu .wp-submenu a:focus,#adminmenu .wp-submenu a:hover,#adminmenu a.wp-has-current-submenu:focus+.wp-submenu a:focus,#adminmenu a.wp-has-current-submenu:focus+.wp-submenu a:hover,.folded #adminmenu .wp-has-current-submenu .wp-submenu a:focus,.folded #adminmenu .wp-has-current-submenu .wp-submenu a:hover{color:#f7e3d3}#adminmenu .wp-has-current-submenu.opensub .wp-submenu li.current a,#adminmenu .wp-submenu li.current a,#adminmenu a.wp-has-current-submenu:focus+.wp-submenu li.current a{color:#fff}#adminmenu .wp-has-current-submenu.opensub .wp-submenu li.current a:focus,#adminmenu .wp-has-current-submenu.opensub .wp-submenu li.current a:hover,#adminmenu .wp-submenu li.current a:focus,#adminmenu .wp-submenu li.current a:hover,#adminmenu a.wp-has-current-submenu:focus+.wp-submenu li.current a:focus,#adminmenu a.wp-has-current-submenu:focus+.wp-submenu li.current a:hover{color:#f7e3d3}ul#adminmenu a.wp-has-current-submenu:after,ul#adminmenu>li.current>a.current:after{border-left-color:#f1f1f1}#adminmenu li.current a.menu-top,#adminmenu li.wp-has-current-submenu .wp-submenu .wp-submenu-head,#adminmenu li.wp-has-current-submenu a.wp-has-current-submenu,.folded #adminmenu li.current.menu-top{color:#fff;background:#dd823b}#adminmenu a.current:hover div.wp-menu-image:before,#adminmenu li a:focus div.wp-menu-image:before,#adminmenu li.opensub div.wp-menu-image:before,#adminmenu li.wp-has-current-submenu a:focus div.wp-menu-image:before,#adminmenu li.wp-has-current-submenu div.wp-menu-image:before,#adminmenu li.wp-has-current-submenu.opensub div.wp-menu-image:before,#adminmenu li:hover div.wp-menu-image:before,.ie8 #adminmenu li.opensub div.wp-menu-image:before{color:#fff}#adminmenu .awaiting-mod,#adminmenu .update-plugins{color:#fff;background:#ccaf0b}#adminmenu li a.wp-has-current-submenu .update-plugins,#adminmenu li.current a .awaiting-mod,#adminmenu li.menu-top:hover>a .update-plugins,#adminmenu li:hover a .awaiting-mod{color:#fff;background:#be3631}#collapse-button{color:#f3f1f1}#collapse-button:focus,#collapse-button:hover{color:#f7e3d3}#wpadminbar{color:#fff;background:#cf4944}#wpadminbar .ab-item,#wpadminbar a.ab-item,#wpadminbar>#wp-toolbar span.ab-label,#wpadminbar>#wp-toolbar span.noticon{color:#fff}#wpadminbar .ab-icon,#wpadminbar .ab-icon:before,#wpadminbar .ab-item:after,#wpadminbar .ab-item:before{color:#f3f1f1}#wpadminbar .ab-top-menu>li.menupop.hover>.ab-item,#wpadminbar.nojq .quicklinks .ab-top-menu>li>.ab-item:focus,#wpadminbar.nojs .ab-top-menu>li.menupop:hover>.ab-item,#wpadminbar:not(.mobile) .ab-top-menu>li:hover>.ab-item,#wpadminbar:not(.mobile) .ab-top-menu>li>.ab-item:focus{color:#f7e3d3;background:#be3631}#wpadminbar:not(.mobile)>#wp-toolbar a:focus span.ab-label,#wpadminbar:not(.mobile)>#wp-toolbar li.hover span.ab-label,#wpadminbar:not(.mobile)>#wp-toolbar li:hover span.ab-label{color:#f7e3d3}#wpadminbar:not(.mobile) li:hover #adminbarsearch:before,#wpadminbar:not(.mobile) li:hover .ab-icon:before,#wpadminbar:not(.mobile) li:hover .ab-item:after,#wpadminbar:not(.mobile) li:hover .ab-item:before{color:#fff}#wpadminbar .menupop .ab-sub-wrapper{background:#be3631}#wpadminbar .quicklinks .menupop ul.ab-sub-secondary,#wpadminbar .quicklinks .menupop ul.ab-sub-secondary .ab-submenu{background:#cf6b67}#wpadminbar .ab-submenu .ab-item,#wpadminbar .quicklinks .menupop ul li a,#wpadminbar .quicklinks .menupop.hover ul li a,#wpadminbar.nojs .quicklinks .menupop:hover ul li a{color:#f1c8c7}#wpadminbar .menupop .menupop>.ab-item:before,#wpadminbar .quicklinks li .blavatar{color:#f3f1f1}#wpadminbar .quicklinks .ab-sub-wrapper .menupop.hover>a,#wpadminbar .quicklinks .menupop ul li a:focus,#wpadminbar .quicklinks .menupop ul li a:focus strong,#wpadminbar .quicklinks .menupop ul li a:hover,#wpadminbar .quicklinks .menupop ul li a:hover strong,#wpadminbar .quicklinks .menupop.hover ul li a:focus,#wpadminbar .quicklinks .menupop.hover ul li a:hover,#wpadminbar li #adminbarsearch.adminbar-focused:before,#wpadminbar li .ab-item:focus .ab-icon:before,#wpadminbar li .ab-item:focus:before,#wpadminbar li a:focus .ab-icon:before,#wpadminbar li.hover .ab-icon:before,#wpadminbar li.hover .ab-item:before,#wpadminbar li:hover #adminbarsearch:before,#wpadminbar li:hover .ab-icon:before,#wpadminbar li:hover .ab-item:before,#wpadminbar.nojs .quicklinks .menupop:hover ul li a:focus,#wpadminbar.nojs .quicklinks .menupop:hover ul li a:hover{color:#f7e3d3}#wpadminbar .menupop .menupop>.ab-item:hover:before,#wpadminbar .quicklinks .ab-sub-wrapper .menupop.hover>a .blavatar,#wpadminbar .quicklinks li a:focus .blavatar,#wpadminbar .quicklinks li a:hover .blavatar,#wpadminbar.mobile .quicklinks .ab-icon:before,#wpadminbar.mobile .quicklinks .ab-item:before{color:#f7e3d3}#wpadminbar.mobile .quicklinks .hover .ab-icon:before,#wpadminbar.mobile .quicklinks .hover .ab-item:before{color:#f3f1f1}#wpadminbar #adminbarsearch:before{color:#f3f1f1}#wpadminbar>#wp-toolbar>#wp-admin-bar-top-secondary>#wp-admin-bar-search #adminbarsearch input.adminbar-input:focus{color:#fff;background:#d66560}#wpadminbar #wp-admin-bar-recovery-mode{color:#fff;background-color:#ccaf0b}#wpadminbar #wp-admin-bar-recovery-mode .ab-item,#wpadminbar #wp-admin-bar-recovery-mode a.ab-item{color:#fff}#wpadminbar .ab-top-menu>#wp-admin-bar-recovery-mode.hover>.ab-item,#wpadminbar.nojq .quicklinks .ab-top-menu>#wp-admin-bar-recovery-mode>.ab-item:focus,#wpadminbar:not(.mobile) .ab-top-menu>#wp-admin-bar-recovery-mode:hover>.ab-item,#wpadminbar:not(.mobile) .ab-top-menu>#wp-admin-bar-recovery-mode>.ab-item:focus{color:#fff;background-color:#b89e0a}#wpadminbar .quicklinks li#wp-admin-bar-my-account.with-avatar>a img{border-color:#d66560;background-color:#d66560}#wpadminbar #wp-admin-bar-user-info .display-name{color:#fff}#wpadminbar #wp-admin-bar-user-info a:hover .display-name{color:#f7e3d3}#wpadminbar #wp-admin-bar-user-info .username{color:#f1c8c7}.wp-pointer .wp-pointer-content h3{background-color:#dd823b;border-color:#d97426}.wp-pointer .wp-pointer-content h3:before{color:#dd823b}.wp-pointer.wp-pointer-top .wp-pointer-arrow,.wp-pointer.wp-pointer-top .wp-pointer-arrow-inner,.wp-pointer.wp-pointer-undefined .wp-pointer-arrow,.wp-pointer.wp-pointer-undefined .wp-pointer-arrow-inner{border-bottom-color:#dd823b}.media-item .bar,.media-progress-bar div{background-color:#dd823b}.details.attachment{box-shadow:inset 0 0 0 3px #fff,inset 0 0 0 7px #dd823b}.attachment.details .check{background-color:#dd823b;box-shadow:0 0 0 1px #fff,0 0 0 2px #dd823b}.media-selection .attachment.selection.details .thumbnail{box-shadow:0 0 0 1px #fff,0 0 0 3px #dd823b}.theme-browser .theme.active .theme-name,.theme-browser .theme.add-new-theme a:focus:after,.theme-browser .theme.add-new-theme a:hover:after{background:#dd823b}.theme-browser .theme.add-new-theme a:focus span:after,.theme-browser .theme.add-new-theme a:hover span:after{color:#dd823b}.theme-filter.current,.theme-section.current{border-bottom-color:#cf4944}body.more-filters-opened .more-filters{color:#fff;background-color:#cf4944}body.more-filters-opened .more-filters:before{color:#fff}body.more-filters-opened .more-filters:focus,body.more-filters-opened .more-filters:hover{background-color:#dd823b;color:#fff}body.more-filters-opened .more-filters:focus:before,body.more-filters-opened .more-filters:hover:before{color:#fff}.widgets-chooser li.widgets-chooser-selected{background-color:#dd823b;color:#fff}.widgets-chooser li.widgets-chooser-selected:before,.widgets-chooser li.widgets-chooser-selected:focus:before{color:#fff}div#wp-responsive-toggle a:before{color:#f3f1f1}.wp-responsive-open div#wp-responsive-toggle a{border-color:transparent;background:#dd823b}.wp-responsive-open #wpadminbar #wp-admin-bar-menu-toggle a{background:#be3631}.wp-responsive-open #wpadminbar #wp-admin-bar-menu-toggle .ab-icon:before{color:#f3f1f1}.mce-container.mce-menu .mce-menu-item-normal.mce-active,.mce-container.mce-menu .mce-menu-item-preview.mce-active,.mce-container.mce-menu .mce-menu-item.mce-selected,.mce-container.mce-menu .mce-menu-item:focus,.mce-container.mce-menu .mce-menu-item:hover{background:#dd823b} \ No newline at end of file
diff --git a/www/crm/wp-admin/css/colors/sunrise/colors.css b/www/crm/wp-admin/css/colors/sunrise/colors.css
new file mode 100644
index 00000000..f51cf28e
--- /dev/null
+++ b/www/crm/wp-admin/css/colors/sunrise/colors.css
@@ -0,0 +1,519 @@
+/*! This file is auto-generated */
+/*
+ * Button mixin- creates 3d-ish button effect with correct
+ * highlights/shadows, based on a base color.
+ */
+body {
+ background: #f1f1f1;
+}
+
+/* Links */
+a {
+ color: #0073aa;
+}
+
+a:hover, a:active, a:focus {
+ color: #0096dd;
+}
+
+#media-upload a.del-link:hover,
+div.dashboard-widget-submit input:hover,
+.subsubsub a:hover,
+.subsubsub a.current:hover {
+ color: #0096dd;
+}
+
+/* Forms */
+input[type=checkbox]:checked:before {
+ color: #dd823b;
+}
+
+input[type=radio]:checked:before {
+ background: #dd823b;
+}
+
+.wp-core-ui input[type="reset"]:hover,
+.wp-core-ui input[type="reset"]:active {
+ color: #0096dd;
+}
+
+/* Core UI */
+.wp-core-ui .button-primary {
+ background: #dd823b;
+ border-color: #c36922 #ad5d1e #ad5d1e;
+ color: #fff;
+ box-shadow: 0 1px 0 #ad5d1e;
+ text-shadow: 0 -1px 1px #ad5d1e, 1px 0 1px #ad5d1e, 0 1px 1px #ad5d1e, -1px 0 1px #ad5d1e;
+}
+
+.wp-core-ui .button-primary:hover, .wp-core-ui .button-primary:focus {
+ background: #df8a48;
+ border-color: #ad5d1e;
+ color: #fff;
+ box-shadow: 0 1px 0 #ad5d1e;
+}
+
+.wp-core-ui .button-primary:focus {
+ box-shadow: inset 0 1px 0 #c36922, 0 0 2px 1px #33b3db;
+}
+
+.wp-core-ui .button-primary:active, .wp-core-ui .button-primary.active, .wp-core-ui .button-primary.active:focus, .wp-core-ui .button-primary.active:hover {
+ background: #c36922;
+ border-color: #ad5d1e;
+ box-shadow: inset 0 2px 0 #ad5d1e;
+}
+
+.wp-core-ui .button-primary[disabled], .wp-core-ui .button-primary:disabled, .wp-core-ui .button-primary.button-primary-disabled, .wp-core-ui .button-primary.disabled {
+ color: #d1cbc7 !important;
+ background: #cc6d23 !important;
+ border-color: #ad5d1e !important;
+ text-shadow: none !important;
+}
+
+.wp-core-ui .button-primary.button-hero {
+ box-shadow: 0 2px 0 #ad5d1e !important;
+}
+
+.wp-core-ui .button-primary.button-hero:active {
+ box-shadow: inset 0 3px 0 #ad5d1e !important;
+}
+
+.wp-core-ui .wp-ui-primary {
+ color: #fff;
+ background-color: #cf4944;
+}
+
+.wp-core-ui .wp-ui-text-primary {
+ color: #cf4944;
+}
+
+.wp-core-ui .wp-ui-highlight {
+ color: #fff;
+ background-color: #dd823b;
+}
+
+.wp-core-ui .wp-ui-text-highlight {
+ color: #dd823b;
+}
+
+.wp-core-ui .wp-ui-notification {
+ color: #fff;
+ background-color: #ccaf0b;
+}
+
+.wp-core-ui .wp-ui-text-notification {
+ color: #ccaf0b;
+}
+
+.wp-core-ui .wp-ui-text-icon {
+ color: #f3f1f1;
+}
+
+/* List tables */
+.wrap .add-new-h2:hover,
+.wrap .page-title-action:hover {
+ color: #fff;
+ background-color: #cf4944;
+}
+
+.view-switch a.current:before {
+ color: #cf4944;
+}
+
+.view-switch a:hover:before {
+ color: #ccaf0b;
+}
+
+/* Admin Menu */
+#adminmenuback,
+#adminmenuwrap,
+#adminmenu {
+ background: #cf4944;
+}
+
+#adminmenu a {
+ color: #fff;
+}
+
+#adminmenu div.wp-menu-image:before {
+ color: #f3f1f1;
+}
+
+#adminmenu a:hover,
+#adminmenu li.menu-top:hover,
+#adminmenu li.opensub > a.menu-top,
+#adminmenu li > a.menu-top:focus {
+ color: #fff;
+ background-color: #dd823b;
+}
+
+#adminmenu li.menu-top:hover div.wp-menu-image:before,
+#adminmenu li.opensub > a.menu-top div.wp-menu-image:before {
+ color: #fff;
+}
+
+/* Active tabs use a bottom border color that matches the page background color. */
+.about-wrap .nav-tab-active,
+.nav-tab-active,
+.nav-tab-active:hover {
+ background-color: #f1f1f1;
+ border-bottom-color: #f1f1f1;
+}
+
+/* Admin Menu: submenu */
+#adminmenu .wp-submenu,
+#adminmenu .wp-has-current-submenu .wp-submenu,
+#adminmenu .wp-has-current-submenu.opensub .wp-submenu,
+.folded #adminmenu .wp-has-current-submenu .wp-submenu,
+#adminmenu a.wp-has-current-submenu:focus + .wp-submenu {
+ background: #be3631;
+}
+
+#adminmenu li.wp-has-submenu.wp-not-current-submenu.opensub:hover:after {
+ border-right-color: #be3631;
+}
+
+#adminmenu .wp-submenu .wp-submenu-head {
+ color: #f1c8c7;
+}
+
+#adminmenu .wp-submenu a,
+#adminmenu .wp-has-current-submenu .wp-submenu a,
+.folded #adminmenu .wp-has-current-submenu .wp-submenu a,
+#adminmenu a.wp-has-current-submenu:focus + .wp-submenu a,
+#adminmenu .wp-has-current-submenu.opensub .wp-submenu a {
+ color: #f1c8c7;
+}
+
+#adminmenu .wp-submenu a:focus, #adminmenu .wp-submenu a:hover,
+#adminmenu .wp-has-current-submenu .wp-submenu a:focus,
+#adminmenu .wp-has-current-submenu .wp-submenu a:hover,
+.folded #adminmenu .wp-has-current-submenu .wp-submenu a:focus,
+.folded #adminmenu .wp-has-current-submenu .wp-submenu a:hover,
+#adminmenu a.wp-has-current-submenu:focus + .wp-submenu a:focus,
+#adminmenu a.wp-has-current-submenu:focus + .wp-submenu a:hover,
+#adminmenu .wp-has-current-submenu.opensub .wp-submenu a:focus,
+#adminmenu .wp-has-current-submenu.opensub .wp-submenu a:hover {
+ color: #f7e3d3;
+}
+
+/* Admin Menu: current */
+#adminmenu .wp-submenu li.current a,
+#adminmenu a.wp-has-current-submenu:focus + .wp-submenu li.current a,
+#adminmenu .wp-has-current-submenu.opensub .wp-submenu li.current a {
+ color: #fff;
+}
+
+#adminmenu .wp-submenu li.current a:hover, #adminmenu .wp-submenu li.current a:focus,
+#adminmenu a.wp-has-current-submenu:focus + .wp-submenu li.current a:hover,
+#adminmenu a.wp-has-current-submenu:focus + .wp-submenu li.current a:focus,
+#adminmenu .wp-has-current-submenu.opensub .wp-submenu li.current a:hover,
+#adminmenu .wp-has-current-submenu.opensub .wp-submenu li.current a:focus {
+ color: #f7e3d3;
+}
+
+ul#adminmenu a.wp-has-current-submenu:after,
+ul#adminmenu > li.current > a.current:after {
+ border-right-color: #f1f1f1;
+}
+
+#adminmenu li.current a.menu-top,
+#adminmenu li.wp-has-current-submenu a.wp-has-current-submenu,
+#adminmenu li.wp-has-current-submenu .wp-submenu .wp-submenu-head,
+.folded #adminmenu li.current.menu-top {
+ color: #fff;
+ background: #dd823b;
+}
+
+#adminmenu li.wp-has-current-submenu div.wp-menu-image:before,
+#adminmenu a.current:hover div.wp-menu-image:before,
+#adminmenu li.wp-has-current-submenu a:focus div.wp-menu-image:before,
+#adminmenu li.wp-has-current-submenu.opensub div.wp-menu-image:before,
+#adminmenu li:hover div.wp-menu-image:before,
+#adminmenu li a:focus div.wp-menu-image:before,
+#adminmenu li.opensub div.wp-menu-image:before,
+.ie8 #adminmenu li.opensub div.wp-menu-image:before {
+ color: #fff;
+}
+
+/* Admin Menu: bubble */
+#adminmenu .awaiting-mod,
+#adminmenu .update-plugins {
+ color: #fff;
+ background: #ccaf0b;
+}
+
+#adminmenu li.current a .awaiting-mod,
+#adminmenu li a.wp-has-current-submenu .update-plugins,
+#adminmenu li:hover a .awaiting-mod,
+#adminmenu li.menu-top:hover > a .update-plugins {
+ color: #fff;
+ background: #be3631;
+}
+
+/* Admin Menu: collapse button */
+#collapse-button {
+ color: #f3f1f1;
+}
+
+#collapse-button:hover,
+#collapse-button:focus {
+ color: #f7e3d3;
+}
+
+/* Admin Bar */
+#wpadminbar {
+ color: #fff;
+ background: #cf4944;
+}
+
+#wpadminbar .ab-item,
+#wpadminbar a.ab-item,
+#wpadminbar > #wp-toolbar span.ab-label,
+#wpadminbar > #wp-toolbar span.noticon {
+ color: #fff;
+}
+
+#wpadminbar .ab-icon,
+#wpadminbar .ab-icon:before,
+#wpadminbar .ab-item:before,
+#wpadminbar .ab-item:after {
+ color: #f3f1f1;
+}
+
+#wpadminbar:not(.mobile) .ab-top-menu > li:hover > .ab-item,
+#wpadminbar:not(.mobile) .ab-top-menu > li > .ab-item:focus,
+#wpadminbar.nojq .quicklinks .ab-top-menu > li > .ab-item:focus,
+#wpadminbar.nojs .ab-top-menu > li.menupop:hover > .ab-item,
+#wpadminbar .ab-top-menu > li.menupop.hover > .ab-item {
+ color: #f7e3d3;
+ background: #be3631;
+}
+
+#wpadminbar:not(.mobile) > #wp-toolbar li:hover span.ab-label,
+#wpadminbar:not(.mobile) > #wp-toolbar li.hover span.ab-label,
+#wpadminbar:not(.mobile) > #wp-toolbar a:focus span.ab-label {
+ color: #f7e3d3;
+}
+
+#wpadminbar:not(.mobile) li:hover .ab-icon:before,
+#wpadminbar:not(.mobile) li:hover .ab-item:before,
+#wpadminbar:not(.mobile) li:hover .ab-item:after,
+#wpadminbar:not(.mobile) li:hover #adminbarsearch:before {
+ color: #fff;
+}
+
+/* Admin Bar: submenu */
+#wpadminbar .menupop .ab-sub-wrapper {
+ background: #be3631;
+}
+
+#wpadminbar .quicklinks .menupop ul.ab-sub-secondary,
+#wpadminbar .quicklinks .menupop ul.ab-sub-secondary .ab-submenu {
+ background: #cf6b67;
+}
+
+#wpadminbar .ab-submenu .ab-item,
+#wpadminbar .quicklinks .menupop ul li a,
+#wpadminbar .quicklinks .menupop.hover ul li a,
+#wpadminbar.nojs .quicklinks .menupop:hover ul li a {
+ color: #f1c8c7;
+}
+
+#wpadminbar .quicklinks li .blavatar,
+#wpadminbar .menupop .menupop > .ab-item:before {
+ color: #f3f1f1;
+}
+
+#wpadminbar .quicklinks .menupop ul li a:hover,
+#wpadminbar .quicklinks .menupop ul li a:focus,
+#wpadminbar .quicklinks .menupop ul li a:hover strong,
+#wpadminbar .quicklinks .menupop ul li a:focus strong,
+#wpadminbar .quicklinks .ab-sub-wrapper .menupop.hover > a,
+#wpadminbar .quicklinks .menupop.hover ul li a:hover,
+#wpadminbar .quicklinks .menupop.hover ul li a:focus,
+#wpadminbar.nojs .quicklinks .menupop:hover ul li a:hover,
+#wpadminbar.nojs .quicklinks .menupop:hover ul li a:focus,
+#wpadminbar li:hover .ab-icon:before,
+#wpadminbar li:hover .ab-item:before,
+#wpadminbar li a:focus .ab-icon:before,
+#wpadminbar li .ab-item:focus:before,
+#wpadminbar li .ab-item:focus .ab-icon:before,
+#wpadminbar li.hover .ab-icon:before,
+#wpadminbar li.hover .ab-item:before,
+#wpadminbar li:hover #adminbarsearch:before,
+#wpadminbar li #adminbarsearch.adminbar-focused:before {
+ color: #f7e3d3;
+}
+
+#wpadminbar .quicklinks li a:hover .blavatar,
+#wpadminbar .quicklinks li a:focus .blavatar,
+#wpadminbar .quicklinks .ab-sub-wrapper .menupop.hover > a .blavatar,
+#wpadminbar .menupop .menupop > .ab-item:hover:before,
+#wpadminbar.mobile .quicklinks .ab-icon:before,
+#wpadminbar.mobile .quicklinks .ab-item:before {
+ color: #f7e3d3;
+}
+
+#wpadminbar.mobile .quicklinks .hover .ab-icon:before,
+#wpadminbar.mobile .quicklinks .hover .ab-item:before {
+ color: #f3f1f1;
+}
+
+/* Admin Bar: search */
+#wpadminbar #adminbarsearch:before {
+ color: #f3f1f1;
+}
+
+#wpadminbar > #wp-toolbar > #wp-admin-bar-top-secondary > #wp-admin-bar-search #adminbarsearch input.adminbar-input:focus {
+ color: #fff;
+ background: #d66560;
+}
+
+/* Admin Bar: recovery mode */
+#wpadminbar #wp-admin-bar-recovery-mode {
+ color: #fff;
+ background-color: #ccaf0b;
+}
+
+#wpadminbar #wp-admin-bar-recovery-mode .ab-item,
+#wpadminbar #wp-admin-bar-recovery-mode a.ab-item {
+ color: #fff;
+}
+
+#wpadminbar .ab-top-menu > #wp-admin-bar-recovery-mode.hover > .ab-item,
+#wpadminbar.nojq .quicklinks .ab-top-menu > #wp-admin-bar-recovery-mode > .ab-item:focus,
+#wpadminbar:not(.mobile) .ab-top-menu > #wp-admin-bar-recovery-mode:hover > .ab-item,
+#wpadminbar:not(.mobile) .ab-top-menu > #wp-admin-bar-recovery-mode > .ab-item:focus {
+ color: #fff;
+ background-color: #b89e0a;
+}
+
+/* Admin Bar: my account */
+#wpadminbar .quicklinks li#wp-admin-bar-my-account.with-avatar > a img {
+ border-color: #d66560;
+ background-color: #d66560;
+}
+
+#wpadminbar #wp-admin-bar-user-info .display-name {
+ color: #fff;
+}
+
+#wpadminbar #wp-admin-bar-user-info a:hover .display-name {
+ color: #f7e3d3;
+}
+
+#wpadminbar #wp-admin-bar-user-info .username {
+ color: #f1c8c7;
+}
+
+/* Pointers */
+.wp-pointer .wp-pointer-content h3 {
+ background-color: #dd823b;
+ border-color: #d97426;
+}
+
+.wp-pointer .wp-pointer-content h3:before {
+ color: #dd823b;
+}
+
+.wp-pointer.wp-pointer-top .wp-pointer-arrow,
+.wp-pointer.wp-pointer-top .wp-pointer-arrow-inner,
+.wp-pointer.wp-pointer-undefined .wp-pointer-arrow,
+.wp-pointer.wp-pointer-undefined .wp-pointer-arrow-inner {
+ border-bottom-color: #dd823b;
+}
+
+/* Media */
+.media-item .bar,
+.media-progress-bar div {
+ background-color: #dd823b;
+}
+
+.details.attachment {
+ box-shadow: inset 0 0 0 3px #fff, inset 0 0 0 7px #dd823b;
+}
+
+.attachment.details .check {
+ background-color: #dd823b;
+ box-shadow: 0 0 0 1px #fff, 0 0 0 2px #dd823b;
+}
+
+.media-selection .attachment.selection.details .thumbnail {
+ box-shadow: 0 0 0 1px #fff, 0 0 0 3px #dd823b;
+}
+
+/* Themes */
+.theme-browser .theme.active .theme-name,
+.theme-browser .theme.add-new-theme a:hover:after,
+.theme-browser .theme.add-new-theme a:focus:after {
+ background: #dd823b;
+}
+
+.theme-browser .theme.add-new-theme a:hover span:after,
+.theme-browser .theme.add-new-theme a:focus span:after {
+ color: #dd823b;
+}
+
+.theme-section.current,
+.theme-filter.current {
+ border-bottom-color: #cf4944;
+}
+
+body.more-filters-opened .more-filters {
+ color: #fff;
+ background-color: #cf4944;
+}
+
+body.more-filters-opened .more-filters:before {
+ color: #fff;
+}
+
+body.more-filters-opened .more-filters:hover,
+body.more-filters-opened .more-filters:focus {
+ background-color: #dd823b;
+ color: #fff;
+}
+
+body.more-filters-opened .more-filters:hover:before,
+body.more-filters-opened .more-filters:focus:before {
+ color: #fff;
+}
+
+/* Widgets */
+.widgets-chooser li.widgets-chooser-selected {
+ background-color: #dd823b;
+ color: #fff;
+}
+
+.widgets-chooser li.widgets-chooser-selected:before,
+.widgets-chooser li.widgets-chooser-selected:focus:before {
+ color: #fff;
+}
+
+/* Responsive Component */
+div#wp-responsive-toggle a:before {
+ color: #f3f1f1;
+}
+
+.wp-responsive-open div#wp-responsive-toggle a {
+ border-color: transparent;
+ background: #dd823b;
+}
+
+.wp-responsive-open #wpadminbar #wp-admin-bar-menu-toggle a {
+ background: #be3631;
+}
+
+.wp-responsive-open #wpadminbar #wp-admin-bar-menu-toggle .ab-icon:before {
+ color: #f3f1f1;
+}
+
+/* TinyMCE */
+.mce-container.mce-menu .mce-menu-item:hover,
+.mce-container.mce-menu .mce-menu-item.mce-selected,
+.mce-container.mce-menu .mce-menu-item:focus,
+.mce-container.mce-menu .mce-menu-item-normal.mce-active,
+.mce-container.mce-menu .mce-menu-item-preview.mce-active {
+ background: #dd823b;
+}
diff --git a/www/crm/wp-admin/css/colors/sunrise/colors.min.css b/www/crm/wp-admin/css/colors/sunrise/colors.min.css
new file mode 100644
index 00000000..c052f3bd
--- /dev/null
+++ b/www/crm/wp-admin/css/colors/sunrise/colors.min.css
@@ -0,0 +1,2 @@
+/*! This file is auto-generated */
+body{background:#f1f1f1}a{color:#0073aa}a:active,a:focus,a:hover{color:#0096dd}#media-upload a.del-link:hover,.subsubsub a.current:hover,.subsubsub a:hover,div.dashboard-widget-submit input:hover{color:#0096dd}input[type=checkbox]:checked:before{color:#dd823b}input[type=radio]:checked:before{background:#dd823b}.wp-core-ui input[type=reset]:active,.wp-core-ui input[type=reset]:hover{color:#0096dd}.wp-core-ui .button-primary{background:#dd823b;border-color:#c36922 #ad5d1e #ad5d1e;color:#fff;box-shadow:0 1px 0 #ad5d1e;text-shadow:0 -1px 1px #ad5d1e,1px 0 1px #ad5d1e,0 1px 1px #ad5d1e,-1px 0 1px #ad5d1e}.wp-core-ui .button-primary:focus,.wp-core-ui .button-primary:hover{background:#df8a48;border-color:#ad5d1e;color:#fff;box-shadow:0 1px 0 #ad5d1e}.wp-core-ui .button-primary:focus{box-shadow:inset 0 1px 0 #c36922,0 0 2px 1px #33b3db}.wp-core-ui .button-primary.active,.wp-core-ui .button-primary.active:focus,.wp-core-ui .button-primary.active:hover,.wp-core-ui .button-primary:active{background:#c36922;border-color:#ad5d1e;box-shadow:inset 0 2px 0 #ad5d1e}.wp-core-ui .button-primary.button-primary-disabled,.wp-core-ui .button-primary.disabled,.wp-core-ui .button-primary:disabled,.wp-core-ui .button-primary[disabled]{color:#d1cbc7!important;background:#cc6d23!important;border-color:#ad5d1e!important;text-shadow:none!important}.wp-core-ui .button-primary.button-hero{box-shadow:0 2px 0 #ad5d1e!important}.wp-core-ui .button-primary.button-hero:active{box-shadow:inset 0 3px 0 #ad5d1e!important}.wp-core-ui .wp-ui-primary{color:#fff;background-color:#cf4944}.wp-core-ui .wp-ui-text-primary{color:#cf4944}.wp-core-ui .wp-ui-highlight{color:#fff;background-color:#dd823b}.wp-core-ui .wp-ui-text-highlight{color:#dd823b}.wp-core-ui .wp-ui-notification{color:#fff;background-color:#ccaf0b}.wp-core-ui .wp-ui-text-notification{color:#ccaf0b}.wp-core-ui .wp-ui-text-icon{color:#f3f1f1}.wrap .add-new-h2:hover,.wrap .page-title-action:hover{color:#fff;background-color:#cf4944}.view-switch a.current:before{color:#cf4944}.view-switch a:hover:before{color:#ccaf0b}#adminmenu,#adminmenuback,#adminmenuwrap{background:#cf4944}#adminmenu a{color:#fff}#adminmenu div.wp-menu-image:before{color:#f3f1f1}#adminmenu a:hover,#adminmenu li.menu-top:hover,#adminmenu li.opensub>a.menu-top,#adminmenu li>a.menu-top:focus{color:#fff;background-color:#dd823b}#adminmenu li.menu-top:hover div.wp-menu-image:before,#adminmenu li.opensub>a.menu-top div.wp-menu-image:before{color:#fff}.about-wrap .nav-tab-active,.nav-tab-active,.nav-tab-active:hover{background-color:#f1f1f1;border-bottom-color:#f1f1f1}#adminmenu .wp-has-current-submenu .wp-submenu,#adminmenu .wp-has-current-submenu.opensub .wp-submenu,#adminmenu .wp-submenu,#adminmenu a.wp-has-current-submenu:focus+.wp-submenu,.folded #adminmenu .wp-has-current-submenu .wp-submenu{background:#be3631}#adminmenu li.wp-has-submenu.wp-not-current-submenu.opensub:hover:after{border-right-color:#be3631}#adminmenu .wp-submenu .wp-submenu-head{color:#f1c8c7}#adminmenu .wp-has-current-submenu .wp-submenu a,#adminmenu .wp-has-current-submenu.opensub .wp-submenu a,#adminmenu .wp-submenu a,#adminmenu a.wp-has-current-submenu:focus+.wp-submenu a,.folded #adminmenu .wp-has-current-submenu .wp-submenu a{color:#f1c8c7}#adminmenu .wp-has-current-submenu .wp-submenu a:focus,#adminmenu .wp-has-current-submenu .wp-submenu a:hover,#adminmenu .wp-has-current-submenu.opensub .wp-submenu a:focus,#adminmenu .wp-has-current-submenu.opensub .wp-submenu a:hover,#adminmenu .wp-submenu a:focus,#adminmenu .wp-submenu a:hover,#adminmenu a.wp-has-current-submenu:focus+.wp-submenu a:focus,#adminmenu a.wp-has-current-submenu:focus+.wp-submenu a:hover,.folded #adminmenu .wp-has-current-submenu .wp-submenu a:focus,.folded #adminmenu .wp-has-current-submenu .wp-submenu a:hover{color:#f7e3d3}#adminmenu .wp-has-current-submenu.opensub .wp-submenu li.current a,#adminmenu .wp-submenu li.current a,#adminmenu a.wp-has-current-submenu:focus+.wp-submenu li.current a{color:#fff}#adminmenu .wp-has-current-submenu.opensub .wp-submenu li.current a:focus,#adminmenu .wp-has-current-submenu.opensub .wp-submenu li.current a:hover,#adminmenu .wp-submenu li.current a:focus,#adminmenu .wp-submenu li.current a:hover,#adminmenu a.wp-has-current-submenu:focus+.wp-submenu li.current a:focus,#adminmenu a.wp-has-current-submenu:focus+.wp-submenu li.current a:hover{color:#f7e3d3}ul#adminmenu a.wp-has-current-submenu:after,ul#adminmenu>li.current>a.current:after{border-right-color:#f1f1f1}#adminmenu li.current a.menu-top,#adminmenu li.wp-has-current-submenu .wp-submenu .wp-submenu-head,#adminmenu li.wp-has-current-submenu a.wp-has-current-submenu,.folded #adminmenu li.current.menu-top{color:#fff;background:#dd823b}#adminmenu a.current:hover div.wp-menu-image:before,#adminmenu li a:focus div.wp-menu-image:before,#adminmenu li.opensub div.wp-menu-image:before,#adminmenu li.wp-has-current-submenu a:focus div.wp-menu-image:before,#adminmenu li.wp-has-current-submenu div.wp-menu-image:before,#adminmenu li.wp-has-current-submenu.opensub div.wp-menu-image:before,#adminmenu li:hover div.wp-menu-image:before,.ie8 #adminmenu li.opensub div.wp-menu-image:before{color:#fff}#adminmenu .awaiting-mod,#adminmenu .update-plugins{color:#fff;background:#ccaf0b}#adminmenu li a.wp-has-current-submenu .update-plugins,#adminmenu li.current a .awaiting-mod,#adminmenu li.menu-top:hover>a .update-plugins,#adminmenu li:hover a .awaiting-mod{color:#fff;background:#be3631}#collapse-button{color:#f3f1f1}#collapse-button:focus,#collapse-button:hover{color:#f7e3d3}#wpadminbar{color:#fff;background:#cf4944}#wpadminbar .ab-item,#wpadminbar a.ab-item,#wpadminbar>#wp-toolbar span.ab-label,#wpadminbar>#wp-toolbar span.noticon{color:#fff}#wpadminbar .ab-icon,#wpadminbar .ab-icon:before,#wpadminbar .ab-item:after,#wpadminbar .ab-item:before{color:#f3f1f1}#wpadminbar .ab-top-menu>li.menupop.hover>.ab-item,#wpadminbar.nojq .quicklinks .ab-top-menu>li>.ab-item:focus,#wpadminbar.nojs .ab-top-menu>li.menupop:hover>.ab-item,#wpadminbar:not(.mobile) .ab-top-menu>li:hover>.ab-item,#wpadminbar:not(.mobile) .ab-top-menu>li>.ab-item:focus{color:#f7e3d3;background:#be3631}#wpadminbar:not(.mobile)>#wp-toolbar a:focus span.ab-label,#wpadminbar:not(.mobile)>#wp-toolbar li.hover span.ab-label,#wpadminbar:not(.mobile)>#wp-toolbar li:hover span.ab-label{color:#f7e3d3}#wpadminbar:not(.mobile) li:hover #adminbarsearch:before,#wpadminbar:not(.mobile) li:hover .ab-icon:before,#wpadminbar:not(.mobile) li:hover .ab-item:after,#wpadminbar:not(.mobile) li:hover .ab-item:before{color:#fff}#wpadminbar .menupop .ab-sub-wrapper{background:#be3631}#wpadminbar .quicklinks .menupop ul.ab-sub-secondary,#wpadminbar .quicklinks .menupop ul.ab-sub-secondary .ab-submenu{background:#cf6b67}#wpadminbar .ab-submenu .ab-item,#wpadminbar .quicklinks .menupop ul li a,#wpadminbar .quicklinks .menupop.hover ul li a,#wpadminbar.nojs .quicklinks .menupop:hover ul li a{color:#f1c8c7}#wpadminbar .menupop .menupop>.ab-item:before,#wpadminbar .quicklinks li .blavatar{color:#f3f1f1}#wpadminbar .quicklinks .ab-sub-wrapper .menupop.hover>a,#wpadminbar .quicklinks .menupop ul li a:focus,#wpadminbar .quicklinks .menupop ul li a:focus strong,#wpadminbar .quicklinks .menupop ul li a:hover,#wpadminbar .quicklinks .menupop ul li a:hover strong,#wpadminbar .quicklinks .menupop.hover ul li a:focus,#wpadminbar .quicklinks .menupop.hover ul li a:hover,#wpadminbar li #adminbarsearch.adminbar-focused:before,#wpadminbar li .ab-item:focus .ab-icon:before,#wpadminbar li .ab-item:focus:before,#wpadminbar li a:focus .ab-icon:before,#wpadminbar li.hover .ab-icon:before,#wpadminbar li.hover .ab-item:before,#wpadminbar li:hover #adminbarsearch:before,#wpadminbar li:hover .ab-icon:before,#wpadminbar li:hover .ab-item:before,#wpadminbar.nojs .quicklinks .menupop:hover ul li a:focus,#wpadminbar.nojs .quicklinks .menupop:hover ul li a:hover{color:#f7e3d3}#wpadminbar .menupop .menupop>.ab-item:hover:before,#wpadminbar .quicklinks .ab-sub-wrapper .menupop.hover>a .blavatar,#wpadminbar .quicklinks li a:focus .blavatar,#wpadminbar .quicklinks li a:hover .blavatar,#wpadminbar.mobile .quicklinks .ab-icon:before,#wpadminbar.mobile .quicklinks .ab-item:before{color:#f7e3d3}#wpadminbar.mobile .quicklinks .hover .ab-icon:before,#wpadminbar.mobile .quicklinks .hover .ab-item:before{color:#f3f1f1}#wpadminbar #adminbarsearch:before{color:#f3f1f1}#wpadminbar>#wp-toolbar>#wp-admin-bar-top-secondary>#wp-admin-bar-search #adminbarsearch input.adminbar-input:focus{color:#fff;background:#d66560}#wpadminbar #wp-admin-bar-recovery-mode{color:#fff;background-color:#ccaf0b}#wpadminbar #wp-admin-bar-recovery-mode .ab-item,#wpadminbar #wp-admin-bar-recovery-mode a.ab-item{color:#fff}#wpadminbar .ab-top-menu>#wp-admin-bar-recovery-mode.hover>.ab-item,#wpadminbar.nojq .quicklinks .ab-top-menu>#wp-admin-bar-recovery-mode>.ab-item:focus,#wpadminbar:not(.mobile) .ab-top-menu>#wp-admin-bar-recovery-mode:hover>.ab-item,#wpadminbar:not(.mobile) .ab-top-menu>#wp-admin-bar-recovery-mode>.ab-item:focus{color:#fff;background-color:#b89e0a}#wpadminbar .quicklinks li#wp-admin-bar-my-account.with-avatar>a img{border-color:#d66560;background-color:#d66560}#wpadminbar #wp-admin-bar-user-info .display-name{color:#fff}#wpadminbar #wp-admin-bar-user-info a:hover .display-name{color:#f7e3d3}#wpadminbar #wp-admin-bar-user-info .username{color:#f1c8c7}.wp-pointer .wp-pointer-content h3{background-color:#dd823b;border-color:#d97426}.wp-pointer .wp-pointer-content h3:before{color:#dd823b}.wp-pointer.wp-pointer-top .wp-pointer-arrow,.wp-pointer.wp-pointer-top .wp-pointer-arrow-inner,.wp-pointer.wp-pointer-undefined .wp-pointer-arrow,.wp-pointer.wp-pointer-undefined .wp-pointer-arrow-inner{border-bottom-color:#dd823b}.media-item .bar,.media-progress-bar div{background-color:#dd823b}.details.attachment{box-shadow:inset 0 0 0 3px #fff,inset 0 0 0 7px #dd823b}.attachment.details .check{background-color:#dd823b;box-shadow:0 0 0 1px #fff,0 0 0 2px #dd823b}.media-selection .attachment.selection.details .thumbnail{box-shadow:0 0 0 1px #fff,0 0 0 3px #dd823b}.theme-browser .theme.active .theme-name,.theme-browser .theme.add-new-theme a:focus:after,.theme-browser .theme.add-new-theme a:hover:after{background:#dd823b}.theme-browser .theme.add-new-theme a:focus span:after,.theme-browser .theme.add-new-theme a:hover span:after{color:#dd823b}.theme-filter.current,.theme-section.current{border-bottom-color:#cf4944}body.more-filters-opened .more-filters{color:#fff;background-color:#cf4944}body.more-filters-opened .more-filters:before{color:#fff}body.more-filters-opened .more-filters:focus,body.more-filters-opened .more-filters:hover{background-color:#dd823b;color:#fff}body.more-filters-opened .more-filters:focus:before,body.more-filters-opened .more-filters:hover:before{color:#fff}.widgets-chooser li.widgets-chooser-selected{background-color:#dd823b;color:#fff}.widgets-chooser li.widgets-chooser-selected:before,.widgets-chooser li.widgets-chooser-selected:focus:before{color:#fff}div#wp-responsive-toggle a:before{color:#f3f1f1}.wp-responsive-open div#wp-responsive-toggle a{border-color:transparent;background:#dd823b}.wp-responsive-open #wpadminbar #wp-admin-bar-menu-toggle a{background:#be3631}.wp-responsive-open #wpadminbar #wp-admin-bar-menu-toggle .ab-icon:before{color:#f3f1f1}.mce-container.mce-menu .mce-menu-item-normal.mce-active,.mce-container.mce-menu .mce-menu-item-preview.mce-active,.mce-container.mce-menu .mce-menu-item.mce-selected,.mce-container.mce-menu .mce-menu-item:focus,.mce-container.mce-menu .mce-menu-item:hover{background:#dd823b} \ No newline at end of file
diff --git a/www/crm/wp-admin/css/colors/sunrise/colors.scss b/www/crm/wp-admin/css/colors/sunrise/colors.scss
new file mode 100644
index 00000000..5dd8d82f
--- /dev/null
+++ b/www/crm/wp-admin/css/colors/sunrise/colors.scss
@@ -0,0 +1,6 @@
+$base-color: #cf4944;
+$highlight-color: #dd823b;
+$notification-color: #ccaf0b;
+$menu-submenu-focus-text: lighten( $highlight-color, 35% );
+
+@import "../_admin.scss";
diff --git a/www/crm/wp-admin/css/common-rtl.css b/www/crm/wp-admin/css/common-rtl.css
new file mode 100644
index 00000000..860d71b4
--- /dev/null
+++ b/www/crm/wp-admin/css/common-rtl.css
@@ -0,0 +1,4041 @@
+/* 2 column liquid layout */
+#wpwrap {
+ height: auto;
+ min-height: 100%;
+ width: 100%;
+ position: relative;
+ -webkit-font-smoothing: subpixel-antialiased;
+}
+
+#wpcontent {
+ height: 100%;
+ padding-right: 20px;
+}
+
+#wpcontent,
+#wpfooter {
+ margin-right: 160px;
+}
+
+.folded #wpcontent,
+.folded #wpfooter {
+ margin-right: 36px;
+}
+
+#wpbody-content {
+ padding-bottom: 65px;
+ float: right;
+ width: 100%;
+ overflow: visible !important;
+}
+
+/* inner 2 column liquid layout */
+
+.inner-sidebar {
+ float: left;
+ clear: left;
+ display: none;
+ width: 281px;
+ position: relative;
+}
+
+.columns-2 .inner-sidebar {
+ margin-left: auto;
+ width: 286px;
+ display: block;
+}
+
+.inner-sidebar #side-sortables,
+.columns-2 .inner-sidebar #side-sortables {
+ min-height: 300px;
+ width: 280px;
+ padding: 0;
+}
+
+.has-right-sidebar .inner-sidebar {
+ display: block;
+}
+
+.has-right-sidebar #post-body {
+ float: right;
+ clear: right;
+ width: 100%;
+ margin-left: -2000px;
+}
+
+.has-right-sidebar #post-body-content {
+ margin-left: 300px;
+ float: none;
+ width: auto;
+}
+
+/* 2 columns main area */
+
+#col-left {
+ float: right;
+ width: 35%;
+}
+
+#col-right {
+ float: left;
+ width: 65%;
+}
+
+#col-left .col-wrap {
+ padding: 0 0 0 6px;
+}
+
+#col-right .col-wrap {
+ padding: 0 6px 0 0;
+}
+
+/* utility classes */
+.alignleft {
+ float: right;
+}
+
+.alignright {
+ float: left;
+}
+
+.textleft {
+ text-align: right;
+}
+
+.textright {
+ text-align: left;
+}
+
+.clear {
+ clear: both;
+}
+
+/* modern clearfix */
+.wp-clearfix:after {
+ content: "";
+ display: table;
+ clear: both;
+}
+
+/* Hide visually but not from screen readers */
+.screen-reader-text,
+.screen-reader-text span,
+.ui-helper-hidden-accessible {
+ border: 0;
+ clip: rect(1px, 1px, 1px, 1px);
+ -webkit-clip-path: inset(50%);
+ clip-path: inset(50%);
+ height: 1px;
+ margin: -1px;
+ overflow: hidden;
+ padding: 0;
+ position: absolute;
+ width: 1px;
+ word-wrap: normal !important; /* many screen reader and browser combinations announce broken words as they would appear visually */
+}
+
+.button .screen-reader-text {
+ height: auto; /* Fixes a Safari+VoiceOver bug, see ticket #42006 */
+}
+
+.screen-reader-shortcut {
+ position: absolute;
+ top: -1000em;
+}
+
+.screen-reader-shortcut:focus {
+ right: 6px;
+ top: -25px;
+ height: auto;
+ width: auto;
+ display: block;
+ font-size: 14px;
+ font-weight: 600;
+ padding: 15px 23px 14px;
+ background: #f1f1f1;
+ color: #0073aa;
+ z-index: 100000;
+ line-height: normal;
+ box-shadow: 0 0 2px 2px rgba(0, 0, 0, 0.6);
+ text-decoration: none;
+ /* Only visible in Windows High Contrast mode */
+ outline: 2px solid transparent;
+ outline-offset: -2px;
+}
+
+.hidden,
+.js .closed .inside,
+.js .hide-if-js,
+.no-js .hide-if-no-js,
+.js.wp-core-ui .hide-if-js,
+.js .wp-core-ui .hide-if-js,
+.no-js.wp-core-ui .hide-if-no-js,
+.no-js .wp-core-ui .hide-if-no-js {
+ display: none;
+}
+
+/* @todo: Take a second look. Large chunks of shared color, from the colors.css merge */
+.widget-top,
+.menu-item-handle,
+.widget-inside,
+#menu-settings-column .accordion-container,
+#menu-management .menu-edit,
+.manage-menus,
+table.widefat,
+.stuffbox,
+p.popular-tags,
+.widgets-holder-wrap,
+.wp-editor-container,
+.popular-tags,
+.feature-filter,
+.imgedit-group,
+.comment-ays {
+ border: 1px solid #e5e5e5;
+ box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
+}
+
+table.widefat,
+.wp-editor-container,
+.stuffbox,
+p.popular-tags,
+.widgets-holder-wrap,
+.popular-tags,
+.feature-filter,
+.imgedit-group,
+.comment-ays {
+ background: #fff;
+}
+
+/* general */
+html,
+body {
+ height: 100%;
+ margin: 0;
+ padding: 0;
+}
+
+body {
+ background: #f1f1f1;
+ color: #444;
+ font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
+ font-size: 13px;
+ line-height: 1.4em;
+ min-width: 600px;
+}
+
+body.iframe {
+ min-width: 0;
+ padding-top: 1px;
+}
+
+body.modal-open {
+ overflow: hidden;
+}
+
+body.mobile.modal-open #wpwrap {
+ overflow: hidden;
+ position: fixed;
+ height: 100%;
+}
+
+iframe,
+img {
+ border: 0;
+}
+
+td {
+ font-family: inherit;
+ font-size: inherit;
+ font-weight: inherit;
+ line-height: inherit;
+}
+
+/* Any change to the default link style must be applied to button-link too. */
+a {
+ color: #0073aa;
+ transition-property: border, background, color;
+ transition-duration: .05s;
+ transition-timing-function: ease-in-out;
+}
+
+a,
+div {
+ outline: 0;
+}
+
+a:hover,
+a:active {
+ color: #00a0d2;
+}
+
+a:focus,
+a:focus .media-icon img,
+.wp-person a:focus .gravatar {
+ color: #124964;
+ box-shadow:
+ 0 0 0 1px #5b9dd9,
+ 0 0 2px 1px rgba(30, 140, 190, 0.8);
+ /* Only visible in Windows High Contrast mode */
+ outline: 1px solid transparent;
+}
+
+.ie8 a:focus {
+ outline: #5b9dd9 solid 1px;
+}
+
+#adminmenu a:focus {
+ box-shadow: none;
+ /* Only visible in Windows High Contrast mode */
+ outline: 1px solid transparent;
+ outline-offset: -1px;
+}
+
+.screen-reader-text:focus {
+ box-shadow: none;
+ outline: none;
+}
+
+blockquote,
+q {
+ quotes: none;
+}
+
+blockquote:before,
+blockquote:after,
+q:before,
+q:after {
+ content: "";
+ content: none;
+}
+
+p {
+ font-size: 13px;
+ line-height: 1.5;
+ margin: 1em 0;
+}
+
+blockquote {
+ margin: 1em;
+}
+
+li,
+dd {
+ margin-bottom: 6px;
+}
+
+h1,
+h2,
+h3,
+h4,
+h5,
+h6 {
+ display: block;
+ font-weight: 600;
+}
+
+h1 {
+ color: #23282d;
+ font-size: 2em;
+ margin: .67em 0;
+}
+
+h2,
+h3 {
+ color: #23282d;
+ font-size: 1.3em;
+ margin: 1em 0;
+}
+
+.update-core-php h2 {
+ margin-top: 2em;
+}
+
+.update-php h2,
+.update-messages h2,
+h4 {
+ font-size: 1em;
+ margin: 1.33em 0;
+}
+
+h5 {
+ font-size: 0.83em;
+ margin: 1.67em 0;
+}
+
+h6 {
+ font-size: 0.67em;
+ margin: 2.33em 0;
+}
+
+ul,
+ol {
+ padding: 0;
+}
+
+ul {
+ list-style: none;
+}
+
+ol {
+ list-style-type: decimal;
+ margin-right: 2em;
+}
+
+ul.ul-disc {
+ list-style: disc outside;
+}
+
+ul.ul-square {
+ list-style: square outside;
+}
+
+ol.ol-decimal {
+ list-style: decimal outside;
+}
+
+ul.ul-disc,
+ul.ul-square,
+ol.ol-decimal {
+ margin-right: 1.8em;
+}
+
+ul.ul-disc > li,
+ul.ul-square > li,
+ol.ol-decimal > li {
+ margin: 0 0 0.5em;
+}
+
+/* rtl:ignore */
+.ltr {
+ direction: ltr;
+}
+
+/* rtl:ignore */
+.code,
+code {
+ font-family: Consolas, Monaco, monospace;
+ direction: ltr;
+ unicode-bidi: embed;
+}
+
+kbd,
+code {
+ padding: 3px 5px 2px 5px;
+ margin: 0 1px;
+ background: #eaeaea;
+ background: rgba(0, 0, 0, 0.07);
+ font-size: 13px;
+}
+
+.subsubsub {
+ list-style: none;
+ margin: 8px 0 0;
+ padding: 0;
+ font-size: 13px;
+ float: right;
+ color: #666;
+}
+
+.subsubsub a {
+ line-height: 2;
+ padding: .2em;
+ text-decoration: none;
+}
+
+.subsubsub a .count,
+.subsubsub a.current .count {
+ color: #555d66; /* #f1f1f1 background */
+ font-weight: 400;
+}
+
+.subsubsub a.current {
+ font-weight: 600;
+ border: none;
+}
+
+.subsubsub li {
+ display: inline-block;
+ margin: 0;
+ padding: 0;
+ white-space: nowrap;
+}
+
+/* .widefat - main style for tables */
+.widefat {
+ border-spacing: 0;
+ width: 100%;
+ clear: both;
+ margin: 0;
+}
+
+.widefat * {
+ word-wrap: break-word;
+}
+
+.widefat a,
+.widefat button.button-link {
+ text-decoration: none;
+}
+
+.widefat td,
+.widefat th {
+ padding: 8px 10px;
+}
+
+.widefat thead th,
+.widefat thead td {
+ border-bottom: 1px solid #e1e1e1;
+}
+
+.widefat tfoot th,
+.widefat tfoot td {
+ border-top: 1px solid #e1e1e1;
+ border-bottom: none;
+}
+
+.widefat .no-items td {
+ border-bottom-width: 0;
+}
+
+.widefat td {
+ vertical-align: top;
+}
+
+.widefat td,
+.widefat td p,
+.widefat td ol,
+.widefat td ul {
+ font-size: 13px;
+ line-height: 1.5em;
+}
+
+.widefat th,
+.widefat thead td,
+.widefat tfoot td {
+ text-align: right;
+ line-height: 1.3em;
+ font-size: 14px;
+}
+
+.widefat th input,
+.updates-table td input,
+.widefat thead td input,
+.widefat tfoot td input {
+ margin: 0 8px 0 0;
+ padding: 0;
+ vertical-align: text-top;
+}
+
+.widefat .check-column {
+ width: 2.2em;
+ padding: 6px 0 25px;
+ vertical-align: top;
+}
+
+.widefat tbody th.check-column {
+ padding: 9px 0 22px;
+}
+
+.widefat thead td.check-column,
+.widefat tbody th.check-column,
+.updates-table tbody td.check-column,
+.widefat tfoot td.check-column {
+ padding: 11px 3px 0 0;
+}
+
+.widefat thead td.check-column,
+.widefat tfoot td.check-column {
+ padding-top: 4px;
+ vertical-align: middle;
+}
+
+.update-php div.updated,
+.update-php div.error {
+ margin-right: 0;
+}
+
+.no-js .widefat thead .check-column input,
+.no-js .widefat tfoot .check-column input {
+ display: none;
+}
+
+.widefat .num,
+.column-comments,
+.column-links,
+.column-posts {
+ text-align: center;
+}
+
+.widefat th#comments {
+ vertical-align: middle;
+}
+
+.wrap {
+ margin: 10px 2px 0 20px;
+}
+
+.wrap.block-editor-no-js {
+ padding-right: 20px;
+}
+
+.wrap > h2:first-child, /* Back-compat for pre-4.4 */
+.wrap [class$="icon32"] + h2, /* Back-compat for pre-4.4 */
+.postbox .inside h2, /* Back-compat for pre-4.4 */
+.wrap h1 {
+ font-size: 23px;
+ font-weight: 400;
+ margin: 0;
+ padding: 9px 0 4px 0;
+ line-height: 1.3;
+}
+
+.wrap h1.wp-heading-inline {
+ display: inline-block;
+ margin-left: 5px;
+}
+
+.wp-header-end {
+ visibility: hidden;
+ margin: -2px 0 0;
+}
+
+.subtitle {
+ margin: 0;
+ padding-right: 25px;
+ color: #555d66;
+ font-size: 14px;
+ font-weight: 400;
+ line-height: 1;
+}
+
+.wrap .add-new-h2, /* deprecated */
+.wrap .add-new-h2:active, /* deprecated */
+.wrap .page-title-action,
+.wrap .page-title-action:active {
+ margin-right: 4px;
+ padding: 4px 8px;
+ position: relative;
+ top: -3px;
+ text-decoration: none;
+ border: none;
+ border: 1px solid #ccc;
+ border-radius: 2px;
+ background: #f7f7f7;
+ text-shadow: none;
+ font-weight: 600;
+ font-size: 13px;
+ line-height: normal; /* IE8-IE11 need this for buttons */
+ color: #0073aa; /* some of these controls are button elements and don't inherit from links */
+ cursor: pointer;
+}
+
+.wrap .wp-heading-inline + .page-title-action {
+ margin-right: 0;
+}
+
+.wrap .add-new-h2:hover, /* deprecated */
+.wrap .page-title-action:hover {
+ border-color: #008EC2;
+ background: #00a0d2;
+ color: #fff;
+}
+
+/* lower specificity: color needs to be overridden by :hover and :active */
+.page-title-action:focus {
+ color: #124964;
+}
+
+.wrap .page-title-action:focus {
+ border-color: #5b9dd9;
+ box-shadow: 0 0 2px rgba(30, 140, 190, 0.8);
+ /* Only visible in Windows High Contrast mode */
+ outline: 2px solid transparent;
+}
+
+.wrap h1.long-header {
+ padding-left: 0;
+}
+
+.wp-dialog {
+ background-color: #fff;
+}
+
+.widgets-chooser ul,
+#widgets-left .widget-in-question .widget-top,
+#available-widgets .widget-top:hover,
+div#widgets-right .widget-top:hover,
+#widgets-left .widget-top:hover {
+ border-color: #999;
+ box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
+}
+
+.sorthelper {
+ background-color: #ccf3fa;
+}
+
+.ac_match,
+.subsubsub a.current {
+ color: #000;
+}
+
+.striped > tbody > :nth-child(odd),
+ul.striped > :nth-child(odd),
+.alternate {
+ background-color: #f9f9f9;
+}
+
+.bar {
+ background-color: #e8e8e8;
+ border-left-color: #99d;
+}
+
+/* Helper classes for plugins to leverage the active WordPress color scheme */
+
+.highlight {
+ background-color: #e4f2fd;
+ color: #000;
+}
+
+.wp-ui-primary {
+ color: #fff;
+ background-color: #32373c;
+}
+.wp-ui-text-primary {
+ color: #32373c;
+}
+
+.wp-ui-highlight {
+ color: #fff;
+ background-color: #1e8cbe;
+}
+.wp-ui-text-highlight {
+ color: #1e8cbe;
+}
+
+.wp-ui-notification {
+ color: #fff;
+ background-color: #d54e21;
+}
+.wp-ui-text-notification {
+ color: #d54e21;
+}
+
+.wp-ui-text-icon {
+ color: #82878c; /* same as new icons */
+}
+
+/* For emoji replacement images */
+img.emoji {
+ display: inline !important;
+ border: none !important;
+ height: 1em !important;
+ width: 1em !important;
+ margin: 0 .07em !important;
+ vertical-align: -0.1em !important;
+ background: none !important;
+ padding: 0 !important;
+ box-shadow: none !important;
+}
+
+/*------------------------------------------------------------------------------
+ 1.0 - Text Styles
+------------------------------------------------------------------------------*/
+
+.widget .widget-top,
+.postbox .hndle,
+.stuffbox .hndle,
+.control-section .accordion-section-title,
+.sidebar-name,
+#nav-menu-header,
+#nav-menu-footer,
+.menu-item-handle,
+.checkbox,
+.side-info,
+#your-profile #rich_editing,
+.widefat thead th,
+.widefat thead td,
+.widefat tfoot th,
+.widefat tfoot td {
+ line-height: 1.4em;
+}
+
+.widget .widget-top,
+.menu-item-handle {
+ background: #fafafa;
+ color: #23282d;
+}
+
+.postbox .hndle,
+.stuffbox .hndle {
+ border-bottom: 1px solid #eee;
+}
+
+.quicktags,
+.search {
+ background-color: #ccc;
+ color: #000;
+ font-size: 12px;
+}
+
+.icon32 {
+ display: none;
+}
+
+/* @todo can we combine these into a class or use an existing dashicon one? */
+.welcome-panel .welcome-panel-close:before,
+.tagchecklist .ntdelbutton .remove-tag-icon:before,
+#bulk-titles div a:before,
+.notice-dismiss:before {
+ background: none;
+ color: #72777c;
+ content: "\f153";
+ display: block;
+ font: normal 16px/20px dashicons;
+ speak: none;
+ height: 20px;
+ text-align: center;
+ width: 20px;
+ -webkit-font-smoothing: antialiased;
+ -moz-osx-font-smoothing: grayscale;
+}
+
+.welcome-panel .welcome-panel-close:before {
+ margin: 0;
+}
+
+#bulk-titles div a:before {
+ margin: 1px 0;
+}
+
+.tagchecklist .ntdelbutton .remove-tag-icon:before {
+ margin-right: 2px;
+ border-radius: 50%;
+ color: #0073aa;
+ /* vertically center the icon cross browsers */
+ line-height: 1.28;
+}
+
+.tagchecklist .ntdelbutton:focus {
+ outline: 0;
+}
+
+.welcome-panel .welcome-panel-close:hover:before,
+.welcome-panel .welcome-panel-close:focus:before,
+.tagchecklist .ntdelbutton:hover .remove-tag-icon:before,
+.tagchecklist .ntdelbutton:focus .remove-tag-icon:before,
+#bulk-titles div a:hover:before,
+#bulk-titles div a:focus:before {
+ color: #c00;
+}
+
+.tagchecklist .ntdelbutton:focus .remove-tag-icon:before {
+ box-shadow:
+ 0 0 0 1px #5b9dd9,
+ 0 0 2px 1px rgba(30, 140, 190, 0.8);
+}
+
+.key-labels label {
+ line-height: 24px;
+}
+
+strong, b {
+ font-weight: 600;
+}
+
+.pre {
+ /* https://developer.mozilla.org/en-US/docs/CSS/white-space */
+ white-space: pre-wrap; /* css-3 */
+ word-wrap: break-word; /* IE 5.5 - 7 */
+}
+
+.howto {
+ color: #666;
+ font-style: italic;
+ display: block;
+}
+
+p.install-help {
+ margin: 8px 0;
+ font-style: italic;
+}
+
+.no-break {
+ white-space: nowrap;
+}
+
+hr {
+ border: 0;
+ border-top: 1px solid #ddd;
+ border-bottom: 1px solid #fafafa;
+}
+
+.row-actions span.delete a,
+.row-actions span.trash a,
+.row-actions span.spam a,
+.plugins a.delete,
+#all-plugins-table .plugins a.delete,
+#search-plugins-table .plugins a.delete,
+.submitbox .submitdelete,
+#media-items a.delete,
+#media-items a.delete-permanently,
+#nav-menu-footer .menu-delete,
+#delete-link a.delete {
+ color: #a00;
+}
+
+abbr.required,
+span.required,
+.file-error,
+.row-actions .delete a:hover,
+.row-actions .trash a:hover,
+.row-actions .spam a:hover,
+.plugins a.delete:hover,
+#all-plugins-table .plugins a.delete:hover,
+#search-plugins-table .plugins a.delete:hover,
+.submitbox .submitdelete:hover,
+#media-items a.delete:hover,
+#media-items a.delete-permanently:hover,
+#nav-menu-footer .menu-delete:hover,
+#delete-link a.delete:hover {
+ color: #dc3232;
+ border: none;
+}
+
+/*------------------------------------------------------------------------------
+ 3.0 - Actions
+------------------------------------------------------------------------------*/
+
+#major-publishing-actions {
+ padding: 10px;
+ clear: both;
+ border-top: 1px solid #ddd;
+ background: #f5f5f5;
+}
+
+#delete-action {
+ float: right;
+ line-height: 2.1;
+}
+
+#delete-link {
+ line-height: 2.1;
+ vertical-align: middle;
+ text-align: right;
+ margin-right: 8px;
+}
+
+#delete-link a {
+ text-decoration: none;
+}
+
+#publishing-action {
+ text-align: left;
+ float: left;
+ line-height: 1.9;
+}
+
+#publishing-action .spinner {
+ float: right;
+}
+
+#misc-publishing-actions {
+ padding: 6px 0 0;
+}
+
+.misc-pub-section {
+ padding: 6px 10px 8px;
+}
+
+.misc-pub-filename {
+ word-wrap: break-word;
+}
+
+#minor-publishing-actions {
+ padding: 10px 10px 0 10px;
+ text-align: left;
+}
+
+#save-post {
+ float: right;
+}
+
+.preview {
+ float: left;
+}
+
+#sticky-span {
+ margin-right: 18px;
+}
+
+.approve,
+.unapproved .unapprove {
+ display: none;
+}
+
+.unapproved .approve,
+.spam .approve,
+.trash .approve {
+ display: inline;
+}
+
+td.action-links,
+th.action-links {
+ text-align: left;
+}
+
+#misc-publishing-actions .notice {
+ margin-right: 10px;
+ margin-left: 10px;
+}
+
+/* Filter bar */
+.wp-filter {
+ display: inline-block;
+ position: relative;
+ box-sizing: border-box;
+ margin: 12px 0 25px;
+ padding: 0 10px;
+ width: 100%;
+ box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
+ border: 1px solid #e5e5e5;
+ background: #fff;
+ color: #555;
+ font-size: 13px;
+}
+
+.wp-filter a {
+ text-decoration: none;
+}
+
+.filter-count {
+ display: inline-block;
+ vertical-align: middle;
+ min-width: 4em;
+}
+
+.title-count,
+.filter-count .count {
+ display: inline-block;
+ position: relative;
+ top: -1px;
+ padding: 4px 10px;
+ border-radius: 30px;
+ background: #72777c;
+ color: #fff;
+ font-size: 14px;
+ font-weight: 600;
+}
+
+/* not a part of filter bar, but derived from it, so here for now */
+.title-count {
+ display: inline;
+ top: -3px;
+ margin-right: 5px;
+ margin-left: 20px;
+}
+
+.filter-items {
+ float: right;
+}
+
+.filter-links {
+ display: inline-block;
+ margin: 0;
+}
+
+.filter-links li {
+ display: inline-block;
+ margin: 0;
+}
+
+.filter-links li > a {
+ display: inline-block;
+ margin: 0 10px;
+ padding: 15px 0;
+ border-bottom: 4px solid #fff;
+ color: #666;
+ cursor: pointer;
+}
+
+.filter-links .current {
+ box-shadow: none;
+ border-bottom: 4px solid #666;
+ color: #23282d;
+}
+
+.filter-links li > a:hover,
+.filter-links li > a:focus,
+.show-filters .filter-links a.current:hover,
+.show-filters .filter-links a.current:focus {
+ color: #00a0d2;
+}
+
+.wp-filter .search-form {
+ float: left;
+ margin: 10px 0;
+}
+
+.wp-filter .search-form input[type="search"] {
+ margin: 0;
+ padding: 3px 5px;
+ width: 280px;
+ max-width: 100%;
+ font-size: 16px;
+ font-weight: 300;
+ line-height: 1.5;
+}
+
+.wp-filter .search-form select {
+ margin: 0;
+ height: 32px;
+ vertical-align: top;
+}
+
+.wp-filter .search-form.search-plugins {
+ display: inline-block;
+}
+
+.wp-filter .button.drawer-toggle {
+ margin: 10px 9px 0;
+ padding: 0 6px 0 10px;
+ border-color: transparent;
+ background-color: transparent;
+ color: #666;
+ vertical-align: baseline;
+ box-shadow: none;
+}
+
+.wp-filter .drawer-toggle:before {
+ content: "\f111";
+ margin: 0 0 0 5px;
+ color: #72777c;
+ font: normal 16px/1 dashicons;
+ vertical-align: text-bottom;
+ -webkit-font-smoothing: antialiased;
+ -moz-osx-font-smoothing: grayscale;
+}
+
+.wp-filter .button.drawer-toggle:hover,
+.wp-filter .drawer-toggle:hover:before,
+.wp-filter .button.drawer-toggle:focus,
+.wp-filter .drawer-toggle:focus:before {
+ background-color: transparent;
+ color: #00a0d2;
+}
+
+.wp-filter .button.drawer-toggle:hover,
+.wp-filter .button.drawer-toggle:focus:active {
+ border-color: transparent;
+}
+
+.wp-filter .button.drawer-toggle:focus {
+ border-color: #5b9dd9;
+}
+
+.wp-filter .button.drawer-toggle:active {
+ background: transparent;
+ box-shadow: none;
+ transform: none;
+}
+
+.wp-filter .drawer-toggle.current:before {
+ color: #fff;
+}
+
+.filter-drawer,
+.wp-filter .favorites-form {
+ display: none;
+ margin: 0 -20px 0 -10px;
+ padding: 20px;
+ border-top: 1px solid #eee;
+ background: #fafafa;
+ overflow: hidden;
+}
+
+.show-filters .filter-drawer,
+.show-favorites-form .favorites-form {
+ display: block;
+}
+
+.show-filters .filter-links a.current {
+ border-bottom: none;
+}
+
+.show-filters .wp-filter .button.drawer-toggle {
+ border-radius: 2px;
+ background: #72777c;
+ color: #fff;
+}
+
+.show-filters .wp-filter .drawer-toggle:hover,
+.show-filters .wp-filter .drawer-toggle:focus {
+ background: rgb(46, 162, 204);
+}
+
+.show-filters .wp-filter .drawer-toggle:before {
+ color: #fff;
+}
+
+.filter-group {
+ box-sizing: border-box;
+ position: relative;
+ float: right;
+ margin: 0 0 0 1%;
+ padding: 20px 10px 10px;
+ width: 24%;
+ background: #fff;
+ border: 1px solid #e5e5e5;
+ box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
+}
+
+.filter-group legend {
+ position: absolute;
+ top: 10px;
+ display: block;
+ margin: 0;
+ padding: 0;
+ font-size: 1em;
+ font-weight: 600;
+}
+
+.filter-drawer .filter-group-feature {
+ margin: 28px 0 0;
+ list-style-type: none;
+ font-size: 12px;
+}
+
+.filter-drawer .filter-group-feature input,
+.filter-drawer .filter-group-feature label {
+ line-height: 1.4;
+}
+
+.filter-drawer .filter-group-feature input {
+ position: absolute;
+ margin: 0;
+}
+
+.filter-group .filter-group-feature label {
+ display: block;
+ margin: 14px 23px 14px 0px;
+}
+
+.filter-drawer .buttons {
+ clear: both;
+ margin-bottom: 20px;
+}
+
+.filter-drawer .filter-group + .buttons {
+ margin-bottom: 0;
+ padding-top: 20px;
+}
+
+.filter-drawer .buttons .button span {
+ display: inline-block;
+ opacity: 0.8;
+ font-size: 12px;
+ text-indent: 10px;
+}
+
+.wp-filter .button.clear-filters {
+ display: none;
+ margin-right: 10px;
+}
+
+.wp-filter .button-link.edit-filters {
+ padding: 0 5px;
+ line-height: 2.2;
+}
+
+.filtered-by {
+ display: none;
+ margin: 0;
+}
+
+.filtered-by > span {
+ font-weight: 600;
+}
+
+.filtered-by a {
+ margin-right: 10px;
+}
+
+.filtered-by .tags {
+ display: inline;
+}
+
+.filtered-by .tag {
+ margin: 0 5px;
+ padding: 4px 8px;
+ border: 1px solid #e5e5e5;
+ box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
+ background: #fff;
+ font-size: 11px;
+}
+
+.filters-applied .filter-group,
+.filters-applied .filter-drawer .buttons,
+.filters-applied .filter-drawer br {
+ display: none !important;
+}
+
+.filters-applied .filtered-by {
+ display: block;
+}
+
+.filters-applied .filter-drawer {
+ padding: 20px;
+}
+
+.show-filters .favorites-form,
+.show-filters .content-filterable,
+.show-filters.filters-applied.loading-content .content-filterable,
+.loading-content .content-filterable,
+.error .content-filterable {
+ display: none;
+}
+
+.show-filters.filters-applied .content-filterable {
+ display: block;
+}
+
+.loading-content .spinner {
+ display: block;
+ margin: 40px auto 0;
+ float: none;
+}
+
+@media only screen and (max-width: 1120px) {
+ .filter-drawer {
+ border-bottom: 1px solid #eee;
+ }
+
+ .filter-group {
+ margin-bottom: 0;
+ margin-top: 5px;
+ width: 100%;
+ }
+
+ .filter-group li {
+ margin: 10px 0;
+ }
+}
+
+@media only screen and (max-width: 1000px) {
+ .filter-items {
+ float: none;
+ }
+
+ .wp-filter .media-toolbar-primary,
+ .wp-filter .media-toolbar-secondary,
+ .wp-filter .search-form {
+ float: none; /* Remove float from media-views.css */
+ position: relative;
+ max-width: 100%;
+ }
+}
+
+@media only screen and (max-width: 782px) {
+ .filter-group li {
+ padding: 0;
+ width: 50%;
+ }
+}
+
+@media only screen and (max-width: 320px) {
+ .filter-count {
+ display: none;
+ }
+
+ .wp-filter .drawer-toggle {
+ margin: 10px 0;
+ }
+
+ .filter-group li,
+ .wp-filter .search-form input[type="search"] {
+ width: 100%;
+ }
+}
+
+/*------------------------------------------------------------------------------
+ 4.0 - Notifications
+------------------------------------------------------------------------------*/
+
+.notice,
+div.updated,
+div.error {
+ background: #fff;
+ border-right: 4px solid #fff;
+ box-shadow: 0 1px 1px 0 rgba(0, 0, 0, 0.1);
+ margin: 5px 15px 2px;
+ padding: 1px 12px;
+}
+
+div[class="update-message"] { /* back-compat for pre-4.6 */
+ padding: 0.5em 0 0.5em 12px;
+}
+
+.notice p,
+.notice-title,
+div.updated p,
+div.error p,
+.form-table td .notice p {
+ margin: 0.5em 0;
+ padding: 2px;
+}
+
+.error a {
+ text-decoration: underline;
+}
+
+.updated a {
+ padding-bottom: 2px;
+}
+
+.notice-alt {
+ box-shadow: none;
+}
+
+.notice-large {
+ padding: 10px 20px;
+}
+
+.notice-title {
+ display: inline-block;
+ color: #23282d;
+ font-size: 18px;
+}
+
+.wp-core-ui .notice.is-dismissible {
+ padding-left: 38px;
+ position: relative;
+}
+
+.notice-dismiss {
+ position: absolute;
+ top: 0;
+ left: 1px;
+ border: none;
+ margin: 0;
+ padding: 9px;
+ background: none;
+ color: #72777c;
+ cursor: pointer;
+}
+
+.notice-dismiss:hover:before,
+.notice-dismiss:active:before,
+.notice-dismiss:focus:before {
+ color: #c00;
+}
+
+.notice-dismiss:focus {
+ outline: none;
+ box-shadow: 0 0 0 1px #5b9dd9, 0 0 2px 1px rgba(30, 140, 190, 0.8);
+}
+
+.ie8 .notice-dismiss:focus {
+ outline: 1px solid #5b9dd9;
+}
+
+.notice-success,
+div.updated {
+ border-right-color: #46b450;
+}
+
+.notice-success.notice-alt {
+ background-color: #ecf7ed;
+}
+
+.notice-warning {
+ border-right-color: #ffb900;
+}
+
+.notice-warning.notice-alt {
+ background-color: #fff8e5;
+}
+
+.notice-error,
+div.error {
+ border-right-color: #dc3232;
+}
+
+.notice-error.notice-alt {
+ background-color: #fbeaea;
+}
+
+.notice-info {
+ border-right-color: #00a0d2;
+}
+
+.notice-info.notice-alt {
+ background-color: #e5f5fa;
+}
+
+.update-message p:before,
+.updating-message p:before,
+.updated-message p:before,
+.import-php .updating-message:before,
+.button.updating-message:before,
+.button.updated-message:before,
+.button.installed:before,
+.button.installing:before {
+ display: inline-block;
+ font: normal 20px/1 'dashicons';
+ -webkit-font-smoothing: antialiased;
+ -moz-osx-font-smoothing: grayscale;
+ vertical-align: top;
+}
+
+.wrap .notice,
+.wrap div.updated,
+.wrap div.error,
+.media-upload-form .notice,
+.media-upload-form div.error {
+ margin: 5px 0 15px;
+}
+
+.wrap #templateside .notice {
+ display: block;
+ margin: 0;
+ padding: 5px 8px;
+ font-weight: 600;
+ text-decoration: none;
+}
+
+.wrap #templateside span.notice {
+ margin-right: -12px;
+}
+
+#templateside li.notice a {
+ padding: 0;
+}
+
+/* Update icon. */
+.update-message p:before,
+.updating-message p:before,
+.import-php .updating-message:before,
+.button.updating-message:before,
+.button.installing:before {
+ color: #f56e28;
+ content: "\f463";
+}
+
+/* Spins the update icon. */
+.updating-message p:before,
+.import-php .updating-message:before,
+.button.updating-message:before,
+.button.installing:before {
+ animation: rotation 2s infinite linear;
+}
+
+/* Updated icon (check mark). */
+.updated-message p:before,
+.installed p:before,
+.button.updated-message:before {
+ color: #79ba49;
+ content: "\f147";
+}
+
+/* Error icon. */
+.update-message.notice-error p:before {
+ color: #dc3232;
+ content: "\f534";
+}
+
+.wrap .notice p:before,
+.import-php .updating-message:before {
+ margin-left: 6px;
+ vertical-align: bottom;
+}
+
+#update-nag,
+.update-nag {
+ display: inline-block;
+ line-height: 1.4;
+ padding: 11px 15px;
+ font-size: 14px;
+ text-align: right;
+ margin: 25px 2px 0 20px;
+ background-color: #fff;
+ border-right: 4px solid #ffba00;
+ box-shadow: 0 1px 1px 0 rgba(0, 0, 0, 0.1);
+}
+
+ul#dismissed-updates {
+ display: none;
+}
+
+#dismissed-updates li > p {
+ margin-top: 0;
+}
+
+#dismiss,
+#undismiss {
+ margin-right: 0.5em;
+}
+
+form.upgrade {
+ margin-top: 8px;
+}
+
+form.upgrade .hint {
+ font-style: italic;
+ font-size: 85%;
+ margin: -0.5em 0 2em 0;
+}
+
+.update-php .spinner {
+ float: none;
+ margin: -4px 0;
+}
+
+#ajax-loading,
+.ajax-loading,
+.ajax-feedback,
+.imgedit-wait-spin,
+.list-ajax-loading { /* deprecated */
+ visibility: hidden;
+}
+
+#ajax-response.alignleft {
+ margin-right: 2em;
+}
+
+.button.updating-message:before,
+.button.updated-message:before,
+.button.installed:before,
+.button.installing:before {
+ margin: 3px -2px 0 5px;
+}
+
+.button-primary.updating-message:before {
+ color: #fff;
+}
+
+.button-primary.updated-message:before {
+ color: #66c6e4;
+}
+
+.button.updated-message {
+ transition-property: border, background, color;
+ transition-duration: .05s;
+ transition-timing-function: ease-in-out;
+}
+
+@media aural {
+ .wrap .notice p:before,
+ .button.installing:before,
+ .button.installed:before,
+ .update-message p:before {
+ speak: none;
+ }
+}
+
+
+/* @todo: this does not need its own section anymore */
+/*------------------------------------------------------------------------------
+ 6.0 - Admin Header
+------------------------------------------------------------------------------*/
+#adminmenu a,
+#taglist a,
+#catlist a {
+ text-decoration: none;
+}
+
+/*------------------------------------------------------------------------------
+ 6.1 - Screen Options Tabs
+------------------------------------------------------------------------------*/
+
+#screen-options-wrap,
+#contextual-help-wrap {
+ margin: 0;
+ padding: 8px 20px 12px;
+ position: relative;
+}
+
+#contextual-help-wrap {
+ overflow: auto;
+ margin-right: 0 !important;
+}
+
+#screen-meta-links {
+ float: left;
+ margin: 0 0 0 20px;
+}
+
+/* screen options and help tabs revert */
+#screen-meta {
+ display: none;
+ margin: 0 0px -1px 20px;
+ position: relative;
+ background-color: #fff;
+ border: 1px solid #ddd;
+ border-top: none;
+ box-shadow: 0 1px 0 rgba(0, 0, 0, 0.025);
+}
+
+#screen-options-link-wrap,
+#contextual-help-link-wrap {
+ float: right;
+ margin: 0 6px 0 0;
+}
+
+#screen-meta-links .screen-meta-toggle {
+ position: relative;
+ top: 0;
+}
+
+#screen-meta-links .show-settings {
+ border: 1px solid #ddd;
+ border-top: none;
+ border-bottom-color: #ccc;
+ height: auto;
+ margin-bottom: 0;
+ padding: 3px 16px 3px 6px;
+ background: #fff;
+ border-radius: 0;
+ color: #72777c;
+ line-height: 1.7;
+ box-shadow: none;
+}
+
+#screen-meta-links .show-settings:hover,
+#screen-meta-links .show-settings:active,
+#screen-meta-links .show-settings:focus {
+ color: #32373c;
+}
+
+#screen-meta-links .show-settings:focus {
+ border-color: #5b9dd9;
+ box-shadow: 0 0 3px rgba(0, 115, 170, 0.8);
+}
+
+#screen-meta-links .show-settings:active {
+ transform: none;
+}
+
+#screen-meta-links .show-settings:after {
+ left: 0;
+ content: "\f140";
+ font: normal 20px/1 dashicons;
+ speak: none;
+ display: inline-block;
+ padding: 0 0 0 5px;
+ bottom: 2px;
+ position: relative;
+ vertical-align: bottom;
+ -webkit-font-smoothing: antialiased;
+ -moz-osx-font-smoothing: grayscale;
+ text-decoration: none !important;
+ color: #72777c;
+}
+
+#screen-meta-links .screen-meta-active:after {
+ content: "\f142";
+}
+
+/* end screen options and help tabs */
+
+.toggle-arrow {
+ background-repeat: no-repeat;
+ background-position: top right;
+ background-color: transparent;
+ height: 22px;
+ line-height: 22px;
+ display: block;
+}
+
+.toggle-arrow-active {
+ background-position: bottom right;
+}
+
+#screen-options-wrap h5, /* Back-compat for old plugins */
+#screen-options-wrap legend,
+#contextual-help-wrap h5 {
+ margin: 0;
+ padding: 8px 0;
+ font-size: 13px;
+ font-weight: 600;
+}
+
+.ie8 #screen-options-wrap legend {
+ color: inherit;
+}
+
+.metabox-prefs label {
+ display: inline-block;
+ padding-left: 15px;
+ line-height: 2.35;
+}
+
+#number-of-columns {
+ display: inline-block;
+ vertical-align: middle;
+ line-height: 30px;
+}
+
+.metabox-prefs input[type=checkbox] {
+ margin-top: 0;
+ margin-left: 6px;
+}
+
+.metabox-prefs label input,
+.metabox-prefs label input[type=checkbox] {
+ margin: -4px 0 0 5px;
+}
+
+.metabox-prefs .columns-prefs label input {
+ margin: -1px 0 0 2px;
+}
+
+.metabox-prefs label a {
+ display: none;
+}
+
+.metabox-prefs .screen-options input,
+.metabox-prefs .screen-options label {
+ margin-top: 0;
+ margin-bottom: 0;
+ vertical-align: middle;
+}
+
+.metabox-prefs .screen-options .screen-per-page {
+ margin-left: 15px;
+}
+
+.metabox-prefs .screen-options label {
+ line-height: 2.2;
+ padding-left: 0;
+}
+
+.screen-options + .screen-options {
+ margin-top: 10px;
+}
+
+.metabox-prefs .submit {
+ margin-top: 1em;
+ padding: 0;
+}
+
+/*------------------------------------------------------------------------------
+ 6.2 - Help Menu
+------------------------------------------------------------------------------*/
+
+#contextual-help-wrap {
+ padding: 0;
+}
+
+#contextual-help-columns {
+ position: relative;
+}
+
+#contextual-help-back {
+ position: absolute;
+ top: 0;
+ bottom: 0;
+ right: 150px;
+ left: 170px;
+ border: 1px solid #e1e1e1;
+ border-top: none;
+ border-bottom: none;
+ background: #f6fbfd;
+}
+
+#contextual-help-wrap.no-sidebar #contextual-help-back {
+ left: 0;
+ border-left-width: 0;
+ border-bottom-left-radius: 2px;
+}
+
+.contextual-help-tabs {
+ float: right;
+ width: 150px;
+ margin: 0;
+}
+
+.contextual-help-tabs ul {
+ margin: 1em 0;
+}
+
+.contextual-help-tabs li {
+ margin-bottom: 0;
+ list-style-type: none;
+ border-style: solid;
+ border-width: 0 2px 0 0;
+ border-color: transparent;
+}
+
+.contextual-help-tabs a {
+ display: block;
+ padding: 5px 12px 5px 5px;
+ line-height: 1.4;
+ text-decoration: none;
+ border: 1px solid transparent;
+ border-left: none;
+ border-right: none;
+}
+
+.contextual-help-tabs a:hover {
+ color: #32373c;
+}
+
+.contextual-help-tabs .active {
+ padding: 0;
+ margin: 0 0 0 -1px;
+ border-right: 2px solid #00a0d2;
+ background: #f6fbfd;
+ box-shadow: 0 2px 0 rgba(0, 0, 0, 0.02), 0 1px 0 rgba(0, 0, 0, 0.02);
+}
+
+.contextual-help-tabs .active a {
+ border-color: #e1e1e1;
+ color: #32373c;
+}
+
+.contextual-help-tabs-wrap {
+ padding: 0 20px;
+ overflow: auto;
+}
+
+.help-tab-content {
+ display: none;
+ margin: 0 0 12px 22px;
+ line-height: 1.6;
+}
+
+.help-tab-content.active {
+ display: block;
+}
+
+.help-tab-content ul li {
+ list-style-type: disc;
+ margin-right: 18px;
+}
+
+.contextual-help-sidebar {
+ width: 150px;
+ float: left;
+ padding: 0 12px 0 8px;
+ overflow: auto;
+}
+
+/*------------------------------------------------------------------------------
+ 8.0 - Layout Blocks
+------------------------------------------------------------------------------*/
+
+html.wp-toolbar {
+ padding-top: 32px;
+ box-sizing: border-box;
+}
+
+.widefat th,
+.widefat td {
+ color: #555;
+}
+
+.widefat th,
+.widefat thead td,
+.widefat tfoot td {
+ font-weight: 400;
+}
+
+.widefat thead tr th,
+.widefat thead tr td,
+.widefat tfoot tr th,
+.widefat tfoot tr td {
+ color: #32373c;
+}
+
+.widefat td p {
+ margin: 2px 0 0.8em;
+}
+
+.widefat p,
+.widefat ol,
+.widefat ul {
+ color: #32373c;
+}
+
+.widefat .column-comment p {
+ margin: 0.6em 0;
+}
+
+.widefat .column-comment ul {
+ list-style: initial;
+ margin-right: 2em;
+}
+
+/* Screens with postboxes */
+.postbox-container {
+ float: right;
+}
+
+.postbox-container .meta-box-sortables {
+ box-sizing: border-box;
+}
+
+#wpbody-content .metabox-holder {
+ padding-top: 10px;
+}
+
+.metabox-holder .postbox-container .empty-container {
+ border: 3px dashed #b4b9be;
+ height: 250px;
+ position: relative;
+}
+
+.metabox-holder .postbox-container .empty-container:after {
+ content: attr(data-emptystring);
+ margin: auto;
+ position: absolute;
+ top: 0;
+ right: 0;
+ bottom: 0;
+ left: 0;
+ height: 1em;
+ width: 200px;
+ text-align: center;
+ color: #ccc;
+ font-size: 18px;
+ display: none;
+}
+
+.metabox-holder.columns-1 .postbox-container .empty-container,
+.columns-2 #postbox-container-3 .empty-container,
+.columns-2 #postbox-container-4 .empty-container,
+.columns-3 #postbox-container-4 .empty-container {
+ border: 0 none;
+ height: 0;
+ min-height: 0;
+}
+
+#post-body-content {
+ width: 100%;
+ min-width: 463px;
+ float: right;
+}
+
+#post-body.columns-2 #postbox-container-1 {
+ float: left;
+ margin-left: -300px;
+ width: 280px;
+}
+
+#post-body.columns-2 #side-sortables {
+ min-height: 250px;
+}
+
+/* one column on the dash */
+@media only screen and (max-width: 799px) {
+ #wpbody-content .metabox-holder .postbox-container .empty-container {
+ border: 0 none;
+ height: 0;
+ min-height: 0;
+ }
+}
+
+.js .widget .widget-top,
+.js .postbox .hndle {
+ cursor: move;
+}
+
+.hndle a {
+ font-size: 11px;
+ font-weight: 400;
+}
+
+.postbox .handlediv {
+ display: none;
+ float: left;
+ width: 36px;
+ height: 36px;
+ margin: 0;
+ padding: 0;
+ border: 0;
+ background: none;
+ cursor: pointer;
+}
+
+.js .postbox .handlediv {
+ display: block;
+}
+
+.sortable-placeholder {
+ border: 1px dashed #b4b9be;
+ margin-bottom: 20px;
+}
+
+.postbox,
+.stuffbox {
+ margin-bottom: 20px;
+ padding: 0;
+ line-height: 1;
+}
+
+/* user-select is not a part of the CSS standard - may change behavior in the future */
+.postbox .hndle,
+.stuffbox .hndle {
+ -webkit-user-select: none;
+ -moz-user-select: none;
+ -ms-user-select: none;
+ user-select: none;
+}
+
+.postbox .inside {
+ padding: 0 12px 12px;
+ line-height: 1.4;
+ font-size: 13px;
+}
+
+.stuffbox .inside {
+ padding: 0;
+ line-height: 1.4;
+ font-size: 13px;
+ margin-top: 0;
+}
+
+.postbox .inside {
+ margin: 11px 0;
+ position: relative;
+}
+
+.postbox .inside > p:last-child,
+.rss-widget ul li:last-child {
+ margin-bottom: 1px !important;
+}
+
+.postbox.closed h3 {
+ border: none;
+ box-shadow: none;
+}
+
+.postbox table.form-table {
+ margin-bottom: 0;
+}
+
+.postbox table.widefat {
+ box-shadow: none;
+}
+
+.temp-border {
+ border: 1px dotted #ccc;
+}
+
+.columns-prefs label {
+ padding: 0 0 0 10px;
+}
+
+/* @todo: what is this doing here */
+#dashboard_right_now .versions .b,
+#post-status-display,
+#post-visibility-display,
+#adminmenu .wp-submenu li.current,
+#adminmenu .wp-submenu li.current a,
+#adminmenu .wp-submenu li.current a:hover,
+.media-item .percent,
+.plugins .name,
+#pass-strength-result.strong,
+#pass-strength-result.short,
+#ed_reply_toolbar #ed_reply_strong,
+.item-controls .item-order a,
+.feature-filter .feature-name {
+ font-weight: 600;
+}
+
+/*------------------------------------------------------------------------------
+ 21.0 - Admin Footer
+------------------------------------------------------------------------------*/
+
+#wpfooter {
+ position: absolute;
+ bottom: 0;
+ right: 0;
+ left: 0;
+ padding: 10px 20px;
+ color: #555d66;
+}
+
+#wpfooter p {
+ font-size: 13px;
+ margin: 0;
+ line-height: 1.55;
+}
+
+#footer-thankyou {
+ font-style: italic;
+}
+
+/*------------------------------------------------------------------------------
+ 25.0 - Tabbed Admin Screen Interface (Experimental)
+------------------------------------------------------------------------------*/
+
+.nav-tab {
+ float: right;
+ border: 1px solid #ccc;
+ border-bottom: none;
+ margin-right: 0.5em; /* half the font size so set the font size properly */
+ padding: 5px 10px;
+ font-size: 14px;
+ line-height: 1.71428571;
+ font-weight: 600;
+ background: #e5e5e5;
+ color: #555;
+ text-decoration: none;
+ white-space: nowrap;
+}
+
+h3 .nav-tab, /* Back-compat for pre-4.4 */
+.nav-tab-small .nav-tab {
+ padding: 5px 14px;
+ font-size: 12px;
+ line-height: 1.33;
+}
+
+.nav-tab:hover,
+.nav-tab:focus {
+ background-color: #fff;
+ color: #444;
+}
+
+.nav-tab-active,
+.nav-tab:focus:active {
+ box-shadow: none;
+}
+
+.nav-tab-active {
+ margin-bottom: -1px;
+ color: #444;
+}
+
+.nav-tab-active,
+.nav-tab-active:hover,
+.nav-tab-active:focus,
+.nav-tab-active:focus:active {
+ border-bottom: 1px solid #f1f1f1;
+ background: #f1f1f1;
+ color: #000;
+}
+
+h1.nav-tab-wrapper, /* Back-compat for pre-4.4 */
+.wrap h2.nav-tab-wrapper, /* higher specificity to override .wrap > h2:first-child */
+.nav-tab-wrapper {
+ border-bottom: 1px solid #ccc;
+ margin: 0;
+ padding-top: 9px;
+ padding-bottom: 0;
+ line-height: inherit;
+}
+
+/* Back-compat for plugins. Deprecated. Use .wp-clearfix instead. */
+.nav-tab-wrapper:not(.wp-clearfix):after {
+ content: "";
+ display: table;
+ clear: both;
+}
+
+.ie8 .nav-tab-wrapper {
+ /* contain floats establishing a new block formatting context */
+ display: inline-block;
+ width: 100%;
+ vertical-align: top;
+}
+
+/*------------------------------------------------------------------------------
+ 26.0 - Misc
+------------------------------------------------------------------------------*/
+
+.spinner {
+ background: url(../images/spinner.gif) no-repeat;
+ background-size: 20px 20px;
+ display: inline-block;
+ visibility: hidden;
+ float: left;
+ vertical-align: middle;
+ opacity: 0.7;
+ filter: alpha(opacity=70);
+ width: 20px;
+ height: 20px;
+ margin: 4px 10px 0;
+}
+
+.spinner.is-active,
+.loading-content .spinner {
+ visibility: visible;
+}
+
+#template > div {
+ margin-left: 16em;
+}
+#template .notice {
+ margin-top: 1em;
+ margin-left: 3%;
+}
+#template .notice p {
+ width: auto;
+}
+#template .submit .spinner {
+ float: none;
+}
+
+.metabox-holder .stuffbox > h3, /* Back-compat for pre-4.4 */
+.metabox-holder .postbox > h3, /* Back-compat for pre-4.4 */
+.metabox-holder h3.hndle, /* Back-compat for pre-4.4 */
+.metabox-holder h2.hndle {
+ font-size: 14px;
+ padding: 8px 12px;
+ margin: 0;
+ line-height: 1.4;
+}
+
+/* Back-compat for nav-menus screen */
+.nav-menus-php .metabox-holder h3 {
+ padding: 10px 14px 11px 10px;
+ line-height: 1.5;
+}
+
+#templateside ul li a {
+ text-decoration: none;
+}
+
+.plugin-install #description,
+.plugin-install-network #description {
+ width: 60%;
+}
+
+table .vers,
+table .column-visible,
+table .column-rating {
+ text-align: right;
+}
+
+.attention,
+.error-message {
+ color: #dc3232;
+ font-weight: 600;
+}
+
+/* Scrollbar fix for bulk upgrade iframe */
+body.iframe {
+ height: 98%;
+}
+
+/* Upgrader styles, Specific to Language Packs */
+.lp-show-latest p {
+ display: none;
+}
+.lp-show-latest p:last-child,
+.lp-show-latest .lp-error p {
+ display: block;
+}
+
+/* - Only used once or twice in all of WP - deprecate for global style
+------------------------------------------------------------------------------*/
+.media-icon {
+ width: 62px; /* icon + border */
+ text-align: center;
+}
+
+.media-icon img {
+ border: 1px solid #e5e5e5;
+ border: 1px solid rgba(0, 0, 0, 0.07);
+}
+
+#howto {
+ font-size: 11px;
+ margin: 0 5px;
+ display: block;
+}
+
+.importers {
+ font-size: 16px;
+ width: auto;
+}
+
+.importers td {
+ padding-left: 14px;
+ line-height: 1.4;
+}
+
+.importers .import-system {
+ max-width: 250px;
+}
+
+.importers td.desc {
+ max-width: 500px;
+}
+
+.importer-title,
+.importer-desc,
+.importer-action {
+ display: block;
+}
+
+.importer-title {
+ color: #000;
+ font-size: 14px;
+ font-weight: 400;
+ margin-bottom: .2em;
+}
+
+.importer-action {
+ line-height: 1.55; /* Same as with .updating-message */
+ color: #555;
+ margin-bottom: 1em;
+}
+
+#post-body #post-body-content #namediv h3, /* Back-compat for pre-4.4 */
+#post-body #post-body-content #namediv h2 {
+ margin-top: 0;
+}
+
+.edit-comment-author {
+ color: #222;
+ border-bottom: 1px solid #eee;
+}
+
+#namediv h3 label, /* Back-compat for pre-4.4 */
+#namediv h2 label {
+ vertical-align: baseline;
+}
+
+#namediv table {
+ width: 100%;
+}
+
+#namediv td.first {
+ width: 10px;
+ white-space: nowrap;
+}
+
+#namediv input {
+ width: 98%;
+}
+
+#namediv p {
+ margin: 10px 0;
+}
+
+#submitdiv h3 {
+ margin-bottom: 0 !important;
+}
+
+/* - Used - but could/should be deprecated with a CSS reset
+------------------------------------------------------------------------------*/
+.zerosize {
+ height: 0;
+ width: 0;
+ margin: 0;
+ border: 0;
+ padding: 0;
+ overflow: hidden;
+ position: absolute;
+}
+
+br.clear {
+ height: 2px;
+ line-height: 0.15;
+}
+
+.checkbox {
+ border: none;
+ margin: 0;
+ padding: 0;
+}
+
+fieldset {
+ border: 0;
+ padding: 0;
+ margin: 0;
+}
+
+.post-categories {
+ display: inline;
+ margin: 0;
+ padding: 0;
+}
+
+.post-categories li {
+ display: inline;
+}
+
+/* Star Ratings - Back-compat for pre-3.8 */
+div.star-holder {
+ position: relative;
+ height: 17px;
+ width: 100px;
+ background: url(../images/stars.png?ver=20121108) repeat-x bottom left;
+}
+
+div.star-holder .star-rating {
+ background: url(../images/stars.png?ver=20121108) repeat-x top left;
+ height: 17px;
+ float: right;
+}
+
+/* Star Ratings */
+.star-rating {
+ white-space: nowrap;
+}
+.star-rating .star {
+ display: inline-block;
+ width: 20px;
+ height: 20px;
+ -webkit-font-smoothing: antialiased;
+ font-size: 20px;
+ line-height: 1;
+ font-family: dashicons;
+ text-decoration: inherit;
+ font-weight: 400;
+ font-style: normal;
+ vertical-align: top;
+ transition: color .1s ease-in;
+ text-align: center;
+ color: #ffb900;
+}
+
+.star-rating .star-full:before {
+ content: "\f155";
+}
+
+.star-rating .star-half:before {
+ content: "\f459";
+}
+
+.rtl .star-rating .star-half {
+ transform: rotateY(180deg);
+}
+
+.star-rating .star-empty:before {
+ content: "\f154";
+}
+
+div.action-links {
+ font-weight: 400;
+ margin: 6px 0 0;
+}
+
+/* Plugin install thickbox */
+#plugin-information {
+ background: #fff;
+ position: fixed;
+ top: 0;
+ left: 0;
+ bottom: 0;
+ right: 0;
+ height: 100%;
+ padding: 0;
+}
+
+#plugin-information-scrollable {
+ overflow: auto;
+ -webkit-overflow-scrolling: touch;
+ height: 100%;
+}
+
+#plugin-information-title {
+ padding: 0 26px;
+ background: #f5f5f5;
+ font-size: 22px;
+ font-weight: 600;
+ line-height: 2.4;
+ position: relative;
+ height: 56px;
+}
+
+#plugin-information-title.with-banner {
+ margin-left: 0;
+ height: 250px;
+ background-size: cover;
+}
+
+#plugin-information-title h2 {
+ font-size: 1em;
+ font-weight: 600;
+ padding: 0;
+ margin: 0;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+}
+
+#plugin-information-title.with-banner h2 {
+ position: relative;
+ font-family: "Helvetica Neue", sans-serif;
+ display: inline-block;
+ font-size: 30px;
+ line-height: 1.68;
+ box-sizing: border-box;
+ max-width: 100%;
+ padding: 0 15px;
+ margin-top: 174px;
+ color: #fff;
+ background: rgba(30, 30, 30, 0.9);
+ text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
+ box-shadow: 0 0 30px rgba(255, 255, 255, 0.1);
+ border-radius: 8px;
+}
+
+#plugin-information-title div.vignette {
+ display: none;
+}
+
+#plugin-information-title.with-banner div.vignette {
+ position: absolute;
+ display: block;
+ top: 0;
+ right: 0;
+ height: 250px;
+ width: 100%;
+ background: transparent;
+ box-shadow: inset 0 0 50px 4px rgba(0, 0, 0, 0.2), inset 0 -1px 0 rgba(0, 0, 0, 0.1);
+}
+
+#plugin-information-tabs {
+ padding: 0 16px;
+ position: relative;
+ left: 0;
+ right: 0;
+ min-height: 36px;
+ font-size: 0;
+ z-index: 1;
+ border-bottom: 1px solid #ddd;
+ background: #f3f3f3;
+}
+
+#plugin-information-tabs a {
+ position: relative;
+ display: inline-block;
+ padding: 9px 10px;
+ margin: 0;
+ height: 18px;
+ line-height: 1.3;
+ font-size: 14px;
+ text-decoration: none;
+ transition: none;
+}
+
+#plugin-information-tabs a.current {
+ margin: 0 -1px -1px;
+ background: #fff;
+ border: 1px solid #ddd;
+ border-bottom-color: #fff;
+ padding-top: 8px;
+ color: #32373c;
+}
+
+#plugin-information-tabs.with-banner a.current {
+ border-top: none;
+ padding-top: 9px;
+}
+
+#plugin-information-tabs a:active,
+#plugin-information-tabs a:focus {
+ outline: none;
+}
+
+#plugin-information-content {
+ overflow: hidden; /* equal height column trick */
+ background: #fff;
+ position: relative;
+ top: 0;
+ left: 0;
+ right: 0;
+ min-height: 100%;
+ /* Height of title + tabs + install now */
+ min-height: calc( 100% - 152px );
+}
+
+#plugin-information-content.with-banner {
+ /* Height of banner + tabs + install now */
+ min-height: calc( 100% - 346px );
+}
+
+#section-holder {
+ position: relative;
+ top: 0;
+ left: 250px;
+ bottom: 0;
+ right: 0;
+ margin-top: 10px;
+ margin-left: 250px; /* FYI box */
+ padding: 10px 26px;
+ margin-bottom: -99939px; /* 60px less than the padding below to accommodate footer */
+ padding-bottom: 99999px; /* equal height column trick */
+}
+
+#section-holder .notice {
+ margin: 5px 0 15px;
+}
+
+#section-holder .updated {
+ margin: 16px 0;
+}
+
+#plugin-information .fyi {
+ float: left;
+ position: relative;
+ top: 0;
+ left: 0;
+ padding: 16px;
+ margin-bottom: -99939px; /* 60px less than the padding below to accommodate footer */
+ padding-bottom: 99999px; /* equal height column trick */
+ width: 217px;
+ border-right: 1px solid #ddd;
+ background: #f3f3f3;
+ color: #666;
+}
+
+#plugin-information .fyi strong {
+ color: #444;
+}
+
+#plugin-information .fyi h3 {
+ font-weight: 600;
+ text-transform: uppercase;
+ font-size: 12px;
+ color: #666;
+ margin: 24px 0 8px;
+}
+
+#plugin-information .fyi h2 {
+ font-size: 0.9em;
+ margin-bottom: 0;
+ margin-left: 0;
+}
+
+#plugin-information .fyi ul {
+ padding: 0;
+ margin: 0;
+ list-style: none;
+}
+
+#plugin-information .fyi li {
+ margin: 0 0 10px;
+}
+
+#plugin-information .fyi-description {
+ margin-top: 0;
+}
+
+#plugin-information .counter-container {
+ margin: 3px 0;
+}
+
+#plugin-information .counter-label {
+ float: right;
+ margin-left: 5px;
+ min-width: 55px;
+}
+
+#plugin-information .counter-back {
+ height: 17px;
+ width: 92px;
+ background-color: #e5e5e5;
+ float: right;
+}
+
+#plugin-information .counter-bar {
+ height: 17px;
+ background-color: #ffc733; /* slightly lighter than stars due to larger expanse */
+ float: right;
+}
+
+#plugin-information .counter-count {
+ margin-right: 5px;
+}
+
+#plugin-information .fyi ul.contributors {
+ margin-top: 10px;
+}
+
+#plugin-information .fyi ul.contributors li {
+ display: inline-block;
+ margin-left: 8px;
+ vertical-align: middle;
+}
+
+#plugin-information .fyi ul.contributors li {
+ display: inline-block;
+ margin-left: 8px;
+ vertical-align: middle;
+}
+
+#plugin-information .fyi ul.contributors li img {
+ vertical-align: middle;
+ margin-left: 4px;
+}
+
+#plugin-information-footer {
+ padding: 13px 16px;
+ position: absolute;
+ left: 0;
+ bottom: 0;
+ right: 0;
+ height: 33px; /* 33+13+13+1=60 */
+ border-top: 1px solid #ddd;
+ background: #f3f3f3;
+}
+
+/* rtl:ignore */
+#plugin-information .section {
+ direction: ltr;
+}
+
+/* rtl:ignore */
+#plugin-information .section ul,
+#plugin-information .section ol {
+ list-style-type: disc;
+ margin-left: 24px;
+}
+
+#plugin-information .section,
+#plugin-information .section p {
+ font-size: 14px;
+ line-height: 1.7;
+}
+
+#plugin-information #section-screenshots ol {
+ list-style: none;
+ margin: 0;
+}
+
+#plugin-information #section-screenshots li img {
+ vertical-align: text-top;
+ margin-top: 16px;
+ max-width: 100%;
+ width: auto;
+ height: auto;
+ box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
+}
+
+/* rtl:ignore */
+#plugin-information #section-screenshots li p {
+ font-style: italic;
+ padding-left: 20px;
+}
+
+#plugin-information pre {
+ padding: 7px;
+ overflow: auto;
+ border: 1px solid #ccc;
+}
+
+#plugin-information blockquote {
+ border-right: 2px solid #ddd;
+ color: #666;
+ font-style: italic;
+ margin: 1em 0;
+ padding: 0 1em 0 0;
+}
+
+/* rtl:ignore */
+#plugin-information .review {
+ overflow: hidden; /* clearfix */
+ width: 100%;
+ margin-bottom: 20px;
+ border-bottom: 1px solid #e5e5e5;
+}
+
+#plugin-information .review-title-section {
+ overflow: hidden; /* clearfix */
+}
+
+/* rtl:ignore */
+#plugin-information .review-title-section h4 {
+ display: inline-block;
+ float: left;
+ margin: 0 6px 0 0;
+}
+
+#plugin-information .reviewer-info p {
+ clear: both;
+ margin: 0;
+ padding-top: 2px;
+}
+
+/* rtl:ignore */
+#plugin-information .reviewer-info .avatar {
+ float: left;
+ margin: 4px 6px 0 0;
+}
+
+/* rtl:ignore */
+#plugin-information .reviewer-info .star-rating {
+ float: left;
+}
+
+/* rtl:ignore */
+#plugin-information .review-meta {
+ float: left;
+ margin-left: 0.75em;
+}
+
+/* rtl:ignore */
+#plugin-information .review-body {
+ float: left;
+ width: 100%;
+}
+
+.plugin-version-author-uri {
+ font-size: 13px;
+}
+
+/* For non-js plugin installation screen ticket #36430. */
+.update-php .button.button-primary {
+ margin-left: 1em;
+}
+
+@media screen and (max-width: 771px) {
+ #plugin-information-title.with-banner {
+ height: 100px;
+ }
+
+ #plugin-information-title.with-banner h2 {
+ margin-top: 30px;
+ font-size: 20px;
+ line-height: 2;
+ max-width: 85%;
+ }
+
+ #plugin-information-title.with-banner div.vignette {
+ height: 100px;
+ }
+
+ #plugin-information-tabs {
+ overflow: hidden; /* clearfix */
+ padding: 0;
+ height: auto; /* let tabs wrap */
+ }
+
+ #plugin-information-tabs a.current {
+ margin-bottom: 0;
+ border-bottom: none;
+ }
+
+ #plugin-information .fyi {
+ float: none;
+ border: 1px solid #ddd;
+ position: static;
+ width: auto;
+ margin: 26px 26px 0;
+ padding-bottom: 0; /* reset from the two column height fix */
+ }
+
+ #section-holder {
+ position: static;
+ margin: 0;
+ padding-bottom: 70px; /* reset from the two column height fix, plus accommodate footer */
+ }
+
+ #plugin-information .fyi h3,
+ #plugin-information .fyi small {
+ display: none;
+ }
+
+ #plugin-information-footer {
+ padding: 12px 16px 0;
+ height: 46px;
+ }
+}
+
+/* Thickbox for the Plugin details modal. */
+#TB_window.plugin-details-modal {
+ background: #fcfcfc;
+}
+
+#TB_window.plugin-details-modal.thickbox-loading:before {
+ content: "";
+ display: block;
+ width: 20px;
+ height: 20px;
+ position: absolute;
+ right: 50%;
+ top: 50%;
+ z-index: -1;
+ margin: -10px -10px 0 0;
+ background: #fcfcfc url(../images/spinner.gif) no-repeat center;
+ background-size: 20px 20px;
+ transform: translateZ(0);
+}
+
+@media print,
+ (-webkit-min-device-pixel-ratio: 1.25),
+ (min-resolution: 120dpi) {
+
+ #TB_window.plugin-details-modal.thickbox-loading:before {
+ background-image: url(../images/spinner-2x.gif);
+ }
+}
+
+.plugin-details-modal #TB_title {
+ float: right;
+ height: 1px;
+}
+
+.plugin-details-modal #TB_ajaxWindowTitle {
+ display: none;
+}
+
+.plugin-details-modal #TB_closeWindowButton {
+ right: auto;
+ left: -30px;
+ color: #eee;
+}
+
+.plugin-details-modal #TB_closeWindowButton:hover,
+.plugin-details-modal #TB_closeWindowButton:focus {
+ color: #00a0d2;
+ outline: none;
+ box-shadow: none;
+}
+
+.plugin-details-modal .tb-close-icon {
+ display: none;
+}
+
+.plugin-details-modal #TB_closeWindowButton:after {
+ content: "\f335";
+ font: normal 32px/29px 'dashicons';
+ speak: none;
+ -webkit-font-smoothing: antialiased;
+ -moz-osx-font-smoothing: grayscale;
+}
+
+/* move plugin install close icon to top on narrow screens */
+@media screen and (max-width: 830px) {
+ .plugin-details-modal #TB_closeWindowButton {
+ left: 0;
+ top: -30px;
+ }
+}
+
+/* @todo: move this. */
+img {
+ border: none;
+}
+
+/* Metabox collapse arrow indicators */
+.sidebar-name .toggle-indicator:before,
+.js .meta-box-sortables .postbox .toggle-indicator:before,
+.bulk-action-notice .toggle-indicator:before,
+.privacy-text-box .toggle-indicator:before {
+ content: "\f142";
+ display: inline-block;
+ font: normal 20px/1 dashicons;
+ speak: none;
+ -webkit-font-smoothing: antialiased;
+ -moz-osx-font-smoothing: grayscale;
+ text-decoration: none !important;
+}
+
+.js .widgets-holder-wrap.closed .toggle-indicator:before,
+.js .meta-box-sortables .postbox.closed .handlediv .toggle-indicator:before,
+.bulk-action-notice .bulk-action-errors-collapsed .toggle-indicator:before,
+.privacy-text-box.closed .toggle-indicator:before {
+ content: "\f140";
+}
+
+.js .postbox .handlediv .toggle-indicator:before {
+ margin-top: 4px;
+ width: 20px;
+ border-radius: 50%;
+ text-indent: -1px; /* account for the dashicon alignment */
+}
+
+.rtl.js .postbox .handlediv .toggle-indicator:before {
+ text-indent: 1px; /* account for the dashicon alignment */
+}
+
+.bulk-action-notice .toggle-indicator:before {
+ line-height: 16px;
+ vertical-align: top;
+ color: #72777c;
+}
+
+.js .postbox .handlediv:focus {
+ box-shadow: none;
+ outline: none;
+}
+
+.js .postbox .handlediv:focus .toggle-indicator:before {
+ box-shadow:
+ 0 0 0 1px #5b9dd9,
+ 0 0 2px 1px rgba(30, 140, 190, 0.8);
+}
+
+/* @todo: appears to be Press This only and overridden */
+#photo-add-url-div input[type="text"] {
+ width: 300px;
+}
+
+/* Theme/Plugin Editor */
+.alignleft h2 {
+ margin: 0;
+}
+
+#template textarea {
+ font-family: Consolas, Monaco, monospace;
+ font-size: 13px;
+ background: #f9f9f9;
+ -moz-tab-size: 4;
+ -o-tab-size: 4;
+ tab-size: 4;
+}
+
+#template textarea,
+#template .CodeMirror {
+ width: 100%;
+ min-height: 60vh;
+ height: calc( 100vh - 295px );
+ border: 1px solid #ddd;
+ box-sizing: border-box;
+}
+
+#templateside > h2 {
+ padding-top: 6px;
+ padding-bottom: 7px;
+ margin: 0;
+}
+
+#templateside ol,
+#templateside ul {
+ margin: 0;
+ padding: 0;
+}
+#templateside > ul {
+ box-sizing: border-box;
+ margin-top: 0;
+ overflow: auto;
+ padding: 0;
+ min-height: 60vh;
+ height: calc(100vh - 295px);
+ background-color: #f7f7f7;
+ border: 1px solid #ddd;
+ border-right: none;
+}
+#templateside ul ul {
+ padding-right: 12px;
+}
+#templateside > ul > li > ul[role=group] {
+ padding-right: 0;
+}
+
+/*
+ * Styles for Theme and Plugin editors.
+ */
+
+/* Hide collapsed items. */
+[role="treeitem"][aria-expanded="false"] > ul {
+ display: none;
+}
+
+/* Use arrow dashicons for folder states, but hide from screen readers. */
+[role="treeitem"] span[aria-hidden] {
+ display: inline;
+ font-family: dashicons;
+ font-size: 20px;
+ position: absolute;
+ pointer-events: none;
+}
+[role="treeitem"][aria-expanded="false"] > .folder-label .icon:after {
+ content: "\f141";
+}
+[role="treeitem"][aria-expanded="true"] > .folder-label .icon:after {
+ content: "\f140";
+}
+[role="treeitem"] .folder-label {
+ display: block;
+ padding: 3px 12px 3px 3px;
+ cursor: pointer;
+}
+
+/* Remove outline, and create our own focus and hover styles */
+[role="treeitem"] {
+ outline: 0;
+}
+[role="treeitem"] .folder-label.focus {
+ color: #124964;
+ box-shadow: 0 0 0 1px #5b9dd9, 0 0 2px 1px rgba(30, 140, 190, 0.8);
+}
+[role="treeitem"].hover,
+[role="treeitem"] .folder-label.hover {
+ background-color: #eaeaea;
+}
+
+.tree-folder {
+ margin: 0;
+ position: relative;
+}
+[role="treeitem"] li {
+ position: relative;
+}
+
+/* Styles for folder indicators/depth */
+.tree-folder .tree-folder::after {
+ content: "";
+ display: block;
+ position: absolute;
+ right: 2px;
+ border-right: 1px solid #ccc;
+ top: -13px;
+ bottom: 10px;
+}
+.tree-folder > li::before {
+ content: "";
+ position: absolute;
+ display: block;
+ border-right: 1px solid #ccc;
+ right: 2px;
+ top: -5px;
+ height: 18px;
+ width: 7px;
+ border-bottom: 1px solid #ccc;
+}
+.tree-folder > li::after {
+ content: "";
+ position: absolute;
+ display: block;
+ border-right: 1px solid #ccc;
+ right: 2px;
+ bottom: -7px;
+ top: 0;
+}
+
+/* current-file needs to adjustment for .notice styles */
+#templateside .current-file {
+ margin: -4px 0 -2px;
+}
+.tree-folder > .current-file::before {
+ right: 4px;
+ height: 15px;
+ width: 0px;
+ border-right: none;
+ top: 3px;
+}
+.tree-folder > .current-file::after {
+ bottom: -4px;
+ height: 7px;
+ right: 2px;
+ top: auto;
+}
+
+/* Lines shouldn't continue on last item */
+.tree-folder > li:last-child::after,
+.tree-folder li:last-child > .tree-folder::after {
+ display: none;
+}
+
+
+#theme-plugin-editor-label {
+ display: inline-block;
+ margin-bottom: 1em;
+ font-weight: 600;
+}
+
+/* rtl:ignore */
+#template textarea,
+#docs-list {
+ direction: ltr;
+}
+
+.fileedit-sub #theme,
+.fileedit-sub #plugin {
+ max-width: 40%;
+}
+.fileedit-sub .alignright {
+ text-align: left;
+}
+
+#template p {
+ width: 97%;
+}
+
+#file-editor-linting-error {
+ margin-top: 1em;
+ margin-bottom: 1em;
+}
+#file-editor-linting-error > .notice {
+ margin: 0;
+ display: inline-block;
+}
+#file-editor-linting-error > .notice > p {
+ width: auto;
+}
+#template .submit {
+ margin-top: 1em;
+ padding: 0;
+}
+
+#template .submit input[type=submit][disabled] {
+ cursor: not-allowed;
+}
+#templateside {
+ float: left;
+ width: 16em;
+ word-wrap: break-word;
+}
+
+#postcustomstuff p.submit {
+ margin: 0;
+}
+
+#templateside h4 {
+ margin: 1em 0 0;
+}
+
+#templateside li {
+ margin: 4px 0;
+}
+
+#templateside li:not(.howto) a,
+.theme-editor-php .highlight {
+ display: block;
+ padding: 3px 12px 3px 0;
+ text-decoration: none;
+}
+
+#templateside li:not(.howto) > a:first-of-type {
+ padding-top: 0;
+}
+
+#templateside li.howto {
+ padding: 6px 12px 12px 12px;
+}
+
+.theme-editor-php .highlight {
+ margin: -3px -12px -3px 3px;
+}
+
+#templateside .highlight {
+ border: none;
+ font-weight: 600;
+}
+
+.nonessential {
+ color: #666;
+ font-size: 11px;
+ font-style: italic;
+ padding-right: 12px;
+}
+
+#documentation {
+ margin-top: 10px;
+}
+
+#documentation label {
+ line-height: 1.8;
+ vertical-align: baseline;
+ font-weight: 600;
+}
+
+.fileedit-sub {
+ padding: 10px 0 8px;
+ line-height: 180%;
+}
+
+#file-editor-warning .file-editor-warning-content {
+ margin: 25px;
+}
+
+/* @todo: can we use a common class for these? */
+.nav-menus-php .item-edit:before,
+.widget-top .widget-action .toggle-indicator:before,
+.control-section .accordion-section-title:after,
+.accordion-section-title:after {
+ content: "\f140";
+ font: normal 20px/1 dashicons;
+ speak: none;
+ display: block;
+ -webkit-font-smoothing: antialiased;
+ -moz-osx-font-smoothing: grayscale;
+ text-decoration: none !important;
+}
+
+.widget-top .widget-action .toggle-indicator:before {
+ padding: 1px 0px 1px 2px;
+ border-radius: 50%;
+}
+
+.handlediv,
+.postbox .handlediv.button-link,
+.item-edit,
+.toggle-indicator,
+.accordion-section-title:after {
+ color: #72777c;
+}
+
+.widget-action {
+ color: #555d66; /* #fafafa background in the Widgets screen */
+}
+
+.widget-top:hover .widget-action,
+.widget-action:focus,
+.handlediv:hover,
+.handlediv:focus,
+.postbox .handlediv.button-link:hover,
+.postbox .handlediv.button-link:focus,
+.item-edit:hover,
+.item-edit:focus,
+.sidebar-name:hover .toggle-indicator,
+.accordion-section-title:hover:after {
+ color: #23282d;
+}
+
+.widget-top .widget-action:focus .toggle-indicator:before {
+ box-shadow:
+ 0 0 0 1px #5b9dd9,
+ 0 0 2px 1px rgba(30, 140, 190, 0.8);
+}
+
+.control-section .accordion-section-title:after,
+.accordion-section-title:after {
+ float: left;
+ left: 20px;
+ top: -2px;
+}
+
+.control-section.open .accordion-section-title:after,
+#customize-info.open .accordion-section-title:after,
+.nav-menus-php .menu-item-edit-active .item-edit:before,
+.widget.open .widget-top .widget-action .toggle-indicator:before,
+.widget.widget-in-question .widget-top .widget-action .toggle-indicator:before {
+ content: "\f142";
+}
+
+/*!
+ * jQuery UI Draggable/Sortable 1.11.4
+ * http://jqueryui.com
+ *
+ * Copyright jQuery Foundation and other contributors
+ * Released under the MIT license.
+ * http://jquery.org/license
+ */
+.ui-draggable-handle,
+.ui-sortable-handle {
+ touch-action: none;
+}
+
+/* Accordion */
+.accordion-section {
+ border-bottom: 1px solid #ddd;
+ margin: 0;
+}
+
+.accordion-section.open .accordion-section-content,
+.no-js .accordion-section .accordion-section-content {
+ display: block;
+}
+
+.accordion-section.open:hover {
+ border-bottom-color: #ddd;
+}
+
+.accordion-section-content {
+ display: none;
+ padding: 10px 20px 15px;
+ overflow: hidden;
+ background: #fff;
+}
+
+.accordion-section-title {
+ margin: 0;
+ padding: 12px 15px 15px;
+ position: relative;
+ border-right: 1px solid #ddd;
+ border-left: 1px solid #ddd;
+ -webkit-user-select: none;
+ -moz-user-select: none;
+ -ms-user-select: none;
+ user-select: none;
+}
+
+.js .accordion-section-title {
+ cursor: pointer;
+}
+
+.js .accordion-section-title:after {
+ position: absolute;
+ top: 12px;
+ left: 10px;
+ z-index: 1;
+}
+
+.accordion-section-title:focus {
+ outline: none;
+}
+
+.accordion-section-title:hover:after,
+.accordion-section-title:focus:after {
+ border-color: #a0a5aa transparent;
+}
+
+.cannot-expand .accordion-section-title {
+ cursor: auto;
+}
+
+.cannot-expand .accordion-section-title:after {
+ display: none;
+}
+
+.control-section .accordion-section-title,
+.customize-pane-child .accordion-section-title {
+ border-right: none;
+ border-left: none;
+ padding: 10px 14px 11px 10px;
+ line-height: 1.55;
+ background: #fff;
+}
+
+.control-section .accordion-section-title:after,
+.customize-pane-child .accordion-section-title:after {
+ top: calc(50% - 10px); /* Arrow height is 20px, so use half of that to vertically center */
+}
+
+.js .control-section:hover .accordion-section-title,
+.js .control-section .accordion-section-title:hover,
+.js .control-section.open .accordion-section-title,
+.js .control-section .accordion-section-title:focus {
+ color: #23282d;
+ background: #f5f5f5;
+}
+
+.control-section.open .accordion-section-title {
+ /* When expanded */
+ border-bottom: 1px solid #ddd;
+}
+
+/* Edit Site */
+.network-admin .edit-site-actions {
+ margin-top: 0;
+}
+
+/* My Sites */
+.my-sites {
+ display: block;
+ overflow: auto;
+ zoom: 1;
+}
+
+.my-sites li {
+ display: block;
+ padding: 8px 3%;
+ min-height: 130px;
+ margin: 0;
+}
+
+@media only screen and (max-width: 599px) {
+ .my-sites li {
+ min-height: 0;
+ }
+}
+
+@media only screen and (min-width: 600px) {
+ .my-sites.striped li {
+ background-color: #fff;
+ position: relative;
+ }
+ .my-sites.striped li:after {
+ content: "";
+ width: 1px;
+ height: 100%;
+ position: absolute;
+ top: 0;
+ left: 0;
+ background: #ccc;
+ }
+
+}
+@media only screen and (min-width: 600px) and (max-width: 699px) {
+ .my-sites li{
+ float: right;
+ width: 44%;
+ }
+ .my-sites.striped li {
+ background-color: #fff;
+ }
+ .my-sites.striped li:nth-of-type(2n+1) {
+ clear: right;
+ }
+ .my-sites.striped li:nth-of-type(2n+2):after {
+ content: none;
+ }
+ .my-sites li:nth-of-type(4n+1),
+ .my-sites li:nth-of-type(4n+2) {
+ background-color: #f9f9f9;
+ }
+
+}
+
+@media only screen and (min-width: 700px) and (max-width: 1199px) {
+ .my-sites li {
+ float: right;
+ width: 27.333333%;
+ background-color: #fff;
+ }
+ .my-sites.striped li:nth-of-type(3n+3):after {
+ content: none;
+ }
+ .my-sites li:nth-of-type(6n+1),
+ .my-sites li:nth-of-type(6n+2),
+ .my-sites li:nth-of-type(6n+3) {
+ background-color: #f9f9f9;
+ }
+}
+
+@media only screen and (min-width: 1200px) and (max-width: 1399px) {
+ .my-sites li {
+ float: right;
+ width: 21%;
+ padding: 8px 2%;
+ background-color: #fff;
+ }
+ .my-sites.striped li:nth-of-type(4n+1) {
+ clear: right;
+ }
+ .my-sites.striped li:nth-of-type(4n+4):after {
+ content: none;
+ }
+ .my-sites li:nth-of-type(8n+1),
+ .my-sites li:nth-of-type(8n+2),
+ .my-sites li:nth-of-type(8n+3),
+ .my-sites li:nth-of-type(8n+4) {
+ background-color: #f9f9f9;
+ }
+}
+
+@media only screen and (min-width: 1400px) and (max-width: 1599px) {
+ .my-sites li {
+ float: right;
+ width: 16%;
+ padding: 8px 2%;
+ background-color: #fff;
+ }
+ .my-sites.striped li:nth-of-type(5n+1) {
+ clear: right;
+ }
+ .my-sites.striped li:nth-of-type(5n+5):after {
+ content: none;
+ }
+ .my-sites li:nth-of-type(10n+1),
+ .my-sites li:nth-of-type(10n+2),
+ .my-sites li:nth-of-type(10n+3),
+ .my-sites li:nth-of-type(10n+4),
+ .my-sites li:nth-of-type(10n+5) {
+ background-color: #f9f9f9;
+ }
+}
+
+@media only screen and (min-width: 1600px) {
+ .my-sites li {
+ float: right;
+ width: 12.666666%;
+ padding: 8px 2%;
+ background-color: #fff;
+ }
+ .my-sites.striped li:nth-of-type(6n+1) {
+ clear: right;
+ }
+ .my-sites.striped li:nth-of-type(6n+6):after {
+ content: none;
+ }
+ .my-sites li:nth-of-type(12n+1),
+ .my-sites li:nth-of-type(12n+2),
+ .my-sites li:nth-of-type(12n+3),
+ .my-sites li:nth-of-type(12n+4),
+ .my-sites li:nth-of-type(12n+5),
+ .my-sites li:nth-of-type(12n+6) {
+ background-color: #f9f9f9;
+ }
+}
+
+.my-sites li a {
+ text-decoration: none;
+}
+
+/* =Media Queries
+-------------------------------------------------------------- */
+
+/**
+ * HiDPI Displays
+ */
+@media print,
+ (-webkit-min-device-pixel-ratio: 1.25),
+ (min-resolution: 120dpi) {
+ /* Back-compat for pre-3.8 */
+ div.star-holder,
+ div.star-holder .star-rating {
+ background: url(../images/stars-2x.png?ver=20121108) repeat-x bottom left;
+ background-size: 21px 37px;
+ }
+
+ .spinner {
+ background-image: url(../images/spinner-2x.gif);
+ }
+
+ /* @todo: evaluate - most of these were likely replaced by dashicons */
+ .curtime #timestamp,
+ #screen-meta-links a.show-settings,
+ .widget-top .widget-action,
+ .widget-top .widget-action:hover,
+ .sidebar-name .toggle-indicator,
+ .sidebar-name:hover .toggle-indicator,
+ .meta-box-sortables .postbox:hover .handlediv,
+ #bulk-titles div a,
+ #bulk-titles div a:hover {
+ background: none !important;
+ }
+
+}
+
+@-ms-viewport {
+ width: device-width;
+}
+
+@media screen and (max-width: 782px) {
+ html.wp-toolbar {
+ padding-top: 46px;
+ }
+
+ .screen-reader-shortcut:focus {
+ top: -39px;
+ }
+
+ body {
+ min-width: 240px;
+ overflow-x: hidden;
+ }
+
+ body * {
+ -webkit-tap-highlight-color: rgba(0, 0, 0, 0) !important;
+ }
+
+ #wpcontent {
+ position: relative;
+ margin-right: 0;
+ padding-right: 10px;
+ }
+
+ #wpbody-content {
+ padding-bottom: 100px;
+ }
+
+ .wrap {
+ clear: both;
+ margin-left: 12px;
+ margin-right: 0;
+ }
+
+ /* categories */
+ #col-left,
+ #col-right {
+ float: none;
+ width: auto;
+ }
+
+ #col-left .col-wrap,
+ #col-right .col-wrap {
+ padding: 0;
+ }
+
+ /* Hidden Elements */
+ #collapse-menu,
+ .post-format-select {
+ display: none !important;
+ }
+
+ .wrap h1.wp-heading-inline {
+ margin-bottom: 0.5em;
+ }
+
+ .wrap .add-new-h2, /* deprecated */
+ .wrap .add-new-h2:active, /* deprecated */
+ .wrap .page-title-action,
+ .wrap .page-title-action:active {
+ padding: 10px 15px;
+ font-size: 14px;
+ white-space: nowrap;
+ }
+
+ /* Feedback Messages */
+ .notice,
+ .wrap div.updated,
+ .wrap div.error,
+ .media-upload-form div.error {
+ margin: 20px 0 10px 0;
+ padding: 5px 10px;
+ font-size: 14px;
+ line-height: 175%;
+ }
+
+ .wp-core-ui .notice.is-dismissible {
+ padding-left: 46px;
+ }
+
+ .notice-dismiss {
+ padding: 13px;
+ }
+
+ .wrap .icon32 + h2 {
+ margin-top: -2px;
+ }
+
+ .wp-responsive-open #wpbody {
+ left: -16em;
+ }
+
+ code {
+ word-wrap: break-word;
+ }
+
+ /* General Metabox */
+ .postbox {
+ font-size: 14px;
+ }
+
+ .metabox-holder h3.hndle, /* Back-compat for pre-4.4 */
+ .metabox-holder .stuffbox > h3, /* Back-compat for pre-4.4 */
+ .metabox-holder .postbox > h3, /* Back-compat for pre-4.4 */
+ .metabox-holder h2 {
+ padding: 12px;
+ }
+
+ .postbox .handlediv {
+ margin-top: 3px;
+ }
+
+ /* Subsubsub Nav */
+ .subsubsub {
+ font-size: 16px;
+ text-align: center;
+ margin-bottom: 15px;
+ }
+
+ /* Theme/Plugin File Editor */
+
+ #template textarea,
+ #template .CodeMirror {
+ box-sizing: border-box;
+ }
+
+ #templateside {
+ float: none;
+ width: auto;
+ }
+
+ #templateside > ul {
+ border-right: 1px solid #ddd;
+ }
+
+ #templateside li {
+ margin: 0;
+ }
+
+ #templateside li:not(.howto) a {
+ display: block;
+ padding: 5px;
+ }
+ #templateside li.howto {
+ padding: 12px;
+ }
+
+ #templateside .highlight {
+ padding: 5px;
+ margin-right: -5px;
+ margin-top: -5px;
+ }
+
+ #template > div,
+ #template .notice {
+ float: none;
+ margin: 1em 0;
+ width: auto;
+ }
+
+ #template .CodeMirror,
+ #template textarea {
+ width: 100%;
+ }
+
+ #templateside ul ul {
+ padding-right: 1.5em;
+ }
+ [role="treeitem"] .folder-label {
+ display: block;
+ padding: 5px;
+ }
+ .tree-folder > li::before,
+ .tree-folder > li::after,
+ .tree-folder .tree-folder::after {
+ right: -8px;
+ }
+ .tree-folder > li::before {
+ top: 0px;
+ height: 13px;
+ }
+ .tree-folder > .current-file::before {
+ right: -5px;
+ top: 7px;
+ width: 4px;
+ }
+ .tree-folder > .current-file::after {
+ height: 9px;
+ right: -8px;
+ }
+ .wrap #templateside span.notice {
+ margin-right: -5px;
+ width: 100%;
+ }
+
+ .fileedit-sub .alignright {
+ float: right;
+ margin-top: 15px;
+ width: 100%;
+ text-align: right;
+ }
+
+ .fileedit-sub .alignright label {
+ display: block;
+ }
+
+ .fileedit-sub #theme,
+ .fileedit-sub #plugin {
+ margin-right: 0;
+ max-width: 70%;
+ }
+
+ .fileedit-sub input[type="submit"] {
+ margin-bottom: 0px;
+ padding: 8px 18px;
+ }
+
+ #documentation label[for="docs-list"] {
+ display: block;
+ }
+
+ #documentation select[name="docs-list"] {
+ margin-right: 0;
+ max-width: 60%;
+ }
+
+ #documentation input[type="button"] {
+ margin-bottom: 0;
+ padding: 8px 18px;
+ }
+
+ #wpfooter {
+ display: none;
+ }
+
+ #comments-form .checkforspam {
+ display: none;
+ }
+
+ .edit-comment-author {
+ margin: 2px 0 0;
+ }
+
+ .filter-drawer .filter-group-feature input,
+ .filter-drawer .filter-group-feature label {
+ line-height: 2.1;
+ }
+
+ .filter-drawer .filter-group-feature label {
+ margin-right: 32px;
+ }
+
+ .wp-filter .button.drawer-toggle {
+ font-size: 13px;
+ line-height: 2;
+ height: 28px;
+ }
+
+ /* Fix help tab columns for smaller screens */
+ #screen-meta #contextual-help-wrap {
+ overflow: visible;
+ }
+
+ #screen-meta #contextual-help-back,
+ #screen-meta .contextual-help-sidebar {
+ display: none;
+ }
+
+ #screen-meta .contextual-help-tabs {
+ clear: both;
+ width: 100%;
+ float: none;
+ }
+
+ #screen-meta .contextual-help-tabs ul {
+ margin: 0 0 1em;
+ padding: 1em 0 0;
+ }
+
+ #screen-meta .contextual-help-tabs .active {
+ margin: 0;
+ }
+
+ #screen-meta .contextual-help-tabs-wrap {
+ clear: both;
+ max-width: 100%;
+ float: none;
+ }
+
+ #screen-meta-links {
+ margin-bottom: 20px; /* Add margins beneath links for better spacing between boxes and elements */
+ }
+}
+
+/* Smartphone */
+@media screen and (max-width: 600px) {
+ /* Disable horizontal scroll when responsive menu is open
+ since we push the main content off to the right. */
+ #wpwrap.wp-responsive-open {
+ overflow-x: hidden;
+ }
+
+ html.wp-toolbar {
+ padding-top: 0;
+ }
+
+ .screen-reader-shortcut:focus {
+ top: 7px;
+ }
+
+ #wpbody {
+ padding-top: 46px;
+ }
+
+ /* Keep full-width boxes on Edit Post page from causing horizontal scroll */
+ div#post-body.metabox-holder.columns-1 {
+ overflow-x: hidden;
+ }
+
+ h1.nav-tab-wrapper,
+ .wrap h2.nav-tab-wrapper,
+ .nav-tab-wrapper {
+ border-bottom: 0;
+ }
+
+ h1 .nav-tab,
+ h2 .nav-tab,
+ h3 .nav-tab,
+ nav .nav-tab {
+ margin: 10px 0 0 10px;
+ border-bottom: 1px solid #ccc;
+ }
+
+ .nav-tab-active:hover,
+ .nav-tab-active:focus,
+ .nav-tab-active:focus:active {
+ border-bottom: 1px solid #ccc;
+ }
+}
+
+@media screen and (max-width: 320px) {
+ /* Prevent default center alignment and larger font for the Right Now widget when
+ the network dashboard is viewed on a small mobile device. */
+ #network_dashboard_right_now .subsubsub {
+ font-size: 14px;
+ text-align: right;
+ }
+}
diff --git a/www/crm/wp-admin/css/common-rtl.min.css b/www/crm/wp-admin/css/common-rtl.min.css
new file mode 100644
index 00000000..3cfecc01
--- /dev/null
+++ b/www/crm/wp-admin/css/common-rtl.min.css
@@ -0,0 +1,9 @@
+/*! This file is auto-generated */
+#wpwrap{height:auto;min-height:100%;width:100%;position:relative;-webkit-font-smoothing:subpixel-antialiased}#wpcontent{height:100%;padding-right:20px}#wpcontent,#wpfooter{margin-right:160px}.folded #wpcontent,.folded #wpfooter{margin-right:36px}#wpbody-content{padding-bottom:65px;float:right;width:100%;overflow:visible!important}.inner-sidebar{float:left;clear:left;display:none;width:281px;position:relative}.columns-2 .inner-sidebar{margin-left:auto;width:286px;display:block}.columns-2 .inner-sidebar #side-sortables,.inner-sidebar #side-sortables{min-height:300px;width:280px;padding:0}.has-right-sidebar .inner-sidebar{display:block}.has-right-sidebar #post-body{float:right;clear:right;width:100%;margin-left:-2000px}.has-right-sidebar #post-body-content{margin-left:300px;float:none;width:auto}#col-left{float:right;width:35%}#col-right{float:left;width:65%}#col-left .col-wrap{padding:0 0 0 6px}#col-right .col-wrap{padding:0 6px 0 0}.alignleft{float:right}.alignright{float:left}.textleft{text-align:right}.textright{text-align:left}.clear{clear:both}.wp-clearfix:after{content:"";display:table;clear:both}.screen-reader-text,.screen-reader-text span,.ui-helper-hidden-accessible{border:0;clip:rect(1px,1px,1px,1px);-webkit-clip-path:inset(50%);clip-path:inset(50%);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;word-wrap:normal!important}.button .screen-reader-text{height:auto}.screen-reader-shortcut{position:absolute;top:-1000em}.screen-reader-shortcut:focus{right:6px;top:-25px;height:auto;width:auto;display:block;font-size:14px;font-weight:600;padding:15px 23px 14px;background:#f1f1f1;color:#0073aa;z-index:100000;line-height:normal;box-shadow:0 0 2px 2px rgba(0,0,0,.6);text-decoration:none;outline:2px solid transparent;outline-offset:-2px}.hidden,.js .closed .inside,.js .hide-if-js,.js .wp-core-ui .hide-if-js,.js.wp-core-ui .hide-if-js,.no-js .hide-if-no-js,.no-js .wp-core-ui .hide-if-no-js,.no-js.wp-core-ui .hide-if-no-js{display:none}#menu-management .menu-edit,#menu-settings-column .accordion-container,.comment-ays,.feature-filter,.imgedit-group,.manage-menus,.menu-item-handle,.popular-tags,.stuffbox,.widget-inside,.widget-top,.widgets-holder-wrap,.wp-editor-container,p.popular-tags,table.widefat{border:1px solid #e5e5e5;box-shadow:0 1px 1px rgba(0,0,0,.04)}.comment-ays,.feature-filter,.imgedit-group,.popular-tags,.stuffbox,.widgets-holder-wrap,.wp-editor-container,p.popular-tags,table.widefat{background:#fff}body,html{height:100%;margin:0;padding:0}body{background:#f1f1f1;color:#444;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif;font-size:13px;line-height:1.4em;min-width:600px}body.iframe{min-width:0;padding-top:1px}body.modal-open{overflow:hidden}body.mobile.modal-open #wpwrap{overflow:hidden;position:fixed;height:100%}iframe,img{border:0}td{font-family:inherit;font-size:inherit;font-weight:inherit;line-height:inherit}a{color:#0073aa;transition-property:border,background,color;transition-duration:.05s;transition-timing-function:ease-in-out}a,div{outline:0}a:active,a:hover{color:#00a0d2}.wp-person a:focus .gravatar,a:focus,a:focus .media-icon img{color:#124964;box-shadow:0 0 0 1px #5b9dd9,0 0 2px 1px rgba(30,140,190,.8);outline:1px solid transparent}.ie8 a:focus{outline:#5b9dd9 solid 1px}#adminmenu a:focus{box-shadow:none;outline:1px solid transparent;outline-offset:-1px}.screen-reader-text:focus{box-shadow:none;outline:0}blockquote,q{quotes:none}blockquote:after,blockquote:before,q:after,q:before{content:"";content:none}p{font-size:13px;line-height:1.5;margin:1em 0}blockquote{margin:1em}dd,li{margin-bottom:6px}h1,h2,h3,h4,h5,h6{display:block;font-weight:600}h1{color:#23282d;font-size:2em;margin:.67em 0}h2,h3{color:#23282d;font-size:1.3em;margin:1em 0}.update-core-php h2{margin-top:2em}.update-messages h2,.update-php h2,h4{font-size:1em;margin:1.33em 0}h5{font-size:.83em;margin:1.67em 0}h6{font-size:.67em;margin:2.33em 0}ol,ul{padding:0}ul{list-style:none}ol{list-style-type:decimal;margin-right:2em}ul.ul-disc{list-style:disc outside}ul.ul-square{list-style:square outside}ol.ol-decimal{list-style:decimal outside}ol.ol-decimal,ul.ul-disc,ul.ul-square{margin-right:1.8em}ol.ol-decimal>li,ul.ul-disc>li,ul.ul-square>li{margin:0 0 .5em}.ltr{direction:ltr}.code,code{font-family:Consolas,Monaco,monospace;direction:ltr;unicode-bidi:embed}code,kbd{padding:3px 5px 2px 5px;margin:0 1px;background:#eaeaea;background:rgba(0,0,0,.07);font-size:13px}.subsubsub{list-style:none;margin:8px 0 0;padding:0;font-size:13px;float:right;color:#666}.subsubsub a{line-height:2;padding:.2em;text-decoration:none}.subsubsub a .count,.subsubsub a.current .count{color:#555d66;font-weight:400}.subsubsub a.current{font-weight:600;border:none}.subsubsub li{display:inline-block;margin:0;padding:0;white-space:nowrap}.widefat{border-spacing:0;width:100%;clear:both;margin:0}.widefat *{word-wrap:break-word}.widefat a,.widefat button.button-link{text-decoration:none}.widefat td,.widefat th{padding:8px 10px}.widefat thead td,.widefat thead th{border-bottom:1px solid #e1e1e1}.widefat tfoot td,.widefat tfoot th{border-top:1px solid #e1e1e1;border-bottom:none}.widefat .no-items td{border-bottom-width:0}.widefat td{vertical-align:top}.widefat td,.widefat td ol,.widefat td p,.widefat td ul{font-size:13px;line-height:1.5em}.widefat tfoot td,.widefat th,.widefat thead td{text-align:right;line-height:1.3em;font-size:14px}.updates-table td input,.widefat tfoot td input,.widefat th input,.widefat thead td input{margin:0 8px 0 0;padding:0;vertical-align:text-top}.widefat .check-column{width:2.2em;padding:6px 0 25px;vertical-align:top}.widefat tbody th.check-column{padding:9px 0 22px}.updates-table tbody td.check-column,.widefat tbody th.check-column,.widefat tfoot td.check-column,.widefat thead td.check-column{padding:11px 3px 0 0}.widefat tfoot td.check-column,.widefat thead td.check-column{padding-top:4px;vertical-align:middle}.update-php div.error,.update-php div.updated{margin-right:0}.no-js .widefat tfoot .check-column input,.no-js .widefat thead .check-column input{display:none}.column-comments,.column-links,.column-posts,.widefat .num{text-align:center}.widefat th#comments{vertical-align:middle}.wrap{margin:10px 2px 0 20px}.wrap.block-editor-no-js{padding-right:20px}.postbox .inside h2,.wrap [class$=icon32]+h2,.wrap h1,.wrap>h2:first-child{font-size:23px;font-weight:400;margin:0;padding:9px 0 4px 0;line-height:1.3}.wrap h1.wp-heading-inline{display:inline-block;margin-left:5px}.wp-header-end{visibility:hidden;margin:-2px 0 0}.subtitle{margin:0;padding-right:25px;color:#555d66;font-size:14px;font-weight:400;line-height:1}.wrap .add-new-h2,.wrap .add-new-h2:active,.wrap .page-title-action,.wrap .page-title-action:active{margin-right:4px;padding:4px 8px;position:relative;top:-3px;text-decoration:none;border:none;border:1px solid #ccc;border-radius:2px;background:#f7f7f7;text-shadow:none;font-weight:600;font-size:13px;line-height:normal;color:#0073aa;cursor:pointer}.wrap .wp-heading-inline+.page-title-action{margin-right:0}.wrap .add-new-h2:hover,.wrap .page-title-action:hover{border-color:#008ec2;background:#00a0d2;color:#fff}.page-title-action:focus{color:#124964}.wrap .page-title-action:focus{border-color:#5b9dd9;box-shadow:0 0 2px rgba(30,140,190,.8);outline:2px solid transparent}.wrap h1.long-header{padding-left:0}.wp-dialog{background-color:#fff}#available-widgets .widget-top:hover,#widgets-left .widget-in-question .widget-top,#widgets-left .widget-top:hover,.widgets-chooser ul,div#widgets-right .widget-top:hover{border-color:#999;box-shadow:0 1px 2px rgba(0,0,0,.1)}.sorthelper{background-color:#ccf3fa}.ac_match,.subsubsub a.current{color:#000}.alternate,.striped>tbody>:nth-child(odd),ul.striped>:nth-child(odd){background-color:#f9f9f9}.bar{background-color:#e8e8e8;border-left-color:#99d}.highlight{background-color:#e4f2fd;color:#000}.wp-ui-primary{color:#fff;background-color:#32373c}.wp-ui-text-primary{color:#32373c}.wp-ui-highlight{color:#fff;background-color:#1e8cbe}.wp-ui-text-highlight{color:#1e8cbe}.wp-ui-notification{color:#fff;background-color:#d54e21}.wp-ui-text-notification{color:#d54e21}.wp-ui-text-icon{color:#82878c}img.emoji{display:inline!important;border:none!important;height:1em!important;width:1em!important;margin:0 .07em!important;vertical-align:-.1em!important;background:0 0!important;padding:0!important;box-shadow:none!important}#nav-menu-footer,#nav-menu-header,#your-profile #rich_editing,.checkbox,.control-section .accordion-section-title,.menu-item-handle,.postbox .hndle,.side-info,.sidebar-name,.stuffbox .hndle,.widefat tfoot td,.widefat tfoot th,.widefat thead td,.widefat thead th,.widget .widget-top{line-height:1.4em}.menu-item-handle,.widget .widget-top{background:#fafafa;color:#23282d}.postbox .hndle,.stuffbox .hndle{border-bottom:1px solid #eee}.quicktags,.search{background-color:#ccc;color:#000;font-size:12px}.icon32{display:none}#bulk-titles div a:before,.notice-dismiss:before,.tagchecklist .ntdelbutton .remove-tag-icon:before,.welcome-panel .welcome-panel-close:before{background:0 0;color:#72777c;content:"\f153";display:block;font:normal 16px/20px dashicons;speak:none;height:20px;text-align:center;width:20px;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.welcome-panel .welcome-panel-close:before{margin:0}#bulk-titles div a:before{margin:1px 0}.tagchecklist .ntdelbutton .remove-tag-icon:before{margin-right:2px;border-radius:50%;color:#0073aa;line-height:1.28}.tagchecklist .ntdelbutton:focus{outline:0}#bulk-titles div a:focus:before,#bulk-titles div a:hover:before,.tagchecklist .ntdelbutton:focus .remove-tag-icon:before,.tagchecklist .ntdelbutton:hover .remove-tag-icon:before,.welcome-panel .welcome-panel-close:focus:before,.welcome-panel .welcome-panel-close:hover:before{color:#c00}.tagchecklist .ntdelbutton:focus .remove-tag-icon:before{box-shadow:0 0 0 1px #5b9dd9,0 0 2px 1px rgba(30,140,190,.8)}.key-labels label{line-height:24px}b,strong{font-weight:600}.pre{white-space:pre-wrap;word-wrap:break-word}.howto{color:#666;font-style:italic;display:block}p.install-help{margin:8px 0;font-style:italic}.no-break{white-space:nowrap}hr{border:0;border-top:1px solid #ddd;border-bottom:1px solid #fafafa}#all-plugins-table .plugins a.delete,#delete-link a.delete,#media-items a.delete,#media-items a.delete-permanently,#nav-menu-footer .menu-delete,#search-plugins-table .plugins a.delete,.plugins a.delete,.row-actions span.delete a,.row-actions span.spam a,.row-actions span.trash a,.submitbox .submitdelete{color:#a00}#all-plugins-table .plugins a.delete:hover,#delete-link a.delete:hover,#media-items a.delete-permanently:hover,#media-items a.delete:hover,#nav-menu-footer .menu-delete:hover,#search-plugins-table .plugins a.delete:hover,.file-error,.plugins a.delete:hover,.row-actions .delete a:hover,.row-actions .spam a:hover,.row-actions .trash a:hover,.submitbox .submitdelete:hover,abbr.required,span.required{color:#dc3232;border:none}#major-publishing-actions{padding:10px;clear:both;border-top:1px solid #ddd;background:#f5f5f5}#delete-action{float:right;line-height:2.1}#delete-link{line-height:2.1;vertical-align:middle;text-align:right;margin-right:8px}#delete-link a{text-decoration:none}#publishing-action{text-align:left;float:left;line-height:1.9}#publishing-action .spinner{float:right}#misc-publishing-actions{padding:6px 0 0}.misc-pub-section{padding:6px 10px 8px}.misc-pub-filename{word-wrap:break-word}#minor-publishing-actions{padding:10px 10px 0 10px;text-align:left}#save-post{float:right}.preview{float:left}#sticky-span{margin-right:18px}.approve,.unapproved .unapprove{display:none}.spam .approve,.trash .approve,.unapproved .approve{display:inline}td.action-links,th.action-links{text-align:left}#misc-publishing-actions .notice{margin-right:10px;margin-left:10px}.wp-filter{display:inline-block;position:relative;box-sizing:border-box;margin:12px 0 25px;padding:0 10px;width:100%;box-shadow:0 1px 1px rgba(0,0,0,.04);border:1px solid #e5e5e5;background:#fff;color:#555;font-size:13px}.wp-filter a{text-decoration:none}.filter-count{display:inline-block;vertical-align:middle;min-width:4em}.filter-count .count,.title-count{display:inline-block;position:relative;top:-1px;padding:4px 10px;border-radius:30px;background:#72777c;color:#fff;font-size:14px;font-weight:600}.title-count{display:inline;top:-3px;margin-right:5px;margin-left:20px}.filter-items{float:right}.filter-links{display:inline-block;margin:0}.filter-links li{display:inline-block;margin:0}.filter-links li>a{display:inline-block;margin:0 10px;padding:15px 0;border-bottom:4px solid #fff;color:#666;cursor:pointer}.filter-links .current{box-shadow:none;border-bottom:4px solid #666;color:#23282d}.filter-links li>a:focus,.filter-links li>a:hover,.show-filters .filter-links a.current:focus,.show-filters .filter-links a.current:hover{color:#00a0d2}.wp-filter .search-form{float:left;margin:10px 0}.wp-filter .search-form input[type=search]{margin:0;padding:3px 5px;width:280px;max-width:100%;font-size:16px;font-weight:300;line-height:1.5}.wp-filter .search-form select{margin:0;height:32px;vertical-align:top}.wp-filter .search-form.search-plugins{display:inline-block}.wp-filter .button.drawer-toggle{margin:10px 9px 0;padding:0 6px 0 10px;border-color:transparent;background-color:transparent;color:#666;vertical-align:baseline;box-shadow:none}.wp-filter .drawer-toggle:before{content:"\f111";margin:0 0 0 5px;color:#72777c;font:normal 16px/1 dashicons;vertical-align:text-bottom;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.wp-filter .button.drawer-toggle:focus,.wp-filter .button.drawer-toggle:hover,.wp-filter .drawer-toggle:focus:before,.wp-filter .drawer-toggle:hover:before{background-color:transparent;color:#00a0d2}.wp-filter .button.drawer-toggle:focus:active,.wp-filter .button.drawer-toggle:hover{border-color:transparent}.wp-filter .button.drawer-toggle:focus{border-color:#5b9dd9}.wp-filter .button.drawer-toggle:active{background:0 0;box-shadow:none;transform:none}.wp-filter .drawer-toggle.current:before{color:#fff}.filter-drawer,.wp-filter .favorites-form{display:none;margin:0 -20px 0 -10px;padding:20px;border-top:1px solid #eee;background:#fafafa;overflow:hidden}.show-favorites-form .favorites-form,.show-filters .filter-drawer{display:block}.show-filters .filter-links a.current{border-bottom:none}.show-filters .wp-filter .button.drawer-toggle{border-radius:2px;background:#72777c;color:#fff}.show-filters .wp-filter .drawer-toggle:focus,.show-filters .wp-filter .drawer-toggle:hover{background:#2ea2cc}.show-filters .wp-filter .drawer-toggle:before{color:#fff}.filter-group{box-sizing:border-box;position:relative;float:right;margin:0 0 0 1%;padding:20px 10px 10px;width:24%;background:#fff;border:1px solid #e5e5e5;box-shadow:0 1px 1px rgba(0,0,0,.04)}.filter-group legend{position:absolute;top:10px;display:block;margin:0;padding:0;font-size:1em;font-weight:600}.filter-drawer .filter-group-feature{margin:28px 0 0;list-style-type:none;font-size:12px}.filter-drawer .filter-group-feature input,.filter-drawer .filter-group-feature label{line-height:1.4}.filter-drawer .filter-group-feature input{position:absolute;margin:0}.filter-group .filter-group-feature label{display:block;margin:14px 23px 14px 0}.filter-drawer .buttons{clear:both;margin-bottom:20px}.filter-drawer .filter-group+.buttons{margin-bottom:0;padding-top:20px}.filter-drawer .buttons .button span{display:inline-block;opacity:.8;font-size:12px;text-indent:10px}.wp-filter .button.clear-filters{display:none;margin-right:10px}.wp-filter .button-link.edit-filters{padding:0 5px;line-height:2.2}.filtered-by{display:none;margin:0}.filtered-by>span{font-weight:600}.filtered-by a{margin-right:10px}.filtered-by .tags{display:inline}.filtered-by .tag{margin:0 5px;padding:4px 8px;border:1px solid #e5e5e5;box-shadow:0 1px 1px rgba(0,0,0,.04);background:#fff;font-size:11px}.filters-applied .filter-drawer .buttons,.filters-applied .filter-drawer br,.filters-applied .filter-group{display:none!important}.filters-applied .filtered-by{display:block}.filters-applied .filter-drawer{padding:20px}.error .content-filterable,.loading-content .content-filterable,.show-filters .content-filterable,.show-filters .favorites-form,.show-filters.filters-applied.loading-content .content-filterable{display:none}.show-filters.filters-applied .content-filterable{display:block}.loading-content .spinner{display:block;margin:40px auto 0;float:none}@media only screen and (max-width:1120px){.filter-drawer{border-bottom:1px solid #eee}.filter-group{margin-bottom:0;margin-top:5px;width:100%}.filter-group li{margin:10px 0}}@media only screen and (max-width:1000px){.filter-items{float:none}.wp-filter .media-toolbar-primary,.wp-filter .media-toolbar-secondary,.wp-filter .search-form{float:none;position:relative;max-width:100%}}@media only screen and (max-width:782px){.filter-group li{padding:0;width:50%}}@media only screen and (max-width:320px){.filter-count{display:none}.wp-filter .drawer-toggle{margin:10px 0}.filter-group li,.wp-filter .search-form input[type=search]{width:100%}}.notice,div.error,div.updated{background:#fff;border-right:4px solid #fff;box-shadow:0 1px 1px 0 rgba(0,0,0,.1);margin:5px 15px 2px;padding:1px 12px}div[class=update-message]{padding:.5em 0 .5em 12px}.form-table td .notice p,.notice p,.notice-title,div.error p,div.updated p{margin:.5em 0;padding:2px}.error a{text-decoration:underline}.updated a{padding-bottom:2px}.notice-alt{box-shadow:none}.notice-large{padding:10px 20px}.notice-title{display:inline-block;color:#23282d;font-size:18px}.wp-core-ui .notice.is-dismissible{padding-left:38px;position:relative}.notice-dismiss{position:absolute;top:0;left:1px;border:none;margin:0;padding:9px;background:0 0;color:#72777c;cursor:pointer}.notice-dismiss:active:before,.notice-dismiss:focus:before,.notice-dismiss:hover:before{color:#c00}.notice-dismiss:focus{outline:0;box-shadow:0 0 0 1px #5b9dd9,0 0 2px 1px rgba(30,140,190,.8)}.ie8 .notice-dismiss:focus{outline:1px solid #5b9dd9}.notice-success,div.updated{border-right-color:#46b450}.notice-success.notice-alt{background-color:#ecf7ed}.notice-warning{border-right-color:#ffb900}.notice-warning.notice-alt{background-color:#fff8e5}.notice-error,div.error{border-right-color:#dc3232}.notice-error.notice-alt{background-color:#fbeaea}.notice-info{border-right-color:#00a0d2}.notice-info.notice-alt{background-color:#e5f5fa}.button.installed:before,.button.installing:before,.button.updated-message:before,.button.updating-message:before,.import-php .updating-message:before,.update-message p:before,.updated-message p:before,.updating-message p:before{display:inline-block;font:normal 20px/1 dashicons;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;vertical-align:top}.media-upload-form .notice,.media-upload-form div.error,.wrap .notice,.wrap div.error,.wrap div.updated{margin:5px 0 15px}.wrap #templateside .notice{display:block;margin:0;padding:5px 8px;font-weight:600;text-decoration:none}.wrap #templateside span.notice{margin-right:-12px}#templateside li.notice a{padding:0}.button.installing:before,.button.updating-message:before,.import-php .updating-message:before,.update-message p:before,.updating-message p:before{color:#f56e28;content:"\f463"}.button.installing:before,.button.updating-message:before,.import-php .updating-message:before,.updating-message p:before{animation:rotation 2s infinite linear}.button.updated-message:before,.installed p:before,.updated-message p:before{color:#79ba49;content:"\f147"}.update-message.notice-error p:before{color:#dc3232;content:"\f534"}.import-php .updating-message:before,.wrap .notice p:before{margin-left:6px;vertical-align:bottom}#update-nag,.update-nag{display:inline-block;line-height:1.4;padding:11px 15px;font-size:14px;text-align:right;margin:25px 2px 0 20px;background-color:#fff;border-right:4px solid #ffba00;box-shadow:0 1px 1px 0 rgba(0,0,0,.1)}ul#dismissed-updates{display:none}#dismissed-updates li>p{margin-top:0}#dismiss,#undismiss{margin-right:.5em}form.upgrade{margin-top:8px}form.upgrade .hint{font-style:italic;font-size:85%;margin:-.5em 0 2em 0}.update-php .spinner{float:none;margin:-4px 0}#ajax-loading,.ajax-feedback,.ajax-loading,.imgedit-wait-spin,.list-ajax-loading{visibility:hidden}#ajax-response.alignleft{margin-right:2em}.button.installed:before,.button.installing:before,.button.updated-message:before,.button.updating-message:before{margin:3px -2px 0 5px}.button-primary.updating-message:before{color:#fff}.button-primary.updated-message:before{color:#66c6e4}.button.updated-message{transition-property:border,background,color;transition-duration:.05s;transition-timing-function:ease-in-out}@media aural{.button.installed:before,.button.installing:before,.update-message p:before,.wrap .notice p:before{speak:none}}#adminmenu a,#catlist a,#taglist a{text-decoration:none}#contextual-help-wrap,#screen-options-wrap{margin:0;padding:8px 20px 12px;position:relative}#contextual-help-wrap{overflow:auto;margin-right:0!important}#screen-meta-links{float:left;margin:0 0 0 20px}#screen-meta{display:none;margin:0 0 -1px 20px;position:relative;background-color:#fff;border:1px solid #ddd;border-top:none;box-shadow:0 1px 0 rgba(0,0,0,.025)}#contextual-help-link-wrap,#screen-options-link-wrap{float:right;margin:0 6px 0 0}#screen-meta-links .screen-meta-toggle{position:relative;top:0}#screen-meta-links .show-settings{border:1px solid #ddd;border-top:none;border-bottom-color:#ccc;height:auto;margin-bottom:0;padding:3px 16px 3px 6px;background:#fff;border-radius:0;color:#72777c;line-height:1.7;box-shadow:none}#screen-meta-links .show-settings:active,#screen-meta-links .show-settings:focus,#screen-meta-links .show-settings:hover{color:#32373c}#screen-meta-links .show-settings:focus{border-color:#5b9dd9;box-shadow:0 0 3px rgba(0,115,170,.8)}#screen-meta-links .show-settings:active{transform:none}#screen-meta-links .show-settings:after{left:0;content:"\f140";font:normal 20px/1 dashicons;speak:none;display:inline-block;padding:0 0 0 5px;bottom:2px;position:relative;vertical-align:bottom;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-decoration:none!important;color:#72777c}#screen-meta-links .screen-meta-active:after{content:"\f142"}.toggle-arrow{background-repeat:no-repeat;background-position:top right;background-color:transparent;height:22px;line-height:22px;display:block}.toggle-arrow-active{background-position:bottom right}#contextual-help-wrap h5,#screen-options-wrap h5,#screen-options-wrap legend{margin:0;padding:8px 0;font-size:13px;font-weight:600}.ie8 #screen-options-wrap legend{color:inherit}.metabox-prefs label{display:inline-block;padding-left:15px;line-height:2.35}#number-of-columns{display:inline-block;vertical-align:middle;line-height:30px}.metabox-prefs input[type=checkbox]{margin-top:0;margin-left:6px}.metabox-prefs label input,.metabox-prefs label input[type=checkbox]{margin:-4px 0 0 5px}.metabox-prefs .columns-prefs label input{margin:-1px 0 0 2px}.metabox-prefs label a{display:none}.metabox-prefs .screen-options input,.metabox-prefs .screen-options label{margin-top:0;margin-bottom:0;vertical-align:middle}.metabox-prefs .screen-options .screen-per-page{margin-left:15px}.metabox-prefs .screen-options label{line-height:2.2;padding-left:0}.screen-options+.screen-options{margin-top:10px}.metabox-prefs .submit{margin-top:1em;padding:0}#contextual-help-wrap{padding:0}#contextual-help-columns{position:relative}#contextual-help-back{position:absolute;top:0;bottom:0;right:150px;left:170px;border:1px solid #e1e1e1;border-top:none;border-bottom:none;background:#f6fbfd}#contextual-help-wrap.no-sidebar #contextual-help-back{left:0;border-left-width:0;border-bottom-left-radius:2px}.contextual-help-tabs{float:right;width:150px;margin:0}.contextual-help-tabs ul{margin:1em 0}.contextual-help-tabs li{margin-bottom:0;list-style-type:none;border-style:solid;border-width:0 2px 0 0;border-color:transparent}.contextual-help-tabs a{display:block;padding:5px 12px 5px 5px;line-height:1.4;text-decoration:none;border:1px solid transparent;border-left:none;border-right:none}.contextual-help-tabs a:hover{color:#32373c}.contextual-help-tabs .active{padding:0;margin:0 0 0 -1px;border-right:2px solid #00a0d2;background:#f6fbfd;box-shadow:0 2px 0 rgba(0,0,0,.02),0 1px 0 rgba(0,0,0,.02)}.contextual-help-tabs .active a{border-color:#e1e1e1;color:#32373c}.contextual-help-tabs-wrap{padding:0 20px;overflow:auto}.help-tab-content{display:none;margin:0 0 12px 22px;line-height:1.6}.help-tab-content.active{display:block}.help-tab-content ul li{list-style-type:disc;margin-right:18px}.contextual-help-sidebar{width:150px;float:left;padding:0 12px 0 8px;overflow:auto}html.wp-toolbar{padding-top:32px;box-sizing:border-box}.widefat td,.widefat th{color:#555}.widefat tfoot td,.widefat th,.widefat thead td{font-weight:400}.widefat tfoot tr td,.widefat tfoot tr th,.widefat thead tr td,.widefat thead tr th{color:#32373c}.widefat td p{margin:2px 0 .8em}.widefat ol,.widefat p,.widefat ul{color:#32373c}.widefat .column-comment p{margin:.6em 0}.widefat .column-comment ul{list-style:initial;margin-right:2em}.postbox-container{float:right}.postbox-container .meta-box-sortables{box-sizing:border-box}#wpbody-content .metabox-holder{padding-top:10px}.metabox-holder .postbox-container .empty-container{border:3px dashed #b4b9be;height:250px;position:relative}.metabox-holder .postbox-container .empty-container:after{content:attr(data-emptystring);margin:auto;position:absolute;top:0;right:0;bottom:0;left:0;height:1em;width:200px;text-align:center;color:#ccc;font-size:18px;display:none}.columns-2 #postbox-container-3 .empty-container,.columns-2 #postbox-container-4 .empty-container,.columns-3 #postbox-container-4 .empty-container,.metabox-holder.columns-1 .postbox-container .empty-container{border:0 none;height:0;min-height:0}#post-body-content{width:100%;min-width:463px;float:right}#post-body.columns-2 #postbox-container-1{float:left;margin-left:-300px;width:280px}#post-body.columns-2 #side-sortables{min-height:250px}@media only screen and (max-width:799px){#wpbody-content .metabox-holder .postbox-container .empty-container{border:0 none;height:0;min-height:0}}.js .postbox .hndle,.js .widget .widget-top{cursor:move}.hndle a{font-size:11px;font-weight:400}.postbox .handlediv{display:none;float:left;width:36px;height:36px;margin:0;padding:0;border:0;background:0 0;cursor:pointer}.js .postbox .handlediv{display:block}.sortable-placeholder{border:1px dashed #b4b9be;margin-bottom:20px}.postbox,.stuffbox{margin-bottom:20px;padding:0;line-height:1}.postbox .hndle,.stuffbox .hndle{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.postbox .inside{padding:0 12px 12px;line-height:1.4;font-size:13px}.stuffbox .inside{padding:0;line-height:1.4;font-size:13px;margin-top:0}.postbox .inside{margin:11px 0;position:relative}.postbox .inside>p:last-child,.rss-widget ul li:last-child{margin-bottom:1px!important}.postbox.closed h3{border:none;box-shadow:none}.postbox table.form-table{margin-bottom:0}.postbox table.widefat{box-shadow:none}.temp-border{border:1px dotted #ccc}.columns-prefs label{padding:0 0 0 10px}#adminmenu .wp-submenu li.current,#adminmenu .wp-submenu li.current a,#adminmenu .wp-submenu li.current a:hover,#dashboard_right_now .versions .b,#ed_reply_toolbar #ed_reply_strong,#pass-strength-result.short,#pass-strength-result.strong,#post-status-display,#post-visibility-display,.feature-filter .feature-name,.item-controls .item-order a,.media-item .percent,.plugins .name{font-weight:600}#wpfooter{position:absolute;bottom:0;right:0;left:0;padding:10px 20px;color:#555d66}#wpfooter p{font-size:13px;margin:0;line-height:1.55}#footer-thankyou{font-style:italic}.nav-tab{float:right;border:1px solid #ccc;border-bottom:none;margin-right:.5em;padding:5px 10px;font-size:14px;line-height:1.71428571;font-weight:600;background:#e5e5e5;color:#555;text-decoration:none;white-space:nowrap}.nav-tab-small .nav-tab,h3 .nav-tab{padding:5px 14px;font-size:12px;line-height:1.33}.nav-tab:focus,.nav-tab:hover{background-color:#fff;color:#444}.nav-tab-active,.nav-tab:focus:active{box-shadow:none}.nav-tab-active{margin-bottom:-1px;color:#444}.nav-tab-active,.nav-tab-active:focus,.nav-tab-active:focus:active,.nav-tab-active:hover{border-bottom:1px solid #f1f1f1;background:#f1f1f1;color:#000}.nav-tab-wrapper,.wrap h2.nav-tab-wrapper,h1.nav-tab-wrapper{border-bottom:1px solid #ccc;margin:0;padding-top:9px;padding-bottom:0;line-height:inherit}.nav-tab-wrapper:not(.wp-clearfix):after{content:"";display:table;clear:both}.ie8 .nav-tab-wrapper{display:inline-block;width:100%;vertical-align:top}.spinner{background:url(../images/spinner.gif) no-repeat;background-size:20px 20px;display:inline-block;visibility:hidden;float:left;vertical-align:middle;opacity:.7;filter:alpha(opacity=70);width:20px;height:20px;margin:4px 10px 0}.loading-content .spinner,.spinner.is-active{visibility:visible}#template>div{margin-left:16em}#template .notice{margin-top:1em;margin-left:3%}#template .notice p{width:auto}#template .submit .spinner{float:none}.metabox-holder .postbox>h3,.metabox-holder .stuffbox>h3,.metabox-holder h2.hndle,.metabox-holder h3.hndle{font-size:14px;padding:8px 12px;margin:0;line-height:1.4}.nav-menus-php .metabox-holder h3{padding:10px 14px 11px 10px;line-height:1.5}#templateside ul li a{text-decoration:none}.plugin-install #description,.plugin-install-network #description{width:60%}table .column-rating,table .column-visible,table .vers{text-align:right}.attention,.error-message{color:#dc3232;font-weight:600}body.iframe{height:98%}.lp-show-latest p{display:none}.lp-show-latest .lp-error p,.lp-show-latest p:last-child{display:block}.media-icon{width:62px;text-align:center}.media-icon img{border:1px solid #e5e5e5;border:1px solid rgba(0,0,0,.07)}#howto{font-size:11px;margin:0 5px;display:block}.importers{font-size:16px;width:auto}.importers td{padding-left:14px;line-height:1.4}.importers .import-system{max-width:250px}.importers td.desc{max-width:500px}.importer-action,.importer-desc,.importer-title{display:block}.importer-title{color:#000;font-size:14px;font-weight:400;margin-bottom:.2em}.importer-action{line-height:1.55;color:#555;margin-bottom:1em}#post-body #post-body-content #namediv h2,#post-body #post-body-content #namediv h3{margin-top:0}.edit-comment-author{color:#222;border-bottom:1px solid #eee}#namediv h2 label,#namediv h3 label{vertical-align:baseline}#namediv table{width:100%}#namediv td.first{width:10px;white-space:nowrap}#namediv input{width:98%}#namediv p{margin:10px 0}#submitdiv h3{margin-bottom:0!important}.zerosize{height:0;width:0;margin:0;border:0;padding:0;overflow:hidden;position:absolute}br.clear{height:2px;line-height:.15}.checkbox{border:none;margin:0;padding:0}fieldset{border:0;padding:0;margin:0}.post-categories{display:inline;margin:0;padding:0}.post-categories li{display:inline}div.star-holder{position:relative;height:17px;width:100px;background:url(../images/stars.png?ver=20121108) repeat-x bottom left}div.star-holder .star-rating{background:url(../images/stars.png?ver=20121108) repeat-x top left;height:17px;float:right}.star-rating{white-space:nowrap}.star-rating .star{display:inline-block;width:20px;height:20px;-webkit-font-smoothing:antialiased;font-size:20px;line-height:1;font-family:dashicons;text-decoration:inherit;font-weight:400;font-style:normal;vertical-align:top;transition:color .1s ease-in;text-align:center;color:#ffb900}.star-rating .star-full:before{content:"\f155"}.star-rating .star-half:before{content:"\f459"}.rtl .star-rating .star-half{transform:rotateY(180deg)}.star-rating .star-empty:before{content:"\f154"}div.action-links{font-weight:400;margin:6px 0 0}#plugin-information{background:#fff;position:fixed;top:0;left:0;bottom:0;right:0;height:100%;padding:0}#plugin-information-scrollable{overflow:auto;-webkit-overflow-scrolling:touch;height:100%}#plugin-information-title{padding:0 26px;background:#f5f5f5;font-size:22px;font-weight:600;line-height:2.4;position:relative;height:56px}#plugin-information-title.with-banner{margin-left:0;height:250px;background-size:cover}#plugin-information-title h2{font-size:1em;font-weight:600;padding:0;margin:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}#plugin-information-title.with-banner h2{position:relative;font-family:"Helvetica Neue",sans-serif;display:inline-block;font-size:30px;line-height:1.68;box-sizing:border-box;max-width:100%;padding:0 15px;margin-top:174px;color:#fff;background:rgba(30,30,30,.9);text-shadow:0 1px 3px rgba(0,0,0,.4);box-shadow:0 0 30px rgba(255,255,255,.1);border-radius:8px}#plugin-information-title div.vignette{display:none}#plugin-information-title.with-banner div.vignette{position:absolute;display:block;top:0;right:0;height:250px;width:100%;background:0 0;box-shadow:inset 0 0 50px 4px rgba(0,0,0,.2),inset 0 -1px 0 rgba(0,0,0,.1)}#plugin-information-tabs{padding:0 16px;position:relative;left:0;right:0;min-height:36px;font-size:0;z-index:1;border-bottom:1px solid #ddd;background:#f3f3f3}#plugin-information-tabs a{position:relative;display:inline-block;padding:9px 10px;margin:0;height:18px;line-height:1.3;font-size:14px;text-decoration:none;transition:none}#plugin-information-tabs a.current{margin:0 -1px -1px;background:#fff;border:1px solid #ddd;border-bottom-color:#fff;padding-top:8px;color:#32373c}#plugin-information-tabs.with-banner a.current{border-top:none;padding-top:9px}#plugin-information-tabs a:active,#plugin-information-tabs a:focus{outline:0}#plugin-information-content{overflow:hidden;background:#fff;position:relative;top:0;left:0;right:0;min-height:100%;min-height:calc(100% - 152px)}#plugin-information-content.with-banner{min-height:calc(100% - 346px)}#section-holder{position:relative;top:0;left:250px;bottom:0;right:0;margin-top:10px;margin-left:250px;padding:10px 26px;margin-bottom:-99939px;padding-bottom:99999px}#section-holder .notice{margin:5px 0 15px}#section-holder .updated{margin:16px 0}#plugin-information .fyi{float:left;position:relative;top:0;left:0;padding:16px;margin-bottom:-99939px;padding-bottom:99999px;width:217px;border-right:1px solid #ddd;background:#f3f3f3;color:#666}#plugin-information .fyi strong{color:#444}#plugin-information .fyi h3{font-weight:600;text-transform:uppercase;font-size:12px;color:#666;margin:24px 0 8px}#plugin-information .fyi h2{font-size:.9em;margin-bottom:0;margin-left:0}#plugin-information .fyi ul{padding:0;margin:0;list-style:none}#plugin-information .fyi li{margin:0 0 10px}#plugin-information .fyi-description{margin-top:0}#plugin-information .counter-container{margin:3px 0}#plugin-information .counter-label{float:right;margin-left:5px;min-width:55px}#plugin-information .counter-back{height:17px;width:92px;background-color:#e5e5e5;float:right}#plugin-information .counter-bar{height:17px;background-color:#ffc733;float:right}#plugin-information .counter-count{margin-right:5px}#plugin-information .fyi ul.contributors{margin-top:10px}#plugin-information .fyi ul.contributors li{display:inline-block;margin-left:8px;vertical-align:middle}#plugin-information .fyi ul.contributors li{display:inline-block;margin-left:8px;vertical-align:middle}#plugin-information .fyi ul.contributors li img{vertical-align:middle;margin-left:4px}#plugin-information-footer{padding:13px 16px;position:absolute;left:0;bottom:0;right:0;height:33px;border-top:1px solid #ddd;background:#f3f3f3}#plugin-information .section{direction:ltr}#plugin-information .section ol,#plugin-information .section ul{list-style-type:disc;margin-left:24px}#plugin-information .section,#plugin-information .section p{font-size:14px;line-height:1.7}#plugin-information #section-screenshots ol{list-style:none;margin:0}#plugin-information #section-screenshots li img{vertical-align:text-top;margin-top:16px;max-width:100%;width:auto;height:auto;box-shadow:0 1px 2px rgba(0,0,0,.3)}#plugin-information #section-screenshots li p{font-style:italic;padding-left:20px}#plugin-information pre{padding:7px;overflow:auto;border:1px solid #ccc}#plugin-information blockquote{border-right:2px solid #ddd;color:#666;font-style:italic;margin:1em 0;padding:0 1em 0 0}#plugin-information .review{overflow:hidden;width:100%;margin-bottom:20px;border-bottom:1px solid #e5e5e5}#plugin-information .review-title-section{overflow:hidden}#plugin-information .review-title-section h4{display:inline-block;float:left;margin:0 6px 0 0}#plugin-information .reviewer-info p{clear:both;margin:0;padding-top:2px}#plugin-information .reviewer-info .avatar{float:left;margin:4px 6px 0 0}#plugin-information .reviewer-info .star-rating{float:left}#plugin-information .review-meta{float:left;margin-left:.75em}#plugin-information .review-body{float:left;width:100%}.plugin-version-author-uri{font-size:13px}.update-php .button.button-primary{margin-left:1em}@media screen and (max-width:771px){#plugin-information-title.with-banner{height:100px}#plugin-information-title.with-banner h2{margin-top:30px;font-size:20px;line-height:2;max-width:85%}#plugin-information-title.with-banner div.vignette{height:100px}#plugin-information-tabs{overflow:hidden;padding:0;height:auto}#plugin-information-tabs a.current{margin-bottom:0;border-bottom:none}#plugin-information .fyi{float:none;border:1px solid #ddd;position:static;width:auto;margin:26px 26px 0;padding-bottom:0}#section-holder{position:static;margin:0;padding-bottom:70px}#plugin-information .fyi h3,#plugin-information .fyi small{display:none}#plugin-information-footer{padding:12px 16px 0;height:46px}}#TB_window.plugin-details-modal{background:#fcfcfc}#TB_window.plugin-details-modal.thickbox-loading:before{content:"";display:block;width:20px;height:20px;position:absolute;right:50%;top:50%;z-index:-1;margin:-10px -10px 0 0;background:#fcfcfc url(../images/spinner.gif) no-repeat center;background-size:20px 20px;transform:translateZ(0)}@media print,(-webkit-min-device-pixel-ratio:1.25),(min-resolution:120dpi){#TB_window.plugin-details-modal.thickbox-loading:before{background-image:url(../images/spinner-2x.gif)}}.plugin-details-modal #TB_title{float:right;height:1px}.plugin-details-modal #TB_ajaxWindowTitle{display:none}.plugin-details-modal #TB_closeWindowButton{right:auto;left:-30px;color:#eee}.plugin-details-modal #TB_closeWindowButton:focus,.plugin-details-modal #TB_closeWindowButton:hover{color:#00a0d2;outline:0;box-shadow:none}.plugin-details-modal .tb-close-icon{display:none}.plugin-details-modal #TB_closeWindowButton:after{content:"\f335";font:normal 32px/29px dashicons;speak:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}@media screen and (max-width:830px){.plugin-details-modal #TB_closeWindowButton{left:0;top:-30px}}img{border:none}.bulk-action-notice .toggle-indicator:before,.js .meta-box-sortables .postbox .toggle-indicator:before,.privacy-text-box .toggle-indicator:before,.sidebar-name .toggle-indicator:before{content:"\f142";display:inline-block;font:normal 20px/1 dashicons;speak:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-decoration:none!important}.bulk-action-notice .bulk-action-errors-collapsed .toggle-indicator:before,.js .meta-box-sortables .postbox.closed .handlediv .toggle-indicator:before,.js .widgets-holder-wrap.closed .toggle-indicator:before,.privacy-text-box.closed .toggle-indicator:before{content:"\f140"}.js .postbox .handlediv .toggle-indicator:before{margin-top:4px;width:20px;border-radius:50%;text-indent:-1px}.rtl.js .postbox .handlediv .toggle-indicator:before{text-indent:1px}.bulk-action-notice .toggle-indicator:before{line-height:16px;vertical-align:top;color:#72777c}.js .postbox .handlediv:focus{box-shadow:none;outline:0}.js .postbox .handlediv:focus .toggle-indicator:before{box-shadow:0 0 0 1px #5b9dd9,0 0 2px 1px rgba(30,140,190,.8)}#photo-add-url-div input[type=text]{width:300px}.alignleft h2{margin:0}#template textarea{font-family:Consolas,Monaco,monospace;font-size:13px;background:#f9f9f9;-moz-tab-size:4;-o-tab-size:4;tab-size:4}#template .CodeMirror,#template textarea{width:100%;min-height:60vh;height:calc(100vh - 295px);border:1px solid #ddd;box-sizing:border-box}#templateside>h2{padding-top:6px;padding-bottom:7px;margin:0}#templateside ol,#templateside ul{margin:0;padding:0}#templateside>ul{box-sizing:border-box;margin-top:0;overflow:auto;padding:0;min-height:60vh;height:calc(100vh - 295px);background-color:#f7f7f7;border:1px solid #ddd;border-right:none}#templateside ul ul{padding-right:12px}#templateside>ul>li>ul[role=group]{padding-right:0}[role=treeitem][aria-expanded=false]>ul{display:none}[role=treeitem] span[aria-hidden]{display:inline;font-family:dashicons;font-size:20px;position:absolute;pointer-events:none}[role=treeitem][aria-expanded=false]>.folder-label .icon:after{content:"\f141"}[role=treeitem][aria-expanded=true]>.folder-label .icon:after{content:"\f140"}[role=treeitem] .folder-label{display:block;padding:3px 12px 3px 3px;cursor:pointer}[role=treeitem]{outline:0}[role=treeitem] .folder-label.focus{color:#124964;box-shadow:0 0 0 1px #5b9dd9,0 0 2px 1px rgba(30,140,190,.8)}[role=treeitem] .folder-label.hover,[role=treeitem].hover{background-color:#eaeaea}.tree-folder{margin:0;position:relative}[role=treeitem] li{position:relative}.tree-folder .tree-folder::after{content:"";display:block;position:absolute;right:2px;border-right:1px solid #ccc;top:-13px;bottom:10px}.tree-folder>li::before{content:"";position:absolute;display:block;border-right:1px solid #ccc;right:2px;top:-5px;height:18px;width:7px;border-bottom:1px solid #ccc}.tree-folder>li::after{content:"";position:absolute;display:block;border-right:1px solid #ccc;right:2px;bottom:-7px;top:0}#templateside .current-file{margin:-4px 0 -2px}.tree-folder>.current-file::before{right:4px;height:15px;width:0;border-right:none;top:3px}.tree-folder>.current-file::after{bottom:-4px;height:7px;right:2px;top:auto}.tree-folder li:last-child>.tree-folder::after,.tree-folder>li:last-child::after{display:none}#theme-plugin-editor-label{display:inline-block;margin-bottom:1em;font-weight:600}#docs-list,#template textarea{direction:ltr}.fileedit-sub #plugin,.fileedit-sub #theme{max-width:40%}.fileedit-sub .alignright{text-align:left}#template p{width:97%}#file-editor-linting-error{margin-top:1em;margin-bottom:1em}#file-editor-linting-error>.notice{margin:0;display:inline-block}#file-editor-linting-error>.notice>p{width:auto}#template .submit{margin-top:1em;padding:0}#template .submit input[type=submit][disabled]{cursor:not-allowed}#templateside{float:left;width:16em;word-wrap:break-word}#postcustomstuff p.submit{margin:0}#templateside h4{margin:1em 0 0}#templateside li{margin:4px 0}#templateside li:not(.howto) a,.theme-editor-php .highlight{display:block;padding:3px 12px 3px 0;text-decoration:none}#templateside li:not(.howto)>a:first-of-type{padding-top:0}#templateside li.howto{padding:6px 12px 12px 12px}.theme-editor-php .highlight{margin:-3px -12px -3px 3px}#templateside .highlight{border:none;font-weight:600}.nonessential{color:#666;font-size:11px;font-style:italic;padding-right:12px}#documentation{margin-top:10px}#documentation label{line-height:1.8;vertical-align:baseline;font-weight:600}.fileedit-sub{padding:10px 0 8px;line-height:180%}#file-editor-warning .file-editor-warning-content{margin:25px}.accordion-section-title:after,.control-section .accordion-section-title:after,.nav-menus-php .item-edit:before,.widget-top .widget-action .toggle-indicator:before{content:"\f140";font:normal 20px/1 dashicons;speak:none;display:block;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-decoration:none!important}.widget-top .widget-action .toggle-indicator:before{padding:1px 0 1px 2px;border-radius:50%}.accordion-section-title:after,.handlediv,.item-edit,.postbox .handlediv.button-link,.toggle-indicator{color:#72777c}.widget-action{color:#555d66}.accordion-section-title:hover:after,.handlediv:focus,.handlediv:hover,.item-edit:focus,.item-edit:hover,.postbox .handlediv.button-link:focus,.postbox .handlediv.button-link:hover,.sidebar-name:hover .toggle-indicator,.widget-action:focus,.widget-top:hover .widget-action{color:#23282d}.widget-top .widget-action:focus .toggle-indicator:before{box-shadow:0 0 0 1px #5b9dd9,0 0 2px 1px rgba(30,140,190,.8)}.accordion-section-title:after,.control-section .accordion-section-title:after{float:left;left:20px;top:-2px}#customize-info.open .accordion-section-title:after,.control-section.open .accordion-section-title:after,.nav-menus-php .menu-item-edit-active .item-edit:before,.widget.open .widget-top .widget-action .toggle-indicator:before,.widget.widget-in-question .widget-top .widget-action .toggle-indicator:before{content:"\f142"}/*!
+ * jQuery UI Draggable/Sortable 1.11.4
+ * http://jqueryui.com
+ *
+ * Copyright jQuery Foundation and other contributors
+ * Released under the MIT license.
+ * http://jquery.org/license
+ */.ui-draggable-handle,.ui-sortable-handle{touch-action:none}.accordion-section{border-bottom:1px solid #ddd;margin:0}.accordion-section.open .accordion-section-content,.no-js .accordion-section .accordion-section-content{display:block}.accordion-section.open:hover{border-bottom-color:#ddd}.accordion-section-content{display:none;padding:10px 20px 15px;overflow:hidden;background:#fff}.accordion-section-title{margin:0;padding:12px 15px 15px;position:relative;border-right:1px solid #ddd;border-left:1px solid #ddd;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.js .accordion-section-title{cursor:pointer}.js .accordion-section-title:after{position:absolute;top:12px;left:10px;z-index:1}.accordion-section-title:focus{outline:0}.accordion-section-title:focus:after,.accordion-section-title:hover:after{border-color:#a0a5aa transparent}.cannot-expand .accordion-section-title{cursor:auto}.cannot-expand .accordion-section-title:after{display:none}.control-section .accordion-section-title,.customize-pane-child .accordion-section-title{border-right:none;border-left:none;padding:10px 14px 11px 10px;line-height:1.55;background:#fff}.control-section .accordion-section-title:after,.customize-pane-child .accordion-section-title:after{top:calc(50% - 10px)}.js .control-section .accordion-section-title:focus,.js .control-section .accordion-section-title:hover,.js .control-section.open .accordion-section-title,.js .control-section:hover .accordion-section-title{color:#23282d;background:#f5f5f5}.control-section.open .accordion-section-title{border-bottom:1px solid #ddd}.network-admin .edit-site-actions{margin-top:0}.my-sites{display:block;overflow:auto;zoom:1}.my-sites li{display:block;padding:8px 3%;min-height:130px;margin:0}@media only screen and (max-width:599px){.my-sites li{min-height:0}}@media only screen and (min-width:600px){.my-sites.striped li{background-color:#fff;position:relative}.my-sites.striped li:after{content:"";width:1px;height:100%;position:absolute;top:0;left:0;background:#ccc}}@media only screen and (min-width:600px) and (max-width:699px){.my-sites li{float:right;width:44%}.my-sites.striped li{background-color:#fff}.my-sites.striped li:nth-of-type(2n+1){clear:right}.my-sites.striped li:nth-of-type(2n+2):after{content:none}.my-sites li:nth-of-type(4n+1),.my-sites li:nth-of-type(4n+2){background-color:#f9f9f9}}@media only screen and (min-width:700px) and (max-width:1199px){.my-sites li{float:right;width:27.333333%;background-color:#fff}.my-sites.striped li:nth-of-type(3n+3):after{content:none}.my-sites li:nth-of-type(6n+1),.my-sites li:nth-of-type(6n+2),.my-sites li:nth-of-type(6n+3){background-color:#f9f9f9}}@media only screen and (min-width:1200px) and (max-width:1399px){.my-sites li{float:right;width:21%;padding:8px 2%;background-color:#fff}.my-sites.striped li:nth-of-type(4n+1){clear:right}.my-sites.striped li:nth-of-type(4n+4):after{content:none}.my-sites li:nth-of-type(8n+1),.my-sites li:nth-of-type(8n+2),.my-sites li:nth-of-type(8n+3),.my-sites li:nth-of-type(8n+4){background-color:#f9f9f9}}@media only screen and (min-width:1400px) and (max-width:1599px){.my-sites li{float:right;width:16%;padding:8px 2%;background-color:#fff}.my-sites.striped li:nth-of-type(5n+1){clear:right}.my-sites.striped li:nth-of-type(5n+5):after{content:none}.my-sites li:nth-of-type(10n+1),.my-sites li:nth-of-type(10n+2),.my-sites li:nth-of-type(10n+3),.my-sites li:nth-of-type(10n+4),.my-sites li:nth-of-type(10n+5){background-color:#f9f9f9}}@media only screen and (min-width:1600px){.my-sites li{float:right;width:12.666666%;padding:8px 2%;background-color:#fff}.my-sites.striped li:nth-of-type(6n+1){clear:right}.my-sites.striped li:nth-of-type(6n+6):after{content:none}.my-sites li:nth-of-type(12n+1),.my-sites li:nth-of-type(12n+2),.my-sites li:nth-of-type(12n+3),.my-sites li:nth-of-type(12n+4),.my-sites li:nth-of-type(12n+5),.my-sites li:nth-of-type(12n+6){background-color:#f9f9f9}}.my-sites li a{text-decoration:none}@media print,(-webkit-min-device-pixel-ratio:1.25),(min-resolution:120dpi){div.star-holder,div.star-holder .star-rating{background:url(../images/stars-2x.png?ver=20121108) repeat-x bottom left;background-size:21px 37px}.spinner{background-image:url(../images/spinner-2x.gif)}#bulk-titles div a,#bulk-titles div a:hover,#screen-meta-links a.show-settings,.curtime #timestamp,.meta-box-sortables .postbox:hover .handlediv,.sidebar-name .toggle-indicator,.sidebar-name:hover .toggle-indicator,.widget-top .widget-action,.widget-top .widget-action:hover{background:0 0!important}}@-ms-viewport{width:device-width}@media screen and (max-width:782px){html.wp-toolbar{padding-top:46px}.screen-reader-shortcut:focus{top:-39px}body{min-width:240px;overflow-x:hidden}body *{-webkit-tap-highlight-color:rgba(0,0,0,0)!important}#wpcontent{position:relative;margin-right:0;padding-right:10px}#wpbody-content{padding-bottom:100px}.wrap{clear:both;margin-left:12px;margin-right:0}#col-left,#col-right{float:none;width:auto}#col-left .col-wrap,#col-right .col-wrap{padding:0}#collapse-menu,.post-format-select{display:none!important}.wrap h1.wp-heading-inline{margin-bottom:.5em}.wrap .add-new-h2,.wrap .add-new-h2:active,.wrap .page-title-action,.wrap .page-title-action:active{padding:10px 15px;font-size:14px;white-space:nowrap}.media-upload-form div.error,.notice,.wrap div.error,.wrap div.updated{margin:20px 0 10px 0;padding:5px 10px;font-size:14px;line-height:175%}.wp-core-ui .notice.is-dismissible{padding-left:46px}.notice-dismiss{padding:13px}.wrap .icon32+h2{margin-top:-2px}.wp-responsive-open #wpbody{left:-16em}code{word-wrap:break-word}.postbox{font-size:14px}.metabox-holder .postbox>h3,.metabox-holder .stuffbox>h3,.metabox-holder h2,.metabox-holder h3.hndle{padding:12px}.postbox .handlediv{margin-top:3px}.subsubsub{font-size:16px;text-align:center;margin-bottom:15px}#template .CodeMirror,#template textarea{box-sizing:border-box}#templateside{float:none;width:auto}#templateside>ul{border-right:1px solid #ddd}#templateside li{margin:0}#templateside li:not(.howto) a{display:block;padding:5px}#templateside li.howto{padding:12px}#templateside .highlight{padding:5px;margin-right:-5px;margin-top:-5px}#template .notice,#template>div{float:none;margin:1em 0;width:auto}#template .CodeMirror,#template textarea{width:100%}#templateside ul ul{padding-right:1.5em}[role=treeitem] .folder-label{display:block;padding:5px}.tree-folder .tree-folder::after,.tree-folder>li::after,.tree-folder>li::before{right:-8px}.tree-folder>li::before{top:0;height:13px}.tree-folder>.current-file::before{right:-5px;top:7px;width:4px}.tree-folder>.current-file::after{height:9px;right:-8px}.wrap #templateside span.notice{margin-right:-5px;width:100%}.fileedit-sub .alignright{float:right;margin-top:15px;width:100%;text-align:right}.fileedit-sub .alignright label{display:block}.fileedit-sub #plugin,.fileedit-sub #theme{margin-right:0;max-width:70%}.fileedit-sub input[type=submit]{margin-bottom:0;padding:8px 18px}#documentation label[for=docs-list]{display:block}#documentation select[name=docs-list]{margin-right:0;max-width:60%}#documentation input[type=button]{margin-bottom:0;padding:8px 18px}#wpfooter{display:none}#comments-form .checkforspam{display:none}.edit-comment-author{margin:2px 0 0}.filter-drawer .filter-group-feature input,.filter-drawer .filter-group-feature label{line-height:2.1}.filter-drawer .filter-group-feature label{margin-right:32px}.wp-filter .button.drawer-toggle{font-size:13px;line-height:2;height:28px}#screen-meta #contextual-help-wrap{overflow:visible}#screen-meta #contextual-help-back,#screen-meta .contextual-help-sidebar{display:none}#screen-meta .contextual-help-tabs{clear:both;width:100%;float:none}#screen-meta .contextual-help-tabs ul{margin:0 0 1em;padding:1em 0 0}#screen-meta .contextual-help-tabs .active{margin:0}#screen-meta .contextual-help-tabs-wrap{clear:both;max-width:100%;float:none}#screen-meta-links{margin-bottom:20px}}@media screen and (max-width:600px){#wpwrap.wp-responsive-open{overflow-x:hidden}html.wp-toolbar{padding-top:0}.screen-reader-shortcut:focus{top:7px}#wpbody{padding-top:46px}div#post-body.metabox-holder.columns-1{overflow-x:hidden}.nav-tab-wrapper,.wrap h2.nav-tab-wrapper,h1.nav-tab-wrapper{border-bottom:0}h1 .nav-tab,h2 .nav-tab,h3 .nav-tab,nav .nav-tab{margin:10px 0 0 10px;border-bottom:1px solid #ccc}.nav-tab-active:focus,.nav-tab-active:focus:active,.nav-tab-active:hover{border-bottom:1px solid #ccc}}@media screen and (max-width:320px){#network_dashboard_right_now .subsubsub{font-size:14px;text-align:right}} \ No newline at end of file
diff --git a/www/crm/wp-admin/css/common.css b/www/crm/wp-admin/css/common.css
new file mode 100644
index 00000000..83101367
--- /dev/null
+++ b/www/crm/wp-admin/css/common.css
@@ -0,0 +1,4041 @@
+/* 2 column liquid layout */
+#wpwrap {
+ height: auto;
+ min-height: 100%;
+ width: 100%;
+ position: relative;
+ -webkit-font-smoothing: subpixel-antialiased;
+}
+
+#wpcontent {
+ height: 100%;
+ padding-left: 20px;
+}
+
+#wpcontent,
+#wpfooter {
+ margin-left: 160px;
+}
+
+.folded #wpcontent,
+.folded #wpfooter {
+ margin-left: 36px;
+}
+
+#wpbody-content {
+ padding-bottom: 65px;
+ float: left;
+ width: 100%;
+ overflow: visible !important;
+}
+
+/* inner 2 column liquid layout */
+
+.inner-sidebar {
+ float: right;
+ clear: right;
+ display: none;
+ width: 281px;
+ position: relative;
+}
+
+.columns-2 .inner-sidebar {
+ margin-right: auto;
+ width: 286px;
+ display: block;
+}
+
+.inner-sidebar #side-sortables,
+.columns-2 .inner-sidebar #side-sortables {
+ min-height: 300px;
+ width: 280px;
+ padding: 0;
+}
+
+.has-right-sidebar .inner-sidebar {
+ display: block;
+}
+
+.has-right-sidebar #post-body {
+ float: left;
+ clear: left;
+ width: 100%;
+ margin-right: -2000px;
+}
+
+.has-right-sidebar #post-body-content {
+ margin-right: 300px;
+ float: none;
+ width: auto;
+}
+
+/* 2 columns main area */
+
+#col-left {
+ float: left;
+ width: 35%;
+}
+
+#col-right {
+ float: right;
+ width: 65%;
+}
+
+#col-left .col-wrap {
+ padding: 0 6px 0 0;
+}
+
+#col-right .col-wrap {
+ padding: 0 0 0 6px;
+}
+
+/* utility classes */
+.alignleft {
+ float: left;
+}
+
+.alignright {
+ float: right;
+}
+
+.textleft {
+ text-align: left;
+}
+
+.textright {
+ text-align: right;
+}
+
+.clear {
+ clear: both;
+}
+
+/* modern clearfix */
+.wp-clearfix:after {
+ content: "";
+ display: table;
+ clear: both;
+}
+
+/* Hide visually but not from screen readers */
+.screen-reader-text,
+.screen-reader-text span,
+.ui-helper-hidden-accessible {
+ border: 0;
+ clip: rect(1px, 1px, 1px, 1px);
+ -webkit-clip-path: inset(50%);
+ clip-path: inset(50%);
+ height: 1px;
+ margin: -1px;
+ overflow: hidden;
+ padding: 0;
+ position: absolute;
+ width: 1px;
+ word-wrap: normal !important; /* many screen reader and browser combinations announce broken words as they would appear visually */
+}
+
+.button .screen-reader-text {
+ height: auto; /* Fixes a Safari+VoiceOver bug, see ticket #42006 */
+}
+
+.screen-reader-shortcut {
+ position: absolute;
+ top: -1000em;
+}
+
+.screen-reader-shortcut:focus {
+ left: 6px;
+ top: -25px;
+ height: auto;
+ width: auto;
+ display: block;
+ font-size: 14px;
+ font-weight: 600;
+ padding: 15px 23px 14px;
+ background: #f1f1f1;
+ color: #0073aa;
+ z-index: 100000;
+ line-height: normal;
+ box-shadow: 0 0 2px 2px rgba(0, 0, 0, 0.6);
+ text-decoration: none;
+ /* Only visible in Windows High Contrast mode */
+ outline: 2px solid transparent;
+ outline-offset: -2px;
+}
+
+.hidden,
+.js .closed .inside,
+.js .hide-if-js,
+.no-js .hide-if-no-js,
+.js.wp-core-ui .hide-if-js,
+.js .wp-core-ui .hide-if-js,
+.no-js.wp-core-ui .hide-if-no-js,
+.no-js .wp-core-ui .hide-if-no-js {
+ display: none;
+}
+
+/* @todo: Take a second look. Large chunks of shared color, from the colors.css merge */
+.widget-top,
+.menu-item-handle,
+.widget-inside,
+#menu-settings-column .accordion-container,
+#menu-management .menu-edit,
+.manage-menus,
+table.widefat,
+.stuffbox,
+p.popular-tags,
+.widgets-holder-wrap,
+.wp-editor-container,
+.popular-tags,
+.feature-filter,
+.imgedit-group,
+.comment-ays {
+ border: 1px solid #e5e5e5;
+ box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
+}
+
+table.widefat,
+.wp-editor-container,
+.stuffbox,
+p.popular-tags,
+.widgets-holder-wrap,
+.popular-tags,
+.feature-filter,
+.imgedit-group,
+.comment-ays {
+ background: #fff;
+}
+
+/* general */
+html,
+body {
+ height: 100%;
+ margin: 0;
+ padding: 0;
+}
+
+body {
+ background: #f1f1f1;
+ color: #444;
+ font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
+ font-size: 13px;
+ line-height: 1.4em;
+ min-width: 600px;
+}
+
+body.iframe {
+ min-width: 0;
+ padding-top: 1px;
+}
+
+body.modal-open {
+ overflow: hidden;
+}
+
+body.mobile.modal-open #wpwrap {
+ overflow: hidden;
+ position: fixed;
+ height: 100%;
+}
+
+iframe,
+img {
+ border: 0;
+}
+
+td {
+ font-family: inherit;
+ font-size: inherit;
+ font-weight: inherit;
+ line-height: inherit;
+}
+
+/* Any change to the default link style must be applied to button-link too. */
+a {
+ color: #0073aa;
+ transition-property: border, background, color;
+ transition-duration: .05s;
+ transition-timing-function: ease-in-out;
+}
+
+a,
+div {
+ outline: 0;
+}
+
+a:hover,
+a:active {
+ color: #00a0d2;
+}
+
+a:focus,
+a:focus .media-icon img,
+.wp-person a:focus .gravatar {
+ color: #124964;
+ box-shadow:
+ 0 0 0 1px #5b9dd9,
+ 0 0 2px 1px rgba(30, 140, 190, 0.8);
+ /* Only visible in Windows High Contrast mode */
+ outline: 1px solid transparent;
+}
+
+.ie8 a:focus {
+ outline: #5b9dd9 solid 1px;
+}
+
+#adminmenu a:focus {
+ box-shadow: none;
+ /* Only visible in Windows High Contrast mode */
+ outline: 1px solid transparent;
+ outline-offset: -1px;
+}
+
+.screen-reader-text:focus {
+ box-shadow: none;
+ outline: none;
+}
+
+blockquote,
+q {
+ quotes: none;
+}
+
+blockquote:before,
+blockquote:after,
+q:before,
+q:after {
+ content: "";
+ content: none;
+}
+
+p {
+ font-size: 13px;
+ line-height: 1.5;
+ margin: 1em 0;
+}
+
+blockquote {
+ margin: 1em;
+}
+
+li,
+dd {
+ margin-bottom: 6px;
+}
+
+h1,
+h2,
+h3,
+h4,
+h5,
+h6 {
+ display: block;
+ font-weight: 600;
+}
+
+h1 {
+ color: #23282d;
+ font-size: 2em;
+ margin: .67em 0;
+}
+
+h2,
+h3 {
+ color: #23282d;
+ font-size: 1.3em;
+ margin: 1em 0;
+}
+
+.update-core-php h2 {
+ margin-top: 2em;
+}
+
+.update-php h2,
+.update-messages h2,
+h4 {
+ font-size: 1em;
+ margin: 1.33em 0;
+}
+
+h5 {
+ font-size: 0.83em;
+ margin: 1.67em 0;
+}
+
+h6 {
+ font-size: 0.67em;
+ margin: 2.33em 0;
+}
+
+ul,
+ol {
+ padding: 0;
+}
+
+ul {
+ list-style: none;
+}
+
+ol {
+ list-style-type: decimal;
+ margin-left: 2em;
+}
+
+ul.ul-disc {
+ list-style: disc outside;
+}
+
+ul.ul-square {
+ list-style: square outside;
+}
+
+ol.ol-decimal {
+ list-style: decimal outside;
+}
+
+ul.ul-disc,
+ul.ul-square,
+ol.ol-decimal {
+ margin-left: 1.8em;
+}
+
+ul.ul-disc > li,
+ul.ul-square > li,
+ol.ol-decimal > li {
+ margin: 0 0 0.5em;
+}
+
+/* rtl:ignore */
+.ltr {
+ direction: ltr;
+}
+
+/* rtl:ignore */
+.code,
+code {
+ font-family: Consolas, Monaco, monospace;
+ direction: ltr;
+ unicode-bidi: embed;
+}
+
+kbd,
+code {
+ padding: 3px 5px 2px 5px;
+ margin: 0 1px;
+ background: #eaeaea;
+ background: rgba(0, 0, 0, 0.07);
+ font-size: 13px;
+}
+
+.subsubsub {
+ list-style: none;
+ margin: 8px 0 0;
+ padding: 0;
+ font-size: 13px;
+ float: left;
+ color: #666;
+}
+
+.subsubsub a {
+ line-height: 2;
+ padding: .2em;
+ text-decoration: none;
+}
+
+.subsubsub a .count,
+.subsubsub a.current .count {
+ color: #555d66; /* #f1f1f1 background */
+ font-weight: 400;
+}
+
+.subsubsub a.current {
+ font-weight: 600;
+ border: none;
+}
+
+.subsubsub li {
+ display: inline-block;
+ margin: 0;
+ padding: 0;
+ white-space: nowrap;
+}
+
+/* .widefat - main style for tables */
+.widefat {
+ border-spacing: 0;
+ width: 100%;
+ clear: both;
+ margin: 0;
+}
+
+.widefat * {
+ word-wrap: break-word;
+}
+
+.widefat a,
+.widefat button.button-link {
+ text-decoration: none;
+}
+
+.widefat td,
+.widefat th {
+ padding: 8px 10px;
+}
+
+.widefat thead th,
+.widefat thead td {
+ border-bottom: 1px solid #e1e1e1;
+}
+
+.widefat tfoot th,
+.widefat tfoot td {
+ border-top: 1px solid #e1e1e1;
+ border-bottom: none;
+}
+
+.widefat .no-items td {
+ border-bottom-width: 0;
+}
+
+.widefat td {
+ vertical-align: top;
+}
+
+.widefat td,
+.widefat td p,
+.widefat td ol,
+.widefat td ul {
+ font-size: 13px;
+ line-height: 1.5em;
+}
+
+.widefat th,
+.widefat thead td,
+.widefat tfoot td {
+ text-align: left;
+ line-height: 1.3em;
+ font-size: 14px;
+}
+
+.widefat th input,
+.updates-table td input,
+.widefat thead td input,
+.widefat tfoot td input {
+ margin: 0 0 0 8px;
+ padding: 0;
+ vertical-align: text-top;
+}
+
+.widefat .check-column {
+ width: 2.2em;
+ padding: 6px 0 25px;
+ vertical-align: top;
+}
+
+.widefat tbody th.check-column {
+ padding: 9px 0 22px;
+}
+
+.widefat thead td.check-column,
+.widefat tbody th.check-column,
+.updates-table tbody td.check-column,
+.widefat tfoot td.check-column {
+ padding: 11px 0 0 3px;
+}
+
+.widefat thead td.check-column,
+.widefat tfoot td.check-column {
+ padding-top: 4px;
+ vertical-align: middle;
+}
+
+.update-php div.updated,
+.update-php div.error {
+ margin-left: 0;
+}
+
+.no-js .widefat thead .check-column input,
+.no-js .widefat tfoot .check-column input {
+ display: none;
+}
+
+.widefat .num,
+.column-comments,
+.column-links,
+.column-posts {
+ text-align: center;
+}
+
+.widefat th#comments {
+ vertical-align: middle;
+}
+
+.wrap {
+ margin: 10px 20px 0 2px;
+}
+
+.wrap.block-editor-no-js {
+ padding-left: 20px;
+}
+
+.wrap > h2:first-child, /* Back-compat for pre-4.4 */
+.wrap [class$="icon32"] + h2, /* Back-compat for pre-4.4 */
+.postbox .inside h2, /* Back-compat for pre-4.4 */
+.wrap h1 {
+ font-size: 23px;
+ font-weight: 400;
+ margin: 0;
+ padding: 9px 0 4px 0;
+ line-height: 1.3;
+}
+
+.wrap h1.wp-heading-inline {
+ display: inline-block;
+ margin-right: 5px;
+}
+
+.wp-header-end {
+ visibility: hidden;
+ margin: -2px 0 0;
+}
+
+.subtitle {
+ margin: 0;
+ padding-left: 25px;
+ color: #555d66;
+ font-size: 14px;
+ font-weight: 400;
+ line-height: 1;
+}
+
+.wrap .add-new-h2, /* deprecated */
+.wrap .add-new-h2:active, /* deprecated */
+.wrap .page-title-action,
+.wrap .page-title-action:active {
+ margin-left: 4px;
+ padding: 4px 8px;
+ position: relative;
+ top: -3px;
+ text-decoration: none;
+ border: none;
+ border: 1px solid #ccc;
+ border-radius: 2px;
+ background: #f7f7f7;
+ text-shadow: none;
+ font-weight: 600;
+ font-size: 13px;
+ line-height: normal; /* IE8-IE11 need this for buttons */
+ color: #0073aa; /* some of these controls are button elements and don't inherit from links */
+ cursor: pointer;
+}
+
+.wrap .wp-heading-inline + .page-title-action {
+ margin-left: 0;
+}
+
+.wrap .add-new-h2:hover, /* deprecated */
+.wrap .page-title-action:hover {
+ border-color: #008EC2;
+ background: #00a0d2;
+ color: #fff;
+}
+
+/* lower specificity: color needs to be overridden by :hover and :active */
+.page-title-action:focus {
+ color: #124964;
+}
+
+.wrap .page-title-action:focus {
+ border-color: #5b9dd9;
+ box-shadow: 0 0 2px rgba(30, 140, 190, 0.8);
+ /* Only visible in Windows High Contrast mode */
+ outline: 2px solid transparent;
+}
+
+.wrap h1.long-header {
+ padding-right: 0;
+}
+
+.wp-dialog {
+ background-color: #fff;
+}
+
+.widgets-chooser ul,
+#widgets-left .widget-in-question .widget-top,
+#available-widgets .widget-top:hover,
+div#widgets-right .widget-top:hover,
+#widgets-left .widget-top:hover {
+ border-color: #999;
+ box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
+}
+
+.sorthelper {
+ background-color: #ccf3fa;
+}
+
+.ac_match,
+.subsubsub a.current {
+ color: #000;
+}
+
+.striped > tbody > :nth-child(odd),
+ul.striped > :nth-child(odd),
+.alternate {
+ background-color: #f9f9f9;
+}
+
+.bar {
+ background-color: #e8e8e8;
+ border-right-color: #99d;
+}
+
+/* Helper classes for plugins to leverage the active WordPress color scheme */
+
+.highlight {
+ background-color: #e4f2fd;
+ color: #000;
+}
+
+.wp-ui-primary {
+ color: #fff;
+ background-color: #32373c;
+}
+.wp-ui-text-primary {
+ color: #32373c;
+}
+
+.wp-ui-highlight {
+ color: #fff;
+ background-color: #1e8cbe;
+}
+.wp-ui-text-highlight {
+ color: #1e8cbe;
+}
+
+.wp-ui-notification {
+ color: #fff;
+ background-color: #d54e21;
+}
+.wp-ui-text-notification {
+ color: #d54e21;
+}
+
+.wp-ui-text-icon {
+ color: #82878c; /* same as new icons */
+}
+
+/* For emoji replacement images */
+img.emoji {
+ display: inline !important;
+ border: none !important;
+ height: 1em !important;
+ width: 1em !important;
+ margin: 0 .07em !important;
+ vertical-align: -0.1em !important;
+ background: none !important;
+ padding: 0 !important;
+ box-shadow: none !important;
+}
+
+/*------------------------------------------------------------------------------
+ 1.0 - Text Styles
+------------------------------------------------------------------------------*/
+
+.widget .widget-top,
+.postbox .hndle,
+.stuffbox .hndle,
+.control-section .accordion-section-title,
+.sidebar-name,
+#nav-menu-header,
+#nav-menu-footer,
+.menu-item-handle,
+.checkbox,
+.side-info,
+#your-profile #rich_editing,
+.widefat thead th,
+.widefat thead td,
+.widefat tfoot th,
+.widefat tfoot td {
+ line-height: 1.4em;
+}
+
+.widget .widget-top,
+.menu-item-handle {
+ background: #fafafa;
+ color: #23282d;
+}
+
+.postbox .hndle,
+.stuffbox .hndle {
+ border-bottom: 1px solid #eee;
+}
+
+.quicktags,
+.search {
+ background-color: #ccc;
+ color: #000;
+ font-size: 12px;
+}
+
+.icon32 {
+ display: none;
+}
+
+/* @todo can we combine these into a class or use an existing dashicon one? */
+.welcome-panel .welcome-panel-close:before,
+.tagchecklist .ntdelbutton .remove-tag-icon:before,
+#bulk-titles div a:before,
+.notice-dismiss:before {
+ background: none;
+ color: #72777c;
+ content: "\f153";
+ display: block;
+ font: normal 16px/20px dashicons;
+ speak: none;
+ height: 20px;
+ text-align: center;
+ width: 20px;
+ -webkit-font-smoothing: antialiased;
+ -moz-osx-font-smoothing: grayscale;
+}
+
+.welcome-panel .welcome-panel-close:before {
+ margin: 0;
+}
+
+#bulk-titles div a:before {
+ margin: 1px 0;
+}
+
+.tagchecklist .ntdelbutton .remove-tag-icon:before {
+ margin-left: 2px;
+ border-radius: 50%;
+ color: #0073aa;
+ /* vertically center the icon cross browsers */
+ line-height: 1.28;
+}
+
+.tagchecklist .ntdelbutton:focus {
+ outline: 0;
+}
+
+.welcome-panel .welcome-panel-close:hover:before,
+.welcome-panel .welcome-panel-close:focus:before,
+.tagchecklist .ntdelbutton:hover .remove-tag-icon:before,
+.tagchecklist .ntdelbutton:focus .remove-tag-icon:before,
+#bulk-titles div a:hover:before,
+#bulk-titles div a:focus:before {
+ color: #c00;
+}
+
+.tagchecklist .ntdelbutton:focus .remove-tag-icon:before {
+ box-shadow:
+ 0 0 0 1px #5b9dd9,
+ 0 0 2px 1px rgba(30, 140, 190, 0.8);
+}
+
+.key-labels label {
+ line-height: 24px;
+}
+
+strong, b {
+ font-weight: 600;
+}
+
+.pre {
+ /* https://developer.mozilla.org/en-US/docs/CSS/white-space */
+ white-space: pre-wrap; /* css-3 */
+ word-wrap: break-word; /* IE 5.5 - 7 */
+}
+
+.howto {
+ color: #666;
+ font-style: italic;
+ display: block;
+}
+
+p.install-help {
+ margin: 8px 0;
+ font-style: italic;
+}
+
+.no-break {
+ white-space: nowrap;
+}
+
+hr {
+ border: 0;
+ border-top: 1px solid #ddd;
+ border-bottom: 1px solid #fafafa;
+}
+
+.row-actions span.delete a,
+.row-actions span.trash a,
+.row-actions span.spam a,
+.plugins a.delete,
+#all-plugins-table .plugins a.delete,
+#search-plugins-table .plugins a.delete,
+.submitbox .submitdelete,
+#media-items a.delete,
+#media-items a.delete-permanently,
+#nav-menu-footer .menu-delete,
+#delete-link a.delete {
+ color: #a00;
+}
+
+abbr.required,
+span.required,
+.file-error,
+.row-actions .delete a:hover,
+.row-actions .trash a:hover,
+.row-actions .spam a:hover,
+.plugins a.delete:hover,
+#all-plugins-table .plugins a.delete:hover,
+#search-plugins-table .plugins a.delete:hover,
+.submitbox .submitdelete:hover,
+#media-items a.delete:hover,
+#media-items a.delete-permanently:hover,
+#nav-menu-footer .menu-delete:hover,
+#delete-link a.delete:hover {
+ color: #dc3232;
+ border: none;
+}
+
+/*------------------------------------------------------------------------------
+ 3.0 - Actions
+------------------------------------------------------------------------------*/
+
+#major-publishing-actions {
+ padding: 10px;
+ clear: both;
+ border-top: 1px solid #ddd;
+ background: #f5f5f5;
+}
+
+#delete-action {
+ float: left;
+ line-height: 2.1;
+}
+
+#delete-link {
+ line-height: 2.1;
+ vertical-align: middle;
+ text-align: left;
+ margin-left: 8px;
+}
+
+#delete-link a {
+ text-decoration: none;
+}
+
+#publishing-action {
+ text-align: right;
+ float: right;
+ line-height: 1.9;
+}
+
+#publishing-action .spinner {
+ float: left;
+}
+
+#misc-publishing-actions {
+ padding: 6px 0 0;
+}
+
+.misc-pub-section {
+ padding: 6px 10px 8px;
+}
+
+.misc-pub-filename {
+ word-wrap: break-word;
+}
+
+#minor-publishing-actions {
+ padding: 10px 10px 0 10px;
+ text-align: right;
+}
+
+#save-post {
+ float: left;
+}
+
+.preview {
+ float: right;
+}
+
+#sticky-span {
+ margin-left: 18px;
+}
+
+.approve,
+.unapproved .unapprove {
+ display: none;
+}
+
+.unapproved .approve,
+.spam .approve,
+.trash .approve {
+ display: inline;
+}
+
+td.action-links,
+th.action-links {
+ text-align: right;
+}
+
+#misc-publishing-actions .notice {
+ margin-left: 10px;
+ margin-right: 10px;
+}
+
+/* Filter bar */
+.wp-filter {
+ display: inline-block;
+ position: relative;
+ box-sizing: border-box;
+ margin: 12px 0 25px;
+ padding: 0 10px;
+ width: 100%;
+ box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
+ border: 1px solid #e5e5e5;
+ background: #fff;
+ color: #555;
+ font-size: 13px;
+}
+
+.wp-filter a {
+ text-decoration: none;
+}
+
+.filter-count {
+ display: inline-block;
+ vertical-align: middle;
+ min-width: 4em;
+}
+
+.title-count,
+.filter-count .count {
+ display: inline-block;
+ position: relative;
+ top: -1px;
+ padding: 4px 10px;
+ border-radius: 30px;
+ background: #72777c;
+ color: #fff;
+ font-size: 14px;
+ font-weight: 600;
+}
+
+/* not a part of filter bar, but derived from it, so here for now */
+.title-count {
+ display: inline;
+ top: -3px;
+ margin-left: 5px;
+ margin-right: 20px;
+}
+
+.filter-items {
+ float: left;
+}
+
+.filter-links {
+ display: inline-block;
+ margin: 0;
+}
+
+.filter-links li {
+ display: inline-block;
+ margin: 0;
+}
+
+.filter-links li > a {
+ display: inline-block;
+ margin: 0 10px;
+ padding: 15px 0;
+ border-bottom: 4px solid #fff;
+ color: #666;
+ cursor: pointer;
+}
+
+.filter-links .current {
+ box-shadow: none;
+ border-bottom: 4px solid #666;
+ color: #23282d;
+}
+
+.filter-links li > a:hover,
+.filter-links li > a:focus,
+.show-filters .filter-links a.current:hover,
+.show-filters .filter-links a.current:focus {
+ color: #00a0d2;
+}
+
+.wp-filter .search-form {
+ float: right;
+ margin: 10px 0;
+}
+
+.wp-filter .search-form input[type="search"] {
+ margin: 0;
+ padding: 3px 5px;
+ width: 280px;
+ max-width: 100%;
+ font-size: 16px;
+ font-weight: 300;
+ line-height: 1.5;
+}
+
+.wp-filter .search-form select {
+ margin: 0;
+ height: 32px;
+ vertical-align: top;
+}
+
+.wp-filter .search-form.search-plugins {
+ display: inline-block;
+}
+
+.wp-filter .button.drawer-toggle {
+ margin: 10px 9px 0;
+ padding: 0 10px 0 6px;
+ border-color: transparent;
+ background-color: transparent;
+ color: #666;
+ vertical-align: baseline;
+ box-shadow: none;
+}
+
+.wp-filter .drawer-toggle:before {
+ content: "\f111";
+ margin: 0 5px 0 0;
+ color: #72777c;
+ font: normal 16px/1 dashicons;
+ vertical-align: text-bottom;
+ -webkit-font-smoothing: antialiased;
+ -moz-osx-font-smoothing: grayscale;
+}
+
+.wp-filter .button.drawer-toggle:hover,
+.wp-filter .drawer-toggle:hover:before,
+.wp-filter .button.drawer-toggle:focus,
+.wp-filter .drawer-toggle:focus:before {
+ background-color: transparent;
+ color: #00a0d2;
+}
+
+.wp-filter .button.drawer-toggle:hover,
+.wp-filter .button.drawer-toggle:focus:active {
+ border-color: transparent;
+}
+
+.wp-filter .button.drawer-toggle:focus {
+ border-color: #5b9dd9;
+}
+
+.wp-filter .button.drawer-toggle:active {
+ background: transparent;
+ box-shadow: none;
+ transform: none;
+}
+
+.wp-filter .drawer-toggle.current:before {
+ color: #fff;
+}
+
+.filter-drawer,
+.wp-filter .favorites-form {
+ display: none;
+ margin: 0 -10px 0 -20px;
+ padding: 20px;
+ border-top: 1px solid #eee;
+ background: #fafafa;
+ overflow: hidden;
+}
+
+.show-filters .filter-drawer,
+.show-favorites-form .favorites-form {
+ display: block;
+}
+
+.show-filters .filter-links a.current {
+ border-bottom: none;
+}
+
+.show-filters .wp-filter .button.drawer-toggle {
+ border-radius: 2px;
+ background: #72777c;
+ color: #fff;
+}
+
+.show-filters .wp-filter .drawer-toggle:hover,
+.show-filters .wp-filter .drawer-toggle:focus {
+ background: rgb(46, 162, 204);
+}
+
+.show-filters .wp-filter .drawer-toggle:before {
+ color: #fff;
+}
+
+.filter-group {
+ box-sizing: border-box;
+ position: relative;
+ float: left;
+ margin: 0 1% 0 0;
+ padding: 20px 10px 10px;
+ width: 24%;
+ background: #fff;
+ border: 1px solid #e5e5e5;
+ box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
+}
+
+.filter-group legend {
+ position: absolute;
+ top: 10px;
+ display: block;
+ margin: 0;
+ padding: 0;
+ font-size: 1em;
+ font-weight: 600;
+}
+
+.filter-drawer .filter-group-feature {
+ margin: 28px 0 0;
+ list-style-type: none;
+ font-size: 12px;
+}
+
+.filter-drawer .filter-group-feature input,
+.filter-drawer .filter-group-feature label {
+ line-height: 1.4;
+}
+
+.filter-drawer .filter-group-feature input {
+ position: absolute;
+ margin: 0;
+}
+
+.filter-group .filter-group-feature label {
+ display: block;
+ margin: 14px 0px 14px 23px;
+}
+
+.filter-drawer .buttons {
+ clear: both;
+ margin-bottom: 20px;
+}
+
+.filter-drawer .filter-group + .buttons {
+ margin-bottom: 0;
+ padding-top: 20px;
+}
+
+.filter-drawer .buttons .button span {
+ display: inline-block;
+ opacity: 0.8;
+ font-size: 12px;
+ text-indent: 10px;
+}
+
+.wp-filter .button.clear-filters {
+ display: none;
+ margin-left: 10px;
+}
+
+.wp-filter .button-link.edit-filters {
+ padding: 0 5px;
+ line-height: 2.2;
+}
+
+.filtered-by {
+ display: none;
+ margin: 0;
+}
+
+.filtered-by > span {
+ font-weight: 600;
+}
+
+.filtered-by a {
+ margin-left: 10px;
+}
+
+.filtered-by .tags {
+ display: inline;
+}
+
+.filtered-by .tag {
+ margin: 0 5px;
+ padding: 4px 8px;
+ border: 1px solid #e5e5e5;
+ box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
+ background: #fff;
+ font-size: 11px;
+}
+
+.filters-applied .filter-group,
+.filters-applied .filter-drawer .buttons,
+.filters-applied .filter-drawer br {
+ display: none !important;
+}
+
+.filters-applied .filtered-by {
+ display: block;
+}
+
+.filters-applied .filter-drawer {
+ padding: 20px;
+}
+
+.show-filters .favorites-form,
+.show-filters .content-filterable,
+.show-filters.filters-applied.loading-content .content-filterable,
+.loading-content .content-filterable,
+.error .content-filterable {
+ display: none;
+}
+
+.show-filters.filters-applied .content-filterable {
+ display: block;
+}
+
+.loading-content .spinner {
+ display: block;
+ margin: 40px auto 0;
+ float: none;
+}
+
+@media only screen and (max-width: 1120px) {
+ .filter-drawer {
+ border-bottom: 1px solid #eee;
+ }
+
+ .filter-group {
+ margin-bottom: 0;
+ margin-top: 5px;
+ width: 100%;
+ }
+
+ .filter-group li {
+ margin: 10px 0;
+ }
+}
+
+@media only screen and (max-width: 1000px) {
+ .filter-items {
+ float: none;
+ }
+
+ .wp-filter .media-toolbar-primary,
+ .wp-filter .media-toolbar-secondary,
+ .wp-filter .search-form {
+ float: none; /* Remove float from media-views.css */
+ position: relative;
+ max-width: 100%;
+ }
+}
+
+@media only screen and (max-width: 782px) {
+ .filter-group li {
+ padding: 0;
+ width: 50%;
+ }
+}
+
+@media only screen and (max-width: 320px) {
+ .filter-count {
+ display: none;
+ }
+
+ .wp-filter .drawer-toggle {
+ margin: 10px 0;
+ }
+
+ .filter-group li,
+ .wp-filter .search-form input[type="search"] {
+ width: 100%;
+ }
+}
+
+/*------------------------------------------------------------------------------
+ 4.0 - Notifications
+------------------------------------------------------------------------------*/
+
+.notice,
+div.updated,
+div.error {
+ background: #fff;
+ border-left: 4px solid #fff;
+ box-shadow: 0 1px 1px 0 rgba(0, 0, 0, 0.1);
+ margin: 5px 15px 2px;
+ padding: 1px 12px;
+}
+
+div[class="update-message"] { /* back-compat for pre-4.6 */
+ padding: 0.5em 12px 0.5em 0;
+}
+
+.notice p,
+.notice-title,
+div.updated p,
+div.error p,
+.form-table td .notice p {
+ margin: 0.5em 0;
+ padding: 2px;
+}
+
+.error a {
+ text-decoration: underline;
+}
+
+.updated a {
+ padding-bottom: 2px;
+}
+
+.notice-alt {
+ box-shadow: none;
+}
+
+.notice-large {
+ padding: 10px 20px;
+}
+
+.notice-title {
+ display: inline-block;
+ color: #23282d;
+ font-size: 18px;
+}
+
+.wp-core-ui .notice.is-dismissible {
+ padding-right: 38px;
+ position: relative;
+}
+
+.notice-dismiss {
+ position: absolute;
+ top: 0;
+ right: 1px;
+ border: none;
+ margin: 0;
+ padding: 9px;
+ background: none;
+ color: #72777c;
+ cursor: pointer;
+}
+
+.notice-dismiss:hover:before,
+.notice-dismiss:active:before,
+.notice-dismiss:focus:before {
+ color: #c00;
+}
+
+.notice-dismiss:focus {
+ outline: none;
+ box-shadow: 0 0 0 1px #5b9dd9, 0 0 2px 1px rgba(30, 140, 190, 0.8);
+}
+
+.ie8 .notice-dismiss:focus {
+ outline: 1px solid #5b9dd9;
+}
+
+.notice-success,
+div.updated {
+ border-left-color: #46b450;
+}
+
+.notice-success.notice-alt {
+ background-color: #ecf7ed;
+}
+
+.notice-warning {
+ border-left-color: #ffb900;
+}
+
+.notice-warning.notice-alt {
+ background-color: #fff8e5;
+}
+
+.notice-error,
+div.error {
+ border-left-color: #dc3232;
+}
+
+.notice-error.notice-alt {
+ background-color: #fbeaea;
+}
+
+.notice-info {
+ border-left-color: #00a0d2;
+}
+
+.notice-info.notice-alt {
+ background-color: #e5f5fa;
+}
+
+.update-message p:before,
+.updating-message p:before,
+.updated-message p:before,
+.import-php .updating-message:before,
+.button.updating-message:before,
+.button.updated-message:before,
+.button.installed:before,
+.button.installing:before {
+ display: inline-block;
+ font: normal 20px/1 'dashicons';
+ -webkit-font-smoothing: antialiased;
+ -moz-osx-font-smoothing: grayscale;
+ vertical-align: top;
+}
+
+.wrap .notice,
+.wrap div.updated,
+.wrap div.error,
+.media-upload-form .notice,
+.media-upload-form div.error {
+ margin: 5px 0 15px;
+}
+
+.wrap #templateside .notice {
+ display: block;
+ margin: 0;
+ padding: 5px 8px;
+ font-weight: 600;
+ text-decoration: none;
+}
+
+.wrap #templateside span.notice {
+ margin-left: -12px;
+}
+
+#templateside li.notice a {
+ padding: 0;
+}
+
+/* Update icon. */
+.update-message p:before,
+.updating-message p:before,
+.import-php .updating-message:before,
+.button.updating-message:before,
+.button.installing:before {
+ color: #f56e28;
+ content: "\f463";
+}
+
+/* Spins the update icon. */
+.updating-message p:before,
+.import-php .updating-message:before,
+.button.updating-message:before,
+.button.installing:before {
+ animation: rotation 2s infinite linear;
+}
+
+/* Updated icon (check mark). */
+.updated-message p:before,
+.installed p:before,
+.button.updated-message:before {
+ color: #79ba49;
+ content: "\f147";
+}
+
+/* Error icon. */
+.update-message.notice-error p:before {
+ color: #dc3232;
+ content: "\f534";
+}
+
+.wrap .notice p:before,
+.import-php .updating-message:before {
+ margin-right: 6px;
+ vertical-align: bottom;
+}
+
+#update-nag,
+.update-nag {
+ display: inline-block;
+ line-height: 1.4;
+ padding: 11px 15px;
+ font-size: 14px;
+ text-align: left;
+ margin: 25px 20px 0 2px;
+ background-color: #fff;
+ border-left: 4px solid #ffba00;
+ box-shadow: 0 1px 1px 0 rgba(0, 0, 0, 0.1);
+}
+
+ul#dismissed-updates {
+ display: none;
+}
+
+#dismissed-updates li > p {
+ margin-top: 0;
+}
+
+#dismiss,
+#undismiss {
+ margin-left: 0.5em;
+}
+
+form.upgrade {
+ margin-top: 8px;
+}
+
+form.upgrade .hint {
+ font-style: italic;
+ font-size: 85%;
+ margin: -0.5em 0 2em 0;
+}
+
+.update-php .spinner {
+ float: none;
+ margin: -4px 0;
+}
+
+#ajax-loading,
+.ajax-loading,
+.ajax-feedback,
+.imgedit-wait-spin,
+.list-ajax-loading { /* deprecated */
+ visibility: hidden;
+}
+
+#ajax-response.alignleft {
+ margin-left: 2em;
+}
+
+.button.updating-message:before,
+.button.updated-message:before,
+.button.installed:before,
+.button.installing:before {
+ margin: 3px 5px 0 -2px;
+}
+
+.button-primary.updating-message:before {
+ color: #fff;
+}
+
+.button-primary.updated-message:before {
+ color: #66c6e4;
+}
+
+.button.updated-message {
+ transition-property: border, background, color;
+ transition-duration: .05s;
+ transition-timing-function: ease-in-out;
+}
+
+@media aural {
+ .wrap .notice p:before,
+ .button.installing:before,
+ .button.installed:before,
+ .update-message p:before {
+ speak: none;
+ }
+}
+
+
+/* @todo: this does not need its own section anymore */
+/*------------------------------------------------------------------------------
+ 6.0 - Admin Header
+------------------------------------------------------------------------------*/
+#adminmenu a,
+#taglist a,
+#catlist a {
+ text-decoration: none;
+}
+
+/*------------------------------------------------------------------------------
+ 6.1 - Screen Options Tabs
+------------------------------------------------------------------------------*/
+
+#screen-options-wrap,
+#contextual-help-wrap {
+ margin: 0;
+ padding: 8px 20px 12px;
+ position: relative;
+}
+
+#contextual-help-wrap {
+ overflow: auto;
+ margin-left: 0 !important;
+}
+
+#screen-meta-links {
+ float: right;
+ margin: 0 20px 0 0;
+}
+
+/* screen options and help tabs revert */
+#screen-meta {
+ display: none;
+ margin: 0 20px -1px 0px;
+ position: relative;
+ background-color: #fff;
+ border: 1px solid #ddd;
+ border-top: none;
+ box-shadow: 0 1px 0 rgba(0, 0, 0, 0.025);
+}
+
+#screen-options-link-wrap,
+#contextual-help-link-wrap {
+ float: left;
+ margin: 0 0 0 6px;
+}
+
+#screen-meta-links .screen-meta-toggle {
+ position: relative;
+ top: 0;
+}
+
+#screen-meta-links .show-settings {
+ border: 1px solid #ddd;
+ border-top: none;
+ border-bottom-color: #ccc;
+ height: auto;
+ margin-bottom: 0;
+ padding: 3px 6px 3px 16px;
+ background: #fff;
+ border-radius: 0;
+ color: #72777c;
+ line-height: 1.7;
+ box-shadow: none;
+}
+
+#screen-meta-links .show-settings:hover,
+#screen-meta-links .show-settings:active,
+#screen-meta-links .show-settings:focus {
+ color: #32373c;
+}
+
+#screen-meta-links .show-settings:focus {
+ border-color: #5b9dd9;
+ box-shadow: 0 0 3px rgba(0, 115, 170, 0.8);
+}
+
+#screen-meta-links .show-settings:active {
+ transform: none;
+}
+
+#screen-meta-links .show-settings:after {
+ right: 0;
+ content: "\f140";
+ font: normal 20px/1 dashicons;
+ speak: none;
+ display: inline-block;
+ padding: 0 5px 0 0;
+ bottom: 2px;
+ position: relative;
+ vertical-align: bottom;
+ -webkit-font-smoothing: antialiased;
+ -moz-osx-font-smoothing: grayscale;
+ text-decoration: none !important;
+ color: #72777c;
+}
+
+#screen-meta-links .screen-meta-active:after {
+ content: "\f142";
+}
+
+/* end screen options and help tabs */
+
+.toggle-arrow {
+ background-repeat: no-repeat;
+ background-position: top left;
+ background-color: transparent;
+ height: 22px;
+ line-height: 22px;
+ display: block;
+}
+
+.toggle-arrow-active {
+ background-position: bottom left;
+}
+
+#screen-options-wrap h5, /* Back-compat for old plugins */
+#screen-options-wrap legend,
+#contextual-help-wrap h5 {
+ margin: 0;
+ padding: 8px 0;
+ font-size: 13px;
+ font-weight: 600;
+}
+
+.ie8 #screen-options-wrap legend {
+ color: inherit;
+}
+
+.metabox-prefs label {
+ display: inline-block;
+ padding-right: 15px;
+ line-height: 2.35;
+}
+
+#number-of-columns {
+ display: inline-block;
+ vertical-align: middle;
+ line-height: 30px;
+}
+
+.metabox-prefs input[type=checkbox] {
+ margin-top: 0;
+ margin-right: 6px;
+}
+
+.metabox-prefs label input,
+.metabox-prefs label input[type=checkbox] {
+ margin: -4px 5px 0 0;
+}
+
+.metabox-prefs .columns-prefs label input {
+ margin: -1px 2px 0 0;
+}
+
+.metabox-prefs label a {
+ display: none;
+}
+
+.metabox-prefs .screen-options input,
+.metabox-prefs .screen-options label {
+ margin-top: 0;
+ margin-bottom: 0;
+ vertical-align: middle;
+}
+
+.metabox-prefs .screen-options .screen-per-page {
+ margin-right: 15px;
+}
+
+.metabox-prefs .screen-options label {
+ line-height: 2.2;
+ padding-right: 0;
+}
+
+.screen-options + .screen-options {
+ margin-top: 10px;
+}
+
+.metabox-prefs .submit {
+ margin-top: 1em;
+ padding: 0;
+}
+
+/*------------------------------------------------------------------------------
+ 6.2 - Help Menu
+------------------------------------------------------------------------------*/
+
+#contextual-help-wrap {
+ padding: 0;
+}
+
+#contextual-help-columns {
+ position: relative;
+}
+
+#contextual-help-back {
+ position: absolute;
+ top: 0;
+ bottom: 0;
+ left: 150px;
+ right: 170px;
+ border: 1px solid #e1e1e1;
+ border-top: none;
+ border-bottom: none;
+ background: #f6fbfd;
+}
+
+#contextual-help-wrap.no-sidebar #contextual-help-back {
+ right: 0;
+ border-right-width: 0;
+ border-bottom-right-radius: 2px;
+}
+
+.contextual-help-tabs {
+ float: left;
+ width: 150px;
+ margin: 0;
+}
+
+.contextual-help-tabs ul {
+ margin: 1em 0;
+}
+
+.contextual-help-tabs li {
+ margin-bottom: 0;
+ list-style-type: none;
+ border-style: solid;
+ border-width: 0 0 0 2px;
+ border-color: transparent;
+}
+
+.contextual-help-tabs a {
+ display: block;
+ padding: 5px 5px 5px 12px;
+ line-height: 1.4;
+ text-decoration: none;
+ border: 1px solid transparent;
+ border-right: none;
+ border-left: none;
+}
+
+.contextual-help-tabs a:hover {
+ color: #32373c;
+}
+
+.contextual-help-tabs .active {
+ padding: 0;
+ margin: 0 -1px 0 0;
+ border-left: 2px solid #00a0d2;
+ background: #f6fbfd;
+ box-shadow: 0 2px 0 rgba(0, 0, 0, 0.02), 0 1px 0 rgba(0, 0, 0, 0.02);
+}
+
+.contextual-help-tabs .active a {
+ border-color: #e1e1e1;
+ color: #32373c;
+}
+
+.contextual-help-tabs-wrap {
+ padding: 0 20px;
+ overflow: auto;
+}
+
+.help-tab-content {
+ display: none;
+ margin: 0 22px 12px 0;
+ line-height: 1.6;
+}
+
+.help-tab-content.active {
+ display: block;
+}
+
+.help-tab-content ul li {
+ list-style-type: disc;
+ margin-left: 18px;
+}
+
+.contextual-help-sidebar {
+ width: 150px;
+ float: right;
+ padding: 0 8px 0 12px;
+ overflow: auto;
+}
+
+/*------------------------------------------------------------------------------
+ 8.0 - Layout Blocks
+------------------------------------------------------------------------------*/
+
+html.wp-toolbar {
+ padding-top: 32px;
+ box-sizing: border-box;
+}
+
+.widefat th,
+.widefat td {
+ color: #555;
+}
+
+.widefat th,
+.widefat thead td,
+.widefat tfoot td {
+ font-weight: 400;
+}
+
+.widefat thead tr th,
+.widefat thead tr td,
+.widefat tfoot tr th,
+.widefat tfoot tr td {
+ color: #32373c;
+}
+
+.widefat td p {
+ margin: 2px 0 0.8em;
+}
+
+.widefat p,
+.widefat ol,
+.widefat ul {
+ color: #32373c;
+}
+
+.widefat .column-comment p {
+ margin: 0.6em 0;
+}
+
+.widefat .column-comment ul {
+ list-style: initial;
+ margin-left: 2em;
+}
+
+/* Screens with postboxes */
+.postbox-container {
+ float: left;
+}
+
+.postbox-container .meta-box-sortables {
+ box-sizing: border-box;
+}
+
+#wpbody-content .metabox-holder {
+ padding-top: 10px;
+}
+
+.metabox-holder .postbox-container .empty-container {
+ border: 3px dashed #b4b9be;
+ height: 250px;
+ position: relative;
+}
+
+.metabox-holder .postbox-container .empty-container:after {
+ content: attr(data-emptystring);
+ margin: auto;
+ position: absolute;
+ top: 0;
+ left: 0;
+ bottom: 0;
+ right: 0;
+ height: 1em;
+ width: 200px;
+ text-align: center;
+ color: #ccc;
+ font-size: 18px;
+ display: none;
+}
+
+.metabox-holder.columns-1 .postbox-container .empty-container,
+.columns-2 #postbox-container-3 .empty-container,
+.columns-2 #postbox-container-4 .empty-container,
+.columns-3 #postbox-container-4 .empty-container {
+ border: 0 none;
+ height: 0;
+ min-height: 0;
+}
+
+#post-body-content {
+ width: 100%;
+ min-width: 463px;
+ float: left;
+}
+
+#post-body.columns-2 #postbox-container-1 {
+ float: right;
+ margin-right: -300px;
+ width: 280px;
+}
+
+#post-body.columns-2 #side-sortables {
+ min-height: 250px;
+}
+
+/* one column on the dash */
+@media only screen and (max-width: 799px) {
+ #wpbody-content .metabox-holder .postbox-container .empty-container {
+ border: 0 none;
+ height: 0;
+ min-height: 0;
+ }
+}
+
+.js .widget .widget-top,
+.js .postbox .hndle {
+ cursor: move;
+}
+
+.hndle a {
+ font-size: 11px;
+ font-weight: 400;
+}
+
+.postbox .handlediv {
+ display: none;
+ float: right;
+ width: 36px;
+ height: 36px;
+ margin: 0;
+ padding: 0;
+ border: 0;
+ background: none;
+ cursor: pointer;
+}
+
+.js .postbox .handlediv {
+ display: block;
+}
+
+.sortable-placeholder {
+ border: 1px dashed #b4b9be;
+ margin-bottom: 20px;
+}
+
+.postbox,
+.stuffbox {
+ margin-bottom: 20px;
+ padding: 0;
+ line-height: 1;
+}
+
+/* user-select is not a part of the CSS standard - may change behavior in the future */
+.postbox .hndle,
+.stuffbox .hndle {
+ -webkit-user-select: none;
+ -moz-user-select: none;
+ -ms-user-select: none;
+ user-select: none;
+}
+
+.postbox .inside {
+ padding: 0 12px 12px;
+ line-height: 1.4;
+ font-size: 13px;
+}
+
+.stuffbox .inside {
+ padding: 0;
+ line-height: 1.4;
+ font-size: 13px;
+ margin-top: 0;
+}
+
+.postbox .inside {
+ margin: 11px 0;
+ position: relative;
+}
+
+.postbox .inside > p:last-child,
+.rss-widget ul li:last-child {
+ margin-bottom: 1px !important;
+}
+
+.postbox.closed h3 {
+ border: none;
+ box-shadow: none;
+}
+
+.postbox table.form-table {
+ margin-bottom: 0;
+}
+
+.postbox table.widefat {
+ box-shadow: none;
+}
+
+.temp-border {
+ border: 1px dotted #ccc;
+}
+
+.columns-prefs label {
+ padding: 0 10px 0 0;
+}
+
+/* @todo: what is this doing here */
+#dashboard_right_now .versions .b,
+#post-status-display,
+#post-visibility-display,
+#adminmenu .wp-submenu li.current,
+#adminmenu .wp-submenu li.current a,
+#adminmenu .wp-submenu li.current a:hover,
+.media-item .percent,
+.plugins .name,
+#pass-strength-result.strong,
+#pass-strength-result.short,
+#ed_reply_toolbar #ed_reply_strong,
+.item-controls .item-order a,
+.feature-filter .feature-name {
+ font-weight: 600;
+}
+
+/*------------------------------------------------------------------------------
+ 21.0 - Admin Footer
+------------------------------------------------------------------------------*/
+
+#wpfooter {
+ position: absolute;
+ bottom: 0;
+ left: 0;
+ right: 0;
+ padding: 10px 20px;
+ color: #555d66;
+}
+
+#wpfooter p {
+ font-size: 13px;
+ margin: 0;
+ line-height: 1.55;
+}
+
+#footer-thankyou {
+ font-style: italic;
+}
+
+/*------------------------------------------------------------------------------
+ 25.0 - Tabbed Admin Screen Interface (Experimental)
+------------------------------------------------------------------------------*/
+
+.nav-tab {
+ float: left;
+ border: 1px solid #ccc;
+ border-bottom: none;
+ margin-left: 0.5em; /* half the font size so set the font size properly */
+ padding: 5px 10px;
+ font-size: 14px;
+ line-height: 1.71428571;
+ font-weight: 600;
+ background: #e5e5e5;
+ color: #555;
+ text-decoration: none;
+ white-space: nowrap;
+}
+
+h3 .nav-tab, /* Back-compat for pre-4.4 */
+.nav-tab-small .nav-tab {
+ padding: 5px 14px;
+ font-size: 12px;
+ line-height: 1.33;
+}
+
+.nav-tab:hover,
+.nav-tab:focus {
+ background-color: #fff;
+ color: #444;
+}
+
+.nav-tab-active,
+.nav-tab:focus:active {
+ box-shadow: none;
+}
+
+.nav-tab-active {
+ margin-bottom: -1px;
+ color: #444;
+}
+
+.nav-tab-active,
+.nav-tab-active:hover,
+.nav-tab-active:focus,
+.nav-tab-active:focus:active {
+ border-bottom: 1px solid #f1f1f1;
+ background: #f1f1f1;
+ color: #000;
+}
+
+h1.nav-tab-wrapper, /* Back-compat for pre-4.4 */
+.wrap h2.nav-tab-wrapper, /* higher specificity to override .wrap > h2:first-child */
+.nav-tab-wrapper {
+ border-bottom: 1px solid #ccc;
+ margin: 0;
+ padding-top: 9px;
+ padding-bottom: 0;
+ line-height: inherit;
+}
+
+/* Back-compat for plugins. Deprecated. Use .wp-clearfix instead. */
+.nav-tab-wrapper:not(.wp-clearfix):after {
+ content: "";
+ display: table;
+ clear: both;
+}
+
+.ie8 .nav-tab-wrapper {
+ /* contain floats establishing a new block formatting context */
+ display: inline-block;
+ width: 100%;
+ vertical-align: top;
+}
+
+/*------------------------------------------------------------------------------
+ 26.0 - Misc
+------------------------------------------------------------------------------*/
+
+.spinner {
+ background: url(../images/spinner.gif) no-repeat;
+ background-size: 20px 20px;
+ display: inline-block;
+ visibility: hidden;
+ float: right;
+ vertical-align: middle;
+ opacity: 0.7;
+ filter: alpha(opacity=70);
+ width: 20px;
+ height: 20px;
+ margin: 4px 10px 0;
+}
+
+.spinner.is-active,
+.loading-content .spinner {
+ visibility: visible;
+}
+
+#template > div {
+ margin-right: 16em;
+}
+#template .notice {
+ margin-top: 1em;
+ margin-right: 3%;
+}
+#template .notice p {
+ width: auto;
+}
+#template .submit .spinner {
+ float: none;
+}
+
+.metabox-holder .stuffbox > h3, /* Back-compat for pre-4.4 */
+.metabox-holder .postbox > h3, /* Back-compat for pre-4.4 */
+.metabox-holder h3.hndle, /* Back-compat for pre-4.4 */
+.metabox-holder h2.hndle {
+ font-size: 14px;
+ padding: 8px 12px;
+ margin: 0;
+ line-height: 1.4;
+}
+
+/* Back-compat for nav-menus screen */
+.nav-menus-php .metabox-holder h3 {
+ padding: 10px 10px 11px 14px;
+ line-height: 1.5;
+}
+
+#templateside ul li a {
+ text-decoration: none;
+}
+
+.plugin-install #description,
+.plugin-install-network #description {
+ width: 60%;
+}
+
+table .vers,
+table .column-visible,
+table .column-rating {
+ text-align: left;
+}
+
+.attention,
+.error-message {
+ color: #dc3232;
+ font-weight: 600;
+}
+
+/* Scrollbar fix for bulk upgrade iframe */
+body.iframe {
+ height: 98%;
+}
+
+/* Upgrader styles, Specific to Language Packs */
+.lp-show-latest p {
+ display: none;
+}
+.lp-show-latest p:last-child,
+.lp-show-latest .lp-error p {
+ display: block;
+}
+
+/* - Only used once or twice in all of WP - deprecate for global style
+------------------------------------------------------------------------------*/
+.media-icon {
+ width: 62px; /* icon + border */
+ text-align: center;
+}
+
+.media-icon img {
+ border: 1px solid #e5e5e5;
+ border: 1px solid rgba(0, 0, 0, 0.07);
+}
+
+#howto {
+ font-size: 11px;
+ margin: 0 5px;
+ display: block;
+}
+
+.importers {
+ font-size: 16px;
+ width: auto;
+}
+
+.importers td {
+ padding-right: 14px;
+ line-height: 1.4;
+}
+
+.importers .import-system {
+ max-width: 250px;
+}
+
+.importers td.desc {
+ max-width: 500px;
+}
+
+.importer-title,
+.importer-desc,
+.importer-action {
+ display: block;
+}
+
+.importer-title {
+ color: #000;
+ font-size: 14px;
+ font-weight: 400;
+ margin-bottom: .2em;
+}
+
+.importer-action {
+ line-height: 1.55; /* Same as with .updating-message */
+ color: #555;
+ margin-bottom: 1em;
+}
+
+#post-body #post-body-content #namediv h3, /* Back-compat for pre-4.4 */
+#post-body #post-body-content #namediv h2 {
+ margin-top: 0;
+}
+
+.edit-comment-author {
+ color: #222;
+ border-bottom: 1px solid #eee;
+}
+
+#namediv h3 label, /* Back-compat for pre-4.4 */
+#namediv h2 label {
+ vertical-align: baseline;
+}
+
+#namediv table {
+ width: 100%;
+}
+
+#namediv td.first {
+ width: 10px;
+ white-space: nowrap;
+}
+
+#namediv input {
+ width: 98%;
+}
+
+#namediv p {
+ margin: 10px 0;
+}
+
+#submitdiv h3 {
+ margin-bottom: 0 !important;
+}
+
+/* - Used - but could/should be deprecated with a CSS reset
+------------------------------------------------------------------------------*/
+.zerosize {
+ height: 0;
+ width: 0;
+ margin: 0;
+ border: 0;
+ padding: 0;
+ overflow: hidden;
+ position: absolute;
+}
+
+br.clear {
+ height: 2px;
+ line-height: 0.15;
+}
+
+.checkbox {
+ border: none;
+ margin: 0;
+ padding: 0;
+}
+
+fieldset {
+ border: 0;
+ padding: 0;
+ margin: 0;
+}
+
+.post-categories {
+ display: inline;
+ margin: 0;
+ padding: 0;
+}
+
+.post-categories li {
+ display: inline;
+}
+
+/* Star Ratings - Back-compat for pre-3.8 */
+div.star-holder {
+ position: relative;
+ height: 17px;
+ width: 100px;
+ background: url(../images/stars.png?ver=20121108) repeat-x bottom left;
+}
+
+div.star-holder .star-rating {
+ background: url(../images/stars.png?ver=20121108) repeat-x top left;
+ height: 17px;
+ float: left;
+}
+
+/* Star Ratings */
+.star-rating {
+ white-space: nowrap;
+}
+.star-rating .star {
+ display: inline-block;
+ width: 20px;
+ height: 20px;
+ -webkit-font-smoothing: antialiased;
+ font-size: 20px;
+ line-height: 1;
+ font-family: dashicons;
+ text-decoration: inherit;
+ font-weight: 400;
+ font-style: normal;
+ vertical-align: top;
+ transition: color .1s ease-in;
+ text-align: center;
+ color: #ffb900;
+}
+
+.star-rating .star-full:before {
+ content: "\f155";
+}
+
+.star-rating .star-half:before {
+ content: "\f459";
+}
+
+.rtl .star-rating .star-half {
+ transform: rotateY(180deg);
+}
+
+.star-rating .star-empty:before {
+ content: "\f154";
+}
+
+div.action-links {
+ font-weight: 400;
+ margin: 6px 0 0;
+}
+
+/* Plugin install thickbox */
+#plugin-information {
+ background: #fff;
+ position: fixed;
+ top: 0;
+ right: 0;
+ bottom: 0;
+ left: 0;
+ height: 100%;
+ padding: 0;
+}
+
+#plugin-information-scrollable {
+ overflow: auto;
+ -webkit-overflow-scrolling: touch;
+ height: 100%;
+}
+
+#plugin-information-title {
+ padding: 0 26px;
+ background: #f5f5f5;
+ font-size: 22px;
+ font-weight: 600;
+ line-height: 2.4;
+ position: relative;
+ height: 56px;
+}
+
+#plugin-information-title.with-banner {
+ margin-right: 0;
+ height: 250px;
+ background-size: cover;
+}
+
+#plugin-information-title h2 {
+ font-size: 1em;
+ font-weight: 600;
+ padding: 0;
+ margin: 0;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+}
+
+#plugin-information-title.with-banner h2 {
+ position: relative;
+ font-family: "Helvetica Neue", sans-serif;
+ display: inline-block;
+ font-size: 30px;
+ line-height: 1.68;
+ box-sizing: border-box;
+ max-width: 100%;
+ padding: 0 15px;
+ margin-top: 174px;
+ color: #fff;
+ background: rgba(30, 30, 30, 0.9);
+ text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
+ box-shadow: 0 0 30px rgba(255, 255, 255, 0.1);
+ border-radius: 8px;
+}
+
+#plugin-information-title div.vignette {
+ display: none;
+}
+
+#plugin-information-title.with-banner div.vignette {
+ position: absolute;
+ display: block;
+ top: 0;
+ left: 0;
+ height: 250px;
+ width: 100%;
+ background: transparent;
+ box-shadow: inset 0 0 50px 4px rgba(0, 0, 0, 0.2), inset 0 -1px 0 rgba(0, 0, 0, 0.1);
+}
+
+#plugin-information-tabs {
+ padding: 0 16px;
+ position: relative;
+ right: 0;
+ left: 0;
+ min-height: 36px;
+ font-size: 0;
+ z-index: 1;
+ border-bottom: 1px solid #ddd;
+ background: #f3f3f3;
+}
+
+#plugin-information-tabs a {
+ position: relative;
+ display: inline-block;
+ padding: 9px 10px;
+ margin: 0;
+ height: 18px;
+ line-height: 1.3;
+ font-size: 14px;
+ text-decoration: none;
+ transition: none;
+}
+
+#plugin-information-tabs a.current {
+ margin: 0 -1px -1px;
+ background: #fff;
+ border: 1px solid #ddd;
+ border-bottom-color: #fff;
+ padding-top: 8px;
+ color: #32373c;
+}
+
+#plugin-information-tabs.with-banner a.current {
+ border-top: none;
+ padding-top: 9px;
+}
+
+#plugin-information-tabs a:active,
+#plugin-information-tabs a:focus {
+ outline: none;
+}
+
+#plugin-information-content {
+ overflow: hidden; /* equal height column trick */
+ background: #fff;
+ position: relative;
+ top: 0;
+ right: 0;
+ left: 0;
+ min-height: 100%;
+ /* Height of title + tabs + install now */
+ min-height: calc( 100% - 152px );
+}
+
+#plugin-information-content.with-banner {
+ /* Height of banner + tabs + install now */
+ min-height: calc( 100% - 346px );
+}
+
+#section-holder {
+ position: relative;
+ top: 0;
+ right: 250px;
+ bottom: 0;
+ left: 0;
+ margin-top: 10px;
+ margin-right: 250px; /* FYI box */
+ padding: 10px 26px;
+ margin-bottom: -99939px; /* 60px less than the padding below to accommodate footer */
+ padding-bottom: 99999px; /* equal height column trick */
+}
+
+#section-holder .notice {
+ margin: 5px 0 15px;
+}
+
+#section-holder .updated {
+ margin: 16px 0;
+}
+
+#plugin-information .fyi {
+ float: right;
+ position: relative;
+ top: 0;
+ right: 0;
+ padding: 16px;
+ margin-bottom: -99939px; /* 60px less than the padding below to accommodate footer */
+ padding-bottom: 99999px; /* equal height column trick */
+ width: 217px;
+ border-left: 1px solid #ddd;
+ background: #f3f3f3;
+ color: #666;
+}
+
+#plugin-information .fyi strong {
+ color: #444;
+}
+
+#plugin-information .fyi h3 {
+ font-weight: 600;
+ text-transform: uppercase;
+ font-size: 12px;
+ color: #666;
+ margin: 24px 0 8px;
+}
+
+#plugin-information .fyi h2 {
+ font-size: 0.9em;
+ margin-bottom: 0;
+ margin-right: 0;
+}
+
+#plugin-information .fyi ul {
+ padding: 0;
+ margin: 0;
+ list-style: none;
+}
+
+#plugin-information .fyi li {
+ margin: 0 0 10px;
+}
+
+#plugin-information .fyi-description {
+ margin-top: 0;
+}
+
+#plugin-information .counter-container {
+ margin: 3px 0;
+}
+
+#plugin-information .counter-label {
+ float: left;
+ margin-right: 5px;
+ min-width: 55px;
+}
+
+#plugin-information .counter-back {
+ height: 17px;
+ width: 92px;
+ background-color: #e5e5e5;
+ float: left;
+}
+
+#plugin-information .counter-bar {
+ height: 17px;
+ background-color: #ffc733; /* slightly lighter than stars due to larger expanse */
+ float: left;
+}
+
+#plugin-information .counter-count {
+ margin-left: 5px;
+}
+
+#plugin-information .fyi ul.contributors {
+ margin-top: 10px;
+}
+
+#plugin-information .fyi ul.contributors li {
+ display: inline-block;
+ margin-right: 8px;
+ vertical-align: middle;
+}
+
+#plugin-information .fyi ul.contributors li {
+ display: inline-block;
+ margin-right: 8px;
+ vertical-align: middle;
+}
+
+#plugin-information .fyi ul.contributors li img {
+ vertical-align: middle;
+ margin-right: 4px;
+}
+
+#plugin-information-footer {
+ padding: 13px 16px;
+ position: absolute;
+ right: 0;
+ bottom: 0;
+ left: 0;
+ height: 33px; /* 33+13+13+1=60 */
+ border-top: 1px solid #ddd;
+ background: #f3f3f3;
+}
+
+/* rtl:ignore */
+#plugin-information .section {
+ direction: ltr;
+}
+
+/* rtl:ignore */
+#plugin-information .section ul,
+#plugin-information .section ol {
+ list-style-type: disc;
+ margin-left: 24px;
+}
+
+#plugin-information .section,
+#plugin-information .section p {
+ font-size: 14px;
+ line-height: 1.7;
+}
+
+#plugin-information #section-screenshots ol {
+ list-style: none;
+ margin: 0;
+}
+
+#plugin-information #section-screenshots li img {
+ vertical-align: text-top;
+ margin-top: 16px;
+ max-width: 100%;
+ width: auto;
+ height: auto;
+ box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
+}
+
+/* rtl:ignore */
+#plugin-information #section-screenshots li p {
+ font-style: italic;
+ padding-left: 20px;
+}
+
+#plugin-information pre {
+ padding: 7px;
+ overflow: auto;
+ border: 1px solid #ccc;
+}
+
+#plugin-information blockquote {
+ border-left: 2px solid #ddd;
+ color: #666;
+ font-style: italic;
+ margin: 1em 0;
+ padding: 0 0 0 1em;
+}
+
+/* rtl:ignore */
+#plugin-information .review {
+ overflow: hidden; /* clearfix */
+ width: 100%;
+ margin-bottom: 20px;
+ border-bottom: 1px solid #e5e5e5;
+}
+
+#plugin-information .review-title-section {
+ overflow: hidden; /* clearfix */
+}
+
+/* rtl:ignore */
+#plugin-information .review-title-section h4 {
+ display: inline-block;
+ float: left;
+ margin: 0 6px 0 0;
+}
+
+#plugin-information .reviewer-info p {
+ clear: both;
+ margin: 0;
+ padding-top: 2px;
+}
+
+/* rtl:ignore */
+#plugin-information .reviewer-info .avatar {
+ float: left;
+ margin: 4px 6px 0 0;
+}
+
+/* rtl:ignore */
+#plugin-information .reviewer-info .star-rating {
+ float: left;
+}
+
+/* rtl:ignore */
+#plugin-information .review-meta {
+ float: left;
+ margin-left: 0.75em;
+}
+
+/* rtl:ignore */
+#plugin-information .review-body {
+ float: left;
+ width: 100%;
+}
+
+.plugin-version-author-uri {
+ font-size: 13px;
+}
+
+/* For non-js plugin installation screen ticket #36430. */
+.update-php .button.button-primary {
+ margin-right: 1em;
+}
+
+@media screen and (max-width: 771px) {
+ #plugin-information-title.with-banner {
+ height: 100px;
+ }
+
+ #plugin-information-title.with-banner h2 {
+ margin-top: 30px;
+ font-size: 20px;
+ line-height: 2;
+ max-width: 85%;
+ }
+
+ #plugin-information-title.with-banner div.vignette {
+ height: 100px;
+ }
+
+ #plugin-information-tabs {
+ overflow: hidden; /* clearfix */
+ padding: 0;
+ height: auto; /* let tabs wrap */
+ }
+
+ #plugin-information-tabs a.current {
+ margin-bottom: 0;
+ border-bottom: none;
+ }
+
+ #plugin-information .fyi {
+ float: none;
+ border: 1px solid #ddd;
+ position: static;
+ width: auto;
+ margin: 26px 26px 0;
+ padding-bottom: 0; /* reset from the two column height fix */
+ }
+
+ #section-holder {
+ position: static;
+ margin: 0;
+ padding-bottom: 70px; /* reset from the two column height fix, plus accommodate footer */
+ }
+
+ #plugin-information .fyi h3,
+ #plugin-information .fyi small {
+ display: none;
+ }
+
+ #plugin-information-footer {
+ padding: 12px 16px 0;
+ height: 46px;
+ }
+}
+
+/* Thickbox for the Plugin details modal. */
+#TB_window.plugin-details-modal {
+ background: #fcfcfc;
+}
+
+#TB_window.plugin-details-modal.thickbox-loading:before {
+ content: "";
+ display: block;
+ width: 20px;
+ height: 20px;
+ position: absolute;
+ left: 50%;
+ top: 50%;
+ z-index: -1;
+ margin: -10px 0 0 -10px;
+ background: #fcfcfc url(../images/spinner.gif) no-repeat center;
+ background-size: 20px 20px;
+ transform: translateZ(0);
+}
+
+@media print,
+ (-webkit-min-device-pixel-ratio: 1.25),
+ (min-resolution: 120dpi) {
+
+ #TB_window.plugin-details-modal.thickbox-loading:before {
+ background-image: url(../images/spinner-2x.gif);
+ }
+}
+
+.plugin-details-modal #TB_title {
+ float: left;
+ height: 1px;
+}
+
+.plugin-details-modal #TB_ajaxWindowTitle {
+ display: none;
+}
+
+.plugin-details-modal #TB_closeWindowButton {
+ left: auto;
+ right: -30px;
+ color: #eee;
+}
+
+.plugin-details-modal #TB_closeWindowButton:hover,
+.plugin-details-modal #TB_closeWindowButton:focus {
+ color: #00a0d2;
+ outline: none;
+ box-shadow: none;
+}
+
+.plugin-details-modal .tb-close-icon {
+ display: none;
+}
+
+.plugin-details-modal #TB_closeWindowButton:after {
+ content: "\f335";
+ font: normal 32px/29px 'dashicons';
+ speak: none;
+ -webkit-font-smoothing: antialiased;
+ -moz-osx-font-smoothing: grayscale;
+}
+
+/* move plugin install close icon to top on narrow screens */
+@media screen and (max-width: 830px) {
+ .plugin-details-modal #TB_closeWindowButton {
+ right: 0;
+ top: -30px;
+ }
+}
+
+/* @todo: move this. */
+img {
+ border: none;
+}
+
+/* Metabox collapse arrow indicators */
+.sidebar-name .toggle-indicator:before,
+.js .meta-box-sortables .postbox .toggle-indicator:before,
+.bulk-action-notice .toggle-indicator:before,
+.privacy-text-box .toggle-indicator:before {
+ content: "\f142";
+ display: inline-block;
+ font: normal 20px/1 dashicons;
+ speak: none;
+ -webkit-font-smoothing: antialiased;
+ -moz-osx-font-smoothing: grayscale;
+ text-decoration: none !important;
+}
+
+.js .widgets-holder-wrap.closed .toggle-indicator:before,
+.js .meta-box-sortables .postbox.closed .handlediv .toggle-indicator:before,
+.bulk-action-notice .bulk-action-errors-collapsed .toggle-indicator:before,
+.privacy-text-box.closed .toggle-indicator:before {
+ content: "\f140";
+}
+
+.js .postbox .handlediv .toggle-indicator:before {
+ margin-top: 4px;
+ width: 20px;
+ border-radius: 50%;
+ text-indent: -1px; /* account for the dashicon alignment */
+}
+
+.rtl.js .postbox .handlediv .toggle-indicator:before {
+ text-indent: 1px; /* account for the dashicon alignment */
+}
+
+.bulk-action-notice .toggle-indicator:before {
+ line-height: 16px;
+ vertical-align: top;
+ color: #72777c;
+}
+
+.js .postbox .handlediv:focus {
+ box-shadow: none;
+ outline: none;
+}
+
+.js .postbox .handlediv:focus .toggle-indicator:before {
+ box-shadow:
+ 0 0 0 1px #5b9dd9,
+ 0 0 2px 1px rgba(30, 140, 190, 0.8);
+}
+
+/* @todo: appears to be Press This only and overridden */
+#photo-add-url-div input[type="text"] {
+ width: 300px;
+}
+
+/* Theme/Plugin Editor */
+.alignleft h2 {
+ margin: 0;
+}
+
+#template textarea {
+ font-family: Consolas, Monaco, monospace;
+ font-size: 13px;
+ background: #f9f9f9;
+ -moz-tab-size: 4;
+ -o-tab-size: 4;
+ tab-size: 4;
+}
+
+#template textarea,
+#template .CodeMirror {
+ width: 100%;
+ min-height: 60vh;
+ height: calc( 100vh - 295px );
+ border: 1px solid #ddd;
+ box-sizing: border-box;
+}
+
+#templateside > h2 {
+ padding-top: 6px;
+ padding-bottom: 7px;
+ margin: 0;
+}
+
+#templateside ol,
+#templateside ul {
+ margin: 0;
+ padding: 0;
+}
+#templateside > ul {
+ box-sizing: border-box;
+ margin-top: 0;
+ overflow: auto;
+ padding: 0;
+ min-height: 60vh;
+ height: calc(100vh - 295px);
+ background-color: #f7f7f7;
+ border: 1px solid #ddd;
+ border-left: none;
+}
+#templateside ul ul {
+ padding-left: 12px;
+}
+#templateside > ul > li > ul[role=group] {
+ padding-left: 0;
+}
+
+/*
+ * Styles for Theme and Plugin editors.
+ */
+
+/* Hide collapsed items. */
+[role="treeitem"][aria-expanded="false"] > ul {
+ display: none;
+}
+
+/* Use arrow dashicons for folder states, but hide from screen readers. */
+[role="treeitem"] span[aria-hidden] {
+ display: inline;
+ font-family: dashicons;
+ font-size: 20px;
+ position: absolute;
+ pointer-events: none;
+}
+[role="treeitem"][aria-expanded="false"] > .folder-label .icon:after {
+ content: "\f139";
+}
+[role="treeitem"][aria-expanded="true"] > .folder-label .icon:after {
+ content: "\f140";
+}
+[role="treeitem"] .folder-label {
+ display: block;
+ padding: 3px 3px 3px 12px;
+ cursor: pointer;
+}
+
+/* Remove outline, and create our own focus and hover styles */
+[role="treeitem"] {
+ outline: 0;
+}
+[role="treeitem"] .folder-label.focus {
+ color: #124964;
+ box-shadow: 0 0 0 1px #5b9dd9, 0 0 2px 1px rgba(30, 140, 190, 0.8);
+}
+[role="treeitem"].hover,
+[role="treeitem"] .folder-label.hover {
+ background-color: #eaeaea;
+}
+
+.tree-folder {
+ margin: 0;
+ position: relative;
+}
+[role="treeitem"] li {
+ position: relative;
+}
+
+/* Styles for folder indicators/depth */
+.tree-folder .tree-folder::after {
+ content: "";
+ display: block;
+ position: absolute;
+ left: 2px;
+ border-left: 1px solid #ccc;
+ top: -13px;
+ bottom: 10px;
+}
+.tree-folder > li::before {
+ content: "";
+ position: absolute;
+ display: block;
+ border-left: 1px solid #ccc;
+ left: 2px;
+ top: -5px;
+ height: 18px;
+ width: 7px;
+ border-bottom: 1px solid #ccc;
+}
+.tree-folder > li::after {
+ content: "";
+ position: absolute;
+ display: block;
+ border-left: 1px solid #ccc;
+ left: 2px;
+ bottom: -7px;
+ top: 0;
+}
+
+/* current-file needs to adjustment for .notice styles */
+#templateside .current-file {
+ margin: -4px 0 -2px;
+}
+.tree-folder > .current-file::before {
+ left: 4px;
+ height: 15px;
+ width: 0px;
+ border-left: none;
+ top: 3px;
+}
+.tree-folder > .current-file::after {
+ bottom: -4px;
+ height: 7px;
+ left: 2px;
+ top: auto;
+}
+
+/* Lines shouldn't continue on last item */
+.tree-folder > li:last-child::after,
+.tree-folder li:last-child > .tree-folder::after {
+ display: none;
+}
+
+
+#theme-plugin-editor-label {
+ display: inline-block;
+ margin-bottom: 1em;
+ font-weight: 600;
+}
+
+/* rtl:ignore */
+#template textarea,
+#docs-list {
+ direction: ltr;
+}
+
+.fileedit-sub #theme,
+.fileedit-sub #plugin {
+ max-width: 40%;
+}
+.fileedit-sub .alignright {
+ text-align: right;
+}
+
+#template p {
+ width: 97%;
+}
+
+#file-editor-linting-error {
+ margin-top: 1em;
+ margin-bottom: 1em;
+}
+#file-editor-linting-error > .notice {
+ margin: 0;
+ display: inline-block;
+}
+#file-editor-linting-error > .notice > p {
+ width: auto;
+}
+#template .submit {
+ margin-top: 1em;
+ padding: 0;
+}
+
+#template .submit input[type=submit][disabled] {
+ cursor: not-allowed;
+}
+#templateside {
+ float: right;
+ width: 16em;
+ word-wrap: break-word;
+}
+
+#postcustomstuff p.submit {
+ margin: 0;
+}
+
+#templateside h4 {
+ margin: 1em 0 0;
+}
+
+#templateside li {
+ margin: 4px 0;
+}
+
+#templateside li:not(.howto) a,
+.theme-editor-php .highlight {
+ display: block;
+ padding: 3px 0 3px 12px;
+ text-decoration: none;
+}
+
+#templateside li:not(.howto) > a:first-of-type {
+ padding-top: 0;
+}
+
+#templateside li.howto {
+ padding: 6px 12px 12px 12px;
+}
+
+.theme-editor-php .highlight {
+ margin: -3px 3px -3px -12px;
+}
+
+#templateside .highlight {
+ border: none;
+ font-weight: 600;
+}
+
+.nonessential {
+ color: #666;
+ font-size: 11px;
+ font-style: italic;
+ padding-left: 12px;
+}
+
+#documentation {
+ margin-top: 10px;
+}
+
+#documentation label {
+ line-height: 1.8;
+ vertical-align: baseline;
+ font-weight: 600;
+}
+
+.fileedit-sub {
+ padding: 10px 0 8px;
+ line-height: 180%;
+}
+
+#file-editor-warning .file-editor-warning-content {
+ margin: 25px;
+}
+
+/* @todo: can we use a common class for these? */
+.nav-menus-php .item-edit:before,
+.widget-top .widget-action .toggle-indicator:before,
+.control-section .accordion-section-title:after,
+.accordion-section-title:after {
+ content: "\f140";
+ font: normal 20px/1 dashicons;
+ speak: none;
+ display: block;
+ -webkit-font-smoothing: antialiased;
+ -moz-osx-font-smoothing: grayscale;
+ text-decoration: none !important;
+}
+
+.widget-top .widget-action .toggle-indicator:before {
+ padding: 1px 2px 1px 0px;
+ border-radius: 50%;
+}
+
+.handlediv,
+.postbox .handlediv.button-link,
+.item-edit,
+.toggle-indicator,
+.accordion-section-title:after {
+ color: #72777c;
+}
+
+.widget-action {
+ color: #555d66; /* #fafafa background in the Widgets screen */
+}
+
+.widget-top:hover .widget-action,
+.widget-action:focus,
+.handlediv:hover,
+.handlediv:focus,
+.postbox .handlediv.button-link:hover,
+.postbox .handlediv.button-link:focus,
+.item-edit:hover,
+.item-edit:focus,
+.sidebar-name:hover .toggle-indicator,
+.accordion-section-title:hover:after {
+ color: #23282d;
+}
+
+.widget-top .widget-action:focus .toggle-indicator:before {
+ box-shadow:
+ 0 0 0 1px #5b9dd9,
+ 0 0 2px 1px rgba(30, 140, 190, 0.8);
+}
+
+.control-section .accordion-section-title:after,
+.accordion-section-title:after {
+ float: right;
+ right: 20px;
+ top: -2px;
+}
+
+.control-section.open .accordion-section-title:after,
+#customize-info.open .accordion-section-title:after,
+.nav-menus-php .menu-item-edit-active .item-edit:before,
+.widget.open .widget-top .widget-action .toggle-indicator:before,
+.widget.widget-in-question .widget-top .widget-action .toggle-indicator:before {
+ content: "\f142";
+}
+
+/*!
+ * jQuery UI Draggable/Sortable 1.11.4
+ * http://jqueryui.com
+ *
+ * Copyright jQuery Foundation and other contributors
+ * Released under the MIT license.
+ * http://jquery.org/license
+ */
+.ui-draggable-handle,
+.ui-sortable-handle {
+ touch-action: none;
+}
+
+/* Accordion */
+.accordion-section {
+ border-bottom: 1px solid #ddd;
+ margin: 0;
+}
+
+.accordion-section.open .accordion-section-content,
+.no-js .accordion-section .accordion-section-content {
+ display: block;
+}
+
+.accordion-section.open:hover {
+ border-bottom-color: #ddd;
+}
+
+.accordion-section-content {
+ display: none;
+ padding: 10px 20px 15px;
+ overflow: hidden;
+ background: #fff;
+}
+
+.accordion-section-title {
+ margin: 0;
+ padding: 12px 15px 15px;
+ position: relative;
+ border-left: 1px solid #ddd;
+ border-right: 1px solid #ddd;
+ -webkit-user-select: none;
+ -moz-user-select: none;
+ -ms-user-select: none;
+ user-select: none;
+}
+
+.js .accordion-section-title {
+ cursor: pointer;
+}
+
+.js .accordion-section-title:after {
+ position: absolute;
+ top: 12px;
+ right: 10px;
+ z-index: 1;
+}
+
+.accordion-section-title:focus {
+ outline: none;
+}
+
+.accordion-section-title:hover:after,
+.accordion-section-title:focus:after {
+ border-color: #a0a5aa transparent;
+}
+
+.cannot-expand .accordion-section-title {
+ cursor: auto;
+}
+
+.cannot-expand .accordion-section-title:after {
+ display: none;
+}
+
+.control-section .accordion-section-title,
+.customize-pane-child .accordion-section-title {
+ border-left: none;
+ border-right: none;
+ padding: 10px 10px 11px 14px;
+ line-height: 1.55;
+ background: #fff;
+}
+
+.control-section .accordion-section-title:after,
+.customize-pane-child .accordion-section-title:after {
+ top: calc(50% - 10px); /* Arrow height is 20px, so use half of that to vertically center */
+}
+
+.js .control-section:hover .accordion-section-title,
+.js .control-section .accordion-section-title:hover,
+.js .control-section.open .accordion-section-title,
+.js .control-section .accordion-section-title:focus {
+ color: #23282d;
+ background: #f5f5f5;
+}
+
+.control-section.open .accordion-section-title {
+ /* When expanded */
+ border-bottom: 1px solid #ddd;
+}
+
+/* Edit Site */
+.network-admin .edit-site-actions {
+ margin-top: 0;
+}
+
+/* My Sites */
+.my-sites {
+ display: block;
+ overflow: auto;
+ zoom: 1;
+}
+
+.my-sites li {
+ display: block;
+ padding: 8px 3%;
+ min-height: 130px;
+ margin: 0;
+}
+
+@media only screen and (max-width: 599px) {
+ .my-sites li {
+ min-height: 0;
+ }
+}
+
+@media only screen and (min-width: 600px) {
+ .my-sites.striped li {
+ background-color: #fff;
+ position: relative;
+ }
+ .my-sites.striped li:after {
+ content: "";
+ width: 1px;
+ height: 100%;
+ position: absolute;
+ top: 0;
+ right: 0;
+ background: #ccc;
+ }
+
+}
+@media only screen and (min-width: 600px) and (max-width: 699px) {
+ .my-sites li{
+ float: left;
+ width: 44%;
+ }
+ .my-sites.striped li {
+ background-color: #fff;
+ }
+ .my-sites.striped li:nth-of-type(2n+1) {
+ clear: left;
+ }
+ .my-sites.striped li:nth-of-type(2n+2):after {
+ content: none;
+ }
+ .my-sites li:nth-of-type(4n+1),
+ .my-sites li:nth-of-type(4n+2) {
+ background-color: #f9f9f9;
+ }
+
+}
+
+@media only screen and (min-width: 700px) and (max-width: 1199px) {
+ .my-sites li {
+ float: left;
+ width: 27.333333%;
+ background-color: #fff;
+ }
+ .my-sites.striped li:nth-of-type(3n+3):after {
+ content: none;
+ }
+ .my-sites li:nth-of-type(6n+1),
+ .my-sites li:nth-of-type(6n+2),
+ .my-sites li:nth-of-type(6n+3) {
+ background-color: #f9f9f9;
+ }
+}
+
+@media only screen and (min-width: 1200px) and (max-width: 1399px) {
+ .my-sites li {
+ float: left;
+ width: 21%;
+ padding: 8px 2%;
+ background-color: #fff;
+ }
+ .my-sites.striped li:nth-of-type(4n+1) {
+ clear: left;
+ }
+ .my-sites.striped li:nth-of-type(4n+4):after {
+ content: none;
+ }
+ .my-sites li:nth-of-type(8n+1),
+ .my-sites li:nth-of-type(8n+2),
+ .my-sites li:nth-of-type(8n+3),
+ .my-sites li:nth-of-type(8n+4) {
+ background-color: #f9f9f9;
+ }
+}
+
+@media only screen and (min-width: 1400px) and (max-width: 1599px) {
+ .my-sites li {
+ float: left;
+ width: 16%;
+ padding: 8px 2%;
+ background-color: #fff;
+ }
+ .my-sites.striped li:nth-of-type(5n+1) {
+ clear: left;
+ }
+ .my-sites.striped li:nth-of-type(5n+5):after {
+ content: none;
+ }
+ .my-sites li:nth-of-type(10n+1),
+ .my-sites li:nth-of-type(10n+2),
+ .my-sites li:nth-of-type(10n+3),
+ .my-sites li:nth-of-type(10n+4),
+ .my-sites li:nth-of-type(10n+5) {
+ background-color: #f9f9f9;
+ }
+}
+
+@media only screen and (min-width: 1600px) {
+ .my-sites li {
+ float: left;
+ width: 12.666666%;
+ padding: 8px 2%;
+ background-color: #fff;
+ }
+ .my-sites.striped li:nth-of-type(6n+1) {
+ clear: left;
+ }
+ .my-sites.striped li:nth-of-type(6n+6):after {
+ content: none;
+ }
+ .my-sites li:nth-of-type(12n+1),
+ .my-sites li:nth-of-type(12n+2),
+ .my-sites li:nth-of-type(12n+3),
+ .my-sites li:nth-of-type(12n+4),
+ .my-sites li:nth-of-type(12n+5),
+ .my-sites li:nth-of-type(12n+6) {
+ background-color: #f9f9f9;
+ }
+}
+
+.my-sites li a {
+ text-decoration: none;
+}
+
+/* =Media Queries
+-------------------------------------------------------------- */
+
+/**
+ * HiDPI Displays
+ */
+@media print,
+ (-webkit-min-device-pixel-ratio: 1.25),
+ (min-resolution: 120dpi) {
+ /* Back-compat for pre-3.8 */
+ div.star-holder,
+ div.star-holder .star-rating {
+ background: url(../images/stars-2x.png?ver=20121108) repeat-x bottom left;
+ background-size: 21px 37px;
+ }
+
+ .spinner {
+ background-image: url(../images/spinner-2x.gif);
+ }
+
+ /* @todo: evaluate - most of these were likely replaced by dashicons */
+ .curtime #timestamp,
+ #screen-meta-links a.show-settings,
+ .widget-top .widget-action,
+ .widget-top .widget-action:hover,
+ .sidebar-name .toggle-indicator,
+ .sidebar-name:hover .toggle-indicator,
+ .meta-box-sortables .postbox:hover .handlediv,
+ #bulk-titles div a,
+ #bulk-titles div a:hover {
+ background: none !important;
+ }
+
+}
+
+@-ms-viewport {
+ width: device-width;
+}
+
+@media screen and (max-width: 782px) {
+ html.wp-toolbar {
+ padding-top: 46px;
+ }
+
+ .screen-reader-shortcut:focus {
+ top: -39px;
+ }
+
+ body {
+ min-width: 240px;
+ overflow-x: hidden;
+ }
+
+ body * {
+ -webkit-tap-highlight-color: rgba(0, 0, 0, 0) !important;
+ }
+
+ #wpcontent {
+ position: relative;
+ margin-left: 0;
+ padding-left: 10px;
+ }
+
+ #wpbody-content {
+ padding-bottom: 100px;
+ }
+
+ .wrap {
+ clear: both;
+ margin-right: 12px;
+ margin-left: 0;
+ }
+
+ /* categories */
+ #col-left,
+ #col-right {
+ float: none;
+ width: auto;
+ }
+
+ #col-left .col-wrap,
+ #col-right .col-wrap {
+ padding: 0;
+ }
+
+ /* Hidden Elements */
+ #collapse-menu,
+ .post-format-select {
+ display: none !important;
+ }
+
+ .wrap h1.wp-heading-inline {
+ margin-bottom: 0.5em;
+ }
+
+ .wrap .add-new-h2, /* deprecated */
+ .wrap .add-new-h2:active, /* deprecated */
+ .wrap .page-title-action,
+ .wrap .page-title-action:active {
+ padding: 10px 15px;
+ font-size: 14px;
+ white-space: nowrap;
+ }
+
+ /* Feedback Messages */
+ .notice,
+ .wrap div.updated,
+ .wrap div.error,
+ .media-upload-form div.error {
+ margin: 20px 0 10px 0;
+ padding: 5px 10px;
+ font-size: 14px;
+ line-height: 175%;
+ }
+
+ .wp-core-ui .notice.is-dismissible {
+ padding-right: 46px;
+ }
+
+ .notice-dismiss {
+ padding: 13px;
+ }
+
+ .wrap .icon32 + h2 {
+ margin-top: -2px;
+ }
+
+ .wp-responsive-open #wpbody {
+ right: -16em;
+ }
+
+ code {
+ word-wrap: break-word;
+ }
+
+ /* General Metabox */
+ .postbox {
+ font-size: 14px;
+ }
+
+ .metabox-holder h3.hndle, /* Back-compat for pre-4.4 */
+ .metabox-holder .stuffbox > h3, /* Back-compat for pre-4.4 */
+ .metabox-holder .postbox > h3, /* Back-compat for pre-4.4 */
+ .metabox-holder h2 {
+ padding: 12px;
+ }
+
+ .postbox .handlediv {
+ margin-top: 3px;
+ }
+
+ /* Subsubsub Nav */
+ .subsubsub {
+ font-size: 16px;
+ text-align: center;
+ margin-bottom: 15px;
+ }
+
+ /* Theme/Plugin File Editor */
+
+ #template textarea,
+ #template .CodeMirror {
+ box-sizing: border-box;
+ }
+
+ #templateside {
+ float: none;
+ width: auto;
+ }
+
+ #templateside > ul {
+ border-left: 1px solid #ddd;
+ }
+
+ #templateside li {
+ margin: 0;
+ }
+
+ #templateside li:not(.howto) a {
+ display: block;
+ padding: 5px;
+ }
+ #templateside li.howto {
+ padding: 12px;
+ }
+
+ #templateside .highlight {
+ padding: 5px;
+ margin-left: -5px;
+ margin-top: -5px;
+ }
+
+ #template > div,
+ #template .notice {
+ float: none;
+ margin: 1em 0;
+ width: auto;
+ }
+
+ #template .CodeMirror,
+ #template textarea {
+ width: 100%;
+ }
+
+ #templateside ul ul {
+ padding-left: 1.5em;
+ }
+ [role="treeitem"] .folder-label {
+ display: block;
+ padding: 5px;
+ }
+ .tree-folder > li::before,
+ .tree-folder > li::after,
+ .tree-folder .tree-folder::after {
+ left: -8px;
+ }
+ .tree-folder > li::before {
+ top: 0px;
+ height: 13px;
+ }
+ .tree-folder > .current-file::before {
+ left: -5px;
+ top: 7px;
+ width: 4px;
+ }
+ .tree-folder > .current-file::after {
+ height: 9px;
+ left: -8px;
+ }
+ .wrap #templateside span.notice {
+ margin-left: -5px;
+ width: 100%;
+ }
+
+ .fileedit-sub .alignright {
+ float: left;
+ margin-top: 15px;
+ width: 100%;
+ text-align: left;
+ }
+
+ .fileedit-sub .alignright label {
+ display: block;
+ }
+
+ .fileedit-sub #theme,
+ .fileedit-sub #plugin {
+ margin-left: 0;
+ max-width: 70%;
+ }
+
+ .fileedit-sub input[type="submit"] {
+ margin-bottom: 0px;
+ padding: 8px 18px;
+ }
+
+ #documentation label[for="docs-list"] {
+ display: block;
+ }
+
+ #documentation select[name="docs-list"] {
+ margin-left: 0;
+ max-width: 60%;
+ }
+
+ #documentation input[type="button"] {
+ margin-bottom: 0;
+ padding: 8px 18px;
+ }
+
+ #wpfooter {
+ display: none;
+ }
+
+ #comments-form .checkforspam {
+ display: none;
+ }
+
+ .edit-comment-author {
+ margin: 2px 0 0;
+ }
+
+ .filter-drawer .filter-group-feature input,
+ .filter-drawer .filter-group-feature label {
+ line-height: 2.1;
+ }
+
+ .filter-drawer .filter-group-feature label {
+ margin-left: 32px;
+ }
+
+ .wp-filter .button.drawer-toggle {
+ font-size: 13px;
+ line-height: 2;
+ height: 28px;
+ }
+
+ /* Fix help tab columns for smaller screens */
+ #screen-meta #contextual-help-wrap {
+ overflow: visible;
+ }
+
+ #screen-meta #contextual-help-back,
+ #screen-meta .contextual-help-sidebar {
+ display: none;
+ }
+
+ #screen-meta .contextual-help-tabs {
+ clear: both;
+ width: 100%;
+ float: none;
+ }
+
+ #screen-meta .contextual-help-tabs ul {
+ margin: 0 0 1em;
+ padding: 1em 0 0;
+ }
+
+ #screen-meta .contextual-help-tabs .active {
+ margin: 0;
+ }
+
+ #screen-meta .contextual-help-tabs-wrap {
+ clear: both;
+ max-width: 100%;
+ float: none;
+ }
+
+ #screen-meta-links {
+ margin-bottom: 20px; /* Add margins beneath links for better spacing between boxes and elements */
+ }
+}
+
+/* Smartphone */
+@media screen and (max-width: 600px) {
+ /* Disable horizontal scroll when responsive menu is open
+ since we push the main content off to the right. */
+ #wpwrap.wp-responsive-open {
+ overflow-x: hidden;
+ }
+
+ html.wp-toolbar {
+ padding-top: 0;
+ }
+
+ .screen-reader-shortcut:focus {
+ top: 7px;
+ }
+
+ #wpbody {
+ padding-top: 46px;
+ }
+
+ /* Keep full-width boxes on Edit Post page from causing horizontal scroll */
+ div#post-body.metabox-holder.columns-1 {
+ overflow-x: hidden;
+ }
+
+ h1.nav-tab-wrapper,
+ .wrap h2.nav-tab-wrapper,
+ .nav-tab-wrapper {
+ border-bottom: 0;
+ }
+
+ h1 .nav-tab,
+ h2 .nav-tab,
+ h3 .nav-tab,
+ nav .nav-tab {
+ margin: 10px 10px 0 0;
+ border-bottom: 1px solid #ccc;
+ }
+
+ .nav-tab-active:hover,
+ .nav-tab-active:focus,
+ .nav-tab-active:focus:active {
+ border-bottom: 1px solid #ccc;
+ }
+}
+
+@media screen and (max-width: 320px) {
+ /* Prevent default center alignment and larger font for the Right Now widget when
+ the network dashboard is viewed on a small mobile device. */
+ #network_dashboard_right_now .subsubsub {
+ font-size: 14px;
+ text-align: left;
+ }
+}
diff --git a/www/crm/wp-admin/css/common.min.css b/www/crm/wp-admin/css/common.min.css
new file mode 100644
index 00000000..7e1b1b24
--- /dev/null
+++ b/www/crm/wp-admin/css/common.min.css
@@ -0,0 +1,9 @@
+/*! This file is auto-generated */
+#wpwrap{height:auto;min-height:100%;width:100%;position:relative;-webkit-font-smoothing:subpixel-antialiased}#wpcontent{height:100%;padding-left:20px}#wpcontent,#wpfooter{margin-left:160px}.folded #wpcontent,.folded #wpfooter{margin-left:36px}#wpbody-content{padding-bottom:65px;float:left;width:100%;overflow:visible!important}.inner-sidebar{float:right;clear:right;display:none;width:281px;position:relative}.columns-2 .inner-sidebar{margin-right:auto;width:286px;display:block}.columns-2 .inner-sidebar #side-sortables,.inner-sidebar #side-sortables{min-height:300px;width:280px;padding:0}.has-right-sidebar .inner-sidebar{display:block}.has-right-sidebar #post-body{float:left;clear:left;width:100%;margin-right:-2000px}.has-right-sidebar #post-body-content{margin-right:300px;float:none;width:auto}#col-left{float:left;width:35%}#col-right{float:right;width:65%}#col-left .col-wrap{padding:0 6px 0 0}#col-right .col-wrap{padding:0 0 0 6px}.alignleft{float:left}.alignright{float:right}.textleft{text-align:left}.textright{text-align:right}.clear{clear:both}.wp-clearfix:after{content:"";display:table;clear:both}.screen-reader-text,.screen-reader-text span,.ui-helper-hidden-accessible{border:0;clip:rect(1px,1px,1px,1px);-webkit-clip-path:inset(50%);clip-path:inset(50%);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;word-wrap:normal!important}.button .screen-reader-text{height:auto}.screen-reader-shortcut{position:absolute;top:-1000em}.screen-reader-shortcut:focus{left:6px;top:-25px;height:auto;width:auto;display:block;font-size:14px;font-weight:600;padding:15px 23px 14px;background:#f1f1f1;color:#0073aa;z-index:100000;line-height:normal;box-shadow:0 0 2px 2px rgba(0,0,0,.6);text-decoration:none;outline:2px solid transparent;outline-offset:-2px}.hidden,.js .closed .inside,.js .hide-if-js,.js .wp-core-ui .hide-if-js,.js.wp-core-ui .hide-if-js,.no-js .hide-if-no-js,.no-js .wp-core-ui .hide-if-no-js,.no-js.wp-core-ui .hide-if-no-js{display:none}#menu-management .menu-edit,#menu-settings-column .accordion-container,.comment-ays,.feature-filter,.imgedit-group,.manage-menus,.menu-item-handle,.popular-tags,.stuffbox,.widget-inside,.widget-top,.widgets-holder-wrap,.wp-editor-container,p.popular-tags,table.widefat{border:1px solid #e5e5e5;box-shadow:0 1px 1px rgba(0,0,0,.04)}.comment-ays,.feature-filter,.imgedit-group,.popular-tags,.stuffbox,.widgets-holder-wrap,.wp-editor-container,p.popular-tags,table.widefat{background:#fff}body,html{height:100%;margin:0;padding:0}body{background:#f1f1f1;color:#444;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif;font-size:13px;line-height:1.4em;min-width:600px}body.iframe{min-width:0;padding-top:1px}body.modal-open{overflow:hidden}body.mobile.modal-open #wpwrap{overflow:hidden;position:fixed;height:100%}iframe,img{border:0}td{font-family:inherit;font-size:inherit;font-weight:inherit;line-height:inherit}a{color:#0073aa;transition-property:border,background,color;transition-duration:.05s;transition-timing-function:ease-in-out}a,div{outline:0}a:active,a:hover{color:#00a0d2}.wp-person a:focus .gravatar,a:focus,a:focus .media-icon img{color:#124964;box-shadow:0 0 0 1px #5b9dd9,0 0 2px 1px rgba(30,140,190,.8);outline:1px solid transparent}.ie8 a:focus{outline:#5b9dd9 solid 1px}#adminmenu a:focus{box-shadow:none;outline:1px solid transparent;outline-offset:-1px}.screen-reader-text:focus{box-shadow:none;outline:0}blockquote,q{quotes:none}blockquote:after,blockquote:before,q:after,q:before{content:"";content:none}p{font-size:13px;line-height:1.5;margin:1em 0}blockquote{margin:1em}dd,li{margin-bottom:6px}h1,h2,h3,h4,h5,h6{display:block;font-weight:600}h1{color:#23282d;font-size:2em;margin:.67em 0}h2,h3{color:#23282d;font-size:1.3em;margin:1em 0}.update-core-php h2{margin-top:2em}.update-messages h2,.update-php h2,h4{font-size:1em;margin:1.33em 0}h5{font-size:.83em;margin:1.67em 0}h6{font-size:.67em;margin:2.33em 0}ol,ul{padding:0}ul{list-style:none}ol{list-style-type:decimal;margin-left:2em}ul.ul-disc{list-style:disc outside}ul.ul-square{list-style:square outside}ol.ol-decimal{list-style:decimal outside}ol.ol-decimal,ul.ul-disc,ul.ul-square{margin-left:1.8em}ol.ol-decimal>li,ul.ul-disc>li,ul.ul-square>li{margin:0 0 .5em}.ltr{direction:ltr}.code,code{font-family:Consolas,Monaco,monospace;direction:ltr;unicode-bidi:embed}code,kbd{padding:3px 5px 2px 5px;margin:0 1px;background:#eaeaea;background:rgba(0,0,0,.07);font-size:13px}.subsubsub{list-style:none;margin:8px 0 0;padding:0;font-size:13px;float:left;color:#666}.subsubsub a{line-height:2;padding:.2em;text-decoration:none}.subsubsub a .count,.subsubsub a.current .count{color:#555d66;font-weight:400}.subsubsub a.current{font-weight:600;border:none}.subsubsub li{display:inline-block;margin:0;padding:0;white-space:nowrap}.widefat{border-spacing:0;width:100%;clear:both;margin:0}.widefat *{word-wrap:break-word}.widefat a,.widefat button.button-link{text-decoration:none}.widefat td,.widefat th{padding:8px 10px}.widefat thead td,.widefat thead th{border-bottom:1px solid #e1e1e1}.widefat tfoot td,.widefat tfoot th{border-top:1px solid #e1e1e1;border-bottom:none}.widefat .no-items td{border-bottom-width:0}.widefat td{vertical-align:top}.widefat td,.widefat td ol,.widefat td p,.widefat td ul{font-size:13px;line-height:1.5em}.widefat tfoot td,.widefat th,.widefat thead td{text-align:left;line-height:1.3em;font-size:14px}.updates-table td input,.widefat tfoot td input,.widefat th input,.widefat thead td input{margin:0 0 0 8px;padding:0;vertical-align:text-top}.widefat .check-column{width:2.2em;padding:6px 0 25px;vertical-align:top}.widefat tbody th.check-column{padding:9px 0 22px}.updates-table tbody td.check-column,.widefat tbody th.check-column,.widefat tfoot td.check-column,.widefat thead td.check-column{padding:11px 0 0 3px}.widefat tfoot td.check-column,.widefat thead td.check-column{padding-top:4px;vertical-align:middle}.update-php div.error,.update-php div.updated{margin-left:0}.no-js .widefat tfoot .check-column input,.no-js .widefat thead .check-column input{display:none}.column-comments,.column-links,.column-posts,.widefat .num{text-align:center}.widefat th#comments{vertical-align:middle}.wrap{margin:10px 20px 0 2px}.wrap.block-editor-no-js{padding-left:20px}.postbox .inside h2,.wrap [class$=icon32]+h2,.wrap h1,.wrap>h2:first-child{font-size:23px;font-weight:400;margin:0;padding:9px 0 4px 0;line-height:1.3}.wrap h1.wp-heading-inline{display:inline-block;margin-right:5px}.wp-header-end{visibility:hidden;margin:-2px 0 0}.subtitle{margin:0;padding-left:25px;color:#555d66;font-size:14px;font-weight:400;line-height:1}.wrap .add-new-h2,.wrap .add-new-h2:active,.wrap .page-title-action,.wrap .page-title-action:active{margin-left:4px;padding:4px 8px;position:relative;top:-3px;text-decoration:none;border:none;border:1px solid #ccc;border-radius:2px;background:#f7f7f7;text-shadow:none;font-weight:600;font-size:13px;line-height:normal;color:#0073aa;cursor:pointer}.wrap .wp-heading-inline+.page-title-action{margin-left:0}.wrap .add-new-h2:hover,.wrap .page-title-action:hover{border-color:#008ec2;background:#00a0d2;color:#fff}.page-title-action:focus{color:#124964}.wrap .page-title-action:focus{border-color:#5b9dd9;box-shadow:0 0 2px rgba(30,140,190,.8);outline:2px solid transparent}.wrap h1.long-header{padding-right:0}.wp-dialog{background-color:#fff}#available-widgets .widget-top:hover,#widgets-left .widget-in-question .widget-top,#widgets-left .widget-top:hover,.widgets-chooser ul,div#widgets-right .widget-top:hover{border-color:#999;box-shadow:0 1px 2px rgba(0,0,0,.1)}.sorthelper{background-color:#ccf3fa}.ac_match,.subsubsub a.current{color:#000}.alternate,.striped>tbody>:nth-child(odd),ul.striped>:nth-child(odd){background-color:#f9f9f9}.bar{background-color:#e8e8e8;border-right-color:#99d}.highlight{background-color:#e4f2fd;color:#000}.wp-ui-primary{color:#fff;background-color:#32373c}.wp-ui-text-primary{color:#32373c}.wp-ui-highlight{color:#fff;background-color:#1e8cbe}.wp-ui-text-highlight{color:#1e8cbe}.wp-ui-notification{color:#fff;background-color:#d54e21}.wp-ui-text-notification{color:#d54e21}.wp-ui-text-icon{color:#82878c}img.emoji{display:inline!important;border:none!important;height:1em!important;width:1em!important;margin:0 .07em!important;vertical-align:-.1em!important;background:0 0!important;padding:0!important;box-shadow:none!important}#nav-menu-footer,#nav-menu-header,#your-profile #rich_editing,.checkbox,.control-section .accordion-section-title,.menu-item-handle,.postbox .hndle,.side-info,.sidebar-name,.stuffbox .hndle,.widefat tfoot td,.widefat tfoot th,.widefat thead td,.widefat thead th,.widget .widget-top{line-height:1.4em}.menu-item-handle,.widget .widget-top{background:#fafafa;color:#23282d}.postbox .hndle,.stuffbox .hndle{border-bottom:1px solid #eee}.quicktags,.search{background-color:#ccc;color:#000;font-size:12px}.icon32{display:none}#bulk-titles div a:before,.notice-dismiss:before,.tagchecklist .ntdelbutton .remove-tag-icon:before,.welcome-panel .welcome-panel-close:before{background:0 0;color:#72777c;content:"\f153";display:block;font:normal 16px/20px dashicons;speak:none;height:20px;text-align:center;width:20px;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.welcome-panel .welcome-panel-close:before{margin:0}#bulk-titles div a:before{margin:1px 0}.tagchecklist .ntdelbutton .remove-tag-icon:before{margin-left:2px;border-radius:50%;color:#0073aa;line-height:1.28}.tagchecklist .ntdelbutton:focus{outline:0}#bulk-titles div a:focus:before,#bulk-titles div a:hover:before,.tagchecklist .ntdelbutton:focus .remove-tag-icon:before,.tagchecklist .ntdelbutton:hover .remove-tag-icon:before,.welcome-panel .welcome-panel-close:focus:before,.welcome-panel .welcome-panel-close:hover:before{color:#c00}.tagchecklist .ntdelbutton:focus .remove-tag-icon:before{box-shadow:0 0 0 1px #5b9dd9,0 0 2px 1px rgba(30,140,190,.8)}.key-labels label{line-height:24px}b,strong{font-weight:600}.pre{white-space:pre-wrap;word-wrap:break-word}.howto{color:#666;font-style:italic;display:block}p.install-help{margin:8px 0;font-style:italic}.no-break{white-space:nowrap}hr{border:0;border-top:1px solid #ddd;border-bottom:1px solid #fafafa}#all-plugins-table .plugins a.delete,#delete-link a.delete,#media-items a.delete,#media-items a.delete-permanently,#nav-menu-footer .menu-delete,#search-plugins-table .plugins a.delete,.plugins a.delete,.row-actions span.delete a,.row-actions span.spam a,.row-actions span.trash a,.submitbox .submitdelete{color:#a00}#all-plugins-table .plugins a.delete:hover,#delete-link a.delete:hover,#media-items a.delete-permanently:hover,#media-items a.delete:hover,#nav-menu-footer .menu-delete:hover,#search-plugins-table .plugins a.delete:hover,.file-error,.plugins a.delete:hover,.row-actions .delete a:hover,.row-actions .spam a:hover,.row-actions .trash a:hover,.submitbox .submitdelete:hover,abbr.required,span.required{color:#dc3232;border:none}#major-publishing-actions{padding:10px;clear:both;border-top:1px solid #ddd;background:#f5f5f5}#delete-action{float:left;line-height:2.1}#delete-link{line-height:2.1;vertical-align:middle;text-align:left;margin-left:8px}#delete-link a{text-decoration:none}#publishing-action{text-align:right;float:right;line-height:1.9}#publishing-action .spinner{float:left}#misc-publishing-actions{padding:6px 0 0}.misc-pub-section{padding:6px 10px 8px}.misc-pub-filename{word-wrap:break-word}#minor-publishing-actions{padding:10px 10px 0 10px;text-align:right}#save-post{float:left}.preview{float:right}#sticky-span{margin-left:18px}.approve,.unapproved .unapprove{display:none}.spam .approve,.trash .approve,.unapproved .approve{display:inline}td.action-links,th.action-links{text-align:right}#misc-publishing-actions .notice{margin-left:10px;margin-right:10px}.wp-filter{display:inline-block;position:relative;box-sizing:border-box;margin:12px 0 25px;padding:0 10px;width:100%;box-shadow:0 1px 1px rgba(0,0,0,.04);border:1px solid #e5e5e5;background:#fff;color:#555;font-size:13px}.wp-filter a{text-decoration:none}.filter-count{display:inline-block;vertical-align:middle;min-width:4em}.filter-count .count,.title-count{display:inline-block;position:relative;top:-1px;padding:4px 10px;border-radius:30px;background:#72777c;color:#fff;font-size:14px;font-weight:600}.title-count{display:inline;top:-3px;margin-left:5px;margin-right:20px}.filter-items{float:left}.filter-links{display:inline-block;margin:0}.filter-links li{display:inline-block;margin:0}.filter-links li>a{display:inline-block;margin:0 10px;padding:15px 0;border-bottom:4px solid #fff;color:#666;cursor:pointer}.filter-links .current{box-shadow:none;border-bottom:4px solid #666;color:#23282d}.filter-links li>a:focus,.filter-links li>a:hover,.show-filters .filter-links a.current:focus,.show-filters .filter-links a.current:hover{color:#00a0d2}.wp-filter .search-form{float:right;margin:10px 0}.wp-filter .search-form input[type=search]{margin:0;padding:3px 5px;width:280px;max-width:100%;font-size:16px;font-weight:300;line-height:1.5}.wp-filter .search-form select{margin:0;height:32px;vertical-align:top}.wp-filter .search-form.search-plugins{display:inline-block}.wp-filter .button.drawer-toggle{margin:10px 9px 0;padding:0 10px 0 6px;border-color:transparent;background-color:transparent;color:#666;vertical-align:baseline;box-shadow:none}.wp-filter .drawer-toggle:before{content:"\f111";margin:0 5px 0 0;color:#72777c;font:normal 16px/1 dashicons;vertical-align:text-bottom;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.wp-filter .button.drawer-toggle:focus,.wp-filter .button.drawer-toggle:hover,.wp-filter .drawer-toggle:focus:before,.wp-filter .drawer-toggle:hover:before{background-color:transparent;color:#00a0d2}.wp-filter .button.drawer-toggle:focus:active,.wp-filter .button.drawer-toggle:hover{border-color:transparent}.wp-filter .button.drawer-toggle:focus{border-color:#5b9dd9}.wp-filter .button.drawer-toggle:active{background:0 0;box-shadow:none;transform:none}.wp-filter .drawer-toggle.current:before{color:#fff}.filter-drawer,.wp-filter .favorites-form{display:none;margin:0 -10px 0 -20px;padding:20px;border-top:1px solid #eee;background:#fafafa;overflow:hidden}.show-favorites-form .favorites-form,.show-filters .filter-drawer{display:block}.show-filters .filter-links a.current{border-bottom:none}.show-filters .wp-filter .button.drawer-toggle{border-radius:2px;background:#72777c;color:#fff}.show-filters .wp-filter .drawer-toggle:focus,.show-filters .wp-filter .drawer-toggle:hover{background:#2ea2cc}.show-filters .wp-filter .drawer-toggle:before{color:#fff}.filter-group{box-sizing:border-box;position:relative;float:left;margin:0 1% 0 0;padding:20px 10px 10px;width:24%;background:#fff;border:1px solid #e5e5e5;box-shadow:0 1px 1px rgba(0,0,0,.04)}.filter-group legend{position:absolute;top:10px;display:block;margin:0;padding:0;font-size:1em;font-weight:600}.filter-drawer .filter-group-feature{margin:28px 0 0;list-style-type:none;font-size:12px}.filter-drawer .filter-group-feature input,.filter-drawer .filter-group-feature label{line-height:1.4}.filter-drawer .filter-group-feature input{position:absolute;margin:0}.filter-group .filter-group-feature label{display:block;margin:14px 0 14px 23px}.filter-drawer .buttons{clear:both;margin-bottom:20px}.filter-drawer .filter-group+.buttons{margin-bottom:0;padding-top:20px}.filter-drawer .buttons .button span{display:inline-block;opacity:.8;font-size:12px;text-indent:10px}.wp-filter .button.clear-filters{display:none;margin-left:10px}.wp-filter .button-link.edit-filters{padding:0 5px;line-height:2.2}.filtered-by{display:none;margin:0}.filtered-by>span{font-weight:600}.filtered-by a{margin-left:10px}.filtered-by .tags{display:inline}.filtered-by .tag{margin:0 5px;padding:4px 8px;border:1px solid #e5e5e5;box-shadow:0 1px 1px rgba(0,0,0,.04);background:#fff;font-size:11px}.filters-applied .filter-drawer .buttons,.filters-applied .filter-drawer br,.filters-applied .filter-group{display:none!important}.filters-applied .filtered-by{display:block}.filters-applied .filter-drawer{padding:20px}.error .content-filterable,.loading-content .content-filterable,.show-filters .content-filterable,.show-filters .favorites-form,.show-filters.filters-applied.loading-content .content-filterable{display:none}.show-filters.filters-applied .content-filterable{display:block}.loading-content .spinner{display:block;margin:40px auto 0;float:none}@media only screen and (max-width:1120px){.filter-drawer{border-bottom:1px solid #eee}.filter-group{margin-bottom:0;margin-top:5px;width:100%}.filter-group li{margin:10px 0}}@media only screen and (max-width:1000px){.filter-items{float:none}.wp-filter .media-toolbar-primary,.wp-filter .media-toolbar-secondary,.wp-filter .search-form{float:none;position:relative;max-width:100%}}@media only screen and (max-width:782px){.filter-group li{padding:0;width:50%}}@media only screen and (max-width:320px){.filter-count{display:none}.wp-filter .drawer-toggle{margin:10px 0}.filter-group li,.wp-filter .search-form input[type=search]{width:100%}}.notice,div.error,div.updated{background:#fff;border-left:4px solid #fff;box-shadow:0 1px 1px 0 rgba(0,0,0,.1);margin:5px 15px 2px;padding:1px 12px}div[class=update-message]{padding:.5em 12px .5em 0}.form-table td .notice p,.notice p,.notice-title,div.error p,div.updated p{margin:.5em 0;padding:2px}.error a{text-decoration:underline}.updated a{padding-bottom:2px}.notice-alt{box-shadow:none}.notice-large{padding:10px 20px}.notice-title{display:inline-block;color:#23282d;font-size:18px}.wp-core-ui .notice.is-dismissible{padding-right:38px;position:relative}.notice-dismiss{position:absolute;top:0;right:1px;border:none;margin:0;padding:9px;background:0 0;color:#72777c;cursor:pointer}.notice-dismiss:active:before,.notice-dismiss:focus:before,.notice-dismiss:hover:before{color:#c00}.notice-dismiss:focus{outline:0;box-shadow:0 0 0 1px #5b9dd9,0 0 2px 1px rgba(30,140,190,.8)}.ie8 .notice-dismiss:focus{outline:1px solid #5b9dd9}.notice-success,div.updated{border-left-color:#46b450}.notice-success.notice-alt{background-color:#ecf7ed}.notice-warning{border-left-color:#ffb900}.notice-warning.notice-alt{background-color:#fff8e5}.notice-error,div.error{border-left-color:#dc3232}.notice-error.notice-alt{background-color:#fbeaea}.notice-info{border-left-color:#00a0d2}.notice-info.notice-alt{background-color:#e5f5fa}.button.installed:before,.button.installing:before,.button.updated-message:before,.button.updating-message:before,.import-php .updating-message:before,.update-message p:before,.updated-message p:before,.updating-message p:before{display:inline-block;font:normal 20px/1 dashicons;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;vertical-align:top}.media-upload-form .notice,.media-upload-form div.error,.wrap .notice,.wrap div.error,.wrap div.updated{margin:5px 0 15px}.wrap #templateside .notice{display:block;margin:0;padding:5px 8px;font-weight:600;text-decoration:none}.wrap #templateside span.notice{margin-left:-12px}#templateside li.notice a{padding:0}.button.installing:before,.button.updating-message:before,.import-php .updating-message:before,.update-message p:before,.updating-message p:before{color:#f56e28;content:"\f463"}.button.installing:before,.button.updating-message:before,.import-php .updating-message:before,.updating-message p:before{animation:rotation 2s infinite linear}.button.updated-message:before,.installed p:before,.updated-message p:before{color:#79ba49;content:"\f147"}.update-message.notice-error p:before{color:#dc3232;content:"\f534"}.import-php .updating-message:before,.wrap .notice p:before{margin-right:6px;vertical-align:bottom}#update-nag,.update-nag{display:inline-block;line-height:1.4;padding:11px 15px;font-size:14px;text-align:left;margin:25px 20px 0 2px;background-color:#fff;border-left:4px solid #ffba00;box-shadow:0 1px 1px 0 rgba(0,0,0,.1)}ul#dismissed-updates{display:none}#dismissed-updates li>p{margin-top:0}#dismiss,#undismiss{margin-left:.5em}form.upgrade{margin-top:8px}form.upgrade .hint{font-style:italic;font-size:85%;margin:-.5em 0 2em 0}.update-php .spinner{float:none;margin:-4px 0}#ajax-loading,.ajax-feedback,.ajax-loading,.imgedit-wait-spin,.list-ajax-loading{visibility:hidden}#ajax-response.alignleft{margin-left:2em}.button.installed:before,.button.installing:before,.button.updated-message:before,.button.updating-message:before{margin:3px 5px 0 -2px}.button-primary.updating-message:before{color:#fff}.button-primary.updated-message:before{color:#66c6e4}.button.updated-message{transition-property:border,background,color;transition-duration:.05s;transition-timing-function:ease-in-out}@media aural{.button.installed:before,.button.installing:before,.update-message p:before,.wrap .notice p:before{speak:none}}#adminmenu a,#catlist a,#taglist a{text-decoration:none}#contextual-help-wrap,#screen-options-wrap{margin:0;padding:8px 20px 12px;position:relative}#contextual-help-wrap{overflow:auto;margin-left:0!important}#screen-meta-links{float:right;margin:0 20px 0 0}#screen-meta{display:none;margin:0 20px -1px 0;position:relative;background-color:#fff;border:1px solid #ddd;border-top:none;box-shadow:0 1px 0 rgba(0,0,0,.025)}#contextual-help-link-wrap,#screen-options-link-wrap{float:left;margin:0 0 0 6px}#screen-meta-links .screen-meta-toggle{position:relative;top:0}#screen-meta-links .show-settings{border:1px solid #ddd;border-top:none;border-bottom-color:#ccc;height:auto;margin-bottom:0;padding:3px 6px 3px 16px;background:#fff;border-radius:0;color:#72777c;line-height:1.7;box-shadow:none}#screen-meta-links .show-settings:active,#screen-meta-links .show-settings:focus,#screen-meta-links .show-settings:hover{color:#32373c}#screen-meta-links .show-settings:focus{border-color:#5b9dd9;box-shadow:0 0 3px rgba(0,115,170,.8)}#screen-meta-links .show-settings:active{transform:none}#screen-meta-links .show-settings:after{right:0;content:"\f140";font:normal 20px/1 dashicons;speak:none;display:inline-block;padding:0 5px 0 0;bottom:2px;position:relative;vertical-align:bottom;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-decoration:none!important;color:#72777c}#screen-meta-links .screen-meta-active:after{content:"\f142"}.toggle-arrow{background-repeat:no-repeat;background-position:top left;background-color:transparent;height:22px;line-height:22px;display:block}.toggle-arrow-active{background-position:bottom left}#contextual-help-wrap h5,#screen-options-wrap h5,#screen-options-wrap legend{margin:0;padding:8px 0;font-size:13px;font-weight:600}.ie8 #screen-options-wrap legend{color:inherit}.metabox-prefs label{display:inline-block;padding-right:15px;line-height:2.35}#number-of-columns{display:inline-block;vertical-align:middle;line-height:30px}.metabox-prefs input[type=checkbox]{margin-top:0;margin-right:6px}.metabox-prefs label input,.metabox-prefs label input[type=checkbox]{margin:-4px 5px 0 0}.metabox-prefs .columns-prefs label input{margin:-1px 2px 0 0}.metabox-prefs label a{display:none}.metabox-prefs .screen-options input,.metabox-prefs .screen-options label{margin-top:0;margin-bottom:0;vertical-align:middle}.metabox-prefs .screen-options .screen-per-page{margin-right:15px}.metabox-prefs .screen-options label{line-height:2.2;padding-right:0}.screen-options+.screen-options{margin-top:10px}.metabox-prefs .submit{margin-top:1em;padding:0}#contextual-help-wrap{padding:0}#contextual-help-columns{position:relative}#contextual-help-back{position:absolute;top:0;bottom:0;left:150px;right:170px;border:1px solid #e1e1e1;border-top:none;border-bottom:none;background:#f6fbfd}#contextual-help-wrap.no-sidebar #contextual-help-back{right:0;border-right-width:0;border-bottom-right-radius:2px}.contextual-help-tabs{float:left;width:150px;margin:0}.contextual-help-tabs ul{margin:1em 0}.contextual-help-tabs li{margin-bottom:0;list-style-type:none;border-style:solid;border-width:0 0 0 2px;border-color:transparent}.contextual-help-tabs a{display:block;padding:5px 5px 5px 12px;line-height:1.4;text-decoration:none;border:1px solid transparent;border-right:none;border-left:none}.contextual-help-tabs a:hover{color:#32373c}.contextual-help-tabs .active{padding:0;margin:0 -1px 0 0;border-left:2px solid #00a0d2;background:#f6fbfd;box-shadow:0 2px 0 rgba(0,0,0,.02),0 1px 0 rgba(0,0,0,.02)}.contextual-help-tabs .active a{border-color:#e1e1e1;color:#32373c}.contextual-help-tabs-wrap{padding:0 20px;overflow:auto}.help-tab-content{display:none;margin:0 22px 12px 0;line-height:1.6}.help-tab-content.active{display:block}.help-tab-content ul li{list-style-type:disc;margin-left:18px}.contextual-help-sidebar{width:150px;float:right;padding:0 8px 0 12px;overflow:auto}html.wp-toolbar{padding-top:32px;box-sizing:border-box}.widefat td,.widefat th{color:#555}.widefat tfoot td,.widefat th,.widefat thead td{font-weight:400}.widefat tfoot tr td,.widefat tfoot tr th,.widefat thead tr td,.widefat thead tr th{color:#32373c}.widefat td p{margin:2px 0 .8em}.widefat ol,.widefat p,.widefat ul{color:#32373c}.widefat .column-comment p{margin:.6em 0}.widefat .column-comment ul{list-style:initial;margin-left:2em}.postbox-container{float:left}.postbox-container .meta-box-sortables{box-sizing:border-box}#wpbody-content .metabox-holder{padding-top:10px}.metabox-holder .postbox-container .empty-container{border:3px dashed #b4b9be;height:250px;position:relative}.metabox-holder .postbox-container .empty-container:after{content:attr(data-emptystring);margin:auto;position:absolute;top:0;left:0;bottom:0;right:0;height:1em;width:200px;text-align:center;color:#ccc;font-size:18px;display:none}.columns-2 #postbox-container-3 .empty-container,.columns-2 #postbox-container-4 .empty-container,.columns-3 #postbox-container-4 .empty-container,.metabox-holder.columns-1 .postbox-container .empty-container{border:0 none;height:0;min-height:0}#post-body-content{width:100%;min-width:463px;float:left}#post-body.columns-2 #postbox-container-1{float:right;margin-right:-300px;width:280px}#post-body.columns-2 #side-sortables{min-height:250px}@media only screen and (max-width:799px){#wpbody-content .metabox-holder .postbox-container .empty-container{border:0 none;height:0;min-height:0}}.js .postbox .hndle,.js .widget .widget-top{cursor:move}.hndle a{font-size:11px;font-weight:400}.postbox .handlediv{display:none;float:right;width:36px;height:36px;margin:0;padding:0;border:0;background:0 0;cursor:pointer}.js .postbox .handlediv{display:block}.sortable-placeholder{border:1px dashed #b4b9be;margin-bottom:20px}.postbox,.stuffbox{margin-bottom:20px;padding:0;line-height:1}.postbox .hndle,.stuffbox .hndle{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.postbox .inside{padding:0 12px 12px;line-height:1.4;font-size:13px}.stuffbox .inside{padding:0;line-height:1.4;font-size:13px;margin-top:0}.postbox .inside{margin:11px 0;position:relative}.postbox .inside>p:last-child,.rss-widget ul li:last-child{margin-bottom:1px!important}.postbox.closed h3{border:none;box-shadow:none}.postbox table.form-table{margin-bottom:0}.postbox table.widefat{box-shadow:none}.temp-border{border:1px dotted #ccc}.columns-prefs label{padding:0 10px 0 0}#adminmenu .wp-submenu li.current,#adminmenu .wp-submenu li.current a,#adminmenu .wp-submenu li.current a:hover,#dashboard_right_now .versions .b,#ed_reply_toolbar #ed_reply_strong,#pass-strength-result.short,#pass-strength-result.strong,#post-status-display,#post-visibility-display,.feature-filter .feature-name,.item-controls .item-order a,.media-item .percent,.plugins .name{font-weight:600}#wpfooter{position:absolute;bottom:0;left:0;right:0;padding:10px 20px;color:#555d66}#wpfooter p{font-size:13px;margin:0;line-height:1.55}#footer-thankyou{font-style:italic}.nav-tab{float:left;border:1px solid #ccc;border-bottom:none;margin-left:.5em;padding:5px 10px;font-size:14px;line-height:1.71428571;font-weight:600;background:#e5e5e5;color:#555;text-decoration:none;white-space:nowrap}.nav-tab-small .nav-tab,h3 .nav-tab{padding:5px 14px;font-size:12px;line-height:1.33}.nav-tab:focus,.nav-tab:hover{background-color:#fff;color:#444}.nav-tab-active,.nav-tab:focus:active{box-shadow:none}.nav-tab-active{margin-bottom:-1px;color:#444}.nav-tab-active,.nav-tab-active:focus,.nav-tab-active:focus:active,.nav-tab-active:hover{border-bottom:1px solid #f1f1f1;background:#f1f1f1;color:#000}.nav-tab-wrapper,.wrap h2.nav-tab-wrapper,h1.nav-tab-wrapper{border-bottom:1px solid #ccc;margin:0;padding-top:9px;padding-bottom:0;line-height:inherit}.nav-tab-wrapper:not(.wp-clearfix):after{content:"";display:table;clear:both}.ie8 .nav-tab-wrapper{display:inline-block;width:100%;vertical-align:top}.spinner{background:url(../images/spinner.gif) no-repeat;background-size:20px 20px;display:inline-block;visibility:hidden;float:right;vertical-align:middle;opacity:.7;filter:alpha(opacity=70);width:20px;height:20px;margin:4px 10px 0}.loading-content .spinner,.spinner.is-active{visibility:visible}#template>div{margin-right:16em}#template .notice{margin-top:1em;margin-right:3%}#template .notice p{width:auto}#template .submit .spinner{float:none}.metabox-holder .postbox>h3,.metabox-holder .stuffbox>h3,.metabox-holder h2.hndle,.metabox-holder h3.hndle{font-size:14px;padding:8px 12px;margin:0;line-height:1.4}.nav-menus-php .metabox-holder h3{padding:10px 10px 11px 14px;line-height:1.5}#templateside ul li a{text-decoration:none}.plugin-install #description,.plugin-install-network #description{width:60%}table .column-rating,table .column-visible,table .vers{text-align:left}.attention,.error-message{color:#dc3232;font-weight:600}body.iframe{height:98%}.lp-show-latest p{display:none}.lp-show-latest .lp-error p,.lp-show-latest p:last-child{display:block}.media-icon{width:62px;text-align:center}.media-icon img{border:1px solid #e5e5e5;border:1px solid rgba(0,0,0,.07)}#howto{font-size:11px;margin:0 5px;display:block}.importers{font-size:16px;width:auto}.importers td{padding-right:14px;line-height:1.4}.importers .import-system{max-width:250px}.importers td.desc{max-width:500px}.importer-action,.importer-desc,.importer-title{display:block}.importer-title{color:#000;font-size:14px;font-weight:400;margin-bottom:.2em}.importer-action{line-height:1.55;color:#555;margin-bottom:1em}#post-body #post-body-content #namediv h2,#post-body #post-body-content #namediv h3{margin-top:0}.edit-comment-author{color:#222;border-bottom:1px solid #eee}#namediv h2 label,#namediv h3 label{vertical-align:baseline}#namediv table{width:100%}#namediv td.first{width:10px;white-space:nowrap}#namediv input{width:98%}#namediv p{margin:10px 0}#submitdiv h3{margin-bottom:0!important}.zerosize{height:0;width:0;margin:0;border:0;padding:0;overflow:hidden;position:absolute}br.clear{height:2px;line-height:.15}.checkbox{border:none;margin:0;padding:0}fieldset{border:0;padding:0;margin:0}.post-categories{display:inline;margin:0;padding:0}.post-categories li{display:inline}div.star-holder{position:relative;height:17px;width:100px;background:url(../images/stars.png?ver=20121108) repeat-x bottom left}div.star-holder .star-rating{background:url(../images/stars.png?ver=20121108) repeat-x top left;height:17px;float:left}.star-rating{white-space:nowrap}.star-rating .star{display:inline-block;width:20px;height:20px;-webkit-font-smoothing:antialiased;font-size:20px;line-height:1;font-family:dashicons;text-decoration:inherit;font-weight:400;font-style:normal;vertical-align:top;transition:color .1s ease-in;text-align:center;color:#ffb900}.star-rating .star-full:before{content:"\f155"}.star-rating .star-half:before{content:"\f459"}.rtl .star-rating .star-half{transform:rotateY(180deg)}.star-rating .star-empty:before{content:"\f154"}div.action-links{font-weight:400;margin:6px 0 0}#plugin-information{background:#fff;position:fixed;top:0;right:0;bottom:0;left:0;height:100%;padding:0}#plugin-information-scrollable{overflow:auto;-webkit-overflow-scrolling:touch;height:100%}#plugin-information-title{padding:0 26px;background:#f5f5f5;font-size:22px;font-weight:600;line-height:2.4;position:relative;height:56px}#plugin-information-title.with-banner{margin-right:0;height:250px;background-size:cover}#plugin-information-title h2{font-size:1em;font-weight:600;padding:0;margin:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}#plugin-information-title.with-banner h2{position:relative;font-family:"Helvetica Neue",sans-serif;display:inline-block;font-size:30px;line-height:1.68;box-sizing:border-box;max-width:100%;padding:0 15px;margin-top:174px;color:#fff;background:rgba(30,30,30,.9);text-shadow:0 1px 3px rgba(0,0,0,.4);box-shadow:0 0 30px rgba(255,255,255,.1);border-radius:8px}#plugin-information-title div.vignette{display:none}#plugin-information-title.with-banner div.vignette{position:absolute;display:block;top:0;left:0;height:250px;width:100%;background:0 0;box-shadow:inset 0 0 50px 4px rgba(0,0,0,.2),inset 0 -1px 0 rgba(0,0,0,.1)}#plugin-information-tabs{padding:0 16px;position:relative;right:0;left:0;min-height:36px;font-size:0;z-index:1;border-bottom:1px solid #ddd;background:#f3f3f3}#plugin-information-tabs a{position:relative;display:inline-block;padding:9px 10px;margin:0;height:18px;line-height:1.3;font-size:14px;text-decoration:none;transition:none}#plugin-information-tabs a.current{margin:0 -1px -1px;background:#fff;border:1px solid #ddd;border-bottom-color:#fff;padding-top:8px;color:#32373c}#plugin-information-tabs.with-banner a.current{border-top:none;padding-top:9px}#plugin-information-tabs a:active,#plugin-information-tabs a:focus{outline:0}#plugin-information-content{overflow:hidden;background:#fff;position:relative;top:0;right:0;left:0;min-height:100%;min-height:calc(100% - 152px)}#plugin-information-content.with-banner{min-height:calc(100% - 346px)}#section-holder{position:relative;top:0;right:250px;bottom:0;left:0;margin-top:10px;margin-right:250px;padding:10px 26px;margin-bottom:-99939px;padding-bottom:99999px}#section-holder .notice{margin:5px 0 15px}#section-holder .updated{margin:16px 0}#plugin-information .fyi{float:right;position:relative;top:0;right:0;padding:16px;margin-bottom:-99939px;padding-bottom:99999px;width:217px;border-left:1px solid #ddd;background:#f3f3f3;color:#666}#plugin-information .fyi strong{color:#444}#plugin-information .fyi h3{font-weight:600;text-transform:uppercase;font-size:12px;color:#666;margin:24px 0 8px}#plugin-information .fyi h2{font-size:.9em;margin-bottom:0;margin-right:0}#plugin-information .fyi ul{padding:0;margin:0;list-style:none}#plugin-information .fyi li{margin:0 0 10px}#plugin-information .fyi-description{margin-top:0}#plugin-information .counter-container{margin:3px 0}#plugin-information .counter-label{float:left;margin-right:5px;min-width:55px}#plugin-information .counter-back{height:17px;width:92px;background-color:#e5e5e5;float:left}#plugin-information .counter-bar{height:17px;background-color:#ffc733;float:left}#plugin-information .counter-count{margin-left:5px}#plugin-information .fyi ul.contributors{margin-top:10px}#plugin-information .fyi ul.contributors li{display:inline-block;margin-right:8px;vertical-align:middle}#plugin-information .fyi ul.contributors li{display:inline-block;margin-right:8px;vertical-align:middle}#plugin-information .fyi ul.contributors li img{vertical-align:middle;margin-right:4px}#plugin-information-footer{padding:13px 16px;position:absolute;right:0;bottom:0;left:0;height:33px;border-top:1px solid #ddd;background:#f3f3f3}#plugin-information .section{direction:ltr}#plugin-information .section ol,#plugin-information .section ul{list-style-type:disc;margin-left:24px}#plugin-information .section,#plugin-information .section p{font-size:14px;line-height:1.7}#plugin-information #section-screenshots ol{list-style:none;margin:0}#plugin-information #section-screenshots li img{vertical-align:text-top;margin-top:16px;max-width:100%;width:auto;height:auto;box-shadow:0 1px 2px rgba(0,0,0,.3)}#plugin-information #section-screenshots li p{font-style:italic;padding-left:20px}#plugin-information pre{padding:7px;overflow:auto;border:1px solid #ccc}#plugin-information blockquote{border-left:2px solid #ddd;color:#666;font-style:italic;margin:1em 0;padding:0 0 0 1em}#plugin-information .review{overflow:hidden;width:100%;margin-bottom:20px;border-bottom:1px solid #e5e5e5}#plugin-information .review-title-section{overflow:hidden}#plugin-information .review-title-section h4{display:inline-block;float:left;margin:0 6px 0 0}#plugin-information .reviewer-info p{clear:both;margin:0;padding-top:2px}#plugin-information .reviewer-info .avatar{float:left;margin:4px 6px 0 0}#plugin-information .reviewer-info .star-rating{float:left}#plugin-information .review-meta{float:left;margin-left:.75em}#plugin-information .review-body{float:left;width:100%}.plugin-version-author-uri{font-size:13px}.update-php .button.button-primary{margin-right:1em}@media screen and (max-width:771px){#plugin-information-title.with-banner{height:100px}#plugin-information-title.with-banner h2{margin-top:30px;font-size:20px;line-height:2;max-width:85%}#plugin-information-title.with-banner div.vignette{height:100px}#plugin-information-tabs{overflow:hidden;padding:0;height:auto}#plugin-information-tabs a.current{margin-bottom:0;border-bottom:none}#plugin-information .fyi{float:none;border:1px solid #ddd;position:static;width:auto;margin:26px 26px 0;padding-bottom:0}#section-holder{position:static;margin:0;padding-bottom:70px}#plugin-information .fyi h3,#plugin-information .fyi small{display:none}#plugin-information-footer{padding:12px 16px 0;height:46px}}#TB_window.plugin-details-modal{background:#fcfcfc}#TB_window.plugin-details-modal.thickbox-loading:before{content:"";display:block;width:20px;height:20px;position:absolute;left:50%;top:50%;z-index:-1;margin:-10px 0 0 -10px;background:#fcfcfc url(../images/spinner.gif) no-repeat center;background-size:20px 20px;transform:translateZ(0)}@media print,(-webkit-min-device-pixel-ratio:1.25),(min-resolution:120dpi){#TB_window.plugin-details-modal.thickbox-loading:before{background-image:url(../images/spinner-2x.gif)}}.plugin-details-modal #TB_title{float:left;height:1px}.plugin-details-modal #TB_ajaxWindowTitle{display:none}.plugin-details-modal #TB_closeWindowButton{left:auto;right:-30px;color:#eee}.plugin-details-modal #TB_closeWindowButton:focus,.plugin-details-modal #TB_closeWindowButton:hover{color:#00a0d2;outline:0;box-shadow:none}.plugin-details-modal .tb-close-icon{display:none}.plugin-details-modal #TB_closeWindowButton:after{content:"\f335";font:normal 32px/29px dashicons;speak:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}@media screen and (max-width:830px){.plugin-details-modal #TB_closeWindowButton{right:0;top:-30px}}img{border:none}.bulk-action-notice .toggle-indicator:before,.js .meta-box-sortables .postbox .toggle-indicator:before,.privacy-text-box .toggle-indicator:before,.sidebar-name .toggle-indicator:before{content:"\f142";display:inline-block;font:normal 20px/1 dashicons;speak:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-decoration:none!important}.bulk-action-notice .bulk-action-errors-collapsed .toggle-indicator:before,.js .meta-box-sortables .postbox.closed .handlediv .toggle-indicator:before,.js .widgets-holder-wrap.closed .toggle-indicator:before,.privacy-text-box.closed .toggle-indicator:before{content:"\f140"}.js .postbox .handlediv .toggle-indicator:before{margin-top:4px;width:20px;border-radius:50%;text-indent:-1px}.rtl.js .postbox .handlediv .toggle-indicator:before{text-indent:1px}.bulk-action-notice .toggle-indicator:before{line-height:16px;vertical-align:top;color:#72777c}.js .postbox .handlediv:focus{box-shadow:none;outline:0}.js .postbox .handlediv:focus .toggle-indicator:before{box-shadow:0 0 0 1px #5b9dd9,0 0 2px 1px rgba(30,140,190,.8)}#photo-add-url-div input[type=text]{width:300px}.alignleft h2{margin:0}#template textarea{font-family:Consolas,Monaco,monospace;font-size:13px;background:#f9f9f9;-moz-tab-size:4;-o-tab-size:4;tab-size:4}#template .CodeMirror,#template textarea{width:100%;min-height:60vh;height:calc(100vh - 295px);border:1px solid #ddd;box-sizing:border-box}#templateside>h2{padding-top:6px;padding-bottom:7px;margin:0}#templateside ol,#templateside ul{margin:0;padding:0}#templateside>ul{box-sizing:border-box;margin-top:0;overflow:auto;padding:0;min-height:60vh;height:calc(100vh - 295px);background-color:#f7f7f7;border:1px solid #ddd;border-left:none}#templateside ul ul{padding-left:12px}#templateside>ul>li>ul[role=group]{padding-left:0}[role=treeitem][aria-expanded=false]>ul{display:none}[role=treeitem] span[aria-hidden]{display:inline;font-family:dashicons;font-size:20px;position:absolute;pointer-events:none}[role=treeitem][aria-expanded=false]>.folder-label .icon:after{content:"\f139"}[role=treeitem][aria-expanded=true]>.folder-label .icon:after{content:"\f140"}[role=treeitem] .folder-label{display:block;padding:3px 3px 3px 12px;cursor:pointer}[role=treeitem]{outline:0}[role=treeitem] .folder-label.focus{color:#124964;box-shadow:0 0 0 1px #5b9dd9,0 0 2px 1px rgba(30,140,190,.8)}[role=treeitem] .folder-label.hover,[role=treeitem].hover{background-color:#eaeaea}.tree-folder{margin:0;position:relative}[role=treeitem] li{position:relative}.tree-folder .tree-folder::after{content:"";display:block;position:absolute;left:2px;border-left:1px solid #ccc;top:-13px;bottom:10px}.tree-folder>li::before{content:"";position:absolute;display:block;border-left:1px solid #ccc;left:2px;top:-5px;height:18px;width:7px;border-bottom:1px solid #ccc}.tree-folder>li::after{content:"";position:absolute;display:block;border-left:1px solid #ccc;left:2px;bottom:-7px;top:0}#templateside .current-file{margin:-4px 0 -2px}.tree-folder>.current-file::before{left:4px;height:15px;width:0;border-left:none;top:3px}.tree-folder>.current-file::after{bottom:-4px;height:7px;left:2px;top:auto}.tree-folder li:last-child>.tree-folder::after,.tree-folder>li:last-child::after{display:none}#theme-plugin-editor-label{display:inline-block;margin-bottom:1em;font-weight:600}#docs-list,#template textarea{direction:ltr}.fileedit-sub #plugin,.fileedit-sub #theme{max-width:40%}.fileedit-sub .alignright{text-align:right}#template p{width:97%}#file-editor-linting-error{margin-top:1em;margin-bottom:1em}#file-editor-linting-error>.notice{margin:0;display:inline-block}#file-editor-linting-error>.notice>p{width:auto}#template .submit{margin-top:1em;padding:0}#template .submit input[type=submit][disabled]{cursor:not-allowed}#templateside{float:right;width:16em;word-wrap:break-word}#postcustomstuff p.submit{margin:0}#templateside h4{margin:1em 0 0}#templateside li{margin:4px 0}#templateside li:not(.howto) a,.theme-editor-php .highlight{display:block;padding:3px 0 3px 12px;text-decoration:none}#templateside li:not(.howto)>a:first-of-type{padding-top:0}#templateside li.howto{padding:6px 12px 12px 12px}.theme-editor-php .highlight{margin:-3px 3px -3px -12px}#templateside .highlight{border:none;font-weight:600}.nonessential{color:#666;font-size:11px;font-style:italic;padding-left:12px}#documentation{margin-top:10px}#documentation label{line-height:1.8;vertical-align:baseline;font-weight:600}.fileedit-sub{padding:10px 0 8px;line-height:180%}#file-editor-warning .file-editor-warning-content{margin:25px}.accordion-section-title:after,.control-section .accordion-section-title:after,.nav-menus-php .item-edit:before,.widget-top .widget-action .toggle-indicator:before{content:"\f140";font:normal 20px/1 dashicons;speak:none;display:block;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-decoration:none!important}.widget-top .widget-action .toggle-indicator:before{padding:1px 2px 1px 0;border-radius:50%}.accordion-section-title:after,.handlediv,.item-edit,.postbox .handlediv.button-link,.toggle-indicator{color:#72777c}.widget-action{color:#555d66}.accordion-section-title:hover:after,.handlediv:focus,.handlediv:hover,.item-edit:focus,.item-edit:hover,.postbox .handlediv.button-link:focus,.postbox .handlediv.button-link:hover,.sidebar-name:hover .toggle-indicator,.widget-action:focus,.widget-top:hover .widget-action{color:#23282d}.widget-top .widget-action:focus .toggle-indicator:before{box-shadow:0 0 0 1px #5b9dd9,0 0 2px 1px rgba(30,140,190,.8)}.accordion-section-title:after,.control-section .accordion-section-title:after{float:right;right:20px;top:-2px}#customize-info.open .accordion-section-title:after,.control-section.open .accordion-section-title:after,.nav-menus-php .menu-item-edit-active .item-edit:before,.widget.open .widget-top .widget-action .toggle-indicator:before,.widget.widget-in-question .widget-top .widget-action .toggle-indicator:before{content:"\f142"}/*!
+ * jQuery UI Draggable/Sortable 1.11.4
+ * http://jqueryui.com
+ *
+ * Copyright jQuery Foundation and other contributors
+ * Released under the MIT license.
+ * http://jquery.org/license
+ */.ui-draggable-handle,.ui-sortable-handle{touch-action:none}.accordion-section{border-bottom:1px solid #ddd;margin:0}.accordion-section.open .accordion-section-content,.no-js .accordion-section .accordion-section-content{display:block}.accordion-section.open:hover{border-bottom-color:#ddd}.accordion-section-content{display:none;padding:10px 20px 15px;overflow:hidden;background:#fff}.accordion-section-title{margin:0;padding:12px 15px 15px;position:relative;border-left:1px solid #ddd;border-right:1px solid #ddd;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.js .accordion-section-title{cursor:pointer}.js .accordion-section-title:after{position:absolute;top:12px;right:10px;z-index:1}.accordion-section-title:focus{outline:0}.accordion-section-title:focus:after,.accordion-section-title:hover:after{border-color:#a0a5aa transparent}.cannot-expand .accordion-section-title{cursor:auto}.cannot-expand .accordion-section-title:after{display:none}.control-section .accordion-section-title,.customize-pane-child .accordion-section-title{border-left:none;border-right:none;padding:10px 10px 11px 14px;line-height:1.55;background:#fff}.control-section .accordion-section-title:after,.customize-pane-child .accordion-section-title:after{top:calc(50% - 10px)}.js .control-section .accordion-section-title:focus,.js .control-section .accordion-section-title:hover,.js .control-section.open .accordion-section-title,.js .control-section:hover .accordion-section-title{color:#23282d;background:#f5f5f5}.control-section.open .accordion-section-title{border-bottom:1px solid #ddd}.network-admin .edit-site-actions{margin-top:0}.my-sites{display:block;overflow:auto;zoom:1}.my-sites li{display:block;padding:8px 3%;min-height:130px;margin:0}@media only screen and (max-width:599px){.my-sites li{min-height:0}}@media only screen and (min-width:600px){.my-sites.striped li{background-color:#fff;position:relative}.my-sites.striped li:after{content:"";width:1px;height:100%;position:absolute;top:0;right:0;background:#ccc}}@media only screen and (min-width:600px) and (max-width:699px){.my-sites li{float:left;width:44%}.my-sites.striped li{background-color:#fff}.my-sites.striped li:nth-of-type(2n+1){clear:left}.my-sites.striped li:nth-of-type(2n+2):after{content:none}.my-sites li:nth-of-type(4n+1),.my-sites li:nth-of-type(4n+2){background-color:#f9f9f9}}@media only screen and (min-width:700px) and (max-width:1199px){.my-sites li{float:left;width:27.333333%;background-color:#fff}.my-sites.striped li:nth-of-type(3n+3):after{content:none}.my-sites li:nth-of-type(6n+1),.my-sites li:nth-of-type(6n+2),.my-sites li:nth-of-type(6n+3){background-color:#f9f9f9}}@media only screen and (min-width:1200px) and (max-width:1399px){.my-sites li{float:left;width:21%;padding:8px 2%;background-color:#fff}.my-sites.striped li:nth-of-type(4n+1){clear:left}.my-sites.striped li:nth-of-type(4n+4):after{content:none}.my-sites li:nth-of-type(8n+1),.my-sites li:nth-of-type(8n+2),.my-sites li:nth-of-type(8n+3),.my-sites li:nth-of-type(8n+4){background-color:#f9f9f9}}@media only screen and (min-width:1400px) and (max-width:1599px){.my-sites li{float:left;width:16%;padding:8px 2%;background-color:#fff}.my-sites.striped li:nth-of-type(5n+1){clear:left}.my-sites.striped li:nth-of-type(5n+5):after{content:none}.my-sites li:nth-of-type(10n+1),.my-sites li:nth-of-type(10n+2),.my-sites li:nth-of-type(10n+3),.my-sites li:nth-of-type(10n+4),.my-sites li:nth-of-type(10n+5){background-color:#f9f9f9}}@media only screen and (min-width:1600px){.my-sites li{float:left;width:12.666666%;padding:8px 2%;background-color:#fff}.my-sites.striped li:nth-of-type(6n+1){clear:left}.my-sites.striped li:nth-of-type(6n+6):after{content:none}.my-sites li:nth-of-type(12n+1),.my-sites li:nth-of-type(12n+2),.my-sites li:nth-of-type(12n+3),.my-sites li:nth-of-type(12n+4),.my-sites li:nth-of-type(12n+5),.my-sites li:nth-of-type(12n+6){background-color:#f9f9f9}}.my-sites li a{text-decoration:none}@media print,(-webkit-min-device-pixel-ratio:1.25),(min-resolution:120dpi){div.star-holder,div.star-holder .star-rating{background:url(../images/stars-2x.png?ver=20121108) repeat-x bottom left;background-size:21px 37px}.spinner{background-image:url(../images/spinner-2x.gif)}#bulk-titles div a,#bulk-titles div a:hover,#screen-meta-links a.show-settings,.curtime #timestamp,.meta-box-sortables .postbox:hover .handlediv,.sidebar-name .toggle-indicator,.sidebar-name:hover .toggle-indicator,.widget-top .widget-action,.widget-top .widget-action:hover{background:0 0!important}}@-ms-viewport{width:device-width}@media screen and (max-width:782px){html.wp-toolbar{padding-top:46px}.screen-reader-shortcut:focus{top:-39px}body{min-width:240px;overflow-x:hidden}body *{-webkit-tap-highlight-color:rgba(0,0,0,0)!important}#wpcontent{position:relative;margin-left:0;padding-left:10px}#wpbody-content{padding-bottom:100px}.wrap{clear:both;margin-right:12px;margin-left:0}#col-left,#col-right{float:none;width:auto}#col-left .col-wrap,#col-right .col-wrap{padding:0}#collapse-menu,.post-format-select{display:none!important}.wrap h1.wp-heading-inline{margin-bottom:.5em}.wrap .add-new-h2,.wrap .add-new-h2:active,.wrap .page-title-action,.wrap .page-title-action:active{padding:10px 15px;font-size:14px;white-space:nowrap}.media-upload-form div.error,.notice,.wrap div.error,.wrap div.updated{margin:20px 0 10px 0;padding:5px 10px;font-size:14px;line-height:175%}.wp-core-ui .notice.is-dismissible{padding-right:46px}.notice-dismiss{padding:13px}.wrap .icon32+h2{margin-top:-2px}.wp-responsive-open #wpbody{right:-16em}code{word-wrap:break-word}.postbox{font-size:14px}.metabox-holder .postbox>h3,.metabox-holder .stuffbox>h3,.metabox-holder h2,.metabox-holder h3.hndle{padding:12px}.postbox .handlediv{margin-top:3px}.subsubsub{font-size:16px;text-align:center;margin-bottom:15px}#template .CodeMirror,#template textarea{box-sizing:border-box}#templateside{float:none;width:auto}#templateside>ul{border-left:1px solid #ddd}#templateside li{margin:0}#templateside li:not(.howto) a{display:block;padding:5px}#templateside li.howto{padding:12px}#templateside .highlight{padding:5px;margin-left:-5px;margin-top:-5px}#template .notice,#template>div{float:none;margin:1em 0;width:auto}#template .CodeMirror,#template textarea{width:100%}#templateside ul ul{padding-left:1.5em}[role=treeitem] .folder-label{display:block;padding:5px}.tree-folder .tree-folder::after,.tree-folder>li::after,.tree-folder>li::before{left:-8px}.tree-folder>li::before{top:0;height:13px}.tree-folder>.current-file::before{left:-5px;top:7px;width:4px}.tree-folder>.current-file::after{height:9px;left:-8px}.wrap #templateside span.notice{margin-left:-5px;width:100%}.fileedit-sub .alignright{float:left;margin-top:15px;width:100%;text-align:left}.fileedit-sub .alignright label{display:block}.fileedit-sub #plugin,.fileedit-sub #theme{margin-left:0;max-width:70%}.fileedit-sub input[type=submit]{margin-bottom:0;padding:8px 18px}#documentation label[for=docs-list]{display:block}#documentation select[name=docs-list]{margin-left:0;max-width:60%}#documentation input[type=button]{margin-bottom:0;padding:8px 18px}#wpfooter{display:none}#comments-form .checkforspam{display:none}.edit-comment-author{margin:2px 0 0}.filter-drawer .filter-group-feature input,.filter-drawer .filter-group-feature label{line-height:2.1}.filter-drawer .filter-group-feature label{margin-left:32px}.wp-filter .button.drawer-toggle{font-size:13px;line-height:2;height:28px}#screen-meta #contextual-help-wrap{overflow:visible}#screen-meta #contextual-help-back,#screen-meta .contextual-help-sidebar{display:none}#screen-meta .contextual-help-tabs{clear:both;width:100%;float:none}#screen-meta .contextual-help-tabs ul{margin:0 0 1em;padding:1em 0 0}#screen-meta .contextual-help-tabs .active{margin:0}#screen-meta .contextual-help-tabs-wrap{clear:both;max-width:100%;float:none}#screen-meta-links{margin-bottom:20px}}@media screen and (max-width:600px){#wpwrap.wp-responsive-open{overflow-x:hidden}html.wp-toolbar{padding-top:0}.screen-reader-shortcut:focus{top:7px}#wpbody{padding-top:46px}div#post-body.metabox-holder.columns-1{overflow-x:hidden}.nav-tab-wrapper,.wrap h2.nav-tab-wrapper,h1.nav-tab-wrapper{border-bottom:0}h1 .nav-tab,h2 .nav-tab,h3 .nav-tab,nav .nav-tab{margin:10px 10px 0 0;border-bottom:1px solid #ccc}.nav-tab-active:focus,.nav-tab-active:focus:active,.nav-tab-active:hover{border-bottom:1px solid #ccc}}@media screen and (max-width:320px){#network_dashboard_right_now .subsubsub{font-size:14px;text-align:left}} \ No newline at end of file
diff --git a/www/crm/wp-admin/css/customize-controls-rtl.css b/www/crm/wp-admin/css/customize-controls-rtl.css
new file mode 100644
index 00000000..0bfd07df
--- /dev/null
+++ b/www/crm/wp-admin/css/customize-controls-rtl.css
@@ -0,0 +1,2995 @@
+body {
+ overflow: hidden;
+ -webkit-text-size-adjust: 100%;
+}
+
+.customize-controls-close,
+.widget-control-actions a {
+ text-decoration: none;
+}
+
+#customize-controls h3 {
+ font-size: 14px;
+}
+
+#customize-controls img {
+ max-width: 100%;
+}
+
+#customize-controls .submit {
+ text-align: center;
+}
+
+#customize-controls #customize-notifications-area .notice.notification-overlay.notification-changeset-locked {
+ background-color: rgba(0, 0, 0, 0.7);
+ padding: 25px;
+}
+
+#customize-controls #customize-notifications-area .notice.notification-overlay.notification-changeset-locked .customize-changeset-locked-message {
+ margin-right: auto;
+ margin-left: auto;
+ max-width: 366px;
+ min-height: 64px;
+ width: auto;
+ padding: 25px 109px 25px 25px;
+ position: relative;
+ background: #fff;
+ box-shadow: 0 3px 6px rgba(0, 0, 0, 0.3);
+ line-height: 1.5;
+ overflow-y: auto;
+ text-align: right;
+ top: calc( 50% - 100px );
+}
+
+#customize-controls #customize-notifications-area .notice.notification-overlay.notification-changeset-locked .currently-editing {
+ margin-top: 0;
+}
+#customize-controls #customize-notifications-area .notice.notification-overlay.notification-changeset-locked .action-buttons {
+ margin-bottom: 0;
+}
+
+.customize-changeset-locked-avatar {
+ width: 64px;
+ position: absolute;
+ right: 25px;
+ top: 25px;
+}
+
+.wp-core-ui.wp-customizer .customize-changeset-locked-message a.button {
+ margin-left: 10px;
+ margin-top: 0;
+}
+
+#customize-controls .description {
+ color: #555d66;
+}
+
+#customize-save-button-wrapper {
+ float: left;
+ margin-top: 9px;
+}
+
+body:not(.ready) #customize-save-button-wrapper .save {
+ visibility: hidden;
+}
+#customize-save-button-wrapper .save {
+ float: right;
+ border-radius: 3px;
+ box-shadow: none; /* @todo Adjust box shadow based on the disable states of paired button. */
+ margin-top: 0;
+}
+
+#customize-save-button-wrapper .save:focus, #publish-settings:focus {
+ box-shadow: 0 1px 0 #0073aa, 0 0 2px 1px #33b3db; /* This is default box shadow for focus */
+}
+
+#customize-save-button-wrapper .save.has-next-sibling {
+ border-radius: 0 3px 3px 0;
+}
+
+#customize-sidebar-outer-content {
+ position: absolute;
+ top: 0;
+ bottom: 0;
+ right: 0;
+ visibility: hidden;
+ overflow-x: hidden;
+ overflow-y: auto;
+ width: 100%;
+ margin: 0;
+ z-index: -1;
+ background: #eee;
+ transition: right .18s;
+ border-left: 1px solid #ddd;
+ border-right: 1px solid #ddd;
+ height: 100%;
+}
+
+#customize-theme-controls .control-section-outer {
+ display: none !important;
+}
+
+#customize-outer-theme-controls .accordion-section-content {
+ padding: 12px;
+}
+
+#customize-outer-theme-controls .accordion-section-content.open {
+ display: block;
+}
+
+.outer-section-open .wp-full-overlay.expanded #customize-sidebar-outer-content {
+ visibility: visible;
+ right: 100%;
+ transition: right .18s;
+}
+
+.customize-outer-pane-parent {
+ margin: 0;
+}
+
+.outer-section-open .wp-full-overlay.expanded .wp-full-overlay-main {
+ right: 300px;
+ opacity: 0.4;
+}
+
+.outer-section-open .wp-full-overlay.expanded.preview-tablet .wp-full-overlay-main,
+.outer-section-open .wp-full-overlay.expanded.preview-mobile .wp-full-overlay-main,
+.adding-menu-items .wp-full-overlay.expanded.preview-tablet .wp-full-overlay-main,
+.adding-menu-items .wp-full-overlay.expanded.preview-mobile .wp-full-overlay-main,
+.adding-widget .wp-full-overlay.expanded.preview-tablet .wp-full-overlay-main,
+.adding-widget .wp-full-overlay.expanded.preview-mobile .wp-full-overlay-main {
+ right: 64%;
+}
+
+#customize-outer-theme-controls li.notice {
+ padding-top: 8px;
+ padding-bottom: 8px;
+ margin-right: 0;
+ margin-bottom: 10px;
+}
+
+#publish-settings {
+ text-indent: 0;
+ border-radius: 3px 0 0 3px;
+ padding-right: 0;
+ padding-left: 0;
+ box-shadow: none; /* @todo Adjust box shadow based on the disable states of paired button. */
+ font-size: 14px;
+ width: 30px;
+ float: right;
+ transform: none;
+ margin-top: 0;
+}
+
+body:not(.ready) #publish-settings,
+body.trashing #customize-save-button-wrapper .save,
+body.trashing #publish-settings {
+ display: none;
+}
+
+#customize-header-actions .spinner {
+ margin-top: 13px;
+ margin-left: 4px;
+}
+
+.saving #customize-header-actions .spinner,
+.trashing #customize-header-actions .spinner {
+ visibility: visible;
+}
+
+#customize-header-actions {
+ border-bottom: 1px solid #ddd;
+}
+
+#customize-controls .wp-full-overlay-sidebar-content {
+ overflow-y: auto;
+ overflow-x: hidden;
+}
+
+.outer-section-open #customize-controls .wp-full-overlay-sidebar-content {
+ background: #eee;
+}
+
+#customize-controls .customize-info {
+ border: none;
+ border-bottom: 1px solid #ddd;
+ margin-bottom: 15px;
+}
+
+#customize-control-changeset_status .customize-inside-control-row,
+#customize-control-changeset_preview_link input {
+ background-color: #ffffff;
+ border-bottom: 1px solid #ddd;
+ box-sizing: content-box;
+ width: 100%;
+ margin-right: -12px;
+ padding-right: 12px;
+ padding-left: 12px;
+}
+
+#customize-control-trash_changeset {
+ margin-top: 20px;
+}
+#customize-control-trash_changeset .button-link {
+ position: relative;
+ padding-right: 24px;
+ display: inline-block;
+}
+#customize-control-trash_changeset .button-link:before {
+ content: "\f182";
+ font: normal 22px dashicons;
+ text-decoration: none;
+ position: absolute;
+ right: 0;
+ top: -2px;
+}
+
+#customize-controls .date-input:invalid {
+ border-color: #dc3232;
+}
+
+#customize-control-changeset_status .customize-inside-control-row {
+ padding-top: 10px;
+ padding-bottom: 10px;
+ font-weight: 500;
+}
+
+#customize-control-changeset_status .customize-inside-control-row:first-of-type {
+ border-top: 1px solid #ddd;
+}
+
+#customize-control-changeset_status .customize-control-title {
+ margin-bottom: 6px;
+}
+
+#customize-control-changeset_status input {
+ margin-right: 0;
+}
+
+#customize-control-changeset_preview_link {
+ position: relative;
+ display: block;
+}
+
+.preview-link-wrapper .customize-copy-preview-link.preview-control-element.button {
+ margin: 0;
+ position: absolute;
+ bottom: 9px;
+ left: 0;
+}
+
+.preview-link-wrapper {
+ position: relative;
+}
+
+.customize-copy-preview-link:before,
+.customize-copy-preview-link:after {
+ content: "";
+ height: 28px;
+ position: absolute;
+ background: #ffffff;
+ top: -1px;
+}
+
+.customize-copy-preview-link:before {
+ right: -10px;
+ width: 9px;
+ opacity: 0.75;
+}
+
+.customize-copy-preview-link:after {
+ right: -5px;
+ width: 4px;
+ opacity: 0.8;
+}
+
+#customize-control-changeset_preview_link input {
+ line-height: 2.5;
+ border-top: 1px solid #ddd;
+ border-right: none;
+ border-left: none;
+ text-indent: -999px;
+ color: #fff;
+}
+
+#customize-control-changeset_preview_link label {
+ position: relative;
+ display: block;
+}
+
+#customize-control-changeset_preview_link a {
+ display: inline-block;
+ position: absolute;
+ white-space: nowrap;
+ overflow: hidden;
+ width: 90%;
+ bottom: 14px;
+ font-size: 14px;
+ text-decoration: none;
+}
+
+#customize-control-changeset_preview_link a.disabled,
+#customize-control-changeset_preview_link a.disabled:active,
+#customize-control-changeset_preview_link a.disabled:focus,
+#customize-control-changeset_preview_link a.disabled:visited {
+ color: black;
+ opacity: 0.4;
+ cursor: default;
+ outline: none;
+ box-shadow: none;
+}
+
+#sub-accordion-section-publish_settings .customize-section-description-container {
+ display: none;
+}
+
+#customize-controls .customize-info.section-meta {
+ margin-bottom: 15px;
+}
+
+.customize-control-date_time .customize-control-description + .date-time-fields.includes-time {
+ margin-top: 10px;
+}
+
+.customize-control.customize-control-date_time .date-time-fields .date-input.day {
+ margin-left: 0;
+}
+
+.date-time-fields .date-input.month {
+ width: auto;
+ margin: 0;
+}
+
+.date-time-fields .date-input.day,
+.date-time-fields .date-input.hour,
+.date-time-fields .date-input.minute {
+ width: 46px;
+}
+
+.date-time-fields .date-input.year {
+ width: 60px;
+}
+
+.date-time-fields .date-input.meridian {
+ width: auto;
+ margin: 0;
+}
+
+.date-time-fields .time-row {
+ margin-top: 12px;
+}
+
+.date-time-fields .date-timezone {
+ line-height: 2.2;
+ text-decoration: none;
+}
+
+#customize-control-changeset_preview_link {
+ margin-top: 6px;
+}
+
+#customize-control-changeset_status {
+ margin-bottom: 0;
+ padding-bottom: 0;
+}
+
+#customize-control-changeset_scheduled_date {
+ box-sizing: content-box;
+ width: 100%;
+ margin-right: -12px;
+ padding: 12px;
+ background: #ffffff;
+ border-bottom: 1px solid #ddd;
+ margin-bottom: 0;
+}
+
+#customize-control-changeset_scheduled_date .customize-control-description {
+ font-style: normal;
+}
+
+#customize-controls .customize-info.is-in-view,
+#customize-controls .customize-section-title.is-in-view {
+ position: absolute;
+ z-index: 9;
+ width: 100%;
+ box-shadow: 0 1px 0 rgba(0, 0, 0, 0.1);
+}
+
+#customize-controls .customize-section-title.is-in-view {
+ margin-top: 0;
+}
+
+#customize-controls .customize-info.is-in-view + .accordion-section {
+ margin-top: 15px;
+}
+
+#customize-controls .customize-info.is-sticky,
+#customize-controls .customize-section-title.is-sticky {
+ position: fixed;
+ top: 46px;
+}
+
+#customize-controls .customize-info .accordion-section-title {
+ background: #fff;
+ color: #555d66;
+ border-right: none;
+ border-left: none;
+ border-bottom: none;
+ cursor: default;
+}
+
+#customize-controls .customize-info.open .accordion-section-title:after,
+#customize-controls .customize-info .accordion-section-title:hover:after,
+#customize-controls .customize-info .accordion-section-title:focus:after {
+ color: #32373c;
+}
+
+#customize-controls .customize-info .accordion-section-title:after {
+ display: none;
+}
+
+#customize-controls .customize-info .preview-notice {
+ font-size: 13px;
+ line-height: 1.9;
+}
+
+#customize-controls .customize-pane-child .customize-section-title h3,
+#customize-controls .customize-pane-child h3.customize-section-title,
+#customize-outer-theme-controls .customize-pane-child .customize-section-title h3,
+#customize-outer-theme-controls .customize-pane-child h3.customize-section-title,
+#customize-controls .customize-info .panel-title {
+ font-size: 20px;
+ font-weight: 200;
+ line-height: 26px;
+ display: block;
+ overflow: hidden;
+ white-space: nowrap;
+ text-overflow: ellipsis;
+}
+
+#customize-controls .customize-section-title span.customize-action {
+ overflow: hidden;
+ white-space: nowrap;
+ text-overflow: ellipsis;
+}
+
+#customize-controls .customize-info .customize-help-toggle {
+ position: absolute;
+ top: 4px;
+ left: 1px;
+ padding: 20px 10px 10px 20px;
+ width: 20px;
+ height: 20px;
+ cursor: pointer;
+ box-shadow: none;
+ -webkit-appearance: none;
+ background: transparent;
+ color: #555d66;
+ border: none;
+}
+
+#customize-controls .customize-info .customize-help-toggle:before {
+ position: absolute;
+ top: 5px;
+ right: 6px;
+}
+
+#customize-controls .customize-info.open .customize-help-toggle,
+#customize-controls .customize-info .customize-help-toggle:focus,
+#customize-controls .customize-info .customize-help-toggle:hover {
+ color: #0073aa;
+}
+
+#customize-controls .customize-info .customize-panel-description,
+#customize-controls .customize-info .customize-section-description,
+#customize-outer-theme-controls .customize-info .customize-section-description,
+#customize-controls .no-widget-areas-rendered-notice {
+ color: #555d66;
+ display: none;
+ background: #fff;
+ padding: 12px 15px;
+ border-top: 1px solid #ddd;
+}
+
+#customize-controls .customize-info .customize-panel-description.open + .no-widget-areas-rendered-notice {
+ border-top: none;
+}
+.no-widget-areas-rendered-notice {
+ font-style: italic;
+}
+.no-widget-areas-rendered-notice p:first-child {
+ margin-top: 0;
+}
+.no-widget-areas-rendered-notice p:last-child {
+ margin-bottom: 0;
+}
+
+#customize-controls .customize-info .customize-section-description {
+ margin-bottom: 15px;
+}
+
+#customize-controls .customize-info .customize-panel-description p:first-child,
+#customize-controls .customize-info .customize-section-description p:first-child {
+ margin-top: 0;
+}
+
+#customize-controls .customize-info .customize-panel-description p:last-child,
+#customize-controls .customize-info .customize-section-description p:last-child {
+ margin-bottom: 0;
+}
+
+#customize-controls .current-panel .control-section > h3.accordion-section-title {
+ padding-left: 30px;
+}
+
+#customize-theme-controls .control-section,
+#customize-outer-theme-controls .control-section {
+ border: none;
+}
+
+#customize-theme-controls .accordion-section-title,
+#customize-outer-theme-controls .accordion-section-title {
+ color: #555d66;
+ background-color: #fff;
+ border-bottom: 1px solid #ddd;
+ border-right: 4px solid #fff;
+ transition:
+ .15s color ease-in-out,
+ .15s background-color ease-in-out,
+ .15s border-color ease-in-out;
+}
+
+#customize-controls #customize-theme-controls .customize-themes-panel .accordion-section-title {
+ color: #555;
+ background-color: #fff;
+ border-right: 4px solid #fff;
+}
+
+#customize-theme-controls .accordion-section-title:after,
+#customize-outer-theme-controls .accordion-section-title:after {
+ content: "\f341";
+ color: #a0a5aa;
+}
+
+#customize-theme-controls .accordion-section-content,
+#customize-outer-theme-controls .accordion-section-content {
+ color: #555d66;
+ background: transparent;
+}
+
+#customize-controls .control-section:hover > .accordion-section-title,
+#customize-controls .control-section .accordion-section-title:hover,
+#customize-controls .control-section.open .accordion-section-title,
+#customize-controls .control-section .accordion-section-title:focus {
+ color: #0073aa;
+ background: #f3f3f5;
+ border-right-color: #0073aa;
+}
+
+#accordion-section-themes + .control-section {
+ border-top: 1px solid #ddd;
+}
+
+.js .control-section:hover .accordion-section-title,
+.js .control-section .accordion-section-title:hover,
+.js .control-section.open .accordion-section-title,
+.js .control-section .accordion-section-title:focus {
+ background: #f3f3f5;
+}
+
+#customize-theme-controls .control-section:hover > .accordion-section-title:after,
+#customize-theme-controls .control-section .accordion-section-title:hover:after,
+#customize-theme-controls .control-section.open .accordion-section-title:after,
+#customize-theme-controls .control-section .accordion-section-title:focus:after,
+#customize-outer-theme-controls .control-section:hover > .accordion-section-title:after,
+#customize-outer-theme-controls .control-section .accordion-section-title:hover:after,
+#customize-outer-theme-controls .control-section.open .accordion-section-title:after,
+#customize-outer-theme-controls .control-section .accordion-section-title:focus:after {
+ color: #0073aa;
+}
+
+#customize-theme-controls .control-section.open {
+ border-bottom: 1px solid #eee;
+}
+
+#customize-theme-controls .control-section.open .accordion-section-title,
+#customize-outer-theme-controls .control-section.open .accordion-section-title {
+ border-bottom-color: #eee !important;
+}
+
+#customize-theme-controls .control-section:last-of-type.open,
+#customize-theme-controls .control-section:last-of-type > .accordion-section-title {
+ border-bottom-color: #ddd;
+}
+
+#customize-theme-controls .control-panel-content:not(.control-panel-nav_menus) .control-section:nth-child(2),
+#customize-theme-controls .control-panel-nav_menus .control-section-nav_menu,
+#customize-theme-controls .control-section-nav_menu_locations .accordion-section-title {
+ border-top: 1px solid #ddd;
+}
+
+#customize-theme-controls .control-panel-nav_menus .control-section-nav_menu + .control-section-nav_menu {
+ border-top: none;
+}
+
+#customize-theme-controls > ul {
+ margin: 0;
+}
+
+#customize-theme-controls .accordion-section-content {
+ position: absolute;
+ top: 0;
+ right: 100%;
+ width: 100%;
+ margin: 0;
+ padding: 12px;
+ box-sizing: border-box;
+}
+
+#customize-info,
+#customize-theme-controls .customize-pane-parent,
+#customize-theme-controls .customize-pane-child {
+ overflow: visible;
+ width: 100%;
+ margin: 0;
+ padding: 0;
+ box-sizing: border-box;
+ transition: 0.18s transform cubic-bezier(0.645, 0.045, 0.355, 1); /* easeInOutCubic */
+}
+
+#customize-theme-controls .customize-pane-child.skip-transition {
+ transition: none;
+}
+
+#customize-info,
+#customize-theme-controls .customize-pane-parent {
+ position: relative;
+ visibility: visible;
+ height: auto;
+ max-height: none;
+ overflow: auto;
+ transform: none;
+}
+
+#customize-theme-controls .customize-pane-child {
+ position: absolute;
+ top: 0;
+ right: 0;
+ visibility: hidden;
+ height: 0;
+ max-height: none;
+ overflow: hidden;
+ transform: translateX(-100%);
+}
+
+#customize-theme-controls .customize-pane-child.open,
+#customize-theme-controls .customize-pane-child.current-panel {
+ transform: none;
+}
+
+.section-open #customize-theme-controls .customize-pane-parent,
+.in-sub-panel #customize-theme-controls .customize-pane-parent,
+.section-open #customize-info,
+.in-sub-panel #customize-info,
+.in-sub-panel.section-open #customize-theme-controls .customize-pane-child.current-panel {
+ visibility: hidden;
+ height: 0;
+ overflow: hidden;
+ transform: translateX(100%);
+}
+
+.section-open #customize-theme-controls .customize-pane-parent.busy,
+.in-sub-panel #customize-theme-controls .customize-pane-parent.busy,
+.section-open #customize-info.busy,
+.in-sub-panel #customize-info.busy,
+.busy.section-open.in-sub-panel #customize-theme-controls .customize-pane-child.current-panel,
+#customize-theme-controls .customize-pane-child.open,
+#customize-theme-controls .customize-pane-child.current-panel,
+#customize-theme-controls .customize-pane-child.busy {
+ visibility: visible;
+ height: auto;
+ overflow: auto;
+}
+
+#customize-theme-controls .customize-pane-child.accordion-section-content,
+#customize-theme-controls .customize-pane-child.accordion-sub-container {
+ display: block;
+ overflow-x: hidden;
+}
+
+#customize-theme-controls .customize-pane-child.accordion-section-content {
+ padding: 12px;
+}
+
+#customize-theme-controls .customize-pane-child.menu li {
+ position: static;
+}
+
+.customize-section-description-container,
+.control-section-nav_menu .customize-section-description-container,
+.control-section-new_menu .customize-section-description-container {
+ margin-bottom: 15px;
+}
+
+.control-section-nav_menu .customize-control,
+.control-section-new_menu .customize-control {
+ /* Override default `margin-bottom` for `.customize-control` */
+ margin-bottom: 0;
+}
+
+.customize-section-title {
+ margin: -12px -12px 0 -12px;
+ border-bottom: 1px solid #ddd;
+ background: #fff;
+}
+
+div.customize-section-description {
+ margin-top: 22px;
+}
+
+.customize-info div.customize-section-description {
+ margin-top: 0;
+}
+
+div.customize-section-description p:first-child {
+ margin-top: 0;
+}
+
+div.customize-section-description p:last-child {
+ margin-bottom: 0;
+}
+
+#customize-theme-controls .customize-themes-panel h3.customize-section-title:first-child {
+ border-bottom: 1px solid #ddd;
+ padding: 12px 12px 12px 12px;
+}
+
+.ios #customize-theme-controls .customize-themes-panel h3.customize-section-title:first-child {
+ padding: 12px 12px 13px 12px;
+}
+
+.customize-section-title h3,
+h3.customize-section-title {
+ padding: 10px 14px 12px 10px;
+ margin: 0;
+ line-height: 21px;
+ color: #555d66;
+}
+
+.accordion-sub-container.control-panel-content {
+ display: none;
+ position: absolute;
+ top: 0;
+ width: 100%;
+}
+
+.accordion-sub-container.control-panel-content.busy {
+ display: block;
+}
+
+.current-panel .accordion-sub-container.control-panel-content {
+ width: 100%;
+}
+
+.customize-controls-close {
+ display: block;
+ position: absolute;
+ top: 0;
+ right: 0;
+ width: 45px;
+ height: 41px;
+ padding: 0 0 0 2px;
+ background: #eee;
+ border: none;
+ border-top: 4px solid #eee;
+ border-left: 1px solid #ddd;
+ color: #444;
+ text-align: right;
+ cursor: pointer;
+ transition:
+ color .15s ease-in-out,
+ border-color .15s ease-in-out,
+ background .15s ease-in-out;
+ box-sizing: content-box;
+}
+
+.customize-panel-back,
+.customize-section-back {
+ display: block;
+ float: right;
+ width: 48px;
+ height: 71px;
+ padding: 0 0 0 24px;
+ margin: 0;
+ background: #fff;
+ border: none;
+ border-left: 1px solid #ddd;
+ border-right: 4px solid #fff;
+ box-shadow: none;
+ cursor: pointer;
+ transition:
+ color .15s ease-in-out,
+ border-color .15s ease-in-out,
+ background .15s ease-in-out;
+}
+
+.customize-section-back {
+ height: 74px;
+}
+
+.ios .customize-panel-back {
+ display: none;
+}
+
+.ios .expanded.in-sub-panel .customize-panel-back {
+ display: block;
+}
+
+#customize-controls .panel-meta.customize-info .accordion-section-title {
+ margin-right: 48px;
+ border-right: none;
+}
+
+#customize-controls .panel-meta.customize-info .accordion-section-title:hover,
+#customize-controls .cannot-expand:hover .accordion-section-title {
+ background: #fff;
+ color: #555d66;
+ border-right-color: #fff;
+}
+
+.customize-controls-close:focus,
+.customize-controls-close:hover,
+.customize-controls-preview-toggle:focus,
+.customize-controls-preview-toggle:hover {
+ background: #fff;
+ color: #0073aa;
+ border-top-color: #0073aa;
+ outline: none;
+ box-shadow: none;
+}
+
+
+.customize-panel-back:hover,
+.customize-panel-back:focus,
+.customize-section-back:hover,
+.customize-section-back:focus {
+ color: #0073aa;
+ background: #f3f3f5;
+ border-right-color: #0073aa;
+ outline: none;
+ box-shadow: none;
+}
+
+.customize-controls-close:before {
+ font: normal 22px/45px dashicons;
+ content: "\f335";
+ position: relative;
+ top: -3px;
+ right: 13px;
+}
+
+.customize-panel-back:before,
+.customize-section-back:before {
+ font: normal 20px/72px dashicons;
+ content: "\f345";
+ position: relative;
+ right: 9px;
+}
+
+.wp-full-overlay-sidebar .wp-full-overlay-header {
+ background-color: #eee;
+ transition: padding ease-in-out .18s;
+}
+
+.in-sub-panel .wp-full-overlay-sidebar .wp-full-overlay-header {
+ padding-right: 62px;
+}
+
+p.customize-section-description {
+ font-style: normal;
+ margin-top: 22px;
+ margin-bottom: 0;
+}
+
+.customize-section-description ul {
+ margin-right: 1em;
+}
+
+.customize-section-description ul > li {
+ list-style: disc;
+}
+
+.section-description-buttons {
+ text-align: left;
+}
+
+.section-description-buttons button.button-link {
+ color: #0073aa;
+ text-decoration: underline;
+}
+
+.customize-control {
+ width: 100%;
+ float: right;
+ clear: both;
+ margin-bottom: 12px;
+}
+
+.customize-control select,
+.customize-control input[type="radio"],
+.customize-control input[type="checkbox"] {
+ line-height: 2;
+}
+
+.customize-control input[type="text"],
+.customize-control input[type="password"],
+.customize-control input[type="email"],
+.customize-control input[type="number"],
+.customize-control input[type="search"],
+.customize-control input[type="tel"],
+.customize-control input[type="url"] {
+ width: 100%;
+ line-height: 1.3;
+ margin: 0;
+}
+
+.customize-control-hidden {
+ margin: 0;
+}
+
+.customize-control-textarea textarea {
+ width: 100%;
+ resize: vertical;
+}
+
+.customize-control select {
+ width: 100%;
+ height: 28px;
+ line-height: 2;
+}
+
+.customize-control select[multiple] {
+ height: auto;
+}
+
+.customize-control-title {
+ display: block;
+ font-size: 14px;
+ line-height: 1.75;
+ font-weight: 600;
+ margin-bottom: 4px;
+}
+
+.customize-control-description {
+ display: block;
+ font-style: italic;
+ line-height: 1.4;
+ margin-top: 0;
+ margin-bottom: 5px;
+}
+
+.customize-section-description a.external-link:after {
+ font: 16px/11px dashicons;
+ content: "\f310";
+ top: 3px;
+ position: relative;
+ padding-right: 3px;
+ display: inline-block;
+ text-decoration: none;
+}
+
+.customize-control-color .color-picker,
+.customize-control-upload div {
+ line-height: 28px;
+}
+
+.customize-control .customize-inside-control-row {
+ line-height: 1.6;
+ display: block;
+ margin-right: 24px;
+ padding-top: 6px;
+ padding-bottom: 6px;
+}
+
+.customize-control-radio input,
+.customize-control-checkbox input,
+.customize-control-nav_menu_auto_add input {
+ margin-left: 4px;
+ margin-right: -24px;
+}
+
+.customize-control-radio {
+ padding: 5px 0 10px;
+}
+
+.customize-control-radio .customize-control-title {
+ margin-bottom: 0;
+ line-height: 1.6;
+}
+
+.customize-control-radio .customize-control-title + .customize-control-description {
+ margin-top: 7px;
+}
+
+.customize-control-radio label,
+.customize-control-checkbox label {
+ vertical-align: top;
+}
+
+.customize-control .attachment-thumb.type-icon {
+ float: right;
+ margin: 10px;
+ width: auto;
+}
+
+.customize-control .attachment-title {
+ font-weight: 600;
+ margin: 0;
+ padding: 5px 10px;
+}
+
+.customize-control .attachment-meta {
+ white-space: nowrap;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ margin: 0;
+ padding: 0 10px;
+}
+
+.customize-control .attachment-meta-title {
+ padding-top: 7px;
+}
+
+/* Remove descender space. */
+.customize-control .thumbnail-image,
+.customize-control-header .current,
+.customize-control .wp-media-wrapper.wp-video {
+ line-height: 0;
+}
+
+/* Remove descender space. */
+.customize-control-site_icon .favicon-preview .browser-preview {
+ vertical-align: top;
+}
+
+.customize-control .thumbnail-image img {
+ cursor: pointer;
+}
+
+#customize-controls .thumbnail-audio .thumbnail {
+ max-width: 64px;
+ max-height: 64px;
+ margin: 10px;
+ float: right;
+}
+
+#available-menu-items .accordion-section-content .new-content-item,
+.customize-control-dropdown-pages .new-content-item {
+ width: calc(100% - 30px);
+ padding: 8px 15px;
+ position: absolute;
+ bottom: 0;
+ z-index: 10;
+ background: #eee;
+ display: flex;
+}
+
+.customize-control-dropdown-pages .new-content-item {
+ width: 100%;
+ padding: 5px 1px 5px 0;
+ position: relative;
+}
+
+#available-menu-items .new-content-item .create-item-input,
+.customize-control-dropdown-pages .new-content-item .create-item-input {
+ flex-grow: 10;
+}
+
+#available-menu-items .new-content-item .add-content,
+.customize-control-dropdown-pages .new-content-item .add-content {
+ margin: 2px 6px 2px 0;
+ flex-grow: 1;
+}
+
+.customize-control-dropdown-pages .new-content-item .create-item-input.invalid {
+ border: 1px solid #dc3232;
+}
+
+.customize-control-dropdown-pages .add-new-toggle {
+ margin-right: 1px;
+ font-weight: 600;
+ line-height: 2.2;
+}
+
+#customize-preview iframe {
+ width: 100%;
+ height: 100%;
+ position: absolute;
+}
+#customize-preview iframe + iframe {
+ visibility: hidden;
+}
+
+.wp-full-overlay-sidebar {
+ background: #eee;
+ border-left: 1px solid #ddd;
+}
+
+
+/**
+ * Notifications
+ */
+
+#customize-controls .customize-control-notifications-container { /* Scoped to #customize-controls for specificity over notification styles in common.css. */
+ margin: 4px 0 8px 0;
+ padding: 0;
+ cursor: default;
+}
+
+#customize-controls .customize-control-widget_form.has-error .widget .widget-top,
+.customize-control-nav_menu_item.has-error .menu-item-bar .menu-item-handle {
+ box-shadow: inset 0 0 0 2px #dc3232;
+ transition: .15s box-shadow linear;
+}
+
+#customize-controls .customize-control-notifications-container li.notice {
+ list-style: none;
+ margin: 0 0 6px 0;
+ padding: 9px 14px;
+ overflow: hidden;
+}
+#customize-controls .customize-control-notifications-container .notice.is-dismissible {
+ padding-left: 38px;
+}
+
+.customize-control-notifications-container li.notice:last-child {
+ margin-bottom: 0;
+}
+
+#customize-controls .customize-control-nav_menu_item .customize-control-notifications-container {
+ margin-top: 0;
+}
+
+#customize-controls .customize-control-widget_form .customize-control-notifications-container {
+ margin-top: 8px;
+}
+
+.customize-control-text.has-error input {
+ outline: 2px solid #dc3232;
+}
+
+#customize-controls #customize-notifications-area {
+ position: absolute;
+ top: 46px;
+ width: 100%;
+ border-bottom: 1px solid #ddd;
+ display: block;
+ padding: 0;
+ margin: 0;
+}
+
+.wp-full-overlay.collapsed #customize-controls #customize-notifications-area {
+ display: none !important;
+}
+
+#customize-controls #customize-notifications-area:not(.has-overlay-notifications),
+#customize-controls .customize-section-title > .customize-control-notifications-container:not(.has-overlay-notifications),
+#customize-controls .panel-meta > .customize-control-notifications-container:not(.has-overlay-notifications) {
+ max-height: 210px;
+ overflow-x: hidden;
+ overflow-y: auto;
+}
+
+#customize-controls #customize-notifications-area > ul,
+#customize-controls #customize-notifications-area .notice,
+#customize-controls .panel-meta > .customize-control-notifications-container,
+#customize-controls .panel-meta > .customize-control-notifications-container .notice,
+#customize-controls .customize-section-title > .customize-control-notifications-container,
+#customize-controls .customize-section-title > .customize-control-notifications-container .notice {
+ margin: 0;
+}
+#customize-controls .panel-meta > .customize-control-notifications-container,
+#customize-controls .customize-section-title > .customize-control-notifications-container {
+ border-top: 1px solid #ddd;
+}
+#customize-controls #customize-notifications-area .notice,
+#customize-controls .panel-meta > .customize-control-notifications-container .notice,
+#customize-controls .customize-section-title > .customize-control-notifications-container .notice {
+ padding: 9px 14px;
+}
+#customize-controls #customize-notifications-area .notice.is-dismissible,
+#customize-controls .panel-meta > .customize-control-notifications-container .notice.is-dismissible,
+#customize-controls .customize-section-title > .customize-control-notifications-container .notice.is-dismissible {
+ padding-left: 38px;
+}
+#customize-controls #customize-notifications-area .notice + .notice,
+#customize-controls .panel-meta > .customize-control-notifications-container .notice + .notice,
+#customize-controls .customize-section-title > .customize-control-notifications-container .notice + .notice {
+ margin-top: 1px;
+}
+
+@keyframes customize-fade-in {
+ 0% { opacity: 0; }
+ 100% { opacity: 1; }
+}
+
+#customize-controls .notice.notification-overlay,
+#customize-controls #customize-notifications-area .notice.notification-overlay {
+ margin: 0;
+ border-right: 0; /* @todo Appropriate styles could be added for notice-error, notice-warning, notice-success, etc */
+}
+
+#customize-controls .customize-control-notifications-container.has-overlay-notifications {
+ animation: customize-fade-in 0.5s;
+ z-index: 30;
+}
+
+/* Note: Styles for this are also defined in themes.css */
+#customize-controls #customize-notifications-area .notice.notification-overlay .notification-message {
+ clear: both;
+ color: #191e23;
+ font-size: 18px;
+ font-style: normal;
+ margin: 0;
+ padding: 2em 0;
+ text-align: center;
+ width: 100%;
+ display: block;
+ top: 50%;
+ position: relative;
+}
+
+/* Style for custom settings */
+
+/**
+ * Static front page
+ */
+
+#customize-control-show_on_front.has-error {
+ margin-bottom: 0;
+}
+#customize-control-show_on_front.has-error .customize-control-notifications-container {
+ margin-top: 12px;
+}
+
+/**
+ * Dropdowns
+ */
+
+.accordion-section .dropdown {
+ float: right;
+ display: block;
+ position: relative;
+ cursor: pointer;
+}
+
+.accordion-section .dropdown-content {
+ overflow: hidden;
+ float: right;
+ min-width: 30px;
+ height: 16px;
+ line-height: 16px;
+ margin-left: 16px;
+ padding: 4px 5px;
+ border: 2px solid #eee;
+ -webkit-user-select: none;
+ -moz-user-select: none;
+ -ms-user-select: none;
+ user-select: none;
+}
+
+/* @todo maybe no more used? */
+.customize-control .dropdown-arrow {
+ position: absolute;
+ top: 0;
+ bottom: 0;
+ left: 0;
+ width: 20px;
+ background: #eee;
+}
+
+.customize-control .dropdown-arrow:after {
+ content: "\f140";
+ font: normal 20px/1 dashicons;
+ speak: none;
+ display: block;
+ padding: 0;
+ text-indent: 0;
+ text-align: center;
+ position: relative;
+ -webkit-font-smoothing: antialiased;
+ -moz-osx-font-smoothing: grayscale;
+ text-decoration: none !important;
+ color: #32373c;
+}
+
+.customize-control .dropdown-status {
+ color: #32373c;
+ background: #eee;
+ display: none;
+ max-width: 112px;
+}
+
+.customize-control-color .dropdown {
+ margin-left: 5px;
+ margin-bottom: 5px;
+}
+
+.customize-control-color .dropdown .dropdown-content {
+ background-color: #555d66;
+ border: 1px solid rgba(0, 0, 0, 0.15);
+}
+
+.customize-control-color .dropdown:hover .dropdown-content {
+ border-color: rgba(0, 0, 0, 0.25);
+}
+
+/**
+ * iOS can't scroll iframes,
+ * instead it expands the iframe size to match the size of the content
+ */
+
+.ios .wp-full-overlay {
+ position: relative;
+}
+
+.ios #customize-controls .wp-full-overlay-sidebar-content {
+ -webkit-overflow-scrolling: touch;
+}
+
+/* Media controls */
+
+.customize-control .actions .button {
+ margin-top: 12px;
+}
+
+.customize-control-header .actions,
+.customize-control-header .uploaded {
+ margin-bottom: 18px;
+}
+
+.customize-control-header .uploaded button:not(.random),
+.customize-control-header .default button:not(.random) {
+ width: 100%;
+ padding: 0;
+ margin: 0;
+ background: none;
+ border: none;
+ color: inherit;
+ cursor: pointer;
+}
+
+.customize-control-header button img {
+ display: block;
+}
+
+.customize-control .attachment-media-view .remove-button,
+.customize-control .attachment-media-view .default-button,
+.customize-control .attachment-media-view .upload-button,
+.customize-control-header button.new,
+.customize-control-header button.remove {
+ width: auto;
+ height: auto;
+ white-space: normal;
+}
+
+.customize-control .attachment-media-view .thumbnail,
+.customize-control-header .current .container {
+ overflow: hidden;
+}
+
+.customize-control .attachment-media-view .placeholder,
+.customize-control .attachment-media-view .button-add-media,
+.customize-control-header .placeholder {
+ width: 100%;
+ position: relative;
+ text-align: center;
+ cursor: default;
+ border: 1px dashed #b4b9be;
+ box-sizing: border-box;
+ padding: 9px 0;
+ line-height: 1.6;
+}
+
+.customize-control .attachment-media-view .button-add-media {
+ cursor: pointer;
+ background-color: #edeff0;
+ color: #32373c;
+}
+
+.customize-control .attachment-media-view .button-add-media:hover {
+ background-color: #fbfbfc;
+}
+
+.customize-control .attachment-media-view .button-add-media:focus {
+ background-color: #fbfbfc;
+ border-style: solid;
+ border-color: #5b9dd9;
+ box-shadow: 0 0 3px rgba( 0, 115, 170, .8 );
+ /* Only visible in Windows High Contrast mode */
+ outline: 2px solid transparent;
+ outline-offset: -2px;
+}
+
+.customize-control-header .inner {
+ display: none;
+ position: absolute;
+ width: 100%;
+ color: #555d66;
+ white-space: nowrap;
+ text-overflow: ellipsis;
+ overflow: hidden;
+}
+
+.customize-control-header .inner,
+.customize-control-header .inner .dashicons {
+ line-height: 20px;
+ top: 8px;
+}
+
+.customize-control-header .list .inner,
+.customize-control-header .list .inner .dashicons {
+ top: 9px;
+}
+
+.customize-control-header .header-view {
+ position: relative;
+ width: 100%;
+ margin-bottom: 12px;
+}
+
+.customize-control-header .header-view:last-child {
+ margin-bottom: 0px;
+}
+
+/* Convoluted, but 'outline' support isn't good enough yet */
+.customize-control-header .header-view:after {
+ border: 0;
+}
+
+.customize-control-header .header-view.selected .choice:focus {
+ outline: none;
+}
+
+.customize-control-header .header-view.selected:after {
+ content: "";
+ position: absolute;
+ height: auto;
+ top: 0;
+ right: 0;
+ bottom: 0;
+ left: 0;
+ border: 4px solid #00a0d2;
+ border-radius: 2px;
+}
+
+.customize-control-header .header-view.button.selected {
+ border: 0;
+}
+
+/* Header control: overlay "close" button */
+
+.customize-control-header .uploaded .header-view .close {
+ font-size: 20px;
+ color: #fff;
+ background: #555d66;
+ background: rgba(0, 0, 0, 0.5);
+ position: absolute;
+ top: 10px;
+ right: -999px;
+ z-index: 1;
+ width: 26px;
+ height: 26px;
+ cursor: pointer;
+}
+
+.customize-control-header .header-view:hover .close,
+.customize-control-header .header-view .close:focus {
+ right: auto;
+ left: 10px;
+}
+
+.customize-control-header .header-view .close:focus {
+ outline: 1px solid #5b9dd9;
+}
+
+/* Header control: randomiz(s)er */
+
+.customize-control-header .random.placeholder {
+ cursor: pointer;
+ border-radius: 2px;
+ height: 40px;
+}
+
+.customize-control-header button.random {
+ width: 100%;
+ height: auto;
+ min-height: 40px;
+ white-space: normal;
+}
+
+.customize-control-header button.random .dice {
+ margin-top: 4px;
+}
+
+.customize-control-header .placeholder:hover .dice,
+.customize-control-header .header-view:hover > button.random .dice {
+ animation: dice-color-change 3s infinite;
+}
+
+.button-see-me {
+ animation: bounce .7s 1;
+ transform-origin: center bottom;
+}
+
+@keyframes bounce {
+ from, 20%, 53%, 80%, to {
+ animation-timing-function: cubic-bezier(0.215, 0.610, 0.355, 1.000);
+ transform: translate3d(0,0,0);
+ }
+
+ 40%, 43% {
+ animation-timing-function: cubic-bezier(0.755, 0.050, 0.855, 0.060);
+ transform: translate3d(0, -12px, 0);
+ }
+
+ 70% {
+ animation-timing-function: cubic-bezier(0.755, 0.050, 0.855, 0.060);
+ transform: translate3d(0, -6px, 0);
+ }
+
+ 90% {
+ transform: translate3d(0,-1px,0);
+ }
+}
+
+.customize-control-header .choice {
+ position: relative;
+ display: block;
+ margin-bottom: 9px;
+}
+
+.customize-control-header .choice:focus {
+ outline: none;
+ box-shadow:
+ 0 0 0 1px #5b9dd9,
+ 0 0 3px 1px rgba(30, 140, 190, 0.8);
+}
+
+.customize-control-header .uploaded div:last-child > .choice {
+ margin-bottom: 0;
+}
+
+.customize-control .attachment-media-view .thumbnail-image img,
+.customize-control-header img {
+ max-width: 100%;
+}
+
+.customize-control .attachment-media-view .remove-button,
+.customize-control .attachment-media-view .default-button,
+.customize-control-header .remove {
+ margin-left: 8px;
+}
+
+/* Background position control */
+.customize-control-background_position .background-position-control .button-group {
+ display: block;
+}
+
+/**
+ * Code Editor Control and Custom CSS Section
+ *
+ * Modifications to the Section Container to make the textarea full-width and
+ * full-height, if the control is the only control in the section.
+ */
+
+.customize-control-code_editor textarea {
+ width: 100%;
+ font-family: Consolas, Monaco, monospace;
+ font-size: 12px;
+ padding: 6px 8px;
+ -moz-tab-size: 2;
+ -o-tab-size: 2;
+ tab-size: 2;
+}
+.customize-control-code_editor textarea,
+.customize-control-code_editor .CodeMirror {
+ height: 14em;
+}
+
+#customize-controls .customize-section-description-container.section-meta.customize-info {
+ border-bottom: none;
+}
+
+#sub-accordion-section-custom_css .customize-control-notifications-container {
+ margin-bottom: 15px;
+}
+
+#customize-control-custom_css textarea {
+ display: block;
+ height: 500px;
+}
+
+.customize-section-description-container + #customize-control-custom_css .customize-control-title {
+ margin-right: 12px;
+}
+
+.customize-section-description-container + #customize-control-custom_css:last-child textarea {
+ border-left: 0;
+ border-right: 0;
+ height: calc( 100vh - 185px );
+ resize: none;
+}
+
+.customize-section-description-container + #customize-control-custom_css:last-child {
+ margin-right: -12px;
+ width: 299px;
+ width: calc( 100% + 24px );
+ margin-bottom: -12px;
+}
+
+.customize-section-description-container + #customize-control-custom_css:last-child .CodeMirror {
+ height: calc( 100vh - 185px );
+}
+
+.CodeMirror-lint-tooltip,
+.CodeMirror-hints {
+ z-index: 500000 !important;
+}
+
+.customize-section-description-container + #customize-control-custom_css:last-child .customize-control-notifications-container {
+ margin-right: 12px;
+ margin-left: 12px;
+}
+
+.theme-browser .theme.active .theme-actions,
+.wp-customizer .theme-browser .theme .theme-actions {
+ padding: 10px 15px;
+ box-shadow: inset 0 1px 0 rgba(0, 0, 0, 0.1);
+}
+
+@media screen and (max-width: 640px) {
+ .customize-section-description-container + #customize-control-custom_css:last-child {
+ margin-left: 0;
+ }
+
+ .customize-section-description-container + #customize-control-custom_css:last-child textarea {
+ height: calc( 100vh - 140px );
+ }
+}
+
+/**
+ * Themes
+ */
+
+#customize-theme-controls .control-panel-themes {
+ border-bottom: none;
+}
+
+#customize-theme-controls .control-panel-themes > .accordion-section-title:hover, /* Not a focusable element. */
+#customize-theme-controls .control-panel-themes > .accordion-section-title {
+ cursor: default;
+ background: #fff;
+ color: #555d66;
+ border-top: 1px solid #ddd;
+ border-bottom: 1px solid #ddd;
+ border-right: none;
+ border-left: none;
+ margin: 0 0 15px 0;
+ padding-left: 100px; /* Space for the button */
+}
+
+#customize-theme-controls .control-section-themes .customize-themes-panel .accordion-section-title:first-child:hover, /* Not a focusable element. */
+#customize-theme-controls .control-section-themes .customize-themes-panel .accordion-section-title:first-child {
+ border-top: 0;
+}
+
+#customize-theme-controls .control-section-themes > .accordion-section-title:hover, /* Not a focusable element. */
+#customize-theme-controls .control-section-themes > .accordion-section-title {
+ margin: 0 0 15px;
+}
+
+#customize-controls .customize-themes-panel .accordion-section-title:hover,
+#customize-controls .customize-themes-panel .accordion-section-title {
+ margin: 15px -8px;
+}
+
+#customize-controls .control-section-themes .accordion-section-title,
+#customize-controls .customize-themes-panel .accordion-section-title {
+ padding-left: 100px; /* Space for the button */
+}
+
+.control-panel-themes .accordion-section-title span.customize-action,
+#customize-controls .customize-section-title span.customize-action,
+#customize-controls .control-section-themes .accordion-section-title span.customize-action,
+#customize-controls .customize-section-title span.customize-action {
+ font-size: 13px;
+ display: block;
+ font-weight: 400;
+}
+
+#customize-theme-controls .control-panel-themes .accordion-section-title .change-theme {
+ position: absolute;
+ left: 10px;
+ top: 50%;
+ margin-top: -14px;
+ font-weight: 400;
+}
+
+#customize-theme-controls .control-panel-themes > .accordion-section-title:after {
+ display: none;
+}
+
+.control-panel-themes .customize-themes-full-container {
+ position: fixed;
+ top: 0;
+ right: 0;
+ transition: .18s right ease-in-out;
+ margin: 0 300px 0 0;
+ padding: 71px 0 25px;
+ overflow-y: scroll;
+ width: calc(100% - 300px);
+ height: calc(100% - 96px);
+ background: #eee;
+ z-index: 20;
+}
+
+@media screen and (min-width: 1670px) {
+ .control-panel-themes .customize-themes-full-container {
+ width: 82%;
+ left: 0;
+ right: initial;
+ }
+}
+
+.modal-open .control-panel-themes .customize-themes-full-container {
+ overflow-y: visible;
+}
+
+/* Animations for opening the themes panel */
+#customize-save-button-wrapper,
+#customize-header-actions .spinner,
+#customize-header-actions .customize-controls-preview-toggle {
+ transition: .18s margin ease-in-out;
+}
+
+#customize-footer-actions,
+#customize-footer-actions .collapse-sidebar {
+ bottom: 0;
+ transition: .18s bottom ease-in-out;
+}
+
+.in-themes-panel:not(.animating) #customize-header-actions .spinner,
+.in-themes-panel:not(.animating) #customize-header-actions .customize-controls-preview-toggle,
+.in-themes-panel:not(.animating) #customize-preview,
+.in-themes-panel:not(.animating) #customize-footer-actions {
+ visibility: hidden;
+}
+
+.wp-full-overlay.in-themes-panel {
+ background: #eee; /* Prevents a black flash when fading in the panel */
+}
+
+.in-themes-panel #customize-save-button-wrapper,
+.in-themes-panel #customize-header-actions .spinner,
+.in-themes-panel #customize-header-actions .customize-controls-preview-toggle {
+ margin-top: -46px; /* Height of header actions bar */
+}
+
+.in-themes-panel #customize-footer-actions,
+.in-themes-panel #customize-footer-actions .collapse-sidebar {
+ bottom: -45px;
+}
+
+/* Don't show the theme count while the panel opens, as it's in the wrong place during the animation */
+.in-themes-panel.animating .control-panel-themes .filter-themes-count {
+ display: none;
+}
+
+.in-themes-panel.wp-full-overlay .wp-full-overlay-sidebar-content {
+ bottom: 0;
+}
+
+.themes-filter-bar .feature-filter-toggle {
+ float: left;
+ margin: 3px 25px 3px 0;
+}
+
+.themes-filter-bar .feature-filter-toggle:before {
+ content: "\f111";
+ margin: 0 0 0 5px;
+ font: normal 16px/1 dashicons;
+ vertical-align: text-bottom;
+ -webkit-font-smoothing: antialiased;
+ -moz-osx-font-smoothing: grayscale;
+}
+
+.themes-filter-bar .feature-filter-toggle.open {
+ background: #eee;
+ border-color: #999;
+ box-shadow: inset 0 2px 5px -3px rgba(0, 0, 0, 0.5);
+ transform: translateY(1px);
+}
+
+.themes-filter-bar .feature-filter-toggle .filter-count-filters {
+ display: none;
+}
+
+.filter-drawer {
+ box-sizing: border-box;
+ width: 100%;
+ position: absolute;
+ top: 46px;
+ right: 0;
+ padding: 25px 25px 25px 0;
+ border-top: 0;
+ margin: 0;
+ background: #eee;
+ border-bottom: 1px solid #ddd;
+}
+
+.filter-drawer .filter-group {
+ margin: 0 0 0 25px;
+ width: calc( (100% - 75px) / 3);
+ min-width: 200px;
+ max-width: 320px;
+}
+
+/* Adds a delay before fading in to avoid it "jumping" */
+@keyframes themes-fade-in {
+ 0% {
+ opacity: 0;
+ }
+ 50% {
+ opacity: 0;
+ }
+ 100% {
+ opacity: 1;
+ }
+}
+
+.control-panel-themes .customize-themes-full-container.animate {
+ animation: .6s themes-fade-in 1;
+}
+
+.in-themes-panel:not(.animating) .control-panel-themes .filter-themes-count {
+ animation: .6s themes-fade-in 1;
+}
+
+.control-panel-themes .filter-themes-count {
+ position: relative;
+ float: left;
+ line-height: 2.6;
+}
+
+.control-panel-themes .filter-themes-count .themes-displayed {
+ font-weight: 600;
+ color: #555d66;
+}
+
+.customize-themes-notifications {
+ margin: 0;
+}
+
+.control-panel-themes .customize-themes-notifications .notice {
+ margin: 0 0 25px 0;
+}
+
+.customize-themes-full-container .customize-themes-section {
+ display: none !important; /* There is unknown JS that perpetually tries to show all theme sections when more items are added. */
+ overflow: hidden;
+}
+
+.customize-themes-full-container .customize-themes-section.current-section {
+ display: list-item !important; /* There is unknown JS that perpetually tries to show all theme sections when more items are added. */
+}
+
+.control-section .customize-section-text-before {
+ padding: 0 15px 8px 0;
+ margin: 15px 0 0 0;
+ line-height: 16px;
+ border-bottom: 1px solid #ddd;
+ color: #555d66;
+}
+
+.control-panel-themes .customize-themes-section-title {
+ width: 100%;
+ background: #fff;
+ box-shadow: none;
+ outline: none;
+ border-top: none;
+ border-bottom: 1px solid #ddd;
+ border-right: 4px solid #fff;
+ border-left: none;
+ cursor: pointer;
+ padding: 10px 15px;
+ position: relative;
+ text-align: right;
+ font-size: 14px;
+ font-weight: 600;
+ color: #555d66;
+ text-shadow: none;
+}
+
+.control-panel-themes #accordion-section-installed_themes {
+ border-top: 1px solid #ddd;
+}
+
+.control-panel-themes .theme-section {
+ margin: 0;
+ position: relative;
+}
+
+.control-panel-themes .customize-themes-section-title:focus,
+.control-panel-themes .customize-themes-section-title:hover {
+ border-right-color: #0073aa;
+ color: #0073aa;
+ background: #f5f5f5;
+}
+
+.customize-themes-section-title:not(.selected):after {
+ content: "";
+ display: block;
+ position: absolute;
+ top: 9px;
+ left: 15px;
+ width: 18px;
+ height: 18px;
+ border-radius: 100%;
+ border: 1px solid #ccc;
+ background: #fff;
+}
+
+.control-panel-themes .theme-section .customize-themes-section-title.selected:after {
+ content: "\f147";
+ font: 16px/1 dashicons;
+ box-sizing: border-box;
+ width: 20px;
+ height: 20px;
+ padding: 3px 1px 1px 3px; /* Re-align the icon to the smaller grid */
+ border-radius: 100%;
+ position: absolute;
+ top: 9px;
+ left: 15px;
+ background: #0073aa;
+ color: #fff;
+}
+
+.control-panel-themes .customize-themes-section-title.selected {
+ color: #0073aa;
+}
+
+#customize-theme-controls .themes.accordion-section-content {
+ position: relative;
+ right: 0;
+ padding: 0;
+ width: 100%;
+}
+
+.loading .customize-themes-section .spinner {
+ display: block;
+ visibility: visible;
+ position: relative;
+ clear: both;
+ width: 20px;
+ height: 20px;
+ right: calc(50% - 10px);
+ float: none;
+ margin-top: 50px;
+}
+
+.customize-themes-section .no-themes,
+.customize-themes-section .no-themes-local {
+ display: none;
+}
+
+.themes-section-installed_themes .theme .notice-success:not(.updated-message) {
+ display: none; /* Hide "installed" notice on installed themes tab. */
+}
+
+.customize-control-theme .theme {
+ width: 100%;
+ margin: 0;
+ border: 1px solid #ddd;
+ background: #fff;
+}
+
+.customize-control-theme .theme .theme-name, .customize-control-theme .theme .theme-actions {
+ background: #fff;
+ border: none;
+}
+
+.customize-control.customize-control-theme { /* override most properties on .customize-control */
+ box-sizing: border-box;
+ width: 25%;
+ max-width: 600px; /* Max. screenshot size / 2 */
+ margin: 0 0 25px 25px;
+ padding: 0;
+ clear: none;
+}
+
+/* 5 columns above 2100px */
+@media screen and (min-width: 2101px) {
+ .customize-control.customize-control-theme {
+ width: calc( ( 100% - 125px ) / 5 - 1px ); /* 1px offset accounts for browser rounding, typical all grids */
+ }
+}
+
+/* 4 columns up to 2100px */
+@media screen and (min-width: 1601px) and (max-width: 2100px) {
+ .customize-control.customize-control-theme {
+ width: calc( ( 100% - 100px ) / 4 - 1px );
+ }
+}
+
+/* 3 columns up to 1600px */
+@media screen and (min-width: 1201px) and (max-width: 1600px) {
+ .customize-control.customize-control-theme {
+ width: calc( ( 100% - 75px ) / 3 - 1px );
+ }
+}
+
+/* 2 columns up to 1200px */
+@media screen and (min-width: 851px) and (max-width: 1200px) {
+ .customize-control.customize-control-theme {
+ width: calc( ( 100% - 50px ) / 2 - 1px );
+
+ }
+}
+
+/* 1 column up to 850 px */
+@media screen and (max-width: 850px) {
+ .customize-control.customize-control-theme {
+ width: 100%;
+ }
+}
+
+.wp-customizer .theme-browser .themes {
+ padding: 0 25px 25px 0;
+ transition: .18s margin-top linear;
+}
+
+.wp-customizer .theme-browser .theme .theme-actions {
+ opacity: 1;
+}
+
+#customize-controls h3.theme-name {
+ font-size: 15px;
+}
+
+#customize-controls .theme-overlay .theme-name {
+ font-size: 32px;
+}
+
+.customize-preview-header.themes-filter-bar {
+ position: fixed;
+ top: 0;
+ right: 300px;
+ width: calc(100% - 300px);
+ height: 46px;
+ background: #eee;
+ z-index: 10;
+ padding: 6px 25px;
+ box-sizing: border-box;
+ border-bottom: 1px solid #ddd;
+}
+
+@media screen and (min-width: 1670px) {
+ .customize-preview-header.themes-filter-bar {
+ width: 82%;
+ left: 0;
+ right: initial;
+ }
+}
+
+.themes-filter-bar .themes-filter-container {
+ margin: 0;
+ padding: 0;
+}
+
+.themes-filter-bar .wp-filter-search {
+ line-height: 1.8;
+ padding: 6px 30px 6px 10px;
+ max-width: 100%;
+ width: 40%;
+ min-width: 300px;
+ position: absolute;
+ top: 6px;
+ right: 25px;
+ height: 32px;
+ margin: 1px 0;
+}
+
+/* Unstick the filter bar on short windows/screens. This breakpoint is based on the
+ current length of .org feature filters assuming translations do not wrap lines. */
+@media screen and (max-height: 540px), screen and (max-width: 1018px) {
+ .customize-preview-header.themes-filter-bar {
+ position: relative;
+ right: 0;
+ width: 100%;
+ margin: 0 0 25px 0;
+ }
+ .filter-drawer {
+ top: 46px;
+ }
+ .wp-customizer .theme-browser .themes {
+ padding: 0 25px 25px 0;
+ overflow: hidden;
+ }
+
+ .control-panel-themes .customize-themes-full-container {
+ margin-top: 0;
+ padding: 0;
+ height: 100%;
+ width: calc(100% - 300px);
+ }
+}
+
+@media screen and (max-width: 1018px) {
+ .filter-drawer .filter-group {
+ width: calc( (100% - 50px) / 2);
+ }
+}
+
+@media screen and (max-width: 900px) {
+ .customize-preview-header.themes-filter-bar {
+ height: 86px;
+ padding-top: 46px;
+ }
+
+ .themes-filter-bar .wp-filter-search {
+ width: calc(100% - 50px);
+ margin: 0;
+ min-width: 200px;
+ }
+
+ .filter-drawer {
+ top: 86px;
+ }
+
+ .control-panel-themes .filter-themes-count {
+ float: right;
+ }
+}
+
+@media screen and (max-width: 792px) {
+ .filter-drawer .filter-group {
+ width: calc( 100% - 25px);
+ }
+}
+
+.control-panel-themes .customize-themes-mobile-back {
+ display: none;
+}
+
+/* Mobile - toggle between themes and filters */
+@media screen and (max-width: 600px) {
+
+ .filter-drawer {
+ top: 132px;
+ }
+
+ .wp-full-overlay.showing-themes .control-panel-themes .filter-themes-count .filter-themes {
+ display: block;
+ float: left;
+ }
+
+ .control-panel-themes .customize-themes-full-container {
+ width: 100%;
+ margin: 0;
+ padding-top: 46px;
+ height: calc(100% - 46px);
+ z-index: 1;
+ display: none;
+ }
+
+ .showing-themes .control-panel-themes .customize-themes-full-container {
+ display: block;
+ }
+
+ .wp-customizer .showing-themes .control-panel-themes .customize-themes-mobile-back {
+ display: block;
+ position: fixed;
+ top: 0;
+ right: 0;
+ background: #eee;
+ color: #444;
+ border-radius: 0;
+ box-shadow: none;
+ border: none;
+ height: 46px;
+ width: 100%;
+ z-index: 10;
+ text-align: right;
+ text-shadow: none;
+ border-bottom: 1px solid #ddd;
+ border-right: 4px solid transparent;
+ margin: 0;
+ padding: 0;
+ font-size: 0;
+ overflow: hidden;
+ }
+
+ .wp-customizer .showing-themes .control-panel-themes .customize-themes-mobile-back:before {
+ right: 0;
+ top: 0;
+ height: 46px;
+ width: 26px;
+ display: block;
+ line-height: 2.3;
+ padding: 0 8px 0 8px;
+ border-left: 1px solid #ddd;
+ }
+
+ .wp-customizer .showing-themes .control-panel-themes .customize-themes-mobile-back:hover,
+ .wp-customizer .showing-themes .control-panel-themes .customize-themes-mobile-back:focus {
+ color: #0073aa;
+ background: #f3f3f5;
+ border-right-color: #0073aa;
+ outline: none;
+ box-shadow: none;
+ }
+
+ .showing-themes #customize-header-actions {
+ display: none;
+ }
+
+ #customize-controls {
+ width: 100%;
+ }
+}
+
+/* Details View */
+.wp-customizer .theme-overlay {
+ display: none;
+}
+
+.wp-customizer.modal-open .theme-overlay {
+ position: fixed;
+ right: 0;
+ top: 0;
+ left: 0;
+ bottom: 0;
+ z-index: 109;
+}
+
+/* Avoid a z-index war by resetting elements that should be under the overlay.
+ This is likely required because of the way that sections and panels are positioned. */
+.wp-customizer.modal-open #customize-header-actions,
+.wp-customizer.modal-open .control-panel-themes .filter-themes-count,
+.wp-customizer.modal-open .control-panel-themes .customize-themes-section-title.selected:after {
+ z-index: -1;
+}
+
+.wp-full-overlay.in-themes-panel.themes-panel-expanded #customize-controls .wp-full-overlay-sidebar-content {
+ overflow: visible;
+}
+
+.wp-customizer .theme-overlay .theme-backdrop {
+ background: rgba(238, 238, 238, 0.75);
+ position: fixed;
+ z-index: 110;
+}
+
+.wp-customizer .theme-overlay .star-rating {
+ float: right;
+ margin-left: 8px;
+}
+
+.wp-customizer .theme-rating .num-ratings {
+ line-height: 20px;
+}
+
+.wp-customizer .theme-overlay .theme-wrap {
+ right: 90px;
+ left: 90px;
+ top: 45px;
+ bottom: 45px;
+ z-index: 120;
+}
+
+.wp-customizer .theme-overlay .theme-actions {
+ text-align: left; /* Because there're only one or two actions, match the UI pattern of media modals and right-align the action. */
+ padding: 10px 25px;
+ background: #eee;
+ border-top: 1px solid #ddd;
+}
+
+.wp-customizer .theme-overlay .theme-actions .theme-install.preview {
+ margin-right: 8px;
+}
+
+.control-panel-themes .theme-actions .delete-theme {
+ right: 15px; /* these override themes.css on mobile */
+ left: auto;
+ bottom: auto;
+ position: absolute;
+}
+
+.modal-open .in-themes-panel #customize-controls .wp-full-overlay-sidebar-content {
+ overflow: visible; /* Prevent the top-level Customizer controls from becoming visible when elements on the right of the details modal are focused. */
+}
+
+.wp-customizer .theme-header {
+ background: #eee;
+}
+
+.wp-customizer .theme-overlay .theme-header button,
+.wp-customizer .theme-overlay .theme-header .close:before {
+ color: #444;
+}
+
+.wp-customizer .theme-overlay .theme-header .close:focus,
+.wp-customizer .theme-overlay .theme-header .close:hover,
+.wp-customizer .theme-overlay .theme-header .right:focus,
+.wp-customizer .theme-overlay .theme-header .right:hover,
+.wp-customizer .theme-overlay .theme-header .left:focus,
+.wp-customizer .theme-overlay .theme-header .left:hover {
+ background: #fff;
+ border-bottom: 4px solid #0073aa;
+ color: #0073aa;
+}
+
+.wp-customizer .theme-overlay .theme-header .close:focus:before,
+.wp-customizer .theme-overlay .theme-header .close:hover:before {
+ color: #0073aa;
+}
+
+.wp-customizer .theme-overlay .theme-header button.disabled,
+.wp-customizer .theme-overlay .theme-header button.disabled:hover,
+.wp-customizer .theme-overlay .theme-header button.disabled:focus {
+ border-bottom: none;
+ background: transparent;
+ color: #ccc;
+}
+
+/* Small Screens */
+@media (max-width: 850px), (max-height: 472px) {
+ .wp-customizer .theme-overlay .theme-wrap {
+ right: 0;
+ left: 0;
+ top: 0;
+ bottom: 0;
+ }
+
+ .wp-customizer .theme-browser .themes {
+ padding-left: 25px;
+ }
+}
+
+/* Handle cheaters. */
+body.cheatin {
+ font-size: medium;
+ height: auto;
+ background: #fff;
+ margin: 50px auto 2em;
+ padding: 1em 2em;
+ max-width: 700px;
+ min-width: 0;
+ box-shadow: 0 1px 3px rgba(0, 0, 0, 0.13);
+}
+
+body.cheatin h1 {
+ border-bottom: 1px solid #ddd;
+ clear: both;
+ color: #555d66;
+ font-size: 24px;
+ font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
+ margin: 30px 0 0 0;
+ padding: 0;
+ padding-bottom: 7px;
+}
+
+body.cheatin p {
+ font-size: 14px;
+ line-height: 1.5;
+ margin: 25px 0 20px;
+}
+
+/**
+ * Widgets and Menus common styles
+ */
+
+/* higher specificity than .wp-core-ui .button */
+#customize-theme-controls .add-new-widget,
+#customize-theme-controls .add-new-menu-item {
+ cursor: pointer;
+ float: left;
+ margin: 0;
+ margin-right: 10px;
+ transition: all 0.2s;
+ -webkit-user-select: none;
+ -moz-user-select: none;
+ -ms-user-select: none;
+ user-select: none;
+ outline: none;
+}
+
+.reordering .add-new-widget,
+.reordering .add-new-menu-item {
+ opacity: 0.2;
+ pointer-events: none;
+ cursor: not-allowed; /* doesn't work in conjunction with pointer-events */
+}
+
+.add-new-widget:before,
+.add-new-menu-item:before,
+#available-menu-items .new-content-item .add-content:before {
+ content: "\f132";
+ display: inline-block;
+ position: relative;
+ right: -2px;
+ top: 0;
+ font: normal 20px/1 dashicons;
+ vertical-align: middle;
+ transition: all 0.2s;
+ -webkit-font-smoothing: antialiased;
+ -moz-osx-font-smoothing: grayscale;
+}
+
+/* Reordering */
+.reorder-toggle {
+ float: left;
+ padding: 5px 8px;
+ text-decoration: none;
+ cursor: pointer;
+ outline: none;
+}
+
+.reorder,
+.reordering .reorder-done {
+ display: block;
+ padding: 5px 8px;
+}
+
+.reorder-done,
+.reordering .reorder {
+ display: none;
+}
+
+.widget-reorder-nav span,
+.menu-item-reorder-nav button {
+ position: relative;
+ overflow: hidden;
+ float: right;
+ display: block;
+ width: 33px; /* was 42px for mobile */
+ height: 43px;
+ color: #82878c;
+ text-indent: -9999px;
+ cursor: pointer;
+ outline: none;
+}
+
+.menu-item-reorder-nav button {
+ width: 30px;
+ height: 40px;
+ background: transparent;
+ border: none;
+ box-shadow: none;
+}
+
+.widget-reorder-nav span:before,
+.menu-item-reorder-nav button:before {
+ display: inline-block;
+ position: absolute;
+ top: 0;
+ left: 0;
+ width: 100%;
+ height: 100%;
+ font: normal 20px/43px dashicons;
+ text-align: center;
+ text-indent: 0;
+ -webkit-font-smoothing: antialiased;
+ -moz-osx-font-smoothing: grayscale;
+}
+
+.widget-reorder-nav span:hover,
+.widget-reorder-nav span:focus,
+.menu-item-reorder-nav button:hover,
+.menu-item-reorder-nav button:focus {
+ color: #191e23;
+ background: #eee;
+}
+
+.move-widget-down:before,
+.menus-move-down:before {
+ content: "\f347";
+}
+
+.move-widget-up:before,
+.menus-move-up:before {
+ content: "\f343";
+}
+
+#customize-theme-controls .first-widget .move-widget-up,
+#customize-theme-controls .last-widget .move-widget-down,
+.move-up-disabled .menus-move-up,
+.move-down-disabled .menus-move-down,
+.move-right-disabled .menus-move-right,
+.move-left-disabled .menus-move-left {
+ color: #d5d5d5;
+ background-color: #fff;
+ cursor: default;
+ pointer-events: none;
+}
+
+/**
+ * New widget and Add-menu-items modes and panels
+ */
+
+.wp-full-overlay-main {
+ left: auto; /* this overrides a right: 0; which causes the preview to resize, I'd rather have it go off screen at the normal size. */
+ width: 100%;
+}
+
+body.adding-widget .add-new-widget,
+body.adding-widget .add-new-widget:hover,
+.adding-menu-items .add-new-menu-item,
+.adding-menu-items .add-new-menu-item:hover,
+.add-menu-toggle.open,
+.add-menu-toggle.open:hover {
+ background: #eee;
+ border-color: #929793;
+ color: #32373c;
+ box-shadow: inset 0 2px 5px -3px rgba(0, 0, 0, 0.5);
+}
+
+body.adding-widget .add-new-widget:before,
+.adding-menu-items .add-new-menu-item:before,
+#accordion-section-add_menu .add-new-menu-item.open:before {
+ transform: rotate(-45deg);
+}
+
+#available-widgets,
+#available-menu-items {
+ position: absolute;
+ top: 0;
+ bottom: 0;
+ right: -301px;
+ visibility: hidden;
+ overflow-x: hidden;
+ overflow-y: auto;
+ width: 300px;
+ margin: 0;
+ z-index: 4;
+ background: #eee;
+ transition: right .18s;
+ border-left: 1px solid #ddd;
+}
+
+#available-widgets .customize-section-title,
+#available-menu-items .customize-section-title {
+ display: none;
+}
+
+#available-widgets-list {
+ top: 60px;
+ position: absolute;
+ overflow: auto;
+ bottom: 0;
+ width: 100%;
+ border-top: 1px solid #ddd;
+}
+
+.no-widgets-found #available-widgets-list {
+ border-top: none;
+}
+
+#available-widgets-filter {
+ position: fixed;
+ top: 0;
+ z-index: 1;
+ width: 300px;
+ background: #eee;
+}
+
+/* search field container */
+#available-widgets-filter,
+#available-menu-items-search .accordion-section-title {
+ padding: 13px 15px;
+ box-sizing: border-box;
+}
+
+#available-widgets-filter input,
+#available-menu-items-search input {
+ width: 100%;
+ height: 32px;
+ margin: 1px 0;
+ padding: 6px 30px;
+}
+
+#available-widgets-filter input::-ms-clear,
+#available-menu-items-search input::-ms-clear {
+ display: none; /* remove the "x" in IE, which conflicts with the "x" icon on button.clear-results */
+}
+
+#available-menu-items-search .search-icon,
+#available-widgets-filter .search-icon {
+ display: block;
+ position: absolute;
+ top: 15px; /* 13 container padding +1 input margin +1 input border */
+ right: 16px;
+ width: 30px;
+ height: 30px;
+ line-height: 2.1;
+ text-align: center;
+ color: #72777c;
+}
+
+#available-widgets-filter .clear-results,
+#available-menu-items-search .clear-results {
+ position: absolute;
+ top: 15px; /* 13 container padding +1 input margin +1 input border */
+ left: 16px;
+ width: 30px;
+ height: 30px;
+ padding: 0;
+ border: 0;
+ cursor: pointer;
+ background: none;
+ color: #a00;
+ text-decoration: none;
+ outline: 0;
+}
+
+#available-widgets-filter .clear-results,
+#available-menu-items-search .clear-results,
+#available-menu-items-search.loading .clear-results.is-visible {
+ display: none;
+}
+
+#available-widgets-filter .clear-results.is-visible,
+#available-menu-items-search .clear-results.is-visible {
+ display: block;
+}
+
+#available-widgets-filter .clear-results:before,
+#available-menu-items-search .clear-results:before {
+ content: "\f335";
+ font: normal 20px/1 dashicons;
+ vertical-align: middle;
+ -webkit-font-smoothing: antialiased;
+ -moz-osx-font-smoothing: grayscale;
+}
+
+#available-widgets-filter .clear-results:hover,
+#available-widgets-filter .clear-results:focus,
+#available-menu-items-search .clear-results:hover,
+#available-menu-items-search .clear-results:focus {
+ color: #dc3232;
+}
+
+#available-widgets-filter .clear-results:focus,
+#available-menu-items-search .clear-results:focus {
+ box-shadow:
+ 0 0 0 1px #5b9dd9,
+ 0 0 2px 1px rgba(30, 140, 190, 0.8);
+}
+
+#available-menu-items-search .search-icon:after,
+#available-widgets-filter .search-icon:after,
+.themes-filter-bar .search-icon:after {
+ content: "\f179";
+ font: normal 20px/1 dashicons;
+ vertical-align: middle;
+ -webkit-font-smoothing: antialiased;
+ -moz-osx-font-smoothing: grayscale;
+}
+
+.themes-filter-bar .search-icon {
+ position: absolute;
+ top: 7px;
+ right: 26px;
+ z-index: 1;
+ color: #72777c;
+ height: 30px;
+ width: 30px;
+ line-height: 2;
+ text-align: center;
+}
+
+.no-widgets-found-message {
+ display: none;
+ margin: 0;
+ padding: 0 15px;
+ line-height: inherit;
+}
+
+.no-widgets-found .no-widgets-found-message {
+ display: block;
+}
+
+#available-widgets .widget-top,
+#available-widgets .widget-top:hover,
+#available-menu-items .item-top,
+#available-menu-items .item-top:hover {
+ border: none;
+ background: transparent;
+ box-shadow: none;
+}
+
+#available-widgets .widget-tpl,
+#available-menu-items .item-tpl {
+ position: relative;
+ padding: 15px 60px 15px 15px;
+ background: #fff;
+ border-bottom: 1px solid #ddd;
+ border-right: 4px solid #fff;
+ transition:
+ .15s color ease-in-out,
+ .15s background-color ease-in-out,
+ .15s border-color ease-in-out;
+ cursor: pointer;
+ display: none;
+}
+
+#available-widgets .widget,
+#available-menu-items .item {
+ position: static;
+}
+
+
+/* Responsive */
+.customize-controls-preview-toggle {
+ display: none;
+}
+
+@media only screen and (max-width: 782px) {
+ .wp-customizer .theme:not(.active):hover .theme-actions,
+ .wp-customizer .theme:not(.active):focus .theme-actions {
+ display: block;
+ }
+
+ .wp-customizer .theme-browser .theme.active .theme-name span {
+ display: inline;
+ }
+
+ .customize-control-header button.random .dice {
+ margin-top: 0;
+ }
+
+ .customize-control-radio .customize-inside-control-row,
+ .customize-control-checkbox .customize-inside-control-row,
+ .customize-control-nav_menu_auto_add .customize-inside-control-row {
+ margin-right: 32px;
+ }
+
+ .customize-control-radio input,
+ .customize-control-checkbox input,
+ .customize-control-nav_menu_auto_add input {
+ margin-right: -32px;
+ }
+
+ .customize-control input[type="radio"] + label + br,
+ .customize-control input[type="checkbox"] + label + br {
+ line-height: 2.5; /* For widgets checkboxes */
+ }
+
+ .customize-control .date-time-fields select {
+ height: 39px;
+ }
+
+ .date-time-fields .date-input.month {
+ width: 79px;
+ }
+
+ .date-time-fields .date-input.day,
+ .date-time-fields .date-input.hour,
+ .date-time-fields .date-input.minute {
+ width: 55px;
+ }
+
+ .date-time-fields .date-input.year {
+ width: 80px;
+ }
+
+ .date-time-fields .date-timezone {
+ line-height: 3.2;
+ }
+
+ #customize-control-changeset_preview_link a {
+ bottom: 16px;
+ }
+
+ .preview-link-wrapper .customize-copy-preview-link.preview-control-element.button {
+ bottom: 10px;
+ }
+
+ .media-widget-control .media-widget-buttons .button.edit-media,
+ .media-widget-control .media-widget-buttons .button.change-media,
+ .media-widget-control .media-widget-buttons .button.select-media {
+ margin-top: 12px;
+ }
+
+ .wp-core-ui .themes-filter-bar .feature-filter-toggle {
+ margin: 3px 25px 3px 0;
+ }
+}
+
+@media screen and (max-width: 1200px) {
+ .outer-section-open .wp-full-overlay.expanded.preview-mobile .wp-full-overlay-main,
+ .adding-menu-items .wp-full-overlay.expanded.preview-mobile .wp-full-overlay-main,
+ .adding-widget .wp-full-overlay.expanded.preview-mobile .wp-full-overlay-main {
+ right: 67%;
+ }
+}
+
+@media screen and (max-width: 640px) {
+
+ /* when the sidebar is collapsed and switching to responsive view,
+ bring it back see ticket #35220 */
+ .wp-full-overlay.collapsed #customize-controls {
+ margin-right: 0;
+ }
+
+ .wp-full-overlay-sidebar .wp-full-overlay-sidebar-content {
+ bottom: 0;
+ }
+
+ .customize-controls-preview-toggle {
+ display: block;
+ position: absolute;
+ top: 0;
+ right: 48px;
+ line-height: 3.2;
+ font-size: 14px;
+ padding: 0 12px;
+ margin: 0;
+ height: 45px;
+ background: #eee;
+ border: 0;
+ border-left: 1px solid #ddd;
+ color: #555d66;
+ cursor: pointer;
+ transition: color .1s ease-in-out, background .1s ease-in-out;
+ }
+
+ #customize-footer-actions,
+ /*#customize-preview,*/
+ .customize-controls-preview-toggle .controls,
+ .preview-only .wp-full-overlay-sidebar-content,
+ .preview-only .customize-controls-preview-toggle .preview {
+ display: none;
+ }
+
+ .preview-only #customize-save-button-wrapper {
+ margin-top: -46px;
+ }
+
+ .customize-controls-preview-toggle .preview:before,
+ .customize-controls-preview-toggle .controls:before {
+ font: normal 20px/1 dashicons;
+ content: "\f177";
+ position: relative;
+ top: 4px;
+ margin-left: 6px;
+ }
+
+ .customize-controls-preview-toggle .controls:before {
+ content: "\f540";
+ }
+
+ .preview-only #customize-controls {
+ height: 45px;
+ }
+
+ .preview-only #customize-preview,
+ .preview-only .customize-controls-preview-toggle .controls {
+ display: block;
+ }
+
+ .wp-core-ui.wp-customizer .button {
+ padding: 6px 14px;
+ line-height: normal;
+ font-size: 14px;
+ vertical-align: middle;
+ height: auto;
+ }
+
+ #publish-settings {
+ height: 31px;
+ }
+
+ #customize-control-changeset_status .customize-inside-control-row {
+ padding-top: 15px;
+ }
+
+ body.adding-widget div#available-widgets,
+ body.adding-menu-items div#available-menu-items,
+ body.outer-section-open div#customize-sidebar-outer-content {
+ width: 100%;
+ }
+
+ #available-widgets .customize-section-title,
+ #available-menu-items .customize-section-title {
+ display: block;
+ margin: 0;
+ }
+
+ #available-widgets .customize-section-back,
+ #available-menu-items .customize-section-back {
+ height: 69px;
+ }
+
+ #available-widgets .customize-section-title h3,
+ #available-menu-items .customize-section-title h3 {
+ font-size: 20px;
+ font-weight: 200;
+ padding: 9px 14px 12px 10px;
+ margin: 0;
+ line-height: 24px;
+ color: #555d66;
+ display: block;
+ overflow: hidden;
+ white-space: nowrap;
+ text-overflow: ellipsis;
+ }
+
+ #available-widgets .customize-section-title .customize-action,
+ #available-menu-items .customize-section-title .customize-action {
+ font-size: 13px;
+ display: block;
+ font-weight: 400;
+ overflow: hidden;
+ white-space: nowrap;
+ text-overflow: ellipsis;
+ }
+
+ #available-widgets-filter {
+ position: relative;
+ width: 100%;
+ height: auto;
+ }
+
+ #available-widgets-list {
+ top: 130px;
+ }
+
+ #available-menu-items-search .clear-results,
+ #available-menu-items-search .search-icon {
+ top: 85px; /* 70 section title height + 13 container padding +1 input margin +1 input border */
+ }
+
+ .reorder,
+ .reordering .reorder-done {
+ padding: 8px;
+ }
+
+ .wp-core-ui .themes-filter-bar .feature-filter-toggle {
+ margin: 0;
+ }
+
+ .theme-browser .theme.active .theme-actions,
+ .wp-customizer .theme-browser .theme .theme-actions {
+ padding: 9px 15px;
+ box-shadow: inset 0 1px 0 rgba(0, 0, 0, 0.1);
+ }
+}
+
+@media screen and (max-width: 600px) {
+ .theme-browser .theme.active .theme-actions,
+ .wp-customizer .theme-browser .theme .theme-actions {
+ padding: 8px 15px;
+ box-shadow: none;
+ }
+
+ .wp-full-overlay.expanded {
+ margin-right: 0;
+ }
+
+ body.adding-widget div#available-widgets,
+ body.adding-menu-items div#available-menu-items,
+ body.outer-section-open div#customize-sidebar-outer-content {
+ top: 46px;
+ z-index: 10;
+ }
+
+ body.wp-customizer .wp-full-overlay.expanded #customize-sidebar-outer-content {
+ right: -100%;
+ }
+
+ body.wp-customizer.outer-section-open .wp-full-overlay.expanded #customize-sidebar-outer-content {
+ right: 0;
+ }
+}
diff --git a/www/crm/wp-admin/css/customize-controls-rtl.min.css b/www/crm/wp-admin/css/customize-controls-rtl.min.css
new file mode 100644
index 00000000..e1d8c5a2
--- /dev/null
+++ b/www/crm/wp-admin/css/customize-controls-rtl.min.css
@@ -0,0 +1,2 @@
+/*! This file is auto-generated */
+body{overflow:hidden;-webkit-text-size-adjust:100%}.customize-controls-close,.widget-control-actions a{text-decoration:none}#customize-controls h3{font-size:14px}#customize-controls img{max-width:100%}#customize-controls .submit{text-align:center}#customize-controls #customize-notifications-area .notice.notification-overlay.notification-changeset-locked{background-color:rgba(0,0,0,.7);padding:25px}#customize-controls #customize-notifications-area .notice.notification-overlay.notification-changeset-locked .customize-changeset-locked-message{margin-right:auto;margin-left:auto;max-width:366px;min-height:64px;width:auto;padding:25px 109px 25px 25px;position:relative;background:#fff;box-shadow:0 3px 6px rgba(0,0,0,.3);line-height:1.5;overflow-y:auto;text-align:right;top:calc(50% - 100px)}#customize-controls #customize-notifications-area .notice.notification-overlay.notification-changeset-locked .currently-editing{margin-top:0}#customize-controls #customize-notifications-area .notice.notification-overlay.notification-changeset-locked .action-buttons{margin-bottom:0}.customize-changeset-locked-avatar{width:64px;position:absolute;right:25px;top:25px}.wp-core-ui.wp-customizer .customize-changeset-locked-message a.button{margin-left:10px;margin-top:0}#customize-controls .description{color:#555d66}#customize-save-button-wrapper{float:left;margin-top:9px}body:not(.ready) #customize-save-button-wrapper .save{visibility:hidden}#customize-save-button-wrapper .save{float:right;border-radius:3px;box-shadow:none;margin-top:0}#customize-save-button-wrapper .save:focus,#publish-settings:focus{box-shadow:0 1px 0 #0073aa,0 0 2px 1px #33b3db}#customize-save-button-wrapper .save.has-next-sibling{border-radius:0 3px 3px 0}#customize-sidebar-outer-content{position:absolute;top:0;bottom:0;right:0;visibility:hidden;overflow-x:hidden;overflow-y:auto;width:100%;margin:0;z-index:-1;background:#eee;transition:right .18s;border-left:1px solid #ddd;border-right:1px solid #ddd;height:100%}#customize-theme-controls .control-section-outer{display:none!important}#customize-outer-theme-controls .accordion-section-content{padding:12px}#customize-outer-theme-controls .accordion-section-content.open{display:block}.outer-section-open .wp-full-overlay.expanded #customize-sidebar-outer-content{visibility:visible;right:100%;transition:right .18s}.customize-outer-pane-parent{margin:0}.outer-section-open .wp-full-overlay.expanded .wp-full-overlay-main{right:300px;opacity:.4}.adding-menu-items .wp-full-overlay.expanded.preview-mobile .wp-full-overlay-main,.adding-menu-items .wp-full-overlay.expanded.preview-tablet .wp-full-overlay-main,.adding-widget .wp-full-overlay.expanded.preview-mobile .wp-full-overlay-main,.adding-widget .wp-full-overlay.expanded.preview-tablet .wp-full-overlay-main,.outer-section-open .wp-full-overlay.expanded.preview-mobile .wp-full-overlay-main,.outer-section-open .wp-full-overlay.expanded.preview-tablet .wp-full-overlay-main{right:64%}#customize-outer-theme-controls li.notice{padding-top:8px;padding-bottom:8px;margin-right:0;margin-bottom:10px}#publish-settings{text-indent:0;border-radius:3px 0 0 3px;padding-right:0;padding-left:0;box-shadow:none;font-size:14px;width:30px;float:right;transform:none;margin-top:0}body.trashing #customize-save-button-wrapper .save,body.trashing #publish-settings,body:not(.ready) #publish-settings{display:none}#customize-header-actions .spinner{margin-top:13px;margin-left:4px}.saving #customize-header-actions .spinner,.trashing #customize-header-actions .spinner{visibility:visible}#customize-header-actions{border-bottom:1px solid #ddd}#customize-controls .wp-full-overlay-sidebar-content{overflow-y:auto;overflow-x:hidden}.outer-section-open #customize-controls .wp-full-overlay-sidebar-content{background:#eee}#customize-controls .customize-info{border:none;border-bottom:1px solid #ddd;margin-bottom:15px}#customize-control-changeset_preview_link input,#customize-control-changeset_status .customize-inside-control-row{background-color:#fff;border-bottom:1px solid #ddd;box-sizing:content-box;width:100%;margin-right:-12px;padding-right:12px;padding-left:12px}#customize-control-trash_changeset{margin-top:20px}#customize-control-trash_changeset .button-link{position:relative;padding-right:24px;display:inline-block}#customize-control-trash_changeset .button-link:before{content:"\f182";font:normal 22px dashicons;text-decoration:none;position:absolute;right:0;top:-2px}#customize-controls .date-input:invalid{border-color:#dc3232}#customize-control-changeset_status .customize-inside-control-row{padding-top:10px;padding-bottom:10px;font-weight:500}#customize-control-changeset_status .customize-inside-control-row:first-of-type{border-top:1px solid #ddd}#customize-control-changeset_status .customize-control-title{margin-bottom:6px}#customize-control-changeset_status input{margin-right:0}#customize-control-changeset_preview_link{position:relative;display:block}.preview-link-wrapper .customize-copy-preview-link.preview-control-element.button{margin:0;position:absolute;bottom:9px;left:0}.preview-link-wrapper{position:relative}.customize-copy-preview-link:after,.customize-copy-preview-link:before{content:"";height:28px;position:absolute;background:#fff;top:-1px}.customize-copy-preview-link:before{right:-10px;width:9px;opacity:.75}.customize-copy-preview-link:after{right:-5px;width:4px;opacity:.8}#customize-control-changeset_preview_link input{line-height:2.5;border-top:1px solid #ddd;border-right:none;border-left:none;text-indent:-999px;color:#fff}#customize-control-changeset_preview_link label{position:relative;display:block}#customize-control-changeset_preview_link a{display:inline-block;position:absolute;white-space:nowrap;overflow:hidden;width:90%;bottom:14px;font-size:14px;text-decoration:none}#customize-control-changeset_preview_link a.disabled,#customize-control-changeset_preview_link a.disabled:active,#customize-control-changeset_preview_link a.disabled:focus,#customize-control-changeset_preview_link a.disabled:visited{color:#000;opacity:.4;cursor:default;outline:0;box-shadow:none}#sub-accordion-section-publish_settings .customize-section-description-container{display:none}#customize-controls .customize-info.section-meta{margin-bottom:15px}.customize-control-date_time .customize-control-description+.date-time-fields.includes-time{margin-top:10px}.customize-control.customize-control-date_time .date-time-fields .date-input.day{margin-left:0}.date-time-fields .date-input.month{width:auto;margin:0}.date-time-fields .date-input.day,.date-time-fields .date-input.hour,.date-time-fields .date-input.minute{width:46px}.date-time-fields .date-input.year{width:60px}.date-time-fields .date-input.meridian{width:auto;margin:0}.date-time-fields .time-row{margin-top:12px}.date-time-fields .date-timezone{line-height:2.2;text-decoration:none}#customize-control-changeset_preview_link{margin-top:6px}#customize-control-changeset_status{margin-bottom:0;padding-bottom:0}#customize-control-changeset_scheduled_date{box-sizing:content-box;width:100%;margin-right:-12px;padding:12px;background:#fff;border-bottom:1px solid #ddd;margin-bottom:0}#customize-control-changeset_scheduled_date .customize-control-description{font-style:normal}#customize-controls .customize-info.is-in-view,#customize-controls .customize-section-title.is-in-view{position:absolute;z-index:9;width:100%;box-shadow:0 1px 0 rgba(0,0,0,.1)}#customize-controls .customize-section-title.is-in-view{margin-top:0}#customize-controls .customize-info.is-in-view+.accordion-section{margin-top:15px}#customize-controls .customize-info.is-sticky,#customize-controls .customize-section-title.is-sticky{position:fixed;top:46px}#customize-controls .customize-info .accordion-section-title{background:#fff;color:#555d66;border-right:none;border-left:none;border-bottom:none;cursor:default}#customize-controls .customize-info .accordion-section-title:focus:after,#customize-controls .customize-info .accordion-section-title:hover:after,#customize-controls .customize-info.open .accordion-section-title:after{color:#32373c}#customize-controls .customize-info .accordion-section-title:after{display:none}#customize-controls .customize-info .preview-notice{font-size:13px;line-height:1.9}#customize-controls .customize-info .panel-title,#customize-controls .customize-pane-child .customize-section-title h3,#customize-controls .customize-pane-child h3.customize-section-title,#customize-outer-theme-controls .customize-pane-child .customize-section-title h3,#customize-outer-theme-controls .customize-pane-child h3.customize-section-title{font-size:20px;font-weight:200;line-height:26px;display:block;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}#customize-controls .customize-section-title span.customize-action{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}#customize-controls .customize-info .customize-help-toggle{position:absolute;top:4px;left:1px;padding:20px 10px 10px 20px;width:20px;height:20px;cursor:pointer;box-shadow:none;-webkit-appearance:none;background:0 0;color:#555d66;border:none}#customize-controls .customize-info .customize-help-toggle:before{position:absolute;top:5px;right:6px}#customize-controls .customize-info .customize-help-toggle:focus,#customize-controls .customize-info .customize-help-toggle:hover,#customize-controls .customize-info.open .customize-help-toggle{color:#0073aa}#customize-controls .customize-info .customize-panel-description,#customize-controls .customize-info .customize-section-description,#customize-controls .no-widget-areas-rendered-notice,#customize-outer-theme-controls .customize-info .customize-section-description{color:#555d66;display:none;background:#fff;padding:12px 15px;border-top:1px solid #ddd}#customize-controls .customize-info .customize-panel-description.open+.no-widget-areas-rendered-notice{border-top:none}.no-widget-areas-rendered-notice{font-style:italic}.no-widget-areas-rendered-notice p:first-child{margin-top:0}.no-widget-areas-rendered-notice p:last-child{margin-bottom:0}#customize-controls .customize-info .customize-section-description{margin-bottom:15px}#customize-controls .customize-info .customize-panel-description p:first-child,#customize-controls .customize-info .customize-section-description p:first-child{margin-top:0}#customize-controls .customize-info .customize-panel-description p:last-child,#customize-controls .customize-info .customize-section-description p:last-child{margin-bottom:0}#customize-controls .current-panel .control-section>h3.accordion-section-title{padding-left:30px}#customize-outer-theme-controls .control-section,#customize-theme-controls .control-section{border:none}#customize-outer-theme-controls .accordion-section-title,#customize-theme-controls .accordion-section-title{color:#555d66;background-color:#fff;border-bottom:1px solid #ddd;border-right:4px solid #fff;transition:.15s color ease-in-out,.15s background-color ease-in-out,.15s border-color ease-in-out}#customize-controls #customize-theme-controls .customize-themes-panel .accordion-section-title{color:#555;background-color:#fff;border-right:4px solid #fff}#customize-outer-theme-controls .accordion-section-title:after,#customize-theme-controls .accordion-section-title:after{content:"\f341";color:#a0a5aa}#customize-outer-theme-controls .accordion-section-content,#customize-theme-controls .accordion-section-content{color:#555d66;background:0 0}#customize-controls .control-section .accordion-section-title:focus,#customize-controls .control-section .accordion-section-title:hover,#customize-controls .control-section.open .accordion-section-title,#customize-controls .control-section:hover>.accordion-section-title{color:#0073aa;background:#f3f3f5;border-right-color:#0073aa}#accordion-section-themes+.control-section{border-top:1px solid #ddd}.js .control-section .accordion-section-title:focus,.js .control-section .accordion-section-title:hover,.js .control-section.open .accordion-section-title,.js .control-section:hover .accordion-section-title{background:#f3f3f5}#customize-outer-theme-controls .control-section .accordion-section-title:focus:after,#customize-outer-theme-controls .control-section .accordion-section-title:hover:after,#customize-outer-theme-controls .control-section.open .accordion-section-title:after,#customize-outer-theme-controls .control-section:hover>.accordion-section-title:after,#customize-theme-controls .control-section .accordion-section-title:focus:after,#customize-theme-controls .control-section .accordion-section-title:hover:after,#customize-theme-controls .control-section.open .accordion-section-title:after,#customize-theme-controls .control-section:hover>.accordion-section-title:after{color:#0073aa}#customize-theme-controls .control-section.open{border-bottom:1px solid #eee}#customize-outer-theme-controls .control-section.open .accordion-section-title,#customize-theme-controls .control-section.open .accordion-section-title{border-bottom-color:#eee!important}#customize-theme-controls .control-section:last-of-type.open,#customize-theme-controls .control-section:last-of-type>.accordion-section-title{border-bottom-color:#ddd}#customize-theme-controls .control-panel-content:not(.control-panel-nav_menus) .control-section:nth-child(2),#customize-theme-controls .control-panel-nav_menus .control-section-nav_menu,#customize-theme-controls .control-section-nav_menu_locations .accordion-section-title{border-top:1px solid #ddd}#customize-theme-controls .control-panel-nav_menus .control-section-nav_menu+.control-section-nav_menu{border-top:none}#customize-theme-controls>ul{margin:0}#customize-theme-controls .accordion-section-content{position:absolute;top:0;right:100%;width:100%;margin:0;padding:12px;box-sizing:border-box}#customize-info,#customize-theme-controls .customize-pane-child,#customize-theme-controls .customize-pane-parent{overflow:visible;width:100%;margin:0;padding:0;box-sizing:border-box;transition:.18s transform cubic-bezier(.645,.045,.355,1)}#customize-theme-controls .customize-pane-child.skip-transition{transition:none}#customize-info,#customize-theme-controls .customize-pane-parent{position:relative;visibility:visible;height:auto;max-height:none;overflow:auto;transform:none}#customize-theme-controls .customize-pane-child{position:absolute;top:0;right:0;visibility:hidden;height:0;max-height:none;overflow:hidden;transform:translateX(-100%)}#customize-theme-controls .customize-pane-child.current-panel,#customize-theme-controls .customize-pane-child.open{transform:none}.in-sub-panel #customize-info,.in-sub-panel #customize-theme-controls .customize-pane-parent,.in-sub-panel.section-open #customize-theme-controls .customize-pane-child.current-panel,.section-open #customize-info,.section-open #customize-theme-controls .customize-pane-parent{visibility:hidden;height:0;overflow:hidden;transform:translateX(100%)}#customize-theme-controls .customize-pane-child.busy,#customize-theme-controls .customize-pane-child.current-panel,#customize-theme-controls .customize-pane-child.open,.busy.section-open.in-sub-panel #customize-theme-controls .customize-pane-child.current-panel,.in-sub-panel #customize-info.busy,.in-sub-panel #customize-theme-controls .customize-pane-parent.busy,.section-open #customize-info.busy,.section-open #customize-theme-controls .customize-pane-parent.busy{visibility:visible;height:auto;overflow:auto}#customize-theme-controls .customize-pane-child.accordion-section-content,#customize-theme-controls .customize-pane-child.accordion-sub-container{display:block;overflow-x:hidden}#customize-theme-controls .customize-pane-child.accordion-section-content{padding:12px}#customize-theme-controls .customize-pane-child.menu li{position:static}.control-section-nav_menu .customize-section-description-container,.control-section-new_menu .customize-section-description-container,.customize-section-description-container{margin-bottom:15px}.control-section-nav_menu .customize-control,.control-section-new_menu .customize-control{margin-bottom:0}.customize-section-title{margin:-12px -12px 0 -12px;border-bottom:1px solid #ddd;background:#fff}div.customize-section-description{margin-top:22px}.customize-info div.customize-section-description{margin-top:0}div.customize-section-description p:first-child{margin-top:0}div.customize-section-description p:last-child{margin-bottom:0}#customize-theme-controls .customize-themes-panel h3.customize-section-title:first-child{border-bottom:1px solid #ddd;padding:12px 12px 12px 12px}.ios #customize-theme-controls .customize-themes-panel h3.customize-section-title:first-child{padding:12px 12px 13px 12px}.customize-section-title h3,h3.customize-section-title{padding:10px 14px 12px 10px;margin:0;line-height:21px;color:#555d66}.accordion-sub-container.control-panel-content{display:none;position:absolute;top:0;width:100%}.accordion-sub-container.control-panel-content.busy{display:block}.current-panel .accordion-sub-container.control-panel-content{width:100%}.customize-controls-close{display:block;position:absolute;top:0;right:0;width:45px;height:41px;padding:0 0 0 2px;background:#eee;border:none;border-top:4px solid #eee;border-left:1px solid #ddd;color:#444;text-align:right;cursor:pointer;transition:color .15s ease-in-out,border-color .15s ease-in-out,background .15s ease-in-out;box-sizing:content-box}.customize-panel-back,.customize-section-back{display:block;float:right;width:48px;height:71px;padding:0 0 0 24px;margin:0;background:#fff;border:none;border-left:1px solid #ddd;border-right:4px solid #fff;box-shadow:none;cursor:pointer;transition:color .15s ease-in-out,border-color .15s ease-in-out,background .15s ease-in-out}.customize-section-back{height:74px}.ios .customize-panel-back{display:none}.ios .expanded.in-sub-panel .customize-panel-back{display:block}#customize-controls .panel-meta.customize-info .accordion-section-title{margin-right:48px;border-right:none}#customize-controls .cannot-expand:hover .accordion-section-title,#customize-controls .panel-meta.customize-info .accordion-section-title:hover{background:#fff;color:#555d66;border-right-color:#fff}.customize-controls-close:focus,.customize-controls-close:hover,.customize-controls-preview-toggle:focus,.customize-controls-preview-toggle:hover{background:#fff;color:#0073aa;border-top-color:#0073aa;outline:0;box-shadow:none}.customize-panel-back:focus,.customize-panel-back:hover,.customize-section-back:focus,.customize-section-back:hover{color:#0073aa;background:#f3f3f5;border-right-color:#0073aa;outline:0;box-shadow:none}.customize-controls-close:before{font:normal 22px/45px dashicons;content:"\f335";position:relative;top:-3px;right:13px}.customize-panel-back:before,.customize-section-back:before{font:normal 20px/72px dashicons;content:"\f345";position:relative;right:9px}.wp-full-overlay-sidebar .wp-full-overlay-header{background-color:#eee;transition:padding ease-in-out .18s}.in-sub-panel .wp-full-overlay-sidebar .wp-full-overlay-header{padding-right:62px}p.customize-section-description{font-style:normal;margin-top:22px;margin-bottom:0}.customize-section-description ul{margin-right:1em}.customize-section-description ul>li{list-style:disc}.section-description-buttons{text-align:left}.section-description-buttons button.button-link{color:#0073aa;text-decoration:underline}.customize-control{width:100%;float:right;clear:both;margin-bottom:12px}.customize-control input[type=checkbox],.customize-control input[type=radio],.customize-control select{line-height:2}.customize-control input[type=email],.customize-control input[type=number],.customize-control input[type=password],.customize-control input[type=search],.customize-control input[type=tel],.customize-control input[type=text],.customize-control input[type=url]{width:100%;line-height:1.3;margin:0}.customize-control-hidden{margin:0}.customize-control-textarea textarea{width:100%;resize:vertical}.customize-control select{width:100%;height:28px;line-height:2}.customize-control select[multiple]{height:auto}.customize-control-title{display:block;font-size:14px;line-height:1.75;font-weight:600;margin-bottom:4px}.customize-control-description{display:block;font-style:italic;line-height:1.4;margin-top:0;margin-bottom:5px}.customize-section-description a.external-link:after{font:16px/11px dashicons;content:"\f310";top:3px;position:relative;padding-right:3px;display:inline-block;text-decoration:none}.customize-control-color .color-picker,.customize-control-upload div{line-height:28px}.customize-control .customize-inside-control-row{line-height:1.6;display:block;margin-right:24px;padding-top:6px;padding-bottom:6px}.customize-control-checkbox input,.customize-control-nav_menu_auto_add input,.customize-control-radio input{margin-left:4px;margin-right:-24px}.customize-control-radio{padding:5px 0 10px}.customize-control-radio .customize-control-title{margin-bottom:0;line-height:1.6}.customize-control-radio .customize-control-title+.customize-control-description{margin-top:7px}.customize-control-checkbox label,.customize-control-radio label{vertical-align:top}.customize-control .attachment-thumb.type-icon{float:right;margin:10px;width:auto}.customize-control .attachment-title{font-weight:600;margin:0;padding:5px 10px}.customize-control .attachment-meta{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin:0;padding:0 10px}.customize-control .attachment-meta-title{padding-top:7px}.customize-control .thumbnail-image,.customize-control .wp-media-wrapper.wp-video,.customize-control-header .current{line-height:0}.customize-control-site_icon .favicon-preview .browser-preview{vertical-align:top}.customize-control .thumbnail-image img{cursor:pointer}#customize-controls .thumbnail-audio .thumbnail{max-width:64px;max-height:64px;margin:10px;float:right}#available-menu-items .accordion-section-content .new-content-item,.customize-control-dropdown-pages .new-content-item{width:calc(100% - 30px);padding:8px 15px;position:absolute;bottom:0;z-index:10;background:#eee;display:flex}.customize-control-dropdown-pages .new-content-item{width:100%;padding:5px 1px 5px 0;position:relative}#available-menu-items .new-content-item .create-item-input,.customize-control-dropdown-pages .new-content-item .create-item-input{flex-grow:10}#available-menu-items .new-content-item .add-content,.customize-control-dropdown-pages .new-content-item .add-content{margin:2px 6px 2px 0;flex-grow:1}.customize-control-dropdown-pages .new-content-item .create-item-input.invalid{border:1px solid #dc3232}.customize-control-dropdown-pages .add-new-toggle{margin-right:1px;font-weight:600;line-height:2.2}#customize-preview iframe{width:100%;height:100%;position:absolute}#customize-preview iframe+iframe{visibility:hidden}.wp-full-overlay-sidebar{background:#eee;border-left:1px solid #ddd}#customize-controls .customize-control-notifications-container{margin:4px 0 8px 0;padding:0;cursor:default}#customize-controls .customize-control-widget_form.has-error .widget .widget-top,.customize-control-nav_menu_item.has-error .menu-item-bar .menu-item-handle{box-shadow:inset 0 0 0 2px #dc3232;transition:.15s box-shadow linear}#customize-controls .customize-control-notifications-container li.notice{list-style:none;margin:0 0 6px 0;padding:9px 14px;overflow:hidden}#customize-controls .customize-control-notifications-container .notice.is-dismissible{padding-left:38px}.customize-control-notifications-container li.notice:last-child{margin-bottom:0}#customize-controls .customize-control-nav_menu_item .customize-control-notifications-container{margin-top:0}#customize-controls .customize-control-widget_form .customize-control-notifications-container{margin-top:8px}.customize-control-text.has-error input{outline:2px solid #dc3232}#customize-controls #customize-notifications-area{position:absolute;top:46px;width:100%;border-bottom:1px solid #ddd;display:block;padding:0;margin:0}.wp-full-overlay.collapsed #customize-controls #customize-notifications-area{display:none!important}#customize-controls #customize-notifications-area:not(.has-overlay-notifications),#customize-controls .customize-section-title>.customize-control-notifications-container:not(.has-overlay-notifications),#customize-controls .panel-meta>.customize-control-notifications-container:not(.has-overlay-notifications){max-height:210px;overflow-x:hidden;overflow-y:auto}#customize-controls #customize-notifications-area .notice,#customize-controls #customize-notifications-area>ul,#customize-controls .customize-section-title>.customize-control-notifications-container,#customize-controls .customize-section-title>.customize-control-notifications-container .notice,#customize-controls .panel-meta>.customize-control-notifications-container,#customize-controls .panel-meta>.customize-control-notifications-container .notice{margin:0}#customize-controls .customize-section-title>.customize-control-notifications-container,#customize-controls .panel-meta>.customize-control-notifications-container{border-top:1px solid #ddd}#customize-controls #customize-notifications-area .notice,#customize-controls .customize-section-title>.customize-control-notifications-container .notice,#customize-controls .panel-meta>.customize-control-notifications-container .notice{padding:9px 14px}#customize-controls #customize-notifications-area .notice.is-dismissible,#customize-controls .customize-section-title>.customize-control-notifications-container .notice.is-dismissible,#customize-controls .panel-meta>.customize-control-notifications-container .notice.is-dismissible{padding-left:38px}#customize-controls #customize-notifications-area .notice+.notice,#customize-controls .customize-section-title>.customize-control-notifications-container .notice+.notice,#customize-controls .panel-meta>.customize-control-notifications-container .notice+.notice{margin-top:1px}@keyframes customize-fade-in{0%{opacity:0}100%{opacity:1}}#customize-controls #customize-notifications-area .notice.notification-overlay,#customize-controls .notice.notification-overlay{margin:0;border-right:0}#customize-controls .customize-control-notifications-container.has-overlay-notifications{animation:customize-fade-in .5s;z-index:30}#customize-controls #customize-notifications-area .notice.notification-overlay .notification-message{clear:both;color:#191e23;font-size:18px;font-style:normal;margin:0;padding:2em 0;text-align:center;width:100%;display:block;top:50%;position:relative}#customize-control-show_on_front.has-error{margin-bottom:0}#customize-control-show_on_front.has-error .customize-control-notifications-container{margin-top:12px}.accordion-section .dropdown{float:right;display:block;position:relative;cursor:pointer}.accordion-section .dropdown-content{overflow:hidden;float:right;min-width:30px;height:16px;line-height:16px;margin-left:16px;padding:4px 5px;border:2px solid #eee;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.customize-control .dropdown-arrow{position:absolute;top:0;bottom:0;left:0;width:20px;background:#eee}.customize-control .dropdown-arrow:after{content:"\f140";font:normal 20px/1 dashicons;speak:none;display:block;padding:0;text-indent:0;text-align:center;position:relative;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-decoration:none!important;color:#32373c}.customize-control .dropdown-status{color:#32373c;background:#eee;display:none;max-width:112px}.customize-control-color .dropdown{margin-left:5px;margin-bottom:5px}.customize-control-color .dropdown .dropdown-content{background-color:#555d66;border:1px solid rgba(0,0,0,.15)}.customize-control-color .dropdown:hover .dropdown-content{border-color:rgba(0,0,0,.25)}.ios .wp-full-overlay{position:relative}.ios #customize-controls .wp-full-overlay-sidebar-content{-webkit-overflow-scrolling:touch}.customize-control .actions .button{margin-top:12px}.customize-control-header .actions,.customize-control-header .uploaded{margin-bottom:18px}.customize-control-header .default button:not(.random),.customize-control-header .uploaded button:not(.random){width:100%;padding:0;margin:0;background:0 0;border:none;color:inherit;cursor:pointer}.customize-control-header button img{display:block}.customize-control .attachment-media-view .default-button,.customize-control .attachment-media-view .remove-button,.customize-control .attachment-media-view .upload-button,.customize-control-header button.new,.customize-control-header button.remove{width:auto;height:auto;white-space:normal}.customize-control .attachment-media-view .thumbnail,.customize-control-header .current .container{overflow:hidden}.customize-control .attachment-media-view .button-add-media,.customize-control .attachment-media-view .placeholder,.customize-control-header .placeholder{width:100%;position:relative;text-align:center;cursor:default;border:1px dashed #b4b9be;box-sizing:border-box;padding:9px 0;line-height:1.6}.customize-control .attachment-media-view .button-add-media{cursor:pointer;background-color:#edeff0;color:#32373c}.customize-control .attachment-media-view .button-add-media:hover{background-color:#fbfbfc}.customize-control .attachment-media-view .button-add-media:focus{background-color:#fbfbfc;border-style:solid;border-color:#5b9dd9;box-shadow:0 0 3px rgba(0,115,170,.8);outline:2px solid transparent;outline-offset:-2px}.customize-control-header .inner{display:none;position:absolute;width:100%;color:#555d66;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.customize-control-header .inner,.customize-control-header .inner .dashicons{line-height:20px;top:8px}.customize-control-header .list .inner,.customize-control-header .list .inner .dashicons{top:9px}.customize-control-header .header-view{position:relative;width:100%;margin-bottom:12px}.customize-control-header .header-view:last-child{margin-bottom:0}.customize-control-header .header-view:after{border:0}.customize-control-header .header-view.selected .choice:focus{outline:0}.customize-control-header .header-view.selected:after{content:"";position:absolute;height:auto;top:0;right:0;bottom:0;left:0;border:4px solid #00a0d2;border-radius:2px}.customize-control-header .header-view.button.selected{border:0}.customize-control-header .uploaded .header-view .close{font-size:20px;color:#fff;background:#555d66;background:rgba(0,0,0,.5);position:absolute;top:10px;right:-999px;z-index:1;width:26px;height:26px;cursor:pointer}.customize-control-header .header-view .close:focus,.customize-control-header .header-view:hover .close{right:auto;left:10px}.customize-control-header .header-view .close:focus{outline:1px solid #5b9dd9}.customize-control-header .random.placeholder{cursor:pointer;border-radius:2px;height:40px}.customize-control-header button.random{width:100%;height:auto;min-height:40px;white-space:normal}.customize-control-header button.random .dice{margin-top:4px}.customize-control-header .header-view:hover>button.random .dice,.customize-control-header .placeholder:hover .dice{animation:dice-color-change 3s infinite}.button-see-me{animation:bounce .7s 1;transform-origin:center bottom}@keyframes bounce{20%,53%,80%,from,to{animation-timing-function:cubic-bezier(.215,.61,.355,1);transform:translate3d(0,0,0)}40%,43%{animation-timing-function:cubic-bezier(.755,.050,.855,.060);transform:translate3d(0,-12px,0)}70%{animation-timing-function:cubic-bezier(.755,.050,.855,.060);transform:translate3d(0,-6px,0)}90%{transform:translate3d(0,-1px,0)}}.customize-control-header .choice{position:relative;display:block;margin-bottom:9px}.customize-control-header .choice:focus{outline:0;box-shadow:0 0 0 1px #5b9dd9,0 0 3px 1px rgba(30,140,190,.8)}.customize-control-header .uploaded div:last-child>.choice{margin-bottom:0}.customize-control .attachment-media-view .thumbnail-image img,.customize-control-header img{max-width:100%}.customize-control .attachment-media-view .default-button,.customize-control .attachment-media-view .remove-button,.customize-control-header .remove{margin-left:8px}.customize-control-background_position .background-position-control .button-group{display:block}.customize-control-code_editor textarea{width:100%;font-family:Consolas,Monaco,monospace;font-size:12px;padding:6px 8px;-moz-tab-size:2;-o-tab-size:2;tab-size:2}.customize-control-code_editor .CodeMirror,.customize-control-code_editor textarea{height:14em}#customize-controls .customize-section-description-container.section-meta.customize-info{border-bottom:none}#sub-accordion-section-custom_css .customize-control-notifications-container{margin-bottom:15px}#customize-control-custom_css textarea{display:block;height:500px}.customize-section-description-container+#customize-control-custom_css .customize-control-title{margin-right:12px}.customize-section-description-container+#customize-control-custom_css:last-child textarea{border-left:0;border-right:0;height:calc(100vh - 185px);resize:none}.customize-section-description-container+#customize-control-custom_css:last-child{margin-right:-12px;width:299px;width:calc(100% + 24px);margin-bottom:-12px}.customize-section-description-container+#customize-control-custom_css:last-child .CodeMirror{height:calc(100vh - 185px)}.CodeMirror-hints,.CodeMirror-lint-tooltip{z-index:500000!important}.customize-section-description-container+#customize-control-custom_css:last-child .customize-control-notifications-container{margin-right:12px;margin-left:12px}.theme-browser .theme.active .theme-actions,.wp-customizer .theme-browser .theme .theme-actions{padding:10px 15px;box-shadow:inset 0 1px 0 rgba(0,0,0,.1)}@media screen and (max-width:640px){.customize-section-description-container+#customize-control-custom_css:last-child{margin-left:0}.customize-section-description-container+#customize-control-custom_css:last-child textarea{height:calc(100vh - 140px)}}#customize-theme-controls .control-panel-themes{border-bottom:none}#customize-theme-controls .control-panel-themes>.accordion-section-title,#customize-theme-controls .control-panel-themes>.accordion-section-title:hover{cursor:default;background:#fff;color:#555d66;border-top:1px solid #ddd;border-bottom:1px solid #ddd;border-right:none;border-left:none;margin:0 0 15px 0;padding-left:100px}#customize-theme-controls .control-section-themes .customize-themes-panel .accordion-section-title:first-child,#customize-theme-controls .control-section-themes .customize-themes-panel .accordion-section-title:first-child:hover{border-top:0}#customize-theme-controls .control-section-themes>.accordion-section-title,#customize-theme-controls .control-section-themes>.accordion-section-title:hover{margin:0 0 15px}#customize-controls .customize-themes-panel .accordion-section-title,#customize-controls .customize-themes-panel .accordion-section-title:hover{margin:15px -8px}#customize-controls .control-section-themes .accordion-section-title,#customize-controls .customize-themes-panel .accordion-section-title{padding-left:100px}#customize-controls .control-section-themes .accordion-section-title span.customize-action,#customize-controls .customize-section-title span.customize-action,.control-panel-themes .accordion-section-title span.customize-action{font-size:13px;display:block;font-weight:400}#customize-theme-controls .control-panel-themes .accordion-section-title .change-theme{position:absolute;left:10px;top:50%;margin-top:-14px;font-weight:400}#customize-theme-controls .control-panel-themes>.accordion-section-title:after{display:none}.control-panel-themes .customize-themes-full-container{position:fixed;top:0;right:0;transition:.18s right ease-in-out;margin:0 300px 0 0;padding:71px 0 25px;overflow-y:scroll;width:calc(100% - 300px);height:calc(100% - 96px);background:#eee;z-index:20}@media screen and (min-width:1670px){.control-panel-themes .customize-themes-full-container{width:82%;left:0;right:initial}}.modal-open .control-panel-themes .customize-themes-full-container{overflow-y:visible}#customize-header-actions .customize-controls-preview-toggle,#customize-header-actions .spinner,#customize-save-button-wrapper{transition:.18s margin ease-in-out}#customize-footer-actions,#customize-footer-actions .collapse-sidebar{bottom:0;transition:.18s bottom ease-in-out}.in-themes-panel:not(.animating) #customize-footer-actions,.in-themes-panel:not(.animating) #customize-header-actions .customize-controls-preview-toggle,.in-themes-panel:not(.animating) #customize-header-actions .spinner,.in-themes-panel:not(.animating) #customize-preview{visibility:hidden}.wp-full-overlay.in-themes-panel{background:#eee}.in-themes-panel #customize-header-actions .customize-controls-preview-toggle,.in-themes-panel #customize-header-actions .spinner,.in-themes-panel #customize-save-button-wrapper{margin-top:-46px}.in-themes-panel #customize-footer-actions,.in-themes-panel #customize-footer-actions .collapse-sidebar{bottom:-45px}.in-themes-panel.animating .control-panel-themes .filter-themes-count{display:none}.in-themes-panel.wp-full-overlay .wp-full-overlay-sidebar-content{bottom:0}.themes-filter-bar .feature-filter-toggle{float:left;margin:3px 25px 3px 0}.themes-filter-bar .feature-filter-toggle:before{content:"\f111";margin:0 0 0 5px;font:normal 16px/1 dashicons;vertical-align:text-bottom;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.themes-filter-bar .feature-filter-toggle.open{background:#eee;border-color:#999;box-shadow:inset 0 2px 5px -3px rgba(0,0,0,.5);transform:translateY(1px)}.themes-filter-bar .feature-filter-toggle .filter-count-filters{display:none}.filter-drawer{box-sizing:border-box;width:100%;position:absolute;top:46px;right:0;padding:25px 25px 25px 0;border-top:0;margin:0;background:#eee;border-bottom:1px solid #ddd}.filter-drawer .filter-group{margin:0 0 0 25px;width:calc((100% - 75px)/ 3);min-width:200px;max-width:320px}@keyframes themes-fade-in{0%{opacity:0}50%{opacity:0}100%{opacity:1}}.control-panel-themes .customize-themes-full-container.animate{animation:.6s themes-fade-in 1}.in-themes-panel:not(.animating) .control-panel-themes .filter-themes-count{animation:.6s themes-fade-in 1}.control-panel-themes .filter-themes-count{position:relative;float:left;line-height:2.6}.control-panel-themes .filter-themes-count .themes-displayed{font-weight:600;color:#555d66}.customize-themes-notifications{margin:0}.control-panel-themes .customize-themes-notifications .notice{margin:0 0 25px 0}.customize-themes-full-container .customize-themes-section{display:none!important;overflow:hidden}.customize-themes-full-container .customize-themes-section.current-section{display:list-item!important}.control-section .customize-section-text-before{padding:0 15px 8px 0;margin:15px 0 0 0;line-height:16px;border-bottom:1px solid #ddd;color:#555d66}.control-panel-themes .customize-themes-section-title{width:100%;background:#fff;box-shadow:none;outline:0;border-top:none;border-bottom:1px solid #ddd;border-right:4px solid #fff;border-left:none;cursor:pointer;padding:10px 15px;position:relative;text-align:right;font-size:14px;font-weight:600;color:#555d66;text-shadow:none}.control-panel-themes #accordion-section-installed_themes{border-top:1px solid #ddd}.control-panel-themes .theme-section{margin:0;position:relative}.control-panel-themes .customize-themes-section-title:focus,.control-panel-themes .customize-themes-section-title:hover{border-right-color:#0073aa;color:#0073aa;background:#f5f5f5}.customize-themes-section-title:not(.selected):after{content:"";display:block;position:absolute;top:9px;left:15px;width:18px;height:18px;border-radius:100%;border:1px solid #ccc;background:#fff}.control-panel-themes .theme-section .customize-themes-section-title.selected:after{content:"\f147";font:16px/1 dashicons;box-sizing:border-box;width:20px;height:20px;padding:3px 1px 1px 3px;border-radius:100%;position:absolute;top:9px;left:15px;background:#0073aa;color:#fff}.control-panel-themes .customize-themes-section-title.selected{color:#0073aa}#customize-theme-controls .themes.accordion-section-content{position:relative;right:0;padding:0;width:100%}.loading .customize-themes-section .spinner{display:block;visibility:visible;position:relative;clear:both;width:20px;height:20px;right:calc(50% - 10px);float:none;margin-top:50px}.customize-themes-section .no-themes,.customize-themes-section .no-themes-local{display:none}.themes-section-installed_themes .theme .notice-success:not(.updated-message){display:none}.customize-control-theme .theme{width:100%;margin:0;border:1px solid #ddd;background:#fff}.customize-control-theme .theme .theme-actions,.customize-control-theme .theme .theme-name{background:#fff;border:none}.customize-control.customize-control-theme{box-sizing:border-box;width:25%;max-width:600px;margin:0 0 25px 25px;padding:0;clear:none}@media screen and (min-width:2101px){.customize-control.customize-control-theme{width:calc((100% - 125px)/ 5 - 1px)}}@media screen and (min-width:1601px) and (max-width:2100px){.customize-control.customize-control-theme{width:calc((100% - 100px)/ 4 - 1px)}}@media screen and (min-width:1201px) and (max-width:1600px){.customize-control.customize-control-theme{width:calc((100% - 75px)/ 3 - 1px)}}@media screen and (min-width:851px) and (max-width:1200px){.customize-control.customize-control-theme{width:calc((100% - 50px)/ 2 - 1px)}}@media screen and (max-width:850px){.customize-control.customize-control-theme{width:100%}}.wp-customizer .theme-browser .themes{padding:0 25px 25px 0;transition:.18s margin-top linear}.wp-customizer .theme-browser .theme .theme-actions{opacity:1}#customize-controls h3.theme-name{font-size:15px}#customize-controls .theme-overlay .theme-name{font-size:32px}.customize-preview-header.themes-filter-bar{position:fixed;top:0;right:300px;width:calc(100% - 300px);height:46px;background:#eee;z-index:10;padding:6px 25px;box-sizing:border-box;border-bottom:1px solid #ddd}@media screen and (min-width:1670px){.customize-preview-header.themes-filter-bar{width:82%;left:0;right:initial}}.themes-filter-bar .themes-filter-container{margin:0;padding:0}.themes-filter-bar .wp-filter-search{line-height:1.8;padding:6px 30px 6px 10px;max-width:100%;width:40%;min-width:300px;position:absolute;top:6px;right:25px;height:32px;margin:1px 0}@media screen and (max-height:540px),screen and (max-width:1018px){.customize-preview-header.themes-filter-bar{position:relative;right:0;width:100%;margin:0 0 25px 0}.filter-drawer{top:46px}.wp-customizer .theme-browser .themes{padding:0 25px 25px 0;overflow:hidden}.control-panel-themes .customize-themes-full-container{margin-top:0;padding:0;height:100%;width:calc(100% - 300px)}}@media screen and (max-width:1018px){.filter-drawer .filter-group{width:calc((100% - 50px)/ 2)}}@media screen and (max-width:900px){.customize-preview-header.themes-filter-bar{height:86px;padding-top:46px}.themes-filter-bar .wp-filter-search{width:calc(100% - 50px);margin:0;min-width:200px}.filter-drawer{top:86px}.control-panel-themes .filter-themes-count{float:right}}@media screen and (max-width:792px){.filter-drawer .filter-group{width:calc(100% - 25px)}}.control-panel-themes .customize-themes-mobile-back{display:none}@media screen and (max-width:600px){.filter-drawer{top:132px}.wp-full-overlay.showing-themes .control-panel-themes .filter-themes-count .filter-themes{display:block;float:left}.control-panel-themes .customize-themes-full-container{width:100%;margin:0;padding-top:46px;height:calc(100% - 46px);z-index:1;display:none}.showing-themes .control-panel-themes .customize-themes-full-container{display:block}.wp-customizer .showing-themes .control-panel-themes .customize-themes-mobile-back{display:block;position:fixed;top:0;right:0;background:#eee;color:#444;border-radius:0;box-shadow:none;border:none;height:46px;width:100%;z-index:10;text-align:right;text-shadow:none;border-bottom:1px solid #ddd;border-right:4px solid transparent;margin:0;padding:0;font-size:0;overflow:hidden}.wp-customizer .showing-themes .control-panel-themes .customize-themes-mobile-back:before{right:0;top:0;height:46px;width:26px;display:block;line-height:2.3;padding:0 8px 0 8px;border-left:1px solid #ddd}.wp-customizer .showing-themes .control-panel-themes .customize-themes-mobile-back:focus,.wp-customizer .showing-themes .control-panel-themes .customize-themes-mobile-back:hover{color:#0073aa;background:#f3f3f5;border-right-color:#0073aa;outline:0;box-shadow:none}.showing-themes #customize-header-actions{display:none}#customize-controls{width:100%}}.wp-customizer .theme-overlay{display:none}.wp-customizer.modal-open .theme-overlay{position:fixed;right:0;top:0;left:0;bottom:0;z-index:109}.wp-customizer.modal-open #customize-header-actions,.wp-customizer.modal-open .control-panel-themes .customize-themes-section-title.selected:after,.wp-customizer.modal-open .control-panel-themes .filter-themes-count{z-index:-1}.wp-full-overlay.in-themes-panel.themes-panel-expanded #customize-controls .wp-full-overlay-sidebar-content{overflow:visible}.wp-customizer .theme-overlay .theme-backdrop{background:rgba(238,238,238,.75);position:fixed;z-index:110}.wp-customizer .theme-overlay .star-rating{float:right;margin-left:8px}.wp-customizer .theme-rating .num-ratings{line-height:20px}.wp-customizer .theme-overlay .theme-wrap{right:90px;left:90px;top:45px;bottom:45px;z-index:120}.wp-customizer .theme-overlay .theme-actions{text-align:left;padding:10px 25px;background:#eee;border-top:1px solid #ddd}.wp-customizer .theme-overlay .theme-actions .theme-install.preview{margin-right:8px}.control-panel-themes .theme-actions .delete-theme{right:15px;left:auto;bottom:auto;position:absolute}.modal-open .in-themes-panel #customize-controls .wp-full-overlay-sidebar-content{overflow:visible}.wp-customizer .theme-header{background:#eee}.wp-customizer .theme-overlay .theme-header .close:before,.wp-customizer .theme-overlay .theme-header button{color:#444}.wp-customizer .theme-overlay .theme-header .close:focus,.wp-customizer .theme-overlay .theme-header .close:hover,.wp-customizer .theme-overlay .theme-header .left:focus,.wp-customizer .theme-overlay .theme-header .left:hover,.wp-customizer .theme-overlay .theme-header .right:focus,.wp-customizer .theme-overlay .theme-header .right:hover{background:#fff;border-bottom:4px solid #0073aa;color:#0073aa}.wp-customizer .theme-overlay .theme-header .close:focus:before,.wp-customizer .theme-overlay .theme-header .close:hover:before{color:#0073aa}.wp-customizer .theme-overlay .theme-header button.disabled,.wp-customizer .theme-overlay .theme-header button.disabled:focus,.wp-customizer .theme-overlay .theme-header button.disabled:hover{border-bottom:none;background:0 0;color:#ccc}@media (max-width:850px),(max-height:472px){.wp-customizer .theme-overlay .theme-wrap{right:0;left:0;top:0;bottom:0}.wp-customizer .theme-browser .themes{padding-left:25px}}body.cheatin{font-size:medium;height:auto;background:#fff;margin:50px auto 2em;padding:1em 2em;max-width:700px;min-width:0;box-shadow:0 1px 3px rgba(0,0,0,.13)}body.cheatin h1{border-bottom:1px solid #ddd;clear:both;color:#555d66;font-size:24px;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif;margin:30px 0 0 0;padding:0;padding-bottom:7px}body.cheatin p{font-size:14px;line-height:1.5;margin:25px 0 20px}#customize-theme-controls .add-new-menu-item,#customize-theme-controls .add-new-widget{cursor:pointer;float:left;margin:0;margin-right:10px;transition:all .2s;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;outline:0}.reordering .add-new-menu-item,.reordering .add-new-widget{opacity:.2;pointer-events:none;cursor:not-allowed}#available-menu-items .new-content-item .add-content:before,.add-new-menu-item:before,.add-new-widget:before{content:"\f132";display:inline-block;position:relative;right:-2px;top:0;font:normal 20px/1 dashicons;vertical-align:middle;transition:all .2s;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.reorder-toggle{float:left;padding:5px 8px;text-decoration:none;cursor:pointer;outline:0}.reorder,.reordering .reorder-done{display:block;padding:5px 8px}.reorder-done,.reordering .reorder{display:none}.menu-item-reorder-nav button,.widget-reorder-nav span{position:relative;overflow:hidden;float:right;display:block;width:33px;height:43px;color:#82878c;text-indent:-9999px;cursor:pointer;outline:0}.menu-item-reorder-nav button{width:30px;height:40px;background:0 0;border:none;box-shadow:none}.menu-item-reorder-nav button:before,.widget-reorder-nav span:before{display:inline-block;position:absolute;top:0;left:0;width:100%;height:100%;font:normal 20px/43px dashicons;text-align:center;text-indent:0;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.menu-item-reorder-nav button:focus,.menu-item-reorder-nav button:hover,.widget-reorder-nav span:focus,.widget-reorder-nav span:hover{color:#191e23;background:#eee}.menus-move-down:before,.move-widget-down:before{content:"\f347"}.menus-move-up:before,.move-widget-up:before{content:"\f343"}#customize-theme-controls .first-widget .move-widget-up,#customize-theme-controls .last-widget .move-widget-down,.move-down-disabled .menus-move-down,.move-left-disabled .menus-move-left,.move-right-disabled .menus-move-right,.move-up-disabled .menus-move-up{color:#d5d5d5;background-color:#fff;cursor:default;pointer-events:none}.wp-full-overlay-main{left:auto;width:100%}.add-menu-toggle.open,.add-menu-toggle.open:hover,.adding-menu-items .add-new-menu-item,.adding-menu-items .add-new-menu-item:hover,body.adding-widget .add-new-widget,body.adding-widget .add-new-widget:hover{background:#eee;border-color:#929793;color:#32373c;box-shadow:inset 0 2px 5px -3px rgba(0,0,0,.5)}#accordion-section-add_menu .add-new-menu-item.open:before,.adding-menu-items .add-new-menu-item:before,body.adding-widget .add-new-widget:before{transform:rotate(-45deg)}#available-menu-items,#available-widgets{position:absolute;top:0;bottom:0;right:-301px;visibility:hidden;overflow-x:hidden;overflow-y:auto;width:300px;margin:0;z-index:4;background:#eee;transition:right .18s;border-left:1px solid #ddd}#available-menu-items .customize-section-title,#available-widgets .customize-section-title{display:none}#available-widgets-list{top:60px;position:absolute;overflow:auto;bottom:0;width:100%;border-top:1px solid #ddd}.no-widgets-found #available-widgets-list{border-top:none}#available-widgets-filter{position:fixed;top:0;z-index:1;width:300px;background:#eee}#available-menu-items-search .accordion-section-title,#available-widgets-filter{padding:13px 15px;box-sizing:border-box}#available-menu-items-search input,#available-widgets-filter input{width:100%;height:32px;margin:1px 0;padding:6px 30px}#available-menu-items-search input::-ms-clear,#available-widgets-filter input::-ms-clear{display:none}#available-menu-items-search .search-icon,#available-widgets-filter .search-icon{display:block;position:absolute;top:15px;right:16px;width:30px;height:30px;line-height:2.1;text-align:center;color:#72777c}#available-menu-items-search .clear-results,#available-widgets-filter .clear-results{position:absolute;top:15px;left:16px;width:30px;height:30px;padding:0;border:0;cursor:pointer;background:0 0;color:#a00;text-decoration:none;outline:0}#available-menu-items-search .clear-results,#available-menu-items-search.loading .clear-results.is-visible,#available-widgets-filter .clear-results{display:none}#available-menu-items-search .clear-results.is-visible,#available-widgets-filter .clear-results.is-visible{display:block}#available-menu-items-search .clear-results:before,#available-widgets-filter .clear-results:before{content:"\f335";font:normal 20px/1 dashicons;vertical-align:middle;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}#available-menu-items-search .clear-results:focus,#available-menu-items-search .clear-results:hover,#available-widgets-filter .clear-results:focus,#available-widgets-filter .clear-results:hover{color:#dc3232}#available-menu-items-search .clear-results:focus,#available-widgets-filter .clear-results:focus{box-shadow:0 0 0 1px #5b9dd9,0 0 2px 1px rgba(30,140,190,.8)}#available-menu-items-search .search-icon:after,#available-widgets-filter .search-icon:after,.themes-filter-bar .search-icon:after{content:"\f179";font:normal 20px/1 dashicons;vertical-align:middle;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.themes-filter-bar .search-icon{position:absolute;top:7px;right:26px;z-index:1;color:#72777c;height:30px;width:30px;line-height:2;text-align:center}.no-widgets-found-message{display:none;margin:0;padding:0 15px;line-height:inherit}.no-widgets-found .no-widgets-found-message{display:block}#available-menu-items .item-top,#available-menu-items .item-top:hover,#available-widgets .widget-top,#available-widgets .widget-top:hover{border:none;background:0 0;box-shadow:none}#available-menu-items .item-tpl,#available-widgets .widget-tpl{position:relative;padding:15px 60px 15px 15px;background:#fff;border-bottom:1px solid #ddd;border-right:4px solid #fff;transition:.15s color ease-in-out,.15s background-color ease-in-out,.15s border-color ease-in-out;cursor:pointer;display:none}#available-menu-items .item,#available-widgets .widget{position:static}.customize-controls-preview-toggle{display:none}@media only screen and (max-width:782px){.wp-customizer .theme:not(.active):focus .theme-actions,.wp-customizer .theme:not(.active):hover .theme-actions{display:block}.wp-customizer .theme-browser .theme.active .theme-name span{display:inline}.customize-control-header button.random .dice{margin-top:0}.customize-control-checkbox .customize-inside-control-row,.customize-control-nav_menu_auto_add .customize-inside-control-row,.customize-control-radio .customize-inside-control-row{margin-right:32px}.customize-control-checkbox input,.customize-control-nav_menu_auto_add input,.customize-control-radio input{margin-right:-32px}.customize-control input[type=checkbox]+label+br,.customize-control input[type=radio]+label+br{line-height:2.5}.customize-control .date-time-fields select{height:39px}.date-time-fields .date-input.month{width:79px}.date-time-fields .date-input.day,.date-time-fields .date-input.hour,.date-time-fields .date-input.minute{width:55px}.date-time-fields .date-input.year{width:80px}.date-time-fields .date-timezone{line-height:3.2}#customize-control-changeset_preview_link a{bottom:16px}.preview-link-wrapper .customize-copy-preview-link.preview-control-element.button{bottom:10px}.media-widget-control .media-widget-buttons .button.change-media,.media-widget-control .media-widget-buttons .button.edit-media,.media-widget-control .media-widget-buttons .button.select-media{margin-top:12px}.wp-core-ui .themes-filter-bar .feature-filter-toggle{margin:3px 25px 3px 0}}@media screen and (max-width:1200px){.adding-menu-items .wp-full-overlay.expanded.preview-mobile .wp-full-overlay-main,.adding-widget .wp-full-overlay.expanded.preview-mobile .wp-full-overlay-main,.outer-section-open .wp-full-overlay.expanded.preview-mobile .wp-full-overlay-main{right:67%}}@media screen and (max-width:640px){.wp-full-overlay.collapsed #customize-controls{margin-right:0}.wp-full-overlay-sidebar .wp-full-overlay-sidebar-content{bottom:0}.customize-controls-preview-toggle{display:block;position:absolute;top:0;right:48px;line-height:3.2;font-size:14px;padding:0 12px;margin:0;height:45px;background:#eee;border:0;border-left:1px solid #ddd;color:#555d66;cursor:pointer;transition:color .1s ease-in-out,background .1s ease-in-out}#customize-footer-actions,.customize-controls-preview-toggle .controls,.preview-only .customize-controls-preview-toggle .preview,.preview-only .wp-full-overlay-sidebar-content{display:none}.preview-only #customize-save-button-wrapper{margin-top:-46px}.customize-controls-preview-toggle .controls:before,.customize-controls-preview-toggle .preview:before{font:normal 20px/1 dashicons;content:"\f177";position:relative;top:4px;margin-left:6px}.customize-controls-preview-toggle .controls:before{content:"\f540"}.preview-only #customize-controls{height:45px}.preview-only #customize-preview,.preview-only .customize-controls-preview-toggle .controls{display:block}.wp-core-ui.wp-customizer .button{padding:6px 14px;line-height:normal;font-size:14px;vertical-align:middle;height:auto}#publish-settings{height:31px}#customize-control-changeset_status .customize-inside-control-row{padding-top:15px}body.adding-menu-items div#available-menu-items,body.adding-widget div#available-widgets,body.outer-section-open div#customize-sidebar-outer-content{width:100%}#available-menu-items .customize-section-title,#available-widgets .customize-section-title{display:block;margin:0}#available-menu-items .customize-section-back,#available-widgets .customize-section-back{height:69px}#available-menu-items .customize-section-title h3,#available-widgets .customize-section-title h3{font-size:20px;font-weight:200;padding:9px 14px 12px 10px;margin:0;line-height:24px;color:#555d66;display:block;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}#available-menu-items .customize-section-title .customize-action,#available-widgets .customize-section-title .customize-action{font-size:13px;display:block;font-weight:400;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}#available-widgets-filter{position:relative;width:100%;height:auto}#available-widgets-list{top:130px}#available-menu-items-search .clear-results,#available-menu-items-search .search-icon{top:85px}.reorder,.reordering .reorder-done{padding:8px}.wp-core-ui .themes-filter-bar .feature-filter-toggle{margin:0}.theme-browser .theme.active .theme-actions,.wp-customizer .theme-browser .theme .theme-actions{padding:9px 15px;box-shadow:inset 0 1px 0 rgba(0,0,0,.1)}}@media screen and (max-width:600px){.theme-browser .theme.active .theme-actions,.wp-customizer .theme-browser .theme .theme-actions{padding:8px 15px;box-shadow:none}.wp-full-overlay.expanded{margin-right:0}body.adding-menu-items div#available-menu-items,body.adding-widget div#available-widgets,body.outer-section-open div#customize-sidebar-outer-content{top:46px;z-index:10}body.wp-customizer .wp-full-overlay.expanded #customize-sidebar-outer-content{right:-100%}body.wp-customizer.outer-section-open .wp-full-overlay.expanded #customize-sidebar-outer-content{right:0}} \ No newline at end of file
diff --git a/www/crm/wp-admin/css/customize-controls.css b/www/crm/wp-admin/css/customize-controls.css
new file mode 100644
index 00000000..2c780fbf
--- /dev/null
+++ b/www/crm/wp-admin/css/customize-controls.css
@@ -0,0 +1,2995 @@
+body {
+ overflow: hidden;
+ -webkit-text-size-adjust: 100%;
+}
+
+.customize-controls-close,
+.widget-control-actions a {
+ text-decoration: none;
+}
+
+#customize-controls h3 {
+ font-size: 14px;
+}
+
+#customize-controls img {
+ max-width: 100%;
+}
+
+#customize-controls .submit {
+ text-align: center;
+}
+
+#customize-controls #customize-notifications-area .notice.notification-overlay.notification-changeset-locked {
+ background-color: rgba(0, 0, 0, 0.7);
+ padding: 25px;
+}
+
+#customize-controls #customize-notifications-area .notice.notification-overlay.notification-changeset-locked .customize-changeset-locked-message {
+ margin-left: auto;
+ margin-right: auto;
+ max-width: 366px;
+ min-height: 64px;
+ width: auto;
+ padding: 25px 25px 25px 109px;
+ position: relative;
+ background: #fff;
+ box-shadow: 0 3px 6px rgba(0, 0, 0, 0.3);
+ line-height: 1.5;
+ overflow-y: auto;
+ text-align: left;
+ top: calc( 50% - 100px );
+}
+
+#customize-controls #customize-notifications-area .notice.notification-overlay.notification-changeset-locked .currently-editing {
+ margin-top: 0;
+}
+#customize-controls #customize-notifications-area .notice.notification-overlay.notification-changeset-locked .action-buttons {
+ margin-bottom: 0;
+}
+
+.customize-changeset-locked-avatar {
+ width: 64px;
+ position: absolute;
+ left: 25px;
+ top: 25px;
+}
+
+.wp-core-ui.wp-customizer .customize-changeset-locked-message a.button {
+ margin-right: 10px;
+ margin-top: 0;
+}
+
+#customize-controls .description {
+ color: #555d66;
+}
+
+#customize-save-button-wrapper {
+ float: right;
+ margin-top: 9px;
+}
+
+body:not(.ready) #customize-save-button-wrapper .save {
+ visibility: hidden;
+}
+#customize-save-button-wrapper .save {
+ float: left;
+ border-radius: 3px;
+ box-shadow: none; /* @todo Adjust box shadow based on the disable states of paired button. */
+ margin-top: 0;
+}
+
+#customize-save-button-wrapper .save:focus, #publish-settings:focus {
+ box-shadow: 0 1px 0 #0073aa, 0 0 2px 1px #33b3db; /* This is default box shadow for focus */
+}
+
+#customize-save-button-wrapper .save.has-next-sibling {
+ border-radius: 3px 0 0 3px;
+}
+
+#customize-sidebar-outer-content {
+ position: absolute;
+ top: 0;
+ bottom: 0;
+ left: 0;
+ visibility: hidden;
+ overflow-x: hidden;
+ overflow-y: auto;
+ width: 100%;
+ margin: 0;
+ z-index: -1;
+ background: #eee;
+ transition: left .18s;
+ border-right: 1px solid #ddd;
+ border-left: 1px solid #ddd;
+ height: 100%;
+}
+
+#customize-theme-controls .control-section-outer {
+ display: none !important;
+}
+
+#customize-outer-theme-controls .accordion-section-content {
+ padding: 12px;
+}
+
+#customize-outer-theme-controls .accordion-section-content.open {
+ display: block;
+}
+
+.outer-section-open .wp-full-overlay.expanded #customize-sidebar-outer-content {
+ visibility: visible;
+ left: 100%;
+ transition: left .18s;
+}
+
+.customize-outer-pane-parent {
+ margin: 0;
+}
+
+.outer-section-open .wp-full-overlay.expanded .wp-full-overlay-main {
+ left: 300px;
+ opacity: 0.4;
+}
+
+.outer-section-open .wp-full-overlay.expanded.preview-tablet .wp-full-overlay-main,
+.outer-section-open .wp-full-overlay.expanded.preview-mobile .wp-full-overlay-main,
+.adding-menu-items .wp-full-overlay.expanded.preview-tablet .wp-full-overlay-main,
+.adding-menu-items .wp-full-overlay.expanded.preview-mobile .wp-full-overlay-main,
+.adding-widget .wp-full-overlay.expanded.preview-tablet .wp-full-overlay-main,
+.adding-widget .wp-full-overlay.expanded.preview-mobile .wp-full-overlay-main {
+ left: 64%;
+}
+
+#customize-outer-theme-controls li.notice {
+ padding-top: 8px;
+ padding-bottom: 8px;
+ margin-left: 0;
+ margin-bottom: 10px;
+}
+
+#publish-settings {
+ text-indent: 0;
+ border-radius: 0 3px 3px 0;
+ padding-left: 0;
+ padding-right: 0;
+ box-shadow: none; /* @todo Adjust box shadow based on the disable states of paired button. */
+ font-size: 14px;
+ width: 30px;
+ float: left;
+ transform: none;
+ margin-top: 0;
+}
+
+body:not(.ready) #publish-settings,
+body.trashing #customize-save-button-wrapper .save,
+body.trashing #publish-settings {
+ display: none;
+}
+
+#customize-header-actions .spinner {
+ margin-top: 13px;
+ margin-right: 4px;
+}
+
+.saving #customize-header-actions .spinner,
+.trashing #customize-header-actions .spinner {
+ visibility: visible;
+}
+
+#customize-header-actions {
+ border-bottom: 1px solid #ddd;
+}
+
+#customize-controls .wp-full-overlay-sidebar-content {
+ overflow-y: auto;
+ overflow-x: hidden;
+}
+
+.outer-section-open #customize-controls .wp-full-overlay-sidebar-content {
+ background: #eee;
+}
+
+#customize-controls .customize-info {
+ border: none;
+ border-bottom: 1px solid #ddd;
+ margin-bottom: 15px;
+}
+
+#customize-control-changeset_status .customize-inside-control-row,
+#customize-control-changeset_preview_link input {
+ background-color: #ffffff;
+ border-bottom: 1px solid #ddd;
+ box-sizing: content-box;
+ width: 100%;
+ margin-left: -12px;
+ padding-left: 12px;
+ padding-right: 12px;
+}
+
+#customize-control-trash_changeset {
+ margin-top: 20px;
+}
+#customize-control-trash_changeset .button-link {
+ position: relative;
+ padding-left: 24px;
+ display: inline-block;
+}
+#customize-control-trash_changeset .button-link:before {
+ content: "\f182";
+ font: normal 22px dashicons;
+ text-decoration: none;
+ position: absolute;
+ left: 0;
+ top: -2px;
+}
+
+#customize-controls .date-input:invalid {
+ border-color: #dc3232;
+}
+
+#customize-control-changeset_status .customize-inside-control-row {
+ padding-top: 10px;
+ padding-bottom: 10px;
+ font-weight: 500;
+}
+
+#customize-control-changeset_status .customize-inside-control-row:first-of-type {
+ border-top: 1px solid #ddd;
+}
+
+#customize-control-changeset_status .customize-control-title {
+ margin-bottom: 6px;
+}
+
+#customize-control-changeset_status input {
+ margin-left: 0;
+}
+
+#customize-control-changeset_preview_link {
+ position: relative;
+ display: block;
+}
+
+.preview-link-wrapper .customize-copy-preview-link.preview-control-element.button {
+ margin: 0;
+ position: absolute;
+ bottom: 9px;
+ right: 0;
+}
+
+.preview-link-wrapper {
+ position: relative;
+}
+
+.customize-copy-preview-link:before,
+.customize-copy-preview-link:after {
+ content: "";
+ height: 28px;
+ position: absolute;
+ background: #ffffff;
+ top: -1px;
+}
+
+.customize-copy-preview-link:before {
+ left: -10px;
+ width: 9px;
+ opacity: 0.75;
+}
+
+.customize-copy-preview-link:after {
+ left: -5px;
+ width: 4px;
+ opacity: 0.8;
+}
+
+#customize-control-changeset_preview_link input {
+ line-height: 2.5;
+ border-top: 1px solid #ddd;
+ border-left: none;
+ border-right: none;
+ text-indent: -999px;
+ color: #fff;
+}
+
+#customize-control-changeset_preview_link label {
+ position: relative;
+ display: block;
+}
+
+#customize-control-changeset_preview_link a {
+ display: inline-block;
+ position: absolute;
+ white-space: nowrap;
+ overflow: hidden;
+ width: 90%;
+ bottom: 14px;
+ font-size: 14px;
+ text-decoration: none;
+}
+
+#customize-control-changeset_preview_link a.disabled,
+#customize-control-changeset_preview_link a.disabled:active,
+#customize-control-changeset_preview_link a.disabled:focus,
+#customize-control-changeset_preview_link a.disabled:visited {
+ color: black;
+ opacity: 0.4;
+ cursor: default;
+ outline: none;
+ box-shadow: none;
+}
+
+#sub-accordion-section-publish_settings .customize-section-description-container {
+ display: none;
+}
+
+#customize-controls .customize-info.section-meta {
+ margin-bottom: 15px;
+}
+
+.customize-control-date_time .customize-control-description + .date-time-fields.includes-time {
+ margin-top: 10px;
+}
+
+.customize-control.customize-control-date_time .date-time-fields .date-input.day {
+ margin-right: 0;
+}
+
+.date-time-fields .date-input.month {
+ width: auto;
+ margin: 0;
+}
+
+.date-time-fields .date-input.day,
+.date-time-fields .date-input.hour,
+.date-time-fields .date-input.minute {
+ width: 46px;
+}
+
+.date-time-fields .date-input.year {
+ width: 60px;
+}
+
+.date-time-fields .date-input.meridian {
+ width: auto;
+ margin: 0;
+}
+
+.date-time-fields .time-row {
+ margin-top: 12px;
+}
+
+.date-time-fields .date-timezone {
+ line-height: 2.2;
+ text-decoration: none;
+}
+
+#customize-control-changeset_preview_link {
+ margin-top: 6px;
+}
+
+#customize-control-changeset_status {
+ margin-bottom: 0;
+ padding-bottom: 0;
+}
+
+#customize-control-changeset_scheduled_date {
+ box-sizing: content-box;
+ width: 100%;
+ margin-left: -12px;
+ padding: 12px;
+ background: #ffffff;
+ border-bottom: 1px solid #ddd;
+ margin-bottom: 0;
+}
+
+#customize-control-changeset_scheduled_date .customize-control-description {
+ font-style: normal;
+}
+
+#customize-controls .customize-info.is-in-view,
+#customize-controls .customize-section-title.is-in-view {
+ position: absolute;
+ z-index: 9;
+ width: 100%;
+ box-shadow: 0 1px 0 rgba(0, 0, 0, 0.1);
+}
+
+#customize-controls .customize-section-title.is-in-view {
+ margin-top: 0;
+}
+
+#customize-controls .customize-info.is-in-view + .accordion-section {
+ margin-top: 15px;
+}
+
+#customize-controls .customize-info.is-sticky,
+#customize-controls .customize-section-title.is-sticky {
+ position: fixed;
+ top: 46px;
+}
+
+#customize-controls .customize-info .accordion-section-title {
+ background: #fff;
+ color: #555d66;
+ border-left: none;
+ border-right: none;
+ border-bottom: none;
+ cursor: default;
+}
+
+#customize-controls .customize-info.open .accordion-section-title:after,
+#customize-controls .customize-info .accordion-section-title:hover:after,
+#customize-controls .customize-info .accordion-section-title:focus:after {
+ color: #32373c;
+}
+
+#customize-controls .customize-info .accordion-section-title:after {
+ display: none;
+}
+
+#customize-controls .customize-info .preview-notice {
+ font-size: 13px;
+ line-height: 1.9;
+}
+
+#customize-controls .customize-pane-child .customize-section-title h3,
+#customize-controls .customize-pane-child h3.customize-section-title,
+#customize-outer-theme-controls .customize-pane-child .customize-section-title h3,
+#customize-outer-theme-controls .customize-pane-child h3.customize-section-title,
+#customize-controls .customize-info .panel-title {
+ font-size: 20px;
+ font-weight: 200;
+ line-height: 26px;
+ display: block;
+ overflow: hidden;
+ white-space: nowrap;
+ text-overflow: ellipsis;
+}
+
+#customize-controls .customize-section-title span.customize-action {
+ overflow: hidden;
+ white-space: nowrap;
+ text-overflow: ellipsis;
+}
+
+#customize-controls .customize-info .customize-help-toggle {
+ position: absolute;
+ top: 4px;
+ right: 1px;
+ padding: 20px 20px 10px 10px;
+ width: 20px;
+ height: 20px;
+ cursor: pointer;
+ box-shadow: none;
+ -webkit-appearance: none;
+ background: transparent;
+ color: #555d66;
+ border: none;
+}
+
+#customize-controls .customize-info .customize-help-toggle:before {
+ position: absolute;
+ top: 5px;
+ left: 6px;
+}
+
+#customize-controls .customize-info.open .customize-help-toggle,
+#customize-controls .customize-info .customize-help-toggle:focus,
+#customize-controls .customize-info .customize-help-toggle:hover {
+ color: #0073aa;
+}
+
+#customize-controls .customize-info .customize-panel-description,
+#customize-controls .customize-info .customize-section-description,
+#customize-outer-theme-controls .customize-info .customize-section-description,
+#customize-controls .no-widget-areas-rendered-notice {
+ color: #555d66;
+ display: none;
+ background: #fff;
+ padding: 12px 15px;
+ border-top: 1px solid #ddd;
+}
+
+#customize-controls .customize-info .customize-panel-description.open + .no-widget-areas-rendered-notice {
+ border-top: none;
+}
+.no-widget-areas-rendered-notice {
+ font-style: italic;
+}
+.no-widget-areas-rendered-notice p:first-child {
+ margin-top: 0;
+}
+.no-widget-areas-rendered-notice p:last-child {
+ margin-bottom: 0;
+}
+
+#customize-controls .customize-info .customize-section-description {
+ margin-bottom: 15px;
+}
+
+#customize-controls .customize-info .customize-panel-description p:first-child,
+#customize-controls .customize-info .customize-section-description p:first-child {
+ margin-top: 0;
+}
+
+#customize-controls .customize-info .customize-panel-description p:last-child,
+#customize-controls .customize-info .customize-section-description p:last-child {
+ margin-bottom: 0;
+}
+
+#customize-controls .current-panel .control-section > h3.accordion-section-title {
+ padding-right: 30px;
+}
+
+#customize-theme-controls .control-section,
+#customize-outer-theme-controls .control-section {
+ border: none;
+}
+
+#customize-theme-controls .accordion-section-title,
+#customize-outer-theme-controls .accordion-section-title {
+ color: #555d66;
+ background-color: #fff;
+ border-bottom: 1px solid #ddd;
+ border-left: 4px solid #fff;
+ transition:
+ .15s color ease-in-out,
+ .15s background-color ease-in-out,
+ .15s border-color ease-in-out;
+}
+
+#customize-controls #customize-theme-controls .customize-themes-panel .accordion-section-title {
+ color: #555;
+ background-color: #fff;
+ border-left: 4px solid #fff;
+}
+
+#customize-theme-controls .accordion-section-title:after,
+#customize-outer-theme-controls .accordion-section-title:after {
+ content: "\f345";
+ color: #a0a5aa;
+}
+
+#customize-theme-controls .accordion-section-content,
+#customize-outer-theme-controls .accordion-section-content {
+ color: #555d66;
+ background: transparent;
+}
+
+#customize-controls .control-section:hover > .accordion-section-title,
+#customize-controls .control-section .accordion-section-title:hover,
+#customize-controls .control-section.open .accordion-section-title,
+#customize-controls .control-section .accordion-section-title:focus {
+ color: #0073aa;
+ background: #f3f3f5;
+ border-left-color: #0073aa;
+}
+
+#accordion-section-themes + .control-section {
+ border-top: 1px solid #ddd;
+}
+
+.js .control-section:hover .accordion-section-title,
+.js .control-section .accordion-section-title:hover,
+.js .control-section.open .accordion-section-title,
+.js .control-section .accordion-section-title:focus {
+ background: #f3f3f5;
+}
+
+#customize-theme-controls .control-section:hover > .accordion-section-title:after,
+#customize-theme-controls .control-section .accordion-section-title:hover:after,
+#customize-theme-controls .control-section.open .accordion-section-title:after,
+#customize-theme-controls .control-section .accordion-section-title:focus:after,
+#customize-outer-theme-controls .control-section:hover > .accordion-section-title:after,
+#customize-outer-theme-controls .control-section .accordion-section-title:hover:after,
+#customize-outer-theme-controls .control-section.open .accordion-section-title:after,
+#customize-outer-theme-controls .control-section .accordion-section-title:focus:after {
+ color: #0073aa;
+}
+
+#customize-theme-controls .control-section.open {
+ border-bottom: 1px solid #eee;
+}
+
+#customize-theme-controls .control-section.open .accordion-section-title,
+#customize-outer-theme-controls .control-section.open .accordion-section-title {
+ border-bottom-color: #eee !important;
+}
+
+#customize-theme-controls .control-section:last-of-type.open,
+#customize-theme-controls .control-section:last-of-type > .accordion-section-title {
+ border-bottom-color: #ddd;
+}
+
+#customize-theme-controls .control-panel-content:not(.control-panel-nav_menus) .control-section:nth-child(2),
+#customize-theme-controls .control-panel-nav_menus .control-section-nav_menu,
+#customize-theme-controls .control-section-nav_menu_locations .accordion-section-title {
+ border-top: 1px solid #ddd;
+}
+
+#customize-theme-controls .control-panel-nav_menus .control-section-nav_menu + .control-section-nav_menu {
+ border-top: none;
+}
+
+#customize-theme-controls > ul {
+ margin: 0;
+}
+
+#customize-theme-controls .accordion-section-content {
+ position: absolute;
+ top: 0;
+ left: 100%;
+ width: 100%;
+ margin: 0;
+ padding: 12px;
+ box-sizing: border-box;
+}
+
+#customize-info,
+#customize-theme-controls .customize-pane-parent,
+#customize-theme-controls .customize-pane-child {
+ overflow: visible;
+ width: 100%;
+ margin: 0;
+ padding: 0;
+ box-sizing: border-box;
+ transition: 0.18s transform cubic-bezier(0.645, 0.045, 0.355, 1); /* easeInOutCubic */
+}
+
+#customize-theme-controls .customize-pane-child.skip-transition {
+ transition: none;
+}
+
+#customize-info,
+#customize-theme-controls .customize-pane-parent {
+ position: relative;
+ visibility: visible;
+ height: auto;
+ max-height: none;
+ overflow: auto;
+ transform: none;
+}
+
+#customize-theme-controls .customize-pane-child {
+ position: absolute;
+ top: 0;
+ left: 0;
+ visibility: hidden;
+ height: 0;
+ max-height: none;
+ overflow: hidden;
+ transform: translateX(100%);
+}
+
+#customize-theme-controls .customize-pane-child.open,
+#customize-theme-controls .customize-pane-child.current-panel {
+ transform: none;
+}
+
+.section-open #customize-theme-controls .customize-pane-parent,
+.in-sub-panel #customize-theme-controls .customize-pane-parent,
+.section-open #customize-info,
+.in-sub-panel #customize-info,
+.in-sub-panel.section-open #customize-theme-controls .customize-pane-child.current-panel {
+ visibility: hidden;
+ height: 0;
+ overflow: hidden;
+ transform: translateX(-100%);
+}
+
+.section-open #customize-theme-controls .customize-pane-parent.busy,
+.in-sub-panel #customize-theme-controls .customize-pane-parent.busy,
+.section-open #customize-info.busy,
+.in-sub-panel #customize-info.busy,
+.busy.section-open.in-sub-panel #customize-theme-controls .customize-pane-child.current-panel,
+#customize-theme-controls .customize-pane-child.open,
+#customize-theme-controls .customize-pane-child.current-panel,
+#customize-theme-controls .customize-pane-child.busy {
+ visibility: visible;
+ height: auto;
+ overflow: auto;
+}
+
+#customize-theme-controls .customize-pane-child.accordion-section-content,
+#customize-theme-controls .customize-pane-child.accordion-sub-container {
+ display: block;
+ overflow-x: hidden;
+}
+
+#customize-theme-controls .customize-pane-child.accordion-section-content {
+ padding: 12px;
+}
+
+#customize-theme-controls .customize-pane-child.menu li {
+ position: static;
+}
+
+.customize-section-description-container,
+.control-section-nav_menu .customize-section-description-container,
+.control-section-new_menu .customize-section-description-container {
+ margin-bottom: 15px;
+}
+
+.control-section-nav_menu .customize-control,
+.control-section-new_menu .customize-control {
+ /* Override default `margin-bottom` for `.customize-control` */
+ margin-bottom: 0;
+}
+
+.customize-section-title {
+ margin: -12px -12px 0 -12px;
+ border-bottom: 1px solid #ddd;
+ background: #fff;
+}
+
+div.customize-section-description {
+ margin-top: 22px;
+}
+
+.customize-info div.customize-section-description {
+ margin-top: 0;
+}
+
+div.customize-section-description p:first-child {
+ margin-top: 0;
+}
+
+div.customize-section-description p:last-child {
+ margin-bottom: 0;
+}
+
+#customize-theme-controls .customize-themes-panel h3.customize-section-title:first-child {
+ border-bottom: 1px solid #ddd;
+ padding: 12px 12px 12px 12px;
+}
+
+.ios #customize-theme-controls .customize-themes-panel h3.customize-section-title:first-child {
+ padding: 12px 12px 13px 12px;
+}
+
+.customize-section-title h3,
+h3.customize-section-title {
+ padding: 10px 10px 12px 14px;
+ margin: 0;
+ line-height: 21px;
+ color: #555d66;
+}
+
+.accordion-sub-container.control-panel-content {
+ display: none;
+ position: absolute;
+ top: 0;
+ width: 100%;
+}
+
+.accordion-sub-container.control-panel-content.busy {
+ display: block;
+}
+
+.current-panel .accordion-sub-container.control-panel-content {
+ width: 100%;
+}
+
+.customize-controls-close {
+ display: block;
+ position: absolute;
+ top: 0;
+ left: 0;
+ width: 45px;
+ height: 41px;
+ padding: 0 2px 0 0;
+ background: #eee;
+ border: none;
+ border-top: 4px solid #eee;
+ border-right: 1px solid #ddd;
+ color: #444;
+ text-align: left;
+ cursor: pointer;
+ transition:
+ color .15s ease-in-out,
+ border-color .15s ease-in-out,
+ background .15s ease-in-out;
+ box-sizing: content-box;
+}
+
+.customize-panel-back,
+.customize-section-back {
+ display: block;
+ float: left;
+ width: 48px;
+ height: 71px;
+ padding: 0 24px 0 0;
+ margin: 0;
+ background: #fff;
+ border: none;
+ border-right: 1px solid #ddd;
+ border-left: 4px solid #fff;
+ box-shadow: none;
+ cursor: pointer;
+ transition:
+ color .15s ease-in-out,
+ border-color .15s ease-in-out,
+ background .15s ease-in-out;
+}
+
+.customize-section-back {
+ height: 74px;
+}
+
+.ios .customize-panel-back {
+ display: none;
+}
+
+.ios .expanded.in-sub-panel .customize-panel-back {
+ display: block;
+}
+
+#customize-controls .panel-meta.customize-info .accordion-section-title {
+ margin-left: 48px;
+ border-left: none;
+}
+
+#customize-controls .panel-meta.customize-info .accordion-section-title:hover,
+#customize-controls .cannot-expand:hover .accordion-section-title {
+ background: #fff;
+ color: #555d66;
+ border-left-color: #fff;
+}
+
+.customize-controls-close:focus,
+.customize-controls-close:hover,
+.customize-controls-preview-toggle:focus,
+.customize-controls-preview-toggle:hover {
+ background: #fff;
+ color: #0073aa;
+ border-top-color: #0073aa;
+ outline: none;
+ box-shadow: none;
+}
+
+
+.customize-panel-back:hover,
+.customize-panel-back:focus,
+.customize-section-back:hover,
+.customize-section-back:focus {
+ color: #0073aa;
+ background: #f3f3f5;
+ border-left-color: #0073aa;
+ outline: none;
+ box-shadow: none;
+}
+
+.customize-controls-close:before {
+ font: normal 22px/45px dashicons;
+ content: "\f335";
+ position: relative;
+ top: -3px;
+ left: 13px;
+}
+
+.customize-panel-back:before,
+.customize-section-back:before {
+ font: normal 20px/72px dashicons;
+ content: "\f341";
+ position: relative;
+ left: 9px;
+}
+
+.wp-full-overlay-sidebar .wp-full-overlay-header {
+ background-color: #eee;
+ transition: padding ease-in-out .18s;
+}
+
+.in-sub-panel .wp-full-overlay-sidebar .wp-full-overlay-header {
+ padding-left: 62px;
+}
+
+p.customize-section-description {
+ font-style: normal;
+ margin-top: 22px;
+ margin-bottom: 0;
+}
+
+.customize-section-description ul {
+ margin-left: 1em;
+}
+
+.customize-section-description ul > li {
+ list-style: disc;
+}
+
+.section-description-buttons {
+ text-align: right;
+}
+
+.section-description-buttons button.button-link {
+ color: #0073aa;
+ text-decoration: underline;
+}
+
+.customize-control {
+ width: 100%;
+ float: left;
+ clear: both;
+ margin-bottom: 12px;
+}
+
+.customize-control select,
+.customize-control input[type="radio"],
+.customize-control input[type="checkbox"] {
+ line-height: 2;
+}
+
+.customize-control input[type="text"],
+.customize-control input[type="password"],
+.customize-control input[type="email"],
+.customize-control input[type="number"],
+.customize-control input[type="search"],
+.customize-control input[type="tel"],
+.customize-control input[type="url"] {
+ width: 100%;
+ line-height: 1.3;
+ margin: 0;
+}
+
+.customize-control-hidden {
+ margin: 0;
+}
+
+.customize-control-textarea textarea {
+ width: 100%;
+ resize: vertical;
+}
+
+.customize-control select {
+ width: 100%;
+ height: 28px;
+ line-height: 2;
+}
+
+.customize-control select[multiple] {
+ height: auto;
+}
+
+.customize-control-title {
+ display: block;
+ font-size: 14px;
+ line-height: 1.75;
+ font-weight: 600;
+ margin-bottom: 4px;
+}
+
+.customize-control-description {
+ display: block;
+ font-style: italic;
+ line-height: 1.4;
+ margin-top: 0;
+ margin-bottom: 5px;
+}
+
+.customize-section-description a.external-link:after {
+ font: 16px/11px dashicons;
+ content: "\f310";
+ top: 3px;
+ position: relative;
+ padding-left: 3px;
+ display: inline-block;
+ text-decoration: none;
+}
+
+.customize-control-color .color-picker,
+.customize-control-upload div {
+ line-height: 28px;
+}
+
+.customize-control .customize-inside-control-row {
+ line-height: 1.6;
+ display: block;
+ margin-left: 24px;
+ padding-top: 6px;
+ padding-bottom: 6px;
+}
+
+.customize-control-radio input,
+.customize-control-checkbox input,
+.customize-control-nav_menu_auto_add input {
+ margin-right: 4px;
+ margin-left: -24px;
+}
+
+.customize-control-radio {
+ padding: 5px 0 10px;
+}
+
+.customize-control-radio .customize-control-title {
+ margin-bottom: 0;
+ line-height: 1.6;
+}
+
+.customize-control-radio .customize-control-title + .customize-control-description {
+ margin-top: 7px;
+}
+
+.customize-control-radio label,
+.customize-control-checkbox label {
+ vertical-align: top;
+}
+
+.customize-control .attachment-thumb.type-icon {
+ float: left;
+ margin: 10px;
+ width: auto;
+}
+
+.customize-control .attachment-title {
+ font-weight: 600;
+ margin: 0;
+ padding: 5px 10px;
+}
+
+.customize-control .attachment-meta {
+ white-space: nowrap;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ margin: 0;
+ padding: 0 10px;
+}
+
+.customize-control .attachment-meta-title {
+ padding-top: 7px;
+}
+
+/* Remove descender space. */
+.customize-control .thumbnail-image,
+.customize-control-header .current,
+.customize-control .wp-media-wrapper.wp-video {
+ line-height: 0;
+}
+
+/* Remove descender space. */
+.customize-control-site_icon .favicon-preview .browser-preview {
+ vertical-align: top;
+}
+
+.customize-control .thumbnail-image img {
+ cursor: pointer;
+}
+
+#customize-controls .thumbnail-audio .thumbnail {
+ max-width: 64px;
+ max-height: 64px;
+ margin: 10px;
+ float: left;
+}
+
+#available-menu-items .accordion-section-content .new-content-item,
+.customize-control-dropdown-pages .new-content-item {
+ width: calc(100% - 30px);
+ padding: 8px 15px;
+ position: absolute;
+ bottom: 0;
+ z-index: 10;
+ background: #eee;
+ display: flex;
+}
+
+.customize-control-dropdown-pages .new-content-item {
+ width: 100%;
+ padding: 5px 0 5px 1px;
+ position: relative;
+}
+
+#available-menu-items .new-content-item .create-item-input,
+.customize-control-dropdown-pages .new-content-item .create-item-input {
+ flex-grow: 10;
+}
+
+#available-menu-items .new-content-item .add-content,
+.customize-control-dropdown-pages .new-content-item .add-content {
+ margin: 2px 0 2px 6px;
+ flex-grow: 1;
+}
+
+.customize-control-dropdown-pages .new-content-item .create-item-input.invalid {
+ border: 1px solid #dc3232;
+}
+
+.customize-control-dropdown-pages .add-new-toggle {
+ margin-left: 1px;
+ font-weight: 600;
+ line-height: 2.2;
+}
+
+#customize-preview iframe {
+ width: 100%;
+ height: 100%;
+ position: absolute;
+}
+#customize-preview iframe + iframe {
+ visibility: hidden;
+}
+
+.wp-full-overlay-sidebar {
+ background: #eee;
+ border-right: 1px solid #ddd;
+}
+
+
+/**
+ * Notifications
+ */
+
+#customize-controls .customize-control-notifications-container { /* Scoped to #customize-controls for specificity over notification styles in common.css. */
+ margin: 4px 0 8px 0;
+ padding: 0;
+ cursor: default;
+}
+
+#customize-controls .customize-control-widget_form.has-error .widget .widget-top,
+.customize-control-nav_menu_item.has-error .menu-item-bar .menu-item-handle {
+ box-shadow: inset 0 0 0 2px #dc3232;
+ transition: .15s box-shadow linear;
+}
+
+#customize-controls .customize-control-notifications-container li.notice {
+ list-style: none;
+ margin: 0 0 6px 0;
+ padding: 9px 14px;
+ overflow: hidden;
+}
+#customize-controls .customize-control-notifications-container .notice.is-dismissible {
+ padding-right: 38px;
+}
+
+.customize-control-notifications-container li.notice:last-child {
+ margin-bottom: 0;
+}
+
+#customize-controls .customize-control-nav_menu_item .customize-control-notifications-container {
+ margin-top: 0;
+}
+
+#customize-controls .customize-control-widget_form .customize-control-notifications-container {
+ margin-top: 8px;
+}
+
+.customize-control-text.has-error input {
+ outline: 2px solid #dc3232;
+}
+
+#customize-controls #customize-notifications-area {
+ position: absolute;
+ top: 46px;
+ width: 100%;
+ border-bottom: 1px solid #ddd;
+ display: block;
+ padding: 0;
+ margin: 0;
+}
+
+.wp-full-overlay.collapsed #customize-controls #customize-notifications-area {
+ display: none !important;
+}
+
+#customize-controls #customize-notifications-area:not(.has-overlay-notifications),
+#customize-controls .customize-section-title > .customize-control-notifications-container:not(.has-overlay-notifications),
+#customize-controls .panel-meta > .customize-control-notifications-container:not(.has-overlay-notifications) {
+ max-height: 210px;
+ overflow-x: hidden;
+ overflow-y: auto;
+}
+
+#customize-controls #customize-notifications-area > ul,
+#customize-controls #customize-notifications-area .notice,
+#customize-controls .panel-meta > .customize-control-notifications-container,
+#customize-controls .panel-meta > .customize-control-notifications-container .notice,
+#customize-controls .customize-section-title > .customize-control-notifications-container,
+#customize-controls .customize-section-title > .customize-control-notifications-container .notice {
+ margin: 0;
+}
+#customize-controls .panel-meta > .customize-control-notifications-container,
+#customize-controls .customize-section-title > .customize-control-notifications-container {
+ border-top: 1px solid #ddd;
+}
+#customize-controls #customize-notifications-area .notice,
+#customize-controls .panel-meta > .customize-control-notifications-container .notice,
+#customize-controls .customize-section-title > .customize-control-notifications-container .notice {
+ padding: 9px 14px;
+}
+#customize-controls #customize-notifications-area .notice.is-dismissible,
+#customize-controls .panel-meta > .customize-control-notifications-container .notice.is-dismissible,
+#customize-controls .customize-section-title > .customize-control-notifications-container .notice.is-dismissible {
+ padding-right: 38px;
+}
+#customize-controls #customize-notifications-area .notice + .notice,
+#customize-controls .panel-meta > .customize-control-notifications-container .notice + .notice,
+#customize-controls .customize-section-title > .customize-control-notifications-container .notice + .notice {
+ margin-top: 1px;
+}
+
+@keyframes customize-fade-in {
+ 0% { opacity: 0; }
+ 100% { opacity: 1; }
+}
+
+#customize-controls .notice.notification-overlay,
+#customize-controls #customize-notifications-area .notice.notification-overlay {
+ margin: 0;
+ border-left: 0; /* @todo Appropriate styles could be added for notice-error, notice-warning, notice-success, etc */
+}
+
+#customize-controls .customize-control-notifications-container.has-overlay-notifications {
+ animation: customize-fade-in 0.5s;
+ z-index: 30;
+}
+
+/* Note: Styles for this are also defined in themes.css */
+#customize-controls #customize-notifications-area .notice.notification-overlay .notification-message {
+ clear: both;
+ color: #191e23;
+ font-size: 18px;
+ font-style: normal;
+ margin: 0;
+ padding: 2em 0;
+ text-align: center;
+ width: 100%;
+ display: block;
+ top: 50%;
+ position: relative;
+}
+
+/* Style for custom settings */
+
+/**
+ * Static front page
+ */
+
+#customize-control-show_on_front.has-error {
+ margin-bottom: 0;
+}
+#customize-control-show_on_front.has-error .customize-control-notifications-container {
+ margin-top: 12px;
+}
+
+/**
+ * Dropdowns
+ */
+
+.accordion-section .dropdown {
+ float: left;
+ display: block;
+ position: relative;
+ cursor: pointer;
+}
+
+.accordion-section .dropdown-content {
+ overflow: hidden;
+ float: left;
+ min-width: 30px;
+ height: 16px;
+ line-height: 16px;
+ margin-right: 16px;
+ padding: 4px 5px;
+ border: 2px solid #eee;
+ -webkit-user-select: none;
+ -moz-user-select: none;
+ -ms-user-select: none;
+ user-select: none;
+}
+
+/* @todo maybe no more used? */
+.customize-control .dropdown-arrow {
+ position: absolute;
+ top: 0;
+ bottom: 0;
+ right: 0;
+ width: 20px;
+ background: #eee;
+}
+
+.customize-control .dropdown-arrow:after {
+ content: "\f140";
+ font: normal 20px/1 dashicons;
+ speak: none;
+ display: block;
+ padding: 0;
+ text-indent: 0;
+ text-align: center;
+ position: relative;
+ -webkit-font-smoothing: antialiased;
+ -moz-osx-font-smoothing: grayscale;
+ text-decoration: none !important;
+ color: #32373c;
+}
+
+.customize-control .dropdown-status {
+ color: #32373c;
+ background: #eee;
+ display: none;
+ max-width: 112px;
+}
+
+.customize-control-color .dropdown {
+ margin-right: 5px;
+ margin-bottom: 5px;
+}
+
+.customize-control-color .dropdown .dropdown-content {
+ background-color: #555d66;
+ border: 1px solid rgba(0, 0, 0, 0.15);
+}
+
+.customize-control-color .dropdown:hover .dropdown-content {
+ border-color: rgba(0, 0, 0, 0.25);
+}
+
+/**
+ * iOS can't scroll iframes,
+ * instead it expands the iframe size to match the size of the content
+ */
+
+.ios .wp-full-overlay {
+ position: relative;
+}
+
+.ios #customize-controls .wp-full-overlay-sidebar-content {
+ -webkit-overflow-scrolling: touch;
+}
+
+/* Media controls */
+
+.customize-control .actions .button {
+ margin-top: 12px;
+}
+
+.customize-control-header .actions,
+.customize-control-header .uploaded {
+ margin-bottom: 18px;
+}
+
+.customize-control-header .uploaded button:not(.random),
+.customize-control-header .default button:not(.random) {
+ width: 100%;
+ padding: 0;
+ margin: 0;
+ background: none;
+ border: none;
+ color: inherit;
+ cursor: pointer;
+}
+
+.customize-control-header button img {
+ display: block;
+}
+
+.customize-control .attachment-media-view .remove-button,
+.customize-control .attachment-media-view .default-button,
+.customize-control .attachment-media-view .upload-button,
+.customize-control-header button.new,
+.customize-control-header button.remove {
+ width: auto;
+ height: auto;
+ white-space: normal;
+}
+
+.customize-control .attachment-media-view .thumbnail,
+.customize-control-header .current .container {
+ overflow: hidden;
+}
+
+.customize-control .attachment-media-view .placeholder,
+.customize-control .attachment-media-view .button-add-media,
+.customize-control-header .placeholder {
+ width: 100%;
+ position: relative;
+ text-align: center;
+ cursor: default;
+ border: 1px dashed #b4b9be;
+ box-sizing: border-box;
+ padding: 9px 0;
+ line-height: 1.6;
+}
+
+.customize-control .attachment-media-view .button-add-media {
+ cursor: pointer;
+ background-color: #edeff0;
+ color: #32373c;
+}
+
+.customize-control .attachment-media-view .button-add-media:hover {
+ background-color: #fbfbfc;
+}
+
+.customize-control .attachment-media-view .button-add-media:focus {
+ background-color: #fbfbfc;
+ border-style: solid;
+ border-color: #5b9dd9;
+ box-shadow: 0 0 3px rgba( 0, 115, 170, .8 );
+ /* Only visible in Windows High Contrast mode */
+ outline: 2px solid transparent;
+ outline-offset: -2px;
+}
+
+.customize-control-header .inner {
+ display: none;
+ position: absolute;
+ width: 100%;
+ color: #555d66;
+ white-space: nowrap;
+ text-overflow: ellipsis;
+ overflow: hidden;
+}
+
+.customize-control-header .inner,
+.customize-control-header .inner .dashicons {
+ line-height: 20px;
+ top: 8px;
+}
+
+.customize-control-header .list .inner,
+.customize-control-header .list .inner .dashicons {
+ top: 9px;
+}
+
+.customize-control-header .header-view {
+ position: relative;
+ width: 100%;
+ margin-bottom: 12px;
+}
+
+.customize-control-header .header-view:last-child {
+ margin-bottom: 0px;
+}
+
+/* Convoluted, but 'outline' support isn't good enough yet */
+.customize-control-header .header-view:after {
+ border: 0;
+}
+
+.customize-control-header .header-view.selected .choice:focus {
+ outline: none;
+}
+
+.customize-control-header .header-view.selected:after {
+ content: "";
+ position: absolute;
+ height: auto;
+ top: 0;
+ left: 0;
+ bottom: 0;
+ right: 0;
+ border: 4px solid #00a0d2;
+ border-radius: 2px;
+}
+
+.customize-control-header .header-view.button.selected {
+ border: 0;
+}
+
+/* Header control: overlay "close" button */
+
+.customize-control-header .uploaded .header-view .close {
+ font-size: 20px;
+ color: #fff;
+ background: #555d66;
+ background: rgba(0, 0, 0, 0.5);
+ position: absolute;
+ top: 10px;
+ left: -999px;
+ z-index: 1;
+ width: 26px;
+ height: 26px;
+ cursor: pointer;
+}
+
+.customize-control-header .header-view:hover .close,
+.customize-control-header .header-view .close:focus {
+ left: auto;
+ right: 10px;
+}
+
+.customize-control-header .header-view .close:focus {
+ outline: 1px solid #5b9dd9;
+}
+
+/* Header control: randomiz(s)er */
+
+.customize-control-header .random.placeholder {
+ cursor: pointer;
+ border-radius: 2px;
+ height: 40px;
+}
+
+.customize-control-header button.random {
+ width: 100%;
+ height: auto;
+ min-height: 40px;
+ white-space: normal;
+}
+
+.customize-control-header button.random .dice {
+ margin-top: 4px;
+}
+
+.customize-control-header .placeholder:hover .dice,
+.customize-control-header .header-view:hover > button.random .dice {
+ animation: dice-color-change 3s infinite;
+}
+
+.button-see-me {
+ animation: bounce .7s 1;
+ transform-origin: center bottom;
+}
+
+@keyframes bounce {
+ from, 20%, 53%, 80%, to {
+ animation-timing-function: cubic-bezier(0.215, 0.610, 0.355, 1.000);
+ transform: translate3d(0,0,0);
+ }
+
+ 40%, 43% {
+ animation-timing-function: cubic-bezier(0.755, 0.050, 0.855, 0.060);
+ transform: translate3d(0, -12px, 0);
+ }
+
+ 70% {
+ animation-timing-function: cubic-bezier(0.755, 0.050, 0.855, 0.060);
+ transform: translate3d(0, -6px, 0);
+ }
+
+ 90% {
+ transform: translate3d(0,-1px,0);
+ }
+}
+
+.customize-control-header .choice {
+ position: relative;
+ display: block;
+ margin-bottom: 9px;
+}
+
+.customize-control-header .choice:focus {
+ outline: none;
+ box-shadow:
+ 0 0 0 1px #5b9dd9,
+ 0 0 3px 1px rgba(30, 140, 190, 0.8);
+}
+
+.customize-control-header .uploaded div:last-child > .choice {
+ margin-bottom: 0;
+}
+
+.customize-control .attachment-media-view .thumbnail-image img,
+.customize-control-header img {
+ max-width: 100%;
+}
+
+.customize-control .attachment-media-view .remove-button,
+.customize-control .attachment-media-view .default-button,
+.customize-control-header .remove {
+ margin-right: 8px;
+}
+
+/* Background position control */
+.customize-control-background_position .background-position-control .button-group {
+ display: block;
+}
+
+/**
+ * Code Editor Control and Custom CSS Section
+ *
+ * Modifications to the Section Container to make the textarea full-width and
+ * full-height, if the control is the only control in the section.
+ */
+
+.customize-control-code_editor textarea {
+ width: 100%;
+ font-family: Consolas, Monaco, monospace;
+ font-size: 12px;
+ padding: 6px 8px;
+ -moz-tab-size: 2;
+ -o-tab-size: 2;
+ tab-size: 2;
+}
+.customize-control-code_editor textarea,
+.customize-control-code_editor .CodeMirror {
+ height: 14em;
+}
+
+#customize-controls .customize-section-description-container.section-meta.customize-info {
+ border-bottom: none;
+}
+
+#sub-accordion-section-custom_css .customize-control-notifications-container {
+ margin-bottom: 15px;
+}
+
+#customize-control-custom_css textarea {
+ display: block;
+ height: 500px;
+}
+
+.customize-section-description-container + #customize-control-custom_css .customize-control-title {
+ margin-left: 12px;
+}
+
+.customize-section-description-container + #customize-control-custom_css:last-child textarea {
+ border-right: 0;
+ border-left: 0;
+ height: calc( 100vh - 185px );
+ resize: none;
+}
+
+.customize-section-description-container + #customize-control-custom_css:last-child {
+ margin-left: -12px;
+ width: 299px;
+ width: calc( 100% + 24px );
+ margin-bottom: -12px;
+}
+
+.customize-section-description-container + #customize-control-custom_css:last-child .CodeMirror {
+ height: calc( 100vh - 185px );
+}
+
+.CodeMirror-lint-tooltip,
+.CodeMirror-hints {
+ z-index: 500000 !important;
+}
+
+.customize-section-description-container + #customize-control-custom_css:last-child .customize-control-notifications-container {
+ margin-left: 12px;
+ margin-right: 12px;
+}
+
+.theme-browser .theme.active .theme-actions,
+.wp-customizer .theme-browser .theme .theme-actions {
+ padding: 10px 15px;
+ box-shadow: inset 0 1px 0 rgba(0, 0, 0, 0.1);
+}
+
+@media screen and (max-width: 640px) {
+ .customize-section-description-container + #customize-control-custom_css:last-child {
+ margin-right: 0;
+ }
+
+ .customize-section-description-container + #customize-control-custom_css:last-child textarea {
+ height: calc( 100vh - 140px );
+ }
+}
+
+/**
+ * Themes
+ */
+
+#customize-theme-controls .control-panel-themes {
+ border-bottom: none;
+}
+
+#customize-theme-controls .control-panel-themes > .accordion-section-title:hover, /* Not a focusable element. */
+#customize-theme-controls .control-panel-themes > .accordion-section-title {
+ cursor: default;
+ background: #fff;
+ color: #555d66;
+ border-top: 1px solid #ddd;
+ border-bottom: 1px solid #ddd;
+ border-left: none;
+ border-right: none;
+ margin: 0 0 15px 0;
+ padding-right: 100px; /* Space for the button */
+}
+
+#customize-theme-controls .control-section-themes .customize-themes-panel .accordion-section-title:first-child:hover, /* Not a focusable element. */
+#customize-theme-controls .control-section-themes .customize-themes-panel .accordion-section-title:first-child {
+ border-top: 0;
+}
+
+#customize-theme-controls .control-section-themes > .accordion-section-title:hover, /* Not a focusable element. */
+#customize-theme-controls .control-section-themes > .accordion-section-title {
+ margin: 0 0 15px;
+}
+
+#customize-controls .customize-themes-panel .accordion-section-title:hover,
+#customize-controls .customize-themes-panel .accordion-section-title {
+ margin: 15px -8px;
+}
+
+#customize-controls .control-section-themes .accordion-section-title,
+#customize-controls .customize-themes-panel .accordion-section-title {
+ padding-right: 100px; /* Space for the button */
+}
+
+.control-panel-themes .accordion-section-title span.customize-action,
+#customize-controls .customize-section-title span.customize-action,
+#customize-controls .control-section-themes .accordion-section-title span.customize-action,
+#customize-controls .customize-section-title span.customize-action {
+ font-size: 13px;
+ display: block;
+ font-weight: 400;
+}
+
+#customize-theme-controls .control-panel-themes .accordion-section-title .change-theme {
+ position: absolute;
+ right: 10px;
+ top: 50%;
+ margin-top: -14px;
+ font-weight: 400;
+}
+
+#customize-theme-controls .control-panel-themes > .accordion-section-title:after {
+ display: none;
+}
+
+.control-panel-themes .customize-themes-full-container {
+ position: fixed;
+ top: 0;
+ left: 0;
+ transition: .18s left ease-in-out;
+ margin: 0 0 0 300px;
+ padding: 71px 0 25px;
+ overflow-y: scroll;
+ width: calc(100% - 300px);
+ height: calc(100% - 96px);
+ background: #eee;
+ z-index: 20;
+}
+
+@media screen and (min-width: 1670px) {
+ .control-panel-themes .customize-themes-full-container {
+ width: 82%;
+ right: 0;
+ left: initial;
+ }
+}
+
+.modal-open .control-panel-themes .customize-themes-full-container {
+ overflow-y: visible;
+}
+
+/* Animations for opening the themes panel */
+#customize-save-button-wrapper,
+#customize-header-actions .spinner,
+#customize-header-actions .customize-controls-preview-toggle {
+ transition: .18s margin ease-in-out;
+}
+
+#customize-footer-actions,
+#customize-footer-actions .collapse-sidebar {
+ bottom: 0;
+ transition: .18s bottom ease-in-out;
+}
+
+.in-themes-panel:not(.animating) #customize-header-actions .spinner,
+.in-themes-panel:not(.animating) #customize-header-actions .customize-controls-preview-toggle,
+.in-themes-panel:not(.animating) #customize-preview,
+.in-themes-panel:not(.animating) #customize-footer-actions {
+ visibility: hidden;
+}
+
+.wp-full-overlay.in-themes-panel {
+ background: #eee; /* Prevents a black flash when fading in the panel */
+}
+
+.in-themes-panel #customize-save-button-wrapper,
+.in-themes-panel #customize-header-actions .spinner,
+.in-themes-panel #customize-header-actions .customize-controls-preview-toggle {
+ margin-top: -46px; /* Height of header actions bar */
+}
+
+.in-themes-panel #customize-footer-actions,
+.in-themes-panel #customize-footer-actions .collapse-sidebar {
+ bottom: -45px;
+}
+
+/* Don't show the theme count while the panel opens, as it's in the wrong place during the animation */
+.in-themes-panel.animating .control-panel-themes .filter-themes-count {
+ display: none;
+}
+
+.in-themes-panel.wp-full-overlay .wp-full-overlay-sidebar-content {
+ bottom: 0;
+}
+
+.themes-filter-bar .feature-filter-toggle {
+ float: right;
+ margin: 3px 0 3px 25px;
+}
+
+.themes-filter-bar .feature-filter-toggle:before {
+ content: "\f111";
+ margin: 0 5px 0 0;
+ font: normal 16px/1 dashicons;
+ vertical-align: text-bottom;
+ -webkit-font-smoothing: antialiased;
+ -moz-osx-font-smoothing: grayscale;
+}
+
+.themes-filter-bar .feature-filter-toggle.open {
+ background: #eee;
+ border-color: #999;
+ box-shadow: inset 0 2px 5px -3px rgba(0, 0, 0, 0.5);
+ transform: translateY(1px);
+}
+
+.themes-filter-bar .feature-filter-toggle .filter-count-filters {
+ display: none;
+}
+
+.filter-drawer {
+ box-sizing: border-box;
+ width: 100%;
+ position: absolute;
+ top: 46px;
+ left: 0;
+ padding: 25px 0 25px 25px;
+ border-top: 0;
+ margin: 0;
+ background: #eee;
+ border-bottom: 1px solid #ddd;
+}
+
+.filter-drawer .filter-group {
+ margin: 0 25px 0 0;
+ width: calc( (100% - 75px) / 3);
+ min-width: 200px;
+ max-width: 320px;
+}
+
+/* Adds a delay before fading in to avoid it "jumping" */
+@keyframes themes-fade-in {
+ 0% {
+ opacity: 0;
+ }
+ 50% {
+ opacity: 0;
+ }
+ 100% {
+ opacity: 1;
+ }
+}
+
+.control-panel-themes .customize-themes-full-container.animate {
+ animation: .6s themes-fade-in 1;
+}
+
+.in-themes-panel:not(.animating) .control-panel-themes .filter-themes-count {
+ animation: .6s themes-fade-in 1;
+}
+
+.control-panel-themes .filter-themes-count {
+ position: relative;
+ float: right;
+ line-height: 2.6;
+}
+
+.control-panel-themes .filter-themes-count .themes-displayed {
+ font-weight: 600;
+ color: #555d66;
+}
+
+.customize-themes-notifications {
+ margin: 0;
+}
+
+.control-panel-themes .customize-themes-notifications .notice {
+ margin: 0 0 25px 0;
+}
+
+.customize-themes-full-container .customize-themes-section {
+ display: none !important; /* There is unknown JS that perpetually tries to show all theme sections when more items are added. */
+ overflow: hidden;
+}
+
+.customize-themes-full-container .customize-themes-section.current-section {
+ display: list-item !important; /* There is unknown JS that perpetually tries to show all theme sections when more items are added. */
+}
+
+.control-section .customize-section-text-before {
+ padding: 0 0 8px 15px;
+ margin: 15px 0 0 0;
+ line-height: 16px;
+ border-bottom: 1px solid #ddd;
+ color: #555d66;
+}
+
+.control-panel-themes .customize-themes-section-title {
+ width: 100%;
+ background: #fff;
+ box-shadow: none;
+ outline: none;
+ border-top: none;
+ border-bottom: 1px solid #ddd;
+ border-left: 4px solid #fff;
+ border-right: none;
+ cursor: pointer;
+ padding: 10px 15px;
+ position: relative;
+ text-align: left;
+ font-size: 14px;
+ font-weight: 600;
+ color: #555d66;
+ text-shadow: none;
+}
+
+.control-panel-themes #accordion-section-installed_themes {
+ border-top: 1px solid #ddd;
+}
+
+.control-panel-themes .theme-section {
+ margin: 0;
+ position: relative;
+}
+
+.control-panel-themes .customize-themes-section-title:focus,
+.control-panel-themes .customize-themes-section-title:hover {
+ border-left-color: #0073aa;
+ color: #0073aa;
+ background: #f5f5f5;
+}
+
+.customize-themes-section-title:not(.selected):after {
+ content: "";
+ display: block;
+ position: absolute;
+ top: 9px;
+ right: 15px;
+ width: 18px;
+ height: 18px;
+ border-radius: 100%;
+ border: 1px solid #ccc;
+ background: #fff;
+}
+
+.control-panel-themes .theme-section .customize-themes-section-title.selected:after {
+ content: "\f147";
+ font: 16px/1 dashicons;
+ box-sizing: border-box;
+ width: 20px;
+ height: 20px;
+ padding: 3px 3px 1px 1px; /* Re-align the icon to the smaller grid */
+ border-radius: 100%;
+ position: absolute;
+ top: 9px;
+ right: 15px;
+ background: #0073aa;
+ color: #fff;
+}
+
+.control-panel-themes .customize-themes-section-title.selected {
+ color: #0073aa;
+}
+
+#customize-theme-controls .themes.accordion-section-content {
+ position: relative;
+ left: 0;
+ padding: 0;
+ width: 100%;
+}
+
+.loading .customize-themes-section .spinner {
+ display: block;
+ visibility: visible;
+ position: relative;
+ clear: both;
+ width: 20px;
+ height: 20px;
+ left: calc(50% - 10px);
+ float: none;
+ margin-top: 50px;
+}
+
+.customize-themes-section .no-themes,
+.customize-themes-section .no-themes-local {
+ display: none;
+}
+
+.themes-section-installed_themes .theme .notice-success:not(.updated-message) {
+ display: none; /* Hide "installed" notice on installed themes tab. */
+}
+
+.customize-control-theme .theme {
+ width: 100%;
+ margin: 0;
+ border: 1px solid #ddd;
+ background: #fff;
+}
+
+.customize-control-theme .theme .theme-name, .customize-control-theme .theme .theme-actions {
+ background: #fff;
+ border: none;
+}
+
+.customize-control.customize-control-theme { /* override most properties on .customize-control */
+ box-sizing: border-box;
+ width: 25%;
+ max-width: 600px; /* Max. screenshot size / 2 */
+ margin: 0 25px 25px 0;
+ padding: 0;
+ clear: none;
+}
+
+/* 5 columns above 2100px */
+@media screen and (min-width: 2101px) {
+ .customize-control.customize-control-theme {
+ width: calc( ( 100% - 125px ) / 5 - 1px ); /* 1px offset accounts for browser rounding, typical all grids */
+ }
+}
+
+/* 4 columns up to 2100px */
+@media screen and (min-width: 1601px) and (max-width: 2100px) {
+ .customize-control.customize-control-theme {
+ width: calc( ( 100% - 100px ) / 4 - 1px );
+ }
+}
+
+/* 3 columns up to 1600px */
+@media screen and (min-width: 1201px) and (max-width: 1600px) {
+ .customize-control.customize-control-theme {
+ width: calc( ( 100% - 75px ) / 3 - 1px );
+ }
+}
+
+/* 2 columns up to 1200px */
+@media screen and (min-width: 851px) and (max-width: 1200px) {
+ .customize-control.customize-control-theme {
+ width: calc( ( 100% - 50px ) / 2 - 1px );
+
+ }
+}
+
+/* 1 column up to 850 px */
+@media screen and (max-width: 850px) {
+ .customize-control.customize-control-theme {
+ width: 100%;
+ }
+}
+
+.wp-customizer .theme-browser .themes {
+ padding: 0 0 25px 25px;
+ transition: .18s margin-top linear;
+}
+
+.wp-customizer .theme-browser .theme .theme-actions {
+ opacity: 1;
+}
+
+#customize-controls h3.theme-name {
+ font-size: 15px;
+}
+
+#customize-controls .theme-overlay .theme-name {
+ font-size: 32px;
+}
+
+.customize-preview-header.themes-filter-bar {
+ position: fixed;
+ top: 0;
+ left: 300px;
+ width: calc(100% - 300px);
+ height: 46px;
+ background: #eee;
+ z-index: 10;
+ padding: 6px 25px;
+ box-sizing: border-box;
+ border-bottom: 1px solid #ddd;
+}
+
+@media screen and (min-width: 1670px) {
+ .customize-preview-header.themes-filter-bar {
+ width: 82%;
+ right: 0;
+ left: initial;
+ }
+}
+
+.themes-filter-bar .themes-filter-container {
+ margin: 0;
+ padding: 0;
+}
+
+.themes-filter-bar .wp-filter-search {
+ line-height: 1.8;
+ padding: 6px 10px 6px 30px;
+ max-width: 100%;
+ width: 40%;
+ min-width: 300px;
+ position: absolute;
+ top: 6px;
+ left: 25px;
+ height: 32px;
+ margin: 1px 0;
+}
+
+/* Unstick the filter bar on short windows/screens. This breakpoint is based on the
+ current length of .org feature filters assuming translations do not wrap lines. */
+@media screen and (max-height: 540px), screen and (max-width: 1018px) {
+ .customize-preview-header.themes-filter-bar {
+ position: relative;
+ left: 0;
+ width: 100%;
+ margin: 0 0 25px 0;
+ }
+ .filter-drawer {
+ top: 46px;
+ }
+ .wp-customizer .theme-browser .themes {
+ padding: 0 0 25px 25px;
+ overflow: hidden;
+ }
+
+ .control-panel-themes .customize-themes-full-container {
+ margin-top: 0;
+ padding: 0;
+ height: 100%;
+ width: calc(100% - 300px);
+ }
+}
+
+@media screen and (max-width: 1018px) {
+ .filter-drawer .filter-group {
+ width: calc( (100% - 50px) / 2);
+ }
+}
+
+@media screen and (max-width: 900px) {
+ .customize-preview-header.themes-filter-bar {
+ height: 86px;
+ padding-top: 46px;
+ }
+
+ .themes-filter-bar .wp-filter-search {
+ width: calc(100% - 50px);
+ margin: 0;
+ min-width: 200px;
+ }
+
+ .filter-drawer {
+ top: 86px;
+ }
+
+ .control-panel-themes .filter-themes-count {
+ float: left;
+ }
+}
+
+@media screen and (max-width: 792px) {
+ .filter-drawer .filter-group {
+ width: calc( 100% - 25px);
+ }
+}
+
+.control-panel-themes .customize-themes-mobile-back {
+ display: none;
+}
+
+/* Mobile - toggle between themes and filters */
+@media screen and (max-width: 600px) {
+
+ .filter-drawer {
+ top: 132px;
+ }
+
+ .wp-full-overlay.showing-themes .control-panel-themes .filter-themes-count .filter-themes {
+ display: block;
+ float: right;
+ }
+
+ .control-panel-themes .customize-themes-full-container {
+ width: 100%;
+ margin: 0;
+ padding-top: 46px;
+ height: calc(100% - 46px);
+ z-index: 1;
+ display: none;
+ }
+
+ .showing-themes .control-panel-themes .customize-themes-full-container {
+ display: block;
+ }
+
+ .wp-customizer .showing-themes .control-panel-themes .customize-themes-mobile-back {
+ display: block;
+ position: fixed;
+ top: 0;
+ left: 0;
+ background: #eee;
+ color: #444;
+ border-radius: 0;
+ box-shadow: none;
+ border: none;
+ height: 46px;
+ width: 100%;
+ z-index: 10;
+ text-align: left;
+ text-shadow: none;
+ border-bottom: 1px solid #ddd;
+ border-left: 4px solid transparent;
+ margin: 0;
+ padding: 0;
+ font-size: 0;
+ overflow: hidden;
+ }
+
+ .wp-customizer .showing-themes .control-panel-themes .customize-themes-mobile-back:before {
+ left: 0;
+ top: 0;
+ height: 46px;
+ width: 26px;
+ display: block;
+ line-height: 2.3;
+ padding: 0 8px 0 8px;
+ border-right: 1px solid #ddd;
+ }
+
+ .wp-customizer .showing-themes .control-panel-themes .customize-themes-mobile-back:hover,
+ .wp-customizer .showing-themes .control-panel-themes .customize-themes-mobile-back:focus {
+ color: #0073aa;
+ background: #f3f3f5;
+ border-left-color: #0073aa;
+ outline: none;
+ box-shadow: none;
+ }
+
+ .showing-themes #customize-header-actions {
+ display: none;
+ }
+
+ #customize-controls {
+ width: 100%;
+ }
+}
+
+/* Details View */
+.wp-customizer .theme-overlay {
+ display: none;
+}
+
+.wp-customizer.modal-open .theme-overlay {
+ position: fixed;
+ left: 0;
+ top: 0;
+ right: 0;
+ bottom: 0;
+ z-index: 109;
+}
+
+/* Avoid a z-index war by resetting elements that should be under the overlay.
+ This is likely required because of the way that sections and panels are positioned. */
+.wp-customizer.modal-open #customize-header-actions,
+.wp-customizer.modal-open .control-panel-themes .filter-themes-count,
+.wp-customizer.modal-open .control-panel-themes .customize-themes-section-title.selected:after {
+ z-index: -1;
+}
+
+.wp-full-overlay.in-themes-panel.themes-panel-expanded #customize-controls .wp-full-overlay-sidebar-content {
+ overflow: visible;
+}
+
+.wp-customizer .theme-overlay .theme-backdrop {
+ background: rgba(238, 238, 238, 0.75);
+ position: fixed;
+ z-index: 110;
+}
+
+.wp-customizer .theme-overlay .star-rating {
+ float: left;
+ margin-right: 8px;
+}
+
+.wp-customizer .theme-rating .num-ratings {
+ line-height: 20px;
+}
+
+.wp-customizer .theme-overlay .theme-wrap {
+ left: 90px;
+ right: 90px;
+ top: 45px;
+ bottom: 45px;
+ z-index: 120;
+}
+
+.wp-customizer .theme-overlay .theme-actions {
+ text-align: right; /* Because there're only one or two actions, match the UI pattern of media modals and right-align the action. */
+ padding: 10px 25px;
+ background: #eee;
+ border-top: 1px solid #ddd;
+}
+
+.wp-customizer .theme-overlay .theme-actions .theme-install.preview {
+ margin-left: 8px;
+}
+
+.control-panel-themes .theme-actions .delete-theme {
+ left: 15px; /* these override themes.css on mobile */
+ right: auto;
+ bottom: auto;
+ position: absolute;
+}
+
+.modal-open .in-themes-panel #customize-controls .wp-full-overlay-sidebar-content {
+ overflow: visible; /* Prevent the top-level Customizer controls from becoming visible when elements on the right of the details modal are focused. */
+}
+
+.wp-customizer .theme-header {
+ background: #eee;
+}
+
+.wp-customizer .theme-overlay .theme-header button,
+.wp-customizer .theme-overlay .theme-header .close:before {
+ color: #444;
+}
+
+.wp-customizer .theme-overlay .theme-header .close:focus,
+.wp-customizer .theme-overlay .theme-header .close:hover,
+.wp-customizer .theme-overlay .theme-header .right:focus,
+.wp-customizer .theme-overlay .theme-header .right:hover,
+.wp-customizer .theme-overlay .theme-header .left:focus,
+.wp-customizer .theme-overlay .theme-header .left:hover {
+ background: #fff;
+ border-bottom: 4px solid #0073aa;
+ color: #0073aa;
+}
+
+.wp-customizer .theme-overlay .theme-header .close:focus:before,
+.wp-customizer .theme-overlay .theme-header .close:hover:before {
+ color: #0073aa;
+}
+
+.wp-customizer .theme-overlay .theme-header button.disabled,
+.wp-customizer .theme-overlay .theme-header button.disabled:hover,
+.wp-customizer .theme-overlay .theme-header button.disabled:focus {
+ border-bottom: none;
+ background: transparent;
+ color: #ccc;
+}
+
+/* Small Screens */
+@media (max-width: 850px), (max-height: 472px) {
+ .wp-customizer .theme-overlay .theme-wrap {
+ left: 0;
+ right: 0;
+ top: 0;
+ bottom: 0;
+ }
+
+ .wp-customizer .theme-browser .themes {
+ padding-right: 25px;
+ }
+}
+
+/* Handle cheaters. */
+body.cheatin {
+ font-size: medium;
+ height: auto;
+ background: #fff;
+ margin: 50px auto 2em;
+ padding: 1em 2em;
+ max-width: 700px;
+ min-width: 0;
+ box-shadow: 0 1px 3px rgba(0, 0, 0, 0.13);
+}
+
+body.cheatin h1 {
+ border-bottom: 1px solid #ddd;
+ clear: both;
+ color: #555d66;
+ font-size: 24px;
+ font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
+ margin: 30px 0 0 0;
+ padding: 0;
+ padding-bottom: 7px;
+}
+
+body.cheatin p {
+ font-size: 14px;
+ line-height: 1.5;
+ margin: 25px 0 20px;
+}
+
+/**
+ * Widgets and Menus common styles
+ */
+
+/* higher specificity than .wp-core-ui .button */
+#customize-theme-controls .add-new-widget,
+#customize-theme-controls .add-new-menu-item {
+ cursor: pointer;
+ float: right;
+ margin: 0;
+ margin-left: 10px;
+ transition: all 0.2s;
+ -webkit-user-select: none;
+ -moz-user-select: none;
+ -ms-user-select: none;
+ user-select: none;
+ outline: none;
+}
+
+.reordering .add-new-widget,
+.reordering .add-new-menu-item {
+ opacity: 0.2;
+ pointer-events: none;
+ cursor: not-allowed; /* doesn't work in conjunction with pointer-events */
+}
+
+.add-new-widget:before,
+.add-new-menu-item:before,
+#available-menu-items .new-content-item .add-content:before {
+ content: "\f132";
+ display: inline-block;
+ position: relative;
+ left: -2px;
+ top: 0;
+ font: normal 20px/1 dashicons;
+ vertical-align: middle;
+ transition: all 0.2s;
+ -webkit-font-smoothing: antialiased;
+ -moz-osx-font-smoothing: grayscale;
+}
+
+/* Reordering */
+.reorder-toggle {
+ float: right;
+ padding: 5px 8px;
+ text-decoration: none;
+ cursor: pointer;
+ outline: none;
+}
+
+.reorder,
+.reordering .reorder-done {
+ display: block;
+ padding: 5px 8px;
+}
+
+.reorder-done,
+.reordering .reorder {
+ display: none;
+}
+
+.widget-reorder-nav span,
+.menu-item-reorder-nav button {
+ position: relative;
+ overflow: hidden;
+ float: left;
+ display: block;
+ width: 33px; /* was 42px for mobile */
+ height: 43px;
+ color: #82878c;
+ text-indent: -9999px;
+ cursor: pointer;
+ outline: none;
+}
+
+.menu-item-reorder-nav button {
+ width: 30px;
+ height: 40px;
+ background: transparent;
+ border: none;
+ box-shadow: none;
+}
+
+.widget-reorder-nav span:before,
+.menu-item-reorder-nav button:before {
+ display: inline-block;
+ position: absolute;
+ top: 0;
+ right: 0;
+ width: 100%;
+ height: 100%;
+ font: normal 20px/43px dashicons;
+ text-align: center;
+ text-indent: 0;
+ -webkit-font-smoothing: antialiased;
+ -moz-osx-font-smoothing: grayscale;
+}
+
+.widget-reorder-nav span:hover,
+.widget-reorder-nav span:focus,
+.menu-item-reorder-nav button:hover,
+.menu-item-reorder-nav button:focus {
+ color: #191e23;
+ background: #eee;
+}
+
+.move-widget-down:before,
+.menus-move-down:before {
+ content: "\f347";
+}
+
+.move-widget-up:before,
+.menus-move-up:before {
+ content: "\f343";
+}
+
+#customize-theme-controls .first-widget .move-widget-up,
+#customize-theme-controls .last-widget .move-widget-down,
+.move-up-disabled .menus-move-up,
+.move-down-disabled .menus-move-down,
+.move-right-disabled .menus-move-right,
+.move-left-disabled .menus-move-left {
+ color: #d5d5d5;
+ background-color: #fff;
+ cursor: default;
+ pointer-events: none;
+}
+
+/**
+ * New widget and Add-menu-items modes and panels
+ */
+
+.wp-full-overlay-main {
+ right: auto; /* this overrides a right: 0; which causes the preview to resize, I'd rather have it go off screen at the normal size. */
+ width: 100%;
+}
+
+body.adding-widget .add-new-widget,
+body.adding-widget .add-new-widget:hover,
+.adding-menu-items .add-new-menu-item,
+.adding-menu-items .add-new-menu-item:hover,
+.add-menu-toggle.open,
+.add-menu-toggle.open:hover {
+ background: #eee;
+ border-color: #929793;
+ color: #32373c;
+ box-shadow: inset 0 2px 5px -3px rgba(0, 0, 0, 0.5);
+}
+
+body.adding-widget .add-new-widget:before,
+.adding-menu-items .add-new-menu-item:before,
+#accordion-section-add_menu .add-new-menu-item.open:before {
+ transform: rotate(45deg);
+}
+
+#available-widgets,
+#available-menu-items {
+ position: absolute;
+ top: 0;
+ bottom: 0;
+ left: -301px;
+ visibility: hidden;
+ overflow-x: hidden;
+ overflow-y: auto;
+ width: 300px;
+ margin: 0;
+ z-index: 4;
+ background: #eee;
+ transition: left .18s;
+ border-right: 1px solid #ddd;
+}
+
+#available-widgets .customize-section-title,
+#available-menu-items .customize-section-title {
+ display: none;
+}
+
+#available-widgets-list {
+ top: 60px;
+ position: absolute;
+ overflow: auto;
+ bottom: 0;
+ width: 100%;
+ border-top: 1px solid #ddd;
+}
+
+.no-widgets-found #available-widgets-list {
+ border-top: none;
+}
+
+#available-widgets-filter {
+ position: fixed;
+ top: 0;
+ z-index: 1;
+ width: 300px;
+ background: #eee;
+}
+
+/* search field container */
+#available-widgets-filter,
+#available-menu-items-search .accordion-section-title {
+ padding: 13px 15px;
+ box-sizing: border-box;
+}
+
+#available-widgets-filter input,
+#available-menu-items-search input {
+ width: 100%;
+ height: 32px;
+ margin: 1px 0;
+ padding: 6px 30px;
+}
+
+#available-widgets-filter input::-ms-clear,
+#available-menu-items-search input::-ms-clear {
+ display: none; /* remove the "x" in IE, which conflicts with the "x" icon on button.clear-results */
+}
+
+#available-menu-items-search .search-icon,
+#available-widgets-filter .search-icon {
+ display: block;
+ position: absolute;
+ top: 15px; /* 13 container padding +1 input margin +1 input border */
+ left: 16px;
+ width: 30px;
+ height: 30px;
+ line-height: 2.1;
+ text-align: center;
+ color: #72777c;
+}
+
+#available-widgets-filter .clear-results,
+#available-menu-items-search .clear-results {
+ position: absolute;
+ top: 15px; /* 13 container padding +1 input margin +1 input border */
+ right: 16px;
+ width: 30px;
+ height: 30px;
+ padding: 0;
+ border: 0;
+ cursor: pointer;
+ background: none;
+ color: #a00;
+ text-decoration: none;
+ outline: 0;
+}
+
+#available-widgets-filter .clear-results,
+#available-menu-items-search .clear-results,
+#available-menu-items-search.loading .clear-results.is-visible {
+ display: none;
+}
+
+#available-widgets-filter .clear-results.is-visible,
+#available-menu-items-search .clear-results.is-visible {
+ display: block;
+}
+
+#available-widgets-filter .clear-results:before,
+#available-menu-items-search .clear-results:before {
+ content: "\f335";
+ font: normal 20px/1 dashicons;
+ vertical-align: middle;
+ -webkit-font-smoothing: antialiased;
+ -moz-osx-font-smoothing: grayscale;
+}
+
+#available-widgets-filter .clear-results:hover,
+#available-widgets-filter .clear-results:focus,
+#available-menu-items-search .clear-results:hover,
+#available-menu-items-search .clear-results:focus {
+ color: #dc3232;
+}
+
+#available-widgets-filter .clear-results:focus,
+#available-menu-items-search .clear-results:focus {
+ box-shadow:
+ 0 0 0 1px #5b9dd9,
+ 0 0 2px 1px rgba(30, 140, 190, 0.8);
+}
+
+#available-menu-items-search .search-icon:after,
+#available-widgets-filter .search-icon:after,
+.themes-filter-bar .search-icon:after {
+ content: "\f179";
+ font: normal 20px/1 dashicons;
+ vertical-align: middle;
+ -webkit-font-smoothing: antialiased;
+ -moz-osx-font-smoothing: grayscale;
+}
+
+.themes-filter-bar .search-icon {
+ position: absolute;
+ top: 7px;
+ left: 26px;
+ z-index: 1;
+ color: #72777c;
+ height: 30px;
+ width: 30px;
+ line-height: 2;
+ text-align: center;
+}
+
+.no-widgets-found-message {
+ display: none;
+ margin: 0;
+ padding: 0 15px;
+ line-height: inherit;
+}
+
+.no-widgets-found .no-widgets-found-message {
+ display: block;
+}
+
+#available-widgets .widget-top,
+#available-widgets .widget-top:hover,
+#available-menu-items .item-top,
+#available-menu-items .item-top:hover {
+ border: none;
+ background: transparent;
+ box-shadow: none;
+}
+
+#available-widgets .widget-tpl,
+#available-menu-items .item-tpl {
+ position: relative;
+ padding: 15px 15px 15px 60px;
+ background: #fff;
+ border-bottom: 1px solid #ddd;
+ border-left: 4px solid #fff;
+ transition:
+ .15s color ease-in-out,
+ .15s background-color ease-in-out,
+ .15s border-color ease-in-out;
+ cursor: pointer;
+ display: none;
+}
+
+#available-widgets .widget,
+#available-menu-items .item {
+ position: static;
+}
+
+
+/* Responsive */
+.customize-controls-preview-toggle {
+ display: none;
+}
+
+@media only screen and (max-width: 782px) {
+ .wp-customizer .theme:not(.active):hover .theme-actions,
+ .wp-customizer .theme:not(.active):focus .theme-actions {
+ display: block;
+ }
+
+ .wp-customizer .theme-browser .theme.active .theme-name span {
+ display: inline;
+ }
+
+ .customize-control-header button.random .dice {
+ margin-top: 0;
+ }
+
+ .customize-control-radio .customize-inside-control-row,
+ .customize-control-checkbox .customize-inside-control-row,
+ .customize-control-nav_menu_auto_add .customize-inside-control-row {
+ margin-left: 32px;
+ }
+
+ .customize-control-radio input,
+ .customize-control-checkbox input,
+ .customize-control-nav_menu_auto_add input {
+ margin-left: -32px;
+ }
+
+ .customize-control input[type="radio"] + label + br,
+ .customize-control input[type="checkbox"] + label + br {
+ line-height: 2.5; /* For widgets checkboxes */
+ }
+
+ .customize-control .date-time-fields select {
+ height: 39px;
+ }
+
+ .date-time-fields .date-input.month {
+ width: 79px;
+ }
+
+ .date-time-fields .date-input.day,
+ .date-time-fields .date-input.hour,
+ .date-time-fields .date-input.minute {
+ width: 55px;
+ }
+
+ .date-time-fields .date-input.year {
+ width: 80px;
+ }
+
+ .date-time-fields .date-timezone {
+ line-height: 3.2;
+ }
+
+ #customize-control-changeset_preview_link a {
+ bottom: 16px;
+ }
+
+ .preview-link-wrapper .customize-copy-preview-link.preview-control-element.button {
+ bottom: 10px;
+ }
+
+ .media-widget-control .media-widget-buttons .button.edit-media,
+ .media-widget-control .media-widget-buttons .button.change-media,
+ .media-widget-control .media-widget-buttons .button.select-media {
+ margin-top: 12px;
+ }
+
+ .wp-core-ui .themes-filter-bar .feature-filter-toggle {
+ margin: 3px 0 3px 25px;
+ }
+}
+
+@media screen and (max-width: 1200px) {
+ .outer-section-open .wp-full-overlay.expanded.preview-mobile .wp-full-overlay-main,
+ .adding-menu-items .wp-full-overlay.expanded.preview-mobile .wp-full-overlay-main,
+ .adding-widget .wp-full-overlay.expanded.preview-mobile .wp-full-overlay-main {
+ left: 67%;
+ }
+}
+
+@media screen and (max-width: 640px) {
+
+ /* when the sidebar is collapsed and switching to responsive view,
+ bring it back see ticket #35220 */
+ .wp-full-overlay.collapsed #customize-controls {
+ margin-left: 0;
+ }
+
+ .wp-full-overlay-sidebar .wp-full-overlay-sidebar-content {
+ bottom: 0;
+ }
+
+ .customize-controls-preview-toggle {
+ display: block;
+ position: absolute;
+ top: 0;
+ left: 48px;
+ line-height: 3.2;
+ font-size: 14px;
+ padding: 0 12px;
+ margin: 0;
+ height: 45px;
+ background: #eee;
+ border: 0;
+ border-right: 1px solid #ddd;
+ color: #555d66;
+ cursor: pointer;
+ transition: color .1s ease-in-out, background .1s ease-in-out;
+ }
+
+ #customize-footer-actions,
+ /*#customize-preview,*/
+ .customize-controls-preview-toggle .controls,
+ .preview-only .wp-full-overlay-sidebar-content,
+ .preview-only .customize-controls-preview-toggle .preview {
+ display: none;
+ }
+
+ .preview-only #customize-save-button-wrapper {
+ margin-top: -46px;
+ }
+
+ .customize-controls-preview-toggle .preview:before,
+ .customize-controls-preview-toggle .controls:before {
+ font: normal 20px/1 dashicons;
+ content: "\f177";
+ position: relative;
+ top: 4px;
+ margin-right: 6px;
+ }
+
+ .customize-controls-preview-toggle .controls:before {
+ content: "\f540";
+ }
+
+ .preview-only #customize-controls {
+ height: 45px;
+ }
+
+ .preview-only #customize-preview,
+ .preview-only .customize-controls-preview-toggle .controls {
+ display: block;
+ }
+
+ .wp-core-ui.wp-customizer .button {
+ padding: 6px 14px;
+ line-height: normal;
+ font-size: 14px;
+ vertical-align: middle;
+ height: auto;
+ }
+
+ #publish-settings {
+ height: 31px;
+ }
+
+ #customize-control-changeset_status .customize-inside-control-row {
+ padding-top: 15px;
+ }
+
+ body.adding-widget div#available-widgets,
+ body.adding-menu-items div#available-menu-items,
+ body.outer-section-open div#customize-sidebar-outer-content {
+ width: 100%;
+ }
+
+ #available-widgets .customize-section-title,
+ #available-menu-items .customize-section-title {
+ display: block;
+ margin: 0;
+ }
+
+ #available-widgets .customize-section-back,
+ #available-menu-items .customize-section-back {
+ height: 69px;
+ }
+
+ #available-widgets .customize-section-title h3,
+ #available-menu-items .customize-section-title h3 {
+ font-size: 20px;
+ font-weight: 200;
+ padding: 9px 10px 12px 14px;
+ margin: 0;
+ line-height: 24px;
+ color: #555d66;
+ display: block;
+ overflow: hidden;
+ white-space: nowrap;
+ text-overflow: ellipsis;
+ }
+
+ #available-widgets .customize-section-title .customize-action,
+ #available-menu-items .customize-section-title .customize-action {
+ font-size: 13px;
+ display: block;
+ font-weight: 400;
+ overflow: hidden;
+ white-space: nowrap;
+ text-overflow: ellipsis;
+ }
+
+ #available-widgets-filter {
+ position: relative;
+ width: 100%;
+ height: auto;
+ }
+
+ #available-widgets-list {
+ top: 130px;
+ }
+
+ #available-menu-items-search .clear-results,
+ #available-menu-items-search .search-icon {
+ top: 85px; /* 70 section title height + 13 container padding +1 input margin +1 input border */
+ }
+
+ .reorder,
+ .reordering .reorder-done {
+ padding: 8px;
+ }
+
+ .wp-core-ui .themes-filter-bar .feature-filter-toggle {
+ margin: 0;
+ }
+
+ .theme-browser .theme.active .theme-actions,
+ .wp-customizer .theme-browser .theme .theme-actions {
+ padding: 9px 15px;
+ box-shadow: inset 0 1px 0 rgba(0, 0, 0, 0.1);
+ }
+}
+
+@media screen and (max-width: 600px) {
+ .theme-browser .theme.active .theme-actions,
+ .wp-customizer .theme-browser .theme .theme-actions {
+ padding: 8px 15px;
+ box-shadow: none;
+ }
+
+ .wp-full-overlay.expanded {
+ margin-left: 0;
+ }
+
+ body.adding-widget div#available-widgets,
+ body.adding-menu-items div#available-menu-items,
+ body.outer-section-open div#customize-sidebar-outer-content {
+ top: 46px;
+ z-index: 10;
+ }
+
+ body.wp-customizer .wp-full-overlay.expanded #customize-sidebar-outer-content {
+ left: -100%;
+ }
+
+ body.wp-customizer.outer-section-open .wp-full-overlay.expanded #customize-sidebar-outer-content {
+ left: 0;
+ }
+}
diff --git a/www/crm/wp-admin/css/customize-controls.min.css b/www/crm/wp-admin/css/customize-controls.min.css
new file mode 100644
index 00000000..f3a08985
--- /dev/null
+++ b/www/crm/wp-admin/css/customize-controls.min.css
@@ -0,0 +1,2 @@
+/*! This file is auto-generated */
+body{overflow:hidden;-webkit-text-size-adjust:100%}.customize-controls-close,.widget-control-actions a{text-decoration:none}#customize-controls h3{font-size:14px}#customize-controls img{max-width:100%}#customize-controls .submit{text-align:center}#customize-controls #customize-notifications-area .notice.notification-overlay.notification-changeset-locked{background-color:rgba(0,0,0,.7);padding:25px}#customize-controls #customize-notifications-area .notice.notification-overlay.notification-changeset-locked .customize-changeset-locked-message{margin-left:auto;margin-right:auto;max-width:366px;min-height:64px;width:auto;padding:25px 25px 25px 109px;position:relative;background:#fff;box-shadow:0 3px 6px rgba(0,0,0,.3);line-height:1.5;overflow-y:auto;text-align:left;top:calc(50% - 100px)}#customize-controls #customize-notifications-area .notice.notification-overlay.notification-changeset-locked .currently-editing{margin-top:0}#customize-controls #customize-notifications-area .notice.notification-overlay.notification-changeset-locked .action-buttons{margin-bottom:0}.customize-changeset-locked-avatar{width:64px;position:absolute;left:25px;top:25px}.wp-core-ui.wp-customizer .customize-changeset-locked-message a.button{margin-right:10px;margin-top:0}#customize-controls .description{color:#555d66}#customize-save-button-wrapper{float:right;margin-top:9px}body:not(.ready) #customize-save-button-wrapper .save{visibility:hidden}#customize-save-button-wrapper .save{float:left;border-radius:3px;box-shadow:none;margin-top:0}#customize-save-button-wrapper .save:focus,#publish-settings:focus{box-shadow:0 1px 0 #0073aa,0 0 2px 1px #33b3db}#customize-save-button-wrapper .save.has-next-sibling{border-radius:3px 0 0 3px}#customize-sidebar-outer-content{position:absolute;top:0;bottom:0;left:0;visibility:hidden;overflow-x:hidden;overflow-y:auto;width:100%;margin:0;z-index:-1;background:#eee;transition:left .18s;border-right:1px solid #ddd;border-left:1px solid #ddd;height:100%}#customize-theme-controls .control-section-outer{display:none!important}#customize-outer-theme-controls .accordion-section-content{padding:12px}#customize-outer-theme-controls .accordion-section-content.open{display:block}.outer-section-open .wp-full-overlay.expanded #customize-sidebar-outer-content{visibility:visible;left:100%;transition:left .18s}.customize-outer-pane-parent{margin:0}.outer-section-open .wp-full-overlay.expanded .wp-full-overlay-main{left:300px;opacity:.4}.adding-menu-items .wp-full-overlay.expanded.preview-mobile .wp-full-overlay-main,.adding-menu-items .wp-full-overlay.expanded.preview-tablet .wp-full-overlay-main,.adding-widget .wp-full-overlay.expanded.preview-mobile .wp-full-overlay-main,.adding-widget .wp-full-overlay.expanded.preview-tablet .wp-full-overlay-main,.outer-section-open .wp-full-overlay.expanded.preview-mobile .wp-full-overlay-main,.outer-section-open .wp-full-overlay.expanded.preview-tablet .wp-full-overlay-main{left:64%}#customize-outer-theme-controls li.notice{padding-top:8px;padding-bottom:8px;margin-left:0;margin-bottom:10px}#publish-settings{text-indent:0;border-radius:0 3px 3px 0;padding-left:0;padding-right:0;box-shadow:none;font-size:14px;width:30px;float:left;transform:none;margin-top:0}body.trashing #customize-save-button-wrapper .save,body.trashing #publish-settings,body:not(.ready) #publish-settings{display:none}#customize-header-actions .spinner{margin-top:13px;margin-right:4px}.saving #customize-header-actions .spinner,.trashing #customize-header-actions .spinner{visibility:visible}#customize-header-actions{border-bottom:1px solid #ddd}#customize-controls .wp-full-overlay-sidebar-content{overflow-y:auto;overflow-x:hidden}.outer-section-open #customize-controls .wp-full-overlay-sidebar-content{background:#eee}#customize-controls .customize-info{border:none;border-bottom:1px solid #ddd;margin-bottom:15px}#customize-control-changeset_preview_link input,#customize-control-changeset_status .customize-inside-control-row{background-color:#fff;border-bottom:1px solid #ddd;box-sizing:content-box;width:100%;margin-left:-12px;padding-left:12px;padding-right:12px}#customize-control-trash_changeset{margin-top:20px}#customize-control-trash_changeset .button-link{position:relative;padding-left:24px;display:inline-block}#customize-control-trash_changeset .button-link:before{content:"\f182";font:normal 22px dashicons;text-decoration:none;position:absolute;left:0;top:-2px}#customize-controls .date-input:invalid{border-color:#dc3232}#customize-control-changeset_status .customize-inside-control-row{padding-top:10px;padding-bottom:10px;font-weight:500}#customize-control-changeset_status .customize-inside-control-row:first-of-type{border-top:1px solid #ddd}#customize-control-changeset_status .customize-control-title{margin-bottom:6px}#customize-control-changeset_status input{margin-left:0}#customize-control-changeset_preview_link{position:relative;display:block}.preview-link-wrapper .customize-copy-preview-link.preview-control-element.button{margin:0;position:absolute;bottom:9px;right:0}.preview-link-wrapper{position:relative}.customize-copy-preview-link:after,.customize-copy-preview-link:before{content:"";height:28px;position:absolute;background:#fff;top:-1px}.customize-copy-preview-link:before{left:-10px;width:9px;opacity:.75}.customize-copy-preview-link:after{left:-5px;width:4px;opacity:.8}#customize-control-changeset_preview_link input{line-height:2.5;border-top:1px solid #ddd;border-left:none;border-right:none;text-indent:-999px;color:#fff}#customize-control-changeset_preview_link label{position:relative;display:block}#customize-control-changeset_preview_link a{display:inline-block;position:absolute;white-space:nowrap;overflow:hidden;width:90%;bottom:14px;font-size:14px;text-decoration:none}#customize-control-changeset_preview_link a.disabled,#customize-control-changeset_preview_link a.disabled:active,#customize-control-changeset_preview_link a.disabled:focus,#customize-control-changeset_preview_link a.disabled:visited{color:#000;opacity:.4;cursor:default;outline:0;box-shadow:none}#sub-accordion-section-publish_settings .customize-section-description-container{display:none}#customize-controls .customize-info.section-meta{margin-bottom:15px}.customize-control-date_time .customize-control-description+.date-time-fields.includes-time{margin-top:10px}.customize-control.customize-control-date_time .date-time-fields .date-input.day{margin-right:0}.date-time-fields .date-input.month{width:auto;margin:0}.date-time-fields .date-input.day,.date-time-fields .date-input.hour,.date-time-fields .date-input.minute{width:46px}.date-time-fields .date-input.year{width:60px}.date-time-fields .date-input.meridian{width:auto;margin:0}.date-time-fields .time-row{margin-top:12px}.date-time-fields .date-timezone{line-height:2.2;text-decoration:none}#customize-control-changeset_preview_link{margin-top:6px}#customize-control-changeset_status{margin-bottom:0;padding-bottom:0}#customize-control-changeset_scheduled_date{box-sizing:content-box;width:100%;margin-left:-12px;padding:12px;background:#fff;border-bottom:1px solid #ddd;margin-bottom:0}#customize-control-changeset_scheduled_date .customize-control-description{font-style:normal}#customize-controls .customize-info.is-in-view,#customize-controls .customize-section-title.is-in-view{position:absolute;z-index:9;width:100%;box-shadow:0 1px 0 rgba(0,0,0,.1)}#customize-controls .customize-section-title.is-in-view{margin-top:0}#customize-controls .customize-info.is-in-view+.accordion-section{margin-top:15px}#customize-controls .customize-info.is-sticky,#customize-controls .customize-section-title.is-sticky{position:fixed;top:46px}#customize-controls .customize-info .accordion-section-title{background:#fff;color:#555d66;border-left:none;border-right:none;border-bottom:none;cursor:default}#customize-controls .customize-info .accordion-section-title:focus:after,#customize-controls .customize-info .accordion-section-title:hover:after,#customize-controls .customize-info.open .accordion-section-title:after{color:#32373c}#customize-controls .customize-info .accordion-section-title:after{display:none}#customize-controls .customize-info .preview-notice{font-size:13px;line-height:1.9}#customize-controls .customize-info .panel-title,#customize-controls .customize-pane-child .customize-section-title h3,#customize-controls .customize-pane-child h3.customize-section-title,#customize-outer-theme-controls .customize-pane-child .customize-section-title h3,#customize-outer-theme-controls .customize-pane-child h3.customize-section-title{font-size:20px;font-weight:200;line-height:26px;display:block;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}#customize-controls .customize-section-title span.customize-action{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}#customize-controls .customize-info .customize-help-toggle{position:absolute;top:4px;right:1px;padding:20px 20px 10px 10px;width:20px;height:20px;cursor:pointer;box-shadow:none;-webkit-appearance:none;background:0 0;color:#555d66;border:none}#customize-controls .customize-info .customize-help-toggle:before{position:absolute;top:5px;left:6px}#customize-controls .customize-info .customize-help-toggle:focus,#customize-controls .customize-info .customize-help-toggle:hover,#customize-controls .customize-info.open .customize-help-toggle{color:#0073aa}#customize-controls .customize-info .customize-panel-description,#customize-controls .customize-info .customize-section-description,#customize-controls .no-widget-areas-rendered-notice,#customize-outer-theme-controls .customize-info .customize-section-description{color:#555d66;display:none;background:#fff;padding:12px 15px;border-top:1px solid #ddd}#customize-controls .customize-info .customize-panel-description.open+.no-widget-areas-rendered-notice{border-top:none}.no-widget-areas-rendered-notice{font-style:italic}.no-widget-areas-rendered-notice p:first-child{margin-top:0}.no-widget-areas-rendered-notice p:last-child{margin-bottom:0}#customize-controls .customize-info .customize-section-description{margin-bottom:15px}#customize-controls .customize-info .customize-panel-description p:first-child,#customize-controls .customize-info .customize-section-description p:first-child{margin-top:0}#customize-controls .customize-info .customize-panel-description p:last-child,#customize-controls .customize-info .customize-section-description p:last-child{margin-bottom:0}#customize-controls .current-panel .control-section>h3.accordion-section-title{padding-right:30px}#customize-outer-theme-controls .control-section,#customize-theme-controls .control-section{border:none}#customize-outer-theme-controls .accordion-section-title,#customize-theme-controls .accordion-section-title{color:#555d66;background-color:#fff;border-bottom:1px solid #ddd;border-left:4px solid #fff;transition:.15s color ease-in-out,.15s background-color ease-in-out,.15s border-color ease-in-out}#customize-controls #customize-theme-controls .customize-themes-panel .accordion-section-title{color:#555;background-color:#fff;border-left:4px solid #fff}#customize-outer-theme-controls .accordion-section-title:after,#customize-theme-controls .accordion-section-title:after{content:"\f345";color:#a0a5aa}#customize-outer-theme-controls .accordion-section-content,#customize-theme-controls .accordion-section-content{color:#555d66;background:0 0}#customize-controls .control-section .accordion-section-title:focus,#customize-controls .control-section .accordion-section-title:hover,#customize-controls .control-section.open .accordion-section-title,#customize-controls .control-section:hover>.accordion-section-title{color:#0073aa;background:#f3f3f5;border-left-color:#0073aa}#accordion-section-themes+.control-section{border-top:1px solid #ddd}.js .control-section .accordion-section-title:focus,.js .control-section .accordion-section-title:hover,.js .control-section.open .accordion-section-title,.js .control-section:hover .accordion-section-title{background:#f3f3f5}#customize-outer-theme-controls .control-section .accordion-section-title:focus:after,#customize-outer-theme-controls .control-section .accordion-section-title:hover:after,#customize-outer-theme-controls .control-section.open .accordion-section-title:after,#customize-outer-theme-controls .control-section:hover>.accordion-section-title:after,#customize-theme-controls .control-section .accordion-section-title:focus:after,#customize-theme-controls .control-section .accordion-section-title:hover:after,#customize-theme-controls .control-section.open .accordion-section-title:after,#customize-theme-controls .control-section:hover>.accordion-section-title:after{color:#0073aa}#customize-theme-controls .control-section.open{border-bottom:1px solid #eee}#customize-outer-theme-controls .control-section.open .accordion-section-title,#customize-theme-controls .control-section.open .accordion-section-title{border-bottom-color:#eee!important}#customize-theme-controls .control-section:last-of-type.open,#customize-theme-controls .control-section:last-of-type>.accordion-section-title{border-bottom-color:#ddd}#customize-theme-controls .control-panel-content:not(.control-panel-nav_menus) .control-section:nth-child(2),#customize-theme-controls .control-panel-nav_menus .control-section-nav_menu,#customize-theme-controls .control-section-nav_menu_locations .accordion-section-title{border-top:1px solid #ddd}#customize-theme-controls .control-panel-nav_menus .control-section-nav_menu+.control-section-nav_menu{border-top:none}#customize-theme-controls>ul{margin:0}#customize-theme-controls .accordion-section-content{position:absolute;top:0;left:100%;width:100%;margin:0;padding:12px;box-sizing:border-box}#customize-info,#customize-theme-controls .customize-pane-child,#customize-theme-controls .customize-pane-parent{overflow:visible;width:100%;margin:0;padding:0;box-sizing:border-box;transition:.18s transform cubic-bezier(.645,.045,.355,1)}#customize-theme-controls .customize-pane-child.skip-transition{transition:none}#customize-info,#customize-theme-controls .customize-pane-parent{position:relative;visibility:visible;height:auto;max-height:none;overflow:auto;transform:none}#customize-theme-controls .customize-pane-child{position:absolute;top:0;left:0;visibility:hidden;height:0;max-height:none;overflow:hidden;transform:translateX(100%)}#customize-theme-controls .customize-pane-child.current-panel,#customize-theme-controls .customize-pane-child.open{transform:none}.in-sub-panel #customize-info,.in-sub-panel #customize-theme-controls .customize-pane-parent,.in-sub-panel.section-open #customize-theme-controls .customize-pane-child.current-panel,.section-open #customize-info,.section-open #customize-theme-controls .customize-pane-parent{visibility:hidden;height:0;overflow:hidden;transform:translateX(-100%)}#customize-theme-controls .customize-pane-child.busy,#customize-theme-controls .customize-pane-child.current-panel,#customize-theme-controls .customize-pane-child.open,.busy.section-open.in-sub-panel #customize-theme-controls .customize-pane-child.current-panel,.in-sub-panel #customize-info.busy,.in-sub-panel #customize-theme-controls .customize-pane-parent.busy,.section-open #customize-info.busy,.section-open #customize-theme-controls .customize-pane-parent.busy{visibility:visible;height:auto;overflow:auto}#customize-theme-controls .customize-pane-child.accordion-section-content,#customize-theme-controls .customize-pane-child.accordion-sub-container{display:block;overflow-x:hidden}#customize-theme-controls .customize-pane-child.accordion-section-content{padding:12px}#customize-theme-controls .customize-pane-child.menu li{position:static}.control-section-nav_menu .customize-section-description-container,.control-section-new_menu .customize-section-description-container,.customize-section-description-container{margin-bottom:15px}.control-section-nav_menu .customize-control,.control-section-new_menu .customize-control{margin-bottom:0}.customize-section-title{margin:-12px -12px 0 -12px;border-bottom:1px solid #ddd;background:#fff}div.customize-section-description{margin-top:22px}.customize-info div.customize-section-description{margin-top:0}div.customize-section-description p:first-child{margin-top:0}div.customize-section-description p:last-child{margin-bottom:0}#customize-theme-controls .customize-themes-panel h3.customize-section-title:first-child{border-bottom:1px solid #ddd;padding:12px 12px 12px 12px}.ios #customize-theme-controls .customize-themes-panel h3.customize-section-title:first-child{padding:12px 12px 13px 12px}.customize-section-title h3,h3.customize-section-title{padding:10px 10px 12px 14px;margin:0;line-height:21px;color:#555d66}.accordion-sub-container.control-panel-content{display:none;position:absolute;top:0;width:100%}.accordion-sub-container.control-panel-content.busy{display:block}.current-panel .accordion-sub-container.control-panel-content{width:100%}.customize-controls-close{display:block;position:absolute;top:0;left:0;width:45px;height:41px;padding:0 2px 0 0;background:#eee;border:none;border-top:4px solid #eee;border-right:1px solid #ddd;color:#444;text-align:left;cursor:pointer;transition:color .15s ease-in-out,border-color .15s ease-in-out,background .15s ease-in-out;box-sizing:content-box}.customize-panel-back,.customize-section-back{display:block;float:left;width:48px;height:71px;padding:0 24px 0 0;margin:0;background:#fff;border:none;border-right:1px solid #ddd;border-left:4px solid #fff;box-shadow:none;cursor:pointer;transition:color .15s ease-in-out,border-color .15s ease-in-out,background .15s ease-in-out}.customize-section-back{height:74px}.ios .customize-panel-back{display:none}.ios .expanded.in-sub-panel .customize-panel-back{display:block}#customize-controls .panel-meta.customize-info .accordion-section-title{margin-left:48px;border-left:none}#customize-controls .cannot-expand:hover .accordion-section-title,#customize-controls .panel-meta.customize-info .accordion-section-title:hover{background:#fff;color:#555d66;border-left-color:#fff}.customize-controls-close:focus,.customize-controls-close:hover,.customize-controls-preview-toggle:focus,.customize-controls-preview-toggle:hover{background:#fff;color:#0073aa;border-top-color:#0073aa;outline:0;box-shadow:none}.customize-panel-back:focus,.customize-panel-back:hover,.customize-section-back:focus,.customize-section-back:hover{color:#0073aa;background:#f3f3f5;border-left-color:#0073aa;outline:0;box-shadow:none}.customize-controls-close:before{font:normal 22px/45px dashicons;content:"\f335";position:relative;top:-3px;left:13px}.customize-panel-back:before,.customize-section-back:before{font:normal 20px/72px dashicons;content:"\f341";position:relative;left:9px}.wp-full-overlay-sidebar .wp-full-overlay-header{background-color:#eee;transition:padding ease-in-out .18s}.in-sub-panel .wp-full-overlay-sidebar .wp-full-overlay-header{padding-left:62px}p.customize-section-description{font-style:normal;margin-top:22px;margin-bottom:0}.customize-section-description ul{margin-left:1em}.customize-section-description ul>li{list-style:disc}.section-description-buttons{text-align:right}.section-description-buttons button.button-link{color:#0073aa;text-decoration:underline}.customize-control{width:100%;float:left;clear:both;margin-bottom:12px}.customize-control input[type=checkbox],.customize-control input[type=radio],.customize-control select{line-height:2}.customize-control input[type=email],.customize-control input[type=number],.customize-control input[type=password],.customize-control input[type=search],.customize-control input[type=tel],.customize-control input[type=text],.customize-control input[type=url]{width:100%;line-height:1.3;margin:0}.customize-control-hidden{margin:0}.customize-control-textarea textarea{width:100%;resize:vertical}.customize-control select{width:100%;height:28px;line-height:2}.customize-control select[multiple]{height:auto}.customize-control-title{display:block;font-size:14px;line-height:1.75;font-weight:600;margin-bottom:4px}.customize-control-description{display:block;font-style:italic;line-height:1.4;margin-top:0;margin-bottom:5px}.customize-section-description a.external-link:after{font:16px/11px dashicons;content:"\f310";top:3px;position:relative;padding-left:3px;display:inline-block;text-decoration:none}.customize-control-color .color-picker,.customize-control-upload div{line-height:28px}.customize-control .customize-inside-control-row{line-height:1.6;display:block;margin-left:24px;padding-top:6px;padding-bottom:6px}.customize-control-checkbox input,.customize-control-nav_menu_auto_add input,.customize-control-radio input{margin-right:4px;margin-left:-24px}.customize-control-radio{padding:5px 0 10px}.customize-control-radio .customize-control-title{margin-bottom:0;line-height:1.6}.customize-control-radio .customize-control-title+.customize-control-description{margin-top:7px}.customize-control-checkbox label,.customize-control-radio label{vertical-align:top}.customize-control .attachment-thumb.type-icon{float:left;margin:10px;width:auto}.customize-control .attachment-title{font-weight:600;margin:0;padding:5px 10px}.customize-control .attachment-meta{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin:0;padding:0 10px}.customize-control .attachment-meta-title{padding-top:7px}.customize-control .thumbnail-image,.customize-control .wp-media-wrapper.wp-video,.customize-control-header .current{line-height:0}.customize-control-site_icon .favicon-preview .browser-preview{vertical-align:top}.customize-control .thumbnail-image img{cursor:pointer}#customize-controls .thumbnail-audio .thumbnail{max-width:64px;max-height:64px;margin:10px;float:left}#available-menu-items .accordion-section-content .new-content-item,.customize-control-dropdown-pages .new-content-item{width:calc(100% - 30px);padding:8px 15px;position:absolute;bottom:0;z-index:10;background:#eee;display:flex}.customize-control-dropdown-pages .new-content-item{width:100%;padding:5px 0 5px 1px;position:relative}#available-menu-items .new-content-item .create-item-input,.customize-control-dropdown-pages .new-content-item .create-item-input{flex-grow:10}#available-menu-items .new-content-item .add-content,.customize-control-dropdown-pages .new-content-item .add-content{margin:2px 0 2px 6px;flex-grow:1}.customize-control-dropdown-pages .new-content-item .create-item-input.invalid{border:1px solid #dc3232}.customize-control-dropdown-pages .add-new-toggle{margin-left:1px;font-weight:600;line-height:2.2}#customize-preview iframe{width:100%;height:100%;position:absolute}#customize-preview iframe+iframe{visibility:hidden}.wp-full-overlay-sidebar{background:#eee;border-right:1px solid #ddd}#customize-controls .customize-control-notifications-container{margin:4px 0 8px 0;padding:0;cursor:default}#customize-controls .customize-control-widget_form.has-error .widget .widget-top,.customize-control-nav_menu_item.has-error .menu-item-bar .menu-item-handle{box-shadow:inset 0 0 0 2px #dc3232;transition:.15s box-shadow linear}#customize-controls .customize-control-notifications-container li.notice{list-style:none;margin:0 0 6px 0;padding:9px 14px;overflow:hidden}#customize-controls .customize-control-notifications-container .notice.is-dismissible{padding-right:38px}.customize-control-notifications-container li.notice:last-child{margin-bottom:0}#customize-controls .customize-control-nav_menu_item .customize-control-notifications-container{margin-top:0}#customize-controls .customize-control-widget_form .customize-control-notifications-container{margin-top:8px}.customize-control-text.has-error input{outline:2px solid #dc3232}#customize-controls #customize-notifications-area{position:absolute;top:46px;width:100%;border-bottom:1px solid #ddd;display:block;padding:0;margin:0}.wp-full-overlay.collapsed #customize-controls #customize-notifications-area{display:none!important}#customize-controls #customize-notifications-area:not(.has-overlay-notifications),#customize-controls .customize-section-title>.customize-control-notifications-container:not(.has-overlay-notifications),#customize-controls .panel-meta>.customize-control-notifications-container:not(.has-overlay-notifications){max-height:210px;overflow-x:hidden;overflow-y:auto}#customize-controls #customize-notifications-area .notice,#customize-controls #customize-notifications-area>ul,#customize-controls .customize-section-title>.customize-control-notifications-container,#customize-controls .customize-section-title>.customize-control-notifications-container .notice,#customize-controls .panel-meta>.customize-control-notifications-container,#customize-controls .panel-meta>.customize-control-notifications-container .notice{margin:0}#customize-controls .customize-section-title>.customize-control-notifications-container,#customize-controls .panel-meta>.customize-control-notifications-container{border-top:1px solid #ddd}#customize-controls #customize-notifications-area .notice,#customize-controls .customize-section-title>.customize-control-notifications-container .notice,#customize-controls .panel-meta>.customize-control-notifications-container .notice{padding:9px 14px}#customize-controls #customize-notifications-area .notice.is-dismissible,#customize-controls .customize-section-title>.customize-control-notifications-container .notice.is-dismissible,#customize-controls .panel-meta>.customize-control-notifications-container .notice.is-dismissible{padding-right:38px}#customize-controls #customize-notifications-area .notice+.notice,#customize-controls .customize-section-title>.customize-control-notifications-container .notice+.notice,#customize-controls .panel-meta>.customize-control-notifications-container .notice+.notice{margin-top:1px}@keyframes customize-fade-in{0%{opacity:0}100%{opacity:1}}#customize-controls #customize-notifications-area .notice.notification-overlay,#customize-controls .notice.notification-overlay{margin:0;border-left:0}#customize-controls .customize-control-notifications-container.has-overlay-notifications{animation:customize-fade-in .5s;z-index:30}#customize-controls #customize-notifications-area .notice.notification-overlay .notification-message{clear:both;color:#191e23;font-size:18px;font-style:normal;margin:0;padding:2em 0;text-align:center;width:100%;display:block;top:50%;position:relative}#customize-control-show_on_front.has-error{margin-bottom:0}#customize-control-show_on_front.has-error .customize-control-notifications-container{margin-top:12px}.accordion-section .dropdown{float:left;display:block;position:relative;cursor:pointer}.accordion-section .dropdown-content{overflow:hidden;float:left;min-width:30px;height:16px;line-height:16px;margin-right:16px;padding:4px 5px;border:2px solid #eee;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.customize-control .dropdown-arrow{position:absolute;top:0;bottom:0;right:0;width:20px;background:#eee}.customize-control .dropdown-arrow:after{content:"\f140";font:normal 20px/1 dashicons;speak:none;display:block;padding:0;text-indent:0;text-align:center;position:relative;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-decoration:none!important;color:#32373c}.customize-control .dropdown-status{color:#32373c;background:#eee;display:none;max-width:112px}.customize-control-color .dropdown{margin-right:5px;margin-bottom:5px}.customize-control-color .dropdown .dropdown-content{background-color:#555d66;border:1px solid rgba(0,0,0,.15)}.customize-control-color .dropdown:hover .dropdown-content{border-color:rgba(0,0,0,.25)}.ios .wp-full-overlay{position:relative}.ios #customize-controls .wp-full-overlay-sidebar-content{-webkit-overflow-scrolling:touch}.customize-control .actions .button{margin-top:12px}.customize-control-header .actions,.customize-control-header .uploaded{margin-bottom:18px}.customize-control-header .default button:not(.random),.customize-control-header .uploaded button:not(.random){width:100%;padding:0;margin:0;background:0 0;border:none;color:inherit;cursor:pointer}.customize-control-header button img{display:block}.customize-control .attachment-media-view .default-button,.customize-control .attachment-media-view .remove-button,.customize-control .attachment-media-view .upload-button,.customize-control-header button.new,.customize-control-header button.remove{width:auto;height:auto;white-space:normal}.customize-control .attachment-media-view .thumbnail,.customize-control-header .current .container{overflow:hidden}.customize-control .attachment-media-view .button-add-media,.customize-control .attachment-media-view .placeholder,.customize-control-header .placeholder{width:100%;position:relative;text-align:center;cursor:default;border:1px dashed #b4b9be;box-sizing:border-box;padding:9px 0;line-height:1.6}.customize-control .attachment-media-view .button-add-media{cursor:pointer;background-color:#edeff0;color:#32373c}.customize-control .attachment-media-view .button-add-media:hover{background-color:#fbfbfc}.customize-control .attachment-media-view .button-add-media:focus{background-color:#fbfbfc;border-style:solid;border-color:#5b9dd9;box-shadow:0 0 3px rgba(0,115,170,.8);outline:2px solid transparent;outline-offset:-2px}.customize-control-header .inner{display:none;position:absolute;width:100%;color:#555d66;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.customize-control-header .inner,.customize-control-header .inner .dashicons{line-height:20px;top:8px}.customize-control-header .list .inner,.customize-control-header .list .inner .dashicons{top:9px}.customize-control-header .header-view{position:relative;width:100%;margin-bottom:12px}.customize-control-header .header-view:last-child{margin-bottom:0}.customize-control-header .header-view:after{border:0}.customize-control-header .header-view.selected .choice:focus{outline:0}.customize-control-header .header-view.selected:after{content:"";position:absolute;height:auto;top:0;left:0;bottom:0;right:0;border:4px solid #00a0d2;border-radius:2px}.customize-control-header .header-view.button.selected{border:0}.customize-control-header .uploaded .header-view .close{font-size:20px;color:#fff;background:#555d66;background:rgba(0,0,0,.5);position:absolute;top:10px;left:-999px;z-index:1;width:26px;height:26px;cursor:pointer}.customize-control-header .header-view .close:focus,.customize-control-header .header-view:hover .close{left:auto;right:10px}.customize-control-header .header-view .close:focus{outline:1px solid #5b9dd9}.customize-control-header .random.placeholder{cursor:pointer;border-radius:2px;height:40px}.customize-control-header button.random{width:100%;height:auto;min-height:40px;white-space:normal}.customize-control-header button.random .dice{margin-top:4px}.customize-control-header .header-view:hover>button.random .dice,.customize-control-header .placeholder:hover .dice{animation:dice-color-change 3s infinite}.button-see-me{animation:bounce .7s 1;transform-origin:center bottom}@keyframes bounce{20%,53%,80%,from,to{animation-timing-function:cubic-bezier(.215,.61,.355,1);transform:translate3d(0,0,0)}40%,43%{animation-timing-function:cubic-bezier(.755,.050,.855,.060);transform:translate3d(0,-12px,0)}70%{animation-timing-function:cubic-bezier(.755,.050,.855,.060);transform:translate3d(0,-6px,0)}90%{transform:translate3d(0,-1px,0)}}.customize-control-header .choice{position:relative;display:block;margin-bottom:9px}.customize-control-header .choice:focus{outline:0;box-shadow:0 0 0 1px #5b9dd9,0 0 3px 1px rgba(30,140,190,.8)}.customize-control-header .uploaded div:last-child>.choice{margin-bottom:0}.customize-control .attachment-media-view .thumbnail-image img,.customize-control-header img{max-width:100%}.customize-control .attachment-media-view .default-button,.customize-control .attachment-media-view .remove-button,.customize-control-header .remove{margin-right:8px}.customize-control-background_position .background-position-control .button-group{display:block}.customize-control-code_editor textarea{width:100%;font-family:Consolas,Monaco,monospace;font-size:12px;padding:6px 8px;-moz-tab-size:2;-o-tab-size:2;tab-size:2}.customize-control-code_editor .CodeMirror,.customize-control-code_editor textarea{height:14em}#customize-controls .customize-section-description-container.section-meta.customize-info{border-bottom:none}#sub-accordion-section-custom_css .customize-control-notifications-container{margin-bottom:15px}#customize-control-custom_css textarea{display:block;height:500px}.customize-section-description-container+#customize-control-custom_css .customize-control-title{margin-left:12px}.customize-section-description-container+#customize-control-custom_css:last-child textarea{border-right:0;border-left:0;height:calc(100vh - 185px);resize:none}.customize-section-description-container+#customize-control-custom_css:last-child{margin-left:-12px;width:299px;width:calc(100% + 24px);margin-bottom:-12px}.customize-section-description-container+#customize-control-custom_css:last-child .CodeMirror{height:calc(100vh - 185px)}.CodeMirror-hints,.CodeMirror-lint-tooltip{z-index:500000!important}.customize-section-description-container+#customize-control-custom_css:last-child .customize-control-notifications-container{margin-left:12px;margin-right:12px}.theme-browser .theme.active .theme-actions,.wp-customizer .theme-browser .theme .theme-actions{padding:10px 15px;box-shadow:inset 0 1px 0 rgba(0,0,0,.1)}@media screen and (max-width:640px){.customize-section-description-container+#customize-control-custom_css:last-child{margin-right:0}.customize-section-description-container+#customize-control-custom_css:last-child textarea{height:calc(100vh - 140px)}}#customize-theme-controls .control-panel-themes{border-bottom:none}#customize-theme-controls .control-panel-themes>.accordion-section-title,#customize-theme-controls .control-panel-themes>.accordion-section-title:hover{cursor:default;background:#fff;color:#555d66;border-top:1px solid #ddd;border-bottom:1px solid #ddd;border-left:none;border-right:none;margin:0 0 15px 0;padding-right:100px}#customize-theme-controls .control-section-themes .customize-themes-panel .accordion-section-title:first-child,#customize-theme-controls .control-section-themes .customize-themes-panel .accordion-section-title:first-child:hover{border-top:0}#customize-theme-controls .control-section-themes>.accordion-section-title,#customize-theme-controls .control-section-themes>.accordion-section-title:hover{margin:0 0 15px}#customize-controls .customize-themes-panel .accordion-section-title,#customize-controls .customize-themes-panel .accordion-section-title:hover{margin:15px -8px}#customize-controls .control-section-themes .accordion-section-title,#customize-controls .customize-themes-panel .accordion-section-title{padding-right:100px}#customize-controls .control-section-themes .accordion-section-title span.customize-action,#customize-controls .customize-section-title span.customize-action,.control-panel-themes .accordion-section-title span.customize-action{font-size:13px;display:block;font-weight:400}#customize-theme-controls .control-panel-themes .accordion-section-title .change-theme{position:absolute;right:10px;top:50%;margin-top:-14px;font-weight:400}#customize-theme-controls .control-panel-themes>.accordion-section-title:after{display:none}.control-panel-themes .customize-themes-full-container{position:fixed;top:0;left:0;transition:.18s left ease-in-out;margin:0 0 0 300px;padding:71px 0 25px;overflow-y:scroll;width:calc(100% - 300px);height:calc(100% - 96px);background:#eee;z-index:20}@media screen and (min-width:1670px){.control-panel-themes .customize-themes-full-container{width:82%;right:0;left:initial}}.modal-open .control-panel-themes .customize-themes-full-container{overflow-y:visible}#customize-header-actions .customize-controls-preview-toggle,#customize-header-actions .spinner,#customize-save-button-wrapper{transition:.18s margin ease-in-out}#customize-footer-actions,#customize-footer-actions .collapse-sidebar{bottom:0;transition:.18s bottom ease-in-out}.in-themes-panel:not(.animating) #customize-footer-actions,.in-themes-panel:not(.animating) #customize-header-actions .customize-controls-preview-toggle,.in-themes-panel:not(.animating) #customize-header-actions .spinner,.in-themes-panel:not(.animating) #customize-preview{visibility:hidden}.wp-full-overlay.in-themes-panel{background:#eee}.in-themes-panel #customize-header-actions .customize-controls-preview-toggle,.in-themes-panel #customize-header-actions .spinner,.in-themes-panel #customize-save-button-wrapper{margin-top:-46px}.in-themes-panel #customize-footer-actions,.in-themes-panel #customize-footer-actions .collapse-sidebar{bottom:-45px}.in-themes-panel.animating .control-panel-themes .filter-themes-count{display:none}.in-themes-panel.wp-full-overlay .wp-full-overlay-sidebar-content{bottom:0}.themes-filter-bar .feature-filter-toggle{float:right;margin:3px 0 3px 25px}.themes-filter-bar .feature-filter-toggle:before{content:"\f111";margin:0 5px 0 0;font:normal 16px/1 dashicons;vertical-align:text-bottom;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.themes-filter-bar .feature-filter-toggle.open{background:#eee;border-color:#999;box-shadow:inset 0 2px 5px -3px rgba(0,0,0,.5);transform:translateY(1px)}.themes-filter-bar .feature-filter-toggle .filter-count-filters{display:none}.filter-drawer{box-sizing:border-box;width:100%;position:absolute;top:46px;left:0;padding:25px 0 25px 25px;border-top:0;margin:0;background:#eee;border-bottom:1px solid #ddd}.filter-drawer .filter-group{margin:0 25px 0 0;width:calc((100% - 75px)/ 3);min-width:200px;max-width:320px}@keyframes themes-fade-in{0%{opacity:0}50%{opacity:0}100%{opacity:1}}.control-panel-themes .customize-themes-full-container.animate{animation:.6s themes-fade-in 1}.in-themes-panel:not(.animating) .control-panel-themes .filter-themes-count{animation:.6s themes-fade-in 1}.control-panel-themes .filter-themes-count{position:relative;float:right;line-height:2.6}.control-panel-themes .filter-themes-count .themes-displayed{font-weight:600;color:#555d66}.customize-themes-notifications{margin:0}.control-panel-themes .customize-themes-notifications .notice{margin:0 0 25px 0}.customize-themes-full-container .customize-themes-section{display:none!important;overflow:hidden}.customize-themes-full-container .customize-themes-section.current-section{display:list-item!important}.control-section .customize-section-text-before{padding:0 0 8px 15px;margin:15px 0 0 0;line-height:16px;border-bottom:1px solid #ddd;color:#555d66}.control-panel-themes .customize-themes-section-title{width:100%;background:#fff;box-shadow:none;outline:0;border-top:none;border-bottom:1px solid #ddd;border-left:4px solid #fff;border-right:none;cursor:pointer;padding:10px 15px;position:relative;text-align:left;font-size:14px;font-weight:600;color:#555d66;text-shadow:none}.control-panel-themes #accordion-section-installed_themes{border-top:1px solid #ddd}.control-panel-themes .theme-section{margin:0;position:relative}.control-panel-themes .customize-themes-section-title:focus,.control-panel-themes .customize-themes-section-title:hover{border-left-color:#0073aa;color:#0073aa;background:#f5f5f5}.customize-themes-section-title:not(.selected):after{content:"";display:block;position:absolute;top:9px;right:15px;width:18px;height:18px;border-radius:100%;border:1px solid #ccc;background:#fff}.control-panel-themes .theme-section .customize-themes-section-title.selected:after{content:"\f147";font:16px/1 dashicons;box-sizing:border-box;width:20px;height:20px;padding:3px 3px 1px 1px;border-radius:100%;position:absolute;top:9px;right:15px;background:#0073aa;color:#fff}.control-panel-themes .customize-themes-section-title.selected{color:#0073aa}#customize-theme-controls .themes.accordion-section-content{position:relative;left:0;padding:0;width:100%}.loading .customize-themes-section .spinner{display:block;visibility:visible;position:relative;clear:both;width:20px;height:20px;left:calc(50% - 10px);float:none;margin-top:50px}.customize-themes-section .no-themes,.customize-themes-section .no-themes-local{display:none}.themes-section-installed_themes .theme .notice-success:not(.updated-message){display:none}.customize-control-theme .theme{width:100%;margin:0;border:1px solid #ddd;background:#fff}.customize-control-theme .theme .theme-actions,.customize-control-theme .theme .theme-name{background:#fff;border:none}.customize-control.customize-control-theme{box-sizing:border-box;width:25%;max-width:600px;margin:0 25px 25px 0;padding:0;clear:none}@media screen and (min-width:2101px){.customize-control.customize-control-theme{width:calc((100% - 125px)/ 5 - 1px)}}@media screen and (min-width:1601px) and (max-width:2100px){.customize-control.customize-control-theme{width:calc((100% - 100px)/ 4 - 1px)}}@media screen and (min-width:1201px) and (max-width:1600px){.customize-control.customize-control-theme{width:calc((100% - 75px)/ 3 - 1px)}}@media screen and (min-width:851px) and (max-width:1200px){.customize-control.customize-control-theme{width:calc((100% - 50px)/ 2 - 1px)}}@media screen and (max-width:850px){.customize-control.customize-control-theme{width:100%}}.wp-customizer .theme-browser .themes{padding:0 0 25px 25px;transition:.18s margin-top linear}.wp-customizer .theme-browser .theme .theme-actions{opacity:1}#customize-controls h3.theme-name{font-size:15px}#customize-controls .theme-overlay .theme-name{font-size:32px}.customize-preview-header.themes-filter-bar{position:fixed;top:0;left:300px;width:calc(100% - 300px);height:46px;background:#eee;z-index:10;padding:6px 25px;box-sizing:border-box;border-bottom:1px solid #ddd}@media screen and (min-width:1670px){.customize-preview-header.themes-filter-bar{width:82%;right:0;left:initial}}.themes-filter-bar .themes-filter-container{margin:0;padding:0}.themes-filter-bar .wp-filter-search{line-height:1.8;padding:6px 10px 6px 30px;max-width:100%;width:40%;min-width:300px;position:absolute;top:6px;left:25px;height:32px;margin:1px 0}@media screen and (max-height:540px),screen and (max-width:1018px){.customize-preview-header.themes-filter-bar{position:relative;left:0;width:100%;margin:0 0 25px 0}.filter-drawer{top:46px}.wp-customizer .theme-browser .themes{padding:0 0 25px 25px;overflow:hidden}.control-panel-themes .customize-themes-full-container{margin-top:0;padding:0;height:100%;width:calc(100% - 300px)}}@media screen and (max-width:1018px){.filter-drawer .filter-group{width:calc((100% - 50px)/ 2)}}@media screen and (max-width:900px){.customize-preview-header.themes-filter-bar{height:86px;padding-top:46px}.themes-filter-bar .wp-filter-search{width:calc(100% - 50px);margin:0;min-width:200px}.filter-drawer{top:86px}.control-panel-themes .filter-themes-count{float:left}}@media screen and (max-width:792px){.filter-drawer .filter-group{width:calc(100% - 25px)}}.control-panel-themes .customize-themes-mobile-back{display:none}@media screen and (max-width:600px){.filter-drawer{top:132px}.wp-full-overlay.showing-themes .control-panel-themes .filter-themes-count .filter-themes{display:block;float:right}.control-panel-themes .customize-themes-full-container{width:100%;margin:0;padding-top:46px;height:calc(100% - 46px);z-index:1;display:none}.showing-themes .control-panel-themes .customize-themes-full-container{display:block}.wp-customizer .showing-themes .control-panel-themes .customize-themes-mobile-back{display:block;position:fixed;top:0;left:0;background:#eee;color:#444;border-radius:0;box-shadow:none;border:none;height:46px;width:100%;z-index:10;text-align:left;text-shadow:none;border-bottom:1px solid #ddd;border-left:4px solid transparent;margin:0;padding:0;font-size:0;overflow:hidden}.wp-customizer .showing-themes .control-panel-themes .customize-themes-mobile-back:before{left:0;top:0;height:46px;width:26px;display:block;line-height:2.3;padding:0 8px 0 8px;border-right:1px solid #ddd}.wp-customizer .showing-themes .control-panel-themes .customize-themes-mobile-back:focus,.wp-customizer .showing-themes .control-panel-themes .customize-themes-mobile-back:hover{color:#0073aa;background:#f3f3f5;border-left-color:#0073aa;outline:0;box-shadow:none}.showing-themes #customize-header-actions{display:none}#customize-controls{width:100%}}.wp-customizer .theme-overlay{display:none}.wp-customizer.modal-open .theme-overlay{position:fixed;left:0;top:0;right:0;bottom:0;z-index:109}.wp-customizer.modal-open #customize-header-actions,.wp-customizer.modal-open .control-panel-themes .customize-themes-section-title.selected:after,.wp-customizer.modal-open .control-panel-themes .filter-themes-count{z-index:-1}.wp-full-overlay.in-themes-panel.themes-panel-expanded #customize-controls .wp-full-overlay-sidebar-content{overflow:visible}.wp-customizer .theme-overlay .theme-backdrop{background:rgba(238,238,238,.75);position:fixed;z-index:110}.wp-customizer .theme-overlay .star-rating{float:left;margin-right:8px}.wp-customizer .theme-rating .num-ratings{line-height:20px}.wp-customizer .theme-overlay .theme-wrap{left:90px;right:90px;top:45px;bottom:45px;z-index:120}.wp-customizer .theme-overlay .theme-actions{text-align:right;padding:10px 25px;background:#eee;border-top:1px solid #ddd}.wp-customizer .theme-overlay .theme-actions .theme-install.preview{margin-left:8px}.control-panel-themes .theme-actions .delete-theme{left:15px;right:auto;bottom:auto;position:absolute}.modal-open .in-themes-panel #customize-controls .wp-full-overlay-sidebar-content{overflow:visible}.wp-customizer .theme-header{background:#eee}.wp-customizer .theme-overlay .theme-header .close:before,.wp-customizer .theme-overlay .theme-header button{color:#444}.wp-customizer .theme-overlay .theme-header .close:focus,.wp-customizer .theme-overlay .theme-header .close:hover,.wp-customizer .theme-overlay .theme-header .left:focus,.wp-customizer .theme-overlay .theme-header .left:hover,.wp-customizer .theme-overlay .theme-header .right:focus,.wp-customizer .theme-overlay .theme-header .right:hover{background:#fff;border-bottom:4px solid #0073aa;color:#0073aa}.wp-customizer .theme-overlay .theme-header .close:focus:before,.wp-customizer .theme-overlay .theme-header .close:hover:before{color:#0073aa}.wp-customizer .theme-overlay .theme-header button.disabled,.wp-customizer .theme-overlay .theme-header button.disabled:focus,.wp-customizer .theme-overlay .theme-header button.disabled:hover{border-bottom:none;background:0 0;color:#ccc}@media (max-width:850px),(max-height:472px){.wp-customizer .theme-overlay .theme-wrap{left:0;right:0;top:0;bottom:0}.wp-customizer .theme-browser .themes{padding-right:25px}}body.cheatin{font-size:medium;height:auto;background:#fff;margin:50px auto 2em;padding:1em 2em;max-width:700px;min-width:0;box-shadow:0 1px 3px rgba(0,0,0,.13)}body.cheatin h1{border-bottom:1px solid #ddd;clear:both;color:#555d66;font-size:24px;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif;margin:30px 0 0 0;padding:0;padding-bottom:7px}body.cheatin p{font-size:14px;line-height:1.5;margin:25px 0 20px}#customize-theme-controls .add-new-menu-item,#customize-theme-controls .add-new-widget{cursor:pointer;float:right;margin:0;margin-left:10px;transition:all .2s;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;outline:0}.reordering .add-new-menu-item,.reordering .add-new-widget{opacity:.2;pointer-events:none;cursor:not-allowed}#available-menu-items .new-content-item .add-content:before,.add-new-menu-item:before,.add-new-widget:before{content:"\f132";display:inline-block;position:relative;left:-2px;top:0;font:normal 20px/1 dashicons;vertical-align:middle;transition:all .2s;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.reorder-toggle{float:right;padding:5px 8px;text-decoration:none;cursor:pointer;outline:0}.reorder,.reordering .reorder-done{display:block;padding:5px 8px}.reorder-done,.reordering .reorder{display:none}.menu-item-reorder-nav button,.widget-reorder-nav span{position:relative;overflow:hidden;float:left;display:block;width:33px;height:43px;color:#82878c;text-indent:-9999px;cursor:pointer;outline:0}.menu-item-reorder-nav button{width:30px;height:40px;background:0 0;border:none;box-shadow:none}.menu-item-reorder-nav button:before,.widget-reorder-nav span:before{display:inline-block;position:absolute;top:0;right:0;width:100%;height:100%;font:normal 20px/43px dashicons;text-align:center;text-indent:0;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.menu-item-reorder-nav button:focus,.menu-item-reorder-nav button:hover,.widget-reorder-nav span:focus,.widget-reorder-nav span:hover{color:#191e23;background:#eee}.menus-move-down:before,.move-widget-down:before{content:"\f347"}.menus-move-up:before,.move-widget-up:before{content:"\f343"}#customize-theme-controls .first-widget .move-widget-up,#customize-theme-controls .last-widget .move-widget-down,.move-down-disabled .menus-move-down,.move-left-disabled .menus-move-left,.move-right-disabled .menus-move-right,.move-up-disabled .menus-move-up{color:#d5d5d5;background-color:#fff;cursor:default;pointer-events:none}.wp-full-overlay-main{right:auto;width:100%}.add-menu-toggle.open,.add-menu-toggle.open:hover,.adding-menu-items .add-new-menu-item,.adding-menu-items .add-new-menu-item:hover,body.adding-widget .add-new-widget,body.adding-widget .add-new-widget:hover{background:#eee;border-color:#929793;color:#32373c;box-shadow:inset 0 2px 5px -3px rgba(0,0,0,.5)}#accordion-section-add_menu .add-new-menu-item.open:before,.adding-menu-items .add-new-menu-item:before,body.adding-widget .add-new-widget:before{transform:rotate(45deg)}#available-menu-items,#available-widgets{position:absolute;top:0;bottom:0;left:-301px;visibility:hidden;overflow-x:hidden;overflow-y:auto;width:300px;margin:0;z-index:4;background:#eee;transition:left .18s;border-right:1px solid #ddd}#available-menu-items .customize-section-title,#available-widgets .customize-section-title{display:none}#available-widgets-list{top:60px;position:absolute;overflow:auto;bottom:0;width:100%;border-top:1px solid #ddd}.no-widgets-found #available-widgets-list{border-top:none}#available-widgets-filter{position:fixed;top:0;z-index:1;width:300px;background:#eee}#available-menu-items-search .accordion-section-title,#available-widgets-filter{padding:13px 15px;box-sizing:border-box}#available-menu-items-search input,#available-widgets-filter input{width:100%;height:32px;margin:1px 0;padding:6px 30px}#available-menu-items-search input::-ms-clear,#available-widgets-filter input::-ms-clear{display:none}#available-menu-items-search .search-icon,#available-widgets-filter .search-icon{display:block;position:absolute;top:15px;left:16px;width:30px;height:30px;line-height:2.1;text-align:center;color:#72777c}#available-menu-items-search .clear-results,#available-widgets-filter .clear-results{position:absolute;top:15px;right:16px;width:30px;height:30px;padding:0;border:0;cursor:pointer;background:0 0;color:#a00;text-decoration:none;outline:0}#available-menu-items-search .clear-results,#available-menu-items-search.loading .clear-results.is-visible,#available-widgets-filter .clear-results{display:none}#available-menu-items-search .clear-results.is-visible,#available-widgets-filter .clear-results.is-visible{display:block}#available-menu-items-search .clear-results:before,#available-widgets-filter .clear-results:before{content:"\f335";font:normal 20px/1 dashicons;vertical-align:middle;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}#available-menu-items-search .clear-results:focus,#available-menu-items-search .clear-results:hover,#available-widgets-filter .clear-results:focus,#available-widgets-filter .clear-results:hover{color:#dc3232}#available-menu-items-search .clear-results:focus,#available-widgets-filter .clear-results:focus{box-shadow:0 0 0 1px #5b9dd9,0 0 2px 1px rgba(30,140,190,.8)}#available-menu-items-search .search-icon:after,#available-widgets-filter .search-icon:after,.themes-filter-bar .search-icon:after{content:"\f179";font:normal 20px/1 dashicons;vertical-align:middle;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.themes-filter-bar .search-icon{position:absolute;top:7px;left:26px;z-index:1;color:#72777c;height:30px;width:30px;line-height:2;text-align:center}.no-widgets-found-message{display:none;margin:0;padding:0 15px;line-height:inherit}.no-widgets-found .no-widgets-found-message{display:block}#available-menu-items .item-top,#available-menu-items .item-top:hover,#available-widgets .widget-top,#available-widgets .widget-top:hover{border:none;background:0 0;box-shadow:none}#available-menu-items .item-tpl,#available-widgets .widget-tpl{position:relative;padding:15px 15px 15px 60px;background:#fff;border-bottom:1px solid #ddd;border-left:4px solid #fff;transition:.15s color ease-in-out,.15s background-color ease-in-out,.15s border-color ease-in-out;cursor:pointer;display:none}#available-menu-items .item,#available-widgets .widget{position:static}.customize-controls-preview-toggle{display:none}@media only screen and (max-width:782px){.wp-customizer .theme:not(.active):focus .theme-actions,.wp-customizer .theme:not(.active):hover .theme-actions{display:block}.wp-customizer .theme-browser .theme.active .theme-name span{display:inline}.customize-control-header button.random .dice{margin-top:0}.customize-control-checkbox .customize-inside-control-row,.customize-control-nav_menu_auto_add .customize-inside-control-row,.customize-control-radio .customize-inside-control-row{margin-left:32px}.customize-control-checkbox input,.customize-control-nav_menu_auto_add input,.customize-control-radio input{margin-left:-32px}.customize-control input[type=checkbox]+label+br,.customize-control input[type=radio]+label+br{line-height:2.5}.customize-control .date-time-fields select{height:39px}.date-time-fields .date-input.month{width:79px}.date-time-fields .date-input.day,.date-time-fields .date-input.hour,.date-time-fields .date-input.minute{width:55px}.date-time-fields .date-input.year{width:80px}.date-time-fields .date-timezone{line-height:3.2}#customize-control-changeset_preview_link a{bottom:16px}.preview-link-wrapper .customize-copy-preview-link.preview-control-element.button{bottom:10px}.media-widget-control .media-widget-buttons .button.change-media,.media-widget-control .media-widget-buttons .button.edit-media,.media-widget-control .media-widget-buttons .button.select-media{margin-top:12px}.wp-core-ui .themes-filter-bar .feature-filter-toggle{margin:3px 0 3px 25px}}@media screen and (max-width:1200px){.adding-menu-items .wp-full-overlay.expanded.preview-mobile .wp-full-overlay-main,.adding-widget .wp-full-overlay.expanded.preview-mobile .wp-full-overlay-main,.outer-section-open .wp-full-overlay.expanded.preview-mobile .wp-full-overlay-main{left:67%}}@media screen and (max-width:640px){.wp-full-overlay.collapsed #customize-controls{margin-left:0}.wp-full-overlay-sidebar .wp-full-overlay-sidebar-content{bottom:0}.customize-controls-preview-toggle{display:block;position:absolute;top:0;left:48px;line-height:3.2;font-size:14px;padding:0 12px;margin:0;height:45px;background:#eee;border:0;border-right:1px solid #ddd;color:#555d66;cursor:pointer;transition:color .1s ease-in-out,background .1s ease-in-out}#customize-footer-actions,.customize-controls-preview-toggle .controls,.preview-only .customize-controls-preview-toggle .preview,.preview-only .wp-full-overlay-sidebar-content{display:none}.preview-only #customize-save-button-wrapper{margin-top:-46px}.customize-controls-preview-toggle .controls:before,.customize-controls-preview-toggle .preview:before{font:normal 20px/1 dashicons;content:"\f177";position:relative;top:4px;margin-right:6px}.customize-controls-preview-toggle .controls:before{content:"\f540"}.preview-only #customize-controls{height:45px}.preview-only #customize-preview,.preview-only .customize-controls-preview-toggle .controls{display:block}.wp-core-ui.wp-customizer .button{padding:6px 14px;line-height:normal;font-size:14px;vertical-align:middle;height:auto}#publish-settings{height:31px}#customize-control-changeset_status .customize-inside-control-row{padding-top:15px}body.adding-menu-items div#available-menu-items,body.adding-widget div#available-widgets,body.outer-section-open div#customize-sidebar-outer-content{width:100%}#available-menu-items .customize-section-title,#available-widgets .customize-section-title{display:block;margin:0}#available-menu-items .customize-section-back,#available-widgets .customize-section-back{height:69px}#available-menu-items .customize-section-title h3,#available-widgets .customize-section-title h3{font-size:20px;font-weight:200;padding:9px 10px 12px 14px;margin:0;line-height:24px;color:#555d66;display:block;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}#available-menu-items .customize-section-title .customize-action,#available-widgets .customize-section-title .customize-action{font-size:13px;display:block;font-weight:400;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}#available-widgets-filter{position:relative;width:100%;height:auto}#available-widgets-list{top:130px}#available-menu-items-search .clear-results,#available-menu-items-search .search-icon{top:85px}.reorder,.reordering .reorder-done{padding:8px}.wp-core-ui .themes-filter-bar .feature-filter-toggle{margin:0}.theme-browser .theme.active .theme-actions,.wp-customizer .theme-browser .theme .theme-actions{padding:9px 15px;box-shadow:inset 0 1px 0 rgba(0,0,0,.1)}}@media screen and (max-width:600px){.theme-browser .theme.active .theme-actions,.wp-customizer .theme-browser .theme .theme-actions{padding:8px 15px;box-shadow:none}.wp-full-overlay.expanded{margin-left:0}body.adding-menu-items div#available-menu-items,body.adding-widget div#available-widgets,body.outer-section-open div#customize-sidebar-outer-content{top:46px;z-index:10}body.wp-customizer .wp-full-overlay.expanded #customize-sidebar-outer-content{left:-100%}body.wp-customizer.outer-section-open .wp-full-overlay.expanded #customize-sidebar-outer-content{left:0}} \ No newline at end of file
diff --git a/www/crm/wp-admin/css/customize-nav-menus-rtl.css b/www/crm/wp-admin/css/customize-nav-menus-rtl.css
new file mode 100644
index 00000000..e54a8dd3
--- /dev/null
+++ b/www/crm/wp-admin/css/customize-nav-menus-rtl.css
@@ -0,0 +1,887 @@
+#customize-theme-controls #accordion-section-menu_locations {
+ position: relative;
+ margin-top: 30px;
+}
+
+#customize-theme-controls #accordion-section-menu_locations > .accordion-section-title {
+ border-bottom-color: #ddd;
+ margin-top: 15px;
+}
+
+#customize-theme-controls .customize-section-title-nav_menus-heading,
+#customize-theme-controls .customize-section-title-menu_locations-heading,
+#customize-theme-controls .customize-section-title-menu_locations-description {
+ padding: 0 12px 0 12px;
+}
+
+#customize-theme-controls .customize-control-description.customize-section-title-menu_locations-description {
+ /* Override the default italic style for control descriptions */
+ font-style: normal;
+}
+
+.menu-in-location,
+.menu-in-locations {
+ display: block;
+ font-weight: 600;
+ font-size: 10px;
+}
+
+#customize-controls .theme-location-set,
+#customize-controls .control-section .accordion-section-title:focus .menu-in-location,
+#customize-controls .control-section .accordion-section-title:hover .menu-in-location {
+ color: #555;
+}
+
+/* The `edit-menu` and `create-menu` buttons also use the `button-link` class. */
+.customize-control-nav_menu_location .edit-menu,
+.customize-control-nav_menu_location .create-menu {
+ margin-right: 6px;
+ vertical-align: middle;
+ line-height: 2.2;
+}
+
+#customize-controls .customize-control-nav_menu_name {
+ margin-bottom: 12px;
+}
+
+.customize-control-nav_menu_name p:last-of-type {
+ margin-bottom: 0;
+}
+
+#customize-new-menu-submit {
+ float: left;
+ min-width: 85px;
+}
+
+.wp-customizer .menu-item-bar .menu-item-handle,
+.wp-customizer .menu-item-settings,
+.wp-customizer .menu-item-settings .description-thin {
+ box-sizing: border-box;
+}
+
+.wp-customizer .menu-item-bar {
+ margin: 0;
+}
+
+.wp-customizer .menu-item-bar .menu-item-handle {
+ width: 100%;
+ background: #fff;
+}
+
+.wp-customizer .menu-item-handle .item-title {
+ margin-left: 0;
+}
+
+.wp-customizer .menu-item-handle .item-type {
+ padding: 1px 5px 0 21px;
+ float: left;
+ text-align: left;
+}
+
+.wp-customizer .menu-item-handle:hover {
+ z-index: 8;
+}
+
+.customize-control-nav_menu_item.has-notifications .menu-item-handle {
+ border-right: 4px solid #00a0d2;
+}
+
+.wp-customizer .menu-item-settings {
+ max-width: 100%;
+ overflow: hidden;
+ z-index: 8;
+ padding: 10px;
+ background: #eee;
+ border: 1px solid #999;
+ border-top: none;
+}
+
+.wp-customizer .menu-item-settings .description-thin {
+ width: 100%;
+ height: auto;
+ margin: 0 0 8px 0;
+}
+
+.wp-customizer .menu-item-settings input[type="text"] {
+ width: 100%;
+}
+
+.wp-customizer .menu-item-settings .submitbox {
+ margin: 0;
+ padding: 0;
+}
+
+.wp-customizer .menu-item-settings .link-to-original {
+ padding: 5px 0;
+ border: none;
+ font-style: normal;
+ margin: 0;
+ width: 100%;
+}
+
+.wp-customizer .menu-item .submitbox .submitdelete {
+ float: right;
+ margin: 6px 0 0;
+ padding: 0;
+ cursor: pointer;
+}
+
+
+/**
+ * Menu items reordering styles
+ */
+
+.menu-item-reorder-nav {
+ display: none;
+ background-color: #fff;
+ position: absolute;
+ top: 0;
+ left: 0;
+}
+
+.menus-move-left:before {
+ content: "\f345";
+}
+
+.menus-move-right:before {
+ content: "\f341";
+}
+
+.reordering .menu-item .item-controls,
+.reordering .menu-item .item-type {
+ display: none;
+}
+
+.reordering .menu-item-reorder-nav {
+ display: block;
+}
+
+.customize-control input.menu-name-field {
+ width: 100%; /* Override the 98% default for customizer inputs, to align with the size of menu items. */
+}
+
+.wp-customizer .menu-item .item-edit {
+ position: absolute;
+ left: -19px;
+ top: 2px;
+ display: block;
+ width: 30px;
+ height: 38px;
+ margin-left: 0 !important;
+ box-shadow: none;
+ outline: none;
+ overflow: hidden;
+ cursor: pointer;
+ text-align: center;
+}
+
+.wp-customizer .menu-item.menu-item-edit-active .item-edit .toggle-indicator:before {
+ content: "\f142";
+}
+
+.wp-customizer .menu-item-settings p.description {
+ font-style: normal;
+}
+
+.wp-customizer .menu-settings dl {
+ margin: 12px 0 0 0;
+ padding: 0;
+}
+
+.wp-customizer .menu-settings .checkbox-input {
+ margin-top: 8px;
+}
+
+.wp-customizer .menu-settings .menu-theme-locations {
+ border-top: 1px solid #ccc;
+}
+
+.wp-customizer .menu-settings {
+ margin-top: 36px;
+ border-top: none;
+}
+
+.wp-customizer .menu-location-settings {
+ margin-top: 12px;
+ border-top: none;
+}
+
+.wp-customizer .control-section-nav_menu .menu-location-settings {
+ margin-top: 24px;
+ border-top: 1px solid #ddd;
+}
+
+.wp-customizer .control-section-nav_menu .menu-location-settings,
+.customize-control-nav_menu_auto_add {
+ padding-top: 12px;
+}
+
+.menu-location-settings .customize-control-checkbox .theme-location-set {
+ line-height: 1;
+}
+
+.customize-control-nav_menu_auto_add label {
+ vertical-align: top;
+}
+
+.menu-location-settings .new-menu-locations-widget-note {
+ display: block;
+}
+
+.customize-control-menu {
+ margin-top: 4px;
+}
+
+#customize-controls .customize-info.open.active-menu-screen-options .customize-help-toggle {
+ color: #555;
+}
+
+/* Screen Options */
+.customize-screen-options-toggle {
+ background: none;
+ border: none;
+ color: #555;
+ cursor: pointer;
+ margin: 0;
+ padding: 20px;
+ position: absolute;
+ left: 0;
+ top: 30px;
+}
+
+#customize-controls .customize-info .customize-help-toggle {
+ padding: 20px;
+}
+
+#customize-controls .customize-info .customize-help-toggle:before {
+ padding: 4px;
+}
+
+.customize-screen-options-toggle:hover,
+.customize-screen-options-toggle:active,
+.customize-screen-options-toggle:focus,
+.active-menu-screen-options .customize-screen-options-toggle,
+#customize-controls .customize-info.open.active-menu-screen-options .customize-help-toggle:hover,
+#customize-controls .customize-info.open.active-menu-screen-options .customize-help-toggle:active,
+#customize-controls .customize-info.open.active-menu-screen-options .customize-help-toggle:focus {
+ color: #0073aa;
+}
+
+.customize-screen-options-toggle:focus,
+#customize-controls .customize-info .customize-help-toggle:focus {
+ outline: none;
+}
+
+.customize-screen-options-toggle:before {
+ -moz-osx-font-smoothing: grayscale;
+ border: none;
+ content: "\f111";
+ display: block;
+ font: 18px/1 dashicons;
+ padding: 5px;
+ text-align: center;
+ text-decoration: none !important;
+ text-indent: 0;
+ right: 6px;
+ position: absolute;
+ top: 6px;
+}
+
+.customize-screen-options-toggle:focus:before,
+#customize-controls .customize-info .customize-help-toggle:focus:before {
+ border-radius: 100%;
+}
+
+.wp-customizer #screen-options-wrap {
+ display: none;
+ background: #fff;
+ border-top: 1px solid #ddd;
+ padding: 4px 15px 15px;
+}
+
+.wp-customizer .metabox-prefs label {
+ display: block;
+ padding-left: 0;
+ line-height: 30px;
+}
+
+/* rework the arrow indicator implementation for NVDA bug same as #32715 */
+.wp-customizer .toggle-indicator {
+ display: inline-block;
+ font-size: 20px;
+ line-height: 1;
+}
+
+.rtl .wp-customizer .toggle-indicator {
+ text-indent: 1px; /* account for the dashicon alignment */
+}
+
+.wp-customizer .menu-item .item-edit .toggle-indicator:before,
+#available-menu-items .accordion-section-title .toggle-indicator:before {
+ content: "\f140";
+ display: block;
+ padding: 1px 0px 1px 2px;
+ speak: none;
+ border-radius: 50%;
+ color: #72777c;
+ font: normal 20px/1 dashicons;
+ -webkit-font-smoothing: antialiased;
+ -moz-osx-font-smoothing: grayscale;
+ text-decoration: none !important;
+}
+
+.control-section-nav_menu .field-link-target,
+.control-section-nav_menu .field-title-attribute,
+.control-section-nav_menu .field-css-classes,
+.control-section-nav_menu .field-xfn,
+.control-section-nav_menu .field-description {
+ display: none;
+}
+
+.control-section-nav_menu.field-link-target-active .field-link-target,
+.control-section-nav_menu.field-title-attribute-active .field-title-attribute,
+.control-section-nav_menu.field-css-classes-active .field-css-classes,
+.control-section-nav_menu.field-xfn-active .field-xfn,
+.control-section-nav_menu.field-description-active .field-description {
+ display: block;
+}
+
+/* WARNING: The 20px factor is hard-coded in JS. */
+.menu-item-depth-0 { margin-right: 0; }
+.menu-item-depth-1 { margin-right: 20px; }
+.menu-item-depth-2 { margin-right: 40px; }
+.menu-item-depth-3 { margin-right: 60px; }
+.menu-item-depth-4 { margin-right: 80px; }
+.menu-item-depth-5 { margin-right: 100px; }
+.menu-item-depth-6 { margin-right: 120px; }
+.menu-item-depth-7 { margin-right: 140px; }
+.menu-item-depth-8 { margin-right: 160px; } /* Not likely to be used or useful beyond this depth */
+.menu-item-depth-9 { margin-right: 180px; }
+.menu-item-depth-10 { margin-right: 200px; }
+.menu-item-depth-11 { margin-right: 220px; }
+
+/* @todo handle .menu-item-settings width */
+.menu-item-depth-0 > .menu-item-bar { margin-left: 0; }
+.menu-item-depth-1 > .menu-item-bar { margin-left: 20px; }
+.menu-item-depth-2 > .menu-item-bar { margin-left: 40px; }
+.menu-item-depth-3 > .menu-item-bar { margin-left: 60px; }
+.menu-item-depth-4 > .menu-item-bar { margin-left: 80px; }
+.menu-item-depth-5 > .menu-item-bar { margin-left: 100px; }
+.menu-item-depth-6 > .menu-item-bar { margin-left: 120px; }
+.menu-item-depth-7 > .menu-item-bar { margin-left: 140px; }
+.menu-item-depth-8 > .menu-item-bar { margin-left: 160px; }
+.menu-item-depth-9 > .menu-item-bar { margin-left: 180px; }
+.menu-item-depth-10 > .menu-item-bar { margin-left: 200px; }
+.menu-item-depth-11 > .menu-item-bar { margin-left: 220px; }
+
+/* Submenu left margin. */
+.menu-item-depth-0 .menu-item-transport { margin-right: 0; }
+.menu-item-depth-1 .menu-item-transport { margin-right: -20px; }
+.menu-item-depth-3 .menu-item-transport { margin-right: -60px; }
+.menu-item-depth-4 .menu-item-transport { margin-right: -80px; }
+.menu-item-depth-2 .menu-item-transport { margin-right: -40px; }
+.menu-item-depth-5 .menu-item-transport { margin-right: -100px; }
+.menu-item-depth-6 .menu-item-transport { margin-right: -120px; }
+.menu-item-depth-7 .menu-item-transport { margin-right: -140px; }
+.menu-item-depth-8 .menu-item-transport { margin-right: -160px; }
+.menu-item-depth-9 .menu-item-transport { margin-right: -180px; }
+.menu-item-depth-10 .menu-item-transport { margin-right: -200px; }
+.menu-item-depth-11 .menu-item-transport { margin-right: -220px; }
+
+/* WARNING: The 20px factor is hard-coded in JS. */
+.reordering .menu-item-depth-0 { margin-right: 0; }
+.reordering .menu-item-depth-1 { margin-right: 15px; }
+.reordering .menu-item-depth-2 { margin-right: 30px; }
+.reordering .menu-item-depth-3 { margin-right: 45px; }
+.reordering .menu-item-depth-4 { margin-right: 60px; }
+.reordering .menu-item-depth-5 { margin-right: 75px; }
+.reordering .menu-item-depth-6 { margin-right: 90px; }
+.reordering .menu-item-depth-7 { margin-right: 105px; }
+.reordering .menu-item-depth-8 { margin-right: 120px; } /* Not likely to be used or useful beyond this depth */
+.reordering .menu-item-depth-9 { margin-right: 135px; }
+.reordering .menu-item-depth-10 { margin-right: 150px; }
+.reordering .menu-item-depth-11 { margin-right: 165px; }
+
+.reordering .menu-item-depth-0 > .menu-item-bar { margin-left: 0; }
+.reordering .menu-item-depth-1 > .menu-item-bar { margin-left: 15px; }
+.reordering .menu-item-depth-2 > .menu-item-bar { margin-left: 30px; }
+.reordering .menu-item-depth-3 > .menu-item-bar { margin-left: 45px; }
+.reordering .menu-item-depth-4 > .menu-item-bar { margin-left: 60px; }
+.reordering .menu-item-depth-5 > .menu-item-bar { margin-left: 75px; }
+.reordering .menu-item-depth-6 > .menu-item-bar { margin-left: 90px; }
+.reordering .menu-item-depth-7 > .menu-item-bar { margin-left: 105px; }
+.reordering .menu-item-depth-8 > .menu-item-bar { margin-left: 120px; }
+.reordering .menu-item-depth-9 > .menu-item-bar { margin-left: 135px; }
+.reordering .menu-item-depth-10 > .menu-item-bar { margin-left: 150px; }
+.reordering .menu-item-depth-11 > .menu-item-bar { margin-left: 165px; }
+
+.control-section-nav_menu.menu .menu-item-edit-active {
+ margin-right: 0;
+}
+
+.control-section-nav_menu.menu .menu-item-edit-active .menu-item-bar {
+ margin-left: 0;
+}
+
+.control-section-nav_menu.menu .sortable-placeholder {
+ margin-top: 0;
+ margin-bottom: 1px;
+ max-width: calc(100% - 2px);
+ float: right;
+ display: list-item;
+ border-color: #a0a5aa;
+}
+
+.menu-item-transport li.customize-control {
+ float: none;
+}
+
+.control-section-nav_menu.menu ul.menu-item-transport .menu-item-bar {
+ margin-top: 0;
+}
+
+/**
+ * Add-menu-items mode
+ */
+
+.adding-menu-items .control-section {
+ opacity: .4;
+}
+
+.adding-menu-items .control-panel.control-section,
+.adding-menu-items .control-section.open {
+ opacity: 1;
+}
+
+.menu-item-bar .item-delete {
+ color: #a00;
+ position: absolute;
+ top: 2px;
+ left: -19px;
+ width: 30px;
+ height: 38px;
+ cursor: pointer;
+ display: none;
+}
+
+.menu-item-bar .item-delete:before {
+ content: "\f335";
+ position: absolute;
+ top: 9px;
+ right: 5px;
+ border-radius: 50%;
+ font: normal 20px/1 dashicons;
+ -webkit-font-smoothing: antialiased;
+ -moz-osx-font-smoothing: grayscale;
+}
+
+.ie8 .menu-item-bar .item-delete:before {
+ top: -10px;
+}
+
+.menu-item-bar .item-delete:hover,
+.menu-item-bar .item-delete:focus {
+ box-shadow: none;
+ outline: none;
+ color: #dc3232;
+}
+
+.adding-menu-items .menu-item-bar .item-edit {
+ display: none;
+}
+
+.adding-menu-items .menu-item-bar .item-delete {
+ display: block;
+}
+
+/**
+ * Styles for menu-item addition panel
+ */
+
+#available-menu-items.opening {
+ overflow-y: hidden; /* avoid scrollbar jitter with animating heights */
+}
+
+#available-menu-items #available-menu-items-search.open {
+ height: 100%;
+ border-bottom: none;
+}
+
+#available-menu-items .accordion-section-title {
+ border-right: none;
+ border-left: none;
+ background: #fff;
+ transition: background-color 0.15s;
+ /* Reset the value inherited from the base .accordion-section-title style. Ticket #37589. */
+ -webkit-user-select: auto;
+ -moz-user-select: auto;
+ -ms-user-select: auto;
+ user-select: auto;
+}
+
+#available-menu-items .open .accordion-section-title,
+#available-menu-items #available-menu-items-search .accordion-section-title {
+ background: #eee;
+}
+
+/* rework the arrow indicator implementation for NVDA bug see #32715 */
+#available-menu-items .accordion-section-title:after {
+ content: none !important;
+}
+
+#available-menu-items .accordion-section-title:hover .toggle-indicator:before,
+#available-menu-items .button-link:hover .toggle-indicator:before,
+#available-menu-items .button-link:focus .toggle-indicator:before {
+ color: #23282d;
+}
+
+#available-menu-items .open .accordion-section-title .toggle-indicator:before {
+ content: "\f142";
+ color: #23282d;
+}
+
+#available-menu-items .available-menu-items-list {
+ overflow-y: auto;
+ max-height: 200px; /* This gets set in JS to fit the screen size, and based on # of sections. */
+ background: transparent;
+}
+
+#available-menu-items .accordion-section-title button {
+ display: block;
+ width: 28px;
+ height: 35px;
+ position: absolute;
+ top: 5px;
+ left: 5px;
+ box-shadow: none;
+ outline: none;
+ cursor: pointer;
+ text-align: center;
+}
+
+#available-menu-items .accordion-section-title .no-items,
+#available-menu-items .cannot-expand .accordion-section-title .spinner,
+#available-menu-items .cannot-expand .accordion-section-title > button {
+ display: none;
+}
+
+#available-menu-items-search.cannot-expand .accordion-section-title .spinner {
+ display: block;
+}
+
+#available-menu-items .cannot-expand .accordion-section-title .no-items {
+ float: left;
+ color: #555d66;
+ font-weight: 400;
+ margin-right: 5px;
+}
+
+#available-menu-items .accordion-section-content {
+ max-height: 290px;
+ margin: 0;
+ padding: 0;
+ position: relative;
+ background: transparent;
+}
+
+#available-menu-items .accordion-section-content .available-menu-items-list {
+ margin: 0 0 45px 0;
+ padding: 1px 15px 15px 15px;
+}
+
+#available-menu-items .accordion-section-content .available-menu-items-list:only-child { /* Types that do not support new items for the current user */
+ margin-bottom: 0;
+}
+
+#new-custom-menu-item .accordion-section-content {
+ padding: 0 15px 15px 15px;
+}
+
+#available-menu-items .menu-item-tpl {
+ margin: 0;
+}
+
+#custom-menu-item-name.invalid,
+#custom-menu-item-url.invalid,
+.edit-menu-item-url.invalid,
+.menu-name-field.invalid,
+.menu-name-field.invalid:focus,
+#available-menu-items .new-content-item .create-item-input.invalid,
+#available-menu-items .new-content-item .create-item-input.invalid:focus {
+ border: 1px solid #dc3232;
+}
+
+#available-menu-items .menu-item-handle .item-type {
+ padding-left: 0;
+}
+
+#available-menu-items .menu-item-handle .item-title {
+ padding-right: 20px;
+}
+
+#available-menu-items .menu-item-handle {
+ cursor: pointer;
+}
+
+#available-menu-items .menu-item-handle {
+ box-shadow: none;
+ margin-top: -1px;
+}
+
+#available-menu-items .menu-item-handle:hover {
+ z-index: 1;
+}
+
+#available-menu-items .item-title h4 {
+ padding: 0 0 5px;
+ font-size: 14px;
+}
+
+#available-menu-items .item-add {
+ position: absolute;
+ top: 1px;
+ right: 1px;
+ color: #82878c;
+ width: 30px;
+ height: 38px;
+ box-shadow: none;
+ outline: none;
+ cursor: pointer;
+ text-align: center;
+}
+
+#available-menu-items .menu-item-handle .item-add:focus {
+ color: #23282d;
+}
+
+#available-menu-items .item-add:before {
+ content: "\f543";
+ position: relative;
+ right: 2px;
+ top: 3px;
+ display: inline-block;
+ height: 20px;
+ border-radius: 50%;
+ font: normal 20px/1.05 dashicons; /* line height is to account for the dashicon's vertical alignment */
+}
+
+#available-menu-items .menu-item-handle.item-added .item-type,
+#available-menu-items .menu-item-handle.item-added .item-title,
+#available-menu-items .menu-item-handle.item-added:hover .item-add,
+#available-menu-items .menu-item-handle.item-added .item-add:focus {
+ color: #82878c;
+}
+
+#available-menu-items .menu-item-handle.item-added .item-add:before {
+ content: "\f147";
+}
+
+#available-menu-items .accordion-section-title.loading .spinner,
+#available-menu-items-search.loading .accordion-section-title .spinner {
+ visibility: visible;
+ margin: 0 20px;
+}
+
+#available-menu-items-search .spinner {
+ position: absolute;
+ top: 20px; /* 13 container padding +1 input margin +6 ( ( 32 input height - 20 spinner height ) / 2 ) */
+ left: 21px;
+ margin: 0 !important;
+}
+
+/* search results list */
+#available-menu-items #available-menu-items-search .accordion-section-content {
+ position: absolute;
+ right: 0;
+ top: 60px; /* below title div / search input */
+ bottom: 0px; /* 100% height that still triggers lazy load */
+ max-height: none;
+ width: 100%;
+ padding: 1px 15px 15px;
+ box-sizing: border-box;
+}
+
+#available-menu-items-search .nothing-found {
+ /* Compensate the 1px top padding of the container. */
+ margin-top: -1px;
+}
+
+#available-menu-items-search .accordion-section-title:after {
+ display: none;
+}
+
+#available-menu-items-search .accordion-section-content:empty {
+ min-height: 0;
+ padding: 0;
+}
+
+#available-menu-items-search.loading .accordion-section-content div {
+ opacity: .5;
+}
+
+#available-menu-items-search.loading.loading-more .accordion-section-content div {
+ opacity: 1;
+}
+
+#customize-preview {
+ transition: all 0.2s;
+}
+
+body.adding-menu-items #available-menu-items {
+ right: 0;
+ visibility: visible;
+}
+
+body.adding-menu-items .wp-full-overlay-main {
+ right: 300px;
+}
+
+body.adding-menu-items #customize-preview {
+ opacity: 0.4;
+}
+
+body.adding-menu-items #customize-preview iframe {
+ pointer-events: none;
+}
+
+.menu-item-handle .spinner {
+ display: none;
+ float: right;
+ margin: 0 0 0 8px;
+}
+
+.nav-menu-inserted-item-loading .spinner {
+ display: block;
+}
+
+.nav-menu-inserted-item-loading .menu-item-handle .item-type {
+ padding: 0 8px 0 0;
+}
+
+.nav-menu-inserted-item-loading .menu-item-handle,
+.added-menu-item .menu-item-handle.loading {
+ padding: 10px 8px 10px 15px;
+ cursor: default;
+ opacity: .5;
+ background: #fff;
+ color: #727773;
+}
+
+.added-menu-item .menu-item-handle {
+ transition-property: opacity, background, color;
+ transition-duration: 1.25s;
+ transition-timing-function: cubic-bezier( .25, -2.5, .75, 8 ); /* Replacement for .hide().fadeIn('slow') in JS to add emphasis when it's loaded. */
+}
+
+/* Add/delete Menus */
+
+#customize-theme-controls .control-panel-content .control-section-nav_menu:nth-last-child(2) .accordion-section-title {
+ border-bottom-color: #ddd;
+}
+
+/* @todo update selector */
+#accordion-section-add_menu {
+ margin: 15px 12px;
+}
+
+#accordion-section-add_menu h3 {
+ text-align: left;
+}
+
+#accordion-section-add_menu h3,
+#accordion-section-add_menu .customize-add-menu-button {
+ margin: 0;
+}
+
+#accordion-section-add_menu .customize-add-menu-button {
+ font-weight: 400;
+}
+
+#create-new-menu-submit {
+ float: left;
+ margin: 0 0 12px 0;
+}
+
+.menu-delete-item {
+ float: right;
+ padding: 1em 0;
+ width: 100%;
+}
+
+.assigned-menu-locations-title p {
+ margin: 0 0 8px 0;
+}
+
+li.assigned-to-menu-location .menu-delete-item {
+ display: none;
+}
+
+li.assigned-to-menu-location .add-new-menu-item {
+ margin-bottom: 1em;
+}
+
+.menu-item-handle {
+ margin-top: -1px;
+}
+.ui-sortable-disabled .menu-item-handle {
+ cursor: default;
+}
+
+.menu-item-handle:hover {
+ position: relative;
+ z-index: 10;
+ color: #0073aa;
+}
+
+.menu-item-handle:hover .item-type,
+.menu-item-handle:hover .item-edit,
+#available-menu-items .menu-item-handle:hover .item-add {
+ color: #0073aa;
+}
+
+.menu-item-edit-active .menu-item-handle {
+ border-color: #999;
+ border-bottom: none;
+}
+
+.customize-control-nav_menu_item {
+ margin-bottom: 0;
+}
+
+.customize-control-nav_menu .new-menu-item-invitation {
+ margin-top: 0;
+ margin-bottom: 0;
+}
+
+.customize-control-nav_menu .customize-control-nav_menu-buttons {
+ margin-top: 12px;
+}
+
+/**
+ * box-shadows
+ */
+
+.wp-customizer .menu-item .submitbox .submitdelete:focus,
+.customize-screen-options-toggle:focus:before,
+#customize-controls .customize-info .customize-help-toggle:focus:before,
+.wp-customizer button:focus .toggle-indicator:before,
+.menu-delete:focus,
+.menu-item-bar .item-delete:focus:before,
+#available-menu-items .item-add:focus:before {
+ box-shadow:
+ 0 0 0 1px #5b9dd9,
+ 0 0 2px 1px rgba(30, 140, 190, 0.8);
+}
+
+
+@media screen and (max-width: 782px) {
+ #available-menu-items #available-menu-items-search .accordion-section-content {
+ top: 63px;
+ }
+}
+
+@media screen and (max-width: 640px) {
+ #available-menu-items #available-menu-items-search .accordion-section-content {
+ top: 130px;
+ }
+}
diff --git a/www/crm/wp-admin/css/customize-nav-menus-rtl.min.css b/www/crm/wp-admin/css/customize-nav-menus-rtl.min.css
new file mode 100644
index 00000000..2dea5156
--- /dev/null
+++ b/www/crm/wp-admin/css/customize-nav-menus-rtl.min.css
@@ -0,0 +1,2 @@
+/*! This file is auto-generated */
+#customize-theme-controls #accordion-section-menu_locations{position:relative;margin-top:30px}#customize-theme-controls #accordion-section-menu_locations>.accordion-section-title{border-bottom-color:#ddd;margin-top:15px}#customize-theme-controls .customize-section-title-menu_locations-description,#customize-theme-controls .customize-section-title-menu_locations-heading,#customize-theme-controls .customize-section-title-nav_menus-heading{padding:0 12px 0 12px}#customize-theme-controls .customize-control-description.customize-section-title-menu_locations-description{font-style:normal}.menu-in-location,.menu-in-locations{display:block;font-weight:600;font-size:10px}#customize-controls .control-section .accordion-section-title:focus .menu-in-location,#customize-controls .control-section .accordion-section-title:hover .menu-in-location,#customize-controls .theme-location-set{color:#555}.customize-control-nav_menu_location .create-menu,.customize-control-nav_menu_location .edit-menu{margin-right:6px;vertical-align:middle;line-height:2.2}#customize-controls .customize-control-nav_menu_name{margin-bottom:12px}.customize-control-nav_menu_name p:last-of-type{margin-bottom:0}#customize-new-menu-submit{float:left;min-width:85px}.wp-customizer .menu-item-bar .menu-item-handle,.wp-customizer .menu-item-settings,.wp-customizer .menu-item-settings .description-thin{box-sizing:border-box}.wp-customizer .menu-item-bar{margin:0}.wp-customizer .menu-item-bar .menu-item-handle{width:100%;background:#fff}.wp-customizer .menu-item-handle .item-title{margin-left:0}.wp-customizer .menu-item-handle .item-type{padding:1px 5px 0 21px;float:left;text-align:left}.wp-customizer .menu-item-handle:hover{z-index:8}.customize-control-nav_menu_item.has-notifications .menu-item-handle{border-right:4px solid #00a0d2}.wp-customizer .menu-item-settings{max-width:100%;overflow:hidden;z-index:8;padding:10px;background:#eee;border:1px solid #999;border-top:none}.wp-customizer .menu-item-settings .description-thin{width:100%;height:auto;margin:0 0 8px 0}.wp-customizer .menu-item-settings input[type=text]{width:100%}.wp-customizer .menu-item-settings .submitbox{margin:0;padding:0}.wp-customizer .menu-item-settings .link-to-original{padding:5px 0;border:none;font-style:normal;margin:0;width:100%}.wp-customizer .menu-item .submitbox .submitdelete{float:right;margin:6px 0 0;padding:0;cursor:pointer}.menu-item-reorder-nav{display:none;background-color:#fff;position:absolute;top:0;left:0}.menus-move-left:before{content:"\f345"}.menus-move-right:before{content:"\f341"}.reordering .menu-item .item-controls,.reordering .menu-item .item-type{display:none}.reordering .menu-item-reorder-nav{display:block}.customize-control input.menu-name-field{width:100%}.wp-customizer .menu-item .item-edit{position:absolute;left:-19px;top:2px;display:block;width:30px;height:38px;margin-left:0!important;box-shadow:none;outline:0;overflow:hidden;cursor:pointer;text-align:center}.wp-customizer .menu-item.menu-item-edit-active .item-edit .toggle-indicator:before{content:"\f142"}.wp-customizer .menu-item-settings p.description{font-style:normal}.wp-customizer .menu-settings dl{margin:12px 0 0 0;padding:0}.wp-customizer .menu-settings .checkbox-input{margin-top:8px}.wp-customizer .menu-settings .menu-theme-locations{border-top:1px solid #ccc}.wp-customizer .menu-settings{margin-top:36px;border-top:none}.wp-customizer .menu-location-settings{margin-top:12px;border-top:none}.wp-customizer .control-section-nav_menu .menu-location-settings{margin-top:24px;border-top:1px solid #ddd}.customize-control-nav_menu_auto_add,.wp-customizer .control-section-nav_menu .menu-location-settings{padding-top:12px}.menu-location-settings .customize-control-checkbox .theme-location-set{line-height:1}.customize-control-nav_menu_auto_add label{vertical-align:top}.menu-location-settings .new-menu-locations-widget-note{display:block}.customize-control-menu{margin-top:4px}#customize-controls .customize-info.open.active-menu-screen-options .customize-help-toggle{color:#555}.customize-screen-options-toggle{background:0 0;border:none;color:#555;cursor:pointer;margin:0;padding:20px;position:absolute;left:0;top:30px}#customize-controls .customize-info .customize-help-toggle{padding:20px}#customize-controls .customize-info .customize-help-toggle:before{padding:4px}#customize-controls .customize-info.open.active-menu-screen-options .customize-help-toggle:active,#customize-controls .customize-info.open.active-menu-screen-options .customize-help-toggle:focus,#customize-controls .customize-info.open.active-menu-screen-options .customize-help-toggle:hover,.active-menu-screen-options .customize-screen-options-toggle,.customize-screen-options-toggle:active,.customize-screen-options-toggle:focus,.customize-screen-options-toggle:hover{color:#0073aa}#customize-controls .customize-info .customize-help-toggle:focus,.customize-screen-options-toggle:focus{outline:0}.customize-screen-options-toggle:before{-moz-osx-font-smoothing:grayscale;border:none;content:"\f111";display:block;font:18px/1 dashicons;padding:5px;text-align:center;text-decoration:none!important;text-indent:0;right:6px;position:absolute;top:6px}#customize-controls .customize-info .customize-help-toggle:focus:before,.customize-screen-options-toggle:focus:before{border-radius:100%}.wp-customizer #screen-options-wrap{display:none;background:#fff;border-top:1px solid #ddd;padding:4px 15px 15px}.wp-customizer .metabox-prefs label{display:block;padding-left:0;line-height:30px}.wp-customizer .toggle-indicator{display:inline-block;font-size:20px;line-height:1}.rtl .wp-customizer .toggle-indicator{text-indent:1px}#available-menu-items .accordion-section-title .toggle-indicator:before,.wp-customizer .menu-item .item-edit .toggle-indicator:before{content:"\f140";display:block;padding:1px 0 1px 2px;speak:none;border-radius:50%;color:#72777c;font:normal 20px/1 dashicons;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-decoration:none!important}.control-section-nav_menu .field-css-classes,.control-section-nav_menu .field-description,.control-section-nav_menu .field-link-target,.control-section-nav_menu .field-title-attribute,.control-section-nav_menu .field-xfn{display:none}.control-section-nav_menu.field-css-classes-active .field-css-classes,.control-section-nav_menu.field-description-active .field-description,.control-section-nav_menu.field-link-target-active .field-link-target,.control-section-nav_menu.field-title-attribute-active .field-title-attribute,.control-section-nav_menu.field-xfn-active .field-xfn{display:block}.menu-item-depth-0{margin-right:0}.menu-item-depth-1{margin-right:20px}.menu-item-depth-2{margin-right:40px}.menu-item-depth-3{margin-right:60px}.menu-item-depth-4{margin-right:80px}.menu-item-depth-5{margin-right:100px}.menu-item-depth-6{margin-right:120px}.menu-item-depth-7{margin-right:140px}.menu-item-depth-8{margin-right:160px}.menu-item-depth-9{margin-right:180px}.menu-item-depth-10{margin-right:200px}.menu-item-depth-11{margin-right:220px}.menu-item-depth-0>.menu-item-bar{margin-left:0}.menu-item-depth-1>.menu-item-bar{margin-left:20px}.menu-item-depth-2>.menu-item-bar{margin-left:40px}.menu-item-depth-3>.menu-item-bar{margin-left:60px}.menu-item-depth-4>.menu-item-bar{margin-left:80px}.menu-item-depth-5>.menu-item-bar{margin-left:100px}.menu-item-depth-6>.menu-item-bar{margin-left:120px}.menu-item-depth-7>.menu-item-bar{margin-left:140px}.menu-item-depth-8>.menu-item-bar{margin-left:160px}.menu-item-depth-9>.menu-item-bar{margin-left:180px}.menu-item-depth-10>.menu-item-bar{margin-left:200px}.menu-item-depth-11>.menu-item-bar{margin-left:220px}.menu-item-depth-0 .menu-item-transport{margin-right:0}.menu-item-depth-1 .menu-item-transport{margin-right:-20px}.menu-item-depth-3 .menu-item-transport{margin-right:-60px}.menu-item-depth-4 .menu-item-transport{margin-right:-80px}.menu-item-depth-2 .menu-item-transport{margin-right:-40px}.menu-item-depth-5 .menu-item-transport{margin-right:-100px}.menu-item-depth-6 .menu-item-transport{margin-right:-120px}.menu-item-depth-7 .menu-item-transport{margin-right:-140px}.menu-item-depth-8 .menu-item-transport{margin-right:-160px}.menu-item-depth-9 .menu-item-transport{margin-right:-180px}.menu-item-depth-10 .menu-item-transport{margin-right:-200px}.menu-item-depth-11 .menu-item-transport{margin-right:-220px}.reordering .menu-item-depth-0{margin-right:0}.reordering .menu-item-depth-1{margin-right:15px}.reordering .menu-item-depth-2{margin-right:30px}.reordering .menu-item-depth-3{margin-right:45px}.reordering .menu-item-depth-4{margin-right:60px}.reordering .menu-item-depth-5{margin-right:75px}.reordering .menu-item-depth-6{margin-right:90px}.reordering .menu-item-depth-7{margin-right:105px}.reordering .menu-item-depth-8{margin-right:120px}.reordering .menu-item-depth-9{margin-right:135px}.reordering .menu-item-depth-10{margin-right:150px}.reordering .menu-item-depth-11{margin-right:165px}.reordering .menu-item-depth-0>.menu-item-bar{margin-left:0}.reordering .menu-item-depth-1>.menu-item-bar{margin-left:15px}.reordering .menu-item-depth-2>.menu-item-bar{margin-left:30px}.reordering .menu-item-depth-3>.menu-item-bar{margin-left:45px}.reordering .menu-item-depth-4>.menu-item-bar{margin-left:60px}.reordering .menu-item-depth-5>.menu-item-bar{margin-left:75px}.reordering .menu-item-depth-6>.menu-item-bar{margin-left:90px}.reordering .menu-item-depth-7>.menu-item-bar{margin-left:105px}.reordering .menu-item-depth-8>.menu-item-bar{margin-left:120px}.reordering .menu-item-depth-9>.menu-item-bar{margin-left:135px}.reordering .menu-item-depth-10>.menu-item-bar{margin-left:150px}.reordering .menu-item-depth-11>.menu-item-bar{margin-left:165px}.control-section-nav_menu.menu .menu-item-edit-active{margin-right:0}.control-section-nav_menu.menu .menu-item-edit-active .menu-item-bar{margin-left:0}.control-section-nav_menu.menu .sortable-placeholder{margin-top:0;margin-bottom:1px;max-width:calc(100% - 2px);float:right;display:list-item;border-color:#a0a5aa}.menu-item-transport li.customize-control{float:none}.control-section-nav_menu.menu ul.menu-item-transport .menu-item-bar{margin-top:0}.adding-menu-items .control-section{opacity:.4}.adding-menu-items .control-panel.control-section,.adding-menu-items .control-section.open{opacity:1}.menu-item-bar .item-delete{color:#a00;position:absolute;top:2px;left:-19px;width:30px;height:38px;cursor:pointer;display:none}.menu-item-bar .item-delete:before{content:"\f335";position:absolute;top:9px;right:5px;border-radius:50%;font:normal 20px/1 dashicons;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.ie8 .menu-item-bar .item-delete:before{top:-10px}.menu-item-bar .item-delete:focus,.menu-item-bar .item-delete:hover{box-shadow:none;outline:0;color:#dc3232}.adding-menu-items .menu-item-bar .item-edit{display:none}.adding-menu-items .menu-item-bar .item-delete{display:block}#available-menu-items.opening{overflow-y:hidden}#available-menu-items #available-menu-items-search.open{height:100%;border-bottom:none}#available-menu-items .accordion-section-title{border-right:none;border-left:none;background:#fff;transition:background-color .15s;-webkit-user-select:auto;-moz-user-select:auto;-ms-user-select:auto;user-select:auto}#available-menu-items #available-menu-items-search .accordion-section-title,#available-menu-items .open .accordion-section-title{background:#eee}#available-menu-items .accordion-section-title:after{content:none!important}#available-menu-items .accordion-section-title:hover .toggle-indicator:before,#available-menu-items .button-link:focus .toggle-indicator:before,#available-menu-items .button-link:hover .toggle-indicator:before{color:#23282d}#available-menu-items .open .accordion-section-title .toggle-indicator:before{content:"\f142";color:#23282d}#available-menu-items .available-menu-items-list{overflow-y:auto;max-height:200px;background:0 0}#available-menu-items .accordion-section-title button{display:block;width:28px;height:35px;position:absolute;top:5px;left:5px;box-shadow:none;outline:0;cursor:pointer;text-align:center}#available-menu-items .accordion-section-title .no-items,#available-menu-items .cannot-expand .accordion-section-title .spinner,#available-menu-items .cannot-expand .accordion-section-title>button{display:none}#available-menu-items-search.cannot-expand .accordion-section-title .spinner{display:block}#available-menu-items .cannot-expand .accordion-section-title .no-items{float:left;color:#555d66;font-weight:400;margin-right:5px}#available-menu-items .accordion-section-content{max-height:290px;margin:0;padding:0;position:relative;background:0 0}#available-menu-items .accordion-section-content .available-menu-items-list{margin:0 0 45px 0;padding:1px 15px 15px 15px}#available-menu-items .accordion-section-content .available-menu-items-list:only-child{margin-bottom:0}#new-custom-menu-item .accordion-section-content{padding:0 15px 15px 15px}#available-menu-items .menu-item-tpl{margin:0}#available-menu-items .new-content-item .create-item-input.invalid,#available-menu-items .new-content-item .create-item-input.invalid:focus,#custom-menu-item-name.invalid,#custom-menu-item-url.invalid,.edit-menu-item-url.invalid,.menu-name-field.invalid,.menu-name-field.invalid:focus{border:1px solid #dc3232}#available-menu-items .menu-item-handle .item-type{padding-left:0}#available-menu-items .menu-item-handle .item-title{padding-right:20px}#available-menu-items .menu-item-handle{cursor:pointer}#available-menu-items .menu-item-handle{box-shadow:none;margin-top:-1px}#available-menu-items .menu-item-handle:hover{z-index:1}#available-menu-items .item-title h4{padding:0 0 5px;font-size:14px}#available-menu-items .item-add{position:absolute;top:1px;right:1px;color:#82878c;width:30px;height:38px;box-shadow:none;outline:0;cursor:pointer;text-align:center}#available-menu-items .menu-item-handle .item-add:focus{color:#23282d}#available-menu-items .item-add:before{content:"\f543";position:relative;right:2px;top:3px;display:inline-block;height:20px;border-radius:50%;font:normal 20px/1.05 dashicons}#available-menu-items .menu-item-handle.item-added .item-add:focus,#available-menu-items .menu-item-handle.item-added .item-title,#available-menu-items .menu-item-handle.item-added .item-type,#available-menu-items .menu-item-handle.item-added:hover .item-add{color:#82878c}#available-menu-items .menu-item-handle.item-added .item-add:before{content:"\f147"}#available-menu-items .accordion-section-title.loading .spinner,#available-menu-items-search.loading .accordion-section-title .spinner{visibility:visible;margin:0 20px}#available-menu-items-search .spinner{position:absolute;top:20px;left:21px;margin:0!important}#available-menu-items #available-menu-items-search .accordion-section-content{position:absolute;right:0;top:60px;bottom:0;max-height:none;width:100%;padding:1px 15px 15px;box-sizing:border-box}#available-menu-items-search .nothing-found{margin-top:-1px}#available-menu-items-search .accordion-section-title:after{display:none}#available-menu-items-search .accordion-section-content:empty{min-height:0;padding:0}#available-menu-items-search.loading .accordion-section-content div{opacity:.5}#available-menu-items-search.loading.loading-more .accordion-section-content div{opacity:1}#customize-preview{transition:all .2s}body.adding-menu-items #available-menu-items{right:0;visibility:visible}body.adding-menu-items .wp-full-overlay-main{right:300px}body.adding-menu-items #customize-preview{opacity:.4}body.adding-menu-items #customize-preview iframe{pointer-events:none}.menu-item-handle .spinner{display:none;float:right;margin:0 0 0 8px}.nav-menu-inserted-item-loading .spinner{display:block}.nav-menu-inserted-item-loading .menu-item-handle .item-type{padding:0 8px 0 0}.added-menu-item .menu-item-handle.loading,.nav-menu-inserted-item-loading .menu-item-handle{padding:10px 8px 10px 15px;cursor:default;opacity:.5;background:#fff;color:#727773}.added-menu-item .menu-item-handle{transition-property:opacity,background,color;transition-duration:1.25s;transition-timing-function:cubic-bezier(.25,-2.5,.75,8)}#customize-theme-controls .control-panel-content .control-section-nav_menu:nth-last-child(2) .accordion-section-title{border-bottom-color:#ddd}#accordion-section-add_menu{margin:15px 12px}#accordion-section-add_menu h3{text-align:left}#accordion-section-add_menu .customize-add-menu-button,#accordion-section-add_menu h3{margin:0}#accordion-section-add_menu .customize-add-menu-button{font-weight:400}#create-new-menu-submit{float:left;margin:0 0 12px 0}.menu-delete-item{float:right;padding:1em 0;width:100%}.assigned-menu-locations-title p{margin:0 0 8px 0}li.assigned-to-menu-location .menu-delete-item{display:none}li.assigned-to-menu-location .add-new-menu-item{margin-bottom:1em}.menu-item-handle{margin-top:-1px}.ui-sortable-disabled .menu-item-handle{cursor:default}.menu-item-handle:hover{position:relative;z-index:10;color:#0073aa}#available-menu-items .menu-item-handle:hover .item-add,.menu-item-handle:hover .item-edit,.menu-item-handle:hover .item-type{color:#0073aa}.menu-item-edit-active .menu-item-handle{border-color:#999;border-bottom:none}.customize-control-nav_menu_item{margin-bottom:0}.customize-control-nav_menu .new-menu-item-invitation{margin-top:0;margin-bottom:0}.customize-control-nav_menu .customize-control-nav_menu-buttons{margin-top:12px}#available-menu-items .item-add:focus:before,#customize-controls .customize-info .customize-help-toggle:focus:before,.customize-screen-options-toggle:focus:before,.menu-delete:focus,.menu-item-bar .item-delete:focus:before,.wp-customizer .menu-item .submitbox .submitdelete:focus,.wp-customizer button:focus .toggle-indicator:before{box-shadow:0 0 0 1px #5b9dd9,0 0 2px 1px rgba(30,140,190,.8)}@media screen and (max-width:782px){#available-menu-items #available-menu-items-search .accordion-section-content{top:63px}}@media screen and (max-width:640px){#available-menu-items #available-menu-items-search .accordion-section-content{top:130px}} \ No newline at end of file
diff --git a/www/crm/wp-admin/css/customize-nav-menus.css b/www/crm/wp-admin/css/customize-nav-menus.css
new file mode 100644
index 00000000..14593825
--- /dev/null
+++ b/www/crm/wp-admin/css/customize-nav-menus.css
@@ -0,0 +1,887 @@
+#customize-theme-controls #accordion-section-menu_locations {
+ position: relative;
+ margin-top: 30px;
+}
+
+#customize-theme-controls #accordion-section-menu_locations > .accordion-section-title {
+ border-bottom-color: #ddd;
+ margin-top: 15px;
+}
+
+#customize-theme-controls .customize-section-title-nav_menus-heading,
+#customize-theme-controls .customize-section-title-menu_locations-heading,
+#customize-theme-controls .customize-section-title-menu_locations-description {
+ padding: 0 12px 0 12px;
+}
+
+#customize-theme-controls .customize-control-description.customize-section-title-menu_locations-description {
+ /* Override the default italic style for control descriptions */
+ font-style: normal;
+}
+
+.menu-in-location,
+.menu-in-locations {
+ display: block;
+ font-weight: 600;
+ font-size: 10px;
+}
+
+#customize-controls .theme-location-set,
+#customize-controls .control-section .accordion-section-title:focus .menu-in-location,
+#customize-controls .control-section .accordion-section-title:hover .menu-in-location {
+ color: #555;
+}
+
+/* The `edit-menu` and `create-menu` buttons also use the `button-link` class. */
+.customize-control-nav_menu_location .edit-menu,
+.customize-control-nav_menu_location .create-menu {
+ margin-left: 6px;
+ vertical-align: middle;
+ line-height: 2.2;
+}
+
+#customize-controls .customize-control-nav_menu_name {
+ margin-bottom: 12px;
+}
+
+.customize-control-nav_menu_name p:last-of-type {
+ margin-bottom: 0;
+}
+
+#customize-new-menu-submit {
+ float: right;
+ min-width: 85px;
+}
+
+.wp-customizer .menu-item-bar .menu-item-handle,
+.wp-customizer .menu-item-settings,
+.wp-customizer .menu-item-settings .description-thin {
+ box-sizing: border-box;
+}
+
+.wp-customizer .menu-item-bar {
+ margin: 0;
+}
+
+.wp-customizer .menu-item-bar .menu-item-handle {
+ width: 100%;
+ background: #fff;
+}
+
+.wp-customizer .menu-item-handle .item-title {
+ margin-right: 0;
+}
+
+.wp-customizer .menu-item-handle .item-type {
+ padding: 1px 21px 0 5px;
+ float: right;
+ text-align: right;
+}
+
+.wp-customizer .menu-item-handle:hover {
+ z-index: 8;
+}
+
+.customize-control-nav_menu_item.has-notifications .menu-item-handle {
+ border-left: 4px solid #00a0d2;
+}
+
+.wp-customizer .menu-item-settings {
+ max-width: 100%;
+ overflow: hidden;
+ z-index: 8;
+ padding: 10px;
+ background: #eee;
+ border: 1px solid #999;
+ border-top: none;
+}
+
+.wp-customizer .menu-item-settings .description-thin {
+ width: 100%;
+ height: auto;
+ margin: 0 0 8px 0;
+}
+
+.wp-customizer .menu-item-settings input[type="text"] {
+ width: 100%;
+}
+
+.wp-customizer .menu-item-settings .submitbox {
+ margin: 0;
+ padding: 0;
+}
+
+.wp-customizer .menu-item-settings .link-to-original {
+ padding: 5px 0;
+ border: none;
+ font-style: normal;
+ margin: 0;
+ width: 100%;
+}
+
+.wp-customizer .menu-item .submitbox .submitdelete {
+ float: left;
+ margin: 6px 0 0;
+ padding: 0;
+ cursor: pointer;
+}
+
+
+/**
+ * Menu items reordering styles
+ */
+
+.menu-item-reorder-nav {
+ display: none;
+ background-color: #fff;
+ position: absolute;
+ top: 0;
+ right: 0;
+}
+
+.menus-move-left:before {
+ content: "\f341";
+}
+
+.menus-move-right:before {
+ content: "\f345";
+}
+
+.reordering .menu-item .item-controls,
+.reordering .menu-item .item-type {
+ display: none;
+}
+
+.reordering .menu-item-reorder-nav {
+ display: block;
+}
+
+.customize-control input.menu-name-field {
+ width: 100%; /* Override the 98% default for customizer inputs, to align with the size of menu items. */
+}
+
+.wp-customizer .menu-item .item-edit {
+ position: absolute;
+ right: -19px;
+ top: 2px;
+ display: block;
+ width: 30px;
+ height: 38px;
+ margin-right: 0 !important;
+ box-shadow: none;
+ outline: none;
+ overflow: hidden;
+ cursor: pointer;
+ text-align: center;
+}
+
+.wp-customizer .menu-item.menu-item-edit-active .item-edit .toggle-indicator:before {
+ content: "\f142";
+}
+
+.wp-customizer .menu-item-settings p.description {
+ font-style: normal;
+}
+
+.wp-customizer .menu-settings dl {
+ margin: 12px 0 0 0;
+ padding: 0;
+}
+
+.wp-customizer .menu-settings .checkbox-input {
+ margin-top: 8px;
+}
+
+.wp-customizer .menu-settings .menu-theme-locations {
+ border-top: 1px solid #ccc;
+}
+
+.wp-customizer .menu-settings {
+ margin-top: 36px;
+ border-top: none;
+}
+
+.wp-customizer .menu-location-settings {
+ margin-top: 12px;
+ border-top: none;
+}
+
+.wp-customizer .control-section-nav_menu .menu-location-settings {
+ margin-top: 24px;
+ border-top: 1px solid #ddd;
+}
+
+.wp-customizer .control-section-nav_menu .menu-location-settings,
+.customize-control-nav_menu_auto_add {
+ padding-top: 12px;
+}
+
+.menu-location-settings .customize-control-checkbox .theme-location-set {
+ line-height: 1;
+}
+
+.customize-control-nav_menu_auto_add label {
+ vertical-align: top;
+}
+
+.menu-location-settings .new-menu-locations-widget-note {
+ display: block;
+}
+
+.customize-control-menu {
+ margin-top: 4px;
+}
+
+#customize-controls .customize-info.open.active-menu-screen-options .customize-help-toggle {
+ color: #555;
+}
+
+/* Screen Options */
+.customize-screen-options-toggle {
+ background: none;
+ border: none;
+ color: #555;
+ cursor: pointer;
+ margin: 0;
+ padding: 20px;
+ position: absolute;
+ right: 0;
+ top: 30px;
+}
+
+#customize-controls .customize-info .customize-help-toggle {
+ padding: 20px;
+}
+
+#customize-controls .customize-info .customize-help-toggle:before {
+ padding: 4px;
+}
+
+.customize-screen-options-toggle:hover,
+.customize-screen-options-toggle:active,
+.customize-screen-options-toggle:focus,
+.active-menu-screen-options .customize-screen-options-toggle,
+#customize-controls .customize-info.open.active-menu-screen-options .customize-help-toggle:hover,
+#customize-controls .customize-info.open.active-menu-screen-options .customize-help-toggle:active,
+#customize-controls .customize-info.open.active-menu-screen-options .customize-help-toggle:focus {
+ color: #0073aa;
+}
+
+.customize-screen-options-toggle:focus,
+#customize-controls .customize-info .customize-help-toggle:focus {
+ outline: none;
+}
+
+.customize-screen-options-toggle:before {
+ -moz-osx-font-smoothing: grayscale;
+ border: none;
+ content: "\f111";
+ display: block;
+ font: 18px/1 dashicons;
+ padding: 5px;
+ text-align: center;
+ text-decoration: none !important;
+ text-indent: 0;
+ left: 6px;
+ position: absolute;
+ top: 6px;
+}
+
+.customize-screen-options-toggle:focus:before,
+#customize-controls .customize-info .customize-help-toggle:focus:before {
+ border-radius: 100%;
+}
+
+.wp-customizer #screen-options-wrap {
+ display: none;
+ background: #fff;
+ border-top: 1px solid #ddd;
+ padding: 4px 15px 15px;
+}
+
+.wp-customizer .metabox-prefs label {
+ display: block;
+ padding-right: 0;
+ line-height: 30px;
+}
+
+/* rework the arrow indicator implementation for NVDA bug same as #32715 */
+.wp-customizer .toggle-indicator {
+ display: inline-block;
+ font-size: 20px;
+ line-height: 1;
+}
+
+.rtl .wp-customizer .toggle-indicator {
+ text-indent: 1px; /* account for the dashicon alignment */
+}
+
+.wp-customizer .menu-item .item-edit .toggle-indicator:before,
+#available-menu-items .accordion-section-title .toggle-indicator:before {
+ content: "\f140";
+ display: block;
+ padding: 1px 2px 1px 0px;
+ speak: none;
+ border-radius: 50%;
+ color: #72777c;
+ font: normal 20px/1 dashicons;
+ -webkit-font-smoothing: antialiased;
+ -moz-osx-font-smoothing: grayscale;
+ text-decoration: none !important;
+}
+
+.control-section-nav_menu .field-link-target,
+.control-section-nav_menu .field-title-attribute,
+.control-section-nav_menu .field-css-classes,
+.control-section-nav_menu .field-xfn,
+.control-section-nav_menu .field-description {
+ display: none;
+}
+
+.control-section-nav_menu.field-link-target-active .field-link-target,
+.control-section-nav_menu.field-title-attribute-active .field-title-attribute,
+.control-section-nav_menu.field-css-classes-active .field-css-classes,
+.control-section-nav_menu.field-xfn-active .field-xfn,
+.control-section-nav_menu.field-description-active .field-description {
+ display: block;
+}
+
+/* WARNING: The 20px factor is hard-coded in JS. */
+.menu-item-depth-0 { margin-left: 0; }
+.menu-item-depth-1 { margin-left: 20px; }
+.menu-item-depth-2 { margin-left: 40px; }
+.menu-item-depth-3 { margin-left: 60px; }
+.menu-item-depth-4 { margin-left: 80px; }
+.menu-item-depth-5 { margin-left: 100px; }
+.menu-item-depth-6 { margin-left: 120px; }
+.menu-item-depth-7 { margin-left: 140px; }
+.menu-item-depth-8 { margin-left: 160px; } /* Not likely to be used or useful beyond this depth */
+.menu-item-depth-9 { margin-left: 180px; }
+.menu-item-depth-10 { margin-left: 200px; }
+.menu-item-depth-11 { margin-left: 220px; }
+
+/* @todo handle .menu-item-settings width */
+.menu-item-depth-0 > .menu-item-bar { margin-right: 0; }
+.menu-item-depth-1 > .menu-item-bar { margin-right: 20px; }
+.menu-item-depth-2 > .menu-item-bar { margin-right: 40px; }
+.menu-item-depth-3 > .menu-item-bar { margin-right: 60px; }
+.menu-item-depth-4 > .menu-item-bar { margin-right: 80px; }
+.menu-item-depth-5 > .menu-item-bar { margin-right: 100px; }
+.menu-item-depth-6 > .menu-item-bar { margin-right: 120px; }
+.menu-item-depth-7 > .menu-item-bar { margin-right: 140px; }
+.menu-item-depth-8 > .menu-item-bar { margin-right: 160px; }
+.menu-item-depth-9 > .menu-item-bar { margin-right: 180px; }
+.menu-item-depth-10 > .menu-item-bar { margin-right: 200px; }
+.menu-item-depth-11 > .menu-item-bar { margin-right: 220px; }
+
+/* Submenu left margin. */
+.menu-item-depth-0 .menu-item-transport { margin-left: 0; }
+.menu-item-depth-1 .menu-item-transport { margin-left: -20px; }
+.menu-item-depth-3 .menu-item-transport { margin-left: -60px; }
+.menu-item-depth-4 .menu-item-transport { margin-left: -80px; }
+.menu-item-depth-2 .menu-item-transport { margin-left: -40px; }
+.menu-item-depth-5 .menu-item-transport { margin-left: -100px; }
+.menu-item-depth-6 .menu-item-transport { margin-left: -120px; }
+.menu-item-depth-7 .menu-item-transport { margin-left: -140px; }
+.menu-item-depth-8 .menu-item-transport { margin-left: -160px; }
+.menu-item-depth-9 .menu-item-transport { margin-left: -180px; }
+.menu-item-depth-10 .menu-item-transport { margin-left: -200px; }
+.menu-item-depth-11 .menu-item-transport { margin-left: -220px; }
+
+/* WARNING: The 20px factor is hard-coded in JS. */
+.reordering .menu-item-depth-0 { margin-left: 0; }
+.reordering .menu-item-depth-1 { margin-left: 15px; }
+.reordering .menu-item-depth-2 { margin-left: 30px; }
+.reordering .menu-item-depth-3 { margin-left: 45px; }
+.reordering .menu-item-depth-4 { margin-left: 60px; }
+.reordering .menu-item-depth-5 { margin-left: 75px; }
+.reordering .menu-item-depth-6 { margin-left: 90px; }
+.reordering .menu-item-depth-7 { margin-left: 105px; }
+.reordering .menu-item-depth-8 { margin-left: 120px; } /* Not likely to be used or useful beyond this depth */
+.reordering .menu-item-depth-9 { margin-left: 135px; }
+.reordering .menu-item-depth-10 { margin-left: 150px; }
+.reordering .menu-item-depth-11 { margin-left: 165px; }
+
+.reordering .menu-item-depth-0 > .menu-item-bar { margin-right: 0; }
+.reordering .menu-item-depth-1 > .menu-item-bar { margin-right: 15px; }
+.reordering .menu-item-depth-2 > .menu-item-bar { margin-right: 30px; }
+.reordering .menu-item-depth-3 > .menu-item-bar { margin-right: 45px; }
+.reordering .menu-item-depth-4 > .menu-item-bar { margin-right: 60px; }
+.reordering .menu-item-depth-5 > .menu-item-bar { margin-right: 75px; }
+.reordering .menu-item-depth-6 > .menu-item-bar { margin-right: 90px; }
+.reordering .menu-item-depth-7 > .menu-item-bar { margin-right: 105px; }
+.reordering .menu-item-depth-8 > .menu-item-bar { margin-right: 120px; }
+.reordering .menu-item-depth-9 > .menu-item-bar { margin-right: 135px; }
+.reordering .menu-item-depth-10 > .menu-item-bar { margin-right: 150px; }
+.reordering .menu-item-depth-11 > .menu-item-bar { margin-right: 165px; }
+
+.control-section-nav_menu.menu .menu-item-edit-active {
+ margin-left: 0;
+}
+
+.control-section-nav_menu.menu .menu-item-edit-active .menu-item-bar {
+ margin-right: 0;
+}
+
+.control-section-nav_menu.menu .sortable-placeholder {
+ margin-top: 0;
+ margin-bottom: 1px;
+ max-width: calc(100% - 2px);
+ float: left;
+ display: list-item;
+ border-color: #a0a5aa;
+}
+
+.menu-item-transport li.customize-control {
+ float: none;
+}
+
+.control-section-nav_menu.menu ul.menu-item-transport .menu-item-bar {
+ margin-top: 0;
+}
+
+/**
+ * Add-menu-items mode
+ */
+
+.adding-menu-items .control-section {
+ opacity: .4;
+}
+
+.adding-menu-items .control-panel.control-section,
+.adding-menu-items .control-section.open {
+ opacity: 1;
+}
+
+.menu-item-bar .item-delete {
+ color: #a00;
+ position: absolute;
+ top: 2px;
+ right: -19px;
+ width: 30px;
+ height: 38px;
+ cursor: pointer;
+ display: none;
+}
+
+.menu-item-bar .item-delete:before {
+ content: "\f335";
+ position: absolute;
+ top: 9px;
+ left: 5px;
+ border-radius: 50%;
+ font: normal 20px/1 dashicons;
+ -webkit-font-smoothing: antialiased;
+ -moz-osx-font-smoothing: grayscale;
+}
+
+.ie8 .menu-item-bar .item-delete:before {
+ top: -10px;
+}
+
+.menu-item-bar .item-delete:hover,
+.menu-item-bar .item-delete:focus {
+ box-shadow: none;
+ outline: none;
+ color: #dc3232;
+}
+
+.adding-menu-items .menu-item-bar .item-edit {
+ display: none;
+}
+
+.adding-menu-items .menu-item-bar .item-delete {
+ display: block;
+}
+
+/**
+ * Styles for menu-item addition panel
+ */
+
+#available-menu-items.opening {
+ overflow-y: hidden; /* avoid scrollbar jitter with animating heights */
+}
+
+#available-menu-items #available-menu-items-search.open {
+ height: 100%;
+ border-bottom: none;
+}
+
+#available-menu-items .accordion-section-title {
+ border-left: none;
+ border-right: none;
+ background: #fff;
+ transition: background-color 0.15s;
+ /* Reset the value inherited from the base .accordion-section-title style. Ticket #37589. */
+ -webkit-user-select: auto;
+ -moz-user-select: auto;
+ -ms-user-select: auto;
+ user-select: auto;
+}
+
+#available-menu-items .open .accordion-section-title,
+#available-menu-items #available-menu-items-search .accordion-section-title {
+ background: #eee;
+}
+
+/* rework the arrow indicator implementation for NVDA bug see #32715 */
+#available-menu-items .accordion-section-title:after {
+ content: none !important;
+}
+
+#available-menu-items .accordion-section-title:hover .toggle-indicator:before,
+#available-menu-items .button-link:hover .toggle-indicator:before,
+#available-menu-items .button-link:focus .toggle-indicator:before {
+ color: #23282d;
+}
+
+#available-menu-items .open .accordion-section-title .toggle-indicator:before {
+ content: "\f142";
+ color: #23282d;
+}
+
+#available-menu-items .available-menu-items-list {
+ overflow-y: auto;
+ max-height: 200px; /* This gets set in JS to fit the screen size, and based on # of sections. */
+ background: transparent;
+}
+
+#available-menu-items .accordion-section-title button {
+ display: block;
+ width: 28px;
+ height: 35px;
+ position: absolute;
+ top: 5px;
+ right: 5px;
+ box-shadow: none;
+ outline: none;
+ cursor: pointer;
+ text-align: center;
+}
+
+#available-menu-items .accordion-section-title .no-items,
+#available-menu-items .cannot-expand .accordion-section-title .spinner,
+#available-menu-items .cannot-expand .accordion-section-title > button {
+ display: none;
+}
+
+#available-menu-items-search.cannot-expand .accordion-section-title .spinner {
+ display: block;
+}
+
+#available-menu-items .cannot-expand .accordion-section-title .no-items {
+ float: right;
+ color: #555d66;
+ font-weight: 400;
+ margin-left: 5px;
+}
+
+#available-menu-items .accordion-section-content {
+ max-height: 290px;
+ margin: 0;
+ padding: 0;
+ position: relative;
+ background: transparent;
+}
+
+#available-menu-items .accordion-section-content .available-menu-items-list {
+ margin: 0 0 45px 0;
+ padding: 1px 15px 15px 15px;
+}
+
+#available-menu-items .accordion-section-content .available-menu-items-list:only-child { /* Types that do not support new items for the current user */
+ margin-bottom: 0;
+}
+
+#new-custom-menu-item .accordion-section-content {
+ padding: 0 15px 15px 15px;
+}
+
+#available-menu-items .menu-item-tpl {
+ margin: 0;
+}
+
+#custom-menu-item-name.invalid,
+#custom-menu-item-url.invalid,
+.edit-menu-item-url.invalid,
+.menu-name-field.invalid,
+.menu-name-field.invalid:focus,
+#available-menu-items .new-content-item .create-item-input.invalid,
+#available-menu-items .new-content-item .create-item-input.invalid:focus {
+ border: 1px solid #dc3232;
+}
+
+#available-menu-items .menu-item-handle .item-type {
+ padding-right: 0;
+}
+
+#available-menu-items .menu-item-handle .item-title {
+ padding-left: 20px;
+}
+
+#available-menu-items .menu-item-handle {
+ cursor: pointer;
+}
+
+#available-menu-items .menu-item-handle {
+ box-shadow: none;
+ margin-top: -1px;
+}
+
+#available-menu-items .menu-item-handle:hover {
+ z-index: 1;
+}
+
+#available-menu-items .item-title h4 {
+ padding: 0 0 5px;
+ font-size: 14px;
+}
+
+#available-menu-items .item-add {
+ position: absolute;
+ top: 1px;
+ left: 1px;
+ color: #82878c;
+ width: 30px;
+ height: 38px;
+ box-shadow: none;
+ outline: none;
+ cursor: pointer;
+ text-align: center;
+}
+
+#available-menu-items .menu-item-handle .item-add:focus {
+ color: #23282d;
+}
+
+#available-menu-items .item-add:before {
+ content: "\f543";
+ position: relative;
+ left: 2px;
+ top: 3px;
+ display: inline-block;
+ height: 20px;
+ border-radius: 50%;
+ font: normal 20px/1.05 dashicons; /* line height is to account for the dashicon's vertical alignment */
+}
+
+#available-menu-items .menu-item-handle.item-added .item-type,
+#available-menu-items .menu-item-handle.item-added .item-title,
+#available-menu-items .menu-item-handle.item-added:hover .item-add,
+#available-menu-items .menu-item-handle.item-added .item-add:focus {
+ color: #82878c;
+}
+
+#available-menu-items .menu-item-handle.item-added .item-add:before {
+ content: "\f147";
+}
+
+#available-menu-items .accordion-section-title.loading .spinner,
+#available-menu-items-search.loading .accordion-section-title .spinner {
+ visibility: visible;
+ margin: 0 20px;
+}
+
+#available-menu-items-search .spinner {
+ position: absolute;
+ top: 20px; /* 13 container padding +1 input margin +6 ( ( 32 input height - 20 spinner height ) / 2 ) */
+ right: 21px;
+ margin: 0 !important;
+}
+
+/* search results list */
+#available-menu-items #available-menu-items-search .accordion-section-content {
+ position: absolute;
+ left: 0;
+ top: 60px; /* below title div / search input */
+ bottom: 0px; /* 100% height that still triggers lazy load */
+ max-height: none;
+ width: 100%;
+ padding: 1px 15px 15px;
+ box-sizing: border-box;
+}
+
+#available-menu-items-search .nothing-found {
+ /* Compensate the 1px top padding of the container. */
+ margin-top: -1px;
+}
+
+#available-menu-items-search .accordion-section-title:after {
+ display: none;
+}
+
+#available-menu-items-search .accordion-section-content:empty {
+ min-height: 0;
+ padding: 0;
+}
+
+#available-menu-items-search.loading .accordion-section-content div {
+ opacity: .5;
+}
+
+#available-menu-items-search.loading.loading-more .accordion-section-content div {
+ opacity: 1;
+}
+
+#customize-preview {
+ transition: all 0.2s;
+}
+
+body.adding-menu-items #available-menu-items {
+ left: 0;
+ visibility: visible;
+}
+
+body.adding-menu-items .wp-full-overlay-main {
+ left: 300px;
+}
+
+body.adding-menu-items #customize-preview {
+ opacity: 0.4;
+}
+
+body.adding-menu-items #customize-preview iframe {
+ pointer-events: none;
+}
+
+.menu-item-handle .spinner {
+ display: none;
+ float: left;
+ margin: 0 8px 0 0;
+}
+
+.nav-menu-inserted-item-loading .spinner {
+ display: block;
+}
+
+.nav-menu-inserted-item-loading .menu-item-handle .item-type {
+ padding: 0 0 0 8px;
+}
+
+.nav-menu-inserted-item-loading .menu-item-handle,
+.added-menu-item .menu-item-handle.loading {
+ padding: 10px 15px 10px 8px;
+ cursor: default;
+ opacity: .5;
+ background: #fff;
+ color: #727773;
+}
+
+.added-menu-item .menu-item-handle {
+ transition-property: opacity, background, color;
+ transition-duration: 1.25s;
+ transition-timing-function: cubic-bezier( .25, -2.5, .75, 8 ); /* Replacement for .hide().fadeIn('slow') in JS to add emphasis when it's loaded. */
+}
+
+/* Add/delete Menus */
+
+#customize-theme-controls .control-panel-content .control-section-nav_menu:nth-last-child(2) .accordion-section-title {
+ border-bottom-color: #ddd;
+}
+
+/* @todo update selector */
+#accordion-section-add_menu {
+ margin: 15px 12px;
+}
+
+#accordion-section-add_menu h3 {
+ text-align: right;
+}
+
+#accordion-section-add_menu h3,
+#accordion-section-add_menu .customize-add-menu-button {
+ margin: 0;
+}
+
+#accordion-section-add_menu .customize-add-menu-button {
+ font-weight: 400;
+}
+
+#create-new-menu-submit {
+ float: right;
+ margin: 0 0 12px 0;
+}
+
+.menu-delete-item {
+ float: left;
+ padding: 1em 0;
+ width: 100%;
+}
+
+.assigned-menu-locations-title p {
+ margin: 0 0 8px 0;
+}
+
+li.assigned-to-menu-location .menu-delete-item {
+ display: none;
+}
+
+li.assigned-to-menu-location .add-new-menu-item {
+ margin-bottom: 1em;
+}
+
+.menu-item-handle {
+ margin-top: -1px;
+}
+.ui-sortable-disabled .menu-item-handle {
+ cursor: default;
+}
+
+.menu-item-handle:hover {
+ position: relative;
+ z-index: 10;
+ color: #0073aa;
+}
+
+.menu-item-handle:hover .item-type,
+.menu-item-handle:hover .item-edit,
+#available-menu-items .menu-item-handle:hover .item-add {
+ color: #0073aa;
+}
+
+.menu-item-edit-active .menu-item-handle {
+ border-color: #999;
+ border-bottom: none;
+}
+
+.customize-control-nav_menu_item {
+ margin-bottom: 0;
+}
+
+.customize-control-nav_menu .new-menu-item-invitation {
+ margin-top: 0;
+ margin-bottom: 0;
+}
+
+.customize-control-nav_menu .customize-control-nav_menu-buttons {
+ margin-top: 12px;
+}
+
+/**
+ * box-shadows
+ */
+
+.wp-customizer .menu-item .submitbox .submitdelete:focus,
+.customize-screen-options-toggle:focus:before,
+#customize-controls .customize-info .customize-help-toggle:focus:before,
+.wp-customizer button:focus .toggle-indicator:before,
+.menu-delete:focus,
+.menu-item-bar .item-delete:focus:before,
+#available-menu-items .item-add:focus:before {
+ box-shadow:
+ 0 0 0 1px #5b9dd9,
+ 0 0 2px 1px rgba(30, 140, 190, 0.8);
+}
+
+
+@media screen and (max-width: 782px) {
+ #available-menu-items #available-menu-items-search .accordion-section-content {
+ top: 63px;
+ }
+}
+
+@media screen and (max-width: 640px) {
+ #available-menu-items #available-menu-items-search .accordion-section-content {
+ top: 130px;
+ }
+}
diff --git a/www/crm/wp-admin/css/customize-nav-menus.min.css b/www/crm/wp-admin/css/customize-nav-menus.min.css
new file mode 100644
index 00000000..07076bc4
--- /dev/null
+++ b/www/crm/wp-admin/css/customize-nav-menus.min.css
@@ -0,0 +1,2 @@
+/*! This file is auto-generated */
+#customize-theme-controls #accordion-section-menu_locations{position:relative;margin-top:30px}#customize-theme-controls #accordion-section-menu_locations>.accordion-section-title{border-bottom-color:#ddd;margin-top:15px}#customize-theme-controls .customize-section-title-menu_locations-description,#customize-theme-controls .customize-section-title-menu_locations-heading,#customize-theme-controls .customize-section-title-nav_menus-heading{padding:0 12px 0 12px}#customize-theme-controls .customize-control-description.customize-section-title-menu_locations-description{font-style:normal}.menu-in-location,.menu-in-locations{display:block;font-weight:600;font-size:10px}#customize-controls .control-section .accordion-section-title:focus .menu-in-location,#customize-controls .control-section .accordion-section-title:hover .menu-in-location,#customize-controls .theme-location-set{color:#555}.customize-control-nav_menu_location .create-menu,.customize-control-nav_menu_location .edit-menu{margin-left:6px;vertical-align:middle;line-height:2.2}#customize-controls .customize-control-nav_menu_name{margin-bottom:12px}.customize-control-nav_menu_name p:last-of-type{margin-bottom:0}#customize-new-menu-submit{float:right;min-width:85px}.wp-customizer .menu-item-bar .menu-item-handle,.wp-customizer .menu-item-settings,.wp-customizer .menu-item-settings .description-thin{box-sizing:border-box}.wp-customizer .menu-item-bar{margin:0}.wp-customizer .menu-item-bar .menu-item-handle{width:100%;background:#fff}.wp-customizer .menu-item-handle .item-title{margin-right:0}.wp-customizer .menu-item-handle .item-type{padding:1px 21px 0 5px;float:right;text-align:right}.wp-customizer .menu-item-handle:hover{z-index:8}.customize-control-nav_menu_item.has-notifications .menu-item-handle{border-left:4px solid #00a0d2}.wp-customizer .menu-item-settings{max-width:100%;overflow:hidden;z-index:8;padding:10px;background:#eee;border:1px solid #999;border-top:none}.wp-customizer .menu-item-settings .description-thin{width:100%;height:auto;margin:0 0 8px 0}.wp-customizer .menu-item-settings input[type=text]{width:100%}.wp-customizer .menu-item-settings .submitbox{margin:0;padding:0}.wp-customizer .menu-item-settings .link-to-original{padding:5px 0;border:none;font-style:normal;margin:0;width:100%}.wp-customizer .menu-item .submitbox .submitdelete{float:left;margin:6px 0 0;padding:0;cursor:pointer}.menu-item-reorder-nav{display:none;background-color:#fff;position:absolute;top:0;right:0}.menus-move-left:before{content:"\f341"}.menus-move-right:before{content:"\f345"}.reordering .menu-item .item-controls,.reordering .menu-item .item-type{display:none}.reordering .menu-item-reorder-nav{display:block}.customize-control input.menu-name-field{width:100%}.wp-customizer .menu-item .item-edit{position:absolute;right:-19px;top:2px;display:block;width:30px;height:38px;margin-right:0!important;box-shadow:none;outline:0;overflow:hidden;cursor:pointer;text-align:center}.wp-customizer .menu-item.menu-item-edit-active .item-edit .toggle-indicator:before{content:"\f142"}.wp-customizer .menu-item-settings p.description{font-style:normal}.wp-customizer .menu-settings dl{margin:12px 0 0 0;padding:0}.wp-customizer .menu-settings .checkbox-input{margin-top:8px}.wp-customizer .menu-settings .menu-theme-locations{border-top:1px solid #ccc}.wp-customizer .menu-settings{margin-top:36px;border-top:none}.wp-customizer .menu-location-settings{margin-top:12px;border-top:none}.wp-customizer .control-section-nav_menu .menu-location-settings{margin-top:24px;border-top:1px solid #ddd}.customize-control-nav_menu_auto_add,.wp-customizer .control-section-nav_menu .menu-location-settings{padding-top:12px}.menu-location-settings .customize-control-checkbox .theme-location-set{line-height:1}.customize-control-nav_menu_auto_add label{vertical-align:top}.menu-location-settings .new-menu-locations-widget-note{display:block}.customize-control-menu{margin-top:4px}#customize-controls .customize-info.open.active-menu-screen-options .customize-help-toggle{color:#555}.customize-screen-options-toggle{background:0 0;border:none;color:#555;cursor:pointer;margin:0;padding:20px;position:absolute;right:0;top:30px}#customize-controls .customize-info .customize-help-toggle{padding:20px}#customize-controls .customize-info .customize-help-toggle:before{padding:4px}#customize-controls .customize-info.open.active-menu-screen-options .customize-help-toggle:active,#customize-controls .customize-info.open.active-menu-screen-options .customize-help-toggle:focus,#customize-controls .customize-info.open.active-menu-screen-options .customize-help-toggle:hover,.active-menu-screen-options .customize-screen-options-toggle,.customize-screen-options-toggle:active,.customize-screen-options-toggle:focus,.customize-screen-options-toggle:hover{color:#0073aa}#customize-controls .customize-info .customize-help-toggle:focus,.customize-screen-options-toggle:focus{outline:0}.customize-screen-options-toggle:before{-moz-osx-font-smoothing:grayscale;border:none;content:"\f111";display:block;font:18px/1 dashicons;padding:5px;text-align:center;text-decoration:none!important;text-indent:0;left:6px;position:absolute;top:6px}#customize-controls .customize-info .customize-help-toggle:focus:before,.customize-screen-options-toggle:focus:before{border-radius:100%}.wp-customizer #screen-options-wrap{display:none;background:#fff;border-top:1px solid #ddd;padding:4px 15px 15px}.wp-customizer .metabox-prefs label{display:block;padding-right:0;line-height:30px}.wp-customizer .toggle-indicator{display:inline-block;font-size:20px;line-height:1}.rtl .wp-customizer .toggle-indicator{text-indent:1px}#available-menu-items .accordion-section-title .toggle-indicator:before,.wp-customizer .menu-item .item-edit .toggle-indicator:before{content:"\f140";display:block;padding:1px 2px 1px 0;speak:none;border-radius:50%;color:#72777c;font:normal 20px/1 dashicons;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-decoration:none!important}.control-section-nav_menu .field-css-classes,.control-section-nav_menu .field-description,.control-section-nav_menu .field-link-target,.control-section-nav_menu .field-title-attribute,.control-section-nav_menu .field-xfn{display:none}.control-section-nav_menu.field-css-classes-active .field-css-classes,.control-section-nav_menu.field-description-active .field-description,.control-section-nav_menu.field-link-target-active .field-link-target,.control-section-nav_menu.field-title-attribute-active .field-title-attribute,.control-section-nav_menu.field-xfn-active .field-xfn{display:block}.menu-item-depth-0{margin-left:0}.menu-item-depth-1{margin-left:20px}.menu-item-depth-2{margin-left:40px}.menu-item-depth-3{margin-left:60px}.menu-item-depth-4{margin-left:80px}.menu-item-depth-5{margin-left:100px}.menu-item-depth-6{margin-left:120px}.menu-item-depth-7{margin-left:140px}.menu-item-depth-8{margin-left:160px}.menu-item-depth-9{margin-left:180px}.menu-item-depth-10{margin-left:200px}.menu-item-depth-11{margin-left:220px}.menu-item-depth-0>.menu-item-bar{margin-right:0}.menu-item-depth-1>.menu-item-bar{margin-right:20px}.menu-item-depth-2>.menu-item-bar{margin-right:40px}.menu-item-depth-3>.menu-item-bar{margin-right:60px}.menu-item-depth-4>.menu-item-bar{margin-right:80px}.menu-item-depth-5>.menu-item-bar{margin-right:100px}.menu-item-depth-6>.menu-item-bar{margin-right:120px}.menu-item-depth-7>.menu-item-bar{margin-right:140px}.menu-item-depth-8>.menu-item-bar{margin-right:160px}.menu-item-depth-9>.menu-item-bar{margin-right:180px}.menu-item-depth-10>.menu-item-bar{margin-right:200px}.menu-item-depth-11>.menu-item-bar{margin-right:220px}.menu-item-depth-0 .menu-item-transport{margin-left:0}.menu-item-depth-1 .menu-item-transport{margin-left:-20px}.menu-item-depth-3 .menu-item-transport{margin-left:-60px}.menu-item-depth-4 .menu-item-transport{margin-left:-80px}.menu-item-depth-2 .menu-item-transport{margin-left:-40px}.menu-item-depth-5 .menu-item-transport{margin-left:-100px}.menu-item-depth-6 .menu-item-transport{margin-left:-120px}.menu-item-depth-7 .menu-item-transport{margin-left:-140px}.menu-item-depth-8 .menu-item-transport{margin-left:-160px}.menu-item-depth-9 .menu-item-transport{margin-left:-180px}.menu-item-depth-10 .menu-item-transport{margin-left:-200px}.menu-item-depth-11 .menu-item-transport{margin-left:-220px}.reordering .menu-item-depth-0{margin-left:0}.reordering .menu-item-depth-1{margin-left:15px}.reordering .menu-item-depth-2{margin-left:30px}.reordering .menu-item-depth-3{margin-left:45px}.reordering .menu-item-depth-4{margin-left:60px}.reordering .menu-item-depth-5{margin-left:75px}.reordering .menu-item-depth-6{margin-left:90px}.reordering .menu-item-depth-7{margin-left:105px}.reordering .menu-item-depth-8{margin-left:120px}.reordering .menu-item-depth-9{margin-left:135px}.reordering .menu-item-depth-10{margin-left:150px}.reordering .menu-item-depth-11{margin-left:165px}.reordering .menu-item-depth-0>.menu-item-bar{margin-right:0}.reordering .menu-item-depth-1>.menu-item-bar{margin-right:15px}.reordering .menu-item-depth-2>.menu-item-bar{margin-right:30px}.reordering .menu-item-depth-3>.menu-item-bar{margin-right:45px}.reordering .menu-item-depth-4>.menu-item-bar{margin-right:60px}.reordering .menu-item-depth-5>.menu-item-bar{margin-right:75px}.reordering .menu-item-depth-6>.menu-item-bar{margin-right:90px}.reordering .menu-item-depth-7>.menu-item-bar{margin-right:105px}.reordering .menu-item-depth-8>.menu-item-bar{margin-right:120px}.reordering .menu-item-depth-9>.menu-item-bar{margin-right:135px}.reordering .menu-item-depth-10>.menu-item-bar{margin-right:150px}.reordering .menu-item-depth-11>.menu-item-bar{margin-right:165px}.control-section-nav_menu.menu .menu-item-edit-active{margin-left:0}.control-section-nav_menu.menu .menu-item-edit-active .menu-item-bar{margin-right:0}.control-section-nav_menu.menu .sortable-placeholder{margin-top:0;margin-bottom:1px;max-width:calc(100% - 2px);float:left;display:list-item;border-color:#a0a5aa}.menu-item-transport li.customize-control{float:none}.control-section-nav_menu.menu ul.menu-item-transport .menu-item-bar{margin-top:0}.adding-menu-items .control-section{opacity:.4}.adding-menu-items .control-panel.control-section,.adding-menu-items .control-section.open{opacity:1}.menu-item-bar .item-delete{color:#a00;position:absolute;top:2px;right:-19px;width:30px;height:38px;cursor:pointer;display:none}.menu-item-bar .item-delete:before{content:"\f335";position:absolute;top:9px;left:5px;border-radius:50%;font:normal 20px/1 dashicons;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.ie8 .menu-item-bar .item-delete:before{top:-10px}.menu-item-bar .item-delete:focus,.menu-item-bar .item-delete:hover{box-shadow:none;outline:0;color:#dc3232}.adding-menu-items .menu-item-bar .item-edit{display:none}.adding-menu-items .menu-item-bar .item-delete{display:block}#available-menu-items.opening{overflow-y:hidden}#available-menu-items #available-menu-items-search.open{height:100%;border-bottom:none}#available-menu-items .accordion-section-title{border-left:none;border-right:none;background:#fff;transition:background-color .15s;-webkit-user-select:auto;-moz-user-select:auto;-ms-user-select:auto;user-select:auto}#available-menu-items #available-menu-items-search .accordion-section-title,#available-menu-items .open .accordion-section-title{background:#eee}#available-menu-items .accordion-section-title:after{content:none!important}#available-menu-items .accordion-section-title:hover .toggle-indicator:before,#available-menu-items .button-link:focus .toggle-indicator:before,#available-menu-items .button-link:hover .toggle-indicator:before{color:#23282d}#available-menu-items .open .accordion-section-title .toggle-indicator:before{content:"\f142";color:#23282d}#available-menu-items .available-menu-items-list{overflow-y:auto;max-height:200px;background:0 0}#available-menu-items .accordion-section-title button{display:block;width:28px;height:35px;position:absolute;top:5px;right:5px;box-shadow:none;outline:0;cursor:pointer;text-align:center}#available-menu-items .accordion-section-title .no-items,#available-menu-items .cannot-expand .accordion-section-title .spinner,#available-menu-items .cannot-expand .accordion-section-title>button{display:none}#available-menu-items-search.cannot-expand .accordion-section-title .spinner{display:block}#available-menu-items .cannot-expand .accordion-section-title .no-items{float:right;color:#555d66;font-weight:400;margin-left:5px}#available-menu-items .accordion-section-content{max-height:290px;margin:0;padding:0;position:relative;background:0 0}#available-menu-items .accordion-section-content .available-menu-items-list{margin:0 0 45px 0;padding:1px 15px 15px 15px}#available-menu-items .accordion-section-content .available-menu-items-list:only-child{margin-bottom:0}#new-custom-menu-item .accordion-section-content{padding:0 15px 15px 15px}#available-menu-items .menu-item-tpl{margin:0}#available-menu-items .new-content-item .create-item-input.invalid,#available-menu-items .new-content-item .create-item-input.invalid:focus,#custom-menu-item-name.invalid,#custom-menu-item-url.invalid,.edit-menu-item-url.invalid,.menu-name-field.invalid,.menu-name-field.invalid:focus{border:1px solid #dc3232}#available-menu-items .menu-item-handle .item-type{padding-right:0}#available-menu-items .menu-item-handle .item-title{padding-left:20px}#available-menu-items .menu-item-handle{cursor:pointer}#available-menu-items .menu-item-handle{box-shadow:none;margin-top:-1px}#available-menu-items .menu-item-handle:hover{z-index:1}#available-menu-items .item-title h4{padding:0 0 5px;font-size:14px}#available-menu-items .item-add{position:absolute;top:1px;left:1px;color:#82878c;width:30px;height:38px;box-shadow:none;outline:0;cursor:pointer;text-align:center}#available-menu-items .menu-item-handle .item-add:focus{color:#23282d}#available-menu-items .item-add:before{content:"\f543";position:relative;left:2px;top:3px;display:inline-block;height:20px;border-radius:50%;font:normal 20px/1.05 dashicons}#available-menu-items .menu-item-handle.item-added .item-add:focus,#available-menu-items .menu-item-handle.item-added .item-title,#available-menu-items .menu-item-handle.item-added .item-type,#available-menu-items .menu-item-handle.item-added:hover .item-add{color:#82878c}#available-menu-items .menu-item-handle.item-added .item-add:before{content:"\f147"}#available-menu-items .accordion-section-title.loading .spinner,#available-menu-items-search.loading .accordion-section-title .spinner{visibility:visible;margin:0 20px}#available-menu-items-search .spinner{position:absolute;top:20px;right:21px;margin:0!important}#available-menu-items #available-menu-items-search .accordion-section-content{position:absolute;left:0;top:60px;bottom:0;max-height:none;width:100%;padding:1px 15px 15px;box-sizing:border-box}#available-menu-items-search .nothing-found{margin-top:-1px}#available-menu-items-search .accordion-section-title:after{display:none}#available-menu-items-search .accordion-section-content:empty{min-height:0;padding:0}#available-menu-items-search.loading .accordion-section-content div{opacity:.5}#available-menu-items-search.loading.loading-more .accordion-section-content div{opacity:1}#customize-preview{transition:all .2s}body.adding-menu-items #available-menu-items{left:0;visibility:visible}body.adding-menu-items .wp-full-overlay-main{left:300px}body.adding-menu-items #customize-preview{opacity:.4}body.adding-menu-items #customize-preview iframe{pointer-events:none}.menu-item-handle .spinner{display:none;float:left;margin:0 8px 0 0}.nav-menu-inserted-item-loading .spinner{display:block}.nav-menu-inserted-item-loading .menu-item-handle .item-type{padding:0 0 0 8px}.added-menu-item .menu-item-handle.loading,.nav-menu-inserted-item-loading .menu-item-handle{padding:10px 15px 10px 8px;cursor:default;opacity:.5;background:#fff;color:#727773}.added-menu-item .menu-item-handle{transition-property:opacity,background,color;transition-duration:1.25s;transition-timing-function:cubic-bezier(.25,-2.5,.75,8)}#customize-theme-controls .control-panel-content .control-section-nav_menu:nth-last-child(2) .accordion-section-title{border-bottom-color:#ddd}#accordion-section-add_menu{margin:15px 12px}#accordion-section-add_menu h3{text-align:right}#accordion-section-add_menu .customize-add-menu-button,#accordion-section-add_menu h3{margin:0}#accordion-section-add_menu .customize-add-menu-button{font-weight:400}#create-new-menu-submit{float:right;margin:0 0 12px 0}.menu-delete-item{float:left;padding:1em 0;width:100%}.assigned-menu-locations-title p{margin:0 0 8px 0}li.assigned-to-menu-location .menu-delete-item{display:none}li.assigned-to-menu-location .add-new-menu-item{margin-bottom:1em}.menu-item-handle{margin-top:-1px}.ui-sortable-disabled .menu-item-handle{cursor:default}.menu-item-handle:hover{position:relative;z-index:10;color:#0073aa}#available-menu-items .menu-item-handle:hover .item-add,.menu-item-handle:hover .item-edit,.menu-item-handle:hover .item-type{color:#0073aa}.menu-item-edit-active .menu-item-handle{border-color:#999;border-bottom:none}.customize-control-nav_menu_item{margin-bottom:0}.customize-control-nav_menu .new-menu-item-invitation{margin-top:0;margin-bottom:0}.customize-control-nav_menu .customize-control-nav_menu-buttons{margin-top:12px}#available-menu-items .item-add:focus:before,#customize-controls .customize-info .customize-help-toggle:focus:before,.customize-screen-options-toggle:focus:before,.menu-delete:focus,.menu-item-bar .item-delete:focus:before,.wp-customizer .menu-item .submitbox .submitdelete:focus,.wp-customizer button:focus .toggle-indicator:before{box-shadow:0 0 0 1px #5b9dd9,0 0 2px 1px rgba(30,140,190,.8)}@media screen and (max-width:782px){#available-menu-items #available-menu-items-search .accordion-section-content{top:63px}}@media screen and (max-width:640px){#available-menu-items #available-menu-items-search .accordion-section-content{top:130px}} \ No newline at end of file
diff --git a/www/crm/wp-admin/css/customize-widgets-rtl.css b/www/crm/wp-admin/css/customize-widgets-rtl.css
new file mode 100644
index 00000000..03246465
--- /dev/null
+++ b/www/crm/wp-admin/css/customize-widgets-rtl.css
@@ -0,0 +1,483 @@
+.wp-full-overlay-sidebar {
+ overflow: visible;
+}
+
+/**
+ * Hide all sidebar sections by default, only show them (via JS) once the
+ * preview loads and we know whether the sidebars are used in the template.
+ */
+
+.control-section.control-section-sidebar,
+.customize-control-sidebar_widgets label,
+.customize-control-sidebar_widgets .hide-if-js {
+ /* The link in .customize-control-sidebar_widgets .hide-if-js will fail if it ever gets used. */
+ display: none;
+}
+
+.control-section.control-section-sidebar .accordion-section-content.ui-sortable {
+ overflow: visible;
+}
+
+/* Note: widget-tops are more compact when (max-height: 700px) and (min-width: 981px). */
+.customize-control-widget_form .widget-top {
+ background: #fff;
+ transition: opacity 0.5s;
+}
+
+.customize-control .widget-action {
+ color: #72777c;
+}
+
+.customize-control .widget-top:hover .widget-action,
+.customize-control .widget-action:focus {
+ color: #23282d;
+}
+
+.customize-control-widget_form:not(.widget-rendered) .widget-top {
+ opacity: 0.5;
+}
+
+.customize-control-widget_form .widget-control-save {
+ display: none;
+}
+
+.customize-control-widget_form .spinner {
+ visibility: hidden;
+ margin-top: 0;
+}
+
+.customize-control-widget_form.previewer-loading .spinner {
+ visibility: visible;
+}
+
+.customize-control-widget_form.widget-form-disabled .widget-content {
+ opacity: 0.7;
+ pointer-events: none;
+ -moz-user-select: none;
+ -webkit-user-select: none;
+ -ms-user-select: none;
+ user-select: none;
+}
+
+.customize-control-widget_form .widget {
+ margin-bottom: 0;
+}
+
+.customize-control-widget_form.wide-widget-control .widget-inside {
+ position: fixed;
+ right: 299px;
+ top: 25%;
+ border: 1px solid rgb(229, 229, 229);
+ overflow: auto;
+}
+.customize-control-widget_form.wide-widget-control .widget-inside > .form {
+ padding: 20px;
+}
+
+.customize-control-widget_form.wide-widget-control .widget-top {
+ transition: background-color 0.4s;
+}
+.customize-control-widget_form.wide-widget-control.expanding .widget-top,
+.customize-control-widget_form.wide-widget-control.expanded:not(.collapsing) .widget-top {
+ background-color: rgb(227, 227, 227);
+}
+
+.widget-inside {
+ padding: 1px 10px 10px 10px;
+ border-top: none;
+ line-height: 16px;
+}
+
+.customize-control-widget_form.expanded .widget-action .toggle-indicator:before {
+ content: "\f142";
+}
+
+.customize-control-widget_form.wide-widget-control .widget-action .toggle-indicator:before {
+ content: "\f141";
+}
+
+.customize-control-widget_form.wide-widget-control.expanded .widget-action .toggle-indicator:before {
+ content: "\f139";
+}
+
+.widget-title-action {
+ cursor: pointer;
+}
+
+.widget-top,
+.customize-control-widget_form .widget .customize-control-title {
+ cursor: move;
+}
+
+.control-section.accordion-section.highlighted > .accordion-section-title,
+.customize-control-widget_form.highlighted {
+ outline: none;
+ box-shadow: 0 0 2px rgba(30, 140, 190, 0.8);
+ position: relative;
+ z-index: 1;
+}
+
+#widget-customizer-control-templates {
+ display: none;
+}
+
+/**
+ * Widget reordering styles
+ */
+
+#customize-theme-controls .widget-reorder-nav {
+ display: none;
+ float: left;
+ background-color: #fafafa;
+}
+
+.move-widget:before {
+ content: "\f504";
+}
+
+#customize-theme-controls .move-widget-area {
+ display: none;
+ background: #fff;
+ border: 1px solid #ddd;
+ border-top: none;
+ cursor: auto;
+}
+
+#customize-theme-controls .reordering .move-widget-area.active {
+ display: block;
+}
+
+#customize-theme-controls .move-widget-area .description {
+ margin: 0;
+ padding: 15px 20px;
+ font-weight: 400;
+}
+
+#customize-theme-controls .widget-area-select {
+ margin: 0;
+ padding: 0;
+ list-style: none;
+}
+
+#customize-theme-controls .widget-area-select li {
+ position: relative;
+ margin: 0;
+ padding: 13px 42px 15px 15px;
+ color: #555;
+ border-top: 1px solid #eee;
+ cursor: pointer;
+ -webkit-user-select: none;
+ -moz-user-select: none;
+ -ms-user-select: none;
+ user-select: none;
+}
+
+#customize-theme-controls .widget-area-select li:before {
+ display: none;
+ content: "\f147";
+ position: absolute;
+ top: 12px;
+ right: 10px;
+ font: normal 20px/1 dashicons;
+ -webkit-font-smoothing: antialiased;
+ -moz-osx-font-smoothing: grayscale;
+}
+
+#customize-theme-controls .widget-area-select li:last-child {
+ border-bottom: 1px solid #eee;
+}
+
+#customize-theme-controls .widget-area-select .selected {
+ color: #fff;
+ text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.4);
+ background: #00a0d2;
+}
+
+#customize-theme-controls .widget-area-select .selected:before {
+ display: block;
+}
+
+#customize-theme-controls .move-widget-actions {
+ text-align: left;
+ padding: 12px;
+}
+
+#customize-theme-controls .reordering .widget-title-action {
+ display: none;
+}
+
+#customize-theme-controls .reordering .widget-reorder-nav {
+ display: block;
+}
+
+/* Text Widget */
+.wp-customizer div.mce-inline-toolbar-grp,
+.wp-customizer div.mce-tooltip {
+ z-index: 500100 !important;
+}
+.wp-customizer .ui-autocomplete.wplink-autocomplete {
+ z-index: 500110; /* originally 100110, but z-index of .wp-full-overlay is 500000 */
+}
+.wp-customizer #wp-link-backdrop {
+ z-index: 500100; /* originally 100100, but z-index of .wp-full-overlay is 500000 */
+}
+.wp-customizer #wp-link-wrap {
+ z-index: 500105; /* originally 100105, but z-index of .wp-full-overlay is 500000 */
+}
+
+/**
+ * Styles for new widget addition panel
+ */
+
+/* override widgets admin page rules in wp-admin/css/widgets.css */
+#widgets-left #available-widgets .widget {
+ float: none !important;
+ width: auto !important;
+}
+
+/* Keep rule that is no longer necessary on widgets.php. */
+#available-widgets .widget-action {
+ display: none;
+}
+
+.ios #available-widgets {
+ transition: right 0s;
+}
+
+#available-widgets .widget-tpl:hover,
+#available-widgets .widget-tpl.selected {
+ background: #f3f3f5;
+ border-bottom-color: #ccc;
+ color: #0073aa;
+ border-right: 4px solid #0073aa;
+}
+
+#customize-controls .widget-title h3 {
+ font-size: 1em;
+}
+
+#available-widgets .widget-title h3 {
+ padding: 0 0 5px;
+ font-size: 14px;
+}
+
+#available-widgets .widget .widget-description {
+ padding: 0;
+ color: #72777c;
+}
+
+#customize-preview {
+ transition: all 0.2s;
+}
+
+body.adding-widget #available-widgets {
+ right: 0;
+ visibility: visible;
+}
+
+body.adding-widget .wp-full-overlay-main {
+ right: 300px;
+}
+
+body.adding-widget #customize-preview {
+ opacity: 0.4;
+}
+
+
+/**
+ * Widget Icon styling
+ * No plurals in naming.
+ * Ordered from lowest to highest specificity.
+ */
+
+#available-widgets .widget-title {
+ position: relative;
+}
+
+#available-widgets .widget-title:before {
+ content: "\f132";
+ position: absolute;
+ top: -3px;
+ left: 100%;
+ margin-left: 20px;
+ width: 20px;
+ height: 20px;
+ color: #32373c;
+ font: normal 20px/1 dashicons;
+ text-align: center;
+ box-sizing: border-box;
+ -webkit-font-smoothing: antialiased;
+ -moz-osx-font-smoothing: grayscale;
+}
+
+/* smiley */
+#available-widgets [class*="easy"] .widget-title:before { content: "\f328"; top: -4px; }
+
+/* star-filled */
+#available-widgets [class*="super"] .widget-title:before,
+#available-widgets [class*="like"] .widget-title:before { content: "\f155"; top: -4px; }
+
+/* wordpress */
+#available-widgets [class*="meta"] .widget-title:before { content: "\f120"; }
+
+/* archive-box */
+#available-widgets [class*="archives"] .widget-title:before { content: "\f480"; top: -4px; }
+
+/* category */
+#available-widgets [class*="categor"] .widget-title:before { content: "\f318"; top: -4px; }
+
+/* comments */
+#available-widgets [class*="comment"] .widget-title:before,
+#available-widgets [class*="testimonial"] .widget-title:before,
+#available-widgets [class*="chat"] .widget-title:before { content: "\f101"; }
+
+/* post */
+#available-widgets [class*="post"] .widget-title:before { content: "\f109"; }
+
+/* admin-page */
+#available-widgets [class*="page"] .widget-title:before { content: "\f105"; }
+
+/* text */
+#available-widgets [class*="text"] .widget-title:before { content: "\f478"; }
+
+/* links */
+#available-widgets [class*="link"] .widget-title:before { content: "\f103"; }
+
+/* search */
+#available-widgets [class*="search"] .widget-title:before { content: "\f179"; }
+
+/* menu */
+#available-widgets [class*="menu"] .widget-title:before,
+#available-widgets [class*="nav"] .widget-title:before { content: "\f333"; }
+
+/* tag-cloud */
+#available-widgets [class*="tag"] .widget-title:before { content: "\f479"; }
+
+/* rss */
+#available-widgets [class*="rss"] .widget-title:before { content: "\f303"; top: -6px; }
+
+/* calendar */
+#available-widgets [class*="event"] .widget-title:before,
+#available-widgets [class*="calendar"] .widget-title:before { content: "\f145"; top: -4px;}
+
+/* format-image */
+#available-widgets [class*="image"] .widget-title:before,
+#available-widgets [class*="photo"] .widget-title:before,
+#available-widgets [class*="slide"] .widget-title:before,
+#available-widgets [class*="instagram"] .widget-title:before { content: "\f128"; }
+
+/* format-gallery */
+#available-widgets [class*="album"] .widget-title:before,
+#available-widgets [class*="galler"] .widget-title:before { content: "\f161"; }
+
+/* format-video */
+#available-widgets [class*="video"] .widget-title:before,
+#available-widgets [class*="tube"] .widget-title:before { content: "\f126"; }
+
+/* format-audio */
+#available-widgets [class*="music"] .widget-title:before,
+#available-widgets [class*="radio"] .widget-title:before,
+#available-widgets [class*="audio"] .widget-title:before { content: "\f127"; }
+
+/* admin-users */
+#available-widgets [class*="login"] .widget-title:before,
+#available-widgets [class*="user"] .widget-title:before,
+#available-widgets [class*="member"] .widget-title:before,
+#available-widgets [class*="avatar"] .widget-title:before,
+#available-widgets [class*="subscriber"] .widget-title:before,
+#available-widgets [class*="profile"] .widget-title:before,
+#available-widgets [class*="grofile"] .widget-title:before { content: "\f110"; }
+
+/* cart */
+#available-widgets [class*="commerce"] .widget-title:before,
+#available-widgets [class*="shop"] .widget-title:before,
+#available-widgets [class*="cart"] .widget-title:before { content: "\f174"; top: -4px; }
+
+/* shield */
+#available-widgets [class*="secur"] .widget-title:before,
+#available-widgets [class*="firewall"] .widget-title:before { content: "\f332"; }
+
+/* chart-bar */
+#available-widgets [class*="analytic"] .widget-title:before,
+#available-widgets [class*="stat"] .widget-title:before,
+#available-widgets [class*="poll"] .widget-title:before { content: "\f185"; }
+
+/* feedback */
+#available-widgets [class*="form"] .widget-title:before { content: "\f175"; }
+
+/* email-alt */
+#available-widgets [class*="subscribe"] .widget-title:before,
+#available-widgets [class*="news"] .widget-title:before,
+#available-widgets [class*="contact"] .widget-title:before,
+#available-widgets [class*="mail"] .widget-title:before { content: "\f466"; }
+
+/* share */
+#available-widgets [class*="share"] .widget-title:before,
+#available-widgets [class*="socia"] .widget-title:before { content: "\f237"; }
+
+/* translation */
+#available-widgets [class*="lang"] .widget-title:before,
+#available-widgets [class*="translat"] .widget-title:before { content: "\f326"; }
+
+/* location-alt */
+#available-widgets [class*="locat"] .widget-title:before,
+#available-widgets [class*="map"] .widget-title:before { content: "\f231"; }
+
+/* download */
+#available-widgets [class*="download"] .widget-title:before { content: "\f316"; }
+
+/* cloud */
+#available-widgets [class*="weather"] .widget-title:before { content: "\f176"; top: -4px;}
+
+/* facebook */
+#available-widgets [class*="facebook"] .widget-title:before { content: "\f304"; }
+
+/* twitter */
+#available-widgets [class*="tweet"] .widget-title:before,
+#available-widgets [class*="twitter"] .widget-title:before { content: "\f301"; }
+
+@media screen and (max-height: 700px) and (min-width: 981px) {
+ /* Compact widget-tops on smaller laptops, but not tablets. See ticket #27112#comment:4 */
+ .customize-control-widget_form {
+ margin-bottom: 0;
+ }
+
+ .widget-top {
+ box-shadow: none;
+ margin-top: -1px;
+ }
+
+ .widget-top:hover {
+ position: relative;
+ z-index: 1;
+ }
+
+ .last-widget {
+ margin-bottom: 15px;
+ }
+
+ .widget-title h3 {
+ padding: 13px 15px;
+ }
+
+ .widget-top .widget-action {
+ padding: 8px 10px;
+ }
+
+ .widget-reorder-nav span {
+ height: 39px;
+ }
+
+ .widget-reorder-nav span:before {
+ line-height: 39px;
+ }
+
+ /* Compact the move widget areas. */
+ #customize-theme-controls .widget-area-select li {
+ padding: 9px 42px 11px 15px;
+ }
+
+ #customize-theme-controls .widget-area-select li:before {
+ top: 8px;
+ }
+}
diff --git a/www/crm/wp-admin/css/customize-widgets-rtl.min.css b/www/crm/wp-admin/css/customize-widgets-rtl.min.css
new file mode 100644
index 00000000..56aeaea2
--- /dev/null
+++ b/www/crm/wp-admin/css/customize-widgets-rtl.min.css
@@ -0,0 +1,2 @@
+/*! This file is auto-generated */
+.wp-full-overlay-sidebar{overflow:visible}.control-section.control-section-sidebar,.customize-control-sidebar_widgets .hide-if-js,.customize-control-sidebar_widgets label{display:none}.control-section.control-section-sidebar .accordion-section-content.ui-sortable{overflow:visible}.customize-control-widget_form .widget-top{background:#fff;transition:opacity .5s}.customize-control .widget-action{color:#72777c}.customize-control .widget-action:focus,.customize-control .widget-top:hover .widget-action{color:#23282d}.customize-control-widget_form:not(.widget-rendered) .widget-top{opacity:.5}.customize-control-widget_form .widget-control-save{display:none}.customize-control-widget_form .spinner{visibility:hidden;margin-top:0}.customize-control-widget_form.previewer-loading .spinner{visibility:visible}.customize-control-widget_form.widget-form-disabled .widget-content{opacity:.7;pointer-events:none;-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none}.customize-control-widget_form .widget{margin-bottom:0}.customize-control-widget_form.wide-widget-control .widget-inside{position:fixed;right:299px;top:25%;border:1px solid #e5e5e5;overflow:auto}.customize-control-widget_form.wide-widget-control .widget-inside>.form{padding:20px}.customize-control-widget_form.wide-widget-control .widget-top{transition:background-color .4s}.customize-control-widget_form.wide-widget-control.expanded:not(.collapsing) .widget-top,.customize-control-widget_form.wide-widget-control.expanding .widget-top{background-color:#e3e3e3}.widget-inside{padding:1px 10px 10px 10px;border-top:none;line-height:16px}.customize-control-widget_form.expanded .widget-action .toggle-indicator:before{content:"\f142"}.customize-control-widget_form.wide-widget-control .widget-action .toggle-indicator:before{content:"\f141"}.customize-control-widget_form.wide-widget-control.expanded .widget-action .toggle-indicator:before{content:"\f139"}.widget-title-action{cursor:pointer}.customize-control-widget_form .widget .customize-control-title,.widget-top{cursor:move}.control-section.accordion-section.highlighted>.accordion-section-title,.customize-control-widget_form.highlighted{outline:0;box-shadow:0 0 2px rgba(30,140,190,.8);position:relative;z-index:1}#widget-customizer-control-templates{display:none}#customize-theme-controls .widget-reorder-nav{display:none;float:left;background-color:#fafafa}.move-widget:before{content:"\f504"}#customize-theme-controls .move-widget-area{display:none;background:#fff;border:1px solid #ddd;border-top:none;cursor:auto}#customize-theme-controls .reordering .move-widget-area.active{display:block}#customize-theme-controls .move-widget-area .description{margin:0;padding:15px 20px;font-weight:400}#customize-theme-controls .widget-area-select{margin:0;padding:0;list-style:none}#customize-theme-controls .widget-area-select li{position:relative;margin:0;padding:13px 42px 15px 15px;color:#555;border-top:1px solid #eee;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}#customize-theme-controls .widget-area-select li:before{display:none;content:"\f147";position:absolute;top:12px;right:10px;font:normal 20px/1 dashicons;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}#customize-theme-controls .widget-area-select li:last-child{border-bottom:1px solid #eee}#customize-theme-controls .widget-area-select .selected{color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,.4);background:#00a0d2}#customize-theme-controls .widget-area-select .selected:before{display:block}#customize-theme-controls .move-widget-actions{text-align:left;padding:12px}#customize-theme-controls .reordering .widget-title-action{display:none}#customize-theme-controls .reordering .widget-reorder-nav{display:block}.wp-customizer div.mce-inline-toolbar-grp,.wp-customizer div.mce-tooltip{z-index:500100!important}.wp-customizer .ui-autocomplete.wplink-autocomplete{z-index:500110}.wp-customizer #wp-link-backdrop{z-index:500100}.wp-customizer #wp-link-wrap{z-index:500105}#widgets-left #available-widgets .widget{float:none!important;width:auto!important}#available-widgets .widget-action{display:none}.ios #available-widgets{transition:right 0s}#available-widgets .widget-tpl.selected,#available-widgets .widget-tpl:hover{background:#f3f3f5;border-bottom-color:#ccc;color:#0073aa;border-right:4px solid #0073aa}#customize-controls .widget-title h3{font-size:1em}#available-widgets .widget-title h3{padding:0 0 5px;font-size:14px}#available-widgets .widget .widget-description{padding:0;color:#72777c}#customize-preview{transition:all .2s}body.adding-widget #available-widgets{right:0;visibility:visible}body.adding-widget .wp-full-overlay-main{right:300px}body.adding-widget #customize-preview{opacity:.4}#available-widgets .widget-title{position:relative}#available-widgets .widget-title:before{content:"\f132";position:absolute;top:-3px;left:100%;margin-left:20px;width:20px;height:20px;color:#32373c;font:normal 20px/1 dashicons;text-align:center;box-sizing:border-box;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}#available-widgets [class*=easy] .widget-title:before{content:"\f328";top:-4px}#available-widgets [class*=like] .widget-title:before,#available-widgets [class*=super] .widget-title:before{content:"\f155";top:-4px}#available-widgets [class*=meta] .widget-title:before{content:"\f120"}#available-widgets [class*=archives] .widget-title:before{content:"\f480";top:-4px}#available-widgets [class*=categor] .widget-title:before{content:"\f318";top:-4px}#available-widgets [class*=chat] .widget-title:before,#available-widgets [class*=comment] .widget-title:before,#available-widgets [class*=testimonial] .widget-title:before{content:"\f101"}#available-widgets [class*=post] .widget-title:before{content:"\f109"}#available-widgets [class*=page] .widget-title:before{content:"\f105"}#available-widgets [class*=text] .widget-title:before{content:"\f478"}#available-widgets [class*=link] .widget-title:before{content:"\f103"}#available-widgets [class*=search] .widget-title:before{content:"\f179"}#available-widgets [class*=menu] .widget-title:before,#available-widgets [class*=nav] .widget-title:before{content:"\f333"}#available-widgets [class*=tag] .widget-title:before{content:"\f479"}#available-widgets [class*=rss] .widget-title:before{content:"\f303";top:-6px}#available-widgets [class*=calendar] .widget-title:before,#available-widgets [class*=event] .widget-title:before{content:"\f145";top:-4px}#available-widgets [class*=image] .widget-title:before,#available-widgets [class*=instagram] .widget-title:before,#available-widgets [class*=photo] .widget-title:before,#available-widgets [class*=slide] .widget-title:before{content:"\f128"}#available-widgets [class*=album] .widget-title:before,#available-widgets [class*=galler] .widget-title:before{content:"\f161"}#available-widgets [class*=tube] .widget-title:before,#available-widgets [class*=video] .widget-title:before{content:"\f126"}#available-widgets [class*=audio] .widget-title:before,#available-widgets [class*=music] .widget-title:before,#available-widgets [class*=radio] .widget-title:before{content:"\f127"}#available-widgets [class*=avatar] .widget-title:before,#available-widgets [class*=grofile] .widget-title:before,#available-widgets [class*=login] .widget-title:before,#available-widgets [class*=member] .widget-title:before,#available-widgets [class*=profile] .widget-title:before,#available-widgets [class*=subscriber] .widget-title:before,#available-widgets [class*=user] .widget-title:before{content:"\f110"}#available-widgets [class*=cart] .widget-title:before,#available-widgets [class*=commerce] .widget-title:before,#available-widgets [class*=shop] .widget-title:before{content:"\f174";top:-4px}#available-widgets [class*=firewall] .widget-title:before,#available-widgets [class*=secur] .widget-title:before{content:"\f332"}#available-widgets [class*=analytic] .widget-title:before,#available-widgets [class*=poll] .widget-title:before,#available-widgets [class*=stat] .widget-title:before{content:"\f185"}#available-widgets [class*=form] .widget-title:before{content:"\f175"}#available-widgets [class*=contact] .widget-title:before,#available-widgets [class*=mail] .widget-title:before,#available-widgets [class*=news] .widget-title:before,#available-widgets [class*=subscribe] .widget-title:before{content:"\f466"}#available-widgets [class*=share] .widget-title:before,#available-widgets [class*=socia] .widget-title:before{content:"\f237"}#available-widgets [class*=lang] .widget-title:before,#available-widgets [class*=translat] .widget-title:before{content:"\f326"}#available-widgets [class*=locat] .widget-title:before,#available-widgets [class*=map] .widget-title:before{content:"\f231"}#available-widgets [class*=download] .widget-title:before{content:"\f316"}#available-widgets [class*=weather] .widget-title:before{content:"\f176";top:-4px}#available-widgets [class*=facebook] .widget-title:before{content:"\f304"}#available-widgets [class*=tweet] .widget-title:before,#available-widgets [class*=twitter] .widget-title:before{content:"\f301"}@media screen and (max-height:700px) and (min-width:981px){.customize-control-widget_form{margin-bottom:0}.widget-top{box-shadow:none;margin-top:-1px}.widget-top:hover{position:relative;z-index:1}.last-widget{margin-bottom:15px}.widget-title h3{padding:13px 15px}.widget-top .widget-action{padding:8px 10px}.widget-reorder-nav span{height:39px}.widget-reorder-nav span:before{line-height:39px}#customize-theme-controls .widget-area-select li{padding:9px 42px 11px 15px}#customize-theme-controls .widget-area-select li:before{top:8px}} \ No newline at end of file
diff --git a/www/crm/wp-admin/css/customize-widgets.css b/www/crm/wp-admin/css/customize-widgets.css
new file mode 100644
index 00000000..d24539e5
--- /dev/null
+++ b/www/crm/wp-admin/css/customize-widgets.css
@@ -0,0 +1,483 @@
+.wp-full-overlay-sidebar {
+ overflow: visible;
+}
+
+/**
+ * Hide all sidebar sections by default, only show them (via JS) once the
+ * preview loads and we know whether the sidebars are used in the template.
+ */
+
+.control-section.control-section-sidebar,
+.customize-control-sidebar_widgets label,
+.customize-control-sidebar_widgets .hide-if-js {
+ /* The link in .customize-control-sidebar_widgets .hide-if-js will fail if it ever gets used. */
+ display: none;
+}
+
+.control-section.control-section-sidebar .accordion-section-content.ui-sortable {
+ overflow: visible;
+}
+
+/* Note: widget-tops are more compact when (max-height: 700px) and (min-width: 981px). */
+.customize-control-widget_form .widget-top {
+ background: #fff;
+ transition: opacity 0.5s;
+}
+
+.customize-control .widget-action {
+ color: #72777c;
+}
+
+.customize-control .widget-top:hover .widget-action,
+.customize-control .widget-action:focus {
+ color: #23282d;
+}
+
+.customize-control-widget_form:not(.widget-rendered) .widget-top {
+ opacity: 0.5;
+}
+
+.customize-control-widget_form .widget-control-save {
+ display: none;
+}
+
+.customize-control-widget_form .spinner {
+ visibility: hidden;
+ margin-top: 0;
+}
+
+.customize-control-widget_form.previewer-loading .spinner {
+ visibility: visible;
+}
+
+.customize-control-widget_form.widget-form-disabled .widget-content {
+ opacity: 0.7;
+ pointer-events: none;
+ -moz-user-select: none;
+ -webkit-user-select: none;
+ -ms-user-select: none;
+ user-select: none;
+}
+
+.customize-control-widget_form .widget {
+ margin-bottom: 0;
+}
+
+.customize-control-widget_form.wide-widget-control .widget-inside {
+ position: fixed;
+ left: 299px;
+ top: 25%;
+ border: 1px solid rgb(229, 229, 229);
+ overflow: auto;
+}
+.customize-control-widget_form.wide-widget-control .widget-inside > .form {
+ padding: 20px;
+}
+
+.customize-control-widget_form.wide-widget-control .widget-top {
+ transition: background-color 0.4s;
+}
+.customize-control-widget_form.wide-widget-control.expanding .widget-top,
+.customize-control-widget_form.wide-widget-control.expanded:not(.collapsing) .widget-top {
+ background-color: rgb(227, 227, 227);
+}
+
+.widget-inside {
+ padding: 1px 10px 10px 10px;
+ border-top: none;
+ line-height: 16px;
+}
+
+.customize-control-widget_form.expanded .widget-action .toggle-indicator:before {
+ content: "\f142";
+}
+
+.customize-control-widget_form.wide-widget-control .widget-action .toggle-indicator:before {
+ content: "\f139";
+}
+
+.customize-control-widget_form.wide-widget-control.expanded .widget-action .toggle-indicator:before {
+ content: "\f141";
+}
+
+.widget-title-action {
+ cursor: pointer;
+}
+
+.widget-top,
+.customize-control-widget_form .widget .customize-control-title {
+ cursor: move;
+}
+
+.control-section.accordion-section.highlighted > .accordion-section-title,
+.customize-control-widget_form.highlighted {
+ outline: none;
+ box-shadow: 0 0 2px rgba(30, 140, 190, 0.8);
+ position: relative;
+ z-index: 1;
+}
+
+#widget-customizer-control-templates {
+ display: none;
+}
+
+/**
+ * Widget reordering styles
+ */
+
+#customize-theme-controls .widget-reorder-nav {
+ display: none;
+ float: right;
+ background-color: #fafafa;
+}
+
+.move-widget:before {
+ content: "\f504";
+}
+
+#customize-theme-controls .move-widget-area {
+ display: none;
+ background: #fff;
+ border: 1px solid #ddd;
+ border-top: none;
+ cursor: auto;
+}
+
+#customize-theme-controls .reordering .move-widget-area.active {
+ display: block;
+}
+
+#customize-theme-controls .move-widget-area .description {
+ margin: 0;
+ padding: 15px 20px;
+ font-weight: 400;
+}
+
+#customize-theme-controls .widget-area-select {
+ margin: 0;
+ padding: 0;
+ list-style: none;
+}
+
+#customize-theme-controls .widget-area-select li {
+ position: relative;
+ margin: 0;
+ padding: 13px 15px 15px 42px;
+ color: #555;
+ border-top: 1px solid #eee;
+ cursor: pointer;
+ -webkit-user-select: none;
+ -moz-user-select: none;
+ -ms-user-select: none;
+ user-select: none;
+}
+
+#customize-theme-controls .widget-area-select li:before {
+ display: none;
+ content: "\f147";
+ position: absolute;
+ top: 12px;
+ left: 10px;
+ font: normal 20px/1 dashicons;
+ -webkit-font-smoothing: antialiased;
+ -moz-osx-font-smoothing: grayscale;
+}
+
+#customize-theme-controls .widget-area-select li:last-child {
+ border-bottom: 1px solid #eee;
+}
+
+#customize-theme-controls .widget-area-select .selected {
+ color: #fff;
+ text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.4);
+ background: #00a0d2;
+}
+
+#customize-theme-controls .widget-area-select .selected:before {
+ display: block;
+}
+
+#customize-theme-controls .move-widget-actions {
+ text-align: right;
+ padding: 12px;
+}
+
+#customize-theme-controls .reordering .widget-title-action {
+ display: none;
+}
+
+#customize-theme-controls .reordering .widget-reorder-nav {
+ display: block;
+}
+
+/* Text Widget */
+.wp-customizer div.mce-inline-toolbar-grp,
+.wp-customizer div.mce-tooltip {
+ z-index: 500100 !important;
+}
+.wp-customizer .ui-autocomplete.wplink-autocomplete {
+ z-index: 500110; /* originally 100110, but z-index of .wp-full-overlay is 500000 */
+}
+.wp-customizer #wp-link-backdrop {
+ z-index: 500100; /* originally 100100, but z-index of .wp-full-overlay is 500000 */
+}
+.wp-customizer #wp-link-wrap {
+ z-index: 500105; /* originally 100105, but z-index of .wp-full-overlay is 500000 */
+}
+
+/**
+ * Styles for new widget addition panel
+ */
+
+/* override widgets admin page rules in wp-admin/css/widgets.css */
+#widgets-left #available-widgets .widget {
+ float: none !important;
+ width: auto !important;
+}
+
+/* Keep rule that is no longer necessary on widgets.php. */
+#available-widgets .widget-action {
+ display: none;
+}
+
+.ios #available-widgets {
+ transition: left 0s;
+}
+
+#available-widgets .widget-tpl:hover,
+#available-widgets .widget-tpl.selected {
+ background: #f3f3f5;
+ border-bottom-color: #ccc;
+ color: #0073aa;
+ border-left: 4px solid #0073aa;
+}
+
+#customize-controls .widget-title h3 {
+ font-size: 1em;
+}
+
+#available-widgets .widget-title h3 {
+ padding: 0 0 5px;
+ font-size: 14px;
+}
+
+#available-widgets .widget .widget-description {
+ padding: 0;
+ color: #72777c;
+}
+
+#customize-preview {
+ transition: all 0.2s;
+}
+
+body.adding-widget #available-widgets {
+ left: 0;
+ visibility: visible;
+}
+
+body.adding-widget .wp-full-overlay-main {
+ left: 300px;
+}
+
+body.adding-widget #customize-preview {
+ opacity: 0.4;
+}
+
+
+/**
+ * Widget Icon styling
+ * No plurals in naming.
+ * Ordered from lowest to highest specificity.
+ */
+
+#available-widgets .widget-title {
+ position: relative;
+}
+
+#available-widgets .widget-title:before {
+ content: "\f132";
+ position: absolute;
+ top: -3px;
+ right: 100%;
+ margin-right: 20px;
+ width: 20px;
+ height: 20px;
+ color: #32373c;
+ font: normal 20px/1 dashicons;
+ text-align: center;
+ box-sizing: border-box;
+ -webkit-font-smoothing: antialiased;
+ -moz-osx-font-smoothing: grayscale;
+}
+
+/* smiley */
+#available-widgets [class*="easy"] .widget-title:before { content: "\f328"; top: -4px; }
+
+/* star-filled */
+#available-widgets [class*="super"] .widget-title:before,
+#available-widgets [class*="like"] .widget-title:before { content: "\f155"; top: -4px; }
+
+/* wordpress */
+#available-widgets [class*="meta"] .widget-title:before { content: "\f120"; }
+
+/* archive-box */
+#available-widgets [class*="archives"] .widget-title:before { content: "\f480"; top: -4px; }
+
+/* category */
+#available-widgets [class*="categor"] .widget-title:before { content: "\f318"; top: -4px; }
+
+/* comments */
+#available-widgets [class*="comment"] .widget-title:before,
+#available-widgets [class*="testimonial"] .widget-title:before,
+#available-widgets [class*="chat"] .widget-title:before { content: "\f101"; }
+
+/* post */
+#available-widgets [class*="post"] .widget-title:before { content: "\f109"; }
+
+/* admin-page */
+#available-widgets [class*="page"] .widget-title:before { content: "\f105"; }
+
+/* text */
+#available-widgets [class*="text"] .widget-title:before { content: "\f478"; }
+
+/* links */
+#available-widgets [class*="link"] .widget-title:before { content: "\f103"; }
+
+/* search */
+#available-widgets [class*="search"] .widget-title:before { content: "\f179"; }
+
+/* menu */
+#available-widgets [class*="menu"] .widget-title:before,
+#available-widgets [class*="nav"] .widget-title:before { content: "\f333"; }
+
+/* tag-cloud */
+#available-widgets [class*="tag"] .widget-title:before { content: "\f479"; }
+
+/* rss */
+#available-widgets [class*="rss"] .widget-title:before { content: "\f303"; top: -6px; }
+
+/* calendar */
+#available-widgets [class*="event"] .widget-title:before,
+#available-widgets [class*="calendar"] .widget-title:before { content: "\f145"; top: -4px;}
+
+/* format-image */
+#available-widgets [class*="image"] .widget-title:before,
+#available-widgets [class*="photo"] .widget-title:before,
+#available-widgets [class*="slide"] .widget-title:before,
+#available-widgets [class*="instagram"] .widget-title:before { content: "\f128"; }
+
+/* format-gallery */
+#available-widgets [class*="album"] .widget-title:before,
+#available-widgets [class*="galler"] .widget-title:before { content: "\f161"; }
+
+/* format-video */
+#available-widgets [class*="video"] .widget-title:before,
+#available-widgets [class*="tube"] .widget-title:before { content: "\f126"; }
+
+/* format-audio */
+#available-widgets [class*="music"] .widget-title:before,
+#available-widgets [class*="radio"] .widget-title:before,
+#available-widgets [class*="audio"] .widget-title:before { content: "\f127"; }
+
+/* admin-users */
+#available-widgets [class*="login"] .widget-title:before,
+#available-widgets [class*="user"] .widget-title:before,
+#available-widgets [class*="member"] .widget-title:before,
+#available-widgets [class*="avatar"] .widget-title:before,
+#available-widgets [class*="subscriber"] .widget-title:before,
+#available-widgets [class*="profile"] .widget-title:before,
+#available-widgets [class*="grofile"] .widget-title:before { content: "\f110"; }
+
+/* cart */
+#available-widgets [class*="commerce"] .widget-title:before,
+#available-widgets [class*="shop"] .widget-title:before,
+#available-widgets [class*="cart"] .widget-title:before { content: "\f174"; top: -4px; }
+
+/* shield */
+#available-widgets [class*="secur"] .widget-title:before,
+#available-widgets [class*="firewall"] .widget-title:before { content: "\f332"; }
+
+/* chart-bar */
+#available-widgets [class*="analytic"] .widget-title:before,
+#available-widgets [class*="stat"] .widget-title:before,
+#available-widgets [class*="poll"] .widget-title:before { content: "\f185"; }
+
+/* feedback */
+#available-widgets [class*="form"] .widget-title:before { content: "\f175"; }
+
+/* email-alt */
+#available-widgets [class*="subscribe"] .widget-title:before,
+#available-widgets [class*="news"] .widget-title:before,
+#available-widgets [class*="contact"] .widget-title:before,
+#available-widgets [class*="mail"] .widget-title:before { content: "\f466"; }
+
+/* share */
+#available-widgets [class*="share"] .widget-title:before,
+#available-widgets [class*="socia"] .widget-title:before { content: "\f237"; }
+
+/* translation */
+#available-widgets [class*="lang"] .widget-title:before,
+#available-widgets [class*="translat"] .widget-title:before { content: "\f326"; }
+
+/* location-alt */
+#available-widgets [class*="locat"] .widget-title:before,
+#available-widgets [class*="map"] .widget-title:before { content: "\f231"; }
+
+/* download */
+#available-widgets [class*="download"] .widget-title:before { content: "\f316"; }
+
+/* cloud */
+#available-widgets [class*="weather"] .widget-title:before { content: "\f176"; top: -4px;}
+
+/* facebook */
+#available-widgets [class*="facebook"] .widget-title:before { content: "\f304"; }
+
+/* twitter */
+#available-widgets [class*="tweet"] .widget-title:before,
+#available-widgets [class*="twitter"] .widget-title:before { content: "\f301"; }
+
+@media screen and (max-height: 700px) and (min-width: 981px) {
+ /* Compact widget-tops on smaller laptops, but not tablets. See ticket #27112#comment:4 */
+ .customize-control-widget_form {
+ margin-bottom: 0;
+ }
+
+ .widget-top {
+ box-shadow: none;
+ margin-top: -1px;
+ }
+
+ .widget-top:hover {
+ position: relative;
+ z-index: 1;
+ }
+
+ .last-widget {
+ margin-bottom: 15px;
+ }
+
+ .widget-title h3 {
+ padding: 13px 15px;
+ }
+
+ .widget-top .widget-action {
+ padding: 8px 10px;
+ }
+
+ .widget-reorder-nav span {
+ height: 39px;
+ }
+
+ .widget-reorder-nav span:before {
+ line-height: 39px;
+ }
+
+ /* Compact the move widget areas. */
+ #customize-theme-controls .widget-area-select li {
+ padding: 9px 15px 11px 42px;
+ }
+
+ #customize-theme-controls .widget-area-select li:before {
+ top: 8px;
+ }
+}
diff --git a/www/crm/wp-admin/css/customize-widgets.min.css b/www/crm/wp-admin/css/customize-widgets.min.css
new file mode 100644
index 00000000..14ddf46f
--- /dev/null
+++ b/www/crm/wp-admin/css/customize-widgets.min.css
@@ -0,0 +1,2 @@
+/*! This file is auto-generated */
+.wp-full-overlay-sidebar{overflow:visible}.control-section.control-section-sidebar,.customize-control-sidebar_widgets .hide-if-js,.customize-control-sidebar_widgets label{display:none}.control-section.control-section-sidebar .accordion-section-content.ui-sortable{overflow:visible}.customize-control-widget_form .widget-top{background:#fff;transition:opacity .5s}.customize-control .widget-action{color:#72777c}.customize-control .widget-action:focus,.customize-control .widget-top:hover .widget-action{color:#23282d}.customize-control-widget_form:not(.widget-rendered) .widget-top{opacity:.5}.customize-control-widget_form .widget-control-save{display:none}.customize-control-widget_form .spinner{visibility:hidden;margin-top:0}.customize-control-widget_form.previewer-loading .spinner{visibility:visible}.customize-control-widget_form.widget-form-disabled .widget-content{opacity:.7;pointer-events:none;-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none}.customize-control-widget_form .widget{margin-bottom:0}.customize-control-widget_form.wide-widget-control .widget-inside{position:fixed;left:299px;top:25%;border:1px solid #e5e5e5;overflow:auto}.customize-control-widget_form.wide-widget-control .widget-inside>.form{padding:20px}.customize-control-widget_form.wide-widget-control .widget-top{transition:background-color .4s}.customize-control-widget_form.wide-widget-control.expanded:not(.collapsing) .widget-top,.customize-control-widget_form.wide-widget-control.expanding .widget-top{background-color:#e3e3e3}.widget-inside{padding:1px 10px 10px 10px;border-top:none;line-height:16px}.customize-control-widget_form.expanded .widget-action .toggle-indicator:before{content:"\f142"}.customize-control-widget_form.wide-widget-control .widget-action .toggle-indicator:before{content:"\f139"}.customize-control-widget_form.wide-widget-control.expanded .widget-action .toggle-indicator:before{content:"\f141"}.widget-title-action{cursor:pointer}.customize-control-widget_form .widget .customize-control-title,.widget-top{cursor:move}.control-section.accordion-section.highlighted>.accordion-section-title,.customize-control-widget_form.highlighted{outline:0;box-shadow:0 0 2px rgba(30,140,190,.8);position:relative;z-index:1}#widget-customizer-control-templates{display:none}#customize-theme-controls .widget-reorder-nav{display:none;float:right;background-color:#fafafa}.move-widget:before{content:"\f504"}#customize-theme-controls .move-widget-area{display:none;background:#fff;border:1px solid #ddd;border-top:none;cursor:auto}#customize-theme-controls .reordering .move-widget-area.active{display:block}#customize-theme-controls .move-widget-area .description{margin:0;padding:15px 20px;font-weight:400}#customize-theme-controls .widget-area-select{margin:0;padding:0;list-style:none}#customize-theme-controls .widget-area-select li{position:relative;margin:0;padding:13px 15px 15px 42px;color:#555;border-top:1px solid #eee;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}#customize-theme-controls .widget-area-select li:before{display:none;content:"\f147";position:absolute;top:12px;left:10px;font:normal 20px/1 dashicons;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}#customize-theme-controls .widget-area-select li:last-child{border-bottom:1px solid #eee}#customize-theme-controls .widget-area-select .selected{color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,.4);background:#00a0d2}#customize-theme-controls .widget-area-select .selected:before{display:block}#customize-theme-controls .move-widget-actions{text-align:right;padding:12px}#customize-theme-controls .reordering .widget-title-action{display:none}#customize-theme-controls .reordering .widget-reorder-nav{display:block}.wp-customizer div.mce-inline-toolbar-grp,.wp-customizer div.mce-tooltip{z-index:500100!important}.wp-customizer .ui-autocomplete.wplink-autocomplete{z-index:500110}.wp-customizer #wp-link-backdrop{z-index:500100}.wp-customizer #wp-link-wrap{z-index:500105}#widgets-left #available-widgets .widget{float:none!important;width:auto!important}#available-widgets .widget-action{display:none}.ios #available-widgets{transition:left 0s}#available-widgets .widget-tpl.selected,#available-widgets .widget-tpl:hover{background:#f3f3f5;border-bottom-color:#ccc;color:#0073aa;border-left:4px solid #0073aa}#customize-controls .widget-title h3{font-size:1em}#available-widgets .widget-title h3{padding:0 0 5px;font-size:14px}#available-widgets .widget .widget-description{padding:0;color:#72777c}#customize-preview{transition:all .2s}body.adding-widget #available-widgets{left:0;visibility:visible}body.adding-widget .wp-full-overlay-main{left:300px}body.adding-widget #customize-preview{opacity:.4}#available-widgets .widget-title{position:relative}#available-widgets .widget-title:before{content:"\f132";position:absolute;top:-3px;right:100%;margin-right:20px;width:20px;height:20px;color:#32373c;font:normal 20px/1 dashicons;text-align:center;box-sizing:border-box;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}#available-widgets [class*=easy] .widget-title:before{content:"\f328";top:-4px}#available-widgets [class*=like] .widget-title:before,#available-widgets [class*=super] .widget-title:before{content:"\f155";top:-4px}#available-widgets [class*=meta] .widget-title:before{content:"\f120"}#available-widgets [class*=archives] .widget-title:before{content:"\f480";top:-4px}#available-widgets [class*=categor] .widget-title:before{content:"\f318";top:-4px}#available-widgets [class*=chat] .widget-title:before,#available-widgets [class*=comment] .widget-title:before,#available-widgets [class*=testimonial] .widget-title:before{content:"\f101"}#available-widgets [class*=post] .widget-title:before{content:"\f109"}#available-widgets [class*=page] .widget-title:before{content:"\f105"}#available-widgets [class*=text] .widget-title:before{content:"\f478"}#available-widgets [class*=link] .widget-title:before{content:"\f103"}#available-widgets [class*=search] .widget-title:before{content:"\f179"}#available-widgets [class*=menu] .widget-title:before,#available-widgets [class*=nav] .widget-title:before{content:"\f333"}#available-widgets [class*=tag] .widget-title:before{content:"\f479"}#available-widgets [class*=rss] .widget-title:before{content:"\f303";top:-6px}#available-widgets [class*=calendar] .widget-title:before,#available-widgets [class*=event] .widget-title:before{content:"\f145";top:-4px}#available-widgets [class*=image] .widget-title:before,#available-widgets [class*=instagram] .widget-title:before,#available-widgets [class*=photo] .widget-title:before,#available-widgets [class*=slide] .widget-title:before{content:"\f128"}#available-widgets [class*=album] .widget-title:before,#available-widgets [class*=galler] .widget-title:before{content:"\f161"}#available-widgets [class*=tube] .widget-title:before,#available-widgets [class*=video] .widget-title:before{content:"\f126"}#available-widgets [class*=audio] .widget-title:before,#available-widgets [class*=music] .widget-title:before,#available-widgets [class*=radio] .widget-title:before{content:"\f127"}#available-widgets [class*=avatar] .widget-title:before,#available-widgets [class*=grofile] .widget-title:before,#available-widgets [class*=login] .widget-title:before,#available-widgets [class*=member] .widget-title:before,#available-widgets [class*=profile] .widget-title:before,#available-widgets [class*=subscriber] .widget-title:before,#available-widgets [class*=user] .widget-title:before{content:"\f110"}#available-widgets [class*=cart] .widget-title:before,#available-widgets [class*=commerce] .widget-title:before,#available-widgets [class*=shop] .widget-title:before{content:"\f174";top:-4px}#available-widgets [class*=firewall] .widget-title:before,#available-widgets [class*=secur] .widget-title:before{content:"\f332"}#available-widgets [class*=analytic] .widget-title:before,#available-widgets [class*=poll] .widget-title:before,#available-widgets [class*=stat] .widget-title:before{content:"\f185"}#available-widgets [class*=form] .widget-title:before{content:"\f175"}#available-widgets [class*=contact] .widget-title:before,#available-widgets [class*=mail] .widget-title:before,#available-widgets [class*=news] .widget-title:before,#available-widgets [class*=subscribe] .widget-title:before{content:"\f466"}#available-widgets [class*=share] .widget-title:before,#available-widgets [class*=socia] .widget-title:before{content:"\f237"}#available-widgets [class*=lang] .widget-title:before,#available-widgets [class*=translat] .widget-title:before{content:"\f326"}#available-widgets [class*=locat] .widget-title:before,#available-widgets [class*=map] .widget-title:before{content:"\f231"}#available-widgets [class*=download] .widget-title:before{content:"\f316"}#available-widgets [class*=weather] .widget-title:before{content:"\f176";top:-4px}#available-widgets [class*=facebook] .widget-title:before{content:"\f304"}#available-widgets [class*=tweet] .widget-title:before,#available-widgets [class*=twitter] .widget-title:before{content:"\f301"}@media screen and (max-height:700px) and (min-width:981px){.customize-control-widget_form{margin-bottom:0}.widget-top{box-shadow:none;margin-top:-1px}.widget-top:hover{position:relative;z-index:1}.last-widget{margin-bottom:15px}.widget-title h3{padding:13px 15px}.widget-top .widget-action{padding:8px 10px}.widget-reorder-nav span{height:39px}.widget-reorder-nav span:before{line-height:39px}#customize-theme-controls .widget-area-select li{padding:9px 15px 11px 42px}#customize-theme-controls .widget-area-select li:before{top:8px}} \ No newline at end of file
diff --git a/www/crm/wp-admin/css/dashboard-rtl.css b/www/crm/wp-admin/css/dashboard-rtl.css
new file mode 100644
index 00000000..42a7316a
--- /dev/null
+++ b/www/crm/wp-admin/css/dashboard-rtl.css
@@ -0,0 +1,1282 @@
+#wpbody-content #dashboard-widgets.columns-1 .postbox-container {
+ width: 100%;
+}
+
+#wpbody-content #dashboard-widgets.columns-2 .postbox-container {
+ width: 49.5%;
+}
+
+#wpbody-content #dashboard-widgets.columns-2 #postbox-container-2,
+#wpbody-content #dashboard-widgets.columns-2 #postbox-container-3,
+#wpbody-content #dashboard-widgets.columns-2 #postbox-container-4 {
+ float: left;
+ width: 50.5%;
+}
+
+#wpbody-content #dashboard-widgets.columns-3 .postbox-container {
+ width: 33.5%;
+}
+
+#wpbody-content #dashboard-widgets.columns-3 #postbox-container-1 {
+ width: 33%;
+}
+
+#wpbody-content #dashboard-widgets.columns-3 #postbox-container-3,
+#wpbody-content #dashboard-widgets.columns-3 #postbox-container-4 {
+ float: left;
+}
+
+#wpbody-content #dashboard-widgets.columns-4 .postbox-container {
+ width: 25%;
+}
+
+#dashboard-widgets .postbox-container {
+ width: 25%;
+}
+
+#dashboard-widgets-wrap .columns-3 #postbox-container-4 .empty-container {
+ border: none !important;
+}
+
+.ie8 #wpbody-content #dashboard-widgets .postbox-container {
+ width: 49.5%;
+}
+
+.ie8 #wpbody-content #dashboard-widgets #postbox-container-2,
+.ie8 #wpbody-content #dashboard-widgets #postbox-container-3,
+.ie8 #wpbody-content #dashboard-widgets #postbox-container-4 {
+ float: left;
+ width: 50.5%;
+}
+
+.ie8 #dashboard-widgets #postbox-container-3 .empty-container,
+.ie8 #dashboard-widgets #postbox-container-4 .empty-container {
+ border: 0 none;
+ height: 0;
+ min-height: 0;
+}
+
+#dashboard-widgets-wrap {
+ overflow: hidden;
+ margin: 0 -8px;
+}
+
+#dashboard-widgets .postbox .inside {
+ margin-bottom: 0;
+}
+
+#dashboard-widgets .meta-box-sortables {
+ margin: 0 8px;
+ min-height: 100px;
+}
+
+/* @todo: this was originally in this section, but likely belongs elsewhere */
+#the-comment-list td.comment p.comment-author {
+ margin-top: 0;
+ margin-right: 0;
+}
+
+#the-comment-list p.comment-author img {
+ float: right;
+ margin-left: 8px;
+}
+
+#the-comment-list p.comment-author strong a {
+ border: none;
+}
+
+#the-comment-list td {
+ vertical-align: top;
+}
+
+#the-comment-list td.comment {
+ word-wrap: break-word;
+}
+
+#the-comment-list td.comment img {
+ max-width: 100%;
+}
+
+/* Welcome Panel */
+.welcome-panel {
+ position: relative;
+ overflow: auto;
+ margin: 16px 0;
+ padding: 23px 10px 0;
+ border: 1px solid #e5e5e5;
+ box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
+ background: #fff;
+ font-size: 13px;
+ line-height: 2.1em;
+}
+
+.welcome-panel h2 {
+ margin: 0;
+ font-size: 21px;
+ font-weight: 400;
+ line-height: 1.2;
+}
+
+.welcome-panel h3 {
+ margin: 1.33em 0 0;
+ font-size: 16px;
+}
+
+.welcome-panel li {
+ font-size: 14px;
+}
+
+.welcome-panel p {
+ color: #72777c;
+}
+
+.welcome-panel a {
+ text-decoration: none;
+}
+
+.welcome-panel .about-description {
+ font-size: 16px;
+ margin: 0;
+}
+
+.welcome-panel .welcome-panel-close {
+ position: absolute;
+ top: 10px;
+ left: 10px;
+ padding: 10px 21px 10px 15px;
+ font-size: 13px;
+ line-height: 1.23076923; /* Chrome rounding, needs to be 16px equivalent */
+ text-decoration: none;
+}
+
+.welcome-panel .welcome-panel-close:before {
+ position: absolute;
+ top: 8px;
+ right: 0;
+ transition: all .1s ease-in-out;
+}
+
+.wp-core-ui .welcome-panel .button.button-hero {
+ margin: 15px 0 3px 13px;
+ padding: 12px 36px;
+ height: auto;
+ line-height: 1.4285714;
+ white-space: normal;
+}
+
+.welcome-panel-content {
+ margin-right: 13px;
+ max-width: 1500px;
+}
+
+.welcome-panel .welcome-panel-column-container {
+ clear: both;
+ position: relative;
+}
+
+.welcome-panel .welcome-panel-column {
+ width: 32%;
+ min-width: 200px;
+ float: right;
+}
+
+.ie8 .welcome-panel .welcome-panel-column {
+ min-width: 230px;
+}
+
+.welcome-panel .welcome-panel-column:first-child {
+ width: 36%;
+}
+
+.welcome-panel-column p.hide-if-no-customize {
+ margin-top: 10px;
+}
+
+.welcome-panel-column p {
+ margin-top: 7px;
+ color: #444;
+}
+
+.welcome-panel .welcome-widgets-menus {
+ line-height: 16px;
+}
+
+.welcome-panel .welcome-panel-column ul {
+ margin: 0.8em 0 1em 1em;
+}
+
+.welcome-panel .welcome-panel-column li {
+ line-height: 16px;
+ list-style-type: none;
+ padding: 0 0 8px;
+}
+
+.welcome-panel .welcome-icon {
+ background: transparent !important;
+}
+
+/* Welcome Panel and Right Now common Icons style */
+
+.welcome-panel .welcome-icon:before,
+#dashboard_right_now li a:before,
+#dashboard_right_now li span:before {
+ color: #82878c;
+ font: normal 20px/1 dashicons;
+ speak: none;
+ display: inline-block;
+ padding: 0 0 0 10px;
+ position: relative;
+ -webkit-font-smoothing: antialiased;
+ -moz-osx-font-smoothing: grayscale;
+ text-decoration: none !important;
+ vertical-align: top;
+}
+
+/* Welcome Panel specific Icons styles */
+
+.welcome-panel .welcome-write-blog:before,
+.welcome-panel .welcome-edit-page:before {
+ content: "\f119";
+ top: -3px;
+}
+
+.welcome-panel .welcome-add-page:before {
+ content: "\f132";
+ top: -1px;
+}
+
+.welcome-panel .welcome-setup-home:before {
+ content: "\f102";
+ top: -1px;
+}
+
+.welcome-panel .welcome-view-site:before {
+ content: "\f115";
+ top: -2px;
+}
+
+.welcome-panel .welcome-widgets-menus:before {
+ content: "\f116";
+ top: -2px;
+}
+
+.welcome-panel .welcome-comments:before {
+ content: "\f117";
+ top: -1px;
+}
+
+.welcome-panel .welcome-learn-more:before {
+ content: "\f118";
+ top: -1px;
+}
+
+/* Right Now specific Icons styles */
+
+#dashboard_right_now li a:before,
+#dashboard_right_now li > span:before { /* get only the first level span to exclude screen-reader-text in mu-storage */
+ content: "\f159"; /* generic icon for items added by CPTs ? */
+ padding: 0 0 0 5px;
+}
+
+#dashboard_right_now .page-count a:before,
+#dashboard_right_now .page-count span:before {
+ content: "\f105";
+}
+
+#dashboard_right_now .post-count a:before,
+#dashboard_right_now .post-count span:before {
+ content: "\f109";
+}
+
+#dashboard_right_now .comment-count a:before {
+ content: "\f101";
+}
+
+#dashboard_right_now .comment-mod-count a:before {
+ content: "\f125";
+}
+
+#dashboard_right_now .storage-count a:before {
+ content: "\f104";
+}
+
+#dashboard_right_now .storage-count.warning a:before {
+ content: "\f153";
+}
+
+/* Dashboard WordPress events */
+
+.community-events-errors {
+ margin: 0;
+}
+
+.community-events-loading {
+ padding: 10px 12px 8px;
+}
+
+.community-events {
+ margin-bottom: 6px;
+ padding: 0 12px;
+}
+
+.community-events .spinner {
+ float: none;
+ margin: 5px 2px 0;
+ vertical-align: top;
+}
+
+.community-events-errors[aria-hidden="true"],
+.community-events-errors [aria-hidden="true"],
+.community-events-loading[aria-hidden="true"],
+.community-events[aria-hidden="true"],
+.community-events [aria-hidden="true"] {
+ display: none;
+}
+
+.community-events .activity-block:first-child,
+.community-events h2 {
+ padding-top: 12px;
+ padding-bottom: 10px;
+}
+
+.community-events-form {
+ margin: 15px 0 5px;
+}
+
+.community-events-form .regular-text {
+ width: 40%;
+ height: 29px;
+ margin: 0;
+ vertical-align: top;
+}
+
+.community-events li.event-none {
+ border-right: 4px solid #00a0d2;
+}
+
+.community-events-form label {
+ display: inline-block;
+ vertical-align: top;
+ line-height: 28px;
+ height: 28px;
+}
+
+.community-events .activity-block > p {
+ margin-bottom: 0;
+ display: inline;
+}
+
+.community-events-toggle-location {
+ vertical-align: middle;
+}
+
+#community-events-submit {
+ margin-right: 3px;
+ margin-left: 3px;
+}
+
+/* Needs higher specificity than #dashboard-widgets .button-link */
+#dashboard-widgets .community-events-cancel.button-link {
+ vertical-align: top;
+ /* Same properties as the submit button for cross-browsers alignment. */
+ line-height: 26px;
+ height: 28px;
+ text-decoration: underline;
+}
+
+.community-events ul {
+ background-color: #fafafa;
+ padding-right: 0;
+ padding-left: 0;
+ padding-bottom: 0;
+}
+
+.community-events li {
+ margin: 0;
+ padding: 8px 12px;
+ color: #32373c;
+}
+.community-events li:first-child {
+ border-top: 1px solid #eee;
+}
+
+.community-events li ~ li {
+ border-top: 1px solid #eee;
+}
+
+.community-events .activity-block.last {
+ border-bottom: 1px solid #eee;
+ padding-top: 0;
+ margin-top: -1px;
+}
+
+.community-events .event-info {
+ display: block;
+}
+
+.event-icon {
+ height: 18px;
+ padding-left: 10px;
+ width: 18px;
+ display: none; /* Hide on smaller screens */
+}
+
+.event-icon:before {
+ color: #82878C;
+ font-size: 18px;
+}
+.event-meetup .event-icon:before {
+ content: "\f484";
+}
+.event-wordcamp .event-icon:before {
+ content: "\f486";
+}
+
+.community-events .event-title {
+ font-weight: 600;
+ display: block;
+}
+
+.community-events .event-date,
+.community-events .event-time {
+ display: block;
+}
+
+.community-events-footer {
+ margin-top: 0;
+ margin-bottom: 0;
+ padding: 12px;
+ border-top: 1px solid #eee;
+ color: #ddd;
+}
+
+/* Safari 10 + VoiceOver specific: without this, the hidden text gets read out before the link. */
+.community-events-footer .screen-reader-text {
+ height: inherit;
+ white-space: nowrap;
+}
+
+/* Dashboard WordPress news */
+
+#dashboard_primary .inside {
+ margin: 0;
+ padding: 0;
+}
+
+#dashboard_primary .widget-loading {
+ padding: 12px 12px 0;
+ margin-bottom: 1em !important; /* Needs to override `.postbox .inside > p:last-child` in common.css */
+}
+
+/* Notice when JS is off. */
+#dashboard_primary .inside .notice {
+ margin: 0;
+}
+
+body #dashboard-widgets .postbox form .submit {
+ margin: 0;
+}
+
+/* Used only for configurable widgets. */
+.dashboard-widget-control-form p {
+ margin-top: 0;
+}
+
+.rssSummary {
+ color: #72777c;
+ margin-top: 4px;
+}
+
+#dashboard_primary .rss-widget {
+ font-size: 13px;
+ padding: 0 12px 0;
+}
+
+#dashboard_primary .rss-widget:last-child {
+ border-bottom: none;
+ padding-bottom: 8px;
+}
+
+#dashboard_primary .rss-widget a {
+ font-weight: 400;
+}
+
+#dashboard_primary .rss-widget span,
+#dashboard_primary .rss-widget span.rss-date {
+ color: #72777c;
+}
+
+#dashboard_primary .rss-widget span.rss-date {
+ margin-right: 12px;
+}
+
+#dashboard_primary .rss-widget ul li {
+ padding: 4px 0;
+ margin: 0;
+}
+
+/* Dashboard right now */
+
+#dashboard_right_now ul {
+ margin: 0;
+ /* contain floats but don't use overflow: hidden */
+ display: inline-block;
+ width: 100%;
+}
+
+#dashboard_right_now li {
+ width: 50%;
+ float: right;
+ margin-bottom: 10px;
+}
+
+#dashboard_right_now .inside {
+ padding: 0;
+}
+
+#dashboard_right_now .main {
+ padding: 0 12px 11px;
+}
+
+#dashboard_right_now .main p {
+ margin: 0;
+}
+
+#dashboard_right_now #wp-version-message .button {
+ float: left;
+ position: relative;
+ top: -5px;
+ margin-right: 5px;
+}
+
+.mu-storage {
+ overflow: hidden;
+}
+
+#dashboard-widgets h3.mu-storage {
+ margin: 0 0 10px;
+ padding: 0;
+ font-size: 14px;
+ font-weight: 400;
+}
+
+/* Dashboard right now - Colors */
+
+#dashboard_right_now .sub {
+ color: #555d66;
+ background: #f5f5f5;
+ border-top: 1px solid #eee;
+ padding: 10px 12px 6px 12px;
+}
+
+#dashboard_right_now .sub h3 {
+ color: #555;
+}
+
+#dashboard_right_now .sub p {
+ margin: 0 0 1em;
+}
+
+#dashboard_right_now .warning a:before,
+#dashboard_right_now .warning span:before {
+ color: #d54e21;
+}
+
+/* Dashboard Quick Draft */
+
+#dashboard_quick_press .inside {
+ margin: 0;
+ padding: 0;
+}
+
+#dashboard_quick_press div.updated {
+ margin-bottom: 10px;
+ border: 1px solid #eee;
+ border-width: 1px 0 1px 1px;
+}
+
+#dashboard_quick_press form {
+ margin: 12px;
+}
+
+#dashboard_quick_press .drafts {
+ padding: 10px 0 0;
+}
+
+/* Dashboard Quick Draft - Form styling */
+
+#dashboard_quick_press label {
+ display: inline-block;
+ margin-bottom: 4px;
+}
+
+#dashboard_quick_press input,
+#dashboard_quick_press textarea {
+ box-sizing: border-box;
+ margin: 0;
+}
+
+#dashboard-widgets .postbox form .submit {
+ margin: -39px 0;
+ float: left;
+}
+
+#description-wrap {
+ margin-top: 12px;
+}
+
+#quick-press textarea#content {
+ min-height: 90px;
+ max-height: 1300px;
+ margin: 0 0 8px;
+ padding: 6px 7px;
+ resize: none;
+}
+
+/* Dashboard Quick Draft - Drafts list */
+
+.js #dashboard_quick_press .drafts {
+ border-top: 1px solid #eee;
+}
+
+#dashboard_quick_press .drafts abbr {
+ border: none;
+}
+
+#dashboard_quick_press .drafts .view-all {
+ float: left;
+ margin: 0 0 0 12px;
+}
+
+#dashboard_primary a.rsswidget {
+ font-weight: 400;
+}
+
+#dashboard_quick_press .drafts ul {
+ margin: 0 12px;
+}
+
+#dashboard_quick_press .drafts li {
+ margin-bottom: 1em;
+}
+#dashboard_quick_press .drafts li time {
+ color: #72777c;
+}
+
+#dashboard_quick_press .drafts p {
+ margin: 0;
+ word-wrap: break-word;
+}
+
+#dashboard_quick_press .draft-title {
+ word-wrap: break-word;
+}
+
+#dashboard_quick_press .draft-title a,
+#dashboard_quick_press .draft-title time {
+ margin: 0 0 0 5px;
+}
+
+/* Dashboard common styles */
+
+#dashboard-widgets h4, /* Back-compat for pre-4.4 */
+#dashboard-widgets h3,
+#dashboard_quick_press .drafts h2 {
+ margin: 0 12px 8px;
+ padding: 0;
+ font-size: 14px;
+ font-weight: 400;
+ color: #23282d;
+}
+
+#dashboard_quick_press .drafts h2 {
+ line-height: inherit;
+}
+
+#dashboard-widgets .inside h4, /* Back-compat for pre-4.4 */
+#dashboard-widgets .inside h3 {
+ margin-right: 0;
+ margin-left: 0;
+}
+
+/* Dashboard activity widget */
+
+#dashboard_activity .comment-meta span.approve:before {
+ content: "\f227";
+ font: 20px/.5 dashicons;
+ margin-right: 5px;
+ vertical-align: middle;
+ position: relative;
+ top: -1px;
+ margin-left: 2px;
+}
+
+#dashboard_activity .inside {
+ margin: 0;
+ padding-bottom: 0;
+}
+
+#dashboard_activity .no-activity {
+ overflow: hidden;
+ padding: 0 0 12px;
+ text-align: center;
+}
+
+#dashboard_activity .no-activity p {
+ color: #72777c;
+ font-size: 16px;
+}
+
+#dashboard_activity .no-activity .smiley {
+ margin-top: 0;
+}
+
+#dashboard_activity .no-activity .smiley:before {
+ content: "\f328";
+ font: normal 120px/1 dashicons;
+ speak: none;
+ display: block;
+ margin: 0 0 0 5px;
+ padding: 0;
+ text-indent: 0;
+ text-align: center;
+ position: relative;
+ -webkit-font-smoothing: antialiased;
+ text-decoration: none !important;
+}
+
+#dashboard_activity .subsubsub {
+ float: none;
+ border-top: 1px solid #eee;
+ margin: 0 -12px;
+ padding: 8px 12px 4px;
+}
+
+#dashboard_activity .subsubsub a .count,
+#dashboard_activity .subsubsub a.current .count {
+ color: #72777c; /* white background on the dashboard but #f1f1f1 on list tables */
+}
+
+#future-posts ul,
+#published-posts ul {
+ clear: both;
+ margin-bottom: 0;
+}
+
+#future-posts li,
+#published-posts li {
+ margin-bottom: 8px;
+}
+
+#future-posts ul span,
+#published-posts ul span {
+ display: inline-block;
+ margin-left: 5px;
+ min-width: 150px;
+ color: #72777c;
+}
+
+.activity-block {
+ border-bottom: 1px solid #eee;
+ margin: 0 -12px;
+ padding: 8px 12px 4px;
+}
+
+.activity-block:last-child {
+ border-bottom: none;
+}
+
+.activity-block .subsubsub li {
+ color: #ddd;
+}
+
+/* Dashboard activity widget - Comments */
+/* @todo: needs serious de-duplication */
+
+#activity-widget #the-comment-list tr.undo,
+#activity-widget #the-comment-list div.undo {
+ background: none;
+ padding: 6px 0;
+ margin-right: 12px;
+}
+
+#activity-widget #the-comment-list .comment-item {
+ background: #fafafa;
+ padding: 12px;
+ position: relative;
+}
+
+#activity-widget #the-comment-list .avatar {
+ position: absolute;
+ top: 12px;
+}
+
+#activity-widget #the-comment-list .dashboard-comment-wrap {
+ padding-right: 63px;
+}
+
+#activity-widget #the-comment-list .dashboard-comment-wrap blockquote {
+ margin: 1em 0;
+}
+
+#activity-widget #the-comment-list .comment-item p.row-actions {
+ margin: 4px 0 0 0;
+}
+
+#activity-widget #the-comment-list .comment-item:first-child {
+ border-top: 1px solid #eeeeee;
+}
+
+#activity-widget #the-comment-list .unapproved {
+ background-color: #fef7f1;
+}
+
+#activity-widget #the-comment-list .unapproved:before {
+ content: "";
+ display: block;
+ position: absolute;
+ right: 0;
+ top: 0;
+ bottom: 0;
+ background: #d54e21;
+ width: 4px;
+}
+
+#activity-widget #the-comment-list .spam-undo-inside .avatar,
+#activity-widget #the-comment-list .trash-undo-inside .avatar {
+ position: relative;
+ top: 0;
+}
+
+/* Browse happy box */
+
+#dashboard-widgets #dashboard_browser_nag.postbox .inside {
+ margin: 10px;
+}
+
+.postbox .button-link .edit-box {
+ display: none;
+}
+
+.edit-box {
+ opacity: 0;
+}
+
+.hndle:hover .edit-box,
+.edit-box:focus {
+ opacity: 1;
+}
+
+#dashboard-widgets form .input-text-wrap input {
+ width: 100%;
+}
+
+#dashboard-widgets form .textarea-wrap textarea {
+ width: 100%;
+}
+
+#dashboard-widgets .postbox form .submit {
+ float: none;
+ margin: .5em 0 0;
+ padding: 0;
+ border: none;
+}
+
+#dashboard-widgets-wrap #dashboard-widgets .postbox form .submit #publish {
+ min-width: 0;
+}
+
+#dashboard-widgets a,
+#dashboard-widgets .button-link {
+ text-decoration: none;
+}
+
+#dashboard-widgets h2 a {
+ text-decoration: underline;
+}
+
+#dashboard-widgets .hndle .postbox-title-action {
+ float: left;
+ line-height: 1.2;
+}
+
+#dashboard_plugins h5 {
+ font-size: 14px;
+}
+
+/* Recent Comments */
+
+#latest-comments #the-comment-list {
+ position: relative;
+ margin: 0 -12px;
+}
+
+#activity-widget #the-comment-list .comment,
+#activity-widget #the-comment-list .pingback {
+ box-shadow: inset 0 1px 0 rgba(0, 0, 0, 0.06);
+}
+
+#activity-widget .comments #the-comment-list .alt {
+ background-color: transparent;
+}
+
+#activity-widget #latest-comments #the-comment-list .comment-item {
+ /* the row-actions paragraph is output only for users with 'edit_comment' capabilities,
+ for other users this needs a min height equal to the gravatar image */
+ min-height: 50px;
+ margin: 0;
+ padding: 12px;
+}
+
+#latest-comments #the-comment-list .pingback {
+ padding-right: 12px !important;
+}
+
+#latest-comments #the-comment-list .comment-item:first-child {
+ border-top: none;
+}
+
+#latest-comments #the-comment-list .comment-meta {
+ line-height: 1.5em;
+ margin: 0;
+ color: #666;
+}
+
+#latest-comments #the-comment-list .comment-meta cite {
+ font-style: normal;
+ font-weight: 400;
+}
+
+#latest-comments #the-comment-list .comment-item blockquote,
+#latest-comments #the-comment-list .comment-item blockquote p {
+ margin: 0;
+ padding: 0;
+ display: inline;
+}
+
+#latest-comments #the-comment-list .comment-item p.row-actions {
+ margin: 3px 0 0;
+ padding: 0;
+ font-size: 13px;
+}
+
+/* Feeds */
+.rss-widget ul {
+ margin: 0;
+ padding: 0;
+ list-style: none;
+}
+
+a.rsswidget {
+ font-size: 13px;
+ font-weight: 600;
+ line-height: 1.4em;
+}
+
+.rss-widget ul li {
+ line-height: 1.5em;
+ margin-bottom: 12px;
+}
+
+.rss-widget span.rss-date {
+ color: #72777c;
+ font-size: 13px;
+ margin-right: 3px;
+}
+
+.rss-widget cite {
+ display: block;
+ text-align: left;
+ margin: 0 0 1em;
+ padding: 0;
+}
+
+.rss-widget cite:before {
+ content: "\2014";
+}
+
+.dashboard-comment-wrap {
+ word-wrap: break-word;
+}
+
+/* Browser Nag */
+#dashboard_browser_nag a.update-browser-link {
+ font-size: 1.2em;
+ font-weight: 600;
+}
+
+#dashboard_browser_nag a {
+ text-decoration: underline;
+}
+
+#dashboard_browser_nag p.browser-update-nag.has-browser-icon {
+ padding-left: 125px;
+}
+
+#dashboard_browser_nag .browser-icon {
+ margin-top: -35px;
+}
+
+#dashboard_browser_nag.postbox.browser-insecure {
+ background-color: #ac1b1b;
+ border-color: #ac1b1b;
+}
+
+#dashboard_browser_nag.postbox {
+ background-color: #e29808;
+ background-image: none;
+ border-color: #edc048;
+ color: #fff;
+ box-shadow: none;
+}
+
+#dashboard_browser_nag.postbox.browser-insecure h2 {
+ border-bottom-color: #cd5a5a;
+ color: #fff;
+}
+
+#dashboard_browser_nag.postbox h2 {
+ border-bottom-color: #f6e2ac;
+ background: transparent none;
+ color: #fff;
+ box-shadow: none;
+}
+
+#dashboard_browser_nag a {
+ color: #fff;
+}
+
+#dashboard_browser_nag h2.hndle {
+ border: none;
+ font-weight: 600;
+ font-size: 20px;
+ padding-top: 10px;
+}
+
+.postbox#dashboard_browser_nag p a.dismiss {
+ font-size: 14px;
+}
+
+.postbox#dashboard_browser_nag p,
+.postbox#dashboard_browser_nag a,
+.postbox#dashboard_browser_nag p.browser-update-nag {
+ font-size: 16px;
+}
+
+/* PHP Nag */
+#dashboard_php_nag .dashicons-warning {
+ color: #ffb900;
+ padding-left: 6px;
+}
+
+#dashboard_php_nag.php-insecure .dashicons-warning {
+ color: #df3232;
+}
+
+#dashboard_php_nag p {
+ margin: 12px 0;
+}
+
+#dashboard_php_nag h3 {
+ font-weight: 600;
+}
+
+#dashboard_php_nag .button .dashicons-external {
+ line-height: 25px;
+}
+
+/* =Media Queries
+-------------------------------------------------------------- */
+
+/* one column on the dash */
+@media only screen and (max-width: 799px) {
+ #wpbody-content #dashboard-widgets .postbox-container {
+ width: 100%;
+ }
+}
+
+/* two columns on the dash, but keep the setting if one is selected */
+@media only screen and (min-width: 800px) and (max-width: 1499px) {
+ #wpbody-content #dashboard-widgets .postbox-container {
+ width: 49.5%;
+ }
+
+ #wpbody-content #dashboard-widgets #postbox-container-2,
+ #wpbody-content #dashboard-widgets #postbox-container-3,
+ #wpbody-content #dashboard-widgets #postbox-container-4 {
+ float: left;
+ width: 50.5%;
+ }
+
+ #dashboard-widgets #postbox-container-3 .empty-container,
+ #dashboard-widgets #postbox-container-4 .empty-container {
+ border: 0 none;
+ height: 0;
+ min-height: 0;
+ }
+
+ #dashboard-widgets #postbox-container-3 .empty-container:after,
+ #dashboard-widgets #postbox-container-4 .empty-container:after {
+ display: none;
+ }
+
+ #wpbody #wpbody-content #dashboard-widgets.columns-1 .postbox-container {
+ width: 100%;
+ }
+
+ #wpbody #wpbody-content .metabox-holder.columns-1 .postbox-container .empty-container {
+ border: 0 none;
+ height: 0;
+ min-height: 0;
+ }
+
+ /* show the radio buttons for column prefs only for one or two columns */
+ .index-php .screen-layout,
+ .index-php .columns-prefs {
+ display: block;
+ }
+
+ .columns-prefs .columns-prefs-3,
+ .columns-prefs .columns-prefs-4 {
+ display: none;
+ }
+
+ .metabox-holder .postbox-container .empty-container:after {
+ display: block;
+ }
+}
+
+/* three columns on the dash */
+@media only screen and (min-width: 1500px) and (max-width: 1800px) {
+ #wpbody-content #dashboard-widgets .postbox-container {
+ width: 33.5%;
+ }
+
+ #wpbody-content #dashboard-widgets #postbox-container-1 {
+ width: 33%;
+ }
+
+ #wpbody-content #dashboard-widgets #postbox-container-3,
+ #wpbody-content #dashboard-widgets #postbox-container-4 {
+ float: left;
+ }
+
+ #dashboard-widgets #postbox-container-4 .empty-container {
+ border: 0 none;
+ height: 0;
+ min-height: 0;
+ }
+
+ #dashboard-widgets #postbox-container-4 .empty-container:after {
+ display: none;
+ }
+
+ .metabox-holder .postbox-container .empty-container:after {
+ display: block;
+ }
+}
+
+@media screen and (max-width: 870px) {
+ .welcome-panel .welcome-panel-column,
+ .welcome-panel .welcome-panel-column:first-child {
+ display: block;
+ float: none;
+ width: 100%;
+ }
+
+ .welcome-panel .welcome-panel-column li {
+ display: inline-block;
+ margin-left: 13px;
+ }
+
+ .welcome-panel .welcome-panel-column ul {
+ margin: 0.4em 0 0;
+ }
+
+}
+
+@media screen and (max-width: 782px) {
+ #dashboard_recent_comments #the-comment-list .comment-item .avatar {
+ height: 30px;
+ width: 30px;
+ margin: 4px 0 5px 10px;
+ }
+
+ .community-events-toggle-location {
+ height: 38px;
+ vertical-align: baseline;
+ }
+
+ .community-events-form .regular-text {
+ height: 32px;
+ }
+
+ #community-events-submit {
+ margin-bottom: 0;
+ /* Override .wp-core-ui .button */
+ vertical-align: top;
+ }
+
+ .community-events-form label,
+ #dashboard-widgets .community-events-cancel.button-link {
+ /* Same properties as the submit button for cross-browsers alignment. */
+ font-size: 14px;
+ line-height: normal;
+ height: auto;
+ padding: 6px 0;
+ border: 1px solid transparent;
+ }
+
+ .community-events .spinner {
+ margin-top: 7px;
+ }
+}
+
+/* Smartphone */
+@media screen and (max-width: 600px) {
+ /* Keep the close icon from overlapping the Welcome text. */
+ .welcome-panel .welcome-panel-close {
+ overflow: hidden;
+ text-indent: 40px;
+ white-space: nowrap;
+ width: 20px;
+ height: 20px;
+ padding: 5px;
+ top: 5px;
+ left: 5px;
+ }
+
+ /* Make the close icon larger for tappability. */
+ .welcome-panel .welcome-panel-close:before {
+ font-size: 20px;
+ top: 5px;
+ right: -35px;
+ }
+}
+
+@media screen and (min-width: 355px) {
+ .community-events .event-info {
+ display: table-row;
+ float: right;
+ max-width: 59%;
+ }
+
+ .event-icon,
+ .event-icon[aria-hidden="true"] {
+ display: table-cell;
+ }
+
+ .event-info-inner {
+ display: table-cell;
+ }
+
+ .community-events .event-date-time {
+ float: left;
+ max-width: 39%;
+ }
+
+ .community-events .event-date,
+ .community-events .event-time {
+ text-align: left;
+ }
+}
diff --git a/www/crm/wp-admin/css/dashboard-rtl.min.css b/www/crm/wp-admin/css/dashboard-rtl.min.css
new file mode 100644
index 00000000..81cbe50f
--- /dev/null
+++ b/www/crm/wp-admin/css/dashboard-rtl.min.css
@@ -0,0 +1,2 @@
+/*! This file is auto-generated */
+#wpbody-content #dashboard-widgets.columns-1 .postbox-container{width:100%}#wpbody-content #dashboard-widgets.columns-2 .postbox-container{width:49.5%}#wpbody-content #dashboard-widgets.columns-2 #postbox-container-2,#wpbody-content #dashboard-widgets.columns-2 #postbox-container-3,#wpbody-content #dashboard-widgets.columns-2 #postbox-container-4{float:left;width:50.5%}#wpbody-content #dashboard-widgets.columns-3 .postbox-container{width:33.5%}#wpbody-content #dashboard-widgets.columns-3 #postbox-container-1{width:33%}#wpbody-content #dashboard-widgets.columns-3 #postbox-container-3,#wpbody-content #dashboard-widgets.columns-3 #postbox-container-4{float:left}#wpbody-content #dashboard-widgets.columns-4 .postbox-container{width:25%}#dashboard-widgets .postbox-container{width:25%}#dashboard-widgets-wrap .columns-3 #postbox-container-4 .empty-container{border:none!important}.ie8 #wpbody-content #dashboard-widgets .postbox-container{width:49.5%}.ie8 #wpbody-content #dashboard-widgets #postbox-container-2,.ie8 #wpbody-content #dashboard-widgets #postbox-container-3,.ie8 #wpbody-content #dashboard-widgets #postbox-container-4{float:left;width:50.5%}.ie8 #dashboard-widgets #postbox-container-3 .empty-container,.ie8 #dashboard-widgets #postbox-container-4 .empty-container{border:0 none;height:0;min-height:0}#dashboard-widgets-wrap{overflow:hidden;margin:0 -8px}#dashboard-widgets .postbox .inside{margin-bottom:0}#dashboard-widgets .meta-box-sortables{margin:0 8px;min-height:100px}#the-comment-list td.comment p.comment-author{margin-top:0;margin-right:0}#the-comment-list p.comment-author img{float:right;margin-left:8px}#the-comment-list p.comment-author strong a{border:none}#the-comment-list td{vertical-align:top}#the-comment-list td.comment{word-wrap:break-word}#the-comment-list td.comment img{max-width:100%}.welcome-panel{position:relative;overflow:auto;margin:16px 0;padding:23px 10px 0;border:1px solid #e5e5e5;box-shadow:0 1px 1px rgba(0,0,0,.04);background:#fff;font-size:13px;line-height:2.1em}.welcome-panel h2{margin:0;font-size:21px;font-weight:400;line-height:1.2}.welcome-panel h3{margin:1.33em 0 0;font-size:16px}.welcome-panel li{font-size:14px}.welcome-panel p{color:#72777c}.welcome-panel a{text-decoration:none}.welcome-panel .about-description{font-size:16px;margin:0}.welcome-panel .welcome-panel-close{position:absolute;top:10px;left:10px;padding:10px 21px 10px 15px;font-size:13px;line-height:1.23076923;text-decoration:none}.welcome-panel .welcome-panel-close:before{position:absolute;top:8px;right:0;transition:all .1s ease-in-out}.wp-core-ui .welcome-panel .button.button-hero{margin:15px 0 3px 13px;padding:12px 36px;height:auto;line-height:1.4285714;white-space:normal}.welcome-panel-content{margin-right:13px;max-width:1500px}.welcome-panel .welcome-panel-column-container{clear:both;position:relative}.welcome-panel .welcome-panel-column{width:32%;min-width:200px;float:right}.ie8 .welcome-panel .welcome-panel-column{min-width:230px}.welcome-panel .welcome-panel-column:first-child{width:36%}.welcome-panel-column p.hide-if-no-customize{margin-top:10px}.welcome-panel-column p{margin-top:7px;color:#444}.welcome-panel .welcome-widgets-menus{line-height:16px}.welcome-panel .welcome-panel-column ul{margin:.8em 0 1em 1em}.welcome-panel .welcome-panel-column li{line-height:16px;list-style-type:none;padding:0 0 8px}.welcome-panel .welcome-icon{background:0 0!important}#dashboard_right_now li a:before,#dashboard_right_now li span:before,.welcome-panel .welcome-icon:before{color:#82878c;font:normal 20px/1 dashicons;speak:none;display:inline-block;padding:0 0 0 10px;position:relative;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-decoration:none!important;vertical-align:top}.welcome-panel .welcome-edit-page:before,.welcome-panel .welcome-write-blog:before{content:"\f119";top:-3px}.welcome-panel .welcome-add-page:before{content:"\f132";top:-1px}.welcome-panel .welcome-setup-home:before{content:"\f102";top:-1px}.welcome-panel .welcome-view-site:before{content:"\f115";top:-2px}.welcome-panel .welcome-widgets-menus:before{content:"\f116";top:-2px}.welcome-panel .welcome-comments:before{content:"\f117";top:-1px}.welcome-panel .welcome-learn-more:before{content:"\f118";top:-1px}#dashboard_right_now li a:before,#dashboard_right_now li>span:before{content:"\f159";padding:0 0 0 5px}#dashboard_right_now .page-count a:before,#dashboard_right_now .page-count span:before{content:"\f105"}#dashboard_right_now .post-count a:before,#dashboard_right_now .post-count span:before{content:"\f109"}#dashboard_right_now .comment-count a:before{content:"\f101"}#dashboard_right_now .comment-mod-count a:before{content:"\f125"}#dashboard_right_now .storage-count a:before{content:"\f104"}#dashboard_right_now .storage-count.warning a:before{content:"\f153"}.community-events-errors{margin:0}.community-events-loading{padding:10px 12px 8px}.community-events{margin-bottom:6px;padding:0 12px}.community-events .spinner{float:none;margin:5px 2px 0;vertical-align:top}.community-events [aria-hidden=true],.community-events-errors [aria-hidden=true],.community-events-errors[aria-hidden=true],.community-events-loading[aria-hidden=true],.community-events[aria-hidden=true]{display:none}.community-events .activity-block:first-child,.community-events h2{padding-top:12px;padding-bottom:10px}.community-events-form{margin:15px 0 5px}.community-events-form .regular-text{width:40%;height:29px;margin:0;vertical-align:top}.community-events li.event-none{border-right:4px solid #00a0d2}.community-events-form label{display:inline-block;vertical-align:top;line-height:28px;height:28px}.community-events .activity-block>p{margin-bottom:0;display:inline}.community-events-toggle-location{vertical-align:middle}#community-events-submit{margin-right:3px;margin-left:3px}#dashboard-widgets .community-events-cancel.button-link{vertical-align:top;line-height:26px;height:28px;text-decoration:underline}.community-events ul{background-color:#fafafa;padding-right:0;padding-left:0;padding-bottom:0}.community-events li{margin:0;padding:8px 12px;color:#32373c}.community-events li:first-child{border-top:1px solid #eee}.community-events li~li{border-top:1px solid #eee}.community-events .activity-block.last{border-bottom:1px solid #eee;padding-top:0;margin-top:-1px}.community-events .event-info{display:block}.event-icon{height:18px;padding-left:10px;width:18px;display:none}.event-icon:before{color:#82878c;font-size:18px}.event-meetup .event-icon:before{content:"\f484"}.event-wordcamp .event-icon:before{content:"\f486"}.community-events .event-title{font-weight:600;display:block}.community-events .event-date,.community-events .event-time{display:block}.community-events-footer{margin-top:0;margin-bottom:0;padding:12px;border-top:1px solid #eee;color:#ddd}.community-events-footer .screen-reader-text{height:inherit;white-space:nowrap}#dashboard_primary .inside{margin:0;padding:0}#dashboard_primary .widget-loading{padding:12px 12px 0;margin-bottom:1em!important}#dashboard_primary .inside .notice{margin:0}body #dashboard-widgets .postbox form .submit{margin:0}.dashboard-widget-control-form p{margin-top:0}.rssSummary{color:#72777c;margin-top:4px}#dashboard_primary .rss-widget{font-size:13px;padding:0 12px 0}#dashboard_primary .rss-widget:last-child{border-bottom:none;padding-bottom:8px}#dashboard_primary .rss-widget a{font-weight:400}#dashboard_primary .rss-widget span,#dashboard_primary .rss-widget span.rss-date{color:#72777c}#dashboard_primary .rss-widget span.rss-date{margin-right:12px}#dashboard_primary .rss-widget ul li{padding:4px 0;margin:0}#dashboard_right_now ul{margin:0;display:inline-block;width:100%}#dashboard_right_now li{width:50%;float:right;margin-bottom:10px}#dashboard_right_now .inside{padding:0}#dashboard_right_now .main{padding:0 12px 11px}#dashboard_right_now .main p{margin:0}#dashboard_right_now #wp-version-message .button{float:left;position:relative;top:-5px;margin-right:5px}.mu-storage{overflow:hidden}#dashboard-widgets h3.mu-storage{margin:0 0 10px;padding:0;font-size:14px;font-weight:400}#dashboard_right_now .sub{color:#555d66;background:#f5f5f5;border-top:1px solid #eee;padding:10px 12px 6px 12px}#dashboard_right_now .sub h3{color:#555}#dashboard_right_now .sub p{margin:0 0 1em}#dashboard_right_now .warning a:before,#dashboard_right_now .warning span:before{color:#d54e21}#dashboard_quick_press .inside{margin:0;padding:0}#dashboard_quick_press div.updated{margin-bottom:10px;border:1px solid #eee;border-width:1px 0 1px 1px}#dashboard_quick_press form{margin:12px}#dashboard_quick_press .drafts{padding:10px 0 0}#dashboard_quick_press label{display:inline-block;margin-bottom:4px}#dashboard_quick_press input,#dashboard_quick_press textarea{box-sizing:border-box;margin:0}#dashboard-widgets .postbox form .submit{margin:-39px 0;float:left}#description-wrap{margin-top:12px}#quick-press textarea#content{min-height:90px;max-height:1300px;margin:0 0 8px;padding:6px 7px;resize:none}.js #dashboard_quick_press .drafts{border-top:1px solid #eee}#dashboard_quick_press .drafts abbr{border:none}#dashboard_quick_press .drafts .view-all{float:left;margin:0 0 0 12px}#dashboard_primary a.rsswidget{font-weight:400}#dashboard_quick_press .drafts ul{margin:0 12px}#dashboard_quick_press .drafts li{margin-bottom:1em}#dashboard_quick_press .drafts li time{color:#72777c}#dashboard_quick_press .drafts p{margin:0;word-wrap:break-word}#dashboard_quick_press .draft-title{word-wrap:break-word}#dashboard_quick_press .draft-title a,#dashboard_quick_press .draft-title time{margin:0 0 0 5px}#dashboard-widgets h3,#dashboard-widgets h4,#dashboard_quick_press .drafts h2{margin:0 12px 8px;padding:0;font-size:14px;font-weight:400;color:#23282d}#dashboard_quick_press .drafts h2{line-height:inherit}#dashboard-widgets .inside h3,#dashboard-widgets .inside h4{margin-right:0;margin-left:0}#dashboard_activity .comment-meta span.approve:before{content:"\f227";font:20px/.5 dashicons;margin-right:5px;vertical-align:middle;position:relative;top:-1px;margin-left:2px}#dashboard_activity .inside{margin:0;padding-bottom:0}#dashboard_activity .no-activity{overflow:hidden;padding:0 0 12px;text-align:center}#dashboard_activity .no-activity p{color:#72777c;font-size:16px}#dashboard_activity .no-activity .smiley{margin-top:0}#dashboard_activity .no-activity .smiley:before{content:"\f328";font:normal 120px/1 dashicons;speak:none;display:block;margin:0 0 0 5px;padding:0;text-indent:0;text-align:center;position:relative;-webkit-font-smoothing:antialiased;text-decoration:none!important}#dashboard_activity .subsubsub{float:none;border-top:1px solid #eee;margin:0 -12px;padding:8px 12px 4px}#dashboard_activity .subsubsub a .count,#dashboard_activity .subsubsub a.current .count{color:#72777c}#future-posts ul,#published-posts ul{clear:both;margin-bottom:0}#future-posts li,#published-posts li{margin-bottom:8px}#future-posts ul span,#published-posts ul span{display:inline-block;margin-left:5px;min-width:150px;color:#72777c}.activity-block{border-bottom:1px solid #eee;margin:0 -12px;padding:8px 12px 4px}.activity-block:last-child{border-bottom:none}.activity-block .subsubsub li{color:#ddd}#activity-widget #the-comment-list div.undo,#activity-widget #the-comment-list tr.undo{background:0 0;padding:6px 0;margin-right:12px}#activity-widget #the-comment-list .comment-item{background:#fafafa;padding:12px;position:relative}#activity-widget #the-comment-list .avatar{position:absolute;top:12px}#activity-widget #the-comment-list .dashboard-comment-wrap{padding-right:63px}#activity-widget #the-comment-list .dashboard-comment-wrap blockquote{margin:1em 0}#activity-widget #the-comment-list .comment-item p.row-actions{margin:4px 0 0 0}#activity-widget #the-comment-list .comment-item:first-child{border-top:1px solid #eee}#activity-widget #the-comment-list .unapproved{background-color:#fef7f1}#activity-widget #the-comment-list .unapproved:before{content:"";display:block;position:absolute;right:0;top:0;bottom:0;background:#d54e21;width:4px}#activity-widget #the-comment-list .spam-undo-inside .avatar,#activity-widget #the-comment-list .trash-undo-inside .avatar{position:relative;top:0}#dashboard-widgets #dashboard_browser_nag.postbox .inside{margin:10px}.postbox .button-link .edit-box{display:none}.edit-box{opacity:0}.edit-box:focus,.hndle:hover .edit-box{opacity:1}#dashboard-widgets form .input-text-wrap input{width:100%}#dashboard-widgets form .textarea-wrap textarea{width:100%}#dashboard-widgets .postbox form .submit{float:none;margin:.5em 0 0;padding:0;border:none}#dashboard-widgets-wrap #dashboard-widgets .postbox form .submit #publish{min-width:0}#dashboard-widgets .button-link,#dashboard-widgets a{text-decoration:none}#dashboard-widgets h2 a{text-decoration:underline}#dashboard-widgets .hndle .postbox-title-action{float:left;line-height:1.2}#dashboard_plugins h5{font-size:14px}#latest-comments #the-comment-list{position:relative;margin:0 -12px}#activity-widget #the-comment-list .comment,#activity-widget #the-comment-list .pingback{box-shadow:inset 0 1px 0 rgba(0,0,0,.06)}#activity-widget .comments #the-comment-list .alt{background-color:transparent}#activity-widget #latest-comments #the-comment-list .comment-item{min-height:50px;margin:0;padding:12px}#latest-comments #the-comment-list .pingback{padding-right:12px!important}#latest-comments #the-comment-list .comment-item:first-child{border-top:none}#latest-comments #the-comment-list .comment-meta{line-height:1.5em;margin:0;color:#666}#latest-comments #the-comment-list .comment-meta cite{font-style:normal;font-weight:400}#latest-comments #the-comment-list .comment-item blockquote,#latest-comments #the-comment-list .comment-item blockquote p{margin:0;padding:0;display:inline}#latest-comments #the-comment-list .comment-item p.row-actions{margin:3px 0 0;padding:0;font-size:13px}.rss-widget ul{margin:0;padding:0;list-style:none}a.rsswidget{font-size:13px;font-weight:600;line-height:1.4em}.rss-widget ul li{line-height:1.5em;margin-bottom:12px}.rss-widget span.rss-date{color:#72777c;font-size:13px;margin-right:3px}.rss-widget cite{display:block;text-align:left;margin:0 0 1em;padding:0}.rss-widget cite:before{content:"\2014"}.dashboard-comment-wrap{word-wrap:break-word}#dashboard_browser_nag a.update-browser-link{font-size:1.2em;font-weight:600}#dashboard_browser_nag a{text-decoration:underline}#dashboard_browser_nag p.browser-update-nag.has-browser-icon{padding-left:125px}#dashboard_browser_nag .browser-icon{margin-top:-35px}#dashboard_browser_nag.postbox.browser-insecure{background-color:#ac1b1b;border-color:#ac1b1b}#dashboard_browser_nag.postbox{background-color:#e29808;background-image:none;border-color:#edc048;color:#fff;box-shadow:none}#dashboard_browser_nag.postbox.browser-insecure h2{border-bottom-color:#cd5a5a;color:#fff}#dashboard_browser_nag.postbox h2{border-bottom-color:#f6e2ac;background:transparent none;color:#fff;box-shadow:none}#dashboard_browser_nag a{color:#fff}#dashboard_browser_nag h2.hndle{border:none;font-weight:600;font-size:20px;padding-top:10px}.postbox#dashboard_browser_nag p a.dismiss{font-size:14px}.postbox#dashboard_browser_nag a,.postbox#dashboard_browser_nag p,.postbox#dashboard_browser_nag p.browser-update-nag{font-size:16px}#dashboard_php_nag .dashicons-warning{color:#ffb900;padding-left:6px}#dashboard_php_nag.php-insecure .dashicons-warning{color:#df3232}#dashboard_php_nag p{margin:12px 0}#dashboard_php_nag h3{font-weight:600}#dashboard_php_nag .button .dashicons-external{line-height:25px}@media only screen and (max-width:799px){#wpbody-content #dashboard-widgets .postbox-container{width:100%}}@media only screen and (min-width:800px) and (max-width:1499px){#wpbody-content #dashboard-widgets .postbox-container{width:49.5%}#wpbody-content #dashboard-widgets #postbox-container-2,#wpbody-content #dashboard-widgets #postbox-container-3,#wpbody-content #dashboard-widgets #postbox-container-4{float:left;width:50.5%}#dashboard-widgets #postbox-container-3 .empty-container,#dashboard-widgets #postbox-container-4 .empty-container{border:0 none;height:0;min-height:0}#dashboard-widgets #postbox-container-3 .empty-container:after,#dashboard-widgets #postbox-container-4 .empty-container:after{display:none}#wpbody #wpbody-content #dashboard-widgets.columns-1 .postbox-container{width:100%}#wpbody #wpbody-content .metabox-holder.columns-1 .postbox-container .empty-container{border:0 none;height:0;min-height:0}.index-php .columns-prefs,.index-php .screen-layout{display:block}.columns-prefs .columns-prefs-3,.columns-prefs .columns-prefs-4{display:none}.metabox-holder .postbox-container .empty-container:after{display:block}}@media only screen and (min-width:1500px) and (max-width:1800px){#wpbody-content #dashboard-widgets .postbox-container{width:33.5%}#wpbody-content #dashboard-widgets #postbox-container-1{width:33%}#wpbody-content #dashboard-widgets #postbox-container-3,#wpbody-content #dashboard-widgets #postbox-container-4{float:left}#dashboard-widgets #postbox-container-4 .empty-container{border:0 none;height:0;min-height:0}#dashboard-widgets #postbox-container-4 .empty-container:after{display:none}.metabox-holder .postbox-container .empty-container:after{display:block}}@media screen and (max-width:870px){.welcome-panel .welcome-panel-column,.welcome-panel .welcome-panel-column:first-child{display:block;float:none;width:100%}.welcome-panel .welcome-panel-column li{display:inline-block;margin-left:13px}.welcome-panel .welcome-panel-column ul{margin:.4em 0 0}}@media screen and (max-width:782px){#dashboard_recent_comments #the-comment-list .comment-item .avatar{height:30px;width:30px;margin:4px 0 5px 10px}.community-events-toggle-location{height:38px;vertical-align:baseline}.community-events-form .regular-text{height:32px}#community-events-submit{margin-bottom:0;vertical-align:top}#dashboard-widgets .community-events-cancel.button-link,.community-events-form label{font-size:14px;line-height:normal;height:auto;padding:6px 0;border:1px solid transparent}.community-events .spinner{margin-top:7px}}@media screen and (max-width:600px){.welcome-panel .welcome-panel-close{overflow:hidden;text-indent:40px;white-space:nowrap;width:20px;height:20px;padding:5px;top:5px;left:5px}.welcome-panel .welcome-panel-close:before{font-size:20px;top:5px;right:-35px}}@media screen and (min-width:355px){.community-events .event-info{display:table-row;float:right;max-width:59%}.event-icon,.event-icon[aria-hidden=true]{display:table-cell}.event-info-inner{display:table-cell}.community-events .event-date-time{float:left;max-width:39%}.community-events .event-date,.community-events .event-time{text-align:left}} \ No newline at end of file
diff --git a/www/crm/wp-admin/css/dashboard.css b/www/crm/wp-admin/css/dashboard.css
new file mode 100644
index 00000000..dc810482
--- /dev/null
+++ b/www/crm/wp-admin/css/dashboard.css
@@ -0,0 +1,1282 @@
+#wpbody-content #dashboard-widgets.columns-1 .postbox-container {
+ width: 100%;
+}
+
+#wpbody-content #dashboard-widgets.columns-2 .postbox-container {
+ width: 49.5%;
+}
+
+#wpbody-content #dashboard-widgets.columns-2 #postbox-container-2,
+#wpbody-content #dashboard-widgets.columns-2 #postbox-container-3,
+#wpbody-content #dashboard-widgets.columns-2 #postbox-container-4 {
+ float: right;
+ width: 50.5%;
+}
+
+#wpbody-content #dashboard-widgets.columns-3 .postbox-container {
+ width: 33.5%;
+}
+
+#wpbody-content #dashboard-widgets.columns-3 #postbox-container-1 {
+ width: 33%;
+}
+
+#wpbody-content #dashboard-widgets.columns-3 #postbox-container-3,
+#wpbody-content #dashboard-widgets.columns-3 #postbox-container-4 {
+ float: right;
+}
+
+#wpbody-content #dashboard-widgets.columns-4 .postbox-container {
+ width: 25%;
+}
+
+#dashboard-widgets .postbox-container {
+ width: 25%;
+}
+
+#dashboard-widgets-wrap .columns-3 #postbox-container-4 .empty-container {
+ border: none !important;
+}
+
+.ie8 #wpbody-content #dashboard-widgets .postbox-container {
+ width: 49.5%;
+}
+
+.ie8 #wpbody-content #dashboard-widgets #postbox-container-2,
+.ie8 #wpbody-content #dashboard-widgets #postbox-container-3,
+.ie8 #wpbody-content #dashboard-widgets #postbox-container-4 {
+ float: right;
+ width: 50.5%;
+}
+
+.ie8 #dashboard-widgets #postbox-container-3 .empty-container,
+.ie8 #dashboard-widgets #postbox-container-4 .empty-container {
+ border: 0 none;
+ height: 0;
+ min-height: 0;
+}
+
+#dashboard-widgets-wrap {
+ overflow: hidden;
+ margin: 0 -8px;
+}
+
+#dashboard-widgets .postbox .inside {
+ margin-bottom: 0;
+}
+
+#dashboard-widgets .meta-box-sortables {
+ margin: 0 8px;
+ min-height: 100px;
+}
+
+/* @todo: this was originally in this section, but likely belongs elsewhere */
+#the-comment-list td.comment p.comment-author {
+ margin-top: 0;
+ margin-left: 0;
+}
+
+#the-comment-list p.comment-author img {
+ float: left;
+ margin-right: 8px;
+}
+
+#the-comment-list p.comment-author strong a {
+ border: none;
+}
+
+#the-comment-list td {
+ vertical-align: top;
+}
+
+#the-comment-list td.comment {
+ word-wrap: break-word;
+}
+
+#the-comment-list td.comment img {
+ max-width: 100%;
+}
+
+/* Welcome Panel */
+.welcome-panel {
+ position: relative;
+ overflow: auto;
+ margin: 16px 0;
+ padding: 23px 10px 0;
+ border: 1px solid #e5e5e5;
+ box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
+ background: #fff;
+ font-size: 13px;
+ line-height: 2.1em;
+}
+
+.welcome-panel h2 {
+ margin: 0;
+ font-size: 21px;
+ font-weight: 400;
+ line-height: 1.2;
+}
+
+.welcome-panel h3 {
+ margin: 1.33em 0 0;
+ font-size: 16px;
+}
+
+.welcome-panel li {
+ font-size: 14px;
+}
+
+.welcome-panel p {
+ color: #72777c;
+}
+
+.welcome-panel a {
+ text-decoration: none;
+}
+
+.welcome-panel .about-description {
+ font-size: 16px;
+ margin: 0;
+}
+
+.welcome-panel .welcome-panel-close {
+ position: absolute;
+ top: 10px;
+ right: 10px;
+ padding: 10px 15px 10px 21px;
+ font-size: 13px;
+ line-height: 1.23076923; /* Chrome rounding, needs to be 16px equivalent */
+ text-decoration: none;
+}
+
+.welcome-panel .welcome-panel-close:before {
+ position: absolute;
+ top: 8px;
+ left: 0;
+ transition: all .1s ease-in-out;
+}
+
+.wp-core-ui .welcome-panel .button.button-hero {
+ margin: 15px 13px 3px 0;
+ padding: 12px 36px;
+ height: auto;
+ line-height: 1.4285714;
+ white-space: normal;
+}
+
+.welcome-panel-content {
+ margin-left: 13px;
+ max-width: 1500px;
+}
+
+.welcome-panel .welcome-panel-column-container {
+ clear: both;
+ position: relative;
+}
+
+.welcome-panel .welcome-panel-column {
+ width: 32%;
+ min-width: 200px;
+ float: left;
+}
+
+.ie8 .welcome-panel .welcome-panel-column {
+ min-width: 230px;
+}
+
+.welcome-panel .welcome-panel-column:first-child {
+ width: 36%;
+}
+
+.welcome-panel-column p.hide-if-no-customize {
+ margin-top: 10px;
+}
+
+.welcome-panel-column p {
+ margin-top: 7px;
+ color: #444;
+}
+
+.welcome-panel .welcome-widgets-menus {
+ line-height: 16px;
+}
+
+.welcome-panel .welcome-panel-column ul {
+ margin: 0.8em 1em 1em 0;
+}
+
+.welcome-panel .welcome-panel-column li {
+ line-height: 16px;
+ list-style-type: none;
+ padding: 0 0 8px;
+}
+
+.welcome-panel .welcome-icon {
+ background: transparent !important;
+}
+
+/* Welcome Panel and Right Now common Icons style */
+
+.welcome-panel .welcome-icon:before,
+#dashboard_right_now li a:before,
+#dashboard_right_now li span:before {
+ color: #82878c;
+ font: normal 20px/1 dashicons;
+ speak: none;
+ display: inline-block;
+ padding: 0 10px 0 0;
+ position: relative;
+ -webkit-font-smoothing: antialiased;
+ -moz-osx-font-smoothing: grayscale;
+ text-decoration: none !important;
+ vertical-align: top;
+}
+
+/* Welcome Panel specific Icons styles */
+
+.welcome-panel .welcome-write-blog:before,
+.welcome-panel .welcome-edit-page:before {
+ content: "\f119";
+ top: -3px;
+}
+
+.welcome-panel .welcome-add-page:before {
+ content: "\f132";
+ top: -1px;
+}
+
+.welcome-panel .welcome-setup-home:before {
+ content: "\f102";
+ top: -1px;
+}
+
+.welcome-panel .welcome-view-site:before {
+ content: "\f115";
+ top: -2px;
+}
+
+.welcome-panel .welcome-widgets-menus:before {
+ content: "\f116";
+ top: -2px;
+}
+
+.welcome-panel .welcome-comments:before {
+ content: "\f117";
+ top: -1px;
+}
+
+.welcome-panel .welcome-learn-more:before {
+ content: "\f118";
+ top: -1px;
+}
+
+/* Right Now specific Icons styles */
+
+#dashboard_right_now li a:before,
+#dashboard_right_now li > span:before { /* get only the first level span to exclude screen-reader-text in mu-storage */
+ content: "\f159"; /* generic icon for items added by CPTs ? */
+ padding: 0 5px 0 0;
+}
+
+#dashboard_right_now .page-count a:before,
+#dashboard_right_now .page-count span:before {
+ content: "\f105";
+}
+
+#dashboard_right_now .post-count a:before,
+#dashboard_right_now .post-count span:before {
+ content: "\f109";
+}
+
+#dashboard_right_now .comment-count a:before {
+ content: "\f101";
+}
+
+#dashboard_right_now .comment-mod-count a:before {
+ content: "\f125";
+}
+
+#dashboard_right_now .storage-count a:before {
+ content: "\f104";
+}
+
+#dashboard_right_now .storage-count.warning a:before {
+ content: "\f153";
+}
+
+/* Dashboard WordPress events */
+
+.community-events-errors {
+ margin: 0;
+}
+
+.community-events-loading {
+ padding: 10px 12px 8px;
+}
+
+.community-events {
+ margin-bottom: 6px;
+ padding: 0 12px;
+}
+
+.community-events .spinner {
+ float: none;
+ margin: 5px 2px 0;
+ vertical-align: top;
+}
+
+.community-events-errors[aria-hidden="true"],
+.community-events-errors [aria-hidden="true"],
+.community-events-loading[aria-hidden="true"],
+.community-events[aria-hidden="true"],
+.community-events [aria-hidden="true"] {
+ display: none;
+}
+
+.community-events .activity-block:first-child,
+.community-events h2 {
+ padding-top: 12px;
+ padding-bottom: 10px;
+}
+
+.community-events-form {
+ margin: 15px 0 5px;
+}
+
+.community-events-form .regular-text {
+ width: 40%;
+ height: 29px;
+ margin: 0;
+ vertical-align: top;
+}
+
+.community-events li.event-none {
+ border-left: 4px solid #00a0d2;
+}
+
+.community-events-form label {
+ display: inline-block;
+ vertical-align: top;
+ line-height: 28px;
+ height: 28px;
+}
+
+.community-events .activity-block > p {
+ margin-bottom: 0;
+ display: inline;
+}
+
+.community-events-toggle-location {
+ vertical-align: middle;
+}
+
+#community-events-submit {
+ margin-left: 3px;
+ margin-right: 3px;
+}
+
+/* Needs higher specificity than #dashboard-widgets .button-link */
+#dashboard-widgets .community-events-cancel.button-link {
+ vertical-align: top;
+ /* Same properties as the submit button for cross-browsers alignment. */
+ line-height: 26px;
+ height: 28px;
+ text-decoration: underline;
+}
+
+.community-events ul {
+ background-color: #fafafa;
+ padding-left: 0;
+ padding-right: 0;
+ padding-bottom: 0;
+}
+
+.community-events li {
+ margin: 0;
+ padding: 8px 12px;
+ color: #32373c;
+}
+.community-events li:first-child {
+ border-top: 1px solid #eee;
+}
+
+.community-events li ~ li {
+ border-top: 1px solid #eee;
+}
+
+.community-events .activity-block.last {
+ border-bottom: 1px solid #eee;
+ padding-top: 0;
+ margin-top: -1px;
+}
+
+.community-events .event-info {
+ display: block;
+}
+
+.event-icon {
+ height: 18px;
+ padding-right: 10px;
+ width: 18px;
+ display: none; /* Hide on smaller screens */
+}
+
+.event-icon:before {
+ color: #82878C;
+ font-size: 18px;
+}
+.event-meetup .event-icon:before {
+ content: "\f484";
+}
+.event-wordcamp .event-icon:before {
+ content: "\f486";
+}
+
+.community-events .event-title {
+ font-weight: 600;
+ display: block;
+}
+
+.community-events .event-date,
+.community-events .event-time {
+ display: block;
+}
+
+.community-events-footer {
+ margin-top: 0;
+ margin-bottom: 0;
+ padding: 12px;
+ border-top: 1px solid #eee;
+ color: #ddd;
+}
+
+/* Safari 10 + VoiceOver specific: without this, the hidden text gets read out before the link. */
+.community-events-footer .screen-reader-text {
+ height: inherit;
+ white-space: nowrap;
+}
+
+/* Dashboard WordPress news */
+
+#dashboard_primary .inside {
+ margin: 0;
+ padding: 0;
+}
+
+#dashboard_primary .widget-loading {
+ padding: 12px 12px 0;
+ margin-bottom: 1em !important; /* Needs to override `.postbox .inside > p:last-child` in common.css */
+}
+
+/* Notice when JS is off. */
+#dashboard_primary .inside .notice {
+ margin: 0;
+}
+
+body #dashboard-widgets .postbox form .submit {
+ margin: 0;
+}
+
+/* Used only for configurable widgets. */
+.dashboard-widget-control-form p {
+ margin-top: 0;
+}
+
+.rssSummary {
+ color: #72777c;
+ margin-top: 4px;
+}
+
+#dashboard_primary .rss-widget {
+ font-size: 13px;
+ padding: 0 12px 0;
+}
+
+#dashboard_primary .rss-widget:last-child {
+ border-bottom: none;
+ padding-bottom: 8px;
+}
+
+#dashboard_primary .rss-widget a {
+ font-weight: 400;
+}
+
+#dashboard_primary .rss-widget span,
+#dashboard_primary .rss-widget span.rss-date {
+ color: #72777c;
+}
+
+#dashboard_primary .rss-widget span.rss-date {
+ margin-left: 12px;
+}
+
+#dashboard_primary .rss-widget ul li {
+ padding: 4px 0;
+ margin: 0;
+}
+
+/* Dashboard right now */
+
+#dashboard_right_now ul {
+ margin: 0;
+ /* contain floats but don't use overflow: hidden */
+ display: inline-block;
+ width: 100%;
+}
+
+#dashboard_right_now li {
+ width: 50%;
+ float: left;
+ margin-bottom: 10px;
+}
+
+#dashboard_right_now .inside {
+ padding: 0;
+}
+
+#dashboard_right_now .main {
+ padding: 0 12px 11px;
+}
+
+#dashboard_right_now .main p {
+ margin: 0;
+}
+
+#dashboard_right_now #wp-version-message .button {
+ float: right;
+ position: relative;
+ top: -5px;
+ margin-left: 5px;
+}
+
+.mu-storage {
+ overflow: hidden;
+}
+
+#dashboard-widgets h3.mu-storage {
+ margin: 0 0 10px;
+ padding: 0;
+ font-size: 14px;
+ font-weight: 400;
+}
+
+/* Dashboard right now - Colors */
+
+#dashboard_right_now .sub {
+ color: #555d66;
+ background: #f5f5f5;
+ border-top: 1px solid #eee;
+ padding: 10px 12px 6px 12px;
+}
+
+#dashboard_right_now .sub h3 {
+ color: #555;
+}
+
+#dashboard_right_now .sub p {
+ margin: 0 0 1em;
+}
+
+#dashboard_right_now .warning a:before,
+#dashboard_right_now .warning span:before {
+ color: #d54e21;
+}
+
+/* Dashboard Quick Draft */
+
+#dashboard_quick_press .inside {
+ margin: 0;
+ padding: 0;
+}
+
+#dashboard_quick_press div.updated {
+ margin-bottom: 10px;
+ border: 1px solid #eee;
+ border-width: 1px 1px 1px 0;
+}
+
+#dashboard_quick_press form {
+ margin: 12px;
+}
+
+#dashboard_quick_press .drafts {
+ padding: 10px 0 0;
+}
+
+/* Dashboard Quick Draft - Form styling */
+
+#dashboard_quick_press label {
+ display: inline-block;
+ margin-bottom: 4px;
+}
+
+#dashboard_quick_press input,
+#dashboard_quick_press textarea {
+ box-sizing: border-box;
+ margin: 0;
+}
+
+#dashboard-widgets .postbox form .submit {
+ margin: -39px 0;
+ float: right;
+}
+
+#description-wrap {
+ margin-top: 12px;
+}
+
+#quick-press textarea#content {
+ min-height: 90px;
+ max-height: 1300px;
+ margin: 0 0 8px;
+ padding: 6px 7px;
+ resize: none;
+}
+
+/* Dashboard Quick Draft - Drafts list */
+
+.js #dashboard_quick_press .drafts {
+ border-top: 1px solid #eee;
+}
+
+#dashboard_quick_press .drafts abbr {
+ border: none;
+}
+
+#dashboard_quick_press .drafts .view-all {
+ float: right;
+ margin: 0 12px 0 0;
+}
+
+#dashboard_primary a.rsswidget {
+ font-weight: 400;
+}
+
+#dashboard_quick_press .drafts ul {
+ margin: 0 12px;
+}
+
+#dashboard_quick_press .drafts li {
+ margin-bottom: 1em;
+}
+#dashboard_quick_press .drafts li time {
+ color: #72777c;
+}
+
+#dashboard_quick_press .drafts p {
+ margin: 0;
+ word-wrap: break-word;
+}
+
+#dashboard_quick_press .draft-title {
+ word-wrap: break-word;
+}
+
+#dashboard_quick_press .draft-title a,
+#dashboard_quick_press .draft-title time {
+ margin: 0 5px 0 0;
+}
+
+/* Dashboard common styles */
+
+#dashboard-widgets h4, /* Back-compat for pre-4.4 */
+#dashboard-widgets h3,
+#dashboard_quick_press .drafts h2 {
+ margin: 0 12px 8px;
+ padding: 0;
+ font-size: 14px;
+ font-weight: 400;
+ color: #23282d;
+}
+
+#dashboard_quick_press .drafts h2 {
+ line-height: inherit;
+}
+
+#dashboard-widgets .inside h4, /* Back-compat for pre-4.4 */
+#dashboard-widgets .inside h3 {
+ margin-left: 0;
+ margin-right: 0;
+}
+
+/* Dashboard activity widget */
+
+#dashboard_activity .comment-meta span.approve:before {
+ content: "\f227";
+ font: 20px/.5 dashicons;
+ margin-left: 5px;
+ vertical-align: middle;
+ position: relative;
+ top: -1px;
+ margin-right: 2px;
+}
+
+#dashboard_activity .inside {
+ margin: 0;
+ padding-bottom: 0;
+}
+
+#dashboard_activity .no-activity {
+ overflow: hidden;
+ padding: 0 0 12px;
+ text-align: center;
+}
+
+#dashboard_activity .no-activity p {
+ color: #72777c;
+ font-size: 16px;
+}
+
+#dashboard_activity .no-activity .smiley {
+ margin-top: 0;
+}
+
+#dashboard_activity .no-activity .smiley:before {
+ content: "\f328";
+ font: normal 120px/1 dashicons;
+ speak: none;
+ display: block;
+ margin: 0 5px 0 0;
+ padding: 0;
+ text-indent: 0;
+ text-align: center;
+ position: relative;
+ -webkit-font-smoothing: antialiased;
+ text-decoration: none !important;
+}
+
+#dashboard_activity .subsubsub {
+ float: none;
+ border-top: 1px solid #eee;
+ margin: 0 -12px;
+ padding: 8px 12px 4px;
+}
+
+#dashboard_activity .subsubsub a .count,
+#dashboard_activity .subsubsub a.current .count {
+ color: #72777c; /* white background on the dashboard but #f1f1f1 on list tables */
+}
+
+#future-posts ul,
+#published-posts ul {
+ clear: both;
+ margin-bottom: 0;
+}
+
+#future-posts li,
+#published-posts li {
+ margin-bottom: 8px;
+}
+
+#future-posts ul span,
+#published-posts ul span {
+ display: inline-block;
+ margin-right: 5px;
+ min-width: 150px;
+ color: #72777c;
+}
+
+.activity-block {
+ border-bottom: 1px solid #eee;
+ margin: 0 -12px;
+ padding: 8px 12px 4px;
+}
+
+.activity-block:last-child {
+ border-bottom: none;
+}
+
+.activity-block .subsubsub li {
+ color: #ddd;
+}
+
+/* Dashboard activity widget - Comments */
+/* @todo: needs serious de-duplication */
+
+#activity-widget #the-comment-list tr.undo,
+#activity-widget #the-comment-list div.undo {
+ background: none;
+ padding: 6px 0;
+ margin-left: 12px;
+}
+
+#activity-widget #the-comment-list .comment-item {
+ background: #fafafa;
+ padding: 12px;
+ position: relative;
+}
+
+#activity-widget #the-comment-list .avatar {
+ position: absolute;
+ top: 12px;
+}
+
+#activity-widget #the-comment-list .dashboard-comment-wrap {
+ padding-left: 63px;
+}
+
+#activity-widget #the-comment-list .dashboard-comment-wrap blockquote {
+ margin: 1em 0;
+}
+
+#activity-widget #the-comment-list .comment-item p.row-actions {
+ margin: 4px 0 0 0;
+}
+
+#activity-widget #the-comment-list .comment-item:first-child {
+ border-top: 1px solid #eeeeee;
+}
+
+#activity-widget #the-comment-list .unapproved {
+ background-color: #fef7f1;
+}
+
+#activity-widget #the-comment-list .unapproved:before {
+ content: "";
+ display: block;
+ position: absolute;
+ left: 0;
+ top: 0;
+ bottom: 0;
+ background: #d54e21;
+ width: 4px;
+}
+
+#activity-widget #the-comment-list .spam-undo-inside .avatar,
+#activity-widget #the-comment-list .trash-undo-inside .avatar {
+ position: relative;
+ top: 0;
+}
+
+/* Browse happy box */
+
+#dashboard-widgets #dashboard_browser_nag.postbox .inside {
+ margin: 10px;
+}
+
+.postbox .button-link .edit-box {
+ display: none;
+}
+
+.edit-box {
+ opacity: 0;
+}
+
+.hndle:hover .edit-box,
+.edit-box:focus {
+ opacity: 1;
+}
+
+#dashboard-widgets form .input-text-wrap input {
+ width: 100%;
+}
+
+#dashboard-widgets form .textarea-wrap textarea {
+ width: 100%;
+}
+
+#dashboard-widgets .postbox form .submit {
+ float: none;
+ margin: .5em 0 0;
+ padding: 0;
+ border: none;
+}
+
+#dashboard-widgets-wrap #dashboard-widgets .postbox form .submit #publish {
+ min-width: 0;
+}
+
+#dashboard-widgets a,
+#dashboard-widgets .button-link {
+ text-decoration: none;
+}
+
+#dashboard-widgets h2 a {
+ text-decoration: underline;
+}
+
+#dashboard-widgets .hndle .postbox-title-action {
+ float: right;
+ line-height: 1.2;
+}
+
+#dashboard_plugins h5 {
+ font-size: 14px;
+}
+
+/* Recent Comments */
+
+#latest-comments #the-comment-list {
+ position: relative;
+ margin: 0 -12px;
+}
+
+#activity-widget #the-comment-list .comment,
+#activity-widget #the-comment-list .pingback {
+ box-shadow: inset 0 1px 0 rgba(0, 0, 0, 0.06);
+}
+
+#activity-widget .comments #the-comment-list .alt {
+ background-color: transparent;
+}
+
+#activity-widget #latest-comments #the-comment-list .comment-item {
+ /* the row-actions paragraph is output only for users with 'edit_comment' capabilities,
+ for other users this needs a min height equal to the gravatar image */
+ min-height: 50px;
+ margin: 0;
+ padding: 12px;
+}
+
+#latest-comments #the-comment-list .pingback {
+ padding-left: 12px !important;
+}
+
+#latest-comments #the-comment-list .comment-item:first-child {
+ border-top: none;
+}
+
+#latest-comments #the-comment-list .comment-meta {
+ line-height: 1.5em;
+ margin: 0;
+ color: #666;
+}
+
+#latest-comments #the-comment-list .comment-meta cite {
+ font-style: normal;
+ font-weight: 400;
+}
+
+#latest-comments #the-comment-list .comment-item blockquote,
+#latest-comments #the-comment-list .comment-item blockquote p {
+ margin: 0;
+ padding: 0;
+ display: inline;
+}
+
+#latest-comments #the-comment-list .comment-item p.row-actions {
+ margin: 3px 0 0;
+ padding: 0;
+ font-size: 13px;
+}
+
+/* Feeds */
+.rss-widget ul {
+ margin: 0;
+ padding: 0;
+ list-style: none;
+}
+
+a.rsswidget {
+ font-size: 13px;
+ font-weight: 600;
+ line-height: 1.4em;
+}
+
+.rss-widget ul li {
+ line-height: 1.5em;
+ margin-bottom: 12px;
+}
+
+.rss-widget span.rss-date {
+ color: #72777c;
+ font-size: 13px;
+ margin-left: 3px;
+}
+
+.rss-widget cite {
+ display: block;
+ text-align: right;
+ margin: 0 0 1em;
+ padding: 0;
+}
+
+.rss-widget cite:before {
+ content: "\2014";
+}
+
+.dashboard-comment-wrap {
+ word-wrap: break-word;
+}
+
+/* Browser Nag */
+#dashboard_browser_nag a.update-browser-link {
+ font-size: 1.2em;
+ font-weight: 600;
+}
+
+#dashboard_browser_nag a {
+ text-decoration: underline;
+}
+
+#dashboard_browser_nag p.browser-update-nag.has-browser-icon {
+ padding-right: 125px;
+}
+
+#dashboard_browser_nag .browser-icon {
+ margin-top: -35px;
+}
+
+#dashboard_browser_nag.postbox.browser-insecure {
+ background-color: #ac1b1b;
+ border-color: #ac1b1b;
+}
+
+#dashboard_browser_nag.postbox {
+ background-color: #e29808;
+ background-image: none;
+ border-color: #edc048;
+ color: #fff;
+ box-shadow: none;
+}
+
+#dashboard_browser_nag.postbox.browser-insecure h2 {
+ border-bottom-color: #cd5a5a;
+ color: #fff;
+}
+
+#dashboard_browser_nag.postbox h2 {
+ border-bottom-color: #f6e2ac;
+ background: transparent none;
+ color: #fff;
+ box-shadow: none;
+}
+
+#dashboard_browser_nag a {
+ color: #fff;
+}
+
+#dashboard_browser_nag h2.hndle {
+ border: none;
+ font-weight: 600;
+ font-size: 20px;
+ padding-top: 10px;
+}
+
+.postbox#dashboard_browser_nag p a.dismiss {
+ font-size: 14px;
+}
+
+.postbox#dashboard_browser_nag p,
+.postbox#dashboard_browser_nag a,
+.postbox#dashboard_browser_nag p.browser-update-nag {
+ font-size: 16px;
+}
+
+/* PHP Nag */
+#dashboard_php_nag .dashicons-warning {
+ color: #ffb900;
+ padding-right: 6px;
+}
+
+#dashboard_php_nag.php-insecure .dashicons-warning {
+ color: #df3232;
+}
+
+#dashboard_php_nag p {
+ margin: 12px 0;
+}
+
+#dashboard_php_nag h3 {
+ font-weight: 600;
+}
+
+#dashboard_php_nag .button .dashicons-external {
+ line-height: 25px;
+}
+
+/* =Media Queries
+-------------------------------------------------------------- */
+
+/* one column on the dash */
+@media only screen and (max-width: 799px) {
+ #wpbody-content #dashboard-widgets .postbox-container {
+ width: 100%;
+ }
+}
+
+/* two columns on the dash, but keep the setting if one is selected */
+@media only screen and (min-width: 800px) and (max-width: 1499px) {
+ #wpbody-content #dashboard-widgets .postbox-container {
+ width: 49.5%;
+ }
+
+ #wpbody-content #dashboard-widgets #postbox-container-2,
+ #wpbody-content #dashboard-widgets #postbox-container-3,
+ #wpbody-content #dashboard-widgets #postbox-container-4 {
+ float: right;
+ width: 50.5%;
+ }
+
+ #dashboard-widgets #postbox-container-3 .empty-container,
+ #dashboard-widgets #postbox-container-4 .empty-container {
+ border: 0 none;
+ height: 0;
+ min-height: 0;
+ }
+
+ #dashboard-widgets #postbox-container-3 .empty-container:after,
+ #dashboard-widgets #postbox-container-4 .empty-container:after {
+ display: none;
+ }
+
+ #wpbody #wpbody-content #dashboard-widgets.columns-1 .postbox-container {
+ width: 100%;
+ }
+
+ #wpbody #wpbody-content .metabox-holder.columns-1 .postbox-container .empty-container {
+ border: 0 none;
+ height: 0;
+ min-height: 0;
+ }
+
+ /* show the radio buttons for column prefs only for one or two columns */
+ .index-php .screen-layout,
+ .index-php .columns-prefs {
+ display: block;
+ }
+
+ .columns-prefs .columns-prefs-3,
+ .columns-prefs .columns-prefs-4 {
+ display: none;
+ }
+
+ .metabox-holder .postbox-container .empty-container:after {
+ display: block;
+ }
+}
+
+/* three columns on the dash */
+@media only screen and (min-width: 1500px) and (max-width: 1800px) {
+ #wpbody-content #dashboard-widgets .postbox-container {
+ width: 33.5%;
+ }
+
+ #wpbody-content #dashboard-widgets #postbox-container-1 {
+ width: 33%;
+ }
+
+ #wpbody-content #dashboard-widgets #postbox-container-3,
+ #wpbody-content #dashboard-widgets #postbox-container-4 {
+ float: right;
+ }
+
+ #dashboard-widgets #postbox-container-4 .empty-container {
+ border: 0 none;
+ height: 0;
+ min-height: 0;
+ }
+
+ #dashboard-widgets #postbox-container-4 .empty-container:after {
+ display: none;
+ }
+
+ .metabox-holder .postbox-container .empty-container:after {
+ display: block;
+ }
+}
+
+@media screen and (max-width: 870px) {
+ .welcome-panel .welcome-panel-column,
+ .welcome-panel .welcome-panel-column:first-child {
+ display: block;
+ float: none;
+ width: 100%;
+ }
+
+ .welcome-panel .welcome-panel-column li {
+ display: inline-block;
+ margin-right: 13px;
+ }
+
+ .welcome-panel .welcome-panel-column ul {
+ margin: 0.4em 0 0;
+ }
+
+}
+
+@media screen and (max-width: 782px) {
+ #dashboard_recent_comments #the-comment-list .comment-item .avatar {
+ height: 30px;
+ width: 30px;
+ margin: 4px 10px 5px 0;
+ }
+
+ .community-events-toggle-location {
+ height: 38px;
+ vertical-align: baseline;
+ }
+
+ .community-events-form .regular-text {
+ height: 32px;
+ }
+
+ #community-events-submit {
+ margin-bottom: 0;
+ /* Override .wp-core-ui .button */
+ vertical-align: top;
+ }
+
+ .community-events-form label,
+ #dashboard-widgets .community-events-cancel.button-link {
+ /* Same properties as the submit button for cross-browsers alignment. */
+ font-size: 14px;
+ line-height: normal;
+ height: auto;
+ padding: 6px 0;
+ border: 1px solid transparent;
+ }
+
+ .community-events .spinner {
+ margin-top: 7px;
+ }
+}
+
+/* Smartphone */
+@media screen and (max-width: 600px) {
+ /* Keep the close icon from overlapping the Welcome text. */
+ .welcome-panel .welcome-panel-close {
+ overflow: hidden;
+ text-indent: 40px;
+ white-space: nowrap;
+ width: 20px;
+ height: 20px;
+ padding: 5px;
+ top: 5px;
+ right: 5px;
+ }
+
+ /* Make the close icon larger for tappability. */
+ .welcome-panel .welcome-panel-close:before {
+ font-size: 20px;
+ top: 5px;
+ left: -35px;
+ }
+}
+
+@media screen and (min-width: 355px) {
+ .community-events .event-info {
+ display: table-row;
+ float: left;
+ max-width: 59%;
+ }
+
+ .event-icon,
+ .event-icon[aria-hidden="true"] {
+ display: table-cell;
+ }
+
+ .event-info-inner {
+ display: table-cell;
+ }
+
+ .community-events .event-date-time {
+ float: right;
+ max-width: 39%;
+ }
+
+ .community-events .event-date,
+ .community-events .event-time {
+ text-align: right;
+ }
+}
diff --git a/www/crm/wp-admin/css/dashboard.min.css b/www/crm/wp-admin/css/dashboard.min.css
new file mode 100644
index 00000000..57f3bf45
--- /dev/null
+++ b/www/crm/wp-admin/css/dashboard.min.css
@@ -0,0 +1,2 @@
+/*! This file is auto-generated */
+#wpbody-content #dashboard-widgets.columns-1 .postbox-container{width:100%}#wpbody-content #dashboard-widgets.columns-2 .postbox-container{width:49.5%}#wpbody-content #dashboard-widgets.columns-2 #postbox-container-2,#wpbody-content #dashboard-widgets.columns-2 #postbox-container-3,#wpbody-content #dashboard-widgets.columns-2 #postbox-container-4{float:right;width:50.5%}#wpbody-content #dashboard-widgets.columns-3 .postbox-container{width:33.5%}#wpbody-content #dashboard-widgets.columns-3 #postbox-container-1{width:33%}#wpbody-content #dashboard-widgets.columns-3 #postbox-container-3,#wpbody-content #dashboard-widgets.columns-3 #postbox-container-4{float:right}#wpbody-content #dashboard-widgets.columns-4 .postbox-container{width:25%}#dashboard-widgets .postbox-container{width:25%}#dashboard-widgets-wrap .columns-3 #postbox-container-4 .empty-container{border:none!important}.ie8 #wpbody-content #dashboard-widgets .postbox-container{width:49.5%}.ie8 #wpbody-content #dashboard-widgets #postbox-container-2,.ie8 #wpbody-content #dashboard-widgets #postbox-container-3,.ie8 #wpbody-content #dashboard-widgets #postbox-container-4{float:right;width:50.5%}.ie8 #dashboard-widgets #postbox-container-3 .empty-container,.ie8 #dashboard-widgets #postbox-container-4 .empty-container{border:0 none;height:0;min-height:0}#dashboard-widgets-wrap{overflow:hidden;margin:0 -8px}#dashboard-widgets .postbox .inside{margin-bottom:0}#dashboard-widgets .meta-box-sortables{margin:0 8px;min-height:100px}#the-comment-list td.comment p.comment-author{margin-top:0;margin-left:0}#the-comment-list p.comment-author img{float:left;margin-right:8px}#the-comment-list p.comment-author strong a{border:none}#the-comment-list td{vertical-align:top}#the-comment-list td.comment{word-wrap:break-word}#the-comment-list td.comment img{max-width:100%}.welcome-panel{position:relative;overflow:auto;margin:16px 0;padding:23px 10px 0;border:1px solid #e5e5e5;box-shadow:0 1px 1px rgba(0,0,0,.04);background:#fff;font-size:13px;line-height:2.1em}.welcome-panel h2{margin:0;font-size:21px;font-weight:400;line-height:1.2}.welcome-panel h3{margin:1.33em 0 0;font-size:16px}.welcome-panel li{font-size:14px}.welcome-panel p{color:#72777c}.welcome-panel a{text-decoration:none}.welcome-panel .about-description{font-size:16px;margin:0}.welcome-panel .welcome-panel-close{position:absolute;top:10px;right:10px;padding:10px 15px 10px 21px;font-size:13px;line-height:1.23076923;text-decoration:none}.welcome-panel .welcome-panel-close:before{position:absolute;top:8px;left:0;transition:all .1s ease-in-out}.wp-core-ui .welcome-panel .button.button-hero{margin:15px 13px 3px 0;padding:12px 36px;height:auto;line-height:1.4285714;white-space:normal}.welcome-panel-content{margin-left:13px;max-width:1500px}.welcome-panel .welcome-panel-column-container{clear:both;position:relative}.welcome-panel .welcome-panel-column{width:32%;min-width:200px;float:left}.ie8 .welcome-panel .welcome-panel-column{min-width:230px}.welcome-panel .welcome-panel-column:first-child{width:36%}.welcome-panel-column p.hide-if-no-customize{margin-top:10px}.welcome-panel-column p{margin-top:7px;color:#444}.welcome-panel .welcome-widgets-menus{line-height:16px}.welcome-panel .welcome-panel-column ul{margin:.8em 1em 1em 0}.welcome-panel .welcome-panel-column li{line-height:16px;list-style-type:none;padding:0 0 8px}.welcome-panel .welcome-icon{background:0 0!important}#dashboard_right_now li a:before,#dashboard_right_now li span:before,.welcome-panel .welcome-icon:before{color:#82878c;font:normal 20px/1 dashicons;speak:none;display:inline-block;padding:0 10px 0 0;position:relative;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-decoration:none!important;vertical-align:top}.welcome-panel .welcome-edit-page:before,.welcome-panel .welcome-write-blog:before{content:"\f119";top:-3px}.welcome-panel .welcome-add-page:before{content:"\f132";top:-1px}.welcome-panel .welcome-setup-home:before{content:"\f102";top:-1px}.welcome-panel .welcome-view-site:before{content:"\f115";top:-2px}.welcome-panel .welcome-widgets-menus:before{content:"\f116";top:-2px}.welcome-panel .welcome-comments:before{content:"\f117";top:-1px}.welcome-panel .welcome-learn-more:before{content:"\f118";top:-1px}#dashboard_right_now li a:before,#dashboard_right_now li>span:before{content:"\f159";padding:0 5px 0 0}#dashboard_right_now .page-count a:before,#dashboard_right_now .page-count span:before{content:"\f105"}#dashboard_right_now .post-count a:before,#dashboard_right_now .post-count span:before{content:"\f109"}#dashboard_right_now .comment-count a:before{content:"\f101"}#dashboard_right_now .comment-mod-count a:before{content:"\f125"}#dashboard_right_now .storage-count a:before{content:"\f104"}#dashboard_right_now .storage-count.warning a:before{content:"\f153"}.community-events-errors{margin:0}.community-events-loading{padding:10px 12px 8px}.community-events{margin-bottom:6px;padding:0 12px}.community-events .spinner{float:none;margin:5px 2px 0;vertical-align:top}.community-events [aria-hidden=true],.community-events-errors [aria-hidden=true],.community-events-errors[aria-hidden=true],.community-events-loading[aria-hidden=true],.community-events[aria-hidden=true]{display:none}.community-events .activity-block:first-child,.community-events h2{padding-top:12px;padding-bottom:10px}.community-events-form{margin:15px 0 5px}.community-events-form .regular-text{width:40%;height:29px;margin:0;vertical-align:top}.community-events li.event-none{border-left:4px solid #00a0d2}.community-events-form label{display:inline-block;vertical-align:top;line-height:28px;height:28px}.community-events .activity-block>p{margin-bottom:0;display:inline}.community-events-toggle-location{vertical-align:middle}#community-events-submit{margin-left:3px;margin-right:3px}#dashboard-widgets .community-events-cancel.button-link{vertical-align:top;line-height:26px;height:28px;text-decoration:underline}.community-events ul{background-color:#fafafa;padding-left:0;padding-right:0;padding-bottom:0}.community-events li{margin:0;padding:8px 12px;color:#32373c}.community-events li:first-child{border-top:1px solid #eee}.community-events li~li{border-top:1px solid #eee}.community-events .activity-block.last{border-bottom:1px solid #eee;padding-top:0;margin-top:-1px}.community-events .event-info{display:block}.event-icon{height:18px;padding-right:10px;width:18px;display:none}.event-icon:before{color:#82878c;font-size:18px}.event-meetup .event-icon:before{content:"\f484"}.event-wordcamp .event-icon:before{content:"\f486"}.community-events .event-title{font-weight:600;display:block}.community-events .event-date,.community-events .event-time{display:block}.community-events-footer{margin-top:0;margin-bottom:0;padding:12px;border-top:1px solid #eee;color:#ddd}.community-events-footer .screen-reader-text{height:inherit;white-space:nowrap}#dashboard_primary .inside{margin:0;padding:0}#dashboard_primary .widget-loading{padding:12px 12px 0;margin-bottom:1em!important}#dashboard_primary .inside .notice{margin:0}body #dashboard-widgets .postbox form .submit{margin:0}.dashboard-widget-control-form p{margin-top:0}.rssSummary{color:#72777c;margin-top:4px}#dashboard_primary .rss-widget{font-size:13px;padding:0 12px 0}#dashboard_primary .rss-widget:last-child{border-bottom:none;padding-bottom:8px}#dashboard_primary .rss-widget a{font-weight:400}#dashboard_primary .rss-widget span,#dashboard_primary .rss-widget span.rss-date{color:#72777c}#dashboard_primary .rss-widget span.rss-date{margin-left:12px}#dashboard_primary .rss-widget ul li{padding:4px 0;margin:0}#dashboard_right_now ul{margin:0;display:inline-block;width:100%}#dashboard_right_now li{width:50%;float:left;margin-bottom:10px}#dashboard_right_now .inside{padding:0}#dashboard_right_now .main{padding:0 12px 11px}#dashboard_right_now .main p{margin:0}#dashboard_right_now #wp-version-message .button{float:right;position:relative;top:-5px;margin-left:5px}.mu-storage{overflow:hidden}#dashboard-widgets h3.mu-storage{margin:0 0 10px;padding:0;font-size:14px;font-weight:400}#dashboard_right_now .sub{color:#555d66;background:#f5f5f5;border-top:1px solid #eee;padding:10px 12px 6px 12px}#dashboard_right_now .sub h3{color:#555}#dashboard_right_now .sub p{margin:0 0 1em}#dashboard_right_now .warning a:before,#dashboard_right_now .warning span:before{color:#d54e21}#dashboard_quick_press .inside{margin:0;padding:0}#dashboard_quick_press div.updated{margin-bottom:10px;border:1px solid #eee;border-width:1px 1px 1px 0}#dashboard_quick_press form{margin:12px}#dashboard_quick_press .drafts{padding:10px 0 0}#dashboard_quick_press label{display:inline-block;margin-bottom:4px}#dashboard_quick_press input,#dashboard_quick_press textarea{box-sizing:border-box;margin:0}#dashboard-widgets .postbox form .submit{margin:-39px 0;float:right}#description-wrap{margin-top:12px}#quick-press textarea#content{min-height:90px;max-height:1300px;margin:0 0 8px;padding:6px 7px;resize:none}.js #dashboard_quick_press .drafts{border-top:1px solid #eee}#dashboard_quick_press .drafts abbr{border:none}#dashboard_quick_press .drafts .view-all{float:right;margin:0 12px 0 0}#dashboard_primary a.rsswidget{font-weight:400}#dashboard_quick_press .drafts ul{margin:0 12px}#dashboard_quick_press .drafts li{margin-bottom:1em}#dashboard_quick_press .drafts li time{color:#72777c}#dashboard_quick_press .drafts p{margin:0;word-wrap:break-word}#dashboard_quick_press .draft-title{word-wrap:break-word}#dashboard_quick_press .draft-title a,#dashboard_quick_press .draft-title time{margin:0 5px 0 0}#dashboard-widgets h3,#dashboard-widgets h4,#dashboard_quick_press .drafts h2{margin:0 12px 8px;padding:0;font-size:14px;font-weight:400;color:#23282d}#dashboard_quick_press .drafts h2{line-height:inherit}#dashboard-widgets .inside h3,#dashboard-widgets .inside h4{margin-left:0;margin-right:0}#dashboard_activity .comment-meta span.approve:before{content:"\f227";font:20px/.5 dashicons;margin-left:5px;vertical-align:middle;position:relative;top:-1px;margin-right:2px}#dashboard_activity .inside{margin:0;padding-bottom:0}#dashboard_activity .no-activity{overflow:hidden;padding:0 0 12px;text-align:center}#dashboard_activity .no-activity p{color:#72777c;font-size:16px}#dashboard_activity .no-activity .smiley{margin-top:0}#dashboard_activity .no-activity .smiley:before{content:"\f328";font:normal 120px/1 dashicons;speak:none;display:block;margin:0 5px 0 0;padding:0;text-indent:0;text-align:center;position:relative;-webkit-font-smoothing:antialiased;text-decoration:none!important}#dashboard_activity .subsubsub{float:none;border-top:1px solid #eee;margin:0 -12px;padding:8px 12px 4px}#dashboard_activity .subsubsub a .count,#dashboard_activity .subsubsub a.current .count{color:#72777c}#future-posts ul,#published-posts ul{clear:both;margin-bottom:0}#future-posts li,#published-posts li{margin-bottom:8px}#future-posts ul span,#published-posts ul span{display:inline-block;margin-right:5px;min-width:150px;color:#72777c}.activity-block{border-bottom:1px solid #eee;margin:0 -12px;padding:8px 12px 4px}.activity-block:last-child{border-bottom:none}.activity-block .subsubsub li{color:#ddd}#activity-widget #the-comment-list div.undo,#activity-widget #the-comment-list tr.undo{background:0 0;padding:6px 0;margin-left:12px}#activity-widget #the-comment-list .comment-item{background:#fafafa;padding:12px;position:relative}#activity-widget #the-comment-list .avatar{position:absolute;top:12px}#activity-widget #the-comment-list .dashboard-comment-wrap{padding-left:63px}#activity-widget #the-comment-list .dashboard-comment-wrap blockquote{margin:1em 0}#activity-widget #the-comment-list .comment-item p.row-actions{margin:4px 0 0 0}#activity-widget #the-comment-list .comment-item:first-child{border-top:1px solid #eee}#activity-widget #the-comment-list .unapproved{background-color:#fef7f1}#activity-widget #the-comment-list .unapproved:before{content:"";display:block;position:absolute;left:0;top:0;bottom:0;background:#d54e21;width:4px}#activity-widget #the-comment-list .spam-undo-inside .avatar,#activity-widget #the-comment-list .trash-undo-inside .avatar{position:relative;top:0}#dashboard-widgets #dashboard_browser_nag.postbox .inside{margin:10px}.postbox .button-link .edit-box{display:none}.edit-box{opacity:0}.edit-box:focus,.hndle:hover .edit-box{opacity:1}#dashboard-widgets form .input-text-wrap input{width:100%}#dashboard-widgets form .textarea-wrap textarea{width:100%}#dashboard-widgets .postbox form .submit{float:none;margin:.5em 0 0;padding:0;border:none}#dashboard-widgets-wrap #dashboard-widgets .postbox form .submit #publish{min-width:0}#dashboard-widgets .button-link,#dashboard-widgets a{text-decoration:none}#dashboard-widgets h2 a{text-decoration:underline}#dashboard-widgets .hndle .postbox-title-action{float:right;line-height:1.2}#dashboard_plugins h5{font-size:14px}#latest-comments #the-comment-list{position:relative;margin:0 -12px}#activity-widget #the-comment-list .comment,#activity-widget #the-comment-list .pingback{box-shadow:inset 0 1px 0 rgba(0,0,0,.06)}#activity-widget .comments #the-comment-list .alt{background-color:transparent}#activity-widget #latest-comments #the-comment-list .comment-item{min-height:50px;margin:0;padding:12px}#latest-comments #the-comment-list .pingback{padding-left:12px!important}#latest-comments #the-comment-list .comment-item:first-child{border-top:none}#latest-comments #the-comment-list .comment-meta{line-height:1.5em;margin:0;color:#666}#latest-comments #the-comment-list .comment-meta cite{font-style:normal;font-weight:400}#latest-comments #the-comment-list .comment-item blockquote,#latest-comments #the-comment-list .comment-item blockquote p{margin:0;padding:0;display:inline}#latest-comments #the-comment-list .comment-item p.row-actions{margin:3px 0 0;padding:0;font-size:13px}.rss-widget ul{margin:0;padding:0;list-style:none}a.rsswidget{font-size:13px;font-weight:600;line-height:1.4em}.rss-widget ul li{line-height:1.5em;margin-bottom:12px}.rss-widget span.rss-date{color:#72777c;font-size:13px;margin-left:3px}.rss-widget cite{display:block;text-align:right;margin:0 0 1em;padding:0}.rss-widget cite:before{content:"\2014"}.dashboard-comment-wrap{word-wrap:break-word}#dashboard_browser_nag a.update-browser-link{font-size:1.2em;font-weight:600}#dashboard_browser_nag a{text-decoration:underline}#dashboard_browser_nag p.browser-update-nag.has-browser-icon{padding-right:125px}#dashboard_browser_nag .browser-icon{margin-top:-35px}#dashboard_browser_nag.postbox.browser-insecure{background-color:#ac1b1b;border-color:#ac1b1b}#dashboard_browser_nag.postbox{background-color:#e29808;background-image:none;border-color:#edc048;color:#fff;box-shadow:none}#dashboard_browser_nag.postbox.browser-insecure h2{border-bottom-color:#cd5a5a;color:#fff}#dashboard_browser_nag.postbox h2{border-bottom-color:#f6e2ac;background:transparent none;color:#fff;box-shadow:none}#dashboard_browser_nag a{color:#fff}#dashboard_browser_nag h2.hndle{border:none;font-weight:600;font-size:20px;padding-top:10px}.postbox#dashboard_browser_nag p a.dismiss{font-size:14px}.postbox#dashboard_browser_nag a,.postbox#dashboard_browser_nag p,.postbox#dashboard_browser_nag p.browser-update-nag{font-size:16px}#dashboard_php_nag .dashicons-warning{color:#ffb900;padding-right:6px}#dashboard_php_nag.php-insecure .dashicons-warning{color:#df3232}#dashboard_php_nag p{margin:12px 0}#dashboard_php_nag h3{font-weight:600}#dashboard_php_nag .button .dashicons-external{line-height:25px}@media only screen and (max-width:799px){#wpbody-content #dashboard-widgets .postbox-container{width:100%}}@media only screen and (min-width:800px) and (max-width:1499px){#wpbody-content #dashboard-widgets .postbox-container{width:49.5%}#wpbody-content #dashboard-widgets #postbox-container-2,#wpbody-content #dashboard-widgets #postbox-container-3,#wpbody-content #dashboard-widgets #postbox-container-4{float:right;width:50.5%}#dashboard-widgets #postbox-container-3 .empty-container,#dashboard-widgets #postbox-container-4 .empty-container{border:0 none;height:0;min-height:0}#dashboard-widgets #postbox-container-3 .empty-container:after,#dashboard-widgets #postbox-container-4 .empty-container:after{display:none}#wpbody #wpbody-content #dashboard-widgets.columns-1 .postbox-container{width:100%}#wpbody #wpbody-content .metabox-holder.columns-1 .postbox-container .empty-container{border:0 none;height:0;min-height:0}.index-php .columns-prefs,.index-php .screen-layout{display:block}.columns-prefs .columns-prefs-3,.columns-prefs .columns-prefs-4{display:none}.metabox-holder .postbox-container .empty-container:after{display:block}}@media only screen and (min-width:1500px) and (max-width:1800px){#wpbody-content #dashboard-widgets .postbox-container{width:33.5%}#wpbody-content #dashboard-widgets #postbox-container-1{width:33%}#wpbody-content #dashboard-widgets #postbox-container-3,#wpbody-content #dashboard-widgets #postbox-container-4{float:right}#dashboard-widgets #postbox-container-4 .empty-container{border:0 none;height:0;min-height:0}#dashboard-widgets #postbox-container-4 .empty-container:after{display:none}.metabox-holder .postbox-container .empty-container:after{display:block}}@media screen and (max-width:870px){.welcome-panel .welcome-panel-column,.welcome-panel .welcome-panel-column:first-child{display:block;float:none;width:100%}.welcome-panel .welcome-panel-column li{display:inline-block;margin-right:13px}.welcome-panel .welcome-panel-column ul{margin:.4em 0 0}}@media screen and (max-width:782px){#dashboard_recent_comments #the-comment-list .comment-item .avatar{height:30px;width:30px;margin:4px 10px 5px 0}.community-events-toggle-location{height:38px;vertical-align:baseline}.community-events-form .regular-text{height:32px}#community-events-submit{margin-bottom:0;vertical-align:top}#dashboard-widgets .community-events-cancel.button-link,.community-events-form label{font-size:14px;line-height:normal;height:auto;padding:6px 0;border:1px solid transparent}.community-events .spinner{margin-top:7px}}@media screen and (max-width:600px){.welcome-panel .welcome-panel-close{overflow:hidden;text-indent:40px;white-space:nowrap;width:20px;height:20px;padding:5px;top:5px;right:5px}.welcome-panel .welcome-panel-close:before{font-size:20px;top:5px;left:-35px}}@media screen and (min-width:355px){.community-events .event-info{display:table-row;float:left;max-width:59%}.event-icon,.event-icon[aria-hidden=true]{display:table-cell}.event-info-inner{display:table-cell}.community-events .event-date-time{float:right;max-width:39%}.community-events .event-date,.community-events .event-time{text-align:right}} \ No newline at end of file
diff --git a/www/crm/wp-admin/css/deprecated-media-rtl.css b/www/crm/wp-admin/css/deprecated-media-rtl.css
new file mode 100644
index 00000000..f5d23041
--- /dev/null
+++ b/www/crm/wp-admin/css/deprecated-media-rtl.css
@@ -0,0 +1,429 @@
+/* Styles for the media library iframe (not used on the Library screen) */
+
+div#media-upload-header {
+ margin: 0;
+ padding: 5px 5px 0;
+ font-weight: 600;
+ position: relative;
+ border-bottom: 1px solid #ddd;
+ background: #f9f9f9;
+}
+
+#sidemenu {
+ overflow: hidden;
+ float: none;
+ position: relative;
+ right: 0;
+ bottom: -1px;
+ margin: 0 5px;
+ padding-right: 10px;
+ list-style: none;
+ font-size: 12px;
+ font-weight: 400;
+}
+
+#sidemenu a {
+ padding: 0 7px;
+ display: block;
+ float: right;
+ line-height: 28px;
+ border-top: 1px solid #f9f9f9;
+ border-bottom: 1px solid #ddd;
+ background-color: #f9f9f9;
+ text-decoration: none;
+ transition: none;
+}
+
+#sidemenu li {
+ display: inline;
+ line-height: 200%;
+ list-style: none;
+ text-align: center;
+ white-space: nowrap;
+ margin: 0;
+ padding: 0;
+}
+
+#sidemenu a.current {
+ font-weight: 400;
+ padding-right: 6px;
+ padding-left: 6px;
+ border: 1px solid #ddd;
+ border-bottom-color: #f1f1f1;
+ background-color: #f1f1f1;
+ color: #000;
+}
+
+#media-upload:after { /* clearfix */
+ content: "";
+ display: table;
+ clear: both;
+}
+
+#media-upload .slidetoggle {
+ border-top-color: #ddd;
+}
+
+#media-upload input[type="radio"] {
+ padding: 0;
+}
+
+.media-upload-form label.form-help,
+td.help {
+ color: #72777c;
+}
+
+form {
+ margin: 1em;
+}
+
+#search-filter {
+ text-align: left;
+}
+
+th {
+ position: relative;
+}
+
+.media-upload-form label.form-help, td.help {
+ font-family: sans-serif;
+ font-style: italic;
+ font-weight: 400;
+}
+
+.media-upload-form p.help {
+ margin: 0;
+ padding: 0;
+}
+
+.media-upload-form fieldset {
+ width: 100%;
+ border: none;
+ text-align: justify;
+ margin: 0 0 1em 0;
+ padding: 0;
+}
+
+/* specific to the image upload form */
+
+.image-align-none-label {
+ background: url(../images/align-none.png) no-repeat center left;
+}
+
+.image-align-left-label {
+ background: url(../images/align-left.png) no-repeat center left;
+}
+
+.image-align-center-label {
+ background: url(../images/align-center.png) no-repeat center left;
+}
+
+.image-align-right-label {
+ background: url(../images/align-right.png) no-repeat center left;
+}
+
+tr.image-size td {
+ width: 460px;
+}
+
+tr.image-size div.image-size-item {
+ margin: 0 0 5px;
+}
+
+#library-form .progress,
+#gallery-form .progress,
+.insert-gallery,
+.describe.startopen,
+.describe.startclosed {
+ display: none;
+}
+
+.media-item .thumbnail {
+ max-width: 128px;
+ max-height: 128px;
+}
+
+thead.media-item-info tr {
+ background-color: transparent;
+}
+
+.form-table thead.media-item-info {
+ border: 8px solid #fff;
+}
+
+abbr.required,
+span.required {
+ text-decoration: none;
+ border: none;
+}
+
+.describe label {
+ display: inline;
+}
+
+.describe td.error {
+ padding: 2px 8px;
+}
+
+.describe td.A1 {
+ width: 132px;
+}
+
+.describe input[type="text"],
+.describe textarea {
+ width: 460px;
+ border-width: 1px;
+ border-style: solid;
+}
+
+/* Specific to Uploader */
+
+#media-upload p.ml-submit {
+ padding: 1em 0;
+}
+
+#media-upload p.help,
+#media-upload label.help {
+ font-family: sans-serif;
+ font-style: italic;
+ font-weight: 400;
+}
+
+#media-upload .ui-sortable .media-item {
+ cursor: move;
+}
+
+#media-upload tr.image-size {
+ margin-bottom: 1em;
+ height: 3em;
+}
+
+#media-upload #filter {
+ width: 623px;
+}
+
+#media-upload #filter .subsubsub {
+ margin: 8px 0;
+}
+
+#media-upload .tablenav-pages a,
+#media-upload .tablenav-pages .current {
+ display: inline-block;
+ padding: 4px 5px 6px;
+ font-size: 16px;
+ line-height: 1;
+ text-align: center;
+ text-decoration: none;
+}
+
+#media-upload .tablenav-pages a {
+ min-width: 17px;
+ border: 1px solid #ccc;
+ background: #f7f7f7;
+}
+
+#filter .tablenav select {
+ border-style: solid;
+ border-width: 1px;
+ padding: 2px;
+ vertical-align: top;
+ width: auto;
+}
+
+#media-upload .del-attachment {
+ display: none;
+ margin: 5px 0;
+}
+
+.menu_order {
+ float: left;
+ font-size: 11px;
+ margin: 8px 10px 0;
+}
+
+.menu_order_input {
+ border: 1px solid #ddd;
+ font-size: 10px;
+ padding: 1px;
+ width: 23px;
+}
+
+.ui-sortable-helper {
+ background-color: #fff;
+ border: 1px solid #a0a5aa;
+ opacity: 0.6;
+ filter: alpha(opacity=60);
+}
+
+#media-upload th.order-head {
+ width: 20%;
+ text-align: center;
+}
+
+#media-upload th.actions-head {
+ width: 25%;
+ text-align: center;
+}
+
+#media-upload a.wp-post-thumbnail {
+ margin: 0 20px;
+}
+
+#media-upload .widefat {
+ border-style: solid solid none;
+}
+
+.sorthelper {
+ height: 37px;
+ width: 623px;
+ display: block;
+}
+
+#gallery-settings th.label {
+ width: 160px;
+}
+
+#gallery-settings #basic th.label {
+ padding: 5px 0 5px 5px;
+}
+
+#gallery-settings .title {
+ clear: both;
+ padding: 0 0 3px;
+ font-size: 1.6em;
+ border-bottom: 1px solid #ddd;
+}
+
+h3.media-title {
+ font-size: 1.6em;
+}
+
+h4.media-sub-title {
+ border-bottom: 1px solid #ddd;
+ font-size: 1.3em;
+ margin: 12px;
+ padding: 0 0 3px;
+}
+
+#gallery-settings .title,
+h3.media-title,
+h4.media-sub-title {
+ font-family: Georgia,"Times New Roman",Times,serif;
+ font-weight: 400;
+ color: #5A5A5A;
+}
+
+#gallery-settings .describe td {
+ vertical-align: middle;
+ height: 3em;
+}
+
+#gallery-settings .describe th.label {
+ padding-top: .5em;
+ text-align: right;
+}
+
+#gallery-settings .describe {
+ padding: 5px;
+ width: 100%;
+ clear: both;
+ cursor: default;
+ background: #fff;
+}
+
+#gallery-settings .describe select {
+ width: 15em;
+}
+
+#gallery-settings .describe select option,
+#gallery-settings .describe td {
+ padding: 0;
+}
+
+#gallery-settings label,
+#gallery-settings legend {
+ font-size: 13px;
+ color: #444;
+ margin-left: 15px;
+}
+
+#gallery-settings .align .field label {
+ margin: 0 3px 0 1em;
+}
+
+#gallery-settings p.ml-submit {
+ border-top: 1px solid #ddd;
+}
+
+#gallery-settings select#columns {
+ width: 6em;
+}
+
+#sort-buttons {
+ font-size: 0.8em;
+ margin: 3px 0 -8px 25px;
+ text-align: left;
+ max-width: 625px;
+}
+
+#sort-buttons a {
+ text-decoration: none;
+}
+
+#sort-buttons #asc,
+#sort-buttons #showall {
+ padding-right: 5px;
+}
+
+#sort-buttons span {
+ margin-left: 25px;
+}
+
+p.media-types {
+ margin: 0;
+ padding: 1em;
+}
+
+p.media-types-required-info {
+ padding-top: 0;
+}
+
+tr.not-image {
+ display: none;
+}
+
+table.not-image tr.not-image {
+ display: table-row;
+}
+
+table.not-image tr.image-only {
+ display: none;
+}
+
+/**
+ * HiDPI Displays
+ */
+@media print,
+ (-webkit-min-device-pixel-ratio: 1.25),
+ (min-resolution: 120dpi) {
+
+ .image-align-none-label {
+ background-image: url(../images/align-none-2x.png?ver=20120916);
+ background-size: 21px 15px;
+ }
+
+ .image-align-left-label {
+ background-image: url(../images/align-left-2x.png?ver=20120916);
+ background-size: 22px 15px;
+ }
+
+ .image-align-center-label {
+ background-image: url(../images/align-center-2x.png?ver=20120916);
+ background-size: 21px 15px;
+ }
+
+ .image-align-right-label {
+ background-image: url(../images/align-right-2x.png?ver=20120916);
+ background-size: 22px 15px;
+ }
+}
diff --git a/www/crm/wp-admin/css/deprecated-media-rtl.min.css b/www/crm/wp-admin/css/deprecated-media-rtl.min.css
new file mode 100644
index 00000000..affd60eb
--- /dev/null
+++ b/www/crm/wp-admin/css/deprecated-media-rtl.min.css
@@ -0,0 +1,2 @@
+/*! This file is auto-generated */
+div#media-upload-header{margin:0;padding:5px 5px 0;font-weight:600;position:relative;border-bottom:1px solid #ddd;background:#f9f9f9}#sidemenu{overflow:hidden;float:none;position:relative;right:0;bottom:-1px;margin:0 5px;padding-right:10px;list-style:none;font-size:12px;font-weight:400}#sidemenu a{padding:0 7px;display:block;float:right;line-height:28px;border-top:1px solid #f9f9f9;border-bottom:1px solid #ddd;background-color:#f9f9f9;text-decoration:none;transition:none}#sidemenu li{display:inline;line-height:200%;list-style:none;text-align:center;white-space:nowrap;margin:0;padding:0}#sidemenu a.current{font-weight:400;padding-right:6px;padding-left:6px;border:1px solid #ddd;border-bottom-color:#f1f1f1;background-color:#f1f1f1;color:#000}#media-upload:after{content:"";display:table;clear:both}#media-upload .slidetoggle{border-top-color:#ddd}#media-upload input[type=radio]{padding:0}.media-upload-form label.form-help,td.help{color:#72777c}form{margin:1em}#search-filter{text-align:left}th{position:relative}.media-upload-form label.form-help,td.help{font-family:sans-serif;font-style:italic;font-weight:400}.media-upload-form p.help{margin:0;padding:0}.media-upload-form fieldset{width:100%;border:none;text-align:justify;margin:0 0 1em 0;padding:0}.image-align-none-label{background:url(../images/align-none.png) no-repeat center left}.image-align-left-label{background:url(../images/align-left.png) no-repeat center left}.image-align-center-label{background:url(../images/align-center.png) no-repeat center left}.image-align-right-label{background:url(../images/align-right.png) no-repeat center left}tr.image-size td{width:460px}tr.image-size div.image-size-item{margin:0 0 5px}#gallery-form .progress,#library-form .progress,.describe.startclosed,.describe.startopen,.insert-gallery{display:none}.media-item .thumbnail{max-width:128px;max-height:128px}thead.media-item-info tr{background-color:transparent}.form-table thead.media-item-info{border:8px solid #fff}abbr.required,span.required{text-decoration:none;border:none}.describe label{display:inline}.describe td.error{padding:2px 8px}.describe td.A1{width:132px}.describe input[type=text],.describe textarea{width:460px;border-width:1px;border-style:solid}#media-upload p.ml-submit{padding:1em 0}#media-upload label.help,#media-upload p.help{font-family:sans-serif;font-style:italic;font-weight:400}#media-upload .ui-sortable .media-item{cursor:move}#media-upload tr.image-size{margin-bottom:1em;height:3em}#media-upload #filter{width:623px}#media-upload #filter .subsubsub{margin:8px 0}#media-upload .tablenav-pages .current,#media-upload .tablenav-pages a{display:inline-block;padding:4px 5px 6px;font-size:16px;line-height:1;text-align:center;text-decoration:none}#media-upload .tablenav-pages a{min-width:17px;border:1px solid #ccc;background:#f7f7f7}#filter .tablenav select{border-style:solid;border-width:1px;padding:2px;vertical-align:top;width:auto}#media-upload .del-attachment{display:none;margin:5px 0}.menu_order{float:left;font-size:11px;margin:8px 10px 0}.menu_order_input{border:1px solid #ddd;font-size:10px;padding:1px;width:23px}.ui-sortable-helper{background-color:#fff;border:1px solid #a0a5aa;opacity:.6;filter:alpha(opacity=60)}#media-upload th.order-head{width:20%;text-align:center}#media-upload th.actions-head{width:25%;text-align:center}#media-upload a.wp-post-thumbnail{margin:0 20px}#media-upload .widefat{border-style:solid solid none}.sorthelper{height:37px;width:623px;display:block}#gallery-settings th.label{width:160px}#gallery-settings #basic th.label{padding:5px 0 5px 5px}#gallery-settings .title{clear:both;padding:0 0 3px;font-size:1.6em;border-bottom:1px solid #ddd}h3.media-title{font-size:1.6em}h4.media-sub-title{border-bottom:1px solid #ddd;font-size:1.3em;margin:12px;padding:0 0 3px}#gallery-settings .title,h3.media-title,h4.media-sub-title{font-family:Georgia,"Times New Roman",Times,serif;font-weight:400;color:#5a5a5a}#gallery-settings .describe td{vertical-align:middle;height:3em}#gallery-settings .describe th.label{padding-top:.5em;text-align:right}#gallery-settings .describe{padding:5px;width:100%;clear:both;cursor:default;background:#fff}#gallery-settings .describe select{width:15em}#gallery-settings .describe select option,#gallery-settings .describe td{padding:0}#gallery-settings label,#gallery-settings legend{font-size:13px;color:#444;margin-left:15px}#gallery-settings .align .field label{margin:0 3px 0 1em}#gallery-settings p.ml-submit{border-top:1px solid #ddd}#gallery-settings select#columns{width:6em}#sort-buttons{font-size:.8em;margin:3px 0 -8px 25px;text-align:left;max-width:625px}#sort-buttons a{text-decoration:none}#sort-buttons #asc,#sort-buttons #showall{padding-right:5px}#sort-buttons span{margin-left:25px}p.media-types{margin:0;padding:1em}p.media-types-required-info{padding-top:0}tr.not-image{display:none}table.not-image tr.not-image{display:table-row}table.not-image tr.image-only{display:none}@media print,(-webkit-min-device-pixel-ratio:1.25),(min-resolution:120dpi){.image-align-none-label{background-image:url(../images/align-none-2x.png?ver=20120916);background-size:21px 15px}.image-align-left-label{background-image:url(../images/align-left-2x.png?ver=20120916);background-size:22px 15px}.image-align-center-label{background-image:url(../images/align-center-2x.png?ver=20120916);background-size:21px 15px}.image-align-right-label{background-image:url(../images/align-right-2x.png?ver=20120916);background-size:22px 15px}} \ No newline at end of file
diff --git a/www/crm/wp-admin/css/deprecated-media.css b/www/crm/wp-admin/css/deprecated-media.css
new file mode 100644
index 00000000..22d7a9f5
--- /dev/null
+++ b/www/crm/wp-admin/css/deprecated-media.css
@@ -0,0 +1,429 @@
+/* Styles for the media library iframe (not used on the Library screen) */
+
+div#media-upload-header {
+ margin: 0;
+ padding: 5px 5px 0;
+ font-weight: 600;
+ position: relative;
+ border-bottom: 1px solid #ddd;
+ background: #f9f9f9;
+}
+
+#sidemenu {
+ overflow: hidden;
+ float: none;
+ position: relative;
+ left: 0;
+ bottom: -1px;
+ margin: 0 5px;
+ padding-left: 10px;
+ list-style: none;
+ font-size: 12px;
+ font-weight: 400;
+}
+
+#sidemenu a {
+ padding: 0 7px;
+ display: block;
+ float: left;
+ line-height: 28px;
+ border-top: 1px solid #f9f9f9;
+ border-bottom: 1px solid #ddd;
+ background-color: #f9f9f9;
+ text-decoration: none;
+ transition: none;
+}
+
+#sidemenu li {
+ display: inline;
+ line-height: 200%;
+ list-style: none;
+ text-align: center;
+ white-space: nowrap;
+ margin: 0;
+ padding: 0;
+}
+
+#sidemenu a.current {
+ font-weight: 400;
+ padding-left: 6px;
+ padding-right: 6px;
+ border: 1px solid #ddd;
+ border-bottom-color: #f1f1f1;
+ background-color: #f1f1f1;
+ color: #000;
+}
+
+#media-upload:after { /* clearfix */
+ content: "";
+ display: table;
+ clear: both;
+}
+
+#media-upload .slidetoggle {
+ border-top-color: #ddd;
+}
+
+#media-upload input[type="radio"] {
+ padding: 0;
+}
+
+.media-upload-form label.form-help,
+td.help {
+ color: #72777c;
+}
+
+form {
+ margin: 1em;
+}
+
+#search-filter {
+ text-align: right;
+}
+
+th {
+ position: relative;
+}
+
+.media-upload-form label.form-help, td.help {
+ font-family: sans-serif;
+ font-style: italic;
+ font-weight: 400;
+}
+
+.media-upload-form p.help {
+ margin: 0;
+ padding: 0;
+}
+
+.media-upload-form fieldset {
+ width: 100%;
+ border: none;
+ text-align: justify;
+ margin: 0 0 1em 0;
+ padding: 0;
+}
+
+/* specific to the image upload form */
+
+.image-align-none-label {
+ background: url(../images/align-none.png) no-repeat center left;
+}
+
+.image-align-left-label {
+ background: url(../images/align-left.png) no-repeat center left;
+}
+
+.image-align-center-label {
+ background: url(../images/align-center.png) no-repeat center left;
+}
+
+.image-align-right-label {
+ background: url(../images/align-right.png) no-repeat center left;
+}
+
+tr.image-size td {
+ width: 460px;
+}
+
+tr.image-size div.image-size-item {
+ margin: 0 0 5px;
+}
+
+#library-form .progress,
+#gallery-form .progress,
+.insert-gallery,
+.describe.startopen,
+.describe.startclosed {
+ display: none;
+}
+
+.media-item .thumbnail {
+ max-width: 128px;
+ max-height: 128px;
+}
+
+thead.media-item-info tr {
+ background-color: transparent;
+}
+
+.form-table thead.media-item-info {
+ border: 8px solid #fff;
+}
+
+abbr.required,
+span.required {
+ text-decoration: none;
+ border: none;
+}
+
+.describe label {
+ display: inline;
+}
+
+.describe td.error {
+ padding: 2px 8px;
+}
+
+.describe td.A1 {
+ width: 132px;
+}
+
+.describe input[type="text"],
+.describe textarea {
+ width: 460px;
+ border-width: 1px;
+ border-style: solid;
+}
+
+/* Specific to Uploader */
+
+#media-upload p.ml-submit {
+ padding: 1em 0;
+}
+
+#media-upload p.help,
+#media-upload label.help {
+ font-family: sans-serif;
+ font-style: italic;
+ font-weight: 400;
+}
+
+#media-upload .ui-sortable .media-item {
+ cursor: move;
+}
+
+#media-upload tr.image-size {
+ margin-bottom: 1em;
+ height: 3em;
+}
+
+#media-upload #filter {
+ width: 623px;
+}
+
+#media-upload #filter .subsubsub {
+ margin: 8px 0;
+}
+
+#media-upload .tablenav-pages a,
+#media-upload .tablenav-pages .current {
+ display: inline-block;
+ padding: 4px 5px 6px;
+ font-size: 16px;
+ line-height: 1;
+ text-align: center;
+ text-decoration: none;
+}
+
+#media-upload .tablenav-pages a {
+ min-width: 17px;
+ border: 1px solid #ccc;
+ background: #f7f7f7;
+}
+
+#filter .tablenav select {
+ border-style: solid;
+ border-width: 1px;
+ padding: 2px;
+ vertical-align: top;
+ width: auto;
+}
+
+#media-upload .del-attachment {
+ display: none;
+ margin: 5px 0;
+}
+
+.menu_order {
+ float: right;
+ font-size: 11px;
+ margin: 8px 10px 0;
+}
+
+.menu_order_input {
+ border: 1px solid #ddd;
+ font-size: 10px;
+ padding: 1px;
+ width: 23px;
+}
+
+.ui-sortable-helper {
+ background-color: #fff;
+ border: 1px solid #a0a5aa;
+ opacity: 0.6;
+ filter: alpha(opacity=60);
+}
+
+#media-upload th.order-head {
+ width: 20%;
+ text-align: center;
+}
+
+#media-upload th.actions-head {
+ width: 25%;
+ text-align: center;
+}
+
+#media-upload a.wp-post-thumbnail {
+ margin: 0 20px;
+}
+
+#media-upload .widefat {
+ border-style: solid solid none;
+}
+
+.sorthelper {
+ height: 37px;
+ width: 623px;
+ display: block;
+}
+
+#gallery-settings th.label {
+ width: 160px;
+}
+
+#gallery-settings #basic th.label {
+ padding: 5px 5px 5px 0;
+}
+
+#gallery-settings .title {
+ clear: both;
+ padding: 0 0 3px;
+ font-size: 1.6em;
+ border-bottom: 1px solid #ddd;
+}
+
+h3.media-title {
+ font-size: 1.6em;
+}
+
+h4.media-sub-title {
+ border-bottom: 1px solid #ddd;
+ font-size: 1.3em;
+ margin: 12px;
+ padding: 0 0 3px;
+}
+
+#gallery-settings .title,
+h3.media-title,
+h4.media-sub-title {
+ font-family: Georgia,"Times New Roman",Times,serif;
+ font-weight: 400;
+ color: #5A5A5A;
+}
+
+#gallery-settings .describe td {
+ vertical-align: middle;
+ height: 3em;
+}
+
+#gallery-settings .describe th.label {
+ padding-top: .5em;
+ text-align: left;
+}
+
+#gallery-settings .describe {
+ padding: 5px;
+ width: 100%;
+ clear: both;
+ cursor: default;
+ background: #fff;
+}
+
+#gallery-settings .describe select {
+ width: 15em;
+}
+
+#gallery-settings .describe select option,
+#gallery-settings .describe td {
+ padding: 0;
+}
+
+#gallery-settings label,
+#gallery-settings legend {
+ font-size: 13px;
+ color: #444;
+ margin-right: 15px;
+}
+
+#gallery-settings .align .field label {
+ margin: 0 1em 0 3px;
+}
+
+#gallery-settings p.ml-submit {
+ border-top: 1px solid #ddd;
+}
+
+#gallery-settings select#columns {
+ width: 6em;
+}
+
+#sort-buttons {
+ font-size: 0.8em;
+ margin: 3px 25px -8px 0;
+ text-align: right;
+ max-width: 625px;
+}
+
+#sort-buttons a {
+ text-decoration: none;
+}
+
+#sort-buttons #asc,
+#sort-buttons #showall {
+ padding-left: 5px;
+}
+
+#sort-buttons span {
+ margin-right: 25px;
+}
+
+p.media-types {
+ margin: 0;
+ padding: 1em;
+}
+
+p.media-types-required-info {
+ padding-top: 0;
+}
+
+tr.not-image {
+ display: none;
+}
+
+table.not-image tr.not-image {
+ display: table-row;
+}
+
+table.not-image tr.image-only {
+ display: none;
+}
+
+/**
+ * HiDPI Displays
+ */
+@media print,
+ (-webkit-min-device-pixel-ratio: 1.25),
+ (min-resolution: 120dpi) {
+
+ .image-align-none-label {
+ background-image: url(../images/align-none-2x.png?ver=20120916);
+ background-size: 21px 15px;
+ }
+
+ .image-align-left-label {
+ background-image: url(../images/align-left-2x.png?ver=20120916);
+ background-size: 22px 15px;
+ }
+
+ .image-align-center-label {
+ background-image: url(../images/align-center-2x.png?ver=20120916);
+ background-size: 21px 15px;
+ }
+
+ .image-align-right-label {
+ background-image: url(../images/align-right-2x.png?ver=20120916);
+ background-size: 22px 15px;
+ }
+}
diff --git a/www/crm/wp-admin/css/deprecated-media.min.css b/www/crm/wp-admin/css/deprecated-media.min.css
new file mode 100644
index 00000000..adec832f
--- /dev/null
+++ b/www/crm/wp-admin/css/deprecated-media.min.css
@@ -0,0 +1,2 @@
+/*! This file is auto-generated */
+div#media-upload-header{margin:0;padding:5px 5px 0;font-weight:600;position:relative;border-bottom:1px solid #ddd;background:#f9f9f9}#sidemenu{overflow:hidden;float:none;position:relative;left:0;bottom:-1px;margin:0 5px;padding-left:10px;list-style:none;font-size:12px;font-weight:400}#sidemenu a{padding:0 7px;display:block;float:left;line-height:28px;border-top:1px solid #f9f9f9;border-bottom:1px solid #ddd;background-color:#f9f9f9;text-decoration:none;transition:none}#sidemenu li{display:inline;line-height:200%;list-style:none;text-align:center;white-space:nowrap;margin:0;padding:0}#sidemenu a.current{font-weight:400;padding-left:6px;padding-right:6px;border:1px solid #ddd;border-bottom-color:#f1f1f1;background-color:#f1f1f1;color:#000}#media-upload:after{content:"";display:table;clear:both}#media-upload .slidetoggle{border-top-color:#ddd}#media-upload input[type=radio]{padding:0}.media-upload-form label.form-help,td.help{color:#72777c}form{margin:1em}#search-filter{text-align:right}th{position:relative}.media-upload-form label.form-help,td.help{font-family:sans-serif;font-style:italic;font-weight:400}.media-upload-form p.help{margin:0;padding:0}.media-upload-form fieldset{width:100%;border:none;text-align:justify;margin:0 0 1em 0;padding:0}.image-align-none-label{background:url(../images/align-none.png) no-repeat center left}.image-align-left-label{background:url(../images/align-left.png) no-repeat center left}.image-align-center-label{background:url(../images/align-center.png) no-repeat center left}.image-align-right-label{background:url(../images/align-right.png) no-repeat center left}tr.image-size td{width:460px}tr.image-size div.image-size-item{margin:0 0 5px}#gallery-form .progress,#library-form .progress,.describe.startclosed,.describe.startopen,.insert-gallery{display:none}.media-item .thumbnail{max-width:128px;max-height:128px}thead.media-item-info tr{background-color:transparent}.form-table thead.media-item-info{border:8px solid #fff}abbr.required,span.required{text-decoration:none;border:none}.describe label{display:inline}.describe td.error{padding:2px 8px}.describe td.A1{width:132px}.describe input[type=text],.describe textarea{width:460px;border-width:1px;border-style:solid}#media-upload p.ml-submit{padding:1em 0}#media-upload label.help,#media-upload p.help{font-family:sans-serif;font-style:italic;font-weight:400}#media-upload .ui-sortable .media-item{cursor:move}#media-upload tr.image-size{margin-bottom:1em;height:3em}#media-upload #filter{width:623px}#media-upload #filter .subsubsub{margin:8px 0}#media-upload .tablenav-pages .current,#media-upload .tablenav-pages a{display:inline-block;padding:4px 5px 6px;font-size:16px;line-height:1;text-align:center;text-decoration:none}#media-upload .tablenav-pages a{min-width:17px;border:1px solid #ccc;background:#f7f7f7}#filter .tablenav select{border-style:solid;border-width:1px;padding:2px;vertical-align:top;width:auto}#media-upload .del-attachment{display:none;margin:5px 0}.menu_order{float:right;font-size:11px;margin:8px 10px 0}.menu_order_input{border:1px solid #ddd;font-size:10px;padding:1px;width:23px}.ui-sortable-helper{background-color:#fff;border:1px solid #a0a5aa;opacity:.6;filter:alpha(opacity=60)}#media-upload th.order-head{width:20%;text-align:center}#media-upload th.actions-head{width:25%;text-align:center}#media-upload a.wp-post-thumbnail{margin:0 20px}#media-upload .widefat{border-style:solid solid none}.sorthelper{height:37px;width:623px;display:block}#gallery-settings th.label{width:160px}#gallery-settings #basic th.label{padding:5px 5px 5px 0}#gallery-settings .title{clear:both;padding:0 0 3px;font-size:1.6em;border-bottom:1px solid #ddd}h3.media-title{font-size:1.6em}h4.media-sub-title{border-bottom:1px solid #ddd;font-size:1.3em;margin:12px;padding:0 0 3px}#gallery-settings .title,h3.media-title,h4.media-sub-title{font-family:Georgia,"Times New Roman",Times,serif;font-weight:400;color:#5a5a5a}#gallery-settings .describe td{vertical-align:middle;height:3em}#gallery-settings .describe th.label{padding-top:.5em;text-align:left}#gallery-settings .describe{padding:5px;width:100%;clear:both;cursor:default;background:#fff}#gallery-settings .describe select{width:15em}#gallery-settings .describe select option,#gallery-settings .describe td{padding:0}#gallery-settings label,#gallery-settings legend{font-size:13px;color:#444;margin-right:15px}#gallery-settings .align .field label{margin:0 1em 0 3px}#gallery-settings p.ml-submit{border-top:1px solid #ddd}#gallery-settings select#columns{width:6em}#sort-buttons{font-size:.8em;margin:3px 25px -8px 0;text-align:right;max-width:625px}#sort-buttons a{text-decoration:none}#sort-buttons #asc,#sort-buttons #showall{padding-left:5px}#sort-buttons span{margin-right:25px}p.media-types{margin:0;padding:1em}p.media-types-required-info{padding-top:0}tr.not-image{display:none}table.not-image tr.not-image{display:table-row}table.not-image tr.image-only{display:none}@media print,(-webkit-min-device-pixel-ratio:1.25),(min-resolution:120dpi){.image-align-none-label{background-image:url(../images/align-none-2x.png?ver=20120916);background-size:21px 15px}.image-align-left-label{background-image:url(../images/align-left-2x.png?ver=20120916);background-size:22px 15px}.image-align-center-label{background-image:url(../images/align-center-2x.png?ver=20120916);background-size:21px 15px}.image-align-right-label{background-image:url(../images/align-right-2x.png?ver=20120916);background-size:22px 15px}} \ No newline at end of file
diff --git a/www/crm/wp-admin/css/edit-rtl.css b/www/crm/wp-admin/css/edit-rtl.css
new file mode 100644
index 00000000..3ffe87ea
--- /dev/null
+++ b/www/crm/wp-admin/css/edit-rtl.css
@@ -0,0 +1,1651 @@
+#poststuff {
+ padding-top: 10px;
+ min-width: 763px;
+}
+
+#poststuff #post-body {
+ padding: 0;
+}
+
+#poststuff .postbox-container {
+ width: 100%;
+}
+
+#poststuff #post-body.columns-2 {
+ margin-left: 300px;
+}
+
+/*------------------------------------------------------------------------------
+ 11.0 - Write/Edit Post Screen
+------------------------------------------------------------------------------*/
+
+#show-comments {
+ overflow: hidden;
+}
+
+#save-action .spinner,
+#show-comments a {
+ float: right;
+}
+
+#show-comments .spinner {
+ float: none;
+ margin-top: 0;
+}
+
+#lost-connection-notice .spinner {
+ visibility: visible;
+ float: right;
+ margin: 0 0 0 5px;
+}
+
+#titlediv {
+ position: relative;
+}
+
+#titlediv label {
+ cursor: text;
+}
+
+#titlediv div.inside {
+ margin: 0;
+}
+
+#poststuff #titlewrap {
+ border: 0;
+ padding: 0;
+}
+
+#titlediv #title {
+ padding: 3px 8px;
+ font-size: 1.7em;
+ line-height: 100%;
+ height: 1.7em;
+ width: 100%;
+ outline: none;
+ margin: 0 0 3px;
+ background-color: #fff;
+}
+
+#titlediv #title-prompt-text {
+ color: #72777c;
+ position: absolute;
+ font-size: 1.7em;
+ padding: 11px 10px;
+}
+
+input#link_description,
+input#link_url {
+ width: 98%;
+}
+
+#pending {
+ background: 100% none;
+ border: 0 none;
+ padding: 0;
+ font-size: 11px;
+ margin-top: -1px;
+}
+
+#edit-slug-box,
+#comment-link-box {
+ line-height: 24px;
+ min-height: 25px; /* Yes, line-height + 1 */
+ margin-top: 5px;
+ padding: 0 10px;
+ color: #666;
+}
+
+#edit-slug-box .cancel {
+ margin-left: 10px;
+ padding: 0;
+ font-size: 11px;
+}
+
+#comment-link-box {
+ margin: 5px 0;
+ padding: 0 5px;
+}
+
+#editable-post-name-full {
+ display: none;
+}
+
+#editable-post-name {
+ font-weight: 600;
+}
+
+#editable-post-name input {
+ font-size: 13px;
+ font-weight: 400;
+ height: 24px;
+ margin: 0;
+ width: 16em;
+}
+
+.postarea h3 label {
+ float: right;
+}
+
+body.post-new-php .submitbox .submitdelete {
+ display: none;
+}
+
+.submitbox .submit a:hover {
+ text-decoration: underline;
+}
+
+.submitbox .submit input {
+ margin-bottom: 8px;
+ margin-left: 4px;
+ padding: 6px;
+}
+
+#post-status-select {
+ margin-top: 3px;
+}
+
+/* Post Screen */
+#post-body #normal-sortables {
+ min-height: 50px;
+}
+
+.postbox {
+ position: relative;
+ min-width: 255px;
+ border: 1px solid #e5e5e5;
+ box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
+ background: #fff;
+}
+
+#trackback_url {
+ width: 99%;
+}
+
+#normal-sortables .postbox .submit {
+ background: transparent none;
+ border: 0 none;
+ float: left;
+ padding: 0 12px;
+ margin: 0;
+}
+
+.category-add input[type="text"],
+.category-add select {
+ width: 100%;
+ max-width: 260px;
+ vertical-align: baseline;
+}
+
+#side-sortables .category-add input[type="text"],
+#side-sortables .category-add select {
+ margin: 0 0 1em;
+}
+
+ul.category-tabs li,
+#side-sortables .add-menu-item-tabs li,
+.wp-tab-bar li {
+ display: inline;
+ line-height: 1.35em;
+}
+
+.no-js .category-tabs li.hide-if-no-js {
+ display: none;
+}
+
+.category-tabs a,
+#side-sortables .add-menu-item-tabs a,
+.wp-tab-bar a {
+ text-decoration: none;
+}
+
+/* @todo: do these really need to be so specific? */
+#side-sortables .category-tabs .tabs a,
+#side-sortables .add-menu-item-tabs .tabs a,
+.wp-tab-bar .wp-tab-active a,
+#post-body ul.category-tabs li.tabs a,
+#post-body ul.add-menu-item-tabs li.tabs a {
+ color: #32373c;
+}
+
+.category-tabs {
+ margin: 8px 0 5px;
+}
+
+/* Back-compat for pre-4.4 */
+#category-adder h4 {
+ margin: 0;
+}
+
+.taxonomy-add-new {
+ display: inline-block;
+ margin: 10px 0;
+ font-weight: 600;
+}
+
+#side-sortables .add-menu-item-tabs,
+.wp-tab-bar {
+ margin-bottom: 3px;
+}
+
+#normal-sortables .postbox #replyrow .submit {
+ float: none;
+ margin: 0;
+ padding: 5px 7px 10px;
+ overflow: hidden;
+}
+
+#side-sortables .submitbox .submit input,
+#side-sortables .submitbox .submit .preview,
+#side-sortables .submitbox .submit a.preview:hover {
+ border: 0 none;
+}
+
+/* @todo: make this a more generic class */
+ul.category-tabs,
+ul.add-menu-item-tabs,
+ul.wp-tab-bar {
+ margin-top: 12px;
+}
+
+ul.category-tabs li,
+ul.add-menu-item-tabs li {
+ border: solid 1px transparent;
+ position: relative;
+}
+
+ul.category-tabs li.tabs,
+ul.add-menu-item-tabs li.tabs,
+.wp-tab-active {
+ border: 1px solid #ddd;
+ border-bottom-color: #fdfdfd;
+ background-color: #fdfdfd;
+}
+
+ul.category-tabs li,
+ul.add-menu-item-tabs li,
+ul.wp-tab-bar li {
+ padding: 3px 5px 6px;
+}
+
+#set-post-thumbnail {
+ display: inline-block;
+ max-width: 100%;
+}
+
+#postimagediv .inside img {
+ max-width: 100%;
+ height: auto;
+ width: auto;
+ vertical-align: top;
+ background-image: linear-gradient(-45deg, #c4c4c4 25%, transparent 25%, transparent 75%, #c4c4c4 75%, #c4c4c4), linear-gradient(-45deg, #c4c4c4 25%, transparent 25%, transparent 75%, #c4c4c4 75%, #c4c4c4);
+ background-position: 100% 0, 10px 10px;
+ background-size: 20px 20px;
+}
+
+form#tags-filter {
+ position: relative;
+}
+
+/* Global classes */
+.wp-hidden-children .wp-hidden-child,
+.ui-tabs-hide {
+ display: none;
+}
+
+#post-body .tagsdiv #newtag {
+ margin-left: 5px;
+ width: 16em;
+}
+
+#side-sortables input#post_password {
+ width: 94%
+}
+
+#side-sortables .tagsdiv #newtag {
+ width: 68%;
+}
+
+#post-status-info {
+ width: 100%;
+ border-spacing: 0;
+ border: 1px solid #e5e5e5;
+ border-top: none;
+ background-color: #f7f7f7;
+ box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
+ z-index: 999;
+}
+
+#post-status-info td {
+ font-size: 12px;
+}
+
+.autosave-info {
+ padding: 2px 10px;
+ text-align: left;
+}
+
+#editorcontent #post-status-info {
+ border: none;
+}
+
+#content-resize-handle {
+ background: transparent url(../images/resize.gif) no-repeat scroll left bottom;
+ width: 12px;
+ cursor: row-resize;
+}
+
+/*rtl:ignore*/
+.rtl #content-resize-handle {
+ background-image: url(../images/resize-rtl.gif);
+ background-position: left bottom;
+}
+
+.wp-editor-expand #content-resize-handle {
+ display: none;
+}
+
+#postdivrich #content {
+ resize: none;
+}
+
+#wp-word-count {
+ display: block;
+ padding: 2px 10px;
+}
+
+#wp-content-editor-container {
+ position: relative;
+}
+
+.wp-editor-expand #wp-content-editor-tools {
+ z-index: 1000;
+ border-bottom: 1px solid #e5e5e5;
+}
+
+.wp-editor-expand #wp-content-editor-container {
+ box-shadow: none;
+ margin-top: -1px;
+}
+
+.wp-editor-expand #wp-content-editor-container {
+ border-bottom: 0 none;
+}
+
+.wp-editor-expand div.mce-statusbar {
+ z-index: 1;
+}
+
+.wp-editor-expand #post-status-info {
+ border-top: 1px solid #e5e5e5;
+}
+
+.wp-editor-expand div.mce-toolbar-grp {
+ z-index: 999;
+}
+
+/* TinyMCE native fullscreen mode override */
+.mce-fullscreen #wp-content-wrap .mce-menubar,
+.mce-fullscreen #wp-content-wrap .mce-toolbar-grp,
+.mce-fullscreen #wp-content-wrap .mce-edit-area,
+.mce-fullscreen #wp-content-wrap .mce-statusbar {
+ position: static !important;
+ width: auto !important;
+ padding: 0 !important;
+}
+
+.mce-fullscreen #wp-content-wrap .mce-statusbar {
+ visibility: visible !important;
+}
+
+.mce-fullscreen #wp-content-wrap .mce-tinymce .mce-wp-dfw {
+ display: none;
+}
+
+.post-php.mce-fullscreen #wpadminbar,
+.mce-fullscreen #wp-content-wrap .mce-wp-dfw {
+ display: none;
+}
+/* End TinyMCE native fullscreen mode override */
+
+#wp-content-editor-tools {
+ background-color: #f1f1f1;
+ padding-top: 20px;
+}
+
+#poststuff #post-body.columns-2 #side-sortables {
+ width: 280px;
+}
+
+#timestampdiv select {
+ height: 21px;
+ line-height: 14px;
+ padding: 0;
+ vertical-align: top;
+ font-size: 12px;
+}
+
+#aa, #jj, #hh, #mn {
+ padding: 1px;
+ font-size: 12px;
+}
+
+#jj, #hh, #mn {
+ width: 2em;
+}
+
+#aa {
+ width: 3.4em;
+}
+
+.curtime #timestamp {
+ padding: 2px 0 1px 0;
+ display: inline !important;
+ height: auto !important;
+}
+
+#post-body .misc-pub-post-status:before,
+#post-body #visibility:before,
+.curtime #timestamp:before,
+#post-body .misc-pub-revisions:before,
+span.wp-media-buttons-icon:before {
+ color: #82878c;
+}
+
+#post-body .misc-pub-post-status:before,
+#post-body #visibility:before,
+.curtime #timestamp:before,
+#post-body .misc-pub-revisions:before {
+ font: normal 20px/1 dashicons;
+ speak: none;
+ display: inline-block;
+ margin-right: -1px;
+ padding-left: 3px;
+ vertical-align: top;
+ -webkit-font-smoothing: antialiased;
+ -moz-osx-font-smoothing: grayscale;
+}
+
+#post-body .misc-pub-post-status:before {
+ content: "\f173";
+}
+
+#post-body #visibility:before {
+ content: "\f177";
+}
+
+.curtime #timestamp:before {
+ content: "\f145";
+ position: relative;
+ top: -1px;
+}
+
+#post-body .misc-pub-revisions:before {
+ content: "\f321";
+}
+
+#timestampdiv {
+ padding-top: 5px;
+ line-height: 23px;
+}
+
+#timestampdiv p {
+ margin: 8px 0 6px;
+}
+
+#timestampdiv input {
+ border-width: 1px;
+ border-style: solid;
+ text-align: center;
+}
+
+.notification-dialog {
+ position: fixed;
+ top: 30%;
+ max-height: 70%;
+ right: 50%;
+ width: 450px;
+ margin-right: -225px;
+ background: #fff;
+ box-shadow: 0 3px 6px rgba(0, 0, 0, 0.3);
+ line-height: 1.5;
+ z-index: 1000005;
+ overflow-y: auto;
+}
+
+.notification-dialog-background {
+ position: fixed;
+ top: 0;
+ right: 0;
+ left: 0;
+ bottom: 0;
+ background: #000;
+ opacity: 0.7;
+ filter: alpha(opacity=70);
+ z-index: 1000000;
+}
+
+#post-lock-dialog .post-locked-message,
+#post-lock-dialog .post-taken-over {
+ margin: 25px;
+}
+
+#post-lock-dialog .post-locked-message a.button,
+#file-editor-warning .button {
+ margin-left: 10px;
+}
+
+#post-lock-dialog .post-locked-avatar {
+ float: right;
+ margin: 0 0 20px 20px;
+}
+
+#post-lock-dialog .wp-tab-first {
+ outline: 0;
+}
+
+#post-lock-dialog .locked-saving img {
+ float: right;
+ margin-left: 3px;
+}
+
+#post-lock-dialog.saving .locked-saving,
+#post-lock-dialog.saved .locked-saved {
+ display: inline;
+}
+
+#excerpt {
+ display: block;
+ margin: 12px 0 0;
+ height: 4em;
+ width: 100%;
+}
+
+.tagchecklist {
+ margin-right: 14px;
+ font-size: 12px;
+ overflow: auto;
+}
+
+.tagchecklist br {
+ display: none;
+}
+
+.tagchecklist strong {
+ margin-right: -8px;
+ position: absolute;
+}
+
+.tagchecklist > li {
+ float: right;
+ margin-left: 25px;
+ font-size: 13px;
+ line-height: 1.8em;
+ cursor: default;
+ max-width: 100%;
+ overflow: hidden;
+ text-overflow: ellipsis;
+}
+
+.tagchecklist .ntdelbutton {
+ position: absolute;
+ width: 24px;
+ height: 24px;
+ border: none;
+ margin: 0 -19px 0 0;
+ padding: 0;
+ background: none;
+ cursor: pointer;
+ text-indent: 0;
+}
+
+#poststuff h3.hndle, /* Back-compat for pre-4.4 */
+#poststuff .stuffbox > h3, /* Back-compat for pre-4.4 */
+#poststuff h2 {
+ font-size: 14px;
+ padding: 8px 12px;
+ margin: 0;
+ line-height: 1.4;
+}
+
+#poststuff .stuffbox h2 {
+ padding: 8px 10px;
+}
+
+#poststuff .inside {
+ margin: 6px 0 0 0;
+}
+
+#poststuff .stuffbox .inside {
+ margin: 0;
+}
+
+#poststuff .inside #parent_id,
+#poststuff .inside #page_template {
+ max-width: 100%;
+}
+
+.ie8 #poststuff .inside #parent_id,
+.ie8 #poststuff .inside #page_template {
+ width: 250px;
+}
+
+.post-attributes-label-wrapper {
+ margin-bottom: 0.5em;
+}
+
+.post-attributes-label {
+ vertical-align: baseline;
+ font-weight: 600;
+}
+
+#post-visibility-select {
+ line-height: 1.5em;
+ margin-top: 3px;
+}
+
+#linksubmitdiv .inside, /* Old Link Manager back-compat. */
+#poststuff #submitdiv .inside {
+ margin: 0;
+ padding: 0;
+}
+
+#post-body-content,
+.edit-form-section {
+ margin-bottom: 20px;
+}
+
+/* Suggested text for privacy policy */
+.wp-privacy-policy-guide {
+ max-width: 1000px;
+}
+
+.privacy-text-box {
+ width: calc(100% - 260px);
+}
+
+.privacy-text-box-toc {
+ float: left;
+ width: 250px;
+ background-color: #fff;
+}
+
+.privacy-text-box-toc p {
+ margin: 0;
+ padding: 0.7em 1em;
+ border-bottom: 1px solid #eee;
+}
+
+.privacy-text-box-toc ol {
+ margin-right: 2em;
+}
+
+.wp-privacy-policy-guide h3 {
+ font-size: 1.2em;
+ margin: 1em 0 0.5em;
+}
+
+.privacy-text-section .privacy-text-copy {
+ float: left;
+}
+
+.privacy-text-section {
+ position: relative;
+ border-top: 1px solid #e3e3e3;
+}
+
+.privacy-text-box-head,
+.privacy-text-section.text-removed {
+ padding-bottom: 12px;
+}
+
+.text-removed .policy-text {
+ font-style: italic;
+ color: #666;
+ font-weight: 600;
+}
+
+.privacy-text-actions {
+ height: 32px;
+ line-height: 32px;
+ padding-bottom: 6px;
+}
+
+.wp-privacy-policy-guide .policy-text h2 {
+ margin: 1.2em 0 1em;
+ padding: 0;
+}
+
+.suggested-policy-content {
+ font-style: italic;
+}
+
+.privacy-text-section a.return-to-top {
+ float: left;
+ margin-left: -250px;
+ margin-top: 6px;
+}
+
+.hide-privacy-policy-tutorial .privacy-policy-tutorial {
+ visibility: hidden;
+}
+
+.wp-suggested-text p {
+ font-style: italic;
+}
+
+.wp-suggested-text p.privacy-policy-tutorial {
+ font-style: normal;
+}
+
+.notice.wp-pp-notice {
+ margin: 15px 0 3px;
+}
+
+/*------------------------------------------------------------------------------
+ 11.1 - Custom Fields
+------------------------------------------------------------------------------*/
+
+#postcustomstuff thead th {
+ padding: 5px 8px 8px;
+ background-color: #f1f1f1;
+}
+
+#postcustom #postcustomstuff .submit {
+ border: 0 none;
+ float: none;
+ padding: 0 8px 8px;
+}
+
+#side-sortables #postcustom #postcustomstuff .submit {
+ margin: 0;
+ padding: 0;
+}
+
+#side-sortables #postcustom #postcustomstuff #the-list textarea {
+ height: 85px;
+}
+
+#side-sortables #postcustom #postcustomstuff td.left input,
+#side-sortables #postcustom #postcustomstuff td.left select,
+#side-sortables #postcustomstuff #newmetaleft a {
+ margin: 3px 3px 0;
+}
+
+#postcustomstuff table {
+ margin: 0;
+ width: 100%;
+ border: 1px solid #ddd;
+ border-spacing: 0;
+ background-color: #f9f9f9;
+}
+
+#postcustomstuff tr {
+ vertical-align: top;
+}
+
+#postcustomstuff table input,
+#postcustomstuff table select,
+#postcustomstuff table textarea {
+ width: 96%;
+ margin: 8px;
+}
+
+#side-sortables #postcustomstuff table input,
+#side-sortables #postcustomstuff table select,
+#side-sortables #postcustomstuff table textarea {
+ margin: 3px;
+}
+
+#postcustomstuff th.left,
+#postcustomstuff td.left {
+ width: 38%;
+}
+
+#postcustomstuff .submit input {
+ margin: 0;
+ width: auto;
+}
+
+#postcustomstuff #newmetaleft a {
+ display: inline-block;
+ margin: 0 8px 8px;
+ text-decoration: none;
+}
+
+.no-js #postcustomstuff #enternew {
+ display: none;
+}
+
+#post-body-content .compat-attachment-fields {
+ margin-bottom: 20px;
+}
+
+.compat-attachment-fields th {
+ padding-top: 5px;
+ padding-left: 10px;
+}
+
+/*------------------------------------------------------------------------------
+ 11.3 - Featured Images
+------------------------------------------------------------------------------*/
+
+#select-featured-image {
+ padding: 4px 0;
+ overflow: hidden;
+}
+
+#select-featured-image img {
+ max-width: 100%;
+ height: auto;
+ margin-bottom: 10px;
+}
+
+#select-featured-image a {
+ float: right;
+ clear: both;
+}
+
+#select-featured-image .remove {
+ display: none;
+ margin-top: 10px;
+}
+
+.js #select-featured-image.has-featured-image .remove {
+ display: inline-block;
+}
+
+.no-js #select-featured-image .choose {
+ display: none;
+}
+
+/*------------------------------------------------------------------------------
+ 11.4 - Post formats
+------------------------------------------------------------------------------*/
+
+.post-format-icon::before {
+ display: inline-block;
+ vertical-align: middle;
+ height: 20px;
+ width: 20px;
+ margin-top: -4px;
+ margin-left: 7px;
+ color: #ddd;
+ font: normal 20px/1 dashicons;
+ speak: none;
+ -webkit-font-smoothing: antialiased;
+ -moz-osx-font-smoothing: grayscale;
+}
+
+a.post-format-icon:hover:before {
+ color: #00a0d2;
+}
+
+#post-formats-select {
+ line-height: 2em;
+}
+
+#post-formats-select .post-format-icon::before {
+ top: 5px;
+}
+
+input.post-format {
+ margin-top: 1px;
+}
+
+label.post-format-icon {
+ margin-right: 0;
+ padding: 2px 0;
+}
+
+.post-format-icon.post-format-standard::before {
+ content: "\f109";
+}
+
+.post-format-icon.post-format-image::before {
+ content: "\f128";
+}
+
+.post-format-icon.post-format-gallery::before {
+ content: "\f161";
+}
+
+.post-format-icon.post-format-audio::before {
+ content: "\f127";
+}
+
+.post-format-icon.post-format-video::before {
+ content: "\f126";
+}
+
+.post-format-icon.post-format-chat::before {
+ content: "\f125";
+}
+
+.post-format-icon.post-format-status::before {
+ content: "\f130";
+}
+
+.post-format-icon.post-format-aside::before {
+ content: "\f123";
+}
+
+.post-format-icon.post-format-quote::before {
+ content: "\f122";
+}
+
+.post-format-icon.post-format-link::before {
+ content: "\f103";
+}
+
+/*------------------------------------------------------------------------------
+ 12.0 - Categories
+------------------------------------------------------------------------------*/
+
+.category-adder {
+ margin-right: 120px;
+ padding: 4px 0;
+}
+
+.category-adder h4 {
+ margin: 0 0 8px;
+}
+
+#side-sortables .category-adder {
+ margin: 0;
+}
+
+.wp-tab-panel,
+.categorydiv div.tabs-panel,
+.customlinkdiv div.tabs-panel,
+.posttypediv div.tabs-panel,
+.taxonomydiv div.tabs-panel {
+ min-height: 42px;
+ max-height: 200px;
+ overflow: auto;
+ padding: 0 0.9em;
+ border: solid 1px #ddd;
+ background-color: #fdfdfd;
+}
+
+div.tabs-panel-active {
+ display: block;
+}
+
+div.tabs-panel-inactive {
+ display: none;
+}
+
+#front-page-warning,
+#front-static-pages ul,
+ul.export-filters,
+.inline-editor ul.cat-checklist ul,
+.categorydiv ul.categorychecklist ul,
+.customlinkdiv ul.categorychecklist ul,
+.posttypediv ul.categorychecklist ul,
+.taxonomydiv ul.categorychecklist ul {
+ margin-right: 18px;
+}
+
+ul.categorychecklist li {
+ margin: 0;
+ padding: 0;
+ line-height: 22px;
+ word-wrap: break-word;
+}
+
+.categorydiv .tabs-panel,
+.customlinkdiv .tabs-panel,
+.posttypediv .tabs-panel,
+.taxonomydiv .tabs-panel {
+ border-width: 3px;
+ border-style: solid;
+}
+
+.form-wrap label {
+ display: block;
+ padding: 2px 0;
+}
+
+.form-field input[type="text"],
+.form-field input[type="password"],
+.form-field input[type="email"],
+.form-field input[type="number"],
+.form-field input[type="search"],
+.form-field input[type="tel"],
+.form-field input[type="url"],
+.form-field textarea {
+ border-style: solid;
+ border-width: 1px;
+ width: 95%;
+}
+
+p.description,
+.form-wrap p {
+ margin: 2px 0 5px;
+ color: #666;
+}
+
+p.help,
+p.description,
+span.description,
+.form-wrap p {
+ font-size: 13px;
+ font-style: italic;
+}
+
+.form-wrap .form-field {
+ margin: 1em 0;
+ padding: 0;
+}
+
+.form-wrap .form-field #parent {
+ max-width: 100%;
+}
+
+.col-wrap h2 {
+ margin: 12px 0;
+ font-size: 1.1em;
+}
+
+.col-wrap p.submit {
+ margin-top: -10px;
+}
+
+.edit-term-notes {
+ margin-top: 2em;
+}
+
+/*------------------------------------------------------------------------------
+ 13.0 - Tags
+------------------------------------------------------------------------------*/
+
+#poststuff .tagsdiv .ajaxtag {
+ margin-top: 1em;
+}
+
+#poststuff .tagsdiv .howto {
+ margin: 1em 0 6px 0;
+}
+
+.ajaxtag .newtag {
+ position: relative;
+}
+
+.tagsdiv .newtag {
+ width: 180px;
+}
+
+.tagsdiv .the-tags {
+ display: block;
+ height: 60px;
+ margin: 0 auto;
+ overflow: auto;
+ width: 260px;
+}
+
+#post-body-content .tagsdiv .the-tags {
+ margin: 0 5px;
+}
+
+p.popular-tags {
+ border: none;
+ line-height: 2em;
+ padding: 8px 12px 12px;
+ text-align: justify;
+}
+
+p.popular-tags a {
+ padding: 0 3px;
+}
+
+.tagcloud {
+ width: 97%;
+ margin: 0 0 40px;
+ text-align: justify;
+}
+
+.tagcloud h2 {
+ margin: 2px 0 12px;
+}
+
+.the-tagcloud ul {
+ margin: 0;
+}
+
+.the-tagcloud ul li {
+ display: inline-block;
+}
+
+/* Suggest.js autocomplete, no more used by core. */
+.ac_results {
+ display: none;
+ margin: -1px 0 0;
+ padding: 0;
+ list-style: none;
+ position: absolute;
+ z-index: 10000;
+ border: 1px solid #5b9dd9;
+ background-color: #fff;
+}
+
+.wp-customizer .ac_results {
+ z-index: 500000;
+}
+
+.ac_results li {
+ margin: 0;
+ padding: 5px 10px;
+ white-space: nowrap;
+ text-align: right;
+}
+
+.ac_results .ac_over,
+.ac_over .ac_match {
+ background-color: #0073aa;
+ color: #fff;
+ cursor: pointer;
+}
+
+.ac_match {
+ text-decoration: underline;
+}
+
+#edittag {
+ max-width: 800px;
+}
+
+.edit-tag-actions {
+ margin-top: 20px;
+}
+
+/* Comments */
+
+.comment-php .wp-editor-area {
+ height: 200px;
+}
+
+.comment-ays th,
+.comment-ays td {
+ padding: 10px 15px;
+}
+
+.comment-ays .comment-content ul {
+ list-style: initial;
+ margin-right: 2em;
+}
+
+.comment-ays .comment-content a[href]:after {
+ content: "(" attr( href ) ")";
+ display: inline-block;
+ padding: 0 4px;
+ color: #72777C;
+ font-size: 13px;
+ word-break: break-all;
+}
+
+.comment-ays .comment-content p.edit-comment {
+ margin-top: 10px;
+}
+
+.comment-ays .comment-content p.edit-comment a[href]:after {
+ content: "";
+ padding: 0;
+}
+
+.comment-ays-submit .button-cancel {
+ margin-right: 1em;
+}
+
+.trash-undo-inside,
+.spam-undo-inside {
+ margin: 1px 0 1px 8px;
+ line-height: 16px;
+}
+
+.spam-undo-inside .avatar,
+.trash-undo-inside .avatar {
+ height: 20px;
+ width: 20px;
+ margin-left: 8px;
+ vertical-align: middle;
+}
+
+.stuffbox .editcomment {
+ clear: none;
+ margin-top: 0;
+}
+
+#namediv.stuffbox .editcomment input {
+ width: 100%;
+}
+
+#namediv.stuffbox .editcomment.form-table td {
+ padding: 10px;
+}
+
+#comment-status-radio p {
+ margin: 3px 0 5px;
+}
+
+#comment-status-radio input {
+ margin: 2px 0 5px 3px;
+ vertical-align: middle;
+}
+
+#comment-status-radio label {
+ padding: 5px 0;
+}
+
+/* links tables */
+table.links-table {
+ width: 100%;
+ border-spacing: 0;
+}
+
+.links-table th {
+ font-weight: 400;
+ text-align: right;
+ vertical-align: top;
+ min-width: 80px;
+ width: 20%;
+ word-wrap: break-word;
+}
+
+.links-table th,
+.links-table td {
+ padding: 5px 0;
+}
+
+.links-table td label {
+ margin-left: 8px;
+}
+
+.links-table td input[type="text"],
+.links-table td textarea {
+ width: 100%;
+}
+
+.links-table #link_rel {
+ max-width: 280px;
+}
+
+/* DFW 2
+-------------------------------------------------------------- */
+
+#qt_content_dfw {
+ display: none;
+}
+
+.wp-editor-expand #qt_content_dfw {
+ display: inline-block;
+}
+
+.focus-on .wrap > h1,
+.focus-on .page-title-action,
+.focus-on #wpfooter,
+.focus-on .postbox-container > *,
+.focus-on div.updated,
+.focus-on div.error,
+.focus-on div.notice,
+.focus-on .update-nag,
+.focus-on #wp-toolbar,
+.focus-on #screen-meta-links,
+.focus-on #screen-meta {
+ opacity: 0;
+ transition-duration: 0.6s;
+ transition-property: opacity;
+ transition-timing-function: ease-in-out;
+}
+
+.focus-on #wp-toolbar {
+ opacity: 0.3;
+}
+
+.focus-off .wrap > h1,
+.focus-off .page-title-action,
+.focus-off #wpfooter,
+.focus-off .postbox-container > *,
+.focus-off div.updated,
+.focus-off div.error,
+.focus-off div.notice,
+.focus-off .update-nag,
+.focus-off #wp-toolbar,
+.focus-off #screen-meta-links,
+.focus-off #screen-meta {
+ opacity: 1;
+ transition-duration: 0.2s;
+ transition-property: opacity;
+ transition-timing-function: ease-in-out;
+}
+
+.focus-off #wp-toolbar {
+ -webkit-transform: translate(0, 0);
+}
+
+.focus-on #adminmenuback,
+.focus-on #adminmenuwrap {
+ transition-duration: 0.6s;
+ transition-property: transform;
+ transition-timing-function: ease-in-out;
+}
+
+.focus-on #adminmenuback,
+.focus-on #adminmenuwrap {
+ transform: translateX( 100% );
+}
+
+.focus-off #adminmenuback,
+.focus-off #adminmenuwrap {
+ transform: translateX( 0 );
+ transition-duration: 0.2s;
+ transition-property: transform;
+ transition-timing-function: ease-in-out;
+}
+
+/* =Media Queries
+-------------------------------------------------------------- */
+
+/**
+ * HiDPI Displays
+ */
+@media print,
+ (-webkit-min-device-pixel-ratio: 1.25),
+ (min-resolution: 120dpi) {
+ #content-resize-handle,
+ #post-body .wp_themeSkin .mceStatusbar a.mceResize {
+ background: transparent url(../images/resize-2x.gif) no-repeat scroll left bottom;
+ background-size: 11px 11px;
+ }
+
+ /*rtl:ignore*/
+ .rtl #content-resize-handle,
+ .rtl #post-body .wp_themeSkin .mceStatusbar a.mceResize {
+ background-image: url(../images/resize-rtl-2x.gif);
+ background-position: left bottom;
+ }
+}
+
+/* one column on the post write/edit screen */
+@media only screen and (max-width: 850px) {
+ #poststuff {
+ min-width: 0;
+ }
+
+ #wpbody-content #poststuff #post-body {
+ margin: 0;
+ }
+
+ #wpbody-content #post-body.columns-2 #postbox-container-1 {
+ margin-left: 0;
+ width: 100%;
+ }
+
+ #poststuff #postbox-container-1 .empty-container,
+ #poststuff #postbox-container-1 #side-sortables:empty {
+ border: 0 none;
+ height: 0;
+ min-height: 0;
+ }
+
+ #poststuff #post-body.columns-2 #side-sortables {
+ min-height: 0;
+ width: auto;
+ }
+
+ /* hide the radio buttons for column prefs */
+ .screen-layout,
+ .columns-prefs {
+ display: none;
+ }
+}
+
+@media screen and (max-width: 782px) {
+ .wp-core-ui .edit-tag-actions .button-primary {
+ margin-bottom: 0;
+ }
+
+ #post-body-content {
+ min-width: 0;
+ }
+
+ #titlediv #title-prompt-text {
+ padding: 10px 10px;
+ }
+
+ #poststuff .stuffbox .inside {
+ padding: 0 0 4px 2px;
+ }
+
+ #poststuff h3.hndle, /* Back-compat for pre-4.4 */
+ #poststuff .stuffbox > h3, /* Back-compat for pre-4.4 */
+ #poststuff h2 {
+ padding: 12px;
+ }
+
+ #namediv.stuffbox .editcomment.form-table td {
+ padding: 5px 10px;
+ }
+
+ .post-format-options {
+ padding-left: 0;
+ }
+
+ .post-format-options a {
+ margin-left: 5px;
+ margin-bottom: 5px;
+ min-width: 52px;
+ }
+
+ .post-format-options .post-format-title {
+ font-size: 11px;
+ }
+
+ .post-format-options a div {
+ height: 28px;
+ width: 28px;
+ }
+
+ .post-format-options a div:before {
+ font-size: 26px !important;
+ }
+
+ /* Publish Metabox Options */
+ #post-visibility-select {
+ line-height: 280%;
+ }
+
+ .wp-core-ui .save-post-visibility,
+ .wp-core-ui .save-timestamp {
+ vertical-align: middle;
+ margin-left: 15px;
+ }
+
+ .timestamp-wrap select#mm {
+ display: block;
+ width: 100%;
+ margin-bottom: 10px;
+ }
+
+ .timestamp-wrap #jj,
+ .timestamp-wrap #aa,
+ .timestamp-wrap #hh,
+ .timestamp-wrap #mn {
+ padding: 12px 3px;
+ font-size: 14px;
+ margin-bottom: 5px;
+ width: auto;
+ text-align: center;
+ }
+
+ /* Categories Metabox */
+ ul.category-tabs {
+ margin: 30px 0 15px;
+ }
+
+ ul.category-tabs li.tabs {
+ padding: 15px;
+ }
+
+ ul.categorychecklist li {
+ margin-bottom: 15px;
+ }
+
+ ul.categorychecklist ul {
+ margin-top: 15px;
+ }
+
+ .category-add input[type=text],
+ .category-add select {
+ max-width: none;
+ margin-bottom: 15px;
+ }
+
+ /* Tags Metabox */
+ .tagsdiv .newtag {
+ width: 100%;
+ height: auto;
+ margin-bottom: 15px;
+ }
+
+ .tagchecklist {
+ margin: 25px 10px;
+ }
+
+ .tagchecklist > li {
+ font-size: 16px;
+ line-height: 1.4;
+ }
+
+ /* Discussion */
+ #commentstatusdiv p {
+ line-height: 2.8;
+ }
+
+ /* TinyMCE Adjustments */
+ .mceToolbar * {
+ white-space: normal !important;
+ }
+
+ .mceToolbar tr,
+ .mceToolbar td {
+ float: right !important;
+ }
+
+ .wp_themeSkin a.mceButton {
+ width: 30px;
+ height: 30px;
+ }
+
+ .wp_themeSkin .mceButton .mceIcon {
+ margin-top: 5px;
+ margin-right: 5px;
+ }
+
+ .wp_themeSkin .mceSplitButton {
+ margin-top: 1px;
+ }
+
+ .wp_themeSkin .mceSplitButton td a.mceAction {
+ padding-top: 6px;
+ padding-bottom: 6px;
+ padding-right: 6px;
+ padding-left: 3px;
+ }
+
+ .wp_themeSkin .mceSplitButton td a.mceOpen,
+ .wp_themeSkin .mceSplitButtonEnabled:hover td a.mceOpen {
+ padding-top: 6px;
+ padding-bottom: 6px;
+ background-position: 1px 6px;
+ }
+
+ .wp_themeSkin table.mceListBox {
+ margin: 5px;
+ }
+
+ div.quicktags-toolbar input {
+ padding: 10px 20px;
+ }
+
+ button.wp-switch-editor {
+ font-size: 16px;
+ line-height: 1em;
+ margin: 7px 7px 0 0;
+ padding: 8px 12px;
+ }
+
+ #wp-content-media-buttons a {
+ font-size: 14px;
+ padding: 6px 10px;
+ }
+
+ .wp-media-buttons span.wp-media-buttons-icon,
+ .wp-media-buttons span.jetpack-contact-form-icon {
+ width: 22px !important;
+ margin-right: -2px !important;
+ }
+
+ .wp-media-buttons .add_media span.wp-media-buttons-icon:before,
+ .wp-media-buttons #insert-jetpack-contact-form span.jetpack-contact-form-icon:before {
+ font-size: 20px !important;
+ }
+
+ #content_wp_fullscreen {
+ display: none;
+ }
+
+ .misc-pub-section {
+ padding: 20px 10px 20px;
+ }
+
+ .misc-pub-section > a {
+ float: left;
+ font-size: 16px;
+ }
+
+ #delete-action,
+ #publishing-action {
+ line-height: 47px;
+ }
+
+ #publishing-action .spinner {
+ float: none;
+ margin-top: -2px; /* Half of the Publish button's bottom margin. */
+ }
+
+ /* Moderate Comment */
+ .comment-ays th,
+ .comment-ays td {
+ padding-bottom: 0;
+ }
+
+ .comment-ays td {
+ padding-top: 6px;
+ }
+
+ /* Links */
+ .links-table #link_rel {
+ max-width: none;
+ }
+
+ .links-table th,
+ .links-table td {
+ padding: 10px 0;
+ }
+
+ .privacy-text-box {
+ width: auto;
+ }
+
+ .privacy-text-box-toc {
+ float: none;
+ width: auto;
+ height: 100%;
+ }
+
+ .privacy-text-section a.return-to-top {
+ float: none;
+ margin: 0;
+ }
+}
diff --git a/www/crm/wp-admin/css/edit-rtl.min.css b/www/crm/wp-admin/css/edit-rtl.min.css
new file mode 100644
index 00000000..e033c1aa
--- /dev/null
+++ b/www/crm/wp-admin/css/edit-rtl.min.css
@@ -0,0 +1,2 @@
+/*! This file is auto-generated */
+#poststuff{padding-top:10px;min-width:763px}#poststuff #post-body{padding:0}#poststuff .postbox-container{width:100%}#poststuff #post-body.columns-2{margin-left:300px}#show-comments{overflow:hidden}#save-action .spinner,#show-comments a{float:right}#show-comments .spinner{float:none;margin-top:0}#lost-connection-notice .spinner{visibility:visible;float:right;margin:0 0 0 5px}#titlediv{position:relative}#titlediv label{cursor:text}#titlediv div.inside{margin:0}#poststuff #titlewrap{border:0;padding:0}#titlediv #title{padding:3px 8px;font-size:1.7em;line-height:100%;height:1.7em;width:100%;outline:0;margin:0 0 3px;background-color:#fff}#titlediv #title-prompt-text{color:#72777c;position:absolute;font-size:1.7em;padding:11px 10px}input#link_description,input#link_url{width:98%}#pending{background:100% none;border:0 none;padding:0;font-size:11px;margin-top:-1px}#comment-link-box,#edit-slug-box{line-height:24px;min-height:25px;margin-top:5px;padding:0 10px;color:#666}#edit-slug-box .cancel{margin-left:10px;padding:0;font-size:11px}#comment-link-box{margin:5px 0;padding:0 5px}#editable-post-name-full{display:none}#editable-post-name{font-weight:600}#editable-post-name input{font-size:13px;font-weight:400;height:24px;margin:0;width:16em}.postarea h3 label{float:right}body.post-new-php .submitbox .submitdelete{display:none}.submitbox .submit a:hover{text-decoration:underline}.submitbox .submit input{margin-bottom:8px;margin-left:4px;padding:6px}#post-status-select{margin-top:3px}#post-body #normal-sortables{min-height:50px}.postbox{position:relative;min-width:255px;border:1px solid #e5e5e5;box-shadow:0 1px 1px rgba(0,0,0,.04);background:#fff}#trackback_url{width:99%}#normal-sortables .postbox .submit{background:transparent none;border:0 none;float:left;padding:0 12px;margin:0}.category-add input[type=text],.category-add select{width:100%;max-width:260px;vertical-align:baseline}#side-sortables .category-add input[type=text],#side-sortables .category-add select{margin:0 0 1em}#side-sortables .add-menu-item-tabs li,.wp-tab-bar li,ul.category-tabs li{display:inline;line-height:1.35em}.no-js .category-tabs li.hide-if-no-js{display:none}#side-sortables .add-menu-item-tabs a,.category-tabs a,.wp-tab-bar a{text-decoration:none}#post-body ul.add-menu-item-tabs li.tabs a,#post-body ul.category-tabs li.tabs a,#side-sortables .add-menu-item-tabs .tabs a,#side-sortables .category-tabs .tabs a,.wp-tab-bar .wp-tab-active a{color:#32373c}.category-tabs{margin:8px 0 5px}#category-adder h4{margin:0}.taxonomy-add-new{display:inline-block;margin:10px 0;font-weight:600}#side-sortables .add-menu-item-tabs,.wp-tab-bar{margin-bottom:3px}#normal-sortables .postbox #replyrow .submit{float:none;margin:0;padding:5px 7px 10px;overflow:hidden}#side-sortables .submitbox .submit .preview,#side-sortables .submitbox .submit a.preview:hover,#side-sortables .submitbox .submit input{border:0 none}ul.add-menu-item-tabs,ul.category-tabs,ul.wp-tab-bar{margin-top:12px}ul.add-menu-item-tabs li,ul.category-tabs li{border:solid 1px transparent;position:relative}.wp-tab-active,ul.add-menu-item-tabs li.tabs,ul.category-tabs li.tabs{border:1px solid #ddd;border-bottom-color:#fdfdfd;background-color:#fdfdfd}ul.add-menu-item-tabs li,ul.category-tabs li,ul.wp-tab-bar li{padding:3px 5px 6px}#set-post-thumbnail{display:inline-block;max-width:100%}#postimagediv .inside img{max-width:100%;height:auto;width:auto;vertical-align:top;background-image:linear-gradient(-45deg,#c4c4c4 25%,transparent 25%,transparent 75%,#c4c4c4 75%,#c4c4c4),linear-gradient(-45deg,#c4c4c4 25%,transparent 25%,transparent 75%,#c4c4c4 75%,#c4c4c4);background-position:100% 0,10px 10px;background-size:20px 20px}form#tags-filter{position:relative}.ui-tabs-hide,.wp-hidden-children .wp-hidden-child{display:none}#post-body .tagsdiv #newtag{margin-left:5px;width:16em}#side-sortables input#post_password{width:94%}#side-sortables .tagsdiv #newtag{width:68%}#post-status-info{width:100%;border-spacing:0;border:1px solid #e5e5e5;border-top:none;background-color:#f7f7f7;box-shadow:0 1px 1px rgba(0,0,0,.04);z-index:999}#post-status-info td{font-size:12px}.autosave-info{padding:2px 10px;text-align:left}#editorcontent #post-status-info{border:none}#content-resize-handle{background:transparent url(../images/resize.gif) no-repeat scroll left bottom;width:12px;cursor:row-resize}.rtl #content-resize-handle{background-image:url(../images/resize-rtl.gif);background-position:left bottom}.wp-editor-expand #content-resize-handle{display:none}#postdivrich #content{resize:none}#wp-word-count{display:block;padding:2px 10px}#wp-content-editor-container{position:relative}.wp-editor-expand #wp-content-editor-tools{z-index:1000;border-bottom:1px solid #e5e5e5}.wp-editor-expand #wp-content-editor-container{box-shadow:none;margin-top:-1px}.wp-editor-expand #wp-content-editor-container{border-bottom:0 none}.wp-editor-expand div.mce-statusbar{z-index:1}.wp-editor-expand #post-status-info{border-top:1px solid #e5e5e5}.wp-editor-expand div.mce-toolbar-grp{z-index:999}.mce-fullscreen #wp-content-wrap .mce-edit-area,.mce-fullscreen #wp-content-wrap .mce-menubar,.mce-fullscreen #wp-content-wrap .mce-statusbar,.mce-fullscreen #wp-content-wrap .mce-toolbar-grp{position:static!important;width:auto!important;padding:0!important}.mce-fullscreen #wp-content-wrap .mce-statusbar{visibility:visible!important}.mce-fullscreen #wp-content-wrap .mce-tinymce .mce-wp-dfw{display:none}.mce-fullscreen #wp-content-wrap .mce-wp-dfw,.post-php.mce-fullscreen #wpadminbar{display:none}#wp-content-editor-tools{background-color:#f1f1f1;padding-top:20px}#poststuff #post-body.columns-2 #side-sortables{width:280px}#timestampdiv select{height:21px;line-height:14px;padding:0;vertical-align:top;font-size:12px}#aa,#hh,#jj,#mn{padding:1px;font-size:12px}#hh,#jj,#mn{width:2em}#aa{width:3.4em}.curtime #timestamp{padding:2px 0 1px 0;display:inline!important;height:auto!important}#post-body #visibility:before,#post-body .misc-pub-post-status:before,#post-body .misc-pub-revisions:before,.curtime #timestamp:before,span.wp-media-buttons-icon:before{color:#82878c}#post-body #visibility:before,#post-body .misc-pub-post-status:before,#post-body .misc-pub-revisions:before,.curtime #timestamp:before{font:normal 20px/1 dashicons;speak:none;display:inline-block;margin-right:-1px;padding-left:3px;vertical-align:top;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}#post-body .misc-pub-post-status:before{content:"\f173"}#post-body #visibility:before{content:"\f177"}.curtime #timestamp:before{content:"\f145";position:relative;top:-1px}#post-body .misc-pub-revisions:before{content:"\f321"}#timestampdiv{padding-top:5px;line-height:23px}#timestampdiv p{margin:8px 0 6px}#timestampdiv input{border-width:1px;border-style:solid;text-align:center}.notification-dialog{position:fixed;top:30%;max-height:70%;right:50%;width:450px;margin-right:-225px;background:#fff;box-shadow:0 3px 6px rgba(0,0,0,.3);line-height:1.5;z-index:1000005;overflow-y:auto}.notification-dialog-background{position:fixed;top:0;right:0;left:0;bottom:0;background:#000;opacity:.7;filter:alpha(opacity=70);z-index:1000000}#post-lock-dialog .post-locked-message,#post-lock-dialog .post-taken-over{margin:25px}#file-editor-warning .button,#post-lock-dialog .post-locked-message a.button{margin-left:10px}#post-lock-dialog .post-locked-avatar{float:right;margin:0 0 20px 20px}#post-lock-dialog .wp-tab-first{outline:0}#post-lock-dialog .locked-saving img{float:right;margin-left:3px}#post-lock-dialog.saved .locked-saved,#post-lock-dialog.saving .locked-saving{display:inline}#excerpt{display:block;margin:12px 0 0;height:4em;width:100%}.tagchecklist{margin-right:14px;font-size:12px;overflow:auto}.tagchecklist br{display:none}.tagchecklist strong{margin-right:-8px;position:absolute}.tagchecklist>li{float:right;margin-left:25px;font-size:13px;line-height:1.8em;cursor:default;max-width:100%;overflow:hidden;text-overflow:ellipsis}.tagchecklist .ntdelbutton{position:absolute;width:24px;height:24px;border:none;margin:0 -19px 0 0;padding:0;background:0 0;cursor:pointer;text-indent:0}#poststuff .stuffbox>h3,#poststuff h2,#poststuff h3.hndle{font-size:14px;padding:8px 12px;margin:0;line-height:1.4}#poststuff .stuffbox h2{padding:8px 10px}#poststuff .inside{margin:6px 0 0 0}#poststuff .stuffbox .inside{margin:0}#poststuff .inside #page_template,#poststuff .inside #parent_id{max-width:100%}.ie8 #poststuff .inside #page_template,.ie8 #poststuff .inside #parent_id{width:250px}.post-attributes-label-wrapper{margin-bottom:.5em}.post-attributes-label{vertical-align:baseline;font-weight:600}#post-visibility-select{line-height:1.5em;margin-top:3px}#linksubmitdiv .inside,#poststuff #submitdiv .inside{margin:0;padding:0}#post-body-content,.edit-form-section{margin-bottom:20px}.wp-privacy-policy-guide{max-width:1000px}.privacy-text-box{width:calc(100% - 260px)}.privacy-text-box-toc{float:left;width:250px;background-color:#fff}.privacy-text-box-toc p{margin:0;padding:.7em 1em;border-bottom:1px solid #eee}.privacy-text-box-toc ol{margin-right:2em}.wp-privacy-policy-guide h3{font-size:1.2em;margin:1em 0 .5em}.privacy-text-section .privacy-text-copy{float:left}.privacy-text-section{position:relative;border-top:1px solid #e3e3e3}.privacy-text-box-head,.privacy-text-section.text-removed{padding-bottom:12px}.text-removed .policy-text{font-style:italic;color:#666;font-weight:600}.privacy-text-actions{height:32px;line-height:32px;padding-bottom:6px}.wp-privacy-policy-guide .policy-text h2{margin:1.2em 0 1em;padding:0}.suggested-policy-content{font-style:italic}.privacy-text-section a.return-to-top{float:left;margin-left:-250px;margin-top:6px}.hide-privacy-policy-tutorial .privacy-policy-tutorial{visibility:hidden}.wp-suggested-text p{font-style:italic}.wp-suggested-text p.privacy-policy-tutorial{font-style:normal}.notice.wp-pp-notice{margin:15px 0 3px}#postcustomstuff thead th{padding:5px 8px 8px;background-color:#f1f1f1}#postcustom #postcustomstuff .submit{border:0 none;float:none;padding:0 8px 8px}#side-sortables #postcustom #postcustomstuff .submit{margin:0;padding:0}#side-sortables #postcustom #postcustomstuff #the-list textarea{height:85px}#side-sortables #postcustom #postcustomstuff td.left input,#side-sortables #postcustom #postcustomstuff td.left select,#side-sortables #postcustomstuff #newmetaleft a{margin:3px 3px 0}#postcustomstuff table{margin:0;width:100%;border:1px solid #ddd;border-spacing:0;background-color:#f9f9f9}#postcustomstuff tr{vertical-align:top}#postcustomstuff table input,#postcustomstuff table select,#postcustomstuff table textarea{width:96%;margin:8px}#side-sortables #postcustomstuff table input,#side-sortables #postcustomstuff table select,#side-sortables #postcustomstuff table textarea{margin:3px}#postcustomstuff td.left,#postcustomstuff th.left{width:38%}#postcustomstuff .submit input{margin:0;width:auto}#postcustomstuff #newmetaleft a{display:inline-block;margin:0 8px 8px;text-decoration:none}.no-js #postcustomstuff #enternew{display:none}#post-body-content .compat-attachment-fields{margin-bottom:20px}.compat-attachment-fields th{padding-top:5px;padding-left:10px}#select-featured-image{padding:4px 0;overflow:hidden}#select-featured-image img{max-width:100%;height:auto;margin-bottom:10px}#select-featured-image a{float:right;clear:both}#select-featured-image .remove{display:none;margin-top:10px}.js #select-featured-image.has-featured-image .remove{display:inline-block}.no-js #select-featured-image .choose{display:none}.post-format-icon::before{display:inline-block;vertical-align:middle;height:20px;width:20px;margin-top:-4px;margin-left:7px;color:#ddd;font:normal 20px/1 dashicons;speak:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}a.post-format-icon:hover:before{color:#00a0d2}#post-formats-select{line-height:2em}#post-formats-select .post-format-icon::before{top:5px}input.post-format{margin-top:1px}label.post-format-icon{margin-right:0;padding:2px 0}.post-format-icon.post-format-standard::before{content:"\f109"}.post-format-icon.post-format-image::before{content:"\f128"}.post-format-icon.post-format-gallery::before{content:"\f161"}.post-format-icon.post-format-audio::before{content:"\f127"}.post-format-icon.post-format-video::before{content:"\f126"}.post-format-icon.post-format-chat::before{content:"\f125"}.post-format-icon.post-format-status::before{content:"\f130"}.post-format-icon.post-format-aside::before{content:"\f123"}.post-format-icon.post-format-quote::before{content:"\f122"}.post-format-icon.post-format-link::before{content:"\f103"}.category-adder{margin-right:120px;padding:4px 0}.category-adder h4{margin:0 0 8px}#side-sortables .category-adder{margin:0}.categorydiv div.tabs-panel,.customlinkdiv div.tabs-panel,.posttypediv div.tabs-panel,.taxonomydiv div.tabs-panel,.wp-tab-panel{min-height:42px;max-height:200px;overflow:auto;padding:0 .9em;border:solid 1px #ddd;background-color:#fdfdfd}div.tabs-panel-active{display:block}div.tabs-panel-inactive{display:none}#front-page-warning,#front-static-pages ul,.categorydiv ul.categorychecklist ul,.customlinkdiv ul.categorychecklist ul,.inline-editor ul.cat-checklist ul,.posttypediv ul.categorychecklist ul,.taxonomydiv ul.categorychecklist ul,ul.export-filters{margin-right:18px}ul.categorychecklist li{margin:0;padding:0;line-height:22px;word-wrap:break-word}.categorydiv .tabs-panel,.customlinkdiv .tabs-panel,.posttypediv .tabs-panel,.taxonomydiv .tabs-panel{border-width:3px;border-style:solid}.form-wrap label{display:block;padding:2px 0}.form-field input[type=email],.form-field input[type=number],.form-field input[type=password],.form-field input[type=search],.form-field input[type=tel],.form-field input[type=text],.form-field input[type=url],.form-field textarea{border-style:solid;border-width:1px;width:95%}.form-wrap p,p.description{margin:2px 0 5px;color:#666}.form-wrap p,p.description,p.help,span.description{font-size:13px;font-style:italic}.form-wrap .form-field{margin:1em 0;padding:0}.form-wrap .form-field #parent{max-width:100%}.col-wrap h2{margin:12px 0;font-size:1.1em}.col-wrap p.submit{margin-top:-10px}.edit-term-notes{margin-top:2em}#poststuff .tagsdiv .ajaxtag{margin-top:1em}#poststuff .tagsdiv .howto{margin:1em 0 6px 0}.ajaxtag .newtag{position:relative}.tagsdiv .newtag{width:180px}.tagsdiv .the-tags{display:block;height:60px;margin:0 auto;overflow:auto;width:260px}#post-body-content .tagsdiv .the-tags{margin:0 5px}p.popular-tags{border:none;line-height:2em;padding:8px 12px 12px;text-align:justify}p.popular-tags a{padding:0 3px}.tagcloud{width:97%;margin:0 0 40px;text-align:justify}.tagcloud h2{margin:2px 0 12px}.the-tagcloud ul{margin:0}.the-tagcloud ul li{display:inline-block}.ac_results{display:none;margin:-1px 0 0;padding:0;list-style:none;position:absolute;z-index:10000;border:1px solid #5b9dd9;background-color:#fff}.wp-customizer .ac_results{z-index:500000}.ac_results li{margin:0;padding:5px 10px;white-space:nowrap;text-align:right}.ac_over .ac_match,.ac_results .ac_over{background-color:#0073aa;color:#fff;cursor:pointer}.ac_match{text-decoration:underline}#edittag{max-width:800px}.edit-tag-actions{margin-top:20px}.comment-php .wp-editor-area{height:200px}.comment-ays td,.comment-ays th{padding:10px 15px}.comment-ays .comment-content ul{list-style:initial;margin-right:2em}.comment-ays .comment-content a[href]:after{content:"(" attr(href) ")";display:inline-block;padding:0 4px;color:#72777c;font-size:13px;word-break:break-all}.comment-ays .comment-content p.edit-comment{margin-top:10px}.comment-ays .comment-content p.edit-comment a[href]:after{content:"";padding:0}.comment-ays-submit .button-cancel{margin-right:1em}.spam-undo-inside,.trash-undo-inside{margin:1px 0 1px 8px;line-height:16px}.spam-undo-inside .avatar,.trash-undo-inside .avatar{height:20px;width:20px;margin-left:8px;vertical-align:middle}.stuffbox .editcomment{clear:none;margin-top:0}#namediv.stuffbox .editcomment input{width:100%}#namediv.stuffbox .editcomment.form-table td{padding:10px}#comment-status-radio p{margin:3px 0 5px}#comment-status-radio input{margin:2px 0 5px 3px;vertical-align:middle}#comment-status-radio label{padding:5px 0}table.links-table{width:100%;border-spacing:0}.links-table th{font-weight:400;text-align:right;vertical-align:top;min-width:80px;width:20%;word-wrap:break-word}.links-table td,.links-table th{padding:5px 0}.links-table td label{margin-left:8px}.links-table td input[type=text],.links-table td textarea{width:100%}.links-table #link_rel{max-width:280px}#qt_content_dfw{display:none}.wp-editor-expand #qt_content_dfw{display:inline-block}.focus-on #screen-meta,.focus-on #screen-meta-links,.focus-on #wp-toolbar,.focus-on #wpfooter,.focus-on .page-title-action,.focus-on .postbox-container>*,.focus-on .update-nag,.focus-on .wrap>h1,.focus-on div.error,.focus-on div.notice,.focus-on div.updated{opacity:0;transition-duration:.6s;transition-property:opacity;transition-timing-function:ease-in-out}.focus-on #wp-toolbar{opacity:.3}.focus-off #screen-meta,.focus-off #screen-meta-links,.focus-off #wp-toolbar,.focus-off #wpfooter,.focus-off .page-title-action,.focus-off .postbox-container>*,.focus-off .update-nag,.focus-off .wrap>h1,.focus-off div.error,.focus-off div.notice,.focus-off div.updated{opacity:1;transition-duration:.2s;transition-property:opacity;transition-timing-function:ease-in-out}.focus-off #wp-toolbar{-webkit-transform:translate(0,0)}.focus-on #adminmenuback,.focus-on #adminmenuwrap{transition-duration:.6s;transition-property:transform;transition-timing-function:ease-in-out}.focus-on #adminmenuback,.focus-on #adminmenuwrap{transform:translateX(100%)}.focus-off #adminmenuback,.focus-off #adminmenuwrap{transform:translateX(0);transition-duration:.2s;transition-property:transform;transition-timing-function:ease-in-out}@media print,(-webkit-min-device-pixel-ratio:1.25),(min-resolution:120dpi){#content-resize-handle,#post-body .wp_themeSkin .mceStatusbar a.mceResize{background:transparent url(../images/resize-2x.gif) no-repeat scroll left bottom;background-size:11px 11px}.rtl #content-resize-handle,.rtl #post-body .wp_themeSkin .mceStatusbar a.mceResize{background-image:url(../images/resize-rtl-2x.gif);background-position:left bottom}}@media only screen and (max-width:850px){#poststuff{min-width:0}#wpbody-content #poststuff #post-body{margin:0}#wpbody-content #post-body.columns-2 #postbox-container-1{margin-left:0;width:100%}#poststuff #postbox-container-1 #side-sortables:empty,#poststuff #postbox-container-1 .empty-container{border:0 none;height:0;min-height:0}#poststuff #post-body.columns-2 #side-sortables{min-height:0;width:auto}.columns-prefs,.screen-layout{display:none}}@media screen and (max-width:782px){.wp-core-ui .edit-tag-actions .button-primary{margin-bottom:0}#post-body-content{min-width:0}#titlediv #title-prompt-text{padding:10px 10px}#poststuff .stuffbox .inside{padding:0 0 4px 2px}#poststuff .stuffbox>h3,#poststuff h2,#poststuff h3.hndle{padding:12px}#namediv.stuffbox .editcomment.form-table td{padding:5px 10px}.post-format-options{padding-left:0}.post-format-options a{margin-left:5px;margin-bottom:5px;min-width:52px}.post-format-options .post-format-title{font-size:11px}.post-format-options a div{height:28px;width:28px}.post-format-options a div:before{font-size:26px!important}#post-visibility-select{line-height:280%}.wp-core-ui .save-post-visibility,.wp-core-ui .save-timestamp{vertical-align:middle;margin-left:15px}.timestamp-wrap select#mm{display:block;width:100%;margin-bottom:10px}.timestamp-wrap #aa,.timestamp-wrap #hh,.timestamp-wrap #jj,.timestamp-wrap #mn{padding:12px 3px;font-size:14px;margin-bottom:5px;width:auto;text-align:center}ul.category-tabs{margin:30px 0 15px}ul.category-tabs li.tabs{padding:15px}ul.categorychecklist li{margin-bottom:15px}ul.categorychecklist ul{margin-top:15px}.category-add input[type=text],.category-add select{max-width:none;margin-bottom:15px}.tagsdiv .newtag{width:100%;height:auto;margin-bottom:15px}.tagchecklist{margin:25px 10px}.tagchecklist>li{font-size:16px;line-height:1.4}#commentstatusdiv p{line-height:2.8}.mceToolbar *{white-space:normal!important}.mceToolbar td,.mceToolbar tr{float:right!important}.wp_themeSkin a.mceButton{width:30px;height:30px}.wp_themeSkin .mceButton .mceIcon{margin-top:5px;margin-right:5px}.wp_themeSkin .mceSplitButton{margin-top:1px}.wp_themeSkin .mceSplitButton td a.mceAction{padding-top:6px;padding-bottom:6px;padding-right:6px;padding-left:3px}.wp_themeSkin .mceSplitButton td a.mceOpen,.wp_themeSkin .mceSplitButtonEnabled:hover td a.mceOpen{padding-top:6px;padding-bottom:6px;background-position:1px 6px}.wp_themeSkin table.mceListBox{margin:5px}div.quicktags-toolbar input{padding:10px 20px}button.wp-switch-editor{font-size:16px;line-height:1em;margin:7px 7px 0 0;padding:8px 12px}#wp-content-media-buttons a{font-size:14px;padding:6px 10px}.wp-media-buttons span.jetpack-contact-form-icon,.wp-media-buttons span.wp-media-buttons-icon{width:22px!important;margin-right:-2px!important}.wp-media-buttons #insert-jetpack-contact-form span.jetpack-contact-form-icon:before,.wp-media-buttons .add_media span.wp-media-buttons-icon:before{font-size:20px!important}#content_wp_fullscreen{display:none}.misc-pub-section{padding:20px 10px 20px}.misc-pub-section>a{float:left;font-size:16px}#delete-action,#publishing-action{line-height:47px}#publishing-action .spinner{float:none;margin-top:-2px}.comment-ays td,.comment-ays th{padding-bottom:0}.comment-ays td{padding-top:6px}.links-table #link_rel{max-width:none}.links-table td,.links-table th{padding:10px 0}.privacy-text-box{width:auto}.privacy-text-box-toc{float:none;width:auto;height:100%}.privacy-text-section a.return-to-top{float:none;margin:0}} \ No newline at end of file
diff --git a/www/crm/wp-admin/css/edit.css b/www/crm/wp-admin/css/edit.css
new file mode 100644
index 00000000..ce62c069
--- /dev/null
+++ b/www/crm/wp-admin/css/edit.css
@@ -0,0 +1,1651 @@
+#poststuff {
+ padding-top: 10px;
+ min-width: 763px;
+}
+
+#poststuff #post-body {
+ padding: 0;
+}
+
+#poststuff .postbox-container {
+ width: 100%;
+}
+
+#poststuff #post-body.columns-2 {
+ margin-right: 300px;
+}
+
+/*------------------------------------------------------------------------------
+ 11.0 - Write/Edit Post Screen
+------------------------------------------------------------------------------*/
+
+#show-comments {
+ overflow: hidden;
+}
+
+#save-action .spinner,
+#show-comments a {
+ float: left;
+}
+
+#show-comments .spinner {
+ float: none;
+ margin-top: 0;
+}
+
+#lost-connection-notice .spinner {
+ visibility: visible;
+ float: left;
+ margin: 0 5px 0 0;
+}
+
+#titlediv {
+ position: relative;
+}
+
+#titlediv label {
+ cursor: text;
+}
+
+#titlediv div.inside {
+ margin: 0;
+}
+
+#poststuff #titlewrap {
+ border: 0;
+ padding: 0;
+}
+
+#titlediv #title {
+ padding: 3px 8px;
+ font-size: 1.7em;
+ line-height: 100%;
+ height: 1.7em;
+ width: 100%;
+ outline: none;
+ margin: 0 0 3px;
+ background-color: #fff;
+}
+
+#titlediv #title-prompt-text {
+ color: #72777c;
+ position: absolute;
+ font-size: 1.7em;
+ padding: 11px 10px;
+}
+
+input#link_description,
+input#link_url {
+ width: 98%;
+}
+
+#pending {
+ background: 0 none;
+ border: 0 none;
+ padding: 0;
+ font-size: 11px;
+ margin-top: -1px;
+}
+
+#edit-slug-box,
+#comment-link-box {
+ line-height: 24px;
+ min-height: 25px; /* Yes, line-height + 1 */
+ margin-top: 5px;
+ padding: 0 10px;
+ color: #666;
+}
+
+#edit-slug-box .cancel {
+ margin-right: 10px;
+ padding: 0;
+ font-size: 11px;
+}
+
+#comment-link-box {
+ margin: 5px 0;
+ padding: 0 5px;
+}
+
+#editable-post-name-full {
+ display: none;
+}
+
+#editable-post-name {
+ font-weight: 600;
+}
+
+#editable-post-name input {
+ font-size: 13px;
+ font-weight: 400;
+ height: 24px;
+ margin: 0;
+ width: 16em;
+}
+
+.postarea h3 label {
+ float: left;
+}
+
+body.post-new-php .submitbox .submitdelete {
+ display: none;
+}
+
+.submitbox .submit a:hover {
+ text-decoration: underline;
+}
+
+.submitbox .submit input {
+ margin-bottom: 8px;
+ margin-right: 4px;
+ padding: 6px;
+}
+
+#post-status-select {
+ margin-top: 3px;
+}
+
+/* Post Screen */
+#post-body #normal-sortables {
+ min-height: 50px;
+}
+
+.postbox {
+ position: relative;
+ min-width: 255px;
+ border: 1px solid #e5e5e5;
+ box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
+ background: #fff;
+}
+
+#trackback_url {
+ width: 99%;
+}
+
+#normal-sortables .postbox .submit {
+ background: transparent none;
+ border: 0 none;
+ float: right;
+ padding: 0 12px;
+ margin: 0;
+}
+
+.category-add input[type="text"],
+.category-add select {
+ width: 100%;
+ max-width: 260px;
+ vertical-align: baseline;
+}
+
+#side-sortables .category-add input[type="text"],
+#side-sortables .category-add select {
+ margin: 0 0 1em;
+}
+
+ul.category-tabs li,
+#side-sortables .add-menu-item-tabs li,
+.wp-tab-bar li {
+ display: inline;
+ line-height: 1.35em;
+}
+
+.no-js .category-tabs li.hide-if-no-js {
+ display: none;
+}
+
+.category-tabs a,
+#side-sortables .add-menu-item-tabs a,
+.wp-tab-bar a {
+ text-decoration: none;
+}
+
+/* @todo: do these really need to be so specific? */
+#side-sortables .category-tabs .tabs a,
+#side-sortables .add-menu-item-tabs .tabs a,
+.wp-tab-bar .wp-tab-active a,
+#post-body ul.category-tabs li.tabs a,
+#post-body ul.add-menu-item-tabs li.tabs a {
+ color: #32373c;
+}
+
+.category-tabs {
+ margin: 8px 0 5px;
+}
+
+/* Back-compat for pre-4.4 */
+#category-adder h4 {
+ margin: 0;
+}
+
+.taxonomy-add-new {
+ display: inline-block;
+ margin: 10px 0;
+ font-weight: 600;
+}
+
+#side-sortables .add-menu-item-tabs,
+.wp-tab-bar {
+ margin-bottom: 3px;
+}
+
+#normal-sortables .postbox #replyrow .submit {
+ float: none;
+ margin: 0;
+ padding: 5px 7px 10px;
+ overflow: hidden;
+}
+
+#side-sortables .submitbox .submit input,
+#side-sortables .submitbox .submit .preview,
+#side-sortables .submitbox .submit a.preview:hover {
+ border: 0 none;
+}
+
+/* @todo: make this a more generic class */
+ul.category-tabs,
+ul.add-menu-item-tabs,
+ul.wp-tab-bar {
+ margin-top: 12px;
+}
+
+ul.category-tabs li,
+ul.add-menu-item-tabs li {
+ border: solid 1px transparent;
+ position: relative;
+}
+
+ul.category-tabs li.tabs,
+ul.add-menu-item-tabs li.tabs,
+.wp-tab-active {
+ border: 1px solid #ddd;
+ border-bottom-color: #fdfdfd;
+ background-color: #fdfdfd;
+}
+
+ul.category-tabs li,
+ul.add-menu-item-tabs li,
+ul.wp-tab-bar li {
+ padding: 3px 5px 6px;
+}
+
+#set-post-thumbnail {
+ display: inline-block;
+ max-width: 100%;
+}
+
+#postimagediv .inside img {
+ max-width: 100%;
+ height: auto;
+ width: auto;
+ vertical-align: top;
+ background-image: linear-gradient(45deg, #c4c4c4 25%, transparent 25%, transparent 75%, #c4c4c4 75%, #c4c4c4), linear-gradient(45deg, #c4c4c4 25%, transparent 25%, transparent 75%, #c4c4c4 75%, #c4c4c4);
+ background-position: 0 0, 10px 10px;
+ background-size: 20px 20px;
+}
+
+form#tags-filter {
+ position: relative;
+}
+
+/* Global classes */
+.wp-hidden-children .wp-hidden-child,
+.ui-tabs-hide {
+ display: none;
+}
+
+#post-body .tagsdiv #newtag {
+ margin-right: 5px;
+ width: 16em;
+}
+
+#side-sortables input#post_password {
+ width: 94%
+}
+
+#side-sortables .tagsdiv #newtag {
+ width: 68%;
+}
+
+#post-status-info {
+ width: 100%;
+ border-spacing: 0;
+ border: 1px solid #e5e5e5;
+ border-top: none;
+ background-color: #f7f7f7;
+ box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
+ z-index: 999;
+}
+
+#post-status-info td {
+ font-size: 12px;
+}
+
+.autosave-info {
+ padding: 2px 10px;
+ text-align: right;
+}
+
+#editorcontent #post-status-info {
+ border: none;
+}
+
+#content-resize-handle {
+ background: transparent url(../images/resize.gif) no-repeat scroll right bottom;
+ width: 12px;
+ cursor: row-resize;
+}
+
+/*rtl:ignore*/
+.rtl #content-resize-handle {
+ background-image: url(../images/resize-rtl.gif);
+ background-position: left bottom;
+}
+
+.wp-editor-expand #content-resize-handle {
+ display: none;
+}
+
+#postdivrich #content {
+ resize: none;
+}
+
+#wp-word-count {
+ display: block;
+ padding: 2px 10px;
+}
+
+#wp-content-editor-container {
+ position: relative;
+}
+
+.wp-editor-expand #wp-content-editor-tools {
+ z-index: 1000;
+ border-bottom: 1px solid #e5e5e5;
+}
+
+.wp-editor-expand #wp-content-editor-container {
+ box-shadow: none;
+ margin-top: -1px;
+}
+
+.wp-editor-expand #wp-content-editor-container {
+ border-bottom: 0 none;
+}
+
+.wp-editor-expand div.mce-statusbar {
+ z-index: 1;
+}
+
+.wp-editor-expand #post-status-info {
+ border-top: 1px solid #e5e5e5;
+}
+
+.wp-editor-expand div.mce-toolbar-grp {
+ z-index: 999;
+}
+
+/* TinyMCE native fullscreen mode override */
+.mce-fullscreen #wp-content-wrap .mce-menubar,
+.mce-fullscreen #wp-content-wrap .mce-toolbar-grp,
+.mce-fullscreen #wp-content-wrap .mce-edit-area,
+.mce-fullscreen #wp-content-wrap .mce-statusbar {
+ position: static !important;
+ width: auto !important;
+ padding: 0 !important;
+}
+
+.mce-fullscreen #wp-content-wrap .mce-statusbar {
+ visibility: visible !important;
+}
+
+.mce-fullscreen #wp-content-wrap .mce-tinymce .mce-wp-dfw {
+ display: none;
+}
+
+.post-php.mce-fullscreen #wpadminbar,
+.mce-fullscreen #wp-content-wrap .mce-wp-dfw {
+ display: none;
+}
+/* End TinyMCE native fullscreen mode override */
+
+#wp-content-editor-tools {
+ background-color: #f1f1f1;
+ padding-top: 20px;
+}
+
+#poststuff #post-body.columns-2 #side-sortables {
+ width: 280px;
+}
+
+#timestampdiv select {
+ height: 21px;
+ line-height: 14px;
+ padding: 0;
+ vertical-align: top;
+ font-size: 12px;
+}
+
+#aa, #jj, #hh, #mn {
+ padding: 1px;
+ font-size: 12px;
+}
+
+#jj, #hh, #mn {
+ width: 2em;
+}
+
+#aa {
+ width: 3.4em;
+}
+
+.curtime #timestamp {
+ padding: 2px 0 1px 0;
+ display: inline !important;
+ height: auto !important;
+}
+
+#post-body .misc-pub-post-status:before,
+#post-body #visibility:before,
+.curtime #timestamp:before,
+#post-body .misc-pub-revisions:before,
+span.wp-media-buttons-icon:before {
+ color: #82878c;
+}
+
+#post-body .misc-pub-post-status:before,
+#post-body #visibility:before,
+.curtime #timestamp:before,
+#post-body .misc-pub-revisions:before {
+ font: normal 20px/1 dashicons;
+ speak: none;
+ display: inline-block;
+ margin-left: -1px;
+ padding-right: 3px;
+ vertical-align: top;
+ -webkit-font-smoothing: antialiased;
+ -moz-osx-font-smoothing: grayscale;
+}
+
+#post-body .misc-pub-post-status:before {
+ content: "\f173";
+}
+
+#post-body #visibility:before {
+ content: "\f177";
+}
+
+.curtime #timestamp:before {
+ content: "\f145";
+ position: relative;
+ top: -1px;
+}
+
+#post-body .misc-pub-revisions:before {
+ content: "\f321";
+}
+
+#timestampdiv {
+ padding-top: 5px;
+ line-height: 23px;
+}
+
+#timestampdiv p {
+ margin: 8px 0 6px;
+}
+
+#timestampdiv input {
+ border-width: 1px;
+ border-style: solid;
+ text-align: center;
+}
+
+.notification-dialog {
+ position: fixed;
+ top: 30%;
+ max-height: 70%;
+ left: 50%;
+ width: 450px;
+ margin-left: -225px;
+ background: #fff;
+ box-shadow: 0 3px 6px rgba(0, 0, 0, 0.3);
+ line-height: 1.5;
+ z-index: 1000005;
+ overflow-y: auto;
+}
+
+.notification-dialog-background {
+ position: fixed;
+ top: 0;
+ left: 0;
+ right: 0;
+ bottom: 0;
+ background: #000;
+ opacity: 0.7;
+ filter: alpha(opacity=70);
+ z-index: 1000000;
+}
+
+#post-lock-dialog .post-locked-message,
+#post-lock-dialog .post-taken-over {
+ margin: 25px;
+}
+
+#post-lock-dialog .post-locked-message a.button,
+#file-editor-warning .button {
+ margin-right: 10px;
+}
+
+#post-lock-dialog .post-locked-avatar {
+ float: left;
+ margin: 0 20px 20px 0;
+}
+
+#post-lock-dialog .wp-tab-first {
+ outline: 0;
+}
+
+#post-lock-dialog .locked-saving img {
+ float: left;
+ margin-right: 3px;
+}
+
+#post-lock-dialog.saving .locked-saving,
+#post-lock-dialog.saved .locked-saved {
+ display: inline;
+}
+
+#excerpt {
+ display: block;
+ margin: 12px 0 0;
+ height: 4em;
+ width: 100%;
+}
+
+.tagchecklist {
+ margin-left: 14px;
+ font-size: 12px;
+ overflow: auto;
+}
+
+.tagchecklist br {
+ display: none;
+}
+
+.tagchecklist strong {
+ margin-left: -8px;
+ position: absolute;
+}
+
+.tagchecklist > li {
+ float: left;
+ margin-right: 25px;
+ font-size: 13px;
+ line-height: 1.8em;
+ cursor: default;
+ max-width: 100%;
+ overflow: hidden;
+ text-overflow: ellipsis;
+}
+
+.tagchecklist .ntdelbutton {
+ position: absolute;
+ width: 24px;
+ height: 24px;
+ border: none;
+ margin: 0 0 0 -19px;
+ padding: 0;
+ background: none;
+ cursor: pointer;
+ text-indent: 0;
+}
+
+#poststuff h3.hndle, /* Back-compat for pre-4.4 */
+#poststuff .stuffbox > h3, /* Back-compat for pre-4.4 */
+#poststuff h2 {
+ font-size: 14px;
+ padding: 8px 12px;
+ margin: 0;
+ line-height: 1.4;
+}
+
+#poststuff .stuffbox h2 {
+ padding: 8px 10px;
+}
+
+#poststuff .inside {
+ margin: 6px 0 0 0;
+}
+
+#poststuff .stuffbox .inside {
+ margin: 0;
+}
+
+#poststuff .inside #parent_id,
+#poststuff .inside #page_template {
+ max-width: 100%;
+}
+
+.ie8 #poststuff .inside #parent_id,
+.ie8 #poststuff .inside #page_template {
+ width: 250px;
+}
+
+.post-attributes-label-wrapper {
+ margin-bottom: 0.5em;
+}
+
+.post-attributes-label {
+ vertical-align: baseline;
+ font-weight: 600;
+}
+
+#post-visibility-select {
+ line-height: 1.5em;
+ margin-top: 3px;
+}
+
+#linksubmitdiv .inside, /* Old Link Manager back-compat. */
+#poststuff #submitdiv .inside {
+ margin: 0;
+ padding: 0;
+}
+
+#post-body-content,
+.edit-form-section {
+ margin-bottom: 20px;
+}
+
+/* Suggested text for privacy policy */
+.wp-privacy-policy-guide {
+ max-width: 1000px;
+}
+
+.privacy-text-box {
+ width: calc(100% - 260px);
+}
+
+.privacy-text-box-toc {
+ float: right;
+ width: 250px;
+ background-color: #fff;
+}
+
+.privacy-text-box-toc p {
+ margin: 0;
+ padding: 0.7em 1em;
+ border-bottom: 1px solid #eee;
+}
+
+.privacy-text-box-toc ol {
+ margin-left: 2em;
+}
+
+.wp-privacy-policy-guide h3 {
+ font-size: 1.2em;
+ margin: 1em 0 0.5em;
+}
+
+.privacy-text-section .privacy-text-copy {
+ float: right;
+}
+
+.privacy-text-section {
+ position: relative;
+ border-top: 1px solid #e3e3e3;
+}
+
+.privacy-text-box-head,
+.privacy-text-section.text-removed {
+ padding-bottom: 12px;
+}
+
+.text-removed .policy-text {
+ font-style: italic;
+ color: #666;
+ font-weight: 600;
+}
+
+.privacy-text-actions {
+ height: 32px;
+ line-height: 32px;
+ padding-bottom: 6px;
+}
+
+.wp-privacy-policy-guide .policy-text h2 {
+ margin: 1.2em 0 1em;
+ padding: 0;
+}
+
+.suggested-policy-content {
+ font-style: italic;
+}
+
+.privacy-text-section a.return-to-top {
+ float: right;
+ margin-right: -250px;
+ margin-top: 6px;
+}
+
+.hide-privacy-policy-tutorial .privacy-policy-tutorial {
+ visibility: hidden;
+}
+
+.wp-suggested-text p {
+ font-style: italic;
+}
+
+.wp-suggested-text p.privacy-policy-tutorial {
+ font-style: normal;
+}
+
+.notice.wp-pp-notice {
+ margin: 15px 0 3px;
+}
+
+/*------------------------------------------------------------------------------
+ 11.1 - Custom Fields
+------------------------------------------------------------------------------*/
+
+#postcustomstuff thead th {
+ padding: 5px 8px 8px;
+ background-color: #f1f1f1;
+}
+
+#postcustom #postcustomstuff .submit {
+ border: 0 none;
+ float: none;
+ padding: 0 8px 8px;
+}
+
+#side-sortables #postcustom #postcustomstuff .submit {
+ margin: 0;
+ padding: 0;
+}
+
+#side-sortables #postcustom #postcustomstuff #the-list textarea {
+ height: 85px;
+}
+
+#side-sortables #postcustom #postcustomstuff td.left input,
+#side-sortables #postcustom #postcustomstuff td.left select,
+#side-sortables #postcustomstuff #newmetaleft a {
+ margin: 3px 3px 0;
+}
+
+#postcustomstuff table {
+ margin: 0;
+ width: 100%;
+ border: 1px solid #ddd;
+ border-spacing: 0;
+ background-color: #f9f9f9;
+}
+
+#postcustomstuff tr {
+ vertical-align: top;
+}
+
+#postcustomstuff table input,
+#postcustomstuff table select,
+#postcustomstuff table textarea {
+ width: 96%;
+ margin: 8px;
+}
+
+#side-sortables #postcustomstuff table input,
+#side-sortables #postcustomstuff table select,
+#side-sortables #postcustomstuff table textarea {
+ margin: 3px;
+}
+
+#postcustomstuff th.left,
+#postcustomstuff td.left {
+ width: 38%;
+}
+
+#postcustomstuff .submit input {
+ margin: 0;
+ width: auto;
+}
+
+#postcustomstuff #newmetaleft a {
+ display: inline-block;
+ margin: 0 8px 8px;
+ text-decoration: none;
+}
+
+.no-js #postcustomstuff #enternew {
+ display: none;
+}
+
+#post-body-content .compat-attachment-fields {
+ margin-bottom: 20px;
+}
+
+.compat-attachment-fields th {
+ padding-top: 5px;
+ padding-right: 10px;
+}
+
+/*------------------------------------------------------------------------------
+ 11.3 - Featured Images
+------------------------------------------------------------------------------*/
+
+#select-featured-image {
+ padding: 4px 0;
+ overflow: hidden;
+}
+
+#select-featured-image img {
+ max-width: 100%;
+ height: auto;
+ margin-bottom: 10px;
+}
+
+#select-featured-image a {
+ float: left;
+ clear: both;
+}
+
+#select-featured-image .remove {
+ display: none;
+ margin-top: 10px;
+}
+
+.js #select-featured-image.has-featured-image .remove {
+ display: inline-block;
+}
+
+.no-js #select-featured-image .choose {
+ display: none;
+}
+
+/*------------------------------------------------------------------------------
+ 11.4 - Post formats
+------------------------------------------------------------------------------*/
+
+.post-format-icon::before {
+ display: inline-block;
+ vertical-align: middle;
+ height: 20px;
+ width: 20px;
+ margin-top: -4px;
+ margin-right: 7px;
+ color: #ddd;
+ font: normal 20px/1 dashicons;
+ speak: none;
+ -webkit-font-smoothing: antialiased;
+ -moz-osx-font-smoothing: grayscale;
+}
+
+a.post-format-icon:hover:before {
+ color: #00a0d2;
+}
+
+#post-formats-select {
+ line-height: 2em;
+}
+
+#post-formats-select .post-format-icon::before {
+ top: 5px;
+}
+
+input.post-format {
+ margin-top: 1px;
+}
+
+label.post-format-icon {
+ margin-left: 0;
+ padding: 2px 0;
+}
+
+.post-format-icon.post-format-standard::before {
+ content: "\f109";
+}
+
+.post-format-icon.post-format-image::before {
+ content: "\f128";
+}
+
+.post-format-icon.post-format-gallery::before {
+ content: "\f161";
+}
+
+.post-format-icon.post-format-audio::before {
+ content: "\f127";
+}
+
+.post-format-icon.post-format-video::before {
+ content: "\f126";
+}
+
+.post-format-icon.post-format-chat::before {
+ content: "\f125";
+}
+
+.post-format-icon.post-format-status::before {
+ content: "\f130";
+}
+
+.post-format-icon.post-format-aside::before {
+ content: "\f123";
+}
+
+.post-format-icon.post-format-quote::before {
+ content: "\f122";
+}
+
+.post-format-icon.post-format-link::before {
+ content: "\f103";
+}
+
+/*------------------------------------------------------------------------------
+ 12.0 - Categories
+------------------------------------------------------------------------------*/
+
+.category-adder {
+ margin-left: 120px;
+ padding: 4px 0;
+}
+
+.category-adder h4 {
+ margin: 0 0 8px;
+}
+
+#side-sortables .category-adder {
+ margin: 0;
+}
+
+.wp-tab-panel,
+.categorydiv div.tabs-panel,
+.customlinkdiv div.tabs-panel,
+.posttypediv div.tabs-panel,
+.taxonomydiv div.tabs-panel {
+ min-height: 42px;
+ max-height: 200px;
+ overflow: auto;
+ padding: 0 0.9em;
+ border: solid 1px #ddd;
+ background-color: #fdfdfd;
+}
+
+div.tabs-panel-active {
+ display: block;
+}
+
+div.tabs-panel-inactive {
+ display: none;
+}
+
+#front-page-warning,
+#front-static-pages ul,
+ul.export-filters,
+.inline-editor ul.cat-checklist ul,
+.categorydiv ul.categorychecklist ul,
+.customlinkdiv ul.categorychecklist ul,
+.posttypediv ul.categorychecklist ul,
+.taxonomydiv ul.categorychecklist ul {
+ margin-left: 18px;
+}
+
+ul.categorychecklist li {
+ margin: 0;
+ padding: 0;
+ line-height: 22px;
+ word-wrap: break-word;
+}
+
+.categorydiv .tabs-panel,
+.customlinkdiv .tabs-panel,
+.posttypediv .tabs-panel,
+.taxonomydiv .tabs-panel {
+ border-width: 3px;
+ border-style: solid;
+}
+
+.form-wrap label {
+ display: block;
+ padding: 2px 0;
+}
+
+.form-field input[type="text"],
+.form-field input[type="password"],
+.form-field input[type="email"],
+.form-field input[type="number"],
+.form-field input[type="search"],
+.form-field input[type="tel"],
+.form-field input[type="url"],
+.form-field textarea {
+ border-style: solid;
+ border-width: 1px;
+ width: 95%;
+}
+
+p.description,
+.form-wrap p {
+ margin: 2px 0 5px;
+ color: #666;
+}
+
+p.help,
+p.description,
+span.description,
+.form-wrap p {
+ font-size: 13px;
+ font-style: italic;
+}
+
+.form-wrap .form-field {
+ margin: 1em 0;
+ padding: 0;
+}
+
+.form-wrap .form-field #parent {
+ max-width: 100%;
+}
+
+.col-wrap h2 {
+ margin: 12px 0;
+ font-size: 1.1em;
+}
+
+.col-wrap p.submit {
+ margin-top: -10px;
+}
+
+.edit-term-notes {
+ margin-top: 2em;
+}
+
+/*------------------------------------------------------------------------------
+ 13.0 - Tags
+------------------------------------------------------------------------------*/
+
+#poststuff .tagsdiv .ajaxtag {
+ margin-top: 1em;
+}
+
+#poststuff .tagsdiv .howto {
+ margin: 1em 0 6px 0;
+}
+
+.ajaxtag .newtag {
+ position: relative;
+}
+
+.tagsdiv .newtag {
+ width: 180px;
+}
+
+.tagsdiv .the-tags {
+ display: block;
+ height: 60px;
+ margin: 0 auto;
+ overflow: auto;
+ width: 260px;
+}
+
+#post-body-content .tagsdiv .the-tags {
+ margin: 0 5px;
+}
+
+p.popular-tags {
+ border: none;
+ line-height: 2em;
+ padding: 8px 12px 12px;
+ text-align: justify;
+}
+
+p.popular-tags a {
+ padding: 0 3px;
+}
+
+.tagcloud {
+ width: 97%;
+ margin: 0 0 40px;
+ text-align: justify;
+}
+
+.tagcloud h2 {
+ margin: 2px 0 12px;
+}
+
+.the-tagcloud ul {
+ margin: 0;
+}
+
+.the-tagcloud ul li {
+ display: inline-block;
+}
+
+/* Suggest.js autocomplete, no more used by core. */
+.ac_results {
+ display: none;
+ margin: -1px 0 0;
+ padding: 0;
+ list-style: none;
+ position: absolute;
+ z-index: 10000;
+ border: 1px solid #5b9dd9;
+ background-color: #fff;
+}
+
+.wp-customizer .ac_results {
+ z-index: 500000;
+}
+
+.ac_results li {
+ margin: 0;
+ padding: 5px 10px;
+ white-space: nowrap;
+ text-align: left;
+}
+
+.ac_results .ac_over,
+.ac_over .ac_match {
+ background-color: #0073aa;
+ color: #fff;
+ cursor: pointer;
+}
+
+.ac_match {
+ text-decoration: underline;
+}
+
+#edittag {
+ max-width: 800px;
+}
+
+.edit-tag-actions {
+ margin-top: 20px;
+}
+
+/* Comments */
+
+.comment-php .wp-editor-area {
+ height: 200px;
+}
+
+.comment-ays th,
+.comment-ays td {
+ padding: 10px 15px;
+}
+
+.comment-ays .comment-content ul {
+ list-style: initial;
+ margin-left: 2em;
+}
+
+.comment-ays .comment-content a[href]:after {
+ content: "(" attr( href ) ")";
+ display: inline-block;
+ padding: 0 4px;
+ color: #72777C;
+ font-size: 13px;
+ word-break: break-all;
+}
+
+.comment-ays .comment-content p.edit-comment {
+ margin-top: 10px;
+}
+
+.comment-ays .comment-content p.edit-comment a[href]:after {
+ content: "";
+ padding: 0;
+}
+
+.comment-ays-submit .button-cancel {
+ margin-left: 1em;
+}
+
+.trash-undo-inside,
+.spam-undo-inside {
+ margin: 1px 8px 1px 0;
+ line-height: 16px;
+}
+
+.spam-undo-inside .avatar,
+.trash-undo-inside .avatar {
+ height: 20px;
+ width: 20px;
+ margin-right: 8px;
+ vertical-align: middle;
+}
+
+.stuffbox .editcomment {
+ clear: none;
+ margin-top: 0;
+}
+
+#namediv.stuffbox .editcomment input {
+ width: 100%;
+}
+
+#namediv.stuffbox .editcomment.form-table td {
+ padding: 10px;
+}
+
+#comment-status-radio p {
+ margin: 3px 0 5px;
+}
+
+#comment-status-radio input {
+ margin: 2px 3px 5px 0;
+ vertical-align: middle;
+}
+
+#comment-status-radio label {
+ padding: 5px 0;
+}
+
+/* links tables */
+table.links-table {
+ width: 100%;
+ border-spacing: 0;
+}
+
+.links-table th {
+ font-weight: 400;
+ text-align: left;
+ vertical-align: top;
+ min-width: 80px;
+ width: 20%;
+ word-wrap: break-word;
+}
+
+.links-table th,
+.links-table td {
+ padding: 5px 0;
+}
+
+.links-table td label {
+ margin-right: 8px;
+}
+
+.links-table td input[type="text"],
+.links-table td textarea {
+ width: 100%;
+}
+
+.links-table #link_rel {
+ max-width: 280px;
+}
+
+/* DFW 2
+-------------------------------------------------------------- */
+
+#qt_content_dfw {
+ display: none;
+}
+
+.wp-editor-expand #qt_content_dfw {
+ display: inline-block;
+}
+
+.focus-on .wrap > h1,
+.focus-on .page-title-action,
+.focus-on #wpfooter,
+.focus-on .postbox-container > *,
+.focus-on div.updated,
+.focus-on div.error,
+.focus-on div.notice,
+.focus-on .update-nag,
+.focus-on #wp-toolbar,
+.focus-on #screen-meta-links,
+.focus-on #screen-meta {
+ opacity: 0;
+ transition-duration: 0.6s;
+ transition-property: opacity;
+ transition-timing-function: ease-in-out;
+}
+
+.focus-on #wp-toolbar {
+ opacity: 0.3;
+}
+
+.focus-off .wrap > h1,
+.focus-off .page-title-action,
+.focus-off #wpfooter,
+.focus-off .postbox-container > *,
+.focus-off div.updated,
+.focus-off div.error,
+.focus-off div.notice,
+.focus-off .update-nag,
+.focus-off #wp-toolbar,
+.focus-off #screen-meta-links,
+.focus-off #screen-meta {
+ opacity: 1;
+ transition-duration: 0.2s;
+ transition-property: opacity;
+ transition-timing-function: ease-in-out;
+}
+
+.focus-off #wp-toolbar {
+ -webkit-transform: translate(0, 0);
+}
+
+.focus-on #adminmenuback,
+.focus-on #adminmenuwrap {
+ transition-duration: 0.6s;
+ transition-property: transform;
+ transition-timing-function: ease-in-out;
+}
+
+.focus-on #adminmenuback,
+.focus-on #adminmenuwrap {
+ transform: translateX( -100% );
+}
+
+.focus-off #adminmenuback,
+.focus-off #adminmenuwrap {
+ transform: translateX( 0 );
+ transition-duration: 0.2s;
+ transition-property: transform;
+ transition-timing-function: ease-in-out;
+}
+
+/* =Media Queries
+-------------------------------------------------------------- */
+
+/**
+ * HiDPI Displays
+ */
+@media print,
+ (-webkit-min-device-pixel-ratio: 1.25),
+ (min-resolution: 120dpi) {
+ #content-resize-handle,
+ #post-body .wp_themeSkin .mceStatusbar a.mceResize {
+ background: transparent url(../images/resize-2x.gif) no-repeat scroll right bottom;
+ background-size: 11px 11px;
+ }
+
+ /*rtl:ignore*/
+ .rtl #content-resize-handle,
+ .rtl #post-body .wp_themeSkin .mceStatusbar a.mceResize {
+ background-image: url(../images/resize-rtl-2x.gif);
+ background-position: left bottom;
+ }
+}
+
+/* one column on the post write/edit screen */
+@media only screen and (max-width: 850px) {
+ #poststuff {
+ min-width: 0;
+ }
+
+ #wpbody-content #poststuff #post-body {
+ margin: 0;
+ }
+
+ #wpbody-content #post-body.columns-2 #postbox-container-1 {
+ margin-right: 0;
+ width: 100%;
+ }
+
+ #poststuff #postbox-container-1 .empty-container,
+ #poststuff #postbox-container-1 #side-sortables:empty {
+ border: 0 none;
+ height: 0;
+ min-height: 0;
+ }
+
+ #poststuff #post-body.columns-2 #side-sortables {
+ min-height: 0;
+ width: auto;
+ }
+
+ /* hide the radio buttons for column prefs */
+ .screen-layout,
+ .columns-prefs {
+ display: none;
+ }
+}
+
+@media screen and (max-width: 782px) {
+ .wp-core-ui .edit-tag-actions .button-primary {
+ margin-bottom: 0;
+ }
+
+ #post-body-content {
+ min-width: 0;
+ }
+
+ #titlediv #title-prompt-text {
+ padding: 10px 10px;
+ }
+
+ #poststuff .stuffbox .inside {
+ padding: 0 2px 4px 0;
+ }
+
+ #poststuff h3.hndle, /* Back-compat for pre-4.4 */
+ #poststuff .stuffbox > h3, /* Back-compat for pre-4.4 */
+ #poststuff h2 {
+ padding: 12px;
+ }
+
+ #namediv.stuffbox .editcomment.form-table td {
+ padding: 5px 10px;
+ }
+
+ .post-format-options {
+ padding-right: 0;
+ }
+
+ .post-format-options a {
+ margin-right: 5px;
+ margin-bottom: 5px;
+ min-width: 52px;
+ }
+
+ .post-format-options .post-format-title {
+ font-size: 11px;
+ }
+
+ .post-format-options a div {
+ height: 28px;
+ width: 28px;
+ }
+
+ .post-format-options a div:before {
+ font-size: 26px !important;
+ }
+
+ /* Publish Metabox Options */
+ #post-visibility-select {
+ line-height: 280%;
+ }
+
+ .wp-core-ui .save-post-visibility,
+ .wp-core-ui .save-timestamp {
+ vertical-align: middle;
+ margin-right: 15px;
+ }
+
+ .timestamp-wrap select#mm {
+ display: block;
+ width: 100%;
+ margin-bottom: 10px;
+ }
+
+ .timestamp-wrap #jj,
+ .timestamp-wrap #aa,
+ .timestamp-wrap #hh,
+ .timestamp-wrap #mn {
+ padding: 12px 3px;
+ font-size: 14px;
+ margin-bottom: 5px;
+ width: auto;
+ text-align: center;
+ }
+
+ /* Categories Metabox */
+ ul.category-tabs {
+ margin: 30px 0 15px;
+ }
+
+ ul.category-tabs li.tabs {
+ padding: 15px;
+ }
+
+ ul.categorychecklist li {
+ margin-bottom: 15px;
+ }
+
+ ul.categorychecklist ul {
+ margin-top: 15px;
+ }
+
+ .category-add input[type=text],
+ .category-add select {
+ max-width: none;
+ margin-bottom: 15px;
+ }
+
+ /* Tags Metabox */
+ .tagsdiv .newtag {
+ width: 100%;
+ height: auto;
+ margin-bottom: 15px;
+ }
+
+ .tagchecklist {
+ margin: 25px 10px;
+ }
+
+ .tagchecklist > li {
+ font-size: 16px;
+ line-height: 1.4;
+ }
+
+ /* Discussion */
+ #commentstatusdiv p {
+ line-height: 2.8;
+ }
+
+ /* TinyMCE Adjustments */
+ .mceToolbar * {
+ white-space: normal !important;
+ }
+
+ .mceToolbar tr,
+ .mceToolbar td {
+ float: left !important;
+ }
+
+ .wp_themeSkin a.mceButton {
+ width: 30px;
+ height: 30px;
+ }
+
+ .wp_themeSkin .mceButton .mceIcon {
+ margin-top: 5px;
+ margin-left: 5px;
+ }
+
+ .wp_themeSkin .mceSplitButton {
+ margin-top: 1px;
+ }
+
+ .wp_themeSkin .mceSplitButton td a.mceAction {
+ padding-top: 6px;
+ padding-bottom: 6px;
+ padding-left: 6px;
+ padding-right: 3px;
+ }
+
+ .wp_themeSkin .mceSplitButton td a.mceOpen,
+ .wp_themeSkin .mceSplitButtonEnabled:hover td a.mceOpen {
+ padding-top: 6px;
+ padding-bottom: 6px;
+ background-position: 1px 6px;
+ }
+
+ .wp_themeSkin table.mceListBox {
+ margin: 5px;
+ }
+
+ div.quicktags-toolbar input {
+ padding: 10px 20px;
+ }
+
+ button.wp-switch-editor {
+ font-size: 16px;
+ line-height: 1em;
+ margin: 7px 0 0 7px;
+ padding: 8px 12px;
+ }
+
+ #wp-content-media-buttons a {
+ font-size: 14px;
+ padding: 6px 10px;
+ }
+
+ .wp-media-buttons span.wp-media-buttons-icon,
+ .wp-media-buttons span.jetpack-contact-form-icon {
+ width: 22px !important;
+ margin-left: -2px !important;
+ }
+
+ .wp-media-buttons .add_media span.wp-media-buttons-icon:before,
+ .wp-media-buttons #insert-jetpack-contact-form span.jetpack-contact-form-icon:before {
+ font-size: 20px !important;
+ }
+
+ #content_wp_fullscreen {
+ display: none;
+ }
+
+ .misc-pub-section {
+ padding: 20px 10px 20px;
+ }
+
+ .misc-pub-section > a {
+ float: right;
+ font-size: 16px;
+ }
+
+ #delete-action,
+ #publishing-action {
+ line-height: 47px;
+ }
+
+ #publishing-action .spinner {
+ float: none;
+ margin-top: -2px; /* Half of the Publish button's bottom margin. */
+ }
+
+ /* Moderate Comment */
+ .comment-ays th,
+ .comment-ays td {
+ padding-bottom: 0;
+ }
+
+ .comment-ays td {
+ padding-top: 6px;
+ }
+
+ /* Links */
+ .links-table #link_rel {
+ max-width: none;
+ }
+
+ .links-table th,
+ .links-table td {
+ padding: 10px 0;
+ }
+
+ .privacy-text-box {
+ width: auto;
+ }
+
+ .privacy-text-box-toc {
+ float: none;
+ width: auto;
+ height: 100%;
+ }
+
+ .privacy-text-section a.return-to-top {
+ float: none;
+ margin: 0;
+ }
+}
diff --git a/www/crm/wp-admin/css/edit.min.css b/www/crm/wp-admin/css/edit.min.css
new file mode 100644
index 00000000..4bdf3af9
--- /dev/null
+++ b/www/crm/wp-admin/css/edit.min.css
@@ -0,0 +1,2 @@
+/*! This file is auto-generated */
+#poststuff{padding-top:10px;min-width:763px}#poststuff #post-body{padding:0}#poststuff .postbox-container{width:100%}#poststuff #post-body.columns-2{margin-right:300px}#show-comments{overflow:hidden}#save-action .spinner,#show-comments a{float:left}#show-comments .spinner{float:none;margin-top:0}#lost-connection-notice .spinner{visibility:visible;float:left;margin:0 5px 0 0}#titlediv{position:relative}#titlediv label{cursor:text}#titlediv div.inside{margin:0}#poststuff #titlewrap{border:0;padding:0}#titlediv #title{padding:3px 8px;font-size:1.7em;line-height:100%;height:1.7em;width:100%;outline:0;margin:0 0 3px;background-color:#fff}#titlediv #title-prompt-text{color:#72777c;position:absolute;font-size:1.7em;padding:11px 10px}input#link_description,input#link_url{width:98%}#pending{background:0 none;border:0 none;padding:0;font-size:11px;margin-top:-1px}#comment-link-box,#edit-slug-box{line-height:24px;min-height:25px;margin-top:5px;padding:0 10px;color:#666}#edit-slug-box .cancel{margin-right:10px;padding:0;font-size:11px}#comment-link-box{margin:5px 0;padding:0 5px}#editable-post-name-full{display:none}#editable-post-name{font-weight:600}#editable-post-name input{font-size:13px;font-weight:400;height:24px;margin:0;width:16em}.postarea h3 label{float:left}body.post-new-php .submitbox .submitdelete{display:none}.submitbox .submit a:hover{text-decoration:underline}.submitbox .submit input{margin-bottom:8px;margin-right:4px;padding:6px}#post-status-select{margin-top:3px}#post-body #normal-sortables{min-height:50px}.postbox{position:relative;min-width:255px;border:1px solid #e5e5e5;box-shadow:0 1px 1px rgba(0,0,0,.04);background:#fff}#trackback_url{width:99%}#normal-sortables .postbox .submit{background:transparent none;border:0 none;float:right;padding:0 12px;margin:0}.category-add input[type=text],.category-add select{width:100%;max-width:260px;vertical-align:baseline}#side-sortables .category-add input[type=text],#side-sortables .category-add select{margin:0 0 1em}#side-sortables .add-menu-item-tabs li,.wp-tab-bar li,ul.category-tabs li{display:inline;line-height:1.35em}.no-js .category-tabs li.hide-if-no-js{display:none}#side-sortables .add-menu-item-tabs a,.category-tabs a,.wp-tab-bar a{text-decoration:none}#post-body ul.add-menu-item-tabs li.tabs a,#post-body ul.category-tabs li.tabs a,#side-sortables .add-menu-item-tabs .tabs a,#side-sortables .category-tabs .tabs a,.wp-tab-bar .wp-tab-active a{color:#32373c}.category-tabs{margin:8px 0 5px}#category-adder h4{margin:0}.taxonomy-add-new{display:inline-block;margin:10px 0;font-weight:600}#side-sortables .add-menu-item-tabs,.wp-tab-bar{margin-bottom:3px}#normal-sortables .postbox #replyrow .submit{float:none;margin:0;padding:5px 7px 10px;overflow:hidden}#side-sortables .submitbox .submit .preview,#side-sortables .submitbox .submit a.preview:hover,#side-sortables .submitbox .submit input{border:0 none}ul.add-menu-item-tabs,ul.category-tabs,ul.wp-tab-bar{margin-top:12px}ul.add-menu-item-tabs li,ul.category-tabs li{border:solid 1px transparent;position:relative}.wp-tab-active,ul.add-menu-item-tabs li.tabs,ul.category-tabs li.tabs{border:1px solid #ddd;border-bottom-color:#fdfdfd;background-color:#fdfdfd}ul.add-menu-item-tabs li,ul.category-tabs li,ul.wp-tab-bar li{padding:3px 5px 6px}#set-post-thumbnail{display:inline-block;max-width:100%}#postimagediv .inside img{max-width:100%;height:auto;width:auto;vertical-align:top;background-image:linear-gradient(45deg,#c4c4c4 25%,transparent 25%,transparent 75%,#c4c4c4 75%,#c4c4c4),linear-gradient(45deg,#c4c4c4 25%,transparent 25%,transparent 75%,#c4c4c4 75%,#c4c4c4);background-position:0 0,10px 10px;background-size:20px 20px}form#tags-filter{position:relative}.ui-tabs-hide,.wp-hidden-children .wp-hidden-child{display:none}#post-body .tagsdiv #newtag{margin-right:5px;width:16em}#side-sortables input#post_password{width:94%}#side-sortables .tagsdiv #newtag{width:68%}#post-status-info{width:100%;border-spacing:0;border:1px solid #e5e5e5;border-top:none;background-color:#f7f7f7;box-shadow:0 1px 1px rgba(0,0,0,.04);z-index:999}#post-status-info td{font-size:12px}.autosave-info{padding:2px 10px;text-align:right}#editorcontent #post-status-info{border:none}#content-resize-handle{background:transparent url(../images/resize.gif) no-repeat scroll right bottom;width:12px;cursor:row-resize}.rtl #content-resize-handle{background-image:url(../images/resize-rtl.gif);background-position:left bottom}.wp-editor-expand #content-resize-handle{display:none}#postdivrich #content{resize:none}#wp-word-count{display:block;padding:2px 10px}#wp-content-editor-container{position:relative}.wp-editor-expand #wp-content-editor-tools{z-index:1000;border-bottom:1px solid #e5e5e5}.wp-editor-expand #wp-content-editor-container{box-shadow:none;margin-top:-1px}.wp-editor-expand #wp-content-editor-container{border-bottom:0 none}.wp-editor-expand div.mce-statusbar{z-index:1}.wp-editor-expand #post-status-info{border-top:1px solid #e5e5e5}.wp-editor-expand div.mce-toolbar-grp{z-index:999}.mce-fullscreen #wp-content-wrap .mce-edit-area,.mce-fullscreen #wp-content-wrap .mce-menubar,.mce-fullscreen #wp-content-wrap .mce-statusbar,.mce-fullscreen #wp-content-wrap .mce-toolbar-grp{position:static!important;width:auto!important;padding:0!important}.mce-fullscreen #wp-content-wrap .mce-statusbar{visibility:visible!important}.mce-fullscreen #wp-content-wrap .mce-tinymce .mce-wp-dfw{display:none}.mce-fullscreen #wp-content-wrap .mce-wp-dfw,.post-php.mce-fullscreen #wpadminbar{display:none}#wp-content-editor-tools{background-color:#f1f1f1;padding-top:20px}#poststuff #post-body.columns-2 #side-sortables{width:280px}#timestampdiv select{height:21px;line-height:14px;padding:0;vertical-align:top;font-size:12px}#aa,#hh,#jj,#mn{padding:1px;font-size:12px}#hh,#jj,#mn{width:2em}#aa{width:3.4em}.curtime #timestamp{padding:2px 0 1px 0;display:inline!important;height:auto!important}#post-body #visibility:before,#post-body .misc-pub-post-status:before,#post-body .misc-pub-revisions:before,.curtime #timestamp:before,span.wp-media-buttons-icon:before{color:#82878c}#post-body #visibility:before,#post-body .misc-pub-post-status:before,#post-body .misc-pub-revisions:before,.curtime #timestamp:before{font:normal 20px/1 dashicons;speak:none;display:inline-block;margin-left:-1px;padding-right:3px;vertical-align:top;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}#post-body .misc-pub-post-status:before{content:"\f173"}#post-body #visibility:before{content:"\f177"}.curtime #timestamp:before{content:"\f145";position:relative;top:-1px}#post-body .misc-pub-revisions:before{content:"\f321"}#timestampdiv{padding-top:5px;line-height:23px}#timestampdiv p{margin:8px 0 6px}#timestampdiv input{border-width:1px;border-style:solid;text-align:center}.notification-dialog{position:fixed;top:30%;max-height:70%;left:50%;width:450px;margin-left:-225px;background:#fff;box-shadow:0 3px 6px rgba(0,0,0,.3);line-height:1.5;z-index:1000005;overflow-y:auto}.notification-dialog-background{position:fixed;top:0;left:0;right:0;bottom:0;background:#000;opacity:.7;filter:alpha(opacity=70);z-index:1000000}#post-lock-dialog .post-locked-message,#post-lock-dialog .post-taken-over{margin:25px}#file-editor-warning .button,#post-lock-dialog .post-locked-message a.button{margin-right:10px}#post-lock-dialog .post-locked-avatar{float:left;margin:0 20px 20px 0}#post-lock-dialog .wp-tab-first{outline:0}#post-lock-dialog .locked-saving img{float:left;margin-right:3px}#post-lock-dialog.saved .locked-saved,#post-lock-dialog.saving .locked-saving{display:inline}#excerpt{display:block;margin:12px 0 0;height:4em;width:100%}.tagchecklist{margin-left:14px;font-size:12px;overflow:auto}.tagchecklist br{display:none}.tagchecklist strong{margin-left:-8px;position:absolute}.tagchecklist>li{float:left;margin-right:25px;font-size:13px;line-height:1.8em;cursor:default;max-width:100%;overflow:hidden;text-overflow:ellipsis}.tagchecklist .ntdelbutton{position:absolute;width:24px;height:24px;border:none;margin:0 0 0 -19px;padding:0;background:0 0;cursor:pointer;text-indent:0}#poststuff .stuffbox>h3,#poststuff h2,#poststuff h3.hndle{font-size:14px;padding:8px 12px;margin:0;line-height:1.4}#poststuff .stuffbox h2{padding:8px 10px}#poststuff .inside{margin:6px 0 0 0}#poststuff .stuffbox .inside{margin:0}#poststuff .inside #page_template,#poststuff .inside #parent_id{max-width:100%}.ie8 #poststuff .inside #page_template,.ie8 #poststuff .inside #parent_id{width:250px}.post-attributes-label-wrapper{margin-bottom:.5em}.post-attributes-label{vertical-align:baseline;font-weight:600}#post-visibility-select{line-height:1.5em;margin-top:3px}#linksubmitdiv .inside,#poststuff #submitdiv .inside{margin:0;padding:0}#post-body-content,.edit-form-section{margin-bottom:20px}.wp-privacy-policy-guide{max-width:1000px}.privacy-text-box{width:calc(100% - 260px)}.privacy-text-box-toc{float:right;width:250px;background-color:#fff}.privacy-text-box-toc p{margin:0;padding:.7em 1em;border-bottom:1px solid #eee}.privacy-text-box-toc ol{margin-left:2em}.wp-privacy-policy-guide h3{font-size:1.2em;margin:1em 0 .5em}.privacy-text-section .privacy-text-copy{float:right}.privacy-text-section{position:relative;border-top:1px solid #e3e3e3}.privacy-text-box-head,.privacy-text-section.text-removed{padding-bottom:12px}.text-removed .policy-text{font-style:italic;color:#666;font-weight:600}.privacy-text-actions{height:32px;line-height:32px;padding-bottom:6px}.wp-privacy-policy-guide .policy-text h2{margin:1.2em 0 1em;padding:0}.suggested-policy-content{font-style:italic}.privacy-text-section a.return-to-top{float:right;margin-right:-250px;margin-top:6px}.hide-privacy-policy-tutorial .privacy-policy-tutorial{visibility:hidden}.wp-suggested-text p{font-style:italic}.wp-suggested-text p.privacy-policy-tutorial{font-style:normal}.notice.wp-pp-notice{margin:15px 0 3px}#postcustomstuff thead th{padding:5px 8px 8px;background-color:#f1f1f1}#postcustom #postcustomstuff .submit{border:0 none;float:none;padding:0 8px 8px}#side-sortables #postcustom #postcustomstuff .submit{margin:0;padding:0}#side-sortables #postcustom #postcustomstuff #the-list textarea{height:85px}#side-sortables #postcustom #postcustomstuff td.left input,#side-sortables #postcustom #postcustomstuff td.left select,#side-sortables #postcustomstuff #newmetaleft a{margin:3px 3px 0}#postcustomstuff table{margin:0;width:100%;border:1px solid #ddd;border-spacing:0;background-color:#f9f9f9}#postcustomstuff tr{vertical-align:top}#postcustomstuff table input,#postcustomstuff table select,#postcustomstuff table textarea{width:96%;margin:8px}#side-sortables #postcustomstuff table input,#side-sortables #postcustomstuff table select,#side-sortables #postcustomstuff table textarea{margin:3px}#postcustomstuff td.left,#postcustomstuff th.left{width:38%}#postcustomstuff .submit input{margin:0;width:auto}#postcustomstuff #newmetaleft a{display:inline-block;margin:0 8px 8px;text-decoration:none}.no-js #postcustomstuff #enternew{display:none}#post-body-content .compat-attachment-fields{margin-bottom:20px}.compat-attachment-fields th{padding-top:5px;padding-right:10px}#select-featured-image{padding:4px 0;overflow:hidden}#select-featured-image img{max-width:100%;height:auto;margin-bottom:10px}#select-featured-image a{float:left;clear:both}#select-featured-image .remove{display:none;margin-top:10px}.js #select-featured-image.has-featured-image .remove{display:inline-block}.no-js #select-featured-image .choose{display:none}.post-format-icon::before{display:inline-block;vertical-align:middle;height:20px;width:20px;margin-top:-4px;margin-right:7px;color:#ddd;font:normal 20px/1 dashicons;speak:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}a.post-format-icon:hover:before{color:#00a0d2}#post-formats-select{line-height:2em}#post-formats-select .post-format-icon::before{top:5px}input.post-format{margin-top:1px}label.post-format-icon{margin-left:0;padding:2px 0}.post-format-icon.post-format-standard::before{content:"\f109"}.post-format-icon.post-format-image::before{content:"\f128"}.post-format-icon.post-format-gallery::before{content:"\f161"}.post-format-icon.post-format-audio::before{content:"\f127"}.post-format-icon.post-format-video::before{content:"\f126"}.post-format-icon.post-format-chat::before{content:"\f125"}.post-format-icon.post-format-status::before{content:"\f130"}.post-format-icon.post-format-aside::before{content:"\f123"}.post-format-icon.post-format-quote::before{content:"\f122"}.post-format-icon.post-format-link::before{content:"\f103"}.category-adder{margin-left:120px;padding:4px 0}.category-adder h4{margin:0 0 8px}#side-sortables .category-adder{margin:0}.categorydiv div.tabs-panel,.customlinkdiv div.tabs-panel,.posttypediv div.tabs-panel,.taxonomydiv div.tabs-panel,.wp-tab-panel{min-height:42px;max-height:200px;overflow:auto;padding:0 .9em;border:solid 1px #ddd;background-color:#fdfdfd}div.tabs-panel-active{display:block}div.tabs-panel-inactive{display:none}#front-page-warning,#front-static-pages ul,.categorydiv ul.categorychecklist ul,.customlinkdiv ul.categorychecklist ul,.inline-editor ul.cat-checklist ul,.posttypediv ul.categorychecklist ul,.taxonomydiv ul.categorychecklist ul,ul.export-filters{margin-left:18px}ul.categorychecklist li{margin:0;padding:0;line-height:22px;word-wrap:break-word}.categorydiv .tabs-panel,.customlinkdiv .tabs-panel,.posttypediv .tabs-panel,.taxonomydiv .tabs-panel{border-width:3px;border-style:solid}.form-wrap label{display:block;padding:2px 0}.form-field input[type=email],.form-field input[type=number],.form-field input[type=password],.form-field input[type=search],.form-field input[type=tel],.form-field input[type=text],.form-field input[type=url],.form-field textarea{border-style:solid;border-width:1px;width:95%}.form-wrap p,p.description{margin:2px 0 5px;color:#666}.form-wrap p,p.description,p.help,span.description{font-size:13px;font-style:italic}.form-wrap .form-field{margin:1em 0;padding:0}.form-wrap .form-field #parent{max-width:100%}.col-wrap h2{margin:12px 0;font-size:1.1em}.col-wrap p.submit{margin-top:-10px}.edit-term-notes{margin-top:2em}#poststuff .tagsdiv .ajaxtag{margin-top:1em}#poststuff .tagsdiv .howto{margin:1em 0 6px 0}.ajaxtag .newtag{position:relative}.tagsdiv .newtag{width:180px}.tagsdiv .the-tags{display:block;height:60px;margin:0 auto;overflow:auto;width:260px}#post-body-content .tagsdiv .the-tags{margin:0 5px}p.popular-tags{border:none;line-height:2em;padding:8px 12px 12px;text-align:justify}p.popular-tags a{padding:0 3px}.tagcloud{width:97%;margin:0 0 40px;text-align:justify}.tagcloud h2{margin:2px 0 12px}.the-tagcloud ul{margin:0}.the-tagcloud ul li{display:inline-block}.ac_results{display:none;margin:-1px 0 0;padding:0;list-style:none;position:absolute;z-index:10000;border:1px solid #5b9dd9;background-color:#fff}.wp-customizer .ac_results{z-index:500000}.ac_results li{margin:0;padding:5px 10px;white-space:nowrap;text-align:left}.ac_over .ac_match,.ac_results .ac_over{background-color:#0073aa;color:#fff;cursor:pointer}.ac_match{text-decoration:underline}#edittag{max-width:800px}.edit-tag-actions{margin-top:20px}.comment-php .wp-editor-area{height:200px}.comment-ays td,.comment-ays th{padding:10px 15px}.comment-ays .comment-content ul{list-style:initial;margin-left:2em}.comment-ays .comment-content a[href]:after{content:"(" attr(href) ")";display:inline-block;padding:0 4px;color:#72777c;font-size:13px;word-break:break-all}.comment-ays .comment-content p.edit-comment{margin-top:10px}.comment-ays .comment-content p.edit-comment a[href]:after{content:"";padding:0}.comment-ays-submit .button-cancel{margin-left:1em}.spam-undo-inside,.trash-undo-inside{margin:1px 8px 1px 0;line-height:16px}.spam-undo-inside .avatar,.trash-undo-inside .avatar{height:20px;width:20px;margin-right:8px;vertical-align:middle}.stuffbox .editcomment{clear:none;margin-top:0}#namediv.stuffbox .editcomment input{width:100%}#namediv.stuffbox .editcomment.form-table td{padding:10px}#comment-status-radio p{margin:3px 0 5px}#comment-status-radio input{margin:2px 3px 5px 0;vertical-align:middle}#comment-status-radio label{padding:5px 0}table.links-table{width:100%;border-spacing:0}.links-table th{font-weight:400;text-align:left;vertical-align:top;min-width:80px;width:20%;word-wrap:break-word}.links-table td,.links-table th{padding:5px 0}.links-table td label{margin-right:8px}.links-table td input[type=text],.links-table td textarea{width:100%}.links-table #link_rel{max-width:280px}#qt_content_dfw{display:none}.wp-editor-expand #qt_content_dfw{display:inline-block}.focus-on #screen-meta,.focus-on #screen-meta-links,.focus-on #wp-toolbar,.focus-on #wpfooter,.focus-on .page-title-action,.focus-on .postbox-container>*,.focus-on .update-nag,.focus-on .wrap>h1,.focus-on div.error,.focus-on div.notice,.focus-on div.updated{opacity:0;transition-duration:.6s;transition-property:opacity;transition-timing-function:ease-in-out}.focus-on #wp-toolbar{opacity:.3}.focus-off #screen-meta,.focus-off #screen-meta-links,.focus-off #wp-toolbar,.focus-off #wpfooter,.focus-off .page-title-action,.focus-off .postbox-container>*,.focus-off .update-nag,.focus-off .wrap>h1,.focus-off div.error,.focus-off div.notice,.focus-off div.updated{opacity:1;transition-duration:.2s;transition-property:opacity;transition-timing-function:ease-in-out}.focus-off #wp-toolbar{-webkit-transform:translate(0,0)}.focus-on #adminmenuback,.focus-on #adminmenuwrap{transition-duration:.6s;transition-property:transform;transition-timing-function:ease-in-out}.focus-on #adminmenuback,.focus-on #adminmenuwrap{transform:translateX(-100%)}.focus-off #adminmenuback,.focus-off #adminmenuwrap{transform:translateX(0);transition-duration:.2s;transition-property:transform;transition-timing-function:ease-in-out}@media print,(-webkit-min-device-pixel-ratio:1.25),(min-resolution:120dpi){#content-resize-handle,#post-body .wp_themeSkin .mceStatusbar a.mceResize{background:transparent url(../images/resize-2x.gif) no-repeat scroll right bottom;background-size:11px 11px}.rtl #content-resize-handle,.rtl #post-body .wp_themeSkin .mceStatusbar a.mceResize{background-image:url(../images/resize-rtl-2x.gif);background-position:left bottom}}@media only screen and (max-width:850px){#poststuff{min-width:0}#wpbody-content #poststuff #post-body{margin:0}#wpbody-content #post-body.columns-2 #postbox-container-1{margin-right:0;width:100%}#poststuff #postbox-container-1 #side-sortables:empty,#poststuff #postbox-container-1 .empty-container{border:0 none;height:0;min-height:0}#poststuff #post-body.columns-2 #side-sortables{min-height:0;width:auto}.columns-prefs,.screen-layout{display:none}}@media screen and (max-width:782px){.wp-core-ui .edit-tag-actions .button-primary{margin-bottom:0}#post-body-content{min-width:0}#titlediv #title-prompt-text{padding:10px 10px}#poststuff .stuffbox .inside{padding:0 2px 4px 0}#poststuff .stuffbox>h3,#poststuff h2,#poststuff h3.hndle{padding:12px}#namediv.stuffbox .editcomment.form-table td{padding:5px 10px}.post-format-options{padding-right:0}.post-format-options a{margin-right:5px;margin-bottom:5px;min-width:52px}.post-format-options .post-format-title{font-size:11px}.post-format-options a div{height:28px;width:28px}.post-format-options a div:before{font-size:26px!important}#post-visibility-select{line-height:280%}.wp-core-ui .save-post-visibility,.wp-core-ui .save-timestamp{vertical-align:middle;margin-right:15px}.timestamp-wrap select#mm{display:block;width:100%;margin-bottom:10px}.timestamp-wrap #aa,.timestamp-wrap #hh,.timestamp-wrap #jj,.timestamp-wrap #mn{padding:12px 3px;font-size:14px;margin-bottom:5px;width:auto;text-align:center}ul.category-tabs{margin:30px 0 15px}ul.category-tabs li.tabs{padding:15px}ul.categorychecklist li{margin-bottom:15px}ul.categorychecklist ul{margin-top:15px}.category-add input[type=text],.category-add select{max-width:none;margin-bottom:15px}.tagsdiv .newtag{width:100%;height:auto;margin-bottom:15px}.tagchecklist{margin:25px 10px}.tagchecklist>li{font-size:16px;line-height:1.4}#commentstatusdiv p{line-height:2.8}.mceToolbar *{white-space:normal!important}.mceToolbar td,.mceToolbar tr{float:left!important}.wp_themeSkin a.mceButton{width:30px;height:30px}.wp_themeSkin .mceButton .mceIcon{margin-top:5px;margin-left:5px}.wp_themeSkin .mceSplitButton{margin-top:1px}.wp_themeSkin .mceSplitButton td a.mceAction{padding-top:6px;padding-bottom:6px;padding-left:6px;padding-right:3px}.wp_themeSkin .mceSplitButton td a.mceOpen,.wp_themeSkin .mceSplitButtonEnabled:hover td a.mceOpen{padding-top:6px;padding-bottom:6px;background-position:1px 6px}.wp_themeSkin table.mceListBox{margin:5px}div.quicktags-toolbar input{padding:10px 20px}button.wp-switch-editor{font-size:16px;line-height:1em;margin:7px 0 0 7px;padding:8px 12px}#wp-content-media-buttons a{font-size:14px;padding:6px 10px}.wp-media-buttons span.jetpack-contact-form-icon,.wp-media-buttons span.wp-media-buttons-icon{width:22px!important;margin-left:-2px!important}.wp-media-buttons #insert-jetpack-contact-form span.jetpack-contact-form-icon:before,.wp-media-buttons .add_media span.wp-media-buttons-icon:before{font-size:20px!important}#content_wp_fullscreen{display:none}.misc-pub-section{padding:20px 10px 20px}.misc-pub-section>a{float:right;font-size:16px}#delete-action,#publishing-action{line-height:47px}#publishing-action .spinner{float:none;margin-top:-2px}.comment-ays td,.comment-ays th{padding-bottom:0}.comment-ays td{padding-top:6px}.links-table #link_rel{max-width:none}.links-table td,.links-table th{padding:10px 0}.privacy-text-box{width:auto}.privacy-text-box-toc{float:none;width:auto;height:100%}.privacy-text-section a.return-to-top{float:none;margin:0}} \ No newline at end of file
diff --git a/www/crm/wp-admin/css/farbtastic-rtl.css b/www/crm/wp-admin/css/farbtastic-rtl.css
new file mode 100644
index 00000000..b7aebadc
--- /dev/null
+++ b/www/crm/wp-admin/css/farbtastic-rtl.css
@@ -0,0 +1,41 @@
+
+.farbtastic {
+ position: relative;
+}
+
+.farbtastic * {
+ position: absolute;
+ cursor: crosshair;
+}
+
+.farbtastic,
+.farbtastic .wheel {
+ width: 195px;
+ height: 195px;
+}
+
+.farbtastic .color,
+.farbtastic .overlay {
+ top: 47px;
+ right: 47px;
+ width: 101px;
+ height: 101px;
+}
+
+.farbtastic .wheel {
+ background: url(../images/wheel.png) no-repeat;
+ width: 195px;
+ height: 195px;
+}
+
+.farbtastic .overlay {
+ background: url(../images/mask.png) no-repeat;
+}
+
+.farbtastic .marker {
+ width: 17px;
+ height: 17px;
+ margin: -8px -8px 0 0;
+ overflow: hidden;
+ background: url(../images/marker.png) no-repeat;
+}
diff --git a/www/crm/wp-admin/css/farbtastic-rtl.min.css b/www/crm/wp-admin/css/farbtastic-rtl.min.css
new file mode 100644
index 00000000..26cc0c40
--- /dev/null
+++ b/www/crm/wp-admin/css/farbtastic-rtl.min.css
@@ -0,0 +1,2 @@
+/*! This file is auto-generated */
+.farbtastic{position:relative}.farbtastic *{position:absolute;cursor:crosshair}.farbtastic,.farbtastic .wheel{width:195px;height:195px}.farbtastic .color,.farbtastic .overlay{top:47px;right:47px;width:101px;height:101px}.farbtastic .wheel{background:url(../images/wheel.png) no-repeat;width:195px;height:195px}.farbtastic .overlay{background:url(../images/mask.png) no-repeat}.farbtastic .marker{width:17px;height:17px;margin:-8px -8px 0 0;overflow:hidden;background:url(../images/marker.png) no-repeat} \ No newline at end of file
diff --git a/www/crm/wp-admin/css/farbtastic.css b/www/crm/wp-admin/css/farbtastic.css
new file mode 100644
index 00000000..2bb73bfc
--- /dev/null
+++ b/www/crm/wp-admin/css/farbtastic.css
@@ -0,0 +1,41 @@
+
+.farbtastic {
+ position: relative;
+}
+
+.farbtastic * {
+ position: absolute;
+ cursor: crosshair;
+}
+
+.farbtastic,
+.farbtastic .wheel {
+ width: 195px;
+ height: 195px;
+}
+
+.farbtastic .color,
+.farbtastic .overlay {
+ top: 47px;
+ left: 47px;
+ width: 101px;
+ height: 101px;
+}
+
+.farbtastic .wheel {
+ background: url(../images/wheel.png) no-repeat;
+ width: 195px;
+ height: 195px;
+}
+
+.farbtastic .overlay {
+ background: url(../images/mask.png) no-repeat;
+}
+
+.farbtastic .marker {
+ width: 17px;
+ height: 17px;
+ margin: -8px 0 0 -8px;
+ overflow: hidden;
+ background: url(../images/marker.png) no-repeat;
+}
diff --git a/www/crm/wp-admin/css/farbtastic.min.css b/www/crm/wp-admin/css/farbtastic.min.css
new file mode 100644
index 00000000..e2768088
--- /dev/null
+++ b/www/crm/wp-admin/css/farbtastic.min.css
@@ -0,0 +1,2 @@
+/*! This file is auto-generated */
+.farbtastic{position:relative}.farbtastic *{position:absolute;cursor:crosshair}.farbtastic,.farbtastic .wheel{width:195px;height:195px}.farbtastic .color,.farbtastic .overlay{top:47px;left:47px;width:101px;height:101px}.farbtastic .wheel{background:url(../images/wheel.png) no-repeat;width:195px;height:195px}.farbtastic .overlay{background:url(../images/mask.png) no-repeat}.farbtastic .marker{width:17px;height:17px;margin:-8px 0 0 -8px;overflow:hidden;background:url(../images/marker.png) no-repeat} \ No newline at end of file
diff --git a/www/crm/wp-admin/css/forms-rtl.css b/www/crm/wp-admin/css/forms-rtl.css
new file mode 100644
index 00000000..e8e6cddd
--- /dev/null
+++ b/www/crm/wp-admin/css/forms-rtl.css
@@ -0,0 +1,1604 @@
+/* Include margin and padding in the width calculation of input and textarea. */
+input,
+textarea {
+ box-sizing: border-box;
+}
+
+input[type="text"],
+input[type="password"],
+input[type="checkbox"],
+input[type="color"],
+input[type="date"],
+input[type="datetime"],
+input[type="datetime-local"],
+input[type="email"],
+input[type="month"],
+input[type="number"],
+input[type="search"],
+input[type="radio"],
+input[type="tel"],
+input[type="text"],
+input[type="time"],
+input[type="url"],
+input[type="week"],
+select,
+textarea {
+ border: 1px solid #ddd;
+ box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.07);
+ background-color: #fff;
+ color: #32373c;
+ outline: none;
+ transition: 0.05s border-color ease-in-out;
+}
+
+input[type="text"]:focus,
+input[type="password"]:focus,
+input[type="color"]:focus,
+input[type="date"]:focus,
+input[type="datetime"]:focus,
+input[type="datetime-local"]:focus,
+input[type="email"]:focus,
+input[type="month"]:focus,
+input[type="number"]:focus,
+input[type="search"]:focus,
+input[type="tel"]:focus,
+input[type="text"]:focus,
+input[type="time"]:focus,
+input[type="url"]:focus,
+input[type="week"]:focus,
+input[type="checkbox"]:focus,
+input[type="radio"]:focus,
+select:focus,
+textarea:focus {
+ border-color: #5b9dd9;
+ box-shadow: 0 0 2px rgba(30, 140, 190, 0.8);
+ /* Only visible in Windows High Contrast mode */
+ outline: 2px solid transparent;
+}
+
+/* rtl:ignore */
+input[type="email"],
+input[type="url"] {
+ direction: ltr;
+}
+
+/* Vertically align the number selector with the input. */
+input[type="number"] {
+ height: 28px;
+ line-height: 1;
+}
+
+input[type="checkbox"],
+input[type="radio"] {
+ border: 1px solid #b4b9be;
+ background: #fff;
+ color: #555;
+ clear: none;
+ cursor: pointer;
+ display: inline-block;
+ line-height: 0;
+ height: 16px;
+ margin: -4px 0 0 4px;
+ outline: 0;
+ padding: 0 !important;
+ text-align: center;
+ vertical-align: middle;
+ width: 16px;
+ min-width: 16px;
+ -webkit-appearance: none;
+ box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
+ transition: .05s border-color ease-in-out;
+}
+
+input[type="radio"]:checked + label:before {
+ color: #82878c;
+}
+
+.wp-core-ui input[type="reset"]:hover,
+.wp-core-ui input[type="reset"]:active {
+ color: #00a0d2;
+}
+
+td > input[type="checkbox"],
+.wp-admin p input[type="checkbox"],
+.wp-admin p input[type="radio"] {
+ margin-top: 0;
+}
+
+.wp-admin p label input[type="checkbox"] {
+ margin-top: -4px;
+}
+
+.wp-admin p label input[type="radio"] {
+ margin-top: -2px;
+}
+
+input[type="radio"] {
+ border-radius: 50%;
+ margin-left: 4px;
+ line-height: 10px;
+}
+
+input[type="checkbox"]:checked:before,
+input[type="radio"]:checked:before {
+ float: right;
+ display: inline-block;
+ vertical-align: middle;
+ width: 16px;
+ font: normal 21px/1 dashicons;
+ speak: none;
+ -webkit-font-smoothing: antialiased;
+ -moz-osx-font-smoothing: grayscale;
+}
+
+input[type="checkbox"]:checked:before {
+ content: "\f147";
+ margin: -3px -4px 0 0;
+ color: #1e8cbe;
+}
+
+input[type="radio"]:checked:before {
+ content: "\2022";
+ text-indent: -9999px;
+ border-radius: 50px;
+ font-size: 24px;
+ width: 6px;
+ height: 6px;
+ margin: 4px;
+ line-height: 16px;
+ background-color: #1e8cbe;
+}
+
+@-moz-document url-prefix() {
+ input[type="checkbox"],
+ input[type="radio"],
+ .form-table input.tog {
+ margin-bottom: -1px;
+ }
+}
+
+/* Search */
+input[type="search"] {
+ -webkit-appearance: textfield;
+}
+
+input[type="search"]::-webkit-search-decoration {
+ display: none;
+}
+
+.ie8 input[type="password"] {
+ font-family: sans-serif;
+}
+
+textarea,
+input,
+select,
+button {
+ font-family: inherit;
+ font-size: inherit;
+ font-weight: inherit;
+}
+
+textarea,
+input,
+select {
+ font-size: 14px;
+ padding: 3px 5px;
+ border-radius: 0; /* Reset mobile webkit's default element styling */
+}
+
+textarea {
+ overflow: auto;
+ padding: 2px 6px;
+ line-height: 1.4;
+ resize: vertical;
+}
+
+.wp-admin input[type="file"] {
+ padding: 3px 0;
+ cursor: pointer;
+}
+
+label {
+ cursor: pointer;
+}
+
+input,
+select {
+ margin: 1px;
+ padding: 3px 5px;
+}
+
+input.code {
+ padding-top: 6px;
+}
+
+textarea.code {
+ line-height: 1.4;
+ padding: 4px 6px 1px 6px;
+}
+
+input.readonly,
+input[readonly],
+textarea.readonly,
+textarea[readonly] {
+ background-color: #eee;
+}
+
+::-webkit-input-placeholder {
+ color: #72777c;
+}
+
+::-moz-placeholder {
+ color: #72777c;
+ opacity: 1;
+}
+
+:-ms-input-placeholder {
+ color: #72777c;
+}
+
+.form-invalid input,
+.form-invalid input:focus,
+.form-invalid select,
+.form-invalid select:focus {
+ border-color: #dc3232 !important;
+ box-shadow: 0 0 2px rgba(204, 0, 0, 0.8);
+}
+
+.form-table .form-required.form-invalid td:after {
+ content: "\f534";
+ font: normal 20px/1 dashicons;
+ color: #dc3232;
+ margin-right: -25px;
+ vertical-align: middle;
+}
+
+/* Adjust error indicator for password layout */
+.form-table .form-required.user-pass1-wrap.form-invalid td:after {
+ content: "";
+}
+
+.form-table .form-required.user-pass1-wrap.form-invalid .password-input-wrapper:after {
+ content: "\f534";
+ font: normal 20px/1 dashicons;
+ color: #dc3232;
+ margin: 0 -29px 0 6px;
+ vertical-align: middle;
+}
+
+.form-input-tip {
+ color: #666;
+}
+
+input:disabled,
+input.disabled,
+select:disabled,
+select.disabled,
+textarea:disabled,
+textarea.disabled {
+ background: rgba(255, 255, 255, 0.5);
+ border-color: rgba(222, 222, 222, 0.75);
+ box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.04);
+ color: rgba(51, 51, 51, 0.5);
+}
+
+input[type="file"]:disabled,
+input[type="file"].disabled,
+input[type="range"]:disabled,
+input[type="range"].disabled {
+ background: none;
+ box-shadow: none;
+ cursor: default;
+}
+
+input[type="checkbox"]:disabled,
+input[type="checkbox"].disabled,
+input[type="radio"]:disabled,
+input[type="radio"].disabled,
+input[type="checkbox"]:disabled:checked:before,
+input[type="checkbox"].disabled:checked:before,
+input[type="radio"]:disabled:checked:before,
+input[type="radio"].disabled:checked:before {
+ opacity: 0.7;
+}
+
+/*------------------------------------------------------------------------------
+ 2.0 - Forms
+------------------------------------------------------------------------------*/
+
+
+.wp-admin select {
+ padding: 2px;
+ line-height: 28px;
+ height: 28px;
+ vertical-align: middle;
+}
+
+.wp-admin .button-cancel {
+ padding: 0 5px;
+ line-height: 2;
+}
+
+.meta-box-sortables select {
+ max-width: 100%;
+}
+
+.wp-admin select[multiple] {
+ height: auto;
+}
+
+.submit {
+ padding: 1.5em 0;
+ margin: 5px 0;
+ border-bottom-right-radius: 3px;
+ border-bottom-left-radius: 3px;
+ border: none;
+}
+
+form p.submit a.cancel:hover {
+ text-decoration: none;
+}
+
+p.submit {
+ text-align: right;
+ max-width: 100%;
+ margin-top: 20px;
+ padding-top: 10px;
+}
+
+.textright p.submit {
+ border: none;
+ text-align: left;
+}
+
+table.form-table + p.submit,
+table.form-table + input + p.submit,
+table.form-table + input + input + p.submit {
+ border-top: none;
+ padding-top: 0;
+}
+
+#minor-publishing-actions input,
+#major-publishing-actions input,
+#minor-publishing-actions .preview {
+ text-align: center;
+}
+
+textarea.all-options,
+input.all-options {
+ width: 250px;
+}
+
+input.large-text,
+textarea.large-text {
+ width: 99%;
+}
+
+.regular-text {
+ width: 25em;
+}
+
+input.small-text {
+ width: 50px;
+ padding: 1px 6px;
+}
+
+input[type="number"].small-text {
+ width: 65px;
+}
+
+input.tiny-text {
+ width: 35px;
+}
+
+input[type="number"].tiny-text {
+ width: 45px;
+}
+
+#doaction,
+#doaction2,
+#post-query-submit {
+ margin: 1px 0 0 8px;
+}
+
+.tablenav #changeit,
+.tablenav #delete_all,
+.tablenav #clear-recent-list,
+.wp-filter #delete_all {
+ margin-top: 1px;
+}
+
+.tablenav .actions select {
+ float: right;
+ margin-left: 6px;
+ max-width: 200px;
+}
+
+.ie8 .tablenav .actions select {
+ width: 155px;
+}
+
+.ie8 .tablenav .actions select#cat {
+ width: 200px;
+}
+
+#timezone_string option {
+ margin-right: 1em;
+}
+
+.wp-hide-pw > .dashicons,
+.wp-cancel-pw > .dashicons {
+ position: relative;
+ top: 3px;
+}
+
+.wp-cancel-pw .dashicons-no {
+ display: none;
+}
+
+label,
+#your-profile label + a {
+ vertical-align: middle;
+}
+
+fieldset label,
+#your-profile label + a {
+ vertical-align: middle;
+}
+
+.options-media-php [for*="_size_"] {
+ min-width: 10em;
+ vertical-align: baseline;
+}
+
+.options-media-php .small-text[name*="_size_"] {
+ margin: 0 0 1em;
+}
+
+#misc-publishing-actions label {
+ vertical-align: baseline;
+}
+
+#pass-strength-result {
+ background-color: #eee;
+ border: 1px solid #ddd;
+ color: #23282d;
+ margin: -1px 1px 5px;
+ padding: 3px 5px;
+ text-align: center;
+ width: 25em;
+ box-sizing: border-box;
+ opacity: 0;
+}
+
+#pass-strength-result.short {
+ background-color: #f1adad;
+ border-color: #e35b5b;
+ opacity: 1;
+}
+
+#pass-strength-result.bad {
+ background-color: #fbc5a9;
+ border-color: #f78b53;
+ opacity: 1;
+}
+
+#pass-strength-result.good {
+ background-color: #ffe399;
+ border-color: #ffc733;
+ opacity: 1;
+}
+
+#pass-strength-result.strong {
+ background-color: #c1e1b9;
+ border-color: #83c373;
+ opacity: 1;
+}
+
+#pass1.short, #pass1-text.short {
+ border-color: #e35b5b;
+}
+
+#pass1.bad, #pass1-text.bad {
+ border-color: #f78b53;
+}
+
+#pass1.good, #pass1-text.good {
+ border-color: #ffc733;
+}
+
+#pass1.strong, #pass1-text.strong {
+ border-color: #83c373;
+}
+
+.pw-weak {
+ display: none;
+}
+
+.indicator-hint {
+ padding-top: 8px;
+}
+
+.wp-pwd [type="text"],
+.wp-pwd [type="password"] {
+ margin-bottom: 0;
+ /* Same height as the buttons */
+ line-height: 20px;
+ min-height: 28px;
+ max-height: 40px;
+}
+
+#pass1-text,
+.show-password #pass1 {
+ display: none;
+}
+
+#pass1-text::-ms-clear {
+ display: none;
+}
+
+.show-password #pass1-text {
+ display: inline-block;
+}
+
+p.search-box {
+ float: left;
+ margin: 0;
+}
+
+.network-admin.themes-php p.search-box {
+ clear: right;
+}
+
+.search-box input[name="s"],
+.tablenav .search-plugins input[name="s"],
+.tagsdiv .newtag {
+ float: right;
+ height: 28px;
+ margin: 0 0 0 4px;
+}
+
+.js.plugins-php .search-box .wp-filter-search {
+ margin: 0;
+ width: 280px;
+ font-size: 16px;
+ font-weight: 300;
+ line-height: 1.5;
+ padding: 3px 5px;
+ height: 32px;
+}
+
+input[type="text"].ui-autocomplete-loading,
+input[type="email"].ui-autocomplete-loading {
+ background-image: url(../images/loading.gif);
+ background-repeat: no-repeat;
+ background-position: left center;
+ visibility: visible;
+}
+
+input.ui-autocomplete-input.open {
+ border-bottom-color: transparent;
+}
+
+ul#add-to-blog-users {
+ margin: 0 14px 0 0;
+}
+
+.ui-autocomplete {
+ padding: 0;
+ margin: 0;
+ list-style: none;
+ position: absolute;
+ z-index: 10000;
+ border: 1px solid #5b9dd9;
+ box-shadow: 0 1px 2px rgba(30, 140, 190, 0.8);
+ background-color: #fff;
+}
+
+.ui-autocomplete li {
+ margin-bottom: 0;
+ padding: 4px 10px;
+ white-space: nowrap;
+ text-align: right;
+ cursor: pointer;
+}
+
+/* Colors for the wplink toolbar autocomplete. */
+.ui-autocomplete .ui-state-focus {
+ background-color: #ddd;
+}
+
+/* Colors for the tags autocomplete. */
+.wp-tags-autocomplete .ui-state-focus {
+ background-color: #0073aa;
+ color: #fff;
+}
+
+/*------------------------------------------------------------------------------
+ 15.0 - Comments Screen
+------------------------------------------------------------------------------*/
+
+.form-table {
+ border-collapse: collapse;
+ margin-top: 0.5em;
+ width: 100%;
+ clear: both;
+}
+
+.form-table,
+.form-table td,
+.form-table th,
+.form-table td p {
+ font-size: 14px;
+}
+
+.form-table td {
+ margin-bottom: 9px;
+ padding: 15px 10px;
+ line-height: 1.3;
+ vertical-align: middle;
+}
+
+.form-table th,
+.form-wrap label {
+ color: #23282d;
+ font-weight: 400;
+ text-shadow: none;
+ vertical-align: baseline;
+}
+
+.form-table th {
+ vertical-align: top;
+ text-align: right;
+ padding: 20px 0 20px 10px;
+ width: 200px;
+ line-height: 1.3;
+ font-weight: 600;
+}
+
+.form-table th.th-full, /* Not used by core. Back-compat for pre-4.8 */
+.form-table .td-full {
+ width: auto;
+ padding: 20px 0 20px 10px;
+ font-weight: 400;
+}
+
+.form-table td p {
+ margin-top: 4px;
+ margin-bottom: 0;
+}
+
+.form-table .date-time-doc {
+ margin-top: 1em;
+}
+
+.form-table p.timezone-info {
+ margin: 1em 0;
+}
+
+.form-table td fieldset label {
+ margin: 0.25em 0 0.5em !important;
+ display: inline-block;
+}
+
+.form-table td fieldset label,
+.form-table td fieldset p,
+.form-table td fieldset li {
+ line-height: 1.4em;
+}
+
+.form-table input.tog,
+.form-table input[type="radio"] {
+ margin-top: -4px;
+ margin-left: 4px;
+ float: none;
+}
+
+.form-table .pre {
+ padding: 8px;
+ margin: 0;
+}
+
+table.form-table td .updated {
+ font-size: 13px;
+}
+
+table.form-table td .updated p {
+ font-size: 13px;
+ margin: 0.3em 0;
+}
+
+/*------------------------------------------------------------------------------
+ 18.0 - Users
+------------------------------------------------------------------------------*/
+
+#profile-page .form-table textarea {
+ width: 500px;
+ margin-bottom: 6px;
+}
+
+#profile-page .form-table #rich_editing {
+ margin-left: 5px
+}
+
+#your-profile legend {
+ font-size: 22px;
+}
+
+#display_name {
+ width: 15em;
+}
+
+#adduser .form-field input,
+#createuser .form-field input {
+ width: 25em;
+}
+
+.color-option {
+ display: inline-block;
+ width: 24%;
+ padding: 5px 15px 15px;
+ box-sizing: border-box;
+ margin-bottom: 3px;
+}
+
+.color-option:hover,
+.color-option.selected {
+ background: #ddd;
+}
+
+.color-palette {
+ width: 100%;
+ border-spacing: 0;
+ border-collapse: collapse;
+}
+.color-palette td {
+ height: 20px;
+ padding: 0;
+ border: none;
+}
+
+.color-option {
+ cursor: pointer;
+}
+
+/*------------------------------------------------------------------------------
+ 19.0 - Tools
+------------------------------------------------------------------------------*/
+
+.tool-box .title {
+ margin: 8px 0;
+ font-size: 18px;
+ font-weight: 400;
+ line-height: 24px;
+}
+
+.label-responsive {
+ vertical-align: middle;
+}
+
+#export-filters p {
+ margin: 0 0 1em;
+}
+
+#export-filters p.submit {
+ margin: 7px 0 5px;
+}
+
+/* Card styles */
+
+.card {
+ position: relative;
+ margin-top: 20px;
+ padding: 0.7em 2em 1em;
+ min-width: 255px;
+ max-width: 520px;
+ border: 1px solid #e5e5e5;
+ box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
+ background: #fff;
+ box-sizing: border-box;
+}
+
+/* Press this styles */
+
+.pressthis h4 {
+ margin: 2em 0 1em;
+}
+
+.pressthis textarea {
+ width: 100%;
+ font-size: 1em;
+}
+
+#pressthis-code-wrap {
+ overflow: auto;
+}
+
+.pressthis-bookmarklet-wrapper {
+ margin: 20px 0 8px;
+ vertical-align: top;
+ position: relative;
+ z-index: 1;
+}
+
+.pressthis-bookmarklet,
+.pressthis-bookmarklet:hover,
+.pressthis-bookmarklet:focus,
+.pressthis-bookmarklet:active {
+ display: inline-block;
+ position: relative;
+ cursor: move;
+ color: #32373c;
+ background: #e5e5e5;
+ border-radius: 5px;
+ border: 1px solid #b4b9be;
+ font-style: normal;
+ line-height: 16px;
+ font-size: 14px;
+ text-decoration: none;
+}
+
+.pressthis-bookmarklet:active {
+ outline: none;
+}
+
+.pressthis-bookmarklet:after {
+ content: "";
+ width: 70%;
+ height: 55%;
+ z-index: -1;
+ position: absolute;
+ left: 10px;
+ bottom: 9px;
+ background: transparent;
+ transform: skew(-20deg) rotate(-6deg);
+ box-shadow: 0 10px 8px rgba(0, 0, 0, 0.6);
+}
+
+.pressthis-bookmarklet:hover:after {
+ transform: skew(-20deg) rotate(-9deg);
+ box-shadow: 0 10px 8px rgba(0, 0, 0, 0.7);
+}
+
+.pressthis-bookmarklet span {
+ display: inline-block;
+ margin: 0px 0 0;
+ padding: 0px 9px 8px 12px;
+}
+
+.pressthis-bookmarklet span:before {
+ color: #72777c;
+ font: normal 20px/1 dashicons;
+ content: "\f157";
+ position: relative;
+ display: inline-block;
+ top: 4px;
+ margin-left: 4px;
+}
+
+.pressthis-js-toggle {
+ margin-right: 10px;
+ padding: 0;
+ height: auto;
+ vertical-align: top;
+}
+
+/* to override the button class being applied */
+.pressthis-js-toggle.button.button {
+ margin-right: 10px;
+ padding: 0;
+ height: auto;
+ vertical-align: top;
+}
+
+.pressthis-js-toggle .dashicons {
+ margin: 5px 7px 6px 8px;
+ color: #555d66;
+}
+
+/*------------------------------------------------------------------------------
+ 20.0 - Settings
+------------------------------------------------------------------------------*/
+
+.timezone-info code {
+ white-space: nowrap;
+}
+
+.defaultavatarpicker .avatar {
+ margin: 2px 0;
+ vertical-align: middle;
+}
+
+.options-general-php .date-time-text {
+ display: inline-block;
+ min-width: 10em;
+}
+
+.options-general-php input.small-text {
+ width: 56px;
+}
+
+.options-general-php .spinner {
+ float: none;
+ margin: -3px 3px 0;
+}
+
+.settings-php .language-install-spinner,
+.options-general-php .language-install-spinner {
+ display: inline-block;
+ float: none;
+ margin: -3px 5px 0;
+ vertical-align: middle;
+}
+
+.form-table.permalink-structure .available-structure-tags li {
+ float: right;
+ margin-left: 5px;
+}
+
+/*------------------------------------------------------------------------------
+ 21.0 - Network Admin
+------------------------------------------------------------------------------*/
+
+.setup-php textarea {
+ max-width: 100%;
+}
+
+.form-field #site-address {
+ max-width: 25em;
+}
+
+.form-field #domain {
+ max-width: 22em;
+}
+
+.form-field #site-title,
+.form-field #admin-email,
+.form-field #path,
+.form-field #blog_registered,
+.form-field #blog_last_updated {
+ max-width: 25em;
+}
+
+.form-field #path {
+ margin-bottom: 5px;
+}
+
+#search-users,
+#search-sites {
+ max-width: 100%;
+}
+
+/*------------------------------------------------------------------------------
+ Credentials check dialog for Install and Updates
+------------------------------------------------------------------------------*/
+
+.request-filesystem-credentials-dialog {
+ display: none;
+ /* The customizer uses visibility: hidden on the body for full-overlays. */
+ visibility: visible;
+}
+
+.request-filesystem-credentials-dialog .notification-dialog {
+ top: 10%;
+ max-height: 85%;
+}
+
+.request-filesystem-credentials-dialog-content {
+ margin: 25px;
+}
+
+#request-filesystem-credentials-title {
+ font-size: 1.3em;
+ margin: 1em 0;
+}
+
+.request-filesystem-credentials-form legend {
+ font-size: 1em;
+ padding: 1.33em 0;
+ font-weight: 600;
+}
+
+.request-filesystem-credentials-form input[type="text"],
+.request-filesystem-credentials-form input[type="password"] {
+ display: block;
+}
+
+.request-filesystem-credentials-dialog input[type="text"],
+.request-filesystem-credentials-dialog input[type="password"] {
+ width: 100%;
+}
+
+.request-filesystem-credentials-form .field-title {
+ font-weight: 600;
+}
+
+.request-filesystem-credentials-dialog label[for="hostname"],
+.request-filesystem-credentials-dialog label[for="public_key"],
+.request-filesystem-credentials-dialog label[for="private_key"] {
+ display: block;
+ margin-bottom: 1em;
+}
+
+.request-filesystem-credentials-dialog .ftp-username,
+.request-filesystem-credentials-dialog .ftp-password {
+ float: right;
+ width: 48%;
+}
+
+.request-filesystem-credentials-dialog .ftp-password {
+ margin-right: 4%;
+}
+
+.request-filesystem-credentials-dialog .request-filesystem-credentials-action-buttons {
+ text-align: left;
+}
+
+.request-filesystem-credentials-dialog label[for="ftp"] {
+ margin-left: 10px;
+}
+
+.request-filesystem-credentials-dialog #auth-keys-desc {
+ margin-bottom: 0;
+}
+
+#request-filesystem-credentials-dialog .button:not(:last-child) {
+ margin-left: 10px;
+}
+
+#request-filesystem-credentials-form .cancel-button {
+ display: none;
+}
+
+#request-filesystem-credentials-dialog .cancel-button {
+ display: inline;
+}
+
+.request-filesystem-credentials-dialog .ftp-username,
+.request-filesystem-credentials-dialog .ftp-password {
+ float: none;
+ width: auto;
+}
+
+.request-filesystem-credentials-dialog .ftp-username {
+ margin-bottom: 1em;
+}
+
+.request-filesystem-credentials-dialog .ftp-password {
+ margin: 0;
+}
+
+.request-filesystem-credentials-dialog .ftp-password em {
+ color: #888;
+}
+
+.request-filesystem-credentials-dialog label {
+ display: block;
+ line-height: 1.5;
+ margin-bottom: 1em;
+}
+
+.request-filesystem-credentials-form legend {
+ padding-bottom: 0;
+}
+
+.request-filesystem-credentials-form #ssh-keys legend {
+ font-size: 1.3em;
+}
+
+.request-filesystem-credentials-form .notice {
+ margin: 0 0 20px 0;
+ clear: both;
+}
+
+/*------------------------------------------------------------------------------
+ Privacy Policy settings screen
+------------------------------------------------------------------------------*/
+.tools-privacy-policy-page form {
+ margin-bottom: 1.3em;
+}
+
+.tools-privacy-policy-page input.button,
+.tools-privacy-policy-page select {
+ margin-right: 6px;
+}
+
+.tools-privacy-edit {
+ margin: 1.5em 0;
+}
+
+.tools-privacy-policy-page span {
+ line-height: 2em;
+}
+
+.privacy_requests .column-email {
+ width: 40%;
+}
+
+.privacy_requests .column-type {
+ text-align: center;
+}
+
+.privacy_requests thead td:first-child,
+.privacy_requests tfoot td:first-child {
+ border-right: 4px solid #fff;
+}
+
+.privacy_requests tbody th {
+ border-right: 4px solid #fff;
+ background: #fff;
+ box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.1);
+}
+
+.privacy_requests tbody .has-request-results th {
+ box-shadow: none;
+}
+
+.privacy_requests tbody .request-results th .notice {
+ margin: 0 0 5px;
+}
+
+.privacy_requests tbody td {
+ background: #fff;
+ box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.1);
+}
+
+.privacy_requests tbody .has-request-results td {
+ box-shadow: none;
+}
+
+.privacy_requests .next_steps .button {
+ height: auto;
+ line-height: 1.5;
+ padding: 4px 10px;
+ word-break: break-all;
+ white-space: unset;
+}
+
+.privacy_requests .status-request-confirmed th,
+.privacy_requests .status-request-confirmed td {
+ background-color: #f7fcfe;
+ border-right-color: #00a0d2;
+}
+
+.privacy_requests .status-request-failed th,
+.privacy_requests .status-request-failed td {
+ background-color: #fef7f1;
+ border-right-color: #d64d21;
+}
+
+.privacy_requests .export_personal_data_failed a {
+ vertical-align: baseline;
+}
+
+.status-label {
+ font-weight: 600;
+}
+
+.status-label.status-request-pending {
+ font-weight: 400;
+ font-style: italic;
+ color: #6c7781;
+}
+
+.status-label.status-request-failed {
+ color: #aa0000;
+ font-weight: 600;
+}
+
+.wp-privacy-request-form {
+ clear: both;
+}
+
+.wp-privacy-request-form-field {
+ margin: 1.5em 0;
+}
+
+.wp-privacy-request-form label {
+ font-weight: 600;
+ line-height: 1.5;
+ padding-bottom: .5em;
+ display: block;
+}
+
+.wp-privacy-request-form input {
+ line-height: 1.5;
+ margin: 0;
+}
+
+.email-personal-data::before {
+ display: inline-block;
+ font: normal 20px/1 dashicons;
+ margin: 3px -2px 0 5px;
+ speak: none;
+ -webkit-font-smoothing: antialiased;
+ -moz-osx-font-smoothing: grayscale;
+ vertical-align: top;
+}
+
+.email-personal-data--sending::before {
+ color: #f56e28;
+ content: "\f463";
+ animation: rotation 2s infinite linear;
+}
+
+.email-personal-data--sent::before {
+ color: #79ba49;
+ content: "\f147";
+}
+
+
+/* =Media Queries
+-------------------------------------------------------------- */
+
+@media screen and (max-width: 782px) {
+ /* Input Elements */
+ textarea {
+ -webkit-appearance: none;
+ }
+
+ input[type="text"],
+ input[type="email"],
+ input[type="search"],
+ input[type="password"],
+ input[type="number"] {
+ -webkit-appearance: none;
+ padding: 6px 10px;
+ }
+
+ input[type="number"] {
+ height: 40px;
+ }
+
+ input.code {
+ padding-bottom: 5px;
+ padding-top: 10px;
+ }
+
+ input[type="checkbox"],
+ .widefat th input[type="checkbox"],
+ .widefat thead td input[type="checkbox"],
+ .widefat tfoot td input[type="checkbox"] {
+ -webkit-appearance: none;
+ padding: 10px;
+ }
+
+ .widefat th input[type="checkbox"],
+ .widefat thead td input[type="checkbox"],
+ .widefat tfoot td input[type="checkbox"] {
+ margin-bottom: 8px;
+ }
+
+ input[type="checkbox"]:checked:before,
+ .widefat th input[type="checkbox"]:before,
+ .widefat thead td input[type="checkbox"]:before,
+ .widefat tfoot td input[type="checkbox"]:before {
+ font: normal 30px/1 dashicons;
+ margin: -3px -5px;
+ }
+
+ input[type="radio"],
+ input[type="checkbox"] {
+ height: 25px;
+ width: 25px;
+ }
+
+ .wp-admin p input[type="checkbox"],
+ .wp-admin p input[type="radio"] {
+ margin-top: -3px;
+ }
+
+ input[type="radio"]:checked:before {
+ vertical-align: middle;
+ width: 9px;
+ height: 9px;
+ margin: 7px;
+ line-height: 16px;
+ }
+
+ .wp-upload-form input[type="submit"] {
+ margin-top: 10px;
+ }
+
+ #wpbody select {
+ height: 36px;
+ font-size: 16px;
+ }
+
+ .wp-admin .button-cancel {
+ padding: 0;
+ font-size: 14px;
+ }
+
+ #adduser .form-field input,
+ #createuser .form-field input {
+ width: 100%;
+ }
+
+ .form-table {
+ box-sizing: border-box;
+ }
+
+ .form-table th,
+ .form-table td,
+ .label-responsive {
+ display: block;
+ width: auto;
+ vertical-align: middle;
+ }
+
+ .label-responsive {
+ margin: 0.5em 0;
+ }
+
+ .export-filters li {
+ margin-bottom: 0;
+ }
+
+ .form-table .color-palette td {
+ display: table-cell;
+ width: 15px;
+ }
+
+ .form-table table.color-palette {
+ margin-left: 10px;
+ }
+
+ textarea,
+ input {
+ font-size: 16px;
+ }
+
+ .form-table td input[type="text"],
+ .form-table td input[type="email"],
+ .form-table td input[type="password"],
+ .form-table td select,
+ .form-table td textarea,
+ .form-table span.description,
+ #profile-page .form-table textarea {
+ width: 100%;
+ font-size: 16px;
+ line-height: 1.5;
+ padding: 7px 10px;
+ display: block;
+ max-width: none;
+ box-sizing: border-box;
+ }
+
+ .form-table .form-required.form-invalid td:after {
+ float: left;
+ margin: -30px 0 0 3px;
+ }
+
+ #wpbody .form-table td select {
+ height: 40px;
+ }
+
+ input[type="text"].small-text,
+ input[type="search"].small-text,
+ input[type="password"].small-text,
+ input[type="number"].small-text,
+ input[type="number"].small-text,
+ .form-table input[type="text"].small-text {
+ width: auto;
+ max-width: 4.375em; /* 70px, enough for 4 digits to fit comfortably */
+ display: inline;
+ padding: 3px 6px;
+ margin: 0 3px;
+ }
+
+ #pass-strength-result {
+ width: 100%;
+ box-sizing: border-box;
+ padding: 8px;
+ }
+
+ p.search-box {
+ float: none;
+ position: absolute;
+ bottom: 0;
+ width: 98%;
+ height: 90px;
+ margin-bottom: 20px;
+ }
+
+ p.search-box input[name="s"] {
+ height: auto;
+ float: none;
+ width: 100%;
+ margin-bottom: 10px;
+ vertical-align: middle;
+ -webkit-appearance: none;
+ }
+
+ p.search-box input[type="submit"] {
+ margin-bottom: 10px;
+ }
+
+ .form-table span.description {
+ display: inline;
+ padding: 4px 0 0;
+ line-height: 1.4em;
+ font-size: 14px;
+ }
+
+ .form-table th {
+ padding-top: 10px;
+ padding-bottom: 0;
+ border-bottom: 0;
+ }
+
+ .form-table td {
+ margin-bottom: 0;
+ padding-bottom: 6px;
+ padding-top: 4px;
+ padding-right: 0;
+ }
+
+ .form-table.permalink-structure td code {
+ margin-right: 32px;
+ }
+
+ .form-table.permalink-structure td input[type="text"] {
+ margin-right: 32px;
+ margin-top: 4px;
+ width: 96%;
+ }
+
+ .form-table input.regular-text {
+ width: 100%;
+ }
+
+ .form-table label {
+ font-size: 14px;
+ }
+
+ .form-table fieldset label {
+ display: block;
+ }
+
+ #utc-time,
+ #local-time {
+ display: block;
+ float: none;
+ margin-top: 0.5em;
+ }
+
+ .form-field #domain {
+ max-width: none;
+ }
+
+ /* New Password */
+ .wp-pwd {
+ position: relative;
+ }
+
+ .wp-pwd [type="text"],
+ .wp-pwd [type="password"] {
+ padding-left: 88px;
+ }
+
+ .wp-pwd button.button {
+ background: transparent;
+ border: 1px solid transparent;
+ box-shadow: none;
+ line-height: 2;
+ margin: 0;
+ padding: 5px 9px;
+ position: absolute;
+ left: 0;
+ top: 0;
+ }
+
+ .wp-pwd button.wp-hide-pw {
+ left: 40px;
+ }
+
+ .wp-pwd button.button:hover,
+ .wp-pwd button.button:focus {
+ background: transparent;
+ }
+
+ .wp-pwd button.button:active {
+ background: transparent;
+ box-shadow: none;
+ transform: none;
+ }
+
+ .wp-pwd .button .text {
+ display: none;
+ }
+
+ .wp-cancel-pw .dashicons-no {
+ display: inline-block;
+ }
+
+ .options-general-php input[type="text"].small-text {
+ max-width: 6.25em;
+ margin: 0;
+ }
+
+ /* Privacy Policy settings screen */
+ .tools-privacy-policy-page form.wp-create-privacy-page {
+ margin-bottom: 1em;
+ }
+
+ .tools-privacy-policy-page input#set-page,
+ .tools-privacy-policy-page select {
+ margin: 10px 0 0;
+ }
+
+ .tools-privacy-policy-page .wp-create-privacy-page span {
+ display: block;
+ margin-bottom: 1em;
+ }
+
+ .tools-privacy-policy-page .wp-create-privacy-page .button {
+ margin-right: 0;
+ }
+
+ .wp-list-table.privacy_requests tr:not(.inline-edit-row):not(.no-items) td.column-primary:not(.check-column) {
+ display: table-cell;
+ }
+
+ .wp-list-table.privacy_requests.widefat th input,
+ .wp-list-table.privacy_requests.widefat thead td input {
+ margin-right: 5px;
+ }
+ .regular-text {
+ max-width: 100%;
+ }
+}
+
+@media only screen and (max-width: 768px) {
+ .form-field input[type="text"],
+ .form-field input[type="email"],
+ .form-field input[type="password"],
+ .form-field select,
+ .form-field textarea {
+ width: 99%;
+ }
+
+ .form-wrap .form-field {
+ padding: 0;
+ }
+}
+
+@media only screen and (max-height: 480px), screen and (max-width: 450px) {
+ /* Request Credentials / File Editor Warning */
+ .request-filesystem-credentials-dialog .notification-dialog,
+ .file-editor-warning .notification-dialog {
+ width: 100%;
+ height: 100%;
+ max-height: 100%;
+ position: fixed;
+ top: 0;
+ margin: 0;
+ right: 0;
+ }
+}
+
+/* Smartphone */
+@media screen and (max-width: 600px) {
+ /* Color Picker Options */
+ .color-option {
+ width: 49%;
+ }
+}
+
+@media only screen and (max-width: 320px) {
+ .options-general-php .date-time-text.date-time-custom-text {
+ min-width: 0;
+ margin-left: 0.5em;
+ }
+}
+
+@keyframes rotation {
+ 0% {
+ transform: rotate(0deg);
+ }
+ 100% {
+ transform: rotate(-359deg);
+ }
+}
diff --git a/www/crm/wp-admin/css/forms-rtl.min.css b/www/crm/wp-admin/css/forms-rtl.min.css
new file mode 100644
index 00000000..5652d509
--- /dev/null
+++ b/www/crm/wp-admin/css/forms-rtl.min.css
@@ -0,0 +1,2 @@
+/*! This file is auto-generated */
+input,textarea{box-sizing:border-box}input[type=checkbox],input[type=color],input[type=date],input[type=datetime-local],input[type=datetime],input[type=email],input[type=month],input[type=number],input[type=password],input[type=radio],input[type=search],input[type=tel],input[type=text],input[type=time],input[type=url],input[type=week],select,textarea{border:1px solid #ddd;box-shadow:inset 0 1px 2px rgba(0,0,0,.07);background-color:#fff;color:#32373c;outline:0;transition:50ms border-color ease-in-out}input[type=checkbox]:focus,input[type=color]:focus,input[type=date]:focus,input[type=datetime-local]:focus,input[type=datetime]:focus,input[type=email]:focus,input[type=month]:focus,input[type=number]:focus,input[type=password]:focus,input[type=radio]:focus,input[type=search]:focus,input[type=tel]:focus,input[type=text]:focus,input[type=time]:focus,input[type=url]:focus,input[type=week]:focus,select:focus,textarea:focus{border-color:#5b9dd9;box-shadow:0 0 2px rgba(30,140,190,.8);outline:2px solid transparent}input[type=email],input[type=url]{direction:ltr}input[type=number]{height:28px;line-height:1}input[type=checkbox],input[type=radio]{border:1px solid #b4b9be;background:#fff;color:#555;clear:none;cursor:pointer;display:inline-block;line-height:0;height:16px;margin:-4px 0 0 4px;outline:0;padding:0!important;text-align:center;vertical-align:middle;width:16px;min-width:16px;-webkit-appearance:none;box-shadow:inset 0 1px 2px rgba(0,0,0,.1);transition:.05s border-color ease-in-out}input[type=radio]:checked+label:before{color:#82878c}.wp-core-ui input[type=reset]:active,.wp-core-ui input[type=reset]:hover{color:#00a0d2}.wp-admin p input[type=checkbox],.wp-admin p input[type=radio],td>input[type=checkbox]{margin-top:0}.wp-admin p label input[type=checkbox]{margin-top:-4px}.wp-admin p label input[type=radio]{margin-top:-2px}input[type=radio]{border-radius:50%;margin-left:4px;line-height:10px}input[type=checkbox]:checked:before,input[type=radio]:checked:before{float:right;display:inline-block;vertical-align:middle;width:16px;font:normal 21px/1 dashicons;speak:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}input[type=checkbox]:checked:before{content:"\f147";margin:-3px -4px 0 0;color:#1e8cbe}input[type=radio]:checked:before{content:"\2022";text-indent:-9999px;border-radius:50px;font-size:24px;width:6px;height:6px;margin:4px;line-height:16px;background-color:#1e8cbe}@-moz-document url-prefix(){.form-table input.tog,input[type=checkbox],input[type=radio]{margin-bottom:-1px}}input[type=search]{-webkit-appearance:textfield}input[type=search]::-webkit-search-decoration{display:none}.ie8 input[type=password]{font-family:sans-serif}button,input,select,textarea{font-family:inherit;font-size:inherit;font-weight:inherit}input,select,textarea{font-size:14px;padding:3px 5px;border-radius:0}textarea{overflow:auto;padding:2px 6px;line-height:1.4;resize:vertical}.wp-admin input[type=file]{padding:3px 0;cursor:pointer}label{cursor:pointer}input,select{margin:1px;padding:3px 5px}input.code{padding-top:6px}textarea.code{line-height:1.4;padding:4px 6px 1px 6px}input.readonly,input[readonly],textarea.readonly,textarea[readonly]{background-color:#eee}::-webkit-input-placeholder{color:#72777c}::-moz-placeholder{color:#72777c;opacity:1}:-ms-input-placeholder{color:#72777c}.form-invalid input,.form-invalid input:focus,.form-invalid select,.form-invalid select:focus{border-color:#dc3232!important;box-shadow:0 0 2px rgba(204,0,0,.8)}.form-table .form-required.form-invalid td:after{content:"\f534";font:normal 20px/1 dashicons;color:#dc3232;margin-right:-25px;vertical-align:middle}.form-table .form-required.user-pass1-wrap.form-invalid td:after{content:""}.form-table .form-required.user-pass1-wrap.form-invalid .password-input-wrapper:after{content:"\f534";font:normal 20px/1 dashicons;color:#dc3232;margin:0 -29px 0 6px;vertical-align:middle}.form-input-tip{color:#666}input.disabled,input:disabled,select.disabled,select:disabled,textarea.disabled,textarea:disabled{background:rgba(255,255,255,.5);border-color:rgba(222,222,222,.75);box-shadow:inset 0 1px 2px rgba(0,0,0,.04);color:rgba(51,51,51,.5)}input[type=file].disabled,input[type=file]:disabled,input[type=range].disabled,input[type=range]:disabled{background:0 0;box-shadow:none;cursor:default}input[type=checkbox].disabled,input[type=checkbox].disabled:checked:before,input[type=checkbox]:disabled,input[type=checkbox]:disabled:checked:before,input[type=radio].disabled,input[type=radio].disabled:checked:before,input[type=radio]:disabled,input[type=radio]:disabled:checked:before{opacity:.7}.wp-admin select{padding:2px;line-height:28px;height:28px;vertical-align:middle}.wp-admin .button-cancel{padding:0 5px;line-height:2}.meta-box-sortables select{max-width:100%}.wp-admin select[multiple]{height:auto}.submit{padding:1.5em 0;margin:5px 0;border-bottom-right-radius:3px;border-bottom-left-radius:3px;border:none}form p.submit a.cancel:hover{text-decoration:none}p.submit{text-align:right;max-width:100%;margin-top:20px;padding-top:10px}.textright p.submit{border:none;text-align:left}table.form-table+input+input+p.submit,table.form-table+input+p.submit,table.form-table+p.submit{border-top:none;padding-top:0}#major-publishing-actions input,#minor-publishing-actions .preview,#minor-publishing-actions input{text-align:center}input.all-options,textarea.all-options{width:250px}input.large-text,textarea.large-text{width:99%}.regular-text{width:25em}input.small-text{width:50px;padding:1px 6px}input[type=number].small-text{width:65px}input.tiny-text{width:35px}input[type=number].tiny-text{width:45px}#doaction,#doaction2,#post-query-submit{margin:1px 0 0 8px}.tablenav #changeit,.tablenav #clear-recent-list,.tablenav #delete_all,.wp-filter #delete_all{margin-top:1px}.tablenav .actions select{float:right;margin-left:6px;max-width:200px}.ie8 .tablenav .actions select{width:155px}.ie8 .tablenav .actions select#cat{width:200px}#timezone_string option{margin-right:1em}.wp-cancel-pw>.dashicons,.wp-hide-pw>.dashicons{position:relative;top:3px}.wp-cancel-pw .dashicons-no{display:none}#your-profile label+a,label{vertical-align:middle}#your-profile label+a,fieldset label{vertical-align:middle}.options-media-php [for*="_size_"]{min-width:10em;vertical-align:baseline}.options-media-php .small-text[name*="_size_"]{margin:0 0 1em}#misc-publishing-actions label{vertical-align:baseline}#pass-strength-result{background-color:#eee;border:1px solid #ddd;color:#23282d;margin:-1px 1px 5px;padding:3px 5px;text-align:center;width:25em;box-sizing:border-box;opacity:0}#pass-strength-result.short{background-color:#f1adad;border-color:#e35b5b;opacity:1}#pass-strength-result.bad{background-color:#fbc5a9;border-color:#f78b53;opacity:1}#pass-strength-result.good{background-color:#ffe399;border-color:#ffc733;opacity:1}#pass-strength-result.strong{background-color:#c1e1b9;border-color:#83c373;opacity:1}#pass1-text.short,#pass1.short{border-color:#e35b5b}#pass1-text.bad,#pass1.bad{border-color:#f78b53}#pass1-text.good,#pass1.good{border-color:#ffc733}#pass1-text.strong,#pass1.strong{border-color:#83c373}.pw-weak{display:none}.indicator-hint{padding-top:8px}.wp-pwd [type=password],.wp-pwd [type=text]{margin-bottom:0;line-height:20px;min-height:28px;max-height:40px}#pass1-text,.show-password #pass1{display:none}#pass1-text::-ms-clear{display:none}.show-password #pass1-text{display:inline-block}p.search-box{float:left;margin:0}.network-admin.themes-php p.search-box{clear:right}.search-box input[name="s"],.tablenav .search-plugins input[name="s"],.tagsdiv .newtag{float:right;height:28px;margin:0 0 0 4px}.js.plugins-php .search-box .wp-filter-search{margin:0;width:280px;font-size:16px;font-weight:300;line-height:1.5;padding:3px 5px;height:32px}input[type=email].ui-autocomplete-loading,input[type=text].ui-autocomplete-loading{background-image:url(../images/loading.gif);background-repeat:no-repeat;background-position:left center;visibility:visible}input.ui-autocomplete-input.open{border-bottom-color:transparent}ul#add-to-blog-users{margin:0 14px 0 0}.ui-autocomplete{padding:0;margin:0;list-style:none;position:absolute;z-index:10000;border:1px solid #5b9dd9;box-shadow:0 1px 2px rgba(30,140,190,.8);background-color:#fff}.ui-autocomplete li{margin-bottom:0;padding:4px 10px;white-space:nowrap;text-align:right;cursor:pointer}.ui-autocomplete .ui-state-focus{background-color:#ddd}.wp-tags-autocomplete .ui-state-focus{background-color:#0073aa;color:#fff}.form-table{border-collapse:collapse;margin-top:.5em;width:100%;clear:both}.form-table,.form-table td,.form-table td p,.form-table th{font-size:14px}.form-table td{margin-bottom:9px;padding:15px 10px;line-height:1.3;vertical-align:middle}.form-table th,.form-wrap label{color:#23282d;font-weight:400;text-shadow:none;vertical-align:baseline}.form-table th{vertical-align:top;text-align:right;padding:20px 0 20px 10px;width:200px;line-height:1.3;font-weight:600}.form-table .td-full,.form-table th.th-full{width:auto;padding:20px 0 20px 10px;font-weight:400}.form-table td p{margin-top:4px;margin-bottom:0}.form-table .date-time-doc{margin-top:1em}.form-table p.timezone-info{margin:1em 0}.form-table td fieldset label{margin:.25em 0 .5em!important;display:inline-block}.form-table td fieldset label,.form-table td fieldset li,.form-table td fieldset p{line-height:1.4em}.form-table input.tog,.form-table input[type=radio]{margin-top:-4px;margin-left:4px;float:none}.form-table .pre{padding:8px;margin:0}table.form-table td .updated{font-size:13px}table.form-table td .updated p{font-size:13px;margin:.3em 0}#profile-page .form-table textarea{width:500px;margin-bottom:6px}#profile-page .form-table #rich_editing{margin-left:5px}#your-profile legend{font-size:22px}#display_name{width:15em}#adduser .form-field input,#createuser .form-field input{width:25em}.color-option{display:inline-block;width:24%;padding:5px 15px 15px;box-sizing:border-box;margin-bottom:3px}.color-option.selected,.color-option:hover{background:#ddd}.color-palette{width:100%;border-spacing:0;border-collapse:collapse}.color-palette td{height:20px;padding:0;border:none}.color-option{cursor:pointer}.tool-box .title{margin:8px 0;font-size:18px;font-weight:400;line-height:24px}.label-responsive{vertical-align:middle}#export-filters p{margin:0 0 1em}#export-filters p.submit{margin:7px 0 5px}.card{position:relative;margin-top:20px;padding:.7em 2em 1em;min-width:255px;max-width:520px;border:1px solid #e5e5e5;box-shadow:0 1px 1px rgba(0,0,0,.04);background:#fff;box-sizing:border-box}.pressthis h4{margin:2em 0 1em}.pressthis textarea{width:100%;font-size:1em}#pressthis-code-wrap{overflow:auto}.pressthis-bookmarklet-wrapper{margin:20px 0 8px;vertical-align:top;position:relative;z-index:1}.pressthis-bookmarklet,.pressthis-bookmarklet:active,.pressthis-bookmarklet:focus,.pressthis-bookmarklet:hover{display:inline-block;position:relative;cursor:move;color:#32373c;background:#e5e5e5;border-radius:5px;border:1px solid #b4b9be;font-style:normal;line-height:16px;font-size:14px;text-decoration:none}.pressthis-bookmarklet:active{outline:0}.pressthis-bookmarklet:after{content:"";width:70%;height:55%;z-index:-1;position:absolute;left:10px;bottom:9px;background:0 0;transform:skew(-20deg) rotate(-6deg);box-shadow:0 10px 8px rgba(0,0,0,.6)}.pressthis-bookmarklet:hover:after{transform:skew(-20deg) rotate(-9deg);box-shadow:0 10px 8px rgba(0,0,0,.7)}.pressthis-bookmarklet span{display:inline-block;margin:0 0 0;padding:0 9px 8px 12px}.pressthis-bookmarklet span:before{color:#72777c;font:normal 20px/1 dashicons;content:"\f157";position:relative;display:inline-block;top:4px;margin-left:4px}.pressthis-js-toggle{margin-right:10px;padding:0;height:auto;vertical-align:top}.pressthis-js-toggle.button.button{margin-right:10px;padding:0;height:auto;vertical-align:top}.pressthis-js-toggle .dashicons{margin:5px 7px 6px 8px;color:#555d66}.timezone-info code{white-space:nowrap}.defaultavatarpicker .avatar{margin:2px 0;vertical-align:middle}.options-general-php .date-time-text{display:inline-block;min-width:10em}.options-general-php input.small-text{width:56px}.options-general-php .spinner{float:none;margin:-3px 3px 0}.options-general-php .language-install-spinner,.settings-php .language-install-spinner{display:inline-block;float:none;margin:-3px 5px 0;vertical-align:middle}.form-table.permalink-structure .available-structure-tags li{float:right;margin-left:5px}.setup-php textarea{max-width:100%}.form-field #site-address{max-width:25em}.form-field #domain{max-width:22em}.form-field #admin-email,.form-field #blog_last_updated,.form-field #blog_registered,.form-field #path,.form-field #site-title{max-width:25em}.form-field #path{margin-bottom:5px}#search-sites,#search-users{max-width:100%}.request-filesystem-credentials-dialog{display:none;visibility:visible}.request-filesystem-credentials-dialog .notification-dialog{top:10%;max-height:85%}.request-filesystem-credentials-dialog-content{margin:25px}#request-filesystem-credentials-title{font-size:1.3em;margin:1em 0}.request-filesystem-credentials-form legend{font-size:1em;padding:1.33em 0;font-weight:600}.request-filesystem-credentials-form input[type=password],.request-filesystem-credentials-form input[type=text]{display:block}.request-filesystem-credentials-dialog input[type=password],.request-filesystem-credentials-dialog input[type=text]{width:100%}.request-filesystem-credentials-form .field-title{font-weight:600}.request-filesystem-credentials-dialog label[for=hostname],.request-filesystem-credentials-dialog label[for=private_key],.request-filesystem-credentials-dialog label[for=public_key]{display:block;margin-bottom:1em}.request-filesystem-credentials-dialog .ftp-password,.request-filesystem-credentials-dialog .ftp-username{float:right;width:48%}.request-filesystem-credentials-dialog .ftp-password{margin-right:4%}.request-filesystem-credentials-dialog .request-filesystem-credentials-action-buttons{text-align:left}.request-filesystem-credentials-dialog label[for=ftp]{margin-left:10px}.request-filesystem-credentials-dialog #auth-keys-desc{margin-bottom:0}#request-filesystem-credentials-dialog .button:not(:last-child){margin-left:10px}#request-filesystem-credentials-form .cancel-button{display:none}#request-filesystem-credentials-dialog .cancel-button{display:inline}.request-filesystem-credentials-dialog .ftp-password,.request-filesystem-credentials-dialog .ftp-username{float:none;width:auto}.request-filesystem-credentials-dialog .ftp-username{margin-bottom:1em}.request-filesystem-credentials-dialog .ftp-password{margin:0}.request-filesystem-credentials-dialog .ftp-password em{color:#888}.request-filesystem-credentials-dialog label{display:block;line-height:1.5;margin-bottom:1em}.request-filesystem-credentials-form legend{padding-bottom:0}.request-filesystem-credentials-form #ssh-keys legend{font-size:1.3em}.request-filesystem-credentials-form .notice{margin:0 0 20px 0;clear:both}.tools-privacy-policy-page form{margin-bottom:1.3em}.tools-privacy-policy-page input.button,.tools-privacy-policy-page select{margin-right:6px}.tools-privacy-edit{margin:1.5em 0}.tools-privacy-policy-page span{line-height:2em}.privacy_requests .column-email{width:40%}.privacy_requests .column-type{text-align:center}.privacy_requests tfoot td:first-child,.privacy_requests thead td:first-child{border-right:4px solid #fff}.privacy_requests tbody th{border-right:4px solid #fff;background:#fff;box-shadow:inset 0 -1px 0 rgba(0,0,0,.1)}.privacy_requests tbody .has-request-results th{box-shadow:none}.privacy_requests tbody .request-results th .notice{margin:0 0 5px}.privacy_requests tbody td{background:#fff;box-shadow:inset 0 -1px 0 rgba(0,0,0,.1)}.privacy_requests tbody .has-request-results td{box-shadow:none}.privacy_requests .next_steps .button{height:auto;line-height:1.5;padding:4px 10px;word-break:break-all;white-space:unset}.privacy_requests .status-request-confirmed td,.privacy_requests .status-request-confirmed th{background-color:#f7fcfe;border-right-color:#00a0d2}.privacy_requests .status-request-failed td,.privacy_requests .status-request-failed th{background-color:#fef7f1;border-right-color:#d64d21}.privacy_requests .export_personal_data_failed a{vertical-align:baseline}.status-label{font-weight:600}.status-label.status-request-pending{font-weight:400;font-style:italic;color:#6c7781}.status-label.status-request-failed{color:#a00;font-weight:600}.wp-privacy-request-form{clear:both}.wp-privacy-request-form-field{margin:1.5em 0}.wp-privacy-request-form label{font-weight:600;line-height:1.5;padding-bottom:.5em;display:block}.wp-privacy-request-form input{line-height:1.5;margin:0}.email-personal-data::before{display:inline-block;font:normal 20px/1 dashicons;margin:3px -2px 0 5px;speak:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;vertical-align:top}.email-personal-data--sending::before{color:#f56e28;content:"\f463";animation:rotation 2s infinite linear}.email-personal-data--sent::before{color:#79ba49;content:"\f147"}@media screen and (max-width:782px){textarea{-webkit-appearance:none}input[type=email],input[type=number],input[type=password],input[type=search],input[type=text]{-webkit-appearance:none;padding:6px 10px}input[type=number]{height:40px}input.code{padding-bottom:5px;padding-top:10px}.widefat tfoot td input[type=checkbox],.widefat th input[type=checkbox],.widefat thead td input[type=checkbox],input[type=checkbox]{-webkit-appearance:none;padding:10px}.widefat tfoot td input[type=checkbox],.widefat th input[type=checkbox],.widefat thead td input[type=checkbox]{margin-bottom:8px}.widefat tfoot td input[type=checkbox]:before,.widefat th input[type=checkbox]:before,.widefat thead td input[type=checkbox]:before,input[type=checkbox]:checked:before{font:normal 30px/1 dashicons;margin:-3px -5px}input[type=checkbox],input[type=radio]{height:25px;width:25px}.wp-admin p input[type=checkbox],.wp-admin p input[type=radio]{margin-top:-3px}input[type=radio]:checked:before{vertical-align:middle;width:9px;height:9px;margin:7px;line-height:16px}.wp-upload-form input[type=submit]{margin-top:10px}#wpbody select{height:36px;font-size:16px}.wp-admin .button-cancel{padding:0;font-size:14px}#adduser .form-field input,#createuser .form-field input{width:100%}.form-table{box-sizing:border-box}.form-table td,.form-table th,.label-responsive{display:block;width:auto;vertical-align:middle}.label-responsive{margin:.5em 0}.export-filters li{margin-bottom:0}.form-table .color-palette td{display:table-cell;width:15px}.form-table table.color-palette{margin-left:10px}input,textarea{font-size:16px}#profile-page .form-table textarea,.form-table span.description,.form-table td input[type=email],.form-table td input[type=password],.form-table td input[type=text],.form-table td select,.form-table td textarea{width:100%;font-size:16px;line-height:1.5;padding:7px 10px;display:block;max-width:none;box-sizing:border-box}.form-table .form-required.form-invalid td:after{float:left;margin:-30px 0 0 3px}#wpbody .form-table td select{height:40px}.form-table input[type=text].small-text,input[type=number].small-text,input[type=password].small-text,input[type=search].small-text,input[type=text].small-text{width:auto;max-width:4.375em;display:inline;padding:3px 6px;margin:0 3px}#pass-strength-result{width:100%;box-sizing:border-box;padding:8px}p.search-box{float:none;position:absolute;bottom:0;width:98%;height:90px;margin-bottom:20px}p.search-box input[name="s"]{height:auto;float:none;width:100%;margin-bottom:10px;vertical-align:middle;-webkit-appearance:none}p.search-box input[type=submit]{margin-bottom:10px}.form-table span.description{display:inline;padding:4px 0 0;line-height:1.4em;font-size:14px}.form-table th{padding-top:10px;padding-bottom:0;border-bottom:0}.form-table td{margin-bottom:0;padding-bottom:6px;padding-top:4px;padding-right:0}.form-table.permalink-structure td code{margin-right:32px}.form-table.permalink-structure td input[type=text]{margin-right:32px;margin-top:4px;width:96%}.form-table input.regular-text{width:100%}.form-table label{font-size:14px}.form-table fieldset label{display:block}#local-time,#utc-time{display:block;float:none;margin-top:.5em}.form-field #domain{max-width:none}.wp-pwd{position:relative}.wp-pwd [type=password],.wp-pwd [type=text]{padding-left:88px}.wp-pwd button.button{background:0 0;border:1px solid transparent;box-shadow:none;line-height:2;margin:0;padding:5px 9px;position:absolute;left:0;top:0}.wp-pwd button.wp-hide-pw{left:40px}.wp-pwd button.button:focus,.wp-pwd button.button:hover{background:0 0}.wp-pwd button.button:active{background:0 0;box-shadow:none;transform:none}.wp-pwd .button .text{display:none}.wp-cancel-pw .dashicons-no{display:inline-block}.options-general-php input[type=text].small-text{max-width:6.25em;margin:0}.tools-privacy-policy-page form.wp-create-privacy-page{margin-bottom:1em}.tools-privacy-policy-page input#set-page,.tools-privacy-policy-page select{margin:10px 0 0}.tools-privacy-policy-page .wp-create-privacy-page span{display:block;margin-bottom:1em}.tools-privacy-policy-page .wp-create-privacy-page .button{margin-right:0}.wp-list-table.privacy_requests tr:not(.inline-edit-row):not(.no-items) td.column-primary:not(.check-column){display:table-cell}.wp-list-table.privacy_requests.widefat th input,.wp-list-table.privacy_requests.widefat thead td input{margin-right:5px}.regular-text{max-width:100%}}@media only screen and (max-width:768px){.form-field input[type=email],.form-field input[type=password],.form-field input[type=text],.form-field select,.form-field textarea{width:99%}.form-wrap .form-field{padding:0}}@media only screen and (max-height:480px),screen and (max-width:450px){.file-editor-warning .notification-dialog,.request-filesystem-credentials-dialog .notification-dialog{width:100%;height:100%;max-height:100%;position:fixed;top:0;margin:0;right:0}}@media screen and (max-width:600px){.color-option{width:49%}}@media only screen and (max-width:320px){.options-general-php .date-time-text.date-time-custom-text{min-width:0;margin-left:.5em}}@keyframes rotation{0%{transform:rotate(0)}100%{transform:rotate(-359deg)}} \ No newline at end of file
diff --git a/www/crm/wp-admin/css/forms.css b/www/crm/wp-admin/css/forms.css
new file mode 100644
index 00000000..9c608785
--- /dev/null
+++ b/www/crm/wp-admin/css/forms.css
@@ -0,0 +1,1604 @@
+/* Include margin and padding in the width calculation of input and textarea. */
+input,
+textarea {
+ box-sizing: border-box;
+}
+
+input[type="text"],
+input[type="password"],
+input[type="checkbox"],
+input[type="color"],
+input[type="date"],
+input[type="datetime"],
+input[type="datetime-local"],
+input[type="email"],
+input[type="month"],
+input[type="number"],
+input[type="search"],
+input[type="radio"],
+input[type="tel"],
+input[type="text"],
+input[type="time"],
+input[type="url"],
+input[type="week"],
+select,
+textarea {
+ border: 1px solid #ddd;
+ box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.07);
+ background-color: #fff;
+ color: #32373c;
+ outline: none;
+ transition: 0.05s border-color ease-in-out;
+}
+
+input[type="text"]:focus,
+input[type="password"]:focus,
+input[type="color"]:focus,
+input[type="date"]:focus,
+input[type="datetime"]:focus,
+input[type="datetime-local"]:focus,
+input[type="email"]:focus,
+input[type="month"]:focus,
+input[type="number"]:focus,
+input[type="search"]:focus,
+input[type="tel"]:focus,
+input[type="text"]:focus,
+input[type="time"]:focus,
+input[type="url"]:focus,
+input[type="week"]:focus,
+input[type="checkbox"]:focus,
+input[type="radio"]:focus,
+select:focus,
+textarea:focus {
+ border-color: #5b9dd9;
+ box-shadow: 0 0 2px rgba(30, 140, 190, 0.8);
+ /* Only visible in Windows High Contrast mode */
+ outline: 2px solid transparent;
+}
+
+/* rtl:ignore */
+input[type="email"],
+input[type="url"] {
+ direction: ltr;
+}
+
+/* Vertically align the number selector with the input. */
+input[type="number"] {
+ height: 28px;
+ line-height: 1;
+}
+
+input[type="checkbox"],
+input[type="radio"] {
+ border: 1px solid #b4b9be;
+ background: #fff;
+ color: #555;
+ clear: none;
+ cursor: pointer;
+ display: inline-block;
+ line-height: 0;
+ height: 16px;
+ margin: -4px 4px 0 0;
+ outline: 0;
+ padding: 0 !important;
+ text-align: center;
+ vertical-align: middle;
+ width: 16px;
+ min-width: 16px;
+ -webkit-appearance: none;
+ box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
+ transition: .05s border-color ease-in-out;
+}
+
+input[type="radio"]:checked + label:before {
+ color: #82878c;
+}
+
+.wp-core-ui input[type="reset"]:hover,
+.wp-core-ui input[type="reset"]:active {
+ color: #00a0d2;
+}
+
+td > input[type="checkbox"],
+.wp-admin p input[type="checkbox"],
+.wp-admin p input[type="radio"] {
+ margin-top: 0;
+}
+
+.wp-admin p label input[type="checkbox"] {
+ margin-top: -4px;
+}
+
+.wp-admin p label input[type="radio"] {
+ margin-top: -2px;
+}
+
+input[type="radio"] {
+ border-radius: 50%;
+ margin-right: 4px;
+ line-height: 10px;
+}
+
+input[type="checkbox"]:checked:before,
+input[type="radio"]:checked:before {
+ float: left;
+ display: inline-block;
+ vertical-align: middle;
+ width: 16px;
+ font: normal 21px/1 dashicons;
+ speak: none;
+ -webkit-font-smoothing: antialiased;
+ -moz-osx-font-smoothing: grayscale;
+}
+
+input[type="checkbox"]:checked:before {
+ content: "\f147";
+ margin: -3px 0 0 -4px;
+ color: #1e8cbe;
+}
+
+input[type="radio"]:checked:before {
+ content: "\2022";
+ text-indent: -9999px;
+ border-radius: 50px;
+ font-size: 24px;
+ width: 6px;
+ height: 6px;
+ margin: 4px;
+ line-height: 16px;
+ background-color: #1e8cbe;
+}
+
+@-moz-document url-prefix() {
+ input[type="checkbox"],
+ input[type="radio"],
+ .form-table input.tog {
+ margin-bottom: -1px;
+ }
+}
+
+/* Search */
+input[type="search"] {
+ -webkit-appearance: textfield;
+}
+
+input[type="search"]::-webkit-search-decoration {
+ display: none;
+}
+
+.ie8 input[type="password"] {
+ font-family: sans-serif;
+}
+
+textarea,
+input,
+select,
+button {
+ font-family: inherit;
+ font-size: inherit;
+ font-weight: inherit;
+}
+
+textarea,
+input,
+select {
+ font-size: 14px;
+ padding: 3px 5px;
+ border-radius: 0; /* Reset mobile webkit's default element styling */
+}
+
+textarea {
+ overflow: auto;
+ padding: 2px 6px;
+ line-height: 1.4;
+ resize: vertical;
+}
+
+.wp-admin input[type="file"] {
+ padding: 3px 0;
+ cursor: pointer;
+}
+
+label {
+ cursor: pointer;
+}
+
+input,
+select {
+ margin: 1px;
+ padding: 3px 5px;
+}
+
+input.code {
+ padding-top: 6px;
+}
+
+textarea.code {
+ line-height: 1.4;
+ padding: 4px 6px 1px 6px;
+}
+
+input.readonly,
+input[readonly],
+textarea.readonly,
+textarea[readonly] {
+ background-color: #eee;
+}
+
+::-webkit-input-placeholder {
+ color: #72777c;
+}
+
+::-moz-placeholder {
+ color: #72777c;
+ opacity: 1;
+}
+
+:-ms-input-placeholder {
+ color: #72777c;
+}
+
+.form-invalid input,
+.form-invalid input:focus,
+.form-invalid select,
+.form-invalid select:focus {
+ border-color: #dc3232 !important;
+ box-shadow: 0 0 2px rgba(204, 0, 0, 0.8);
+}
+
+.form-table .form-required.form-invalid td:after {
+ content: "\f534";
+ font: normal 20px/1 dashicons;
+ color: #dc3232;
+ margin-left: -25px;
+ vertical-align: middle;
+}
+
+/* Adjust error indicator for password layout */
+.form-table .form-required.user-pass1-wrap.form-invalid td:after {
+ content: "";
+}
+
+.form-table .form-required.user-pass1-wrap.form-invalid .password-input-wrapper:after {
+ content: "\f534";
+ font: normal 20px/1 dashicons;
+ color: #dc3232;
+ margin: 0 6px 0 -29px;
+ vertical-align: middle;
+}
+
+.form-input-tip {
+ color: #666;
+}
+
+input:disabled,
+input.disabled,
+select:disabled,
+select.disabled,
+textarea:disabled,
+textarea.disabled {
+ background: rgba(255, 255, 255, 0.5);
+ border-color: rgba(222, 222, 222, 0.75);
+ box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.04);
+ color: rgba(51, 51, 51, 0.5);
+}
+
+input[type="file"]:disabled,
+input[type="file"].disabled,
+input[type="range"]:disabled,
+input[type="range"].disabled {
+ background: none;
+ box-shadow: none;
+ cursor: default;
+}
+
+input[type="checkbox"]:disabled,
+input[type="checkbox"].disabled,
+input[type="radio"]:disabled,
+input[type="radio"].disabled,
+input[type="checkbox"]:disabled:checked:before,
+input[type="checkbox"].disabled:checked:before,
+input[type="radio"]:disabled:checked:before,
+input[type="radio"].disabled:checked:before {
+ opacity: 0.7;
+}
+
+/*------------------------------------------------------------------------------
+ 2.0 - Forms
+------------------------------------------------------------------------------*/
+
+
+.wp-admin select {
+ padding: 2px;
+ line-height: 28px;
+ height: 28px;
+ vertical-align: middle;
+}
+
+.wp-admin .button-cancel {
+ padding: 0 5px;
+ line-height: 2;
+}
+
+.meta-box-sortables select {
+ max-width: 100%;
+}
+
+.wp-admin select[multiple] {
+ height: auto;
+}
+
+.submit {
+ padding: 1.5em 0;
+ margin: 5px 0;
+ border-bottom-left-radius: 3px;
+ border-bottom-right-radius: 3px;
+ border: none;
+}
+
+form p.submit a.cancel:hover {
+ text-decoration: none;
+}
+
+p.submit {
+ text-align: left;
+ max-width: 100%;
+ margin-top: 20px;
+ padding-top: 10px;
+}
+
+.textright p.submit {
+ border: none;
+ text-align: right;
+}
+
+table.form-table + p.submit,
+table.form-table + input + p.submit,
+table.form-table + input + input + p.submit {
+ border-top: none;
+ padding-top: 0;
+}
+
+#minor-publishing-actions input,
+#major-publishing-actions input,
+#minor-publishing-actions .preview {
+ text-align: center;
+}
+
+textarea.all-options,
+input.all-options {
+ width: 250px;
+}
+
+input.large-text,
+textarea.large-text {
+ width: 99%;
+}
+
+.regular-text {
+ width: 25em;
+}
+
+input.small-text {
+ width: 50px;
+ padding: 1px 6px;
+}
+
+input[type="number"].small-text {
+ width: 65px;
+}
+
+input.tiny-text {
+ width: 35px;
+}
+
+input[type="number"].tiny-text {
+ width: 45px;
+}
+
+#doaction,
+#doaction2,
+#post-query-submit {
+ margin: 1px 8px 0 0;
+}
+
+.tablenav #changeit,
+.tablenav #delete_all,
+.tablenav #clear-recent-list,
+.wp-filter #delete_all {
+ margin-top: 1px;
+}
+
+.tablenav .actions select {
+ float: left;
+ margin-right: 6px;
+ max-width: 200px;
+}
+
+.ie8 .tablenav .actions select {
+ width: 155px;
+}
+
+.ie8 .tablenav .actions select#cat {
+ width: 200px;
+}
+
+#timezone_string option {
+ margin-left: 1em;
+}
+
+.wp-hide-pw > .dashicons,
+.wp-cancel-pw > .dashicons {
+ position: relative;
+ top: 3px;
+}
+
+.wp-cancel-pw .dashicons-no {
+ display: none;
+}
+
+label,
+#your-profile label + a {
+ vertical-align: middle;
+}
+
+fieldset label,
+#your-profile label + a {
+ vertical-align: middle;
+}
+
+.options-media-php [for*="_size_"] {
+ min-width: 10em;
+ vertical-align: baseline;
+}
+
+.options-media-php .small-text[name*="_size_"] {
+ margin: 0 0 1em;
+}
+
+#misc-publishing-actions label {
+ vertical-align: baseline;
+}
+
+#pass-strength-result {
+ background-color: #eee;
+ border: 1px solid #ddd;
+ color: #23282d;
+ margin: -1px 1px 5px;
+ padding: 3px 5px;
+ text-align: center;
+ width: 25em;
+ box-sizing: border-box;
+ opacity: 0;
+}
+
+#pass-strength-result.short {
+ background-color: #f1adad;
+ border-color: #e35b5b;
+ opacity: 1;
+}
+
+#pass-strength-result.bad {
+ background-color: #fbc5a9;
+ border-color: #f78b53;
+ opacity: 1;
+}
+
+#pass-strength-result.good {
+ background-color: #ffe399;
+ border-color: #ffc733;
+ opacity: 1;
+}
+
+#pass-strength-result.strong {
+ background-color: #c1e1b9;
+ border-color: #83c373;
+ opacity: 1;
+}
+
+#pass1.short, #pass1-text.short {
+ border-color: #e35b5b;
+}
+
+#pass1.bad, #pass1-text.bad {
+ border-color: #f78b53;
+}
+
+#pass1.good, #pass1-text.good {
+ border-color: #ffc733;
+}
+
+#pass1.strong, #pass1-text.strong {
+ border-color: #83c373;
+}
+
+.pw-weak {
+ display: none;
+}
+
+.indicator-hint {
+ padding-top: 8px;
+}
+
+.wp-pwd [type="text"],
+.wp-pwd [type="password"] {
+ margin-bottom: 0;
+ /* Same height as the buttons */
+ line-height: 20px;
+ min-height: 28px;
+ max-height: 40px;
+}
+
+#pass1-text,
+.show-password #pass1 {
+ display: none;
+}
+
+#pass1-text::-ms-clear {
+ display: none;
+}
+
+.show-password #pass1-text {
+ display: inline-block;
+}
+
+p.search-box {
+ float: right;
+ margin: 0;
+}
+
+.network-admin.themes-php p.search-box {
+ clear: left;
+}
+
+.search-box input[name="s"],
+.tablenav .search-plugins input[name="s"],
+.tagsdiv .newtag {
+ float: left;
+ height: 28px;
+ margin: 0 4px 0 0;
+}
+
+.js.plugins-php .search-box .wp-filter-search {
+ margin: 0;
+ width: 280px;
+ font-size: 16px;
+ font-weight: 300;
+ line-height: 1.5;
+ padding: 3px 5px;
+ height: 32px;
+}
+
+input[type="text"].ui-autocomplete-loading,
+input[type="email"].ui-autocomplete-loading {
+ background-image: url(../images/loading.gif);
+ background-repeat: no-repeat;
+ background-position: right center;
+ visibility: visible;
+}
+
+input.ui-autocomplete-input.open {
+ border-bottom-color: transparent;
+}
+
+ul#add-to-blog-users {
+ margin: 0 0 0 14px;
+}
+
+.ui-autocomplete {
+ padding: 0;
+ margin: 0;
+ list-style: none;
+ position: absolute;
+ z-index: 10000;
+ border: 1px solid #5b9dd9;
+ box-shadow: 0 1px 2px rgba(30, 140, 190, 0.8);
+ background-color: #fff;
+}
+
+.ui-autocomplete li {
+ margin-bottom: 0;
+ padding: 4px 10px;
+ white-space: nowrap;
+ text-align: left;
+ cursor: pointer;
+}
+
+/* Colors for the wplink toolbar autocomplete. */
+.ui-autocomplete .ui-state-focus {
+ background-color: #ddd;
+}
+
+/* Colors for the tags autocomplete. */
+.wp-tags-autocomplete .ui-state-focus {
+ background-color: #0073aa;
+ color: #fff;
+}
+
+/*------------------------------------------------------------------------------
+ 15.0 - Comments Screen
+------------------------------------------------------------------------------*/
+
+.form-table {
+ border-collapse: collapse;
+ margin-top: 0.5em;
+ width: 100%;
+ clear: both;
+}
+
+.form-table,
+.form-table td,
+.form-table th,
+.form-table td p {
+ font-size: 14px;
+}
+
+.form-table td {
+ margin-bottom: 9px;
+ padding: 15px 10px;
+ line-height: 1.3;
+ vertical-align: middle;
+}
+
+.form-table th,
+.form-wrap label {
+ color: #23282d;
+ font-weight: 400;
+ text-shadow: none;
+ vertical-align: baseline;
+}
+
+.form-table th {
+ vertical-align: top;
+ text-align: left;
+ padding: 20px 10px 20px 0;
+ width: 200px;
+ line-height: 1.3;
+ font-weight: 600;
+}
+
+.form-table th.th-full, /* Not used by core. Back-compat for pre-4.8 */
+.form-table .td-full {
+ width: auto;
+ padding: 20px 10px 20px 0;
+ font-weight: 400;
+}
+
+.form-table td p {
+ margin-top: 4px;
+ margin-bottom: 0;
+}
+
+.form-table .date-time-doc {
+ margin-top: 1em;
+}
+
+.form-table p.timezone-info {
+ margin: 1em 0;
+}
+
+.form-table td fieldset label {
+ margin: 0.25em 0 0.5em !important;
+ display: inline-block;
+}
+
+.form-table td fieldset label,
+.form-table td fieldset p,
+.form-table td fieldset li {
+ line-height: 1.4em;
+}
+
+.form-table input.tog,
+.form-table input[type="radio"] {
+ margin-top: -4px;
+ margin-right: 4px;
+ float: none;
+}
+
+.form-table .pre {
+ padding: 8px;
+ margin: 0;
+}
+
+table.form-table td .updated {
+ font-size: 13px;
+}
+
+table.form-table td .updated p {
+ font-size: 13px;
+ margin: 0.3em 0;
+}
+
+/*------------------------------------------------------------------------------
+ 18.0 - Users
+------------------------------------------------------------------------------*/
+
+#profile-page .form-table textarea {
+ width: 500px;
+ margin-bottom: 6px;
+}
+
+#profile-page .form-table #rich_editing {
+ margin-right: 5px
+}
+
+#your-profile legend {
+ font-size: 22px;
+}
+
+#display_name {
+ width: 15em;
+}
+
+#adduser .form-field input,
+#createuser .form-field input {
+ width: 25em;
+}
+
+.color-option {
+ display: inline-block;
+ width: 24%;
+ padding: 5px 15px 15px;
+ box-sizing: border-box;
+ margin-bottom: 3px;
+}
+
+.color-option:hover,
+.color-option.selected {
+ background: #ddd;
+}
+
+.color-palette {
+ width: 100%;
+ border-spacing: 0;
+ border-collapse: collapse;
+}
+.color-palette td {
+ height: 20px;
+ padding: 0;
+ border: none;
+}
+
+.color-option {
+ cursor: pointer;
+}
+
+/*------------------------------------------------------------------------------
+ 19.0 - Tools
+------------------------------------------------------------------------------*/
+
+.tool-box .title {
+ margin: 8px 0;
+ font-size: 18px;
+ font-weight: 400;
+ line-height: 24px;
+}
+
+.label-responsive {
+ vertical-align: middle;
+}
+
+#export-filters p {
+ margin: 0 0 1em;
+}
+
+#export-filters p.submit {
+ margin: 7px 0 5px;
+}
+
+/* Card styles */
+
+.card {
+ position: relative;
+ margin-top: 20px;
+ padding: 0.7em 2em 1em;
+ min-width: 255px;
+ max-width: 520px;
+ border: 1px solid #e5e5e5;
+ box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
+ background: #fff;
+ box-sizing: border-box;
+}
+
+/* Press this styles */
+
+.pressthis h4 {
+ margin: 2em 0 1em;
+}
+
+.pressthis textarea {
+ width: 100%;
+ font-size: 1em;
+}
+
+#pressthis-code-wrap {
+ overflow: auto;
+}
+
+.pressthis-bookmarklet-wrapper {
+ margin: 20px 0 8px;
+ vertical-align: top;
+ position: relative;
+ z-index: 1;
+}
+
+.pressthis-bookmarklet,
+.pressthis-bookmarklet:hover,
+.pressthis-bookmarklet:focus,
+.pressthis-bookmarklet:active {
+ display: inline-block;
+ position: relative;
+ cursor: move;
+ color: #32373c;
+ background: #e5e5e5;
+ border-radius: 5px;
+ border: 1px solid #b4b9be;
+ font-style: normal;
+ line-height: 16px;
+ font-size: 14px;
+ text-decoration: none;
+}
+
+.pressthis-bookmarklet:active {
+ outline: none;
+}
+
+.pressthis-bookmarklet:after {
+ content: "";
+ width: 70%;
+ height: 55%;
+ z-index: -1;
+ position: absolute;
+ right: 10px;
+ bottom: 9px;
+ background: transparent;
+ transform: skew(20deg) rotate(6deg);
+ box-shadow: 0 10px 8px rgba(0, 0, 0, 0.6);
+}
+
+.pressthis-bookmarklet:hover:after {
+ transform: skew(20deg) rotate(9deg);
+ box-shadow: 0 10px 8px rgba(0, 0, 0, 0.7);
+}
+
+.pressthis-bookmarklet span {
+ display: inline-block;
+ margin: 0px 0 0;
+ padding: 0px 12px 8px 9px;
+}
+
+.pressthis-bookmarklet span:before {
+ color: #72777c;
+ font: normal 20px/1 dashicons;
+ content: "\f157";
+ position: relative;
+ display: inline-block;
+ top: 4px;
+ margin-right: 4px;
+}
+
+.pressthis-js-toggle {
+ margin-left: 10px;
+ padding: 0;
+ height: auto;
+ vertical-align: top;
+}
+
+/* to override the button class being applied */
+.pressthis-js-toggle.button.button {
+ margin-left: 10px;
+ padding: 0;
+ height: auto;
+ vertical-align: top;
+}
+
+.pressthis-js-toggle .dashicons {
+ margin: 5px 8px 6px 7px;
+ color: #555d66;
+}
+
+/*------------------------------------------------------------------------------
+ 20.0 - Settings
+------------------------------------------------------------------------------*/
+
+.timezone-info code {
+ white-space: nowrap;
+}
+
+.defaultavatarpicker .avatar {
+ margin: 2px 0;
+ vertical-align: middle;
+}
+
+.options-general-php .date-time-text {
+ display: inline-block;
+ min-width: 10em;
+}
+
+.options-general-php input.small-text {
+ width: 56px;
+}
+
+.options-general-php .spinner {
+ float: none;
+ margin: -3px 3px 0;
+}
+
+.settings-php .language-install-spinner,
+.options-general-php .language-install-spinner {
+ display: inline-block;
+ float: none;
+ margin: -3px 5px 0;
+ vertical-align: middle;
+}
+
+.form-table.permalink-structure .available-structure-tags li {
+ float: left;
+ margin-right: 5px;
+}
+
+/*------------------------------------------------------------------------------
+ 21.0 - Network Admin
+------------------------------------------------------------------------------*/
+
+.setup-php textarea {
+ max-width: 100%;
+}
+
+.form-field #site-address {
+ max-width: 25em;
+}
+
+.form-field #domain {
+ max-width: 22em;
+}
+
+.form-field #site-title,
+.form-field #admin-email,
+.form-field #path,
+.form-field #blog_registered,
+.form-field #blog_last_updated {
+ max-width: 25em;
+}
+
+.form-field #path {
+ margin-bottom: 5px;
+}
+
+#search-users,
+#search-sites {
+ max-width: 100%;
+}
+
+/*------------------------------------------------------------------------------
+ Credentials check dialog for Install and Updates
+------------------------------------------------------------------------------*/
+
+.request-filesystem-credentials-dialog {
+ display: none;
+ /* The customizer uses visibility: hidden on the body for full-overlays. */
+ visibility: visible;
+}
+
+.request-filesystem-credentials-dialog .notification-dialog {
+ top: 10%;
+ max-height: 85%;
+}
+
+.request-filesystem-credentials-dialog-content {
+ margin: 25px;
+}
+
+#request-filesystem-credentials-title {
+ font-size: 1.3em;
+ margin: 1em 0;
+}
+
+.request-filesystem-credentials-form legend {
+ font-size: 1em;
+ padding: 1.33em 0;
+ font-weight: 600;
+}
+
+.request-filesystem-credentials-form input[type="text"],
+.request-filesystem-credentials-form input[type="password"] {
+ display: block;
+}
+
+.request-filesystem-credentials-dialog input[type="text"],
+.request-filesystem-credentials-dialog input[type="password"] {
+ width: 100%;
+}
+
+.request-filesystem-credentials-form .field-title {
+ font-weight: 600;
+}
+
+.request-filesystem-credentials-dialog label[for="hostname"],
+.request-filesystem-credentials-dialog label[for="public_key"],
+.request-filesystem-credentials-dialog label[for="private_key"] {
+ display: block;
+ margin-bottom: 1em;
+}
+
+.request-filesystem-credentials-dialog .ftp-username,
+.request-filesystem-credentials-dialog .ftp-password {
+ float: left;
+ width: 48%;
+}
+
+.request-filesystem-credentials-dialog .ftp-password {
+ margin-left: 4%;
+}
+
+.request-filesystem-credentials-dialog .request-filesystem-credentials-action-buttons {
+ text-align: right;
+}
+
+.request-filesystem-credentials-dialog label[for="ftp"] {
+ margin-right: 10px;
+}
+
+.request-filesystem-credentials-dialog #auth-keys-desc {
+ margin-bottom: 0;
+}
+
+#request-filesystem-credentials-dialog .button:not(:last-child) {
+ margin-right: 10px;
+}
+
+#request-filesystem-credentials-form .cancel-button {
+ display: none;
+}
+
+#request-filesystem-credentials-dialog .cancel-button {
+ display: inline;
+}
+
+.request-filesystem-credentials-dialog .ftp-username,
+.request-filesystem-credentials-dialog .ftp-password {
+ float: none;
+ width: auto;
+}
+
+.request-filesystem-credentials-dialog .ftp-username {
+ margin-bottom: 1em;
+}
+
+.request-filesystem-credentials-dialog .ftp-password {
+ margin: 0;
+}
+
+.request-filesystem-credentials-dialog .ftp-password em {
+ color: #888;
+}
+
+.request-filesystem-credentials-dialog label {
+ display: block;
+ line-height: 1.5;
+ margin-bottom: 1em;
+}
+
+.request-filesystem-credentials-form legend {
+ padding-bottom: 0;
+}
+
+.request-filesystem-credentials-form #ssh-keys legend {
+ font-size: 1.3em;
+}
+
+.request-filesystem-credentials-form .notice {
+ margin: 0 0 20px 0;
+ clear: both;
+}
+
+/*------------------------------------------------------------------------------
+ Privacy Policy settings screen
+------------------------------------------------------------------------------*/
+.tools-privacy-policy-page form {
+ margin-bottom: 1.3em;
+}
+
+.tools-privacy-policy-page input.button,
+.tools-privacy-policy-page select {
+ margin-left: 6px;
+}
+
+.tools-privacy-edit {
+ margin: 1.5em 0;
+}
+
+.tools-privacy-policy-page span {
+ line-height: 2em;
+}
+
+.privacy_requests .column-email {
+ width: 40%;
+}
+
+.privacy_requests .column-type {
+ text-align: center;
+}
+
+.privacy_requests thead td:first-child,
+.privacy_requests tfoot td:first-child {
+ border-left: 4px solid #fff;
+}
+
+.privacy_requests tbody th {
+ border-left: 4px solid #fff;
+ background: #fff;
+ box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.1);
+}
+
+.privacy_requests tbody .has-request-results th {
+ box-shadow: none;
+}
+
+.privacy_requests tbody .request-results th .notice {
+ margin: 0 0 5px;
+}
+
+.privacy_requests tbody td {
+ background: #fff;
+ box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.1);
+}
+
+.privacy_requests tbody .has-request-results td {
+ box-shadow: none;
+}
+
+.privacy_requests .next_steps .button {
+ height: auto;
+ line-height: 1.5;
+ padding: 4px 10px;
+ word-break: break-all;
+ white-space: unset;
+}
+
+.privacy_requests .status-request-confirmed th,
+.privacy_requests .status-request-confirmed td {
+ background-color: #f7fcfe;
+ border-left-color: #00a0d2;
+}
+
+.privacy_requests .status-request-failed th,
+.privacy_requests .status-request-failed td {
+ background-color: #fef7f1;
+ border-left-color: #d64d21;
+}
+
+.privacy_requests .export_personal_data_failed a {
+ vertical-align: baseline;
+}
+
+.status-label {
+ font-weight: 600;
+}
+
+.status-label.status-request-pending {
+ font-weight: 400;
+ font-style: italic;
+ color: #6c7781;
+}
+
+.status-label.status-request-failed {
+ color: #aa0000;
+ font-weight: 600;
+}
+
+.wp-privacy-request-form {
+ clear: both;
+}
+
+.wp-privacy-request-form-field {
+ margin: 1.5em 0;
+}
+
+.wp-privacy-request-form label {
+ font-weight: 600;
+ line-height: 1.5;
+ padding-bottom: .5em;
+ display: block;
+}
+
+.wp-privacy-request-form input {
+ line-height: 1.5;
+ margin: 0;
+}
+
+.email-personal-data::before {
+ display: inline-block;
+ font: normal 20px/1 dashicons;
+ margin: 3px 5px 0 -2px;
+ speak: none;
+ -webkit-font-smoothing: antialiased;
+ -moz-osx-font-smoothing: grayscale;
+ vertical-align: top;
+}
+
+.email-personal-data--sending::before {
+ color: #f56e28;
+ content: "\f463";
+ animation: rotation 2s infinite linear;
+}
+
+.email-personal-data--sent::before {
+ color: #79ba49;
+ content: "\f147";
+}
+
+
+/* =Media Queries
+-------------------------------------------------------------- */
+
+@media screen and (max-width: 782px) {
+ /* Input Elements */
+ textarea {
+ -webkit-appearance: none;
+ }
+
+ input[type="text"],
+ input[type="email"],
+ input[type="search"],
+ input[type="password"],
+ input[type="number"] {
+ -webkit-appearance: none;
+ padding: 6px 10px;
+ }
+
+ input[type="number"] {
+ height: 40px;
+ }
+
+ input.code {
+ padding-bottom: 5px;
+ padding-top: 10px;
+ }
+
+ input[type="checkbox"],
+ .widefat th input[type="checkbox"],
+ .widefat thead td input[type="checkbox"],
+ .widefat tfoot td input[type="checkbox"] {
+ -webkit-appearance: none;
+ padding: 10px;
+ }
+
+ .widefat th input[type="checkbox"],
+ .widefat thead td input[type="checkbox"],
+ .widefat tfoot td input[type="checkbox"] {
+ margin-bottom: 8px;
+ }
+
+ input[type="checkbox"]:checked:before,
+ .widefat th input[type="checkbox"]:before,
+ .widefat thead td input[type="checkbox"]:before,
+ .widefat tfoot td input[type="checkbox"]:before {
+ font: normal 30px/1 dashicons;
+ margin: -3px -5px;
+ }
+
+ input[type="radio"],
+ input[type="checkbox"] {
+ height: 25px;
+ width: 25px;
+ }
+
+ .wp-admin p input[type="checkbox"],
+ .wp-admin p input[type="radio"] {
+ margin-top: -3px;
+ }
+
+ input[type="radio"]:checked:before {
+ vertical-align: middle;
+ width: 9px;
+ height: 9px;
+ margin: 7px;
+ line-height: 16px;
+ }
+
+ .wp-upload-form input[type="submit"] {
+ margin-top: 10px;
+ }
+
+ #wpbody select {
+ height: 36px;
+ font-size: 16px;
+ }
+
+ .wp-admin .button-cancel {
+ padding: 0;
+ font-size: 14px;
+ }
+
+ #adduser .form-field input,
+ #createuser .form-field input {
+ width: 100%;
+ }
+
+ .form-table {
+ box-sizing: border-box;
+ }
+
+ .form-table th,
+ .form-table td,
+ .label-responsive {
+ display: block;
+ width: auto;
+ vertical-align: middle;
+ }
+
+ .label-responsive {
+ margin: 0.5em 0;
+ }
+
+ .export-filters li {
+ margin-bottom: 0;
+ }
+
+ .form-table .color-palette td {
+ display: table-cell;
+ width: 15px;
+ }
+
+ .form-table table.color-palette {
+ margin-right: 10px;
+ }
+
+ textarea,
+ input {
+ font-size: 16px;
+ }
+
+ .form-table td input[type="text"],
+ .form-table td input[type="email"],
+ .form-table td input[type="password"],
+ .form-table td select,
+ .form-table td textarea,
+ .form-table span.description,
+ #profile-page .form-table textarea {
+ width: 100%;
+ font-size: 16px;
+ line-height: 1.5;
+ padding: 7px 10px;
+ display: block;
+ max-width: none;
+ box-sizing: border-box;
+ }
+
+ .form-table .form-required.form-invalid td:after {
+ float: right;
+ margin: -30px 3px 0 0;
+ }
+
+ #wpbody .form-table td select {
+ height: 40px;
+ }
+
+ input[type="text"].small-text,
+ input[type="search"].small-text,
+ input[type="password"].small-text,
+ input[type="number"].small-text,
+ input[type="number"].small-text,
+ .form-table input[type="text"].small-text {
+ width: auto;
+ max-width: 4.375em; /* 70px, enough for 4 digits to fit comfortably */
+ display: inline;
+ padding: 3px 6px;
+ margin: 0 3px;
+ }
+
+ #pass-strength-result {
+ width: 100%;
+ box-sizing: border-box;
+ padding: 8px;
+ }
+
+ p.search-box {
+ float: none;
+ position: absolute;
+ bottom: 0;
+ width: 98%;
+ height: 90px;
+ margin-bottom: 20px;
+ }
+
+ p.search-box input[name="s"] {
+ height: auto;
+ float: none;
+ width: 100%;
+ margin-bottom: 10px;
+ vertical-align: middle;
+ -webkit-appearance: none;
+ }
+
+ p.search-box input[type="submit"] {
+ margin-bottom: 10px;
+ }
+
+ .form-table span.description {
+ display: inline;
+ padding: 4px 0 0;
+ line-height: 1.4em;
+ font-size: 14px;
+ }
+
+ .form-table th {
+ padding-top: 10px;
+ padding-bottom: 0;
+ border-bottom: 0;
+ }
+
+ .form-table td {
+ margin-bottom: 0;
+ padding-bottom: 6px;
+ padding-top: 4px;
+ padding-left: 0;
+ }
+
+ .form-table.permalink-structure td code {
+ margin-left: 32px;
+ }
+
+ .form-table.permalink-structure td input[type="text"] {
+ margin-left: 32px;
+ margin-top: 4px;
+ width: 96%;
+ }
+
+ .form-table input.regular-text {
+ width: 100%;
+ }
+
+ .form-table label {
+ font-size: 14px;
+ }
+
+ .form-table fieldset label {
+ display: block;
+ }
+
+ #utc-time,
+ #local-time {
+ display: block;
+ float: none;
+ margin-top: 0.5em;
+ }
+
+ .form-field #domain {
+ max-width: none;
+ }
+
+ /* New Password */
+ .wp-pwd {
+ position: relative;
+ }
+
+ .wp-pwd [type="text"],
+ .wp-pwd [type="password"] {
+ padding-right: 88px;
+ }
+
+ .wp-pwd button.button {
+ background: transparent;
+ border: 1px solid transparent;
+ box-shadow: none;
+ line-height: 2;
+ margin: 0;
+ padding: 5px 9px;
+ position: absolute;
+ right: 0;
+ top: 0;
+ }
+
+ .wp-pwd button.wp-hide-pw {
+ right: 40px;
+ }
+
+ .wp-pwd button.button:hover,
+ .wp-pwd button.button:focus {
+ background: transparent;
+ }
+
+ .wp-pwd button.button:active {
+ background: transparent;
+ box-shadow: none;
+ transform: none;
+ }
+
+ .wp-pwd .button .text {
+ display: none;
+ }
+
+ .wp-cancel-pw .dashicons-no {
+ display: inline-block;
+ }
+
+ .options-general-php input[type="text"].small-text {
+ max-width: 6.25em;
+ margin: 0;
+ }
+
+ /* Privacy Policy settings screen */
+ .tools-privacy-policy-page form.wp-create-privacy-page {
+ margin-bottom: 1em;
+ }
+
+ .tools-privacy-policy-page input#set-page,
+ .tools-privacy-policy-page select {
+ margin: 10px 0 0;
+ }
+
+ .tools-privacy-policy-page .wp-create-privacy-page span {
+ display: block;
+ margin-bottom: 1em;
+ }
+
+ .tools-privacy-policy-page .wp-create-privacy-page .button {
+ margin-left: 0;
+ }
+
+ .wp-list-table.privacy_requests tr:not(.inline-edit-row):not(.no-items) td.column-primary:not(.check-column) {
+ display: table-cell;
+ }
+
+ .wp-list-table.privacy_requests.widefat th input,
+ .wp-list-table.privacy_requests.widefat thead td input {
+ margin-left: 5px;
+ }
+ .regular-text {
+ max-width: 100%;
+ }
+}
+
+@media only screen and (max-width: 768px) {
+ .form-field input[type="text"],
+ .form-field input[type="email"],
+ .form-field input[type="password"],
+ .form-field select,
+ .form-field textarea {
+ width: 99%;
+ }
+
+ .form-wrap .form-field {
+ padding: 0;
+ }
+}
+
+@media only screen and (max-height: 480px), screen and (max-width: 450px) {
+ /* Request Credentials / File Editor Warning */
+ .request-filesystem-credentials-dialog .notification-dialog,
+ .file-editor-warning .notification-dialog {
+ width: 100%;
+ height: 100%;
+ max-height: 100%;
+ position: fixed;
+ top: 0;
+ margin: 0;
+ left: 0;
+ }
+}
+
+/* Smartphone */
+@media screen and (max-width: 600px) {
+ /* Color Picker Options */
+ .color-option {
+ width: 49%;
+ }
+}
+
+@media only screen and (max-width: 320px) {
+ .options-general-php .date-time-text.date-time-custom-text {
+ min-width: 0;
+ margin-right: 0.5em;
+ }
+}
+
+@keyframes rotation {
+ 0% {
+ transform: rotate(0deg);
+ }
+ 100% {
+ transform: rotate(359deg);
+ }
+}
diff --git a/www/crm/wp-admin/css/forms.min.css b/www/crm/wp-admin/css/forms.min.css
new file mode 100644
index 00000000..ed01d940
--- /dev/null
+++ b/www/crm/wp-admin/css/forms.min.css
@@ -0,0 +1,2 @@
+/*! This file is auto-generated */
+input,textarea{box-sizing:border-box}input[type=checkbox],input[type=color],input[type=date],input[type=datetime-local],input[type=datetime],input[type=email],input[type=month],input[type=number],input[type=password],input[type=radio],input[type=search],input[type=tel],input[type=text],input[type=time],input[type=url],input[type=week],select,textarea{border:1px solid #ddd;box-shadow:inset 0 1px 2px rgba(0,0,0,.07);background-color:#fff;color:#32373c;outline:0;transition:50ms border-color ease-in-out}input[type=checkbox]:focus,input[type=color]:focus,input[type=date]:focus,input[type=datetime-local]:focus,input[type=datetime]:focus,input[type=email]:focus,input[type=month]:focus,input[type=number]:focus,input[type=password]:focus,input[type=radio]:focus,input[type=search]:focus,input[type=tel]:focus,input[type=text]:focus,input[type=time]:focus,input[type=url]:focus,input[type=week]:focus,select:focus,textarea:focus{border-color:#5b9dd9;box-shadow:0 0 2px rgba(30,140,190,.8);outline:2px solid transparent}input[type=email],input[type=url]{direction:ltr}input[type=number]{height:28px;line-height:1}input[type=checkbox],input[type=radio]{border:1px solid #b4b9be;background:#fff;color:#555;clear:none;cursor:pointer;display:inline-block;line-height:0;height:16px;margin:-4px 4px 0 0;outline:0;padding:0!important;text-align:center;vertical-align:middle;width:16px;min-width:16px;-webkit-appearance:none;box-shadow:inset 0 1px 2px rgba(0,0,0,.1);transition:.05s border-color ease-in-out}input[type=radio]:checked+label:before{color:#82878c}.wp-core-ui input[type=reset]:active,.wp-core-ui input[type=reset]:hover{color:#00a0d2}.wp-admin p input[type=checkbox],.wp-admin p input[type=radio],td>input[type=checkbox]{margin-top:0}.wp-admin p label input[type=checkbox]{margin-top:-4px}.wp-admin p label input[type=radio]{margin-top:-2px}input[type=radio]{border-radius:50%;margin-right:4px;line-height:10px}input[type=checkbox]:checked:before,input[type=radio]:checked:before{float:left;display:inline-block;vertical-align:middle;width:16px;font:normal 21px/1 dashicons;speak:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}input[type=checkbox]:checked:before{content:"\f147";margin:-3px 0 0 -4px;color:#1e8cbe}input[type=radio]:checked:before{content:"\2022";text-indent:-9999px;border-radius:50px;font-size:24px;width:6px;height:6px;margin:4px;line-height:16px;background-color:#1e8cbe}@-moz-document url-prefix(){.form-table input.tog,input[type=checkbox],input[type=radio]{margin-bottom:-1px}}input[type=search]{-webkit-appearance:textfield}input[type=search]::-webkit-search-decoration{display:none}.ie8 input[type=password]{font-family:sans-serif}button,input,select,textarea{font-family:inherit;font-size:inherit;font-weight:inherit}input,select,textarea{font-size:14px;padding:3px 5px;border-radius:0}textarea{overflow:auto;padding:2px 6px;line-height:1.4;resize:vertical}.wp-admin input[type=file]{padding:3px 0;cursor:pointer}label{cursor:pointer}input,select{margin:1px;padding:3px 5px}input.code{padding-top:6px}textarea.code{line-height:1.4;padding:4px 6px 1px 6px}input.readonly,input[readonly],textarea.readonly,textarea[readonly]{background-color:#eee}::-webkit-input-placeholder{color:#72777c}::-moz-placeholder{color:#72777c;opacity:1}:-ms-input-placeholder{color:#72777c}.form-invalid input,.form-invalid input:focus,.form-invalid select,.form-invalid select:focus{border-color:#dc3232!important;box-shadow:0 0 2px rgba(204,0,0,.8)}.form-table .form-required.form-invalid td:after{content:"\f534";font:normal 20px/1 dashicons;color:#dc3232;margin-left:-25px;vertical-align:middle}.form-table .form-required.user-pass1-wrap.form-invalid td:after{content:""}.form-table .form-required.user-pass1-wrap.form-invalid .password-input-wrapper:after{content:"\f534";font:normal 20px/1 dashicons;color:#dc3232;margin:0 6px 0 -29px;vertical-align:middle}.form-input-tip{color:#666}input.disabled,input:disabled,select.disabled,select:disabled,textarea.disabled,textarea:disabled{background:rgba(255,255,255,.5);border-color:rgba(222,222,222,.75);box-shadow:inset 0 1px 2px rgba(0,0,0,.04);color:rgba(51,51,51,.5)}input[type=file].disabled,input[type=file]:disabled,input[type=range].disabled,input[type=range]:disabled{background:0 0;box-shadow:none;cursor:default}input[type=checkbox].disabled,input[type=checkbox].disabled:checked:before,input[type=checkbox]:disabled,input[type=checkbox]:disabled:checked:before,input[type=radio].disabled,input[type=radio].disabled:checked:before,input[type=radio]:disabled,input[type=radio]:disabled:checked:before{opacity:.7}.wp-admin select{padding:2px;line-height:28px;height:28px;vertical-align:middle}.wp-admin .button-cancel{padding:0 5px;line-height:2}.meta-box-sortables select{max-width:100%}.wp-admin select[multiple]{height:auto}.submit{padding:1.5em 0;margin:5px 0;border-bottom-left-radius:3px;border-bottom-right-radius:3px;border:none}form p.submit a.cancel:hover{text-decoration:none}p.submit{text-align:left;max-width:100%;margin-top:20px;padding-top:10px}.textright p.submit{border:none;text-align:right}table.form-table+input+input+p.submit,table.form-table+input+p.submit,table.form-table+p.submit{border-top:none;padding-top:0}#major-publishing-actions input,#minor-publishing-actions .preview,#minor-publishing-actions input{text-align:center}input.all-options,textarea.all-options{width:250px}input.large-text,textarea.large-text{width:99%}.regular-text{width:25em}input.small-text{width:50px;padding:1px 6px}input[type=number].small-text{width:65px}input.tiny-text{width:35px}input[type=number].tiny-text{width:45px}#doaction,#doaction2,#post-query-submit{margin:1px 8px 0 0}.tablenav #changeit,.tablenav #clear-recent-list,.tablenav #delete_all,.wp-filter #delete_all{margin-top:1px}.tablenav .actions select{float:left;margin-right:6px;max-width:200px}.ie8 .tablenav .actions select{width:155px}.ie8 .tablenav .actions select#cat{width:200px}#timezone_string option{margin-left:1em}.wp-cancel-pw>.dashicons,.wp-hide-pw>.dashicons{position:relative;top:3px}.wp-cancel-pw .dashicons-no{display:none}#your-profile label+a,label{vertical-align:middle}#your-profile label+a,fieldset label{vertical-align:middle}.options-media-php [for*="_size_"]{min-width:10em;vertical-align:baseline}.options-media-php .small-text[name*="_size_"]{margin:0 0 1em}#misc-publishing-actions label{vertical-align:baseline}#pass-strength-result{background-color:#eee;border:1px solid #ddd;color:#23282d;margin:-1px 1px 5px;padding:3px 5px;text-align:center;width:25em;box-sizing:border-box;opacity:0}#pass-strength-result.short{background-color:#f1adad;border-color:#e35b5b;opacity:1}#pass-strength-result.bad{background-color:#fbc5a9;border-color:#f78b53;opacity:1}#pass-strength-result.good{background-color:#ffe399;border-color:#ffc733;opacity:1}#pass-strength-result.strong{background-color:#c1e1b9;border-color:#83c373;opacity:1}#pass1-text.short,#pass1.short{border-color:#e35b5b}#pass1-text.bad,#pass1.bad{border-color:#f78b53}#pass1-text.good,#pass1.good{border-color:#ffc733}#pass1-text.strong,#pass1.strong{border-color:#83c373}.pw-weak{display:none}.indicator-hint{padding-top:8px}.wp-pwd [type=password],.wp-pwd [type=text]{margin-bottom:0;line-height:20px;min-height:28px;max-height:40px}#pass1-text,.show-password #pass1{display:none}#pass1-text::-ms-clear{display:none}.show-password #pass1-text{display:inline-block}p.search-box{float:right;margin:0}.network-admin.themes-php p.search-box{clear:left}.search-box input[name="s"],.tablenav .search-plugins input[name="s"],.tagsdiv .newtag{float:left;height:28px;margin:0 4px 0 0}.js.plugins-php .search-box .wp-filter-search{margin:0;width:280px;font-size:16px;font-weight:300;line-height:1.5;padding:3px 5px;height:32px}input[type=email].ui-autocomplete-loading,input[type=text].ui-autocomplete-loading{background-image:url(../images/loading.gif);background-repeat:no-repeat;background-position:right center;visibility:visible}input.ui-autocomplete-input.open{border-bottom-color:transparent}ul#add-to-blog-users{margin:0 0 0 14px}.ui-autocomplete{padding:0;margin:0;list-style:none;position:absolute;z-index:10000;border:1px solid #5b9dd9;box-shadow:0 1px 2px rgba(30,140,190,.8);background-color:#fff}.ui-autocomplete li{margin-bottom:0;padding:4px 10px;white-space:nowrap;text-align:left;cursor:pointer}.ui-autocomplete .ui-state-focus{background-color:#ddd}.wp-tags-autocomplete .ui-state-focus{background-color:#0073aa;color:#fff}.form-table{border-collapse:collapse;margin-top:.5em;width:100%;clear:both}.form-table,.form-table td,.form-table td p,.form-table th{font-size:14px}.form-table td{margin-bottom:9px;padding:15px 10px;line-height:1.3;vertical-align:middle}.form-table th,.form-wrap label{color:#23282d;font-weight:400;text-shadow:none;vertical-align:baseline}.form-table th{vertical-align:top;text-align:left;padding:20px 10px 20px 0;width:200px;line-height:1.3;font-weight:600}.form-table .td-full,.form-table th.th-full{width:auto;padding:20px 10px 20px 0;font-weight:400}.form-table td p{margin-top:4px;margin-bottom:0}.form-table .date-time-doc{margin-top:1em}.form-table p.timezone-info{margin:1em 0}.form-table td fieldset label{margin:.25em 0 .5em!important;display:inline-block}.form-table td fieldset label,.form-table td fieldset li,.form-table td fieldset p{line-height:1.4em}.form-table input.tog,.form-table input[type=radio]{margin-top:-4px;margin-right:4px;float:none}.form-table .pre{padding:8px;margin:0}table.form-table td .updated{font-size:13px}table.form-table td .updated p{font-size:13px;margin:.3em 0}#profile-page .form-table textarea{width:500px;margin-bottom:6px}#profile-page .form-table #rich_editing{margin-right:5px}#your-profile legend{font-size:22px}#display_name{width:15em}#adduser .form-field input,#createuser .form-field input{width:25em}.color-option{display:inline-block;width:24%;padding:5px 15px 15px;box-sizing:border-box;margin-bottom:3px}.color-option.selected,.color-option:hover{background:#ddd}.color-palette{width:100%;border-spacing:0;border-collapse:collapse}.color-palette td{height:20px;padding:0;border:none}.color-option{cursor:pointer}.tool-box .title{margin:8px 0;font-size:18px;font-weight:400;line-height:24px}.label-responsive{vertical-align:middle}#export-filters p{margin:0 0 1em}#export-filters p.submit{margin:7px 0 5px}.card{position:relative;margin-top:20px;padding:.7em 2em 1em;min-width:255px;max-width:520px;border:1px solid #e5e5e5;box-shadow:0 1px 1px rgba(0,0,0,.04);background:#fff;box-sizing:border-box}.pressthis h4{margin:2em 0 1em}.pressthis textarea{width:100%;font-size:1em}#pressthis-code-wrap{overflow:auto}.pressthis-bookmarklet-wrapper{margin:20px 0 8px;vertical-align:top;position:relative;z-index:1}.pressthis-bookmarklet,.pressthis-bookmarklet:active,.pressthis-bookmarklet:focus,.pressthis-bookmarklet:hover{display:inline-block;position:relative;cursor:move;color:#32373c;background:#e5e5e5;border-radius:5px;border:1px solid #b4b9be;font-style:normal;line-height:16px;font-size:14px;text-decoration:none}.pressthis-bookmarklet:active{outline:0}.pressthis-bookmarklet:after{content:"";width:70%;height:55%;z-index:-1;position:absolute;right:10px;bottom:9px;background:0 0;transform:skew(20deg) rotate(6deg);box-shadow:0 10px 8px rgba(0,0,0,.6)}.pressthis-bookmarklet:hover:after{transform:skew(20deg) rotate(9deg);box-shadow:0 10px 8px rgba(0,0,0,.7)}.pressthis-bookmarklet span{display:inline-block;margin:0 0 0;padding:0 12px 8px 9px}.pressthis-bookmarklet span:before{color:#72777c;font:normal 20px/1 dashicons;content:"\f157";position:relative;display:inline-block;top:4px;margin-right:4px}.pressthis-js-toggle{margin-left:10px;padding:0;height:auto;vertical-align:top}.pressthis-js-toggle.button.button{margin-left:10px;padding:0;height:auto;vertical-align:top}.pressthis-js-toggle .dashicons{margin:5px 8px 6px 7px;color:#555d66}.timezone-info code{white-space:nowrap}.defaultavatarpicker .avatar{margin:2px 0;vertical-align:middle}.options-general-php .date-time-text{display:inline-block;min-width:10em}.options-general-php input.small-text{width:56px}.options-general-php .spinner{float:none;margin:-3px 3px 0}.options-general-php .language-install-spinner,.settings-php .language-install-spinner{display:inline-block;float:none;margin:-3px 5px 0;vertical-align:middle}.form-table.permalink-structure .available-structure-tags li{float:left;margin-right:5px}.setup-php textarea{max-width:100%}.form-field #site-address{max-width:25em}.form-field #domain{max-width:22em}.form-field #admin-email,.form-field #blog_last_updated,.form-field #blog_registered,.form-field #path,.form-field #site-title{max-width:25em}.form-field #path{margin-bottom:5px}#search-sites,#search-users{max-width:100%}.request-filesystem-credentials-dialog{display:none;visibility:visible}.request-filesystem-credentials-dialog .notification-dialog{top:10%;max-height:85%}.request-filesystem-credentials-dialog-content{margin:25px}#request-filesystem-credentials-title{font-size:1.3em;margin:1em 0}.request-filesystem-credentials-form legend{font-size:1em;padding:1.33em 0;font-weight:600}.request-filesystem-credentials-form input[type=password],.request-filesystem-credentials-form input[type=text]{display:block}.request-filesystem-credentials-dialog input[type=password],.request-filesystem-credentials-dialog input[type=text]{width:100%}.request-filesystem-credentials-form .field-title{font-weight:600}.request-filesystem-credentials-dialog label[for=hostname],.request-filesystem-credentials-dialog label[for=private_key],.request-filesystem-credentials-dialog label[for=public_key]{display:block;margin-bottom:1em}.request-filesystem-credentials-dialog .ftp-password,.request-filesystem-credentials-dialog .ftp-username{float:left;width:48%}.request-filesystem-credentials-dialog .ftp-password{margin-left:4%}.request-filesystem-credentials-dialog .request-filesystem-credentials-action-buttons{text-align:right}.request-filesystem-credentials-dialog label[for=ftp]{margin-right:10px}.request-filesystem-credentials-dialog #auth-keys-desc{margin-bottom:0}#request-filesystem-credentials-dialog .button:not(:last-child){margin-right:10px}#request-filesystem-credentials-form .cancel-button{display:none}#request-filesystem-credentials-dialog .cancel-button{display:inline}.request-filesystem-credentials-dialog .ftp-password,.request-filesystem-credentials-dialog .ftp-username{float:none;width:auto}.request-filesystem-credentials-dialog .ftp-username{margin-bottom:1em}.request-filesystem-credentials-dialog .ftp-password{margin:0}.request-filesystem-credentials-dialog .ftp-password em{color:#888}.request-filesystem-credentials-dialog label{display:block;line-height:1.5;margin-bottom:1em}.request-filesystem-credentials-form legend{padding-bottom:0}.request-filesystem-credentials-form #ssh-keys legend{font-size:1.3em}.request-filesystem-credentials-form .notice{margin:0 0 20px 0;clear:both}.tools-privacy-policy-page form{margin-bottom:1.3em}.tools-privacy-policy-page input.button,.tools-privacy-policy-page select{margin-left:6px}.tools-privacy-edit{margin:1.5em 0}.tools-privacy-policy-page span{line-height:2em}.privacy_requests .column-email{width:40%}.privacy_requests .column-type{text-align:center}.privacy_requests tfoot td:first-child,.privacy_requests thead td:first-child{border-left:4px solid #fff}.privacy_requests tbody th{border-left:4px solid #fff;background:#fff;box-shadow:inset 0 -1px 0 rgba(0,0,0,.1)}.privacy_requests tbody .has-request-results th{box-shadow:none}.privacy_requests tbody .request-results th .notice{margin:0 0 5px}.privacy_requests tbody td{background:#fff;box-shadow:inset 0 -1px 0 rgba(0,0,0,.1)}.privacy_requests tbody .has-request-results td{box-shadow:none}.privacy_requests .next_steps .button{height:auto;line-height:1.5;padding:4px 10px;word-break:break-all;white-space:unset}.privacy_requests .status-request-confirmed td,.privacy_requests .status-request-confirmed th{background-color:#f7fcfe;border-left-color:#00a0d2}.privacy_requests .status-request-failed td,.privacy_requests .status-request-failed th{background-color:#fef7f1;border-left-color:#d64d21}.privacy_requests .export_personal_data_failed a{vertical-align:baseline}.status-label{font-weight:600}.status-label.status-request-pending{font-weight:400;font-style:italic;color:#6c7781}.status-label.status-request-failed{color:#a00;font-weight:600}.wp-privacy-request-form{clear:both}.wp-privacy-request-form-field{margin:1.5em 0}.wp-privacy-request-form label{font-weight:600;line-height:1.5;padding-bottom:.5em;display:block}.wp-privacy-request-form input{line-height:1.5;margin:0}.email-personal-data::before{display:inline-block;font:normal 20px/1 dashicons;margin:3px 5px 0 -2px;speak:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;vertical-align:top}.email-personal-data--sending::before{color:#f56e28;content:"\f463";animation:rotation 2s infinite linear}.email-personal-data--sent::before{color:#79ba49;content:"\f147"}@media screen and (max-width:782px){textarea{-webkit-appearance:none}input[type=email],input[type=number],input[type=password],input[type=search],input[type=text]{-webkit-appearance:none;padding:6px 10px}input[type=number]{height:40px}input.code{padding-bottom:5px;padding-top:10px}.widefat tfoot td input[type=checkbox],.widefat th input[type=checkbox],.widefat thead td input[type=checkbox],input[type=checkbox]{-webkit-appearance:none;padding:10px}.widefat tfoot td input[type=checkbox],.widefat th input[type=checkbox],.widefat thead td input[type=checkbox]{margin-bottom:8px}.widefat tfoot td input[type=checkbox]:before,.widefat th input[type=checkbox]:before,.widefat thead td input[type=checkbox]:before,input[type=checkbox]:checked:before{font:normal 30px/1 dashicons;margin:-3px -5px}input[type=checkbox],input[type=radio]{height:25px;width:25px}.wp-admin p input[type=checkbox],.wp-admin p input[type=radio]{margin-top:-3px}input[type=radio]:checked:before{vertical-align:middle;width:9px;height:9px;margin:7px;line-height:16px}.wp-upload-form input[type=submit]{margin-top:10px}#wpbody select{height:36px;font-size:16px}.wp-admin .button-cancel{padding:0;font-size:14px}#adduser .form-field input,#createuser .form-field input{width:100%}.form-table{box-sizing:border-box}.form-table td,.form-table th,.label-responsive{display:block;width:auto;vertical-align:middle}.label-responsive{margin:.5em 0}.export-filters li{margin-bottom:0}.form-table .color-palette td{display:table-cell;width:15px}.form-table table.color-palette{margin-right:10px}input,textarea{font-size:16px}#profile-page .form-table textarea,.form-table span.description,.form-table td input[type=email],.form-table td input[type=password],.form-table td input[type=text],.form-table td select,.form-table td textarea{width:100%;font-size:16px;line-height:1.5;padding:7px 10px;display:block;max-width:none;box-sizing:border-box}.form-table .form-required.form-invalid td:after{float:right;margin:-30px 3px 0 0}#wpbody .form-table td select{height:40px}.form-table input[type=text].small-text,input[type=number].small-text,input[type=password].small-text,input[type=search].small-text,input[type=text].small-text{width:auto;max-width:4.375em;display:inline;padding:3px 6px;margin:0 3px}#pass-strength-result{width:100%;box-sizing:border-box;padding:8px}p.search-box{float:none;position:absolute;bottom:0;width:98%;height:90px;margin-bottom:20px}p.search-box input[name="s"]{height:auto;float:none;width:100%;margin-bottom:10px;vertical-align:middle;-webkit-appearance:none}p.search-box input[type=submit]{margin-bottom:10px}.form-table span.description{display:inline;padding:4px 0 0;line-height:1.4em;font-size:14px}.form-table th{padding-top:10px;padding-bottom:0;border-bottom:0}.form-table td{margin-bottom:0;padding-bottom:6px;padding-top:4px;padding-left:0}.form-table.permalink-structure td code{margin-left:32px}.form-table.permalink-structure td input[type=text]{margin-left:32px;margin-top:4px;width:96%}.form-table input.regular-text{width:100%}.form-table label{font-size:14px}.form-table fieldset label{display:block}#local-time,#utc-time{display:block;float:none;margin-top:.5em}.form-field #domain{max-width:none}.wp-pwd{position:relative}.wp-pwd [type=password],.wp-pwd [type=text]{padding-right:88px}.wp-pwd button.button{background:0 0;border:1px solid transparent;box-shadow:none;line-height:2;margin:0;padding:5px 9px;position:absolute;right:0;top:0}.wp-pwd button.wp-hide-pw{right:40px}.wp-pwd button.button:focus,.wp-pwd button.button:hover{background:0 0}.wp-pwd button.button:active{background:0 0;box-shadow:none;transform:none}.wp-pwd .button .text{display:none}.wp-cancel-pw .dashicons-no{display:inline-block}.options-general-php input[type=text].small-text{max-width:6.25em;margin:0}.tools-privacy-policy-page form.wp-create-privacy-page{margin-bottom:1em}.tools-privacy-policy-page input#set-page,.tools-privacy-policy-page select{margin:10px 0 0}.tools-privacy-policy-page .wp-create-privacy-page span{display:block;margin-bottom:1em}.tools-privacy-policy-page .wp-create-privacy-page .button{margin-left:0}.wp-list-table.privacy_requests tr:not(.inline-edit-row):not(.no-items) td.column-primary:not(.check-column){display:table-cell}.wp-list-table.privacy_requests.widefat th input,.wp-list-table.privacy_requests.widefat thead td input{margin-left:5px}.regular-text{max-width:100%}}@media only screen and (max-width:768px){.form-field input[type=email],.form-field input[type=password],.form-field input[type=text],.form-field select,.form-field textarea{width:99%}.form-wrap .form-field{padding:0}}@media only screen and (max-height:480px),screen and (max-width:450px){.file-editor-warning .notification-dialog,.request-filesystem-credentials-dialog .notification-dialog{width:100%;height:100%;max-height:100%;position:fixed;top:0;margin:0;left:0}}@media screen and (max-width:600px){.color-option{width:49%}}@media only screen and (max-width:320px){.options-general-php .date-time-text.date-time-custom-text{min-width:0;margin-right:.5em}}@keyframes rotation{0%{transform:rotate(0)}100%{transform:rotate(359deg)}} \ No newline at end of file
diff --git a/www/crm/wp-admin/css/ie-rtl.css b/www/crm/wp-admin/css/ie-rtl.css
new file mode 100644
index 00000000..02af27a5
--- /dev/null
+++ b/www/crm/wp-admin/css/ie-rtl.css
@@ -0,0 +1,764 @@
+/* Fixes for IE 7 bugs */
+
+#dashboard-widgets form .input-text-wrap input,
+#dashboard-widgets form .textarea-wrap textarea {
+ width: 99%;
+}
+
+#dashboard-widgets form #title {
+ width: 98%;
+}
+
+#wpbody-content #dashboard-widgets .postbox-container {
+ width: 49.5%;
+}
+
+#wpbody-content #dashboard-widgets #postbox-container-2,
+#wpbody-content #dashboard-widgets #postbox-container-3,
+#wpbody-content #dashboard-widgets #postbox-container-4 {
+ float: left;
+ width: 50.5%;
+}
+
+#dashboard-widgets #postbox-container-3 .empty-container,
+#dashboard-widgets #postbox-container-4 .empty-container {
+ border: 0 none;
+ height: 0;
+ min-height: 0;
+}
+
+.wp-editor-wrap .wp-editor-tools,
+.wp-editor-wrap .wp-switch-editor,
+.wp-editor-wrap .wp-editor-tabs,
+.wp-editor-wrap .wp-editor-container {
+ zoom: 100%;
+}
+
+.wp-editor-wrap .wp-editor-container textarea.wp-editor-area {
+ width: 97%;
+}
+
+#post-body.columns-2 #postbox-container-1 {
+ padding-right: 19px;
+}
+
+.welcome-panel .wp-badge {
+ position: absolute;
+}
+
+.welcome-panel .welcome-panel-column:first-child {
+ width: 35%;
+}
+
+#adminmenuback {
+ right: 0;
+ background-image: none;
+}
+
+#adminmenuwrap {
+ position: static;
+}
+
+#adminmenu {
+ position: relative;
+}
+
+#adminmenu,
+#adminmenu a {
+ cursor: pointer;
+}
+
+#adminmenu li.wp-menu-separator,
+#adminmenu li.wp-menu-separator-last {
+ font-size: 1px;
+ line-height: 1;
+}
+
+#adminmenu a.menu-top {
+ border-bottom: 0 none;
+ border-top: 1px solid #ddd;
+}
+
+#adminmenu .separator {
+ font-size: 1px;
+ line-height: 1px;
+}
+
+#adminmenu .wp-submenu {
+ right: 110px;
+}
+
+#adminmenu .wp-submenu ul {
+ margin: 0;
+}
+
+.folded #wpcontent,
+.folded #wpfooter {
+ margin-right: 170px;
+}
+
+.folded #adminmenuback,
+.folded #adminmenuwrap,
+.folded #adminmenu,
+.folded #adminmenu li.menu-top {
+ width: 150px;
+}
+
+.folded #adminmenu .wp-submenu {
+ border-top-color: transparent;
+}
+
+.folded #adminmenu .wp-menu-name {
+ display: block;
+}
+
+.folded #adminmenu .wp-submenu.sub-open,
+.folded #adminmenu .opensub .wp-submenu {
+ right: 110px;
+}
+
+.folded #adminmenu a.wp-has-current-submenu:focus + .wp-submenu,
+.folded #adminmenu .wp-has-current-submenu .wp-submenu {
+ top: -1px;
+ position: relative;
+}
+
+.folded #adminmenu .wp-has-current-submenu .wp-submenu .wp-submenu-head {
+ background-color: transparent;
+}
+
+#adminmenu .wp-submenu .wp-submenu-head {
+ border-top-color: #ddd;
+}
+
+.folded #adminmenu .wp-submenu ul {
+ margin-right: 5px;
+}
+
+#adminmenu li.menu-top {
+ margin-bottom: -2px;
+}
+
+#adminmenu .wp-menu-arrow {
+ display: none !important;
+}
+
+.js.folded #adminmenu li.menu-top {
+ display: block;
+ zoom: 100%;
+}
+
+ul#adminmenu {
+ z-index: 99;
+}
+
+#adminmenu li.menu-top a.menu-top {
+ min-width: auto;
+ width: auto;
+}
+
+#wpcontent #adminmenu li.wp-has-current-submenu a.wp-has-submenu {
+ font-style: normal;
+}
+
+#wpcontent #adminmenu .wp-submenu li {
+ padding: 0;
+}
+
+#adminmenu li.wp-has-current-submenu .wp-submenu {
+ right: -40px;
+}
+
+#adminmenu .wp-menu-image {
+ display: none !important;
+}
+
+#adminmenu a.menu-top .wp-menu-name {
+ padding-right: 8px;
+}
+
+#collapse-menu {
+ line-height: 23px;
+}
+
+#wpadminbar .ab-comments-icon {
+ padding-top: 7px;
+}
+
+
+.theme-browser .theme {
+ width: 30%;
+ margin: 0 0 4% 3%;
+ cursor: auto;
+}
+
+.theme-browser .theme:hover,
+.theme-browser .theme:focus {
+ cursor: auto;
+}
+
+.theme-browser .theme .theme-screenshot {
+ height: 180px;
+}
+
+.theme-browser .theme .theme-actions {
+ position: static;
+ background-color: #e8e8e8;
+}
+
+.theme-browser .theme .more-details {
+ display: none;
+}
+
+.plugins td,
+.plugins th {
+ border-top: 1px solid #ddd;
+}
+
+table.fixed th,
+table.fixed td {
+ border-top: 1px solid #ddd;
+}
+
+#wpbody-content input.button,
+#wpbody-content input.button-primary {
+ overflow: visible;
+}
+
+#dashboard-widgets h3 a {
+ height: 14px;
+ line-height: 14px;
+}
+
+#dashboard_browser_nag {
+ color: #fff;
+}
+
+#dashboard_browser_nag .browser-icon {
+ position: relative;
+}
+
+.tablenav-pages .current-page {
+ vertical-align: middle;
+}
+
+#wpbody-content .postbox {
+ border: 1px solid #ddd;
+}
+
+#wpbody-content .postbox .hndle {
+ margin-bottom: -1px;
+}
+
+.major-publishing-actions,
+.wp-submenu,
+.wp-submenu li,
+#template,
+#template div,
+#editcat,
+#addcat {
+ zoom: 100%;
+}
+
+.wp-menu-arrow {
+ height: 28px;
+}
+
+.submitbox {
+ margin-top: 10px;
+}
+
+/* Inline Editor */
+#wpbody-content .quick-edit-row-post .inline-edit-col-left {
+ width: 39%;
+}
+
+#wpbody-content .inline-edit-row-post .inline-edit-col-center {
+ width: 19%;
+}
+
+#wpbody-content .quick-edit-row-page .inline-edit-col-left {
+ width: 49%;
+}
+
+#wpbody-content .bulk-edit-row .inline-edit-col-left {
+ width: 29%;
+}
+
+.inline-edit-row .submit {
+ zoom: 100%;
+}
+
+.inline-edit-row fieldset label span.title {
+ display: block;
+ float: right;
+ width: 5em;
+}
+
+.inline-edit-row fieldset label span.input-text-wrap {
+ margin-right: 0;
+ zoom: 100%;
+}
+
+#wpbody-content .inline-edit-row fieldset label span.input-text-wrap input {
+ line-height: 130%;
+}
+
+#wpbody-content .inline-edit-row .input-text-wrap input {
+ width: 95%;
+}
+
+#wpbody-content .inline-edit-row .input-text-wrap input.inline-edit-password-input {
+ width: 8em;
+}
+/* end Inline Editor */
+
+#titlediv #title {
+ width: 98%;
+}
+
+.button,
+input[type="reset"],
+input[type="button"],
+input[type="submit"] {
+ padding: 0 8px;
+ line-height: 20px;
+ height: auto;
+}
+
+.button.button-large,
+input[type="reset"].button-large,
+input[type="button"].button-large,
+input[type="submit"].button-large {
+ padding: 0 10px;
+ line-height: 24px;
+ height: auto;
+}
+
+.button.button-small,
+input[type="reset"].button-small,
+input[type="button"].button-small,
+input[type="submit"].button-small {
+ padding: 0 6px;
+ line-height: 16px;
+ height: auto;
+}
+
+a.button {
+ margin: 1px;
+ padding: 1px 9px 2px;
+}
+
+a.button.button-large {
+ padding: 1px 11px 2px;
+}
+
+a.button.button-small {
+ padding: 1px 7px 2px;
+}
+
+#screen-options-wrap {
+ overflow: hidden;
+}
+
+#the-comment-list .comment-item,
+#post-status-info,
+#wpwrap,
+#wrap,
+#postdivrich,
+#postdiv,
+#poststuff,
+.metabox-holder,
+#titlediv,
+#post-body,
+#editorcontainer,
+.tablenav,
+.widget-liquid-left,
+.widget-liquid-right,
+#widgets-left,
+.widgets-sortables,
+#dragHelper,
+.widget .widget-top,
+.widget-control-actions,
+.tagchecklist,
+#col-container,
+#col-left,
+#col-right,
+.fileedit-sub {
+ display: block;
+ zoom: 100%;
+}
+
+p.search-box {
+ position: static;
+ float: left;
+ margin: -3px 0 4px;
+}
+
+#widget-list .widget {
+ display: inline;
+}
+
+#editorcontainer #content {
+ overflow: auto;
+ margin: auto;
+ width: 98%;
+}
+
+form#template div {
+ width: 100%;
+}
+
+.wp-editor-container .quicktags-toolbar input {
+ overflow: visible;
+ padding: 0 4px;
+}
+
+#poststuff h2 {
+ font-size: 1.6em;
+}
+
+#poststuff .inside #parent_id,
+#poststuff .inside #page_template,
+.inline-edit-row #post_parent,
+.inline-edit-row select[name="page_template"] {
+ width: 250px;
+}
+
+#submitdiv input,
+#submitdiv select,
+#submitdiv a.button {
+ position: relative;
+}
+
+#bh {
+ margin: 7px 0 0 10px;
+ float: left;
+}
+
+/* without this dashboard widgets appear in one column for some screen widths */
+div#dashboard-widgets {
+ padding-left: 1px;
+}
+
+.tagchecklist > li, .tagchecklist .ntdelbutton {
+ display: inline-block;
+ display: block;
+}
+
+.tagchecklist .ntdelbutton:focus .remove-tag-icon:before {
+ outline: 1px solid #5b9dd9;
+}
+
+.tablenav .button,
+.nav .button {
+ padding-top: 2px;
+ padding-bottom: 2px;
+}
+
+.tablenav select {
+ font-size: 13px;
+ display: inline-block;
+ vertical-align: top;
+ margin-top: 2px;
+}
+
+.tablenav .actions select {
+ width: 155px;
+}
+
+.subsubsub li {
+ display: inline;
+}
+
+table.ie-fixed {
+ table-layout: fixed;
+}
+
+.widefat tr,
+.widefat th,
+.widefat thead td,
+.widefat tfoot td {
+ margin-bottom: 0;
+ border-spacing: 0;
+}
+
+.widefat th input,
+.widefat thead td input,
+.widefat tfoot td input {
+ margin: 0 5px 0 0;
+}
+
+.widefat thead .check-column,
+.widefat tfoot .check-column {
+ padding-top: 6px;
+}
+
+.widefat tbody th.check-column,
+.media.widefat tbody th.check-column {
+ padding: 4px 0 0;
+}
+
+.widefat {
+ empty-cells: show;
+ border-collapse: collapse;
+}
+
+.tablenav a.button {
+ display: inline-block;
+ padding: 2px 5px;
+}
+
+.inactive-sidebar .widgets-sortables {
+ padding-bottom: 8px;
+}
+
+#available-widgets .widget-holder {
+ padding-bottom: 65px;
+}
+
+#widgets-left .inactive {
+ padding-bottom: 10px;
+}
+
+.widget-liquid-right .widget,
+.inactive-sidebar .widget {
+ position: relative;
+}
+
+.inactive-sidebar .widget {
+ display: block;
+ float: right;
+}
+
+#wpcontent .button-primary-disabled {
+ color: #9FD0D5;
+ background: #298CBA;
+}
+
+#the-comment-list .unapproved tr,
+#the-comment-list .unapproved td {
+ background-color: #ffffe0;
+}
+
+.imgedit-submit {
+ width: 300px;
+}
+
+#nav-menus-frame,
+#wpbody,
+.menu li {
+ zoom: 100%;
+}
+
+#update-nav-menu #post-body {
+ overflow: hidden;
+}
+
+.menu li {
+ min-width: 100%;
+}
+
+.menu li.sortable-placeholder {
+ min-width: 400px;
+}
+
+.available-theme {
+ display: inline;
+}
+
+.available-theme ul {
+ margin: 0;
+}
+
+.available-theme .action-links li {
+ padding-left: 7px;
+ margin-left: 7px;
+}
+
+.about-wrap .three-col.about-updates .col-2 {
+ width: 15%;
+}
+
+.about-wrap .about-password-meter input {
+ width: 98%;
+}
+
+.revisions-tickmarks,
+.revisions-tooltip {
+ display: none !important;
+}
+
+.revisions.pinned .revisions-controls {
+ position: relative;
+}
+
+input[type="password"],
+.login form .input {
+ font-family: sans-serif;
+}
+
+/* TinyMCE icons */
+.mce-btn i.mce-i-bold,
+.mce-btn i.mce-i-italic,
+.mce-btn i.mce-i-bullist,
+.mce-btn i.mce-i-numlist,
+.mce-btn i.mce-i-blockquote,
+.mce-btn i.mce-i-alignleft,
+.mce-btn i.mce-i-aligncenter,
+.mce-btn i.mce-i-alignright,
+.mce-btn i.mce-i-link,
+.mce-btn i.mce-i-unlink,
+.mce-btn i.mce-i-wp_more,
+.mce-btn i.mce-i-strikethrough,
+.mce-btn i.mce-i-spellchecker,
+.mce-btn i.mce-i-fullscreen,
+.mce-btn i.mce-i-wp_fullscreen,
+.mce-btn i.mce-i-wp_adv,
+.mce-btn i.mce-i-underline,
+.mce-btn i.mce-i-alignjustify,
+.mce-btn i.mce-i-forecolor,
+.mce-btn i.mce-i-pastetext,
+.mce-btn i.mce-i-pasteword,
+.mce-btn i.mce-i-removeformat,
+.mce-btn i.mce-i-charmap,
+.mce-btn i.mce-i-outdent,
+.mce-btn i.mce-i-indent,
+.mce-btn i.mce-i-undo,
+.mce-btn i.mce-i-redo,
+.mce-btn i.mce-i-help,
+.mce-btn i.mce-i-wp_help,
+.mce-btn i.mce-i-wp-media-library,
+.mce-btn i.mce-i-ltr,
+.mce-btn i.mce-i-wp_page,
+.mce-btn i.mce-i-hr,
+.mce-close {
+ font-family: tinymce, Arial;
+ font-style: normal;
+ font-weight: 400;
+ font-variant: normal;
+ font-size: 16px;
+ margin-right: 0;
+ padding-left: 0;
+}
+
+.mce-btn i.mce-i-wp_fullscreen,
+.qt-fullscreen {
+ -ie7-icon: "\e023";
+}
+
+.mce-btn i.mce-i-wp_more,
+.mce-btn i.mce-i-wp_page {
+ -ie7-icon: "\e027";
+}
+
+.mce-btn i.mce-i-wp_adv {
+ background-color: #a0a5aa;
+}
+
+.mce-btn i.mce-i-help,
+.mce-btn i.mce-i-wp_help {
+ -ie7-icon: "\e016";
+}
+
+
+/* IE6 leftovers */
+* html .row-actions {
+ visibility: visible;
+}
+
+* html div.widget-liquid-left,
+* html div.widget-liquid-right {
+ display: block;
+ position: relative;
+}
+
+* html #editorcontainer {
+ padding: 0;
+}
+
+* html #poststuff h2 {
+ margin-right: 0;
+}
+
+* html .stuffbox,
+* html .stuffbox input,
+* html .stuffbox textarea {
+ border: 1px solid #ddd;
+}
+
+* html div.widget-liquid-left {
+ width: 99%;
+}
+
+* html .widgets-sortables {
+ height: 50px;
+}
+
+* html a#content_resize {
+ left: -2px;
+}
+
+* html .widget-title h4 {
+ width: 205px;
+}
+
+* html #removing-widget .in-widget-title {
+ display: none;
+}
+
+* html .media-item .pinkynail {
+ height: 32px;
+ width: 40px;
+}
+
+* html .describe .field input.text,
+* html .describe .field textarea {
+ width: 440px;
+}
+
+* html input {
+ border: 1px solid #ddd;
+}
+
+* html .edit-box {
+ display: inline;
+}
+
+* html .postbox-container .meta-box-sortables {
+ height: 300px;
+}
+
+* html #wpbody-content #screen-options-link-wrap {
+ display: inline-block;
+ width: 150px;
+ text-align: center;
+}
+
+* html #wpbody-content #contextual-help-link-wrap {
+ display: inline-block;
+ width: 100px;
+ text-align: center;
+}
+
+* html #adminmenu {
+ margin-right: -80px;
+}
+
+* html .folded #adminmenu {
+ margin-right: -22px;
+}
+
+* html #wpcontent #adminmenu li.menu-top {
+ display: inline;
+ padding: 0;
+ margin: 0;
+}
+
+* html #wpfooter {
+ margin: 0;
+}
+
+* html #adminmenu div.wp-menu-image {
+ height: 29px;
+}
diff --git a/www/crm/wp-admin/css/ie-rtl.min.css b/www/crm/wp-admin/css/ie-rtl.min.css
new file mode 100644
index 00000000..96b34c8f
--- /dev/null
+++ b/www/crm/wp-admin/css/ie-rtl.min.css
@@ -0,0 +1,2 @@
+/*! This file is auto-generated */
+#dashboard-widgets form .input-text-wrap input,#dashboard-widgets form .textarea-wrap textarea{width:99%}#dashboard-widgets form #title{width:98%}#wpbody-content #dashboard-widgets .postbox-container{width:49.5%}#wpbody-content #dashboard-widgets #postbox-container-2,#wpbody-content #dashboard-widgets #postbox-container-3,#wpbody-content #dashboard-widgets #postbox-container-4{float:left;width:50.5%}#dashboard-widgets #postbox-container-3 .empty-container,#dashboard-widgets #postbox-container-4 .empty-container{border:0 none;height:0;min-height:0}.wp-editor-wrap .wp-editor-container,.wp-editor-wrap .wp-editor-tabs,.wp-editor-wrap .wp-editor-tools,.wp-editor-wrap .wp-switch-editor{zoom:100%}.wp-editor-wrap .wp-editor-container textarea.wp-editor-area{width:97%}#post-body.columns-2 #postbox-container-1{padding-right:19px}.welcome-panel .wp-badge{position:absolute}.welcome-panel .welcome-panel-column:first-child{width:35%}#adminmenuback{right:0;background-image:none}#adminmenuwrap{position:static}#adminmenu{position:relative}#adminmenu,#adminmenu a{cursor:pointer}#adminmenu li.wp-menu-separator,#adminmenu li.wp-menu-separator-last{font-size:1px;line-height:1}#adminmenu a.menu-top{border-bottom:0 none;border-top:1px solid #ddd}#adminmenu .separator{font-size:1px;line-height:1px}#adminmenu .wp-submenu{right:110px}#adminmenu .wp-submenu ul{margin:0}.folded #wpcontent,.folded #wpfooter{margin-right:170px}.folded #adminmenu,.folded #adminmenu li.menu-top,.folded #adminmenuback,.folded #adminmenuwrap{width:150px}.folded #adminmenu .wp-submenu{border-top-color:transparent}.folded #adminmenu .wp-menu-name{display:block}.folded #adminmenu .opensub .wp-submenu,.folded #adminmenu .wp-submenu.sub-open{right:110px}.folded #adminmenu .wp-has-current-submenu .wp-submenu,.folded #adminmenu a.wp-has-current-submenu:focus+.wp-submenu{top:-1px;position:relative}.folded #adminmenu .wp-has-current-submenu .wp-submenu .wp-submenu-head{background-color:transparent}#adminmenu .wp-submenu .wp-submenu-head{border-top-color:#ddd}.folded #adminmenu .wp-submenu ul{margin-right:5px}#adminmenu li.menu-top{margin-bottom:-2px}#adminmenu .wp-menu-arrow{display:none!important}.js.folded #adminmenu li.menu-top{display:block;zoom:100%}ul#adminmenu{z-index:99}#adminmenu li.menu-top a.menu-top{min-width:auto;width:auto}#wpcontent #adminmenu li.wp-has-current-submenu a.wp-has-submenu{font-style:normal}#wpcontent #adminmenu .wp-submenu li{padding:0}#adminmenu li.wp-has-current-submenu .wp-submenu{right:-40px}#adminmenu .wp-menu-image{display:none!important}#adminmenu a.menu-top .wp-menu-name{padding-right:8px}#collapse-menu{line-height:23px}#wpadminbar .ab-comments-icon{padding-top:7px}.theme-browser .theme{width:30%;margin:0 0 4% 3%;cursor:auto}.theme-browser .theme:focus,.theme-browser .theme:hover{cursor:auto}.theme-browser .theme .theme-screenshot{height:180px}.theme-browser .theme .theme-actions{position:static;background-color:#e8e8e8}.theme-browser .theme .more-details{display:none}.plugins td,.plugins th{border-top:1px solid #ddd}table.fixed td,table.fixed th{border-top:1px solid #ddd}#wpbody-content input.button,#wpbody-content input.button-primary{overflow:visible}#dashboard-widgets h3 a{height:14px;line-height:14px}#dashboard_browser_nag{color:#fff}#dashboard_browser_nag .browser-icon{position:relative}.tablenav-pages .current-page{vertical-align:middle}#wpbody-content .postbox{border:1px solid #ddd}#wpbody-content .postbox .hndle{margin-bottom:-1px}#addcat,#editcat,#template,#template div,.major-publishing-actions,.wp-submenu,.wp-submenu li{zoom:100%}.wp-menu-arrow{height:28px}.submitbox{margin-top:10px}#wpbody-content .quick-edit-row-post .inline-edit-col-left{width:39%}#wpbody-content .inline-edit-row-post .inline-edit-col-center{width:19%}#wpbody-content .quick-edit-row-page .inline-edit-col-left{width:49%}#wpbody-content .bulk-edit-row .inline-edit-col-left{width:29%}.inline-edit-row .submit{zoom:100%}.inline-edit-row fieldset label span.title{display:block;float:right;width:5em}.inline-edit-row fieldset label span.input-text-wrap{margin-right:0;zoom:100%}#wpbody-content .inline-edit-row fieldset label span.input-text-wrap input{line-height:130%}#wpbody-content .inline-edit-row .input-text-wrap input{width:95%}#wpbody-content .inline-edit-row .input-text-wrap input.inline-edit-password-input{width:8em}#titlediv #title{width:98%}.button,input[type=button],input[type=reset],input[type=submit]{padding:0 8px;line-height:20px;height:auto}.button.button-large,input[type=button].button-large,input[type=reset].button-large,input[type=submit].button-large{padding:0 10px;line-height:24px;height:auto}.button.button-small,input[type=button].button-small,input[type=reset].button-small,input[type=submit].button-small{padding:0 6px;line-height:16px;height:auto}a.button{margin:1px;padding:1px 9px 2px}a.button.button-large{padding:1px 11px 2px}a.button.button-small{padding:1px 7px 2px}#screen-options-wrap{overflow:hidden}#col-container,#col-left,#col-right,#dragHelper,#editorcontainer,#post-body,#post-status-info,#postdiv,#postdivrich,#poststuff,#the-comment-list .comment-item,#titlediv,#widgets-left,#wpwrap,#wrap,.fileedit-sub,.metabox-holder,.tablenav,.tagchecklist,.widget .widget-top,.widget-control-actions,.widget-liquid-left,.widget-liquid-right,.widgets-sortables{display:block;zoom:100%}p.search-box{position:static;float:left;margin:-3px 0 4px}#widget-list .widget{display:inline}#editorcontainer #content{overflow:auto;margin:auto;width:98%}form#template div{width:100%}.wp-editor-container .quicktags-toolbar input{overflow:visible;padding:0 4px}#poststuff h2{font-size:1.6em}#poststuff .inside #page_template,#poststuff .inside #parent_id,.inline-edit-row #post_parent,.inline-edit-row select[name=page_template]{width:250px}#submitdiv a.button,#submitdiv input,#submitdiv select{position:relative}#bh{margin:7px 0 0 10px;float:left}div#dashboard-widgets{padding-left:1px}.tagchecklist .ntdelbutton,.tagchecklist>li{display:inline-block;display:block}.tagchecklist .ntdelbutton:focus .remove-tag-icon:before{outline:1px solid #5b9dd9}.nav .button,.tablenav .button{padding-top:2px;padding-bottom:2px}.tablenav select{font-size:13px;display:inline-block;vertical-align:top;margin-top:2px}.tablenav .actions select{width:155px}.subsubsub li{display:inline}table.ie-fixed{table-layout:fixed}.widefat tfoot td,.widefat th,.widefat thead td,.widefat tr{margin-bottom:0;border-spacing:0}.widefat tfoot td input,.widefat th input,.widefat thead td input{margin:0 5px 0 0}.widefat tfoot .check-column,.widefat thead .check-column{padding-top:6px}.media.widefat tbody th.check-column,.widefat tbody th.check-column{padding:4px 0 0}.widefat{empty-cells:show;border-collapse:collapse}.tablenav a.button{display:inline-block;padding:2px 5px}.inactive-sidebar .widgets-sortables{padding-bottom:8px}#available-widgets .widget-holder{padding-bottom:65px}#widgets-left .inactive{padding-bottom:10px}.inactive-sidebar .widget,.widget-liquid-right .widget{position:relative}.inactive-sidebar .widget{display:block;float:right}#wpcontent .button-primary-disabled{color:#9fd0d5;background:#298cba}#the-comment-list .unapproved td,#the-comment-list .unapproved tr{background-color:#ffffe0}.imgedit-submit{width:300px}#nav-menus-frame,#wpbody,.menu li{zoom:100%}#update-nav-menu #post-body{overflow:hidden}.menu li{min-width:100%}.menu li.sortable-placeholder{min-width:400px}.available-theme{display:inline}.available-theme ul{margin:0}.available-theme .action-links li{padding-left:7px;margin-left:7px}.about-wrap .three-col.about-updates .col-2{width:15%}.about-wrap .about-password-meter input{width:98%}.revisions-tickmarks,.revisions-tooltip{display:none!important}.revisions.pinned .revisions-controls{position:relative}.login form .input,input[type=password]{font-family:sans-serif}.mce-btn i.mce-i-aligncenter,.mce-btn i.mce-i-alignjustify,.mce-btn i.mce-i-alignleft,.mce-btn i.mce-i-alignright,.mce-btn i.mce-i-blockquote,.mce-btn i.mce-i-bold,.mce-btn i.mce-i-bullist,.mce-btn i.mce-i-charmap,.mce-btn i.mce-i-forecolor,.mce-btn i.mce-i-fullscreen,.mce-btn i.mce-i-help,.mce-btn i.mce-i-hr,.mce-btn i.mce-i-indent,.mce-btn i.mce-i-italic,.mce-btn i.mce-i-link,.mce-btn i.mce-i-ltr,.mce-btn i.mce-i-numlist,.mce-btn i.mce-i-outdent,.mce-btn i.mce-i-pastetext,.mce-btn i.mce-i-pasteword,.mce-btn i.mce-i-redo,.mce-btn i.mce-i-removeformat,.mce-btn i.mce-i-spellchecker,.mce-btn i.mce-i-strikethrough,.mce-btn i.mce-i-underline,.mce-btn i.mce-i-undo,.mce-btn i.mce-i-unlink,.mce-btn i.mce-i-wp-media-library,.mce-btn i.mce-i-wp_adv,.mce-btn i.mce-i-wp_fullscreen,.mce-btn i.mce-i-wp_help,.mce-btn i.mce-i-wp_more,.mce-btn i.mce-i-wp_page,.mce-close{font-family:tinymce,Arial;font-style:normal;font-weight:400;font-variant:normal;font-size:16px;margin-right:0;padding-left:0}.mce-btn i.mce-i-wp_fullscreen,.qt-fullscreen{-ie7-icon:"\e023"}.mce-btn i.mce-i-wp_more,.mce-btn i.mce-i-wp_page{-ie7-icon:"\e027"}.mce-btn i.mce-i-wp_adv{background-color:#a0a5aa}.mce-btn i.mce-i-help,.mce-btn i.mce-i-wp_help{-ie7-icon:"\e016"}* html .row-actions{visibility:visible}* html div.widget-liquid-left,* html div.widget-liquid-right{display:block;position:relative}* html #editorcontainer{padding:0}* html #poststuff h2{margin-right:0}* html .stuffbox,* html .stuffbox input,* html .stuffbox textarea{border:1px solid #ddd}* html div.widget-liquid-left{width:99%}* html .widgets-sortables{height:50px}* html a#content_resize{left:-2px}* html .widget-title h4{width:205px}* html #removing-widget .in-widget-title{display:none}* html .media-item .pinkynail{height:32px;width:40px}* html .describe .field input.text,* html .describe .field textarea{width:440px}* html input{border:1px solid #ddd}* html .edit-box{display:inline}* html .postbox-container .meta-box-sortables{height:300px}* html #wpbody-content #screen-options-link-wrap{display:inline-block;width:150px;text-align:center}* html #wpbody-content #contextual-help-link-wrap{display:inline-block;width:100px;text-align:center}* html #adminmenu{margin-right:-80px}* html .folded #adminmenu{margin-right:-22px}* html #wpcontent #adminmenu li.menu-top{display:inline;padding:0;margin:0}* html #wpfooter{margin:0}* html #adminmenu div.wp-menu-image{height:29px} \ No newline at end of file
diff --git a/www/crm/wp-admin/css/ie.css b/www/crm/wp-admin/css/ie.css
new file mode 100644
index 00000000..00853ab7
--- /dev/null
+++ b/www/crm/wp-admin/css/ie.css
@@ -0,0 +1,764 @@
+/* Fixes for IE 7 bugs */
+
+#dashboard-widgets form .input-text-wrap input,
+#dashboard-widgets form .textarea-wrap textarea {
+ width: 99%;
+}
+
+#dashboard-widgets form #title {
+ width: 98%;
+}
+
+#wpbody-content #dashboard-widgets .postbox-container {
+ width: 49.5%;
+}
+
+#wpbody-content #dashboard-widgets #postbox-container-2,
+#wpbody-content #dashboard-widgets #postbox-container-3,
+#wpbody-content #dashboard-widgets #postbox-container-4 {
+ float: right;
+ width: 50.5%;
+}
+
+#dashboard-widgets #postbox-container-3 .empty-container,
+#dashboard-widgets #postbox-container-4 .empty-container {
+ border: 0 none;
+ height: 0;
+ min-height: 0;
+}
+
+.wp-editor-wrap .wp-editor-tools,
+.wp-editor-wrap .wp-switch-editor,
+.wp-editor-wrap .wp-editor-tabs,
+.wp-editor-wrap .wp-editor-container {
+ zoom: 100%;
+}
+
+.wp-editor-wrap .wp-editor-container textarea.wp-editor-area {
+ width: 97%;
+}
+
+#post-body.columns-2 #postbox-container-1 {
+ padding-left: 19px;
+}
+
+.welcome-panel .wp-badge {
+ position: absolute;
+}
+
+.welcome-panel .welcome-panel-column:first-child {
+ width: 35%;
+}
+
+#adminmenuback {
+ left: 0;
+ background-image: none;
+}
+
+#adminmenuwrap {
+ position: static;
+}
+
+#adminmenu {
+ position: relative;
+}
+
+#adminmenu,
+#adminmenu a {
+ cursor: pointer;
+}
+
+#adminmenu li.wp-menu-separator,
+#adminmenu li.wp-menu-separator-last {
+ font-size: 1px;
+ line-height: 1;
+}
+
+#adminmenu a.menu-top {
+ border-bottom: 0 none;
+ border-top: 1px solid #ddd;
+}
+
+#adminmenu .separator {
+ font-size: 1px;
+ line-height: 1px;
+}
+
+#adminmenu .wp-submenu {
+ left: 110px;
+}
+
+#adminmenu .wp-submenu ul {
+ margin: 0;
+}
+
+.folded #wpcontent,
+.folded #wpfooter {
+ margin-left: 170px;
+}
+
+.folded #adminmenuback,
+.folded #adminmenuwrap,
+.folded #adminmenu,
+.folded #adminmenu li.menu-top {
+ width: 150px;
+}
+
+.folded #adminmenu .wp-submenu {
+ border-top-color: transparent;
+}
+
+.folded #adminmenu .wp-menu-name {
+ display: block;
+}
+
+.folded #adminmenu .wp-submenu.sub-open,
+.folded #adminmenu .opensub .wp-submenu {
+ left: 110px;
+}
+
+.folded #adminmenu a.wp-has-current-submenu:focus + .wp-submenu,
+.folded #adminmenu .wp-has-current-submenu .wp-submenu {
+ top: -1px;
+ position: relative;
+}
+
+.folded #adminmenu .wp-has-current-submenu .wp-submenu .wp-submenu-head {
+ background-color: transparent;
+}
+
+#adminmenu .wp-submenu .wp-submenu-head {
+ border-top-color: #ddd;
+}
+
+.folded #adminmenu .wp-submenu ul {
+ margin-left: 5px;
+}
+
+#adminmenu li.menu-top {
+ margin-bottom: -2px;
+}
+
+#adminmenu .wp-menu-arrow {
+ display: none !important;
+}
+
+.js.folded #adminmenu li.menu-top {
+ display: block;
+ zoom: 100%;
+}
+
+ul#adminmenu {
+ z-index: 99;
+}
+
+#adminmenu li.menu-top a.menu-top {
+ min-width: auto;
+ width: auto;
+}
+
+#wpcontent #adminmenu li.wp-has-current-submenu a.wp-has-submenu {
+ font-style: normal;
+}
+
+#wpcontent #adminmenu .wp-submenu li {
+ padding: 0;
+}
+
+#adminmenu li.wp-has-current-submenu .wp-submenu {
+ left: -40px;
+}
+
+#adminmenu .wp-menu-image {
+ display: none !important;
+}
+
+#adminmenu a.menu-top .wp-menu-name {
+ padding-left: 8px;
+}
+
+#collapse-menu {
+ line-height: 23px;
+}
+
+#wpadminbar .ab-comments-icon {
+ padding-top: 7px;
+}
+
+
+.theme-browser .theme {
+ width: 30%;
+ margin: 0 3% 4% 0;
+ cursor: auto;
+}
+
+.theme-browser .theme:hover,
+.theme-browser .theme:focus {
+ cursor: auto;
+}
+
+.theme-browser .theme .theme-screenshot {
+ height: 180px;
+}
+
+.theme-browser .theme .theme-actions {
+ position: static;
+ background-color: #e8e8e8;
+}
+
+.theme-browser .theme .more-details {
+ display: none;
+}
+
+.plugins td,
+.plugins th {
+ border-top: 1px solid #ddd;
+}
+
+table.fixed th,
+table.fixed td {
+ border-top: 1px solid #ddd;
+}
+
+#wpbody-content input.button,
+#wpbody-content input.button-primary {
+ overflow: visible;
+}
+
+#dashboard-widgets h3 a {
+ height: 14px;
+ line-height: 14px;
+}
+
+#dashboard_browser_nag {
+ color: #fff;
+}
+
+#dashboard_browser_nag .browser-icon {
+ position: relative;
+}
+
+.tablenav-pages .current-page {
+ vertical-align: middle;
+}
+
+#wpbody-content .postbox {
+ border: 1px solid #ddd;
+}
+
+#wpbody-content .postbox .hndle {
+ margin-bottom: -1px;
+}
+
+.major-publishing-actions,
+.wp-submenu,
+.wp-submenu li,
+#template,
+#template div,
+#editcat,
+#addcat {
+ zoom: 100%;
+}
+
+.wp-menu-arrow {
+ height: 28px;
+}
+
+.submitbox {
+ margin-top: 10px;
+}
+
+/* Inline Editor */
+#wpbody-content .quick-edit-row-post .inline-edit-col-left {
+ width: 39%;
+}
+
+#wpbody-content .inline-edit-row-post .inline-edit-col-center {
+ width: 19%;
+}
+
+#wpbody-content .quick-edit-row-page .inline-edit-col-left {
+ width: 49%;
+}
+
+#wpbody-content .bulk-edit-row .inline-edit-col-left {
+ width: 29%;
+}
+
+.inline-edit-row .submit {
+ zoom: 100%;
+}
+
+.inline-edit-row fieldset label span.title {
+ display: block;
+ float: left;
+ width: 5em;
+}
+
+.inline-edit-row fieldset label span.input-text-wrap {
+ margin-left: 0;
+ zoom: 100%;
+}
+
+#wpbody-content .inline-edit-row fieldset label span.input-text-wrap input {
+ line-height: 130%;
+}
+
+#wpbody-content .inline-edit-row .input-text-wrap input {
+ width: 95%;
+}
+
+#wpbody-content .inline-edit-row .input-text-wrap input.inline-edit-password-input {
+ width: 8em;
+}
+/* end Inline Editor */
+
+#titlediv #title {
+ width: 98%;
+}
+
+.button,
+input[type="reset"],
+input[type="button"],
+input[type="submit"] {
+ padding: 0 8px;
+ line-height: 20px;
+ height: auto;
+}
+
+.button.button-large,
+input[type="reset"].button-large,
+input[type="button"].button-large,
+input[type="submit"].button-large {
+ padding: 0 10px;
+ line-height: 24px;
+ height: auto;
+}
+
+.button.button-small,
+input[type="reset"].button-small,
+input[type="button"].button-small,
+input[type="submit"].button-small {
+ padding: 0 6px;
+ line-height: 16px;
+ height: auto;
+}
+
+a.button {
+ margin: 1px;
+ padding: 1px 9px 2px;
+}
+
+a.button.button-large {
+ padding: 1px 11px 2px;
+}
+
+a.button.button-small {
+ padding: 1px 7px 2px;
+}
+
+#screen-options-wrap {
+ overflow: hidden;
+}
+
+#the-comment-list .comment-item,
+#post-status-info,
+#wpwrap,
+#wrap,
+#postdivrich,
+#postdiv,
+#poststuff,
+.metabox-holder,
+#titlediv,
+#post-body,
+#editorcontainer,
+.tablenav,
+.widget-liquid-left,
+.widget-liquid-right,
+#widgets-left,
+.widgets-sortables,
+#dragHelper,
+.widget .widget-top,
+.widget-control-actions,
+.tagchecklist,
+#col-container,
+#col-left,
+#col-right,
+.fileedit-sub {
+ display: block;
+ zoom: 100%;
+}
+
+p.search-box {
+ position: static;
+ float: right;
+ margin: -3px 0 4px;
+}
+
+#widget-list .widget {
+ display: inline;
+}
+
+#editorcontainer #content {
+ overflow: auto;
+ margin: auto;
+ width: 98%;
+}
+
+form#template div {
+ width: 100%;
+}
+
+.wp-editor-container .quicktags-toolbar input {
+ overflow: visible;
+ padding: 0 4px;
+}
+
+#poststuff h2 {
+ font-size: 1.6em;
+}
+
+#poststuff .inside #parent_id,
+#poststuff .inside #page_template,
+.inline-edit-row #post_parent,
+.inline-edit-row select[name="page_template"] {
+ width: 250px;
+}
+
+#submitdiv input,
+#submitdiv select,
+#submitdiv a.button {
+ position: relative;
+}
+
+#bh {
+ margin: 7px 10px 0 0;
+ float: right;
+}
+
+/* without this dashboard widgets appear in one column for some screen widths */
+div#dashboard-widgets {
+ padding-right: 1px;
+}
+
+.tagchecklist > li, .tagchecklist .ntdelbutton {
+ display: inline-block;
+ display: block;
+}
+
+.tagchecklist .ntdelbutton:focus .remove-tag-icon:before {
+ outline: 1px solid #5b9dd9;
+}
+
+.tablenav .button,
+.nav .button {
+ padding-top: 2px;
+ padding-bottom: 2px;
+}
+
+.tablenav select {
+ font-size: 13px;
+ display: inline-block;
+ vertical-align: top;
+ margin-top: 2px;
+}
+
+.tablenav .actions select {
+ width: 155px;
+}
+
+.subsubsub li {
+ display: inline;
+}
+
+table.ie-fixed {
+ table-layout: fixed;
+}
+
+.widefat tr,
+.widefat th,
+.widefat thead td,
+.widefat tfoot td {
+ margin-bottom: 0;
+ border-spacing: 0;
+}
+
+.widefat th input,
+.widefat thead td input,
+.widefat tfoot td input {
+ margin: 0 0 0 5px;
+}
+
+.widefat thead .check-column,
+.widefat tfoot .check-column {
+ padding-top: 6px;
+}
+
+.widefat tbody th.check-column,
+.media.widefat tbody th.check-column {
+ padding: 4px 0 0;
+}
+
+.widefat {
+ empty-cells: show;
+ border-collapse: collapse;
+}
+
+.tablenav a.button {
+ display: inline-block;
+ padding: 2px 5px;
+}
+
+.inactive-sidebar .widgets-sortables {
+ padding-bottom: 8px;
+}
+
+#available-widgets .widget-holder {
+ padding-bottom: 65px;
+}
+
+#widgets-left .inactive {
+ padding-bottom: 10px;
+}
+
+.widget-liquid-right .widget,
+.inactive-sidebar .widget {
+ position: relative;
+}
+
+.inactive-sidebar .widget {
+ display: block;
+ float: left;
+}
+
+#wpcontent .button-primary-disabled {
+ color: #9FD0D5;
+ background: #298CBA;
+}
+
+#the-comment-list .unapproved tr,
+#the-comment-list .unapproved td {
+ background-color: #ffffe0;
+}
+
+.imgedit-submit {
+ width: 300px;
+}
+
+#nav-menus-frame,
+#wpbody,
+.menu li {
+ zoom: 100%;
+}
+
+#update-nav-menu #post-body {
+ overflow: hidden;
+}
+
+.menu li {
+ min-width: 100%;
+}
+
+.menu li.sortable-placeholder {
+ min-width: 400px;
+}
+
+.available-theme {
+ display: inline;
+}
+
+.available-theme ul {
+ margin: 0;
+}
+
+.available-theme .action-links li {
+ padding-right: 7px;
+ margin-right: 7px;
+}
+
+.about-wrap .three-col.about-updates .col-2 {
+ width: 15%;
+}
+
+.about-wrap .about-password-meter input {
+ width: 98%;
+}
+
+.revisions-tickmarks,
+.revisions-tooltip {
+ display: none !important;
+}
+
+.revisions.pinned .revisions-controls {
+ position: relative;
+}
+
+input[type="password"],
+.login form .input {
+ font-family: sans-serif;
+}
+
+/* TinyMCE icons */
+.mce-btn i.mce-i-bold,
+.mce-btn i.mce-i-italic,
+.mce-btn i.mce-i-bullist,
+.mce-btn i.mce-i-numlist,
+.mce-btn i.mce-i-blockquote,
+.mce-btn i.mce-i-alignleft,
+.mce-btn i.mce-i-aligncenter,
+.mce-btn i.mce-i-alignright,
+.mce-btn i.mce-i-link,
+.mce-btn i.mce-i-unlink,
+.mce-btn i.mce-i-wp_more,
+.mce-btn i.mce-i-strikethrough,
+.mce-btn i.mce-i-spellchecker,
+.mce-btn i.mce-i-fullscreen,
+.mce-btn i.mce-i-wp_fullscreen,
+.mce-btn i.mce-i-wp_adv,
+.mce-btn i.mce-i-underline,
+.mce-btn i.mce-i-alignjustify,
+.mce-btn i.mce-i-forecolor,
+.mce-btn i.mce-i-pastetext,
+.mce-btn i.mce-i-pasteword,
+.mce-btn i.mce-i-removeformat,
+.mce-btn i.mce-i-charmap,
+.mce-btn i.mce-i-outdent,
+.mce-btn i.mce-i-indent,
+.mce-btn i.mce-i-undo,
+.mce-btn i.mce-i-redo,
+.mce-btn i.mce-i-help,
+.mce-btn i.mce-i-wp_help,
+.mce-btn i.mce-i-wp-media-library,
+.mce-btn i.mce-i-ltr,
+.mce-btn i.mce-i-wp_page,
+.mce-btn i.mce-i-hr,
+.mce-close {
+ font-family: tinymce, Arial;
+ font-style: normal;
+ font-weight: 400;
+ font-variant: normal;
+ font-size: 16px;
+ margin-left: 0;
+ padding-right: 0;
+}
+
+.mce-btn i.mce-i-wp_fullscreen,
+.qt-fullscreen {
+ -ie7-icon: "\e023";
+}
+
+.mce-btn i.mce-i-wp_more,
+.mce-btn i.mce-i-wp_page {
+ -ie7-icon: "\e027";
+}
+
+.mce-btn i.mce-i-wp_adv {
+ background-color: #a0a5aa;
+}
+
+.mce-btn i.mce-i-help,
+.mce-btn i.mce-i-wp_help {
+ -ie7-icon: "\e016";
+}
+
+
+/* IE6 leftovers */
+* html .row-actions {
+ visibility: visible;
+}
+
+* html div.widget-liquid-left,
+* html div.widget-liquid-right {
+ display: block;
+ position: relative;
+}
+
+* html #editorcontainer {
+ padding: 0;
+}
+
+* html #poststuff h2 {
+ margin-left: 0;
+}
+
+* html .stuffbox,
+* html .stuffbox input,
+* html .stuffbox textarea {
+ border: 1px solid #ddd;
+}
+
+* html div.widget-liquid-left {
+ width: 99%;
+}
+
+* html .widgets-sortables {
+ height: 50px;
+}
+
+* html a#content_resize {
+ right: -2px;
+}
+
+* html .widget-title h4 {
+ width: 205px;
+}
+
+* html #removing-widget .in-widget-title {
+ display: none;
+}
+
+* html .media-item .pinkynail {
+ height: 32px;
+ width: 40px;
+}
+
+* html .describe .field input.text,
+* html .describe .field textarea {
+ width: 440px;
+}
+
+* html input {
+ border: 1px solid #ddd;
+}
+
+* html .edit-box {
+ display: inline;
+}
+
+* html .postbox-container .meta-box-sortables {
+ height: 300px;
+}
+
+* html #wpbody-content #screen-options-link-wrap {
+ display: inline-block;
+ width: 150px;
+ text-align: center;
+}
+
+* html #wpbody-content #contextual-help-link-wrap {
+ display: inline-block;
+ width: 100px;
+ text-align: center;
+}
+
+* html #adminmenu {
+ margin-left: -80px;
+}
+
+* html .folded #adminmenu {
+ margin-left: -22px;
+}
+
+* html #wpcontent #adminmenu li.menu-top {
+ display: inline;
+ padding: 0;
+ margin: 0;
+}
+
+* html #wpfooter {
+ margin: 0;
+}
+
+* html #adminmenu div.wp-menu-image {
+ height: 29px;
+}
diff --git a/www/crm/wp-admin/css/ie.min.css b/www/crm/wp-admin/css/ie.min.css
new file mode 100644
index 00000000..47ecfda9
--- /dev/null
+++ b/www/crm/wp-admin/css/ie.min.css
@@ -0,0 +1,2 @@
+/*! This file is auto-generated */
+#dashboard-widgets form .input-text-wrap input,#dashboard-widgets form .textarea-wrap textarea{width:99%}#dashboard-widgets form #title{width:98%}#wpbody-content #dashboard-widgets .postbox-container{width:49.5%}#wpbody-content #dashboard-widgets #postbox-container-2,#wpbody-content #dashboard-widgets #postbox-container-3,#wpbody-content #dashboard-widgets #postbox-container-4{float:right;width:50.5%}#dashboard-widgets #postbox-container-3 .empty-container,#dashboard-widgets #postbox-container-4 .empty-container{border:0 none;height:0;min-height:0}.wp-editor-wrap .wp-editor-container,.wp-editor-wrap .wp-editor-tabs,.wp-editor-wrap .wp-editor-tools,.wp-editor-wrap .wp-switch-editor{zoom:100%}.wp-editor-wrap .wp-editor-container textarea.wp-editor-area{width:97%}#post-body.columns-2 #postbox-container-1{padding-left:19px}.welcome-panel .wp-badge{position:absolute}.welcome-panel .welcome-panel-column:first-child{width:35%}#adminmenuback{left:0;background-image:none}#adminmenuwrap{position:static}#adminmenu{position:relative}#adminmenu,#adminmenu a{cursor:pointer}#adminmenu li.wp-menu-separator,#adminmenu li.wp-menu-separator-last{font-size:1px;line-height:1}#adminmenu a.menu-top{border-bottom:0 none;border-top:1px solid #ddd}#adminmenu .separator{font-size:1px;line-height:1px}#adminmenu .wp-submenu{left:110px}#adminmenu .wp-submenu ul{margin:0}.folded #wpcontent,.folded #wpfooter{margin-left:170px}.folded #adminmenu,.folded #adminmenu li.menu-top,.folded #adminmenuback,.folded #adminmenuwrap{width:150px}.folded #adminmenu .wp-submenu{border-top-color:transparent}.folded #adminmenu .wp-menu-name{display:block}.folded #adminmenu .opensub .wp-submenu,.folded #adminmenu .wp-submenu.sub-open{left:110px}.folded #adminmenu .wp-has-current-submenu .wp-submenu,.folded #adminmenu a.wp-has-current-submenu:focus+.wp-submenu{top:-1px;position:relative}.folded #adminmenu .wp-has-current-submenu .wp-submenu .wp-submenu-head{background-color:transparent}#adminmenu .wp-submenu .wp-submenu-head{border-top-color:#ddd}.folded #adminmenu .wp-submenu ul{margin-left:5px}#adminmenu li.menu-top{margin-bottom:-2px}#adminmenu .wp-menu-arrow{display:none!important}.js.folded #adminmenu li.menu-top{display:block;zoom:100%}ul#adminmenu{z-index:99}#adminmenu li.menu-top a.menu-top{min-width:auto;width:auto}#wpcontent #adminmenu li.wp-has-current-submenu a.wp-has-submenu{font-style:normal}#wpcontent #adminmenu .wp-submenu li{padding:0}#adminmenu li.wp-has-current-submenu .wp-submenu{left:-40px}#adminmenu .wp-menu-image{display:none!important}#adminmenu a.menu-top .wp-menu-name{padding-left:8px}#collapse-menu{line-height:23px}#wpadminbar .ab-comments-icon{padding-top:7px}.theme-browser .theme{width:30%;margin:0 3% 4% 0;cursor:auto}.theme-browser .theme:focus,.theme-browser .theme:hover{cursor:auto}.theme-browser .theme .theme-screenshot{height:180px}.theme-browser .theme .theme-actions{position:static;background-color:#e8e8e8}.theme-browser .theme .more-details{display:none}.plugins td,.plugins th{border-top:1px solid #ddd}table.fixed td,table.fixed th{border-top:1px solid #ddd}#wpbody-content input.button,#wpbody-content input.button-primary{overflow:visible}#dashboard-widgets h3 a{height:14px;line-height:14px}#dashboard_browser_nag{color:#fff}#dashboard_browser_nag .browser-icon{position:relative}.tablenav-pages .current-page{vertical-align:middle}#wpbody-content .postbox{border:1px solid #ddd}#wpbody-content .postbox .hndle{margin-bottom:-1px}#addcat,#editcat,#template,#template div,.major-publishing-actions,.wp-submenu,.wp-submenu li{zoom:100%}.wp-menu-arrow{height:28px}.submitbox{margin-top:10px}#wpbody-content .quick-edit-row-post .inline-edit-col-left{width:39%}#wpbody-content .inline-edit-row-post .inline-edit-col-center{width:19%}#wpbody-content .quick-edit-row-page .inline-edit-col-left{width:49%}#wpbody-content .bulk-edit-row .inline-edit-col-left{width:29%}.inline-edit-row .submit{zoom:100%}.inline-edit-row fieldset label span.title{display:block;float:left;width:5em}.inline-edit-row fieldset label span.input-text-wrap{margin-left:0;zoom:100%}#wpbody-content .inline-edit-row fieldset label span.input-text-wrap input{line-height:130%}#wpbody-content .inline-edit-row .input-text-wrap input{width:95%}#wpbody-content .inline-edit-row .input-text-wrap input.inline-edit-password-input{width:8em}#titlediv #title{width:98%}.button,input[type=button],input[type=reset],input[type=submit]{padding:0 8px;line-height:20px;height:auto}.button.button-large,input[type=button].button-large,input[type=reset].button-large,input[type=submit].button-large{padding:0 10px;line-height:24px;height:auto}.button.button-small,input[type=button].button-small,input[type=reset].button-small,input[type=submit].button-small{padding:0 6px;line-height:16px;height:auto}a.button{margin:1px;padding:1px 9px 2px}a.button.button-large{padding:1px 11px 2px}a.button.button-small{padding:1px 7px 2px}#screen-options-wrap{overflow:hidden}#col-container,#col-left,#col-right,#dragHelper,#editorcontainer,#post-body,#post-status-info,#postdiv,#postdivrich,#poststuff,#the-comment-list .comment-item,#titlediv,#widgets-left,#wpwrap,#wrap,.fileedit-sub,.metabox-holder,.tablenav,.tagchecklist,.widget .widget-top,.widget-control-actions,.widget-liquid-left,.widget-liquid-right,.widgets-sortables{display:block;zoom:100%}p.search-box{position:static;float:right;margin:-3px 0 4px}#widget-list .widget{display:inline}#editorcontainer #content{overflow:auto;margin:auto;width:98%}form#template div{width:100%}.wp-editor-container .quicktags-toolbar input{overflow:visible;padding:0 4px}#poststuff h2{font-size:1.6em}#poststuff .inside #page_template,#poststuff .inside #parent_id,.inline-edit-row #post_parent,.inline-edit-row select[name=page_template]{width:250px}#submitdiv a.button,#submitdiv input,#submitdiv select{position:relative}#bh{margin:7px 10px 0 0;float:right}div#dashboard-widgets{padding-right:1px}.tagchecklist .ntdelbutton,.tagchecklist>li{display:inline-block;display:block}.tagchecklist .ntdelbutton:focus .remove-tag-icon:before{outline:1px solid #5b9dd9}.nav .button,.tablenav .button{padding-top:2px;padding-bottom:2px}.tablenav select{font-size:13px;display:inline-block;vertical-align:top;margin-top:2px}.tablenav .actions select{width:155px}.subsubsub li{display:inline}table.ie-fixed{table-layout:fixed}.widefat tfoot td,.widefat th,.widefat thead td,.widefat tr{margin-bottom:0;border-spacing:0}.widefat tfoot td input,.widefat th input,.widefat thead td input{margin:0 0 0 5px}.widefat tfoot .check-column,.widefat thead .check-column{padding-top:6px}.media.widefat tbody th.check-column,.widefat tbody th.check-column{padding:4px 0 0}.widefat{empty-cells:show;border-collapse:collapse}.tablenav a.button{display:inline-block;padding:2px 5px}.inactive-sidebar .widgets-sortables{padding-bottom:8px}#available-widgets .widget-holder{padding-bottom:65px}#widgets-left .inactive{padding-bottom:10px}.inactive-sidebar .widget,.widget-liquid-right .widget{position:relative}.inactive-sidebar .widget{display:block;float:left}#wpcontent .button-primary-disabled{color:#9fd0d5;background:#298cba}#the-comment-list .unapproved td,#the-comment-list .unapproved tr{background-color:#ffffe0}.imgedit-submit{width:300px}#nav-menus-frame,#wpbody,.menu li{zoom:100%}#update-nav-menu #post-body{overflow:hidden}.menu li{min-width:100%}.menu li.sortable-placeholder{min-width:400px}.available-theme{display:inline}.available-theme ul{margin:0}.available-theme .action-links li{padding-right:7px;margin-right:7px}.about-wrap .three-col.about-updates .col-2{width:15%}.about-wrap .about-password-meter input{width:98%}.revisions-tickmarks,.revisions-tooltip{display:none!important}.revisions.pinned .revisions-controls{position:relative}.login form .input,input[type=password]{font-family:sans-serif}.mce-btn i.mce-i-aligncenter,.mce-btn i.mce-i-alignjustify,.mce-btn i.mce-i-alignleft,.mce-btn i.mce-i-alignright,.mce-btn i.mce-i-blockquote,.mce-btn i.mce-i-bold,.mce-btn i.mce-i-bullist,.mce-btn i.mce-i-charmap,.mce-btn i.mce-i-forecolor,.mce-btn i.mce-i-fullscreen,.mce-btn i.mce-i-help,.mce-btn i.mce-i-hr,.mce-btn i.mce-i-indent,.mce-btn i.mce-i-italic,.mce-btn i.mce-i-link,.mce-btn i.mce-i-ltr,.mce-btn i.mce-i-numlist,.mce-btn i.mce-i-outdent,.mce-btn i.mce-i-pastetext,.mce-btn i.mce-i-pasteword,.mce-btn i.mce-i-redo,.mce-btn i.mce-i-removeformat,.mce-btn i.mce-i-spellchecker,.mce-btn i.mce-i-strikethrough,.mce-btn i.mce-i-underline,.mce-btn i.mce-i-undo,.mce-btn i.mce-i-unlink,.mce-btn i.mce-i-wp-media-library,.mce-btn i.mce-i-wp_adv,.mce-btn i.mce-i-wp_fullscreen,.mce-btn i.mce-i-wp_help,.mce-btn i.mce-i-wp_more,.mce-btn i.mce-i-wp_page,.mce-close{font-family:tinymce,Arial;font-style:normal;font-weight:400;font-variant:normal;font-size:16px;margin-left:0;padding-right:0}.mce-btn i.mce-i-wp_fullscreen,.qt-fullscreen{-ie7-icon:"\e023"}.mce-btn i.mce-i-wp_more,.mce-btn i.mce-i-wp_page{-ie7-icon:"\e027"}.mce-btn i.mce-i-wp_adv{background-color:#a0a5aa}.mce-btn i.mce-i-help,.mce-btn i.mce-i-wp_help{-ie7-icon:"\e016"}* html .row-actions{visibility:visible}* html div.widget-liquid-left,* html div.widget-liquid-right{display:block;position:relative}* html #editorcontainer{padding:0}* html #poststuff h2{margin-left:0}* html .stuffbox,* html .stuffbox input,* html .stuffbox textarea{border:1px solid #ddd}* html div.widget-liquid-left{width:99%}* html .widgets-sortables{height:50px}* html a#content_resize{right:-2px}* html .widget-title h4{width:205px}* html #removing-widget .in-widget-title{display:none}* html .media-item .pinkynail{height:32px;width:40px}* html .describe .field input.text,* html .describe .field textarea{width:440px}* html input{border:1px solid #ddd}* html .edit-box{display:inline}* html .postbox-container .meta-box-sortables{height:300px}* html #wpbody-content #screen-options-link-wrap{display:inline-block;width:150px;text-align:center}* html #wpbody-content #contextual-help-link-wrap{display:inline-block;width:100px;text-align:center}* html #adminmenu{margin-left:-80px}* html .folded #adminmenu{margin-left:-22px}* html #wpcontent #adminmenu li.menu-top{display:inline;padding:0;margin:0}* html #wpfooter{margin:0}* html #adminmenu div.wp-menu-image{height:29px} \ No newline at end of file
diff --git a/www/crm/wp-admin/css/install-rtl.css b/www/crm/wp-admin/css/install-rtl.css
new file mode 100644
index 00000000..e0e77c56
--- /dev/null
+++ b/www/crm/wp-admin/css/install-rtl.css
@@ -0,0 +1,374 @@
+html {
+ background: #f1f1f1;
+ margin: 0 20px;
+}
+
+body {
+ background: #fff;
+ color: #444;
+ font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
+ margin: 140px auto 25px;
+ padding: 20px 20px 10px 20px;
+ max-width: 700px;
+ -webkit-font-smoothing: subpixel-antialiased;
+ box-shadow: 0 1px 3px rgba(0, 0, 0, 0.13);
+}
+
+a {
+ color: #0073aa;
+}
+
+a:hover,
+a:active {
+ color: #00a0d2;
+}
+
+a:focus {
+ color: #124964;
+ box-shadow:
+ 0 0 0 1px #5b9dd9,
+ 0 0 2px 1px rgba(30, 140, 190, 0.8);
+}
+
+.ie8 a:focus {
+ outline: #5b9dd9 solid 1px;
+}
+
+h1, h2 {
+ border-bottom: 1px solid #ddd;
+ clear: both;
+ color: #666;
+ font-size: 24px;
+ padding: 0;
+ padding-bottom: 7px;
+ font-weight: 400;
+}
+
+h3 {
+ font-size: 16px;
+}
+
+p, li, dd, dt {
+ padding-bottom: 2px;
+ font-size: 14px;
+ line-height: 1.5;
+}
+
+code, .code {
+ font-family: Consolas, Monaco, monospace;
+}
+
+ul, ol, dl {
+ padding: 5px 22px 5px 5px;
+}
+
+a img {
+ border: 0
+}
+abbr {
+ border: 0;
+ font-variant: normal;
+}
+
+fieldset {
+ border: 0;
+ padding: 0;
+ margin: 0;
+}
+
+label {
+ cursor: pointer;
+}
+
+#logo {
+ margin: 6px 0 14px 0;
+ padding: 0 0 7px 0;
+ border-bottom: none;
+ text-align: center
+}
+#logo a {
+ background-image: url(../images/w-logo-blue.png?ver=20131202);
+ background-image: none, url(../images/wordpress-logo.svg?ver=20131107);
+ background-size: 84px;
+ background-position: center top;
+ background-repeat: no-repeat;
+ color: #444; /* same as login.css */
+ height: 84px;
+ font-size: 20px;
+ font-weight: 400;
+ line-height: 1.3em;
+ margin: -130px auto 25px;
+ padding: 0;
+ text-decoration: none;
+ width: 84px;
+ text-indent: -9999px;
+ outline: none;
+ overflow: hidden;
+ display: block;
+}
+
+.step {
+ margin: 20px 0 15px;
+}
+.step, th {
+ text-align: right;
+ padding: 0;
+}
+.language-chooser.wp-core-ui .step .button.button-large {
+ height: 36px;
+ font-size: 14px;
+ line-height: 33px;
+ vertical-align: middle;
+}
+textarea {
+ border: 1px solid #ddd;
+ font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
+ width: 100%;
+ box-sizing: border-box;
+}
+
+.form-table {
+ border-collapse: collapse;
+ margin-top: 1em;
+ width: 100%;
+}
+
+.form-table td {
+ margin-bottom: 9px;
+ padding: 10px 0 10px 20px;
+ font-size: 14px;
+ vertical-align: top
+}
+
+.form-table th {
+ font-size: 14px;
+ text-align: right;
+ padding: 10px 0 10px 20px;
+ width: 140px;
+ vertical-align: top;
+}
+
+.form-table code {
+ line-height: 18px;
+ font-size: 14px;
+}
+
+.form-table p {
+ margin: 4px 0 0 0;
+ font-size: 11px;
+}
+
+.form-table input {
+ line-height: 20px;
+ font-size: 15px;
+ padding: 3px 5px;
+ border: 1px solid #ddd;
+ box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.07);
+}
+
+input,
+submit {
+ font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
+}
+
+.form-table input[type=text],
+.form-table input[type=email],
+.form-table input[type=url],
+.form-table input[type=password],
+#pass-strength-result {
+ width: 218px;
+}
+
+.form-table th p {
+ font-weight: 400;
+}
+
+.form-table.install-success th,
+.form-table.install-success td {
+ vertical-align: middle;
+ padding: 16px 0 16px 20px;
+}
+
+.form-table.install-success td p {
+ margin: 0;
+ font-size: 14px;
+}
+
+.form-table.install-success td code {
+ margin: 0;
+ font-size: 18px;
+}
+
+#error-page {
+ margin-top: 50px;
+}
+
+#error-page p {
+ font-size: 14px;
+ line-height: 18px;
+ margin: 25px 0 20px;
+}
+
+#error-page code, .code {
+ font-family: Consolas, Monaco, monospace;
+}
+
+.message {
+ border-right: 4px solid #dc3232;
+ padding: .7em .6em;
+ background-color: #fbeaea;
+}
+
+/* rtl:ignore */
+#dbname,
+#uname,
+#pwd,
+#dbhost,
+#prefix,
+#user_login,
+#admin_email,
+#pass1,
+#pass2 {
+ direction: ltr;
+}
+
+
+/* localization */
+body.rtl,
+.rtl textarea,
+.rtl input,
+.rtl submit {
+ font-family: Tahoma, sans-serif;
+}
+
+:lang(he-il) body.rtl,
+:lang(he-il) .rtl textarea,
+:lang(he-il) .rtl input,
+:lang(he-il) .rtl submit {
+ font-family: Arial, sans-serif;
+}
+
+@media only screen and (max-width: 799px) {
+ body {
+ margin-top: 115px;
+ }
+ #logo a {
+ margin: -125px auto 30px;
+ }
+}
+
+@media screen and (max-width: 782px) {
+
+ .form-table {
+ margin-top: 0;
+ }
+
+ .form-table th,
+ .form-table td {
+ display: block;
+ width: auto;
+ vertical-align: middle;
+ }
+
+ .form-table th {
+ padding: 20px 0 0;
+ }
+
+ .form-table td {
+ padding: 5px 0;
+ border: 0;
+ margin: 0;
+ }
+
+ textarea,
+ input {
+ font-size: 16px;
+ }
+
+ .form-table td input[type="text"],
+ .form-table td input[type="email"],
+ .form-table td input[type="url"],
+ .form-table td input[type="password"],
+ .form-table td select,
+ .form-table td textarea,
+ .form-table span.description {
+ width: 100%;
+ font-size: 16px;
+ line-height: 1.5;
+ padding: 7px 10px;
+ display: block;
+ max-width: none;
+ box-sizing: border-box;
+ }
+
+}
+
+body.language-chooser {
+ max-width: 300px;
+}
+
+.language-chooser select {
+ padding: 8px;
+ width: 100%;
+ display: block;
+ border: 1px solid #ddd;
+ background-color: #fff;
+ color: #32373c;
+ font-size: 16px;
+ font-family: Arial, sans-serif;
+ font-weight: 400;
+}
+
+.language-chooser p {
+ text-align: left;
+}
+
+.screen-reader-input,
+.screen-reader-text {
+ border: 0;
+ clip: rect(1px, 1px, 1px, 1px);
+ -webkit-clip-path: inset(50%);
+ clip-path: inset(50%);
+ height: 1px;
+ margin: -1px;
+ overflow: hidden;
+ padding: 0;
+ position: absolute;
+ width: 1px;
+ word-wrap: normal !important;
+}
+
+.spinner {
+ background: url(../images/spinner.gif) no-repeat;
+ background-size: 20px 20px;
+ visibility: hidden;
+ opacity: 0.7;
+ filter: alpha(opacity=70);
+ width: 20px;
+ height: 20px;
+ margin: 2px 5px 0;
+}
+
+.step .spinner {
+ display: inline-block;
+ vertical-align: middle;
+ margin-left: 15px;
+}
+
+.button.hide-if-no-js,
+.hide-if-no-js {
+ display: none;
+}
+
+/**
+ * HiDPI Displays
+ */
+@media print,
+ (-webkit-min-device-pixel-ratio: 1.25),
+ (min-resolution: 120dpi) {
+
+ .spinner {
+ background-image: url(../images/spinner-2x.gif);
+ }
+
+}
diff --git a/www/crm/wp-admin/css/install-rtl.min.css b/www/crm/wp-admin/css/install-rtl.min.css
new file mode 100644
index 00000000..ff72035d
--- /dev/null
+++ b/www/crm/wp-admin/css/install-rtl.min.css
@@ -0,0 +1,2 @@
+/*! This file is auto-generated */
+html{background:#f1f1f1;margin:0 20px}body{background:#fff;color:#444;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif;margin:140px auto 25px;padding:20px 20px 10px 20px;max-width:700px;-webkit-font-smoothing:subpixel-antialiased;box-shadow:0 1px 3px rgba(0,0,0,.13)}a{color:#0073aa}a:active,a:hover{color:#00a0d2}a:focus{color:#124964;box-shadow:0 0 0 1px #5b9dd9,0 0 2px 1px rgba(30,140,190,.8)}.ie8 a:focus{outline:#5b9dd9 solid 1px}h1,h2{border-bottom:1px solid #ddd;clear:both;color:#666;font-size:24px;padding:0;padding-bottom:7px;font-weight:400}h3{font-size:16px}dd,dt,li,p{padding-bottom:2px;font-size:14px;line-height:1.5}.code,code{font-family:Consolas,Monaco,monospace}dl,ol,ul{padding:5px 22px 5px 5px}a img{border:0}abbr{border:0;font-variant:normal}fieldset{border:0;padding:0;margin:0}label{cursor:pointer}#logo{margin:6px 0 14px 0;padding:0 0 7px 0;border-bottom:none;text-align:center}#logo a{background-image:url(../images/w-logo-blue.png?ver=20131202);background-image:none,url(../images/wordpress-logo.svg?ver=20131107);background-size:84px;background-position:center top;background-repeat:no-repeat;color:#444;height:84px;font-size:20px;font-weight:400;line-height:1.3em;margin:-130px auto 25px;padding:0;text-decoration:none;width:84px;text-indent:-9999px;outline:0;overflow:hidden;display:block}.step{margin:20px 0 15px}.step,th{text-align:right;padding:0}.language-chooser.wp-core-ui .step .button.button-large{height:36px;font-size:14px;line-height:33px;vertical-align:middle}textarea{border:1px solid #ddd;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif;width:100%;box-sizing:border-box}.form-table{border-collapse:collapse;margin-top:1em;width:100%}.form-table td{margin-bottom:9px;padding:10px 0 10px 20px;font-size:14px;vertical-align:top}.form-table th{font-size:14px;text-align:right;padding:10px 0 10px 20px;width:140px;vertical-align:top}.form-table code{line-height:18px;font-size:14px}.form-table p{margin:4px 0 0 0;font-size:11px}.form-table input{line-height:20px;font-size:15px;padding:3px 5px;border:1px solid #ddd;box-shadow:inset 0 1px 2px rgba(0,0,0,.07)}input,submit{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif}#pass-strength-result,.form-table input[type=email],.form-table input[type=password],.form-table input[type=text],.form-table input[type=url]{width:218px}.form-table th p{font-weight:400}.form-table.install-success td,.form-table.install-success th{vertical-align:middle;padding:16px 0 16px 20px}.form-table.install-success td p{margin:0;font-size:14px}.form-table.install-success td code{margin:0;font-size:18px}#error-page{margin-top:50px}#error-page p{font-size:14px;line-height:18px;margin:25px 0 20px}#error-page code,.code{font-family:Consolas,Monaco,monospace}.message{border-right:4px solid #dc3232;padding:.7em .6em;background-color:#fbeaea}#admin_email,#dbhost,#dbname,#pass1,#pass2,#prefix,#pwd,#uname,#user_login{direction:ltr}.rtl input,.rtl submit,.rtl textarea,body.rtl{font-family:Tahoma,sans-serif}:lang(he-il) .rtl input,:lang(he-il) .rtl submit,:lang(he-il) .rtl textarea,:lang(he-il) body.rtl{font-family:Arial,sans-serif}@media only screen and (max-width:799px){body{margin-top:115px}#logo a{margin:-125px auto 30px}}@media screen and (max-width:782px){.form-table{margin-top:0}.form-table td,.form-table th{display:block;width:auto;vertical-align:middle}.form-table th{padding:20px 0 0}.form-table td{padding:5px 0;border:0;margin:0}input,textarea{font-size:16px}.form-table span.description,.form-table td input[type=email],.form-table td input[type=password],.form-table td input[type=text],.form-table td input[type=url],.form-table td select,.form-table td textarea{width:100%;font-size:16px;line-height:1.5;padding:7px 10px;display:block;max-width:none;box-sizing:border-box}}body.language-chooser{max-width:300px}.language-chooser select{padding:8px;width:100%;display:block;border:1px solid #ddd;background-color:#fff;color:#32373c;font-size:16px;font-family:Arial,sans-serif;font-weight:400}.language-chooser p{text-align:left}.screen-reader-input,.screen-reader-text{border:0;clip:rect(1px,1px,1px,1px);-webkit-clip-path:inset(50%);clip-path:inset(50%);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;word-wrap:normal!important}.spinner{background:url(../images/spinner.gif) no-repeat;background-size:20px 20px;visibility:hidden;opacity:.7;filter:alpha(opacity=70);width:20px;height:20px;margin:2px 5px 0}.step .spinner{display:inline-block;vertical-align:middle;margin-left:15px}.button.hide-if-no-js,.hide-if-no-js{display:none}@media print,(-webkit-min-device-pixel-ratio:1.25),(min-resolution:120dpi){.spinner{background-image:url(../images/spinner-2x.gif)}} \ No newline at end of file
diff --git a/www/crm/wp-admin/css/install.css b/www/crm/wp-admin/css/install.css
new file mode 100644
index 00000000..c67de737
--- /dev/null
+++ b/www/crm/wp-admin/css/install.css
@@ -0,0 +1,374 @@
+html {
+ background: #f1f1f1;
+ margin: 0 20px;
+}
+
+body {
+ background: #fff;
+ color: #444;
+ font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
+ margin: 140px auto 25px;
+ padding: 20px 20px 10px 20px;
+ max-width: 700px;
+ -webkit-font-smoothing: subpixel-antialiased;
+ box-shadow: 0 1px 3px rgba(0, 0, 0, 0.13);
+}
+
+a {
+ color: #0073aa;
+}
+
+a:hover,
+a:active {
+ color: #00a0d2;
+}
+
+a:focus {
+ color: #124964;
+ box-shadow:
+ 0 0 0 1px #5b9dd9,
+ 0 0 2px 1px rgba(30, 140, 190, 0.8);
+}
+
+.ie8 a:focus {
+ outline: #5b9dd9 solid 1px;
+}
+
+h1, h2 {
+ border-bottom: 1px solid #ddd;
+ clear: both;
+ color: #666;
+ font-size: 24px;
+ padding: 0;
+ padding-bottom: 7px;
+ font-weight: 400;
+}
+
+h3 {
+ font-size: 16px;
+}
+
+p, li, dd, dt {
+ padding-bottom: 2px;
+ font-size: 14px;
+ line-height: 1.5;
+}
+
+code, .code {
+ font-family: Consolas, Monaco, monospace;
+}
+
+ul, ol, dl {
+ padding: 5px 5px 5px 22px;
+}
+
+a img {
+ border: 0
+}
+abbr {
+ border: 0;
+ font-variant: normal;
+}
+
+fieldset {
+ border: 0;
+ padding: 0;
+ margin: 0;
+}
+
+label {
+ cursor: pointer;
+}
+
+#logo {
+ margin: 6px 0 14px 0;
+ padding: 0 0 7px 0;
+ border-bottom: none;
+ text-align: center
+}
+#logo a {
+ background-image: url(../images/w-logo-blue.png?ver=20131202);
+ background-image: none, url(../images/wordpress-logo.svg?ver=20131107);
+ background-size: 84px;
+ background-position: center top;
+ background-repeat: no-repeat;
+ color: #444; /* same as login.css */
+ height: 84px;
+ font-size: 20px;
+ font-weight: 400;
+ line-height: 1.3em;
+ margin: -130px auto 25px;
+ padding: 0;
+ text-decoration: none;
+ width: 84px;
+ text-indent: -9999px;
+ outline: none;
+ overflow: hidden;
+ display: block;
+}
+
+.step {
+ margin: 20px 0 15px;
+}
+.step, th {
+ text-align: left;
+ padding: 0;
+}
+.language-chooser.wp-core-ui .step .button.button-large {
+ height: 36px;
+ font-size: 14px;
+ line-height: 33px;
+ vertical-align: middle;
+}
+textarea {
+ border: 1px solid #ddd;
+ font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
+ width: 100%;
+ box-sizing: border-box;
+}
+
+.form-table {
+ border-collapse: collapse;
+ margin-top: 1em;
+ width: 100%;
+}
+
+.form-table td {
+ margin-bottom: 9px;
+ padding: 10px 20px 10px 0;
+ font-size: 14px;
+ vertical-align: top
+}
+
+.form-table th {
+ font-size: 14px;
+ text-align: left;
+ padding: 10px 20px 10px 0;
+ width: 140px;
+ vertical-align: top;
+}
+
+.form-table code {
+ line-height: 18px;
+ font-size: 14px;
+}
+
+.form-table p {
+ margin: 4px 0 0 0;
+ font-size: 11px;
+}
+
+.form-table input {
+ line-height: 20px;
+ font-size: 15px;
+ padding: 3px 5px;
+ border: 1px solid #ddd;
+ box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.07);
+}
+
+input,
+submit {
+ font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
+}
+
+.form-table input[type=text],
+.form-table input[type=email],
+.form-table input[type=url],
+.form-table input[type=password],
+#pass-strength-result {
+ width: 218px;
+}
+
+.form-table th p {
+ font-weight: 400;
+}
+
+.form-table.install-success th,
+.form-table.install-success td {
+ vertical-align: middle;
+ padding: 16px 20px 16px 0;
+}
+
+.form-table.install-success td p {
+ margin: 0;
+ font-size: 14px;
+}
+
+.form-table.install-success td code {
+ margin: 0;
+ font-size: 18px;
+}
+
+#error-page {
+ margin-top: 50px;
+}
+
+#error-page p {
+ font-size: 14px;
+ line-height: 18px;
+ margin: 25px 0 20px;
+}
+
+#error-page code, .code {
+ font-family: Consolas, Monaco, monospace;
+}
+
+.message {
+ border-left: 4px solid #dc3232;
+ padding: .7em .6em;
+ background-color: #fbeaea;
+}
+
+/* rtl:ignore */
+#dbname,
+#uname,
+#pwd,
+#dbhost,
+#prefix,
+#user_login,
+#admin_email,
+#pass1,
+#pass2 {
+ direction: ltr;
+}
+
+
+/* localization */
+body.rtl,
+.rtl textarea,
+.rtl input,
+.rtl submit {
+ font-family: Tahoma, sans-serif;
+}
+
+:lang(he-il) body.rtl,
+:lang(he-il) .rtl textarea,
+:lang(he-il) .rtl input,
+:lang(he-il) .rtl submit {
+ font-family: Arial, sans-serif;
+}
+
+@media only screen and (max-width: 799px) {
+ body {
+ margin-top: 115px;
+ }
+ #logo a {
+ margin: -125px auto 30px;
+ }
+}
+
+@media screen and (max-width: 782px) {
+
+ .form-table {
+ margin-top: 0;
+ }
+
+ .form-table th,
+ .form-table td {
+ display: block;
+ width: auto;
+ vertical-align: middle;
+ }
+
+ .form-table th {
+ padding: 20px 0 0;
+ }
+
+ .form-table td {
+ padding: 5px 0;
+ border: 0;
+ margin: 0;
+ }
+
+ textarea,
+ input {
+ font-size: 16px;
+ }
+
+ .form-table td input[type="text"],
+ .form-table td input[type="email"],
+ .form-table td input[type="url"],
+ .form-table td input[type="password"],
+ .form-table td select,
+ .form-table td textarea,
+ .form-table span.description {
+ width: 100%;
+ font-size: 16px;
+ line-height: 1.5;
+ padding: 7px 10px;
+ display: block;
+ max-width: none;
+ box-sizing: border-box;
+ }
+
+}
+
+body.language-chooser {
+ max-width: 300px;
+}
+
+.language-chooser select {
+ padding: 8px;
+ width: 100%;
+ display: block;
+ border: 1px solid #ddd;
+ background-color: #fff;
+ color: #32373c;
+ font-size: 16px;
+ font-family: Arial, sans-serif;
+ font-weight: 400;
+}
+
+.language-chooser p {
+ text-align: right;
+}
+
+.screen-reader-input,
+.screen-reader-text {
+ border: 0;
+ clip: rect(1px, 1px, 1px, 1px);
+ -webkit-clip-path: inset(50%);
+ clip-path: inset(50%);
+ height: 1px;
+ margin: -1px;
+ overflow: hidden;
+ padding: 0;
+ position: absolute;
+ width: 1px;
+ word-wrap: normal !important;
+}
+
+.spinner {
+ background: url(../images/spinner.gif) no-repeat;
+ background-size: 20px 20px;
+ visibility: hidden;
+ opacity: 0.7;
+ filter: alpha(opacity=70);
+ width: 20px;
+ height: 20px;
+ margin: 2px 5px 0;
+}
+
+.step .spinner {
+ display: inline-block;
+ vertical-align: middle;
+ margin-right: 15px;
+}
+
+.button.hide-if-no-js,
+.hide-if-no-js {
+ display: none;
+}
+
+/**
+ * HiDPI Displays
+ */
+@media print,
+ (-webkit-min-device-pixel-ratio: 1.25),
+ (min-resolution: 120dpi) {
+
+ .spinner {
+ background-image: url(../images/spinner-2x.gif);
+ }
+
+}
diff --git a/www/crm/wp-admin/css/install.min.css b/www/crm/wp-admin/css/install.min.css
new file mode 100644
index 00000000..471b34e6
--- /dev/null
+++ b/www/crm/wp-admin/css/install.min.css
@@ -0,0 +1,2 @@
+/*! This file is auto-generated */
+html{background:#f1f1f1;margin:0 20px}body{background:#fff;color:#444;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif;margin:140px auto 25px;padding:20px 20px 10px 20px;max-width:700px;-webkit-font-smoothing:subpixel-antialiased;box-shadow:0 1px 3px rgba(0,0,0,.13)}a{color:#0073aa}a:active,a:hover{color:#00a0d2}a:focus{color:#124964;box-shadow:0 0 0 1px #5b9dd9,0 0 2px 1px rgba(30,140,190,.8)}.ie8 a:focus{outline:#5b9dd9 solid 1px}h1,h2{border-bottom:1px solid #ddd;clear:both;color:#666;font-size:24px;padding:0;padding-bottom:7px;font-weight:400}h3{font-size:16px}dd,dt,li,p{padding-bottom:2px;font-size:14px;line-height:1.5}.code,code{font-family:Consolas,Monaco,monospace}dl,ol,ul{padding:5px 5px 5px 22px}a img{border:0}abbr{border:0;font-variant:normal}fieldset{border:0;padding:0;margin:0}label{cursor:pointer}#logo{margin:6px 0 14px 0;padding:0 0 7px 0;border-bottom:none;text-align:center}#logo a{background-image:url(../images/w-logo-blue.png?ver=20131202);background-image:none,url(../images/wordpress-logo.svg?ver=20131107);background-size:84px;background-position:center top;background-repeat:no-repeat;color:#444;height:84px;font-size:20px;font-weight:400;line-height:1.3em;margin:-130px auto 25px;padding:0;text-decoration:none;width:84px;text-indent:-9999px;outline:0;overflow:hidden;display:block}.step{margin:20px 0 15px}.step,th{text-align:left;padding:0}.language-chooser.wp-core-ui .step .button.button-large{height:36px;font-size:14px;line-height:33px;vertical-align:middle}textarea{border:1px solid #ddd;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif;width:100%;box-sizing:border-box}.form-table{border-collapse:collapse;margin-top:1em;width:100%}.form-table td{margin-bottom:9px;padding:10px 20px 10px 0;font-size:14px;vertical-align:top}.form-table th{font-size:14px;text-align:left;padding:10px 20px 10px 0;width:140px;vertical-align:top}.form-table code{line-height:18px;font-size:14px}.form-table p{margin:4px 0 0 0;font-size:11px}.form-table input{line-height:20px;font-size:15px;padding:3px 5px;border:1px solid #ddd;box-shadow:inset 0 1px 2px rgba(0,0,0,.07)}input,submit{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif}#pass-strength-result,.form-table input[type=email],.form-table input[type=password],.form-table input[type=text],.form-table input[type=url]{width:218px}.form-table th p{font-weight:400}.form-table.install-success td,.form-table.install-success th{vertical-align:middle;padding:16px 20px 16px 0}.form-table.install-success td p{margin:0;font-size:14px}.form-table.install-success td code{margin:0;font-size:18px}#error-page{margin-top:50px}#error-page p{font-size:14px;line-height:18px;margin:25px 0 20px}#error-page code,.code{font-family:Consolas,Monaco,monospace}.message{border-left:4px solid #dc3232;padding:.7em .6em;background-color:#fbeaea}#admin_email,#dbhost,#dbname,#pass1,#pass2,#prefix,#pwd,#uname,#user_login{direction:ltr}.rtl input,.rtl submit,.rtl textarea,body.rtl{font-family:Tahoma,sans-serif}:lang(he-il) .rtl input,:lang(he-il) .rtl submit,:lang(he-il) .rtl textarea,:lang(he-il) body.rtl{font-family:Arial,sans-serif}@media only screen and (max-width:799px){body{margin-top:115px}#logo a{margin:-125px auto 30px}}@media screen and (max-width:782px){.form-table{margin-top:0}.form-table td,.form-table th{display:block;width:auto;vertical-align:middle}.form-table th{padding:20px 0 0}.form-table td{padding:5px 0;border:0;margin:0}input,textarea{font-size:16px}.form-table span.description,.form-table td input[type=email],.form-table td input[type=password],.form-table td input[type=text],.form-table td input[type=url],.form-table td select,.form-table td textarea{width:100%;font-size:16px;line-height:1.5;padding:7px 10px;display:block;max-width:none;box-sizing:border-box}}body.language-chooser{max-width:300px}.language-chooser select{padding:8px;width:100%;display:block;border:1px solid #ddd;background-color:#fff;color:#32373c;font-size:16px;font-family:Arial,sans-serif;font-weight:400}.language-chooser p{text-align:right}.screen-reader-input,.screen-reader-text{border:0;clip:rect(1px,1px,1px,1px);-webkit-clip-path:inset(50%);clip-path:inset(50%);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;word-wrap:normal!important}.spinner{background:url(../images/spinner.gif) no-repeat;background-size:20px 20px;visibility:hidden;opacity:.7;filter:alpha(opacity=70);width:20px;height:20px;margin:2px 5px 0}.step .spinner{display:inline-block;vertical-align:middle;margin-right:15px}.button.hide-if-no-js,.hide-if-no-js{display:none}@media print,(-webkit-min-device-pixel-ratio:1.25),(min-resolution:120dpi){.spinner{background-image:url(../images/spinner-2x.gif)}} \ No newline at end of file
diff --git a/www/crm/wp-admin/css/l10n-rtl.css b/www/crm/wp-admin/css/l10n-rtl.css
new file mode 100644
index 00000000..82ea545f
--- /dev/null
+++ b/www/crm/wp-admin/css/l10n-rtl.css
@@ -0,0 +1,120 @@
+/*------------------------------------------------------------------------------
+ 27.0 - Localization
+------------------------------------------------------------------------------*/
+
+/* RTL except Hebrew (see below): Tahoma as the first font; */
+body.rtl,
+body.rtl .press-this a.wp-switch-editor {
+ font-family: Tahoma, Arial, sans-serif;
+}
+
+/* Arial is best for RTL headings. */
+.rtl h1,
+.rtl h2,
+.rtl h3,
+.rtl h4,
+.rtl h5,
+.rtl h6 {
+ font-family: Arial, sans-serif;
+ font-weight: 600;
+}
+
+/* he_IL: Remove Tahoma from the font stack. Arial is best for Hebrew. */
+body.locale-he-il,
+body.locale-he-il .press-this a.wp-switch-editor {
+ font-family: Arial, sans-serif;
+}
+
+/* he_IL: Have <em> be bold rather than italic. */
+.locale-he-il em {
+ font-style: normal;
+ font-weight: 600;
+}
+
+/* zh_CN: Remove italic properties. */
+.locale-zh-cn .howto,
+.locale-zh-cn .tablenav .displaying-num,
+.locale-zh-cn .js .input-with-default-title,
+.locale-zh-cn .link-to-original,
+.locale-zh-cn .inline-edit-row fieldset span.title,
+.locale-zh-cn .inline-edit-row fieldset span.checkbox-title,
+.locale-zh-cn #utc-time,
+.locale-zh-cn #local-time,
+.locale-zh-cn p.install-help,
+.locale-zh-cn p.help,
+.locale-zh-cn p.description,
+.locale-zh-cn span.description,
+.locale-zh-cn .form-wrap p {
+ font-style: normal;
+}
+
+/* zh_CN: Enlarge dashboard widget 'Configure' link */
+.locale-zh-cn .hdnle a { font-size: 12px; }
+
+/* zn_CH: Enlarge font size, set font-size: normal */
+.locale-zh-cn form.upgrade .hint { font-style: normal; font-size: 100%; }
+
+/* zh_CN: Enlarge font-size. */
+.locale-zh-cn #sort-buttons { font-size: 1em !important; }
+
+/* de_DE: Text needs more space for translation */
+.locale-de-de #customize-header-actions .button,
+.locale-de-de-formal #customize-header-actions .button {
+ padding: 0 5px 1px; /* default 0 10px 1px */
+}
+.locale-de-de #customize-header-actions .spinner,
+.locale-de-de-formal #customize-header-actions .spinner {
+ margin: 16px 3px 0; /* default 16px 4px 0 5px */
+}
+
+/* ru_RU: Text needs more room to breathe. */
+.locale-ru-ru #adminmenu {
+ width: inherit; /* back-compat for pre-3.2 */
+}
+.locale-ru-ru #adminmenu,
+.locale-ru-ru #wpbody {
+ margin-right: 0; /* back-compat for pre-3.2 */
+}
+.locale-ru-ru .inline-edit-row fieldset label span.title,
+.locale-ru-ru .inline-edit-row fieldset.inline-edit-date legend {
+ width: 8em; /* default 6em */
+}
+.locale-ru-ru .inline-edit-row fieldset label span.input-text-wrap,
+.locale-ru-ru .inline-edit-row fieldset .timestamp-wrap {
+ margin-right: 8em; /* default 6em */
+}
+.locale-ru-ru.post-php .tagsdiv .newtag,
+.locale-ru-ru.post-new-php .tagsdiv .newtag {
+ width: 165px; /* default 180px - 15px */
+}
+.locale-ru-ru.press-this .posting {
+ margin-left: 277px; /* default 252px + 25px */
+}
+.locale-ru-ru .press-this-sidebar {
+ width: 265px; /* default 240px + 25px */
+}
+.locale-ru-ru #customize-header-actions .button {
+ padding: 0 5px 1px; /* default 0 10px 1px */
+}
+.locale-ru-ru #customize-header-actions .spinner {
+ margin: 16px 3px 0; /* default 16px 4px 0 5px */
+}
+
+/* lt_LT: QuickEdit */
+.locale-lt-lt .inline-edit-row fieldset label span.title,
+.locale-lt-lt .inline-edit-row fieldset.inline-edit-date legend {
+ width: 8em; /* default 6em */
+}
+.locale-lt-lt .inline-edit-row fieldset label span.input-text-wrap,
+.locale-lt-lt .inline-edit-row fieldset .timestamp-wrap {
+ margin-right: 8em; /* default 6em */
+}
+
+@media screen and (max-width: 782px) {
+ .locale-ru-ru .inline-edit-row fieldset label span.input-text-wrap,
+ .locale-ru-ru .inline-edit-row fieldset .timestamp-wrap,
+ .locale-lt-lt .inline-edit-row fieldset label span.input-text-wrap,
+ .locale-lt-lt .inline-edit-row fieldset .timestamp-wrap {
+ margin-right: 0;
+ }
+}
diff --git a/www/crm/wp-admin/css/l10n-rtl.min.css b/www/crm/wp-admin/css/l10n-rtl.min.css
new file mode 100644
index 00000000..3ac11f8e
--- /dev/null
+++ b/www/crm/wp-admin/css/l10n-rtl.min.css
@@ -0,0 +1,2 @@
+/*! This file is auto-generated */
+body.rtl,body.rtl .press-this a.wp-switch-editor{font-family:Tahoma,Arial,sans-serif}.rtl h1,.rtl h2,.rtl h3,.rtl h4,.rtl h5,.rtl h6{font-family:Arial,sans-serif;font-weight:600}body.locale-he-il,body.locale-he-il .press-this a.wp-switch-editor{font-family:Arial,sans-serif}.locale-he-il em{font-style:normal;font-weight:600}.locale-zh-cn #local-time,.locale-zh-cn #utc-time,.locale-zh-cn .form-wrap p,.locale-zh-cn .howto,.locale-zh-cn .inline-edit-row fieldset span.checkbox-title,.locale-zh-cn .inline-edit-row fieldset span.title,.locale-zh-cn .js .input-with-default-title,.locale-zh-cn .link-to-original,.locale-zh-cn .tablenav .displaying-num,.locale-zh-cn p.description,.locale-zh-cn p.help,.locale-zh-cn p.install-help,.locale-zh-cn span.description{font-style:normal}.locale-zh-cn .hdnle a{font-size:12px}.locale-zh-cn form.upgrade .hint{font-style:normal;font-size:100%}.locale-zh-cn #sort-buttons{font-size:1em!important}.locale-de-de #customize-header-actions .button,.locale-de-de-formal #customize-header-actions .button{padding:0 5px 1px}.locale-de-de #customize-header-actions .spinner,.locale-de-de-formal #customize-header-actions .spinner{margin:16px 3px 0}.locale-ru-ru #adminmenu{width:inherit}.locale-ru-ru #adminmenu,.locale-ru-ru #wpbody{margin-right:0}.locale-ru-ru .inline-edit-row fieldset label span.title,.locale-ru-ru .inline-edit-row fieldset.inline-edit-date legend{width:8em}.locale-ru-ru .inline-edit-row fieldset .timestamp-wrap,.locale-ru-ru .inline-edit-row fieldset label span.input-text-wrap{margin-right:8em}.locale-ru-ru.post-new-php .tagsdiv .newtag,.locale-ru-ru.post-php .tagsdiv .newtag{width:165px}.locale-ru-ru.press-this .posting{margin-left:277px}.locale-ru-ru .press-this-sidebar{width:265px}.locale-ru-ru #customize-header-actions .button{padding:0 5px 1px}.locale-ru-ru #customize-header-actions .spinner{margin:16px 3px 0}.locale-lt-lt .inline-edit-row fieldset label span.title,.locale-lt-lt .inline-edit-row fieldset.inline-edit-date legend{width:8em}.locale-lt-lt .inline-edit-row fieldset .timestamp-wrap,.locale-lt-lt .inline-edit-row fieldset label span.input-text-wrap{margin-right:8em}@media screen and (max-width:782px){.locale-lt-lt .inline-edit-row fieldset .timestamp-wrap,.locale-lt-lt .inline-edit-row fieldset label span.input-text-wrap,.locale-ru-ru .inline-edit-row fieldset .timestamp-wrap,.locale-ru-ru .inline-edit-row fieldset label span.input-text-wrap{margin-right:0}} \ No newline at end of file
diff --git a/www/crm/wp-admin/css/l10n.css b/www/crm/wp-admin/css/l10n.css
new file mode 100644
index 00000000..967fb4c6
--- /dev/null
+++ b/www/crm/wp-admin/css/l10n.css
@@ -0,0 +1,120 @@
+/*------------------------------------------------------------------------------
+ 27.0 - Localization
+------------------------------------------------------------------------------*/
+
+/* RTL except Hebrew (see below): Tahoma as the first font; */
+body.rtl,
+body.rtl .press-this a.wp-switch-editor {
+ font-family: Tahoma, Arial, sans-serif;
+}
+
+/* Arial is best for RTL headings. */
+.rtl h1,
+.rtl h2,
+.rtl h3,
+.rtl h4,
+.rtl h5,
+.rtl h6 {
+ font-family: Arial, sans-serif;
+ font-weight: 600;
+}
+
+/* he_IL: Remove Tahoma from the font stack. Arial is best for Hebrew. */
+body.locale-he-il,
+body.locale-he-il .press-this a.wp-switch-editor {
+ font-family: Arial, sans-serif;
+}
+
+/* he_IL: Have <em> be bold rather than italic. */
+.locale-he-il em {
+ font-style: normal;
+ font-weight: 600;
+}
+
+/* zh_CN: Remove italic properties. */
+.locale-zh-cn .howto,
+.locale-zh-cn .tablenav .displaying-num,
+.locale-zh-cn .js .input-with-default-title,
+.locale-zh-cn .link-to-original,
+.locale-zh-cn .inline-edit-row fieldset span.title,
+.locale-zh-cn .inline-edit-row fieldset span.checkbox-title,
+.locale-zh-cn #utc-time,
+.locale-zh-cn #local-time,
+.locale-zh-cn p.install-help,
+.locale-zh-cn p.help,
+.locale-zh-cn p.description,
+.locale-zh-cn span.description,
+.locale-zh-cn .form-wrap p {
+ font-style: normal;
+}
+
+/* zh_CN: Enlarge dashboard widget 'Configure' link */
+.locale-zh-cn .hdnle a { font-size: 12px; }
+
+/* zn_CH: Enlarge font size, set font-size: normal */
+.locale-zh-cn form.upgrade .hint { font-style: normal; font-size: 100%; }
+
+/* zh_CN: Enlarge font-size. */
+.locale-zh-cn #sort-buttons { font-size: 1em !important; }
+
+/* de_DE: Text needs more space for translation */
+.locale-de-de #customize-header-actions .button,
+.locale-de-de-formal #customize-header-actions .button {
+ padding: 0 5px 1px; /* default 0 10px 1px */
+}
+.locale-de-de #customize-header-actions .spinner,
+.locale-de-de-formal #customize-header-actions .spinner {
+ margin: 16px 3px 0; /* default 16px 4px 0 5px */
+}
+
+/* ru_RU: Text needs more room to breathe. */
+.locale-ru-ru #adminmenu {
+ width: inherit; /* back-compat for pre-3.2 */
+}
+.locale-ru-ru #adminmenu,
+.locale-ru-ru #wpbody {
+ margin-left: 0; /* back-compat for pre-3.2 */
+}
+.locale-ru-ru .inline-edit-row fieldset label span.title,
+.locale-ru-ru .inline-edit-row fieldset.inline-edit-date legend {
+ width: 8em; /* default 6em */
+}
+.locale-ru-ru .inline-edit-row fieldset label span.input-text-wrap,
+.locale-ru-ru .inline-edit-row fieldset .timestamp-wrap {
+ margin-left: 8em; /* default 6em */
+}
+.locale-ru-ru.post-php .tagsdiv .newtag,
+.locale-ru-ru.post-new-php .tagsdiv .newtag {
+ width: 165px; /* default 180px - 15px */
+}
+.locale-ru-ru.press-this .posting {
+ margin-right: 277px; /* default 252px + 25px */
+}
+.locale-ru-ru .press-this-sidebar {
+ width: 265px; /* default 240px + 25px */
+}
+.locale-ru-ru #customize-header-actions .button {
+ padding: 0 5px 1px; /* default 0 10px 1px */
+}
+.locale-ru-ru #customize-header-actions .spinner {
+ margin: 16px 3px 0; /* default 16px 4px 0 5px */
+}
+
+/* lt_LT: QuickEdit */
+.locale-lt-lt .inline-edit-row fieldset label span.title,
+.locale-lt-lt .inline-edit-row fieldset.inline-edit-date legend {
+ width: 8em; /* default 6em */
+}
+.locale-lt-lt .inline-edit-row fieldset label span.input-text-wrap,
+.locale-lt-lt .inline-edit-row fieldset .timestamp-wrap {
+ margin-left: 8em; /* default 6em */
+}
+
+@media screen and (max-width: 782px) {
+ .locale-ru-ru .inline-edit-row fieldset label span.input-text-wrap,
+ .locale-ru-ru .inline-edit-row fieldset .timestamp-wrap,
+ .locale-lt-lt .inline-edit-row fieldset label span.input-text-wrap,
+ .locale-lt-lt .inline-edit-row fieldset .timestamp-wrap {
+ margin-left: 0;
+ }
+}
diff --git a/www/crm/wp-admin/css/l10n.min.css b/www/crm/wp-admin/css/l10n.min.css
new file mode 100644
index 00000000..6a427f4c
--- /dev/null
+++ b/www/crm/wp-admin/css/l10n.min.css
@@ -0,0 +1,2 @@
+/*! This file is auto-generated */
+body.rtl,body.rtl .press-this a.wp-switch-editor{font-family:Tahoma,Arial,sans-serif}.rtl h1,.rtl h2,.rtl h3,.rtl h4,.rtl h5,.rtl h6{font-family:Arial,sans-serif;font-weight:600}body.locale-he-il,body.locale-he-il .press-this a.wp-switch-editor{font-family:Arial,sans-serif}.locale-he-il em{font-style:normal;font-weight:600}.locale-zh-cn #local-time,.locale-zh-cn #utc-time,.locale-zh-cn .form-wrap p,.locale-zh-cn .howto,.locale-zh-cn .inline-edit-row fieldset span.checkbox-title,.locale-zh-cn .inline-edit-row fieldset span.title,.locale-zh-cn .js .input-with-default-title,.locale-zh-cn .link-to-original,.locale-zh-cn .tablenav .displaying-num,.locale-zh-cn p.description,.locale-zh-cn p.help,.locale-zh-cn p.install-help,.locale-zh-cn span.description{font-style:normal}.locale-zh-cn .hdnle a{font-size:12px}.locale-zh-cn form.upgrade .hint{font-style:normal;font-size:100%}.locale-zh-cn #sort-buttons{font-size:1em!important}.locale-de-de #customize-header-actions .button,.locale-de-de-formal #customize-header-actions .button{padding:0 5px 1px}.locale-de-de #customize-header-actions .spinner,.locale-de-de-formal #customize-header-actions .spinner{margin:16px 3px 0}.locale-ru-ru #adminmenu{width:inherit}.locale-ru-ru #adminmenu,.locale-ru-ru #wpbody{margin-left:0}.locale-ru-ru .inline-edit-row fieldset label span.title,.locale-ru-ru .inline-edit-row fieldset.inline-edit-date legend{width:8em}.locale-ru-ru .inline-edit-row fieldset .timestamp-wrap,.locale-ru-ru .inline-edit-row fieldset label span.input-text-wrap{margin-left:8em}.locale-ru-ru.post-new-php .tagsdiv .newtag,.locale-ru-ru.post-php .tagsdiv .newtag{width:165px}.locale-ru-ru.press-this .posting{margin-right:277px}.locale-ru-ru .press-this-sidebar{width:265px}.locale-ru-ru #customize-header-actions .button{padding:0 5px 1px}.locale-ru-ru #customize-header-actions .spinner{margin:16px 3px 0}.locale-lt-lt .inline-edit-row fieldset label span.title,.locale-lt-lt .inline-edit-row fieldset.inline-edit-date legend{width:8em}.locale-lt-lt .inline-edit-row fieldset .timestamp-wrap,.locale-lt-lt .inline-edit-row fieldset label span.input-text-wrap{margin-left:8em}@media screen and (max-width:782px){.locale-lt-lt .inline-edit-row fieldset .timestamp-wrap,.locale-lt-lt .inline-edit-row fieldset label span.input-text-wrap,.locale-ru-ru .inline-edit-row fieldset .timestamp-wrap,.locale-ru-ru .inline-edit-row fieldset label span.input-text-wrap{margin-left:0}} \ No newline at end of file
diff --git a/www/crm/wp-admin/css/list-tables-rtl.css b/www/crm/wp-admin/css/list-tables-rtl.css
new file mode 100644
index 00000000..ef817264
--- /dev/null
+++ b/www/crm/wp-admin/css/list-tables-rtl.css
@@ -0,0 +1,2186 @@
+.response-links {
+ display: block;
+ margin-bottom: 1em;
+}
+
+.response-links a {
+ display: block;
+}
+
+.response-links a.comments-edit-item-link {
+ font-weight: 600;
+}
+
+.response-links a.comments-view-item-link {
+ font-size: 12px;
+}
+
+.post-com-count-wrapper strong {
+ font-weight: 400;
+}
+
+.comments-view-item-link {
+ display: inline-block;
+ clear: both;
+}
+
+.column-response .post-com-count-wrapper,
+.column-comments .post-com-count-wrapper {
+ white-space: nowrap;
+ word-wrap: normal;
+}
+
+/* comments bubble common */
+.column-response .post-com-count,
+.column-comments .post-com-count {
+ display: inline-block;
+ vertical-align: top;
+}
+
+/* comments bubble approved */
+.column-response .post-com-count-no-comments,
+.column-response .post-com-count-approved,
+.column-comments .post-com-count-no-comments,
+.column-comments .post-com-count-approved {
+ margin-top: 5px;
+}
+
+.column-response .comment-count-no-comments,
+.column-response .comment-count-approved,
+.column-comments .comment-count-no-comments,
+.column-comments .comment-count-approved {
+ box-sizing: border-box;
+ display: block;
+ padding: 0 8px;
+ min-width: 24px;
+ height: 2em;
+ border-radius: 5px;
+ background-color: #72777c;
+ color: #fff;
+ font-size: 11px;
+ line-height: 21px;
+ text-align: center;
+}
+
+.ie8 .column-response .comment-count-no-comments,
+.ie8 .column-response .comment-count-approved,
+.ie8 .column-comments .comment-count-no-comments,
+.ie8 .column-comments .comment-count-approved {
+ min-width: 0;
+}
+
+.column-response .post-com-count-no-comments:after,
+.column-response .post-com-count-approved:after,
+.column-comments .post-com-count-no-comments:after,
+.column-comments .post-com-count-approved:after {
+ content: "";
+ display: block;
+ margin-right: 8px;
+ width: 0;
+ height: 0;
+ border-top: 5px solid #72777c;
+ border-left: 5px solid transparent;
+}
+
+.column-response .post-com-count-approved:hover .comment-count-approved,
+.column-response .post-com-count-approved:focus .comment-count-approved,
+.column-comments .post-com-count-approved:hover .comment-count-approved,
+.column-comments .post-com-count-approved:focus .comment-count-approved {
+ background: #0073aa;
+}
+
+.column-response .post-com-count-approved:hover:after,
+.column-response .post-com-count-approved:focus:after,
+.column-comments .post-com-count-approved:hover:after,
+.column-comments .post-com-count-approved:focus:after {
+ border-top-color: #0073aa;
+}
+
+/* @todo: consider to use a single rule for these counters and the admin menu counters. */
+.column-response .post-com-count-pending,
+.column-comments .post-com-count-pending {
+ position: relative;
+ right: -3px;
+ padding: 0 5px;
+ min-width: 7px;
+ height: 17px;
+ border: 2px solid #fff;
+ border-radius: 11px;
+ background: #ca4a1f;
+ color: #fff;
+ font-size: 9px;
+ line-height: 17px;
+ text-align: center;
+}
+
+.column-response .post-com-count-no-pending,
+.column-comments .post-com-count-no-pending {
+ display: none;
+}
+
+/* comments */
+
+.commentlist li {
+ padding: 1em 1em .2em;
+ margin: 0;
+ border-bottom: 1px solid #ccc;
+}
+
+.commentlist li li {
+ border-bottom: 0;
+ padding: 0;
+}
+
+.commentlist p {
+ padding: 0;
+ margin: 0 0 .8em;
+}
+
+#submitted-on,
+.submitted-on {
+ color: #555d66;
+}
+
+/* reply to comments */
+#replyrow td {
+ padding: 2px;
+}
+
+#replysubmit {
+ margin: 0;
+ padding: 5px 7px 10px;
+ overflow: hidden;
+}
+
+#replysubmit .reply-submit-buttons {
+ margin-bottom: 0;
+}
+
+#replysubmit .button {
+ margin-left: 5px;
+}
+
+#replysubmit .spinner {
+ float: none;
+ margin: -4px 0 0;
+}
+
+#replyrow.inline-edit-row fieldset.comment-reply {
+ font-size: inherit;
+ line-height: inherit;
+}
+
+#replyrow legend {
+ margin: 0;
+ padding: .2em 5px 0;
+ font-size: 13px;
+ line-height: 1.4;
+ font-weight: 600;
+}
+
+#replyrow.inline-edit-row label {
+ display: inline;
+ vertical-align: baseline;
+ line-height: inherit;
+}
+
+#edithead .inside,
+#commentsdiv #edithead .inside {
+ float: right;
+ padding: 3px 5px 2px 0;
+ margin: 0;
+ text-align: center;
+}
+
+#edithead .inside input {
+ width: 180px;
+}
+
+#edithead label {
+ padding: 2px 0;
+}
+
+#replycontainer {
+ padding: 5px;
+}
+
+#replycontent {
+ height: 120px;
+ box-shadow: none;
+}
+
+#replyerror {
+ border-color: #ddd;
+ background-color: #f9f9f9;
+}
+
+/* @todo: is this used? */
+.commentlist .avatar {
+ vertical-align: text-top;
+}
+
+#the-comment-list tr.undo,
+#the-comment-list div.undo {
+ background-color: #f5f5f5;
+}
+
+#the-comment-list .unapproved th,
+#the-comment-list .unapproved td {
+ background-color: #fef7f1;
+}
+
+#the-comment-list .unapproved th.check-column {
+ border-right: 4px solid #d54e21;
+}
+
+#the-comment-list .unapproved th.check-column input {
+ margin-right: 4px;
+}
+
+#the-comment-list .approve a {
+ color: #006505;
+}
+
+#the-comment-list .unapprove a {
+ color: #d98500;
+}
+
+#the-comment-list th,
+#the-comment-list td {
+ box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.1);
+}
+
+#the-comment-list tr:last-child th,
+#the-comment-list tr:last-child td {
+ box-shadow: none;
+}
+
+#the-comment-list tr.unapproved + tr.approved th,
+#the-comment-list tr.unapproved + tr.approved td {
+ border-top: 1px solid rgba(0, 0, 0, 0.03);
+}
+
+/* table vim shortcuts */
+.vim-current,
+.vim-current th,
+.vim-current td {
+ background-color: #e4f2fd !important;
+}
+
+th .comment-grey-bubble {
+ height: 16px;
+ width: 16px;
+}
+
+th .comment-grey-bubble:before {
+ content: "\f101";
+ font: normal 20px/.5 dashicons;
+ speak: none;
+ display: inline-block;
+ padding: 0;
+ top: 4px;
+ right: -4px;
+ position: relative;
+ vertical-align: top;
+ -webkit-font-smoothing: antialiased;
+ -moz-osx-font-smoothing: grayscale;
+ text-decoration: none !important;
+ color: #444;
+}
+
+/*------------------------------------------------------------------------------
+ 10.0 - List Posts (/Pages/etc)
+------------------------------------------------------------------------------*/
+
+table.fixed {
+ table-layout: fixed;
+}
+
+.fixed .column-rating,
+.fixed .column-visible {
+ width: 8%;
+}
+
+.fixed .column-posts,
+.fixed .column-date,
+.fixed .column-parent,
+.fixed .column-links,
+.fixed .column-author,
+.fixed .column-format {
+ width: 10%;
+}
+
+.fixed .column-posts {
+ width: 74px;
+}
+
+.fixed .column-comment .comment-author {
+ display: none;
+}
+
+.fixed .column-response,
+.fixed .column-categories,
+.fixed .column-tags,
+.fixed .column-rel,
+.fixed .column-role {
+ width: 15%;
+}
+
+.fixed .column-slug {
+ width: 25%;
+}
+
+.fixed .column-locations {
+ width: 35%;
+}
+
+.fixed .column-comments {
+ width: 5.5em;
+ padding: 8px 0;
+ text-align: right;
+}
+
+.fixed .column-comments .vers {
+ padding-right: 3px;
+}
+
+td.column-title strong,
+td.plugin-title strong {
+ display: block;
+ margin-bottom: .2em;
+ font-size: 14px;
+}
+
+td.column-title p,
+td.plugin-title p {
+ margin: 6px 0;
+}
+
+/* Media file column */
+table.media .column-title .media-icon {
+ float: right;
+ min-height: 60px;
+ margin: 0 0 0 9px;
+}
+
+table.media .column-title .media-icon img {
+ max-width: 60px;
+ height: auto;
+ vertical-align: top; /* Remove descender white-space. */
+}
+
+table.media .column-title .has-media-icon ~ .row-actions {
+ margin-right: 70px; /* 60px image + margin */
+}
+
+table.media .column-title .filename {
+ margin-bottom: 0.2em;
+}
+
+/* @todo: pick a consistent list table selector */
+.wp-list-table a {
+ transition: none;
+}
+
+#the-list tr:last-child td,
+#the-list tr:last-child th {
+ border-bottom: none !important;
+ box-shadow: none;
+}
+
+#comments-form .fixed .column-author {
+ width: 20%;
+}
+
+#comments-form .fixed .column-date {
+ width: 14%;
+}
+
+#commentsdiv.postbox .inside {
+ margin: 0;
+ padding: 0;
+}
+
+#commentsdiv .inside .row-actions {
+ line-height: 18px;
+}
+
+#commentsdiv .inside .column-author {
+ width: 25%;
+}
+
+#commentsdiv .column-comment p {
+ margin: 0.6em 0;
+ padding: 0;
+}
+
+#commentsdiv #replyrow td {
+ padding: 0;
+}
+
+#commentsdiv p {
+ padding: 8px 10px;
+ margin: 0;
+}
+
+#commentsdiv .comments-box {
+ border: 0 none;
+}
+
+#commentsdiv .comments-box thead th,
+#commentsdiv .comments-box thead td {
+ background: transparent;
+ padding: 0 7px 4px;
+ font-style: italic;
+}
+
+#commentsdiv .comments-box tr:last-child td {
+ border-bottom: 0 none;
+}
+
+#commentsdiv #edithead .inside input {
+ width: 160px;
+}
+
+.sorting-indicator {
+ display: block;
+ visibility: hidden;
+ width: 10px;
+ height: 4px;
+ margin-top: 8px;
+ margin-right: 7px;
+}
+
+.sorting-indicator:before {
+ content: "\f142";
+ font: normal 20px/1 dashicons;
+ speak: none;
+ display: inline-block;
+ padding: 0;
+ top: -4px;
+ right: -8px;
+ color: #444;
+ line-height: 10px;
+ position: relative;
+ vertical-align: top;
+ -webkit-font-smoothing: antialiased;
+ -moz-osx-font-smoothing: grayscale;
+ text-decoration: none !important;
+ color: #444;
+}
+
+.column-comments .sorting-indicator:before {
+ top: 0;
+ right: -10px;
+}
+
+th.sorted.asc .sorting-indicator:before,
+th.desc:hover span.sorting-indicator:before,
+th.desc a:focus span.sorting-indicator:before {
+ content: "\f142";
+}
+
+th.sorted.desc .sorting-indicator:before,
+th.asc:hover span.sorting-indicator:before,
+th.asc a:focus span.sorting-indicator:before {
+ content: "\f140";
+}
+
+.wp-list-table .toggle-row {
+ position: absolute;
+ left: 8px;
+ top: 10px;
+ display: none;
+ padding: 0;
+ width: 40px;
+ height: 40px;
+ border: none;
+ outline: none;
+ background: transparent;
+}
+
+.wp-list-table .toggle-row:hover {
+ cursor: pointer;
+}
+
+.wp-list-table .toggle-row:focus:before {
+ box-shadow:
+ 0 0 0 1px #5b9dd9,
+ 0 0 2px 1px rgba(30, 140, 190, 0.8);
+}
+
+.ie8 .wp-list-table .toggle-row:focus:before {
+ outline: #5b9dd9 solid 1px;
+}
+
+.wp-list-table .toggle-row:active {
+ box-shadow: none;
+}
+
+.wp-list-table .toggle-row:before {
+ position: absolute;
+ top: -5px;
+ right: 10px;
+ border-radius: 50%;
+ display: block;
+ padding: 1px 0 1px 2px;
+ color: #444; /* same as table headers sort arrows */
+ content: "\f140";
+ font: normal 20px/1 dashicons;
+ line-height: 1;
+ -webkit-font-smoothing: antialiased;
+ -moz-osx-font-smoothing: grayscale;
+ speak: none;
+}
+
+.wp-list-table .is-expanded .toggle-row:before {
+ content: "\f142";
+}
+
+tr.wp-locked .locked-indicator {
+ margin-right: 6px;
+ height: 20px;
+ width: 16px;
+}
+
+tr.wp-locked .locked-indicator-icon:before {
+ color: #82878c;
+ content: "\f160";
+ display: inline-block;
+ font: normal 20px/1 dashicons;
+ speak: none;
+ vertical-align: middle;
+ -webkit-font-smoothing: antialiased;
+ -moz-osx-font-smoothing: grayscale;
+}
+
+tr.wp-locked .check-column label,
+tr.wp-locked .check-column input[type="checkbox"],
+tr.wp-locked .row-actions .inline,
+tr.wp-locked .row-actions .trash {
+ display: none;
+}
+
+tr .locked-info {
+ height: 0;
+ opacity: 0;
+}
+
+tr.wp-locked .locked-info {
+ margin-top: 4px;
+ height: auto;
+ opacity: 1;
+}
+
+.locked-text {
+ vertical-align: top;
+}
+
+tr.locked-info, tr.wp-locked .locked-info {
+ transition: height 1s, opacity 0.5s;
+}
+
+.fixed .column-comments .sorting-indicator {
+ margin-top: 3px;
+}
+
+#menu-locations-wrap .widefat {
+ width: 60%;
+}
+
+.widefat th.sortable,
+.widefat th.sorted {
+ padding: 0;
+}
+
+th.sortable a,
+th.sorted a {
+ display: block;
+ overflow: hidden;
+ padding: 8px;
+}
+
+.fixed .column-comments.sortable a,
+.fixed .column-comments.sorted a {
+ padding: 8px 0;
+}
+
+th.sortable a span,
+th.sorted a span {
+ float: right;
+ cursor: pointer;
+}
+
+th.sorted .sorting-indicator,
+th.desc:hover span.sorting-indicator,
+th.desc a:focus span.sorting-indicator,
+th.asc:hover span.sorting-indicator,
+th.asc a:focus span.sorting-indicator {
+ visibility: visible;
+}
+
+.tablenav-pages .current-page {
+ margin: 0 0 0 2px;
+ padding-top: 5px;
+ padding-bottom: 5px;
+ font-size: 13px;
+ text-align: center;
+}
+
+.tablenav .total-pages {
+ margin-left: 2px;
+}
+
+.tablenav #table-paging {
+ margin-right: 2px;
+}
+
+.tablenav {
+ clear: both;
+ height: 30px;
+ margin: 6px 0 4px;
+ vertical-align: middle;
+}
+
+.tablenav.themes {
+ max-width: 98%;
+}
+
+.tablenav .tablenav-pages {
+ float: left;
+ margin: 3px 0 9px;
+}
+
+.tablenav .no-pages,
+.tablenav .one-page .pagination-links {
+ display: none;
+}
+
+.tablenav .tablenav-pages .button,
+.tablenav .tablenav-pages .tablenav-pages-navspan {
+ display: inline-block;
+ vertical-align: baseline;
+ min-width: 28px;
+ min-height: 28px;
+ margin: 0;
+ padding: 0 4px;
+ font-size: 16px;
+ line-height: 1.5;
+ text-align: center;
+}
+
+.tablenav .displaying-num {
+ margin-left: 7px;
+}
+
+.tablenav .one-page .displaying-num {
+ display: inline-block;
+ margin: 5px 0;
+}
+
+.tablenav .actions {
+ overflow: hidden;
+ padding: 2px 0 0 8px;
+}
+
+.wp-filter .actions {
+ display: inline-block;
+ vertical-align: middle;
+}
+
+.tablenav .delete {
+ margin-left: 20px;
+}
+
+/* This view-switcher is still used on multisite. */
+.tablenav .view-switch {
+ float: left;
+ margin: 0 5px;
+ padding-top: 3px;
+}
+
+.wp-filter .view-switch {
+ display: inline-block;
+ vertical-align: middle;
+ padding: 12px 0;
+ margin: 0 2px 0 8px;
+}
+
+.media-toolbar.wp-filter .view-switch {
+ margin: 0 2px 0 12px;
+}
+
+.view-switch a {
+ float: right;
+ width: 28px;
+ height: 28px;
+ text-align: center;
+ line-height: 24px;
+ text-decoration: none;
+}
+
+.view-switch a:before {
+ color: #b4b9be;
+ display: inline-block;
+ font: normal 20px/1 dashicons;
+ speak: none;
+ vertical-align: middle;
+ -webkit-font-smoothing: antialiased;
+ -moz-osx-font-smoothing: grayscale;
+}
+
+.view-switch a:hover:before,
+.view-switch a:focus:before {
+ color: #727272;
+}
+
+.view-switch a.current:before {
+ color: #0073aa;
+}
+
+.view-switch .view-list:before {
+ content: "\f163";
+}
+
+.view-switch .view-excerpt:before {
+ content: "\f164";
+}
+
+.view-switch .view-grid:before {
+ content: "\f509";
+}
+
+.filter {
+ float: right;
+ margin: -5px 10px 0 0;
+}
+
+.filter .subsubsub {
+ margin-right: -10px;
+ margin-top: 13px;
+}
+.screen-per-page {
+ width: 4em;
+}
+
+#posts-filter .wp-filter {
+ margin-bottom: 0;
+}
+
+#posts-filter fieldset {
+ float: right;
+ margin: 0 0 1em 1.5ex;
+ padding: 0;
+}
+
+#posts-filter fieldset legend {
+ padding: 0 1px .2em 0;
+}
+
+p.pagenav {
+ margin: 0;
+ display: inline;
+}
+
+.pagenav span {
+ font-weight: 600;
+ margin: 0 6px;
+}
+
+.row-title {
+ font-size: 14px !important;
+ font-weight: 600;
+}
+
+.column-comment .comment-author {
+ margin-bottom: 0.6em;
+}
+
+.column-author img,
+.column-username img,
+.column-comment .comment-author img {
+ float: right;
+ margin-left: 10px;
+ margin-top: 1px;
+}
+
+.row-actions {
+ color: #ddd;
+ font-size: 13px;
+ padding: 2px 0 0;
+ position: relative;
+ right: -9999em;
+}
+
+/* ticket #34150 */
+.rtl .row-actions a {
+ display: inline-block;
+}
+
+.row-actions .network_only,
+.row-actions .network_active {
+ color: #000;
+}
+
+.no-js .row-actions,
+tr:hover .row-actions,
+.mobile .row-actions,
+.row-actions.visible,
+.comment-item:hover .row-actions {
+ position: static;
+}
+
+/* deprecated */
+.row-actions-visible {
+ padding: 2px 0 0;
+}
+
+
+/*------------------------------------------------------------------------------
+ 10.1 - Inline Editing
+------------------------------------------------------------------------------*/
+
+/*
+.quick-edit* is for Quick Edit
+.bulk-edit* is for Bulk Edit
+.inline-edit* is for everything
+*/
+
+/* Layout */
+
+#wpbody-content .inline-edit-row fieldset {
+ font-size: 12px;
+ float: right;
+ margin: 0;
+ padding: 0;
+ width: 100%;
+}
+
+tr.inline-edit-row td,
+#wpbody-content .inline-edit-row fieldset .inline-edit-col {
+ padding: 0 0.5em;
+}
+
+#wpbody-content .quick-edit-row-post .inline-edit-col-left {
+ width: 40%;
+}
+
+#wpbody-content .quick-edit-row-post .inline-edit-col-right {
+ width: 39%;
+}
+
+#wpbody-content .inline-edit-row-post .inline-edit-col-center {
+ width: 20%;
+}
+
+#wpbody-content .quick-edit-row-page .inline-edit-col-left {
+ width: 50%;
+}
+
+#wpbody-content .quick-edit-row-page .inline-edit-col-right,
+#wpbody-content .bulk-edit-row-post .inline-edit-col-right {
+ width: 49%;
+}
+
+#wpbody-content .bulk-edit-row .inline-edit-col-left {
+ width: 30%;
+}
+
+#wpbody-content .bulk-edit-row-page .inline-edit-col-right {
+ width: 69%;
+}
+
+#wpbody-content .bulk-edit-row .inline-edit-col-bottom {
+ float: left;
+ width: 69%;
+}
+
+#wpbody-content .inline-edit-row-page .inline-edit-col-right {
+ margin-top: 27px;
+}
+
+.inline-edit-row fieldset .inline-edit-group {
+ clear: both;
+ line-height: 2.5;
+}
+
+.inline-edit-row .submit {
+ clear: both;
+ padding: 0.5em;
+ margin: 0.5em 0 0;
+}
+
+.inline-edit-row .notice-error {
+ margin-top: 1em;
+}
+
+.inline-edit-row .notice-error .error {
+ margin: 0.5em 0;
+ padding: 2px;
+}
+
+/* Positioning */
+
+/* Needs higher specificity for the padding */
+#the-list .inline-edit-row .inline-edit-legend {
+ margin: 0;
+ padding: 0.2em 0.5em 0;
+ line-height: 2.5;
+ font-weight: 600;
+}
+
+#the-list #bulk-edit.inline-edit-row .inline-edit-legend {
+ padding: 0.2em 0.5em;
+}
+
+.inline-edit-row fieldset span.title,
+.inline-edit-row fieldset span.checkbox-title {
+ margin: 0;
+ padding: 0;
+}
+
+.inline-edit-row fieldset label,
+.inline-edit-row fieldset span.inline-edit-categories-label {
+ display: block;
+ margin: .2em 0;
+ line-height: 2.5;
+}
+
+.inline-edit-row fieldset.inline-edit-date label {
+ display: inline-block;
+ margin: 0;
+ line-height: 1.5;
+ vertical-align: baseline;
+}
+
+.inline-edit-row fieldset label.inline-edit-tags {
+ margin-top: 0;
+}
+
+.inline-edit-row fieldset label.inline-edit-tags span.title {
+ margin: .2em 0;
+ width: auto;
+}
+
+.inline-edit-row fieldset label span.title,
+.inline-edit-row fieldset.inline-edit-date legend {
+ display: block;
+ float: right;
+ width: 6em;
+ line-height: 2.5;
+}
+
+#posts-filter fieldset.inline-edit-date legend {
+ padding: 0;
+}
+
+.inline-edit-row fieldset.inline-edit-date select {
+ margin: 1px;
+ line-height: 28px;
+}
+
+.inline-edit-row fieldset label span.input-text-wrap,
+.inline-edit-row fieldset .timestamp-wrap {
+ display: block;
+ margin-right: 6em;
+}
+
+.quick-edit-row-post fieldset.inline-edit-col-right label span.title {
+ width: auto;
+ padding-left: 0.5em;
+}
+
+.inline-edit-row .inline-edit-or {
+ margin: .2em 0 .2em 6px;
+ line-height: 2.5;
+}
+
+.inline-edit-row .input-text-wrap input[type=text] {
+ width: 100%;
+}
+
+.inline-edit-row fieldset label input[type=checkbox] {
+ vertical-align: middle;
+}
+
+.inline-edit-row fieldset label textarea {
+ width: 100%;
+ height: 4em;
+ vertical-align: top;
+}
+
+#wpbody-content .bulk-edit-row fieldset .inline-edit-group label {
+ max-width: 50%;
+}
+
+#wpbody-content .quick-edit-row fieldset .inline-edit-group label.alignleft:first-child {
+ margin-left: 0.5em
+}
+
+.inline-edit-col-right .input-text-wrap input.inline-edit-menu-order-input {
+ width: 6em;
+}
+
+/* Styling */
+.inline-edit-row .inline-edit-legend {
+ text-transform: uppercase;
+}
+
+.inline-edit-row fieldset span.title,
+.inline-edit-row fieldset span.checkbox-title {
+ font-style: italic;
+}
+
+/* Specific Elements */
+.inline-edit-row fieldset .inline-edit-date {
+ float: right;
+}
+
+.inline-edit-row fieldset input[name=jj],
+.inline-edit-row fieldset input[name=hh],
+.inline-edit-row fieldset input[name=mn] {
+ font-size: 12px;
+ width: 2.3em;
+}
+
+.inline-edit-row fieldset input[name=aa] {
+ font-size: 12px;
+ width: 3.5em;
+}
+
+.inline-edit-row fieldset label input.inline-edit-password-input {
+ width: 8em;
+}
+
+ul.cat-checklist {
+ height: 12em;
+ border: solid 1px #ddd;
+ overflow-y: scroll;
+ padding: 0 5px;
+ margin: 0;
+ background-color: #fff;
+}
+
+#bulk-titles {
+ display: block;
+ height: 12em;
+ border: 1px solid #ddd;
+ overflow-y: scroll;
+ padding: 0 5px;
+ margin: 0 0 5px;
+}
+
+.inline-edit-row fieldset ul.cat-checklist li,
+.inline-edit-row fieldset ul.cat-checklist input {
+ margin: 0;
+ position: relative; /* RTL fix, #WP27629 */
+}
+
+.inline-edit-row fieldset ul.cat-checklist label,
+.inline-edit-row #bulk-titles div {
+ font-style: normal;
+ font-size: 11px;
+}
+
+.inline-edit-row fieldset label input.inline-edit-menu-order-input {
+ width: 3em;
+}
+
+.inline-edit-row fieldset label input.inline-edit-slug-input {
+ width: 75%;
+}
+
+.inline-edit-row #post_parent,
+.inline-edit-row select[name="page_template"] {
+ max-width: 80%;
+}
+
+.ie8 .inline-edit-row #post_parent,
+.ie8 .inline-edit-row select[name="page_template"] {
+ width: 250px;
+}
+
+.quick-edit-row-post fieldset label.inline-edit-status {
+ float: right;
+}
+
+#bulk-titles {
+ line-height: 140%;
+}
+#bulk-titles div {
+ margin: 0.2em 0.3em;
+}
+
+#bulk-titles div a {
+ cursor: pointer;
+ display: block;
+ float: right;
+ height: 18px;
+ margin: 0 -2px 0 3px;
+ overflow: hidden;
+ position: relative;
+ width: 20px;
+}
+
+#bulk-titles div a:before {
+ position: relative;
+ top: -3px;
+}
+
+/*------------------------------------------------------------------------------
+ 17.0 - Plugins
+------------------------------------------------------------------------------*/
+
+.plugins tbody th.check-column,
+.plugins tbody {
+ padding: 8px 2px 0 0;
+}
+
+.plugins tbody th.check-column input[type=checkbox] {
+ margin-top: 4px;
+}
+
+.updates-table .plugin-title p {
+ margin-top: 0;
+}
+
+.plugins thead td.check-column,
+.plugins tfoot td.check-column,
+.plugins .inactive th.check-column {
+ padding-right: 6px;
+}
+
+.plugins,
+.plugins th,
+.plugins td {
+ color: #000;
+}
+
+.plugins tr {
+ background: #fff;
+}
+
+.plugins p {
+ margin: 0 4px;
+ padding: 0;
+}
+
+.plugins .desc p {
+ margin: 0 0 8px;
+}
+
+.plugins td.desc {
+ line-height: 1.5em;
+}
+
+.plugins .desc ul,
+.plugins .desc ol {
+ margin: 0 2em 0 0;
+}
+
+.plugins .desc ul {
+ list-style-type: disc;
+}
+
+.plugins .row-actions {
+ font-size: 13px;
+ padding: 0;
+}
+
+.plugins .inactive td,
+.plugins .inactive th,
+.plugins .active td,
+.plugins .active th {
+ padding: 10px 9px;
+}
+
+.plugins .active td,
+.plugins .active th {
+ background-color: #f7fcfe;
+}
+
+.plugins .update th,
+.plugins .update td {
+ border-bottom: 0;
+}
+
+.plugins .inactive td,
+.plugins .inactive th,
+.plugins .active td,
+.plugins .active th,
+.plugin-install #the-list td,
+.upgrade .plugins td,
+.upgrade .plugins th {
+ box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.1);
+}
+
+.plugins tr.active.plugin-update-tr + tr.inactive th,
+.plugins tr.active.plugin-update-tr + tr.inactive td,
+.plugins tr.active + tr.inactive th,
+.plugins tr.active + tr.inactive td {
+ border-top: 1px solid rgba(0, 0, 0, 0.03);
+ box-shadow: inset 0 1px 0 rgba(0, 0, 0, 0.02), inset 0 -1px 0 #e1e1e1;
+}
+
+.plugins .update td,
+.plugins .update th,
+.upgrade .plugins tr:last-of-type td,
+.upgrade .plugins tr:last-of-type th,
+.plugins tr.active + tr.inactive.update th,
+.plugins tr.active + tr.inactive.update td,
+.plugins .updated td,
+.plugins .updated th,
+.plugins tr.active + tr.inactive.updated th,
+.plugins tr.active + tr.inactive.updated td {
+ box-shadow: none;
+}
+
+.plugins .active th.check-column,
+.plugin-update-tr.active td {
+ border-right: 4px solid #00a0d2;
+}
+
+.wp-list-table.plugins .plugin-title,
+.wp-list-table.plugins .theme-title {
+ padding-left: 12px;
+ white-space: nowrap;
+}
+
+.plugins .plugin-title img,
+.plugins .plugin-title .dashicons {
+ float: right;
+ padding: 0 0 0 10px;
+ width: 64px;
+ height: 64px;
+}
+
+.plugins .plugin-title .dashicons:before {
+ padding: 2px;
+ background-color: #eee;
+ box-shadow: inset 0 0 10px rgba(160, 165, 170, 0.15);
+ font-size: 60px;
+ color: #B4B9BE;
+}
+
+#update-themes-table .plugin-title img,
+#update-themes-table .plugin-title .dashicons {
+ width: 85px;
+}
+
+.plugins .inactive .plugin-title strong {
+ font-weight: 400;
+}
+
+.plugins .second,
+.plugins .row-actions {
+ padding: 0 0 5px;
+}
+
+.plugins .update .second,
+.plugins .update .row-actions,
+.plugins .updated .second,
+.plugins .updated .row-actions {
+ padding-bottom: 0;
+}
+
+.plugins-php .widefat tfoot th,
+.plugins-php .widefat tfoot td {
+ border-top-style: solid;
+ border-top-width: 1px;
+}
+
+.plugins .plugin-update-tr .plugin-update {
+ box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.1);
+ overflow: hidden; /* clearfix */
+ padding: 0;
+}
+
+.plugins .plugin-update-tr .notice,
+.plugins .plugin-update-tr div[class="update-message"] { /* back-compat for pre-4.6 */
+ margin: 5px 40px 15px 20px;
+}
+
+.plugins .notice p {
+ margin: 0.5em 0;
+}
+
+.plugins .plugin-description a,
+.plugins .plugin-update a,
+.updates-table .plugin-title a {
+ text-decoration: underline;
+}
+
+.plugins tr.paused th.check-column {
+ border-right: 4px solid #d54e21;
+}
+
+.plugins tr.paused th,
+.plugins tr.paused td {
+ background-color: #fef7f1;
+}
+
+.plugins tr.paused .plugin-title,
+.plugins .paused .dashicons-warning {
+ color: #dc3232;
+}
+
+.plugins .paused .error-display p,
+.plugins .paused .error-display code {
+ font-size: 90%;
+ font-style: italic;
+ color: rgb( 0, 0, 0, 0.7 );
+}
+
+.plugins .resume-link {
+ color: #dc3232;
+}
+
+.plugin-card .update-now:before {
+ color: #f56e28;
+ content: "\f463";
+ display: inline-block;
+ font: normal 20px/1 dashicons;
+ margin: 3px -2px 0 5px;
+ speak: none;
+ -webkit-font-smoothing: antialiased;
+ -moz-osx-font-smoothing: grayscale;
+ vertical-align: top;
+}
+
+.plugin-card .updating-message:before {
+ content: "\f463";
+ animation: rotation 2s infinite linear;
+}
+
+@keyframes rotation {
+ 0% {
+ transform: rotate(0deg);
+ }
+ 100% {
+ transform: rotate(-359deg);
+ }
+}
+
+.plugin-card .updated-message:before {
+ color: #79ba49;
+ content: "\f147";
+}
+
+.plugin-install-php h2 {
+ clear: both;
+}
+
+.plugin-install-php h3 {
+ margin: 2.5em 0 8px;
+}
+
+.plugin-install-php .wp-filter {
+ margin-bottom: 0;
+}
+
+/* Plugin card table view */
+.plugin-group {
+ overflow: hidden; /* clearfix */
+ margin-top: 1.5em;
+}
+
+.plugin-group h3 {
+ margin-top: 0;
+}
+
+.plugin-card {
+ float: right;
+ margin: 0 8px 16px;
+ width: 48.5%;
+ width: calc( 50% - 8px );
+ background-color: #fff;
+ border: 1px solid #ddd;
+ box-sizing: border-box;
+}
+
+.plugin-card:nth-child(odd) {
+ clear: both;
+ margin-right: 0;
+}
+
+.plugin-card:nth-child(even) {
+ margin-left: 0;
+}
+
+@media screen and (min-width: 1600px) and ( max-width: 2299px ) {
+ .plugin-card {
+ width: 30%;
+ width: calc( 33.1% - 8px );
+ }
+
+ .plugin-card:nth-child(odd) {
+ clear: none;
+ margin-right: 8px;
+ }
+
+ .plugin-card:nth-child(even) {
+ margin-left: 8px;
+ }
+
+ .plugin-card:nth-child(3n+1) {
+ clear: both;
+ margin-right: 0;
+ }
+
+ .plugin-card:nth-child(3n) {
+ margin-left: 0;
+ }
+}
+
+@media screen and (min-width: 2300px) {
+ .plugin-card {
+ width: 25%;
+ width: calc( 25% - 12px );
+ }
+
+ .plugin-card:nth-child(odd) {
+ clear: none;
+ margin-right: 8px;
+ }
+
+ .plugin-card:nth-child(even) {
+ margin-left: 8px;
+ }
+
+ .plugin-card:nth-child(4n+1) {
+ clear: both;
+ margin-right: 0;
+ }
+
+ .plugin-card:nth-child(4n) {
+ margin-left: 0;
+ }
+}
+
+.plugin-card-top {
+ position: relative;
+ padding: 20px 20px 10px;
+ min-height: 135px;
+}
+
+div.action-links,
+.plugin-action-buttons {
+ margin: 0; /* Override existing margins */
+}
+
+.plugin-card h3 {
+ margin: 0 0 12px;
+ font-size: 18px;
+ line-height: 1.3;
+}
+
+.plugin-card .name,
+.plugin-card .desc {
+ margin-right: 148px; /* icon + margin */
+ margin-left: 120px; /* action links */
+}
+
+.plugin-card .action-links {
+ position: absolute;
+ top: 20px;
+ left: 20px;
+ width: 120px;
+}
+
+.plugin-action-buttons {
+ clear: left;
+ float: left;
+ margin-right: 2em;
+ margin-bottom: 1em;
+ text-align: left;
+}
+
+.plugin-action-buttons li {
+ margin-bottom: 10px;
+}
+
+.plugin-card-bottom {
+ clear: both;
+ padding: 12px 20px;
+ background-color: #fafafa;
+ border-top: 1px solid #ddd;
+ overflow: hidden;
+}
+
+.plugin-card-bottom .star-rating {
+ display: inline;
+}
+
+.plugin-card-update-failed .update-now {
+ font-weight: 600;
+}
+
+.plugin-card-update-failed .notice-error {
+ margin: 0;
+ padding-right: 16px;
+ box-shadow: 0 -1px 0 #ddd;
+}
+
+.plugin-card-update-failed .plugin-card-bottom {
+ display: none;
+}
+
+.plugin-card .column-rating {
+ line-height: 23px;
+}
+
+.plugin-card .column-rating,
+.plugin-card .column-updated {
+ margin-bottom: 4px;
+}
+
+.plugin-card .column-rating,
+.plugin-card .column-downloaded {
+ float: right;
+ clear: right;
+ max-width: 180px;
+}
+
+.plugin-card .column-updated,
+.plugin-card .column-compatibility {
+ text-align: left;
+ float: left;
+ clear: left;
+ width: 65%;
+ width: calc( 100% - 180px );
+}
+
+.plugin-card .column-compatibility span:before {
+ font: normal 20px/.5 dashicons;
+ speak: none;
+ display: inline-block;
+ padding: 0;
+ top: 4px;
+ right: -2px;
+ position: relative;
+ vertical-align: top;
+ -webkit-font-smoothing: antialiased;
+ -moz-osx-font-smoothing: grayscale;
+ text-decoration: none !important;
+ color: #444;
+}
+
+.plugin-card .column-compatibility .compatibility-incompatible:before {
+ content: "\f158";
+ color: #c62d2d;
+}
+
+.plugin-card .column-compatibility .compatibility-compatible:before {
+ content: "\f147";
+ color: #31843f;
+}
+
+.plugin-card .notice {
+ margin: 20px 20px 0 20px;
+}
+
+.plugin-icon {
+ position: absolute;
+ top: 20px;
+ right: 20px;
+ width: 128px;
+ height: 128px;
+ margin: 0 0 20px 20px;
+}
+
+.no-plugin-results {
+ color: #666; /* same as no themes and no media */
+ font-size: 18px;
+ font-style: normal;
+ margin: 0;
+ padding: 100px 0 0;
+ text-align: center;
+}
+
+/* ms */
+/* Background Color for Site Status */
+.wp-list-table .site-deleted,
+.wp-list-table tr.site-deleted {
+ background: #ff8573;
+}
+.wp-list-table .site-spammed,
+.wp-list-table tr.site-spammed {
+ background: #faafaa;
+}
+.wp-list-table .site-archived,
+.wp-list-table tr.site-archived {
+ background: #ffebe8;
+}
+.wp-list-table .site-mature,
+.wp-list-table tr.site-mature {
+ background: #fecac2;
+}
+
+.sites.fixed .column-lastupdated,
+.sites.fixed .column-registered {
+ width: 20%;
+}
+
+.sites.fixed .column-users {
+ width: 80px;
+}
+
+/* =Media Queries
+-------------------------------------------------------------- */
+
+@media screen and (max-width: 1100px) and (min-width: 782px), (max-width: 480px) {
+ .plugin-card .action-links {
+ position: static;
+ margin-right: 148px;
+ width: auto;
+ }
+
+ .plugin-action-buttons {
+ float: none;
+ margin: 1em 0 0;
+ text-align: right;
+ }
+
+ .plugin-action-buttons li {
+ display: inline-block;
+ vertical-align: middle;
+ }
+
+ .plugin-action-buttons li .button {
+ margin-left: 20px;
+ }
+
+ .plugin-card .name,
+ .plugin-card .desc {
+ margin-left: 0;
+ }
+
+ .plugin-card .desc p:first-of-type {
+ margin-top: 0;
+ }
+
+ .fixed .column-date {
+ width: 14%;
+ }
+}
+
+@media screen and (max-width: 782px) {
+ /* WP List Table Options & Filters */
+ .tablenav {
+ height: auto;
+ }
+
+ .tablenav.top {
+ margin: 20px 0 5px 0;
+ }
+
+ .tablenav.bottom {
+ position: relative;
+ margin-top: 15px;
+ }
+
+ .tablenav br {
+ display: none;
+ }
+
+ .tablenav br.clear {
+ display: block;
+ }
+
+ .tablenav.top .actions,
+ .tablenav .view-switch {
+ display: none;
+ }
+
+ .view-switch a {
+ width: 36px;
+ height: 36px;
+ line-height: 33px;
+ }
+
+ /* Pagination */
+ .tablenav.top .displaying-num {
+ display: none;
+ }
+
+ .tablenav.bottom .displaying-num {
+ position: absolute;
+ left: 0;
+ top: 11px;
+ margin: 0;
+ font-size: 14px;
+ }
+
+ .tablenav .tablenav-pages {
+ width: 100%;
+ text-align: center;
+ margin: 0 0 25px;
+ }
+
+ .tablenav.bottom .tablenav-pages {
+ margin-top: 25px;
+ }
+
+ .tablenav.top .tablenav-pages.one-page {
+ display: none;
+ }
+
+ .tablenav.bottom .tablenav-pages.one-page {
+ margin: 15px 0 0 0;
+ height: 0;
+ }
+
+ .tablenav-pages .pagination-links {
+ font-size: 16px;
+ }
+
+ .tablenav .tablenav-pages .button,
+ .tablenav .tablenav-pages .tablenav-pages-navspan {
+ min-width: 44px;
+ padding: 12px 8px;
+ font-size: 18px;
+ line-height: 1;
+ }
+
+ .tablenav-pages .pagination-links .current-page {
+ min-width: 44px;
+ padding: 12px 6px;
+ font-size: 16px;
+ line-height: 18px;
+ }
+
+ /* WP List Table Adjustments: General */
+ .form-wrap > p {
+ display: none;
+ }
+
+ .comment-count {
+ font-size: 14px;
+ }
+
+ .wp-list-table th.column-primary ~ th,
+ .wp-list-table tr:not(.inline-edit-row):not(.no-items) td.column-primary ~ td:not(.check-column) {
+ display: none;
+ }
+
+ .wp-list-table thead th.column-primary {
+ width: 100%;
+ }
+
+ /* Checkboxes need to show */
+ .wp-list-table tr th.check-column {
+ display: table-cell;
+ width: 35px;
+ }
+
+ .wp-list-table .column-primary .toggle-row {
+ display: block;
+ }
+
+ .wp-list-table tr:not(.inline-edit-row):not(.no-items) td:not(.check-column) {
+ position: relative;
+ clear: both;
+ display: block;
+ width: auto !important; /* needs to override some columns that are more specifically targeted */
+ }
+
+ .wp-list-table td.column-primary {
+ padding-left: 50px; /* space for toggle button */
+ }
+
+ .wp-list-table tr:not(.inline-edit-row):not(.no-items) td.column-primary ~ td:not(.check-column) {
+ padding: 3px 35% 3px 8px;
+ }
+
+ .wp-list-table tr:not(.inline-edit-row):not(.no-items) td:not(.column-primary)::before {
+ position: absolute;
+ right: 10px; /* match padding of regular table cell */
+ display: block;
+ overflow: hidden;
+ width: 32%; /* leave a little space for a gutter */
+ content: attr(data-colname);
+ white-space: nowrap;
+ text-overflow: ellipsis;
+ }
+
+ .wp-list-table .is-expanded td:not(.hidden) {
+ display: block !important;
+ overflow: hidden; /* clearfix */
+ }
+
+ /* Special cases */
+ .widefat .num,
+ .column-posts {
+ text-align: right;
+ }
+
+ #comments-form .fixed .column-author,
+ #commentsdiv .fixed .column-author {
+ display: none !important;
+ }
+
+ .fixed .column-comment .comment-author {
+ display: block;
+ }
+
+ /* Comment author hidden via Screen Options */
+ .fixed .column-author.hidden ~ .column-comment .comment-author {
+ display: none;
+ }
+
+ #the-comment-list .is-expanded td {
+ box-shadow: none;
+ }
+
+ #the-comment-list .is-expanded td:last-child {
+ box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.1);
+ }
+
+ /* Show comment bubble as text instead */
+ .post-com-count .screen-reader-text {
+ position: static;
+ -webkit-clip-path: none;
+ clip-path: none;
+ width: auto;
+ height: auto;
+ margin: 0;
+ }
+
+ .column-response .post-com-count-no-comments:after,
+ .column-response .post-com-count-approved:after,
+ .column-comments .post-com-count-no-comments:after,
+ .column-comments .post-com-count-approved:after {
+ content: none;
+ }
+
+ .column-response .post-com-count [aria-hidden="true"],
+ .column-comments .post-com-count [aria-hidden="true"] {
+ display: none;
+ }
+
+ .column-response .post-com-count-wrapper,
+ .column-comments .post-com-count-wrapper {
+ white-space: normal;
+ }
+
+ .column-response .post-com-count-wrapper > a,
+ .column-comments .post-com-count-wrapper > a {
+ display: block;
+ }
+
+ .column-response .post-com-count-no-comments,
+ .column-response .post-com-count-approved,
+ .column-comments .post-com-count-no-comments,
+ .column-comments .post-com-count-approved {
+ margin-top: 0;
+ margin-left: 0.5em;
+ }
+
+ .column-response .post-com-count-pending,
+ .column-comments .post-com-count-pending {
+ position: static;
+ height: auto;
+ min-width: 0;
+ padding: 0;
+ border: none;
+ border-radius: 0;
+ background: none;
+ color: #bb2a2a;
+ font-size: inherit;
+ line-height: inherit;
+ text-align: right;
+ }
+
+ .column-response .post-com-count-pending:hover,
+ .column-comments .post-com-count-pending:hover {
+ color: #dc3232;
+ }
+
+ .widefat thead td.check-column,
+ .widefat tfoot td.check-column {
+ padding-top: 10px;
+ }
+
+ .widefat * {
+ word-wrap: normal;
+ }
+
+ /* Make row actions more easy to select on mobile */
+ body:not(.plugins-php) .row-actions {
+ display: -ms-grid;
+ display: grid;
+ -ms-grid-columns: auto auto auto;
+ grid-template-columns: auto auto auto;
+ color: transparent;
+ }
+
+ .row-actions span {
+ padding: 4px 0;
+ }
+
+ .row-actions span a,
+ .row-actions span .button-link {
+ display: inline-block;
+ padding: 4px 0;
+ }
+
+ .row-actions span.approve:before,
+ .row-actions span.unapprove:before {
+ content: "| ";
+ }
+
+ /* Quick Edit and Bulk Edit */
+ #wpbody-content .quick-edit-row-post .inline-edit-col-left,
+ #wpbody-content .quick-edit-row-post .inline-edit-col-right,
+ #wpbody-content .inline-edit-row-post .inline-edit-col-center,
+ #wpbody-content .quick-edit-row-page .inline-edit-col-left,
+ #wpbody-content .quick-edit-row-page .inline-edit-col-right,
+ #wpbody-content .bulk-edit-row-post .inline-edit-col-right,
+ #wpbody-content .bulk-edit-row .inline-edit-col-left,
+ #wpbody-content .bulk-edit-row-page .inline-edit-col-right,
+ #wpbody-content .bulk-edit-row .inline-edit-col-bottom {
+ float: none;
+ width: 100%;
+ }
+
+ #wpbody-content .quick-edit-row fieldset .inline-edit-col label,
+ #wpbody-content .quick-edit-row fieldset .inline-edit-group label,
+ #wpbody-content .bulk-edit-row fieldset .inline-edit-col label,
+ #wpbody-content .bulk-edit-row fieldset .inline-edit-group label {
+ max-width: none;
+ float: none;
+ margin-bottom: 5px;
+ }
+
+ #wpbody .bulk-edit-row fieldset select {
+ display: block;
+ width: 100%;
+ max-width: none;
+ box-sizing: border-box;
+ }
+
+ .inline-edit-row fieldset ul.cat-checklist label,
+ .inline-edit-row #bulk-titles div {
+ font-size: 16px;
+ }
+
+ .inline-edit-row fieldset label span.title,
+ .inline-edit-row fieldset.inline-edit-date legend {
+ float: none;
+ }
+
+ .inline-edit-row fieldset label.inline-edit-tags {
+ padding: 0 0.5em;
+ }
+
+ .inline-edit-row fieldset .inline-edit-col label.inline-edit-tags {
+ padding: 0;
+ }
+
+ .inline-edit-row fieldset label span.input-text-wrap,
+ .inline-edit-row fieldset .timestamp-wrap {
+ margin-right: 0;
+ }
+
+ .inline-edit-row fieldset input[name=jj],
+ .inline-edit-row fieldset input[name=hh],
+ .inline-edit-row fieldset input[name=mn] {
+ width: 3em;
+ }
+
+ .inline-edit-row fieldset input[name=aa] {
+ width: 4.5em;
+ }
+
+ .inline-edit-row .inline-edit-or {
+ margin: 0 0 0 6px;
+ }
+
+ #edithead .inside,
+ #commentsdiv #edithead .inside {
+ float: none;
+ text-align: right;
+ padding: 3px 5px;
+ }
+
+ #commentsdiv #edithead .inside input,
+ #edithead .inside input {
+ width: 100%;
+ }
+
+ #edithead label {
+ display: block;
+ }
+
+ #bulk-titles div {
+ margin: 0.8em 0.3em;
+ }
+
+ #bulk-titles div a {
+ height: 22px;
+ }
+
+ /* Updates */
+ #wpbody-content .updates-table .plugin-title {
+ width: auto;
+ white-space: normal;
+ }
+
+ /* Links */
+ .link-manager-php #posts-filter {
+ margin-top: 25px;
+ }
+
+ .link-manager-php .tablenav.bottom {
+ overflow: hidden;
+ }
+
+ /* List tables that don't toggle rows */
+ .comments-box .toggle-row,
+ .wp-list-table.plugins .toggle-row {
+ display: none;
+ }
+
+ /* Plugin/Theme Management */
+ #wpbody-content .wp-list-table.plugins td {
+ display: block;
+ width: auto;
+ padding: 10px 9px; /* reset from other list tables that have a label at this width */
+ }
+
+ /* Plugin description hidden via Screen Options */
+ #wpbody-content .wp-list-table.plugins .desc.hidden {
+ display: none;
+ }
+
+ #wpbody-content .wp-list-table.plugins .column-description {
+ padding-top: 2px;
+ }
+
+ #wpbody-content .wp-list-table.plugins .plugin-title,
+ #wpbody-content .wp-list-table.plugins .theme-title {
+ padding-left: 12px;
+ white-space: normal;
+ }
+
+ .wp-list-table.plugins .plugin-title,
+ .wp-list-table.plugins .theme-title {
+ padding-top: 13px;
+ padding-bottom: 4px;
+ }
+
+ .plugins #the-list tr > td:not(:last-child),
+ .plugins #the-list .update th,
+ .plugins #the-list .update td,
+ .wp-list-table.plugins #the-list .theme-title {
+ box-shadow: none;
+ border-top: none;
+ }
+
+ .plugins #the-list tr td {
+ border-top: none;
+ }
+
+ .plugins tbody {
+ padding: 1px 0 0;
+ }
+
+ .plugins tr.active + tr.inactive th.check-column,
+ .plugins tr.active + tr.inactive td.column-description,
+ .plugins .plugin-update-tr:before {
+ box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.1);
+ }
+
+ .plugins tr.active + tr.inactive th.check-column,
+ .plugins tr.active + tr.inactive td {
+ border-top: none;
+ }
+
+ /* mimic the checkbox th */
+ .plugins .plugin-update-tr:before {
+ content: "";
+ display: table-cell;
+ }
+
+ .plugins .active.update + .plugin-update-tr:before {
+ border-right: 4px solid #d54e21;
+ background-color: #fef7f1;
+ }
+
+ .plugins #the-list .plugin-update-tr .plugin-update {
+ border-right: none;
+ }
+
+ .plugin-update-tr .update-message {
+ margin-right: 0;
+ }
+
+ .plugins .active.update + .plugin-update-tr:before {
+ background-color: #f7fcfe;
+ border-right: 4px solid #00a0d2;
+ }
+
+ .plugins .plugin-update-tr .update-message {
+ margin-right: 0;
+ }
+
+ .wp-list-table.plugins .plugin-title strong,
+ .wp-list-table.plugins .theme-title strong {
+ font-size: 1.4em;
+ line-height: 1.5;
+ }
+
+ /* Add New plugins page */
+ table.plugin-install .column-name,
+ table.plugin-install .column-version,
+ table.plugin-install .column-rating,
+ table.plugin-install .column-description {
+ display: block;
+ width: auto;
+ }
+
+ table.plugin-install th.column-name,
+ table.plugin-install th.column-version,
+ table.plugin-install th.column-rating,
+ table.plugin-install th.column-description {
+ display: none;
+ }
+
+ table.plugin-install td.column-name strong {
+ font-size: 1.4em;
+ line-height: 1.6em;
+ }
+
+ table.plugin-install #the-list td {
+ box-shadow: none;
+ }
+
+ table.plugin-install #the-list tr {
+ display: block;
+ box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.1);
+ }
+
+ .plugin-card {
+ margin-right: 0;
+ margin-left: 0;
+ width: 100%;
+ }
+}
+
+@media screen and (max-width: 480px) {
+ .tablenav-pages .current-page {
+ margin: 0;
+ }
+
+ /* Drop row actions to two columns on a small screen */
+ .row-actions:not(.plugins-php) {
+ -ms-grid-columns: auto auto;
+ grid-template-columns: auto auto;
+ }
+
+ .tablenav-pages .tablenav-paging-text {
+ float: right;
+ width: 100%;
+ padding-top: 0.5em;
+ }
+}
diff --git a/www/crm/wp-admin/css/list-tables-rtl.min.css b/www/crm/wp-admin/css/list-tables-rtl.min.css
new file mode 100644
index 00000000..3ef7343b
--- /dev/null
+++ b/www/crm/wp-admin/css/list-tables-rtl.min.css
@@ -0,0 +1,2 @@
+/*! This file is auto-generated */
+.response-links{display:block;margin-bottom:1em}.response-links a{display:block}.response-links a.comments-edit-item-link{font-weight:600}.response-links a.comments-view-item-link{font-size:12px}.post-com-count-wrapper strong{font-weight:400}.comments-view-item-link{display:inline-block;clear:both}.column-comments .post-com-count-wrapper,.column-response .post-com-count-wrapper{white-space:nowrap;word-wrap:normal}.column-comments .post-com-count,.column-response .post-com-count{display:inline-block;vertical-align:top}.column-comments .post-com-count-approved,.column-comments .post-com-count-no-comments,.column-response .post-com-count-approved,.column-response .post-com-count-no-comments{margin-top:5px}.column-comments .comment-count-approved,.column-comments .comment-count-no-comments,.column-response .comment-count-approved,.column-response .comment-count-no-comments{box-sizing:border-box;display:block;padding:0 8px;min-width:24px;height:2em;border-radius:5px;background-color:#72777c;color:#fff;font-size:11px;line-height:21px;text-align:center}.ie8 .column-comments .comment-count-approved,.ie8 .column-comments .comment-count-no-comments,.ie8 .column-response .comment-count-approved,.ie8 .column-response .comment-count-no-comments{min-width:0}.column-comments .post-com-count-approved:after,.column-comments .post-com-count-no-comments:after,.column-response .post-com-count-approved:after,.column-response .post-com-count-no-comments:after{content:"";display:block;margin-right:8px;width:0;height:0;border-top:5px solid #72777c;border-left:5px solid transparent}.column-comments .post-com-count-approved:focus .comment-count-approved,.column-comments .post-com-count-approved:hover .comment-count-approved,.column-response .post-com-count-approved:focus .comment-count-approved,.column-response .post-com-count-approved:hover .comment-count-approved{background:#0073aa}.column-comments .post-com-count-approved:focus:after,.column-comments .post-com-count-approved:hover:after,.column-response .post-com-count-approved:focus:after,.column-response .post-com-count-approved:hover:after{border-top-color:#0073aa}.column-comments .post-com-count-pending,.column-response .post-com-count-pending{position:relative;right:-3px;padding:0 5px;min-width:7px;height:17px;border:2px solid #fff;border-radius:11px;background:#ca4a1f;color:#fff;font-size:9px;line-height:17px;text-align:center}.column-comments .post-com-count-no-pending,.column-response .post-com-count-no-pending{display:none}.commentlist li{padding:1em 1em .2em;margin:0;border-bottom:1px solid #ccc}.commentlist li li{border-bottom:0;padding:0}.commentlist p{padding:0;margin:0 0 .8em}#submitted-on,.submitted-on{color:#555d66}#replyrow td{padding:2px}#replysubmit{margin:0;padding:5px 7px 10px;overflow:hidden}#replysubmit .reply-submit-buttons{margin-bottom:0}#replysubmit .button{margin-left:5px}#replysubmit .spinner{float:none;margin:-4px 0 0}#replyrow.inline-edit-row fieldset.comment-reply{font-size:inherit;line-height:inherit}#replyrow legend{margin:0;padding:.2em 5px 0;font-size:13px;line-height:1.4;font-weight:600}#replyrow.inline-edit-row label{display:inline;vertical-align:baseline;line-height:inherit}#commentsdiv #edithead .inside,#edithead .inside{float:right;padding:3px 5px 2px 0;margin:0;text-align:center}#edithead .inside input{width:180px}#edithead label{padding:2px 0}#replycontainer{padding:5px}#replycontent{height:120px;box-shadow:none}#replyerror{border-color:#ddd;background-color:#f9f9f9}.commentlist .avatar{vertical-align:text-top}#the-comment-list div.undo,#the-comment-list tr.undo{background-color:#f5f5f5}#the-comment-list .unapproved td,#the-comment-list .unapproved th{background-color:#fef7f1}#the-comment-list .unapproved th.check-column{border-right:4px solid #d54e21}#the-comment-list .unapproved th.check-column input{margin-right:4px}#the-comment-list .approve a{color:#006505}#the-comment-list .unapprove a{color:#d98500}#the-comment-list td,#the-comment-list th{box-shadow:inset 0 -1px 0 rgba(0,0,0,.1)}#the-comment-list tr:last-child td,#the-comment-list tr:last-child th{box-shadow:none}#the-comment-list tr.unapproved+tr.approved td,#the-comment-list tr.unapproved+tr.approved th{border-top:1px solid rgba(0,0,0,.03)}.vim-current,.vim-current td,.vim-current th{background-color:#e4f2fd!important}th .comment-grey-bubble{height:16px;width:16px}th .comment-grey-bubble:before{content:"\f101";font:normal 20px/.5 dashicons;speak:none;display:inline-block;padding:0;top:4px;right:-4px;position:relative;vertical-align:top;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-decoration:none!important;color:#444}table.fixed{table-layout:fixed}.fixed .column-rating,.fixed .column-visible{width:8%}.fixed .column-author,.fixed .column-date,.fixed .column-format,.fixed .column-links,.fixed .column-parent,.fixed .column-posts{width:10%}.fixed .column-posts{width:74px}.fixed .column-comment .comment-author{display:none}.fixed .column-categories,.fixed .column-rel,.fixed .column-response,.fixed .column-role,.fixed .column-tags{width:15%}.fixed .column-slug{width:25%}.fixed .column-locations{width:35%}.fixed .column-comments{width:5.5em;padding:8px 0;text-align:right}.fixed .column-comments .vers{padding-right:3px}td.column-title strong,td.plugin-title strong{display:block;margin-bottom:.2em;font-size:14px}td.column-title p,td.plugin-title p{margin:6px 0}table.media .column-title .media-icon{float:right;min-height:60px;margin:0 0 0 9px}table.media .column-title .media-icon img{max-width:60px;height:auto;vertical-align:top}table.media .column-title .has-media-icon~.row-actions{margin-right:70px}table.media .column-title .filename{margin-bottom:.2em}.wp-list-table a{transition:none}#the-list tr:last-child td,#the-list tr:last-child th{border-bottom:none!important;box-shadow:none}#comments-form .fixed .column-author{width:20%}#comments-form .fixed .column-date{width:14%}#commentsdiv.postbox .inside{margin:0;padding:0}#commentsdiv .inside .row-actions{line-height:18px}#commentsdiv .inside .column-author{width:25%}#commentsdiv .column-comment p{margin:.6em 0;padding:0}#commentsdiv #replyrow td{padding:0}#commentsdiv p{padding:8px 10px;margin:0}#commentsdiv .comments-box{border:0 none}#commentsdiv .comments-box thead td,#commentsdiv .comments-box thead th{background:0 0;padding:0 7px 4px;font-style:italic}#commentsdiv .comments-box tr:last-child td{border-bottom:0 none}#commentsdiv #edithead .inside input{width:160px}.sorting-indicator{display:block;visibility:hidden;width:10px;height:4px;margin-top:8px;margin-right:7px}.sorting-indicator:before{content:"\f142";font:normal 20px/1 dashicons;speak:none;display:inline-block;padding:0;top:-4px;right:-8px;color:#444;line-height:10px;position:relative;vertical-align:top;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-decoration:none!important;color:#444}.column-comments .sorting-indicator:before{top:0;right:-10px}th.desc a:focus span.sorting-indicator:before,th.desc:hover span.sorting-indicator:before,th.sorted.asc .sorting-indicator:before{content:"\f142"}th.asc a:focus span.sorting-indicator:before,th.asc:hover span.sorting-indicator:before,th.sorted.desc .sorting-indicator:before{content:"\f140"}.wp-list-table .toggle-row{position:absolute;left:8px;top:10px;display:none;padding:0;width:40px;height:40px;border:none;outline:0;background:0 0}.wp-list-table .toggle-row:hover{cursor:pointer}.wp-list-table .toggle-row:focus:before{box-shadow:0 0 0 1px #5b9dd9,0 0 2px 1px rgba(30,140,190,.8)}.ie8 .wp-list-table .toggle-row:focus:before{outline:#5b9dd9 solid 1px}.wp-list-table .toggle-row:active{box-shadow:none}.wp-list-table .toggle-row:before{position:absolute;top:-5px;right:10px;border-radius:50%;display:block;padding:1px 0 1px 2px;color:#444;content:"\f140";font:normal 20px/1 dashicons;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;speak:none}.wp-list-table .is-expanded .toggle-row:before{content:"\f142"}tr.wp-locked .locked-indicator{margin-right:6px;height:20px;width:16px}tr.wp-locked .locked-indicator-icon:before{color:#82878c;content:"\f160";display:inline-block;font:normal 20px/1 dashicons;speak:none;vertical-align:middle;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}tr.wp-locked .check-column input[type=checkbox],tr.wp-locked .check-column label,tr.wp-locked .row-actions .inline,tr.wp-locked .row-actions .trash{display:none}tr .locked-info{height:0;opacity:0}tr.wp-locked .locked-info{margin-top:4px;height:auto;opacity:1}.locked-text{vertical-align:top}tr.locked-info,tr.wp-locked .locked-info{transition:height 1s,opacity .5s}.fixed .column-comments .sorting-indicator{margin-top:3px}#menu-locations-wrap .widefat{width:60%}.widefat th.sortable,.widefat th.sorted{padding:0}th.sortable a,th.sorted a{display:block;overflow:hidden;padding:8px}.fixed .column-comments.sortable a,.fixed .column-comments.sorted a{padding:8px 0}th.sortable a span,th.sorted a span{float:right;cursor:pointer}th.asc a:focus span.sorting-indicator,th.asc:hover span.sorting-indicator,th.desc a:focus span.sorting-indicator,th.desc:hover span.sorting-indicator,th.sorted .sorting-indicator{visibility:visible}.tablenav-pages .current-page{margin:0 0 0 2px;padding-top:5px;padding-bottom:5px;font-size:13px;text-align:center}.tablenav .total-pages{margin-left:2px}.tablenav #table-paging{margin-right:2px}.tablenav{clear:both;height:30px;margin:6px 0 4px;vertical-align:middle}.tablenav.themes{max-width:98%}.tablenav .tablenav-pages{float:left;margin:3px 0 9px}.tablenav .no-pages,.tablenav .one-page .pagination-links{display:none}.tablenav .tablenav-pages .button,.tablenav .tablenav-pages .tablenav-pages-navspan{display:inline-block;vertical-align:baseline;min-width:28px;min-height:28px;margin:0;padding:0 4px;font-size:16px;line-height:1.5;text-align:center}.tablenav .displaying-num{margin-left:7px}.tablenav .one-page .displaying-num{display:inline-block;margin:5px 0}.tablenav .actions{overflow:hidden;padding:2px 0 0 8px}.wp-filter .actions{display:inline-block;vertical-align:middle}.tablenav .delete{margin-left:20px}.tablenav .view-switch{float:left;margin:0 5px;padding-top:3px}.wp-filter .view-switch{display:inline-block;vertical-align:middle;padding:12px 0;margin:0 2px 0 8px}.media-toolbar.wp-filter .view-switch{margin:0 2px 0 12px}.view-switch a{float:right;width:28px;height:28px;text-align:center;line-height:24px;text-decoration:none}.view-switch a:before{color:#b4b9be;display:inline-block;font:normal 20px/1 dashicons;speak:none;vertical-align:middle;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.view-switch a:focus:before,.view-switch a:hover:before{color:#727272}.view-switch a.current:before{color:#0073aa}.view-switch .view-list:before{content:"\f163"}.view-switch .view-excerpt:before{content:"\f164"}.view-switch .view-grid:before{content:"\f509"}.filter{float:right;margin:-5px 10px 0 0}.filter .subsubsub{margin-right:-10px;margin-top:13px}.screen-per-page{width:4em}#posts-filter .wp-filter{margin-bottom:0}#posts-filter fieldset{float:right;margin:0 0 1em 1.5ex;padding:0}#posts-filter fieldset legend{padding:0 1px .2em 0}p.pagenav{margin:0;display:inline}.pagenav span{font-weight:600;margin:0 6px}.row-title{font-size:14px!important;font-weight:600}.column-comment .comment-author{margin-bottom:.6em}.column-author img,.column-comment .comment-author img,.column-username img{float:right;margin-left:10px;margin-top:1px}.row-actions{color:#ddd;font-size:13px;padding:2px 0 0;position:relative;right:-9999em}.rtl .row-actions a{display:inline-block}.row-actions .network_active,.row-actions .network_only{color:#000}.comment-item:hover .row-actions,.mobile .row-actions,.no-js .row-actions,.row-actions.visible,tr:hover .row-actions{position:static}.row-actions-visible{padding:2px 0 0}#wpbody-content .inline-edit-row fieldset{font-size:12px;float:right;margin:0;padding:0;width:100%}#wpbody-content .inline-edit-row fieldset .inline-edit-col,tr.inline-edit-row td{padding:0 .5em}#wpbody-content .quick-edit-row-post .inline-edit-col-left{width:40%}#wpbody-content .quick-edit-row-post .inline-edit-col-right{width:39%}#wpbody-content .inline-edit-row-post .inline-edit-col-center{width:20%}#wpbody-content .quick-edit-row-page .inline-edit-col-left{width:50%}#wpbody-content .bulk-edit-row-post .inline-edit-col-right,#wpbody-content .quick-edit-row-page .inline-edit-col-right{width:49%}#wpbody-content .bulk-edit-row .inline-edit-col-left{width:30%}#wpbody-content .bulk-edit-row-page .inline-edit-col-right{width:69%}#wpbody-content .bulk-edit-row .inline-edit-col-bottom{float:left;width:69%}#wpbody-content .inline-edit-row-page .inline-edit-col-right{margin-top:27px}.inline-edit-row fieldset .inline-edit-group{clear:both;line-height:2.5}.inline-edit-row .submit{clear:both;padding:.5em;margin:.5em 0 0}.inline-edit-row .notice-error{margin-top:1em}.inline-edit-row .notice-error .error{margin:.5em 0;padding:2px}#the-list .inline-edit-row .inline-edit-legend{margin:0;padding:.2em .5em 0;line-height:2.5;font-weight:600}#the-list #bulk-edit.inline-edit-row .inline-edit-legend{padding:.2em .5em}.inline-edit-row fieldset span.checkbox-title,.inline-edit-row fieldset span.title{margin:0;padding:0}.inline-edit-row fieldset label,.inline-edit-row fieldset span.inline-edit-categories-label{display:block;margin:.2em 0;line-height:2.5}.inline-edit-row fieldset.inline-edit-date label{display:inline-block;margin:0;line-height:1.5;vertical-align:baseline}.inline-edit-row fieldset label.inline-edit-tags{margin-top:0}.inline-edit-row fieldset label.inline-edit-tags span.title{margin:.2em 0;width:auto}.inline-edit-row fieldset label span.title,.inline-edit-row fieldset.inline-edit-date legend{display:block;float:right;width:6em;line-height:2.5}#posts-filter fieldset.inline-edit-date legend{padding:0}.inline-edit-row fieldset.inline-edit-date select{margin:1px;line-height:28px}.inline-edit-row fieldset .timestamp-wrap,.inline-edit-row fieldset label span.input-text-wrap{display:block;margin-right:6em}.quick-edit-row-post fieldset.inline-edit-col-right label span.title{width:auto;padding-left:.5em}.inline-edit-row .inline-edit-or{margin:.2em 0 .2em 6px;line-height:2.5}.inline-edit-row .input-text-wrap input[type=text]{width:100%}.inline-edit-row fieldset label input[type=checkbox]{vertical-align:middle}.inline-edit-row fieldset label textarea{width:100%;height:4em;vertical-align:top}#wpbody-content .bulk-edit-row fieldset .inline-edit-group label{max-width:50%}#wpbody-content .quick-edit-row fieldset .inline-edit-group label.alignleft:first-child{margin-left:.5em}.inline-edit-col-right .input-text-wrap input.inline-edit-menu-order-input{width:6em}.inline-edit-row .inline-edit-legend{text-transform:uppercase}.inline-edit-row fieldset span.checkbox-title,.inline-edit-row fieldset span.title{font-style:italic}.inline-edit-row fieldset .inline-edit-date{float:right}.inline-edit-row fieldset input[name=hh],.inline-edit-row fieldset input[name=jj],.inline-edit-row fieldset input[name=mn]{font-size:12px;width:2.3em}.inline-edit-row fieldset input[name=aa]{font-size:12px;width:3.5em}.inline-edit-row fieldset label input.inline-edit-password-input{width:8em}ul.cat-checklist{height:12em;border:solid 1px #ddd;overflow-y:scroll;padding:0 5px;margin:0;background-color:#fff}#bulk-titles{display:block;height:12em;border:1px solid #ddd;overflow-y:scroll;padding:0 5px;margin:0 0 5px}.inline-edit-row fieldset ul.cat-checklist input,.inline-edit-row fieldset ul.cat-checklist li{margin:0;position:relative}.inline-edit-row #bulk-titles div,.inline-edit-row fieldset ul.cat-checklist label{font-style:normal;font-size:11px}.inline-edit-row fieldset label input.inline-edit-menu-order-input{width:3em}.inline-edit-row fieldset label input.inline-edit-slug-input{width:75%}.inline-edit-row #post_parent,.inline-edit-row select[name=page_template]{max-width:80%}.ie8 .inline-edit-row #post_parent,.ie8 .inline-edit-row select[name=page_template]{width:250px}.quick-edit-row-post fieldset label.inline-edit-status{float:right}#bulk-titles{line-height:140%}#bulk-titles div{margin:.2em .3em}#bulk-titles div a{cursor:pointer;display:block;float:right;height:18px;margin:0 -2px 0 3px;overflow:hidden;position:relative;width:20px}#bulk-titles div a:before{position:relative;top:-3px}.plugins tbody,.plugins tbody th.check-column{padding:8px 2px 0 0}.plugins tbody th.check-column input[type=checkbox]{margin-top:4px}.updates-table .plugin-title p{margin-top:0}.plugins .inactive th.check-column,.plugins tfoot td.check-column,.plugins thead td.check-column{padding-right:6px}.plugins,.plugins td,.plugins th{color:#000}.plugins tr{background:#fff}.plugins p{margin:0 4px;padding:0}.plugins .desc p{margin:0 0 8px}.plugins td.desc{line-height:1.5em}.plugins .desc ol,.plugins .desc ul{margin:0 2em 0 0}.plugins .desc ul{list-style-type:disc}.plugins .row-actions{font-size:13px;padding:0}.plugins .active td,.plugins .active th,.plugins .inactive td,.plugins .inactive th{padding:10px 9px}.plugins .active td,.plugins .active th{background-color:#f7fcfe}.plugins .update td,.plugins .update th{border-bottom:0}.plugin-install #the-list td,.plugins .active td,.plugins .active th,.plugins .inactive td,.plugins .inactive th,.upgrade .plugins td,.upgrade .plugins th{box-shadow:inset 0 -1px 0 rgba(0,0,0,.1)}.plugins tr.active+tr.inactive td,.plugins tr.active+tr.inactive th,.plugins tr.active.plugin-update-tr+tr.inactive td,.plugins tr.active.plugin-update-tr+tr.inactive th{border-top:1px solid rgba(0,0,0,.03);box-shadow:inset 0 1px 0 rgba(0,0,0,.02),inset 0 -1px 0 #e1e1e1}.plugins .update td,.plugins .update th,.plugins .updated td,.plugins .updated th,.plugins tr.active+tr.inactive.update td,.plugins tr.active+tr.inactive.update th,.plugins tr.active+tr.inactive.updated td,.plugins tr.active+tr.inactive.updated th,.upgrade .plugins tr:last-of-type td,.upgrade .plugins tr:last-of-type th{box-shadow:none}.plugin-update-tr.active td,.plugins .active th.check-column{border-right:4px solid #00a0d2}.wp-list-table.plugins .plugin-title,.wp-list-table.plugins .theme-title{padding-left:12px;white-space:nowrap}.plugins .plugin-title .dashicons,.plugins .plugin-title img{float:right;padding:0 0 0 10px;width:64px;height:64px}.plugins .plugin-title .dashicons:before{padding:2px;background-color:#eee;box-shadow:inset 0 0 10px rgba(160,165,170,.15);font-size:60px;color:#b4b9be}#update-themes-table .plugin-title .dashicons,#update-themes-table .plugin-title img{width:85px}.plugins .inactive .plugin-title strong{font-weight:400}.plugins .row-actions,.plugins .second{padding:0 0 5px}.plugins .update .row-actions,.plugins .update .second,.plugins .updated .row-actions,.plugins .updated .second{padding-bottom:0}.plugins-php .widefat tfoot td,.plugins-php .widefat tfoot th{border-top-style:solid;border-top-width:1px}.plugins .plugin-update-tr .plugin-update{box-shadow:inset 0 -1px 0 rgba(0,0,0,.1);overflow:hidden;padding:0}.plugins .plugin-update-tr .notice,.plugins .plugin-update-tr div[class=update-message]{margin:5px 40px 15px 20px}.plugins .notice p{margin:.5em 0}.plugins .plugin-description a,.plugins .plugin-update a,.updates-table .plugin-title a{text-decoration:underline}.plugins tr.paused th.check-column{border-right:4px solid #d54e21}.plugins tr.paused td,.plugins tr.paused th{background-color:#fef7f1}.plugins .paused .dashicons-warning,.plugins tr.paused .plugin-title{color:#dc3232}.plugins .paused .error-display code,.plugins .paused .error-display p{font-size:90%;font-style:italic;color:rgb(0,0,0,.7)}.plugins .resume-link{color:#dc3232}.plugin-card .update-now:before{color:#f56e28;content:"\f463";display:inline-block;font:normal 20px/1 dashicons;margin:3px -2px 0 5px;speak:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;vertical-align:top}.plugin-card .updating-message:before{content:"\f463";animation:rotation 2s infinite linear}@keyframes rotation{0%{transform:rotate(0)}100%{transform:rotate(-359deg)}}.plugin-card .updated-message:before{color:#79ba49;content:"\f147"}.plugin-install-php h2{clear:both}.plugin-install-php h3{margin:2.5em 0 8px}.plugin-install-php .wp-filter{margin-bottom:0}.plugin-group{overflow:hidden;margin-top:1.5em}.plugin-group h3{margin-top:0}.plugin-card{float:right;margin:0 8px 16px;width:48.5%;width:calc(50% - 8px);background-color:#fff;border:1px solid #ddd;box-sizing:border-box}.plugin-card:nth-child(odd){clear:both;margin-right:0}.plugin-card:nth-child(even){margin-left:0}@media screen and (min-width:1600px) and (max-width:2299px){.plugin-card{width:30%;width:calc(33.1% - 8px)}.plugin-card:nth-child(odd){clear:none;margin-right:8px}.plugin-card:nth-child(even){margin-left:8px}.plugin-card:nth-child(3n+1){clear:both;margin-right:0}.plugin-card:nth-child(3n){margin-left:0}}@media screen and (min-width:2300px){.plugin-card{width:25%;width:calc(25% - 12px)}.plugin-card:nth-child(odd){clear:none;margin-right:8px}.plugin-card:nth-child(even){margin-left:8px}.plugin-card:nth-child(4n+1){clear:both;margin-right:0}.plugin-card:nth-child(4n){margin-left:0}}.plugin-card-top{position:relative;padding:20px 20px 10px;min-height:135px}.plugin-action-buttons,div.action-links{margin:0}.plugin-card h3{margin:0 0 12px;font-size:18px;line-height:1.3}.plugin-card .desc,.plugin-card .name{margin-right:148px;margin-left:120px}.plugin-card .action-links{position:absolute;top:20px;left:20px;width:120px}.plugin-action-buttons{clear:left;float:left;margin-right:2em;margin-bottom:1em;text-align:left}.plugin-action-buttons li{margin-bottom:10px}.plugin-card-bottom{clear:both;padding:12px 20px;background-color:#fafafa;border-top:1px solid #ddd;overflow:hidden}.plugin-card-bottom .star-rating{display:inline}.plugin-card-update-failed .update-now{font-weight:600}.plugin-card-update-failed .notice-error{margin:0;padding-right:16px;box-shadow:0 -1px 0 #ddd}.plugin-card-update-failed .plugin-card-bottom{display:none}.plugin-card .column-rating{line-height:23px}.plugin-card .column-rating,.plugin-card .column-updated{margin-bottom:4px}.plugin-card .column-downloaded,.plugin-card .column-rating{float:right;clear:right;max-width:180px}.plugin-card .column-compatibility,.plugin-card .column-updated{text-align:left;float:left;clear:left;width:65%;width:calc(100% - 180px)}.plugin-card .column-compatibility span:before{font:normal 20px/.5 dashicons;speak:none;display:inline-block;padding:0;top:4px;right:-2px;position:relative;vertical-align:top;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-decoration:none!important;color:#444}.plugin-card .column-compatibility .compatibility-incompatible:before{content:"\f158";color:#c62d2d}.plugin-card .column-compatibility .compatibility-compatible:before{content:"\f147";color:#31843f}.plugin-card .notice{margin:20px 20px 0 20px}.plugin-icon{position:absolute;top:20px;right:20px;width:128px;height:128px;margin:0 0 20px 20px}.no-plugin-results{color:#666;font-size:18px;font-style:normal;margin:0;padding:100px 0 0;text-align:center}.wp-list-table .site-deleted,.wp-list-table tr.site-deleted{background:#ff8573}.wp-list-table .site-spammed,.wp-list-table tr.site-spammed{background:#faafaa}.wp-list-table .site-archived,.wp-list-table tr.site-archived{background:#ffebe8}.wp-list-table .site-mature,.wp-list-table tr.site-mature{background:#fecac2}.sites.fixed .column-lastupdated,.sites.fixed .column-registered{width:20%}.sites.fixed .column-users{width:80px}@media screen and (max-width:1100px) and (min-width:782px),(max-width:480px){.plugin-card .action-links{position:static;margin-right:148px;width:auto}.plugin-action-buttons{float:none;margin:1em 0 0;text-align:right}.plugin-action-buttons li{display:inline-block;vertical-align:middle}.plugin-action-buttons li .button{margin-left:20px}.plugin-card .desc,.plugin-card .name{margin-left:0}.plugin-card .desc p:first-of-type{margin-top:0}.fixed .column-date{width:14%}}@media screen and (max-width:782px){.tablenav{height:auto}.tablenav.top{margin:20px 0 5px 0}.tablenav.bottom{position:relative;margin-top:15px}.tablenav br{display:none}.tablenav br.clear{display:block}.tablenav .view-switch,.tablenav.top .actions{display:none}.view-switch a{width:36px;height:36px;line-height:33px}.tablenav.top .displaying-num{display:none}.tablenav.bottom .displaying-num{position:absolute;left:0;top:11px;margin:0;font-size:14px}.tablenav .tablenav-pages{width:100%;text-align:center;margin:0 0 25px}.tablenav.bottom .tablenav-pages{margin-top:25px}.tablenav.top .tablenav-pages.one-page{display:none}.tablenav.bottom .tablenav-pages.one-page{margin:15px 0 0 0;height:0}.tablenav-pages .pagination-links{font-size:16px}.tablenav .tablenav-pages .button,.tablenav .tablenav-pages .tablenav-pages-navspan{min-width:44px;padding:12px 8px;font-size:18px;line-height:1}.tablenav-pages .pagination-links .current-page{min-width:44px;padding:12px 6px;font-size:16px;line-height:18px}.form-wrap>p{display:none}.comment-count{font-size:14px}.wp-list-table th.column-primary~th,.wp-list-table tr:not(.inline-edit-row):not(.no-items) td.column-primary~td:not(.check-column){display:none}.wp-list-table thead th.column-primary{width:100%}.wp-list-table tr th.check-column{display:table-cell;width:35px}.wp-list-table .column-primary .toggle-row{display:block}.wp-list-table tr:not(.inline-edit-row):not(.no-items) td:not(.check-column){position:relative;clear:both;display:block;width:auto!important}.wp-list-table td.column-primary{padding-left:50px}.wp-list-table tr:not(.inline-edit-row):not(.no-items) td.column-primary~td:not(.check-column){padding:3px 35% 3px 8px}.wp-list-table tr:not(.inline-edit-row):not(.no-items) td:not(.column-primary)::before{position:absolute;right:10px;display:block;overflow:hidden;width:32%;content:attr(data-colname);white-space:nowrap;text-overflow:ellipsis}.wp-list-table .is-expanded td:not(.hidden){display:block!important;overflow:hidden}.column-posts,.widefat .num{text-align:right}#comments-form .fixed .column-author,#commentsdiv .fixed .column-author{display:none!important}.fixed .column-comment .comment-author{display:block}.fixed .column-author.hidden~.column-comment .comment-author{display:none}#the-comment-list .is-expanded td{box-shadow:none}#the-comment-list .is-expanded td:last-child{box-shadow:inset 0 -1px 0 rgba(0,0,0,.1)}.post-com-count .screen-reader-text{position:static;-webkit-clip-path:none;clip-path:none;width:auto;height:auto;margin:0}.column-comments .post-com-count-approved:after,.column-comments .post-com-count-no-comments:after,.column-response .post-com-count-approved:after,.column-response .post-com-count-no-comments:after{content:none}.column-comments .post-com-count [aria-hidden=true],.column-response .post-com-count [aria-hidden=true]{display:none}.column-comments .post-com-count-wrapper,.column-response .post-com-count-wrapper{white-space:normal}.column-comments .post-com-count-wrapper>a,.column-response .post-com-count-wrapper>a{display:block}.column-comments .post-com-count-approved,.column-comments .post-com-count-no-comments,.column-response .post-com-count-approved,.column-response .post-com-count-no-comments{margin-top:0;margin-left:.5em}.column-comments .post-com-count-pending,.column-response .post-com-count-pending{position:static;height:auto;min-width:0;padding:0;border:none;border-radius:0;background:0 0;color:#bb2a2a;font-size:inherit;line-height:inherit;text-align:right}.column-comments .post-com-count-pending:hover,.column-response .post-com-count-pending:hover{color:#dc3232}.widefat tfoot td.check-column,.widefat thead td.check-column{padding-top:10px}.widefat *{word-wrap:normal}body:not(.plugins-php) .row-actions{display:-ms-grid;display:grid;-ms-grid-columns:auto auto auto;grid-template-columns:auto auto auto;color:transparent}.row-actions span{padding:4px 0}.row-actions span .button-link,.row-actions span a{display:inline-block;padding:4px 0}.row-actions span.approve:before,.row-actions span.unapprove:before{content:"| "}#wpbody-content .bulk-edit-row .inline-edit-col-bottom,#wpbody-content .bulk-edit-row .inline-edit-col-left,#wpbody-content .bulk-edit-row-page .inline-edit-col-right,#wpbody-content .bulk-edit-row-post .inline-edit-col-right,#wpbody-content .inline-edit-row-post .inline-edit-col-center,#wpbody-content .quick-edit-row-page .inline-edit-col-left,#wpbody-content .quick-edit-row-page .inline-edit-col-right,#wpbody-content .quick-edit-row-post .inline-edit-col-left,#wpbody-content .quick-edit-row-post .inline-edit-col-right{float:none;width:100%}#wpbody-content .bulk-edit-row fieldset .inline-edit-col label,#wpbody-content .bulk-edit-row fieldset .inline-edit-group label,#wpbody-content .quick-edit-row fieldset .inline-edit-col label,#wpbody-content .quick-edit-row fieldset .inline-edit-group label{max-width:none;float:none;margin-bottom:5px}#wpbody .bulk-edit-row fieldset select{display:block;width:100%;max-width:none;box-sizing:border-box}.inline-edit-row #bulk-titles div,.inline-edit-row fieldset ul.cat-checklist label{font-size:16px}.inline-edit-row fieldset label span.title,.inline-edit-row fieldset.inline-edit-date legend{float:none}.inline-edit-row fieldset label.inline-edit-tags{padding:0 .5em}.inline-edit-row fieldset .inline-edit-col label.inline-edit-tags{padding:0}.inline-edit-row fieldset .timestamp-wrap,.inline-edit-row fieldset label span.input-text-wrap{margin-right:0}.inline-edit-row fieldset input[name=hh],.inline-edit-row fieldset input[name=jj],.inline-edit-row fieldset input[name=mn]{width:3em}.inline-edit-row fieldset input[name=aa]{width:4.5em}.inline-edit-row .inline-edit-or{margin:0 0 0 6px}#commentsdiv #edithead .inside,#edithead .inside{float:none;text-align:right;padding:3px 5px}#commentsdiv #edithead .inside input,#edithead .inside input{width:100%}#edithead label{display:block}#bulk-titles div{margin:.8em .3em}#bulk-titles div a{height:22px}#wpbody-content .updates-table .plugin-title{width:auto;white-space:normal}.link-manager-php #posts-filter{margin-top:25px}.link-manager-php .tablenav.bottom{overflow:hidden}.comments-box .toggle-row,.wp-list-table.plugins .toggle-row{display:none}#wpbody-content .wp-list-table.plugins td{display:block;width:auto;padding:10px 9px}#wpbody-content .wp-list-table.plugins .desc.hidden{display:none}#wpbody-content .wp-list-table.plugins .column-description{padding-top:2px}#wpbody-content .wp-list-table.plugins .plugin-title,#wpbody-content .wp-list-table.plugins .theme-title{padding-left:12px;white-space:normal}.wp-list-table.plugins .plugin-title,.wp-list-table.plugins .theme-title{padding-top:13px;padding-bottom:4px}.plugins #the-list .update td,.plugins #the-list .update th,.plugins #the-list tr>td:not(:last-child),.wp-list-table.plugins #the-list .theme-title{box-shadow:none;border-top:none}.plugins #the-list tr td{border-top:none}.plugins tbody{padding:1px 0 0}.plugins .plugin-update-tr:before,.plugins tr.active+tr.inactive td.column-description,.plugins tr.active+tr.inactive th.check-column{box-shadow:inset 0 -1px 0 rgba(0,0,0,.1)}.plugins tr.active+tr.inactive td,.plugins tr.active+tr.inactive th.check-column{border-top:none}.plugins .plugin-update-tr:before{content:"";display:table-cell}.plugins .active.update+.plugin-update-tr:before{border-right:4px solid #d54e21;background-color:#fef7f1}.plugins #the-list .plugin-update-tr .plugin-update{border-right:none}.plugin-update-tr .update-message{margin-right:0}.plugins .active.update+.plugin-update-tr:before{background-color:#f7fcfe;border-right:4px solid #00a0d2}.plugins .plugin-update-tr .update-message{margin-right:0}.wp-list-table.plugins .plugin-title strong,.wp-list-table.plugins .theme-title strong{font-size:1.4em;line-height:1.5}table.plugin-install .column-description,table.plugin-install .column-name,table.plugin-install .column-rating,table.plugin-install .column-version{display:block;width:auto}table.plugin-install th.column-description,table.plugin-install th.column-name,table.plugin-install th.column-rating,table.plugin-install th.column-version{display:none}table.plugin-install td.column-name strong{font-size:1.4em;line-height:1.6em}table.plugin-install #the-list td{box-shadow:none}table.plugin-install #the-list tr{display:block;box-shadow:inset 0 -1px 0 rgba(0,0,0,.1)}.plugin-card{margin-right:0;margin-left:0;width:100%}}@media screen and (max-width:480px){.tablenav-pages .current-page{margin:0}.row-actions:not(.plugins-php){-ms-grid-columns:auto auto;grid-template-columns:auto auto}.tablenav-pages .tablenav-paging-text{float:right;width:100%;padding-top:.5em}} \ No newline at end of file
diff --git a/www/crm/wp-admin/css/list-tables.css b/www/crm/wp-admin/css/list-tables.css
new file mode 100644
index 00000000..91b1a2c9
--- /dev/null
+++ b/www/crm/wp-admin/css/list-tables.css
@@ -0,0 +1,2186 @@
+.response-links {
+ display: block;
+ margin-bottom: 1em;
+}
+
+.response-links a {
+ display: block;
+}
+
+.response-links a.comments-edit-item-link {
+ font-weight: 600;
+}
+
+.response-links a.comments-view-item-link {
+ font-size: 12px;
+}
+
+.post-com-count-wrapper strong {
+ font-weight: 400;
+}
+
+.comments-view-item-link {
+ display: inline-block;
+ clear: both;
+}
+
+.column-response .post-com-count-wrapper,
+.column-comments .post-com-count-wrapper {
+ white-space: nowrap;
+ word-wrap: normal;
+}
+
+/* comments bubble common */
+.column-response .post-com-count,
+.column-comments .post-com-count {
+ display: inline-block;
+ vertical-align: top;
+}
+
+/* comments bubble approved */
+.column-response .post-com-count-no-comments,
+.column-response .post-com-count-approved,
+.column-comments .post-com-count-no-comments,
+.column-comments .post-com-count-approved {
+ margin-top: 5px;
+}
+
+.column-response .comment-count-no-comments,
+.column-response .comment-count-approved,
+.column-comments .comment-count-no-comments,
+.column-comments .comment-count-approved {
+ box-sizing: border-box;
+ display: block;
+ padding: 0 8px;
+ min-width: 24px;
+ height: 2em;
+ border-radius: 5px;
+ background-color: #72777c;
+ color: #fff;
+ font-size: 11px;
+ line-height: 21px;
+ text-align: center;
+}
+
+.ie8 .column-response .comment-count-no-comments,
+.ie8 .column-response .comment-count-approved,
+.ie8 .column-comments .comment-count-no-comments,
+.ie8 .column-comments .comment-count-approved {
+ min-width: 0;
+}
+
+.column-response .post-com-count-no-comments:after,
+.column-response .post-com-count-approved:after,
+.column-comments .post-com-count-no-comments:after,
+.column-comments .post-com-count-approved:after {
+ content: "";
+ display: block;
+ margin-left: 8px;
+ width: 0;
+ height: 0;
+ border-top: 5px solid #72777c;
+ border-right: 5px solid transparent;
+}
+
+.column-response .post-com-count-approved:hover .comment-count-approved,
+.column-response .post-com-count-approved:focus .comment-count-approved,
+.column-comments .post-com-count-approved:hover .comment-count-approved,
+.column-comments .post-com-count-approved:focus .comment-count-approved {
+ background: #0073aa;
+}
+
+.column-response .post-com-count-approved:hover:after,
+.column-response .post-com-count-approved:focus:after,
+.column-comments .post-com-count-approved:hover:after,
+.column-comments .post-com-count-approved:focus:after {
+ border-top-color: #0073aa;
+}
+
+/* @todo: consider to use a single rule for these counters and the admin menu counters. */
+.column-response .post-com-count-pending,
+.column-comments .post-com-count-pending {
+ position: relative;
+ left: -3px;
+ padding: 0 5px;
+ min-width: 7px;
+ height: 17px;
+ border: 2px solid #fff;
+ border-radius: 11px;
+ background: #ca4a1f;
+ color: #fff;
+ font-size: 9px;
+ line-height: 17px;
+ text-align: center;
+}
+
+.column-response .post-com-count-no-pending,
+.column-comments .post-com-count-no-pending {
+ display: none;
+}
+
+/* comments */
+
+.commentlist li {
+ padding: 1em 1em .2em;
+ margin: 0;
+ border-bottom: 1px solid #ccc;
+}
+
+.commentlist li li {
+ border-bottom: 0;
+ padding: 0;
+}
+
+.commentlist p {
+ padding: 0;
+ margin: 0 0 .8em;
+}
+
+#submitted-on,
+.submitted-on {
+ color: #555d66;
+}
+
+/* reply to comments */
+#replyrow td {
+ padding: 2px;
+}
+
+#replysubmit {
+ margin: 0;
+ padding: 5px 7px 10px;
+ overflow: hidden;
+}
+
+#replysubmit .reply-submit-buttons {
+ margin-bottom: 0;
+}
+
+#replysubmit .button {
+ margin-right: 5px;
+}
+
+#replysubmit .spinner {
+ float: none;
+ margin: -4px 0 0;
+}
+
+#replyrow.inline-edit-row fieldset.comment-reply {
+ font-size: inherit;
+ line-height: inherit;
+}
+
+#replyrow legend {
+ margin: 0;
+ padding: .2em 5px 0;
+ font-size: 13px;
+ line-height: 1.4;
+ font-weight: 600;
+}
+
+#replyrow.inline-edit-row label {
+ display: inline;
+ vertical-align: baseline;
+ line-height: inherit;
+}
+
+#edithead .inside,
+#commentsdiv #edithead .inside {
+ float: left;
+ padding: 3px 0 2px 5px;
+ margin: 0;
+ text-align: center;
+}
+
+#edithead .inside input {
+ width: 180px;
+}
+
+#edithead label {
+ padding: 2px 0;
+}
+
+#replycontainer {
+ padding: 5px;
+}
+
+#replycontent {
+ height: 120px;
+ box-shadow: none;
+}
+
+#replyerror {
+ border-color: #ddd;
+ background-color: #f9f9f9;
+}
+
+/* @todo: is this used? */
+.commentlist .avatar {
+ vertical-align: text-top;
+}
+
+#the-comment-list tr.undo,
+#the-comment-list div.undo {
+ background-color: #f5f5f5;
+}
+
+#the-comment-list .unapproved th,
+#the-comment-list .unapproved td {
+ background-color: #fef7f1;
+}
+
+#the-comment-list .unapproved th.check-column {
+ border-left: 4px solid #d54e21;
+}
+
+#the-comment-list .unapproved th.check-column input {
+ margin-left: 4px;
+}
+
+#the-comment-list .approve a {
+ color: #006505;
+}
+
+#the-comment-list .unapprove a {
+ color: #d98500;
+}
+
+#the-comment-list th,
+#the-comment-list td {
+ box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.1);
+}
+
+#the-comment-list tr:last-child th,
+#the-comment-list tr:last-child td {
+ box-shadow: none;
+}
+
+#the-comment-list tr.unapproved + tr.approved th,
+#the-comment-list tr.unapproved + tr.approved td {
+ border-top: 1px solid rgba(0, 0, 0, 0.03);
+}
+
+/* table vim shortcuts */
+.vim-current,
+.vim-current th,
+.vim-current td {
+ background-color: #e4f2fd !important;
+}
+
+th .comment-grey-bubble {
+ height: 16px;
+ width: 16px;
+}
+
+th .comment-grey-bubble:before {
+ content: "\f101";
+ font: normal 20px/.5 dashicons;
+ speak: none;
+ display: inline-block;
+ padding: 0;
+ top: 4px;
+ left: -4px;
+ position: relative;
+ vertical-align: top;
+ -webkit-font-smoothing: antialiased;
+ -moz-osx-font-smoothing: grayscale;
+ text-decoration: none !important;
+ color: #444;
+}
+
+/*------------------------------------------------------------------------------
+ 10.0 - List Posts (/Pages/etc)
+------------------------------------------------------------------------------*/
+
+table.fixed {
+ table-layout: fixed;
+}
+
+.fixed .column-rating,
+.fixed .column-visible {
+ width: 8%;
+}
+
+.fixed .column-posts,
+.fixed .column-date,
+.fixed .column-parent,
+.fixed .column-links,
+.fixed .column-author,
+.fixed .column-format {
+ width: 10%;
+}
+
+.fixed .column-posts {
+ width: 74px;
+}
+
+.fixed .column-comment .comment-author {
+ display: none;
+}
+
+.fixed .column-response,
+.fixed .column-categories,
+.fixed .column-tags,
+.fixed .column-rel,
+.fixed .column-role {
+ width: 15%;
+}
+
+.fixed .column-slug {
+ width: 25%;
+}
+
+.fixed .column-locations {
+ width: 35%;
+}
+
+.fixed .column-comments {
+ width: 5.5em;
+ padding: 8px 0;
+ text-align: left;
+}
+
+.fixed .column-comments .vers {
+ padding-left: 3px;
+}
+
+td.column-title strong,
+td.plugin-title strong {
+ display: block;
+ margin-bottom: .2em;
+ font-size: 14px;
+}
+
+td.column-title p,
+td.plugin-title p {
+ margin: 6px 0;
+}
+
+/* Media file column */
+table.media .column-title .media-icon {
+ float: left;
+ min-height: 60px;
+ margin: 0 9px 0 0;
+}
+
+table.media .column-title .media-icon img {
+ max-width: 60px;
+ height: auto;
+ vertical-align: top; /* Remove descender white-space. */
+}
+
+table.media .column-title .has-media-icon ~ .row-actions {
+ margin-left: 70px; /* 60px image + margin */
+}
+
+table.media .column-title .filename {
+ margin-bottom: 0.2em;
+}
+
+/* @todo: pick a consistent list table selector */
+.wp-list-table a {
+ transition: none;
+}
+
+#the-list tr:last-child td,
+#the-list tr:last-child th {
+ border-bottom: none !important;
+ box-shadow: none;
+}
+
+#comments-form .fixed .column-author {
+ width: 20%;
+}
+
+#comments-form .fixed .column-date {
+ width: 14%;
+}
+
+#commentsdiv.postbox .inside {
+ margin: 0;
+ padding: 0;
+}
+
+#commentsdiv .inside .row-actions {
+ line-height: 18px;
+}
+
+#commentsdiv .inside .column-author {
+ width: 25%;
+}
+
+#commentsdiv .column-comment p {
+ margin: 0.6em 0;
+ padding: 0;
+}
+
+#commentsdiv #replyrow td {
+ padding: 0;
+}
+
+#commentsdiv p {
+ padding: 8px 10px;
+ margin: 0;
+}
+
+#commentsdiv .comments-box {
+ border: 0 none;
+}
+
+#commentsdiv .comments-box thead th,
+#commentsdiv .comments-box thead td {
+ background: transparent;
+ padding: 0 7px 4px;
+ font-style: italic;
+}
+
+#commentsdiv .comments-box tr:last-child td {
+ border-bottom: 0 none;
+}
+
+#commentsdiv #edithead .inside input {
+ width: 160px;
+}
+
+.sorting-indicator {
+ display: block;
+ visibility: hidden;
+ width: 10px;
+ height: 4px;
+ margin-top: 8px;
+ margin-left: 7px;
+}
+
+.sorting-indicator:before {
+ content: "\f142";
+ font: normal 20px/1 dashicons;
+ speak: none;
+ display: inline-block;
+ padding: 0;
+ top: -4px;
+ left: -8px;
+ color: #444;
+ line-height: 10px;
+ position: relative;
+ vertical-align: top;
+ -webkit-font-smoothing: antialiased;
+ -moz-osx-font-smoothing: grayscale;
+ text-decoration: none !important;
+ color: #444;
+}
+
+.column-comments .sorting-indicator:before {
+ top: 0;
+ left: -10px;
+}
+
+th.sorted.asc .sorting-indicator:before,
+th.desc:hover span.sorting-indicator:before,
+th.desc a:focus span.sorting-indicator:before {
+ content: "\f142";
+}
+
+th.sorted.desc .sorting-indicator:before,
+th.asc:hover span.sorting-indicator:before,
+th.asc a:focus span.sorting-indicator:before {
+ content: "\f140";
+}
+
+.wp-list-table .toggle-row {
+ position: absolute;
+ right: 8px;
+ top: 10px;
+ display: none;
+ padding: 0;
+ width: 40px;
+ height: 40px;
+ border: none;
+ outline: none;
+ background: transparent;
+}
+
+.wp-list-table .toggle-row:hover {
+ cursor: pointer;
+}
+
+.wp-list-table .toggle-row:focus:before {
+ box-shadow:
+ 0 0 0 1px #5b9dd9,
+ 0 0 2px 1px rgba(30, 140, 190, 0.8);
+}
+
+.ie8 .wp-list-table .toggle-row:focus:before {
+ outline: #5b9dd9 solid 1px;
+}
+
+.wp-list-table .toggle-row:active {
+ box-shadow: none;
+}
+
+.wp-list-table .toggle-row:before {
+ position: absolute;
+ top: -5px;
+ left: 10px;
+ border-radius: 50%;
+ display: block;
+ padding: 1px 2px 1px 0;
+ color: #444; /* same as table headers sort arrows */
+ content: "\f140";
+ font: normal 20px/1 dashicons;
+ line-height: 1;
+ -webkit-font-smoothing: antialiased;
+ -moz-osx-font-smoothing: grayscale;
+ speak: none;
+}
+
+.wp-list-table .is-expanded .toggle-row:before {
+ content: "\f142";
+}
+
+tr.wp-locked .locked-indicator {
+ margin-left: 6px;
+ height: 20px;
+ width: 16px;
+}
+
+tr.wp-locked .locked-indicator-icon:before {
+ color: #82878c;
+ content: "\f160";
+ display: inline-block;
+ font: normal 20px/1 dashicons;
+ speak: none;
+ vertical-align: middle;
+ -webkit-font-smoothing: antialiased;
+ -moz-osx-font-smoothing: grayscale;
+}
+
+tr.wp-locked .check-column label,
+tr.wp-locked .check-column input[type="checkbox"],
+tr.wp-locked .row-actions .inline,
+tr.wp-locked .row-actions .trash {
+ display: none;
+}
+
+tr .locked-info {
+ height: 0;
+ opacity: 0;
+}
+
+tr.wp-locked .locked-info {
+ margin-top: 4px;
+ height: auto;
+ opacity: 1;
+}
+
+.locked-text {
+ vertical-align: top;
+}
+
+tr.locked-info, tr.wp-locked .locked-info {
+ transition: height 1s, opacity 0.5s;
+}
+
+.fixed .column-comments .sorting-indicator {
+ margin-top: 3px;
+}
+
+#menu-locations-wrap .widefat {
+ width: 60%;
+}
+
+.widefat th.sortable,
+.widefat th.sorted {
+ padding: 0;
+}
+
+th.sortable a,
+th.sorted a {
+ display: block;
+ overflow: hidden;
+ padding: 8px;
+}
+
+.fixed .column-comments.sortable a,
+.fixed .column-comments.sorted a {
+ padding: 8px 0;
+}
+
+th.sortable a span,
+th.sorted a span {
+ float: left;
+ cursor: pointer;
+}
+
+th.sorted .sorting-indicator,
+th.desc:hover span.sorting-indicator,
+th.desc a:focus span.sorting-indicator,
+th.asc:hover span.sorting-indicator,
+th.asc a:focus span.sorting-indicator {
+ visibility: visible;
+}
+
+.tablenav-pages .current-page {
+ margin: 0 2px 0 0;
+ padding-top: 5px;
+ padding-bottom: 5px;
+ font-size: 13px;
+ text-align: center;
+}
+
+.tablenav .total-pages {
+ margin-right: 2px;
+}
+
+.tablenav #table-paging {
+ margin-left: 2px;
+}
+
+.tablenav {
+ clear: both;
+ height: 30px;
+ margin: 6px 0 4px;
+ vertical-align: middle;
+}
+
+.tablenav.themes {
+ max-width: 98%;
+}
+
+.tablenav .tablenav-pages {
+ float: right;
+ margin: 3px 0 9px;
+}
+
+.tablenav .no-pages,
+.tablenav .one-page .pagination-links {
+ display: none;
+}
+
+.tablenav .tablenav-pages .button,
+.tablenav .tablenav-pages .tablenav-pages-navspan {
+ display: inline-block;
+ vertical-align: baseline;
+ min-width: 28px;
+ min-height: 28px;
+ margin: 0;
+ padding: 0 4px;
+ font-size: 16px;
+ line-height: 1.5;
+ text-align: center;
+}
+
+.tablenav .displaying-num {
+ margin-right: 7px;
+}
+
+.tablenav .one-page .displaying-num {
+ display: inline-block;
+ margin: 5px 0;
+}
+
+.tablenav .actions {
+ overflow: hidden;
+ padding: 2px 8px 0 0;
+}
+
+.wp-filter .actions {
+ display: inline-block;
+ vertical-align: middle;
+}
+
+.tablenav .delete {
+ margin-right: 20px;
+}
+
+/* This view-switcher is still used on multisite. */
+.tablenav .view-switch {
+ float: right;
+ margin: 0 5px;
+ padding-top: 3px;
+}
+
+.wp-filter .view-switch {
+ display: inline-block;
+ vertical-align: middle;
+ padding: 12px 0;
+ margin: 0 8px 0 2px;
+}
+
+.media-toolbar.wp-filter .view-switch {
+ margin: 0 12px 0 2px;
+}
+
+.view-switch a {
+ float: left;
+ width: 28px;
+ height: 28px;
+ text-align: center;
+ line-height: 24px;
+ text-decoration: none;
+}
+
+.view-switch a:before {
+ color: #b4b9be;
+ display: inline-block;
+ font: normal 20px/1 dashicons;
+ speak: none;
+ vertical-align: middle;
+ -webkit-font-smoothing: antialiased;
+ -moz-osx-font-smoothing: grayscale;
+}
+
+.view-switch a:hover:before,
+.view-switch a:focus:before {
+ color: #727272;
+}
+
+.view-switch a.current:before {
+ color: #0073aa;
+}
+
+.view-switch .view-list:before {
+ content: "\f163";
+}
+
+.view-switch .view-excerpt:before {
+ content: "\f164";
+}
+
+.view-switch .view-grid:before {
+ content: "\f509";
+}
+
+.filter {
+ float: left;
+ margin: -5px 0 0 10px;
+}
+
+.filter .subsubsub {
+ margin-left: -10px;
+ margin-top: 13px;
+}
+.screen-per-page {
+ width: 4em;
+}
+
+#posts-filter .wp-filter {
+ margin-bottom: 0;
+}
+
+#posts-filter fieldset {
+ float: left;
+ margin: 0 1.5ex 1em 0;
+ padding: 0;
+}
+
+#posts-filter fieldset legend {
+ padding: 0 0 .2em 1px;
+}
+
+p.pagenav {
+ margin: 0;
+ display: inline;
+}
+
+.pagenav span {
+ font-weight: 600;
+ margin: 0 6px;
+}
+
+.row-title {
+ font-size: 14px !important;
+ font-weight: 600;
+}
+
+.column-comment .comment-author {
+ margin-bottom: 0.6em;
+}
+
+.column-author img,
+.column-username img,
+.column-comment .comment-author img {
+ float: left;
+ margin-right: 10px;
+ margin-top: 1px;
+}
+
+.row-actions {
+ color: #ddd;
+ font-size: 13px;
+ padding: 2px 0 0;
+ position: relative;
+ left: -9999em;
+}
+
+/* ticket #34150 */
+.rtl .row-actions a {
+ display: inline-block;
+}
+
+.row-actions .network_only,
+.row-actions .network_active {
+ color: #000;
+}
+
+.no-js .row-actions,
+tr:hover .row-actions,
+.mobile .row-actions,
+.row-actions.visible,
+.comment-item:hover .row-actions {
+ position: static;
+}
+
+/* deprecated */
+.row-actions-visible {
+ padding: 2px 0 0;
+}
+
+
+/*------------------------------------------------------------------------------
+ 10.1 - Inline Editing
+------------------------------------------------------------------------------*/
+
+/*
+.quick-edit* is for Quick Edit
+.bulk-edit* is for Bulk Edit
+.inline-edit* is for everything
+*/
+
+/* Layout */
+
+#wpbody-content .inline-edit-row fieldset {
+ font-size: 12px;
+ float: left;
+ margin: 0;
+ padding: 0;
+ width: 100%;
+}
+
+tr.inline-edit-row td,
+#wpbody-content .inline-edit-row fieldset .inline-edit-col {
+ padding: 0 0.5em;
+}
+
+#wpbody-content .quick-edit-row-post .inline-edit-col-left {
+ width: 40%;
+}
+
+#wpbody-content .quick-edit-row-post .inline-edit-col-right {
+ width: 39%;
+}
+
+#wpbody-content .inline-edit-row-post .inline-edit-col-center {
+ width: 20%;
+}
+
+#wpbody-content .quick-edit-row-page .inline-edit-col-left {
+ width: 50%;
+}
+
+#wpbody-content .quick-edit-row-page .inline-edit-col-right,
+#wpbody-content .bulk-edit-row-post .inline-edit-col-right {
+ width: 49%;
+}
+
+#wpbody-content .bulk-edit-row .inline-edit-col-left {
+ width: 30%;
+}
+
+#wpbody-content .bulk-edit-row-page .inline-edit-col-right {
+ width: 69%;
+}
+
+#wpbody-content .bulk-edit-row .inline-edit-col-bottom {
+ float: right;
+ width: 69%;
+}
+
+#wpbody-content .inline-edit-row-page .inline-edit-col-right {
+ margin-top: 27px;
+}
+
+.inline-edit-row fieldset .inline-edit-group {
+ clear: both;
+ line-height: 2.5;
+}
+
+.inline-edit-row .submit {
+ clear: both;
+ padding: 0.5em;
+ margin: 0.5em 0 0;
+}
+
+.inline-edit-row .notice-error {
+ margin-top: 1em;
+}
+
+.inline-edit-row .notice-error .error {
+ margin: 0.5em 0;
+ padding: 2px;
+}
+
+/* Positioning */
+
+/* Needs higher specificity for the padding */
+#the-list .inline-edit-row .inline-edit-legend {
+ margin: 0;
+ padding: 0.2em 0.5em 0;
+ line-height: 2.5;
+ font-weight: 600;
+}
+
+#the-list #bulk-edit.inline-edit-row .inline-edit-legend {
+ padding: 0.2em 0.5em;
+}
+
+.inline-edit-row fieldset span.title,
+.inline-edit-row fieldset span.checkbox-title {
+ margin: 0;
+ padding: 0;
+}
+
+.inline-edit-row fieldset label,
+.inline-edit-row fieldset span.inline-edit-categories-label {
+ display: block;
+ margin: .2em 0;
+ line-height: 2.5;
+}
+
+.inline-edit-row fieldset.inline-edit-date label {
+ display: inline-block;
+ margin: 0;
+ line-height: 1.5;
+ vertical-align: baseline;
+}
+
+.inline-edit-row fieldset label.inline-edit-tags {
+ margin-top: 0;
+}
+
+.inline-edit-row fieldset label.inline-edit-tags span.title {
+ margin: .2em 0;
+ width: auto;
+}
+
+.inline-edit-row fieldset label span.title,
+.inline-edit-row fieldset.inline-edit-date legend {
+ display: block;
+ float: left;
+ width: 6em;
+ line-height: 2.5;
+}
+
+#posts-filter fieldset.inline-edit-date legend {
+ padding: 0;
+}
+
+.inline-edit-row fieldset.inline-edit-date select {
+ margin: 1px;
+ line-height: 28px;
+}
+
+.inline-edit-row fieldset label span.input-text-wrap,
+.inline-edit-row fieldset .timestamp-wrap {
+ display: block;
+ margin-left: 6em;
+}
+
+.quick-edit-row-post fieldset.inline-edit-col-right label span.title {
+ width: auto;
+ padding-right: 0.5em;
+}
+
+.inline-edit-row .inline-edit-or {
+ margin: .2em 6px .2em 0;
+ line-height: 2.5;
+}
+
+.inline-edit-row .input-text-wrap input[type=text] {
+ width: 100%;
+}
+
+.inline-edit-row fieldset label input[type=checkbox] {
+ vertical-align: middle;
+}
+
+.inline-edit-row fieldset label textarea {
+ width: 100%;
+ height: 4em;
+ vertical-align: top;
+}
+
+#wpbody-content .bulk-edit-row fieldset .inline-edit-group label {
+ max-width: 50%;
+}
+
+#wpbody-content .quick-edit-row fieldset .inline-edit-group label.alignleft:first-child {
+ margin-right: 0.5em
+}
+
+.inline-edit-col-right .input-text-wrap input.inline-edit-menu-order-input {
+ width: 6em;
+}
+
+/* Styling */
+.inline-edit-row .inline-edit-legend {
+ text-transform: uppercase;
+}
+
+.inline-edit-row fieldset span.title,
+.inline-edit-row fieldset span.checkbox-title {
+ font-style: italic;
+}
+
+/* Specific Elements */
+.inline-edit-row fieldset .inline-edit-date {
+ float: left;
+}
+
+.inline-edit-row fieldset input[name=jj],
+.inline-edit-row fieldset input[name=hh],
+.inline-edit-row fieldset input[name=mn] {
+ font-size: 12px;
+ width: 2.3em;
+}
+
+.inline-edit-row fieldset input[name=aa] {
+ font-size: 12px;
+ width: 3.5em;
+}
+
+.inline-edit-row fieldset label input.inline-edit-password-input {
+ width: 8em;
+}
+
+ul.cat-checklist {
+ height: 12em;
+ border: solid 1px #ddd;
+ overflow-y: scroll;
+ padding: 0 5px;
+ margin: 0;
+ background-color: #fff;
+}
+
+#bulk-titles {
+ display: block;
+ height: 12em;
+ border: 1px solid #ddd;
+ overflow-y: scroll;
+ padding: 0 5px;
+ margin: 0 0 5px;
+}
+
+.inline-edit-row fieldset ul.cat-checklist li,
+.inline-edit-row fieldset ul.cat-checklist input {
+ margin: 0;
+ position: relative; /* RTL fix, #WP27629 */
+}
+
+.inline-edit-row fieldset ul.cat-checklist label,
+.inline-edit-row #bulk-titles div {
+ font-style: normal;
+ font-size: 11px;
+}
+
+.inline-edit-row fieldset label input.inline-edit-menu-order-input {
+ width: 3em;
+}
+
+.inline-edit-row fieldset label input.inline-edit-slug-input {
+ width: 75%;
+}
+
+.inline-edit-row #post_parent,
+.inline-edit-row select[name="page_template"] {
+ max-width: 80%;
+}
+
+.ie8 .inline-edit-row #post_parent,
+.ie8 .inline-edit-row select[name="page_template"] {
+ width: 250px;
+}
+
+.quick-edit-row-post fieldset label.inline-edit-status {
+ float: left;
+}
+
+#bulk-titles {
+ line-height: 140%;
+}
+#bulk-titles div {
+ margin: 0.2em 0.3em;
+}
+
+#bulk-titles div a {
+ cursor: pointer;
+ display: block;
+ float: left;
+ height: 18px;
+ margin: 0 3px 0 -2px;
+ overflow: hidden;
+ position: relative;
+ width: 20px;
+}
+
+#bulk-titles div a:before {
+ position: relative;
+ top: -3px;
+}
+
+/*------------------------------------------------------------------------------
+ 17.0 - Plugins
+------------------------------------------------------------------------------*/
+
+.plugins tbody th.check-column,
+.plugins tbody {
+ padding: 8px 0 0 2px;
+}
+
+.plugins tbody th.check-column input[type=checkbox] {
+ margin-top: 4px;
+}
+
+.updates-table .plugin-title p {
+ margin-top: 0;
+}
+
+.plugins thead td.check-column,
+.plugins tfoot td.check-column,
+.plugins .inactive th.check-column {
+ padding-left: 6px;
+}
+
+.plugins,
+.plugins th,
+.plugins td {
+ color: #000;
+}
+
+.plugins tr {
+ background: #fff;
+}
+
+.plugins p {
+ margin: 0 4px;
+ padding: 0;
+}
+
+.plugins .desc p {
+ margin: 0 0 8px;
+}
+
+.plugins td.desc {
+ line-height: 1.5em;
+}
+
+.plugins .desc ul,
+.plugins .desc ol {
+ margin: 0 0 0 2em;
+}
+
+.plugins .desc ul {
+ list-style-type: disc;
+}
+
+.plugins .row-actions {
+ font-size: 13px;
+ padding: 0;
+}
+
+.plugins .inactive td,
+.plugins .inactive th,
+.plugins .active td,
+.plugins .active th {
+ padding: 10px 9px;
+}
+
+.plugins .active td,
+.plugins .active th {
+ background-color: #f7fcfe;
+}
+
+.plugins .update th,
+.plugins .update td {
+ border-bottom: 0;
+}
+
+.plugins .inactive td,
+.plugins .inactive th,
+.plugins .active td,
+.plugins .active th,
+.plugin-install #the-list td,
+.upgrade .plugins td,
+.upgrade .plugins th {
+ box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.1);
+}
+
+.plugins tr.active.plugin-update-tr + tr.inactive th,
+.plugins tr.active.plugin-update-tr + tr.inactive td,
+.plugins tr.active + tr.inactive th,
+.plugins tr.active + tr.inactive td {
+ border-top: 1px solid rgba(0, 0, 0, 0.03);
+ box-shadow: inset 0 1px 0 rgba(0, 0, 0, 0.02), inset 0 -1px 0 #e1e1e1;
+}
+
+.plugins .update td,
+.plugins .update th,
+.upgrade .plugins tr:last-of-type td,
+.upgrade .plugins tr:last-of-type th,
+.plugins tr.active + tr.inactive.update th,
+.plugins tr.active + tr.inactive.update td,
+.plugins .updated td,
+.plugins .updated th,
+.plugins tr.active + tr.inactive.updated th,
+.plugins tr.active + tr.inactive.updated td {
+ box-shadow: none;
+}
+
+.plugins .active th.check-column,
+.plugin-update-tr.active td {
+ border-left: 4px solid #00a0d2;
+}
+
+.wp-list-table.plugins .plugin-title,
+.wp-list-table.plugins .theme-title {
+ padding-right: 12px;
+ white-space: nowrap;
+}
+
+.plugins .plugin-title img,
+.plugins .plugin-title .dashicons {
+ float: left;
+ padding: 0 10px 0 0;
+ width: 64px;
+ height: 64px;
+}
+
+.plugins .plugin-title .dashicons:before {
+ padding: 2px;
+ background-color: #eee;
+ box-shadow: inset 0 0 10px rgba(160, 165, 170, 0.15);
+ font-size: 60px;
+ color: #B4B9BE;
+}
+
+#update-themes-table .plugin-title img,
+#update-themes-table .plugin-title .dashicons {
+ width: 85px;
+}
+
+.plugins .inactive .plugin-title strong {
+ font-weight: 400;
+}
+
+.plugins .second,
+.plugins .row-actions {
+ padding: 0 0 5px;
+}
+
+.plugins .update .second,
+.plugins .update .row-actions,
+.plugins .updated .second,
+.plugins .updated .row-actions {
+ padding-bottom: 0;
+}
+
+.plugins-php .widefat tfoot th,
+.plugins-php .widefat tfoot td {
+ border-top-style: solid;
+ border-top-width: 1px;
+}
+
+.plugins .plugin-update-tr .plugin-update {
+ box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.1);
+ overflow: hidden; /* clearfix */
+ padding: 0;
+}
+
+.plugins .plugin-update-tr .notice,
+.plugins .plugin-update-tr div[class="update-message"] { /* back-compat for pre-4.6 */
+ margin: 5px 20px 15px 40px;
+}
+
+.plugins .notice p {
+ margin: 0.5em 0;
+}
+
+.plugins .plugin-description a,
+.plugins .plugin-update a,
+.updates-table .plugin-title a {
+ text-decoration: underline;
+}
+
+.plugins tr.paused th.check-column {
+ border-left: 4px solid #d54e21;
+}
+
+.plugins tr.paused th,
+.plugins tr.paused td {
+ background-color: #fef7f1;
+}
+
+.plugins tr.paused .plugin-title,
+.plugins .paused .dashicons-warning {
+ color: #dc3232;
+}
+
+.plugins .paused .error-display p,
+.plugins .paused .error-display code {
+ font-size: 90%;
+ font-style: italic;
+ color: rgb( 0, 0, 0, 0.7 );
+}
+
+.plugins .resume-link {
+ color: #dc3232;
+}
+
+.plugin-card .update-now:before {
+ color: #f56e28;
+ content: "\f463";
+ display: inline-block;
+ font: normal 20px/1 dashicons;
+ margin: 3px 5px 0 -2px;
+ speak: none;
+ -webkit-font-smoothing: antialiased;
+ -moz-osx-font-smoothing: grayscale;
+ vertical-align: top;
+}
+
+.plugin-card .updating-message:before {
+ content: "\f463";
+ animation: rotation 2s infinite linear;
+}
+
+@keyframes rotation {
+ 0% {
+ transform: rotate(0deg);
+ }
+ 100% {
+ transform: rotate(359deg);
+ }
+}
+
+.plugin-card .updated-message:before {
+ color: #79ba49;
+ content: "\f147";
+}
+
+.plugin-install-php h2 {
+ clear: both;
+}
+
+.plugin-install-php h3 {
+ margin: 2.5em 0 8px;
+}
+
+.plugin-install-php .wp-filter {
+ margin-bottom: 0;
+}
+
+/* Plugin card table view */
+.plugin-group {
+ overflow: hidden; /* clearfix */
+ margin-top: 1.5em;
+}
+
+.plugin-group h3 {
+ margin-top: 0;
+}
+
+.plugin-card {
+ float: left;
+ margin: 0 8px 16px;
+ width: 48.5%;
+ width: calc( 50% - 8px );
+ background-color: #fff;
+ border: 1px solid #ddd;
+ box-sizing: border-box;
+}
+
+.plugin-card:nth-child(odd) {
+ clear: both;
+ margin-left: 0;
+}
+
+.plugin-card:nth-child(even) {
+ margin-right: 0;
+}
+
+@media screen and (min-width: 1600px) and ( max-width: 2299px ) {
+ .plugin-card {
+ width: 30%;
+ width: calc( 33.1% - 8px );
+ }
+
+ .plugin-card:nth-child(odd) {
+ clear: none;
+ margin-left: 8px;
+ }
+
+ .plugin-card:nth-child(even) {
+ margin-right: 8px;
+ }
+
+ .plugin-card:nth-child(3n+1) {
+ clear: both;
+ margin-left: 0;
+ }
+
+ .plugin-card:nth-child(3n) {
+ margin-right: 0;
+ }
+}
+
+@media screen and (min-width: 2300px) {
+ .plugin-card {
+ width: 25%;
+ width: calc( 25% - 12px );
+ }
+
+ .plugin-card:nth-child(odd) {
+ clear: none;
+ margin-left: 8px;
+ }
+
+ .plugin-card:nth-child(even) {
+ margin-right: 8px;
+ }
+
+ .plugin-card:nth-child(4n+1) {
+ clear: both;
+ margin-left: 0;
+ }
+
+ .plugin-card:nth-child(4n) {
+ margin-right: 0;
+ }
+}
+
+.plugin-card-top {
+ position: relative;
+ padding: 20px 20px 10px;
+ min-height: 135px;
+}
+
+div.action-links,
+.plugin-action-buttons {
+ margin: 0; /* Override existing margins */
+}
+
+.plugin-card h3 {
+ margin: 0 0 12px;
+ font-size: 18px;
+ line-height: 1.3;
+}
+
+.plugin-card .name,
+.plugin-card .desc {
+ margin-left: 148px; /* icon + margin */
+ margin-right: 120px; /* action links */
+}
+
+.plugin-card .action-links {
+ position: absolute;
+ top: 20px;
+ right: 20px;
+ width: 120px;
+}
+
+.plugin-action-buttons {
+ clear: right;
+ float: right;
+ margin-left: 2em;
+ margin-bottom: 1em;
+ text-align: right;
+}
+
+.plugin-action-buttons li {
+ margin-bottom: 10px;
+}
+
+.plugin-card-bottom {
+ clear: both;
+ padding: 12px 20px;
+ background-color: #fafafa;
+ border-top: 1px solid #ddd;
+ overflow: hidden;
+}
+
+.plugin-card-bottom .star-rating {
+ display: inline;
+}
+
+.plugin-card-update-failed .update-now {
+ font-weight: 600;
+}
+
+.plugin-card-update-failed .notice-error {
+ margin: 0;
+ padding-left: 16px;
+ box-shadow: 0 -1px 0 #ddd;
+}
+
+.plugin-card-update-failed .plugin-card-bottom {
+ display: none;
+}
+
+.plugin-card .column-rating {
+ line-height: 23px;
+}
+
+.plugin-card .column-rating,
+.plugin-card .column-updated {
+ margin-bottom: 4px;
+}
+
+.plugin-card .column-rating,
+.plugin-card .column-downloaded {
+ float: left;
+ clear: left;
+ max-width: 180px;
+}
+
+.plugin-card .column-updated,
+.plugin-card .column-compatibility {
+ text-align: right;
+ float: right;
+ clear: right;
+ width: 65%;
+ width: calc( 100% - 180px );
+}
+
+.plugin-card .column-compatibility span:before {
+ font: normal 20px/.5 dashicons;
+ speak: none;
+ display: inline-block;
+ padding: 0;
+ top: 4px;
+ left: -2px;
+ position: relative;
+ vertical-align: top;
+ -webkit-font-smoothing: antialiased;
+ -moz-osx-font-smoothing: grayscale;
+ text-decoration: none !important;
+ color: #444;
+}
+
+.plugin-card .column-compatibility .compatibility-incompatible:before {
+ content: "\f158";
+ color: #c62d2d;
+}
+
+.plugin-card .column-compatibility .compatibility-compatible:before {
+ content: "\f147";
+ color: #31843f;
+}
+
+.plugin-card .notice {
+ margin: 20px 20px 0 20px;
+}
+
+.plugin-icon {
+ position: absolute;
+ top: 20px;
+ left: 20px;
+ width: 128px;
+ height: 128px;
+ margin: 0 20px 20px 0;
+}
+
+.no-plugin-results {
+ color: #666; /* same as no themes and no media */
+ font-size: 18px;
+ font-style: normal;
+ margin: 0;
+ padding: 100px 0 0;
+ text-align: center;
+}
+
+/* ms */
+/* Background Color for Site Status */
+.wp-list-table .site-deleted,
+.wp-list-table tr.site-deleted {
+ background: #ff8573;
+}
+.wp-list-table .site-spammed,
+.wp-list-table tr.site-spammed {
+ background: #faafaa;
+}
+.wp-list-table .site-archived,
+.wp-list-table tr.site-archived {
+ background: #ffebe8;
+}
+.wp-list-table .site-mature,
+.wp-list-table tr.site-mature {
+ background: #fecac2;
+}
+
+.sites.fixed .column-lastupdated,
+.sites.fixed .column-registered {
+ width: 20%;
+}
+
+.sites.fixed .column-users {
+ width: 80px;
+}
+
+/* =Media Queries
+-------------------------------------------------------------- */
+
+@media screen and (max-width: 1100px) and (min-width: 782px), (max-width: 480px) {
+ .plugin-card .action-links {
+ position: static;
+ margin-left: 148px;
+ width: auto;
+ }
+
+ .plugin-action-buttons {
+ float: none;
+ margin: 1em 0 0;
+ text-align: left;
+ }
+
+ .plugin-action-buttons li {
+ display: inline-block;
+ vertical-align: middle;
+ }
+
+ .plugin-action-buttons li .button {
+ margin-right: 20px;
+ }
+
+ .plugin-card .name,
+ .plugin-card .desc {
+ margin-right: 0;
+ }
+
+ .plugin-card .desc p:first-of-type {
+ margin-top: 0;
+ }
+
+ .fixed .column-date {
+ width: 14%;
+ }
+}
+
+@media screen and (max-width: 782px) {
+ /* WP List Table Options & Filters */
+ .tablenav {
+ height: auto;
+ }
+
+ .tablenav.top {
+ margin: 20px 0 5px 0;
+ }
+
+ .tablenav.bottom {
+ position: relative;
+ margin-top: 15px;
+ }
+
+ .tablenav br {
+ display: none;
+ }
+
+ .tablenav br.clear {
+ display: block;
+ }
+
+ .tablenav.top .actions,
+ .tablenav .view-switch {
+ display: none;
+ }
+
+ .view-switch a {
+ width: 36px;
+ height: 36px;
+ line-height: 33px;
+ }
+
+ /* Pagination */
+ .tablenav.top .displaying-num {
+ display: none;
+ }
+
+ .tablenav.bottom .displaying-num {
+ position: absolute;
+ right: 0;
+ top: 11px;
+ margin: 0;
+ font-size: 14px;
+ }
+
+ .tablenav .tablenav-pages {
+ width: 100%;
+ text-align: center;
+ margin: 0 0 25px;
+ }
+
+ .tablenav.bottom .tablenav-pages {
+ margin-top: 25px;
+ }
+
+ .tablenav.top .tablenav-pages.one-page {
+ display: none;
+ }
+
+ .tablenav.bottom .tablenav-pages.one-page {
+ margin: 15px 0 0 0;
+ height: 0;
+ }
+
+ .tablenav-pages .pagination-links {
+ font-size: 16px;
+ }
+
+ .tablenav .tablenav-pages .button,
+ .tablenav .tablenav-pages .tablenav-pages-navspan {
+ min-width: 44px;
+ padding: 12px 8px;
+ font-size: 18px;
+ line-height: 1;
+ }
+
+ .tablenav-pages .pagination-links .current-page {
+ min-width: 44px;
+ padding: 12px 6px;
+ font-size: 16px;
+ line-height: 18px;
+ }
+
+ /* WP List Table Adjustments: General */
+ .form-wrap > p {
+ display: none;
+ }
+
+ .comment-count {
+ font-size: 14px;
+ }
+
+ .wp-list-table th.column-primary ~ th,
+ .wp-list-table tr:not(.inline-edit-row):not(.no-items) td.column-primary ~ td:not(.check-column) {
+ display: none;
+ }
+
+ .wp-list-table thead th.column-primary {
+ width: 100%;
+ }
+
+ /* Checkboxes need to show */
+ .wp-list-table tr th.check-column {
+ display: table-cell;
+ width: 35px;
+ }
+
+ .wp-list-table .column-primary .toggle-row {
+ display: block;
+ }
+
+ .wp-list-table tr:not(.inline-edit-row):not(.no-items) td:not(.check-column) {
+ position: relative;
+ clear: both;
+ display: block;
+ width: auto !important; /* needs to override some columns that are more specifically targeted */
+ }
+
+ .wp-list-table td.column-primary {
+ padding-right: 50px; /* space for toggle button */
+ }
+
+ .wp-list-table tr:not(.inline-edit-row):not(.no-items) td.column-primary ~ td:not(.check-column) {
+ padding: 3px 8px 3px 35%;
+ }
+
+ .wp-list-table tr:not(.inline-edit-row):not(.no-items) td:not(.column-primary)::before {
+ position: absolute;
+ left: 10px; /* match padding of regular table cell */
+ display: block;
+ overflow: hidden;
+ width: 32%; /* leave a little space for a gutter */
+ content: attr(data-colname);
+ white-space: nowrap;
+ text-overflow: ellipsis;
+ }
+
+ .wp-list-table .is-expanded td:not(.hidden) {
+ display: block !important;
+ overflow: hidden; /* clearfix */
+ }
+
+ /* Special cases */
+ .widefat .num,
+ .column-posts {
+ text-align: left;
+ }
+
+ #comments-form .fixed .column-author,
+ #commentsdiv .fixed .column-author {
+ display: none !important;
+ }
+
+ .fixed .column-comment .comment-author {
+ display: block;
+ }
+
+ /* Comment author hidden via Screen Options */
+ .fixed .column-author.hidden ~ .column-comment .comment-author {
+ display: none;
+ }
+
+ #the-comment-list .is-expanded td {
+ box-shadow: none;
+ }
+
+ #the-comment-list .is-expanded td:last-child {
+ box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.1);
+ }
+
+ /* Show comment bubble as text instead */
+ .post-com-count .screen-reader-text {
+ position: static;
+ -webkit-clip-path: none;
+ clip-path: none;
+ width: auto;
+ height: auto;
+ margin: 0;
+ }
+
+ .column-response .post-com-count-no-comments:after,
+ .column-response .post-com-count-approved:after,
+ .column-comments .post-com-count-no-comments:after,
+ .column-comments .post-com-count-approved:after {
+ content: none;
+ }
+
+ .column-response .post-com-count [aria-hidden="true"],
+ .column-comments .post-com-count [aria-hidden="true"] {
+ display: none;
+ }
+
+ .column-response .post-com-count-wrapper,
+ .column-comments .post-com-count-wrapper {
+ white-space: normal;
+ }
+
+ .column-response .post-com-count-wrapper > a,
+ .column-comments .post-com-count-wrapper > a {
+ display: block;
+ }
+
+ .column-response .post-com-count-no-comments,
+ .column-response .post-com-count-approved,
+ .column-comments .post-com-count-no-comments,
+ .column-comments .post-com-count-approved {
+ margin-top: 0;
+ margin-right: 0.5em;
+ }
+
+ .column-response .post-com-count-pending,
+ .column-comments .post-com-count-pending {
+ position: static;
+ height: auto;
+ min-width: 0;
+ padding: 0;
+ border: none;
+ border-radius: 0;
+ background: none;
+ color: #bb2a2a;
+ font-size: inherit;
+ line-height: inherit;
+ text-align: left;
+ }
+
+ .column-response .post-com-count-pending:hover,
+ .column-comments .post-com-count-pending:hover {
+ color: #dc3232;
+ }
+
+ .widefat thead td.check-column,
+ .widefat tfoot td.check-column {
+ padding-top: 10px;
+ }
+
+ .widefat * {
+ word-wrap: normal;
+ }
+
+ /* Make row actions more easy to select on mobile */
+ body:not(.plugins-php) .row-actions {
+ display: -ms-grid;
+ display: grid;
+ -ms-grid-columns: auto auto auto;
+ grid-template-columns: auto auto auto;
+ color: transparent;
+ }
+
+ .row-actions span {
+ padding: 4px 0;
+ }
+
+ .row-actions span a,
+ .row-actions span .button-link {
+ display: inline-block;
+ padding: 4px 0;
+ }
+
+ .row-actions span.approve:before,
+ .row-actions span.unapprove:before {
+ content: "| ";
+ }
+
+ /* Quick Edit and Bulk Edit */
+ #wpbody-content .quick-edit-row-post .inline-edit-col-left,
+ #wpbody-content .quick-edit-row-post .inline-edit-col-right,
+ #wpbody-content .inline-edit-row-post .inline-edit-col-center,
+ #wpbody-content .quick-edit-row-page .inline-edit-col-left,
+ #wpbody-content .quick-edit-row-page .inline-edit-col-right,
+ #wpbody-content .bulk-edit-row-post .inline-edit-col-right,
+ #wpbody-content .bulk-edit-row .inline-edit-col-left,
+ #wpbody-content .bulk-edit-row-page .inline-edit-col-right,
+ #wpbody-content .bulk-edit-row .inline-edit-col-bottom {
+ float: none;
+ width: 100%;
+ }
+
+ #wpbody-content .quick-edit-row fieldset .inline-edit-col label,
+ #wpbody-content .quick-edit-row fieldset .inline-edit-group label,
+ #wpbody-content .bulk-edit-row fieldset .inline-edit-col label,
+ #wpbody-content .bulk-edit-row fieldset .inline-edit-group label {
+ max-width: none;
+ float: none;
+ margin-bottom: 5px;
+ }
+
+ #wpbody .bulk-edit-row fieldset select {
+ display: block;
+ width: 100%;
+ max-width: none;
+ box-sizing: border-box;
+ }
+
+ .inline-edit-row fieldset ul.cat-checklist label,
+ .inline-edit-row #bulk-titles div {
+ font-size: 16px;
+ }
+
+ .inline-edit-row fieldset label span.title,
+ .inline-edit-row fieldset.inline-edit-date legend {
+ float: none;
+ }
+
+ .inline-edit-row fieldset label.inline-edit-tags {
+ padding: 0 0.5em;
+ }
+
+ .inline-edit-row fieldset .inline-edit-col label.inline-edit-tags {
+ padding: 0;
+ }
+
+ .inline-edit-row fieldset label span.input-text-wrap,
+ .inline-edit-row fieldset .timestamp-wrap {
+ margin-left: 0;
+ }
+
+ .inline-edit-row fieldset input[name=jj],
+ .inline-edit-row fieldset input[name=hh],
+ .inline-edit-row fieldset input[name=mn] {
+ width: 3em;
+ }
+
+ .inline-edit-row fieldset input[name=aa] {
+ width: 4.5em;
+ }
+
+ .inline-edit-row .inline-edit-or {
+ margin: 0 6px 0 0;
+ }
+
+ #edithead .inside,
+ #commentsdiv #edithead .inside {
+ float: none;
+ text-align: left;
+ padding: 3px 5px;
+ }
+
+ #commentsdiv #edithead .inside input,
+ #edithead .inside input {
+ width: 100%;
+ }
+
+ #edithead label {
+ display: block;
+ }
+
+ #bulk-titles div {
+ margin: 0.8em 0.3em;
+ }
+
+ #bulk-titles div a {
+ height: 22px;
+ }
+
+ /* Updates */
+ #wpbody-content .updates-table .plugin-title {
+ width: auto;
+ white-space: normal;
+ }
+
+ /* Links */
+ .link-manager-php #posts-filter {
+ margin-top: 25px;
+ }
+
+ .link-manager-php .tablenav.bottom {
+ overflow: hidden;
+ }
+
+ /* List tables that don't toggle rows */
+ .comments-box .toggle-row,
+ .wp-list-table.plugins .toggle-row {
+ display: none;
+ }
+
+ /* Plugin/Theme Management */
+ #wpbody-content .wp-list-table.plugins td {
+ display: block;
+ width: auto;
+ padding: 10px 9px; /* reset from other list tables that have a label at this width */
+ }
+
+ /* Plugin description hidden via Screen Options */
+ #wpbody-content .wp-list-table.plugins .desc.hidden {
+ display: none;
+ }
+
+ #wpbody-content .wp-list-table.plugins .column-description {
+ padding-top: 2px;
+ }
+
+ #wpbody-content .wp-list-table.plugins .plugin-title,
+ #wpbody-content .wp-list-table.plugins .theme-title {
+ padding-right: 12px;
+ white-space: normal;
+ }
+
+ .wp-list-table.plugins .plugin-title,
+ .wp-list-table.plugins .theme-title {
+ padding-top: 13px;
+ padding-bottom: 4px;
+ }
+
+ .plugins #the-list tr > td:not(:last-child),
+ .plugins #the-list .update th,
+ .plugins #the-list .update td,
+ .wp-list-table.plugins #the-list .theme-title {
+ box-shadow: none;
+ border-top: none;
+ }
+
+ .plugins #the-list tr td {
+ border-top: none;
+ }
+
+ .plugins tbody {
+ padding: 1px 0 0;
+ }
+
+ .plugins tr.active + tr.inactive th.check-column,
+ .plugins tr.active + tr.inactive td.column-description,
+ .plugins .plugin-update-tr:before {
+ box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.1);
+ }
+
+ .plugins tr.active + tr.inactive th.check-column,
+ .plugins tr.active + tr.inactive td {
+ border-top: none;
+ }
+
+ /* mimic the checkbox th */
+ .plugins .plugin-update-tr:before {
+ content: "";
+ display: table-cell;
+ }
+
+ .plugins .active.update + .plugin-update-tr:before {
+ border-left: 4px solid #d54e21;
+ background-color: #fef7f1;
+ }
+
+ .plugins #the-list .plugin-update-tr .plugin-update {
+ border-left: none;
+ }
+
+ .plugin-update-tr .update-message {
+ margin-left: 0;
+ }
+
+ .plugins .active.update + .plugin-update-tr:before {
+ background-color: #f7fcfe;
+ border-left: 4px solid #00a0d2;
+ }
+
+ .plugins .plugin-update-tr .update-message {
+ margin-left: 0;
+ }
+
+ .wp-list-table.plugins .plugin-title strong,
+ .wp-list-table.plugins .theme-title strong {
+ font-size: 1.4em;
+ line-height: 1.5;
+ }
+
+ /* Add New plugins page */
+ table.plugin-install .column-name,
+ table.plugin-install .column-version,
+ table.plugin-install .column-rating,
+ table.plugin-install .column-description {
+ display: block;
+ width: auto;
+ }
+
+ table.plugin-install th.column-name,
+ table.plugin-install th.column-version,
+ table.plugin-install th.column-rating,
+ table.plugin-install th.column-description {
+ display: none;
+ }
+
+ table.plugin-install td.column-name strong {
+ font-size: 1.4em;
+ line-height: 1.6em;
+ }
+
+ table.plugin-install #the-list td {
+ box-shadow: none;
+ }
+
+ table.plugin-install #the-list tr {
+ display: block;
+ box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.1);
+ }
+
+ .plugin-card {
+ margin-left: 0;
+ margin-right: 0;
+ width: 100%;
+ }
+}
+
+@media screen and (max-width: 480px) {
+ .tablenav-pages .current-page {
+ margin: 0;
+ }
+
+ /* Drop row actions to two columns on a small screen */
+ .row-actions:not(.plugins-php) {
+ -ms-grid-columns: auto auto;
+ grid-template-columns: auto auto;
+ }
+
+ .tablenav-pages .tablenav-paging-text {
+ float: left;
+ width: 100%;
+ padding-top: 0.5em;
+ }
+}
diff --git a/www/crm/wp-admin/css/list-tables.min.css b/www/crm/wp-admin/css/list-tables.min.css
new file mode 100644
index 00000000..fef0dba2
--- /dev/null
+++ b/www/crm/wp-admin/css/list-tables.min.css
@@ -0,0 +1,2 @@
+/*! This file is auto-generated */
+.response-links{display:block;margin-bottom:1em}.response-links a{display:block}.response-links a.comments-edit-item-link{font-weight:600}.response-links a.comments-view-item-link{font-size:12px}.post-com-count-wrapper strong{font-weight:400}.comments-view-item-link{display:inline-block;clear:both}.column-comments .post-com-count-wrapper,.column-response .post-com-count-wrapper{white-space:nowrap;word-wrap:normal}.column-comments .post-com-count,.column-response .post-com-count{display:inline-block;vertical-align:top}.column-comments .post-com-count-approved,.column-comments .post-com-count-no-comments,.column-response .post-com-count-approved,.column-response .post-com-count-no-comments{margin-top:5px}.column-comments .comment-count-approved,.column-comments .comment-count-no-comments,.column-response .comment-count-approved,.column-response .comment-count-no-comments{box-sizing:border-box;display:block;padding:0 8px;min-width:24px;height:2em;border-radius:5px;background-color:#72777c;color:#fff;font-size:11px;line-height:21px;text-align:center}.ie8 .column-comments .comment-count-approved,.ie8 .column-comments .comment-count-no-comments,.ie8 .column-response .comment-count-approved,.ie8 .column-response .comment-count-no-comments{min-width:0}.column-comments .post-com-count-approved:after,.column-comments .post-com-count-no-comments:after,.column-response .post-com-count-approved:after,.column-response .post-com-count-no-comments:after{content:"";display:block;margin-left:8px;width:0;height:0;border-top:5px solid #72777c;border-right:5px solid transparent}.column-comments .post-com-count-approved:focus .comment-count-approved,.column-comments .post-com-count-approved:hover .comment-count-approved,.column-response .post-com-count-approved:focus .comment-count-approved,.column-response .post-com-count-approved:hover .comment-count-approved{background:#0073aa}.column-comments .post-com-count-approved:focus:after,.column-comments .post-com-count-approved:hover:after,.column-response .post-com-count-approved:focus:after,.column-response .post-com-count-approved:hover:after{border-top-color:#0073aa}.column-comments .post-com-count-pending,.column-response .post-com-count-pending{position:relative;left:-3px;padding:0 5px;min-width:7px;height:17px;border:2px solid #fff;border-radius:11px;background:#ca4a1f;color:#fff;font-size:9px;line-height:17px;text-align:center}.column-comments .post-com-count-no-pending,.column-response .post-com-count-no-pending{display:none}.commentlist li{padding:1em 1em .2em;margin:0;border-bottom:1px solid #ccc}.commentlist li li{border-bottom:0;padding:0}.commentlist p{padding:0;margin:0 0 .8em}#submitted-on,.submitted-on{color:#555d66}#replyrow td{padding:2px}#replysubmit{margin:0;padding:5px 7px 10px;overflow:hidden}#replysubmit .reply-submit-buttons{margin-bottom:0}#replysubmit .button{margin-right:5px}#replysubmit .spinner{float:none;margin:-4px 0 0}#replyrow.inline-edit-row fieldset.comment-reply{font-size:inherit;line-height:inherit}#replyrow legend{margin:0;padding:.2em 5px 0;font-size:13px;line-height:1.4;font-weight:600}#replyrow.inline-edit-row label{display:inline;vertical-align:baseline;line-height:inherit}#commentsdiv #edithead .inside,#edithead .inside{float:left;padding:3px 0 2px 5px;margin:0;text-align:center}#edithead .inside input{width:180px}#edithead label{padding:2px 0}#replycontainer{padding:5px}#replycontent{height:120px;box-shadow:none}#replyerror{border-color:#ddd;background-color:#f9f9f9}.commentlist .avatar{vertical-align:text-top}#the-comment-list div.undo,#the-comment-list tr.undo{background-color:#f5f5f5}#the-comment-list .unapproved td,#the-comment-list .unapproved th{background-color:#fef7f1}#the-comment-list .unapproved th.check-column{border-left:4px solid #d54e21}#the-comment-list .unapproved th.check-column input{margin-left:4px}#the-comment-list .approve a{color:#006505}#the-comment-list .unapprove a{color:#d98500}#the-comment-list td,#the-comment-list th{box-shadow:inset 0 -1px 0 rgba(0,0,0,.1)}#the-comment-list tr:last-child td,#the-comment-list tr:last-child th{box-shadow:none}#the-comment-list tr.unapproved+tr.approved td,#the-comment-list tr.unapproved+tr.approved th{border-top:1px solid rgba(0,0,0,.03)}.vim-current,.vim-current td,.vim-current th{background-color:#e4f2fd!important}th .comment-grey-bubble{height:16px;width:16px}th .comment-grey-bubble:before{content:"\f101";font:normal 20px/.5 dashicons;speak:none;display:inline-block;padding:0;top:4px;left:-4px;position:relative;vertical-align:top;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-decoration:none!important;color:#444}table.fixed{table-layout:fixed}.fixed .column-rating,.fixed .column-visible{width:8%}.fixed .column-author,.fixed .column-date,.fixed .column-format,.fixed .column-links,.fixed .column-parent,.fixed .column-posts{width:10%}.fixed .column-posts{width:74px}.fixed .column-comment .comment-author{display:none}.fixed .column-categories,.fixed .column-rel,.fixed .column-response,.fixed .column-role,.fixed .column-tags{width:15%}.fixed .column-slug{width:25%}.fixed .column-locations{width:35%}.fixed .column-comments{width:5.5em;padding:8px 0;text-align:left}.fixed .column-comments .vers{padding-left:3px}td.column-title strong,td.plugin-title strong{display:block;margin-bottom:.2em;font-size:14px}td.column-title p,td.plugin-title p{margin:6px 0}table.media .column-title .media-icon{float:left;min-height:60px;margin:0 9px 0 0}table.media .column-title .media-icon img{max-width:60px;height:auto;vertical-align:top}table.media .column-title .has-media-icon~.row-actions{margin-left:70px}table.media .column-title .filename{margin-bottom:.2em}.wp-list-table a{transition:none}#the-list tr:last-child td,#the-list tr:last-child th{border-bottom:none!important;box-shadow:none}#comments-form .fixed .column-author{width:20%}#comments-form .fixed .column-date{width:14%}#commentsdiv.postbox .inside{margin:0;padding:0}#commentsdiv .inside .row-actions{line-height:18px}#commentsdiv .inside .column-author{width:25%}#commentsdiv .column-comment p{margin:.6em 0;padding:0}#commentsdiv #replyrow td{padding:0}#commentsdiv p{padding:8px 10px;margin:0}#commentsdiv .comments-box{border:0 none}#commentsdiv .comments-box thead td,#commentsdiv .comments-box thead th{background:0 0;padding:0 7px 4px;font-style:italic}#commentsdiv .comments-box tr:last-child td{border-bottom:0 none}#commentsdiv #edithead .inside input{width:160px}.sorting-indicator{display:block;visibility:hidden;width:10px;height:4px;margin-top:8px;margin-left:7px}.sorting-indicator:before{content:"\f142";font:normal 20px/1 dashicons;speak:none;display:inline-block;padding:0;top:-4px;left:-8px;color:#444;line-height:10px;position:relative;vertical-align:top;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-decoration:none!important;color:#444}.column-comments .sorting-indicator:before{top:0;left:-10px}th.desc a:focus span.sorting-indicator:before,th.desc:hover span.sorting-indicator:before,th.sorted.asc .sorting-indicator:before{content:"\f142"}th.asc a:focus span.sorting-indicator:before,th.asc:hover span.sorting-indicator:before,th.sorted.desc .sorting-indicator:before{content:"\f140"}.wp-list-table .toggle-row{position:absolute;right:8px;top:10px;display:none;padding:0;width:40px;height:40px;border:none;outline:0;background:0 0}.wp-list-table .toggle-row:hover{cursor:pointer}.wp-list-table .toggle-row:focus:before{box-shadow:0 0 0 1px #5b9dd9,0 0 2px 1px rgba(30,140,190,.8)}.ie8 .wp-list-table .toggle-row:focus:before{outline:#5b9dd9 solid 1px}.wp-list-table .toggle-row:active{box-shadow:none}.wp-list-table .toggle-row:before{position:absolute;top:-5px;left:10px;border-radius:50%;display:block;padding:1px 2px 1px 0;color:#444;content:"\f140";font:normal 20px/1 dashicons;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;speak:none}.wp-list-table .is-expanded .toggle-row:before{content:"\f142"}tr.wp-locked .locked-indicator{margin-left:6px;height:20px;width:16px}tr.wp-locked .locked-indicator-icon:before{color:#82878c;content:"\f160";display:inline-block;font:normal 20px/1 dashicons;speak:none;vertical-align:middle;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}tr.wp-locked .check-column input[type=checkbox],tr.wp-locked .check-column label,tr.wp-locked .row-actions .inline,tr.wp-locked .row-actions .trash{display:none}tr .locked-info{height:0;opacity:0}tr.wp-locked .locked-info{margin-top:4px;height:auto;opacity:1}.locked-text{vertical-align:top}tr.locked-info,tr.wp-locked .locked-info{transition:height 1s,opacity .5s}.fixed .column-comments .sorting-indicator{margin-top:3px}#menu-locations-wrap .widefat{width:60%}.widefat th.sortable,.widefat th.sorted{padding:0}th.sortable a,th.sorted a{display:block;overflow:hidden;padding:8px}.fixed .column-comments.sortable a,.fixed .column-comments.sorted a{padding:8px 0}th.sortable a span,th.sorted a span{float:left;cursor:pointer}th.asc a:focus span.sorting-indicator,th.asc:hover span.sorting-indicator,th.desc a:focus span.sorting-indicator,th.desc:hover span.sorting-indicator,th.sorted .sorting-indicator{visibility:visible}.tablenav-pages .current-page{margin:0 2px 0 0;padding-top:5px;padding-bottom:5px;font-size:13px;text-align:center}.tablenav .total-pages{margin-right:2px}.tablenav #table-paging{margin-left:2px}.tablenav{clear:both;height:30px;margin:6px 0 4px;vertical-align:middle}.tablenav.themes{max-width:98%}.tablenav .tablenav-pages{float:right;margin:3px 0 9px}.tablenav .no-pages,.tablenav .one-page .pagination-links{display:none}.tablenav .tablenav-pages .button,.tablenav .tablenav-pages .tablenav-pages-navspan{display:inline-block;vertical-align:baseline;min-width:28px;min-height:28px;margin:0;padding:0 4px;font-size:16px;line-height:1.5;text-align:center}.tablenav .displaying-num{margin-right:7px}.tablenav .one-page .displaying-num{display:inline-block;margin:5px 0}.tablenav .actions{overflow:hidden;padding:2px 8px 0 0}.wp-filter .actions{display:inline-block;vertical-align:middle}.tablenav .delete{margin-right:20px}.tablenav .view-switch{float:right;margin:0 5px;padding-top:3px}.wp-filter .view-switch{display:inline-block;vertical-align:middle;padding:12px 0;margin:0 8px 0 2px}.media-toolbar.wp-filter .view-switch{margin:0 12px 0 2px}.view-switch a{float:left;width:28px;height:28px;text-align:center;line-height:24px;text-decoration:none}.view-switch a:before{color:#b4b9be;display:inline-block;font:normal 20px/1 dashicons;speak:none;vertical-align:middle;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.view-switch a:focus:before,.view-switch a:hover:before{color:#727272}.view-switch a.current:before{color:#0073aa}.view-switch .view-list:before{content:"\f163"}.view-switch .view-excerpt:before{content:"\f164"}.view-switch .view-grid:before{content:"\f509"}.filter{float:left;margin:-5px 0 0 10px}.filter .subsubsub{margin-left:-10px;margin-top:13px}.screen-per-page{width:4em}#posts-filter .wp-filter{margin-bottom:0}#posts-filter fieldset{float:left;margin:0 1.5ex 1em 0;padding:0}#posts-filter fieldset legend{padding:0 0 .2em 1px}p.pagenav{margin:0;display:inline}.pagenav span{font-weight:600;margin:0 6px}.row-title{font-size:14px!important;font-weight:600}.column-comment .comment-author{margin-bottom:.6em}.column-author img,.column-comment .comment-author img,.column-username img{float:left;margin-right:10px;margin-top:1px}.row-actions{color:#ddd;font-size:13px;padding:2px 0 0;position:relative;left:-9999em}.rtl .row-actions a{display:inline-block}.row-actions .network_active,.row-actions .network_only{color:#000}.comment-item:hover .row-actions,.mobile .row-actions,.no-js .row-actions,.row-actions.visible,tr:hover .row-actions{position:static}.row-actions-visible{padding:2px 0 0}#wpbody-content .inline-edit-row fieldset{font-size:12px;float:left;margin:0;padding:0;width:100%}#wpbody-content .inline-edit-row fieldset .inline-edit-col,tr.inline-edit-row td{padding:0 .5em}#wpbody-content .quick-edit-row-post .inline-edit-col-left{width:40%}#wpbody-content .quick-edit-row-post .inline-edit-col-right{width:39%}#wpbody-content .inline-edit-row-post .inline-edit-col-center{width:20%}#wpbody-content .quick-edit-row-page .inline-edit-col-left{width:50%}#wpbody-content .bulk-edit-row-post .inline-edit-col-right,#wpbody-content .quick-edit-row-page .inline-edit-col-right{width:49%}#wpbody-content .bulk-edit-row .inline-edit-col-left{width:30%}#wpbody-content .bulk-edit-row-page .inline-edit-col-right{width:69%}#wpbody-content .bulk-edit-row .inline-edit-col-bottom{float:right;width:69%}#wpbody-content .inline-edit-row-page .inline-edit-col-right{margin-top:27px}.inline-edit-row fieldset .inline-edit-group{clear:both;line-height:2.5}.inline-edit-row .submit{clear:both;padding:.5em;margin:.5em 0 0}.inline-edit-row .notice-error{margin-top:1em}.inline-edit-row .notice-error .error{margin:.5em 0;padding:2px}#the-list .inline-edit-row .inline-edit-legend{margin:0;padding:.2em .5em 0;line-height:2.5;font-weight:600}#the-list #bulk-edit.inline-edit-row .inline-edit-legend{padding:.2em .5em}.inline-edit-row fieldset span.checkbox-title,.inline-edit-row fieldset span.title{margin:0;padding:0}.inline-edit-row fieldset label,.inline-edit-row fieldset span.inline-edit-categories-label{display:block;margin:.2em 0;line-height:2.5}.inline-edit-row fieldset.inline-edit-date label{display:inline-block;margin:0;line-height:1.5;vertical-align:baseline}.inline-edit-row fieldset label.inline-edit-tags{margin-top:0}.inline-edit-row fieldset label.inline-edit-tags span.title{margin:.2em 0;width:auto}.inline-edit-row fieldset label span.title,.inline-edit-row fieldset.inline-edit-date legend{display:block;float:left;width:6em;line-height:2.5}#posts-filter fieldset.inline-edit-date legend{padding:0}.inline-edit-row fieldset.inline-edit-date select{margin:1px;line-height:28px}.inline-edit-row fieldset .timestamp-wrap,.inline-edit-row fieldset label span.input-text-wrap{display:block;margin-left:6em}.quick-edit-row-post fieldset.inline-edit-col-right label span.title{width:auto;padding-right:.5em}.inline-edit-row .inline-edit-or{margin:.2em 6px .2em 0;line-height:2.5}.inline-edit-row .input-text-wrap input[type=text]{width:100%}.inline-edit-row fieldset label input[type=checkbox]{vertical-align:middle}.inline-edit-row fieldset label textarea{width:100%;height:4em;vertical-align:top}#wpbody-content .bulk-edit-row fieldset .inline-edit-group label{max-width:50%}#wpbody-content .quick-edit-row fieldset .inline-edit-group label.alignleft:first-child{margin-right:.5em}.inline-edit-col-right .input-text-wrap input.inline-edit-menu-order-input{width:6em}.inline-edit-row .inline-edit-legend{text-transform:uppercase}.inline-edit-row fieldset span.checkbox-title,.inline-edit-row fieldset span.title{font-style:italic}.inline-edit-row fieldset .inline-edit-date{float:left}.inline-edit-row fieldset input[name=hh],.inline-edit-row fieldset input[name=jj],.inline-edit-row fieldset input[name=mn]{font-size:12px;width:2.3em}.inline-edit-row fieldset input[name=aa]{font-size:12px;width:3.5em}.inline-edit-row fieldset label input.inline-edit-password-input{width:8em}ul.cat-checklist{height:12em;border:solid 1px #ddd;overflow-y:scroll;padding:0 5px;margin:0;background-color:#fff}#bulk-titles{display:block;height:12em;border:1px solid #ddd;overflow-y:scroll;padding:0 5px;margin:0 0 5px}.inline-edit-row fieldset ul.cat-checklist input,.inline-edit-row fieldset ul.cat-checklist li{margin:0;position:relative}.inline-edit-row #bulk-titles div,.inline-edit-row fieldset ul.cat-checklist label{font-style:normal;font-size:11px}.inline-edit-row fieldset label input.inline-edit-menu-order-input{width:3em}.inline-edit-row fieldset label input.inline-edit-slug-input{width:75%}.inline-edit-row #post_parent,.inline-edit-row select[name=page_template]{max-width:80%}.ie8 .inline-edit-row #post_parent,.ie8 .inline-edit-row select[name=page_template]{width:250px}.quick-edit-row-post fieldset label.inline-edit-status{float:left}#bulk-titles{line-height:140%}#bulk-titles div{margin:.2em .3em}#bulk-titles div a{cursor:pointer;display:block;float:left;height:18px;margin:0 3px 0 -2px;overflow:hidden;position:relative;width:20px}#bulk-titles div a:before{position:relative;top:-3px}.plugins tbody,.plugins tbody th.check-column{padding:8px 0 0 2px}.plugins tbody th.check-column input[type=checkbox]{margin-top:4px}.updates-table .plugin-title p{margin-top:0}.plugins .inactive th.check-column,.plugins tfoot td.check-column,.plugins thead td.check-column{padding-left:6px}.plugins,.plugins td,.plugins th{color:#000}.plugins tr{background:#fff}.plugins p{margin:0 4px;padding:0}.plugins .desc p{margin:0 0 8px}.plugins td.desc{line-height:1.5em}.plugins .desc ol,.plugins .desc ul{margin:0 0 0 2em}.plugins .desc ul{list-style-type:disc}.plugins .row-actions{font-size:13px;padding:0}.plugins .active td,.plugins .active th,.plugins .inactive td,.plugins .inactive th{padding:10px 9px}.plugins .active td,.plugins .active th{background-color:#f7fcfe}.plugins .update td,.plugins .update th{border-bottom:0}.plugin-install #the-list td,.plugins .active td,.plugins .active th,.plugins .inactive td,.plugins .inactive th,.upgrade .plugins td,.upgrade .plugins th{box-shadow:inset 0 -1px 0 rgba(0,0,0,.1)}.plugins tr.active+tr.inactive td,.plugins tr.active+tr.inactive th,.plugins tr.active.plugin-update-tr+tr.inactive td,.plugins tr.active.plugin-update-tr+tr.inactive th{border-top:1px solid rgba(0,0,0,.03);box-shadow:inset 0 1px 0 rgba(0,0,0,.02),inset 0 -1px 0 #e1e1e1}.plugins .update td,.plugins .update th,.plugins .updated td,.plugins .updated th,.plugins tr.active+tr.inactive.update td,.plugins tr.active+tr.inactive.update th,.plugins tr.active+tr.inactive.updated td,.plugins tr.active+tr.inactive.updated th,.upgrade .plugins tr:last-of-type td,.upgrade .plugins tr:last-of-type th{box-shadow:none}.plugin-update-tr.active td,.plugins .active th.check-column{border-left:4px solid #00a0d2}.wp-list-table.plugins .plugin-title,.wp-list-table.plugins .theme-title{padding-right:12px;white-space:nowrap}.plugins .plugin-title .dashicons,.plugins .plugin-title img{float:left;padding:0 10px 0 0;width:64px;height:64px}.plugins .plugin-title .dashicons:before{padding:2px;background-color:#eee;box-shadow:inset 0 0 10px rgba(160,165,170,.15);font-size:60px;color:#b4b9be}#update-themes-table .plugin-title .dashicons,#update-themes-table .plugin-title img{width:85px}.plugins .inactive .plugin-title strong{font-weight:400}.plugins .row-actions,.plugins .second{padding:0 0 5px}.plugins .update .row-actions,.plugins .update .second,.plugins .updated .row-actions,.plugins .updated .second{padding-bottom:0}.plugins-php .widefat tfoot td,.plugins-php .widefat tfoot th{border-top-style:solid;border-top-width:1px}.plugins .plugin-update-tr .plugin-update{box-shadow:inset 0 -1px 0 rgba(0,0,0,.1);overflow:hidden;padding:0}.plugins .plugin-update-tr .notice,.plugins .plugin-update-tr div[class=update-message]{margin:5px 20px 15px 40px}.plugins .notice p{margin:.5em 0}.plugins .plugin-description a,.plugins .plugin-update a,.updates-table .plugin-title a{text-decoration:underline}.plugins tr.paused th.check-column{border-left:4px solid #d54e21}.plugins tr.paused td,.plugins tr.paused th{background-color:#fef7f1}.plugins .paused .dashicons-warning,.plugins tr.paused .plugin-title{color:#dc3232}.plugins .paused .error-display code,.plugins .paused .error-display p{font-size:90%;font-style:italic;color:rgb(0,0,0,.7)}.plugins .resume-link{color:#dc3232}.plugin-card .update-now:before{color:#f56e28;content:"\f463";display:inline-block;font:normal 20px/1 dashicons;margin:3px 5px 0 -2px;speak:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;vertical-align:top}.plugin-card .updating-message:before{content:"\f463";animation:rotation 2s infinite linear}@keyframes rotation{0%{transform:rotate(0)}100%{transform:rotate(359deg)}}.plugin-card .updated-message:before{color:#79ba49;content:"\f147"}.plugin-install-php h2{clear:both}.plugin-install-php h3{margin:2.5em 0 8px}.plugin-install-php .wp-filter{margin-bottom:0}.plugin-group{overflow:hidden;margin-top:1.5em}.plugin-group h3{margin-top:0}.plugin-card{float:left;margin:0 8px 16px;width:48.5%;width:calc(50% - 8px);background-color:#fff;border:1px solid #ddd;box-sizing:border-box}.plugin-card:nth-child(odd){clear:both;margin-left:0}.plugin-card:nth-child(even){margin-right:0}@media screen and (min-width:1600px) and (max-width:2299px){.plugin-card{width:30%;width:calc(33.1% - 8px)}.plugin-card:nth-child(odd){clear:none;margin-left:8px}.plugin-card:nth-child(even){margin-right:8px}.plugin-card:nth-child(3n+1){clear:both;margin-left:0}.plugin-card:nth-child(3n){margin-right:0}}@media screen and (min-width:2300px){.plugin-card{width:25%;width:calc(25% - 12px)}.plugin-card:nth-child(odd){clear:none;margin-left:8px}.plugin-card:nth-child(even){margin-right:8px}.plugin-card:nth-child(4n+1){clear:both;margin-left:0}.plugin-card:nth-child(4n){margin-right:0}}.plugin-card-top{position:relative;padding:20px 20px 10px;min-height:135px}.plugin-action-buttons,div.action-links{margin:0}.plugin-card h3{margin:0 0 12px;font-size:18px;line-height:1.3}.plugin-card .desc,.plugin-card .name{margin-left:148px;margin-right:120px}.plugin-card .action-links{position:absolute;top:20px;right:20px;width:120px}.plugin-action-buttons{clear:right;float:right;margin-left:2em;margin-bottom:1em;text-align:right}.plugin-action-buttons li{margin-bottom:10px}.plugin-card-bottom{clear:both;padding:12px 20px;background-color:#fafafa;border-top:1px solid #ddd;overflow:hidden}.plugin-card-bottom .star-rating{display:inline}.plugin-card-update-failed .update-now{font-weight:600}.plugin-card-update-failed .notice-error{margin:0;padding-left:16px;box-shadow:0 -1px 0 #ddd}.plugin-card-update-failed .plugin-card-bottom{display:none}.plugin-card .column-rating{line-height:23px}.plugin-card .column-rating,.plugin-card .column-updated{margin-bottom:4px}.plugin-card .column-downloaded,.plugin-card .column-rating{float:left;clear:left;max-width:180px}.plugin-card .column-compatibility,.plugin-card .column-updated{text-align:right;float:right;clear:right;width:65%;width:calc(100% - 180px)}.plugin-card .column-compatibility span:before{font:normal 20px/.5 dashicons;speak:none;display:inline-block;padding:0;top:4px;left:-2px;position:relative;vertical-align:top;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-decoration:none!important;color:#444}.plugin-card .column-compatibility .compatibility-incompatible:before{content:"\f158";color:#c62d2d}.plugin-card .column-compatibility .compatibility-compatible:before{content:"\f147";color:#31843f}.plugin-card .notice{margin:20px 20px 0 20px}.plugin-icon{position:absolute;top:20px;left:20px;width:128px;height:128px;margin:0 20px 20px 0}.no-plugin-results{color:#666;font-size:18px;font-style:normal;margin:0;padding:100px 0 0;text-align:center}.wp-list-table .site-deleted,.wp-list-table tr.site-deleted{background:#ff8573}.wp-list-table .site-spammed,.wp-list-table tr.site-spammed{background:#faafaa}.wp-list-table .site-archived,.wp-list-table tr.site-archived{background:#ffebe8}.wp-list-table .site-mature,.wp-list-table tr.site-mature{background:#fecac2}.sites.fixed .column-lastupdated,.sites.fixed .column-registered{width:20%}.sites.fixed .column-users{width:80px}@media screen and (max-width:1100px) and (min-width:782px),(max-width:480px){.plugin-card .action-links{position:static;margin-left:148px;width:auto}.plugin-action-buttons{float:none;margin:1em 0 0;text-align:left}.plugin-action-buttons li{display:inline-block;vertical-align:middle}.plugin-action-buttons li .button{margin-right:20px}.plugin-card .desc,.plugin-card .name{margin-right:0}.plugin-card .desc p:first-of-type{margin-top:0}.fixed .column-date{width:14%}}@media screen and (max-width:782px){.tablenav{height:auto}.tablenav.top{margin:20px 0 5px 0}.tablenav.bottom{position:relative;margin-top:15px}.tablenav br{display:none}.tablenav br.clear{display:block}.tablenav .view-switch,.tablenav.top .actions{display:none}.view-switch a{width:36px;height:36px;line-height:33px}.tablenav.top .displaying-num{display:none}.tablenav.bottom .displaying-num{position:absolute;right:0;top:11px;margin:0;font-size:14px}.tablenav .tablenav-pages{width:100%;text-align:center;margin:0 0 25px}.tablenav.bottom .tablenav-pages{margin-top:25px}.tablenav.top .tablenav-pages.one-page{display:none}.tablenav.bottom .tablenav-pages.one-page{margin:15px 0 0 0;height:0}.tablenav-pages .pagination-links{font-size:16px}.tablenav .tablenav-pages .button,.tablenav .tablenav-pages .tablenav-pages-navspan{min-width:44px;padding:12px 8px;font-size:18px;line-height:1}.tablenav-pages .pagination-links .current-page{min-width:44px;padding:12px 6px;font-size:16px;line-height:18px}.form-wrap>p{display:none}.comment-count{font-size:14px}.wp-list-table th.column-primary~th,.wp-list-table tr:not(.inline-edit-row):not(.no-items) td.column-primary~td:not(.check-column){display:none}.wp-list-table thead th.column-primary{width:100%}.wp-list-table tr th.check-column{display:table-cell;width:35px}.wp-list-table .column-primary .toggle-row{display:block}.wp-list-table tr:not(.inline-edit-row):not(.no-items) td:not(.check-column){position:relative;clear:both;display:block;width:auto!important}.wp-list-table td.column-primary{padding-right:50px}.wp-list-table tr:not(.inline-edit-row):not(.no-items) td.column-primary~td:not(.check-column){padding:3px 8px 3px 35%}.wp-list-table tr:not(.inline-edit-row):not(.no-items) td:not(.column-primary)::before{position:absolute;left:10px;display:block;overflow:hidden;width:32%;content:attr(data-colname);white-space:nowrap;text-overflow:ellipsis}.wp-list-table .is-expanded td:not(.hidden){display:block!important;overflow:hidden}.column-posts,.widefat .num{text-align:left}#comments-form .fixed .column-author,#commentsdiv .fixed .column-author{display:none!important}.fixed .column-comment .comment-author{display:block}.fixed .column-author.hidden~.column-comment .comment-author{display:none}#the-comment-list .is-expanded td{box-shadow:none}#the-comment-list .is-expanded td:last-child{box-shadow:inset 0 -1px 0 rgba(0,0,0,.1)}.post-com-count .screen-reader-text{position:static;-webkit-clip-path:none;clip-path:none;width:auto;height:auto;margin:0}.column-comments .post-com-count-approved:after,.column-comments .post-com-count-no-comments:after,.column-response .post-com-count-approved:after,.column-response .post-com-count-no-comments:after{content:none}.column-comments .post-com-count [aria-hidden=true],.column-response .post-com-count [aria-hidden=true]{display:none}.column-comments .post-com-count-wrapper,.column-response .post-com-count-wrapper{white-space:normal}.column-comments .post-com-count-wrapper>a,.column-response .post-com-count-wrapper>a{display:block}.column-comments .post-com-count-approved,.column-comments .post-com-count-no-comments,.column-response .post-com-count-approved,.column-response .post-com-count-no-comments{margin-top:0;margin-right:.5em}.column-comments .post-com-count-pending,.column-response .post-com-count-pending{position:static;height:auto;min-width:0;padding:0;border:none;border-radius:0;background:0 0;color:#bb2a2a;font-size:inherit;line-height:inherit;text-align:left}.column-comments .post-com-count-pending:hover,.column-response .post-com-count-pending:hover{color:#dc3232}.widefat tfoot td.check-column,.widefat thead td.check-column{padding-top:10px}.widefat *{word-wrap:normal}body:not(.plugins-php) .row-actions{display:-ms-grid;display:grid;-ms-grid-columns:auto auto auto;grid-template-columns:auto auto auto;color:transparent}.row-actions span{padding:4px 0}.row-actions span .button-link,.row-actions span a{display:inline-block;padding:4px 0}.row-actions span.approve:before,.row-actions span.unapprove:before{content:"| "}#wpbody-content .bulk-edit-row .inline-edit-col-bottom,#wpbody-content .bulk-edit-row .inline-edit-col-left,#wpbody-content .bulk-edit-row-page .inline-edit-col-right,#wpbody-content .bulk-edit-row-post .inline-edit-col-right,#wpbody-content .inline-edit-row-post .inline-edit-col-center,#wpbody-content .quick-edit-row-page .inline-edit-col-left,#wpbody-content .quick-edit-row-page .inline-edit-col-right,#wpbody-content .quick-edit-row-post .inline-edit-col-left,#wpbody-content .quick-edit-row-post .inline-edit-col-right{float:none;width:100%}#wpbody-content .bulk-edit-row fieldset .inline-edit-col label,#wpbody-content .bulk-edit-row fieldset .inline-edit-group label,#wpbody-content .quick-edit-row fieldset .inline-edit-col label,#wpbody-content .quick-edit-row fieldset .inline-edit-group label{max-width:none;float:none;margin-bottom:5px}#wpbody .bulk-edit-row fieldset select{display:block;width:100%;max-width:none;box-sizing:border-box}.inline-edit-row #bulk-titles div,.inline-edit-row fieldset ul.cat-checklist label{font-size:16px}.inline-edit-row fieldset label span.title,.inline-edit-row fieldset.inline-edit-date legend{float:none}.inline-edit-row fieldset label.inline-edit-tags{padding:0 .5em}.inline-edit-row fieldset .inline-edit-col label.inline-edit-tags{padding:0}.inline-edit-row fieldset .timestamp-wrap,.inline-edit-row fieldset label span.input-text-wrap{margin-left:0}.inline-edit-row fieldset input[name=hh],.inline-edit-row fieldset input[name=jj],.inline-edit-row fieldset input[name=mn]{width:3em}.inline-edit-row fieldset input[name=aa]{width:4.5em}.inline-edit-row .inline-edit-or{margin:0 6px 0 0}#commentsdiv #edithead .inside,#edithead .inside{float:none;text-align:left;padding:3px 5px}#commentsdiv #edithead .inside input,#edithead .inside input{width:100%}#edithead label{display:block}#bulk-titles div{margin:.8em .3em}#bulk-titles div a{height:22px}#wpbody-content .updates-table .plugin-title{width:auto;white-space:normal}.link-manager-php #posts-filter{margin-top:25px}.link-manager-php .tablenav.bottom{overflow:hidden}.comments-box .toggle-row,.wp-list-table.plugins .toggle-row{display:none}#wpbody-content .wp-list-table.plugins td{display:block;width:auto;padding:10px 9px}#wpbody-content .wp-list-table.plugins .desc.hidden{display:none}#wpbody-content .wp-list-table.plugins .column-description{padding-top:2px}#wpbody-content .wp-list-table.plugins .plugin-title,#wpbody-content .wp-list-table.plugins .theme-title{padding-right:12px;white-space:normal}.wp-list-table.plugins .plugin-title,.wp-list-table.plugins .theme-title{padding-top:13px;padding-bottom:4px}.plugins #the-list .update td,.plugins #the-list .update th,.plugins #the-list tr>td:not(:last-child),.wp-list-table.plugins #the-list .theme-title{box-shadow:none;border-top:none}.plugins #the-list tr td{border-top:none}.plugins tbody{padding:1px 0 0}.plugins .plugin-update-tr:before,.plugins tr.active+tr.inactive td.column-description,.plugins tr.active+tr.inactive th.check-column{box-shadow:inset 0 -1px 0 rgba(0,0,0,.1)}.plugins tr.active+tr.inactive td,.plugins tr.active+tr.inactive th.check-column{border-top:none}.plugins .plugin-update-tr:before{content:"";display:table-cell}.plugins .active.update+.plugin-update-tr:before{border-left:4px solid #d54e21;background-color:#fef7f1}.plugins #the-list .plugin-update-tr .plugin-update{border-left:none}.plugin-update-tr .update-message{margin-left:0}.plugins .active.update+.plugin-update-tr:before{background-color:#f7fcfe;border-left:4px solid #00a0d2}.plugins .plugin-update-tr .update-message{margin-left:0}.wp-list-table.plugins .plugin-title strong,.wp-list-table.plugins .theme-title strong{font-size:1.4em;line-height:1.5}table.plugin-install .column-description,table.plugin-install .column-name,table.plugin-install .column-rating,table.plugin-install .column-version{display:block;width:auto}table.plugin-install th.column-description,table.plugin-install th.column-name,table.plugin-install th.column-rating,table.plugin-install th.column-version{display:none}table.plugin-install td.column-name strong{font-size:1.4em;line-height:1.6em}table.plugin-install #the-list td{box-shadow:none}table.plugin-install #the-list tr{display:block;box-shadow:inset 0 -1px 0 rgba(0,0,0,.1)}.plugin-card{margin-left:0;margin-right:0;width:100%}}@media screen and (max-width:480px){.tablenav-pages .current-page{margin:0}.row-actions:not(.plugins-php){-ms-grid-columns:auto auto;grid-template-columns:auto auto}.tablenav-pages .tablenav-paging-text{float:left;width:100%;padding-top:.5em}} \ No newline at end of file
diff --git a/www/crm/wp-admin/css/login-rtl.css b/www/crm/wp-admin/css/login-rtl.css
new file mode 100644
index 00000000..398ae6ec
--- /dev/null
+++ b/www/crm/wp-admin/css/login-rtl.css
@@ -0,0 +1,311 @@
+html,
+body {
+ height: 100%;
+ margin: 0;
+ padding: 0;
+}
+
+body {
+ background: #f1f1f1;
+ min-width: 0;
+ color: #444;
+ font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
+ font-size: 13px;
+ line-height: 1.4em;
+}
+
+a {
+ color: #0073aa;
+ transition-property: border, background, color;
+ transition-duration: .05s;
+ transition-timing-function: ease-in-out;
+}
+
+a {
+ outline: 0;
+}
+
+a:hover,
+a:active {
+ color: #00a0d2;
+}
+
+a:focus {
+ color: #124964;
+ box-shadow:
+ 0 0 0 1px #5b9dd9,
+ 0 0 2px 1px rgba(30, 140, 190, 0.8);
+}
+
+.ie8 a:focus {
+ outline: #5b9dd9 solid 1px;
+}
+
+p {
+ line-height: 1.5;
+}
+
+.login .message,
+.login .success,
+.login #login_error {
+ border-right: 4px solid #00a0d2;
+ padding: 12px;
+ margin-right: 0;
+ margin-bottom: 20px;
+ background-color: #fff;
+ box-shadow: 0 1px 1px 0 rgba(0, 0, 0, 0.1);
+}
+
+.login .success {
+ border-right-color: #46b450;
+}
+
+.login #login_error {
+ border-right-color: #dc3232;
+}
+
+#loginform p.submit,
+.login-action-lostpassword p.submit {
+ border: none;
+ margin: -10px 0 20px; /* May want to revisit this */
+}
+
+.login * {
+ margin: 0;
+ padding: 0;
+}
+
+.login .password-input-wrapper {
+ position: relative;
+}
+
+.login .input.password-input {
+ margin: 0;
+}
+
+.login .input::-ms-clear {
+ display: none;
+}
+
+.login .pw-weak {
+ margin-bottom: 15px;
+}
+
+.login .button.button-secondary {
+ background: transparent;
+ border: 1px solid transparent;
+ box-shadow: none;
+ font-size: 14px;
+ line-height: 2;
+ height: auto;
+ margin: 0;
+ padding: 5px 9px;
+ position: absolute;
+ left: 0;
+ top: 0;
+}
+
+.login .button.button-secondary:hover {
+ background: transparent;
+}
+
+.login .button.button-secondary:focus {
+ background: transparent;
+ border-color: #5b9dd9;
+ box-shadow: 0 0 3px rgba(0, 115, 170, 0.8);
+}
+
+.login .button.button-secondary:active {
+ background: transparent;
+ box-shadow: none;
+ transform: none;
+}
+
+.login form {
+ margin-top: 20px;
+ margin-right: 0;
+ padding: 26px 24px 46px;
+ font-weight: 400;
+ overflow: hidden;
+ background: #fff;
+ box-shadow: 0 1px 3px rgba(0, 0, 0, 0.13);
+}
+
+.login form .forgetmenot {
+ font-weight: 400;
+ float: right;
+ margin-bottom: 0;
+}
+
+.login .button-primary {
+ float: left;
+}
+
+#login form p {
+ margin-bottom: 0;
+}
+
+#login form p.submit {
+ margin: 0;
+ padding: 0;
+}
+
+.login label {
+ font-size: 14px;
+}
+
+.login form .forgetmenot label {
+ font-size: 12px;
+ line-height: 19px;
+}
+
+.login h1 {
+ text-align: center;
+}
+
+.login h1 a {
+ background-image: url(../images/w-logo-blue.png?ver=20131202);
+ background-image: none, url(../images/wordpress-logo.svg?ver=20131107);
+ background-size: 84px;
+ background-position: center top;
+ background-repeat: no-repeat;
+ color: #444;
+ height: 84px;
+ font-size: 20px;
+ font-weight: 400;
+ line-height: 1.3em;
+ margin: 0 auto 25px;
+ padding: 0;
+ text-decoration: none;
+ width: 84px;
+ text-indent: -9999px;
+ outline: none;
+ overflow: hidden;
+ display: block;
+}
+
+#login {
+ width: 320px;
+ padding: 8% 0 0;
+ margin: auto;
+}
+
+.login #nav,
+.login #backtoblog {
+ font-size: 13px;
+ padding: 0 24px 0;
+}
+
+.login #nav {
+ margin: 24px 0 0 0;
+}
+
+#backtoblog {
+ margin: 16px 0;
+}
+
+.login #nav a,
+.login #backtoblog a {
+ text-decoration: none;
+ color: #555d66;
+}
+
+.login #nav a:hover,
+.login #backtoblog a:hover,
+.login h1 a:hover {
+ color: #00a0d2;
+}
+
+.login #nav a:focus,
+.login #backtoblog a:focus,
+.login h1 a:focus {
+ color: #124964;
+}
+
+.login .privacy-policy-page-link {
+ text-align: center;
+ width: 100%;
+ margin: 5em 0 2em;
+}
+
+.login form .input,
+.login input[type="text"] {
+ font-size: 24px;
+ width: 100%;
+ padding: 5px;
+ margin: 2px 0 16px 6px;
+}
+
+.login-action-rp form .input,
+.login-action-rp input[type="text"] {
+ padding: 5px 5px 5px 45px;
+}
+
+.login form .input,
+.login input[type="text"],
+.login form input[type="checkbox"] {
+ background: #fbfbfb;
+}
+
+.ie7 .login form .input,
+.ie8 .login form .input {
+ font-family: sans-serif;
+}
+
+.login-action-rp input[type="text"] {
+ box-shadow: none;
+ margin: 0;
+}
+
+.login #pass-strength-result {
+ font-weight: 600;
+ margin: -1px 0 16px 5px;
+ padding: 6px 5px;
+ text-align: center;
+ width: 100%;
+}
+
+body.interim-login {
+ height: auto;
+}
+
+.interim-login #login {
+ padding: 0;
+ margin: 5px auto 20px;
+}
+
+.interim-login.login h1 a {
+ width: auto;
+}
+
+.interim-login #login_error,
+.interim-login.login .message {
+ margin: 0 0 16px;
+}
+
+.interim-login.login form {
+ margin: 0;
+}
+
+@-ms-viewport {
+ width: device-width;
+}
+
+@media screen and (max-height: 550px) {
+ #login {
+ padding: 20px 0;
+ }
+}
+
+@media screen and (max-width: 782px) {
+ .interim-login input[type=checkbox] {
+ height: 16px;
+ width: 16px;
+ }
+
+ .interim-login input[type=checkbox]:checked:before {
+ width: 16px;
+ font: normal 21px/1 dashicons;
+ margin: -3px -4px 0 0;
+ }
+}
diff --git a/www/crm/wp-admin/css/login-rtl.min.css b/www/crm/wp-admin/css/login-rtl.min.css
new file mode 100644
index 00000000..4cb87aed
--- /dev/null
+++ b/www/crm/wp-admin/css/login-rtl.min.css
@@ -0,0 +1,2 @@
+/*! This file is auto-generated */
+body,html{height:100%;margin:0;padding:0}body{background:#f1f1f1;min-width:0;color:#444;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif;font-size:13px;line-height:1.4em}a{color:#0073aa;transition-property:border,background,color;transition-duration:.05s;transition-timing-function:ease-in-out}a{outline:0}a:active,a:hover{color:#00a0d2}a:focus{color:#124964;box-shadow:0 0 0 1px #5b9dd9,0 0 2px 1px rgba(30,140,190,.8)}.ie8 a:focus{outline:#5b9dd9 solid 1px}p{line-height:1.5}.login #login_error,.login .message,.login .success{border-right:4px solid #00a0d2;padding:12px;margin-right:0;margin-bottom:20px;background-color:#fff;box-shadow:0 1px 1px 0 rgba(0,0,0,.1)}.login .success{border-right-color:#46b450}.login #login_error{border-right-color:#dc3232}#loginform p.submit,.login-action-lostpassword p.submit{border:none;margin:-10px 0 20px}.login *{margin:0;padding:0}.login .password-input-wrapper{position:relative}.login .input.password-input{margin:0}.login .input::-ms-clear{display:none}.login .pw-weak{margin-bottom:15px}.login .button.button-secondary{background:0 0;border:1px solid transparent;box-shadow:none;font-size:14px;line-height:2;height:auto;margin:0;padding:5px 9px;position:absolute;left:0;top:0}.login .button.button-secondary:hover{background:0 0}.login .button.button-secondary:focus{background:0 0;border-color:#5b9dd9;box-shadow:0 0 3px rgba(0,115,170,.8)}.login .button.button-secondary:active{background:0 0;box-shadow:none;transform:none}.login form{margin-top:20px;margin-right:0;padding:26px 24px 46px;font-weight:400;overflow:hidden;background:#fff;box-shadow:0 1px 3px rgba(0,0,0,.13)}.login form .forgetmenot{font-weight:400;float:right;margin-bottom:0}.login .button-primary{float:left}#login form p{margin-bottom:0}#login form p.submit{margin:0;padding:0}.login label{font-size:14px}.login form .forgetmenot label{font-size:12px;line-height:19px}.login h1{text-align:center}.login h1 a{background-image:url(../images/w-logo-blue.png?ver=20131202);background-image:none,url(../images/wordpress-logo.svg?ver=20131107);background-size:84px;background-position:center top;background-repeat:no-repeat;color:#444;height:84px;font-size:20px;font-weight:400;line-height:1.3em;margin:0 auto 25px;padding:0;text-decoration:none;width:84px;text-indent:-9999px;outline:0;overflow:hidden;display:block}#login{width:320px;padding:8% 0 0;margin:auto}.login #backtoblog,.login #nav{font-size:13px;padding:0 24px 0}.login #nav{margin:24px 0 0 0}#backtoblog{margin:16px 0}.login #backtoblog a,.login #nav a{text-decoration:none;color:#555d66}.login #backtoblog a:hover,.login #nav a:hover,.login h1 a:hover{color:#00a0d2}.login #backtoblog a:focus,.login #nav a:focus,.login h1 a:focus{color:#124964}.login .privacy-policy-page-link{text-align:center;width:100%;margin:5em 0 2em}.login form .input,.login input[type=text]{font-size:24px;width:100%;padding:5px;margin:2px 0 16px 6px}.login-action-rp form .input,.login-action-rp input[type=text]{padding:5px 5px 5px 45px}.login form .input,.login form input[type=checkbox],.login input[type=text]{background:#fbfbfb}.ie7 .login form .input,.ie8 .login form .input{font-family:sans-serif}.login-action-rp input[type=text]{box-shadow:none;margin:0}.login #pass-strength-result{font-weight:600;margin:-1px 0 16px 5px;padding:6px 5px;text-align:center;width:100%}body.interim-login{height:auto}.interim-login #login{padding:0;margin:5px auto 20px}.interim-login.login h1 a{width:auto}.interim-login #login_error,.interim-login.login .message{margin:0 0 16px}.interim-login.login form{margin:0}@-ms-viewport{width:device-width}@media screen and (max-height:550px){#login{padding:20px 0}}@media screen and (max-width:782px){.interim-login input[type=checkbox]{height:16px;width:16px}.interim-login input[type=checkbox]:checked:before{width:16px;font:normal 21px/1 dashicons;margin:-3px -4px 0 0}} \ No newline at end of file
diff --git a/www/crm/wp-admin/css/login.css b/www/crm/wp-admin/css/login.css
new file mode 100644
index 00000000..4b7c1c89
--- /dev/null
+++ b/www/crm/wp-admin/css/login.css
@@ -0,0 +1,311 @@
+html,
+body {
+ height: 100%;
+ margin: 0;
+ padding: 0;
+}
+
+body {
+ background: #f1f1f1;
+ min-width: 0;
+ color: #444;
+ font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
+ font-size: 13px;
+ line-height: 1.4em;
+}
+
+a {
+ color: #0073aa;
+ transition-property: border, background, color;
+ transition-duration: .05s;
+ transition-timing-function: ease-in-out;
+}
+
+a {
+ outline: 0;
+}
+
+a:hover,
+a:active {
+ color: #00a0d2;
+}
+
+a:focus {
+ color: #124964;
+ box-shadow:
+ 0 0 0 1px #5b9dd9,
+ 0 0 2px 1px rgba(30, 140, 190, 0.8);
+}
+
+.ie8 a:focus {
+ outline: #5b9dd9 solid 1px;
+}
+
+p {
+ line-height: 1.5;
+}
+
+.login .message,
+.login .success,
+.login #login_error {
+ border-left: 4px solid #00a0d2;
+ padding: 12px;
+ margin-left: 0;
+ margin-bottom: 20px;
+ background-color: #fff;
+ box-shadow: 0 1px 1px 0 rgba(0, 0, 0, 0.1);
+}
+
+.login .success {
+ border-left-color: #46b450;
+}
+
+.login #login_error {
+ border-left-color: #dc3232;
+}
+
+#loginform p.submit,
+.login-action-lostpassword p.submit {
+ border: none;
+ margin: -10px 0 20px; /* May want to revisit this */
+}
+
+.login * {
+ margin: 0;
+ padding: 0;
+}
+
+.login .password-input-wrapper {
+ position: relative;
+}
+
+.login .input.password-input {
+ margin: 0;
+}
+
+.login .input::-ms-clear {
+ display: none;
+}
+
+.login .pw-weak {
+ margin-bottom: 15px;
+}
+
+.login .button.button-secondary {
+ background: transparent;
+ border: 1px solid transparent;
+ box-shadow: none;
+ font-size: 14px;
+ line-height: 2;
+ height: auto;
+ margin: 0;
+ padding: 5px 9px;
+ position: absolute;
+ right: 0;
+ top: 0;
+}
+
+.login .button.button-secondary:hover {
+ background: transparent;
+}
+
+.login .button.button-secondary:focus {
+ background: transparent;
+ border-color: #5b9dd9;
+ box-shadow: 0 0 3px rgba(0, 115, 170, 0.8);
+}
+
+.login .button.button-secondary:active {
+ background: transparent;
+ box-shadow: none;
+ transform: none;
+}
+
+.login form {
+ margin-top: 20px;
+ margin-left: 0;
+ padding: 26px 24px 46px;
+ font-weight: 400;
+ overflow: hidden;
+ background: #fff;
+ box-shadow: 0 1px 3px rgba(0, 0, 0, 0.13);
+}
+
+.login form .forgetmenot {
+ font-weight: 400;
+ float: left;
+ margin-bottom: 0;
+}
+
+.login .button-primary {
+ float: right;
+}
+
+#login form p {
+ margin-bottom: 0;
+}
+
+#login form p.submit {
+ margin: 0;
+ padding: 0;
+}
+
+.login label {
+ font-size: 14px;
+}
+
+.login form .forgetmenot label {
+ font-size: 12px;
+ line-height: 19px;
+}
+
+.login h1 {
+ text-align: center;
+}
+
+.login h1 a {
+ background-image: url(../images/w-logo-blue.png?ver=20131202);
+ background-image: none, url(../images/wordpress-logo.svg?ver=20131107);
+ background-size: 84px;
+ background-position: center top;
+ background-repeat: no-repeat;
+ color: #444;
+ height: 84px;
+ font-size: 20px;
+ font-weight: 400;
+ line-height: 1.3em;
+ margin: 0 auto 25px;
+ padding: 0;
+ text-decoration: none;
+ width: 84px;
+ text-indent: -9999px;
+ outline: none;
+ overflow: hidden;
+ display: block;
+}
+
+#login {
+ width: 320px;
+ padding: 8% 0 0;
+ margin: auto;
+}
+
+.login #nav,
+.login #backtoblog {
+ font-size: 13px;
+ padding: 0 24px 0;
+}
+
+.login #nav {
+ margin: 24px 0 0 0;
+}
+
+#backtoblog {
+ margin: 16px 0;
+}
+
+.login #nav a,
+.login #backtoblog a {
+ text-decoration: none;
+ color: #555d66;
+}
+
+.login #nav a:hover,
+.login #backtoblog a:hover,
+.login h1 a:hover {
+ color: #00a0d2;
+}
+
+.login #nav a:focus,
+.login #backtoblog a:focus,
+.login h1 a:focus {
+ color: #124964;
+}
+
+.login .privacy-policy-page-link {
+ text-align: center;
+ width: 100%;
+ margin: 5em 0 2em;
+}
+
+.login form .input,
+.login input[type="text"] {
+ font-size: 24px;
+ width: 100%;
+ padding: 5px;
+ margin: 2px 6px 16px 0;
+}
+
+.login-action-rp form .input,
+.login-action-rp input[type="text"] {
+ padding: 5px 45px 5px 5px;
+}
+
+.login form .input,
+.login input[type="text"],
+.login form input[type="checkbox"] {
+ background: #fbfbfb;
+}
+
+.ie7 .login form .input,
+.ie8 .login form .input {
+ font-family: sans-serif;
+}
+
+.login-action-rp input[type="text"] {
+ box-shadow: none;
+ margin: 0;
+}
+
+.login #pass-strength-result {
+ font-weight: 600;
+ margin: -1px 5px 16px 0;
+ padding: 6px 5px;
+ text-align: center;
+ width: 100%;
+}
+
+body.interim-login {
+ height: auto;
+}
+
+.interim-login #login {
+ padding: 0;
+ margin: 5px auto 20px;
+}
+
+.interim-login.login h1 a {
+ width: auto;
+}
+
+.interim-login #login_error,
+.interim-login.login .message {
+ margin: 0 0 16px;
+}
+
+.interim-login.login form {
+ margin: 0;
+}
+
+@-ms-viewport {
+ width: device-width;
+}
+
+@media screen and (max-height: 550px) {
+ #login {
+ padding: 20px 0;
+ }
+}
+
+@media screen and (max-width: 782px) {
+ .interim-login input[type=checkbox] {
+ height: 16px;
+ width: 16px;
+ }
+
+ .interim-login input[type=checkbox]:checked:before {
+ width: 16px;
+ font: normal 21px/1 dashicons;
+ margin: -3px 0 0 -4px;
+ }
+}
diff --git a/www/crm/wp-admin/css/login.min.css b/www/crm/wp-admin/css/login.min.css
new file mode 100644
index 00000000..1616c3ed
--- /dev/null
+++ b/www/crm/wp-admin/css/login.min.css
@@ -0,0 +1,2 @@
+/*! This file is auto-generated */
+body,html{height:100%;margin:0;padding:0}body{background:#f1f1f1;min-width:0;color:#444;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif;font-size:13px;line-height:1.4em}a{color:#0073aa;transition-property:border,background,color;transition-duration:.05s;transition-timing-function:ease-in-out}a{outline:0}a:active,a:hover{color:#00a0d2}a:focus{color:#124964;box-shadow:0 0 0 1px #5b9dd9,0 0 2px 1px rgba(30,140,190,.8)}.ie8 a:focus{outline:#5b9dd9 solid 1px}p{line-height:1.5}.login #login_error,.login .message,.login .success{border-left:4px solid #00a0d2;padding:12px;margin-left:0;margin-bottom:20px;background-color:#fff;box-shadow:0 1px 1px 0 rgba(0,0,0,.1)}.login .success{border-left-color:#46b450}.login #login_error{border-left-color:#dc3232}#loginform p.submit,.login-action-lostpassword p.submit{border:none;margin:-10px 0 20px}.login *{margin:0;padding:0}.login .password-input-wrapper{position:relative}.login .input.password-input{margin:0}.login .input::-ms-clear{display:none}.login .pw-weak{margin-bottom:15px}.login .button.button-secondary{background:0 0;border:1px solid transparent;box-shadow:none;font-size:14px;line-height:2;height:auto;margin:0;padding:5px 9px;position:absolute;right:0;top:0}.login .button.button-secondary:hover{background:0 0}.login .button.button-secondary:focus{background:0 0;border-color:#5b9dd9;box-shadow:0 0 3px rgba(0,115,170,.8)}.login .button.button-secondary:active{background:0 0;box-shadow:none;transform:none}.login form{margin-top:20px;margin-left:0;padding:26px 24px 46px;font-weight:400;overflow:hidden;background:#fff;box-shadow:0 1px 3px rgba(0,0,0,.13)}.login form .forgetmenot{font-weight:400;float:left;margin-bottom:0}.login .button-primary{float:right}#login form p{margin-bottom:0}#login form p.submit{margin:0;padding:0}.login label{font-size:14px}.login form .forgetmenot label{font-size:12px;line-height:19px}.login h1{text-align:center}.login h1 a{background-image:url(../images/w-logo-blue.png?ver=20131202);background-image:none,url(../images/wordpress-logo.svg?ver=20131107);background-size:84px;background-position:center top;background-repeat:no-repeat;color:#444;height:84px;font-size:20px;font-weight:400;line-height:1.3em;margin:0 auto 25px;padding:0;text-decoration:none;width:84px;text-indent:-9999px;outline:0;overflow:hidden;display:block}#login{width:320px;padding:8% 0 0;margin:auto}.login #backtoblog,.login #nav{font-size:13px;padding:0 24px 0}.login #nav{margin:24px 0 0 0}#backtoblog{margin:16px 0}.login #backtoblog a,.login #nav a{text-decoration:none;color:#555d66}.login #backtoblog a:hover,.login #nav a:hover,.login h1 a:hover{color:#00a0d2}.login #backtoblog a:focus,.login #nav a:focus,.login h1 a:focus{color:#124964}.login .privacy-policy-page-link{text-align:center;width:100%;margin:5em 0 2em}.login form .input,.login input[type=text]{font-size:24px;width:100%;padding:5px;margin:2px 6px 16px 0}.login-action-rp form .input,.login-action-rp input[type=text]{padding:5px 45px 5px 5px}.login form .input,.login form input[type=checkbox],.login input[type=text]{background:#fbfbfb}.ie7 .login form .input,.ie8 .login form .input{font-family:sans-serif}.login-action-rp input[type=text]{box-shadow:none;margin:0}.login #pass-strength-result{font-weight:600;margin:-1px 5px 16px 0;padding:6px 5px;text-align:center;width:100%}body.interim-login{height:auto}.interim-login #login{padding:0;margin:5px auto 20px}.interim-login.login h1 a{width:auto}.interim-login #login_error,.interim-login.login .message{margin:0 0 16px}.interim-login.login form{margin:0}@-ms-viewport{width:device-width}@media screen and (max-height:550px){#login{padding:20px 0}}@media screen and (max-width:782px){.interim-login input[type=checkbox]{height:16px;width:16px}.interim-login input[type=checkbox]:checked:before{width:16px;font:normal 21px/1 dashicons;margin:-3px 0 0 -4px}} \ No newline at end of file
diff --git a/www/crm/wp-admin/css/media-rtl.css b/www/crm/wp-admin/css/media-rtl.css
new file mode 100644
index 00000000..34fa15a6
--- /dev/null
+++ b/www/crm/wp-admin/css/media-rtl.css
@@ -0,0 +1,1290 @@
+/*------------------------------------------------------------------------------
+ 14.0 - Media Screen
+------------------------------------------------------------------------------*/
+
+.media-item .describe {
+ border-collapse: collapse;
+ width: 100%;
+ border-top: 1px solid #ddd;
+ clear: both;
+ cursor: default;
+}
+
+.media-item.media-blank .describe {
+ border: 0;
+}
+
+.media-item .describe th {
+ vertical-align: top;
+ text-align: right;
+ padding: 5px 10px 10px;
+ width: 140px;
+}
+
+.media-item .describe .align th {
+ padding-top: 0;
+}
+
+.media-item .media-item-info tr {
+ background-color: transparent;
+}
+
+.media-item .describe td {
+ padding: 0 0 8px 8px;
+ vertical-align: top;
+}
+
+.media-item thead.media-item-info td {
+ padding: 4px 10px 0;
+}
+
+.media-item .media-item-info .A1B1 {
+ padding: 0 10px 0 0;
+}
+
+.media-item td.savesend {
+ padding-bottom: 15px;
+}
+
+.media-item .thumbnail {
+ max-height: 128px;
+ max-width: 128px;
+}
+
+#wpbody-content #async-upload-wrap a {
+ display: none;
+}
+
+.media-upload-form {
+ margin-top: 20px;
+}
+
+.media-upload-form td label {
+ margin-left: 6px;
+ margin-right: 2px;
+}
+
+.media-upload-form .align .field label {
+ display: inline;
+ padding: 0 23px 0 0;
+ margin: 0 3px 0 1em;
+ font-weight: 600;
+}
+
+.media-upload-form tr.image-size label {
+ margin: 0 5px 0 0;
+ font-weight: 600;
+}
+
+.media-upload-form th.label label {
+ font-weight: 600;
+ margin: 0.5em;
+ font-size: 13px;
+}
+
+.media-upload-form th.label label span {
+ padding: 0 5px;
+}
+
+.media-item .describe input[type="text"],
+.media-item .describe textarea {
+ width: 460px;
+}
+
+.media-item .describe p.help {
+ margin: 0;
+ padding: 0 5px 0 0;
+}
+
+.media-item .edit-attachment,
+.describe-toggle-on,
+.describe-toggle-off {
+ display: block;
+ line-height: 36px;
+ float: left;
+ margin-left: 10px;
+}
+
+.media-item .describe-toggle-off,
+.media-item.open .describe-toggle-on {
+ display: none;
+}
+
+.media-item.open .describe-toggle-off {
+ display: block;
+}
+
+.media-upload-form .media-item {
+ min-height: 36px;
+ margin-bottom: 1px;
+ position: relative;
+ width: 100%;
+ background: #fff;
+}
+
+.media-upload-form .media-item,
+.media-upload-form .media-item .error {
+ box-shadow: 0 1px 0 #ddd;
+}
+
+#media-items:empty {
+ border: 0 none;
+}
+
+.media-item .filename {
+ line-height: 36px;
+ overflow: hidden;
+ margin-right: 6px;
+}
+
+.media-item .pinkynail {
+ float: right;
+ margin: 2px 3px 0 10px;
+ max-width: 40px;
+ max-height: 32px;
+}
+
+.media-item .startopen,
+.media-item .startclosed {
+ display: none;
+}
+
+.media-item .original {
+ position: relative;
+ height: 34px;
+}
+
+.media-item .progress {
+ float: left;
+ height: 22px;
+ margin: 7px 6px;
+ width: 200px;
+ line-height: 2em;
+ padding: 0;
+ overflow: hidden;
+ border-radius: 22px;
+ background: #ddd;
+ box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
+}
+
+.media-item .bar {
+ z-index: 9;
+ width: 0;
+ height: 100%;
+ margin-top: -22px;
+ border-radius: 22px;
+ background-color: #0073aa;
+ box-shadow: inset 0 0 2px rgba(0, 0, 0, 0.3);
+}
+
+.media-item .progress .percent {
+ z-index: 10;
+ position: relative;
+ width: 200px;
+ padding: 0;
+ color: #fff;
+ text-align: center;
+ line-height: 22px;
+ font-weight: 400;
+ text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
+}
+
+.upload-php .fixed .column-parent {
+ width: 15%;
+}
+
+.js .html-uploader #plupload-upload-ui {
+ display: none;
+}
+
+.js .html-uploader #html-upload-ui {
+ display: block;
+}
+
+.media-upload-form .media-item.error,
+.media-upload-form .media-item .error {
+ width: auto;
+ margin: 0 0 1px 0;
+}
+
+.media-upload-form .media-item .error {
+ padding: 10px 14px 10px 0;
+}
+
+.media-item .error-div button.dismiss {
+ float: left;
+ margin: 0 15px 0 10px;
+}
+
+/*------------------------------------------------------------------------------
+ 14.1 - Media Library
+------------------------------------------------------------------------------*/
+
+.find-box {
+ background-color: #fff;
+ box-shadow: 0 3px 6px rgba(0, 0, 0, 0.3);
+ width: 600px;
+ overflow: hidden;
+ margin-right: -300px;
+ position: fixed;
+ top: 30px;
+ bottom: 30px;
+ right: 50%;
+ z-index: 100105;
+}
+
+.find-box-head {
+ background: #fcfcfc;
+ border-bottom: 1px solid #ddd;
+ height: 36px;
+ font-size: 18px;
+ font-weight: 600;
+ line-height: 36px;
+ padding: 0 16px 0 36px;
+ position: absolute;
+ top: 0;
+ right: 0;
+ left: 0;
+}
+
+.find-box-inside {
+ overflow: auto;
+ padding: 16px;
+ background-color: #fff;
+ position: absolute;
+ top: 37px;
+ bottom: 45px;
+ overflow-y: scroll;
+ width: 100%;
+ box-sizing: border-box;
+}
+
+.find-box-search {
+ padding-bottom: 16px;
+}
+
+.find-box-search .spinner {
+ float: none;
+ right: 105px;
+ position: absolute;
+}
+
+.find-box-search,
+#find-posts-response {
+ position: relative; /* RTL fix, #WP28010 */
+}
+
+#find-posts-input,
+#find-posts-search {
+ float: right;
+}
+
+#find-posts-input {
+ width: 140px;
+ height: 28px;
+ margin: 0 0 0 4px;
+}
+
+.widefat .found-radio {
+ padding-left: 0;
+ width: 16px;
+}
+
+#find-posts-close {
+ width: 36px;
+ height: 36px;
+ border: none;
+ padding: 0;
+ position: absolute;
+ top: 0;
+ left: 0;
+ cursor: pointer;
+ text-align: center;
+ background: none;
+ color: #666;
+}
+
+#find-posts-close:hover,
+#find-posts-close:focus {
+ color: #00a0d2;
+}
+
+#find-posts-close:focus {
+ box-shadow:
+ 0 0 0 1px #5b9dd9,
+ 0 0 2px 1px rgba(30, 140, 190, 0.8);
+ /* Only visible in Windows High Contrast mode */
+ outline: 2px solid transparent;
+ outline-offset: -2px;
+}
+
+#find-posts-close:before {
+ font: normal 20px/36px dashicons;
+ vertical-align: top;
+ speak: none;
+ -webkit-font-smoothing: antialiased;
+ -moz-osx-font-smoothing: grayscale;
+ content: "\f158";
+}
+
+.find-box-buttons {
+ padding: 8px 16px;
+ background: #fcfcfc;
+ border-top: 1px solid #ddd;
+ position: absolute;
+ bottom: 0;
+ right: 0;
+ left: 0;
+}
+
+@media screen and (max-width: 782px) {
+ .find-box-inside {
+ bottom: 57px;
+ }
+}
+
+@media screen and (max-width: 660px) {
+
+ .find-box {
+ top: 0;
+ bottom: 0;
+ right: 0;
+ left: 0;
+ margin: 0;
+ width: 100%;
+ }
+
+}
+
+.ui-find-overlay {
+ position: fixed;
+ top: 0;
+ right: 0;
+ left: 0;
+ bottom: 0;
+ background: #000;
+ opacity: 0.7;
+ filter: alpha(opacity=70);
+ z-index: 100100;
+}
+
+ul#dismissed-updates {
+ display: none;
+}
+
+form.upgrade {
+ margin-top: 8px;
+}
+
+form.upgrade .hint {
+ font-style: italic;
+ font-size: 85%;
+ margin: -0.5em 0 2em 0;
+}
+
+#poststuff .inside .the-tagcloud {
+ margin: 5px 0 10px;
+ padding: 8px;
+ border: 1px solid #ddd;
+ line-height: 1.8em;
+ word-spacing: 3px;
+}
+
+.drag-drop #drag-drop-area {
+ border: 4px dashed #b4b9be;
+ height: 200px;
+}
+
+.drag-drop .drag-drop-inside {
+ margin: 70px auto 0;
+ width: 250px;
+}
+
+.drag-drop-inside p {
+ color: #a0a5aa;
+ font-size: 14px;
+ margin: 5px 0;
+ display: none;
+}
+
+.drag-drop .drag-drop-inside p {
+ text-align: center;
+}
+
+.drag-drop-inside p.drag-drop-info {
+ font-size: 20px;
+}
+
+.drag-drop .drag-drop-inside p,
+.drag-drop-inside p.drag-drop-buttons {
+ display: block;
+}
+
+/*
+#drag-drop-area:-moz-drag-over {
+ border-color: #83b4d8;
+}
+border color while dragging a file over the uploader drop area */
+.drag-drop.drag-over #drag-drop-area {
+ border-color: #83b4d8;
+}
+
+#plupload-upload-ui {
+ position: relative;
+}
+
+/**
+ * Media Library grid view
+ */
+
+.media-frame.mode-grid,
+.media-frame.mode-grid .media-frame-content,
+.media-frame.mode-grid .attachments-browser .attachments,
+.media-frame.mode-grid .uploader-inline-content {
+ position: static;
+}
+
+/* Regions we don't use at all */
+.media-frame.mode-grid .media-frame-title,
+.media-frame.mode-grid .media-frame-router,
+.media-frame.mode-grid .media-frame-menu {
+ display: none;
+}
+
+.media-frame.mode-grid .media-frame-content {
+ background-color: transparent;
+ border: none;
+}
+
+.upload-php .mode-grid .media-sidebar {
+ position: relative;
+ width: auto;
+ margin-top: 12px;
+ padding: 0 16px;
+ border-right: 4px solid #dd3d36;
+ box-shadow: 0 1px 1px 0 rgba(0, 0, 0, 0.1);
+ background-color: #fff;
+}
+
+.upload-php .mode-grid .hide-sidebar .media-sidebar {
+ display: none;
+}
+
+.upload-php .mode-grid .media-sidebar .media-uploader-status {
+ border-bottom: none;
+ padding-bottom: 0;
+ max-width: 100%;
+}
+
+.upload-php .mode-grid .media-sidebar .upload-error {
+ margin: 12px 0;
+ padding: 4px 0 0;
+ border: none;
+ box-shadow: none;
+ background: none;
+}
+
+.upload-php .mode-grid .media-sidebar .media-uploader-status .upload-dismiss-errors {
+ top: -10px;
+ left: -14px;
+ padding: 10px;
+}
+
+.upload-php .mode-grid .media-sidebar .media-uploader-status .upload-dismiss-errors:before {
+ content: "\f153";
+ display: block;
+ font: normal 16px/1 dashicons;
+ color: #72777c;
+}
+
+.upload-php .mode-grid .media-sidebar .media-uploader-status .upload-dismiss-errors:focus:before,
+.upload-php .mode-grid .media-sidebar .media-uploader-status .upload-dismiss-errors:hover:before {
+ color: #c00;
+}
+
+.upload-php .mode-grid .media-sidebar .media-uploader-status.errors h3, /* Back-compat for pre-4.4 */
+.upload-php .mode-grid .media-sidebar .media-uploader-status.errors h2 {
+ display: none;
+}
+
+.media-frame.mode-grid .uploader-inline {
+ position: relative;
+ top: auto;
+ left: auto;
+ right: auto;
+ bottom: auto;
+ padding-top: 0;
+ margin-top: 20px;
+ border: 4px dashed #b4b9be;
+}
+
+.media-frame.mode-select .attachments-browser.fixed .attachments {
+ position: relative;
+ top: 94px; /* prevent jumping up when the toolbar becomes fixed */
+ padding-bottom: 94px; /* offset for above so the bottom doesn't get cut off */
+}
+
+.media-frame.mode-grid .attachment:focus,
+.media-frame.mode-grid .selected.attachment:focus,
+.media-frame.mode-grid .attachment.details:focus {
+ box-shadow:
+ inset 0 0 2px 3px #f1f1f1,
+ inset 0 0 0 7px #5b9dd9;
+ /* Only visible in Windows High Contrast mode */
+ outline: 2px solid transparent;
+ outline-offset: -6px;
+}
+
+.media-frame.mode-grid .selected.attachment {
+ box-shadow:
+ inset 0 0 0 5px #f1f1f1,
+ inset 0 0 0 7px #ccc;
+}
+
+.media-frame.mode-grid .attachment.details {
+ box-shadow:
+ inset 0 0 0 3px #f1f1f1,
+ inset 0 0 0 7px #1e8cbe;
+}
+
+.media-frame.mode-grid.mode-select .attachment .thumbnail {
+ opacity: 0.65;
+}
+
+.media-frame.mode-select .attachment.selected .thumbnail {
+ opacity: 1;
+}
+
+.media-frame.mode-grid .media-toolbar {
+ margin-bottom: 15px;
+ height: auto;
+}
+
+.media-frame.mode-grid .media-toolbar select {
+ margin: 0 0 0 10px;
+ font-size: 14px;
+}
+
+.media-frame.mode-grid.mode-edit .media-toolbar-secondary > .select-mode-toggle-button {
+ margin: 0 0 0 8px;
+ vertical-align: middle;
+}
+
+.media-frame.mode-grid .attachments-browser .bulk-select {
+ display: inline-block;
+ margin: 0 0 0 10px;
+}
+
+.media-frame.mode-grid .search {
+ margin-top: 0;
+}
+
+.media-frame.mode-grid .spinner {
+ margin-top: 16px;
+}
+
+.attachments-browser .media-toolbar-secondary > .media-button {
+ margin-left: 10px;
+}
+
+.media-frame.mode-select .attachments-browser.fixed .media-toolbar {
+ position: fixed;
+ top: 32px;
+ right: auto;
+ left: 20px;
+ margin-top: 0;
+}
+
+.media-frame.mode-grid .attachments-browser {
+ padding: 0;
+}
+
+.media-frame.mode-grid .attachments-browser .attachments {
+ padding: 2px;
+}
+
+.media-frame.mode-grid .attachments-browser .no-media {
+ color: #666; /* same as no plugins and no themes */
+ font-size: 18px;
+ font-style: normal;
+ margin: 0;
+ padding: 100px 0 0;
+ text-align: center;
+}
+
+/**
+ * Attachment details modal
+ */
+
+.edit-attachment-frame {
+ display: block;
+ height: 100%;
+ width: 100%;
+}
+
+.edit-attachment-frame .edit-media-header {
+ overflow: hidden;
+}
+
+.upload-php .media-modal-close .media-modal-icon:before {
+ content: "\f335";
+ font-size: 22px;
+}
+
+.upload-php .media-modal-close,
+.edit-attachment-frame .edit-media-header .left,
+.edit-attachment-frame .edit-media-header .right {
+ cursor: pointer;
+ color: #72777c;
+ background-color: transparent;
+ height: 50px;
+ width: 50px;
+ padding: 0;
+ position: absolute;
+ text-align: center;
+ border: 0;
+ border-right: 1px solid #ddd;
+ transition: color .1s ease-in-out, background .1s ease-in-out;
+}
+
+.upload-php .media-modal-close {
+ top: 0;
+ left: 0;
+}
+
+.edit-attachment-frame .edit-media-header .left {
+ left: 102px;
+}
+
+.edit-attachment-frame .edit-media-header .right {
+ left: 51px;
+}
+
+.edit-attachment-frame .media-frame-title {
+ right: 0;
+ left: 150px; /* leave space for prev/next/close */
+}
+
+.edit-attachment-frame .edit-media-header .right:before,
+.edit-attachment-frame .edit-media-header .left:before {
+ font: normal 20px/50px dashicons !important;
+ display: inline;
+ font-weight: 300;
+}
+
+.upload-php .media-modal-close:hover,
+.upload-php .media-modal-close:focus,
+.edit-attachment-frame .edit-media-header .left:hover,
+.edit-attachment-frame .edit-media-header .right:hover,
+.edit-attachment-frame .edit-media-header .left:focus,
+.edit-attachment-frame .edit-media-header .right:focus {
+ background: #ddd;
+ border-color: #ccc;
+ color: #000;
+ outline: none;
+ box-shadow: none;
+}
+
+.upload-php .media-modal-close:focus,
+.edit-attachment-frame .edit-media-header .left:focus,
+.edit-attachment-frame .edit-media-header .right:focus {
+ /* Only visible in Windows High Contrast mode */
+ outline: 2px solid transparent;
+ outline-offset: -2px;
+}
+
+.upload-php .media-modal-close:focus .media-modal-icon:before,
+.upload-php .media-modal-close:hover .media-modal-icon:before {
+ color: #000;
+}
+
+.edit-attachment-frame .edit-media-header .left:before {
+ content: "\f345";
+}
+
+.edit-attachment-frame .edit-media-header .right:before {
+ content: "\f341";
+}
+
+.edit-attachment-frame .edit-media-header .left.disabled,
+.edit-attachment-frame .edit-media-header .right.disabled,
+.edit-attachment-frame .edit-media-header .left.disabled:hover,
+.edit-attachment-frame .edit-media-header .right.disabled:hover {
+ color: #ccc;
+ background: inherit;
+ cursor: default;
+ pointer-events: none;
+}
+
+.edit-attachment-frame .media-frame-content,
+.edit-attachment-frame .media-frame-router {
+ right: 0;
+}
+
+.edit-attachment-frame .media-frame-content {
+ border-bottom: none;
+ bottom: 0;
+ top: 50px;
+}
+
+.edit-attachment-frame .attachment-details {
+ position: absolute;
+ overflow: auto;
+ top: 0;
+ bottom: 0;
+ left: 0;
+ right: 0;
+ box-shadow: inset 0px 4px 4px -4px rgba(0, 0, 0, 0.1);
+}
+
+.edit-attachment-frame .attachment-media-view {
+ float: right;
+ width: 65%;
+ height: 100%;
+}
+
+.edit-attachment-frame .attachment-media-view .thumbnail {
+ box-sizing: border-box;
+ padding: 16px;
+ height: 100%;
+}
+
+.edit-attachment-frame .attachment-media-view .details-image {
+ display: block;
+ margin: 0 auto 16px;
+ max-width: 100%;
+ max-height: 90%;
+ max-height: calc( 100% - 42px ); /* leave space for actions underneath */
+ background-image: linear-gradient(-45deg, #c4c4c4 25%, transparent 25%, transparent 75%, #c4c4c4 75%, #c4c4c4), linear-gradient(-45deg, #c4c4c4 25%, transparent 25%, transparent 75%, #c4c4c4 75%, #c4c4c4);
+ background-position: 100% 0, 10px 10px;
+ background-size: 20px 20px;
+}
+
+.edit-attachment-frame .attachment-media-view .details-image.icon {
+ background: none;
+}
+
+.edit-attachment-frame .attachment-media-view .attachment-actions {
+ text-align: center;
+}
+
+.edit-attachment-frame .wp-media-wrapper {
+ margin-bottom: 12px;
+}
+
+.edit-attachment-frame input,
+.edit-attachment-frame textarea {
+ padding: 6px 8px;
+ line-height: 16px;
+}
+
+.edit-attachment-frame .attachment-info {
+ overflow: auto;
+ box-sizing: border-box;
+ margin-bottom: 0;
+ padding: 12px 16px 0;
+ width: 35%;
+ height: 100%;
+ box-shadow: inset 0px 4px 4px -4px rgba(0, 0, 0, 0.1);
+ border-bottom: 0;
+ border-right: 1px solid #ddd;
+ background: #f3f3f3;
+}
+
+.edit-attachment-frame .attachment-info .details,
+.edit-attachment-frame .attachment-info .settings {
+ position: relative; /* RTL fix, #WP29352 */
+ overflow: hidden;
+ float: none;
+ margin-bottom: 15px;
+ padding-bottom: 15px;
+ border-bottom: 1px solid #ddd;
+}
+
+.edit-attachment-frame .attachment-info .filename {
+ font-weight: 400;
+ color: #666;
+}
+
+.edit-attachment-frame .attachment-info .thumbnail {
+ margin-bottom: 12px;
+}
+
+.attachment-info .actions {
+ margin-bottom: 16px;
+}
+
+.attachment-info .actions a {
+ display: inline;
+ text-decoration: none;
+}
+
+
+/*------------------------------------------------------------------------------
+ 14.2 - Image Editor
+------------------------------------------------------------------------------*/
+.wp_attachment_details .attachment-alt-text {
+ margin-bottom: 5px;
+}
+
+.wp_attachment_details .attachment-alt-text-description {
+ margin-top: 5px;
+}
+
+.wp_attachment_details label[for="content"] {
+ font-size: 13px;
+ line-height: 1.5;
+ margin: 1em 0;
+}
+
+.wp_attachment_details #attachment_caption {
+ height: 4em;
+}
+
+.describe .image-editor {
+ vertical-align: top;
+}
+
+.imgedit-wrap {
+ position: relative;
+ padding-top: 10px;
+}
+
+.imgedit-settings p,
+.imgedit-settings fieldset {
+ margin: 8px 0;
+}
+
+.imgedit-settings legend {
+ margin-bottom: 5px;
+}
+
+.describe .imgedit-wrap .imgedit-settings {
+ padding: 0 5px;
+}
+
+.wp_attachment_holder div.updated {
+ margin-top: 0;
+}
+
+.wp_attachment_holder .imgedit-wrap > div {
+ height: auto;
+}
+
+.wp_attachment_holder .imgedit-wrap .imgedit-panel-content {
+ padding: 3px 0 0 16px;
+ float: right;
+}
+
+.wp_attachment_holder .imgedit-wrap .imgedit-settings {
+ float: left;
+ width: 250px;
+}
+
+.imgedit-settings input {
+ margin-top: 0;
+ vertical-align: middle;
+}
+
+.imgedit-wait {
+ position: absolute;
+ top: 0;
+ bottom: 0;
+ width: 100%;
+ background: #fff;
+ opacity: 0.7;
+ filter: alpha(opacity=70);
+ display: none;
+}
+
+.imgedit-wait:before {
+ content: "";
+ display: block;
+ width: 20px;
+ height: 20px;
+ position: absolute;
+ right: 50%;
+ top: 50%;
+ margin: -10px -10px 0 0;
+ background: transparent url(../images/spinner.gif) no-repeat center;
+ background-size: 20px 20px;
+ transform: translateZ(0);
+}
+
+.no-float {
+ float: none;
+}
+
+.media-disabled,
+.imgedit-settings .disabled {
+ /* WCAG 1.4.3 Text or images of text that are part of an inactive user
+ interface component ... have no contrast requirement. */
+ color: #a0a5aa;
+}
+
+.A1B1 {
+ overflow: hidden;
+}
+
+.wp_attachment_image .button,
+.A1B1 .button {
+ float: right;
+}
+
+.no-js .wp_attachment_image .button {
+ display: none;
+}
+
+.wp_attachment_image .spinner,
+.A1B1 .spinner {
+ float: right;
+}
+
+.imgedit-menu {
+ min-width: 300px;
+ margin: 0 0 12px;
+}
+
+.imgedit-menu .note-no-rotate {
+ clear: both;
+ margin: 0;
+ padding: 1em 0 0;
+}
+
+.image-editor .imgedit-menu .button {
+ float: right;
+ width: 32px;
+ height: 32px;
+ margin: 0 0 0 8px;
+ padding: 0;
+ background: #f1f1f1;
+ -webkit-font-smoothing: antialiased;
+ -moz-osx-font-smoothing: grayscale;
+ line-height: 16px;
+ color: #72777c;
+}
+
+.imgedit-menu .button:before {
+ font: normal 20px/1 dashicons;
+ speak: none;
+ vertical-align: middle;
+}
+
+.imgedit-menu .button.disabled {
+ border-color: #ccc;
+ background-color: #ddd;
+ color: #72777c;
+ filter: alpha(opacity=50);
+ opacity: 0.5;
+ cursor: default;
+}
+
+.imgedit-crop:before {
+ content: "\f165";
+}
+
+.imgedit-rleft:before {
+ content: "\f166";
+}
+
+.imgedit-rright:before {
+ content: "\f167";
+}
+
+.imgedit-flipv:before {
+ content: "\f168";
+}
+
+.imgedit-fliph:before {
+ content: "\f169";
+}
+
+.imgedit-undo:before {
+ content: "\f171";
+}
+
+.imgedit-redo:before {
+ content: "\f172";
+}
+
+.imgedit-crop-wrap {
+ position: relative;
+}
+
+.imgedit-crop-wrap img {
+ background-image: linear-gradient(-45deg, #c4c4c4 25%, transparent 25%, transparent 75%, #c4c4c4 75%, #c4c4c4), linear-gradient(-45deg, #c4c4c4 25%, transparent 25%, transparent 75%, #c4c4c4 75%, #c4c4c4);
+ background-position: 100% 0, 10px 10px;
+ background-size: 20px 20px;
+}
+
+.imgedit-crop {
+ margin: 0 0 0 8px;
+}
+
+.imgedit-rleft {
+ margin: 0 3px;
+}
+
+.imgedit-rright {
+ margin: 0 3px 0 8px;
+}
+
+.imgedit-flipv {
+ margin: 0 3px;
+}
+
+.imgedit-fliph {
+ margin: 0 3px 0 8px;
+}
+
+.imgedit-undo {
+ margin: 0 3px;
+}
+
+.imgedit-redo {
+ margin: 0 3px 0 8px;
+}
+
+.imgedit-thumbnail-preview {
+ margin: 10px 0 0 8px;
+}
+
+.imgedit-thumbnail-preview-caption {
+ display: block;
+}
+
+#poststuff .imgedit-group-top h3, /* Back-compat for pre-4.4 */
+#poststuff .imgedit-group-top h2 {
+ display: inline-block;
+ margin: 0;
+ padding: 0;
+ font-size: 14px;
+ line-height: 1.4;
+}
+
+#poststuff .imgedit-group-top .button-link {
+ text-decoration: none;
+ color: #23282d;
+}
+
+.imgedit-applyto .imgedit-label {
+ display: block;
+ padding: .5em 0 0;
+}
+
+.imgedit-help {
+ display: none;
+ font-style: italic;
+}
+
+/* higher specificity than buttons */
+.image-editor .imgedit-settings .imgedit-help-toggle,
+.image-editor .imgedit-settings .imgedit-help-toggle:hover,
+.image-editor .imgedit-settings .imgedit-help-toggle:active {
+ border: 1px solid transparent;
+ margin: -1px -1px 0 0;
+ padding: 0;
+ background: transparent;
+ color: #0074a2;
+ font-size: 20px;
+ line-height: 1;
+ cursor: pointer;
+ box-sizing: content-box;
+ box-shadow: none;
+}
+
+.image-editor .imgedit-settings .imgedit-help-toggle:focus {
+ color: #0074a2;
+ border-color: #5b9dd9;
+ box-shadow: 0 0 3px rgba(0, 115, 170, 0.8);
+ /* Only visible in Windows High Contrast mode */
+ outline: 2px solid transparent;
+}
+
+.form-table td.imgedit-response {
+ padding: 0;
+}
+
+.imgedit-submit {
+ margin: 8px 0 0;
+}
+
+.imgedit-submit-btn {
+ margin-right: 20px;
+}
+
+.imgedit-wrap .nowrap {
+ white-space: nowrap;
+ font-size: 12px;
+ line-height: inherit;
+}
+
+span.imgedit-scale-warn {
+ color: #dc3232;
+ font-size: 20px;
+ font-style: normal;
+ visibility: hidden;
+ vertical-align: middle;
+}
+
+.imgedit-save-target {
+ margin: 8px 0;
+}
+
+.imgedit-group {
+ margin-bottom: 8px;
+ padding: 10px;
+}
+
+.imgedit-settings .imgedit-scale input[type="text"],
+.imgedit-settings .imgedit-crop-ratio input[type="text"],
+.imgedit-settings .imgedit-crop-sel input[type="text"] {
+ width: 50px;
+ font-size: 14px;
+ padding: 5px 8px;
+}
+
+.imgedit-separator {
+ display: inline-block;
+ width: 7px;
+ text-align: center;
+ vertical-align: middle;
+ font-size: 13px;
+ color: #444;
+}
+
+.imgedit-settings .imgedit-scale .button {
+ margin-bottom: 0;
+}
+
+audio, video {
+ display: inline-block;
+ max-width: 100%;
+}
+
+.mejs-container {
+ width: 100%;
+ max-width: 100%;
+}
+
+/* =Media Queries
+-------------------------------------------------------------- */
+
+/**
+ * HiDPI Displays
+ */
+@media print,
+ (-webkit-min-device-pixel-ratio: 1.25),
+ (min-resolution: 120dpi) {
+ .imgedit-wait:before {
+ background-image: url(../images/spinner-2x.gif);
+ }
+}
+
+@media screen and (max-width: 782px) {
+ .wp_attachment_details label[for="content"] {
+ font-size: 14px;
+ line-height: 1.5em;
+ }
+
+ .media-upload-form .media-item.error,
+ .media-upload-form .media-item .error {
+ font-size: 13px;
+ line-height: 1.5;
+ }
+
+ .media-upload-form .media-item.error {
+ padding: 1px 10px;
+ }
+
+ .media-upload-form .media-item .error {
+ padding: 10px 12px 10px 0;
+ }
+
+ .imgedit-settings .imgedit-scale input[type="text"],
+ .imgedit-settings .imgedit-crop-ratio input[type="text"],
+ .imgedit-settings .imgedit-crop-sel input[type="text"] {
+ width: 60px;
+ font-size: 16px;
+ padding: 6px 10px;
+ }
+
+ .imgedit-applyto .imgedit-label {
+ vertical-align: middle;
+ }
+}
+
+/**
+ * Media queries for media grid.
+ */
+
+@media only screen and (max-width: 1120px) {
+ /* override for media-views.css */
+ #wp-media-grid .wp-filter .attachment-filters {
+ max-width: 100%;
+ }
+}
+
+@media only screen and (max-width: 782px) {
+ .media-frame.mode-select .attachments-browser.fixed .media-toolbar {
+ top: 46px;
+ left: 10px;
+ }
+}
+
+@media only screen and (max-width: 600px) {
+ .media-frame.mode-select .attachments-browser.fixed .media-toolbar {
+ top: 0;
+ }
+}
+
+@media only screen and (max-width: 480px) {
+ .edit-attachment-frame .media-frame-title {
+ left: 110px;
+ }
+
+ .upload-php .media-modal-close,
+ .edit-attachment-frame .edit-media-header .left,
+ .edit-attachment-frame .edit-media-header .right {
+ width: 40px;
+ height: 40px;
+ }
+
+ .upload-php .media-modal-close .media-modal-icon {
+ margin: 9px 10px;
+ }
+
+ .edit-attachment-frame .edit-media-header .right:before,
+ .edit-attachment-frame .edit-media-header .left:before {
+ line-height: 40px !important;
+ }
+
+ .edit-attachment-frame .edit-media-header .left {
+ left: 82px;
+ }
+
+ .edit-attachment-frame .edit-media-header .right {
+ left: 41px;
+ }
+
+ .edit-attachment-frame .media-frame-content {
+ top: 40px;
+ }
+
+ .edit-attachment-frame .attachment-media-view {
+ float: none;
+ height: auto;
+ width: 100%;
+ }
+
+ .edit-attachment-frame .attachment-info {
+ height: auto;
+ width: 100%;
+ }
+}
+
+@media only screen and (max-width: 640px), screen and (max-height: 400px) {
+ .upload-php .mode-grid .media-sidebar{
+ max-width: 100%;
+ }
+}
diff --git a/www/crm/wp-admin/css/media-rtl.min.css b/www/crm/wp-admin/css/media-rtl.min.css
new file mode 100644
index 00000000..6fd75835
--- /dev/null
+++ b/www/crm/wp-admin/css/media-rtl.min.css
@@ -0,0 +1,2 @@
+/*! This file is auto-generated */
+.media-item .describe{border-collapse:collapse;width:100%;border-top:1px solid #ddd;clear:both;cursor:default}.media-item.media-blank .describe{border:0}.media-item .describe th{vertical-align:top;text-align:right;padding:5px 10px 10px;width:140px}.media-item .describe .align th{padding-top:0}.media-item .media-item-info tr{background-color:transparent}.media-item .describe td{padding:0 0 8px 8px;vertical-align:top}.media-item thead.media-item-info td{padding:4px 10px 0}.media-item .media-item-info .A1B1{padding:0 10px 0 0}.media-item td.savesend{padding-bottom:15px}.media-item .thumbnail{max-height:128px;max-width:128px}#wpbody-content #async-upload-wrap a{display:none}.media-upload-form{margin-top:20px}.media-upload-form td label{margin-left:6px;margin-right:2px}.media-upload-form .align .field label{display:inline;padding:0 23px 0 0;margin:0 3px 0 1em;font-weight:600}.media-upload-form tr.image-size label{margin:0 5px 0 0;font-weight:600}.media-upload-form th.label label{font-weight:600;margin:.5em;font-size:13px}.media-upload-form th.label label span{padding:0 5px}.media-item .describe input[type=text],.media-item .describe textarea{width:460px}.media-item .describe p.help{margin:0;padding:0 5px 0 0}.describe-toggle-off,.describe-toggle-on,.media-item .edit-attachment{display:block;line-height:36px;float:left;margin-left:10px}.media-item .describe-toggle-off,.media-item.open .describe-toggle-on{display:none}.media-item.open .describe-toggle-off{display:block}.media-upload-form .media-item{min-height:36px;margin-bottom:1px;position:relative;width:100%;background:#fff}.media-upload-form .media-item,.media-upload-form .media-item .error{box-shadow:0 1px 0 #ddd}#media-items:empty{border:0 none}.media-item .filename{line-height:36px;overflow:hidden;margin-right:6px}.media-item .pinkynail{float:right;margin:2px 3px 0 10px;max-width:40px;max-height:32px}.media-item .startclosed,.media-item .startopen{display:none}.media-item .original{position:relative;height:34px}.media-item .progress{float:left;height:22px;margin:7px 6px;width:200px;line-height:2em;padding:0;overflow:hidden;border-radius:22px;background:#ddd;box-shadow:inset 0 1px 2px rgba(0,0,0,.1)}.media-item .bar{z-index:9;width:0;height:100%;margin-top:-22px;border-radius:22px;background-color:#0073aa;box-shadow:inset 0 0 2px rgba(0,0,0,.3)}.media-item .progress .percent{z-index:10;position:relative;width:200px;padding:0;color:#fff;text-align:center;line-height:22px;font-weight:400;text-shadow:0 1px 2px rgba(0,0,0,.2)}.upload-php .fixed .column-parent{width:15%}.js .html-uploader #plupload-upload-ui{display:none}.js .html-uploader #html-upload-ui{display:block}.media-upload-form .media-item .error,.media-upload-form .media-item.error{width:auto;margin:0 0 1px 0}.media-upload-form .media-item .error{padding:10px 14px 10px 0}.media-item .error-div button.dismiss{float:left;margin:0 15px 0 10px}.find-box{background-color:#fff;box-shadow:0 3px 6px rgba(0,0,0,.3);width:600px;overflow:hidden;margin-right:-300px;position:fixed;top:30px;bottom:30px;right:50%;z-index:100105}.find-box-head{background:#fcfcfc;border-bottom:1px solid #ddd;height:36px;font-size:18px;font-weight:600;line-height:36px;padding:0 16px 0 36px;position:absolute;top:0;right:0;left:0}.find-box-inside{overflow:auto;padding:16px;background-color:#fff;position:absolute;top:37px;bottom:45px;overflow-y:scroll;width:100%;box-sizing:border-box}.find-box-search{padding-bottom:16px}.find-box-search .spinner{float:none;right:105px;position:absolute}#find-posts-response,.find-box-search{position:relative}#find-posts-input,#find-posts-search{float:right}#find-posts-input{width:140px;height:28px;margin:0 0 0 4px}.widefat .found-radio{padding-left:0;width:16px}#find-posts-close{width:36px;height:36px;border:none;padding:0;position:absolute;top:0;left:0;cursor:pointer;text-align:center;background:0 0;color:#666}#find-posts-close:focus,#find-posts-close:hover{color:#00a0d2}#find-posts-close:focus{box-shadow:0 0 0 1px #5b9dd9,0 0 2px 1px rgba(30,140,190,.8);outline:2px solid transparent;outline-offset:-2px}#find-posts-close:before{font:normal 20px/36px dashicons;vertical-align:top;speak:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;content:"\f158"}.find-box-buttons{padding:8px 16px;background:#fcfcfc;border-top:1px solid #ddd;position:absolute;bottom:0;right:0;left:0}@media screen and (max-width:782px){.find-box-inside{bottom:57px}}@media screen and (max-width:660px){.find-box{top:0;bottom:0;right:0;left:0;margin:0;width:100%}}.ui-find-overlay{position:fixed;top:0;right:0;left:0;bottom:0;background:#000;opacity:.7;filter:alpha(opacity=70);z-index:100100}ul#dismissed-updates{display:none}form.upgrade{margin-top:8px}form.upgrade .hint{font-style:italic;font-size:85%;margin:-.5em 0 2em 0}#poststuff .inside .the-tagcloud{margin:5px 0 10px;padding:8px;border:1px solid #ddd;line-height:1.8em;word-spacing:3px}.drag-drop #drag-drop-area{border:4px dashed #b4b9be;height:200px}.drag-drop .drag-drop-inside{margin:70px auto 0;width:250px}.drag-drop-inside p{color:#a0a5aa;font-size:14px;margin:5px 0;display:none}.drag-drop .drag-drop-inside p{text-align:center}.drag-drop-inside p.drag-drop-info{font-size:20px}.drag-drop .drag-drop-inside p,.drag-drop-inside p.drag-drop-buttons{display:block}.drag-drop.drag-over #drag-drop-area{border-color:#83b4d8}#plupload-upload-ui{position:relative}.media-frame.mode-grid,.media-frame.mode-grid .attachments-browser .attachments,.media-frame.mode-grid .media-frame-content,.media-frame.mode-grid .uploader-inline-content{position:static}.media-frame.mode-grid .media-frame-menu,.media-frame.mode-grid .media-frame-router,.media-frame.mode-grid .media-frame-title{display:none}.media-frame.mode-grid .media-frame-content{background-color:transparent;border:none}.upload-php .mode-grid .media-sidebar{position:relative;width:auto;margin-top:12px;padding:0 16px;border-right:4px solid #dd3d36;box-shadow:0 1px 1px 0 rgba(0,0,0,.1);background-color:#fff}.upload-php .mode-grid .hide-sidebar .media-sidebar{display:none}.upload-php .mode-grid .media-sidebar .media-uploader-status{border-bottom:none;padding-bottom:0;max-width:100%}.upload-php .mode-grid .media-sidebar .upload-error{margin:12px 0;padding:4px 0 0;border:none;box-shadow:none;background:0 0}.upload-php .mode-grid .media-sidebar .media-uploader-status .upload-dismiss-errors{top:-10px;left:-14px;padding:10px}.upload-php .mode-grid .media-sidebar .media-uploader-status .upload-dismiss-errors:before{content:"\f153";display:block;font:normal 16px/1 dashicons;color:#72777c}.upload-php .mode-grid .media-sidebar .media-uploader-status .upload-dismiss-errors:focus:before,.upload-php .mode-grid .media-sidebar .media-uploader-status .upload-dismiss-errors:hover:before{color:#c00}.upload-php .mode-grid .media-sidebar .media-uploader-status.errors h2,.upload-php .mode-grid .media-sidebar .media-uploader-status.errors h3{display:none}.media-frame.mode-grid .uploader-inline{position:relative;top:auto;left:auto;right:auto;bottom:auto;padding-top:0;margin-top:20px;border:4px dashed #b4b9be}.media-frame.mode-select .attachments-browser.fixed .attachments{position:relative;top:94px;padding-bottom:94px}.media-frame.mode-grid .attachment.details:focus,.media-frame.mode-grid .attachment:focus,.media-frame.mode-grid .selected.attachment:focus{box-shadow:inset 0 0 2px 3px #f1f1f1,inset 0 0 0 7px #5b9dd9;outline:2px solid transparent;outline-offset:-6px}.media-frame.mode-grid .selected.attachment{box-shadow:inset 0 0 0 5px #f1f1f1,inset 0 0 0 7px #ccc}.media-frame.mode-grid .attachment.details{box-shadow:inset 0 0 0 3px #f1f1f1,inset 0 0 0 7px #1e8cbe}.media-frame.mode-grid.mode-select .attachment .thumbnail{opacity:.65}.media-frame.mode-select .attachment.selected .thumbnail{opacity:1}.media-frame.mode-grid .media-toolbar{margin-bottom:15px;height:auto}.media-frame.mode-grid .media-toolbar select{margin:0 0 0 10px;font-size:14px}.media-frame.mode-grid.mode-edit .media-toolbar-secondary>.select-mode-toggle-button{margin:0 0 0 8px;vertical-align:middle}.media-frame.mode-grid .attachments-browser .bulk-select{display:inline-block;margin:0 0 0 10px}.media-frame.mode-grid .search{margin-top:0}.media-frame.mode-grid .spinner{margin-top:16px}.attachments-browser .media-toolbar-secondary>.media-button{margin-left:10px}.media-frame.mode-select .attachments-browser.fixed .media-toolbar{position:fixed;top:32px;right:auto;left:20px;margin-top:0}.media-frame.mode-grid .attachments-browser{padding:0}.media-frame.mode-grid .attachments-browser .attachments{padding:2px}.media-frame.mode-grid .attachments-browser .no-media{color:#666;font-size:18px;font-style:normal;margin:0;padding:100px 0 0;text-align:center}.edit-attachment-frame{display:block;height:100%;width:100%}.edit-attachment-frame .edit-media-header{overflow:hidden}.upload-php .media-modal-close .media-modal-icon:before{content:"\f335";font-size:22px}.edit-attachment-frame .edit-media-header .left,.edit-attachment-frame .edit-media-header .right,.upload-php .media-modal-close{cursor:pointer;color:#72777c;background-color:transparent;height:50px;width:50px;padding:0;position:absolute;text-align:center;border:0;border-right:1px solid #ddd;transition:color .1s ease-in-out,background .1s ease-in-out}.upload-php .media-modal-close{top:0;left:0}.edit-attachment-frame .edit-media-header .left{left:102px}.edit-attachment-frame .edit-media-header .right{left:51px}.edit-attachment-frame .media-frame-title{right:0;left:150px}.edit-attachment-frame .edit-media-header .left:before,.edit-attachment-frame .edit-media-header .right:before{font:normal 20px/50px dashicons!important;display:inline;font-weight:300}.edit-attachment-frame .edit-media-header .left:focus,.edit-attachment-frame .edit-media-header .left:hover,.edit-attachment-frame .edit-media-header .right:focus,.edit-attachment-frame .edit-media-header .right:hover,.upload-php .media-modal-close:focus,.upload-php .media-modal-close:hover{background:#ddd;border-color:#ccc;color:#000;outline:0;box-shadow:none}.edit-attachment-frame .edit-media-header .left:focus,.edit-attachment-frame .edit-media-header .right:focus,.upload-php .media-modal-close:focus{outline:2px solid transparent;outline-offset:-2px}.upload-php .media-modal-close:focus .media-modal-icon:before,.upload-php .media-modal-close:hover .media-modal-icon:before{color:#000}.edit-attachment-frame .edit-media-header .left:before{content:"\f345"}.edit-attachment-frame .edit-media-header .right:before{content:"\f341"}.edit-attachment-frame .edit-media-header .left.disabled,.edit-attachment-frame .edit-media-header .left.disabled:hover,.edit-attachment-frame .edit-media-header .right.disabled,.edit-attachment-frame .edit-media-header .right.disabled:hover{color:#ccc;background:inherit;cursor:default;pointer-events:none}.edit-attachment-frame .media-frame-content,.edit-attachment-frame .media-frame-router{right:0}.edit-attachment-frame .media-frame-content{border-bottom:none;bottom:0;top:50px}.edit-attachment-frame .attachment-details{position:absolute;overflow:auto;top:0;bottom:0;left:0;right:0;box-shadow:inset 0 4px 4px -4px rgba(0,0,0,.1)}.edit-attachment-frame .attachment-media-view{float:right;width:65%;height:100%}.edit-attachment-frame .attachment-media-view .thumbnail{box-sizing:border-box;padding:16px;height:100%}.edit-attachment-frame .attachment-media-view .details-image{display:block;margin:0 auto 16px;max-width:100%;max-height:90%;max-height:calc(100% - 42px);background-image:linear-gradient(-45deg,#c4c4c4 25%,transparent 25%,transparent 75%,#c4c4c4 75%,#c4c4c4),linear-gradient(-45deg,#c4c4c4 25%,transparent 25%,transparent 75%,#c4c4c4 75%,#c4c4c4);background-position:100% 0,10px 10px;background-size:20px 20px}.edit-attachment-frame .attachment-media-view .details-image.icon{background:0 0}.edit-attachment-frame .attachment-media-view .attachment-actions{text-align:center}.edit-attachment-frame .wp-media-wrapper{margin-bottom:12px}.edit-attachment-frame input,.edit-attachment-frame textarea{padding:6px 8px;line-height:16px}.edit-attachment-frame .attachment-info{overflow:auto;box-sizing:border-box;margin-bottom:0;padding:12px 16px 0;width:35%;height:100%;box-shadow:inset 0 4px 4px -4px rgba(0,0,0,.1);border-bottom:0;border-right:1px solid #ddd;background:#f3f3f3}.edit-attachment-frame .attachment-info .details,.edit-attachment-frame .attachment-info .settings{position:relative;overflow:hidden;float:none;margin-bottom:15px;padding-bottom:15px;border-bottom:1px solid #ddd}.edit-attachment-frame .attachment-info .filename{font-weight:400;color:#666}.edit-attachment-frame .attachment-info .thumbnail{margin-bottom:12px}.attachment-info .actions{margin-bottom:16px}.attachment-info .actions a{display:inline;text-decoration:none}.wp_attachment_details .attachment-alt-text{margin-bottom:5px}.wp_attachment_details .attachment-alt-text-description{margin-top:5px}.wp_attachment_details label[for=content]{font-size:13px;line-height:1.5;margin:1em 0}.wp_attachment_details #attachment_caption{height:4em}.describe .image-editor{vertical-align:top}.imgedit-wrap{position:relative;padding-top:10px}.imgedit-settings fieldset,.imgedit-settings p{margin:8px 0}.imgedit-settings legend{margin-bottom:5px}.describe .imgedit-wrap .imgedit-settings{padding:0 5px}.wp_attachment_holder div.updated{margin-top:0}.wp_attachment_holder .imgedit-wrap>div{height:auto}.wp_attachment_holder .imgedit-wrap .imgedit-panel-content{padding:3px 0 0 16px;float:right}.wp_attachment_holder .imgedit-wrap .imgedit-settings{float:left;width:250px}.imgedit-settings input{margin-top:0;vertical-align:middle}.imgedit-wait{position:absolute;top:0;bottom:0;width:100%;background:#fff;opacity:.7;filter:alpha(opacity=70);display:none}.imgedit-wait:before{content:"";display:block;width:20px;height:20px;position:absolute;right:50%;top:50%;margin:-10px -10px 0 0;background:transparent url(../images/spinner.gif) no-repeat center;background-size:20px 20px;transform:translateZ(0)}.no-float{float:none}.imgedit-settings .disabled,.media-disabled{color:#a0a5aa}.A1B1{overflow:hidden}.A1B1 .button,.wp_attachment_image .button{float:right}.no-js .wp_attachment_image .button{display:none}.A1B1 .spinner,.wp_attachment_image .spinner{float:right}.imgedit-menu{min-width:300px;margin:0 0 12px}.imgedit-menu .note-no-rotate{clear:both;margin:0;padding:1em 0 0}.image-editor .imgedit-menu .button{float:right;width:32px;height:32px;margin:0 0 0 8px;padding:0;background:#f1f1f1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;line-height:16px;color:#72777c}.imgedit-menu .button:before{font:normal 20px/1 dashicons;speak:none;vertical-align:middle}.imgedit-menu .button.disabled{border-color:#ccc;background-color:#ddd;color:#72777c;filter:alpha(opacity=50);opacity:.5;cursor:default}.imgedit-crop:before{content:"\f165"}.imgedit-rleft:before{content:"\f166"}.imgedit-rright:before{content:"\f167"}.imgedit-flipv:before{content:"\f168"}.imgedit-fliph:before{content:"\f169"}.imgedit-undo:before{content:"\f171"}.imgedit-redo:before{content:"\f172"}.imgedit-crop-wrap{position:relative}.imgedit-crop-wrap img{background-image:linear-gradient(-45deg,#c4c4c4 25%,transparent 25%,transparent 75%,#c4c4c4 75%,#c4c4c4),linear-gradient(-45deg,#c4c4c4 25%,transparent 25%,transparent 75%,#c4c4c4 75%,#c4c4c4);background-position:100% 0,10px 10px;background-size:20px 20px}.imgedit-crop{margin:0 0 0 8px}.imgedit-rleft{margin:0 3px}.imgedit-rright{margin:0 3px 0 8px}.imgedit-flipv{margin:0 3px}.imgedit-fliph{margin:0 3px 0 8px}.imgedit-undo{margin:0 3px}.imgedit-redo{margin:0 3px 0 8px}.imgedit-thumbnail-preview{margin:10px 0 0 8px}.imgedit-thumbnail-preview-caption{display:block}#poststuff .imgedit-group-top h2,#poststuff .imgedit-group-top h3{display:inline-block;margin:0;padding:0;font-size:14px;line-height:1.4}#poststuff .imgedit-group-top .button-link{text-decoration:none;color:#23282d}.imgedit-applyto .imgedit-label{display:block;padding:.5em 0 0}.imgedit-help{display:none;font-style:italic}.image-editor .imgedit-settings .imgedit-help-toggle,.image-editor .imgedit-settings .imgedit-help-toggle:active,.image-editor .imgedit-settings .imgedit-help-toggle:hover{border:1px solid transparent;margin:-1px -1px 0 0;padding:0;background:0 0;color:#0074a2;font-size:20px;line-height:1;cursor:pointer;box-sizing:content-box;box-shadow:none}.image-editor .imgedit-settings .imgedit-help-toggle:focus{color:#0074a2;border-color:#5b9dd9;box-shadow:0 0 3px rgba(0,115,170,.8);outline:2px solid transparent}.form-table td.imgedit-response{padding:0}.imgedit-submit{margin:8px 0 0}.imgedit-submit-btn{margin-right:20px}.imgedit-wrap .nowrap{white-space:nowrap;font-size:12px;line-height:inherit}span.imgedit-scale-warn{color:#dc3232;font-size:20px;font-style:normal;visibility:hidden;vertical-align:middle}.imgedit-save-target{margin:8px 0}.imgedit-group{margin-bottom:8px;padding:10px}.imgedit-settings .imgedit-crop-ratio input[type=text],.imgedit-settings .imgedit-crop-sel input[type=text],.imgedit-settings .imgedit-scale input[type=text]{width:50px;font-size:14px;padding:5px 8px}.imgedit-separator{display:inline-block;width:7px;text-align:center;vertical-align:middle;font-size:13px;color:#444}.imgedit-settings .imgedit-scale .button{margin-bottom:0}audio,video{display:inline-block;max-width:100%}.mejs-container{width:100%;max-width:100%}@media print,(-webkit-min-device-pixel-ratio:1.25),(min-resolution:120dpi){.imgedit-wait:before{background-image:url(../images/spinner-2x.gif)}}@media screen and (max-width:782px){.wp_attachment_details label[for=content]{font-size:14px;line-height:1.5em}.media-upload-form .media-item .error,.media-upload-form .media-item.error{font-size:13px;line-height:1.5}.media-upload-form .media-item.error{padding:1px 10px}.media-upload-form .media-item .error{padding:10px 12px 10px 0}.imgedit-settings .imgedit-crop-ratio input[type=text],.imgedit-settings .imgedit-crop-sel input[type=text],.imgedit-settings .imgedit-scale input[type=text]{width:60px;font-size:16px;padding:6px 10px}.imgedit-applyto .imgedit-label{vertical-align:middle}}@media only screen and (max-width:1120px){#wp-media-grid .wp-filter .attachment-filters{max-width:100%}}@media only screen and (max-width:782px){.media-frame.mode-select .attachments-browser.fixed .media-toolbar{top:46px;left:10px}}@media only screen and (max-width:600px){.media-frame.mode-select .attachments-browser.fixed .media-toolbar{top:0}}@media only screen and (max-width:480px){.edit-attachment-frame .media-frame-title{left:110px}.edit-attachment-frame .edit-media-header .left,.edit-attachment-frame .edit-media-header .right,.upload-php .media-modal-close{width:40px;height:40px}.upload-php .media-modal-close .media-modal-icon{margin:9px 10px}.edit-attachment-frame .edit-media-header .left:before,.edit-attachment-frame .edit-media-header .right:before{line-height:40px!important}.edit-attachment-frame .edit-media-header .left{left:82px}.edit-attachment-frame .edit-media-header .right{left:41px}.edit-attachment-frame .media-frame-content{top:40px}.edit-attachment-frame .attachment-media-view{float:none;height:auto;width:100%}.edit-attachment-frame .attachment-info{height:auto;width:100%}}@media only screen and (max-width:640px),screen and (max-height:400px){.upload-php .mode-grid .media-sidebar{max-width:100%}} \ No newline at end of file
diff --git a/www/crm/wp-admin/css/media.css b/www/crm/wp-admin/css/media.css
new file mode 100644
index 00000000..9f4d862c
--- /dev/null
+++ b/www/crm/wp-admin/css/media.css
@@ -0,0 +1,1290 @@
+/*------------------------------------------------------------------------------
+ 14.0 - Media Screen
+------------------------------------------------------------------------------*/
+
+.media-item .describe {
+ border-collapse: collapse;
+ width: 100%;
+ border-top: 1px solid #ddd;
+ clear: both;
+ cursor: default;
+}
+
+.media-item.media-blank .describe {
+ border: 0;
+}
+
+.media-item .describe th {
+ vertical-align: top;
+ text-align: left;
+ padding: 5px 10px 10px;
+ width: 140px;
+}
+
+.media-item .describe .align th {
+ padding-top: 0;
+}
+
+.media-item .media-item-info tr {
+ background-color: transparent;
+}
+
+.media-item .describe td {
+ padding: 0 8px 8px 0;
+ vertical-align: top;
+}
+
+.media-item thead.media-item-info td {
+ padding: 4px 10px 0;
+}
+
+.media-item .media-item-info .A1B1 {
+ padding: 0 0 0 10px;
+}
+
+.media-item td.savesend {
+ padding-bottom: 15px;
+}
+
+.media-item .thumbnail {
+ max-height: 128px;
+ max-width: 128px;
+}
+
+#wpbody-content #async-upload-wrap a {
+ display: none;
+}
+
+.media-upload-form {
+ margin-top: 20px;
+}
+
+.media-upload-form td label {
+ margin-right: 6px;
+ margin-left: 2px;
+}
+
+.media-upload-form .align .field label {
+ display: inline;
+ padding: 0 0 0 23px;
+ margin: 0 1em 0 3px;
+ font-weight: 600;
+}
+
+.media-upload-form tr.image-size label {
+ margin: 0 0 0 5px;
+ font-weight: 600;
+}
+
+.media-upload-form th.label label {
+ font-weight: 600;
+ margin: 0.5em;
+ font-size: 13px;
+}
+
+.media-upload-form th.label label span {
+ padding: 0 5px;
+}
+
+.media-item .describe input[type="text"],
+.media-item .describe textarea {
+ width: 460px;
+}
+
+.media-item .describe p.help {
+ margin: 0;
+ padding: 0 0 0 5px;
+}
+
+.media-item .edit-attachment,
+.describe-toggle-on,
+.describe-toggle-off {
+ display: block;
+ line-height: 36px;
+ float: right;
+ margin-right: 10px;
+}
+
+.media-item .describe-toggle-off,
+.media-item.open .describe-toggle-on {
+ display: none;
+}
+
+.media-item.open .describe-toggle-off {
+ display: block;
+}
+
+.media-upload-form .media-item {
+ min-height: 36px;
+ margin-bottom: 1px;
+ position: relative;
+ width: 100%;
+ background: #fff;
+}
+
+.media-upload-form .media-item,
+.media-upload-form .media-item .error {
+ box-shadow: 0 1px 0 #ddd;
+}
+
+#media-items:empty {
+ border: 0 none;
+}
+
+.media-item .filename {
+ line-height: 36px;
+ overflow: hidden;
+ margin-left: 6px;
+}
+
+.media-item .pinkynail {
+ float: left;
+ margin: 2px 10px 0 3px;
+ max-width: 40px;
+ max-height: 32px;
+}
+
+.media-item .startopen,
+.media-item .startclosed {
+ display: none;
+}
+
+.media-item .original {
+ position: relative;
+ height: 34px;
+}
+
+.media-item .progress {
+ float: right;
+ height: 22px;
+ margin: 7px 6px;
+ width: 200px;
+ line-height: 2em;
+ padding: 0;
+ overflow: hidden;
+ border-radius: 22px;
+ background: #ddd;
+ box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
+}
+
+.media-item .bar {
+ z-index: 9;
+ width: 0;
+ height: 100%;
+ margin-top: -22px;
+ border-radius: 22px;
+ background-color: #0073aa;
+ box-shadow: inset 0 0 2px rgba(0, 0, 0, 0.3);
+}
+
+.media-item .progress .percent {
+ z-index: 10;
+ position: relative;
+ width: 200px;
+ padding: 0;
+ color: #fff;
+ text-align: center;
+ line-height: 22px;
+ font-weight: 400;
+ text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
+}
+
+.upload-php .fixed .column-parent {
+ width: 15%;
+}
+
+.js .html-uploader #plupload-upload-ui {
+ display: none;
+}
+
+.js .html-uploader #html-upload-ui {
+ display: block;
+}
+
+.media-upload-form .media-item.error,
+.media-upload-form .media-item .error {
+ width: auto;
+ margin: 0 0 1px 0;
+}
+
+.media-upload-form .media-item .error {
+ padding: 10px 0 10px 14px;
+}
+
+.media-item .error-div button.dismiss {
+ float: right;
+ margin: 0 10px 0 15px;
+}
+
+/*------------------------------------------------------------------------------
+ 14.1 - Media Library
+------------------------------------------------------------------------------*/
+
+.find-box {
+ background-color: #fff;
+ box-shadow: 0 3px 6px rgba(0, 0, 0, 0.3);
+ width: 600px;
+ overflow: hidden;
+ margin-left: -300px;
+ position: fixed;
+ top: 30px;
+ bottom: 30px;
+ left: 50%;
+ z-index: 100105;
+}
+
+.find-box-head {
+ background: #fcfcfc;
+ border-bottom: 1px solid #ddd;
+ height: 36px;
+ font-size: 18px;
+ font-weight: 600;
+ line-height: 36px;
+ padding: 0 36px 0 16px;
+ position: absolute;
+ top: 0;
+ left: 0;
+ right: 0;
+}
+
+.find-box-inside {
+ overflow: auto;
+ padding: 16px;
+ background-color: #fff;
+ position: absolute;
+ top: 37px;
+ bottom: 45px;
+ overflow-y: scroll;
+ width: 100%;
+ box-sizing: border-box;
+}
+
+.find-box-search {
+ padding-bottom: 16px;
+}
+
+.find-box-search .spinner {
+ float: none;
+ left: 105px;
+ position: absolute;
+}
+
+.find-box-search,
+#find-posts-response {
+ position: relative; /* RTL fix, #WP28010 */
+}
+
+#find-posts-input,
+#find-posts-search {
+ float: left;
+}
+
+#find-posts-input {
+ width: 140px;
+ height: 28px;
+ margin: 0 4px 0 0;
+}
+
+.widefat .found-radio {
+ padding-right: 0;
+ width: 16px;
+}
+
+#find-posts-close {
+ width: 36px;
+ height: 36px;
+ border: none;
+ padding: 0;
+ position: absolute;
+ top: 0;
+ right: 0;
+ cursor: pointer;
+ text-align: center;
+ background: none;
+ color: #666;
+}
+
+#find-posts-close:hover,
+#find-posts-close:focus {
+ color: #00a0d2;
+}
+
+#find-posts-close:focus {
+ box-shadow:
+ 0 0 0 1px #5b9dd9,
+ 0 0 2px 1px rgba(30, 140, 190, 0.8);
+ /* Only visible in Windows High Contrast mode */
+ outline: 2px solid transparent;
+ outline-offset: -2px;
+}
+
+#find-posts-close:before {
+ font: normal 20px/36px dashicons;
+ vertical-align: top;
+ speak: none;
+ -webkit-font-smoothing: antialiased;
+ -moz-osx-font-smoothing: grayscale;
+ content: "\f158";
+}
+
+.find-box-buttons {
+ padding: 8px 16px;
+ background: #fcfcfc;
+ border-top: 1px solid #ddd;
+ position: absolute;
+ bottom: 0;
+ left: 0;
+ right: 0;
+}
+
+@media screen and (max-width: 782px) {
+ .find-box-inside {
+ bottom: 57px;
+ }
+}
+
+@media screen and (max-width: 660px) {
+
+ .find-box {
+ top: 0;
+ bottom: 0;
+ left: 0;
+ right: 0;
+ margin: 0;
+ width: 100%;
+ }
+
+}
+
+.ui-find-overlay {
+ position: fixed;
+ top: 0;
+ left: 0;
+ right: 0;
+ bottom: 0;
+ background: #000;
+ opacity: 0.7;
+ filter: alpha(opacity=70);
+ z-index: 100100;
+}
+
+ul#dismissed-updates {
+ display: none;
+}
+
+form.upgrade {
+ margin-top: 8px;
+}
+
+form.upgrade .hint {
+ font-style: italic;
+ font-size: 85%;
+ margin: -0.5em 0 2em 0;
+}
+
+#poststuff .inside .the-tagcloud {
+ margin: 5px 0 10px;
+ padding: 8px;
+ border: 1px solid #ddd;
+ line-height: 1.8em;
+ word-spacing: 3px;
+}
+
+.drag-drop #drag-drop-area {
+ border: 4px dashed #b4b9be;
+ height: 200px;
+}
+
+.drag-drop .drag-drop-inside {
+ margin: 70px auto 0;
+ width: 250px;
+}
+
+.drag-drop-inside p {
+ color: #a0a5aa;
+ font-size: 14px;
+ margin: 5px 0;
+ display: none;
+}
+
+.drag-drop .drag-drop-inside p {
+ text-align: center;
+}
+
+.drag-drop-inside p.drag-drop-info {
+ font-size: 20px;
+}
+
+.drag-drop .drag-drop-inside p,
+.drag-drop-inside p.drag-drop-buttons {
+ display: block;
+}
+
+/*
+#drag-drop-area:-moz-drag-over {
+ border-color: #83b4d8;
+}
+border color while dragging a file over the uploader drop area */
+.drag-drop.drag-over #drag-drop-area {
+ border-color: #83b4d8;
+}
+
+#plupload-upload-ui {
+ position: relative;
+}
+
+/**
+ * Media Library grid view
+ */
+
+.media-frame.mode-grid,
+.media-frame.mode-grid .media-frame-content,
+.media-frame.mode-grid .attachments-browser .attachments,
+.media-frame.mode-grid .uploader-inline-content {
+ position: static;
+}
+
+/* Regions we don't use at all */
+.media-frame.mode-grid .media-frame-title,
+.media-frame.mode-grid .media-frame-router,
+.media-frame.mode-grid .media-frame-menu {
+ display: none;
+}
+
+.media-frame.mode-grid .media-frame-content {
+ background-color: transparent;
+ border: none;
+}
+
+.upload-php .mode-grid .media-sidebar {
+ position: relative;
+ width: auto;
+ margin-top: 12px;
+ padding: 0 16px;
+ border-left: 4px solid #dd3d36;
+ box-shadow: 0 1px 1px 0 rgba(0, 0, 0, 0.1);
+ background-color: #fff;
+}
+
+.upload-php .mode-grid .hide-sidebar .media-sidebar {
+ display: none;
+}
+
+.upload-php .mode-grid .media-sidebar .media-uploader-status {
+ border-bottom: none;
+ padding-bottom: 0;
+ max-width: 100%;
+}
+
+.upload-php .mode-grid .media-sidebar .upload-error {
+ margin: 12px 0;
+ padding: 4px 0 0;
+ border: none;
+ box-shadow: none;
+ background: none;
+}
+
+.upload-php .mode-grid .media-sidebar .media-uploader-status .upload-dismiss-errors {
+ top: -10px;
+ right: -14px;
+ padding: 10px;
+}
+
+.upload-php .mode-grid .media-sidebar .media-uploader-status .upload-dismiss-errors:before {
+ content: "\f153";
+ display: block;
+ font: normal 16px/1 dashicons;
+ color: #72777c;
+}
+
+.upload-php .mode-grid .media-sidebar .media-uploader-status .upload-dismiss-errors:focus:before,
+.upload-php .mode-grid .media-sidebar .media-uploader-status .upload-dismiss-errors:hover:before {
+ color: #c00;
+}
+
+.upload-php .mode-grid .media-sidebar .media-uploader-status.errors h3, /* Back-compat for pre-4.4 */
+.upload-php .mode-grid .media-sidebar .media-uploader-status.errors h2 {
+ display: none;
+}
+
+.media-frame.mode-grid .uploader-inline {
+ position: relative;
+ top: auto;
+ right: auto;
+ left: auto;
+ bottom: auto;
+ padding-top: 0;
+ margin-top: 20px;
+ border: 4px dashed #b4b9be;
+}
+
+.media-frame.mode-select .attachments-browser.fixed .attachments {
+ position: relative;
+ top: 94px; /* prevent jumping up when the toolbar becomes fixed */
+ padding-bottom: 94px; /* offset for above so the bottom doesn't get cut off */
+}
+
+.media-frame.mode-grid .attachment:focus,
+.media-frame.mode-grid .selected.attachment:focus,
+.media-frame.mode-grid .attachment.details:focus {
+ box-shadow:
+ inset 0 0 2px 3px #f1f1f1,
+ inset 0 0 0 7px #5b9dd9;
+ /* Only visible in Windows High Contrast mode */
+ outline: 2px solid transparent;
+ outline-offset: -6px;
+}
+
+.media-frame.mode-grid .selected.attachment {
+ box-shadow:
+ inset 0 0 0 5px #f1f1f1,
+ inset 0 0 0 7px #ccc;
+}
+
+.media-frame.mode-grid .attachment.details {
+ box-shadow:
+ inset 0 0 0 3px #f1f1f1,
+ inset 0 0 0 7px #1e8cbe;
+}
+
+.media-frame.mode-grid.mode-select .attachment .thumbnail {
+ opacity: 0.65;
+}
+
+.media-frame.mode-select .attachment.selected .thumbnail {
+ opacity: 1;
+}
+
+.media-frame.mode-grid .media-toolbar {
+ margin-bottom: 15px;
+ height: auto;
+}
+
+.media-frame.mode-grid .media-toolbar select {
+ margin: 0 10px 0 0;
+ font-size: 14px;
+}
+
+.media-frame.mode-grid.mode-edit .media-toolbar-secondary > .select-mode-toggle-button {
+ margin: 0 8px 0 0;
+ vertical-align: middle;
+}
+
+.media-frame.mode-grid .attachments-browser .bulk-select {
+ display: inline-block;
+ margin: 0 10px 0 0;
+}
+
+.media-frame.mode-grid .search {
+ margin-top: 0;
+}
+
+.media-frame.mode-grid .spinner {
+ margin-top: 16px;
+}
+
+.attachments-browser .media-toolbar-secondary > .media-button {
+ margin-right: 10px;
+}
+
+.media-frame.mode-select .attachments-browser.fixed .media-toolbar {
+ position: fixed;
+ top: 32px;
+ left: auto;
+ right: 20px;
+ margin-top: 0;
+}
+
+.media-frame.mode-grid .attachments-browser {
+ padding: 0;
+}
+
+.media-frame.mode-grid .attachments-browser .attachments {
+ padding: 2px;
+}
+
+.media-frame.mode-grid .attachments-browser .no-media {
+ color: #666; /* same as no plugins and no themes */
+ font-size: 18px;
+ font-style: normal;
+ margin: 0;
+ padding: 100px 0 0;
+ text-align: center;
+}
+
+/**
+ * Attachment details modal
+ */
+
+.edit-attachment-frame {
+ display: block;
+ height: 100%;
+ width: 100%;
+}
+
+.edit-attachment-frame .edit-media-header {
+ overflow: hidden;
+}
+
+.upload-php .media-modal-close .media-modal-icon:before {
+ content: "\f335";
+ font-size: 22px;
+}
+
+.upload-php .media-modal-close,
+.edit-attachment-frame .edit-media-header .left,
+.edit-attachment-frame .edit-media-header .right {
+ cursor: pointer;
+ color: #72777c;
+ background-color: transparent;
+ height: 50px;
+ width: 50px;
+ padding: 0;
+ position: absolute;
+ text-align: center;
+ border: 0;
+ border-left: 1px solid #ddd;
+ transition: color .1s ease-in-out, background .1s ease-in-out;
+}
+
+.upload-php .media-modal-close {
+ top: 0;
+ right: 0;
+}
+
+.edit-attachment-frame .edit-media-header .left {
+ right: 102px;
+}
+
+.edit-attachment-frame .edit-media-header .right {
+ right: 51px;
+}
+
+.edit-attachment-frame .media-frame-title {
+ left: 0;
+ right: 150px; /* leave space for prev/next/close */
+}
+
+.edit-attachment-frame .edit-media-header .right:before,
+.edit-attachment-frame .edit-media-header .left:before {
+ font: normal 20px/50px dashicons !important;
+ display: inline;
+ font-weight: 300;
+}
+
+.upload-php .media-modal-close:hover,
+.upload-php .media-modal-close:focus,
+.edit-attachment-frame .edit-media-header .left:hover,
+.edit-attachment-frame .edit-media-header .right:hover,
+.edit-attachment-frame .edit-media-header .left:focus,
+.edit-attachment-frame .edit-media-header .right:focus {
+ background: #ddd;
+ border-color: #ccc;
+ color: #000;
+ outline: none;
+ box-shadow: none;
+}
+
+.upload-php .media-modal-close:focus,
+.edit-attachment-frame .edit-media-header .left:focus,
+.edit-attachment-frame .edit-media-header .right:focus {
+ /* Only visible in Windows High Contrast mode */
+ outline: 2px solid transparent;
+ outline-offset: -2px;
+}
+
+.upload-php .media-modal-close:focus .media-modal-icon:before,
+.upload-php .media-modal-close:hover .media-modal-icon:before {
+ color: #000;
+}
+
+.edit-attachment-frame .edit-media-header .left:before {
+ content: "\f341";
+}
+
+.edit-attachment-frame .edit-media-header .right:before {
+ content: "\f345";
+}
+
+.edit-attachment-frame .edit-media-header .left.disabled,
+.edit-attachment-frame .edit-media-header .right.disabled,
+.edit-attachment-frame .edit-media-header .left.disabled:hover,
+.edit-attachment-frame .edit-media-header .right.disabled:hover {
+ color: #ccc;
+ background: inherit;
+ cursor: default;
+ pointer-events: none;
+}
+
+.edit-attachment-frame .media-frame-content,
+.edit-attachment-frame .media-frame-router {
+ left: 0;
+}
+
+.edit-attachment-frame .media-frame-content {
+ border-bottom: none;
+ bottom: 0;
+ top: 50px;
+}
+
+.edit-attachment-frame .attachment-details {
+ position: absolute;
+ overflow: auto;
+ top: 0;
+ bottom: 0;
+ right: 0;
+ left: 0;
+ box-shadow: inset 0px 4px 4px -4px rgba(0, 0, 0, 0.1);
+}
+
+.edit-attachment-frame .attachment-media-view {
+ float: left;
+ width: 65%;
+ height: 100%;
+}
+
+.edit-attachment-frame .attachment-media-view .thumbnail {
+ box-sizing: border-box;
+ padding: 16px;
+ height: 100%;
+}
+
+.edit-attachment-frame .attachment-media-view .details-image {
+ display: block;
+ margin: 0 auto 16px;
+ max-width: 100%;
+ max-height: 90%;
+ max-height: calc( 100% - 42px ); /* leave space for actions underneath */
+ background-image: linear-gradient(45deg, #c4c4c4 25%, transparent 25%, transparent 75%, #c4c4c4 75%, #c4c4c4), linear-gradient(45deg, #c4c4c4 25%, transparent 25%, transparent 75%, #c4c4c4 75%, #c4c4c4);
+ background-position: 0 0, 10px 10px;
+ background-size: 20px 20px;
+}
+
+.edit-attachment-frame .attachment-media-view .details-image.icon {
+ background: none;
+}
+
+.edit-attachment-frame .attachment-media-view .attachment-actions {
+ text-align: center;
+}
+
+.edit-attachment-frame .wp-media-wrapper {
+ margin-bottom: 12px;
+}
+
+.edit-attachment-frame input,
+.edit-attachment-frame textarea {
+ padding: 6px 8px;
+ line-height: 16px;
+}
+
+.edit-attachment-frame .attachment-info {
+ overflow: auto;
+ box-sizing: border-box;
+ margin-bottom: 0;
+ padding: 12px 16px 0;
+ width: 35%;
+ height: 100%;
+ box-shadow: inset 0px 4px 4px -4px rgba(0, 0, 0, 0.1);
+ border-bottom: 0;
+ border-left: 1px solid #ddd;
+ background: #f3f3f3;
+}
+
+.edit-attachment-frame .attachment-info .details,
+.edit-attachment-frame .attachment-info .settings {
+ position: relative; /* RTL fix, #WP29352 */
+ overflow: hidden;
+ float: none;
+ margin-bottom: 15px;
+ padding-bottom: 15px;
+ border-bottom: 1px solid #ddd;
+}
+
+.edit-attachment-frame .attachment-info .filename {
+ font-weight: 400;
+ color: #666;
+}
+
+.edit-attachment-frame .attachment-info .thumbnail {
+ margin-bottom: 12px;
+}
+
+.attachment-info .actions {
+ margin-bottom: 16px;
+}
+
+.attachment-info .actions a {
+ display: inline;
+ text-decoration: none;
+}
+
+
+/*------------------------------------------------------------------------------
+ 14.2 - Image Editor
+------------------------------------------------------------------------------*/
+.wp_attachment_details .attachment-alt-text {
+ margin-bottom: 5px;
+}
+
+.wp_attachment_details .attachment-alt-text-description {
+ margin-top: 5px;
+}
+
+.wp_attachment_details label[for="content"] {
+ font-size: 13px;
+ line-height: 1.5;
+ margin: 1em 0;
+}
+
+.wp_attachment_details #attachment_caption {
+ height: 4em;
+}
+
+.describe .image-editor {
+ vertical-align: top;
+}
+
+.imgedit-wrap {
+ position: relative;
+ padding-top: 10px;
+}
+
+.imgedit-settings p,
+.imgedit-settings fieldset {
+ margin: 8px 0;
+}
+
+.imgedit-settings legend {
+ margin-bottom: 5px;
+}
+
+.describe .imgedit-wrap .imgedit-settings {
+ padding: 0 5px;
+}
+
+.wp_attachment_holder div.updated {
+ margin-top: 0;
+}
+
+.wp_attachment_holder .imgedit-wrap > div {
+ height: auto;
+}
+
+.wp_attachment_holder .imgedit-wrap .imgedit-panel-content {
+ padding: 3px 16px 0 0;
+ float: left;
+}
+
+.wp_attachment_holder .imgedit-wrap .imgedit-settings {
+ float: right;
+ width: 250px;
+}
+
+.imgedit-settings input {
+ margin-top: 0;
+ vertical-align: middle;
+}
+
+.imgedit-wait {
+ position: absolute;
+ top: 0;
+ bottom: 0;
+ width: 100%;
+ background: #fff;
+ opacity: 0.7;
+ filter: alpha(opacity=70);
+ display: none;
+}
+
+.imgedit-wait:before {
+ content: "";
+ display: block;
+ width: 20px;
+ height: 20px;
+ position: absolute;
+ left: 50%;
+ top: 50%;
+ margin: -10px 0 0 -10px;
+ background: transparent url(../images/spinner.gif) no-repeat center;
+ background-size: 20px 20px;
+ transform: translateZ(0);
+}
+
+.no-float {
+ float: none;
+}
+
+.media-disabled,
+.imgedit-settings .disabled {
+ /* WCAG 1.4.3 Text or images of text that are part of an inactive user
+ interface component ... have no contrast requirement. */
+ color: #a0a5aa;
+}
+
+.A1B1 {
+ overflow: hidden;
+}
+
+.wp_attachment_image .button,
+.A1B1 .button {
+ float: left;
+}
+
+.no-js .wp_attachment_image .button {
+ display: none;
+}
+
+.wp_attachment_image .spinner,
+.A1B1 .spinner {
+ float: left;
+}
+
+.imgedit-menu {
+ min-width: 300px;
+ margin: 0 0 12px;
+}
+
+.imgedit-menu .note-no-rotate {
+ clear: both;
+ margin: 0;
+ padding: 1em 0 0;
+}
+
+.image-editor .imgedit-menu .button {
+ float: left;
+ width: 32px;
+ height: 32px;
+ margin: 0 8px 0 0;
+ padding: 0;
+ background: #f1f1f1;
+ -webkit-font-smoothing: antialiased;
+ -moz-osx-font-smoothing: grayscale;
+ line-height: 16px;
+ color: #72777c;
+}
+
+.imgedit-menu .button:before {
+ font: normal 20px/1 dashicons;
+ speak: none;
+ vertical-align: middle;
+}
+
+.imgedit-menu .button.disabled {
+ border-color: #ccc;
+ background-color: #ddd;
+ color: #72777c;
+ filter: alpha(opacity=50);
+ opacity: 0.5;
+ cursor: default;
+}
+
+.imgedit-crop:before {
+ content: "\f165";
+}
+
+.imgedit-rleft:before {
+ content: "\f166";
+}
+
+.imgedit-rright:before {
+ content: "\f167";
+}
+
+.imgedit-flipv:before {
+ content: "\f168";
+}
+
+.imgedit-fliph:before {
+ content: "\f169";
+}
+
+.imgedit-undo:before {
+ content: "\f171";
+}
+
+.imgedit-redo:before {
+ content: "\f172";
+}
+
+.imgedit-crop-wrap {
+ position: relative;
+}
+
+.imgedit-crop-wrap img {
+ background-image: linear-gradient(45deg, #c4c4c4 25%, transparent 25%, transparent 75%, #c4c4c4 75%, #c4c4c4), linear-gradient(45deg, #c4c4c4 25%, transparent 25%, transparent 75%, #c4c4c4 75%, #c4c4c4);
+ background-position: 0 0, 10px 10px;
+ background-size: 20px 20px;
+}
+
+.imgedit-crop {
+ margin: 0 8px 0 0;
+}
+
+.imgedit-rleft {
+ margin: 0 3px;
+}
+
+.imgedit-rright {
+ margin: 0 8px 0 3px;
+}
+
+.imgedit-flipv {
+ margin: 0 3px;
+}
+
+.imgedit-fliph {
+ margin: 0 8px 0 3px;
+}
+
+.imgedit-undo {
+ margin: 0 3px;
+}
+
+.imgedit-redo {
+ margin: 0 8px 0 3px;
+}
+
+.imgedit-thumbnail-preview {
+ margin: 10px 8px 0 0;
+}
+
+.imgedit-thumbnail-preview-caption {
+ display: block;
+}
+
+#poststuff .imgedit-group-top h3, /* Back-compat for pre-4.4 */
+#poststuff .imgedit-group-top h2 {
+ display: inline-block;
+ margin: 0;
+ padding: 0;
+ font-size: 14px;
+ line-height: 1.4;
+}
+
+#poststuff .imgedit-group-top .button-link {
+ text-decoration: none;
+ color: #23282d;
+}
+
+.imgedit-applyto .imgedit-label {
+ display: block;
+ padding: .5em 0 0;
+}
+
+.imgedit-help {
+ display: none;
+ font-style: italic;
+}
+
+/* higher specificity than buttons */
+.image-editor .imgedit-settings .imgedit-help-toggle,
+.image-editor .imgedit-settings .imgedit-help-toggle:hover,
+.image-editor .imgedit-settings .imgedit-help-toggle:active {
+ border: 1px solid transparent;
+ margin: -1px 0 0 -1px;
+ padding: 0;
+ background: transparent;
+ color: #0074a2;
+ font-size: 20px;
+ line-height: 1;
+ cursor: pointer;
+ box-sizing: content-box;
+ box-shadow: none;
+}
+
+.image-editor .imgedit-settings .imgedit-help-toggle:focus {
+ color: #0074a2;
+ border-color: #5b9dd9;
+ box-shadow: 0 0 3px rgba(0, 115, 170, 0.8);
+ /* Only visible in Windows High Contrast mode */
+ outline: 2px solid transparent;
+}
+
+.form-table td.imgedit-response {
+ padding: 0;
+}
+
+.imgedit-submit {
+ margin: 8px 0 0;
+}
+
+.imgedit-submit-btn {
+ margin-left: 20px;
+}
+
+.imgedit-wrap .nowrap {
+ white-space: nowrap;
+ font-size: 12px;
+ line-height: inherit;
+}
+
+span.imgedit-scale-warn {
+ color: #dc3232;
+ font-size: 20px;
+ font-style: normal;
+ visibility: hidden;
+ vertical-align: middle;
+}
+
+.imgedit-save-target {
+ margin: 8px 0;
+}
+
+.imgedit-group {
+ margin-bottom: 8px;
+ padding: 10px;
+}
+
+.imgedit-settings .imgedit-scale input[type="text"],
+.imgedit-settings .imgedit-crop-ratio input[type="text"],
+.imgedit-settings .imgedit-crop-sel input[type="text"] {
+ width: 50px;
+ font-size: 14px;
+ padding: 5px 8px;
+}
+
+.imgedit-separator {
+ display: inline-block;
+ width: 7px;
+ text-align: center;
+ vertical-align: middle;
+ font-size: 13px;
+ color: #444;
+}
+
+.imgedit-settings .imgedit-scale .button {
+ margin-bottom: 0;
+}
+
+audio, video {
+ display: inline-block;
+ max-width: 100%;
+}
+
+.mejs-container {
+ width: 100%;
+ max-width: 100%;
+}
+
+/* =Media Queries
+-------------------------------------------------------------- */
+
+/**
+ * HiDPI Displays
+ */
+@media print,
+ (-webkit-min-device-pixel-ratio: 1.25),
+ (min-resolution: 120dpi) {
+ .imgedit-wait:before {
+ background-image: url(../images/spinner-2x.gif);
+ }
+}
+
+@media screen and (max-width: 782px) {
+ .wp_attachment_details label[for="content"] {
+ font-size: 14px;
+ line-height: 1.5em;
+ }
+
+ .media-upload-form .media-item.error,
+ .media-upload-form .media-item .error {
+ font-size: 13px;
+ line-height: 1.5;
+ }
+
+ .media-upload-form .media-item.error {
+ padding: 1px 10px;
+ }
+
+ .media-upload-form .media-item .error {
+ padding: 10px 0 10px 12px;
+ }
+
+ .imgedit-settings .imgedit-scale input[type="text"],
+ .imgedit-settings .imgedit-crop-ratio input[type="text"],
+ .imgedit-settings .imgedit-crop-sel input[type="text"] {
+ width: 60px;
+ font-size: 16px;
+ padding: 6px 10px;
+ }
+
+ .imgedit-applyto .imgedit-label {
+ vertical-align: middle;
+ }
+}
+
+/**
+ * Media queries for media grid.
+ */
+
+@media only screen and (max-width: 1120px) {
+ /* override for media-views.css */
+ #wp-media-grid .wp-filter .attachment-filters {
+ max-width: 100%;
+ }
+}
+
+@media only screen and (max-width: 782px) {
+ .media-frame.mode-select .attachments-browser.fixed .media-toolbar {
+ top: 46px;
+ right: 10px;
+ }
+}
+
+@media only screen and (max-width: 600px) {
+ .media-frame.mode-select .attachments-browser.fixed .media-toolbar {
+ top: 0;
+ }
+}
+
+@media only screen and (max-width: 480px) {
+ .edit-attachment-frame .media-frame-title {
+ right: 110px;
+ }
+
+ .upload-php .media-modal-close,
+ .edit-attachment-frame .edit-media-header .left,
+ .edit-attachment-frame .edit-media-header .right {
+ width: 40px;
+ height: 40px;
+ }
+
+ .upload-php .media-modal-close .media-modal-icon {
+ margin: 9px 10px;
+ }
+
+ .edit-attachment-frame .edit-media-header .right:before,
+ .edit-attachment-frame .edit-media-header .left:before {
+ line-height: 40px !important;
+ }
+
+ .edit-attachment-frame .edit-media-header .left {
+ right: 82px;
+ }
+
+ .edit-attachment-frame .edit-media-header .right {
+ right: 41px;
+ }
+
+ .edit-attachment-frame .media-frame-content {
+ top: 40px;
+ }
+
+ .edit-attachment-frame .attachment-media-view {
+ float: none;
+ height: auto;
+ width: 100%;
+ }
+
+ .edit-attachment-frame .attachment-info {
+ height: auto;
+ width: 100%;
+ }
+}
+
+@media only screen and (max-width: 640px), screen and (max-height: 400px) {
+ .upload-php .mode-grid .media-sidebar{
+ max-width: 100%;
+ }
+}
diff --git a/www/crm/wp-admin/css/media.min.css b/www/crm/wp-admin/css/media.min.css
new file mode 100644
index 00000000..6fdad965
--- /dev/null
+++ b/www/crm/wp-admin/css/media.min.css
@@ -0,0 +1,2 @@
+/*! This file is auto-generated */
+.media-item .describe{border-collapse:collapse;width:100%;border-top:1px solid #ddd;clear:both;cursor:default}.media-item.media-blank .describe{border:0}.media-item .describe th{vertical-align:top;text-align:left;padding:5px 10px 10px;width:140px}.media-item .describe .align th{padding-top:0}.media-item .media-item-info tr{background-color:transparent}.media-item .describe td{padding:0 8px 8px 0;vertical-align:top}.media-item thead.media-item-info td{padding:4px 10px 0}.media-item .media-item-info .A1B1{padding:0 0 0 10px}.media-item td.savesend{padding-bottom:15px}.media-item .thumbnail{max-height:128px;max-width:128px}#wpbody-content #async-upload-wrap a{display:none}.media-upload-form{margin-top:20px}.media-upload-form td label{margin-right:6px;margin-left:2px}.media-upload-form .align .field label{display:inline;padding:0 0 0 23px;margin:0 1em 0 3px;font-weight:600}.media-upload-form tr.image-size label{margin:0 0 0 5px;font-weight:600}.media-upload-form th.label label{font-weight:600;margin:.5em;font-size:13px}.media-upload-form th.label label span{padding:0 5px}.media-item .describe input[type=text],.media-item .describe textarea{width:460px}.media-item .describe p.help{margin:0;padding:0 0 0 5px}.describe-toggle-off,.describe-toggle-on,.media-item .edit-attachment{display:block;line-height:36px;float:right;margin-right:10px}.media-item .describe-toggle-off,.media-item.open .describe-toggle-on{display:none}.media-item.open .describe-toggle-off{display:block}.media-upload-form .media-item{min-height:36px;margin-bottom:1px;position:relative;width:100%;background:#fff}.media-upload-form .media-item,.media-upload-form .media-item .error{box-shadow:0 1px 0 #ddd}#media-items:empty{border:0 none}.media-item .filename{line-height:36px;overflow:hidden;margin-left:6px}.media-item .pinkynail{float:left;margin:2px 10px 0 3px;max-width:40px;max-height:32px}.media-item .startclosed,.media-item .startopen{display:none}.media-item .original{position:relative;height:34px}.media-item .progress{float:right;height:22px;margin:7px 6px;width:200px;line-height:2em;padding:0;overflow:hidden;border-radius:22px;background:#ddd;box-shadow:inset 0 1px 2px rgba(0,0,0,.1)}.media-item .bar{z-index:9;width:0;height:100%;margin-top:-22px;border-radius:22px;background-color:#0073aa;box-shadow:inset 0 0 2px rgba(0,0,0,.3)}.media-item .progress .percent{z-index:10;position:relative;width:200px;padding:0;color:#fff;text-align:center;line-height:22px;font-weight:400;text-shadow:0 1px 2px rgba(0,0,0,.2)}.upload-php .fixed .column-parent{width:15%}.js .html-uploader #plupload-upload-ui{display:none}.js .html-uploader #html-upload-ui{display:block}.media-upload-form .media-item .error,.media-upload-form .media-item.error{width:auto;margin:0 0 1px 0}.media-upload-form .media-item .error{padding:10px 0 10px 14px}.media-item .error-div button.dismiss{float:right;margin:0 10px 0 15px}.find-box{background-color:#fff;box-shadow:0 3px 6px rgba(0,0,0,.3);width:600px;overflow:hidden;margin-left:-300px;position:fixed;top:30px;bottom:30px;left:50%;z-index:100105}.find-box-head{background:#fcfcfc;border-bottom:1px solid #ddd;height:36px;font-size:18px;font-weight:600;line-height:36px;padding:0 36px 0 16px;position:absolute;top:0;left:0;right:0}.find-box-inside{overflow:auto;padding:16px;background-color:#fff;position:absolute;top:37px;bottom:45px;overflow-y:scroll;width:100%;box-sizing:border-box}.find-box-search{padding-bottom:16px}.find-box-search .spinner{float:none;left:105px;position:absolute}#find-posts-response,.find-box-search{position:relative}#find-posts-input,#find-posts-search{float:left}#find-posts-input{width:140px;height:28px;margin:0 4px 0 0}.widefat .found-radio{padding-right:0;width:16px}#find-posts-close{width:36px;height:36px;border:none;padding:0;position:absolute;top:0;right:0;cursor:pointer;text-align:center;background:0 0;color:#666}#find-posts-close:focus,#find-posts-close:hover{color:#00a0d2}#find-posts-close:focus{box-shadow:0 0 0 1px #5b9dd9,0 0 2px 1px rgba(30,140,190,.8);outline:2px solid transparent;outline-offset:-2px}#find-posts-close:before{font:normal 20px/36px dashicons;vertical-align:top;speak:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;content:"\f158"}.find-box-buttons{padding:8px 16px;background:#fcfcfc;border-top:1px solid #ddd;position:absolute;bottom:0;left:0;right:0}@media screen and (max-width:782px){.find-box-inside{bottom:57px}}@media screen and (max-width:660px){.find-box{top:0;bottom:0;left:0;right:0;margin:0;width:100%}}.ui-find-overlay{position:fixed;top:0;left:0;right:0;bottom:0;background:#000;opacity:.7;filter:alpha(opacity=70);z-index:100100}ul#dismissed-updates{display:none}form.upgrade{margin-top:8px}form.upgrade .hint{font-style:italic;font-size:85%;margin:-.5em 0 2em 0}#poststuff .inside .the-tagcloud{margin:5px 0 10px;padding:8px;border:1px solid #ddd;line-height:1.8em;word-spacing:3px}.drag-drop #drag-drop-area{border:4px dashed #b4b9be;height:200px}.drag-drop .drag-drop-inside{margin:70px auto 0;width:250px}.drag-drop-inside p{color:#a0a5aa;font-size:14px;margin:5px 0;display:none}.drag-drop .drag-drop-inside p{text-align:center}.drag-drop-inside p.drag-drop-info{font-size:20px}.drag-drop .drag-drop-inside p,.drag-drop-inside p.drag-drop-buttons{display:block}.drag-drop.drag-over #drag-drop-area{border-color:#83b4d8}#plupload-upload-ui{position:relative}.media-frame.mode-grid,.media-frame.mode-grid .attachments-browser .attachments,.media-frame.mode-grid .media-frame-content,.media-frame.mode-grid .uploader-inline-content{position:static}.media-frame.mode-grid .media-frame-menu,.media-frame.mode-grid .media-frame-router,.media-frame.mode-grid .media-frame-title{display:none}.media-frame.mode-grid .media-frame-content{background-color:transparent;border:none}.upload-php .mode-grid .media-sidebar{position:relative;width:auto;margin-top:12px;padding:0 16px;border-left:4px solid #dd3d36;box-shadow:0 1px 1px 0 rgba(0,0,0,.1);background-color:#fff}.upload-php .mode-grid .hide-sidebar .media-sidebar{display:none}.upload-php .mode-grid .media-sidebar .media-uploader-status{border-bottom:none;padding-bottom:0;max-width:100%}.upload-php .mode-grid .media-sidebar .upload-error{margin:12px 0;padding:4px 0 0;border:none;box-shadow:none;background:0 0}.upload-php .mode-grid .media-sidebar .media-uploader-status .upload-dismiss-errors{top:-10px;right:-14px;padding:10px}.upload-php .mode-grid .media-sidebar .media-uploader-status .upload-dismiss-errors:before{content:"\f153";display:block;font:normal 16px/1 dashicons;color:#72777c}.upload-php .mode-grid .media-sidebar .media-uploader-status .upload-dismiss-errors:focus:before,.upload-php .mode-grid .media-sidebar .media-uploader-status .upload-dismiss-errors:hover:before{color:#c00}.upload-php .mode-grid .media-sidebar .media-uploader-status.errors h2,.upload-php .mode-grid .media-sidebar .media-uploader-status.errors h3{display:none}.media-frame.mode-grid .uploader-inline{position:relative;top:auto;right:auto;left:auto;bottom:auto;padding-top:0;margin-top:20px;border:4px dashed #b4b9be}.media-frame.mode-select .attachments-browser.fixed .attachments{position:relative;top:94px;padding-bottom:94px}.media-frame.mode-grid .attachment.details:focus,.media-frame.mode-grid .attachment:focus,.media-frame.mode-grid .selected.attachment:focus{box-shadow:inset 0 0 2px 3px #f1f1f1,inset 0 0 0 7px #5b9dd9;outline:2px solid transparent;outline-offset:-6px}.media-frame.mode-grid .selected.attachment{box-shadow:inset 0 0 0 5px #f1f1f1,inset 0 0 0 7px #ccc}.media-frame.mode-grid .attachment.details{box-shadow:inset 0 0 0 3px #f1f1f1,inset 0 0 0 7px #1e8cbe}.media-frame.mode-grid.mode-select .attachment .thumbnail{opacity:.65}.media-frame.mode-select .attachment.selected .thumbnail{opacity:1}.media-frame.mode-grid .media-toolbar{margin-bottom:15px;height:auto}.media-frame.mode-grid .media-toolbar select{margin:0 10px 0 0;font-size:14px}.media-frame.mode-grid.mode-edit .media-toolbar-secondary>.select-mode-toggle-button{margin:0 8px 0 0;vertical-align:middle}.media-frame.mode-grid .attachments-browser .bulk-select{display:inline-block;margin:0 10px 0 0}.media-frame.mode-grid .search{margin-top:0}.media-frame.mode-grid .spinner{margin-top:16px}.attachments-browser .media-toolbar-secondary>.media-button{margin-right:10px}.media-frame.mode-select .attachments-browser.fixed .media-toolbar{position:fixed;top:32px;left:auto;right:20px;margin-top:0}.media-frame.mode-grid .attachments-browser{padding:0}.media-frame.mode-grid .attachments-browser .attachments{padding:2px}.media-frame.mode-grid .attachments-browser .no-media{color:#666;font-size:18px;font-style:normal;margin:0;padding:100px 0 0;text-align:center}.edit-attachment-frame{display:block;height:100%;width:100%}.edit-attachment-frame .edit-media-header{overflow:hidden}.upload-php .media-modal-close .media-modal-icon:before{content:"\f335";font-size:22px}.edit-attachment-frame .edit-media-header .left,.edit-attachment-frame .edit-media-header .right,.upload-php .media-modal-close{cursor:pointer;color:#72777c;background-color:transparent;height:50px;width:50px;padding:0;position:absolute;text-align:center;border:0;border-left:1px solid #ddd;transition:color .1s ease-in-out,background .1s ease-in-out}.upload-php .media-modal-close{top:0;right:0}.edit-attachment-frame .edit-media-header .left{right:102px}.edit-attachment-frame .edit-media-header .right{right:51px}.edit-attachment-frame .media-frame-title{left:0;right:150px}.edit-attachment-frame .edit-media-header .left:before,.edit-attachment-frame .edit-media-header .right:before{font:normal 20px/50px dashicons!important;display:inline;font-weight:300}.edit-attachment-frame .edit-media-header .left:focus,.edit-attachment-frame .edit-media-header .left:hover,.edit-attachment-frame .edit-media-header .right:focus,.edit-attachment-frame .edit-media-header .right:hover,.upload-php .media-modal-close:focus,.upload-php .media-modal-close:hover{background:#ddd;border-color:#ccc;color:#000;outline:0;box-shadow:none}.edit-attachment-frame .edit-media-header .left:focus,.edit-attachment-frame .edit-media-header .right:focus,.upload-php .media-modal-close:focus{outline:2px solid transparent;outline-offset:-2px}.upload-php .media-modal-close:focus .media-modal-icon:before,.upload-php .media-modal-close:hover .media-modal-icon:before{color:#000}.edit-attachment-frame .edit-media-header .left:before{content:"\f341"}.edit-attachment-frame .edit-media-header .right:before{content:"\f345"}.edit-attachment-frame .edit-media-header .left.disabled,.edit-attachment-frame .edit-media-header .left.disabled:hover,.edit-attachment-frame .edit-media-header .right.disabled,.edit-attachment-frame .edit-media-header .right.disabled:hover{color:#ccc;background:inherit;cursor:default;pointer-events:none}.edit-attachment-frame .media-frame-content,.edit-attachment-frame .media-frame-router{left:0}.edit-attachment-frame .media-frame-content{border-bottom:none;bottom:0;top:50px}.edit-attachment-frame .attachment-details{position:absolute;overflow:auto;top:0;bottom:0;right:0;left:0;box-shadow:inset 0 4px 4px -4px rgba(0,0,0,.1)}.edit-attachment-frame .attachment-media-view{float:left;width:65%;height:100%}.edit-attachment-frame .attachment-media-view .thumbnail{box-sizing:border-box;padding:16px;height:100%}.edit-attachment-frame .attachment-media-view .details-image{display:block;margin:0 auto 16px;max-width:100%;max-height:90%;max-height:calc(100% - 42px);background-image:linear-gradient(45deg,#c4c4c4 25%,transparent 25%,transparent 75%,#c4c4c4 75%,#c4c4c4),linear-gradient(45deg,#c4c4c4 25%,transparent 25%,transparent 75%,#c4c4c4 75%,#c4c4c4);background-position:0 0,10px 10px;background-size:20px 20px}.edit-attachment-frame .attachment-media-view .details-image.icon{background:0 0}.edit-attachment-frame .attachment-media-view .attachment-actions{text-align:center}.edit-attachment-frame .wp-media-wrapper{margin-bottom:12px}.edit-attachment-frame input,.edit-attachment-frame textarea{padding:6px 8px;line-height:16px}.edit-attachment-frame .attachment-info{overflow:auto;box-sizing:border-box;margin-bottom:0;padding:12px 16px 0;width:35%;height:100%;box-shadow:inset 0 4px 4px -4px rgba(0,0,0,.1);border-bottom:0;border-left:1px solid #ddd;background:#f3f3f3}.edit-attachment-frame .attachment-info .details,.edit-attachment-frame .attachment-info .settings{position:relative;overflow:hidden;float:none;margin-bottom:15px;padding-bottom:15px;border-bottom:1px solid #ddd}.edit-attachment-frame .attachment-info .filename{font-weight:400;color:#666}.edit-attachment-frame .attachment-info .thumbnail{margin-bottom:12px}.attachment-info .actions{margin-bottom:16px}.attachment-info .actions a{display:inline;text-decoration:none}.wp_attachment_details .attachment-alt-text{margin-bottom:5px}.wp_attachment_details .attachment-alt-text-description{margin-top:5px}.wp_attachment_details label[for=content]{font-size:13px;line-height:1.5;margin:1em 0}.wp_attachment_details #attachment_caption{height:4em}.describe .image-editor{vertical-align:top}.imgedit-wrap{position:relative;padding-top:10px}.imgedit-settings fieldset,.imgedit-settings p{margin:8px 0}.imgedit-settings legend{margin-bottom:5px}.describe .imgedit-wrap .imgedit-settings{padding:0 5px}.wp_attachment_holder div.updated{margin-top:0}.wp_attachment_holder .imgedit-wrap>div{height:auto}.wp_attachment_holder .imgedit-wrap .imgedit-panel-content{padding:3px 16px 0 0;float:left}.wp_attachment_holder .imgedit-wrap .imgedit-settings{float:right;width:250px}.imgedit-settings input{margin-top:0;vertical-align:middle}.imgedit-wait{position:absolute;top:0;bottom:0;width:100%;background:#fff;opacity:.7;filter:alpha(opacity=70);display:none}.imgedit-wait:before{content:"";display:block;width:20px;height:20px;position:absolute;left:50%;top:50%;margin:-10px 0 0 -10px;background:transparent url(../images/spinner.gif) no-repeat center;background-size:20px 20px;transform:translateZ(0)}.no-float{float:none}.imgedit-settings .disabled,.media-disabled{color:#a0a5aa}.A1B1{overflow:hidden}.A1B1 .button,.wp_attachment_image .button{float:left}.no-js .wp_attachment_image .button{display:none}.A1B1 .spinner,.wp_attachment_image .spinner{float:left}.imgedit-menu{min-width:300px;margin:0 0 12px}.imgedit-menu .note-no-rotate{clear:both;margin:0;padding:1em 0 0}.image-editor .imgedit-menu .button{float:left;width:32px;height:32px;margin:0 8px 0 0;padding:0;background:#f1f1f1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;line-height:16px;color:#72777c}.imgedit-menu .button:before{font:normal 20px/1 dashicons;speak:none;vertical-align:middle}.imgedit-menu .button.disabled{border-color:#ccc;background-color:#ddd;color:#72777c;filter:alpha(opacity=50);opacity:.5;cursor:default}.imgedit-crop:before{content:"\f165"}.imgedit-rleft:before{content:"\f166"}.imgedit-rright:before{content:"\f167"}.imgedit-flipv:before{content:"\f168"}.imgedit-fliph:before{content:"\f169"}.imgedit-undo:before{content:"\f171"}.imgedit-redo:before{content:"\f172"}.imgedit-crop-wrap{position:relative}.imgedit-crop-wrap img{background-image:linear-gradient(45deg,#c4c4c4 25%,transparent 25%,transparent 75%,#c4c4c4 75%,#c4c4c4),linear-gradient(45deg,#c4c4c4 25%,transparent 25%,transparent 75%,#c4c4c4 75%,#c4c4c4);background-position:0 0,10px 10px;background-size:20px 20px}.imgedit-crop{margin:0 8px 0 0}.imgedit-rleft{margin:0 3px}.imgedit-rright{margin:0 8px 0 3px}.imgedit-flipv{margin:0 3px}.imgedit-fliph{margin:0 8px 0 3px}.imgedit-undo{margin:0 3px}.imgedit-redo{margin:0 8px 0 3px}.imgedit-thumbnail-preview{margin:10px 8px 0 0}.imgedit-thumbnail-preview-caption{display:block}#poststuff .imgedit-group-top h2,#poststuff .imgedit-group-top h3{display:inline-block;margin:0;padding:0;font-size:14px;line-height:1.4}#poststuff .imgedit-group-top .button-link{text-decoration:none;color:#23282d}.imgedit-applyto .imgedit-label{display:block;padding:.5em 0 0}.imgedit-help{display:none;font-style:italic}.image-editor .imgedit-settings .imgedit-help-toggle,.image-editor .imgedit-settings .imgedit-help-toggle:active,.image-editor .imgedit-settings .imgedit-help-toggle:hover{border:1px solid transparent;margin:-1px 0 0 -1px;padding:0;background:0 0;color:#0074a2;font-size:20px;line-height:1;cursor:pointer;box-sizing:content-box;box-shadow:none}.image-editor .imgedit-settings .imgedit-help-toggle:focus{color:#0074a2;border-color:#5b9dd9;box-shadow:0 0 3px rgba(0,115,170,.8);outline:2px solid transparent}.form-table td.imgedit-response{padding:0}.imgedit-submit{margin:8px 0 0}.imgedit-submit-btn{margin-left:20px}.imgedit-wrap .nowrap{white-space:nowrap;font-size:12px;line-height:inherit}span.imgedit-scale-warn{color:#dc3232;font-size:20px;font-style:normal;visibility:hidden;vertical-align:middle}.imgedit-save-target{margin:8px 0}.imgedit-group{margin-bottom:8px;padding:10px}.imgedit-settings .imgedit-crop-ratio input[type=text],.imgedit-settings .imgedit-crop-sel input[type=text],.imgedit-settings .imgedit-scale input[type=text]{width:50px;font-size:14px;padding:5px 8px}.imgedit-separator{display:inline-block;width:7px;text-align:center;vertical-align:middle;font-size:13px;color:#444}.imgedit-settings .imgedit-scale .button{margin-bottom:0}audio,video{display:inline-block;max-width:100%}.mejs-container{width:100%;max-width:100%}@media print,(-webkit-min-device-pixel-ratio:1.25),(min-resolution:120dpi){.imgedit-wait:before{background-image:url(../images/spinner-2x.gif)}}@media screen and (max-width:782px){.wp_attachment_details label[for=content]{font-size:14px;line-height:1.5em}.media-upload-form .media-item .error,.media-upload-form .media-item.error{font-size:13px;line-height:1.5}.media-upload-form .media-item.error{padding:1px 10px}.media-upload-form .media-item .error{padding:10px 0 10px 12px}.imgedit-settings .imgedit-crop-ratio input[type=text],.imgedit-settings .imgedit-crop-sel input[type=text],.imgedit-settings .imgedit-scale input[type=text]{width:60px;font-size:16px;padding:6px 10px}.imgedit-applyto .imgedit-label{vertical-align:middle}}@media only screen and (max-width:1120px){#wp-media-grid .wp-filter .attachment-filters{max-width:100%}}@media only screen and (max-width:782px){.media-frame.mode-select .attachments-browser.fixed .media-toolbar{top:46px;right:10px}}@media only screen and (max-width:600px){.media-frame.mode-select .attachments-browser.fixed .media-toolbar{top:0}}@media only screen and (max-width:480px){.edit-attachment-frame .media-frame-title{right:110px}.edit-attachment-frame .edit-media-header .left,.edit-attachment-frame .edit-media-header .right,.upload-php .media-modal-close{width:40px;height:40px}.upload-php .media-modal-close .media-modal-icon{margin:9px 10px}.edit-attachment-frame .edit-media-header .left:before,.edit-attachment-frame .edit-media-header .right:before{line-height:40px!important}.edit-attachment-frame .edit-media-header .left{right:82px}.edit-attachment-frame .edit-media-header .right{right:41px}.edit-attachment-frame .media-frame-content{top:40px}.edit-attachment-frame .attachment-media-view{float:none;height:auto;width:100%}.edit-attachment-frame .attachment-info{height:auto;width:100%}}@media only screen and (max-width:640px),screen and (max-height:400px){.upload-php .mode-grid .media-sidebar{max-width:100%}} \ No newline at end of file
diff --git a/www/crm/wp-admin/css/nav-menus-rtl.css b/www/crm/wp-admin/css/nav-menus-rtl.css
new file mode 100644
index 00000000..7ee53417
--- /dev/null
+++ b/www/crm/wp-admin/css/nav-menus-rtl.css
@@ -0,0 +1,905 @@
+/* nav-menu */
+
+/* @todo: determine if this is truly for nav menus only */
+.no-js #message {
+ display: block;
+}
+
+ul.add-menu-item-tabs li {
+ padding: 3px 8px 4px 5px;
+}
+
+.accordion-section ul.category-tabs,
+.accordion-section ul.add-menu-item-tabs,
+.accordion-section ul.wp-tab-bar {
+ margin: 0;
+}
+
+.accordion-section .categorychecklist {
+ margin: 13px 0;
+}
+
+#nav-menu-meta .accordion-section-content {
+ padding: 18px 13px;
+}
+
+#nav-menu-meta .button-controls {
+ margin-bottom: 0;
+}
+
+.has-no-menu-item .button-controls {
+ display: none;
+}
+
+#nav-menus-frame {
+ margin-right: 300px;
+ margin-top: 23px;
+}
+
+#wpbody-content #menu-settings-column {
+ display: inline;
+ width: 281px;
+ margin-right: -300px;
+ clear: both;
+ float: right;
+ padding-top: 0;
+}
+
+#menu-settings-column .inside {
+ clear: both;
+ margin: 10px 0 0;
+}
+
+.metabox-holder-disabled .postbox,
+.metabox-holder-disabled .accordion-section-content,
+.metabox-holder-disabled .accordion-section-title {
+ opacity: 0.5;
+ filter: alpha(opacity=50);
+}
+
+.metabox-holder-disabled .button-controls .select-all {
+ display: none;
+}
+
+#wpbody {
+ position: relative;
+}
+
+.blank-slate .menu-settings {
+ border: none;
+ margin-top: 0;
+ padding-top: 0;
+ overflow: hidden;
+}
+
+.is-submenu {
+ color: #555d66; /* #fafafa background */
+ font-style: italic;
+ font-weight: 400;
+ margin-right: 4px;
+}
+
+.manage-menus {
+ margin-top: 23px;
+ padding: 10px;
+ overflow: hidden;
+ background: #fbfbfb;
+}
+
+.manage-menus .selected-menu,
+.manage-menus select,
+.manage-menus .submit-btn,
+.nav-menus-php .add-new-menu-action {
+ display: inline-block;
+ margin-left: 3px;
+ vertical-align: middle;
+}
+
+.manage-menus select,
+.menu-location-menus select {
+ max-width: 100%;
+}
+
+.menu-edit #post-body-content h3 {
+ margin: 1em 0 10px;
+}
+
+.menu-settings {
+ border-top: 1px solid #eee;
+ margin-top: 2em;
+}
+
+.menu-settings-group {
+ margin: 0 0 10px;
+ overflow: hidden;
+ padding-right: 20%;
+}
+
+.menu-settings-group:last-of-type {
+ margin-bottom: 0;
+}
+
+.menu-settings-input {
+ float: right;
+ margin: 0;
+ width: 100%;
+}
+
+.menu-settings-group-name {
+ float: right;
+ clear: both;
+ width: 25%;
+ padding: 3px 0 0;
+ margin-right: -25%; /* 20 container left padding x ( 100 container % width / 80 this % width ) */
+}
+
+.menu-settings label {
+ vertical-align: baseline;
+}
+
+.menu-edit .checkbox-input {
+ margin-top: 4px;
+}
+
+.theme-location-set {
+ color: #72777c;
+ font-size: 11px;
+}
+
+/* Menu Container */
+
+/* @todo: responsive view. */
+#menu-management-liquid {
+ float: right;
+ min-width: 100%;
+ margin-top: 3px;
+}
+
+/* @todo: responsive view. */
+#menu-management {
+ position: relative;
+ margin-left: 20px;
+ margin-top: -3px;
+ width: 100%;
+}
+
+#menu-management .menu-edit {
+ margin-bottom: 20px;
+}
+
+.nav-menus-php #post-body {
+ padding: 0 10px;
+ border-top: 1px solid #fff;
+ border-bottom: 1px solid #ddd;
+ background: #fff;
+}
+
+#nav-menu-header,
+#nav-menu-footer {
+ padding: 0 10px;
+ background: #f5f5f5;
+}
+
+#nav-menu-header {
+ border-bottom: 1px solid #ddd;
+ margin-bottom: 0;
+}
+
+#nav-menu-header .menu-name-label {
+ display: inline-block;
+ vertical-align: middle;
+ margin-left: 7px;
+ font-style: italic;
+}
+
+.nav-menus-php #post-body div.updated,
+.nav-menus-php #post-body div.error {
+ margin: 0;
+}
+
+.nav-menus-php #post-body-content {
+ position: relative;
+ float: none;
+}
+
+.nav-menus-php #post-body-content .post-body-plain {
+ margin-bottom: 0;
+}
+
+#menu-management .menu-add-new abbr {
+ font-weight: 600;
+}
+
+#select-nav-menu-container {
+ text-align: left;
+ padding: 0 10px 3px 10px;
+ margin-bottom: 5px;
+}
+
+#select-nav-menu {
+ width: 100px;
+ display: inline;
+}
+
+#menu-name-label {
+ margin-top: -2px;
+}
+
+.widefat .menu-locations .menu-location-title {
+ padding: 13px 10px 0;
+}
+
+.menu-location-title label {
+ font-weight: 600;
+}
+
+.menu-location-menus select {
+ float: right;
+}
+
+#locations-nav-menu-wrapper {
+ padding: 5px 0;
+}
+
+.locations-nav-menu-select select {
+ float: right;
+ width: 160px;
+ margin-left: 5px;
+}
+
+.locations-row-links {
+ float: right;
+ margin: 6px 6px 0 0;
+}
+
+.locations-edit-menu-link,
+.locations-add-menu-link {
+ margin: 0 3px;
+}
+
+.locations-edit-menu-link {
+ padding-left: 3px;
+ border-left: 1px solid #ccc;
+}
+
+#menu-management .inside {
+ padding: 0 10px;
+}
+
+/* Add Menu Item Boxes */
+.postbox .howto input,
+.customlinkdiv .menu-item-textbox {
+ width: 180px;
+ float: left;
+}
+
+.accordion-container .outer-border {
+ margin: 0;
+}
+
+.customlinkdiv p {
+ margin-top: 0
+}
+
+#nav-menu-theme-locations .howto select {
+ width: 100%;
+}
+
+#nav-menu-theme-locations .button-controls {
+ text-align: left;
+}
+
+.add-menu-item-view-all {
+ height: 400px;
+}
+
+/* Button Primary Actions */
+#menu-container .submit {
+ margin: 0 0 10px;
+ padding: 0;
+}
+
+/* @todo: is this actually used? */
+#cancel-save {
+ text-decoration: underline;
+ font-size: 12px;
+ margin-right: 20px;
+ margin-top: 5px;
+}
+
+.button.right, .button-secondary.right, .button-primary.right {
+ float: left;
+}
+
+/* Button Secondary Actions */
+.list-controls {
+ float: right;
+ margin-top: 5px;
+}
+
+.add-to-menu {
+ float: left;
+}
+
+.button-controls {
+ clear: both;
+ margin: 10px 0;
+}
+
+.show-all,
+.hide-all {
+ cursor: pointer;
+}
+
+.hide-all {
+ display: none;
+}
+
+/* Create Menu */
+#menu-name {
+ width: 270px;
+ vertical-align: middle;
+}
+
+#manage-menu .inside {
+ padding: 0px 0px;
+}
+
+/* Custom Links */
+#available-links dt {
+ display: block;
+}
+
+#add-custom-link .howto {
+ font-size: 12px;
+}
+
+#add-custom-link label span {
+ display: block;
+ float: right;
+ margin-top: 5px;
+ padding-left: 5px;
+}
+
+.menu-item-textbox {
+ width: 180px;
+}
+
+.customlinkdiv label,
+.nav-menus-php .howto span {
+ float: right;
+ margin-top: 6px;
+}
+
+/* Menu item types */
+.quick-search {
+ width: 190px;
+}
+
+.quick-search-wrap .spinner {
+ float: none;
+ margin: -3px 0 0 -10px;
+}
+
+.nav-menus-php .list-wrap {
+ display: none;
+ clear: both;
+ margin-bottom: 10px;
+}
+
+.nav-menus-php .postbox p.submit {
+ margin-bottom: 0;
+}
+
+/* Listings */
+.nav-menus-php .list li {
+ display: none;
+ margin: 0;
+ margin-bottom: 5px;
+}
+
+.nav-menus-php .list li .menu-item-title {
+ cursor: pointer;
+ display: block;
+}
+
+.nav-menus-php .list li .menu-item-title input {
+ margin-left: 3px;
+ margin-top: -3px;
+}
+
+.menu-item-title input[type=checkbox] {
+ display: inline-block;
+ margin-top: -4px;
+}
+
+/* Nav Menu */
+#menu-container .inside {
+ padding-bottom: 10px;
+}
+
+.menu {
+ padding-top: 1em;
+}
+
+#menu-to-edit {
+ margin: 0;
+ padding: 0.1em 0;
+}
+
+.menu ul {
+ width: 100%;
+}
+
+.menu li {
+ margin-bottom: 0;
+ position: relative;
+}
+
+.menu-item-bar {
+ clear: both;
+ line-height: 1.5;
+ position: relative;
+ margin: 9px 0 0;
+}
+
+.menu-item-bar .menu-item-handle {
+ border: 1px solid #ddd;
+ position: relative;
+ padding: 10px 15px;
+ height: auto;
+ min-height: 20px;
+ width: 382px;
+ line-height: 2.4;
+ overflow: hidden;
+ word-wrap: break-word;
+}
+
+.menu-item-bar .menu-item-handle:hover {
+ border-color: #999;
+}
+
+#menu-to-edit .menu-item-invalid .menu-item-handle {
+ background: #f6c9cc;
+ border-color: #f1acb1;
+}
+
+.no-js .menu-item-edit-active .item-edit {
+ display: none;
+}
+
+.js .menu-item-handle {
+ cursor: move;
+}
+
+.menu li.deleting .menu-item-handle {
+ background-image: none;
+ background-color: #f66;
+}
+
+.menu-item-handle .item-title {
+ font-size: 13px;
+ font-weight: 600;
+ line-height: 1.6;
+ display: block;
+ /* @todo: responsive view. */
+ margin-left: 13em;
+}
+
+.menu-item-handle .menu-item-title.no-title {
+ color: #72777c;
+}
+
+/* Sortables */
+li.menu-item.ui-sortable-helper .menu-item-bar {
+ margin-top: 0;
+}
+
+li.menu-item.ui-sortable-helper .menu-item-transport .menu-item-bar {
+ margin-top: 9px; /* Must use the same value used by the dragged item .menu-item-bar */
+}
+
+.menu .sortable-placeholder {
+ height: 35px;
+ width: 410px;
+ margin-top: 9px; /* Must use the same value used by the dragged item .menu-item-bar */
+}
+
+/* Hide the transport list when it's empty */
+.menu-item .menu-item-transport:empty {
+ display: none;
+}
+
+/* WARNING: The factor of 30px is hardcoded into the nav-menus JavaScript. */
+.menu-item-depth-0 { margin-right: 0px; }
+.menu-item-depth-1 { margin-right: 30px; }
+.menu-item-depth-2 { margin-right: 60px; }
+.menu-item-depth-3 { margin-right: 90px; }
+.menu-item-depth-4 { margin-right: 120px; }
+.menu-item-depth-5 { margin-right: 150px; }
+.menu-item-depth-6 { margin-right: 180px; }
+.menu-item-depth-7 { margin-right: 210px; }
+.menu-item-depth-8 { margin-right: 240px; }
+.menu-item-depth-9 { margin-right: 270px; }
+.menu-item-depth-10 { margin-right: 300px; }
+.menu-item-depth-11 { margin-right: 330px; }
+
+.menu-item-depth-0 .menu-item-transport { margin-right: 0px; }
+.menu-item-depth-1 .menu-item-transport { margin-right: -30px; }
+.menu-item-depth-2 .menu-item-transport { margin-right: -60px; }
+.menu-item-depth-3 .menu-item-transport { margin-right: -90px; }
+.menu-item-depth-4 .menu-item-transport { margin-right: -120px; }
+.menu-item-depth-5 .menu-item-transport { margin-right: -150px; }
+.menu-item-depth-6 .menu-item-transport { margin-right: -180px; }
+.menu-item-depth-7 .menu-item-transport { margin-right: -210px; }
+.menu-item-depth-8 .menu-item-transport { margin-right: -240px; }
+.menu-item-depth-9 .menu-item-transport { margin-right: -270px; }
+.menu-item-depth-10 .menu-item-transport { margin-right: -300px; }
+.menu-item-depth-11 .menu-item-transport { margin-right: -330px; }
+
+body.menu-max-depth-0 { min-width: 950px !important; }
+body.menu-max-depth-1 { min-width: 980px !important; }
+body.menu-max-depth-2 { min-width: 1010px !important; }
+body.menu-max-depth-3 { min-width: 1040px !important; }
+body.menu-max-depth-4 { min-width: 1070px !important; }
+body.menu-max-depth-5 { min-width: 1100px !important; }
+body.menu-max-depth-6 { min-width: 1130px !important; }
+body.menu-max-depth-7 { min-width: 1160px !important; }
+body.menu-max-depth-8 { min-width: 1190px !important; }
+body.menu-max-depth-9 { min-width: 1220px !important; }
+body.menu-max-depth-10 { min-width: 1250px !important; }
+body.menu-max-depth-11 { min-width: 1280px !important; }
+
+/* Menu item controls */
+.item-type {
+ display: inline-block;
+ padding: 12px 16px;
+ color: #666;
+ font-size: 12px;
+ line-height: 1.5;
+}
+
+.item-controls {
+ font-size: 12px;
+ position: absolute;
+ left: 20px;
+ top: -1px;
+}
+
+.item-controls a {
+ text-decoration: none;
+}
+
+.item-controls a:hover {
+ cursor: pointer;
+}
+
+.item-controls .item-order {
+ padding-left: 10px;
+}
+
+.nav-menus-php .item-edit {
+ position: absolute;
+ left: -20px;
+ top: 0;
+ display: block;
+ width: 30px;
+ height: 40px;
+ outline: none;
+}
+
+.no-js.nav-menus-php .item-edit {
+ position: static;
+ float: left;
+ width: auto;
+ height: auto;
+ margin: 12px 0 12px -10px;
+ padding: 0;
+ color: #0073aa;
+ text-decoration: underline;
+ font-size: 12px;
+ line-height: 1.5;
+}
+
+.no-js.nav-menus-php .item-edit .screen-reader-text {
+ position: static;
+ -webkit-clip-path: none;
+ clip-path: none;
+ width: auto;
+ height: auto;
+ margin: 0;
+}
+
+.nav-menus-php .item-edit:before {
+ margin-top: 10px;
+ margin-right: 4px;
+ width: 20px;
+ border-radius: 50%;
+ text-indent: -1px; /* account for the dashicon alignment */
+}
+
+.no-js.nav-menus-php .item-edit:before {
+ display: none;
+}
+
+.rtl .nav-menus-php .item-edit:before {
+ text-indent: 1px; /* account for the dashicon alignment */
+}
+
+.js.nav-menus-php .item-edit:focus {
+ box-shadow: none;
+}
+
+.nav-menus-php .item-edit:focus:before {
+ box-shadow:
+ 0 0 0 1px #5b9dd9,
+ 0 0 2px 1px rgba(30, 140, 190, 0.8);
+}
+
+/* Menu editing */
+.menu-instructions-inactive {
+ display: none;
+}
+
+.menu-item-settings {
+ display: block;
+ width: 402px;
+ padding: 10px 10px 10px 0;
+ position: relative;
+ z-index: 10; /* Keep .item-title's shadow from appearing on top of .menu-item-settings */
+ border: 1px solid #e5e5e5;
+ border-top: none;
+ box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
+}
+
+.menu-item-settings .field-move {
+ margin: 3px 0 5px;
+ line-height: 1.5;
+}
+
+.field-move-visual-label {
+ float: right;
+ margin-left: 4px;
+ font-style: italic;
+}
+
+.menu-item-settings .field-move .button-link {
+ display: none;
+ margin: 0 2px;
+ font-style: italic;
+}
+
+.menu-item-edit-active .menu-item-settings {
+ display: block;
+}
+
+.menu-item-edit-inactive .menu-item-settings {
+ display: none;
+}
+
+.add-menu-item-pagelinks {
+ margin: .5em -10px;
+ text-align: center;
+}
+
+.add-menu-item-pagelinks .page-numbers {
+ display: inline-block;
+ min-width: 20px;
+}
+
+.add-menu-item-pagelinks .page-numbers.dots {
+ min-width: 0;
+}
+
+.link-to-original {
+ display: block;
+ margin: 0 0 15px;
+ padding: 3px 5px 5px;
+ border: 1px solid #ddd;
+ color: #72777c;
+ font-size: 12px;
+ font-style: italic;
+}
+
+.link-to-original a {
+ padding-right: 4px;
+ font-style: normal;
+}
+
+.hidden-field {
+ display: none;
+}
+
+.menu-item-settings .description-thin,
+.menu-item-settings .description-wide {
+ margin-left: 10px;
+ float: right;
+}
+
+.description-thin {
+ width: 190px;
+}
+
+.description-wide {
+ width: 390px;
+}
+
+.menu-item-actions {
+ padding-top: 15px;
+ padding-bottom: 7px;
+}
+
+#cancel-save {
+ cursor: pointer;
+}
+
+/* Major/minor publishing actions (classes) */
+.nav-menus-php .major-publishing-actions {
+ clear: both;
+ padding: 10px 0;
+ line-height: 2.1;
+}
+
+.nav-menus-php .major-publishing-actions .publishing-action {
+ text-align: left;
+ float: left;
+}
+
+.nav-menus-php .blank-slate .menu-settings {
+ display: none;
+}
+
+/* Same as the Publish Meta Box #delete-action */
+.nav-menus-php .delete-action {
+ float: right;
+ line-height: 2.1;
+}
+
+.nav-menus-php .major-publishing-actions .form-invalid {
+ padding-right: 4px;
+ margin-right: -4px;
+}
+
+#nav-menus-frame,
+.button-controls,
+#menu-item-url-wrap,
+#menu-item-name-wrap {
+ display: block;
+}
+
+/* =Media Queries
+-------------------------------------------------------------- */
+
+@media only screen and (min-width: 769px) and (max-width: 1000px){
+ body.menu-max-depth-0 {
+ min-width: 0 !important;
+ }
+
+ #menu-management-liquid{
+ width: 100%;
+ }
+
+ .nav-menus-php #post-body-content{
+ min-width: 0;
+ }
+
+ .menu-item-bar .menu-item-handle{
+ width: 90%;
+ }
+}
+
+@media screen and (max-width: 782px) {
+ body.nav-menus-php,
+ body.wp-customizer {
+ min-width: 0 !important;
+ }
+
+ #nav-menus-frame {
+ margin-right: 0;
+ float: none;
+ width: 100%;
+ }
+
+ #wpbody-content #menu-settings-column {
+ display: block;
+ width: 100%;
+ float: none;
+ margin-right: 0;
+ }
+
+ #side-sortables .add-menu-item-tabs {
+ margin: 15px 0 14px;
+ }
+
+ ul.add-menu-item-tabs li.tabs {
+ padding: 13px 15px 14px;
+ }
+
+ .nav-menus-php .customlinkdiv .howto input {
+ width: 65%;
+ }
+
+ .nav-menus-php .quick-search {
+ width: 85%;
+ }
+
+ #menu-management-liquid {
+ margin-top: 25px;
+ }
+
+ .nav-menus-php .menu-name-label.howto span {
+ margin-top: 13px
+ }
+
+ #menu-name {
+ width: 100%;
+ }
+
+ .nav-menus-php #nav-menu-header .major-publishing-actions .publishing-action {
+ padding-top: 1em;
+ }
+
+ .nav-menus-php .delete-action {
+ font-size: 14px;
+ line-height: 2.1;
+ }
+
+ .menu-item-bar .menu-item-handle,
+ .menu-item-settings,
+ .description-wide {
+ width: auto;
+ }
+
+ .menu-item-settings {
+ padding: 10px;
+ }
+
+ .menu-item-settings .description-thin,
+ .menu-item-settings .description-wide {
+ width: 100%;
+ }
+
+ .menu-item-settings input {
+ width: 100%;
+ }
+
+ .menu-item-settings input[type="checkbox"],
+ .menu-item-settings input[type="radio"] {
+ width: 25px;
+ }
+
+ .menu-settings-group {
+ padding-right: 0;
+ }
+
+ .menu-settings-group-name {
+ float: none;
+ width: auto;
+ margin-right: 0;
+ margin-bottom: 15px;
+ }
+
+ .menu-settings-input {
+ float: none;
+ margin-bottom: 15px;
+ }
+
+ .menu-edit .checkbox-input {
+ margin-top: 0;
+ }
+
+ .manage-menus select {
+ margin: 0.5em 0;
+ }
+
+ .widefat .menu-locations .menu-location-title {
+ padding-top: 16px;
+ }
+}
+
+@media only screen and (max-width: 768px) {
+ /* menu locations */
+ #menu-locations-wrap .widefat {
+ width: 100%;
+ }
+}
diff --git a/www/crm/wp-admin/css/nav-menus-rtl.min.css b/www/crm/wp-admin/css/nav-menus-rtl.min.css
new file mode 100644
index 00000000..02ed192c
--- /dev/null
+++ b/www/crm/wp-admin/css/nav-menus-rtl.min.css
@@ -0,0 +1,2 @@
+/*! This file is auto-generated */
+.no-js #message{display:block}ul.add-menu-item-tabs li{padding:3px 8px 4px 5px}.accordion-section ul.add-menu-item-tabs,.accordion-section ul.category-tabs,.accordion-section ul.wp-tab-bar{margin:0}.accordion-section .categorychecklist{margin:13px 0}#nav-menu-meta .accordion-section-content{padding:18px 13px}#nav-menu-meta .button-controls{margin-bottom:0}.has-no-menu-item .button-controls{display:none}#nav-menus-frame{margin-right:300px;margin-top:23px}#wpbody-content #menu-settings-column{display:inline;width:281px;margin-right:-300px;clear:both;float:right;padding-top:0}#menu-settings-column .inside{clear:both;margin:10px 0 0}.metabox-holder-disabled .accordion-section-content,.metabox-holder-disabled .accordion-section-title,.metabox-holder-disabled .postbox{opacity:.5;filter:alpha(opacity=50)}.metabox-holder-disabled .button-controls .select-all{display:none}#wpbody{position:relative}.blank-slate .menu-settings{border:none;margin-top:0;padding-top:0;overflow:hidden}.is-submenu{color:#555d66;font-style:italic;font-weight:400;margin-right:4px}.manage-menus{margin-top:23px;padding:10px;overflow:hidden;background:#fbfbfb}.manage-menus .selected-menu,.manage-menus .submit-btn,.manage-menus select,.nav-menus-php .add-new-menu-action{display:inline-block;margin-left:3px;vertical-align:middle}.manage-menus select,.menu-location-menus select{max-width:100%}.menu-edit #post-body-content h3{margin:1em 0 10px}.menu-settings{border-top:1px solid #eee;margin-top:2em}.menu-settings-group{margin:0 0 10px;overflow:hidden;padding-right:20%}.menu-settings-group:last-of-type{margin-bottom:0}.menu-settings-input{float:right;margin:0;width:100%}.menu-settings-group-name{float:right;clear:both;width:25%;padding:3px 0 0;margin-right:-25%}.menu-settings label{vertical-align:baseline}.menu-edit .checkbox-input{margin-top:4px}.theme-location-set{color:#72777c;font-size:11px}#menu-management-liquid{float:right;min-width:100%;margin-top:3px}#menu-management{position:relative;margin-left:20px;margin-top:-3px;width:100%}#menu-management .menu-edit{margin-bottom:20px}.nav-menus-php #post-body{padding:0 10px;border-top:1px solid #fff;border-bottom:1px solid #ddd;background:#fff}#nav-menu-footer,#nav-menu-header{padding:0 10px;background:#f5f5f5}#nav-menu-header{border-bottom:1px solid #ddd;margin-bottom:0}#nav-menu-header .menu-name-label{display:inline-block;vertical-align:middle;margin-left:7px;font-style:italic}.nav-menus-php #post-body div.error,.nav-menus-php #post-body div.updated{margin:0}.nav-menus-php #post-body-content{position:relative;float:none}.nav-menus-php #post-body-content .post-body-plain{margin-bottom:0}#menu-management .menu-add-new abbr{font-weight:600}#select-nav-menu-container{text-align:left;padding:0 10px 3px 10px;margin-bottom:5px}#select-nav-menu{width:100px;display:inline}#menu-name-label{margin-top:-2px}.widefat .menu-locations .menu-location-title{padding:13px 10px 0}.menu-location-title label{font-weight:600}.menu-location-menus select{float:right}#locations-nav-menu-wrapper{padding:5px 0}.locations-nav-menu-select select{float:right;width:160px;margin-left:5px}.locations-row-links{float:right;margin:6px 6px 0 0}.locations-add-menu-link,.locations-edit-menu-link{margin:0 3px}.locations-edit-menu-link{padding-left:3px;border-left:1px solid #ccc}#menu-management .inside{padding:0 10px}.customlinkdiv .menu-item-textbox,.postbox .howto input{width:180px;float:left}.accordion-container .outer-border{margin:0}.customlinkdiv p{margin-top:0}#nav-menu-theme-locations .howto select{width:100%}#nav-menu-theme-locations .button-controls{text-align:left}.add-menu-item-view-all{height:400px}#menu-container .submit{margin:0 0 10px;padding:0}#cancel-save{text-decoration:underline;font-size:12px;margin-right:20px;margin-top:5px}.button-primary.right,.button-secondary.right,.button.right{float:left}.list-controls{float:right;margin-top:5px}.add-to-menu{float:left}.button-controls{clear:both;margin:10px 0}.hide-all,.show-all{cursor:pointer}.hide-all{display:none}#menu-name{width:270px;vertical-align:middle}#manage-menu .inside{padding:0 0}#available-links dt{display:block}#add-custom-link .howto{font-size:12px}#add-custom-link label span{display:block;float:right;margin-top:5px;padding-left:5px}.menu-item-textbox{width:180px}.customlinkdiv label,.nav-menus-php .howto span{float:right;margin-top:6px}.quick-search{width:190px}.quick-search-wrap .spinner{float:none;margin:-3px 0 0 -10px}.nav-menus-php .list-wrap{display:none;clear:both;margin-bottom:10px}.nav-menus-php .postbox p.submit{margin-bottom:0}.nav-menus-php .list li{display:none;margin:0;margin-bottom:5px}.nav-menus-php .list li .menu-item-title{cursor:pointer;display:block}.nav-menus-php .list li .menu-item-title input{margin-left:3px;margin-top:-3px}.menu-item-title input[type=checkbox]{display:inline-block;margin-top:-4px}#menu-container .inside{padding-bottom:10px}.menu{padding-top:1em}#menu-to-edit{margin:0;padding:.1em 0}.menu ul{width:100%}.menu li{margin-bottom:0;position:relative}.menu-item-bar{clear:both;line-height:1.5;position:relative;margin:9px 0 0}.menu-item-bar .menu-item-handle{border:1px solid #ddd;position:relative;padding:10px 15px;height:auto;min-height:20px;width:382px;line-height:2.4;overflow:hidden;word-wrap:break-word}.menu-item-bar .menu-item-handle:hover{border-color:#999}#menu-to-edit .menu-item-invalid .menu-item-handle{background:#f6c9cc;border-color:#f1acb1}.no-js .menu-item-edit-active .item-edit{display:none}.js .menu-item-handle{cursor:move}.menu li.deleting .menu-item-handle{background-image:none;background-color:#f66}.menu-item-handle .item-title{font-size:13px;font-weight:600;line-height:1.6;display:block;margin-left:13em}.menu-item-handle .menu-item-title.no-title{color:#72777c}li.menu-item.ui-sortable-helper .menu-item-bar{margin-top:0}li.menu-item.ui-sortable-helper .menu-item-transport .menu-item-bar{margin-top:9px}.menu .sortable-placeholder{height:35px;width:410px;margin-top:9px}.menu-item .menu-item-transport:empty{display:none}.menu-item-depth-0{margin-right:0}.menu-item-depth-1{margin-right:30px}.menu-item-depth-2{margin-right:60px}.menu-item-depth-3{margin-right:90px}.menu-item-depth-4{margin-right:120px}.menu-item-depth-5{margin-right:150px}.menu-item-depth-6{margin-right:180px}.menu-item-depth-7{margin-right:210px}.menu-item-depth-8{margin-right:240px}.menu-item-depth-9{margin-right:270px}.menu-item-depth-10{margin-right:300px}.menu-item-depth-11{margin-right:330px}.menu-item-depth-0 .menu-item-transport{margin-right:0}.menu-item-depth-1 .menu-item-transport{margin-right:-30px}.menu-item-depth-2 .menu-item-transport{margin-right:-60px}.menu-item-depth-3 .menu-item-transport{margin-right:-90px}.menu-item-depth-4 .menu-item-transport{margin-right:-120px}.menu-item-depth-5 .menu-item-transport{margin-right:-150px}.menu-item-depth-6 .menu-item-transport{margin-right:-180px}.menu-item-depth-7 .menu-item-transport{margin-right:-210px}.menu-item-depth-8 .menu-item-transport{margin-right:-240px}.menu-item-depth-9 .menu-item-transport{margin-right:-270px}.menu-item-depth-10 .menu-item-transport{margin-right:-300px}.menu-item-depth-11 .menu-item-transport{margin-right:-330px}body.menu-max-depth-0{min-width:950px!important}body.menu-max-depth-1{min-width:980px!important}body.menu-max-depth-2{min-width:1010px!important}body.menu-max-depth-3{min-width:1040px!important}body.menu-max-depth-4{min-width:1070px!important}body.menu-max-depth-5{min-width:1100px!important}body.menu-max-depth-6{min-width:1130px!important}body.menu-max-depth-7{min-width:1160px!important}body.menu-max-depth-8{min-width:1190px!important}body.menu-max-depth-9{min-width:1220px!important}body.menu-max-depth-10{min-width:1250px!important}body.menu-max-depth-11{min-width:1280px!important}.item-type{display:inline-block;padding:12px 16px;color:#666;font-size:12px;line-height:1.5}.item-controls{font-size:12px;position:absolute;left:20px;top:-1px}.item-controls a{text-decoration:none}.item-controls a:hover{cursor:pointer}.item-controls .item-order{padding-left:10px}.nav-menus-php .item-edit{position:absolute;left:-20px;top:0;display:block;width:30px;height:40px;outline:0}.no-js.nav-menus-php .item-edit{position:static;float:left;width:auto;height:auto;margin:12px 0 12px -10px;padding:0;color:#0073aa;text-decoration:underline;font-size:12px;line-height:1.5}.no-js.nav-menus-php .item-edit .screen-reader-text{position:static;-webkit-clip-path:none;clip-path:none;width:auto;height:auto;margin:0}.nav-menus-php .item-edit:before{margin-top:10px;margin-right:4px;width:20px;border-radius:50%;text-indent:-1px}.no-js.nav-menus-php .item-edit:before{display:none}.rtl .nav-menus-php .item-edit:before{text-indent:1px}.js.nav-menus-php .item-edit:focus{box-shadow:none}.nav-menus-php .item-edit:focus:before{box-shadow:0 0 0 1px #5b9dd9,0 0 2px 1px rgba(30,140,190,.8)}.menu-instructions-inactive{display:none}.menu-item-settings{display:block;width:402px;padding:10px 10px 10px 0;position:relative;z-index:10;border:1px solid #e5e5e5;border-top:none;box-shadow:0 1px 1px rgba(0,0,0,.04)}.menu-item-settings .field-move{margin:3px 0 5px;line-height:1.5}.field-move-visual-label{float:right;margin-left:4px;font-style:italic}.menu-item-settings .field-move .button-link{display:none;margin:0 2px;font-style:italic}.menu-item-edit-active .menu-item-settings{display:block}.menu-item-edit-inactive .menu-item-settings{display:none}.add-menu-item-pagelinks{margin:.5em -10px;text-align:center}.add-menu-item-pagelinks .page-numbers{display:inline-block;min-width:20px}.add-menu-item-pagelinks .page-numbers.dots{min-width:0}.link-to-original{display:block;margin:0 0 15px;padding:3px 5px 5px;border:1px solid #ddd;color:#72777c;font-size:12px;font-style:italic}.link-to-original a{padding-right:4px;font-style:normal}.hidden-field{display:none}.menu-item-settings .description-thin,.menu-item-settings .description-wide{margin-left:10px;float:right}.description-thin{width:190px}.description-wide{width:390px}.menu-item-actions{padding-top:15px;padding-bottom:7px}#cancel-save{cursor:pointer}.nav-menus-php .major-publishing-actions{clear:both;padding:10px 0;line-height:2.1}.nav-menus-php .major-publishing-actions .publishing-action{text-align:left;float:left}.nav-menus-php .blank-slate .menu-settings{display:none}.nav-menus-php .delete-action{float:right;line-height:2.1}.nav-menus-php .major-publishing-actions .form-invalid{padding-right:4px;margin-right:-4px}#menu-item-name-wrap,#menu-item-url-wrap,#nav-menus-frame,.button-controls{display:block}@media only screen and (min-width:769px) and (max-width:1000px){body.menu-max-depth-0{min-width:0!important}#menu-management-liquid{width:100%}.nav-menus-php #post-body-content{min-width:0}.menu-item-bar .menu-item-handle{width:90%}}@media screen and (max-width:782px){body.nav-menus-php,body.wp-customizer{min-width:0!important}#nav-menus-frame{margin-right:0;float:none;width:100%}#wpbody-content #menu-settings-column{display:block;width:100%;float:none;margin-right:0}#side-sortables .add-menu-item-tabs{margin:15px 0 14px}ul.add-menu-item-tabs li.tabs{padding:13px 15px 14px}.nav-menus-php .customlinkdiv .howto input{width:65%}.nav-menus-php .quick-search{width:85%}#menu-management-liquid{margin-top:25px}.nav-menus-php .menu-name-label.howto span{margin-top:13px}#menu-name{width:100%}.nav-menus-php #nav-menu-header .major-publishing-actions .publishing-action{padding-top:1em}.nav-menus-php .delete-action{font-size:14px;line-height:2.1}.description-wide,.menu-item-bar .menu-item-handle,.menu-item-settings{width:auto}.menu-item-settings{padding:10px}.menu-item-settings .description-thin,.menu-item-settings .description-wide{width:100%}.menu-item-settings input{width:100%}.menu-item-settings input[type=checkbox],.menu-item-settings input[type=radio]{width:25px}.menu-settings-group{padding-right:0}.menu-settings-group-name{float:none;width:auto;margin-right:0;margin-bottom:15px}.menu-settings-input{float:none;margin-bottom:15px}.menu-edit .checkbox-input{margin-top:0}.manage-menus select{margin:.5em 0}.widefat .menu-locations .menu-location-title{padding-top:16px}}@media only screen and (max-width:768px){#menu-locations-wrap .widefat{width:100%}} \ No newline at end of file
diff --git a/www/crm/wp-admin/css/nav-menus.css b/www/crm/wp-admin/css/nav-menus.css
new file mode 100644
index 00000000..214b8062
--- /dev/null
+++ b/www/crm/wp-admin/css/nav-menus.css
@@ -0,0 +1,905 @@
+/* nav-menu */
+
+/* @todo: determine if this is truly for nav menus only */
+.no-js #message {
+ display: block;
+}
+
+ul.add-menu-item-tabs li {
+ padding: 3px 5px 4px 8px;
+}
+
+.accordion-section ul.category-tabs,
+.accordion-section ul.add-menu-item-tabs,
+.accordion-section ul.wp-tab-bar {
+ margin: 0;
+}
+
+.accordion-section .categorychecklist {
+ margin: 13px 0;
+}
+
+#nav-menu-meta .accordion-section-content {
+ padding: 18px 13px;
+}
+
+#nav-menu-meta .button-controls {
+ margin-bottom: 0;
+}
+
+.has-no-menu-item .button-controls {
+ display: none;
+}
+
+#nav-menus-frame {
+ margin-left: 300px;
+ margin-top: 23px;
+}
+
+#wpbody-content #menu-settings-column {
+ display: inline;
+ width: 281px;
+ margin-left: -300px;
+ clear: both;
+ float: left;
+ padding-top: 0;
+}
+
+#menu-settings-column .inside {
+ clear: both;
+ margin: 10px 0 0;
+}
+
+.metabox-holder-disabled .postbox,
+.metabox-holder-disabled .accordion-section-content,
+.metabox-holder-disabled .accordion-section-title {
+ opacity: 0.5;
+ filter: alpha(opacity=50);
+}
+
+.metabox-holder-disabled .button-controls .select-all {
+ display: none;
+}
+
+#wpbody {
+ position: relative;
+}
+
+.blank-slate .menu-settings {
+ border: none;
+ margin-top: 0;
+ padding-top: 0;
+ overflow: hidden;
+}
+
+.is-submenu {
+ color: #555d66; /* #fafafa background */
+ font-style: italic;
+ font-weight: 400;
+ margin-left: 4px;
+}
+
+.manage-menus {
+ margin-top: 23px;
+ padding: 10px;
+ overflow: hidden;
+ background: #fbfbfb;
+}
+
+.manage-menus .selected-menu,
+.manage-menus select,
+.manage-menus .submit-btn,
+.nav-menus-php .add-new-menu-action {
+ display: inline-block;
+ margin-right: 3px;
+ vertical-align: middle;
+}
+
+.manage-menus select,
+.menu-location-menus select {
+ max-width: 100%;
+}
+
+.menu-edit #post-body-content h3 {
+ margin: 1em 0 10px;
+}
+
+.menu-settings {
+ border-top: 1px solid #eee;
+ margin-top: 2em;
+}
+
+.menu-settings-group {
+ margin: 0 0 10px;
+ overflow: hidden;
+ padding-left: 20%;
+}
+
+.menu-settings-group:last-of-type {
+ margin-bottom: 0;
+}
+
+.menu-settings-input {
+ float: left;
+ margin: 0;
+ width: 100%;
+}
+
+.menu-settings-group-name {
+ float: left;
+ clear: both;
+ width: 25%;
+ padding: 3px 0 0;
+ margin-left: -25%; /* 20 container left padding x ( 100 container % width / 80 this % width ) */
+}
+
+.menu-settings label {
+ vertical-align: baseline;
+}
+
+.menu-edit .checkbox-input {
+ margin-top: 4px;
+}
+
+.theme-location-set {
+ color: #72777c;
+ font-size: 11px;
+}
+
+/* Menu Container */
+
+/* @todo: responsive view. */
+#menu-management-liquid {
+ float: left;
+ min-width: 100%;
+ margin-top: 3px;
+}
+
+/* @todo: responsive view. */
+#menu-management {
+ position: relative;
+ margin-right: 20px;
+ margin-top: -3px;
+ width: 100%;
+}
+
+#menu-management .menu-edit {
+ margin-bottom: 20px;
+}
+
+.nav-menus-php #post-body {
+ padding: 0 10px;
+ border-top: 1px solid #fff;
+ border-bottom: 1px solid #ddd;
+ background: #fff;
+}
+
+#nav-menu-header,
+#nav-menu-footer {
+ padding: 0 10px;
+ background: #f5f5f5;
+}
+
+#nav-menu-header {
+ border-bottom: 1px solid #ddd;
+ margin-bottom: 0;
+}
+
+#nav-menu-header .menu-name-label {
+ display: inline-block;
+ vertical-align: middle;
+ margin-right: 7px;
+ font-style: italic;
+}
+
+.nav-menus-php #post-body div.updated,
+.nav-menus-php #post-body div.error {
+ margin: 0;
+}
+
+.nav-menus-php #post-body-content {
+ position: relative;
+ float: none;
+}
+
+.nav-menus-php #post-body-content .post-body-plain {
+ margin-bottom: 0;
+}
+
+#menu-management .menu-add-new abbr {
+ font-weight: 600;
+}
+
+#select-nav-menu-container {
+ text-align: right;
+ padding: 0 10px 3px 10px;
+ margin-bottom: 5px;
+}
+
+#select-nav-menu {
+ width: 100px;
+ display: inline;
+}
+
+#menu-name-label {
+ margin-top: -2px;
+}
+
+.widefat .menu-locations .menu-location-title {
+ padding: 13px 10px 0;
+}
+
+.menu-location-title label {
+ font-weight: 600;
+}
+
+.menu-location-menus select {
+ float: left;
+}
+
+#locations-nav-menu-wrapper {
+ padding: 5px 0;
+}
+
+.locations-nav-menu-select select {
+ float: left;
+ width: 160px;
+ margin-right: 5px;
+}
+
+.locations-row-links {
+ float: left;
+ margin: 6px 0 0 6px;
+}
+
+.locations-edit-menu-link,
+.locations-add-menu-link {
+ margin: 0 3px;
+}
+
+.locations-edit-menu-link {
+ padding-right: 3px;
+ border-right: 1px solid #ccc;
+}
+
+#menu-management .inside {
+ padding: 0 10px;
+}
+
+/* Add Menu Item Boxes */
+.postbox .howto input,
+.customlinkdiv .menu-item-textbox {
+ width: 180px;
+ float: right;
+}
+
+.accordion-container .outer-border {
+ margin: 0;
+}
+
+.customlinkdiv p {
+ margin-top: 0
+}
+
+#nav-menu-theme-locations .howto select {
+ width: 100%;
+}
+
+#nav-menu-theme-locations .button-controls {
+ text-align: right;
+}
+
+.add-menu-item-view-all {
+ height: 400px;
+}
+
+/* Button Primary Actions */
+#menu-container .submit {
+ margin: 0 0 10px;
+ padding: 0;
+}
+
+/* @todo: is this actually used? */
+#cancel-save {
+ text-decoration: underline;
+ font-size: 12px;
+ margin-left: 20px;
+ margin-top: 5px;
+}
+
+.button.right, .button-secondary.right, .button-primary.right {
+ float: right;
+}
+
+/* Button Secondary Actions */
+.list-controls {
+ float: left;
+ margin-top: 5px;
+}
+
+.add-to-menu {
+ float: right;
+}
+
+.button-controls {
+ clear: both;
+ margin: 10px 0;
+}
+
+.show-all,
+.hide-all {
+ cursor: pointer;
+}
+
+.hide-all {
+ display: none;
+}
+
+/* Create Menu */
+#menu-name {
+ width: 270px;
+ vertical-align: middle;
+}
+
+#manage-menu .inside {
+ padding: 0px 0px;
+}
+
+/* Custom Links */
+#available-links dt {
+ display: block;
+}
+
+#add-custom-link .howto {
+ font-size: 12px;
+}
+
+#add-custom-link label span {
+ display: block;
+ float: left;
+ margin-top: 5px;
+ padding-right: 5px;
+}
+
+.menu-item-textbox {
+ width: 180px;
+}
+
+.customlinkdiv label,
+.nav-menus-php .howto span {
+ float: left;
+ margin-top: 6px;
+}
+
+/* Menu item types */
+.quick-search {
+ width: 190px;
+}
+
+.quick-search-wrap .spinner {
+ float: none;
+ margin: -3px -10px 0 0;
+}
+
+.nav-menus-php .list-wrap {
+ display: none;
+ clear: both;
+ margin-bottom: 10px;
+}
+
+.nav-menus-php .postbox p.submit {
+ margin-bottom: 0;
+}
+
+/* Listings */
+.nav-menus-php .list li {
+ display: none;
+ margin: 0;
+ margin-bottom: 5px;
+}
+
+.nav-menus-php .list li .menu-item-title {
+ cursor: pointer;
+ display: block;
+}
+
+.nav-menus-php .list li .menu-item-title input {
+ margin-right: 3px;
+ margin-top: -3px;
+}
+
+.menu-item-title input[type=checkbox] {
+ display: inline-block;
+ margin-top: -4px;
+}
+
+/* Nav Menu */
+#menu-container .inside {
+ padding-bottom: 10px;
+}
+
+.menu {
+ padding-top: 1em;
+}
+
+#menu-to-edit {
+ margin: 0;
+ padding: 0.1em 0;
+}
+
+.menu ul {
+ width: 100%;
+}
+
+.menu li {
+ margin-bottom: 0;
+ position: relative;
+}
+
+.menu-item-bar {
+ clear: both;
+ line-height: 1.5;
+ position: relative;
+ margin: 9px 0 0;
+}
+
+.menu-item-bar .menu-item-handle {
+ border: 1px solid #ddd;
+ position: relative;
+ padding: 10px 15px;
+ height: auto;
+ min-height: 20px;
+ width: 382px;
+ line-height: 2.4;
+ overflow: hidden;
+ word-wrap: break-word;
+}
+
+.menu-item-bar .menu-item-handle:hover {
+ border-color: #999;
+}
+
+#menu-to-edit .menu-item-invalid .menu-item-handle {
+ background: #f6c9cc;
+ border-color: #f1acb1;
+}
+
+.no-js .menu-item-edit-active .item-edit {
+ display: none;
+}
+
+.js .menu-item-handle {
+ cursor: move;
+}
+
+.menu li.deleting .menu-item-handle {
+ background-image: none;
+ background-color: #f66;
+}
+
+.menu-item-handle .item-title {
+ font-size: 13px;
+ font-weight: 600;
+ line-height: 1.6;
+ display: block;
+ /* @todo: responsive view. */
+ margin-right: 13em;
+}
+
+.menu-item-handle .menu-item-title.no-title {
+ color: #72777c;
+}
+
+/* Sortables */
+li.menu-item.ui-sortable-helper .menu-item-bar {
+ margin-top: 0;
+}
+
+li.menu-item.ui-sortable-helper .menu-item-transport .menu-item-bar {
+ margin-top: 9px; /* Must use the same value used by the dragged item .menu-item-bar */
+}
+
+.menu .sortable-placeholder {
+ height: 35px;
+ width: 410px;
+ margin-top: 9px; /* Must use the same value used by the dragged item .menu-item-bar */
+}
+
+/* Hide the transport list when it's empty */
+.menu-item .menu-item-transport:empty {
+ display: none;
+}
+
+/* WARNING: The factor of 30px is hardcoded into the nav-menus JavaScript. */
+.menu-item-depth-0 { margin-left: 0px; }
+.menu-item-depth-1 { margin-left: 30px; }
+.menu-item-depth-2 { margin-left: 60px; }
+.menu-item-depth-3 { margin-left: 90px; }
+.menu-item-depth-4 { margin-left: 120px; }
+.menu-item-depth-5 { margin-left: 150px; }
+.menu-item-depth-6 { margin-left: 180px; }
+.menu-item-depth-7 { margin-left: 210px; }
+.menu-item-depth-8 { margin-left: 240px; }
+.menu-item-depth-9 { margin-left: 270px; }
+.menu-item-depth-10 { margin-left: 300px; }
+.menu-item-depth-11 { margin-left: 330px; }
+
+.menu-item-depth-0 .menu-item-transport { margin-left: 0px; }
+.menu-item-depth-1 .menu-item-transport { margin-left: -30px; }
+.menu-item-depth-2 .menu-item-transport { margin-left: -60px; }
+.menu-item-depth-3 .menu-item-transport { margin-left: -90px; }
+.menu-item-depth-4 .menu-item-transport { margin-left: -120px; }
+.menu-item-depth-5 .menu-item-transport { margin-left: -150px; }
+.menu-item-depth-6 .menu-item-transport { margin-left: -180px; }
+.menu-item-depth-7 .menu-item-transport { margin-left: -210px; }
+.menu-item-depth-8 .menu-item-transport { margin-left: -240px; }
+.menu-item-depth-9 .menu-item-transport { margin-left: -270px; }
+.menu-item-depth-10 .menu-item-transport { margin-left: -300px; }
+.menu-item-depth-11 .menu-item-transport { margin-left: -330px; }
+
+body.menu-max-depth-0 { min-width: 950px !important; }
+body.menu-max-depth-1 { min-width: 980px !important; }
+body.menu-max-depth-2 { min-width: 1010px !important; }
+body.menu-max-depth-3 { min-width: 1040px !important; }
+body.menu-max-depth-4 { min-width: 1070px !important; }
+body.menu-max-depth-5 { min-width: 1100px !important; }
+body.menu-max-depth-6 { min-width: 1130px !important; }
+body.menu-max-depth-7 { min-width: 1160px !important; }
+body.menu-max-depth-8 { min-width: 1190px !important; }
+body.menu-max-depth-9 { min-width: 1220px !important; }
+body.menu-max-depth-10 { min-width: 1250px !important; }
+body.menu-max-depth-11 { min-width: 1280px !important; }
+
+/* Menu item controls */
+.item-type {
+ display: inline-block;
+ padding: 12px 16px;
+ color: #666;
+ font-size: 12px;
+ line-height: 1.5;
+}
+
+.item-controls {
+ font-size: 12px;
+ position: absolute;
+ right: 20px;
+ top: -1px;
+}
+
+.item-controls a {
+ text-decoration: none;
+}
+
+.item-controls a:hover {
+ cursor: pointer;
+}
+
+.item-controls .item-order {
+ padding-right: 10px;
+}
+
+.nav-menus-php .item-edit {
+ position: absolute;
+ right: -20px;
+ top: 0;
+ display: block;
+ width: 30px;
+ height: 40px;
+ outline: none;
+}
+
+.no-js.nav-menus-php .item-edit {
+ position: static;
+ float: right;
+ width: auto;
+ height: auto;
+ margin: 12px -10px 12px 0;
+ padding: 0;
+ color: #0073aa;
+ text-decoration: underline;
+ font-size: 12px;
+ line-height: 1.5;
+}
+
+.no-js.nav-menus-php .item-edit .screen-reader-text {
+ position: static;
+ -webkit-clip-path: none;
+ clip-path: none;
+ width: auto;
+ height: auto;
+ margin: 0;
+}
+
+.nav-menus-php .item-edit:before {
+ margin-top: 10px;
+ margin-left: 4px;
+ width: 20px;
+ border-radius: 50%;
+ text-indent: -1px; /* account for the dashicon alignment */
+}
+
+.no-js.nav-menus-php .item-edit:before {
+ display: none;
+}
+
+.rtl .nav-menus-php .item-edit:before {
+ text-indent: 1px; /* account for the dashicon alignment */
+}
+
+.js.nav-menus-php .item-edit:focus {
+ box-shadow: none;
+}
+
+.nav-menus-php .item-edit:focus:before {
+ box-shadow:
+ 0 0 0 1px #5b9dd9,
+ 0 0 2px 1px rgba(30, 140, 190, 0.8);
+}
+
+/* Menu editing */
+.menu-instructions-inactive {
+ display: none;
+}
+
+.menu-item-settings {
+ display: block;
+ width: 402px;
+ padding: 10px 0 10px 10px;
+ position: relative;
+ z-index: 10; /* Keep .item-title's shadow from appearing on top of .menu-item-settings */
+ border: 1px solid #e5e5e5;
+ border-top: none;
+ box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
+}
+
+.menu-item-settings .field-move {
+ margin: 3px 0 5px;
+ line-height: 1.5;
+}
+
+.field-move-visual-label {
+ float: left;
+ margin-right: 4px;
+ font-style: italic;
+}
+
+.menu-item-settings .field-move .button-link {
+ display: none;
+ margin: 0 2px;
+ font-style: italic;
+}
+
+.menu-item-edit-active .menu-item-settings {
+ display: block;
+}
+
+.menu-item-edit-inactive .menu-item-settings {
+ display: none;
+}
+
+.add-menu-item-pagelinks {
+ margin: .5em -10px;
+ text-align: center;
+}
+
+.add-menu-item-pagelinks .page-numbers {
+ display: inline-block;
+ min-width: 20px;
+}
+
+.add-menu-item-pagelinks .page-numbers.dots {
+ min-width: 0;
+}
+
+.link-to-original {
+ display: block;
+ margin: 0 0 15px;
+ padding: 3px 5px 5px;
+ border: 1px solid #ddd;
+ color: #72777c;
+ font-size: 12px;
+ font-style: italic;
+}
+
+.link-to-original a {
+ padding-left: 4px;
+ font-style: normal;
+}
+
+.hidden-field {
+ display: none;
+}
+
+.menu-item-settings .description-thin,
+.menu-item-settings .description-wide {
+ margin-right: 10px;
+ float: left;
+}
+
+.description-thin {
+ width: 190px;
+}
+
+.description-wide {
+ width: 390px;
+}
+
+.menu-item-actions {
+ padding-top: 15px;
+ padding-bottom: 7px;
+}
+
+#cancel-save {
+ cursor: pointer;
+}
+
+/* Major/minor publishing actions (classes) */
+.nav-menus-php .major-publishing-actions {
+ clear: both;
+ padding: 10px 0;
+ line-height: 2.1;
+}
+
+.nav-menus-php .major-publishing-actions .publishing-action {
+ text-align: right;
+ float: right;
+}
+
+.nav-menus-php .blank-slate .menu-settings {
+ display: none;
+}
+
+/* Same as the Publish Meta Box #delete-action */
+.nav-menus-php .delete-action {
+ float: left;
+ line-height: 2.1;
+}
+
+.nav-menus-php .major-publishing-actions .form-invalid {
+ padding-left: 4px;
+ margin-left: -4px;
+}
+
+#nav-menus-frame,
+.button-controls,
+#menu-item-url-wrap,
+#menu-item-name-wrap {
+ display: block;
+}
+
+/* =Media Queries
+-------------------------------------------------------------- */
+
+@media only screen and (min-width: 769px) and (max-width: 1000px){
+ body.menu-max-depth-0 {
+ min-width: 0 !important;
+ }
+
+ #menu-management-liquid{
+ width: 100%;
+ }
+
+ .nav-menus-php #post-body-content{
+ min-width: 0;
+ }
+
+ .menu-item-bar .menu-item-handle{
+ width: 90%;
+ }
+}
+
+@media screen and (max-width: 782px) {
+ body.nav-menus-php,
+ body.wp-customizer {
+ min-width: 0 !important;
+ }
+
+ #nav-menus-frame {
+ margin-left: 0;
+ float: none;
+ width: 100%;
+ }
+
+ #wpbody-content #menu-settings-column {
+ display: block;
+ width: 100%;
+ float: none;
+ margin-left: 0;
+ }
+
+ #side-sortables .add-menu-item-tabs {
+ margin: 15px 0 14px;
+ }
+
+ ul.add-menu-item-tabs li.tabs {
+ padding: 13px 15px 14px;
+ }
+
+ .nav-menus-php .customlinkdiv .howto input {
+ width: 65%;
+ }
+
+ .nav-menus-php .quick-search {
+ width: 85%;
+ }
+
+ #menu-management-liquid {
+ margin-top: 25px;
+ }
+
+ .nav-menus-php .menu-name-label.howto span {
+ margin-top: 13px
+ }
+
+ #menu-name {
+ width: 100%;
+ }
+
+ .nav-menus-php #nav-menu-header .major-publishing-actions .publishing-action {
+ padding-top: 1em;
+ }
+
+ .nav-menus-php .delete-action {
+ font-size: 14px;
+ line-height: 2.1;
+ }
+
+ .menu-item-bar .menu-item-handle,
+ .menu-item-settings,
+ .description-wide {
+ width: auto;
+ }
+
+ .menu-item-settings {
+ padding: 10px;
+ }
+
+ .menu-item-settings .description-thin,
+ .menu-item-settings .description-wide {
+ width: 100%;
+ }
+
+ .menu-item-settings input {
+ width: 100%;
+ }
+
+ .menu-item-settings input[type="checkbox"],
+ .menu-item-settings input[type="radio"] {
+ width: 25px;
+ }
+
+ .menu-settings-group {
+ padding-left: 0;
+ }
+
+ .menu-settings-group-name {
+ float: none;
+ width: auto;
+ margin-left: 0;
+ margin-bottom: 15px;
+ }
+
+ .menu-settings-input {
+ float: none;
+ margin-bottom: 15px;
+ }
+
+ .menu-edit .checkbox-input {
+ margin-top: 0;
+ }
+
+ .manage-menus select {
+ margin: 0.5em 0;
+ }
+
+ .widefat .menu-locations .menu-location-title {
+ padding-top: 16px;
+ }
+}
+
+@media only screen and (max-width: 768px) {
+ /* menu locations */
+ #menu-locations-wrap .widefat {
+ width: 100%;
+ }
+}
diff --git a/www/crm/wp-admin/css/nav-menus.min.css b/www/crm/wp-admin/css/nav-menus.min.css
new file mode 100644
index 00000000..5bc44533
--- /dev/null
+++ b/www/crm/wp-admin/css/nav-menus.min.css
@@ -0,0 +1,2 @@
+/*! This file is auto-generated */
+.no-js #message{display:block}ul.add-menu-item-tabs li{padding:3px 5px 4px 8px}.accordion-section ul.add-menu-item-tabs,.accordion-section ul.category-tabs,.accordion-section ul.wp-tab-bar{margin:0}.accordion-section .categorychecklist{margin:13px 0}#nav-menu-meta .accordion-section-content{padding:18px 13px}#nav-menu-meta .button-controls{margin-bottom:0}.has-no-menu-item .button-controls{display:none}#nav-menus-frame{margin-left:300px;margin-top:23px}#wpbody-content #menu-settings-column{display:inline;width:281px;margin-left:-300px;clear:both;float:left;padding-top:0}#menu-settings-column .inside{clear:both;margin:10px 0 0}.metabox-holder-disabled .accordion-section-content,.metabox-holder-disabled .accordion-section-title,.metabox-holder-disabled .postbox{opacity:.5;filter:alpha(opacity=50)}.metabox-holder-disabled .button-controls .select-all{display:none}#wpbody{position:relative}.blank-slate .menu-settings{border:none;margin-top:0;padding-top:0;overflow:hidden}.is-submenu{color:#555d66;font-style:italic;font-weight:400;margin-left:4px}.manage-menus{margin-top:23px;padding:10px;overflow:hidden;background:#fbfbfb}.manage-menus .selected-menu,.manage-menus .submit-btn,.manage-menus select,.nav-menus-php .add-new-menu-action{display:inline-block;margin-right:3px;vertical-align:middle}.manage-menus select,.menu-location-menus select{max-width:100%}.menu-edit #post-body-content h3{margin:1em 0 10px}.menu-settings{border-top:1px solid #eee;margin-top:2em}.menu-settings-group{margin:0 0 10px;overflow:hidden;padding-left:20%}.menu-settings-group:last-of-type{margin-bottom:0}.menu-settings-input{float:left;margin:0;width:100%}.menu-settings-group-name{float:left;clear:both;width:25%;padding:3px 0 0;margin-left:-25%}.menu-settings label{vertical-align:baseline}.menu-edit .checkbox-input{margin-top:4px}.theme-location-set{color:#72777c;font-size:11px}#menu-management-liquid{float:left;min-width:100%;margin-top:3px}#menu-management{position:relative;margin-right:20px;margin-top:-3px;width:100%}#menu-management .menu-edit{margin-bottom:20px}.nav-menus-php #post-body{padding:0 10px;border-top:1px solid #fff;border-bottom:1px solid #ddd;background:#fff}#nav-menu-footer,#nav-menu-header{padding:0 10px;background:#f5f5f5}#nav-menu-header{border-bottom:1px solid #ddd;margin-bottom:0}#nav-menu-header .menu-name-label{display:inline-block;vertical-align:middle;margin-right:7px;font-style:italic}.nav-menus-php #post-body div.error,.nav-menus-php #post-body div.updated{margin:0}.nav-menus-php #post-body-content{position:relative;float:none}.nav-menus-php #post-body-content .post-body-plain{margin-bottom:0}#menu-management .menu-add-new abbr{font-weight:600}#select-nav-menu-container{text-align:right;padding:0 10px 3px 10px;margin-bottom:5px}#select-nav-menu{width:100px;display:inline}#menu-name-label{margin-top:-2px}.widefat .menu-locations .menu-location-title{padding:13px 10px 0}.menu-location-title label{font-weight:600}.menu-location-menus select{float:left}#locations-nav-menu-wrapper{padding:5px 0}.locations-nav-menu-select select{float:left;width:160px;margin-right:5px}.locations-row-links{float:left;margin:6px 0 0 6px}.locations-add-menu-link,.locations-edit-menu-link{margin:0 3px}.locations-edit-menu-link{padding-right:3px;border-right:1px solid #ccc}#menu-management .inside{padding:0 10px}.customlinkdiv .menu-item-textbox,.postbox .howto input{width:180px;float:right}.accordion-container .outer-border{margin:0}.customlinkdiv p{margin-top:0}#nav-menu-theme-locations .howto select{width:100%}#nav-menu-theme-locations .button-controls{text-align:right}.add-menu-item-view-all{height:400px}#menu-container .submit{margin:0 0 10px;padding:0}#cancel-save{text-decoration:underline;font-size:12px;margin-left:20px;margin-top:5px}.button-primary.right,.button-secondary.right,.button.right{float:right}.list-controls{float:left;margin-top:5px}.add-to-menu{float:right}.button-controls{clear:both;margin:10px 0}.hide-all,.show-all{cursor:pointer}.hide-all{display:none}#menu-name{width:270px;vertical-align:middle}#manage-menu .inside{padding:0 0}#available-links dt{display:block}#add-custom-link .howto{font-size:12px}#add-custom-link label span{display:block;float:left;margin-top:5px;padding-right:5px}.menu-item-textbox{width:180px}.customlinkdiv label,.nav-menus-php .howto span{float:left;margin-top:6px}.quick-search{width:190px}.quick-search-wrap .spinner{float:none;margin:-3px -10px 0 0}.nav-menus-php .list-wrap{display:none;clear:both;margin-bottom:10px}.nav-menus-php .postbox p.submit{margin-bottom:0}.nav-menus-php .list li{display:none;margin:0;margin-bottom:5px}.nav-menus-php .list li .menu-item-title{cursor:pointer;display:block}.nav-menus-php .list li .menu-item-title input{margin-right:3px;margin-top:-3px}.menu-item-title input[type=checkbox]{display:inline-block;margin-top:-4px}#menu-container .inside{padding-bottom:10px}.menu{padding-top:1em}#menu-to-edit{margin:0;padding:.1em 0}.menu ul{width:100%}.menu li{margin-bottom:0;position:relative}.menu-item-bar{clear:both;line-height:1.5;position:relative;margin:9px 0 0}.menu-item-bar .menu-item-handle{border:1px solid #ddd;position:relative;padding:10px 15px;height:auto;min-height:20px;width:382px;line-height:2.4;overflow:hidden;word-wrap:break-word}.menu-item-bar .menu-item-handle:hover{border-color:#999}#menu-to-edit .menu-item-invalid .menu-item-handle{background:#f6c9cc;border-color:#f1acb1}.no-js .menu-item-edit-active .item-edit{display:none}.js .menu-item-handle{cursor:move}.menu li.deleting .menu-item-handle{background-image:none;background-color:#f66}.menu-item-handle .item-title{font-size:13px;font-weight:600;line-height:1.6;display:block;margin-right:13em}.menu-item-handle .menu-item-title.no-title{color:#72777c}li.menu-item.ui-sortable-helper .menu-item-bar{margin-top:0}li.menu-item.ui-sortable-helper .menu-item-transport .menu-item-bar{margin-top:9px}.menu .sortable-placeholder{height:35px;width:410px;margin-top:9px}.menu-item .menu-item-transport:empty{display:none}.menu-item-depth-0{margin-left:0}.menu-item-depth-1{margin-left:30px}.menu-item-depth-2{margin-left:60px}.menu-item-depth-3{margin-left:90px}.menu-item-depth-4{margin-left:120px}.menu-item-depth-5{margin-left:150px}.menu-item-depth-6{margin-left:180px}.menu-item-depth-7{margin-left:210px}.menu-item-depth-8{margin-left:240px}.menu-item-depth-9{margin-left:270px}.menu-item-depth-10{margin-left:300px}.menu-item-depth-11{margin-left:330px}.menu-item-depth-0 .menu-item-transport{margin-left:0}.menu-item-depth-1 .menu-item-transport{margin-left:-30px}.menu-item-depth-2 .menu-item-transport{margin-left:-60px}.menu-item-depth-3 .menu-item-transport{margin-left:-90px}.menu-item-depth-4 .menu-item-transport{margin-left:-120px}.menu-item-depth-5 .menu-item-transport{margin-left:-150px}.menu-item-depth-6 .menu-item-transport{margin-left:-180px}.menu-item-depth-7 .menu-item-transport{margin-left:-210px}.menu-item-depth-8 .menu-item-transport{margin-left:-240px}.menu-item-depth-9 .menu-item-transport{margin-left:-270px}.menu-item-depth-10 .menu-item-transport{margin-left:-300px}.menu-item-depth-11 .menu-item-transport{margin-left:-330px}body.menu-max-depth-0{min-width:950px!important}body.menu-max-depth-1{min-width:980px!important}body.menu-max-depth-2{min-width:1010px!important}body.menu-max-depth-3{min-width:1040px!important}body.menu-max-depth-4{min-width:1070px!important}body.menu-max-depth-5{min-width:1100px!important}body.menu-max-depth-6{min-width:1130px!important}body.menu-max-depth-7{min-width:1160px!important}body.menu-max-depth-8{min-width:1190px!important}body.menu-max-depth-9{min-width:1220px!important}body.menu-max-depth-10{min-width:1250px!important}body.menu-max-depth-11{min-width:1280px!important}.item-type{display:inline-block;padding:12px 16px;color:#666;font-size:12px;line-height:1.5}.item-controls{font-size:12px;position:absolute;right:20px;top:-1px}.item-controls a{text-decoration:none}.item-controls a:hover{cursor:pointer}.item-controls .item-order{padding-right:10px}.nav-menus-php .item-edit{position:absolute;right:-20px;top:0;display:block;width:30px;height:40px;outline:0}.no-js.nav-menus-php .item-edit{position:static;float:right;width:auto;height:auto;margin:12px -10px 12px 0;padding:0;color:#0073aa;text-decoration:underline;font-size:12px;line-height:1.5}.no-js.nav-menus-php .item-edit .screen-reader-text{position:static;-webkit-clip-path:none;clip-path:none;width:auto;height:auto;margin:0}.nav-menus-php .item-edit:before{margin-top:10px;margin-left:4px;width:20px;border-radius:50%;text-indent:-1px}.no-js.nav-menus-php .item-edit:before{display:none}.rtl .nav-menus-php .item-edit:before{text-indent:1px}.js.nav-menus-php .item-edit:focus{box-shadow:none}.nav-menus-php .item-edit:focus:before{box-shadow:0 0 0 1px #5b9dd9,0 0 2px 1px rgba(30,140,190,.8)}.menu-instructions-inactive{display:none}.menu-item-settings{display:block;width:402px;padding:10px 0 10px 10px;position:relative;z-index:10;border:1px solid #e5e5e5;border-top:none;box-shadow:0 1px 1px rgba(0,0,0,.04)}.menu-item-settings .field-move{margin:3px 0 5px;line-height:1.5}.field-move-visual-label{float:left;margin-right:4px;font-style:italic}.menu-item-settings .field-move .button-link{display:none;margin:0 2px;font-style:italic}.menu-item-edit-active .menu-item-settings{display:block}.menu-item-edit-inactive .menu-item-settings{display:none}.add-menu-item-pagelinks{margin:.5em -10px;text-align:center}.add-menu-item-pagelinks .page-numbers{display:inline-block;min-width:20px}.add-menu-item-pagelinks .page-numbers.dots{min-width:0}.link-to-original{display:block;margin:0 0 15px;padding:3px 5px 5px;border:1px solid #ddd;color:#72777c;font-size:12px;font-style:italic}.link-to-original a{padding-left:4px;font-style:normal}.hidden-field{display:none}.menu-item-settings .description-thin,.menu-item-settings .description-wide{margin-right:10px;float:left}.description-thin{width:190px}.description-wide{width:390px}.menu-item-actions{padding-top:15px;padding-bottom:7px}#cancel-save{cursor:pointer}.nav-menus-php .major-publishing-actions{clear:both;padding:10px 0;line-height:2.1}.nav-menus-php .major-publishing-actions .publishing-action{text-align:right;float:right}.nav-menus-php .blank-slate .menu-settings{display:none}.nav-menus-php .delete-action{float:left;line-height:2.1}.nav-menus-php .major-publishing-actions .form-invalid{padding-left:4px;margin-left:-4px}#menu-item-name-wrap,#menu-item-url-wrap,#nav-menus-frame,.button-controls{display:block}@media only screen and (min-width:769px) and (max-width:1000px){body.menu-max-depth-0{min-width:0!important}#menu-management-liquid{width:100%}.nav-menus-php #post-body-content{min-width:0}.menu-item-bar .menu-item-handle{width:90%}}@media screen and (max-width:782px){body.nav-menus-php,body.wp-customizer{min-width:0!important}#nav-menus-frame{margin-left:0;float:none;width:100%}#wpbody-content #menu-settings-column{display:block;width:100%;float:none;margin-left:0}#side-sortables .add-menu-item-tabs{margin:15px 0 14px}ul.add-menu-item-tabs li.tabs{padding:13px 15px 14px}.nav-menus-php .customlinkdiv .howto input{width:65%}.nav-menus-php .quick-search{width:85%}#menu-management-liquid{margin-top:25px}.nav-menus-php .menu-name-label.howto span{margin-top:13px}#menu-name{width:100%}.nav-menus-php #nav-menu-header .major-publishing-actions .publishing-action{padding-top:1em}.nav-menus-php .delete-action{font-size:14px;line-height:2.1}.description-wide,.menu-item-bar .menu-item-handle,.menu-item-settings{width:auto}.menu-item-settings{padding:10px}.menu-item-settings .description-thin,.menu-item-settings .description-wide{width:100%}.menu-item-settings input{width:100%}.menu-item-settings input[type=checkbox],.menu-item-settings input[type=radio]{width:25px}.menu-settings-group{padding-left:0}.menu-settings-group-name{float:none;width:auto;margin-left:0;margin-bottom:15px}.menu-settings-input{float:none;margin-bottom:15px}.menu-edit .checkbox-input{margin-top:0}.manage-menus select{margin:.5em 0}.widefat .menu-locations .menu-location-title{padding-top:16px}}@media only screen and (max-width:768px){#menu-locations-wrap .widefat{width:100%}} \ No newline at end of file
diff --git a/www/crm/wp-admin/css/revisions-rtl.css b/www/crm/wp-admin/css/revisions-rtl.css
new file mode 100644
index 00000000..14984abb
--- /dev/null
+++ b/www/crm/wp-admin/css/revisions-rtl.css
@@ -0,0 +1,601 @@
+/*------------------------------------------------------------------------------
+ 11.2 - Post Revisions
+------------------------------------------------------------------------------*/
+.revisions-control-frame,
+.revisions-diff-frame {
+ position: relative;
+}
+
+.revisions-diff-frame {
+ top: 10px;
+}
+
+.revisions-controls {
+ padding-top: 40px;
+ z-index: 1;
+}
+
+.revisions-controls input[type="checkbox"] {
+ position: relative;
+ top: -1px;
+ vertical-align: text-bottom;
+}
+
+.revisions.pinned .revisions-controls {
+ position: fixed;
+ top: 0;
+ height: 82px;
+ background: #fff;
+ box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
+}
+
+.revisions-tickmarks {
+ position: relative;
+ margin: 0 auto;
+ height: 0.7em;
+ top: 7px;
+ max-width: 70%;
+ box-sizing: border-box;
+ background-color: #fff;
+}
+
+.revisions-tickmarks > div {
+ position: absolute;
+ height: 100%;
+ border-right: 1px solid #a0a5aa;
+ box-sizing: border-box;
+}
+
+.revisions-tickmarks > div:first-child {
+ border-width: 0;
+}
+
+.comparing-two-revisions .revisions-controls {
+ height: 140px;
+}
+
+.comparing-two-revisions.pinned .revisions-controls {
+ height: 124px;
+}
+
+.revisions .diff-error {
+ position: absolute;
+ text-align: center;
+ margin: 0 auto;
+ width: 100%;
+ display: none;
+}
+
+.revisions.diff-error .diff-error {
+ display: block;
+}
+
+.revisions .loading-indicator {
+ position: absolute;
+ vertical-align: middle;
+ opacity: 0;
+ width: 100%;
+ width: calc( 100% - 30px );
+ top: 50%;
+ top: calc( 50% - 10px );
+ transition: opacity 0.5s;
+ filter: alpha(opacity=0); /* ie8 and earlier */
+}
+
+body.folded .revisions .loading-indicator {
+ margin-right: -32px;
+}
+
+.revisions .loading-indicator span.spinner {
+ display: block;
+ margin: 0 auto;
+ float: none;
+}
+
+.revisions.loading .loading-indicator {
+ opacity: 1;
+ filter: alpha(opacity=100); /* ie8 and earlier */
+}
+
+.revisions .diff {
+ transition: opacity 0.5s;
+}
+
+.revisions.loading .diff {
+ opacity: 0.5;
+ filter: alpha(opacity=50); /* ie8 and earlier */
+}
+
+.revisions.diff-error .diff {
+ visibility: hidden;
+}
+
+.revisions-meta {
+ margin-top: 20px;
+ background-color: #fff;
+ box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
+ overflow: hidden;
+}
+
+.revisions.pinned .revisions-meta {
+ box-shadow: none;
+}
+
+.revision-toggle-compare-mode {
+ position: absolute;
+ top: 0;
+ left: 0;
+}
+
+.comparing-two-revisions .revisions-previous,
+.comparing-two-revisions .revisions-next,
+.revisions-meta .diff-meta-to strong {
+ display: none;
+}
+
+.revisions-controls .author-card .date {
+ color: #72777c;
+}
+
+.revisions-controls .author-card.autosave {
+ color: #d54e21;
+}
+
+.revisions-controls .author-card .author-name {
+ font-weight: 600;
+}
+
+.comparing-two-revisions .diff-meta-to strong {
+ display: block;
+}
+
+.revisions.pinned .revisions-buttons {
+ padding: 0 11px;
+}
+
+.revisions-previous,
+.revisions-next {
+ position: relative;
+ z-index: 1;
+}
+
+.revisions-previous {
+ float: right;
+}
+
+.revisions-next {
+ float: left;
+}
+
+.revisions-controls .wp-slider {
+ max-width: 70%;
+ margin: 0 auto;
+ top: -3px;
+}
+
+.revisions-diff {
+ padding: 15px;
+ background-color: #fff;
+ box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
+}
+
+.revisions-diff h3:first-child {
+ margin-top: 0;
+}
+
+/* Revision meta box */
+.post-revisions li img,
+#revisions-meta-restored img {
+ vertical-align: middle;
+}
+
+table.diff tbody tr td:nth-child(2) {
+ width: 4%;
+}
+
+table.diff {
+ table-layout: fixed;
+ width: 100%;
+ white-space: pre-wrap;
+}
+
+table.diff col.content {
+ width: auto;
+}
+
+table.diff col.content.diffsplit {
+ width: 48%;
+}
+
+table.diff col.diffsplit.middle {
+ width: auto;
+}
+
+table.diff col.ltype {
+ width: 30px;
+}
+
+table.diff tr {
+ background-color: transparent;
+}
+
+table.diff td,
+table.diff th {
+ font-family: Consolas, Monaco, monospace;
+ font-size: 14px;
+ line-height: 1.618;
+ padding: .5em;
+ vertical-align: top;
+ word-wrap: break-word;
+}
+
+table.diff td h1,
+table.diff td h2,
+table.diff td h3,
+table.diff td h4,
+table.diff td h5,
+table.diff td h6 {
+ margin: 0;
+}
+
+table.diff .diff-deletedline del,
+table.diff .diff-addedline ins {
+ text-decoration: none;
+}
+
+table.diff .diff-deletedline {
+ background-color: #ffe9e9;
+}
+
+table.diff .diff-deletedline del {
+ background-color: #faa;
+}
+
+table.diff .diff-addedline {
+ background-color: #e9ffe9;
+}
+
+table.diff .diff-addedline ins {
+ background-color: #afa;
+}
+
+.diff-meta {
+ padding: 5px;
+ clear: both;
+ min-height: 32px;
+}
+
+.diff-title strong {
+ line-height: 32px;
+ min-width: 60px;
+ text-align: left;
+ float: right;
+ margin-left: 5px;
+}
+
+.revisions-controls .author-card .author-info {
+ font-size: 12px;
+ line-height: 16px;
+}
+
+.revisions-controls .author-card .avatar,
+.revisions-controls .author-card .author-info {
+ float: right;
+ margin-right: 6px;
+ margin-left: 6px;
+}
+
+.revisions-controls .author-card .byline {
+ display: block;
+ font-size: 12px;
+}
+
+.revisions-controls .author-card .avatar {
+ vertical-align: middle;
+}
+
+.diff-meta input.restore-revision {
+ float: left;
+ margin-right: 6px;
+ margin-left: 6px;
+ margin-top: 2px;
+}
+
+.diff-meta-from {
+ display: none;
+}
+
+.comparing-two-revisions .diff-meta-from {
+ display: block;
+}
+
+.revisions-tooltip {
+ position: absolute;
+ bottom: 105px;
+ margin-left: 0;
+ margin-right: -69px;
+ z-index: 0;
+ max-width: 350px;
+ min-width: 130px;
+ padding: 8px 4px;
+ display: none;
+ opacity: 0;
+}
+
+.revisions-tooltip.flipped {
+ margin-right: 0;
+ margin-left: -70px;
+}
+
+.revisions.pinned .revisions-tooltip {
+ display: none !important;
+}
+
+.comparing-two-revisions .revisions-tooltip {
+ bottom: 145px;
+}
+
+.revisions-tooltip-arrow {
+ width: 70px;
+ height: 15px;
+ overflow: hidden;
+ position: absolute;
+ right: 0;
+ margin-right: 35px;
+ bottom: -15px;
+}
+
+.revisions-tooltip.flipped .revisions-tooltip-arrow {
+ margin-right: 0;
+ margin-left: 35px;
+ right: auto;
+ left: 0;
+}
+
+.revisions-tooltip-arrow > span {
+ content: "";
+ position: absolute;
+ right: 20px;
+ top: -20px;
+ width: 25px;
+ height: 25px;
+ transform: rotate(-45deg);
+}
+
+.revisions-tooltip.flipped .revisions-tooltip-arrow > span {
+ right: auto;
+ left: 20px;
+}
+
+.ie8 .revisions-tooltip-arrow > span {
+ right: 15px;
+ top: -25px;
+ -ms-filter: "progid:DXImageTransform.Microsoft.Matrix(SizingMethod='auto expand', M11=0.7071067811865476, M12=-0.7071067811865475, M21=0.7071067811865475, M22=0.7071067811865476)";
+}
+
+.ie8 .revisions-tooltip.flipped .revisions-tooltip-arrow > span {
+ left: 25px;
+}
+
+.revisions-tooltip,
+.revisions-tooltip-arrow > span {
+ border: 1px solid #ddd;
+ background-color: #fff;
+}
+
+.revisions-tooltip {
+ display: none;
+}
+
+.arrow {
+ width: 70px;
+ height: 16px;
+ overflow: hidden;
+ position: absolute;
+ right: 0;
+ margin-right: -35px;
+ bottom: 90px;
+ z-index: 10000;
+}
+
+.arrow:after {
+ z-index: 9999;
+ background-color: #fff;
+ box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
+}
+
+.arrow.top {
+ top: -16px;
+ bottom: auto;
+}
+
+.arrow.left {
+ right: 20%;
+}
+
+.arrow:after {
+ content: "";
+ position: absolute;
+ right: 20px;
+ top: -20px;
+ width: 25px;
+ height: 25px;
+ transform: rotate(-45deg);
+}
+
+.revisions-tooltip,
+.revisions-tooltip-arrow:after {
+ border-width: 1px;
+ border-style: solid;
+}
+
+div.revisions-controls > .wp-slider > .ui-slider-handle {
+ margin-right: -10px;
+}
+
+.rtl div.revisions-controls > .wp-slider > .ui-slider-handle {
+ margin-left: -10px;
+}
+
+/* jQuery UI Slider */
+.wp-slider.ui-slider {
+ position: relative;
+ border: 1px solid #ddd;
+ text-align: right;
+ cursor: pointer;
+}
+
+.wp-slider .ui-slider-handle {
+ border-radius: 50%;
+ height: 18px;
+ margin-top: -5px;
+ outline: none;
+ padding: 2px;
+ position: absolute;
+ width: 18px;
+ z-index: 2;
+ touch-action: none;
+}
+
+.wp-slider .ui-slider-handle,
+.wp-slider .ui-slider-handle.focus {
+ background: #f7f7f7;
+ border: 1px solid #ccc;
+ box-shadow: 0 1px 0 #cccccc;
+}
+
+.wp-slider .ui-slider-handle:hover,
+.wp-slider .ui-slider-handle.ui-state-hover {
+ background: #fafafa;
+ border-color: #999;
+}
+
+.wp-slider .ui-slider-handle:active,
+.wp-slider .ui-slider-handle.ui-state-active {
+ background: #eee;
+ border-color: #999;
+ box-shadow: inset 0 2px 5px -3px rgba(0, 0, 0, 0.5);
+ transform: translateY(1px);
+}
+
+.wp-slider .ui-slider-handle:before {
+ background: none;
+ position: absolute;
+ top: 2px;
+ right: 2px;
+ color: #555;
+ content: "\f229";
+ font: normal 18px/1 dashicons;
+ speak: none;
+ -webkit-font-smoothing: antialiased;
+ -moz-osx-font-smoothing: grayscale;
+}
+
+.wp-slider .ui-slider-handle:hover:before,
+.wp-slider .ui-slider-handle.ui-state-hover:before {
+ color: #23282d;
+}
+
+.wp-slider .ui-slider-handle.from-handle:before,
+.wp-slider .ui-slider-handle.to-handle:before {
+ font-size: 20px !important;
+ margin: -1px -1px 0 0;
+}
+
+.wp-slider .ui-slider-handle.from-handle:before {
+ content: "\f141";
+}
+
+.wp-slider .ui-slider-handle.to-handle:before {
+ content: "\f139";
+}
+
+.rtl .wp-slider .ui-slider-handle.from-handle:before {
+ content: "\f139";
+}
+
+.rtl .wp-slider .ui-slider-handle.to-handle:before {
+ content: "\f141";
+ left: -1px;
+}
+
+.wp-slider .ui-slider-range {
+ position: absolute;
+ font-size: .7em;
+ display: block;
+ border: 0;
+ background-color: transparent;
+ background-image: none;
+}
+
+.wp-slider.ui-slider-horizontal {
+ height: .7em;
+}
+
+.wp-slider.ui-slider-horizontal .ui-slider-handle {
+ top: -.25em;
+ margin-right: -.6em;
+}
+
+.wp-slider.ui-slider-horizontal .ui-slider-range {
+ top: 0;
+ height: 100%;
+}
+
+.wp-slider.ui-slider-horizontal .ui-slider-range-min {
+ right: 0;
+}
+
+.wp-slider.ui-slider-horizontal .ui-slider-range-max {
+ left: 0;
+}
+
+/* =Media Queries
+-------------------------------------------------------------- */
+
+/**
+ * HiDPI Displays
+ */
+@media print,
+ (-webkit-min-device-pixel-ratio: 1.25),
+ (min-resolution: 120dpi) {
+ .revision-tick.completed-false {
+ background-image: url(../images/spinner-2x.gif);
+ }
+}
+
+@media screen and (max-width: 782px) {
+ #diff-next-revision,
+ #diff-previous-revision {
+ margin-top: -1em;
+ }
+
+ .revisions-buttons {
+ overflow: hidden;
+ margin-bottom: 15px;
+ }
+
+ .revisions-controls,
+ .comparing-two-revisions .revisions-controls {
+ height: 170px;
+ }
+
+ .revisions-tooltip {
+ bottom: 130px;
+ z-index: 2;
+ }
+
+ .diff-meta {
+ overflow: hidden;
+ }
+
+ table.diff {
+ -ms-word-break: break-all;
+ word-break: break-all;
+ word-wrap: break-word;
+ }
+
+ .diff-meta input.restore-revision {
+ margin-top: 0;
+ }
+}
diff --git a/www/crm/wp-admin/css/revisions-rtl.min.css b/www/crm/wp-admin/css/revisions-rtl.min.css
new file mode 100644
index 00000000..24709f90
--- /dev/null
+++ b/www/crm/wp-admin/css/revisions-rtl.min.css
@@ -0,0 +1,2 @@
+/*! This file is auto-generated */
+.revisions-control-frame,.revisions-diff-frame{position:relative}.revisions-diff-frame{top:10px}.revisions-controls{padding-top:40px;z-index:1}.revisions-controls input[type=checkbox]{position:relative;top:-1px;vertical-align:text-bottom}.revisions.pinned .revisions-controls{position:fixed;top:0;height:82px;background:#fff;box-shadow:0 1px 3px rgba(0,0,0,.1)}.revisions-tickmarks{position:relative;margin:0 auto;height:.7em;top:7px;max-width:70%;box-sizing:border-box;background-color:#fff}.revisions-tickmarks>div{position:absolute;height:100%;border-right:1px solid #a0a5aa;box-sizing:border-box}.revisions-tickmarks>div:first-child{border-width:0}.comparing-two-revisions .revisions-controls{height:140px}.comparing-two-revisions.pinned .revisions-controls{height:124px}.revisions .diff-error{position:absolute;text-align:center;margin:0 auto;width:100%;display:none}.revisions.diff-error .diff-error{display:block}.revisions .loading-indicator{position:absolute;vertical-align:middle;opacity:0;width:100%;width:calc(100% - 30px);top:50%;top:calc(50% - 10px);transition:opacity .5s;filter:alpha(opacity=0)}body.folded .revisions .loading-indicator{margin-right:-32px}.revisions .loading-indicator span.spinner{display:block;margin:0 auto;float:none}.revisions.loading .loading-indicator{opacity:1;filter:alpha(opacity=100)}.revisions .diff{transition:opacity .5s}.revisions.loading .diff{opacity:.5;filter:alpha(opacity=50)}.revisions.diff-error .diff{visibility:hidden}.revisions-meta{margin-top:20px;background-color:#fff;box-shadow:0 1px 3px rgba(0,0,0,.1);overflow:hidden}.revisions.pinned .revisions-meta{box-shadow:none}.revision-toggle-compare-mode{position:absolute;top:0;left:0}.comparing-two-revisions .revisions-next,.comparing-two-revisions .revisions-previous,.revisions-meta .diff-meta-to strong{display:none}.revisions-controls .author-card .date{color:#72777c}.revisions-controls .author-card.autosave{color:#d54e21}.revisions-controls .author-card .author-name{font-weight:600}.comparing-two-revisions .diff-meta-to strong{display:block}.revisions.pinned .revisions-buttons{padding:0 11px}.revisions-next,.revisions-previous{position:relative;z-index:1}.revisions-previous{float:right}.revisions-next{float:left}.revisions-controls .wp-slider{max-width:70%;margin:0 auto;top:-3px}.revisions-diff{padding:15px;background-color:#fff;box-shadow:0 1px 3px rgba(0,0,0,.1)}.revisions-diff h3:first-child{margin-top:0}#revisions-meta-restored img,.post-revisions li img{vertical-align:middle}table.diff tbody tr td:nth-child(2){width:4%}table.diff{table-layout:fixed;width:100%;white-space:pre-wrap}table.diff col.content{width:auto}table.diff col.content.diffsplit{width:48%}table.diff col.diffsplit.middle{width:auto}table.diff col.ltype{width:30px}table.diff tr{background-color:transparent}table.diff td,table.diff th{font-family:Consolas,Monaco,monospace;font-size:14px;line-height:1.618;padding:.5em;vertical-align:top;word-wrap:break-word}table.diff td h1,table.diff td h2,table.diff td h3,table.diff td h4,table.diff td h5,table.diff td h6{margin:0}table.diff .diff-addedline ins,table.diff .diff-deletedline del{text-decoration:none}table.diff .diff-deletedline{background-color:#ffe9e9}table.diff .diff-deletedline del{background-color:#faa}table.diff .diff-addedline{background-color:#e9ffe9}table.diff .diff-addedline ins{background-color:#afa}.diff-meta{padding:5px;clear:both;min-height:32px}.diff-title strong{line-height:32px;min-width:60px;text-align:left;float:right;margin-left:5px}.revisions-controls .author-card .author-info{font-size:12px;line-height:16px}.revisions-controls .author-card .author-info,.revisions-controls .author-card .avatar{float:right;margin-right:6px;margin-left:6px}.revisions-controls .author-card .byline{display:block;font-size:12px}.revisions-controls .author-card .avatar{vertical-align:middle}.diff-meta input.restore-revision{float:left;margin-right:6px;margin-left:6px;margin-top:2px}.diff-meta-from{display:none}.comparing-two-revisions .diff-meta-from{display:block}.revisions-tooltip{position:absolute;bottom:105px;margin-left:0;margin-right:-69px;z-index:0;max-width:350px;min-width:130px;padding:8px 4px;display:none;opacity:0}.revisions-tooltip.flipped{margin-right:0;margin-left:-70px}.revisions.pinned .revisions-tooltip{display:none!important}.comparing-two-revisions .revisions-tooltip{bottom:145px}.revisions-tooltip-arrow{width:70px;height:15px;overflow:hidden;position:absolute;right:0;margin-right:35px;bottom:-15px}.revisions-tooltip.flipped .revisions-tooltip-arrow{margin-right:0;margin-left:35px;right:auto;left:0}.revisions-tooltip-arrow>span{content:"";position:absolute;right:20px;top:-20px;width:25px;height:25px;transform:rotate(-45deg)}.revisions-tooltip.flipped .revisions-tooltip-arrow>span{right:auto;left:20px}.ie8 .revisions-tooltip-arrow>span{right:15px;top:-25px;-ms-filter:"progid:DXImageTransform.Microsoft.Matrix(SizingMethod='auto expand', M11=0.7071067811865476, M12=-0.7071067811865475, M21=0.7071067811865475, M22=0.7071067811865476)"}.ie8 .revisions-tooltip.flipped .revisions-tooltip-arrow>span{left:25px}.revisions-tooltip,.revisions-tooltip-arrow>span{border:1px solid #ddd;background-color:#fff}.revisions-tooltip{display:none}.arrow{width:70px;height:16px;overflow:hidden;position:absolute;right:0;margin-right:-35px;bottom:90px;z-index:10000}.arrow:after{z-index:9999;background-color:#fff;box-shadow:0 1px 3px rgba(0,0,0,.1)}.arrow.top{top:-16px;bottom:auto}.arrow.left{right:20%}.arrow:after{content:"";position:absolute;right:20px;top:-20px;width:25px;height:25px;transform:rotate(-45deg)}.revisions-tooltip,.revisions-tooltip-arrow:after{border-width:1px;border-style:solid}div.revisions-controls>.wp-slider>.ui-slider-handle{margin-right:-10px}.rtl div.revisions-controls>.wp-slider>.ui-slider-handle{margin-left:-10px}.wp-slider.ui-slider{position:relative;border:1px solid #ddd;text-align:right;cursor:pointer}.wp-slider .ui-slider-handle{border-radius:50%;height:18px;margin-top:-5px;outline:0;padding:2px;position:absolute;width:18px;z-index:2;touch-action:none}.wp-slider .ui-slider-handle,.wp-slider .ui-slider-handle.focus{background:#f7f7f7;border:1px solid #ccc;box-shadow:0 1px 0 #ccc}.wp-slider .ui-slider-handle.ui-state-hover,.wp-slider .ui-slider-handle:hover{background:#fafafa;border-color:#999}.wp-slider .ui-slider-handle.ui-state-active,.wp-slider .ui-slider-handle:active{background:#eee;border-color:#999;box-shadow:inset 0 2px 5px -3px rgba(0,0,0,.5);transform:translateY(1px)}.wp-slider .ui-slider-handle:before{background:0 0;position:absolute;top:2px;right:2px;color:#555;content:"\f229";font:normal 18px/1 dashicons;speak:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.wp-slider .ui-slider-handle.ui-state-hover:before,.wp-slider .ui-slider-handle:hover:before{color:#23282d}.wp-slider .ui-slider-handle.from-handle:before,.wp-slider .ui-slider-handle.to-handle:before{font-size:20px!important;margin:-1px -1px 0 0}.wp-slider .ui-slider-handle.from-handle:before{content:"\f141"}.wp-slider .ui-slider-handle.to-handle:before{content:"\f139"}.rtl .wp-slider .ui-slider-handle.from-handle:before{content:"\f139"}.rtl .wp-slider .ui-slider-handle.to-handle:before{content:"\f141";left:-1px}.wp-slider .ui-slider-range{position:absolute;font-size:.7em;display:block;border:0;background-color:transparent;background-image:none}.wp-slider.ui-slider-horizontal{height:.7em}.wp-slider.ui-slider-horizontal .ui-slider-handle{top:-.25em;margin-right:-.6em}.wp-slider.ui-slider-horizontal .ui-slider-range{top:0;height:100%}.wp-slider.ui-slider-horizontal .ui-slider-range-min{right:0}.wp-slider.ui-slider-horizontal .ui-slider-range-max{left:0}@media print,(-webkit-min-device-pixel-ratio:1.25),(min-resolution:120dpi){.revision-tick.completed-false{background-image:url(../images/spinner-2x.gif)}}@media screen and (max-width:782px){#diff-next-revision,#diff-previous-revision{margin-top:-1em}.revisions-buttons{overflow:hidden;margin-bottom:15px}.comparing-two-revisions .revisions-controls,.revisions-controls{height:170px}.revisions-tooltip{bottom:130px;z-index:2}.diff-meta{overflow:hidden}table.diff{-ms-word-break:break-all;word-break:break-all;word-wrap:break-word}.diff-meta input.restore-revision{margin-top:0}} \ No newline at end of file
diff --git a/www/crm/wp-admin/css/revisions.css b/www/crm/wp-admin/css/revisions.css
new file mode 100644
index 00000000..2069b4fe
--- /dev/null
+++ b/www/crm/wp-admin/css/revisions.css
@@ -0,0 +1,601 @@
+/*------------------------------------------------------------------------------
+ 11.2 - Post Revisions
+------------------------------------------------------------------------------*/
+.revisions-control-frame,
+.revisions-diff-frame {
+ position: relative;
+}
+
+.revisions-diff-frame {
+ top: 10px;
+}
+
+.revisions-controls {
+ padding-top: 40px;
+ z-index: 1;
+}
+
+.revisions-controls input[type="checkbox"] {
+ position: relative;
+ top: -1px;
+ vertical-align: text-bottom;
+}
+
+.revisions.pinned .revisions-controls {
+ position: fixed;
+ top: 0;
+ height: 82px;
+ background: #fff;
+ box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
+}
+
+.revisions-tickmarks {
+ position: relative;
+ margin: 0 auto;
+ height: 0.7em;
+ top: 7px;
+ max-width: 70%;
+ box-sizing: border-box;
+ background-color: #fff;
+}
+
+.revisions-tickmarks > div {
+ position: absolute;
+ height: 100%;
+ border-left: 1px solid #a0a5aa;
+ box-sizing: border-box;
+}
+
+.revisions-tickmarks > div:first-child {
+ border-width: 0;
+}
+
+.comparing-two-revisions .revisions-controls {
+ height: 140px;
+}
+
+.comparing-two-revisions.pinned .revisions-controls {
+ height: 124px;
+}
+
+.revisions .diff-error {
+ position: absolute;
+ text-align: center;
+ margin: 0 auto;
+ width: 100%;
+ display: none;
+}
+
+.revisions.diff-error .diff-error {
+ display: block;
+}
+
+.revisions .loading-indicator {
+ position: absolute;
+ vertical-align: middle;
+ opacity: 0;
+ width: 100%;
+ width: calc( 100% - 30px );
+ top: 50%;
+ top: calc( 50% - 10px );
+ transition: opacity 0.5s;
+ filter: alpha(opacity=0); /* ie8 and earlier */
+}
+
+body.folded .revisions .loading-indicator {
+ margin-left: -32px;
+}
+
+.revisions .loading-indicator span.spinner {
+ display: block;
+ margin: 0 auto;
+ float: none;
+}
+
+.revisions.loading .loading-indicator {
+ opacity: 1;
+ filter: alpha(opacity=100); /* ie8 and earlier */
+}
+
+.revisions .diff {
+ transition: opacity 0.5s;
+}
+
+.revisions.loading .diff {
+ opacity: 0.5;
+ filter: alpha(opacity=50); /* ie8 and earlier */
+}
+
+.revisions.diff-error .diff {
+ visibility: hidden;
+}
+
+.revisions-meta {
+ margin-top: 20px;
+ background-color: #fff;
+ box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
+ overflow: hidden;
+}
+
+.revisions.pinned .revisions-meta {
+ box-shadow: none;
+}
+
+.revision-toggle-compare-mode {
+ position: absolute;
+ top: 0;
+ right: 0;
+}
+
+.comparing-two-revisions .revisions-previous,
+.comparing-two-revisions .revisions-next,
+.revisions-meta .diff-meta-to strong {
+ display: none;
+}
+
+.revisions-controls .author-card .date {
+ color: #72777c;
+}
+
+.revisions-controls .author-card.autosave {
+ color: #d54e21;
+}
+
+.revisions-controls .author-card .author-name {
+ font-weight: 600;
+}
+
+.comparing-two-revisions .diff-meta-to strong {
+ display: block;
+}
+
+.revisions.pinned .revisions-buttons {
+ padding: 0 11px;
+}
+
+.revisions-previous,
+.revisions-next {
+ position: relative;
+ z-index: 1;
+}
+
+.revisions-previous {
+ float: left;
+}
+
+.revisions-next {
+ float: right;
+}
+
+.revisions-controls .wp-slider {
+ max-width: 70%;
+ margin: 0 auto;
+ top: -3px;
+}
+
+.revisions-diff {
+ padding: 15px;
+ background-color: #fff;
+ box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
+}
+
+.revisions-diff h3:first-child {
+ margin-top: 0;
+}
+
+/* Revision meta box */
+.post-revisions li img,
+#revisions-meta-restored img {
+ vertical-align: middle;
+}
+
+table.diff tbody tr td:nth-child(2) {
+ width: 4%;
+}
+
+table.diff {
+ table-layout: fixed;
+ width: 100%;
+ white-space: pre-wrap;
+}
+
+table.diff col.content {
+ width: auto;
+}
+
+table.diff col.content.diffsplit {
+ width: 48%;
+}
+
+table.diff col.diffsplit.middle {
+ width: auto;
+}
+
+table.diff col.ltype {
+ width: 30px;
+}
+
+table.diff tr {
+ background-color: transparent;
+}
+
+table.diff td,
+table.diff th {
+ font-family: Consolas, Monaco, monospace;
+ font-size: 14px;
+ line-height: 1.618;
+ padding: .5em;
+ vertical-align: top;
+ word-wrap: break-word;
+}
+
+table.diff td h1,
+table.diff td h2,
+table.diff td h3,
+table.diff td h4,
+table.diff td h5,
+table.diff td h6 {
+ margin: 0;
+}
+
+table.diff .diff-deletedline del,
+table.diff .diff-addedline ins {
+ text-decoration: none;
+}
+
+table.diff .diff-deletedline {
+ background-color: #ffe9e9;
+}
+
+table.diff .diff-deletedline del {
+ background-color: #faa;
+}
+
+table.diff .diff-addedline {
+ background-color: #e9ffe9;
+}
+
+table.diff .diff-addedline ins {
+ background-color: #afa;
+}
+
+.diff-meta {
+ padding: 5px;
+ clear: both;
+ min-height: 32px;
+}
+
+.diff-title strong {
+ line-height: 32px;
+ min-width: 60px;
+ text-align: right;
+ float: left;
+ margin-right: 5px;
+}
+
+.revisions-controls .author-card .author-info {
+ font-size: 12px;
+ line-height: 16px;
+}
+
+.revisions-controls .author-card .avatar,
+.revisions-controls .author-card .author-info {
+ float: left;
+ margin-left: 6px;
+ margin-right: 6px;
+}
+
+.revisions-controls .author-card .byline {
+ display: block;
+ font-size: 12px;
+}
+
+.revisions-controls .author-card .avatar {
+ vertical-align: middle;
+}
+
+.diff-meta input.restore-revision {
+ float: right;
+ margin-left: 6px;
+ margin-right: 6px;
+ margin-top: 2px;
+}
+
+.diff-meta-from {
+ display: none;
+}
+
+.comparing-two-revisions .diff-meta-from {
+ display: block;
+}
+
+.revisions-tooltip {
+ position: absolute;
+ bottom: 105px;
+ margin-right: 0;
+ margin-left: -69px;
+ z-index: 0;
+ max-width: 350px;
+ min-width: 130px;
+ padding: 8px 4px;
+ display: none;
+ opacity: 0;
+}
+
+.revisions-tooltip.flipped {
+ margin-left: 0;
+ margin-right: -70px;
+}
+
+.revisions.pinned .revisions-tooltip {
+ display: none !important;
+}
+
+.comparing-two-revisions .revisions-tooltip {
+ bottom: 145px;
+}
+
+.revisions-tooltip-arrow {
+ width: 70px;
+ height: 15px;
+ overflow: hidden;
+ position: absolute;
+ left: 0;
+ margin-left: 35px;
+ bottom: -15px;
+}
+
+.revisions-tooltip.flipped .revisions-tooltip-arrow {
+ margin-left: 0;
+ margin-right: 35px;
+ left: auto;
+ right: 0;
+}
+
+.revisions-tooltip-arrow > span {
+ content: "";
+ position: absolute;
+ left: 20px;
+ top: -20px;
+ width: 25px;
+ height: 25px;
+ transform: rotate(45deg);
+}
+
+.revisions-tooltip.flipped .revisions-tooltip-arrow > span {
+ left: auto;
+ right: 20px;
+}
+
+.ie8 .revisions-tooltip-arrow > span {
+ left: 15px;
+ top: -25px;
+ -ms-filter: "progid:DXImageTransform.Microsoft.Matrix(SizingMethod='auto expand', M11=0.7071067811865476, M12=-0.7071067811865475, M21=0.7071067811865475, M22=0.7071067811865476)";
+}
+
+.ie8 .revisions-tooltip.flipped .revisions-tooltip-arrow > span {
+ right: 25px;
+}
+
+.revisions-tooltip,
+.revisions-tooltip-arrow > span {
+ border: 1px solid #ddd;
+ background-color: #fff;
+}
+
+.revisions-tooltip {
+ display: none;
+}
+
+.arrow {
+ width: 70px;
+ height: 16px;
+ overflow: hidden;
+ position: absolute;
+ left: 0;
+ margin-left: -35px;
+ bottom: 90px;
+ z-index: 10000;
+}
+
+.arrow:after {
+ z-index: 9999;
+ background-color: #fff;
+ box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
+}
+
+.arrow.top {
+ top: -16px;
+ bottom: auto;
+}
+
+.arrow.left {
+ left: 20%;
+}
+
+.arrow:after {
+ content: "";
+ position: absolute;
+ left: 20px;
+ top: -20px;
+ width: 25px;
+ height: 25px;
+ transform: rotate(45deg);
+}
+
+.revisions-tooltip,
+.revisions-tooltip-arrow:after {
+ border-width: 1px;
+ border-style: solid;
+}
+
+div.revisions-controls > .wp-slider > .ui-slider-handle {
+ margin-left: -10px;
+}
+
+.rtl div.revisions-controls > .wp-slider > .ui-slider-handle {
+ margin-right: -10px;
+}
+
+/* jQuery UI Slider */
+.wp-slider.ui-slider {
+ position: relative;
+ border: 1px solid #ddd;
+ text-align: left;
+ cursor: pointer;
+}
+
+.wp-slider .ui-slider-handle {
+ border-radius: 50%;
+ height: 18px;
+ margin-top: -5px;
+ outline: none;
+ padding: 2px;
+ position: absolute;
+ width: 18px;
+ z-index: 2;
+ touch-action: none;
+}
+
+.wp-slider .ui-slider-handle,
+.wp-slider .ui-slider-handle.focus {
+ background: #f7f7f7;
+ border: 1px solid #ccc;
+ box-shadow: 0 1px 0 #cccccc;
+}
+
+.wp-slider .ui-slider-handle:hover,
+.wp-slider .ui-slider-handle.ui-state-hover {
+ background: #fafafa;
+ border-color: #999;
+}
+
+.wp-slider .ui-slider-handle:active,
+.wp-slider .ui-slider-handle.ui-state-active {
+ background: #eee;
+ border-color: #999;
+ box-shadow: inset 0 2px 5px -3px rgba(0, 0, 0, 0.5);
+ transform: translateY(1px);
+}
+
+.wp-slider .ui-slider-handle:before {
+ background: none;
+ position: absolute;
+ top: 2px;
+ left: 2px;
+ color: #555;
+ content: "\f229";
+ font: normal 18px/1 dashicons;
+ speak: none;
+ -webkit-font-smoothing: antialiased;
+ -moz-osx-font-smoothing: grayscale;
+}
+
+.wp-slider .ui-slider-handle:hover:before,
+.wp-slider .ui-slider-handle.ui-state-hover:before {
+ color: #23282d;
+}
+
+.wp-slider .ui-slider-handle.from-handle:before,
+.wp-slider .ui-slider-handle.to-handle:before {
+ font-size: 20px !important;
+ margin: -1px 0 0 -1px;
+}
+
+.wp-slider .ui-slider-handle.from-handle:before {
+ content: "\f139";
+}
+
+.wp-slider .ui-slider-handle.to-handle:before {
+ content: "\f141";
+}
+
+.rtl .wp-slider .ui-slider-handle.from-handle:before {
+ content: "\f141";
+}
+
+.rtl .wp-slider .ui-slider-handle.to-handle:before {
+ content: "\f139";
+ right: -1px;
+}
+
+.wp-slider .ui-slider-range {
+ position: absolute;
+ font-size: .7em;
+ display: block;
+ border: 0;
+ background-color: transparent;
+ background-image: none;
+}
+
+.wp-slider.ui-slider-horizontal {
+ height: .7em;
+}
+
+.wp-slider.ui-slider-horizontal .ui-slider-handle {
+ top: -.25em;
+ margin-left: -.6em;
+}
+
+.wp-slider.ui-slider-horizontal .ui-slider-range {
+ top: 0;
+ height: 100%;
+}
+
+.wp-slider.ui-slider-horizontal .ui-slider-range-min {
+ left: 0;
+}
+
+.wp-slider.ui-slider-horizontal .ui-slider-range-max {
+ right: 0;
+}
+
+/* =Media Queries
+-------------------------------------------------------------- */
+
+/**
+ * HiDPI Displays
+ */
+@media print,
+ (-webkit-min-device-pixel-ratio: 1.25),
+ (min-resolution: 120dpi) {
+ .revision-tick.completed-false {
+ background-image: url(../images/spinner-2x.gif);
+ }
+}
+
+@media screen and (max-width: 782px) {
+ #diff-next-revision,
+ #diff-previous-revision {
+ margin-top: -1em;
+ }
+
+ .revisions-buttons {
+ overflow: hidden;
+ margin-bottom: 15px;
+ }
+
+ .revisions-controls,
+ .comparing-two-revisions .revisions-controls {
+ height: 170px;
+ }
+
+ .revisions-tooltip {
+ bottom: 130px;
+ z-index: 2;
+ }
+
+ .diff-meta {
+ overflow: hidden;
+ }
+
+ table.diff {
+ -ms-word-break: break-all;
+ word-break: break-all;
+ word-wrap: break-word;
+ }
+
+ .diff-meta input.restore-revision {
+ margin-top: 0;
+ }
+}
diff --git a/www/crm/wp-admin/css/revisions.min.css b/www/crm/wp-admin/css/revisions.min.css
new file mode 100644
index 00000000..1484fe9a
--- /dev/null
+++ b/www/crm/wp-admin/css/revisions.min.css
@@ -0,0 +1,2 @@
+/*! This file is auto-generated */
+.revisions-control-frame,.revisions-diff-frame{position:relative}.revisions-diff-frame{top:10px}.revisions-controls{padding-top:40px;z-index:1}.revisions-controls input[type=checkbox]{position:relative;top:-1px;vertical-align:text-bottom}.revisions.pinned .revisions-controls{position:fixed;top:0;height:82px;background:#fff;box-shadow:0 1px 3px rgba(0,0,0,.1)}.revisions-tickmarks{position:relative;margin:0 auto;height:.7em;top:7px;max-width:70%;box-sizing:border-box;background-color:#fff}.revisions-tickmarks>div{position:absolute;height:100%;border-left:1px solid #a0a5aa;box-sizing:border-box}.revisions-tickmarks>div:first-child{border-width:0}.comparing-two-revisions .revisions-controls{height:140px}.comparing-two-revisions.pinned .revisions-controls{height:124px}.revisions .diff-error{position:absolute;text-align:center;margin:0 auto;width:100%;display:none}.revisions.diff-error .diff-error{display:block}.revisions .loading-indicator{position:absolute;vertical-align:middle;opacity:0;width:100%;width:calc(100% - 30px);top:50%;top:calc(50% - 10px);transition:opacity .5s;filter:alpha(opacity=0)}body.folded .revisions .loading-indicator{margin-left:-32px}.revisions .loading-indicator span.spinner{display:block;margin:0 auto;float:none}.revisions.loading .loading-indicator{opacity:1;filter:alpha(opacity=100)}.revisions .diff{transition:opacity .5s}.revisions.loading .diff{opacity:.5;filter:alpha(opacity=50)}.revisions.diff-error .diff{visibility:hidden}.revisions-meta{margin-top:20px;background-color:#fff;box-shadow:0 1px 3px rgba(0,0,0,.1);overflow:hidden}.revisions.pinned .revisions-meta{box-shadow:none}.revision-toggle-compare-mode{position:absolute;top:0;right:0}.comparing-two-revisions .revisions-next,.comparing-two-revisions .revisions-previous,.revisions-meta .diff-meta-to strong{display:none}.revisions-controls .author-card .date{color:#72777c}.revisions-controls .author-card.autosave{color:#d54e21}.revisions-controls .author-card .author-name{font-weight:600}.comparing-two-revisions .diff-meta-to strong{display:block}.revisions.pinned .revisions-buttons{padding:0 11px}.revisions-next,.revisions-previous{position:relative;z-index:1}.revisions-previous{float:left}.revisions-next{float:right}.revisions-controls .wp-slider{max-width:70%;margin:0 auto;top:-3px}.revisions-diff{padding:15px;background-color:#fff;box-shadow:0 1px 3px rgba(0,0,0,.1)}.revisions-diff h3:first-child{margin-top:0}#revisions-meta-restored img,.post-revisions li img{vertical-align:middle}table.diff tbody tr td:nth-child(2){width:4%}table.diff{table-layout:fixed;width:100%;white-space:pre-wrap}table.diff col.content{width:auto}table.diff col.content.diffsplit{width:48%}table.diff col.diffsplit.middle{width:auto}table.diff col.ltype{width:30px}table.diff tr{background-color:transparent}table.diff td,table.diff th{font-family:Consolas,Monaco,monospace;font-size:14px;line-height:1.618;padding:.5em;vertical-align:top;word-wrap:break-word}table.diff td h1,table.diff td h2,table.diff td h3,table.diff td h4,table.diff td h5,table.diff td h6{margin:0}table.diff .diff-addedline ins,table.diff .diff-deletedline del{text-decoration:none}table.diff .diff-deletedline{background-color:#ffe9e9}table.diff .diff-deletedline del{background-color:#faa}table.diff .diff-addedline{background-color:#e9ffe9}table.diff .diff-addedline ins{background-color:#afa}.diff-meta{padding:5px;clear:both;min-height:32px}.diff-title strong{line-height:32px;min-width:60px;text-align:right;float:left;margin-right:5px}.revisions-controls .author-card .author-info{font-size:12px;line-height:16px}.revisions-controls .author-card .author-info,.revisions-controls .author-card .avatar{float:left;margin-left:6px;margin-right:6px}.revisions-controls .author-card .byline{display:block;font-size:12px}.revisions-controls .author-card .avatar{vertical-align:middle}.diff-meta input.restore-revision{float:right;margin-left:6px;margin-right:6px;margin-top:2px}.diff-meta-from{display:none}.comparing-two-revisions .diff-meta-from{display:block}.revisions-tooltip{position:absolute;bottom:105px;margin-right:0;margin-left:-69px;z-index:0;max-width:350px;min-width:130px;padding:8px 4px;display:none;opacity:0}.revisions-tooltip.flipped{margin-left:0;margin-right:-70px}.revisions.pinned .revisions-tooltip{display:none!important}.comparing-two-revisions .revisions-tooltip{bottom:145px}.revisions-tooltip-arrow{width:70px;height:15px;overflow:hidden;position:absolute;left:0;margin-left:35px;bottom:-15px}.revisions-tooltip.flipped .revisions-tooltip-arrow{margin-left:0;margin-right:35px;left:auto;right:0}.revisions-tooltip-arrow>span{content:"";position:absolute;left:20px;top:-20px;width:25px;height:25px;transform:rotate(45deg)}.revisions-tooltip.flipped .revisions-tooltip-arrow>span{left:auto;right:20px}.ie8 .revisions-tooltip-arrow>span{left:15px;top:-25px;-ms-filter:"progid:DXImageTransform.Microsoft.Matrix(SizingMethod='auto expand', M11=0.7071067811865476, M12=-0.7071067811865475, M21=0.7071067811865475, M22=0.7071067811865476)"}.ie8 .revisions-tooltip.flipped .revisions-tooltip-arrow>span{right:25px}.revisions-tooltip,.revisions-tooltip-arrow>span{border:1px solid #ddd;background-color:#fff}.revisions-tooltip{display:none}.arrow{width:70px;height:16px;overflow:hidden;position:absolute;left:0;margin-left:-35px;bottom:90px;z-index:10000}.arrow:after{z-index:9999;background-color:#fff;box-shadow:0 1px 3px rgba(0,0,0,.1)}.arrow.top{top:-16px;bottom:auto}.arrow.left{left:20%}.arrow:after{content:"";position:absolute;left:20px;top:-20px;width:25px;height:25px;transform:rotate(45deg)}.revisions-tooltip,.revisions-tooltip-arrow:after{border-width:1px;border-style:solid}div.revisions-controls>.wp-slider>.ui-slider-handle{margin-left:-10px}.rtl div.revisions-controls>.wp-slider>.ui-slider-handle{margin-right:-10px}.wp-slider.ui-slider{position:relative;border:1px solid #ddd;text-align:left;cursor:pointer}.wp-slider .ui-slider-handle{border-radius:50%;height:18px;margin-top:-5px;outline:0;padding:2px;position:absolute;width:18px;z-index:2;touch-action:none}.wp-slider .ui-slider-handle,.wp-slider .ui-slider-handle.focus{background:#f7f7f7;border:1px solid #ccc;box-shadow:0 1px 0 #ccc}.wp-slider .ui-slider-handle.ui-state-hover,.wp-slider .ui-slider-handle:hover{background:#fafafa;border-color:#999}.wp-slider .ui-slider-handle.ui-state-active,.wp-slider .ui-slider-handle:active{background:#eee;border-color:#999;box-shadow:inset 0 2px 5px -3px rgba(0,0,0,.5);transform:translateY(1px)}.wp-slider .ui-slider-handle:before{background:0 0;position:absolute;top:2px;left:2px;color:#555;content:"\f229";font:normal 18px/1 dashicons;speak:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.wp-slider .ui-slider-handle.ui-state-hover:before,.wp-slider .ui-slider-handle:hover:before{color:#23282d}.wp-slider .ui-slider-handle.from-handle:before,.wp-slider .ui-slider-handle.to-handle:before{font-size:20px!important;margin:-1px 0 0 -1px}.wp-slider .ui-slider-handle.from-handle:before{content:"\f139"}.wp-slider .ui-slider-handle.to-handle:before{content:"\f141"}.rtl .wp-slider .ui-slider-handle.from-handle:before{content:"\f141"}.rtl .wp-slider .ui-slider-handle.to-handle:before{content:"\f139";right:-1px}.wp-slider .ui-slider-range{position:absolute;font-size:.7em;display:block;border:0;background-color:transparent;background-image:none}.wp-slider.ui-slider-horizontal{height:.7em}.wp-slider.ui-slider-horizontal .ui-slider-handle{top:-.25em;margin-left:-.6em}.wp-slider.ui-slider-horizontal .ui-slider-range{top:0;height:100%}.wp-slider.ui-slider-horizontal .ui-slider-range-min{left:0}.wp-slider.ui-slider-horizontal .ui-slider-range-max{right:0}@media print,(-webkit-min-device-pixel-ratio:1.25),(min-resolution:120dpi){.revision-tick.completed-false{background-image:url(../images/spinner-2x.gif)}}@media screen and (max-width:782px){#diff-next-revision,#diff-previous-revision{margin-top:-1em}.revisions-buttons{overflow:hidden;margin-bottom:15px}.comparing-two-revisions .revisions-controls,.revisions-controls{height:170px}.revisions-tooltip{bottom:130px;z-index:2}.diff-meta{overflow:hidden}table.diff{-ms-word-break:break-all;word-break:break-all;word-wrap:break-word}.diff-meta input.restore-revision{margin-top:0}} \ No newline at end of file
diff --git a/www/crm/wp-admin/css/site-health-rtl.css b/www/crm/wp-admin/css/site-health-rtl.css
new file mode 100644
index 00000000..7c624362
--- /dev/null
+++ b/www/crm/wp-admin/css/site-health-rtl.css
@@ -0,0 +1,454 @@
+.site-health #wpcontent,
+.site-health.auto-fold #wpcontent {
+ padding-right: 0;
+}
+
+/* Emulates .wrap h1 styling */
+.health-check-header h1 {
+ display: inline-block;
+ font-weight: 600;
+ margin: 1rem 0.8rem;
+ font-size: 23px;
+ padding: 9px 0 4px 0;
+ line-height: 1.3;
+}
+
+.health-check-body h2 {
+ padding: 1rem 0;
+ line-height: 1.4;
+}
+
+.health-check-body h3 {
+ padding: 0;
+ font-weight: 400;
+}
+
+.health-check-header {
+ text-align: center;
+ margin: 0 0 1rem;
+ background: #fff;
+ border-bottom: 1px solid #e2e4e7;
+}
+
+.health-check-title-section {
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ clear: both;
+}
+
+.site-health-progress {
+ display: inline-block;
+ height: 40px;
+ width: 40px;
+ margin: 0;
+ border-radius: 100%;
+ position: relative;
+ font-weight: 600;
+ font-size: 0.4rem;
+}
+
+.site-health-progress-count {
+ position: absolute;
+ display: block;
+ height: 80px;
+ width: 80px;
+ right: 50%;
+ top: 50%;
+ margin-top: -40px;
+ margin-right: -40px;
+ border-radius: 100%;
+ line-height: 6.3;
+ font-size: 2em;
+}
+
+.site-health-progress-count::after {
+ content: "";
+}
+
+.site-health-progress.loading .site-health-progress-count::after {
+ content: "···";
+}
+
+.site-health-progress.loading svg #bar {
+ stroke-dashoffset: 0;
+ stroke: #adc5d2;
+ animation: loadingPulse 3s infinite ease-in-out;
+}
+
+.site-health-progress svg circle {
+ stroke-dashoffset: 0;
+ transition: stroke-dashoffset 1s linear;
+ stroke: #ccc;
+ stroke-width: 2em;
+}
+
+.site-health-progress svg #bar {
+ stroke-dashoffset: 565;
+ stroke: #dc3232;
+}
+
+.site-health-progress svg #bar.green {
+ stroke: #46b450;
+}
+
+.site-health-progress svg #bar.orange {
+ stroke: #ffb900;
+}
+
+@keyframes loadingPulse {
+ 0% {
+ stroke: #adc5d2;
+ }
+ 50% {
+ stroke: #00a0d2;
+ }
+ 100% {
+ stroke: #adc5d2;
+ }
+}
+
+.health-check-tabs-wrapper {
+ /* IE 11 */
+ display: -ms-inline-grid;
+ -ms-grid-columns: 1fr 1fr;
+ vertical-align: top;
+ /* modern browsers */
+ display: inline-grid;
+ grid-template-columns: 1fr 1fr;
+}
+
+.health-check-tab {
+ display: block; /* IE 11 */
+ text-decoration: none;
+ color: inherit;
+ padding: 0.5rem 1rem 1rem;
+ margin: 0 1rem;
+ transition: box-shadow 0.5s ease-in-out;
+}
+
+.health-check-tab:nth-child(1) {
+ -ms-grid-column: 1; /* IE 11 */
+}
+
+.health-check-tab:nth-child(2) {
+ -ms-grid-column: 2; /* IE 11 */
+}
+
+.health-check-tab:focus {
+ color: #191e23;
+ outline: 1px solid #6c7781;
+ box-shadow: none;
+}
+
+.health-check-tab.active {
+ box-shadow: inset 0 -3px #007cba;
+ font-weight: 600;
+}
+
+.health-check-body {
+ max-width: 800px;
+ margin: 0 auto;
+}
+
+.health-check-table td:first-child {
+ width: 30%;
+}
+
+.health-check-table td {
+ width: 70%;
+}
+
+.health-check-table ul,
+.health-check-table ol {
+ margin: 0;
+}
+
+.health-check-body li {
+ line-height: 1.5;
+}
+
+.health-check-body .pass::before,
+.health-check-body .good::before {
+ content: "\f147";
+ color: #46b450;
+}
+
+.health-check-body .warning::before {
+ content: "\f460";
+ color: #ffb900;
+}
+
+.health-check-body .info::before {
+ content: "\f348";
+ color: #00a0d2;
+}
+
+.health-check-body .fail::before,
+.health-check-body .error::before {
+ content: "\f335";
+ color: #dc3232;
+}
+
+.site-health-copy-buttons {
+ margin: 1rem 0;
+}
+
+.site-health-copy-buttons .copy-button-wrapper {
+ margin: 0.5rem 0 1rem;
+}
+
+.site-health-copy-buttons .success {
+ display: none;
+ color: #40860a;
+ line-height: 1.8;
+ margin-right: 0.5rem;
+}
+
+.site-health-copy-buttons .success.visible {
+ display: inline-block;
+ height: 28px;
+ line-height: 2.2;
+}
+
+.site-status-has-issues.hide {
+ display: none;
+}
+
+.site-health-view-more {
+ text-align: center;
+}
+
+.site-health-issues-wrapper:first-of-type {
+ margin-top: 3rem;
+}
+
+.site-health-issues-wrapper {
+ margin-bottom: 3rem;
+ margin-top: 2rem;
+}
+
+.site-status-all-clear {
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ justify-content: center;
+ text-align: center;
+ height: 100%;
+ width: 100%;
+ margin-top: 0;
+}
+
+@media all and (min-width: 784px) {
+ .site-status-all-clear {
+ margin: 5rem 0;
+ }
+}
+
+.site-status-all-clear.hide {
+ display: none;
+}
+
+.site-status-all-clear .dashicons {
+ font-size: 150px;
+ height: 130px;
+ width: 150px;
+}
+
+.site-status-all-clear .encouragement {
+ font-size: 1.5rem;
+ font-weight: 600;
+}
+
+.site-status-all-clear p {
+ margin: 0;
+}
+
+.health-check-accordion {
+ border: 1px solid #e2e4e7;
+}
+
+.health-check-accordion-heading {
+ margin: 0;
+ border-top: 1px solid #e2e4e7;
+ font-size: inherit;
+ line-height: inherit;
+ font-weight: 600;
+ color: inherit;
+}
+
+.health-check-accordion-heading:first-child {
+ border-top: none;
+}
+
+.health-check-accordion-trigger {
+ background: #fff;
+ border: 0;
+ color: #32373c;
+ cursor: pointer;
+ display: flex;
+ font-weight: 400;
+ margin: 0;
+ padding: 1em 1.5em 1em 3.5em;
+ min-height: 46px;
+ position: relative;
+ text-align: right;
+ width: 100%;
+ align-items: center;
+ justify-content: space-between;
+}
+
+.wp-core-ui .button.site-health-view-passed {
+ position: relative;
+ padding-left: 40px;
+ padding-right: 20px;
+}
+
+.health-check-accordion-trigger:hover,
+.health-check-accordion-trigger:active {
+ background: #f8f9f9;
+}
+
+.health-check-accordion-trigger:focus {
+ color: #191e23;
+ border: none;
+ box-shadow: none;
+ outline-offset: -2px;
+ outline: 1px dotted #555d66;
+}
+
+.health-check-accordion-trigger .title {
+ pointer-events: none;
+ font-weight: 600;
+ flex-grow: 1;
+}
+
+.health-check-accordion-trigger .icon,
+.site-health-view-passed .icon {
+ border: solid #555d66;
+ border-width: 0 0 2px 2px;
+ height: 0.5rem;
+ pointer-events: none;
+ position: absolute;
+ left: 1.5em;
+ top: 50%;
+ transform: translateY(-70%) rotate(-45deg);
+ width: 0.5rem;
+}
+
+.health-check-accordion-trigger .badge {
+ padding: 0.1rem 0.5rem 0.15rem;
+ color: #32373c;
+ font-weight: 600;
+ margin-right: 0.5rem;
+}
+
+.health-check-accordion-trigger .badge.blue {
+ border: 1px solid #bfe7f3;
+}
+
+.health-check-accordion-trigger .badge.orange {
+ border: 1px solid #ffb900;
+}
+
+.health-check-accordion-trigger .badge.red {
+ border: 1px solid #dc3232;
+}
+
+.health-check-accordion-trigger .badge.green {
+ border: 1px solid #46b450;
+}
+
+.health-check-accordion-trigger .badge.purple {
+ border: 1px solid #826eb4;
+}
+
+.health-check-accordion-trigger .badge.gray {
+ border: 1px solid #ccd0d4;
+}
+
+.health-check-accordion-trigger[aria-expanded="true"] .icon,
+.site-health-view-passed[aria-expanded="true"] .icon {
+ transform: translateY(-30%) rotate(135deg)
+}
+
+.health-check-accordion-panel {
+ margin: 0;
+ padding: 1em 1.5em;
+ background: #fff;
+}
+
+.health-check-accordion-panel[hidden] {
+ display: none;
+}
+
+.health-check-accordion-panel a .dashicons {
+ text-decoration: none;
+}
+
+/* Better position for the WordPress admin notices and update nag. */
+.site-health .notice {
+ margin: 5px 22px 15px 20px;
+}
+
+.site-health .update-nag {
+ margin-bottom: 20px;
+ margin-right: 22px;
+}
+
+.health-check-wp-paths-sizes.spinner {
+ visibility: visible;
+ float: none;
+ margin: 0 4px;
+ flex-shrink: 0;
+}
+
+@media screen and (max-width: 782px) {
+ .health-check-body {
+ margin: 0 12px;
+ width: auto;
+ }
+
+ .site-health .notice {
+ margin: 5px 10px 15px;
+ }
+
+ .site-health .update-nag {
+ margin-left: 10px;
+ margin-right: 10px;
+ }
+
+ .site-health-issues-wrapper .health-check-accordion-trigger {
+ flex-direction: column;
+ align-items: flex-start;
+ }
+
+ .health-check-accordion-trigger .badge {
+ margin: 1em 0 0;
+ }
+
+ .health-check-table {
+ table-layout: fixed;
+ }
+
+ .health-check-table td {
+ box-sizing: border-box;
+ display: block;
+ width: 100%;
+ word-wrap: break-word;
+ }
+
+ .health-check-table td:first-child {
+ width: 100%;
+ padding-bottom: 0;
+ font-weight: 600;
+ }
+}
+
+/* The breakpoint is usually at 960px, the additional space is to allow for the margin. */
+@media only screen and (max-width: 1004px) {
+ .health-check-body {
+ margin: 0 22px;
+ width: auto;
+ }
+}
diff --git a/www/crm/wp-admin/css/site-health-rtl.min.css b/www/crm/wp-admin/css/site-health-rtl.min.css
new file mode 100644
index 00000000..00840422
--- /dev/null
+++ b/www/crm/wp-admin/css/site-health-rtl.min.css
@@ -0,0 +1,2 @@
+/*! This file is auto-generated */
+.site-health #wpcontent,.site-health.auto-fold #wpcontent{padding-right:0}.health-check-header h1{display:inline-block;font-weight:600;margin:1rem .8rem;font-size:23px;padding:9px 0 4px 0;line-height:1.3}.health-check-body h2{padding:1rem 0;line-height:1.4}.health-check-body h3{padding:0;font-weight:400}.health-check-header{text-align:center;margin:0 0 1rem;background:#fff;border-bottom:1px solid #e2e4e7}.health-check-title-section{display:flex;align-items:center;justify-content:center;clear:both}.site-health-progress{display:inline-block;height:40px;width:40px;margin:0;border-radius:100%;position:relative;font-weight:600;font-size:.4rem}.site-health-progress-count{position:absolute;display:block;height:80px;width:80px;right:50%;top:50%;margin-top:-40px;margin-right:-40px;border-radius:100%;line-height:6.3;font-size:2em}.site-health-progress-count::after{content:""}.site-health-progress.loading .site-health-progress-count::after{content:"···"}.site-health-progress.loading svg #bar{stroke-dashoffset:0;stroke:#adc5d2;animation:loadingPulse 3s infinite ease-in-out}.site-health-progress svg circle{stroke-dashoffset:0;transition:stroke-dashoffset 1s linear;stroke:#ccc;stroke-width:2em}.site-health-progress svg #bar{stroke-dashoffset:565;stroke:#dc3232}.site-health-progress svg #bar.green{stroke:#46b450}.site-health-progress svg #bar.orange{stroke:#ffb900}@keyframes loadingPulse{0%{stroke:#adc5d2}50%{stroke:#00a0d2}100%{stroke:#adc5d2}}.health-check-tabs-wrapper{display:-ms-inline-grid;-ms-grid-columns:1fr 1fr;vertical-align:top;display:inline-grid;grid-template-columns:1fr 1fr}.health-check-tab{display:block;text-decoration:none;color:inherit;padding:.5rem 1rem 1rem;margin:0 1rem;transition:box-shadow .5s ease-in-out}.health-check-tab:nth-child(1){-ms-grid-column:1}.health-check-tab:nth-child(2){-ms-grid-column:2}.health-check-tab:focus{color:#191e23;outline:1px solid #6c7781;box-shadow:none}.health-check-tab.active{box-shadow:inset 0 -3px #007cba;font-weight:600}.health-check-body{max-width:800px;margin:0 auto}.health-check-table td:first-child{width:30%}.health-check-table td{width:70%}.health-check-table ol,.health-check-table ul{margin:0}.health-check-body li{line-height:1.5}.health-check-body .good::before,.health-check-body .pass::before{content:"\f147";color:#46b450}.health-check-body .warning::before{content:"\f460";color:#ffb900}.health-check-body .info::before{content:"\f348";color:#00a0d2}.health-check-body .error::before,.health-check-body .fail::before{content:"\f335";color:#dc3232}.site-health-copy-buttons{margin:1rem 0}.site-health-copy-buttons .copy-button-wrapper{margin:.5rem 0 1rem}.site-health-copy-buttons .success{display:none;color:#40860a;line-height:1.8;margin-right:.5rem}.site-health-copy-buttons .success.visible{display:inline-block;height:28px;line-height:2.2}.site-status-has-issues.hide{display:none}.site-health-view-more{text-align:center}.site-health-issues-wrapper:first-of-type{margin-top:3rem}.site-health-issues-wrapper{margin-bottom:3rem;margin-top:2rem}.site-status-all-clear{display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;height:100%;width:100%;margin-top:0}@media all and (min-width:784px){.site-status-all-clear{margin:5rem 0}}.site-status-all-clear.hide{display:none}.site-status-all-clear .dashicons{font-size:150px;height:130px;width:150px}.site-status-all-clear .encouragement{font-size:1.5rem;font-weight:600}.site-status-all-clear p{margin:0}.health-check-accordion{border:1px solid #e2e4e7}.health-check-accordion-heading{margin:0;border-top:1px solid #e2e4e7;font-size:inherit;line-height:inherit;font-weight:600;color:inherit}.health-check-accordion-heading:first-child{border-top:none}.health-check-accordion-trigger{background:#fff;border:0;color:#32373c;cursor:pointer;display:flex;font-weight:400;margin:0;padding:1em 1.5em 1em 3.5em;min-height:46px;position:relative;text-align:right;width:100%;align-items:center;justify-content:space-between}.wp-core-ui .button.site-health-view-passed{position:relative;padding-left:40px;padding-right:20px}.health-check-accordion-trigger:active,.health-check-accordion-trigger:hover{background:#f8f9f9}.health-check-accordion-trigger:focus{color:#191e23;border:none;box-shadow:none;outline-offset:-2px;outline:1px dotted #555d66}.health-check-accordion-trigger .title{pointer-events:none;font-weight:600;flex-grow:1}.health-check-accordion-trigger .icon,.site-health-view-passed .icon{border:solid #555d66;border-width:0 0 2px 2px;height:.5rem;pointer-events:none;position:absolute;left:1.5em;top:50%;transform:translateY(-70%) rotate(-45deg);width:.5rem}.health-check-accordion-trigger .badge{padding:.1rem .5rem .15rem;color:#32373c;font-weight:600;margin-right:.5rem}.health-check-accordion-trigger .badge.blue{border:1px solid #bfe7f3}.health-check-accordion-trigger .badge.orange{border:1px solid #ffb900}.health-check-accordion-trigger .badge.red{border:1px solid #dc3232}.health-check-accordion-trigger .badge.green{border:1px solid #46b450}.health-check-accordion-trigger .badge.purple{border:1px solid #826eb4}.health-check-accordion-trigger .badge.gray{border:1px solid #ccd0d4}.health-check-accordion-trigger[aria-expanded=true] .icon,.site-health-view-passed[aria-expanded=true] .icon{transform:translateY(-30%) rotate(135deg)}.health-check-accordion-panel{margin:0;padding:1em 1.5em;background:#fff}.health-check-accordion-panel[hidden]{display:none}.health-check-accordion-panel a .dashicons{text-decoration:none}.site-health .notice{margin:5px 22px 15px 20px}.site-health .update-nag{margin-bottom:20px;margin-right:22px}.health-check-wp-paths-sizes.spinner{visibility:visible;float:none;margin:0 4px;flex-shrink:0}@media screen and (max-width:782px){.health-check-body{margin:0 12px;width:auto}.site-health .notice{margin:5px 10px 15px}.site-health .update-nag{margin-left:10px;margin-right:10px}.site-health-issues-wrapper .health-check-accordion-trigger{flex-direction:column;align-items:flex-start}.health-check-accordion-trigger .badge{margin:1em 0 0}.health-check-table{table-layout:fixed}.health-check-table td{box-sizing:border-box;display:block;width:100%;word-wrap:break-word}.health-check-table td:first-child{width:100%;padding-bottom:0;font-weight:600}}@media only screen and (max-width:1004px){.health-check-body{margin:0 22px;width:auto}} \ No newline at end of file
diff --git a/www/crm/wp-admin/css/site-health.css b/www/crm/wp-admin/css/site-health.css
new file mode 100644
index 00000000..f320d4f4
--- /dev/null
+++ b/www/crm/wp-admin/css/site-health.css
@@ -0,0 +1,454 @@
+.site-health #wpcontent,
+.site-health.auto-fold #wpcontent {
+ padding-left: 0;
+}
+
+/* Emulates .wrap h1 styling */
+.health-check-header h1 {
+ display: inline-block;
+ font-weight: 600;
+ margin: 1rem 0.8rem;
+ font-size: 23px;
+ padding: 9px 0 4px 0;
+ line-height: 1.3;
+}
+
+.health-check-body h2 {
+ padding: 1rem 0;
+ line-height: 1.4;
+}
+
+.health-check-body h3 {
+ padding: 0;
+ font-weight: 400;
+}
+
+.health-check-header {
+ text-align: center;
+ margin: 0 0 1rem;
+ background: #fff;
+ border-bottom: 1px solid #e2e4e7;
+}
+
+.health-check-title-section {
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ clear: both;
+}
+
+.site-health-progress {
+ display: inline-block;
+ height: 40px;
+ width: 40px;
+ margin: 0;
+ border-radius: 100%;
+ position: relative;
+ font-weight: 600;
+ font-size: 0.4rem;
+}
+
+.site-health-progress-count {
+ position: absolute;
+ display: block;
+ height: 80px;
+ width: 80px;
+ left: 50%;
+ top: 50%;
+ margin-top: -40px;
+ margin-left: -40px;
+ border-radius: 100%;
+ line-height: 6.3;
+ font-size: 2em;
+}
+
+.site-health-progress-count::after {
+ content: "";
+}
+
+.site-health-progress.loading .site-health-progress-count::after {
+ content: "···";
+}
+
+.site-health-progress.loading svg #bar {
+ stroke-dashoffset: 0;
+ stroke: #adc5d2;
+ animation: loadingPulse 3s infinite ease-in-out;
+}
+
+.site-health-progress svg circle {
+ stroke-dashoffset: 0;
+ transition: stroke-dashoffset 1s linear;
+ stroke: #ccc;
+ stroke-width: 2em;
+}
+
+.site-health-progress svg #bar {
+ stroke-dashoffset: 565;
+ stroke: #dc3232;
+}
+
+.site-health-progress svg #bar.green {
+ stroke: #46b450;
+}
+
+.site-health-progress svg #bar.orange {
+ stroke: #ffb900;
+}
+
+@keyframes loadingPulse {
+ 0% {
+ stroke: #adc5d2;
+ }
+ 50% {
+ stroke: #00a0d2;
+ }
+ 100% {
+ stroke: #adc5d2;
+ }
+}
+
+.health-check-tabs-wrapper {
+ /* IE 11 */
+ display: -ms-inline-grid;
+ -ms-grid-columns: 1fr 1fr;
+ vertical-align: top;
+ /* modern browsers */
+ display: inline-grid;
+ grid-template-columns: 1fr 1fr;
+}
+
+.health-check-tab {
+ display: block; /* IE 11 */
+ text-decoration: none;
+ color: inherit;
+ padding: 0.5rem 1rem 1rem;
+ margin: 0 1rem;
+ transition: box-shadow 0.5s ease-in-out;
+}
+
+.health-check-tab:nth-child(1) {
+ -ms-grid-column: 1; /* IE 11 */
+}
+
+.health-check-tab:nth-child(2) {
+ -ms-grid-column: 2; /* IE 11 */
+}
+
+.health-check-tab:focus {
+ color: #191e23;
+ outline: 1px solid #6c7781;
+ box-shadow: none;
+}
+
+.health-check-tab.active {
+ box-shadow: inset 0 -3px #007cba;
+ font-weight: 600;
+}
+
+.health-check-body {
+ max-width: 800px;
+ margin: 0 auto;
+}
+
+.health-check-table td:first-child {
+ width: 30%;
+}
+
+.health-check-table td {
+ width: 70%;
+}
+
+.health-check-table ul,
+.health-check-table ol {
+ margin: 0;
+}
+
+.health-check-body li {
+ line-height: 1.5;
+}
+
+.health-check-body .pass::before,
+.health-check-body .good::before {
+ content: "\f147";
+ color: #46b450;
+}
+
+.health-check-body .warning::before {
+ content: "\f460";
+ color: #ffb900;
+}
+
+.health-check-body .info::before {
+ content: "\f348";
+ color: #00a0d2;
+}
+
+.health-check-body .fail::before,
+.health-check-body .error::before {
+ content: "\f335";
+ color: #dc3232;
+}
+
+.site-health-copy-buttons {
+ margin: 1rem 0;
+}
+
+.site-health-copy-buttons .copy-button-wrapper {
+ margin: 0.5rem 0 1rem;
+}
+
+.site-health-copy-buttons .success {
+ display: none;
+ color: #40860a;
+ line-height: 1.8;
+ margin-left: 0.5rem;
+}
+
+.site-health-copy-buttons .success.visible {
+ display: inline-block;
+ height: 28px;
+ line-height: 2.2;
+}
+
+.site-status-has-issues.hide {
+ display: none;
+}
+
+.site-health-view-more {
+ text-align: center;
+}
+
+.site-health-issues-wrapper:first-of-type {
+ margin-top: 3rem;
+}
+
+.site-health-issues-wrapper {
+ margin-bottom: 3rem;
+ margin-top: 2rem;
+}
+
+.site-status-all-clear {
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ justify-content: center;
+ text-align: center;
+ height: 100%;
+ width: 100%;
+ margin-top: 0;
+}
+
+@media all and (min-width: 784px) {
+ .site-status-all-clear {
+ margin: 5rem 0;
+ }
+}
+
+.site-status-all-clear.hide {
+ display: none;
+}
+
+.site-status-all-clear .dashicons {
+ font-size: 150px;
+ height: 130px;
+ width: 150px;
+}
+
+.site-status-all-clear .encouragement {
+ font-size: 1.5rem;
+ font-weight: 600;
+}
+
+.site-status-all-clear p {
+ margin: 0;
+}
+
+.health-check-accordion {
+ border: 1px solid #e2e4e7;
+}
+
+.health-check-accordion-heading {
+ margin: 0;
+ border-top: 1px solid #e2e4e7;
+ font-size: inherit;
+ line-height: inherit;
+ font-weight: 600;
+ color: inherit;
+}
+
+.health-check-accordion-heading:first-child {
+ border-top: none;
+}
+
+.health-check-accordion-trigger {
+ background: #fff;
+ border: 0;
+ color: #32373c;
+ cursor: pointer;
+ display: flex;
+ font-weight: 400;
+ margin: 0;
+ padding: 1em 3.5em 1em 1.5em;
+ min-height: 46px;
+ position: relative;
+ text-align: left;
+ width: 100%;
+ align-items: center;
+ justify-content: space-between;
+}
+
+.wp-core-ui .button.site-health-view-passed {
+ position: relative;
+ padding-right: 40px;
+ padding-left: 20px;
+}
+
+.health-check-accordion-trigger:hover,
+.health-check-accordion-trigger:active {
+ background: #f8f9f9;
+}
+
+.health-check-accordion-trigger:focus {
+ color: #191e23;
+ border: none;
+ box-shadow: none;
+ outline-offset: -2px;
+ outline: 1px dotted #555d66;
+}
+
+.health-check-accordion-trigger .title {
+ pointer-events: none;
+ font-weight: 600;
+ flex-grow: 1;
+}
+
+.health-check-accordion-trigger .icon,
+.site-health-view-passed .icon {
+ border: solid #555d66;
+ border-width: 0 2px 2px 0;
+ height: 0.5rem;
+ pointer-events: none;
+ position: absolute;
+ right: 1.5em;
+ top: 50%;
+ transform: translateY(-70%) rotate(45deg);
+ width: 0.5rem;
+}
+
+.health-check-accordion-trigger .badge {
+ padding: 0.1rem 0.5rem 0.15rem;
+ color: #32373c;
+ font-weight: 600;
+ margin-left: 0.5rem;
+}
+
+.health-check-accordion-trigger .badge.blue {
+ border: 1px solid #bfe7f3;
+}
+
+.health-check-accordion-trigger .badge.orange {
+ border: 1px solid #ffb900;
+}
+
+.health-check-accordion-trigger .badge.red {
+ border: 1px solid #dc3232;
+}
+
+.health-check-accordion-trigger .badge.green {
+ border: 1px solid #46b450;
+}
+
+.health-check-accordion-trigger .badge.purple {
+ border: 1px solid #826eb4;
+}
+
+.health-check-accordion-trigger .badge.gray {
+ border: 1px solid #ccd0d4;
+}
+
+.health-check-accordion-trigger[aria-expanded="true"] .icon,
+.site-health-view-passed[aria-expanded="true"] .icon {
+ transform: translateY(-30%) rotate(-135deg)
+}
+
+.health-check-accordion-panel {
+ margin: 0;
+ padding: 1em 1.5em;
+ background: #fff;
+}
+
+.health-check-accordion-panel[hidden] {
+ display: none;
+}
+
+.health-check-accordion-panel a .dashicons {
+ text-decoration: none;
+}
+
+/* Better position for the WordPress admin notices and update nag. */
+.site-health .notice {
+ margin: 5px 20px 15px 22px;
+}
+
+.site-health .update-nag {
+ margin-bottom: 20px;
+ margin-left: 22px;
+}
+
+.health-check-wp-paths-sizes.spinner {
+ visibility: visible;
+ float: none;
+ margin: 0 4px;
+ flex-shrink: 0;
+}
+
+@media screen and (max-width: 782px) {
+ .health-check-body {
+ margin: 0 12px;
+ width: auto;
+ }
+
+ .site-health .notice {
+ margin: 5px 10px 15px;
+ }
+
+ .site-health .update-nag {
+ margin-right: 10px;
+ margin-left: 10px;
+ }
+
+ .site-health-issues-wrapper .health-check-accordion-trigger {
+ flex-direction: column;
+ align-items: flex-start;
+ }
+
+ .health-check-accordion-trigger .badge {
+ margin: 1em 0 0;
+ }
+
+ .health-check-table {
+ table-layout: fixed;
+ }
+
+ .health-check-table td {
+ box-sizing: border-box;
+ display: block;
+ width: 100%;
+ word-wrap: break-word;
+ }
+
+ .health-check-table td:first-child {
+ width: 100%;
+ padding-bottom: 0;
+ font-weight: 600;
+ }
+}
+
+/* The breakpoint is usually at 960px, the additional space is to allow for the margin. */
+@media only screen and (max-width: 1004px) {
+ .health-check-body {
+ margin: 0 22px;
+ width: auto;
+ }
+}
diff --git a/www/crm/wp-admin/css/site-health.min.css b/www/crm/wp-admin/css/site-health.min.css
new file mode 100644
index 00000000..6fec604d
--- /dev/null
+++ b/www/crm/wp-admin/css/site-health.min.css
@@ -0,0 +1,2 @@
+/*! This file is auto-generated */
+.site-health #wpcontent,.site-health.auto-fold #wpcontent{padding-left:0}.health-check-header h1{display:inline-block;font-weight:600;margin:1rem .8rem;font-size:23px;padding:9px 0 4px 0;line-height:1.3}.health-check-body h2{padding:1rem 0;line-height:1.4}.health-check-body h3{padding:0;font-weight:400}.health-check-header{text-align:center;margin:0 0 1rem;background:#fff;border-bottom:1px solid #e2e4e7}.health-check-title-section{display:flex;align-items:center;justify-content:center;clear:both}.site-health-progress{display:inline-block;height:40px;width:40px;margin:0;border-radius:100%;position:relative;font-weight:600;font-size:.4rem}.site-health-progress-count{position:absolute;display:block;height:80px;width:80px;left:50%;top:50%;margin-top:-40px;margin-left:-40px;border-radius:100%;line-height:6.3;font-size:2em}.site-health-progress-count::after{content:""}.site-health-progress.loading .site-health-progress-count::after{content:"···"}.site-health-progress.loading svg #bar{stroke-dashoffset:0;stroke:#adc5d2;animation:loadingPulse 3s infinite ease-in-out}.site-health-progress svg circle{stroke-dashoffset:0;transition:stroke-dashoffset 1s linear;stroke:#ccc;stroke-width:2em}.site-health-progress svg #bar{stroke-dashoffset:565;stroke:#dc3232}.site-health-progress svg #bar.green{stroke:#46b450}.site-health-progress svg #bar.orange{stroke:#ffb900}@keyframes loadingPulse{0%{stroke:#adc5d2}50%{stroke:#00a0d2}100%{stroke:#adc5d2}}.health-check-tabs-wrapper{display:-ms-inline-grid;-ms-grid-columns:1fr 1fr;vertical-align:top;display:inline-grid;grid-template-columns:1fr 1fr}.health-check-tab{display:block;text-decoration:none;color:inherit;padding:.5rem 1rem 1rem;margin:0 1rem;transition:box-shadow .5s ease-in-out}.health-check-tab:nth-child(1){-ms-grid-column:1}.health-check-tab:nth-child(2){-ms-grid-column:2}.health-check-tab:focus{color:#191e23;outline:1px solid #6c7781;box-shadow:none}.health-check-tab.active{box-shadow:inset 0 -3px #007cba;font-weight:600}.health-check-body{max-width:800px;margin:0 auto}.health-check-table td:first-child{width:30%}.health-check-table td{width:70%}.health-check-table ol,.health-check-table ul{margin:0}.health-check-body li{line-height:1.5}.health-check-body .good::before,.health-check-body .pass::before{content:"\f147";color:#46b450}.health-check-body .warning::before{content:"\f460";color:#ffb900}.health-check-body .info::before{content:"\f348";color:#00a0d2}.health-check-body .error::before,.health-check-body .fail::before{content:"\f335";color:#dc3232}.site-health-copy-buttons{margin:1rem 0}.site-health-copy-buttons .copy-button-wrapper{margin:.5rem 0 1rem}.site-health-copy-buttons .success{display:none;color:#40860a;line-height:1.8;margin-left:.5rem}.site-health-copy-buttons .success.visible{display:inline-block;height:28px;line-height:2.2}.site-status-has-issues.hide{display:none}.site-health-view-more{text-align:center}.site-health-issues-wrapper:first-of-type{margin-top:3rem}.site-health-issues-wrapper{margin-bottom:3rem;margin-top:2rem}.site-status-all-clear{display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;height:100%;width:100%;margin-top:0}@media all and (min-width:784px){.site-status-all-clear{margin:5rem 0}}.site-status-all-clear.hide{display:none}.site-status-all-clear .dashicons{font-size:150px;height:130px;width:150px}.site-status-all-clear .encouragement{font-size:1.5rem;font-weight:600}.site-status-all-clear p{margin:0}.health-check-accordion{border:1px solid #e2e4e7}.health-check-accordion-heading{margin:0;border-top:1px solid #e2e4e7;font-size:inherit;line-height:inherit;font-weight:600;color:inherit}.health-check-accordion-heading:first-child{border-top:none}.health-check-accordion-trigger{background:#fff;border:0;color:#32373c;cursor:pointer;display:flex;font-weight:400;margin:0;padding:1em 3.5em 1em 1.5em;min-height:46px;position:relative;text-align:left;width:100%;align-items:center;justify-content:space-between}.wp-core-ui .button.site-health-view-passed{position:relative;padding-right:40px;padding-left:20px}.health-check-accordion-trigger:active,.health-check-accordion-trigger:hover{background:#f8f9f9}.health-check-accordion-trigger:focus{color:#191e23;border:none;box-shadow:none;outline-offset:-2px;outline:1px dotted #555d66}.health-check-accordion-trigger .title{pointer-events:none;font-weight:600;flex-grow:1}.health-check-accordion-trigger .icon,.site-health-view-passed .icon{border:solid #555d66;border-width:0 2px 2px 0;height:.5rem;pointer-events:none;position:absolute;right:1.5em;top:50%;transform:translateY(-70%) rotate(45deg);width:.5rem}.health-check-accordion-trigger .badge{padding:.1rem .5rem .15rem;color:#32373c;font-weight:600;margin-left:.5rem}.health-check-accordion-trigger .badge.blue{border:1px solid #bfe7f3}.health-check-accordion-trigger .badge.orange{border:1px solid #ffb900}.health-check-accordion-trigger .badge.red{border:1px solid #dc3232}.health-check-accordion-trigger .badge.green{border:1px solid #46b450}.health-check-accordion-trigger .badge.purple{border:1px solid #826eb4}.health-check-accordion-trigger .badge.gray{border:1px solid #ccd0d4}.health-check-accordion-trigger[aria-expanded=true] .icon,.site-health-view-passed[aria-expanded=true] .icon{transform:translateY(-30%) rotate(-135deg)}.health-check-accordion-panel{margin:0;padding:1em 1.5em;background:#fff}.health-check-accordion-panel[hidden]{display:none}.health-check-accordion-panel a .dashicons{text-decoration:none}.site-health .notice{margin:5px 20px 15px 22px}.site-health .update-nag{margin-bottom:20px;margin-left:22px}.health-check-wp-paths-sizes.spinner{visibility:visible;float:none;margin:0 4px;flex-shrink:0}@media screen and (max-width:782px){.health-check-body{margin:0 12px;width:auto}.site-health .notice{margin:5px 10px 15px}.site-health .update-nag{margin-right:10px;margin-left:10px}.site-health-issues-wrapper .health-check-accordion-trigger{flex-direction:column;align-items:flex-start}.health-check-accordion-trigger .badge{margin:1em 0 0}.health-check-table{table-layout:fixed}.health-check-table td{box-sizing:border-box;display:block;width:100%;word-wrap:break-word}.health-check-table td:first-child{width:100%;padding-bottom:0;font-weight:600}}@media only screen and (max-width:1004px){.health-check-body{margin:0 22px;width:auto}} \ No newline at end of file
diff --git a/www/crm/wp-admin/css/site-icon-rtl.css b/www/crm/wp-admin/css/site-icon-rtl.css
new file mode 100644
index 00000000..29211f39
--- /dev/null
+++ b/www/crm/wp-admin/css/site-icon-rtl.css
@@ -0,0 +1,54 @@
+/*------------------------------------------------------------------------------
+ 28.0 - Site Icon
+------------------------------------------------------------------------------*/
+
+.site-icon-preview .favicon-preview {
+ margin: 5px 0 20px;
+ overflow: hidden;
+ position: relative;
+ max-width: 180px;
+}
+
+.site-icon-preview .favicon,
+.site-icon-preview .browser-title {
+ height: 16px;
+ right: 88px;
+ overflow: hidden;
+ position: absolute;
+ top: 16px;
+}
+
+.site-icon-preview .favicon {
+ width: 16px;
+}
+
+.site-icon-preview .browser-title {
+ right: 109px;
+ width: 72px;
+ white-space: nowrap;
+}
+
+.site-icon-preview .app-icon-preview {
+ background-color: #000;
+ border-radius: 16px;
+ height: 64px;
+ overflow: hidden;
+ width: 64px;
+ margin-top: 5px;
+}
+
+/* rtl:ignore */
+.site-icon-preview .favicon,
+.site-icon-preview .app-icon-preview {
+ direction: ltr;
+}
+
+.customize-control-site_icon .favicon-preview {
+ float: right;
+ margin-left: 12px;
+ margin-bottom: 0;
+}
+
+.customize-control-site_icon .app-icon-preview {
+ margin-top: 9px;
+}
diff --git a/www/crm/wp-admin/css/site-icon-rtl.min.css b/www/crm/wp-admin/css/site-icon-rtl.min.css
new file mode 100644
index 00000000..901a1eb6
--- /dev/null
+++ b/www/crm/wp-admin/css/site-icon-rtl.min.css
@@ -0,0 +1,2 @@
+/*! This file is auto-generated */
+.site-icon-preview .favicon-preview{margin:5px 0 20px;overflow:hidden;position:relative;max-width:180px}.site-icon-preview .browser-title,.site-icon-preview .favicon{height:16px;right:88px;overflow:hidden;position:absolute;top:16px}.site-icon-preview .favicon{width:16px}.site-icon-preview .browser-title{right:109px;width:72px;white-space:nowrap}.site-icon-preview .app-icon-preview{background-color:#000;border-radius:16px;height:64px;overflow:hidden;width:64px;margin-top:5px}.site-icon-preview .app-icon-preview,.site-icon-preview .favicon{direction:ltr}.customize-control-site_icon .favicon-preview{float:right;margin-left:12px;margin-bottom:0}.customize-control-site_icon .app-icon-preview{margin-top:9px} \ No newline at end of file
diff --git a/www/crm/wp-admin/css/site-icon.css b/www/crm/wp-admin/css/site-icon.css
new file mode 100644
index 00000000..eae9a576
--- /dev/null
+++ b/www/crm/wp-admin/css/site-icon.css
@@ -0,0 +1,54 @@
+/*------------------------------------------------------------------------------
+ 28.0 - Site Icon
+------------------------------------------------------------------------------*/
+
+.site-icon-preview .favicon-preview {
+ margin: 5px 0 20px;
+ overflow: hidden;
+ position: relative;
+ max-width: 180px;
+}
+
+.site-icon-preview .favicon,
+.site-icon-preview .browser-title {
+ height: 16px;
+ left: 88px;
+ overflow: hidden;
+ position: absolute;
+ top: 16px;
+}
+
+.site-icon-preview .favicon {
+ width: 16px;
+}
+
+.site-icon-preview .browser-title {
+ left: 109px;
+ width: 72px;
+ white-space: nowrap;
+}
+
+.site-icon-preview .app-icon-preview {
+ background-color: #000;
+ border-radius: 16px;
+ height: 64px;
+ overflow: hidden;
+ width: 64px;
+ margin-top: 5px;
+}
+
+/* rtl:ignore */
+.site-icon-preview .favicon,
+.site-icon-preview .app-icon-preview {
+ direction: ltr;
+}
+
+.customize-control-site_icon .favicon-preview {
+ float: left;
+ margin-right: 12px;
+ margin-bottom: 0;
+}
+
+.customize-control-site_icon .app-icon-preview {
+ margin-top: 9px;
+}
diff --git a/www/crm/wp-admin/css/site-icon.min.css b/www/crm/wp-admin/css/site-icon.min.css
new file mode 100644
index 00000000..5287d07f
--- /dev/null
+++ b/www/crm/wp-admin/css/site-icon.min.css
@@ -0,0 +1,2 @@
+/*! This file is auto-generated */
+.site-icon-preview .favicon-preview{margin:5px 0 20px;overflow:hidden;position:relative;max-width:180px}.site-icon-preview .browser-title,.site-icon-preview .favicon{height:16px;left:88px;overflow:hidden;position:absolute;top:16px}.site-icon-preview .favicon{width:16px}.site-icon-preview .browser-title{left:109px;width:72px;white-space:nowrap}.site-icon-preview .app-icon-preview{background-color:#000;border-radius:16px;height:64px;overflow:hidden;width:64px;margin-top:5px}.site-icon-preview .app-icon-preview,.site-icon-preview .favicon{direction:ltr}.customize-control-site_icon .favicon-preview{float:left;margin-right:12px;margin-bottom:0}.customize-control-site_icon .app-icon-preview{margin-top:9px} \ No newline at end of file
diff --git a/www/crm/wp-admin/css/themes-rtl.css b/www/crm/wp-admin/css/themes-rtl.css
new file mode 100644
index 00000000..62d166dd
--- /dev/null
+++ b/www/crm/wp-admin/css/themes-rtl.css
@@ -0,0 +1,1922 @@
+/*------------------------------------------------------------------------------
+ 16.0 - Themes
+------------------------------------------------------------------------------*/
+
+
+/*------------------------------------------------------------------------------
+ 16.1 - Manage Themes
+------------------------------------------------------------------------------*/
+
+body.js .theme-browser.search-loading {
+ display: none;
+}
+
+.theme-browser .themes {
+ clear: both;
+}
+
+.themes-php:not(.network-admin) .wrap h1 {
+ margin-bottom: 15px;
+}
+
+.themes-php .wrap h1 .button {
+ margin-right: 20px;
+}
+
+/* Search form */
+.themes-php .search-form {
+ display: inline;
+}
+
+.themes-php .wp-filter-search {
+ position: relative;
+ top: -2px;
+ right: 20px;
+ margin: 0;
+ width: 280px;
+ font-size: 16px;
+ font-weight: 300;
+ line-height: 1.5;
+}
+
+/* Position admin messages */
+.theme .notice,
+.theme .notice.is-dismissible {
+ right: 0;
+ margin: 0;
+ position: absolute;
+ left: 0;
+ top: 0;
+}
+
+/**
+ * Main theme element
+ * (has flexible margins)
+ */
+.theme-browser .theme {
+ cursor: pointer;
+ float: right;
+ margin: 0 0 4% 4%;
+ position: relative;
+ width: 30.6%;
+ border: 1px solid #ddd;
+ box-shadow: 0 1px 1px -1px rgba(0, 0, 0, 0.1);
+ box-sizing: border-box;
+}
+
+.ie8 .theme-browser .theme {
+ width: 30%;
+ margin: 0 0 4% 3%;
+}
+
+.theme-browser .theme:nth-child(3n) {
+ margin-left: 0;
+}
+
+.theme-browser .theme:hover,
+.theme-browser .theme:focus {
+ cursor: pointer;
+}
+
+.theme-browser .theme .theme-name {
+ font-size: 15px;
+ font-weight: 600;
+ height: 18px;
+ margin: 0;
+ padding: 15px;
+ box-shadow: inset 0 1px 0 rgba(0, 0, 0, 0.1);
+ overflow: hidden;
+ white-space: nowrap;
+ text-overflow: ellipsis;
+ background: #fff;
+ background: rgba(255, 255, 255, 0.65);
+}
+
+/* Activate and Customize buttons, shown on hover and focus */
+.theme-browser .theme .theme-actions {
+ -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";
+ opacity: 0;
+ transition: opacity 0.1s ease-in-out;
+ height: auto;
+ background: rgba(244, 244, 244, 0.7);
+ border-right: 1px solid rgba(0, 0, 0, 0.05);
+}
+
+.theme-browser .theme:hover .theme-actions,
+.theme-browser .theme.focus .theme-actions,
+.theme-browser .theme:focus .theme-actions {
+ -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=100)";
+ opacity: 1;
+}
+
+.theme-browser .theme .theme-actions .button-primary {
+ margin-left: 3px;
+}
+
+.theme-browser .theme .theme-actions .button {
+ float: none;
+ margin-right: 3px;
+}
+
+/**
+ * Theme Screenshot
+ *
+ * Has a fixed aspect ratio of 1.5 to 1 regardless of screenshot size
+ * It is also responsive.
+ */
+.theme-browser .theme .theme-screenshot {
+ display: block;
+ overflow: hidden;
+ position: relative;
+ -webkit-backface-visibility: hidden; /* Prevents flicker of the screenshot on hover. */
+ transition: opacity 0.2s ease-in-out;
+}
+
+.theme-browser .theme .theme-screenshot:after {
+ content: "";
+ display: block;
+ padding-top: 66.66666%; /* using a 3/2 aspect ratio */
+}
+
+.theme-browser .theme .theme-screenshot img {
+ height: auto;
+ position: absolute;
+ right: 0;
+ top: 0;
+ width: 100%;
+ transition: opacity 0.2s ease-in-out;
+}
+
+.theme-browser .theme:hover .theme-screenshot,
+.theme-browser .theme:focus .theme-screenshot {
+ background: #fff;
+}
+
+.theme-browser.rendered .theme:hover .theme-screenshot img,
+.theme-browser.rendered .theme:focus .theme-screenshot img {
+ opacity: 0.4;
+}
+
+.theme-browser .theme .more-details {
+ -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";
+ opacity: 0;
+ position: absolute;
+ top: 35%;
+ left: 20%;
+ right: 20%;
+ background: #23282d;
+ background: rgba(0, 0, 0, 0.7);
+ color: #fff;
+ font-size: 15px;
+ text-shadow: 0 1px 0 rgba(0, 0, 0, 0.6);
+ -webkit-font-smoothing: antialiased;
+ font-weight: 600;
+ padding: 15px 12px;
+ text-align: center;
+ border-radius: 3px;
+ transition: opacity 0.1s ease-in-out;
+}
+
+.theme-browser .theme:focus {
+ border-color: #5b9dd9;
+ box-shadow: 0 0 2px rgba(30, 140, 190, 0.8);
+}
+
+.theme-browser .theme:focus .more-details {
+ opacity: 1;
+}
+
+/* Current theme needs to have its action always on view */
+.theme-browser .theme.active:focus .theme-actions {
+ display: block;
+}
+
+.theme-browser.rendered .theme:hover .more-details,
+.theme-browser.rendered .theme:focus .more-details {
+ -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=100)";
+ opacity: 1;
+}
+
+/**
+ * The currently active theme
+ */
+.theme-browser .theme.active .theme-name {
+ background: #23282d;
+ color: #fff;
+ padding-left: 110px;
+ font-weight: 300;
+ box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.5);
+}
+
+.theme-browser .customize-control .theme.active .theme-name {
+ padding-left: 15px;
+}
+
+.theme-browser .theme.active .theme-name span {
+ font-weight: 600;
+}
+
+.theme-browser .theme.active .theme-actions {
+ background: rgba(49, 49, 49, 0.7);
+ border-right: none;
+ opacity: 1;
+}
+
+.theme-id-container {
+ position: relative;
+}
+
+.theme-browser .theme.active .theme-actions,
+.theme-browser .theme .theme-actions {
+ position: absolute;
+ top: 50%;
+ transform: translateY(-50%);
+ left: 0;
+ padding: 10px 15px;
+ box-shadow: inset 0 1px 0 rgba(0, 0, 0, 0.1);
+}
+
+.theme-browser .theme.active .theme-actions .button-primary {
+ margin-left: 0;
+}
+
+.theme-browser .theme .theme-author {
+ background: #23282d;
+ color: #eee;
+ display: none;
+ font-size: 14px;
+ margin: 0 10px;
+ padding: 5px 10px;
+ position: absolute;
+ bottom: 56px;
+}
+
+.theme-browser .theme.display-author .theme-author {
+ display: block;
+}
+
+.theme-browser .theme.display-author .theme-author a {
+ color: inherit;
+ text-decoration: none;
+}
+
+/**
+ * Add new theme
+ */
+.theme-browser .theme.add-new-theme {
+ border: none;
+ box-shadow: none;
+}
+
+.theme-browser .theme.add-new-theme a {
+ text-decoration: none;
+ display: block;
+ position: relative;
+ z-index: 1;
+}
+
+.theme-browser .theme.add-new-theme a:after {
+ display: block;
+ content: "";
+ background: transparent;
+ background: rgba(0, 0, 0, 0);
+ position: absolute;
+ top: 0;
+ right: 0;
+ left: 0;
+ bottom: 0;
+ padding: 0;
+ text-shadow: none;
+ border: 5px dashed #d5d2ca;
+ border: 5px dashed rgba(0, 0, 0, 0.1);
+ box-sizing: border-box;
+}
+
+.theme-browser .theme.add-new-theme span:after {
+ background: #e5e5e5;
+ background: rgba(153, 153, 153, 0.1);
+ border-radius: 50%;
+ display: inline-block;
+ content: "\f132";
+ -webkit-font-smoothing: antialiased;
+ font: normal 74px/115px dashicons;
+ width: 100px;
+ height: 100px;
+ vertical-align: middle;
+ text-align: center;
+ color: rgb(153, 153, 153);
+ position: absolute;
+ top: 30%;
+ right: 50%;
+ margin-right: -50px;
+ text-indent: -4px;
+ padding: 0;
+ text-shadow: none;
+ z-index: 4;
+}
+
+.rtl .theme-browser .theme.add-new-theme span:after {
+ text-indent: 4px;
+}
+
+.theme-browser .theme.add-new-theme a:hover .theme-screenshot,
+.theme-browser .theme.add-new-theme a:focus .theme-screenshot {
+ background: none;
+}
+
+.theme-browser .theme.add-new-theme a:hover span:after,
+.theme-browser .theme.add-new-theme a:focus span:after {
+ background: #fff;
+ color: #0073aa;
+}
+
+.theme-browser .theme.add-new-theme a:hover:after,
+.theme-browser .theme.add-new-theme a:focus:after {
+ border-color: transparent;
+ color: #fff;
+ background: #0073aa;
+ content: "";
+}
+
+.theme-browser .theme.add-new-theme .theme-name {
+ background: none;
+ text-align: center;
+ box-shadow: none;
+ font-weight: 400;
+ position: relative;
+ top: 0;
+ margin-top: -18px;
+ padding-top: 0;
+ padding-bottom: 48px;
+}
+
+.theme-browser .theme.add-new-theme a:hover .theme-name,
+.theme-browser .theme.add-new-theme a:focus .theme-name {
+ color: #fff;
+ z-index: 2;
+}
+
+/**
+ * Theme Overlay
+ * Shown when clicking a theme
+ */
+.theme-overlay .theme-backdrop {
+ position: absolute;
+ right: -20px;
+ left: 0;
+ top: 0;
+ bottom: 0;
+ background: #f1f1f1;
+ background: rgba(238, 238, 238, 0.9);
+ z-index: 10000; /* Over WP Pointers. */
+}
+
+.theme-overlay .theme-header {
+ position: absolute;
+ top: 0;
+ right: 0;
+ left: 0;
+ height: 48px;
+ border-bottom: 1px solid #ddd;
+}
+
+.theme-overlay .theme-header button {
+ padding: 0;
+}
+
+.theme-overlay .theme-header .close {
+ cursor: pointer;
+ height: 48px;
+ width: 50px;
+ text-align: center;
+ float: left;
+ border: 0;
+ border-right: 1px solid #ddd;
+ background-color: transparent;
+ transition: color .1s ease-in-out, background .1s ease-in-out;
+}
+
+.theme-overlay .theme-header .close:before {
+ font: normal 22px/50px dashicons !important;
+ color: #72777c;
+ display: inline-block;
+ content: "\f335";
+ font-weight: 300;
+}
+
+/* Left and right navigation */
+.theme-overlay .theme-header .right,
+.theme-overlay .theme-header .left {
+ cursor: pointer;
+ color: #72777c;
+ background-color: transparent;
+ height: 48px;
+ width: 54px;
+ float: right;
+ text-align: center;
+ border: 0;
+ border-left: 1px solid #ddd;
+ transition: color .1s ease-in-out, background .1s ease-in-out;
+}
+
+.theme-overlay .theme-header .close:focus,
+.theme-overlay .theme-header .close:hover,
+.theme-overlay .theme-header .right:focus,
+.theme-overlay .theme-header .right:hover,
+.theme-overlay .theme-header .left:focus,
+.theme-overlay .theme-header .left:hover {
+ background: #ddd;
+ border-color: #ccc;
+ color: #000;
+}
+
+.theme-overlay .theme-header .close:focus:before,
+.theme-overlay .theme-header .close:hover:before {
+ color: #000;
+}
+
+.theme-overlay .theme-header .close:focus,
+.theme-overlay .theme-header .right:focus,
+.theme-overlay .theme-header .left:focus {
+ box-shadow: none;
+ outline: none;
+}
+
+.theme-overlay .theme-header .left.disabled,
+.theme-overlay .theme-header .right.disabled,
+.theme-overlay .theme-header .left.disabled:hover,
+.theme-overlay .theme-header .right.disabled:hover {
+ color: #ccc;
+ background: inherit;
+ cursor: inherit;
+}
+
+.theme-overlay .theme-header .right:before,
+.theme-overlay .theme-header .left:before {
+ font: normal 20px/50px dashicons !important;
+ display: inline;
+ font-weight: 300;
+}
+
+.theme-overlay .theme-header .left:before {
+ content: "\f345";
+}
+
+.theme-overlay .theme-header .right:before {
+ content: "\f341";
+}
+
+.theme-overlay .theme-wrap {
+ clear: both;
+ position: fixed;
+ top: 9%;
+ right: 190px;
+ left: 30px;
+ bottom: 3%;
+ background: #fff;
+ box-shadow: 0 1px 20px 5px rgba(0, 0, 0, 0.1);
+ z-index: 10000; /* Over WP Pointers. */
+ box-sizing: border-box;
+ -webkit-overflow-scrolling: touch;
+}
+
+body.folded .theme-browser ~ .theme-overlay .theme-wrap {
+ right: 70px;
+}
+
+.theme-overlay .theme-about {
+ position: absolute;
+ top: 49px;
+ bottom: 57px;
+ right: 0;
+ left: 0;
+ overflow: auto;
+ padding: 2% 4%;
+}
+
+.theme-overlay .theme-actions {
+ position: absolute;
+ text-align: center;
+ bottom: 0;
+ right: 0;
+ left: 0;
+ padding: 10px 25px 5px;
+ background: #f3f3f3;
+ z-index: 30;
+ box-sizing: border-box;
+ border-top: 1px solid #eee;
+}
+
+.ie8 .theme-overlay .theme-actions {
+ border: 1px solid #eee;
+}
+
+.theme-overlay .theme-actions a {
+ margin-left: 5px;
+ margin-bottom: 5px;
+}
+
+/* Hide-if-customize for items we can't add classes to */
+.customize-support .theme-overlay .theme-actions a[href="themes.php?page=custom-header"],
+.customize-support .theme-overlay .theme-actions a[href="themes.php?page=custom-background"] {
+ display: none;
+}
+
+.broken-themes a.delete-theme,
+.theme-overlay .theme-actions .delete-theme {
+ color: #a00;
+ text-decoration: none;
+ border-color: transparent;
+ box-shadow: none;
+ background: transparent;
+}
+
+.theme-overlay .theme-actions .delete-theme {
+ position: absolute;
+ left: 10px;
+ bottom: 5px;
+}
+
+.broken-themes a.delete-theme:hover,
+.broken-themes a.delete-theme:focus,
+.theme-overlay .theme-actions .delete-theme:hover,
+.theme-overlay .theme-actions .delete-theme:focus {
+ background: #d54e21;
+ color: #fff;
+ border-color: #d54e21;
+}
+
+.theme-overlay .theme-actions .active-theme,
+.theme-overlay.active .theme-actions .inactive-theme {
+ display: none;
+}
+
+.theme-overlay .theme-actions .inactive-theme,
+.theme-overlay.active .theme-actions .active-theme {
+ display: block;
+}
+
+/**
+ * Theme Screenshots gallery
+ */
+.theme-overlay .theme-screenshots {
+ float: right;
+ margin: 0 0 0 30px;
+ width: 55%;
+ max-width: 1200px; /* Recommended theme screenshot width, set here to avoid stretching */
+ text-align: center;
+}
+
+/* First screenshot, shown big */
+.theme-overlay .screenshot {
+ border: 1px solid #fff;
+ box-sizing: border-box;
+ overflow: hidden;
+ position: relative;
+ box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.2);
+}
+
+.theme-overlay .screenshot:after {
+ content: "";
+ display: block;
+ padding-top: 75%; /* using a 4/3 aspect ratio */
+}
+
+.theme-overlay .screenshot img {
+ height: auto;
+ position: absolute;
+ right: 0;
+ top: 0;
+ width: 100%;
+}
+/* Handles old 300px screenshots */
+.theme-overlay.small-screenshot .theme-screenshots {
+ position: absolute;
+ width: 302px;
+}
+.theme-overlay.small-screenshot .theme-info {
+ margin-right: 350px;
+ width: auto;
+}
+
+/* Other screenshots, shown small and square */
+.theme-overlay .screenshot.thumb {
+ background: #ccc;
+ border: 1px solid #eee;
+ float: none;
+ display: inline-block;
+ margin: 10px 5px 0;
+ width: 140px;
+ height: 80px;
+ cursor: pointer;
+}
+
+.theme-overlay .screenshot.thumb:after {
+ content: "";
+ display: block;
+ padding-top: 100%; /* using a 1/1 aspect ratio */
+}
+
+.theme-overlay .screenshot.thumb img {
+ cursor: pointer;
+ height: auto;
+ position: absolute;
+ right: 0;
+ top: 0;
+ width: 100%;
+ height: auto;
+}
+
+.theme-overlay .screenshot.selected {
+ background: transparent;
+ border: 2px solid #00a0d2;
+}
+
+.theme-overlay .screenshot.selected img {
+ opacity: 0.8;
+}
+
+/* No screenshot placeholder */
+.theme-browser .theme .theme-screenshot.blank,
+.theme-overlay .screenshot.blank {
+ background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAYAAADED76LAAAALElEQVQYGWO8d+/efwYkoKioiMRjYGBC4WHhUK6A8T8QIJt8//59ZC493AAAQssKpBK4F5AAAAAASUVORK5CYII=);
+}
+
+/**
+ * Theme heading information
+ */
+.theme-overlay .theme-info {
+ width: 40%;
+ float: right;
+}
+
+.theme-overlay .current-label {
+ background: #32373c;
+ color: #fff;
+ font-size: 11px;
+ display: inline-block;
+ padding: 2px 8px;
+ border-radius: 2px;
+ margin: 0 0 -10px;
+ -webkit-user-select: none;
+ -moz-user-select: none;
+ -ms-user-select: none;
+ user-select: none;
+}
+
+.theme-overlay .theme-name {
+ color: #23282d;
+ font-size: 32px;
+ font-weight: 100;
+ margin: 10px 0 0;
+ line-height: 1.3;
+ word-wrap: break-word;
+ overflow-wrap: break-word;
+}
+
+.theme-overlay .theme-version {
+ color: #72777c;
+ font-size: 13px;
+ font-weight: 400;
+ float: none;
+ display: inline-block;
+ margin-right: 10px;
+}
+
+.theme-overlay .theme-author {
+ margin: 15px 0 25px;
+ color: #72777c;
+ font-size: 16px;
+ font-weight: 400;
+ line-height: inherit;
+}
+
+.theme-overlay .theme-author a {
+ text-decoration: none;
+}
+
+.theme-overlay .theme-description {
+ color: #555;
+ font-size: 15px;
+ font-weight: 400;
+ line-height: 1.5;
+ margin: 30px 0 0 0;
+}
+
+.theme-overlay .theme-tags {
+ border-top: 3px solid #eee;
+ color: #82878c;
+ font-size: 13px;
+ font-weight: 400;
+ margin: 30px 0 0 0;
+ padding-top: 20px;
+}
+
+.theme-overlay .theme-tags span {
+ color: #444;
+ font-weight: 600;
+ margin-left: 5px;
+}
+
+.theme-overlay .parent-theme {
+ background: #f7fcfe;
+ border: 1px solid #eee;
+ border-right: 4px solid #00a0d2;
+ font-size: 14px;
+ font-weight: 400;
+ margin-top: 30px;
+ padding: 10px 20px 10px 10px;
+}
+
+.theme-overlay .parent-theme strong {
+ font-weight: 600;
+}
+
+/**
+ * Single Theme Mode
+ * Displays detailed view inline when a user has no switch capabilities
+ */
+.single-theme .theme-overlay .theme-backdrop,
+.single-theme .theme-overlay .theme-header,
+.single-theme .theme {
+ display: none;
+}
+
+.single-theme .theme-overlay .theme-wrap {
+ clear: both;
+ min-height: 330px;
+ position: relative;
+ right: auto;
+ left: auto;
+ top: auto;
+ bottom: auto;
+ z-index: 10;
+}
+
+.single-theme .theme-overlay .theme-about {
+ padding: 30px 30px 70px;
+ position: static;
+}
+
+.single-theme .theme-overlay .theme-actions {
+ position: absolute;
+}
+
+/**
+ * Basic Responsive structure...
+ *
+ * Shuffles theme columns around based on screen width
+ */
+
+@media only screen and (min-width: 2000px) {
+ #wpwrap .theme-browser .theme {
+ width: 17.6%;
+ margin: 0 0 3% 3%;
+ }
+
+ #wpwrap .theme-browser .theme:nth-child(3n),
+ #wpwrap .theme-browser .theme:nth-child(4n) {
+ margin-left: 3%;
+ }
+
+ #wpwrap .theme-browser .theme:nth-child(5n) {
+ margin-left: 0;
+ }
+}
+
+@media only screen and (min-width: 1680px) {
+ .theme-overlay .theme-wrap {
+ width: 1450px;
+ margin: 0 auto;
+ }
+}
+
+/* Maximum screenshot width reaches 440px */
+@media only screen and (min-width: 1640px) {
+ .theme-browser .theme {
+ width: 22.7%;
+ margin: 0 0 3% 3%;
+ }
+ .theme-browser .theme .theme-screenshot:after {
+ padding-top: 75%; /* using a 4/3 aspect ratio */
+ }
+
+ .theme-browser .theme:nth-child(3n) {
+ margin-left: 3%;
+ }
+
+ .theme-browser .theme:nth-child(4n) {
+ margin-left: 0;
+ }
+}
+/* Maximum screenshot width reaches 440px */
+@media only screen and (max-width: 1120px) {
+ .theme-browser .theme {
+ width: 47.5%;
+ margin-left: 0;
+ }
+
+ .theme-browser .theme:nth-child(even) {
+ margin-left: 0;
+ }
+
+ .theme-browser .theme:nth-child(odd) {
+ margin-left: 5%;
+ }
+}
+
+/* Admin menu is folded */
+@media only screen and (max-width: 900px) {
+ .theme-overlay .theme-wrap {
+ right: 65px;
+ }
+}
+
+@media only screen and (max-width: 780px) {
+ body.folded .theme-overlay .theme-wrap,
+ .theme-overlay .theme-wrap {
+ top: 0; /* The adminmenu isn't fixed on mobile, so this can use the full viewport height */
+ left: 0;
+ bottom: 0;
+ right: 0;
+ padding: 70px 20px 20px;
+ border: none;
+ z-index: 100000; /* should overlap #wpadminbar. */
+ position: fixed;
+ }
+
+ .theme-browser .theme.active .theme-name span {
+ /* Hide the "Active: " label on smaller screens. */
+ display: none;
+ }
+
+ .theme-overlay .theme-screenshots {
+ width: 40%;
+ }
+
+ .theme-overlay .theme-info {
+ width: 50%;
+ }
+ .single-theme .theme-wrap {
+ padding: 10px;
+ }
+
+ .theme-browser .theme .theme-actions {
+ padding: 5px 10px 4px 10px;
+ }
+
+ .theme-overlay.small-screenshot .theme-screenshots {
+ position: static;
+ float: none;
+ max-width: 302px;
+ }
+
+ .theme-overlay.small-screenshot .theme-info {
+ margin-right: 0;
+ width: auto;
+ }
+
+ .theme:not(.active):hover .theme-actions,
+ .theme:not(.active):focus .theme-actions,
+ .theme:hover .more-details,
+ .theme:focus .more-details {
+ display: none;
+ }
+
+ .theme-browser.rendered .theme:hover .theme-screenshot img,
+ .theme-browser.rendered .theme:focus .theme-screenshot img {
+ opacity: 1.0;
+ }
+}
+
+@media only screen and (max-width: 480px) {
+ .theme-browser .theme {
+ width: 100%;
+ margin-left: 0;
+ }
+
+ .theme-browser .theme:nth-child(2n),
+ .theme-browser .theme:nth-child(3n) {
+ margin-left: 0;
+ }
+}
+
+@media only screen and (max-width: 650px) {
+ .theme-overlay .theme-description {
+ margin-right: 0;
+ }
+
+ .theme-overlay .theme-actions .delete-theme {
+ position: relative;
+ left: auto;
+ bottom: auto;
+ }
+
+ .theme-overlay .theme-actions .inactive-theme {
+ display: inline;
+ }
+
+ .theme-overlay .theme-screenshots {
+ width: 100%;
+ float: none;
+ }
+
+ .theme-overlay .theme-info {
+ width: 100%;
+ }
+
+ .theme-overlay .theme-author {
+ margin: 5px 0 15px 0;
+ }
+
+ .theme-overlay .current-label {
+ margin-top: 10px;
+ font-size: 13px;
+ }
+
+ .themes-php .wp-filter-search {
+ float: none;
+ clear: both;
+ right: 0;
+ left: 0;
+ margin: -5px 0 20px 0;
+ width: 100%;
+ max-width: 280px;
+ }
+
+ .theme-browser .theme.add-new-theme span:after {
+ font: normal 60px/90px dashicons;
+ width: 80px;
+ height: 80px;
+ top: 30%;
+ right: 50%;
+ text-indent: 0;
+ margin-right: -40px;
+ }
+
+ .single-theme .theme-wrap {
+ margin: 0 -10px 0 -12px;
+ padding: 10px;
+ }
+ .single-theme .theme-overlay .theme-about {
+ padding: 10px;
+ overflow: visible;
+ }
+ .single-theme .current-label {
+ display: none;
+ }
+ .single-theme .theme-overlay .theme-actions {
+ position: static;
+ }
+}
+
+.broken-themes {
+ clear: both;
+}
+
+.broken-themes table {
+ text-align: right;
+ width: 50%;
+ border-spacing: 3px;
+ padding: 3px;
+}
+
+
+/*------------------------------------------------------------------------------
+ 16.2 - Install Themes
+------------------------------------------------------------------------------*/
+
+/* Already installed theme */
+.theme-browser .theme .theme-installed {
+ background: #0073aa;
+}
+.theme-browser .theme .notice-success p:before {
+ color: #79ba49;
+ content: "\f147";
+ display: inline-block;
+ font: normal 20px/1 'dashicons';
+ -webkit-font-smoothing: antialiased;
+ -moz-osx-font-smoothing: grayscale;
+ vertical-align: top;
+}
+
+.theme-install.updated-message:before {
+ content: "";
+}
+
+.theme-install-php .wp-filter {
+ padding-right: 20px;
+}
+
+.theme-install-php a.upload,
+.theme-install-php a.browse-themes {
+ cursor: pointer;
+}
+
+.upload-view-toggle .browse,
+.plugin-install-tab-upload .upload-view-toggle .upload {
+ display: none;
+}
+
+.plugin-install-tab-upload .upload-view-toggle .browse {
+ display: inline;
+}
+
+.upload-theme,
+.upload-plugin {
+ box-sizing: border-box;
+ display: none;
+ margin: 0;
+ padding: 50px 0;
+ width: 100%;
+ overflow: hidden;
+ position: relative;
+ top: 10px;
+}
+
+.upload-plugin-wrap {
+ display: none;
+}
+
+.show-upload-view .upload-theme,
+.show-upload-view .upload-plugin,
+.show-upload-view .upload-plugin-wrap,
+.plugin-install-tab-upload .upload-plugin {
+ display: block;
+}
+
+.upload-theme .wp-upload-form,
+.upload-plugin .wp-upload-form {
+ background: #fafafa;
+ border: 1px solid #e5e5e5;
+ padding: 30px;
+ margin: 30px auto;
+ max-width: 380px;
+}
+.upload-theme .install-help,
+.upload-plugin .install-help {
+ color: #555d66; /* #f1f1f1 background */
+ font-size: 18px;
+ font-style: normal;
+ margin: 0;
+ padding: 0;
+ text-align: center;
+}
+
+p.no-themes,
+p.no-themes-local {
+ clear: both;
+ color: #666;
+ font-size: 18px;
+ font-style: normal;
+ margin: 0;
+ padding: 100px 0;
+ text-align: center;
+ display: none;
+}
+
+.no-results p.no-themes {
+ display: block;
+}
+
+.theme-install-php .add-new-theme {
+ display: none !important;
+}
+
+@media only screen and (max-width: 1120px) {
+ .upload-theme .wp-upload-form {
+ margin: 20px 0;
+ max-width: 100%;
+ }
+ .upload-theme .install-help {
+ font-size: 15px;
+ padding: 20px 0 0;
+ text-align: right;
+ }
+}
+
+.theme-details .theme-rating {
+ line-height: 1.9;
+}
+
+.theme-details .star-rating {
+ display: inline;
+}
+
+.theme-details .num-ratings,
+.theme-details .no-rating {
+ font-size: 11px;
+ color: #72777c;
+}
+
+.theme-details .no-rating {
+ display: block;
+ line-height: 1.9;
+}
+
+/*------------------------------------------------------------------------------
+ 16.3 - Custom Header Screen
+------------------------------------------------------------------------------*/
+
+.appearance_page_custom-header #headimg {
+ border: 1px solid #ddd;
+ overflow: hidden;
+ width: 100%;
+}
+
+.appearance_page_custom-header #upload-form p label {
+ font-size: 12px;
+}
+
+.appearance_page_custom-header .available-headers .default-header {
+ float: right;
+ margin: 0 0 20px 20px;
+}
+
+.appearance_page_custom-header .random-header {
+ clear: both;
+ margin: 0 0 20px 20px;
+ vertical-align: middle;
+}
+
+.appearance_page_custom-header .available-headers label input,
+.appearance_page_custom-header .random-header label input {
+ margin-left: 10px;
+}
+
+.appearance_page_custom-header .available-headers label img {
+ vertical-align: middle;
+}
+
+
+/*------------------------------------------------------------------------------
+ 16.4 - Custom Background Screen
+------------------------------------------------------------------------------*/
+
+div#custom-background-image {
+ min-height: 100px;
+ border: 1px solid #ddd;
+}
+
+div#custom-background-image img {
+ max-width: 400px;
+ max-height: 300px;
+}
+
+.background-position-control input[type="radio"]:checked ~ .button {
+ background: #eee;
+ border-color: #999;
+ box-shadow: inset 0 2px 5px -3px rgba(0, 0, 0, 0.5);
+ z-index: 1;
+}
+
+.background-position-control input[type="radio"]:focus ~ .button {
+ border-color: #5b9dd9;
+ box-shadow: inset 0 2px 5px -3px rgba(0, 0, 0, 0.5), 0 0 3px rgba(0, 115, 170, 0.8);
+ color: #23282d;
+}
+
+.background-position-control .background-position-center-icon,
+.background-position-control .background-position-center-icon:before {
+ display: inline-block;
+ line-height: 1;
+ text-align: center;
+ transition: background-color .1s ease-in;
+}
+
+.background-position-control .background-position-center-icon {
+ height: 20px;
+ margin-top: 13px;
+ vertical-align: top;
+ width: 20px;
+}
+
+.background-position-control .background-position-center-icon:before {
+ background-color: #555;
+ border-radius: 50%;
+ content: "";
+ height: 12px;
+ width: 12px;
+}
+
+.background-position-control .button:hover .background-position-center-icon:before,
+.background-position-control input[type="radio"]:focus ~ .button .background-position-center-icon:before {
+ background-color: #23282d;
+}
+
+.background-position-control .button-group {
+ display: block;
+}
+
+.background-position-control .button-group .button {
+ border-radius: 0;
+ box-shadow: none;
+ /* Following properties are overridden by buttons responsive styles (see: wp-includes/css/buttons.css). */
+ height: 40px !important;
+ line-height: 2.9 !important;
+ margin: 0 0 0 -1px !important;
+ padding: 0 10px 1px !important;
+ position: relative;
+}
+
+.background-position-control .button-group .button:active,
+.background-position-control .button-group .button:hover,
+.background-position-control .button-group .button:focus {
+ z-index: 1;
+}
+
+.background-position-control .button-group:last-child .button {
+ box-shadow: 0 1px 0 #ccc;
+}
+
+.background-position-control .button-group > label {
+ margin: 0 !important;
+}
+
+.background-position-control .button-group:first-child > label:first-child .button {
+ border-radius: 0 3px 0 0;
+}
+
+.background-position-control .button-group:first-child > label:first-child .dashicons {
+ transform: rotate( -45deg );
+}
+
+.background-position-control .button-group:first-child > label:last-child .button {
+ border-radius: 3px 0 0 0;
+}
+
+.background-position-control .button-group:first-child > label:last-child .dashicons {
+ transform: rotate( 45deg );
+}
+
+.background-position-control .button-group:last-child > label:first-child .button {
+ border-radius: 0 0 3px 0;
+}
+
+.background-position-control .button-group:last-child > label:first-child .dashicons {
+ transform: rotate( 45deg );
+}
+
+.background-position-control .button-group:last-child > label:last-child .button {
+ border-radius: 0 0 0 3px;
+}
+
+.background-position-control .button-group:last-child > label:last-child .dashicons {
+ transform: rotate( -45deg );
+}
+
+.background-position-control .button-group .dashicons {
+ margin-top: 9px;
+}
+
+.background-position-control .button-group + .button-group {
+ margin-top: -1px;
+}
+
+/*------------------------------------------------------------------------------
+ 23.0 - Full Overlay w/ Sidebar
+------------------------------------------------------------------------------*/
+
+body.full-overlay-active {
+ overflow: hidden;
+ /* Hide all the content, the Customizer overlay is then made visible to be the only available content. */
+ visibility: hidden;
+}
+
+.wp-full-overlay {
+ background: transparent;
+ z-index: 500000;
+ position: fixed;
+ overflow: visible;
+ top: 0;
+ bottom: 0;
+ right: 0;
+ left: 0;
+ height: 100%;
+ min-width: 0;
+}
+
+.wp-full-overlay-sidebar {
+ box-sizing: border-box;
+ position: fixed;
+ min-width: 300px;
+ max-width: 600px;
+ width: 18%;
+ height: 100%;
+ top: 0;
+ bottom: 0;
+ right: 0;
+ padding: 0;
+ margin: 0;
+ z-index: 10;
+ background: #eee;
+ border-left: none;
+}
+
+.wp-full-overlay.collapsed .wp-full-overlay-sidebar {
+ overflow: visible;
+}
+
+.wp-full-overlay.collapsed,
+.wp-full-overlay.expanded .wp-full-overlay-sidebar {
+ margin-right: 0 !important;
+}
+
+.wp-full-overlay.expanded {
+ margin-right: 300px;
+}
+
+.wp-full-overlay.collapsed .wp-full-overlay-sidebar {
+ margin-right: -300px;
+}
+
+@media screen and (min-width: 1667px) {
+ .wp-full-overlay.expanded {
+ margin-right: 18%;
+ }
+
+ .wp-full-overlay.collapsed .wp-full-overlay-sidebar {
+ margin-right: -18%;
+ }
+}
+
+@media screen and (min-width: 3333px) {
+ .wp-full-overlay.expanded {
+ margin-right: 600px;
+ }
+
+ .wp-full-overlay.collapsed .wp-full-overlay-sidebar {
+ margin-right: -600px;
+ }
+}
+
+.wp-full-overlay-sidebar:after {
+ content: "";
+ display: block;
+ position: absolute;
+ top: 0;
+ bottom: 0;
+ left: 0;
+ width: 3px;
+ z-index: 1000;
+}
+
+.wp-full-overlay-main {
+ position: absolute;
+ right: 0;
+ left: 0;
+ top: 0;
+ bottom: 0;
+ height: 100%;
+}
+
+.wp-full-overlay-sidebar .wp-full-overlay-header {
+ position: absolute;
+ right: 0;
+ left: 0;
+ height: 45px;
+ padding: 0 15px;
+ line-height: 3.2;
+ z-index: 10;
+ margin: 0;
+ border-top: none;
+ box-shadow: none;
+}
+
+.wp-full-overlay-sidebar .wp-full-overlay-header a.back {
+ margin-top: 9px;
+}
+
+.wp-full-overlay-sidebar .wp-full-overlay-footer {
+ bottom: 0;
+ border-bottom: none;
+ border-top: none;
+ box-shadow: none;
+}
+
+.wp-full-overlay-sidebar .wp-full-overlay-sidebar-content {
+ position: absolute;
+ top: 45px;
+ bottom: 45px;
+ right: 0;
+ left: 0;
+ overflow: auto;
+}
+
+/* Close & Navigation Links */
+.theme-install-overlay .wp-full-overlay-sidebar .wp-full-overlay-header {
+ padding: 0;
+}
+
+.theme-install-overlay .close-full-overlay,
+.theme-install-overlay .previous-theme,
+.theme-install-overlay .next-theme {
+ display: block;
+ position: relative;
+ float: right;
+ width: 45px;
+ height: 45px;
+ padding-left: 2px;
+ background: #eee;
+ border-left: 1px solid #ddd;
+ color: #444;
+ cursor: pointer;
+ text-decoration: none;
+ transition: color .1s ease-in-out, background .1s ease-in-out;
+}
+
+.theme-install-overlay .close-full-overlay:hover,
+.theme-install-overlay .close-full-overlay:focus,
+.theme-install-overlay .previous-theme:hover,
+.theme-install-overlay .previous-theme:focus,
+.theme-install-overlay .next-theme:hover,
+.theme-install-overlay .next-theme:focus {
+ background: #ddd;
+ border-color: #ccc;
+ color: #000;
+ outline: none;
+ box-shadow: none;
+}
+
+.theme-install-overlay .close-full-overlay:before {
+ font: normal 22px/1 dashicons;
+ content: "\f335";
+ position: relative;
+ top: 7px;
+ right: 13px;
+}
+
+.theme-install-overlay .previous-theme:before {
+ font: normal 20px/1 dashicons;
+ content: "\f345";
+ position: relative;
+ top: 6px;
+ right: 14px;
+}
+
+.theme-install-overlay .next-theme:before {
+ font: normal 20px/1 dashicons;
+ content: "\f341";
+ position: relative;
+ top: 6px;
+ right: 13px;
+}
+
+.theme-install-overlay .previous-theme.disabled,
+.theme-install-overlay .next-theme.disabled,
+.theme-install-overlay .previous-theme.disabled:hover,
+.theme-install-overlay .previous-theme.disabled:focus,
+.theme-install-overlay .next-theme.disabled:hover,
+.theme-install-overlay .next-theme.disabled:focus {
+ color: #b4b9be;
+ background: #eee;
+ cursor: default;
+ pointer-events: none;
+}
+
+.theme-install-overlay .close-full-overlay,
+.theme-install-overlay .previous-theme,
+.theme-install-overlay .next-theme {
+ border-right: 0;
+ border-top: 0;
+ border-bottom: 0;
+}
+
+.theme-install-overlay .close-full-overlay:before,
+.theme-install-overlay .previous-theme:before,
+.theme-install-overlay .next-theme:before {
+ top: 2px;
+ right: 0;
+}
+
+/* Collapse Button */
+.wp-core-ui .wp-full-overlay .collapse-sidebar {
+ position: fixed;
+ bottom: 0;
+ right: 0;
+ padding: 9px 10px 9px 0;
+ height: 45px;
+ color: #656a6f;
+ outline: 0;
+ line-height: 1;
+ background-color: transparent !important;
+ border: none !important;
+ box-shadow: none !important;
+ border-radius: 0 !important;
+}
+
+.wp-core-ui .wp-full-overlay .collapse-sidebar:hover,
+.wp-core-ui .wp-full-overlay .collapse-sidebar:focus {
+ color: #0073aa;
+}
+
+.wp-full-overlay .collapse-sidebar-arrow,
+.wp-full-overlay .collapse-sidebar-label {
+ display: inline-block;
+ vertical-align: middle;
+ line-height: 1.6;
+}
+
+.wp-full-overlay .collapse-sidebar-arrow {
+ width: 20px;
+ height: 20px;
+ margin: 0 2px; /* avoid the focus box-shadow to be cut-off */
+ border-radius: 50%;
+ overflow: hidden;
+}
+
+.wp-full-overlay .collapse-sidebar:hover .collapse-sidebar-arrow,
+.wp-full-overlay .collapse-sidebar:focus .collapse-sidebar-arrow {
+ box-shadow:
+ 0 0 0 1px #5b9dd9,
+ 0 0 2px 1px rgba(30, 140, 190, 0.8);
+}
+
+.wp-full-overlay .collapse-sidebar-label {
+ margin-right: 3px;
+}
+
+.wp-full-overlay.collapsed .collapse-sidebar-label {
+ display: none;
+}
+
+.wp-full-overlay .collapse-sidebar-arrow:before {
+ display: block;
+ content: "\f148";
+ background: #eee;
+ font: normal 20px/1 dashicons;
+ speak: none;
+ padding: 0;
+ -webkit-font-smoothing: antialiased;
+ -moz-osx-font-smoothing: grayscale;
+}
+
+.wp-core-ui .wp-full-overlay.collapsed .collapse-sidebar {
+ padding: 9px 10px;
+}
+
+/* rtl:ignore */
+.wp-full-overlay.collapsed .collapse-sidebar-arrow:before,
+.rtl .wp-full-overlay .collapse-sidebar-arrow:before {
+ transform: rotate(180.001deg); /* Firefox: promoting to its own layer to trigger anti-aliasing */
+}
+
+.rtl .wp-full-overlay.collapsed .collapse-sidebar-arrow:before {
+ transform: none;
+}
+
+/* Animations */
+.wp-full-overlay,
+.wp-full-overlay-sidebar,
+.wp-full-overlay .collapse-sidebar,
+.wp-full-overlay-main {
+ transition-property: right, left, top, bottom, width, margin;
+ transition-duration: 0.2s;
+}
+
+/* Device/preview size toggles */
+
+.wp-full-overlay {
+ background: #191e23;
+}
+
+.wp-full-overlay-main {
+ background-color: #f1f1f1;
+}
+
+.expanded .wp-full-overlay-footer {
+ position: fixed;
+ bottom: 0;
+ right: 0;
+ min-width: 299px;
+ max-width: 599px;
+ width: 18%;
+ width: calc( 18% - 1px );
+ height: 45px;
+ border-top: 1px solid #ddd;
+ background: #eee;
+}
+
+.wp-full-overlay-footer .devices-wrapper {
+ float: left;
+}
+
+.wp-full-overlay-footer .devices {
+ position: relative;
+ background: #eee;
+ box-shadow: 20px 0 10px -5px #eee;
+}
+
+.wp-full-overlay-footer .devices button {
+ cursor: pointer;
+ background: transparent;
+ border: none;
+ height: 45px;
+ padding: 0 3px;
+ margin: 0 -4px 0 0;
+ box-shadow: none;
+ border-top: 1px solid transparent;
+ border-bottom: 4px solid transparent;
+ transition:
+ .15s color ease-in-out,
+ .15s background-color ease-in-out,
+ .15s border-color ease-in-out;
+}
+
+.wp-full-overlay-footer .devices button:focus {
+ box-shadow: none;
+ outline: none;
+}
+
+.wp-full-overlay-footer .devices button:before {
+ display: inline-block;
+ -webkit-font-smoothing: antialiased;
+ font: normal 20px/30px "dashicons";
+ vertical-align: top;
+ margin: 3px 0;
+ padding: 4px 8px;
+ color: #656a6f;
+}
+
+.wp-full-overlay-footer .devices button.active {
+ border-bottom-color: #191e23;
+}
+
+.wp-full-overlay-footer .devices button:hover,
+.wp-full-overlay-footer .devices button:focus {
+ background-color: #fff;
+}
+
+.wp-full-overlay-footer .devices button:focus,
+.wp-full-overlay-footer .devices button.active:hover {
+ border-bottom-color: #0073aa;
+}
+
+.wp-full-overlay-footer .devices button.active:before {
+ color: #191e23;
+}
+
+.wp-full-overlay-footer .devices button:hover:before,
+.wp-full-overlay-footer .devices button:focus:before {
+ color: #0073aa;
+}
+
+.wp-full-overlay-footer .devices .preview-desktop:before {
+ content: "\f472";
+}
+
+.wp-full-overlay-footer .devices .preview-tablet:before {
+ content: "\f471";
+}
+
+.wp-full-overlay-footer .devices .preview-mobile:before {
+ content: "\f470";
+}
+
+@media screen and (max-width: 1024px) {
+ .wp-full-overlay-footer .devices {
+ display: none;
+ }
+}
+
+.collapsed .wp-full-overlay-footer .devices button:before {
+ display: none;
+}
+
+.preview-mobile .wp-full-overlay-main {
+ margin: auto -160px auto 0;
+ width: 320px;
+ height: 480px;
+ max-height: 100%;
+ max-width: 100%;
+ right: 50%;
+}
+
+.preview-tablet .wp-full-overlay-main {
+ margin: auto -360px auto 0;
+ width: 720px; /* Size is loosely based on a typical "tablet" device size. Intentionally ambiguous - this does not represent any particular device precisely. */
+ height: 1080px;
+ max-height: 100%;
+ max-width: 100%;
+ right: 50%;
+}
+
+
+/*------------------------------------------------------------------------------
+ 24.0 - Customize Loader
+------------------------------------------------------------------------------*/
+
+.no-customize-support .hide-if-no-customize,
+.customize-support .hide-if-customize,
+.no-customize-support.wp-core-ui .hide-if-no-customize,
+.no-customize-support .wp-core-ui .hide-if-no-customize,
+.customize-support.wp-core-ui .hide-if-customize,
+.customize-support .wp-core-ui .hide-if-customize {
+ display: none;
+}
+
+#customize-container,
+#customize-controls .notice.notification-overlay {
+ background: #eee;
+ z-index: 500000;
+ position: fixed;
+ overflow: visible;
+ top: 0;
+ bottom: 0;
+ right: 0;
+ left: 0;
+ height: 100%;
+}
+#customize-container {
+ display: none;
+}
+
+/* Make the Customizer and Theme installer overlays the only available content. */
+#customize-container,
+.theme-install-overlay {
+ visibility: visible;
+}
+
+.customize-loading #customize-container iframe {
+ opacity: 0;
+}
+
+#customize-container iframe,
+.theme-install-overlay iframe {
+ height: 100%;
+ width: 100%;
+ z-index: 20;
+ transition: opacity 0.3s;
+}
+
+#customize-controls {
+ margin-top: 0;
+}
+
+.theme-install-overlay {
+ display: none;
+}
+
+.theme-install-overlay.single-theme {
+ display: block;
+}
+
+.install-theme-info {
+ display: none;
+ padding: 10px 20px 60px;
+}
+
+.single-theme .install-theme-info {
+ padding-top: 15px;
+}
+
+.theme-install-overlay .install-theme-info {
+ display: block;
+}
+
+.install-theme-info .theme-install {
+ float: left;
+ margin-top: 18px;
+}
+
+.install-theme-info .theme-name {
+ font-size: 16px;
+ line-height: 1.5;
+ margin-bottom: 0;
+ margin-top: 0;
+}
+
+.install-theme-info .theme-screenshot {
+ margin: 15px 0;
+ width: 258px;
+ border: 1px solid #ccc;
+}
+
+.install-theme-info .theme-details {
+ overflow: hidden;
+}
+
+.theme-details .theme-version {
+ margin: 15px 0;
+}
+
+.theme-details .theme-description {
+ float: right;
+ color: #72777c;
+ line-height: 1.6;
+ max-width: 100%;
+}
+
+.theme-install-overlay .wp-full-overlay-header .button {
+ float: left;
+ margin: 8px 0 0 10px;
+ /* For when .theme-install is a span rather than a.button-primary (already installed theme) */
+ line-height: 2;
+}
+
+.theme-install-overlay .wp-full-overlay-sidebar {
+ background: #eee;
+ border-left: 1px solid #ddd;
+}
+
+.theme-install-overlay .wp-full-overlay-sidebar-content {
+ background: #fff;
+ border-top: 1px solid #ddd;
+ border-bottom: 1px solid #ddd;
+}
+
+.theme-install-overlay .wp-full-overlay-main {
+ position: absolute;
+ z-index: 0;
+ background-color: #f1f1f1;
+}
+
+.customize-loading #customize-container {
+ background-color: #f1f1f1;
+}
+
+#customize-preview.wp-full-overlay-main:before,
+.customize-loading #customize-container:before,
+#customize-controls .notice.notification-overlay.notification-loading:before,
+.theme-install-overlay .wp-full-overlay-main:before {
+ content: "";
+ display: block;
+ width: 20px;
+ height: 20px;
+ position: absolute;
+ right: 50%;
+ top: 50%;
+ z-index: -1;
+ margin: -10px -10px 0 0;
+ transform: translateZ(0);
+ background: transparent url(../images/spinner.gif) no-repeat center center;
+ background-size: 20px 20px;
+}
+
+#customize-preview.wp-full-overlay-main.iframe-ready:before,
+.theme-install-overlay.iframe-ready .wp-full-overlay-main:before {
+ background-image: none;
+}
+
+/* =Media Queries
+-------------------------------------------------------------- */
+
+/**
+ * HiDPI Displays
+ */
+@media print,
+ (-webkit-min-device-pixel-ratio: 1.25),
+ (min-resolution: 120dpi) {
+ .wp-full-overlay .collapse-sidebar-arrow {
+ background-image: url(../images/arrows-2x.png);
+ background-size: 15px 123px;
+ }
+
+ #customize-preview.wp-full-overlay-main:before,
+ .customize-loading #customize-container:before,
+ #customize-controls .notice.notification-overlay.notification-loading:before,
+ .theme-install-overlay .wp-full-overlay-main:before {
+ background-image: url(../images/spinner-2x.gif);
+ }
+}
+
+@media screen and (max-width: 782px) {
+ .available-theme .action-links .delete-theme {
+ float: none;
+ margin: 0;
+ padding: 0;
+ clear: both;
+ }
+
+ .available-theme .action-links .delete-theme a {
+ padding: 0;
+ }
+
+ .broken-themes table {
+ width: 100%;
+ }
+
+ .theme-install-overlay .wp-full-overlay-header .theme-install {
+ margin-top: 6px;
+ line-height: normal;
+ }
+
+ .theme-browser .theme .theme-actions .button {
+ margin-bottom: 0;
+ }
+
+ .theme-browser .theme.active .theme-actions,
+ .theme-browser .theme .theme-actions {
+ padding-top: 8px;
+ padding-bottom: 8px;
+ }
+}
+
+@media aural {
+ .theme .notice:before,
+ .theme-info .updating-message:before,
+ .theme-info .updated-message:before,
+ .theme-install.updating-message:before {
+ speak: none;
+ }
+}
diff --git a/www/crm/wp-admin/css/themes-rtl.min.css b/www/crm/wp-admin/css/themes-rtl.min.css
new file mode 100644
index 00000000..44eb7b9a
--- /dev/null
+++ b/www/crm/wp-admin/css/themes-rtl.min.css
@@ -0,0 +1,2 @@
+/*! This file is auto-generated */
+body.js .theme-browser.search-loading{display:none}.theme-browser .themes{clear:both}.themes-php:not(.network-admin) .wrap h1{margin-bottom:15px}.themes-php .wrap h1 .button{margin-right:20px}.themes-php .search-form{display:inline}.themes-php .wp-filter-search{position:relative;top:-2px;right:20px;margin:0;width:280px;font-size:16px;font-weight:300;line-height:1.5}.theme .notice,.theme .notice.is-dismissible{right:0;margin:0;position:absolute;left:0;top:0}.theme-browser .theme{cursor:pointer;float:right;margin:0 0 4% 4%;position:relative;width:30.6%;border:1px solid #ddd;box-shadow:0 1px 1px -1px rgba(0,0,0,.1);box-sizing:border-box}.ie8 .theme-browser .theme{width:30%;margin:0 0 4% 3%}.theme-browser .theme:nth-child(3n){margin-left:0}.theme-browser .theme:focus,.theme-browser .theme:hover{cursor:pointer}.theme-browser .theme .theme-name{font-size:15px;font-weight:600;height:18px;margin:0;padding:15px;box-shadow:inset 0 1px 0 rgba(0,0,0,.1);overflow:hidden;white-space:nowrap;text-overflow:ellipsis;background:#fff;background:rgba(255,255,255,.65)}.theme-browser .theme .theme-actions{-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";opacity:0;transition:opacity .1s ease-in-out;height:auto;background:rgba(244,244,244,.7);border-right:1px solid rgba(0,0,0,.05)}.theme-browser .theme.focus .theme-actions,.theme-browser .theme:focus .theme-actions,.theme-browser .theme:hover .theme-actions{-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=100)";opacity:1}.theme-browser .theme .theme-actions .button-primary{margin-left:3px}.theme-browser .theme .theme-actions .button{float:none;margin-right:3px}.theme-browser .theme .theme-screenshot{display:block;overflow:hidden;position:relative;-webkit-backface-visibility:hidden;transition:opacity .2s ease-in-out}.theme-browser .theme .theme-screenshot:after{content:"";display:block;padding-top:66.66666%}.theme-browser .theme .theme-screenshot img{height:auto;position:absolute;right:0;top:0;width:100%;transition:opacity .2s ease-in-out}.theme-browser .theme:focus .theme-screenshot,.theme-browser .theme:hover .theme-screenshot{background:#fff}.theme-browser.rendered .theme:focus .theme-screenshot img,.theme-browser.rendered .theme:hover .theme-screenshot img{opacity:.4}.theme-browser .theme .more-details{-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";opacity:0;position:absolute;top:35%;left:20%;right:20%;background:#23282d;background:rgba(0,0,0,.7);color:#fff;font-size:15px;text-shadow:0 1px 0 rgba(0,0,0,.6);-webkit-font-smoothing:antialiased;font-weight:600;padding:15px 12px;text-align:center;border-radius:3px;transition:opacity .1s ease-in-out}.theme-browser .theme:focus{border-color:#5b9dd9;box-shadow:0 0 2px rgba(30,140,190,.8)}.theme-browser .theme:focus .more-details{opacity:1}.theme-browser .theme.active:focus .theme-actions{display:block}.theme-browser.rendered .theme:focus .more-details,.theme-browser.rendered .theme:hover .more-details{-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=100)";opacity:1}.theme-browser .theme.active .theme-name{background:#23282d;color:#fff;padding-left:110px;font-weight:300;box-shadow:inset 0 1px 1px rgba(0,0,0,.5)}.theme-browser .customize-control .theme.active .theme-name{padding-left:15px}.theme-browser .theme.active .theme-name span{font-weight:600}.theme-browser .theme.active .theme-actions{background:rgba(49,49,49,.7);border-right:none;opacity:1}.theme-id-container{position:relative}.theme-browser .theme .theme-actions,.theme-browser .theme.active .theme-actions{position:absolute;top:50%;transform:translateY(-50%);left:0;padding:10px 15px;box-shadow:inset 0 1px 0 rgba(0,0,0,.1)}.theme-browser .theme.active .theme-actions .button-primary{margin-left:0}.theme-browser .theme .theme-author{background:#23282d;color:#eee;display:none;font-size:14px;margin:0 10px;padding:5px 10px;position:absolute;bottom:56px}.theme-browser .theme.display-author .theme-author{display:block}.theme-browser .theme.display-author .theme-author a{color:inherit;text-decoration:none}.theme-browser .theme.add-new-theme{border:none;box-shadow:none}.theme-browser .theme.add-new-theme a{text-decoration:none;display:block;position:relative;z-index:1}.theme-browser .theme.add-new-theme a:after{display:block;content:"";background:0 0;background:rgba(0,0,0,0);position:absolute;top:0;right:0;left:0;bottom:0;padding:0;text-shadow:none;border:5px dashed #d5d2ca;border:5px dashed rgba(0,0,0,.1);box-sizing:border-box}.theme-browser .theme.add-new-theme span:after{background:#e5e5e5;background:rgba(153,153,153,.1);border-radius:50%;display:inline-block;content:"\f132";-webkit-font-smoothing:antialiased;font:normal 74px/115px dashicons;width:100px;height:100px;vertical-align:middle;text-align:center;color:#999;position:absolute;top:30%;right:50%;margin-right:-50px;text-indent:-4px;padding:0;text-shadow:none;z-index:4}.rtl .theme-browser .theme.add-new-theme span:after{text-indent:4px}.theme-browser .theme.add-new-theme a:focus .theme-screenshot,.theme-browser .theme.add-new-theme a:hover .theme-screenshot{background:0 0}.theme-browser .theme.add-new-theme a:focus span:after,.theme-browser .theme.add-new-theme a:hover span:after{background:#fff;color:#0073aa}.theme-browser .theme.add-new-theme a:focus:after,.theme-browser .theme.add-new-theme a:hover:after{border-color:transparent;color:#fff;background:#0073aa;content:""}.theme-browser .theme.add-new-theme .theme-name{background:0 0;text-align:center;box-shadow:none;font-weight:400;position:relative;top:0;margin-top:-18px;padding-top:0;padding-bottom:48px}.theme-browser .theme.add-new-theme a:focus .theme-name,.theme-browser .theme.add-new-theme a:hover .theme-name{color:#fff;z-index:2}.theme-overlay .theme-backdrop{position:absolute;right:-20px;left:0;top:0;bottom:0;background:#f1f1f1;background:rgba(238,238,238,.9);z-index:10000}.theme-overlay .theme-header{position:absolute;top:0;right:0;left:0;height:48px;border-bottom:1px solid #ddd}.theme-overlay .theme-header button{padding:0}.theme-overlay .theme-header .close{cursor:pointer;height:48px;width:50px;text-align:center;float:left;border:0;border-right:1px solid #ddd;background-color:transparent;transition:color .1s ease-in-out,background .1s ease-in-out}.theme-overlay .theme-header .close:before{font:normal 22px/50px dashicons!important;color:#72777c;display:inline-block;content:"\f335";font-weight:300}.theme-overlay .theme-header .left,.theme-overlay .theme-header .right{cursor:pointer;color:#72777c;background-color:transparent;height:48px;width:54px;float:right;text-align:center;border:0;border-left:1px solid #ddd;transition:color .1s ease-in-out,background .1s ease-in-out}.theme-overlay .theme-header .close:focus,.theme-overlay .theme-header .close:hover,.theme-overlay .theme-header .left:focus,.theme-overlay .theme-header .left:hover,.theme-overlay .theme-header .right:focus,.theme-overlay .theme-header .right:hover{background:#ddd;border-color:#ccc;color:#000}.theme-overlay .theme-header .close:focus:before,.theme-overlay .theme-header .close:hover:before{color:#000}.theme-overlay .theme-header .close:focus,.theme-overlay .theme-header .left:focus,.theme-overlay .theme-header .right:focus{box-shadow:none;outline:0}.theme-overlay .theme-header .left.disabled,.theme-overlay .theme-header .left.disabled:hover,.theme-overlay .theme-header .right.disabled,.theme-overlay .theme-header .right.disabled:hover{color:#ccc;background:inherit;cursor:inherit}.theme-overlay .theme-header .left:before,.theme-overlay .theme-header .right:before{font:normal 20px/50px dashicons!important;display:inline;font-weight:300}.theme-overlay .theme-header .left:before{content:"\f345"}.theme-overlay .theme-header .right:before{content:"\f341"}.theme-overlay .theme-wrap{clear:both;position:fixed;top:9%;right:190px;left:30px;bottom:3%;background:#fff;box-shadow:0 1px 20px 5px rgba(0,0,0,.1);z-index:10000;box-sizing:border-box;-webkit-overflow-scrolling:touch}body.folded .theme-browser~.theme-overlay .theme-wrap{right:70px}.theme-overlay .theme-about{position:absolute;top:49px;bottom:57px;right:0;left:0;overflow:auto;padding:2% 4%}.theme-overlay .theme-actions{position:absolute;text-align:center;bottom:0;right:0;left:0;padding:10px 25px 5px;background:#f3f3f3;z-index:30;box-sizing:border-box;border-top:1px solid #eee}.ie8 .theme-overlay .theme-actions{border:1px solid #eee}.theme-overlay .theme-actions a{margin-left:5px;margin-bottom:5px}.customize-support .theme-overlay .theme-actions a[href="themes.php?page=custom-background"],.customize-support .theme-overlay .theme-actions a[href="themes.php?page=custom-header"]{display:none}.broken-themes a.delete-theme,.theme-overlay .theme-actions .delete-theme{color:#a00;text-decoration:none;border-color:transparent;box-shadow:none;background:0 0}.theme-overlay .theme-actions .delete-theme{position:absolute;left:10px;bottom:5px}.broken-themes a.delete-theme:focus,.broken-themes a.delete-theme:hover,.theme-overlay .theme-actions .delete-theme:focus,.theme-overlay .theme-actions .delete-theme:hover{background:#d54e21;color:#fff;border-color:#d54e21}.theme-overlay .theme-actions .active-theme,.theme-overlay.active .theme-actions .inactive-theme{display:none}.theme-overlay .theme-actions .inactive-theme,.theme-overlay.active .theme-actions .active-theme{display:block}.theme-overlay .theme-screenshots{float:right;margin:0 0 0 30px;width:55%;max-width:1200px;text-align:center}.theme-overlay .screenshot{border:1px solid #fff;box-sizing:border-box;overflow:hidden;position:relative;box-shadow:0 0 0 1px rgba(0,0,0,.2)}.theme-overlay .screenshot:after{content:"";display:block;padding-top:75%}.theme-overlay .screenshot img{height:auto;position:absolute;right:0;top:0;width:100%}.theme-overlay.small-screenshot .theme-screenshots{position:absolute;width:302px}.theme-overlay.small-screenshot .theme-info{margin-right:350px;width:auto}.theme-overlay .screenshot.thumb{background:#ccc;border:1px solid #eee;float:none;display:inline-block;margin:10px 5px 0;width:140px;height:80px;cursor:pointer}.theme-overlay .screenshot.thumb:after{content:"";display:block;padding-top:100%}.theme-overlay .screenshot.thumb img{cursor:pointer;height:auto;position:absolute;right:0;top:0;width:100%;height:auto}.theme-overlay .screenshot.selected{background:0 0;border:2px solid #00a0d2}.theme-overlay .screenshot.selected img{opacity:.8}.theme-browser .theme .theme-screenshot.blank,.theme-overlay .screenshot.blank{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAYAAADED76LAAAALElEQVQYGWO8d+/efwYkoKioiMRjYGBC4WHhUK6A8T8QIJt8//59ZC493AAAQssKpBK4F5AAAAAASUVORK5CYII=)}.theme-overlay .theme-info{width:40%;float:right}.theme-overlay .current-label{background:#32373c;color:#fff;font-size:11px;display:inline-block;padding:2px 8px;border-radius:2px;margin:0 0 -10px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.theme-overlay .theme-name{color:#23282d;font-size:32px;font-weight:100;margin:10px 0 0;line-height:1.3;word-wrap:break-word;overflow-wrap:break-word}.theme-overlay .theme-version{color:#72777c;font-size:13px;font-weight:400;float:none;display:inline-block;margin-right:10px}.theme-overlay .theme-author{margin:15px 0 25px;color:#72777c;font-size:16px;font-weight:400;line-height:inherit}.theme-overlay .theme-author a{text-decoration:none}.theme-overlay .theme-description{color:#555;font-size:15px;font-weight:400;line-height:1.5;margin:30px 0 0 0}.theme-overlay .theme-tags{border-top:3px solid #eee;color:#82878c;font-size:13px;font-weight:400;margin:30px 0 0 0;padding-top:20px}.theme-overlay .theme-tags span{color:#444;font-weight:600;margin-left:5px}.theme-overlay .parent-theme{background:#f7fcfe;border:1px solid #eee;border-right:4px solid #00a0d2;font-size:14px;font-weight:400;margin-top:30px;padding:10px 20px 10px 10px}.theme-overlay .parent-theme strong{font-weight:600}.single-theme .theme,.single-theme .theme-overlay .theme-backdrop,.single-theme .theme-overlay .theme-header{display:none}.single-theme .theme-overlay .theme-wrap{clear:both;min-height:330px;position:relative;right:auto;left:auto;top:auto;bottom:auto;z-index:10}.single-theme .theme-overlay .theme-about{padding:30px 30px 70px;position:static}.single-theme .theme-overlay .theme-actions{position:absolute}@media only screen and (min-width:2000px){#wpwrap .theme-browser .theme{width:17.6%;margin:0 0 3% 3%}#wpwrap .theme-browser .theme:nth-child(3n),#wpwrap .theme-browser .theme:nth-child(4n){margin-left:3%}#wpwrap .theme-browser .theme:nth-child(5n){margin-left:0}}@media only screen and (min-width:1680px){.theme-overlay .theme-wrap{width:1450px;margin:0 auto}}@media only screen and (min-width:1640px){.theme-browser .theme{width:22.7%;margin:0 0 3% 3%}.theme-browser .theme .theme-screenshot:after{padding-top:75%}.theme-browser .theme:nth-child(3n){margin-left:3%}.theme-browser .theme:nth-child(4n){margin-left:0}}@media only screen and (max-width:1120px){.theme-browser .theme{width:47.5%;margin-left:0}.theme-browser .theme:nth-child(even){margin-left:0}.theme-browser .theme:nth-child(odd){margin-left:5%}}@media only screen and (max-width:900px){.theme-overlay .theme-wrap{right:65px}}@media only screen and (max-width:780px){.theme-overlay .theme-wrap,body.folded .theme-overlay .theme-wrap{top:0;left:0;bottom:0;right:0;padding:70px 20px 20px;border:none;z-index:100000;position:fixed}.theme-browser .theme.active .theme-name span{display:none}.theme-overlay .theme-screenshots{width:40%}.theme-overlay .theme-info{width:50%}.single-theme .theme-wrap{padding:10px}.theme-browser .theme .theme-actions{padding:5px 10px 4px 10px}.theme-overlay.small-screenshot .theme-screenshots{position:static;float:none;max-width:302px}.theme-overlay.small-screenshot .theme-info{margin-right:0;width:auto}.theme:focus .more-details,.theme:hover .more-details,.theme:not(.active):focus .theme-actions,.theme:not(.active):hover .theme-actions{display:none}.theme-browser.rendered .theme:focus .theme-screenshot img,.theme-browser.rendered .theme:hover .theme-screenshot img{opacity:1}}@media only screen and (max-width:480px){.theme-browser .theme{width:100%;margin-left:0}.theme-browser .theme:nth-child(2n),.theme-browser .theme:nth-child(3n){margin-left:0}}@media only screen and (max-width:650px){.theme-overlay .theme-description{margin-right:0}.theme-overlay .theme-actions .delete-theme{position:relative;left:auto;bottom:auto}.theme-overlay .theme-actions .inactive-theme{display:inline}.theme-overlay .theme-screenshots{width:100%;float:none}.theme-overlay .theme-info{width:100%}.theme-overlay .theme-author{margin:5px 0 15px 0}.theme-overlay .current-label{margin-top:10px;font-size:13px}.themes-php .wp-filter-search{float:none;clear:both;right:0;left:0;margin:-5px 0 20px 0;width:100%;max-width:280px}.theme-browser .theme.add-new-theme span:after{font:normal 60px/90px dashicons;width:80px;height:80px;top:30%;right:50%;text-indent:0;margin-right:-40px}.single-theme .theme-wrap{margin:0 -10px 0 -12px;padding:10px}.single-theme .theme-overlay .theme-about{padding:10px;overflow:visible}.single-theme .current-label{display:none}.single-theme .theme-overlay .theme-actions{position:static}}.broken-themes{clear:both}.broken-themes table{text-align:right;width:50%;border-spacing:3px;padding:3px}.theme-browser .theme .theme-installed{background:#0073aa}.theme-browser .theme .notice-success p:before{color:#79ba49;content:"\f147";display:inline-block;font:normal 20px/1 dashicons;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;vertical-align:top}.theme-install.updated-message:before{content:""}.theme-install-php .wp-filter{padding-right:20px}.theme-install-php a.browse-themes,.theme-install-php a.upload{cursor:pointer}.plugin-install-tab-upload .upload-view-toggle .upload,.upload-view-toggle .browse{display:none}.plugin-install-tab-upload .upload-view-toggle .browse{display:inline}.upload-plugin,.upload-theme{box-sizing:border-box;display:none;margin:0;padding:50px 0;width:100%;overflow:hidden;position:relative;top:10px}.upload-plugin-wrap{display:none}.plugin-install-tab-upload .upload-plugin,.show-upload-view .upload-plugin,.show-upload-view .upload-plugin-wrap,.show-upload-view .upload-theme{display:block}.upload-plugin .wp-upload-form,.upload-theme .wp-upload-form{background:#fafafa;border:1px solid #e5e5e5;padding:30px;margin:30px auto;max-width:380px}.upload-plugin .install-help,.upload-theme .install-help{color:#555d66;font-size:18px;font-style:normal;margin:0;padding:0;text-align:center}p.no-themes,p.no-themes-local{clear:both;color:#666;font-size:18px;font-style:normal;margin:0;padding:100px 0;text-align:center;display:none}.no-results p.no-themes{display:block}.theme-install-php .add-new-theme{display:none!important}@media only screen and (max-width:1120px){.upload-theme .wp-upload-form{margin:20px 0;max-width:100%}.upload-theme .install-help{font-size:15px;padding:20px 0 0;text-align:right}}.theme-details .theme-rating{line-height:1.9}.theme-details .star-rating{display:inline}.theme-details .no-rating,.theme-details .num-ratings{font-size:11px;color:#72777c}.theme-details .no-rating{display:block;line-height:1.9}.appearance_page_custom-header #headimg{border:1px solid #ddd;overflow:hidden;width:100%}.appearance_page_custom-header #upload-form p label{font-size:12px}.appearance_page_custom-header .available-headers .default-header{float:right;margin:0 0 20px 20px}.appearance_page_custom-header .random-header{clear:both;margin:0 0 20px 20px;vertical-align:middle}.appearance_page_custom-header .available-headers label input,.appearance_page_custom-header .random-header label input{margin-left:10px}.appearance_page_custom-header .available-headers label img{vertical-align:middle}div#custom-background-image{min-height:100px;border:1px solid #ddd}div#custom-background-image img{max-width:400px;max-height:300px}.background-position-control input[type=radio]:checked~.button{background:#eee;border-color:#999;box-shadow:inset 0 2px 5px -3px rgba(0,0,0,.5);z-index:1}.background-position-control input[type=radio]:focus~.button{border-color:#5b9dd9;box-shadow:inset 0 2px 5px -3px rgba(0,0,0,.5),0 0 3px rgba(0,115,170,.8);color:#23282d}.background-position-control .background-position-center-icon,.background-position-control .background-position-center-icon:before{display:inline-block;line-height:1;text-align:center;transition:background-color .1s ease-in}.background-position-control .background-position-center-icon{height:20px;margin-top:13px;vertical-align:top;width:20px}.background-position-control .background-position-center-icon:before{background-color:#555;border-radius:50%;content:"";height:12px;width:12px}.background-position-control .button:hover .background-position-center-icon:before,.background-position-control input[type=radio]:focus~.button .background-position-center-icon:before{background-color:#23282d}.background-position-control .button-group{display:block}.background-position-control .button-group .button{border-radius:0;box-shadow:none;height:40px!important;line-height:2.9!important;margin:0 0 0 -1px!important;padding:0 10px 1px!important;position:relative}.background-position-control .button-group .button:active,.background-position-control .button-group .button:focus,.background-position-control .button-group .button:hover{z-index:1}.background-position-control .button-group:last-child .button{box-shadow:0 1px 0 #ccc}.background-position-control .button-group>label{margin:0!important}.background-position-control .button-group:first-child>label:first-child .button{border-radius:0 3px 0 0}.background-position-control .button-group:first-child>label:first-child .dashicons{transform:rotate(-45deg)}.background-position-control .button-group:first-child>label:last-child .button{border-radius:3px 0 0 0}.background-position-control .button-group:first-child>label:last-child .dashicons{transform:rotate(45deg)}.background-position-control .button-group:last-child>label:first-child .button{border-radius:0 0 3px 0}.background-position-control .button-group:last-child>label:first-child .dashicons{transform:rotate(45deg)}.background-position-control .button-group:last-child>label:last-child .button{border-radius:0 0 0 3px}.background-position-control .button-group:last-child>label:last-child .dashicons{transform:rotate(-45deg)}.background-position-control .button-group .dashicons{margin-top:9px}.background-position-control .button-group+.button-group{margin-top:-1px}body.full-overlay-active{overflow:hidden;visibility:hidden}.wp-full-overlay{background:0 0;z-index:500000;position:fixed;overflow:visible;top:0;bottom:0;right:0;left:0;height:100%;min-width:0}.wp-full-overlay-sidebar{box-sizing:border-box;position:fixed;min-width:300px;max-width:600px;width:18%;height:100%;top:0;bottom:0;right:0;padding:0;margin:0;z-index:10;background:#eee;border-left:none}.wp-full-overlay.collapsed .wp-full-overlay-sidebar{overflow:visible}.wp-full-overlay.collapsed,.wp-full-overlay.expanded .wp-full-overlay-sidebar{margin-right:0!important}.wp-full-overlay.expanded{margin-right:300px}.wp-full-overlay.collapsed .wp-full-overlay-sidebar{margin-right:-300px}@media screen and (min-width:1667px){.wp-full-overlay.expanded{margin-right:18%}.wp-full-overlay.collapsed .wp-full-overlay-sidebar{margin-right:-18%}}@media screen and (min-width:3333px){.wp-full-overlay.expanded{margin-right:600px}.wp-full-overlay.collapsed .wp-full-overlay-sidebar{margin-right:-600px}}.wp-full-overlay-sidebar:after{content:"";display:block;position:absolute;top:0;bottom:0;left:0;width:3px;z-index:1000}.wp-full-overlay-main{position:absolute;right:0;left:0;top:0;bottom:0;height:100%}.wp-full-overlay-sidebar .wp-full-overlay-header{position:absolute;right:0;left:0;height:45px;padding:0 15px;line-height:3.2;z-index:10;margin:0;border-top:none;box-shadow:none}.wp-full-overlay-sidebar .wp-full-overlay-header a.back{margin-top:9px}.wp-full-overlay-sidebar .wp-full-overlay-footer{bottom:0;border-bottom:none;border-top:none;box-shadow:none}.wp-full-overlay-sidebar .wp-full-overlay-sidebar-content{position:absolute;top:45px;bottom:45px;right:0;left:0;overflow:auto}.theme-install-overlay .wp-full-overlay-sidebar .wp-full-overlay-header{padding:0}.theme-install-overlay .close-full-overlay,.theme-install-overlay .next-theme,.theme-install-overlay .previous-theme{display:block;position:relative;float:right;width:45px;height:45px;padding-left:2px;background:#eee;border-left:1px solid #ddd;color:#444;cursor:pointer;text-decoration:none;transition:color .1s ease-in-out,background .1s ease-in-out}.theme-install-overlay .close-full-overlay:focus,.theme-install-overlay .close-full-overlay:hover,.theme-install-overlay .next-theme:focus,.theme-install-overlay .next-theme:hover,.theme-install-overlay .previous-theme:focus,.theme-install-overlay .previous-theme:hover{background:#ddd;border-color:#ccc;color:#000;outline:0;box-shadow:none}.theme-install-overlay .close-full-overlay:before{font:normal 22px/1 dashicons;content:"\f335";position:relative;top:7px;right:13px}.theme-install-overlay .previous-theme:before{font:normal 20px/1 dashicons;content:"\f345";position:relative;top:6px;right:14px}.theme-install-overlay .next-theme:before{font:normal 20px/1 dashicons;content:"\f341";position:relative;top:6px;right:13px}.theme-install-overlay .next-theme.disabled,.theme-install-overlay .next-theme.disabled:focus,.theme-install-overlay .next-theme.disabled:hover,.theme-install-overlay .previous-theme.disabled,.theme-install-overlay .previous-theme.disabled:focus,.theme-install-overlay .previous-theme.disabled:hover{color:#b4b9be;background:#eee;cursor:default;pointer-events:none}.theme-install-overlay .close-full-overlay,.theme-install-overlay .next-theme,.theme-install-overlay .previous-theme{border-right:0;border-top:0;border-bottom:0}.theme-install-overlay .close-full-overlay:before,.theme-install-overlay .next-theme:before,.theme-install-overlay .previous-theme:before{top:2px;right:0}.wp-core-ui .wp-full-overlay .collapse-sidebar{position:fixed;bottom:0;right:0;padding:9px 10px 9px 0;height:45px;color:#656a6f;outline:0;line-height:1;background-color:transparent!important;border:none!important;box-shadow:none!important;border-radius:0!important}.wp-core-ui .wp-full-overlay .collapse-sidebar:focus,.wp-core-ui .wp-full-overlay .collapse-sidebar:hover{color:#0073aa}.wp-full-overlay .collapse-sidebar-arrow,.wp-full-overlay .collapse-sidebar-label{display:inline-block;vertical-align:middle;line-height:1.6}.wp-full-overlay .collapse-sidebar-arrow{width:20px;height:20px;margin:0 2px;border-radius:50%;overflow:hidden}.wp-full-overlay .collapse-sidebar:focus .collapse-sidebar-arrow,.wp-full-overlay .collapse-sidebar:hover .collapse-sidebar-arrow{box-shadow:0 0 0 1px #5b9dd9,0 0 2px 1px rgba(30,140,190,.8)}.wp-full-overlay .collapse-sidebar-label{margin-right:3px}.wp-full-overlay.collapsed .collapse-sidebar-label{display:none}.wp-full-overlay .collapse-sidebar-arrow:before{display:block;content:"\f148";background:#eee;font:normal 20px/1 dashicons;speak:none;padding:0;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.wp-core-ui .wp-full-overlay.collapsed .collapse-sidebar{padding:9px 10px}.rtl .wp-full-overlay .collapse-sidebar-arrow:before,.wp-full-overlay.collapsed .collapse-sidebar-arrow:before{transform:rotate(180.001deg)}.rtl .wp-full-overlay.collapsed .collapse-sidebar-arrow:before{transform:none}.wp-full-overlay,.wp-full-overlay .collapse-sidebar,.wp-full-overlay-main,.wp-full-overlay-sidebar{transition-property:right,left,top,bottom,width,margin;transition-duration:.2s}.wp-full-overlay{background:#191e23}.wp-full-overlay-main{background-color:#f1f1f1}.expanded .wp-full-overlay-footer{position:fixed;bottom:0;right:0;min-width:299px;max-width:599px;width:18%;width:calc(18% - 1px);height:45px;border-top:1px solid #ddd;background:#eee}.wp-full-overlay-footer .devices-wrapper{float:left}.wp-full-overlay-footer .devices{position:relative;background:#eee;box-shadow:20px 0 10px -5px #eee}.wp-full-overlay-footer .devices button{cursor:pointer;background:0 0;border:none;height:45px;padding:0 3px;margin:0 -4px 0 0;box-shadow:none;border-top:1px solid transparent;border-bottom:4px solid transparent;transition:.15s color ease-in-out,.15s background-color ease-in-out,.15s border-color ease-in-out}.wp-full-overlay-footer .devices button:focus{box-shadow:none;outline:0}.wp-full-overlay-footer .devices button:before{display:inline-block;-webkit-font-smoothing:antialiased;font:normal 20px/30px dashicons;vertical-align:top;margin:3px 0;padding:4px 8px;color:#656a6f}.wp-full-overlay-footer .devices button.active{border-bottom-color:#191e23}.wp-full-overlay-footer .devices button:focus,.wp-full-overlay-footer .devices button:hover{background-color:#fff}.wp-full-overlay-footer .devices button.active:hover,.wp-full-overlay-footer .devices button:focus{border-bottom-color:#0073aa}.wp-full-overlay-footer .devices button.active:before{color:#191e23}.wp-full-overlay-footer .devices button:focus:before,.wp-full-overlay-footer .devices button:hover:before{color:#0073aa}.wp-full-overlay-footer .devices .preview-desktop:before{content:"\f472"}.wp-full-overlay-footer .devices .preview-tablet:before{content:"\f471"}.wp-full-overlay-footer .devices .preview-mobile:before{content:"\f470"}@media screen and (max-width:1024px){.wp-full-overlay-footer .devices{display:none}}.collapsed .wp-full-overlay-footer .devices button:before{display:none}.preview-mobile .wp-full-overlay-main{margin:auto -160px auto 0;width:320px;height:480px;max-height:100%;max-width:100%;right:50%}.preview-tablet .wp-full-overlay-main{margin:auto -360px auto 0;width:720px;height:1080px;max-height:100%;max-width:100%;right:50%}.customize-support .hide-if-customize,.customize-support .wp-core-ui .hide-if-customize,.customize-support.wp-core-ui .hide-if-customize,.no-customize-support .hide-if-no-customize,.no-customize-support .wp-core-ui .hide-if-no-customize,.no-customize-support.wp-core-ui .hide-if-no-customize{display:none}#customize-container,#customize-controls .notice.notification-overlay{background:#eee;z-index:500000;position:fixed;overflow:visible;top:0;bottom:0;right:0;left:0;height:100%}#customize-container{display:none}#customize-container,.theme-install-overlay{visibility:visible}.customize-loading #customize-container iframe{opacity:0}#customize-container iframe,.theme-install-overlay iframe{height:100%;width:100%;z-index:20;transition:opacity .3s}#customize-controls{margin-top:0}.theme-install-overlay{display:none}.theme-install-overlay.single-theme{display:block}.install-theme-info{display:none;padding:10px 20px 60px}.single-theme .install-theme-info{padding-top:15px}.theme-install-overlay .install-theme-info{display:block}.install-theme-info .theme-install{float:left;margin-top:18px}.install-theme-info .theme-name{font-size:16px;line-height:1.5;margin-bottom:0;margin-top:0}.install-theme-info .theme-screenshot{margin:15px 0;width:258px;border:1px solid #ccc}.install-theme-info .theme-details{overflow:hidden}.theme-details .theme-version{margin:15px 0}.theme-details .theme-description{float:right;color:#72777c;line-height:1.6;max-width:100%}.theme-install-overlay .wp-full-overlay-header .button{float:left;margin:8px 0 0 10px;line-height:2}.theme-install-overlay .wp-full-overlay-sidebar{background:#eee;border-left:1px solid #ddd}.theme-install-overlay .wp-full-overlay-sidebar-content{background:#fff;border-top:1px solid #ddd;border-bottom:1px solid #ddd}.theme-install-overlay .wp-full-overlay-main{position:absolute;z-index:0;background-color:#f1f1f1}.customize-loading #customize-container{background-color:#f1f1f1}#customize-controls .notice.notification-overlay.notification-loading:before,#customize-preview.wp-full-overlay-main:before,.customize-loading #customize-container:before,.theme-install-overlay .wp-full-overlay-main:before{content:"";display:block;width:20px;height:20px;position:absolute;right:50%;top:50%;z-index:-1;margin:-10px -10px 0 0;transform:translateZ(0);background:transparent url(../images/spinner.gif) no-repeat center center;background-size:20px 20px}#customize-preview.wp-full-overlay-main.iframe-ready:before,.theme-install-overlay.iframe-ready .wp-full-overlay-main:before{background-image:none}@media print,(-webkit-min-device-pixel-ratio:1.25),(min-resolution:120dpi){.wp-full-overlay .collapse-sidebar-arrow{background-image:url(../images/arrows-2x.png);background-size:15px 123px}#customize-controls .notice.notification-overlay.notification-loading:before,#customize-preview.wp-full-overlay-main:before,.customize-loading #customize-container:before,.theme-install-overlay .wp-full-overlay-main:before{background-image:url(../images/spinner-2x.gif)}}@media screen and (max-width:782px){.available-theme .action-links .delete-theme{float:none;margin:0;padding:0;clear:both}.available-theme .action-links .delete-theme a{padding:0}.broken-themes table{width:100%}.theme-install-overlay .wp-full-overlay-header .theme-install{margin-top:6px;line-height:normal}.theme-browser .theme .theme-actions .button{margin-bottom:0}.theme-browser .theme .theme-actions,.theme-browser .theme.active .theme-actions{padding-top:8px;padding-bottom:8px}}@media aural{.theme .notice:before,.theme-info .updated-message:before,.theme-info .updating-message:before,.theme-install.updating-message:before{speak:none}} \ No newline at end of file
diff --git a/www/crm/wp-admin/css/themes.css b/www/crm/wp-admin/css/themes.css
new file mode 100644
index 00000000..4fd28c2f
--- /dev/null
+++ b/www/crm/wp-admin/css/themes.css
@@ -0,0 +1,1922 @@
+/*------------------------------------------------------------------------------
+ 16.0 - Themes
+------------------------------------------------------------------------------*/
+
+
+/*------------------------------------------------------------------------------
+ 16.1 - Manage Themes
+------------------------------------------------------------------------------*/
+
+body.js .theme-browser.search-loading {
+ display: none;
+}
+
+.theme-browser .themes {
+ clear: both;
+}
+
+.themes-php:not(.network-admin) .wrap h1 {
+ margin-bottom: 15px;
+}
+
+.themes-php .wrap h1 .button {
+ margin-left: 20px;
+}
+
+/* Search form */
+.themes-php .search-form {
+ display: inline;
+}
+
+.themes-php .wp-filter-search {
+ position: relative;
+ top: -2px;
+ left: 20px;
+ margin: 0;
+ width: 280px;
+ font-size: 16px;
+ font-weight: 300;
+ line-height: 1.5;
+}
+
+/* Position admin messages */
+.theme .notice,
+.theme .notice.is-dismissible {
+ left: 0;
+ margin: 0;
+ position: absolute;
+ right: 0;
+ top: 0;
+}
+
+/**
+ * Main theme element
+ * (has flexible margins)
+ */
+.theme-browser .theme {
+ cursor: pointer;
+ float: left;
+ margin: 0 4% 4% 0;
+ position: relative;
+ width: 30.6%;
+ border: 1px solid #ddd;
+ box-shadow: 0 1px 1px -1px rgba(0, 0, 0, 0.1);
+ box-sizing: border-box;
+}
+
+.ie8 .theme-browser .theme {
+ width: 30%;
+ margin: 0 3% 4% 0;
+}
+
+.theme-browser .theme:nth-child(3n) {
+ margin-right: 0;
+}
+
+.theme-browser .theme:hover,
+.theme-browser .theme:focus {
+ cursor: pointer;
+}
+
+.theme-browser .theme .theme-name {
+ font-size: 15px;
+ font-weight: 600;
+ height: 18px;
+ margin: 0;
+ padding: 15px;
+ box-shadow: inset 0 1px 0 rgba(0, 0, 0, 0.1);
+ overflow: hidden;
+ white-space: nowrap;
+ text-overflow: ellipsis;
+ background: #fff;
+ background: rgba(255, 255, 255, 0.65);
+}
+
+/* Activate and Customize buttons, shown on hover and focus */
+.theme-browser .theme .theme-actions {
+ -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";
+ opacity: 0;
+ transition: opacity 0.1s ease-in-out;
+ height: auto;
+ background: rgba(244, 244, 244, 0.7);
+ border-left: 1px solid rgba(0, 0, 0, 0.05);
+}
+
+.theme-browser .theme:hover .theme-actions,
+.theme-browser .theme.focus .theme-actions,
+.theme-browser .theme:focus .theme-actions {
+ -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=100)";
+ opacity: 1;
+}
+
+.theme-browser .theme .theme-actions .button-primary {
+ margin-right: 3px;
+}
+
+.theme-browser .theme .theme-actions .button {
+ float: none;
+ margin-left: 3px;
+}
+
+/**
+ * Theme Screenshot
+ *
+ * Has a fixed aspect ratio of 1.5 to 1 regardless of screenshot size
+ * It is also responsive.
+ */
+.theme-browser .theme .theme-screenshot {
+ display: block;
+ overflow: hidden;
+ position: relative;
+ -webkit-backface-visibility: hidden; /* Prevents flicker of the screenshot on hover. */
+ transition: opacity 0.2s ease-in-out;
+}
+
+.theme-browser .theme .theme-screenshot:after {
+ content: "";
+ display: block;
+ padding-top: 66.66666%; /* using a 3/2 aspect ratio */
+}
+
+.theme-browser .theme .theme-screenshot img {
+ height: auto;
+ position: absolute;
+ left: 0;
+ top: 0;
+ width: 100%;
+ transition: opacity 0.2s ease-in-out;
+}
+
+.theme-browser .theme:hover .theme-screenshot,
+.theme-browser .theme:focus .theme-screenshot {
+ background: #fff;
+}
+
+.theme-browser.rendered .theme:hover .theme-screenshot img,
+.theme-browser.rendered .theme:focus .theme-screenshot img {
+ opacity: 0.4;
+}
+
+.theme-browser .theme .more-details {
+ -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";
+ opacity: 0;
+ position: absolute;
+ top: 35%;
+ right: 20%;
+ left: 20%;
+ background: #23282d;
+ background: rgba(0, 0, 0, 0.7);
+ color: #fff;
+ font-size: 15px;
+ text-shadow: 0 1px 0 rgba(0, 0, 0, 0.6);
+ -webkit-font-smoothing: antialiased;
+ font-weight: 600;
+ padding: 15px 12px;
+ text-align: center;
+ border-radius: 3px;
+ transition: opacity 0.1s ease-in-out;
+}
+
+.theme-browser .theme:focus {
+ border-color: #5b9dd9;
+ box-shadow: 0 0 2px rgba(30, 140, 190, 0.8);
+}
+
+.theme-browser .theme:focus .more-details {
+ opacity: 1;
+}
+
+/* Current theme needs to have its action always on view */
+.theme-browser .theme.active:focus .theme-actions {
+ display: block;
+}
+
+.theme-browser.rendered .theme:hover .more-details,
+.theme-browser.rendered .theme:focus .more-details {
+ -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=100)";
+ opacity: 1;
+}
+
+/**
+ * The currently active theme
+ */
+.theme-browser .theme.active .theme-name {
+ background: #23282d;
+ color: #fff;
+ padding-right: 110px;
+ font-weight: 300;
+ box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.5);
+}
+
+.theme-browser .customize-control .theme.active .theme-name {
+ padding-right: 15px;
+}
+
+.theme-browser .theme.active .theme-name span {
+ font-weight: 600;
+}
+
+.theme-browser .theme.active .theme-actions {
+ background: rgba(49, 49, 49, 0.7);
+ border-left: none;
+ opacity: 1;
+}
+
+.theme-id-container {
+ position: relative;
+}
+
+.theme-browser .theme.active .theme-actions,
+.theme-browser .theme .theme-actions {
+ position: absolute;
+ top: 50%;
+ transform: translateY(-50%);
+ right: 0;
+ padding: 10px 15px;
+ box-shadow: inset 0 1px 0 rgba(0, 0, 0, 0.1);
+}
+
+.theme-browser .theme.active .theme-actions .button-primary {
+ margin-right: 0;
+}
+
+.theme-browser .theme .theme-author {
+ background: #23282d;
+ color: #eee;
+ display: none;
+ font-size: 14px;
+ margin: 0 10px;
+ padding: 5px 10px;
+ position: absolute;
+ bottom: 56px;
+}
+
+.theme-browser .theme.display-author .theme-author {
+ display: block;
+}
+
+.theme-browser .theme.display-author .theme-author a {
+ color: inherit;
+ text-decoration: none;
+}
+
+/**
+ * Add new theme
+ */
+.theme-browser .theme.add-new-theme {
+ border: none;
+ box-shadow: none;
+}
+
+.theme-browser .theme.add-new-theme a {
+ text-decoration: none;
+ display: block;
+ position: relative;
+ z-index: 1;
+}
+
+.theme-browser .theme.add-new-theme a:after {
+ display: block;
+ content: "";
+ background: transparent;
+ background: rgba(0, 0, 0, 0);
+ position: absolute;
+ top: 0;
+ left: 0;
+ right: 0;
+ bottom: 0;
+ padding: 0;
+ text-shadow: none;
+ border: 5px dashed #d5d2ca;
+ border: 5px dashed rgba(0, 0, 0, 0.1);
+ box-sizing: border-box;
+}
+
+.theme-browser .theme.add-new-theme span:after {
+ background: #e5e5e5;
+ background: rgba(153, 153, 153, 0.1);
+ border-radius: 50%;
+ display: inline-block;
+ content: "\f132";
+ -webkit-font-smoothing: antialiased;
+ font: normal 74px/115px dashicons;
+ width: 100px;
+ height: 100px;
+ vertical-align: middle;
+ text-align: center;
+ color: rgb(153, 153, 153);
+ position: absolute;
+ top: 30%;
+ left: 50%;
+ margin-left: -50px;
+ text-indent: -4px;
+ padding: 0;
+ text-shadow: none;
+ z-index: 4;
+}
+
+.rtl .theme-browser .theme.add-new-theme span:after {
+ text-indent: 4px;
+}
+
+.theme-browser .theme.add-new-theme a:hover .theme-screenshot,
+.theme-browser .theme.add-new-theme a:focus .theme-screenshot {
+ background: none;
+}
+
+.theme-browser .theme.add-new-theme a:hover span:after,
+.theme-browser .theme.add-new-theme a:focus span:after {
+ background: #fff;
+ color: #0073aa;
+}
+
+.theme-browser .theme.add-new-theme a:hover:after,
+.theme-browser .theme.add-new-theme a:focus:after {
+ border-color: transparent;
+ color: #fff;
+ background: #0073aa;
+ content: "";
+}
+
+.theme-browser .theme.add-new-theme .theme-name {
+ background: none;
+ text-align: center;
+ box-shadow: none;
+ font-weight: 400;
+ position: relative;
+ top: 0;
+ margin-top: -18px;
+ padding-top: 0;
+ padding-bottom: 48px;
+}
+
+.theme-browser .theme.add-new-theme a:hover .theme-name,
+.theme-browser .theme.add-new-theme a:focus .theme-name {
+ color: #fff;
+ z-index: 2;
+}
+
+/**
+ * Theme Overlay
+ * Shown when clicking a theme
+ */
+.theme-overlay .theme-backdrop {
+ position: absolute;
+ left: -20px;
+ right: 0;
+ top: 0;
+ bottom: 0;
+ background: #f1f1f1;
+ background: rgba(238, 238, 238, 0.9);
+ z-index: 10000; /* Over WP Pointers. */
+}
+
+.theme-overlay .theme-header {
+ position: absolute;
+ top: 0;
+ left: 0;
+ right: 0;
+ height: 48px;
+ border-bottom: 1px solid #ddd;
+}
+
+.theme-overlay .theme-header button {
+ padding: 0;
+}
+
+.theme-overlay .theme-header .close {
+ cursor: pointer;
+ height: 48px;
+ width: 50px;
+ text-align: center;
+ float: right;
+ border: 0;
+ border-left: 1px solid #ddd;
+ background-color: transparent;
+ transition: color .1s ease-in-out, background .1s ease-in-out;
+}
+
+.theme-overlay .theme-header .close:before {
+ font: normal 22px/50px dashicons !important;
+ color: #72777c;
+ display: inline-block;
+ content: "\f335";
+ font-weight: 300;
+}
+
+/* Left and right navigation */
+.theme-overlay .theme-header .right,
+.theme-overlay .theme-header .left {
+ cursor: pointer;
+ color: #72777c;
+ background-color: transparent;
+ height: 48px;
+ width: 54px;
+ float: left;
+ text-align: center;
+ border: 0;
+ border-right: 1px solid #ddd;
+ transition: color .1s ease-in-out, background .1s ease-in-out;
+}
+
+.theme-overlay .theme-header .close:focus,
+.theme-overlay .theme-header .close:hover,
+.theme-overlay .theme-header .right:focus,
+.theme-overlay .theme-header .right:hover,
+.theme-overlay .theme-header .left:focus,
+.theme-overlay .theme-header .left:hover {
+ background: #ddd;
+ border-color: #ccc;
+ color: #000;
+}
+
+.theme-overlay .theme-header .close:focus:before,
+.theme-overlay .theme-header .close:hover:before {
+ color: #000;
+}
+
+.theme-overlay .theme-header .close:focus,
+.theme-overlay .theme-header .right:focus,
+.theme-overlay .theme-header .left:focus {
+ box-shadow: none;
+ outline: none;
+}
+
+.theme-overlay .theme-header .left.disabled,
+.theme-overlay .theme-header .right.disabled,
+.theme-overlay .theme-header .left.disabled:hover,
+.theme-overlay .theme-header .right.disabled:hover {
+ color: #ccc;
+ background: inherit;
+ cursor: inherit;
+}
+
+.theme-overlay .theme-header .right:before,
+.theme-overlay .theme-header .left:before {
+ font: normal 20px/50px dashicons !important;
+ display: inline;
+ font-weight: 300;
+}
+
+.theme-overlay .theme-header .left:before {
+ content: "\f341";
+}
+
+.theme-overlay .theme-header .right:before {
+ content: "\f345";
+}
+
+.theme-overlay .theme-wrap {
+ clear: both;
+ position: fixed;
+ top: 9%;
+ left: 190px;
+ right: 30px;
+ bottom: 3%;
+ background: #fff;
+ box-shadow: 0 1px 20px 5px rgba(0, 0, 0, 0.1);
+ z-index: 10000; /* Over WP Pointers. */
+ box-sizing: border-box;
+ -webkit-overflow-scrolling: touch;
+}
+
+body.folded .theme-browser ~ .theme-overlay .theme-wrap {
+ left: 70px;
+}
+
+.theme-overlay .theme-about {
+ position: absolute;
+ top: 49px;
+ bottom: 57px;
+ left: 0;
+ right: 0;
+ overflow: auto;
+ padding: 2% 4%;
+}
+
+.theme-overlay .theme-actions {
+ position: absolute;
+ text-align: center;
+ bottom: 0;
+ left: 0;
+ right: 0;
+ padding: 10px 25px 5px;
+ background: #f3f3f3;
+ z-index: 30;
+ box-sizing: border-box;
+ border-top: 1px solid #eee;
+}
+
+.ie8 .theme-overlay .theme-actions {
+ border: 1px solid #eee;
+}
+
+.theme-overlay .theme-actions a {
+ margin-right: 5px;
+ margin-bottom: 5px;
+}
+
+/* Hide-if-customize for items we can't add classes to */
+.customize-support .theme-overlay .theme-actions a[href="themes.php?page=custom-header"],
+.customize-support .theme-overlay .theme-actions a[href="themes.php?page=custom-background"] {
+ display: none;
+}
+
+.broken-themes a.delete-theme,
+.theme-overlay .theme-actions .delete-theme {
+ color: #a00;
+ text-decoration: none;
+ border-color: transparent;
+ box-shadow: none;
+ background: transparent;
+}
+
+.theme-overlay .theme-actions .delete-theme {
+ position: absolute;
+ right: 10px;
+ bottom: 5px;
+}
+
+.broken-themes a.delete-theme:hover,
+.broken-themes a.delete-theme:focus,
+.theme-overlay .theme-actions .delete-theme:hover,
+.theme-overlay .theme-actions .delete-theme:focus {
+ background: #d54e21;
+ color: #fff;
+ border-color: #d54e21;
+}
+
+.theme-overlay .theme-actions .active-theme,
+.theme-overlay.active .theme-actions .inactive-theme {
+ display: none;
+}
+
+.theme-overlay .theme-actions .inactive-theme,
+.theme-overlay.active .theme-actions .active-theme {
+ display: block;
+}
+
+/**
+ * Theme Screenshots gallery
+ */
+.theme-overlay .theme-screenshots {
+ float: left;
+ margin: 0 30px 0 0;
+ width: 55%;
+ max-width: 1200px; /* Recommended theme screenshot width, set here to avoid stretching */
+ text-align: center;
+}
+
+/* First screenshot, shown big */
+.theme-overlay .screenshot {
+ border: 1px solid #fff;
+ box-sizing: border-box;
+ overflow: hidden;
+ position: relative;
+ box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.2);
+}
+
+.theme-overlay .screenshot:after {
+ content: "";
+ display: block;
+ padding-top: 75%; /* using a 4/3 aspect ratio */
+}
+
+.theme-overlay .screenshot img {
+ height: auto;
+ position: absolute;
+ left: 0;
+ top: 0;
+ width: 100%;
+}
+/* Handles old 300px screenshots */
+.theme-overlay.small-screenshot .theme-screenshots {
+ position: absolute;
+ width: 302px;
+}
+.theme-overlay.small-screenshot .theme-info {
+ margin-left: 350px;
+ width: auto;
+}
+
+/* Other screenshots, shown small and square */
+.theme-overlay .screenshot.thumb {
+ background: #ccc;
+ border: 1px solid #eee;
+ float: none;
+ display: inline-block;
+ margin: 10px 5px 0;
+ width: 140px;
+ height: 80px;
+ cursor: pointer;
+}
+
+.theme-overlay .screenshot.thumb:after {
+ content: "";
+ display: block;
+ padding-top: 100%; /* using a 1/1 aspect ratio */
+}
+
+.theme-overlay .screenshot.thumb img {
+ cursor: pointer;
+ height: auto;
+ position: absolute;
+ left: 0;
+ top: 0;
+ width: 100%;
+ height: auto;
+}
+
+.theme-overlay .screenshot.selected {
+ background: transparent;
+ border: 2px solid #00a0d2;
+}
+
+.theme-overlay .screenshot.selected img {
+ opacity: 0.8;
+}
+
+/* No screenshot placeholder */
+.theme-browser .theme .theme-screenshot.blank,
+.theme-overlay .screenshot.blank {
+ background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAYAAADED76LAAAALElEQVQYGWO8d+/efwYkoKioiMRjYGBC4WHhUK6A8T8QIJt8//59ZC493AAAQssKpBK4F5AAAAAASUVORK5CYII=);
+}
+
+/**
+ * Theme heading information
+ */
+.theme-overlay .theme-info {
+ width: 40%;
+ float: left;
+}
+
+.theme-overlay .current-label {
+ background: #32373c;
+ color: #fff;
+ font-size: 11px;
+ display: inline-block;
+ padding: 2px 8px;
+ border-radius: 2px;
+ margin: 0 0 -10px;
+ -webkit-user-select: none;
+ -moz-user-select: none;
+ -ms-user-select: none;
+ user-select: none;
+}
+
+.theme-overlay .theme-name {
+ color: #23282d;
+ font-size: 32px;
+ font-weight: 100;
+ margin: 10px 0 0;
+ line-height: 1.3;
+ word-wrap: break-word;
+ overflow-wrap: break-word;
+}
+
+.theme-overlay .theme-version {
+ color: #72777c;
+ font-size: 13px;
+ font-weight: 400;
+ float: none;
+ display: inline-block;
+ margin-left: 10px;
+}
+
+.theme-overlay .theme-author {
+ margin: 15px 0 25px;
+ color: #72777c;
+ font-size: 16px;
+ font-weight: 400;
+ line-height: inherit;
+}
+
+.theme-overlay .theme-author a {
+ text-decoration: none;
+}
+
+.theme-overlay .theme-description {
+ color: #555;
+ font-size: 15px;
+ font-weight: 400;
+ line-height: 1.5;
+ margin: 30px 0 0 0;
+}
+
+.theme-overlay .theme-tags {
+ border-top: 3px solid #eee;
+ color: #82878c;
+ font-size: 13px;
+ font-weight: 400;
+ margin: 30px 0 0 0;
+ padding-top: 20px;
+}
+
+.theme-overlay .theme-tags span {
+ color: #444;
+ font-weight: 600;
+ margin-right: 5px;
+}
+
+.theme-overlay .parent-theme {
+ background: #f7fcfe;
+ border: 1px solid #eee;
+ border-left: 4px solid #00a0d2;
+ font-size: 14px;
+ font-weight: 400;
+ margin-top: 30px;
+ padding: 10px 10px 10px 20px;
+}
+
+.theme-overlay .parent-theme strong {
+ font-weight: 600;
+}
+
+/**
+ * Single Theme Mode
+ * Displays detailed view inline when a user has no switch capabilities
+ */
+.single-theme .theme-overlay .theme-backdrop,
+.single-theme .theme-overlay .theme-header,
+.single-theme .theme {
+ display: none;
+}
+
+.single-theme .theme-overlay .theme-wrap {
+ clear: both;
+ min-height: 330px;
+ position: relative;
+ left: auto;
+ right: auto;
+ top: auto;
+ bottom: auto;
+ z-index: 10;
+}
+
+.single-theme .theme-overlay .theme-about {
+ padding: 30px 30px 70px;
+ position: static;
+}
+
+.single-theme .theme-overlay .theme-actions {
+ position: absolute;
+}
+
+/**
+ * Basic Responsive structure...
+ *
+ * Shuffles theme columns around based on screen width
+ */
+
+@media only screen and (min-width: 2000px) {
+ #wpwrap .theme-browser .theme {
+ width: 17.6%;
+ margin: 0 3% 3% 0;
+ }
+
+ #wpwrap .theme-browser .theme:nth-child(3n),
+ #wpwrap .theme-browser .theme:nth-child(4n) {
+ margin-right: 3%;
+ }
+
+ #wpwrap .theme-browser .theme:nth-child(5n) {
+ margin-right: 0;
+ }
+}
+
+@media only screen and (min-width: 1680px) {
+ .theme-overlay .theme-wrap {
+ width: 1450px;
+ margin: 0 auto;
+ }
+}
+
+/* Maximum screenshot width reaches 440px */
+@media only screen and (min-width: 1640px) {
+ .theme-browser .theme {
+ width: 22.7%;
+ margin: 0 3% 3% 0;
+ }
+ .theme-browser .theme .theme-screenshot:after {
+ padding-top: 75%; /* using a 4/3 aspect ratio */
+ }
+
+ .theme-browser .theme:nth-child(3n) {
+ margin-right: 3%;
+ }
+
+ .theme-browser .theme:nth-child(4n) {
+ margin-right: 0;
+ }
+}
+/* Maximum screenshot width reaches 440px */
+@media only screen and (max-width: 1120px) {
+ .theme-browser .theme {
+ width: 47.5%;
+ margin-right: 0;
+ }
+
+ .theme-browser .theme:nth-child(even) {
+ margin-right: 0;
+ }
+
+ .theme-browser .theme:nth-child(odd) {
+ margin-right: 5%;
+ }
+}
+
+/* Admin menu is folded */
+@media only screen and (max-width: 900px) {
+ .theme-overlay .theme-wrap {
+ left: 65px;
+ }
+}
+
+@media only screen and (max-width: 780px) {
+ body.folded .theme-overlay .theme-wrap,
+ .theme-overlay .theme-wrap {
+ top: 0; /* The adminmenu isn't fixed on mobile, so this can use the full viewport height */
+ right: 0;
+ bottom: 0;
+ left: 0;
+ padding: 70px 20px 20px;
+ border: none;
+ z-index: 100000; /* should overlap #wpadminbar. */
+ position: fixed;
+ }
+
+ .theme-browser .theme.active .theme-name span {
+ /* Hide the "Active: " label on smaller screens. */
+ display: none;
+ }
+
+ .theme-overlay .theme-screenshots {
+ width: 40%;
+ }
+
+ .theme-overlay .theme-info {
+ width: 50%;
+ }
+ .single-theme .theme-wrap {
+ padding: 10px;
+ }
+
+ .theme-browser .theme .theme-actions {
+ padding: 5px 10px 4px 10px;
+ }
+
+ .theme-overlay.small-screenshot .theme-screenshots {
+ position: static;
+ float: none;
+ max-width: 302px;
+ }
+
+ .theme-overlay.small-screenshot .theme-info {
+ margin-left: 0;
+ width: auto;
+ }
+
+ .theme:not(.active):hover .theme-actions,
+ .theme:not(.active):focus .theme-actions,
+ .theme:hover .more-details,
+ .theme:focus .more-details {
+ display: none;
+ }
+
+ .theme-browser.rendered .theme:hover .theme-screenshot img,
+ .theme-browser.rendered .theme:focus .theme-screenshot img {
+ opacity: 1.0;
+ }
+}
+
+@media only screen and (max-width: 480px) {
+ .theme-browser .theme {
+ width: 100%;
+ margin-right: 0;
+ }
+
+ .theme-browser .theme:nth-child(2n),
+ .theme-browser .theme:nth-child(3n) {
+ margin-right: 0;
+ }
+}
+
+@media only screen and (max-width: 650px) {
+ .theme-overlay .theme-description {
+ margin-left: 0;
+ }
+
+ .theme-overlay .theme-actions .delete-theme {
+ position: relative;
+ right: auto;
+ bottom: auto;
+ }
+
+ .theme-overlay .theme-actions .inactive-theme {
+ display: inline;
+ }
+
+ .theme-overlay .theme-screenshots {
+ width: 100%;
+ float: none;
+ }
+
+ .theme-overlay .theme-info {
+ width: 100%;
+ }
+
+ .theme-overlay .theme-author {
+ margin: 5px 0 15px 0;
+ }
+
+ .theme-overlay .current-label {
+ margin-top: 10px;
+ font-size: 13px;
+ }
+
+ .themes-php .wp-filter-search {
+ float: none;
+ clear: both;
+ left: 0;
+ right: 0;
+ margin: -5px 0 20px 0;
+ width: 100%;
+ max-width: 280px;
+ }
+
+ .theme-browser .theme.add-new-theme span:after {
+ font: normal 60px/90px dashicons;
+ width: 80px;
+ height: 80px;
+ top: 30%;
+ left: 50%;
+ text-indent: 0;
+ margin-left: -40px;
+ }
+
+ .single-theme .theme-wrap {
+ margin: 0 -12px 0 -10px;
+ padding: 10px;
+ }
+ .single-theme .theme-overlay .theme-about {
+ padding: 10px;
+ overflow: visible;
+ }
+ .single-theme .current-label {
+ display: none;
+ }
+ .single-theme .theme-overlay .theme-actions {
+ position: static;
+ }
+}
+
+.broken-themes {
+ clear: both;
+}
+
+.broken-themes table {
+ text-align: left;
+ width: 50%;
+ border-spacing: 3px;
+ padding: 3px;
+}
+
+
+/*------------------------------------------------------------------------------
+ 16.2 - Install Themes
+------------------------------------------------------------------------------*/
+
+/* Already installed theme */
+.theme-browser .theme .theme-installed {
+ background: #0073aa;
+}
+.theme-browser .theme .notice-success p:before {
+ color: #79ba49;
+ content: "\f147";
+ display: inline-block;
+ font: normal 20px/1 'dashicons';
+ -webkit-font-smoothing: antialiased;
+ -moz-osx-font-smoothing: grayscale;
+ vertical-align: top;
+}
+
+.theme-install.updated-message:before {
+ content: "";
+}
+
+.theme-install-php .wp-filter {
+ padding-left: 20px;
+}
+
+.theme-install-php a.upload,
+.theme-install-php a.browse-themes {
+ cursor: pointer;
+}
+
+.upload-view-toggle .browse,
+.plugin-install-tab-upload .upload-view-toggle .upload {
+ display: none;
+}
+
+.plugin-install-tab-upload .upload-view-toggle .browse {
+ display: inline;
+}
+
+.upload-theme,
+.upload-plugin {
+ box-sizing: border-box;
+ display: none;
+ margin: 0;
+ padding: 50px 0;
+ width: 100%;
+ overflow: hidden;
+ position: relative;
+ top: 10px;
+}
+
+.upload-plugin-wrap {
+ display: none;
+}
+
+.show-upload-view .upload-theme,
+.show-upload-view .upload-plugin,
+.show-upload-view .upload-plugin-wrap,
+.plugin-install-tab-upload .upload-plugin {
+ display: block;
+}
+
+.upload-theme .wp-upload-form,
+.upload-plugin .wp-upload-form {
+ background: #fafafa;
+ border: 1px solid #e5e5e5;
+ padding: 30px;
+ margin: 30px auto;
+ max-width: 380px;
+}
+.upload-theme .install-help,
+.upload-plugin .install-help {
+ color: #555d66; /* #f1f1f1 background */
+ font-size: 18px;
+ font-style: normal;
+ margin: 0;
+ padding: 0;
+ text-align: center;
+}
+
+p.no-themes,
+p.no-themes-local {
+ clear: both;
+ color: #666;
+ font-size: 18px;
+ font-style: normal;
+ margin: 0;
+ padding: 100px 0;
+ text-align: center;
+ display: none;
+}
+
+.no-results p.no-themes {
+ display: block;
+}
+
+.theme-install-php .add-new-theme {
+ display: none !important;
+}
+
+@media only screen and (max-width: 1120px) {
+ .upload-theme .wp-upload-form {
+ margin: 20px 0;
+ max-width: 100%;
+ }
+ .upload-theme .install-help {
+ font-size: 15px;
+ padding: 20px 0 0;
+ text-align: left;
+ }
+}
+
+.theme-details .theme-rating {
+ line-height: 1.9;
+}
+
+.theme-details .star-rating {
+ display: inline;
+}
+
+.theme-details .num-ratings,
+.theme-details .no-rating {
+ font-size: 11px;
+ color: #72777c;
+}
+
+.theme-details .no-rating {
+ display: block;
+ line-height: 1.9;
+}
+
+/*------------------------------------------------------------------------------
+ 16.3 - Custom Header Screen
+------------------------------------------------------------------------------*/
+
+.appearance_page_custom-header #headimg {
+ border: 1px solid #ddd;
+ overflow: hidden;
+ width: 100%;
+}
+
+.appearance_page_custom-header #upload-form p label {
+ font-size: 12px;
+}
+
+.appearance_page_custom-header .available-headers .default-header {
+ float: left;
+ margin: 0 20px 20px 0;
+}
+
+.appearance_page_custom-header .random-header {
+ clear: both;
+ margin: 0 20px 20px 0;
+ vertical-align: middle;
+}
+
+.appearance_page_custom-header .available-headers label input,
+.appearance_page_custom-header .random-header label input {
+ margin-right: 10px;
+}
+
+.appearance_page_custom-header .available-headers label img {
+ vertical-align: middle;
+}
+
+
+/*------------------------------------------------------------------------------
+ 16.4 - Custom Background Screen
+------------------------------------------------------------------------------*/
+
+div#custom-background-image {
+ min-height: 100px;
+ border: 1px solid #ddd;
+}
+
+div#custom-background-image img {
+ max-width: 400px;
+ max-height: 300px;
+}
+
+.background-position-control input[type="radio"]:checked ~ .button {
+ background: #eee;
+ border-color: #999;
+ box-shadow: inset 0 2px 5px -3px rgba(0, 0, 0, 0.5);
+ z-index: 1;
+}
+
+.background-position-control input[type="radio"]:focus ~ .button {
+ border-color: #5b9dd9;
+ box-shadow: inset 0 2px 5px -3px rgba(0, 0, 0, 0.5), 0 0 3px rgba(0, 115, 170, 0.8);
+ color: #23282d;
+}
+
+.background-position-control .background-position-center-icon,
+.background-position-control .background-position-center-icon:before {
+ display: inline-block;
+ line-height: 1;
+ text-align: center;
+ transition: background-color .1s ease-in;
+}
+
+.background-position-control .background-position-center-icon {
+ height: 20px;
+ margin-top: 13px;
+ vertical-align: top;
+ width: 20px;
+}
+
+.background-position-control .background-position-center-icon:before {
+ background-color: #555;
+ border-radius: 50%;
+ content: "";
+ height: 12px;
+ width: 12px;
+}
+
+.background-position-control .button:hover .background-position-center-icon:before,
+.background-position-control input[type="radio"]:focus ~ .button .background-position-center-icon:before {
+ background-color: #23282d;
+}
+
+.background-position-control .button-group {
+ display: block;
+}
+
+.background-position-control .button-group .button {
+ border-radius: 0;
+ box-shadow: none;
+ /* Following properties are overridden by buttons responsive styles (see: wp-includes/css/buttons.css). */
+ height: 40px !important;
+ line-height: 2.9 !important;
+ margin: 0 -1px 0 0 !important;
+ padding: 0 10px 1px !important;
+ position: relative;
+}
+
+.background-position-control .button-group .button:active,
+.background-position-control .button-group .button:hover,
+.background-position-control .button-group .button:focus {
+ z-index: 1;
+}
+
+.background-position-control .button-group:last-child .button {
+ box-shadow: 0 1px 0 #ccc;
+}
+
+.background-position-control .button-group > label {
+ margin: 0 !important;
+}
+
+.background-position-control .button-group:first-child > label:first-child .button {
+ border-radius: 3px 0 0;
+}
+
+.background-position-control .button-group:first-child > label:first-child .dashicons {
+ transform: rotate( 45deg );
+}
+
+.background-position-control .button-group:first-child > label:last-child .button {
+ border-radius: 0 3px 0 0;
+}
+
+.background-position-control .button-group:first-child > label:last-child .dashicons {
+ transform: rotate( -45deg );
+}
+
+.background-position-control .button-group:last-child > label:first-child .button {
+ border-radius: 0 0 0 3px;
+}
+
+.background-position-control .button-group:last-child > label:first-child .dashicons {
+ transform: rotate( -45deg );
+}
+
+.background-position-control .button-group:last-child > label:last-child .button {
+ border-radius: 0 0 3px 0;
+}
+
+.background-position-control .button-group:last-child > label:last-child .dashicons {
+ transform: rotate( 45deg );
+}
+
+.background-position-control .button-group .dashicons {
+ margin-top: 9px;
+}
+
+.background-position-control .button-group + .button-group {
+ margin-top: -1px;
+}
+
+/*------------------------------------------------------------------------------
+ 23.0 - Full Overlay w/ Sidebar
+------------------------------------------------------------------------------*/
+
+body.full-overlay-active {
+ overflow: hidden;
+ /* Hide all the content, the Customizer overlay is then made visible to be the only available content. */
+ visibility: hidden;
+}
+
+.wp-full-overlay {
+ background: transparent;
+ z-index: 500000;
+ position: fixed;
+ overflow: visible;
+ top: 0;
+ bottom: 0;
+ left: 0;
+ right: 0;
+ height: 100%;
+ min-width: 0;
+}
+
+.wp-full-overlay-sidebar {
+ box-sizing: border-box;
+ position: fixed;
+ min-width: 300px;
+ max-width: 600px;
+ width: 18%;
+ height: 100%;
+ top: 0;
+ bottom: 0;
+ left: 0;
+ padding: 0;
+ margin: 0;
+ z-index: 10;
+ background: #eee;
+ border-right: none;
+}
+
+.wp-full-overlay.collapsed .wp-full-overlay-sidebar {
+ overflow: visible;
+}
+
+.wp-full-overlay.collapsed,
+.wp-full-overlay.expanded .wp-full-overlay-sidebar {
+ margin-left: 0 !important;
+}
+
+.wp-full-overlay.expanded {
+ margin-left: 300px;
+}
+
+.wp-full-overlay.collapsed .wp-full-overlay-sidebar {
+ margin-left: -300px;
+}
+
+@media screen and (min-width: 1667px) {
+ .wp-full-overlay.expanded {
+ margin-left: 18%;
+ }
+
+ .wp-full-overlay.collapsed .wp-full-overlay-sidebar {
+ margin-left: -18%;
+ }
+}
+
+@media screen and (min-width: 3333px) {
+ .wp-full-overlay.expanded {
+ margin-left: 600px;
+ }
+
+ .wp-full-overlay.collapsed .wp-full-overlay-sidebar {
+ margin-left: -600px;
+ }
+}
+
+.wp-full-overlay-sidebar:after {
+ content: "";
+ display: block;
+ position: absolute;
+ top: 0;
+ bottom: 0;
+ right: 0;
+ width: 3px;
+ z-index: 1000;
+}
+
+.wp-full-overlay-main {
+ position: absolute;
+ left: 0;
+ right: 0;
+ top: 0;
+ bottom: 0;
+ height: 100%;
+}
+
+.wp-full-overlay-sidebar .wp-full-overlay-header {
+ position: absolute;
+ left: 0;
+ right: 0;
+ height: 45px;
+ padding: 0 15px;
+ line-height: 3.2;
+ z-index: 10;
+ margin: 0;
+ border-top: none;
+ box-shadow: none;
+}
+
+.wp-full-overlay-sidebar .wp-full-overlay-header a.back {
+ margin-top: 9px;
+}
+
+.wp-full-overlay-sidebar .wp-full-overlay-footer {
+ bottom: 0;
+ border-bottom: none;
+ border-top: none;
+ box-shadow: none;
+}
+
+.wp-full-overlay-sidebar .wp-full-overlay-sidebar-content {
+ position: absolute;
+ top: 45px;
+ bottom: 45px;
+ left: 0;
+ right: 0;
+ overflow: auto;
+}
+
+/* Close & Navigation Links */
+.theme-install-overlay .wp-full-overlay-sidebar .wp-full-overlay-header {
+ padding: 0;
+}
+
+.theme-install-overlay .close-full-overlay,
+.theme-install-overlay .previous-theme,
+.theme-install-overlay .next-theme {
+ display: block;
+ position: relative;
+ float: left;
+ width: 45px;
+ height: 45px;
+ padding-right: 2px;
+ background: #eee;
+ border-right: 1px solid #ddd;
+ color: #444;
+ cursor: pointer;
+ text-decoration: none;
+ transition: color .1s ease-in-out, background .1s ease-in-out;
+}
+
+.theme-install-overlay .close-full-overlay:hover,
+.theme-install-overlay .close-full-overlay:focus,
+.theme-install-overlay .previous-theme:hover,
+.theme-install-overlay .previous-theme:focus,
+.theme-install-overlay .next-theme:hover,
+.theme-install-overlay .next-theme:focus {
+ background: #ddd;
+ border-color: #ccc;
+ color: #000;
+ outline: none;
+ box-shadow: none;
+}
+
+.theme-install-overlay .close-full-overlay:before {
+ font: normal 22px/1 dashicons;
+ content: "\f335";
+ position: relative;
+ top: 7px;
+ left: 13px;
+}
+
+.theme-install-overlay .previous-theme:before {
+ font: normal 20px/1 dashicons;
+ content: "\f341";
+ position: relative;
+ top: 6px;
+ left: 14px;
+}
+
+.theme-install-overlay .next-theme:before {
+ font: normal 20px/1 dashicons;
+ content: "\f345";
+ position: relative;
+ top: 6px;
+ left: 13px;
+}
+
+.theme-install-overlay .previous-theme.disabled,
+.theme-install-overlay .next-theme.disabled,
+.theme-install-overlay .previous-theme.disabled:hover,
+.theme-install-overlay .previous-theme.disabled:focus,
+.theme-install-overlay .next-theme.disabled:hover,
+.theme-install-overlay .next-theme.disabled:focus {
+ color: #b4b9be;
+ background: #eee;
+ cursor: default;
+ pointer-events: none;
+}
+
+.theme-install-overlay .close-full-overlay,
+.theme-install-overlay .previous-theme,
+.theme-install-overlay .next-theme {
+ border-left: 0;
+ border-top: 0;
+ border-bottom: 0;
+}
+
+.theme-install-overlay .close-full-overlay:before,
+.theme-install-overlay .previous-theme:before,
+.theme-install-overlay .next-theme:before {
+ top: 2px;
+ left: 0;
+}
+
+/* Collapse Button */
+.wp-core-ui .wp-full-overlay .collapse-sidebar {
+ position: fixed;
+ bottom: 0;
+ left: 0;
+ padding: 9px 0 9px 10px;
+ height: 45px;
+ color: #656a6f;
+ outline: 0;
+ line-height: 1;
+ background-color: transparent !important;
+ border: none !important;
+ box-shadow: none !important;
+ border-radius: 0 !important;
+}
+
+.wp-core-ui .wp-full-overlay .collapse-sidebar:hover,
+.wp-core-ui .wp-full-overlay .collapse-sidebar:focus {
+ color: #0073aa;
+}
+
+.wp-full-overlay .collapse-sidebar-arrow,
+.wp-full-overlay .collapse-sidebar-label {
+ display: inline-block;
+ vertical-align: middle;
+ line-height: 1.6;
+}
+
+.wp-full-overlay .collapse-sidebar-arrow {
+ width: 20px;
+ height: 20px;
+ margin: 0 2px; /* avoid the focus box-shadow to be cut-off */
+ border-radius: 50%;
+ overflow: hidden;
+}
+
+.wp-full-overlay .collapse-sidebar:hover .collapse-sidebar-arrow,
+.wp-full-overlay .collapse-sidebar:focus .collapse-sidebar-arrow {
+ box-shadow:
+ 0 0 0 1px #5b9dd9,
+ 0 0 2px 1px rgba(30, 140, 190, 0.8);
+}
+
+.wp-full-overlay .collapse-sidebar-label {
+ margin-left: 3px;
+}
+
+.wp-full-overlay.collapsed .collapse-sidebar-label {
+ display: none;
+}
+
+.wp-full-overlay .collapse-sidebar-arrow:before {
+ display: block;
+ content: "\f148";
+ background: #eee;
+ font: normal 20px/1 dashicons;
+ speak: none;
+ padding: 0;
+ -webkit-font-smoothing: antialiased;
+ -moz-osx-font-smoothing: grayscale;
+}
+
+.wp-core-ui .wp-full-overlay.collapsed .collapse-sidebar {
+ padding: 9px 10px;
+}
+
+/* rtl:ignore */
+.wp-full-overlay.collapsed .collapse-sidebar-arrow:before,
+.rtl .wp-full-overlay .collapse-sidebar-arrow:before {
+ transform: rotate(180.001deg); /* Firefox: promoting to its own layer to trigger anti-aliasing */
+}
+
+.rtl .wp-full-overlay.collapsed .collapse-sidebar-arrow:before {
+ transform: none;
+}
+
+/* Animations */
+.wp-full-overlay,
+.wp-full-overlay-sidebar,
+.wp-full-overlay .collapse-sidebar,
+.wp-full-overlay-main {
+ transition-property: left, right, top, bottom, width, margin;
+ transition-duration: 0.2s;
+}
+
+/* Device/preview size toggles */
+
+.wp-full-overlay {
+ background: #191e23;
+}
+
+.wp-full-overlay-main {
+ background-color: #f1f1f1;
+}
+
+.expanded .wp-full-overlay-footer {
+ position: fixed;
+ bottom: 0;
+ left: 0;
+ min-width: 299px;
+ max-width: 599px;
+ width: 18%;
+ width: calc( 18% - 1px );
+ height: 45px;
+ border-top: 1px solid #ddd;
+ background: #eee;
+}
+
+.wp-full-overlay-footer .devices-wrapper {
+ float: right;
+}
+
+.wp-full-overlay-footer .devices {
+ position: relative;
+ background: #eee;
+ box-shadow: -20px 0 10px -5px #eee;
+}
+
+.wp-full-overlay-footer .devices button {
+ cursor: pointer;
+ background: transparent;
+ border: none;
+ height: 45px;
+ padding: 0 3px;
+ margin: 0 0 0 -4px;
+ box-shadow: none;
+ border-top: 1px solid transparent;
+ border-bottom: 4px solid transparent;
+ transition:
+ .15s color ease-in-out,
+ .15s background-color ease-in-out,
+ .15s border-color ease-in-out;
+}
+
+.wp-full-overlay-footer .devices button:focus {
+ box-shadow: none;
+ outline: none;
+}
+
+.wp-full-overlay-footer .devices button:before {
+ display: inline-block;
+ -webkit-font-smoothing: antialiased;
+ font: normal 20px/30px "dashicons";
+ vertical-align: top;
+ margin: 3px 0;
+ padding: 4px 8px;
+ color: #656a6f;
+}
+
+.wp-full-overlay-footer .devices button.active {
+ border-bottom-color: #191e23;
+}
+
+.wp-full-overlay-footer .devices button:hover,
+.wp-full-overlay-footer .devices button:focus {
+ background-color: #fff;
+}
+
+.wp-full-overlay-footer .devices button:focus,
+.wp-full-overlay-footer .devices button.active:hover {
+ border-bottom-color: #0073aa;
+}
+
+.wp-full-overlay-footer .devices button.active:before {
+ color: #191e23;
+}
+
+.wp-full-overlay-footer .devices button:hover:before,
+.wp-full-overlay-footer .devices button:focus:before {
+ color: #0073aa;
+}
+
+.wp-full-overlay-footer .devices .preview-desktop:before {
+ content: "\f472";
+}
+
+.wp-full-overlay-footer .devices .preview-tablet:before {
+ content: "\f471";
+}
+
+.wp-full-overlay-footer .devices .preview-mobile:before {
+ content: "\f470";
+}
+
+@media screen and (max-width: 1024px) {
+ .wp-full-overlay-footer .devices {
+ display: none;
+ }
+}
+
+.collapsed .wp-full-overlay-footer .devices button:before {
+ display: none;
+}
+
+.preview-mobile .wp-full-overlay-main {
+ margin: auto 0 auto -160px;
+ width: 320px;
+ height: 480px;
+ max-height: 100%;
+ max-width: 100%;
+ left: 50%;
+}
+
+.preview-tablet .wp-full-overlay-main {
+ margin: auto 0 auto -360px;
+ width: 720px; /* Size is loosely based on a typical "tablet" device size. Intentionally ambiguous - this does not represent any particular device precisely. */
+ height: 1080px;
+ max-height: 100%;
+ max-width: 100%;
+ left: 50%;
+}
+
+
+/*------------------------------------------------------------------------------
+ 24.0 - Customize Loader
+------------------------------------------------------------------------------*/
+
+.no-customize-support .hide-if-no-customize,
+.customize-support .hide-if-customize,
+.no-customize-support.wp-core-ui .hide-if-no-customize,
+.no-customize-support .wp-core-ui .hide-if-no-customize,
+.customize-support.wp-core-ui .hide-if-customize,
+.customize-support .wp-core-ui .hide-if-customize {
+ display: none;
+}
+
+#customize-container,
+#customize-controls .notice.notification-overlay {
+ background: #eee;
+ z-index: 500000;
+ position: fixed;
+ overflow: visible;
+ top: 0;
+ bottom: 0;
+ left: 0;
+ right: 0;
+ height: 100%;
+}
+#customize-container {
+ display: none;
+}
+
+/* Make the Customizer and Theme installer overlays the only available content. */
+#customize-container,
+.theme-install-overlay {
+ visibility: visible;
+}
+
+.customize-loading #customize-container iframe {
+ opacity: 0;
+}
+
+#customize-container iframe,
+.theme-install-overlay iframe {
+ height: 100%;
+ width: 100%;
+ z-index: 20;
+ transition: opacity 0.3s;
+}
+
+#customize-controls {
+ margin-top: 0;
+}
+
+.theme-install-overlay {
+ display: none;
+}
+
+.theme-install-overlay.single-theme {
+ display: block;
+}
+
+.install-theme-info {
+ display: none;
+ padding: 10px 20px 60px;
+}
+
+.single-theme .install-theme-info {
+ padding-top: 15px;
+}
+
+.theme-install-overlay .install-theme-info {
+ display: block;
+}
+
+.install-theme-info .theme-install {
+ float: right;
+ margin-top: 18px;
+}
+
+.install-theme-info .theme-name {
+ font-size: 16px;
+ line-height: 1.5;
+ margin-bottom: 0;
+ margin-top: 0;
+}
+
+.install-theme-info .theme-screenshot {
+ margin: 15px 0;
+ width: 258px;
+ border: 1px solid #ccc;
+}
+
+.install-theme-info .theme-details {
+ overflow: hidden;
+}
+
+.theme-details .theme-version {
+ margin: 15px 0;
+}
+
+.theme-details .theme-description {
+ float: left;
+ color: #72777c;
+ line-height: 1.6;
+ max-width: 100%;
+}
+
+.theme-install-overlay .wp-full-overlay-header .button {
+ float: right;
+ margin: 8px 10px 0 0;
+ /* For when .theme-install is a span rather than a.button-primary (already installed theme) */
+ line-height: 2;
+}
+
+.theme-install-overlay .wp-full-overlay-sidebar {
+ background: #eee;
+ border-right: 1px solid #ddd;
+}
+
+.theme-install-overlay .wp-full-overlay-sidebar-content {
+ background: #fff;
+ border-top: 1px solid #ddd;
+ border-bottom: 1px solid #ddd;
+}
+
+.theme-install-overlay .wp-full-overlay-main {
+ position: absolute;
+ z-index: 0;
+ background-color: #f1f1f1;
+}
+
+.customize-loading #customize-container {
+ background-color: #f1f1f1;
+}
+
+#customize-preview.wp-full-overlay-main:before,
+.customize-loading #customize-container:before,
+#customize-controls .notice.notification-overlay.notification-loading:before,
+.theme-install-overlay .wp-full-overlay-main:before {
+ content: "";
+ display: block;
+ width: 20px;
+ height: 20px;
+ position: absolute;
+ left: 50%;
+ top: 50%;
+ z-index: -1;
+ margin: -10px 0 0 -10px;
+ transform: translateZ(0);
+ background: transparent url(../images/spinner.gif) no-repeat center center;
+ background-size: 20px 20px;
+}
+
+#customize-preview.wp-full-overlay-main.iframe-ready:before,
+.theme-install-overlay.iframe-ready .wp-full-overlay-main:before {
+ background-image: none;
+}
+
+/* =Media Queries
+-------------------------------------------------------------- */
+
+/**
+ * HiDPI Displays
+ */
+@media print,
+ (-webkit-min-device-pixel-ratio: 1.25),
+ (min-resolution: 120dpi) {
+ .wp-full-overlay .collapse-sidebar-arrow {
+ background-image: url(../images/arrows-2x.png);
+ background-size: 15px 123px;
+ }
+
+ #customize-preview.wp-full-overlay-main:before,
+ .customize-loading #customize-container:before,
+ #customize-controls .notice.notification-overlay.notification-loading:before,
+ .theme-install-overlay .wp-full-overlay-main:before {
+ background-image: url(../images/spinner-2x.gif);
+ }
+}
+
+@media screen and (max-width: 782px) {
+ .available-theme .action-links .delete-theme {
+ float: none;
+ margin: 0;
+ padding: 0;
+ clear: both;
+ }
+
+ .available-theme .action-links .delete-theme a {
+ padding: 0;
+ }
+
+ .broken-themes table {
+ width: 100%;
+ }
+
+ .theme-install-overlay .wp-full-overlay-header .theme-install {
+ margin-top: 6px;
+ line-height: normal;
+ }
+
+ .theme-browser .theme .theme-actions .button {
+ margin-bottom: 0;
+ }
+
+ .theme-browser .theme.active .theme-actions,
+ .theme-browser .theme .theme-actions {
+ padding-top: 8px;
+ padding-bottom: 8px;
+ }
+}
+
+@media aural {
+ .theme .notice:before,
+ .theme-info .updating-message:before,
+ .theme-info .updated-message:before,
+ .theme-install.updating-message:before {
+ speak: none;
+ }
+}
diff --git a/www/crm/wp-admin/css/themes.min.css b/www/crm/wp-admin/css/themes.min.css
new file mode 100644
index 00000000..ff09c0c8
--- /dev/null
+++ b/www/crm/wp-admin/css/themes.min.css
@@ -0,0 +1,2 @@
+/*! This file is auto-generated */
+body.js .theme-browser.search-loading{display:none}.theme-browser .themes{clear:both}.themes-php:not(.network-admin) .wrap h1{margin-bottom:15px}.themes-php .wrap h1 .button{margin-left:20px}.themes-php .search-form{display:inline}.themes-php .wp-filter-search{position:relative;top:-2px;left:20px;margin:0;width:280px;font-size:16px;font-weight:300;line-height:1.5}.theme .notice,.theme .notice.is-dismissible{left:0;margin:0;position:absolute;right:0;top:0}.theme-browser .theme{cursor:pointer;float:left;margin:0 4% 4% 0;position:relative;width:30.6%;border:1px solid #ddd;box-shadow:0 1px 1px -1px rgba(0,0,0,.1);box-sizing:border-box}.ie8 .theme-browser .theme{width:30%;margin:0 3% 4% 0}.theme-browser .theme:nth-child(3n){margin-right:0}.theme-browser .theme:focus,.theme-browser .theme:hover{cursor:pointer}.theme-browser .theme .theme-name{font-size:15px;font-weight:600;height:18px;margin:0;padding:15px;box-shadow:inset 0 1px 0 rgba(0,0,0,.1);overflow:hidden;white-space:nowrap;text-overflow:ellipsis;background:#fff;background:rgba(255,255,255,.65)}.theme-browser .theme .theme-actions{-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";opacity:0;transition:opacity .1s ease-in-out;height:auto;background:rgba(244,244,244,.7);border-left:1px solid rgba(0,0,0,.05)}.theme-browser .theme.focus .theme-actions,.theme-browser .theme:focus .theme-actions,.theme-browser .theme:hover .theme-actions{-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=100)";opacity:1}.theme-browser .theme .theme-actions .button-primary{margin-right:3px}.theme-browser .theme .theme-actions .button{float:none;margin-left:3px}.theme-browser .theme .theme-screenshot{display:block;overflow:hidden;position:relative;-webkit-backface-visibility:hidden;transition:opacity .2s ease-in-out}.theme-browser .theme .theme-screenshot:after{content:"";display:block;padding-top:66.66666%}.theme-browser .theme .theme-screenshot img{height:auto;position:absolute;left:0;top:0;width:100%;transition:opacity .2s ease-in-out}.theme-browser .theme:focus .theme-screenshot,.theme-browser .theme:hover .theme-screenshot{background:#fff}.theme-browser.rendered .theme:focus .theme-screenshot img,.theme-browser.rendered .theme:hover .theme-screenshot img{opacity:.4}.theme-browser .theme .more-details{-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";opacity:0;position:absolute;top:35%;right:20%;left:20%;background:#23282d;background:rgba(0,0,0,.7);color:#fff;font-size:15px;text-shadow:0 1px 0 rgba(0,0,0,.6);-webkit-font-smoothing:antialiased;font-weight:600;padding:15px 12px;text-align:center;border-radius:3px;transition:opacity .1s ease-in-out}.theme-browser .theme:focus{border-color:#5b9dd9;box-shadow:0 0 2px rgba(30,140,190,.8)}.theme-browser .theme:focus .more-details{opacity:1}.theme-browser .theme.active:focus .theme-actions{display:block}.theme-browser.rendered .theme:focus .more-details,.theme-browser.rendered .theme:hover .more-details{-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=100)";opacity:1}.theme-browser .theme.active .theme-name{background:#23282d;color:#fff;padding-right:110px;font-weight:300;box-shadow:inset 0 1px 1px rgba(0,0,0,.5)}.theme-browser .customize-control .theme.active .theme-name{padding-right:15px}.theme-browser .theme.active .theme-name span{font-weight:600}.theme-browser .theme.active .theme-actions{background:rgba(49,49,49,.7);border-left:none;opacity:1}.theme-id-container{position:relative}.theme-browser .theme .theme-actions,.theme-browser .theme.active .theme-actions{position:absolute;top:50%;transform:translateY(-50%);right:0;padding:10px 15px;box-shadow:inset 0 1px 0 rgba(0,0,0,.1)}.theme-browser .theme.active .theme-actions .button-primary{margin-right:0}.theme-browser .theme .theme-author{background:#23282d;color:#eee;display:none;font-size:14px;margin:0 10px;padding:5px 10px;position:absolute;bottom:56px}.theme-browser .theme.display-author .theme-author{display:block}.theme-browser .theme.display-author .theme-author a{color:inherit;text-decoration:none}.theme-browser .theme.add-new-theme{border:none;box-shadow:none}.theme-browser .theme.add-new-theme a{text-decoration:none;display:block;position:relative;z-index:1}.theme-browser .theme.add-new-theme a:after{display:block;content:"";background:0 0;background:rgba(0,0,0,0);position:absolute;top:0;left:0;right:0;bottom:0;padding:0;text-shadow:none;border:5px dashed #d5d2ca;border:5px dashed rgba(0,0,0,.1);box-sizing:border-box}.theme-browser .theme.add-new-theme span:after{background:#e5e5e5;background:rgba(153,153,153,.1);border-radius:50%;display:inline-block;content:"\f132";-webkit-font-smoothing:antialiased;font:normal 74px/115px dashicons;width:100px;height:100px;vertical-align:middle;text-align:center;color:#999;position:absolute;top:30%;left:50%;margin-left:-50px;text-indent:-4px;padding:0;text-shadow:none;z-index:4}.rtl .theme-browser .theme.add-new-theme span:after{text-indent:4px}.theme-browser .theme.add-new-theme a:focus .theme-screenshot,.theme-browser .theme.add-new-theme a:hover .theme-screenshot{background:0 0}.theme-browser .theme.add-new-theme a:focus span:after,.theme-browser .theme.add-new-theme a:hover span:after{background:#fff;color:#0073aa}.theme-browser .theme.add-new-theme a:focus:after,.theme-browser .theme.add-new-theme a:hover:after{border-color:transparent;color:#fff;background:#0073aa;content:""}.theme-browser .theme.add-new-theme .theme-name{background:0 0;text-align:center;box-shadow:none;font-weight:400;position:relative;top:0;margin-top:-18px;padding-top:0;padding-bottom:48px}.theme-browser .theme.add-new-theme a:focus .theme-name,.theme-browser .theme.add-new-theme a:hover .theme-name{color:#fff;z-index:2}.theme-overlay .theme-backdrop{position:absolute;left:-20px;right:0;top:0;bottom:0;background:#f1f1f1;background:rgba(238,238,238,.9);z-index:10000}.theme-overlay .theme-header{position:absolute;top:0;left:0;right:0;height:48px;border-bottom:1px solid #ddd}.theme-overlay .theme-header button{padding:0}.theme-overlay .theme-header .close{cursor:pointer;height:48px;width:50px;text-align:center;float:right;border:0;border-left:1px solid #ddd;background-color:transparent;transition:color .1s ease-in-out,background .1s ease-in-out}.theme-overlay .theme-header .close:before{font:normal 22px/50px dashicons!important;color:#72777c;display:inline-block;content:"\f335";font-weight:300}.theme-overlay .theme-header .left,.theme-overlay .theme-header .right{cursor:pointer;color:#72777c;background-color:transparent;height:48px;width:54px;float:left;text-align:center;border:0;border-right:1px solid #ddd;transition:color .1s ease-in-out,background .1s ease-in-out}.theme-overlay .theme-header .close:focus,.theme-overlay .theme-header .close:hover,.theme-overlay .theme-header .left:focus,.theme-overlay .theme-header .left:hover,.theme-overlay .theme-header .right:focus,.theme-overlay .theme-header .right:hover{background:#ddd;border-color:#ccc;color:#000}.theme-overlay .theme-header .close:focus:before,.theme-overlay .theme-header .close:hover:before{color:#000}.theme-overlay .theme-header .close:focus,.theme-overlay .theme-header .left:focus,.theme-overlay .theme-header .right:focus{box-shadow:none;outline:0}.theme-overlay .theme-header .left.disabled,.theme-overlay .theme-header .left.disabled:hover,.theme-overlay .theme-header .right.disabled,.theme-overlay .theme-header .right.disabled:hover{color:#ccc;background:inherit;cursor:inherit}.theme-overlay .theme-header .left:before,.theme-overlay .theme-header .right:before{font:normal 20px/50px dashicons!important;display:inline;font-weight:300}.theme-overlay .theme-header .left:before{content:"\f341"}.theme-overlay .theme-header .right:before{content:"\f345"}.theme-overlay .theme-wrap{clear:both;position:fixed;top:9%;left:190px;right:30px;bottom:3%;background:#fff;box-shadow:0 1px 20px 5px rgba(0,0,0,.1);z-index:10000;box-sizing:border-box;-webkit-overflow-scrolling:touch}body.folded .theme-browser~.theme-overlay .theme-wrap{left:70px}.theme-overlay .theme-about{position:absolute;top:49px;bottom:57px;left:0;right:0;overflow:auto;padding:2% 4%}.theme-overlay .theme-actions{position:absolute;text-align:center;bottom:0;left:0;right:0;padding:10px 25px 5px;background:#f3f3f3;z-index:30;box-sizing:border-box;border-top:1px solid #eee}.ie8 .theme-overlay .theme-actions{border:1px solid #eee}.theme-overlay .theme-actions a{margin-right:5px;margin-bottom:5px}.customize-support .theme-overlay .theme-actions a[href="themes.php?page=custom-background"],.customize-support .theme-overlay .theme-actions a[href="themes.php?page=custom-header"]{display:none}.broken-themes a.delete-theme,.theme-overlay .theme-actions .delete-theme{color:#a00;text-decoration:none;border-color:transparent;box-shadow:none;background:0 0}.theme-overlay .theme-actions .delete-theme{position:absolute;right:10px;bottom:5px}.broken-themes a.delete-theme:focus,.broken-themes a.delete-theme:hover,.theme-overlay .theme-actions .delete-theme:focus,.theme-overlay .theme-actions .delete-theme:hover{background:#d54e21;color:#fff;border-color:#d54e21}.theme-overlay .theme-actions .active-theme,.theme-overlay.active .theme-actions .inactive-theme{display:none}.theme-overlay .theme-actions .inactive-theme,.theme-overlay.active .theme-actions .active-theme{display:block}.theme-overlay .theme-screenshots{float:left;margin:0 30px 0 0;width:55%;max-width:1200px;text-align:center}.theme-overlay .screenshot{border:1px solid #fff;box-sizing:border-box;overflow:hidden;position:relative;box-shadow:0 0 0 1px rgba(0,0,0,.2)}.theme-overlay .screenshot:after{content:"";display:block;padding-top:75%}.theme-overlay .screenshot img{height:auto;position:absolute;left:0;top:0;width:100%}.theme-overlay.small-screenshot .theme-screenshots{position:absolute;width:302px}.theme-overlay.small-screenshot .theme-info{margin-left:350px;width:auto}.theme-overlay .screenshot.thumb{background:#ccc;border:1px solid #eee;float:none;display:inline-block;margin:10px 5px 0;width:140px;height:80px;cursor:pointer}.theme-overlay .screenshot.thumb:after{content:"";display:block;padding-top:100%}.theme-overlay .screenshot.thumb img{cursor:pointer;height:auto;position:absolute;left:0;top:0;width:100%;height:auto}.theme-overlay .screenshot.selected{background:0 0;border:2px solid #00a0d2}.theme-overlay .screenshot.selected img{opacity:.8}.theme-browser .theme .theme-screenshot.blank,.theme-overlay .screenshot.blank{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAYAAADED76LAAAALElEQVQYGWO8d+/efwYkoKioiMRjYGBC4WHhUK6A8T8QIJt8//59ZC493AAAQssKpBK4F5AAAAAASUVORK5CYII=)}.theme-overlay .theme-info{width:40%;float:left}.theme-overlay .current-label{background:#32373c;color:#fff;font-size:11px;display:inline-block;padding:2px 8px;border-radius:2px;margin:0 0 -10px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.theme-overlay .theme-name{color:#23282d;font-size:32px;font-weight:100;margin:10px 0 0;line-height:1.3;word-wrap:break-word;overflow-wrap:break-word}.theme-overlay .theme-version{color:#72777c;font-size:13px;font-weight:400;float:none;display:inline-block;margin-left:10px}.theme-overlay .theme-author{margin:15px 0 25px;color:#72777c;font-size:16px;font-weight:400;line-height:inherit}.theme-overlay .theme-author a{text-decoration:none}.theme-overlay .theme-description{color:#555;font-size:15px;font-weight:400;line-height:1.5;margin:30px 0 0 0}.theme-overlay .theme-tags{border-top:3px solid #eee;color:#82878c;font-size:13px;font-weight:400;margin:30px 0 0 0;padding-top:20px}.theme-overlay .theme-tags span{color:#444;font-weight:600;margin-right:5px}.theme-overlay .parent-theme{background:#f7fcfe;border:1px solid #eee;border-left:4px solid #00a0d2;font-size:14px;font-weight:400;margin-top:30px;padding:10px 10px 10px 20px}.theme-overlay .parent-theme strong{font-weight:600}.single-theme .theme,.single-theme .theme-overlay .theme-backdrop,.single-theme .theme-overlay .theme-header{display:none}.single-theme .theme-overlay .theme-wrap{clear:both;min-height:330px;position:relative;left:auto;right:auto;top:auto;bottom:auto;z-index:10}.single-theme .theme-overlay .theme-about{padding:30px 30px 70px;position:static}.single-theme .theme-overlay .theme-actions{position:absolute}@media only screen and (min-width:2000px){#wpwrap .theme-browser .theme{width:17.6%;margin:0 3% 3% 0}#wpwrap .theme-browser .theme:nth-child(3n),#wpwrap .theme-browser .theme:nth-child(4n){margin-right:3%}#wpwrap .theme-browser .theme:nth-child(5n){margin-right:0}}@media only screen and (min-width:1680px){.theme-overlay .theme-wrap{width:1450px;margin:0 auto}}@media only screen and (min-width:1640px){.theme-browser .theme{width:22.7%;margin:0 3% 3% 0}.theme-browser .theme .theme-screenshot:after{padding-top:75%}.theme-browser .theme:nth-child(3n){margin-right:3%}.theme-browser .theme:nth-child(4n){margin-right:0}}@media only screen and (max-width:1120px){.theme-browser .theme{width:47.5%;margin-right:0}.theme-browser .theme:nth-child(even){margin-right:0}.theme-browser .theme:nth-child(odd){margin-right:5%}}@media only screen and (max-width:900px){.theme-overlay .theme-wrap{left:65px}}@media only screen and (max-width:780px){.theme-overlay .theme-wrap,body.folded .theme-overlay .theme-wrap{top:0;right:0;bottom:0;left:0;padding:70px 20px 20px;border:none;z-index:100000;position:fixed}.theme-browser .theme.active .theme-name span{display:none}.theme-overlay .theme-screenshots{width:40%}.theme-overlay .theme-info{width:50%}.single-theme .theme-wrap{padding:10px}.theme-browser .theme .theme-actions{padding:5px 10px 4px 10px}.theme-overlay.small-screenshot .theme-screenshots{position:static;float:none;max-width:302px}.theme-overlay.small-screenshot .theme-info{margin-left:0;width:auto}.theme:focus .more-details,.theme:hover .more-details,.theme:not(.active):focus .theme-actions,.theme:not(.active):hover .theme-actions{display:none}.theme-browser.rendered .theme:focus .theme-screenshot img,.theme-browser.rendered .theme:hover .theme-screenshot img{opacity:1}}@media only screen and (max-width:480px){.theme-browser .theme{width:100%;margin-right:0}.theme-browser .theme:nth-child(2n),.theme-browser .theme:nth-child(3n){margin-right:0}}@media only screen and (max-width:650px){.theme-overlay .theme-description{margin-left:0}.theme-overlay .theme-actions .delete-theme{position:relative;right:auto;bottom:auto}.theme-overlay .theme-actions .inactive-theme{display:inline}.theme-overlay .theme-screenshots{width:100%;float:none}.theme-overlay .theme-info{width:100%}.theme-overlay .theme-author{margin:5px 0 15px 0}.theme-overlay .current-label{margin-top:10px;font-size:13px}.themes-php .wp-filter-search{float:none;clear:both;left:0;right:0;margin:-5px 0 20px 0;width:100%;max-width:280px}.theme-browser .theme.add-new-theme span:after{font:normal 60px/90px dashicons;width:80px;height:80px;top:30%;left:50%;text-indent:0;margin-left:-40px}.single-theme .theme-wrap{margin:0 -12px 0 -10px;padding:10px}.single-theme .theme-overlay .theme-about{padding:10px;overflow:visible}.single-theme .current-label{display:none}.single-theme .theme-overlay .theme-actions{position:static}}.broken-themes{clear:both}.broken-themes table{text-align:left;width:50%;border-spacing:3px;padding:3px}.theme-browser .theme .theme-installed{background:#0073aa}.theme-browser .theme .notice-success p:before{color:#79ba49;content:"\f147";display:inline-block;font:normal 20px/1 dashicons;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;vertical-align:top}.theme-install.updated-message:before{content:""}.theme-install-php .wp-filter{padding-left:20px}.theme-install-php a.browse-themes,.theme-install-php a.upload{cursor:pointer}.plugin-install-tab-upload .upload-view-toggle .upload,.upload-view-toggle .browse{display:none}.plugin-install-tab-upload .upload-view-toggle .browse{display:inline}.upload-plugin,.upload-theme{box-sizing:border-box;display:none;margin:0;padding:50px 0;width:100%;overflow:hidden;position:relative;top:10px}.upload-plugin-wrap{display:none}.plugin-install-tab-upload .upload-plugin,.show-upload-view .upload-plugin,.show-upload-view .upload-plugin-wrap,.show-upload-view .upload-theme{display:block}.upload-plugin .wp-upload-form,.upload-theme .wp-upload-form{background:#fafafa;border:1px solid #e5e5e5;padding:30px;margin:30px auto;max-width:380px}.upload-plugin .install-help,.upload-theme .install-help{color:#555d66;font-size:18px;font-style:normal;margin:0;padding:0;text-align:center}p.no-themes,p.no-themes-local{clear:both;color:#666;font-size:18px;font-style:normal;margin:0;padding:100px 0;text-align:center;display:none}.no-results p.no-themes{display:block}.theme-install-php .add-new-theme{display:none!important}@media only screen and (max-width:1120px){.upload-theme .wp-upload-form{margin:20px 0;max-width:100%}.upload-theme .install-help{font-size:15px;padding:20px 0 0;text-align:left}}.theme-details .theme-rating{line-height:1.9}.theme-details .star-rating{display:inline}.theme-details .no-rating,.theme-details .num-ratings{font-size:11px;color:#72777c}.theme-details .no-rating{display:block;line-height:1.9}.appearance_page_custom-header #headimg{border:1px solid #ddd;overflow:hidden;width:100%}.appearance_page_custom-header #upload-form p label{font-size:12px}.appearance_page_custom-header .available-headers .default-header{float:left;margin:0 20px 20px 0}.appearance_page_custom-header .random-header{clear:both;margin:0 20px 20px 0;vertical-align:middle}.appearance_page_custom-header .available-headers label input,.appearance_page_custom-header .random-header label input{margin-right:10px}.appearance_page_custom-header .available-headers label img{vertical-align:middle}div#custom-background-image{min-height:100px;border:1px solid #ddd}div#custom-background-image img{max-width:400px;max-height:300px}.background-position-control input[type=radio]:checked~.button{background:#eee;border-color:#999;box-shadow:inset 0 2px 5px -3px rgba(0,0,0,.5);z-index:1}.background-position-control input[type=radio]:focus~.button{border-color:#5b9dd9;box-shadow:inset 0 2px 5px -3px rgba(0,0,0,.5),0 0 3px rgba(0,115,170,.8);color:#23282d}.background-position-control .background-position-center-icon,.background-position-control .background-position-center-icon:before{display:inline-block;line-height:1;text-align:center;transition:background-color .1s ease-in}.background-position-control .background-position-center-icon{height:20px;margin-top:13px;vertical-align:top;width:20px}.background-position-control .background-position-center-icon:before{background-color:#555;border-radius:50%;content:"";height:12px;width:12px}.background-position-control .button:hover .background-position-center-icon:before,.background-position-control input[type=radio]:focus~.button .background-position-center-icon:before{background-color:#23282d}.background-position-control .button-group{display:block}.background-position-control .button-group .button{border-radius:0;box-shadow:none;height:40px!important;line-height:2.9!important;margin:0 -1px 0 0!important;padding:0 10px 1px!important;position:relative}.background-position-control .button-group .button:active,.background-position-control .button-group .button:focus,.background-position-control .button-group .button:hover{z-index:1}.background-position-control .button-group:last-child .button{box-shadow:0 1px 0 #ccc}.background-position-control .button-group>label{margin:0!important}.background-position-control .button-group:first-child>label:first-child .button{border-radius:3px 0 0}.background-position-control .button-group:first-child>label:first-child .dashicons{transform:rotate(45deg)}.background-position-control .button-group:first-child>label:last-child .button{border-radius:0 3px 0 0}.background-position-control .button-group:first-child>label:last-child .dashicons{transform:rotate(-45deg)}.background-position-control .button-group:last-child>label:first-child .button{border-radius:0 0 0 3px}.background-position-control .button-group:last-child>label:first-child .dashicons{transform:rotate(-45deg)}.background-position-control .button-group:last-child>label:last-child .button{border-radius:0 0 3px 0}.background-position-control .button-group:last-child>label:last-child .dashicons{transform:rotate(45deg)}.background-position-control .button-group .dashicons{margin-top:9px}.background-position-control .button-group+.button-group{margin-top:-1px}body.full-overlay-active{overflow:hidden;visibility:hidden}.wp-full-overlay{background:0 0;z-index:500000;position:fixed;overflow:visible;top:0;bottom:0;left:0;right:0;height:100%;min-width:0}.wp-full-overlay-sidebar{box-sizing:border-box;position:fixed;min-width:300px;max-width:600px;width:18%;height:100%;top:0;bottom:0;left:0;padding:0;margin:0;z-index:10;background:#eee;border-right:none}.wp-full-overlay.collapsed .wp-full-overlay-sidebar{overflow:visible}.wp-full-overlay.collapsed,.wp-full-overlay.expanded .wp-full-overlay-sidebar{margin-left:0!important}.wp-full-overlay.expanded{margin-left:300px}.wp-full-overlay.collapsed .wp-full-overlay-sidebar{margin-left:-300px}@media screen and (min-width:1667px){.wp-full-overlay.expanded{margin-left:18%}.wp-full-overlay.collapsed .wp-full-overlay-sidebar{margin-left:-18%}}@media screen and (min-width:3333px){.wp-full-overlay.expanded{margin-left:600px}.wp-full-overlay.collapsed .wp-full-overlay-sidebar{margin-left:-600px}}.wp-full-overlay-sidebar:after{content:"";display:block;position:absolute;top:0;bottom:0;right:0;width:3px;z-index:1000}.wp-full-overlay-main{position:absolute;left:0;right:0;top:0;bottom:0;height:100%}.wp-full-overlay-sidebar .wp-full-overlay-header{position:absolute;left:0;right:0;height:45px;padding:0 15px;line-height:3.2;z-index:10;margin:0;border-top:none;box-shadow:none}.wp-full-overlay-sidebar .wp-full-overlay-header a.back{margin-top:9px}.wp-full-overlay-sidebar .wp-full-overlay-footer{bottom:0;border-bottom:none;border-top:none;box-shadow:none}.wp-full-overlay-sidebar .wp-full-overlay-sidebar-content{position:absolute;top:45px;bottom:45px;left:0;right:0;overflow:auto}.theme-install-overlay .wp-full-overlay-sidebar .wp-full-overlay-header{padding:0}.theme-install-overlay .close-full-overlay,.theme-install-overlay .next-theme,.theme-install-overlay .previous-theme{display:block;position:relative;float:left;width:45px;height:45px;padding-right:2px;background:#eee;border-right:1px solid #ddd;color:#444;cursor:pointer;text-decoration:none;transition:color .1s ease-in-out,background .1s ease-in-out}.theme-install-overlay .close-full-overlay:focus,.theme-install-overlay .close-full-overlay:hover,.theme-install-overlay .next-theme:focus,.theme-install-overlay .next-theme:hover,.theme-install-overlay .previous-theme:focus,.theme-install-overlay .previous-theme:hover{background:#ddd;border-color:#ccc;color:#000;outline:0;box-shadow:none}.theme-install-overlay .close-full-overlay:before{font:normal 22px/1 dashicons;content:"\f335";position:relative;top:7px;left:13px}.theme-install-overlay .previous-theme:before{font:normal 20px/1 dashicons;content:"\f341";position:relative;top:6px;left:14px}.theme-install-overlay .next-theme:before{font:normal 20px/1 dashicons;content:"\f345";position:relative;top:6px;left:13px}.theme-install-overlay .next-theme.disabled,.theme-install-overlay .next-theme.disabled:focus,.theme-install-overlay .next-theme.disabled:hover,.theme-install-overlay .previous-theme.disabled,.theme-install-overlay .previous-theme.disabled:focus,.theme-install-overlay .previous-theme.disabled:hover{color:#b4b9be;background:#eee;cursor:default;pointer-events:none}.theme-install-overlay .close-full-overlay,.theme-install-overlay .next-theme,.theme-install-overlay .previous-theme{border-left:0;border-top:0;border-bottom:0}.theme-install-overlay .close-full-overlay:before,.theme-install-overlay .next-theme:before,.theme-install-overlay .previous-theme:before{top:2px;left:0}.wp-core-ui .wp-full-overlay .collapse-sidebar{position:fixed;bottom:0;left:0;padding:9px 0 9px 10px;height:45px;color:#656a6f;outline:0;line-height:1;background-color:transparent!important;border:none!important;box-shadow:none!important;border-radius:0!important}.wp-core-ui .wp-full-overlay .collapse-sidebar:focus,.wp-core-ui .wp-full-overlay .collapse-sidebar:hover{color:#0073aa}.wp-full-overlay .collapse-sidebar-arrow,.wp-full-overlay .collapse-sidebar-label{display:inline-block;vertical-align:middle;line-height:1.6}.wp-full-overlay .collapse-sidebar-arrow{width:20px;height:20px;margin:0 2px;border-radius:50%;overflow:hidden}.wp-full-overlay .collapse-sidebar:focus .collapse-sidebar-arrow,.wp-full-overlay .collapse-sidebar:hover .collapse-sidebar-arrow{box-shadow:0 0 0 1px #5b9dd9,0 0 2px 1px rgba(30,140,190,.8)}.wp-full-overlay .collapse-sidebar-label{margin-left:3px}.wp-full-overlay.collapsed .collapse-sidebar-label{display:none}.wp-full-overlay .collapse-sidebar-arrow:before{display:block;content:"\f148";background:#eee;font:normal 20px/1 dashicons;speak:none;padding:0;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.wp-core-ui .wp-full-overlay.collapsed .collapse-sidebar{padding:9px 10px}.rtl .wp-full-overlay .collapse-sidebar-arrow:before,.wp-full-overlay.collapsed .collapse-sidebar-arrow:before{transform:rotate(180.001deg)}.rtl .wp-full-overlay.collapsed .collapse-sidebar-arrow:before{transform:none}.wp-full-overlay,.wp-full-overlay .collapse-sidebar,.wp-full-overlay-main,.wp-full-overlay-sidebar{transition-property:left,right,top,bottom,width,margin;transition-duration:.2s}.wp-full-overlay{background:#191e23}.wp-full-overlay-main{background-color:#f1f1f1}.expanded .wp-full-overlay-footer{position:fixed;bottom:0;left:0;min-width:299px;max-width:599px;width:18%;width:calc(18% - 1px);height:45px;border-top:1px solid #ddd;background:#eee}.wp-full-overlay-footer .devices-wrapper{float:right}.wp-full-overlay-footer .devices{position:relative;background:#eee;box-shadow:-20px 0 10px -5px #eee}.wp-full-overlay-footer .devices button{cursor:pointer;background:0 0;border:none;height:45px;padding:0 3px;margin:0 0 0 -4px;box-shadow:none;border-top:1px solid transparent;border-bottom:4px solid transparent;transition:.15s color ease-in-out,.15s background-color ease-in-out,.15s border-color ease-in-out}.wp-full-overlay-footer .devices button:focus{box-shadow:none;outline:0}.wp-full-overlay-footer .devices button:before{display:inline-block;-webkit-font-smoothing:antialiased;font:normal 20px/30px dashicons;vertical-align:top;margin:3px 0;padding:4px 8px;color:#656a6f}.wp-full-overlay-footer .devices button.active{border-bottom-color:#191e23}.wp-full-overlay-footer .devices button:focus,.wp-full-overlay-footer .devices button:hover{background-color:#fff}.wp-full-overlay-footer .devices button.active:hover,.wp-full-overlay-footer .devices button:focus{border-bottom-color:#0073aa}.wp-full-overlay-footer .devices button.active:before{color:#191e23}.wp-full-overlay-footer .devices button:focus:before,.wp-full-overlay-footer .devices button:hover:before{color:#0073aa}.wp-full-overlay-footer .devices .preview-desktop:before{content:"\f472"}.wp-full-overlay-footer .devices .preview-tablet:before{content:"\f471"}.wp-full-overlay-footer .devices .preview-mobile:before{content:"\f470"}@media screen and (max-width:1024px){.wp-full-overlay-footer .devices{display:none}}.collapsed .wp-full-overlay-footer .devices button:before{display:none}.preview-mobile .wp-full-overlay-main{margin:auto 0 auto -160px;width:320px;height:480px;max-height:100%;max-width:100%;left:50%}.preview-tablet .wp-full-overlay-main{margin:auto 0 auto -360px;width:720px;height:1080px;max-height:100%;max-width:100%;left:50%}.customize-support .hide-if-customize,.customize-support .wp-core-ui .hide-if-customize,.customize-support.wp-core-ui .hide-if-customize,.no-customize-support .hide-if-no-customize,.no-customize-support .wp-core-ui .hide-if-no-customize,.no-customize-support.wp-core-ui .hide-if-no-customize{display:none}#customize-container,#customize-controls .notice.notification-overlay{background:#eee;z-index:500000;position:fixed;overflow:visible;top:0;bottom:0;left:0;right:0;height:100%}#customize-container{display:none}#customize-container,.theme-install-overlay{visibility:visible}.customize-loading #customize-container iframe{opacity:0}#customize-container iframe,.theme-install-overlay iframe{height:100%;width:100%;z-index:20;transition:opacity .3s}#customize-controls{margin-top:0}.theme-install-overlay{display:none}.theme-install-overlay.single-theme{display:block}.install-theme-info{display:none;padding:10px 20px 60px}.single-theme .install-theme-info{padding-top:15px}.theme-install-overlay .install-theme-info{display:block}.install-theme-info .theme-install{float:right;margin-top:18px}.install-theme-info .theme-name{font-size:16px;line-height:1.5;margin-bottom:0;margin-top:0}.install-theme-info .theme-screenshot{margin:15px 0;width:258px;border:1px solid #ccc}.install-theme-info .theme-details{overflow:hidden}.theme-details .theme-version{margin:15px 0}.theme-details .theme-description{float:left;color:#72777c;line-height:1.6;max-width:100%}.theme-install-overlay .wp-full-overlay-header .button{float:right;margin:8px 10px 0 0;line-height:2}.theme-install-overlay .wp-full-overlay-sidebar{background:#eee;border-right:1px solid #ddd}.theme-install-overlay .wp-full-overlay-sidebar-content{background:#fff;border-top:1px solid #ddd;border-bottom:1px solid #ddd}.theme-install-overlay .wp-full-overlay-main{position:absolute;z-index:0;background-color:#f1f1f1}.customize-loading #customize-container{background-color:#f1f1f1}#customize-controls .notice.notification-overlay.notification-loading:before,#customize-preview.wp-full-overlay-main:before,.customize-loading #customize-container:before,.theme-install-overlay .wp-full-overlay-main:before{content:"";display:block;width:20px;height:20px;position:absolute;left:50%;top:50%;z-index:-1;margin:-10px 0 0 -10px;transform:translateZ(0);background:transparent url(../images/spinner.gif) no-repeat center center;background-size:20px 20px}#customize-preview.wp-full-overlay-main.iframe-ready:before,.theme-install-overlay.iframe-ready .wp-full-overlay-main:before{background-image:none}@media print,(-webkit-min-device-pixel-ratio:1.25),(min-resolution:120dpi){.wp-full-overlay .collapse-sidebar-arrow{background-image:url(../images/arrows-2x.png);background-size:15px 123px}#customize-controls .notice.notification-overlay.notification-loading:before,#customize-preview.wp-full-overlay-main:before,.customize-loading #customize-container:before,.theme-install-overlay .wp-full-overlay-main:before{background-image:url(../images/spinner-2x.gif)}}@media screen and (max-width:782px){.available-theme .action-links .delete-theme{float:none;margin:0;padding:0;clear:both}.available-theme .action-links .delete-theme a{padding:0}.broken-themes table{width:100%}.theme-install-overlay .wp-full-overlay-header .theme-install{margin-top:6px;line-height:normal}.theme-browser .theme .theme-actions .button{margin-bottom:0}.theme-browser .theme .theme-actions,.theme-browser .theme.active .theme-actions{padding-top:8px;padding-bottom:8px}}@media aural{.theme .notice:before,.theme-info .updated-message:before,.theme-info .updating-message:before,.theme-install.updating-message:before{speak:none}} \ No newline at end of file
diff --git a/www/crm/wp-admin/css/widgets-rtl.css b/www/crm/wp-admin/css/widgets-rtl.css
new file mode 100644
index 00000000..991a8f8c
--- /dev/null
+++ b/www/crm/wp-admin/css/widgets-rtl.css
@@ -0,0 +1,851 @@
+/* General Widgets Styles */
+
+.widget {
+ margin: 0 auto 10px;
+ position: relative;
+ box-sizing: border-box;
+}
+
+.widget-top {
+ font-size: 13px;
+ font-weight: 600;
+ background: #f7f7f7;
+}
+
+.widget-top .widget-action {
+ border: 0;
+ margin: 0;
+ padding: 10px;
+ background: none;
+ cursor: pointer;
+ outline: none;
+}
+
+.widget-title h3,
+.widget-title h4 {
+ margin: 0;
+ padding: 15px;
+ font-size: 1em;
+ line-height: 1;
+ overflow: hidden;
+ white-space: nowrap;
+ text-overflow: ellipsis;
+ -webkit-user-select: none;
+ -moz-user-select: none;
+ -ms-user-select: none;
+ user-select: none;
+}
+
+.widgets-holder-wrap .widget-inside {
+ border-top: none;
+ padding: 1px 15px 15px 15px;
+ line-height: 1.2;
+}
+
+.widget.widget-dirty .widget-control-close-wrapper {
+ display: none;
+}
+
+.in-widget-title,
+#widgets-right a.widget-control-edit,
+#available-widgets .widget-description {
+ color: #666;
+}
+
+.deleting .widget-title,
+.deleting .widget-top .widget-action .toggle-indicator:before {
+ color: #a0a5aa;
+}
+
+/* Media Widgets */
+.wp-core-ui .media-widget-control.selected .placeholder,
+.wp-core-ui .media-widget-control.selected .not-selected,
+.wp-core-ui .media-widget-control .selected {
+ display: none;
+}
+
+.media-widget-control.selected .selected {
+ display: inline-block;
+}
+
+.media-widget-buttons {
+ text-align: right;
+ margin-top: 0;
+}
+
+.media-widget-control .media-widget-buttons .button {
+ width: auto;
+ height: auto;
+ margin-top: 12px;
+ white-space: normal;
+}
+
+.media-widget-buttons .button:first-child {
+ margin-left: 8px;
+}
+
+.media-widget-control .attachment-media-view .button-add-media,
+.media-widget-control .placeholder {
+ border: 1px dashed #b4b9be;
+ box-sizing: border-box;
+ cursor: pointer;
+ line-height: 1.6;
+ padding: 9px 0;
+ position: relative;
+ text-align: center;
+ width: 100%;
+}
+
+.media-widget-control .attachment-media-view .button-add-media {
+ cursor: pointer;
+ background-color: #edeff0;
+ color: #32373c;
+}
+
+.media-widget-control .attachment-media-view .button-add-media:hover {
+ background-color: #fbfbfc;
+}
+
+.media-widget-control .attachment-media-view .button-add-media:focus {
+ background-color: #fbfbfc;
+ border-style: solid;
+ border-color: #5b9dd9;
+ box-shadow: 0 0 3px rgba( 0, 115, 170, .8 );
+ /* Only visible in Windows High Contrast mode */
+ outline: 2px solid transparent;
+ outline-offset: -2px;
+}
+
+.media-widget-control .media-widget-preview {
+ background: transparent;
+ text-align: center;
+}
+.media-widget-control .media-widget-preview .notice {
+ text-align: initial;
+}
+.media-frame .media-widget-embed-notice p code,
+.media-widget-control .notice p code {
+ padding: 0 0 0 3px;
+}
+.media-frame .media-widget-embed-notice {
+ margin-top: 16px;
+}
+.media-widget-control .media-widget-preview img {
+ max-width: 100%;
+ vertical-align: middle;
+}
+.media-widget-control .media-widget-preview .wp-video-shortcode {
+ background: #000;
+}
+
+.media-frame.media-widget .media-toolbar-secondary {
+ min-width: 300px;
+}
+
+.media-frame.media-widget .image-details .embed-media-settings .setting.align,
+.media-frame.media-widget .attachment-display-settings .setting.align,
+.media-frame.media-widget .embed-media-settings .setting.align,
+.media-frame.media-widget .embed-link-settings .setting.link-text,
+.media-frame.media-widget .replace-attachment,
+.media-frame.media-widget .checkbox-setting.autoplay {
+ display: none;
+}
+
+.media-widget-video-preview {
+ width: 100%;
+}
+
+.media-widget-video-link {
+ display: inline-block;
+ min-height: 132px;
+ width: 100%;
+ background: black;
+}
+
+.media-widget-video-link .dashicons {
+ font: normal 60px/1 'dashicons';
+ position: relative;
+ width: 100%;
+ top: -90px;
+ color: white;
+ text-decoration: none;
+}
+
+.media-widget-video-link.no-poster .dashicons {
+ top: 30px;
+}
+
+.media-frame #embed-url-field.invalid,
+.media-widget-image-link > .link:invalid {
+ border: 1px solid #dc3232;
+}
+
+.media-widget-image-link {
+ margin: 1em 0;
+}
+
+.media-widget-gallery-preview {
+ display: flex;
+ justify-content: flex-start;
+ flex-wrap: wrap;
+ margin: -1.79104477%;
+}
+
+.media-widget-preview.media_gallery,
+.media-widget-preview.media_image {
+ cursor: pointer;
+}
+
+.media-widget-preview .placeholder {
+ background: #f1f1f1;
+}
+
+.media-widget-gallery-preview .gallery-item {
+ box-sizing: border-box;
+ width: 50%;
+ margin: 0;
+ background: transparent;
+}
+
+.media-widget-gallery-preview .gallery-item .gallery-icon {
+ margin: 4.5%;
+}
+
+/*
+ * Use targeted nth-last-child selectors to control the size of each image
+ * based on how many gallery items are present in the grid.
+ * See: https://alistapart.com/article/quantity-queries-for-css
+ */
+.media-widget-gallery-preview .gallery-item:nth-last-child(3):first-child,
+.media-widget-gallery-preview .gallery-item:nth-last-child(3):first-child ~ .gallery-item,
+.media-widget-gallery-preview .gallery-item:nth-last-child(n+5),
+.media-widget-gallery-preview .gallery-item:nth-last-child(n+5) ~ .gallery-item,
+.media-widget-gallery-preview .gallery-item:nth-last-child(n+6),
+.media-widget-gallery-preview .gallery-item:nth-last-child(n+6) ~ .gallery-item {
+ max-width: 33.33%;
+}
+
+.media-widget-gallery-preview .gallery-item img {
+ height: auto;
+ vertical-align: bottom;
+}
+
+.media-widget-gallery-preview .gallery-icon {
+ position: relative;
+}
+
+.media-widget-gallery-preview .gallery-icon-placeholder {
+ position: absolute;
+ top: 0;
+ bottom: 0;
+ width: 100%;
+ box-sizing: border-box;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ background-color: rgba(0, 0, 0, 0.5);
+}
+
+.media-widget-gallery-preview .gallery-icon-placeholder-text {
+ font-weight: 600;
+ font-size: 2em;
+ color: white;
+}
+
+
+/* Widget Dragging Helpers */
+.widget.ui-draggable-dragging {
+ min-width: 100%;
+}
+
+.widget.ui-sortable-helper {
+ opacity: 0.8;
+}
+
+.widget-placeholder {
+ border: 1px dashed #b4b9be;
+ margin: 0 auto 10px;
+ height: 45px;
+ width: 100%;
+ box-sizing: border-box;
+}
+
+#widgets-right .widget-placeholder {
+ margin-top: 0;
+}
+
+#widgets-right .closed .widget-placeholder {
+ height: 0;
+ border: 0;
+ margin-top: -10px;
+}
+
+/* Widget Sidebars */
+.sidebar-name {
+ position: relative;
+ box-sizing: border-box;
+}
+
+.js .sidebar-name {
+ cursor: pointer;
+}
+
+.sidebar-name .handlediv {
+ float: left;
+ width: 38px;
+ height: 38px;
+ border: 0;
+ margin: 0;
+ padding: 8px;
+ background: none;
+ cursor: pointer;
+ outline: none;
+}
+
+#widgets-right .sidebar-name .handlediv {
+ margin: 5px 0 0 3px;
+}
+
+.sidebar-name .handlediv:focus {
+ box-shadow: none;
+ outline: none;
+}
+
+#widgets-left .sidebar-name .toggle-indicator {
+ display: none;
+}
+
+#widgets-left .widgets-holder-wrap.closed .sidebar-name .toggle-indicator,
+#widgets-left .sidebar-name:hover .toggle-indicator,
+#widgets-left .sidebar-name .handlediv:focus .toggle-indicator {
+ display: block;
+}
+
+.sidebar-name .toggle-indicator:before {
+ padding: 1px 0 1px 2px;
+ border-radius: 50%;
+}
+
+.sidebar-name .handlediv:focus .toggle-indicator:before {
+ box-shadow:
+ 0 0 0 1px #5b9dd9,
+ 0 0 2px 1px rgba(30, 140, 190, 0.8);
+}
+
+.sidebar-name h2,
+.sidebar-name h3 {
+ margin: 0;
+ padding: 8px 10px;
+ overflow: hidden;
+ white-space: nowrap;
+}
+
+.widgets-holder-wrap .description {
+ padding: 0 0 15px;
+ margin: 0;
+ font-style: normal;
+ color: #72777c;
+}
+
+.widget-holder .description,
+.inactive-sidebar .description {
+ color: #555d66;
+}
+
+#widgets-right .widgets-holder-wrap .description {
+ padding-right: 7px;
+ padding-left: 7px;
+}
+
+/* Widgets 2-col Layout */
+div.widget-liquid-left {
+ margin: 0;
+ width: 38%;
+ float: right;
+}
+
+div.widget-liquid-right {
+ float: left;
+ width: 58%;
+}
+
+/* Widgets Left - Available Widgets */
+
+div#widgets-left {
+ padding-top: 12px;
+}
+
+div#widgets-left .closed .sidebar-name,
+div#widgets-left .inactive-sidebar.closed .sidebar-name {
+ margin-bottom: 10px;
+}
+
+div#widgets-left .sidebar-name h2,
+div#widgets-left .sidebar-name h3 {
+ padding: 10px 0;
+ margin: 0 0 0 10px;
+}
+
+#widgets-left .widgets-holder-wrap,
+div#widgets-left .widget-holder {
+ background: transparent;
+ border: none;
+}
+
+#widgets-left .widgets-holder-wrap {
+ border: none;
+ box-shadow: none;
+}
+
+#available-widgets .widget {
+ margin: 0;
+}
+
+#available-widgets .widget:nth-child(odd) {
+ clear: both;
+}
+
+#available-widgets .widget .widget-description {
+ display: block;
+ padding: 10px 15px;
+ font-size: 12px;
+ overflow-wrap: break-word;
+ word-wrap: break-word;
+ -ms-word-break: break-all;
+ word-break: break-word;
+ -ms-hyphens: auto;
+ -webkit-hyphens: auto;
+ hyphens: auto;
+}
+
+#available-widgets #widget-list {
+ position: relative;
+}
+
+/* Inactive Sidebars */
+#widgets-left .inactive-sidebar {
+ clear: both;
+ width: 100%;
+ background: transparent;
+ padding: 0;
+ margin: 0 0 20px 0;
+ border: none;
+ box-shadow: none;
+}
+
+#widgets-left .inactive-sidebar.first {
+ margin-top: 40px;
+}
+
+/* Not sure what this is for... */
+div#widgets-left .inactive-sidebar .widget.expanded {
+ right: auto;
+}
+
+.widget-title-action {
+ float: left;
+ position: relative;
+}
+
+div#widgets-left .inactive-sidebar .widgets-sortables {
+ min-height: 42px;
+ padding: 0;
+ background: transparent;
+ margin: 0;
+ position: relative;
+}
+
+/* Widgets Right */
+
+div#widgets-right .sidebars-column-1,
+div#widgets-right .sidebars-column-2 {
+ max-width: 450px;
+}
+
+div#widgets-right .widgets-holder-wrap {
+ margin: 10px 0 0 0;
+}
+
+div#widgets-right .sidebar-description {
+ min-height: 20px;
+ margin-top: -5px;
+}
+
+div#widgets-right .sidebar-name h2,
+div#widgets-right .sidebar-name h3 {
+ padding: 15px 7px;
+}
+
+div#widgets-right .widget-top {
+ padding: 0;
+}
+
+div#widgets-right .widgets-sortables {
+ padding: 0 8px;
+ margin-bottom: 9px;
+ position: relative;
+ min-height: 123px;
+}
+
+div#widgets-right .closed .widgets-sortables {
+ min-height: 0;
+ margin-bottom: 0;
+}
+
+.sidebar-name .spinner,
+.remove-inactive-widgets .spinner {
+ float: none;
+ position: relative;
+ top: -2px;
+ margin: -5px 5px;
+}
+
+/* Dragging a widget over a closed sidebar */
+#widgets-right .widgets-holder-wrap.widget-hover {
+ border-color: #72777c;
+ box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
+}
+
+/* Accessibility Mode */
+.widget-access-link {
+ float: left;
+ margin: -5px 10px 10px 0;
+}
+
+.widgets_access #widgets-left .widget .widget-top {
+ cursor: auto;
+}
+
+.widgets_access #wpwrap .widgets-holder-wrap.closed .sidebar-description,
+.widgets_access #wpwrap .widgets-holder-wrap.closed .widget,
+.widgets_access #wpwrap .widget-control-edit {
+ display: block;
+}
+
+.widgets_access #widgets-left .widget .widget-top:hover,
+.widgets_access #widgets-right .widget .widget-top:hover {
+ border-color: #ddd;
+}
+
+#available-widgets .widget-control-edit .edit,
+#available-widgets .widget-action .edit,
+#widgets-left .inactive-sidebar .widget-control-edit .add,
+#widgets-left .inactive-sidebar .widget-action .add,
+#widgets-right .widget-control-edit .add,
+#widgets-right .widget-action .add {
+ display: none;
+}
+
+.widget-control-edit {
+ display: block;
+ color: #666;
+ background: #EEE;
+ padding: 0 15px;
+ line-height: 3.35;
+ border-right: 1px solid #DDD;
+}
+
+#widgets-left .widget-control-edit:hover,
+#widgets-right .widget-control-edit:hover {
+ color: #fff;
+ background: #444;
+ border-right: 0;
+ outline: 1px solid #444;
+}
+
+.widgets-holder-wrap .sidebar-name,
+.widgets-holder-wrap .sidebar-description {
+ -webkit-user-select: none;
+ -moz-user-select: none;
+ -ms-user-select: none;
+ user-select: none;
+}
+
+.editwidget {
+ margin: 0 auto;
+}
+
+.editwidget .widget-inside {
+ display: block;
+ padding: 0 15px;
+}
+
+.editwidget .widget-control-actions {
+ margin-top: 20px;
+}
+
+.js .widgets-holder-wrap.closed .widget,
+.js .widgets-holder-wrap.closed .sidebar-description,
+.js .widgets-holder-wrap.closed .remove-inactive-widgets,
+.js .widgets-holder-wrap.closed .description,
+.js .closed br.clear {
+ display: none;
+}
+
+.js .widgets-holder-wrap.closed .widget.ui-sortable-helper {
+ display: block;
+}
+
+/* Hide Widget Settings by Default */
+.widget-inside,
+.widget-description {
+ display: none;
+}
+
+.widget-inside {
+ background: #fff;
+}
+
+/* Dragging widgets over the available widget area show's a "Deactivate" message */
+#removing-widget {
+ display: none;
+ font-weight: 400;
+ padding-right: 15px;
+ font-size: 12px;
+ line-height: 1;
+ color: black;
+}
+
+.js #removing-widget {
+ color: #00a0d2;
+}
+
+.widget-control-noform,
+#access-off,
+.widgets_access .widget-action,
+.widgets_access .handlediv,
+.widgets_access #access-on,
+.widgets_access .widget-holder .description,
+.no-js .widget-holder .description {
+ display: none;
+}
+
+.widgets_access .widget-holder,
+.widgets_access #widget-list {
+ padding-top: 10px;
+}
+
+.widgets_access #access-off {
+ display: inline;
+}
+
+.widgets_access .sidebar-name,
+.widgets_access .widget .widget-top {
+ cursor: default;
+}
+
+
+/* Widgets Area Chooser */
+.widget-liquid-left #widgets-left.chooser #available-widgets .widget,
+.widget-liquid-left #widgets-left.chooser .inactive-sidebar {
+ transition: opacity 0.1s linear;
+}
+
+.widget-liquid-left #widgets-left.chooser #available-widgets .widget,
+.widget-liquid-left #widgets-left.chooser .inactive-sidebar {
+ /* -webkit-filter: blur(1px); */
+ opacity: 0.2;
+ pointer-events: none;
+}
+
+.widget-liquid-left #widgets-left.chooser #available-widgets .widget-in-question {
+ /* -webkit-filter: none; */
+ opacity: 1;
+ pointer-events: auto;
+}
+
+.widgets-chooser ul,
+#widgets-left .widget-in-question .widget-top,
+#available-widgets .widget-top:hover,
+div#widgets-right .widget-top:hover,
+#widgets-left .widget-top:hover {
+ border-color: #999;
+ box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
+}
+
+.widgets-chooser ul.widgets-chooser-sidebars {
+ margin: 0;
+ list-style-type: none;
+ max-height: 300px;
+ overflow: auto;
+}
+
+.widgets-chooser {
+ display: none;
+}
+
+.widgets-chooser ul {
+ border: 1px solid #ccc;
+}
+
+.widgets-chooser li {
+ border-bottom: 1px solid #ccc;
+ background: #fff;
+ margin: 0;
+ position: relative;
+}
+
+.widgets-chooser .widgets-chooser-button {
+ width: 100%;
+ padding: 10px 35px 10px 15px;
+ background: transparent;
+ border: 0;
+ box-sizing: border-box;
+ text-align: right;
+ cursor: pointer;
+ transition: background 0.2s ease-in-out;
+}
+
+/* @todo looks like these hover/focus states are overridden by .widgets-chooser-selected */
+.widgets-chooser .widgets-chooser-button:hover,
+.widgets-chooser .widgets-chooser-button:focus {
+ outline: none;
+ text-decoration: underline;
+}
+
+.widgets-chooser li:last-child {
+ border: none;
+}
+
+.widgets-chooser .widgets-chooser-selected .widgets-chooser-button {
+ background: #0073aa;
+ color: #fff;
+}
+
+.widgets-chooser .widgets-chooser-selected:before {
+ content: "\f147";
+ display: block;
+ -webkit-font-smoothing: antialiased;
+ font: normal 26px/1 dashicons;
+ color: #fff;
+ position: absolute;
+ top: 7px;
+ right: 5px;
+}
+
+.widgets-chooser .widgets-chooser-actions {
+ padding: 10px 0 12px 0;
+ text-align: center;
+}
+
+#available-widgets .widget .widget-top {
+ cursor: pointer;
+}
+
+#available-widgets .widget.ui-draggable-dragging .widget-top {
+ cursor: move;
+}
+
+/* =Specific widget styling
+-------------------------------------------------------------- */
+.text-widget-fields {
+ position: relative;
+}
+.text-widget-fields [hidden] {
+ display: none;
+}
+.text-widget-fields .wp-pointer.wp-pointer-top {
+ position: absolute;
+ z-index: 3;
+ top: 100px;
+ left: 10px;
+ right: 10px;
+}
+.text-widget-fields .wp-pointer .wp-pointer-arrow {
+ right: auto;
+ left: 15px;
+}
+.text-widget-fields .wp-pointer .wp-pointer-buttons {
+ line-height: 1.4;
+}
+
+.custom-html-widget-fields > p > .CodeMirror {
+ border: 1px solid #e5e5e5;
+}
+.custom-html-widget-fields code {
+ padding-top: 1px;
+ padding-bottom: 1px;
+}
+ul.CodeMirror-hints {
+ z-index: 101; /* Due to z-index 100 set on .widget.open */
+}
+.widget-control-actions .custom-html-widget-save-button.button.validation-blocked {
+ cursor: not-allowed;
+}
+
+/* =Media Queries
+-------------------------------------------------------------- */
+
+@media screen and (max-width: 480px) {
+ div.widget-liquid-left {
+ width: 100%;
+ float: none;
+ border-left: none;
+ padding-left: 0;
+ }
+
+ #widgets-left .sidebar-name {
+ margin-left: 0;
+ }
+
+ #widgets-left #available-widgets .widget-top {
+ margin-left: 0;
+ }
+
+ #widgets-left .inactive-sidebar .widgets-sortables {
+ margin-left: 0;
+ }
+
+ div.widget-liquid-right {
+ width: 100%;
+ float: none;
+ }
+
+ div.widget {
+ margin: 0 auto !important;
+ max-width: 480px;
+ }
+
+ .widget-access-link {
+ float: none;
+ margin: 15px 0 0 0;
+ }
+}
+
+@media screen and (max-width: 320px) {
+ div.widget {
+ max-width: 320px;
+ }
+}
+
+@media only screen and (min-width: 1250px) {
+ #widgets-left #available-widgets .widget {
+ width: 49%;
+ float: right;
+ }
+
+ .widget.ui-draggable-dragging {
+ min-width: 49%;
+ }
+
+ #widgets-left #available-widgets .widget:nth-child(even) {
+ float: left;
+ }
+
+ #widgets-right .sidebars-column-1,
+ #widgets-right .sidebars-column-2 {
+ float: right;
+ width: 49%;
+ }
+
+ #widgets-right .sidebars-column-1 {
+ margin-left: 2%;
+ }
+
+ #widgets-right.single-sidebar .sidebars-column-1,
+ #widgets-right.single-sidebar .sidebars-column-2 {
+ float: none;
+ width: 100%;
+ margin: 0;
+ }
+}
diff --git a/www/crm/wp-admin/css/widgets-rtl.min.css b/www/crm/wp-admin/css/widgets-rtl.min.css
new file mode 100644
index 00000000..dacd1881
--- /dev/null
+++ b/www/crm/wp-admin/css/widgets-rtl.min.css
@@ -0,0 +1,2 @@
+/*! This file is auto-generated */
+.widget{margin:0 auto 10px;position:relative;box-sizing:border-box}.widget-top{font-size:13px;font-weight:600;background:#f7f7f7}.widget-top .widget-action{border:0;margin:0;padding:10px;background:0 0;cursor:pointer;outline:0}.widget-title h3,.widget-title h4{margin:0;padding:15px;font-size:1em;line-height:1;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.widgets-holder-wrap .widget-inside{border-top:none;padding:1px 15px 15px 15px;line-height:1.2}.widget.widget-dirty .widget-control-close-wrapper{display:none}#available-widgets .widget-description,#widgets-right a.widget-control-edit,.in-widget-title{color:#666}.deleting .widget-title,.deleting .widget-top .widget-action .toggle-indicator:before{color:#a0a5aa}.wp-core-ui .media-widget-control .selected,.wp-core-ui .media-widget-control.selected .not-selected,.wp-core-ui .media-widget-control.selected .placeholder{display:none}.media-widget-control.selected .selected{display:inline-block}.media-widget-buttons{text-align:right;margin-top:0}.media-widget-control .media-widget-buttons .button{width:auto;height:auto;margin-top:12px;white-space:normal}.media-widget-buttons .button:first-child{margin-left:8px}.media-widget-control .attachment-media-view .button-add-media,.media-widget-control .placeholder{border:1px dashed #b4b9be;box-sizing:border-box;cursor:pointer;line-height:1.6;padding:9px 0;position:relative;text-align:center;width:100%}.media-widget-control .attachment-media-view .button-add-media{cursor:pointer;background-color:#edeff0;color:#32373c}.media-widget-control .attachment-media-view .button-add-media:hover{background-color:#fbfbfc}.media-widget-control .attachment-media-view .button-add-media:focus{background-color:#fbfbfc;border-style:solid;border-color:#5b9dd9;box-shadow:0 0 3px rgba(0,115,170,.8);outline:2px solid transparent;outline-offset:-2px}.media-widget-control .media-widget-preview{background:0 0;text-align:center}.media-widget-control .media-widget-preview .notice{text-align:initial}.media-frame .media-widget-embed-notice p code,.media-widget-control .notice p code{padding:0 0 0 3px}.media-frame .media-widget-embed-notice{margin-top:16px}.media-widget-control .media-widget-preview img{max-width:100%;vertical-align:middle}.media-widget-control .media-widget-preview .wp-video-shortcode{background:#000}.media-frame.media-widget .media-toolbar-secondary{min-width:300px}.media-frame.media-widget .attachment-display-settings .setting.align,.media-frame.media-widget .checkbox-setting.autoplay,.media-frame.media-widget .embed-link-settings .setting.link-text,.media-frame.media-widget .embed-media-settings .setting.align,.media-frame.media-widget .image-details .embed-media-settings .setting.align,.media-frame.media-widget .replace-attachment{display:none}.media-widget-video-preview{width:100%}.media-widget-video-link{display:inline-block;min-height:132px;width:100%;background:#000}.media-widget-video-link .dashicons{font:normal 60px/1 dashicons;position:relative;width:100%;top:-90px;color:#fff;text-decoration:none}.media-widget-video-link.no-poster .dashicons{top:30px}.media-frame #embed-url-field.invalid,.media-widget-image-link>.link:invalid{border:1px solid #dc3232}.media-widget-image-link{margin:1em 0}.media-widget-gallery-preview{display:flex;justify-content:flex-start;flex-wrap:wrap;margin:-1.79104477%}.media-widget-preview.media_gallery,.media-widget-preview.media_image{cursor:pointer}.media-widget-preview .placeholder{background:#f1f1f1}.media-widget-gallery-preview .gallery-item{box-sizing:border-box;width:50%;margin:0;background:0 0}.media-widget-gallery-preview .gallery-item .gallery-icon{margin:4.5%}.media-widget-gallery-preview .gallery-item:nth-last-child(3):first-child,.media-widget-gallery-preview .gallery-item:nth-last-child(3):first-child~.gallery-item,.media-widget-gallery-preview .gallery-item:nth-last-child(n+5),.media-widget-gallery-preview .gallery-item:nth-last-child(n+5)~.gallery-item,.media-widget-gallery-preview .gallery-item:nth-last-child(n+6),.media-widget-gallery-preview .gallery-item:nth-last-child(n+6)~.gallery-item{max-width:33.33%}.media-widget-gallery-preview .gallery-item img{height:auto;vertical-align:bottom}.media-widget-gallery-preview .gallery-icon{position:relative}.media-widget-gallery-preview .gallery-icon-placeholder{position:absolute;top:0;bottom:0;width:100%;box-sizing:border-box;display:flex;align-items:center;justify-content:center;background-color:rgba(0,0,0,.5)}.media-widget-gallery-preview .gallery-icon-placeholder-text{font-weight:600;font-size:2em;color:#fff}.widget.ui-draggable-dragging{min-width:100%}.widget.ui-sortable-helper{opacity:.8}.widget-placeholder{border:1px dashed #b4b9be;margin:0 auto 10px;height:45px;width:100%;box-sizing:border-box}#widgets-right .widget-placeholder{margin-top:0}#widgets-right .closed .widget-placeholder{height:0;border:0;margin-top:-10px}.sidebar-name{position:relative;box-sizing:border-box}.js .sidebar-name{cursor:pointer}.sidebar-name .handlediv{float:left;width:38px;height:38px;border:0;margin:0;padding:8px;background:0 0;cursor:pointer;outline:0}#widgets-right .sidebar-name .handlediv{margin:5px 0 0 3px}.sidebar-name .handlediv:focus{box-shadow:none;outline:0}#widgets-left .sidebar-name .toggle-indicator{display:none}#widgets-left .sidebar-name .handlediv:focus .toggle-indicator,#widgets-left .sidebar-name:hover .toggle-indicator,#widgets-left .widgets-holder-wrap.closed .sidebar-name .toggle-indicator{display:block}.sidebar-name .toggle-indicator:before{padding:1px 0 1px 2px;border-radius:50%}.sidebar-name .handlediv:focus .toggle-indicator:before{box-shadow:0 0 0 1px #5b9dd9,0 0 2px 1px rgba(30,140,190,.8)}.sidebar-name h2,.sidebar-name h3{margin:0;padding:8px 10px;overflow:hidden;white-space:nowrap}.widgets-holder-wrap .description{padding:0 0 15px;margin:0;font-style:normal;color:#72777c}.inactive-sidebar .description,.widget-holder .description{color:#555d66}#widgets-right .widgets-holder-wrap .description{padding-right:7px;padding-left:7px}div.widget-liquid-left{margin:0;width:38%;float:right}div.widget-liquid-right{float:left;width:58%}div#widgets-left{padding-top:12px}div#widgets-left .closed .sidebar-name,div#widgets-left .inactive-sidebar.closed .sidebar-name{margin-bottom:10px}div#widgets-left .sidebar-name h2,div#widgets-left .sidebar-name h3{padding:10px 0;margin:0 0 0 10px}#widgets-left .widgets-holder-wrap,div#widgets-left .widget-holder{background:0 0;border:none}#widgets-left .widgets-holder-wrap{border:none;box-shadow:none}#available-widgets .widget{margin:0}#available-widgets .widget:nth-child(odd){clear:both}#available-widgets .widget .widget-description{display:block;padding:10px 15px;font-size:12px;overflow-wrap:break-word;word-wrap:break-word;-ms-word-break:break-all;word-break:break-word;-ms-hyphens:auto;-webkit-hyphens:auto;hyphens:auto}#available-widgets #widget-list{position:relative}#widgets-left .inactive-sidebar{clear:both;width:100%;background:0 0;padding:0;margin:0 0 20px 0;border:none;box-shadow:none}#widgets-left .inactive-sidebar.first{margin-top:40px}div#widgets-left .inactive-sidebar .widget.expanded{right:auto}.widget-title-action{float:left;position:relative}div#widgets-left .inactive-sidebar .widgets-sortables{min-height:42px;padding:0;background:0 0;margin:0;position:relative}div#widgets-right .sidebars-column-1,div#widgets-right .sidebars-column-2{max-width:450px}div#widgets-right .widgets-holder-wrap{margin:10px 0 0 0}div#widgets-right .sidebar-description{min-height:20px;margin-top:-5px}div#widgets-right .sidebar-name h2,div#widgets-right .sidebar-name h3{padding:15px 7px}div#widgets-right .widget-top{padding:0}div#widgets-right .widgets-sortables{padding:0 8px;margin-bottom:9px;position:relative;min-height:123px}div#widgets-right .closed .widgets-sortables{min-height:0;margin-bottom:0}.remove-inactive-widgets .spinner,.sidebar-name .spinner{float:none;position:relative;top:-2px;margin:-5px 5px}#widgets-right .widgets-holder-wrap.widget-hover{border-color:#72777c;box-shadow:0 1px 2px rgba(0,0,0,.3)}.widget-access-link{float:left;margin:-5px 10px 10px 0}.widgets_access #widgets-left .widget .widget-top{cursor:auto}.widgets_access #wpwrap .widget-control-edit,.widgets_access #wpwrap .widgets-holder-wrap.closed .sidebar-description,.widgets_access #wpwrap .widgets-holder-wrap.closed .widget{display:block}.widgets_access #widgets-left .widget .widget-top:hover,.widgets_access #widgets-right .widget .widget-top:hover{border-color:#ddd}#available-widgets .widget-action .edit,#available-widgets .widget-control-edit .edit,#widgets-left .inactive-sidebar .widget-action .add,#widgets-left .inactive-sidebar .widget-control-edit .add,#widgets-right .widget-action .add,#widgets-right .widget-control-edit .add{display:none}.widget-control-edit{display:block;color:#666;background:#eee;padding:0 15px;line-height:3.35;border-right:1px solid #ddd}#widgets-left .widget-control-edit:hover,#widgets-right .widget-control-edit:hover{color:#fff;background:#444;border-right:0;outline:1px solid #444}.widgets-holder-wrap .sidebar-description,.widgets-holder-wrap .sidebar-name{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.editwidget{margin:0 auto}.editwidget .widget-inside{display:block;padding:0 15px}.editwidget .widget-control-actions{margin-top:20px}.js .closed br.clear,.js .widgets-holder-wrap.closed .description,.js .widgets-holder-wrap.closed .remove-inactive-widgets,.js .widgets-holder-wrap.closed .sidebar-description,.js .widgets-holder-wrap.closed .widget{display:none}.js .widgets-holder-wrap.closed .widget.ui-sortable-helper{display:block}.widget-description,.widget-inside{display:none}.widget-inside{background:#fff}#removing-widget{display:none;font-weight:400;padding-right:15px;font-size:12px;line-height:1;color:#000}.js #removing-widget{color:#00a0d2}#access-off,.no-js .widget-holder .description,.widget-control-noform,.widgets_access #access-on,.widgets_access .handlediv,.widgets_access .widget-action,.widgets_access .widget-holder .description{display:none}.widgets_access #widget-list,.widgets_access .widget-holder{padding-top:10px}.widgets_access #access-off{display:inline}.widgets_access .sidebar-name,.widgets_access .widget .widget-top{cursor:default}.widget-liquid-left #widgets-left.chooser #available-widgets .widget,.widget-liquid-left #widgets-left.chooser .inactive-sidebar{transition:opacity .1s linear}.widget-liquid-left #widgets-left.chooser #available-widgets .widget,.widget-liquid-left #widgets-left.chooser .inactive-sidebar{opacity:.2;pointer-events:none}.widget-liquid-left #widgets-left.chooser #available-widgets .widget-in-question{opacity:1;pointer-events:auto}#available-widgets .widget-top:hover,#widgets-left .widget-in-question .widget-top,#widgets-left .widget-top:hover,.widgets-chooser ul,div#widgets-right .widget-top:hover{border-color:#999;box-shadow:0 1px 2px rgba(0,0,0,.1)}.widgets-chooser ul.widgets-chooser-sidebars{margin:0;list-style-type:none;max-height:300px;overflow:auto}.widgets-chooser{display:none}.widgets-chooser ul{border:1px solid #ccc}.widgets-chooser li{border-bottom:1px solid #ccc;background:#fff;margin:0;position:relative}.widgets-chooser .widgets-chooser-button{width:100%;padding:10px 35px 10px 15px;background:0 0;border:0;box-sizing:border-box;text-align:right;cursor:pointer;transition:background .2s ease-in-out}.widgets-chooser .widgets-chooser-button:focus,.widgets-chooser .widgets-chooser-button:hover{outline:0;text-decoration:underline}.widgets-chooser li:last-child{border:none}.widgets-chooser .widgets-chooser-selected .widgets-chooser-button{background:#0073aa;color:#fff}.widgets-chooser .widgets-chooser-selected:before{content:"\f147";display:block;-webkit-font-smoothing:antialiased;font:normal 26px/1 dashicons;color:#fff;position:absolute;top:7px;right:5px}.widgets-chooser .widgets-chooser-actions{padding:10px 0 12px 0;text-align:center}#available-widgets .widget .widget-top{cursor:pointer}#available-widgets .widget.ui-draggable-dragging .widget-top{cursor:move}.text-widget-fields{position:relative}.text-widget-fields [hidden]{display:none}.text-widget-fields .wp-pointer.wp-pointer-top{position:absolute;z-index:3;top:100px;left:10px;right:10px}.text-widget-fields .wp-pointer .wp-pointer-arrow{right:auto;left:15px}.text-widget-fields .wp-pointer .wp-pointer-buttons{line-height:1.4}.custom-html-widget-fields>p>.CodeMirror{border:1px solid #e5e5e5}.custom-html-widget-fields code{padding-top:1px;padding-bottom:1px}ul.CodeMirror-hints{z-index:101}.widget-control-actions .custom-html-widget-save-button.button.validation-blocked{cursor:not-allowed}@media screen and (max-width:480px){div.widget-liquid-left{width:100%;float:none;border-left:none;padding-left:0}#widgets-left .sidebar-name{margin-left:0}#widgets-left #available-widgets .widget-top{margin-left:0}#widgets-left .inactive-sidebar .widgets-sortables{margin-left:0}div.widget-liquid-right{width:100%;float:none}div.widget{margin:0 auto!important;max-width:480px}.widget-access-link{float:none;margin:15px 0 0 0}}@media screen and (max-width:320px){div.widget{max-width:320px}}@media only screen and (min-width:1250px){#widgets-left #available-widgets .widget{width:49%;float:right}.widget.ui-draggable-dragging{min-width:49%}#widgets-left #available-widgets .widget:nth-child(even){float:left}#widgets-right .sidebars-column-1,#widgets-right .sidebars-column-2{float:right;width:49%}#widgets-right .sidebars-column-1{margin-left:2%}#widgets-right.single-sidebar .sidebars-column-1,#widgets-right.single-sidebar .sidebars-column-2{float:none;width:100%;margin:0}} \ No newline at end of file
diff --git a/www/crm/wp-admin/css/widgets.css b/www/crm/wp-admin/css/widgets.css
new file mode 100644
index 00000000..8f365cf4
--- /dev/null
+++ b/www/crm/wp-admin/css/widgets.css
@@ -0,0 +1,851 @@
+/* General Widgets Styles */
+
+.widget {
+ margin: 0 auto 10px;
+ position: relative;
+ box-sizing: border-box;
+}
+
+.widget-top {
+ font-size: 13px;
+ font-weight: 600;
+ background: #f7f7f7;
+}
+
+.widget-top .widget-action {
+ border: 0;
+ margin: 0;
+ padding: 10px;
+ background: none;
+ cursor: pointer;
+ outline: none;
+}
+
+.widget-title h3,
+.widget-title h4 {
+ margin: 0;
+ padding: 15px;
+ font-size: 1em;
+ line-height: 1;
+ overflow: hidden;
+ white-space: nowrap;
+ text-overflow: ellipsis;
+ -webkit-user-select: none;
+ -moz-user-select: none;
+ -ms-user-select: none;
+ user-select: none;
+}
+
+.widgets-holder-wrap .widget-inside {
+ border-top: none;
+ padding: 1px 15px 15px 15px;
+ line-height: 1.2;
+}
+
+.widget.widget-dirty .widget-control-close-wrapper {
+ display: none;
+}
+
+.in-widget-title,
+#widgets-right a.widget-control-edit,
+#available-widgets .widget-description {
+ color: #666;
+}
+
+.deleting .widget-title,
+.deleting .widget-top .widget-action .toggle-indicator:before {
+ color: #a0a5aa;
+}
+
+/* Media Widgets */
+.wp-core-ui .media-widget-control.selected .placeholder,
+.wp-core-ui .media-widget-control.selected .not-selected,
+.wp-core-ui .media-widget-control .selected {
+ display: none;
+}
+
+.media-widget-control.selected .selected {
+ display: inline-block;
+}
+
+.media-widget-buttons {
+ text-align: left;
+ margin-top: 0;
+}
+
+.media-widget-control .media-widget-buttons .button {
+ width: auto;
+ height: auto;
+ margin-top: 12px;
+ white-space: normal;
+}
+
+.media-widget-buttons .button:first-child {
+ margin-right: 8px;
+}
+
+.media-widget-control .attachment-media-view .button-add-media,
+.media-widget-control .placeholder {
+ border: 1px dashed #b4b9be;
+ box-sizing: border-box;
+ cursor: pointer;
+ line-height: 1.6;
+ padding: 9px 0;
+ position: relative;
+ text-align: center;
+ width: 100%;
+}
+
+.media-widget-control .attachment-media-view .button-add-media {
+ cursor: pointer;
+ background-color: #edeff0;
+ color: #32373c;
+}
+
+.media-widget-control .attachment-media-view .button-add-media:hover {
+ background-color: #fbfbfc;
+}
+
+.media-widget-control .attachment-media-view .button-add-media:focus {
+ background-color: #fbfbfc;
+ border-style: solid;
+ border-color: #5b9dd9;
+ box-shadow: 0 0 3px rgba( 0, 115, 170, .8 );
+ /* Only visible in Windows High Contrast mode */
+ outline: 2px solid transparent;
+ outline-offset: -2px;
+}
+
+.media-widget-control .media-widget-preview {
+ background: transparent;
+ text-align: center;
+}
+.media-widget-control .media-widget-preview .notice {
+ text-align: initial;
+}
+.media-frame .media-widget-embed-notice p code,
+.media-widget-control .notice p code {
+ padding: 0 3px 0 0;
+}
+.media-frame .media-widget-embed-notice {
+ margin-top: 16px;
+}
+.media-widget-control .media-widget-preview img {
+ max-width: 100%;
+ vertical-align: middle;
+}
+.media-widget-control .media-widget-preview .wp-video-shortcode {
+ background: #000;
+}
+
+.media-frame.media-widget .media-toolbar-secondary {
+ min-width: 300px;
+}
+
+.media-frame.media-widget .image-details .embed-media-settings .setting.align,
+.media-frame.media-widget .attachment-display-settings .setting.align,
+.media-frame.media-widget .embed-media-settings .setting.align,
+.media-frame.media-widget .embed-link-settings .setting.link-text,
+.media-frame.media-widget .replace-attachment,
+.media-frame.media-widget .checkbox-setting.autoplay {
+ display: none;
+}
+
+.media-widget-video-preview {
+ width: 100%;
+}
+
+.media-widget-video-link {
+ display: inline-block;
+ min-height: 132px;
+ width: 100%;
+ background: black;
+}
+
+.media-widget-video-link .dashicons {
+ font: normal 60px/1 'dashicons';
+ position: relative;
+ width: 100%;
+ top: -90px;
+ color: white;
+ text-decoration: none;
+}
+
+.media-widget-video-link.no-poster .dashicons {
+ top: 30px;
+}
+
+.media-frame #embed-url-field.invalid,
+.media-widget-image-link > .link:invalid {
+ border: 1px solid #dc3232;
+}
+
+.media-widget-image-link {
+ margin: 1em 0;
+}
+
+.media-widget-gallery-preview {
+ display: flex;
+ justify-content: flex-start;
+ flex-wrap: wrap;
+ margin: -1.79104477%;
+}
+
+.media-widget-preview.media_gallery,
+.media-widget-preview.media_image {
+ cursor: pointer;
+}
+
+.media-widget-preview .placeholder {
+ background: #f1f1f1;
+}
+
+.media-widget-gallery-preview .gallery-item {
+ box-sizing: border-box;
+ width: 50%;
+ margin: 0;
+ background: transparent;
+}
+
+.media-widget-gallery-preview .gallery-item .gallery-icon {
+ margin: 4.5%;
+}
+
+/*
+ * Use targeted nth-last-child selectors to control the size of each image
+ * based on how many gallery items are present in the grid.
+ * See: https://alistapart.com/article/quantity-queries-for-css
+ */
+.media-widget-gallery-preview .gallery-item:nth-last-child(3):first-child,
+.media-widget-gallery-preview .gallery-item:nth-last-child(3):first-child ~ .gallery-item,
+.media-widget-gallery-preview .gallery-item:nth-last-child(n+5),
+.media-widget-gallery-preview .gallery-item:nth-last-child(n+5) ~ .gallery-item,
+.media-widget-gallery-preview .gallery-item:nth-last-child(n+6),
+.media-widget-gallery-preview .gallery-item:nth-last-child(n+6) ~ .gallery-item {
+ max-width: 33.33%;
+}
+
+.media-widget-gallery-preview .gallery-item img {
+ height: auto;
+ vertical-align: bottom;
+}
+
+.media-widget-gallery-preview .gallery-icon {
+ position: relative;
+}
+
+.media-widget-gallery-preview .gallery-icon-placeholder {
+ position: absolute;
+ top: 0;
+ bottom: 0;
+ width: 100%;
+ box-sizing: border-box;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ background-color: rgba(0, 0, 0, 0.5);
+}
+
+.media-widget-gallery-preview .gallery-icon-placeholder-text {
+ font-weight: 600;
+ font-size: 2em;
+ color: white;
+}
+
+
+/* Widget Dragging Helpers */
+.widget.ui-draggable-dragging {
+ min-width: 100%;
+}
+
+.widget.ui-sortable-helper {
+ opacity: 0.8;
+}
+
+.widget-placeholder {
+ border: 1px dashed #b4b9be;
+ margin: 0 auto 10px;
+ height: 45px;
+ width: 100%;
+ box-sizing: border-box;
+}
+
+#widgets-right .widget-placeholder {
+ margin-top: 0;
+}
+
+#widgets-right .closed .widget-placeholder {
+ height: 0;
+ border: 0;
+ margin-top: -10px;
+}
+
+/* Widget Sidebars */
+.sidebar-name {
+ position: relative;
+ box-sizing: border-box;
+}
+
+.js .sidebar-name {
+ cursor: pointer;
+}
+
+.sidebar-name .handlediv {
+ float: right;
+ width: 38px;
+ height: 38px;
+ border: 0;
+ margin: 0;
+ padding: 8px;
+ background: none;
+ cursor: pointer;
+ outline: none;
+}
+
+#widgets-right .sidebar-name .handlediv {
+ margin: 5px 3px 0 0;
+}
+
+.sidebar-name .handlediv:focus {
+ box-shadow: none;
+ outline: none;
+}
+
+#widgets-left .sidebar-name .toggle-indicator {
+ display: none;
+}
+
+#widgets-left .widgets-holder-wrap.closed .sidebar-name .toggle-indicator,
+#widgets-left .sidebar-name:hover .toggle-indicator,
+#widgets-left .sidebar-name .handlediv:focus .toggle-indicator {
+ display: block;
+}
+
+.sidebar-name .toggle-indicator:before {
+ padding: 1px 2px 1px 0;
+ border-radius: 50%;
+}
+
+.sidebar-name .handlediv:focus .toggle-indicator:before {
+ box-shadow:
+ 0 0 0 1px #5b9dd9,
+ 0 0 2px 1px rgba(30, 140, 190, 0.8);
+}
+
+.sidebar-name h2,
+.sidebar-name h3 {
+ margin: 0;
+ padding: 8px 10px;
+ overflow: hidden;
+ white-space: nowrap;
+}
+
+.widgets-holder-wrap .description {
+ padding: 0 0 15px;
+ margin: 0;
+ font-style: normal;
+ color: #72777c;
+}
+
+.widget-holder .description,
+.inactive-sidebar .description {
+ color: #555d66;
+}
+
+#widgets-right .widgets-holder-wrap .description {
+ padding-left: 7px;
+ padding-right: 7px;
+}
+
+/* Widgets 2-col Layout */
+div.widget-liquid-left {
+ margin: 0;
+ width: 38%;
+ float: left;
+}
+
+div.widget-liquid-right {
+ float: right;
+ width: 58%;
+}
+
+/* Widgets Left - Available Widgets */
+
+div#widgets-left {
+ padding-top: 12px;
+}
+
+div#widgets-left .closed .sidebar-name,
+div#widgets-left .inactive-sidebar.closed .sidebar-name {
+ margin-bottom: 10px;
+}
+
+div#widgets-left .sidebar-name h2,
+div#widgets-left .sidebar-name h3 {
+ padding: 10px 0;
+ margin: 0 10px 0 0;
+}
+
+#widgets-left .widgets-holder-wrap,
+div#widgets-left .widget-holder {
+ background: transparent;
+ border: none;
+}
+
+#widgets-left .widgets-holder-wrap {
+ border: none;
+ box-shadow: none;
+}
+
+#available-widgets .widget {
+ margin: 0;
+}
+
+#available-widgets .widget:nth-child(odd) {
+ clear: both;
+}
+
+#available-widgets .widget .widget-description {
+ display: block;
+ padding: 10px 15px;
+ font-size: 12px;
+ overflow-wrap: break-word;
+ word-wrap: break-word;
+ -ms-word-break: break-all;
+ word-break: break-word;
+ -ms-hyphens: auto;
+ -webkit-hyphens: auto;
+ hyphens: auto;
+}
+
+#available-widgets #widget-list {
+ position: relative;
+}
+
+/* Inactive Sidebars */
+#widgets-left .inactive-sidebar {
+ clear: both;
+ width: 100%;
+ background: transparent;
+ padding: 0;
+ margin: 0 0 20px 0;
+ border: none;
+ box-shadow: none;
+}
+
+#widgets-left .inactive-sidebar.first {
+ margin-top: 40px;
+}
+
+/* Not sure what this is for... */
+div#widgets-left .inactive-sidebar .widget.expanded {
+ left: auto;
+}
+
+.widget-title-action {
+ float: right;
+ position: relative;
+}
+
+div#widgets-left .inactive-sidebar .widgets-sortables {
+ min-height: 42px;
+ padding: 0;
+ background: transparent;
+ margin: 0;
+ position: relative;
+}
+
+/* Widgets Right */
+
+div#widgets-right .sidebars-column-1,
+div#widgets-right .sidebars-column-2 {
+ max-width: 450px;
+}
+
+div#widgets-right .widgets-holder-wrap {
+ margin: 10px 0 0 0;
+}
+
+div#widgets-right .sidebar-description {
+ min-height: 20px;
+ margin-top: -5px;
+}
+
+div#widgets-right .sidebar-name h2,
+div#widgets-right .sidebar-name h3 {
+ padding: 15px 7px;
+}
+
+div#widgets-right .widget-top {
+ padding: 0;
+}
+
+div#widgets-right .widgets-sortables {
+ padding: 0 8px;
+ margin-bottom: 9px;
+ position: relative;
+ min-height: 123px;
+}
+
+div#widgets-right .closed .widgets-sortables {
+ min-height: 0;
+ margin-bottom: 0;
+}
+
+.sidebar-name .spinner,
+.remove-inactive-widgets .spinner {
+ float: none;
+ position: relative;
+ top: -2px;
+ margin: -5px 5px;
+}
+
+/* Dragging a widget over a closed sidebar */
+#widgets-right .widgets-holder-wrap.widget-hover {
+ border-color: #72777c;
+ box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
+}
+
+/* Accessibility Mode */
+.widget-access-link {
+ float: right;
+ margin: -5px 0 10px 10px;
+}
+
+.widgets_access #widgets-left .widget .widget-top {
+ cursor: auto;
+}
+
+.widgets_access #wpwrap .widgets-holder-wrap.closed .sidebar-description,
+.widgets_access #wpwrap .widgets-holder-wrap.closed .widget,
+.widgets_access #wpwrap .widget-control-edit {
+ display: block;
+}
+
+.widgets_access #widgets-left .widget .widget-top:hover,
+.widgets_access #widgets-right .widget .widget-top:hover {
+ border-color: #ddd;
+}
+
+#available-widgets .widget-control-edit .edit,
+#available-widgets .widget-action .edit,
+#widgets-left .inactive-sidebar .widget-control-edit .add,
+#widgets-left .inactive-sidebar .widget-action .add,
+#widgets-right .widget-control-edit .add,
+#widgets-right .widget-action .add {
+ display: none;
+}
+
+.widget-control-edit {
+ display: block;
+ color: #666;
+ background: #EEE;
+ padding: 0 15px;
+ line-height: 3.35;
+ border-left: 1px solid #DDD;
+}
+
+#widgets-left .widget-control-edit:hover,
+#widgets-right .widget-control-edit:hover {
+ color: #fff;
+ background: #444;
+ border-left: 0;
+ outline: 1px solid #444;
+}
+
+.widgets-holder-wrap .sidebar-name,
+.widgets-holder-wrap .sidebar-description {
+ -webkit-user-select: none;
+ -moz-user-select: none;
+ -ms-user-select: none;
+ user-select: none;
+}
+
+.editwidget {
+ margin: 0 auto;
+}
+
+.editwidget .widget-inside {
+ display: block;
+ padding: 0 15px;
+}
+
+.editwidget .widget-control-actions {
+ margin-top: 20px;
+}
+
+.js .widgets-holder-wrap.closed .widget,
+.js .widgets-holder-wrap.closed .sidebar-description,
+.js .widgets-holder-wrap.closed .remove-inactive-widgets,
+.js .widgets-holder-wrap.closed .description,
+.js .closed br.clear {
+ display: none;
+}
+
+.js .widgets-holder-wrap.closed .widget.ui-sortable-helper {
+ display: block;
+}
+
+/* Hide Widget Settings by Default */
+.widget-inside,
+.widget-description {
+ display: none;
+}
+
+.widget-inside {
+ background: #fff;
+}
+
+/* Dragging widgets over the available widget area show's a "Deactivate" message */
+#removing-widget {
+ display: none;
+ font-weight: 400;
+ padding-left: 15px;
+ font-size: 12px;
+ line-height: 1;
+ color: black;
+}
+
+.js #removing-widget {
+ color: #00a0d2;
+}
+
+.widget-control-noform,
+#access-off,
+.widgets_access .widget-action,
+.widgets_access .handlediv,
+.widgets_access #access-on,
+.widgets_access .widget-holder .description,
+.no-js .widget-holder .description {
+ display: none;
+}
+
+.widgets_access .widget-holder,
+.widgets_access #widget-list {
+ padding-top: 10px;
+}
+
+.widgets_access #access-off {
+ display: inline;
+}
+
+.widgets_access .sidebar-name,
+.widgets_access .widget .widget-top {
+ cursor: default;
+}
+
+
+/* Widgets Area Chooser */
+.widget-liquid-left #widgets-left.chooser #available-widgets .widget,
+.widget-liquid-left #widgets-left.chooser .inactive-sidebar {
+ transition: opacity 0.1s linear;
+}
+
+.widget-liquid-left #widgets-left.chooser #available-widgets .widget,
+.widget-liquid-left #widgets-left.chooser .inactive-sidebar {
+ /* -webkit-filter: blur(1px); */
+ opacity: 0.2;
+ pointer-events: none;
+}
+
+.widget-liquid-left #widgets-left.chooser #available-widgets .widget-in-question {
+ /* -webkit-filter: none; */
+ opacity: 1;
+ pointer-events: auto;
+}
+
+.widgets-chooser ul,
+#widgets-left .widget-in-question .widget-top,
+#available-widgets .widget-top:hover,
+div#widgets-right .widget-top:hover,
+#widgets-left .widget-top:hover {
+ border-color: #999;
+ box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
+}
+
+.widgets-chooser ul.widgets-chooser-sidebars {
+ margin: 0;
+ list-style-type: none;
+ max-height: 300px;
+ overflow: auto;
+}
+
+.widgets-chooser {
+ display: none;
+}
+
+.widgets-chooser ul {
+ border: 1px solid #ccc;
+}
+
+.widgets-chooser li {
+ border-bottom: 1px solid #ccc;
+ background: #fff;
+ margin: 0;
+ position: relative;
+}
+
+.widgets-chooser .widgets-chooser-button {
+ width: 100%;
+ padding: 10px 15px 10px 35px;
+ background: transparent;
+ border: 0;
+ box-sizing: border-box;
+ text-align: left;
+ cursor: pointer;
+ transition: background 0.2s ease-in-out;
+}
+
+/* @todo looks like these hover/focus states are overridden by .widgets-chooser-selected */
+.widgets-chooser .widgets-chooser-button:hover,
+.widgets-chooser .widgets-chooser-button:focus {
+ outline: none;
+ text-decoration: underline;
+}
+
+.widgets-chooser li:last-child {
+ border: none;
+}
+
+.widgets-chooser .widgets-chooser-selected .widgets-chooser-button {
+ background: #0073aa;
+ color: #fff;
+}
+
+.widgets-chooser .widgets-chooser-selected:before {
+ content: "\f147";
+ display: block;
+ -webkit-font-smoothing: antialiased;
+ font: normal 26px/1 dashicons;
+ color: #fff;
+ position: absolute;
+ top: 7px;
+ left: 5px;
+}
+
+.widgets-chooser .widgets-chooser-actions {
+ padding: 10px 0 12px 0;
+ text-align: center;
+}
+
+#available-widgets .widget .widget-top {
+ cursor: pointer;
+}
+
+#available-widgets .widget.ui-draggable-dragging .widget-top {
+ cursor: move;
+}
+
+/* =Specific widget styling
+-------------------------------------------------------------- */
+.text-widget-fields {
+ position: relative;
+}
+.text-widget-fields [hidden] {
+ display: none;
+}
+.text-widget-fields .wp-pointer.wp-pointer-top {
+ position: absolute;
+ z-index: 3;
+ top: 100px;
+ right: 10px;
+ left: 10px;
+}
+.text-widget-fields .wp-pointer .wp-pointer-arrow {
+ left: auto;
+ right: 15px;
+}
+.text-widget-fields .wp-pointer .wp-pointer-buttons {
+ line-height: 1.4;
+}
+
+.custom-html-widget-fields > p > .CodeMirror {
+ border: 1px solid #e5e5e5;
+}
+.custom-html-widget-fields code {
+ padding-top: 1px;
+ padding-bottom: 1px;
+}
+ul.CodeMirror-hints {
+ z-index: 101; /* Due to z-index 100 set on .widget.open */
+}
+.widget-control-actions .custom-html-widget-save-button.button.validation-blocked {
+ cursor: not-allowed;
+}
+
+/* =Media Queries
+-------------------------------------------------------------- */
+
+@media screen and (max-width: 480px) {
+ div.widget-liquid-left {
+ width: 100%;
+ float: none;
+ border-right: none;
+ padding-right: 0;
+ }
+
+ #widgets-left .sidebar-name {
+ margin-right: 0;
+ }
+
+ #widgets-left #available-widgets .widget-top {
+ margin-right: 0;
+ }
+
+ #widgets-left .inactive-sidebar .widgets-sortables {
+ margin-right: 0;
+ }
+
+ div.widget-liquid-right {
+ width: 100%;
+ float: none;
+ }
+
+ div.widget {
+ margin: 0 auto !important;
+ max-width: 480px;
+ }
+
+ .widget-access-link {
+ float: none;
+ margin: 15px 0 0 0;
+ }
+}
+
+@media screen and (max-width: 320px) {
+ div.widget {
+ max-width: 320px;
+ }
+}
+
+@media only screen and (min-width: 1250px) {
+ #widgets-left #available-widgets .widget {
+ width: 49%;
+ float: left;
+ }
+
+ .widget.ui-draggable-dragging {
+ min-width: 49%;
+ }
+
+ #widgets-left #available-widgets .widget:nth-child(even) {
+ float: right;
+ }
+
+ #widgets-right .sidebars-column-1,
+ #widgets-right .sidebars-column-2 {
+ float: left;
+ width: 49%;
+ }
+
+ #widgets-right .sidebars-column-1 {
+ margin-right: 2%;
+ }
+
+ #widgets-right.single-sidebar .sidebars-column-1,
+ #widgets-right.single-sidebar .sidebars-column-2 {
+ float: none;
+ width: 100%;
+ margin: 0;
+ }
+}
diff --git a/www/crm/wp-admin/css/widgets.min.css b/www/crm/wp-admin/css/widgets.min.css
new file mode 100644
index 00000000..04429a09
--- /dev/null
+++ b/www/crm/wp-admin/css/widgets.min.css
@@ -0,0 +1,2 @@
+/*! This file is auto-generated */
+.widget{margin:0 auto 10px;position:relative;box-sizing:border-box}.widget-top{font-size:13px;font-weight:600;background:#f7f7f7}.widget-top .widget-action{border:0;margin:0;padding:10px;background:0 0;cursor:pointer;outline:0}.widget-title h3,.widget-title h4{margin:0;padding:15px;font-size:1em;line-height:1;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.widgets-holder-wrap .widget-inside{border-top:none;padding:1px 15px 15px 15px;line-height:1.2}.widget.widget-dirty .widget-control-close-wrapper{display:none}#available-widgets .widget-description,#widgets-right a.widget-control-edit,.in-widget-title{color:#666}.deleting .widget-title,.deleting .widget-top .widget-action .toggle-indicator:before{color:#a0a5aa}.wp-core-ui .media-widget-control .selected,.wp-core-ui .media-widget-control.selected .not-selected,.wp-core-ui .media-widget-control.selected .placeholder{display:none}.media-widget-control.selected .selected{display:inline-block}.media-widget-buttons{text-align:left;margin-top:0}.media-widget-control .media-widget-buttons .button{width:auto;height:auto;margin-top:12px;white-space:normal}.media-widget-buttons .button:first-child{margin-right:8px}.media-widget-control .attachment-media-view .button-add-media,.media-widget-control .placeholder{border:1px dashed #b4b9be;box-sizing:border-box;cursor:pointer;line-height:1.6;padding:9px 0;position:relative;text-align:center;width:100%}.media-widget-control .attachment-media-view .button-add-media{cursor:pointer;background-color:#edeff0;color:#32373c}.media-widget-control .attachment-media-view .button-add-media:hover{background-color:#fbfbfc}.media-widget-control .attachment-media-view .button-add-media:focus{background-color:#fbfbfc;border-style:solid;border-color:#5b9dd9;box-shadow:0 0 3px rgba(0,115,170,.8);outline:2px solid transparent;outline-offset:-2px}.media-widget-control .media-widget-preview{background:0 0;text-align:center}.media-widget-control .media-widget-preview .notice{text-align:initial}.media-frame .media-widget-embed-notice p code,.media-widget-control .notice p code{padding:0 3px 0 0}.media-frame .media-widget-embed-notice{margin-top:16px}.media-widget-control .media-widget-preview img{max-width:100%;vertical-align:middle}.media-widget-control .media-widget-preview .wp-video-shortcode{background:#000}.media-frame.media-widget .media-toolbar-secondary{min-width:300px}.media-frame.media-widget .attachment-display-settings .setting.align,.media-frame.media-widget .checkbox-setting.autoplay,.media-frame.media-widget .embed-link-settings .setting.link-text,.media-frame.media-widget .embed-media-settings .setting.align,.media-frame.media-widget .image-details .embed-media-settings .setting.align,.media-frame.media-widget .replace-attachment{display:none}.media-widget-video-preview{width:100%}.media-widget-video-link{display:inline-block;min-height:132px;width:100%;background:#000}.media-widget-video-link .dashicons{font:normal 60px/1 dashicons;position:relative;width:100%;top:-90px;color:#fff;text-decoration:none}.media-widget-video-link.no-poster .dashicons{top:30px}.media-frame #embed-url-field.invalid,.media-widget-image-link>.link:invalid{border:1px solid #dc3232}.media-widget-image-link{margin:1em 0}.media-widget-gallery-preview{display:flex;justify-content:flex-start;flex-wrap:wrap;margin:-1.79104477%}.media-widget-preview.media_gallery,.media-widget-preview.media_image{cursor:pointer}.media-widget-preview .placeholder{background:#f1f1f1}.media-widget-gallery-preview .gallery-item{box-sizing:border-box;width:50%;margin:0;background:0 0}.media-widget-gallery-preview .gallery-item .gallery-icon{margin:4.5%}.media-widget-gallery-preview .gallery-item:nth-last-child(3):first-child,.media-widget-gallery-preview .gallery-item:nth-last-child(3):first-child~.gallery-item,.media-widget-gallery-preview .gallery-item:nth-last-child(n+5),.media-widget-gallery-preview .gallery-item:nth-last-child(n+5)~.gallery-item,.media-widget-gallery-preview .gallery-item:nth-last-child(n+6),.media-widget-gallery-preview .gallery-item:nth-last-child(n+6)~.gallery-item{max-width:33.33%}.media-widget-gallery-preview .gallery-item img{height:auto;vertical-align:bottom}.media-widget-gallery-preview .gallery-icon{position:relative}.media-widget-gallery-preview .gallery-icon-placeholder{position:absolute;top:0;bottom:0;width:100%;box-sizing:border-box;display:flex;align-items:center;justify-content:center;background-color:rgba(0,0,0,.5)}.media-widget-gallery-preview .gallery-icon-placeholder-text{font-weight:600;font-size:2em;color:#fff}.widget.ui-draggable-dragging{min-width:100%}.widget.ui-sortable-helper{opacity:.8}.widget-placeholder{border:1px dashed #b4b9be;margin:0 auto 10px;height:45px;width:100%;box-sizing:border-box}#widgets-right .widget-placeholder{margin-top:0}#widgets-right .closed .widget-placeholder{height:0;border:0;margin-top:-10px}.sidebar-name{position:relative;box-sizing:border-box}.js .sidebar-name{cursor:pointer}.sidebar-name .handlediv{float:right;width:38px;height:38px;border:0;margin:0;padding:8px;background:0 0;cursor:pointer;outline:0}#widgets-right .sidebar-name .handlediv{margin:5px 3px 0 0}.sidebar-name .handlediv:focus{box-shadow:none;outline:0}#widgets-left .sidebar-name .toggle-indicator{display:none}#widgets-left .sidebar-name .handlediv:focus .toggle-indicator,#widgets-left .sidebar-name:hover .toggle-indicator,#widgets-left .widgets-holder-wrap.closed .sidebar-name .toggle-indicator{display:block}.sidebar-name .toggle-indicator:before{padding:1px 2px 1px 0;border-radius:50%}.sidebar-name .handlediv:focus .toggle-indicator:before{box-shadow:0 0 0 1px #5b9dd9,0 0 2px 1px rgba(30,140,190,.8)}.sidebar-name h2,.sidebar-name h3{margin:0;padding:8px 10px;overflow:hidden;white-space:nowrap}.widgets-holder-wrap .description{padding:0 0 15px;margin:0;font-style:normal;color:#72777c}.inactive-sidebar .description,.widget-holder .description{color:#555d66}#widgets-right .widgets-holder-wrap .description{padding-left:7px;padding-right:7px}div.widget-liquid-left{margin:0;width:38%;float:left}div.widget-liquid-right{float:right;width:58%}div#widgets-left{padding-top:12px}div#widgets-left .closed .sidebar-name,div#widgets-left .inactive-sidebar.closed .sidebar-name{margin-bottom:10px}div#widgets-left .sidebar-name h2,div#widgets-left .sidebar-name h3{padding:10px 0;margin:0 10px 0 0}#widgets-left .widgets-holder-wrap,div#widgets-left .widget-holder{background:0 0;border:none}#widgets-left .widgets-holder-wrap{border:none;box-shadow:none}#available-widgets .widget{margin:0}#available-widgets .widget:nth-child(odd){clear:both}#available-widgets .widget .widget-description{display:block;padding:10px 15px;font-size:12px;overflow-wrap:break-word;word-wrap:break-word;-ms-word-break:break-all;word-break:break-word;-ms-hyphens:auto;-webkit-hyphens:auto;hyphens:auto}#available-widgets #widget-list{position:relative}#widgets-left .inactive-sidebar{clear:both;width:100%;background:0 0;padding:0;margin:0 0 20px 0;border:none;box-shadow:none}#widgets-left .inactive-sidebar.first{margin-top:40px}div#widgets-left .inactive-sidebar .widget.expanded{left:auto}.widget-title-action{float:right;position:relative}div#widgets-left .inactive-sidebar .widgets-sortables{min-height:42px;padding:0;background:0 0;margin:0;position:relative}div#widgets-right .sidebars-column-1,div#widgets-right .sidebars-column-2{max-width:450px}div#widgets-right .widgets-holder-wrap{margin:10px 0 0 0}div#widgets-right .sidebar-description{min-height:20px;margin-top:-5px}div#widgets-right .sidebar-name h2,div#widgets-right .sidebar-name h3{padding:15px 7px}div#widgets-right .widget-top{padding:0}div#widgets-right .widgets-sortables{padding:0 8px;margin-bottom:9px;position:relative;min-height:123px}div#widgets-right .closed .widgets-sortables{min-height:0;margin-bottom:0}.remove-inactive-widgets .spinner,.sidebar-name .spinner{float:none;position:relative;top:-2px;margin:-5px 5px}#widgets-right .widgets-holder-wrap.widget-hover{border-color:#72777c;box-shadow:0 1px 2px rgba(0,0,0,.3)}.widget-access-link{float:right;margin:-5px 0 10px 10px}.widgets_access #widgets-left .widget .widget-top{cursor:auto}.widgets_access #wpwrap .widget-control-edit,.widgets_access #wpwrap .widgets-holder-wrap.closed .sidebar-description,.widgets_access #wpwrap .widgets-holder-wrap.closed .widget{display:block}.widgets_access #widgets-left .widget .widget-top:hover,.widgets_access #widgets-right .widget .widget-top:hover{border-color:#ddd}#available-widgets .widget-action .edit,#available-widgets .widget-control-edit .edit,#widgets-left .inactive-sidebar .widget-action .add,#widgets-left .inactive-sidebar .widget-control-edit .add,#widgets-right .widget-action .add,#widgets-right .widget-control-edit .add{display:none}.widget-control-edit{display:block;color:#666;background:#eee;padding:0 15px;line-height:3.35;border-left:1px solid #ddd}#widgets-left .widget-control-edit:hover,#widgets-right .widget-control-edit:hover{color:#fff;background:#444;border-left:0;outline:1px solid #444}.widgets-holder-wrap .sidebar-description,.widgets-holder-wrap .sidebar-name{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.editwidget{margin:0 auto}.editwidget .widget-inside{display:block;padding:0 15px}.editwidget .widget-control-actions{margin-top:20px}.js .closed br.clear,.js .widgets-holder-wrap.closed .description,.js .widgets-holder-wrap.closed .remove-inactive-widgets,.js .widgets-holder-wrap.closed .sidebar-description,.js .widgets-holder-wrap.closed .widget{display:none}.js .widgets-holder-wrap.closed .widget.ui-sortable-helper{display:block}.widget-description,.widget-inside{display:none}.widget-inside{background:#fff}#removing-widget{display:none;font-weight:400;padding-left:15px;font-size:12px;line-height:1;color:#000}.js #removing-widget{color:#00a0d2}#access-off,.no-js .widget-holder .description,.widget-control-noform,.widgets_access #access-on,.widgets_access .handlediv,.widgets_access .widget-action,.widgets_access .widget-holder .description{display:none}.widgets_access #widget-list,.widgets_access .widget-holder{padding-top:10px}.widgets_access #access-off{display:inline}.widgets_access .sidebar-name,.widgets_access .widget .widget-top{cursor:default}.widget-liquid-left #widgets-left.chooser #available-widgets .widget,.widget-liquid-left #widgets-left.chooser .inactive-sidebar{transition:opacity .1s linear}.widget-liquid-left #widgets-left.chooser #available-widgets .widget,.widget-liquid-left #widgets-left.chooser .inactive-sidebar{opacity:.2;pointer-events:none}.widget-liquid-left #widgets-left.chooser #available-widgets .widget-in-question{opacity:1;pointer-events:auto}#available-widgets .widget-top:hover,#widgets-left .widget-in-question .widget-top,#widgets-left .widget-top:hover,.widgets-chooser ul,div#widgets-right .widget-top:hover{border-color:#999;box-shadow:0 1px 2px rgba(0,0,0,.1)}.widgets-chooser ul.widgets-chooser-sidebars{margin:0;list-style-type:none;max-height:300px;overflow:auto}.widgets-chooser{display:none}.widgets-chooser ul{border:1px solid #ccc}.widgets-chooser li{border-bottom:1px solid #ccc;background:#fff;margin:0;position:relative}.widgets-chooser .widgets-chooser-button{width:100%;padding:10px 15px 10px 35px;background:0 0;border:0;box-sizing:border-box;text-align:left;cursor:pointer;transition:background .2s ease-in-out}.widgets-chooser .widgets-chooser-button:focus,.widgets-chooser .widgets-chooser-button:hover{outline:0;text-decoration:underline}.widgets-chooser li:last-child{border:none}.widgets-chooser .widgets-chooser-selected .widgets-chooser-button{background:#0073aa;color:#fff}.widgets-chooser .widgets-chooser-selected:before{content:"\f147";display:block;-webkit-font-smoothing:antialiased;font:normal 26px/1 dashicons;color:#fff;position:absolute;top:7px;left:5px}.widgets-chooser .widgets-chooser-actions{padding:10px 0 12px 0;text-align:center}#available-widgets .widget .widget-top{cursor:pointer}#available-widgets .widget.ui-draggable-dragging .widget-top{cursor:move}.text-widget-fields{position:relative}.text-widget-fields [hidden]{display:none}.text-widget-fields .wp-pointer.wp-pointer-top{position:absolute;z-index:3;top:100px;right:10px;left:10px}.text-widget-fields .wp-pointer .wp-pointer-arrow{left:auto;right:15px}.text-widget-fields .wp-pointer .wp-pointer-buttons{line-height:1.4}.custom-html-widget-fields>p>.CodeMirror{border:1px solid #e5e5e5}.custom-html-widget-fields code{padding-top:1px;padding-bottom:1px}ul.CodeMirror-hints{z-index:101}.widget-control-actions .custom-html-widget-save-button.button.validation-blocked{cursor:not-allowed}@media screen and (max-width:480px){div.widget-liquid-left{width:100%;float:none;border-right:none;padding-right:0}#widgets-left .sidebar-name{margin-right:0}#widgets-left #available-widgets .widget-top{margin-right:0}#widgets-left .inactive-sidebar .widgets-sortables{margin-right:0}div.widget-liquid-right{width:100%;float:none}div.widget{margin:0 auto!important;max-width:480px}.widget-access-link{float:none;margin:15px 0 0 0}}@media screen and (max-width:320px){div.widget{max-width:320px}}@media only screen and (min-width:1250px){#widgets-left #available-widgets .widget{width:49%;float:left}.widget.ui-draggable-dragging{min-width:49%}#widgets-left #available-widgets .widget:nth-child(even){float:right}#widgets-right .sidebars-column-1,#widgets-right .sidebars-column-2{float:left;width:49%}#widgets-right .sidebars-column-1{margin-right:2%}#widgets-right.single-sidebar .sidebars-column-1,#widgets-right.single-sidebar .sidebars-column-2{float:none;width:100%;margin:0}} \ No newline at end of file
diff --git a/www/crm/wp-admin/css/wp-admin-rtl.css b/www/crm/wp-admin/css/wp-admin-rtl.css
new file mode 100644
index 00000000..207a8c85
--- /dev/null
+++ b/www/crm/wp-admin/css/wp-admin-rtl.css
@@ -0,0 +1,15 @@
+@import url(common-rtl.css);
+@import url(forms-rtl.css);
+@import url(admin-menu-rtl.css);
+@import url(dashboard-rtl.css);
+@import url(list-tables-rtl.css);
+@import url(edit-rtl.css);
+@import url(revisions-rtl.css);
+@import url(media-rtl.css);
+@import url(themes-rtl.css);
+@import url(about-rtl.css);
+@import url(nav-menus-rtl.css);
+@import url(widgets-rtl.css);
+@import url(site-icon-rtl.css);
+@import url(l10n-rtl.css);
+@import url(site-health-rtl.css);
diff --git a/www/crm/wp-admin/css/wp-admin-rtl.min.css b/www/crm/wp-admin/css/wp-admin-rtl.min.css
new file mode 100644
index 00000000..110850bb
--- /dev/null
+++ b/www/crm/wp-admin/css/wp-admin-rtl.min.css
@@ -0,0 +1,16 @@
+/*! This file is auto-generated */
+@import url(common-rtl.min.css);
+@import url(forms-rtl.min.css);
+@import url(admin-menu-rtl.min.css);
+@import url(dashboard-rtl.min.css);
+@import url(list-tables-rtl.min.css);
+@import url(edit-rtl.min.css);
+@import url(revisions-rtl.min.css);
+@import url(media-rtl.min.css);
+@import url(themes-rtl.min.css);
+@import url(about-rtl.min.css);
+@import url(nav-menus-rtl.min.css);
+@import url(widgets-rtl.min.css);
+@import url(site-icon-rtl.min.css);
+@import url(l10n-rtl.min.css);
+@import url(site-health-rtl.min.css);
diff --git a/www/crm/wp-admin/css/wp-admin.css b/www/crm/wp-admin/css/wp-admin.css
new file mode 100644
index 00000000..b475cf0a
--- /dev/null
+++ b/www/crm/wp-admin/css/wp-admin.css
@@ -0,0 +1,15 @@
+@import url(common.css);
+@import url(forms.css);
+@import url(admin-menu.css);
+@import url(dashboard.css);
+@import url(list-tables.css);
+@import url(edit.css);
+@import url(revisions.css);
+@import url(media.css);
+@import url(themes.css);
+@import url(about.css);
+@import url(nav-menus.css);
+@import url(widgets.css);
+@import url(site-icon.css);
+@import url(l10n.css);
+@import url(site-health.css);
diff --git a/www/crm/wp-admin/css/wp-admin.min.css b/www/crm/wp-admin/css/wp-admin.min.css
new file mode 100644
index 00000000..2fdbba50
--- /dev/null
+++ b/www/crm/wp-admin/css/wp-admin.min.css
@@ -0,0 +1,16 @@
+/*! This file is auto-generated */
+@import url(common.min.css);
+@import url(forms.min.css);
+@import url(admin-menu.min.css);
+@import url(dashboard.min.css);
+@import url(list-tables.min.css);
+@import url(edit.min.css);
+@import url(revisions.min.css);
+@import url(media.min.css);
+@import url(themes.min.css);
+@import url(about.min.css);
+@import url(nav-menus.min.css);
+@import url(widgets.min.css);
+@import url(site-icon.min.css);
+@import url(l10n.min.css);
+@import url(site-health.min.css);
diff --git a/www/crm/wp-admin/custom-background.php b/www/crm/wp-admin/custom-background.php
new file mode 100644
index 00000000..1975b10b
--- /dev/null
+++ b/www/crm/wp-admin/custom-background.php
@@ -0,0 +1,605 @@
+<?php
+/**
+ * The custom background script.
+ *
+ * @package WordPress
+ * @subpackage Administration
+ */
+
+/**
+ * The custom background class.
+ *
+ * @since 3.0.0
+ */
+class Custom_Background {
+
+ /**
+ * Callback for administration header.
+ *
+ * @var callable
+ * @since 3.0.0
+ */
+ public $admin_header_callback;
+
+ /**
+ * Callback for header div.
+ *
+ * @var callable
+ * @since 3.0.0
+ */
+ public $admin_image_div_callback;
+
+ /**
+ * Used to trigger a success message when settings updated and set to true.
+ *
+ * @since 3.0.0
+ * @var bool
+ */
+ private $updated;
+
+ /**
+ * Constructor - Register administration header callback.
+ *
+ * @since 3.0.0
+ * @param callable $admin_header_callback
+ * @param callable $admin_image_div_callback Optional custom image div output callback.
+ */
+ public function __construct( $admin_header_callback = '', $admin_image_div_callback = '' ) {
+ $this->admin_header_callback = $admin_header_callback;
+ $this->admin_image_div_callback = $admin_image_div_callback;
+
+ add_action( 'admin_menu', array( $this, 'init' ) );
+
+ add_action( 'wp_ajax_custom-background-add', array( $this, 'ajax_background_add' ) );
+
+ // Unused since 3.5.0.
+ add_action( 'wp_ajax_set-background-image', array( $this, 'wp_set_background_image' ) );
+ }
+
+ /**
+ * Set up the hooks for the Custom Background admin page.
+ *
+ * @since 3.0.0
+ */
+ public function init() {
+ $page = add_theme_page( __( 'Background' ), __( 'Background' ), 'edit_theme_options', 'custom-background', array( $this, 'admin_page' ) );
+ if ( ! $page ) {
+ return;
+ }
+
+ add_action( "load-$page", array( $this, 'admin_load' ) );
+ add_action( "load-$page", array( $this, 'take_action' ), 49 );
+ add_action( "load-$page", array( $this, 'handle_upload' ), 49 );
+
+ if ( $this->admin_header_callback ) {
+ add_action( "admin_head-$page", $this->admin_header_callback, 51 );
+ }
+ }
+
+ /**
+ * Set up the enqueue for the CSS & JavaScript files.
+ *
+ * @since 3.0.0
+ */
+ public function admin_load() {
+ get_current_screen()->add_help_tab(
+ array(
+ 'id' => 'overview',
+ 'title' => __( 'Overview' ),
+ 'content' =>
+ '<p>' . __( 'You can customize the look of your site without touching any of your theme&#8217;s code by using a custom background. Your background can be an image or a color.' ) . '</p>' .
+ '<p>' . __( 'To use a background image, simply upload it or choose an image that has already been uploaded to your Media Library by clicking the &#8220;Choose Image&#8221; button. You can display a single instance of your image, or tile it to fill the screen. You can have your background fixed in place, so your site content moves on top of it, or you can have it scroll with your site.' ) . '</p>' .
+ '<p>' . __( 'You can also choose a background color by clicking the Select Color button and either typing in a legitimate HTML hex value, e.g. &#8220;#ff0000&#8221; for red, or by choosing a color using the color picker.' ) . '</p>' .
+ '<p>' . __( 'Don&#8217;t forget to click on the Save Changes button when you are finished.' ) . '</p>',
+ )
+ );
+
+ get_current_screen()->set_help_sidebar(
+ '<p><strong>' . __( 'For more information:' ) . '</strong></p>' .
+ '<p>' . __( '<a href="https://codex.wordpress.org/Appearance_Background_Screen">Documentation on Custom Background</a>' ) . '</p>' .
+ '<p>' . __( '<a href="https://wordpress.org/support/">Support</a>' ) . '</p>'
+ );
+
+ wp_enqueue_media();
+ wp_enqueue_script( 'custom-background' );
+ wp_enqueue_style( 'wp-color-picker' );
+ }
+
+ /**
+ * Execute custom background modification.
+ *
+ * @since 3.0.0
+ */
+ public function take_action() {
+ if ( empty( $_POST ) ) {
+ return;
+ }
+
+ if ( isset( $_POST['reset-background'] ) ) {
+ check_admin_referer( 'custom-background-reset', '_wpnonce-custom-background-reset' );
+ remove_theme_mod( 'background_image' );
+ remove_theme_mod( 'background_image_thumb' );
+ $this->updated = true;
+ return;
+ }
+
+ if ( isset( $_POST['remove-background'] ) ) {
+ // @TODO: Uploaded files are not removed here.
+ check_admin_referer( 'custom-background-remove', '_wpnonce-custom-background-remove' );
+ set_theme_mod( 'background_image', '' );
+ set_theme_mod( 'background_image_thumb', '' );
+ $this->updated = true;
+ wp_safe_redirect( $_POST['_wp_http_referer'] );
+ return;
+ }
+
+ if ( isset( $_POST['background-preset'] ) ) {
+ check_admin_referer( 'custom-background' );
+
+ if ( in_array( $_POST['background-preset'], array( 'default', 'fill', 'fit', 'repeat', 'custom' ), true ) ) {
+ $preset = $_POST['background-preset'];
+ } else {
+ $preset = 'default';
+ }
+
+ set_theme_mod( 'background_preset', $preset );
+ }
+
+ if ( isset( $_POST['background-position'] ) ) {
+ check_admin_referer( 'custom-background' );
+
+ $position = explode( ' ', $_POST['background-position'] );
+
+ if ( in_array( $position[0], array( 'left', 'center', 'right' ), true ) ) {
+ $position_x = $position[0];
+ } else {
+ $position_x = 'left';
+ }
+
+ if ( in_array( $position[1], array( 'top', 'center', 'bottom' ), true ) ) {
+ $position_y = $position[1];
+ } else {
+ $position_y = 'top';
+ }
+
+ set_theme_mod( 'background_position_x', $position_x );
+ set_theme_mod( 'background_position_y', $position_y );
+ }
+
+ if ( isset( $_POST['background-size'] ) ) {
+ check_admin_referer( 'custom-background' );
+
+ if ( in_array( $_POST['background-size'], array( 'auto', 'contain', 'cover' ), true ) ) {
+ $size = $_POST['background-size'];
+ } else {
+ $size = 'auto';
+ }
+
+ set_theme_mod( 'background_size', $size );
+ }
+
+ if ( isset( $_POST['background-repeat'] ) ) {
+ check_admin_referer( 'custom-background' );
+
+ $repeat = $_POST['background-repeat'];
+
+ if ( 'no-repeat' !== $repeat ) {
+ $repeat = 'repeat';
+ }
+
+ set_theme_mod( 'background_repeat', $repeat );
+ }
+
+ if ( isset( $_POST['background-attachment'] ) ) {
+ check_admin_referer( 'custom-background' );
+
+ $attachment = $_POST['background-attachment'];
+
+ if ( 'fixed' !== $attachment ) {
+ $attachment = 'scroll';
+ }
+
+ set_theme_mod( 'background_attachment', $attachment );
+ }
+
+ if ( isset( $_POST['background-color'] ) ) {
+ check_admin_referer( 'custom-background' );
+ $color = preg_replace( '/[^0-9a-fA-F]/', '', $_POST['background-color'] );
+ if ( strlen( $color ) == 6 || strlen( $color ) == 3 ) {
+ set_theme_mod( 'background_color', $color );
+ } else {
+ set_theme_mod( 'background_color', '' );
+ }
+ }
+
+ $this->updated = true;
+ }
+
+ /**
+ * Display the custom background page.
+ *
+ * @since 3.0.0
+ */
+ public function admin_page() {
+ ?>
+<div class="wrap" id="custom-background">
+<h1><?php _e( 'Custom Background' ); ?></h1>
+
+ <?php if ( current_user_can( 'customize' ) ) { ?>
+<div class="notice notice-info hide-if-no-customize">
+ <p>
+ <?php
+ printf(
+ __( 'You can now manage and live-preview Custom Backgrounds in the <a href="%1$s">Customizer</a>.' ),
+ admin_url( 'customize.php?autofocus[control]=background_image' )
+ );
+ ?>
+ </p>
+</div>
+ <?php } ?>
+
+ <?php if ( ! empty( $this->updated ) ) { ?>
+<div id="message" class="updated">
+<p><?php printf( __( 'Background updated. <a href="%s">Visit your site</a> to see how it looks.' ), home_url( '/' ) ); ?></p>
+</div>
+ <?php } ?>
+
+<h2><?php _e( 'Background Image' ); ?></h2>
+
+<table class="form-table" role="presentation">
+<tbody>
+<tr>
+<th scope="row"><?php _e( 'Preview' ); ?></th>
+<td>
+ <?php
+ if ( $this->admin_image_div_callback ) {
+ call_user_func( $this->admin_image_div_callback );
+ } else {
+ $background_styles = '';
+ if ( $bgcolor = get_background_color() ) {
+ $background_styles .= 'background-color: #' . $bgcolor . ';';
+ }
+
+ $background_image_thumb = get_background_image();
+ if ( $background_image_thumb ) {
+ $background_image_thumb = esc_url( set_url_scheme( get_theme_mod( 'background_image_thumb', str_replace( '%', '%%', $background_image_thumb ) ) ) );
+ $background_position_x = get_theme_mod( 'background_position_x', get_theme_support( 'custom-background', 'default-position-x' ) );
+ $background_position_y = get_theme_mod( 'background_position_y', get_theme_support( 'custom-background', 'default-position-y' ) );
+ $background_size = get_theme_mod( 'background_size', get_theme_support( 'custom-background', 'default-size' ) );
+ $background_repeat = get_theme_mod( 'background_repeat', get_theme_support( 'custom-background', 'default-repeat' ) );
+ $background_attachment = get_theme_mod( 'background_attachment', get_theme_support( 'custom-background', 'default-attachment' ) );
+
+ // Background-image URL must be single quote, see below.
+ $background_styles .= " background-image: url('$background_image_thumb');"
+ . " background-size: $background_size;"
+ . " background-position: $background_position_x $background_position_y;"
+ . " background-repeat: $background_repeat;"
+ . " background-attachment: $background_attachment;";
+ }
+ ?>
+ <div id="custom-background-image" style="<?php echo $background_styles; ?>"><?php // must be double quote, see above ?>
+ <?php if ( $background_image_thumb ) { ?>
+ <img class="custom-background-image" src="<?php echo $background_image_thumb; ?>" style="visibility:hidden;" alt="" /><br />
+ <img class="custom-background-image" src="<?php echo $background_image_thumb; ?>" style="visibility:hidden;" alt="" />
+ <?php } ?>
+ </div>
+ <?php } ?>
+</td>
+</tr>
+
+ <?php if ( get_background_image() ) : ?>
+<tr>
+<th scope="row"><?php _e( 'Remove Image' ); ?></th>
+<td>
+<form method="post">
+ <?php wp_nonce_field( 'custom-background-remove', '_wpnonce-custom-background-remove' ); ?>
+ <?php submit_button( __( 'Remove Background Image' ), '', 'remove-background', false ); ?><br/>
+ <?php _e( 'This will remove the background image. You will not be able to restore any customizations.' ); ?>
+</form>
+</td>
+</tr>
+ <?php endif; ?>
+
+ <?php $default_image = get_theme_support( 'custom-background', 'default-image' ); ?>
+ <?php if ( $default_image && get_background_image() != $default_image ) : ?>
+<tr>
+<th scope="row"><?php _e( 'Restore Original Image' ); ?></th>
+<td>
+<form method="post">
+ <?php wp_nonce_field( 'custom-background-reset', '_wpnonce-custom-background-reset' ); ?>
+ <?php submit_button( __( 'Restore Original Image' ), '', 'reset-background', false ); ?><br/>
+ <?php _e( 'This will restore the original background image. You will not be able to restore any customizations.' ); ?>
+</form>
+</td>
+</tr>
+ <?php endif; ?>
+
+ <?php if ( current_user_can( 'upload_files' ) ) : ?>
+<tr>
+<th scope="row"><?php _e( 'Select Image' ); ?></th>
+<td><form enctype="multipart/form-data" id="upload-form" class="wp-upload-form" method="post">
+ <p>
+ <label for="upload"><?php _e( 'Choose an image from your computer:' ); ?></label><br />
+ <input type="file" id="upload" name="import" />
+ <input type="hidden" name="action" value="save" />
+ <?php wp_nonce_field( 'custom-background-upload', '_wpnonce-custom-background-upload' ); ?>
+ <?php submit_button( __( 'Upload' ), '', 'submit', false ); ?>
+ </p>
+ <p>
+ <label for="choose-from-library-link"><?php _e( 'Or choose an image from your media library:' ); ?></label><br />
+ <button id="choose-from-library-link" class="button"
+ data-choose="<?php esc_attr_e( 'Choose a Background Image' ); ?>"
+ data-update="<?php esc_attr_e( 'Set as background' ); ?>"><?php _e( 'Choose Image' ); ?></button>
+ </p>
+ </form>
+</td>
+</tr>
+ <?php endif; ?>
+</tbody>
+</table>
+
+<h2><?php _e( 'Display Options' ); ?></h2>
+<form method="post">
+<table class="form-table" role="presentation">
+<tbody>
+ <?php if ( get_background_image() ) : ?>
+<input name="background-preset" type="hidden" value="custom">
+
+ <?php
+ $background_position = sprintf(
+ '%s %s',
+ get_theme_mod( 'background_position_x', get_theme_support( 'custom-background', 'default-position-x' ) ),
+ get_theme_mod( 'background_position_y', get_theme_support( 'custom-background', 'default-position-y' ) )
+ );
+
+ $background_position_options = array(
+ array(
+ 'left top' => array(
+ 'label' => __( 'Top Left' ),
+ 'icon' => 'dashicons dashicons-arrow-left-alt',
+ ),
+ 'center top' => array(
+ 'label' => __( 'Top' ),
+ 'icon' => 'dashicons dashicons-arrow-up-alt',
+ ),
+ 'right top' => array(
+ 'label' => __( 'Top Right' ),
+ 'icon' => 'dashicons dashicons-arrow-right-alt',
+ ),
+ ),
+ array(
+ 'left center' => array(
+ 'label' => __( 'Left' ),
+ 'icon' => 'dashicons dashicons-arrow-left-alt',
+ ),
+ 'center center' => array(
+ 'label' => __( 'Center' ),
+ 'icon' => 'background-position-center-icon',
+ ),
+ 'right center' => array(
+ 'label' => __( 'Right' ),
+ 'icon' => 'dashicons dashicons-arrow-right-alt',
+ ),
+ ),
+ array(
+ 'left bottom' => array(
+ 'label' => __( 'Bottom Left' ),
+ 'icon' => 'dashicons dashicons-arrow-left-alt',
+ ),
+ 'center bottom' => array(
+ 'label' => __( 'Bottom' ),
+ 'icon' => 'dashicons dashicons-arrow-down-alt',
+ ),
+ 'right bottom' => array(
+ 'label' => __( 'Bottom Right' ),
+ 'icon' => 'dashicons dashicons-arrow-right-alt',
+ ),
+ ),
+ );
+ ?>
+<tr>
+<th scope="row"><?php _e( 'Image Position' ); ?></th>
+<td><fieldset><legend class="screen-reader-text"><span><?php _e( 'Image Position' ); ?></span></legend>
+<div class="background-position-control">
+ <?php foreach ( $background_position_options as $group ) : ?>
+ <div class="button-group">
+ <?php foreach ( $group as $value => $input ) : ?>
+ <label>
+ <input class="screen-reader-text" name="background-position" type="radio" value="<?php echo esc_attr( $value ); ?>"<?php checked( $value, $background_position ); ?>>
+ <span class="button display-options position"><span class="<?php echo esc_attr( $input['icon'] ); ?>" aria-hidden="true"></span></span>
+ <span class="screen-reader-text"><?php echo $input['label']; ?></span>
+ </label>
+ <?php endforeach; ?>
+ </div>
+<?php endforeach; ?>
+</div>
+</fieldset></td>
+</tr>
+
+<tr>
+<th scope="row"><label for="background-size"><?php _e( 'Image Size' ); ?></label></th>
+<td><fieldset><legend class="screen-reader-text"><span><?php _e( 'Image Size' ); ?></span></legend>
+<select id="background-size" name="background-size">
+<option value="auto"<?php selected( 'auto', get_theme_mod( 'background_size', get_theme_support( 'custom-background', 'default-size' ) ) ); ?>><?php _ex( 'Original', 'Original Size' ); ?></option>
+<option value="contain"<?php selected( 'contain', get_theme_mod( 'background_size', get_theme_support( 'custom-background', 'default-size' ) ) ); ?>><?php _e( 'Fit to Screen' ); ?></option>
+<option value="cover"<?php selected( 'cover', get_theme_mod( 'background_size', get_theme_support( 'custom-background', 'default-size' ) ) ); ?>><?php _e( 'Fill Screen' ); ?></option>
+</select>
+</fieldset></td>
+</tr>
+
+<tr>
+<th scope="row"><?php _ex( 'Repeat', 'Background Repeat' ); ?></th>
+<td><fieldset><legend class="screen-reader-text"><span><?php _ex( 'Repeat', 'Background Repeat' ); ?></span></legend>
+<input name="background-repeat" type="hidden" value="no-repeat">
+<label><input type="checkbox" name="background-repeat" value="repeat"<?php checked( 'repeat', get_theme_mod( 'background_repeat', get_theme_support( 'custom-background', 'default-repeat' ) ) ); ?>> <?php _e( 'Repeat Background Image' ); ?></label>
+</fieldset></td>
+</tr>
+
+<tr>
+<th scope="row"><?php _ex( 'Scroll', 'Background Scroll' ); ?></th>
+<td><fieldset><legend class="screen-reader-text"><span><?php _ex( 'Scroll', 'Background Scroll' ); ?></span></legend>
+<input name="background-attachment" type="hidden" value="fixed">
+<label><input name="background-attachment" type="checkbox" value="scroll" <?php checked( 'scroll', get_theme_mod( 'background_attachment', get_theme_support( 'custom-background', 'default-attachment' ) ) ); ?>> <?php _e( 'Scroll with Page' ); ?></label>
+</fieldset></td>
+</tr>
+<?php endif; // get_background_image() ?>
+<tr>
+<th scope="row"><?php _e( 'Background Color' ); ?></th>
+<td><fieldset><legend class="screen-reader-text"><span><?php _e( 'Background Color' ); ?></span></legend>
+ <?php
+ $default_color = '';
+ if ( current_theme_supports( 'custom-background', 'default-color' ) ) {
+ $default_color = ' data-default-color="#' . esc_attr( get_theme_support( 'custom-background', 'default-color' ) ) . '"';
+ }
+ ?>
+<input type="text" name="background-color" id="background-color" value="#<?php echo esc_attr( get_background_color() ); ?>"<?php echo $default_color; ?>>
+</fieldset></td>
+</tr>
+</tbody>
+</table>
+
+ <?php wp_nonce_field( 'custom-background' ); ?>
+ <?php submit_button( null, 'primary', 'save-background-options' ); ?>
+</form>
+
+</div>
+ <?php
+ }
+
+ /**
+ * Handle an Image upload for the background image.
+ *
+ * @since 3.0.0
+ */
+ public function handle_upload() {
+ if ( empty( $_FILES ) ) {
+ return;
+ }
+
+ check_admin_referer( 'custom-background-upload', '_wpnonce-custom-background-upload' );
+ $overrides = array( 'test_form' => false );
+
+ $uploaded_file = $_FILES['import'];
+ $wp_filetype = wp_check_filetype_and_ext( $uploaded_file['tmp_name'], $uploaded_file['name'] );
+ if ( ! wp_match_mime_types( 'image', $wp_filetype['type'] ) ) {
+ wp_die( __( 'The uploaded file is not a valid image. Please try again.' ) );
+ }
+
+ $file = wp_handle_upload( $uploaded_file, $overrides );
+
+ if ( isset( $file['error'] ) ) {
+ wp_die( $file['error'] );
+ }
+
+ $url = $file['url'];
+ $type = $file['type'];
+ $file = $file['file'];
+ $filename = wp_basename( $file );
+
+ // Construct the object array
+ $object = array(
+ 'post_title' => $filename,
+ 'post_content' => $url,
+ 'post_mime_type' => $type,
+ 'guid' => $url,
+ 'context' => 'custom-background',
+ );
+
+ // Save the data
+ $id = wp_insert_attachment( $object, $file );
+
+ // Add the meta-data
+ wp_update_attachment_metadata( $id, wp_generate_attachment_metadata( $id, $file ) );
+ update_post_meta( $id, '_wp_attachment_is_custom_background', get_option( 'stylesheet' ) );
+
+ set_theme_mod( 'background_image', esc_url_raw( $url ) );
+
+ $thumbnail = wp_get_attachment_image_src( $id, 'thumbnail' );
+ set_theme_mod( 'background_image_thumb', esc_url_raw( $thumbnail[0] ) );
+
+ /** This action is documented in wp-admin/custom-header.php */
+ do_action( 'wp_create_file_in_uploads', $file, $id ); // For replication
+ $this->updated = true;
+ }
+
+ /**
+ * Ajax handler for adding custom background context to an attachment.
+ *
+ * Triggers when the user adds a new background image from the
+ * Media Manager.
+ *
+ * @since 4.1.0
+ */
+ public function ajax_background_add() {
+ check_ajax_referer( 'background-add', 'nonce' );
+
+ if ( ! current_user_can( 'edit_theme_options' ) ) {
+ wp_send_json_error();
+ }
+
+ $attachment_id = absint( $_POST['attachment_id'] );
+ if ( $attachment_id < 1 ) {
+ wp_send_json_error();
+ }
+
+ update_post_meta( $attachment_id, '_wp_attachment_is_custom_background', get_stylesheet() );
+
+ wp_send_json_success();
+ }
+
+ /**
+ * @since 3.4.0
+ * @deprecated 3.5.0
+ *
+ * @param array $form_fields
+ * @return array $form_fields
+ */
+ public function attachment_fields_to_edit( $form_fields ) {
+ return $form_fields;
+ }
+
+ /**
+ * @since 3.4.0
+ * @deprecated 3.5.0
+ *
+ * @param array $tabs
+ * @return array $tabs
+ */
+ public function filter_upload_tabs( $tabs ) {
+ return $tabs;
+ }
+
+ /**
+ * @since 3.4.0
+ * @deprecated 3.5.0
+ */
+ public function wp_set_background_image() {
+ if ( ! current_user_can( 'edit_theme_options' ) || ! isset( $_POST['attachment_id'] ) ) {
+ exit;
+ }
+ $attachment_id = absint( $_POST['attachment_id'] );
+ /** This filter is documented in wp-admin/includes/media.php */
+ $sizes = array_keys(
+ apply_filters(
+ 'image_size_names_choose',
+ array(
+ 'thumbnail' => __( 'Thumbnail' ),
+ 'medium' => __( 'Medium' ),
+ 'large' => __( 'Large' ),
+ 'full' => __( 'Full Size' ),
+ )
+ )
+ );
+ $size = 'thumbnail';
+ if ( in_array( $_POST['size'], $sizes ) ) {
+ $size = esc_attr( $_POST['size'] );
+ }
+
+ update_post_meta( $attachment_id, '_wp_attachment_is_custom_background', get_option( 'stylesheet' ) );
+ $url = wp_get_attachment_image_src( $attachment_id, $size );
+ $thumbnail = wp_get_attachment_image_src( $attachment_id, 'thumbnail' );
+ set_theme_mod( 'background_image', esc_url_raw( $url[0] ) );
+ set_theme_mod( 'background_image_thumb', esc_url_raw( $thumbnail[0] ) );
+ exit;
+ }
+}
diff --git a/www/crm/wp-admin/custom-header.php b/www/crm/wp-admin/custom-header.php
new file mode 100644
index 00000000..2cf26600
--- /dev/null
+++ b/www/crm/wp-admin/custom-header.php
@@ -0,0 +1,1502 @@
+<?php
+/**
+ * The custom header image script.
+ *
+ * @package WordPress
+ * @subpackage Administration
+ */
+
+/**
+ * The custom header image class.
+ *
+ * @since 2.1.0
+ */
+class Custom_Image_Header {
+
+ /**
+ * Callback for administration header.
+ *
+ * @var callable
+ * @since 2.1.0
+ */
+ public $admin_header_callback;
+
+ /**
+ * Callback for header div.
+ *
+ * @var callable
+ * @since 3.0.0
+ */
+ public $admin_image_div_callback;
+
+ /**
+ * Holds default headers.
+ *
+ * @var array
+ * @since 3.0.0
+ */
+ public $default_headers = array();
+
+ /**
+ * Used to trigger a success message when settings updated and set to true.
+ *
+ * @since 3.0.0
+ * @var bool
+ */
+ private $updated;
+
+ /**
+ * Constructor - Register administration header callback.
+ *
+ * @since 2.1.0
+ * @param callable $admin_header_callback
+ * @param callable $admin_image_div_callback Optional custom image div output callback.
+ */
+ public function __construct( $admin_header_callback, $admin_image_div_callback = '' ) {
+ $this->admin_header_callback = $admin_header_callback;
+ $this->admin_image_div_callback = $admin_image_div_callback;
+
+ add_action( 'admin_menu', array( $this, 'init' ) );
+
+ add_action( 'customize_save_after', array( $this, 'customize_set_last_used' ) );
+ add_action( 'wp_ajax_custom-header-crop', array( $this, 'ajax_header_crop' ) );
+ add_action( 'wp_ajax_custom-header-add', array( $this, 'ajax_header_add' ) );
+ add_action( 'wp_ajax_custom-header-remove', array( $this, 'ajax_header_remove' ) );
+ }
+
+ /**
+ * Set up the hooks for the Custom Header admin page.
+ *
+ * @since 2.1.0
+ */
+ public function init() {
+ $page = add_theme_page( __( 'Header' ), __( 'Header' ), 'edit_theme_options', 'custom-header', array( $this, 'admin_page' ) );
+ if ( ! $page ) {
+ return;
+ }
+
+ add_action( "admin_print_scripts-$page", array( $this, 'js_includes' ) );
+ add_action( "admin_print_styles-$page", array( $this, 'css_includes' ) );
+ add_action( "admin_head-$page", array( $this, 'help' ) );
+ add_action( "admin_head-$page", array( $this, 'take_action' ), 50 );
+ add_action( "admin_head-$page", array( $this, 'js' ), 50 );
+ if ( $this->admin_header_callback ) {
+ add_action( "admin_head-$page", $this->admin_header_callback, 51 );
+ }
+ }
+
+ /**
+ * Adds contextual help.
+ *
+ * @since 3.0.0
+ */
+ public function help() {
+ get_current_screen()->add_help_tab(
+ array(
+ 'id' => 'overview',
+ 'title' => __( 'Overview' ),
+ 'content' =>
+ '<p>' . __( 'This screen is used to customize the header section of your theme.' ) . '</p>' .
+ '<p>' . __( 'You can choose from the theme&#8217;s default header images, or use one of your own. You can also customize how your Site Title and Tagline are displayed.' ) . '<p>',
+ )
+ );
+
+ get_current_screen()->add_help_tab(
+ array(
+ 'id' => 'set-header-image',
+ 'title' => __( 'Header Image' ),
+ 'content' =>
+ '<p>' . __( 'You can set a custom image header for your site. Simply upload the image and crop it, and the new header will go live immediately. Alternatively, you can use an image that has already been uploaded to your Media Library by clicking the &#8220;Choose Image&#8221; button.' ) . '</p>' .
+ '<p>' . __( 'Some themes come with additional header images bundled. If you see multiple images displayed, select the one you&#8217;d like and click the &#8220;Save Changes&#8221; button.' ) . '</p>' .
+ '<p>' . __( 'If your theme has more than one default header image, or you have uploaded more than one custom header image, you have the option of having WordPress display a randomly different image on each page of your site. Click the &#8220;Random&#8221; radio button next to the Uploaded Images or Default Images section to enable this feature.' ) . '</p>' .
+ '<p>' . __( 'If you don&#8217;t want a header image to be displayed on your site at all, click the &#8220;Remove Header Image&#8221; button at the bottom of the Header Image section of this page. If you want to re-enable the header image later, you just have to select one of the other image options and click &#8220;Save Changes&#8221;.' ) . '</p>',
+ )
+ );
+
+ get_current_screen()->add_help_tab(
+ array(
+ 'id' => 'set-header-text',
+ 'title' => __( 'Header Text' ),
+ 'content' =>
+ '<p>' . sprintf( __( 'For most themes, the header text is your Site Title and Tagline, as defined in the <a href="%1$s">General Settings</a> section.' ), admin_url( 'options-general.php' ) ) . '<p>' .
+ '<p>' . __( 'In the Header Text section of this page, you can choose whether to display this text or hide it. You can also choose a color for the text by clicking the Select Color button and either typing in a legitimate HTML hex value, e.g. &#8220;#ff0000&#8221; for red, or by choosing a color using the color picker.' ) . '</p>' .
+ '<p>' . __( 'Don&#8217;t forget to click &#8220;Save Changes&#8221; when you&#8217;re done!' ) . '</p>',
+ )
+ );
+
+ get_current_screen()->set_help_sidebar(
+ '<p><strong>' . __( 'For more information:' ) . '</strong></p>' .
+ '<p>' . __( '<a href="https://codex.wordpress.org/Appearance_Header_Screen">Documentation on Custom Header</a>' ) . '</p>' .
+ '<p>' . __( '<a href="https://wordpress.org/support/">Support</a>' ) . '</p>'
+ );
+ }
+
+ /**
+ * Get the current step.
+ *
+ * @since 2.6.0
+ *
+ * @return int Current step
+ */
+ public function step() {
+ if ( ! isset( $_GET['step'] ) ) {
+ return 1;
+ }
+
+ $step = (int) $_GET['step'];
+ if ( $step < 1 || 3 < $step ||
+ ( 2 == $step && ! wp_verify_nonce( $_REQUEST['_wpnonce-custom-header-upload'], 'custom-header-upload' ) ) ||
+ ( 3 == $step && ! wp_verify_nonce( $_REQUEST['_wpnonce'], 'custom-header-crop-image' ) )
+ ) {
+ return 1;
+ }
+
+ return $step;
+ }
+
+ /**
+ * Set up the enqueue for the JavaScript files.
+ *
+ * @since 2.1.0
+ */
+ public function js_includes() {
+ $step = $this->step();
+
+ if ( ( 1 == $step || 3 == $step ) ) {
+ wp_enqueue_media();
+ wp_enqueue_script( 'custom-header' );
+ if ( current_theme_supports( 'custom-header', 'header-text' ) ) {
+ wp_enqueue_script( 'wp-color-picker' );
+ }
+ } elseif ( 2 == $step ) {
+ wp_enqueue_script( 'imgareaselect' );
+ }
+ }
+
+ /**
+ * Set up the enqueue for the CSS files
+ *
+ * @since 2.7.0
+ */
+ public function css_includes() {
+ $step = $this->step();
+
+ if ( ( 1 == $step || 3 == $step ) && current_theme_supports( 'custom-header', 'header-text' ) ) {
+ wp_enqueue_style( 'wp-color-picker' );
+ } elseif ( 2 == $step ) {
+ wp_enqueue_style( 'imgareaselect' );
+ }
+ }
+
+ /**
+ * Execute custom header modification.
+ *
+ * @since 2.6.0
+ */
+ public function take_action() {
+ if ( ! current_user_can( 'edit_theme_options' ) ) {
+ return;
+ }
+
+ if ( empty( $_POST ) ) {
+ return;
+ }
+
+ $this->updated = true;
+
+ if ( isset( $_POST['resetheader'] ) ) {
+ check_admin_referer( 'custom-header-options', '_wpnonce-custom-header-options' );
+ $this->reset_header_image();
+ return;
+ }
+
+ if ( isset( $_POST['removeheader'] ) ) {
+ check_admin_referer( 'custom-header-options', '_wpnonce-custom-header-options' );
+ $this->remove_header_image();
+ return;
+ }
+
+ if ( isset( $_POST['text-color'] ) && ! isset( $_POST['display-header-text'] ) ) {
+ check_admin_referer( 'custom-header-options', '_wpnonce-custom-header-options' );
+ set_theme_mod( 'header_textcolor', 'blank' );
+ } elseif ( isset( $_POST['text-color'] ) ) {
+ check_admin_referer( 'custom-header-options', '_wpnonce-custom-header-options' );
+ $_POST['text-color'] = str_replace( '#', '', $_POST['text-color'] );
+ $color = preg_replace( '/[^0-9a-fA-F]/', '', $_POST['text-color'] );
+ if ( strlen( $color ) == 6 || strlen( $color ) == 3 ) {
+ set_theme_mod( 'header_textcolor', $color );
+ } elseif ( ! $color ) {
+ set_theme_mod( 'header_textcolor', 'blank' );
+ }
+ }
+
+ if ( isset( $_POST['default-header'] ) ) {
+ check_admin_referer( 'custom-header-options', '_wpnonce-custom-header-options' );
+ $this->set_header_image( $_POST['default-header'] );
+ return;
+ }
+ }
+
+ /**
+ * Process the default headers
+ *
+ * @since 3.0.0
+ *
+ * @global array $_wp_default_headers
+ */
+ public function process_default_headers() {
+ global $_wp_default_headers;
+
+ if ( ! isset( $_wp_default_headers ) ) {
+ return;
+ }
+
+ if ( ! empty( $this->default_headers ) ) {
+ return;
+ }
+
+ $this->default_headers = $_wp_default_headers;
+ $template_directory_uri = get_template_directory_uri();
+ $stylesheet_directory_uri = get_stylesheet_directory_uri();
+ foreach ( array_keys( $this->default_headers ) as $header ) {
+ $this->default_headers[ $header ]['url'] = sprintf( $this->default_headers[ $header ]['url'], $template_directory_uri, $stylesheet_directory_uri );
+ $this->default_headers[ $header ]['thumbnail_url'] = sprintf( $this->default_headers[ $header ]['thumbnail_url'], $template_directory_uri, $stylesheet_directory_uri );
+ }
+ }
+
+ /**
+ * Display UI for selecting one of several default headers.
+ *
+ * Show the random image option if this theme has multiple header images.
+ * Random image option is on by default if no header has been set.
+ *
+ * @since 3.0.0
+ *
+ * @param string $type The header type. One of 'default' (for the Uploaded Images control)
+ * or 'uploaded' (for the Uploaded Images control).
+ */
+ public function show_header_selector( $type = 'default' ) {
+ if ( 'default' == $type ) {
+ $headers = $this->default_headers;
+ } else {
+ $headers = get_uploaded_header_images();
+ $type = 'uploaded';
+ }
+
+ if ( 1 < count( $headers ) ) {
+ echo '<div class="random-header">';
+ echo '<label><input name="default-header" type="radio" value="random-' . $type . '-image"' . checked( is_random_header_image( $type ), true, false ) . ' />';
+ _e( '<strong>Random:</strong> Show a different image on each page.' );
+ echo '</label>';
+ echo '</div>';
+ }
+
+ echo '<div class="available-headers">';
+ foreach ( $headers as $header_key => $header ) {
+ $header_thumbnail = $header['thumbnail_url'];
+ $header_url = $header['url'];
+ $header_alt_text = empty( $header['alt_text'] ) ? '' : $header['alt_text'];
+ echo '<div class="default-header">';
+ echo '<label><input name="default-header" type="radio" value="' . esc_attr( $header_key ) . '" ' . checked( $header_url, get_theme_mod( 'header_image' ), false ) . ' />';
+ $width = '';
+ if ( ! empty( $header['attachment_id'] ) ) {
+ $width = ' width="230"';
+ }
+ echo '<img src="' . set_url_scheme( $header_thumbnail ) . '" alt="' . esc_attr( $header_alt_text ) . '"' . $width . ' /></label>';
+ echo '</div>';
+ }
+ echo '<div class="clear"></div></div>';
+ }
+
+ /**
+ * Execute JavaScript depending on step.
+ *
+ * @since 2.1.0
+ */
+ public function js() {
+ $step = $this->step();
+ if ( ( 1 == $step || 3 == $step ) && current_theme_supports( 'custom-header', 'header-text' ) ) {
+ $this->js_1();
+ } elseif ( 2 == $step ) {
+ $this->js_2();
+ }
+ }
+
+ /**
+ * Display JavaScript based on Step 1 and 3.
+ *
+ * @since 2.6.0
+ */
+ public function js_1() {
+ $default_color = '';
+ if ( current_theme_supports( 'custom-header', 'default-text-color' ) ) {
+ $default_color = get_theme_support( 'custom-header', 'default-text-color' );
+ if ( $default_color && false === strpos( $default_color, '#' ) ) {
+ $default_color = '#' . $default_color;
+ }
+ }
+ ?>
+<script type="text/javascript">
+(function($){
+ var default_color = '<?php echo $default_color; ?>',
+ header_text_fields;
+
+ function pickColor(color) {
+ $('#name').css('color', color);
+ $('#desc').css('color', color);
+ $('#text-color').val(color);
+ }
+
+ function toggle_text() {
+ var checked = $('#display-header-text').prop('checked'),
+ text_color;
+ header_text_fields.toggle( checked );
+ if ( ! checked )
+ return;
+ text_color = $('#text-color');
+ if ( '' == text_color.val().replace('#', '') ) {
+ text_color.val( default_color );
+ pickColor( default_color );
+ } else {
+ pickColor( text_color.val() );
+ }
+ }
+
+ $(document).ready(function() {
+ var text_color = $('#text-color');
+ header_text_fields = $('.displaying-header-text');
+ text_color.wpColorPicker({
+ change: function( event, ui ) {
+ pickColor( text_color.wpColorPicker('color') );
+ },
+ clear: function() {
+ pickColor( '' );
+ }
+ });
+ $('#display-header-text').click( toggle_text );
+ <?php if ( ! display_header_text() ) : ?>
+ toggle_text();
+ <?php endif; ?>
+ });
+})(jQuery);
+</script>
+ <?php
+ }
+
+ /**
+ * Display JavaScript based on Step 2.
+ *
+ * @since 2.6.0
+ */
+ public function js_2() {
+
+ ?>
+<script type="text/javascript">
+ function onEndCrop( coords ) {
+ jQuery( '#x1' ).val(coords.x);
+ jQuery( '#y1' ).val(coords.y);
+ jQuery( '#width' ).val(coords.w);
+ jQuery( '#height' ).val(coords.h);
+ }
+
+ jQuery(document).ready(function() {
+ var xinit = <?php echo absint( get_theme_support( 'custom-header', 'width' ) ); ?>;
+ var yinit = <?php echo absint( get_theme_support( 'custom-header', 'height' ) ); ?>;
+ var ratio = xinit / yinit;
+ var ximg = jQuery('img#upload').width();
+ var yimg = jQuery('img#upload').height();
+
+ if ( yimg < yinit || ximg < xinit ) {
+ if ( ximg / yimg > ratio ) {
+ yinit = yimg;
+ xinit = yinit * ratio;
+ } else {
+ xinit = ximg;
+ yinit = xinit / ratio;
+ }
+ }
+
+ jQuery('img#upload').imgAreaSelect({
+ handles: true,
+ keys: true,
+ show: true,
+ x1: 0,
+ y1: 0,
+ x2: xinit,
+ y2: yinit,
+ <?php
+ if ( ! current_theme_supports( 'custom-header', 'flex-height' ) && ! current_theme_supports( 'custom-header', 'flex-width' ) ) {
+ ?>
+ aspectRatio: xinit + ':' + yinit,
+ <?php
+ }
+ if ( ! current_theme_supports( 'custom-header', 'flex-height' ) ) {
+ ?>
+ maxHeight: <?php echo get_theme_support( 'custom-header', 'height' ); ?>,
+ <?php
+ }
+ if ( ! current_theme_supports( 'custom-header', 'flex-width' ) ) {
+ ?>
+ maxWidth: <?php echo get_theme_support( 'custom-header', 'width' ); ?>,
+ <?php
+ }
+ ?>
+ onInit: function () {
+ jQuery('#width').val(xinit);
+ jQuery('#height').val(yinit);
+ },
+ onSelectChange: function(img, c) {
+ jQuery('#x1').val(c.x1);
+ jQuery('#y1').val(c.y1);
+ jQuery('#width').val(c.width);
+ jQuery('#height').val(c.height);
+ }
+ });
+ });
+</script>
+ <?php
+ }
+
+ /**
+ * Display first step of custom header image page.
+ *
+ * @since 2.1.0
+ */
+ public function step_1() {
+ $this->process_default_headers();
+ ?>
+
+<div class="wrap">
+<h1><?php _e( 'Custom Header' ); ?></h1>
+
+ <?php if ( current_user_can( 'customize' ) ) { ?>
+<div class="notice notice-info hide-if-no-customize">
+ <p>
+ <?php
+ printf(
+ __( 'You can now manage and live-preview Custom Header in the <a href="%1$s">Customizer</a>.' ),
+ admin_url( 'customize.php?autofocus[control]=header_image' )
+ );
+ ?>
+ </p>
+</div>
+ <?php } ?>
+
+ <?php if ( ! empty( $this->updated ) ) { ?>
+<div id="message" class="updated">
+<p><?php printf( __( 'Header updated. <a href="%s">Visit your site</a> to see how it looks.' ), home_url( '/' ) ); ?></p>
+</div>
+ <?php } ?>
+
+<h2><?php _e( 'Header Image' ); ?></h2>
+
+<table class="form-table" role="presentation">
+<tbody>
+
+ <?php if ( get_custom_header() || display_header_text() ) : ?>
+<tr>
+<th scope="row"><?php _e( 'Preview' ); ?></th>
+<td>
+ <?php
+ if ( $this->admin_image_div_callback ) {
+ call_user_func( $this->admin_image_div_callback );
+ } else {
+ $custom_header = get_custom_header();
+ $header_image = get_header_image();
+
+ if ( $header_image ) {
+ $header_image_style = 'background-image:url(' . esc_url( $header_image ) . ');';
+ } else {
+ $header_image_style = '';
+ }
+
+ if ( $custom_header->width ) {
+ $header_image_style .= 'max-width:' . $custom_header->width . 'px;';
+ }
+ if ( $custom_header->height ) {
+ $header_image_style .= 'height:' . $custom_header->height . 'px;';
+ }
+ ?>
+ <div id="headimg" style="<?php echo $header_image_style; ?>">
+ <?php
+ if ( display_header_text() ) {
+ $style = ' style="color:#' . get_header_textcolor() . ';"';
+ } else {
+ $style = ' style="display:none;"';
+ }
+ ?>
+ <h1><a id="name" class="displaying-header-text" <?php echo $style; ?> onclick="return false;" href="<?php bloginfo( 'url' ); ?>" tabindex="-1"><?php bloginfo( 'name' ); ?></a></h1>
+ <div id="desc" class="displaying-header-text" <?php echo $style; ?>><?php bloginfo( 'description' ); ?></div>
+ </div>
+ <?php } ?>
+</td>
+</tr>
+ <?php endif; ?>
+
+ <?php if ( current_user_can( 'upload_files' ) && current_theme_supports( 'custom-header', 'uploads' ) ) : ?>
+<tr>
+<th scope="row"><?php _e( 'Select Image' ); ?></th>
+<td>
+ <p><?php _e( 'You can select an image to be shown at the top of your site by uploading from your computer or choosing from your media library. After selecting an image you will be able to crop it.' ); ?><br />
+ <?php
+ if ( ! current_theme_supports( 'custom-header', 'flex-height' ) && ! current_theme_supports( 'custom-header', 'flex-width' ) ) {
+ printf( __( 'Images of exactly <strong>%1$d &times; %2$d pixels</strong> will be used as-is.' ) . '<br />', get_theme_support( 'custom-header', 'width' ), get_theme_support( 'custom-header', 'height' ) );
+ } elseif ( current_theme_supports( 'custom-header', 'flex-height' ) ) {
+ if ( ! current_theme_supports( 'custom-header', 'flex-width' ) ) {
+ printf(
+ /* translators: %s: size in pixels */
+ __( 'Images should be at least %s wide.' ) . ' ',
+ sprintf(
+ /* translators: %d: custom header width */
+ '<strong>' . __( '%d pixels' ) . '</strong>',
+ get_theme_support( 'custom-header', 'width' )
+ )
+ );
+ }
+ } elseif ( current_theme_supports( 'custom-header', 'flex-width' ) ) {
+ if ( ! current_theme_supports( 'custom-header', 'flex-height' ) ) {
+ printf(
+ /* translators: %s: size in pixels */
+ __( 'Images should be at least %s tall.' ) . ' ',
+ sprintf(
+ /* translators: %d: custom header height */
+ '<strong>' . __( '%d pixels' ) . '</strong>',
+ get_theme_support( 'custom-header', 'height' )
+ )
+ );
+ }
+ }
+ if ( current_theme_supports( 'custom-header', 'flex-height' ) || current_theme_supports( 'custom-header', 'flex-width' ) ) {
+ if ( current_theme_supports( 'custom-header', 'width' ) ) {
+ printf(
+ /* translators: %s: size in pixels */
+ __( 'Suggested width is %s.' ) . ' ',
+ sprintf(
+ /* translators: %d: custom header width */
+ '<strong>' . __( '%d pixels' ) . '</strong>',
+ get_theme_support( 'custom-header', 'width' )
+ )
+ );
+ }
+ if ( current_theme_supports( 'custom-header', 'height' ) ) {
+ printf(
+ /* translators: %s: size in pixels */
+ __( 'Suggested height is %s.' ) . ' ',
+ sprintf(
+ /* translators: %d: custom header height */
+ '<strong>' . __( '%d pixels' ) . '</strong>',
+ get_theme_support( 'custom-header', 'height' )
+ )
+ );
+ }
+ }
+ ?>
+ </p>
+ <form enctype="multipart/form-data" id="upload-form" class="wp-upload-form" method="post" action="<?php echo esc_url( add_query_arg( 'step', 2 ) ); ?>">
+ <p>
+ <label for="upload"><?php _e( 'Choose an image from your computer:' ); ?></label><br />
+ <input type="file" id="upload" name="import" />
+ <input type="hidden" name="action" value="save" />
+ <?php wp_nonce_field( 'custom-header-upload', '_wpnonce-custom-header-upload' ); ?>
+ <?php submit_button( __( 'Upload' ), '', 'submit', false ); ?>
+ </p>
+ <?php
+ $modal_update_href = esc_url(
+ add_query_arg(
+ array(
+ 'page' => 'custom-header',
+ 'step' => 2,
+ '_wpnonce-custom-header-upload' => wp_create_nonce( 'custom-header-upload' ),
+ ),
+ admin_url( 'themes.php' )
+ )
+ );
+ ?>
+ <p>
+ <label for="choose-from-library-link"><?php _e( 'Or choose an image from your media library:' ); ?></label><br />
+ <button id="choose-from-library-link" class="button"
+ data-update-link="<?php echo esc_attr( $modal_update_href ); ?>"
+ data-choose="<?php esc_attr_e( 'Choose a Custom Header' ); ?>"
+ data-update="<?php esc_attr_e( 'Set as header' ); ?>"><?php _e( 'Choose Image' ); ?></button>
+ </p>
+ </form>
+</td>
+</tr>
+ <?php endif; ?>
+</tbody>
+</table>
+
+<form method="post" action="<?php echo esc_url( add_query_arg( 'step', 1 ) ); ?>">
+ <?php submit_button( null, 'screen-reader-text', 'save-header-options', false ); ?>
+<table class="form-table" role="presentation">
+<tbody>
+ <?php if ( get_uploaded_header_images() ) : ?>
+<tr>
+<th scope="row"><?php _e( 'Uploaded Images' ); ?></th>
+<td>
+ <p><?php _e( 'You can choose one of your previously uploaded headers, or show a random one.' ); ?></p>
+ <?php
+ $this->show_header_selector( 'uploaded' );
+ ?>
+</td>
+</tr>
+ <?php
+ endif;
+ if ( ! empty( $this->default_headers ) ) :
+ ?>
+<tr>
+<th scope="row"><?php _e( 'Default Images' ); ?></th>
+<td>
+ <?php if ( current_theme_supports( 'custom-header', 'uploads' ) ) : ?>
+ <p><?php _e( 'If you don&lsquo;t want to upload your own image, you can use one of these cool headers, or show a random one.' ); ?></p>
+ <?php else : ?>
+ <p><?php _e( 'You can use one of these cool headers or show a random one on each page.' ); ?></p>
+ <?php endif; ?>
+ <?php
+ $this->show_header_selector( 'default' );
+ ?>
+</td>
+</tr>
+ <?php
+ endif;
+ if ( get_header_image() ) :
+ ?>
+<tr>
+<th scope="row"><?php _e( 'Remove Image' ); ?></th>
+<td>
+ <p><?php _e( 'This will remove the header image. You will not be able to restore any customizations.' ); ?></p>
+ <?php submit_button( __( 'Remove Header Image' ), '', 'removeheader', false ); ?>
+</td>
+</tr>
+ <?php
+ endif;
+
+ $default_image = sprintf( get_theme_support( 'custom-header', 'default-image' ), get_template_directory_uri(), get_stylesheet_directory_uri() );
+ if ( $default_image && get_header_image() != $default_image ) :
+ ?>
+<tr>
+<th scope="row"><?php _e( 'Reset Image' ); ?></th>
+<td>
+ <p><?php _e( 'This will restore the original header image. You will not be able to restore any customizations.' ); ?></p>
+ <?php submit_button( __( 'Restore Original Header Image' ), '', 'resetheader', false ); ?>
+</td>
+</tr>
+ <?php endif; ?>
+</tbody>
+</table>
+
+ <?php if ( current_theme_supports( 'custom-header', 'header-text' ) ) : ?>
+
+<h2><?php _e( 'Header Text' ); ?></h2>
+
+<table class="form-table" role="presentation">
+<tbody>
+<tr>
+<th scope="row"><?php _e( 'Header Text' ); ?></th>
+<td>
+ <p>
+ <label><input type="checkbox" name="display-header-text" id="display-header-text"<?php checked( display_header_text() ); ?> /> <?php _e( 'Show header text with your image.' ); ?></label>
+ </p>
+</td>
+</tr>
+
+<tr class="displaying-header-text">
+<th scope="row"><?php _e( 'Text Color' ); ?></th>
+<td>
+ <p>
+ <?php
+ $default_color = '';
+ if ( current_theme_supports( 'custom-header', 'default-text-color' ) ) {
+ $default_color = get_theme_support( 'custom-header', 'default-text-color' );
+ if ( $default_color && false === strpos( $default_color, '#' ) ) {
+ $default_color = '#' . $default_color;
+ }
+ }
+
+ $default_color_attr = $default_color ? ' data-default-color="' . esc_attr( $default_color ) . '"' : '';
+
+ $header_textcolor = display_header_text() ? get_header_textcolor() : get_theme_support( 'custom-header', 'default-text-color' );
+ if ( $header_textcolor && false === strpos( $header_textcolor, '#' ) ) {
+ $header_textcolor = '#' . $header_textcolor;
+ }
+
+ echo '<input type="text" name="text-color" id="text-color" value="' . esc_attr( $header_textcolor ) . '"' . $default_color_attr . ' />';
+ if ( $default_color ) {
+ echo ' <span class="description hide-if-js">' . sprintf( _x( 'Default: %s', 'color' ), esc_html( $default_color ) ) . '</span>';
+ }
+ ?>
+ </p>
+</td>
+</tr>
+</tbody>
+</table>
+ <?php
+endif;
+
+ /**
+ * Fires just before the submit button in the custom header options form.
+ *
+ * @since 3.1.0
+ */
+ do_action( 'custom_header_options' );
+
+ wp_nonce_field( 'custom-header-options', '_wpnonce-custom-header-options' );
+ ?>
+
+ <?php submit_button( null, 'primary', 'save-header-options' ); ?>
+</form>
+</div>
+
+ <?php
+ }
+
+ /**
+ * Display second step of custom header image page.
+ *
+ * @since 2.1.0
+ */
+ public function step_2() {
+ check_admin_referer( 'custom-header-upload', '_wpnonce-custom-header-upload' );
+ if ( ! current_theme_supports( 'custom-header', 'uploads' ) ) {
+ wp_die(
+ '<h1>' . __( 'Something went wrong.' ) . '</h1>' .
+ '<p>' . __( 'The current theme does not support uploading a custom header image.' ) . '</p>',
+ 403
+ );
+ }
+
+ if ( empty( $_POST ) && isset( $_GET['file'] ) ) {
+ $attachment_id = absint( $_GET['file'] );
+ $file = get_attached_file( $attachment_id, true );
+ $url = wp_get_attachment_image_src( $attachment_id, 'full' );
+ $url = $url[0];
+ } elseif ( isset( $_POST ) ) {
+ $data = $this->step_2_manage_upload();
+ $attachment_id = $data['attachment_id'];
+ $file = $data['file'];
+ $url = $data['url'];
+ }
+
+ if ( file_exists( $file ) ) {
+ list( $width, $height, $type, $attr ) = getimagesize( $file );
+ } else {
+ $data = wp_get_attachment_metadata( $attachment_id );
+ $height = isset( $data['height'] ) ? $data['height'] : 0;
+ $width = isset( $data['width'] ) ? $data['width'] : 0;
+ unset( $data );
+ }
+
+ $max_width = 0;
+ // For flex, limit size of image displayed to 1500px unless theme says otherwise
+ if ( current_theme_supports( 'custom-header', 'flex-width' ) ) {
+ $max_width = 1500;
+ }
+
+ if ( current_theme_supports( 'custom-header', 'max-width' ) ) {
+ $max_width = max( $max_width, get_theme_support( 'custom-header', 'max-width' ) );
+ }
+ $max_width = max( $max_width, get_theme_support( 'custom-header', 'width' ) );
+
+ // If flexible height isn't supported and the image is the exact right size
+ if ( ! current_theme_supports( 'custom-header', 'flex-height' ) && ! current_theme_supports( 'custom-header', 'flex-width' )
+ && $width == get_theme_support( 'custom-header', 'width' ) && $height == get_theme_support( 'custom-header', 'height' ) ) {
+ // Add the meta-data
+ if ( file_exists( $file ) ) {
+ wp_update_attachment_metadata( $attachment_id, wp_generate_attachment_metadata( $attachment_id, $file ) );
+ }
+
+ $this->set_header_image( compact( 'url', 'attachment_id', 'width', 'height' ) );
+
+ /**
+ * Fires after the header image is set or an error is returned.
+ *
+ * @since 2.1.0
+ *
+ * @param string $file Path to the file.
+ * @param int $attachment_id Attachment ID.
+ */
+ do_action( 'wp_create_file_in_uploads', $file, $attachment_id ); // For replication
+
+ return $this->finished();
+ } elseif ( $width > $max_width ) {
+ $oitar = $width / $max_width;
+ $image = wp_crop_image( $attachment_id, 0, 0, $width, $height, $max_width, $height / $oitar, false, str_replace( wp_basename( $file ), 'midsize-' . wp_basename( $file ), $file ) );
+ if ( ! $image || is_wp_error( $image ) ) {
+ wp_die( __( 'Image could not be processed. Please go back and try again.' ), __( 'Image Processing Error' ) );
+ }
+
+ /** This filter is documented in wp-admin/custom-header.php */
+ $image = apply_filters( 'wp_create_file_in_uploads', $image, $attachment_id ); // For replication
+
+ $url = str_replace( wp_basename( $url ), wp_basename( $image ), $url );
+ $width = $width / $oitar;
+ $height = $height / $oitar;
+ } else {
+ $oitar = 1;
+ }
+ ?>
+
+<div class="wrap">
+<h1><?php _e( 'Crop Header Image' ); ?></h1>
+
+<form method="post" action="<?php echo esc_url( add_query_arg( 'step', 3 ) ); ?>">
+ <p class="hide-if-no-js"><?php _e( 'Choose the part of the image you want to use as your header.' ); ?></p>
+ <p class="hide-if-js"><strong><?php _e( 'You need JavaScript to choose a part of the image.' ); ?></strong></p>
+
+ <div id="crop_image" style="position: relative">
+ <img src="<?php echo esc_url( $url ); ?>" id="upload" width="<?php echo $width; ?>" height="<?php echo $height; ?>" alt="" />
+ </div>
+
+ <input type="hidden" name="x1" id="x1" value="0"/>
+ <input type="hidden" name="y1" id="y1" value="0"/>
+ <input type="hidden" name="width" id="width" value="<?php echo esc_attr( $width ); ?>"/>
+ <input type="hidden" name="height" id="height" value="<?php echo esc_attr( $height ); ?>"/>
+ <input type="hidden" name="attachment_id" id="attachment_id" value="<?php echo esc_attr( $attachment_id ); ?>" />
+ <input type="hidden" name="oitar" id="oitar" value="<?php echo esc_attr( $oitar ); ?>" />
+ <?php if ( empty( $_POST ) && isset( $_GET['file'] ) ) { ?>
+ <input type="hidden" name="create-new-attachment" value="true" />
+ <?php } ?>
+ <?php wp_nonce_field( 'custom-header-crop-image' ); ?>
+
+ <p class="submit">
+ <?php submit_button( __( 'Crop and Publish' ), 'primary', 'submit', false ); ?>
+ <?php
+ if ( isset( $oitar ) && 1 == $oitar && ( current_theme_supports( 'custom-header', 'flex-height' ) || current_theme_supports( 'custom-header', 'flex-width' ) ) ) {
+ submit_button( __( 'Skip Cropping, Publish Image as Is' ), '', 'skip-cropping', false );
+ }
+ ?>
+ </p>
+</form>
+</div>
+ <?php
+ }
+
+
+ /**
+ * Upload the file to be cropped in the second step.
+ *
+ * @since 3.4.0
+ */
+ public function step_2_manage_upload() {
+ $overrides = array( 'test_form' => false );
+
+ $uploaded_file = $_FILES['import'];
+ $wp_filetype = wp_check_filetype_and_ext( $uploaded_file['tmp_name'], $uploaded_file['name'] );
+ if ( ! wp_match_mime_types( 'image', $wp_filetype['type'] ) ) {
+ wp_die( __( 'The uploaded file is not a valid image. Please try again.' ) );
+ }
+
+ $file = wp_handle_upload( $uploaded_file, $overrides );
+
+ if ( isset( $file['error'] ) ) {
+ wp_die( $file['error'], __( 'Image Upload Error' ) );
+ }
+
+ $url = $file['url'];
+ $type = $file['type'];
+ $file = $file['file'];
+ $filename = wp_basename( $file );
+
+ // Construct the object array
+ $object = array(
+ 'post_title' => $filename,
+ 'post_content' => $url,
+ 'post_mime_type' => $type,
+ 'guid' => $url,
+ 'context' => 'custom-header',
+ );
+
+ // Save the data
+ $attachment_id = wp_insert_attachment( $object, $file );
+ return compact( 'attachment_id', 'file', 'filename', 'url', 'type' );
+ }
+
+ /**
+ * Display third step of custom header image page.
+ *
+ * @since 2.1.0
+ * @since 4.4.0 Switched to using wp_get_attachment_url() instead of the guid
+ * for retrieving the header image URL.
+ */
+ public function step_3() {
+ check_admin_referer( 'custom-header-crop-image' );
+
+ if ( ! current_theme_supports( 'custom-header', 'uploads' ) ) {
+ wp_die(
+ '<h1>' . __( 'Something went wrong.' ) . '</h1>' .
+ '<p>' . __( 'The current theme does not support uploading a custom header image.' ) . '</p>',
+ 403
+ );
+ }
+
+ if ( ! empty( $_POST['skip-cropping'] ) && ! ( current_theme_supports( 'custom-header', 'flex-height' ) || current_theme_supports( 'custom-header', 'flex-width' ) ) ) {
+ wp_die(
+ '<h1>' . __( 'Something went wrong.' ) . '</h1>' .
+ '<p>' . __( 'The current theme does not support a flexible sized header image.' ) . '</p>',
+ 403
+ );
+ }
+
+ if ( $_POST['oitar'] > 1 ) {
+ $_POST['x1'] = $_POST['x1'] * $_POST['oitar'];
+ $_POST['y1'] = $_POST['y1'] * $_POST['oitar'];
+ $_POST['width'] = $_POST['width'] * $_POST['oitar'];
+ $_POST['height'] = $_POST['height'] * $_POST['oitar'];
+ }
+
+ $attachment_id = absint( $_POST['attachment_id'] );
+ $original = get_attached_file( $attachment_id );
+
+ $dimensions = $this->get_header_dimensions(
+ array(
+ 'height' => $_POST['height'],
+ 'width' => $_POST['width'],
+ )
+ );
+ $height = $dimensions['dst_height'];
+ $width = $dimensions['dst_width'];
+
+ if ( empty( $_POST['skip-cropping'] ) ) {
+ $cropped = wp_crop_image( $attachment_id, (int) $_POST['x1'], (int) $_POST['y1'], (int) $_POST['width'], (int) $_POST['height'], $width, $height );
+ } elseif ( ! empty( $_POST['create-new-attachment'] ) ) {
+ $cropped = _copy_image_file( $attachment_id );
+ } else {
+ $cropped = get_attached_file( $attachment_id );
+ }
+
+ if ( ! $cropped || is_wp_error( $cropped ) ) {
+ wp_die( __( 'Image could not be processed. Please go back and try again.' ), __( 'Image Processing Error' ) );
+ }
+
+ /** This filter is documented in wp-admin/custom-header.php */
+ $cropped = apply_filters( 'wp_create_file_in_uploads', $cropped, $attachment_id ); // For replication
+
+ $object = $this->create_attachment_object( $cropped, $attachment_id );
+
+ if ( ! empty( $_POST['create-new-attachment'] ) ) {
+ unset( $object['ID'] );
+ }
+
+ // Update the attachment
+ $attachment_id = $this->insert_attachment( $object, $cropped );
+
+ $url = wp_get_attachment_url( $attachment_id );
+ $this->set_header_image( compact( 'url', 'attachment_id', 'width', 'height' ) );
+
+ // Cleanup.
+ $medium = str_replace( wp_basename( $original ), 'midsize-' . wp_basename( $original ), $original );
+ if ( file_exists( $medium ) ) {
+ wp_delete_file( $medium );
+ }
+
+ if ( empty( $_POST['create-new-attachment'] ) && empty( $_POST['skip-cropping'] ) ) {
+ wp_delete_file( $original );
+ }
+
+ return $this->finished();
+ }
+
+ /**
+ * Display last step of custom header image page.
+ *
+ * @since 2.1.0
+ */
+ public function finished() {
+ $this->updated = true;
+ $this->step_1();
+ }
+
+ /**
+ * Display the page based on the current step.
+ *
+ * @since 2.1.0
+ */
+ public function admin_page() {
+ if ( ! current_user_can( 'edit_theme_options' ) ) {
+ wp_die( __( 'Sorry, you are not allowed to customize headers.' ) );
+ }
+ $step = $this->step();
+ if ( 2 == $step ) {
+ $this->step_2();
+ } elseif ( 3 == $step ) {
+ $this->step_3();
+ } else {
+ $this->step_1();
+ }
+ }
+
+ /**
+ * Unused since 3.5.0.
+ *
+ * @since 3.4.0
+ *
+ * @param array $form_fields
+ * @return array $form_fields
+ */
+ public function attachment_fields_to_edit( $form_fields ) {
+ return $form_fields;
+ }
+
+ /**
+ * Unused since 3.5.0.
+ *
+ * @since 3.4.0
+ *
+ * @param array $tabs
+ * @return array $tabs
+ */
+ public function filter_upload_tabs( $tabs ) {
+ return $tabs;
+ }
+
+ /**
+ * Choose a header image, selected from existing uploaded and default headers,
+ * or provide an array of uploaded header data (either new, or from media library).
+ *
+ * @since 3.4.0
+ *
+ * @param mixed $choice Which header image to select. Allows for values of 'random-default-image',
+ * for randomly cycling among the default images; 'random-uploaded-image', for randomly cycling
+ * among the uploaded images; the key of a default image registered for that theme; and
+ * the key of an image uploaded for that theme (the attachment ID of the image).
+ * Or an array of arguments: attachment_id, url, width, height. All are required.
+ */
+ final public function set_header_image( $choice ) {
+ if ( is_array( $choice ) || is_object( $choice ) ) {
+ $choice = (array) $choice;
+ if ( ! isset( $choice['attachment_id'] ) || ! isset( $choice['url'] ) ) {
+ return;
+ }
+
+ $choice['url'] = esc_url_raw( $choice['url'] );
+
+ $header_image_data = (object) array(
+ 'attachment_id' => $choice['attachment_id'],
+ 'url' => $choice['url'],
+ 'thumbnail_url' => $choice['url'],
+ 'height' => $choice['height'],
+ 'width' => $choice['width'],
+ );
+
+ update_post_meta( $choice['attachment_id'], '_wp_attachment_is_custom_header', get_stylesheet() );
+ set_theme_mod( 'header_image', $choice['url'] );
+ set_theme_mod( 'header_image_data', $header_image_data );
+ return;
+ }
+
+ if ( in_array( $choice, array( 'remove-header', 'random-default-image', 'random-uploaded-image' ) ) ) {
+ set_theme_mod( 'header_image', $choice );
+ remove_theme_mod( 'header_image_data' );
+ return;
+ }
+
+ $uploaded = get_uploaded_header_images();
+ if ( $uploaded && isset( $uploaded[ $choice ] ) ) {
+ $header_image_data = $uploaded[ $choice ];
+
+ } else {
+ $this->process_default_headers();
+ if ( isset( $this->default_headers[ $choice ] ) ) {
+ $header_image_data = $this->default_headers[ $choice ];
+ } else {
+ return;
+ }
+ }
+
+ set_theme_mod( 'header_image', esc_url_raw( $header_image_data['url'] ) );
+ set_theme_mod( 'header_image_data', $header_image_data );
+ }
+
+ /**
+ * Remove a header image.
+ *
+ * @since 3.4.0
+ */
+ final public function remove_header_image() {
+ $this->set_header_image( 'remove-header' );
+ }
+
+ /**
+ * Reset a header image to the default image for the theme.
+ *
+ * This method does not do anything if the theme does not have a default header image.
+ *
+ * @since 3.4.0
+ */
+ final public function reset_header_image() {
+ $this->process_default_headers();
+ $default = get_theme_support( 'custom-header', 'default-image' );
+
+ if ( ! $default ) {
+ $this->remove_header_image();
+ return;
+ }
+ $default = sprintf( $default, get_template_directory_uri(), get_stylesheet_directory_uri() );
+
+ $default_data = array();
+ foreach ( $this->default_headers as $header => $details ) {
+ if ( $details['url'] == $default ) {
+ $default_data = $details;
+ break;
+ }
+ }
+
+ set_theme_mod( 'header_image', $default );
+ set_theme_mod( 'header_image_data', (object) $default_data );
+ }
+
+ /**
+ * Calculate width and height based on what the currently selected theme supports.
+ *
+ * @since 3.9.0
+ *
+ * @param array $dimensions
+ * @return array dst_height and dst_width of header image.
+ */
+ final public function get_header_dimensions( $dimensions ) {
+ $max_width = 0;
+ $width = absint( $dimensions['width'] );
+ $height = absint( $dimensions['height'] );
+ $theme_height = get_theme_support( 'custom-header', 'height' );
+ $theme_width = get_theme_support( 'custom-header', 'width' );
+ $has_flex_width = current_theme_supports( 'custom-header', 'flex-width' );
+ $has_flex_height = current_theme_supports( 'custom-header', 'flex-height' );
+ $has_max_width = current_theme_supports( 'custom-header', 'max-width' );
+ $dst = array(
+ 'dst_height' => null,
+ 'dst_width' => null,
+ );
+
+ // For flex, limit size of image displayed to 1500px unless theme says otherwise
+ if ( $has_flex_width ) {
+ $max_width = 1500;
+ }
+
+ if ( $has_max_width ) {
+ $max_width = max( $max_width, get_theme_support( 'custom-header', 'max-width' ) );
+ }
+ $max_width = max( $max_width, $theme_width );
+
+ if ( $has_flex_height && ( ! $has_flex_width || $width > $max_width ) ) {
+ $dst['dst_height'] = absint( $height * ( $max_width / $width ) );
+ } elseif ( $has_flex_height && $has_flex_width ) {
+ $dst['dst_height'] = $height;
+ } else {
+ $dst['dst_height'] = $theme_height;
+ }
+
+ if ( $has_flex_width && ( ! $has_flex_height || $width > $max_width ) ) {
+ $dst['dst_width'] = absint( $width * ( $max_width / $width ) );
+ } elseif ( $has_flex_width && $has_flex_height ) {
+ $dst['dst_width'] = $width;
+ } else {
+ $dst['dst_width'] = $theme_width;
+ }
+
+ return $dst;
+ }
+
+ /**
+ * Create an attachment 'object'.
+ *
+ * @since 3.9.0
+ *
+ * @param string $cropped Cropped image URL.
+ * @param int $parent_attachment_id Attachment ID of parent image.
+ * @return array Attachment object.
+ */
+ final public function create_attachment_object( $cropped, $parent_attachment_id ) {
+ $parent = get_post( $parent_attachment_id );
+ $parent_url = wp_get_attachment_url( $parent->ID );
+ $url = str_replace( wp_basename( $parent_url ), wp_basename( $cropped ), $parent_url );
+
+ $size = @getimagesize( $cropped );
+ $image_type = ( $size ) ? $size['mime'] : 'image/jpeg';
+
+ $object = array(
+ 'ID' => $parent_attachment_id,
+ 'post_title' => wp_basename( $cropped ),
+ 'post_mime_type' => $image_type,
+ 'guid' => $url,
+ 'context' => 'custom-header',
+ 'post_parent' => $parent_attachment_id,
+ );
+
+ return $object;
+ }
+
+ /**
+ * Insert an attachment and its metadata.
+ *
+ * @since 3.9.0
+ *
+ * @param array $object Attachment object.
+ * @param string $cropped Cropped image URL.
+ * @return int Attachment ID.
+ */
+ final public function insert_attachment( $object, $cropped ) {
+ $parent_id = isset( $object['post_parent'] ) ? $object['post_parent'] : null;
+ unset( $object['post_parent'] );
+
+ $attachment_id = wp_insert_attachment( $object, $cropped );
+ $metadata = wp_generate_attachment_metadata( $attachment_id, $cropped );
+
+ // If this is a crop, save the original attachment ID as metadata.
+ if ( $parent_id ) {
+ $metadata['attachment_parent'] = $parent_id;
+ }
+
+ /**
+ * Filters the header image attachment metadata.
+ *
+ * @since 3.9.0
+ *
+ * @see wp_generate_attachment_metadata()
+ *
+ * @param array $metadata Attachment metadata.
+ */
+ $metadata = apply_filters( 'wp_header_image_attachment_metadata', $metadata );
+
+ wp_update_attachment_metadata( $attachment_id, $metadata );
+
+ return $attachment_id;
+ }
+
+ /**
+ * Gets attachment uploaded by Media Manager, crops it, then saves it as a
+ * new object. Returns JSON-encoded object details.
+ *
+ * @since 3.9.0
+ */
+ public function ajax_header_crop() {
+ check_ajax_referer( 'image_editor-' . $_POST['id'], 'nonce' );
+
+ if ( ! current_user_can( 'edit_theme_options' ) ) {
+ wp_send_json_error();
+ }
+
+ if ( ! current_theme_supports( 'custom-header', 'uploads' ) ) {
+ wp_send_json_error();
+ }
+
+ $crop_details = $_POST['cropDetails'];
+
+ $dimensions = $this->get_header_dimensions(
+ array(
+ 'height' => $crop_details['height'],
+ 'width' => $crop_details['width'],
+ )
+ );
+
+ $attachment_id = absint( $_POST['id'] );
+
+ $cropped = wp_crop_image(
+ $attachment_id,
+ (int) $crop_details['x1'],
+ (int) $crop_details['y1'],
+ (int) $crop_details['width'],
+ (int) $crop_details['height'],
+ (int) $dimensions['dst_width'],
+ (int) $dimensions['dst_height']
+ );
+
+ if ( ! $cropped || is_wp_error( $cropped ) ) {
+ wp_send_json_error( array( 'message' => __( 'Image could not be processed. Please go back and try again.' ) ) );
+ }
+
+ /** This filter is documented in wp-admin/custom-header.php */
+ $cropped = apply_filters( 'wp_create_file_in_uploads', $cropped, $attachment_id ); // For replication
+
+ $object = $this->create_attachment_object( $cropped, $attachment_id );
+
+ $previous = $this->get_previous_crop( $object );
+
+ if ( $previous ) {
+ $object['ID'] = $previous;
+ } else {
+ unset( $object['ID'] );
+ }
+
+ $new_attachment_id = $this->insert_attachment( $object, $cropped );
+
+ $object['attachment_id'] = $new_attachment_id;
+ $object['url'] = wp_get_attachment_url( $new_attachment_id );
+
+ $object['width'] = $dimensions['dst_width'];
+ $object['height'] = $dimensions['dst_height'];
+
+ wp_send_json_success( $object );
+ }
+
+ /**
+ * Given an attachment ID for a header image, updates its "last used"
+ * timestamp to now.
+ *
+ * Triggered when the user tries adds a new header image from the
+ * Media Manager, even if s/he doesn't save that change.
+ *
+ * @since 3.9.0
+ */
+ public function ajax_header_add() {
+ check_ajax_referer( 'header-add', 'nonce' );
+
+ if ( ! current_user_can( 'edit_theme_options' ) ) {
+ wp_send_json_error();
+ }
+
+ $attachment_id = absint( $_POST['attachment_id'] );
+ if ( $attachment_id < 1 ) {
+ wp_send_json_error();
+ }
+
+ $key = '_wp_attachment_custom_header_last_used_' . get_stylesheet();
+ update_post_meta( $attachment_id, $key, time() );
+ update_post_meta( $attachment_id, '_wp_attachment_is_custom_header', get_stylesheet() );
+
+ wp_send_json_success();
+ }
+
+ /**
+ * Given an attachment ID for a header image, unsets it as a user-uploaded
+ * header image for the current theme.
+ *
+ * Triggered when the user clicks the overlay "X" button next to each image
+ * choice in the Customizer's Header tool.
+ *
+ * @since 3.9.0
+ */
+ public function ajax_header_remove() {
+ check_ajax_referer( 'header-remove', 'nonce' );
+
+ if ( ! current_user_can( 'edit_theme_options' ) ) {
+ wp_send_json_error();
+ }
+
+ $attachment_id = absint( $_POST['attachment_id'] );
+ if ( $attachment_id < 1 ) {
+ wp_send_json_error();
+ }
+
+ $key = '_wp_attachment_custom_header_last_used_' . get_stylesheet();
+ delete_post_meta( $attachment_id, $key );
+ delete_post_meta( $attachment_id, '_wp_attachment_is_custom_header', get_stylesheet() );
+
+ wp_send_json_success();
+ }
+
+ /**
+ * Updates the last-used postmeta on a header image attachment after saving a new header image via the Customizer.
+ *
+ * @since 3.9.0
+ *
+ * @param WP_Customize_Manager $wp_customize Customize manager.
+ */
+ public function customize_set_last_used( $wp_customize ) {
+
+ $header_image_data_setting = $wp_customize->get_setting( 'header_image_data' );
+ if ( ! $header_image_data_setting ) {
+ return;
+ }
+ $data = $header_image_data_setting->post_value();
+
+ if ( ! isset( $data['attachment_id'] ) ) {
+ return;
+ }
+
+ $attachment_id = $data['attachment_id'];
+ $key = '_wp_attachment_custom_header_last_used_' . get_stylesheet();
+ update_post_meta( $attachment_id, $key, time() );
+ }
+
+ /**
+ * Gets the details of default header images if defined.
+ *
+ * @since 3.9.0
+ *
+ * @return array Default header images.
+ */
+ public function get_default_header_images() {
+ $this->process_default_headers();
+
+ // Get the default image if there is one.
+ $default = get_theme_support( 'custom-header', 'default-image' );
+
+ if ( ! $default ) { // If not,
+ return $this->default_headers; // easy peasy.
+ }
+
+ $default = sprintf( $default, get_template_directory_uri(), get_stylesheet_directory_uri() );
+ $already_has_default = false;
+
+ foreach ( $this->default_headers as $k => $h ) {
+ if ( $h['url'] === $default ) {
+ $already_has_default = true;
+ break;
+ }
+ }
+
+ if ( $already_has_default ) {
+ return $this->default_headers;
+ }
+
+ // If the one true image isn't included in the default set, prepend it.
+ $header_images = array();
+ $header_images['default'] = array(
+ 'url' => $default,
+ 'thumbnail_url' => $default,
+ 'description' => 'Default',
+ );
+
+ // The rest of the set comes after.
+ return array_merge( $header_images, $this->default_headers );
+ }
+
+ /**
+ * Gets the previously uploaded header images.
+ *
+ * @since 3.9.0
+ *
+ * @return array Uploaded header images.
+ */
+ public function get_uploaded_header_images() {
+ $header_images = get_uploaded_header_images();
+ $timestamp_key = '_wp_attachment_custom_header_last_used_' . get_stylesheet();
+ $alt_text_key = '_wp_attachment_image_alt';
+
+ foreach ( $header_images as &$header_image ) {
+ $header_meta = get_post_meta( $header_image['attachment_id'] );
+ $header_image['timestamp'] = isset( $header_meta[ $timestamp_key ] ) ? $header_meta[ $timestamp_key ] : '';
+ $header_image['alt_text'] = isset( $header_meta[ $alt_text_key ] ) ? $header_meta[ $alt_text_key ] : '';
+ }
+
+ return $header_images;
+ }
+
+ /**
+ * Get the ID of a previous crop from the same base image.
+ *
+ * @since 4.9.0
+ *
+ * @param array $object A crop attachment object.
+ * @return int|false An attachment ID if one exists. False if none.
+ */
+ public function get_previous_crop( $object ) {
+ $header_images = $this->get_uploaded_header_images();
+
+ // Bail early if there are no header images.
+ if ( empty( $header_images ) ) {
+ return false;
+ }
+
+ $previous = false;
+
+ foreach ( $header_images as $image ) {
+ if ( $image['attachment_parent'] === $object['post_parent'] ) {
+ $previous = $image['attachment_id'];
+ break;
+ }
+ }
+
+ return $previous;
+ }
+}
diff --git a/www/crm/wp-admin/customize.php b/www/crm/wp-admin/customize.php
new file mode 100644
index 00000000..2486f901
--- /dev/null
+++ b/www/crm/wp-admin/customize.php
@@ -0,0 +1,269 @@
+<?php
+/**
+ * Theme Customize Screen.
+ *
+ * @package WordPress
+ * @subpackage Customize
+ * @since 3.4.0
+ */
+
+define( 'IFRAME_REQUEST', true );
+
+/** Load WordPress Administration Bootstrap */
+require_once( dirname( __FILE__ ) . '/admin.php' );
+
+if ( ! current_user_can( 'customize' ) ) {
+ wp_die(
+ '<h1>' . __( 'You need a higher level of permission.' ) . '</h1>' .
+ '<p>' . __( 'Sorry, you are not allowed to customize this site.' ) . '</p>',
+ 403
+ );
+}
+
+/**
+ * @global WP_Scripts $wp_scripts
+ * @global WP_Customize_Manager $wp_customize
+ */
+global $wp_scripts, $wp_customize;
+
+if ( $wp_customize->changeset_post_id() ) {
+ $changeset_post = get_post( $wp_customize->changeset_post_id() );
+
+ if ( ! current_user_can( get_post_type_object( 'customize_changeset' )->cap->edit_post, $changeset_post->ID ) ) {
+ wp_die(
+ '<h1>' . __( 'You need a higher level of permission.' ) . '</h1>' .
+ '<p>' . __( 'Sorry, you are not allowed to edit this changeset.' ) . '</p>',
+ 403
+ );
+ }
+
+ $missed_schedule = (
+ 'future' === $changeset_post->post_status &&
+ get_post_time( 'G', true, $changeset_post ) < time()
+ );
+ if ( $missed_schedule ) {
+ /*
+ * Note that an Ajax request spawns here instead of just calling `wp_publish_post( $changeset_post->ID )`.
+ *
+ * Because WP_Customize_Manager is not instantiated for customize.php with the `settings_previewed=false`
+ * argument, settings cannot be reliably saved. Some logic short-circuits if the current value is the
+ * same as the value being saved. This is particularly true for options via `update_option()`.
+ *
+ * By opening an Ajax request, this is avoided and the changeset is published. See #39221.
+ */
+ $nonces = $wp_customize->get_nonces();
+ $request_args = array(
+ 'nonce' => $nonces['save'],
+ 'customize_changeset_uuid' => $wp_customize->changeset_uuid(),
+ 'wp_customize' => 'on',
+ 'customize_changeset_status' => 'publish',
+ );
+ ob_start();
+ ?>
+ <?php wp_print_scripts( array( 'wp-util' ) ); ?>
+ <script>
+ wp.ajax.post( 'customize_save', <?php echo wp_json_encode( $request_args ); ?> );
+ </script>
+ <?php
+ $script = ob_get_clean();
+
+ wp_die(
+ '<h1>' . __( 'Your scheduled changes just published' ) . '</h1>' .
+ '<p><a href="' . esc_url( remove_query_arg( 'changeset_uuid' ) ) . '">' . __( 'Customize New Changes' ) . '</a></p>' . $script,
+ 200
+ );
+ }
+
+ if ( in_array( get_post_status( $changeset_post->ID ), array( 'publish', 'trash' ), true ) ) {
+ wp_die(
+ '<h1>' . __( 'Something went wrong.' ) . '</h1>' .
+ '<p>' . __( 'This changeset cannot be further modified.' ) . '</p>' .
+ '<p><a href="' . esc_url( remove_query_arg( 'changeset_uuid' ) ) . '">' . __( 'Customize New Changes' ) . '</a></p>',
+ 403
+ );
+ }
+}
+
+
+wp_reset_vars( array( 'url', 'return', 'autofocus' ) );
+if ( ! empty( $url ) ) {
+ $wp_customize->set_preview_url( wp_unslash( $url ) );
+}
+if ( ! empty( $return ) ) {
+ $wp_customize->set_return_url( wp_unslash( $return ) );
+}
+if ( ! empty( $autofocus ) && is_array( $autofocus ) ) {
+ $wp_customize->set_autofocus( wp_unslash( $autofocus ) );
+}
+
+$registered = $wp_scripts->registered;
+$wp_scripts = new WP_Scripts;
+$wp_scripts->registered = $registered;
+
+add_action( 'customize_controls_print_scripts', 'print_head_scripts', 20 );
+add_action( 'customize_controls_print_footer_scripts', '_wp_footer_scripts' );
+add_action( 'customize_controls_print_styles', 'print_admin_styles', 20 );
+
+/**
+ * Fires when Customizer controls are initialized, before scripts are enqueued.
+ *
+ * @since 3.4.0
+ */
+do_action( 'customize_controls_init' );
+
+wp_enqueue_script( 'heartbeat' );
+wp_enqueue_script( 'customize-controls' );
+wp_enqueue_style( 'customize-controls' );
+
+/**
+ * Enqueue Customizer control scripts.
+ *
+ * @since 3.4.0
+ */
+do_action( 'customize_controls_enqueue_scripts' );
+
+// Let's roll.
+@header( 'Content-Type: ' . get_option( 'html_type' ) . '; charset=' . get_option( 'blog_charset' ) );
+
+wp_user_settings();
+_wp_admin_html_begin();
+
+$body_class = 'wp-core-ui wp-customizer js';
+
+if ( wp_is_mobile() ) :
+ $body_class .= ' mobile';
+
+ ?>
+ <meta name="viewport" id="viewport-meta" content="width=device-width, initial-scale=1.0, minimum-scale=0.5, maximum-scale=1.2" />
+ <?php
+endif;
+
+if ( $wp_customize->is_ios() ) {
+ $body_class .= ' ios';
+}
+
+if ( is_rtl() ) {
+ $body_class .= ' rtl';
+}
+$body_class .= ' locale-' . sanitize_html_class( strtolower( str_replace( '_', '-', get_user_locale() ) ) );
+
+$admin_title = sprintf( $wp_customize->get_document_title_template(), __( 'Loading&hellip;' ) );
+
+?>
+<title><?php echo $admin_title; ?></title>
+
+<script type="text/javascript">
+var ajaxurl = <?php echo wp_json_encode( admin_url( 'admin-ajax.php', 'relative' ) ); ?>,
+ pagenow = 'customize';
+</script>
+
+<?php
+/**
+ * Fires when Customizer control styles are printed.
+ *
+ * @since 3.4.0
+ */
+do_action( 'customize_controls_print_styles' );
+
+/**
+ * Fires when Customizer control scripts are printed.
+ *
+ * @since 3.4.0
+ */
+do_action( 'customize_controls_print_scripts' );
+?>
+</head>
+<body class="<?php echo esc_attr( $body_class ); ?>">
+<div class="wp-full-overlay expanded">
+ <form id="customize-controls" class="wrap wp-full-overlay-sidebar">
+ <div id="customize-header-actions" class="wp-full-overlay-header">
+ <?php $save_text = $wp_customize->is_theme_active() ? __( 'Publish' ) : __( 'Activate &amp; Publish' ); ?>
+ <div id="customize-save-button-wrapper" class="customize-save-button-wrapper" >
+ <?php submit_button( $save_text, 'primary save', 'save', false ); ?>
+ <button id="publish-settings" class="publish-settings button-primary button dashicons dashicons-admin-generic" aria-label="<?php esc_attr_e( 'Publish Settings' ); ?>" aria-expanded="false" disabled></button>
+ </div>
+ <span class="spinner"></span>
+ <button type="button" class="customize-controls-preview-toggle">
+ <span class="controls"><?php _e( 'Customize' ); ?></span>
+ <span class="preview"><?php _e( 'Preview' ); ?></span>
+ </button>
+ <a class="customize-controls-close" href="<?php echo esc_url( $wp_customize->get_return_url() ); ?>">
+ <span class="screen-reader-text"><?php _e( 'Close the Customizer and go back to the previous page' ); ?></span>
+ </a>
+ </div>
+
+ <div id="customize-sidebar-outer-content">
+ <div id="customize-outer-theme-controls">
+ <ul class="customize-outer-pane-parent"><?php // Outer panel and sections are not implemented, but its here as a placeholder to avoid any side-effect in api.Section. ?></ul>
+ </div>
+ </div>
+
+ <div id="widgets-right" class="wp-clearfix"><!-- For Widget Customizer, many widgets try to look for instances under div#widgets-right, so we have to add that ID to a container div in the Customizer for compat -->
+ <div id="customize-notifications-area" class="customize-control-notifications-container">
+ <ul></ul>
+ </div>
+ <div class="wp-full-overlay-sidebar-content" tabindex="-1">
+ <div id="customize-info" class="accordion-section customize-info">
+ <div class="accordion-section-title">
+ <span class="preview-notice">
+ <?php
+ echo sprintf( __( 'You are customizing %s' ), '<strong class="panel-title site-title">' . get_bloginfo( 'name', 'display' ) . '</strong>' );
+ ?>
+ </span>
+ <button type="button" class="customize-help-toggle dashicons dashicons-editor-help" aria-expanded="false"><span class="screen-reader-text"><?php _e( 'Help' ); ?></span></button>
+ </div>
+ <div class="customize-panel-description">
+ <?php
+ _e( 'The Customizer allows you to preview changes to your site before publishing them. You can navigate to different pages on your site within the preview. Edit shortcuts are shown for some editable elements.' );
+ ?>
+ </div>
+ </div>
+
+ <div id="customize-theme-controls">
+ <ul class="customize-pane-parent"><?php // Panels and sections are managed here via JavaScript ?></ul>
+ </div>
+ </div>
+ </div>
+
+ <div id="customize-footer-actions" class="wp-full-overlay-footer">
+ <button type="button" class="collapse-sidebar button" aria-expanded="true" aria-label="<?php echo esc_attr( _x( 'Hide Controls', 'label for hide controls button without length constraints' ) ); ?>">
+ <span class="collapse-sidebar-arrow"></span>
+ <span class="collapse-sidebar-label"><?php _ex( 'Hide Controls', 'short (~12 characters) label for hide controls button' ); ?></span>
+ </button>
+ <?php $previewable_devices = $wp_customize->get_previewable_devices(); ?>
+ <?php if ( ! empty( $previewable_devices ) ) : ?>
+ <div class="devices-wrapper">
+ <div class="devices">
+ <?php foreach ( (array) $previewable_devices as $device => $settings ) : ?>
+ <?php
+ if ( empty( $settings['label'] ) ) {
+ continue;
+ }
+ $active = ! empty( $settings['default'] );
+ $class = 'preview-' . $device;
+ if ( $active ) {
+ $class .= ' active';
+ }
+ ?>
+ <button type="button" class="<?php echo esc_attr( $class ); ?>" aria-pressed="<?php echo esc_attr( $active ); ?>" data-device="<?php echo esc_attr( $device ); ?>">
+ <span class="screen-reader-text"><?php echo esc_html( $settings['label'] ); ?></span>
+ </button>
+ <?php endforeach; ?>
+ </div>
+ </div>
+ <?php endif; ?>
+ </div>
+ </form>
+ <div id="customize-preview" class="wp-full-overlay-main"></div>
+ <?php
+
+ /**
+ * Prints templates, control scripts, and settings in the footer.
+ *
+ * @since 3.4.0
+ */
+ do_action( 'customize_controls_print_footer_scripts' );
+ ?>
+</div>
+</body>
+</html>
diff --git a/www/crm/wp-admin/edit-comments.php b/www/crm/wp-admin/edit-comments.php
new file mode 100644
index 00000000..d2ef006a
--- /dev/null
+++ b/www/crm/wp-admin/edit-comments.php
@@ -0,0 +1,358 @@
+<?php
+/**
+ * Edit Comments Administration Screen.
+ *
+ * @package WordPress
+ * @subpackage Administration
+ */
+
+/** WordPress Administration Bootstrap */
+require_once( dirname( __FILE__ ) . '/admin.php' );
+if ( ! current_user_can( 'edit_posts' ) ) {
+ wp_die(
+ '<h1>' . __( 'You need a higher level of permission.' ) . '</h1>' .
+ '<p>' . __( 'Sorry, you are not allowed to edit comments.' ) . '</p>',
+ 403
+ );
+}
+
+$wp_list_table = _get_list_table( 'WP_Comments_List_Table' );
+$pagenum = $wp_list_table->get_pagenum();
+
+$doaction = $wp_list_table->current_action();
+
+if ( $doaction ) {
+ check_admin_referer( 'bulk-comments' );
+
+ if ( 'delete_all' == $doaction && ! empty( $_REQUEST['pagegen_timestamp'] ) ) {
+ $comment_status = wp_unslash( $_REQUEST['comment_status'] );
+ $delete_time = wp_unslash( $_REQUEST['pagegen_timestamp'] );
+ $comment_ids = $wpdb->get_col( $wpdb->prepare( "SELECT comment_ID FROM $wpdb->comments WHERE comment_approved = %s AND %s > comment_date_gmt", $comment_status, $delete_time ) );
+ $doaction = 'delete';
+ } elseif ( isset( $_REQUEST['delete_comments'] ) ) {
+ $comment_ids = $_REQUEST['delete_comments'];
+ $doaction = ( $_REQUEST['action'] != -1 ) ? $_REQUEST['action'] : $_REQUEST['action2'];
+ } elseif ( isset( $_REQUEST['ids'] ) ) {
+ $comment_ids = array_map( 'absint', explode( ',', $_REQUEST['ids'] ) );
+ } elseif ( wp_get_referer() ) {
+ wp_safe_redirect( wp_get_referer() );
+ exit;
+ }
+
+ $approved = $unapproved = $spammed = $unspammed = $trashed = $untrashed = $deleted = 0;
+
+ $redirect_to = remove_query_arg( array( 'trashed', 'untrashed', 'deleted', 'spammed', 'unspammed', 'approved', 'unapproved', 'ids' ), wp_get_referer() );
+ $redirect_to = add_query_arg( 'paged', $pagenum, $redirect_to );
+
+ wp_defer_comment_counting( true );
+
+ foreach ( $comment_ids as $comment_id ) { // Check the permissions on each
+ if ( ! current_user_can( 'edit_comment', $comment_id ) ) {
+ continue;
+ }
+
+ switch ( $doaction ) {
+ case 'approve':
+ wp_set_comment_status( $comment_id, 'approve' );
+ $approved++;
+ break;
+ case 'unapprove':
+ wp_set_comment_status( $comment_id, 'hold' );
+ $unapproved++;
+ break;
+ case 'spam':
+ wp_spam_comment( $comment_id );
+ $spammed++;
+ break;
+ case 'unspam':
+ wp_unspam_comment( $comment_id );
+ $unspammed++;
+ break;
+ case 'trash':
+ wp_trash_comment( $comment_id );
+ $trashed++;
+ break;
+ case 'untrash':
+ wp_untrash_comment( $comment_id );
+ $untrashed++;
+ break;
+ case 'delete':
+ wp_delete_comment( $comment_id );
+ $deleted++;
+ break;
+ }
+ }
+
+ if ( ! in_array( $doaction, array( 'approve', 'unapprove', 'spam', 'unspam', 'trash', 'delete' ), true ) ) {
+ $screen = get_current_screen()->id;
+
+ /**
+ * Fires when a custom bulk action should be handled.
+ *
+ * The redirect link should be modified with success or failure feedback
+ * from the action to be used to display feedback to the user.
+ *
+ * The dynamic portion of the hook name, `$screen`, refers to the current screen ID.
+ *
+ * @since 4.7.0
+ *
+ * @param string $redirect_url The redirect URL.
+ * @param string $doaction The action being taken.
+ * @param array $items The items to take the action on.
+ */
+ $redirect_to = apply_filters( "handle_bulk_actions-{$screen}", $redirect_to, $doaction, $comment_ids );
+ }
+
+ wp_defer_comment_counting( false );
+
+ if ( $approved ) {
+ $redirect_to = add_query_arg( 'approved', $approved, $redirect_to );
+ }
+ if ( $unapproved ) {
+ $redirect_to = add_query_arg( 'unapproved', $unapproved, $redirect_to );
+ }
+ if ( $spammed ) {
+ $redirect_to = add_query_arg( 'spammed', $spammed, $redirect_to );
+ }
+ if ( $unspammed ) {
+ $redirect_to = add_query_arg( 'unspammed', $unspammed, $redirect_to );
+ }
+ if ( $trashed ) {
+ $redirect_to = add_query_arg( 'trashed', $trashed, $redirect_to );
+ }
+ if ( $untrashed ) {
+ $redirect_to = add_query_arg( 'untrashed', $untrashed, $redirect_to );
+ }
+ if ( $deleted ) {
+ $redirect_to = add_query_arg( 'deleted', $deleted, $redirect_to );
+ }
+ if ( $trashed || $spammed ) {
+ $redirect_to = add_query_arg( 'ids', join( ',', $comment_ids ), $redirect_to );
+ }
+
+ wp_safe_redirect( $redirect_to );
+ exit;
+} elseif ( ! empty( $_GET['_wp_http_referer'] ) ) {
+ wp_redirect( remove_query_arg( array( '_wp_http_referer', '_wpnonce' ), wp_unslash( $_SERVER['REQUEST_URI'] ) ) );
+ exit;
+}
+
+$wp_list_table->prepare_items();
+
+wp_enqueue_script( 'admin-comments' );
+enqueue_comment_hotkeys_js();
+
+if ( $post_id ) {
+ $comments_count = wp_count_comments( $post_id );
+ $draft_or_post_title = wp_html_excerpt( _draft_or_post_title( $post_id ), 50, '&hellip;' );
+ if ( $comments_count->moderated > 0 ) {
+ /* translators: 1: comments count, 2: post title */
+ $title = sprintf(
+ __( 'Comments (%1$s) on &#8220;%2$s&#8221;' ),
+ number_format_i18n( $comments_count->moderated ),
+ $draft_or_post_title
+ );
+ } else {
+ /* translators: %s: post title */
+ $title = sprintf(
+ __( 'Comments on &#8220;%s&#8221;' ),
+ $draft_or_post_title
+ );
+ }
+} else {
+ $comments_count = wp_count_comments();
+ if ( $comments_count->moderated > 0 ) {
+ /* translators: %s: comments count */
+ $title = sprintf(
+ __( 'Comments (%s)' ),
+ number_format_i18n( $comments_count->moderated )
+ );
+ } else {
+ $title = __( 'Comments' );
+ }
+}
+
+add_screen_option( 'per_page' );
+
+get_current_screen()->add_help_tab(
+ array(
+ 'id' => 'overview',
+ 'title' => __( 'Overview' ),
+ 'content' =>
+ '<p>' . __( 'You can manage comments made on your site similar to the way you manage posts and other content. This screen is customizable in the same ways as other management screens, and you can act on comments using the on-hover action links or the Bulk Actions.' ) . '</p>',
+ )
+);
+get_current_screen()->add_help_tab(
+ array(
+ 'id' => 'moderating-comments',
+ 'title' => __( 'Moderating Comments' ),
+ 'content' =>
+ '<p>' . __( 'A red bar on the left means the comment is waiting for you to moderate it.' ) . '</p>' .
+ '<p>' . __( 'In the <strong>Author</strong> column, in addition to the author&#8217;s name, email address, and blog URL, the commenter&#8217;s IP address is shown. Clicking on this link will show you all the comments made from this IP address.' ) . '</p>' .
+ '<p>' . __( 'In the <strong>Comment</strong> column, hovering over any comment gives you options to approve, reply (and approve), quick edit, edit, spam mark, or trash that comment.' ) . '</p>' .
+ '<p>' . __( 'In the <strong>In Response To</strong> column, there are three elements. The text is the name of the post that inspired the comment, and links to the post editor for that entry. The View Post link leads to that post on your live site. The small bubble with the number in it shows the number of approved comments that post has received. If there are pending comments, a red notification circle with the number of pending comments is displayed. Clicking the notification circle will filter the comments screen to show only pending comments on that post.' ) . '</p>' .
+ '<p>' . __( 'In the <strong>Submitted On</strong> column, the date and time the comment was left on your site appears. Clicking on the date/time link will take you to that comment on your live site.' ) . '</p>' .
+ '<p>' . __( 'Many people take advantage of keyboard shortcuts to moderate their comments more quickly. Use the link to the side to learn more.' ) . '</p>',
+ )
+);
+
+get_current_screen()->set_help_sidebar(
+ '<p><strong>' . __( 'For more information:' ) . '</strong></p>' .
+ '<p>' . __( '<a href="https://codex.wordpress.org/Administration_Screens#Comments">Documentation on Comments</a>' ) . '</p>' .
+ '<p>' . __( '<a href="https://codex.wordpress.org/Comment_Spam">Documentation on Comment Spam</a>' ) . '</p>' .
+ '<p>' . __( '<a href="https://codex.wordpress.org/Keyboard_Shortcuts">Documentation on Keyboard Shortcuts</a>' ) . '</p>' .
+ '<p>' . __( '<a href="https://wordpress.org/support/">Support</a>' ) . '</p>'
+);
+
+get_current_screen()->set_screen_reader_content(
+ array(
+ 'heading_views' => __( 'Filter comments list' ),
+ 'heading_pagination' => __( 'Comments list navigation' ),
+ 'heading_list' => __( 'Comments list' ),
+ )
+);
+
+require_once( ABSPATH . 'wp-admin/admin-header.php' );
+?>
+
+<div class="wrap">
+<h1 class="wp-heading-inline">
+<?php
+if ( $post_id ) {
+ /* translators: %s: link to post */
+ printf(
+ __( 'Comments on &#8220;%s&#8221;' ),
+ sprintf(
+ '<a href="%1$s">%2$s</a>',
+ get_edit_post_link( $post_id ),
+ wp_html_excerpt( _draft_or_post_title( $post_id ), 50, '&hellip;' )
+ )
+ );
+} else {
+ _e( 'Comments' );
+}
+?>
+</h1>
+
+<?php
+if ( isset( $_REQUEST['s'] ) && strlen( $_REQUEST['s'] ) ) {
+ echo '<span class="subtitle">';
+ /* translators: %s: search keywords */
+ printf(
+ __( 'Search results for &#8220;%s&#8221;' ),
+ wp_html_excerpt( esc_html( wp_unslash( $_REQUEST['s'] ) ), 50, '&hellip;' )
+ );
+ echo '</span>';
+}
+?>
+
+<hr class="wp-header-end">
+
+<?php
+if ( isset( $_REQUEST['error'] ) ) {
+ $error = (int) $_REQUEST['error'];
+ $error_msg = '';
+ switch ( $error ) {
+ case 1:
+ $error_msg = __( 'Invalid comment ID.' );
+ break;
+ case 2:
+ $error_msg = __( 'Sorry, you are not allowed to edit comments on this post.' );
+ break;
+ }
+ if ( $error_msg ) {
+ echo '<div id="moderated" class="error"><p>' . $error_msg . '</p></div>';
+ }
+}
+
+if ( isset( $_REQUEST['approved'] ) || isset( $_REQUEST['deleted'] ) || isset( $_REQUEST['trashed'] ) || isset( $_REQUEST['untrashed'] ) || isset( $_REQUEST['spammed'] ) || isset( $_REQUEST['unspammed'] ) || isset( $_REQUEST['same'] ) ) {
+ $approved = isset( $_REQUEST['approved'] ) ? (int) $_REQUEST['approved'] : 0;
+ $deleted = isset( $_REQUEST['deleted'] ) ? (int) $_REQUEST['deleted'] : 0;
+ $trashed = isset( $_REQUEST['trashed'] ) ? (int) $_REQUEST['trashed'] : 0;
+ $untrashed = isset( $_REQUEST['untrashed'] ) ? (int) $_REQUEST['untrashed'] : 0;
+ $spammed = isset( $_REQUEST['spammed'] ) ? (int) $_REQUEST['spammed'] : 0;
+ $unspammed = isset( $_REQUEST['unspammed'] ) ? (int) $_REQUEST['unspammed'] : 0;
+ $same = isset( $_REQUEST['same'] ) ? (int) $_REQUEST['same'] : 0;
+
+ if ( $approved > 0 || $deleted > 0 || $trashed > 0 || $untrashed > 0 || $spammed > 0 || $unspammed > 0 || $same > 0 ) {
+ if ( $approved > 0 ) {
+ /* translators: %s: number of comments approved */
+ $messages[] = sprintf( _n( '%s comment approved', '%s comments approved', $approved ), $approved );
+ }
+
+ if ( $spammed > 0 ) {
+ $ids = isset( $_REQUEST['ids'] ) ? $_REQUEST['ids'] : 0;
+ /* translators: %s: number of comments marked as spam */
+ $messages[] = sprintf( _n( '%s comment marked as spam.', '%s comments marked as spam.', $spammed ), $spammed ) . ' <a href="' . esc_url( wp_nonce_url( "edit-comments.php?doaction=undo&action=unspam&ids=$ids", 'bulk-comments' ) ) . '">' . __( 'Undo' ) . '</a><br />';
+ }
+
+ if ( $unspammed > 0 ) {
+ /* translators: %s: number of comments restored from the spam */
+ $messages[] = sprintf( _n( '%s comment restored from the spam', '%s comments restored from the spam', $unspammed ), $unspammed );
+ }
+
+ if ( $trashed > 0 ) {
+ $ids = isset( $_REQUEST['ids'] ) ? $_REQUEST['ids'] : 0;
+ /* translators: %s: number of comments moved to the Trash */
+ $messages[] = sprintf( _n( '%s comment moved to the Trash.', '%s comments moved to the Trash.', $trashed ), $trashed ) . ' <a href="' . esc_url( wp_nonce_url( "edit-comments.php?doaction=undo&action=untrash&ids=$ids", 'bulk-comments' ) ) . '">' . __( 'Undo' ) . '</a><br />';
+ }
+
+ if ( $untrashed > 0 ) {
+ /* translators: %s: number of comments restored from the Trash */
+ $messages[] = sprintf( _n( '%s comment restored from the Trash', '%s comments restored from the Trash', $untrashed ), $untrashed );
+ }
+
+ if ( $deleted > 0 ) {
+ /* translators: %s: number of comments permanently deleted */
+ $messages[] = sprintf( _n( '%s comment permanently deleted', '%s comments permanently deleted', $deleted ), $deleted );
+ }
+
+ if ( $same > 0 && $comment = get_comment( $same ) ) {
+ switch ( $comment->comment_approved ) {
+ case '1':
+ $messages[] = __( 'This comment is already approved.' ) . ' <a href="' . esc_url( admin_url( "comment.php?action=editcomment&c=$same" ) ) . '">' . __( 'Edit comment' ) . '</a>';
+ break;
+ case 'trash':
+ $messages[] = __( 'This comment is already in the Trash.' ) . ' <a href="' . esc_url( admin_url( 'edit-comments.php?comment_status=trash' ) ) . '"> ' . __( 'View Trash' ) . '</a>';
+ break;
+ case 'spam':
+ $messages[] = __( 'This comment is already marked as spam.' ) . ' <a href="' . esc_url( admin_url( "comment.php?action=editcomment&c=$same" ) ) . '">' . __( 'Edit comment' ) . '</a>';
+ break;
+ }
+ }
+
+ echo '<div id="moderated" class="updated notice is-dismissible"><p>' . implode( "<br/>\n", $messages ) . '</p></div>';
+ }
+}
+?>
+
+<?php $wp_list_table->views(); ?>
+
+<form id="comments-form" method="get">
+
+<?php $wp_list_table->search_box( __( 'Search Comments' ), 'comment' ); ?>
+
+<?php if ( $post_id ) : ?>
+<input type="hidden" name="p" value="<?php echo esc_attr( intval( $post_id ) ); ?>" />
+<?php endif; ?>
+<input type="hidden" name="comment_status" value="<?php echo esc_attr( $comment_status ); ?>" />
+<input type="hidden" name="pagegen_timestamp" value="<?php echo esc_attr( current_time( 'mysql', 1 ) ); ?>" />
+
+<input type="hidden" name="_total" value="<?php echo esc_attr( $wp_list_table->get_pagination_arg( 'total_items' ) ); ?>" />
+<input type="hidden" name="_per_page" value="<?php echo esc_attr( $wp_list_table->get_pagination_arg( 'per_page' ) ); ?>" />
+<input type="hidden" name="_page" value="<?php echo esc_attr( $wp_list_table->get_pagination_arg( 'page' ) ); ?>" />
+
+<?php if ( isset( $_REQUEST['paged'] ) ) { ?>
+ <input type="hidden" name="paged" value="<?php echo esc_attr( absint( $_REQUEST['paged'] ) ); ?>" />
+<?php } ?>
+
+<?php $wp_list_table->display(); ?>
+</form>
+</div>
+
+<div id="ajax-response"></div>
+
+<?php
+wp_comment_reply( '-1', true, 'detail' );
+wp_comment_trashnotice();
+include( ABSPATH . 'wp-admin/admin-footer.php' ); ?>
diff --git a/www/crm/wp-admin/edit-form-advanced.php b/www/crm/wp-admin/edit-form-advanced.php
new file mode 100644
index 00000000..b7f6fad9
--- /dev/null
+++ b/www/crm/wp-admin/edit-form-advanced.php
@@ -0,0 +1,696 @@
+<?php
+/**
+ * Post advanced form for inclusion in the administration panels.
+ *
+ * @package WordPress
+ * @subpackage Administration
+ */
+
+// don't load directly
+if ( ! defined( 'ABSPATH' ) ) {
+ die( '-1' );
+}
+
+/**
+ * @global string $post_type
+ * @global WP_Post_Type $post_type_object
+ * @global WP_Post $post
+ */
+global $post_type, $post_type_object, $post;
+
+// Flag that we're not loading the block editor.
+$current_screen = get_current_screen();
+$current_screen->is_block_editor( false );
+
+if ( is_multisite() ) {
+ add_action( 'admin_footer', '_admin_notice_post_locked' );
+} else {
+ $check_users = get_users(
+ array(
+ 'fields' => 'ID',
+ 'number' => 2,
+ )
+ );
+
+ if ( count( $check_users ) > 1 ) {
+ add_action( 'admin_footer', '_admin_notice_post_locked' );
+ }
+
+ unset( $check_users );
+}
+
+wp_enqueue_script( 'post' );
+$_wp_editor_expand = $_content_editor_dfw = false;
+
+/**
+ * Filters whether to enable the 'expand' functionality in the post editor.
+ *
+ * @since 4.0.0
+ * @since 4.1.0 Added the `$post_type` parameter.
+ *
+ * @param bool $expand Whether to enable the 'expand' functionality. Default true.
+ * @param string $post_type Post type.
+ */
+if ( post_type_supports( $post_type, 'editor' ) && ! wp_is_mobile() &&
+ ! ( $is_IE && preg_match( '/MSIE [5678]/', $_SERVER['HTTP_USER_AGENT'] ) ) &&
+ apply_filters( 'wp_editor_expand', true, $post_type ) ) {
+
+ wp_enqueue_script( 'editor-expand' );
+ $_content_editor_dfw = true;
+ $_wp_editor_expand = ( get_user_setting( 'editor_expand', 'on' ) === 'on' );
+}
+
+if ( wp_is_mobile() ) {
+ wp_enqueue_script( 'jquery-touch-punch' );
+}
+
+/**
+ * Post ID global
+ *
+ * @name $post_ID
+ * @var int
+ */
+$post_ID = isset( $post_ID ) ? (int) $post_ID : 0;
+$user_ID = isset( $user_ID ) ? (int) $user_ID : 0;
+$action = isset( $action ) ? $action : '';
+
+if ( $post_ID == get_option( 'page_for_posts' ) && empty( $post->post_content ) ) {
+ add_action( 'edit_form_after_title', '_wp_posts_page_notice' );
+ remove_post_type_support( $post_type, 'editor' );
+}
+
+$thumbnail_support = current_theme_supports( 'post-thumbnails', $post_type ) && post_type_supports( $post_type, 'thumbnail' );
+if ( ! $thumbnail_support && 'attachment' === $post_type && $post->post_mime_type ) {
+ if ( wp_attachment_is( 'audio', $post ) ) {
+ $thumbnail_support = post_type_supports( 'attachment:audio', 'thumbnail' ) || current_theme_supports( 'post-thumbnails', 'attachment:audio' );
+ } elseif ( wp_attachment_is( 'video', $post ) ) {
+ $thumbnail_support = post_type_supports( 'attachment:video', 'thumbnail' ) || current_theme_supports( 'post-thumbnails', 'attachment:video' );
+ }
+}
+
+if ( $thumbnail_support ) {
+ add_thickbox();
+ wp_enqueue_media( array( 'post' => $post_ID ) );
+}
+
+// Add the local autosave notice HTML
+add_action( 'admin_footer', '_local_storage_notice' );
+
+/*
+ * @todo Document the $messages array(s).
+ */
+$permalink = get_permalink( $post_ID );
+if ( ! $permalink ) {
+ $permalink = '';
+}
+
+$messages = array();
+
+$preview_post_link_html = $scheduled_post_link_html = $view_post_link_html = '';
+$preview_page_link_html = $scheduled_page_link_html = $view_page_link_html = '';
+
+$preview_url = get_preview_post_link( $post );
+
+$viewable = is_post_type_viewable( $post_type_object );
+
+if ( $viewable ) {
+
+ // Preview post link.
+ $preview_post_link_html = sprintf(
+ ' <a target="_blank" href="%1$s">%2$s</a>',
+ esc_url( $preview_url ),
+ __( 'Preview post' )
+ );
+
+ // Scheduled post preview link.
+ $scheduled_post_link_html = sprintf(
+ ' <a target="_blank" href="%1$s">%2$s</a>',
+ esc_url( $permalink ),
+ __( 'Preview post' )
+ );
+
+ // View post link.
+ $view_post_link_html = sprintf(
+ ' <a href="%1$s">%2$s</a>',
+ esc_url( $permalink ),
+ __( 'View post' )
+ );
+
+ // Preview page link.
+ $preview_page_link_html = sprintf(
+ ' <a target="_blank" href="%1$s">%2$s</a>',
+ esc_url( $preview_url ),
+ __( 'Preview page' )
+ );
+
+ // Scheduled page preview link.
+ $scheduled_page_link_html = sprintf(
+ ' <a target="_blank" href="%1$s">%2$s</a>',
+ esc_url( $permalink ),
+ __( 'Preview page' )
+ );
+
+ // View page link.
+ $view_page_link_html = sprintf(
+ ' <a href="%1$s">%2$s</a>',
+ esc_url( $permalink ),
+ __( 'View page' )
+ );
+
+}
+
+/* translators: Publish box date format, see https://secure.php.net/date */
+$scheduled_date = date_i18n( __( 'M j, Y @ H:i' ), strtotime( $post->post_date ) );
+
+$messages['post'] = array(
+ 0 => '', // Unused. Messages start at index 1.
+ 1 => __( 'Post updated.' ) . $view_post_link_html,
+ 2 => __( 'Custom field updated.' ),
+ 3 => __( 'Custom field deleted.' ),
+ 4 => __( 'Post updated.' ),
+ /* translators: %s: date and time of the revision */
+ 5 => isset( $_GET['revision'] ) ? sprintf( __( 'Post restored to revision from %s.' ), wp_post_revision_title( (int) $_GET['revision'], false ) ) : false,
+ 6 => __( 'Post published.' ) . $view_post_link_html,
+ 7 => __( 'Post saved.' ),
+ 8 => __( 'Post submitted.' ) . $preview_post_link_html,
+ 9 => sprintf( __( 'Post scheduled for: %s.' ), '<strong>' . $scheduled_date . '</strong>' ) . $scheduled_post_link_html,
+ 10 => __( 'Post draft updated.' ) . $preview_post_link_html,
+);
+$messages['page'] = array(
+ 0 => '', // Unused. Messages start at index 1.
+ 1 => __( 'Page updated.' ) . $view_page_link_html,
+ 2 => __( 'Custom field updated.' ),
+ 3 => __( 'Custom field deleted.' ),
+ 4 => __( 'Page updated.' ),
+ /* translators: %s: date and time of the revision */
+ 5 => isset( $_GET['revision'] ) ? sprintf( __( 'Page restored to revision from %s.' ), wp_post_revision_title( (int) $_GET['revision'], false ) ) : false,
+ 6 => __( 'Page published.' ) . $view_page_link_html,
+ 7 => __( 'Page saved.' ),
+ 8 => __( 'Page submitted.' ) . $preview_page_link_html,
+ 9 => sprintf( __( 'Page scheduled for: %s.' ), '<strong>' . $scheduled_date . '</strong>' ) . $scheduled_page_link_html,
+ 10 => __( 'Page draft updated.' ) . $preview_page_link_html,
+);
+$messages['attachment'] = array_fill( 1, 10, __( 'Media file updated.' ) ); // Hack, for now.
+
+/**
+ * Filters the post updated messages.
+ *
+ * @since 3.0.0
+ *
+ * @param array[] $messages Post updated messages. For defaults see `$messages` declarations above.
+ */
+$messages = apply_filters( 'post_updated_messages', $messages );
+
+$message = false;
+if ( isset( $_GET['message'] ) ) {
+ $_GET['message'] = absint( $_GET['message'] );
+ if ( isset( $messages[ $post_type ][ $_GET['message'] ] ) ) {
+ $message = $messages[ $post_type ][ $_GET['message'] ];
+ } elseif ( ! isset( $messages[ $post_type ] ) && isset( $messages['post'][ $_GET['message'] ] ) ) {
+ $message = $messages['post'][ $_GET['message'] ];
+ }
+}
+
+$notice = false;
+$form_extra = '';
+if ( 'auto-draft' == $post->post_status ) {
+ if ( 'edit' == $action ) {
+ $post->post_title = '';
+ }
+ $autosave = false;
+ $form_extra .= "<input type='hidden' id='auto_draft' name='auto_draft' value='1' />";
+} else {
+ $autosave = wp_get_post_autosave( $post_ID );
+}
+
+$form_action = 'editpost';
+$nonce_action = 'update-post_' . $post_ID;
+$form_extra .= "<input type='hidden' id='post_ID' name='post_ID' value='" . esc_attr( $post_ID ) . "' />";
+
+// Detect if there exists an autosave newer than the post and if that autosave is different than the post
+if ( $autosave && mysql2date( 'U', $autosave->post_modified_gmt, false ) > mysql2date( 'U', $post->post_modified_gmt, false ) ) {
+ foreach ( _wp_post_revision_fields( $post ) as $autosave_field => $_autosave_field ) {
+ if ( normalize_whitespace( $autosave->$autosave_field ) != normalize_whitespace( $post->$autosave_field ) ) {
+ $notice = sprintf( __( 'There is an autosave of this post that is more recent than the version below. <a href="%s">View the autosave</a>' ), get_edit_post_link( $autosave->ID ) );
+ break;
+ }
+ }
+ // If this autosave isn't different from the current post, begone.
+ if ( ! $notice ) {
+ wp_delete_post_revision( $autosave->ID );
+ }
+ unset( $autosave_field, $_autosave_field );
+}
+
+$post_type_object = get_post_type_object( $post_type );
+
+// All meta boxes should be defined and added before the first do_meta_boxes() call (or potentially during the do_meta_boxes action).
+require_once( ABSPATH . 'wp-admin/includes/meta-boxes.php' );
+
+register_and_do_post_meta_boxes( $post );
+
+add_screen_option(
+ 'layout_columns',
+ array(
+ 'max' => 2,
+ 'default' => 2,
+ )
+);
+
+if ( 'post' == $post_type ) {
+ $customize_display = '<p>' . __( 'The title field and the big Post Editing Area are fixed in place, but you can reposition all the other boxes using drag and drop. You can also minimize or expand them by clicking the title bar of each box. Use the Screen Options tab to unhide more boxes (Excerpt, Send Trackbacks, Custom Fields, Discussion, Slug, Author) or to choose a 1- or 2-column layout for this screen.' ) . '</p>';
+
+ get_current_screen()->add_help_tab(
+ array(
+ 'id' => 'customize-display',
+ 'title' => __( 'Customizing This Display' ),
+ 'content' => $customize_display,
+ )
+ );
+
+ $title_and_editor = '<p>' . __( '<strong>Title</strong> &mdash; Enter a title for your post. After you enter a title, you&#8217;ll see the permalink below, which you can edit.' ) . '</p>';
+ $title_and_editor .= '<p>' . __( '<strong>Post editor</strong> &mdash; Enter the text for your post. There are two modes of editing: Visual and Text. Choose the mode by clicking on the appropriate tab.' ) . '</p>';
+ $title_and_editor .= '<p>' . __( 'Visual mode gives you an editor that is similar to a word processor. Click the Toolbar Toggle button to get a second row of controls.' ) . '</p>';
+ $title_and_editor .= '<p>' . __( 'The Text mode allows you to enter HTML along with your post text. Note that &lt;p&gt; and &lt;br&gt; tags are converted to line breaks when switching to the Text editor to make it less cluttered. When you type, a single line break can be used instead of typing &lt;br&gt;, and two line breaks instead of paragraph tags. The line breaks are converted back to tags automatically.' ) . '</p>';
+ $title_and_editor .= '<p>' . __( 'You can insert media files by clicking the button above the post editor and following the directions. You can align or edit images using the inline formatting toolbar available in Visual mode.' ) . '</p>';
+ $title_and_editor .= '<p>' . __( 'You can enable distraction-free writing mode using the icon to the right. This feature is not available for old browsers or devices with small screens, and requires that the full-height editor be enabled in Screen Options.' ) . '</p>';
+ $title_and_editor .= '<p>' . __( 'Keyboard users: When you&#8217;re working in the visual editor, you can use <kbd>Alt + F10</kbd> to access the toolbar.' ) . '</p>';
+
+ get_current_screen()->add_help_tab(
+ array(
+ 'id' => 'title-post-editor',
+ 'title' => __( 'Title and Post Editor' ),
+ 'content' => $title_and_editor,
+ )
+ );
+
+ get_current_screen()->set_help_sidebar(
+ '<p>' . sprintf( __( 'You can also create posts with the <a href="%s">Press This bookmarklet</a>.' ), 'tools.php' ) . '</p>' .
+ '<p><strong>' . __( 'For more information:' ) . '</strong></p>' .
+ '<p>' . __( '<a href="https://codex.wordpress.org/Posts_Add_New_Screen">Documentation on Writing and Editing Posts</a>' ) . '</p>' .
+ '<p>' . __( '<a href="https://wordpress.org/support/">Support</a>' ) . '</p>'
+ );
+} elseif ( 'page' == $post_type ) {
+ $about_pages = '<p>' . __( 'Pages are similar to posts in that they have a title, body text, and associated metadata, but they are different in that they are not part of the chronological blog stream, kind of like permanent posts. Pages are not categorized or tagged, but can have a hierarchy. You can nest pages under other pages by making one the &#8220;Parent&#8221; of the other, creating a group of pages.' ) . '</p>' .
+ '<p>' . __( 'Creating a Page is very similar to creating a Post, and the screens can be customized in the same way using drag and drop, the Screen Options tab, and expanding/collapsing boxes as you choose. This screen also has the distraction-free writing space, available in both the Visual and Text modes via the Fullscreen buttons. The Page editor mostly works the same as the Post editor, but there are some Page-specific features in the Page Attributes box.' ) . '</p>';
+
+ get_current_screen()->add_help_tab(
+ array(
+ 'id' => 'about-pages',
+ 'title' => __( 'About Pages' ),
+ 'content' => $about_pages,
+ )
+ );
+
+ get_current_screen()->set_help_sidebar(
+ '<p><strong>' . __( 'For more information:' ) . '</strong></p>' .
+ '<p>' . __( '<a href="https://codex.wordpress.org/Pages_Add_New_Screen">Documentation on Adding New Pages</a>' ) . '</p>' .
+ '<p>' . __( '<a href="https://codex.wordpress.org/Pages_Screen#Editing_Individual_Pages">Documentation on Editing Pages</a>' ) . '</p>' .
+ '<p>' . __( '<a href="https://wordpress.org/support/">Support</a>' ) . '</p>'
+ );
+} elseif ( 'attachment' == $post_type ) {
+ get_current_screen()->add_help_tab(
+ array(
+ 'id' => 'overview',
+ 'title' => __( 'Overview' ),
+ 'content' =>
+ '<p>' . __( 'This screen allows you to edit four fields for metadata in a file within the media library.' ) . '</p>' .
+ '<p>' . __( 'For images only, you can click on Edit Image under the thumbnail to expand out an inline image editor with icons for cropping, rotating, or flipping the image as well as for undoing and redoing. The boxes on the right give you more options for scaling the image, for cropping it, and for cropping the thumbnail in a different way than you crop the original image. You can click on Help in those boxes to get more information.' ) . '</p>' .
+ '<p>' . __( 'Note that you crop the image by clicking on it (the Crop icon is already selected) and dragging the cropping frame to select the desired part. Then click Save to retain the cropping.' ) . '</p>' .
+ '<p>' . __( 'Remember to click Update Media to save metadata entered or changed.' ) . '</p>',
+ )
+ );
+
+ get_current_screen()->set_help_sidebar(
+ '<p><strong>' . __( 'For more information:' ) . '</strong></p>' .
+ '<p>' . __( '<a href="https://codex.wordpress.org/Media_Add_New_Screen#Edit_Media">Documentation on Edit Media</a>' ) . '</p>' .
+ '<p>' . __( '<a href="https://wordpress.org/support/">Support</a>' ) . '</p>'
+ );
+}
+
+if ( 'post' == $post_type || 'page' == $post_type ) {
+ $inserting_media = '<p>' . __( 'You can upload and insert media (images, audio, documents, etc.) by clicking the Add Media button. You can select from the images and files already uploaded to the Media Library, or upload new media to add to your page or post. To create an image gallery, select the images to add and click the &#8220;Create a new gallery&#8221; button.' ) . '</p>';
+ $inserting_media .= '<p>' . __( 'You can also embed media from many popular websites including Twitter, YouTube, Flickr and others by pasting the media URL on its own line into the content of your post/page. Please refer to the Codex to <a href="https://codex.wordpress.org/Embeds">learn more about embeds</a>.' ) . '</p>';
+
+ get_current_screen()->add_help_tab(
+ array(
+ 'id' => 'inserting-media',
+ 'title' => __( 'Inserting Media' ),
+ 'content' => $inserting_media,
+ )
+ );
+}
+
+if ( 'post' == $post_type ) {
+ $publish_box = '<p>' . __( 'Several boxes on this screen contain settings for how your content will be published, including:' ) . '</p>';
+ $publish_box .= '<ul><li>' .
+ __( '<strong>Publish</strong> &mdash; You can set the terms of publishing your post in the Publish box. For Status, Visibility, and Publish (immediately), click on the Edit link to reveal more options. Visibility includes options for password-protecting a post or making it stay at the top of your blog indefinitely (sticky). The Password protected option allows you to set an arbitrary password for each post. The Private option hides the post from everyone except editors and administrators. Publish (immediately) allows you to set a future or past date and time, so you can schedule a post to be published in the future or backdate a post.' ) .
+ '</li>';
+
+ if ( current_theme_supports( 'post-formats' ) && post_type_supports( 'post', 'post-formats' ) ) {
+ $publish_box .= '<li>' . __( '<strong>Format</strong> &mdash; Post Formats designate how your theme will display a specific post. For example, you could have a <em>standard</em> blog post with a title and paragraphs, or a short <em>aside</em> that omits the title and contains a short text blurb. Please refer to the Codex for <a href="https://codex.wordpress.org/Post_Formats#Supported_Formats">descriptions of each post format</a>. Your theme could enable all or some of 10 possible formats.' ) . '</li>';
+ }
+
+ if ( current_theme_supports( 'post-thumbnails' ) && post_type_supports( 'post', 'thumbnail' ) ) {
+ /* translators: %s: Featured Image */
+ $publish_box .= '<li>' . sprintf( __( '<strong>%s</strong> &mdash; This allows you to associate an image with your post without inserting it. This is usually useful only if your theme makes use of the image as a post thumbnail on the home page, a custom header, etc.' ), esc_html( $post_type_object->labels->featured_image ) ) . '</li>';
+ }
+
+ $publish_box .= '</ul>';
+
+ get_current_screen()->add_help_tab(
+ array(
+ 'id' => 'publish-box',
+ 'title' => __( 'Publish Settings' ),
+ 'content' => $publish_box,
+ )
+ );
+
+ $discussion_settings = '<p>' . __( '<strong>Send Trackbacks</strong> &mdash; Trackbacks are a way to notify legacy blog systems that you&#8217;ve linked to them. Enter the URL(s) you want to send trackbacks. If you link to other WordPress sites they&#8217;ll be notified automatically using pingbacks, and this field is unnecessary.' ) . '</p>';
+ $discussion_settings .= '<p>' . __( '<strong>Discussion</strong> &mdash; You can turn comments and pings on or off, and if there are comments on the post, you can see them here and moderate them.' ) . '</p>';
+
+ get_current_screen()->add_help_tab(
+ array(
+ 'id' => 'discussion-settings',
+ 'title' => __( 'Discussion Settings' ),
+ 'content' => $discussion_settings,
+ )
+ );
+} elseif ( 'page' == $post_type ) {
+ $page_attributes = '<p>' . __( '<strong>Parent</strong> &mdash; You can arrange your pages in hierarchies. For example, you could have an &#8220;About&#8221; page that has &#8220;Life Story&#8221; and &#8220;My Dog&#8221; pages under it. There are no limits to how many levels you can nest pages.' ) . '</p>' .
+ '<p>' . __( '<strong>Template</strong> &mdash; Some themes have custom templates you can use for certain pages that might have additional features or custom layouts. If so, you&#8217;ll see them in this dropdown menu.' ) . '</p>' .
+ '<p>' . __( '<strong>Order</strong> &mdash; Pages are usually ordered alphabetically, but you can choose your own order by entering a number (1 for first, etc.) in this field.' ) . '</p>';
+
+ get_current_screen()->add_help_tab(
+ array(
+ 'id' => 'page-attributes',
+ 'title' => __( 'Page Attributes' ),
+ 'content' => $page_attributes,
+ )
+ );
+}
+
+require_once( ABSPATH . 'wp-admin/admin-header.php' );
+?>
+
+<div class="wrap">
+<h1 class="wp-heading-inline">
+<?php
+echo esc_html( $title );
+?>
+</h1>
+
+<?php
+if ( isset( $post_new_file ) && current_user_can( $post_type_object->cap->create_posts ) ) {
+ echo ' <a href="' . esc_url( admin_url( $post_new_file ) ) . '" class="page-title-action">' . esc_html( $post_type_object->labels->add_new ) . '</a>';
+}
+?>
+
+<hr class="wp-header-end">
+
+<?php if ( $notice ) : ?>
+<div id="notice" class="notice notice-warning"><p id="has-newer-autosave"><?php echo $notice; ?></p></div>
+<?php endif; ?>
+<?php if ( $message ) : ?>
+<div id="message" class="updated notice notice-success is-dismissible"><p><?php echo $message; ?></p></div>
+<?php endif; ?>
+<div id="lost-connection-notice" class="error hidden">
+ <p><span class="spinner"></span> <?php _e( '<strong>Connection lost.</strong> Saving has been disabled until you&#8217;re reconnected.' ); ?>
+ <span class="hide-if-no-sessionstorage"><?php _e( 'We&#8217;re backing up this post in your browser, just in case.' ); ?></span>
+ </p>
+</div>
+<form name="post" action="post.php" method="post" id="post"
+<?php
+/**
+ * Fires inside the post editor form tag.
+ *
+ * @since 3.0.0
+ *
+ * @param WP_Post $post Post object.
+ */
+do_action( 'post_edit_form_tag', $post );
+
+$referer = wp_get_referer();
+?>
+>
+<?php wp_nonce_field( $nonce_action ); ?>
+<input type="hidden" id="user-id" name="user_ID" value="<?php echo (int) $user_ID; ?>" />
+<input type="hidden" id="hiddenaction" name="action" value="<?php echo esc_attr( $form_action ); ?>" />
+<input type="hidden" id="originalaction" name="originalaction" value="<?php echo esc_attr( $form_action ); ?>" />
+<input type="hidden" id="post_author" name="post_author" value="<?php echo esc_attr( $post->post_author ); ?>" />
+<input type="hidden" id="post_type" name="post_type" value="<?php echo esc_attr( $post_type ); ?>" />
+<input type="hidden" id="original_post_status" name="original_post_status" value="<?php echo esc_attr( $post->post_status ); ?>" />
+<input type="hidden" id="referredby" name="referredby" value="<?php echo $referer ? esc_url( $referer ) : ''; ?>" />
+<?php if ( ! empty( $active_post_lock ) ) { ?>
+<input type="hidden" id="active_post_lock" value="<?php echo esc_attr( implode( ':', $active_post_lock ) ); ?>" />
+ <?php
+}
+if ( 'draft' != get_post_status( $post ) ) {
+ wp_original_referer_field( true, 'previous' );
+}
+
+echo $form_extra;
+
+wp_nonce_field( 'meta-box-order', 'meta-box-order-nonce', false );
+wp_nonce_field( 'closedpostboxes', 'closedpostboxesnonce', false );
+?>
+
+<?php
+/**
+ * Fires at the beginning of the edit form.
+ *
+ * At this point, the required hidden fields and nonces have already been output.
+ *
+ * @since 3.7.0
+ *
+ * @param WP_Post $post Post object.
+ */
+do_action( 'edit_form_top', $post );
+?>
+
+<div id="poststuff">
+<div id="post-body" class="metabox-holder columns-<?php echo 1 == get_current_screen()->get_columns() ? '1' : '2'; ?>">
+<div id="post-body-content">
+
+<?php if ( post_type_supports( $post_type, 'title' ) ) { ?>
+<div id="titlediv">
+<div id="titlewrap">
+ <?php
+ /**
+ * Filters the title field placeholder text.
+ *
+ * @since 3.1.0
+ *
+ * @param string $text Placeholder text. Default 'Add title'.
+ * @param WP_Post $post Post object.
+ */
+ $title_placeholder = apply_filters( 'enter_title_here', __( 'Add title' ), $post );
+ ?>
+ <label class="screen-reader-text" id="title-prompt-text" for="title"><?php echo $title_placeholder; ?></label>
+ <input type="text" name="post_title" size="30" value="<?php echo esc_attr( $post->post_title ); ?>" id="title" spellcheck="true" autocomplete="off" />
+</div>
+ <?php
+ /**
+ * Fires before the permalink field in the edit form.
+ *
+ * @since 4.1.0
+ *
+ * @param WP_Post $post Post object.
+ */
+ do_action( 'edit_form_before_permalink', $post );
+ ?>
+<div class="inside">
+ <?php
+ if ( $viewable ) :
+ $sample_permalink_html = $post_type_object->public ? get_sample_permalink_html( $post->ID ) : '';
+
+ // As of 4.4, the Get Shortlink button is hidden by default.
+ if ( has_filter( 'pre_get_shortlink' ) || has_filter( 'get_shortlink' ) ) {
+ $shortlink = wp_get_shortlink( $post->ID, 'post' );
+
+ if ( ! empty( $shortlink ) && $shortlink !== $permalink && $permalink !== home_url( '?page_id=' . $post->ID ) ) {
+ $sample_permalink_html .= '<input id="shortlink" type="hidden" value="' . esc_attr( $shortlink ) . '" /><button type="button" class="button button-small" onclick="prompt(&#39;URL:&#39;, jQuery(\'#shortlink\').val());">' . __( 'Get Shortlink' ) . '</button>';
+ }
+ }
+
+ if ( $post_type_object->public && ! ( 'pending' == get_post_status( $post ) && ! current_user_can( $post_type_object->cap->publish_posts ) ) ) {
+ $has_sample_permalink = $sample_permalink_html && 'auto-draft' != $post->post_status;
+ ?>
+ <div id="edit-slug-box" class="hide-if-no-js">
+ <?php
+ if ( $has_sample_permalink ) {
+ echo $sample_permalink_html;
+ }
+ ?>
+ </div>
+ <?php
+ }
+endif;
+ ?>
+</div>
+ <?php
+ wp_nonce_field( 'samplepermalink', 'samplepermalinknonce', false );
+ ?>
+</div><!-- /titlediv -->
+ <?php
+}
+/**
+ * Fires after the title field.
+ *
+ * @since 3.5.0
+ *
+ * @param WP_Post $post Post object.
+ */
+do_action( 'edit_form_after_title', $post );
+
+if ( post_type_supports( $post_type, 'editor' ) ) {
+ $_wp_editor_expand_class = '';
+ if ( $_wp_editor_expand ) {
+ $_wp_editor_expand_class = ' wp-editor-expand';
+ }
+ ?>
+<div id="postdivrich" class="postarea<?php echo $_wp_editor_expand_class; ?>">
+
+ <?php
+ wp_editor(
+ $post->post_content,
+ 'content',
+ array(
+ '_content_editor_dfw' => $_content_editor_dfw,
+ 'drag_drop_upload' => true,
+ 'tabfocus_elements' => 'content-html,save-post',
+ 'editor_height' => 300,
+ 'tinymce' => array(
+ 'resize' => false,
+ 'wp_autoresize_on' => $_wp_editor_expand,
+ 'add_unload_trigger' => false,
+ 'wp_keep_scroll_position' => ! $is_IE,
+ ),
+ )
+ );
+ ?>
+<table id="post-status-info"><tbody><tr>
+ <td id="wp-word-count" class="hide-if-no-js"><?php printf( __( 'Word count: %s' ), '<span class="word-count">0</span>' ); ?></td>
+ <td class="autosave-info">
+ <span class="autosave-message">&nbsp;</span>
+ <?php
+ if ( 'auto-draft' != $post->post_status ) {
+ echo '<span id="last-edit">';
+ if ( $last_user = get_userdata( get_post_meta( $post_ID, '_edit_last', true ) ) ) {
+ /* translators: 1: Name of most recent post author, 2: Post edited date, 3: Post edited time */
+ printf( __( 'Last edited by %1$s on %2$s at %3$s' ), esc_html( $last_user->display_name ), mysql2date( __( 'F j, Y' ), $post->post_modified ), mysql2date( __( 'g:i a' ), $post->post_modified ) );
+ } else {
+ /* translators: 1: Post edited date, 2: Post edited time */
+ printf( __( 'Last edited on %1$s at %2$s' ), mysql2date( __( 'F j, Y' ), $post->post_modified ), mysql2date( __( 'g:i a' ), $post->post_modified ) );
+ }
+ echo '</span>';
+ }
+ ?>
+ </td>
+ <td id="content-resize-handle" class="hide-if-no-js"><br /></td>
+</tr></tbody></table>
+
+</div>
+ <?php
+}
+/**
+ * Fires after the content editor.
+ *
+ * @since 3.5.0
+ *
+ * @param WP_Post $post Post object.
+ */
+do_action( 'edit_form_after_editor', $post );
+?>
+</div><!-- /post-body-content -->
+
+<div id="postbox-container-1" class="postbox-container">
+<?php
+
+if ( 'page' == $post_type ) {
+ /**
+ * Fires before meta boxes with 'side' context are output for the 'page' post type.
+ *
+ * The submitpage box is a meta box with 'side' context, so this hook fires just before it is output.
+ *
+ * @since 2.5.0
+ *
+ * @param WP_Post $post Post object.
+ */
+ do_action( 'submitpage_box', $post );
+} else {
+ /**
+ * Fires before meta boxes with 'side' context are output for all post types other than 'page'.
+ *
+ * The submitpost box is a meta box with 'side' context, so this hook fires just before it is output.
+ *
+ * @since 2.5.0
+ *
+ * @param WP_Post $post Post object.
+ */
+ do_action( 'submitpost_box', $post );
+}
+
+
+do_meta_boxes( $post_type, 'side', $post );
+
+?>
+</div>
+<div id="postbox-container-2" class="postbox-container">
+<?php
+
+do_meta_boxes( null, 'normal', $post );
+
+if ( 'page' == $post_type ) {
+ /**
+ * Fires after 'normal' context meta boxes have been output for the 'page' post type.
+ *
+ * @since 1.5.0
+ *
+ * @param WP_Post $post Post object.
+ */
+ do_action( 'edit_page_form', $post );
+} else {
+ /**
+ * Fires after 'normal' context meta boxes have been output for all post types other than 'page'.
+ *
+ * @since 1.5.0
+ *
+ * @param WP_Post $post Post object.
+ */
+ do_action( 'edit_form_advanced', $post );
+}
+
+
+do_meta_boxes( null, 'advanced', $post );
+
+?>
+</div>
+<?php
+/**
+ * Fires after all meta box sections have been output, before the closing #post-body div.
+ *
+ * @since 2.1.0
+ *
+ * @param WP_Post $post Post object.
+ */
+do_action( 'dbx_post_sidebar', $post );
+
+?>
+</div><!-- /post-body -->
+<br class="clear" />
+</div><!-- /poststuff -->
+</form>
+</div>
+
+<?php
+if ( post_type_supports( $post_type, 'comments' ) ) {
+ wp_comment_reply();
+}
+?>
+
+<?php if ( ! wp_is_mobile() && post_type_supports( $post_type, 'title' ) && '' === $post->post_title ) : ?>
+<script type="text/javascript">
+try{document.post.title.focus();}catch(e){}
+</script>
+<?php endif; ?>
diff --git a/www/crm/wp-admin/edit-form-blocks.php b/www/crm/wp-admin/edit-form-blocks.php
new file mode 100644
index 00000000..4f68a8a4
--- /dev/null
+++ b/www/crm/wp-admin/edit-form-blocks.php
@@ -0,0 +1,433 @@
+<?php
+/**
+ * The Block Editor page.
+ *
+ * @since 5.0.0
+ *
+ * @package WordPress
+ * @subpackage Administration
+ */
+
+// don't load directly
+if ( ! defined( 'ABSPATH' ) ) {
+ die( '-1' );
+}
+
+/**
+ * @global string $post_type
+ * @global WP_Post_Type $post_type_object
+ * @global WP_Post $post
+ * @global string $title
+ * @global array $editor_styles
+ * @global array $wp_meta_boxes
+ */
+global $post_type, $post_type_object, $post, $title, $editor_styles, $wp_meta_boxes;
+
+// Flag that we're loading the block editor.
+$current_screen = get_current_screen();
+$current_screen->is_block_editor( true );
+
+/*
+ * Emoji replacement is disabled for now, until it plays nicely with React.
+ */
+remove_action( 'admin_print_scripts', 'print_emoji_detection_script' );
+
+wp_enqueue_script( 'heartbeat' );
+wp_enqueue_script( 'wp-edit-post' );
+wp_enqueue_script( 'wp-format-library' );
+
+$rest_base = ! empty( $post_type_object->rest_base ) ? $post_type_object->rest_base : $post_type_object->name;
+
+// Preload common data.
+$preload_paths = array(
+ '/',
+ '/wp/v2/types?context=edit',
+ '/wp/v2/taxonomies?per_page=-1&context=edit',
+ '/wp/v2/themes?status=active',
+ sprintf( '/wp/v2/%s/%s?context=edit', $rest_base, $post->ID ),
+ sprintf( '/wp/v2/types/%s?context=edit', $post_type ),
+ sprintf( '/wp/v2/users/me?post_type=%s&context=edit', $post_type ),
+ array( '/wp/v2/media', 'OPTIONS' ),
+ array( '/wp/v2/blocks', 'OPTIONS' ),
+);
+
+/**
+ * Preload common data by specifying an array of REST API paths that will be preloaded.
+ *
+ * Filters the array of paths that will be preloaded.
+ *
+ * @since 5.0.0
+ *
+ * @param array $preload_paths Array of paths to preload.
+ * @param object $post The post resource data.
+ */
+$preload_paths = apply_filters( 'block_editor_preload_paths', $preload_paths, $post );
+
+/*
+ * Ensure the global $post remains the same after API data is preloaded.
+ * Because API preloading can call the_content and other filters, plugins
+ * can unexpectedly modify $post.
+ */
+$backup_global_post = $post;
+
+$preload_data = array_reduce(
+ $preload_paths,
+ 'rest_preload_api_request',
+ array()
+);
+
+// Restore the global $post as it was before API preloading.
+$post = $backup_global_post;
+
+wp_add_inline_script(
+ 'wp-api-fetch',
+ sprintf( 'wp.apiFetch.use( wp.apiFetch.createPreloadingMiddleware( %s ) );', wp_json_encode( $preload_data ) ),
+ 'after'
+);
+
+wp_add_inline_script(
+ 'wp-blocks',
+ sprintf( 'wp.blocks.setCategories( %s );', wp_json_encode( get_block_categories( $post ) ) ),
+ 'after'
+);
+
+/*
+ * Assign initial edits, if applicable. These are not initially assigned to the persisted post,
+ * but should be included in its save payload.
+ */
+$initial_edits = null;
+$is_new_post = false;
+if ( 'auto-draft' === $post->post_status ) {
+ $is_new_post = true;
+ // Override "(Auto Draft)" new post default title with empty string, or filtered value.
+ $initial_edits = array(
+ 'title' => $post->post_title,
+ 'content' => $post->post_content,
+ 'excerpt' => $post->post_excerpt,
+ );
+}
+
+// Preload server-registered block schemas.
+wp_add_inline_script(
+ 'wp-blocks',
+ 'wp.blocks.unstable__bootstrapServerSideBlockDefinitions(' . wp_json_encode( get_block_editor_server_block_settings() ) . ');'
+);
+
+// Get admin url for handling meta boxes.
+$meta_box_url = admin_url( 'post.php' );
+$meta_box_url = add_query_arg(
+ array(
+ 'post' => $post->ID,
+ 'action' => 'edit',
+ 'meta-box-loader' => true,
+ 'meta-box-loader-nonce' => wp_create_nonce( 'meta-box-loader' ),
+ ),
+ $meta_box_url
+);
+wp_localize_script( 'wp-editor', '_wpMetaBoxUrl', $meta_box_url );
+
+
+/*
+ * Initialize the editor.
+ */
+
+$align_wide = get_theme_support( 'align-wide' );
+$color_palette = current( (array) get_theme_support( 'editor-color-palette' ) );
+$font_sizes = current( (array) get_theme_support( 'editor-font-sizes' ) );
+
+/**
+ * Filters the allowed block types for the editor, defaulting to true (all
+ * block types supported).
+ *
+ * @since 5.0.0
+ *
+ * @param bool|array $allowed_block_types Array of block type slugs, or
+ * boolean to enable/disable all.
+ * @param object $post The post resource data.
+ */
+$allowed_block_types = apply_filters( 'allowed_block_types', true, $post );
+
+// Get all available templates for the post/page attributes meta-box.
+// The "Default template" array element should only be added if the array is
+// not empty so we do not trigger the template select element without any options
+// besides the default value.
+$available_templates = wp_get_theme()->get_page_templates( get_post( $post->ID ) );
+$available_templates = ! empty( $available_templates ) ? array_merge(
+ array(
+ /** This filter is documented in wp-admin/includes/meta-boxes.php */
+ '' => apply_filters( 'default_page_template_title', __( 'Default template' ), 'rest-api' ),
+ ),
+ $available_templates
+) : $available_templates;
+
+// Media settings.
+$max_upload_size = wp_max_upload_size();
+if ( ! $max_upload_size ) {
+ $max_upload_size = 0;
+}
+
+// Editor Styles.
+$styles = array(
+ array(
+ 'css' => file_get_contents(
+ ABSPATH . WPINC . '/css/dist/editor/editor-styles.css'
+ ),
+ ),
+);
+
+/* Translators: Use this to specify the CSS font family for the default font */
+$locale_font_family = esc_html_x( 'Noto Serif', 'CSS Font Family for Editor Font' );
+$styles[] = array(
+ 'css' => "body { font-family: '$locale_font_family' }",
+);
+
+if ( $editor_styles && current_theme_supports( 'editor-styles' ) ) {
+ foreach ( $editor_styles as $style ) {
+ if ( preg_match( '~^(https?:)?//~', $style ) ) {
+ $response = wp_remote_get( $style );
+ if ( ! is_wp_error( $response ) ) {
+ $styles[] = array(
+ 'css' => wp_remote_retrieve_body( $response ),
+ );
+ }
+ } else {
+ $file = get_theme_file_path( $style );
+ if ( is_file( $file ) ) {
+ $styles[] = array(
+ 'css' => file_get_contents( $file ),
+ 'baseURL' => get_theme_file_uri( $style ),
+ );
+ }
+ }
+ }
+}
+
+// Image sizes.
+
+/** This filter is documented in wp-admin/includes/media.php */
+$image_size_names = apply_filters(
+ 'image_size_names_choose',
+ array(
+ 'thumbnail' => __( 'Thumbnail' ),
+ 'medium' => __( 'Medium' ),
+ 'large' => __( 'Large' ),
+ 'full' => __( 'Full Size' ),
+ )
+);
+
+$available_image_sizes = array();
+foreach ( $image_size_names as $image_size_slug => $image_size_name ) {
+ $available_image_sizes[] = array(
+ 'slug' => $image_size_slug,
+ 'name' => $image_size_name,
+ );
+}
+
+// Lock settings.
+$user_id = wp_check_post_lock( $post->ID );
+if ( $user_id ) {
+ $locked = false;
+
+ /** This filter is documented in wp-admin/includes/post.php */
+ if ( apply_filters( 'show_post_locked_dialog', true, $post, $user_id ) ) {
+ $locked = true;
+ }
+
+ $user_details = null;
+ if ( $locked ) {
+ $user = get_userdata( $user_id );
+ $user_details = array(
+ 'name' => $user->display_name,
+ );
+ $avatar = get_avatar_url( $user_id, array( 'size' => 64 ) );
+ }
+
+ $lock_details = array(
+ 'isLocked' => $locked,
+ 'user' => $user_details,
+ );
+} else {
+ // Lock the post.
+ $active_post_lock = wp_set_post_lock( $post->ID );
+ $lock_details = array(
+ 'isLocked' => false,
+ 'activePostLock' => esc_attr( implode( ':', $active_post_lock ) ),
+ );
+}
+
+/**
+ * Filters the body placeholder text.
+ *
+ * @since 5.0.0
+ *
+ * @param string $text Placeholder text. Default 'Start writing or type / to choose a block'.
+ * @param WP_Post $post Post object.
+ */
+$body_placeholder = apply_filters( 'write_your_story', __( 'Start writing or type / to choose a block' ), $post );
+
+$editor_settings = array(
+ 'alignWide' => $align_wide,
+ 'availableTemplates' => $available_templates,
+ 'allowedBlockTypes' => $allowed_block_types,
+ 'disableCustomColors' => get_theme_support( 'disable-custom-colors' ),
+ 'disableCustomFontSizes' => get_theme_support( 'disable-custom-font-sizes' ),
+ 'disablePostFormats' => ! current_theme_supports( 'post-formats' ),
+ /** This filter is documented in wp-admin/edit-form-advanced.php */
+ 'titlePlaceholder' => apply_filters( 'enter_title_here', __( 'Add title' ), $post ),
+ 'bodyPlaceholder' => $body_placeholder,
+ 'isRTL' => is_rtl(),
+ 'autosaveInterval' => AUTOSAVE_INTERVAL,
+ 'maxUploadFileSize' => $max_upload_size,
+ 'allowedMimeTypes' => get_allowed_mime_types(),
+ 'styles' => $styles,
+ 'imageSizes' => $available_image_sizes,
+ 'richEditingEnabled' => user_can_richedit(),
+ 'postLock' => $lock_details,
+ 'postLockUtils' => array(
+ 'nonce' => wp_create_nonce( 'lock-post_' . $post->ID ),
+ 'unlockNonce' => wp_create_nonce( 'update-post_' . $post->ID ),
+ 'ajaxUrl' => admin_url( 'admin-ajax.php' ),
+ ),
+
+ // Whether or not to load the 'postcustom' meta box is stored as a user meta
+ // field so that we're not always loading its assets.
+ 'enableCustomFields' => (bool) get_user_meta( get_current_user_id(), 'enable_custom_fields', true ),
+);
+
+$autosave = wp_get_post_autosave( $post_ID );
+if ( $autosave ) {
+ if ( mysql2date( 'U', $autosave->post_modified_gmt, false ) > mysql2date( 'U', $post->post_modified_gmt, false ) ) {
+ $editor_settings['autosave'] = array(
+ 'editLink' => get_edit_post_link( $autosave->ID ),
+ );
+ } else {
+ wp_delete_post_revision( $autosave->ID );
+ }
+}
+
+if ( false !== $color_palette ) {
+ $editor_settings['colors'] = $color_palette;
+}
+
+if ( false !== $font_sizes ) {
+ $editor_settings['fontSizes'] = $font_sizes;
+}
+
+if ( ! empty( $post_type_object->template ) ) {
+ $editor_settings['template'] = $post_type_object->template;
+ $editor_settings['templateLock'] = ! empty( $post_type_object->template_lock ) ? $post_type_object->template_lock : false;
+}
+
+// If there's no template set on a new post, use the post format, instead.
+if ( $is_new_post && ! isset( $editor_settings['template'] ) && 'post' === $post->post_type ) {
+ $post_format = get_post_format( $post );
+ if ( in_array( $post_format, array( 'audio', 'gallery', 'image', 'quote', 'video' ), true ) ) {
+ $editor_settings['template'] = array( array( "core/$post_format" ) );
+ }
+}
+
+/**
+ * Scripts
+ */
+wp_enqueue_media(
+ array(
+ 'post' => $post->ID,
+ )
+);
+wp_tinymce_inline_scripts();
+wp_enqueue_editor();
+
+/**
+ * Styles
+ */
+wp_enqueue_style( 'wp-edit-post' );
+wp_enqueue_style( 'wp-format-library' );
+
+/**
+ * Fires after block assets have been enqueued for the editing interface.
+ *
+ * Call `add_action` on any hook before 'admin_enqueue_scripts'.
+ *
+ * In the function call you supply, simply use `wp_enqueue_script` and
+ * `wp_enqueue_style` to add your functionality to the block editor.
+ *
+ * @since 5.0.0
+ */
+do_action( 'enqueue_block_editor_assets' );
+
+// In order to duplicate classic meta box behaviour, we need to run the classic meta box actions.
+require_once( ABSPATH . 'wp-admin/includes/meta-boxes.php' );
+register_and_do_post_meta_boxes( $post );
+
+// Check if the Custom Fields meta box has been removed at some point.
+$core_meta_boxes = $wp_meta_boxes[ $current_screen->id ]['normal']['core'];
+if ( ! isset( $core_meta_boxes['postcustom'] ) || ! $core_meta_boxes['postcustom'] ) {
+ unset( $editor_settings['enableCustomFields'] );
+}
+
+/**
+ * Filters the settings to pass to the block editor.
+ *
+ * @since 5.0.0
+ *
+ * @param array $editor_settings Default editor settings.
+ * @param WP_Post $post Post being edited.
+ */
+$editor_settings = apply_filters( 'block_editor_settings', $editor_settings, $post );
+
+$init_script = <<<JS
+( function() {
+ window._wpLoadBlockEditor = new Promise( function( resolve ) {
+ wp.domReady( function() {
+ resolve( wp.editPost.initializeEditor( 'editor', "%s", %d, %s, %s ) );
+ } );
+ } );
+} )();
+JS;
+
+$script = sprintf(
+ $init_script,
+ $post->post_type,
+ $post->ID,
+ wp_json_encode( $editor_settings ),
+ wp_json_encode( $initial_edits )
+);
+wp_add_inline_script( 'wp-edit-post', $script );
+
+require_once( ABSPATH . 'wp-admin/admin-header.php' );
+?>
+
+<div class="block-editor">
+ <h1 class="screen-reader-text hide-if-no-js"><?php echo esc_html( $title ); ?></h1>
+ <div id="editor" class="block-editor__container hide-if-no-js"></div>
+ <div id="metaboxes" class="hidden">
+ <?php the_block_editor_meta_boxes(); ?>
+ </div>
+
+ <?php // JavaScript is disabled. ?>
+ <div class="wrap hide-if-js block-editor-no-js">
+ <h1 class="wp-heading-inline"><?php echo esc_html( $title ); ?></h1>
+ <div class="notice notice-error notice-alt">
+ <p>
+ <?php
+ $message = sprintf(
+ /* translators: %s: Classic Editor plugin URL */
+ __( 'The block editor requires JavaScript. Please enable JavaScript in your browser settings, or try the <a href="%s">Classic Editor plugin</a>.' ),
+ __( 'https://wordpress.org/plugins/classic-editor/' )
+ );
+
+ /**
+ * Filters the message displayed in the block editor interface when JavaScript is
+ * not enabled in the browser.
+ *
+ * @since 5.0.3
+ *
+ * @param string $message The message being displayed.
+ * @param WP_Post $post The post being edited.
+ */
+ echo apply_filters( 'block_editor_no_javascript_message', $message, $post );
+ ?>
+ </p>
+ </div>
+ </div>
+</div>
diff --git a/www/crm/wp-admin/edit-form-comment.php b/www/crm/wp-admin/edit-form-comment.php
new file mode 100644
index 00000000..a64be9cf
--- /dev/null
+++ b/www/crm/wp-admin/edit-form-comment.php
@@ -0,0 +1,232 @@
+<?php
+/**
+ * Edit comment form for inclusion in another file.
+ *
+ * @package WordPress
+ * @subpackage Administration
+ */
+
+// don't load directly
+if ( ! defined( 'ABSPATH' ) ) {
+ die( '-1' );
+}
+?>
+<form name="post" action="comment.php" method="post" id="post">
+<?php wp_nonce_field( 'update-comment_' . $comment->comment_ID ); ?>
+<div class="wrap">
+<h1><?php _e( 'Edit Comment' ); ?></h1>
+
+<div id="poststuff">
+<input type="hidden" name="action" value="editedcomment" />
+<input type="hidden" name="comment_ID" value="<?php echo esc_attr( $comment->comment_ID ); ?>" />
+<input type="hidden" name="comment_post_ID" value="<?php echo esc_attr( $comment->comment_post_ID ); ?>" />
+
+<div id="post-body" class="metabox-holder columns-2">
+<div id="post-body-content" class="edit-form-section edit-comment-section">
+<?php
+if ( 'approved' === wp_get_comment_status( $comment ) && $comment->comment_post_ID > 0 ) :
+ $comment_link = get_comment_link( $comment );
+ ?>
+<div class="inside">
+ <div id="comment-link-box">
+ <strong><?php _ex( 'Permalink:', 'comment' ); ?></strong>
+ <span id="sample-permalink">
+ <a href="<?php echo esc_url( $comment_link ); ?>">
+ <?php echo esc_html( $comment_link ); ?>
+ </a>
+ </span>
+ </div>
+</div>
+<?php endif; ?>
+<div id="namediv" class="stuffbox">
+<div class="inside">
+<h2 class="edit-comment-author"><?php _e( 'Author' ); ?></h2>
+<fieldset>
+<legend class="screen-reader-text"><?php _e( 'Comment Author' ); ?></legend>
+<table class="form-table editcomment" role="presentation">
+<tbody>
+<tr>
+ <td class="first"><label for="name"><?php _e( 'Name' ); ?></label></td>
+ <td><input type="text" name="newcomment_author" size="30" value="<?php echo esc_attr( $comment->comment_author ); ?>" id="name" /></td>
+</tr>
+<tr>
+ <td class="first"><label for="email"><?php _e( 'Email' ); ?></label></td>
+ <td>
+ <input type="text" name="newcomment_author_email" size="30" value="<?php echo $comment->comment_author_email; ?>" id="email" />
+ </td>
+</tr>
+<tr>
+ <td class="first"><label for="newcomment_author_url"><?php _e( 'URL' ); ?></label></td>
+ <td>
+ <input type="text" id="newcomment_author_url" name="newcomment_author_url" size="30" class="code" value="<?php echo esc_attr( $comment->comment_author_url ); ?>" />
+ </td>
+</tr>
+</tbody>
+</table>
+</fieldset>
+</div>
+</div>
+
+<div id="postdiv" class="postarea">
+<?php
+ echo '<label for="content" class="screen-reader-text">' . __( 'Comment' ) . '</label>';
+ $quicktags_settings = array( 'buttons' => 'strong,em,link,block,del,ins,img,ul,ol,li,code,close' );
+ wp_editor(
+ $comment->comment_content,
+ 'content',
+ array(
+ 'media_buttons' => false,
+ 'tinymce' => false,
+ 'quicktags' => $quicktags_settings,
+ )
+ );
+ wp_nonce_field( 'closedpostboxes', 'closedpostboxesnonce', false );
+ ?>
+</div>
+</div><!-- /post-body-content -->
+
+<div id="postbox-container-1" class="postbox-container">
+<div id="submitdiv" class="stuffbox" >
+<h2><?php _e( 'Status' ); ?></h2>
+<div class="inside">
+<div class="submitbox" id="submitcomment">
+<div id="minor-publishing">
+
+<div id="misc-publishing-actions">
+
+<fieldset class="misc-pub-section misc-pub-comment-status" id="comment-status-radio">
+<legend class="screen-reader-text"><?php _e( 'Comment status' ); ?></legend>
+<label><input type="radio"<?php checked( $comment->comment_approved, '1' ); ?> name="comment_status" value="1" /><?php _ex( 'Approved', 'comment status' ); ?></label><br />
+<label><input type="radio"<?php checked( $comment->comment_approved, '0' ); ?> name="comment_status" value="0" /><?php _ex( 'Pending', 'comment status' ); ?></label><br />
+<label><input type="radio"<?php checked( $comment->comment_approved, 'spam' ); ?> name="comment_status" value="spam" /><?php _ex( 'Spam', 'comment status' ); ?></label>
+</fieldset>
+
+<div class="misc-pub-section curtime misc-pub-curtime">
+<?php
+/* translators: Publish box date format, see https://secure.php.net/date */
+$datef = __( 'M j, Y @ H:i' );
+?>
+<span id="timestamp">
+<?php
+printf(
+ /* translators: %s: comment date */
+ __( 'Submitted on: %s' ),
+ '<b>' . date_i18n( $datef, strtotime( $comment->comment_date ) ) . '</b>'
+);
+?>
+</span>
+<a href="#edit_timestamp" class="edit-timestamp hide-if-no-js"><span aria-hidden="true"><?php _e( 'Edit' ); ?></span> <span class="screen-reader-text"><?php _e( 'Edit date and time' ); ?></span></a>
+<fieldset id='timestampdiv' class='hide-if-js'>
+<legend class="screen-reader-text"><?php _e( 'Date and time' ); ?></legend>
+<?php touch_time( ( 'editcomment' === $action ), 0 ); ?>
+</fieldset>
+</div>
+
+<?php
+$post_id = $comment->comment_post_ID;
+if ( current_user_can( 'edit_post', $post_id ) ) {
+ $post_link = "<a href='" . esc_url( get_edit_post_link( $post_id ) ) . "'>";
+ $post_link .= esc_html( get_the_title( $post_id ) ) . '</a>';
+} else {
+ $post_link = esc_html( get_the_title( $post_id ) );
+}
+?>
+
+<div class="misc-pub-section misc-pub-response-to">
+ <?php
+ printf(
+ /* translators: %s: post link */
+ __( 'In response to: %s' ),
+ '<b>' . $post_link . '</b>'
+ );
+ ?>
+</div>
+
+<?php
+if ( $comment->comment_parent ) :
+ $parent = get_comment( $comment->comment_parent );
+ if ( $parent ) :
+ $parent_link = esc_url( get_comment_link( $parent ) );
+ $name = get_comment_author( $parent );
+ ?>
+ <div class="misc-pub-section misc-pub-reply-to">
+ <?php
+ printf(
+ /* translators: %s: comment link */
+ __( 'In reply to: %s' ),
+ '<b><a href="' . $parent_link . '">' . $name . '</a></b>'
+ );
+ ?>
+ </div>
+ <?php
+endif;
+endif;
+?>
+
+<?php
+ /**
+ * Filters miscellaneous actions for the edit comment form sidebar.
+ *
+ * @since 4.3.0
+ *
+ * @param string $html Output HTML to display miscellaneous action.
+ * @param object $comment Current comment object.
+ */
+ echo apply_filters( 'edit_comment_misc_actions', '', $comment );
+?>
+
+</div> <!-- misc actions -->
+<div class="clear"></div>
+</div>
+
+<div id="major-publishing-actions">
+<div id="delete-action">
+<?php echo "<a class='submitdelete deletion' href='" . wp_nonce_url( 'comment.php?action=' . ( ! EMPTY_TRASH_DAYS ? 'deletecomment' : 'trashcomment' ) . "&amp;c=$comment->comment_ID&amp;_wp_original_http_referer=" . urlencode( wp_get_referer() ), 'delete-comment_' . $comment->comment_ID ) . "'>" . ( ! EMPTY_TRASH_DAYS ? __( 'Delete Permanently' ) : __( 'Move to Trash' ) ) . "</a>\n"; ?>
+</div>
+<div id="publishing-action">
+<?php submit_button( __( 'Update' ), 'primary large', 'save', false ); ?>
+</div>
+<div class="clear"></div>
+</div>
+</div>
+</div>
+</div><!-- /submitdiv -->
+</div>
+
+<div id="postbox-container-2" class="postbox-container">
+<?php
+/** This action is documented in wp-admin/includes/meta-boxes.php */
+do_action( 'add_meta_boxes', 'comment', $comment );
+
+/**
+ * Fires when comment-specific meta boxes are added.
+ *
+ * @since 3.0.0
+ *
+ * @param WP_Comment $comment Comment object.
+ */
+do_action( 'add_meta_boxes_comment', $comment );
+
+do_meta_boxes( null, 'normal', $comment );
+
+$referer = wp_get_referer();
+?>
+</div>
+
+<input type="hidden" name="c" value="<?php echo esc_attr( $comment->comment_ID ); ?>" />
+<input type="hidden" name="p" value="<?php echo esc_attr( $comment->comment_post_ID ); ?>" />
+<input name="referredby" type="hidden" id="referredby" value="<?php echo $referer ? esc_url( $referer ) : ''; ?>" />
+<?php wp_original_referer_field( true, 'previous' ); ?>
+<input type="hidden" name="noredir" value="1" />
+
+</div><!-- /post-body -->
+</div>
+</div>
+</form>
+
+<?php if ( ! wp_is_mobile() ) : ?>
+<script type="text/javascript">
+try{document.post.name.focus();}catch(e){}
+</script>
+ <?php
+endif;
diff --git a/www/crm/wp-admin/edit-link-form.php b/www/crm/wp-admin/edit-link-form.php
new file mode 100644
index 00000000..f63d71b4
--- /dev/null
+++ b/www/crm/wp-admin/edit-link-form.php
@@ -0,0 +1,169 @@
+<?php
+/**
+ * Edit links form for inclusion in administration panels.
+ *
+ * @package WordPress
+ * @subpackage Administration
+ */
+
+// don't load directly
+if ( ! defined( 'ABSPATH' ) ) {
+ die( '-1' );
+}
+
+if ( ! empty( $link_id ) ) {
+ $heading = sprintf( __( '<a href="%s">Links</a> / Edit Link' ), 'link-manager.php' );
+ $submit_text = __( 'Update Link' );
+ $form_name = 'editlink';
+ $nonce_action = 'update-bookmark_' . $link_id;
+} else {
+ $heading = sprintf( __( '<a href="%s">Links</a> / Add New Link' ), 'link-manager.php' );
+ $submit_text = __( 'Add Link' );
+ $form_name = 'addlink';
+ $nonce_action = 'add-bookmark';
+}
+
+require_once( ABSPATH . 'wp-admin/includes/meta-boxes.php' );
+
+add_meta_box( 'linksubmitdiv', __( 'Save' ), 'link_submit_meta_box', null, 'side', 'core' );
+add_meta_box( 'linkcategorydiv', __( 'Categories' ), 'link_categories_meta_box', null, 'normal', 'core' );
+add_meta_box( 'linktargetdiv', __( 'Target' ), 'link_target_meta_box', null, 'normal', 'core' );
+add_meta_box( 'linkxfndiv', __( 'Link Relationship (XFN)' ), 'link_xfn_meta_box', null, 'normal', 'core' );
+add_meta_box( 'linkadvanceddiv', __( 'Advanced' ), 'link_advanced_meta_box', null, 'normal', 'core' );
+
+/** This action is documented in wp-admin/includes/meta-boxes.php */
+do_action( 'add_meta_boxes', 'link', $link );
+
+/**
+ * Fires when link-specific meta boxes are added.
+ *
+ * @since 3.0.0
+ *
+ * @param object $link Link object.
+ */
+do_action( 'add_meta_boxes_link', $link );
+
+/** This action is documented in wp-admin/includes/meta-boxes.php */
+do_action( 'do_meta_boxes', 'link', 'normal', $link );
+/** This action is documented in wp-admin/includes/meta-boxes.php */
+do_action( 'do_meta_boxes', 'link', 'advanced', $link );
+/** This action is documented in wp-admin/includes/meta-boxes.php */
+do_action( 'do_meta_boxes', 'link', 'side', $link );
+
+add_screen_option(
+ 'layout_columns',
+ array(
+ 'max' => 2,
+ 'default' => 2,
+ )
+);
+
+get_current_screen()->add_help_tab(
+ array(
+ 'id' => 'overview',
+ 'title' => __( 'Overview' ),
+ 'content' =>
+ '<p>' . __( 'You can add or edit links on this screen by entering information in each of the boxes. Only the link&#8217;s web address and name (the text you want to display on your site as the link) are required fields.' ) . '</p>' .
+ '<p>' . __( 'The boxes for link name, web address, and description have fixed positions, while the others may be repositioned using drag and drop. You can also hide boxes you don&#8217;t use in the Screen Options tab, or minimize boxes by clicking on the title bar of the box.' ) . '</p>' .
+ '<p>' . __( 'XFN stands for <a href="http://gmpg.org/xfn/">XHTML Friends Network</a>, which is optional. WordPress allows the generation of XFN attributes to show how you are related to the authors/owners of the site to which you are linking.' ) . '</p>',
+ )
+);
+
+get_current_screen()->set_help_sidebar(
+ '<p><strong>' . __( 'For more information:' ) . '</strong></p>' .
+ '<p>' . __( '<a href="https://codex.wordpress.org/Links_Add_New_Screen">Documentation on Creating Links</a>' ) . '</p>' .
+ '<p>' . __( '<a href="https://wordpress.org/support/">Support</a>' ) . '</p>'
+);
+
+require_once( ABSPATH . 'wp-admin/admin-header.php' );
+?>
+
+<div class="wrap">
+<h1 class="wp-heading-inline">
+<?php
+echo esc_html( $title );
+?>
+</h1>
+
+<a href="link-add.php" class="page-title-action"><?php echo esc_html_x( 'Add New', 'link' ); ?></a>
+
+<hr class="wp-header-end">
+
+<?php if ( isset( $_GET['added'] ) ) : ?>
+<div id="message" class="updated notice is-dismissible"><p><?php _e( 'Link added.' ); ?></p></div>
+<?php endif; ?>
+
+<form name="<?php echo esc_attr( $form_name ); ?>" id="<?php echo esc_attr( $form_name ); ?>" method="post" action="link.php">
+<?php
+if ( ! empty( $link_added ) ) {
+ echo $link_added;
+}
+
+wp_nonce_field( $nonce_action );
+wp_nonce_field( 'closedpostboxes', 'closedpostboxesnonce', false );
+wp_nonce_field( 'meta-box-order', 'meta-box-order-nonce', false );
+?>
+
+<div id="poststuff">
+
+<div id="post-body" class="metabox-holder columns-<?php echo 1 == get_current_screen()->get_columns() ? '1' : '2'; ?>">
+<div id="post-body-content">
+<div id="namediv" class="stuffbox">
+<h2><label for="link_name"><?php _ex( 'Name', 'link name' ); ?></label></h2>
+<div class="inside">
+ <input type="text" name="link_name" size="30" maxlength="255" value="<?php echo esc_attr( $link->link_name ); ?>" id="link_name" />
+ <p><?php _e( 'Example: Nifty blogging software' ); ?></p>
+</div>
+</div>
+
+<div id="addressdiv" class="stuffbox">
+<h2><label for="link_url"><?php _e( 'Web Address' ); ?></label></h2>
+<div class="inside">
+ <input type="text" name="link_url" size="30" maxlength="255" class="code" value="<?php echo esc_attr( $link->link_url ); ?>" id="link_url" />
+ <p><?php _e( 'Example: <code>http://wordpress.org/</code> &#8212; don&#8217;t forget the <code>http://</code>' ); ?></p>
+</div>
+</div>
+
+<div id="descriptiondiv" class="stuffbox">
+<h2><label for="link_description"><?php _e( 'Description' ); ?></label></h2>
+<div class="inside">
+ <input type="text" name="link_description" size="30" maxlength="255" value="<?php echo isset( $link->link_description ) ? esc_attr( $link->link_description ) : ''; ?>" id="link_description" />
+ <p><?php _e( 'This will be shown when someone hovers over the link in the blogroll, or optionally below the link.' ); ?></p>
+</div>
+</div>
+</div><!-- /post-body-content -->
+
+<div id="postbox-container-1" class="postbox-container">
+<?php
+
+/** This action is documented in wp-admin/includes/meta-boxes.php */
+do_action( 'submitlink_box' );
+$side_meta_boxes = do_meta_boxes( 'link', 'side', $link );
+
+?>
+</div>
+<div id="postbox-container-2" class="postbox-container">
+<?php
+
+do_meta_boxes( null, 'normal', $link );
+
+do_meta_boxes( null, 'advanced', $link );
+
+?>
+</div>
+<?php
+
+if ( $link_id ) :
+ ?>
+<input type="hidden" name="action" value="save" />
+<input type="hidden" name="link_id" value="<?php echo (int) $link_id; ?>" />
+<input type="hidden" name="cat_id" value="<?php echo (int) $cat_id; ?>" />
+<?php else : ?>
+<input type="hidden" name="action" value="add" />
+<?php endif; ?>
+
+</div>
+</div>
+
+</form>
+</div>
diff --git a/www/crm/wp-admin/edit-tag-form.php b/www/crm/wp-admin/edit-tag-form.php
new file mode 100644
index 00000000..48800eb8
--- /dev/null
+++ b/www/crm/wp-admin/edit-tag-form.php
@@ -0,0 +1,292 @@
+<?php
+/**
+ * Edit tag form for inclusion in administration panels.
+ *
+ * @package WordPress
+ * @subpackage Administration
+ */
+
+// don't load directly
+if ( ! defined( 'ABSPATH' ) ) {
+ die( '-1' );
+}
+
+// Back compat hooks
+if ( 'category' == $taxonomy ) {
+ /**
+ * Fires before the Edit Category form.
+ *
+ * @since 2.1.0
+ * @deprecated 3.0.0 Use {$taxonomy}_pre_edit_form instead.
+ *
+ * @param WP_Term $tag Current category term object.
+ */
+ do_action( 'edit_category_form_pre', $tag );
+} elseif ( 'link_category' == $taxonomy ) {
+ /**
+ * Fires before the Edit Link Category form.
+ *
+ * @since 2.3.0
+ * @deprecated 3.0.0 Use {$taxonomy}_pre_edit_form instead.
+ *
+ * @param WP_Term $tag Current link category term object.
+ */
+ do_action( 'edit_link_category_form_pre', $tag );
+} else {
+ /**
+ * Fires before the Edit Tag form.
+ *
+ * @since 2.5.0
+ * @deprecated 3.0.0 Use {$taxonomy}_pre_edit_form instead.
+ *
+ * @param WP_Term $tag Current tag term object.
+ */
+ do_action( 'edit_tag_form_pre', $tag );
+}
+
+/**
+ * Use with caution, see https://codex.wordpress.org/Function_Reference/wp_reset_vars
+ */
+wp_reset_vars( array( 'wp_http_referer' ) );
+
+$wp_http_referer = remove_query_arg( array( 'action', 'message', 'tag_ID' ), $wp_http_referer );
+
+/** Also used by Edit Tags */
+require_once( ABSPATH . 'wp-admin/includes/edit-tag-messages.php' );
+
+/**
+ * Fires before the Edit Term form for all taxonomies.
+ *
+ * The dynamic portion of the hook name, `$taxonomy`, refers to
+ * the taxonomy slug.
+ *
+ * @since 3.0.0
+ *
+ * @param WP_Term $tag Current taxonomy term object.
+ * @param string $taxonomy Current $taxonomy slug.
+ */
+do_action( "{$taxonomy}_pre_edit_form", $tag, $taxonomy ); ?>
+
+<div class="wrap">
+<h1><?php echo $tax->labels->edit_item; ?></h1>
+
+<?php
+$class = ( isset( $msg ) && 5 === $msg ) ? 'error' : 'success';
+
+if ( $message ) {
+ ?>
+<div id="message" class="notice notice-<?php echo $class; ?>">
+ <p><strong><?php echo $message; ?></strong></p>
+ <?php if ( $wp_http_referer ) { ?>
+ <p><a href="<?php echo esc_url( wp_validate_redirect( esc_url_raw( $wp_http_referer ), admin_url( 'term.php?taxonomy=' . $taxonomy ) ) ); ?>">
+ <?php echo esc_html( $tax->labels->back_to_items ); ?>
+ </a></p>
+ <?php } ?>
+</div>
+ <?php
+}
+?>
+
+<div id="ajax-response"></div>
+
+<form name="edittag" id="edittag" method="post" action="edit-tags.php" class="validate"
+<?php
+/**
+ * Fires inside the Edit Term form tag.
+ *
+ * The dynamic portion of the hook name, `$taxonomy`, refers to the taxonomy slug.
+ *
+ * @since 3.7.0
+ */
+do_action( "{$taxonomy}_term_edit_form_tag" );
+?>
+>
+<input type="hidden" name="action" value="editedtag"/>
+<input type="hidden" name="tag_ID" value="<?php echo esc_attr( $tag_ID ); ?>"/>
+<input type="hidden" name="taxonomy" value="<?php echo esc_attr( $taxonomy ); ?>"/>
+<?php
+wp_original_referer_field( true, 'previous' );
+wp_nonce_field( 'update-tag_' . $tag_ID );
+
+/**
+ * Fires at the beginning of the Edit Term form.
+ *
+ * At this point, the required hidden fields and nonces have already been output.
+ *
+ * The dynamic portion of the hook name, `$taxonomy`, refers to the taxonomy slug.
+ *
+ * @since 4.5.0
+ *
+ * @param WP_Term $tag Current taxonomy term object.
+ * @param string $taxonomy Current $taxonomy slug.
+ */
+do_action( "{$taxonomy}_term_edit_form_top", $tag, $taxonomy );
+
+$tag_name_value = '';
+if ( isset( $tag->name ) ) {
+ $tag_name_value = esc_attr( $tag->name );
+}
+?>
+ <table class="form-table" role="presentation">
+ <tr class="form-field form-required term-name-wrap">
+ <th scope="row"><label for="name"><?php _ex( 'Name', 'term name' ); ?></label></th>
+ <td><input name="name" id="name" type="text" value="<?php echo $tag_name_value; ?>" size="40" aria-required="true" />
+ <p class="description"><?php _e( 'The name is how it appears on your site.' ); ?></p></td>
+ </tr>
+<?php if ( ! global_terms_enabled() ) { ?>
+ <tr class="form-field term-slug-wrap">
+ <th scope="row"><label for="slug"><?php _e( 'Slug' ); ?></label></th>
+ <?php
+ /**
+ * Filters the editable slug.
+ *
+ * Note: This is a multi-use hook in that it is leveraged both for editable
+ * post URIs and term slugs.
+ *
+ * @since 2.6.0
+ * @since 4.4.0 The `$tag` parameter was added.
+ *
+ * @param string $slug The editable slug. Will be either a term slug or post URI depending
+ * upon the context in which it is evaluated.
+ * @param WP_Term|WP_Post $tag Term or WP_Post object.
+ */
+ $slug = isset( $tag->slug ) ? apply_filters( 'editable_slug', $tag->slug, $tag ) : '';
+ ?>
+ <td><input name="slug" id="slug" type="text" value="<?php echo esc_attr( $slug ); ?>" size="40" />
+ <p class="description"><?php _e( 'The &#8220;slug&#8221; is the URL-friendly version of the name. It is usually all lowercase and contains only letters, numbers, and hyphens.' ); ?></p></td>
+ </tr>
+<?php } ?>
+<?php if ( is_taxonomy_hierarchical( $taxonomy ) ) : ?>
+ <tr class="form-field term-parent-wrap">
+ <th scope="row"><label for="parent"><?php echo esc_html( $tax->labels->parent_item ); ?></label></th>
+ <td>
+ <?php
+ $dropdown_args = array(
+ 'hide_empty' => 0,
+ 'hide_if_empty' => false,
+ 'taxonomy' => $taxonomy,
+ 'name' => 'parent',
+ 'orderby' => 'name',
+ 'selected' => $tag->parent,
+ 'exclude_tree' => $tag->term_id,
+ 'hierarchical' => true,
+ 'show_option_none' => __( 'None' ),
+ );
+
+ /** This filter is documented in wp-admin/edit-tags.php */
+ $dropdown_args = apply_filters( 'taxonomy_parent_dropdown_args', $dropdown_args, $taxonomy, 'edit' );
+ wp_dropdown_categories( $dropdown_args );
+ ?>
+ <?php if ( 'category' == $taxonomy ) : ?>
+ <p class="description"><?php _e( 'Categories, unlike tags, can have a hierarchy. You might have a Jazz category, and under that have children categories for Bebop and Big Band. Totally optional.' ); ?></p>
+ <?php else : ?>
+ <p class="description"><?php _e( 'Assign a parent term to create a hierarchy. The term Jazz, for example, would be the parent of Bebop and Big Band.' ); ?></p>
+ <?php endif; ?>
+ </td>
+ </tr>
+<?php endif; // is_taxonomy_hierarchical() ?>
+ <tr class="form-field term-description-wrap">
+ <th scope="row"><label for="description"><?php _e( 'Description' ); ?></label></th>
+ <td><textarea name="description" id="description" rows="5" cols="50" class="large-text"><?php echo $tag->description; // textarea_escaped ?></textarea>
+ <p class="description"><?php _e( 'The description is not prominent by default; however, some themes may show it.' ); ?></p></td>
+ </tr>
+ <?php
+ // Back compat hooks
+ if ( 'category' == $taxonomy ) {
+ /**
+ * Fires after the Edit Category form fields are displayed.
+ *
+ * @since 2.9.0
+ * @deprecated 3.0.0 Use {$taxonomy}_edit_form_fields instead.
+ *
+ * @param WP_Term $tag Current category term object.
+ */
+ do_action( 'edit_category_form_fields', $tag );
+ } elseif ( 'link_category' == $taxonomy ) {
+ /**
+ * Fires after the Edit Link Category form fields are displayed.
+ *
+ * @since 2.9.0
+ * @deprecated 3.0.0 Use {$taxonomy}_edit_form_fields instead.
+ *
+ * @param WP_Term $tag Current link category term object.
+ */
+ do_action( 'edit_link_category_form_fields', $tag );
+ } else {
+ /**
+ * Fires after the Edit Tag form fields are displayed.
+ *
+ * @since 2.9.0
+ * @deprecated 3.0.0 Use {$taxonomy}_edit_form_fields instead.
+ *
+ * @param WP_Term $tag Current tag term object.
+ */
+ do_action( 'edit_tag_form_fields', $tag );
+ }
+ /**
+ * Fires after the Edit Term form fields are displayed.
+ *
+ * The dynamic portion of the hook name, `$taxonomy`, refers to
+ * the taxonomy slug.
+ *
+ * @since 3.0.0
+ *
+ * @param WP_Term $tag Current taxonomy term object.
+ * @param string $taxonomy Current taxonomy slug.
+ */
+ do_action( "{$taxonomy}_edit_form_fields", $tag, $taxonomy );
+ ?>
+ </table>
+<?php
+// Back compat hooks
+if ( 'category' == $taxonomy ) {
+ /** This action is documented in wp-admin/edit-tags.php */
+ do_action( 'edit_category_form', $tag );
+} elseif ( 'link_category' == $taxonomy ) {
+ /** This action is documented in wp-admin/edit-tags.php */
+ do_action( 'edit_link_category_form', $tag );
+} else {
+ /**
+ * Fires at the end of the Edit Term form.
+ *
+ * @since 2.5.0
+ * @deprecated 3.0.0 Use {$taxonomy}_edit_form instead.
+ *
+ * @param WP_Term $tag Current taxonomy term object.
+ */
+ do_action( 'edit_tag_form', $tag );
+}
+/**
+ * Fires at the end of the Edit Term form for all taxonomies.
+ *
+ * The dynamic portion of the hook name, `$taxonomy`, refers to the taxonomy slug.
+ *
+ * @since 3.0.0
+ *
+ * @param WP_Term $tag Current taxonomy term object.
+ * @param string $taxonomy Current taxonomy slug.
+ */
+do_action( "{$taxonomy}_edit_form", $tag, $taxonomy );
+?>
+
+<div class="edit-tag-actions">
+
+ <?php submit_button( __( 'Update' ), 'primary', null, false ); ?>
+
+ <?php if ( current_user_can( 'delete_term', $tag->term_id ) ) : ?>
+ <span id="delete-link">
+ <a class="delete" href="<?php echo admin_url( wp_nonce_url( "edit-tags.php?action=delete&taxonomy=$taxonomy&tag_ID=$tag->term_id", 'delete-tag_' . $tag->term_id ) ); ?>"><?php _e( 'Delete' ); ?></a>
+ </span>
+ <?php endif; ?>
+
+</div>
+
+</form>
+</div>
+
+<?php if ( ! wp_is_mobile() ) : ?>
+<script type="text/javascript">
+try{document.forms.edittag.name.focus();}catch(e){}
+</script>
+ <?php
+endif;
diff --git a/www/crm/wp-admin/edit-tags.php b/www/crm/wp-admin/edit-tags.php
new file mode 100644
index 00000000..1be66c9d
--- /dev/null
+++ b/www/crm/wp-admin/edit-tags.php
@@ -0,0 +1,637 @@
+<?php
+/**
+ * Edit Tags Administration Screen.
+ *
+ * @package WordPress
+ * @subpackage Administration
+ */
+
+/** WordPress Administration Bootstrap */
+require_once( dirname( __FILE__ ) . '/admin.php' );
+
+if ( ! $taxnow ) {
+ wp_die( __( 'Invalid taxonomy.' ) );
+}
+
+$tax = get_taxonomy( $taxnow );
+
+if ( ! $tax ) {
+ wp_die( __( 'Invalid taxonomy.' ) );
+}
+
+if ( ! in_array( $tax->name, get_taxonomies( array( 'show_ui' => true ) ) ) ) {
+ wp_die( __( 'Sorry, you are not allowed to edit terms in this taxonomy.' ) );
+}
+
+if ( ! current_user_can( $tax->cap->manage_terms ) ) {
+ wp_die(
+ '<h1>' . __( 'You need a higher level of permission.' ) . '</h1>' .
+ '<p>' . __( 'Sorry, you are not allowed to manage terms in this taxonomy.' ) . '</p>',
+ 403
+ );
+}
+
+/**
+ * $post_type is set when the WP_Terms_List_Table instance is created
+ *
+ * @global string $post_type
+ */
+global $post_type;
+
+$wp_list_table = _get_list_table( 'WP_Terms_List_Table' );
+$pagenum = $wp_list_table->get_pagenum();
+
+$title = $tax->labels->name;
+
+if ( 'post' != $post_type ) {
+ $parent_file = ( 'attachment' == $post_type ) ? 'upload.php' : "edit.php?post_type=$post_type";
+ $submenu_file = "edit-tags.php?taxonomy=$taxonomy&amp;post_type=$post_type";
+} elseif ( 'link_category' == $tax->name ) {
+ $parent_file = 'link-manager.php';
+ $submenu_file = 'edit-tags.php?taxonomy=link_category';
+} else {
+ $parent_file = 'edit.php';
+ $submenu_file = "edit-tags.php?taxonomy=$taxonomy";
+}
+
+add_screen_option(
+ 'per_page',
+ array(
+ 'default' => 20,
+ 'option' => 'edit_' . $tax->name . '_per_page',
+ )
+);
+
+get_current_screen()->set_screen_reader_content(
+ array(
+ 'heading_pagination' => $tax->labels->items_list_navigation,
+ 'heading_list' => $tax->labels->items_list,
+ )
+);
+
+$location = false;
+$referer = wp_get_referer();
+if ( ! $referer ) { // For POST requests.
+ $referer = wp_unslash( $_SERVER['REQUEST_URI'] );
+}
+$referer = remove_query_arg( array( '_wp_http_referer', '_wpnonce', 'error', 'message', 'paged' ), $referer );
+switch ( $wp_list_table->current_action() ) {
+
+ case 'add-tag':
+ check_admin_referer( 'add-tag', '_wpnonce_add-tag' );
+
+ if ( ! current_user_can( $tax->cap->edit_terms ) ) {
+ wp_die(
+ '<h1>' . __( 'You need a higher level of permission.' ) . '</h1>' .
+ '<p>' . __( 'Sorry, you are not allowed to create terms in this taxonomy.' ) . '</p>',
+ 403
+ );
+ }
+
+ $ret = wp_insert_term( $_POST['tag-name'], $taxonomy, $_POST );
+ if ( $ret && ! is_wp_error( $ret ) ) {
+ $location = add_query_arg( 'message', 1, $referer );
+ } else {
+ $location = add_query_arg(
+ array(
+ 'error' => true,
+ 'message' => 4,
+ ),
+ $referer
+ );
+ }
+
+ break;
+
+ case 'delete':
+ if ( ! isset( $_REQUEST['tag_ID'] ) ) {
+ break;
+ }
+
+ $tag_ID = (int) $_REQUEST['tag_ID'];
+ check_admin_referer( 'delete-tag_' . $tag_ID );
+
+ if ( ! current_user_can( 'delete_term', $tag_ID ) ) {
+ wp_die(
+ '<h1>' . __( 'You need a higher level of permission.' ) . '</h1>' .
+ '<p>' . __( 'Sorry, you are not allowed to delete this item.' ) . '</p>',
+ 403
+ );
+ }
+
+ wp_delete_term( $tag_ID, $taxonomy );
+
+ $location = add_query_arg( 'message', 2, $referer );
+
+ // When deleting a term, prevent the action from redirecting back to a term that no longer exists.
+ $location = remove_query_arg( array( 'tag_ID', 'action' ), $location );
+
+ break;
+
+ case 'bulk-delete':
+ check_admin_referer( 'bulk-tags' );
+
+ if ( ! current_user_can( $tax->cap->delete_terms ) ) {
+ wp_die(
+ '<h1>' . __( 'You need a higher level of permission.' ) . '</h1>' .
+ '<p>' . __( 'Sorry, you are not allowed to delete these items.' ) . '</p>',
+ 403
+ );
+ }
+
+ $tags = (array) $_REQUEST['delete_tags'];
+ foreach ( $tags as $tag_ID ) {
+ wp_delete_term( $tag_ID, $taxonomy );
+ }
+
+ $location = add_query_arg( 'message', 6, $referer );
+
+ break;
+
+ case 'edit':
+ if ( ! isset( $_REQUEST['tag_ID'] ) ) {
+ break;
+ }
+
+ $term_id = (int) $_REQUEST['tag_ID'];
+ $term = get_term( $term_id );
+
+ if ( ! $term instanceof WP_Term ) {
+ wp_die( __( 'You attempted to edit an item that doesn&#8217;t exist. Perhaps it was deleted?' ) );
+ }
+
+ wp_redirect( esc_url_raw( get_edit_term_link( $term_id, $taxonomy, $post_type ) ) );
+ exit;
+
+ case 'editedtag':
+ $tag_ID = (int) $_POST['tag_ID'];
+ check_admin_referer( 'update-tag_' . $tag_ID );
+
+ if ( ! current_user_can( 'edit_term', $tag_ID ) ) {
+ wp_die(
+ '<h1>' . __( 'You need a higher level of permission.' ) . '</h1>' .
+ '<p>' . __( 'Sorry, you are not allowed to edit this item.' ) . '</p>',
+ 403
+ );
+ }
+
+ $tag = get_term( $tag_ID, $taxonomy );
+ if ( ! $tag ) {
+ wp_die( __( 'You attempted to edit an item that doesn&#8217;t exist. Perhaps it was deleted?' ) );
+ }
+
+ $ret = wp_update_term( $tag_ID, $taxonomy, $_POST );
+
+ if ( $ret && ! is_wp_error( $ret ) ) {
+ $location = add_query_arg( 'message', 3, $referer );
+ } else {
+ $location = add_query_arg(
+ array(
+ 'error' => true,
+ 'message' => 5,
+ ),
+ $referer
+ );
+ }
+ break;
+ default:
+ if ( ! $wp_list_table->current_action() || ! isset( $_REQUEST['delete_tags'] ) ) {
+ break;
+ }
+ check_admin_referer( 'bulk-tags' );
+ $tags = (array) $_REQUEST['delete_tags'];
+ /** This action is documented in wp-admin/edit-comments.php */
+ $location = apply_filters( 'handle_bulk_actions-' . get_current_screen()->id, $location, $wp_list_table->current_action(), $tags );
+ break;
+}
+
+if ( ! $location && ! empty( $_REQUEST['_wp_http_referer'] ) ) {
+ $location = remove_query_arg( array( '_wp_http_referer', '_wpnonce' ), wp_unslash( $_SERVER['REQUEST_URI'] ) );
+}
+
+if ( $location ) {
+ if ( $pagenum > 1 ) {
+ $location = add_query_arg( 'paged', $pagenum, $location ); // $pagenum takes care of $total_pages.
+ }
+
+ /**
+ * Filters the taxonomy redirect destination URL.
+ *
+ * @since 4.6.0
+ *
+ * @param string $location The destination URL.
+ * @param object $tax The taxonomy object.
+ */
+ wp_redirect( apply_filters( 'redirect_term_location', $location, $tax ) );
+ exit;
+}
+
+$wp_list_table->prepare_items();
+$total_pages = $wp_list_table->get_pagination_arg( 'total_pages' );
+
+if ( $pagenum > $total_pages && $total_pages > 0 ) {
+ wp_redirect( add_query_arg( 'paged', $total_pages ) );
+ exit;
+}
+
+wp_enqueue_script( 'admin-tags' );
+if ( current_user_can( $tax->cap->edit_terms ) ) {
+ wp_enqueue_script( 'inline-edit-tax' );
+}
+
+if ( 'category' == $taxonomy || 'link_category' == $taxonomy || 'post_tag' == $taxonomy ) {
+ $help = '';
+ if ( 'category' == $taxonomy ) {
+ $help = '<p>' . sprintf( __( 'You can use categories to define sections of your site and group related posts. The default category is &#8220;Uncategorized&#8221; until you change it in your <a href="%s">writing settings</a>.' ), 'options-writing.php' ) . '</p>';
+ } elseif ( 'link_category' == $taxonomy ) {
+ $help = '<p>' . __( 'You can create groups of links by using Link Categories. Link Category names must be unique and Link Categories are separate from the categories you use for posts.' ) . '</p>';
+ } else {
+ $help = '<p>' . __( 'You can assign keywords to your posts using <strong>tags</strong>. Unlike categories, tags have no hierarchy, meaning there&#8217;s no relationship from one tag to another.' ) . '</p>';
+ }
+
+ if ( 'link_category' == $taxonomy ) {
+ $help .= '<p>' . __( 'You can delete Link Categories in the Bulk Action pull-down, but that action does not delete the links within the category. Instead, it moves them to the default Link Category.' ) . '</p>';
+ } else {
+ $help .= '<p>' . __( 'What&#8217;s the difference between categories and tags? Normally, tags are ad-hoc keywords that identify important information in your post (names, subjects, etc) that may or may not recur in other posts, while categories are pre-determined sections. If you think of your site like a book, the categories are like the Table of Contents and the tags are like the terms in the index.' ) . '</p>';
+ }
+
+ get_current_screen()->add_help_tab(
+ array(
+ 'id' => 'overview',
+ 'title' => __( 'Overview' ),
+ 'content' => $help,
+ )
+ );
+
+ if ( 'category' == $taxonomy || 'post_tag' == $taxonomy ) {
+ if ( 'category' == $taxonomy ) {
+ $help = '<p>' . __( 'When adding a new category on this screen, you&#8217;ll fill in the following fields:' ) . '</p>';
+ } else {
+ $help = '<p>' . __( 'When adding a new tag on this screen, you&#8217;ll fill in the following fields:' ) . '</p>';
+ }
+
+ $help .= '<ul>' .
+ '<li>' . __( '<strong>Name</strong> &mdash; The name is how it appears on your site.' ) . '</li>';
+
+ if ( ! global_terms_enabled() ) {
+ $help .= '<li>' . __( '<strong>Slug</strong> &mdash; The &#8220;slug&#8221; is the URL-friendly version of the name. It is usually all lowercase and contains only letters, numbers, and hyphens.' ) . '</li>';
+ }
+
+ if ( 'category' == $taxonomy ) {
+ $help .= '<li>' . __( '<strong>Parent</strong> &mdash; Categories, unlike tags, can have a hierarchy. You might have a Jazz category, and under that have child categories for Bebop and Big Band. Totally optional. To create a subcategory, just choose another category from the Parent dropdown.' ) . '</li>';
+ }
+
+ $help .= '<li>' . __( '<strong>Description</strong> &mdash; The description is not prominent by default; however, some themes may display it.' ) . '</li>' .
+ '</ul>' .
+ '<p>' . __( 'You can change the display of this screen using the Screen Options tab to set how many items are displayed per screen and to display/hide columns in the table.' ) . '</p>';
+
+ get_current_screen()->add_help_tab(
+ array(
+ 'id' => 'adding-terms',
+ 'title' => 'category' == $taxonomy ? __( 'Adding Categories' ) : __( 'Adding Tags' ),
+ 'content' => $help,
+ )
+ );
+ }
+
+ $help = '<p><strong>' . __( 'For more information:' ) . '</strong></p>';
+
+ if ( 'category' == $taxonomy ) {
+ $help .= '<p>' . __( '<a href="https://codex.wordpress.org/Posts_Categories_Screen">Documentation on Categories</a>' ) . '</p>';
+ } elseif ( 'link_category' == $taxonomy ) {
+ $help .= '<p>' . __( '<a href="https://codex.wordpress.org/Links_Link_Categories_Screen">Documentation on Link Categories</a>' ) . '</p>';
+ } else {
+ $help .= '<p>' . __( '<a href="https://codex.wordpress.org/Posts_Tags_Screen">Documentation on Tags</a>' ) . '</p>';
+ }
+
+ $help .= '<p>' . __( '<a href="https://wordpress.org/support/">Support</a>' ) . '</p>';
+
+ get_current_screen()->set_help_sidebar( $help );
+
+ unset( $help );
+}
+
+require_once( ABSPATH . 'wp-admin/admin-header.php' );
+
+/** Also used by the Edit Tag form */
+require_once( ABSPATH . 'wp-admin/includes/edit-tag-messages.php' );
+
+$class = ( isset( $_REQUEST['error'] ) ) ? 'error' : 'updated';
+
+if ( is_plugin_active( 'wpcat2tag-importer/wpcat2tag-importer.php' ) ) {
+ $import_link = admin_url( 'admin.php?import=wpcat2tag' );
+} else {
+ $import_link = admin_url( 'import.php' );
+}
+
+?>
+
+<div class="wrap nosubsub">
+<h1 class="wp-heading-inline"><?php echo esc_html( $title ); ?></h1>
+
+<?php
+if ( isset( $_REQUEST['s'] ) && strlen( $_REQUEST['s'] ) ) {
+ /* translators: %s: search keywords */
+ printf( '<span class="subtitle">' . __( 'Search results for &#8220;%s&#8221;' ) . '</span>', esc_html( wp_unslash( $_REQUEST['s'] ) ) );
+}
+?>
+
+<hr class="wp-header-end">
+
+<?php if ( $message ) : ?>
+<div id="message" class="<?php echo $class; ?> notice is-dismissible"><p><?php echo $message; ?></p></div>
+ <?php
+ $_SERVER['REQUEST_URI'] = remove_query_arg( array( 'message', 'error' ), $_SERVER['REQUEST_URI'] );
+endif;
+?>
+<div id="ajax-response"></div>
+
+<form class="search-form wp-clearfix" method="get">
+<input type="hidden" name="taxonomy" value="<?php echo esc_attr( $taxonomy ); ?>" />
+<input type="hidden" name="post_type" value="<?php echo esc_attr( $post_type ); ?>" />
+
+<?php $wp_list_table->search_box( $tax->labels->search_items, 'tag' ); ?>
+
+</form>
+
+<?php
+$can_edit_terms = current_user_can( $tax->cap->edit_terms );
+
+if ( $can_edit_terms ) {
+ ?>
+<div id="col-container" class="wp-clearfix">
+
+<div id="col-left">
+<div class="col-wrap">
+
+ <?php
+ if ( 'category' == $taxonomy ) {
+ /**
+ * Fires before the Add Category form.
+ *
+ * @since 2.1.0
+ * @deprecated 3.0.0 Use {$taxonomy}_pre_add_form instead.
+ *
+ * @param object $arg Optional arguments cast to an object.
+ */
+ do_action( 'add_category_form_pre', (object) array( 'parent' => 0 ) );
+ } elseif ( 'link_category' == $taxonomy ) {
+ /**
+ * Fires before the link category form.
+ *
+ * @since 2.3.0
+ * @deprecated 3.0.0 Use {$taxonomy}_pre_add_form instead.
+ *
+ * @param object $arg Optional arguments cast to an object.
+ */
+ do_action( 'add_link_category_form_pre', (object) array( 'parent' => 0 ) );
+ } else {
+ /**
+ * Fires before the Add Tag form.
+ *
+ * @since 2.5.0
+ * @deprecated 3.0.0 Use {$taxonomy}_pre_add_form instead.
+ *
+ * @param string $taxonomy The taxonomy slug.
+ */
+ do_action( 'add_tag_form_pre', $taxonomy );
+ }
+
+ /**
+ * Fires before the Add Term form for all taxonomies.
+ *
+ * The dynamic portion of the hook name, `$taxonomy`, refers to the taxonomy slug.
+ *
+ * @since 3.0.0
+ *
+ * @param string $taxonomy The taxonomy slug.
+ */
+ do_action( "{$taxonomy}_pre_add_form", $taxonomy );
+ ?>
+
+<div class="form-wrap">
+<h2><?php echo $tax->labels->add_new_item; ?></h2>
+<form id="addtag" method="post" action="edit-tags.php" class="validate"
+ <?php
+ /**
+ * Fires inside the Add Tag form tag.
+ *
+ * The dynamic portion of the hook name, `$taxonomy`, refers to the taxonomy slug.
+ *
+ * @since 3.7.0
+ */
+ do_action( "{$taxonomy}_term_new_form_tag" );
+ ?>
+>
+<input type="hidden" name="action" value="add-tag" />
+<input type="hidden" name="screen" value="<?php echo esc_attr( $current_screen->id ); ?>" />
+<input type="hidden" name="taxonomy" value="<?php echo esc_attr( $taxonomy ); ?>" />
+<input type="hidden" name="post_type" value="<?php echo esc_attr( $post_type ); ?>" />
+ <?php wp_nonce_field( 'add-tag', '_wpnonce_add-tag' ); ?>
+
+<div class="form-field form-required term-name-wrap">
+ <label for="tag-name"><?php _ex( 'Name', 'term name' ); ?></label>
+ <input name="tag-name" id="tag-name" type="text" value="" size="40" aria-required="true" />
+ <p><?php _e( 'The name is how it appears on your site.' ); ?></p>
+</div>
+ <?php if ( ! global_terms_enabled() ) : ?>
+<div class="form-field term-slug-wrap">
+ <label for="tag-slug"><?php _e( 'Slug' ); ?></label>
+ <input name="slug" id="tag-slug" type="text" value="" size="40" />
+ <p><?php _e( 'The &#8220;slug&#8221; is the URL-friendly version of the name. It is usually all lowercase and contains only letters, numbers, and hyphens.' ); ?></p>
+</div>
+<?php endif; // global_terms_enabled() ?>
+ <?php if ( is_taxonomy_hierarchical( $taxonomy ) ) : ?>
+<div class="form-field term-parent-wrap">
+ <label for="parent"><?php echo esc_html( $tax->labels->parent_item ); ?></label>
+ <?php
+ $dropdown_args = array(
+ 'hide_empty' => 0,
+ 'hide_if_empty' => false,
+ 'taxonomy' => $taxonomy,
+ 'name' => 'parent',
+ 'orderby' => 'name',
+ 'hierarchical' => true,
+ 'show_option_none' => __( 'None' ),
+ );
+
+ /**
+ * Filters the taxonomy parent drop-down on the Edit Term page.
+ *
+ * @since 3.7.0
+ * @since 4.2.0 Added `$context` parameter.
+ *
+ * @param array $dropdown_args {
+ * An array of taxonomy parent drop-down arguments.
+ *
+ * @type int|bool $hide_empty Whether to hide terms not attached to any posts. Default 0|false.
+ * @type bool $hide_if_empty Whether to hide the drop-down if no terms exist. Default false.
+ * @type string $taxonomy The taxonomy slug.
+ * @type string $name Value of the name attribute to use for the drop-down select element.
+ * Default 'parent'.
+ * @type string $orderby The field to order by. Default 'name'.
+ * @type bool $hierarchical Whether the taxonomy is hierarchical. Default true.
+ * @type string $show_option_none Label to display if there are no terms. Default 'None'.
+ * }
+ * @param string $taxonomy The taxonomy slug.
+ * @param string $context Filter context. Accepts 'new' or 'edit'.
+ */
+ $dropdown_args = apply_filters( 'taxonomy_parent_dropdown_args', $dropdown_args, $taxonomy, 'new' );
+
+ wp_dropdown_categories( $dropdown_args );
+ ?>
+ <?php if ( 'category' == $taxonomy ) : ?>
+ <p><?php _e( 'Categories, unlike tags, can have a hierarchy. You might have a Jazz category, and under that have children categories for Bebop and Big Band. Totally optional.' ); ?></p>
+ <?php else : ?>
+ <p><?php _e( 'Assign a parent term to create a hierarchy. The term Jazz, for example, would be the parent of Bebop and Big Band.' ); ?></p>
+ <?php endif; ?>
+</div>
+ <?php endif; // is_taxonomy_hierarchical() ?>
+<div class="form-field term-description-wrap">
+ <label for="tag-description"><?php _e( 'Description' ); ?></label>
+ <textarea name="description" id="tag-description" rows="5" cols="40"></textarea>
+ <p><?php _e( 'The description is not prominent by default; however, some themes may show it.' ); ?></p>
+</div>
+
+ <?php
+ if ( ! is_taxonomy_hierarchical( $taxonomy ) ) {
+ /**
+ * Fires after the Add Tag form fields for non-hierarchical taxonomies.
+ *
+ * @since 3.0.0
+ *
+ * @param string $taxonomy The taxonomy slug.
+ */
+ do_action( 'add_tag_form_fields', $taxonomy );
+ }
+
+ /**
+ * Fires after the Add Term form fields.
+ *
+ * The dynamic portion of the hook name, `$taxonomy`, refers to the taxonomy slug.
+ *
+ * @since 3.0.0
+ *
+ * @param string $taxonomy The taxonomy slug.
+ */
+ do_action( "{$taxonomy}_add_form_fields", $taxonomy );
+
+ submit_button( $tax->labels->add_new_item );
+
+ if ( 'category' == $taxonomy ) {
+ /**
+ * Fires at the end of the Edit Category form.
+ *
+ * @since 2.1.0
+ * @deprecated 3.0.0 Use {$taxonomy}_add_form instead.
+ *
+ * @param object $arg Optional arguments cast to an object.
+ */
+ do_action( 'edit_category_form', (object) array( 'parent' => 0 ) );
+ } elseif ( 'link_category' == $taxonomy ) {
+ /**
+ * Fires at the end of the Edit Link form.
+ *
+ * @since 2.3.0
+ * @deprecated 3.0.0 Use {$taxonomy}_add_form instead.
+ *
+ * @param object $arg Optional arguments cast to an object.
+ */
+ do_action( 'edit_link_category_form', (object) array( 'parent' => 0 ) );
+ } else {
+ /**
+ * Fires at the end of the Add Tag form.
+ *
+ * @since 2.7.0
+ * @deprecated 3.0.0 Use {$taxonomy}_add_form instead.
+ *
+ * @param string $taxonomy The taxonomy slug.
+ */
+ do_action( 'add_tag_form', $taxonomy );
+ }
+
+ /**
+ * Fires at the end of the Add Term form for all taxonomies.
+ *
+ * The dynamic portion of the hook name, `$taxonomy`, refers to the taxonomy slug.
+ *
+ * @since 3.0.0
+ *
+ * @param string $taxonomy The taxonomy slug.
+ */
+ do_action( "{$taxonomy}_add_form", $taxonomy );
+ ?>
+</form></div>
+</div>
+</div><!-- /col-left -->
+
+<div id="col-right">
+<div class="col-wrap">
+<?php } ?>
+
+<?php $wp_list_table->views(); ?>
+
+<form id="posts-filter" method="post">
+<input type="hidden" name="taxonomy" value="<?php echo esc_attr( $taxonomy ); ?>" />
+<input type="hidden" name="post_type" value="<?php echo esc_attr( $post_type ); ?>" />
+
+<?php $wp_list_table->display(); ?>
+
+</form>
+
+<?php if ( 'category' == $taxonomy ) : ?>
+<div class="form-wrap edit-term-notes">
+<p>
+ <?php
+ printf(
+ /* translators: %s: default category */
+ __( 'Deleting a category does not delete the posts in that category. Instead, posts that were only assigned to the deleted category are set to the default category %s. The default category cannot be deleted.' ),
+ /** This filter is documented in wp-includes/category-template.php */
+ '<strong>' . apply_filters( 'the_category', get_cat_name( get_option( 'default_category' ) ), '', '' ) . '</strong>'
+ );
+ ?>
+</p>
+ <?php if ( current_user_can( 'import' ) ) : ?>
+ <p>
+ <?php printf( __( 'Categories can be selectively converted to tags using the <a href="%s">category to tag converter</a>.' ), esc_url( $import_link ) ); ?>
+ </p>
+ <?php endif; ?>
+</div>
+<?php elseif ( 'post_tag' == $taxonomy && current_user_can( 'import' ) ) : ?>
+<div class="form-wrap edit-term-notes">
+<p><?php printf( __( 'Tags can be selectively converted to categories using the <a href="%s">tag to category converter</a>.' ), esc_url( $import_link ) ); ?></p>
+</div>
+ <?php
+endif;
+
+/**
+ * Fires after the taxonomy list table.
+ *
+ * The dynamic portion of the hook name, `$taxonomy`, refers to the taxonomy slug.
+ *
+ * @since 3.0.0
+ *
+ * @param string $taxonomy The taxonomy name.
+ */
+do_action( "after-{$taxonomy}-table", $taxonomy );
+
+if ( $can_edit_terms ) {
+ ?>
+</div>
+</div><!-- /col-right -->
+
+</div><!-- /col-container -->
+<?php } ?>
+
+</div><!-- /wrap -->
+
+<?php if ( ! wp_is_mobile() ) : ?>
+<script type="text/javascript">
+try{document.forms.addtag['tag-name'].focus();}catch(e){}
+</script>
+ <?php
+endif;
+
+$wp_list_table->inline_edit();
+
+include( ABSPATH . 'wp-admin/admin-footer.php' );
diff --git a/www/crm/wp-admin/edit.php b/www/crm/wp-admin/edit.php
new file mode 100644
index 00000000..d9333b97
--- /dev/null
+++ b/www/crm/wp-admin/edit.php
@@ -0,0 +1,431 @@
+<?php
+/**
+ * Edit Posts Administration Screen.
+ *
+ * @package WordPress
+ * @subpackage Administration
+ */
+
+/** WordPress Administration Bootstrap */
+require_once( dirname( __FILE__ ) . '/admin.php' );
+
+if ( ! $typenow ) {
+ wp_die( __( 'Invalid post type.' ) );
+}
+
+if ( ! in_array( $typenow, get_post_types( array( 'show_ui' => true ) ) ) ) {
+ wp_die( __( 'Sorry, you are not allowed to edit posts in this post type.' ) );
+}
+
+if ( 'attachment' === $typenow ) {
+ if ( wp_redirect( admin_url( 'upload.php' ) ) ) {
+ exit;
+ }
+}
+
+/**
+ * @global string $post_type
+ * @global WP_Post_Type $post_type_object
+ */
+global $post_type, $post_type_object;
+
+$post_type = $typenow;
+$post_type_object = get_post_type_object( $post_type );
+
+if ( ! $post_type_object ) {
+ wp_die( __( 'Invalid post type.' ) );
+}
+
+if ( ! current_user_can( $post_type_object->cap->edit_posts ) ) {
+ wp_die(
+ '<h1>' . __( 'You need a higher level of permission.' ) . '</h1>' .
+ '<p>' . __( 'Sorry, you are not allowed to edit posts in this post type.' ) . '</p>',
+ 403
+ );
+}
+
+$wp_list_table = _get_list_table( 'WP_Posts_List_Table' );
+$pagenum = $wp_list_table->get_pagenum();
+
+// Back-compat for viewing comments of an entry
+foreach ( array( 'p', 'attachment_id', 'page_id' ) as $_redirect ) {
+ if ( ! empty( $_REQUEST[ $_redirect ] ) ) {
+ wp_redirect( admin_url( 'edit-comments.php?p=' . absint( $_REQUEST[ $_redirect ] ) ) );
+ exit;
+ }
+}
+unset( $_redirect );
+
+if ( 'post' != $post_type ) {
+ $parent_file = "edit.php?post_type=$post_type";
+ $submenu_file = "edit.php?post_type=$post_type";
+ $post_new_file = "post-new.php?post_type=$post_type";
+} else {
+ $parent_file = 'edit.php';
+ $submenu_file = 'edit.php';
+ $post_new_file = 'post-new.php';
+}
+
+$doaction = $wp_list_table->current_action();
+
+if ( $doaction ) {
+ check_admin_referer( 'bulk-posts' );
+
+ $sendback = remove_query_arg( array( 'trashed', 'untrashed', 'deleted', 'locked', 'ids' ), wp_get_referer() );
+ if ( ! $sendback ) {
+ $sendback = admin_url( $parent_file );
+ }
+ $sendback = add_query_arg( 'paged', $pagenum, $sendback );
+ if ( strpos( $sendback, 'post.php' ) !== false ) {
+ $sendback = admin_url( $post_new_file );
+ }
+
+ if ( 'delete_all' == $doaction ) {
+ // Prepare for deletion of all posts with a specified post status (i.e. Empty trash).
+ $post_status = preg_replace( '/[^a-z0-9_-]+/i', '', $_REQUEST['post_status'] );
+ // Validate the post status exists.
+ if ( get_post_status_object( $post_status ) ) {
+ $post_ids = $wpdb->get_col( $wpdb->prepare( "SELECT ID FROM $wpdb->posts WHERE post_type=%s AND post_status = %s", $post_type, $post_status ) );
+ }
+ $doaction = 'delete';
+ } elseif ( isset( $_REQUEST['media'] ) ) {
+ $post_ids = $_REQUEST['media'];
+ } elseif ( isset( $_REQUEST['ids'] ) ) {
+ $post_ids = explode( ',', $_REQUEST['ids'] );
+ } elseif ( ! empty( $_REQUEST['post'] ) ) {
+ $post_ids = array_map( 'intval', $_REQUEST['post'] );
+ }
+
+ if ( ! isset( $post_ids ) ) {
+ wp_redirect( $sendback );
+ exit;
+ }
+
+ switch ( $doaction ) {
+ case 'trash':
+ $trashed = $locked = 0;
+
+ foreach ( (array) $post_ids as $post_id ) {
+ if ( ! current_user_can( 'delete_post', $post_id ) ) {
+ wp_die( __( 'Sorry, you are not allowed to move this item to the Trash.' ) );
+ }
+
+ if ( wp_check_post_lock( $post_id ) ) {
+ $locked++;
+ continue;
+ }
+
+ if ( ! wp_trash_post( $post_id ) ) {
+ wp_die( __( 'Error in moving to Trash.' ) );
+ }
+
+ $trashed++;
+ }
+
+ $sendback = add_query_arg(
+ array(
+ 'trashed' => $trashed,
+ 'ids' => join( ',', $post_ids ),
+ 'locked' => $locked,
+ ),
+ $sendback
+ );
+ break;
+ case 'untrash':
+ $untrashed = 0;
+ foreach ( (array) $post_ids as $post_id ) {
+ if ( ! current_user_can( 'delete_post', $post_id ) ) {
+ wp_die( __( 'Sorry, you are not allowed to restore this item from the Trash.' ) );
+ }
+
+ if ( ! wp_untrash_post( $post_id ) ) {
+ wp_die( __( 'Error in restoring from Trash.' ) );
+ }
+
+ $untrashed++;
+ }
+ $sendback = add_query_arg( 'untrashed', $untrashed, $sendback );
+ break;
+ case 'delete':
+ $deleted = 0;
+ foreach ( (array) $post_ids as $post_id ) {
+ $post_del = get_post( $post_id );
+
+ if ( ! current_user_can( 'delete_post', $post_id ) ) {
+ wp_die( __( 'Sorry, you are not allowed to delete this item.' ) );
+ }
+
+ if ( $post_del->post_type == 'attachment' ) {
+ if ( ! wp_delete_attachment( $post_id ) ) {
+ wp_die( __( 'Error in deleting.' ) );
+ }
+ } else {
+ if ( ! wp_delete_post( $post_id ) ) {
+ wp_die( __( 'Error in deleting.' ) );
+ }
+ }
+ $deleted++;
+ }
+ $sendback = add_query_arg( 'deleted', $deleted, $sendback );
+ break;
+ case 'edit':
+ if ( isset( $_REQUEST['bulk_edit'] ) ) {
+ $done = bulk_edit_posts( $_REQUEST );
+
+ if ( is_array( $done ) ) {
+ $done['updated'] = count( $done['updated'] );
+ $done['skipped'] = count( $done['skipped'] );
+ $done['locked'] = count( $done['locked'] );
+ $sendback = add_query_arg( $done, $sendback );
+ }
+ }
+ break;
+ default:
+ /** This action is documented in wp-admin/edit-comments.php */
+ $sendback = apply_filters( 'handle_bulk_actions-' . get_current_screen()->id, $sendback, $doaction, $post_ids );
+ break;
+ }
+
+ $sendback = remove_query_arg( array( 'action', 'action2', 'tags_input', 'post_author', 'comment_status', 'ping_status', '_status', 'post', 'bulk_edit', 'post_view' ), $sendback );
+
+ wp_redirect( $sendback );
+ exit();
+} elseif ( ! empty( $_REQUEST['_wp_http_referer'] ) ) {
+ wp_redirect( remove_query_arg( array( '_wp_http_referer', '_wpnonce' ), wp_unslash( $_SERVER['REQUEST_URI'] ) ) );
+ exit;
+}
+
+$wp_list_table->prepare_items();
+
+wp_enqueue_script( 'inline-edit-post' );
+wp_enqueue_script( 'heartbeat' );
+
+if ( 'wp_block' === $post_type ) {
+ wp_enqueue_script( 'wp-list-reusable-blocks' );
+ wp_enqueue_style( 'wp-list-reusable-blocks' );
+}
+
+$title = $post_type_object->labels->name;
+
+if ( 'post' == $post_type ) {
+ get_current_screen()->add_help_tab(
+ array(
+ 'id' => 'overview',
+ 'title' => __( 'Overview' ),
+ 'content' =>
+ '<p>' . __( 'This screen provides access to all of your posts. You can customize the display of this screen to suit your workflow.' ) . '</p>',
+ )
+ );
+ get_current_screen()->add_help_tab(
+ array(
+ 'id' => 'screen-content',
+ 'title' => __( 'Screen Content' ),
+ 'content' =>
+ '<p>' . __( 'You can customize the display of this screen&#8217;s contents in a number of ways:' ) . '</p>' .
+ '<ul>' .
+ '<li>' . __( 'You can hide/display columns based on your needs and decide how many posts to list per screen using the Screen Options tab.' ) . '</li>' .
+ '<li>' . __( 'You can filter the list of posts by post status using the text links above the posts list to only show posts with that status. The default view is to show all posts.' ) . '</li>' .
+ '<li>' . __( 'You can view posts in a simple title list or with an excerpt using the Screen Options tab.' ) . '</li>' .
+ '<li>' . __( 'You can refine the list to show only posts in a specific category or from a specific month by using the dropdown menus above the posts list. Click the Filter button after making your selection. You also can refine the list by clicking on the post author, category or tag in the posts list.' ) . '</li>' .
+ '</ul>',
+ )
+ );
+ get_current_screen()->add_help_tab(
+ array(
+ 'id' => 'action-links',
+ 'title' => __( 'Available Actions' ),
+ 'content' =>
+ '<p>' . __( 'Hovering over a row in the posts list will display action links that allow you to manage your post. You can perform the following actions:' ) . '</p>' .
+ '<ul>' .
+ '<li>' . __( '<strong>Edit</strong> takes you to the editing screen for that post. You can also reach that screen by clicking on the post title.' ) . '</li>' .
+ '<li>' . __( '<strong>Quick Edit</strong> provides inline access to the metadata of your post, allowing you to update post details without leaving this screen.' ) . '</li>' .
+ '<li>' . __( '<strong>Trash</strong> removes your post from this list and places it in the trash, from which you can permanently delete it.' ) . '</li>' .
+ '<li>' . __( '<strong>Preview</strong> will show you what your draft post will look like if you publish it. View will take you to your live site to view the post. Which link is available depends on your post&#8217;s status.' ) . '</li>' .
+ '</ul>',
+ )
+ );
+ get_current_screen()->add_help_tab(
+ array(
+ 'id' => 'bulk-actions',
+ 'title' => __( 'Bulk Actions' ),
+ 'content' =>
+ '<p>' . __( 'You can also edit or move multiple posts to the trash at once. Select the posts you want to act on using the checkboxes, then select the action you want to take from the Bulk Actions menu and click Apply.' ) . '</p>' .
+ '<p>' . __( 'When using Bulk Edit, you can change the metadata (categories, author, etc.) for all selected posts at once. To remove a post from the grouping, just click the x next to its name in the Bulk Edit area that appears.' ) . '</p>',
+ )
+ );
+
+ get_current_screen()->set_help_sidebar(
+ '<p><strong>' . __( 'For more information:' ) . '</strong></p>' .
+ '<p>' . __( '<a href="https://codex.wordpress.org/Posts_Screen">Documentation on Managing Posts</a>' ) . '</p>' .
+ '<p>' . __( '<a href="https://wordpress.org/support/">Support</a>' ) . '</p>'
+ );
+
+} elseif ( 'page' == $post_type ) {
+ get_current_screen()->add_help_tab(
+ array(
+ 'id' => 'overview',
+ 'title' => __( 'Overview' ),
+ 'content' =>
+ '<p>' . __( 'Pages are similar to posts in that they have a title, body text, and associated metadata, but they are different in that they are not part of the chronological blog stream, kind of like permanent posts. Pages are not categorized or tagged, but can have a hierarchy. You can nest pages under other pages by making one the &#8220;Parent&#8221; of the other, creating a group of pages.' ) . '</p>',
+ )
+ );
+ get_current_screen()->add_help_tab(
+ array(
+ 'id' => 'managing-pages',
+ 'title' => __( 'Managing Pages' ),
+ 'content' =>
+ '<p>' . __( 'Managing pages is very similar to managing posts, and the screens can be customized in the same way.' ) . '</p>' .
+ '<p>' . __( 'You can also perform the same types of actions, including narrowing the list by using the filters, acting on a page using the action links that appear when you hover over a row, or using the Bulk Actions menu to edit the metadata for multiple pages at once.' ) . '</p>',
+ )
+ );
+
+ get_current_screen()->set_help_sidebar(
+ '<p><strong>' . __( 'For more information:' ) . '</strong></p>' .
+ '<p>' . __( '<a href="https://codex.wordpress.org/Pages_Screen">Documentation on Managing Pages</a>' ) . '</p>' .
+ '<p>' . __( '<a href="https://wordpress.org/support/">Support</a>' ) . '</p>'
+ );
+
+}
+
+get_current_screen()->set_screen_reader_content(
+ array(
+ 'heading_views' => $post_type_object->labels->filter_items_list,
+ 'heading_pagination' => $post_type_object->labels->items_list_navigation,
+ 'heading_list' => $post_type_object->labels->items_list,
+ )
+);
+
+add_screen_option(
+ 'per_page',
+ array(
+ 'default' => 20,
+ 'option' => 'edit_' . $post_type . '_per_page',
+ )
+);
+
+$bulk_counts = array(
+ 'updated' => isset( $_REQUEST['updated'] ) ? absint( $_REQUEST['updated'] ) : 0,
+ 'locked' => isset( $_REQUEST['locked'] ) ? absint( $_REQUEST['locked'] ) : 0,
+ 'deleted' => isset( $_REQUEST['deleted'] ) ? absint( $_REQUEST['deleted'] ) : 0,
+ 'trashed' => isset( $_REQUEST['trashed'] ) ? absint( $_REQUEST['trashed'] ) : 0,
+ 'untrashed' => isset( $_REQUEST['untrashed'] ) ? absint( $_REQUEST['untrashed'] ) : 0,
+);
+
+$bulk_messages = array();
+$bulk_messages['post'] = array(
+ 'updated' => _n( '%s post updated.', '%s posts updated.', $bulk_counts['updated'] ),
+ 'locked' => ( 1 == $bulk_counts['locked'] ) ? __( '1 post not updated, somebody is editing it.' ) :
+ _n( '%s post not updated, somebody is editing it.', '%s posts not updated, somebody is editing them.', $bulk_counts['locked'] ),
+ 'deleted' => _n( '%s post permanently deleted.', '%s posts permanently deleted.', $bulk_counts['deleted'] ),
+ 'trashed' => _n( '%s post moved to the Trash.', '%s posts moved to the Trash.', $bulk_counts['trashed'] ),
+ 'untrashed' => _n( '%s post restored from the Trash.', '%s posts restored from the Trash.', $bulk_counts['untrashed'] ),
+);
+$bulk_messages['page'] = array(
+ 'updated' => _n( '%s page updated.', '%s pages updated.', $bulk_counts['updated'] ),
+ 'locked' => ( 1 == $bulk_counts['locked'] ) ? __( '1 page not updated, somebody is editing it.' ) :
+ _n( '%s page not updated, somebody is editing it.', '%s pages not updated, somebody is editing them.', $bulk_counts['locked'] ),
+ 'deleted' => _n( '%s page permanently deleted.', '%s pages permanently deleted.', $bulk_counts['deleted'] ),
+ 'trashed' => _n( '%s page moved to the Trash.', '%s pages moved to the Trash.', $bulk_counts['trashed'] ),
+ 'untrashed' => _n( '%s page restored from the Trash.', '%s pages restored from the Trash.', $bulk_counts['untrashed'] ),
+);
+$bulk_messages['wp_block'] = array(
+ 'updated' => _n( '%s block updated.', '%s blocks updated.', $bulk_counts['updated'] ),
+ 'locked' => ( 1 == $bulk_counts['locked'] ) ? __( '1 block not updated, somebody is editing it.' ) : _n( '%s block not updated, somebody is editing it.', '%s blocks not updated, somebody is editing them.', $bulk_counts['locked'] ),
+ 'deleted' => _n( '%s block permanently deleted.', '%s blocks permanently deleted.', $bulk_counts['deleted'] ),
+ 'trashed' => _n( '%s block moved to the Trash.', '%s blocks moved to the Trash.', $bulk_counts['trashed'] ),
+ 'untrashed' => _n( '%s block restored from the Trash.', '%s blocks restored from the Trash.', $bulk_counts['untrashed'] ),
+);
+
+/**
+ * Filters the bulk action updated messages.
+ *
+ * By default, custom post types use the messages for the 'post' post type.
+ *
+ * @since 3.7.0
+ *
+ * @param array[] $bulk_messages Arrays of messages, each keyed by the corresponding post type. Messages are
+ * keyed with 'updated', 'locked', 'deleted', 'trashed', and 'untrashed'.
+ * @param int[] $bulk_counts Array of item counts for each message, used to build internationalized strings.
+ */
+$bulk_messages = apply_filters( 'bulk_post_updated_messages', $bulk_messages, $bulk_counts );
+$bulk_counts = array_filter( $bulk_counts );
+
+require_once( ABSPATH . 'wp-admin/admin-header.php' );
+?>
+<div class="wrap">
+<h1 class="wp-heading-inline">
+<?php
+echo esc_html( $post_type_object->labels->name );
+?>
+</h1>
+
+<?php
+if ( current_user_can( $post_type_object->cap->create_posts ) ) {
+ echo ' <a href="' . esc_url( admin_url( $post_new_file ) ) . '" class="page-title-action">' . esc_html( $post_type_object->labels->add_new ) . '</a>';
+}
+
+if ( isset( $_REQUEST['s'] ) && strlen( $_REQUEST['s'] ) ) {
+ /* translators: %s: search keywords */
+ printf( ' <span class="subtitle">' . __( 'Search results for &#8220;%s&#8221;' ) . '</span>', get_search_query() );
+}
+?>
+
+<hr class="wp-header-end">
+
+<?php
+// If we have a bulk message to issue:
+$messages = array();
+foreach ( $bulk_counts as $message => $count ) {
+ if ( isset( $bulk_messages[ $post_type ][ $message ] ) ) {
+ $messages[] = sprintf( $bulk_messages[ $post_type ][ $message ], number_format_i18n( $count ) );
+ } elseif ( isset( $bulk_messages['post'][ $message ] ) ) {
+ $messages[] = sprintf( $bulk_messages['post'][ $message ], number_format_i18n( $count ) );
+ }
+
+ if ( $message == 'trashed' && isset( $_REQUEST['ids'] ) ) {
+ $ids = preg_replace( '/[^0-9,]/', '', $_REQUEST['ids'] );
+ $messages[] = '<a href="' . esc_url( wp_nonce_url( "edit.php?post_type=$post_type&doaction=undo&action=untrash&ids=$ids", 'bulk-posts' ) ) . '">' . __( 'Undo' ) . '</a>';
+ }
+}
+
+if ( $messages ) {
+ echo '<div id="message" class="updated notice is-dismissible"><p>' . join( ' ', $messages ) . '</p></div>';
+}
+unset( $messages );
+
+$_SERVER['REQUEST_URI'] = remove_query_arg( array( 'locked', 'skipped', 'updated', 'deleted', 'trashed', 'untrashed' ), $_SERVER['REQUEST_URI'] );
+?>
+
+<?php $wp_list_table->views(); ?>
+
+<form id="posts-filter" method="get">
+
+<?php $wp_list_table->search_box( $post_type_object->labels->search_items, 'post' ); ?>
+
+<input type="hidden" name="post_status" class="post_status_page" value="<?php echo ! empty( $_REQUEST['post_status'] ) ? esc_attr( $_REQUEST['post_status'] ) : 'all'; ?>" />
+<input type="hidden" name="post_type" class="post_type_page" value="<?php echo $post_type; ?>" />
+
+<?php if ( ! empty( $_REQUEST['author'] ) ) { ?>
+<input type="hidden" name="author" value="<?php echo esc_attr( $_REQUEST['author'] ); ?>" />
+<?php } ?>
+
+<?php if ( ! empty( $_REQUEST['show_sticky'] ) ) { ?>
+<input type="hidden" name="show_sticky" value="1" />
+<?php } ?>
+
+<?php $wp_list_table->display(); ?>
+
+</form>
+
+<?php
+if ( $wp_list_table->has_items() ) {
+ $wp_list_table->inline_edit();
+}
+?>
+
+<div id="ajax-response"></div>
+<br class="clear" />
+</div>
+
+<?php
+include( ABSPATH . 'wp-admin/admin-footer.php' );
diff --git a/www/crm/wp-admin/export.php b/www/crm/wp-admin/export.php
new file mode 100644
index 00000000..39c60737
--- /dev/null
+++ b/www/crm/wp-admin/export.php
@@ -0,0 +1,324 @@
+<?php
+/**
+ * WordPress Export Administration Screen
+ *
+ * @package WordPress
+ * @subpackage Administration
+ */
+
+/** Load WordPress Bootstrap */
+require_once( dirname( __FILE__ ) . '/admin.php' );
+
+if ( ! current_user_can( 'export' ) ) {
+ wp_die( __( 'Sorry, you are not allowed to export the content of this site.' ) );
+}
+
+/** Load WordPress export API */
+require_once( ABSPATH . 'wp-admin/includes/export.php' );
+$title = __( 'Export' );
+
+/**
+ * Display JavaScript on the page.
+ *
+ * @since 3.5.0
+ */
+function export_add_js() {
+ ?>
+<script type="text/javascript">
+ jQuery(document).ready(function($){
+ var form = $('#export-filters'),
+ filters = form.find('.export-filters');
+ filters.hide();
+ form.find('input:radio').change(function() {
+ filters.slideUp('fast');
+ switch ( $(this).val() ) {
+ case 'attachment': $('#attachment-filters').slideDown(); break;
+ case 'posts': $('#post-filters').slideDown(); break;
+ case 'pages': $('#page-filters').slideDown(); break;
+ }
+ });
+ });
+</script>
+ <?php
+}
+add_action( 'admin_head', 'export_add_js' );
+
+get_current_screen()->add_help_tab(
+ array(
+ 'id' => 'overview',
+ 'title' => __( 'Overview' ),
+ 'content' => '<p>' . __( 'You can export a file of your site&#8217;s content in order to import it into another installation or platform. The export file will be an XML file format called WXR. Posts, pages, comments, custom fields, categories, and tags can be included. You can choose for the WXR file to include only certain posts or pages by setting the dropdown filters to limit the export by category, author, date range by month, or publishing status.' ) . '</p>' .
+ '<p>' . __( 'Once generated, your WXR file can be imported by another WordPress site or by another blogging platform able to access this format.' ) . '</p>',
+ )
+);
+
+get_current_screen()->set_help_sidebar(
+ '<p><strong>' . __( 'For more information:' ) . '</strong></p>' .
+ '<p>' . __( '<a href="https://codex.wordpress.org/Tools_Export_Screen">Documentation on Export</a>' ) . '</p>' .
+ '<p>' . __( '<a href="https://wordpress.org/support/">Support</a>' ) . '</p>'
+);
+
+// If the 'download' URL parameter is set, a WXR export file is baked and returned.
+if ( isset( $_GET['download'] ) ) {
+ $args = array();
+
+ if ( ! isset( $_GET['content'] ) || 'all' == $_GET['content'] ) {
+ $args['content'] = 'all';
+ } elseif ( 'posts' == $_GET['content'] ) {
+ $args['content'] = 'post';
+
+ if ( $_GET['cat'] ) {
+ $args['category'] = (int) $_GET['cat'];
+ }
+
+ if ( $_GET['post_author'] ) {
+ $args['author'] = (int) $_GET['post_author'];
+ }
+
+ if ( $_GET['post_start_date'] || $_GET['post_end_date'] ) {
+ $args['start_date'] = $_GET['post_start_date'];
+ $args['end_date'] = $_GET['post_end_date'];
+ }
+
+ if ( $_GET['post_status'] ) {
+ $args['status'] = $_GET['post_status'];
+ }
+ } elseif ( 'pages' == $_GET['content'] ) {
+ $args['content'] = 'page';
+
+ if ( $_GET['page_author'] ) {
+ $args['author'] = (int) $_GET['page_author'];
+ }
+
+ if ( $_GET['page_start_date'] || $_GET['page_end_date'] ) {
+ $args['start_date'] = $_GET['page_start_date'];
+ $args['end_date'] = $_GET['page_end_date'];
+ }
+
+ if ( $_GET['page_status'] ) {
+ $args['status'] = $_GET['page_status'];
+ }
+ } elseif ( 'attachment' == $_GET['content'] ) {
+ $args['content'] = 'attachment';
+
+ if ( $_GET['attachment_start_date'] || $_GET['attachment_end_date'] ) {
+ $args['start_date'] = $_GET['attachment_start_date'];
+ $args['end_date'] = $_GET['attachment_end_date'];
+ }
+ } else {
+ $args['content'] = $_GET['content'];
+ }
+
+ /**
+ * Filters the export args.
+ *
+ * @since 3.5.0
+ *
+ * @param array $args The arguments to send to the exporter.
+ */
+ $args = apply_filters( 'export_args', $args );
+
+ export_wp( $args );
+ die();
+}
+
+require_once( ABSPATH . 'wp-admin/admin-header.php' );
+
+/**
+ * Create the date options fields for exporting a given post type.
+ *
+ * @global wpdb $wpdb WordPress database abstraction object.
+ * @global WP_Locale $wp_locale Date and Time Locale object.
+ *
+ * @since 3.1.0
+ *
+ * @param string $post_type The post type. Default 'post'.
+ */
+function export_date_options( $post_type = 'post' ) {
+ global $wpdb, $wp_locale;
+
+ $months = $wpdb->get_results(
+ $wpdb->prepare(
+ "
+ SELECT DISTINCT YEAR( post_date ) AS year, MONTH( post_date ) AS month
+ FROM $wpdb->posts
+ WHERE post_type = %s AND post_status != 'auto-draft'
+ ORDER BY post_date DESC
+ ",
+ $post_type
+ )
+ );
+
+ $month_count = count( $months );
+ if ( ! $month_count || ( 1 == $month_count && 0 == $months[0]->month ) ) {
+ return;
+ }
+
+ foreach ( $months as $date ) {
+ if ( 0 == $date->year ) {
+ continue;
+ }
+
+ $month = zeroise( $date->month, 2 );
+ echo '<option value="' . $date->year . '-' . $month . '">' . $wp_locale->get_month( $month ) . ' ' . $date->year . '</option>';
+ }
+}
+?>
+
+<div class="wrap">
+<h1><?php echo esc_html( $title ); ?></h1>
+
+<p><?php _e( 'When you click the button below WordPress will create an XML file for you to save to your computer.' ); ?></p>
+<p><?php _e( 'This format, which we call WordPress eXtended RSS or WXR, will contain your posts, pages, comments, custom fields, categories, and tags.' ); ?></p>
+<p><?php _e( 'Once you&#8217;ve saved the download file, you can use the Import function in another WordPress installation to import the content from this site.' ); ?></p>
+
+<h2><?php _e( 'Choose what to export' ); ?></h2>
+<form method="get" id="export-filters">
+<fieldset>
+<legend class="screen-reader-text"><?php _e( 'Content to export' ); ?></legend>
+<input type="hidden" name="download" value="true" />
+<p><label><input type="radio" name="content" value="all" checked="checked" aria-describedby="all-content-desc" /> <?php _e( 'All content' ); ?></label></p>
+<p class="description" id="all-content-desc"><?php _e( 'This will contain all of your posts, pages, comments, custom fields, terms, navigation menus, and custom posts.' ); ?></p>
+
+<p><label><input type="radio" name="content" value="posts" /> <?php _e( 'Posts' ); ?></label></p>
+<ul id="post-filters" class="export-filters">
+ <li>
+ <label><span class="label-responsive"><?php _e( 'Categories:' ); ?></span>
+ <?php wp_dropdown_categories( array( 'show_option_all' => __( 'All' ) ) ); ?>
+ </label>
+ </li>
+ <li>
+ <label><span class="label-responsive"><?php _e( 'Authors:' ); ?></span>
+ <?php
+ $authors = $wpdb->get_col( "SELECT DISTINCT post_author FROM {$wpdb->posts} WHERE post_type = 'post'" );
+ wp_dropdown_users(
+ array(
+ 'include' => $authors,
+ 'name' => 'post_author',
+ 'multi' => true,
+ 'show_option_all' => __( 'All' ),
+ 'show' => 'display_name_with_login',
+ )
+ );
+ ?>
+ </label>
+ </li>
+ <li>
+ <fieldset>
+ <legend class="screen-reader-text"><?php _e( 'Date range:' ); ?></legend>
+ <label for="post-start-date" class="label-responsive"><?php _e( 'Start date:' ); ?></label>
+ <select name="post_start_date" id="post-start-date">
+ <option value="0"><?php _e( '&mdash; Select &mdash;' ); ?></option>
+ <?php export_date_options(); ?>
+ </select>
+ <label for="post-end-date" class="label-responsive"><?php _e( 'End date:' ); ?></label>
+ <select name="post_end_date" id="post-end-date">
+ <option value="0"><?php _e( '&mdash; Select &mdash;' ); ?></option>
+ <?php export_date_options(); ?>
+ </select>
+ </fieldset>
+ </li>
+ <li>
+ <label for="post-status" class="label-responsive"><?php _e( 'Status:' ); ?></label>
+ <select name="post_status" id="post-status">
+ <option value="0"><?php _e( 'All' ); ?></option>
+ <?php
+ $post_stati = get_post_stati( array( 'internal' => false ), 'objects' );
+ foreach ( $post_stati as $status ) :
+ ?>
+ <option value="<?php echo esc_attr( $status->name ); ?>"><?php echo esc_html( $status->label ); ?></option>
+ <?php endforeach; ?>
+ </select>
+ </li>
+</ul>
+
+<p><label><input type="radio" name="content" value="pages" /> <?php _e( 'Pages' ); ?></label></p>
+<ul id="page-filters" class="export-filters">
+ <li>
+ <label><span class="label-responsive"><?php _e( 'Authors:' ); ?></span>
+ <?php
+ $authors = $wpdb->get_col( "SELECT DISTINCT post_author FROM {$wpdb->posts} WHERE post_type = 'page'" );
+ wp_dropdown_users(
+ array(
+ 'include' => $authors,
+ 'name' => 'page_author',
+ 'multi' => true,
+ 'show_option_all' => __( 'All' ),
+ 'show' => 'display_name_with_login',
+ )
+ );
+ ?>
+ </label>
+ </li>
+ <li>
+ <fieldset>
+ <legend class="screen-reader-text"><?php _e( 'Date range:' ); ?></legend>
+ <label for="page-start-date" class="label-responsive"><?php _e( 'Start date:' ); ?></label>
+ <select name="page_start_date" id="page-start-date">
+ <option value="0"><?php _e( '&mdash; Select &mdash;' ); ?></option>
+ <?php export_date_options( 'page' ); ?>
+ </select>
+ <label for="page-end-date" class="label-responsive"><?php _e( 'End date:' ); ?></label>
+ <select name="page_end_date" id="page-end-date">
+ <option value="0"><?php _e( '&mdash; Select &mdash;' ); ?></option>
+ <?php export_date_options( 'page' ); ?>
+ </select>
+ </fieldset>
+ </li>
+ <li>
+ <label for="page-status" class="label-responsive"><?php _e( 'Status:' ); ?></label>
+ <select name="page_status" id="page-status">
+ <option value="0"><?php _e( 'All' ); ?></option>
+ <?php foreach ( $post_stati as $status ) : ?>
+ <option value="<?php echo esc_attr( $status->name ); ?>"><?php echo esc_html( $status->label ); ?></option>
+ <?php endforeach; ?>
+ </select>
+ </li>
+</ul>
+
+<?php
+foreach ( get_post_types(
+ array(
+ '_builtin' => false,
+ 'can_export' => true,
+ ),
+ 'objects'
+) as $post_type ) :
+ ?>
+<p><label><input type="radio" name="content" value="<?php echo esc_attr( $post_type->name ); ?>" /> <?php echo esc_html( $post_type->label ); ?></label></p>
+<?php endforeach; ?>
+
+<p><label><input type="radio" name="content" value="attachment" /> <?php _e( 'Media' ); ?></label></p>
+<ul id="attachment-filters" class="export-filters">
+ <li>
+ <fieldset>
+ <legend class="screen-reader-text"><?php _e( 'Date range:' ); ?></legend>
+ <label for="attachment-start-date" class="label-responsive"><?php _e( 'Start date:' ); ?></label>
+ <select name="attachment_start_date" id="attachment-start-date">
+ <option value="0"><?php _e( '&mdash; Select &mdash;' ); ?></option>
+ <?php export_date_options( 'attachment' ); ?>
+ </select>
+ <label for="attachment-end-date" class="label-responsive"><?php _e( 'End date:' ); ?></label>
+ <select name="attachment_end_date" id="attachment-end-date">
+ <option value="0"><?php _e( '&mdash; Select &mdash;' ); ?></option>
+ <?php export_date_options( 'attachment' ); ?>
+ </select>
+ </fieldset>
+ </li>
+</ul>
+
+</fieldset>
+<?php
+/**
+ * Fires at the end of the export filters form.
+ *
+ * @since 3.5.0
+ */
+do_action( 'export_filters' );
+?>
+
+<?php submit_button( __( 'Download Export File' ) ); ?>
+</form>
+</div>
+
+<?php include( ABSPATH . 'wp-admin/admin-footer.php' ); ?>
diff --git a/www/crm/wp-admin/freedoms.php b/www/crm/wp-admin/freedoms.php
new file mode 100644
index 00000000..8dfcc28f
--- /dev/null
+++ b/www/crm/wp-admin/freedoms.php
@@ -0,0 +1,144 @@
+<?php
+/**
+ * Your Rights administration panel.
+ *
+ * @package WordPress
+ * @subpackage Administration
+ */
+
+/** WordPress Administration Bootstrap */
+require_once( dirname( __FILE__ ) . '/admin.php' );
+
+$title = __( 'Freedoms' );
+
+list( $display_version ) = explode( '-', get_bloginfo( 'version' ) );
+
+include( ABSPATH . 'wp-admin/admin-header.php' );
+
+$is_privacy_notice = isset( $_GET['privacy-notice'] );
+
+if ( $is_privacy_notice ) {
+ $freedoms_class = '';
+ $privacy_class = ' nav-tab-active';
+ $freedoms_aria_current = '';
+ $privacy_aria_current = ' aria-current="page"';
+} else {
+ $freedoms_class = ' nav-tab-active';
+ $privacy_class = '';
+ $freedoms_aria_current = ' aria-current="page"';
+ $privacy_aria_current = '';
+}
+
+?>
+<div class="wrap about-wrap full-width-layout">
+
+<h1>
+ <?php
+ /* translators: %s: The current WordPress version number */
+ printf( __( 'Welcome to WordPress&nbsp;%s' ), $display_version );
+ ?>
+</h1>
+
+<p class="about-text">
+ <?php
+ printf(
+ /* translators: %s: The current WordPress version number */
+ __( 'Congratulations on updating to WordPress %s! This update makes it easier than ever to fix your site if something goes wrong.' ),
+ $display_version
+ );
+ ?>
+</p>
+
+<div class="wp-badge">
+ <?php
+ /* translators: %s: The current WordPress version number */
+ printf( __( 'Version %s' ), $display_version );
+ ?>
+</div>
+
+<nav class="nav-tab-wrapper wp-clearfix" aria-label="<?php esc_attr_e( 'Secondary menu' ); ?>">
+ <a href="about.php" class="nav-tab"><?php _e( 'What&#8217;s New' ); ?></a>
+ <a href="credits.php" class="nav-tab"><?php _e( 'Credits' ); ?></a>
+ <a href="freedoms.php" class="nav-tab<?php echo $freedoms_class; ?>"<?php echo $freedoms_aria_current; ?>><?php _e( 'Freedoms' ); ?></a>
+ <a href="freedoms.php?privacy-notice" class="nav-tab<?php echo $privacy_class; ?>"<?php echo $privacy_aria_current; ?>><?php _e( 'Privacy' ); ?></a>
+</nav>
+
+<?php if ( $is_privacy_notice ) : ?>
+
+<div class="about-wrap-content">
+ <p class="about-description"><?php _e( 'From time to time, your WordPress site may send data to WordPress.org &#8212; including, but not limited to &#8212; the version of WordPress you are using, and a list of installed plugins and themes.' ); ?></p>
+
+ <p>
+ <?php
+ /* translators: %s: https://wordpress.org/about/stats/ */
+ printf( __( 'This data is used to provide general enhancements to WordPress, which includes helping to protect your site by finding and automatically installing new updates. It is also used to calculate statistics, such as those shown on the <a href="%s">WordPress.org stats page</a>.' ), 'https://wordpress.org/about/stats/' );
+ ?>
+ </p>
+
+ <p>
+ <?php
+ /* translators: %s: https://wordpress.org/about/privacy/ */
+ printf( __( 'We take privacy and transparency very seriously. To learn more about what data we collect, and how we use it, please visit <a href="%s">WordPress.org/about/privacy</a>.' ), 'https://wordpress.org/about/privacy/' );
+ ?>
+ </p>
+</div>
+
+<?php else : ?>
+<div class="about-wrap-content">
+ <div class="feature-section has-1-columns">
+ <h2><?php _e( 'Freedoms' ); ?></h2>
+ <p class="about-description">
+ <?php
+ /* translators: %s: https://wordpress.org/about/license/ */
+ printf( __( 'WordPress is Free and open source software, built by a distributed community of mostly volunteer developers from around the world. WordPress comes with some awesome, worldview-changing rights courtesy of its <a href="%s">license</a>, the GPL.' ), 'https://wordpress.org/about/license/' );
+ ?>
+ </p>
+ </div>
+
+ <div class="feature-section has-4-columns is-fullwidth">
+ <div class="column">
+ <div class="freedoms-image"></div>
+ <h3><?php _e( 'The 1st Freedom' ); ?></h3>
+ <p><?php _e( 'To run the program for any purpose.' ); ?></p>
+ </div>
+ <div class="column">
+ <div class="freedoms-image"></div>
+ <h3><?php _e( 'The 2nd Freedom' ); ?></h3>
+ <p><?php _e( 'To study how the program works and change it to make it do what you wish.' ); ?></p>
+ </div>
+ <div class="column">
+ <div class="freedoms-image"></div>
+ <h3><?php _e( 'The 3rd Freedom' ); ?></h3>
+ <p><?php _e( 'To redistribute.' ); ?></p>
+ </div>
+ <div class="column">
+ <div class="freedoms-image"></div>
+ <h3><?php _e( 'The 4th Freedom' ); ?></h3>
+ <p><?php _e( 'To distribute copies of your modified versions to others.' ); ?></p>
+ </div>
+ </div>
+
+ <div class="feature-section has-1-columns">
+ <p>
+ <?php
+ /* translators: %s: https://wordpressfoundation.org/trademark-policy/ */
+ printf( __( 'WordPress grows when people like you tell their friends about it, and the thousands of businesses and services that are built on and around WordPress share that fact with their users. We&#8217;re flattered every time someone spreads the good word, just make sure to <a href="%s">check out our trademark guidelines</a> first.' ), 'https://wordpressfoundation.org/trademark-policy/' );
+ ?>
+ </p>
+
+ <p>
+ <?php
+ $plugins_url = current_user_can( 'activate_plugins' ) ? admin_url( 'plugins.php' ) : __( 'https://wordpress.org/plugins/' );
+ $themes_url = current_user_can( 'switch_themes' ) ? admin_url( 'themes.php' ) : __( 'https://wordpress.org/themes/' );
+ /* translators: %s: https://wordpress.org/about/license/ */
+ printf( __( 'Every plugin and theme in WordPress.org&#8217;s directory is 100%% GPL or a similarly free and compatible license, so you can feel safe finding <a href="%1$s">plugins</a> and <a href="%2$s">themes</a> there. If you get a plugin or theme from another source, make sure to <a href="%3$s">ask them if it&#8217;s GPL</a> first. If they don&#8217;t respect the WordPress license, we don&#8217;t recommend them.' ), $plugins_url, $themes_url, 'https://wordpress.org/about/license/' );
+ ?>
+ </p>
+
+ <p><?php _e( 'Don&#8217;t you wish all software came with these freedoms? So do we! For more information, check out the <a href="https://www.fsf.org/">Free Software Foundation</a>.' ); ?></p>
+ </div>
+</div>
+
+<?php endif; ?>
+</div>
+<?php include( ABSPATH . 'wp-admin/admin-footer.php' ); ?>
diff --git a/www/crm/wp-admin/images/align-center-2x.png b/www/crm/wp-admin/images/align-center-2x.png
new file mode 100644
index 00000000..0b627344
--- /dev/null
+++ b/www/crm/wp-admin/images/align-center-2x.png
Binary files differ
diff --git a/www/crm/wp-admin/images/align-center.png b/www/crm/wp-admin/images/align-center.png
new file mode 100644
index 00000000..e7bc8078
--- /dev/null
+++ b/www/crm/wp-admin/images/align-center.png
Binary files differ
diff --git a/www/crm/wp-admin/images/align-left-2x.png b/www/crm/wp-admin/images/align-left-2x.png
new file mode 100644
index 00000000..1b2d4283
--- /dev/null
+++ b/www/crm/wp-admin/images/align-left-2x.png
Binary files differ
diff --git a/www/crm/wp-admin/images/align-left.png b/www/crm/wp-admin/images/align-left.png
new file mode 100644
index 00000000..b438f7e0
--- /dev/null
+++ b/www/crm/wp-admin/images/align-left.png
Binary files differ
diff --git a/www/crm/wp-admin/images/align-none-2x.png b/www/crm/wp-admin/images/align-none-2x.png
new file mode 100644
index 00000000..a64a0bed
--- /dev/null
+++ b/www/crm/wp-admin/images/align-none-2x.png
Binary files differ
diff --git a/www/crm/wp-admin/images/align-none.png b/www/crm/wp-admin/images/align-none.png
new file mode 100644
index 00000000..b72df647
--- /dev/null
+++ b/www/crm/wp-admin/images/align-none.png
Binary files differ
diff --git a/www/crm/wp-admin/images/align-right-2x.png b/www/crm/wp-admin/images/align-right-2x.png
new file mode 100644
index 00000000..01315051
--- /dev/null
+++ b/www/crm/wp-admin/images/align-right-2x.png
Binary files differ
diff --git a/www/crm/wp-admin/images/align-right.png b/www/crm/wp-admin/images/align-right.png
new file mode 100644
index 00000000..86a1b2e8
--- /dev/null
+++ b/www/crm/wp-admin/images/align-right.png
Binary files differ
diff --git a/www/crm/wp-admin/images/arrows-2x.png b/www/crm/wp-admin/images/arrows-2x.png
new file mode 100644
index 00000000..0b0c53d1
--- /dev/null
+++ b/www/crm/wp-admin/images/arrows-2x.png
Binary files differ
diff --git a/www/crm/wp-admin/images/arrows.png b/www/crm/wp-admin/images/arrows.png
new file mode 100644
index 00000000..9e4a96cd
--- /dev/null
+++ b/www/crm/wp-admin/images/arrows.png
Binary files differ
diff --git a/www/crm/wp-admin/images/browser-rtl.png b/www/crm/wp-admin/images/browser-rtl.png
new file mode 100644
index 00000000..a4d36956
--- /dev/null
+++ b/www/crm/wp-admin/images/browser-rtl.png
Binary files differ
diff --git a/www/crm/wp-admin/images/browser.png b/www/crm/wp-admin/images/browser.png
new file mode 100644
index 00000000..83ead474
--- /dev/null
+++ b/www/crm/wp-admin/images/browser.png
Binary files differ
diff --git a/www/crm/wp-admin/images/bubble_bg-2x.gif b/www/crm/wp-admin/images/bubble_bg-2x.gif
new file mode 100644
index 00000000..21302a34
--- /dev/null
+++ b/www/crm/wp-admin/images/bubble_bg-2x.gif
Binary files differ
diff --git a/www/crm/wp-admin/images/bubble_bg.gif b/www/crm/wp-admin/images/bubble_bg.gif
new file mode 100644
index 00000000..f3bfdcdc
--- /dev/null
+++ b/www/crm/wp-admin/images/bubble_bg.gif
Binary files differ
diff --git a/www/crm/wp-admin/images/comment-grey-bubble-2x.png b/www/crm/wp-admin/images/comment-grey-bubble-2x.png
new file mode 100644
index 00000000..0eec4a6d
--- /dev/null
+++ b/www/crm/wp-admin/images/comment-grey-bubble-2x.png
Binary files differ
diff --git a/www/crm/wp-admin/images/comment-grey-bubble.png b/www/crm/wp-admin/images/comment-grey-bubble.png
new file mode 100644
index 00000000..558ee8f3
--- /dev/null
+++ b/www/crm/wp-admin/images/comment-grey-bubble.png
Binary files differ
diff --git a/www/crm/wp-admin/images/date-button-2x.gif b/www/crm/wp-admin/images/date-button-2x.gif
new file mode 100644
index 00000000..f658b515
--- /dev/null
+++ b/www/crm/wp-admin/images/date-button-2x.gif
Binary files differ
diff --git a/www/crm/wp-admin/images/date-button.gif b/www/crm/wp-admin/images/date-button.gif
new file mode 100644
index 00000000..50805447
--- /dev/null
+++ b/www/crm/wp-admin/images/date-button.gif
Binary files differ
diff --git a/www/crm/wp-admin/images/generic.png b/www/crm/wp-admin/images/generic.png
new file mode 100644
index 00000000..00575a07
--- /dev/null
+++ b/www/crm/wp-admin/images/generic.png
Binary files differ
diff --git a/www/crm/wp-admin/images/icons32-2x.png b/www/crm/wp-admin/images/icons32-2x.png
new file mode 100644
index 00000000..b86b7272
--- /dev/null
+++ b/www/crm/wp-admin/images/icons32-2x.png
Binary files differ
diff --git a/www/crm/wp-admin/images/icons32-vs-2x.png b/www/crm/wp-admin/images/icons32-vs-2x.png
new file mode 100644
index 00000000..54e2fb2f
--- /dev/null
+++ b/www/crm/wp-admin/images/icons32-vs-2x.png
Binary files differ
diff --git a/www/crm/wp-admin/images/icons32-vs.png b/www/crm/wp-admin/images/icons32-vs.png
new file mode 100644
index 00000000..e46d6beb
--- /dev/null
+++ b/www/crm/wp-admin/images/icons32-vs.png
Binary files differ
diff --git a/www/crm/wp-admin/images/icons32.png b/www/crm/wp-admin/images/icons32.png
new file mode 100644
index 00000000..e491b1a8
--- /dev/null
+++ b/www/crm/wp-admin/images/icons32.png
Binary files differ
diff --git a/www/crm/wp-admin/images/imgedit-icons-2x.png b/www/crm/wp-admin/images/imgedit-icons-2x.png
new file mode 100644
index 00000000..98dd4124
--- /dev/null
+++ b/www/crm/wp-admin/images/imgedit-icons-2x.png
Binary files differ
diff --git a/www/crm/wp-admin/images/imgedit-icons.png b/www/crm/wp-admin/images/imgedit-icons.png
new file mode 100644
index 00000000..0d544ee9
--- /dev/null
+++ b/www/crm/wp-admin/images/imgedit-icons.png
Binary files differ
diff --git a/www/crm/wp-admin/images/list-2x.png b/www/crm/wp-admin/images/list-2x.png
new file mode 100644
index 00000000..05c6eb37
--- /dev/null
+++ b/www/crm/wp-admin/images/list-2x.png
Binary files differ
diff --git a/www/crm/wp-admin/images/list.png b/www/crm/wp-admin/images/list.png
new file mode 100644
index 00000000..85d1295e
--- /dev/null
+++ b/www/crm/wp-admin/images/list.png
Binary files differ
diff --git a/www/crm/wp-admin/images/loading.gif b/www/crm/wp-admin/images/loading.gif
new file mode 100644
index 00000000..5df0defa
--- /dev/null
+++ b/www/crm/wp-admin/images/loading.gif
Binary files differ
diff --git a/www/crm/wp-admin/images/marker.png b/www/crm/wp-admin/images/marker.png
new file mode 100644
index 00000000..30313b87
--- /dev/null
+++ b/www/crm/wp-admin/images/marker.png
Binary files differ
diff --git a/www/crm/wp-admin/images/mask.png b/www/crm/wp-admin/images/mask.png
new file mode 100644
index 00000000..0fc9cbe6
--- /dev/null
+++ b/www/crm/wp-admin/images/mask.png
Binary files differ
diff --git a/www/crm/wp-admin/images/media-button-2x.png b/www/crm/wp-admin/images/media-button-2x.png
new file mode 100644
index 00000000..b8f8ed4d
--- /dev/null
+++ b/www/crm/wp-admin/images/media-button-2x.png
Binary files differ
diff --git a/www/crm/wp-admin/images/media-button-image.gif b/www/crm/wp-admin/images/media-button-image.gif
new file mode 100644
index 00000000..56a97473
--- /dev/null
+++ b/www/crm/wp-admin/images/media-button-image.gif
Binary files differ
diff --git a/www/crm/wp-admin/images/media-button-music.gif b/www/crm/wp-admin/images/media-button-music.gif
new file mode 100644
index 00000000..42e65b24
--- /dev/null
+++ b/www/crm/wp-admin/images/media-button-music.gif
Binary files differ
diff --git a/www/crm/wp-admin/images/media-button-other.gif b/www/crm/wp-admin/images/media-button-other.gif
new file mode 100644
index 00000000..c7544ec1
--- /dev/null
+++ b/www/crm/wp-admin/images/media-button-other.gif
Binary files differ
diff --git a/www/crm/wp-admin/images/media-button-video.gif b/www/crm/wp-admin/images/media-button-video.gif
new file mode 100644
index 00000000..405083b0
--- /dev/null
+++ b/www/crm/wp-admin/images/media-button-video.gif
Binary files differ
diff --git a/www/crm/wp-admin/images/media-button.png b/www/crm/wp-admin/images/media-button.png
new file mode 100644
index 00000000..752ee452
--- /dev/null
+++ b/www/crm/wp-admin/images/media-button.png
Binary files differ
diff --git a/www/crm/wp-admin/images/menu-2x.png b/www/crm/wp-admin/images/menu-2x.png
new file mode 100644
index 00000000..7131763a
--- /dev/null
+++ b/www/crm/wp-admin/images/menu-2x.png
Binary files differ
diff --git a/www/crm/wp-admin/images/menu-vs-2x.png b/www/crm/wp-admin/images/menu-vs-2x.png
new file mode 100644
index 00000000..99b38236
--- /dev/null
+++ b/www/crm/wp-admin/images/menu-vs-2x.png
Binary files differ
diff --git a/www/crm/wp-admin/images/menu-vs.png b/www/crm/wp-admin/images/menu-vs.png
new file mode 100644
index 00000000..fe281087
--- /dev/null
+++ b/www/crm/wp-admin/images/menu-vs.png
Binary files differ
diff --git a/www/crm/wp-admin/images/menu.png b/www/crm/wp-admin/images/menu.png
new file mode 100644
index 00000000..c1d15af8
--- /dev/null
+++ b/www/crm/wp-admin/images/menu.png
Binary files differ
diff --git a/www/crm/wp-admin/images/no.png b/www/crm/wp-admin/images/no.png
new file mode 100644
index 00000000..59c35bdc
--- /dev/null
+++ b/www/crm/wp-admin/images/no.png
Binary files differ
diff --git a/www/crm/wp-admin/images/post-formats-vs.png b/www/crm/wp-admin/images/post-formats-vs.png
new file mode 100644
index 00000000..d77f91c0
--- /dev/null
+++ b/www/crm/wp-admin/images/post-formats-vs.png
Binary files differ
diff --git a/www/crm/wp-admin/images/post-formats.png b/www/crm/wp-admin/images/post-formats.png
new file mode 100644
index 00000000..cae309e5
--- /dev/null
+++ b/www/crm/wp-admin/images/post-formats.png
Binary files differ
diff --git a/www/crm/wp-admin/images/post-formats32-vs.png b/www/crm/wp-admin/images/post-formats32-vs.png
new file mode 100644
index 00000000..f5653407
--- /dev/null
+++ b/www/crm/wp-admin/images/post-formats32-vs.png
Binary files differ
diff --git a/www/crm/wp-admin/images/post-formats32.png b/www/crm/wp-admin/images/post-formats32.png
new file mode 100644
index 00000000..69ec095e
--- /dev/null
+++ b/www/crm/wp-admin/images/post-formats32.png
Binary files differ
diff --git a/www/crm/wp-admin/images/resize-2x.gif b/www/crm/wp-admin/images/resize-2x.gif
new file mode 100644
index 00000000..e57f9bcd
--- /dev/null
+++ b/www/crm/wp-admin/images/resize-2x.gif
Binary files differ
diff --git a/www/crm/wp-admin/images/resize-rtl-2x.gif b/www/crm/wp-admin/images/resize-rtl-2x.gif
new file mode 100644
index 00000000..483c23dc
--- /dev/null
+++ b/www/crm/wp-admin/images/resize-rtl-2x.gif
Binary files differ
diff --git a/www/crm/wp-admin/images/resize-rtl.gif b/www/crm/wp-admin/images/resize-rtl.gif
new file mode 100644
index 00000000..82502954
--- /dev/null
+++ b/www/crm/wp-admin/images/resize-rtl.gif
Binary files differ
diff --git a/www/crm/wp-admin/images/resize.gif b/www/crm/wp-admin/images/resize.gif
new file mode 100644
index 00000000..5cb0939a
--- /dev/null
+++ b/www/crm/wp-admin/images/resize.gif
Binary files differ
diff --git a/www/crm/wp-admin/images/se.png b/www/crm/wp-admin/images/se.png
new file mode 100644
index 00000000..eb487b46
--- /dev/null
+++ b/www/crm/wp-admin/images/se.png
Binary files differ
diff --git a/www/crm/wp-admin/images/sort-2x.gif b/www/crm/wp-admin/images/sort-2x.gif
new file mode 100644
index 00000000..60b6084b
--- /dev/null
+++ b/www/crm/wp-admin/images/sort-2x.gif
Binary files differ
diff --git a/www/crm/wp-admin/images/sort.gif b/www/crm/wp-admin/images/sort.gif
new file mode 100644
index 00000000..aa65db11
--- /dev/null
+++ b/www/crm/wp-admin/images/sort.gif
Binary files differ
diff --git a/www/crm/wp-admin/images/spinner-2x.gif b/www/crm/wp-admin/images/spinner-2x.gif
new file mode 100644
index 00000000..26e28e17
--- /dev/null
+++ b/www/crm/wp-admin/images/spinner-2x.gif
Binary files differ
diff --git a/www/crm/wp-admin/images/spinner.gif b/www/crm/wp-admin/images/spinner.gif
new file mode 100644
index 00000000..88e8a939
--- /dev/null
+++ b/www/crm/wp-admin/images/spinner.gif
Binary files differ
diff --git a/www/crm/wp-admin/images/stars-2x.png b/www/crm/wp-admin/images/stars-2x.png
new file mode 100644
index 00000000..15aa9deb
--- /dev/null
+++ b/www/crm/wp-admin/images/stars-2x.png
Binary files differ
diff --git a/www/crm/wp-admin/images/stars.png b/www/crm/wp-admin/images/stars.png
new file mode 100644
index 00000000..c01ada13
--- /dev/null
+++ b/www/crm/wp-admin/images/stars.png
Binary files differ
diff --git a/www/crm/wp-admin/images/w-logo-blue.png b/www/crm/wp-admin/images/w-logo-blue.png
new file mode 100644
index 00000000..11e550c7
--- /dev/null
+++ b/www/crm/wp-admin/images/w-logo-blue.png
Binary files differ
diff --git a/www/crm/wp-admin/images/w-logo-white.png b/www/crm/wp-admin/images/w-logo-white.png
new file mode 100644
index 00000000..ed5efcdc
--- /dev/null
+++ b/www/crm/wp-admin/images/w-logo-white.png
Binary files differ
diff --git a/www/crm/wp-admin/images/wheel.png b/www/crm/wp-admin/images/wheel.png
new file mode 100644
index 00000000..9b9fdf4a
--- /dev/null
+++ b/www/crm/wp-admin/images/wheel.png
Binary files differ
diff --git a/www/crm/wp-admin/images/wordpress-logo-white.svg b/www/crm/wp-admin/images/wordpress-logo-white.svg
new file mode 100644
index 00000000..682e80b8
--- /dev/null
+++ b/www/crm/wp-admin/images/wordpress-logo-white.svg
@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" width="80" height="80"><g fill="none"><g fill="#fff"><g><path d="M40 2.48c5.07 0 9.98 1 14.6 2.94 2.23.94 4.37 2.1 6.38 3.46 2 1.35 3.86 2.9 5.55 4.6 1.7 1.68 3.24 3.55 4.6 5.54 1.34 2 2.5 4.15 3.45 6.37 1.95 4.62 2.94 9.53 2.94 14.6s-1 9.98-2.94 14.6c-.94 2.23-2.1 4.37-3.46 6.38-1.35 2-2.9 3.86-4.6 5.55-1.68 1.7-3.55 3.24-5.54 4.6-2 1.34-4.15 2.5-6.37 3.45-4.62 1.95-9.53 2.94-14.6 2.94s-9.98-1-14.6-2.94c-2.23-.94-4.37-2.1-6.38-3.46-2-1.35-3.86-2.9-5.55-4.6-1.7-1.68-3.24-3.55-4.6-5.54-1.34-2-2.5-4.15-3.45-6.37C3.47 50 2.48 45.08 2.48 40s1-9.98 2.94-14.6c.94-2.23 2.1-4.37 3.46-6.38 1.35-2 2.9-3.86 4.6-5.55 1.68-1.7 3.55-3.24 5.54-4.6 2-1.34 4.15-2.5 6.37-3.45C30 3.47 34.92 2.48 40 2.48m0-2.4C17.95.08.08 17.95.08 40S17.95 79.92 40 79.92 79.92 62.05 79.92 40 62.05.08 40 .08"/><path d="M6.73 40c0 13.17 7.65 24.55 18.75 29.94L9.6 26.46C7.78 30.6 6.74 35.18 6.74 40zm55.73-1.68c0-4.1-1.48-6.96-2.74-9.17-1.7-2.74-3.27-5.06-3.27-7.8 0-3.06 2.32-5.9 5.58-5.9.15 0 .3 0 .43.02-5.9-5.43-13.8-8.74-22.46-8.74-11.62 0-21.85 5.97-27.8 15 .8.02 1.52.04 2.15.04 3.47 0 8.86-.43 8.86-.43 1.8-.1 2.02 2.53.22 2.75 0 0-1.8.2-3.8.3l12.1 36.04 7.3-21.84-5.2-14.2c-1.78-.1-3.48-.3-3.48-.3-1.8-.12-1.58-2.86.2-2.76 0 0 5.5.43 8.77.43 3.5 0 8.88-.43 8.88-.43 1.8-.1 2 2.53.2 2.75 0 0-1.8.2-3.8.3l12.03 35.76 3.44-10.87c1.52-4.77 2.42-8.13 2.42-10.98zm-21.88 4.6l-9.98 29c2.98.87 6.13 1.35 9.4 1.35 3.87 0 7.6-.67 11.05-1.9-.1-.13-.17-.28-.24-.45l-10.22-28zm28.6-18.88c.16 1.06.24 2.2.24 3.42 0 3.37-.64 7.17-2.53 11.92L56.72 68.75C66.63 63 73.27 52.27 73.27 40c0-5.8-1.48-11.22-4.08-15.96z"/></g></g></g></svg> \ No newline at end of file
diff --git a/www/crm/wp-admin/images/wordpress-logo.png b/www/crm/wp-admin/images/wordpress-logo.png
new file mode 100644
index 00000000..63b03796
--- /dev/null
+++ b/www/crm/wp-admin/images/wordpress-logo.png
Binary files differ
diff --git a/www/crm/wp-admin/images/wordpress-logo.svg b/www/crm/wp-admin/images/wordpress-logo.svg
new file mode 100644
index 00000000..ba26fef0
--- /dev/null
+++ b/www/crm/wp-admin/images/wordpress-logo.svg
@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" id="Layer_1" x="0px" y="0px" width="64px" height="64px" viewBox="0 0 64 64" enable-background="new 0 0 64 64" xml:space="preserve"><style>.style0{fill: #0073aa;}</style><g><g><path d="M4.548 31.999c0 10.9 6.3 20.3 15.5 24.706L6.925 20.827C5.402 24.2 4.5 28 4.5 31.999z M50.531 30.614c0-3.394-1.219-5.742-2.264-7.57c-1.391-2.263-2.695-4.177-2.695-6.439c0-2.523 1.912-4.872 4.609-4.872 c0.121 0 0.2 0 0.4 0.022C45.653 7.3 39.1 4.5 32 4.548c-9.591 0-18.027 4.921-22.936 12.4 c0.645 0 1.3 0 1.8 0.033c2.871 0 7.316-0.349 7.316-0.349c1.479-0.086 1.7 2.1 0.2 2.3 c0 0-1.487 0.174-3.142 0.261l9.997 29.735l6.008-18.017l-4.276-11.718c-1.479-0.087-2.879-0.261-2.879-0.261 c-1.48-0.087-1.306-2.349 0.174-2.262c0 0 4.5 0.3 7.2 0.349c2.87 0 7.317-0.349 7.317-0.349 c1.479-0.086 1.7 2.1 0.2 2.262c0 0-1.489 0.174-3.142 0.261l9.92 29.508l2.739-9.148 C49.628 35.7 50.5 33 50.5 30.614z M32.481 34.4l-8.237 23.934c2.46 0.7 5.1 1.1 7.8 1.1 c3.197 0 6.262-0.552 9.116-1.556c-0.072-0.118-0.141-0.243-0.196-0.379L32.481 34.4z M56.088 18.8 c0.119 0.9 0.2 1.8 0.2 2.823c0 2.785-0.521 5.916-2.088 9.832l-8.385 24.242c8.161-4.758 13.65-13.6 13.65-23.728 C59.451 27.2 58.2 22.7 56.1 18.83z M32 0c-17.645 0-32 14.355-32 32C0 49.6 14.4 64 32 64s32-14.355 32-32.001 C64 14.4 49.6 0 32 0z M32 62.533c-16.835 0-30.533-13.698-30.533-30.534C1.467 15.2 15.2 1.5 32 1.5 s30.534 13.7 30.5 30.532C62.533 48.8 48.8 62.5 32 62.533z" class="style0"/></g></g></svg> \ No newline at end of file
diff --git a/www/crm/wp-admin/images/wpspin_light-2x.gif b/www/crm/wp-admin/images/wpspin_light-2x.gif
new file mode 100644
index 00000000..261c819d
--- /dev/null
+++ b/www/crm/wp-admin/images/wpspin_light-2x.gif
Binary files differ
diff --git a/www/crm/wp-admin/images/wpspin_light.gif b/www/crm/wp-admin/images/wpspin_light.gif
new file mode 100644
index 00000000..ea9fb0db
--- /dev/null
+++ b/www/crm/wp-admin/images/wpspin_light.gif
Binary files differ
diff --git a/www/crm/wp-admin/images/xit-2x.gif b/www/crm/wp-admin/images/xit-2x.gif
new file mode 100644
index 00000000..3a72ee1a
--- /dev/null
+++ b/www/crm/wp-admin/images/xit-2x.gif
Binary files differ
diff --git a/www/crm/wp-admin/images/xit.gif b/www/crm/wp-admin/images/xit.gif
new file mode 100644
index 00000000..d288954d
--- /dev/null
+++ b/www/crm/wp-admin/images/xit.gif
Binary files differ
diff --git a/www/crm/wp-admin/images/yes.png b/www/crm/wp-admin/images/yes.png
new file mode 100644
index 00000000..fbb39836
--- /dev/null
+++ b/www/crm/wp-admin/images/yes.png
Binary files differ
diff --git a/www/crm/wp-admin/import.php b/www/crm/wp-admin/import.php
new file mode 100644
index 00000000..14555ec5
--- /dev/null
+++ b/www/crm/wp-admin/import.php
@@ -0,0 +1,235 @@
+<?php
+/**
+ * Import WordPress Administration Screen
+ *
+ * @package WordPress
+ * @subpackage Administration
+ */
+
+define( 'WP_LOAD_IMPORTERS', true );
+
+/** Load WordPress Bootstrap */
+require_once( dirname( __FILE__ ) . '/admin.php' );
+
+if ( ! current_user_can( 'import' ) ) {
+ wp_die( __( 'Sorry, you are not allowed to import content.' ) );
+}
+
+$title = __( 'Import' );
+
+get_current_screen()->add_help_tab(
+ array(
+ 'id' => 'overview',
+ 'title' => __( 'Overview' ),
+ 'content' => '<p>' . __( 'This screen lists links to plugins to import data from blogging/content management platforms. Choose the platform you want to import from, and click Install Now when you are prompted in the popup window. If your platform is not listed, click the link to search the plugin directory for other importer plugins to see if there is one for your platform.' ) . '</p>' .
+ '<p>' . __( 'In previous versions of WordPress, all importers were built-in. They have been turned into plugins since most people only use them once or infrequently.' ) . '</p>',
+ )
+);
+
+get_current_screen()->set_help_sidebar(
+ '<p><strong>' . __( 'For more information:' ) . '</strong></p>' .
+ '<p>' . __( '<a href="https://codex.wordpress.org/Tools_Import_Screen">Documentation on Import</a>' ) . '</p>' .
+ '<p>' . __( '<a href="https://wordpress.org/support/">Support</a>' ) . '</p>'
+);
+
+if ( current_user_can( 'install_plugins' ) ) {
+ // List of popular importer plugins from the WordPress.org API.
+ $popular_importers = wp_get_popular_importers();
+} else {
+ $popular_importers = array();
+}
+
+// Detect and redirect invalid importers like 'movabletype', which is registered as 'mt'
+if ( ! empty( $_GET['invalid'] ) && isset( $popular_importers[ $_GET['invalid'] ] ) ) {
+ $importer_id = $popular_importers[ $_GET['invalid'] ]['importer-id'];
+ if ( $importer_id != $_GET['invalid'] ) { // Prevent redirect loops.
+ wp_redirect( admin_url( 'admin.php?import=' . $importer_id ) );
+ exit;
+ }
+ unset( $importer_id );
+}
+
+add_thickbox();
+wp_enqueue_script( 'plugin-install' );
+wp_enqueue_script( 'updates' );
+
+require_once( ABSPATH . 'wp-admin/admin-header.php' );
+$parent_file = 'tools.php';
+?>
+
+<div class="wrap">
+<h1><?php echo esc_html( $title ); ?></h1>
+<?php if ( ! empty( $_GET['invalid'] ) ) : ?>
+ <div class="error">
+ <p><strong><?php _e( 'ERROR:' ); ?></strong>
+ <?php
+ /* translators: %s: importer slug */
+ printf( __( 'The %s importer is invalid or is not installed.' ), '<strong>' . esc_html( $_GET['invalid'] ) . '</strong>' );
+ ?>
+ </p>
+ </div>
+<?php endif; ?>
+<p><?php _e( 'If you have posts or comments in another system, WordPress can import those into this site. To get started, choose a system to import from below:' ); ?></p>
+
+<?php
+// Registered (already installed) importers. They're stored in the global $wp_importers.
+$importers = get_importers();
+
+// If a popular importer is not registered, create a dummy registration that links to the plugin installer.
+foreach ( $popular_importers as $pop_importer => $pop_data ) {
+ if ( isset( $importers[ $pop_importer ] ) ) {
+ continue;
+ }
+ if ( isset( $importers[ $pop_data['importer-id'] ] ) ) {
+ continue;
+ }
+
+ // Fill the array of registered (already installed) importers with data of the popular importers from the WordPress.org API.
+ $importers[ $pop_data['importer-id'] ] = array(
+ $pop_data['name'],
+ $pop_data['description'],
+ 'install' => $pop_data['plugin-slug'],
+ );
+}
+
+if ( empty( $importers ) ) {
+ echo '<p>' . __( 'No importers are available.' ) . '</p>'; // TODO: make more helpful
+} else {
+ uasort( $importers, '_usort_by_first_member' );
+ ?>
+<table class="widefat importers striped">
+
+ <?php
+ foreach ( $importers as $importer_id => $data ) {
+ $plugin_slug = $action = '';
+ $is_plugin_installed = false;
+
+ if ( isset( $data['install'] ) ) {
+ $plugin_slug = $data['install'];
+
+ if ( file_exists( WP_PLUGIN_DIR . '/' . $plugin_slug ) ) {
+ // Looks like an importer is installed, but not active.
+ $plugins = get_plugins( '/' . $plugin_slug );
+ if ( ! empty( $plugins ) ) {
+ $keys = array_keys( $plugins );
+ $plugin_file = $plugin_slug . '/' . $keys[0];
+ $url = wp_nonce_url(
+ add_query_arg(
+ array(
+ 'action' => 'activate',
+ 'plugin' => $plugin_file,
+ 'from' => 'import',
+ ),
+ admin_url( 'plugins.php' )
+ ),
+ 'activate-plugin_' . $plugin_file
+ );
+ $action = sprintf(
+ '<a href="%s" aria-label="%s">%s</a>',
+ esc_url( $url ),
+ /* translators: %s: Importer name */
+ esc_attr( sprintf( __( 'Run %s' ), $data[0] ) ),
+ __( 'Run Importer' )
+ );
+
+ $is_plugin_installed = true;
+ }
+ }
+
+ if ( empty( $action ) ) {
+ if ( is_main_site() ) {
+ $url = wp_nonce_url(
+ add_query_arg(
+ array(
+ 'action' => 'install-plugin',
+ 'plugin' => $plugin_slug,
+ 'from' => 'import',
+ ),
+ self_admin_url( 'update.php' )
+ ),
+ 'install-plugin_' . $plugin_slug
+ );
+ $action = sprintf(
+ '<a href="%1$s" class="install-now" data-slug="%2$s" data-name="%3$s" aria-label="%4$s">%5$s</a>',
+ esc_url( $url ),
+ esc_attr( $plugin_slug ),
+ esc_attr( $data[0] ),
+ /* translators: %s: Importer name */
+ esc_attr( sprintf( __( 'Install %s now' ), $data[0] ) ),
+ __( 'Install Now' )
+ );
+ } else {
+ $action = sprintf(
+ /* translators: URL to wp-admin/import.php */
+ __( 'This importer is not installed. Please install importers from <a href="%s">the main site</a>.' ),
+ get_admin_url( get_current_network_id(), 'import.php' )
+ );
+ }
+ }
+ } else {
+ $url = add_query_arg(
+ array(
+ 'import' => $importer_id,
+ ),
+ self_admin_url( 'admin.php' )
+ );
+ $action = sprintf(
+ '<a href="%1$s" aria-label="%2$s">%3$s</a>',
+ esc_url( $url ),
+ /* translators: %s: Importer name */
+ esc_attr( sprintf( __( 'Run %s' ), $data[0] ) ),
+ __( 'Run Importer' )
+ );
+
+ $is_plugin_installed = true;
+ }
+
+ if ( ! $is_plugin_installed && is_main_site() ) {
+ $url = add_query_arg(
+ array(
+ 'tab' => 'plugin-information',
+ 'plugin' => $plugin_slug,
+ 'from' => 'import',
+ 'TB_iframe' => 'true',
+ 'width' => 600,
+ 'height' => 550,
+ ),
+ network_admin_url( 'plugin-install.php' )
+ );
+ $action .= sprintf(
+ ' | <a href="%1$s" class="thickbox open-plugin-details-modal" aria-label="%2$s">%3$s</a>',
+ esc_url( $url ),
+ /* translators: %s: Importer name */
+ esc_attr( sprintf( __( 'More information about %s' ), $data[0] ) ),
+ __( 'Details' )
+ );
+ }
+
+ echo "
+ <tr class='importer-item'>
+ <td class='import-system'>
+ <span class='importer-title'>{$data[0]}</span>
+ <span class='importer-action'>{$action}</span>
+ </td>
+ <td class='desc'>
+ <span class='importer-desc'>{$data[1]}</span>
+ </td>
+ </tr>";
+ }
+ ?>
+</table>
+ <?php
+}
+
+if ( current_user_can( 'install_plugins' ) ) {
+ echo '<p>' . sprintf( __( 'If the importer you need is not listed, <a href="%s">search the plugin directory</a> to see if an importer is available.' ), esc_url( network_admin_url( 'plugin-install.php?tab=search&type=tag&s=importer' ) ) ) . '</p>';
+}
+?>
+
+</div>
+
+<?php
+wp_print_request_filesystem_credentials_modal();
+wp_print_admin_notice_templates();
+
+include( ABSPATH . 'wp-admin/admin-footer.php' );
diff --git a/www/crm/wp-admin/includes/admin-filters.php b/www/crm/wp-admin/includes/admin-filters.php
new file mode 100644
index 00000000..06bb612d
--- /dev/null
+++ b/www/crm/wp-admin/includes/admin-filters.php
@@ -0,0 +1,155 @@
+<?php
+/**
+ * Administration API: Default admin hooks
+ *
+ * @package WordPress
+ * @subpackage Administration
+ * @since 4.3.0
+ */
+
+// Bookmark hooks.
+add_action( 'admin_page_access_denied', 'wp_link_manager_disabled_message' );
+
+// Dashboard hooks.
+add_action( 'activity_box_end', 'wp_dashboard_quota' );
+
+// Media hooks.
+add_action( 'attachment_submitbox_misc_actions', 'attachment_submitbox_metadata' );
+
+add_action( 'media_upload_image', 'wp_media_upload_handler' );
+add_action( 'media_upload_audio', 'wp_media_upload_handler' );
+add_action( 'media_upload_video', 'wp_media_upload_handler' );
+add_action( 'media_upload_file', 'wp_media_upload_handler' );
+
+add_action( 'post-plupload-upload-ui', 'media_upload_flash_bypass' );
+
+add_action( 'post-html-upload-ui', 'media_upload_html_bypass' );
+
+add_filter( 'async_upload_image', 'get_media_item', 10, 2 );
+add_filter( 'async_upload_audio', 'get_media_item', 10, 2 );
+add_filter( 'async_upload_video', 'get_media_item', 10, 2 );
+add_filter( 'async_upload_file', 'get_media_item', 10, 2 );
+
+add_filter( 'attachment_fields_to_save', 'image_attachment_fields_to_save', 10, 2 );
+
+add_filter( 'media_upload_gallery', 'media_upload_gallery' );
+add_filter( 'media_upload_library', 'media_upload_library' );
+
+add_filter( 'media_upload_tabs', 'update_gallery_tab' );
+
+// Misc hooks.
+add_action( 'admin_init', 'wp_admin_headers' );
+add_action( 'login_init', 'wp_admin_headers' );
+add_action( 'admin_head', 'wp_admin_canonical_url' );
+add_action( 'admin_head', 'wp_color_scheme_settings' );
+add_action( 'admin_head', 'wp_site_icon' );
+add_action( 'admin_head', '_ipad_meta' );
+
+// Privacy tools
+add_action( 'admin_menu', '_wp_privacy_hook_requests_page' );
+add_action( 'load-tools_page_export_personal_data', '_wp_privacy_requests_screen_options' );
+add_action( 'load-tools_page_remove_personal_data', '_wp_privacy_requests_screen_options' );
+
+// Prerendering.
+if ( ! is_customize_preview() ) {
+ add_filter( 'admin_print_styles', 'wp_resource_hints', 1 );
+}
+
+add_action( 'admin_print_scripts-post.php', 'wp_page_reload_on_back_button_js' );
+add_action( 'admin_print_scripts-post-new.php', 'wp_page_reload_on_back_button_js' );
+
+add_action( 'update_option_home', 'update_home_siteurl', 10, 2 );
+add_action( 'update_option_siteurl', 'update_home_siteurl', 10, 2 );
+add_action( 'update_option_page_on_front', 'update_home_siteurl', 10, 2 );
+add_action( 'update_option_admin_email', 'wp_site_admin_email_change_notification', 10, 3 );
+
+add_action( 'add_option_new_admin_email', 'update_option_new_admin_email', 10, 2 );
+add_action( 'update_option_new_admin_email', 'update_option_new_admin_email', 10, 2 );
+
+add_filter( 'heartbeat_received', 'wp_check_locked_posts', 10, 3 );
+add_filter( 'heartbeat_received', 'wp_refresh_post_lock', 10, 3 );
+add_filter( 'heartbeat_received', 'heartbeat_autosave', 500, 2 );
+
+add_filter( 'wp_refresh_nonces', 'wp_refresh_post_nonces', 10, 3 );
+add_filter( 'wp_refresh_nonces', 'wp_refresh_heartbeat_nonces' );
+
+add_filter( 'heartbeat_settings', 'wp_heartbeat_set_suspension' );
+
+// Nav Menu hooks.
+add_action( 'admin_head-nav-menus.php', '_wp_delete_orphaned_draft_menu_items' );
+
+// Plugin hooks.
+add_filter( 'whitelist_options', 'option_update_filter' );
+
+// Plugin Install hooks.
+add_action( 'install_plugins_featured', 'install_dashboard' );
+add_action( 'install_plugins_upload', 'install_plugins_upload' );
+add_action( 'install_plugins_search', 'display_plugins_table' );
+add_action( 'install_plugins_popular', 'display_plugins_table' );
+add_action( 'install_plugins_recommended', 'display_plugins_table' );
+add_action( 'install_plugins_new', 'display_plugins_table' );
+add_action( 'install_plugins_beta', 'display_plugins_table' );
+add_action( 'install_plugins_favorites', 'display_plugins_table' );
+add_action( 'install_plugins_pre_plugin-information', 'install_plugin_information' );
+
+// Template hooks.
+add_action( 'admin_enqueue_scripts', array( 'WP_Internal_Pointers', 'enqueue_scripts' ) );
+add_action( 'user_register', array( 'WP_Internal_Pointers', 'dismiss_pointers_for_new_users' ) );
+
+// Theme hooks.
+add_action( 'customize_controls_print_footer_scripts', 'customize_themes_print_templates' );
+
+// Theme Install hooks.
+add_action( 'install_themes_pre_theme-information', 'install_theme_information' );
+
+// User hooks.
+add_action( 'admin_init', 'default_password_nag_handler' );
+
+add_action( 'admin_notices', 'default_password_nag' );
+add_action( 'admin_notices', 'new_user_email_admin_notice' );
+
+add_action( 'profile_update', 'default_password_nag_edit_user', 10, 2 );
+
+add_action( 'personal_options_update', 'send_confirmation_on_profile_email' );
+
+// Update hooks.
+add_action( 'load-plugins.php', 'wp_plugin_update_rows', 20 ); // After wp_update_plugins() is called.
+add_action( 'load-themes.php', 'wp_theme_update_rows', 20 ); // After wp_update_themes() is called.
+
+add_action( 'admin_notices', 'update_nag', 3 );
+add_action( 'admin_notices', 'paused_plugins_notice', 5 );
+add_action( 'admin_notices', 'paused_themes_notice', 5 );
+add_action( 'admin_notices', 'maintenance_nag', 10 );
+add_action( 'admin_notices', 'wp_recovery_mode_nag', 1 );
+
+add_filter( 'update_footer', 'core_update_footer' );
+
+// Update Core hooks.
+add_action( '_core_updated_successfully', '_redirect_to_about_wordpress' );
+
+// Upgrade hooks.
+add_action( 'upgrader_process_complete', array( 'Language_Pack_Upgrader', 'async_upgrade' ), 20 );
+add_action( 'upgrader_process_complete', 'wp_version_check', 10, 0 );
+add_action( 'upgrader_process_complete', 'wp_update_plugins', 10, 0 );
+add_action( 'upgrader_process_complete', 'wp_update_themes', 10, 0 );
+
+// Privacy hooks
+add_filter( 'wp_privacy_personal_data_erasure_page', 'wp_privacy_process_personal_data_erasure_page', 10, 5 );
+add_filter( 'wp_privacy_personal_data_export_page', 'wp_privacy_process_personal_data_export_page', 10, 7 );
+add_action( 'wp_privacy_personal_data_export_file', 'wp_privacy_generate_personal_data_export_file', 10 );
+add_action( 'wp_privacy_personal_data_erased', '_wp_privacy_send_erasure_fulfillment_notification', 10 );
+
+// Privacy policy text changes check.
+add_action( 'admin_init', array( 'WP_Privacy_Policy_Content', 'text_change_check' ), 100 );
+
+// Show a "postbox" with the text suggestions for a privacy policy.
+add_action( 'admin_notices', array( 'WP_Privacy_Policy_Content', 'notice' ) );
+
+// Add the suggested policy text from WordPress.
+add_action( 'admin_init', array( 'WP_Privacy_Policy_Content', 'add_suggested_content' ), 1 );
+
+// Update the cached policy info when the policy page is updated.
+add_action( 'post_updated', array( 'WP_Privacy_Policy_Content', '_policy_page_updated' ) );
+
+// Append '(Draft)' to draft page titles in the privacy page dropdown.
+add_filter( 'list_pages', '_wp_privacy_settings_filter_draft_page_titles', 10, 2 );
diff --git a/www/crm/wp-admin/includes/admin.php b/www/crm/wp-admin/includes/admin.php
new file mode 100644
index 00000000..af4f7cc0
--- /dev/null
+++ b/www/crm/wp-admin/includes/admin.php
@@ -0,0 +1,87 @@
+<?php
+/**
+ * Core Administration API
+ *
+ * @package WordPress
+ * @subpackage Administration
+ * @since 2.3.0
+ */
+
+if ( ! defined( 'WP_ADMIN' ) ) {
+ /*
+ * This file is being included from a file other than wp-admin/admin.php, so
+ * some setup was skipped. Make sure the admin message catalog is loaded since
+ * load_default_textdomain() will not have done so in this context.
+ */
+ load_textdomain( 'default', WP_LANG_DIR . '/admin-' . get_locale() . '.mo' );
+}
+
+/** WordPress Administration Hooks */
+require_once( ABSPATH . 'wp-admin/includes/admin-filters.php' );
+
+/** WordPress Bookmark Administration API */
+require_once( ABSPATH . 'wp-admin/includes/bookmark.php' );
+
+/** WordPress Comment Administration API */
+require_once( ABSPATH . 'wp-admin/includes/comment.php' );
+
+/** WordPress Administration File API */
+require_once( ABSPATH . 'wp-admin/includes/file.php' );
+
+/** WordPress Image Administration API */
+require_once( ABSPATH . 'wp-admin/includes/image.php' );
+
+/** WordPress Media Administration API */
+require_once( ABSPATH . 'wp-admin/includes/media.php' );
+
+/** WordPress Import Administration API */
+require_once( ABSPATH . 'wp-admin/includes/import.php' );
+
+/** WordPress Misc Administration API */
+require_once( ABSPATH . 'wp-admin/includes/misc.php' );
+
+/** WordPress Options Administration API */
+require_once( ABSPATH . 'wp-admin/includes/options.php' );
+
+/** WordPress Plugin Administration API */
+require_once( ABSPATH . 'wp-admin/includes/plugin.php' );
+
+/** WordPress Post Administration API */
+require_once( ABSPATH . 'wp-admin/includes/post.php' );
+
+/** WordPress Administration Screen API */
+require_once( ABSPATH . 'wp-admin/includes/class-wp-screen.php' );
+require_once( ABSPATH . 'wp-admin/includes/screen.php' );
+
+/** WordPress Taxonomy Administration API */
+require_once( ABSPATH . 'wp-admin/includes/taxonomy.php' );
+
+/** WordPress Template Administration API */
+require_once( ABSPATH . 'wp-admin/includes/template.php' );
+
+/** WordPress List Table Administration API and base class */
+require_once( ABSPATH . 'wp-admin/includes/class-wp-list-table.php' );
+require_once( ABSPATH . 'wp-admin/includes/class-wp-list-table-compat.php' );
+require_once( ABSPATH . 'wp-admin/includes/list-table.php' );
+
+/** WordPress Theme Administration API */
+require_once( ABSPATH . 'wp-admin/includes/theme.php' );
+
+/** WordPress User Administration API */
+require_once( ABSPATH . 'wp-admin/includes/user.php' );
+
+/** WordPress Site Icon API */
+require_once( ABSPATH . 'wp-admin/includes/class-wp-site-icon.php' );
+
+/** WordPress Update Administration API */
+require_once( ABSPATH . 'wp-admin/includes/update.php' );
+
+/** WordPress Deprecated Administration API */
+require_once( ABSPATH . 'wp-admin/includes/deprecated.php' );
+
+/** WordPress Multisite support API */
+if ( is_multisite() ) {
+ require_once( ABSPATH . 'wp-admin/includes/ms-admin-filters.php' );
+ require_once( ABSPATH . 'wp-admin/includes/ms.php' );
+ require_once( ABSPATH . 'wp-admin/includes/ms-deprecated.php' );
+}
diff --git a/www/crm/wp-admin/includes/ajax-actions.php b/www/crm/wp-admin/includes/ajax-actions.php
new file mode 100644
index 00000000..347afd7b
--- /dev/null
+++ b/www/crm/wp-admin/includes/ajax-actions.php
@@ -0,0 +1,5014 @@
+<?php
+/**
+ * Administration API: Core Ajax handlers
+ *
+ * @package WordPress
+ * @subpackage Administration
+ * @since 2.1.0
+ */
+
+//
+// No-privilege Ajax handlers.
+//
+
+/**
+ * Ajax handler for the Heartbeat API in
+ * the no-privilege context.
+ *
+ * Runs when the user is not logged in.
+ *
+ * @since 3.6.0
+ */
+function wp_ajax_nopriv_heartbeat() {
+ $response = array();
+
+ // screen_id is the same as $current_screen->id and the JS global 'pagenow'.
+ if ( ! empty( $_POST['screen_id'] ) ) {
+ $screen_id = sanitize_key( $_POST['screen_id'] );
+ } else {
+ $screen_id = 'front';
+ }
+
+ if ( ! empty( $_POST['data'] ) ) {
+ $data = wp_unslash( (array) $_POST['data'] );
+
+ /**
+ * Filters Heartbeat Ajax response in no-privilege environments.
+ *
+ * @since 3.6.0
+ *
+ * @param array $response The no-priv Heartbeat response.
+ * @param array $data The $_POST data sent.
+ * @param string $screen_id The screen id.
+ */
+ $response = apply_filters( 'heartbeat_nopriv_received', $response, $data, $screen_id );
+ }
+
+ /**
+ * Filters Heartbeat Ajax response in no-privilege environments when no data is passed.
+ *
+ * @since 3.6.0
+ *
+ * @param array $response The no-priv Heartbeat response.
+ * @param string $screen_id The screen id.
+ */
+ $response = apply_filters( 'heartbeat_nopriv_send', $response, $screen_id );
+
+ /**
+ * Fires when Heartbeat ticks in no-privilege environments.
+ *
+ * Allows the transport to be easily replaced with long-polling.
+ *
+ * @since 3.6.0
+ *
+ * @param array $response The no-priv Heartbeat response.
+ * @param string $screen_id The screen id.
+ */
+ do_action( 'heartbeat_nopriv_tick', $response, $screen_id );
+
+ // Send the current time according to the server.
+ $response['server_time'] = time();
+
+ wp_send_json( $response );
+}
+
+//
+// GET-based Ajax handlers.
+//
+
+/**
+ * Ajax handler for fetching a list table.
+ *
+ * @since 3.1.0
+ */
+function wp_ajax_fetch_list() {
+ $list_class = $_GET['list_args']['class'];
+ check_ajax_referer( "fetch-list-$list_class", '_ajax_fetch_list_nonce' );
+
+ $wp_list_table = _get_list_table( $list_class, array( 'screen' => $_GET['list_args']['screen']['id'] ) );
+ if ( ! $wp_list_table ) {
+ wp_die( 0 );
+ }
+
+ if ( ! $wp_list_table->ajax_user_can() ) {
+ wp_die( -1 );
+ }
+
+ $wp_list_table->ajax_response();
+
+ wp_die( 0 );
+}
+
+/**
+ * Ajax handler for tag search.
+ *
+ * @since 3.1.0
+ */
+function wp_ajax_ajax_tag_search() {
+ if ( ! isset( $_GET['tax'] ) ) {
+ wp_die( 0 );
+ }
+
+ $taxonomy = sanitize_key( $_GET['tax'] );
+ $tax = get_taxonomy( $taxonomy );
+ if ( ! $tax ) {
+ wp_die( 0 );
+ }
+
+ if ( ! current_user_can( $tax->cap->assign_terms ) ) {
+ wp_die( -1 );
+ }
+
+ $s = wp_unslash( $_GET['q'] );
+
+ $comma = _x( ',', 'tag delimiter' );
+ if ( ',' !== $comma ) {
+ $s = str_replace( $comma, ',', $s );
+ }
+ if ( false !== strpos( $s, ',' ) ) {
+ $s = explode( ',', $s );
+ $s = $s[ count( $s ) - 1 ];
+ }
+ $s = trim( $s );
+
+ /**
+ * Filters the minimum number of characters required to fire a tag search via Ajax.
+ *
+ * @since 4.0.0
+ *
+ * @param int $characters The minimum number of characters required. Default 2.
+ * @param WP_Taxonomy $tax The taxonomy object.
+ * @param string $s The search term.
+ */
+ $term_search_min_chars = (int) apply_filters( 'term_search_min_chars', 2, $tax, $s );
+
+ /*
+ * Require $term_search_min_chars chars for matching (default: 2)
+ * ensure it's a non-negative, non-zero integer.
+ */
+ if ( ( $term_search_min_chars == 0 ) || ( strlen( $s ) < $term_search_min_chars ) ) {
+ wp_die();
+ }
+
+ $results = get_terms(
+ $taxonomy,
+ array(
+ 'name__like' => $s,
+ 'fields' => 'names',
+ 'hide_empty' => false,
+ )
+ );
+
+ echo join( $results, "\n" );
+ wp_die();
+}
+
+/**
+ * Ajax handler for compression testing.
+ *
+ * @since 3.1.0
+ */
+function wp_ajax_wp_compression_test() {
+ if ( ! current_user_can( 'manage_options' ) ) {
+ wp_die( -1 );
+ }
+
+ if ( ini_get( 'zlib.output_compression' ) || 'ob_gzhandler' == ini_get( 'output_handler' ) ) {
+ update_site_option( 'can_compress_scripts', 0 );
+ wp_die( 0 );
+ }
+
+ if ( isset( $_GET['test'] ) ) {
+ header( 'Expires: Wed, 11 Jan 1984 05:00:00 GMT' );
+ header( 'Last-Modified: ' . gmdate( 'D, d M Y H:i:s' ) . ' GMT' );
+ header( 'Cache-Control: no-cache, must-revalidate, max-age=0' );
+ header( 'Content-Type: application/javascript; charset=UTF-8' );
+ $force_gzip = ( defined( 'ENFORCE_GZIP' ) && ENFORCE_GZIP );
+ $test_str = '"wpCompressionTest Lorem ipsum dolor sit amet consectetuer mollis sapien urna ut a. Eu nonummy condimentum fringilla tempor pretium platea vel nibh netus Maecenas. Hac molestie amet justo quis pellentesque est ultrices interdum nibh Morbi. Cras mattis pretium Phasellus ante ipsum ipsum ut sociis Suspendisse Lorem. Ante et non molestie. Porta urna Vestibulum egestas id congue nibh eu risus gravida sit. Ac augue auctor Ut et non a elit massa id sodales. Elit eu Nulla at nibh adipiscing mattis lacus mauris at tempus. Netus nibh quis suscipit nec feugiat eget sed lorem et urna. Pellentesque lacus at ut massa consectetuer ligula ut auctor semper Pellentesque. Ut metus massa nibh quam Curabitur molestie nec mauris congue. Volutpat molestie elit justo facilisis neque ac risus Ut nascetur tristique. Vitae sit lorem tellus et quis Phasellus lacus tincidunt nunc Fusce. Pharetra wisi Suspendisse mus sagittis libero lacinia Integer consequat ac Phasellus. Et urna ac cursus tortor aliquam Aliquam amet tellus volutpat Vestibulum. Justo interdum condimentum In augue congue tellus sollicitudin Quisque quis nibh."';
+
+ if ( 1 == $_GET['test'] ) {
+ echo $test_str;
+ wp_die();
+ } elseif ( 2 == $_GET['test'] ) {
+ if ( ! isset( $_SERVER['HTTP_ACCEPT_ENCODING'] ) ) {
+ wp_die( -1 );
+ }
+ if ( false !== stripos( $_SERVER['HTTP_ACCEPT_ENCODING'], 'deflate' ) && function_exists( 'gzdeflate' ) && ! $force_gzip ) {
+ header( 'Content-Encoding: deflate' );
+ $out = gzdeflate( $test_str, 1 );
+ } elseif ( false !== stripos( $_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip' ) && function_exists( 'gzencode' ) ) {
+ header( 'Content-Encoding: gzip' );
+ $out = gzencode( $test_str, 1 );
+ } else {
+ wp_die( -1 );
+ }
+ echo $out;
+ wp_die();
+ } elseif ( 'no' == $_GET['test'] ) {
+ check_ajax_referer( 'update_can_compress_scripts' );
+ update_site_option( 'can_compress_scripts', 0 );
+ } elseif ( 'yes' == $_GET['test'] ) {
+ check_ajax_referer( 'update_can_compress_scripts' );
+ update_site_option( 'can_compress_scripts', 1 );
+ }
+ }
+
+ wp_die( 0 );
+}
+
+/**
+ * Ajax handler for image editor previews.
+ *
+ * @since 3.1.0
+ */
+function wp_ajax_imgedit_preview() {
+ $post_id = intval( $_GET['postid'] );
+ if ( empty( $post_id ) || ! current_user_can( 'edit_post', $post_id ) ) {
+ wp_die( -1 );
+ }
+
+ check_ajax_referer( "image_editor-$post_id" );
+
+ include_once( ABSPATH . 'wp-admin/includes/image-edit.php' );
+ if ( ! stream_preview_image( $post_id ) ) {
+ wp_die( -1 );
+ }
+
+ wp_die();
+}
+
+/**
+ * Ajax handler for oEmbed caching.
+ *
+ * @since 3.1.0
+ *
+ * @global WP_Embed $wp_embed
+ */
+function wp_ajax_oembed_cache() {
+ $GLOBALS['wp_embed']->cache_oembed( $_GET['post'] );
+ wp_die( 0 );
+}
+
+/**
+ * Ajax handler for user autocomplete.
+ *
+ * @since 3.4.0
+ */
+function wp_ajax_autocomplete_user() {
+ if ( ! is_multisite() || ! current_user_can( 'promote_users' ) || wp_is_large_network( 'users' ) ) {
+ wp_die( -1 );
+ }
+
+ /** This filter is documented in wp-admin/user-new.php */
+ if ( ! current_user_can( 'manage_network_users' ) && ! apply_filters( 'autocomplete_users_for_site_admins', false ) ) {
+ wp_die( -1 );
+ }
+
+ $return = array();
+
+ // Check the type of request
+ // Current allowed values are `add` and `search`
+ if ( isset( $_REQUEST['autocomplete_type'] ) && 'search' === $_REQUEST['autocomplete_type'] ) {
+ $type = $_REQUEST['autocomplete_type'];
+ } else {
+ $type = 'add';
+ }
+
+ // Check the desired field for value
+ // Current allowed values are `user_email` and `user_login`
+ if ( isset( $_REQUEST['autocomplete_field'] ) && 'user_email' === $_REQUEST['autocomplete_field'] ) {
+ $field = $_REQUEST['autocomplete_field'];
+ } else {
+ $field = 'user_login';
+ }
+
+ // Exclude current users of this blog
+ if ( isset( $_REQUEST['site_id'] ) ) {
+ $id = absint( $_REQUEST['site_id'] );
+ } else {
+ $id = get_current_blog_id();
+ }
+
+ $include_blog_users = ( $type == 'search' ? get_users(
+ array(
+ 'blog_id' => $id,
+ 'fields' => 'ID',
+ )
+ ) : array() );
+ $exclude_blog_users = ( $type == 'add' ? get_users(
+ array(
+ 'blog_id' => $id,
+ 'fields' => 'ID',
+ )
+ ) : array() );
+
+ $users = get_users(
+ array(
+ 'blog_id' => false,
+ 'search' => '*' . $_REQUEST['term'] . '*',
+ 'include' => $include_blog_users,
+ 'exclude' => $exclude_blog_users,
+ 'search_columns' => array( 'user_login', 'user_nicename', 'user_email' ),
+ )
+ );
+
+ foreach ( $users as $user ) {
+ $return[] = array(
+ /* translators: 1: user_login, 2: user_email */
+ 'label' => sprintf( _x( '%1$s (%2$s)', 'user autocomplete result' ), $user->user_login, $user->user_email ),
+ 'value' => $user->$field,
+ );
+ }
+
+ wp_die( wp_json_encode( $return ) );
+}
+
+/**
+ * Handles AJAX requests for community events
+ *
+ * @since 4.8.0
+ */
+function wp_ajax_get_community_events() {
+ require_once( ABSPATH . 'wp-admin/includes/class-wp-community-events.php' );
+
+ check_ajax_referer( 'community_events' );
+
+ $search = isset( $_POST['location'] ) ? wp_unslash( $_POST['location'] ) : '';
+ $timezone = isset( $_POST['timezone'] ) ? wp_unslash( $_POST['timezone'] ) : '';
+ $user_id = get_current_user_id();
+ $saved_location = get_user_option( 'community-events-location', $user_id );
+ $events_client = new WP_Community_Events( $user_id, $saved_location );
+ $events = $events_client->get_events( $search, $timezone );
+ $ip_changed = false;
+
+ if ( is_wp_error( $events ) ) {
+ wp_send_json_error(
+ array(
+ 'error' => $events->get_error_message(),
+ )
+ );
+ } else {
+ if ( empty( $saved_location['ip'] ) && ! empty( $events['location']['ip'] ) ) {
+ $ip_changed = true;
+ } elseif ( isset( $saved_location['ip'] ) && ! empty( $events['location']['ip'] ) && $saved_location['ip'] !== $events['location']['ip'] ) {
+ $ip_changed = true;
+ }
+
+ /*
+ * The location should only be updated when it changes. The API doesn't always return
+ * a full location; sometimes it's missing the description or country. The location
+ * that was saved during the initial request is known to be good and complete, though.
+ * It should be left intact until the user explicitly changes it (either by manually
+ * searching for a new location, or by changing their IP address).
+ *
+ * If the location was updated with an incomplete response from the API, then it could
+ * break assumptions that the UI makes (e.g., that there will always be a description
+ * that corresponds to a latitude/longitude location).
+ *
+ * The location is stored network-wide, so that the user doesn't have to set it on each site.
+ */
+ if ( $ip_changed || $search ) {
+ update_user_option( $user_id, 'community-events-location', $events['location'], true );
+ }
+
+ wp_send_json_success( $events );
+ }
+}
+
+/**
+ * Ajax handler for dashboard widgets.
+ *
+ * @since 3.4.0
+ */
+function wp_ajax_dashboard_widgets() {
+ require_once ABSPATH . 'wp-admin/includes/dashboard.php';
+
+ $pagenow = $_GET['pagenow'];
+ if ( $pagenow === 'dashboard-user' || $pagenow === 'dashboard-network' || $pagenow === 'dashboard' ) {
+ set_current_screen( $pagenow );
+ }
+
+ switch ( $_GET['widget'] ) {
+ case 'dashboard_primary':
+ wp_dashboard_primary();
+ break;
+ }
+ wp_die();
+}
+
+/**
+ * Ajax handler for Customizer preview logged-in status.
+ *
+ * @since 3.4.0
+ */
+function wp_ajax_logged_in() {
+ wp_die( 1 );
+}
+
+//
+// Ajax helpers.
+//
+
+/**
+ * Sends back current comment total and new page links if they need to be updated.
+ *
+ * Contrary to normal success Ajax response ("1"), die with time() on success.
+ *
+ * @access private
+ * @since 2.7.0
+ *
+ * @param int $comment_id
+ * @param int $delta
+ */
+function _wp_ajax_delete_comment_response( $comment_id, $delta = -1 ) {
+ $total = isset( $_POST['_total'] ) ? (int) $_POST['_total'] : 0;
+ $per_page = isset( $_POST['_per_page'] ) ? (int) $_POST['_per_page'] : 0;
+ $page = isset( $_POST['_page'] ) ? (int) $_POST['_page'] : 0;
+ $url = isset( $_POST['_url'] ) ? esc_url_raw( $_POST['_url'] ) : '';
+
+ // JS didn't send us everything we need to know. Just die with success message
+ if ( ! $total || ! $per_page || ! $page || ! $url ) {
+ $time = time();
+ $comment = get_comment( $comment_id );
+ $comment_status = '';
+ $comment_link = '';
+
+ if ( $comment ) {
+ $comment_status = $comment->comment_approved;
+ }
+
+ if ( 1 === (int) $comment_status ) {
+ $comment_link = get_comment_link( $comment );
+ }
+
+ $counts = wp_count_comments();
+
+ $x = new WP_Ajax_Response(
+ array(
+ 'what' => 'comment',
+ // Here for completeness - not used.
+ 'id' => $comment_id,
+ 'supplemental' => array(
+ 'status' => $comment_status,
+ 'postId' => $comment ? $comment->comment_post_ID : '',
+ 'time' => $time,
+ 'in_moderation' => $counts->moderated,
+ 'i18n_comments_text' => sprintf(
+ /* translators: %s: number of comments approved */
+ _n( '%s Comment', '%s Comments', $counts->approved ),
+ number_format_i18n( $counts->approved )
+ ),
+ 'i18n_moderation_text' => sprintf(
+ /* translators: %s: number of comments in moderation */
+ _n( '%s Comment in moderation', '%s Comments in moderation', $counts->moderated ),
+ number_format_i18n( $counts->moderated )
+ ),
+ 'comment_link' => $comment_link,
+ ),
+ )
+ );
+ $x->send();
+ }
+
+ $total += $delta;
+ if ( $total < 0 ) {
+ $total = 0;
+ }
+
+ // Only do the expensive stuff on a page-break, and about 1 other time per page
+ if ( 0 == $total % $per_page || 1 == mt_rand( 1, $per_page ) ) {
+ $post_id = 0;
+ // What type of comment count are we looking for?
+ $status = 'all';
+ $parsed = parse_url( $url );
+ if ( isset( $parsed['query'] ) ) {
+ parse_str( $parsed['query'], $query_vars );
+ if ( ! empty( $query_vars['comment_status'] ) ) {
+ $status = $query_vars['comment_status'];
+ }
+ if ( ! empty( $query_vars['p'] ) ) {
+ $post_id = (int) $query_vars['p'];
+ }
+ if ( ! empty( $query_vars['comment_type'] ) ) {
+ $type = $query_vars['comment_type'];
+ }
+ }
+
+ if ( empty( $type ) ) {
+ // Only use the comment count if not filtering by a comment_type.
+ $comment_count = wp_count_comments( $post_id );
+
+ // We're looking for a known type of comment count.
+ if ( isset( $comment_count->$status ) ) {
+ $total = $comment_count->$status;
+ }
+ }
+ // Else use the decremented value from above.
+ }
+
+ // The time since the last comment count.
+ $time = time();
+ $comment = get_comment( $comment_id );
+ $counts = wp_count_comments();
+
+ $x = new WP_Ajax_Response(
+ array(
+ 'what' => 'comment',
+ 'id' => $comment_id,
+ 'supplemental' => array(
+ 'status' => $comment ? $comment->comment_approved : '',
+ 'postId' => $comment ? $comment->comment_post_ID : '',
+ /* translators: %s: number of comments */
+ 'total_items_i18n' => sprintf( _n( '%s item', '%s items', $total ), number_format_i18n( $total ) ),
+ 'total_pages' => ceil( $total / $per_page ),
+ 'total_pages_i18n' => number_format_i18n( ceil( $total / $per_page ) ),
+ 'total' => $total,
+ 'time' => $time,
+ 'in_moderation' => $counts->moderated,
+ 'i18n_moderation_text' => sprintf(
+ /* translators: %s: number of comments in moderation */
+ _n( '%s Comment in moderation', '%s Comments in moderation', $counts->moderated ),
+ number_format_i18n( $counts->moderated )
+ ),
+ ),
+ )
+ );
+ $x->send();
+}
+
+//
+// POST-based Ajax handlers.
+//
+
+/**
+ * Ajax handler for adding a hierarchical term.
+ *
+ * @access private
+ * @since 3.1.0
+ */
+function _wp_ajax_add_hierarchical_term() {
+ $action = $_POST['action'];
+ $taxonomy = get_taxonomy( substr( $action, 4 ) );
+ check_ajax_referer( $action, '_ajax_nonce-add-' . $taxonomy->name );
+ if ( ! current_user_can( $taxonomy->cap->edit_terms ) ) {
+ wp_die( -1 );
+ }
+ $names = explode( ',', $_POST[ 'new' . $taxonomy->name ] );
+ $parent = isset( $_POST[ 'new' . $taxonomy->name . '_parent' ] ) ? (int) $_POST[ 'new' . $taxonomy->name . '_parent' ] : 0;
+ if ( 0 > $parent ) {
+ $parent = 0;
+ }
+ if ( $taxonomy->name == 'category' ) {
+ $post_category = isset( $_POST['post_category'] ) ? (array) $_POST['post_category'] : array();
+ } else {
+ $post_category = ( isset( $_POST['tax_input'] ) && isset( $_POST['tax_input'][ $taxonomy->name ] ) ) ? (array) $_POST['tax_input'][ $taxonomy->name ] : array();
+ }
+ $checked_categories = array_map( 'absint', (array) $post_category );
+ $popular_ids = wp_popular_terms_checklist( $taxonomy->name, 0, 10, false );
+
+ foreach ( $names as $cat_name ) {
+ $cat_name = trim( $cat_name );
+ $category_nicename = sanitize_title( $cat_name );
+ if ( '' === $category_nicename ) {
+ continue;
+ }
+
+ $cat_id = wp_insert_term( $cat_name, $taxonomy->name, array( 'parent' => $parent ) );
+ if ( ! $cat_id || is_wp_error( $cat_id ) ) {
+ continue;
+ } else {
+ $cat_id = $cat_id['term_id'];
+ }
+ $checked_categories[] = $cat_id;
+ if ( $parent ) { // Do these all at once in a second
+ continue;
+ }
+
+ ob_start();
+
+ wp_terms_checklist(
+ 0,
+ array(
+ 'taxonomy' => $taxonomy->name,
+ 'descendants_and_self' => $cat_id,
+ 'selected_cats' => $checked_categories,
+ 'popular_cats' => $popular_ids,
+ )
+ );
+
+ $data = ob_get_clean();
+
+ $add = array(
+ 'what' => $taxonomy->name,
+ 'id' => $cat_id,
+ 'data' => str_replace( array( "\n", "\t" ), '', $data ),
+ 'position' => -1,
+ );
+ }
+
+ if ( $parent ) { // Foncy - replace the parent and all its children
+ $parent = get_term( $parent, $taxonomy->name );
+ $term_id = $parent->term_id;
+
+ while ( $parent->parent ) { // get the top parent
+ $parent = get_term( $parent->parent, $taxonomy->name );
+ if ( is_wp_error( $parent ) ) {
+ break;
+ }
+ $term_id = $parent->term_id;
+ }
+
+ ob_start();
+
+ wp_terms_checklist(
+ 0,
+ array(
+ 'taxonomy' => $taxonomy->name,
+ 'descendants_and_self' => $term_id,
+ 'selected_cats' => $checked_categories,
+ 'popular_cats' => $popular_ids,
+ )
+ );
+
+ $data = ob_get_clean();
+
+ $add = array(
+ 'what' => $taxonomy->name,
+ 'id' => $term_id,
+ 'data' => str_replace( array( "\n", "\t" ), '', $data ),
+ 'position' => -1,
+ );
+ }
+
+ ob_start();
+
+ wp_dropdown_categories(
+ array(
+ 'taxonomy' => $taxonomy->name,
+ 'hide_empty' => 0,
+ 'name' => 'new' . $taxonomy->name . '_parent',
+ 'orderby' => 'name',
+ 'hierarchical' => 1,
+ 'show_option_none' => '&mdash; ' . $taxonomy->labels->parent_item . ' &mdash;',
+ )
+ );
+
+ $sup = ob_get_clean();
+
+ $add['supplemental'] = array( 'newcat_parent' => $sup );
+
+ $x = new WP_Ajax_Response( $add );
+ $x->send();
+}
+
+/**
+ * Ajax handler for deleting a comment.
+ *
+ * @since 3.1.0
+ */
+function wp_ajax_delete_comment() {
+ $id = isset( $_POST['id'] ) ? (int) $_POST['id'] : 0;
+
+ if ( ! $comment = get_comment( $id ) ) {
+ wp_die( time() );
+ }
+ if ( ! current_user_can( 'edit_comment', $comment->comment_ID ) ) {
+ wp_die( -1 );
+ }
+
+ check_ajax_referer( "delete-comment_$id" );
+ $status = wp_get_comment_status( $comment );
+
+ $delta = -1;
+ if ( isset( $_POST['trash'] ) && 1 == $_POST['trash'] ) {
+ if ( 'trash' == $status ) {
+ wp_die( time() );
+ }
+ $r = wp_trash_comment( $comment );
+ } elseif ( isset( $_POST['untrash'] ) && 1 == $_POST['untrash'] ) {
+ if ( 'trash' != $status ) {
+ wp_die( time() );
+ }
+ $r = wp_untrash_comment( $comment );
+ if ( ! isset( $_POST['comment_status'] ) || $_POST['comment_status'] != 'trash' ) { // undo trash, not in trash
+ $delta = 1;
+ }
+ } elseif ( isset( $_POST['spam'] ) && 1 == $_POST['spam'] ) {
+ if ( 'spam' == $status ) {
+ wp_die( time() );
+ }
+ $r = wp_spam_comment( $comment );
+ } elseif ( isset( $_POST['unspam'] ) && 1 == $_POST['unspam'] ) {
+ if ( 'spam' != $status ) {
+ wp_die( time() );
+ }
+ $r = wp_unspam_comment( $comment );
+ if ( ! isset( $_POST['comment_status'] ) || $_POST['comment_status'] != 'spam' ) { // undo spam, not in spam
+ $delta = 1;
+ }
+ } elseif ( isset( $_POST['delete'] ) && 1 == $_POST['delete'] ) {
+ $r = wp_delete_comment( $comment );
+ } else {
+ wp_die( -1 );
+ }
+
+ if ( $r ) { // Decide if we need to send back '1' or a more complicated response including page links and comment counts
+ _wp_ajax_delete_comment_response( $comment->comment_ID, $delta );
+ }
+ wp_die( 0 );
+}
+
+/**
+ * Ajax handler for deleting a tag.
+ *
+ * @since 3.1.0
+ */
+function wp_ajax_delete_tag() {
+ $tag_id = (int) $_POST['tag_ID'];
+ check_ajax_referer( "delete-tag_$tag_id" );
+
+ if ( ! current_user_can( 'delete_term', $tag_id ) ) {
+ wp_die( -1 );
+ }
+
+ $taxonomy = ! empty( $_POST['taxonomy'] ) ? $_POST['taxonomy'] : 'post_tag';
+ $tag = get_term( $tag_id, $taxonomy );
+ if ( ! $tag || is_wp_error( $tag ) ) {
+ wp_die( 1 );
+ }
+
+ if ( wp_delete_term( $tag_id, $taxonomy ) ) {
+ wp_die( 1 );
+ } else {
+ wp_die( 0 );
+ }
+}
+
+/**
+ * Ajax handler for deleting a link.
+ *
+ * @since 3.1.0
+ */
+function wp_ajax_delete_link() {
+ $id = isset( $_POST['id'] ) ? (int) $_POST['id'] : 0;
+
+ check_ajax_referer( "delete-bookmark_$id" );
+ if ( ! current_user_can( 'manage_links' ) ) {
+ wp_die( -1 );
+ }
+
+ $link = get_bookmark( $id );
+ if ( ! $link || is_wp_error( $link ) ) {
+ wp_die( 1 );
+ }
+
+ if ( wp_delete_link( $id ) ) {
+ wp_die( 1 );
+ } else {
+ wp_die( 0 );
+ }
+}
+
+/**
+ * Ajax handler for deleting meta.
+ *
+ * @since 3.1.0
+ */
+function wp_ajax_delete_meta() {
+ $id = isset( $_POST['id'] ) ? (int) $_POST['id'] : 0;
+
+ check_ajax_referer( "delete-meta_$id" );
+ if ( ! $meta = get_metadata_by_mid( 'post', $id ) ) {
+ wp_die( 1 );
+ }
+
+ if ( is_protected_meta( $meta->meta_key, 'post' ) || ! current_user_can( 'delete_post_meta', $meta->post_id, $meta->meta_key ) ) {
+ wp_die( -1 );
+ }
+ if ( delete_meta( $meta->meta_id ) ) {
+ wp_die( 1 );
+ }
+ wp_die( 0 );
+}
+
+/**
+ * Ajax handler for deleting a post.
+ *
+ * @since 3.1.0
+ *
+ * @param string $action Action to perform.
+ */
+function wp_ajax_delete_post( $action ) {
+ if ( empty( $action ) ) {
+ $action = 'delete-post';
+ }
+ $id = isset( $_POST['id'] ) ? (int) $_POST['id'] : 0;
+
+ check_ajax_referer( "{$action}_$id" );
+ if ( ! current_user_can( 'delete_post', $id ) ) {
+ wp_die( -1 );
+ }
+
+ if ( ! get_post( $id ) ) {
+ wp_die( 1 );
+ }
+
+ if ( wp_delete_post( $id ) ) {
+ wp_die( 1 );
+ } else {
+ wp_die( 0 );
+ }
+}
+
+/**
+ * Ajax handler for sending a post to the trash.
+ *
+ * @since 3.1.0
+ *
+ * @param string $action Action to perform.
+ */
+function wp_ajax_trash_post( $action ) {
+ if ( empty( $action ) ) {
+ $action = 'trash-post';
+ }
+ $id = isset( $_POST['id'] ) ? (int) $_POST['id'] : 0;
+
+ check_ajax_referer( "{$action}_$id" );
+ if ( ! current_user_can( 'delete_post', $id ) ) {
+ wp_die( -1 );
+ }
+
+ if ( ! get_post( $id ) ) {
+ wp_die( 1 );
+ }
+
+ if ( 'trash-post' == $action ) {
+ $done = wp_trash_post( $id );
+ } else {
+ $done = wp_untrash_post( $id );
+ }
+
+ if ( $done ) {
+ wp_die( 1 );
+ }
+
+ wp_die( 0 );
+}
+
+/**
+ * Ajax handler to restore a post from the trash.
+ *
+ * @since 3.1.0
+ *
+ * @param string $action Action to perform.
+ */
+function wp_ajax_untrash_post( $action ) {
+ if ( empty( $action ) ) {
+ $action = 'untrash-post';
+ }
+ wp_ajax_trash_post( $action );
+}
+
+/**
+ * Ajax handler to delete a page.
+ *
+ * @since 3.1.0
+ *
+ * @param string $action Action to perform.
+ */
+function wp_ajax_delete_page( $action ) {
+ if ( empty( $action ) ) {
+ $action = 'delete-page';
+ }
+ $id = isset( $_POST['id'] ) ? (int) $_POST['id'] : 0;
+
+ check_ajax_referer( "{$action}_$id" );
+ if ( ! current_user_can( 'delete_page', $id ) ) {
+ wp_die( -1 );
+ }
+
+ if ( ! get_post( $id ) ) {
+ wp_die( 1 );
+ }
+
+ if ( wp_delete_post( $id ) ) {
+ wp_die( 1 );
+ } else {
+ wp_die( 0 );
+ }
+}
+
+/**
+ * Ajax handler to dim a comment.
+ *
+ * @since 3.1.0
+ */
+function wp_ajax_dim_comment() {
+ $id = isset( $_POST['id'] ) ? (int) $_POST['id'] : 0;
+
+ if ( ! $comment = get_comment( $id ) ) {
+ $x = new WP_Ajax_Response(
+ array(
+ 'what' => 'comment',
+ /* translators: %d: comment ID */
+ 'id' => new WP_Error( 'invalid_comment', sprintf( __( 'Comment %d does not exist' ), $id ) ),
+ )
+ );
+ $x->send();
+ }
+
+ if ( ! current_user_can( 'edit_comment', $comment->comment_ID ) && ! current_user_can( 'moderate_comments' ) ) {
+ wp_die( -1 );
+ }
+
+ $current = wp_get_comment_status( $comment );
+ if ( isset( $_POST['new'] ) && $_POST['new'] == $current ) {
+ wp_die( time() );
+ }
+
+ check_ajax_referer( "approve-comment_$id" );
+ if ( in_array( $current, array( 'unapproved', 'spam' ) ) ) {
+ $result = wp_set_comment_status( $comment, 'approve', true );
+ } else {
+ $result = wp_set_comment_status( $comment, 'hold', true );
+ }
+
+ if ( is_wp_error( $result ) ) {
+ $x = new WP_Ajax_Response(
+ array(
+ 'what' => 'comment',
+ 'id' => $result,
+ )
+ );
+ $x->send();
+ }
+
+ // Decide if we need to send back '1' or a more complicated response including page links and comment counts
+ _wp_ajax_delete_comment_response( $comment->comment_ID );
+ wp_die( 0 );
+}
+
+/**
+ * Ajax handler for adding a link category.
+ *
+ * @since 3.1.0
+ *
+ * @param string $action Action to perform.
+ */
+function wp_ajax_add_link_category( $action ) {
+ if ( empty( $action ) ) {
+ $action = 'add-link-category';
+ }
+ check_ajax_referer( $action );
+ $tax = get_taxonomy( 'link_category' );
+ if ( ! current_user_can( $tax->cap->manage_terms ) ) {
+ wp_die( -1 );
+ }
+ $names = explode( ',', wp_unslash( $_POST['newcat'] ) );
+ $x = new WP_Ajax_Response();
+ foreach ( $names as $cat_name ) {
+ $cat_name = trim( $cat_name );
+ $slug = sanitize_title( $cat_name );
+ if ( '' === $slug ) {
+ continue;
+ }
+
+ $cat_id = wp_insert_term( $cat_name, 'link_category' );
+ if ( ! $cat_id || is_wp_error( $cat_id ) ) {
+ continue;
+ } else {
+ $cat_id = $cat_id['term_id'];
+ }
+ $cat_name = esc_html( $cat_name );
+ $x->add(
+ array(
+ 'what' => 'link-category',
+ 'id' => $cat_id,
+ 'data' => "<li id='link-category-$cat_id'><label for='in-link-category-$cat_id' class='selectit'><input value='" . esc_attr( $cat_id ) . "' type='checkbox' checked='checked' name='link_category[]' id='in-link-category-$cat_id'/> $cat_name</label></li>",
+ 'position' => -1,
+ )
+ );
+ }
+ $x->send();
+}
+
+/**
+ * Ajax handler to add a tag.
+ *
+ * @since 3.1.0
+ */
+function wp_ajax_add_tag() {
+ check_ajax_referer( 'add-tag', '_wpnonce_add-tag' );
+ $taxonomy = ! empty( $_POST['taxonomy'] ) ? $_POST['taxonomy'] : 'post_tag';
+ $tax = get_taxonomy( $taxonomy );
+
+ if ( ! current_user_can( $tax->cap->edit_terms ) ) {
+ wp_die( -1 );
+ }
+
+ $x = new WP_Ajax_Response();
+
+ $tag = wp_insert_term( $_POST['tag-name'], $taxonomy, $_POST );
+
+ if ( ! $tag || is_wp_error( $tag ) || ( ! $tag = get_term( $tag['term_id'], $taxonomy ) ) ) {
+ $message = __( 'An error has occurred. Please reload the page and try again.' );
+ if ( is_wp_error( $tag ) && $tag->get_error_message() ) {
+ $message = $tag->get_error_message();
+ }
+
+ $x->add(
+ array(
+ 'what' => 'taxonomy',
+ 'data' => new WP_Error( 'error', $message ),
+ )
+ );
+ $x->send();
+ }
+
+ $wp_list_table = _get_list_table( 'WP_Terms_List_Table', array( 'screen' => $_POST['screen'] ) );
+
+ $level = 0;
+ $noparents = '';
+
+ if ( is_taxonomy_hierarchical( $taxonomy ) ) {
+ $level = count( get_ancestors( $tag->term_id, $taxonomy, 'taxonomy' ) );
+ ob_start();
+ $wp_list_table->single_row( $tag, $level );
+ $noparents = ob_get_clean();
+ }
+
+ ob_start();
+ $wp_list_table->single_row( $tag );
+ $parents = ob_get_clean();
+
+ $x->add(
+ array(
+ 'what' => 'taxonomy',
+ 'supplemental' => compact( 'parents', 'noparents' ),
+ )
+ );
+ $x->add(
+ array(
+ 'what' => 'term',
+ 'position' => $level,
+ 'supplemental' => (array) $tag,
+ )
+ );
+ $x->send();
+}
+
+/**
+ * Ajax handler for getting a tagcloud.
+ *
+ * @since 3.1.0
+ */
+function wp_ajax_get_tagcloud() {
+ if ( ! isset( $_POST['tax'] ) ) {
+ wp_die( 0 );
+ }
+
+ $taxonomy = sanitize_key( $_POST['tax'] );
+ $tax = get_taxonomy( $taxonomy );
+ if ( ! $tax ) {
+ wp_die( 0 );
+ }
+
+ if ( ! current_user_can( $tax->cap->assign_terms ) ) {
+ wp_die( -1 );
+ }
+
+ $tags = get_terms(
+ $taxonomy,
+ array(
+ 'number' => 45,
+ 'orderby' => 'count',
+ 'order' => 'DESC',
+ )
+ );
+
+ if ( empty( $tags ) ) {
+ wp_die( $tax->labels->not_found );
+ }
+
+ if ( is_wp_error( $tags ) ) {
+ wp_die( $tags->get_error_message() );
+ }
+
+ foreach ( $tags as $key => $tag ) {
+ $tags[ $key ]->link = '#';
+ $tags[ $key ]->id = $tag->term_id;
+ }
+
+ // We need raw tag names here, so don't filter the output
+ $return = wp_generate_tag_cloud(
+ $tags,
+ array(
+ 'filter' => 0,
+ 'format' => 'list',
+ )
+ );
+
+ if ( empty( $return ) ) {
+ wp_die( 0 );
+ }
+
+ echo $return;
+
+ wp_die();
+}
+
+/**
+ * Ajax handler for getting comments.
+ *
+ * @since 3.1.0
+ *
+ * @global int $post_id
+ *
+ * @param string $action Action to perform.
+ */
+function wp_ajax_get_comments( $action ) {
+ global $post_id;
+ if ( empty( $action ) ) {
+ $action = 'get-comments';
+ }
+ check_ajax_referer( $action );
+
+ if ( empty( $post_id ) && ! empty( $_REQUEST['p'] ) ) {
+ $id = absint( $_REQUEST['p'] );
+ if ( ! empty( $id ) ) {
+ $post_id = $id;
+ }
+ }
+
+ if ( empty( $post_id ) ) {
+ wp_die( -1 );
+ }
+
+ $wp_list_table = _get_list_table( 'WP_Post_Comments_List_Table', array( 'screen' => 'edit-comments' ) );
+
+ if ( ! current_user_can( 'edit_post', $post_id ) ) {
+ wp_die( -1 );
+ }
+
+ $wp_list_table->prepare_items();
+
+ if ( ! $wp_list_table->has_items() ) {
+ wp_die( 1 );
+ }
+
+ $x = new WP_Ajax_Response();
+ ob_start();
+ foreach ( $wp_list_table->items as $comment ) {
+ if ( ! current_user_can( 'edit_comment', $comment->comment_ID ) && 0 === $comment->comment_approved ) {
+ continue;
+ }
+ get_comment( $comment );
+ $wp_list_table->single_row( $comment );
+ }
+ $comment_list_item = ob_get_clean();
+
+ $x->add(
+ array(
+ 'what' => 'comments',
+ 'data' => $comment_list_item,
+ )
+ );
+ $x->send();
+}
+
+/**
+ * Ajax handler for replying to a comment.
+ *
+ * @since 3.1.0
+ *
+ * @param string $action Action to perform.
+ */
+function wp_ajax_replyto_comment( $action ) {
+ if ( empty( $action ) ) {
+ $action = 'replyto-comment';
+ }
+
+ check_ajax_referer( $action, '_ajax_nonce-replyto-comment' );
+
+ $comment_post_ID = (int) $_POST['comment_post_ID'];
+ $post = get_post( $comment_post_ID );
+ if ( ! $post ) {
+ wp_die( -1 );
+ }
+
+ if ( ! current_user_can( 'edit_post', $comment_post_ID ) ) {
+ wp_die( -1 );
+ }
+
+ if ( empty( $post->post_status ) ) {
+ wp_die( 1 );
+ } elseif ( in_array( $post->post_status, array( 'draft', 'pending', 'trash' ) ) ) {
+ wp_die( __( 'ERROR: you are replying to a comment on a draft post.' ) );
+ }
+
+ $user = wp_get_current_user();
+ if ( $user->exists() ) {
+ $user_ID = $user->ID;
+ $comment_author = wp_slash( $user->display_name );
+ $comment_author_email = wp_slash( $user->user_email );
+ $comment_author_url = wp_slash( $user->user_url );
+ $comment_content = trim( $_POST['content'] );
+ $comment_type = isset( $_POST['comment_type'] ) ? trim( $_POST['comment_type'] ) : '';
+ if ( current_user_can( 'unfiltered_html' ) ) {
+ if ( ! isset( $_POST['_wp_unfiltered_html_comment'] ) ) {
+ $_POST['_wp_unfiltered_html_comment'] = '';
+ }
+
+ if ( wp_create_nonce( 'unfiltered-html-comment' ) != $_POST['_wp_unfiltered_html_comment'] ) {
+ kses_remove_filters(); // start with a clean slate
+ kses_init_filters(); // set up the filters
+ remove_filter( 'pre_comment_content', 'wp_filter_post_kses' );
+ add_filter( 'pre_comment_content', 'wp_filter_kses' );
+ }
+ }
+ } else {
+ wp_die( __( 'Sorry, you must be logged in to reply to a comment.' ) );
+ }
+
+ if ( '' == $comment_content ) {
+ wp_die( __( 'ERROR: please type a comment.' ) );
+ }
+
+ $comment_parent = 0;
+ if ( isset( $_POST['comment_ID'] ) ) {
+ $comment_parent = absint( $_POST['comment_ID'] );
+ }
+ $comment_auto_approved = false;
+ $commentdata = compact( 'comment_post_ID', 'comment_author', 'comment_author_email', 'comment_author_url', 'comment_content', 'comment_type', 'comment_parent', 'user_ID' );
+
+ // Automatically approve parent comment.
+ if ( ! empty( $_POST['approve_parent'] ) ) {
+ $parent = get_comment( $comment_parent );
+
+ if ( $parent && $parent->comment_approved === '0' && $parent->comment_post_ID == $comment_post_ID ) {
+ if ( ! current_user_can( 'edit_comment', $parent->comment_ID ) ) {
+ wp_die( -1 );
+ }
+
+ if ( wp_set_comment_status( $parent, 'approve' ) ) {
+ $comment_auto_approved = true;
+ }
+ }
+ }
+
+ $comment_id = wp_new_comment( $commentdata );
+
+ if ( is_wp_error( $comment_id ) ) {
+ wp_die( $comment_id->get_error_message() );
+ }
+
+ $comment = get_comment( $comment_id );
+ if ( ! $comment ) {
+ wp_die( 1 );
+ }
+
+ $position = ( isset( $_POST['position'] ) && (int) $_POST['position'] ) ? (int) $_POST['position'] : '-1';
+
+ ob_start();
+ if ( isset( $_REQUEST['mode'] ) && 'dashboard' == $_REQUEST['mode'] ) {
+ require_once( ABSPATH . 'wp-admin/includes/dashboard.php' );
+ _wp_dashboard_recent_comments_row( $comment );
+ } else {
+ if ( isset( $_REQUEST['mode'] ) && 'single' == $_REQUEST['mode'] ) {
+ $wp_list_table = _get_list_table( 'WP_Post_Comments_List_Table', array( 'screen' => 'edit-comments' ) );
+ } else {
+ $wp_list_table = _get_list_table( 'WP_Comments_List_Table', array( 'screen' => 'edit-comments' ) );
+ }
+ $wp_list_table->single_row( $comment );
+ }
+ $comment_list_item = ob_get_clean();
+
+ $response = array(
+ 'what' => 'comment',
+ 'id' => $comment->comment_ID,
+ 'data' => $comment_list_item,
+ 'position' => $position,
+ );
+
+ $counts = wp_count_comments();
+ $response['supplemental'] = array(
+ 'in_moderation' => $counts->moderated,
+ 'i18n_comments_text' => sprintf(
+ /* translators: %s: number of comments approved */
+ _n( '%s Comment', '%s Comments', $counts->approved ),
+ number_format_i18n( $counts->approved )
+ ),
+ 'i18n_moderation_text' => sprintf(
+ /* translators: %s: number of comments in moderation */
+ _n( '%s Comment in moderation', '%s Comments in moderation', $counts->moderated ),
+ number_format_i18n( $counts->moderated )
+ ),
+ );
+
+ if ( $comment_auto_approved ) {
+ $response['supplemental']['parent_approved'] = $parent->comment_ID;
+ $response['supplemental']['parent_post_id'] = $parent->comment_post_ID;
+ }
+
+ $x = new WP_Ajax_Response();
+ $x->add( $response );
+ $x->send();
+}
+
+/**
+ * Ajax handler for editing a comment.
+ *
+ * @since 3.1.0
+ */
+function wp_ajax_edit_comment() {
+ check_ajax_referer( 'replyto-comment', '_ajax_nonce-replyto-comment' );
+
+ $comment_id = (int) $_POST['comment_ID'];
+ if ( ! current_user_can( 'edit_comment', $comment_id ) ) {
+ wp_die( -1 );
+ }
+
+ if ( '' == $_POST['content'] ) {
+ wp_die( __( 'ERROR: please type a comment.' ) );
+ }
+
+ if ( isset( $_POST['status'] ) ) {
+ $_POST['comment_status'] = $_POST['status'];
+ }
+ edit_comment();
+
+ $position = ( isset( $_POST['position'] ) && (int) $_POST['position'] ) ? (int) $_POST['position'] : '-1';
+ $checkbox = ( isset( $_POST['checkbox'] ) && true == $_POST['checkbox'] ) ? 1 : 0;
+ $wp_list_table = _get_list_table( $checkbox ? 'WP_Comments_List_Table' : 'WP_Post_Comments_List_Table', array( 'screen' => 'edit-comments' ) );
+
+ $comment = get_comment( $comment_id );
+ if ( empty( $comment->comment_ID ) ) {
+ wp_die( -1 );
+ }
+
+ ob_start();
+ $wp_list_table->single_row( $comment );
+ $comment_list_item = ob_get_clean();
+
+ $x = new WP_Ajax_Response();
+
+ $x->add(
+ array(
+ 'what' => 'edit_comment',
+ 'id' => $comment->comment_ID,
+ 'data' => $comment_list_item,
+ 'position' => $position,
+ )
+ );
+
+ $x->send();
+}
+
+/**
+ * Ajax handler for adding a menu item.
+ *
+ * @since 3.1.0
+ */
+function wp_ajax_add_menu_item() {
+ check_ajax_referer( 'add-menu_item', 'menu-settings-column-nonce' );
+
+ if ( ! current_user_can( 'edit_theme_options' ) ) {
+ wp_die( -1 );
+ }
+
+ require_once ABSPATH . 'wp-admin/includes/nav-menu.php';
+
+ // For performance reasons, we omit some object properties from the checklist.
+ // The following is a hacky way to restore them when adding non-custom items.
+
+ $menu_items_data = array();
+ foreach ( (array) $_POST['menu-item'] as $menu_item_data ) {
+ if (
+ ! empty( $menu_item_data['menu-item-type'] ) &&
+ 'custom' != $menu_item_data['menu-item-type'] &&
+ ! empty( $menu_item_data['menu-item-object-id'] )
+ ) {
+ switch ( $menu_item_data['menu-item-type'] ) {
+ case 'post_type':
+ $_object = get_post( $menu_item_data['menu-item-object-id'] );
+ break;
+
+ case 'post_type_archive':
+ $_object = get_post_type_object( $menu_item_data['menu-item-object'] );
+ break;
+
+ case 'taxonomy':
+ $_object = get_term( $menu_item_data['menu-item-object-id'], $menu_item_data['menu-item-object'] );
+ break;
+ }
+
+ $_menu_items = array_map( 'wp_setup_nav_menu_item', array( $_object ) );
+ $_menu_item = reset( $_menu_items );
+
+ // Restore the missing menu item properties
+ $menu_item_data['menu-item-description'] = $_menu_item->description;
+ }
+
+ $menu_items_data[] = $menu_item_data;
+ }
+
+ $item_ids = wp_save_nav_menu_items( 0, $menu_items_data );
+ if ( is_wp_error( $item_ids ) ) {
+ wp_die( 0 );
+ }
+
+ $menu_items = array();
+
+ foreach ( (array) $item_ids as $menu_item_id ) {
+ $menu_obj = get_post( $menu_item_id );
+ if ( ! empty( $menu_obj->ID ) ) {
+ $menu_obj = wp_setup_nav_menu_item( $menu_obj );
+ $menu_obj->title = empty( $menu_obj->title ) ? __( 'Menu Item' ) : $menu_obj->title;
+ $menu_obj->label = $menu_obj->title; // don't show "(pending)" in ajax-added items
+ $menu_items[] = $menu_obj;
+ }
+ }
+
+ /** This filter is documented in wp-admin/includes/nav-menu.php */
+ $walker_class_name = apply_filters( 'wp_edit_nav_menu_walker', 'Walker_Nav_Menu_Edit', $_POST['menu'] );
+
+ if ( ! class_exists( $walker_class_name ) ) {
+ wp_die( 0 );
+ }
+
+ if ( ! empty( $menu_items ) ) {
+ $args = array(
+ 'after' => '',
+ 'before' => '',
+ 'link_after' => '',
+ 'link_before' => '',
+ 'walker' => new $walker_class_name,
+ );
+ echo walk_nav_menu_tree( $menu_items, 0, (object) $args );
+ }
+ wp_die();
+}
+
+/**
+ * Ajax handler for adding meta.
+ *
+ * @since 3.1.0
+ */
+function wp_ajax_add_meta() {
+ check_ajax_referer( 'add-meta', '_ajax_nonce-add-meta' );
+ $c = 0;
+ $pid = (int) $_POST['post_id'];
+ $post = get_post( $pid );
+
+ if ( isset( $_POST['metakeyselect'] ) || isset( $_POST['metakeyinput'] ) ) {
+ if ( ! current_user_can( 'edit_post', $pid ) ) {
+ wp_die( -1 );
+ }
+ if ( isset( $_POST['metakeyselect'] ) && '#NONE#' == $_POST['metakeyselect'] && empty( $_POST['metakeyinput'] ) ) {
+ wp_die( 1 );
+ }
+
+ // If the post is an autodraft, save the post as a draft and then attempt to save the meta.
+ if ( $post->post_status == 'auto-draft' ) {
+ $post_data = array();
+ $post_data['action'] = 'draft'; // Warning fix
+ $post_data['post_ID'] = $pid;
+ $post_data['post_type'] = $post->post_type;
+ $post_data['post_status'] = 'draft';
+ $now = time();
+ /* translators: 1: Post creation date, 2: Post creation time */
+ $post_data['post_title'] = sprintf( __( 'Draft created on %1$s at %2$s' ), date( __( 'F j, Y' ), $now ), date( __( 'g:i a' ), $now ) );
+
+ $pid = edit_post( $post_data );
+ if ( $pid ) {
+ if ( is_wp_error( $pid ) ) {
+ $x = new WP_Ajax_Response(
+ array(
+ 'what' => 'meta',
+ 'data' => $pid,
+ )
+ );
+ $x->send();
+ }
+
+ if ( ! $mid = add_meta( $pid ) ) {
+ wp_die( __( 'Please provide a custom field value.' ) );
+ }
+ } else {
+ wp_die( 0 );
+ }
+ } elseif ( ! $mid = add_meta( $pid ) ) {
+ wp_die( __( 'Please provide a custom field value.' ) );
+ }
+
+ $meta = get_metadata_by_mid( 'post', $mid );
+ $pid = (int) $meta->post_id;
+ $meta = get_object_vars( $meta );
+ $x = new WP_Ajax_Response(
+ array(
+ 'what' => 'meta',
+ 'id' => $mid,
+ 'data' => _list_meta_row( $meta, $c ),
+ 'position' => 1,
+ 'supplemental' => array( 'postid' => $pid ),
+ )
+ );
+ } else { // Update?
+ $mid = (int) key( $_POST['meta'] );
+ $key = wp_unslash( $_POST['meta'][ $mid ]['key'] );
+ $value = wp_unslash( $_POST['meta'][ $mid ]['value'] );
+ if ( '' == trim( $key ) ) {
+ wp_die( __( 'Please provide a custom field name.' ) );
+ }
+ if ( ! $meta = get_metadata_by_mid( 'post', $mid ) ) {
+ wp_die( 0 ); // if meta doesn't exist
+ }
+ if ( is_protected_meta( $meta->meta_key, 'post' ) || is_protected_meta( $key, 'post' ) ||
+ ! current_user_can( 'edit_post_meta', $meta->post_id, $meta->meta_key ) ||
+ ! current_user_can( 'edit_post_meta', $meta->post_id, $key ) ) {
+ wp_die( -1 );
+ }
+ if ( $meta->meta_value != $value || $meta->meta_key != $key ) {
+ if ( ! $u = update_metadata_by_mid( 'post', $mid, $value, $key ) ) {
+ wp_die( 0 ); // We know meta exists; we also know it's unchanged (or DB error, in which case there are bigger problems).
+ }
+ }
+
+ $x = new WP_Ajax_Response(
+ array(
+ 'what' => 'meta',
+ 'id' => $mid,
+ 'old_id' => $mid,
+ 'data' => _list_meta_row(
+ array(
+ 'meta_key' => $key,
+ 'meta_value' => $value,
+ 'meta_id' => $mid,
+ ),
+ $c
+ ),
+ 'position' => 0,
+ 'supplemental' => array( 'postid' => $meta->post_id ),
+ )
+ );
+ }
+ $x->send();
+}
+
+/**
+ * Ajax handler for adding a user.
+ *
+ * @since 3.1.0
+ *
+ * @param string $action Action to perform.
+ */
+function wp_ajax_add_user( $action ) {
+ if ( empty( $action ) ) {
+ $action = 'add-user';
+ }
+
+ check_ajax_referer( $action );
+ if ( ! current_user_can( 'create_users' ) ) {
+ wp_die( -1 );
+ }
+ if ( ! $user_id = edit_user() ) {
+ wp_die( 0 );
+ } elseif ( is_wp_error( $user_id ) ) {
+ $x = new WP_Ajax_Response(
+ array(
+ 'what' => 'user',
+ 'id' => $user_id,
+ )
+ );
+ $x->send();
+ }
+ $user_object = get_userdata( $user_id );
+
+ $wp_list_table = _get_list_table( 'WP_Users_List_Table' );
+
+ $role = current( $user_object->roles );
+
+ $x = new WP_Ajax_Response(
+ array(
+ 'what' => 'user',
+ 'id' => $user_id,
+ 'data' => $wp_list_table->single_row( $user_object, '', $role ),
+ 'supplemental' => array(
+ 'show-link' => sprintf(
+ /* translators: %s: the new user */
+ __( 'User %s added' ),
+ '<a href="#user-' . $user_id . '">' . $user_object->user_login . '</a>'
+ ),
+ 'role' => $role,
+ ),
+ )
+ );
+ $x->send();
+}
+
+/**
+ * Ajax handler for closed post boxes.
+ *
+ * @since 3.1.0
+ */
+function wp_ajax_closed_postboxes() {
+ check_ajax_referer( 'closedpostboxes', 'closedpostboxesnonce' );
+ $closed = isset( $_POST['closed'] ) ? explode( ',', $_POST['closed'] ) : array();
+ $closed = array_filter( $closed );
+
+ $hidden = isset( $_POST['hidden'] ) ? explode( ',', $_POST['hidden'] ) : array();
+ $hidden = array_filter( $hidden );
+
+ $page = isset( $_POST['page'] ) ? $_POST['page'] : '';
+
+ if ( $page != sanitize_key( $page ) ) {
+ wp_die( 0 );
+ }
+
+ if ( ! $user = wp_get_current_user() ) {
+ wp_die( -1 );
+ }
+
+ if ( is_array( $closed ) ) {
+ update_user_option( $user->ID, "closedpostboxes_$page", $closed, true );
+ }
+
+ if ( is_array( $hidden ) ) {
+ $hidden = array_diff( $hidden, array( 'submitdiv', 'linksubmitdiv', 'manage-menu', 'create-menu' ) ); // postboxes that are always shown
+ update_user_option( $user->ID, "metaboxhidden_$page", $hidden, true );
+ }
+
+ wp_die( 1 );
+}
+
+/**
+ * Ajax handler for hidden columns.
+ *
+ * @since 3.1.0
+ */
+function wp_ajax_hidden_columns() {
+ check_ajax_referer( 'screen-options-nonce', 'screenoptionnonce' );
+ $page = isset( $_POST['page'] ) ? $_POST['page'] : '';
+
+ if ( $page != sanitize_key( $page ) ) {
+ wp_die( 0 );
+ }
+
+ if ( ! $user = wp_get_current_user() ) {
+ wp_die( -1 );
+ }
+
+ $hidden = ! empty( $_POST['hidden'] ) ? explode( ',', $_POST['hidden'] ) : array();
+ update_user_option( $user->ID, "manage{$page}columnshidden", $hidden, true );
+
+ wp_die( 1 );
+}
+
+/**
+ * Ajax handler for updating whether to display the welcome panel.
+ *
+ * @since 3.1.0
+ */
+function wp_ajax_update_welcome_panel() {
+ check_ajax_referer( 'welcome-panel-nonce', 'welcomepanelnonce' );
+
+ if ( ! current_user_can( 'edit_theme_options' ) ) {
+ wp_die( -1 );
+ }
+
+ update_user_meta( get_current_user_id(), 'show_welcome_panel', empty( $_POST['visible'] ) ? 0 : 1 );
+
+ wp_die( 1 );
+}
+
+/**
+ * Ajax handler for retrieving menu meta boxes.
+ *
+ * @since 3.1.0
+ */
+function wp_ajax_menu_get_metabox() {
+ if ( ! current_user_can( 'edit_theme_options' ) ) {
+ wp_die( -1 );
+ }
+
+ require_once ABSPATH . 'wp-admin/includes/nav-menu.php';
+
+ if ( isset( $_POST['item-type'] ) && 'post_type' == $_POST['item-type'] ) {
+ $type = 'posttype';
+ $callback = 'wp_nav_menu_item_post_type_meta_box';
+ $items = (array) get_post_types( array( 'show_in_nav_menus' => true ), 'object' );
+ } elseif ( isset( $_POST['item-type'] ) && 'taxonomy' == $_POST['item-type'] ) {
+ $type = 'taxonomy';
+ $callback = 'wp_nav_menu_item_taxonomy_meta_box';
+ $items = (array) get_taxonomies( array( 'show_ui' => true ), 'object' );
+ }
+
+ if ( ! empty( $_POST['item-object'] ) && isset( $items[ $_POST['item-object'] ] ) ) {
+ $menus_meta_box_object = $items[ $_POST['item-object'] ];
+
+ /** This filter is documented in wp-admin/includes/nav-menu.php */
+ $item = apply_filters( 'nav_menu_meta_box_object', $menus_meta_box_object );
+ ob_start();
+ call_user_func_array(
+ $callback,
+ array(
+ null,
+ array(
+ 'id' => 'add-' . $item->name,
+ 'title' => $item->labels->name,
+ 'callback' => $callback,
+ 'args' => $item,
+ ),
+ )
+ );
+
+ $markup = ob_get_clean();
+
+ echo wp_json_encode(
+ array(
+ 'replace-id' => $type . '-' . $item->name,
+ 'markup' => $markup,
+ )
+ );
+ }
+
+ wp_die();
+}
+
+/**
+ * Ajax handler for internal linking.
+ *
+ * @since 3.1.0
+ */
+function wp_ajax_wp_link_ajax() {
+ check_ajax_referer( 'internal-linking', '_ajax_linking_nonce' );
+
+ $args = array();
+
+ if ( isset( $_POST['search'] ) ) {
+ $args['s'] = wp_unslash( $_POST['search'] );
+ }
+
+ if ( isset( $_POST['term'] ) ) {
+ $args['s'] = wp_unslash( $_POST['term'] );
+ }
+
+ $args['pagenum'] = ! empty( $_POST['page'] ) ? absint( $_POST['page'] ) : 1;
+
+ if ( ! class_exists( '_WP_Editors', false ) ) {
+ require( ABSPATH . WPINC . '/class-wp-editor.php' );
+ }
+
+ $results = _WP_Editors::wp_link_query( $args );
+
+ if ( ! isset( $results ) ) {
+ wp_die( 0 );
+ }
+
+ echo wp_json_encode( $results );
+ echo "\n";
+
+ wp_die();
+}
+
+/**
+ * Ajax handler for menu locations save.
+ *
+ * @since 3.1.0
+ */
+function wp_ajax_menu_locations_save() {
+ if ( ! current_user_can( 'edit_theme_options' ) ) {
+ wp_die( -1 );
+ }
+ check_ajax_referer( 'add-menu_item', 'menu-settings-column-nonce' );
+ if ( ! isset( $_POST['menu-locations'] ) ) {
+ wp_die( 0 );
+ }
+ set_theme_mod( 'nav_menu_locations', array_map( 'absint', $_POST['menu-locations'] ) );
+ wp_die( 1 );
+}
+
+/**
+ * Ajax handler for saving the meta box order.
+ *
+ * @since 3.1.0
+ */
+function wp_ajax_meta_box_order() {
+ check_ajax_referer( 'meta-box-order' );
+ $order = isset( $_POST['order'] ) ? (array) $_POST['order'] : false;
+ $page_columns = isset( $_POST['page_columns'] ) ? $_POST['page_columns'] : 'auto';
+
+ if ( $page_columns != 'auto' ) {
+ $page_columns = (int) $page_columns;
+ }
+
+ $page = isset( $_POST['page'] ) ? $_POST['page'] : '';
+
+ if ( $page != sanitize_key( $page ) ) {
+ wp_die( 0 );
+ }
+
+ if ( ! $user = wp_get_current_user() ) {
+ wp_die( -1 );
+ }
+
+ if ( $order ) {
+ update_user_option( $user->ID, "meta-box-order_$page", $order, true );
+ }
+
+ if ( $page_columns ) {
+ update_user_option( $user->ID, "screen_layout_$page", $page_columns, true );
+ }
+
+ wp_die( 1 );
+}
+
+/**
+ * Ajax handler for menu quick searching.
+ *
+ * @since 3.1.0
+ */
+function wp_ajax_menu_quick_search() {
+ if ( ! current_user_can( 'edit_theme_options' ) ) {
+ wp_die( -1 );
+ }
+
+ require_once ABSPATH . 'wp-admin/includes/nav-menu.php';
+
+ _wp_ajax_menu_quick_search( $_POST );
+
+ wp_die();
+}
+
+/**
+ * Ajax handler to retrieve a permalink.
+ *
+ * @since 3.1.0
+ */
+function wp_ajax_get_permalink() {
+ check_ajax_referer( 'getpermalink', 'getpermalinknonce' );
+ $post_id = isset( $_POST['post_id'] ) ? intval( $_POST['post_id'] ) : 0;
+ wp_die( get_preview_post_link( $post_id ) );
+}
+
+/**
+ * Ajax handler to retrieve a sample permalink.
+ *
+ * @since 3.1.0
+ */
+function wp_ajax_sample_permalink() {
+ check_ajax_referer( 'samplepermalink', 'samplepermalinknonce' );
+ $post_id = isset( $_POST['post_id'] ) ? intval( $_POST['post_id'] ) : 0;
+ $title = isset( $_POST['new_title'] ) ? $_POST['new_title'] : '';
+ $slug = isset( $_POST['new_slug'] ) ? $_POST['new_slug'] : null;
+ wp_die( get_sample_permalink_html( $post_id, $title, $slug ) );
+}
+
+/**
+ * Ajax handler for Quick Edit saving a post from a list table.
+ *
+ * @since 3.1.0
+ *
+ * @global string $mode List table view mode.
+ */
+function wp_ajax_inline_save() {
+ global $mode;
+
+ check_ajax_referer( 'inlineeditnonce', '_inline_edit' );
+
+ if ( ! isset( $_POST['post_ID'] ) || ! ( $post_ID = (int) $_POST['post_ID'] ) ) {
+ wp_die();
+ }
+
+ if ( 'page' == $_POST['post_type'] ) {
+ if ( ! current_user_can( 'edit_page', $post_ID ) ) {
+ wp_die( __( 'Sorry, you are not allowed to edit this page.' ) );
+ }
+ } else {
+ if ( ! current_user_can( 'edit_post', $post_ID ) ) {
+ wp_die( __( 'Sorry, you are not allowed to edit this post.' ) );
+ }
+ }
+
+ if ( $last = wp_check_post_lock( $post_ID ) ) {
+ $last_user = get_userdata( $last );
+ $last_user_name = $last_user ? $last_user->display_name : __( 'Someone' );
+
+ /* translators: %s: user who is currently editing the post */
+ $msg_template = __( 'Saving is disabled: %s is currently editing this post.' );
+ if ( $_POST['post_type'] == 'page' ) {
+ /* translators: %s: user who is currently editing the page */
+ $msg_template = __( 'Saving is disabled: %s is currently editing this page.' );
+ }
+
+ printf( $msg_template, esc_html( $last_user_name ) );
+ wp_die();
+ }
+
+ $data = &$_POST;
+
+ $post = get_post( $post_ID, ARRAY_A );
+
+ // Since it's coming from the database.
+ $post = wp_slash( $post );
+
+ $data['content'] = $post['post_content'];
+ $data['excerpt'] = $post['post_excerpt'];
+
+ // Rename.
+ $data['user_ID'] = get_current_user_id();
+
+ if ( isset( $data['post_parent'] ) ) {
+ $data['parent_id'] = $data['post_parent'];
+ }
+
+ // Status.
+ if ( isset( $data['keep_private'] ) && 'private' == $data['keep_private'] ) {
+ $data['visibility'] = 'private';
+ $data['post_status'] = 'private';
+ } else {
+ $data['post_status'] = $data['_status'];
+ }
+
+ if ( empty( $data['comment_status'] ) ) {
+ $data['comment_status'] = 'closed';
+ }
+ if ( empty( $data['ping_status'] ) ) {
+ $data['ping_status'] = 'closed';
+ }
+
+ // Exclude terms from taxonomies that are not supposed to appear in Quick Edit.
+ if ( ! empty( $data['tax_input'] ) ) {
+ foreach ( $data['tax_input'] as $taxonomy => $terms ) {
+ $tax_object = get_taxonomy( $taxonomy );
+ /** This filter is documented in wp-admin/includes/class-wp-posts-list-table.php */
+ if ( ! apply_filters( 'quick_edit_show_taxonomy', $tax_object->show_in_quick_edit, $taxonomy, $post['post_type'] ) ) {
+ unset( $data['tax_input'][ $taxonomy ] );
+ }
+ }
+ }
+
+ // Hack: wp_unique_post_slug() doesn't work for drafts, so we will fake that our post is published.
+ if ( ! empty( $data['post_name'] ) && in_array( $post['post_status'], array( 'draft', 'pending' ) ) ) {
+ $post['post_status'] = 'publish';
+ $data['post_name'] = wp_unique_post_slug( $data['post_name'], $post['ID'], $post['post_status'], $post['post_type'], $post['post_parent'] );
+ }
+
+ // Update the post.
+ edit_post();
+
+ $wp_list_table = _get_list_table( 'WP_Posts_List_Table', array( 'screen' => $_POST['screen'] ) );
+
+ $mode = $_POST['post_view'] === 'excerpt' ? 'excerpt' : 'list';
+
+ $level = 0;
+ if ( is_post_type_hierarchical( $wp_list_table->screen->post_type ) ) {
+ $request_post = array( get_post( $_POST['post_ID'] ) );
+ $parent = $request_post[0]->post_parent;
+
+ while ( $parent > 0 ) {
+ $parent_post = get_post( $parent );
+ $parent = $parent_post->post_parent;
+ $level++;
+ }
+ }
+
+ $wp_list_table->display_rows( array( get_post( $_POST['post_ID'] ) ), $level );
+
+ wp_die();
+}
+
+/**
+ * Ajax handler for quick edit saving for a term.
+ *
+ * @since 3.1.0
+ */
+function wp_ajax_inline_save_tax() {
+ check_ajax_referer( 'taxinlineeditnonce', '_inline_edit' );
+
+ $taxonomy = sanitize_key( $_POST['taxonomy'] );
+ $tax = get_taxonomy( $taxonomy );
+ if ( ! $tax ) {
+ wp_die( 0 );
+ }
+
+ if ( ! isset( $_POST['tax_ID'] ) || ! ( $id = (int) $_POST['tax_ID'] ) ) {
+ wp_die( -1 );
+ }
+
+ if ( ! current_user_can( 'edit_term', $id ) ) {
+ wp_die( -1 );
+ }
+
+ $wp_list_table = _get_list_table( 'WP_Terms_List_Table', array( 'screen' => 'edit-' . $taxonomy ) );
+
+ $tag = get_term( $id, $taxonomy );
+ $_POST['description'] = $tag->description;
+
+ $updated = wp_update_term( $id, $taxonomy, $_POST );
+ if ( $updated && ! is_wp_error( $updated ) ) {
+ $tag = get_term( $updated['term_id'], $taxonomy );
+ if ( ! $tag || is_wp_error( $tag ) ) {
+ if ( is_wp_error( $tag ) && $tag->get_error_message() ) {
+ wp_die( $tag->get_error_message() );
+ }
+ wp_die( __( 'Item not updated.' ) );
+ }
+ } else {
+ if ( is_wp_error( $updated ) && $updated->get_error_message() ) {
+ wp_die( $updated->get_error_message() );
+ }
+ wp_die( __( 'Item not updated.' ) );
+ }
+ $level = 0;
+ $parent = $tag->parent;
+ while ( $parent > 0 ) {
+ $parent_tag = get_term( $parent, $taxonomy );
+ $parent = $parent_tag->parent;
+ $level++;
+ }
+ $wp_list_table->single_row( $tag, $level );
+ wp_die();
+}
+
+/**
+ * Ajax handler for querying posts for the Find Posts modal.
+ *
+ * @see window.findPosts
+ *
+ * @since 3.1.0
+ */
+function wp_ajax_find_posts() {
+ check_ajax_referer( 'find-posts' );
+
+ $post_types = get_post_types( array( 'public' => true ), 'objects' );
+ unset( $post_types['attachment'] );
+
+ $s = wp_unslash( $_POST['ps'] );
+ $args = array(
+ 'post_type' => array_keys( $post_types ),
+ 'post_status' => 'any',
+ 'posts_per_page' => 50,
+ );
+ if ( '' !== $s ) {
+ $args['s'] = $s;
+ }
+
+ $posts = get_posts( $args );
+
+ if ( ! $posts ) {
+ wp_send_json_error( __( 'No items found.' ) );
+ }
+
+ $html = '<table class="widefat"><thead><tr><th class="found-radio"><br /></th><th>' . __( 'Title' ) . '</th><th class="no-break">' . __( 'Type' ) . '</th><th class="no-break">' . __( 'Date' ) . '</th><th class="no-break">' . __( 'Status' ) . '</th></tr></thead><tbody>';
+ $alt = '';
+ foreach ( $posts as $post ) {
+ $title = trim( $post->post_title ) ? $post->post_title : __( '(no title)' );
+ $alt = ( 'alternate' == $alt ) ? '' : 'alternate';
+
+ switch ( $post->post_status ) {
+ case 'publish':
+ case 'private':
+ $stat = __( 'Published' );
+ break;
+ case 'future':
+ $stat = __( 'Scheduled' );
+ break;
+ case 'pending':
+ $stat = __( 'Pending Review' );
+ break;
+ case 'draft':
+ $stat = __( 'Draft' );
+ break;
+ }
+
+ if ( '0000-00-00 00:00:00' == $post->post_date ) {
+ $time = '';
+ } else {
+ /* translators: date format in table columns, see https://secure.php.net/date */
+ $time = mysql2date( __( 'Y/m/d' ), $post->post_date );
+ }
+
+ $html .= '<tr class="' . trim( 'found-posts ' . $alt ) . '"><td class="found-radio"><input type="radio" id="found-' . $post->ID . '" name="found_post_id" value="' . esc_attr( $post->ID ) . '"></td>';
+ $html .= '<td><label for="found-' . $post->ID . '">' . esc_html( $title ) . '</label></td><td class="no-break">' . esc_html( $post_types[ $post->post_type ]->labels->singular_name ) . '</td><td class="no-break">' . esc_html( $time ) . '</td><td class="no-break">' . esc_html( $stat ) . ' </td></tr>' . "\n\n";
+ }
+
+ $html .= '</tbody></table>';
+
+ wp_send_json_success( $html );
+}
+
+/**
+ * Ajax handler for saving the widgets order.
+ *
+ * @since 3.1.0
+ */
+function wp_ajax_widgets_order() {
+ check_ajax_referer( 'save-sidebar-widgets', 'savewidgets' );
+
+ if ( ! current_user_can( 'edit_theme_options' ) ) {
+ wp_die( -1 );
+ }
+
+ unset( $_POST['savewidgets'], $_POST['action'] );
+
+ // Save widgets order for all sidebars.
+ if ( is_array( $_POST['sidebars'] ) ) {
+ $sidebars = array();
+ foreach ( wp_unslash( $_POST['sidebars'] ) as $key => $val ) {
+ $sb = array();
+ if ( ! empty( $val ) ) {
+ $val = explode( ',', $val );
+ foreach ( $val as $k => $v ) {
+ if ( strpos( $v, 'widget-' ) === false ) {
+ continue;
+ }
+
+ $sb[ $k ] = substr( $v, strpos( $v, '_' ) + 1 );
+ }
+ }
+ $sidebars[ $key ] = $sb;
+ }
+ wp_set_sidebars_widgets( $sidebars );
+ wp_die( 1 );
+ }
+
+ wp_die( -1 );
+}
+
+/**
+ * Ajax handler for saving a widget.
+ *
+ * @since 3.1.0
+ *
+ * @global array $wp_registered_widgets
+ * @global array $wp_registered_widget_controls
+ * @global array $wp_registered_widget_updates
+ */
+function wp_ajax_save_widget() {
+ global $wp_registered_widgets, $wp_registered_widget_controls, $wp_registered_widget_updates;
+
+ check_ajax_referer( 'save-sidebar-widgets', 'savewidgets' );
+
+ if ( ! current_user_can( 'edit_theme_options' ) || ! isset( $_POST['id_base'] ) ) {
+ wp_die( -1 );
+ }
+
+ unset( $_POST['savewidgets'], $_POST['action'] );
+
+ /**
+ * Fires early when editing the widgets displayed in sidebars.
+ *
+ * @since 2.8.0
+ */
+ do_action( 'load-widgets.php' );
+
+ /**
+ * Fires early when editing the widgets displayed in sidebars.
+ *
+ * @since 2.8.0
+ */
+ do_action( 'widgets.php' );
+
+ /** This action is documented in wp-admin/widgets.php */
+ do_action( 'sidebar_admin_setup' );
+
+ $id_base = wp_unslash( $_POST['id_base'] );
+ $widget_id = wp_unslash( $_POST['widget-id'] );
+ $sidebar_id = $_POST['sidebar'];
+ $multi_number = ! empty( $_POST['multi_number'] ) ? (int) $_POST['multi_number'] : 0;
+ $settings = isset( $_POST[ 'widget-' . $id_base ] ) && is_array( $_POST[ 'widget-' . $id_base ] ) ? $_POST[ 'widget-' . $id_base ] : false;
+ $error = '<p>' . __( 'An error has occurred. Please reload the page and try again.' ) . '</p>';
+
+ $sidebars = wp_get_sidebars_widgets();
+ $sidebar = isset( $sidebars[ $sidebar_id ] ) ? $sidebars[ $sidebar_id ] : array();
+
+ // Delete.
+ if ( isset( $_POST['delete_widget'] ) && $_POST['delete_widget'] ) {
+
+ if ( ! isset( $wp_registered_widgets[ $widget_id ] ) ) {
+ wp_die( $error );
+ }
+
+ $sidebar = array_diff( $sidebar, array( $widget_id ) );
+ $_POST = array(
+ 'sidebar' => $sidebar_id,
+ 'widget-' . $id_base => array(),
+ 'the-widget-id' => $widget_id,
+ 'delete_widget' => '1',
+ );
+
+ /** This action is documented in wp-admin/widgets.php */
+ do_action( 'delete_widget', $widget_id, $sidebar_id, $id_base );
+
+ } elseif ( $settings && preg_match( '/__i__|%i%/', key( $settings ) ) ) {
+ if ( ! $multi_number ) {
+ wp_die( $error );
+ }
+
+ $_POST[ 'widget-' . $id_base ] = array( $multi_number => reset( $settings ) );
+ $widget_id = $id_base . '-' . $multi_number;
+ $sidebar[] = $widget_id;
+ }
+ $_POST['widget-id'] = $sidebar;
+
+ foreach ( (array) $wp_registered_widget_updates as $name => $control ) {
+
+ if ( $name == $id_base ) {
+ if ( ! is_callable( $control['callback'] ) ) {
+ continue;
+ }
+
+ ob_start();
+ call_user_func_array( $control['callback'], $control['params'] );
+ ob_end_clean();
+ break;
+ }
+ }
+
+ if ( isset( $_POST['delete_widget'] ) && $_POST['delete_widget'] ) {
+ $sidebars[ $sidebar_id ] = $sidebar;
+ wp_set_sidebars_widgets( $sidebars );
+ echo "deleted:$widget_id";
+ wp_die();
+ }
+
+ if ( ! empty( $_POST['add_new'] ) ) {
+ wp_die();
+ }
+
+ if ( $form = $wp_registered_widget_controls[ $widget_id ] ) {
+ call_user_func_array( $form['callback'], $form['params'] );
+ }
+
+ wp_die();
+}
+
+/**
+ * Ajax handler for saving a widget.
+ *
+ * @since 3.9.0
+ *
+ * @global WP_Customize_Manager $wp_customize
+ */
+function wp_ajax_update_widget() {
+ global $wp_customize;
+ $wp_customize->widgets->wp_ajax_update_widget();
+}
+
+/**
+ * Ajax handler for removing inactive widgets.
+ *
+ * @since 4.4.0
+ */
+function wp_ajax_delete_inactive_widgets() {
+ check_ajax_referer( 'remove-inactive-widgets', 'removeinactivewidgets' );
+
+ if ( ! current_user_can( 'edit_theme_options' ) ) {
+ wp_die( -1 );
+ }
+
+ unset( $_POST['removeinactivewidgets'], $_POST['action'] );
+ /** This action is documented in wp-admin/includes/ajax-actions.php */
+ do_action( 'load-widgets.php' );
+ /** This action is documented in wp-admin/includes/ajax-actions.php */
+ do_action( 'widgets.php' );
+ /** This action is documented in wp-admin/widgets.php */
+ do_action( 'sidebar_admin_setup' );
+
+ $sidebars_widgets = wp_get_sidebars_widgets();
+
+ foreach ( $sidebars_widgets['wp_inactive_widgets'] as $key => $widget_id ) {
+ $pieces = explode( '-', $widget_id );
+ $multi_number = array_pop( $pieces );
+ $id_base = implode( '-', $pieces );
+ $widget = get_option( 'widget_' . $id_base );
+ unset( $widget[ $multi_number ] );
+ update_option( 'widget_' . $id_base, $widget );
+ unset( $sidebars_widgets['wp_inactive_widgets'][ $key ] );
+ }
+
+ wp_set_sidebars_widgets( $sidebars_widgets );
+
+ wp_die();
+}
+
+/**
+ * Ajax handler for uploading attachments
+ *
+ * @since 3.3.0
+ */
+function wp_ajax_upload_attachment() {
+ check_ajax_referer( 'media-form' );
+ /*
+ * This function does not use wp_send_json_success() / wp_send_json_error()
+ * as the html4 Plupload handler requires a text/html content-type for older IE.
+ * See https://core.trac.wordpress.org/ticket/31037
+ */
+
+ if ( ! current_user_can( 'upload_files' ) ) {
+ echo wp_json_encode(
+ array(
+ 'success' => false,
+ 'data' => array(
+ 'message' => __( 'Sorry, you are not allowed to upload files.' ),
+ 'filename' => esc_html( $_FILES['async-upload']['name'] ),
+ ),
+ )
+ );
+
+ wp_die();
+ }
+
+ if ( isset( $_REQUEST['post_id'] ) ) {
+ $post_id = $_REQUEST['post_id'];
+ if ( ! current_user_can( 'edit_post', $post_id ) ) {
+ echo wp_json_encode(
+ array(
+ 'success' => false,
+ 'data' => array(
+ 'message' => __( 'Sorry, you are not allowed to attach files to this post.' ),
+ 'filename' => esc_html( $_FILES['async-upload']['name'] ),
+ ),
+ )
+ );
+
+ wp_die();
+ }
+ } else {
+ $post_id = null;
+ }
+
+ $post_data = ! empty( $_REQUEST['post_data'] ) ? _wp_get_allowed_postdata( _wp_translate_postdata( false, (array) $_REQUEST['post_data'] ) ) : array();
+
+ if ( is_wp_error( $post_data ) ) {
+ wp_die( $post_data->get_error_message() );
+ }
+
+ // If the context is custom header or background, make sure the uploaded file is an image.
+ if ( isset( $post_data['context'] ) && in_array( $post_data['context'], array( 'custom-header', 'custom-background' ) ) ) {
+ $wp_filetype = wp_check_filetype_and_ext( $_FILES['async-upload']['tmp_name'], $_FILES['async-upload']['name'] );
+ if ( ! wp_match_mime_types( 'image', $wp_filetype['type'] ) ) {
+ echo wp_json_encode(
+ array(
+ 'success' => false,
+ 'data' => array(
+ 'message' => __( 'The uploaded file is not a valid image. Please try again.' ),
+ 'filename' => esc_html( $_FILES['async-upload']['name'] ),
+ ),
+ )
+ );
+
+ wp_die();
+ }
+ }
+
+ $attachment_id = media_handle_upload( 'async-upload', $post_id, $post_data );
+
+ if ( is_wp_error( $attachment_id ) ) {
+ echo wp_json_encode(
+ array(
+ 'success' => false,
+ 'data' => array(
+ 'message' => $attachment_id->get_error_message(),
+ 'filename' => esc_html( $_FILES['async-upload']['name'] ),
+ ),
+ )
+ );
+
+ wp_die();
+ }
+
+ if ( isset( $post_data['context'] ) && isset( $post_data['theme'] ) ) {
+ if ( 'custom-background' === $post_data['context'] ) {
+ update_post_meta( $attachment_id, '_wp_attachment_is_custom_background', $post_data['theme'] );
+ }
+
+ if ( 'custom-header' === $post_data['context'] ) {
+ update_post_meta( $attachment_id, '_wp_attachment_is_custom_header', $post_data['theme'] );
+ }
+ }
+
+ if ( ! $attachment = wp_prepare_attachment_for_js( $attachment_id ) ) {
+ wp_die();
+ }
+
+ echo wp_json_encode(
+ array(
+ 'success' => true,
+ 'data' => $attachment,
+ )
+ );
+
+ wp_die();
+}
+
+/**
+ * Ajax handler for image editing.
+ *
+ * @since 3.1.0
+ */
+function wp_ajax_image_editor() {
+ $attachment_id = intval( $_POST['postid'] );
+ if ( empty( $attachment_id ) || ! current_user_can( 'edit_post', $attachment_id ) ) {
+ wp_die( -1 );
+ }
+
+ check_ajax_referer( "image_editor-$attachment_id" );
+ include_once( ABSPATH . 'wp-admin/includes/image-edit.php' );
+
+ $msg = false;
+ switch ( $_POST['do'] ) {
+ case 'save':
+ $msg = wp_save_image( $attachment_id );
+ $msg = wp_json_encode( $msg );
+ wp_die( $msg );
+ break;
+ case 'scale':
+ $msg = wp_save_image( $attachment_id );
+ break;
+ case 'restore':
+ $msg = wp_restore_image( $attachment_id );
+ break;
+ }
+
+ wp_image_editor( $attachment_id, $msg );
+ wp_die();
+}
+
+/**
+ * Ajax handler for setting the featured image.
+ *
+ * @since 3.1.0
+ */
+function wp_ajax_set_post_thumbnail() {
+ $json = ! empty( $_REQUEST['json'] ); // New-style request
+
+ $post_ID = intval( $_POST['post_id'] );
+ if ( ! current_user_can( 'edit_post', $post_ID ) ) {
+ wp_die( -1 );
+ }
+
+ $thumbnail_id = intval( $_POST['thumbnail_id'] );
+
+ if ( $json ) {
+ check_ajax_referer( "update-post_$post_ID" );
+ } else {
+ check_ajax_referer( "set_post_thumbnail-$post_ID" );
+ }
+
+ if ( $thumbnail_id == '-1' ) {
+ if ( delete_post_thumbnail( $post_ID ) ) {
+ $return = _wp_post_thumbnail_html( null, $post_ID );
+ $json ? wp_send_json_success( $return ) : wp_die( $return );
+ } else {
+ wp_die( 0 );
+ }
+ }
+
+ if ( set_post_thumbnail( $post_ID, $thumbnail_id ) ) {
+ $return = _wp_post_thumbnail_html( $thumbnail_id, $post_ID );
+ $json ? wp_send_json_success( $return ) : wp_die( $return );
+ }
+
+ wp_die( 0 );
+}
+
+/**
+ * Ajax handler for retrieving HTML for the featured image.
+ *
+ * @since 4.6.0
+ */
+function wp_ajax_get_post_thumbnail_html() {
+ $post_ID = intval( $_POST['post_id'] );
+
+ check_ajax_referer( "update-post_$post_ID" );
+
+ if ( ! current_user_can( 'edit_post', $post_ID ) ) {
+ wp_die( -1 );
+ }
+
+ $thumbnail_id = intval( $_POST['thumbnail_id'] );
+
+ // For backward compatibility, -1 refers to no featured image.
+ if ( -1 === $thumbnail_id ) {
+ $thumbnail_id = null;
+ }
+
+ $return = _wp_post_thumbnail_html( $thumbnail_id, $post_ID );
+ wp_send_json_success( $return );
+}
+
+/**
+ * Ajax handler for setting the featured image for an attachment.
+ *
+ * @since 4.0.0
+ *
+ * @see set_post_thumbnail()
+ */
+function wp_ajax_set_attachment_thumbnail() {
+ if ( empty( $_POST['urls'] ) || ! is_array( $_POST['urls'] ) ) {
+ wp_send_json_error();
+ }
+
+ $thumbnail_id = (int) $_POST['thumbnail_id'];
+ if ( empty( $thumbnail_id ) ) {
+ wp_send_json_error();
+ }
+
+ $post_ids = array();
+ // For each URL, try to find its corresponding post ID.
+ foreach ( $_POST['urls'] as $url ) {
+ $post_id = attachment_url_to_postid( $url );
+ if ( ! empty( $post_id ) ) {
+ $post_ids[] = $post_id;
+ }
+ }
+
+ if ( empty( $post_ids ) ) {
+ wp_send_json_error();
+ }
+
+ $success = 0;
+ // For each found attachment, set its thumbnail.
+ foreach ( $post_ids as $post_id ) {
+ if ( ! current_user_can( 'edit_post', $post_id ) ) {
+ continue;
+ }
+
+ if ( set_post_thumbnail( $post_id, $thumbnail_id ) ) {
+ $success++;
+ }
+ }
+
+ if ( 0 === $success ) {
+ wp_send_json_error();
+ } else {
+ wp_send_json_success();
+ }
+
+ wp_send_json_error();
+}
+
+/**
+ * Ajax handler for date formatting.
+ *
+ * @since 3.1.0
+ */
+function wp_ajax_date_format() {
+ wp_die( date_i18n( sanitize_option( 'date_format', wp_unslash( $_POST['date'] ) ) ) );
+}
+
+/**
+ * Ajax handler for time formatting.
+ *
+ * @since 3.1.0
+ */
+function wp_ajax_time_format() {
+ wp_die( date_i18n( sanitize_option( 'time_format', wp_unslash( $_POST['date'] ) ) ) );
+}
+
+/**
+ * Ajax handler for saving posts from the fullscreen editor.
+ *
+ * @since 3.1.0
+ * @deprecated 4.3.0
+ */
+function wp_ajax_wp_fullscreen_save_post() {
+ $post_id = isset( $_POST['post_ID'] ) ? (int) $_POST['post_ID'] : 0;
+
+ $post = null;
+
+ if ( $post_id ) {
+ $post = get_post( $post_id );
+ }
+
+ check_ajax_referer( 'update-post_' . $post_id, '_wpnonce' );
+
+ $post_id = edit_post();
+
+ if ( is_wp_error( $post_id ) ) {
+ wp_send_json_error();
+ }
+
+ if ( $post ) {
+ $last_date = mysql2date( __( 'F j, Y' ), $post->post_modified );
+ $last_time = mysql2date( __( 'g:i a' ), $post->post_modified );
+ } else {
+ $last_date = date_i18n( __( 'F j, Y' ) );
+ $last_time = date_i18n( __( 'g:i a' ) );
+ }
+
+ if ( $last_id = get_post_meta( $post_id, '_edit_last', true ) ) {
+ $last_user = get_userdata( $last_id );
+ /* translators: 1: display_name of last user, 2: date of last edit, 3: time of last edit. */
+ $last_edited = sprintf( __( 'Last edited by %1$s on %2$s at %3$s' ), esc_html( $last_user->display_name ), $last_date, $last_time );
+ } else {
+ /* translators: 1: date of last edit, 2: time of last edit. */
+ $last_edited = sprintf( __( 'Last edited on %1$s at %2$s' ), $last_date, $last_time );
+ }
+
+ wp_send_json_success( array( 'last_edited' => $last_edited ) );
+}
+
+/**
+ * Ajax handler for removing a post lock.
+ *
+ * @since 3.1.0
+ */
+function wp_ajax_wp_remove_post_lock() {
+ if ( empty( $_POST['post_ID'] ) || empty( $_POST['active_post_lock'] ) ) {
+ wp_die( 0 );
+ }
+ $post_id = (int) $_POST['post_ID'];
+ if ( ! $post = get_post( $post_id ) ) {
+ wp_die( 0 );
+ }
+
+ check_ajax_referer( 'update-post_' . $post_id );
+
+ if ( ! current_user_can( 'edit_post', $post_id ) ) {
+ wp_die( -1 );
+ }
+
+ $active_lock = array_map( 'absint', explode( ':', $_POST['active_post_lock'] ) );
+ if ( $active_lock[1] != get_current_user_id() ) {
+ wp_die( 0 );
+ }
+
+ /**
+ * Filters the post lock window duration.
+ *
+ * @since 3.3.0
+ *
+ * @param int $interval The interval in seconds the post lock duration
+ * should last, plus 5 seconds. Default 150.
+ */
+ $new_lock = ( time() - apply_filters( 'wp_check_post_lock_window', 150 ) + 5 ) . ':' . $active_lock[1];
+ update_post_meta( $post_id, '_edit_lock', $new_lock, implode( ':', $active_lock ) );
+ wp_die( 1 );
+}
+
+/**
+ * Ajax handler for dismissing a WordPress pointer.
+ *
+ * @since 3.1.0
+ */
+function wp_ajax_dismiss_wp_pointer() {
+ $pointer = $_POST['pointer'];
+ if ( $pointer != sanitize_key( $pointer ) ) {
+ wp_die( 0 );
+ }
+
+ // check_ajax_referer( 'dismiss-pointer_' . $pointer );
+
+ $dismissed = array_filter( explode( ',', (string) get_user_meta( get_current_user_id(), 'dismissed_wp_pointers', true ) ) );
+
+ if ( in_array( $pointer, $dismissed ) ) {
+ wp_die( 0 );
+ }
+
+ $dismissed[] = $pointer;
+ $dismissed = implode( ',', $dismissed );
+
+ update_user_meta( get_current_user_id(), 'dismissed_wp_pointers', $dismissed );
+ wp_die( 1 );
+}
+
+/**
+ * Ajax handler for getting an attachment.
+ *
+ * @since 3.5.0
+ */
+function wp_ajax_get_attachment() {
+ if ( ! isset( $_REQUEST['id'] ) ) {
+ wp_send_json_error();
+ }
+
+ if ( ! $id = absint( $_REQUEST['id'] ) ) {
+ wp_send_json_error();
+ }
+
+ if ( ! $post = get_post( $id ) ) {
+ wp_send_json_error();
+ }
+
+ if ( 'attachment' != $post->post_type ) {
+ wp_send_json_error();
+ }
+
+ if ( ! current_user_can( 'upload_files' ) ) {
+ wp_send_json_error();
+ }
+
+ if ( ! $attachment = wp_prepare_attachment_for_js( $id ) ) {
+ wp_send_json_error();
+ }
+
+ wp_send_json_success( $attachment );
+}
+
+/**
+ * Ajax handler for querying attachments.
+ *
+ * @since 3.5.0
+ */
+function wp_ajax_query_attachments() {
+ if ( ! current_user_can( 'upload_files' ) ) {
+ wp_send_json_error();
+ }
+
+ $query = isset( $_REQUEST['query'] ) ? (array) $_REQUEST['query'] : array();
+ $keys = array(
+ 's',
+ 'order',
+ 'orderby',
+ 'posts_per_page',
+ 'paged',
+ 'post_mime_type',
+ 'post_parent',
+ 'author',
+ 'post__in',
+ 'post__not_in',
+ 'year',
+ 'monthnum',
+ );
+ foreach ( get_taxonomies_for_attachments( 'objects' ) as $t ) {
+ if ( $t->query_var && isset( $query[ $t->query_var ] ) ) {
+ $keys[] = $t->query_var;
+ }
+ }
+
+ $query = array_intersect_key( $query, array_flip( $keys ) );
+ $query['post_type'] = 'attachment';
+ if ( MEDIA_TRASH
+ && ! empty( $_REQUEST['query']['post_status'] )
+ && 'trash' === $_REQUEST['query']['post_status'] ) {
+ $query['post_status'] = 'trash';
+ } else {
+ $query['post_status'] = 'inherit';
+ }
+
+ if ( current_user_can( get_post_type_object( 'attachment' )->cap->read_private_posts ) ) {
+ $query['post_status'] .= ',private';
+ }
+
+ // Filter query clauses to include filenames.
+ if ( isset( $query['s'] ) ) {
+ add_filter( 'posts_clauses', '_filter_query_attachment_filenames' );
+ }
+
+ /**
+ * Filters the arguments passed to WP_Query during an Ajax
+ * call for querying attachments.
+ *
+ * @since 3.7.0
+ *
+ * @see WP_Query::parse_query()
+ *
+ * @param array $query An array of query variables.
+ */
+ $query = apply_filters( 'ajax_query_attachments_args', $query );
+ $query = new WP_Query( $query );
+
+ $posts = array_map( 'wp_prepare_attachment_for_js', $query->posts );
+ $posts = array_filter( $posts );
+
+ wp_send_json_success( $posts );
+}
+
+/**
+ * Ajax handler for updating attachment attributes.
+ *
+ * @since 3.5.0
+ */
+function wp_ajax_save_attachment() {
+ if ( ! isset( $_REQUEST['id'] ) || ! isset( $_REQUEST['changes'] ) ) {
+ wp_send_json_error();
+ }
+
+ if ( ! $id = absint( $_REQUEST['id'] ) ) {
+ wp_send_json_error();
+ }
+
+ check_ajax_referer( 'update-post_' . $id, 'nonce' );
+
+ if ( ! current_user_can( 'edit_post', $id ) ) {
+ wp_send_json_error();
+ }
+
+ $changes = $_REQUEST['changes'];
+ $post = get_post( $id, ARRAY_A );
+
+ if ( 'attachment' != $post['post_type'] ) {
+ wp_send_json_error();
+ }
+
+ if ( isset( $changes['parent'] ) ) {
+ $post['post_parent'] = $changes['parent'];
+ }
+
+ if ( isset( $changes['title'] ) ) {
+ $post['post_title'] = $changes['title'];
+ }
+
+ if ( isset( $changes['caption'] ) ) {
+ $post['post_excerpt'] = $changes['caption'];
+ }
+
+ if ( isset( $changes['description'] ) ) {
+ $post['post_content'] = $changes['description'];
+ }
+
+ if ( MEDIA_TRASH && isset( $changes['status'] ) ) {
+ $post['post_status'] = $changes['status'];
+ }
+
+ if ( isset( $changes['alt'] ) ) {
+ $alt = wp_unslash( $changes['alt'] );
+ if ( $alt != get_post_meta( $id, '_wp_attachment_image_alt', true ) ) {
+ $alt = wp_strip_all_tags( $alt, true );
+ update_post_meta( $id, '_wp_attachment_image_alt', wp_slash( $alt ) );
+ }
+ }
+
+ if ( wp_attachment_is( 'audio', $post['ID'] ) ) {
+ $changed = false;
+ $id3data = wp_get_attachment_metadata( $post['ID'] );
+ if ( ! is_array( $id3data ) ) {
+ $changed = true;
+ $id3data = array();
+ }
+ foreach ( wp_get_attachment_id3_keys( (object) $post, 'edit' ) as $key => $label ) {
+ if ( isset( $changes[ $key ] ) ) {
+ $changed = true;
+ $id3data[ $key ] = sanitize_text_field( wp_unslash( $changes[ $key ] ) );
+ }
+ }
+
+ if ( $changed ) {
+ wp_update_attachment_metadata( $id, $id3data );
+ }
+ }
+
+ if ( MEDIA_TRASH && isset( $changes['status'] ) && 'trash' === $changes['status'] ) {
+ wp_delete_post( $id );
+ } else {
+ wp_update_post( $post );
+ }
+
+ wp_send_json_success();
+}
+
+/**
+ * Ajax handler for saving backward compatible attachment attributes.
+ *
+ * @since 3.5.0
+ */
+function wp_ajax_save_attachment_compat() {
+ if ( ! isset( $_REQUEST['id'] ) ) {
+ wp_send_json_error();
+ }
+
+ if ( ! $id = absint( $_REQUEST['id'] ) ) {
+ wp_send_json_error();
+ }
+
+ if ( empty( $_REQUEST['attachments'] ) || empty( $_REQUEST['attachments'][ $id ] ) ) {
+ wp_send_json_error();
+ }
+ $attachment_data = $_REQUEST['attachments'][ $id ];
+
+ check_ajax_referer( 'update-post_' . $id, 'nonce' );
+
+ if ( ! current_user_can( 'edit_post', $id ) ) {
+ wp_send_json_error();
+ }
+
+ $post = get_post( $id, ARRAY_A );
+
+ if ( 'attachment' != $post['post_type'] ) {
+ wp_send_json_error();
+ }
+
+ /** This filter is documented in wp-admin/includes/media.php */
+ $post = apply_filters( 'attachment_fields_to_save', $post, $attachment_data );
+
+ if ( isset( $post['errors'] ) ) {
+ $errors = $post['errors']; // @todo return me and display me!
+ unset( $post['errors'] );
+ }
+
+ wp_update_post( $post );
+
+ foreach ( get_attachment_taxonomies( $post ) as $taxonomy ) {
+ if ( isset( $attachment_data[ $taxonomy ] ) ) {
+ wp_set_object_terms( $id, array_map( 'trim', preg_split( '/,+/', $attachment_data[ $taxonomy ] ) ), $taxonomy, false );
+ }
+ }
+
+ if ( ! $attachment = wp_prepare_attachment_for_js( $id ) ) {
+ wp_send_json_error();
+ }
+
+ wp_send_json_success( $attachment );
+}
+
+/**
+ * Ajax handler for saving the attachment order.
+ *
+ * @since 3.5.0
+ */
+function wp_ajax_save_attachment_order() {
+ if ( ! isset( $_REQUEST['post_id'] ) ) {
+ wp_send_json_error();
+ }
+
+ if ( ! $post_id = absint( $_REQUEST['post_id'] ) ) {
+ wp_send_json_error();
+ }
+
+ if ( empty( $_REQUEST['attachments'] ) ) {
+ wp_send_json_error();
+ }
+
+ check_ajax_referer( 'update-post_' . $post_id, 'nonce' );
+
+ $attachments = $_REQUEST['attachments'];
+
+ if ( ! current_user_can( 'edit_post', $post_id ) ) {
+ wp_send_json_error();
+ }
+
+ foreach ( $attachments as $attachment_id => $menu_order ) {
+ if ( ! current_user_can( 'edit_post', $attachment_id ) ) {
+ continue;
+ }
+ if ( ! $attachment = get_post( $attachment_id ) ) {
+ continue;
+ }
+ if ( 'attachment' != $attachment->post_type ) {
+ continue;
+ }
+
+ wp_update_post(
+ array(
+ 'ID' => $attachment_id,
+ 'menu_order' => $menu_order,
+ )
+ );
+ }
+
+ wp_send_json_success();
+}
+
+/**
+ * Ajax handler for sending an attachment to the editor.
+ *
+ * Generates the HTML to send an attachment to the editor.
+ * Backward compatible with the {@see 'media_send_to_editor'} filter
+ * and the chain of filters that follow.
+ *
+ * @since 3.5.0
+ */
+function wp_ajax_send_attachment_to_editor() {
+ check_ajax_referer( 'media-send-to-editor', 'nonce' );
+
+ $attachment = wp_unslash( $_POST['attachment'] );
+
+ $id = intval( $attachment['id'] );
+
+ if ( ! $post = get_post( $id ) ) {
+ wp_send_json_error();
+ }
+
+ if ( 'attachment' != $post->post_type ) {
+ wp_send_json_error();
+ }
+
+ if ( current_user_can( 'edit_post', $id ) ) {
+ // If this attachment is unattached, attach it. Primarily a back compat thing.
+ if ( 0 == $post->post_parent && $insert_into_post_id = intval( $_POST['post_id'] ) ) {
+ wp_update_post(
+ array(
+ 'ID' => $id,
+ 'post_parent' => $insert_into_post_id,
+ )
+ );
+ }
+ }
+
+ $url = empty( $attachment['url'] ) ? '' : $attachment['url'];
+ $rel = ( strpos( $url, 'attachment_id' ) || get_attachment_link( $id ) == $url );
+
+ remove_filter( 'media_send_to_editor', 'image_media_send_to_editor' );
+
+ if ( 'image' === substr( $post->post_mime_type, 0, 5 ) ) {
+ $align = isset( $attachment['align'] ) ? $attachment['align'] : 'none';
+ $size = isset( $attachment['image-size'] ) ? $attachment['image-size'] : 'medium';
+ $alt = isset( $attachment['image_alt'] ) ? $attachment['image_alt'] : '';
+
+ // No whitespace-only captions.
+ $caption = isset( $attachment['post_excerpt'] ) ? $attachment['post_excerpt'] : '';
+ if ( '' === trim( $caption ) ) {
+ $caption = '';
+ }
+
+ $title = ''; // We no longer insert title tags into <img> tags, as they are redundant.
+ $html = get_image_send_to_editor( $id, $caption, $title, $align, $url, $rel, $size, $alt );
+ } elseif ( wp_attachment_is( 'video', $post ) || wp_attachment_is( 'audio', $post ) ) {
+ $html = stripslashes_deep( $_POST['html'] );
+ } else {
+ $html = isset( $attachment['post_title'] ) ? $attachment['post_title'] : '';
+ $rel = $rel ? ' rel="attachment wp-att-' . $id . '"' : ''; // Hard-coded string, $id is already sanitized
+
+ if ( ! empty( $url ) ) {
+ $html = '<a href="' . esc_url( $url ) . '"' . $rel . '>' . $html . '</a>';
+ }
+ }
+
+ /** This filter is documented in wp-admin/includes/media.php */
+ $html = apply_filters( 'media_send_to_editor', $html, $id, $attachment );
+
+ wp_send_json_success( $html );
+}
+
+/**
+ * Ajax handler for sending a link to the editor.
+ *
+ * Generates the HTML to send a non-image embed link to the editor.
+ *
+ * Backward compatible with the following filters:
+ * - file_send_to_editor_url
+ * - audio_send_to_editor_url
+ * - video_send_to_editor_url
+ *
+ * @since 3.5.0
+ *
+ * @global WP_Post $post
+ * @global WP_Embed $wp_embed
+ */
+function wp_ajax_send_link_to_editor() {
+ global $post, $wp_embed;
+
+ check_ajax_referer( 'media-send-to-editor', 'nonce' );
+
+ if ( ! $src = wp_unslash( $_POST['src'] ) ) {
+ wp_send_json_error();
+ }
+
+ if ( ! strpos( $src, '://' ) ) {
+ $src = 'http://' . $src;
+ }
+
+ if ( ! $src = esc_url_raw( $src ) ) {
+ wp_send_json_error();
+ }
+
+ if ( ! $link_text = trim( wp_unslash( $_POST['link_text'] ) ) ) {
+ $link_text = wp_basename( $src );
+ }
+
+ $post = get_post( isset( $_POST['post_id'] ) ? $_POST['post_id'] : 0 );
+
+ // Ping WordPress for an embed.
+ $check_embed = $wp_embed->run_shortcode( '[embed]' . $src . '[/embed]' );
+
+ // Fallback that WordPress creates when no oEmbed was found.
+ $fallback = $wp_embed->maybe_make_link( $src );
+
+ if ( $check_embed !== $fallback ) {
+ // TinyMCE view for [embed] will parse this
+ $html = '[embed]' . $src . '[/embed]';
+ } elseif ( $link_text ) {
+ $html = '<a href="' . esc_url( $src ) . '">' . $link_text . '</a>';
+ } else {
+ $html = '';
+ }
+
+ // Figure out what filter to run:
+ $type = 'file';
+ if ( ( $ext = preg_replace( '/^.+?\.([^.]+)$/', '$1', $src ) ) && ( $ext_type = wp_ext2type( $ext ) )
+ && ( 'audio' == $ext_type || 'video' == $ext_type ) ) {
+ $type = $ext_type;
+ }
+
+ /** This filter is documented in wp-admin/includes/media.php */
+ $html = apply_filters( "{$type}_send_to_editor_url", $html, $src, $link_text );
+
+ wp_send_json_success( $html );
+}
+
+/**
+ * Ajax handler for the Heartbeat API.
+ *
+ * Runs when the user is logged in.
+ *
+ * @since 3.6.0
+ */
+function wp_ajax_heartbeat() {
+ if ( empty( $_POST['_nonce'] ) ) {
+ wp_send_json_error();
+ }
+
+ $response = $data = array();
+ $nonce_state = wp_verify_nonce( $_POST['_nonce'], 'heartbeat-nonce' );
+
+ // screen_id is the same as $current_screen->id and the JS global 'pagenow'.
+ if ( ! empty( $_POST['screen_id'] ) ) {
+ $screen_id = sanitize_key( $_POST['screen_id'] );
+ } else {
+ $screen_id = 'front';
+ }
+
+ if ( ! empty( $_POST['data'] ) ) {
+ $data = wp_unslash( (array) $_POST['data'] );
+ }
+
+ if ( 1 !== $nonce_state ) {
+ /**
+ * Filters the nonces to send to the New/Edit Post screen.
+ *
+ * @since 4.3.0
+ *
+ * @param array $response The Heartbeat response.
+ * @param array $data The $_POST data sent.
+ * @param string $screen_id The screen id.
+ */
+ $response = apply_filters( 'wp_refresh_nonces', $response, $data, $screen_id );
+
+ if ( false === $nonce_state ) {
+ // User is logged in but nonces have expired.
+ $response['nonces_expired'] = true;
+ wp_send_json( $response );
+ }
+ }
+
+ if ( ! empty( $data ) ) {
+ /**
+ * Filters the Heartbeat response received.
+ *
+ * @since 3.6.0
+ *
+ * @param array $response The Heartbeat response.
+ * @param array $data The $_POST data sent.
+ * @param string $screen_id The screen id.
+ */
+ $response = apply_filters( 'heartbeat_received', $response, $data, $screen_id );
+ }
+
+ /**
+ * Filters the Heartbeat response sent.
+ *
+ * @since 3.6.0
+ *
+ * @param array $response The Heartbeat response.
+ * @param string $screen_id The screen id.
+ */
+ $response = apply_filters( 'heartbeat_send', $response, $screen_id );
+
+ /**
+ * Fires when Heartbeat ticks in logged-in environments.
+ *
+ * Allows the transport to be easily replaced with long-polling.
+ *
+ * @since 3.6.0
+ *
+ * @param array $response The Heartbeat response.
+ * @param string $screen_id The screen id.
+ */
+ do_action( 'heartbeat_tick', $response, $screen_id );
+
+ // Send the current time according to the server
+ $response['server_time'] = time();
+
+ wp_send_json( $response );
+}
+
+/**
+ * Ajax handler for getting revision diffs.
+ *
+ * @since 3.6.0
+ */
+function wp_ajax_get_revision_diffs() {
+ require ABSPATH . 'wp-admin/includes/revision.php';
+
+ if ( ! $post = get_post( (int) $_REQUEST['post_id'] ) ) {
+ wp_send_json_error();
+ }
+
+ if ( ! current_user_can( 'edit_post', $post->ID ) ) {
+ wp_send_json_error();
+ }
+
+ // Really just pre-loading the cache here.
+ if ( ! $revisions = wp_get_post_revisions( $post->ID, array( 'check_enabled' => false ) ) ) {
+ wp_send_json_error();
+ }
+
+ $return = array();
+ @set_time_limit( 0 );
+
+ foreach ( $_REQUEST['compare'] as $compare_key ) {
+ list( $compare_from, $compare_to ) = explode( ':', $compare_key ); // from:to
+
+ $return[] = array(
+ 'id' => $compare_key,
+ 'fields' => wp_get_revision_ui_diff( $post, $compare_from, $compare_to ),
+ );
+ }
+ wp_send_json_success( $return );
+}
+
+/**
+ * Ajax handler for auto-saving the selected color scheme for
+ * a user's own profile.
+ *
+ * @since 3.8.0
+ *
+ * @global array $_wp_admin_css_colors
+ */
+function wp_ajax_save_user_color_scheme() {
+ global $_wp_admin_css_colors;
+
+ check_ajax_referer( 'save-color-scheme', 'nonce' );
+
+ $color_scheme = sanitize_key( $_POST['color_scheme'] );
+
+ if ( ! isset( $_wp_admin_css_colors[ $color_scheme ] ) ) {
+ wp_send_json_error();
+ }
+
+ $previous_color_scheme = get_user_meta( get_current_user_id(), 'admin_color', true );
+ update_user_meta( get_current_user_id(), 'admin_color', $color_scheme );
+
+ wp_send_json_success(
+ array(
+ 'previousScheme' => 'admin-color-' . $previous_color_scheme,
+ 'currentScheme' => 'admin-color-' . $color_scheme,
+ )
+ );
+}
+
+/**
+ * Ajax handler for getting themes from themes_api().
+ *
+ * @since 3.9.0
+ *
+ * @global array $themes_allowedtags
+ * @global array $theme_field_defaults
+ */
+function wp_ajax_query_themes() {
+ global $themes_allowedtags, $theme_field_defaults;
+
+ if ( ! current_user_can( 'install_themes' ) ) {
+ wp_send_json_error();
+ }
+
+ $args = wp_parse_args(
+ wp_unslash( $_REQUEST['request'] ),
+ array(
+ 'per_page' => 20,
+ 'fields' => array_merge(
+ (array) $theme_field_defaults,
+ array(
+ 'reviews_url' => true, // Explicitly request the reviews URL to be linked from the Add Themes screen.
+ )
+ ),
+ )
+ );
+
+ if ( isset( $args['browse'] ) && 'favorites' === $args['browse'] && ! isset( $args['user'] ) ) {
+ $user = get_user_option( 'wporg_favorites' );
+ if ( $user ) {
+ $args['user'] = $user;
+ }
+ }
+
+ $old_filter = isset( $args['browse'] ) ? $args['browse'] : 'search';
+
+ /** This filter is documented in wp-admin/includes/class-wp-theme-install-list-table.php */
+ $args = apply_filters( 'install_themes_table_api_args_' . $old_filter, $args );
+
+ $api = themes_api( 'query_themes', $args );
+
+ if ( is_wp_error( $api ) ) {
+ wp_send_json_error();
+ }
+
+ $update_php = network_admin_url( 'update.php?action=install-theme' );
+ foreach ( $api->themes as &$theme ) {
+ $theme->install_url = add_query_arg(
+ array(
+ 'theme' => $theme->slug,
+ '_wpnonce' => wp_create_nonce( 'install-theme_' . $theme->slug ),
+ ),
+ $update_php
+ );
+
+ if ( current_user_can( 'switch_themes' ) ) {
+ if ( is_multisite() ) {
+ $theme->activate_url = add_query_arg(
+ array(
+ 'action' => 'enable',
+ '_wpnonce' => wp_create_nonce( 'enable-theme_' . $theme->slug ),
+ 'theme' => $theme->slug,
+ ),
+ network_admin_url( 'themes.php' )
+ );
+ } else {
+ $theme->activate_url = add_query_arg(
+ array(
+ 'action' => 'activate',
+ '_wpnonce' => wp_create_nonce( 'switch-theme_' . $theme->slug ),
+ 'stylesheet' => $theme->slug,
+ ),
+ admin_url( 'themes.php' )
+ );
+ }
+ }
+
+ if ( ! is_multisite() && current_user_can( 'edit_theme_options' ) && current_user_can( 'customize' ) ) {
+ $theme->customize_url = add_query_arg(
+ array(
+ 'return' => urlencode( network_admin_url( 'theme-install.php', 'relative' ) ),
+ ),
+ wp_customize_url( $theme->slug )
+ );
+ }
+
+ $theme->name = wp_kses( $theme->name, $themes_allowedtags );
+ $theme->author = wp_kses( $theme->author['display_name'], $themes_allowedtags );
+ $theme->version = wp_kses( $theme->version, $themes_allowedtags );
+ $theme->description = wp_kses( $theme->description, $themes_allowedtags );
+ $theme->stars = wp_star_rating(
+ array(
+ 'rating' => $theme->rating,
+ 'type' => 'percent',
+ 'number' => $theme->num_ratings,
+ 'echo' => false,
+ )
+ );
+ $theme->num_ratings = number_format_i18n( $theme->num_ratings );
+ $theme->preview_url = set_url_scheme( $theme->preview_url );
+ }
+
+ wp_send_json_success( $api );
+}
+
+/**
+ * Apply [embed] Ajax handlers to a string.
+ *
+ * @since 4.0.0
+ *
+ * @global WP_Post $post Global $post.
+ * @global WP_Embed $wp_embed Embed API instance.
+ * @global WP_Scripts $wp_scripts
+ * @global int $content_width
+ */
+function wp_ajax_parse_embed() {
+ global $post, $wp_embed, $content_width;
+
+ if ( empty( $_POST['shortcode'] ) ) {
+ wp_send_json_error();
+ }
+ $post_id = isset( $_POST['post_ID'] ) ? intval( $_POST['post_ID'] ) : 0;
+ if ( $post_id > 0 ) {
+ $post = get_post( $post_id );
+ if ( ! $post || ! current_user_can( 'edit_post', $post->ID ) ) {
+ wp_send_json_error();
+ }
+ setup_postdata( $post );
+ } elseif ( ! current_user_can( 'edit_posts' ) ) { // See WP_oEmbed_Controller::get_proxy_item_permissions_check().
+ wp_send_json_error();
+ }
+
+ $shortcode = wp_unslash( $_POST['shortcode'] );
+
+ preg_match( '/' . get_shortcode_regex() . '/s', $shortcode, $matches );
+ $atts = shortcode_parse_atts( $matches[3] );
+ if ( ! empty( $matches[5] ) ) {
+ $url = $matches[5];
+ } elseif ( ! empty( $atts['src'] ) ) {
+ $url = $atts['src'];
+ } else {
+ $url = '';
+ }
+
+ $parsed = false;
+ $wp_embed->return_false_on_fail = true;
+
+ if ( 0 === $post_id ) {
+ /*
+ * Refresh oEmbeds cached outside of posts that are past their TTL.
+ * Posts are excluded because they have separate logic for refreshing
+ * their post meta caches. See WP_Embed::cache_oembed().
+ */
+ $wp_embed->usecache = false;
+ }
+
+ if ( is_ssl() && 0 === strpos( $url, 'http://' ) ) {
+ // Admin is ssl and the user pasted non-ssl URL.
+ // Check if the provider supports ssl embeds and use that for the preview.
+ $ssl_shortcode = preg_replace( '%^(\\[embed[^\\]]*\\])http://%i', '$1https://', $shortcode );
+ $parsed = $wp_embed->run_shortcode( $ssl_shortcode );
+
+ if ( ! $parsed ) {
+ $no_ssl_support = true;
+ }
+ }
+
+ // Set $content_width so any embeds fit in the destination iframe.
+ if ( isset( $_POST['maxwidth'] ) && is_numeric( $_POST['maxwidth'] ) && $_POST['maxwidth'] > 0 ) {
+ if ( ! isset( $content_width ) ) {
+ $content_width = intval( $_POST['maxwidth'] );
+ } else {
+ $content_width = min( $content_width, intval( $_POST['maxwidth'] ) );
+ }
+ }
+
+ if ( $url && ! $parsed ) {
+ $parsed = $wp_embed->run_shortcode( $shortcode );
+ }
+
+ if ( ! $parsed ) {
+ wp_send_json_error(
+ array(
+ 'type' => 'not-embeddable',
+ /* translators: %s: URL which cannot be embedded, between code tags */
+ 'message' => sprintf( __( '%s failed to embed.' ), '<code>' . esc_html( $url ) . '</code>' ),
+ )
+ );
+ }
+
+ if ( has_shortcode( $parsed, 'audio' ) || has_shortcode( $parsed, 'video' ) ) {
+ $styles = '';
+ $mce_styles = wpview_media_sandbox_styles();
+ foreach ( $mce_styles as $style ) {
+ $styles .= sprintf( '<link rel="stylesheet" href="%s"/>', $style );
+ }
+
+ $html = do_shortcode( $parsed );
+
+ global $wp_scripts;
+ if ( ! empty( $wp_scripts ) ) {
+ $wp_scripts->done = array();
+ }
+ ob_start();
+ wp_print_scripts( array( 'mediaelement-vimeo', 'wp-mediaelement' ) );
+ $scripts = ob_get_clean();
+
+ $parsed = $styles . $html . $scripts;
+ }
+
+ if ( ! empty( $no_ssl_support ) || ( is_ssl() && ( preg_match( '%<(iframe|script|embed) [^>]*src="http://%', $parsed ) ||
+ preg_match( '%<link [^>]*href="http://%', $parsed ) ) ) ) {
+ // Admin is ssl and the embed is not. Iframes, scripts, and other "active content" will be blocked.
+ wp_send_json_error(
+ array(
+ 'type' => 'not-ssl',
+ 'message' => __( 'This preview is unavailable in the editor.' ),
+ )
+ );
+ }
+
+ $return = array(
+ 'body' => $parsed,
+ 'attr' => $wp_embed->last_attr,
+ );
+
+ if ( strpos( $parsed, 'class="wp-embedded-content' ) ) {
+ if ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) {
+ $script_src = includes_url( 'js/wp-embed.js' );
+ } else {
+ $script_src = includes_url( 'js/wp-embed.min.js' );
+ }
+
+ $return['head'] = '<script src="' . $script_src . '"></script>';
+ $return['sandbox'] = true;
+ }
+
+ wp_send_json_success( $return );
+}
+
+/**
+ * @since 4.0.0
+ *
+ * @global WP_Post $post
+ * @global WP_Scripts $wp_scripts
+ */
+function wp_ajax_parse_media_shortcode() {
+ global $post, $wp_scripts;
+
+ if ( empty( $_POST['shortcode'] ) ) {
+ wp_send_json_error();
+ }
+
+ $shortcode = wp_unslash( $_POST['shortcode'] );
+
+ if ( ! empty( $_POST['post_ID'] ) ) {
+ $post = get_post( (int) $_POST['post_ID'] );
+ }
+
+ // the embed shortcode requires a post
+ if ( ! $post || ! current_user_can( 'edit_post', $post->ID ) ) {
+ if ( 'embed' === $shortcode ) {
+ wp_send_json_error();
+ }
+ } else {
+ setup_postdata( $post );
+ }
+
+ $parsed = do_shortcode( $shortcode );
+
+ if ( empty( $parsed ) ) {
+ wp_send_json_error(
+ array(
+ 'type' => 'no-items',
+ 'message' => __( 'No items found.' ),
+ )
+ );
+ }
+
+ $head = '';
+ $styles = wpview_media_sandbox_styles();
+
+ foreach ( $styles as $style ) {
+ $head .= '<link type="text/css" rel="stylesheet" href="' . $style . '">';
+ }
+
+ if ( ! empty( $wp_scripts ) ) {
+ $wp_scripts->done = array();
+ }
+
+ ob_start();
+
+ echo $parsed;
+
+ if ( 'playlist' === $_REQUEST['type'] ) {
+ wp_underscore_playlist_templates();
+
+ wp_print_scripts( 'wp-playlist' );
+ } else {
+ wp_print_scripts( array( 'mediaelement-vimeo', 'wp-mediaelement' ) );
+ }
+
+ wp_send_json_success(
+ array(
+ 'head' => $head,
+ 'body' => ob_get_clean(),
+ )
+ );
+}
+
+/**
+ * Ajax handler for destroying multiple open sessions for a user.
+ *
+ * @since 4.1.0
+ */
+function wp_ajax_destroy_sessions() {
+ $user = get_userdata( (int) $_POST['user_id'] );
+ if ( $user ) {
+ if ( ! current_user_can( 'edit_user', $user->ID ) ) {
+ $user = false;
+ } elseif ( ! wp_verify_nonce( $_POST['nonce'], 'update-user_' . $user->ID ) ) {
+ $user = false;
+ }
+ }
+
+ if ( ! $user ) {
+ wp_send_json_error(
+ array(
+ 'message' => __( 'Could not log out user sessions. Please try again.' ),
+ )
+ );
+ }
+
+ $sessions = WP_Session_Tokens::get_instance( $user->ID );
+
+ if ( $user->ID === get_current_user_id() ) {
+ $sessions->destroy_others( wp_get_session_token() );
+ $message = __( 'You are now logged out everywhere else.' );
+ } else {
+ $sessions->destroy_all();
+ /* translators: %s: User's display name. */
+ $message = sprintf( __( '%s has been logged out.' ), $user->display_name );
+ }
+
+ wp_send_json_success( array( 'message' => $message ) );
+}
+
+/**
+ * Ajax handler for cropping an image.
+ *
+ * @since 4.3.0
+ */
+function wp_ajax_crop_image() {
+ $attachment_id = absint( $_POST['id'] );
+
+ check_ajax_referer( 'image_editor-' . $attachment_id, 'nonce' );
+ if ( empty( $attachment_id ) || ! current_user_can( 'edit_post', $attachment_id ) ) {
+ wp_send_json_error();
+ }
+
+ $context = str_replace( '_', '-', $_POST['context'] );
+ $data = array_map( 'absint', $_POST['cropDetails'] );
+ $cropped = wp_crop_image( $attachment_id, $data['x1'], $data['y1'], $data['width'], $data['height'], $data['dst_width'], $data['dst_height'] );
+
+ if ( ! $cropped || is_wp_error( $cropped ) ) {
+ wp_send_json_error( array( 'message' => __( 'Image could not be processed.' ) ) );
+ }
+
+ switch ( $context ) {
+ case 'site-icon':
+ require_once ABSPATH . 'wp-admin/includes/class-wp-site-icon.php';
+ $wp_site_icon = new WP_Site_Icon();
+
+ // Skip creating a new attachment if the attachment is a Site Icon.
+ if ( get_post_meta( $attachment_id, '_wp_attachment_context', true ) == $context ) {
+
+ // Delete the temporary cropped file, we don't need it.
+ wp_delete_file( $cropped );
+
+ // Additional sizes in wp_prepare_attachment_for_js().
+ add_filter( 'image_size_names_choose', array( $wp_site_icon, 'additional_sizes' ) );
+ break;
+ }
+
+ /** This filter is documented in wp-admin/custom-header.php */
+ $cropped = apply_filters( 'wp_create_file_in_uploads', $cropped, $attachment_id ); // For replication.
+ $object = $wp_site_icon->create_attachment_object( $cropped, $attachment_id );
+ unset( $object['ID'] );
+
+ // Update the attachment.
+ add_filter( 'intermediate_image_sizes_advanced', array( $wp_site_icon, 'additional_sizes' ) );
+ $attachment_id = $wp_site_icon->insert_attachment( $object, $cropped );
+ remove_filter( 'intermediate_image_sizes_advanced', array( $wp_site_icon, 'additional_sizes' ) );
+
+ // Additional sizes in wp_prepare_attachment_for_js().
+ add_filter( 'image_size_names_choose', array( $wp_site_icon, 'additional_sizes' ) );
+ break;
+
+ default:
+ /**
+ * Fires before a cropped image is saved.
+ *
+ * Allows to add filters to modify the way a cropped image is saved.
+ *
+ * @since 4.3.0
+ *
+ * @param string $context The Customizer control requesting the cropped image.
+ * @param int $attachment_id The attachment ID of the original image.
+ * @param string $cropped Path to the cropped image file.
+ */
+ do_action( 'wp_ajax_crop_image_pre_save', $context, $attachment_id, $cropped );
+
+ /** This filter is documented in wp-admin/custom-header.php */
+ $cropped = apply_filters( 'wp_create_file_in_uploads', $cropped, $attachment_id ); // For replication.
+
+ $parent_url = wp_get_attachment_url( $attachment_id );
+ $url = str_replace( wp_basename( $parent_url ), wp_basename( $cropped ), $parent_url );
+
+ $size = @getimagesize( $cropped );
+ $image_type = ( $size ) ? $size['mime'] : 'image/jpeg';
+
+ $object = array(
+ 'post_title' => wp_basename( $cropped ),
+ 'post_content' => $url,
+ 'post_mime_type' => $image_type,
+ 'guid' => $url,
+ 'context' => $context,
+ );
+
+ $attachment_id = wp_insert_attachment( $object, $cropped );
+ $metadata = wp_generate_attachment_metadata( $attachment_id, $cropped );
+
+ /**
+ * Filters the cropped image attachment metadata.
+ *
+ * @since 4.3.0
+ *
+ * @see wp_generate_attachment_metadata()
+ *
+ * @param array $metadata Attachment metadata.
+ */
+ $metadata = apply_filters( 'wp_ajax_cropped_attachment_metadata', $metadata );
+ wp_update_attachment_metadata( $attachment_id, $metadata );
+
+ /**
+ * Filters the attachment ID for a cropped image.
+ *
+ * @since 4.3.0
+ *
+ * @param int $attachment_id The attachment ID of the cropped image.
+ * @param string $context The Customizer control requesting the cropped image.
+ */
+ $attachment_id = apply_filters( 'wp_ajax_cropped_attachment_id', $attachment_id, $context );
+ }
+
+ wp_send_json_success( wp_prepare_attachment_for_js( $attachment_id ) );
+}
+
+/**
+ * Ajax handler for generating a password.
+ *
+ * @since 4.4.0
+ */
+function wp_ajax_generate_password() {
+ wp_send_json_success( wp_generate_password( 24 ) );
+}
+
+/**
+ * Ajax handler for saving the user's WordPress.org username.
+ *
+ * @since 4.4.0
+ */
+function wp_ajax_save_wporg_username() {
+ if ( ! current_user_can( 'install_themes' ) && ! current_user_can( 'install_plugins' ) ) {
+ wp_send_json_error();
+ }
+
+ check_ajax_referer( 'save_wporg_username_' . get_current_user_id() );
+
+ $username = isset( $_REQUEST['username'] ) ? wp_unslash( $_REQUEST['username'] ) : false;
+
+ if ( ! $username ) {
+ wp_send_json_error();
+ }
+
+ wp_send_json_success( update_user_meta( get_current_user_id(), 'wporg_favorites', $username ) );
+}
+
+/**
+ * Ajax handler for installing a theme.
+ *
+ * @since 4.6.0
+ *
+ * @see Theme_Upgrader
+ *
+ * @global WP_Filesystem_Base $wp_filesystem WordPress filesystem subclass.
+ */
+function wp_ajax_install_theme() {
+ check_ajax_referer( 'updates' );
+
+ if ( empty( $_POST['slug'] ) ) {
+ wp_send_json_error(
+ array(
+ 'slug' => '',
+ 'errorCode' => 'no_theme_specified',
+ 'errorMessage' => __( 'No theme specified.' ),
+ )
+ );
+ }
+
+ $slug = sanitize_key( wp_unslash( $_POST['slug'] ) );
+
+ $status = array(
+ 'install' => 'theme',
+ 'slug' => $slug,
+ );
+
+ if ( ! current_user_can( 'install_themes' ) ) {
+ $status['errorMessage'] = __( 'Sorry, you are not allowed to install themes on this site.' );
+ wp_send_json_error( $status );
+ }
+
+ include_once( ABSPATH . 'wp-admin/includes/class-wp-upgrader.php' );
+ include_once( ABSPATH . 'wp-admin/includes/theme.php' );
+
+ $api = themes_api(
+ 'theme_information',
+ array(
+ 'slug' => $slug,
+ 'fields' => array( 'sections' => false ),
+ )
+ );
+
+ if ( is_wp_error( $api ) ) {
+ $status['errorMessage'] = $api->get_error_message();
+ wp_send_json_error( $status );
+ }
+
+ $skin = new WP_Ajax_Upgrader_Skin();
+ $upgrader = new Theme_Upgrader( $skin );
+ $result = $upgrader->install( $api->download_link );
+
+ if ( defined( 'WP_DEBUG' ) && WP_DEBUG ) {
+ $status['debug'] = $skin->get_upgrade_messages();
+ }
+
+ if ( is_wp_error( $result ) ) {
+ $status['errorCode'] = $result->get_error_code();
+ $status['errorMessage'] = $result->get_error_message();
+ wp_send_json_error( $status );
+ } elseif ( is_wp_error( $skin->result ) ) {
+ $status['errorCode'] = $skin->result->get_error_code();
+ $status['errorMessage'] = $skin->result->get_error_message();
+ wp_send_json_error( $status );
+ } elseif ( $skin->get_errors()->has_errors() ) {
+ $status['errorMessage'] = $skin->get_error_messages();
+ wp_send_json_error( $status );
+ } elseif ( is_null( $result ) ) {
+ global $wp_filesystem;
+
+ $status['errorCode'] = 'unable_to_connect_to_filesystem';
+ $status['errorMessage'] = __( 'Unable to connect to the filesystem. Please confirm your credentials.' );
+
+ // Pass through the error from WP_Filesystem if one was raised.
+ if ( $wp_filesystem instanceof WP_Filesystem_Base && is_wp_error( $wp_filesystem->errors ) && $wp_filesystem->errors->has_errors() ) {
+ $status['errorMessage'] = esc_html( $wp_filesystem->errors->get_error_message() );
+ }
+
+ wp_send_json_error( $status );
+ }
+
+ $status['themeName'] = wp_get_theme( $slug )->get( 'Name' );
+
+ if ( current_user_can( 'switch_themes' ) ) {
+ if ( is_multisite() ) {
+ $status['activateUrl'] = add_query_arg(
+ array(
+ 'action' => 'enable',
+ '_wpnonce' => wp_create_nonce( 'enable-theme_' . $slug ),
+ 'theme' => $slug,
+ ),
+ network_admin_url( 'themes.php' )
+ );
+ } else {
+ $status['activateUrl'] = add_query_arg(
+ array(
+ 'action' => 'activate',
+ '_wpnonce' => wp_create_nonce( 'switch-theme_' . $slug ),
+ 'stylesheet' => $slug,
+ ),
+ admin_url( 'themes.php' )
+ );
+ }
+ }
+
+ if ( ! is_multisite() && current_user_can( 'edit_theme_options' ) && current_user_can( 'customize' ) ) {
+ $status['customizeUrl'] = add_query_arg(
+ array(
+ 'return' => urlencode( network_admin_url( 'theme-install.php', 'relative' ) ),
+ ),
+ wp_customize_url( $slug )
+ );
+ }
+
+ /*
+ * See WP_Theme_Install_List_Table::_get_theme_status() if we wanted to check
+ * on post-installation status.
+ */
+ wp_send_json_success( $status );
+}
+
+/**
+ * Ajax handler for updating a theme.
+ *
+ * @since 4.6.0
+ *
+ * @see Theme_Upgrader
+ *
+ * @global WP_Filesystem_Base $wp_filesystem WordPress filesystem subclass.
+ */
+function wp_ajax_update_theme() {
+ check_ajax_referer( 'updates' );
+
+ if ( empty( $_POST['slug'] ) ) {
+ wp_send_json_error(
+ array(
+ 'slug' => '',
+ 'errorCode' => 'no_theme_specified',
+ 'errorMessage' => __( 'No theme specified.' ),
+ )
+ );
+ }
+
+ $stylesheet = preg_replace( '/[^A-z0-9_\-]/', '', wp_unslash( $_POST['slug'] ) );
+ $status = array(
+ 'update' => 'theme',
+ 'slug' => $stylesheet,
+ 'oldVersion' => '',
+ 'newVersion' => '',
+ );
+
+ if ( ! current_user_can( 'update_themes' ) ) {
+ $status['errorMessage'] = __( 'Sorry, you are not allowed to update themes for this site.' );
+ wp_send_json_error( $status );
+ }
+
+ $theme = wp_get_theme( $stylesheet );
+ if ( $theme->exists() ) {
+ $status['oldVersion'] = $theme->get( 'Version' );
+ }
+
+ include_once( ABSPATH . 'wp-admin/includes/class-wp-upgrader.php' );
+
+ $current = get_site_transient( 'update_themes' );
+ if ( empty( $current ) ) {
+ wp_update_themes();
+ }
+
+ $skin = new WP_Ajax_Upgrader_Skin();
+ $upgrader = new Theme_Upgrader( $skin );
+ $result = $upgrader->bulk_upgrade( array( $stylesheet ) );
+
+ if ( defined( 'WP_DEBUG' ) && WP_DEBUG ) {
+ $status['debug'] = $skin->get_upgrade_messages();
+ }
+
+ if ( is_wp_error( $skin->result ) ) {
+ $status['errorCode'] = $skin->result->get_error_code();
+ $status['errorMessage'] = $skin->result->get_error_message();
+ wp_send_json_error( $status );
+ } elseif ( $skin->get_errors()->has_errors() ) {
+ $status['errorMessage'] = $skin->get_error_messages();
+ wp_send_json_error( $status );
+ } elseif ( is_array( $result ) && ! empty( $result[ $stylesheet ] ) ) {
+
+ // Theme is already at the latest version.
+ if ( true === $result[ $stylesheet ] ) {
+ $status['errorMessage'] = $upgrader->strings['up_to_date'];
+ wp_send_json_error( $status );
+ }
+
+ $theme = wp_get_theme( $stylesheet );
+ if ( $theme->exists() ) {
+ $status['newVersion'] = $theme->get( 'Version' );
+ }
+
+ wp_send_json_success( $status );
+ } elseif ( false === $result ) {
+ global $wp_filesystem;
+
+ $status['errorCode'] = 'unable_to_connect_to_filesystem';
+ $status['errorMessage'] = __( 'Unable to connect to the filesystem. Please confirm your credentials.' );
+
+ // Pass through the error from WP_Filesystem if one was raised.
+ if ( $wp_filesystem instanceof WP_Filesystem_Base && is_wp_error( $wp_filesystem->errors ) && $wp_filesystem->errors->has_errors() ) {
+ $status['errorMessage'] = esc_html( $wp_filesystem->errors->get_error_message() );
+ }
+
+ wp_send_json_error( $status );
+ }
+
+ // An unhandled error occurred.
+ $status['errorMessage'] = __( 'Update failed.' );
+ wp_send_json_error( $status );
+}
+
+/**
+ * Ajax handler for deleting a theme.
+ *
+ * @since 4.6.0
+ *
+ * @see delete_theme()
+ *
+ * @global WP_Filesystem_Base $wp_filesystem WordPress filesystem subclass.
+ */
+function wp_ajax_delete_theme() {
+ check_ajax_referer( 'updates' );
+
+ if ( empty( $_POST['slug'] ) ) {
+ wp_send_json_error(
+ array(
+ 'slug' => '',
+ 'errorCode' => 'no_theme_specified',
+ 'errorMessage' => __( 'No theme specified.' ),
+ )
+ );
+ }
+
+ $stylesheet = preg_replace( '/[^A-z0-9_\-]/', '', wp_unslash( $_POST['slug'] ) );
+ $status = array(
+ 'delete' => 'theme',
+ 'slug' => $stylesheet,
+ );
+
+ if ( ! current_user_can( 'delete_themes' ) ) {
+ $status['errorMessage'] = __( 'Sorry, you are not allowed to delete themes on this site.' );
+ wp_send_json_error( $status );
+ }
+
+ if ( ! wp_get_theme( $stylesheet )->exists() ) {
+ $status['errorMessage'] = __( 'The requested theme does not exist.' );
+ wp_send_json_error( $status );
+ }
+
+ // Check filesystem credentials. `delete_theme()` will bail otherwise.
+ $url = wp_nonce_url( 'themes.php?action=delete&stylesheet=' . urlencode( $stylesheet ), 'delete-theme_' . $stylesheet );
+ ob_start();
+ $credentials = request_filesystem_credentials( $url );
+ ob_end_clean();
+ if ( false === $credentials || ! WP_Filesystem( $credentials ) ) {
+ global $wp_filesystem;
+
+ $status['errorCode'] = 'unable_to_connect_to_filesystem';
+ $status['errorMessage'] = __( 'Unable to connect to the filesystem. Please confirm your credentials.' );
+
+ // Pass through the error from WP_Filesystem if one was raised.
+ if ( $wp_filesystem instanceof WP_Filesystem_Base && is_wp_error( $wp_filesystem->errors ) && $wp_filesystem->errors->has_errors() ) {
+ $status['errorMessage'] = esc_html( $wp_filesystem->errors->get_error_message() );
+ }
+
+ wp_send_json_error( $status );
+ }
+
+ include_once( ABSPATH . 'wp-admin/includes/theme.php' );
+
+ $result = delete_theme( $stylesheet );
+
+ if ( is_wp_error( $result ) ) {
+ $status['errorMessage'] = $result->get_error_message();
+ wp_send_json_error( $status );
+ } elseif ( false === $result ) {
+ $status['errorMessage'] = __( 'Theme could not be deleted.' );
+ wp_send_json_error( $status );
+ }
+
+ wp_send_json_success( $status );
+}
+
+/**
+ * Ajax handler for installing a plugin.
+ *
+ * @since 4.6.0
+ *
+ * @see Plugin_Upgrader
+ *
+ * @global WP_Filesystem_Base $wp_filesystem WordPress filesystem subclass.
+ */
+function wp_ajax_install_plugin() {
+ check_ajax_referer( 'updates' );
+
+ if ( empty( $_POST['slug'] ) ) {
+ wp_send_json_error(
+ array(
+ 'slug' => '',
+ 'errorCode' => 'no_plugin_specified',
+ 'errorMessage' => __( 'No plugin specified.' ),
+ )
+ );
+ }
+
+ $status = array(
+ 'install' => 'plugin',
+ 'slug' => sanitize_key( wp_unslash( $_POST['slug'] ) ),
+ );
+
+ if ( ! current_user_can( 'install_plugins' ) ) {
+ $status['errorMessage'] = __( 'Sorry, you are not allowed to install plugins on this site.' );
+ wp_send_json_error( $status );
+ }
+
+ include_once( ABSPATH . 'wp-admin/includes/class-wp-upgrader.php' );
+ include_once( ABSPATH . 'wp-admin/includes/plugin-install.php' );
+
+ $api = plugins_api(
+ 'plugin_information',
+ array(
+ 'slug' => sanitize_key( wp_unslash( $_POST['slug'] ) ),
+ 'fields' => array(
+ 'sections' => false,
+ ),
+ )
+ );
+
+ if ( is_wp_error( $api ) ) {
+ $status['errorMessage'] = $api->get_error_message();
+ wp_send_json_error( $status );
+ }
+
+ $status['pluginName'] = $api->name;
+
+ $skin = new WP_Ajax_Upgrader_Skin();
+ $upgrader = new Plugin_Upgrader( $skin );
+ $result = $upgrader->install( $api->download_link );
+
+ if ( defined( 'WP_DEBUG' ) && WP_DEBUG ) {
+ $status['debug'] = $skin->get_upgrade_messages();
+ }
+
+ if ( is_wp_error( $result ) ) {
+ $status['errorCode'] = $result->get_error_code();
+ $status['errorMessage'] = $result->get_error_message();
+ wp_send_json_error( $status );
+ } elseif ( is_wp_error( $skin->result ) ) {
+ $status['errorCode'] = $skin->result->get_error_code();
+ $status['errorMessage'] = $skin->result->get_error_message();
+ wp_send_json_error( $status );
+ } elseif ( $skin->get_errors()->has_errors() ) {
+ $status['errorMessage'] = $skin->get_error_messages();
+ wp_send_json_error( $status );
+ } elseif ( is_null( $result ) ) {
+ global $wp_filesystem;
+
+ $status['errorCode'] = 'unable_to_connect_to_filesystem';
+ $status['errorMessage'] = __( 'Unable to connect to the filesystem. Please confirm your credentials.' );
+
+ // Pass through the error from WP_Filesystem if one was raised.
+ if ( $wp_filesystem instanceof WP_Filesystem_Base && is_wp_error( $wp_filesystem->errors ) && $wp_filesystem->errors->has_errors() ) {
+ $status['errorMessage'] = esc_html( $wp_filesystem->errors->get_error_message() );
+ }
+
+ wp_send_json_error( $status );
+ }
+
+ $install_status = install_plugin_install_status( $api );
+ $pagenow = isset( $_POST['pagenow'] ) ? sanitize_key( $_POST['pagenow'] ) : '';
+
+ // If installation request is coming from import page, do not return network activation link.
+ $plugins_url = ( 'import' === $pagenow ) ? admin_url( 'plugins.php' ) : network_admin_url( 'plugins.php' );
+
+ if ( current_user_can( 'activate_plugin', $install_status['file'] ) && is_plugin_inactive( $install_status['file'] ) ) {
+ $status['activateUrl'] = add_query_arg(
+ array(
+ '_wpnonce' => wp_create_nonce( 'activate-plugin_' . $install_status['file'] ),
+ 'action' => 'activate',
+ 'plugin' => $install_status['file'],
+ ),
+ $plugins_url
+ );
+ }
+
+ if ( is_multisite() && current_user_can( 'manage_network_plugins' ) && 'import' !== $pagenow ) {
+ $status['activateUrl'] = add_query_arg( array( 'networkwide' => 1 ), $status['activateUrl'] );
+ }
+
+ wp_send_json_success( $status );
+}
+
+/**
+ * Ajax handler for updating a plugin.
+ *
+ * @since 4.2.0
+ *
+ * @see Plugin_Upgrader
+ *
+ * @global WP_Filesystem_Base $wp_filesystem WordPress filesystem subclass.
+ */
+function wp_ajax_update_plugin() {
+ check_ajax_referer( 'updates' );
+
+ if ( empty( $_POST['plugin'] ) || empty( $_POST['slug'] ) ) {
+ wp_send_json_error(
+ array(
+ 'slug' => '',
+ 'errorCode' => 'no_plugin_specified',
+ 'errorMessage' => __( 'No plugin specified.' ),
+ )
+ );
+ }
+
+ $plugin = plugin_basename( sanitize_text_field( wp_unslash( $_POST['plugin'] ) ) );
+
+ $status = array(
+ 'update' => 'plugin',
+ 'slug' => sanitize_key( wp_unslash( $_POST['slug'] ) ),
+ 'oldVersion' => '',
+ 'newVersion' => '',
+ );
+
+ if ( ! current_user_can( 'update_plugins' ) || 0 !== validate_file( $plugin ) ) {
+ $status['errorMessage'] = __( 'Sorry, you are not allowed to update plugins for this site.' );
+ wp_send_json_error( $status );
+ }
+
+ $plugin_data = get_plugin_data( WP_PLUGIN_DIR . '/' . $plugin );
+ $status['plugin'] = $plugin;
+ $status['pluginName'] = $plugin_data['Name'];
+
+ if ( $plugin_data['Version'] ) {
+ /* translators: %s: Plugin version */
+ $status['oldVersion'] = sprintf( __( 'Version %s' ), $plugin_data['Version'] );
+ }
+
+ include_once( ABSPATH . 'wp-admin/includes/class-wp-upgrader.php' );
+
+ wp_update_plugins();
+
+ $skin = new WP_Ajax_Upgrader_Skin();
+ $upgrader = new Plugin_Upgrader( $skin );
+ $result = $upgrader->bulk_upgrade( array( $plugin ) );
+
+ if ( defined( 'WP_DEBUG' ) && WP_DEBUG ) {
+ $status['debug'] = $skin->get_upgrade_messages();
+ }
+
+ if ( is_wp_error( $skin->result ) ) {
+ $status['errorCode'] = $skin->result->get_error_code();
+ $status['errorMessage'] = $skin->result->get_error_message();
+ wp_send_json_error( $status );
+ } elseif ( $skin->get_errors()->has_errors() ) {
+ $status['errorMessage'] = $skin->get_error_messages();
+ wp_send_json_error( $status );
+ } elseif ( is_array( $result ) && ! empty( $result[ $plugin ] ) ) {
+ $plugin_update_data = current( $result );
+
+ /*
+ * If the `update_plugins` site transient is empty (e.g. when you update
+ * two plugins in quick succession before the transient repopulates),
+ * this may be the return.
+ *
+ * Preferably something can be done to ensure `update_plugins` isn't empty.
+ * For now, surface some sort of error here.
+ */
+ if ( true === $plugin_update_data ) {
+ $status['errorMessage'] = __( 'Plugin update failed.' );
+ wp_send_json_error( $status );
+ }
+
+ $plugin_data = get_plugins( '/' . $result[ $plugin ]['destination_name'] );
+ $plugin_data = reset( $plugin_data );
+
+ if ( $plugin_data['Version'] ) {
+ /* translators: %s: Plugin version */
+ $status['newVersion'] = sprintf( __( 'Version %s' ), $plugin_data['Version'] );
+ }
+ wp_send_json_success( $status );
+ } elseif ( false === $result ) {
+ global $wp_filesystem;
+
+ $status['errorCode'] = 'unable_to_connect_to_filesystem';
+ $status['errorMessage'] = __( 'Unable to connect to the filesystem. Please confirm your credentials.' );
+
+ // Pass through the error from WP_Filesystem if one was raised.
+ if ( $wp_filesystem instanceof WP_Filesystem_Base && is_wp_error( $wp_filesystem->errors ) && $wp_filesystem->errors->has_errors() ) {
+ $status['errorMessage'] = esc_html( $wp_filesystem->errors->get_error_message() );
+ }
+
+ wp_send_json_error( $status );
+ }
+
+ // An unhandled error occurred.
+ $status['errorMessage'] = __( 'Plugin update failed.' );
+ wp_send_json_error( $status );
+}
+
+/**
+ * Ajax handler for deleting a plugin.
+ *
+ * @since 4.6.0
+ *
+ * @see delete_plugins()
+ *
+ * @global WP_Filesystem_Base $wp_filesystem WordPress filesystem subclass.
+ */
+function wp_ajax_delete_plugin() {
+ check_ajax_referer( 'updates' );
+
+ if ( empty( $_POST['slug'] ) || empty( $_POST['plugin'] ) ) {
+ wp_send_json_error(
+ array(
+ 'slug' => '',
+ 'errorCode' => 'no_plugin_specified',
+ 'errorMessage' => __( 'No plugin specified.' ),
+ )
+ );
+ }
+
+ $plugin = plugin_basename( sanitize_text_field( wp_unslash( $_POST['plugin'] ) ) );
+
+ $status = array(
+ 'delete' => 'plugin',
+ 'slug' => sanitize_key( wp_unslash( $_POST['slug'] ) ),
+ );
+
+ if ( ! current_user_can( 'delete_plugins' ) || 0 !== validate_file( $plugin ) ) {
+ $status['errorMessage'] = __( 'Sorry, you are not allowed to delete plugins for this site.' );
+ wp_send_json_error( $status );
+ }
+
+ $plugin_data = get_plugin_data( WP_PLUGIN_DIR . '/' . $plugin );
+ $status['plugin'] = $plugin;
+ $status['pluginName'] = $plugin_data['Name'];
+
+ if ( is_plugin_active( $plugin ) ) {
+ $status['errorMessage'] = __( 'You cannot delete a plugin while it is active on the main site.' );
+ wp_send_json_error( $status );
+ }
+
+ // Check filesystem credentials. `delete_plugins()` will bail otherwise.
+ $url = wp_nonce_url( 'plugins.php?action=delete-selected&verify-delete=1&checked[]=' . $plugin, 'bulk-plugins' );
+ ob_start();
+ $credentials = request_filesystem_credentials( $url );
+ ob_end_clean();
+ if ( false === $credentials || ! WP_Filesystem( $credentials ) ) {
+ global $wp_filesystem;
+
+ $status['errorCode'] = 'unable_to_connect_to_filesystem';
+ $status['errorMessage'] = __( 'Unable to connect to the filesystem. Please confirm your credentials.' );
+
+ // Pass through the error from WP_Filesystem if one was raised.
+ if ( $wp_filesystem instanceof WP_Filesystem_Base && is_wp_error( $wp_filesystem->errors ) && $wp_filesystem->errors->has_errors() ) {
+ $status['errorMessage'] = esc_html( $wp_filesystem->errors->get_error_message() );
+ }
+
+ wp_send_json_error( $status );
+ }
+
+ $result = delete_plugins( array( $plugin ) );
+
+ if ( is_wp_error( $result ) ) {
+ $status['errorMessage'] = $result->get_error_message();
+ wp_send_json_error( $status );
+ } elseif ( false === $result ) {
+ $status['errorMessage'] = __( 'Plugin could not be deleted.' );
+ wp_send_json_error( $status );
+ }
+
+ wp_send_json_success( $status );
+}
+
+/**
+ * Ajax handler for searching plugins.
+ *
+ * @since 4.6.0
+ *
+ * @global string $s Search term.
+ */
+function wp_ajax_search_plugins() {
+ check_ajax_referer( 'updates' );
+
+ $pagenow = isset( $_POST['pagenow'] ) ? sanitize_key( $_POST['pagenow'] ) : '';
+ if ( 'plugins-network' === $pagenow || 'plugins' === $pagenow ) {
+ set_current_screen( $pagenow );
+ }
+
+ /** @var WP_Plugins_List_Table $wp_list_table */
+ $wp_list_table = _get_list_table(
+ 'WP_Plugins_List_Table',
+ array(
+ 'screen' => get_current_screen(),
+ )
+ );
+
+ $status = array();
+
+ if ( ! $wp_list_table->ajax_user_can() ) {
+ $status['errorMessage'] = __( 'Sorry, you are not allowed to manage plugins for this site.' );
+ wp_send_json_error( $status );
+ }
+
+ // Set the correct requester, so pagination works.
+ $_SERVER['REQUEST_URI'] = add_query_arg(
+ array_diff_key(
+ $_POST,
+ array(
+ '_ajax_nonce' => null,
+ 'action' => null,
+ )
+ ),
+ network_admin_url( 'plugins.php', 'relative' )
+ );
+
+ $GLOBALS['s'] = wp_unslash( $_POST['s'] );
+
+ $wp_list_table->prepare_items();
+
+ ob_start();
+ $wp_list_table->display();
+ $status['count'] = count( $wp_list_table->items );
+ $status['items'] = ob_get_clean();
+
+ wp_send_json_success( $status );
+}
+
+/**
+ * Ajax handler for searching plugins to install.
+ *
+ * @since 4.6.0
+ */
+function wp_ajax_search_install_plugins() {
+ check_ajax_referer( 'updates' );
+
+ $pagenow = isset( $_POST['pagenow'] ) ? sanitize_key( $_POST['pagenow'] ) : '';
+ if ( 'plugin-install-network' === $pagenow || 'plugin-install' === $pagenow ) {
+ set_current_screen( $pagenow );
+ }
+
+ /** @var WP_Plugin_Install_List_Table $wp_list_table */
+ $wp_list_table = _get_list_table(
+ 'WP_Plugin_Install_List_Table',
+ array(
+ 'screen' => get_current_screen(),
+ )
+ );
+
+ $status = array();
+
+ if ( ! $wp_list_table->ajax_user_can() ) {
+ $status['errorMessage'] = __( 'Sorry, you are not allowed to manage plugins for this site.' );
+ wp_send_json_error( $status );
+ }
+
+ // Set the correct requester, so pagination works.
+ $_SERVER['REQUEST_URI'] = add_query_arg(
+ array_diff_key(
+ $_POST,
+ array(
+ '_ajax_nonce' => null,
+ 'action' => null,
+ )
+ ),
+ network_admin_url( 'plugin-install.php', 'relative' )
+ );
+
+ $wp_list_table->prepare_items();
+
+ ob_start();
+ $wp_list_table->display();
+ $status['count'] = (int) $wp_list_table->get_pagination_arg( 'total_items' );
+ $status['items'] = ob_get_clean();
+
+ wp_send_json_success( $status );
+}
+
+/**
+ * Ajax handler for editing a theme or plugin file.
+ *
+ * @since 4.9.0
+ * @see wp_edit_theme_plugin_file()
+ */
+function wp_ajax_edit_theme_plugin_file() {
+ $r = wp_edit_theme_plugin_file( wp_unslash( $_POST ) ); // Validation of args is done in wp_edit_theme_plugin_file().
+ if ( is_wp_error( $r ) ) {
+ wp_send_json_error(
+ array_merge(
+ array(
+ 'code' => $r->get_error_code(),
+ 'message' => $r->get_error_message(),
+ ),
+ (array) $r->get_error_data()
+ )
+ );
+ } else {
+ wp_send_json_success(
+ array(
+ 'message' => __( 'File edited successfully.' ),
+ )
+ );
+ }
+}
+
+/**
+ * Ajax handler for exporting a user's personal data.
+ *
+ * @since 4.9.6
+ */
+function wp_ajax_wp_privacy_export_personal_data() {
+
+ if ( empty( $_POST['id'] ) ) {
+ wp_send_json_error( __( 'Missing request ID.' ) );
+ }
+ $request_id = (int) $_POST['id'];
+
+ if ( $request_id < 1 ) {
+ wp_send_json_error( __( 'Invalid request ID.' ) );
+ }
+
+ if ( ! current_user_can( 'export_others_personal_data' ) ) {
+ wp_send_json_error( __( 'Sorry, you are not allowed to perform this action.' ) );
+ }
+
+ check_ajax_referer( 'wp-privacy-export-personal-data-' . $request_id, 'security' );
+
+ // Get the request data.
+ $request = wp_get_user_request_data( $request_id );
+
+ if ( ! $request || 'export_personal_data' !== $request->action_name ) {
+ wp_send_json_error( __( 'Invalid request type.' ) );
+ }
+
+ $email_address = $request->email;
+ if ( ! is_email( $email_address ) ) {
+ wp_send_json_error( __( 'A valid email address must be given.' ) );
+ }
+
+ if ( ! isset( $_POST['exporter'] ) ) {
+ wp_send_json_error( __( 'Missing exporter index.' ) );
+ }
+ $exporter_index = (int) $_POST['exporter'];
+
+ if ( ! isset( $_POST['page'] ) ) {
+ wp_send_json_error( __( 'Missing page index.' ) );
+ }
+ $page = (int) $_POST['page'];
+
+ $send_as_email = isset( $_POST['sendAsEmail'] ) ? ( 'true' === $_POST['sendAsEmail'] ) : false;
+
+ /**
+ * Filters the array of exporter callbacks.
+ *
+ * @since 4.9.6
+ *
+ * @param array $args {
+ * An array of callable exporters of personal data. Default empty array.
+ *
+ * @type array {
+ * Array of personal data exporters.
+ *
+ * @type string $callback Callable exporter function that accepts an
+ * email address and a page and returns an array
+ * of name => value pairs of personal data.
+ * @type string $exporter_friendly_name Translated user facing friendly name for the
+ * exporter.
+ * }
+ * }
+ */
+ $exporters = apply_filters( 'wp_privacy_personal_data_exporters', array() );
+
+ if ( ! is_array( $exporters ) ) {
+ wp_send_json_error( __( 'An exporter has improperly used the registration filter.' ) );
+ }
+
+ // Do we have any registered exporters?
+ if ( 0 < count( $exporters ) ) {
+ if ( $exporter_index < 1 ) {
+ wp_send_json_error( __( 'Exporter index cannot be negative.' ) );
+ }
+
+ if ( $exporter_index > count( $exporters ) ) {
+ wp_send_json_error( __( 'Exporter index is out of range.' ) );
+ }
+
+ if ( $page < 1 ) {
+ wp_send_json_error( __( 'Page index cannot be less than one.' ) );
+ }
+
+ $exporter_keys = array_keys( $exporters );
+ $exporter_key = $exporter_keys[ $exporter_index - 1 ];
+ $exporter = $exporters[ $exporter_key ];
+
+ if ( ! is_array( $exporter ) ) {
+ wp_send_json_error(
+ /* translators: %s: exporter array index */
+ sprintf( __( 'Expected an array describing the exporter at index %s.' ), $exporter_key )
+ );
+ }
+ if ( ! array_key_exists( 'exporter_friendly_name', $exporter ) ) {
+ wp_send_json_error(
+ /* translators: %s: exporter array index */
+ sprintf( __( 'Exporter array at index %s does not include a friendly name.' ), $exporter_key )
+ );
+ }
+
+ $exporter_friendly_name = $exporter['exporter_friendly_name'];
+
+ if ( ! array_key_exists( 'callback', $exporter ) ) {
+ wp_send_json_error(
+ /* translators: %s: exporter friendly name */
+ sprintf( __( 'Exporter does not include a callback: %s.' ), esc_html( $exporter_friendly_name ) )
+ );
+ }
+ if ( ! is_callable( $exporter['callback'] ) ) {
+ wp_send_json_error(
+ /* translators: %s: exporter friendly name */
+ sprintf( __( 'Exporter callback is not a valid callback: %s.' ), esc_html( $exporter_friendly_name ) )
+ );
+ }
+
+ $callback = $exporter['callback'];
+ $response = call_user_func( $callback, $email_address, $page );
+
+ if ( is_wp_error( $response ) ) {
+ wp_send_json_error( $response );
+ }
+
+ if ( ! is_array( $response ) ) {
+ wp_send_json_error(
+ /* translators: %s: exporter friendly name */
+ sprintf( __( 'Expected response as an array from exporter: %s.' ), esc_html( $exporter_friendly_name ) )
+ );
+ }
+ if ( ! array_key_exists( 'data', $response ) ) {
+ wp_send_json_error(
+ /* translators: %s: exporter friendly name */
+ sprintf( __( 'Expected data in response array from exporter: %s.' ), esc_html( $exporter_friendly_name ) )
+ );
+ }
+ if ( ! is_array( $response['data'] ) ) {
+ wp_send_json_error(
+ /* translators: %s: exporter friendly name */
+ sprintf( __( 'Expected data array in response array from exporter: %s.' ), esc_html( $exporter_friendly_name ) )
+ );
+ }
+ if ( ! array_key_exists( 'done', $response ) ) {
+ wp_send_json_error(
+ /* translators: %s: exporter friendly name */
+ sprintf( __( 'Expected done (boolean) in response array from exporter: %s.' ), esc_html( $exporter_friendly_name ) )
+ );
+ }
+ } else {
+ // No exporters, so we're done.
+ $exporter_key = '';
+
+ $response = array(
+ 'data' => array(),
+ 'done' => true,
+ );
+ }
+
+ /**
+ * Filters a page of personal data exporter data. Used to build the export report.
+ *
+ * Allows the export response to be consumed by destinations in addition to Ajax.
+ *
+ * @since 4.9.6
+ *
+ * @param array $response The personal data for the given exporter and page.
+ * @param int $exporter_index The index of the exporter that provided this data.
+ * @param string $email_address The email address associated with this personal data.
+ * @param int $page The page for this response.
+ * @param int $request_id The privacy request post ID associated with this request.
+ * @param bool $send_as_email Whether the final results of the export should be emailed to the user.
+ * @param string $exporter_key The key (slug) of the exporter that provided this data.
+ */
+ $response = apply_filters( 'wp_privacy_personal_data_export_page', $response, $exporter_index, $email_address, $page, $request_id, $send_as_email, $exporter_key );
+
+ if ( is_wp_error( $response ) ) {
+ wp_send_json_error( $response );
+ }
+
+ wp_send_json_success( $response );
+}
+
+/**
+ * Ajax handler for erasing personal data.
+ *
+ * @since 4.9.6
+ */
+function wp_ajax_wp_privacy_erase_personal_data() {
+
+ if ( empty( $_POST['id'] ) ) {
+ wp_send_json_error( __( 'Missing request ID.' ) );
+ }
+
+ $request_id = (int) $_POST['id'];
+
+ if ( $request_id < 1 ) {
+ wp_send_json_error( __( 'Invalid request ID.' ) );
+ }
+
+ // Both capabilities are required to avoid confusion, see `_wp_personal_data_removal_page()`.
+ if ( ! current_user_can( 'erase_others_personal_data' ) || ! current_user_can( 'delete_users' ) ) {
+ wp_send_json_error( __( 'Sorry, you are not allowed to perform this action.' ) );
+ }
+
+ check_ajax_referer( 'wp-privacy-erase-personal-data-' . $request_id, 'security' );
+
+ // Get the request data.
+ $request = wp_get_user_request_data( $request_id );
+
+ if ( ! $request || 'remove_personal_data' !== $request->action_name ) {
+ wp_send_json_error( __( 'Invalid request type.' ) );
+ }
+
+ $email_address = $request->email;
+
+ if ( ! is_email( $email_address ) ) {
+ wp_send_json_error( __( 'Invalid email address in request.' ) );
+ }
+
+ if ( ! isset( $_POST['eraser'] ) ) {
+ wp_send_json_error( __( 'Missing eraser index.' ) );
+ }
+
+ $eraser_index = (int) $_POST['eraser'];
+
+ if ( ! isset( $_POST['page'] ) ) {
+ wp_send_json_error( __( 'Missing page index.' ) );
+ }
+
+ $page = (int) $_POST['page'];
+
+ /**
+ * Filters the array of personal data eraser callbacks.
+ *
+ * @since 4.9.6
+ *
+ * @param array $args {
+ * An array of callable erasers of personal data. Default empty array.
+ *
+ * @type array {
+ * Array of personal data exporters.
+ *
+ * @type string $callback Callable eraser that accepts an email address and
+ * a page and returns an array with boolean values for
+ * whether items were removed or retained and any messages
+ * from the eraser, as well as if additional pages are
+ * available.
+ * @type string $exporter_friendly_name Translated user facing friendly name for the eraser.
+ * }
+ * }
+ */
+ $erasers = apply_filters( 'wp_privacy_personal_data_erasers', array() );
+
+ // Do we have any registered erasers?
+ if ( 0 < count( $erasers ) ) {
+
+ if ( $eraser_index < 1 ) {
+ wp_send_json_error( __( 'Eraser index cannot be less than one.' ) );
+ }
+
+ if ( $eraser_index > count( $erasers ) ) {
+ wp_send_json_error( __( 'Eraser index is out of range.' ) );
+ }
+
+ if ( $page < 1 ) {
+ wp_send_json_error( __( 'Page index cannot be less than one.' ) );
+ }
+
+ $eraser_keys = array_keys( $erasers );
+ $eraser_key = $eraser_keys[ $eraser_index - 1 ];
+ $eraser = $erasers[ $eraser_key ];
+
+ if ( ! is_array( $eraser ) ) {
+ /* translators: %d: eraser array index */
+ wp_send_json_error( sprintf( __( 'Expected an array describing the eraser at index %d.' ), $eraser_index ) );
+ }
+
+ if ( ! array_key_exists( 'eraser_friendly_name', $eraser ) ) {
+ /* translators: %d: eraser array index */
+ wp_send_json_error( sprintf( __( 'Eraser array at index %d does not include a friendly name.' ), $eraser_index ) );
+ }
+
+ $eraser_friendly_name = $eraser['eraser_friendly_name'];
+
+ if ( ! array_key_exists( 'callback', $eraser ) ) {
+ wp_send_json_error(
+ sprintf(
+ /* translators: %s: eraser friendly name */
+ __( 'Eraser does not include a callback: %s.' ),
+ esc_html( $eraser_friendly_name )
+ )
+ );
+ }
+
+ if ( ! is_callable( $eraser['callback'] ) ) {
+ wp_send_json_error(
+ sprintf(
+ /* translators: %s: eraser friendly name */
+ __( 'Eraser callback is not valid: %s.' ),
+ esc_html( $eraser_friendly_name )
+ )
+ );
+ }
+
+ $callback = $eraser['callback'];
+ $response = call_user_func( $callback, $email_address, $page );
+
+ if ( is_wp_error( $response ) ) {
+ wp_send_json_error( $response );
+ }
+
+ if ( ! is_array( $response ) ) {
+ wp_send_json_error(
+ sprintf(
+ /* translators: 1: eraser friendly name, 2: eraser array index */
+ __( 'Did not receive array from %1$s eraser (index %2$d).' ),
+ esc_html( $eraser_friendly_name ),
+ $eraser_index
+ )
+ );
+ }
+
+ if ( ! array_key_exists( 'items_removed', $response ) ) {
+ wp_send_json_error(
+ sprintf(
+ /* translators: 1: eraser friendly name, 2: eraser array index */
+ __( 'Expected items_removed key in response array from %1$s eraser (index %2$d).' ),
+ esc_html( $eraser_friendly_name ),
+ $eraser_index
+ )
+ );
+ }
+
+ if ( ! array_key_exists( 'items_retained', $response ) ) {
+ wp_send_json_error(
+ sprintf(
+ /* translators: 1: eraser friendly name, 2: eraser array index */
+ __( 'Expected items_retained key in response array from %1$s eraser (index %2$d).' ),
+ esc_html( $eraser_friendly_name ),
+ $eraser_index
+ )
+ );
+ }
+
+ if ( ! array_key_exists( 'messages', $response ) ) {
+ wp_send_json_error(
+ sprintf(
+ /* translators: 1: eraser friendly name, 2: eraser array index */
+ __( 'Expected messages key in response array from %1$s eraser (index %2$d).' ),
+ esc_html( $eraser_friendly_name ),
+ $eraser_index
+ )
+ );
+ }
+
+ if ( ! is_array( $response['messages'] ) ) {
+ wp_send_json_error(
+ sprintf(
+ /* translators: 1: eraser friendly name, 2: eraser array index */
+ __( 'Expected messages key to reference an array in response array from %1$s eraser (index %2$d).' ),
+ esc_html( $eraser_friendly_name ),
+ $eraser_index
+ )
+ );
+ }
+
+ if ( ! array_key_exists( 'done', $response ) ) {
+ wp_send_json_error(
+ sprintf(
+ /* translators: 1: eraser friendly name, 2: eraser array index */
+ __( 'Expected done flag in response array from %1$s eraser (index %2$d).' ),
+ esc_html( $eraser_friendly_name ),
+ $eraser_index
+ )
+ );
+ }
+ } else {
+ // No erasers, so we're done.
+ $eraser_key = '';
+
+ $response = array(
+ 'items_removed' => false,
+ 'items_retained' => false,
+ 'messages' => array(),
+ 'done' => true,
+ );
+ }
+
+ /**
+ * Filters a page of personal data eraser data.
+ *
+ * Allows the erasure response to be consumed by destinations in addition to Ajax.
+ *
+ * @since 4.9.6
+ *
+ * @param array $response The personal data for the given exporter and page.
+ * @param int $eraser_index The index of the eraser that provided this data.
+ * @param string $email_address The email address associated with this personal data.
+ * @param int $page The page for this response.
+ * @param int $request_id The privacy request post ID associated with this request.
+ * @param string $eraser_key The key (slug) of the eraser that provided this data.
+ */
+ $response = apply_filters( 'wp_privacy_personal_data_erasure_page', $response, $eraser_index, $email_address, $page, $request_id, $eraser_key );
+
+ if ( is_wp_error( $response ) ) {
+ wp_send_json_error( $response );
+ }
+
+ wp_send_json_success( $response );
+}
+
+/**
+ * Ajax handler for site health checks on server communication.
+ *
+ * @since 5.2.0
+ */
+function wp_ajax_health_check_dotorg_communication() {
+ check_ajax_referer( 'health-check-site-status' );
+
+ if ( ! current_user_can( 'view_site_health_checks' ) ) {
+ wp_send_json_error();
+ }
+
+ if ( ! class_exists( 'WP_Site_Health' ) ) {
+ require_once( ABSPATH . 'wp-admin/includes/class-wp-site-health.php' );
+ }
+
+ $site_health = new WP_Site_Health();
+ wp_send_json_success( $site_health->get_test_dotorg_communication() );
+}
+
+/**
+ * Ajax handler for site health checks on debug mode.
+ *
+ * @since 5.2.0
+ */
+function wp_ajax_health_check_is_in_debug_mode() {
+ wp_verify_nonce( 'health-check-site-status' );
+
+ if ( ! current_user_can( 'view_site_health_checks' ) ) {
+ wp_send_json_error();
+ }
+
+ if ( ! class_exists( 'WP_Site_Health' ) ) {
+ require_once( ABSPATH . 'wp-admin/includes/class-wp-site-health.php' );
+ }
+
+ $site_health = new WP_Site_Health();
+ wp_send_json_success( $site_health->get_test_is_in_debug_mode() );
+}
+
+/**
+ * Ajax handler for site health checks on background updates.
+ *
+ * @since 5.2.0
+ */
+function wp_ajax_health_check_background_updates() {
+ check_ajax_referer( 'health-check-site-status' );
+
+ if ( ! current_user_can( 'view_site_health_checks' ) ) {
+ wp_send_json_error();
+ }
+
+ if ( ! class_exists( 'WP_Site_Health' ) ) {
+ require_once( ABSPATH . 'wp-admin/includes/class-wp-site-health.php' );
+ }
+
+ $site_health = new WP_Site_Health();
+ wp_send_json_success( $site_health->get_test_background_updates() );
+}
+
+
+/**
+ * Ajax handler for site health checks on loopback requests.
+ *
+ * @since 5.2.0
+ */
+function wp_ajax_health_check_loopback_requests() {
+ check_ajax_referer( 'health-check-site-status' );
+
+ if ( ! current_user_can( 'view_site_health_checks' ) ) {
+ wp_send_json_error();
+ }
+
+ if ( ! class_exists( 'WP_Site_Health' ) ) {
+ require_once( ABSPATH . 'wp-admin/includes/class-wp-site-health.php' );
+ }
+
+ $site_health = new WP_Site_Health();
+ wp_send_json_success( $site_health->get_test_loopback_requests() );
+}
+
+/**
+ * Ajax handler for site health check to update the result status.
+ *
+ * @since 5.2.0
+ */
+function wp_ajax_health_check_site_status_result() {
+ check_ajax_referer( 'health-check-site-status-result' );
+
+ if ( ! current_user_can( 'view_site_health_checks' ) ) {
+ wp_send_json_error();
+ }
+
+ set_transient( 'health-check-site-status-result', wp_json_encode( $_POST['counts'] ) );
+
+ wp_send_json_success();
+}
+
+/**
+ * Ajax handler for site health check to get directories and database sizes.
+ *
+ * @since 5.2.0
+ */
+function wp_ajax_health_check_get_sizes() {
+ check_ajax_referer( 'health-check-site-status-result' );
+
+ if ( ! current_user_can( 'view_site_health_checks' ) || is_multisite() ) {
+ wp_send_json_error();
+ }
+
+ if ( ! class_exists( 'WP_Debug_Data' ) ) {
+ require_once( ABSPATH . 'wp-admin/includes/class-wp-debug-data.php' );
+ }
+
+ $sizes_data = WP_Debug_Data::get_sizes();
+ $all_sizes = array( 'raw' => 0 );
+
+ foreach ( $sizes_data as $name => $value ) {
+ $name = sanitize_text_field( $name );
+ $data = array();
+
+ if ( isset( $value['size'] ) ) {
+ if ( is_string( $value['size'] ) ) {
+ $data['size'] = sanitize_text_field( $value['size'] );
+ } else {
+ $data['size'] = (int) $value['size'];
+ }
+ }
+
+ if ( isset( $value['debug'] ) ) {
+ if ( is_string( $value['debug'] ) ) {
+ $data['debug'] = sanitize_text_field( $value['debug'] );
+ } else {
+ $data['debug'] = (int) $value['debug'];
+ }
+ }
+
+ if ( ! empty( $value['raw'] ) ) {
+ $data['raw'] = (int) $value['raw'];
+ }
+
+ $all_sizes[ $name ] = $data;
+ }
+
+ if ( isset( $all_sizes['total_size']['debug'] ) && 'not available' === $all_sizes['total_size']['debug'] ) {
+ wp_send_json_error( $all_sizes );
+ }
+
+ wp_send_json_success( $all_sizes );
+}
diff --git a/www/crm/wp-admin/includes/bookmark.php b/www/crm/wp-admin/includes/bookmark.php
new file mode 100644
index 00000000..fa425dda
--- /dev/null
+++ b/www/crm/wp-admin/includes/bookmark.php
@@ -0,0 +1,327 @@
+<?php
+/**
+ * WordPress Bookmark Administration API
+ *
+ * @package WordPress
+ * @subpackage Administration
+ */
+
+/**
+ * Add a link to using values provided in $_POST.
+ *
+ * @since 2.0.0
+ *
+ * @return int|WP_Error Value 0 or WP_Error on failure. The link ID on success.
+ */
+function add_link() {
+ return edit_link();
+}
+
+/**
+ * Updates or inserts a link using values provided in $_POST.
+ *
+ * @since 2.0.0
+ *
+ * @param int $link_id Optional. ID of the link to edit. Default 0.
+ * @return int|WP_Error Value 0 or WP_Error on failure. The link ID on success.
+ */
+function edit_link( $link_id = 0 ) {
+ if ( ! current_user_can( 'manage_links' ) ) {
+ wp_die(
+ '<h1>' . __( 'You need a higher level of permission.' ) . '</h1>' .
+ '<p>' . __( 'Sorry, you are not allowed to edit the links for this site.' ) . '</p>',
+ 403
+ );
+ }
+
+ $_POST['link_url'] = esc_html( $_POST['link_url'] );
+ $_POST['link_url'] = esc_url( $_POST['link_url'] );
+ $_POST['link_name'] = esc_html( $_POST['link_name'] );
+ $_POST['link_image'] = esc_html( $_POST['link_image'] );
+ $_POST['link_rss'] = esc_url( $_POST['link_rss'] );
+ if ( ! isset( $_POST['link_visible'] ) || 'N' != $_POST['link_visible'] ) {
+ $_POST['link_visible'] = 'Y';
+ }
+
+ if ( ! empty( $link_id ) ) {
+ $_POST['link_id'] = $link_id;
+ return wp_update_link( $_POST );
+ } else {
+ return wp_insert_link( $_POST );
+ }
+}
+
+/**
+ * Retrieves the default link for editing.
+ *
+ * @since 2.0.0
+ *
+ * @return stdClass Default link object.
+ */
+function get_default_link_to_edit() {
+ $link = new stdClass;
+ if ( isset( $_GET['linkurl'] ) ) {
+ $link->link_url = esc_url( wp_unslash( $_GET['linkurl'] ) );
+ } else {
+ $link->link_url = '';
+ }
+
+ if ( isset( $_GET['name'] ) ) {
+ $link->link_name = esc_attr( wp_unslash( $_GET['name'] ) );
+ } else {
+ $link->link_name = '';
+ }
+
+ $link->link_visible = 'Y';
+
+ return $link;
+}
+
+/**
+ * Deletes a specified link from the database.
+ *
+ * @since 2.0.0
+ *
+ * @global wpdb $wpdb WordPress database abstraction object.
+ *
+ * @param int $link_id ID of the link to delete
+ * @return true Always true.
+ */
+function wp_delete_link( $link_id ) {
+ global $wpdb;
+ /**
+ * Fires before a link is deleted.
+ *
+ * @since 2.0.0
+ *
+ * @param int $link_id ID of the link to delete.
+ */
+ do_action( 'delete_link', $link_id );
+
+ wp_delete_object_term_relationships( $link_id, 'link_category' );
+
+ $wpdb->delete( $wpdb->links, array( 'link_id' => $link_id ) );
+
+ /**
+ * Fires after a link has been deleted.
+ *
+ * @since 2.2.0
+ *
+ * @param int $link_id ID of the deleted link.
+ */
+ do_action( 'deleted_link', $link_id );
+
+ clean_bookmark_cache( $link_id );
+
+ return true;
+}
+
+/**
+ * Retrieves the link categories associated with the link specified.
+ *
+ * @since 2.1.0
+ *
+ * @param int $link_id Link ID to look up
+ * @return array The requested link's categories
+ */
+function wp_get_link_cats( $link_id = 0 ) {
+ $cats = wp_get_object_terms( $link_id, 'link_category', array( 'fields' => 'ids' ) );
+ return array_unique( $cats );
+}
+
+/**
+ * Retrieves link data based on its ID.
+ *
+ * @since 2.0.0
+ *
+ * @param int|stdClass $link Link ID or object to retrieve.
+ * @return object Link object for editing.
+ */
+function get_link_to_edit( $link ) {
+ return get_bookmark( $link, OBJECT, 'edit' );
+}
+
+/**
+ * Inserts/updates links into/in the database.
+ *
+ * @since 2.0.0
+ *
+ * @global wpdb $wpdb WordPress database abstraction object.
+ *
+ * @param array $linkdata Elements that make up the link to insert.
+ * @param bool $wp_error Optional. Whether to return a WP_Error object on failure. Default false.
+ * @return int|WP_Error Value 0 or WP_Error on failure. The link ID on success.
+ */
+function wp_insert_link( $linkdata, $wp_error = false ) {
+ global $wpdb;
+
+ $defaults = array(
+ 'link_id' => 0,
+ 'link_name' => '',
+ 'link_url' => '',
+ 'link_rating' => 0,
+ );
+
+ $args = wp_parse_args( $linkdata, $defaults );
+ $r = wp_unslash( sanitize_bookmark( $args, 'db' ) );
+
+ $link_id = $r['link_id'];
+ $link_name = $r['link_name'];
+ $link_url = $r['link_url'];
+
+ $update = false;
+ if ( ! empty( $link_id ) ) {
+ $update = true;
+ }
+
+ if ( trim( $link_name ) == '' ) {
+ if ( trim( $link_url ) != '' ) {
+ $link_name = $link_url;
+ } else {
+ return 0;
+ }
+ }
+
+ if ( trim( $link_url ) == '' ) {
+ return 0;
+ }
+
+ $link_rating = ( ! empty( $r['link_rating'] ) ) ? $r['link_rating'] : 0;
+ $link_image = ( ! empty( $r['link_image'] ) ) ? $r['link_image'] : '';
+ $link_target = ( ! empty( $r['link_target'] ) ) ? $r['link_target'] : '';
+ $link_visible = ( ! empty( $r['link_visible'] ) ) ? $r['link_visible'] : 'Y';
+ $link_owner = ( ! empty( $r['link_owner'] ) ) ? $r['link_owner'] : get_current_user_id();
+ $link_notes = ( ! empty( $r['link_notes'] ) ) ? $r['link_notes'] : '';
+ $link_description = ( ! empty( $r['link_description'] ) ) ? $r['link_description'] : '';
+ $link_rss = ( ! empty( $r['link_rss'] ) ) ? $r['link_rss'] : '';
+ $link_rel = ( ! empty( $r['link_rel'] ) ) ? $r['link_rel'] : '';
+ $link_category = ( ! empty( $r['link_category'] ) ) ? $r['link_category'] : array();
+
+ // Make sure we set a valid category.
+ if ( ! is_array( $link_category ) || 0 == count( $link_category ) ) {
+ $link_category = array( get_option( 'default_link_category' ) );
+ }
+
+ if ( $update ) {
+ if ( false === $wpdb->update( $wpdb->links, compact( 'link_url', 'link_name', 'link_image', 'link_target', 'link_description', 'link_visible', 'link_rating', 'link_rel', 'link_notes', 'link_rss' ), compact( 'link_id' ) ) ) {
+ if ( $wp_error ) {
+ return new WP_Error( 'db_update_error', __( 'Could not update link in the database' ), $wpdb->last_error );
+ } else {
+ return 0;
+ }
+ }
+ } else {
+ if ( false === $wpdb->insert( $wpdb->links, compact( 'link_url', 'link_name', 'link_image', 'link_target', 'link_description', 'link_visible', 'link_owner', 'link_rating', 'link_rel', 'link_notes', 'link_rss' ) ) ) {
+ if ( $wp_error ) {
+ return new WP_Error( 'db_insert_error', __( 'Could not insert link into the database' ), $wpdb->last_error );
+ } else {
+ return 0;
+ }
+ }
+ $link_id = (int) $wpdb->insert_id;
+ }
+
+ wp_set_link_cats( $link_id, $link_category );
+
+ if ( $update ) {
+ /**
+ * Fires after a link was updated in the database.
+ *
+ * @since 2.0.0
+ *
+ * @param int $link_id ID of the link that was updated.
+ */
+ do_action( 'edit_link', $link_id );
+ } else {
+ /**
+ * Fires after a link was added to the database.
+ *
+ * @since 2.0.0
+ *
+ * @param int $link_id ID of the link that was added.
+ */
+ do_action( 'add_link', $link_id );
+ }
+ clean_bookmark_cache( $link_id );
+
+ return $link_id;
+}
+
+/**
+ * Update link with the specified link categories.
+ *
+ * @since 2.1.0
+ *
+ * @param int $link_id ID of the link to update.
+ * @param int[] $link_categories Array of link category IDs to add the link to.
+ */
+function wp_set_link_cats( $link_id = 0, $link_categories = array() ) {
+ // If $link_categories isn't already an array, make it one:
+ if ( ! is_array( $link_categories ) || 0 == count( $link_categories ) ) {
+ $link_categories = array( get_option( 'default_link_category' ) );
+ }
+
+ $link_categories = array_map( 'intval', $link_categories );
+ $link_categories = array_unique( $link_categories );
+
+ wp_set_object_terms( $link_id, $link_categories, 'link_category' );
+
+ clean_bookmark_cache( $link_id );
+}
+
+/**
+ * Updates a link in the database.
+ *
+ * @since 2.0.0
+ *
+ * @param array $linkdata Link data to update.
+ * @return int|WP_Error Value 0 or WP_Error on failure. The updated link ID on success.
+ */
+function wp_update_link( $linkdata ) {
+ $link_id = (int) $linkdata['link_id'];
+
+ $link = get_bookmark( $link_id, ARRAY_A );
+
+ // Escape data pulled from DB.
+ $link = wp_slash( $link );
+
+ // Passed link category list overwrites existing category list if not empty.
+ if ( isset( $linkdata['link_category'] ) && is_array( $linkdata['link_category'] ) && 0 != count( $linkdata['link_category'] ) ) {
+ $link_cats = $linkdata['link_category'];
+ } else {
+ $link_cats = $link['link_category'];
+ }
+
+ // Merge old and new fields with new fields overwriting old ones.
+ $linkdata = array_merge( $link, $linkdata );
+ $linkdata['link_category'] = $link_cats;
+
+ return wp_insert_link( $linkdata );
+}
+
+/**
+ * Outputs the 'disabled' message for the WordPress Link Manager.
+ *
+ * @since 3.5.0
+ * @access private
+ *
+ * @global string $pagenow
+ */
+function wp_link_manager_disabled_message() {
+ global $pagenow;
+ if ( 'link-manager.php' != $pagenow && 'link-add.php' != $pagenow && 'link.php' != $pagenow ) {
+ return;
+ }
+
+ add_filter( 'pre_option_link_manager_enabled', '__return_true', 100 );
+ $really_can_manage_links = current_user_can( 'manage_links' );
+ remove_filter( 'pre_option_link_manager_enabled', '__return_true', 100 );
+
+ if ( $really_can_manage_links && current_user_can( 'install_plugins' ) ) {
+ $link = network_admin_url( 'plugin-install.php?tab=search&amp;s=Link+Manager' );
+ /* translators: %s: URL of link manager plugin */
+ wp_die( sprintf( __( 'If you are looking to use the link manager, please install the <a href="%s">Link Manager</a> plugin.' ), $link ) );
+ }
+
+ wp_die( __( 'Sorry, you are not allowed to edit the links for this site.' ) );
+}
diff --git a/www/crm/wp-admin/includes/class-automatic-upgrader-skin.php b/www/crm/wp-admin/includes/class-automatic-upgrader-skin.php
new file mode 100644
index 00000000..5f8360f0
--- /dev/null
+++ b/www/crm/wp-admin/includes/class-automatic-upgrader-skin.php
@@ -0,0 +1,118 @@
+<?php
+/**
+ * Upgrader API: Automatic_Upgrader_Skin class
+ *
+ * @package WordPress
+ * @subpackage Upgrader
+ * @since 4.6.0
+ */
+
+/**
+ * Upgrader Skin for Automatic WordPress Upgrades
+ *
+ * This skin is designed to be used when no output is intended, all output
+ * is captured and stored for the caller to process and log/email/discard.
+ *
+ * @since 3.7.0
+ * @since 4.6.0 Moved to its own file from wp-admin/includes/class-wp-upgrader-skins.php.
+ *
+ * @see Bulk_Upgrader_Skin
+ */
+class Automatic_Upgrader_Skin extends WP_Upgrader_Skin {
+ protected $messages = array();
+
+ /**
+ * Determines whether the upgrader needs FTP/SSH details in order to connect
+ * to the filesystem.
+ *
+ * @since 3.7.0
+ * @since 4.6.0 The `$context` parameter default changed from `false` to an empty string.
+ *
+ * @see request_filesystem_credentials()
+ *
+ * @param bool $error Optional. Whether the current request has failed to connect.
+ * Default false.
+ * @param string $context Optional. Full path to the directory that is tested
+ * for being writable. Default empty.
+ * @param bool $allow_relaxed_file_ownership Optional. Whether to allow Group/World writable. Default false.
+ * @return bool True on success, false on failure.
+ */
+ public function request_filesystem_credentials( $error = false, $context = '', $allow_relaxed_file_ownership = false ) {
+ if ( $context ) {
+ $this->options['context'] = $context;
+ }
+ // TODO: fix up request_filesystem_credentials(), or split it, to allow us to request a no-output version
+ // This will output a credentials form in event of failure, We don't want that, so just hide with a buffer
+ ob_start();
+ $result = parent::request_filesystem_credentials( $error, $context, $allow_relaxed_file_ownership );
+ ob_end_clean();
+ return $result;
+ }
+
+ /**
+ * @return array
+ */
+ public function get_upgrade_messages() {
+ return $this->messages;
+ }
+
+ /**
+ * @param string|array|WP_Error $data
+ */
+ public function feedback( $data ) {
+ if ( is_wp_error( $data ) ) {
+ $string = $data->get_error_message();
+ } elseif ( is_array( $data ) ) {
+ return;
+ } else {
+ $string = $data;
+ }
+ if ( ! empty( $this->upgrader->strings[ $string ] ) ) {
+ $string = $this->upgrader->strings[ $string ];
+ }
+
+ if ( strpos( $string, '%' ) !== false ) {
+ $args = func_get_args();
+ $args = array_splice( $args, 1 );
+ if ( ! empty( $args ) ) {
+ $string = vsprintf( $string, $args );
+ }
+ }
+
+ $string = trim( $string );
+
+ // Only allow basic HTML in the messages, as it'll be used in emails/logs rather than direct browser output.
+ $string = wp_kses(
+ $string,
+ array(
+ 'a' => array(
+ 'href' => true,
+ ),
+ 'br' => true,
+ 'em' => true,
+ 'strong' => true,
+ )
+ );
+
+ if ( empty( $string ) ) {
+ return;
+ }
+
+ $this->messages[] = $string;
+ }
+
+ /**
+ */
+ public function header() {
+ ob_start();
+ }
+
+ /**
+ */
+ public function footer() {
+ $output = ob_get_clean();
+ if ( ! empty( $output ) ) {
+ $this->feedback( $output );
+ }
+ }
+}
diff --git a/www/crm/wp-admin/includes/class-bulk-plugin-upgrader-skin.php b/www/crm/wp-admin/includes/class-bulk-plugin-upgrader-skin.php
new file mode 100644
index 00000000..a568d6b1
--- /dev/null
+++ b/www/crm/wp-admin/includes/class-bulk-plugin-upgrader-skin.php
@@ -0,0 +1,68 @@
+<?php
+/**
+ * Upgrader API: Bulk_Plugin_Upgrader_Skin class
+ *
+ * @package WordPress
+ * @subpackage Upgrader
+ * @since 4.6.0
+ */
+
+/**
+ * Bulk Plugin Upgrader Skin for WordPress Plugin Upgrades.
+ *
+ * @since 3.0.0
+ * @since 4.6.0 Moved to its own file from wp-admin/includes/class-wp-upgrader-skins.php.
+ *
+ * @see Bulk_Upgrader_Skin
+ */
+class Bulk_Plugin_Upgrader_Skin extends Bulk_Upgrader_Skin {
+ public $plugin_info = array(); // Plugin_Upgrader::bulk_upgrade() will fill this in.
+
+ public function add_strings() {
+ parent::add_strings();
+ /* translators: 1: name of plugin being updated, 2: number of updating plugin, 3: total number of plugins being updated */
+ $this->upgrader->strings['skin_before_update_header'] = __( 'Updating Plugin %1$s (%2$d/%3$d)' );
+ }
+
+ /**
+ * @param string $title
+ */
+ public function before( $title = '' ) {
+ parent::before( $this->plugin_info['Title'] );
+ }
+
+ /**
+ * @param string $title
+ */
+ public function after( $title = '' ) {
+ parent::after( $this->plugin_info['Title'] );
+ $this->decrement_update_count( 'plugin' );
+ }
+
+ /**
+ */
+ public function bulk_footer() {
+ parent::bulk_footer();
+ $update_actions = array(
+ 'plugins_page' => '<a href="' . self_admin_url( 'plugins.php' ) . '" target="_parent">' . __( 'Return to Plugins page' ) . '</a>',
+ 'updates_page' => '<a href="' . self_admin_url( 'update-core.php' ) . '" target="_parent">' . __( 'Return to WordPress Updates page' ) . '</a>',
+ );
+ if ( ! current_user_can( 'activate_plugins' ) ) {
+ unset( $update_actions['plugins_page'] );
+ }
+
+ /**
+ * Filters the list of action links available following bulk plugin updates.
+ *
+ * @since 3.0.0
+ *
+ * @param string[] $update_actions Array of plugin action links.
+ * @param array $plugin_info Array of information for the last-updated plugin.
+ */
+ $update_actions = apply_filters( 'update_bulk_plugins_complete_actions', $update_actions, $this->plugin_info );
+
+ if ( ! empty( $update_actions ) ) {
+ $this->feedback( implode( ' | ', (array) $update_actions ) );
+ }
+ }
+}
diff --git a/www/crm/wp-admin/includes/class-bulk-theme-upgrader-skin.php b/www/crm/wp-admin/includes/class-bulk-theme-upgrader-skin.php
new file mode 100644
index 00000000..ce426e01
--- /dev/null
+++ b/www/crm/wp-admin/includes/class-bulk-theme-upgrader-skin.php
@@ -0,0 +1,68 @@
+<?php
+/**
+ * Upgrader API: Bulk_Plugin_Upgrader_Skin class
+ *
+ * @package WordPress
+ * @subpackage Upgrader
+ * @since 4.6.0
+ */
+
+/**
+ * Bulk Theme Upgrader Skin for WordPress Theme Upgrades.
+ *
+ * @since 3.0.0
+ * @since 4.6.0 Moved to its own file from wp-admin/includes/class-wp-upgrader-skins.php.
+ *
+ * @see Bulk_Upgrader_Skin
+ */
+class Bulk_Theme_Upgrader_Skin extends Bulk_Upgrader_Skin {
+ public $theme_info = array(); // Theme_Upgrader::bulk_upgrade() will fill this in.
+
+ public function add_strings() {
+ parent::add_strings();
+ /* translators: 1: name of theme being updated, 2: number of updating themes, 3: total number of themes being updated */
+ $this->upgrader->strings['skin_before_update_header'] = __( 'Updating Theme %1$s (%2$d/%3$d)' );
+ }
+
+ /**
+ * @param string $title
+ */
+ public function before( $title = '' ) {
+ parent::before( $this->theme_info->display( 'Name' ) );
+ }
+
+ /**
+ * @param string $title
+ */
+ public function after( $title = '' ) {
+ parent::after( $this->theme_info->display( 'Name' ) );
+ $this->decrement_update_count( 'theme' );
+ }
+
+ /**
+ */
+ public function bulk_footer() {
+ parent::bulk_footer();
+ $update_actions = array(
+ 'themes_page' => '<a href="' . self_admin_url( 'themes.php' ) . '" target="_parent">' . __( 'Return to Themes page' ) . '</a>',
+ 'updates_page' => '<a href="' . self_admin_url( 'update-core.php' ) . '" target="_parent">' . __( 'Return to WordPress Updates page' ) . '</a>',
+ );
+ if ( ! current_user_can( 'switch_themes' ) && ! current_user_can( 'edit_theme_options' ) ) {
+ unset( $update_actions['themes_page'] );
+ }
+
+ /**
+ * Filters the list of action links available following bulk theme updates.
+ *
+ * @since 3.0.0
+ *
+ * @param string[] $update_actions Array of theme action links.
+ * @param WP_Theme $theme_info Theme object for the last-updated theme.
+ */
+ $update_actions = apply_filters( 'update_bulk_theme_complete_actions', $update_actions, $this->theme_info );
+
+ if ( ! empty( $update_actions ) ) {
+ $this->feedback( implode( ' | ', (array) $update_actions ) );
+ }
+ }
+}
diff --git a/www/crm/wp-admin/includes/class-bulk-upgrader-skin.php b/www/crm/wp-admin/includes/class-bulk-upgrader-skin.php
new file mode 100644
index 00000000..c1454e62
--- /dev/null
+++ b/www/crm/wp-admin/includes/class-bulk-upgrader-skin.php
@@ -0,0 +1,178 @@
+<?php
+/**
+ * Upgrader API: Bulk_Upgrader_Skin class
+ *
+ * @package WordPress
+ * @subpackage Upgrader
+ * @since 4.6.0
+ */
+
+/**
+ * Generic Bulk Upgrader Skin for WordPress Upgrades.
+ *
+ * @since 3.0.0
+ * @since 4.6.0 Moved to its own file from wp-admin/includes/class-wp-upgrader-skins.php.
+ *
+ * @see WP_Upgrader_Skin
+ */
+class Bulk_Upgrader_Skin extends WP_Upgrader_Skin {
+ public $in_loop = false;
+ /**
+ * @var string|false
+ */
+ public $error = false;
+
+ /**
+ * @param array $args
+ */
+ public function __construct( $args = array() ) {
+ $defaults = array(
+ 'url' => '',
+ 'nonce' => '',
+ );
+ $args = wp_parse_args( $args, $defaults );
+
+ parent::__construct( $args );
+ }
+
+ /**
+ */
+ public function add_strings() {
+ $this->upgrader->strings['skin_upgrade_start'] = __( 'The update process is starting. This process may take a while on some hosts, so please be patient.' );
+ /* translators: 1: Title of an update, 2: Error message */
+ $this->upgrader->strings['skin_update_failed_error'] = __( 'An error occurred while updating %1$s: %2$s' );
+ /* translators: %s: Title of an update */
+ $this->upgrader->strings['skin_update_failed'] = __( 'The update of %s failed.' );
+ /* translators: %s: Title of an update */
+ $this->upgrader->strings['skin_update_successful'] = __( '%s updated successfully.' );
+ $this->upgrader->strings['skin_upgrade_end'] = __( 'All updates have been completed.' );
+ }
+
+ /**
+ * @param string $string
+ */
+ public function feedback( $string ) {
+ if ( isset( $this->upgrader->strings[ $string ] ) ) {
+ $string = $this->upgrader->strings[ $string ];
+ }
+
+ if ( strpos( $string, '%' ) !== false ) {
+ $args = func_get_args();
+ $args = array_splice( $args, 1 );
+ if ( $args ) {
+ $args = array_map( 'strip_tags', $args );
+ $args = array_map( 'esc_html', $args );
+ $string = vsprintf( $string, $args );
+ }
+ }
+ if ( empty( $string ) ) {
+ return;
+ }
+ if ( $this->in_loop ) {
+ echo "$string<br />\n";
+ } else {
+ echo "<p>$string</p>\n";
+ }
+ }
+
+ /**
+ */
+ public function header() {
+ // Nothing, This will be displayed within a iframe.
+ }
+
+ /**
+ */
+ public function footer() {
+ // Nothing, This will be displayed within a iframe.
+ }
+
+ /**
+ * @param string|WP_Error $error
+ */
+ public function error( $error ) {
+ if ( is_string( $error ) && isset( $this->upgrader->strings[ $error ] ) ) {
+ $this->error = $this->upgrader->strings[ $error ];
+ }
+
+ if ( is_wp_error( $error ) ) {
+ $messages = array();
+ foreach ( $error->get_error_messages() as $emessage ) {
+ if ( $error->get_error_data() && is_string( $error->get_error_data() ) ) {
+ $messages[] = $emessage . ' ' . esc_html( strip_tags( $error->get_error_data() ) );
+ } else {
+ $messages[] = $emessage;
+ }
+ }
+ $this->error = implode( ', ', $messages );
+ }
+ echo '<script type="text/javascript">jQuery(\'.waiting-' . esc_js( $this->upgrader->update_current ) . '\').hide();</script>';
+ }
+
+ /**
+ */
+ public function bulk_header() {
+ $this->feedback( 'skin_upgrade_start' );
+ }
+
+ /**
+ */
+ public function bulk_footer() {
+ $this->feedback( 'skin_upgrade_end' );
+ }
+
+ /**
+ * @param string $title
+ */
+ public function before( $title = '' ) {
+ $this->in_loop = true;
+ printf( '<h2>' . $this->upgrader->strings['skin_before_update_header'] . ' <span class="spinner waiting-' . $this->upgrader->update_current . '"></span></h2>', $title, $this->upgrader->update_current, $this->upgrader->update_count );
+ echo '<script type="text/javascript">jQuery(\'.waiting-' . esc_js( $this->upgrader->update_current ) . '\').css("display", "inline-block");</script>';
+ // This progress messages div gets moved via JavaScript when clicking on "Show details.".
+ echo '<div class="update-messages hide-if-js" id="progress-' . esc_attr( $this->upgrader->update_current ) . '"><p>';
+ $this->flush_output();
+ }
+
+ /**
+ * @param string $title
+ */
+ public function after( $title = '' ) {
+ echo '</p></div>';
+ if ( $this->error || ! $this->result ) {
+ if ( $this->error ) {
+ echo '<div class="error"><p>' . sprintf( $this->upgrader->strings['skin_update_failed_error'], $title, '<strong>' . $this->error . '</strong>' ) . '</p></div>';
+ } else {
+ echo '<div class="error"><p>' . sprintf( $this->upgrader->strings['skin_update_failed'], $title ) . '</p></div>';
+ }
+
+ echo '<script type="text/javascript">jQuery(\'#progress-' . esc_js( $this->upgrader->update_current ) . '\').show();</script>';
+ }
+ if ( $this->result && ! is_wp_error( $this->result ) ) {
+ if ( ! $this->error ) {
+ echo '<div class="updated js-update-details" data-update-details="progress-' . esc_attr( $this->upgrader->update_current ) . '">' .
+ '<p>' . sprintf( $this->upgrader->strings['skin_update_successful'], $title ) .
+ ' <button type="button" class="hide-if-no-js button-link js-update-details-toggle" aria-expanded="false">' . __( 'Show details.' ) . '</button>' .
+ '</p></div>';
+ }
+
+ echo '<script type="text/javascript">jQuery(\'.waiting-' . esc_js( $this->upgrader->update_current ) . '\').hide();</script>';
+ }
+
+ $this->reset();
+ $this->flush_output();
+ }
+
+ /**
+ */
+ public function reset() {
+ $this->in_loop = false;
+ $this->error = false;
+ }
+
+ /**
+ */
+ public function flush_output() {
+ wp_ob_end_flush_all();
+ flush();
+ }
+}
diff --git a/www/crm/wp-admin/includes/class-core-upgrader.php b/www/crm/wp-admin/includes/class-core-upgrader.php
new file mode 100644
index 00000000..977f6ec9
--- /dev/null
+++ b/www/crm/wp-admin/includes/class-core-upgrader.php
@@ -0,0 +1,406 @@
+<?php
+/**
+ * Upgrade API: Core_Upgrader class
+ *
+ * @package WordPress
+ * @subpackage Upgrader
+ * @since 4.6.0
+ */
+
+/**
+ * Core class used for updating core.
+ *
+ * It allows for WordPress to upgrade itself in combination with
+ * the wp-admin/includes/update-core.php file.
+ *
+ * @since 2.8.0
+ * @since 4.6.0 Moved to its own file from wp-admin/includes/class-wp-upgrader.php.
+ *
+ * @see WP_Upgrader
+ */
+class Core_Upgrader extends WP_Upgrader {
+
+ /**
+ * Initialize the upgrade strings.
+ *
+ * @since 2.8.0
+ */
+ public function upgrade_strings() {
+ $this->strings['up_to_date'] = __( 'WordPress is at the latest version.' );
+ $this->strings['locked'] = __( 'Another update is currently in progress.' );
+ $this->strings['no_package'] = __( 'Update package not available.' );
+ /* translators: %s: package URL */
+ $this->strings['downloading_package'] = sprintf( __( 'Downloading update from %s&#8230;' ), '<span class="code">%s</span>' );
+ $this->strings['unpack_package'] = __( 'Unpacking the update&#8230;' );
+ $this->strings['copy_failed'] = __( 'Could not copy files.' );
+ $this->strings['copy_failed_space'] = __( 'Could not copy files. You may have run out of disk space.' );
+ $this->strings['start_rollback'] = __( 'Attempting to roll back to previous version.' );
+ $this->strings['rollback_was_required'] = __( 'Due to an error during updating, WordPress has rolled back to your previous version.' );
+ }
+
+ /**
+ * Upgrade WordPress core.
+ *
+ * @since 2.8.0
+ *
+ * @global WP_Filesystem_Base $wp_filesystem WordPress filesystem subclass.
+ * @global callable $_wp_filesystem_direct_method
+ *
+ * @param object $current Response object for whether WordPress is current.
+ * @param array $args {
+ * Optional. Arguments for upgrading WordPress core. Default empty array.
+ *
+ * @type bool $pre_check_md5 Whether to check the file checksums before
+ * attempting the upgrade. Default true.
+ * @type bool $attempt_rollback Whether to attempt to rollback the chances if
+ * there is a problem. Default false.
+ * @type bool $do_rollback Whether to perform this "upgrade" as a rollback.
+ * Default false.
+ * }
+ * @return null|false|WP_Error False or WP_Error on failure, null on success.
+ */
+ public function upgrade( $current, $args = array() ) {
+ global $wp_filesystem;
+
+ include( ABSPATH . WPINC . '/version.php' ); // $wp_version;
+
+ $start_time = time();
+
+ $defaults = array(
+ 'pre_check_md5' => true,
+ 'attempt_rollback' => false,
+ 'do_rollback' => false,
+ 'allow_relaxed_file_ownership' => false,
+ );
+ $parsed_args = wp_parse_args( $args, $defaults );
+
+ $this->init();
+ $this->upgrade_strings();
+
+ // Is an update available?
+ if ( ! isset( $current->response ) || $current->response == 'latest' ) {
+ return new WP_Error( 'up_to_date', $this->strings['up_to_date'] );
+ }
+
+ $res = $this->fs_connect( array( ABSPATH, WP_CONTENT_DIR ), $parsed_args['allow_relaxed_file_ownership'] );
+ if ( ! $res || is_wp_error( $res ) ) {
+ return $res;
+ }
+
+ $wp_dir = trailingslashit( $wp_filesystem->abspath() );
+
+ $partial = true;
+ if ( $parsed_args['do_rollback'] ) {
+ $partial = false;
+ } elseif ( $parsed_args['pre_check_md5'] && ! $this->check_files() ) {
+ $partial = false;
+ }
+
+ /*
+ * If partial update is returned from the API, use that, unless we're doing
+ * a reinstallation. If we cross the new_bundled version number, then use
+ * the new_bundled zip. Don't though if the constant is set to skip bundled items.
+ * If the API returns a no_content zip, go with it. Finally, default to the full zip.
+ */
+ if ( $parsed_args['do_rollback'] && $current->packages->rollback ) {
+ $to_download = 'rollback';
+ } elseif ( $current->packages->partial && 'reinstall' != $current->response && $wp_version == $current->partial_version && $partial ) {
+ $to_download = 'partial';
+ } elseif ( $current->packages->new_bundled && version_compare( $wp_version, $current->new_bundled, '<' )
+ && ( ! defined( 'CORE_UPGRADE_SKIP_NEW_BUNDLED' ) || ! CORE_UPGRADE_SKIP_NEW_BUNDLED ) ) {
+ $to_download = 'new_bundled';
+ } elseif ( $current->packages->no_content ) {
+ $to_download = 'no_content';
+ } else {
+ $to_download = 'full';
+ }
+
+ // Lock to prevent multiple Core Updates occurring
+ $lock = WP_Upgrader::create_lock( 'core_updater', 15 * MINUTE_IN_SECONDS );
+ if ( ! $lock ) {
+ return new WP_Error( 'locked', $this->strings['locked'] );
+ }
+
+ $download = $this->download_package( $current->packages->$to_download, true );
+
+ // Allow for signature soft-fail.
+ // WARNING: This may be removed in the future.
+ if ( is_wp_error( $download ) && $download->get_error_data( 'softfail-filename' ) ) {
+ // Outout the failure error as a normal feedback, and not as an error:
+ apply_filters( 'update_feedback', $download->get_error_message() );
+
+ // Report this failure back to WordPress.org for debugging purposes.
+ wp_version_check(
+ array(
+ 'signature_failure_code' => $download->get_error_code(),
+ 'signature_failure_data' => $download->get_error_data(),
+ )
+ );
+
+ // Pretend this error didn't happen.
+ $download = $download->get_error_data( 'softfail-filename' );
+ }
+
+ if ( is_wp_error( $download ) ) {
+ WP_Upgrader::release_lock( 'core_updater' );
+ return $download;
+ }
+
+ $working_dir = $this->unpack_package( $download );
+ if ( is_wp_error( $working_dir ) ) {
+ WP_Upgrader::release_lock( 'core_updater' );
+ return $working_dir;
+ }
+
+ // Copy update-core.php from the new version into place.
+ if ( ! $wp_filesystem->copy( $working_dir . '/wordpress/wp-admin/includes/update-core.php', $wp_dir . 'wp-admin/includes/update-core.php', true ) ) {
+ $wp_filesystem->delete( $working_dir, true );
+ WP_Upgrader::release_lock( 'core_updater' );
+ return new WP_Error( 'copy_failed_for_update_core_file', __( 'The update cannot be installed because we will be unable to copy some files. This is usually due to inconsistent file permissions.' ), 'wp-admin/includes/update-core.php' );
+ }
+ $wp_filesystem->chmod( $wp_dir . 'wp-admin/includes/update-core.php', FS_CHMOD_FILE );
+
+ require_once( ABSPATH . 'wp-admin/includes/update-core.php' );
+
+ if ( ! function_exists( 'update_core' ) ) {
+ WP_Upgrader::release_lock( 'core_updater' );
+ return new WP_Error( 'copy_failed_space', $this->strings['copy_failed_space'] );
+ }
+
+ $result = update_core( $working_dir, $wp_dir );
+
+ // In the event of an issue, we may be able to roll back.
+ if ( $parsed_args['attempt_rollback'] && $current->packages->rollback && ! $parsed_args['do_rollback'] ) {
+ $try_rollback = false;
+ if ( is_wp_error( $result ) ) {
+ $error_code = $result->get_error_code();
+ /*
+ * Not all errors are equal. These codes are critical: copy_failed__copy_dir,
+ * mkdir_failed__copy_dir, copy_failed__copy_dir_retry, and disk_full.
+ * do_rollback allows for update_core() to trigger a rollback if needed.
+ */
+ if ( false !== strpos( $error_code, 'do_rollback' ) ) {
+ $try_rollback = true;
+ } elseif ( false !== strpos( $error_code, '__copy_dir' ) ) {
+ $try_rollback = true;
+ } elseif ( 'disk_full' === $error_code ) {
+ $try_rollback = true;
+ }
+ }
+
+ if ( $try_rollback ) {
+ /** This filter is documented in wp-admin/includes/update-core.php */
+ apply_filters( 'update_feedback', $result );
+
+ /** This filter is documented in wp-admin/includes/update-core.php */
+ apply_filters( 'update_feedback', $this->strings['start_rollback'] );
+
+ $rollback_result = $this->upgrade( $current, array_merge( $parsed_args, array( 'do_rollback' => true ) ) );
+
+ $original_result = $result;
+ $result = new WP_Error(
+ 'rollback_was_required',
+ $this->strings['rollback_was_required'],
+ (object) array(
+ 'update' => $original_result,
+ 'rollback' => $rollback_result,
+ )
+ );
+ }
+ }
+
+ /** This action is documented in wp-admin/includes/class-wp-upgrader.php */
+ do_action(
+ 'upgrader_process_complete',
+ $this,
+ array(
+ 'action' => 'update',
+ 'type' => 'core',
+ )
+ );
+
+ // Clear the current updates
+ delete_site_transient( 'update_core' );
+
+ if ( ! $parsed_args['do_rollback'] ) {
+ $stats = array(
+ 'update_type' => $current->response,
+ 'success' => true,
+ 'fs_method' => $wp_filesystem->method,
+ 'fs_method_forced' => defined( 'FS_METHOD' ) || has_filter( 'filesystem_method' ),
+ 'fs_method_direct' => ! empty( $GLOBALS['_wp_filesystem_direct_method'] ) ? $GLOBALS['_wp_filesystem_direct_method'] : '',
+ 'time_taken' => time() - $start_time,
+ 'reported' => $wp_version,
+ 'attempted' => $current->version,
+ );
+
+ if ( is_wp_error( $result ) ) {
+ $stats['success'] = false;
+ // Did a rollback occur?
+ if ( ! empty( $try_rollback ) ) {
+ $stats['error_code'] = $original_result->get_error_code();
+ $stats['error_data'] = $original_result->get_error_data();
+ // Was the rollback successful? If not, collect its error too.
+ $stats['rollback'] = ! is_wp_error( $rollback_result );
+ if ( is_wp_error( $rollback_result ) ) {
+ $stats['rollback_code'] = $rollback_result->get_error_code();
+ $stats['rollback_data'] = $rollback_result->get_error_data();
+ }
+ } else {
+ $stats['error_code'] = $result->get_error_code();
+ $stats['error_data'] = $result->get_error_data();
+ }
+ }
+
+ wp_version_check( $stats );
+ }
+
+ WP_Upgrader::release_lock( 'core_updater' );
+
+ return $result;
+ }
+
+ /**
+ * Determines if this WordPress Core version should update to an offered version or not.
+ *
+ * @since 3.7.0
+ *
+ * @param string $offered_ver The offered version, of the format x.y.z.
+ * @return bool True if we should update to the offered version, otherwise false.
+ */
+ public static function should_update_to_version( $offered_ver ) {
+ include( ABSPATH . WPINC . '/version.php' ); // $wp_version; // x.y.z
+
+ $current_branch = implode( '.', array_slice( preg_split( '/[.-]/', $wp_version ), 0, 2 ) ); // x.y
+ $new_branch = implode( '.', array_slice( preg_split( '/[.-]/', $offered_ver ), 0, 2 ) ); // x.y
+ $current_is_development_version = (bool) strpos( $wp_version, '-' );
+
+ // Defaults:
+ $upgrade_dev = true;
+ $upgrade_minor = true;
+ $upgrade_major = false;
+
+ // WP_AUTO_UPDATE_CORE = true (all), 'minor', false.
+ if ( defined( 'WP_AUTO_UPDATE_CORE' ) ) {
+ if ( false === WP_AUTO_UPDATE_CORE ) {
+ // Defaults to turned off, unless a filter allows it
+ $upgrade_dev = $upgrade_minor = $upgrade_major = false;
+ } elseif ( true === WP_AUTO_UPDATE_CORE ) {
+ // ALL updates for core
+ $upgrade_dev = $upgrade_minor = $upgrade_major = true;
+ } elseif ( 'minor' === WP_AUTO_UPDATE_CORE ) {
+ // Only minor updates for core
+ $upgrade_dev = $upgrade_major = false;
+ $upgrade_minor = true;
+ }
+ }
+
+ // 1: If we're already on that version, not much point in updating?
+ if ( $offered_ver == $wp_version ) {
+ return false;
+ }
+
+ // 2: If we're running a newer version, that's a nope
+ if ( version_compare( $wp_version, $offered_ver, '>' ) ) {
+ return false;
+ }
+
+ $failure_data = get_site_option( 'auto_core_update_failed' );
+ if ( $failure_data ) {
+ // If this was a critical update failure, cannot update.
+ if ( ! empty( $failure_data['critical'] ) ) {
+ return false;
+ }
+
+ // Don't claim we can update on update-core.php if we have a non-critical failure logged.
+ if ( $wp_version == $failure_data['current'] && false !== strpos( $offered_ver, '.1.next.minor' ) ) {
+ return false;
+ }
+
+ // Cannot update if we're retrying the same A to B update that caused a non-critical failure.
+ // Some non-critical failures do allow retries, like download_failed.
+ // 3.7.1 => 3.7.2 resulted in files_not_writable, if we are still on 3.7.1 and still trying to update to 3.7.2.
+ if ( empty( $failure_data['retry'] ) && $wp_version == $failure_data['current'] && $offered_ver == $failure_data['attempted'] ) {
+ return false;
+ }
+ }
+
+ // 3: 3.7-alpha-25000 -> 3.7-alpha-25678 -> 3.7-beta1 -> 3.7-beta2
+ if ( $current_is_development_version ) {
+
+ /**
+ * Filters whether to enable automatic core updates for development versions.
+ *
+ * @since 3.7.0
+ *
+ * @param bool $upgrade_dev Whether to enable automatic updates for
+ * development versions.
+ */
+ if ( ! apply_filters( 'allow_dev_auto_core_updates', $upgrade_dev ) ) {
+ return false;
+ }
+ // Else fall through to minor + major branches below.
+ }
+
+ // 4: Minor In-branch updates (3.7.0 -> 3.7.1 -> 3.7.2 -> 3.7.4)
+ if ( $current_branch == $new_branch ) {
+
+ /**
+ * Filters whether to enable minor automatic core updates.
+ *
+ * @since 3.7.0
+ *
+ * @param bool $upgrade_minor Whether to enable minor automatic core updates.
+ */
+ return apply_filters( 'allow_minor_auto_core_updates', $upgrade_minor );
+ }
+
+ // 5: Major version updates (3.7.0 -> 3.8.0 -> 3.9.1)
+ if ( version_compare( $new_branch, $current_branch, '>' ) ) {
+
+ /**
+ * Filters whether to enable major automatic core updates.
+ *
+ * @since 3.7.0
+ *
+ * @param bool $upgrade_major Whether to enable major automatic core updates.
+ */
+ return apply_filters( 'allow_major_auto_core_updates', $upgrade_major );
+ }
+
+ // If we're not sure, we don't want it
+ return false;
+ }
+
+ /**
+ * Compare the disk file checksums against the expected checksums.
+ *
+ * @since 3.7.0
+ *
+ * @global string $wp_version
+ * @global string $wp_local_package
+ *
+ * @return bool True if the checksums match, otherwise false.
+ */
+ public function check_files() {
+ global $wp_version, $wp_local_package;
+
+ $checksums = get_core_checksums( $wp_version, isset( $wp_local_package ) ? $wp_local_package : 'en_US' );
+
+ if ( ! is_array( $checksums ) ) {
+ return false;
+ }
+
+ foreach ( $checksums as $file => $checksum ) {
+ // Skip files which get updated
+ if ( 'wp-content' == substr( $file, 0, 10 ) ) {
+ continue;
+ }
+ if ( ! file_exists( ABSPATH . $file ) || md5_file( ABSPATH . $file ) !== $checksum ) {
+ return false;
+ }
+ }
+
+ return true;
+ }
+}
diff --git a/www/crm/wp-admin/includes/class-file-upload-upgrader.php b/www/crm/wp-admin/includes/class-file-upload-upgrader.php
new file mode 100644
index 00000000..c3d8a795
--- /dev/null
+++ b/www/crm/wp-admin/includes/class-file-upload-upgrader.php
@@ -0,0 +1,132 @@
+<?php
+/**
+ * Upgrade API: File_Upload_Upgrader class
+ *
+ * @package WordPress
+ * @subpackage Upgrader
+ * @since 4.6.0
+ */
+
+/**
+ * Core class used for handling file uploads.
+ *
+ * This class handles the upload process and passes it as if it's a local file
+ * to the Upgrade/Installer functions.
+ *
+ * @since 2.8.0
+ * @since 4.6.0 Moved to its own file from wp-admin/includes/class-wp-upgrader.php.
+ */
+class File_Upload_Upgrader {
+
+ /**
+ * The full path to the file package.
+ *
+ * @since 2.8.0
+ * @var string $package
+ */
+ public $package;
+
+ /**
+ * The name of the file.
+ *
+ * @since 2.8.0
+ * @var string $filename
+ */
+ public $filename;
+
+ /**
+ * The ID of the attachment post for this file.
+ *
+ * @since 3.3.0
+ * @var int $id
+ */
+ public $id = 0;
+
+ /**
+ * Construct the upgrader for a form.
+ *
+ * @since 2.8.0
+ *
+ * @param string $form The name of the form the file was uploaded from.
+ * @param string $urlholder The name of the `GET` parameter that holds the filename.
+ */
+ public function __construct( $form, $urlholder ) {
+
+ if ( empty( $_FILES[ $form ]['name'] ) && empty( $_GET[ $urlholder ] ) ) {
+ wp_die( __( 'Please select a file' ) );
+ }
+
+ //Handle a newly uploaded file, Else assume it's already been uploaded
+ if ( ! empty( $_FILES ) ) {
+ $overrides = array(
+ 'test_form' => false,
+ 'test_type' => false,
+ );
+ $file = wp_handle_upload( $_FILES[ $form ], $overrides );
+
+ if ( isset( $file['error'] ) ) {
+ wp_die( $file['error'] );
+ }
+
+ $this->filename = $_FILES[ $form ]['name'];
+ $this->package = $file['file'];
+
+ // Construct the object array
+ $object = array(
+ 'post_title' => $this->filename,
+ 'post_content' => $file['url'],
+ 'post_mime_type' => $file['type'],
+ 'guid' => $file['url'],
+ 'context' => 'upgrader',
+ 'post_status' => 'private',
+ );
+
+ // Save the data.
+ $this->id = wp_insert_attachment( $object, $file['file'] );
+
+ // Schedule a cleanup for 2 hours from now in case of failed installation.
+ wp_schedule_single_event( time() + 2 * HOUR_IN_SECONDS, 'upgrader_scheduled_cleanup', array( $this->id ) );
+
+ } elseif ( is_numeric( $_GET[ $urlholder ] ) ) {
+ // Numeric Package = previously uploaded file, see above.
+ $this->id = (int) $_GET[ $urlholder ];
+ $attachment = get_post( $this->id );
+ if ( empty( $attachment ) ) {
+ wp_die( __( 'Please select a file' ) );
+ }
+
+ $this->filename = $attachment->post_title;
+ $this->package = get_attached_file( $attachment->ID );
+ } else {
+ // Else, It's set to something, Back compat for plugins using the old (pre-3.3) File_Uploader handler.
+ if ( ! ( ( $uploads = wp_upload_dir() ) && false === $uploads['error'] ) ) {
+ wp_die( $uploads['error'] );
+ }
+
+ $this->filename = sanitize_file_name( $_GET[ $urlholder ] );
+ $this->package = $uploads['basedir'] . '/' . $this->filename;
+
+ if ( 0 !== strpos( realpath( $this->package ), realpath( $uploads['basedir'] ) ) ) {
+ wp_die( __( 'Please select a file' ) );
+ }
+ }
+ }
+
+ /**
+ * Delete the attachment/uploaded file.
+ *
+ * @since 3.2.2
+ *
+ * @return bool Whether the cleanup was successful.
+ */
+ public function cleanup() {
+ if ( $this->id ) {
+ wp_delete_attachment( $this->id );
+
+ } elseif ( file_exists( $this->package ) ) {
+ return @unlink( $this->package );
+ }
+
+ return true;
+ }
+}
diff --git a/www/crm/wp-admin/includes/class-ftp-pure.php b/www/crm/wp-admin/includes/class-ftp-pure.php
new file mode 100644
index 00000000..c40df637
--- /dev/null
+++ b/www/crm/wp-admin/includes/class-ftp-pure.php
@@ -0,0 +1,186 @@
+<?php
+/**
+ * PemFTP - An Ftp implementation in pure PHP
+ *
+ * @package PemFTP
+ * @since 2.5.0
+ *
+ * @version 1.0
+ * @copyright Alexey Dotsenko
+ * @author Alexey Dotsenko
+ * @link http://www.phpclasses.org/browse/package/1743.html Site
+ * @license LGPL http://www.opensource.org/licenses/lgpl-license.html
+ */
+
+/**
+ * FTP implementation using fsockopen to connect.
+ *
+ * @package PemFTP
+ * @subpackage Pure
+ * @since 2.5.0
+ *
+ * @version 1.0
+ * @copyright Alexey Dotsenko
+ * @author Alexey Dotsenko
+ * @link http://www.phpclasses.org/browse/package/1743.html Site
+ * @license LGPL http://www.opensource.org/licenses/lgpl-license.html
+ */
+class ftp_pure extends ftp_base {
+
+ function __construct($verb=FALSE, $le=FALSE) {
+ parent::__construct(false, $verb, $le);
+ }
+
+// <!-- --------------------------------------------------------------------------------------- -->
+// <!-- Private functions -->
+// <!-- --------------------------------------------------------------------------------------- -->
+
+ function _settimeout($sock) {
+ if(!@stream_set_timeout($sock, $this->_timeout)) {
+ $this->PushError('_settimeout','socket set send timeout');
+ $this->_quit();
+ return FALSE;
+ }
+ return TRUE;
+ }
+
+ function _connect($host, $port) {
+ $this->SendMSG("Creating socket");
+ $sock = @fsockopen($host, $port, $errno, $errstr, $this->_timeout);
+ if (!$sock) {
+ $this->PushError('_connect','socket connect failed', $errstr." (".$errno.")");
+ return FALSE;
+ }
+ $this->_connected=true;
+ return $sock;
+ }
+
+ function _readmsg($fnction="_readmsg"){
+ if(!$this->_connected) {
+ $this->PushError($fnction, 'Connect first');
+ return FALSE;
+ }
+ $result=true;
+ $this->_message="";
+ $this->_code=0;
+ $go=true;
+ do {
+ $tmp=@fgets($this->_ftp_control_sock, 512);
+ if($tmp===false) {
+ $go=$result=false;
+ $this->PushError($fnction,'Read failed');
+ } else {
+ $this->_message.=$tmp;
+ if(preg_match("/^([0-9]{3})(-(.*[".CRLF."]{1,2})+\\1)? [^".CRLF."]+[".CRLF."]{1,2}$/", $this->_message, $regs)) $go=false;
+ }
+ } while($go);
+ if($this->LocalEcho) echo "GET < ".rtrim($this->_message, CRLF).CRLF;
+ $this->_code=(int)$regs[1];
+ return $result;
+ }
+
+ function _exec($cmd, $fnction="_exec") {
+ if(!$this->_ready) {
+ $this->PushError($fnction,'Connect first');
+ return FALSE;
+ }
+ if($this->LocalEcho) echo "PUT > ",$cmd,CRLF;
+ $status=@fputs($this->_ftp_control_sock, $cmd.CRLF);
+ if($status===false) {
+ $this->PushError($fnction,'socket write failed');
+ return FALSE;
+ }
+ $this->_lastaction=time();
+ if(!$this->_readmsg($fnction)) return FALSE;
+ return TRUE;
+ }
+
+ function _data_prepare($mode=FTP_ASCII) {
+ if(!$this->_settype($mode)) return FALSE;
+ if($this->_passive) {
+ if(!$this->_exec("PASV", "pasv")) {
+ $this->_data_close();
+ return FALSE;
+ }
+ if(!$this->_checkCode()) {
+ $this->_data_close();
+ return FALSE;
+ }
+ $ip_port = explode(",", preg_replace("/^.+ \\(?([0-9]{1,3},[0-9]{1,3},[0-9]{1,3},[0-9]{1,3},[0-9]+,[0-9]+)\\)?.*$/s", "\\1", $this->_message));
+ $this->_datahost=$ip_port[0].".".$ip_port[1].".".$ip_port[2].".".$ip_port[3];
+ $this->_dataport=(((int)$ip_port[4])<<8) + ((int)$ip_port[5]);
+ $this->SendMSG("Connecting to ".$this->_datahost.":".$this->_dataport);
+ $this->_ftp_data_sock=@fsockopen($this->_datahost, $this->_dataport, $errno, $errstr, $this->_timeout);
+ if(!$this->_ftp_data_sock) {
+ $this->PushError("_data_prepare","fsockopen fails", $errstr." (".$errno.")");
+ $this->_data_close();
+ return FALSE;
+ }
+ else $this->_ftp_data_sock;
+ } else {
+ $this->SendMSG("Only passive connections available!");
+ return FALSE;
+ }
+ return TRUE;
+ }
+
+ function _data_read($mode=FTP_ASCII, $fp=NULL) {
+ if(is_resource($fp)) $out=0;
+ else $out="";
+ if(!$this->_passive) {
+ $this->SendMSG("Only passive connections available!");
+ return FALSE;
+ }
+ while (!feof($this->_ftp_data_sock)) {
+ $block=fread($this->_ftp_data_sock, $this->_ftp_buff_size);
+ if($mode!=FTP_BINARY) $block=preg_replace("/\r\n|\r|\n/", $this->_eol_code[$this->OS_local], $block);
+ if(is_resource($fp)) $out+=fwrite($fp, $block, strlen($block));
+ else $out.=$block;
+ }
+ return $out;
+ }
+
+ function _data_write($mode=FTP_ASCII, $fp=NULL) {
+ if(is_resource($fp)) $out=0;
+ else $out="";
+ if(!$this->_passive) {
+ $this->SendMSG("Only passive connections available!");
+ return FALSE;
+ }
+ if(is_resource($fp)) {
+ while(!feof($fp)) {
+ $block=fread($fp, $this->_ftp_buff_size);
+ if(!$this->_data_write_block($mode, $block)) return false;
+ }
+ } elseif(!$this->_data_write_block($mode, $fp)) return false;
+ return TRUE;
+ }
+
+ function _data_write_block($mode, $block) {
+ if($mode!=FTP_BINARY) $block=preg_replace("/\r\n|\r|\n/", $this->_eol_code[$this->OS_remote], $block);
+ do {
+ if(($t=@fwrite($this->_ftp_data_sock, $block))===FALSE) {
+ $this->PushError("_data_write","Can't write to socket");
+ return FALSE;
+ }
+ $block=substr($block, $t);
+ } while(!empty($block));
+ return true;
+ }
+
+ function _data_close() {
+ @fclose($this->_ftp_data_sock);
+ $this->SendMSG("Disconnected data from remote host");
+ return TRUE;
+ }
+
+ function _quit($force=FALSE) {
+ if($this->_connected or $force) {
+ @fclose($this->_ftp_control_sock);
+ $this->_connected=false;
+ $this->SendMSG("Socket closed");
+ }
+ }
+}
+
+?>
diff --git a/www/crm/wp-admin/includes/class-ftp-sockets.php b/www/crm/wp-admin/includes/class-ftp-sockets.php
new file mode 100644
index 00000000..1ebedc77
--- /dev/null
+++ b/www/crm/wp-admin/includes/class-ftp-sockets.php
@@ -0,0 +1,246 @@
+<?php
+/**
+ * PemFTP - An Ftp implementation in pure PHP
+ *
+ * @package PemFTP
+ * @since 2.5.0
+ *
+ * @version 1.0
+ * @copyright Alexey Dotsenko
+ * @author Alexey Dotsenko
+ * @link http://www.phpclasses.org/browse/package/1743.html Site
+ * @license LGPL http://www.opensource.org/licenses/lgpl-license.html
+ */
+
+/**
+ * Socket Based FTP implementation
+ *
+ * @package PemFTP
+ * @subpackage Socket
+ * @since 2.5.0
+ *
+ * @version 1.0
+ * @copyright Alexey Dotsenko
+ * @author Alexey Dotsenko
+ * @link http://www.phpclasses.org/browse/package/1743.html Site
+ * @license LGPL http://www.opensource.org/licenses/lgpl-license.html
+ */
+class ftp_sockets extends ftp_base {
+
+ function __construct($verb=FALSE, $le=FALSE) {
+ parent::__construct(true, $verb, $le);
+ }
+
+// <!-- --------------------------------------------------------------------------------------- -->
+// <!-- Private functions -->
+// <!-- --------------------------------------------------------------------------------------- -->
+
+ function _settimeout($sock) {
+ if(!@socket_set_option($sock, SOL_SOCKET, SO_RCVTIMEO, array("sec"=>$this->_timeout, "usec"=>0))) {
+ $this->PushError('_connect','socket set receive timeout',socket_strerror(socket_last_error($sock)));
+ @socket_close($sock);
+ return FALSE;
+ }
+ if(!@socket_set_option($sock, SOL_SOCKET , SO_SNDTIMEO, array("sec"=>$this->_timeout, "usec"=>0))) {
+ $this->PushError('_connect','socket set send timeout',socket_strerror(socket_last_error($sock)));
+ @socket_close($sock);
+ return FALSE;
+ }
+ return true;
+ }
+
+ function _connect($host, $port) {
+ $this->SendMSG("Creating socket");
+ if(!($sock = @socket_create(AF_INET, SOCK_STREAM, SOL_TCP))) {
+ $this->PushError('_connect','socket create failed',socket_strerror(socket_last_error($sock)));
+ return FALSE;
+ }
+ if(!$this->_settimeout($sock)) return FALSE;
+ $this->SendMSG("Connecting to \"".$host.":".$port."\"");
+ if (!($res = @socket_connect($sock, $host, $port))) {
+ $this->PushError('_connect','socket connect failed',socket_strerror(socket_last_error($sock)));
+ @socket_close($sock);
+ return FALSE;
+ }
+ $this->_connected=true;
+ return $sock;
+ }
+
+ function _readmsg($fnction="_readmsg"){
+ if(!$this->_connected) {
+ $this->PushError($fnction,'Connect first');
+ return FALSE;
+ }
+ $result=true;
+ $this->_message="";
+ $this->_code=0;
+ $go=true;
+ do {
+ $tmp=@socket_read($this->_ftp_control_sock, 4096, PHP_BINARY_READ);
+ if($tmp===false) {
+ $go=$result=false;
+ $this->PushError($fnction,'Read failed', socket_strerror(socket_last_error($this->_ftp_control_sock)));
+ } else {
+ $this->_message.=$tmp;
+ $go = !preg_match("/^([0-9]{3})(-.+\\1)? [^".CRLF."]+".CRLF."$/Us", $this->_message, $regs);
+ }
+ } while($go);
+ if($this->LocalEcho) echo "GET < ".rtrim($this->_message, CRLF).CRLF;
+ $this->_code=(int)$regs[1];
+ return $result;
+ }
+
+ function _exec($cmd, $fnction="_exec") {
+ if(!$this->_ready) {
+ $this->PushError($fnction,'Connect first');
+ return FALSE;
+ }
+ if($this->LocalEcho) echo "PUT > ",$cmd,CRLF;
+ $status=@socket_write($this->_ftp_control_sock, $cmd.CRLF);
+ if($status===false) {
+ $this->PushError($fnction,'socket write failed', socket_strerror(socket_last_error($this->stream)));
+ return FALSE;
+ }
+ $this->_lastaction=time();
+ if(!$this->_readmsg($fnction)) return FALSE;
+ return TRUE;
+ }
+
+ function _data_prepare($mode=FTP_ASCII) {
+ if(!$this->_settype($mode)) return FALSE;
+ $this->SendMSG("Creating data socket");
+ $this->_ftp_data_sock = @socket_create(AF_INET, SOCK_STREAM, SOL_TCP);
+ if ($this->_ftp_data_sock < 0) {
+ $this->PushError('_data_prepare','socket create failed',socket_strerror(socket_last_error($this->_ftp_data_sock)));
+ return FALSE;
+ }
+ if(!$this->_settimeout($this->_ftp_data_sock)) {
+ $this->_data_close();
+ return FALSE;
+ }
+ if($this->_passive) {
+ if(!$this->_exec("PASV", "pasv")) {
+ $this->_data_close();
+ return FALSE;
+ }
+ if(!$this->_checkCode()) {
+ $this->_data_close();
+ return FALSE;
+ }
+ $ip_port = explode(",", preg_replace("/^.+ \\(?([0-9]{1,3},[0-9]{1,3},[0-9]{1,3},[0-9]{1,3},[0-9]+,[0-9]+)\\)?.*$/s", "\\1", $this->_message));
+ $this->_datahost=$ip_port[0].".".$ip_port[1].".".$ip_port[2].".".$ip_port[3];
+ $this->_dataport=(((int)$ip_port[4])<<8) + ((int)$ip_port[5]);
+ $this->SendMSG("Connecting to ".$this->_datahost.":".$this->_dataport);
+ if(!@socket_connect($this->_ftp_data_sock, $this->_datahost, $this->_dataport)) {
+ $this->PushError("_data_prepare","socket_connect", socket_strerror(socket_last_error($this->_ftp_data_sock)));
+ $this->_data_close();
+ return FALSE;
+ }
+ else $this->_ftp_temp_sock=$this->_ftp_data_sock;
+ } else {
+ if(!@socket_getsockname($this->_ftp_control_sock, $addr, $port)) {
+ $this->PushError("_data_prepare","can't get control socket information", socket_strerror(socket_last_error($this->_ftp_control_sock)));
+ $this->_data_close();
+ return FALSE;
+ }
+ if(!@socket_bind($this->_ftp_data_sock,$addr)){
+ $this->PushError("_data_prepare","can't bind data socket", socket_strerror(socket_last_error($this->_ftp_data_sock)));
+ $this->_data_close();
+ return FALSE;
+ }
+ if(!@socket_listen($this->_ftp_data_sock)) {
+ $this->PushError("_data_prepare","can't listen data socket", socket_strerror(socket_last_error($this->_ftp_data_sock)));
+ $this->_data_close();
+ return FALSE;
+ }
+ if(!@socket_getsockname($this->_ftp_data_sock, $this->_datahost, $this->_dataport)) {
+ $this->PushError("_data_prepare","can't get data socket information", socket_strerror(socket_last_error($this->_ftp_data_sock)));
+ $this->_data_close();
+ return FALSE;
+ }
+ if(!$this->_exec('PORT '.str_replace('.',',',$this->_datahost.'.'.($this->_dataport>>8).'.'.($this->_dataport&0x00FF)), "_port")) {
+ $this->_data_close();
+ return FALSE;
+ }
+ if(!$this->_checkCode()) {
+ $this->_data_close();
+ return FALSE;
+ }
+ }
+ return TRUE;
+ }
+
+ function _data_read($mode=FTP_ASCII, $fp=NULL) {
+ $NewLine=$this->_eol_code[$this->OS_local];
+ if(is_resource($fp)) $out=0;
+ else $out="";
+ if(!$this->_passive) {
+ $this->SendMSG("Connecting to ".$this->_datahost.":".$this->_dataport);
+ $this->_ftp_temp_sock=socket_accept($this->_ftp_data_sock);
+ if($this->_ftp_temp_sock===FALSE) {
+ $this->PushError("_data_read","socket_accept", socket_strerror(socket_last_error($this->_ftp_temp_sock)));
+ $this->_data_close();
+ return FALSE;
+ }
+ }
+
+ while(($block=@socket_read($this->_ftp_temp_sock, $this->_ftp_buff_size, PHP_BINARY_READ))!==false) {
+ if($block==="") break;
+ if($mode!=FTP_BINARY) $block=preg_replace("/\r\n|\r|\n/", $this->_eol_code[$this->OS_local], $block);
+ if(is_resource($fp)) $out+=fwrite($fp, $block, strlen($block));
+ else $out.=$block;
+ }
+ return $out;
+ }
+
+ function _data_write($mode=FTP_ASCII, $fp=NULL) {
+ $NewLine=$this->_eol_code[$this->OS_local];
+ if(is_resource($fp)) $out=0;
+ else $out="";
+ if(!$this->_passive) {
+ $this->SendMSG("Connecting to ".$this->_datahost.":".$this->_dataport);
+ $this->_ftp_temp_sock=socket_accept($this->_ftp_data_sock);
+ if($this->_ftp_temp_sock===FALSE) {
+ $this->PushError("_data_write","socket_accept", socket_strerror(socket_last_error($this->_ftp_temp_sock)));
+ $this->_data_close();
+ return false;
+ }
+ }
+ if(is_resource($fp)) {
+ while(!feof($fp)) {
+ $block=fread($fp, $this->_ftp_buff_size);
+ if(!$this->_data_write_block($mode, $block)) return false;
+ }
+ } elseif(!$this->_data_write_block($mode, $fp)) return false;
+ return true;
+ }
+
+ function _data_write_block($mode, $block) {
+ if($mode!=FTP_BINARY) $block=preg_replace("/\r\n|\r|\n/", $this->_eol_code[$this->OS_remote], $block);
+ do {
+ if(($t=@socket_write($this->_ftp_temp_sock, $block))===FALSE) {
+ $this->PushError("_data_write","socket_write", socket_strerror(socket_last_error($this->_ftp_temp_sock)));
+ $this->_data_close();
+ return FALSE;
+ }
+ $block=substr($block, $t);
+ } while(!empty($block));
+ return true;
+ }
+
+ function _data_close() {
+ @socket_close($this->_ftp_temp_sock);
+ @socket_close($this->_ftp_data_sock);
+ $this->SendMSG("Disconnected data from remote host");
+ return TRUE;
+ }
+
+ function _quit() {
+ if($this->_connected) {
+ @socket_close($this->_ftp_control_sock);
+ $this->_connected=false;
+ $this->SendMSG("Socket closed");
+ }
+ }
+}
+?>
diff --git a/www/crm/wp-admin/includes/class-ftp.php b/www/crm/wp-admin/includes/class-ftp.php
new file mode 100644
index 00000000..f1d40a4f
--- /dev/null
+++ b/www/crm/wp-admin/includes/class-ftp.php
@@ -0,0 +1,912 @@
+<?php
+/**
+ * PemFTP - An Ftp implementation in pure PHP
+ *
+ * @package PemFTP
+ * @since 2.5.0
+ *
+ * @version 1.0
+ * @copyright Alexey Dotsenko
+ * @author Alexey Dotsenko
+ * @link http://www.phpclasses.org/browse/package/1743.html Site
+ * @license LGPL http://www.opensource.org/licenses/lgpl-license.html
+ */
+
+/**
+ * Defines the newline characters, if not defined already.
+ *
+ * This can be redefined.
+ *
+ * @since 2.5.0
+ * @var string
+ */
+if(!defined('CRLF')) define('CRLF',"\r\n");
+
+/**
+ * Sets whatever to autodetect ASCII mode.
+ *
+ * This can be redefined.
+ *
+ * @since 2.5.0
+ * @var int
+ */
+if(!defined("FTP_AUTOASCII")) define("FTP_AUTOASCII", -1);
+
+/**
+ *
+ * This can be redefined.
+ * @since 2.5.0
+ * @var int
+ */
+if(!defined("FTP_BINARY")) define("FTP_BINARY", 1);
+
+/**
+ *
+ * This can be redefined.
+ * @since 2.5.0
+ * @var int
+ */
+if(!defined("FTP_ASCII")) define("FTP_ASCII", 0);
+
+/**
+ * Whether to force FTP.
+ *
+ * This can be redefined.
+ *
+ * @since 2.5.0
+ * @var bool
+ */
+if(!defined('FTP_FORCE')) define('FTP_FORCE', true);
+
+/**
+ * @since 2.5.0
+ * @var string
+ */
+define('FTP_OS_Unix','u');
+
+/**
+ * @since 2.5.0
+ * @var string
+ */
+define('FTP_OS_Windows','w');
+
+/**
+ * @since 2.5.0
+ * @var string
+ */
+define('FTP_OS_Mac','m');
+
+/**
+ * PemFTP base class
+ *
+ */
+class ftp_base {
+ /* Public variables */
+ var $LocalEcho;
+ var $Verbose;
+ var $OS_local;
+ var $OS_remote;
+
+ /* Private variables */
+ var $_lastaction;
+ var $_errors;
+ var $_type;
+ var $_umask;
+ var $_timeout;
+ var $_passive;
+ var $_host;
+ var $_fullhost;
+ var $_port;
+ var $_datahost;
+ var $_dataport;
+ var $_ftp_control_sock;
+ var $_ftp_data_sock;
+ var $_ftp_temp_sock;
+ var $_ftp_buff_size;
+ var $_login;
+ var $_password;
+ var $_connected;
+ var $_ready;
+ var $_code;
+ var $_message;
+ var $_can_restore;
+ var $_port_available;
+ var $_curtype;
+ var $_features;
+
+ var $_error_array;
+ var $AuthorizedTransferMode;
+ var $OS_FullName;
+ var $_eol_code;
+ var $AutoAsciiExt;
+
+ /* Constructor */
+ function __construct($port_mode=FALSE, $verb=FALSE, $le=FALSE) {
+ $this->LocalEcho=$le;
+ $this->Verbose=$verb;
+ $this->_lastaction=NULL;
+ $this->_error_array=array();
+ $this->_eol_code=array(FTP_OS_Unix=>"\n", FTP_OS_Mac=>"\r", FTP_OS_Windows=>"\r\n");
+ $this->AuthorizedTransferMode=array(FTP_AUTOASCII, FTP_ASCII, FTP_BINARY);
+ $this->OS_FullName=array(FTP_OS_Unix => 'UNIX', FTP_OS_Windows => 'WINDOWS', FTP_OS_Mac => 'MACOS');
+ $this->AutoAsciiExt=array("ASP","BAT","C","CPP","CSS","CSV","JS","H","HTM","HTML","SHTML","INI","LOG","PHP3","PHTML","PL","PERL","SH","SQL","TXT");
+ $this->_port_available=($port_mode==TRUE);
+ $this->SendMSG("Staring FTP client class".($this->_port_available?"":" without PORT mode support"));
+ $this->_connected=FALSE;
+ $this->_ready=FALSE;
+ $this->_can_restore=FALSE;
+ $this->_code=0;
+ $this->_message="";
+ $this->_ftp_buff_size=4096;
+ $this->_curtype=NULL;
+ $this->SetUmask(0022);
+ $this->SetType(FTP_AUTOASCII);
+ $this->SetTimeout(30);
+ $this->Passive(!$this->_port_available);
+ $this->_login="anonymous";
+ $this->_password="anon@ftp.com";
+ $this->_features=array();
+ $this->OS_local=FTP_OS_Unix;
+ $this->OS_remote=FTP_OS_Unix;
+ $this->features=array();
+ if(strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') $this->OS_local=FTP_OS_Windows;
+ elseif(strtoupper(substr(PHP_OS, 0, 3)) === 'MAC') $this->OS_local=FTP_OS_Mac;
+ }
+
+ function ftp_base($port_mode=FALSE) {
+ $this->__construct($port_mode);
+ }
+
+// <!-- --------------------------------------------------------------------------------------- -->
+// <!-- Public functions -->
+// <!-- --------------------------------------------------------------------------------------- -->
+
+ function parselisting($line) {
+ $is_windows = ($this->OS_remote == FTP_OS_Windows);
+ if ($is_windows && preg_match("/([0-9]{2})-([0-9]{2})-([0-9]{2}) +([0-9]{2}):([0-9]{2})(AM|PM) +([0-9]+|<DIR>) +(.+)/",$line,$lucifer)) {
+ $b = array();
+ if ($lucifer[3]<70) { $lucifer[3]+=2000; } else { $lucifer[3]+=1900; } // 4digit year fix
+ $b['isdir'] = ($lucifer[7]=="<DIR>");
+ if ( $b['isdir'] )
+ $b['type'] = 'd';
+ else
+ $b['type'] = 'f';
+ $b['size'] = $lucifer[7];
+ $b['month'] = $lucifer[1];
+ $b['day'] = $lucifer[2];
+ $b['year'] = $lucifer[3];
+ $b['hour'] = $lucifer[4];
+ $b['minute'] = $lucifer[5];
+ $b['time'] = @mktime($lucifer[4]+(strcasecmp($lucifer[6],"PM")==0?12:0),$lucifer[5],0,$lucifer[1],$lucifer[2],$lucifer[3]);
+ $b['am/pm'] = $lucifer[6];
+ $b['name'] = $lucifer[8];
+ } else if (!$is_windows && $lucifer=preg_split("/[ ]/",$line,9,PREG_SPLIT_NO_EMPTY)) {
+ //echo $line."\n";
+ $lcount=count($lucifer);
+ if ($lcount<8) return '';
+ $b = array();
+ $b['isdir'] = $lucifer[0]{0} === "d";
+ $b['islink'] = $lucifer[0]{0} === "l";
+ if ( $b['isdir'] )
+ $b['type'] = 'd';
+ elseif ( $b['islink'] )
+ $b['type'] = 'l';
+ else
+ $b['type'] = 'f';
+ $b['perms'] = $lucifer[0];
+ $b['number'] = $lucifer[1];
+ $b['owner'] = $lucifer[2];
+ $b['group'] = $lucifer[3];
+ $b['size'] = $lucifer[4];
+ if ($lcount==8) {
+ sscanf($lucifer[5],"%d-%d-%d",$b['year'],$b['month'],$b['day']);
+ sscanf($lucifer[6],"%d:%d",$b['hour'],$b['minute']);
+ $b['time'] = @mktime($b['hour'],$b['minute'],0,$b['month'],$b['day'],$b['year']);
+ $b['name'] = $lucifer[7];
+ } else {
+ $b['month'] = $lucifer[5];
+ $b['day'] = $lucifer[6];
+ if (preg_match("/([0-9]{2}):([0-9]{2})/",$lucifer[7],$l2)) {
+ $b['year'] = date("Y");
+ $b['hour'] = $l2[1];
+ $b['minute'] = $l2[2];
+ } else {
+ $b['year'] = $lucifer[7];
+ $b['hour'] = 0;
+ $b['minute'] = 0;
+ }
+ $b['time'] = strtotime(sprintf("%d %s %d %02d:%02d",$b['day'],$b['month'],$b['year'],$b['hour'],$b['minute']));
+ $b['name'] = $lucifer[8];
+ }
+ }
+
+ return $b;
+ }
+
+ function SendMSG($message = "", $crlf=true) {
+ if ($this->Verbose) {
+ echo $message.($crlf?CRLF:"");
+ flush();
+ }
+ return TRUE;
+ }
+
+ function SetType($mode=FTP_AUTOASCII) {
+ if(!in_array($mode, $this->AuthorizedTransferMode)) {
+ $this->SendMSG("Wrong type");
+ return FALSE;
+ }
+ $this->_type=$mode;
+ $this->SendMSG("Transfer type: ".($this->_type==FTP_BINARY?"binary":($this->_type==FTP_ASCII?"ASCII":"auto ASCII") ) );
+ return TRUE;
+ }
+
+ function _settype($mode=FTP_ASCII) {
+ if($this->_ready) {
+ if($mode==FTP_BINARY) {
+ if($this->_curtype!=FTP_BINARY) {
+ if(!$this->_exec("TYPE I", "SetType")) return FALSE;
+ $this->_curtype=FTP_BINARY;
+ }
+ } elseif($this->_curtype!=FTP_ASCII) {
+ if(!$this->_exec("TYPE A", "SetType")) return FALSE;
+ $this->_curtype=FTP_ASCII;
+ }
+ } else return FALSE;
+ return TRUE;
+ }
+
+ function Passive($pasv=NULL) {
+ if(is_null($pasv)) $this->_passive=!$this->_passive;
+ else $this->_passive=$pasv;
+ if(!$this->_port_available and !$this->_passive) {
+ $this->SendMSG("Only passive connections available!");
+ $this->_passive=TRUE;
+ return FALSE;
+ }
+ $this->SendMSG("Passive mode ".($this->_passive?"on":"off"));
+ return TRUE;
+ }
+
+ function SetServer($host, $port=21, $reconnect=true) {
+ if(!is_long($port)) {
+ $this->verbose=true;
+ $this->SendMSG("Incorrect port syntax");
+ return FALSE;
+ } else {
+ $ip=@gethostbyname($host);
+ $dns=@gethostbyaddr($host);
+ if(!$ip) $ip=$host;
+ if(!$dns) $dns=$host;
+ // Validate the IPAddress PHP4 returns -1 for invalid, PHP5 false
+ // -1 === "255.255.255.255" which is the broadcast address which is also going to be invalid
+ $ipaslong = ip2long($ip);
+ if ( ($ipaslong == false) || ($ipaslong === -1) ) {
+ $this->SendMSG("Wrong host name/address \"".$host."\"");
+ return FALSE;
+ }
+ $this->_host=$ip;
+ $this->_fullhost=$dns;
+ $this->_port=$port;
+ $this->_dataport=$port-1;
+ }
+ $this->SendMSG("Host \"".$this->_fullhost."(".$this->_host."):".$this->_port."\"");
+ if($reconnect){
+ if($this->_connected) {
+ $this->SendMSG("Reconnecting");
+ if(!$this->quit(FTP_FORCE)) return FALSE;
+ if(!$this->connect()) return FALSE;
+ }
+ }
+ return TRUE;
+ }
+
+ function SetUmask($umask=0022) {
+ $this->_umask=$umask;
+ umask($this->_umask);
+ $this->SendMSG("UMASK 0".decoct($this->_umask));
+ return TRUE;
+ }
+
+ function SetTimeout($timeout=30) {
+ $this->_timeout=$timeout;
+ $this->SendMSG("Timeout ".$this->_timeout);
+ if($this->_connected)
+ if(!$this->_settimeout($this->_ftp_control_sock)) return FALSE;
+ return TRUE;
+ }
+
+ function connect($server=NULL) {
+ if(!empty($server)) {
+ if(!$this->SetServer($server)) return false;
+ }
+ if($this->_ready) return true;
+ $this->SendMsg('Local OS : '.$this->OS_FullName[$this->OS_local]);
+ if(!($this->_ftp_control_sock = $this->_connect($this->_host, $this->_port))) {
+ $this->SendMSG("Error : Cannot connect to remote host \"".$this->_fullhost." :".$this->_port."\"");
+ return FALSE;
+ }
+ $this->SendMSG("Connected to remote host \"".$this->_fullhost.":".$this->_port."\". Waiting for greeting.");
+ do {
+ if(!$this->_readmsg()) return FALSE;
+ if(!$this->_checkCode()) return FALSE;
+ $this->_lastaction=time();
+ } while($this->_code<200);
+ $this->_ready=true;
+ $syst=$this->systype();
+ if(!$syst) $this->SendMSG("Can't detect remote OS");
+ else {
+ if(preg_match("/win|dos|novell/i", $syst[0])) $this->OS_remote=FTP_OS_Windows;
+ elseif(preg_match("/os/i", $syst[0])) $this->OS_remote=FTP_OS_Mac;
+ elseif(preg_match("/(li|u)nix/i", $syst[0])) $this->OS_remote=FTP_OS_Unix;
+ else $this->OS_remote=FTP_OS_Mac;
+ $this->SendMSG("Remote OS: ".$this->OS_FullName[$this->OS_remote]);
+ }
+ if(!$this->features()) $this->SendMSG("Can't get features list. All supported - disabled");
+ else $this->SendMSG("Supported features: ".implode(", ", array_keys($this->_features)));
+ return TRUE;
+ }
+
+ function quit($force=false) {
+ if($this->_ready) {
+ if(!$this->_exec("QUIT") and !$force) return FALSE;
+ if(!$this->_checkCode() and !$force) return FALSE;
+ $this->_ready=false;
+ $this->SendMSG("Session finished");
+ }
+ $this->_quit();
+ return TRUE;
+ }
+
+ function login($user=NULL, $pass=NULL) {
+ if(!is_null($user)) $this->_login=$user;
+ else $this->_login="anonymous";
+ if(!is_null($pass)) $this->_password=$pass;
+ else $this->_password="anon@anon.com";
+ if(!$this->_exec("USER ".$this->_login, "login")) return FALSE;
+ if(!$this->_checkCode()) return FALSE;
+ if($this->_code!=230) {
+ if(!$this->_exec((($this->_code==331)?"PASS ":"ACCT ").$this->_password, "login")) return FALSE;
+ if(!$this->_checkCode()) return FALSE;
+ }
+ $this->SendMSG("Authentication succeeded");
+ if(empty($this->_features)) {
+ if(!$this->features()) $this->SendMSG("Can't get features list. All supported - disabled");
+ else $this->SendMSG("Supported features: ".implode(", ", array_keys($this->_features)));
+ }
+ return TRUE;
+ }
+
+ function pwd() {
+ if(!$this->_exec("PWD", "pwd")) return FALSE;
+ if(!$this->_checkCode()) return FALSE;
+ return preg_replace("/^[0-9]{3} \"(.+)\".*$/s", "\\1", $this->_message);
+ }
+
+ function cdup() {
+ if(!$this->_exec("CDUP", "cdup")) return FALSE;
+ if(!$this->_checkCode()) return FALSE;
+ return true;
+ }
+
+ function chdir($pathname) {
+ if(!$this->_exec("CWD ".$pathname, "chdir")) return FALSE;
+ if(!$this->_checkCode()) return FALSE;
+ return TRUE;
+ }
+
+ function rmdir($pathname) {
+ if(!$this->_exec("RMD ".$pathname, "rmdir")) return FALSE;
+ if(!$this->_checkCode()) return FALSE;
+ return TRUE;
+ }
+
+ function mkdir($pathname) {
+ if(!$this->_exec("MKD ".$pathname, "mkdir")) return FALSE;
+ if(!$this->_checkCode()) return FALSE;
+ return TRUE;
+ }
+
+ function rename($from, $to) {
+ if(!$this->_exec("RNFR ".$from, "rename")) return FALSE;
+ if(!$this->_checkCode()) return FALSE;
+ if($this->_code==350) {
+ if(!$this->_exec("RNTO ".$to, "rename")) return FALSE;
+ if(!$this->_checkCode()) return FALSE;
+ } else return FALSE;
+ return TRUE;
+ }
+
+ function filesize($pathname) {
+ if(!isset($this->_features["SIZE"])) {
+ $this->PushError("filesize", "not supported by server");
+ return FALSE;
+ }
+ if(!$this->_exec("SIZE ".$pathname, "filesize")) return FALSE;
+ if(!$this->_checkCode()) return FALSE;
+ return preg_replace("/^[0-9]{3} ([0-9]+).*$/s", "\\1", $this->_message);
+ }
+
+ function abort() {
+ if(!$this->_exec("ABOR", "abort")) return FALSE;
+ if(!$this->_checkCode()) {
+ if($this->_code!=426) return FALSE;
+ if(!$this->_readmsg("abort")) return FALSE;
+ if(!$this->_checkCode()) return FALSE;
+ }
+ return true;
+ }
+
+ function mdtm($pathname) {
+ if(!isset($this->_features["MDTM"])) {
+ $this->PushError("mdtm", "not supported by server");
+ return FALSE;
+ }
+ if(!$this->_exec("MDTM ".$pathname, "mdtm")) return FALSE;
+ if(!$this->_checkCode()) return FALSE;
+ $mdtm = preg_replace("/^[0-9]{3} ([0-9]+).*$/s", "\\1", $this->_message);
+ $date = sscanf($mdtm, "%4d%2d%2d%2d%2d%2d");
+ $timestamp = mktime($date[3], $date[4], $date[5], $date[1], $date[2], $date[0]);
+ return $timestamp;
+ }
+
+ function systype() {
+ if(!$this->_exec("SYST", "systype")) return FALSE;
+ if(!$this->_checkCode()) return FALSE;
+ $DATA = explode(" ", $this->_message);
+ return array($DATA[1], $DATA[3]);
+ }
+
+ function delete($pathname) {
+ if(!$this->_exec("DELE ".$pathname, "delete")) return FALSE;
+ if(!$this->_checkCode()) return FALSE;
+ return TRUE;
+ }
+
+ function site($command, $fnction="site") {
+ if(!$this->_exec("SITE ".$command, $fnction)) return FALSE;
+ if(!$this->_checkCode()) return FALSE;
+ return TRUE;
+ }
+
+ function chmod($pathname, $mode) {
+ if(!$this->site( sprintf('CHMOD %o %s', $mode, $pathname), "chmod")) return FALSE;
+ return TRUE;
+ }
+
+ function restore($from) {
+ if(!isset($this->_features["REST"])) {
+ $this->PushError("restore", "not supported by server");
+ return FALSE;
+ }
+ if($this->_curtype!=FTP_BINARY) {
+ $this->PushError("restore", "can't restore in ASCII mode");
+ return FALSE;
+ }
+ if(!$this->_exec("REST ".$from, "resore")) return FALSE;
+ if(!$this->_checkCode()) return FALSE;
+ return TRUE;
+ }
+
+ function features() {
+ if(!$this->_exec("FEAT", "features")) return FALSE;
+ if(!$this->_checkCode()) return FALSE;
+ $f=preg_split("/[".CRLF."]+/", preg_replace("/[0-9]{3}[ -].*[".CRLF."]+/", "", $this->_message), -1, PREG_SPLIT_NO_EMPTY);
+ $this->_features=array();
+ foreach($f as $k=>$v) {
+ $v=explode(" ", trim($v));
+ $this->_features[array_shift($v)]=$v;
+ }
+ return true;
+ }
+
+ function rawlist($pathname="", $arg="") {
+ return $this->_list(($arg?" ".$arg:"").($pathname?" ".$pathname:""), "LIST", "rawlist");
+ }
+
+ function nlist($pathname="", $arg="") {
+ return $this->_list(($arg?" ".$arg:"").($pathname?" ".$pathname:""), "NLST", "nlist");
+ }
+
+ function is_exists($pathname) {
+ return $this->file_exists($pathname);
+ }
+
+ function file_exists($pathname) {
+ $exists=true;
+ if(!$this->_exec("RNFR ".$pathname, "rename")) $exists=FALSE;
+ else {
+ if(!$this->_checkCode()) $exists=FALSE;
+ $this->abort();
+ }
+ if($exists) $this->SendMSG("Remote file ".$pathname." exists");
+ else $this->SendMSG("Remote file ".$pathname." does not exist");
+ return $exists;
+ }
+
+ function fget($fp, $remotefile, $rest=0) {
+ if($this->_can_restore and $rest!=0) fseek($fp, $rest);
+ $pi=pathinfo($remotefile);
+ if($this->_type==FTP_ASCII or ($this->_type==FTP_AUTOASCII and in_array(strtoupper($pi["extension"]), $this->AutoAsciiExt))) $mode=FTP_ASCII;
+ else $mode=FTP_BINARY;
+ if(!$this->_data_prepare($mode)) {
+ return FALSE;
+ }
+ if($this->_can_restore and $rest!=0) $this->restore($rest);
+ if(!$this->_exec("RETR ".$remotefile, "get")) {
+ $this->_data_close();
+ return FALSE;
+ }
+ if(!$this->_checkCode()) {
+ $this->_data_close();
+ return FALSE;
+ }
+ $out=$this->_data_read($mode, $fp);
+ $this->_data_close();
+ if(!$this->_readmsg()) return FALSE;
+ if(!$this->_checkCode()) return FALSE;
+ return $out;
+ }
+
+ function get($remotefile, $localfile=NULL, $rest=0) {
+ if(is_null($localfile)) $localfile=$remotefile;
+ if (@file_exists($localfile)) $this->SendMSG("Warning : local file will be overwritten");
+ $fp = @fopen($localfile, "w");
+ if (!$fp) {
+ $this->PushError("get","can't open local file", "Cannot create \"".$localfile."\"");
+ return FALSE;
+ }
+ if($this->_can_restore and $rest!=0) fseek($fp, $rest);
+ $pi=pathinfo($remotefile);
+ if($this->_type==FTP_ASCII or ($this->_type==FTP_AUTOASCII and in_array(strtoupper($pi["extension"]), $this->AutoAsciiExt))) $mode=FTP_ASCII;
+ else $mode=FTP_BINARY;
+ if(!$this->_data_prepare($mode)) {
+ fclose($fp);
+ return FALSE;
+ }
+ if($this->_can_restore and $rest!=0) $this->restore($rest);
+ if(!$this->_exec("RETR ".$remotefile, "get")) {
+ $this->_data_close();
+ fclose($fp);
+ return FALSE;
+ }
+ if(!$this->_checkCode()) {
+ $this->_data_close();
+ fclose($fp);
+ return FALSE;
+ }
+ $out=$this->_data_read($mode, $fp);
+ fclose($fp);
+ $this->_data_close();
+ if(!$this->_readmsg()) return FALSE;
+ if(!$this->_checkCode()) return FALSE;
+ return $out;
+ }
+
+ function fput($remotefile, $fp, $rest=0) {
+ if($this->_can_restore and $rest!=0) fseek($fp, $rest);
+ $pi=pathinfo($remotefile);
+ if($this->_type==FTP_ASCII or ($this->_type==FTP_AUTOASCII and in_array(strtoupper($pi["extension"]), $this->AutoAsciiExt))) $mode=FTP_ASCII;
+ else $mode=FTP_BINARY;
+ if(!$this->_data_prepare($mode)) {
+ return FALSE;
+ }
+ if($this->_can_restore and $rest!=0) $this->restore($rest);
+ if(!$this->_exec("STOR ".$remotefile, "put")) {
+ $this->_data_close();
+ return FALSE;
+ }
+ if(!$this->_checkCode()) {
+ $this->_data_close();
+ return FALSE;
+ }
+ $ret=$this->_data_write($mode, $fp);
+ $this->_data_close();
+ if(!$this->_readmsg()) return FALSE;
+ if(!$this->_checkCode()) return FALSE;
+ return $ret;
+ }
+
+ function put($localfile, $remotefile=NULL, $rest=0) {
+ if(is_null($remotefile)) $remotefile=$localfile;
+ if (!file_exists($localfile)) {
+ $this->PushError("put","can't open local file", "No such file or directory \"".$localfile."\"");
+ return FALSE;
+ }
+ $fp = @fopen($localfile, "r");
+
+ if (!$fp) {
+ $this->PushError("put","can't open local file", "Cannot read file \"".$localfile."\"");
+ return FALSE;
+ }
+ if($this->_can_restore and $rest!=0) fseek($fp, $rest);
+ $pi=pathinfo($localfile);
+ if($this->_type==FTP_ASCII or ($this->_type==FTP_AUTOASCII and in_array(strtoupper($pi["extension"]), $this->AutoAsciiExt))) $mode=FTP_ASCII;
+ else $mode=FTP_BINARY;
+ if(!$this->_data_prepare($mode)) {
+ fclose($fp);
+ return FALSE;
+ }
+ if($this->_can_restore and $rest!=0) $this->restore($rest);
+ if(!$this->_exec("STOR ".$remotefile, "put")) {
+ $this->_data_close();
+ fclose($fp);
+ return FALSE;
+ }
+ if(!$this->_checkCode()) {
+ $this->_data_close();
+ fclose($fp);
+ return FALSE;
+ }
+ $ret=$this->_data_write($mode, $fp);
+ fclose($fp);
+ $this->_data_close();
+ if(!$this->_readmsg()) return FALSE;
+ if(!$this->_checkCode()) return FALSE;
+ return $ret;
+ }
+
+ function mput($local=".", $remote=NULL, $continious=false) {
+ $local=realpath($local);
+ if(!@file_exists($local)) {
+ $this->PushError("mput","can't open local folder", "Cannot stat folder \"".$local."\"");
+ return FALSE;
+ }
+ if(!is_dir($local)) return $this->put($local, $remote);
+ if(empty($remote)) $remote=".";
+ elseif(!$this->file_exists($remote) and !$this->mkdir($remote)) return FALSE;
+ if($handle = opendir($local)) {
+ $list=array();
+ while (false !== ($file = readdir($handle))) {
+ if ($file != "." && $file != "..") $list[]=$file;
+ }
+ closedir($handle);
+ } else {
+ $this->PushError("mput","can't open local folder", "Cannot read folder \"".$local."\"");
+ return FALSE;
+ }
+ if(empty($list)) return TRUE;
+ $ret=true;
+ foreach($list as $el) {
+ if(is_dir($local."/".$el)) $t=$this->mput($local."/".$el, $remote."/".$el);
+ else $t=$this->put($local."/".$el, $remote."/".$el);
+ if(!$t) {
+ $ret=FALSE;
+ if(!$continious) break;
+ }
+ }
+ return $ret;
+
+ }
+
+ function mget($remote, $local=".", $continious=false) {
+ $list=$this->rawlist($remote, "-lA");
+ if($list===false) {
+ $this->PushError("mget","can't read remote folder list", "Can't read remote folder \"".$remote."\" contents");
+ return FALSE;
+ }
+ if(empty($list)) return true;
+ if(!@file_exists($local)) {
+ if(!@mkdir($local)) {
+ $this->PushError("mget","can't create local folder", "Cannot create folder \"".$local."\"");
+ return FALSE;
+ }
+ }
+ foreach($list as $k=>$v) {
+ $list[$k]=$this->parselisting($v);
+ if( ! $list[$k] or $list[$k]["name"]=="." or $list[$k]["name"]=="..") unset($list[$k]);
+ }
+ $ret=true;
+ foreach($list as $el) {
+ if($el["type"]=="d") {
+ if(!$this->mget($remote."/".$el["name"], $local."/".$el["name"], $continious)) {
+ $this->PushError("mget", "can't copy folder", "Can't copy remote folder \"".$remote."/".$el["name"]."\" to local \"".$local."/".$el["name"]."\"");
+ $ret=false;
+ if(!$continious) break;
+ }
+ } else {
+ if(!$this->get($remote."/".$el["name"], $local."/".$el["name"])) {
+ $this->PushError("mget", "can't copy file", "Can't copy remote file \"".$remote."/".$el["name"]."\" to local \"".$local."/".$el["name"]."\"");
+ $ret=false;
+ if(!$continious) break;
+ }
+ }
+ @chmod($local."/".$el["name"], $el["perms"]);
+ $t=strtotime($el["date"]);
+ if($t!==-1 and $t!==false) @touch($local."/".$el["name"], $t);
+ }
+ return $ret;
+ }
+
+ function mdel($remote, $continious=false) {
+ $list=$this->rawlist($remote, "-la");
+ if($list===false) {
+ $this->PushError("mdel","can't read remote folder list", "Can't read remote folder \"".$remote."\" contents");
+ return false;
+ }
+
+ foreach($list as $k=>$v) {
+ $list[$k]=$this->parselisting($v);
+ if( ! $list[$k] or $list[$k]["name"]=="." or $list[$k]["name"]=="..") unset($list[$k]);
+ }
+ $ret=true;
+
+ foreach($list as $el) {
+ if ( empty($el) )
+ continue;
+
+ if($el["type"]=="d") {
+ if(!$this->mdel($remote."/".$el["name"], $continious)) {
+ $ret=false;
+ if(!$continious) break;
+ }
+ } else {
+ if (!$this->delete($remote."/".$el["name"])) {
+ $this->PushError("mdel", "can't delete file", "Can't delete remote file \"".$remote."/".$el["name"]."\"");
+ $ret=false;
+ if(!$continious) break;
+ }
+ }
+ }
+
+ if(!$this->rmdir($remote)) {
+ $this->PushError("mdel", "can't delete folder", "Can't delete remote folder \"".$remote."/".$el["name"]."\"");
+ $ret=false;
+ }
+ return $ret;
+ }
+
+ function mmkdir($dir, $mode = 0777) {
+ if(empty($dir)) return FALSE;
+ if($this->is_exists($dir) or $dir == "/" ) return TRUE;
+ if(!$this->mmkdir(dirname($dir), $mode)) return false;
+ $r=$this->mkdir($dir, $mode);
+ $this->chmod($dir,$mode);
+ return $r;
+ }
+
+ function glob($pattern, $handle=NULL) {
+ $path=$output=null;
+ if(PHP_OS=='WIN32') $slash='\\';
+ else $slash='/';
+ $lastpos=strrpos($pattern,$slash);
+ if(!($lastpos===false)) {
+ $path=substr($pattern,0,-$lastpos-1);
+ $pattern=substr($pattern,$lastpos);
+ } else $path=getcwd();
+ if(is_array($handle) and !empty($handle)) {
+ foreach($handle as $dir) {
+ if($this->glob_pattern_match($pattern,$dir))
+ $output[]=$dir;
+ }
+ } else {
+ $handle=@opendir($path);
+ if($handle===false) return false;
+ while($dir=readdir($handle)) {
+ if($this->glob_pattern_match($pattern,$dir))
+ $output[]=$dir;
+ }
+ closedir($handle);
+ }
+ if(is_array($output)) return $output;
+ return false;
+ }
+
+ function glob_pattern_match($pattern,$string) {
+ $out=null;
+ $chunks=explode(';',$pattern);
+ foreach($chunks as $pattern) {
+ $escape=array('$','^','.','{','}','(',')','[',']','|');
+ while(strpos($pattern,'**')!==false)
+ $pattern=str_replace('**','*',$pattern);
+ foreach($escape as $probe)
+ $pattern=str_replace($probe,"\\$probe",$pattern);
+ $pattern=str_replace('?*','*',
+ str_replace('*?','*',
+ str_replace('*',".*",
+ str_replace('?','.{1,1}',$pattern))));
+ $out[]=$pattern;
+ }
+ if(count($out)==1) return($this->glob_regexp("^$out[0]$",$string));
+ else {
+ foreach($out as $tester)
+ if($this->my_regexp("^$tester$",$string)) return true;
+ }
+ return false;
+ }
+
+ function glob_regexp($pattern,$probe) {
+ $sensitive=(PHP_OS!='WIN32');
+ return ($sensitive?
+ preg_match( '/' . preg_quote( $pattern, '/' ) . '/', $probe ) :
+ preg_match( '/' . preg_quote( $pattern, '/' ) . '/i', $probe )
+ );
+ }
+
+ function dirlist($remote) {
+ $list=$this->rawlist($remote, "-la");
+ if($list===false) {
+ $this->PushError("dirlist","can't read remote folder list", "Can't read remote folder \"".$remote."\" contents");
+ return false;
+ }
+
+ $dirlist = array();
+ foreach($list as $k=>$v) {
+ $entry=$this->parselisting($v);
+ if ( empty($entry) )
+ continue;
+
+ if($entry["name"]=="." or $entry["name"]=="..")
+ continue;
+
+ $dirlist[$entry['name']] = $entry;
+ }
+
+ return $dirlist;
+ }
+// <!-- --------------------------------------------------------------------------------------- -->
+// <!-- Private functions -->
+// <!-- --------------------------------------------------------------------------------------- -->
+ function _checkCode() {
+ return ($this->_code<400 and $this->_code>0);
+ }
+
+ function _list($arg="", $cmd="LIST", $fnction="_list") {
+ if(!$this->_data_prepare()) return false;
+ if(!$this->_exec($cmd.$arg, $fnction)) {
+ $this->_data_close();
+ return FALSE;
+ }
+ if(!$this->_checkCode()) {
+ $this->_data_close();
+ return FALSE;
+ }
+ $out="";
+ if($this->_code<200) {
+ $out=$this->_data_read();
+ $this->_data_close();
+ if(!$this->_readmsg()) return FALSE;
+ if(!$this->_checkCode()) return FALSE;
+ if($out === FALSE ) return FALSE;
+ $out=preg_split("/[".CRLF."]+/", $out, -1, PREG_SPLIT_NO_EMPTY);
+// $this->SendMSG(implode($this->_eol_code[$this->OS_local], $out));
+ }
+ return $out;
+ }
+
+// <!-- --------------------------------------------------------------------------------------- -->
+// <!-- Partie : gestion des erreurs -->
+// <!-- --------------------------------------------------------------------------------------- -->
+// Gnre une erreur pour traitement externe la classe
+ function PushError($fctname,$msg,$desc=false){
+ $error=array();
+ $error['time']=time();
+ $error['fctname']=$fctname;
+ $error['msg']=$msg;
+ $error['desc']=$desc;
+ if($desc) $tmp=' ('.$desc.')'; else $tmp='';
+ $this->SendMSG($fctname.': '.$msg.$tmp);
+ return(array_push($this->_error_array,$error));
+ }
+
+// Rcupre une erreur externe
+ function PopError(){
+ if(count($this->_error_array)) return(array_pop($this->_error_array));
+ else return(false);
+ }
+}
+
+$mod_sockets = extension_loaded( 'sockets' );
+if ( ! $mod_sockets && function_exists( 'dl' ) && is_callable( 'dl' ) ) {
+ $prefix = ( PHP_SHLIB_SUFFIX == 'dll' ) ? 'php_' : '';
+ @dl( $prefix . 'sockets.' . PHP_SHLIB_SUFFIX );
+ $mod_sockets = extension_loaded( 'sockets' );
+}
+
+require_once dirname( __FILE__ ) . "/class-ftp-" . ( $mod_sockets ? "sockets" : "pure" ) . ".php";
+
+if ( $mod_sockets ) {
+ class ftp extends ftp_sockets {}
+} else {
+ class ftp extends ftp_pure {}
+}
diff --git a/www/crm/wp-admin/includes/class-language-pack-upgrader-skin.php b/www/crm/wp-admin/includes/class-language-pack-upgrader-skin.php
new file mode 100644
index 00000000..1d59cc73
--- /dev/null
+++ b/www/crm/wp-admin/includes/class-language-pack-upgrader-skin.php
@@ -0,0 +1,89 @@
+<?php
+/**
+ * Upgrader API: Language_Pack_Upgrader_Skin class
+ *
+ * @package WordPress
+ * @subpackage Upgrader
+ * @since 4.6.0
+ */
+
+/**
+ * Translation Upgrader Skin for WordPress Translation Upgrades.
+ *
+ * @since 3.7.0
+ * @since 4.6.0 Moved to its own file from wp-admin/includes/class-wp-upgrader-skins.php.
+ *
+ * @see WP_Upgrader_Skin
+ */
+class Language_Pack_Upgrader_Skin extends WP_Upgrader_Skin {
+ public $language_update = null;
+ public $done_header = false;
+ public $done_footer = false;
+ public $display_footer_actions = true;
+
+ /**
+ * @param array $args
+ */
+ public function __construct( $args = array() ) {
+ $defaults = array(
+ 'url' => '',
+ 'nonce' => '',
+ 'title' => __( 'Update Translations' ),
+ 'skip_header_footer' => false,
+ );
+ $args = wp_parse_args( $args, $defaults );
+ if ( $args['skip_header_footer'] ) {
+ $this->done_header = true;
+ $this->done_footer = true;
+ $this->display_footer_actions = false;
+ }
+ parent::__construct( $args );
+ }
+
+ /**
+ */
+ public function before() {
+ $name = $this->upgrader->get_name_for_update( $this->language_update );
+
+ echo '<div class="update-messages lp-show-latest">';
+
+ /* translators: 1: name of project, 2: language */
+ printf( '<h2>' . __( 'Updating translations for %1$s (%2$s)&#8230;' ) . '</h2>', $name, $this->language_update->language );
+ }
+
+ /**
+ * @param string|WP_Error $error
+ */
+ public function error( $error ) {
+ echo '<div class="lp-error">';
+ parent::error( $error );
+ echo '</div>';
+ }
+
+ /**
+ */
+ public function after() {
+ echo '</div>';
+ }
+
+ /**
+ */
+ public function bulk_footer() {
+ $this->decrement_update_count( 'translation' );
+ $update_actions = array();
+ $update_actions['updates_page'] = '<a href="' . self_admin_url( 'update-core.php' ) . '" target="_parent">' . __( 'Return to WordPress Updates page' ) . '</a>';
+
+ /**
+ * Filters the list of action links available following a translations update.
+ *
+ * @since 3.7.0
+ *
+ * @param string[] $update_actions Array of translations update links.
+ */
+ $update_actions = apply_filters( 'update_translations_complete_actions', $update_actions );
+
+ if ( $update_actions && $this->display_footer_actions ) {
+ $this->feedback( implode( ' | ', $update_actions ) );
+ }
+ }
+}
diff --git a/www/crm/wp-admin/includes/class-language-pack-upgrader.php b/www/crm/wp-admin/includes/class-language-pack-upgrader.php
new file mode 100644
index 00000000..754c303c
--- /dev/null
+++ b/www/crm/wp-admin/includes/class-language-pack-upgrader.php
@@ -0,0 +1,472 @@
+<?php
+/**
+ * Upgrade API: Language_Pack_Upgrader class
+ *
+ * @package WordPress
+ * @subpackage Upgrader
+ * @since 4.6.0
+ */
+
+/**
+ * Core class used for updating/installing language packs (translations)
+ * for plugins, themes, and core.
+ *
+ * @since 3.7.0
+ * @since 4.6.0 Moved to its own file from wp-admin/includes/class-wp-upgrader.php.
+ *
+ * @see WP_Upgrader
+ */
+class Language_Pack_Upgrader extends WP_Upgrader {
+
+ /**
+ * Result of the language pack upgrade.
+ *
+ * @since 3.7.0
+ * @var array|WP_Error $result
+ * @see WP_Upgrader::$result
+ */
+ public $result;
+
+ /**
+ * Whether a bulk upgrade/installation is being performed.
+ *
+ * @since 3.7.0
+ * @var bool $bulk
+ */
+ public $bulk = true;
+
+ /**
+ * Asynchronously upgrades language packs after other upgrades have been made.
+ *
+ * Hooked to the {@see 'upgrader_process_complete'} action by default.
+ *
+ * @since 3.7.0
+ *
+ * @param false|WP_Upgrader $upgrader Optional. WP_Upgrader instance or false. If `$upgrader` is
+ * a Language_Pack_Upgrader instance, the method will bail to
+ * avoid recursion. Otherwise unused. Default false.
+ */
+ public static function async_upgrade( $upgrader = false ) {
+ // Avoid recursion.
+ if ( $upgrader && $upgrader instanceof Language_Pack_Upgrader ) {
+ return;
+ }
+
+ // Nothing to do?
+ $language_updates = wp_get_translation_updates();
+ if ( ! $language_updates ) {
+ return;
+ }
+
+ /*
+ * Avoid messing with VCS installations, at least for now.
+ * Noted: this is not the ideal way to accomplish this.
+ */
+ $check_vcs = new WP_Automatic_Updater;
+ if ( $check_vcs->is_vcs_checkout( WP_CONTENT_DIR ) ) {
+ return;
+ }
+
+ foreach ( $language_updates as $key => $language_update ) {
+ $update = ! empty( $language_update->autoupdate );
+
+ /**
+ * Filters whether to asynchronously update translation for core, a plugin, or a theme.
+ *
+ * @since 4.0.0
+ *
+ * @param bool $update Whether to update.
+ * @param object $language_update The update offer.
+ */
+ $update = apply_filters( 'async_update_translation', $update, $language_update );
+
+ if ( ! $update ) {
+ unset( $language_updates[ $key ] );
+ }
+ }
+
+ if ( empty( $language_updates ) ) {
+ return;
+ }
+
+ // Re-use the automatic upgrader skin if the parent upgrader is using it.
+ if ( $upgrader && $upgrader->skin instanceof Automatic_Upgrader_Skin ) {
+ $skin = $upgrader->skin;
+ } else {
+ $skin = new Language_Pack_Upgrader_Skin(
+ array(
+ 'skip_header_footer' => true,
+ )
+ );
+ }
+
+ $lp_upgrader = new Language_Pack_Upgrader( $skin );
+ $lp_upgrader->bulk_upgrade( $language_updates );
+ }
+
+ /**
+ * Initialize the upgrade strings.
+ *
+ * @since 3.7.0
+ */
+ public function upgrade_strings() {
+ $this->strings['starting_upgrade'] = __( 'Some of your translations need updating. Sit tight for a few more seconds while we update them as well.' );
+ $this->strings['up_to_date'] = __( 'The translations are up to date.' );
+ $this->strings['no_package'] = __( 'Update package not available.' );
+ /* translators: %s: package URL */
+ $this->strings['downloading_package'] = sprintf( __( 'Downloading translation from %s&#8230;' ), '<span class="code">%s</span>' );
+ $this->strings['unpack_package'] = __( 'Unpacking the update&#8230;' );
+ $this->strings['process_failed'] = __( 'Translation update failed.' );
+ $this->strings['process_success'] = __( 'Translation updated successfully.' );
+ $this->strings['remove_old'] = __( 'Removing the old version of the translation&#8230;' );
+ $this->strings['remove_old_failed'] = __( 'Could not remove the old translation.' );
+ }
+
+ /**
+ * Upgrade a language pack.
+ *
+ * @since 3.7.0
+ *
+ * @param string|false $update Optional. Whether an update offer is available. Default false.
+ * @param array $args Optional. Other optional arguments, see
+ * Language_Pack_Upgrader::bulk_upgrade(). Default empty array.
+ * @return array|bool|WP_Error The result of the upgrade, or a WP_Error object instead.
+ */
+ public function upgrade( $update = false, $args = array() ) {
+ if ( $update ) {
+ $update = array( $update );
+ }
+
+ $results = $this->bulk_upgrade( $update, $args );
+
+ if ( ! is_array( $results ) ) {
+ return $results;
+ }
+
+ return $results[0];
+ }
+
+ /**
+ * Bulk upgrade language packs.
+ *
+ * @since 3.7.0
+ *
+ * @global WP_Filesystem_Base $wp_filesystem WordPress filesystem subclass.
+ *
+ * @param object[] $language_updates Optional. Array of language packs to update. @see wp_get_translation_updates().
+ * Default empty array.
+ * @param array $args {
+ * Other arguments for upgrading multiple language packs. Default empty array.
+ *
+ * @type bool $clear_update_cache Whether to clear the update cache when done.
+ * Default true.
+ * }
+ * @return array|bool|WP_Error Will return an array of results, or true if there are no updates,
+ * false or WP_Error for initial errors.
+ */
+ public function bulk_upgrade( $language_updates = array(), $args = array() ) {
+ global $wp_filesystem;
+
+ $defaults = array(
+ 'clear_update_cache' => true,
+ );
+ $parsed_args = wp_parse_args( $args, $defaults );
+
+ $this->init();
+ $this->upgrade_strings();
+
+ if ( ! $language_updates ) {
+ $language_updates = wp_get_translation_updates();
+ }
+
+ if ( empty( $language_updates ) ) {
+ $this->skin->header();
+ $this->skin->set_result( true );
+ $this->skin->feedback( 'up_to_date' );
+ $this->skin->bulk_footer();
+ $this->skin->footer();
+ return true;
+ }
+
+ if ( 'upgrader_process_complete' == current_filter() ) {
+ $this->skin->feedback( 'starting_upgrade' );
+ }
+
+ // Remove any existing upgrade filters from the plugin/theme upgraders #WP29425 & #WP29230
+ remove_all_filters( 'upgrader_pre_install' );
+ remove_all_filters( 'upgrader_clear_destination' );
+ remove_all_filters( 'upgrader_post_install' );
+ remove_all_filters( 'upgrader_source_selection' );
+
+ add_filter( 'upgrader_source_selection', array( $this, 'check_package' ), 10, 2 );
+
+ $this->skin->header();
+
+ // Connect to the Filesystem first.
+ $res = $this->fs_connect( array( WP_CONTENT_DIR, WP_LANG_DIR ) );
+ if ( ! $res ) {
+ $this->skin->footer();
+ return false;
+ }
+
+ $results = array();
+
+ $this->update_count = count( $language_updates );
+ $this->update_current = 0;
+
+ /*
+ * The filesystem's mkdir() is not recursive. Make sure WP_LANG_DIR exists,
+ * as we then may need to create a /plugins or /themes directory inside of it.
+ */
+ $remote_destination = $wp_filesystem->find_folder( WP_LANG_DIR );
+ if ( ! $wp_filesystem->exists( $remote_destination ) ) {
+ if ( ! $wp_filesystem->mkdir( $remote_destination, FS_CHMOD_DIR ) ) {
+ return new WP_Error( 'mkdir_failed_lang_dir', $this->strings['mkdir_failed'], $remote_destination );
+ }
+ }
+
+ $language_updates_results = array();
+
+ foreach ( $language_updates as $language_update ) {
+
+ $this->skin->language_update = $language_update;
+
+ $destination = WP_LANG_DIR;
+ if ( 'plugin' == $language_update->type ) {
+ $destination .= '/plugins';
+ } elseif ( 'theme' == $language_update->type ) {
+ $destination .= '/themes';
+ }
+
+ $this->update_current++;
+
+ $options = array(
+ 'package' => $language_update->package,
+ 'destination' => $destination,
+ 'clear_destination' => true,
+ 'abort_if_destination_exists' => false, // We expect the destination to exist.
+ 'clear_working' => true,
+ 'is_multi' => true,
+ 'hook_extra' => array(
+ 'language_update_type' => $language_update->type,
+ 'language_update' => $language_update,
+ ),
+ );
+
+ $result = $this->run( $options );
+
+ $results[] = $this->result;
+
+ // Prevent credentials auth screen from displaying multiple times.
+ if ( false === $result ) {
+ break;
+ }
+
+ $language_updates_results[] = array(
+ 'language' => $language_update->language,
+ 'type' => $language_update->type,
+ 'slug' => isset( $language_update->slug ) ? $language_update->slug : 'default',
+ 'version' => $language_update->version,
+ );
+ }
+
+ // Remove upgrade hooks which are not required for translation updates.
+ remove_action( 'upgrader_process_complete', array( 'Language_Pack_Upgrader', 'async_upgrade' ), 20 );
+ remove_action( 'upgrader_process_complete', 'wp_version_check' );
+ remove_action( 'upgrader_process_complete', 'wp_update_plugins' );
+ remove_action( 'upgrader_process_complete', 'wp_update_themes' );
+
+ /** This action is documented in wp-admin/includes/class-wp-upgrader.php */
+ do_action(
+ 'upgrader_process_complete',
+ $this,
+ array(
+ 'action' => 'update',
+ 'type' => 'translation',
+ 'bulk' => true,
+ 'translations' => $language_updates_results,
+ )
+ );
+
+ // Re-add upgrade hooks.
+ add_action( 'upgrader_process_complete', array( 'Language_Pack_Upgrader', 'async_upgrade' ), 20 );
+ add_action( 'upgrader_process_complete', 'wp_version_check', 10, 0 );
+ add_action( 'upgrader_process_complete', 'wp_update_plugins', 10, 0 );
+ add_action( 'upgrader_process_complete', 'wp_update_themes', 10, 0 );
+
+ $this->skin->bulk_footer();
+
+ $this->skin->footer();
+
+ // Clean up our hooks, in case something else does an upgrade on this connection.
+ remove_filter( 'upgrader_source_selection', array( $this, 'check_package' ) );
+
+ if ( $parsed_args['clear_update_cache'] ) {
+ wp_clean_update_cache();
+ }
+
+ return $results;
+ }
+
+ /**
+ * Check the package source to make sure there are .mo and .po files.
+ *
+ * Hooked to the {@see 'upgrader_source_selection'} filter by
+ * Language_Pack_Upgrader::bulk_upgrade().
+ *
+ * @since 3.7.0
+ *
+ * @global WP_Filesystem_Base $wp_filesystem Subclass
+ *
+ * @param string|WP_Error $source
+ * @param string $remote_source
+ */
+ public function check_package( $source, $remote_source ) {
+ global $wp_filesystem;
+
+ if ( is_wp_error( $source ) ) {
+ return $source;
+ }
+
+ // Check that the folder contains a valid language.
+ $files = $wp_filesystem->dirlist( $remote_source );
+
+ // Check to see if a .po and .mo exist in the folder.
+ $po = $mo = false;
+ foreach ( (array) $files as $file => $filedata ) {
+ if ( '.po' == substr( $file, -3 ) ) {
+ $po = true;
+ } elseif ( '.mo' == substr( $file, -3 ) ) {
+ $mo = true;
+ }
+ }
+
+ if ( ! $mo || ! $po ) {
+ return new WP_Error(
+ 'incompatible_archive_pomo',
+ $this->strings['incompatible_archive'],
+ sprintf(
+ /* translators: 1: .po, 2: .mo */
+ __( 'The language pack is missing either the %1$s or %2$s files.' ),
+ '<code>.po</code>',
+ '<code>.mo</code>'
+ )
+ );
+ }
+
+ return $source;
+ }
+
+ /**
+ * Get the name of an item being updated.
+ *
+ * @since 3.7.0
+ *
+ * @param object $update The data for an update.
+ * @return string The name of the item being updated.
+ */
+ public function get_name_for_update( $update ) {
+ switch ( $update->type ) {
+ case 'core':
+ return 'WordPress'; // Not translated
+
+ case 'theme':
+ $theme = wp_get_theme( $update->slug );
+ if ( $theme->exists() ) {
+ return $theme->Get( 'Name' );
+ }
+ break;
+ case 'plugin':
+ $plugin_data = get_plugins( '/' . $update->slug );
+ $plugin_data = reset( $plugin_data );
+ if ( $plugin_data ) {
+ return $plugin_data['Name'];
+ }
+ break;
+ }
+ return '';
+ }
+
+ /**
+ * Clears existing translations where this item is going to be installed into.
+ *
+ * @since 5.1.0
+ *
+ * @global WP_Filesystem_Base $wp_filesystem WordPress filesystem subclass.
+ *
+ * @param string $remote_destination The location on the remote filesystem to be cleared.
+ * @return bool|WP_Error True upon success, WP_Error on failure.
+ */
+ public function clear_destination( $remote_destination ) {
+ global $wp_filesystem;
+
+ $language_update = $this->skin->language_update;
+ $language_directory = WP_LANG_DIR . '/'; // Local path for use with glob().
+
+ if ( 'core' === $language_update->type ) {
+ $files = array(
+ $remote_destination . $language_update->language . '.po',
+ $remote_destination . $language_update->language . '.mo',
+ $remote_destination . 'admin-' . $language_update->language . '.po',
+ $remote_destination . 'admin-' . $language_update->language . '.mo',
+ $remote_destination . 'admin-network-' . $language_update->language . '.po',
+ $remote_destination . 'admin-network-' . $language_update->language . '.mo',
+ $remote_destination . 'continents-cities-' . $language_update->language . '.po',
+ $remote_destination . 'continents-cities-' . $language_update->language . '.mo',
+ );
+
+ $json_translation_files = glob( $language_directory . $language_update->language . '-*.json' );
+ if ( $json_translation_files ) {
+ foreach ( $json_translation_files as $json_translation_file ) {
+ $files[] = str_replace( $language_directory, $remote_destination, $json_translation_file );
+ }
+ }
+ } else {
+ $files = array(
+ $remote_destination . $language_update->slug . '-' . $language_update->language . '.po',
+ $remote_destination . $language_update->slug . '-' . $language_update->language . '.mo',
+ );
+
+ $language_directory = $language_directory . $language_update->type . 's/';
+ $json_translation_files = glob( $language_directory . $language_update->slug . '-' . $language_update->language . '-*.json' );
+ if ( $json_translation_files ) {
+ foreach ( $json_translation_files as $json_translation_file ) {
+ $files[] = str_replace( $language_directory, $remote_destination, $json_translation_file );
+ }
+ }
+ }
+
+ $files = array_filter( $files, array( $wp_filesystem, 'exists' ) );
+
+ // No files to delete.
+ if ( ! $files ) {
+ return true;
+ }
+
+ // Check all files are writable before attempting to clear the destination.
+ $unwritable_files = array();
+
+ // Check writability.
+ foreach ( $files as $file ) {
+ if ( ! $wp_filesystem->is_writable( $file ) ) {
+ // Attempt to alter permissions to allow writes and try again.
+ $wp_filesystem->chmod( $file, FS_CHMOD_FILE );
+ if ( ! $wp_filesystem->is_writable( $file ) ) {
+ $unwritable_files[] = $file;
+ }
+ }
+ }
+
+ if ( ! empty( $unwritable_files ) ) {
+ return new WP_Error( 'files_not_writable', $this->strings['files_not_writable'], implode( ', ', $unwritable_files ) );
+ }
+
+ foreach ( $files as $file ) {
+ if ( ! $wp_filesystem->delete( $file ) ) {
+ return new WP_Error( 'remove_old_failed', $this->strings['remove_old_failed'] );
+ }
+ }
+
+ return true;
+ }
+}
diff --git a/www/crm/wp-admin/includes/class-pclzip.php b/www/crm/wp-admin/includes/class-pclzip.php
new file mode 100644
index 00000000..ae0af7a8
--- /dev/null
+++ b/www/crm/wp-admin/includes/class-pclzip.php
@@ -0,0 +1,5692 @@
+<?php
+// --------------------------------------------------------------------------------
+// PhpConcept Library - Zip Module 2.8.2
+// --------------------------------------------------------------------------------
+// License GNU/LGPL - Vincent Blavet - August 2009
+// http://www.phpconcept.net
+// --------------------------------------------------------------------------------
+//
+// Presentation :
+// PclZip is a PHP library that manage ZIP archives.
+// So far tests show that archives generated by PclZip are readable by
+// WinZip application and other tools.
+//
+// Description :
+// See readme.txt and http://www.phpconcept.net
+//
+// Warning :
+// This library and the associated files are non commercial, non professional
+// work.
+// It should not have unexpected results. However if any damage is caused by
+// this software the author can not be responsible.
+// The use of this software is at the risk of the user.
+//
+// --------------------------------------------------------------------------------
+// $Id: pclzip.lib.php,v 1.60 2009/09/30 21:01:04 vblavet Exp $
+// --------------------------------------------------------------------------------
+
+ // ----- Constants
+ if (!defined('PCLZIP_READ_BLOCK_SIZE')) {
+ define( 'PCLZIP_READ_BLOCK_SIZE', 2048 );
+ }
+
+ // ----- File list separator
+ // In version 1.x of PclZip, the separator for file list is a space
+ // (which is not a very smart choice, specifically for windows paths !).
+ // A better separator should be a comma (,). This constant gives you the
+ // abilty to change that.
+ // However notice that changing this value, may have impact on existing
+ // scripts, using space separated filenames.
+ // Recommanded values for compatibility with older versions :
+ //define( 'PCLZIP_SEPARATOR', ' ' );
+ // Recommanded values for smart separation of filenames.
+ if (!defined('PCLZIP_SEPARATOR')) {
+ define( 'PCLZIP_SEPARATOR', ',' );
+ }
+
+ // ----- Error configuration
+ // 0 : PclZip Class integrated error handling
+ // 1 : PclError external library error handling. By enabling this
+ // you must ensure that you have included PclError library.
+ // [2,...] : reserved for futur use
+ if (!defined('PCLZIP_ERROR_EXTERNAL')) {
+ define( 'PCLZIP_ERROR_EXTERNAL', 0 );
+ }
+
+ // ----- Optional static temporary directory
+ // By default temporary files are generated in the script current
+ // path.
+ // If defined :
+ // - MUST BE terminated by a '/'.
+ // - MUST be a valid, already created directory
+ // Samples :
+ // define( 'PCLZIP_TEMPORARY_DIR', '/temp/' );
+ // define( 'PCLZIP_TEMPORARY_DIR', 'C:/Temp/' );
+ if (!defined('PCLZIP_TEMPORARY_DIR')) {
+ define( 'PCLZIP_TEMPORARY_DIR', '' );
+ }
+
+ // ----- Optional threshold ratio for use of temporary files
+ // Pclzip sense the size of the file to add/extract and decide to
+ // use or not temporary file. The algorythm is looking for
+ // memory_limit of PHP and apply a ratio.
+ // threshold = memory_limit * ratio.
+ // Recommended values are under 0.5. Default 0.47.
+ // Samples :
+ // define( 'PCLZIP_TEMPORARY_FILE_RATIO', 0.5 );
+ if (!defined('PCLZIP_TEMPORARY_FILE_RATIO')) {
+ define( 'PCLZIP_TEMPORARY_FILE_RATIO', 0.47 );
+ }
+
+// --------------------------------------------------------------------------------
+// ***** UNDER THIS LINE NOTHING NEEDS TO BE MODIFIED *****
+// --------------------------------------------------------------------------------
+
+ // ----- Global variables
+ $g_pclzip_version = "2.8.2";
+
+ // ----- Error codes
+ // -1 : Unable to open file in binary write mode
+ // -2 : Unable to open file in binary read mode
+ // -3 : Invalid parameters
+ // -4 : File does not exist
+ // -5 : Filename is too long (max. 255)
+ // -6 : Not a valid zip file
+ // -7 : Invalid extracted file size
+ // -8 : Unable to create directory
+ // -9 : Invalid archive extension
+ // -10 : Invalid archive format
+ // -11 : Unable to delete file (unlink)
+ // -12 : Unable to rename file (rename)
+ // -13 : Invalid header checksum
+ // -14 : Invalid archive size
+ define( 'PCLZIP_ERR_USER_ABORTED', 2 );
+ define( 'PCLZIP_ERR_NO_ERROR', 0 );
+ define( 'PCLZIP_ERR_WRITE_OPEN_FAIL', -1 );
+ define( 'PCLZIP_ERR_READ_OPEN_FAIL', -2 );
+ define( 'PCLZIP_ERR_INVALID_PARAMETER', -3 );
+ define( 'PCLZIP_ERR_MISSING_FILE', -4 );
+ define( 'PCLZIP_ERR_FILENAME_TOO_LONG', -5 );
+ define( 'PCLZIP_ERR_INVALID_ZIP', -6 );
+ define( 'PCLZIP_ERR_BAD_EXTRACTED_FILE', -7 );
+ define( 'PCLZIP_ERR_DIR_CREATE_FAIL', -8 );
+ define( 'PCLZIP_ERR_BAD_EXTENSION', -9 );
+ define( 'PCLZIP_ERR_BAD_FORMAT', -10 );
+ define( 'PCLZIP_ERR_DELETE_FILE_FAIL', -11 );
+ define( 'PCLZIP_ERR_RENAME_FILE_FAIL', -12 );
+ define( 'PCLZIP_ERR_BAD_CHECKSUM', -13 );
+ define( 'PCLZIP_ERR_INVALID_ARCHIVE_ZIP', -14 );
+ define( 'PCLZIP_ERR_MISSING_OPTION_VALUE', -15 );
+ define( 'PCLZIP_ERR_INVALID_OPTION_VALUE', -16 );
+ define( 'PCLZIP_ERR_ALREADY_A_DIRECTORY', -17 );
+ define( 'PCLZIP_ERR_UNSUPPORTED_COMPRESSION', -18 );
+ define( 'PCLZIP_ERR_UNSUPPORTED_ENCRYPTION', -19 );
+ define( 'PCLZIP_ERR_INVALID_ATTRIBUTE_VALUE', -20 );
+ define( 'PCLZIP_ERR_DIRECTORY_RESTRICTION', -21 );
+
+ // ----- Options values
+ define( 'PCLZIP_OPT_PATH', 77001 );
+ define( 'PCLZIP_OPT_ADD_PATH', 77002 );
+ define( 'PCLZIP_OPT_REMOVE_PATH', 77003 );
+ define( 'PCLZIP_OPT_REMOVE_ALL_PATH', 77004 );
+ define( 'PCLZIP_OPT_SET_CHMOD', 77005 );
+ define( 'PCLZIP_OPT_EXTRACT_AS_STRING', 77006 );
+ define( 'PCLZIP_OPT_NO_COMPRESSION', 77007 );
+ define( 'PCLZIP_OPT_BY_NAME', 77008 );
+ define( 'PCLZIP_OPT_BY_INDEX', 77009 );
+ define( 'PCLZIP_OPT_BY_EREG', 77010 );
+ define( 'PCLZIP_OPT_BY_PREG', 77011 );
+ define( 'PCLZIP_OPT_COMMENT', 77012 );
+ define( 'PCLZIP_OPT_ADD_COMMENT', 77013 );
+ define( 'PCLZIP_OPT_PREPEND_COMMENT', 77014 );
+ define( 'PCLZIP_OPT_EXTRACT_IN_OUTPUT', 77015 );
+ define( 'PCLZIP_OPT_REPLACE_NEWER', 77016 );
+ define( 'PCLZIP_OPT_STOP_ON_ERROR', 77017 );
+ // Having big trouble with crypt. Need to multiply 2 long int
+ // which is not correctly supported by PHP ...
+ //define( 'PCLZIP_OPT_CRYPT', 77018 );
+ define( 'PCLZIP_OPT_EXTRACT_DIR_RESTRICTION', 77019 );
+ define( 'PCLZIP_OPT_TEMP_FILE_THRESHOLD', 77020 );
+ define( 'PCLZIP_OPT_ADD_TEMP_FILE_THRESHOLD', 77020 ); // alias
+ define( 'PCLZIP_OPT_TEMP_FILE_ON', 77021 );
+ define( 'PCLZIP_OPT_ADD_TEMP_FILE_ON', 77021 ); // alias
+ define( 'PCLZIP_OPT_TEMP_FILE_OFF', 77022 );
+ define( 'PCLZIP_OPT_ADD_TEMP_FILE_OFF', 77022 ); // alias
+
+ // ----- File description attributes
+ define( 'PCLZIP_ATT_FILE_NAME', 79001 );
+ define( 'PCLZIP_ATT_FILE_NEW_SHORT_NAME', 79002 );
+ define( 'PCLZIP_ATT_FILE_NEW_FULL_NAME', 79003 );
+ define( 'PCLZIP_ATT_FILE_MTIME', 79004 );
+ define( 'PCLZIP_ATT_FILE_CONTENT', 79005 );
+ define( 'PCLZIP_ATT_FILE_COMMENT', 79006 );
+
+ // ----- Call backs values
+ define( 'PCLZIP_CB_PRE_EXTRACT', 78001 );
+ define( 'PCLZIP_CB_POST_EXTRACT', 78002 );
+ define( 'PCLZIP_CB_PRE_ADD', 78003 );
+ define( 'PCLZIP_CB_POST_ADD', 78004 );
+ /* For futur use
+ define( 'PCLZIP_CB_PRE_LIST', 78005 );
+ define( 'PCLZIP_CB_POST_LIST', 78006 );
+ define( 'PCLZIP_CB_PRE_DELETE', 78007 );
+ define( 'PCLZIP_CB_POST_DELETE', 78008 );
+ */
+
+ // --------------------------------------------------------------------------------
+ // Class : PclZip
+ // Description :
+ // PclZip is the class that represent a Zip archive.
+ // The public methods allow the manipulation of the archive.
+ // Attributes :
+ // Attributes must not be accessed directly.
+ // Methods :
+ // PclZip() : Object creator
+ // create() : Creates the Zip archive
+ // listContent() : List the content of the Zip archive
+ // extract() : Extract the content of the archive
+ // properties() : List the properties of the archive
+ // --------------------------------------------------------------------------------
+ class PclZip
+ {
+ // ----- Filename of the zip file
+ var $zipname = '';
+
+ // ----- File descriptor of the zip file
+ var $zip_fd = 0;
+
+ // ----- Internal error handling
+ var $error_code = 1;
+ var $error_string = '';
+
+ // ----- Current status of the magic_quotes_runtime
+ // This value store the php configuration for magic_quotes
+ // The class can then disable the magic_quotes and reset it after
+ var $magic_quotes_status;
+
+ // --------------------------------------------------------------------------------
+ // Function : PclZip()
+ // Description :
+ // Creates a PclZip object and set the name of the associated Zip archive
+ // filename.
+ // Note that no real action is taken, if the archive does not exist it is not
+ // created. Use create() for that.
+ // --------------------------------------------------------------------------------
+ function __construct($p_zipname)
+ {
+
+ // ----- Tests the zlib
+ if (!function_exists('gzopen'))
+ {
+ die('Abort '.basename(__FILE__).' : Missing zlib extensions');
+ }
+
+ // ----- Set the attributes
+ $this->zipname = $p_zipname;
+ $this->zip_fd = 0;
+ $this->magic_quotes_status = -1;
+
+ // ----- Return
+ return;
+ }
+
+ public function PclZip($p_zipname) {
+ self::__construct($p_zipname);
+ }
+ // --------------------------------------------------------------------------------
+
+ // --------------------------------------------------------------------------------
+ // Function :
+ // create($p_filelist, $p_add_dir="", $p_remove_dir="")
+ // create($p_filelist, $p_option, $p_option_value, ...)
+ // Description :
+ // This method supports two different synopsis. The first one is historical.
+ // This method creates a Zip Archive. The Zip file is created in the
+ // filesystem. The files and directories indicated in $p_filelist
+ // are added in the archive. See the parameters description for the
+ // supported format of $p_filelist.
+ // When a directory is in the list, the directory and its content is added
+ // in the archive.
+ // In this synopsis, the function takes an optional variable list of
+ // options. See bellow the supported options.
+ // Parameters :
+ // $p_filelist : An array containing file or directory names, or
+ // a string containing one filename or one directory name, or
+ // a string containing a list of filenames and/or directory
+ // names separated by spaces.
+ // $p_add_dir : A path to add before the real path of the archived file,
+ // in order to have it memorized in the archive.
+ // $p_remove_dir : A path to remove from the real path of the file to archive,
+ // in order to have a shorter path memorized in the archive.
+ // When $p_add_dir and $p_remove_dir are set, $p_remove_dir
+ // is removed first, before $p_add_dir is added.
+ // Options :
+ // PCLZIP_OPT_ADD_PATH :
+ // PCLZIP_OPT_REMOVE_PATH :
+ // PCLZIP_OPT_REMOVE_ALL_PATH :
+ // PCLZIP_OPT_COMMENT :
+ // PCLZIP_CB_PRE_ADD :
+ // PCLZIP_CB_POST_ADD :
+ // Return Values :
+ // 0 on failure,
+ // The list of the added files, with a status of the add action.
+ // (see PclZip::listContent() for list entry format)
+ // --------------------------------------------------------------------------------
+ function create($p_filelist)
+ {
+ $v_result=1;
+
+ // ----- Reset the error handler
+ $this->privErrorReset();
+
+ // ----- Set default values
+ $v_options = array();
+ $v_options[PCLZIP_OPT_NO_COMPRESSION] = FALSE;
+
+ // ----- Look for variable options arguments
+ $v_size = func_num_args();
+
+ // ----- Look for arguments
+ if ($v_size > 1) {
+ // ----- Get the arguments
+ $v_arg_list = func_get_args();
+
+ // ----- Remove from the options list the first argument
+ array_shift($v_arg_list);
+ $v_size--;
+
+ // ----- Look for first arg
+ if ((is_integer($v_arg_list[0])) && ($v_arg_list[0] > 77000)) {
+
+ // ----- Parse the options
+ $v_result = $this->privParseOptions($v_arg_list, $v_size, $v_options,
+ array (PCLZIP_OPT_REMOVE_PATH => 'optional',
+ PCLZIP_OPT_REMOVE_ALL_PATH => 'optional',
+ PCLZIP_OPT_ADD_PATH => 'optional',
+ PCLZIP_CB_PRE_ADD => 'optional',
+ PCLZIP_CB_POST_ADD => 'optional',
+ PCLZIP_OPT_NO_COMPRESSION => 'optional',
+ PCLZIP_OPT_COMMENT => 'optional',
+ PCLZIP_OPT_TEMP_FILE_THRESHOLD => 'optional',
+ PCLZIP_OPT_TEMP_FILE_ON => 'optional',
+ PCLZIP_OPT_TEMP_FILE_OFF => 'optional'
+ //, PCLZIP_OPT_CRYPT => 'optional'
+ ));
+ if ($v_result != 1) {
+ return 0;
+ }
+ }
+
+ // ----- Look for 2 args
+ // Here we need to support the first historic synopsis of the
+ // method.
+ else {
+
+ // ----- Get the first argument
+ $v_options[PCLZIP_OPT_ADD_PATH] = $v_arg_list[0];
+
+ // ----- Look for the optional second argument
+ if ($v_size == 2) {
+ $v_options[PCLZIP_OPT_REMOVE_PATH] = $v_arg_list[1];
+ }
+ else if ($v_size > 2) {
+ PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER,
+ "Invalid number / type of arguments");
+ return 0;
+ }
+ }
+ }
+
+ // ----- Look for default option values
+ $this->privOptionDefaultThreshold($v_options);
+
+ // ----- Init
+ $v_string_list = array();
+ $v_att_list = array();
+ $v_filedescr_list = array();
+ $p_result_list = array();
+
+ // ----- Look if the $p_filelist is really an array
+ if (is_array($p_filelist)) {
+
+ // ----- Look if the first element is also an array
+ // This will mean that this is a file description entry
+ if (isset($p_filelist[0]) && is_array($p_filelist[0])) {
+ $v_att_list = $p_filelist;
+ }
+
+ // ----- The list is a list of string names
+ else {
+ $v_string_list = $p_filelist;
+ }
+ }
+
+ // ----- Look if the $p_filelist is a string
+ else if (is_string($p_filelist)) {
+ // ----- Create a list from the string
+ $v_string_list = explode(PCLZIP_SEPARATOR, $p_filelist);
+ }
+
+ // ----- Invalid variable type for $p_filelist
+ else {
+ PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Invalid variable type p_filelist");
+ return 0;
+ }
+
+ // ----- Reformat the string list
+ if (sizeof($v_string_list) != 0) {
+ foreach ($v_string_list as $v_string) {
+ if ($v_string != '') {
+ $v_att_list[][PCLZIP_ATT_FILE_NAME] = $v_string;
+ }
+ else {
+ }
+ }
+ }
+
+ // ----- For each file in the list check the attributes
+ $v_supported_attributes
+ = array ( PCLZIP_ATT_FILE_NAME => 'mandatory'
+ ,PCLZIP_ATT_FILE_NEW_SHORT_NAME => 'optional'
+ ,PCLZIP_ATT_FILE_NEW_FULL_NAME => 'optional'
+ ,PCLZIP_ATT_FILE_MTIME => 'optional'
+ ,PCLZIP_ATT_FILE_CONTENT => 'optional'
+ ,PCLZIP_ATT_FILE_COMMENT => 'optional'
+ );
+ foreach ($v_att_list as $v_entry) {
+ $v_result = $this->privFileDescrParseAtt($v_entry,
+ $v_filedescr_list[],
+ $v_options,
+ $v_supported_attributes);
+ if ($v_result != 1) {
+ return 0;
+ }
+ }
+
+ // ----- Expand the filelist (expand directories)
+ $v_result = $this->privFileDescrExpand($v_filedescr_list, $v_options);
+ if ($v_result != 1) {
+ return 0;
+ }
+
+ // ----- Call the create fct
+ $v_result = $this->privCreate($v_filedescr_list, $p_result_list, $v_options);
+ if ($v_result != 1) {
+ return 0;
+ }
+
+ // ----- Return
+ return $p_result_list;
+ }
+ // --------------------------------------------------------------------------------
+
+ // --------------------------------------------------------------------------------
+ // Function :
+ // add($p_filelist, $p_add_dir="", $p_remove_dir="")
+ // add($p_filelist, $p_option, $p_option_value, ...)
+ // Description :
+ // This method supports two synopsis. The first one is historical.
+ // This methods add the list of files in an existing archive.
+ // If a file with the same name already exists, it is added at the end of the
+ // archive, the first one is still present.
+ // If the archive does not exist, it is created.
+ // Parameters :
+ // $p_filelist : An array containing file or directory names, or
+ // a string containing one filename or one directory name, or
+ // a string containing a list of filenames and/or directory
+ // names separated by spaces.
+ // $p_add_dir : A path to add before the real path of the archived file,
+ // in order to have it memorized in the archive.
+ // $p_remove_dir : A path to remove from the real path of the file to archive,
+ // in order to have a shorter path memorized in the archive.
+ // When $p_add_dir and $p_remove_dir are set, $p_remove_dir
+ // is removed first, before $p_add_dir is added.
+ // Options :
+ // PCLZIP_OPT_ADD_PATH :
+ // PCLZIP_OPT_REMOVE_PATH :
+ // PCLZIP_OPT_REMOVE_ALL_PATH :
+ // PCLZIP_OPT_COMMENT :
+ // PCLZIP_OPT_ADD_COMMENT :
+ // PCLZIP_OPT_PREPEND_COMMENT :
+ // PCLZIP_CB_PRE_ADD :
+ // PCLZIP_CB_POST_ADD :
+ // Return Values :
+ // 0 on failure,
+ // The list of the added files, with a status of the add action.
+ // (see PclZip::listContent() for list entry format)
+ // --------------------------------------------------------------------------------
+ function add($p_filelist)
+ {
+ $v_result=1;
+
+ // ----- Reset the error handler
+ $this->privErrorReset();
+
+ // ----- Set default values
+ $v_options = array();
+ $v_options[PCLZIP_OPT_NO_COMPRESSION] = FALSE;
+
+ // ----- Look for variable options arguments
+ $v_size = func_num_args();
+
+ // ----- Look for arguments
+ if ($v_size > 1) {
+ // ----- Get the arguments
+ $v_arg_list = func_get_args();
+
+ // ----- Remove form the options list the first argument
+ array_shift($v_arg_list);
+ $v_size--;
+
+ // ----- Look for first arg
+ if ((is_integer($v_arg_list[0])) && ($v_arg_list[0] > 77000)) {
+
+ // ----- Parse the options
+ $v_result = $this->privParseOptions($v_arg_list, $v_size, $v_options,
+ array (PCLZIP_OPT_REMOVE_PATH => 'optional',
+ PCLZIP_OPT_REMOVE_ALL_PATH => 'optional',
+ PCLZIP_OPT_ADD_PATH => 'optional',
+ PCLZIP_CB_PRE_ADD => 'optional',
+ PCLZIP_CB_POST_ADD => 'optional',
+ PCLZIP_OPT_NO_COMPRESSION => 'optional',
+ PCLZIP_OPT_COMMENT => 'optional',
+ PCLZIP_OPT_ADD_COMMENT => 'optional',
+ PCLZIP_OPT_PREPEND_COMMENT => 'optional',
+ PCLZIP_OPT_TEMP_FILE_THRESHOLD => 'optional',
+ PCLZIP_OPT_TEMP_FILE_ON => 'optional',
+ PCLZIP_OPT_TEMP_FILE_OFF => 'optional'
+ //, PCLZIP_OPT_CRYPT => 'optional'
+ ));
+ if ($v_result != 1) {
+ return 0;
+ }
+ }
+
+ // ----- Look for 2 args
+ // Here we need to support the first historic synopsis of the
+ // method.
+ else {
+
+ // ----- Get the first argument
+ $v_options[PCLZIP_OPT_ADD_PATH] = $v_add_path = $v_arg_list[0];
+
+ // ----- Look for the optional second argument
+ if ($v_size == 2) {
+ $v_options[PCLZIP_OPT_REMOVE_PATH] = $v_arg_list[1];
+ }
+ else if ($v_size > 2) {
+ // ----- Error log
+ PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Invalid number / type of arguments");
+
+ // ----- Return
+ return 0;
+ }
+ }
+ }
+
+ // ----- Look for default option values
+ $this->privOptionDefaultThreshold($v_options);
+
+ // ----- Init
+ $v_string_list = array();
+ $v_att_list = array();
+ $v_filedescr_list = array();
+ $p_result_list = array();
+
+ // ----- Look if the $p_filelist is really an array
+ if (is_array($p_filelist)) {
+
+ // ----- Look if the first element is also an array
+ // This will mean that this is a file description entry
+ if (isset($p_filelist[0]) && is_array($p_filelist[0])) {
+ $v_att_list = $p_filelist;
+ }
+
+ // ----- The list is a list of string names
+ else {
+ $v_string_list = $p_filelist;
+ }
+ }
+
+ // ----- Look if the $p_filelist is a string
+ else if (is_string($p_filelist)) {
+ // ----- Create a list from the string
+ $v_string_list = explode(PCLZIP_SEPARATOR, $p_filelist);
+ }
+
+ // ----- Invalid variable type for $p_filelist
+ else {
+ PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Invalid variable type '".gettype($p_filelist)."' for p_filelist");
+ return 0;
+ }
+
+ // ----- Reformat the string list
+ if (sizeof($v_string_list) != 0) {
+ foreach ($v_string_list as $v_string) {
+ $v_att_list[][PCLZIP_ATT_FILE_NAME] = $v_string;
+ }
+ }
+
+ // ----- For each file in the list check the attributes
+ $v_supported_attributes
+ = array ( PCLZIP_ATT_FILE_NAME => 'mandatory'
+ ,PCLZIP_ATT_FILE_NEW_SHORT_NAME => 'optional'
+ ,PCLZIP_ATT_FILE_NEW_FULL_NAME => 'optional'
+ ,PCLZIP_ATT_FILE_MTIME => 'optional'
+ ,PCLZIP_ATT_FILE_CONTENT => 'optional'
+ ,PCLZIP_ATT_FILE_COMMENT => 'optional'
+ );
+ foreach ($v_att_list as $v_entry) {
+ $v_result = $this->privFileDescrParseAtt($v_entry,
+ $v_filedescr_list[],
+ $v_options,
+ $v_supported_attributes);
+ if ($v_result != 1) {
+ return 0;
+ }
+ }
+
+ // ----- Expand the filelist (expand directories)
+ $v_result = $this->privFileDescrExpand($v_filedescr_list, $v_options);
+ if ($v_result != 1) {
+ return 0;
+ }
+
+ // ----- Call the create fct
+ $v_result = $this->privAdd($v_filedescr_list, $p_result_list, $v_options);
+ if ($v_result != 1) {
+ return 0;
+ }
+
+ // ----- Return
+ return $p_result_list;
+ }
+ // --------------------------------------------------------------------------------
+
+ // --------------------------------------------------------------------------------
+ // Function : listContent()
+ // Description :
+ // This public method, gives the list of the files and directories, with their
+ // properties.
+ // The properties of each entries in the list are (used also in other functions) :
+ // filename : Name of the file. For a create or add action it is the filename
+ // given by the user. For an extract function it is the filename
+ // of the extracted file.
+ // stored_filename : Name of the file / directory stored in the archive.
+ // size : Size of the stored file.
+ // compressed_size : Size of the file's data compressed in the archive
+ // (without the headers overhead)
+ // mtime : Last known modification date of the file (UNIX timestamp)
+ // comment : Comment associated with the file
+ // folder : true | false
+ // index : index of the file in the archive
+ // status : status of the action (depending of the action) :
+ // Values are :
+ // ok : OK !
+ // filtered : the file / dir is not extracted (filtered by user)
+ // already_a_directory : the file can not be extracted because a
+ // directory with the same name already exists
+ // write_protected : the file can not be extracted because a file
+ // with the same name already exists and is
+ // write protected
+ // newer_exist : the file was not extracted because a newer file exists
+ // path_creation_fail : the file is not extracted because the folder
+ // does not exist and can not be created
+ // write_error : the file was not extracted because there was a
+ // error while writing the file
+ // read_error : the file was not extracted because there was a error
+ // while reading the file
+ // invalid_header : the file was not extracted because of an archive
+ // format error (bad file header)
+ // Note that each time a method can continue operating when there
+ // is an action error on a file, the error is only logged in the file status.
+ // Return Values :
+ // 0 on an unrecoverable failure,
+ // The list of the files in the archive.
+ // --------------------------------------------------------------------------------
+ function listContent()
+ {
+ $v_result=1;
+
+ // ----- Reset the error handler
+ $this->privErrorReset();
+
+ // ----- Check archive
+ if (!$this->privCheckFormat()) {
+ return(0);
+ }
+
+ // ----- Call the extracting fct
+ $p_list = array();
+ if (($v_result = $this->privList($p_list)) != 1)
+ {
+ unset($p_list);
+ return(0);
+ }
+
+ // ----- Return
+ return $p_list;
+ }
+ // --------------------------------------------------------------------------------
+
+ // --------------------------------------------------------------------------------
+ // Function :
+ // extract($p_path="./", $p_remove_path="")
+ // extract([$p_option, $p_option_value, ...])
+ // Description :
+ // This method supports two synopsis. The first one is historical.
+ // This method extract all the files / directories from the archive to the
+ // folder indicated in $p_path.
+ // If you want to ignore the 'root' part of path of the memorized files
+ // you can indicate this in the optional $p_remove_path parameter.
+ // By default, if a newer file with the same name already exists, the
+ // file is not extracted.
+ //
+ // If both PCLZIP_OPT_PATH and PCLZIP_OPT_ADD_PATH aoptions
+ // are used, the path indicated in PCLZIP_OPT_ADD_PATH is append
+ // at the end of the path value of PCLZIP_OPT_PATH.
+ // Parameters :
+ // $p_path : Path where the files and directories are to be extracted
+ // $p_remove_path : First part ('root' part) of the memorized path
+ // (if any similar) to remove while extracting.
+ // Options :
+ // PCLZIP_OPT_PATH :
+ // PCLZIP_OPT_ADD_PATH :
+ // PCLZIP_OPT_REMOVE_PATH :
+ // PCLZIP_OPT_REMOVE_ALL_PATH :
+ // PCLZIP_CB_PRE_EXTRACT :
+ // PCLZIP_CB_POST_EXTRACT :
+ // Return Values :
+ // 0 or a negative value on failure,
+ // The list of the extracted files, with a status of the action.
+ // (see PclZip::listContent() for list entry format)
+ // --------------------------------------------------------------------------------
+ function extract()
+ {
+ $v_result=1;
+
+ // ----- Reset the error handler
+ $this->privErrorReset();
+
+ // ----- Check archive
+ if (!$this->privCheckFormat()) {
+ return(0);
+ }
+
+ // ----- Set default values
+ $v_options = array();
+// $v_path = "./";
+ $v_path = '';
+ $v_remove_path = "";
+ $v_remove_all_path = false;
+
+ // ----- Look for variable options arguments
+ $v_size = func_num_args();
+
+ // ----- Default values for option
+ $v_options[PCLZIP_OPT_EXTRACT_AS_STRING] = FALSE;
+
+ // ----- Look for arguments
+ if ($v_size > 0) {
+ // ----- Get the arguments
+ $v_arg_list = func_get_args();
+
+ // ----- Look for first arg
+ if ((is_integer($v_arg_list[0])) && ($v_arg_list[0] > 77000)) {
+
+ // ----- Parse the options
+ $v_result = $this->privParseOptions($v_arg_list, $v_size, $v_options,
+ array (PCLZIP_OPT_PATH => 'optional',
+ PCLZIP_OPT_REMOVE_PATH => 'optional',
+ PCLZIP_OPT_REMOVE_ALL_PATH => 'optional',
+ PCLZIP_OPT_ADD_PATH => 'optional',
+ PCLZIP_CB_PRE_EXTRACT => 'optional',
+ PCLZIP_CB_POST_EXTRACT => 'optional',
+ PCLZIP_OPT_SET_CHMOD => 'optional',
+ PCLZIP_OPT_BY_NAME => 'optional',
+ PCLZIP_OPT_BY_EREG => 'optional',
+ PCLZIP_OPT_BY_PREG => 'optional',
+ PCLZIP_OPT_BY_INDEX => 'optional',
+ PCLZIP_OPT_EXTRACT_AS_STRING => 'optional',
+ PCLZIP_OPT_EXTRACT_IN_OUTPUT => 'optional',
+ PCLZIP_OPT_REPLACE_NEWER => 'optional'
+ ,PCLZIP_OPT_STOP_ON_ERROR => 'optional'
+ ,PCLZIP_OPT_EXTRACT_DIR_RESTRICTION => 'optional',
+ PCLZIP_OPT_TEMP_FILE_THRESHOLD => 'optional',
+ PCLZIP_OPT_TEMP_FILE_ON => 'optional',
+ PCLZIP_OPT_TEMP_FILE_OFF => 'optional'
+ ));
+ if ($v_result != 1) {
+ return 0;
+ }
+
+ // ----- Set the arguments
+ if (isset($v_options[PCLZIP_OPT_PATH])) {
+ $v_path = $v_options[PCLZIP_OPT_PATH];
+ }
+ if (isset($v_options[PCLZIP_OPT_REMOVE_PATH])) {
+ $v_remove_path = $v_options[PCLZIP_OPT_REMOVE_PATH];
+ }
+ if (isset($v_options[PCLZIP_OPT_REMOVE_ALL_PATH])) {
+ $v_remove_all_path = $v_options[PCLZIP_OPT_REMOVE_ALL_PATH];
+ }
+ if (isset($v_options[PCLZIP_OPT_ADD_PATH])) {
+ // ----- Check for '/' in last path char
+ if ((strlen($v_path) > 0) && (substr($v_path, -1) != '/')) {
+ $v_path .= '/';
+ }
+ $v_path .= $v_options[PCLZIP_OPT_ADD_PATH];
+ }
+ }
+
+ // ----- Look for 2 args
+ // Here we need to support the first historic synopsis of the
+ // method.
+ else {
+
+ // ----- Get the first argument
+ $v_path = $v_arg_list[0];
+
+ // ----- Look for the optional second argument
+ if ($v_size == 2) {
+ $v_remove_path = $v_arg_list[1];
+ }
+ else if ($v_size > 2) {
+ // ----- Error log
+ PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Invalid number / type of arguments");
+
+ // ----- Return
+ return 0;
+ }
+ }
+ }
+
+ // ----- Look for default option values
+ $this->privOptionDefaultThreshold($v_options);
+
+ // ----- Trace
+
+ // ----- Call the extracting fct
+ $p_list = array();
+ $v_result = $this->privExtractByRule($p_list, $v_path, $v_remove_path,
+ $v_remove_all_path, $v_options);
+ if ($v_result < 1) {
+ unset($p_list);
+ return(0);
+ }
+
+ // ----- Return
+ return $p_list;
+ }
+ // --------------------------------------------------------------------------------
+
+
+ // --------------------------------------------------------------------------------
+ // Function :
+ // extractByIndex($p_index, $p_path="./", $p_remove_path="")
+ // extractByIndex($p_index, [$p_option, $p_option_value, ...])
+ // Description :
+ // This method supports two synopsis. The first one is historical.
+ // This method is doing a partial extract of the archive.
+ // The extracted files or folders are identified by their index in the
+ // archive (from 0 to n).
+ // Note that if the index identify a folder, only the folder entry is
+ // extracted, not all the files included in the archive.
+ // Parameters :
+ // $p_index : A single index (integer) or a string of indexes of files to
+ // extract. The form of the string is "0,4-6,8-12" with only numbers
+ // and '-' for range or ',' to separate ranges. No spaces or ';'
+ // are allowed.
+ // $p_path : Path where the files and directories are to be extracted
+ // $p_remove_path : First part ('root' part) of the memorized path
+ // (if any similar) to remove while extracting.
+ // Options :
+ // PCLZIP_OPT_PATH :
+ // PCLZIP_OPT_ADD_PATH :
+ // PCLZIP_OPT_REMOVE_PATH :
+ // PCLZIP_OPT_REMOVE_ALL_PATH :
+ // PCLZIP_OPT_EXTRACT_AS_STRING : The files are extracted as strings and
+ // not as files.
+ // The resulting content is in a new field 'content' in the file
+ // structure.
+ // This option must be used alone (any other options are ignored).
+ // PCLZIP_CB_PRE_EXTRACT :
+ // PCLZIP_CB_POST_EXTRACT :
+ // Return Values :
+ // 0 on failure,
+ // The list of the extracted files, with a status of the action.
+ // (see PclZip::listContent() for list entry format)
+ // --------------------------------------------------------------------------------
+ //function extractByIndex($p_index, options...)
+ function extractByIndex($p_index)
+ {
+ $v_result=1;
+
+ // ----- Reset the error handler
+ $this->privErrorReset();
+
+ // ----- Check archive
+ if (!$this->privCheckFormat()) {
+ return(0);
+ }
+
+ // ----- Set default values
+ $v_options = array();
+// $v_path = "./";
+ $v_path = '';
+ $v_remove_path = "";
+ $v_remove_all_path = false;
+
+ // ----- Look for variable options arguments
+ $v_size = func_num_args();
+
+ // ----- Default values for option
+ $v_options[PCLZIP_OPT_EXTRACT_AS_STRING] = FALSE;
+
+ // ----- Look for arguments
+ if ($v_size > 1) {
+ // ----- Get the arguments
+ $v_arg_list = func_get_args();
+
+ // ----- Remove form the options list the first argument
+ array_shift($v_arg_list);
+ $v_size--;
+
+ // ----- Look for first arg
+ if ((is_integer($v_arg_list[0])) && ($v_arg_list[0] > 77000)) {
+
+ // ----- Parse the options
+ $v_result = $this->privParseOptions($v_arg_list, $v_size, $v_options,
+ array (PCLZIP_OPT_PATH => 'optional',
+ PCLZIP_OPT_REMOVE_PATH => 'optional',
+ PCLZIP_OPT_REMOVE_ALL_PATH => 'optional',
+ PCLZIP_OPT_EXTRACT_AS_STRING => 'optional',
+ PCLZIP_OPT_ADD_PATH => 'optional',
+ PCLZIP_CB_PRE_EXTRACT => 'optional',
+ PCLZIP_CB_POST_EXTRACT => 'optional',
+ PCLZIP_OPT_SET_CHMOD => 'optional',
+ PCLZIP_OPT_REPLACE_NEWER => 'optional'
+ ,PCLZIP_OPT_STOP_ON_ERROR => 'optional'
+ ,PCLZIP_OPT_EXTRACT_DIR_RESTRICTION => 'optional',
+ PCLZIP_OPT_TEMP_FILE_THRESHOLD => 'optional',
+ PCLZIP_OPT_TEMP_FILE_ON => 'optional',
+ PCLZIP_OPT_TEMP_FILE_OFF => 'optional'
+ ));
+ if ($v_result != 1) {
+ return 0;
+ }
+
+ // ----- Set the arguments
+ if (isset($v_options[PCLZIP_OPT_PATH])) {
+ $v_path = $v_options[PCLZIP_OPT_PATH];
+ }
+ if (isset($v_options[PCLZIP_OPT_REMOVE_PATH])) {
+ $v_remove_path = $v_options[PCLZIP_OPT_REMOVE_PATH];
+ }
+ if (isset($v_options[PCLZIP_OPT_REMOVE_ALL_PATH])) {
+ $v_remove_all_path = $v_options[PCLZIP_OPT_REMOVE_ALL_PATH];
+ }
+ if (isset($v_options[PCLZIP_OPT_ADD_PATH])) {
+ // ----- Check for '/' in last path char
+ if ((strlen($v_path) > 0) && (substr($v_path, -1) != '/')) {
+ $v_path .= '/';
+ }
+ $v_path .= $v_options[PCLZIP_OPT_ADD_PATH];
+ }
+ if (!isset($v_options[PCLZIP_OPT_EXTRACT_AS_STRING])) {
+ $v_options[PCLZIP_OPT_EXTRACT_AS_STRING] = FALSE;
+ }
+ else {
+ }
+ }
+
+ // ----- Look for 2 args
+ // Here we need to support the first historic synopsis of the
+ // method.
+ else {
+
+ // ----- Get the first argument
+ $v_path = $v_arg_list[0];
+
+ // ----- Look for the optional second argument
+ if ($v_size == 2) {
+ $v_remove_path = $v_arg_list[1];
+ }
+ else if ($v_size > 2) {
+ // ----- Error log
+ PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Invalid number / type of arguments");
+
+ // ----- Return
+ return 0;
+ }
+ }
+ }
+
+ // ----- Trace
+
+ // ----- Trick
+ // Here I want to reuse extractByRule(), so I need to parse the $p_index
+ // with privParseOptions()
+ $v_arg_trick = array (PCLZIP_OPT_BY_INDEX, $p_index);
+ $v_options_trick = array();
+ $v_result = $this->privParseOptions($v_arg_trick, sizeof($v_arg_trick), $v_options_trick,
+ array (PCLZIP_OPT_BY_INDEX => 'optional' ));
+ if ($v_result != 1) {
+ return 0;
+ }
+ $v_options[PCLZIP_OPT_BY_INDEX] = $v_options_trick[PCLZIP_OPT_BY_INDEX];
+
+ // ----- Look for default option values
+ $this->privOptionDefaultThreshold($v_options);
+
+ // ----- Call the extracting fct
+ if (($v_result = $this->privExtractByRule($p_list, $v_path, $v_remove_path, $v_remove_all_path, $v_options)) < 1) {
+ return(0);
+ }
+
+ // ----- Return
+ return $p_list;
+ }
+ // --------------------------------------------------------------------------------
+
+ // --------------------------------------------------------------------------------
+ // Function :
+ // delete([$p_option, $p_option_value, ...])
+ // Description :
+ // This method removes files from the archive.
+ // If no parameters are given, then all the archive is emptied.
+ // Parameters :
+ // None or optional arguments.
+ // Options :
+ // PCLZIP_OPT_BY_INDEX :
+ // PCLZIP_OPT_BY_NAME :
+ // PCLZIP_OPT_BY_EREG :
+ // PCLZIP_OPT_BY_PREG :
+ // Return Values :
+ // 0 on failure,
+ // The list of the files which are still present in the archive.
+ // (see PclZip::listContent() for list entry format)
+ // --------------------------------------------------------------------------------
+ function delete()
+ {
+ $v_result=1;
+
+ // ----- Reset the error handler
+ $this->privErrorReset();
+
+ // ----- Check archive
+ if (!$this->privCheckFormat()) {
+ return(0);
+ }
+
+ // ----- Set default values
+ $v_options = array();
+
+ // ----- Look for variable options arguments
+ $v_size = func_num_args();
+
+ // ----- Look for arguments
+ if ($v_size > 0) {
+ // ----- Get the arguments
+ $v_arg_list = func_get_args();
+
+ // ----- Parse the options
+ $v_result = $this->privParseOptions($v_arg_list, $v_size, $v_options,
+ array (PCLZIP_OPT_BY_NAME => 'optional',
+ PCLZIP_OPT_BY_EREG => 'optional',
+ PCLZIP_OPT_BY_PREG => 'optional',
+ PCLZIP_OPT_BY_INDEX => 'optional' ));
+ if ($v_result != 1) {
+ return 0;
+ }
+ }
+
+ // ----- Magic quotes trick
+ $this->privDisableMagicQuotes();
+
+ // ----- Call the delete fct
+ $v_list = array();
+ if (($v_result = $this->privDeleteByRule($v_list, $v_options)) != 1) {
+ $this->privSwapBackMagicQuotes();
+ unset($v_list);
+ return(0);
+ }
+
+ // ----- Magic quotes trick
+ $this->privSwapBackMagicQuotes();
+
+ // ----- Return
+ return $v_list;
+ }
+ // --------------------------------------------------------------------------------
+
+ // --------------------------------------------------------------------------------
+ // Function : deleteByIndex()
+ // Description :
+ // ***** Deprecated *****
+ // delete(PCLZIP_OPT_BY_INDEX, $p_index) should be prefered.
+ // --------------------------------------------------------------------------------
+ function deleteByIndex($p_index)
+ {
+
+ $p_list = $this->delete(PCLZIP_OPT_BY_INDEX, $p_index);
+
+ // ----- Return
+ return $p_list;
+ }
+ // --------------------------------------------------------------------------------
+
+ // --------------------------------------------------------------------------------
+ // Function : properties()
+ // Description :
+ // This method gives the properties of the archive.
+ // The properties are :
+ // nb : Number of files in the archive
+ // comment : Comment associated with the archive file
+ // status : not_exist, ok
+ // Parameters :
+ // None
+ // Return Values :
+ // 0 on failure,
+ // An array with the archive properties.
+ // --------------------------------------------------------------------------------
+ function properties()
+ {
+
+ // ----- Reset the error handler
+ $this->privErrorReset();
+
+ // ----- Magic quotes trick
+ $this->privDisableMagicQuotes();
+
+ // ----- Check archive
+ if (!$this->privCheckFormat()) {
+ $this->privSwapBackMagicQuotes();
+ return(0);
+ }
+
+ // ----- Default properties
+ $v_prop = array();
+ $v_prop['comment'] = '';
+ $v_prop['nb'] = 0;
+ $v_prop['status'] = 'not_exist';
+
+ // ----- Look if file exists
+ if (@is_file($this->zipname))
+ {
+ // ----- Open the zip file
+ if (($this->zip_fd = @fopen($this->zipname, 'rb')) == 0)
+ {
+ $this->privSwapBackMagicQuotes();
+
+ // ----- Error log
+ PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, 'Unable to open archive \''.$this->zipname.'\' in binary read mode');
+
+ // ----- Return
+ return 0;
+ }
+
+ // ----- Read the central directory informations
+ $v_central_dir = array();
+ if (($v_result = $this->privReadEndCentralDir($v_central_dir)) != 1)
+ {
+ $this->privSwapBackMagicQuotes();
+ return 0;
+ }
+
+ // ----- Close the zip file
+ $this->privCloseFd();
+
+ // ----- Set the user attributes
+ $v_prop['comment'] = $v_central_dir['comment'];
+ $v_prop['nb'] = $v_central_dir['entries'];
+ $v_prop['status'] = 'ok';
+ }
+
+ // ----- Magic quotes trick
+ $this->privSwapBackMagicQuotes();
+
+ // ----- Return
+ return $v_prop;
+ }
+ // --------------------------------------------------------------------------------
+
+ // --------------------------------------------------------------------------------
+ // Function : duplicate()
+ // Description :
+ // This method creates an archive by copying the content of an other one. If
+ // the archive already exist, it is replaced by the new one without any warning.
+ // Parameters :
+ // $p_archive : The filename of a valid archive, or
+ // a valid PclZip object.
+ // Return Values :
+ // 1 on success.
+ // 0 or a negative value on error (error code).
+ // --------------------------------------------------------------------------------
+ function duplicate($p_archive)
+ {
+ $v_result = 1;
+
+ // ----- Reset the error handler
+ $this->privErrorReset();
+
+ // ----- Look if the $p_archive is a PclZip object
+ if ((is_object($p_archive)) && (get_class($p_archive) == 'pclzip'))
+ {
+
+ // ----- Duplicate the archive
+ $v_result = $this->privDuplicate($p_archive->zipname);
+ }
+
+ // ----- Look if the $p_archive is a string (so a filename)
+ else if (is_string($p_archive))
+ {
+
+ // ----- Check that $p_archive is a valid zip file
+ // TBC : Should also check the archive format
+ if (!is_file($p_archive)) {
+ // ----- Error log
+ PclZip::privErrorLog(PCLZIP_ERR_MISSING_FILE, "No file with filename '".$p_archive."'");
+ $v_result = PCLZIP_ERR_MISSING_FILE;
+ }
+ else {
+ // ----- Duplicate the archive
+ $v_result = $this->privDuplicate($p_archive);
+ }
+ }
+
+ // ----- Invalid variable
+ else
+ {
+ // ----- Error log
+ PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Invalid variable type p_archive_to_add");
+ $v_result = PCLZIP_ERR_INVALID_PARAMETER;
+ }
+
+ // ----- Return
+ return $v_result;
+ }
+ // --------------------------------------------------------------------------------
+
+ // --------------------------------------------------------------------------------
+ // Function : merge()
+ // Description :
+ // This method merge the $p_archive_to_add archive at the end of the current
+ // one ($this).
+ // If the archive ($this) does not exist, the merge becomes a duplicate.
+ // If the $p_archive_to_add archive does not exist, the merge is a success.
+ // Parameters :
+ // $p_archive_to_add : It can be directly the filename of a valid zip archive,
+ // or a PclZip object archive.
+ // Return Values :
+ // 1 on success,
+ // 0 or negative values on error (see below).
+ // --------------------------------------------------------------------------------
+ function merge($p_archive_to_add)
+ {
+ $v_result = 1;
+
+ // ----- Reset the error handler
+ $this->privErrorReset();
+
+ // ----- Check archive
+ if (!$this->privCheckFormat()) {
+ return(0);
+ }
+
+ // ----- Look if the $p_archive_to_add is a PclZip object
+ if ((is_object($p_archive_to_add)) && (get_class($p_archive_to_add) == 'pclzip'))
+ {
+
+ // ----- Merge the archive
+ $v_result = $this->privMerge($p_archive_to_add);
+ }
+
+ // ----- Look if the $p_archive_to_add is a string (so a filename)
+ else if (is_string($p_archive_to_add))
+ {
+
+ // ----- Create a temporary archive
+ $v_object_archive = new PclZip($p_archive_to_add);
+
+ // ----- Merge the archive
+ $v_result = $this->privMerge($v_object_archive);
+ }
+
+ // ----- Invalid variable
+ else
+ {
+ // ----- Error log
+ PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Invalid variable type p_archive_to_add");
+ $v_result = PCLZIP_ERR_INVALID_PARAMETER;
+ }
+
+ // ----- Return
+ return $v_result;
+ }
+ // --------------------------------------------------------------------------------
+
+
+
+ // --------------------------------------------------------------------------------
+ // Function : errorCode()
+ // Description :
+ // Parameters :
+ // --------------------------------------------------------------------------------
+ function errorCode()
+ {
+ if (PCLZIP_ERROR_EXTERNAL == 1) {
+ return(PclErrorCode());
+ }
+ else {
+ return($this->error_code);
+ }
+ }
+ // --------------------------------------------------------------------------------
+
+ // --------------------------------------------------------------------------------
+ // Function : errorName()
+ // Description :
+ // Parameters :
+ // --------------------------------------------------------------------------------
+ function errorName($p_with_code=false)
+ {
+ $v_name = array ( PCLZIP_ERR_NO_ERROR => 'PCLZIP_ERR_NO_ERROR',
+ PCLZIP_ERR_WRITE_OPEN_FAIL => 'PCLZIP_ERR_WRITE_OPEN_FAIL',
+ PCLZIP_ERR_READ_OPEN_FAIL => 'PCLZIP_ERR_READ_OPEN_FAIL',
+ PCLZIP_ERR_INVALID_PARAMETER => 'PCLZIP_ERR_INVALID_PARAMETER',
+ PCLZIP_ERR_MISSING_FILE => 'PCLZIP_ERR_MISSING_FILE',
+ PCLZIP_ERR_FILENAME_TOO_LONG => 'PCLZIP_ERR_FILENAME_TOO_LONG',
+ PCLZIP_ERR_INVALID_ZIP => 'PCLZIP_ERR_INVALID_ZIP',
+ PCLZIP_ERR_BAD_EXTRACTED_FILE => 'PCLZIP_ERR_BAD_EXTRACTED_FILE',
+ PCLZIP_ERR_DIR_CREATE_FAIL => 'PCLZIP_ERR_DIR_CREATE_FAIL',
+ PCLZIP_ERR_BAD_EXTENSION => 'PCLZIP_ERR_BAD_EXTENSION',
+ PCLZIP_ERR_BAD_FORMAT => 'PCLZIP_ERR_BAD_FORMAT',
+ PCLZIP_ERR_DELETE_FILE_FAIL => 'PCLZIP_ERR_DELETE_FILE_FAIL',
+ PCLZIP_ERR_RENAME_FILE_FAIL => 'PCLZIP_ERR_RENAME_FILE_FAIL',
+ PCLZIP_ERR_BAD_CHECKSUM => 'PCLZIP_ERR_BAD_CHECKSUM',
+ PCLZIP_ERR_INVALID_ARCHIVE_ZIP => 'PCLZIP_ERR_INVALID_ARCHIVE_ZIP',
+ PCLZIP_ERR_MISSING_OPTION_VALUE => 'PCLZIP_ERR_MISSING_OPTION_VALUE',
+ PCLZIP_ERR_INVALID_OPTION_VALUE => 'PCLZIP_ERR_INVALID_OPTION_VALUE',
+ PCLZIP_ERR_UNSUPPORTED_COMPRESSION => 'PCLZIP_ERR_UNSUPPORTED_COMPRESSION',
+ PCLZIP_ERR_UNSUPPORTED_ENCRYPTION => 'PCLZIP_ERR_UNSUPPORTED_ENCRYPTION'
+ ,PCLZIP_ERR_INVALID_ATTRIBUTE_VALUE => 'PCLZIP_ERR_INVALID_ATTRIBUTE_VALUE'
+ ,PCLZIP_ERR_DIRECTORY_RESTRICTION => 'PCLZIP_ERR_DIRECTORY_RESTRICTION'
+ );
+
+ if (isset($v_name[$this->error_code])) {
+ $v_value = $v_name[$this->error_code];
+ }
+ else {
+ $v_value = 'NoName';
+ }
+
+ if ($p_with_code) {
+ return($v_value.' ('.$this->error_code.')');
+ }
+ else {
+ return($v_value);
+ }
+ }
+ // --------------------------------------------------------------------------------
+
+ // --------------------------------------------------------------------------------
+ // Function : errorInfo()
+ // Description :
+ // Parameters :
+ // --------------------------------------------------------------------------------
+ function errorInfo($p_full=false)
+ {
+ if (PCLZIP_ERROR_EXTERNAL == 1) {
+ return(PclErrorString());
+ }
+ else {
+ if ($p_full) {
+ return($this->errorName(true)." : ".$this->error_string);
+ }
+ else {
+ return($this->error_string." [code ".$this->error_code."]");
+ }
+ }
+ }
+ // --------------------------------------------------------------------------------
+
+
+// --------------------------------------------------------------------------------
+// ***** UNDER THIS LINE ARE DEFINED PRIVATE INTERNAL FUNCTIONS *****
+// ***** *****
+// ***** THESES FUNCTIONS MUST NOT BE USED DIRECTLY *****
+// --------------------------------------------------------------------------------
+
+
+
+ // --------------------------------------------------------------------------------
+ // Function : privCheckFormat()
+ // Description :
+ // This method check that the archive exists and is a valid zip archive.
+ // Several level of check exists. (futur)
+ // Parameters :
+ // $p_level : Level of check. Default 0.
+ // 0 : Check the first bytes (magic codes) (default value))
+ // 1 : 0 + Check the central directory (futur)
+ // 2 : 1 + Check each file header (futur)
+ // Return Values :
+ // true on success,
+ // false on error, the error code is set.
+ // --------------------------------------------------------------------------------
+ function privCheckFormat($p_level=0)
+ {
+ $v_result = true;
+
+ // ----- Reset the file system cache
+ clearstatcache();
+
+ // ----- Reset the error handler
+ $this->privErrorReset();
+
+ // ----- Look if the file exits
+ if (!is_file($this->zipname)) {
+ // ----- Error log
+ PclZip::privErrorLog(PCLZIP_ERR_MISSING_FILE, "Missing archive file '".$this->zipname."'");
+ return(false);
+ }
+
+ // ----- Check that the file is readeable
+ if (!is_readable($this->zipname)) {
+ // ----- Error log
+ PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, "Unable to read archive '".$this->zipname."'");
+ return(false);
+ }
+
+ // ----- Check the magic code
+ // TBC
+
+ // ----- Check the central header
+ // TBC
+
+ // ----- Check each file header
+ // TBC
+
+ // ----- Return
+ return $v_result;
+ }
+ // --------------------------------------------------------------------------------
+
+ // --------------------------------------------------------------------------------
+ // Function : privParseOptions()
+ // Description :
+ // This internal methods reads the variable list of arguments ($p_options_list,
+ // $p_size) and generate an array with the options and values ($v_result_list).
+ // $v_requested_options contains the options that can be present and those that
+ // must be present.
+ // $v_requested_options is an array, with the option value as key, and 'optional',
+ // or 'mandatory' as value.
+ // Parameters :
+ // See above.
+ // Return Values :
+ // 1 on success.
+ // 0 on failure.
+ // --------------------------------------------------------------------------------
+ function privParseOptions(&$p_options_list, $p_size, &$v_result_list, $v_requested_options=false)
+ {
+ $v_result=1;
+
+ // ----- Read the options
+ $i=0;
+ while ($i<$p_size) {
+
+ // ----- Check if the option is supported
+ if (!isset($v_requested_options[$p_options_list[$i]])) {
+ // ----- Error log
+ PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Invalid optional parameter '".$p_options_list[$i]."' for this method");
+
+ // ----- Return
+ return PclZip::errorCode();
+ }
+
+ // ----- Look for next option
+ switch ($p_options_list[$i]) {
+ // ----- Look for options that request a path value
+ case PCLZIP_OPT_PATH :
+ case PCLZIP_OPT_REMOVE_PATH :
+ case PCLZIP_OPT_ADD_PATH :
+ // ----- Check the number of parameters
+ if (($i+1) >= $p_size) {
+ // ----- Error log
+ PclZip::privErrorLog(PCLZIP_ERR_MISSING_OPTION_VALUE, "Missing parameter value for option '".PclZipUtilOptionText($p_options_list[$i])."'");
+
+ // ----- Return
+ return PclZip::errorCode();
+ }
+
+ // ----- Get the value
+ $v_result_list[$p_options_list[$i]] = PclZipUtilTranslateWinPath($p_options_list[$i+1], FALSE);
+ $i++;
+ break;
+
+ case PCLZIP_OPT_TEMP_FILE_THRESHOLD :
+ // ----- Check the number of parameters
+ if (($i+1) >= $p_size) {
+ PclZip::privErrorLog(PCLZIP_ERR_MISSING_OPTION_VALUE, "Missing parameter value for option '".PclZipUtilOptionText($p_options_list[$i])."'");
+ return PclZip::errorCode();
+ }
+
+ // ----- Check for incompatible options
+ if (isset($v_result_list[PCLZIP_OPT_TEMP_FILE_OFF])) {
+ PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Option '".PclZipUtilOptionText($p_options_list[$i])."' can not be used with option 'PCLZIP_OPT_TEMP_FILE_OFF'");
+ return PclZip::errorCode();
+ }
+
+ // ----- Check the value
+ $v_value = $p_options_list[$i+1];
+ if ((!is_integer($v_value)) || ($v_value<0)) {
+ PclZip::privErrorLog(PCLZIP_ERR_INVALID_OPTION_VALUE, "Integer expected for option '".PclZipUtilOptionText($p_options_list[$i])."'");
+ return PclZip::errorCode();
+ }
+
+ // ----- Get the value (and convert it in bytes)
+ $v_result_list[$p_options_list[$i]] = $v_value*1048576;
+ $i++;
+ break;
+
+ case PCLZIP_OPT_TEMP_FILE_ON :
+ // ----- Check for incompatible options
+ if (isset($v_result_list[PCLZIP_OPT_TEMP_FILE_OFF])) {
+ PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Option '".PclZipUtilOptionText($p_options_list[$i])."' can not be used with option 'PCLZIP_OPT_TEMP_FILE_OFF'");
+ return PclZip::errorCode();
+ }
+
+ $v_result_list[$p_options_list[$i]] = true;
+ break;
+
+ case PCLZIP_OPT_TEMP_FILE_OFF :
+ // ----- Check for incompatible options
+ if (isset($v_result_list[PCLZIP_OPT_TEMP_FILE_ON])) {
+ PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Option '".PclZipUtilOptionText($p_options_list[$i])."' can not be used with option 'PCLZIP_OPT_TEMP_FILE_ON'");
+ return PclZip::errorCode();
+ }
+ // ----- Check for incompatible options
+ if (isset($v_result_list[PCLZIP_OPT_TEMP_FILE_THRESHOLD])) {
+ PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Option '".PclZipUtilOptionText($p_options_list[$i])."' can not be used with option 'PCLZIP_OPT_TEMP_FILE_THRESHOLD'");
+ return PclZip::errorCode();
+ }
+
+ $v_result_list[$p_options_list[$i]] = true;
+ break;
+
+ case PCLZIP_OPT_EXTRACT_DIR_RESTRICTION :
+ // ----- Check the number of parameters
+ if (($i+1) >= $p_size) {
+ // ----- Error log
+ PclZip::privErrorLog(PCLZIP_ERR_MISSING_OPTION_VALUE, "Missing parameter value for option '".PclZipUtilOptionText($p_options_list[$i])."'");
+
+ // ----- Return
+ return PclZip::errorCode();
+ }
+
+ // ----- Get the value
+ if ( is_string($p_options_list[$i+1])
+ && ($p_options_list[$i+1] != '')) {
+ $v_result_list[$p_options_list[$i]] = PclZipUtilTranslateWinPath($p_options_list[$i+1], FALSE);
+ $i++;
+ }
+ else {
+ }
+ break;
+
+ // ----- Look for options that request an array of string for value
+ case PCLZIP_OPT_BY_NAME :
+ // ----- Check the number of parameters
+ if (($i+1) >= $p_size) {
+ // ----- Error log
+ PclZip::privErrorLog(PCLZIP_ERR_MISSING_OPTION_VALUE, "Missing parameter value for option '".PclZipUtilOptionText($p_options_list[$i])."'");
+
+ // ----- Return
+ return PclZip::errorCode();
+ }
+
+ // ----- Get the value
+ if (is_string($p_options_list[$i+1])) {
+ $v_result_list[$p_options_list[$i]][0] = $p_options_list[$i+1];
+ }
+ else if (is_array($p_options_list[$i+1])) {
+ $v_result_list[$p_options_list[$i]] = $p_options_list[$i+1];
+ }
+ else {
+ // ----- Error log
+ PclZip::privErrorLog(PCLZIP_ERR_INVALID_OPTION_VALUE, "Wrong parameter value for option '".PclZipUtilOptionText($p_options_list[$i])."'");
+
+ // ----- Return
+ return PclZip::errorCode();
+ }
+ $i++;
+ break;
+
+ // ----- Look for options that request an EREG or PREG expression
+ case PCLZIP_OPT_BY_EREG :
+ // ereg() is deprecated starting with PHP 5.3. Move PCLZIP_OPT_BY_EREG
+ // to PCLZIP_OPT_BY_PREG
+ $p_options_list[$i] = PCLZIP_OPT_BY_PREG;
+ case PCLZIP_OPT_BY_PREG :
+ //case PCLZIP_OPT_CRYPT :
+ // ----- Check the number of parameters
+ if (($i+1) >= $p_size) {
+ // ----- Error log
+ PclZip::privErrorLog(PCLZIP_ERR_MISSING_OPTION_VALUE, "Missing parameter value for option '".PclZipUtilOptionText($p_options_list[$i])."'");
+
+ // ----- Return
+ return PclZip::errorCode();
+ }
+
+ // ----- Get the value
+ if (is_string($p_options_list[$i+1])) {
+ $v_result_list[$p_options_list[$i]] = $p_options_list[$i+1];
+ }
+ else {
+ // ----- Error log
+ PclZip::privErrorLog(PCLZIP_ERR_INVALID_OPTION_VALUE, "Wrong parameter value for option '".PclZipUtilOptionText($p_options_list[$i])."'");
+
+ // ----- Return
+ return PclZip::errorCode();
+ }
+ $i++;
+ break;
+
+ // ----- Look for options that takes a string
+ case PCLZIP_OPT_COMMENT :
+ case PCLZIP_OPT_ADD_COMMENT :
+ case PCLZIP_OPT_PREPEND_COMMENT :
+ // ----- Check the number of parameters
+ if (($i+1) >= $p_size) {
+ // ----- Error log
+ PclZip::privErrorLog(PCLZIP_ERR_MISSING_OPTION_VALUE,
+ "Missing parameter value for option '"
+ .PclZipUtilOptionText($p_options_list[$i])
+ ."'");
+
+ // ----- Return
+ return PclZip::errorCode();
+ }
+
+ // ----- Get the value
+ if (is_string($p_options_list[$i+1])) {
+ $v_result_list[$p_options_list[$i]] = $p_options_list[$i+1];
+ }
+ else {
+ // ----- Error log
+ PclZip::privErrorLog(PCLZIP_ERR_INVALID_OPTION_VALUE,
+ "Wrong parameter value for option '"
+ .PclZipUtilOptionText($p_options_list[$i])
+ ."'");
+
+ // ----- Return
+ return PclZip::errorCode();
+ }
+ $i++;
+ break;
+
+ // ----- Look for options that request an array of index
+ case PCLZIP_OPT_BY_INDEX :
+ // ----- Check the number of parameters
+ if (($i+1) >= $p_size) {
+ // ----- Error log
+ PclZip::privErrorLog(PCLZIP_ERR_MISSING_OPTION_VALUE, "Missing parameter value for option '".PclZipUtilOptionText($p_options_list[$i])."'");
+
+ // ----- Return
+ return PclZip::errorCode();
+ }
+
+ // ----- Get the value
+ $v_work_list = array();
+ if (is_string($p_options_list[$i+1])) {
+
+ // ----- Remove spaces
+ $p_options_list[$i+1] = strtr($p_options_list[$i+1], ' ', '');
+
+ // ----- Parse items
+ $v_work_list = explode(",", $p_options_list[$i+1]);
+ }
+ else if (is_integer($p_options_list[$i+1])) {
+ $v_work_list[0] = $p_options_list[$i+1].'-'.$p_options_list[$i+1];
+ }
+ else if (is_array($p_options_list[$i+1])) {
+ $v_work_list = $p_options_list[$i+1];
+ }
+ else {
+ // ----- Error log
+ PclZip::privErrorLog(PCLZIP_ERR_INVALID_OPTION_VALUE, "Value must be integer, string or array for option '".PclZipUtilOptionText($p_options_list[$i])."'");
+
+ // ----- Return
+ return PclZip::errorCode();
+ }
+
+ // ----- Reduce the index list
+ // each index item in the list must be a couple with a start and
+ // an end value : [0,3], [5-5], [8-10], ...
+ // ----- Check the format of each item
+ $v_sort_flag=false;
+ $v_sort_value=0;
+ for ($j=0; $j<sizeof($v_work_list); $j++) {
+ // ----- Explode the item
+ $v_item_list = explode("-", $v_work_list[$j]);
+ $v_size_item_list = sizeof($v_item_list);
+
+ // ----- TBC : Here we might check that each item is a
+ // real integer ...
+
+ // ----- Look for single value
+ if ($v_size_item_list == 1) {
+ // ----- Set the option value
+ $v_result_list[$p_options_list[$i]][$j]['start'] = $v_item_list[0];
+ $v_result_list[$p_options_list[$i]][$j]['end'] = $v_item_list[0];
+ }
+ elseif ($v_size_item_list == 2) {
+ // ----- Set the option value
+ $v_result_list[$p_options_list[$i]][$j]['start'] = $v_item_list[0];
+ $v_result_list[$p_options_list[$i]][$j]['end'] = $v_item_list[1];
+ }
+ else {
+ // ----- Error log
+ PclZip::privErrorLog(PCLZIP_ERR_INVALID_OPTION_VALUE, "Too many values in index range for option '".PclZipUtilOptionText($p_options_list[$i])."'");
+
+ // ----- Return
+ return PclZip::errorCode();
+ }
+
+
+ // ----- Look for list sort
+ if ($v_result_list[$p_options_list[$i]][$j]['start'] < $v_sort_value) {
+ $v_sort_flag=true;
+
+ // ----- TBC : An automatic sort should be writen ...
+ // ----- Error log
+ PclZip::privErrorLog(PCLZIP_ERR_INVALID_OPTION_VALUE, "Invalid order of index range for option '".PclZipUtilOptionText($p_options_list[$i])."'");
+
+ // ----- Return
+ return PclZip::errorCode();
+ }
+ $v_sort_value = $v_result_list[$p_options_list[$i]][$j]['start'];
+ }
+
+ // ----- Sort the items
+ if ($v_sort_flag) {
+ // TBC : To Be Completed
+ }
+
+ // ----- Next option
+ $i++;
+ break;
+
+ // ----- Look for options that request no value
+ case PCLZIP_OPT_REMOVE_ALL_PATH :
+ case PCLZIP_OPT_EXTRACT_AS_STRING :
+ case PCLZIP_OPT_NO_COMPRESSION :
+ case PCLZIP_OPT_EXTRACT_IN_OUTPUT :
+ case PCLZIP_OPT_REPLACE_NEWER :
+ case PCLZIP_OPT_STOP_ON_ERROR :
+ $v_result_list[$p_options_list[$i]] = true;
+ break;
+
+ // ----- Look for options that request an octal value
+ case PCLZIP_OPT_SET_CHMOD :
+ // ----- Check the number of parameters
+ if (($i+1) >= $p_size) {
+ // ----- Error log
+ PclZip::privErrorLog(PCLZIP_ERR_MISSING_OPTION_VALUE, "Missing parameter value for option '".PclZipUtilOptionText($p_options_list[$i])."'");
+
+ // ----- Return
+ return PclZip::errorCode();
+ }
+
+ // ----- Get the value
+ $v_result_list[$p_options_list[$i]] = $p_options_list[$i+1];
+ $i++;
+ break;
+
+ // ----- Look for options that request a call-back
+ case PCLZIP_CB_PRE_EXTRACT :
+ case PCLZIP_CB_POST_EXTRACT :
+ case PCLZIP_CB_PRE_ADD :
+ case PCLZIP_CB_POST_ADD :
+ /* for futur use
+ case PCLZIP_CB_PRE_DELETE :
+ case PCLZIP_CB_POST_DELETE :
+ case PCLZIP_CB_PRE_LIST :
+ case PCLZIP_CB_POST_LIST :
+ */
+ // ----- Check the number of parameters
+ if (($i+1) >= $p_size) {
+ // ----- Error log
+ PclZip::privErrorLog(PCLZIP_ERR_MISSING_OPTION_VALUE, "Missing parameter value for option '".PclZipUtilOptionText($p_options_list[$i])."'");
+
+ // ----- Return
+ return PclZip::errorCode();
+ }
+
+ // ----- Get the value
+ $v_function_name = $p_options_list[$i+1];
+
+ // ----- Check that the value is a valid existing function
+ if (!function_exists($v_function_name)) {
+ // ----- Error log
+ PclZip::privErrorLog(PCLZIP_ERR_INVALID_OPTION_VALUE, "Function '".$v_function_name."()' is not an existing function for option '".PclZipUtilOptionText($p_options_list[$i])."'");
+
+ // ----- Return
+ return PclZip::errorCode();
+ }
+
+ // ----- Set the attribute
+ $v_result_list[$p_options_list[$i]] = $v_function_name;
+ $i++;
+ break;
+
+ default :
+ // ----- Error log
+ PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER,
+ "Unknown parameter '"
+ .$p_options_list[$i]."'");
+
+ // ----- Return
+ return PclZip::errorCode();
+ }
+
+ // ----- Next options
+ $i++;
+ }
+
+ // ----- Look for mandatory options
+ if ($v_requested_options !== false) {
+ for ($key=reset($v_requested_options); $key=key($v_requested_options); $key=next($v_requested_options)) {
+ // ----- Look for mandatory option
+ if ($v_requested_options[$key] == 'mandatory') {
+ // ----- Look if present
+ if (!isset($v_result_list[$key])) {
+ // ----- Error log
+ PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Missing mandatory parameter ".PclZipUtilOptionText($key)."(".$key.")");
+
+ // ----- Return
+ return PclZip::errorCode();
+ }
+ }
+ }
+ }
+
+ // ----- Look for default values
+ if (!isset($v_result_list[PCLZIP_OPT_TEMP_FILE_THRESHOLD])) {
+
+ }
+
+ // ----- Return
+ return $v_result;
+ }
+ // --------------------------------------------------------------------------------
+
+ // --------------------------------------------------------------------------------
+ // Function : privOptionDefaultThreshold()
+ // Description :
+ // Parameters :
+ // Return Values :
+ // --------------------------------------------------------------------------------
+ function privOptionDefaultThreshold(&$p_options)
+ {
+ $v_result=1;
+
+ if (isset($p_options[PCLZIP_OPT_TEMP_FILE_THRESHOLD])
+ || isset($p_options[PCLZIP_OPT_TEMP_FILE_OFF])) {
+ return $v_result;
+ }
+
+ // ----- Get 'memory_limit' configuration value
+ $v_memory_limit = ini_get('memory_limit');
+ $v_memory_limit = trim($v_memory_limit);
+ $v_memory_limit_int = (int) $v_memory_limit;
+ $last = strtolower(substr($v_memory_limit, -1));
+
+ if($last == 'g')
+ //$v_memory_limit_int = $v_memory_limit_int*1024*1024*1024;
+ $v_memory_limit_int = $v_memory_limit_int*1073741824;
+ if($last == 'm')
+ //$v_memory_limit_int = $v_memory_limit_int*1024*1024;
+ $v_memory_limit_int = $v_memory_limit_int*1048576;
+ if($last == 'k')
+ $v_memory_limit_int = $v_memory_limit_int*1024;
+
+ $p_options[PCLZIP_OPT_TEMP_FILE_THRESHOLD] = floor($v_memory_limit_int*PCLZIP_TEMPORARY_FILE_RATIO);
+
+
+ // ----- Sanity check : No threshold if value lower than 1M
+ if ($p_options[PCLZIP_OPT_TEMP_FILE_THRESHOLD] < 1048576) {
+ unset($p_options[PCLZIP_OPT_TEMP_FILE_THRESHOLD]);
+ }
+
+ // ----- Return
+ return $v_result;
+ }
+ // --------------------------------------------------------------------------------
+
+ // --------------------------------------------------------------------------------
+ // Function : privFileDescrParseAtt()
+ // Description :
+ // Parameters :
+ // Return Values :
+ // 1 on success.
+ // 0 on failure.
+ // --------------------------------------------------------------------------------
+ function privFileDescrParseAtt(&$p_file_list, &$p_filedescr, $v_options, $v_requested_options=false)
+ {
+ $v_result=1;
+
+ // ----- For each file in the list check the attributes
+ foreach ($p_file_list as $v_key => $v_value) {
+
+ // ----- Check if the option is supported
+ if (!isset($v_requested_options[$v_key])) {
+ // ----- Error log
+ PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Invalid file attribute '".$v_key."' for this file");
+
+ // ----- Return
+ return PclZip::errorCode();
+ }
+
+ // ----- Look for attribute
+ switch ($v_key) {
+ case PCLZIP_ATT_FILE_NAME :
+ if (!is_string($v_value)) {
+ PclZip::privErrorLog(PCLZIP_ERR_INVALID_ATTRIBUTE_VALUE, "Invalid type ".gettype($v_value).". String expected for attribute '".PclZipUtilOptionText($v_key)."'");
+ return PclZip::errorCode();
+ }
+
+ $p_filedescr['filename'] = PclZipUtilPathReduction($v_value);
+
+ if ($p_filedescr['filename'] == '') {
+ PclZip::privErrorLog(PCLZIP_ERR_INVALID_ATTRIBUTE_VALUE, "Invalid empty filename for attribute '".PclZipUtilOptionText($v_key)."'");
+ return PclZip::errorCode();
+ }
+
+ break;
+
+ case PCLZIP_ATT_FILE_NEW_SHORT_NAME :
+ if (!is_string($v_value)) {
+ PclZip::privErrorLog(PCLZIP_ERR_INVALID_ATTRIBUTE_VALUE, "Invalid type ".gettype($v_value).". String expected for attribute '".PclZipUtilOptionText($v_key)."'");
+ return PclZip::errorCode();
+ }
+
+ $p_filedescr['new_short_name'] = PclZipUtilPathReduction($v_value);
+
+ if ($p_filedescr['new_short_name'] == '') {
+ PclZip::privErrorLog(PCLZIP_ERR_INVALID_ATTRIBUTE_VALUE, "Invalid empty short filename for attribute '".PclZipUtilOptionText($v_key)."'");
+ return PclZip::errorCode();
+ }
+ break;
+
+ case PCLZIP_ATT_FILE_NEW_FULL_NAME :
+ if (!is_string($v_value)) {
+ PclZip::privErrorLog(PCLZIP_ERR_INVALID_ATTRIBUTE_VALUE, "Invalid type ".gettype($v_value).". String expected for attribute '".PclZipUtilOptionText($v_key)."'");
+ return PclZip::errorCode();
+ }
+
+ $p_filedescr['new_full_name'] = PclZipUtilPathReduction($v_value);
+
+ if ($p_filedescr['new_full_name'] == '') {
+ PclZip::privErrorLog(PCLZIP_ERR_INVALID_ATTRIBUTE_VALUE, "Invalid empty full filename for attribute '".PclZipUtilOptionText($v_key)."'");
+ return PclZip::errorCode();
+ }
+ break;
+
+ // ----- Look for options that takes a string
+ case PCLZIP_ATT_FILE_COMMENT :
+ if (!is_string($v_value)) {
+ PclZip::privErrorLog(PCLZIP_ERR_INVALID_ATTRIBUTE_VALUE, "Invalid type ".gettype($v_value).". String expected for attribute '".PclZipUtilOptionText($v_key)."'");
+ return PclZip::errorCode();
+ }
+
+ $p_filedescr['comment'] = $v_value;
+ break;
+
+ case PCLZIP_ATT_FILE_MTIME :
+ if (!is_integer($v_value)) {
+ PclZip::privErrorLog(PCLZIP_ERR_INVALID_ATTRIBUTE_VALUE, "Invalid type ".gettype($v_value).". Integer expected for attribute '".PclZipUtilOptionText($v_key)."'");
+ return PclZip::errorCode();
+ }
+
+ $p_filedescr['mtime'] = $v_value;
+ break;
+
+ case PCLZIP_ATT_FILE_CONTENT :
+ $p_filedescr['content'] = $v_value;
+ break;
+
+ default :
+ // ----- Error log
+ PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER,
+ "Unknown parameter '".$v_key."'");
+
+ // ----- Return
+ return PclZip::errorCode();
+ }
+
+ // ----- Look for mandatory options
+ if ($v_requested_options !== false) {
+ for ($key=reset($v_requested_options); $key=key($v_requested_options); $key=next($v_requested_options)) {
+ // ----- Look for mandatory option
+ if ($v_requested_options[$key] == 'mandatory') {
+ // ----- Look if present
+ if (!isset($p_file_list[$key])) {
+ PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Missing mandatory parameter ".PclZipUtilOptionText($key)."(".$key.")");
+ return PclZip::errorCode();
+ }
+ }
+ }
+ }
+
+ // end foreach
+ }
+
+ // ----- Return
+ return $v_result;
+ }
+ // --------------------------------------------------------------------------------
+
+ // --------------------------------------------------------------------------------
+ // Function : privFileDescrExpand()
+ // Description :
+ // This method look for each item of the list to see if its a file, a folder
+ // or a string to be added as file. For any other type of files (link, other)
+ // just ignore the item.
+ // Then prepare the information that will be stored for that file.
+ // When its a folder, expand the folder with all the files that are in that
+ // folder (recursively).
+ // Parameters :
+ // Return Values :
+ // 1 on success.
+ // 0 on failure.
+ // --------------------------------------------------------------------------------
+ function privFileDescrExpand(&$p_filedescr_list, &$p_options)
+ {
+ $v_result=1;
+
+ // ----- Create a result list
+ $v_result_list = array();
+
+ // ----- Look each entry
+ for ($i=0; $i<sizeof($p_filedescr_list); $i++) {
+
+ // ----- Get filedescr
+ $v_descr = $p_filedescr_list[$i];
+
+ // ----- Reduce the filename
+ $v_descr['filename'] = PclZipUtilTranslateWinPath($v_descr['filename'], false);
+ $v_descr['filename'] = PclZipUtilPathReduction($v_descr['filename']);
+
+ // ----- Look for real file or folder
+ if (file_exists($v_descr['filename'])) {
+ if (@is_file($v_descr['filename'])) {
+ $v_descr['type'] = 'file';
+ }
+ else if (@is_dir($v_descr['filename'])) {
+ $v_descr['type'] = 'folder';
+ }
+ else if (@is_link($v_descr['filename'])) {
+ // skip
+ continue;
+ }
+ else {
+ // skip
+ continue;
+ }
+ }
+
+ // ----- Look for string added as file
+ else if (isset($v_descr['content'])) {
+ $v_descr['type'] = 'virtual_file';
+ }
+
+ // ----- Missing file
+ else {
+ // ----- Error log
+ PclZip::privErrorLog(PCLZIP_ERR_MISSING_FILE, "File '".$v_descr['filename']."' does not exist");
+
+ // ----- Return
+ return PclZip::errorCode();
+ }
+
+ // ----- Calculate the stored filename
+ $this->privCalculateStoredFilename($v_descr, $p_options);
+
+ // ----- Add the descriptor in result list
+ $v_result_list[sizeof($v_result_list)] = $v_descr;
+
+ // ----- Look for folder
+ if ($v_descr['type'] == 'folder') {
+ // ----- List of items in folder
+ $v_dirlist_descr = array();
+ $v_dirlist_nb = 0;
+ if ($v_folder_handler = @opendir($v_descr['filename'])) {
+ while (($v_item_handler = @readdir($v_folder_handler)) !== false) {
+
+ // ----- Skip '.' and '..'
+ if (($v_item_handler == '.') || ($v_item_handler == '..')) {
+ continue;
+ }
+
+ // ----- Compose the full filename
+ $v_dirlist_descr[$v_dirlist_nb]['filename'] = $v_descr['filename'].'/'.$v_item_handler;
+
+ // ----- Look for different stored filename
+ // Because the name of the folder was changed, the name of the
+ // files/sub-folders also change
+ if (($v_descr['stored_filename'] != $v_descr['filename'])
+ && (!isset($p_options[PCLZIP_OPT_REMOVE_ALL_PATH]))) {
+ if ($v_descr['stored_filename'] != '') {
+ $v_dirlist_descr[$v_dirlist_nb]['new_full_name'] = $v_descr['stored_filename'].'/'.$v_item_handler;
+ }
+ else {
+ $v_dirlist_descr[$v_dirlist_nb]['new_full_name'] = $v_item_handler;
+ }
+ }
+
+ $v_dirlist_nb++;
+ }
+
+ @closedir($v_folder_handler);
+ }
+ else {
+ // TBC : unable to open folder in read mode
+ }
+
+ // ----- Expand each element of the list
+ if ($v_dirlist_nb != 0) {
+ // ----- Expand
+ if (($v_result = $this->privFileDescrExpand($v_dirlist_descr, $p_options)) != 1) {
+ return $v_result;
+ }
+
+ // ----- Concat the resulting list
+ $v_result_list = array_merge($v_result_list, $v_dirlist_descr);
+ }
+ else {
+ }
+
+ // ----- Free local array
+ unset($v_dirlist_descr);
+ }
+ }
+
+ // ----- Get the result list
+ $p_filedescr_list = $v_result_list;
+
+ // ----- Return
+ return $v_result;
+ }
+ // --------------------------------------------------------------------------------
+
+ // --------------------------------------------------------------------------------
+ // Function : privCreate()
+ // Description :
+ // Parameters :
+ // Return Values :
+ // --------------------------------------------------------------------------------
+ function privCreate($p_filedescr_list, &$p_result_list, &$p_options)
+ {
+ $v_result=1;
+ $v_list_detail = array();
+
+ // ----- Magic quotes trick
+ $this->privDisableMagicQuotes();
+
+ // ----- Open the file in write mode
+ if (($v_result = $this->privOpenFd('wb')) != 1)
+ {
+ // ----- Return
+ return $v_result;
+ }
+
+ // ----- Add the list of files
+ $v_result = $this->privAddList($p_filedescr_list, $p_result_list, $p_options);
+
+ // ----- Close
+ $this->privCloseFd();
+
+ // ----- Magic quotes trick
+ $this->privSwapBackMagicQuotes();
+
+ // ----- Return
+ return $v_result;
+ }
+ // --------------------------------------------------------------------------------
+
+ // --------------------------------------------------------------------------------
+ // Function : privAdd()
+ // Description :
+ // Parameters :
+ // Return Values :
+ // --------------------------------------------------------------------------------
+ function privAdd($p_filedescr_list, &$p_result_list, &$p_options)
+ {
+ $v_result=1;
+ $v_list_detail = array();
+
+ // ----- Look if the archive exists or is empty
+ if ((!is_file($this->zipname)) || (filesize($this->zipname) == 0))
+ {
+
+ // ----- Do a create
+ $v_result = $this->privCreate($p_filedescr_list, $p_result_list, $p_options);
+
+ // ----- Return
+ return $v_result;
+ }
+ // ----- Magic quotes trick
+ $this->privDisableMagicQuotes();
+
+ // ----- Open the zip file
+ if (($v_result=$this->privOpenFd('rb')) != 1)
+ {
+ // ----- Magic quotes trick
+ $this->privSwapBackMagicQuotes();
+
+ // ----- Return
+ return $v_result;
+ }
+
+ // ----- Read the central directory informations
+ $v_central_dir = array();
+ if (($v_result = $this->privReadEndCentralDir($v_central_dir)) != 1)
+ {
+ $this->privCloseFd();
+ $this->privSwapBackMagicQuotes();
+ return $v_result;
+ }
+
+ // ----- Go to beginning of File
+ @rewind($this->zip_fd);
+
+ // ----- Creates a temporay file
+ $v_zip_temp_name = PCLZIP_TEMPORARY_DIR.uniqid('pclzip-').'.tmp';
+
+ // ----- Open the temporary file in write mode
+ if (($v_zip_temp_fd = @fopen($v_zip_temp_name, 'wb')) == 0)
+ {
+ $this->privCloseFd();
+ $this->privSwapBackMagicQuotes();
+
+ PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, 'Unable to open temporary file \''.$v_zip_temp_name.'\' in binary write mode');
+
+ // ----- Return
+ return PclZip::errorCode();
+ }
+
+ // ----- Copy the files from the archive to the temporary file
+ // TBC : Here I should better append the file and go back to erase the central dir
+ $v_size = $v_central_dir['offset'];
+ while ($v_size != 0)
+ {
+ $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE);
+ $v_buffer = fread($this->zip_fd, $v_read_size);
+ @fwrite($v_zip_temp_fd, $v_buffer, $v_read_size);
+ $v_size -= $v_read_size;
+ }
+
+ // ----- Swap the file descriptor
+ // Here is a trick : I swap the temporary fd with the zip fd, in order to use
+ // the following methods on the temporary fil and not the real archive
+ $v_swap = $this->zip_fd;
+ $this->zip_fd = $v_zip_temp_fd;
+ $v_zip_temp_fd = $v_swap;
+
+ // ----- Add the files
+ $v_header_list = array();
+ if (($v_result = $this->privAddFileList($p_filedescr_list, $v_header_list, $p_options)) != 1)
+ {
+ fclose($v_zip_temp_fd);
+ $this->privCloseFd();
+ @unlink($v_zip_temp_name);
+ $this->privSwapBackMagicQuotes();
+
+ // ----- Return
+ return $v_result;
+ }
+
+ // ----- Store the offset of the central dir
+ $v_offset = @ftell($this->zip_fd);
+
+ // ----- Copy the block of file headers from the old archive
+ $v_size = $v_central_dir['size'];
+ while ($v_size != 0)
+ {
+ $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE);
+ $v_buffer = @fread($v_zip_temp_fd, $v_read_size);
+ @fwrite($this->zip_fd, $v_buffer, $v_read_size);
+ $v_size -= $v_read_size;
+ }
+
+ // ----- Create the Central Dir files header
+ for ($i=0, $v_count=0; $i<sizeof($v_header_list); $i++)
+ {
+ // ----- Create the file header
+ if ($v_header_list[$i]['status'] == 'ok') {
+ if (($v_result = $this->privWriteCentralFileHeader($v_header_list[$i])) != 1) {
+ fclose($v_zip_temp_fd);
+ $this->privCloseFd();
+ @unlink($v_zip_temp_name);
+ $this->privSwapBackMagicQuotes();
+
+ // ----- Return
+ return $v_result;
+ }
+ $v_count++;
+ }
+
+ // ----- Transform the header to a 'usable' info
+ $this->privConvertHeader2FileInfo($v_header_list[$i], $p_result_list[$i]);
+ }
+
+ // ----- Zip file comment
+ $v_comment = $v_central_dir['comment'];
+ if (isset($p_options[PCLZIP_OPT_COMMENT])) {
+ $v_comment = $p_options[PCLZIP_OPT_COMMENT];
+ }
+ if (isset($p_options[PCLZIP_OPT_ADD_COMMENT])) {
+ $v_comment = $v_comment.$p_options[PCLZIP_OPT_ADD_COMMENT];
+ }
+ if (isset($p_options[PCLZIP_OPT_PREPEND_COMMENT])) {
+ $v_comment = $p_options[PCLZIP_OPT_PREPEND_COMMENT].$v_comment;
+ }
+
+ // ----- Calculate the size of the central header
+ $v_size = @ftell($this->zip_fd)-$v_offset;
+
+ // ----- Create the central dir footer
+ if (($v_result = $this->privWriteCentralHeader($v_count+$v_central_dir['entries'], $v_size, $v_offset, $v_comment)) != 1)
+ {
+ // ----- Reset the file list
+ unset($v_header_list);
+ $this->privSwapBackMagicQuotes();
+
+ // ----- Return
+ return $v_result;
+ }
+
+ // ----- Swap back the file descriptor
+ $v_swap = $this->zip_fd;
+ $this->zip_fd = $v_zip_temp_fd;
+ $v_zip_temp_fd = $v_swap;
+
+ // ----- Close
+ $this->privCloseFd();
+
+ // ----- Close the temporary file
+ @fclose($v_zip_temp_fd);
+
+ // ----- Magic quotes trick
+ $this->privSwapBackMagicQuotes();
+
+ // ----- Delete the zip file
+ // TBC : I should test the result ...
+ @unlink($this->zipname);
+
+ // ----- Rename the temporary file
+ // TBC : I should test the result ...
+ //@rename($v_zip_temp_name, $this->zipname);
+ PclZipUtilRename($v_zip_temp_name, $this->zipname);
+
+ // ----- Return
+ return $v_result;
+ }
+ // --------------------------------------------------------------------------------
+
+ // --------------------------------------------------------------------------------
+ // Function : privOpenFd()
+ // Description :
+ // Parameters :
+ // --------------------------------------------------------------------------------
+ function privOpenFd($p_mode)
+ {
+ $v_result=1;
+
+ // ----- Look if already open
+ if ($this->zip_fd != 0)
+ {
+ // ----- Error log
+ PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, 'Zip file \''.$this->zipname.'\' already open');
+
+ // ----- Return
+ return PclZip::errorCode();
+ }
+
+ // ----- Open the zip file
+ if (($this->zip_fd = @fopen($this->zipname, $p_mode)) == 0)
+ {
+ // ----- Error log
+ PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, 'Unable to open archive \''.$this->zipname.'\' in '.$p_mode.' mode');
+
+ // ----- Return
+ return PclZip::errorCode();
+ }
+
+ // ----- Return
+ return $v_result;
+ }
+ // --------------------------------------------------------------------------------
+
+ // --------------------------------------------------------------------------------
+ // Function : privCloseFd()
+ // Description :
+ // Parameters :
+ // --------------------------------------------------------------------------------
+ function privCloseFd()
+ {
+ $v_result=1;
+
+ if ($this->zip_fd != 0)
+ @fclose($this->zip_fd);
+ $this->zip_fd = 0;
+
+ // ----- Return
+ return $v_result;
+ }
+ // --------------------------------------------------------------------------------
+
+ // --------------------------------------------------------------------------------
+ // Function : privAddList()
+ // Description :
+ // $p_add_dir and $p_remove_dir will give the ability to memorize a path which is
+ // different from the real path of the file. This is usefull if you want to have PclTar
+ // running in any directory, and memorize relative path from an other directory.
+ // Parameters :
+ // $p_list : An array containing the file or directory names to add in the tar
+ // $p_result_list : list of added files with their properties (specially the status field)
+ // $p_add_dir : Path to add in the filename path archived
+ // $p_remove_dir : Path to remove in the filename path archived
+ // Return Values :
+ // --------------------------------------------------------------------------------
+// function privAddList($p_list, &$p_result_list, $p_add_dir, $p_remove_dir, $p_remove_all_dir, &$p_options)
+ function privAddList($p_filedescr_list, &$p_result_list, &$p_options)
+ {
+ $v_result=1;
+
+ // ----- Add the files
+ $v_header_list = array();
+ if (($v_result = $this->privAddFileList($p_filedescr_list, $v_header_list, $p_options)) != 1)
+ {
+ // ----- Return
+ return $v_result;
+ }
+
+ // ----- Store the offset of the central dir
+ $v_offset = @ftell($this->zip_fd);
+
+ // ----- Create the Central Dir files header
+ for ($i=0,$v_count=0; $i<sizeof($v_header_list); $i++)
+ {
+ // ----- Create the file header
+ if ($v_header_list[$i]['status'] == 'ok') {
+ if (($v_result = $this->privWriteCentralFileHeader($v_header_list[$i])) != 1) {
+ // ----- Return
+ return $v_result;
+ }
+ $v_count++;
+ }
+
+ // ----- Transform the header to a 'usable' info
+ $this->privConvertHeader2FileInfo($v_header_list[$i], $p_result_list[$i]);
+ }
+
+ // ----- Zip file comment
+ $v_comment = '';
+ if (isset($p_options[PCLZIP_OPT_COMMENT])) {
+ $v_comment = $p_options[PCLZIP_OPT_COMMENT];
+ }
+
+ // ----- Calculate the size of the central header
+ $v_size = @ftell($this->zip_fd)-$v_offset;
+
+ // ----- Create the central dir footer
+ if (($v_result = $this->privWriteCentralHeader($v_count, $v_size, $v_offset, $v_comment)) != 1)
+ {
+ // ----- Reset the file list
+ unset($v_header_list);
+
+ // ----- Return
+ return $v_result;
+ }
+
+ // ----- Return
+ return $v_result;
+ }
+ // --------------------------------------------------------------------------------
+
+ // --------------------------------------------------------------------------------
+ // Function : privAddFileList()
+ // Description :
+ // Parameters :
+ // $p_filedescr_list : An array containing the file description
+ // or directory names to add in the zip
+ // $p_result_list : list of added files with their properties (specially the status field)
+ // Return Values :
+ // --------------------------------------------------------------------------------
+ function privAddFileList($p_filedescr_list, &$p_result_list, &$p_options)
+ {
+ $v_result=1;
+ $v_header = array();
+
+ // ----- Recuperate the current number of elt in list
+ $v_nb = sizeof($p_result_list);
+
+ // ----- Loop on the files
+ for ($j=0; ($j<sizeof($p_filedescr_list)) && ($v_result==1); $j++) {
+ // ----- Format the filename
+ $p_filedescr_list[$j]['filename']
+ = PclZipUtilTranslateWinPath($p_filedescr_list[$j]['filename'], false);
+
+
+ // ----- Skip empty file names
+ // TBC : Can this be possible ? not checked in DescrParseAtt ?
+ if ($p_filedescr_list[$j]['filename'] == "") {
+ continue;
+ }
+
+ // ----- Check the filename
+ if ( ($p_filedescr_list[$j]['type'] != 'virtual_file')
+ && (!file_exists($p_filedescr_list[$j]['filename']))) {
+ PclZip::privErrorLog(PCLZIP_ERR_MISSING_FILE, "File '".$p_filedescr_list[$j]['filename']."' does not exist");
+ return PclZip::errorCode();
+ }
+
+ // ----- Look if it is a file or a dir with no all path remove option
+ // or a dir with all its path removed
+// if ( (is_file($p_filedescr_list[$j]['filename']))
+// || ( is_dir($p_filedescr_list[$j]['filename'])
+ if ( ($p_filedescr_list[$j]['type'] == 'file')
+ || ($p_filedescr_list[$j]['type'] == 'virtual_file')
+ || ( ($p_filedescr_list[$j]['type'] == 'folder')
+ && ( !isset($p_options[PCLZIP_OPT_REMOVE_ALL_PATH])
+ || !$p_options[PCLZIP_OPT_REMOVE_ALL_PATH]))
+ ) {
+
+ // ----- Add the file
+ $v_result = $this->privAddFile($p_filedescr_list[$j], $v_header,
+ $p_options);
+ if ($v_result != 1) {
+ return $v_result;
+ }
+
+ // ----- Store the file infos
+ $p_result_list[$v_nb++] = $v_header;
+ }
+ }
+
+ // ----- Return
+ return $v_result;
+ }
+ // --------------------------------------------------------------------------------
+
+ // --------------------------------------------------------------------------------
+ // Function : privAddFile()
+ // Description :
+ // Parameters :
+ // Return Values :
+ // --------------------------------------------------------------------------------
+ function privAddFile($p_filedescr, &$p_header, &$p_options)
+ {
+ $v_result=1;
+
+ // ----- Working variable
+ $p_filename = $p_filedescr['filename'];
+
+ // TBC : Already done in the fileAtt check ... ?
+ if ($p_filename == "") {
+ // ----- Error log
+ PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Invalid file list parameter (invalid or empty list)");
+
+ // ----- Return
+ return PclZip::errorCode();
+ }
+
+ // ----- Look for a stored different filename
+ /* TBC : Removed
+ if (isset($p_filedescr['stored_filename'])) {
+ $v_stored_filename = $p_filedescr['stored_filename'];
+ }
+ else {
+ $v_stored_filename = $p_filedescr['stored_filename'];
+ }
+ */
+
+ // ----- Set the file properties
+ clearstatcache();
+ $p_header['version'] = 20;
+ $p_header['version_extracted'] = 10;
+ $p_header['flag'] = 0;
+ $p_header['compression'] = 0;
+ $p_header['crc'] = 0;
+ $p_header['compressed_size'] = 0;
+ $p_header['filename_len'] = strlen($p_filename);
+ $p_header['extra_len'] = 0;
+ $p_header['disk'] = 0;
+ $p_header['internal'] = 0;
+ $p_header['offset'] = 0;
+ $p_header['filename'] = $p_filename;
+// TBC : Removed $p_header['stored_filename'] = $v_stored_filename;
+ $p_header['stored_filename'] = $p_filedescr['stored_filename'];
+ $p_header['extra'] = '';
+ $p_header['status'] = 'ok';
+ $p_header['index'] = -1;
+
+ // ----- Look for regular file
+ if ($p_filedescr['type']=='file') {
+ $p_header['external'] = 0x00000000;
+ $p_header['size'] = filesize($p_filename);
+ }
+
+ // ----- Look for regular folder
+ else if ($p_filedescr['type']=='folder') {
+ $p_header['external'] = 0x00000010;
+ $p_header['mtime'] = filemtime($p_filename);
+ $p_header['size'] = filesize($p_filename);
+ }
+
+ // ----- Look for virtual file
+ else if ($p_filedescr['type'] == 'virtual_file') {
+ $p_header['external'] = 0x00000000;
+ $p_header['size'] = strlen($p_filedescr['content']);
+ }
+
+
+ // ----- Look for filetime
+ if (isset($p_filedescr['mtime'])) {
+ $p_header['mtime'] = $p_filedescr['mtime'];
+ }
+ else if ($p_filedescr['type'] == 'virtual_file') {
+ $p_header['mtime'] = time();
+ }
+ else {
+ $p_header['mtime'] = filemtime($p_filename);
+ }
+
+ // ------ Look for file comment
+ if (isset($p_filedescr['comment'])) {
+ $p_header['comment_len'] = strlen($p_filedescr['comment']);
+ $p_header['comment'] = $p_filedescr['comment'];
+ }
+ else {
+ $p_header['comment_len'] = 0;
+ $p_header['comment'] = '';
+ }
+
+ // ----- Look for pre-add callback
+ if (isset($p_options[PCLZIP_CB_PRE_ADD])) {
+
+ // ----- Generate a local information
+ $v_local_header = array();
+ $this->privConvertHeader2FileInfo($p_header, $v_local_header);
+
+ // ----- Call the callback
+ // Here I do not use call_user_func() because I need to send a reference to the
+ // header.
+ $v_result = $p_options[PCLZIP_CB_PRE_ADD](PCLZIP_CB_PRE_ADD, $v_local_header);
+ if ($v_result == 0) {
+ // ----- Change the file status
+ $p_header['status'] = "skipped";
+ $v_result = 1;
+ }
+
+ // ----- Update the informations
+ // Only some fields can be modified
+ if ($p_header['stored_filename'] != $v_local_header['stored_filename']) {
+ $p_header['stored_filename'] = PclZipUtilPathReduction($v_local_header['stored_filename']);
+ }
+ }
+
+ // ----- Look for empty stored filename
+ if ($p_header['stored_filename'] == "") {
+ $p_header['status'] = "filtered";
+ }
+
+ // ----- Check the path length
+ if (strlen($p_header['stored_filename']) > 0xFF) {
+ $p_header['status'] = 'filename_too_long';
+ }
+
+ // ----- Look if no error, or file not skipped
+ if ($p_header['status'] == 'ok') {
+
+ // ----- Look for a file
+ if ($p_filedescr['type'] == 'file') {
+ // ----- Look for using temporary file to zip
+ if ( (!isset($p_options[PCLZIP_OPT_TEMP_FILE_OFF]))
+ && (isset($p_options[PCLZIP_OPT_TEMP_FILE_ON])
+ || (isset($p_options[PCLZIP_OPT_TEMP_FILE_THRESHOLD])
+ && ($p_options[PCLZIP_OPT_TEMP_FILE_THRESHOLD] <= $p_header['size'])) ) ) {
+ $v_result = $this->privAddFileUsingTempFile($p_filedescr, $p_header, $p_options);
+ if ($v_result < PCLZIP_ERR_NO_ERROR) {
+ return $v_result;
+ }
+ }
+
+ // ----- Use "in memory" zip algo
+ else {
+
+ // ----- Open the source file
+ if (($v_file = @fopen($p_filename, "rb")) == 0) {
+ PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, "Unable to open file '$p_filename' in binary read mode");
+ return PclZip::errorCode();
+ }
+
+ // ----- Read the file content
+ $v_content = @fread($v_file, $p_header['size']);
+
+ // ----- Close the file
+ @fclose($v_file);
+
+ // ----- Calculate the CRC
+ $p_header['crc'] = @crc32($v_content);
+
+ // ----- Look for no compression
+ if ($p_options[PCLZIP_OPT_NO_COMPRESSION]) {
+ // ----- Set header parameters
+ $p_header['compressed_size'] = $p_header['size'];
+ $p_header['compression'] = 0;
+ }
+
+ // ----- Look for normal compression
+ else {
+ // ----- Compress the content
+ $v_content = @gzdeflate($v_content);
+
+ // ----- Set header parameters
+ $p_header['compressed_size'] = strlen($v_content);
+ $p_header['compression'] = 8;
+ }
+
+ // ----- Call the header generation
+ if (($v_result = $this->privWriteFileHeader($p_header)) != 1) {
+ @fclose($v_file);
+ return $v_result;
+ }
+
+ // ----- Write the compressed (or not) content
+ @fwrite($this->zip_fd, $v_content, $p_header['compressed_size']);
+
+ }
+
+ }
+
+ // ----- Look for a virtual file (a file from string)
+ else if ($p_filedescr['type'] == 'virtual_file') {
+
+ $v_content = $p_filedescr['content'];
+
+ // ----- Calculate the CRC
+ $p_header['crc'] = @crc32($v_content);
+
+ // ----- Look for no compression
+ if ($p_options[PCLZIP_OPT_NO_COMPRESSION]) {
+ // ----- Set header parameters
+ $p_header['compressed_size'] = $p_header['size'];
+ $p_header['compression'] = 0;
+ }
+
+ // ----- Look for normal compression
+ else {
+ // ----- Compress the content
+ $v_content = @gzdeflate($v_content);
+
+ // ----- Set header parameters
+ $p_header['compressed_size'] = strlen($v_content);
+ $p_header['compression'] = 8;
+ }
+
+ // ----- Call the header generation
+ if (($v_result = $this->privWriteFileHeader($p_header)) != 1) {
+ @fclose($v_file);
+ return $v_result;
+ }
+
+ // ----- Write the compressed (or not) content
+ @fwrite($this->zip_fd, $v_content, $p_header['compressed_size']);
+ }
+
+ // ----- Look for a directory
+ else if ($p_filedescr['type'] == 'folder') {
+ // ----- Look for directory last '/'
+ if (@substr($p_header['stored_filename'], -1) != '/') {
+ $p_header['stored_filename'] .= '/';
+ }
+
+ // ----- Set the file properties
+ $p_header['size'] = 0;
+ //$p_header['external'] = 0x41FF0010; // Value for a folder : to be checked
+ $p_header['external'] = 0x00000010; // Value for a folder : to be checked
+
+ // ----- Call the header generation
+ if (($v_result = $this->privWriteFileHeader($p_header)) != 1)
+ {
+ return $v_result;
+ }
+ }
+ }
+
+ // ----- Look for post-add callback
+ if (isset($p_options[PCLZIP_CB_POST_ADD])) {
+
+ // ----- Generate a local information
+ $v_local_header = array();
+ $this->privConvertHeader2FileInfo($p_header, $v_local_header);
+
+ // ----- Call the callback
+ // Here I do not use call_user_func() because I need to send a reference to the
+ // header.
+ $v_result = $p_options[PCLZIP_CB_POST_ADD](PCLZIP_CB_POST_ADD, $v_local_header);
+ if ($v_result == 0) {
+ // ----- Ignored
+ $v_result = 1;
+ }
+
+ // ----- Update the informations
+ // Nothing can be modified
+ }
+
+ // ----- Return
+ return $v_result;
+ }
+ // --------------------------------------------------------------------------------
+
+ // --------------------------------------------------------------------------------
+ // Function : privAddFileUsingTempFile()
+ // Description :
+ // Parameters :
+ // Return Values :
+ // --------------------------------------------------------------------------------
+ function privAddFileUsingTempFile($p_filedescr, &$p_header, &$p_options)
+ {
+ $v_result=PCLZIP_ERR_NO_ERROR;
+
+ // ----- Working variable
+ $p_filename = $p_filedescr['filename'];
+
+
+ // ----- Open the source file
+ if (($v_file = @fopen($p_filename, "rb")) == 0) {
+ PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, "Unable to open file '$p_filename' in binary read mode");
+ return PclZip::errorCode();
+ }
+
+ // ----- Creates a compressed temporary file
+ $v_gzip_temp_name = PCLZIP_TEMPORARY_DIR.uniqid('pclzip-').'.gz';
+ if (($v_file_compressed = @gzopen($v_gzip_temp_name, "wb")) == 0) {
+ fclose($v_file);
+ PclZip::privErrorLog(PCLZIP_ERR_WRITE_OPEN_FAIL, 'Unable to open temporary file \''.$v_gzip_temp_name.'\' in binary write mode');
+ return PclZip::errorCode();
+ }
+
+ // ----- Read the file by PCLZIP_READ_BLOCK_SIZE octets blocks
+ $v_size = filesize($p_filename);
+ while ($v_size != 0) {
+ $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE);
+ $v_buffer = @fread($v_file, $v_read_size);
+ //$v_binary_data = pack('a'.$v_read_size, $v_buffer);
+ @gzputs($v_file_compressed, $v_buffer, $v_read_size);
+ $v_size -= $v_read_size;
+ }
+
+ // ----- Close the file
+ @fclose($v_file);
+ @gzclose($v_file_compressed);
+
+ // ----- Check the minimum file size
+ if (filesize($v_gzip_temp_name) < 18) {
+ PclZip::privErrorLog(PCLZIP_ERR_BAD_FORMAT, 'gzip temporary file \''.$v_gzip_temp_name.'\' has invalid filesize - should be minimum 18 bytes');
+ return PclZip::errorCode();
+ }
+
+ // ----- Extract the compressed attributes
+ if (($v_file_compressed = @fopen($v_gzip_temp_name, "rb")) == 0) {
+ PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, 'Unable to open temporary file \''.$v_gzip_temp_name.'\' in binary read mode');
+ return PclZip::errorCode();
+ }
+
+ // ----- Read the gzip file header
+ $v_binary_data = @fread($v_file_compressed, 10);
+ $v_data_header = unpack('a1id1/a1id2/a1cm/a1flag/Vmtime/a1xfl/a1os', $v_binary_data);
+
+ // ----- Check some parameters
+ $v_data_header['os'] = bin2hex($v_data_header['os']);
+
+ // ----- Read the gzip file footer
+ @fseek($v_file_compressed, filesize($v_gzip_temp_name)-8);
+ $v_binary_data = @fread($v_file_compressed, 8);
+ $v_data_footer = unpack('Vcrc/Vcompressed_size', $v_binary_data);
+
+ // ----- Set the attributes
+ $p_header['compression'] = ord($v_data_header['cm']);
+ //$p_header['mtime'] = $v_data_header['mtime'];
+ $p_header['crc'] = $v_data_footer['crc'];
+ $p_header['compressed_size'] = filesize($v_gzip_temp_name)-18;
+
+ // ----- Close the file
+ @fclose($v_file_compressed);
+
+ // ----- Call the header generation
+ if (($v_result = $this->privWriteFileHeader($p_header)) != 1) {
+ return $v_result;
+ }
+
+ // ----- Add the compressed data
+ if (($v_file_compressed = @fopen($v_gzip_temp_name, "rb")) == 0)
+ {
+ PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, 'Unable to open temporary file \''.$v_gzip_temp_name.'\' in binary read mode');
+ return PclZip::errorCode();
+ }
+
+ // ----- Read the file by PCLZIP_READ_BLOCK_SIZE octets blocks
+ fseek($v_file_compressed, 10);
+ $v_size = $p_header['compressed_size'];
+ while ($v_size != 0)
+ {
+ $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE);
+ $v_buffer = @fread($v_file_compressed, $v_read_size);
+ //$v_binary_data = pack('a'.$v_read_size, $v_buffer);
+ @fwrite($this->zip_fd, $v_buffer, $v_read_size);
+ $v_size -= $v_read_size;
+ }
+
+ // ----- Close the file
+ @fclose($v_file_compressed);
+
+ // ----- Unlink the temporary file
+ @unlink($v_gzip_temp_name);
+
+ // ----- Return
+ return $v_result;
+ }
+ // --------------------------------------------------------------------------------
+
+ // --------------------------------------------------------------------------------
+ // Function : privCalculateStoredFilename()
+ // Description :
+ // Based on file descriptor properties and global options, this method
+ // calculate the filename that will be stored in the archive.
+ // Parameters :
+ // Return Values :
+ // --------------------------------------------------------------------------------
+ function privCalculateStoredFilename(&$p_filedescr, &$p_options)
+ {
+ $v_result=1;
+
+ // ----- Working variables
+ $p_filename = $p_filedescr['filename'];
+ if (isset($p_options[PCLZIP_OPT_ADD_PATH])) {
+ $p_add_dir = $p_options[PCLZIP_OPT_ADD_PATH];
+ }
+ else {
+ $p_add_dir = '';
+ }
+ if (isset($p_options[PCLZIP_OPT_REMOVE_PATH])) {
+ $p_remove_dir = $p_options[PCLZIP_OPT_REMOVE_PATH];
+ }
+ else {
+ $p_remove_dir = '';
+ }
+ if (isset($p_options[PCLZIP_OPT_REMOVE_ALL_PATH])) {
+ $p_remove_all_dir = $p_options[PCLZIP_OPT_REMOVE_ALL_PATH];
+ }
+ else {
+ $p_remove_all_dir = 0;
+ }
+
+
+ // ----- Look for full name change
+ if (isset($p_filedescr['new_full_name'])) {
+ // ----- Remove drive letter if any
+ $v_stored_filename = PclZipUtilTranslateWinPath($p_filedescr['new_full_name']);
+ }
+
+ // ----- Look for path and/or short name change
+ else {
+
+ // ----- Look for short name change
+ // Its when we cahnge just the filename but not the path
+ if (isset($p_filedescr['new_short_name'])) {
+ $v_path_info = pathinfo($p_filename);
+ $v_dir = '';
+ if ($v_path_info['dirname'] != '') {
+ $v_dir = $v_path_info['dirname'].'/';
+ }
+ $v_stored_filename = $v_dir.$p_filedescr['new_short_name'];
+ }
+ else {
+ // ----- Calculate the stored filename
+ $v_stored_filename = $p_filename;
+ }
+
+ // ----- Look for all path to remove
+ if ($p_remove_all_dir) {
+ $v_stored_filename = basename($p_filename);
+ }
+ // ----- Look for partial path remove
+ else if ($p_remove_dir != "") {
+ if (substr($p_remove_dir, -1) != '/')
+ $p_remove_dir .= "/";
+
+ if ( (substr($p_filename, 0, 2) == "./")
+ || (substr($p_remove_dir, 0, 2) == "./")) {
+
+ if ( (substr($p_filename, 0, 2) == "./")
+ && (substr($p_remove_dir, 0, 2) != "./")) {
+ $p_remove_dir = "./".$p_remove_dir;
+ }
+ if ( (substr($p_filename, 0, 2) != "./")
+ && (substr($p_remove_dir, 0, 2) == "./")) {
+ $p_remove_dir = substr($p_remove_dir, 2);
+ }
+ }
+
+ $v_compare = PclZipUtilPathInclusion($p_remove_dir,
+ $v_stored_filename);
+ if ($v_compare > 0) {
+ if ($v_compare == 2) {
+ $v_stored_filename = "";
+ }
+ else {
+ $v_stored_filename = substr($v_stored_filename,
+ strlen($p_remove_dir));
+ }
+ }
+ }
+
+ // ----- Remove drive letter if any
+ $v_stored_filename = PclZipUtilTranslateWinPath($v_stored_filename);
+
+ // ----- Look for path to add
+ if ($p_add_dir != "") {
+ if (substr($p_add_dir, -1) == "/")
+ $v_stored_filename = $p_add_dir.$v_stored_filename;
+ else
+ $v_stored_filename = $p_add_dir."/".$v_stored_filename;
+ }
+ }
+
+ // ----- Filename (reduce the path of stored name)
+ $v_stored_filename = PclZipUtilPathReduction($v_stored_filename);
+ $p_filedescr['stored_filename'] = $v_stored_filename;
+
+ // ----- Return
+ return $v_result;
+ }
+ // --------------------------------------------------------------------------------
+
+ // --------------------------------------------------------------------------------
+ // Function : privWriteFileHeader()
+ // Description :
+ // Parameters :
+ // Return Values :
+ // --------------------------------------------------------------------------------
+ function privWriteFileHeader(&$p_header)
+ {
+ $v_result=1;
+
+ // ----- Store the offset position of the file
+ $p_header['offset'] = ftell($this->zip_fd);
+
+ // ----- Transform UNIX mtime to DOS format mdate/mtime
+ $v_date = getdate($p_header['mtime']);
+ $v_mtime = ($v_date['hours']<<11) + ($v_date['minutes']<<5) + $v_date['seconds']/2;
+ $v_mdate = (($v_date['year']-1980)<<9) + ($v_date['mon']<<5) + $v_date['mday'];
+
+ // ----- Packed data
+ $v_binary_data = pack("VvvvvvVVVvv", 0x04034b50,
+ $p_header['version_extracted'], $p_header['flag'],
+ $p_header['compression'], $v_mtime, $v_mdate,
+ $p_header['crc'], $p_header['compressed_size'],
+ $p_header['size'],
+ strlen($p_header['stored_filename']),
+ $p_header['extra_len']);
+
+ // ----- Write the first 148 bytes of the header in the archive
+ fputs($this->zip_fd, $v_binary_data, 30);
+
+ // ----- Write the variable fields
+ if (strlen($p_header['stored_filename']) != 0)
+ {
+ fputs($this->zip_fd, $p_header['stored_filename'], strlen($p_header['stored_filename']));
+ }
+ if ($p_header['extra_len'] != 0)
+ {
+ fputs($this->zip_fd, $p_header['extra'], $p_header['extra_len']);
+ }
+
+ // ----- Return
+ return $v_result;
+ }
+ // --------------------------------------------------------------------------------
+
+ // --------------------------------------------------------------------------------
+ // Function : privWriteCentralFileHeader()
+ // Description :
+ // Parameters :
+ // Return Values :
+ // --------------------------------------------------------------------------------
+ function privWriteCentralFileHeader(&$p_header)
+ {
+ $v_result=1;
+
+ // TBC
+ //for(reset($p_header); $key = key($p_header); next($p_header)) {
+ //}
+
+ // ----- Transform UNIX mtime to DOS format mdate/mtime
+ $v_date = getdate($p_header['mtime']);
+ $v_mtime = ($v_date['hours']<<11) + ($v_date['minutes']<<5) + $v_date['seconds']/2;
+ $v_mdate = (($v_date['year']-1980)<<9) + ($v_date['mon']<<5) + $v_date['mday'];
+
+
+ // ----- Packed data
+ $v_binary_data = pack("VvvvvvvVVVvvvvvVV", 0x02014b50,
+ $p_header['version'], $p_header['version_extracted'],
+ $p_header['flag'], $p_header['compression'],
+ $v_mtime, $v_mdate, $p_header['crc'],
+ $p_header['compressed_size'], $p_header['size'],
+ strlen($p_header['stored_filename']),
+ $p_header['extra_len'], $p_header['comment_len'],
+ $p_header['disk'], $p_header['internal'],
+ $p_header['external'], $p_header['offset']);
+
+ // ----- Write the 42 bytes of the header in the zip file
+ fputs($this->zip_fd, $v_binary_data, 46);
+
+ // ----- Write the variable fields
+ if (strlen($p_header['stored_filename']) != 0)
+ {
+ fputs($this->zip_fd, $p_header['stored_filename'], strlen($p_header['stored_filename']));
+ }
+ if ($p_header['extra_len'] != 0)
+ {
+ fputs($this->zip_fd, $p_header['extra'], $p_header['extra_len']);
+ }
+ if ($p_header['comment_len'] != 0)
+ {
+ fputs($this->zip_fd, $p_header['comment'], $p_header['comment_len']);
+ }
+
+ // ----- Return
+ return $v_result;
+ }
+ // --------------------------------------------------------------------------------
+
+ // --------------------------------------------------------------------------------
+ // Function : privWriteCentralHeader()
+ // Description :
+ // Parameters :
+ // Return Values :
+ // --------------------------------------------------------------------------------
+ function privWriteCentralHeader($p_nb_entries, $p_size, $p_offset, $p_comment)
+ {
+ $v_result=1;
+
+ // ----- Packed data
+ $v_binary_data = pack("VvvvvVVv", 0x06054b50, 0, 0, $p_nb_entries,
+ $p_nb_entries, $p_size,
+ $p_offset, strlen($p_comment));
+
+ // ----- Write the 22 bytes of the header in the zip file
+ fputs($this->zip_fd, $v_binary_data, 22);
+
+ // ----- Write the variable fields
+ if (strlen($p_comment) != 0)
+ {
+ fputs($this->zip_fd, $p_comment, strlen($p_comment));
+ }
+
+ // ----- Return
+ return $v_result;
+ }
+ // --------------------------------------------------------------------------------
+
+ // --------------------------------------------------------------------------------
+ // Function : privList()
+ // Description :
+ // Parameters :
+ // Return Values :
+ // --------------------------------------------------------------------------------
+ function privList(&$p_list)
+ {
+ $v_result=1;
+
+ // ----- Magic quotes trick
+ $this->privDisableMagicQuotes();
+
+ // ----- Open the zip file
+ if (($this->zip_fd = @fopen($this->zipname, 'rb')) == 0)
+ {
+ // ----- Magic quotes trick
+ $this->privSwapBackMagicQuotes();
+
+ // ----- Error log
+ PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, 'Unable to open archive \''.$this->zipname.'\' in binary read mode');
+
+ // ----- Return
+ return PclZip::errorCode();
+ }
+
+ // ----- Read the central directory informations
+ $v_central_dir = array();
+ if (($v_result = $this->privReadEndCentralDir($v_central_dir)) != 1)
+ {
+ $this->privSwapBackMagicQuotes();
+ return $v_result;
+ }
+
+ // ----- Go to beginning of Central Dir
+ @rewind($this->zip_fd);
+ if (@fseek($this->zip_fd, $v_central_dir['offset']))
+ {
+ $this->privSwapBackMagicQuotes();
+
+ // ----- Error log
+ PclZip::privErrorLog(PCLZIP_ERR_INVALID_ARCHIVE_ZIP, 'Invalid archive size');
+
+ // ----- Return
+ return PclZip::errorCode();
+ }
+
+ // ----- Read each entry
+ for ($i=0; $i<$v_central_dir['entries']; $i++)
+ {
+ // ----- Read the file header
+ if (($v_result = $this->privReadCentralFileHeader($v_header)) != 1)
+ {
+ $this->privSwapBackMagicQuotes();
+ return $v_result;
+ }
+ $v_header['index'] = $i;
+
+ // ----- Get the only interesting attributes
+ $this->privConvertHeader2FileInfo($v_header, $p_list[$i]);
+ unset($v_header);
+ }
+
+ // ----- Close the zip file
+ $this->privCloseFd();
+
+ // ----- Magic quotes trick
+ $this->privSwapBackMagicQuotes();
+
+ // ----- Return
+ return $v_result;
+ }
+ // --------------------------------------------------------------------------------
+
+ // --------------------------------------------------------------------------------
+ // Function : privConvertHeader2FileInfo()
+ // Description :
+ // This function takes the file informations from the central directory
+ // entries and extract the interesting parameters that will be given back.
+ // The resulting file infos are set in the array $p_info
+ // $p_info['filename'] : Filename with full path. Given by user (add),
+ // extracted in the filesystem (extract).
+ // $p_info['stored_filename'] : Stored filename in the archive.
+ // $p_info['size'] = Size of the file.
+ // $p_info['compressed_size'] = Compressed size of the file.
+ // $p_info['mtime'] = Last modification date of the file.
+ // $p_info['comment'] = Comment associated with the file.
+ // $p_info['folder'] = true/false : indicates if the entry is a folder or not.
+ // $p_info['status'] = status of the action on the file.
+ // $p_info['crc'] = CRC of the file content.
+ // Parameters :
+ // Return Values :
+ // --------------------------------------------------------------------------------
+ function privConvertHeader2FileInfo($p_header, &$p_info)
+ {
+ $v_result=1;
+
+ // ----- Get the interesting attributes
+ $v_temp_path = PclZipUtilPathReduction($p_header['filename']);
+ $p_info['filename'] = $v_temp_path;
+ $v_temp_path = PclZipUtilPathReduction($p_header['stored_filename']);
+ $p_info['stored_filename'] = $v_temp_path;
+ $p_info['size'] = $p_header['size'];
+ $p_info['compressed_size'] = $p_header['compressed_size'];
+ $p_info['mtime'] = $p_header['mtime'];
+ $p_info['comment'] = $p_header['comment'];
+ $p_info['folder'] = (($p_header['external']&0x00000010)==0x00000010);
+ $p_info['index'] = $p_header['index'];
+ $p_info['status'] = $p_header['status'];
+ $p_info['crc'] = $p_header['crc'];
+
+ // ----- Return
+ return $v_result;
+ }
+ // --------------------------------------------------------------------------------
+
+ // --------------------------------------------------------------------------------
+ // Function : privExtractByRule()
+ // Description :
+ // Extract a file or directory depending of rules (by index, by name, ...)
+ // Parameters :
+ // $p_file_list : An array where will be placed the properties of each
+ // extracted file
+ // $p_path : Path to add while writing the extracted files
+ // $p_remove_path : Path to remove (from the file memorized path) while writing the
+ // extracted files. If the path does not match the file path,
+ // the file is extracted with its memorized path.
+ // $p_remove_path does not apply to 'list' mode.
+ // $p_path and $p_remove_path are commulative.
+ // Return Values :
+ // 1 on success,0 or less on error (see error code list)
+ // --------------------------------------------------------------------------------
+ function privExtractByRule(&$p_file_list, $p_path, $p_remove_path, $p_remove_all_path, &$p_options)
+ {
+ $v_result=1;
+
+ // ----- Magic quotes trick
+ $this->privDisableMagicQuotes();
+
+ // ----- Check the path
+ if ( ($p_path == "")
+ || ( (substr($p_path, 0, 1) != "/")
+ && (substr($p_path, 0, 3) != "../")
+ && (substr($p_path,1,2)!=":/")))
+ $p_path = "./".$p_path;
+
+ // ----- Reduce the path last (and duplicated) '/'
+ if (($p_path != "./") && ($p_path != "/"))
+ {
+ // ----- Look for the path end '/'
+ while (substr($p_path, -1) == "/")
+ {
+ $p_path = substr($p_path, 0, strlen($p_path)-1);
+ }
+ }
+
+ // ----- Look for path to remove format (should end by /)
+ if (($p_remove_path != "") && (substr($p_remove_path, -1) != '/'))
+ {
+ $p_remove_path .= '/';
+ }
+ $p_remove_path_size = strlen($p_remove_path);
+
+ // ----- Open the zip file
+ if (($v_result = $this->privOpenFd('rb')) != 1)
+ {
+ $this->privSwapBackMagicQuotes();
+ return $v_result;
+ }
+
+ // ----- Read the central directory informations
+ $v_central_dir = array();
+ if (($v_result = $this->privReadEndCentralDir($v_central_dir)) != 1)
+ {
+ // ----- Close the zip file
+ $this->privCloseFd();
+ $this->privSwapBackMagicQuotes();
+
+ return $v_result;
+ }
+
+ // ----- Start at beginning of Central Dir
+ $v_pos_entry = $v_central_dir['offset'];
+
+ // ----- Read each entry
+ $j_start = 0;
+ for ($i=0, $v_nb_extracted=0; $i<$v_central_dir['entries']; $i++)
+ {
+
+ // ----- Read next Central dir entry
+ @rewind($this->zip_fd);
+ if (@fseek($this->zip_fd, $v_pos_entry))
+ {
+ // ----- Close the zip file
+ $this->privCloseFd();
+ $this->privSwapBackMagicQuotes();
+
+ // ----- Error log
+ PclZip::privErrorLog(PCLZIP_ERR_INVALID_ARCHIVE_ZIP, 'Invalid archive size');
+
+ // ----- Return
+ return PclZip::errorCode();
+ }
+
+ // ----- Read the file header
+ $v_header = array();
+ if (($v_result = $this->privReadCentralFileHeader($v_header)) != 1)
+ {
+ // ----- Close the zip file
+ $this->privCloseFd();
+ $this->privSwapBackMagicQuotes();
+
+ return $v_result;
+ }
+
+ // ----- Store the index
+ $v_header['index'] = $i;
+
+ // ----- Store the file position
+ $v_pos_entry = ftell($this->zip_fd);
+
+ // ----- Look for the specific extract rules
+ $v_extract = false;
+
+ // ----- Look for extract by name rule
+ if ( (isset($p_options[PCLZIP_OPT_BY_NAME]))
+ && ($p_options[PCLZIP_OPT_BY_NAME] != 0)) {
+
+ // ----- Look if the filename is in the list
+ for ($j=0; ($j<sizeof($p_options[PCLZIP_OPT_BY_NAME])) && (!$v_extract); $j++) {
+
+ // ----- Look for a directory
+ if (substr($p_options[PCLZIP_OPT_BY_NAME][$j], -1) == "/") {
+
+ // ----- Look if the directory is in the filename path
+ if ( (strlen($v_header['stored_filename']) > strlen($p_options[PCLZIP_OPT_BY_NAME][$j]))
+ && (substr($v_header['stored_filename'], 0, strlen($p_options[PCLZIP_OPT_BY_NAME][$j])) == $p_options[PCLZIP_OPT_BY_NAME][$j])) {
+ $v_extract = true;
+ }
+ }
+ // ----- Look for a filename
+ elseif ($v_header['stored_filename'] == $p_options[PCLZIP_OPT_BY_NAME][$j]) {
+ $v_extract = true;
+ }
+ }
+ }
+
+ // ----- Look for extract by ereg rule
+ // ereg() is deprecated with PHP 5.3
+ /*
+ else if ( (isset($p_options[PCLZIP_OPT_BY_EREG]))
+ && ($p_options[PCLZIP_OPT_BY_EREG] != "")) {
+
+ if (ereg($p_options[PCLZIP_OPT_BY_EREG], $v_header['stored_filename'])) {
+ $v_extract = true;
+ }
+ }
+ */
+
+ // ----- Look for extract by preg rule
+ else if ( (isset($p_options[PCLZIP_OPT_BY_PREG]))
+ && ($p_options[PCLZIP_OPT_BY_PREG] != "")) {
+
+ if (preg_match($p_options[PCLZIP_OPT_BY_PREG], $v_header['stored_filename'])) {
+ $v_extract = true;
+ }
+ }
+
+ // ----- Look for extract by index rule
+ else if ( (isset($p_options[PCLZIP_OPT_BY_INDEX]))
+ && ($p_options[PCLZIP_OPT_BY_INDEX] != 0)) {
+
+ // ----- Look if the index is in the list
+ for ($j=$j_start; ($j<sizeof($p_options[PCLZIP_OPT_BY_INDEX])) && (!$v_extract); $j++) {
+
+ if (($i>=$p_options[PCLZIP_OPT_BY_INDEX][$j]['start']) && ($i<=$p_options[PCLZIP_OPT_BY_INDEX][$j]['end'])) {
+ $v_extract = true;
+ }
+ if ($i>=$p_options[PCLZIP_OPT_BY_INDEX][$j]['end']) {
+ $j_start = $j+1;
+ }
+
+ if ($p_options[PCLZIP_OPT_BY_INDEX][$j]['start']>$i) {
+ break;
+ }
+ }
+ }
+
+ // ----- Look for no rule, which means extract all the archive
+ else {
+ $v_extract = true;
+ }
+
+ // ----- Check compression method
+ if ( ($v_extract)
+ && ( ($v_header['compression'] != 8)
+ && ($v_header['compression'] != 0))) {
+ $v_header['status'] = 'unsupported_compression';
+
+ // ----- Look for PCLZIP_OPT_STOP_ON_ERROR
+ if ( (isset($p_options[PCLZIP_OPT_STOP_ON_ERROR]))
+ && ($p_options[PCLZIP_OPT_STOP_ON_ERROR]===true)) {
+
+ $this->privSwapBackMagicQuotes();
+
+ PclZip::privErrorLog(PCLZIP_ERR_UNSUPPORTED_COMPRESSION,
+ "Filename '".$v_header['stored_filename']."' is "
+ ."compressed by an unsupported compression "
+ ."method (".$v_header['compression'].") ");
+
+ return PclZip::errorCode();
+ }
+ }
+
+ // ----- Check encrypted files
+ if (($v_extract) && (($v_header['flag'] & 1) == 1)) {
+ $v_header['status'] = 'unsupported_encryption';
+
+ // ----- Look for PCLZIP_OPT_STOP_ON_ERROR
+ if ( (isset($p_options[PCLZIP_OPT_STOP_ON_ERROR]))
+ && ($p_options[PCLZIP_OPT_STOP_ON_ERROR]===true)) {
+
+ $this->privSwapBackMagicQuotes();
+
+ PclZip::privErrorLog(PCLZIP_ERR_UNSUPPORTED_ENCRYPTION,
+ "Unsupported encryption for "
+ ." filename '".$v_header['stored_filename']
+ ."'");
+
+ return PclZip::errorCode();
+ }
+ }
+
+ // ----- Look for real extraction
+ if (($v_extract) && ($v_header['status'] != 'ok')) {
+ $v_result = $this->privConvertHeader2FileInfo($v_header,
+ $p_file_list[$v_nb_extracted++]);
+ if ($v_result != 1) {
+ $this->privCloseFd();
+ $this->privSwapBackMagicQuotes();
+ return $v_result;
+ }
+
+ $v_extract = false;
+ }
+
+ // ----- Look for real extraction
+ if ($v_extract)
+ {
+
+ // ----- Go to the file position
+ @rewind($this->zip_fd);
+ if (@fseek($this->zip_fd, $v_header['offset']))
+ {
+ // ----- Close the zip file
+ $this->privCloseFd();
+
+ $this->privSwapBackMagicQuotes();
+
+ // ----- Error log
+ PclZip::privErrorLog(PCLZIP_ERR_INVALID_ARCHIVE_ZIP, 'Invalid archive size');
+
+ // ----- Return
+ return PclZip::errorCode();
+ }
+
+ // ----- Look for extraction as string
+ if ($p_options[PCLZIP_OPT_EXTRACT_AS_STRING]) {
+
+ $v_string = '';
+
+ // ----- Extracting the file
+ $v_result1 = $this->privExtractFileAsString($v_header, $v_string, $p_options);
+ if ($v_result1 < 1) {
+ $this->privCloseFd();
+ $this->privSwapBackMagicQuotes();
+ return $v_result1;
+ }
+
+ // ----- Get the only interesting attributes
+ if (($v_result = $this->privConvertHeader2FileInfo($v_header, $p_file_list[$v_nb_extracted])) != 1)
+ {
+ // ----- Close the zip file
+ $this->privCloseFd();
+ $this->privSwapBackMagicQuotes();
+
+ return $v_result;
+ }
+
+ // ----- Set the file content
+ $p_file_list[$v_nb_extracted]['content'] = $v_string;
+
+ // ----- Next extracted file
+ $v_nb_extracted++;
+
+ // ----- Look for user callback abort
+ if ($v_result1 == 2) {
+ break;
+ }
+ }
+ // ----- Look for extraction in standard output
+ elseif ( (isset($p_options[PCLZIP_OPT_EXTRACT_IN_OUTPUT]))
+ && ($p_options[PCLZIP_OPT_EXTRACT_IN_OUTPUT])) {
+ // ----- Extracting the file in standard output
+ $v_result1 = $this->privExtractFileInOutput($v_header, $p_options);
+ if ($v_result1 < 1) {
+ $this->privCloseFd();
+ $this->privSwapBackMagicQuotes();
+ return $v_result1;
+ }
+
+ // ----- Get the only interesting attributes
+ if (($v_result = $this->privConvertHeader2FileInfo($v_header, $p_file_list[$v_nb_extracted++])) != 1) {
+ $this->privCloseFd();
+ $this->privSwapBackMagicQuotes();
+ return $v_result;
+ }
+
+ // ----- Look for user callback abort
+ if ($v_result1 == 2) {
+ break;
+ }
+ }
+ // ----- Look for normal extraction
+ else {
+ // ----- Extracting the file
+ $v_result1 = $this->privExtractFile($v_header,
+ $p_path, $p_remove_path,
+ $p_remove_all_path,
+ $p_options);
+ if ($v_result1 < 1) {
+ $this->privCloseFd();
+ $this->privSwapBackMagicQuotes();
+ return $v_result1;
+ }
+
+ // ----- Get the only interesting attributes
+ if (($v_result = $this->privConvertHeader2FileInfo($v_header, $p_file_list[$v_nb_extracted++])) != 1)
+ {
+ // ----- Close the zip file
+ $this->privCloseFd();
+ $this->privSwapBackMagicQuotes();
+
+ return $v_result;
+ }
+
+ // ----- Look for user callback abort
+ if ($v_result1 == 2) {
+ break;
+ }
+ }
+ }
+ }
+
+ // ----- Close the zip file
+ $this->privCloseFd();
+ $this->privSwapBackMagicQuotes();
+
+ // ----- Return
+ return $v_result;
+ }
+ // --------------------------------------------------------------------------------
+
+ // --------------------------------------------------------------------------------
+ // Function : privExtractFile()
+ // Description :
+ // Parameters :
+ // Return Values :
+ //
+ // 1 : ... ?
+ // PCLZIP_ERR_USER_ABORTED(2) : User ask for extraction stop in callback
+ // --------------------------------------------------------------------------------
+ function privExtractFile(&$p_entry, $p_path, $p_remove_path, $p_remove_all_path, &$p_options)
+ {
+ $v_result=1;
+
+ // ----- Read the file header
+ if (($v_result = $this->privReadFileHeader($v_header)) != 1)
+ {
+ // ----- Return
+ return $v_result;
+ }
+
+
+ // ----- Check that the file header is coherent with $p_entry info
+ if ($this->privCheckFileHeaders($v_header, $p_entry) != 1) {
+ // TBC
+ }
+
+ // ----- Look for all path to remove
+ if ($p_remove_all_path == true) {
+ // ----- Look for folder entry that not need to be extracted
+ if (($p_entry['external']&0x00000010)==0x00000010) {
+
+ $p_entry['status'] = "filtered";
+
+ return $v_result;
+ }
+
+ // ----- Get the basename of the path
+ $p_entry['filename'] = basename($p_entry['filename']);
+ }
+
+ // ----- Look for path to remove
+ else if ($p_remove_path != "")
+ {
+ if (PclZipUtilPathInclusion($p_remove_path, $p_entry['filename']) == 2)
+ {
+
+ // ----- Change the file status
+ $p_entry['status'] = "filtered";
+
+ // ----- Return
+ return $v_result;
+ }
+
+ $p_remove_path_size = strlen($p_remove_path);
+ if (substr($p_entry['filename'], 0, $p_remove_path_size) == $p_remove_path)
+ {
+
+ // ----- Remove the path
+ $p_entry['filename'] = substr($p_entry['filename'], $p_remove_path_size);
+
+ }
+ }
+
+ // ----- Add the path
+ if ($p_path != '') {
+ $p_entry['filename'] = $p_path."/".$p_entry['filename'];
+ }
+
+ // ----- Check a base_dir_restriction
+ if (isset($p_options[PCLZIP_OPT_EXTRACT_DIR_RESTRICTION])) {
+ $v_inclusion
+ = PclZipUtilPathInclusion($p_options[PCLZIP_OPT_EXTRACT_DIR_RESTRICTION],
+ $p_entry['filename']);
+ if ($v_inclusion == 0) {
+
+ PclZip::privErrorLog(PCLZIP_ERR_DIRECTORY_RESTRICTION,
+ "Filename '".$p_entry['filename']."' is "
+ ."outside PCLZIP_OPT_EXTRACT_DIR_RESTRICTION");
+
+ return PclZip::errorCode();
+ }
+ }
+
+ // ----- Look for pre-extract callback
+ if (isset($p_options[PCLZIP_CB_PRE_EXTRACT])) {
+
+ // ----- Generate a local information
+ $v_local_header = array();
+ $this->privConvertHeader2FileInfo($p_entry, $v_local_header);
+
+ // ----- Call the callback
+ // Here I do not use call_user_func() because I need to send a reference to the
+ // header.
+ $v_result = $p_options[PCLZIP_CB_PRE_EXTRACT](PCLZIP_CB_PRE_EXTRACT, $v_local_header);
+ if ($v_result == 0) {
+ // ----- Change the file status
+ $p_entry['status'] = "skipped";
+ $v_result = 1;
+ }
+
+ // ----- Look for abort result
+ if ($v_result == 2) {
+ // ----- This status is internal and will be changed in 'skipped'
+ $p_entry['status'] = "aborted";
+ $v_result = PCLZIP_ERR_USER_ABORTED;
+ }
+
+ // ----- Update the informations
+ // Only some fields can be modified
+ $p_entry['filename'] = $v_local_header['filename'];
+ }
+
+
+ // ----- Look if extraction should be done
+ if ($p_entry['status'] == 'ok') {
+
+ // ----- Look for specific actions while the file exist
+ if (file_exists($p_entry['filename']))
+ {
+
+ // ----- Look if file is a directory
+ if (is_dir($p_entry['filename']))
+ {
+
+ // ----- Change the file status
+ $p_entry['status'] = "already_a_directory";
+
+ // ----- Look for PCLZIP_OPT_STOP_ON_ERROR
+ // For historical reason first PclZip implementation does not stop
+ // when this kind of error occurs.
+ if ( (isset($p_options[PCLZIP_OPT_STOP_ON_ERROR]))
+ && ($p_options[PCLZIP_OPT_STOP_ON_ERROR]===true)) {
+
+ PclZip::privErrorLog(PCLZIP_ERR_ALREADY_A_DIRECTORY,
+ "Filename '".$p_entry['filename']."' is "
+ ."already used by an existing directory");
+
+ return PclZip::errorCode();
+ }
+ }
+ // ----- Look if file is write protected
+ else if (!is_writeable($p_entry['filename']))
+ {
+
+ // ----- Change the file status
+ $p_entry['status'] = "write_protected";
+
+ // ----- Look for PCLZIP_OPT_STOP_ON_ERROR
+ // For historical reason first PclZip implementation does not stop
+ // when this kind of error occurs.
+ if ( (isset($p_options[PCLZIP_OPT_STOP_ON_ERROR]))
+ && ($p_options[PCLZIP_OPT_STOP_ON_ERROR]===true)) {
+
+ PclZip::privErrorLog(PCLZIP_ERR_WRITE_OPEN_FAIL,
+ "Filename '".$p_entry['filename']."' exists "
+ ."and is write protected");
+
+ return PclZip::errorCode();
+ }
+ }
+
+ // ----- Look if the extracted file is older
+ else if (filemtime($p_entry['filename']) > $p_entry['mtime'])
+ {
+ // ----- Change the file status
+ if ( (isset($p_options[PCLZIP_OPT_REPLACE_NEWER]))
+ && ($p_options[PCLZIP_OPT_REPLACE_NEWER]===true)) {
+ }
+ else {
+ $p_entry['status'] = "newer_exist";
+
+ // ----- Look for PCLZIP_OPT_STOP_ON_ERROR
+ // For historical reason first PclZip implementation does not stop
+ // when this kind of error occurs.
+ if ( (isset($p_options[PCLZIP_OPT_STOP_ON_ERROR]))
+ && ($p_options[PCLZIP_OPT_STOP_ON_ERROR]===true)) {
+
+ PclZip::privErrorLog(PCLZIP_ERR_WRITE_OPEN_FAIL,
+ "Newer version of '".$p_entry['filename']."' exists "
+ ."and option PCLZIP_OPT_REPLACE_NEWER is not selected");
+
+ return PclZip::errorCode();
+ }
+ }
+ }
+ else {
+ }
+ }
+
+ // ----- Check the directory availability and create it if necessary
+ else {
+ if ((($p_entry['external']&0x00000010)==0x00000010) || (substr($p_entry['filename'], -1) == '/'))
+ $v_dir_to_check = $p_entry['filename'];
+ else if (!strstr($p_entry['filename'], "/"))
+ $v_dir_to_check = "";
+ else
+ $v_dir_to_check = dirname($p_entry['filename']);
+
+ if (($v_result = $this->privDirCheck($v_dir_to_check, (($p_entry['external']&0x00000010)==0x00000010))) != 1) {
+
+ // ----- Change the file status
+ $p_entry['status'] = "path_creation_fail";
+
+ // ----- Return
+ //return $v_result;
+ $v_result = 1;
+ }
+ }
+ }
+
+ // ----- Look if extraction should be done
+ if ($p_entry['status'] == 'ok') {
+
+ // ----- Do the extraction (if not a folder)
+ if (!(($p_entry['external']&0x00000010)==0x00000010))
+ {
+ // ----- Look for not compressed file
+ if ($p_entry['compression'] == 0) {
+
+ // ----- Opening destination file
+ if (($v_dest_file = @fopen($p_entry['filename'], 'wb')) == 0)
+ {
+
+ // ----- Change the file status
+ $p_entry['status'] = "write_error";
+
+ // ----- Return
+ return $v_result;
+ }
+
+
+ // ----- Read the file by PCLZIP_READ_BLOCK_SIZE octets blocks
+ $v_size = $p_entry['compressed_size'];
+ while ($v_size != 0)
+ {
+ $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE);
+ $v_buffer = @fread($this->zip_fd, $v_read_size);
+ /* Try to speed up the code
+ $v_binary_data = pack('a'.$v_read_size, $v_buffer);
+ @fwrite($v_dest_file, $v_binary_data, $v_read_size);
+ */
+ @fwrite($v_dest_file, $v_buffer, $v_read_size);
+ $v_size -= $v_read_size;
+ }
+
+ // ----- Closing the destination file
+ fclose($v_dest_file);
+
+ // ----- Change the file mtime
+ touch($p_entry['filename'], $p_entry['mtime']);
+
+
+ }
+ else {
+ // ----- TBC
+ // Need to be finished
+ if (($p_entry['flag'] & 1) == 1) {
+ PclZip::privErrorLog(PCLZIP_ERR_UNSUPPORTED_ENCRYPTION, 'File \''.$p_entry['filename'].'\' is encrypted. Encrypted files are not supported.');
+ return PclZip::errorCode();
+ }
+
+
+ // ----- Look for using temporary file to unzip
+ if ( (!isset($p_options[PCLZIP_OPT_TEMP_FILE_OFF]))
+ && (isset($p_options[PCLZIP_OPT_TEMP_FILE_ON])
+ || (isset($p_options[PCLZIP_OPT_TEMP_FILE_THRESHOLD])
+ && ($p_options[PCLZIP_OPT_TEMP_FILE_THRESHOLD] <= $p_entry['size'])) ) ) {
+ $v_result = $this->privExtractFileUsingTempFile($p_entry, $p_options);
+ if ($v_result < PCLZIP_ERR_NO_ERROR) {
+ return $v_result;
+ }
+ }
+
+ // ----- Look for extract in memory
+ else {
+
+
+ // ----- Read the compressed file in a buffer (one shot)
+ $v_buffer = @fread($this->zip_fd, $p_entry['compressed_size']);
+
+ // ----- Decompress the file
+ $v_file_content = @gzinflate($v_buffer);
+ unset($v_buffer);
+ if ($v_file_content === FALSE) {
+
+ // ----- Change the file status
+ // TBC
+ $p_entry['status'] = "error";
+
+ return $v_result;
+ }
+
+ // ----- Opening destination file
+ if (($v_dest_file = @fopen($p_entry['filename'], 'wb')) == 0) {
+
+ // ----- Change the file status
+ $p_entry['status'] = "write_error";
+
+ return $v_result;
+ }
+
+ // ----- Write the uncompressed data
+ @fwrite($v_dest_file, $v_file_content, $p_entry['size']);
+ unset($v_file_content);
+
+ // ----- Closing the destination file
+ @fclose($v_dest_file);
+
+ }
+
+ // ----- Change the file mtime
+ @touch($p_entry['filename'], $p_entry['mtime']);
+ }
+
+ // ----- Look for chmod option
+ if (isset($p_options[PCLZIP_OPT_SET_CHMOD])) {
+
+ // ----- Change the mode of the file
+ @chmod($p_entry['filename'], $p_options[PCLZIP_OPT_SET_CHMOD]);
+ }
+
+ }
+ }
+
+ // ----- Change abort status
+ if ($p_entry['status'] == "aborted") {
+ $p_entry['status'] = "skipped";
+ }
+
+ // ----- Look for post-extract callback
+ elseif (isset($p_options[PCLZIP_CB_POST_EXTRACT])) {
+
+ // ----- Generate a local information
+ $v_local_header = array();
+ $this->privConvertHeader2FileInfo($p_entry, $v_local_header);
+
+ // ----- Call the callback
+ // Here I do not use call_user_func() because I need to send a reference to the
+ // header.
+ $v_result = $p_options[PCLZIP_CB_POST_EXTRACT](PCLZIP_CB_POST_EXTRACT, $v_local_header);
+
+ // ----- Look for abort result
+ if ($v_result == 2) {
+ $v_result = PCLZIP_ERR_USER_ABORTED;
+ }
+ }
+
+ // ----- Return
+ return $v_result;
+ }
+ // --------------------------------------------------------------------------------
+
+ // --------------------------------------------------------------------------------
+ // Function : privExtractFileUsingTempFile()
+ // Description :
+ // Parameters :
+ // Return Values :
+ // --------------------------------------------------------------------------------
+ function privExtractFileUsingTempFile(&$p_entry, &$p_options)
+ {
+ $v_result=1;
+
+ // ----- Creates a temporary file
+ $v_gzip_temp_name = PCLZIP_TEMPORARY_DIR.uniqid('pclzip-').'.gz';
+ if (($v_dest_file = @fopen($v_gzip_temp_name, "wb")) == 0) {
+ fclose($v_file);
+ PclZip::privErrorLog(PCLZIP_ERR_WRITE_OPEN_FAIL, 'Unable to open temporary file \''.$v_gzip_temp_name.'\' in binary write mode');
+ return PclZip::errorCode();
+ }
+
+
+ // ----- Write gz file format header
+ $v_binary_data = pack('va1a1Va1a1', 0x8b1f, Chr($p_entry['compression']), Chr(0x00), time(), Chr(0x00), Chr(3));
+ @fwrite($v_dest_file, $v_binary_data, 10);
+
+ // ----- Read the file by PCLZIP_READ_BLOCK_SIZE octets blocks
+ $v_size = $p_entry['compressed_size'];
+ while ($v_size != 0)
+ {
+ $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE);
+ $v_buffer = @fread($this->zip_fd, $v_read_size);
+ //$v_binary_data = pack('a'.$v_read_size, $v_buffer);
+ @fwrite($v_dest_file, $v_buffer, $v_read_size);
+ $v_size -= $v_read_size;
+ }
+
+ // ----- Write gz file format footer
+ $v_binary_data = pack('VV', $p_entry['crc'], $p_entry['size']);
+ @fwrite($v_dest_file, $v_binary_data, 8);
+
+ // ----- Close the temporary file
+ @fclose($v_dest_file);
+
+ // ----- Opening destination file
+ if (($v_dest_file = @fopen($p_entry['filename'], 'wb')) == 0) {
+ $p_entry['status'] = "write_error";
+ return $v_result;
+ }
+
+ // ----- Open the temporary gz file
+ if (($v_src_file = @gzopen($v_gzip_temp_name, 'rb')) == 0) {
+ @fclose($v_dest_file);
+ $p_entry['status'] = "read_error";
+ PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, 'Unable to open temporary file \''.$v_gzip_temp_name.'\' in binary read mode');
+ return PclZip::errorCode();
+ }
+
+
+ // ----- Read the file by PCLZIP_READ_BLOCK_SIZE octets blocks
+ $v_size = $p_entry['size'];
+ while ($v_size != 0) {
+ $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE);
+ $v_buffer = @gzread($v_src_file, $v_read_size);
+ //$v_binary_data = pack('a'.$v_read_size, $v_buffer);
+ @fwrite($v_dest_file, $v_buffer, $v_read_size);
+ $v_size -= $v_read_size;
+ }
+ @fclose($v_dest_file);
+ @gzclose($v_src_file);
+
+ // ----- Delete the temporary file
+ @unlink($v_gzip_temp_name);
+
+ // ----- Return
+ return $v_result;
+ }
+ // --------------------------------------------------------------------------------
+
+ // --------------------------------------------------------------------------------
+ // Function : privExtractFileInOutput()
+ // Description :
+ // Parameters :
+ // Return Values :
+ // --------------------------------------------------------------------------------
+ function privExtractFileInOutput(&$p_entry, &$p_options)
+ {
+ $v_result=1;
+
+ // ----- Read the file header
+ if (($v_result = $this->privReadFileHeader($v_header)) != 1) {
+ return $v_result;
+ }
+
+
+ // ----- Check that the file header is coherent with $p_entry info
+ if ($this->privCheckFileHeaders($v_header, $p_entry) != 1) {
+ // TBC
+ }
+
+ // ----- Look for pre-extract callback
+ if (isset($p_options[PCLZIP_CB_PRE_EXTRACT])) {
+
+ // ----- Generate a local information
+ $v_local_header = array();
+ $this->privConvertHeader2FileInfo($p_entry, $v_local_header);
+
+ // ----- Call the callback
+ // Here I do not use call_user_func() because I need to send a reference to the
+ // header.
+// eval('$v_result = '.$p_options[PCLZIP_CB_PRE_EXTRACT].'(PCLZIP_CB_PRE_EXTRACT, $v_local_header);');
+ $v_result = $p_options[PCLZIP_CB_PRE_EXTRACT](PCLZIP_CB_PRE_EXTRACT, $v_local_header);
+ if ($v_result == 0) {
+ // ----- Change the file status
+ $p_entry['status'] = "skipped";
+ $v_result = 1;
+ }
+
+ // ----- Look for abort result
+ if ($v_result == 2) {
+ // ----- This status is internal and will be changed in 'skipped'
+ $p_entry['status'] = "aborted";
+ $v_result = PCLZIP_ERR_USER_ABORTED;
+ }
+
+ // ----- Update the informations
+ // Only some fields can be modified
+ $p_entry['filename'] = $v_local_header['filename'];
+ }
+
+ // ----- Trace
+
+ // ----- Look if extraction should be done
+ if ($p_entry['status'] == 'ok') {
+
+ // ----- Do the extraction (if not a folder)
+ if (!(($p_entry['external']&0x00000010)==0x00000010)) {
+ // ----- Look for not compressed file
+ if ($p_entry['compressed_size'] == $p_entry['size']) {
+
+ // ----- Read the file in a buffer (one shot)
+ $v_buffer = @fread($this->zip_fd, $p_entry['compressed_size']);
+
+ // ----- Send the file to the output
+ echo $v_buffer;
+ unset($v_buffer);
+ }
+ else {
+
+ // ----- Read the compressed file in a buffer (one shot)
+ $v_buffer = @fread($this->zip_fd, $p_entry['compressed_size']);
+
+ // ----- Decompress the file
+ $v_file_content = gzinflate($v_buffer);
+ unset($v_buffer);
+
+ // ----- Send the file to the output
+ echo $v_file_content;
+ unset($v_file_content);
+ }
+ }
+ }
+
+ // ----- Change abort status
+ if ($p_entry['status'] == "aborted") {
+ $p_entry['status'] = "skipped";
+ }
+
+ // ----- Look for post-extract callback
+ elseif (isset($p_options[PCLZIP_CB_POST_EXTRACT])) {
+
+ // ----- Generate a local information
+ $v_local_header = array();
+ $this->privConvertHeader2FileInfo($p_entry, $v_local_header);
+
+ // ----- Call the callback
+ // Here I do not use call_user_func() because I need to send a reference to the
+ // header.
+ $v_result = $p_options[PCLZIP_CB_POST_EXTRACT](PCLZIP_CB_POST_EXTRACT, $v_local_header);
+
+ // ----- Look for abort result
+ if ($v_result == 2) {
+ $v_result = PCLZIP_ERR_USER_ABORTED;
+ }
+ }
+
+ return $v_result;
+ }
+ // --------------------------------------------------------------------------------
+
+ // --------------------------------------------------------------------------------
+ // Function : privExtractFileAsString()
+ // Description :
+ // Parameters :
+ // Return Values :
+ // --------------------------------------------------------------------------------
+ function privExtractFileAsString(&$p_entry, &$p_string, &$p_options)
+ {
+ $v_result=1;
+
+ // ----- Read the file header
+ $v_header = array();
+ if (($v_result = $this->privReadFileHeader($v_header)) != 1)
+ {
+ // ----- Return
+ return $v_result;
+ }
+
+
+ // ----- Check that the file header is coherent with $p_entry info
+ if ($this->privCheckFileHeaders($v_header, $p_entry) != 1) {
+ // TBC
+ }
+
+ // ----- Look for pre-extract callback
+ if (isset($p_options[PCLZIP_CB_PRE_EXTRACT])) {
+
+ // ----- Generate a local information
+ $v_local_header = array();
+ $this->privConvertHeader2FileInfo($p_entry, $v_local_header);
+
+ // ----- Call the callback
+ // Here I do not use call_user_func() because I need to send a reference to the
+ // header.
+ $v_result = $p_options[PCLZIP_CB_PRE_EXTRACT](PCLZIP_CB_PRE_EXTRACT, $v_local_header);
+ if ($v_result == 0) {
+ // ----- Change the file status
+ $p_entry['status'] = "skipped";
+ $v_result = 1;
+ }
+
+ // ----- Look for abort result
+ if ($v_result == 2) {
+ // ----- This status is internal and will be changed in 'skipped'
+ $p_entry['status'] = "aborted";
+ $v_result = PCLZIP_ERR_USER_ABORTED;
+ }
+
+ // ----- Update the informations
+ // Only some fields can be modified
+ $p_entry['filename'] = $v_local_header['filename'];
+ }
+
+
+ // ----- Look if extraction should be done
+ if ($p_entry['status'] == 'ok') {
+
+ // ----- Do the extraction (if not a folder)
+ if (!(($p_entry['external']&0x00000010)==0x00000010)) {
+ // ----- Look for not compressed file
+ // if ($p_entry['compressed_size'] == $p_entry['size'])
+ if ($p_entry['compression'] == 0) {
+
+ // ----- Reading the file
+ $p_string = @fread($this->zip_fd, $p_entry['compressed_size']);
+ }
+ else {
+
+ // ----- Reading the file
+ $v_data = @fread($this->zip_fd, $p_entry['compressed_size']);
+
+ // ----- Decompress the file
+ if (($p_string = @gzinflate($v_data)) === FALSE) {
+ // TBC
+ }
+ }
+
+ // ----- Trace
+ }
+ else {
+ // TBC : error : can not extract a folder in a string
+ }
+
+ }
+
+ // ----- Change abort status
+ if ($p_entry['status'] == "aborted") {
+ $p_entry['status'] = "skipped";
+ }
+
+ // ----- Look for post-extract callback
+ elseif (isset($p_options[PCLZIP_CB_POST_EXTRACT])) {
+
+ // ----- Generate a local information
+ $v_local_header = array();
+ $this->privConvertHeader2FileInfo($p_entry, $v_local_header);
+
+ // ----- Swap the content to header
+ $v_local_header['content'] = $p_string;
+ $p_string = '';
+
+ // ----- Call the callback
+ // Here I do not use call_user_func() because I need to send a reference to the
+ // header.
+ $v_result = $p_options[PCLZIP_CB_POST_EXTRACT](PCLZIP_CB_POST_EXTRACT, $v_local_header);
+
+ // ----- Swap back the content to header
+ $p_string = $v_local_header['content'];
+ unset($v_local_header['content']);
+
+ // ----- Look for abort result
+ if ($v_result == 2) {
+ $v_result = PCLZIP_ERR_USER_ABORTED;
+ }
+ }
+
+ // ----- Return
+ return $v_result;
+ }
+ // --------------------------------------------------------------------------------
+
+ // --------------------------------------------------------------------------------
+ // Function : privReadFileHeader()
+ // Description :
+ // Parameters :
+ // Return Values :
+ // --------------------------------------------------------------------------------
+ function privReadFileHeader(&$p_header)
+ {
+ $v_result=1;
+
+ // ----- Read the 4 bytes signature
+ $v_binary_data = @fread($this->zip_fd, 4);
+ $v_data = unpack('Vid', $v_binary_data);
+
+ // ----- Check signature
+ if ($v_data['id'] != 0x04034b50)
+ {
+
+ // ----- Error log
+ PclZip::privErrorLog(PCLZIP_ERR_BAD_FORMAT, 'Invalid archive structure');
+
+ // ----- Return
+ return PclZip::errorCode();
+ }
+
+ // ----- Read the first 42 bytes of the header
+ $v_binary_data = fread($this->zip_fd, 26);
+
+ // ----- Look for invalid block size
+ if (strlen($v_binary_data) != 26)
+ {
+ $p_header['filename'] = "";
+ $p_header['status'] = "invalid_header";
+
+ // ----- Error log
+ PclZip::privErrorLog(PCLZIP_ERR_BAD_FORMAT, "Invalid block size : ".strlen($v_binary_data));
+
+ // ----- Return
+ return PclZip::errorCode();
+ }
+
+ // ----- Extract the values
+ $v_data = unpack('vversion/vflag/vcompression/vmtime/vmdate/Vcrc/Vcompressed_size/Vsize/vfilename_len/vextra_len', $v_binary_data);
+
+ // ----- Get filename
+ $p_header['filename'] = fread($this->zip_fd, $v_data['filename_len']);
+
+ // ----- Get extra_fields
+ if ($v_data['extra_len'] != 0) {
+ $p_header['extra'] = fread($this->zip_fd, $v_data['extra_len']);
+ }
+ else {
+ $p_header['extra'] = '';
+ }
+
+ // ----- Extract properties
+ $p_header['version_extracted'] = $v_data['version'];
+ $p_header['compression'] = $v_data['compression'];
+ $p_header['size'] = $v_data['size'];
+ $p_header['compressed_size'] = $v_data['compressed_size'];
+ $p_header['crc'] = $v_data['crc'];
+ $p_header['flag'] = $v_data['flag'];
+ $p_header['filename_len'] = $v_data['filename_len'];
+
+ // ----- Recuperate date in UNIX format
+ $p_header['mdate'] = $v_data['mdate'];
+ $p_header['mtime'] = $v_data['mtime'];
+ if ($p_header['mdate'] && $p_header['mtime'])
+ {
+ // ----- Extract time
+ $v_hour = ($p_header['mtime'] & 0xF800) >> 11;
+ $v_minute = ($p_header['mtime'] & 0x07E0) >> 5;
+ $v_seconde = ($p_header['mtime'] & 0x001F)*2;
+
+ // ----- Extract date
+ $v_year = (($p_header['mdate'] & 0xFE00) >> 9) + 1980;
+ $v_month = ($p_header['mdate'] & 0x01E0) >> 5;
+ $v_day = $p_header['mdate'] & 0x001F;
+
+ // ----- Get UNIX date format
+ $p_header['mtime'] = @mktime($v_hour, $v_minute, $v_seconde, $v_month, $v_day, $v_year);
+
+ }
+ else
+ {
+ $p_header['mtime'] = time();
+ }
+
+ // TBC
+ //for(reset($v_data); $key = key($v_data); next($v_data)) {
+ //}
+
+ // ----- Set the stored filename
+ $p_header['stored_filename'] = $p_header['filename'];
+
+ // ----- Set the status field
+ $p_header['status'] = "ok";
+
+ // ----- Return
+ return $v_result;
+ }
+ // --------------------------------------------------------------------------------
+
+ // --------------------------------------------------------------------------------
+ // Function : privReadCentralFileHeader()
+ // Description :
+ // Parameters :
+ // Return Values :
+ // --------------------------------------------------------------------------------
+ function privReadCentralFileHeader(&$p_header)
+ {
+ $v_result=1;
+
+ // ----- Read the 4 bytes signature
+ $v_binary_data = @fread($this->zip_fd, 4);
+ $v_data = unpack('Vid', $v_binary_data);
+
+ // ----- Check signature
+ if ($v_data['id'] != 0x02014b50)
+ {
+
+ // ----- Error log
+ PclZip::privErrorLog(PCLZIP_ERR_BAD_FORMAT, 'Invalid archive structure');
+
+ // ----- Return
+ return PclZip::errorCode();
+ }
+
+ // ----- Read the first 42 bytes of the header
+ $v_binary_data = fread($this->zip_fd, 42);
+
+ // ----- Look for invalid block size
+ if (strlen($v_binary_data) != 42)
+ {
+ $p_header['filename'] = "";
+ $p_header['status'] = "invalid_header";
+
+ // ----- Error log
+ PclZip::privErrorLog(PCLZIP_ERR_BAD_FORMAT, "Invalid block size : ".strlen($v_binary_data));
+
+ // ----- Return
+ return PclZip::errorCode();
+ }
+
+ // ----- Extract the values
+ $p_header = unpack('vversion/vversion_extracted/vflag/vcompression/vmtime/vmdate/Vcrc/Vcompressed_size/Vsize/vfilename_len/vextra_len/vcomment_len/vdisk/vinternal/Vexternal/Voffset', $v_binary_data);
+
+ // ----- Get filename
+ if ($p_header['filename_len'] != 0)
+ $p_header['filename'] = fread($this->zip_fd, $p_header['filename_len']);
+ else
+ $p_header['filename'] = '';
+
+ // ----- Get extra
+ if ($p_header['extra_len'] != 0)
+ $p_header['extra'] = fread($this->zip_fd, $p_header['extra_len']);
+ else
+ $p_header['extra'] = '';
+
+ // ----- Get comment
+ if ($p_header['comment_len'] != 0)
+ $p_header['comment'] = fread($this->zip_fd, $p_header['comment_len']);
+ else
+ $p_header['comment'] = '';
+
+ // ----- Extract properties
+
+ // ----- Recuperate date in UNIX format
+ //if ($p_header['mdate'] && $p_header['mtime'])
+ // TBC : bug : this was ignoring time with 0/0/0
+ if (1)
+ {
+ // ----- Extract time
+ $v_hour = ($p_header['mtime'] & 0xF800) >> 11;
+ $v_minute = ($p_header['mtime'] & 0x07E0) >> 5;
+ $v_seconde = ($p_header['mtime'] & 0x001F)*2;
+
+ // ----- Extract date
+ $v_year = (($p_header['mdate'] & 0xFE00) >> 9) + 1980;
+ $v_month = ($p_header['mdate'] & 0x01E0) >> 5;
+ $v_day = $p_header['mdate'] & 0x001F;
+
+ // ----- Get UNIX date format
+ $p_header['mtime'] = @mktime($v_hour, $v_minute, $v_seconde, $v_month, $v_day, $v_year);
+
+ }
+ else
+ {
+ $p_header['mtime'] = time();
+ }
+
+ // ----- Set the stored filename
+ $p_header['stored_filename'] = $p_header['filename'];
+
+ // ----- Set default status to ok
+ $p_header['status'] = 'ok';
+
+ // ----- Look if it is a directory
+ if (substr($p_header['filename'], -1) == '/') {
+ //$p_header['external'] = 0x41FF0010;
+ $p_header['external'] = 0x00000010;
+ }
+
+
+ // ----- Return
+ return $v_result;
+ }
+ // --------------------------------------------------------------------------------
+
+ // --------------------------------------------------------------------------------
+ // Function : privCheckFileHeaders()
+ // Description :
+ // Parameters :
+ // Return Values :
+ // 1 on success,
+ // 0 on error;
+ // --------------------------------------------------------------------------------
+ function privCheckFileHeaders(&$p_local_header, &$p_central_header)
+ {
+ $v_result=1;
+
+ // ----- Check the static values
+ // TBC
+ if ($p_local_header['filename'] != $p_central_header['filename']) {
+ }
+ if ($p_local_header['version_extracted'] != $p_central_header['version_extracted']) {
+ }
+ if ($p_local_header['flag'] != $p_central_header['flag']) {
+ }
+ if ($p_local_header['compression'] != $p_central_header['compression']) {
+ }
+ if ($p_local_header['mtime'] != $p_central_header['mtime']) {
+ }
+ if ($p_local_header['filename_len'] != $p_central_header['filename_len']) {
+ }
+
+ // ----- Look for flag bit 3
+ if (($p_local_header['flag'] & 8) == 8) {
+ $p_local_header['size'] = $p_central_header['size'];
+ $p_local_header['compressed_size'] = $p_central_header['compressed_size'];
+ $p_local_header['crc'] = $p_central_header['crc'];
+ }
+
+ // ----- Return
+ return $v_result;
+ }
+ // --------------------------------------------------------------------------------
+
+ // --------------------------------------------------------------------------------
+ // Function : privReadEndCentralDir()
+ // Description :
+ // Parameters :
+ // Return Values :
+ // --------------------------------------------------------------------------------
+ function privReadEndCentralDir(&$p_central_dir)
+ {
+ $v_result=1;
+
+ // ----- Go to the end of the zip file
+ $v_size = filesize($this->zipname);
+ @fseek($this->zip_fd, $v_size);
+ if (@ftell($this->zip_fd) != $v_size)
+ {
+ // ----- Error log
+ PclZip::privErrorLog(PCLZIP_ERR_BAD_FORMAT, 'Unable to go to the end of the archive \''.$this->zipname.'\'');
+
+ // ----- Return
+ return PclZip::errorCode();
+ }
+
+ // ----- First try : look if this is an archive with no commentaries (most of the time)
+ // in this case the end of central dir is at 22 bytes of the file end
+ $v_found = 0;
+ if ($v_size > 26) {
+ @fseek($this->zip_fd, $v_size-22);
+ if (($v_pos = @ftell($this->zip_fd)) != ($v_size-22))
+ {
+ // ----- Error log
+ PclZip::privErrorLog(PCLZIP_ERR_BAD_FORMAT, 'Unable to seek back to the middle of the archive \''.$this->zipname.'\'');
+
+ // ----- Return
+ return PclZip::errorCode();
+ }
+
+ // ----- Read for bytes
+ $v_binary_data = @fread($this->zip_fd, 4);
+ $v_data = @unpack('Vid', $v_binary_data);
+
+ // ----- Check signature
+ if ($v_data['id'] == 0x06054b50) {
+ $v_found = 1;
+ }
+
+ $v_pos = ftell($this->zip_fd);
+ }
+
+ // ----- Go back to the maximum possible size of the Central Dir End Record
+ if (!$v_found) {
+ $v_maximum_size = 65557; // 0xFFFF + 22;
+ if ($v_maximum_size > $v_size)
+ $v_maximum_size = $v_size;
+ @fseek($this->zip_fd, $v_size-$v_maximum_size);
+ if (@ftell($this->zip_fd) != ($v_size-$v_maximum_size))
+ {
+ // ----- Error log
+ PclZip::privErrorLog(PCLZIP_ERR_BAD_FORMAT, 'Unable to seek back to the middle of the archive \''.$this->zipname.'\'');
+
+ // ----- Return
+ return PclZip::errorCode();
+ }
+
+ // ----- Read byte per byte in order to find the signature
+ $v_pos = ftell($this->zip_fd);
+ $v_bytes = 0x00000000;
+ while ($v_pos < $v_size)
+ {
+ // ----- Read a byte
+ $v_byte = @fread($this->zip_fd, 1);
+
+ // ----- Add the byte
+ //$v_bytes = ($v_bytes << 8) | Ord($v_byte);
+ // Note we mask the old value down such that once shifted we can never end up with more than a 32bit number
+ // Otherwise on systems where we have 64bit integers the check below for the magic number will fail.
+ $v_bytes = ( ($v_bytes & 0xFFFFFF) << 8) | Ord($v_byte);
+
+ // ----- Compare the bytes
+ if ($v_bytes == 0x504b0506)
+ {
+ $v_pos++;
+ break;
+ }
+
+ $v_pos++;
+ }
+
+ // ----- Look if not found end of central dir
+ if ($v_pos == $v_size)
+ {
+
+ // ----- Error log
+ PclZip::privErrorLog(PCLZIP_ERR_BAD_FORMAT, "Unable to find End of Central Dir Record signature");
+
+ // ----- Return
+ return PclZip::errorCode();
+ }
+ }
+
+ // ----- Read the first 18 bytes of the header
+ $v_binary_data = fread($this->zip_fd, 18);
+
+ // ----- Look for invalid block size
+ if (strlen($v_binary_data) != 18)
+ {
+
+ // ----- Error log
+ PclZip::privErrorLog(PCLZIP_ERR_BAD_FORMAT, "Invalid End of Central Dir Record size : ".strlen($v_binary_data));
+
+ // ----- Return
+ return PclZip::errorCode();
+ }
+
+ // ----- Extract the values
+ $v_data = unpack('vdisk/vdisk_start/vdisk_entries/ventries/Vsize/Voffset/vcomment_size', $v_binary_data);
+
+ // ----- Check the global size
+ if (($v_pos + $v_data['comment_size'] + 18) != $v_size) {
+
+ // ----- Removed in release 2.2 see readme file
+ // The check of the file size is a little too strict.
+ // Some bugs where found when a zip is encrypted/decrypted with 'crypt'.
+ // While decrypted, zip has training 0 bytes
+ if (0) {
+ // ----- Error log
+ PclZip::privErrorLog(PCLZIP_ERR_BAD_FORMAT,
+ 'The central dir is not at the end of the archive.'
+ .' Some trailing bytes exists after the archive.');
+
+ // ----- Return
+ return PclZip::errorCode();
+ }
+ }
+
+ // ----- Get comment
+ if ($v_data['comment_size'] != 0) {
+ $p_central_dir['comment'] = fread($this->zip_fd, $v_data['comment_size']);
+ }
+ else
+ $p_central_dir['comment'] = '';
+
+ $p_central_dir['entries'] = $v_data['entries'];
+ $p_central_dir['disk_entries'] = $v_data['disk_entries'];
+ $p_central_dir['offset'] = $v_data['offset'];
+ $p_central_dir['size'] = $v_data['size'];
+ $p_central_dir['disk'] = $v_data['disk'];
+ $p_central_dir['disk_start'] = $v_data['disk_start'];
+
+ // TBC
+ //for(reset($p_central_dir); $key = key($p_central_dir); next($p_central_dir)) {
+ //}
+
+ // ----- Return
+ return $v_result;
+ }
+ // --------------------------------------------------------------------------------
+
+ // --------------------------------------------------------------------------------
+ // Function : privDeleteByRule()
+ // Description :
+ // Parameters :
+ // Return Values :
+ // --------------------------------------------------------------------------------
+ function privDeleteByRule(&$p_result_list, &$p_options)
+ {
+ $v_result=1;
+ $v_list_detail = array();
+
+ // ----- Open the zip file
+ if (($v_result=$this->privOpenFd('rb')) != 1)
+ {
+ // ----- Return
+ return $v_result;
+ }
+
+ // ----- Read the central directory informations
+ $v_central_dir = array();
+ if (($v_result = $this->privReadEndCentralDir($v_central_dir)) != 1)
+ {
+ $this->privCloseFd();
+ return $v_result;
+ }
+
+ // ----- Go to beginning of File
+ @rewind($this->zip_fd);
+
+ // ----- Scan all the files
+ // ----- Start at beginning of Central Dir
+ $v_pos_entry = $v_central_dir['offset'];
+ @rewind($this->zip_fd);
+ if (@fseek($this->zip_fd, $v_pos_entry))
+ {
+ // ----- Close the zip file
+ $this->privCloseFd();
+
+ // ----- Error log
+ PclZip::privErrorLog(PCLZIP_ERR_INVALID_ARCHIVE_ZIP, 'Invalid archive size');
+
+ // ----- Return
+ return PclZip::errorCode();
+ }
+
+ // ----- Read each entry
+ $v_header_list = array();
+ $j_start = 0;
+ for ($i=0, $v_nb_extracted=0; $i<$v_central_dir['entries']; $i++)
+ {
+
+ // ----- Read the file header
+ $v_header_list[$v_nb_extracted] = array();
+ if (($v_result = $this->privReadCentralFileHeader($v_header_list[$v_nb_extracted])) != 1)
+ {
+ // ----- Close the zip file
+ $this->privCloseFd();
+
+ return $v_result;
+ }
+
+
+ // ----- Store the index
+ $v_header_list[$v_nb_extracted]['index'] = $i;
+
+ // ----- Look for the specific extract rules
+ $v_found = false;
+
+ // ----- Look for extract by name rule
+ if ( (isset($p_options[PCLZIP_OPT_BY_NAME]))
+ && ($p_options[PCLZIP_OPT_BY_NAME] != 0)) {
+
+ // ----- Look if the filename is in the list
+ for ($j=0; ($j<sizeof($p_options[PCLZIP_OPT_BY_NAME])) && (!$v_found); $j++) {
+
+ // ----- Look for a directory
+ if (substr($p_options[PCLZIP_OPT_BY_NAME][$j], -1) == "/") {
+
+ // ----- Look if the directory is in the filename path
+ if ( (strlen($v_header_list[$v_nb_extracted]['stored_filename']) > strlen($p_options[PCLZIP_OPT_BY_NAME][$j]))
+ && (substr($v_header_list[$v_nb_extracted]['stored_filename'], 0, strlen($p_options[PCLZIP_OPT_BY_NAME][$j])) == $p_options[PCLZIP_OPT_BY_NAME][$j])) {
+ $v_found = true;
+ }
+ elseif ( (($v_header_list[$v_nb_extracted]['external']&0x00000010)==0x00000010) /* Indicates a folder */
+ && ($v_header_list[$v_nb_extracted]['stored_filename'].'/' == $p_options[PCLZIP_OPT_BY_NAME][$j])) {
+ $v_found = true;
+ }
+ }
+ // ----- Look for a filename
+ elseif ($v_header_list[$v_nb_extracted]['stored_filename'] == $p_options[PCLZIP_OPT_BY_NAME][$j]) {
+ $v_found = true;
+ }
+ }
+ }
+
+ // ----- Look for extract by ereg rule
+ // ereg() is deprecated with PHP 5.3
+ /*
+ else if ( (isset($p_options[PCLZIP_OPT_BY_EREG]))
+ && ($p_options[PCLZIP_OPT_BY_EREG] != "")) {
+
+ if (ereg($p_options[PCLZIP_OPT_BY_EREG], $v_header_list[$v_nb_extracted]['stored_filename'])) {
+ $v_found = true;
+ }
+ }
+ */
+
+ // ----- Look for extract by preg rule
+ else if ( (isset($p_options[PCLZIP_OPT_BY_PREG]))
+ && ($p_options[PCLZIP_OPT_BY_PREG] != "")) {
+
+ if (preg_match($p_options[PCLZIP_OPT_BY_PREG], $v_header_list[$v_nb_extracted]['stored_filename'])) {
+ $v_found = true;
+ }
+ }
+
+ // ----- Look for extract by index rule
+ else if ( (isset($p_options[PCLZIP_OPT_BY_INDEX]))
+ && ($p_options[PCLZIP_OPT_BY_INDEX] != 0)) {
+
+ // ----- Look if the index is in the list
+ for ($j=$j_start; ($j<sizeof($p_options[PCLZIP_OPT_BY_INDEX])) && (!$v_found); $j++) {
+
+ if (($i>=$p_options[PCLZIP_OPT_BY_INDEX][$j]['start']) && ($i<=$p_options[PCLZIP_OPT_BY_INDEX][$j]['end'])) {
+ $v_found = true;
+ }
+ if ($i>=$p_options[PCLZIP_OPT_BY_INDEX][$j]['end']) {
+ $j_start = $j+1;
+ }
+
+ if ($p_options[PCLZIP_OPT_BY_INDEX][$j]['start']>$i) {
+ break;
+ }
+ }
+ }
+ else {
+ $v_found = true;
+ }
+
+ // ----- Look for deletion
+ if ($v_found)
+ {
+ unset($v_header_list[$v_nb_extracted]);
+ }
+ else
+ {
+ $v_nb_extracted++;
+ }
+ }
+
+ // ----- Look if something need to be deleted
+ if ($v_nb_extracted > 0) {
+
+ // ----- Creates a temporay file
+ $v_zip_temp_name = PCLZIP_TEMPORARY_DIR.uniqid('pclzip-').'.tmp';
+
+ // ----- Creates a temporary zip archive
+ $v_temp_zip = new PclZip($v_zip_temp_name);
+
+ // ----- Open the temporary zip file in write mode
+ if (($v_result = $v_temp_zip->privOpenFd('wb')) != 1) {
+ $this->privCloseFd();
+
+ // ----- Return
+ return $v_result;
+ }
+
+ // ----- Look which file need to be kept
+ for ($i=0; $i<sizeof($v_header_list); $i++) {
+
+ // ----- Calculate the position of the header
+ @rewind($this->zip_fd);
+ if (@fseek($this->zip_fd, $v_header_list[$i]['offset'])) {
+ // ----- Close the zip file
+ $this->privCloseFd();
+ $v_temp_zip->privCloseFd();
+ @unlink($v_zip_temp_name);
+
+ // ----- Error log
+ PclZip::privErrorLog(PCLZIP_ERR_INVALID_ARCHIVE_ZIP, 'Invalid archive size');
+
+ // ----- Return
+ return PclZip::errorCode();
+ }
+
+ // ----- Read the file header
+ $v_local_header = array();
+ if (($v_result = $this->privReadFileHeader($v_local_header)) != 1) {
+ // ----- Close the zip file
+ $this->privCloseFd();
+ $v_temp_zip->privCloseFd();
+ @unlink($v_zip_temp_name);
+
+ // ----- Return
+ return $v_result;
+ }
+
+ // ----- Check that local file header is same as central file header
+ if ($this->privCheckFileHeaders($v_local_header,
+ $v_header_list[$i]) != 1) {
+ // TBC
+ }
+ unset($v_local_header);
+
+ // ----- Write the file header
+ if (($v_result = $v_temp_zip->privWriteFileHeader($v_header_list[$i])) != 1) {
+ // ----- Close the zip file
+ $this->privCloseFd();
+ $v_temp_zip->privCloseFd();
+ @unlink($v_zip_temp_name);
+
+ // ----- Return
+ return $v_result;
+ }
+
+ // ----- Read/write the data block
+ if (($v_result = PclZipUtilCopyBlock($this->zip_fd, $v_temp_zip->zip_fd, $v_header_list[$i]['compressed_size'])) != 1) {
+ // ----- Close the zip file
+ $this->privCloseFd();
+ $v_temp_zip->privCloseFd();
+ @unlink($v_zip_temp_name);
+
+ // ----- Return
+ return $v_result;
+ }
+ }
+
+ // ----- Store the offset of the central dir
+ $v_offset = @ftell($v_temp_zip->zip_fd);
+
+ // ----- Re-Create the Central Dir files header
+ for ($i=0; $i<sizeof($v_header_list); $i++) {
+ // ----- Create the file header
+ if (($v_result = $v_temp_zip->privWriteCentralFileHeader($v_header_list[$i])) != 1) {
+ $v_temp_zip->privCloseFd();
+ $this->privCloseFd();
+ @unlink($v_zip_temp_name);
+
+ // ----- Return
+ return $v_result;
+ }
+
+ // ----- Transform the header to a 'usable' info
+ $v_temp_zip->privConvertHeader2FileInfo($v_header_list[$i], $p_result_list[$i]);
+ }
+
+
+ // ----- Zip file comment
+ $v_comment = '';
+ if (isset($p_options[PCLZIP_OPT_COMMENT])) {
+ $v_comment = $p_options[PCLZIP_OPT_COMMENT];
+ }
+
+ // ----- Calculate the size of the central header
+ $v_size = @ftell($v_temp_zip->zip_fd)-$v_offset;
+
+ // ----- Create the central dir footer
+ if (($v_result = $v_temp_zip->privWriteCentralHeader(sizeof($v_header_list), $v_size, $v_offset, $v_comment)) != 1) {
+ // ----- Reset the file list
+ unset($v_header_list);
+ $v_temp_zip->privCloseFd();
+ $this->privCloseFd();
+ @unlink($v_zip_temp_name);
+
+ // ----- Return
+ return $v_result;
+ }
+
+ // ----- Close
+ $v_temp_zip->privCloseFd();
+ $this->privCloseFd();
+
+ // ----- Delete the zip file
+ // TBC : I should test the result ...
+ @unlink($this->zipname);
+
+ // ----- Rename the temporary file
+ // TBC : I should test the result ...
+ //@rename($v_zip_temp_name, $this->zipname);
+ PclZipUtilRename($v_zip_temp_name, $this->zipname);
+
+ // ----- Destroy the temporary archive
+ unset($v_temp_zip);
+ }
+
+ // ----- Remove every files : reset the file
+ else if ($v_central_dir['entries'] != 0) {
+ $this->privCloseFd();
+
+ if (($v_result = $this->privOpenFd('wb')) != 1) {
+ return $v_result;
+ }
+
+ if (($v_result = $this->privWriteCentralHeader(0, 0, 0, '')) != 1) {
+ return $v_result;
+ }
+
+ $this->privCloseFd();
+ }
+
+ // ----- Return
+ return $v_result;
+ }
+ // --------------------------------------------------------------------------------
+
+ // --------------------------------------------------------------------------------
+ // Function : privDirCheck()
+ // Description :
+ // Check if a directory exists, if not it creates it and all the parents directory
+ // which may be useful.
+ // Parameters :
+ // $p_dir : Directory path to check.
+ // Return Values :
+ // 1 : OK
+ // -1 : Unable to create directory
+ // --------------------------------------------------------------------------------
+ function privDirCheck($p_dir, $p_is_dir=false)
+ {
+ $v_result = 1;
+
+
+ // ----- Remove the final '/'
+ if (($p_is_dir) && (substr($p_dir, -1)=='/'))
+ {
+ $p_dir = substr($p_dir, 0, strlen($p_dir)-1);
+ }
+
+ // ----- Check the directory availability
+ if ((is_dir($p_dir)) || ($p_dir == ""))
+ {
+ return 1;
+ }
+
+ // ----- Extract parent directory
+ $p_parent_dir = dirname($p_dir);
+
+ // ----- Just a check
+ if ($p_parent_dir != $p_dir)
+ {
+ // ----- Look for parent directory
+ if ($p_parent_dir != "")
+ {
+ if (($v_result = $this->privDirCheck($p_parent_dir)) != 1)
+ {
+ return $v_result;
+ }
+ }
+ }
+
+ // ----- Create the directory
+ if (!@mkdir($p_dir, 0777))
+ {
+ // ----- Error log
+ PclZip::privErrorLog(PCLZIP_ERR_DIR_CREATE_FAIL, "Unable to create directory '$p_dir'");
+
+ // ----- Return
+ return PclZip::errorCode();
+ }
+
+ // ----- Return
+ return $v_result;
+ }
+ // --------------------------------------------------------------------------------
+
+ // --------------------------------------------------------------------------------
+ // Function : privMerge()
+ // Description :
+ // If $p_archive_to_add does not exist, the function exit with a success result.
+ // Parameters :
+ // Return Values :
+ // --------------------------------------------------------------------------------
+ function privMerge(&$p_archive_to_add)
+ {
+ $v_result=1;
+
+ // ----- Look if the archive_to_add exists
+ if (!is_file($p_archive_to_add->zipname))
+ {
+
+ // ----- Nothing to merge, so merge is a success
+ $v_result = 1;
+
+ // ----- Return
+ return $v_result;
+ }
+
+ // ----- Look if the archive exists
+ if (!is_file($this->zipname))
+ {
+
+ // ----- Do a duplicate
+ $v_result = $this->privDuplicate($p_archive_to_add->zipname);
+
+ // ----- Return
+ return $v_result;
+ }
+
+ // ----- Open the zip file
+ if (($v_result=$this->privOpenFd('rb')) != 1)
+ {
+ // ----- Return
+ return $v_result;
+ }
+
+ // ----- Read the central directory informations
+ $v_central_dir = array();
+ if (($v_result = $this->privReadEndCentralDir($v_central_dir)) != 1)
+ {
+ $this->privCloseFd();
+ return $v_result;
+ }
+
+ // ----- Go to beginning of File
+ @rewind($this->zip_fd);
+
+ // ----- Open the archive_to_add file
+ if (($v_result=$p_archive_to_add->privOpenFd('rb')) != 1)
+ {
+ $this->privCloseFd();
+
+ // ----- Return
+ return $v_result;
+ }
+
+ // ----- Read the central directory informations
+ $v_central_dir_to_add = array();
+ if (($v_result = $p_archive_to_add->privReadEndCentralDir($v_central_dir_to_add)) != 1)
+ {
+ $this->privCloseFd();
+ $p_archive_to_add->privCloseFd();
+
+ return $v_result;
+ }
+
+ // ----- Go to beginning of File
+ @rewind($p_archive_to_add->zip_fd);
+
+ // ----- Creates a temporay file
+ $v_zip_temp_name = PCLZIP_TEMPORARY_DIR.uniqid('pclzip-').'.tmp';
+
+ // ----- Open the temporary file in write mode
+ if (($v_zip_temp_fd = @fopen($v_zip_temp_name, 'wb')) == 0)
+ {
+ $this->privCloseFd();
+ $p_archive_to_add->privCloseFd();
+
+ PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, 'Unable to open temporary file \''.$v_zip_temp_name.'\' in binary write mode');
+
+ // ----- Return
+ return PclZip::errorCode();
+ }
+
+ // ----- Copy the files from the archive to the temporary file
+ // TBC : Here I should better append the file and go back to erase the central dir
+ $v_size = $v_central_dir['offset'];
+ while ($v_size != 0)
+ {
+ $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE);
+ $v_buffer = fread($this->zip_fd, $v_read_size);
+ @fwrite($v_zip_temp_fd, $v_buffer, $v_read_size);
+ $v_size -= $v_read_size;
+ }
+
+ // ----- Copy the files from the archive_to_add into the temporary file
+ $v_size = $v_central_dir_to_add['offset'];
+ while ($v_size != 0)
+ {
+ $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE);
+ $v_buffer = fread($p_archive_to_add->zip_fd, $v_read_size);
+ @fwrite($v_zip_temp_fd, $v_buffer, $v_read_size);
+ $v_size -= $v_read_size;
+ }
+
+ // ----- Store the offset of the central dir
+ $v_offset = @ftell($v_zip_temp_fd);
+
+ // ----- Copy the block of file headers from the old archive
+ $v_size = $v_central_dir['size'];
+ while ($v_size != 0)
+ {
+ $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE);
+ $v_buffer = @fread($this->zip_fd, $v_read_size);
+ @fwrite($v_zip_temp_fd, $v_buffer, $v_read_size);
+ $v_size -= $v_read_size;
+ }
+
+ // ----- Copy the block of file headers from the archive_to_add
+ $v_size = $v_central_dir_to_add['size'];
+ while ($v_size != 0)
+ {
+ $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE);
+ $v_buffer = @fread($p_archive_to_add->zip_fd, $v_read_size);
+ @fwrite($v_zip_temp_fd, $v_buffer, $v_read_size);
+ $v_size -= $v_read_size;
+ }
+
+ // ----- Merge the file comments
+ $v_comment = $v_central_dir['comment'].' '.$v_central_dir_to_add['comment'];
+
+ // ----- Calculate the size of the (new) central header
+ $v_size = @ftell($v_zip_temp_fd)-$v_offset;
+
+ // ----- Swap the file descriptor
+ // Here is a trick : I swap the temporary fd with the zip fd, in order to use
+ // the following methods on the temporary fil and not the real archive fd
+ $v_swap = $this->zip_fd;
+ $this->zip_fd = $v_zip_temp_fd;
+ $v_zip_temp_fd = $v_swap;
+
+ // ----- Create the central dir footer
+ if (($v_result = $this->privWriteCentralHeader($v_central_dir['entries']+$v_central_dir_to_add['entries'], $v_size, $v_offset, $v_comment)) != 1)
+ {
+ $this->privCloseFd();
+ $p_archive_to_add->privCloseFd();
+ @fclose($v_zip_temp_fd);
+ $this->zip_fd = null;
+
+ // ----- Reset the file list
+ unset($v_header_list);
+
+ // ----- Return
+ return $v_result;
+ }
+
+ // ----- Swap back the file descriptor
+ $v_swap = $this->zip_fd;
+ $this->zip_fd = $v_zip_temp_fd;
+ $v_zip_temp_fd = $v_swap;
+
+ // ----- Close
+ $this->privCloseFd();
+ $p_archive_to_add->privCloseFd();
+
+ // ----- Close the temporary file
+ @fclose($v_zip_temp_fd);
+
+ // ----- Delete the zip file
+ // TBC : I should test the result ...
+ @unlink($this->zipname);
+
+ // ----- Rename the temporary file
+ // TBC : I should test the result ...
+ //@rename($v_zip_temp_name, $this->zipname);
+ PclZipUtilRename($v_zip_temp_name, $this->zipname);
+
+ // ----- Return
+ return $v_result;
+ }
+ // --------------------------------------------------------------------------------
+
+ // --------------------------------------------------------------------------------
+ // Function : privDuplicate()
+ // Description :
+ // Parameters :
+ // Return Values :
+ // --------------------------------------------------------------------------------
+ function privDuplicate($p_archive_filename)
+ {
+ $v_result=1;
+
+ // ----- Look if the $p_archive_filename exists
+ if (!is_file($p_archive_filename))
+ {
+
+ // ----- Nothing to duplicate, so duplicate is a success.
+ $v_result = 1;
+
+ // ----- Return
+ return $v_result;
+ }
+
+ // ----- Open the zip file
+ if (($v_result=$this->privOpenFd('wb')) != 1)
+ {
+ // ----- Return
+ return $v_result;
+ }
+
+ // ----- Open the temporary file in write mode
+ if (($v_zip_temp_fd = @fopen($p_archive_filename, 'rb')) == 0)
+ {
+ $this->privCloseFd();
+
+ PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, 'Unable to open archive file \''.$p_archive_filename.'\' in binary write mode');
+
+ // ----- Return
+ return PclZip::errorCode();
+ }
+
+ // ----- Copy the files from the archive to the temporary file
+ // TBC : Here I should better append the file and go back to erase the central dir
+ $v_size = filesize($p_archive_filename);
+ while ($v_size != 0)
+ {
+ $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE);
+ $v_buffer = fread($v_zip_temp_fd, $v_read_size);
+ @fwrite($this->zip_fd, $v_buffer, $v_read_size);
+ $v_size -= $v_read_size;
+ }
+
+ // ----- Close
+ $this->privCloseFd();
+
+ // ----- Close the temporary file
+ @fclose($v_zip_temp_fd);
+
+ // ----- Return
+ return $v_result;
+ }
+ // --------------------------------------------------------------------------------
+
+ // --------------------------------------------------------------------------------
+ // Function : privErrorLog()
+ // Description :
+ // Parameters :
+ // --------------------------------------------------------------------------------
+ function privErrorLog($p_error_code=0, $p_error_string='')
+ {
+ if (PCLZIP_ERROR_EXTERNAL == 1) {
+ PclError($p_error_code, $p_error_string);
+ }
+ else {
+ $this->error_code = $p_error_code;
+ $this->error_string = $p_error_string;
+ }
+ }
+ // --------------------------------------------------------------------------------
+
+ // --------------------------------------------------------------------------------
+ // Function : privErrorReset()
+ // Description :
+ // Parameters :
+ // --------------------------------------------------------------------------------
+ function privErrorReset()
+ {
+ if (PCLZIP_ERROR_EXTERNAL == 1) {
+ PclErrorReset();
+ }
+ else {
+ $this->error_code = 0;
+ $this->error_string = '';
+ }
+ }
+ // --------------------------------------------------------------------------------
+
+ // --------------------------------------------------------------------------------
+ // Function : privDisableMagicQuotes()
+ // Description :
+ // Parameters :
+ // Return Values :
+ // --------------------------------------------------------------------------------
+ function privDisableMagicQuotes()
+ {
+ $v_result=1;
+
+ // ----- Look if function exists
+ if ( (!function_exists("get_magic_quotes_runtime"))
+ || (!function_exists("set_magic_quotes_runtime"))) {
+ return $v_result;
+ }
+
+ // ----- Look if already done
+ if ($this->magic_quotes_status != -1) {
+ return $v_result;
+ }
+
+ // ----- Get and memorize the magic_quote value
+ $this->magic_quotes_status = @get_magic_quotes_runtime();
+
+ // ----- Disable magic_quotes
+ if ($this->magic_quotes_status == 1) {
+ @set_magic_quotes_runtime(0);
+ }
+
+ // ----- Return
+ return $v_result;
+ }
+ // --------------------------------------------------------------------------------
+
+ // --------------------------------------------------------------------------------
+ // Function : privSwapBackMagicQuotes()
+ // Description :
+ // Parameters :
+ // Return Values :
+ // --------------------------------------------------------------------------------
+ function privSwapBackMagicQuotes()
+ {
+ $v_result=1;
+
+ // ----- Look if function exists
+ if ( (!function_exists("get_magic_quotes_runtime"))
+ || (!function_exists("set_magic_quotes_runtime"))) {
+ return $v_result;
+ }
+
+ // ----- Look if something to do
+ if ($this->magic_quotes_status != -1) {
+ return $v_result;
+ }
+
+ // ----- Swap back magic_quotes
+ if ($this->magic_quotes_status == 1) {
+ @set_magic_quotes_runtime($this->magic_quotes_status);
+ }
+
+ // ----- Return
+ return $v_result;
+ }
+ // --------------------------------------------------------------------------------
+
+ }
+ // End of class
+ // --------------------------------------------------------------------------------
+
+ // --------------------------------------------------------------------------------
+ // Function : PclZipUtilPathReduction()
+ // Description :
+ // Parameters :
+ // Return Values :
+ // --------------------------------------------------------------------------------
+ function PclZipUtilPathReduction($p_dir)
+ {
+ $v_result = "";
+
+ // ----- Look for not empty path
+ if ($p_dir != "") {
+ // ----- Explode path by directory names
+ $v_list = explode("/", $p_dir);
+
+ // ----- Study directories from last to first
+ $v_skip = 0;
+ for ($i=sizeof($v_list)-1; $i>=0; $i--) {
+ // ----- Look for current path
+ if ($v_list[$i] == ".") {
+ // ----- Ignore this directory
+ // Should be the first $i=0, but no check is done
+ }
+ else if ($v_list[$i] == "..") {
+ $v_skip++;
+ }
+ else if ($v_list[$i] == "") {
+ // ----- First '/' i.e. root slash
+ if ($i == 0) {
+ $v_result = "/".$v_result;
+ if ($v_skip > 0) {
+ // ----- It is an invalid path, so the path is not modified
+ // TBC
+ $v_result = $p_dir;
+ $v_skip = 0;
+ }
+ }
+ // ----- Last '/' i.e. indicates a directory
+ else if ($i == (sizeof($v_list)-1)) {
+ $v_result = $v_list[$i];
+ }
+ // ----- Double '/' inside the path
+ else {
+ // ----- Ignore only the double '//' in path,
+ // but not the first and last '/'
+ }
+ }
+ else {
+ // ----- Look for item to skip
+ if ($v_skip > 0) {
+ $v_skip--;
+ }
+ else {
+ $v_result = $v_list[$i].($i!=(sizeof($v_list)-1)?"/".$v_result:"");
+ }
+ }
+ }
+
+ // ----- Look for skip
+ if ($v_skip > 0) {
+ while ($v_skip > 0) {
+ $v_result = '../'.$v_result;
+ $v_skip--;
+ }
+ }
+ }
+
+ // ----- Return
+ return $v_result;
+ }
+ // --------------------------------------------------------------------------------
+
+ // --------------------------------------------------------------------------------
+ // Function : PclZipUtilPathInclusion()
+ // Description :
+ // This function indicates if the path $p_path is under the $p_dir tree. Or,
+ // said in an other way, if the file or sub-dir $p_path is inside the dir
+ // $p_dir.
+ // The function indicates also if the path is exactly the same as the dir.
+ // This function supports path with duplicated '/' like '//', but does not
+ // support '.' or '..' statements.
+ // Parameters :
+ // Return Values :
+ // 0 if $p_path is not inside directory $p_dir
+ // 1 if $p_path is inside directory $p_dir
+ // 2 if $p_path is exactly the same as $p_dir
+ // --------------------------------------------------------------------------------
+ function PclZipUtilPathInclusion($p_dir, $p_path)
+ {
+ $v_result = 1;
+
+ // ----- Look for path beginning by ./
+ if ( ($p_dir == '.')
+ || ((strlen($p_dir) >=2) && (substr($p_dir, 0, 2) == './'))) {
+ $p_dir = PclZipUtilTranslateWinPath(getcwd(), FALSE).'/'.substr($p_dir, 1);
+ }
+ if ( ($p_path == '.')
+ || ((strlen($p_path) >=2) && (substr($p_path, 0, 2) == './'))) {
+ $p_path = PclZipUtilTranslateWinPath(getcwd(), FALSE).'/'.substr($p_path, 1);
+ }
+
+ // ----- Explode dir and path by directory separator
+ $v_list_dir = explode("/", $p_dir);
+ $v_list_dir_size = sizeof($v_list_dir);
+ $v_list_path = explode("/", $p_path);
+ $v_list_path_size = sizeof($v_list_path);
+
+ // ----- Study directories paths
+ $i = 0;
+ $j = 0;
+ while (($i < $v_list_dir_size) && ($j < $v_list_path_size) && ($v_result)) {
+
+ // ----- Look for empty dir (path reduction)
+ if ($v_list_dir[$i] == '') {
+ $i++;
+ continue;
+ }
+ if ($v_list_path[$j] == '') {
+ $j++;
+ continue;
+ }
+
+ // ----- Compare the items
+ if (($v_list_dir[$i] != $v_list_path[$j]) && ($v_list_dir[$i] != '') && ( $v_list_path[$j] != '')) {
+ $v_result = 0;
+ }
+
+ // ----- Next items
+ $i++;
+ $j++;
+ }
+
+ // ----- Look if everything seems to be the same
+ if ($v_result) {
+ // ----- Skip all the empty items
+ while (($j < $v_list_path_size) && ($v_list_path[$j] == '')) $j++;
+ while (($i < $v_list_dir_size) && ($v_list_dir[$i] == '')) $i++;
+
+ if (($i >= $v_list_dir_size) && ($j >= $v_list_path_size)) {
+ // ----- There are exactly the same
+ $v_result = 2;
+ }
+ else if ($i < $v_list_dir_size) {
+ // ----- The path is shorter than the dir
+ $v_result = 0;
+ }
+ }
+
+ // ----- Return
+ return $v_result;
+ }
+ // --------------------------------------------------------------------------------
+
+ // --------------------------------------------------------------------------------
+ // Function : PclZipUtilCopyBlock()
+ // Description :
+ // Parameters :
+ // $p_mode : read/write compression mode
+ // 0 : src & dest normal
+ // 1 : src gzip, dest normal
+ // 2 : src normal, dest gzip
+ // 3 : src & dest gzip
+ // Return Values :
+ // --------------------------------------------------------------------------------
+ function PclZipUtilCopyBlock($p_src, $p_dest, $p_size, $p_mode=0)
+ {
+ $v_result = 1;
+
+ if ($p_mode==0)
+ {
+ while ($p_size != 0)
+ {
+ $v_read_size = ($p_size < PCLZIP_READ_BLOCK_SIZE ? $p_size : PCLZIP_READ_BLOCK_SIZE);
+ $v_buffer = @fread($p_src, $v_read_size);
+ @fwrite($p_dest, $v_buffer, $v_read_size);
+ $p_size -= $v_read_size;
+ }
+ }
+ else if ($p_mode==1)
+ {
+ while ($p_size != 0)
+ {
+ $v_read_size = ($p_size < PCLZIP_READ_BLOCK_SIZE ? $p_size : PCLZIP_READ_BLOCK_SIZE);
+ $v_buffer = @gzread($p_src, $v_read_size);
+ @fwrite($p_dest, $v_buffer, $v_read_size);
+ $p_size -= $v_read_size;
+ }
+ }
+ else if ($p_mode==2)
+ {
+ while ($p_size != 0)
+ {
+ $v_read_size = ($p_size < PCLZIP_READ_BLOCK_SIZE ? $p_size : PCLZIP_READ_BLOCK_SIZE);
+ $v_buffer = @fread($p_src, $v_read_size);
+ @gzwrite($p_dest, $v_buffer, $v_read_size);
+ $p_size -= $v_read_size;
+ }
+ }
+ else if ($p_mode==3)
+ {
+ while ($p_size != 0)
+ {
+ $v_read_size = ($p_size < PCLZIP_READ_BLOCK_SIZE ? $p_size : PCLZIP_READ_BLOCK_SIZE);
+ $v_buffer = @gzread($p_src, $v_read_size);
+ @gzwrite($p_dest, $v_buffer, $v_read_size);
+ $p_size -= $v_read_size;
+ }
+ }
+
+ // ----- Return
+ return $v_result;
+ }
+ // --------------------------------------------------------------------------------
+
+ // --------------------------------------------------------------------------------
+ // Function : PclZipUtilRename()
+ // Description :
+ // This function tries to do a simple rename() function. If it fails, it
+ // tries to copy the $p_src file in a new $p_dest file and then unlink the
+ // first one.
+ // Parameters :
+ // $p_src : Old filename
+ // $p_dest : New filename
+ // Return Values :
+ // 1 on success, 0 on failure.
+ // --------------------------------------------------------------------------------
+ function PclZipUtilRename($p_src, $p_dest)
+ {
+ $v_result = 1;
+
+ // ----- Try to rename the files
+ if (!@rename($p_src, $p_dest)) {
+
+ // ----- Try to copy & unlink the src
+ if (!@copy($p_src, $p_dest)) {
+ $v_result = 0;
+ }
+ else if (!@unlink($p_src)) {
+ $v_result = 0;
+ }
+ }
+
+ // ----- Return
+ return $v_result;
+ }
+ // --------------------------------------------------------------------------------
+
+ // --------------------------------------------------------------------------------
+ // Function : PclZipUtilOptionText()
+ // Description :
+ // Translate option value in text. Mainly for debug purpose.
+ // Parameters :
+ // $p_option : the option value.
+ // Return Values :
+ // The option text value.
+ // --------------------------------------------------------------------------------
+ function PclZipUtilOptionText($p_option)
+ {
+
+ $v_list = get_defined_constants();
+ for (reset($v_list); $v_key = key($v_list); next($v_list)) {
+ $v_prefix = substr($v_key, 0, 10);
+ if (( ($v_prefix == 'PCLZIP_OPT')
+ || ($v_prefix == 'PCLZIP_CB_')
+ || ($v_prefix == 'PCLZIP_ATT'))
+ && ($v_list[$v_key] == $p_option)) {
+ return $v_key;
+ }
+ }
+
+ $v_result = 'Unknown';
+
+ return $v_result;
+ }
+ // --------------------------------------------------------------------------------
+
+ // --------------------------------------------------------------------------------
+ // Function : PclZipUtilTranslateWinPath()
+ // Description :
+ // Translate windows path by replacing '\' by '/' and optionally removing
+ // drive letter.
+ // Parameters :
+ // $p_path : path to translate.
+ // $p_remove_disk_letter : true | false
+ // Return Values :
+ // The path translated.
+ // --------------------------------------------------------------------------------
+ function PclZipUtilTranslateWinPath($p_path, $p_remove_disk_letter=true)
+ {
+ if (stristr(php_uname(), 'windows')) {
+ // ----- Look for potential disk letter
+ if (($p_remove_disk_letter) && (($v_position = strpos($p_path, ':')) != false)) {
+ $p_path = substr($p_path, $v_position+1);
+ }
+ // ----- Change potential windows directory separator
+ if ((strpos($p_path, '\\') > 0) || (substr($p_path, 0,1) == '\\')) {
+ $p_path = strtr($p_path, '\\', '/');
+ }
+ }
+ return $p_path;
+ }
+ // --------------------------------------------------------------------------------
+
+
+?>
diff --git a/www/crm/wp-admin/includes/class-plugin-installer-skin.php b/www/crm/wp-admin/includes/class-plugin-installer-skin.php
new file mode 100644
index 00000000..1d6dd018
--- /dev/null
+++ b/www/crm/wp-admin/includes/class-plugin-installer-skin.php
@@ -0,0 +1,105 @@
+<?php
+/**
+ * Upgrader API: Plugin_Installer_Skin class
+ *
+ * @package WordPress
+ * @subpackage Upgrader
+ * @since 4.6.0
+ */
+
+/**
+ * Plugin Installer Skin for WordPress Plugin Installer.
+ *
+ * @since 2.8.0
+ * @since 4.6.0 Moved to its own file from wp-admin/includes/class-wp-upgrader-skins.php.
+ *
+ * @see WP_Upgrader_Skin
+ */
+class Plugin_Installer_Skin extends WP_Upgrader_Skin {
+ public $api;
+ public $type;
+
+ /**
+ * @param array $args
+ */
+ public function __construct( $args = array() ) {
+ $defaults = array(
+ 'type' => 'web',
+ 'url' => '',
+ 'plugin' => '',
+ 'nonce' => '',
+ 'title' => '',
+ );
+ $args = wp_parse_args( $args, $defaults );
+
+ $this->type = $args['type'];
+ $this->api = isset( $args['api'] ) ? $args['api'] : array();
+
+ parent::__construct( $args );
+ }
+
+ /**
+ */
+ public function before() {
+ if ( ! empty( $this->api ) ) {
+ /* translators: 1: name of API, 2: version of API */
+ $this->upgrader->strings['process_success'] = sprintf( __( 'Successfully installed the plugin <strong>%1$s %2$s</strong>.' ), $this->api->name, $this->api->version );
+ }
+ }
+
+ /**
+ */
+ public function after() {
+ $plugin_file = $this->upgrader->plugin_info();
+
+ $install_actions = array();
+
+ $from = isset( $_GET['from'] ) ? wp_unslash( $_GET['from'] ) : 'plugins';
+
+ if ( 'import' == $from ) {
+ $install_actions['activate_plugin'] = '<a class="button button-primary" href="' . wp_nonce_url( 'plugins.php?action=activate&amp;from=import&amp;plugin=' . urlencode( $plugin_file ), 'activate-plugin_' . $plugin_file ) . '" target="_parent">' . __( 'Activate Plugin &amp; Run Importer' ) . '</a>';
+ } elseif ( 'press-this' == $from ) {
+ $install_actions['activate_plugin'] = '<a class="button button-primary" href="' . wp_nonce_url( 'plugins.php?action=activate&amp;from=press-this&amp;plugin=' . urlencode( $plugin_file ), 'activate-plugin_' . $plugin_file ) . '" target="_parent">' . __( 'Activate Plugin &amp; Return to Press This' ) . '</a>';
+ } else {
+ $install_actions['activate_plugin'] = '<a class="button button-primary" href="' . wp_nonce_url( 'plugins.php?action=activate&amp;plugin=' . urlencode( $plugin_file ), 'activate-plugin_' . $plugin_file ) . '" target="_parent">' . __( 'Activate Plugin' ) . '</a>';
+ }
+
+ if ( is_multisite() && current_user_can( 'manage_network_plugins' ) ) {
+ $install_actions['network_activate'] = '<a class="button button-primary" href="' . wp_nonce_url( 'plugins.php?action=activate&amp;networkwide=1&amp;plugin=' . urlencode( $plugin_file ), 'activate-plugin_' . $plugin_file ) . '" target="_parent">' . __( 'Network Activate' ) . '</a>';
+ unset( $install_actions['activate_plugin'] );
+ }
+
+ if ( 'import' == $from ) {
+ $install_actions['importers_page'] = '<a href="' . admin_url( 'import.php' ) . '" target="_parent">' . __( 'Return to Importers' ) . '</a>';
+ } elseif ( $this->type == 'web' ) {
+ $install_actions['plugins_page'] = '<a href="' . self_admin_url( 'plugin-install.php' ) . '" target="_parent">' . __( 'Return to Plugin Installer' ) . '</a>';
+ } elseif ( 'upload' == $this->type && 'plugins' == $from ) {
+ $install_actions['plugins_page'] = '<a href="' . self_admin_url( 'plugin-install.php' ) . '">' . __( 'Return to Plugin Installer' ) . '</a>';
+ } else {
+ $install_actions['plugins_page'] = '<a href="' . self_admin_url( 'plugins.php' ) . '" target="_parent">' . __( 'Return to Plugins page' ) . '</a>';
+ }
+
+ if ( ! $this->result || is_wp_error( $this->result ) ) {
+ unset( $install_actions['activate_plugin'], $install_actions['network_activate'] );
+ } elseif ( ! current_user_can( 'activate_plugin', $plugin_file ) ) {
+ unset( $install_actions['activate_plugin'] );
+ }
+
+ /**
+ * Filters the list of action links available following a single plugin installation.
+ *
+ * @since 2.7.0
+ *
+ * @param string[] $install_actions Array of plugin action links.
+ * @param object $api Object containing WordPress.org API plugin data. Empty
+ * for non-API installs, such as when a plugin is installed
+ * via upload.
+ * @param string $plugin_file Path to the plugin file relative to the plugins directory.
+ */
+ $install_actions = apply_filters( 'install_plugin_complete_actions', $install_actions, $this->api, $plugin_file );
+
+ if ( ! empty( $install_actions ) ) {
+ $this->feedback( implode( ' ', (array) $install_actions ) );
+ }
+ }
+}
diff --git a/www/crm/wp-admin/includes/class-plugin-upgrader-skin.php b/www/crm/wp-admin/includes/class-plugin-upgrader-skin.php
new file mode 100644
index 00000000..87cbefbc
--- /dev/null
+++ b/www/crm/wp-admin/includes/class-plugin-upgrader-skin.php
@@ -0,0 +1,76 @@
+<?php
+/**
+ * Upgrader API: Plugin_Upgrader_Skin class
+ *
+ * @package WordPress
+ * @subpackage Upgrader
+ * @since 4.6.0
+ */
+
+/**
+ * Plugin Upgrader Skin for WordPress Plugin Upgrades.
+ *
+ * @since 2.8.0
+ * @since 4.6.0 Moved to its own file from wp-admin/includes/class-wp-upgrader-skins.php.
+ *
+ * @see WP_Upgrader_Skin
+ */
+class Plugin_Upgrader_Skin extends WP_Upgrader_Skin {
+ public $plugin = '';
+ public $plugin_active = false;
+ public $plugin_network_active = false;
+
+ /**
+ * @param array $args
+ */
+ public function __construct( $args = array() ) {
+ $defaults = array(
+ 'url' => '',
+ 'plugin' => '',
+ 'nonce' => '',
+ 'title' => __( 'Update Plugin' ),
+ );
+ $args = wp_parse_args( $args, $defaults );
+
+ $this->plugin = $args['plugin'];
+
+ $this->plugin_active = is_plugin_active( $this->plugin );
+ $this->plugin_network_active = is_plugin_active_for_network( $this->plugin );
+
+ parent::__construct( $args );
+ }
+
+ /**
+ */
+ public function after() {
+ $this->plugin = $this->upgrader->plugin_info();
+ if ( ! empty( $this->plugin ) && ! is_wp_error( $this->result ) && $this->plugin_active ) {
+ // Currently used only when JS is off for a single plugin update?
+ echo '<iframe title="' . esc_attr__( 'Update progress' ) . '" style="border:0;overflow:hidden" width="100%" height="170" src="' . wp_nonce_url( 'update.php?action=activate-plugin&networkwide=' . $this->plugin_network_active . '&plugin=' . urlencode( $this->plugin ), 'activate-plugin_' . $this->plugin ) . '"></iframe>';
+ }
+
+ $this->decrement_update_count( 'plugin' );
+
+ $update_actions = array(
+ 'activate_plugin' => '<a href="' . wp_nonce_url( 'plugins.php?action=activate&amp;plugin=' . urlencode( $this->plugin ), 'activate-plugin_' . $this->plugin ) . '" target="_parent">' . __( 'Activate Plugin' ) . '</a>',
+ 'plugins_page' => '<a href="' . self_admin_url( 'plugins.php' ) . '" target="_parent">' . __( 'Return to Plugins page' ) . '</a>',
+ );
+ if ( $this->plugin_active || ! $this->result || is_wp_error( $this->result ) || ! current_user_can( 'activate_plugin', $this->plugin ) ) {
+ unset( $update_actions['activate_plugin'] );
+ }
+
+ /**
+ * Filters the list of action links available following a single plugin update.
+ *
+ * @since 2.7.0
+ *
+ * @param string[] $update_actions Array of plugin action links.
+ * @param string $plugin Path to the plugin file relative to the plugins directory.
+ */
+ $update_actions = apply_filters( 'update_plugin_complete_actions', $update_actions, $this->plugin );
+
+ if ( ! empty( $update_actions ) ) {
+ $this->feedback( implode( ' | ', (array) $update_actions ) );
+ }
+ }
+}
diff --git a/www/crm/wp-admin/includes/class-plugin-upgrader.php b/www/crm/wp-admin/includes/class-plugin-upgrader.php
new file mode 100644
index 00000000..c80c9c4c
--- /dev/null
+++ b/www/crm/wp-admin/includes/class-plugin-upgrader.php
@@ -0,0 +1,487 @@
+<?php
+/**
+ * Upgrade API: Plugin_Upgrader class
+ *
+ * @package WordPress
+ * @subpackage Upgrader
+ * @since 4.6.0
+ */
+
+/**
+ * Core class used for upgrading/installing plugins.
+ *
+ * It is designed to upgrade/install plugins from a local zip, remote zip URL,
+ * or uploaded zip file.
+ *
+ * @since 2.8.0
+ * @since 4.6.0 Moved to its own file from wp-admin/includes/class-wp-upgrader.php.
+ *
+ * @see WP_Upgrader
+ */
+class Plugin_Upgrader extends WP_Upgrader {
+
+ /**
+ * Plugin upgrade result.
+ *
+ * @since 2.8.0
+ * @var array|WP_Error $result
+ *
+ * @see WP_Upgrader::$result
+ */
+ public $result;
+
+ /**
+ * Whether a bulk upgrade/installation is being performed.
+ *
+ * @since 2.9.0
+ * @var bool $bulk
+ */
+ public $bulk = false;
+
+ /**
+ * Initialize the upgrade strings.
+ *
+ * @since 2.8.0
+ */
+ public function upgrade_strings() {
+ $this->strings['up_to_date'] = __( 'The plugin is at the latest version.' );
+ $this->strings['no_package'] = __( 'Update package not available.' );
+ /* translators: %s: package URL */
+ $this->strings['downloading_package'] = sprintf( __( 'Downloading update from %s&#8230;' ), '<span class="code">%s</span>' );
+ $this->strings['unpack_package'] = __( 'Unpacking the update&#8230;' );
+ $this->strings['remove_old'] = __( 'Removing the old version of the plugin&#8230;' );
+ $this->strings['remove_old_failed'] = __( 'Could not remove the old plugin.' );
+ $this->strings['process_failed'] = __( 'Plugin update failed.' );
+ $this->strings['process_success'] = __( 'Plugin updated successfully.' );
+ $this->strings['process_bulk_success'] = __( 'Plugins updated successfully.' );
+ }
+
+ /**
+ * Initialize the installation strings.
+ *
+ * @since 2.8.0
+ */
+ public function install_strings() {
+ $this->strings['no_package'] = __( 'Installation package not available.' );
+ /* translators: %s: package URL */
+ $this->strings['downloading_package'] = sprintf( __( 'Downloading installation package from %s&#8230;' ), '<span class="code">%s</span>' );
+ $this->strings['unpack_package'] = __( 'Unpacking the package&#8230;' );
+ $this->strings['installing_package'] = __( 'Installing the plugin&#8230;' );
+ $this->strings['no_files'] = __( 'The plugin contains no files.' );
+ $this->strings['process_failed'] = __( 'Plugin installation failed.' );
+ $this->strings['process_success'] = __( 'Plugin installed successfully.' );
+ }
+
+ /**
+ * Install a plugin package.
+ *
+ * @since 2.8.0
+ * @since 3.7.0 The `$args` parameter was added, making clearing the plugin update cache optional.
+ *
+ * @param string $package The full local path or URI of the package.
+ * @param array $args {
+ * Optional. Other arguments for installing a plugin package. Default empty array.
+ *
+ * @type bool $clear_update_cache Whether to clear the plugin updates cache if successful.
+ * Default true.
+ * }
+ * @return bool|WP_Error True if the installation was successful, false or a WP_Error otherwise.
+ */
+ public function install( $package, $args = array() ) {
+
+ $defaults = array(
+ 'clear_update_cache' => true,
+ );
+ $parsed_args = wp_parse_args( $args, $defaults );
+
+ $this->init();
+ $this->install_strings();
+
+ add_filter( 'upgrader_source_selection', array( $this, 'check_package' ) );
+ if ( $parsed_args['clear_update_cache'] ) {
+ // Clear cache so wp_update_plugins() knows about the new plugin.
+ add_action( 'upgrader_process_complete', 'wp_clean_plugins_cache', 9, 0 );
+ }
+
+ $this->run(
+ array(
+ 'package' => $package,
+ 'destination' => WP_PLUGIN_DIR,
+ 'clear_destination' => false, // Do not overwrite files.
+ 'clear_working' => true,
+ 'hook_extra' => array(
+ 'type' => 'plugin',
+ 'action' => 'install',
+ ),
+ )
+ );
+
+ remove_action( 'upgrader_process_complete', 'wp_clean_plugins_cache', 9 );
+ remove_filter( 'upgrader_source_selection', array( $this, 'check_package' ) );
+
+ if ( ! $this->result || is_wp_error( $this->result ) ) {
+ return $this->result;
+ }
+
+ // Force refresh of plugin update information
+ wp_clean_plugins_cache( $parsed_args['clear_update_cache'] );
+
+ return true;
+ }
+
+ /**
+ * Upgrade a plugin.
+ *
+ * @since 2.8.0
+ * @since 3.7.0 The `$args` parameter was added, making clearing the plugin update cache optional.
+ *
+ * @param string $plugin Path to the plugin file relative to the plugins directory.
+ * @param array $args {
+ * Optional. Other arguments for upgrading a plugin package. Default empty array.
+ *
+ * @type bool $clear_update_cache Whether to clear the plugin updates cache if successful.
+ * Default true.
+ * }
+ * @return bool|WP_Error True if the upgrade was successful, false or a WP_Error object otherwise.
+ */
+ public function upgrade( $plugin, $args = array() ) {
+
+ $defaults = array(
+ 'clear_update_cache' => true,
+ );
+ $parsed_args = wp_parse_args( $args, $defaults );
+
+ $this->init();
+ $this->upgrade_strings();
+
+ $current = get_site_transient( 'update_plugins' );
+ if ( ! isset( $current->response[ $plugin ] ) ) {
+ $this->skin->before();
+ $this->skin->set_result( false );
+ $this->skin->error( 'up_to_date' );
+ $this->skin->after();
+ return false;
+ }
+
+ // Get the URL to the zip file
+ $r = $current->response[ $plugin ];
+
+ add_filter( 'upgrader_pre_install', array( $this, 'deactivate_plugin_before_upgrade' ), 10, 2 );
+ add_filter( 'upgrader_clear_destination', array( $this, 'delete_old_plugin' ), 10, 4 );
+ //'source_selection' => array($this, 'source_selection'), //there's a trac ticket to move up the directory for zip's which are made a bit differently, useful for non-.org plugins.
+ if ( $parsed_args['clear_update_cache'] ) {
+ // Clear cache so wp_update_plugins() knows about the new plugin.
+ add_action( 'upgrader_process_complete', 'wp_clean_plugins_cache', 9, 0 );
+ }
+
+ $this->run(
+ array(
+ 'package' => $r->package,
+ 'destination' => WP_PLUGIN_DIR,
+ 'clear_destination' => true,
+ 'clear_working' => true,
+ 'hook_extra' => array(
+ 'plugin' => $plugin,
+ 'type' => 'plugin',
+ 'action' => 'update',
+ ),
+ )
+ );
+
+ // Cleanup our hooks, in case something else does a upgrade on this connection.
+ remove_action( 'upgrader_process_complete', 'wp_clean_plugins_cache', 9 );
+ remove_filter( 'upgrader_pre_install', array( $this, 'deactivate_plugin_before_upgrade' ) );
+ remove_filter( 'upgrader_clear_destination', array( $this, 'delete_old_plugin' ) );
+
+ if ( ! $this->result || is_wp_error( $this->result ) ) {
+ return $this->result;
+ }
+
+ // Force refresh of plugin update information
+ wp_clean_plugins_cache( $parsed_args['clear_update_cache'] );
+
+ return true;
+ }
+
+ /**
+ * Bulk upgrade several plugins at once.
+ *
+ * @since 2.8.0
+ * @since 3.7.0 The `$args` parameter was added, making clearing the plugin update cache optional.
+ *
+ * @param string[] $plugins Array of paths to plugin files relative to the plugins directory.
+ * @param array $args {
+ * Optional. Other arguments for upgrading several plugins at once.
+ *
+ * @type bool $clear_update_cache Whether to clear the plugin updates cache if successful. Default true.
+ * }
+ * @return array|false An array of results indexed by plugin file, or false if unable to connect to the filesystem.
+ */
+ public function bulk_upgrade( $plugins, $args = array() ) {
+
+ $defaults = array(
+ 'clear_update_cache' => true,
+ );
+ $parsed_args = wp_parse_args( $args, $defaults );
+
+ $this->init();
+ $this->bulk = true;
+ $this->upgrade_strings();
+
+ $current = get_site_transient( 'update_plugins' );
+
+ add_filter( 'upgrader_clear_destination', array( $this, 'delete_old_plugin' ), 10, 4 );
+
+ $this->skin->header();
+
+ // Connect to the Filesystem first.
+ $res = $this->fs_connect( array( WP_CONTENT_DIR, WP_PLUGIN_DIR ) );
+ if ( ! $res ) {
+ $this->skin->footer();
+ return false;
+ }
+
+ $this->skin->bulk_header();
+
+ /*
+ * Only start maintenance mode if:
+ * - running Multisite and there are one or more plugins specified, OR
+ * - a plugin with an update available is currently active.
+ * @TODO: For multisite, maintenance mode should only kick in for individual sites if at all possible.
+ */
+ $maintenance = ( is_multisite() && ! empty( $plugins ) );
+ foreach ( $plugins as $plugin ) {
+ $maintenance = $maintenance || ( is_plugin_active( $plugin ) && isset( $current->response[ $plugin ] ) );
+ }
+ if ( $maintenance ) {
+ $this->maintenance_mode( true );
+ }
+
+ $results = array();
+
+ $this->update_count = count( $plugins );
+ $this->update_current = 0;
+ foreach ( $plugins as $plugin ) {
+ $this->update_current++;
+ $this->skin->plugin_info = get_plugin_data( WP_PLUGIN_DIR . '/' . $plugin, false, true );
+
+ if ( ! isset( $current->response[ $plugin ] ) ) {
+ $this->skin->set_result( 'up_to_date' );
+ $this->skin->before();
+ $this->skin->feedback( 'up_to_date' );
+ $this->skin->after();
+ $results[ $plugin ] = true;
+ continue;
+ }
+
+ // Get the URL to the zip file.
+ $r = $current->response[ $plugin ];
+
+ $this->skin->plugin_active = is_plugin_active( $plugin );
+
+ $result = $this->run(
+ array(
+ 'package' => $r->package,
+ 'destination' => WP_PLUGIN_DIR,
+ 'clear_destination' => true,
+ 'clear_working' => true,
+ 'is_multi' => true,
+ 'hook_extra' => array(
+ 'plugin' => $plugin,
+ ),
+ )
+ );
+
+ $results[ $plugin ] = $this->result;
+
+ // Prevent credentials auth screen from displaying multiple times
+ if ( false === $result ) {
+ break;
+ }
+ } //end foreach $plugins
+
+ $this->maintenance_mode( false );
+
+ // Force refresh of plugin update information.
+ wp_clean_plugins_cache( $parsed_args['clear_update_cache'] );
+
+ /** This action is documented in wp-admin/includes/class-wp-upgrader.php */
+ do_action(
+ 'upgrader_process_complete',
+ $this,
+ array(
+ 'action' => 'update',
+ 'type' => 'plugin',
+ 'bulk' => true,
+ 'plugins' => $plugins,
+ )
+ );
+
+ $this->skin->bulk_footer();
+
+ $this->skin->footer();
+
+ // Cleanup our hooks, in case something else does a upgrade on this connection.
+ remove_filter( 'upgrader_clear_destination', array( $this, 'delete_old_plugin' ) );
+
+ return $results;
+ }
+
+ /**
+ * Check a source package to be sure it contains a plugin.
+ *
+ * This function is added to the {@see 'upgrader_source_selection'} filter by
+ * Plugin_Upgrader::install().
+ *
+ * @since 3.3.0
+ *
+ * @global WP_Filesystem_Base $wp_filesystem WordPress filesystem subclass.
+ *
+ * @param string $source The path to the downloaded package source.
+ * @return string|WP_Error The source as passed, or a WP_Error object
+ * if no plugins were found.
+ */
+ public function check_package( $source ) {
+ global $wp_filesystem;
+
+ if ( is_wp_error( $source ) ) {
+ return $source;
+ }
+
+ $working_directory = str_replace( $wp_filesystem->wp_content_dir(), trailingslashit( WP_CONTENT_DIR ), $source );
+ if ( ! is_dir( $working_directory ) ) { // Sanity check, if the above fails, let's not prevent installation.
+ return $source;
+ }
+
+ // Check the folder contains at least 1 valid plugin.
+ $plugins_found = false;
+ $files = glob( $working_directory . '*.php' );
+ if ( $files ) {
+ foreach ( $files as $file ) {
+ $info = get_plugin_data( $file, false, false );
+ if ( ! empty( $info['Name'] ) ) {
+ $plugins_found = true;
+ break;
+ }
+ }
+ }
+
+ if ( ! $plugins_found ) {
+ return new WP_Error( 'incompatible_archive_no_plugins', $this->strings['incompatible_archive'], __( 'No valid plugins were found.' ) );
+ }
+
+ return $source;
+ }
+
+ /**
+ * Retrieve the path to the file that contains the plugin info.
+ *
+ * This isn't used internally in the class, but is called by the skins.
+ *
+ * @since 2.8.0
+ *
+ * @return string|false The full path to the main plugin file, or false.
+ */
+ public function plugin_info() {
+ if ( ! is_array( $this->result ) ) {
+ return false;
+ }
+ if ( empty( $this->result['destination_name'] ) ) {
+ return false;
+ }
+
+ $plugin = get_plugins( '/' . $this->result['destination_name'] ); //Ensure to pass with leading slash
+ if ( empty( $plugin ) ) {
+ return false;
+ }
+
+ $pluginfiles = array_keys( $plugin ); //Assume the requested plugin is the first in the list
+
+ return $this->result['destination_name'] . '/' . $pluginfiles[0];
+ }
+
+ /**
+ * Deactivates a plugin before it is upgraded.
+ *
+ * Hooked to the {@see 'upgrader_pre_install'} filter by Plugin_Upgrader::upgrade().
+ *
+ * @since 2.8.0
+ * @since 4.1.0 Added a return value.
+ *
+ * @param bool|WP_Error $return Upgrade offer return.
+ * @param array $plugin Plugin package arguments.
+ * @return bool|WP_Error The passed in $return param or WP_Error.
+ */
+ public function deactivate_plugin_before_upgrade( $return, $plugin ) {
+
+ if ( is_wp_error( $return ) ) { //Bypass.
+ return $return;
+ }
+
+ // When in cron (background updates) don't deactivate the plugin, as we require a browser to reactivate it
+ if ( wp_doing_cron() ) {
+ return $return;
+ }
+
+ $plugin = isset( $plugin['plugin'] ) ? $plugin['plugin'] : '';
+ if ( empty( $plugin ) ) {
+ return new WP_Error( 'bad_request', $this->strings['bad_request'] );
+ }
+
+ if ( is_plugin_active( $plugin ) ) {
+ //Deactivate the plugin silently, Prevent deactivation hooks from running.
+ deactivate_plugins( $plugin, true );
+ }
+
+ return $return;
+ }
+
+ /**
+ * Delete the old plugin during an upgrade.
+ *
+ * Hooked to the {@see 'upgrader_clear_destination'} filter by
+ * Plugin_Upgrader::upgrade() and Plugin_Upgrader::bulk_upgrade().
+ *
+ * @since 2.8.0
+ *
+ * @global WP_Filesystem_Base $wp_filesystem WordPress filesystem subclass.
+ *
+ * @param bool|WP_Error $removed
+ * @param string $local_destination
+ * @param string $remote_destination
+ * @param array $plugin
+ * @return WP_Error|bool
+ */
+ public function delete_old_plugin( $removed, $local_destination, $remote_destination, $plugin ) {
+ global $wp_filesystem;
+
+ if ( is_wp_error( $removed ) ) {
+ return $removed; //Pass errors through.
+ }
+
+ $plugin = isset( $plugin['plugin'] ) ? $plugin['plugin'] : '';
+ if ( empty( $plugin ) ) {
+ return new WP_Error( 'bad_request', $this->strings['bad_request'] );
+ }
+
+ $plugins_dir = $wp_filesystem->wp_plugins_dir();
+ $this_plugin_dir = trailingslashit( dirname( $plugins_dir . $plugin ) );
+
+ if ( ! $wp_filesystem->exists( $this_plugin_dir ) ) { //If it's already vanished.
+ return $removed;
+ }
+
+ // If plugin is in its own directory, recursively delete the directory.
+ if ( strpos( $plugin, '/' ) && $this_plugin_dir != $plugins_dir ) { //base check on if plugin includes directory separator AND that it's not the root plugin folder
+ $deleted = $wp_filesystem->delete( $this_plugin_dir, true );
+ } else {
+ $deleted = $wp_filesystem->delete( $plugins_dir . $plugin );
+ }
+
+ if ( ! $deleted ) {
+ return new WP_Error( 'remove_old_failed', $this->strings['remove_old_failed'] );
+ }
+
+ return true;
+ }
+}
diff --git a/www/crm/wp-admin/includes/class-theme-installer-skin.php b/www/crm/wp-admin/includes/class-theme-installer-skin.php
new file mode 100644
index 00000000..5f62e2c0
--- /dev/null
+++ b/www/crm/wp-admin/includes/class-theme-installer-skin.php
@@ -0,0 +1,124 @@
+<?php
+/**
+ * Upgrader API: Theme_Installer_Skin class
+ *
+ * @package WordPress
+ * @subpackage Upgrader
+ * @since 4.6.0
+ */
+
+/**
+ * Theme Installer Skin for the WordPress Theme Installer.
+ *
+ * @since 2.8.0
+ * @since 4.6.0 Moved to its own file from wp-admin/includes/class-wp-upgrader-skins.php.
+ *
+ * @see WP_Upgrader_Skin
+ */
+class Theme_Installer_Skin extends WP_Upgrader_Skin {
+ public $api;
+ public $type;
+
+ /**
+ * @param array $args
+ */
+ public function __construct( $args = array() ) {
+ $defaults = array(
+ 'type' => 'web',
+ 'url' => '',
+ 'theme' => '',
+ 'nonce' => '',
+ 'title' => '',
+ );
+ $args = wp_parse_args( $args, $defaults );
+
+ $this->type = $args['type'];
+ $this->api = isset( $args['api'] ) ? $args['api'] : array();
+
+ parent::__construct( $args );
+ }
+
+ /**
+ */
+ public function before() {
+ if ( ! empty( $this->api ) ) {
+ $this->upgrader->strings['process_success'] = sprintf( $this->upgrader->strings['process_success_specific'], $this->api->name, $this->api->version );
+ }
+ }
+
+ /**
+ */
+ public function after() {
+ if ( empty( $this->upgrader->result['destination_name'] ) ) {
+ return;
+ }
+
+ $theme_info = $this->upgrader->theme_info();
+ if ( empty( $theme_info ) ) {
+ return;
+ }
+
+ $name = $theme_info->display( 'Name' );
+ $stylesheet = $this->upgrader->result['destination_name'];
+ $template = $theme_info->get_template();
+
+ $activate_link = add_query_arg(
+ array(
+ 'action' => 'activate',
+ 'template' => urlencode( $template ),
+ 'stylesheet' => urlencode( $stylesheet ),
+ ),
+ admin_url( 'themes.php' )
+ );
+ $activate_link = wp_nonce_url( $activate_link, 'switch-theme_' . $stylesheet );
+
+ $install_actions = array();
+
+ if ( current_user_can( 'edit_theme_options' ) && current_user_can( 'customize' ) ) {
+ $customize_url = add_query_arg(
+ array(
+ 'theme' => urlencode( $stylesheet ),
+ 'return' => urlencode( admin_url( 'web' === $this->type ? 'theme-install.php' : 'themes.php' ) ),
+ ),
+ admin_url( 'customize.php' )
+ );
+ $install_actions['preview'] = '<a href="' . esc_url( $customize_url ) . '" class="hide-if-no-customize load-customize">';
+ $install_actions['preview'] .= '<span aria-hidden="true">' . __( 'Live Preview' ) . '</span>';
+ /* translators: %s: theme name */
+ $install_actions['preview'] .= '<span class="screen-reader-text">' . sprintf( __( 'Live Preview &#8220;%s&#8221;' ), $name ) . '</span></a>';
+ }
+ $install_actions['activate'] = '<a href="' . esc_url( $activate_link ) . '" class="activatelink">';
+ $install_actions['activate'] .= '<span aria-hidden="true">' . __( 'Activate' ) . '</span>';
+ /* translators: %s: theme name */
+ $install_actions['activate'] .= '<span class="screen-reader-text">' . sprintf( __( 'Activate &#8220;%s&#8221;' ), $name ) . '</span></a>';
+
+ if ( is_network_admin() && current_user_can( 'manage_network_themes' ) ) {
+ $install_actions['network_enable'] = '<a href="' . esc_url( wp_nonce_url( 'themes.php?action=enable&amp;theme=' . urlencode( $stylesheet ), 'enable-theme_' . $stylesheet ) ) . '" target="_parent">' . __( 'Network Enable' ) . '</a>';
+ }
+
+ if ( $this->type == 'web' ) {
+ $install_actions['themes_page'] = '<a href="' . self_admin_url( 'theme-install.php' ) . '" target="_parent">' . __( 'Return to Theme Installer' ) . '</a>';
+ } elseif ( current_user_can( 'switch_themes' ) || current_user_can( 'edit_theme_options' ) ) {
+ $install_actions['themes_page'] = '<a href="' . self_admin_url( 'themes.php' ) . '" target="_parent">' . __( 'Return to Themes page' ) . '</a>';
+ }
+
+ if ( ! $this->result || is_wp_error( $this->result ) || is_network_admin() || ! current_user_can( 'switch_themes' ) ) {
+ unset( $install_actions['activate'], $install_actions['preview'] );
+ }
+
+ /**
+ * Filters the list of action links available following a single theme installation.
+ *
+ * @since 2.8.0
+ *
+ * @param string[] $install_actions Array of theme action links.
+ * @param object $api Object containing WordPress.org API theme data.
+ * @param string $stylesheet Theme directory name.
+ * @param WP_Theme $theme_info Theme object.
+ */
+ $install_actions = apply_filters( 'install_theme_complete_actions', $install_actions, $this->api, $stylesheet, $theme_info );
+ if ( ! empty( $install_actions ) ) {
+ $this->feedback( implode( ' | ', (array) $install_actions ) );
+ }
+ }
+}
diff --git a/www/crm/wp-admin/includes/class-theme-upgrader-skin.php b/www/crm/wp-admin/includes/class-theme-upgrader-skin.php
new file mode 100644
index 00000000..062297df
--- /dev/null
+++ b/www/crm/wp-admin/includes/class-theme-upgrader-skin.php
@@ -0,0 +1,107 @@
+<?php
+/**
+ * Upgrader API: Theme_Upgrader_Skin class
+ *
+ * @package WordPress
+ * @subpackage Upgrader
+ * @since 4.6.0
+ */
+
+/**
+ * Theme Upgrader Skin for WordPress Theme Upgrades.
+ *
+ * @since 2.8.0
+ * @since 4.6.0 Moved to its own file from wp-admin/includes/class-wp-upgrader-skins.php.
+ *
+ * @see WP_Upgrader_Skin
+ */
+class Theme_Upgrader_Skin extends WP_Upgrader_Skin {
+ public $theme = '';
+
+ /**
+ * @param array $args
+ */
+ public function __construct( $args = array() ) {
+ $defaults = array(
+ 'url' => '',
+ 'theme' => '',
+ 'nonce' => '',
+ 'title' => __( 'Update Theme' ),
+ );
+ $args = wp_parse_args( $args, $defaults );
+
+ $this->theme = $args['theme'];
+
+ parent::__construct( $args );
+ }
+
+ /**
+ */
+ public function after() {
+ $this->decrement_update_count( 'theme' );
+
+ $update_actions = array();
+ if ( ! empty( $this->upgrader->result['destination_name'] ) && $theme_info = $this->upgrader->theme_info() ) {
+ $name = $theme_info->display( 'Name' );
+ $stylesheet = $this->upgrader->result['destination_name'];
+ $template = $theme_info->get_template();
+
+ $activate_link = add_query_arg(
+ array(
+ 'action' => 'activate',
+ 'template' => urlencode( $template ),
+ 'stylesheet' => urlencode( $stylesheet ),
+ ),
+ admin_url( 'themes.php' )
+ );
+ $activate_link = wp_nonce_url( $activate_link, 'switch-theme_' . $stylesheet );
+
+ $customize_url = add_query_arg(
+ array(
+ 'theme' => urlencode( $stylesheet ),
+ 'return' => urlencode( admin_url( 'themes.php' ) ),
+ ),
+ admin_url( 'customize.php' )
+ );
+ if ( get_stylesheet() == $stylesheet ) {
+ if ( current_user_can( 'edit_theme_options' ) && current_user_can( 'customize' ) ) {
+ $update_actions['preview'] = '<a href="' . esc_url( $customize_url ) . '" class="hide-if-no-customize load-customize">';
+ $update_actions['preview'] .= '<span aria-hidden="true">' . __( 'Customize' ) . '</span>';
+ /* translators: %s: theme name */
+ $update_actions['preview'] .= '<span class="screen-reader-text">' . sprintf( __( 'Customize &#8220;%s&#8221;' ), $name ) . '</span></a>';
+ }
+ } elseif ( current_user_can( 'switch_themes' ) ) {
+ if ( current_user_can( 'edit_theme_options' ) && current_user_can( 'customize' ) ) {
+ $update_actions['preview'] = '<a href="' . esc_url( $customize_url ) . '" class="hide-if-no-customize load-customize">';
+ $update_actions['preview'] .= '<span aria-hidden="true">' . __( 'Live Preview' ) . '</span>';
+ /* translators: %s: theme name */
+ $update_actions['preview'] .= '<span class="screen-reader-text">' . sprintf( __( 'Live Preview &#8220;%s&#8221;' ), $name ) . '</span></a>';
+ }
+ $update_actions['activate'] = '<a href="' . esc_url( $activate_link ) . '" class="activatelink">';
+ $update_actions['activate'] .= '<span aria-hidden="true">' . __( 'Activate' ) . '</span>';
+ /* translators: %s: theme name */
+ $update_actions['activate'] .= '<span class="screen-reader-text">' . sprintf( __( 'Activate &#8220;%s&#8221;' ), $name ) . '</span></a>';
+ }
+
+ if ( ! $this->result || is_wp_error( $this->result ) || is_network_admin() ) {
+ unset( $update_actions['preview'], $update_actions['activate'] );
+ }
+ }
+
+ $update_actions['themes_page'] = '<a href="' . self_admin_url( 'themes.php' ) . '" target="_parent">' . __( 'Return to Themes page' ) . '</a>';
+
+ /**
+ * Filters the list of action links available following a single theme update.
+ *
+ * @since 2.8.0
+ *
+ * @param string[] $update_actions Array of theme action links.
+ * @param string $theme Theme directory name.
+ */
+ $update_actions = apply_filters( 'update_theme_complete_actions', $update_actions, $this->theme );
+
+ if ( ! empty( $update_actions ) ) {
+ $this->feedback( implode( ' | ', (array) $update_actions ) );
+ }
+ }
+}
diff --git a/www/crm/wp-admin/includes/class-theme-upgrader.php b/www/crm/wp-admin/includes/class-theme-upgrader.php
new file mode 100644
index 00000000..7b521063
--- /dev/null
+++ b/www/crm/wp-admin/includes/class-theme-upgrader.php
@@ -0,0 +1,648 @@
+<?php
+/**
+ * Upgrade API: Theme_Upgrader class
+ *
+ * @package WordPress
+ * @subpackage Upgrader
+ * @since 4.6.0
+ */
+
+/**
+ * Core class used for upgrading/installing themes.
+ *
+ * It is designed to upgrade/install themes from a local zip, remote zip URL,
+ * or uploaded zip file.
+ *
+ * @since 2.8.0
+ * @since 4.6.0 Moved to its own file from wp-admin/includes/class-wp-upgrader.php.
+ *
+ * @see WP_Upgrader
+ */
+class Theme_Upgrader extends WP_Upgrader {
+
+ /**
+ * Result of the theme upgrade offer.
+ *
+ * @since 2.8.0
+ * @var array|WP_Error $result
+ * @see WP_Upgrader::$result
+ */
+ public $result;
+
+ /**
+ * Whether multiple themes are being upgraded/installed in bulk.
+ *
+ * @since 2.9.0
+ * @var bool $bulk
+ */
+ public $bulk = false;
+
+ /**
+ * Initialize the upgrade strings.
+ *
+ * @since 2.8.0
+ */
+ public function upgrade_strings() {
+ $this->strings['up_to_date'] = __( 'The theme is at the latest version.' );
+ $this->strings['no_package'] = __( 'Update package not available.' );
+ /* translators: %s: package URL */
+ $this->strings['downloading_package'] = sprintf( __( 'Downloading update from %s&#8230;' ), '<span class="code">%s</span>' );
+ $this->strings['unpack_package'] = __( 'Unpacking the update&#8230;' );
+ $this->strings['remove_old'] = __( 'Removing the old version of the theme&#8230;' );
+ $this->strings['remove_old_failed'] = __( 'Could not remove the old theme.' );
+ $this->strings['process_failed'] = __( 'Theme update failed.' );
+ $this->strings['process_success'] = __( 'Theme updated successfully.' );
+ }
+
+ /**
+ * Initialize the installation strings.
+ *
+ * @since 2.8.0
+ */
+ public function install_strings() {
+ $this->strings['no_package'] = __( 'Installation package not available.' );
+ /* translators: %s: package URL */
+ $this->strings['downloading_package'] = sprintf( __( 'Downloading installation package from %s&#8230;' ), '<span class="code">%s</span>' );
+ $this->strings['unpack_package'] = __( 'Unpacking the package&#8230;' );
+ $this->strings['installing_package'] = __( 'Installing the theme&#8230;' );
+ $this->strings['no_files'] = __( 'The theme contains no files.' );
+ $this->strings['process_failed'] = __( 'Theme installation failed.' );
+ $this->strings['process_success'] = __( 'Theme installed successfully.' );
+ /* translators: 1: theme name, 2: version */
+ $this->strings['process_success_specific'] = __( 'Successfully installed the theme <strong>%1$s %2$s</strong>.' );
+ $this->strings['parent_theme_search'] = __( 'This theme requires a parent theme. Checking if it is installed&#8230;' );
+ /* translators: 1: theme name, 2: version */
+ $this->strings['parent_theme_prepare_install'] = __( 'Preparing to install <strong>%1$s %2$s</strong>&#8230;' );
+ /* translators: 1: theme name, 2: version */
+ $this->strings['parent_theme_currently_installed'] = __( 'The parent theme, <strong>%1$s %2$s</strong>, is currently installed.' );
+ /* translators: 1: theme name, 2: version */
+ $this->strings['parent_theme_install_success'] = __( 'Successfully installed the parent theme, <strong>%1$s %2$s</strong>.' );
+ /* translators: %s: theme name */
+ $this->strings['parent_theme_not_found'] = sprintf( __( '<strong>The parent theme could not be found.</strong> You will need to install the parent theme, %s, before you can use this child theme.' ), '<strong>%s</strong>' );
+ }
+
+ /**
+ * Check if a child theme is being installed and we need to install its parent.
+ *
+ * Hooked to the {@see 'upgrader_post_install'} filter by Theme_Upgrader::install().
+ *
+ * @since 3.4.0
+ *
+ * @param bool $install_result
+ * @param array $hook_extra
+ * @param array $child_result
+ * @return type
+ */
+ public function check_parent_theme_filter( $install_result, $hook_extra, $child_result ) {
+ // Check to see if we need to install a parent theme
+ $theme_info = $this->theme_info();
+
+ if ( ! $theme_info->parent() ) {
+ return $install_result;
+ }
+
+ $this->skin->feedback( 'parent_theme_search' );
+
+ if ( ! $theme_info->parent()->errors() ) {
+ $this->skin->feedback( 'parent_theme_currently_installed', $theme_info->parent()->display( 'Name' ), $theme_info->parent()->display( 'Version' ) );
+ // We already have the theme, fall through.
+ return $install_result;
+ }
+
+ // We don't have the parent theme, let's install it.
+ $api = themes_api(
+ 'theme_information',
+ array(
+ 'slug' => $theme_info->get( 'Template' ),
+ 'fields' => array(
+ 'sections' => false,
+ 'tags' => false,
+ ),
+ )
+ ); //Save on a bit of bandwidth.
+
+ if ( ! $api || is_wp_error( $api ) ) {
+ $this->skin->feedback( 'parent_theme_not_found', $theme_info->get( 'Template' ) );
+ // Don't show activate or preview actions after installation
+ add_filter( 'install_theme_complete_actions', array( $this, 'hide_activate_preview_actions' ) );
+ return $install_result;
+ }
+
+ // Backup required data we're going to override:
+ $child_api = $this->skin->api;
+ $child_success_message = $this->strings['process_success'];
+
+ // Override them
+ $this->skin->api = $api;
+ $this->strings['process_success_specific'] = $this->strings['parent_theme_install_success'];//, $api->name, $api->version);
+
+ $this->skin->feedback( 'parent_theme_prepare_install', $api->name, $api->version );
+
+ add_filter( 'install_theme_complete_actions', '__return_false', 999 ); // Don't show any actions after installing the theme.
+
+ // Install the parent theme
+ $parent_result = $this->run(
+ array(
+ 'package' => $api->download_link,
+ 'destination' => get_theme_root(),
+ 'clear_destination' => false, //Do not overwrite files.
+ 'clear_working' => true,
+ )
+ );
+
+ if ( is_wp_error( $parent_result ) ) {
+ add_filter( 'install_theme_complete_actions', array( $this, 'hide_activate_preview_actions' ) );
+ }
+
+ // Start cleaning up after the parents installation
+ remove_filter( 'install_theme_complete_actions', '__return_false', 999 );
+
+ // Reset child's result and data
+ $this->result = $child_result;
+ $this->skin->api = $child_api;
+ $this->strings['process_success'] = $child_success_message;
+
+ return $install_result;
+ }
+
+ /**
+ * Don't display the activate and preview actions to the user.
+ *
+ * Hooked to the {@see 'install_theme_complete_actions'} filter by
+ * Theme_Upgrader::check_parent_theme_filter() when installing
+ * a child theme and installing the parent theme fails.
+ *
+ * @since 3.4.0
+ *
+ * @param array $actions Preview actions.
+ * @return array
+ */
+ public function hide_activate_preview_actions( $actions ) {
+ unset( $actions['activate'], $actions['preview'] );
+ return $actions;
+ }
+
+ /**
+ * Install a theme package.
+ *
+ * @since 2.8.0
+ * @since 3.7.0 The `$args` parameter was added, making clearing the update cache optional.
+ *
+ * @param string $package The full local path or URI of the package.
+ * @param array $args {
+ * Optional. Other arguments for installing a theme package. Default empty array.
+ *
+ * @type bool $clear_update_cache Whether to clear the updates cache if successful.
+ * Default true.
+ * }
+ *
+ * @return bool|WP_Error True if the installation was successful, false or a WP_Error object otherwise.
+ */
+ public function install( $package, $args = array() ) {
+
+ $defaults = array(
+ 'clear_update_cache' => true,
+ );
+ $parsed_args = wp_parse_args( $args, $defaults );
+
+ $this->init();
+ $this->install_strings();
+
+ add_filter( 'upgrader_source_selection', array( $this, 'check_package' ) );
+ add_filter( 'upgrader_post_install', array( $this, 'check_parent_theme_filter' ), 10, 3 );
+ if ( $parsed_args['clear_update_cache'] ) {
+ // Clear cache so wp_update_themes() knows about the new theme.
+ add_action( 'upgrader_process_complete', 'wp_clean_themes_cache', 9, 0 );
+ }
+
+ $this->run(
+ array(
+ 'package' => $package,
+ 'destination' => get_theme_root(),
+ 'clear_destination' => false, //Do not overwrite files.
+ 'clear_working' => true,
+ 'hook_extra' => array(
+ 'type' => 'theme',
+ 'action' => 'install',
+ ),
+ )
+ );
+
+ remove_action( 'upgrader_process_complete', 'wp_clean_themes_cache', 9 );
+ remove_filter( 'upgrader_source_selection', array( $this, 'check_package' ) );
+ remove_filter( 'upgrader_post_install', array( $this, 'check_parent_theme_filter' ) );
+
+ if ( ! $this->result || is_wp_error( $this->result ) ) {
+ return $this->result;
+ }
+
+ // Refresh the Theme Update information
+ wp_clean_themes_cache( $parsed_args['clear_update_cache'] );
+
+ return true;
+ }
+
+ /**
+ * Upgrade a theme.
+ *
+ * @since 2.8.0
+ * @since 3.7.0 The `$args` parameter was added, making clearing the update cache optional.
+ *
+ * @param string $theme The theme slug.
+ * @param array $args {
+ * Optional. Other arguments for upgrading a theme. Default empty array.
+ *
+ * @type bool $clear_update_cache Whether to clear the update cache if successful.
+ * Default true.
+ * }
+ * @return bool|WP_Error True if the upgrade was successful, false or a WP_Error object otherwise.
+ */
+ public function upgrade( $theme, $args = array() ) {
+
+ $defaults = array(
+ 'clear_update_cache' => true,
+ );
+ $parsed_args = wp_parse_args( $args, $defaults );
+
+ $this->init();
+ $this->upgrade_strings();
+
+ // Is an update available?
+ $current = get_site_transient( 'update_themes' );
+ if ( ! isset( $current->response[ $theme ] ) ) {
+ $this->skin->before();
+ $this->skin->set_result( false );
+ $this->skin->error( 'up_to_date' );
+ $this->skin->after();
+ return false;
+ }
+
+ $r = $current->response[ $theme ];
+
+ add_filter( 'upgrader_pre_install', array( $this, 'current_before' ), 10, 2 );
+ add_filter( 'upgrader_post_install', array( $this, 'current_after' ), 10, 2 );
+ add_filter( 'upgrader_clear_destination', array( $this, 'delete_old_theme' ), 10, 4 );
+ if ( $parsed_args['clear_update_cache'] ) {
+ // Clear cache so wp_update_themes() knows about the new theme.
+ add_action( 'upgrader_process_complete', 'wp_clean_themes_cache', 9, 0 );
+ }
+
+ $this->run(
+ array(
+ 'package' => $r['package'],
+ 'destination' => get_theme_root( $theme ),
+ 'clear_destination' => true,
+ 'clear_working' => true,
+ 'hook_extra' => array(
+ 'theme' => $theme,
+ 'type' => 'theme',
+ 'action' => 'update',
+ ),
+ )
+ );
+
+ remove_action( 'upgrader_process_complete', 'wp_clean_themes_cache', 9 );
+ remove_filter( 'upgrader_pre_install', array( $this, 'current_before' ) );
+ remove_filter( 'upgrader_post_install', array( $this, 'current_after' ) );
+ remove_filter( 'upgrader_clear_destination', array( $this, 'delete_old_theme' ) );
+
+ if ( ! $this->result || is_wp_error( $this->result ) ) {
+ return $this->result;
+ }
+
+ wp_clean_themes_cache( $parsed_args['clear_update_cache'] );
+
+ return true;
+ }
+
+ /**
+ * Upgrade several themes at once.
+ *
+ * @since 3.0.0
+ * @since 3.7.0 The `$args` parameter was added, making clearing the update cache optional.
+ *
+ * @param string[] $themes Array of the theme slugs.
+ * @param array $args {
+ * Optional. Other arguments for upgrading several themes at once. Default empty array.
+ *
+ * @type bool $clear_update_cache Whether to clear the update cache if successful.
+ * Default true.
+ * }
+ * @return array[]|false An array of results, or false if unable to connect to the filesystem.
+ */
+ public function bulk_upgrade( $themes, $args = array() ) {
+
+ $defaults = array(
+ 'clear_update_cache' => true,
+ );
+ $parsed_args = wp_parse_args( $args, $defaults );
+
+ $this->init();
+ $this->bulk = true;
+ $this->upgrade_strings();
+
+ $current = get_site_transient( 'update_themes' );
+
+ add_filter( 'upgrader_pre_install', array( $this, 'current_before' ), 10, 2 );
+ add_filter( 'upgrader_post_install', array( $this, 'current_after' ), 10, 2 );
+ add_filter( 'upgrader_clear_destination', array( $this, 'delete_old_theme' ), 10, 4 );
+
+ $this->skin->header();
+
+ // Connect to the Filesystem first.
+ $res = $this->fs_connect( array( WP_CONTENT_DIR ) );
+ if ( ! $res ) {
+ $this->skin->footer();
+ return false;
+ }
+
+ $this->skin->bulk_header();
+
+ // Only start maintenance mode if:
+ // - running Multisite and there are one or more themes specified, OR
+ // - a theme with an update available is currently in use.
+ // @TODO: For multisite, maintenance mode should only kick in for individual sites if at all possible.
+ $maintenance = ( is_multisite() && ! empty( $themes ) );
+ foreach ( $themes as $theme ) {
+ $maintenance = $maintenance || $theme == get_stylesheet() || $theme == get_template();
+ }
+ if ( $maintenance ) {
+ $this->maintenance_mode( true );
+ }
+
+ $results = array();
+
+ $this->update_count = count( $themes );
+ $this->update_current = 0;
+ foreach ( $themes as $theme ) {
+ $this->update_current++;
+
+ $this->skin->theme_info = $this->theme_info( $theme );
+
+ if ( ! isset( $current->response[ $theme ] ) ) {
+ $this->skin->set_result( true );
+ $this->skin->before();
+ $this->skin->feedback( 'up_to_date' );
+ $this->skin->after();
+ $results[ $theme ] = true;
+ continue;
+ }
+
+ // Get the URL to the zip file
+ $r = $current->response[ $theme ];
+
+ $result = $this->run(
+ array(
+ 'package' => $r['package'],
+ 'destination' => get_theme_root( $theme ),
+ 'clear_destination' => true,
+ 'clear_working' => true,
+ 'is_multi' => true,
+ 'hook_extra' => array(
+ 'theme' => $theme,
+ ),
+ )
+ );
+
+ $results[ $theme ] = $this->result;
+
+ // Prevent credentials auth screen from displaying multiple times
+ if ( false === $result ) {
+ break;
+ }
+ } //end foreach $plugins
+
+ $this->maintenance_mode( false );
+
+ // Refresh the Theme Update information
+ wp_clean_themes_cache( $parsed_args['clear_update_cache'] );
+
+ /** This action is documented in wp-admin/includes/class-wp-upgrader.php */
+ do_action(
+ 'upgrader_process_complete',
+ $this,
+ array(
+ 'action' => 'update',
+ 'type' => 'theme',
+ 'bulk' => true,
+ 'themes' => $themes,
+ )
+ );
+
+ $this->skin->bulk_footer();
+
+ $this->skin->footer();
+
+ // Cleanup our hooks, in case something else does a upgrade on this connection.
+ remove_filter( 'upgrader_pre_install', array( $this, 'current_before' ) );
+ remove_filter( 'upgrader_post_install', array( $this, 'current_after' ) );
+ remove_filter( 'upgrader_clear_destination', array( $this, 'delete_old_theme' ) );
+
+ return $results;
+ }
+
+ /**
+ * Check that the package source contains a valid theme.
+ *
+ * Hooked to the {@see 'upgrader_source_selection'} filter by Theme_Upgrader::install().
+ * It will return an error if the theme doesn't have style.css or index.php
+ * files.
+ *
+ * @since 3.3.0
+ *
+ * @global WP_Filesystem_Base $wp_filesystem WordPress filesystem subclass.
+ *
+ * @param string $source The full path to the package source.
+ * @return string|WP_Error The source or a WP_Error.
+ */
+ public function check_package( $source ) {
+ global $wp_filesystem;
+
+ if ( is_wp_error( $source ) ) {
+ return $source;
+ }
+
+ // Check the folder contains a valid theme
+ $working_directory = str_replace( $wp_filesystem->wp_content_dir(), trailingslashit( WP_CONTENT_DIR ), $source );
+ if ( ! is_dir( $working_directory ) ) { // Sanity check, if the above fails, let's not prevent installation.
+ return $source;
+ }
+
+ // A proper archive should have a style.css file in the single subdirectory
+ if ( ! file_exists( $working_directory . 'style.css' ) ) {
+ return new WP_Error(
+ 'incompatible_archive_theme_no_style',
+ $this->strings['incompatible_archive'],
+ sprintf(
+ /* translators: %s: style.css */
+ __( 'The theme is missing the %s stylesheet.' ),
+ '<code>style.css</code>'
+ )
+ );
+ }
+
+ $info = get_file_data(
+ $working_directory . 'style.css',
+ array(
+ 'Name' => 'Theme Name',
+ 'Template' => 'Template',
+ )
+ );
+
+ if ( empty( $info['Name'] ) ) {
+ return new WP_Error(
+ 'incompatible_archive_theme_no_name',
+ $this->strings['incompatible_archive'],
+ sprintf(
+ /* translators: %s: style.css */
+ __( 'The %s stylesheet doesn&#8217;t contain a valid theme header.' ),
+ '<code>style.css</code>'
+ )
+ );
+ }
+
+ // If it's not a child theme, it must have at least an index.php to be legit.
+ if ( empty( $info['Template'] ) && ! file_exists( $working_directory . 'index.php' ) ) {
+ return new WP_Error(
+ 'incompatible_archive_theme_no_index',
+ $this->strings['incompatible_archive'],
+ sprintf(
+ /* translators: %s: index.php */
+ __( 'The theme is missing the %s file.' ),
+ '<code>index.php</code>'
+ )
+ );
+ }
+
+ return $source;
+ }
+
+ /**
+ * Turn on maintenance mode before attempting to upgrade the current theme.
+ *
+ * Hooked to the {@see 'upgrader_pre_install'} filter by Theme_Upgrader::upgrade() and
+ * Theme_Upgrader::bulk_upgrade().
+ *
+ * @since 2.8.0
+ *
+ * @param bool|WP_Error $return
+ * @param array $theme
+ * @return bool|WP_Error
+ */
+ public function current_before( $return, $theme ) {
+ if ( is_wp_error( $return ) ) {
+ return $return;
+ }
+
+ $theme = isset( $theme['theme'] ) ? $theme['theme'] : '';
+
+ if ( $theme != get_stylesheet() ) { //If not current
+ return $return;
+ }
+ //Change to maintenance mode now.
+ if ( ! $this->bulk ) {
+ $this->maintenance_mode( true );
+ }
+
+ return $return;
+ }
+
+ /**
+ * Turn off maintenance mode after upgrading the current theme.
+ *
+ * Hooked to the {@see 'upgrader_post_install'} filter by Theme_Upgrader::upgrade()
+ * and Theme_Upgrader::bulk_upgrade().
+ *
+ * @since 2.8.0
+ *
+ * @param bool|WP_Error $return
+ * @param array $theme
+ * @return bool|WP_Error
+ */
+ public function current_after( $return, $theme ) {
+ if ( is_wp_error( $return ) ) {
+ return $return;
+ }
+
+ $theme = isset( $theme['theme'] ) ? $theme['theme'] : '';
+
+ if ( $theme != get_stylesheet() ) { // If not current
+ return $return;
+ }
+
+ // Ensure stylesheet name hasn't changed after the upgrade:
+ if ( $theme == get_stylesheet() && $theme != $this->result['destination_name'] ) {
+ wp_clean_themes_cache();
+ $stylesheet = $this->result['destination_name'];
+ switch_theme( $stylesheet );
+ }
+
+ //Time to remove maintenance mode
+ if ( ! $this->bulk ) {
+ $this->maintenance_mode( false );
+ }
+ return $return;
+ }
+
+ /**
+ * Delete the old theme during an upgrade.
+ *
+ * Hooked to the {@see 'upgrader_clear_destination'} filter by Theme_Upgrader::upgrade()
+ * and Theme_Upgrader::bulk_upgrade().
+ *
+ * @since 2.8.0
+ *
+ * @global WP_Filesystem_Base $wp_filesystem Subclass
+ *
+ * @param bool $removed
+ * @param string $local_destination
+ * @param string $remote_destination
+ * @param array $theme
+ * @return bool
+ */
+ public function delete_old_theme( $removed, $local_destination, $remote_destination, $theme ) {
+ global $wp_filesystem;
+
+ if ( is_wp_error( $removed ) ) {
+ return $removed; // Pass errors through.
+ }
+
+ if ( ! isset( $theme['theme'] ) ) {
+ return $removed;
+ }
+
+ $theme = $theme['theme'];
+ $themes_dir = trailingslashit( $wp_filesystem->wp_themes_dir( $theme ) );
+ if ( $wp_filesystem->exists( $themes_dir . $theme ) ) {
+ if ( ! $wp_filesystem->delete( $themes_dir . $theme, true ) ) {
+ return false;
+ }
+ }
+
+ return true;
+ }
+
+ /**
+ * Get the WP_Theme object for a theme.
+ *
+ * @since 2.8.0
+ * @since 3.0.0 The `$theme` argument was added.
+ *
+ * @param string $theme The directory name of the theme. This is optional, and if not supplied,
+ * the directory name from the last result will be used.
+ * @return WP_Theme|false The theme's info object, or false `$theme` is not supplied
+ * and the last result isn't set.
+ */
+ public function theme_info( $theme = null ) {
+
+ if ( empty( $theme ) ) {
+ if ( ! empty( $this->result['destination_name'] ) ) {
+ $theme = $this->result['destination_name'];
+ } else {
+ return false;
+ }
+ }
+ return wp_get_theme( $theme );
+ }
+
+}
diff --git a/www/crm/wp-admin/includes/class-walker-category-checklist.php b/www/crm/wp-admin/includes/class-walker-category-checklist.php
new file mode 100644
index 00000000..d8719deb
--- /dev/null
+++ b/www/crm/wp-admin/includes/class-walker-category-checklist.php
@@ -0,0 +1,128 @@
+<?php
+/**
+ * Taxonomy API: Walker_Category_Checklist class
+ *
+ * @package WordPress
+ * @subpackage Administration
+ * @since 4.4.0
+ */
+
+/**
+ * Core walker class to output an unordered list of category checkbox input elements.
+ *
+ * @since 2.5.1
+ *
+ * @see Walker
+ * @see wp_category_checklist()
+ * @see wp_terms_checklist()
+ */
+class Walker_Category_Checklist extends Walker {
+ public $tree_type = 'category';
+ public $db_fields = array(
+ 'parent' => 'parent',
+ 'id' => 'term_id',
+ ); //TODO: decouple this
+
+ /**
+ * Starts the list before the elements are added.
+ *
+ * @see Walker:start_lvl()
+ *
+ * @since 2.5.1
+ *
+ * @param string $output Used to append additional content (passed by reference).
+ * @param int $depth Depth of category. Used for tab indentation.
+ * @param array $args An array of arguments. @see wp_terms_checklist()
+ */
+ public function start_lvl( &$output, $depth = 0, $args = array() ) {
+ $indent = str_repeat( "\t", $depth );
+ $output .= "$indent<ul class='children'>\n";
+ }
+
+ /**
+ * Ends the list of after the elements are added.
+ *
+ * @see Walker::end_lvl()
+ *
+ * @since 2.5.1
+ *
+ * @param string $output Used to append additional content (passed by reference).
+ * @param int $depth Depth of category. Used for tab indentation.
+ * @param array $args An array of arguments. @see wp_terms_checklist()
+ */
+ public function end_lvl( &$output, $depth = 0, $args = array() ) {
+ $indent = str_repeat( "\t", $depth );
+ $output .= "$indent</ul>\n";
+ }
+
+ /**
+ * Start the element output.
+ *
+ * @see Walker::start_el()
+ *
+ * @since 2.5.1
+ *
+ * @param string $output Used to append additional content (passed by reference).
+ * @param object $category The current term object.
+ * @param int $depth Depth of the term in reference to parents. Default 0.
+ * @param array $args An array of arguments. @see wp_terms_checklist()
+ * @param int $id ID of the current term.
+ */
+ public function start_el( &$output, $category, $depth = 0, $args = array(), $id = 0 ) {
+ if ( empty( $args['taxonomy'] ) ) {
+ $taxonomy = 'category';
+ } else {
+ $taxonomy = $args['taxonomy'];
+ }
+
+ if ( $taxonomy == 'category' ) {
+ $name = 'post_category';
+ } else {
+ $name = 'tax_input[' . $taxonomy . ']';
+ }
+
+ $args['popular_cats'] = empty( $args['popular_cats'] ) ? array() : $args['popular_cats'];
+ $class = in_array( $category->term_id, $args['popular_cats'] ) ? ' class="popular-category"' : '';
+
+ $args['selected_cats'] = empty( $args['selected_cats'] ) ? array() : $args['selected_cats'];
+
+ if ( ! empty( $args['list_only'] ) ) {
+ $aria_checked = 'false';
+ $inner_class = 'category';
+
+ if ( in_array( $category->term_id, $args['selected_cats'] ) ) {
+ $inner_class .= ' selected';
+ $aria_checked = 'true';
+ }
+
+ /** This filter is documented in wp-includes/category-template.php */
+ $output .= "\n" . '<li' . $class . '>' .
+ '<div class="' . $inner_class . '" data-term-id=' . $category->term_id .
+ ' tabindex="0" role="checkbox" aria-checked="' . $aria_checked . '">' .
+ esc_html( apply_filters( 'the_category', $category->name, '', '' ) ) . '</div>';
+ } else {
+ /** This filter is documented in wp-includes/category-template.php */
+ $output .= "\n<li id='{$taxonomy}-{$category->term_id}'$class>" .
+ '<label class="selectit"><input value="' . $category->term_id . '" type="checkbox" name="' . $name . '[]" id="in-' . $taxonomy . '-' . $category->term_id . '"' .
+ checked( in_array( $category->term_id, $args['selected_cats'] ), true, false ) .
+ disabled( empty( $args['disabled'] ), false, false ) . ' /> ' .
+ esc_html( apply_filters( 'the_category', $category->name, '', '' ) ) . '</label>';
+ }
+ }
+
+ /**
+ * Ends the element output, if needed.
+ *
+ * @see Walker::end_el()
+ *
+ * @since 2.5.1
+ *
+ * @param string $output Used to append additional content (passed by reference).
+ * @param object $category The current term object.
+ * @param int $depth Depth of the term in reference to parents. Default 0.
+ * @param array $args An array of arguments. @see wp_terms_checklist()
+ */
+ public function end_el( &$output, $category, $depth = 0, $args = array() ) {
+ $output .= "</li>\n";
+ }
+}
diff --git a/www/crm/wp-admin/includes/class-walker-nav-menu-checklist.php b/www/crm/wp-admin/includes/class-walker-nav-menu-checklist.php
new file mode 100644
index 00000000..994cc040
--- /dev/null
+++ b/www/crm/wp-admin/includes/class-walker-nav-menu-checklist.php
@@ -0,0 +1,119 @@
+<?php
+/**
+ * Navigation Menu API: Walker_Nav_Menu_Checklist class
+ *
+ * @package WordPress
+ * @subpackage Administration
+ * @since 4.4.0
+ */
+
+/**
+ * Create HTML list of nav menu input items.
+ *
+ * @since 3.0.0
+ * @uses Walker_Nav_Menu
+ */
+class Walker_Nav_Menu_Checklist extends Walker_Nav_Menu {
+ /**
+ * @param array $fields
+ */
+ public function __construct( $fields = false ) {
+ if ( $fields ) {
+ $this->db_fields = $fields;
+ }
+ }
+
+ /**
+ * Starts the list before the elements are added.
+ *
+ * @see Walker_Nav_Menu::start_lvl()
+ *
+ * @since 3.0.0
+ *
+ * @param string $output Used to append additional content (passed by reference).
+ * @param int $depth Depth of page. Used for padding.
+ * @param array $args Not used.
+ */
+ public function start_lvl( &$output, $depth = 0, $args = array() ) {
+ $indent = str_repeat( "\t", $depth );
+ $output .= "\n$indent<ul class='children'>\n";
+ }
+
+ /**
+ * Ends the list of after the elements are added.
+ *
+ * @see Walker_Nav_Menu::end_lvl()
+ *
+ * @since 3.0.0
+ *
+ * @param string $output Used to append additional content (passed by reference).
+ * @param int $depth Depth of page. Used for padding.
+ * @param array $args Not used.
+ */
+ public function end_lvl( &$output, $depth = 0, $args = array() ) {
+ $indent = str_repeat( "\t", $depth );
+ $output .= "\n$indent</ul>";
+ }
+
+ /**
+ * Start the element output.
+ *
+ * @see Walker_Nav_Menu::start_el()
+ *
+ * @since 3.0.0
+ *
+ * @global int $_nav_menu_placeholder
+ *
+ * @param string $output Used to append additional content (passed by reference).
+ * @param object $item Menu item data object.
+ * @param int $depth Depth of menu item. Used for padding.
+ * @param array $args Not used.
+ * @param int $id Not used.
+ */
+ public function start_el( &$output, $item, $depth = 0, $args = array(), $id = 0 ) {
+ global $_nav_menu_placeholder;
+
+ $_nav_menu_placeholder = ( 0 > $_nav_menu_placeholder ) ? intval( $_nav_menu_placeholder ) - 1 : -1;
+ $possible_object_id = isset( $item->post_type ) && 'nav_menu_item' == $item->post_type ? $item->object_id : $_nav_menu_placeholder;
+ $possible_db_id = ( ! empty( $item->ID ) ) && ( 0 < $possible_object_id ) ? (int) $item->ID : 0;
+
+ $indent = ( $depth ) ? str_repeat( "\t", $depth ) : '';
+
+ $output .= $indent . '<li>';
+ $output .= '<label class="menu-item-title">';
+ $output .= '<input type="checkbox" class="menu-item-checkbox';
+
+ if ( ! empty( $item->front_or_home ) ) {
+ $output .= ' add-to-top';
+ }
+
+ $output .= '" name="menu-item[' . $possible_object_id . '][menu-item-object-id]" value="' . esc_attr( $item->object_id ) . '" /> ';
+
+ if ( ! empty( $item->label ) ) {
+ $title = $item->label;
+ } elseif ( isset( $item->post_type ) ) {
+ /** This filter is documented in wp-includes/post-template.php */
+ $title = apply_filters( 'the_title', $item->post_title, $item->ID );
+ if ( ! empty( $item->front_or_home ) && _x( 'Home', 'nav menu home label' ) !== $title ) {
+ /* translators: %s: front page title */
+ $title = sprintf( _x( 'Home: %s', 'nav menu front page title' ), $title );
+ }
+ }
+
+ $output .= isset( $title ) ? esc_html( $title ) : esc_html( $item->title );
+ $output .= '</label>';
+
+ // Menu item hidden fields
+ $output .= '<input type="hidden" class="menu-item-db-id" name="menu-item[' . $possible_object_id . '][menu-item-db-id]" value="' . $possible_db_id . '" />';
+ $output .= '<input type="hidden" class="menu-item-object" name="menu-item[' . $possible_object_id . '][menu-item-object]" value="' . esc_attr( $item->object ) . '" />';
+ $output .= '<input type="hidden" class="menu-item-parent-id" name="menu-item[' . $possible_object_id . '][menu-item-parent-id]" value="' . esc_attr( $item->menu_item_parent ) . '" />';
+ $output .= '<input type="hidden" class="menu-item-type" name="menu-item[' . $possible_object_id . '][menu-item-type]" value="' . esc_attr( $item->type ) . '" />';
+ $output .= '<input type="hidden" class="menu-item-title" name="menu-item[' . $possible_object_id . '][menu-item-title]" value="' . esc_attr( $item->title ) . '" />';
+ $output .= '<input type="hidden" class="menu-item-url" name="menu-item[' . $possible_object_id . '][menu-item-url]" value="' . esc_attr( $item->url ) . '" />';
+ $output .= '<input type="hidden" class="menu-item-target" name="menu-item[' . $possible_object_id . '][menu-item-target]" value="' . esc_attr( $item->target ) . '" />';
+ $output .= '<input type="hidden" class="menu-item-attr_title" name="menu-item[' . $possible_object_id . '][menu-item-attr_title]" value="' . esc_attr( $item->attr_title ) . '" />';
+ $output .= '<input type="hidden" class="menu-item-classes" name="menu-item[' . $possible_object_id . '][menu-item-classes]" value="' . esc_attr( implode( ' ', $item->classes ) ) . '" />';
+ $output .= '<input type="hidden" class="menu-item-xfn" name="menu-item[' . $possible_object_id . '][menu-item-xfn]" value="' . esc_attr( $item->xfn ) . '" />';
+ }
+
+} // Walker_Nav_Menu_Checklist
diff --git a/www/crm/wp-admin/includes/class-walker-nav-menu-edit.php b/www/crm/wp-admin/includes/class-walker-nav-menu-edit.php
new file mode 100644
index 00000000..eb940af3
--- /dev/null
+++ b/www/crm/wp-admin/includes/class-walker-nav-menu-edit.php
@@ -0,0 +1,266 @@
+<?php
+/**
+ * Navigation Menu API: Walker_Nav_Menu_Edit class
+ *
+ * @package WordPress
+ * @subpackage Administration
+ * @since 4.4.0
+ */
+
+/**
+ * Create HTML list of nav menu input items.
+ *
+ * @since 3.0.0
+ *
+ * @see Walker_Nav_Menu
+ */
+class Walker_Nav_Menu_Edit extends Walker_Nav_Menu {
+ /**
+ * Starts the list before the elements are added.
+ *
+ * @see Walker_Nav_Menu::start_lvl()
+ *
+ * @since 3.0.0
+ *
+ * @param string $output Passed by reference.
+ * @param int $depth Depth of menu item. Used for padding.
+ * @param array $args Not used.
+ */
+ public function start_lvl( &$output, $depth = 0, $args = array() ) {}
+
+ /**
+ * Ends the list of after the elements are added.
+ *
+ * @see Walker_Nav_Menu::end_lvl()
+ *
+ * @since 3.0.0
+ *
+ * @param string $output Passed by reference.
+ * @param int $depth Depth of menu item. Used for padding.
+ * @param array $args Not used.
+ */
+ public function end_lvl( &$output, $depth = 0, $args = array() ) {}
+
+ /**
+ * Start the element output.
+ *
+ * @see Walker_Nav_Menu::start_el()
+ * @since 3.0.0
+ *
+ * @global int $_wp_nav_menu_max_depth
+ *
+ * @param string $output Used to append additional content (passed by reference).
+ * @param object $item Menu item data object.
+ * @param int $depth Depth of menu item. Used for padding.
+ * @param array $args Not used.
+ * @param int $id Not used.
+ */
+ public function start_el( &$output, $item, $depth = 0, $args = array(), $id = 0 ) {
+ global $_wp_nav_menu_max_depth;
+ $_wp_nav_menu_max_depth = $depth > $_wp_nav_menu_max_depth ? $depth : $_wp_nav_menu_max_depth;
+
+ ob_start();
+ $item_id = esc_attr( $item->ID );
+ $removed_args = array(
+ 'action',
+ 'customlink-tab',
+ 'edit-menu-item',
+ 'menu-item',
+ 'page-tab',
+ '_wpnonce',
+ );
+
+ $original_title = false;
+ if ( 'taxonomy' == $item->type ) {
+ $original_title = get_term_field( 'name', $item->object_id, $item->object, 'raw' );
+ if ( is_wp_error( $original_title ) ) {
+ $original_title = false;
+ }
+ } elseif ( 'post_type' == $item->type ) {
+ $original_object = get_post( $item->object_id );
+ $original_title = get_the_title( $original_object->ID );
+ } elseif ( 'post_type_archive' == $item->type ) {
+ $original_object = get_post_type_object( $item->object );
+ if ( $original_object ) {
+ $original_title = $original_object->labels->archives;
+ }
+ }
+
+ $classes = array(
+ 'menu-item menu-item-depth-' . $depth,
+ 'menu-item-' . esc_attr( $item->object ),
+ 'menu-item-edit-' . ( ( isset( $_GET['edit-menu-item'] ) && $item_id == $_GET['edit-menu-item'] ) ? 'active' : 'inactive' ),
+ );
+
+ $title = $item->title;
+
+ if ( ! empty( $item->_invalid ) ) {
+ $classes[] = 'menu-item-invalid';
+ /* translators: %s: title of menu item which is invalid */
+ $title = sprintf( __( '%s (Invalid)' ), $item->title );
+ } elseif ( isset( $item->post_status ) && 'draft' == $item->post_status ) {
+ $classes[] = 'pending';
+ /* translators: %s: title of menu item in draft status */
+ $title = sprintf( __( '%s (Pending)' ), $item->title );
+ }
+
+ $title = ( ! isset( $item->label ) || '' == $item->label ) ? $title : $item->label;
+
+ $submenu_text = '';
+ if ( 0 == $depth ) {
+ $submenu_text = 'style="display: none;"';
+ }
+
+ ?>
+ <li id="menu-item-<?php echo $item_id; ?>" class="<?php echo implode( ' ', $classes ); ?>">
+ <div class="menu-item-bar">
+ <div class="menu-item-handle">
+ <span class="item-title"><span class="menu-item-title"><?php echo esc_html( $title ); ?></span> <span class="is-submenu" <?php echo $submenu_text; ?>><?php _e( 'sub item' ); ?></span></span>
+ <span class="item-controls">
+ <span class="item-type"><?php echo esc_html( $item->type_label ); ?></span>
+ <span class="item-order hide-if-js">
+ <a href="
+ <?php
+ echo wp_nonce_url(
+ add_query_arg(
+ array(
+ 'action' => 'move-up-menu-item',
+ 'menu-item' => $item_id,
+ ),
+ remove_query_arg( $removed_args, admin_url( 'nav-menus.php' ) )
+ ),
+ 'move-menu_item'
+ );
+ ?>
+ " class="item-move-up" aria-label="<?php esc_attr_e( 'Move up' ); ?>">&#8593;</a>
+ |
+ <a href="
+ <?php
+ echo wp_nonce_url(
+ add_query_arg(
+ array(
+ 'action' => 'move-down-menu-item',
+ 'menu-item' => $item_id,
+ ),
+ remove_query_arg( $removed_args, admin_url( 'nav-menus.php' ) )
+ ),
+ 'move-menu_item'
+ );
+ ?>
+ " class="item-move-down" aria-label="<?php esc_attr_e( 'Move down' ); ?>">&#8595;</a>
+ </span>
+ <a class="item-edit" id="edit-<?php echo $item_id; ?>" href="
+ <?php
+ echo ( isset( $_GET['edit-menu-item'] ) && $item_id == $_GET['edit-menu-item'] ) ? admin_url( 'nav-menus.php' ) : add_query_arg( 'edit-menu-item', $item_id, remove_query_arg( $removed_args, admin_url( 'nav-menus.php#menu-item-settings-' . $item_id ) ) );
+ ?>
+ " aria-label="<?php esc_attr_e( 'Edit menu item' ); ?>"><span class="screen-reader-text"><?php _e( 'Edit' ); ?></span></a>
+ </span>
+ </div>
+ </div>
+
+ <div class="menu-item-settings wp-clearfix" id="menu-item-settings-<?php echo $item_id; ?>">
+ <?php if ( 'custom' == $item->type ) : ?>
+ <p class="field-url description description-wide">
+ <label for="edit-menu-item-url-<?php echo $item_id; ?>">
+ <?php _e( 'URL' ); ?><br />
+ <input type="text" id="edit-menu-item-url-<?php echo $item_id; ?>" class="widefat code edit-menu-item-url" name="menu-item-url[<?php echo $item_id; ?>]" value="<?php echo esc_attr( $item->url ); ?>" />
+ </label>
+ </p>
+ <?php endif; ?>
+ <p class="description description-wide">
+ <label for="edit-menu-item-title-<?php echo $item_id; ?>">
+ <?php _e( 'Navigation Label' ); ?><br />
+ <input type="text" id="edit-menu-item-title-<?php echo $item_id; ?>" class="widefat edit-menu-item-title" name="menu-item-title[<?php echo $item_id; ?>]" value="<?php echo esc_attr( $item->title ); ?>" />
+ </label>
+ </p>
+ <p class="field-title-attribute field-attr-title description description-wide">
+ <label for="edit-menu-item-attr-title-<?php echo $item_id; ?>">
+ <?php _e( 'Title Attribute' ); ?><br />
+ <input type="text" id="edit-menu-item-attr-title-<?php echo $item_id; ?>" class="widefat edit-menu-item-attr-title" name="menu-item-attr-title[<?php echo $item_id; ?>]" value="<?php echo esc_attr( $item->post_excerpt ); ?>" />
+ </label>
+ </p>
+ <p class="field-link-target description">
+ <label for="edit-menu-item-target-<?php echo $item_id; ?>">
+ <input type="checkbox" id="edit-menu-item-target-<?php echo $item_id; ?>" value="_blank" name="menu-item-target[<?php echo $item_id; ?>]"<?php checked( $item->target, '_blank' ); ?> />
+ <?php _e( 'Open link in a new tab' ); ?>
+ </label>
+ </p>
+ <p class="field-css-classes description description-thin">
+ <label for="edit-menu-item-classes-<?php echo $item_id; ?>">
+ <?php _e( 'CSS Classes (optional)' ); ?><br />
+ <input type="text" id="edit-menu-item-classes-<?php echo $item_id; ?>" class="widefat code edit-menu-item-classes" name="menu-item-classes[<?php echo $item_id; ?>]" value="<?php echo esc_attr( implode( ' ', $item->classes ) ); ?>" />
+ </label>
+ </p>
+ <p class="field-xfn description description-thin">
+ <label for="edit-menu-item-xfn-<?php echo $item_id; ?>">
+ <?php _e( 'Link Relationship (XFN)' ); ?><br />
+ <input type="text" id="edit-menu-item-xfn-<?php echo $item_id; ?>" class="widefat code edit-menu-item-xfn" name="menu-item-xfn[<?php echo $item_id; ?>]" value="<?php echo esc_attr( $item->xfn ); ?>" />
+ </label>
+ </p>
+ <p class="field-description description description-wide">
+ <label for="edit-menu-item-description-<?php echo $item_id; ?>">
+ <?php _e( 'Description' ); ?><br />
+ <textarea id="edit-menu-item-description-<?php echo $item_id; ?>" class="widefat edit-menu-item-description" rows="3" cols="20" name="menu-item-description[<?php echo $item_id; ?>]"><?php echo esc_html( $item->description ); // textarea_escaped ?></textarea>
+ <span class="description"><?php _e( 'The description will be displayed in the menu if the current theme supports it.' ); ?></span>
+ </label>
+ </p>
+
+ <fieldset class="field-move hide-if-no-js description description-wide">
+ <span class="field-move-visual-label" aria-hidden="true"><?php _e( 'Move' ); ?></span>
+ <button type="button" class="button-link menus-move menus-move-up" data-dir="up"><?php _e( 'Up one' ); ?></button>
+ <button type="button" class="button-link menus-move menus-move-down" data-dir="down"><?php _e( 'Down one' ); ?></button>
+ <button type="button" class="button-link menus-move menus-move-left" data-dir="left"></button>
+ <button type="button" class="button-link menus-move menus-move-right" data-dir="right"></button>
+ <button type="button" class="button-link menus-move menus-move-top" data-dir="top"><?php _e( 'To the top' ); ?></button>
+ </fieldset>
+
+ <div class="menu-item-actions description-wide submitbox">
+ <?php if ( 'custom' != $item->type && $original_title !== false ) : ?>
+ <p class="link-to-original">
+ <?php
+ /* translators: %s: original title */
+ printf( __( 'Original: %s' ), '<a href="' . esc_attr( $item->url ) . '">' . esc_html( $original_title ) . '</a>' );
+ ?>
+ </p>
+ <?php endif; ?>
+ <a class="item-delete submitdelete deletion" id="delete-<?php echo $item_id; ?>" href="
+ <?php
+ echo wp_nonce_url(
+ add_query_arg(
+ array(
+ 'action' => 'delete-menu-item',
+ 'menu-item' => $item_id,
+ ),
+ admin_url( 'nav-menus.php' )
+ ),
+ 'delete-menu_item_' . $item_id
+ );
+ ?>
+ "><?php _e( 'Remove' ); ?></a> <span class="meta-sep hide-if-no-js"> | </span> <a class="item-cancel submitcancel hide-if-no-js" id="cancel-<?php echo $item_id; ?>" href="
+ <?php
+ echo esc_url(
+ add_query_arg(
+ array(
+ 'edit-menu-item' => $item_id,
+ 'cancel' => time(),
+ ),
+ admin_url( 'nav-menus.php' )
+ )
+ );
+ ?>
+ #menu-item-settings-<?php echo $item_id; ?>"><?php _e( 'Cancel' ); ?></a>
+ </div>
+
+ <input class="menu-item-data-db-id" type="hidden" name="menu-item-db-id[<?php echo $item_id; ?>]" value="<?php echo $item_id; ?>" />
+ <input class="menu-item-data-object-id" type="hidden" name="menu-item-object-id[<?php echo $item_id; ?>]" value="<?php echo esc_attr( $item->object_id ); ?>" />
+ <input class="menu-item-data-object" type="hidden" name="menu-item-object[<?php echo $item_id; ?>]" value="<?php echo esc_attr( $item->object ); ?>" />
+ <input class="menu-item-data-parent-id" type="hidden" name="menu-item-parent-id[<?php echo $item_id; ?>]" value="<?php echo esc_attr( $item->menu_item_parent ); ?>" />
+ <input class="menu-item-data-position" type="hidden" name="menu-item-position[<?php echo $item_id; ?>]" value="<?php echo esc_attr( $item->menu_order ); ?>" />
+ <input class="menu-item-data-type" type="hidden" name="menu-item-type[<?php echo $item_id; ?>]" value="<?php echo esc_attr( $item->type ); ?>" />
+ </div><!-- .menu-item-settings-->
+ <ul class="menu-item-transport"></ul>
+ <?php
+ $output .= ob_get_clean();
+ }
+
+} // Walker_Nav_Menu_Edit
diff --git a/www/crm/wp-admin/includes/class-wp-ajax-upgrader-skin.php b/www/crm/wp-admin/includes/class-wp-ajax-upgrader-skin.php
new file mode 100644
index 00000000..12afb44e
--- /dev/null
+++ b/www/crm/wp-admin/includes/class-wp-ajax-upgrader-skin.php
@@ -0,0 +1,128 @@
+<?php
+/**
+ * Upgrader API: WP_Ajax_Upgrader_Skin class
+ *
+ * @package WordPress
+ * @subpackage Upgrader
+ * @since 4.6.0
+ */
+
+/**
+ * Upgrader Skin for Ajax WordPress upgrades.
+ *
+ * This skin is designed to be used for Ajax updates.
+ *
+ * @since 4.6.0
+ *
+ * @see Automatic_Upgrader_Skin
+ */
+class WP_Ajax_Upgrader_Skin extends Automatic_Upgrader_Skin {
+
+ /**
+ * Holds the WP_Error object.
+ *
+ * @since 4.6.0
+ * @var null|WP_Error
+ */
+ protected $errors = null;
+
+ /**
+ * Constructor.
+ *
+ * @since 4.6.0
+ *
+ * @param array $args Options for the upgrader, see WP_Upgrader_Skin::__construct().
+ */
+ public function __construct( $args = array() ) {
+ parent::__construct( $args );
+
+ $this->errors = new WP_Error();
+ }
+
+ /**
+ * Retrieves the list of errors.
+ *
+ * @since 4.6.0
+ *
+ * @return WP_Error Errors during an upgrade.
+ */
+ public function get_errors() {
+ return $this->errors;
+ }
+
+ /**
+ * Retrieves a string for error messages.
+ *
+ * @since 4.6.0
+ *
+ * @return string Error messages during an upgrade.
+ */
+ public function get_error_messages() {
+ $messages = array();
+
+ foreach ( $this->errors->get_error_codes() as $error_code ) {
+ $error_data = $this->errors->get_error_data( $error_code );
+
+ if ( $error_data && is_string( $error_data ) ) {
+ $messages[] = $this->errors->get_error_message( $error_code ) . ' ' . esc_html( strip_tags( $error_data ) );
+ } else {
+ $messages[] = $this->errors->get_error_message( $error_code );
+ }
+ }
+
+ return implode( ', ', $messages );
+ }
+
+ /**
+ * Stores a log entry for an error.
+ *
+ * @since 4.6.0
+ *
+ * @param string|WP_Error $errors Errors.
+ */
+ public function error( $errors ) {
+ if ( is_string( $errors ) ) {
+ $string = $errors;
+ if ( ! empty( $this->upgrader->strings[ $string ] ) ) {
+ $string = $this->upgrader->strings[ $string ];
+ }
+
+ if ( false !== strpos( $string, '%' ) ) {
+ $args = func_get_args();
+ $args = array_splice( $args, 1 );
+ if ( ! empty( $args ) ) {
+ $string = vsprintf( $string, $args );
+ }
+ }
+
+ // Count existing errors to generate an unique error code.
+ $errors_count = count( $this->errors->get_error_codes() );
+ $this->errors->add( 'unknown_upgrade_error_' . $errors_count + 1, $string );
+ } elseif ( is_wp_error( $errors ) ) {
+ foreach ( $errors->get_error_codes() as $error_code ) {
+ $this->errors->add( $error_code, $errors->get_error_message( $error_code ), $errors->get_error_data( $error_code ) );
+ }
+ }
+
+ $args = func_get_args();
+ call_user_func_array( array( $this, 'parent::error' ), $args );
+ }
+
+ /**
+ * Stores a log entry.
+ *
+ * @since 4.6.0
+ *
+ * @param string|array|WP_Error $data Log entry data.
+ */
+ public function feedback( $data ) {
+ if ( is_wp_error( $data ) ) {
+ foreach ( $data->get_error_codes() as $error_code ) {
+ $this->errors->add( $error_code, $data->get_error_message( $error_code ), $data->get_error_data( $error_code ) );
+ }
+ }
+
+ $args = func_get_args();
+ call_user_func_array( array( $this, 'parent::feedback' ), $args );
+ }
+}
diff --git a/www/crm/wp-admin/includes/class-wp-automatic-updater.php b/www/crm/wp-admin/includes/class-wp-automatic-updater.php
new file mode 100644
index 00000000..72a93667
--- /dev/null
+++ b/www/crm/wp-admin/includes/class-wp-automatic-updater.php
@@ -0,0 +1,996 @@
+<?php
+/**
+ * Upgrade API: WP_Automatic_Updater class
+ *
+ * @package WordPress
+ * @subpackage Upgrader
+ * @since 4.6.0
+ */
+
+/**
+ * Core class used for handling automatic background updates.
+ *
+ * @since 3.7.0
+ * @since 4.6.0 Moved to its own file from wp-admin/includes/class-wp-upgrader.php.
+ */
+class WP_Automatic_Updater {
+
+ /**
+ * Tracks update results during processing.
+ *
+ * @var array
+ */
+ protected $update_results = array();
+
+ /**
+ * Whether the entire automatic updater is disabled.
+ *
+ * @since 3.7.0
+ */
+ public function is_disabled() {
+ // Background updates are disabled if you don't want file changes.
+ if ( ! wp_is_file_mod_allowed( 'automatic_updater' ) ) {
+ return true;
+ }
+
+ if ( wp_installing() ) {
+ return true;
+ }
+
+ // More fine grained control can be done through the WP_AUTO_UPDATE_CORE constant and filters.
+ $disabled = defined( 'AUTOMATIC_UPDATER_DISABLED' ) && AUTOMATIC_UPDATER_DISABLED;
+
+ /**
+ * Filters whether to entirely disable background updates.
+ *
+ * There are more fine-grained filters and controls for selective disabling.
+ * This filter parallels the AUTOMATIC_UPDATER_DISABLED constant in name.
+ *
+ * This also disables update notification emails. That may change in the future.
+ *
+ * @since 3.7.0
+ *
+ * @param bool $disabled Whether the updater should be disabled.
+ */
+ return apply_filters( 'automatic_updater_disabled', $disabled );
+ }
+
+ /**
+ * Check for version control checkouts.
+ *
+ * Checks for Subversion, Git, Mercurial, and Bazaar. It recursively looks up the
+ * filesystem to the top of the drive, erring on the side of detecting a VCS
+ * checkout somewhere.
+ *
+ * ABSPATH is always checked in addition to whatever $context is (which may be the
+ * wp-content directory, for example). The underlying assumption is that if you are
+ * using version control *anywhere*, then you should be making decisions for
+ * how things get updated.
+ *
+ * @since 3.7.0
+ *
+ * @param string $context The filesystem path to check, in addition to ABSPATH.
+ */
+ public function is_vcs_checkout( $context ) {
+ $context_dirs = array( untrailingslashit( $context ) );
+ if ( $context !== ABSPATH ) {
+ $context_dirs[] = untrailingslashit( ABSPATH );
+ }
+
+ $vcs_dirs = array( '.svn', '.git', '.hg', '.bzr' );
+ $check_dirs = array();
+
+ foreach ( $context_dirs as $context_dir ) {
+ // Walk up from $context_dir to the root.
+ do {
+ $check_dirs[] = $context_dir;
+
+ // Once we've hit '/' or 'C:\', we need to stop. dirname will keep returning the input here.
+ if ( $context_dir == dirname( $context_dir ) ) {
+ break;
+ }
+
+ // Continue one level at a time.
+ } while ( $context_dir = dirname( $context_dir ) );
+ }
+
+ $check_dirs = array_unique( $check_dirs );
+
+ // Search all directories we've found for evidence of version control.
+ foreach ( $vcs_dirs as $vcs_dir ) {
+ foreach ( $check_dirs as $check_dir ) {
+ if ( $checkout = @is_dir( rtrim( $check_dir, '\\/' ) . "/$vcs_dir" ) ) {
+ break 2;
+ }
+ }
+ }
+
+ /**
+ * Filters whether the automatic updater should consider a filesystem
+ * location to be potentially managed by a version control system.
+ *
+ * @since 3.7.0
+ *
+ * @param bool $checkout Whether a VCS checkout was discovered at $context
+ * or ABSPATH, or anywhere higher.
+ * @param string $context The filesystem context (a path) against which
+ * filesystem status should be checked.
+ */
+ return apply_filters( 'automatic_updates_is_vcs_checkout', $checkout, $context );
+ }
+
+ /**
+ * Tests to see if we can and should update a specific item.
+ *
+ * @since 3.7.0
+ *
+ * @global wpdb $wpdb WordPress database abstraction object.
+ *
+ * @param string $type The type of update being checked: 'core', 'theme',
+ * 'plugin', 'translation'.
+ * @param object $item The update offer.
+ * @param string $context The filesystem context (a path) against which filesystem
+ * access and status should be checked.
+ */
+ public function should_update( $type, $item, $context ) {
+ // Used to see if WP_Filesystem is set up to allow unattended updates.
+ $skin = new Automatic_Upgrader_Skin;
+
+ if ( $this->is_disabled() ) {
+ return false;
+ }
+
+ // Only relax the filesystem checks when the update doesn't include new files
+ $allow_relaxed_file_ownership = false;
+ if ( 'core' == $type && isset( $item->new_files ) && ! $item->new_files ) {
+ $allow_relaxed_file_ownership = true;
+ }
+
+ // If we can't do an auto core update, we may still be able to email the user.
+ if ( ! $skin->request_filesystem_credentials( false, $context, $allow_relaxed_file_ownership ) || $this->is_vcs_checkout( $context ) ) {
+ if ( 'core' == $type ) {
+ $this->send_core_update_notification_email( $item );
+ }
+ return false;
+ }
+
+ // Next up, is this an item we can update?
+ if ( 'core' == $type ) {
+ $update = Core_Upgrader::should_update_to_version( $item->current );
+ } else {
+ $update = ! empty( $item->autoupdate );
+ }
+
+ /**
+ * Filters whether to automatically update core, a plugin, a theme, or a language.
+ *
+ * The dynamic portion of the hook name, `$type`, refers to the type of update
+ * being checked. Can be 'core', 'theme', 'plugin', or 'translation'.
+ *
+ * Generally speaking, plugins, themes, and major core versions are not updated
+ * by default, while translations and minor and development versions for core
+ * are updated by default.
+ *
+ * See the {@see 'allow_dev_auto_core_updates'}, {@see 'allow_minor_auto_core_updates'},
+ * and {@see 'allow_major_auto_core_updates'} filters for a more straightforward way to
+ * adjust core updates.
+ *
+ * @since 3.7.0
+ *
+ * @param bool $update Whether to update.
+ * @param object $item The update offer.
+ */
+ $update = apply_filters( "auto_update_{$type}", $update, $item );
+
+ if ( ! $update ) {
+ if ( 'core' == $type ) {
+ $this->send_core_update_notification_email( $item );
+ }
+ return false;
+ }
+
+ // If it's a core update, are we actually compatible with its requirements?
+ if ( 'core' == $type ) {
+ global $wpdb;
+
+ $php_compat = version_compare( phpversion(), $item->php_version, '>=' );
+ if ( file_exists( WP_CONTENT_DIR . '/db.php' ) && empty( $wpdb->is_mysql ) ) {
+ $mysql_compat = true;
+ } else {
+ $mysql_compat = version_compare( $wpdb->db_version(), $item->mysql_version, '>=' );
+ }
+
+ if ( ! $php_compat || ! $mysql_compat ) {
+ return false;
+ }
+ }
+
+ // If updating a plugin, ensure the minimum PHP version requirements are satisfied.
+ if ( 'plugin' === $type ) {
+ if ( ! empty( $item->requires_php ) && version_compare( phpversion(), $item->requires_php, '<' ) ) {
+ return false;
+ }
+ }
+
+ return true;
+ }
+
+ /**
+ * Notifies an administrator of a core update.
+ *
+ * @since 3.7.0
+ *
+ * @param object $item The update offer.
+ */
+ protected function send_core_update_notification_email( $item ) {
+ $notified = get_site_option( 'auto_core_update_notified' );
+
+ // Don't notify if we've already notified the same email address of the same version.
+ if ( $notified && $notified['email'] == get_site_option( 'admin_email' ) && $notified['version'] == $item->current ) {
+ return false;
+ }
+
+ // See if we need to notify users of a core update.
+ $notify = ! empty( $item->notify_email );
+
+ /**
+ * Filters whether to notify the site administrator of a new core update.
+ *
+ * By default, administrators are notified when the update offer received
+ * from WordPress.org sets a particular flag. This allows some discretion
+ * in if and when to notify.
+ *
+ * This filter is only evaluated once per release. If the same email address
+ * was already notified of the same new version, WordPress won't repeatedly
+ * email the administrator.
+ *
+ * This filter is also used on about.php to check if a plugin has disabled
+ * these notifications.
+ *
+ * @since 3.7.0
+ *
+ * @param bool $notify Whether the site administrator is notified.
+ * @param object $item The update offer.
+ */
+ if ( ! apply_filters( 'send_core_update_notification_email', $notify, $item ) ) {
+ return false;
+ }
+
+ $this->send_email( 'manual', $item );
+ return true;
+ }
+
+ /**
+ * Update an item, if appropriate.
+ *
+ * @since 3.7.0
+ *
+ * @param string $type The type of update being checked: 'core', 'theme', 'plugin', 'translation'.
+ * @param object $item The update offer.
+ *
+ * @return null|WP_Error
+ */
+ public function update( $type, $item ) {
+ $skin = new Automatic_Upgrader_Skin;
+
+ switch ( $type ) {
+ case 'core':
+ // The Core upgrader doesn't use the Upgrader's skin during the actual main part of the upgrade, instead, firing a filter.
+ add_filter( 'update_feedback', array( $skin, 'feedback' ) );
+ $upgrader = new Core_Upgrader( $skin );
+ $context = ABSPATH;
+ break;
+ case 'plugin':
+ $upgrader = new Plugin_Upgrader( $skin );
+ $context = WP_PLUGIN_DIR; // We don't support custom Plugin directories, or updates for WPMU_PLUGIN_DIR
+ break;
+ case 'theme':
+ $upgrader = new Theme_Upgrader( $skin );
+ $context = get_theme_root( $item->theme );
+ break;
+ case 'translation':
+ $upgrader = new Language_Pack_Upgrader( $skin );
+ $context = WP_CONTENT_DIR; // WP_LANG_DIR;
+ break;
+ }
+
+ // Determine whether we can and should perform this update.
+ if ( ! $this->should_update( $type, $item, $context ) ) {
+ return false;
+ }
+
+ /**
+ * Fires immediately prior to an auto-update.
+ *
+ * @since 4.4.0
+ *
+ * @param string $type The type of update being checked: 'core', 'theme', 'plugin', or 'translation'.
+ * @param object $item The update offer.
+ * @param string $context The filesystem context (a path) against which filesystem access and status
+ * should be checked.
+ */
+ do_action( 'pre_auto_update', $type, $item, $context );
+
+ $upgrader_item = $item;
+ switch ( $type ) {
+ case 'core':
+ /* translators: %s: WordPress version */
+ $skin->feedback( __( 'Updating to WordPress %s' ), $item->version );
+ /* translators: %s: WordPress version */
+ $item_name = sprintf( __( 'WordPress %s' ), $item->version );
+ break;
+ case 'theme':
+ $upgrader_item = $item->theme;
+ $theme = wp_get_theme( $upgrader_item );
+ $item_name = $theme->Get( 'Name' );
+ /* translators: %s: Theme name */
+ $skin->feedback( __( 'Updating theme: %s' ), $item_name );
+ break;
+ case 'plugin':
+ $upgrader_item = $item->plugin;
+ $plugin_data = get_plugin_data( $context . '/' . $upgrader_item );
+ $item_name = $plugin_data['Name'];
+ /* translators: %s: Plugin name */
+ $skin->feedback( __( 'Updating plugin: %s' ), $item_name );
+ break;
+ case 'translation':
+ $language_item_name = $upgrader->get_name_for_update( $item );
+ /* translators: %s: Name of language item */
+ $item_name = sprintf( __( 'Translations for %s' ), $language_item_name );
+ /* translators: 1: Name of language item, 2: Language */
+ $skin->feedback( sprintf( __( 'Updating translations for %1$s (%2$s)&#8230;' ), $language_item_name, $item->language ) );
+ break;
+ }
+
+ $allow_relaxed_file_ownership = false;
+ if ( 'core' == $type && isset( $item->new_files ) && ! $item->new_files ) {
+ $allow_relaxed_file_ownership = true;
+ }
+
+ // Boom, This sites about to get a whole new splash of paint!
+ $upgrade_result = $upgrader->upgrade(
+ $upgrader_item,
+ array(
+ 'clear_update_cache' => false,
+ // Always use partial builds if possible for core updates.
+ 'pre_check_md5' => false,
+ // Only available for core updates.
+ 'attempt_rollback' => true,
+ // Allow relaxed file ownership in some scenarios
+ 'allow_relaxed_file_ownership' => $allow_relaxed_file_ownership,
+ )
+ );
+
+ // If the filesystem is unavailable, false is returned.
+ if ( false === $upgrade_result ) {
+ $upgrade_result = new WP_Error( 'fs_unavailable', __( 'Could not access filesystem.' ) );
+ }
+
+ if ( 'core' == $type ) {
+ if ( is_wp_error( $upgrade_result ) && ( 'up_to_date' == $upgrade_result->get_error_code() || 'locked' == $upgrade_result->get_error_code() ) ) {
+ // These aren't actual errors, treat it as a skipped-update instead to avoid triggering the post-core update failure routines.
+ return false;
+ }
+
+ // Core doesn't output this, so let's append it so we don't get confused.
+ if ( is_wp_error( $upgrade_result ) ) {
+ $skin->error( __( 'Installation Failed' ), $upgrade_result );
+ } else {
+ $skin->feedback( __( 'WordPress updated successfully' ) );
+ }
+ }
+
+ $this->update_results[ $type ][] = (object) array(
+ 'item' => $item,
+ 'result' => $upgrade_result,
+ 'name' => $item_name,
+ 'messages' => $skin->get_upgrade_messages(),
+ );
+
+ return $upgrade_result;
+ }
+
+ /**
+ * Kicks off the background update process, looping through all pending updates.
+ *
+ * @since 3.7.0
+ */
+ public function run() {
+ if ( $this->is_disabled() ) {
+ return;
+ }
+
+ if ( ! is_main_network() || ! is_main_site() ) {
+ return;
+ }
+
+ if ( ! WP_Upgrader::create_lock( 'auto_updater' ) ) {
+ return;
+ }
+
+ // Don't automatically run these thins, as we'll handle it ourselves
+ remove_action( 'upgrader_process_complete', array( 'Language_Pack_Upgrader', 'async_upgrade' ), 20 );
+ remove_action( 'upgrader_process_complete', 'wp_version_check' );
+ remove_action( 'upgrader_process_complete', 'wp_update_plugins' );
+ remove_action( 'upgrader_process_complete', 'wp_update_themes' );
+
+ // Next, Plugins
+ wp_update_plugins(); // Check for Plugin updates
+ $plugin_updates = get_site_transient( 'update_plugins' );
+ if ( $plugin_updates && ! empty( $plugin_updates->response ) ) {
+ foreach ( $plugin_updates->response as $plugin ) {
+ $this->update( 'plugin', $plugin );
+ }
+ // Force refresh of plugin update information
+ wp_clean_plugins_cache();
+ }
+
+ // Next, those themes we all love
+ wp_update_themes(); // Check for Theme updates
+ $theme_updates = get_site_transient( 'update_themes' );
+ if ( $theme_updates && ! empty( $theme_updates->response ) ) {
+ foreach ( $theme_updates->response as $theme ) {
+ $this->update( 'theme', (object) $theme );
+ }
+ // Force refresh of theme update information
+ wp_clean_themes_cache();
+ }
+
+ // Next, Process any core update
+ wp_version_check(); // Check for Core updates
+ $core_update = find_core_auto_update();
+
+ if ( $core_update ) {
+ $this->update( 'core', $core_update );
+ }
+
+ // Clean up, and check for any pending translations
+ // (Core_Upgrader checks for core updates)
+ $theme_stats = array();
+ if ( isset( $this->update_results['theme'] ) ) {
+ foreach ( $this->update_results['theme'] as $upgrade ) {
+ $theme_stats[ $upgrade->item->theme ] = ( true === $upgrade->result );
+ }
+ }
+ wp_update_themes( $theme_stats ); // Check for Theme updates
+
+ $plugin_stats = array();
+ if ( isset( $this->update_results['plugin'] ) ) {
+ foreach ( $this->update_results['plugin'] as $upgrade ) {
+ $plugin_stats[ $upgrade->item->plugin ] = ( true === $upgrade->result );
+ }
+ }
+ wp_update_plugins( $plugin_stats ); // Check for Plugin updates
+
+ // Finally, Process any new translations
+ $language_updates = wp_get_translation_updates();
+ if ( $language_updates ) {
+ foreach ( $language_updates as $update ) {
+ $this->update( 'translation', $update );
+ }
+
+ // Clear existing caches
+ wp_clean_update_cache();
+
+ wp_version_check(); // check for Core updates
+ wp_update_themes(); // Check for Theme updates
+ wp_update_plugins(); // Check for Plugin updates
+ }
+
+ // Send debugging email to admin for all development installations.
+ if ( ! empty( $this->update_results ) ) {
+ $development_version = false !== strpos( get_bloginfo( 'version' ), '-' );
+
+ /**
+ * Filters whether to send a debugging email for each automatic background update.
+ *
+ * @since 3.7.0
+ *
+ * @param bool $development_version By default, emails are sent if the
+ * install is a development version.
+ * Return false to avoid the email.
+ */
+ if ( apply_filters( 'automatic_updates_send_debug_email', $development_version ) ) {
+ $this->send_debug_email();
+ }
+
+ if ( ! empty( $this->update_results['core'] ) ) {
+ $this->after_core_update( $this->update_results['core'][0] );
+ }
+
+ /**
+ * Fires after all automatic updates have run.
+ *
+ * @since 3.8.0
+ *
+ * @param array $update_results The results of all attempted updates.
+ */
+ do_action( 'automatic_updates_complete', $this->update_results );
+ }
+
+ WP_Upgrader::release_lock( 'auto_updater' );
+ }
+
+ /**
+ * If we tried to perform a core update, check if we should send an email,
+ * and if we need to avoid processing future updates.
+ *
+ * @since 3.7.0
+ *
+ * @param object $update_result The result of the core update. Includes the update offer and result.
+ */
+ protected function after_core_update( $update_result ) {
+ $wp_version = get_bloginfo( 'version' );
+
+ $core_update = $update_result->item;
+ $result = $update_result->result;
+
+ if ( ! is_wp_error( $result ) ) {
+ $this->send_email( 'success', $core_update );
+ return;
+ }
+
+ $error_code = $result->get_error_code();
+
+ // Any of these WP_Error codes are critical failures, as in they occurred after we started to copy core files.
+ // We should not try to perform a background update again until there is a successful one-click update performed by the user.
+ $critical = false;
+ if ( $error_code === 'disk_full' || false !== strpos( $error_code, '__copy_dir' ) ) {
+ $critical = true;
+ } elseif ( $error_code === 'rollback_was_required' && is_wp_error( $result->get_error_data()->rollback ) ) {
+ // A rollback is only critical if it failed too.
+ $critical = true;
+ $rollback_result = $result->get_error_data()->rollback;
+ } elseif ( false !== strpos( $error_code, 'do_rollback' ) ) {
+ $critical = true;
+ }
+
+ if ( $critical ) {
+ $critical_data = array(
+ 'attempted' => $core_update->current,
+ 'current' => $wp_version,
+ 'error_code' => $error_code,
+ 'error_data' => $result->get_error_data(),
+ 'timestamp' => time(),
+ 'critical' => true,
+ );
+ if ( isset( $rollback_result ) ) {
+ $critical_data['rollback_code'] = $rollback_result->get_error_code();
+ $critical_data['rollback_data'] = $rollback_result->get_error_data();
+ }
+ update_site_option( 'auto_core_update_failed', $critical_data );
+ $this->send_email( 'critical', $core_update, $result );
+ return;
+ }
+
+ /*
+ * Any other WP_Error code (like download_failed or files_not_writable) occurs before
+ * we tried to copy over core files. Thus, the failures are early and graceful.
+ *
+ * We should avoid trying to perform a background update again for the same version.
+ * But we can try again if another version is released.
+ *
+ * For certain 'transient' failures, like download_failed, we should allow retries.
+ * In fact, let's schedule a special update for an hour from now. (It's possible
+ * the issue could actually be on WordPress.org's side.) If that one fails, then email.
+ */
+ $send = true;
+ $transient_failures = array( 'incompatible_archive', 'download_failed', 'insane_distro', 'locked' );
+ if ( in_array( $error_code, $transient_failures ) && ! get_site_option( 'auto_core_update_failed' ) ) {
+ wp_schedule_single_event( time() + HOUR_IN_SECONDS, 'wp_maybe_auto_update' );
+ $send = false;
+ }
+
+ $n = get_site_option( 'auto_core_update_notified' );
+ // Don't notify if we've already notified the same email address of the same version of the same notification type.
+ if ( $n && 'fail' == $n['type'] && $n['email'] == get_site_option( 'admin_email' ) && $n['version'] == $core_update->current ) {
+ $send = false;
+ }
+
+ update_site_option(
+ 'auto_core_update_failed',
+ array(
+ 'attempted' => $core_update->current,
+ 'current' => $wp_version,
+ 'error_code' => $error_code,
+ 'error_data' => $result->get_error_data(),
+ 'timestamp' => time(),
+ 'retry' => in_array( $error_code, $transient_failures ),
+ )
+ );
+
+ if ( $send ) {
+ $this->send_email( 'fail', $core_update, $result );
+ }
+ }
+
+ /**
+ * Sends an email upon the completion or failure of a background core update.
+ *
+ * @since 3.7.0
+ *
+ * @param string $type The type of email to send. Can be one of 'success', 'fail', 'manual', 'critical'.
+ * @param object $core_update The update offer that was attempted.
+ * @param mixed $result Optional. The result for the core update. Can be WP_Error.
+ */
+ protected function send_email( $type, $core_update, $result = null ) {
+ update_site_option(
+ 'auto_core_update_notified',
+ array(
+ 'type' => $type,
+ 'email' => get_site_option( 'admin_email' ),
+ 'version' => $core_update->current,
+ 'timestamp' => time(),
+ )
+ );
+
+ $next_user_core_update = get_preferred_from_update_core();
+ // If the update transient is empty, use the update we just performed
+ if ( ! $next_user_core_update ) {
+ $next_user_core_update = $core_update;
+ }
+ $newer_version_available = ( 'upgrade' == $next_user_core_update->response && version_compare( $next_user_core_update->version, $core_update->version, '>' ) );
+
+ /**
+ * Filters whether to send an email following an automatic background core update.
+ *
+ * @since 3.7.0
+ *
+ * @param bool $send Whether to send the email. Default true.
+ * @param string $type The type of email to send. Can be one of
+ * 'success', 'fail', 'critical'.
+ * @param object $core_update The update offer that was attempted.
+ * @param mixed $result The result for the core update. Can be WP_Error.
+ */
+ if ( 'manual' !== $type && ! apply_filters( 'auto_core_update_send_email', true, $type, $core_update, $result ) ) {
+ return;
+ }
+
+ switch ( $type ) {
+ case 'success': // We updated.
+ /* translators: Site updated notification email subject. 1: Site title, 2: WordPress version number. */
+ $subject = __( '[%1$s] Your site has updated to WordPress %2$s' );
+ break;
+
+ case 'fail': // We tried to update but couldn't.
+ case 'manual': // We can't update (and made no attempt).
+ /* translators: Update available notification email subject. 1: Site title, 2: WordPress version number. */
+ $subject = __( '[%1$s] WordPress %2$s is available. Please update!' );
+ break;
+
+ case 'critical': // We tried to update, started to copy files, then things went wrong.
+ /* translators: Site down notification email subject. 1: Site title. */
+ $subject = __( '[%1$s] URGENT: Your site may be down due to a failed update' );
+ break;
+
+ default:
+ return;
+ }
+
+ // If the auto update is not to the latest version, say that the current version of WP is available instead.
+ $version = 'success' === $type ? $core_update->current : $next_user_core_update->current;
+ $subject = sprintf( $subject, wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES ), $version );
+
+ $body = '';
+
+ switch ( $type ) {
+ case 'success':
+ /* translators: 1: Home URL, 2: WordPress version */
+ $body .= sprintf( __( 'Howdy! Your site at %1$s has been updated automatically to WordPress %2$s.' ), home_url(), $core_update->current );
+ $body .= "\n\n";
+ if ( ! $newer_version_available ) {
+ $body .= __( 'No further action is needed on your part.' ) . ' ';
+ }
+
+ // Can only reference the About screen if their update was successful.
+ list( $about_version ) = explode( '-', $core_update->current, 2 );
+ /* translators: %s: WordPress core version */
+ $body .= sprintf( __( 'For more on version %s, see the About WordPress screen:' ), $about_version );
+ $body .= "\n" . admin_url( 'about.php' );
+
+ if ( $newer_version_available ) {
+ /* translators: %s: WordPress core latest version */
+ $body .= "\n\n" . sprintf( __( 'WordPress %s is also now available.' ), $next_user_core_update->current ) . ' ';
+ $body .= __( 'Updating is easy and only takes a few moments:' );
+ $body .= "\n" . network_admin_url( 'update-core.php' );
+ }
+
+ break;
+
+ case 'fail':
+ case 'manual':
+ /* translators: 1: Home URL, 2: WordPress core latest version */
+ $body .= sprintf( __( 'Please update your site at %1$s to WordPress %2$s.' ), home_url(), $next_user_core_update->current );
+
+ $body .= "\n\n";
+
+ // Don't show this message if there is a newer version available.
+ // Potential for confusion, and also not useful for them to know at this point.
+ if ( 'fail' == $type && ! $newer_version_available ) {
+ $body .= __( 'We tried but were unable to update your site automatically.' ) . ' ';
+ }
+
+ $body .= __( 'Updating is easy and only takes a few moments:' );
+ $body .= "\n" . network_admin_url( 'update-core.php' );
+ break;
+
+ case 'critical':
+ if ( $newer_version_available ) {
+ /* translators: 1: Home URL, 2: WordPress core latest version */
+ $body .= sprintf( __( 'Your site at %1$s experienced a critical failure while trying to update WordPress to version %2$s.' ), home_url(), $core_update->current );
+ } else {
+ /* translators: 1: Home URL, 2: Core update version */
+ $body .= sprintf( __( 'Your site at %1$s experienced a critical failure while trying to update to the latest version of WordPress, %2$s.' ), home_url(), $core_update->current );
+ }
+
+ $body .= "\n\n" . __( "This means your site may be offline or broken. Don't panic; this can be fixed." );
+
+ $body .= "\n\n" . __( "Please check out your site now. It's possible that everything is working. If it says you need to update, you should do so:" );
+ $body .= "\n" . network_admin_url( 'update-core.php' );
+ break;
+ }
+
+ $critical_support = 'critical' === $type && ! empty( $core_update->support_email );
+ if ( $critical_support ) {
+ // Support offer if available.
+ /* translators: %s: Support e-mail */
+ $body .= "\n\n" . sprintf( __( 'The WordPress team is willing to help you. Forward this email to %s and the team will work with you to make sure your site is working.' ), $core_update->support_email );
+ } else {
+ // Add a note about the support forums.
+ $body .= "\n\n" . __( 'If you experience any issues or need support, the volunteers in the WordPress.org support forums may be able to help.' );
+ $body .= "\n" . __( 'https://wordpress.org/support/' );
+ }
+
+ // Updates are important!
+ if ( $type != 'success' || $newer_version_available ) {
+ $body .= "\n\n" . __( 'Keeping your site updated is important for security. It also makes the internet a safer place for you and your readers.' );
+ }
+
+ if ( $critical_support ) {
+ $body .= ' ' . __( "If you reach out to us, we'll also ensure you'll never have this problem again." );
+ }
+
+ // If things are successful and we're now on the latest, mention plugins and themes if any are out of date.
+ if ( $type == 'success' && ! $newer_version_available && ( get_plugin_updates() || get_theme_updates() ) ) {
+ $body .= "\n\n" . __( 'You also have some plugins or themes with updates available. Update them now:' );
+ $body .= "\n" . network_admin_url();
+ }
+
+ $body .= "\n\n" . __( 'The WordPress Team' ) . "\n";
+
+ if ( 'critical' == $type && is_wp_error( $result ) ) {
+ $body .= "\n***\n\n";
+ /* translators: %s: WordPress version */
+ $body .= sprintf( __( 'Your site was running version %s.' ), get_bloginfo( 'version' ) );
+ $body .= ' ' . __( 'We have some data that describes the error your site encountered.' );
+ $body .= ' ' . __( 'Your hosting company, support forum volunteers, or a friendly developer may be able to use this information to help you:' );
+
+ // If we had a rollback and we're still critical, then the rollback failed too.
+ // Loop through all errors (the main WP_Error, the update result, the rollback result) for code, data, etc.
+ if ( 'rollback_was_required' == $result->get_error_code() ) {
+ $errors = array( $result, $result->get_error_data()->update, $result->get_error_data()->rollback );
+ } else {
+ $errors = array( $result );
+ }
+
+ foreach ( $errors as $error ) {
+ if ( ! is_wp_error( $error ) ) {
+ continue;
+ }
+ $error_code = $error->get_error_code();
+ /* translators: %s: Error code */
+ $body .= "\n\n" . sprintf( __( 'Error code: %s' ), $error_code );
+ if ( 'rollback_was_required' == $error_code ) {
+ continue;
+ }
+ if ( $error->get_error_message() ) {
+ $body .= "\n" . $error->get_error_message();
+ }
+ $error_data = $error->get_error_data();
+ if ( $error_data ) {
+ $body .= "\n" . implode( ', ', (array) $error_data );
+ }
+ }
+ $body .= "\n";
+ }
+
+ $to = get_site_option( 'admin_email' );
+ $headers = '';
+
+ $email = compact( 'to', 'subject', 'body', 'headers' );
+
+ /**
+ * Filters the email sent following an automatic background core update.
+ *
+ * @since 3.7.0
+ *
+ * @param array $email {
+ * Array of email arguments that will be passed to wp_mail().
+ *
+ * @type string $to The email recipient. An array of emails
+ * can be returned, as handled by wp_mail().
+ * @type string $subject The email's subject.
+ * @type string $body The email message body.
+ * @type string $headers Any email headers, defaults to no headers.
+ * }
+ * @param string $type The type of email being sent. Can be one of
+ * 'success', 'fail', 'manual', 'critical'.
+ * @param object $core_update The update offer that was attempted.
+ * @param mixed $result The result for the core update. Can be WP_Error.
+ */
+ $email = apply_filters( 'auto_core_update_email', $email, $type, $core_update, $result );
+
+ wp_mail( $email['to'], wp_specialchars_decode( $email['subject'] ), $email['body'], $email['headers'] );
+ }
+
+ /**
+ * Prepares and sends an email of a full log of background update results, useful for debugging and geekery.
+ *
+ * @since 3.7.0
+ */
+ protected function send_debug_email() {
+ $update_count = 0;
+ foreach ( $this->update_results as $type => $updates ) {
+ $update_count += count( $updates );
+ }
+
+ $body = array();
+ $failures = 0;
+
+ /* translators: %s: Network home URL */
+ $body[] = sprintf( __( 'WordPress site: %s' ), network_home_url( '/' ) );
+
+ // Core
+ if ( isset( $this->update_results['core'] ) ) {
+ $result = $this->update_results['core'][0];
+ if ( $result->result && ! is_wp_error( $result->result ) ) {
+ /* translators: %s: WordPress core version */
+ $body[] = sprintf( __( 'SUCCESS: WordPress was successfully updated to %s' ), $result->name );
+ } else {
+ /* translators: %s: WordPress core version */
+ $body[] = sprintf( __( 'FAILED: WordPress failed to update to %s' ), $result->name );
+ $failures++;
+ }
+ $body[] = '';
+ }
+
+ // Plugins, Themes, Translations
+ foreach ( array( 'plugin', 'theme', 'translation' ) as $type ) {
+ if ( ! isset( $this->update_results[ $type ] ) ) {
+ continue;
+ }
+ $success_items = wp_list_filter( $this->update_results[ $type ], array( 'result' => true ) );
+ if ( $success_items ) {
+ $messages = array(
+ 'plugin' => __( 'The following plugins were successfully updated:' ),
+ 'theme' => __( 'The following themes were successfully updated:' ),
+ 'translation' => __( 'The following translations were successfully updated:' ),
+ );
+
+ $body[] = $messages[ $type ];
+ foreach ( wp_list_pluck( $success_items, 'name' ) as $name ) {
+ /* translators: %s: name of plugin / theme / translations */
+ $body[] = ' * ' . sprintf( __( 'SUCCESS: %s' ), $name );
+ }
+ }
+ if ( $success_items != $this->update_results[ $type ] ) {
+ // Failed updates
+ $messages = array(
+ 'plugin' => __( 'The following plugins failed to update:' ),
+ 'theme' => __( 'The following themes failed to update:' ),
+ 'translation' => __( 'The following translations failed to update:' ),
+ );
+
+ $body[] = $messages[ $type ];
+ foreach ( $this->update_results[ $type ] as $item ) {
+ if ( ! $item->result || is_wp_error( $item->result ) ) {
+ /* translators: %s: name of plugin / theme / translations */
+ $body[] = ' * ' . sprintf( __( 'FAILED: %s' ), $item->name );
+ $failures++;
+ }
+ }
+ }
+ $body[] = '';
+ }
+
+ $site_title = wp_specialchars_decode( get_bloginfo( 'name' ), ENT_QUOTES );
+ if ( $failures ) {
+ $body[] = trim(
+ __(
+ "BETA TESTING?
+=============
+
+This debugging email is sent when you are using a development version of WordPress.
+
+If you think these failures might be due to a bug in WordPress, could you report it?
+ * Open a thread in the support forums: https://wordpress.org/support/forum/alphabeta
+ * Or, if you're comfortable writing a bug report: https://core.trac.wordpress.org/
+
+Thanks! -- The WordPress Team"
+ )
+ );
+ $body[] = '';
+
+ /* translators: Background update failed notification email subject. %s: Site title */
+ $subject = sprintf( __( '[%s] Background Update Failed' ), $site_title );
+ } else {
+ /* translators: Background update finished notification email subject. %s: Site title */
+ $subject = sprintf( __( '[%s] Background Update Finished' ), $site_title );
+ }
+
+ $body[] = trim(
+ __(
+ 'UPDATE LOG
+=========='
+ )
+ );
+ $body[] = '';
+
+ foreach ( array( 'core', 'plugin', 'theme', 'translation' ) as $type ) {
+ if ( ! isset( $this->update_results[ $type ] ) ) {
+ continue;
+ }
+ foreach ( $this->update_results[ $type ] as $update ) {
+ $body[] = $update->name;
+ $body[] = str_repeat( '-', strlen( $update->name ) );
+ foreach ( $update->messages as $message ) {
+ $body[] = ' ' . html_entity_decode( str_replace( '&#8230;', '...', $message ) );
+ }
+ if ( is_wp_error( $update->result ) ) {
+ $results = array( 'update' => $update->result );
+ // If we rolled back, we want to know an error that occurred then too.
+ if ( 'rollback_was_required' === $update->result->get_error_code() ) {
+ $results = (array) $update->result->get_error_data();
+ }
+ foreach ( $results as $result_type => $result ) {
+ if ( ! is_wp_error( $result ) ) {
+ continue;
+ }
+
+ if ( 'rollback' === $result_type ) {
+ /* translators: 1: Error code, 2: Error message. */
+ $body[] = ' ' . sprintf( __( 'Rollback Error: [%1$s] %2$s' ), $result->get_error_code(), $result->get_error_message() );
+ } else {
+ /* translators: 1: Error code, 2: Error message. */
+ $body[] = ' ' . sprintf( __( 'Error: [%1$s] %2$s' ), $result->get_error_code(), $result->get_error_message() );
+ }
+
+ if ( $result->get_error_data() ) {
+ $body[] = ' ' . implode( ', ', (array) $result->get_error_data() );
+ }
+ }
+ }
+ $body[] = '';
+ }
+ }
+
+ $email = array(
+ 'to' => get_site_option( 'admin_email' ),
+ 'subject' => $subject,
+ 'body' => implode( "\n", $body ),
+ 'headers' => '',
+ );
+
+ /**
+ * Filters the debug email that can be sent following an automatic
+ * background core update.
+ *
+ * @since 3.8.0
+ *
+ * @param array $email {
+ * Array of email arguments that will be passed to wp_mail().
+ *
+ * @type string $to The email recipient. An array of emails
+ * can be returned, as handled by wp_mail().
+ * @type string $subject Email subject.
+ * @type string $body Email message body.
+ * @type string $headers Any email headers. Default empty.
+ * }
+ * @param int $failures The number of failures encountered while upgrading.
+ * @param mixed $results The results of all attempted updates.
+ */
+ $email = apply_filters( 'automatic_updates_debug_email', $email, $failures, $this->update_results );
+
+ wp_mail( $email['to'], wp_specialchars_decode( $email['subject'] ), $email['body'], $email['headers'] );
+ }
+}
diff --git a/www/crm/wp-admin/includes/class-wp-comments-list-table.php b/www/crm/wp-admin/includes/class-wp-comments-list-table.php
new file mode 100644
index 00000000..1c196fcf
--- /dev/null
+++ b/www/crm/wp-admin/includes/class-wp-comments-list-table.php
@@ -0,0 +1,861 @@
+<?php
+/**
+ * List Table API: WP_Comments_List_Table class
+ *
+ * @package WordPress
+ * @subpackage Administration
+ * @since 3.1.0
+ */
+
+/**
+ * Core class used to implement displaying comments in a list table.
+ *
+ * @since 3.1.0
+ * @access private
+ *
+ * @see WP_List_Table
+ */
+class WP_Comments_List_Table extends WP_List_Table {
+
+ public $checkbox = true;
+
+ public $pending_count = array();
+
+ public $extra_items;
+
+ private $user_can;
+
+ /**
+ * Constructor.
+ *
+ * @since 3.1.0
+ *
+ * @see WP_List_Table::__construct() for more information on default arguments.
+ *
+ * @global int $post_id
+ *
+ * @param array $args An associative array of arguments.
+ */
+ public function __construct( $args = array() ) {
+ global $post_id;
+
+ $post_id = isset( $_REQUEST['p'] ) ? absint( $_REQUEST['p'] ) : 0;
+
+ if ( get_option( 'show_avatars' ) ) {
+ add_filter( 'comment_author', array( $this, 'floated_admin_avatar' ), 10, 2 );
+ }
+
+ parent::__construct(
+ array(
+ 'plural' => 'comments',
+ 'singular' => 'comment',
+ 'ajax' => true,
+ 'screen' => isset( $args['screen'] ) ? $args['screen'] : null,
+ )
+ );
+ }
+
+ public function floated_admin_avatar( $name, $comment_ID ) {
+ $comment = get_comment( $comment_ID );
+ $avatar = get_avatar( $comment, 32, 'mystery' );
+ return "$avatar $name";
+ }
+
+ /**
+ * @return bool
+ */
+ public function ajax_user_can() {
+ return current_user_can( 'edit_posts' );
+ }
+
+ /**
+ * @global int $post_id
+ * @global string $comment_status
+ * @global string $search
+ * @global string $comment_type
+ */
+ public function prepare_items() {
+ global $post_id, $comment_status, $search, $comment_type;
+
+ $comment_status = isset( $_REQUEST['comment_status'] ) ? $_REQUEST['comment_status'] : 'all';
+ if ( ! in_array( $comment_status, array( 'all', 'mine', 'moderated', 'approved', 'spam', 'trash' ) ) ) {
+ $comment_status = 'all';
+ }
+
+ $comment_type = ! empty( $_REQUEST['comment_type'] ) ? $_REQUEST['comment_type'] : '';
+
+ $search = ( isset( $_REQUEST['s'] ) ) ? $_REQUEST['s'] : '';
+
+ $post_type = ( isset( $_REQUEST['post_type'] ) ) ? sanitize_key( $_REQUEST['post_type'] ) : '';
+
+ $user_id = ( isset( $_REQUEST['user_id'] ) ) ? $_REQUEST['user_id'] : '';
+
+ $orderby = ( isset( $_REQUEST['orderby'] ) ) ? $_REQUEST['orderby'] : '';
+ $order = ( isset( $_REQUEST['order'] ) ) ? $_REQUEST['order'] : '';
+
+ $comments_per_page = $this->get_per_page( $comment_status );
+
+ $doing_ajax = wp_doing_ajax();
+
+ if ( isset( $_REQUEST['number'] ) ) {
+ $number = (int) $_REQUEST['number'];
+ } else {
+ $number = $comments_per_page + min( 8, $comments_per_page ); // Grab a few extra
+ }
+
+ $page = $this->get_pagenum();
+
+ if ( isset( $_REQUEST['start'] ) ) {
+ $start = $_REQUEST['start'];
+ } else {
+ $start = ( $page - 1 ) * $comments_per_page;
+ }
+
+ if ( $doing_ajax && isset( $_REQUEST['offset'] ) ) {
+ $start += $_REQUEST['offset'];
+ }
+
+ $status_map = array(
+ 'mine' => '',
+ 'moderated' => 'hold',
+ 'approved' => 'approve',
+ 'all' => '',
+ );
+
+ $args = array(
+ 'status' => isset( $status_map[ $comment_status ] ) ? $status_map[ $comment_status ] : $comment_status,
+ 'search' => $search,
+ 'user_id' => $user_id,
+ 'offset' => $start,
+ 'number' => $number,
+ 'post_id' => $post_id,
+ 'type' => $comment_type,
+ 'orderby' => $orderby,
+ 'order' => $order,
+ 'post_type' => $post_type,
+ );
+
+ /**
+ * Filters the arguments for the comment query in the comments list table.
+ *
+ * @since 5.1.0
+ *
+ * @param array $args An array of get_comments() arguments.
+ */
+ $args = apply_filters( 'comments_list_table_query_args', $args );
+
+ $_comments = get_comments( $args );
+ if ( is_array( $_comments ) ) {
+ update_comment_cache( $_comments );
+
+ $this->items = array_slice( $_comments, 0, $comments_per_page );
+ $this->extra_items = array_slice( $_comments, $comments_per_page );
+
+ $_comment_post_ids = array_unique( wp_list_pluck( $_comments, 'comment_post_ID' ) );
+
+ $this->pending_count = get_pending_comments_num( $_comment_post_ids );
+ }
+
+ $total_comments = get_comments(
+ array_merge(
+ $args,
+ array(
+ 'count' => true,
+ 'offset' => 0,
+ 'number' => 0,
+ )
+ )
+ );
+
+ $this->set_pagination_args(
+ array(
+ 'total_items' => $total_comments,
+ 'per_page' => $comments_per_page,
+ )
+ );
+ }
+
+ /**
+ * @param string $comment_status
+ * @return int
+ */
+ public function get_per_page( $comment_status = 'all' ) {
+ $comments_per_page = $this->get_items_per_page( 'edit_comments_per_page' );
+ /**
+ * Filters the number of comments listed per page in the comments list table.
+ *
+ * @since 2.6.0
+ *
+ * @param int $comments_per_page The number of comments to list per page.
+ * @param string $comment_status The comment status name. Default 'All'.
+ */
+ return apply_filters( 'comments_per_page', $comments_per_page, $comment_status );
+ }
+
+ /**
+ * @global string $comment_status
+ */
+ public function no_items() {
+ global $comment_status;
+
+ if ( 'moderated' === $comment_status ) {
+ _e( 'No comments awaiting moderation.' );
+ } else {
+ _e( 'No comments found.' );
+ }
+ }
+
+ /**
+ * @global int $post_id
+ * @global string $comment_status
+ * @global string $comment_type
+ */
+ protected function get_views() {
+ global $post_id, $comment_status, $comment_type;
+
+ $status_links = array();
+ $num_comments = ( $post_id ) ? wp_count_comments( $post_id ) : wp_count_comments();
+
+ $stati = array(
+ /* translators: %s: all comments count */
+ 'all' => _nx_noop(
+ 'All <span class="count">(%s)</span>',
+ 'All <span class="count">(%s)</span>',
+ 'comments'
+ ), // singular not used
+
+ /* translators: %s: current user's comments count */
+ 'mine' => _nx_noop(
+ 'Mine <span class="count">(%s)</span>',
+ 'Mine <span class="count">(%s)</span>',
+ 'comments'
+ ),
+
+ /* translators: %s: pending comments count */
+ 'moderated' => _nx_noop(
+ 'Pending <span class="count">(%s)</span>',
+ 'Pending <span class="count">(%s)</span>',
+ 'comments'
+ ),
+
+ /* translators: %s: approved comments count */
+ 'approved' => _nx_noop(
+ 'Approved <span class="count">(%s)</span>',
+ 'Approved <span class="count">(%s)</span>',
+ 'comments'
+ ),
+
+ /* translators: %s: spam comments count */
+ 'spam' => _nx_noop(
+ 'Spam <span class="count">(%s)</span>',
+ 'Spam <span class="count">(%s)</span>',
+ 'comments'
+ ),
+
+ /* translators: %s: trashed comments count */
+ 'trash' => _nx_noop(
+ 'Trash <span class="count">(%s)</span>',
+ 'Trash <span class="count">(%s)</span>',
+ 'comments'
+ ),
+ );
+
+ if ( ! EMPTY_TRASH_DAYS ) {
+ unset( $stati['trash'] );
+ }
+
+ $link = admin_url( 'edit-comments.php' );
+ if ( ! empty( $comment_type ) && 'all' != $comment_type ) {
+ $link = add_query_arg( 'comment_type', $comment_type, $link );
+ }
+
+ foreach ( $stati as $status => $label ) {
+ $current_link_attributes = '';
+
+ if ( $status === $comment_status ) {
+ $current_link_attributes = ' class="current" aria-current="page"';
+ }
+
+ if ( 'mine' === $status ) {
+ $current_user_id = get_current_user_id();
+ $num_comments->mine = get_comments(
+ array(
+ 'post_id' => $post_id ? $post_id : 0,
+ 'user_id' => $current_user_id,
+ 'count' => true,
+ )
+ );
+ $link = add_query_arg( 'user_id', $current_user_id, $link );
+ } else {
+ $link = remove_query_arg( 'user_id', $link );
+ }
+
+ if ( ! isset( $num_comments->$status ) ) {
+ $num_comments->$status = 10;
+ }
+ $link = add_query_arg( 'comment_status', $status, $link );
+ if ( $post_id ) {
+ $link = add_query_arg( 'p', absint( $post_id ), $link );
+ }
+ /*
+ // I toyed with this, but decided against it. Leaving it in here in case anyone thinks it is a good idea. ~ Mark
+ if ( !empty( $_REQUEST['s'] ) )
+ $link = add_query_arg( 's', esc_attr( wp_unslash( $_REQUEST['s'] ) ), $link );
+ */
+ $status_links[ $status ] = "<a href='$link'$current_link_attributes>" . sprintf(
+ translate_nooped_plural( $label, $num_comments->$status ),
+ sprintf(
+ '<span class="%s-count">%s</span>',
+ ( 'moderated' === $status ) ? 'pending' : $status,
+ number_format_i18n( $num_comments->$status )
+ )
+ ) . '</a>';
+ }
+
+ /**
+ * Filters the comment status links.
+ *
+ * @since 2.5.0
+ * @since 5.1.0 The 'Mine' link was added.
+ *
+ * @param string[] $status_links An associative array of fully-formed comment status links. Includes 'All', 'Mine',
+ * 'Pending', 'Approved', 'Spam', and 'Trash'.
+ */
+ return apply_filters( 'comment_status_links', $status_links );
+ }
+
+ /**
+ * @global string $comment_status
+ *
+ * @return array
+ */
+ protected function get_bulk_actions() {
+ global $comment_status;
+
+ $actions = array();
+ if ( in_array( $comment_status, array( 'all', 'approved' ) ) ) {
+ $actions['unapprove'] = __( 'Unapprove' );
+ }
+ if ( in_array( $comment_status, array( 'all', 'moderated' ) ) ) {
+ $actions['approve'] = __( 'Approve' );
+ }
+ if ( in_array( $comment_status, array( 'all', 'moderated', 'approved', 'trash' ) ) ) {
+ $actions['spam'] = _x( 'Mark as Spam', 'comment' );
+ }
+
+ if ( 'trash' === $comment_status ) {
+ $actions['untrash'] = __( 'Restore' );
+ } elseif ( 'spam' === $comment_status ) {
+ $actions['unspam'] = _x( 'Not Spam', 'comment' );
+ }
+
+ if ( in_array( $comment_status, array( 'trash', 'spam' ) ) || ! EMPTY_TRASH_DAYS ) {
+ $actions['delete'] = __( 'Delete Permanently' );
+ } else {
+ $actions['trash'] = __( 'Move to Trash' );
+ }
+
+ return $actions;
+ }
+
+ /**
+ * @global string $comment_status
+ * @global string $comment_type
+ *
+ * @param string $which
+ */
+ protected function extra_tablenav( $which ) {
+ global $comment_status, $comment_type;
+ static $has_items;
+
+ if ( ! isset( $has_items ) ) {
+ $has_items = $this->has_items();
+ }
+ ?>
+ <div class="alignleft actions">
+ <?php
+ if ( 'top' === $which ) {
+ ?>
+ <label class="screen-reader-text" for="filter-by-comment-type"><?php _e( 'Filter by comment type' ); ?></label>
+ <select id="filter-by-comment-type" name="comment_type">
+ <option value=""><?php _e( 'All comment types' ); ?></option>
+ <?php
+ /**
+ * Filters the comment types dropdown menu.
+ *
+ * @since 2.7.0
+ *
+ * @param string[] $comment_types An array of comment types. Accepts 'Comments', 'Pings'.
+ */
+ $comment_types = apply_filters(
+ 'admin_comment_types_dropdown',
+ array(
+ 'comment' => __( 'Comments' ),
+ 'pings' => __( 'Pings' ),
+ )
+ );
+
+ foreach ( $comment_types as $type => $label ) {
+ echo "\t" . '<option value="' . esc_attr( $type ) . '"' . selected( $comment_type, $type, false ) . ">$label</option>\n";
+ }
+ ?>
+ </select>
+ <?php
+ /**
+ * Fires just before the Filter submit button for comment types.
+ *
+ * @since 3.5.0
+ */
+ do_action( 'restrict_manage_comments' );
+ submit_button( __( 'Filter' ), '', 'filter_action', false, array( 'id' => 'post-query-submit' ) );
+ }
+
+ if ( ( 'spam' === $comment_status || 'trash' === $comment_status ) && current_user_can( 'moderate_comments' ) && $has_items ) {
+ wp_nonce_field( 'bulk-destroy', '_destroy_nonce' );
+ $title = ( 'spam' === $comment_status ) ? esc_attr__( 'Empty Spam' ) : esc_attr__( 'Empty Trash' );
+ submit_button( $title, 'apply', 'delete_all', false );
+ }
+ /**
+ * Fires after the Filter submit button for comment types.
+ *
+ * @since 2.5.0
+ *
+ * @param string $comment_status The comment status name. Default 'All'.
+ */
+ do_action( 'manage_comments_nav', $comment_status );
+ echo '</div>';
+ }
+
+ /**
+ * @return string|false
+ */
+ public function current_action() {
+ if ( isset( $_REQUEST['delete_all'] ) || isset( $_REQUEST['delete_all2'] ) ) {
+ return 'delete_all';
+ }
+
+ return parent::current_action();
+ }
+
+ /**
+ * @global int $post_id
+ *
+ * @return array
+ */
+ public function get_columns() {
+ global $post_id;
+
+ $columns = array();
+
+ if ( $this->checkbox ) {
+ $columns['cb'] = '<input type="checkbox" />';
+ }
+
+ $columns['author'] = __( 'Author' );
+ $columns['comment'] = _x( 'Comment', 'column name' );
+
+ if ( ! $post_id ) {
+ /* translators: column name or table row header */
+ $columns['response'] = __( 'In Response To' );
+ }
+
+ $columns['date'] = _x( 'Submitted On', 'column name' );
+
+ return $columns;
+ }
+
+ /**
+ * @return array
+ */
+ protected function get_sortable_columns() {
+ return array(
+ 'author' => 'comment_author',
+ 'response' => 'comment_post_ID',
+ 'date' => 'comment_date',
+ );
+ }
+
+ /**
+ * Get the name of the default primary column.
+ *
+ * @since 4.3.0
+ *
+ * @return string Name of the default primary column, in this case, 'comment'.
+ */
+ protected function get_default_primary_column_name() {
+ return 'comment';
+ }
+
+ /**
+ */
+ public function display() {
+ wp_nonce_field( 'fetch-list-' . get_class( $this ), '_ajax_fetch_list_nonce' );
+
+ $this->display_tablenav( 'top' );
+
+ $this->screen->render_screen_reader_content( 'heading_list' );
+
+ ?>
+<table class="wp-list-table <?php echo implode( ' ', $this->get_table_classes() ); ?>">
+ <thead>
+ <tr>
+ <?php $this->print_column_headers(); ?>
+ </tr>
+ </thead>
+
+ <tbody id="the-comment-list" data-wp-lists="list:comment">
+ <?php $this->display_rows_or_placeholder(); ?>
+ </tbody>
+
+ <tbody id="the-extra-comment-list" data-wp-lists="list:comment" style="display: none;">
+ <?php
+ /*
+ * Back up the items to restore after printing the extra items markup.
+ * The extra items may be empty, which will prevent the table nav from displaying later.
+ */
+ $items = $this->items;
+ $this->items = $this->extra_items;
+ $this->display_rows_or_placeholder();
+ $this->items = $items;
+ ?>
+ </tbody>
+
+ <tfoot>
+ <tr>
+ <?php $this->print_column_headers( false ); ?>
+ </tr>
+ </tfoot>
+
+</table>
+ <?php
+
+ $this->display_tablenav( 'bottom' );
+ }
+
+ /**
+ * @global WP_Post $post
+ * @global WP_Comment $comment
+ *
+ * @param WP_Comment $item
+ */
+ public function single_row( $item ) {
+ global $post, $comment;
+
+ $comment = $item;
+
+ $the_comment_class = wp_get_comment_status( $comment );
+ if ( ! $the_comment_class ) {
+ $the_comment_class = '';
+ }
+ $the_comment_class = join( ' ', get_comment_class( $the_comment_class, $comment, $comment->comment_post_ID ) );
+
+ if ( $comment->comment_post_ID > 0 ) {
+ $post = get_post( $comment->comment_post_ID );
+ }
+ $this->user_can = current_user_can( 'edit_comment', $comment->comment_ID );
+
+ echo "<tr id='comment-$comment->comment_ID' class='$the_comment_class'>";
+ $this->single_row_columns( $comment );
+ echo "</tr>\n";
+
+ unset( $GLOBALS['post'], $GLOBALS['comment'] );
+ }
+
+ /**
+ * Generate and display row actions links.
+ *
+ * @since 4.3.0
+ *
+ * @global string $comment_status Status for the current listed comments.
+ *
+ * @param WP_Comment $comment The comment object.
+ * @param string $column_name Current column name.
+ * @param string $primary Primary column name.
+ * @return string|void Comment row actions output.
+ */
+ protected function handle_row_actions( $comment, $column_name, $primary ) {
+ global $comment_status;
+
+ if ( $primary !== $column_name ) {
+ return '';
+ }
+
+ if ( ! $this->user_can ) {
+ return;
+ }
+
+ $the_comment_status = wp_get_comment_status( $comment );
+
+ $out = '';
+
+ $del_nonce = esc_html( '_wpnonce=' . wp_create_nonce( "delete-comment_$comment->comment_ID" ) );
+ $approve_nonce = esc_html( '_wpnonce=' . wp_create_nonce( "approve-comment_$comment->comment_ID" ) );
+
+ $url = "comment.php?c=$comment->comment_ID";
+
+ $approve_url = esc_url( $url . "&action=approvecomment&$approve_nonce" );
+ $unapprove_url = esc_url( $url . "&action=unapprovecomment&$approve_nonce" );
+ $spam_url = esc_url( $url . "&action=spamcomment&$del_nonce" );
+ $unspam_url = esc_url( $url . "&action=unspamcomment&$del_nonce" );
+ $trash_url = esc_url( $url . "&action=trashcomment&$del_nonce" );
+ $untrash_url = esc_url( $url . "&action=untrashcomment&$del_nonce" );
+ $delete_url = esc_url( $url . "&action=deletecomment&$del_nonce" );
+
+ // Preorder it: Approve | Reply | Quick Edit | Edit | Spam | Trash.
+ $actions = array(
+ 'approve' => '',
+ 'unapprove' => '',
+ 'reply' => '',
+ 'quickedit' => '',
+ 'edit' => '',
+ 'spam' => '',
+ 'unspam' => '',
+ 'trash' => '',
+ 'untrash' => '',
+ 'delete' => '',
+ );
+
+ // Not looking at all comments.
+ if ( $comment_status && 'all' != $comment_status ) {
+ if ( 'approved' === $the_comment_status ) {
+ $actions['unapprove'] = "<a href='$unapprove_url' data-wp-lists='delete:the-comment-list:comment-$comment->comment_ID:e7e7d3:action=dim-comment&amp;new=unapproved' class='vim-u vim-destructive aria-button-if-js' aria-label='" . esc_attr__( 'Unapprove this comment' ) . "'>" . __( 'Unapprove' ) . '</a>';
+ } elseif ( 'unapproved' === $the_comment_status ) {
+ $actions['approve'] = "<a href='$approve_url' data-wp-lists='delete:the-comment-list:comment-$comment->comment_ID:e7e7d3:action=dim-comment&amp;new=approved' class='vim-a vim-destructive aria-button-if-js' aria-label='" . esc_attr__( 'Approve this comment' ) . "'>" . __( 'Approve' ) . '</a>';
+ }
+ } else {
+ $actions['approve'] = "<a href='$approve_url' data-wp-lists='dim:the-comment-list:comment-$comment->comment_ID:unapproved:e7e7d3:e7e7d3:new=approved' class='vim-a aria-button-if-js' aria-label='" . esc_attr__( 'Approve this comment' ) . "'>" . __( 'Approve' ) . '</a>';
+ $actions['unapprove'] = "<a href='$unapprove_url' data-wp-lists='dim:the-comment-list:comment-$comment->comment_ID:unapproved:e7e7d3:e7e7d3:new=unapproved' class='vim-u aria-button-if-js' aria-label='" . esc_attr__( 'Unapprove this comment' ) . "'>" . __( 'Unapprove' ) . '</a>';
+ }
+
+ if ( 'spam' !== $the_comment_status ) {
+ $actions['spam'] = "<a href='$spam_url' data-wp-lists='delete:the-comment-list:comment-$comment->comment_ID::spam=1' class='vim-s vim-destructive aria-button-if-js' aria-label='" . esc_attr__( 'Mark this comment as spam' ) . "'>" . /* translators: mark as spam link */ _x( 'Spam', 'verb' ) . '</a>';
+ } elseif ( 'spam' === $the_comment_status ) {
+ $actions['unspam'] = "<a href='$unspam_url' data-wp-lists='delete:the-comment-list:comment-$comment->comment_ID:66cc66:unspam=1' class='vim-z vim-destructive aria-button-if-js' aria-label='" . esc_attr__( 'Restore this comment from the spam' ) . "'>" . _x( 'Not Spam', 'comment' ) . '</a>';
+ }
+
+ if ( 'trash' === $the_comment_status ) {
+ $actions['untrash'] = "<a href='$untrash_url' data-wp-lists='delete:the-comment-list:comment-$comment->comment_ID:66cc66:untrash=1' class='vim-z vim-destructive aria-button-if-js' aria-label='" . esc_attr__( 'Restore this comment from the Trash' ) . "'>" . __( 'Restore' ) . '</a>';
+ }
+
+ if ( 'spam' === $the_comment_status || 'trash' === $the_comment_status || ! EMPTY_TRASH_DAYS ) {
+ $actions['delete'] = "<a href='$delete_url' data-wp-lists='delete:the-comment-list:comment-$comment->comment_ID::delete=1' class='delete vim-d vim-destructive aria-button-if-js' aria-label='" . esc_attr__( 'Delete this comment permanently' ) . "'>" . __( 'Delete Permanently' ) . '</a>';
+ } else {
+ $actions['trash'] = "<a href='$trash_url' data-wp-lists='delete:the-comment-list:comment-$comment->comment_ID::trash=1' class='delete vim-d vim-destructive aria-button-if-js' aria-label='" . esc_attr__( 'Move this comment to the Trash' ) . "'>" . _x( 'Trash', 'verb' ) . '</a>';
+ }
+
+ if ( 'spam' !== $the_comment_status && 'trash' !== $the_comment_status ) {
+ $actions['edit'] = "<a href='comment.php?action=editcomment&amp;c={$comment->comment_ID}' aria-label='" . esc_attr__( 'Edit this comment' ) . "'>" . __( 'Edit' ) . '</a>';
+
+ $format = '<button type="button" data-comment-id="%d" data-post-id="%d" data-action="%s" class="%s button-link" aria-expanded="false" aria-label="%s">%s</button>';
+
+ $actions['quickedit'] = sprintf( $format, $comment->comment_ID, $comment->comment_post_ID, 'edit', 'vim-q comment-inline', esc_attr__( 'Quick edit this comment inline' ), __( 'Quick&nbsp;Edit' ) );
+
+ $actions['reply'] = sprintf( $format, $comment->comment_ID, $comment->comment_post_ID, 'replyto', 'vim-r comment-inline', esc_attr__( 'Reply to this comment' ), __( 'Reply' ) );
+ }
+
+ /** This filter is documented in wp-admin/includes/dashboard.php */
+ $actions = apply_filters( 'comment_row_actions', array_filter( $actions ), $comment );
+
+ $i = 0;
+ $out .= '<div class="row-actions">';
+ foreach ( $actions as $action => $link ) {
+ ++$i;
+ ( ( ( 'approve' === $action || 'unapprove' === $action ) && 2 === $i ) || 1 === $i ) ? $sep = '' : $sep = ' | ';
+
+ // Reply and quickedit need a hide-if-no-js span when not added with ajax
+ if ( ( 'reply' === $action || 'quickedit' === $action ) && ! wp_doing_ajax() ) {
+ $action .= ' hide-if-no-js';
+ } elseif ( ( $action === 'untrash' && $the_comment_status === 'trash' ) || ( $action === 'unspam' && $the_comment_status === 'spam' ) ) {
+ if ( '1' == get_comment_meta( $comment->comment_ID, '_wp_trash_meta_status', true ) ) {
+ $action .= ' approve';
+ } else {
+ $action .= ' unapprove';
+ }
+ }
+
+ $out .= "<span class='$action'>$sep$link</span>";
+ }
+ $out .= '</div>';
+
+ $out .= '<button type="button" class="toggle-row"><span class="screen-reader-text">' . __( 'Show more details' ) . '</span></button>';
+
+ return $out;
+ }
+
+ /**
+ * @param WP_Comment $comment The comment object.
+ */
+ public function column_cb( $comment ) {
+ if ( $this->user_can ) {
+ ?>
+ <label class="screen-reader-text" for="cb-select-<?php echo $comment->comment_ID; ?>"><?php _e( 'Select comment' ); ?></label>
+ <input id="cb-select-<?php echo $comment->comment_ID; ?>" type="checkbox" name="delete_comments[]" value="<?php echo $comment->comment_ID; ?>" />
+ <?php
+ }
+ }
+
+ /**
+ * @param WP_Comment $comment The comment object.
+ */
+ public function column_comment( $comment ) {
+ echo '<div class="comment-author">';
+ $this->column_author( $comment );
+ echo '</div>';
+
+ if ( $comment->comment_parent ) {
+ $parent = get_comment( $comment->comment_parent );
+ if ( $parent ) {
+ $parent_link = esc_url( get_comment_link( $parent ) );
+ $name = get_comment_author( $parent );
+ printf(
+ /* translators: %s: comment link */
+ __( 'In reply to %s.' ),
+ '<a href="' . $parent_link . '">' . $name . '</a>'
+ );
+ }
+ }
+
+ comment_text( $comment );
+
+ if ( $this->user_can ) {
+ /** This filter is documented in wp-admin/includes/comment.php */
+ $comment_content = apply_filters( 'comment_edit_pre', $comment->comment_content );
+ ?>
+ <div id="inline-<?php echo $comment->comment_ID; ?>" class="hidden">
+ <textarea class="comment" rows="1" cols="1"><?php echo esc_textarea( $comment_content ); ?></textarea>
+ <div class="author-email"><?php echo esc_attr( $comment->comment_author_email ); ?></div>
+ <div class="author"><?php echo esc_attr( $comment->comment_author ); ?></div>
+ <div class="author-url"><?php echo esc_attr( $comment->comment_author_url ); ?></div>
+ <div class="comment_status"><?php echo $comment->comment_approved; ?></div>
+ </div>
+ <?php
+ }
+ }
+
+ /**
+ * @global string $comment_status
+ *
+ * @param WP_Comment $comment The comment object.
+ */
+ public function column_author( $comment ) {
+ global $comment_status;
+
+ $author_url = get_comment_author_url( $comment );
+
+ $author_url_display = untrailingslashit( preg_replace( '|^http(s)?://(www\.)?|i', '', $author_url ) );
+ if ( strlen( $author_url_display ) > 50 ) {
+ $author_url_display = wp_html_excerpt( $author_url_display, 49, '&hellip;' );
+ }
+
+ echo '<strong>';
+ comment_author( $comment );
+ echo '</strong><br />';
+ if ( ! empty( $author_url_display ) ) {
+ printf( '<a href="%s">%s</a><br />', esc_url( $author_url ), esc_html( $author_url_display ) );
+ }
+
+ if ( $this->user_can ) {
+ if ( ! empty( $comment->comment_author_email ) ) {
+ /** This filter is documented in wp-includes/comment-template.php */
+ $email = apply_filters( 'comment_email', $comment->comment_author_email, $comment );
+
+ if ( ! empty( $email ) && '@' !== $email ) {
+ printf( '<a href="%1$s">%2$s</a><br />', esc_url( 'mailto:' . $email ), esc_html( $email ) );
+ }
+ }
+
+ $author_ip = get_comment_author_IP( $comment );
+ if ( $author_ip ) {
+ $author_ip_url = add_query_arg(
+ array(
+ 's' => $author_ip,
+ 'mode' => 'detail',
+ ),
+ admin_url( 'edit-comments.php' )
+ );
+ if ( 'spam' === $comment_status ) {
+ $author_ip_url = add_query_arg( 'comment_status', 'spam', $author_ip_url );
+ }
+ printf( '<a href="%1$s">%2$s</a>', esc_url( $author_ip_url ), esc_html( $author_ip ) );
+ }
+ }
+ }
+
+ /**
+ * @param WP_Comment $comment The comment object.
+ */
+ public function column_date( $comment ) {
+ /* translators: 1: comment date, 2: comment time */
+ $submitted = sprintf(
+ __( '%1$s at %2$s' ),
+ /* translators: comment date format. See https://secure.php.net/date */
+ get_comment_date( __( 'Y/m/d' ), $comment ),
+ get_comment_date( __( 'g:i a' ), $comment )
+ );
+
+ echo '<div class="submitted-on">';
+ if ( 'approved' === wp_get_comment_status( $comment ) && ! empty( $comment->comment_post_ID ) ) {
+ printf(
+ '<a href="%s">%s</a>',
+ esc_url( get_comment_link( $comment ) ),
+ $submitted
+ );
+ } else {
+ echo $submitted;
+ }
+ echo '</div>';
+ }
+
+ /**
+ * @param WP_Comment $comment The comment object.
+ */
+ public function column_response( $comment ) {
+ $post = get_post();
+
+ if ( ! $post ) {
+ return;
+ }
+
+ if ( isset( $this->pending_count[ $post->ID ] ) ) {
+ $pending_comments = $this->pending_count[ $post->ID ];
+ } else {
+ $_pending_count_temp = get_pending_comments_num( array( $post->ID ) );
+ $pending_comments = $this->pending_count[ $post->ID ] = $_pending_count_temp[ $post->ID ];
+ }
+
+ if ( current_user_can( 'edit_post', $post->ID ) ) {
+ $post_link = "<a href='" . get_edit_post_link( $post->ID ) . "' class='comments-edit-item-link'>";
+ $post_link .= esc_html( get_the_title( $post->ID ) ) . '</a>';
+ } else {
+ $post_link = esc_html( get_the_title( $post->ID ) );
+ }
+
+ echo '<div class="response-links">';
+ if ( 'attachment' === $post->post_type && ( $thumb = wp_get_attachment_image( $post->ID, array( 80, 60 ), true ) ) ) {
+ echo $thumb;
+ }
+ echo $post_link;
+ $post_type_object = get_post_type_object( $post->post_type );
+ echo "<a href='" . get_permalink( $post->ID ) . "' class='comments-view-item-link'>" . $post_type_object->labels->view_item . '</a>';
+ echo '<span class="post-com-count-wrapper post-com-count-', $post->ID, '">';
+ $this->comments_bubble( $post->ID, $pending_comments );
+ echo '</span> ';
+ echo '</div>';
+ }
+
+ /**
+ * @param WP_Comment $comment The comment object.
+ * @param string $column_name The custom column's name.
+ */
+ public function column_default( $comment, $column_name ) {
+ /**
+ * Fires when the default column output is displayed for a single row.
+ *
+ * @since 2.8.0
+ *
+ * @param string $column_name The custom column's name.
+ * @param int $comment->comment_ID The custom column's unique ID number.
+ */
+ do_action( 'manage_comments_custom_column', $column_name, $comment->comment_ID );
+ }
+}
diff --git a/www/crm/wp-admin/includes/class-wp-community-events.php b/www/crm/wp-admin/includes/class-wp-community-events.php
new file mode 100644
index 00000000..2237ab34
--- /dev/null
+++ b/www/crm/wp-admin/includes/class-wp-community-events.php
@@ -0,0 +1,464 @@
+<?php
+/**
+ * Administration: Community Events class.
+ *
+ * @package WordPress
+ * @subpackage Administration
+ * @since 4.8.0
+ */
+
+/**
+ * Class WP_Community_Events.
+ *
+ * A client for api.wordpress.org/events.
+ *
+ * @since 4.8.0
+ */
+class WP_Community_Events {
+ /**
+ * ID for a WordPress user account.
+ *
+ * @since 4.8.0
+ *
+ * @var int
+ */
+ protected $user_id = 0;
+
+ /**
+ * Stores location data for the user.
+ *
+ * @since 4.8.0
+ *
+ * @var bool|array
+ */
+ protected $user_location = false;
+
+ /**
+ * Constructor for WP_Community_Events.
+ *
+ * @since 4.8.0
+ *
+ * @param int $user_id WP user ID.
+ * @param bool|array $user_location Stored location data for the user.
+ * false to pass no location;
+ * array to pass a location {
+ * @type string $description The name of the location
+ * @type string $latitude The latitude in decimal degrees notation, without the degree
+ * symbol. e.g.: 47.615200.
+ * @type string $longitude The longitude in decimal degrees notation, without the degree
+ * symbol. e.g.: -122.341100.
+ * @type string $country The ISO 3166-1 alpha-2 country code. e.g.: BR
+ * }
+ */
+ public function __construct( $user_id, $user_location = false ) {
+ $this->user_id = absint( $user_id );
+ $this->user_location = $user_location;
+ }
+
+ /**
+ * Gets data about events near a particular location.
+ *
+ * Cached events will be immediately returned if the `user_location` property
+ * is set for the current user, and cached events exist for that location.
+ *
+ * Otherwise, this method sends a request to the w.org Events API with location
+ * data. The API will send back a recognized location based on the data, along
+ * with nearby events.
+ *
+ * The browser's request for events is proxied with this method, rather
+ * than having the browser make the request directly to api.wordpress.org,
+ * because it allows results to be cached server-side and shared with other
+ * users and sites in the network. This makes the process more efficient,
+ * since increasing the number of visits that get cached data means users
+ * don't have to wait as often; if the user's browser made the request
+ * directly, it would also need to make a second request to WP in order to
+ * pass the data for caching. Having WP make the request also introduces
+ * the opportunity to anonymize the IP before sending it to w.org, which
+ * mitigates possible privacy concerns.
+ *
+ * @since 4.8.0
+ *
+ * @param string $location_search Optional. City name to help determine the location.
+ * e.g., "Seattle". Default empty string.
+ * @param string $timezone Optional. Timezone to help determine the location.
+ * Default empty string.
+ * @return array|WP_Error A WP_Error on failure; an array with location and events on
+ * success.
+ */
+ public function get_events( $location_search = '', $timezone = '' ) {
+ $cached_events = $this->get_cached_events();
+
+ if ( ! $location_search && $cached_events ) {
+ return $cached_events;
+ }
+
+ // include an unmodified $wp_version
+ include( ABSPATH . WPINC . '/version.php' );
+
+ $api_url = 'http://api.wordpress.org/events/1.0/';
+ $request_args = $this->get_request_args( $location_search, $timezone );
+ $request_args['user-agent'] = 'WordPress/' . $wp_version . '; ' . home_url( '/' );
+
+ if ( wp_http_supports( array( 'ssl' ) ) ) {
+ $api_url = set_url_scheme( $api_url, 'https' );
+ }
+
+ $response = wp_remote_get( $api_url, $request_args );
+ $response_code = wp_remote_retrieve_response_code( $response );
+ $response_body = json_decode( wp_remote_retrieve_body( $response ), true );
+ $response_error = null;
+
+ if ( is_wp_error( $response ) ) {
+ $response_error = $response;
+ } elseif ( 200 !== $response_code ) {
+ $response_error = new WP_Error(
+ 'api-error',
+ /* translators: %d: numeric HTTP status code, e.g. 400, 403, 500, 504, etc. */
+ sprintf( __( 'Invalid API response code (%d)' ), $response_code )
+ );
+ } elseif ( ! isset( $response_body['location'], $response_body['events'] ) ) {
+ $response_error = new WP_Error(
+ 'api-invalid-response',
+ isset( $response_body['error'] ) ? $response_body['error'] : __( 'Unknown API error.' )
+ );
+ }
+
+ if ( is_wp_error( $response_error ) ) {
+ return $response_error;
+ } else {
+ $expiration = false;
+
+ if ( isset( $response_body['ttl'] ) ) {
+ $expiration = $response_body['ttl'];
+ unset( $response_body['ttl'] );
+ }
+
+ /*
+ * The IP in the response is usually the same as the one that was sent
+ * in the request, but in some cases it is different. In those cases,
+ * it's important to reset it back to the IP from the request.
+ *
+ * For example, if the IP sent in the request is private (e.g., 192.168.1.100),
+ * then the API will ignore that and use the corresponding public IP instead,
+ * and the public IP will get returned. If the public IP were saved, though,
+ * then get_cached_events() would always return `false`, because the transient
+ * would be generated based on the public IP when saving the cache, but generated
+ * based on the private IP when retrieving the cache.
+ */
+ if ( ! empty( $response_body['location']['ip'] ) ) {
+ $response_body['location']['ip'] = $request_args['body']['ip'];
+ }
+
+ /*
+ * The API doesn't return a description for latitude/longitude requests,
+ * but the description is already saved in the user location, so that
+ * one can be used instead.
+ */
+ if ( $this->coordinates_match( $request_args['body'], $response_body['location'] ) && empty( $response_body['location']['description'] ) ) {
+ $response_body['location']['description'] = $this->user_location['description'];
+ }
+
+ $this->cache_events( $response_body, $expiration );
+
+ $response_body = $this->trim_events( $response_body );
+ $response_body = $this->format_event_data_time( $response_body );
+
+ return $response_body;
+ }
+ }
+
+ /**
+ * Builds an array of args to use in an HTTP request to the w.org Events API.
+ *
+ * @since 4.8.0
+ *
+ * @param string $search Optional. City search string. Default empty string.
+ * @param string $timezone Optional. Timezone string. Default empty string.
+ * @return array The request args.
+ */
+ protected function get_request_args( $search = '', $timezone = '' ) {
+ $args = array(
+ 'number' => 5, // Get more than three in case some get trimmed out.
+ 'ip' => self::get_unsafe_client_ip(),
+ );
+
+ /*
+ * Include the minimal set of necessary arguments, in order to increase the
+ * chances of a cache-hit on the API side.
+ */
+ if ( empty( $search ) && isset( $this->user_location['latitude'], $this->user_location['longitude'] ) ) {
+ $args['latitude'] = $this->user_location['latitude'];
+ $args['longitude'] = $this->user_location['longitude'];
+ } else {
+ $args['locale'] = get_user_locale( $this->user_id );
+
+ if ( $timezone ) {
+ $args['timezone'] = $timezone;
+ }
+
+ if ( $search ) {
+ $args['location'] = $search;
+ }
+ }
+
+ // Wrap the args in an array compatible with the second parameter of `wp_remote_get()`.
+ return array(
+ 'body' => $args,
+ );
+ }
+
+ /**
+ * Determines the user's actual IP address and attempts to partially
+ * anonymize an IP address by converting it to a network ID.
+ *
+ * Geolocating the network ID usually returns a similar location as the
+ * actual IP, but provides some privacy for the user.
+ *
+ * $_SERVER['REMOTE_ADDR'] cannot be used in all cases, such as when the user
+ * is making their request through a proxy, or when the web server is behind
+ * a proxy. In those cases, $_SERVER['REMOTE_ADDR'] is set to the proxy address rather
+ * than the user's actual address.
+ *
+ * Modified from https://stackoverflow.com/a/2031935/450127, MIT license.
+ * Modified from https://github.com/geertw/php-ip-anonymizer, MIT license.
+ *
+ * SECURITY WARNING: This function is _NOT_ intended to be used in
+ * circumstances where the authenticity of the IP address matters. This does
+ * _NOT_ guarantee that the returned address is valid or accurate, and it can
+ * be easily spoofed.
+ *
+ * @since 4.8.0
+ *
+ * @return false|string The anonymized address on success; the given address
+ * or false on failure.
+ */
+ public static function get_unsafe_client_ip() {
+ $client_ip = false;
+
+ // In order of preference, with the best ones for this purpose first.
+ $address_headers = array(
+ 'HTTP_CLIENT_IP',
+ 'HTTP_X_FORWARDED_FOR',
+ 'HTTP_X_FORWARDED',
+ 'HTTP_X_CLUSTER_CLIENT_IP',
+ 'HTTP_FORWARDED_FOR',
+ 'HTTP_FORWARDED',
+ 'REMOTE_ADDR',
+ );
+
+ foreach ( $address_headers as $header ) {
+ if ( array_key_exists( $header, $_SERVER ) ) {
+ /*
+ * HTTP_X_FORWARDED_FOR can contain a chain of comma-separated
+ * addresses. The first one is the original client. It can't be
+ * trusted for authenticity, but we don't need to for this purpose.
+ */
+ $address_chain = explode( ',', $_SERVER[ $header ] );
+ $client_ip = trim( $address_chain[0] );
+
+ break;
+ }
+ }
+
+ if ( ! $client_ip ) {
+ return false;
+ }
+
+ $anon_ip = wp_privacy_anonymize_ip( $client_ip, true );
+
+ if ( '0.0.0.0' === $anon_ip || '::' === $anon_ip ) {
+ return false;
+ }
+
+ return $anon_ip;
+ }
+
+ /**
+ * Test if two pairs of latitude/longitude coordinates match each other.
+ *
+ * @since 4.8.0
+ *
+ * @param array $a The first pair, with indexes 'latitude' and 'longitude'.
+ * @param array $b The second pair, with indexes 'latitude' and 'longitude'.
+ * @return bool True if they match, false if they don't.
+ */
+ protected function coordinates_match( $a, $b ) {
+ if ( ! isset( $a['latitude'], $a['longitude'], $b['latitude'], $b['longitude'] ) ) {
+ return false;
+ }
+
+ return $a['latitude'] === $b['latitude'] && $a['longitude'] === $b['longitude'];
+ }
+
+ /**
+ * Generates a transient key based on user location.
+ *
+ * This could be reduced to a one-liner in the calling functions, but it's
+ * intentionally a separate function because it's called from multiple
+ * functions, and having it abstracted keeps the logic consistent and DRY,
+ * which is less prone to errors.
+ *
+ * @since 4.8.0
+ *
+ * @param array $location Should contain 'latitude' and 'longitude' indexes.
+ * @return bool|string false on failure, or a string on success.
+ */
+ protected function get_events_transient_key( $location ) {
+ $key = false;
+
+ if ( isset( $location['ip'] ) ) {
+ $key = 'community-events-' . md5( $location['ip'] );
+ } elseif ( isset( $location['latitude'], $location['longitude'] ) ) {
+ $key = 'community-events-' . md5( $location['latitude'] . $location['longitude'] );
+ }
+
+ return $key;
+ }
+
+ /**
+ * Caches an array of events data from the Events API.
+ *
+ * @since 4.8.0
+ *
+ * @param array $events Response body from the API request.
+ * @param int|bool $expiration Optional. Amount of time to cache the events. Defaults to false.
+ * @return bool true if events were cached; false if not.
+ */
+ protected function cache_events( $events, $expiration = false ) {
+ $set = false;
+ $transient_key = $this->get_events_transient_key( $events['location'] );
+ $cache_expiration = $expiration ? absint( $expiration ) : HOUR_IN_SECONDS * 12;
+
+ if ( $transient_key ) {
+ $set = set_site_transient( $transient_key, $events, $cache_expiration );
+ }
+
+ return $set;
+ }
+
+ /**
+ * Gets cached events.
+ *
+ * @since 4.8.0
+ *
+ * @return false|array false on failure; an array containing `location`
+ * and `events` items on success.
+ */
+ public function get_cached_events() {
+ $cached_response = get_site_transient( $this->get_events_transient_key( $this->user_location ) );
+ $cached_response = $this->trim_events( $cached_response );
+
+ return $this->format_event_data_time( $cached_response );
+ }
+
+ /**
+ * Adds formatted date and time items for each event in an API response.
+ *
+ * This has to be called after the data is pulled from the cache, because
+ * the cached events are shared by all users. If it was called before storing
+ * the cache, then all users would see the events in the localized data/time
+ * of the user who triggered the cache refresh, rather than their own.
+ *
+ * @since 4.8.0
+ *
+ * @param array $response_body The response which contains the events.
+ * @return array The response with dates and times formatted.
+ */
+ protected function format_event_data_time( $response_body ) {
+ if ( isset( $response_body['events'] ) ) {
+ foreach ( $response_body['events'] as $key => $event ) {
+ $timestamp = strtotime( $event['date'] );
+
+ /*
+ * The `date_format` option is not used because it's important
+ * in this context to keep the day of the week in the formatted date,
+ * so that users can tell at a glance if the event is on a day they
+ * are available, without having to open the link.
+ */
+ /* translators: Date format for upcoming events on the dashboard. Include the day of the week. See https://secure.php.net/date. */
+ $response_body['events'][ $key ]['formatted_date'] = date_i18n( __( 'l, M j, Y' ), $timestamp );
+ $response_body['events'][ $key ]['formatted_time'] = date_i18n( get_option( 'time_format' ), $timestamp );
+ }
+ }
+
+ return $response_body;
+ }
+
+ /**
+ * Prepares the event list for presentation.
+ *
+ * Discards expired events, and makes WordCamps "sticky." Attendees need more
+ * advanced notice about WordCamps than they do for meetups, so camps should
+ * appear in the list sooner. If a WordCamp is coming up, the API will "stick"
+ * it in the response, even if it wouldn't otherwise appear. When that happens,
+ * the event will be at the end of the list, and will need to be moved into a
+ * higher position, so that it doesn't get trimmed off.
+ *
+ * @since 4.8.0
+ * @since 4.9.7 Stick a WordCamp to the final list.
+ *
+ * @param array $response_body The response body which contains the events.
+ * @return array The response body with events trimmed.
+ */
+ protected function trim_events( $response_body ) {
+ if ( isset( $response_body['events'] ) ) {
+ $wordcamps = array();
+ $current_timestamp = current_time( 'timestamp' );
+
+ foreach ( $response_body['events'] as $key => $event ) {
+ /*
+ * Skip WordCamps, because they might be multi-day events.
+ * Save a copy so they can be pinned later.
+ */
+ if ( 'wordcamp' === $event['type'] ) {
+ $wordcamps[] = $event;
+ continue;
+ }
+
+ $event_timestamp = strtotime( $event['date'] );
+
+ if ( $current_timestamp > $event_timestamp && ( $current_timestamp - $event_timestamp ) > DAY_IN_SECONDS ) {
+ unset( $response_body['events'][ $key ] );
+ }
+ }
+
+ $response_body['events'] = array_slice( $response_body['events'], 0, 3 );
+ $trimmed_event_types = wp_list_pluck( $response_body['events'], 'type' );
+
+ // Make sure the soonest upcoming WordCamp is pinned in the list.
+ if ( ! in_array( 'wordcamp', $trimmed_event_types ) && $wordcamps ) {
+ array_pop( $response_body['events'] );
+ array_push( $response_body['events'], $wordcamps[0] );
+ }
+ }
+
+ return $response_body;
+ }
+
+ /**
+ * Logs responses to Events API requests.
+ *
+ * @since 4.8.0
+ * @deprecated 4.9.0 Use a plugin instead. See #41217 for an example.
+ *
+ * @param string $message A description of what occurred.
+ * @param array $details Details that provide more context for the
+ * log entry.
+ */
+ protected function maybe_log_events_response( $message, $details ) {
+ _deprecated_function( __METHOD__, '4.9.0' );
+
+ if ( ! WP_DEBUG_LOG ) {
+ return;
+ }
+
+ error_log(
+ sprintf(
+ '%s: %s. Details: %s',
+ __METHOD__,
+ trim( $message, '.' ),
+ wp_json_encode( $details )
+ )
+ );
+ }
+}
diff --git a/www/crm/wp-admin/includes/class-wp-debug-data.php b/www/crm/wp-admin/includes/class-wp-debug-data.php
new file mode 100644
index 00000000..72df2621
--- /dev/null
+++ b/www/crm/wp-admin/includes/class-wp-debug-data.php
@@ -0,0 +1,1238 @@
+<?php
+/**
+ * Class for providing debug data based on a users WordPress environment.
+ *
+ * @package WordPress
+ * @subpackage Site_Health
+ * @since 5.2.0
+ */
+
+class WP_Debug_Data {
+ /**
+ * Calls all core functions to check for updates.
+ *
+ * @since 5.2.0
+ */
+ static function check_for_updates() {
+ wp_version_check();
+ wp_update_plugins();
+ wp_update_themes();
+ }
+
+ /**
+ * Static function for generating site debug data when required.
+ *
+ * @since 5.2.0
+ *
+ * @throws ImagickException
+ * @global wpdb $wpdb WordPress database abstraction object.
+ *
+ * @return array The debug data for the site.
+ */
+ static function debug_data() {
+ global $wpdb;
+
+ // Save few function calls.
+ $upload_dir = wp_get_upload_dir();
+ $permalink_structure = get_option( 'permalink_structure' );
+ $is_ssl = is_ssl();
+ $users_can_register = get_option( 'users_can_register' );
+ $default_comment_status = get_option( 'default_comment_status' );
+ $is_multisite = is_multisite();
+ $core_version = get_bloginfo( 'version' );
+ $core_updates = get_core_updates();
+ $core_update_needed = '';
+
+ foreach ( $core_updates as $core => $update ) {
+ if ( 'upgrade' === $update->response ) {
+ // translators: %s: Latest WordPress version number.
+ $core_update_needed = ' ' . sprintf( __( '(Latest version: %s)' ), $update->version );
+ } else {
+ $core_update_needed = '';
+ }
+ }
+
+ // Set up the array that holds all debug information.
+ $info = array();
+
+ $info['wp-core'] = array(
+ 'label' => __( 'WordPress' ),
+ 'fields' => array(
+ 'version' => array(
+ 'label' => __( 'Version' ),
+ 'value' => $core_version . $core_update_needed,
+ 'debug' => $core_version,
+ ),
+ 'site_language' => array(
+ 'label' => __( 'Site Language' ),
+ 'value' => get_locale(),
+ ),
+ 'user_language' => array(
+ 'label' => __( 'User Language' ),
+ 'value' => get_user_locale(),
+ ),
+ 'home_url' => array(
+ 'label' => __( 'Home URL' ),
+ 'value' => get_bloginfo( 'url' ),
+ 'private' => true,
+ ),
+ 'site_url' => array(
+ 'label' => __( 'Site URL' ),
+ 'value' => get_bloginfo( 'wpurl' ),
+ 'private' => true,
+ ),
+ 'permalink' => array(
+ 'label' => __( 'Permalink structure' ),
+ 'value' => $permalink_structure ?: __( 'No permalink structure set' ),
+ 'debug' => $permalink_structure,
+ ),
+ 'https_status' => array(
+ 'label' => __( 'Is this site using HTTPS?' ),
+ 'value' => $is_ssl ? __( 'Yes' ) : __( 'No' ),
+ 'debug' => $is_ssl,
+ ),
+ 'user_registration' => array(
+ 'label' => __( 'Can anyone register on this site?' ),
+ 'value' => $users_can_register ? __( 'Yes' ) : __( 'No' ),
+ 'debug' => $users_can_register,
+ ),
+ 'default_comment_status' => array(
+ 'label' => __( 'Default comment status' ),
+ 'value' => 'open' === $default_comment_status ? _x( 'Open', 'comment status' ) : _x( 'Closed', 'comment status' ),
+ 'debug' => $default_comment_status,
+ ),
+ 'multisite' => array(
+ 'label' => __( 'Is this a multisite?' ),
+ 'value' => $is_multisite ? __( 'Yes' ) : __( 'No' ),
+ 'debug' => $is_multisite,
+ ),
+ ),
+ );
+
+ if ( ! $is_multisite ) {
+ $info['wp-paths-sizes'] = array(
+ 'label' => __( 'Directories and Sizes' ),
+ 'fields' => array(),
+ );
+ }
+
+ $info['wp-dropins'] = array(
+ 'label' => __( 'Drop-ins' ),
+ 'show_count' => true,
+ 'description' => __( 'Drop-ins are single files that replace or enhance WordPress features in ways that are not possible for traditional plugins.' ),
+ 'fields' => array(),
+ );
+
+ $info['wp-active-theme'] = array(
+ 'label' => __( 'Active Theme' ),
+ 'fields' => array(),
+ );
+
+ $info['wp-themes'] = array(
+ 'label' => __( 'Other Themes' ),
+ 'show_count' => true,
+ 'fields' => array(),
+ );
+
+ $info['wp-mu-plugins'] = array(
+ 'label' => __( 'Must Use Plugins' ),
+ 'show_count' => true,
+ 'fields' => array(),
+ );
+
+ $info['wp-plugins-active'] = array(
+ 'label' => __( 'Active Plugins' ),
+ 'show_count' => true,
+ 'fields' => array(),
+ );
+
+ $info['wp-plugins-inactive'] = array(
+ 'label' => __( 'Inactive Plugins' ),
+ 'show_count' => true,
+ 'fields' => array(),
+ );
+
+ $info['wp-media'] = array(
+ 'label' => __( 'Media Handling' ),
+ 'fields' => array(),
+ );
+
+ $info['wp-server'] = array(
+ 'label' => __( 'Server' ),
+ 'description' => __( 'The options shown below relate to your server setup. If changes are required, you may need your web host&#8217;s assistance.' ),
+ 'fields' => array(),
+ );
+
+ $info['wp-database'] = array(
+ 'label' => __( 'Database' ),
+ 'fields' => array(),
+ );
+
+ // Check if WP_DEBUG_LOG is set.
+ $wp_debug_log_value = __( 'Disabled' );
+
+ if ( is_string( WP_DEBUG_LOG ) ) {
+ $wp_debug_log_value = WP_DEBUG_LOG;
+ } elseif ( WP_DEBUG_LOG ) {
+ $wp_debug_log_value = __( 'Enabled' );
+ }
+
+ // Check CONCATENATE_SCRIPTS.
+ if ( defined( 'CONCATENATE_SCRIPTS' ) ) {
+ $concatenate_scripts = CONCATENATE_SCRIPTS ? __( 'Enabled' ) : __( 'Disabled' );
+ $concatenate_scripts_debug = CONCATENATE_SCRIPTS ? 'true' : 'false';
+ } else {
+ $concatenate_scripts = __( 'Undefined' );
+ $concatenate_scripts_debug = 'undefined';
+ }
+
+ // Check COMPRESS_SCRIPTS.
+ if ( defined( 'COMPRESS_SCRIPTS' ) ) {
+ $compress_scripts = COMPRESS_SCRIPTS ? __( 'Enabled' ) : __( 'Disabled' );
+ $compress_scripts_debug = COMPRESS_SCRIPTS ? 'true' : 'false';
+ } else {
+ $compress_scripts = __( 'Undefined' );
+ $compress_scripts_debug = 'undefined';
+ }
+
+ // Check COMPRESS_CSS.
+ if ( defined( 'COMPRESS_CSS' ) ) {
+ $compress_css = COMPRESS_CSS ? __( 'Enabled' ) : __( 'Disabled' );
+ $compress_css_debug = COMPRESS_CSS ? 'true' : 'false';
+ } else {
+ $compress_css = __( 'Undefined' );
+ $compress_css_debug = 'undefined';
+ }
+
+ // Check WP_LOCAL_DEV.
+ if ( defined( 'WP_LOCAL_DEV' ) ) {
+ $wp_local_dev = WP_LOCAL_DEV ? __( 'Enabled' ) : __( 'Disabled' );
+ $wp_local_dev_debug = WP_LOCAL_DEV ? 'true' : 'false';
+ } else {
+ $wp_local_dev = __( 'Undefined' );
+ $wp_local_dev_debug = 'undefined';
+ }
+
+ $info['wp-constants'] = array(
+ 'label' => __( 'WordPress Constants' ),
+ 'description' => __( 'These settings alter where and how parts of WordPress are loaded.' ),
+ 'fields' => array(
+ 'ABSPATH' => array(
+ 'label' => 'ABSPATH',
+ 'value' => ABSPATH,
+ 'private' => true,
+ ),
+ 'WP_HOME' => array(
+ 'label' => 'WP_HOME',
+ 'value' => ( defined( 'WP_HOME' ) ? WP_HOME : __( 'Undefined' ) ),
+ 'debug' => ( defined( 'WP_HOME' ) ? WP_HOME : 'undefined' ),
+ ),
+ 'WP_SITEURL' => array(
+ 'label' => 'WP_SITEURL',
+ 'value' => ( defined( 'WP_SITEURL' ) ? WP_SITEURL : __( 'Undefined' ) ),
+ 'debug' => ( defined( 'WP_SITEURL' ) ? WP_SITEURL : 'undefined' ),
+ ),
+ 'WP_CONTENT_DIR' => array(
+ 'label' => 'WP_CONTENT_DIR',
+ 'value' => WP_CONTENT_DIR,
+ ),
+ 'WP_PLUGIN_DIR' => array(
+ 'label' => 'WP_PLUGIN_DIR',
+ 'value' => WP_PLUGIN_DIR,
+ ),
+ 'WP_MAX_MEMORY_LIMIT' => array(
+ 'label' => 'WP_MAX_MEMORY_LIMIT',
+ 'value' => WP_MAX_MEMORY_LIMIT,
+ ),
+ 'WP_DEBUG' => array(
+ 'label' => 'WP_DEBUG',
+ 'value' => WP_DEBUG ? __( 'Enabled' ) : __( 'Disabled' ),
+ 'debug' => WP_DEBUG,
+ ),
+ 'WP_DEBUG_DISPLAY' => array(
+ 'label' => 'WP_DEBUG_DISPLAY',
+ 'value' => WP_DEBUG_DISPLAY ? __( 'Enabled' ) : __( 'Disabled' ),
+ 'debug' => WP_DEBUG_DISPLAY,
+ ),
+ 'WP_DEBUG_LOG' => array(
+ 'label' => 'WP_DEBUG_LOG',
+ 'value' => $wp_debug_log_value,
+ 'debug' => WP_DEBUG_LOG,
+ ),
+ 'SCRIPT_DEBUG' => array(
+ 'label' => 'SCRIPT_DEBUG',
+ 'value' => SCRIPT_DEBUG ? __( 'Enabled' ) : __( 'Disabled' ),
+ 'debug' => SCRIPT_DEBUG,
+ ),
+ 'WP_CACHE' => array(
+ 'label' => 'WP_CACHE',
+ 'value' => WP_CACHE ? __( 'Enabled' ) : __( 'Disabled' ),
+ 'debug' => WP_CACHE,
+ ),
+ 'CONCATENATE_SCRIPTS' => array(
+ 'label' => 'CONCATENATE_SCRIPTS',
+ 'value' => $concatenate_scripts,
+ 'debug' => $concatenate_scripts_debug,
+ ),
+ 'COMPRESS_SCRIPTS' => array(
+ 'label' => 'COMPRESS_SCRIPTS',
+ 'value' => $compress_scripts,
+ 'debug' => $compress_scripts_debug,
+ ),
+ 'COMPRESS_CSS' => array(
+ 'label' => 'COMPRESS_CSS',
+ 'value' => $compress_css,
+ 'debug' => $compress_css_debug,
+ ),
+ 'WP_LOCAL_DEV' => array(
+ 'label' => 'WP_LOCAL_DEV',
+ 'value' => $wp_local_dev,
+ 'debug' => $wp_local_dev_debug,
+ ),
+ ),
+ );
+
+ $is_writable_abspath = wp_is_writable( ABSPATH );
+ $is_writable_wp_content_dir = wp_is_writable( WP_CONTENT_DIR );
+ $is_writable_upload_dir = wp_is_writable( $upload_dir['basedir'] );
+ $is_writable_wp_plugin_dir = wp_is_writable( WP_PLUGIN_DIR );
+ $is_writable_template_directory = wp_is_writable( get_template_directory() . '/..' );
+
+ $info['wp-filesystem'] = array(
+ 'label' => __( 'Filesystem Permissions' ),
+ 'description' => __( 'Shows whether WordPress is able to write to the directories it needs access to.' ),
+ 'fields' => array(
+ 'wordpress' => array(
+ 'label' => __( 'The main WordPress directory' ),
+ 'value' => ( $is_writable_abspath ? __( 'Writable' ) : __( 'Not writable' ) ),
+ 'debug' => ( $is_writable_abspath ? 'writable' : 'not writable' ),
+ ),
+ 'wp-content' => array(
+ 'label' => __( 'The wp-content directory' ),
+ 'value' => ( $is_writable_wp_content_dir ? __( 'Writable' ) : __( 'Not writable' ) ),
+ 'debug' => ( $is_writable_wp_content_dir ? 'writable' : 'not writable' ),
+ ),
+ 'uploads' => array(
+ 'label' => __( 'The uploads directory' ),
+ 'value' => ( $is_writable_upload_dir ? __( 'Writable' ) : __( 'Not writable' ) ),
+ 'debug' => ( $is_writable_upload_dir ? 'writable' : 'not writable' ),
+ ),
+ 'plugins' => array(
+ 'label' => __( 'The plugins directory' ),
+ 'value' => ( $is_writable_wp_plugin_dir ? __( 'Writable' ) : __( 'Not writable' ) ),
+ 'debug' => ( $is_writable_wp_plugin_dir ? 'writable' : 'not writable' ),
+ ),
+ 'themes' => array(
+ 'label' => __( 'The themes directory' ),
+ 'value' => ( $is_writable_template_directory ? __( 'Writable' ) : __( 'Not writable' ) ),
+ 'debug' => ( $is_writable_template_directory ? 'writable' : 'not writable' ),
+ ),
+ ),
+ );
+
+ // Conditionally add debug information for multisite setups.
+ if ( is_multisite() ) {
+ $network_query = new WP_Network_Query();
+ $network_ids = $network_query->query(
+ array(
+ 'fields' => 'ids',
+ 'number' => 100,
+ 'no_found_rows' => false,
+ )
+ );
+
+ $site_count = 0;
+ foreach ( $network_ids as $network_id ) {
+ $site_count += get_blog_count( $network_id );
+ }
+
+ $info['wp-core']['fields']['user_count'] = array(
+ 'label' => __( 'User count' ),
+ 'value' => get_user_count(),
+ );
+
+ $info['wp-core']['fields']['site_count'] = array(
+ 'label' => __( 'Site count' ),
+ 'value' => $site_count,
+ );
+
+ $info['wp-core']['fields']['network_count'] = array(
+ 'label' => __( 'Network count' ),
+ 'value' => $network_query->found_networks,
+ );
+ } else {
+ $user_count = count_users();
+
+ $info['wp-core']['fields']['user_count'] = array(
+ 'label' => __( 'User count' ),
+ 'value' => $user_count['total_users'],
+ );
+ }
+
+ // WordPress features requiring processing.
+ $wp_dotorg = wp_remote_get( 'https://wordpress.org', array( 'timeout' => 10 ) );
+
+ if ( ! is_wp_error( $wp_dotorg ) ) {
+ $info['wp-core']['fields']['dotorg_communication'] = array(
+ 'label' => __( 'Communication with WordPress.org' ),
+ 'value' => __( 'WordPress.org is reachable' ),
+ 'debug' => 'true',
+ );
+ } else {
+ $info['wp-core']['fields']['dotorg_communication'] = array(
+ 'label' => __( 'Communication with WordPress.org' ),
+ 'value' => sprintf(
+ // translators: 1: The IP address WordPress.org resolves to. 2: The error returned by the lookup.
+ __( 'Unable to reach WordPress.org at %1$s: %2$s' ),
+ gethostbyname( 'wordpress.org' ),
+ $wp_dotorg->get_error_message()
+ ),
+ 'debug' => $wp_dotorg->get_error_message(),
+ );
+ }
+
+ // Remove accordion for Directories and Sizes if in Multisite.
+ if ( ! $is_multisite ) {
+ $loading = __( 'Loading&hellip;' );
+
+ $info['wp-paths-sizes']['fields'] = array(
+ 'wordpress_path' => array(
+ 'label' => __( 'WordPress directory location' ),
+ 'value' => untrailingslashit( ABSPATH ),
+ ),
+ 'wordpress_size' => array(
+ 'label' => __( 'WordPress directory size' ),
+ 'value' => $loading,
+ 'debug' => 'loading...',
+ ),
+ 'uploads_path' => array(
+ 'label' => __( 'Uploads directory location' ),
+ 'value' => $upload_dir['basedir'],
+ ),
+ 'uploads_size' => array(
+ 'label' => __( 'Uploads directory size' ),
+ 'value' => $loading,
+ 'debug' => 'loading...',
+ ),
+ 'themes_path' => array(
+ 'label' => __( 'Themes directory location' ),
+ 'value' => get_theme_root(),
+ ),
+ 'themes_size' => array(
+ 'label' => __( 'Themes directory size' ),
+ 'value' => $loading,
+ 'debug' => 'loading...',
+ ),
+ 'plugins_path' => array(
+ 'label' => __( 'Plugins directory location' ),
+ 'value' => WP_PLUGIN_DIR,
+ ),
+ 'plugins_size' => array(
+ 'label' => __( 'Plugins directory size' ),
+ 'value' => $loading,
+ 'debug' => 'loading...',
+ ),
+ 'database_size' => array(
+ 'label' => __( 'Database size' ),
+ 'value' => $loading,
+ 'debug' => 'loading...',
+ ),
+ 'total_size' => array(
+ 'label' => __( 'Total installation size' ),
+ 'value' => $loading,
+ 'debug' => 'loading...',
+ ),
+ );
+ }
+
+ // Get a list of all drop-in replacements.
+ $dropins = get_dropins();
+
+ // Get dropins descriptions.
+ $dropin_descriptions = _get_dropins();
+
+ // Spare few function calls.
+ $not_available = __( 'Not available' );
+
+ foreach ( $dropins as $dropin_key => $dropin ) {
+ $info['wp-dropins']['fields'][ sanitize_text_field( $dropin_key ) ] = array(
+ 'label' => $dropin_key,
+ 'value' => $dropin_descriptions[ $dropin_key ][0],
+ 'debug' => 'true',
+ );
+ }
+
+ // Populate the media fields.
+ $info['wp-media']['fields']['image_editor'] = array(
+ 'label' => __( 'Active editor' ),
+ 'value' => _wp_image_editor_choose(),
+ );
+
+ // Get ImageMagic information, if available.
+ if ( class_exists( 'Imagick' ) ) {
+ // Save the Imagick instance for later use.
+ $imagick = new Imagick();
+ $imagick_version = $imagick->getVersion();
+ } else {
+ $imagick_version = __( 'Not available' );
+ }
+
+ $info['wp-media']['fields']['imagick_module_version'] = array(
+ 'label' => __( 'ImageMagick version number' ),
+ 'value' => ( is_array( $imagick_version ) ? $imagick_version['versionNumber'] : $imagick_version ),
+ );
+
+ $info['wp-media']['fields']['imagemagick_version'] = array(
+ 'label' => __( 'ImageMagick version string' ),
+ 'value' => ( is_array( $imagick_version ) ? $imagick_version['versionString'] : $imagick_version ),
+ );
+
+ // If Imagick is used as our editor, provide some more information about its limitations.
+ if ( 'WP_Image_Editor_Imagick' === _wp_image_editor_choose() && isset( $imagick ) && $imagick instanceof Imagick ) {
+ $limits = array(
+ 'area' => ( defined( 'imagick::RESOURCETYPE_AREA' ) ? size_format( $imagick->getResourceLimit( imagick::RESOURCETYPE_AREA ) ) : $not_available ),
+ 'disk' => ( defined( 'imagick::RESOURCETYPE_DISK' ) ? $imagick->getResourceLimit( imagick::RESOURCETYPE_DISK ) : $not_available ),
+ 'file' => ( defined( 'imagick::RESOURCETYPE_FILE' ) ? $imagick->getResourceLimit( imagick::RESOURCETYPE_FILE ) : $not_available ),
+ 'map' => ( defined( 'imagick::RESOURCETYPE_MAP' ) ? size_format( $imagick->getResourceLimit( imagick::RESOURCETYPE_MAP ) ) : $not_available ),
+ 'memory' => ( defined( 'imagick::RESOURCETYPE_MEMORY' ) ? size_format( $imagick->getResourceLimit( imagick::RESOURCETYPE_MEMORY ) ) : $not_available ),
+ 'thread' => ( defined( 'imagick::RESOURCETYPE_THREAD' ) ? $imagick->getResourceLimit( imagick::RESOURCETYPE_THREAD ) : $not_available ),
+ );
+
+ $limits_debug = array(
+ 'imagick::RESOURCETYPE_AREA' => ( defined( 'imagick::RESOURCETYPE_AREA' ) ? size_format( $imagick->getResourceLimit( imagick::RESOURCETYPE_AREA ) ) : 'not available' ),
+ 'imagick::RESOURCETYPE_DISK' => ( defined( 'imagick::RESOURCETYPE_DISK' ) ? $imagick->getResourceLimit( imagick::RESOURCETYPE_DISK ) : 'not available' ),
+ 'imagick::RESOURCETYPE_FILE' => ( defined( 'imagick::RESOURCETYPE_FILE' ) ? $imagick->getResourceLimit( imagick::RESOURCETYPE_FILE ) : 'not available' ),
+ 'imagick::RESOURCETYPE_MAP' => ( defined( 'imagick::RESOURCETYPE_MAP' ) ? size_format( $imagick->getResourceLimit( imagick::RESOURCETYPE_MAP ) ) : 'not available' ),
+ 'imagick::RESOURCETYPE_MEMORY' => ( defined( 'imagick::RESOURCETYPE_MEMORY' ) ? size_format( $imagick->getResourceLimit( imagick::RESOURCETYPE_MEMORY ) ) : 'not available' ),
+ 'imagick::RESOURCETYPE_THREAD' => ( defined( 'imagick::RESOURCETYPE_THREAD' ) ? $imagick->getResourceLimit( imagick::RESOURCETYPE_THREAD ) : 'not available' ),
+ );
+
+ $info['wp-media']['fields']['imagick_limits'] = array(
+ 'label' => __( 'Imagick Resource Limits' ),
+ 'value' => $limits,
+ 'debug' => $limits_debug,
+ );
+ }
+
+ // Get GD information, if available.
+ if ( function_exists( 'gd_info' ) ) {
+ $gd = gd_info();
+ } else {
+ $gd = false;
+ }
+
+ $info['wp-media']['fields']['gd_version'] = array(
+ 'label' => __( 'GD version' ),
+ 'value' => ( is_array( $gd ) ? $gd['GD Version'] : $not_available ),
+ 'debug' => ( is_array( $gd ) ? $gd['GD Version'] : 'not available' ),
+ );
+
+ // Get Ghostscript information, if available.
+ if ( function_exists( 'exec' ) ) {
+ $gs = exec( 'gs --version' );
+
+ if ( empty( $gs ) ) {
+ $gs = $not_available;
+ $gs_debug = 'not available';
+ } else {
+ $gs_debug = $gs;
+ }
+ } else {
+ $gs = __( 'Unable to determine if Ghostscript is installed' );
+ $gs_debug = 'unknown';
+ }
+
+ $info['wp-media']['fields']['ghostscript_version'] = array(
+ 'label' => __( 'Ghostscript version' ),
+ 'value' => $gs,
+ 'debug' => $gs_debug,
+ );
+
+ // Populate the server debug fields.
+ if ( function_exists( 'php_uname' ) ) {
+ $server_architecture = sprintf( '%s %s %s', php_uname( 's' ), php_uname( 'r' ), php_uname( 'm' ) );
+ } else {
+ $server_architecture = 'unknown';
+ }
+
+ if ( function_exists( 'phpversion' ) ) {
+ $php_version_debug = phpversion();
+ // Whether PHP supports 64bit
+ $php64bit = ( PHP_INT_SIZE * 8 === 64 );
+
+ $php_version = sprintf(
+ '%s %s',
+ $php_version_debug,
+ ( $php64bit ? __( '(Supports 64bit values)' ) : __( '(Does not support 64bit values)' ) )
+ );
+
+ if ( $php64bit ) {
+ $php_version_debug .= ' 64bit';
+ }
+ } else {
+ $php_version = __( 'Unable to determine PHP version' );
+ $php_version_debug = 'unknown';
+ }
+
+ if ( function_exists( 'php_sapi_name' ) ) {
+ $php_sapi = php_sapi_name();
+ } else {
+ $php_sapi = 'unknown';
+ }
+
+ $info['wp-server']['fields']['server_architecture'] = array(
+ 'label' => __( 'Server architecture' ),
+ 'value' => ( 'unknown' !== $server_architecture ? $server_architecture : __( 'Unable to determine server architecture' ) ),
+ 'debug' => $server_architecture,
+ );
+ $info['wp-server']['fields']['httpd_software'] = array(
+ 'label' => __( 'Web server' ),
+ 'value' => ( isset( $_SERVER['SERVER_SOFTWARE'] ) ? $_SERVER['SERVER_SOFTWARE'] : __( 'Unable to determine what web server software is used' ) ),
+ 'debug' => ( isset( $_SERVER['SERVER_SOFTWARE'] ) ? $_SERVER['SERVER_SOFTWARE'] : 'unknown' ),
+ );
+ $info['wp-server']['fields']['php_version'] = array(
+ 'label' => __( 'PHP version' ),
+ 'value' => $php_version,
+ 'debug' => $php_version_debug,
+ );
+ $info['wp-server']['fields']['php_sapi'] = array(
+ 'label' => __( 'PHP SAPI' ),
+ 'value' => ( 'unknown' !== $php_sapi ? $php_sapi : __( 'Unable to determine PHP SAPI' ) ),
+ 'debug' => $php_sapi,
+ );
+
+ // Some servers disable `ini_set()` and `ini_get()`, we check this before trying to get configuration values.
+ if ( ! function_exists( 'ini_get' ) ) {
+ $info['wp-server']['fields']['ini_get'] = array(
+ 'label' => __( 'Server settings' ),
+ 'value' => __( 'Unable to determine some settings, as the ini_get() function has been disabled.' ),
+ 'debug' => 'ini_get() is disabled',
+ );
+ } else {
+ $info['wp-server']['fields']['max_input_variables'] = array(
+ 'label' => __( 'PHP max input variables' ),
+ 'value' => ini_get( 'max_input_vars' ),
+ );
+ $info['wp-server']['fields']['time_limit'] = array(
+ 'label' => __( 'PHP time limit' ),
+ 'value' => ini_get( 'max_execution_time' ),
+ );
+ $info['wp-server']['fields']['memory_limit'] = array(
+ 'label' => __( 'PHP memory limit' ),
+ 'value' => ini_get( 'memory_limit' ),
+ );
+ $info['wp-server']['fields']['max_input_time'] = array(
+ 'label' => __( 'Max input time' ),
+ 'value' => ini_get( 'max_input_time' ),
+ );
+ $info['wp-server']['fields']['upload_max_size'] = array(
+ 'label' => __( 'Upload max filesize' ),
+ 'value' => ini_get( 'upload_max_filesize' ),
+ );
+ $info['wp-server']['fields']['php_post_max_size'] = array(
+ 'label' => __( 'PHP post max size' ),
+ 'value' => ini_get( 'post_max_size' ),
+ );
+ }
+
+ if ( function_exists( 'curl_version' ) ) {
+ $curl = curl_version();
+
+ $info['wp-server']['fields']['curl_version'] = array(
+ 'label' => __( 'cURL version' ),
+ 'value' => sprintf( '%s %s', $curl['version'], $curl['ssl_version'] ),
+ );
+ } else {
+ $info['wp-server']['fields']['curl_version'] = array(
+ 'label' => __( 'cURL version' ),
+ 'value' => $not_available,
+ 'debug' => 'not available',
+ );
+ }
+
+ // SUHOSIN
+ $suhosin_loaded = ( extension_loaded( 'suhosin' ) || ( defined( 'SUHOSIN_PATCH' ) && constant( 'SUHOSIN_PATCH' ) ) );
+
+ $info['wp-server']['fields']['suhosin'] = array(
+ 'label' => __( 'Is SUHOSIN installed?' ),
+ 'value' => ( $suhosin_loaded ? __( 'Yes' ) : __( 'No' ) ),
+ 'debug' => $suhosin_loaded,
+ );
+
+ // Imagick
+ $imagick_loaded = extension_loaded( 'imagick' );
+
+ $info['wp-server']['fields']['imagick_availability'] = array(
+ 'label' => __( 'Is the Imagick library available?' ),
+ 'value' => ( $imagick_loaded ? __( 'Yes' ) : __( 'No' ) ),
+ 'debug' => $imagick_loaded,
+ );
+
+ // Check if a .htaccess file exists.
+ if ( is_file( ABSPATH . '.htaccess' ) ) {
+ // If the file exists, grab the content of it.
+ $htaccess_content = file_get_contents( ABSPATH . '.htaccess' );
+
+ // Filter away the core WordPress rules.
+ $filtered_htaccess_content = trim( preg_replace( '/\# BEGIN WordPress[\s\S]+?# END WordPress/si', '', $htaccess_content ) );
+ $filtered_htaccess_content = ! empty( $filtered_htaccess_content );
+
+ $info['wp-server']['fields']['htaccess_extra_rules'] = array(
+ 'label' => __( '.htaccess rules' ),
+ 'value' => ( $filtered_htaccess_content ? __( 'Custom rules have been added to your .htaccess file.' ) : __( 'Your .htaccess file contains only core WordPress features.' ) ),
+ 'debug' => $filtered_htaccess_content,
+ );
+ }
+
+ // Populate the database debug fields.
+ if ( is_resource( $wpdb->dbh ) ) {
+ // Old mysql extension.
+ $extension = 'mysql';
+ } elseif ( is_object( $wpdb->dbh ) ) {
+ // mysqli or PDO.
+ $extension = get_class( $wpdb->dbh );
+ } else {
+ // Unknown sql extension.
+ $extension = null;
+ }
+
+ /*
+ * Check what database engine is used, this will throw compatibility
+ * warnings from PHP compatibility testers, but `mysql_*` is
+ * still valid in PHP 5.6, so we need to account for that.
+ */
+ if ( method_exists( $wpdb, 'db_version' ) ) {
+ if ( $wpdb->use_mysqli ) {
+ // phpcs:ignore WordPress.DB.RestrictedFunctions.mysql_mysqli_get_server_info
+ $server = mysqli_get_server_info( $wpdb->dbh );
+ } else {
+ // phpcs:ignore WordPress.DB.RestrictedFunctions.mysql_mysql_get_server_info
+ $server = mysql_get_server_info( $wpdb->dbh );
+ }
+ } else {
+ $server = null;
+ }
+
+ if ( isset( $wpdb->use_mysqli ) && $wpdb->use_mysqli ) {
+ $client_version = $wpdb->dbh->client_info;
+ } else {
+ // phpcs:ignore WordPress.DB.RestrictedFunctions.mysql_mysql_get_client_info
+ if ( preg_match( '|[0-9]{1,2}\.[0-9]{1,2}\.[0-9]{1,2}|', mysql_get_client_info(), $matches ) ) {
+ $client_version = $matches[0];
+ } else {
+ $client_version = null;
+ }
+ }
+
+ $info['wp-database']['fields']['extension'] = array(
+ 'label' => __( 'Extension' ),
+ 'value' => $extension,
+ );
+
+ $info['wp-database']['fields']['server_version'] = array(
+ 'label' => __( 'Server version' ),
+ 'value' => $server,
+ );
+
+ $info['wp-database']['fields']['client_version'] = array(
+ 'label' => __( 'Client version' ),
+ 'value' => $client_version,
+ );
+
+ $info['wp-database']['fields']['database_user'] = array(
+ 'label' => __( 'Database user' ),
+ 'value' => $wpdb->dbuser,
+ 'private' => true,
+ );
+
+ $info['wp-database']['fields']['database_host'] = array(
+ 'label' => __( 'Database host' ),
+ 'value' => $wpdb->dbhost,
+ 'private' => true,
+ );
+
+ $info['wp-database']['fields']['database_name'] = array(
+ 'label' => __( 'Database name' ),
+ 'value' => $wpdb->dbname,
+ 'private' => true,
+ );
+
+ $info['wp-database']['fields']['database_prefix'] = array(
+ 'label' => __( 'Database prefix' ),
+ 'value' => $wpdb->prefix,
+ 'private' => true,
+ );
+
+ // List must use plugins if there are any.
+ $mu_plugins = get_mu_plugins();
+
+ foreach ( $mu_plugins as $plugin_path => $plugin ) {
+ $plugin_version = $plugin['Version'];
+ $plugin_author = $plugin['Author'];
+
+ $plugin_version_string = __( 'No version or author information is available.' );
+ $plugin_version_string_debug = 'author: (undefined), version: (undefined)';
+
+ if ( ! empty( $plugin_version ) && ! empty( $plugin_author ) ) {
+ // translators: 1: Plugin version number. 2: Plugin author name.
+ $plugin_version_string = sprintf( __( 'Version %1$s by %2$s' ), $plugin_version, $plugin_author );
+ $plugin_version_string_debug = sprintf( 'version: %s, author: %s', $plugin_version, $plugin_author );
+ } else {
+ if ( ! empty( $plugin_author ) ) {
+ // translators: %s: Plugin author name.
+ $plugin_version_string = sprintf( __( 'By %s' ), $plugin_author );
+ $plugin_version_string_debug = sprintf( 'author: %s, version: (undefined)', $plugin_author );
+ }
+
+ if ( ! empty( $plugin_version ) ) {
+ // translators: %s: Plugin version number.
+ $plugin_version_string = sprintf( __( 'Version %s' ), $plugin_version );
+ $plugin_version_string_debug = sprintf( 'author: (undefined), version: %s', $plugin_version );
+ }
+ }
+
+ $info['wp-mu-plugins']['fields'][ sanitize_text_field( $plugin['Name'] ) ] = array(
+ 'label' => $plugin['Name'],
+ 'value' => $plugin_version_string,
+ 'debug' => $plugin_version_string_debug,
+ );
+ }
+
+ // List all available plugins.
+ $plugins = get_plugins();
+ $plugin_updates = get_plugin_updates();
+
+ foreach ( $plugins as $plugin_path => $plugin ) {
+ $plugin_part = ( is_plugin_active( $plugin_path ) ) ? 'wp-plugins-active' : 'wp-plugins-inactive';
+
+ $plugin_version = $plugin['Version'];
+ $plugin_author = $plugin['Author'];
+
+ $plugin_version_string = __( 'No version or author information is available.' );
+ $plugin_version_string_debug = 'author: (undefined), version: (undefined)';
+
+ if ( ! empty( $plugin_version ) && ! empty( $plugin_author ) ) {
+ // translators: 1: Plugin version number. 2: Plugin author name.
+ $plugin_version_string = sprintf( __( 'Version %1$s by %2$s' ), $plugin_version, $plugin_author );
+ $plugin_version_string_debug = sprintf( 'version: %s, author: %s', $plugin_version, $plugin_author );
+ } else {
+ if ( ! empty( $plugin_author ) ) {
+ // translators: %s: Plugin author name.
+ $plugin_version_string = sprintf( __( 'By %s' ), $plugin_author );
+ $plugin_version_string_debug = sprintf( 'author: %s, version: (undefined)', $plugin_author );
+ }
+
+ if ( ! empty( $plugin_version ) ) {
+ // translators: %s: Plugin version number.
+ $plugin_version_string = sprintf( __( 'Version %s' ), $plugin_version );
+ $plugin_version_string_debug = sprintf( 'author: (undefined), version: %s', $plugin_version );
+ }
+ }
+
+ if ( array_key_exists( $plugin_path, $plugin_updates ) ) {
+ // translators: %s: Latest plugin version number.
+ $plugin_version_string .= ' ' . sprintf( __( '(Latest version: %s)' ), $plugin_updates[ $plugin_path ]->update->new_version );
+ $plugin_version_string_debug .= sprintf( ' (latest version: %s)', $plugin_updates[ $plugin_path ]->update->new_version );
+ }
+
+ $info[ $plugin_part ]['fields'][ sanitize_text_field( $plugin['Name'] ) ] = array(
+ 'label' => $plugin['Name'],
+ 'value' => $plugin_version_string,
+ 'debug' => $plugin_version_string_debug,
+ );
+ }
+
+ // Populate the section for the currently active theme.
+ global $_wp_theme_features;
+ $theme_features = array();
+
+ if ( ! empty( $_wp_theme_features ) ) {
+ foreach ( $_wp_theme_features as $feature => $options ) {
+ $theme_features[] = $feature;
+ }
+ }
+
+ $active_theme = wp_get_theme();
+ $theme_updates = get_theme_updates();
+
+ // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase
+ $active_theme_version = $active_theme->Version;
+ $active_theme_version_debug = $active_theme_version;
+
+ if ( array_key_exists( $active_theme->stylesheet, $theme_updates ) ) {
+ $theme_update_new_version = $theme_updates[ $active_theme->stylesheet ]->update['new_version'];
+
+ // translators: %s: Latest theme version number.
+ $active_theme_version .= ' ' . sprintf( __( '(Latest version: %s)' ), $theme_update_new_version );
+ $active_theme_version_debug .= sprintf( ' (latest version: %s)', $theme_update_new_version );
+ }
+
+ $active_theme_author_uri = $active_theme->offsetGet( 'Author URI' );
+
+ $info['wp-active-theme']['fields'] = array(
+ 'name' => array(
+ 'label' => __( 'Name' ),
+ // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase
+ 'value' => $active_theme->Name,
+ ),
+ 'version' => array(
+ 'label' => __( 'Version' ),
+ 'value' => $active_theme_version,
+ 'debug' => $active_theme_version_debug,
+ ),
+ 'author' => array(
+ 'label' => __( 'Author' ),
+ // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase
+ 'value' => wp_kses( $active_theme->Author, array() ),
+ ),
+ 'author_website' => array(
+ 'label' => __( 'Author website' ),
+ 'value' => ( $active_theme_author_uri ? $active_theme_author_uri : __( 'Undefined' ) ),
+ 'debug' => ( $active_theme_author_uri ? $active_theme_author_uri : '(undefined)' ),
+ ),
+ 'parent_theme' => array(
+ 'label' => __( 'Parent theme' ),
+ 'value' => ( $active_theme->parent_theme ? $active_theme->parent_theme : __( 'None' ) ),
+ 'debug' => ( $active_theme->parent_theme ? $active_theme->parent_theme : 'none' ),
+ ),
+ 'theme_features' => array(
+ 'label' => __( 'Theme features' ),
+ 'value' => implode( ', ', $theme_features ),
+ ),
+ 'theme_path' => array(
+ 'label' => __( 'Theme directory location' ),
+ 'value' => get_template_directory(),
+ ),
+ );
+
+ // Populate a list of all themes available in the install.
+ $all_themes = wp_get_themes();
+
+ foreach ( $all_themes as $theme_slug => $theme ) {
+ // Ignore the currently active theme from the list of all themes.
+ if ( $active_theme->stylesheet === $theme_slug ) {
+ continue;
+ }
+ // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase
+ $theme_version = $theme->Version;
+ // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase
+ $theme_author = $theme->Author;
+
+ // Sanitize
+ $theme_author = wp_kses( $theme_author, array() );
+
+ $theme_version_string = __( 'No version or author information is available.' );
+ $theme_version_string_debug = 'undefined';
+
+ if ( ! empty( $theme_version ) && ! empty( $theme_author ) ) {
+ // translators: 1: Theme version number. 2: Theme author name.
+ $theme_version_string = sprintf( __( 'Version %1$s by %2$s' ), $theme_version, $theme_author );
+ $theme_version_string_debug = sprintf( 'version: %s, author: %s', $theme_version, $theme_author );
+ } else {
+ if ( ! empty( $theme_author ) ) {
+ // translators: %s: Theme author name.
+ $theme_version_string = sprintf( __( 'By %s' ), $theme_author );
+ $theme_version_string_debug = sprintf( 'author: %s, version: (undefined)', $theme_author );
+ }
+
+ if ( ! empty( $theme_version ) ) {
+ // translators: %s: Theme version number.
+ $theme_version_string = sprintf( __( 'Version %s' ), $theme_version );
+ $theme_version_string_debug = sprintf( 'author: (undefined), version: %s', $theme_version );
+ }
+ }
+
+ if ( array_key_exists( $theme_slug, $theme_updates ) ) {
+ // translators: %s: Latest theme version number.
+ $theme_version_string .= ' ' . sprintf( __( '(Latest version: %s)' ), $theme_updates[ $theme_slug ]->update['new_version'] );
+ $theme_version_string_debug .= sprintf( ' (latest version: %s)', $theme_updates[ $theme_slug ]->update['new_version'] );
+ }
+
+ // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase
+ $info['wp-themes']['fields'][ sanitize_text_field( $theme->Name ) ] = array(
+ 'label' => sprintf(
+ // translators: 1: Theme name. 2: Theme slug.
+ __( '%1$s (%2$s)' ),
+ // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase
+ $theme->Name,
+ $theme_slug
+ ),
+ 'value' => $theme_version_string,
+ 'debug' => $theme_version_string_debug,
+ );
+ }
+
+ // Add more filesystem checks
+ if ( defined( 'WPMU_PLUGIN_DIR' ) && is_dir( WPMU_PLUGIN_DIR ) ) {
+ $is_writable_wpmu_plugin_dir = wp_is_writable( WPMU_PLUGIN_DIR );
+
+ $info['wp-filesystem']['fields']['mu-plugins'] = array(
+ 'label' => __( 'The must use plugins directory' ),
+ 'value' => ( $is_writable_wpmu_plugin_dir ? __( 'Writable' ) : __( 'Not writable' ) ),
+ 'debug' => ( $is_writable_wpmu_plugin_dir ? 'writable' : 'not writable' ),
+ );
+ }
+
+ /**
+ * Add or modify the debug information.
+ *
+ * Plugin or themes may wish to introduce their own debug information without creating additional admin pages
+ * they can utilize this filter to introduce their own sections or add more data to existing sections.
+ *
+ * Array keys for sections added by core are all prefixed with `wp-`, plugins and themes should use their own slug as
+ * a prefix, both for consistency as well as avoiding key collisions. Note that the array keys are used as labels
+ * for the copied data.
+ *
+ * All strings are expected to be plain text except $description that can contain inline HTML tags (see below).
+ *
+ * @since 5.2.0
+ *
+ * @param array $args {
+ * The debug information to be added to the core information page.
+ *
+ * This is an associative multi-dimensional array, up to three levels deep. The topmost array holds the sections.
+ * Each section has a `$fields` associative array (see below), and each `$value` in `$fields` can be
+ * another associative array of name/value pairs when there is more structured data to display.
+ *
+ * @type string $label The title for this section of the debug output.
+ * @type string $description Optional. A description for your information section which may contain basic HTML
+ * markup, inline tags only as it is outputted in a paragraph.
+ * @type boolean $show_count Optional. If set to `true` the amount of fields will be included in the title for
+ * this section.
+ * @type boolean $private Optional. If set to `true` the section and all associated fields will be excluded
+ * from the copied data.
+ * @type array $fields {
+ * An associative array containing the data to be displayed.
+ *
+ * @type string $label The label for this piece of information.
+ * @type string $value The output that is displayed for this field. Text should be translated. Can be
+ * an associative array that is displayed as name/value pairs.
+ * @type string $debug Optional. The output that is used for this field when the user copies the data.
+ * It should be more concise and not translated. If not set, the content of `$value` is used.
+ * Note that the array keys are used as labels for the copied data.
+ * @type boolean $private Optional. If set to `true` the field will not be included in the copied data
+ * allowing you to show, for example, API keys here.
+ * }
+ * }
+ */
+ $info = apply_filters( 'debug_information', $info );
+
+ return $info;
+ }
+
+ /**
+ * Format the information gathered for debugging, in a manner suitable for copying to a forum or support ticket.
+ *
+ * @since 5.2.0
+ *
+ * @param array $info_array Information gathered from the `WP_Debug_Data::debug_data` function.
+ * @param string $type The data type to return, either 'info' or 'debug'.
+ * @return string The formatted data.
+ */
+ public static function format( $info_array, $type ) {
+ $return = "`\n";
+
+ foreach ( $info_array as $section => $details ) {
+ // Skip this section if there are no fields, or the section has been declared as private.
+ if ( empty( $details['fields'] ) || ( isset( $details['private'] ) && $details['private'] ) ) {
+ continue;
+ }
+
+ $section_label = 'debug' === $type ? $section : $details['label'];
+
+ $return .= sprintf(
+ "### %s%s ###\n\n",
+ $section_label,
+ ( isset( $details['show_count'] ) && $details['show_count'] ? sprintf( ' (%d)', count( $details['fields'] ) ) : '' )
+ );
+
+ foreach ( $details['fields'] as $field_name => $field ) {
+ if ( isset( $field['private'] ) && true === $field['private'] ) {
+ continue;
+ }
+
+ if ( 'debug' === $type && isset( $field['debug'] ) ) {
+ $debug_data = $field['debug'];
+ } else {
+ $debug_data = $field['value'];
+ }
+
+ // Can be array, one level deep only.
+ if ( is_array( $debug_data ) ) {
+ $value = '';
+
+ foreach ( $debug_data as $sub_field_name => $sub_field_value ) {
+ $value .= sprintf( "\n\t%s: %s", $sub_field_name, $sub_field_value );
+ }
+ } elseif ( is_bool( $debug_data ) ) {
+ $value = $debug_data ? 'true' : 'false';
+ } elseif ( empty( $debug_data ) && '0' !== $debug_data ) {
+ $value = 'undefined';
+ } else {
+ $value = $debug_data;
+ }
+
+ if ( 'debug' === $type ) {
+ $label = $field_name;
+ } else {
+ $label = $field['label'];
+ }
+
+ $return .= sprintf( "%s: %s\n", $label, $value );
+ }
+
+ $return .= "\n";
+ }
+
+ $return .= '`';
+
+ return $return;
+ }
+
+ /**
+ * Fetch the total size of all the database tables for the active database user.
+ *
+ * @since 5.2.0
+ *
+ * @return int The size of the database, in bytes.
+ */
+ public static function get_database_size() {
+ global $wpdb;
+ $size = 0;
+ $rows = $wpdb->get_results( 'SHOW TABLE STATUS', ARRAY_A );
+
+ if ( $wpdb->num_rows > 0 ) {
+ foreach ( $rows as $row ) {
+ $size += $row['Data_length'] + $row['Index_length'];
+ }
+ }
+
+ return (int) $size;
+ }
+
+ /**
+ * Fetch the sizes of the WordPress directories: `wordpress` (ABSPATH), `plugins`, `themes`, and `uploads`.
+ * Intended to supplement the array returned by `WP_Debug_Data::debug_data()`.
+ *
+ * @since 5.2.0
+ *
+ * @return array The sizes of the directories, also the database size and total installation size.
+ */
+ public static function get_sizes() {
+ $size_db = self::get_database_size();
+ $upload_dir = wp_get_upload_dir();
+
+ /*
+ * We will be using the PHP max execution time to prevent the size calculations
+ * from causing a timeout. The default value is 30 seconds, and some
+ * hosts do not allow you to read configuration values.
+ */
+ if ( function_exists( 'ini_get' ) ) {
+ $max_execution_time = ini_get( 'max_execution_time' );
+ }
+
+ // The max_execution_time defaults to 0 when PHP runs from cli.
+ // We still want to limit it below.
+ if ( empty( $max_execution_time ) ) {
+ $max_execution_time = 30;
+ }
+
+ if ( $max_execution_time > 20 ) {
+ // If the max_execution_time is set to lower than 20 seconds, reduce it a bit to prevent
+ // edge-case timeouts that may happen after the size loop has finished running.
+ $max_execution_time -= 2;
+ }
+
+ // Go through the various installation directories and calculate their sizes.
+ // No trailing slashes.
+ $paths = array(
+ 'wordpress_size' => untrailingslashit( ABSPATH ),
+ 'themes_size' => get_theme_root(),
+ 'plugins_size' => WP_PLUGIN_DIR,
+ 'uploads_size' => $upload_dir['basedir'],
+ );
+
+ $exclude = $paths;
+ unset( $exclude['wordpress_size'] );
+ $exclude = array_values( $exclude );
+
+ $size_total = 0;
+ $all_sizes = array();
+
+ // Loop over all the directories we want to gather the sizes for.
+ foreach ( $paths as $name => $path ) {
+ $dir_size = null; // Default to timeout.
+ $results = array(
+ 'path' => $path,
+ 'raw' => 0,
+ );
+
+ if ( microtime( true ) - WP_START_TIMESTAMP < $max_execution_time ) {
+ if ( 'wordpress_size' === $name ) {
+ $dir_size = recurse_dirsize( $path, $exclude, $max_execution_time );
+ } else {
+ $dir_size = recurse_dirsize( $path, null, $max_execution_time );
+ }
+ }
+
+ if ( false === $dir_size ) {
+ // Error reading.
+ $results['size'] = __( 'The size cannot be calculated. The directory is not accessible. Usually caused by invalid permissions.' );
+ $results['debug'] = 'not accessible';
+
+ // Stop total size calculation.
+ $size_total = null;
+ } elseif ( null === $dir_size ) {
+ // Timeout.
+ $results['size'] = __( 'The directory size calculation has timed out. Usually caused by a very large number of sub-directories and files.' );
+ $results['debug'] = 'timeout while calculating size';
+
+ // Stop total size calculation.
+ $size_total = null;
+ } else {
+ if ( null !== $size_total ) {
+ $size_total += $dir_size;
+ }
+
+ $results['raw'] = $dir_size;
+ $results['size'] = size_format( $dir_size, 2 );
+ $results['debug'] = $results['size'] . " ({$dir_size} bytes)";
+ }
+
+ $all_sizes[ $name ] = $results;
+ }
+
+ if ( $size_db > 0 ) {
+ $database_size = size_format( $size_db, 2 );
+
+ $all_sizes['database_size'] = array(
+ 'raw' => $size_db,
+ 'size' => $database_size,
+ 'debug' => $database_size . " ({$size_db} bytes)",
+ );
+ } else {
+ $all_sizes['database_size'] = array(
+ 'size' => __( 'Not available' ),
+ 'debug' => 'not available',
+ );
+ }
+
+ if ( null !== $size_total && $size_db > 0 ) {
+ $total_size = $size_total + $size_db;
+ $total_size_mb = size_format( $total_size, 2 );
+
+ $all_sizes['total_size'] = array(
+ 'raw' => $total_size,
+ 'size' => $total_size_mb,
+ 'debug' => $total_size_mb . " ({$total_size} bytes)",
+ );
+ } else {
+ $all_sizes['total_size'] = array(
+ 'size' => __( 'Total size is not available. Some errors were encountered when determining the size of your installation.' ),
+ 'debug' => 'not available',
+ );
+ }
+
+ return $all_sizes;
+ }
+}
diff --git a/www/crm/wp-admin/includes/class-wp-filesystem-base.php b/www/crm/wp-admin/includes/class-wp-filesystem-base.php
new file mode 100644
index 00000000..45e44747
--- /dev/null
+++ b/www/crm/wp-admin/includes/class-wp-filesystem-base.php
@@ -0,0 +1,827 @@
+<?php
+/**
+ * Base WordPress Filesystem
+ *
+ * @package WordPress
+ * @subpackage Filesystem
+ */
+
+/**
+ * Base WordPress Filesystem class which Filesystem implementations extend.
+ *
+ * @since 2.5.0
+ */
+class WP_Filesystem_Base {
+
+ /**
+ * Whether to display debug data for the connection.
+ *
+ * @since 2.5.0
+ * @var bool
+ */
+ public $verbose = false;
+
+ /**
+ * Cached list of local filepaths to mapped remote filepaths.
+ *
+ * @since 2.7.0
+ * @var array
+ */
+ public $cache = array();
+
+ /**
+ * The Access method of the current connection, Set automatically.
+ *
+ * @since 2.5.0
+ * @var string
+ */
+ public $method = '';
+
+ /**
+ * @var WP_Error
+ */
+ public $errors = null;
+
+ /**
+ */
+ public $options = array();
+
+ /**
+ * Returns the path on the remote filesystem of ABSPATH.
+ *
+ * @since 2.7.0
+ *
+ * @return string The location of the remote path.
+ */
+ public function abspath() {
+ $folder = $this->find_folder( ABSPATH );
+ // Perhaps the FTP folder is rooted at the WordPress install, Check for wp-includes folder in root, Could have some false positives, but rare.
+ if ( ! $folder && $this->is_dir( '/' . WPINC ) ) {
+ $folder = '/';
+ }
+ return $folder;
+ }
+
+ /**
+ * Returns the path on the remote filesystem of WP_CONTENT_DIR.
+ *
+ * @since 2.7.0
+ *
+ * @return string The location of the remote path.
+ */
+ public function wp_content_dir() {
+ return $this->find_folder( WP_CONTENT_DIR );
+ }
+
+ /**
+ * Returns the path on the remote filesystem of WP_PLUGIN_DIR.
+ *
+ * @since 2.7.0
+ *
+ * @return string The location of the remote path.
+ */
+ public function wp_plugins_dir() {
+ return $this->find_folder( WP_PLUGIN_DIR );
+ }
+
+ /**
+ * Returns the path on the remote filesystem of the Themes Directory.
+ *
+ * @since 2.7.0
+ *
+ * @param string|false $theme Optional. The theme stylesheet or template for the directory.
+ * Default false.
+ * @return string The location of the remote path.
+ */
+ public function wp_themes_dir( $theme = false ) {
+ $theme_root = get_theme_root( $theme );
+
+ // Account for relative theme roots
+ if ( '/themes' == $theme_root || ! is_dir( $theme_root ) ) {
+ $theme_root = WP_CONTENT_DIR . $theme_root;
+ }
+
+ return $this->find_folder( $theme_root );
+ }
+
+ /**
+ * Returns the path on the remote filesystem of WP_LANG_DIR.
+ *
+ * @since 3.2.0
+ *
+ * @return string The location of the remote path.
+ */
+ public function wp_lang_dir() {
+ return $this->find_folder( WP_LANG_DIR );
+ }
+
+ /**
+ * Locates a folder on the remote filesystem.
+ *
+ * @since 2.5.0
+ * @deprecated 2.7.0 use WP_Filesystem::abspath() or WP_Filesystem::wp_*_dir() instead.
+ * @see WP_Filesystem::abspath()
+ * @see WP_Filesystem::wp_content_dir()
+ * @see WP_Filesystem::wp_plugins_dir()
+ * @see WP_Filesystem::wp_themes_dir()
+ * @see WP_Filesystem::wp_lang_dir()
+ *
+ * @param string $base The folder to start searching from.
+ * @param bool $echo True to display debug information.
+ * Default false.
+ * @return string The location of the remote path.
+ */
+ public function find_base_dir( $base = '.', $echo = false ) {
+ _deprecated_function( __FUNCTION__, '2.7.0', 'WP_Filesystem::abspath() or WP_Filesystem::wp_*_dir()' );
+ $this->verbose = $echo;
+ return $this->abspath();
+ }
+
+ /**
+ * Locates a folder on the remote filesystem.
+ *
+ * @since 2.5.0
+ * @deprecated 2.7.0 use WP_Filesystem::abspath() or WP_Filesystem::wp_*_dir() methods instead.
+ * @see WP_Filesystem::abspath()
+ * @see WP_Filesystem::wp_content_dir()
+ * @see WP_Filesystem::wp_plugins_dir()
+ * @see WP_Filesystem::wp_themes_dir()
+ * @see WP_Filesystem::wp_lang_dir()
+ *
+ * @param string $base The folder to start searching from.
+ * @param bool $echo True to display debug information.
+ * @return string The location of the remote path.
+ */
+ public function get_base_dir( $base = '.', $echo = false ) {
+ _deprecated_function( __FUNCTION__, '2.7.0', 'WP_Filesystem::abspath() or WP_Filesystem::wp_*_dir()' );
+ $this->verbose = $echo;
+ return $this->abspath();
+ }
+
+ /**
+ * Locates a folder on the remote filesystem.
+ *
+ * Assumes that on Windows systems, Stripping off the Drive
+ * letter is OK Sanitizes \\ to / in Windows filepaths.
+ *
+ * @since 2.7.0
+ *
+ * @param string $folder the folder to locate.
+ * @return string|false The location of the remote path, false on failure.
+ */
+ public function find_folder( $folder ) {
+ if ( isset( $this->cache[ $folder ] ) ) {
+ return $this->cache[ $folder ];
+ }
+
+ if ( stripos( $this->method, 'ftp' ) !== false ) {
+ $constant_overrides = array(
+ 'FTP_BASE' => ABSPATH,
+ 'FTP_CONTENT_DIR' => WP_CONTENT_DIR,
+ 'FTP_PLUGIN_DIR' => WP_PLUGIN_DIR,
+ 'FTP_LANG_DIR' => WP_LANG_DIR,
+ );
+
+ // Direct matches ( folder = CONSTANT/ )
+ foreach ( $constant_overrides as $constant => $dir ) {
+ if ( ! defined( $constant ) ) {
+ continue;
+ }
+ if ( $folder === $dir ) {
+ return trailingslashit( constant( $constant ) );
+ }
+ }
+
+ // Prefix Matches ( folder = CONSTANT/subdir )
+ foreach ( $constant_overrides as $constant => $dir ) {
+ if ( ! defined( $constant ) ) {
+ continue;
+ }
+ if ( 0 === stripos( $folder, $dir ) ) { // $folder starts with $dir
+ $potential_folder = preg_replace( '#^' . preg_quote( $dir, '#' ) . '/#i', trailingslashit( constant( $constant ) ), $folder );
+ $potential_folder = trailingslashit( $potential_folder );
+
+ if ( $this->is_dir( $potential_folder ) ) {
+ $this->cache[ $folder ] = $potential_folder;
+ return $potential_folder;
+ }
+ }
+ }
+ } elseif ( 'direct' == $this->method ) {
+ $folder = str_replace( '\\', '/', $folder ); // Windows path sanitisation
+ return trailingslashit( $folder );
+ }
+
+ $folder = preg_replace( '|^([a-z]{1}):|i', '', $folder ); // Strip out windows drive letter if it's there.
+ $folder = str_replace( '\\', '/', $folder ); // Windows path sanitisation
+
+ if ( isset( $this->cache[ $folder ] ) ) {
+ return $this->cache[ $folder ];
+ }
+
+ if ( $this->exists( $folder ) ) { // Folder exists at that absolute path.
+ $folder = trailingslashit( $folder );
+ $this->cache[ $folder ] = $folder;
+ return $folder;
+ }
+ if ( $return = $this->search_for_folder( $folder ) ) {
+ $this->cache[ $folder ] = $return;
+ }
+ return $return;
+ }
+
+ /**
+ * Locates a folder on the remote filesystem.
+ *
+ * Expects Windows sanitized path.
+ *
+ * @since 2.7.0
+ *
+ * @param string $folder The folder to locate.
+ * @param string $base The folder to start searching from.
+ * @param bool $loop If the function has recursed, Internal use only.
+ * @return string|false The location of the remote path, false to cease looping.
+ */
+ public function search_for_folder( $folder, $base = '.', $loop = false ) {
+ if ( empty( $base ) || '.' == $base ) {
+ $base = trailingslashit( $this->cwd() );
+ }
+
+ $folder = untrailingslashit( $folder );
+
+ if ( $this->verbose ) {
+ /* translators: 1: folder to locate, 2: folder to start searching from */
+ printf( "\n" . __( 'Looking for %1$s in %2$s' ) . "<br/>\n", $folder, $base );
+ }
+
+ $folder_parts = explode( '/', $folder );
+ $folder_part_keys = array_keys( $folder_parts );
+ $last_index = array_pop( $folder_part_keys );
+ $last_path = $folder_parts[ $last_index ];
+
+ $files = $this->dirlist( $base );
+
+ foreach ( $folder_parts as $index => $key ) {
+ if ( $index == $last_index ) {
+ continue; // We want this to be caught by the next code block.
+ }
+
+ /*
+ * Working from /home/ to /user/ to /wordpress/ see if that file exists within
+ * the current folder, If it's found, change into it and follow through looking
+ * for it. If it can't find WordPress down that route, it'll continue onto the next
+ * folder level, and see if that matches, and so on. If it reaches the end, and still
+ * can't find it, it'll return false for the entire function.
+ */
+ if ( isset( $files[ $key ] ) ) {
+
+ // Let's try that folder:
+ $newdir = trailingslashit( path_join( $base, $key ) );
+ if ( $this->verbose ) {
+ /* translators: %s: directory name */
+ printf( "\n" . __( 'Changing to %s' ) . "<br/>\n", $newdir );
+ }
+
+ // Only search for the remaining path tokens in the directory, not the full path again.
+ $newfolder = implode( '/', array_slice( $folder_parts, $index + 1 ) );
+ if ( $ret = $this->search_for_folder( $newfolder, $newdir, $loop ) ) {
+ return $ret;
+ }
+ }
+ }
+
+ // Only check this as a last resort, to prevent locating the incorrect install.
+ // All above procedures will fail quickly if this is the right branch to take.
+ if ( isset( $files[ $last_path ] ) ) {
+ if ( $this->verbose ) {
+ /* translators: %s: directory name */
+ printf( "\n" . __( 'Found %s' ) . "<br/>\n", $base . $last_path );
+ }
+ return trailingslashit( $base . $last_path );
+ }
+
+ // Prevent this function from looping again.
+ // No need to proceed if we've just searched in /
+ if ( $loop || '/' == $base ) {
+ return false;
+ }
+
+ // As an extra last resort, Change back to / if the folder wasn't found.
+ // This comes into effect when the CWD is /home/user/ but WP is at /var/www/....
+ return $this->search_for_folder( $folder, '/', true );
+
+ }
+
+ /**
+ * Returns the *nix-style file permissions for a file.
+ *
+ * From the PHP documentation page for fileperms().
+ *
+ * @link https://secure.php.net/manual/en/function.fileperms.php
+ *
+ * @since 2.5.0
+ *
+ * @param string $file String filename.
+ * @return string The *nix-style representation of permissions.
+ */
+ public function gethchmod( $file ) {
+ $perms = intval( $this->getchmod( $file ), 8 );
+ if ( ( $perms & 0xC000 ) == 0xC000 ) { // Socket
+ $info = 's';
+ } elseif ( ( $perms & 0xA000 ) == 0xA000 ) { // Symbolic Link
+ $info = 'l';
+ } elseif ( ( $perms & 0x8000 ) == 0x8000 ) { // Regular
+ $info = '-';
+ } elseif ( ( $perms & 0x6000 ) == 0x6000 ) { // Block special
+ $info = 'b';
+ } elseif ( ( $perms & 0x4000 ) == 0x4000 ) { // Directory
+ $info = 'd';
+ } elseif ( ( $perms & 0x2000 ) == 0x2000 ) { // Character special
+ $info = 'c';
+ } elseif ( ( $perms & 0x1000 ) == 0x1000 ) { // FIFO pipe
+ $info = 'p';
+ } else { // Unknown
+ $info = 'u';
+ }
+
+ // Owner
+ $info .= ( ( $perms & 0x0100 ) ? 'r' : '-' );
+ $info .= ( ( $perms & 0x0080 ) ? 'w' : '-' );
+ $info .= ( ( $perms & 0x0040 ) ?
+ ( ( $perms & 0x0800 ) ? 's' : 'x' ) :
+ ( ( $perms & 0x0800 ) ? 'S' : '-' ) );
+
+ // Group
+ $info .= ( ( $perms & 0x0020 ) ? 'r' : '-' );
+ $info .= ( ( $perms & 0x0010 ) ? 'w' : '-' );
+ $info .= ( ( $perms & 0x0008 ) ?
+ ( ( $perms & 0x0400 ) ? 's' : 'x' ) :
+ ( ( $perms & 0x0400 ) ? 'S' : '-' ) );
+
+ // World
+ $info .= ( ( $perms & 0x0004 ) ? 'r' : '-' );
+ $info .= ( ( $perms & 0x0002 ) ? 'w' : '-' );
+ $info .= ( ( $perms & 0x0001 ) ?
+ ( ( $perms & 0x0200 ) ? 't' : 'x' ) :
+ ( ( $perms & 0x0200 ) ? 'T' : '-' ) );
+ return $info;
+ }
+
+ /**
+ * Gets the permissions of the specified file or filepath in their octal format.
+ *
+ * @since 2.5.0
+ *
+ * @param string $file Path to the file.
+ * @return string Mode of the file (the last 3 digits).
+ */
+ public function getchmod( $file ) {
+ return '777';
+ }
+
+ /**
+ * Converts *nix-style file permissions to a octal number.
+ *
+ * Converts '-rw-r--r--' to 0644
+ * From "info at rvgate dot nl"'s comment on the PHP documentation for chmod()
+ *
+ * @link https://secure.php.net/manual/en/function.chmod.php#49614
+ *
+ * @since 2.5.0
+ *
+ * @param string $mode string The *nix-style file permission.
+ * @return int octal representation
+ */
+ public function getnumchmodfromh( $mode ) {
+ $realmode = '';
+ $legal = array( '', 'w', 'r', 'x', '-' );
+ $attarray = preg_split( '//', $mode );
+
+ for ( $i = 0, $c = count( $attarray ); $i < $c; $i++ ) {
+ if ( $key = array_search( $attarray[ $i ], $legal ) ) {
+ $realmode .= $legal[ $key ];
+ }
+ }
+
+ $mode = str_pad( $realmode, 10, '-', STR_PAD_LEFT );
+ $trans = array(
+ '-' => '0',
+ 'r' => '4',
+ 'w' => '2',
+ 'x' => '1',
+ );
+ $mode = strtr( $mode, $trans );
+
+ $newmode = $mode[0];
+ $newmode .= $mode[1] + $mode[2] + $mode[3];
+ $newmode .= $mode[4] + $mode[5] + $mode[6];
+ $newmode .= $mode[7] + $mode[8] + $mode[9];
+ return $newmode;
+ }
+
+ /**
+ * Determines if the string provided contains binary characters.
+ *
+ * @since 2.7.0
+ *
+ * @param string $text String to test against.
+ * @return bool True if string is binary, false otherwise.
+ */
+ public function is_binary( $text ) {
+ return (bool) preg_match( '|[^\x20-\x7E]|', $text ); // chr(32)..chr(127)
+ }
+
+ /**
+ * Changes the owner of a file or directory.
+ *
+ * Default behavior is to do nothing, override this in your subclass, if desired.
+ *
+ * @since 2.5.0
+ *
+ * @param string $file Path to the file or directory.
+ * @param string|int $owner A user name or number.
+ * @param bool $recursive Optional. If set to true, changes file owner recursively.
+ * Default false.
+ * @return bool True on success, false on failure.
+ */
+ public function chown( $file, $owner, $recursive = false ) {
+ return false;
+ }
+
+ /**
+ * Connects filesystem.
+ *
+ * @since 2.5.0
+ * @abstract
+ *
+ * @return bool True on success, false on failure (always true for WP_Filesystem_Direct).
+ */
+ public function connect() {
+ return true;
+ }
+
+ /**
+ * Reads entire file into a string.
+ *
+ * @since 2.5.0
+ * @abstract
+ *
+ * @param string $file Name of the file to read.
+ * @return string|false Read data on success, false on failure.
+ */
+ public function get_contents( $file ) {
+ return false;
+ }
+
+ /**
+ * Reads entire file into an array.
+ *
+ * @since 2.5.0
+ * @abstract
+ *
+ * @param string $file Path to the file.
+ * @return array|false File contents in an array on success, false on failure.
+ */
+ public function get_contents_array( $file ) {
+ return false;
+ }
+
+ /**
+ * Writes a string to a file.
+ *
+ * @since 2.5.0
+ * @abstract
+ *
+ * @param string $file Remote path to the file where to write the data.
+ * @param string $contents The data to write.
+ * @param int|false $mode Optional. The file permissions as octal number, usually 0644.
+ * Default false.
+ * @return bool True on success, false on failure.
+ */
+ public function put_contents( $file, $contents, $mode = false ) {
+ return false;
+ }
+
+ /**
+ * Gets the current working directory.
+ *
+ * @since 2.5.0
+ * @abstract
+ *
+ * @return string|false The current working directory on success, false on failure.
+ */
+ public function cwd() {
+ return false;
+ }
+
+ /**
+ * Changes current directory.
+ *
+ * @since 2.5.0
+ * @abstract
+ *
+ * @param string $dir The new current directory.
+ * @return bool True on success, false on failure.
+ */
+ public function chdir( $dir ) {
+ return false;
+ }
+
+ /**
+ * Changes the file group.
+ *
+ * @since 2.5.0
+ * @abstract
+ *
+ * @param string $file Path to the file.
+ * @param string|int $group A group name or number.
+ * @param bool $recursive Optional. If set to true, changes file group recursively.
+ * Default false.
+ * @return bool True on success, false on failure.
+ */
+ public function chgrp( $file, $group, $recursive = false ) {
+ return false;
+ }
+
+ /**
+ * Changes filesystem permissions.
+ *
+ * @since 2.5.0
+ * @abstract
+ *
+ * @param string $file Path to the file.
+ * @param int|false $mode Optional. The permissions as octal number, usually 0644 for files,
+ * 0755 for directories. Default false.
+ * @param bool $recursive Optional. If set to true, changes file group recursively.
+ * Default false.
+ * @return bool True on success, false on failure.
+ */
+ public function chmod( $file, $mode = false, $recursive = false ) {
+ return false;
+ }
+
+ /**
+ * Gets the file owner.
+ *
+ * @since 2.5.0
+ * @abstract
+ *
+ * @param string $file Path to the file.
+ * @return string|false Username of the owner on success, false on failure.
+ */
+ public function owner( $file ) {
+ return false;
+ }
+
+ /**
+ * Gets the file's group.
+ *
+ * @since 2.5.0
+ * @abstract
+ *
+ * @param string $file Path to the file.
+ * @return string|false The group on success, false on failure.
+ */
+ public function group( $file ) {
+ return false;
+ }
+
+ /**
+ * Copies a file.
+ *
+ * @since 2.5.0
+ * @abstract
+ *
+ * @param string $source Path to the source file.
+ * @param string $destination Path to the destination file.
+ * @param bool $overwrite Optional. Whether to overwrite the destination file if it exists.
+ * Default false.
+ * @param int|false $mode Optional. The permissions as octal number, usually 0644 for files,
+ * 0755 for dirs. Default false.
+ * @return bool True on success, false on failure.
+ */
+ public function copy( $source, $destination, $overwrite = false, $mode = false ) {
+ return false;
+ }
+
+ /**
+ * Moves a file.
+ *
+ * @since 2.5.0
+ * @abstract
+ *
+ * @param string $source Path to the source file.
+ * @param string $destination Path to the destination file.
+ * @param bool $overwrite Optional. Whether to overwrite the destination file if it exists.
+ * Default false.
+ * @return bool True on success, false on failure.
+ */
+ public function move( $source, $destination, $overwrite = false ) {
+ return false;
+ }
+
+ /**
+ * Deletes a file or directory.
+ *
+ * @since 2.5.0
+ * @abstract
+ *
+ * @param string $file Path to the file or directory.
+ * @param bool $recursive Optional. If set to true, changes file group recursively.
+ * Default false.
+ * @param string|false $type Type of resource. 'f' for file, 'd' for directory.
+ * Default false.
+ * @return bool True on success, false on failure.
+ */
+ public function delete( $file, $recursive = false, $type = false ) {
+ return false;
+ }
+
+ /**
+ * Checks if a file or directory exists.
+ *
+ * @since 2.5.0
+ * @abstract
+ *
+ * @param string $file Path to file or directory.
+ * @return bool Whether $file exists or not.
+ */
+ public function exists( $file ) {
+ return false;
+ }
+
+ /**
+ * Checks if resource is a file.
+ *
+ * @since 2.5.0
+ * @abstract
+ *
+ * @param string $file File path.
+ * @return bool Whether $file is a file.
+ */
+ public function is_file( $file ) {
+ return false;
+ }
+
+ /**
+ * Checks if resource is a directory.
+ *
+ * @since 2.5.0
+ * @abstract
+ *
+ * @param string $path Directory path.
+ * @return bool Whether $path is a directory.
+ */
+ public function is_dir( $path ) {
+ return false;
+ }
+
+ /**
+ * Checks if a file is readable.
+ *
+ * @since 2.5.0
+ * @abstract
+ *
+ * @param string $file Path to file.
+ * @return bool Whether $file is readable.
+ */
+ public function is_readable( $file ) {
+ return false;
+ }
+
+ /**
+ * Checks if a file or directory is writable.
+ *
+ * @since 2.5.0
+ * @abstract
+ *
+ * @param string $file Path to file or directory.
+ * @return bool Whether $file is writable.
+ */
+ public function is_writable( $file ) {
+ return false;
+ }
+
+ /**
+ * Gets the file's last access time.
+ *
+ * @since 2.5.0
+ * @abstract
+ *
+ * @param string $file Path to file.
+ * @return int|false Unix timestamp representing last access time, false on failure.
+ */
+ public function atime( $file ) {
+ return false;
+ }
+
+ /**
+ * Gets the file modification time.
+ *
+ * @since 2.5.0
+ * @abstract
+ *
+ * @param string $file Path to file.
+ * @return int|false Unix timestamp representing modification time, false on failure.
+ */
+ public function mtime( $file ) {
+ return false;
+ }
+
+ /**
+ * Gets the file size (in bytes).
+ *
+ * @since 2.5.0
+ * @abstract
+ *
+ * @param string $file Path to file.
+ * @return int|false Size of the file in bytes on success, false on failure.
+ */
+ public function size( $file ) {
+ return false;
+ }
+
+ /**
+ * Sets the access and modification times of a file.
+ *
+ * Note: If $file doesn't exist, it will be created.
+ *
+ * @since 2.5.0
+ * @abstract
+ *
+ * @param string $file Path to file.
+ * @param int $time Optional. Modified time to set for file.
+ * Default 0.
+ * @param int $atime Optional. Access time to set for file.
+ * Default 0.
+ * @return bool True on success, false on failure.
+ */
+ public function touch( $file, $time = 0, $atime = 0 ) {
+ return false;
+ }
+
+ /**
+ * Creates a directory.
+ *
+ * @since 2.5.0
+ * @abstract
+ *
+ * @param string $path Path for new directory.
+ * @param int|false $chmod Optional. The permissions as octal number (or false to skip chmod).
+ * Default false.
+ * @param string|int $chown Optional. A user name or number (or false to skip chown).
+ * Default false.
+ * @param string|int $chgrp Optional. A group name or number (or false to skip chgrp).
+ * Default false.
+ * @return bool True on success, false on failure.
+ */
+ public function mkdir( $path, $chmod = false, $chown = false, $chgrp = false ) {
+ return false;
+ }
+
+ /**
+ * Deletes a directory.
+ *
+ * @since 2.5.0
+ * @abstract
+ *
+ * @param string $path Path to directory.
+ * @param bool $recursive Optional. Whether to recursively remove files/directories.
+ * Default false.
+ * @return bool True on success, false on failure.
+ */
+ public function rmdir( $path, $recursive = false ) {
+ return false;
+ }
+
+ /**
+ * Gets details for files in a directory or a specific file.
+ *
+ * @since 2.5.0
+ * @abstract
+ *
+ * @param string $path Path to directory or file.
+ * @param bool $include_hidden Optional. Whether to include details of hidden ("." prefixed) files.
+ * Default true.
+ * @param bool $recursive Optional. Whether to recursively include file details in nested directories.
+ * Default false.
+ * @return array|false {
+ * Array of files. False if unable to list directory contents.
+ *
+ * @type string $name Name of the file or directory.
+ * @type string $perms *nix representation of permissions.
+ * @type int $permsn Octal representation of permissions.
+ * @type string $owner Owner name or ID.
+ * @type int $size Size of file in bytes.
+ * @type int $lastmodunix Last modified unix timestamp.
+ * @type mixed $lastmod Last modified month (3 letter) and day (without leading 0).
+ * @type int $time Last modified time.
+ * @type string $type Type of resource. 'f' for file, 'd' for directory.
+ * @type mixed $files If a directory and $recursive is true, contains another array of files.
+ * }
+ */
+ public function dirlist( $path, $include_hidden = true, $recursive = false ) {
+ return false;
+ }
+
+} // WP_Filesystem_Base
diff --git a/www/crm/wp-admin/includes/class-wp-filesystem-direct.php b/www/crm/wp-admin/includes/class-wp-filesystem-direct.php
new file mode 100644
index 00000000..41839097
--- /dev/null
+++ b/www/crm/wp-admin/includes/class-wp-filesystem-direct.php
@@ -0,0 +1,619 @@
+<?php
+/**
+ * WordPress Direct Filesystem.
+ *
+ * @package WordPress
+ * @subpackage Filesystem
+ */
+
+/**
+ * WordPress Filesystem Class for direct PHP file and folder manipulation.
+ *
+ * @since 2.5.0
+ *
+ * @see WP_Filesystem_Base
+ */
+class WP_Filesystem_Direct extends WP_Filesystem_Base {
+
+ /**
+ * Constructor.
+ *
+ * @since 2.5.0
+ *
+ * @param mixed $arg Not used.
+ */
+ public function __construct( $arg ) {
+ $this->method = 'direct';
+ $this->errors = new WP_Error();
+ }
+
+ /**
+ * Reads entire file into a string.
+ *
+ * @since 2.5.0
+ *
+ * @param string $file Name of the file to read.
+ * @return string|false Read data on success, false on failure.
+ */
+ public function get_contents( $file ) {
+ return @file_get_contents( $file );
+ }
+
+ /**
+ * Reads entire file into an array.
+ *
+ * @since 2.5.0
+ *
+ * @param string $file Path to the file.
+ * @return array|false File contents in an array on success, false on failure.
+ */
+ public function get_contents_array( $file ) {
+ return @file( $file );
+ }
+
+ /**
+ * Writes a string to a file.
+ *
+ * @since 2.5.0
+ *
+ * @param string $file Remote path to the file where to write the data.
+ * @param string $contents The data to write.
+ * @param int|false $mode Optional. The file permissions as octal number, usually 0644.
+ * Default false.
+ * @return bool True on success, false on failure.
+ */
+ public function put_contents( $file, $contents, $mode = false ) {
+ $fp = @fopen( $file, 'wb' );
+ if ( ! $fp ) {
+ return false;
+ }
+
+ mbstring_binary_safe_encoding();
+
+ $data_length = strlen( $contents );
+
+ $bytes_written = fwrite( $fp, $contents );
+
+ reset_mbstring_encoding();
+
+ fclose( $fp );
+
+ if ( $data_length !== $bytes_written ) {
+ return false;
+ }
+
+ $this->chmod( $file, $mode );
+
+ return true;
+ }
+
+ /**
+ * Gets the current working directory.
+ *
+ * @since 2.5.0
+ *
+ * @return string|false The current working directory on success, false on failure.
+ */
+ public function cwd() {
+ return @getcwd();
+ }
+
+ /**
+ * Changes current directory.
+ *
+ * @since 2.5.0
+ *
+ * @param string $dir The new current directory.
+ * @return bool True on success, false on failure.
+ */
+ public function chdir( $dir ) {
+ return @chdir( $dir );
+ }
+
+ /**
+ * Changes the file group.
+ *
+ * @since 2.5.0
+ *
+ * @param string $file Path to the file.
+ * @param string|int $group A group name or number.
+ * @param bool $recursive Optional. If set to true, changes file group recursively.
+ * Default false.
+ * @return bool True on success, false on failure.
+ */
+ public function chgrp( $file, $group, $recursive = false ) {
+ if ( ! $this->exists( $file ) ) {
+ return false;
+ }
+ if ( ! $recursive ) {
+ return @chgrp( $file, $group );
+ }
+ if ( ! $this->is_dir( $file ) ) {
+ return @chgrp( $file, $group );
+ }
+ // Is a directory, and we want recursive
+ $file = trailingslashit( $file );
+ $filelist = $this->dirlist( $file );
+ foreach ( $filelist as $filename ) {
+ $this->chgrp( $file . $filename, $group, $recursive );
+ }
+
+ return true;
+ }
+
+ /**
+ * Changes filesystem permissions.
+ *
+ * @since 2.5.0
+ *
+ * @param string $file Path to the file.
+ * @param int|false $mode Optional. The permissions as octal number, usually 0644 for files,
+ * 0755 for directories. Default false.
+ * @param bool $recursive Optional. If set to true, changes file group recursively.
+ * Default false.
+ * @return bool True on success, false on failure.
+ */
+ public function chmod( $file, $mode = false, $recursive = false ) {
+ if ( ! $mode ) {
+ if ( $this->is_file( $file ) ) {
+ $mode = FS_CHMOD_FILE;
+ } elseif ( $this->is_dir( $file ) ) {
+ $mode = FS_CHMOD_DIR;
+ } else {
+ return false;
+ }
+ }
+
+ if ( ! $recursive || ! $this->is_dir( $file ) ) {
+ return @chmod( $file, $mode );
+ }
+ // Is a directory, and we want recursive
+ $file = trailingslashit( $file );
+ $filelist = $this->dirlist( $file );
+ foreach ( (array) $filelist as $filename => $filemeta ) {
+ $this->chmod( $file . $filename, $mode, $recursive );
+ }
+
+ return true;
+ }
+
+ /**
+ * Changes the owner of a file or directory.
+ *
+ * @since 2.5.0
+ *
+ * @param string $file Path to the file or directory.
+ * @param string|int $owner A user name or number.
+ * @param bool $recursive Optional. If set to true, changes file owner recursively.
+ * Default false.
+ * @return bool True on success, false on failure.
+ */
+ public function chown( $file, $owner, $recursive = false ) {
+ if ( ! $this->exists( $file ) ) {
+ return false;
+ }
+ if ( ! $recursive ) {
+ return @chown( $file, $owner );
+ }
+ if ( ! $this->is_dir( $file ) ) {
+ return @chown( $file, $owner );
+ }
+ // Is a directory, and we want recursive
+ $filelist = $this->dirlist( $file );
+ foreach ( $filelist as $filename ) {
+ $this->chown( $file . '/' . $filename, $owner, $recursive );
+ }
+ return true;
+ }
+
+ /**
+ * Gets the file owner.
+ *
+ * @since 2.5.0
+ *
+ * @param string $file Path to the file.
+ * @return string|false Username of the owner on success, false on failure.
+ */
+ public function owner( $file ) {
+ $owneruid = @fileowner( $file );
+ if ( ! $owneruid ) {
+ return false;
+ }
+ if ( ! function_exists( 'posix_getpwuid' ) ) {
+ return $owneruid;
+ }
+ $ownerarray = posix_getpwuid( $owneruid );
+ return $ownerarray['name'];
+ }
+
+ /**
+ * Gets the permissions of the specified file or filepath in their octal format.
+ *
+ * FIXME does not handle errors in fileperms()
+ *
+ * @since 2.5.0
+ *
+ * @param string $file Path to the file.
+ * @return string Mode of the file (the last 3 digits).
+ */
+ public function getchmod( $file ) {
+ return substr( decoct( @fileperms( $file ) ), -3 );
+ }
+
+ /**
+ * Gets the file's group.
+ *
+ * @since 2.5.0
+ *
+ * @param string $file Path to the file.
+ * @return string|false The group on success, false on failure.
+ */
+ public function group( $file ) {
+ $gid = @filegroup( $file );
+ if ( ! $gid ) {
+ return false;
+ }
+ if ( ! function_exists( 'posix_getgrgid' ) ) {
+ return $gid;
+ }
+ $grouparray = posix_getgrgid( $gid );
+ return $grouparray['name'];
+ }
+
+ /**
+ * Copies a file.
+ *
+ * @since 2.5.0
+ *
+ * @param string $source Path to the source file.
+ * @param string $destination Path to the destination file.
+ * @param bool $overwrite Optional. Whether to overwrite the destination file if it exists.
+ * Default false.
+ * @param int|false $mode Optional. The permissions as octal number, usually 0644 for files,
+ * 0755 for dirs. Default false.
+ * @return bool True on success, false on failure.
+ */
+ public function copy( $source, $destination, $overwrite = false, $mode = false ) {
+ if ( ! $overwrite && $this->exists( $destination ) ) {
+ return false;
+ }
+
+ $rtval = copy( $source, $destination );
+ if ( $mode ) {
+ $this->chmod( $destination, $mode );
+ }
+ return $rtval;
+ }
+
+ /**
+ * Moves a file.
+ *
+ * @since 2.5.0
+ *
+ * @param string $source Path to the source file.
+ * @param string $destination Path to the destination file.
+ * @param bool $overwrite Optional. Whether to overwrite the destination file if it exists.
+ * Default false.
+ * @return bool True on success, false on failure.
+ */
+ public function move( $source, $destination, $overwrite = false ) {
+ if ( ! $overwrite && $this->exists( $destination ) ) {
+ return false;
+ }
+
+ // Try using rename first. if that fails (for example, source is read only) try copy.
+ if ( @rename( $source, $destination ) ) {
+ return true;
+ }
+
+ if ( $this->copy( $source, $destination, $overwrite ) && $this->exists( $destination ) ) {
+ $this->delete( $source );
+ return true;
+ } else {
+ return false;
+ }
+ }
+
+ /**
+ * Deletes a file or directory.
+ *
+ * @since 2.5.0
+ *
+ * @param string $file Path to the file or directory.
+ * @param bool $recursive Optional. If set to true, changes file group recursively.
+ * Default false.
+ * @param string|false $type Type of resource. 'f' for file, 'd' for directory.
+ * Default false.
+ * @return bool True on success, false on failure.
+ */
+ public function delete( $file, $recursive = false, $type = false ) {
+ if ( empty( $file ) ) { // Some filesystems report this as /, which can cause non-expected recursive deletion of all files in the filesystem.
+ return false;
+ }
+ $file = str_replace( '\\', '/', $file ); // for win32, occasional problems deleting files otherwise
+
+ if ( 'f' == $type || $this->is_file( $file ) ) {
+ return @unlink( $file );
+ }
+ if ( ! $recursive && $this->is_dir( $file ) ) {
+ return @rmdir( $file );
+ }
+
+ // At this point it's a folder, and we're in recursive mode
+ $file = trailingslashit( $file );
+ $filelist = $this->dirlist( $file, true );
+
+ $retval = true;
+ if ( is_array( $filelist ) ) {
+ foreach ( $filelist as $filename => $fileinfo ) {
+ if ( ! $this->delete( $file . $filename, $recursive, $fileinfo['type'] ) ) {
+ $retval = false;
+ }
+ }
+ }
+
+ if ( file_exists( $file ) && ! @rmdir( $file ) ) {
+ $retval = false;
+ }
+
+ return $retval;
+ }
+
+ /**
+ * Checks if a file or directory exists.
+ *
+ * @since 2.5.0
+ *
+ * @param string $file Path to file or directory.
+ * @return bool Whether $file exists or not.
+ */
+ public function exists( $file ) {
+ return @file_exists( $file );
+ }
+
+ /**
+ * Checks if resource is a file.
+ *
+ * @since 2.5.0
+ *
+ * @param string $file File path.
+ * @return bool Whether $file is a file.
+ */
+ public function is_file( $file ) {
+ return @is_file( $file );
+ }
+
+ /**
+ * Checks if resource is a directory.
+ *
+ * @since 2.5.0
+ *
+ * @param string $path Directory path.
+ * @return bool Whether $path is a directory.
+ */
+ public function is_dir( $path ) {
+ return @is_dir( $path );
+ }
+
+ /**
+ * Checks if a file is readable.
+ *
+ * @since 2.5.0
+ *
+ * @param string $file Path to file.
+ * @return bool Whether $file is readable.
+ */
+ public function is_readable( $file ) {
+ return @is_readable( $file );
+ }
+
+ /**
+ * Checks if a file or directory is writable.
+ *
+ * @since 2.5.0
+ *
+ * @param string $file Path to file or directory.
+ * @return bool Whether $file is writable.
+ */
+ public function is_writable( $file ) {
+ return @is_writable( $file );
+ }
+
+ /**
+ * Gets the file's last access time.
+ *
+ * @since 2.5.0
+ *
+ * @param string $file Path to file.
+ * @return int|false Unix timestamp representing last access time, false on failure.
+ */
+ public function atime( $file ) {
+ return @fileatime( $file );
+ }
+
+ /**
+ * Gets the file modification time.
+ *
+ * @since 2.5.0
+ *
+ * @param string $file Path to file.
+ * @return int|false Unix timestamp representing modification time, false on failure.
+ */
+ public function mtime( $file ) {
+ return @filemtime( $file );
+ }
+
+ /**
+ * Gets the file size (in bytes).
+ *
+ * @since 2.5.0
+ *
+ * @param string $file Path to file.
+ * @return int|false Size of the file in bytes on success, false on failure.
+ */
+ public function size( $file ) {
+ return @filesize( $file );
+ }
+
+ /**
+ * Sets the access and modification times of a file.
+ *
+ * Note: If $file doesn't exist, it will be created.
+ *
+ * @since 2.5.0
+ *
+ * @param string $file Path to file.
+ * @param int $time Optional. Modified time to set for file.
+ * Default 0.
+ * @param int $atime Optional. Access time to set for file.
+ * Default 0.
+ * @return bool True on success, false on failure.
+ */
+ public function touch( $file, $time = 0, $atime = 0 ) {
+ if ( $time == 0 ) {
+ $time = time();
+ }
+ if ( $atime == 0 ) {
+ $atime = time();
+ }
+ return @touch( $file, $time, $atime );
+ }
+
+ /**
+ * Creates a directory.
+ *
+ * @since 2.5.0
+ *
+ * @param string $path Path for new directory.
+ * @param int|false $chmod Optional. The permissions as octal number (or false to skip chmod).
+ * Default false.
+ * @param string|int $chown Optional. A user name or number (or false to skip chown).
+ * Default false.
+ * @param string|int $chgrp Optional. A group name or number (or false to skip chgrp).
+ * Default false.
+ * @return bool True on success, false on failure.
+ */
+ public function mkdir( $path, $chmod = false, $chown = false, $chgrp = false ) {
+ // Safe mode fails with a trailing slash under certain PHP versions.
+ $path = untrailingslashit( $path );
+ if ( empty( $path ) ) {
+ return false;
+ }
+
+ if ( ! $chmod ) {
+ $chmod = FS_CHMOD_DIR;
+ }
+
+ if ( ! @mkdir( $path ) ) {
+ return false;
+ }
+ $this->chmod( $path, $chmod );
+ if ( $chown ) {
+ $this->chown( $path, $chown );
+ }
+ if ( $chgrp ) {
+ $this->chgrp( $path, $chgrp );
+ }
+ return true;
+ }
+
+ /**
+ * Deletes a directory.
+ *
+ * @since 2.5.0
+ *
+ * @param string $path Path to directory.
+ * @param bool $recursive Optional. Whether to recursively remove files/directories.
+ * Default false.
+ * @return bool True on success, false on failure.
+ */
+ public function rmdir( $path, $recursive = false ) {
+ return $this->delete( $path, $recursive );
+ }
+
+ /**
+ * Gets details for files in a directory or a specific file.
+ *
+ * @since 2.5.0
+ *
+ * @param string $path Path to directory or file.
+ * @param bool $include_hidden Optional. Whether to include details of hidden ("." prefixed) files.
+ * Default true.
+ * @param bool $recursive Optional. Whether to recursively include file details in nested directories.
+ * Default false.
+ * @return array|false {
+ * Array of files. False if unable to list directory contents.
+ *
+ * @type string $name Name of the file or directory.
+ * @type string $perms *nix representation of permissions.
+ * @type int $permsn Octal representation of permissions.
+ * @type string $owner Owner name or ID.
+ * @type int $size Size of file in bytes.
+ * @type int $lastmodunix Last modified unix timestamp.
+ * @type mixed $lastmod Last modified month (3 letter) and day (without leading 0).
+ * @type int $time Last modified time.
+ * @type string $type Type of resource. 'f' for file, 'd' for directory.
+ * @type mixed $files If a directory and $recursive is true, contains another array of files.
+ * }
+ */
+ public function dirlist( $path, $include_hidden = true, $recursive = false ) {
+ if ( $this->is_file( $path ) ) {
+ $limit_file = basename( $path );
+ $path = dirname( $path );
+ } else {
+ $limit_file = false;
+ }
+
+ if ( ! $this->is_dir( $path ) ) {
+ return false;
+ }
+
+ $dir = @dir( $path );
+ if ( ! $dir ) {
+ return false;
+ }
+
+ $ret = array();
+
+ while ( false !== ( $entry = $dir->read() ) ) {
+ $struc = array();
+ $struc['name'] = $entry;
+
+ if ( '.' == $struc['name'] || '..' == $struc['name'] ) {
+ continue;
+ }
+
+ if ( ! $include_hidden && '.' == $struc['name'][0] ) {
+ continue;
+ }
+
+ if ( $limit_file && $struc['name'] != $limit_file ) {
+ continue;
+ }
+
+ $struc['perms'] = $this->gethchmod( $path . '/' . $entry );
+ $struc['permsn'] = $this->getnumchmodfromh( $struc['perms'] );
+ $struc['number'] = false;
+ $struc['owner'] = $this->owner( $path . '/' . $entry );
+ $struc['group'] = $this->group( $path . '/' . $entry );
+ $struc['size'] = $this->size( $path . '/' . $entry );
+ $struc['lastmodunix'] = $this->mtime( $path . '/' . $entry );
+ $struc['lastmod'] = date( 'M j', $struc['lastmodunix'] );
+ $struc['time'] = date( 'h:i:s', $struc['lastmodunix'] );
+ $struc['type'] = $this->is_dir( $path . '/' . $entry ) ? 'd' : 'f';
+
+ if ( 'd' == $struc['type'] ) {
+ if ( $recursive ) {
+ $struc['files'] = $this->dirlist( $path . '/' . $struc['name'], $include_hidden, $recursive );
+ } else {
+ $struc['files'] = array();
+ }
+ }
+
+ $ret[ $struc['name'] ] = $struc;
+ }
+ $dir->close();
+ unset( $dir );
+ return $ret;
+ }
+}
diff --git a/www/crm/wp-admin/includes/class-wp-filesystem-ftpext.php b/www/crm/wp-admin/includes/class-wp-filesystem-ftpext.php
new file mode 100644
index 00000000..1db0a579
--- /dev/null
+++ b/www/crm/wp-admin/includes/class-wp-filesystem-ftpext.php
@@ -0,0 +1,736 @@
+<?php
+/**
+ * WordPress FTP Filesystem.
+ *
+ * @package WordPress
+ * @subpackage Filesystem
+ */
+
+/**
+ * WordPress Filesystem Class for implementing FTP.
+ *
+ * @since 2.5.0
+ *
+ * @see WP_Filesystem_Base
+ */
+class WP_Filesystem_FTPext extends WP_Filesystem_Base {
+
+ /**
+ * @since 2.5.0
+ * @var resource
+ */
+ public $link;
+
+ /**
+ * Constructor.
+ *
+ * @since 2.5.0
+ *
+ * @param array $opt
+ */
+ public function __construct( $opt = '' ) {
+ $this->method = 'ftpext';
+ $this->errors = new WP_Error();
+
+ // Check if possible to use ftp functions.
+ if ( ! extension_loaded( 'ftp' ) ) {
+ $this->errors->add( 'no_ftp_ext', __( 'The ftp PHP extension is not available' ) );
+ return;
+ }
+
+ // This Class uses the timeout on a per-connection basis, Others use it on a per-action basis.
+
+ if ( ! defined( 'FS_TIMEOUT' ) ) {
+ define( 'FS_TIMEOUT', 240 );
+ }
+
+ if ( empty( $opt['port'] ) ) {
+ $this->options['port'] = 21;
+ } else {
+ $this->options['port'] = $opt['port'];
+ }
+
+ if ( empty( $opt['hostname'] ) ) {
+ $this->errors->add( 'empty_hostname', __( 'FTP hostname is required' ) );
+ } else {
+ $this->options['hostname'] = $opt['hostname'];
+ }
+
+ // Check if the options provided are OK.
+ if ( empty( $opt['username'] ) ) {
+ $this->errors->add( 'empty_username', __( 'FTP username is required' ) );
+ } else {
+ $this->options['username'] = $opt['username'];
+ }
+
+ if ( empty( $opt['password'] ) ) {
+ $this->errors->add( 'empty_password', __( 'FTP password is required' ) );
+ } else {
+ $this->options['password'] = $opt['password'];
+ }
+
+ $this->options['ssl'] = false;
+ if ( isset( $opt['connection_type'] ) && 'ftps' == $opt['connection_type'] ) {
+ $this->options['ssl'] = true;
+ }
+ }
+
+ /**
+ * Connects filesystem.
+ *
+ * @since 2.5.0
+ *
+ * @return bool True on success, false on failure.
+ */
+ public function connect() {
+ if ( isset( $this->options['ssl'] ) && $this->options['ssl'] && function_exists( 'ftp_ssl_connect' ) ) {
+ $this->link = @ftp_ssl_connect( $this->options['hostname'], $this->options['port'], FS_CONNECT_TIMEOUT );
+ } else {
+ $this->link = @ftp_connect( $this->options['hostname'], $this->options['port'], FS_CONNECT_TIMEOUT );
+ }
+
+ if ( ! $this->link ) {
+ $this->errors->add(
+ 'connect',
+ /* translators: %s: hostname:port */
+ sprintf(
+ __( 'Failed to connect to FTP Server %s' ),
+ $this->options['hostname'] . ':' . $this->options['port']
+ )
+ );
+ return false;
+ }
+
+ if ( ! @ftp_login( $this->link, $this->options['username'], $this->options['password'] ) ) {
+ $this->errors->add(
+ 'auth',
+ /* translators: %s: username */
+ sprintf(
+ __( 'Username/Password incorrect for %s' ),
+ $this->options['username']
+ )
+ );
+ return false;
+ }
+
+ // Set the Connection to use Passive FTP
+ @ftp_pasv( $this->link, true );
+ if ( @ftp_get_option( $this->link, FTP_TIMEOUT_SEC ) < FS_TIMEOUT ) {
+ @ftp_set_option( $this->link, FTP_TIMEOUT_SEC, FS_TIMEOUT );
+ }
+
+ return true;
+ }
+
+ /**
+ * Reads entire file into a string.
+ *
+ * @since 2.5.0
+ *
+ * @param string $file Name of the file to read.
+ * @return string|false Read data on success, false if no temporary file could be opened,
+ * or if the file couldn't be retrieved.
+ */
+ public function get_contents( $file ) {
+ $tempfile = wp_tempnam( $file );
+ $temp = fopen( $tempfile, 'w+' );
+
+ if ( ! $temp ) {
+ unlink( $tempfile );
+ return false;
+ }
+
+ if ( ! @ftp_fget( $this->link, $temp, $file, FTP_BINARY ) ) {
+ fclose( $temp );
+ unlink( $tempfile );
+ return false;
+ }
+
+ fseek( $temp, 0 ); // Skip back to the start of the file being written to
+ $contents = '';
+
+ while ( ! feof( $temp ) ) {
+ $contents .= fread( $temp, 8 * KB_IN_BYTES );
+ }
+
+ fclose( $temp );
+ unlink( $tempfile );
+ return $contents;
+ }
+
+ /**
+ * Reads entire file into an array.
+ *
+ * @since 2.5.0
+ *
+ * @param string $file Path to the file.
+ * @return array|false File contents in an array on success, false on failure.
+ */
+ public function get_contents_array( $file ) {
+ return explode( "\n", $this->get_contents( $file ) );
+ }
+
+ /**
+ * Writes a string to a file.
+ *
+ * @since 2.5.0
+ *
+ * @param string $file Remote path to the file where to write the data.
+ * @param string $contents The data to write.
+ * @param int|false $mode Optional. The file permissions as octal number, usually 0644.
+ * Default false.
+ * @return bool True on success, false on failure.
+ */
+ public function put_contents( $file, $contents, $mode = false ) {
+ $tempfile = wp_tempnam( $file );
+ $temp = fopen( $tempfile, 'wb+' );
+
+ if ( ! $temp ) {
+ unlink( $tempfile );
+ return false;
+ }
+
+ mbstring_binary_safe_encoding();
+
+ $data_length = strlen( $contents );
+ $bytes_written = fwrite( $temp, $contents );
+
+ reset_mbstring_encoding();
+
+ if ( $data_length !== $bytes_written ) {
+ fclose( $temp );
+ unlink( $tempfile );
+ return false;
+ }
+
+ fseek( $temp, 0 ); // Skip back to the start of the file being written to
+
+ $ret = @ftp_fput( $this->link, $file, $temp, FTP_BINARY );
+
+ fclose( $temp );
+ unlink( $tempfile );
+
+ $this->chmod( $file, $mode );
+
+ return $ret;
+ }
+
+ /**
+ * Gets the current working directory.
+ *
+ * @since 2.5.0
+ *
+ * @return string|false The current working directory on success, false on failure.
+ */
+ public function cwd() {
+ $cwd = @ftp_pwd( $this->link );
+ if ( $cwd ) {
+ $cwd = trailingslashit( $cwd );
+ }
+ return $cwd;
+ }
+
+ /**
+ * Changes current directory.
+ *
+ * @since 2.5.0
+ *
+ * @param string $dir The new current directory.
+ * @return bool True on success, false on failure.
+ */
+ public function chdir( $dir ) {
+ return @ftp_chdir( $this->link, $dir );
+ }
+
+ /**
+ * Changes filesystem permissions.
+ *
+ * @since 2.5.0
+ *
+ * @param string $file Path to the file.
+ * @param int|false $mode Optional. The permissions as octal number, usually 0644 for files,
+ * 0755 for directories. Default false.
+ * @param bool $recursive Optional. If set to true, changes file group recursively.
+ * Default false.
+ * @return bool True on success, false on failure.
+ */
+ public function chmod( $file, $mode = false, $recursive = false ) {
+ if ( ! $mode ) {
+ if ( $this->is_file( $file ) ) {
+ $mode = FS_CHMOD_FILE;
+ } elseif ( $this->is_dir( $file ) ) {
+ $mode = FS_CHMOD_DIR;
+ } else {
+ return false;
+ }
+ }
+
+ // chmod any sub-objects if recursive.
+ if ( $recursive && $this->is_dir( $file ) ) {
+ $filelist = $this->dirlist( $file );
+ foreach ( (array) $filelist as $filename => $filemeta ) {
+ $this->chmod( $file . '/' . $filename, $mode, $recursive );
+ }
+ }
+
+ // chmod the file or directory
+ if ( ! function_exists( 'ftp_chmod' ) ) {
+ return (bool) @ftp_site( $this->link, sprintf( 'CHMOD %o %s', $mode, $file ) );
+ }
+ return (bool) @ftp_chmod( $this->link, $mode, $file );
+ }
+
+ /**
+ * Gets the file owner.
+ *
+ * @since 2.5.0
+ *
+ * @param string $file Path to the file.
+ * @return string|false Username of the owner on success, false on failure.
+ */
+ public function owner( $file ) {
+ $dir = $this->dirlist( $file );
+ return $dir[ $file ]['owner'];
+ }
+
+ /**
+ * Gets the permissions of the specified file or filepath in their octal format.
+ *
+ * @since 2.5.0
+ *
+ * @param string $file Path to the file.
+ * @return string Mode of the file (the last 3 digits).
+ */
+ public function getchmod( $file ) {
+ $dir = $this->dirlist( $file );
+ return $dir[ $file ]['permsn'];
+ }
+
+ /**
+ * Gets the file's group.
+ *
+ * @since 2.5.0
+ *
+ * @param string $file Path to the file.
+ * @return string|false The group on success, false on failure.
+ */
+ public function group( $file ) {
+ $dir = $this->dirlist( $file );
+ return $dir[ $file ]['group'];
+ }
+
+ /**
+ * Copies a file.
+ *
+ * @since 2.5.0
+ *
+ * @param string $source Path to the source file.
+ * @param string $destination Path to the destination file.
+ * @param bool $overwrite Optional. Whether to overwrite the destination file if it exists.
+ * Default false.
+ * @param int|false $mode Optional. The permissions as octal number, usually 0644 for files,
+ * 0755 for dirs. Default false.
+ * @return bool True on success, false on failure.
+ */
+ public function copy( $source, $destination, $overwrite = false, $mode = false ) {
+ if ( ! $overwrite && $this->exists( $destination ) ) {
+ return false;
+ }
+ $content = $this->get_contents( $source );
+ if ( false === $content ) {
+ return false;
+ }
+ return $this->put_contents( $destination, $content, $mode );
+ }
+
+ /**
+ * Moves a file.
+ *
+ * @since 2.5.0
+ *
+ * @param string $source Path to the source file.
+ * @param string $destination Path to the destination file.
+ * @param bool $overwrite Optional. Whether to overwrite the destination file if it exists.
+ * Default false.
+ * @return bool True on success, false on failure.
+ */
+ public function move( $source, $destination, $overwrite = false ) {
+ return ftp_rename( $this->link, $source, $destination );
+ }
+
+ /**
+ * Deletes a file or directory.
+ *
+ * @since 2.5.0
+ *
+ * @param string $file Path to the file or directory.
+ * @param bool $recursive Optional. If set to true, changes file group recursively.
+ * Default false.
+ * @param string|false $type Type of resource. 'f' for file, 'd' for directory.
+ * Default false.
+ * @return bool True on success, false on failure.
+ */
+ public function delete( $file, $recursive = false, $type = false ) {
+ if ( empty( $file ) ) {
+ return false;
+ }
+ if ( 'f' == $type || $this->is_file( $file ) ) {
+ return @ftp_delete( $this->link, $file );
+ }
+ if ( ! $recursive ) {
+ return @ftp_rmdir( $this->link, $file );
+ }
+
+ $filelist = $this->dirlist( trailingslashit( $file ) );
+ if ( ! empty( $filelist ) ) {
+ foreach ( $filelist as $delete_file ) {
+ $this->delete( trailingslashit( $file ) . $delete_file['name'], $recursive, $delete_file['type'] );
+ }
+ }
+ return @ftp_rmdir( $this->link, $file );
+ }
+
+ /**
+ * Checks if a file or directory exists.
+ *
+ * @since 2.5.0
+ *
+ * @param string $file Path to file or directory.
+ * @return bool Whether $file exists or not.
+ */
+ public function exists( $file ) {
+ $list = @ftp_nlist( $this->link, $file );
+
+ if ( empty( $list ) && $this->is_dir( $file ) ) {
+ return true; // File is an empty directory.
+ }
+
+ return ! empty( $list ); //empty list = no file, so invert.
+ }
+
+ /**
+ * Checks if resource is a file.
+ *
+ * @since 2.5.0
+ *
+ * @param string $file File path.
+ * @return bool Whether $file is a file.
+ */
+ public function is_file( $file ) {
+ return $this->exists( $file ) && ! $this->is_dir( $file );
+ }
+
+ /**
+ * Checks if resource is a directory.
+ *
+ * @since 2.5.0
+ *
+ * @param string $path Directory path.
+ * @return bool Whether $path is a directory.
+ */
+ public function is_dir( $path ) {
+ $cwd = $this->cwd();
+ $result = @ftp_chdir( $this->link, trailingslashit( $path ) );
+ if ( $result && $path == $this->cwd() || $this->cwd() != $cwd ) {
+ @ftp_chdir( $this->link, $cwd );
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ * Checks if a file is readable.
+ *
+ * @since 2.5.0
+ *
+ * @param string $file Path to file.
+ * @return bool Whether $file is readable.
+ */
+ public function is_readable( $file ) {
+ return true;
+ }
+
+ /**
+ * Checks if a file or directory is writable.
+ *
+ * @since 2.5.0
+ *
+ * @param string $file Path to file or directory.
+ * @return bool Whether $file is writable.
+ */
+ public function is_writable( $file ) {
+ return true;
+ }
+
+ /**
+ * Gets the file's last access time.
+ *
+ * @since 2.5.0
+ *
+ * @param string $file Path to file.
+ * @return int|false Unix timestamp representing last access time, false on failure.
+ */
+ public function atime( $file ) {
+ return false;
+ }
+
+ /**
+ * Gets the file modification time.
+ *
+ * @since 2.5.0
+ *
+ * @param string $file Path to file.
+ * @return int|false Unix timestamp representing modification time, false on failure.
+ */
+ public function mtime( $file ) {
+ return ftp_mdtm( $this->link, $file );
+ }
+
+ /**
+ * Gets the file size (in bytes).
+ *
+ * @since 2.5.0
+ *
+ * @param string $file Path to file.
+ * @return int|false Size of the file in bytes on success, false on failure.
+ */
+ public function size( $file ) {
+ return ftp_size( $this->link, $file );
+ }
+
+ /**
+ * Sets the access and modification times of a file.
+ *
+ * Note: If $file doesn't exist, it will be created.
+ *
+ * @since 2.5.0
+ *
+ * @param string $file Path to file.
+ * @param int $time Optional. Modified time to set for file.
+ * Default 0.
+ * @param int $atime Optional. Access time to set for file.
+ * Default 0.
+ * @return bool True on success, false on failure.
+ */
+ public function touch( $file, $time = 0, $atime = 0 ) {
+ return false;
+ }
+
+ /**
+ * Creates a directory.
+ *
+ * @since 2.5.0
+ *
+ * @param string $path Path for new directory.
+ * @param int|false $chmod Optional. The permissions as octal number (or false to skip chmod).
+ * Default false.
+ * @param string|int $chown Optional. A user name or number (or false to skip chown).
+ * Default false.
+ * @param string|int $chgrp Optional. A group name or number (or false to skip chgrp).
+ * Default false.
+ * @return bool True on success, false on failure.
+ */
+ public function mkdir( $path, $chmod = false, $chown = false, $chgrp = false ) {
+ $path = untrailingslashit( $path );
+ if ( empty( $path ) ) {
+ return false;
+ }
+
+ if ( ! @ftp_mkdir( $this->link, $path ) ) {
+ return false;
+ }
+ $this->chmod( $path, $chmod );
+ return true;
+ }
+
+ /**
+ * Deletes a directory.
+ *
+ * @since 2.5.0
+ *
+ * @param string $path Path to directory.
+ * @param bool $recursive Optional. Whether to recursively remove files/directories.
+ * Default false.
+ * @return bool True on success, false on failure.
+ */
+ public function rmdir( $path, $recursive = false ) {
+ return $this->delete( $path, $recursive );
+ }
+
+ /**
+ * @staticvar bool $is_windows
+ * @param string $line
+ * @return array
+ */
+ public function parselisting( $line ) {
+ static $is_windows = null;
+ if ( is_null( $is_windows ) ) {
+ $is_windows = stripos( ftp_systype( $this->link ), 'win' ) !== false;
+ }
+
+ if ( $is_windows && preg_match( '/([0-9]{2})-([0-9]{2})-([0-9]{2}) +([0-9]{2}):([0-9]{2})(AM|PM) +([0-9]+|<DIR>) +(.+)/', $line, $lucifer ) ) {
+ $b = array();
+ if ( $lucifer[3] < 70 ) {
+ $lucifer[3] += 2000;
+ } else {
+ $lucifer[3] += 1900; // 4digit year fix
+ }
+ $b['isdir'] = ( $lucifer[7] == '<DIR>' );
+ if ( $b['isdir'] ) {
+ $b['type'] = 'd';
+ } else {
+ $b['type'] = 'f';
+ }
+ $b['size'] = $lucifer[7];
+ $b['month'] = $lucifer[1];
+ $b['day'] = $lucifer[2];
+ $b['year'] = $lucifer[3];
+ $b['hour'] = $lucifer[4];
+ $b['minute'] = $lucifer[5];
+ $b['time'] = @mktime( $lucifer[4] + ( strcasecmp( $lucifer[6], 'PM' ) == 0 ? 12 : 0 ), $lucifer[5], 0, $lucifer[1], $lucifer[2], $lucifer[3] );
+ $b['am/pm'] = $lucifer[6];
+ $b['name'] = $lucifer[8];
+ } elseif ( ! $is_windows && $lucifer = preg_split( '/[ ]/', $line, 9, PREG_SPLIT_NO_EMPTY ) ) {
+ //echo $line."\n";
+ $lcount = count( $lucifer );
+ if ( $lcount < 8 ) {
+ return '';
+ }
+ $b = array();
+ $b['isdir'] = $lucifer[0]{0} === 'd';
+ $b['islink'] = $lucifer[0]{0} === 'l';
+ if ( $b['isdir'] ) {
+ $b['type'] = 'd';
+ } elseif ( $b['islink'] ) {
+ $b['type'] = 'l';
+ } else {
+ $b['type'] = 'f';
+ }
+ $b['perms'] = $lucifer[0];
+ $b['permsn'] = $this->getnumchmodfromh( $b['perms'] );
+ $b['number'] = $lucifer[1];
+ $b['owner'] = $lucifer[2];
+ $b['group'] = $lucifer[3];
+ $b['size'] = $lucifer[4];
+ if ( $lcount == 8 ) {
+ sscanf( $lucifer[5], '%d-%d-%d', $b['year'], $b['month'], $b['day'] );
+ sscanf( $lucifer[6], '%d:%d', $b['hour'], $b['minute'] );
+ $b['time'] = @mktime( $b['hour'], $b['minute'], 0, $b['month'], $b['day'], $b['year'] );
+ $b['name'] = $lucifer[7];
+ } else {
+ $b['month'] = $lucifer[5];
+ $b['day'] = $lucifer[6];
+ if ( preg_match( '/([0-9]{2}):([0-9]{2})/', $lucifer[7], $l2 ) ) {
+ $b['year'] = date( 'Y' );
+ $b['hour'] = $l2[1];
+ $b['minute'] = $l2[2];
+ } else {
+ $b['year'] = $lucifer[7];
+ $b['hour'] = 0;
+ $b['minute'] = 0;
+ }
+ $b['time'] = strtotime( sprintf( '%d %s %d %02d:%02d', $b['day'], $b['month'], $b['year'], $b['hour'], $b['minute'] ) );
+ $b['name'] = $lucifer[8];
+ }
+ }
+
+ // Replace symlinks formatted as "source -> target" with just the source name
+ if ( isset( $b['islink'] ) && $b['islink'] ) {
+ $b['name'] = preg_replace( '/(\s*->\s*.*)$/', '', $b['name'] );
+ }
+
+ return $b;
+ }
+
+ /**
+ * Gets details for files in a directory or a specific file.
+ *
+ * @since 2.5.0
+ *
+ * @param string $path Path to directory or file.
+ * @param bool $include_hidden Optional. Whether to include details of hidden ("." prefixed) files.
+ * Default true.
+ * @param bool $recursive Optional. Whether to recursively include file details in nested directories.
+ * Default false.
+ * @return array|false {
+ * Array of files. False if unable to list directory contents.
+ *
+ * @type string $name Name of the file or directory.
+ * @type string $perms *nix representation of permissions.
+ * @type int $permsn Octal representation of permissions.
+ * @type string $owner Owner name or ID.
+ * @type int $size Size of file in bytes.
+ * @type int $lastmodunix Last modified unix timestamp.
+ * @type mixed $lastmod Last modified month (3 letter) and day (without leading 0).
+ * @type int $time Last modified time.
+ * @type string $type Type of resource. 'f' for file, 'd' for directory.
+ * @type mixed $files If a directory and $recursive is true, contains another array of files.
+ * }
+ */
+ public function dirlist( $path = '.', $include_hidden = true, $recursive = false ) {
+ if ( $this->is_file( $path ) ) {
+ $limit_file = basename( $path );
+ $path = dirname( $path ) . '/';
+ } else {
+ $limit_file = false;
+ }
+
+ $pwd = @ftp_pwd( $this->link );
+ if ( ! @ftp_chdir( $this->link, $path ) ) { // Can't change to folder = folder doesn't exist.
+ return false;
+ }
+ $list = @ftp_rawlist( $this->link, '-a', false );
+ @ftp_chdir( $this->link, $pwd );
+
+ if ( empty( $list ) ) { // Empty array = non-existent folder (real folder will show . at least).
+ return false;
+ }
+
+ $dirlist = array();
+ foreach ( $list as $k => $v ) {
+ $entry = $this->parselisting( $v );
+ if ( empty( $entry ) ) {
+ continue;
+ }
+
+ if ( '.' == $entry['name'] || '..' == $entry['name'] ) {
+ continue;
+ }
+
+ if ( ! $include_hidden && '.' == $entry['name'][0] ) {
+ continue;
+ }
+
+ if ( $limit_file && $entry['name'] != $limit_file ) {
+ continue;
+ }
+
+ $dirlist[ $entry['name'] ] = $entry;
+ }
+
+ $ret = array();
+ foreach ( (array) $dirlist as $struc ) {
+ if ( 'd' == $struc['type'] ) {
+ if ( $recursive ) {
+ $struc['files'] = $this->dirlist( $path . '/' . $struc['name'], $include_hidden, $recursive );
+ } else {
+ $struc['files'] = array();
+ }
+ }
+
+ $ret[ $struc['name'] ] = $struc;
+ }
+ return $ret;
+ }
+
+ /**
+ * Destructor.
+ *
+ * @since 2.5.0
+ */
+ public function __destruct() {
+ if ( $this->link ) {
+ ftp_close( $this->link );
+ }
+ }
+}
diff --git a/www/crm/wp-admin/includes/class-wp-filesystem-ftpsockets.php b/www/crm/wp-admin/includes/class-wp-filesystem-ftpsockets.php
new file mode 100644
index 00000000..77a7a668
--- /dev/null
+++ b/www/crm/wp-admin/includes/class-wp-filesystem-ftpsockets.php
@@ -0,0 +1,660 @@
+<?php
+/**
+ * WordPress FTP Sockets Filesystem.
+ *
+ * @package WordPress
+ * @subpackage Filesystem
+ */
+
+/**
+ * WordPress Filesystem Class for implementing FTP Sockets.
+ *
+ * @since 2.5.0
+ *
+ * @see WP_Filesystem_Base
+ */
+class WP_Filesystem_ftpsockets extends WP_Filesystem_Base {
+
+ /**
+ * @since 2.5.0
+ * @var ftp
+ */
+ public $ftp;
+
+ /**
+ * Constructor.
+ *
+ * @since 2.5.0
+ *
+ * @param array $opt
+ */
+ public function __construct( $opt = '' ) {
+ $this->method = 'ftpsockets';
+ $this->errors = new WP_Error();
+
+ // Check if possible to use ftp functions.
+ if ( ! @include_once( ABSPATH . 'wp-admin/includes/class-ftp.php' ) ) {
+ return;
+ }
+ $this->ftp = new ftp();
+
+ if ( empty( $opt['port'] ) ) {
+ $this->options['port'] = 21;
+ } else {
+ $this->options['port'] = (int) $opt['port'];
+ }
+
+ if ( empty( $opt['hostname'] ) ) {
+ $this->errors->add( 'empty_hostname', __( 'FTP hostname is required' ) );
+ } else {
+ $this->options['hostname'] = $opt['hostname'];
+ }
+
+ // Check if the options provided are OK.
+ if ( empty( $opt['username'] ) ) {
+ $this->errors->add( 'empty_username', __( 'FTP username is required' ) );
+ } else {
+ $this->options['username'] = $opt['username'];
+ }
+
+ if ( empty( $opt['password'] ) ) {
+ $this->errors->add( 'empty_password', __( 'FTP password is required' ) );
+ } else {
+ $this->options['password'] = $opt['password'];
+ }
+ }
+
+ /**
+ * Connects filesystem.
+ *
+ * @since 2.5.0
+ *
+ * @return bool True on success, false on failure.
+ */
+ public function connect() {
+ if ( ! $this->ftp ) {
+ return false;
+ }
+
+ $this->ftp->setTimeout( FS_CONNECT_TIMEOUT );
+
+ if ( ! $this->ftp->SetServer( $this->options['hostname'], $this->options['port'] ) ) {
+ $this->errors->add(
+ 'connect',
+ /* translators: %s: hostname:port */
+ sprintf(
+ __( 'Failed to connect to FTP Server %s' ),
+ $this->options['hostname'] . ':' . $this->options['port']
+ )
+ );
+ return false;
+ }
+
+ if ( ! $this->ftp->connect() ) {
+ $this->errors->add(
+ 'connect',
+ /* translators: %s: hostname:port */
+ sprintf(
+ __( 'Failed to connect to FTP Server %s' ),
+ $this->options['hostname'] . ':' . $this->options['port']
+ )
+ );
+ return false;
+ }
+
+ if ( ! $this->ftp->login( $this->options['username'], $this->options['password'] ) ) {
+ $this->errors->add(
+ 'auth',
+ /* translators: %s: username */
+ sprintf(
+ __( 'Username/Password incorrect for %s' ),
+ $this->options['username']
+ )
+ );
+ return false;
+ }
+
+ $this->ftp->SetType( FTP_BINARY );
+ $this->ftp->Passive( true );
+ $this->ftp->setTimeout( FS_TIMEOUT );
+ return true;
+ }
+
+ /**
+ * Reads entire file into a string.
+ *
+ * @since 2.5.0
+ *
+ * @param string $file Name of the file to read.
+ * @return string|false Read data on success, false if no temporary file could be opened,
+ * or if the file couldn't be retrieved.
+ */
+ public function get_contents( $file ) {
+ if ( ! $this->exists( $file ) ) {
+ return false;
+ }
+
+ $temp = wp_tempnam( $file );
+
+ if ( ! $temphandle = fopen( $temp, 'w+' ) ) {
+ unlink( $temp );
+ return false;
+ }
+
+ mbstring_binary_safe_encoding();
+
+ if ( ! $this->ftp->fget( $temphandle, $file ) ) {
+ fclose( $temphandle );
+ unlink( $temp );
+
+ reset_mbstring_encoding();
+
+ return ''; // Blank document, File does exist, It's just blank.
+ }
+
+ reset_mbstring_encoding();
+
+ fseek( $temphandle, 0 ); // Skip back to the start of the file being written to
+ $contents = '';
+
+ while ( ! feof( $temphandle ) ) {
+ $contents .= fread( $temphandle, 8 * KB_IN_BYTES );
+ }
+
+ fclose( $temphandle );
+ unlink( $temp );
+ return $contents;
+ }
+
+ /**
+ * Reads entire file into an array.
+ *
+ * @since 2.5.0
+ *
+ * @param string $file Path to the file.
+ * @return array|false File contents in an array on success, false on failure.
+ */
+ public function get_contents_array( $file ) {
+ return explode( "\n", $this->get_contents( $file ) );
+ }
+
+ /**
+ * Writes a string to a file.
+ *
+ * @since 2.5.0
+ *
+ * @param string $file Remote path to the file where to write the data.
+ * @param string $contents The data to write.
+ * @param int|false $mode Optional. The file permissions as octal number, usually 0644.
+ * Default false.
+ * @return bool True on success, false on failure.
+ */
+ public function put_contents( $file, $contents, $mode = false ) {
+ $temp = wp_tempnam( $file );
+ if ( ! $temphandle = @fopen( $temp, 'w+' ) ) {
+ unlink( $temp );
+ return false;
+ }
+
+ // The FTP class uses string functions internally during file download/upload
+ mbstring_binary_safe_encoding();
+
+ $bytes_written = fwrite( $temphandle, $contents );
+ if ( false === $bytes_written || $bytes_written != strlen( $contents ) ) {
+ fclose( $temphandle );
+ unlink( $temp );
+
+ reset_mbstring_encoding();
+
+ return false;
+ }
+
+ fseek( $temphandle, 0 ); // Skip back to the start of the file being written to
+
+ $ret = $this->ftp->fput( $file, $temphandle );
+
+ reset_mbstring_encoding();
+
+ fclose( $temphandle );
+ unlink( $temp );
+
+ $this->chmod( $file, $mode );
+
+ return $ret;
+ }
+
+ /**
+ * Gets the current working directory.
+ *
+ * @since 2.5.0
+ *
+ * @return string|false The current working directory on success, false on failure.
+ */
+ public function cwd() {
+ $cwd = $this->ftp->pwd();
+ if ( $cwd ) {
+ $cwd = trailingslashit( $cwd );
+ }
+ return $cwd;
+ }
+
+ /**
+ * Changes current directory.
+ *
+ * @since 2.5.0
+ *
+ * @param string $dir The new current directory.
+ * @return bool True on success, false on failure.
+ */
+ public function chdir( $dir ) {
+ return $this->ftp->chdir( $dir );
+ }
+
+ /**
+ * Changes filesystem permissions.
+ *
+ * @since 2.5.0
+ *
+ * @param string $file Path to the file.
+ * @param int|false $mode Optional. The permissions as octal number, usually 0644 for files,
+ * 0755 for directories. Default false.
+ * @param bool $recursive Optional. If set to true, changes file group recursively.
+ * Default false.
+ * @return bool True on success, false on failure.
+ */
+ public function chmod( $file, $mode = false, $recursive = false ) {
+ if ( ! $mode ) {
+ if ( $this->is_file( $file ) ) {
+ $mode = FS_CHMOD_FILE;
+ } elseif ( $this->is_dir( $file ) ) {
+ $mode = FS_CHMOD_DIR;
+ } else {
+ return false;
+ }
+ }
+
+ // chmod any sub-objects if recursive.
+ if ( $recursive && $this->is_dir( $file ) ) {
+ $filelist = $this->dirlist( $file );
+ foreach ( (array) $filelist as $filename => $filemeta ) {
+ $this->chmod( $file . '/' . $filename, $mode, $recursive );
+ }
+ }
+
+ // chmod the file or directory
+ return $this->ftp->chmod( $file, $mode );
+ }
+
+ /**
+ * Gets the file owner.
+ *
+ * @since 2.5.0
+ *
+ * @param string $file Path to the file.
+ * @return string|false Username of the owner on success, false on failure.
+ */
+ public function owner( $file ) {
+ $dir = $this->dirlist( $file );
+ return $dir[ $file ]['owner'];
+ }
+
+ /**
+ * Gets the permissions of the specified file or filepath in their octal format.
+ *
+ * @since 2.5.0
+ *
+ * @param string $file Path to the file.
+ * @return string Mode of the file (the last 3 digits).
+ */
+ public function getchmod( $file ) {
+ $dir = $this->dirlist( $file );
+ return $dir[ $file ]['permsn'];
+ }
+
+ /**
+ * Gets the file's group.
+ *
+ * @since 2.5.0
+ *
+ * @param string $file Path to the file.
+ * @return string|false The group on success, false on failure.
+ */
+ public function group( $file ) {
+ $dir = $this->dirlist( $file );
+ return $dir[ $file ]['group'];
+ }
+
+ /**
+ * Copies a file.
+ *
+ * @since 2.5.0
+ *
+ * @param string $source Path to the source file.
+ * @param string $destination Path to the destination file.
+ * @param bool $overwrite Optional. Whether to overwrite the destination file if it exists.
+ * Default false.
+ * @param int|false $mode Optional. The permissions as octal number, usually 0644 for files,
+ * 0755 for dirs. Default false.
+ * @return bool True on success, false on failure.
+ */
+ public function copy( $source, $destination, $overwrite = false, $mode = false ) {
+ if ( ! $overwrite && $this->exists( $destination ) ) {
+ return false;
+ }
+
+ $content = $this->get_contents( $source );
+ if ( false === $content ) {
+ return false;
+ }
+
+ return $this->put_contents( $destination, $content, $mode );
+ }
+
+ /**
+ * Moves a file.
+ *
+ * @since 2.5.0
+ *
+ * @param string $source Path to the source file.
+ * @param string $destination Path to the destination file.
+ * @param bool $overwrite Optional. Whether to overwrite the destination file if it exists.
+ * Default false.
+ * @return bool True on success, false on failure.
+ */
+ public function move( $source, $destination, $overwrite = false ) {
+ return $this->ftp->rename( $source, $destination );
+ }
+
+ /**
+ * Deletes a file or directory.
+ *
+ * @since 2.5.0
+ *
+ * @param string $file Path to the file or directory.
+ * @param bool $recursive Optional. If set to true, changes file group recursively.
+ * Default false.
+ * @param string|false $type Type of resource. 'f' for file, 'd' for directory.
+ * Default false.
+ * @return bool True on success, false on failure.
+ */
+ public function delete( $file, $recursive = false, $type = false ) {
+ if ( empty( $file ) ) {
+ return false;
+ }
+ if ( 'f' == $type || $this->is_file( $file ) ) {
+ return $this->ftp->delete( $file );
+ }
+ if ( ! $recursive ) {
+ return $this->ftp->rmdir( $file );
+ }
+
+ return $this->ftp->mdel( $file );
+ }
+
+ /**
+ * Checks if a file or directory exists.
+ *
+ * @since 2.5.0
+ *
+ * @param string $file Path to file or directory.
+ * @return bool Whether $file exists or not.
+ */
+ public function exists( $file ) {
+ $list = $this->ftp->nlist( $file );
+
+ if ( empty( $list ) && $this->is_dir( $file ) ) {
+ return true; // File is an empty directory.
+ }
+
+ return ! empty( $list ); //empty list = no file, so invert.
+ // Return $this->ftp->is_exists($file); has issues with ABOR+426 responses on the ncFTPd server.
+ }
+
+ /**
+ * Checks if resource is a file.
+ *
+ * @since 2.5.0
+ *
+ * @param string $file File path.
+ * @return bool Whether $file is a file.
+ */
+ public function is_file( $file ) {
+ if ( $this->is_dir( $file ) ) {
+ return false;
+ }
+ if ( $this->exists( $file ) ) {
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ * Checks if resource is a directory.
+ *
+ * @since 2.5.0
+ *
+ * @param string $path Directory path.
+ * @return bool Whether $path is a directory.
+ */
+ public function is_dir( $path ) {
+ $cwd = $this->cwd();
+ if ( $this->chdir( $path ) ) {
+ $this->chdir( $cwd );
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ * Checks if a file is readable.
+ *
+ * @since 2.5.0
+ *
+ * @param string $file Path to file.
+ * @return bool Whether $file is readable.
+ */
+ public function is_readable( $file ) {
+ return true;
+ }
+
+ /**
+ * Checks if a file or directory is writable.
+ *
+ * @since 2.5.0
+ *
+ * @param string $file Path to file or directory.
+ * @return bool Whether $file is writable.
+ */
+ public function is_writable( $file ) {
+ return true;
+ }
+
+ /**
+ * Gets the file's last access time.
+ *
+ * @since 2.5.0
+ *
+ * @param string $file Path to file.
+ * @return int|false Unix timestamp representing last access time, false on failure.
+ */
+ public function atime( $file ) {
+ return false;
+ }
+
+ /**
+ * Gets the file modification time.
+ *
+ * @since 2.5.0
+ *
+ * @param string $file Path to file.
+ * @return int|false Unix timestamp representing modification time, false on failure.
+ */
+ public function mtime( $file ) {
+ return $this->ftp->mdtm( $file );
+ }
+
+ /**
+ * Gets the file size (in bytes).
+ *
+ * @since 2.5.0
+ *
+ * @param string $file Path to file.
+ * @return int|false Size of the file in bytes on success, false on failure.
+ */
+ public function size( $file ) {
+ return $this->ftp->filesize( $file );
+ }
+
+ /**
+ * Sets the access and modification times of a file.
+ *
+ * Note: If $file doesn't exist, it will be created.
+ *
+ * @since 2.5.0
+ *
+ * @param string $file Path to file.
+ * @param int $time Optional. Modified time to set for file.
+ * Default 0.
+ * @param int $atime Optional. Access time to set for file.
+ * Default 0.
+ * @return bool True on success, false on failure.
+ */
+ public function touch( $file, $time = 0, $atime = 0 ) {
+ return false;
+ }
+
+ /**
+ * Creates a directory.
+ *
+ * @since 2.5.0
+ *
+ * @param string $path Path for new directory.
+ * @param int|false $chmod Optional. The permissions as octal number (or false to skip chmod).
+ * Default false.
+ * @param string|int $chown Optional. A user name or number (or false to skip chown).
+ * Default false.
+ * @param string|int $chgrp Optional. A group name or number (or false to skip chgrp).
+ * Default false.
+ * @return bool True on success, false on failure.
+ */
+ public function mkdir( $path, $chmod = false, $chown = false, $chgrp = false ) {
+ $path = untrailingslashit( $path );
+ if ( empty( $path ) ) {
+ return false;
+ }
+
+ if ( ! $this->ftp->mkdir( $path ) ) {
+ return false;
+ }
+ if ( ! $chmod ) {
+ $chmod = FS_CHMOD_DIR;
+ }
+ $this->chmod( $path, $chmod );
+ return true;
+ }
+
+ /**
+ * Deletes a directory.
+ *
+ * @since 2.5.0
+ *
+ * @param string $path Path to directory.
+ * @param bool $recursive Optional. Whether to recursively remove files/directories.
+ * Default false.
+ * @return bool True on success, false on failure.
+ */
+ public function rmdir( $path, $recursive = false ) {
+ return $this->delete( $path, $recursive );
+ }
+
+ /**
+ * Gets details for files in a directory or a specific file.
+ *
+ * @since 2.5.0
+ *
+ * @param string $path Path to directory or file.
+ * @param bool $include_hidden Optional. Whether to include details of hidden ("." prefixed) files.
+ * Default true.
+ * @param bool $recursive Optional. Whether to recursively include file details in nested directories.
+ * Default false.
+ * @return array|false {
+ * Array of files. False if unable to list directory contents.
+ *
+ * @type string $name Name of the file or directory.
+ * @type string $perms *nix representation of permissions.
+ * @type int $permsn Octal representation of permissions.
+ * @type string $owner Owner name or ID.
+ * @type int $size Size of file in bytes.
+ * @type int $lastmodunix Last modified unix timestamp.
+ * @type mixed $lastmod Last modified month (3 letter) and day (without leading 0).
+ * @type int $time Last modified time.
+ * @type string $type Type of resource. 'f' for file, 'd' for directory.
+ * @type mixed $files If a directory and $recursive is true, contains another array of files.
+ * }
+ */
+ public function dirlist( $path = '.', $include_hidden = true, $recursive = false ) {
+ if ( $this->is_file( $path ) ) {
+ $limit_file = basename( $path );
+ $path = dirname( $path ) . '/';
+ } else {
+ $limit_file = false;
+ }
+
+ mbstring_binary_safe_encoding();
+
+ $list = $this->ftp->dirlist( $path );
+ if ( empty( $list ) && ! $this->exists( $path ) ) {
+
+ reset_mbstring_encoding();
+
+ return false;
+ }
+
+ $ret = array();
+ foreach ( $list as $struc ) {
+
+ if ( '.' == $struc['name'] || '..' == $struc['name'] ) {
+ continue;
+ }
+
+ if ( ! $include_hidden && '.' == $struc['name'][0] ) {
+ continue;
+ }
+
+ if ( $limit_file && $struc['name'] != $limit_file ) {
+ continue;
+ }
+
+ if ( 'd' == $struc['type'] ) {
+ if ( $recursive ) {
+ $struc['files'] = $this->dirlist( $path . '/' . $struc['name'], $include_hidden, $recursive );
+ } else {
+ $struc['files'] = array();
+ }
+ }
+
+ // Replace symlinks formatted as "source -> target" with just the source name
+ if ( $struc['islink'] ) {
+ $struc['name'] = preg_replace( '/(\s*->\s*.*)$/', '', $struc['name'] );
+ }
+
+ // Add the Octal representation of the file permissions
+ $struc['permsn'] = $this->getnumchmodfromh( $struc['perms'] );
+
+ $ret[ $struc['name'] ] = $struc;
+ }
+
+ reset_mbstring_encoding();
+
+ return $ret;
+ }
+
+ /**
+ * Destructor.
+ *
+ * @since 2.5.0
+ */
+ public function __destruct() {
+ $this->ftp->quit();
+ }
+}
diff --git a/www/crm/wp-admin/includes/class-wp-filesystem-ssh2.php b/www/crm/wp-admin/includes/class-wp-filesystem-ssh2.php
new file mode 100644
index 00000000..b87a1957
--- /dev/null
+++ b/www/crm/wp-admin/includes/class-wp-filesystem-ssh2.php
@@ -0,0 +1,765 @@
+<?php
+/**
+ * WordPress Filesystem Class for implementing SSH2
+ *
+ * To use this class you must follow these steps for PHP 5.2.6+
+ *
+ * @contrib http://kevin.vanzonneveld.net/techblog/article/make_ssh_connections_with_php/ - Installation Notes
+ *
+ * Complie libssh2 (Note: Only 0.14 is officaly working with PHP 5.2.6+ right now, But many users have found the latest versions work)
+ *
+ * cd /usr/src
+ * wget http://surfnet.dl.sourceforge.net/sourceforge/libssh2/libssh2-0.14.tar.gz
+ * tar -zxvf libssh2-0.14.tar.gz
+ * cd libssh2-0.14/
+ * ./configure
+ * make all install
+ *
+ * Note: Do not leave the directory yet!
+ *
+ * Enter: pecl install -f ssh2
+ *
+ * Copy the ssh.so file it creates to your PHP Module Directory.
+ * Open up your PHP.INI file and look for where extensions are placed.
+ * Add in your PHP.ini file: extension=ssh2.so
+ *
+ * Restart Apache!
+ * Check phpinfo() streams to confirm that: ssh2.shell, ssh2.exec, ssh2.tunnel, ssh2.scp, ssh2.sftp exist.
+ *
+ * Note: as of WordPress 2.8, This utilises the PHP5+ function 'stream_get_contents'
+ *
+ * @since 2.7.0
+ *
+ * @package WordPress
+ * @subpackage Filesystem
+ */
+class WP_Filesystem_SSH2 extends WP_Filesystem_Base {
+
+ /**
+ * @since 2.7.0
+ * @var resource
+ */
+ public $link = false;
+
+ /**
+ * @since 2.7.0
+ * @var resource
+ */
+ public $sftp_link;
+
+ /**
+ * @since 2.7.0
+ * @var bool
+ */
+ public $keys = false;
+
+ /**
+ * Constructor.
+ *
+ * @since 2.7.0
+ *
+ * @param array $opt
+ */
+ public function __construct( $opt = '' ) {
+ $this->method = 'ssh2';
+ $this->errors = new WP_Error();
+
+ //Check if possible to use ssh2 functions.
+ if ( ! extension_loaded( 'ssh2' ) ) {
+ $this->errors->add( 'no_ssh2_ext', __( 'The ssh2 PHP extension is not available' ) );
+ return;
+ }
+ if ( ! function_exists( 'stream_get_contents' ) ) {
+ $this->errors->add(
+ 'ssh2_php_requirement',
+ sprintf(
+ /* translators: %s: stream_get_contents() */
+ __( 'The ssh2 PHP extension is available, however, we require the PHP5 function %s' ),
+ '<code>stream_get_contents()</code>'
+ )
+ );
+ return;
+ }
+
+ // Set defaults:
+ if ( empty( $opt['port'] ) ) {
+ $this->options['port'] = 22;
+ } else {
+ $this->options['port'] = $opt['port'];
+ }
+
+ if ( empty( $opt['hostname'] ) ) {
+ $this->errors->add( 'empty_hostname', __( 'SSH2 hostname is required' ) );
+ } else {
+ $this->options['hostname'] = $opt['hostname'];
+ }
+
+ // Check if the options provided are OK.
+ if ( ! empty( $opt['public_key'] ) && ! empty( $opt['private_key'] ) ) {
+ $this->options['public_key'] = $opt['public_key'];
+ $this->options['private_key'] = $opt['private_key'];
+
+ $this->options['hostkey'] = array( 'hostkey' => 'ssh-rsa' );
+
+ $this->keys = true;
+ } elseif ( empty( $opt['username'] ) ) {
+ $this->errors->add( 'empty_username', __( 'SSH2 username is required' ) );
+ }
+
+ if ( ! empty( $opt['username'] ) ) {
+ $this->options['username'] = $opt['username'];
+ }
+
+ if ( empty( $opt['password'] ) ) {
+ // Password can be blank if we are using keys.
+ if ( ! $this->keys ) {
+ $this->errors->add( 'empty_password', __( 'SSH2 password is required' ) );
+ }
+ } else {
+ $this->options['password'] = $opt['password'];
+ }
+ }
+
+ /**
+ * Connects filesystem.
+ *
+ * @since 2.7.0
+ *
+ * @return bool True on success, false on failure.
+ */
+ public function connect() {
+ if ( ! $this->keys ) {
+ $this->link = @ssh2_connect( $this->options['hostname'], $this->options['port'] );
+ } else {
+ $this->link = @ssh2_connect( $this->options['hostname'], $this->options['port'], $this->options['hostkey'] );
+ }
+
+ if ( ! $this->link ) {
+ $this->errors->add(
+ 'connect',
+ /* translators: %s: hostname:port */
+ sprintf(
+ __( 'Failed to connect to SSH2 Server %s' ),
+ $this->options['hostname'] . ':' . $this->options['port']
+ )
+ );
+ return false;
+ }
+
+ if ( ! $this->keys ) {
+ if ( ! @ssh2_auth_password( $this->link, $this->options['username'], $this->options['password'] ) ) {
+ $this->errors->add(
+ 'auth',
+ /* translators: %s: username */
+ sprintf(
+ __( 'Username/Password incorrect for %s' ),
+ $this->options['username']
+ )
+ );
+ return false;
+ }
+ } else {
+ if ( ! @ssh2_auth_pubkey_file( $this->link, $this->options['username'], $this->options['public_key'], $this->options['private_key'], $this->options['password'] ) ) {
+ $this->errors->add(
+ 'auth',
+ /* translators: %s: username */
+ sprintf(
+ __( 'Public and Private keys incorrect for %s' ),
+ $this->options['username']
+ )
+ );
+ return false;
+ }
+ }
+
+ $this->sftp_link = ssh2_sftp( $this->link );
+ if ( ! $this->sftp_link ) {
+ $this->errors->add(
+ 'connect',
+ /* translators: %s: hostname:port */
+ sprintf(
+ __( 'Failed to initialize a SFTP subsystem session with the SSH2 Server %s' ),
+ $this->options['hostname'] . ':' . $this->options['port']
+ )
+ );
+ return false;
+ }
+
+ return true;
+ }
+
+ /**
+ * Gets the ssh2.sftp PHP stream wrapper path to open for the given file.
+ *
+ * This method also works around a PHP bug where the root directory (/) cannot
+ * be opened by PHP functions, causing a false failure. In order to work around
+ * this, the path is converted to /./ which is semantically the same as /
+ * See https://bugs.php.net/bug.php?id=64169 for more details.
+ *
+ * @since 4.4.0
+ *
+ * @param string $path The File/Directory path on the remote server to return
+ * @return string The ssh2.sftp:// wrapped path to use.
+ */
+ public function sftp_path( $path ) {
+ if ( '/' === $path ) {
+ $path = '/./';
+ }
+ return 'ssh2.sftp://' . $this->sftp_link . '/' . ltrim( $path, '/' );
+ }
+
+ /**
+ * @since 2.7.0
+ *
+ * @param string $command
+ * @param bool $returnbool
+ * @return bool|string True on success, false on failure. String if the command was executed, `$returnbool`
+ * is false (default), and data from the resulting stream was retrieved.
+ */
+ public function run_command( $command, $returnbool = false ) {
+ if ( ! $this->link ) {
+ return false;
+ }
+
+ if ( ! ( $stream = ssh2_exec( $this->link, $command ) ) ) {
+ $this->errors->add(
+ 'command',
+ /* translators: %s: command */
+ sprintf(
+ __( 'Unable to perform command: %s' ),
+ $command
+ )
+ );
+ } else {
+ stream_set_blocking( $stream, true );
+ stream_set_timeout( $stream, FS_TIMEOUT );
+ $data = stream_get_contents( $stream );
+ fclose( $stream );
+
+ if ( $returnbool ) {
+ return ( $data === false ) ? false : '' != trim( $data );
+ } else {
+ return $data;
+ }
+ }
+ return false;
+ }
+
+ /**
+ * Reads entire file into a string.
+ *
+ * @since 2.7.0
+ *
+ * @param string $file Name of the file to read.
+ * @return string|false Read data on success, false if no temporary file could be opened,
+ * or if the file couldn't be retrieved.
+ */
+ public function get_contents( $file ) {
+ return file_get_contents( $this->sftp_path( $file ) );
+ }
+
+ /**
+ * Reads entire file into an array.
+ *
+ * @since 2.7.0
+ *
+ * @param string $file Path to the file.
+ * @return array|false File contents in an array on success, false on failure.
+ */
+ public function get_contents_array( $file ) {
+ return file( $this->sftp_path( $file ) );
+ }
+
+ /**
+ * Writes a string to a file.
+ *
+ * @since 2.7.0
+ *
+ * @param string $file Remote path to the file where to write the data.
+ * @param string $contents The data to write.
+ * @param int|false $mode Optional. The file permissions as octal number, usually 0644.
+ * Default false.
+ * @return bool True on success, false on failure.
+ */
+ public function put_contents( $file, $contents, $mode = false ) {
+ $ret = file_put_contents( $this->sftp_path( $file ), $contents );
+
+ if ( $ret !== strlen( $contents ) ) {
+ return false;
+ }
+
+ $this->chmod( $file, $mode );
+
+ return true;
+ }
+
+ /**
+ * Gets the current working directory.
+ *
+ * @since 2.7.0
+ *
+ * @return string|false The current working directory on success, false on failure.
+ */
+ public function cwd() {
+ $cwd = ssh2_sftp_realpath( $this->sftp_link, '.' );
+ if ( $cwd ) {
+ $cwd = trailingslashit( trim( $cwd ) );
+ }
+ return $cwd;
+ }
+
+ /**
+ * Changes current directory.
+ *
+ * @since 2.7.0
+ *
+ * @param string $dir The new current directory.
+ * @return bool True on success, false on failure.
+ */
+ public function chdir( $dir ) {
+ return $this->run_command( 'cd ' . $dir, true );
+ }
+
+ /**
+ * Changes the file group.
+ *
+ * @since 2.7.0
+ *
+ * @param string $file Path to the file.
+ * @param string|int $group A group name or number.
+ * @param bool $recursive Optional. If set to true, changes file group recursively.
+ * Default false.
+ * @return bool True on success, false on failure.
+ */
+ public function chgrp( $file, $group, $recursive = false ) {
+ if ( ! $this->exists( $file ) ) {
+ return false;
+ }
+ if ( ! $recursive || ! $this->is_dir( $file ) ) {
+ return $this->run_command( sprintf( 'chgrp %s %s', escapeshellarg( $group ), escapeshellarg( $file ) ), true );
+ }
+ return $this->run_command( sprintf( 'chgrp -R %s %s', escapeshellarg( $group ), escapeshellarg( $file ) ), true );
+ }
+
+ /**
+ * Changes filesystem permissions.
+ *
+ * @since 2.7.0
+ *
+ * @param string $file Path to the file.
+ * @param int|false $mode Optional. The permissions as octal number, usually 0644 for files,
+ * 0755 for directories. Default false.
+ * @param bool $recursive Optional. If set to true, changes file group recursively.
+ * Default false.
+ * @return bool True on success, false on failure.
+ */
+ public function chmod( $file, $mode = false, $recursive = false ) {
+ if ( ! $this->exists( $file ) ) {
+ return false;
+ }
+
+ if ( ! $mode ) {
+ if ( $this->is_file( $file ) ) {
+ $mode = FS_CHMOD_FILE;
+ } elseif ( $this->is_dir( $file ) ) {
+ $mode = FS_CHMOD_DIR;
+ } else {
+ return false;
+ }
+ }
+
+ if ( ! $recursive || ! $this->is_dir( $file ) ) {
+ return $this->run_command( sprintf( 'chmod %o %s', $mode, escapeshellarg( $file ) ), true );
+ }
+ return $this->run_command( sprintf( 'chmod -R %o %s', $mode, escapeshellarg( $file ) ), true );
+ }
+
+ /**
+ * Changes the owner of a file or directory.
+ *
+ * @since 2.7.0
+ *
+ * @param string $file Path to the file or directory.
+ * @param string|int $owner A user name or number.
+ * @param bool $recursive Optional. If set to true, changes file owner recursively.
+ * Default false.
+ * @return bool True on success, false on failure.
+ */
+ public function chown( $file, $owner, $recursive = false ) {
+ if ( ! $this->exists( $file ) ) {
+ return false;
+ }
+ if ( ! $recursive || ! $this->is_dir( $file ) ) {
+ return $this->run_command( sprintf( 'chown %s %s', escapeshellarg( $owner ), escapeshellarg( $file ) ), true );
+ }
+ return $this->run_command( sprintf( 'chown -R %s %s', escapeshellarg( $owner ), escapeshellarg( $file ) ), true );
+ }
+
+ /**
+ * Gets the file owner.
+ *
+ * @since 2.7.0
+ *
+ * @param string $file Path to the file.
+ * @return string|false Username of the owner on success, false on failure.
+ */
+ public function owner( $file ) {
+ $owneruid = @fileowner( $this->sftp_path( $file ) );
+ if ( ! $owneruid ) {
+ return false;
+ }
+ if ( ! function_exists( 'posix_getpwuid' ) ) {
+ return $owneruid;
+ }
+ $ownerarray = posix_getpwuid( $owneruid );
+ return $ownerarray['name'];
+ }
+
+ /**
+ * Gets the permissions of the specified file or filepath in their octal format.
+ *
+ * @since 2.7.0
+ *
+ * @param string $file Path to the file.
+ * @return string Mode of the file (the last 3 digits).
+ */
+ public function getchmod( $file ) {
+ return substr( decoct( @fileperms( $this->sftp_path( $file ) ) ), -3 );
+ }
+
+ /**
+ * Gets the file's group.
+ *
+ * @since 2.7.0
+ *
+ * @param string $file Path to the file.
+ * @return string|false The group on success, false on failure.
+ */
+ public function group( $file ) {
+ $gid = @filegroup( $this->sftp_path( $file ) );
+ if ( ! $gid ) {
+ return false;
+ }
+ if ( ! function_exists( 'posix_getgrgid' ) ) {
+ return $gid;
+ }
+ $grouparray = posix_getgrgid( $gid );
+ return $grouparray['name'];
+ }
+
+ /**
+ * Copies a file.
+ *
+ * @since 2.7.0
+ *
+ * @param string $source Path to the source file.
+ * @param string $destination Path to the destination file.
+ * @param bool $overwrite Optional. Whether to overwrite the destination file if it exists.
+ * Default false.
+ * @param int|false $mode Optional. The permissions as octal number, usually 0644 for files,
+ * 0755 for dirs. Default false.
+ * @return bool True on success, false on failure.
+ */
+ public function copy( $source, $destination, $overwrite = false, $mode = false ) {
+ if ( ! $overwrite && $this->exists( $destination ) ) {
+ return false;
+ }
+ $content = $this->get_contents( $source );
+ if ( false === $content ) {
+ return false;
+ }
+ return $this->put_contents( $destination, $content, $mode );
+ }
+
+ /**
+ * Moves a file.
+ *
+ * @since 2.7.0
+ *
+ * @param string $source Path to the source file.
+ * @param string $destination Path to the destination file.
+ * @param bool $overwrite Optional. Whether to overwrite the destination file if it exists.
+ * Default false.
+ * @return bool True on success, false on failure.
+ */
+ public function move( $source, $destination, $overwrite = false ) {
+ return @ssh2_sftp_rename( $this->sftp_link, $source, $destination );
+ }
+
+ /**
+ * Deletes a file or directory.
+ *
+ * @since 2.7.0
+ *
+ * @param string $file Path to the file or directory.
+ * @param bool $recursive Optional. If set to true, changes file group recursively.
+ * Default false.
+ * @param string|false $type Type of resource. 'f' for file, 'd' for directory.
+ * Default false.
+ * @return bool True on success, false on failure.
+ */
+ public function delete( $file, $recursive = false, $type = false ) {
+ if ( 'f' == $type || $this->is_file( $file ) ) {
+ return ssh2_sftp_unlink( $this->sftp_link, $file );
+ }
+ if ( ! $recursive ) {
+ return ssh2_sftp_rmdir( $this->sftp_link, $file );
+ }
+ $filelist = $this->dirlist( $file );
+ if ( is_array( $filelist ) ) {
+ foreach ( $filelist as $filename => $fileinfo ) {
+ $this->delete( $file . '/' . $filename, $recursive, $fileinfo['type'] );
+ }
+ }
+ return ssh2_sftp_rmdir( $this->sftp_link, $file );
+ }
+
+ /**
+ * Checks if a file or directory exists.
+ *
+ * @since 2.7.0
+ *
+ * @param string $file Path to file or directory.
+ * @return bool Whether $file exists or not.
+ */
+ public function exists( $file ) {
+ return file_exists( $this->sftp_path( $file ) );
+ }
+
+ /**
+ * Checks if resource is a file.
+ *
+ * @since 2.7.0
+ *
+ * @param string $file File path.
+ * @return bool Whether $file is a file.
+ */
+ public function is_file( $file ) {
+ return is_file( $this->sftp_path( $file ) );
+ }
+
+ /**
+ * Checks if resource is a directory.
+ *
+ * @since 2.7.0
+ *
+ * @param string $path Directory path.
+ * @return bool Whether $path is a directory.
+ */
+ public function is_dir( $path ) {
+ return is_dir( $this->sftp_path( $path ) );
+ }
+
+ /**
+ * Checks if a file is readable.
+ *
+ * @since 2.7.0
+ *
+ * @param string $file Path to file.
+ * @return bool Whether $file is readable.
+ */
+ public function is_readable( $file ) {
+ return is_readable( $this->sftp_path( $file ) );
+ }
+
+ /**
+ * Checks if a file or directory is writable.
+ *
+ * @since 2.7.0
+ *
+ * @param string $file Path to file or directory.
+ * @return bool Whether $file is writable.
+ */
+ public function is_writable( $file ) {
+ // PHP will base it's writable checks on system_user === file_owner, not ssh_user === file_owner
+ return true;
+ }
+
+ /**
+ * Gets the file's last access time.
+ *
+ * @since 2.7.0
+ *
+ * @param string $file Path to file.
+ * @return int|false Unix timestamp representing last access time, false on failure.
+ */
+ public function atime( $file ) {
+ return fileatime( $this->sftp_path( $file ) );
+ }
+
+ /**
+ * Gets the file modification time.
+ *
+ * @since 2.7.0
+ *
+ * @param string $file Path to file.
+ * @return int|false Unix timestamp representing modification time, false on failure.
+ */
+ public function mtime( $file ) {
+ return filemtime( $this->sftp_path( $file ) );
+ }
+
+ /**
+ * Gets the file size (in bytes).
+ *
+ * @since 2.7.0
+ *
+ * @param string $file Path to file.
+ * @return int|false Size of the file in bytes on success, false on failure.
+ */
+ public function size( $file ) {
+ return filesize( $this->sftp_path( $file ) );
+ }
+
+ /**
+ * Sets the access and modification times of a file.
+ *
+ * Note: Not implemented.
+ *
+ * @since 2.7.0
+ *
+ * @param string $file Path to file.
+ * @param int $time Optional. Modified time to set for file.
+ * Default 0.
+ * @param int $atime Optional. Access time to set for file.
+ * Default 0.
+ */
+ public function touch( $file, $time = 0, $atime = 0 ) {
+ // Not implemented.
+ }
+
+ /**
+ * Creates a directory.
+ *
+ * @since 2.7.0
+ *
+ * @param string $path Path for new directory.
+ * @param int|false $chmod Optional. The permissions as octal number (or false to skip chmod).
+ * Default false.
+ * @param string|int $chown Optional. A user name or number (or false to skip chown).
+ * Default false.
+ * @param string|int $chgrp Optional. A group name or number (or false to skip chgrp).
+ * Default false.
+ * @return bool True on success, false on failure.
+ */
+ public function mkdir( $path, $chmod = false, $chown = false, $chgrp = false ) {
+ $path = untrailingslashit( $path );
+ if ( empty( $path ) ) {
+ return false;
+ }
+
+ if ( ! $chmod ) {
+ $chmod = FS_CHMOD_DIR;
+ }
+ if ( ! ssh2_sftp_mkdir( $this->sftp_link, $path, $chmod, true ) ) {
+ return false;
+ }
+ if ( $chown ) {
+ $this->chown( $path, $chown );
+ }
+ if ( $chgrp ) {
+ $this->chgrp( $path, $chgrp );
+ }
+ return true;
+ }
+
+ /**
+ * Deletes a directory.
+ *
+ * @since 2.7.0
+ *
+ * @param string $path Path to directory.
+ * @param bool $recursive Optional. Whether to recursively remove files/directories.
+ * Default false.
+ * @return bool True on success, false on failure.
+ */
+ public function rmdir( $path, $recursive = false ) {
+ return $this->delete( $path, $recursive );
+ }
+
+ /**
+ * Gets details for files in a directory or a specific file.
+ *
+ * @since 2.7.0
+ *
+ * @param string $path Path to directory or file.
+ * @param bool $include_hidden Optional. Whether to include details of hidden ("." prefixed) files.
+ * Default true.
+ * @param bool $recursive Optional. Whether to recursively include file details in nested directories.
+ * Default false.
+ * @return array|false {
+ * Array of files. False if unable to list directory contents.
+ *
+ * @type string $name Name of the file or directory.
+ * @type string $perms *nix representation of permissions.
+ * @type int $permsn Octal representation of permissions.
+ * @type string $owner Owner name or ID.
+ * @type int $size Size of file in bytes.
+ * @type int $lastmodunix Last modified unix timestamp.
+ * @type mixed $lastmod Last modified month (3 letter) and day (without leading 0).
+ * @type int $time Last modified time.
+ * @type string $type Type of resource. 'f' for file, 'd' for directory.
+ * @type mixed $files If a directory and $recursive is true, contains another array of files.
+ * }
+ */
+ public function dirlist( $path, $include_hidden = true, $recursive = false ) {
+ if ( $this->is_file( $path ) ) {
+ $limit_file = basename( $path );
+ $path = dirname( $path );
+ } else {
+ $limit_file = false;
+ }
+
+ if ( ! $this->is_dir( $path ) ) {
+ return false;
+ }
+
+ $ret = array();
+ $dir = @dir( $this->sftp_path( $path ) );
+
+ if ( ! $dir ) {
+ return false;
+ }
+
+ while ( false !== ( $entry = $dir->read() ) ) {
+ $struc = array();
+ $struc['name'] = $entry;
+
+ if ( '.' == $struc['name'] || '..' == $struc['name'] ) {
+ continue; //Do not care about these folders.
+ }
+
+ if ( ! $include_hidden && '.' == $struc['name'][0] ) {
+ continue;
+ }
+
+ if ( $limit_file && $struc['name'] != $limit_file ) {
+ continue;
+ }
+
+ $struc['perms'] = $this->gethchmod( $path . '/' . $entry );
+ $struc['permsn'] = $this->getnumchmodfromh( $struc['perms'] );
+ $struc['number'] = false;
+ $struc['owner'] = $this->owner( $path . '/' . $entry );
+ $struc['group'] = $this->group( $path . '/' . $entry );
+ $struc['size'] = $this->size( $path . '/' . $entry );
+ $struc['lastmodunix'] = $this->mtime( $path . '/' . $entry );
+ $struc['lastmod'] = date( 'M j', $struc['lastmodunix'] );
+ $struc['time'] = date( 'h:i:s', $struc['lastmodunix'] );
+ $struc['type'] = $this->is_dir( $path . '/' . $entry ) ? 'd' : 'f';
+
+ if ( 'd' == $struc['type'] ) {
+ if ( $recursive ) {
+ $struc['files'] = $this->dirlist( $path . '/' . $struc['name'], $include_hidden, $recursive );
+ } else {
+ $struc['files'] = array();
+ }
+ }
+
+ $ret[ $struc['name'] ] = $struc;
+ }
+ $dir->close();
+ unset( $dir );
+ return $ret;
+ }
+}
diff --git a/www/crm/wp-admin/includes/class-wp-importer.php b/www/crm/wp-admin/includes/class-wp-importer.php
new file mode 100644
index 00000000..d59311e1
--- /dev/null
+++ b/www/crm/wp-admin/includes/class-wp-importer.php
@@ -0,0 +1,333 @@
+<?php
+/**
+ * WP_Importer base class
+ */
+class WP_Importer {
+ /**
+ * Class Constructor
+ */
+ public function __construct() {}
+
+ /**
+ * Returns array with imported permalinks from WordPress database
+ *
+ * @global wpdb $wpdb WordPress database abstraction object.
+ *
+ * @param string $importer_name
+ * @param string $bid
+ * @return array
+ */
+ public function get_imported_posts( $importer_name, $bid ) {
+ global $wpdb;
+
+ $hashtable = array();
+
+ $limit = 100;
+ $offset = 0;
+
+ // Grab all posts in chunks
+ do {
+ $meta_key = $importer_name . '_' . $bid . '_permalink';
+ $sql = $wpdb->prepare( "SELECT post_id, meta_value FROM $wpdb->postmeta WHERE meta_key = %s LIMIT %d,%d", $meta_key, $offset, $limit );
+ $results = $wpdb->get_results( $sql );
+
+ // Increment offset
+ $offset = ( $limit + $offset );
+
+ if ( ! empty( $results ) ) {
+ foreach ( $results as $r ) {
+ // Set permalinks into array
+ $hashtable[ $r->meta_value ] = intval( $r->post_id );
+ }
+ }
+ } while ( count( $results ) == $limit );
+
+ // Unset to save memory.
+ unset( $results, $r );
+
+ return $hashtable;
+ }
+
+ /**
+ * Return count of imported permalinks from WordPress database
+ *
+ * @global wpdb $wpdb WordPress database abstraction object.
+ *
+ * @param string $importer_name
+ * @param string $bid
+ * @return int
+ */
+ public function count_imported_posts( $importer_name, $bid ) {
+ global $wpdb;
+
+ $count = 0;
+
+ // Get count of permalinks
+ $meta_key = $importer_name . '_' . $bid . '_permalink';
+ $sql = $wpdb->prepare( "SELECT COUNT( post_id ) AS cnt FROM $wpdb->postmeta WHERE meta_key = '%s'", $meta_key );
+
+ $result = $wpdb->get_results( $sql );
+
+ if ( ! empty( $result ) ) {
+ $count = intval( $result[0]->cnt );
+ }
+
+ // Unset to save memory.
+ unset( $results );
+
+ return $count;
+ }
+
+ /**
+ * Set array with imported comments from WordPress database
+ *
+ * @global wpdb $wpdb WordPress database abstraction object.
+ *
+ * @param string $bid
+ * @return array
+ */
+ public function get_imported_comments( $bid ) {
+ global $wpdb;
+
+ $hashtable = array();
+
+ $limit = 100;
+ $offset = 0;
+
+ // Grab all comments in chunks
+ do {
+ $sql = $wpdb->prepare( "SELECT comment_ID, comment_agent FROM $wpdb->comments LIMIT %d,%d", $offset, $limit );
+ $results = $wpdb->get_results( $sql );
+
+ // Increment offset
+ $offset = ( $limit + $offset );
+
+ if ( ! empty( $results ) ) {
+ foreach ( $results as $r ) {
+ // Explode comment_agent key
+ list ( $ca_bid, $source_comment_id ) = explode( '-', $r->comment_agent );
+ $source_comment_id = intval( $source_comment_id );
+
+ // Check if this comment came from this blog
+ if ( $bid == $ca_bid ) {
+ $hashtable[ $source_comment_id ] = intval( $r->comment_ID );
+ }
+ }
+ }
+ } while ( count( $results ) == $limit );
+
+ // Unset to save memory.
+ unset( $results, $r );
+
+ return $hashtable;
+ }
+
+ /**
+ * @param int $blog_id
+ * @return int|void
+ */
+ public function set_blog( $blog_id ) {
+ if ( is_numeric( $blog_id ) ) {
+ $blog_id = (int) $blog_id;
+ } else {
+ $blog = 'http://' . preg_replace( '#^https?://#', '', $blog_id );
+ if ( ( ! $parsed = parse_url( $blog ) ) || empty( $parsed['host'] ) ) {
+ fwrite( STDERR, "Error: can not determine blog_id from $blog_id\n" );
+ exit();
+ }
+ if ( empty( $parsed['path'] ) ) {
+ $parsed['path'] = '/';
+ }
+ $blogs = get_sites(
+ array(
+ 'domain' => $parsed['host'],
+ 'number' => 1,
+ 'path' => $parsed['path'],
+ )
+ );
+ if ( ! $blogs ) {
+ fwrite( STDERR, "Error: Could not find blog\n" );
+ exit();
+ }
+ $blog = array_shift( $blogs );
+ $blog_id = (int) $blog->blog_id;
+ }
+
+ if ( function_exists( 'is_multisite' ) ) {
+ if ( is_multisite() ) {
+ switch_to_blog( $blog_id );
+ }
+ }
+
+ return $blog_id;
+ }
+
+ /**
+ * @param int $user_id
+ * @return int|void
+ */
+ public function set_user( $user_id ) {
+ if ( is_numeric( $user_id ) ) {
+ $user_id = (int) $user_id;
+ } else {
+ $user_id = (int) username_exists( $user_id );
+ }
+
+ if ( ! $user_id || ! wp_set_current_user( $user_id ) ) {
+ fwrite( STDERR, "Error: can not find user\n" );
+ exit();
+ }
+
+ return $user_id;
+ }
+
+ /**
+ * Sort by strlen, longest string first
+ *
+ * @param string $a
+ * @param string $b
+ * @return int
+ */
+ public function cmpr_strlen( $a, $b ) {
+ return strlen( $b ) - strlen( $a );
+ }
+
+ /**
+ * GET URL
+ *
+ * @param string $url
+ * @param string $username
+ * @param string $password
+ * @param bool $head
+ * @return array
+ */
+ public function get_page( $url, $username = '', $password = '', $head = false ) {
+ // Increase the timeout
+ add_filter( 'http_request_timeout', array( $this, 'bump_request_timeout' ) );
+
+ $headers = array();
+ $args = array();
+ if ( true === $head ) {
+ $args['method'] = 'HEAD';
+ }
+ if ( ! empty( $username ) && ! empty( $password ) ) {
+ $headers['Authorization'] = 'Basic ' . base64_encode( "$username:$password" );
+ }
+
+ $args['headers'] = $headers;
+
+ return wp_safe_remote_request( $url, $args );
+ }
+
+ /**
+ * Bump up the request timeout for http requests
+ *
+ * @param int $val
+ * @return int
+ */
+ public function bump_request_timeout( $val ) {
+ return 60;
+ }
+
+ /**
+ * Check if user has exceeded disk quota
+ *
+ * @return bool
+ */
+ public function is_user_over_quota() {
+ if ( function_exists( 'upload_is_user_over_quota' ) ) {
+ if ( upload_is_user_over_quota() ) {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ /**
+ * Replace newlines, tabs, and multiple spaces with a single space
+ *
+ * @param string $string
+ * @return string
+ */
+ public function min_whitespace( $string ) {
+ return preg_replace( '|[\r\n\t ]+|', ' ', $string );
+ }
+
+ /**
+ * Resets global variables that grow out of control during imports.
+ *
+ * @since 3.0.0
+ *
+ * @global wpdb $wpdb WordPress database abstraction object.
+ * @global array $wp_actions
+ */
+ public function stop_the_insanity() {
+ global $wpdb, $wp_actions;
+ // Or define( 'WP_IMPORTING', true );
+ $wpdb->queries = array();
+ // Reset $wp_actions to keep it from growing out of control
+ $wp_actions = array();
+ }
+}
+
+/**
+ * Returns value of command line params.
+ * Exits when a required param is not set.
+ *
+ * @param string $param
+ * @param bool $required
+ * @return mixed
+ */
+function get_cli_args( $param, $required = false ) {
+ $args = $_SERVER['argv'];
+ if ( ! is_array( $args ) ) {
+ $args = array();
+ }
+
+ $out = array();
+
+ $last_arg = null;
+ $return = null;
+
+ $il = sizeof( $args );
+
+ for ( $i = 1, $il; $i < $il; $i++ ) {
+ if ( (bool) preg_match( '/^--(.+)/', $args[ $i ], $match ) ) {
+ $parts = explode( '=', $match[1] );
+ $key = preg_replace( '/[^a-z0-9]+/', '', $parts[0] );
+
+ if ( isset( $parts[1] ) ) {
+ $out[ $key ] = $parts[1];
+ } else {
+ $out[ $key ] = true;
+ }
+
+ $last_arg = $key;
+ } elseif ( (bool) preg_match( '/^-([a-zA-Z0-9]+)/', $args[ $i ], $match ) ) {
+ for ( $j = 0, $jl = strlen( $match[1] ); $j < $jl; $j++ ) {
+ $key = $match[1]{$j};
+ $out[ $key ] = true;
+ }
+
+ $last_arg = $key;
+ } elseif ( $last_arg !== null ) {
+ $out[ $last_arg ] = $args[ $i ];
+ }
+ }
+
+ // Check array for specified param
+ if ( isset( $out[ $param ] ) ) {
+ // Set return value
+ $return = $out[ $param ];
+ }
+
+ // Check for missing required param
+ if ( ! isset( $out[ $param ] ) && $required ) {
+ // Display message and exit
+ echo "\"$param\" parameter is required but was not specified\n";
+ exit();
+ }
+
+ return $return;
+}
diff --git a/www/crm/wp-admin/includes/class-wp-internal-pointers.php b/www/crm/wp-admin/includes/class-wp-internal-pointers.php
new file mode 100644
index 00000000..36bd3338
--- /dev/null
+++ b/www/crm/wp-admin/includes/class-wp-internal-pointers.php
@@ -0,0 +1,165 @@
+<?php
+/**
+ * Administration API: WP_Internal_Pointers class
+ *
+ * @package WordPress
+ * @subpackage Administration
+ * @since 4.4.0
+ */
+
+/**
+ * Core class used to implement an internal admin pointers API.
+ *
+ * @since 3.3.0
+ */
+final class WP_Internal_Pointers {
+ /**
+ * Initializes the new feature pointers.
+ *
+ * @since 3.3.0
+ *
+ * All pointers can be disabled using the following:
+ * remove_action( 'admin_enqueue_scripts', array( 'WP_Internal_Pointers', 'enqueue_scripts' ) );
+ *
+ * Individual pointers (e.g. wp390_widgets) can be disabled using the following:
+ * remove_action( 'admin_print_footer_scripts', array( 'WP_Internal_Pointers', 'pointer_wp390_widgets' ) );
+ *
+ * @param string $hook_suffix The current admin page.
+ */
+ public static function enqueue_scripts( $hook_suffix ) {
+ /*
+ * Register feature pointers
+ *
+ * Format:
+ * array(
+ * hook_suffix => pointer callback
+ * )
+ *
+ * Example:
+ * array(
+ * 'themes.php' => 'wp390_widgets'
+ * )
+ */
+ $registered_pointers = array(
+ //None currently.
+ );
+
+ // Check if screen related pointer is registered
+ if ( empty( $registered_pointers[ $hook_suffix ] ) ) {
+ return;
+ }
+
+ $pointers = (array) $registered_pointers[ $hook_suffix ];
+
+ /*
+ * Specify required capabilities for feature pointers
+ *
+ * Format:
+ * array(
+ * pointer callback => Array of required capabilities
+ * )
+ *
+ * Example:
+ * array(
+ * 'wp390_widgets' => array( 'edit_theme_options' )
+ * )
+ */
+ $caps_required = array(
+ // None currently.
+ );
+
+ // Get dismissed pointers
+ $dismissed = explode( ',', (string) get_user_meta( get_current_user_id(), 'dismissed_wp_pointers', true ) );
+
+ $got_pointers = false;
+ foreach ( array_diff( $pointers, $dismissed ) as $pointer ) {
+ if ( isset( $caps_required[ $pointer ] ) ) {
+ foreach ( $caps_required[ $pointer ] as $cap ) {
+ if ( ! current_user_can( $cap ) ) {
+ continue 2;
+ }
+ }
+ }
+
+ // Bind pointer print function
+ add_action( 'admin_print_footer_scripts', array( 'WP_Internal_Pointers', 'pointer_' . $pointer ) );
+ $got_pointers = true;
+ }
+
+ if ( ! $got_pointers ) {
+ return;
+ }
+
+ // Add pointers script and style to queue
+ wp_enqueue_style( 'wp-pointer' );
+ wp_enqueue_script( 'wp-pointer' );
+ }
+
+ /**
+ * Print the pointer JavaScript data.
+ *
+ * @since 3.3.0
+ *
+ * @param string $pointer_id The pointer ID.
+ * @param string $selector The HTML elements, on which the pointer should be attached.
+ * @param array $args Arguments to be passed to the pointer JS (see wp-pointer.js).
+ */
+ private static function print_js( $pointer_id, $selector, $args ) {
+ if ( empty( $pointer_id ) || empty( $selector ) || empty( $args ) || empty( $args['content'] ) ) {
+ return;
+ }
+
+ ?>
+ <script type="text/javascript">
+ (function($){
+ var options = <?php echo wp_json_encode( $args ); ?>, setup;
+
+ if ( ! options )
+ return;
+
+ options = $.extend( options, {
+ close: function() {
+ $.post( ajaxurl, {
+ pointer: '<?php echo $pointer_id; ?>',
+ action: 'dismiss-wp-pointer'
+ });
+ }
+ });
+
+ setup = function() {
+ $('<?php echo $selector; ?>').first().pointer( options ).pointer('open');
+ };
+
+ if ( options.position && options.position.defer_loading )
+ $(window).bind( 'load.wp-pointers', setup );
+ else
+ $(document).ready( setup );
+
+ })( jQuery );
+ </script>
+ <?php
+ }
+
+ public static function pointer_wp330_toolbar() {}
+ public static function pointer_wp330_media_uploader() {}
+ public static function pointer_wp330_saving_widgets() {}
+ public static function pointer_wp340_customize_current_theme_link() {}
+ public static function pointer_wp340_choose_image_from_library() {}
+ public static function pointer_wp350_media() {}
+ public static function pointer_wp360_revisions() {}
+ public static function pointer_wp360_locks() {}
+ public static function pointer_wp390_widgets() {}
+ public static function pointer_wp410_dfw() {}
+ public static function pointer_wp496_privacy() {}
+
+ /**
+ * Prevents new users from seeing existing 'new feature' pointers.
+ *
+ * @since 3.3.0
+ *
+ * @param int $user_id User ID.
+ */
+ public static function dismiss_pointers_for_new_users( $user_id ) {
+ add_user_meta( $user_id, 'dismissed_wp_pointers', '' );
+ }
+}
diff --git a/www/crm/wp-admin/includes/class-wp-links-list-table.php b/www/crm/wp-admin/includes/class-wp-links-list-table.php
new file mode 100644
index 00000000..f3b51961
--- /dev/null
+++ b/www/crm/wp-admin/includes/class-wp-links-list-table.php
@@ -0,0 +1,326 @@
+<?php
+/**
+ * List Table API: WP_Links_List_Table class
+ *
+ * @package WordPress
+ * @subpackage Administration
+ * @since 3.1.0
+ */
+
+/**
+ * Core class used to implement displaying links in a list table.
+ *
+ * @since 3.1.0
+ * @access private
+ *
+ * @see WP_List_Tsble
+ */
+class WP_Links_List_Table extends WP_List_Table {
+
+ /**
+ * Constructor.
+ *
+ * @since 3.1.0
+ *
+ * @see WP_List_Table::__construct() for more information on default arguments.
+ *
+ * @param array $args An associative array of arguments.
+ */
+ public function __construct( $args = array() ) {
+ parent::__construct(
+ array(
+ 'plural' => 'bookmarks',
+ 'screen' => isset( $args['screen'] ) ? $args['screen'] : null,
+ )
+ );
+ }
+
+ /**
+ * @return bool
+ */
+ public function ajax_user_can() {
+ return current_user_can( 'manage_links' );
+ }
+
+ /**
+ * @global int $cat_id
+ * @global string $s
+ * @global string $orderby
+ * @global string $order
+ */
+ public function prepare_items() {
+ global $cat_id, $s, $orderby, $order;
+
+ wp_reset_vars( array( 'action', 'cat_id', 'link_id', 'orderby', 'order', 's' ) );
+
+ $args = array(
+ 'hide_invisible' => 0,
+ 'hide_empty' => 0,
+ );
+
+ if ( 'all' != $cat_id ) {
+ $args['category'] = $cat_id;
+ }
+ if ( ! empty( $s ) ) {
+ $args['search'] = $s;
+ }
+ if ( ! empty( $orderby ) ) {
+ $args['orderby'] = $orderby;
+ }
+ if ( ! empty( $order ) ) {
+ $args['order'] = $order;
+ }
+
+ $this->items = get_bookmarks( $args );
+ }
+
+ /**
+ */
+ public function no_items() {
+ _e( 'No links found.' );
+ }
+
+ /**
+ * @return array
+ */
+ protected function get_bulk_actions() {
+ $actions = array();
+ $actions['delete'] = __( 'Delete' );
+
+ return $actions;
+ }
+
+ /**
+ * @global int $cat_id
+ * @param string $which
+ */
+ protected function extra_tablenav( $which ) {
+ global $cat_id;
+
+ if ( 'top' != $which ) {
+ return;
+ }
+ ?>
+ <div class="alignleft actions">
+ <?php
+ $dropdown_options = array(
+ 'selected' => $cat_id,
+ 'name' => 'cat_id',
+ 'taxonomy' => 'link_category',
+ 'show_option_all' => get_taxonomy( 'link_category' )->labels->all_items,
+ 'hide_empty' => true,
+ 'hierarchical' => 1,
+ 'show_count' => 0,
+ 'orderby' => 'name',
+ );
+
+ echo '<label class="screen-reader-text" for="cat_id">' . __( 'Filter by category' ) . '</label>';
+ wp_dropdown_categories( $dropdown_options );
+ submit_button( __( 'Filter' ), '', 'filter_action', false, array( 'id' => 'post-query-submit' ) );
+ ?>
+ </div>
+ <?php
+ }
+
+ /**
+ * @return array
+ */
+ public function get_columns() {
+ return array(
+ 'cb' => '<input type="checkbox" />',
+ 'name' => _x( 'Name', 'link name' ),
+ 'url' => __( 'URL' ),
+ 'categories' => __( 'Categories' ),
+ 'rel' => __( 'Relationship' ),
+ 'visible' => __( 'Visible' ),
+ 'rating' => __( 'Rating' ),
+ );
+ }
+
+ /**
+ * @return array
+ */
+ protected function get_sortable_columns() {
+ return array(
+ 'name' => 'name',
+ 'url' => 'url',
+ 'visible' => 'visible',
+ 'rating' => 'rating',
+ );
+ }
+
+ /**
+ * Get the name of the default primary column.
+ *
+ * @since 4.3.0
+ *
+ * @return string Name of the default primary column, in this case, 'name'.
+ */
+ protected function get_default_primary_column_name() {
+ return 'name';
+ }
+
+ /**
+ * Handles the checkbox column output.
+ *
+ * @since 4.3.0
+ *
+ * @param object $link The current link object.
+ */
+ public function column_cb( $link ) {
+ ?>
+ <label class="screen-reader-text" for="cb-select-<?php echo $link->link_id; ?>"><?php echo sprintf( __( 'Select %s' ), $link->link_name ); ?></label>
+ <input type="checkbox" name="linkcheck[]" id="cb-select-<?php echo $link->link_id; ?>" value="<?php echo esc_attr( $link->link_id ); ?>" />
+ <?php
+ }
+
+ /**
+ * Handles the link name column output.
+ *
+ * @since 4.3.0
+ *
+ * @param object $link The current link object.
+ */
+ public function column_name( $link ) {
+ $edit_link = get_edit_bookmark_link( $link );
+ printf(
+ '<strong><a class="row-title" href="%s" aria-label="%s">%s</a></strong>',
+ $edit_link,
+ /* translators: %s: link name */
+ esc_attr( sprintf( __( 'Edit &#8220;%s&#8221;' ), $link->link_name ) ),
+ $link->link_name
+ );
+ }
+
+ /**
+ * Handles the link URL column output.
+ *
+ * @since 4.3.0
+ *
+ * @param object $link The current link object.
+ */
+ public function column_url( $link ) {
+ $short_url = url_shorten( $link->link_url );
+ echo "<a href='$link->link_url'>$short_url</a>";
+ }
+
+ /**
+ * Handles the link categories column output.
+ *
+ * @since 4.3.0
+ *
+ * @global int $cat_id
+ *
+ * @param object $link The current link object.
+ */
+ public function column_categories( $link ) {
+ global $cat_id;
+
+ $cat_names = array();
+ foreach ( $link->link_category as $category ) {
+ $cat = get_term( $category, 'link_category', OBJECT, 'display' );
+ if ( is_wp_error( $cat ) ) {
+ echo $cat->get_error_message();
+ }
+ $cat_name = $cat->name;
+ if ( $cat_id != $category ) {
+ $cat_name = "<a href='link-manager.php?cat_id=$category'>$cat_name</a>";
+ }
+ $cat_names[] = $cat_name;
+ }
+ echo implode( ', ', $cat_names );
+ }
+
+ /**
+ * Handles the link relation column output.
+ *
+ * @since 4.3.0
+ *
+ * @param object $link The current link object.
+ */
+ public function column_rel( $link ) {
+ echo empty( $link->link_rel ) ? '<br />' : $link->link_rel;
+ }
+
+ /**
+ * Handles the link visibility column output.
+ *
+ * @since 4.3.0
+ *
+ * @param object $link The current link object.
+ */
+ public function column_visible( $link ) {
+ if ( 'Y' === $link->link_visible ) {
+ _e( 'Yes' );
+ } else {
+ _e( 'No' );
+ }
+ }
+
+ /**
+ * Handles the link rating column output.
+ *
+ * @since 4.3.0
+ *
+ * @param object $link The current link object.
+ */
+ public function column_rating( $link ) {
+ echo $link->link_rating;
+ }
+
+ /**
+ * Handles the default column output.
+ *
+ * @since 4.3.0
+ *
+ * @param object $link Link object.
+ * @param string $column_name Current column name.
+ */
+ public function column_default( $link, $column_name ) {
+ /**
+ * Fires for each registered custom link column.
+ *
+ * @since 2.1.0
+ *
+ * @param string $column_name Name of the custom column.
+ * @param int $link_id Link ID.
+ */
+ do_action( 'manage_link_custom_column', $column_name, $link->link_id );
+ }
+
+ public function display_rows() {
+ foreach ( $this->items as $link ) {
+ $link = sanitize_bookmark( $link );
+ $link->link_name = esc_attr( $link->link_name );
+ $link->link_category = wp_get_link_cats( $link->link_id );
+ ?>
+ <tr id="link-<?php echo $link->link_id; ?>">
+ <?php $this->single_row_columns( $link ); ?>
+ </tr>
+ <?php
+ }
+ }
+
+ /**
+ * Generates and displays row action links.
+ *
+ * @since 4.3.0
+ *
+ * @param object $link Link being acted upon.
+ * @param string $column_name Current column name.
+ * @param string $primary Primary column name.
+ * @return string Row action output for links.
+ */
+ protected function handle_row_actions( $link, $column_name, $primary ) {
+ if ( $primary !== $column_name ) {
+ return '';
+ }
+
+ $edit_link = get_edit_bookmark_link( $link );
+
+ $actions = array();
+ $actions['edit'] = '<a href="' . $edit_link . '">' . __( 'Edit' ) . '</a>';
+ $actions['delete'] = "<a class='submitdelete' href='" . wp_nonce_url( "link.php?action=delete&amp;link_id=$link->link_id", 'delete-bookmark_' . $link->link_id ) . "' onclick=\"if ( confirm( '" . esc_js( sprintf( __( "You are about to delete this link '%s'\n 'Cancel' to stop, 'OK' to delete." ), $link->link_name ) ) . "' ) ) { return true;}return false;\">" . __( 'Delete' ) . '</a>';
+ return $this->row_actions( $actions );
+ }
+}
diff --git a/www/crm/wp-admin/includes/class-wp-list-table-compat.php b/www/crm/wp-admin/includes/class-wp-list-table-compat.php
new file mode 100644
index 00000000..eb9ea2cf
--- /dev/null
+++ b/www/crm/wp-admin/includes/class-wp-list-table-compat.php
@@ -0,0 +1,50 @@
+<?php
+/**
+ * Helper functions for displaying a list of items in an ajaxified HTML table.
+ *
+ * @package WordPress
+ * @subpackage List_Table
+ * @since 4.7.0
+ */
+
+/**
+ * Helper class to be used only by back compat functions
+ *
+ * @since 3.1.0
+ */
+class _WP_List_Table_Compat extends WP_List_Table {
+ public $_screen;
+ public $_columns;
+
+ public function __construct( $screen, $columns = array() ) {
+ if ( is_string( $screen ) ) {
+ $screen = convert_to_screen( $screen );
+ }
+
+ $this->_screen = $screen;
+
+ if ( ! empty( $columns ) ) {
+ $this->_columns = $columns;
+ add_filter( 'manage_' . $screen->id . '_columns', array( $this, 'get_columns' ), 0 );
+ }
+ }
+
+ /**
+ * @return array
+ */
+ protected function get_column_info() {
+ $columns = get_column_headers( $this->_screen );
+ $hidden = get_hidden_columns( $this->_screen );
+ $sortable = array();
+ $primary = $this->get_default_primary_column_name();
+
+ return array( $columns, $hidden, $sortable, $primary );
+ }
+
+ /**
+ * @return array
+ */
+ public function get_columns() {
+ return $this->_columns;
+ }
+}
diff --git a/www/crm/wp-admin/includes/class-wp-list-table.php b/www/crm/wp-admin/includes/class-wp-list-table.php
new file mode 100644
index 00000000..53ef0bc8
--- /dev/null
+++ b/www/crm/wp-admin/includes/class-wp-list-table.php
@@ -0,0 +1,1400 @@
+<?php
+/**
+ * Administration API: WP_List_Table class
+ *
+ * @package WordPress
+ * @subpackage List_Table
+ * @since 3.1.0
+ */
+
+/**
+ * Base class for displaying a list of items in an ajaxified HTML table.
+ *
+ * @since 3.1.0
+ * @access private
+ */
+class WP_List_Table {
+
+ /**
+ * The current list of items.
+ *
+ * @since 3.1.0
+ * @var array
+ */
+ public $items;
+
+ /**
+ * Various information about the current table.
+ *
+ * @since 3.1.0
+ * @var array
+ */
+ protected $_args;
+
+ /**
+ * Various information needed for displaying the pagination.
+ *
+ * @since 3.1.0
+ * @var array
+ */
+ protected $_pagination_args = array();
+
+ /**
+ * The current screen.
+ *
+ * @since 3.1.0
+ * @var object
+ */
+ protected $screen;
+
+ /**
+ * Cached bulk actions.
+ *
+ * @since 3.1.0
+ * @var array
+ */
+ private $_actions;
+
+ /**
+ * Cached pagination output.
+ *
+ * @since 3.1.0
+ * @var string
+ */
+ private $_pagination;
+
+ /**
+ * The view switcher modes.
+ *
+ * @since 4.1.0
+ * @var array
+ */
+ protected $modes = array();
+
+ /**
+ * Stores the value returned by ->get_column_info().
+ *
+ * @since 4.1.0
+ * @var array
+ */
+ protected $_column_headers;
+
+ /**
+ * {@internal Missing Summary}
+ *
+ * @var array
+ */
+ protected $compat_fields = array( '_args', '_pagination_args', 'screen', '_actions', '_pagination' );
+
+ /**
+ * {@internal Missing Summary}
+ *
+ * @var array
+ */
+ protected $compat_methods = array(
+ 'set_pagination_args',
+ 'get_views',
+ 'get_bulk_actions',
+ 'bulk_actions',
+ 'row_actions',
+ 'months_dropdown',
+ 'view_switcher',
+ 'comments_bubble',
+ 'get_items_per_page',
+ 'pagination',
+ 'get_sortable_columns',
+ 'get_column_info',
+ 'get_table_classes',
+ 'display_tablenav',
+ 'extra_tablenav',
+ 'single_row_columns',
+ );
+
+ /**
+ * Constructor.
+ *
+ * The child class should call this constructor from its own constructor to override
+ * the default $args.
+ *
+ * @since 3.1.0
+ *
+ * @param array|string $args {
+ * Array or string of arguments.
+ *
+ * @type string $plural Plural value used for labels and the objects being listed.
+ * This affects things such as CSS class-names and nonces used
+ * in the list table, e.g. 'posts'. Default empty.
+ * @type string $singular Singular label for an object being listed, e.g. 'post'.
+ * Default empty
+ * @type bool $ajax Whether the list table supports Ajax. This includes loading
+ * and sorting data, for example. If true, the class will call
+ * the _js_vars() method in the footer to provide variables
+ * to any scripts handling Ajax events. Default false.
+ * @type string $screen String containing the hook name used to determine the current
+ * screen. If left null, the current screen will be automatically set.
+ * Default null.
+ * }
+ */
+ public function __construct( $args = array() ) {
+ $args = wp_parse_args(
+ $args,
+ array(
+ 'plural' => '',
+ 'singular' => '',
+ 'ajax' => false,
+ 'screen' => null,
+ )
+ );
+
+ $this->screen = convert_to_screen( $args['screen'] );
+
+ add_filter( "manage_{$this->screen->id}_columns", array( $this, 'get_columns' ), 0 );
+
+ if ( ! $args['plural'] ) {
+ $args['plural'] = $this->screen->base;
+ }
+
+ $args['plural'] = sanitize_key( $args['plural'] );
+ $args['singular'] = sanitize_key( $args['singular'] );
+
+ $this->_args = $args;
+
+ if ( $args['ajax'] ) {
+ // wp_enqueue_script( 'list-table' );
+ add_action( 'admin_footer', array( $this, '_js_vars' ) );
+ }
+
+ if ( empty( $this->modes ) ) {
+ $this->modes = array(
+ 'list' => __( 'List View' ),
+ 'excerpt' => __( 'Excerpt View' ),
+ );
+ }
+ }
+
+ /**
+ * Make private properties readable for backward compatibility.
+ *
+ * @since 4.0.0
+ *
+ * @param string $name Property to get.
+ * @return mixed Property.
+ */
+ public function __get( $name ) {
+ if ( in_array( $name, $this->compat_fields ) ) {
+ return $this->$name;
+ }
+ }
+
+ /**
+ * Make private properties settable for backward compatibility.
+ *
+ * @since 4.0.0
+ *
+ * @param string $name Property to check if set.
+ * @param mixed $value Property value.
+ * @return mixed Newly-set property.
+ */
+ public function __set( $name, $value ) {
+ if ( in_array( $name, $this->compat_fields ) ) {
+ return $this->$name = $value;
+ }
+ }
+
+ /**
+ * Make private properties checkable for backward compatibility.
+ *
+ * @since 4.0.0
+ *
+ * @param string $name Property to check if set.
+ * @return bool Whether the property is set.
+ */
+ public function __isset( $name ) {
+ if ( in_array( $name, $this->compat_fields ) ) {
+ return isset( $this->$name );
+ }
+ }
+
+ /**
+ * Make private properties un-settable for backward compatibility.
+ *
+ * @since 4.0.0
+ *
+ * @param string $name Property to unset.
+ */
+ public function __unset( $name ) {
+ if ( in_array( $name, $this->compat_fields ) ) {
+ unset( $this->$name );
+ }
+ }
+
+ /**
+ * Make private/protected methods readable for backward compatibility.
+ *
+ * @since 4.0.0
+ *
+ * @param string $name Method to call.
+ * @param array $arguments Arguments to pass when calling.
+ * @return mixed|bool Return value of the callback, false otherwise.
+ */
+ public function __call( $name, $arguments ) {
+ if ( in_array( $name, $this->compat_methods ) ) {
+ return call_user_func_array( array( $this, $name ), $arguments );
+ }
+ return false;
+ }
+
+ /**
+ * Checks the current user's permissions
+ *
+ * @since 3.1.0
+ * @abstract
+ */
+ public function ajax_user_can() {
+ die( 'function WP_List_Table::ajax_user_can() must be over-ridden in a sub-class.' );
+ }
+
+ /**
+ * Prepares the list of items for displaying.
+ *
+ * @uses WP_List_Table::set_pagination_args()
+ *
+ * @since 3.1.0
+ * @abstract
+ */
+ public function prepare_items() {
+ die( 'function WP_List_Table::prepare_items() must be over-ridden in a sub-class.' );
+ }
+
+ /**
+ * An internal method that sets all the necessary pagination arguments
+ *
+ * @since 3.1.0
+ *
+ * @param array|string $args Array or string of arguments with information about the pagination.
+ */
+ protected function set_pagination_args( $args ) {
+ $args = wp_parse_args(
+ $args,
+ array(
+ 'total_items' => 0,
+ 'total_pages' => 0,
+ 'per_page' => 0,
+ )
+ );
+
+ if ( ! $args['total_pages'] && $args['per_page'] > 0 ) {
+ $args['total_pages'] = ceil( $args['total_items'] / $args['per_page'] );
+ }
+
+ // Redirect if page number is invalid and headers are not already sent.
+ if ( ! headers_sent() && ! wp_doing_ajax() && $args['total_pages'] > 0 && $this->get_pagenum() > $args['total_pages'] ) {
+ wp_redirect( add_query_arg( 'paged', $args['total_pages'] ) );
+ exit;
+ }
+
+ $this->_pagination_args = $args;
+ }
+
+ /**
+ * Access the pagination args.
+ *
+ * @since 3.1.0
+ *
+ * @param string $key Pagination argument to retrieve. Common values include 'total_items',
+ * 'total_pages', 'per_page', or 'infinite_scroll'.
+ * @return int Number of items that correspond to the given pagination argument.
+ */
+ public function get_pagination_arg( $key ) {
+ if ( 'page' === $key ) {
+ return $this->get_pagenum();
+ }
+
+ if ( isset( $this->_pagination_args[ $key ] ) ) {
+ return $this->_pagination_args[ $key ];
+ }
+ }
+
+ /**
+ * Whether the table has items to display or not
+ *
+ * @since 3.1.0
+ *
+ * @return bool
+ */
+ public function has_items() {
+ return ! empty( $this->items );
+ }
+
+ /**
+ * Message to be displayed when there are no items
+ *
+ * @since 3.1.0
+ */
+ public function no_items() {
+ _e( 'No items found.' );
+ }
+
+ /**
+ * Displays the search box.
+ *
+ * @since 3.1.0
+ *
+ * @param string $text The 'submit' button label.
+ * @param string $input_id ID attribute value for the search input field.
+ */
+ public function search_box( $text, $input_id ) {
+ if ( empty( $_REQUEST['s'] ) && ! $this->has_items() ) {
+ return;
+ }
+
+ $input_id = $input_id . '-search-input';
+
+ if ( ! empty( $_REQUEST['orderby'] ) ) {
+ echo '<input type="hidden" name="orderby" value="' . esc_attr( $_REQUEST['orderby'] ) . '" />';
+ }
+ if ( ! empty( $_REQUEST['order'] ) ) {
+ echo '<input type="hidden" name="order" value="' . esc_attr( $_REQUEST['order'] ) . '" />';
+ }
+ if ( ! empty( $_REQUEST['post_mime_type'] ) ) {
+ echo '<input type="hidden" name="post_mime_type" value="' . esc_attr( $_REQUEST['post_mime_type'] ) . '" />';
+ }
+ if ( ! empty( $_REQUEST['detached'] ) ) {
+ echo '<input type="hidden" name="detached" value="' . esc_attr( $_REQUEST['detached'] ) . '" />';
+ }
+ ?>
+<p class="search-box">
+ <label class="screen-reader-text" for="<?php echo esc_attr( $input_id ); ?>"><?php echo $text; ?>:</label>
+ <input type="search" id="<?php echo esc_attr( $input_id ); ?>" name="s" value="<?php _admin_search_query(); ?>" />
+ <?php submit_button( $text, '', '', false, array( 'id' => 'search-submit' ) ); ?>
+</p>
+ <?php
+ }
+
+ /**
+ * Get an associative array ( id => link ) with the list
+ * of views available on this table.
+ *
+ * @since 3.1.0
+ *
+ * @return array
+ */
+ protected function get_views() {
+ return array();
+ }
+
+ /**
+ * Display the list of views available on this table.
+ *
+ * @since 3.1.0
+ */
+ public function views() {
+ $views = $this->get_views();
+ /**
+ * Filters the list of available list table views.
+ *
+ * The dynamic portion of the hook name, `$this->screen->id`, refers
+ * to the ID of the current screen, usually a string.
+ *
+ * @since 3.5.0
+ *
+ * @param string[] $views An array of available list table views.
+ */
+ $views = apply_filters( "views_{$this->screen->id}", $views );
+
+ if ( empty( $views ) ) {
+ return;
+ }
+
+ $this->screen->render_screen_reader_content( 'heading_views' );
+
+ echo "<ul class='subsubsub'>\n";
+ foreach ( $views as $class => $view ) {
+ $views[ $class ] = "\t<li class='$class'>$view";
+ }
+ echo implode( " |</li>\n", $views ) . "</li>\n";
+ echo '</ul>';
+ }
+
+ /**
+ * Get an associative array ( option_name => option_title ) with the list
+ * of bulk actions available on this table.
+ *
+ * @since 3.1.0
+ *
+ * @return array
+ */
+ protected function get_bulk_actions() {
+ return array();
+ }
+
+ /**
+ * Display the bulk actions dropdown.
+ *
+ * @since 3.1.0
+ *
+ * @param string $which The location of the bulk actions: 'top' or 'bottom'.
+ * This is designated as optional for backward compatibility.
+ */
+ protected function bulk_actions( $which = '' ) {
+ if ( is_null( $this->_actions ) ) {
+ $this->_actions = $this->get_bulk_actions();
+ /**
+ * Filters the list table Bulk Actions drop-down.
+ *
+ * The dynamic portion of the hook name, `$this->screen->id`, refers
+ * to the ID of the current screen, usually a string.
+ *
+ * This filter can currently only be used to remove bulk actions.
+ *
+ * @since 3.5.0
+ *
+ * @param string[] $actions An array of the available bulk actions.
+ */
+ $this->_actions = apply_filters( "bulk_actions-{$this->screen->id}", $this->_actions );
+ $two = '';
+ } else {
+ $two = '2';
+ }
+
+ if ( empty( $this->_actions ) ) {
+ return;
+ }
+
+ echo '<label for="bulk-action-selector-' . esc_attr( $which ) . '" class="screen-reader-text">' . __( 'Select bulk action' ) . '</label>';
+ echo '<select name="action' . $two . '" id="bulk-action-selector-' . esc_attr( $which ) . "\">\n";
+ echo '<option value="-1">' . __( 'Bulk Actions' ) . "</option>\n";
+
+ foreach ( $this->_actions as $name => $title ) {
+ $class = 'edit' === $name ? ' class="hide-if-no-js"' : '';
+
+ echo "\t" . '<option value="' . $name . '"' . $class . '>' . $title . "</option>\n";
+ }
+
+ echo "</select>\n";
+
+ submit_button( __( 'Apply' ), 'action', '', false, array( 'id' => "doaction$two" ) );
+ echo "\n";
+ }
+
+ /**
+ * Get the current action selected from the bulk actions dropdown.
+ *
+ * @since 3.1.0
+ *
+ * @return string|false The action name or False if no action was selected
+ */
+ public function current_action() {
+ if ( isset( $_REQUEST['filter_action'] ) && ! empty( $_REQUEST['filter_action'] ) ) {
+ return false;
+ }
+
+ if ( isset( $_REQUEST['action'] ) && -1 != $_REQUEST['action'] ) {
+ return $_REQUEST['action'];
+ }
+
+ if ( isset( $_REQUEST['action2'] ) && -1 != $_REQUEST['action2'] ) {
+ return $_REQUEST['action2'];
+ }
+
+ return false;
+ }
+
+ /**
+ * Generate row actions div
+ *
+ * @since 3.1.0
+ *
+ * @param string[] $actions An array of action links.
+ * @param bool $always_visible Whether the actions should be always visible.
+ * @return string
+ */
+ protected function row_actions( $actions, $always_visible = false ) {
+ $action_count = count( $actions );
+ $i = 0;
+
+ if ( ! $action_count ) {
+ return '';
+ }
+
+ $out = '<div class="' . ( $always_visible ? 'row-actions visible' : 'row-actions' ) . '">';
+ foreach ( $actions as $action => $link ) {
+ ++$i;
+ ( $i == $action_count ) ? $sep = '' : $sep = ' | ';
+ $out .= "<span class='$action'>$link$sep</span>";
+ }
+ $out .= '</div>';
+
+ $out .= '<button type="button" class="toggle-row"><span class="screen-reader-text">' . __( 'Show more details' ) . '</span></button>';
+
+ return $out;
+ }
+
+ /**
+ * Display a monthly dropdown for filtering items
+ *
+ * @since 3.1.0
+ *
+ * @global wpdb $wpdb
+ * @global WP_Locale $wp_locale
+ *
+ * @param string $post_type
+ */
+ protected function months_dropdown( $post_type ) {
+ global $wpdb, $wp_locale;
+
+ /**
+ * Filters whether to remove the 'Months' drop-down from the post list table.
+ *
+ * @since 4.2.0
+ *
+ * @param bool $disable Whether to disable the drop-down. Default false.
+ * @param string $post_type The post type.
+ */
+ if ( apply_filters( 'disable_months_dropdown', false, $post_type ) ) {
+ return;
+ }
+
+ $extra_checks = "AND post_status != 'auto-draft'";
+ if ( ! isset( $_GET['post_status'] ) || 'trash' !== $_GET['post_status'] ) {
+ $extra_checks .= " AND post_status != 'trash'";
+ } elseif ( isset( $_GET['post_status'] ) ) {
+ $extra_checks = $wpdb->prepare( ' AND post_status = %s', $_GET['post_status'] );
+ }
+
+ $months = $wpdb->get_results(
+ $wpdb->prepare(
+ "
+ SELECT DISTINCT YEAR( post_date ) AS year, MONTH( post_date ) AS month
+ FROM $wpdb->posts
+ WHERE post_type = %s
+ $extra_checks
+ ORDER BY post_date DESC
+ ",
+ $post_type
+ )
+ );
+
+ /**
+ * Filters the 'Months' drop-down results.
+ *
+ * @since 3.7.0
+ *
+ * @param object $months The months drop-down query results.
+ * @param string $post_type The post type.
+ */
+ $months = apply_filters( 'months_dropdown_results', $months, $post_type );
+
+ $month_count = count( $months );
+
+ if ( ! $month_count || ( 1 == $month_count && 0 == $months[0]->month ) ) {
+ return;
+ }
+
+ $m = isset( $_GET['m'] ) ? (int) $_GET['m'] : 0;
+ ?>
+ <label for="filter-by-date" class="screen-reader-text"><?php _e( 'Filter by date' ); ?></label>
+ <select name="m" id="filter-by-date">
+ <option<?php selected( $m, 0 ); ?> value="0"><?php _e( 'All dates' ); ?></option>
+ <?php
+ foreach ( $months as $arc_row ) {
+ if ( 0 == $arc_row->year ) {
+ continue;
+ }
+
+ $month = zeroise( $arc_row->month, 2 );
+ $year = $arc_row->year;
+
+ printf(
+ "<option %s value='%s'>%s</option>\n",
+ selected( $m, $year . $month, false ),
+ esc_attr( $arc_row->year . $month ),
+ /* translators: 1: month name, 2: 4-digit year */
+ sprintf( __( '%1$s %2$d' ), $wp_locale->get_month( $month ), $year )
+ );
+ }
+ ?>
+ </select>
+ <?php
+ }
+
+ /**
+ * Display a view switcher
+ *
+ * @since 3.1.0
+ *
+ * @param string $current_mode
+ */
+ protected function view_switcher( $current_mode ) {
+ ?>
+ <input type="hidden" name="mode" value="<?php echo esc_attr( $current_mode ); ?>" />
+ <div class="view-switch">
+ <?php
+ foreach ( $this->modes as $mode => $title ) {
+ $classes = array( 'view-' . $mode );
+ if ( $current_mode === $mode ) {
+ $classes[] = 'current';
+ }
+ printf(
+ "<a href='%s' class='%s' id='view-switch-$mode'><span class='screen-reader-text'>%s</span></a>\n",
+ esc_url( add_query_arg( 'mode', $mode ) ),
+ implode( ' ', $classes ),
+ $title
+ );
+ }
+ ?>
+ </div>
+ <?php
+ }
+
+ /**
+ * Display a comment count bubble
+ *
+ * @since 3.1.0
+ *
+ * @param int $post_id The post ID.
+ * @param int $pending_comments Number of pending comments.
+ */
+ protected function comments_bubble( $post_id, $pending_comments ) {
+ $approved_comments = get_comments_number();
+
+ $approved_comments_number = number_format_i18n( $approved_comments );
+ $pending_comments_number = number_format_i18n( $pending_comments );
+
+ $approved_only_phrase = sprintf( _n( '%s comment', '%s comments', $approved_comments ), $approved_comments_number );
+ $approved_phrase = sprintf( _n( '%s approved comment', '%s approved comments', $approved_comments ), $approved_comments_number );
+ $pending_phrase = sprintf( _n( '%s pending comment', '%s pending comments', $pending_comments ), $pending_comments_number );
+
+ // No comments at all.
+ if ( ! $approved_comments && ! $pending_comments ) {
+ printf(
+ '<span aria-hidden="true">&#8212;</span><span class="screen-reader-text">%s</span>',
+ __( 'No comments' )
+ );
+ // Approved comments have different display depending on some conditions.
+ } elseif ( $approved_comments ) {
+ printf(
+ '<a href="%s" class="post-com-count post-com-count-approved"><span class="comment-count-approved" aria-hidden="true">%s</span><span class="screen-reader-text">%s</span></a>',
+ esc_url(
+ add_query_arg(
+ array(
+ 'p' => $post_id,
+ 'comment_status' => 'approved',
+ ),
+ admin_url( 'edit-comments.php' )
+ )
+ ),
+ $approved_comments_number,
+ $pending_comments ? $approved_phrase : $approved_only_phrase
+ );
+ } else {
+ printf(
+ '<span class="post-com-count post-com-count-no-comments"><span class="comment-count comment-count-no-comments" aria-hidden="true">%s</span><span class="screen-reader-text">%s</span></span>',
+ $approved_comments_number,
+ $pending_comments ? __( 'No approved comments' ) : __( 'No comments' )
+ );
+ }
+
+ if ( $pending_comments ) {
+ printf(
+ '<a href="%s" class="post-com-count post-com-count-pending"><span class="comment-count-pending" aria-hidden="true">%s</span><span class="screen-reader-text">%s</span></a>',
+ esc_url(
+ add_query_arg(
+ array(
+ 'p' => $post_id,
+ 'comment_status' => 'moderated',
+ ),
+ admin_url( 'edit-comments.php' )
+ )
+ ),
+ $pending_comments_number,
+ $pending_phrase
+ );
+ } else {
+ printf(
+ '<span class="post-com-count post-com-count-pending post-com-count-no-pending"><span class="comment-count comment-count-no-pending" aria-hidden="true">%s</span><span class="screen-reader-text">%s</span></span>',
+ $pending_comments_number,
+ $approved_comments ? __( 'No pending comments' ) : __( 'No comments' )
+ );
+ }
+ }
+
+ /**
+ * Get the current page number
+ *
+ * @since 3.1.0
+ *
+ * @return int
+ */
+ public function get_pagenum() {
+ $pagenum = isset( $_REQUEST['paged'] ) ? absint( $_REQUEST['paged'] ) : 0;
+
+ if ( isset( $this->_pagination_args['total_pages'] ) && $pagenum > $this->_pagination_args['total_pages'] ) {
+ $pagenum = $this->_pagination_args['total_pages'];
+ }
+
+ return max( 1, $pagenum );
+ }
+
+ /**
+ * Get number of items to display on a single page
+ *
+ * @since 3.1.0
+ *
+ * @param string $option
+ * @param int $default
+ * @return int
+ */
+ protected function get_items_per_page( $option, $default = 20 ) {
+ $per_page = (int) get_user_option( $option );
+ if ( empty( $per_page ) || $per_page < 1 ) {
+ $per_page = $default;
+ }
+
+ /**
+ * Filters the number of items to be displayed on each page of the list table.
+ *
+ * The dynamic hook name, $option, refers to the `per_page` option depending
+ * on the type of list table in use. Possible values include: 'edit_comments_per_page',
+ * 'sites_network_per_page', 'site_themes_network_per_page', 'themes_network_per_page',
+ * 'users_network_per_page', 'edit_post_per_page', 'edit_page_per_page',
+ * 'edit_{$post_type}_per_page', etc.
+ *
+ * @since 2.9.0
+ *
+ * @param int $per_page Number of items to be displayed. Default 20.
+ */
+ return (int) apply_filters( "{$option}", $per_page );
+ }
+
+ /**
+ * Display the pagination.
+ *
+ * @since 3.1.0
+ *
+ * @param string $which
+ */
+ protected function pagination( $which ) {
+ if ( empty( $this->_pagination_args ) ) {
+ return;
+ }
+
+ $total_items = $this->_pagination_args['total_items'];
+ $total_pages = $this->_pagination_args['total_pages'];
+ $infinite_scroll = false;
+ if ( isset( $this->_pagination_args['infinite_scroll'] ) ) {
+ $infinite_scroll = $this->_pagination_args['infinite_scroll'];
+ }
+
+ if ( 'top' === $which && $total_pages > 1 ) {
+ $this->screen->render_screen_reader_content( 'heading_pagination' );
+ }
+
+ $output = '<span class="displaying-num">' . sprintf( _n( '%s item', '%s items', $total_items ), number_format_i18n( $total_items ) ) . '</span>';
+
+ $current = $this->get_pagenum();
+ $removable_query_args = wp_removable_query_args();
+
+ $current_url = set_url_scheme( 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] );
+
+ $current_url = remove_query_arg( $removable_query_args, $current_url );
+
+ $page_links = array();
+
+ $total_pages_before = '<span class="paging-input">';
+ $total_pages_after = '</span></span>';
+
+ $disable_first = $disable_last = $disable_prev = $disable_next = false;
+
+ if ( $current == 1 ) {
+ $disable_first = true;
+ $disable_prev = true;
+ }
+ if ( $current == 2 ) {
+ $disable_first = true;
+ }
+ if ( $current == $total_pages ) {
+ $disable_last = true;
+ $disable_next = true;
+ }
+ if ( $current == $total_pages - 1 ) {
+ $disable_last = true;
+ }
+
+ if ( $disable_first ) {
+ $page_links[] = '<span class="tablenav-pages-navspan button disabled" aria-hidden="true">&laquo;</span>';
+ } else {
+ $page_links[] = sprintf(
+ "<a class='first-page button' href='%s'><span class='screen-reader-text'>%s</span><span aria-hidden='true'>%s</span></a>",
+ esc_url( remove_query_arg( 'paged', $current_url ) ),
+ __( 'First page' ),
+ '&laquo;'
+ );
+ }
+
+ if ( $disable_prev ) {
+ $page_links[] = '<span class="tablenav-pages-navspan button disabled" aria-hidden="true">&lsaquo;</span>';
+ } else {
+ $page_links[] = sprintf(
+ "<a class='prev-page button' href='%s'><span class='screen-reader-text'>%s</span><span aria-hidden='true'>%s</span></a>",
+ esc_url( add_query_arg( 'paged', max( 1, $current - 1 ), $current_url ) ),
+ __( 'Previous page' ),
+ '&lsaquo;'
+ );
+ }
+
+ if ( 'bottom' === $which ) {
+ $html_current_page = $current;
+ $total_pages_before = '<span class="screen-reader-text">' . __( 'Current Page' ) . '</span><span id="table-paging" class="paging-input"><span class="tablenav-paging-text">';
+ } else {
+ $html_current_page = sprintf(
+ "%s<input class='current-page' id='current-page-selector' type='text' name='paged' value='%s' size='%d' aria-describedby='table-paging' /><span class='tablenav-paging-text'>",
+ '<label for="current-page-selector" class="screen-reader-text">' . __( 'Current Page' ) . '</label>',
+ $current,
+ strlen( $total_pages )
+ );
+ }
+ $html_total_pages = sprintf( "<span class='total-pages'>%s</span>", number_format_i18n( $total_pages ) );
+ $page_links[] = $total_pages_before . sprintf( _x( '%1$s of %2$s', 'paging' ), $html_current_page, $html_total_pages ) . $total_pages_after;
+
+ if ( $disable_next ) {
+ $page_links[] = '<span class="tablenav-pages-navspan button disabled" aria-hidden="true">&rsaquo;</span>';
+ } else {
+ $page_links[] = sprintf(
+ "<a class='next-page button' href='%s'><span class='screen-reader-text'>%s</span><span aria-hidden='true'>%s</span></a>",
+ esc_url( add_query_arg( 'paged', min( $total_pages, $current + 1 ), $current_url ) ),
+ __( 'Next page' ),
+ '&rsaquo;'
+ );
+ }
+
+ if ( $disable_last ) {
+ $page_links[] = '<span class="tablenav-pages-navspan button disabled" aria-hidden="true">&raquo;</span>';
+ } else {
+ $page_links[] = sprintf(
+ "<a class='last-page button' href='%s'><span class='screen-reader-text'>%s</span><span aria-hidden='true'>%s</span></a>",
+ esc_url( add_query_arg( 'paged', $total_pages, $current_url ) ),
+ __( 'Last page' ),
+ '&raquo;'
+ );
+ }
+
+ $pagination_links_class = 'pagination-links';
+ if ( ! empty( $infinite_scroll ) ) {
+ $pagination_links_class .= ' hide-if-js';
+ }
+ $output .= "\n<span class='$pagination_links_class'>" . join( "\n", $page_links ) . '</span>';
+
+ if ( $total_pages ) {
+ $page_class = $total_pages < 2 ? ' one-page' : '';
+ } else {
+ $page_class = ' no-pages';
+ }
+ $this->_pagination = "<div class='tablenav-pages{$page_class}'>$output</div>";
+
+ echo $this->_pagination;
+ }
+
+ /**
+ * Get a list of columns. The format is:
+ * 'internal-name' => 'Title'
+ *
+ * @since 3.1.0
+ * @abstract
+ *
+ * @return array
+ */
+ public function get_columns() {
+ die( 'function WP_List_Table::get_columns() must be over-ridden in a sub-class.' );
+ }
+
+ /**
+ * Get a list of sortable columns. The format is:
+ * 'internal-name' => 'orderby'
+ * or
+ * 'internal-name' => array( 'orderby', true )
+ *
+ * The second format will make the initial sorting order be descending
+ *
+ * @since 3.1.0
+ *
+ * @return array
+ */
+ protected function get_sortable_columns() {
+ return array();
+ }
+
+ /**
+ * Gets the name of the default primary column.
+ *
+ * @since 4.3.0
+ *
+ * @return string Name of the default primary column, in this case, an empty string.
+ */
+ protected function get_default_primary_column_name() {
+ $columns = $this->get_columns();
+ $column = '';
+
+ if ( empty( $columns ) ) {
+ return $column;
+ }
+
+ // We need a primary defined so responsive views show something,
+ // so let's fall back to the first non-checkbox column.
+ foreach ( $columns as $col => $column_name ) {
+ if ( 'cb' === $col ) {
+ continue;
+ }
+
+ $column = $col;
+ break;
+ }
+
+ return $column;
+ }
+
+ /**
+ * Public wrapper for WP_List_Table::get_default_primary_column_name().
+ *
+ * @since 4.4.0
+ *
+ * @return string Name of the default primary column.
+ */
+ public function get_primary_column() {
+ return $this->get_primary_column_name();
+ }
+
+ /**
+ * Gets the name of the primary column.
+ *
+ * @since 4.3.0
+ *
+ * @return string The name of the primary column.
+ */
+ protected function get_primary_column_name() {
+ $columns = get_column_headers( $this->screen );
+ $default = $this->get_default_primary_column_name();
+
+ // If the primary column doesn't exist fall back to the
+ // first non-checkbox column.
+ if ( ! isset( $columns[ $default ] ) ) {
+ $default = WP_List_Table::get_default_primary_column_name();
+ }
+
+ /**
+ * Filters the name of the primary column for the current list table.
+ *
+ * @since 4.3.0
+ *
+ * @param string $default Column name default for the specific list table, e.g. 'name'.
+ * @param string $context Screen ID for specific list table, e.g. 'plugins'.
+ */
+ $column = apply_filters( 'list_table_primary_column', $default, $this->screen->id );
+
+ if ( empty( $column ) || ! isset( $columns[ $column ] ) ) {
+ $column = $default;
+ }
+
+ return $column;
+ }
+
+ /**
+ * Get a list of all, hidden and sortable columns, with filter applied
+ *
+ * @since 3.1.0
+ *
+ * @return array
+ */
+ protected function get_column_info() {
+ // $_column_headers is already set / cached
+ if ( isset( $this->_column_headers ) && is_array( $this->_column_headers ) ) {
+ // Back-compat for list tables that have been manually setting $_column_headers for horse reasons.
+ // In 4.3, we added a fourth argument for primary column.
+ $column_headers = array( array(), array(), array(), $this->get_primary_column_name() );
+ foreach ( $this->_column_headers as $key => $value ) {
+ $column_headers[ $key ] = $value;
+ }
+
+ return $column_headers;
+ }
+
+ $columns = get_column_headers( $this->screen );
+ $hidden = get_hidden_columns( $this->screen );
+
+ $sortable_columns = $this->get_sortable_columns();
+ /**
+ * Filters the list table sortable columns for a specific screen.
+ *
+ * The dynamic portion of the hook name, `$this->screen->id`, refers
+ * to the ID of the current screen, usually a string.
+ *
+ * @since 3.5.0
+ *
+ * @param array $sortable_columns An array of sortable columns.
+ */
+ $_sortable = apply_filters( "manage_{$this->screen->id}_sortable_columns", $sortable_columns );
+
+ $sortable = array();
+ foreach ( $_sortable as $id => $data ) {
+ if ( empty( $data ) ) {
+ continue;
+ }
+
+ $data = (array) $data;
+ if ( ! isset( $data[1] ) ) {
+ $data[1] = false;
+ }
+
+ $sortable[ $id ] = $data;
+ }
+
+ $primary = $this->get_primary_column_name();
+ $this->_column_headers = array( $columns, $hidden, $sortable, $primary );
+
+ return $this->_column_headers;
+ }
+
+ /**
+ * Return number of visible columns
+ *
+ * @since 3.1.0
+ *
+ * @return int
+ */
+ public function get_column_count() {
+ list ( $columns, $hidden ) = $this->get_column_info();
+ $hidden = array_intersect( array_keys( $columns ), array_filter( $hidden ) );
+ return count( $columns ) - count( $hidden );
+ }
+
+ /**
+ * Print column headers, accounting for hidden and sortable columns.
+ *
+ * @since 3.1.0
+ *
+ * @staticvar int $cb_counter
+ *
+ * @param bool $with_id Whether to set the id attribute or not
+ */
+ public function print_column_headers( $with_id = true ) {
+ list( $columns, $hidden, $sortable, $primary ) = $this->get_column_info();
+
+ $current_url = set_url_scheme( 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] );
+ $current_url = remove_query_arg( 'paged', $current_url );
+
+ if ( isset( $_GET['orderby'] ) ) {
+ $current_orderby = $_GET['orderby'];
+ } else {
+ $current_orderby = '';
+ }
+
+ if ( isset( $_GET['order'] ) && 'desc' === $_GET['order'] ) {
+ $current_order = 'desc';
+ } else {
+ $current_order = 'asc';
+ }
+
+ if ( ! empty( $columns['cb'] ) ) {
+ static $cb_counter = 1;
+ $columns['cb'] = '<label class="screen-reader-text" for="cb-select-all-' . $cb_counter . '">' . __( 'Select All' ) . '</label>'
+ . '<input id="cb-select-all-' . $cb_counter . '" type="checkbox" />';
+ $cb_counter++;
+ }
+
+ foreach ( $columns as $column_key => $column_display_name ) {
+ $class = array( 'manage-column', "column-$column_key" );
+
+ if ( in_array( $column_key, $hidden ) ) {
+ $class[] = 'hidden';
+ }
+
+ if ( 'cb' === $column_key ) {
+ $class[] = 'check-column';
+ } elseif ( in_array( $column_key, array( 'posts', 'comments', 'links' ) ) ) {
+ $class[] = 'num';
+ }
+
+ if ( $column_key === $primary ) {
+ $class[] = 'column-primary';
+ }
+
+ if ( isset( $sortable[ $column_key ] ) ) {
+ list( $orderby, $desc_first ) = $sortable[ $column_key ];
+
+ if ( $current_orderby === $orderby ) {
+ $order = 'asc' === $current_order ? 'desc' : 'asc';
+ $class[] = 'sorted';
+ $class[] = $current_order;
+ } else {
+ $order = $desc_first ? 'desc' : 'asc';
+ $class[] = 'sortable';
+ $class[] = $desc_first ? 'asc' : 'desc';
+ }
+
+ $column_display_name = '<a href="' . esc_url( add_query_arg( compact( 'orderby', 'order' ), $current_url ) ) . '"><span>' . $column_display_name . '</span><span class="sorting-indicator"></span></a>';
+ }
+
+ $tag = ( 'cb' === $column_key ) ? 'td' : 'th';
+ $scope = ( 'th' === $tag ) ? 'scope="col"' : '';
+ $id = $with_id ? "id='$column_key'" : '';
+
+ if ( ! empty( $class ) ) {
+ $class = "class='" . join( ' ', $class ) . "'";
+ }
+
+ echo "<$tag $scope $id $class>$column_display_name</$tag>";
+ }
+ }
+
+ /**
+ * Display the table
+ *
+ * @since 3.1.0
+ */
+ public function display() {
+ $singular = $this->_args['singular'];
+
+ $this->display_tablenav( 'top' );
+
+ $this->screen->render_screen_reader_content( 'heading_list' );
+ ?>
+<table class="wp-list-table <?php echo implode( ' ', $this->get_table_classes() ); ?>">
+ <thead>
+ <tr>
+ <?php $this->print_column_headers(); ?>
+ </tr>
+ </thead>
+
+ <tbody id="the-list"
+ <?php
+ if ( $singular ) {
+ echo " data-wp-lists='list:$singular'";
+ }
+ ?>
+ >
+ <?php $this->display_rows_or_placeholder(); ?>
+ </tbody>
+
+ <tfoot>
+ <tr>
+ <?php $this->print_column_headers( false ); ?>
+ </tr>
+ </tfoot>
+
+</table>
+ <?php
+ $this->display_tablenav( 'bottom' );
+ }
+
+ /**
+ * Get a list of CSS classes for the WP_List_Table table tag.
+ *
+ * @since 3.1.0
+ *
+ * @return array List of CSS classes for the table tag.
+ */
+ protected function get_table_classes() {
+ return array( 'widefat', 'fixed', 'striped', $this->_args['plural'] );
+ }
+
+ /**
+ * Generate the table navigation above or below the table
+ *
+ * @since 3.1.0
+ * @param string $which
+ */
+ protected function display_tablenav( $which ) {
+ if ( 'top' === $which ) {
+ wp_nonce_field( 'bulk-' . $this->_args['plural'] );
+ }
+ ?>
+ <div class="tablenav <?php echo esc_attr( $which ); ?>">
+
+ <?php if ( $this->has_items() ) : ?>
+ <div class="alignleft actions bulkactions">
+ <?php $this->bulk_actions( $which ); ?>
+ </div>
+ <?php
+ endif;
+ $this->extra_tablenav( $which );
+ $this->pagination( $which );
+ ?>
+
+ <br class="clear" />
+ </div>
+ <?php
+ }
+
+ /**
+ * Extra controls to be displayed between bulk actions and pagination
+ *
+ * @since 3.1.0
+ *
+ * @param string $which
+ */
+ protected function extra_tablenav( $which ) {}
+
+ /**
+ * Generate the tbody element for the list table.
+ *
+ * @since 3.1.0
+ */
+ public function display_rows_or_placeholder() {
+ if ( $this->has_items() ) {
+ $this->display_rows();
+ } else {
+ echo '<tr class="no-items"><td class="colspanchange" colspan="' . $this->get_column_count() . '">';
+ $this->no_items();
+ echo '</td></tr>';
+ }
+ }
+
+ /**
+ * Generate the table rows
+ *
+ * @since 3.1.0
+ */
+ public function display_rows() {
+ foreach ( $this->items as $item ) {
+ $this->single_row( $item );
+ }
+ }
+
+ /**
+ * Generates content for a single row of the table
+ *
+ * @since 3.1.0
+ *
+ * @param object $item The current item
+ */
+ public function single_row( $item ) {
+ echo '<tr>';
+ $this->single_row_columns( $item );
+ echo '</tr>';
+ }
+
+ /**
+ * @param object $item
+ * @param string $column_name
+ */
+ protected function column_default( $item, $column_name ) {}
+
+ /**
+ * @param object $item
+ */
+ protected function column_cb( $item ) {}
+
+ /**
+ * Generates the columns for a single row of the table
+ *
+ * @since 3.1.0
+ *
+ * @param object $item The current item
+ */
+ protected function single_row_columns( $item ) {
+ list( $columns, $hidden, $sortable, $primary ) = $this->get_column_info();
+
+ foreach ( $columns as $column_name => $column_display_name ) {
+ $classes = "$column_name column-$column_name";
+ if ( $primary === $column_name ) {
+ $classes .= ' has-row-actions column-primary';
+ }
+
+ if ( in_array( $column_name, $hidden ) ) {
+ $classes .= ' hidden';
+ }
+
+ // Comments column uses HTML in the display name with screen reader text.
+ // Instead of using esc_attr(), we strip tags to get closer to a user-friendly string.
+ $data = 'data-colname="' . wp_strip_all_tags( $column_display_name ) . '"';
+
+ $attributes = "class='$classes' $data";
+
+ if ( 'cb' === $column_name ) {
+ echo '<th scope="row" class="check-column">';
+ echo $this->column_cb( $item );
+ echo '</th>';
+ } elseif ( method_exists( $this, '_column_' . $column_name ) ) {
+ echo call_user_func(
+ array( $this, '_column_' . $column_name ),
+ $item,
+ $classes,
+ $data,
+ $primary
+ );
+ } elseif ( method_exists( $this, 'column_' . $column_name ) ) {
+ echo "<td $attributes>";
+ echo call_user_func( array( $this, 'column_' . $column_name ), $item );
+ echo $this->handle_row_actions( $item, $column_name, $primary );
+ echo '</td>';
+ } else {
+ echo "<td $attributes>";
+ echo $this->column_default( $item, $column_name );
+ echo $this->handle_row_actions( $item, $column_name, $primary );
+ echo '</td>';
+ }
+ }
+ }
+
+ /**
+ * Generates and display row actions links for the list table.
+ *
+ * @since 4.3.0
+ *
+ * @param object $item The item being acted upon.
+ * @param string $column_name Current column name.
+ * @param string $primary Primary column name.
+ * @return string The row actions HTML, or an empty string if the current column is the primary column.
+ */
+ protected function handle_row_actions( $item, $column_name, $primary ) {
+ return $column_name === $primary ? '<button type="button" class="toggle-row"><span class="screen-reader-text">' . __( 'Show more details' ) . '</span></button>' : '';
+ }
+
+ /**
+ * Handle an incoming ajax request (called from admin-ajax.php)
+ *
+ * @since 3.1.0
+ */
+ public function ajax_response() {
+ $this->prepare_items();
+
+ ob_start();
+ if ( ! empty( $_REQUEST['no_placeholder'] ) ) {
+ $this->display_rows();
+ } else {
+ $this->display_rows_or_placeholder();
+ }
+
+ $rows = ob_get_clean();
+
+ $response = array( 'rows' => $rows );
+
+ if ( isset( $this->_pagination_args['total_items'] ) ) {
+ $response['total_items_i18n'] = sprintf(
+ _n( '%s item', '%s items', $this->_pagination_args['total_items'] ),
+ number_format_i18n( $this->_pagination_args['total_items'] )
+ );
+ }
+ if ( isset( $this->_pagination_args['total_pages'] ) ) {
+ $response['total_pages'] = $this->_pagination_args['total_pages'];
+ $response['total_pages_i18n'] = number_format_i18n( $this->_pagination_args['total_pages'] );
+ }
+
+ die( wp_json_encode( $response ) );
+ }
+
+ /**
+ * Send required variables to JavaScript land
+ */
+ public function _js_vars() {
+ $args = array(
+ 'class' => get_class( $this ),
+ 'screen' => array(
+ 'id' => $this->screen->id,
+ 'base' => $this->screen->base,
+ ),
+ );
+
+ printf( "<script type='text/javascript'>list_args = %s;</script>\n", wp_json_encode( $args ) );
+ }
+}
diff --git a/www/crm/wp-admin/includes/class-wp-media-list-table.php b/www/crm/wp-admin/includes/class-wp-media-list-table.php
new file mode 100644
index 00000000..1a9970d9
--- /dev/null
+++ b/www/crm/wp-admin/includes/class-wp-media-list-table.php
@@ -0,0 +1,794 @@
+<?php
+/**
+ * List Table API: WP_Media_List_Table class
+ *
+ * @package WordPress
+ * @subpackage Administration
+ * @since 3.1.0
+ */
+
+/**
+ * Core class used to implement displaying media items in a list table.
+ *
+ * @since 3.1.0
+ * @access private
+ *
+ * @see WP_List_Table
+ */
+class WP_Media_List_Table extends WP_List_Table {
+ /**
+ * Holds the number of pending comments for each post.
+ *
+ * @since 4.4.0
+ * @var array
+ */
+ protected $comment_pending_count = array();
+
+ private $detached;
+
+ private $is_trash;
+
+ /**
+ * Constructor.
+ *
+ * @since 3.1.0
+ *
+ * @see WP_List_Table::__construct() for more information on default arguments.
+ *
+ * @param array $args An associative array of arguments.
+ */
+ public function __construct( $args = array() ) {
+ $this->detached = ( isset( $_REQUEST['attachment-filter'] ) && 'detached' === $_REQUEST['attachment-filter'] );
+
+ $this->modes = array(
+ 'list' => __( 'List View' ),
+ 'grid' => __( 'Grid View' ),
+ );
+
+ parent::__construct(
+ array(
+ 'plural' => 'media',
+ 'screen' => isset( $args['screen'] ) ? $args['screen'] : null,
+ )
+ );
+ }
+
+ /**
+ * @return bool
+ */
+ public function ajax_user_can() {
+ return current_user_can( 'upload_files' );
+ }
+
+ /**
+ * @global WP_Query $wp_query
+ * @global array $post_mime_types
+ * @global array $avail_post_mime_types
+ * @global string $mode
+ */
+ public function prepare_items() {
+ global $wp_query, $post_mime_types, $avail_post_mime_types, $mode;
+
+ list( $post_mime_types, $avail_post_mime_types ) = wp_edit_attachments_query( $_REQUEST );
+
+ $this->is_trash = isset( $_REQUEST['attachment-filter'] ) && 'trash' === $_REQUEST['attachment-filter'];
+
+ $mode = empty( $_REQUEST['mode'] ) ? 'list' : $_REQUEST['mode'];
+
+ $this->set_pagination_args(
+ array(
+ 'total_items' => $wp_query->found_posts,
+ 'total_pages' => $wp_query->max_num_pages,
+ 'per_page' => $wp_query->query_vars['posts_per_page'],
+ )
+ );
+ }
+
+ /**
+ * @global array $post_mime_types
+ * @global array $avail_post_mime_types
+ * @return array
+ */
+ protected function get_views() {
+ global $post_mime_types, $avail_post_mime_types;
+
+ $type_links = array();
+
+ $filter = empty( $_GET['attachment-filter'] ) ? '' : $_GET['attachment-filter'];
+
+ $type_links['all'] = sprintf(
+ '<option value=""%s>%s</option>',
+ selected( $filter, true, false ),
+ __( 'All media items' )
+ );
+
+ foreach ( $post_mime_types as $mime_type => $label ) {
+ if ( ! wp_match_mime_types( $mime_type, $avail_post_mime_types ) ) {
+ continue;
+ }
+
+ $selected = selected(
+ $filter && 0 === strpos( $filter, 'post_mime_type:' ) &&
+ wp_match_mime_types( $mime_type, str_replace( 'post_mime_type:', '', $filter ) ),
+ true,
+ false
+ );
+
+ $type_links[ $mime_type ] = sprintf(
+ '<option value="post_mime_type:%s"%s>%s</option>',
+ esc_attr( $mime_type ),
+ $selected,
+ $label[0]
+ );
+ }
+
+ $type_links['detached'] = '<option value="detached"' . ( $this->detached ? ' selected="selected"' : '' ) . '>' . __( 'Unattached' ) . '</option>';
+
+ $type_links['mine'] = sprintf(
+ '<option value="mine"%s>%s</option>',
+ selected( 'mine' === $filter, true, false ),
+ _x( 'Mine', 'media items' )
+ );
+
+ if ( $this->is_trash || ( defined( 'MEDIA_TRASH' ) && MEDIA_TRASH ) ) {
+ $type_links['trash'] = sprintf(
+ '<option value="trash"%s>%s</option>',
+ selected( 'trash' === $filter, true, false ),
+ _x( 'Trash', 'attachment filter' )
+ );
+ }
+
+ return $type_links;
+ }
+
+ /**
+ * @return array
+ */
+ protected function get_bulk_actions() {
+ $actions = array();
+ if ( MEDIA_TRASH ) {
+ if ( $this->is_trash ) {
+ $actions['untrash'] = __( 'Restore' );
+ $actions['delete'] = __( 'Delete Permanently' );
+ } else {
+ $actions['trash'] = __( 'Move to Trash' );
+ }
+ } else {
+ $actions['delete'] = __( 'Delete Permanently' );
+ }
+
+ if ( $this->detached ) {
+ $actions['attach'] = __( 'Attach' );
+ }
+
+ return $actions;
+ }
+
+ /**
+ * @param string $which
+ */
+ protected function extra_tablenav( $which ) {
+ if ( 'bar' !== $which ) {
+ return;
+ }
+ ?>
+ <div class="actions">
+ <?php
+ if ( ! is_singular() ) {
+ if ( ! $this->is_trash ) {
+ $this->months_dropdown( 'attachment' );
+ }
+
+ /** This action is documented in wp-admin/includes/class-wp-posts-list-table.php */
+ do_action( 'restrict_manage_posts', $this->screen->post_type, $which );
+
+ submit_button( __( 'Filter' ), '', 'filter_action', false, array( 'id' => 'post-query-submit' ) );
+ }
+
+ if ( $this->is_trash && current_user_can( 'edit_others_posts' ) && $this->has_items() ) {
+ submit_button( __( 'Empty Trash' ), 'apply', 'delete_all', false );
+ }
+ ?>
+ </div>
+ <?php
+ }
+
+ /**
+ * @return string
+ */
+ public function current_action() {
+ if ( isset( $_REQUEST['found_post_id'] ) && isset( $_REQUEST['media'] ) ) {
+ return 'attach';
+ }
+
+ if ( isset( $_REQUEST['parent_post_id'] ) && isset( $_REQUEST['media'] ) ) {
+ return 'detach';
+ }
+
+ if ( isset( $_REQUEST['delete_all'] ) || isset( $_REQUEST['delete_all2'] ) ) {
+ return 'delete_all';
+ }
+
+ return parent::current_action();
+ }
+
+ /**
+ * @return bool
+ */
+ public function has_items() {
+ return have_posts();
+ }
+
+ /**
+ */
+ public function no_items() {
+ _e( 'No media files found.' );
+ }
+
+ /**
+ * Override parent views so we can use the filter bar display.
+ *
+ * @global string $mode List table view mode.
+ */
+ public function views() {
+ global $mode;
+
+ $views = $this->get_views();
+
+ $this->screen->render_screen_reader_content( 'heading_views' );
+ ?>
+<div class="wp-filter">
+ <div class="filter-items">
+ <?php $this->view_switcher( $mode ); ?>
+
+ <label for="attachment-filter" class="screen-reader-text"><?php _e( 'Filter by type' ); ?></label>
+ <select class="attachment-filters" name="attachment-filter" id="attachment-filter">
+ <?php
+ if ( ! empty( $views ) ) {
+ foreach ( $views as $class => $view ) {
+ echo "\t$view\n";
+ }
+ }
+ ?>
+ </select>
+
+ <?php
+ $this->extra_tablenav( 'bar' );
+
+ /** This filter is documented in wp-admin/inclues/class-wp-list-table.php */
+ $views = apply_filters( "views_{$this->screen->id}", array() );
+
+ // Back compat for pre-4.0 view links.
+ if ( ! empty( $views ) ) {
+ echo '<ul class="filter-links">';
+ foreach ( $views as $class => $view ) {
+ echo "<li class='$class'>$view</li>";
+ }
+ echo '</ul>';
+ }
+ ?>
+ </div>
+
+ <div class="search-form">
+ <label for="media-search-input" class="screen-reader-text"><?php esc_html_e( 'Search Media' ); ?></label>
+ <input type="search" placeholder="<?php esc_attr_e( 'Search media items...' ); ?>" id="media-search-input" class="search" name="s" value="<?php _admin_search_query(); ?>"></div>
+ </div>
+ <?php
+ }
+
+ /**
+ * @return array
+ */
+ public function get_columns() {
+ $posts_columns = array();
+ $posts_columns['cb'] = '<input type="checkbox" />';
+ /* translators: column name */
+ $posts_columns['title'] = _x( 'File', 'column name' );
+ $posts_columns['author'] = __( 'Author' );
+
+ $taxonomies = get_taxonomies_for_attachments( 'objects' );
+ $taxonomies = wp_filter_object_list( $taxonomies, array( 'show_admin_column' => true ), 'and', 'name' );
+
+ /**
+ * Filters the taxonomy columns for attachments in the Media list table.
+ *
+ * @since 3.5.0
+ *
+ * @param string[] $taxonomies An array of registered taxonomy names to show for attachments.
+ * @param string $post_type The post type. Default 'attachment'.
+ */
+ $taxonomies = apply_filters( 'manage_taxonomies_for_attachment_columns', $taxonomies, 'attachment' );
+ $taxonomies = array_filter( $taxonomies, 'taxonomy_exists' );
+
+ foreach ( $taxonomies as $taxonomy ) {
+ if ( 'category' === $taxonomy ) {
+ $column_key = 'categories';
+ } elseif ( 'post_tag' === $taxonomy ) {
+ $column_key = 'tags';
+ } else {
+ $column_key = 'taxonomy-' . $taxonomy;
+ }
+ $posts_columns[ $column_key ] = get_taxonomy( $taxonomy )->labels->name;
+ }
+
+ /* translators: column name */
+ if ( ! $this->detached ) {
+ $posts_columns['parent'] = _x( 'Uploaded to', 'column name' );
+ if ( post_type_supports( 'attachment', 'comments' ) ) {
+ $posts_columns['comments'] = '<span class="vers comment-grey-bubble" title="' . esc_attr__( 'Comments' ) . '"><span class="screen-reader-text">' . __( 'Comments' ) . '</span></span>';
+ }
+ }
+ /* translators: column name */
+ $posts_columns['date'] = _x( 'Date', 'column name' );
+ /**
+ * Filters the Media list table columns.
+ *
+ * @since 2.5.0
+ *
+ * @param string[] $posts_columns An array of columns displayed in the Media list table.
+ * @param bool $detached Whether the list table contains media not attached
+ * to any posts. Default true.
+ */
+ return apply_filters( 'manage_media_columns', $posts_columns, $this->detached );
+ }
+
+ /**
+ * @return array
+ */
+ protected function get_sortable_columns() {
+ return array(
+ 'title' => 'title',
+ 'author' => 'author',
+ 'parent' => 'parent',
+ 'comments' => 'comment_count',
+ 'date' => array( 'date', true ),
+ );
+ }
+
+ /**
+ * Handles the checkbox column output.
+ *
+ * @since 4.3.0
+ *
+ * @param WP_Post $post The current WP_Post object.
+ */
+ public function column_cb( $post ) {
+ if ( current_user_can( 'edit_post', $post->ID ) ) {
+ ?>
+ <label class="screen-reader-text" for="cb-select-<?php echo $post->ID; ?>">
+ <?php
+ echo sprintf( __( 'Select %s' ), _draft_or_post_title() );
+ ?>
+ </label>
+ <input type="checkbox" name="media[]" id="cb-select-<?php echo $post->ID; ?>" value="<?php echo $post->ID; ?>" />
+ <?php
+ }
+ }
+
+ /**
+ * Handles the title column output.
+ *
+ * @since 4.3.0
+ *
+ * @param WP_Post $post The current WP_Post object.
+ */
+ public function column_title( $post ) {
+ list( $mime ) = explode( '/', $post->post_mime_type );
+
+ $title = _draft_or_post_title();
+ $thumb = wp_get_attachment_image( $post->ID, array( 60, 60 ), true, array( 'alt' => '' ) );
+ $link_start = $link_end = '';
+
+ if ( current_user_can( 'edit_post', $post->ID ) && ! $this->is_trash ) {
+ $link_start = sprintf(
+ '<a href="%s" aria-label="%s">',
+ get_edit_post_link( $post->ID ),
+ /* translators: %s: attachment title */
+ esc_attr( sprintf( __( '&#8220;%s&#8221; (Edit)' ), $title ) )
+ );
+ $link_end = '</a>';
+ }
+
+ $class = $thumb ? ' class="has-media-icon"' : '';
+ ?>
+ <strong<?php echo $class; ?>>
+ <?php
+ echo $link_start;
+ if ( $thumb ) :
+ ?>
+ <span class="media-icon <?php echo sanitize_html_class( $mime . '-icon' ); ?>"><?php echo $thumb; ?></span>
+ <?php
+ endif;
+ echo $title . $link_end;
+ _media_states( $post );
+ ?>
+ </strong>
+ <p class="filename">
+ <span class="screen-reader-text"><?php _e( 'File name:' ); ?> </span>
+ <?php
+ $file = get_attached_file( $post->ID );
+ echo esc_html( wp_basename( $file ) );
+ ?>
+ </p>
+ <?php
+ }
+
+ /**
+ * Handles the author column output.
+ *
+ * @since 4.3.0
+ *
+ * @param WP_Post $post The current WP_Post object.
+ */
+ public function column_author( $post ) {
+ printf(
+ '<a href="%s">%s</a>',
+ esc_url( add_query_arg( array( 'author' => get_the_author_meta( 'ID' ) ), 'upload.php' ) ),
+ get_the_author()
+ );
+ }
+
+ /**
+ * Handles the description column output.
+ *
+ * @since 4.3.0
+ *
+ * @param WP_Post $post The current WP_Post object.
+ */
+ public function column_desc( $post ) {
+ echo has_excerpt() ? $post->post_excerpt : '';
+ }
+
+ /**
+ * Handles the date column output.
+ *
+ * @since 4.3.0
+ *
+ * @param WP_Post $post The current WP_Post object.
+ */
+ public function column_date( $post ) {
+ if ( '0000-00-00 00:00:00' === $post->post_date ) {
+ $h_time = __( 'Unpublished' );
+ } else {
+ $m_time = $post->post_date;
+ $time = get_post_time( 'G', true, $post, false );
+ if ( ( abs( $t_diff = time() - $time ) ) < DAY_IN_SECONDS ) {
+ if ( $t_diff < 0 ) {
+ $h_time = sprintf( __( '%s from now' ), human_time_diff( $time ) );
+ } else {
+ $h_time = sprintf( __( '%s ago' ), human_time_diff( $time ) );
+ }
+ } else {
+ $h_time = mysql2date( __( 'Y/m/d' ), $m_time );
+ }
+ }
+
+ echo $h_time;
+ }
+
+ /**
+ * Handles the parent column output.
+ *
+ * @since 4.3.0
+ *
+ * @param WP_Post $post The current WP_Post object.
+ */
+ public function column_parent( $post ) {
+ $user_can_edit = current_user_can( 'edit_post', $post->ID );
+
+ if ( $post->post_parent > 0 ) {
+ $parent = get_post( $post->post_parent );
+ } else {
+ $parent = false;
+ }
+
+ if ( $parent ) {
+ $title = _draft_or_post_title( $post->post_parent );
+ $parent_type = get_post_type_object( $parent->post_type );
+
+ if ( $parent_type && $parent_type->show_ui && current_user_can( 'edit_post', $post->post_parent ) ) {
+ ?>
+ <strong><a href="<?php echo get_edit_post_link( $post->post_parent ); ?>">
+ <?php echo $title; ?></a></strong>
+ <?php
+ } elseif ( $parent_type && current_user_can( 'read_post', $post->post_parent ) ) {
+ ?>
+ <strong><?php echo $title; ?></strong>
+ <?php
+ } else {
+ _e( '(Private post)' );
+ }
+
+ if ( $user_can_edit ) :
+ $detach_url = add_query_arg(
+ array(
+ 'parent_post_id' => $post->post_parent,
+ 'media[]' => $post->ID,
+ '_wpnonce' => wp_create_nonce( 'bulk-' . $this->_args['plural'] ),
+ ),
+ 'upload.php'
+ );
+ printf(
+ '<br /><a href="%s" class="hide-if-no-js detach-from-parent" aria-label="%s">%s</a>',
+ $detach_url,
+ /* translators: %s: title of the post the attachment is attached to */
+ esc_attr( sprintf( __( 'Detach from &#8220;%s&#8221;' ), $title ) ),
+ __( 'Detach' )
+ );
+ endif;
+ } else {
+ _e( '(Unattached)' );
+ ?>
+ <?php
+ if ( $user_can_edit ) {
+ $title = _draft_or_post_title( $post->post_parent );
+ printf(
+ '<br /><a href="#the-list" onclick="findPosts.open( \'media[]\', \'%s\' ); return false;" class="hide-if-no-js aria-button-if-js" aria-label="%s">%s</a>',
+ $post->ID,
+ /* translators: %s: attachment title */
+ esc_attr( sprintf( __( 'Attach &#8220;%s&#8221; to existing content' ), $title ) ),
+ __( 'Attach' )
+ );
+ }
+ }
+ }
+
+ /**
+ * Handles the comments column output.
+ *
+ * @since 4.3.0
+ *
+ * @param WP_Post $post The current WP_Post object.
+ */
+ public function column_comments( $post ) {
+ echo '<div class="post-com-count-wrapper">';
+
+ if ( isset( $this->comment_pending_count[ $post->ID ] ) ) {
+ $pending_comments = $this->comment_pending_count[ $post->ID ];
+ } else {
+ $pending_comments = get_pending_comments_num( $post->ID );
+ }
+
+ $this->comments_bubble( $post->ID, $pending_comments );
+
+ echo '</div>';
+ }
+
+ /**
+ * Handles output for the default column.
+ *
+ * @since 4.3.0
+ *
+ * @param WP_Post $post The current WP_Post object.
+ * @param string $column_name Current column name.
+ */
+ public function column_default( $post, $column_name ) {
+ if ( 'categories' === $column_name ) {
+ $taxonomy = 'category';
+ } elseif ( 'tags' === $column_name ) {
+ $taxonomy = 'post_tag';
+ } elseif ( 0 === strpos( $column_name, 'taxonomy-' ) ) {
+ $taxonomy = substr( $column_name, 9 );
+ } else {
+ $taxonomy = false;
+ }
+
+ if ( $taxonomy ) {
+ $terms = get_the_terms( $post->ID, $taxonomy );
+ if ( is_array( $terms ) ) {
+ $out = array();
+ foreach ( $terms as $t ) {
+ $posts_in_term_qv = array();
+ $posts_in_term_qv['taxonomy'] = $taxonomy;
+ $posts_in_term_qv['term'] = $t->slug;
+
+ $out[] = sprintf(
+ '<a href="%s">%s</a>',
+ esc_url( add_query_arg( $posts_in_term_qv, 'upload.php' ) ),
+ esc_html( sanitize_term_field( 'name', $t->name, $t->term_id, $taxonomy, 'display' ) )
+ );
+ }
+ /* translators: used between list items, there is a space after the comma */
+ echo join( __( ', ' ), $out );
+ } else {
+ echo '<span aria-hidden="true">&#8212;</span><span class="screen-reader-text">' . get_taxonomy( $taxonomy )->labels->no_terms . '</span>';
+ }
+
+ return;
+ }
+
+ /**
+ * Fires for each custom column in the Media list table.
+ *
+ * Custom columns are registered using the {@see 'manage_media_columns'} filter.
+ *
+ * @since 2.5.0
+ *
+ * @param string $column_name Name of the custom column.
+ * @param int $post_id Attachment ID.
+ */
+ do_action( 'manage_media_custom_column', $column_name, $post->ID );
+ }
+
+ /**
+ * @global WP_Post $post
+ */
+ public function display_rows() {
+ global $post, $wp_query;
+
+ $post_ids = wp_list_pluck( $wp_query->posts, 'ID' );
+ reset( $wp_query->posts );
+
+ $this->comment_pending_count = get_pending_comments_num( $post_ids );
+
+ add_filter( 'the_title', 'esc_html' );
+
+ while ( have_posts() ) :
+ the_post();
+ if (
+ ( $this->is_trash && $post->post_status != 'trash' )
+ || ( ! $this->is_trash && $post->post_status === 'trash' )
+ ) {
+ continue;
+ }
+ $post_owner = ( get_current_user_id() == $post->post_author ) ? 'self' : 'other';
+ ?>
+ <tr id="post-<?php echo $post->ID; ?>" class="<?php echo trim( ' author-' . $post_owner . ' status-' . $post->post_status ); ?>">
+ <?php $this->single_row_columns( $post ); ?>
+ </tr>
+ <?php
+ endwhile;
+ }
+
+ /**
+ * Gets the name of the default primary column.
+ *
+ * @since 4.3.0
+ *
+ * @return string Name of the default primary column, in this case, 'title'.
+ */
+ protected function get_default_primary_column_name() {
+ return 'title';
+ }
+
+ /**
+ * @param WP_Post $post
+ * @param string $att_title
+ *
+ * @return array
+ */
+ private function _get_row_actions( $post, $att_title ) {
+ $actions = array();
+
+ if ( $this->detached ) {
+ if ( current_user_can( 'edit_post', $post->ID ) ) {
+ $actions['edit'] = sprintf(
+ '<a href="%s" aria-label="%s">%s</a>',
+ get_edit_post_link( $post->ID ),
+ /* translators: %s: attachment title */
+ esc_attr( sprintf( __( 'Edit &#8220;%s&#8221;' ), $att_title ) ),
+ __( 'Edit' )
+ );
+ }
+ if ( current_user_can( 'delete_post', $post->ID ) ) {
+ if ( EMPTY_TRASH_DAYS && MEDIA_TRASH ) {
+ $actions['trash'] = sprintf(
+ '<a href="%s" class="submitdelete aria-button-if-js" aria-label="%s">%s</a>',
+ wp_nonce_url( "post.php?action=trash&amp;post=$post->ID", 'trash-post_' . $post->ID ),
+ /* translators: %s: attachment title */
+ esc_attr( sprintf( __( 'Move &#8220;%s&#8221; to the Trash' ), $att_title ) ),
+ _x( 'Trash', 'verb' )
+ );
+ } else {
+ $delete_ays = ! MEDIA_TRASH ? " onclick='return showNotice.warn();'" : '';
+ $actions['delete'] = sprintf(
+ '<a href="%s" class="submitdelete aria-button-if-js"%s aria-label="%s">%s</a>',
+ wp_nonce_url( "post.php?action=delete&amp;post=$post->ID", 'delete-post_' . $post->ID ),
+ $delete_ays,
+ /* translators: %s: attachment title */
+ esc_attr( sprintf( __( 'Delete &#8220;%s&#8221; permanently' ), $att_title ) ),
+ __( 'Delete Permanently' )
+ );
+ }
+ }
+ $actions['view'] = sprintf(
+ '<a href="%s" aria-label="%s" rel="bookmark">%s</a>',
+ get_permalink( $post->ID ),
+ /* translators: %s: attachment title */
+ esc_attr( sprintf( __( 'View &#8220;%s&#8221;' ), $att_title ) ),
+ __( 'View' )
+ );
+
+ if ( current_user_can( 'edit_post', $post->ID ) ) {
+ $actions['attach'] = sprintf(
+ '<a href="#the-list" onclick="findPosts.open( \'media[]\', \'%s\' ); return false;" class="hide-if-no-js aria-button-if-js" aria-label="%s">%s</a>',
+ $post->ID,
+ /* translators: %s: attachment title */
+ esc_attr( sprintf( __( 'Attach &#8220;%s&#8221; to existing content' ), $att_title ) ),
+ __( 'Attach' )
+ );
+ }
+ } else {
+ if ( current_user_can( 'edit_post', $post->ID ) && ! $this->is_trash ) {
+ $actions['edit'] = sprintf(
+ '<a href="%s" aria-label="%s">%s</a>',
+ get_edit_post_link( $post->ID ),
+ /* translators: %s: attachment title */
+ esc_attr( sprintf( __( 'Edit &#8220;%s&#8221;' ), $att_title ) ),
+ __( 'Edit' )
+ );
+ }
+ if ( current_user_can( 'delete_post', $post->ID ) ) {
+ if ( $this->is_trash ) {
+ $actions['untrash'] = sprintf(
+ '<a href="%s" class="submitdelete aria-button-if-js" aria-label="%s">%s</a>',
+ wp_nonce_url( "post.php?action=untrash&amp;post=$post->ID", 'untrash-post_' . $post->ID ),
+ /* translators: %s: attachment title */
+ esc_attr( sprintf( __( 'Restore &#8220;%s&#8221; from the Trash' ), $att_title ) ),
+ __( 'Restore' )
+ );
+ } elseif ( EMPTY_TRASH_DAYS && MEDIA_TRASH ) {
+ $actions['trash'] = sprintf(
+ '<a href="%s" class="submitdelete aria-button-if-js" aria-label="%s">%s</a>',
+ wp_nonce_url( "post.php?action=trash&amp;post=$post->ID", 'trash-post_' . $post->ID ),
+ /* translators: %s: attachment title */
+ esc_attr( sprintf( __( 'Move &#8220;%s&#8221; to the Trash' ), $att_title ) ),
+ _x( 'Trash', 'verb' )
+ );
+ }
+ if ( $this->is_trash || ! EMPTY_TRASH_DAYS || ! MEDIA_TRASH ) {
+ $delete_ays = ( ! $this->is_trash && ! MEDIA_TRASH ) ? " onclick='return showNotice.warn();'" : '';
+ $actions['delete'] = sprintf(
+ '<a href="%s" class="submitdelete aria-button-if-js"%s aria-label="%s">%s</a>',
+ wp_nonce_url( "post.php?action=delete&amp;post=$post->ID", 'delete-post_' . $post->ID ),
+ $delete_ays,
+ /* translators: %s: attachment title */
+ esc_attr( sprintf( __( 'Delete &#8220;%s&#8221; permanently' ), $att_title ) ),
+ __( 'Delete Permanently' )
+ );
+ }
+ }
+ if ( ! $this->is_trash ) {
+ $actions['view'] = sprintf(
+ '<a href="%s" aria-label="%s" rel="bookmark">%s</a>',
+ get_permalink( $post->ID ),
+ /* translators: %s: attachment title */
+ esc_attr( sprintf( __( 'View &#8220;%s&#8221;' ), $att_title ) ),
+ __( 'View' )
+ );
+ }
+ }
+
+ /**
+ * Filters the action links for each attachment in the Media list table.
+ *
+ * @since 2.8.0
+ *
+ * @param string[] $actions An array of action links for each attachment.
+ * Default 'Edit', 'Delete Permanently', 'View'.
+ * @param WP_Post $post WP_Post object for the current attachment.
+ * @param bool $detached Whether the list table contains media not attached
+ * to any posts. Default true.
+ */
+ return apply_filters( 'media_row_actions', $actions, $post, $this->detached );
+ }
+
+ /**
+ * Generates and displays row action links.
+ *
+ * @since 4.3.0
+ *
+ * @param object $post Attachment being acted upon.
+ * @param string $column_name Current column name.
+ * @param string $primary Primary column name.
+ * @return string Row actions output for media attachments.
+ */
+ protected function handle_row_actions( $post, $column_name, $primary ) {
+ if ( $primary !== $column_name ) {
+ return '';
+ }
+
+ $att_title = _draft_or_post_title();
+ return $this->row_actions( $this->_get_row_actions( $post, $att_title ) );
+ }
+}
diff --git a/www/crm/wp-admin/includes/class-wp-ms-sites-list-table.php b/www/crm/wp-admin/includes/class-wp-ms-sites-list-table.php
new file mode 100644
index 00000000..c9399b22
--- /dev/null
+++ b/www/crm/wp-admin/includes/class-wp-ms-sites-list-table.php
@@ -0,0 +1,582 @@
+<?php
+/**
+ * List Table API: WP_MS_Sites_List_Table class
+ *
+ * @package WordPress
+ * @subpackage Administration
+ * @since 3.1.0
+ */
+
+/**
+ * Core class used to implement displaying sites in a list table for the network admin.
+ *
+ * @since 3.1.0
+ * @access private
+ *
+ * @see WP_List_Table
+ */
+class WP_MS_Sites_List_Table extends WP_List_Table {
+
+ /**
+ * Site status list.
+ *
+ * @since 4.3.0
+ * @var array
+ */
+ public $status_list;
+
+ /**
+ * Constructor.
+ *
+ * @since 3.1.0
+ *
+ * @see WP_List_Table::__construct() for more information on default arguments.
+ *
+ * @param array $args An associative array of arguments.
+ */
+ public function __construct( $args = array() ) {
+ $this->status_list = array(
+ 'archived' => array( 'site-archived', __( 'Archived' ) ),
+ 'spam' => array( 'site-spammed', _x( 'Spam', 'site' ) ),
+ 'deleted' => array( 'site-deleted', __( 'Deleted' ) ),
+ 'mature' => array( 'site-mature', __( 'Mature' ) ),
+ );
+
+ parent::__construct(
+ array(
+ 'plural' => 'sites',
+ 'screen' => isset( $args['screen'] ) ? $args['screen'] : null,
+ )
+ );
+ }
+
+ /**
+ * @return bool
+ */
+ public function ajax_user_can() {
+ return current_user_can( 'manage_sites' );
+ }
+
+ /**
+ * Prepares the list of sites for display.
+ *
+ * @since 3.1.0
+ *
+ * @global string $s
+ * @global string $mode
+ * @global wpdb $wpdb
+ */
+ public function prepare_items() {
+ global $s, $mode, $wpdb;
+
+ if ( ! empty( $_REQUEST['mode'] ) ) {
+ $mode = $_REQUEST['mode'] === 'excerpt' ? 'excerpt' : 'list';
+ set_user_setting( 'sites_list_mode', $mode );
+ } else {
+ $mode = get_user_setting( 'sites_list_mode', 'list' );
+ }
+
+ $per_page = $this->get_items_per_page( 'sites_network_per_page' );
+
+ $pagenum = $this->get_pagenum();
+
+ $s = isset( $_REQUEST['s'] ) ? wp_unslash( trim( $_REQUEST['s'] ) ) : '';
+ $wild = '';
+ if ( false !== strpos( $s, '*' ) ) {
+ $wild = '*';
+ $s = trim( $s, '*' );
+ }
+
+ /*
+ * If the network is large and a search is not being performed, show only
+ * the latest sites with no paging in order to avoid expensive count queries.
+ */
+ if ( ! $s && wp_is_large_network() ) {
+ if ( ! isset( $_REQUEST['orderby'] ) ) {
+ $_GET['orderby'] = $_REQUEST['orderby'] = '';
+ }
+ if ( ! isset( $_REQUEST['order'] ) ) {
+ $_GET['order'] = $_REQUEST['order'] = 'DESC';
+ }
+ }
+
+ $args = array(
+ 'number' => intval( $per_page ),
+ 'offset' => intval( ( $pagenum - 1 ) * $per_page ),
+ 'network_id' => get_current_network_id(),
+ );
+
+ if ( empty( $s ) ) {
+ // Nothing to do.
+ } elseif ( preg_match( '/^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$/', $s ) ||
+ preg_match( '/^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.?$/', $s ) ||
+ preg_match( '/^[0-9]{1,3}\.[0-9]{1,3}\.?$/', $s ) ||
+ preg_match( '/^[0-9]{1,3}\.$/', $s ) ) {
+ // IPv4 address
+ $sql = $wpdb->prepare( "SELECT blog_id FROM {$wpdb->registration_log} WHERE {$wpdb->registration_log}.IP LIKE %s", $wpdb->esc_like( $s ) . ( ! empty( $wild ) ? '%' : '' ) );
+ $reg_blog_ids = $wpdb->get_col( $sql );
+
+ if ( $reg_blog_ids ) {
+ $args['site__in'] = $reg_blog_ids;
+ }
+ } elseif ( is_numeric( $s ) && empty( $wild ) ) {
+ $args['ID'] = $s;
+ } else {
+ $args['search'] = $s;
+
+ if ( ! is_subdomain_install() ) {
+ $args['search_columns'] = array( 'path' );
+ }
+ }
+
+ $order_by = isset( $_REQUEST['orderby'] ) ? $_REQUEST['orderby'] : '';
+ if ( 'registered' === $order_by ) {
+ // registered is a valid field name.
+ } elseif ( 'lastupdated' === $order_by ) {
+ $order_by = 'last_updated';
+ } elseif ( 'blogname' === $order_by ) {
+ if ( is_subdomain_install() ) {
+ $order_by = 'domain';
+ } else {
+ $order_by = 'path';
+ }
+ } elseif ( 'blog_id' === $order_by ) {
+ $order_by = 'id';
+ } elseif ( ! $order_by ) {
+ $order_by = false;
+ }
+
+ $args['orderby'] = $order_by;
+
+ if ( $order_by ) {
+ $args['order'] = ( isset( $_REQUEST['order'] ) && 'DESC' === strtoupper( $_REQUEST['order'] ) ) ? 'DESC' : 'ASC';
+ }
+
+ if ( wp_is_large_network() ) {
+ $args['no_found_rows'] = true;
+ } else {
+ $args['no_found_rows'] = false;
+ }
+
+ /**
+ * Filters the arguments for the site query in the sites list table.
+ *
+ * @since 4.6.0
+ *
+ * @param array $args An array of get_sites() arguments.
+ */
+ $args = apply_filters( 'ms_sites_list_table_query_args', $args );
+
+ $_sites = get_sites( $args );
+ if ( is_array( $_sites ) ) {
+ update_site_cache( $_sites );
+
+ $this->items = array_slice( $_sites, 0, $per_page );
+ }
+
+ $total_sites = get_sites(
+ array_merge(
+ $args,
+ array(
+ 'count' => true,
+ 'offset' => 0,
+ 'number' => 0,
+ )
+ )
+ );
+
+ $this->set_pagination_args(
+ array(
+ 'total_items' => $total_sites,
+ 'per_page' => $per_page,
+ )
+ );
+ }
+
+ /**
+ */
+ public function no_items() {
+ _e( 'No sites found.' );
+ }
+
+ /**
+ * @return array
+ */
+ protected function get_bulk_actions() {
+ $actions = array();
+ if ( current_user_can( 'delete_sites' ) ) {
+ $actions['delete'] = __( 'Delete' );
+ }
+ $actions['spam'] = _x( 'Mark as Spam', 'site' );
+ $actions['notspam'] = _x( 'Not Spam', 'site' );
+
+ return $actions;
+ }
+
+ /**
+ * @global string $mode List table view mode.
+ *
+ * @param string $which
+ */
+ protected function pagination( $which ) {
+ global $mode;
+
+ parent::pagination( $which );
+
+ if ( 'top' === $which ) {
+ $this->view_switcher( $mode );
+ }
+ }
+
+ /**
+ * @return array
+ */
+ public function get_columns() {
+ $sites_columns = array(
+ 'cb' => '<input type="checkbox" />',
+ 'blogname' => __( 'URL' ),
+ 'lastupdated' => __( 'Last Updated' ),
+ 'registered' => _x( 'Registered', 'site' ),
+ 'users' => __( 'Users' ),
+ );
+
+ if ( has_filter( 'wpmublogsaction' ) ) {
+ $sites_columns['plugins'] = __( 'Actions' );
+ }
+
+ /**
+ * Filters the displayed site columns in Sites list table.
+ *
+ * @since MU (3.0.0)
+ *
+ * @param string[] $sites_columns An array of displayed site columns. Default 'cb',
+ * 'blogname', 'lastupdated', 'registered', 'users'.
+ */
+ return apply_filters( 'wpmu_blogs_columns', $sites_columns );
+ }
+
+ /**
+ * @return array
+ */
+ protected function get_sortable_columns() {
+ return array(
+ 'blogname' => 'blogname',
+ 'lastupdated' => 'lastupdated',
+ 'registered' => 'blog_id',
+ );
+ }
+
+ /**
+ * Handles the checkbox column output.
+ *
+ * @since 4.3.0
+ *
+ * @param array $blog Current site.
+ */
+ public function column_cb( $blog ) {
+ if ( ! is_main_site( $blog['blog_id'] ) ) :
+ $blogname = untrailingslashit( $blog['domain'] . $blog['path'] );
+ ?>
+ <label class="screen-reader-text" for="blog_<?php echo $blog['blog_id']; ?>">
+ <?php
+ printf( __( 'Select %s' ), $blogname );
+ ?>
+ </label>
+ <input type="checkbox" id="blog_<?php echo $blog['blog_id']; ?>" name="allblogs[]" value="<?php echo esc_attr( $blog['blog_id'] ); ?>" />
+ <?php
+ endif;
+ }
+
+ /**
+ * Handles the ID column output.
+ *
+ * @since 4.4.0
+ *
+ * @param array $blog Current site.
+ */
+ public function column_id( $blog ) {
+ echo $blog['blog_id'];
+ }
+
+ /**
+ * Handles the site name column output.
+ *
+ * @since 4.3.0
+ *
+ * @global string $mode List table view mode.
+ *
+ * @param array $blog Current site.
+ */
+ public function column_blogname( $blog ) {
+ global $mode;
+
+ $blogname = untrailingslashit( $blog['domain'] . $blog['path'] );
+ $blog_states = array();
+ reset( $this->status_list );
+
+ foreach ( $this->status_list as $status => $col ) {
+ if ( $blog[ $status ] == 1 ) {
+ $blog_states[] = $col[1];
+ }
+ }
+ $blog_state = '';
+ if ( ! empty( $blog_states ) ) {
+ $state_count = count( $blog_states );
+ $i = 0;
+ $blog_state .= ' &mdash; ';
+ foreach ( $blog_states as $state ) {
+ ++$i;
+ $sep = ( $i == $state_count ) ? '' : ', ';
+ $blog_state .= "<span class='post-state'>$state$sep</span>";
+ }
+ }
+
+ ?>
+ <strong>
+ <a href="<?php echo esc_url( network_admin_url( 'site-info.php?id=' . $blog['blog_id'] ) ); ?>" class="edit"><?php echo $blogname; ?></a>
+ <?php echo $blog_state; ?>
+ </strong>
+ <?php
+ if ( 'list' !== $mode ) {
+ switch_to_blog( $blog['blog_id'] );
+ echo '<p>';
+ printf(
+ /* translators: 1: site name, 2: site tagline. */
+ __( '%1$s &#8211; %2$s' ),
+ get_option( 'blogname' ),
+ '<em>' . get_option( 'blogdescription ' ) . '</em>'
+ );
+ echo '</p>';
+ restore_current_blog();
+ }
+ }
+
+ /**
+ * Handles the lastupdated column output.
+ *
+ * @since 4.3.0
+ *
+ * @global string $mode List table view mode.
+ *
+ * @param array $blog Current site.
+ */
+ public function column_lastupdated( $blog ) {
+ global $mode;
+
+ if ( 'list' === $mode ) {
+ $date = __( 'Y/m/d' );
+ } else {
+ $date = __( 'Y/m/d g:i:s a' );
+ }
+
+ echo ( $blog['last_updated'] === '0000-00-00 00:00:00' ) ? __( 'Never' ) : mysql2date( $date, $blog['last_updated'] );
+ }
+
+ /**
+ * Handles the registered column output.
+ *
+ * @since 4.3.0
+ *
+ * @global string $mode List table view mode.
+ *
+ * @param array $blog Current site.
+ */
+ public function column_registered( $blog ) {
+ global $mode;
+
+ if ( 'list' === $mode ) {
+ $date = __( 'Y/m/d' );
+ } else {
+ $date = __( 'Y/m/d g:i:s a' );
+ }
+
+ if ( $blog['registered'] === '0000-00-00 00:00:00' ) {
+ echo '&#x2014;';
+ } else {
+ echo mysql2date( $date, $blog['registered'] );
+ }
+ }
+
+ /**
+ * Handles the users column output.
+ *
+ * @since 4.3.0
+ *
+ * @param array $blog Current site.
+ */
+ public function column_users( $blog ) {
+ $user_count = wp_cache_get( $blog['blog_id'] . '_user_count', 'blog-details' );
+ if ( ! $user_count ) {
+ $blog_users = new WP_User_Query(
+ array(
+ 'blog_id' => $blog['blog_id'],
+ 'fields' => 'ID',
+ 'number' => 1,
+ 'count_total' => true,
+ )
+ );
+ $user_count = $blog_users->get_total();
+ wp_cache_set( $blog['blog_id'] . '_user_count', $user_count, 'blog-details', 12 * HOUR_IN_SECONDS );
+ }
+
+ printf(
+ '<a href="%s">%s</a>',
+ esc_url( network_admin_url( 'site-users.php?id=' . $blog['blog_id'] ) ),
+ number_format_i18n( $user_count )
+ );
+ }
+
+ /**
+ * Handles the plugins column output.
+ *
+ * @since 4.3.0
+ *
+ * @param array $blog Current site.
+ */
+ public function column_plugins( $blog ) {
+ if ( has_filter( 'wpmublogsaction' ) ) {
+ /**
+ * Fires inside the auxiliary 'Actions' column of the Sites list table.
+ *
+ * By default this column is hidden unless something is hooked to the action.
+ *
+ * @since MU (3.0.0)
+ *
+ * @param int $blog_id The site ID.
+ */
+ do_action( 'wpmublogsaction', $blog['blog_id'] );
+ }
+ }
+
+ /**
+ * Handles output for the default column.
+ *
+ * @since 4.3.0
+ *
+ * @param array $blog Current site.
+ * @param string $column_name Current column name.
+ */
+ public function column_default( $blog, $column_name ) {
+ /**
+ * Fires for each registered custom column in the Sites list table.
+ *
+ * @since 3.1.0
+ *
+ * @param string $column_name The name of the column to display.
+ * @param int $blog_id The site ID.
+ */
+ do_action( 'manage_sites_custom_column', $column_name, $blog['blog_id'] );
+ }
+
+ /**
+ * @global string $mode
+ */
+ public function display_rows() {
+ foreach ( $this->items as $blog ) {
+ $blog = $blog->to_array();
+ $class = '';
+ reset( $this->status_list );
+
+ foreach ( $this->status_list as $status => $col ) {
+ if ( $blog[ $status ] == 1 ) {
+ $class = " class='{$col[0]}'";
+ }
+ }
+
+ echo "<tr{$class}>";
+
+ $this->single_row_columns( $blog );
+
+ echo '</tr>';
+ }
+ }
+
+ /**
+ * Gets the name of the default primary column.
+ *
+ * @since 4.3.0
+ *
+ * @return string Name of the default primary column, in this case, 'blogname'.
+ */
+ protected function get_default_primary_column_name() {
+ return 'blogname';
+ }
+
+ /**
+ * Generates and displays row action links.
+ *
+ * @since 4.3.0
+ *
+ * @param object $blog Site being acted upon.
+ * @param string $column_name Current column name.
+ * @param string $primary Primary column name.
+ * @return string Row actions output.
+ */
+ protected function handle_row_actions( $blog, $column_name, $primary ) {
+ if ( $primary !== $column_name ) {
+ return;
+ }
+
+ $blogname = untrailingslashit( $blog['domain'] . $blog['path'] );
+
+ // Preordered.
+ $actions = array(
+ 'edit' => '',
+ 'backend' => '',
+ 'activate' => '',
+ 'deactivate' => '',
+ 'archive' => '',
+ 'unarchive' => '',
+ 'spam' => '',
+ 'unspam' => '',
+ 'delete' => '',
+ 'visit' => '',
+ );
+
+ $actions['edit'] = '<a href="' . esc_url( network_admin_url( 'site-info.php?id=' . $blog['blog_id'] ) ) . '">' . __( 'Edit' ) . '</a>';
+ $actions['backend'] = "<a href='" . esc_url( get_admin_url( $blog['blog_id'] ) ) . "' class='edit'>" . __( 'Dashboard' ) . '</a>';
+ if ( get_network()->site_id != $blog['blog_id'] ) {
+ if ( $blog['deleted'] == '1' ) {
+ $actions['activate'] = '<a href="' . esc_url( wp_nonce_url( network_admin_url( 'sites.php?action=confirm&amp;action2=activateblog&amp;id=' . $blog['blog_id'] ), 'activateblog_' . $blog['blog_id'] ) ) . '">' . __( 'Activate' ) . '</a>';
+ } else {
+ $actions['deactivate'] = '<a href="' . esc_url( wp_nonce_url( network_admin_url( 'sites.php?action=confirm&amp;action2=deactivateblog&amp;id=' . $blog['blog_id'] ), 'deactivateblog_' . $blog['blog_id'] ) ) . '">' . __( 'Deactivate' ) . '</a>';
+ }
+
+ if ( $blog['archived'] == '1' ) {
+ $actions['unarchive'] = '<a href="' . esc_url( wp_nonce_url( network_admin_url( 'sites.php?action=confirm&amp;action2=unarchiveblog&amp;id=' . $blog['blog_id'] ), 'unarchiveblog_' . $blog['blog_id'] ) ) . '">' . __( 'Unarchive' ) . '</a>';
+ } else {
+ $actions['archive'] = '<a href="' . esc_url( wp_nonce_url( network_admin_url( 'sites.php?action=confirm&amp;action2=archiveblog&amp;id=' . $blog['blog_id'] ), 'archiveblog_' . $blog['blog_id'] ) ) . '">' . _x( 'Archive', 'verb; site' ) . '</a>';
+ }
+
+ if ( $blog['spam'] == '1' ) {
+ $actions['unspam'] = '<a href="' . esc_url( wp_nonce_url( network_admin_url( 'sites.php?action=confirm&amp;action2=unspamblog&amp;id=' . $blog['blog_id'] ), 'unspamblog_' . $blog['blog_id'] ) ) . '">' . _x( 'Not Spam', 'site' ) . '</a>';
+ } else {
+ $actions['spam'] = '<a href="' . esc_url( wp_nonce_url( network_admin_url( 'sites.php?action=confirm&amp;action2=spamblog&amp;id=' . $blog['blog_id'] ), 'spamblog_' . $blog['blog_id'] ) ) . '">' . _x( 'Spam', 'site' ) . '</a>';
+ }
+
+ if ( current_user_can( 'delete_site', $blog['blog_id'] ) ) {
+ $actions['delete'] = '<a href="' . esc_url( wp_nonce_url( network_admin_url( 'sites.php?action=confirm&amp;action2=deleteblog&amp;id=' . $blog['blog_id'] ), 'deleteblog_' . $blog['blog_id'] ) ) . '">' . __( 'Delete' ) . '</a>';
+ }
+ }
+
+ $actions['visit'] = "<a href='" . esc_url( get_home_url( $blog['blog_id'], '/' ) ) . "' rel='bookmark'>" . __( 'Visit' ) . '</a>';
+
+ /**
+ * Filters the action links displayed for each site in the Sites list table.
+ *
+ * The 'Edit', 'Dashboard', 'Delete', and 'Visit' links are displayed by
+ * default for each site. The site's status determines whether to show the
+ * 'Activate' or 'Deactivate' link, 'Unarchive' or 'Archive' links, and
+ * 'Not Spam' or 'Spam' link for each site.
+ *
+ * @since 3.1.0
+ *
+ * @param string[] $actions An array of action links to be displayed.
+ * @param int $blog_id The site ID.
+ * @param string $blogname Site path, formatted depending on whether it is a sub-domain
+ * or subdirectory multisite installation.
+ */
+ $actions = apply_filters( 'manage_sites_action_links', array_filter( $actions ), $blog['blog_id'], $blogname );
+ return $this->row_actions( $actions );
+ }
+}
diff --git a/www/crm/wp-admin/includes/class-wp-ms-themes-list-table.php b/www/crm/wp-admin/includes/class-wp-ms-themes-list-table.php
new file mode 100644
index 00000000..294f2c82
--- /dev/null
+++ b/www/crm/wp-admin/includes/class-wp-ms-themes-list-table.php
@@ -0,0 +1,763 @@
+<?php
+/**
+ * List Table API: WP_MS_Themes_List_Table class
+ *
+ * @package WordPress
+ * @subpackage Administration
+ * @since 3.1.0
+ */
+
+/**
+ * Core class used to implement displaying themes in a list table for the network admin.
+ *
+ * @since 3.1.0
+ * @access private
+ *
+ * @see WP_List_Table
+ */
+class WP_MS_Themes_List_Table extends WP_List_Table {
+
+ public $site_id;
+ public $is_site_themes;
+
+ private $has_items;
+
+ /**
+ * Constructor.
+ *
+ * @since 3.1.0
+ *
+ * @see WP_List_Table::__construct() for more information on default arguments.
+ *
+ * @global string $status
+ * @global int $page
+ *
+ * @param array $args An associative array of arguments.
+ */
+ public function __construct( $args = array() ) {
+ global $status, $page;
+
+ parent::__construct(
+ array(
+ 'plural' => 'themes',
+ 'screen' => isset( $args['screen'] ) ? $args['screen'] : null,
+ )
+ );
+
+ $status = isset( $_REQUEST['theme_status'] ) ? $_REQUEST['theme_status'] : 'all';
+ if ( ! in_array( $status, array( 'all', 'enabled', 'disabled', 'upgrade', 'search', 'broken' ) ) ) {
+ $status = 'all';
+ }
+
+ $page = $this->get_pagenum();
+
+ $this->is_site_themes = ( 'site-themes-network' === $this->screen->id ) ? true : false;
+
+ if ( $this->is_site_themes ) {
+ $this->site_id = isset( $_REQUEST['id'] ) ? intval( $_REQUEST['id'] ) : 0;
+ }
+ }
+
+ /**
+ * @return array
+ */
+ protected function get_table_classes() {
+ // todo: remove and add CSS for .themes
+ return array( 'widefat', 'plugins' );
+ }
+
+ /**
+ * @return bool
+ */
+ public function ajax_user_can() {
+ if ( $this->is_site_themes ) {
+ return current_user_can( 'manage_sites' );
+ } else {
+ return current_user_can( 'manage_network_themes' );
+ }
+ }
+
+ /**
+ * @global string $status
+ * @global array $totals
+ * @global int $page
+ * @global string $orderby
+ * @global string $order
+ * @global string $s
+ */
+ public function prepare_items() {
+ global $status, $totals, $page, $orderby, $order, $s;
+
+ wp_reset_vars( array( 'orderby', 'order', 's' ) );
+
+ $themes = array(
+ /**
+ * Filters the full array of WP_Theme objects to list in the Multisite
+ * themes list table.
+ *
+ * @since 3.1.0
+ *
+ * @param WP_Theme[] $all Array of WP_Theme objects to display in the list table.
+ */
+ 'all' => apply_filters( 'all_themes', wp_get_themes() ),
+ 'search' => array(),
+ 'enabled' => array(),
+ 'disabled' => array(),
+ 'upgrade' => array(),
+ 'broken' => $this->is_site_themes ? array() : wp_get_themes( array( 'errors' => true ) ),
+ );
+
+ if ( $this->is_site_themes ) {
+ $themes_per_page = $this->get_items_per_page( 'site_themes_network_per_page' );
+ $allowed_where = 'site';
+ } else {
+ $themes_per_page = $this->get_items_per_page( 'themes_network_per_page' );
+ $allowed_where = 'network';
+ }
+
+ $maybe_update = current_user_can( 'update_themes' ) && ! $this->is_site_themes && $current = get_site_transient( 'update_themes' );
+
+ foreach ( (array) $themes['all'] as $key => $theme ) {
+ if ( $this->is_site_themes && $theme->is_allowed( 'network' ) ) {
+ unset( $themes['all'][ $key ] );
+ continue;
+ }
+
+ if ( $maybe_update && isset( $current->response[ $key ] ) ) {
+ $themes['all'][ $key ]->update = true;
+ $themes['upgrade'][ $key ] = $themes['all'][ $key ];
+ }
+
+ $filter = $theme->is_allowed( $allowed_where, $this->site_id ) ? 'enabled' : 'disabled';
+ $themes[ $filter ][ $key ] = $themes['all'][ $key ];
+ }
+
+ if ( $s ) {
+ $status = 'search';
+ $themes['search'] = array_filter( array_merge( $themes['all'], $themes['broken'] ), array( $this, '_search_callback' ) );
+ }
+
+ $totals = array();
+ foreach ( $themes as $type => $list ) {
+ $totals[ $type ] = count( $list );
+ }
+
+ if ( empty( $themes[ $status ] ) && ! in_array( $status, array( 'all', 'search' ) ) ) {
+ $status = 'all';
+ }
+
+ $this->items = $themes[ $status ];
+ WP_Theme::sort_by_name( $this->items );
+
+ $this->has_items = ! empty( $themes['all'] );
+ $total_this_page = $totals[ $status ];
+
+ wp_localize_script(
+ 'updates',
+ '_wpUpdatesItemCounts',
+ array(
+ 'themes' => $totals,
+ 'totals' => wp_get_update_data(),
+ )
+ );
+
+ if ( $orderby ) {
+ $orderby = ucfirst( $orderby );
+ $order = strtoupper( $order );
+
+ if ( $orderby === 'Name' ) {
+ if ( 'ASC' === $order ) {
+ $this->items = array_reverse( $this->items );
+ }
+ } else {
+ uasort( $this->items, array( $this, '_order_callback' ) );
+ }
+ }
+
+ $start = ( $page - 1 ) * $themes_per_page;
+
+ if ( $total_this_page > $themes_per_page ) {
+ $this->items = array_slice( $this->items, $start, $themes_per_page, true );
+ }
+
+ $this->set_pagination_args(
+ array(
+ 'total_items' => $total_this_page,
+ 'per_page' => $themes_per_page,
+ )
+ );
+ }
+
+ /**
+ * @staticvar string $term
+ * @param WP_Theme $theme
+ * @return bool
+ */
+ public function _search_callback( $theme ) {
+ static $term = null;
+ if ( is_null( $term ) ) {
+ $term = wp_unslash( $_REQUEST['s'] );
+ }
+
+ foreach ( array( 'Name', 'Description', 'Author', 'Author', 'AuthorURI' ) as $field ) {
+ // Don't mark up; Do translate.
+ if ( false !== stripos( $theme->display( $field, false, true ), $term ) ) {
+ return true;
+ }
+ }
+
+ if ( false !== stripos( $theme->get_stylesheet(), $term ) ) {
+ return true;
+ }
+
+ if ( false !== stripos( $theme->get_template(), $term ) ) {
+ return true;
+ }
+
+ return false;
+ }
+
+ // Not used by any core columns.
+ /**
+ * @global string $orderby
+ * @global string $order
+ * @param array $theme_a
+ * @param array $theme_b
+ * @return int
+ */
+ public function _order_callback( $theme_a, $theme_b ) {
+ global $orderby, $order;
+
+ $a = $theme_a[ $orderby ];
+ $b = $theme_b[ $orderby ];
+
+ if ( $a == $b ) {
+ return 0;
+ }
+
+ if ( 'DESC' === $order ) {
+ return ( $a < $b ) ? 1 : -1;
+ } else {
+ return ( $a < $b ) ? -1 : 1;
+ }
+ }
+
+ /**
+ */
+ public function no_items() {
+ if ( $this->has_items ) {
+ _e( 'No themes found.' );
+ } else {
+ _e( 'You do not appear to have any themes available at this time.' );
+ }
+ }
+
+ /**
+ * @return array
+ */
+ public function get_columns() {
+ return array(
+ 'cb' => '<input type="checkbox" />',
+ 'name' => __( 'Theme' ),
+ 'description' => __( 'Description' ),
+ );
+ }
+
+ /**
+ * @return array
+ */
+ protected function get_sortable_columns() {
+ return array(
+ 'name' => 'name',
+ );
+ }
+
+ /**
+ * Gets the name of the primary column.
+ *
+ * @since 4.3.0
+ *
+ * @return string Unalterable name of the primary column name, in this case, 'name'.
+ */
+ protected function get_primary_column_name() {
+ return 'name';
+ }
+
+ /**
+ * @global array $totals
+ * @global string $status
+ * @return array
+ */
+ protected function get_views() {
+ global $totals, $status;
+
+ $status_links = array();
+ foreach ( $totals as $type => $count ) {
+ if ( ! $count ) {
+ continue;
+ }
+
+ switch ( $type ) {
+ case 'all':
+ $text = _nx( 'All <span class="count">(%s)</span>', 'All <span class="count">(%s)</span>', $count, 'themes' );
+ break;
+ case 'enabled':
+ $text = _n( 'Enabled <span class="count">(%s)</span>', 'Enabled <span class="count">(%s)</span>', $count );
+ break;
+ case 'disabled':
+ $text = _n( 'Disabled <span class="count">(%s)</span>', 'Disabled <span class="count">(%s)</span>', $count );
+ break;
+ case 'upgrade':
+ $text = _n( 'Update Available <span class="count">(%s)</span>', 'Update Available <span class="count">(%s)</span>', $count );
+ break;
+ case 'broken':
+ $text = _n( 'Broken <span class="count">(%s)</span>', 'Broken <span class="count">(%s)</span>', $count );
+ break;
+ }
+
+ if ( $this->is_site_themes ) {
+ $url = 'site-themes.php?id=' . $this->site_id;
+ } else {
+ $url = 'themes.php';
+ }
+
+ if ( 'search' != $type ) {
+ $status_links[ $type ] = sprintf(
+ "<a href='%s'%s>%s</a>",
+ esc_url( add_query_arg( 'theme_status', $type, $url ) ),
+ ( $type === $status ) ? ' class="current" aria-current="page"' : '',
+ sprintf( $text, number_format_i18n( $count ) )
+ );
+ }
+ }
+
+ return $status_links;
+ }
+
+ /**
+ * @global string $status
+ *
+ * @return array
+ */
+ protected function get_bulk_actions() {
+ global $status;
+
+ $actions = array();
+ if ( 'enabled' != $status ) {
+ $actions['enable-selected'] = $this->is_site_themes ? __( 'Enable' ) : __( 'Network Enable' );
+ }
+ if ( 'disabled' != $status ) {
+ $actions['disable-selected'] = $this->is_site_themes ? __( 'Disable' ) : __( 'Network Disable' );
+ }
+ if ( ! $this->is_site_themes ) {
+ if ( current_user_can( 'update_themes' ) ) {
+ $actions['update-selected'] = __( 'Update' );
+ }
+ if ( current_user_can( 'delete_themes' ) ) {
+ $actions['delete-selected'] = __( 'Delete' );
+ }
+ }
+ return $actions;
+ }
+
+ /**
+ */
+ public function display_rows() {
+ foreach ( $this->items as $theme ) {
+ $this->single_row( $theme );
+ }
+ }
+
+ /**
+ * Handles the checkbox column output.
+ *
+ * @since 4.3.0
+ *
+ * @param WP_Theme $theme The current WP_Theme object.
+ */
+ public function column_cb( $theme ) {
+ $checkbox_id = 'checkbox_' . md5( $theme->get( 'Name' ) );
+ ?>
+ <input type="checkbox" name="checked[]" value="<?php echo esc_attr( $theme->get_stylesheet() ); ?>" id="<?php echo $checkbox_id; ?>" />
+ <label class="screen-reader-text" for="<?php echo $checkbox_id; ?>" ><?php _e( 'Select' ); ?> <?php echo $theme->display( 'Name' ); ?></label>
+ <?php
+ }
+
+ /**
+ * Handles the name column output.
+ *
+ * @since 4.3.0
+ *
+ * @global string $status
+ * @global int $page
+ * @global string $s
+ *
+ * @param WP_Theme $theme The current WP_Theme object.
+ */
+ public function column_name( $theme ) {
+ global $status, $page, $s;
+
+ $context = $status;
+
+ if ( $this->is_site_themes ) {
+ $url = "site-themes.php?id={$this->site_id}&amp;";
+ $allowed = $theme->is_allowed( 'site', $this->site_id );
+ } else {
+ $url = 'themes.php?';
+ $allowed = $theme->is_allowed( 'network' );
+ }
+
+ // Pre-order.
+ $actions = array(
+ 'enable' => '',
+ 'disable' => '',
+ 'delete' => '',
+ );
+
+ $stylesheet = $theme->get_stylesheet();
+ $theme_key = urlencode( $stylesheet );
+
+ if ( ! $allowed ) {
+ if ( ! $theme->errors() ) {
+ $url = add_query_arg(
+ array(
+ 'action' => 'enable',
+ 'theme' => $theme_key,
+ 'paged' => $page,
+ 's' => $s,
+ ),
+ $url
+ );
+
+ if ( $this->is_site_themes ) {
+ /* translators: %s: theme name */
+ $aria_label = sprintf( __( 'Enable %s' ), $theme->display( 'Name' ) );
+ } else {
+ /* translators: %s: theme name */
+ $aria_label = sprintf( __( 'Network Enable %s' ), $theme->display( 'Name' ) );
+ }
+
+ $actions['enable'] = sprintf(
+ '<a href="%s" class="edit" aria-label="%s">%s</a>',
+ esc_url( wp_nonce_url( $url, 'enable-theme_' . $stylesheet ) ),
+ esc_attr( $aria_label ),
+ ( $this->is_site_themes ? __( 'Enable' ) : __( 'Network Enable' ) )
+ );
+ }
+ } else {
+ $url = add_query_arg(
+ array(
+ 'action' => 'disable',
+ 'theme' => $theme_key,
+ 'paged' => $page,
+ 's' => $s,
+ ),
+ $url
+ );
+
+ if ( $this->is_site_themes ) {
+ /* translators: %s: theme name */
+ $aria_label = sprintf( __( 'Disable %s' ), $theme->display( 'Name' ) );
+ } else {
+ /* translators: %s: theme name */
+ $aria_label = sprintf( __( 'Network Disable %s' ), $theme->display( 'Name' ) );
+ }
+
+ $actions['disable'] = sprintf(
+ '<a href="%s" aria-label="%s">%s</a>',
+ esc_url( wp_nonce_url( $url, 'disable-theme_' . $stylesheet ) ),
+ esc_attr( $aria_label ),
+ ( $this->is_site_themes ? __( 'Disable' ) : __( 'Network Disable' ) )
+ );
+ }
+
+ if ( ! $allowed && current_user_can( 'delete_themes' ) && ! $this->is_site_themes && $stylesheet != get_option( 'stylesheet' ) && $stylesheet != get_option( 'template' ) ) {
+ $url = add_query_arg(
+ array(
+ 'action' => 'delete-selected',
+ 'checked[]' => $theme_key,
+ 'theme_status' => $context,
+ 'paged' => $page,
+ 's' => $s,
+ ),
+ 'themes.php'
+ );
+
+ /* translators: %s: theme name */
+ $aria_label = sprintf( _x( 'Delete %s', 'theme' ), $theme->display( 'Name' ) );
+
+ $actions['delete'] = sprintf(
+ '<a href="%s" class="delete" aria-label="%s">%s</a>',
+ esc_url( wp_nonce_url( $url, 'bulk-themes' ) ),
+ esc_attr( $aria_label ),
+ __( 'Delete' )
+ );
+ }
+ /**
+ * Filters the action links displayed for each theme in the Multisite
+ * themes list table.
+ *
+ * The action links displayed are determined by the theme's status, and
+ * which Multisite themes list table is being displayed - the Network
+ * themes list table (themes.php), which displays all installed themes,
+ * or the Site themes list table (site-themes.php), which displays the
+ * non-network enabled themes when editing a site in the Network admin.
+ *
+ * The default action links for the Network themes list table include
+ * 'Network Enable', 'Network Disable', and 'Delete'.
+ *
+ * The default action links for the Site themes list table include
+ * 'Enable', and 'Disable'.
+ *
+ * @since 2.8.0
+ *
+ * @param string[] $actions An array of action links.
+ * @param WP_Theme $theme The current WP_Theme object.
+ * @param string $context Status of the theme, one of 'all', 'enabled', or 'disabled'.
+ */
+ $actions = apply_filters( 'theme_action_links', array_filter( $actions ), $theme, $context );
+
+ /**
+ * Filters the action links of a specific theme in the Multisite themes
+ * list table.
+ *
+ * The dynamic portion of the hook name, `$stylesheet`, refers to the
+ * directory name of the theme, which in most cases is synonymous
+ * with the template name.
+ *
+ * @since 3.1.0
+ *
+ * @param string[] $actions An array of action links.
+ * @param WP_Theme $theme The current WP_Theme object.
+ * @param string $context Status of the theme, one of 'all', 'enabled', or 'disabled'.
+ */
+ $actions = apply_filters( "theme_action_links_{$stylesheet}", $actions, $theme, $context );
+
+ echo $this->row_actions( $actions, true );
+ }
+
+ /**
+ * Handles the description column output.
+ *
+ * @since 4.3.0
+ *
+ * @global string $status
+ * @global array $totals
+ *
+ * @param WP_Theme $theme The current WP_Theme object.
+ */
+ public function column_description( $theme ) {
+ global $status, $totals;
+ if ( $theme->errors() ) {
+ $pre = $status === 'broken' ? __( 'Broken Theme:' ) . ' ' : '';
+ echo '<p><strong class="error-message">' . $pre . $theme->errors()->get_error_message() . '</strong></p>';
+ }
+
+ if ( $this->is_site_themes ) {
+ $allowed = $theme->is_allowed( 'site', $this->site_id );
+ } else {
+ $allowed = $theme->is_allowed( 'network' );
+ }
+
+ $class = ! $allowed ? 'inactive' : 'active';
+ if ( ! empty( $totals['upgrade'] ) && ! empty( $theme->update ) ) {
+ $class .= ' update';
+ }
+
+ echo "<div class='theme-description'><p>" . $theme->display( 'Description' ) . "</p></div>
+ <div class='$class second theme-version-author-uri'>";
+
+ $stylesheet = $theme->get_stylesheet();
+ $theme_meta = array();
+
+ if ( $theme->get( 'Version' ) ) {
+ $theme_meta[] = sprintf( __( 'Version %s' ), $theme->display( 'Version' ) );
+ }
+ $theme_meta[] = sprintf( __( 'By %s' ), $theme->display( 'Author' ) );
+
+ if ( $theme->get( 'ThemeURI' ) ) {
+ /* translators: %s: theme name */
+ $aria_label = sprintf( __( 'Visit %s homepage' ), $theme->display( 'Name' ) );
+
+ $theme_meta[] = sprintf(
+ '<a href="%s" aria-label="%s">%s</a>',
+ $theme->display( 'ThemeURI' ),
+ esc_attr( $aria_label ),
+ __( 'Visit Theme Site' )
+ );
+ }
+ /**
+ * Filters the array of row meta for each theme in the Multisite themes
+ * list table.
+ *
+ * @since 3.1.0
+ *
+ * @param string[] $theme_meta An array of the theme's metadata,
+ * including the version, author, and
+ * theme URI.
+ * @param string $stylesheet Directory name of the theme.
+ * @param WP_Theme $theme WP_Theme object.
+ * @param string $status Status of the theme.
+ */
+ $theme_meta = apply_filters( 'theme_row_meta', $theme_meta, $stylesheet, $theme, $status );
+ echo implode( ' | ', $theme_meta );
+
+ echo '</div>';
+ }
+
+ /**
+ * Handles default column output.
+ *
+ * @since 4.3.0
+ *
+ * @param WP_Theme $theme The current WP_Theme object.
+ * @param string $column_name The current column name.
+ */
+ public function column_default( $theme, $column_name ) {
+ $stylesheet = $theme->get_stylesheet();
+
+ /**
+ * Fires inside each custom column of the Multisite themes list table.
+ *
+ * @since 3.1.0
+ *
+ * @param string $column_name Name of the column.
+ * @param string $stylesheet Directory name of the theme.
+ * @param WP_Theme $theme Current WP_Theme object.
+ */
+ do_action( 'manage_themes_custom_column', $column_name, $stylesheet, $theme );
+ }
+
+ /**
+ * Handles the output for a single table row.
+ *
+ * @since 4.3.0
+ *
+ * @param WP_Theme $item The current WP_Theme object.
+ */
+ public function single_row_columns( $item ) {
+ list( $columns, $hidden, $sortable, $primary ) = $this->get_column_info();
+
+ foreach ( $columns as $column_name => $column_display_name ) {
+ $extra_classes = '';
+ if ( in_array( $column_name, $hidden ) ) {
+ $extra_classes .= ' hidden';
+ }
+
+ switch ( $column_name ) {
+ case 'cb':
+ echo '<th scope="row" class="check-column">';
+
+ $this->column_cb( $item );
+
+ echo '</th>';
+ break;
+
+ case 'name':
+ $active_theme_label = '';
+
+ /* The presence of the site_id property means that this is a subsite view and a label for the active theme needs to be added */
+ if ( ! empty( $this->site_id ) ) {
+ $stylesheet = get_blog_option( $this->site_id, 'stylesheet' );
+ $template = get_blog_option( $this->site_id, 'template' );
+
+ /* Add a label for the active template */
+ if ( $item->get_template() === $template ) {
+ $active_theme_label = ' &mdash; ' . __( 'Active Theme' );
+ }
+
+ /* In case this is a child theme, label it properly */
+ if ( $stylesheet !== $template && $item->get_stylesheet() === $stylesheet ) {
+ $active_theme_label = ' &mdash; ' . __( 'Active Child Theme' );
+ }
+ }
+
+ echo "<td class='theme-title column-primary{$extra_classes}'><strong>" . $item->display( 'Name' ) . $active_theme_label . '</strong>';
+
+ $this->column_name( $item );
+
+ echo '</td>';
+ break;
+
+ case 'description':
+ echo "<td class='column-description desc{$extra_classes}'>";
+
+ $this->column_description( $item );
+
+ echo '</td>';
+ break;
+
+ default:
+ echo "<td class='$column_name column-$column_name{$extra_classes}'>";
+
+ $this->column_default( $item, $column_name );
+
+ echo '</td>';
+ break;
+ }
+ }
+ }
+
+ /**
+ * @global string $status
+ * @global array $totals
+ *
+ * @param WP_Theme $theme
+ */
+ public function single_row( $theme ) {
+ global $status, $totals;
+
+ if ( $this->is_site_themes ) {
+ $allowed = $theme->is_allowed( 'site', $this->site_id );
+ } else {
+ $allowed = $theme->is_allowed( 'network' );
+ }
+
+ $stylesheet = $theme->get_stylesheet();
+
+ $class = ! $allowed ? 'inactive' : 'active';
+ if ( ! empty( $totals['upgrade'] ) && ! empty( $theme->update ) ) {
+ $class .= ' update';
+ }
+
+ printf(
+ '<tr class="%s" data-slug="%s">',
+ esc_attr( $class ),
+ esc_attr( $stylesheet )
+ );
+
+ $this->single_row_columns( $theme );
+
+ echo '</tr>';
+
+ if ( $this->is_site_themes ) {
+ remove_action( "after_theme_row_$stylesheet", 'wp_theme_update_row' );
+ }
+
+ /**
+ * Fires after each row in the Multisite themes list table.
+ *
+ * @since 3.1.0
+ *
+ * @param string $stylesheet Directory name of the theme.
+ * @param WP_Theme $theme Current WP_Theme object.
+ * @param string $status Status of the theme.
+ */
+ do_action( 'after_theme_row', $stylesheet, $theme, $status );
+
+ /**
+ * Fires after each specific row in the Multisite themes list table.
+ *
+ * The dynamic portion of the hook name, `$stylesheet`, refers to the
+ * directory name of the theme, most often synonymous with the template
+ * name of the theme.
+ *
+ * @since 3.5.0
+ *
+ * @param string $stylesheet Directory name of the theme.
+ * @param WP_Theme $theme Current WP_Theme object.
+ * @param string $status Status of the theme.
+ */
+ do_action( "after_theme_row_{$stylesheet}", $stylesheet, $theme, $status );
+ }
+}
diff --git a/www/crm/wp-admin/includes/class-wp-ms-users-list-table.php b/www/crm/wp-admin/includes/class-wp-ms-users-list-table.php
new file mode 100644
index 00000000..e3d619ae
--- /dev/null
+++ b/www/crm/wp-admin/includes/class-wp-ms-users-list-table.php
@@ -0,0 +1,488 @@
+<?php
+/**
+ * List Table API: WP_MS_Users_List_Table class
+ *
+ * @package WordPress
+ * @subpackage Administration
+ * @since 3.1.0
+ */
+
+/**
+ * Core class used to implement displaying users in a list table for the network admin.
+ *
+ * @since 3.1.0
+ * @access private
+ *
+ * @see WP_List_Table
+ */
+class WP_MS_Users_List_Table extends WP_List_Table {
+ /**
+ * @return bool
+ */
+ public function ajax_user_can() {
+ return current_user_can( 'manage_network_users' );
+ }
+
+ /**
+ * @global string $usersearch
+ * @global string $role
+ * @global string $mode
+ */
+ public function prepare_items() {
+ global $usersearch, $role, $mode;
+
+ $usersearch = isset( $_REQUEST['s'] ) ? wp_unslash( trim( $_REQUEST['s'] ) ) : '';
+
+ $users_per_page = $this->get_items_per_page( 'users_network_per_page' );
+
+ $role = isset( $_REQUEST['role'] ) ? $_REQUEST['role'] : '';
+
+ $paged = $this->get_pagenum();
+
+ $args = array(
+ 'number' => $users_per_page,
+ 'offset' => ( $paged - 1 ) * $users_per_page,
+ 'search' => $usersearch,
+ 'blog_id' => 0,
+ 'fields' => 'all_with_meta',
+ );
+
+ if ( wp_is_large_network( 'users' ) ) {
+ $args['search'] = ltrim( $args['search'], '*' );
+ } elseif ( '' !== $args['search'] ) {
+ $args['search'] = trim( $args['search'], '*' );
+ $args['search'] = '*' . $args['search'] . '*';
+ }
+
+ if ( $role === 'super' ) {
+ $args['login__in'] = get_super_admins();
+ }
+
+ /*
+ * If the network is large and a search is not being performed,
+ * show only the latest users with no paging in order to avoid
+ * expensive count queries.
+ */
+ if ( ! $usersearch && wp_is_large_network( 'users' ) ) {
+ if ( ! isset( $_REQUEST['orderby'] ) ) {
+ $_GET['orderby'] = $_REQUEST['orderby'] = 'id';
+ }
+ if ( ! isset( $_REQUEST['order'] ) ) {
+ $_GET['order'] = $_REQUEST['order'] = 'DESC';
+ }
+ $args['count_total'] = false;
+ }
+
+ if ( isset( $_REQUEST['orderby'] ) ) {
+ $args['orderby'] = $_REQUEST['orderby'];
+ }
+
+ if ( isset( $_REQUEST['order'] ) ) {
+ $args['order'] = $_REQUEST['order'];
+ }
+
+ if ( ! empty( $_REQUEST['mode'] ) ) {
+ $mode = $_REQUEST['mode'] === 'excerpt' ? 'excerpt' : 'list';
+ set_user_setting( 'network_users_list_mode', $mode );
+ } else {
+ $mode = get_user_setting( 'network_users_list_mode', 'list' );
+ }
+
+ /** This filter is documented in wp-admin/includes/class-wp-users-list-table.php */
+ $args = apply_filters( 'users_list_table_query_args', $args );
+
+ // Query the user IDs for this page
+ $wp_user_search = new WP_User_Query( $args );
+
+ $this->items = $wp_user_search->get_results();
+
+ $this->set_pagination_args(
+ array(
+ 'total_items' => $wp_user_search->get_total(),
+ 'per_page' => $users_per_page,
+ )
+ );
+ }
+
+ /**
+ * @return array
+ */
+ protected function get_bulk_actions() {
+ $actions = array();
+ if ( current_user_can( 'delete_users' ) ) {
+ $actions['delete'] = __( 'Delete' );
+ }
+ $actions['spam'] = _x( 'Mark as Spam', 'user' );
+ $actions['notspam'] = _x( 'Not Spam', 'user' );
+
+ return $actions;
+ }
+
+ /**
+ */
+ public function no_items() {
+ _e( 'No users found.' );
+ }
+
+ /**
+ * @global string $role
+ * @return array
+ */
+ protected function get_views() {
+ global $role;
+
+ $total_users = get_user_count();
+ $super_admins = get_super_admins();
+ $total_admins = count( $super_admins );
+
+ $current_link_attributes = $role !== 'super' ? ' class="current" aria-current="page"' : '';
+ $role_links = array();
+ $role_links['all'] = "<a href='" . network_admin_url( 'users.php' ) . "'$current_link_attributes>" . sprintf( _nx( 'All <span class="count">(%s)</span>', 'All <span class="count">(%s)</span>', $total_users, 'users' ), number_format_i18n( $total_users ) ) . '</a>';
+ $current_link_attributes = $role === 'super' ? ' class="current" aria-current="page"' : '';
+ $role_links['super'] = "<a href='" . network_admin_url( 'users.php?role=super' ) . "'$current_link_attributes>" . sprintf( _n( 'Super Admin <span class="count">(%s)</span>', 'Super Admins <span class="count">(%s)</span>', $total_admins ), number_format_i18n( $total_admins ) ) . '</a>';
+
+ return $role_links;
+ }
+
+ /**
+ * @global string $mode List table view mode.
+ *
+ * @param string $which
+ */
+ protected function pagination( $which ) {
+ global $mode;
+
+ parent::pagination( $which );
+
+ if ( 'top' === $which ) {
+ $this->view_switcher( $mode );
+ }
+ }
+
+ /**
+ * @return array
+ */
+ public function get_columns() {
+ $users_columns = array(
+ 'cb' => '<input type="checkbox" />',
+ 'username' => __( 'Username' ),
+ 'name' => __( 'Name' ),
+ 'email' => __( 'Email' ),
+ 'registered' => _x( 'Registered', 'user' ),
+ 'blogs' => __( 'Sites' ),
+ );
+ /**
+ * Filters the columns displayed in the Network Admin Users list table.
+ *
+ * @since MU (3.0.0)
+ *
+ * @param string[] $users_columns An array of user columns. Default 'cb', 'username',
+ * 'name', 'email', 'registered', 'blogs'.
+ */
+ return apply_filters( 'wpmu_users_columns', $users_columns );
+ }
+
+ /**
+ * @return array
+ */
+ protected function get_sortable_columns() {
+ return array(
+ 'username' => 'login',
+ 'name' => 'name',
+ 'email' => 'email',
+ 'registered' => 'id',
+ );
+ }
+
+ /**
+ * Handles the checkbox column output.
+ *
+ * @since 4.3.0
+ *
+ * @param WP_User $user The current WP_User object.
+ */
+ public function column_cb( $user ) {
+ if ( is_super_admin( $user->ID ) ) {
+ return;
+ }
+ ?>
+ <label class="screen-reader-text" for="blog_<?php echo $user->ID; ?>"><?php echo sprintf( __( 'Select %s' ), $user->user_login ); ?></label>
+ <input type="checkbox" id="blog_<?php echo $user->ID; ?>" name="allusers[]" value="<?php echo esc_attr( $user->ID ); ?>" />
+ <?php
+ }
+
+ /**
+ * Handles the ID column output.
+ *
+ * @since 4.4.0
+ *
+ * @param WP_User $user The current WP_User object.
+ */
+ public function column_id( $user ) {
+ echo $user->ID;
+ }
+
+ /**
+ * Handles the username column output.
+ *
+ * @since 4.3.0
+ *
+ * @param WP_User $user The current WP_User object.
+ */
+ public function column_username( $user ) {
+ $super_admins = get_super_admins();
+ $avatar = get_avatar( $user->user_email, 32 );
+
+ echo $avatar;
+
+ if ( current_user_can( 'edit_user', $user->ID ) ) {
+ $edit_link = esc_url( add_query_arg( 'wp_http_referer', urlencode( wp_unslash( $_SERVER['REQUEST_URI'] ) ), get_edit_user_link( $user->ID ) ) );
+ $edit = "<a href=\"{$edit_link}\">{$user->user_login}</a>";
+ } else {
+ $edit = $user->user_login;
+ }
+
+ ?>
+ <strong>
+ <?php
+ echo $edit;
+
+ if ( in_array( $user->user_login, $super_admins ) ) {
+ echo ' &mdash; ' . __( 'Super Admin' );
+ }
+ ?>
+ </strong>
+ <?php
+ }
+
+ /**
+ * Handles the name column output.
+ *
+ * @since 4.3.0
+ *
+ * @param WP_User $user The current WP_User object.
+ */
+ public function column_name( $user ) {
+ if ( $user->first_name && $user->last_name ) {
+ echo "$user->first_name $user->last_name";
+ } elseif ( $user->first_name ) {
+ echo $user->first_name;
+ } elseif ( $user->last_name ) {
+ echo $user->last_name;
+ } else {
+ echo '<span aria-hidden="true">&#8212;</span><span class="screen-reader-text">' . _x( 'Unknown', 'name' ) . '</span>';
+ }
+ }
+
+ /**
+ * Handles the email column output.
+ *
+ * @since 4.3.0
+ *
+ * @param WP_User $user The current WP_User object.
+ */
+ public function column_email( $user ) {
+ echo "<a href='" . esc_url( "mailto:$user->user_email" ) . "'>$user->user_email</a>";
+ }
+
+ /**
+ * Handles the registered date column output.
+ *
+ * @since 4.3.0
+ *
+ * @global string $mode List table view mode.
+ *
+ * @param WP_User $user The current WP_User object.
+ */
+ public function column_registered( $user ) {
+ global $mode;
+ if ( 'list' === $mode ) {
+ $date = __( 'Y/m/d' );
+ } else {
+ $date = __( 'Y/m/d g:i:s a' );
+ }
+ echo mysql2date( $date, $user->user_registered );
+ }
+
+ /**
+ * @since 4.3.0
+ *
+ * @param WP_User $user
+ * @param string $classes
+ * @param string $data
+ * @param string $primary
+ */
+ protected function _column_blogs( $user, $classes, $data, $primary ) {
+ echo '<td class="', $classes, ' has-row-actions" ', $data, '>';
+ echo $this->column_blogs( $user );
+ echo $this->handle_row_actions( $user, 'blogs', $primary );
+ echo '</td>';
+ }
+
+ /**
+ * Handles the sites column output.
+ *
+ * @since 4.3.0
+ *
+ * @param WP_User $user The current WP_User object.
+ */
+ public function column_blogs( $user ) {
+ $blogs = get_blogs_of_user( $user->ID, true );
+ if ( ! is_array( $blogs ) ) {
+ return;
+ }
+
+ foreach ( $blogs as $val ) {
+ if ( ! can_edit_network( $val->site_id ) ) {
+ continue;
+ }
+
+ $path = ( $val->path === '/' ) ? '' : $val->path;
+ $site_classes = array( 'site-' . $val->site_id );
+ /**
+ * Filters the span class for a site listing on the mulisite user list table.
+ *
+ * @since 5.2.0
+ *
+ * @param array $site_classes Class used within the span tag. Default "site-#" with the site's network ID.
+ * @param int $site_id Site ID.
+ * @param int $network_id Network ID.
+ * @param object $user WP_User object.
+ */
+ $site_classes = apply_filters( 'ms_user_list_site_class', $site_classes, $val->userblog_id, $val->site_id, $user );
+ if ( is_array( $site_classes ) && ! empty( $site_classes ) ) {
+ $site_classes = array_map( 'sanitize_html_class', array_unique( $site_classes ) );
+ echo '<span class="' . esc_attr( implode( ' ', $site_classes ) ) . '">';
+ } else {
+ echo '<span>';
+ }
+ echo '<a href="' . esc_url( network_admin_url( 'site-info.php?id=' . $val->userblog_id ) ) . '">' . str_replace( '.' . get_network()->domain, '', $val->domain . $path ) . '</a>';
+ echo ' <small class="row-actions">';
+ $actions = array();
+ $actions['edit'] = '<a href="' . esc_url( network_admin_url( 'site-info.php?id=' . $val->userblog_id ) ) . '">' . __( 'Edit' ) . '</a>';
+
+ $class = '';
+ if ( $val->spam == 1 ) {
+ $class .= 'site-spammed ';
+ }
+ if ( $val->mature == 1 ) {
+ $class .= 'site-mature ';
+ }
+ if ( $val->deleted == 1 ) {
+ $class .= 'site-deleted ';
+ }
+ if ( $val->archived == 1 ) {
+ $class .= 'site-archived ';
+ }
+
+ $actions['view'] = '<a class="' . $class . '" href="' . esc_url( get_home_url( $val->userblog_id ) ) . '">' . __( 'View' ) . '</a>';
+
+ /**
+ * Filters the action links displayed next the sites a user belongs to
+ * in the Network Admin Users list table.
+ *
+ * @since 3.1.0
+ *
+ * @param string[] $actions An array of action links to be displayed. Default 'Edit', 'View'.
+ * @param int $userblog_id The site ID.
+ */
+ $actions = apply_filters( 'ms_user_list_site_actions', $actions, $val->userblog_id );
+
+ $i = 0;
+ $action_count = count( $actions );
+ foreach ( $actions as $action => $link ) {
+ ++$i;
+ $sep = ( $i == $action_count ) ? '' : ' | ';
+ echo "<span class='$action'>$link$sep</span>";
+ }
+ echo '</small></span><br/>';
+ }
+ }
+
+ /**
+ * Handles the default column output.
+ *
+ * @since 4.3.0
+ *
+ * @param WP_User $user The current WP_User object.
+ * @param string $column_name The current column name.
+ */
+ public function column_default( $user, $column_name ) {
+ /** This filter is documented in wp-admin/includes/class-wp-users-list-table.php */
+ echo apply_filters( 'manage_users_custom_column', '', $column_name, $user->ID );
+ }
+
+ public function display_rows() {
+ foreach ( $this->items as $user ) {
+ $class = '';
+
+ $status_list = array(
+ 'spam' => 'site-spammed',
+ 'deleted' => 'site-deleted',
+ );
+
+ foreach ( $status_list as $status => $col ) {
+ if ( $user->$status ) {
+ $class .= " $col";
+ }
+ }
+
+ ?>
+ <tr class="<?php echo trim( $class ); ?>">
+ <?php $this->single_row_columns( $user ); ?>
+ </tr>
+ <?php
+ }
+ }
+
+ /**
+ * Gets the name of the default primary column.
+ *
+ * @since 4.3.0
+ *
+ * @return string Name of the default primary column, in this case, 'username'.
+ */
+ protected function get_default_primary_column_name() {
+ return 'username';
+ }
+
+ /**
+ * Generates and displays row action links.
+ *
+ * @since 4.3.0
+ *
+ * @param object $user User being acted upon.
+ * @param string $column_name Current column name.
+ * @param string $primary Primary column name.
+ * @return string Row actions output for users in Multisite.
+ */
+ protected function handle_row_actions( $user, $column_name, $primary ) {
+ if ( $primary !== $column_name ) {
+ return '';
+ }
+
+ $super_admins = get_super_admins();
+
+ $actions = array();
+
+ if ( current_user_can( 'edit_user', $user->ID ) ) {
+ $edit_link = esc_url( add_query_arg( 'wp_http_referer', urlencode( wp_unslash( $_SERVER['REQUEST_URI'] ) ), get_edit_user_link( $user->ID ) ) );
+ $actions['edit'] = '<a href="' . $edit_link . '">' . __( 'Edit' ) . '</a>';
+ }
+
+ if ( current_user_can( 'delete_user', $user->ID ) && ! in_array( $user->user_login, $super_admins ) ) {
+ $actions['delete'] = '<a href="' . $delete = esc_url( network_admin_url( add_query_arg( '_wp_http_referer', urlencode( wp_unslash( $_SERVER['REQUEST_URI'] ) ), wp_nonce_url( 'users.php', 'deleteuser' ) . '&amp;action=deleteuser&amp;id=' . $user->ID ) ) ) . '" class="delete">' . __( 'Delete' ) . '</a>';
+ }
+
+ /**
+ * Filters the action links displayed under each user in the Network Admin Users list table.
+ *
+ * @since 3.2.0
+ *
+ * @param string[] $actions An array of action links to be displayed. Default 'Edit', 'Delete'.
+ * @param WP_User $user WP_User object.
+ */
+ $actions = apply_filters( 'ms_user_row_actions', $actions, $user );
+ return $this->row_actions( $actions );
+ }
+}
diff --git a/www/crm/wp-admin/includes/class-wp-plugin-install-list-table.php b/www/crm/wp-admin/includes/class-wp-plugin-install-list-table.php
new file mode 100644
index 00000000..0b2de906
--- /dev/null
+++ b/www/crm/wp-admin/includes/class-wp-plugin-install-list-table.php
@@ -0,0 +1,765 @@
+<?php
+/**
+ * List Table API: WP_Plugin_Install_List_Table class
+ *
+ * @package WordPress
+ * @subpackage Administration
+ * @since 3.1.0
+ */
+
+/**
+ * Core class used to implement displaying plugins to install in a list table.
+ *
+ * @since 3.1.0
+ * @access private
+ *
+ * @see WP_List_Table
+ */
+class WP_Plugin_Install_List_Table extends WP_List_Table {
+
+ public $order = 'ASC';
+ public $orderby = null;
+ public $groups = array();
+
+ private $error;
+
+ /**
+ * @return bool
+ */
+ public function ajax_user_can() {
+ return current_user_can( 'install_plugins' );
+ }
+
+ /**
+ * Return the list of known plugins.
+ *
+ * Uses the transient data from the updates API to determine the known
+ * installed plugins.
+ *
+ * @since 4.9.0
+ * @access protected
+ *
+ * @return array
+ */
+ protected function get_installed_plugins() {
+ $plugins = array();
+
+ $plugin_info = get_site_transient( 'update_plugins' );
+ if ( isset( $plugin_info->no_update ) ) {
+ foreach ( $plugin_info->no_update as $plugin ) {
+ $plugin->upgrade = false;
+ $plugins[ $plugin->slug ] = $plugin;
+ }
+ }
+
+ if ( isset( $plugin_info->response ) ) {
+ foreach ( $plugin_info->response as $plugin ) {
+ $plugin->upgrade = true;
+ $plugins[ $plugin->slug ] = $plugin;
+ }
+ }
+
+ return $plugins;
+ }
+
+ /**
+ * Return a list of slugs of installed plugins, if known.
+ *
+ * Uses the transient data from the updates API to determine the slugs of
+ * known installed plugins. This might be better elsewhere, perhaps even
+ * within get_plugins().
+ *
+ * @since 4.0.0
+ *
+ * @return array
+ */
+ protected function get_installed_plugin_slugs() {
+ return array_keys( $this->get_installed_plugins() );
+ }
+
+ /**
+ * @global array $tabs
+ * @global string $tab
+ * @global int $paged
+ * @global string $type
+ * @global string $term
+ */
+ public function prepare_items() {
+ include( ABSPATH . 'wp-admin/includes/plugin-install.php' );
+
+ global $tabs, $tab, $paged, $type, $term;
+
+ wp_reset_vars( array( 'tab' ) );
+
+ $paged = $this->get_pagenum();
+
+ $per_page = 36;
+
+ // These are the tabs which are shown on the page
+ $tabs = array();
+
+ if ( 'search' === $tab ) {
+ $tabs['search'] = __( 'Search Results' );
+ }
+ if ( $tab === 'beta' || false !== strpos( get_bloginfo( 'version' ), '-' ) ) {
+ $tabs['beta'] = _x( 'Beta Testing', 'Plugin Installer' );
+ }
+ $tabs['featured'] = _x( 'Featured', 'Plugin Installer' );
+ $tabs['popular'] = _x( 'Popular', 'Plugin Installer' );
+ $tabs['recommended'] = _x( 'Recommended', 'Plugin Installer' );
+ $tabs['favorites'] = _x( 'Favorites', 'Plugin Installer' );
+ if ( current_user_can( 'upload_plugins' ) ) {
+ // No longer a real tab. Here for filter compatibility.
+ // Gets skipped in get_views().
+ $tabs['upload'] = __( 'Upload Plugin' );
+ }
+
+ $nonmenu_tabs = array( 'plugin-information' ); // Valid actions to perform which do not have a Menu item.
+
+ /**
+ * Filters the tabs shown on the Plugin Install screen.
+ *
+ * @since 2.7.0
+ *
+ * @param string[] $tabs The tabs shown on the Plugin Install screen. Defaults include 'featured', 'popular',
+ * 'recommended', 'favorites', and 'upload'.
+ */
+ $tabs = apply_filters( 'install_plugins_tabs', $tabs );
+
+ /**
+ * Filters tabs not associated with a menu item on the Plugin Install screen.
+ *
+ * @since 2.7.0
+ *
+ * @param string[] $nonmenu_tabs The tabs that don't have a menu item on the Plugin Install screen.
+ */
+ $nonmenu_tabs = apply_filters( 'install_plugins_nonmenu_tabs', $nonmenu_tabs );
+
+ // If a non-valid menu tab has been selected, And it's not a non-menu action.
+ if ( empty( $tab ) || ( ! isset( $tabs[ $tab ] ) && ! in_array( $tab, (array) $nonmenu_tabs ) ) ) {
+ $tab = key( $tabs );
+ }
+
+ $installed_plugins = $this->get_installed_plugins();
+
+ $args = array(
+ 'page' => $paged,
+ 'per_page' => $per_page,
+ // Send the locale to the API so it can provide context-sensitive results.
+ 'locale' => get_user_locale(),
+ );
+
+ switch ( $tab ) {
+ case 'search':
+ $type = isset( $_REQUEST['type'] ) ? wp_unslash( $_REQUEST['type'] ) : 'term';
+ $term = isset( $_REQUEST['s'] ) ? wp_unslash( $_REQUEST['s'] ) : '';
+
+ switch ( $type ) {
+ case 'tag':
+ $args['tag'] = sanitize_title_with_dashes( $term );
+ break;
+ case 'term':
+ $args['search'] = $term;
+ break;
+ case 'author':
+ $args['author'] = $term;
+ break;
+ }
+
+ break;
+
+ case 'featured':
+ case 'popular':
+ case 'new':
+ case 'beta':
+ $args['browse'] = $tab;
+ break;
+ case 'recommended':
+ $args['browse'] = $tab;
+ // Include the list of installed plugins so we can get relevant results.
+ $args['installed_plugins'] = array_keys( $installed_plugins );
+ break;
+
+ case 'favorites':
+ $action = 'save_wporg_username_' . get_current_user_id();
+ if ( isset( $_GET['_wpnonce'] ) && wp_verify_nonce( wp_unslash( $_GET['_wpnonce'] ), $action ) ) {
+ $user = isset( $_GET['user'] ) ? wp_unslash( $_GET['user'] ) : get_user_option( 'wporg_favorites' );
+
+ // If the save url parameter is passed with a falsey value, don't save the favorite user.
+ if ( ! isset( $_GET['save'] ) || $_GET['save'] ) {
+ update_user_meta( get_current_user_id(), 'wporg_favorites', $user );
+ }
+ } else {
+ $user = get_user_option( 'wporg_favorites' );
+ }
+ if ( $user ) {
+ $args['user'] = $user;
+ } else {
+ $args = false;
+ }
+
+ add_action( 'install_plugins_favorites', 'install_plugins_favorites_form', 9, 0 );
+ break;
+
+ default:
+ $args = false;
+ break;
+ }
+
+ /**
+ * Filters API request arguments for each Plugin Install screen tab.
+ *
+ * The dynamic portion of the hook name, `$tab`, refers to the plugin install tabs.
+ * Default tabs include 'featured', 'popular', 'recommended', 'favorites', and 'upload'.
+ *
+ * @since 3.7.0
+ *
+ * @param array|bool $args Plugin Install API arguments.
+ */
+ $args = apply_filters( "install_plugins_table_api_args_{$tab}", $args );
+
+ if ( ! $args ) {
+ return;
+ }
+
+ $api = plugins_api( 'query_plugins', $args );
+
+ if ( is_wp_error( $api ) ) {
+ $this->error = $api;
+ return;
+ }
+
+ $this->items = $api->plugins;
+
+ if ( $this->orderby ) {
+ uasort( $this->items, array( $this, 'order_callback' ) );
+ }
+
+ $this->set_pagination_args(
+ array(
+ 'total_items' => $api->info['results'],
+ 'per_page' => $args['per_page'],
+ )
+ );
+
+ if ( isset( $api->info['groups'] ) ) {
+ $this->groups = $api->info['groups'];
+ }
+
+ if ( $installed_plugins ) {
+ $js_plugins = array_fill_keys(
+ array( 'all', 'search', 'active', 'inactive', 'recently_activated', 'mustuse', 'dropins' ),
+ array()
+ );
+
+ $js_plugins['all'] = array_values( wp_list_pluck( $installed_plugins, 'plugin' ) );
+ $upgrade_plugins = wp_filter_object_list( $installed_plugins, array( 'upgrade' => true ), 'and', 'plugin' );
+
+ if ( $upgrade_plugins ) {
+ $js_plugins['upgrade'] = array_values( $upgrade_plugins );
+ }
+
+ wp_localize_script(
+ 'updates',
+ '_wpUpdatesItemCounts',
+ array(
+ 'plugins' => $js_plugins,
+ 'totals' => wp_get_update_data(),
+ )
+ );
+ }
+ }
+
+ /**
+ */
+ public function no_items() {
+ if ( isset( $this->error ) ) { ?>
+ <div class="inline error"><p><?php echo $this->error->get_error_message(); ?></p>
+ <p class="hide-if-no-js"><button class="button try-again"><?php _e( 'Try Again' ); ?></button></p>
+ </div>
+ <?php } else { ?>
+ <div class="no-plugin-results"><?php _e( 'No plugins found. Try a different search.' ); ?></div>
+ <?php
+ }
+ }
+
+ /**
+ * @global array $tabs
+ * @global string $tab
+ *
+ * @return array
+ */
+ protected function get_views() {
+ global $tabs, $tab;
+
+ $display_tabs = array();
+ foreach ( (array) $tabs as $action => $text ) {
+ $current_link_attributes = ( $action === $tab ) ? ' class="current" aria-current="page"' : '';
+ $href = self_admin_url( 'plugin-install.php?tab=' . $action );
+ $display_tabs[ 'plugin-install-' . $action ] = "<a href='$href'$current_link_attributes>$text</a>";
+ }
+ // No longer a real tab.
+ unset( $display_tabs['plugin-install-upload'] );
+
+ return $display_tabs;
+ }
+
+ /**
+ * Override parent views so we can use the filter bar display.
+ */
+ public function views() {
+ $views = $this->get_views();
+
+ /** This filter is documented in wp-admin/inclues/class-wp-list-table.php */
+ $views = apply_filters( "views_{$this->screen->id}", $views );
+
+ $this->screen->render_screen_reader_content( 'heading_views' );
+ ?>
+<div class="wp-filter">
+ <ul class="filter-links">
+ <?php
+ if ( ! empty( $views ) ) {
+ foreach ( $views as $class => $view ) {
+ $views[ $class ] = "\t<li class='$class'>$view";
+ }
+ echo implode( " </li>\n", $views ) . "</li>\n";
+ }
+ ?>
+ </ul>
+
+ <?php install_search_form(); ?>
+</div>
+ <?php
+ }
+
+ /**
+ * Override the parent display() so we can provide a different container.
+ */
+ public function display() {
+ $singular = $this->_args['singular'];
+
+ $data_attr = '';
+
+ if ( $singular ) {
+ $data_attr = " data-wp-lists='list:$singular'";
+ }
+
+ $this->display_tablenav( 'top' );
+
+ ?>
+<div class="wp-list-table <?php echo implode( ' ', $this->get_table_classes() ); ?>">
+ <?php
+ $this->screen->render_screen_reader_content( 'heading_list' );
+ ?>
+ <div id="the-list"<?php echo $data_attr; ?>>
+ <?php $this->display_rows_or_placeholder(); ?>
+ </div>
+</div>
+ <?php
+ $this->display_tablenav( 'bottom' );
+ }
+
+ /**
+ * @global string $tab
+ *
+ * @param string $which
+ */
+ protected function display_tablenav( $which ) {
+ if ( $GLOBALS['tab'] === 'featured' ) {
+ return;
+ }
+
+ if ( 'top' === $which ) {
+ wp_referer_field();
+ ?>
+ <div class="tablenav top">
+ <div class="alignleft actions">
+ <?php
+ /**
+ * Fires before the Plugin Install table header pagination is displayed.
+ *
+ * @since 2.7.0
+ */
+ do_action( 'install_plugins_table_header' );
+ ?>
+ </div>
+ <?php $this->pagination( $which ); ?>
+ <br class="clear" />
+ </div>
+ <?php } else { ?>
+ <div class="tablenav bottom">
+ <?php $this->pagination( $which ); ?>
+ <br class="clear" />
+ </div>
+ <?php
+ }
+ }
+
+ /**
+ * @return array
+ */
+ protected function get_table_classes() {
+ return array( 'widefat', $this->_args['plural'] );
+ }
+
+ /**
+ * @return array
+ */
+ public function get_columns() {
+ return array();
+ }
+
+ /**
+ * @param object $plugin_a
+ * @param object $plugin_b
+ * @return int
+ */
+ private function order_callback( $plugin_a, $plugin_b ) {
+ $orderby = $this->orderby;
+ if ( ! isset( $plugin_a->$orderby, $plugin_b->$orderby ) ) {
+ return 0;
+ }
+
+ $a = $plugin_a->$orderby;
+ $b = $plugin_b->$orderby;
+
+ if ( $a == $b ) {
+ return 0;
+ }
+
+ if ( 'DESC' === $this->order ) {
+ return ( $a < $b ) ? 1 : -1;
+ } else {
+ return ( $a < $b ) ? -1 : 1;
+ }
+ }
+
+ public function display_rows() {
+ $plugins_allowedtags = array(
+ 'a' => array(
+ 'href' => array(),
+ 'title' => array(),
+ 'target' => array(),
+ ),
+ 'abbr' => array( 'title' => array() ),
+ 'acronym' => array( 'title' => array() ),
+ 'code' => array(),
+ 'pre' => array(),
+ 'em' => array(),
+ 'strong' => array(),
+ 'ul' => array(),
+ 'ol' => array(),
+ 'li' => array(),
+ 'p' => array(),
+ 'br' => array(),
+ );
+
+ $plugins_group_titles = array(
+ 'Performance' => _x( 'Performance', 'Plugin installer group title' ),
+ 'Social' => _x( 'Social', 'Plugin installer group title' ),
+ 'Tools' => _x( 'Tools', 'Plugin installer group title' ),
+ );
+
+ $group = null;
+
+ foreach ( (array) $this->items as $plugin ) {
+ if ( is_object( $plugin ) ) {
+ $plugin = (array) $plugin;
+ }
+
+ // Display the group heading if there is one
+ if ( isset( $plugin['group'] ) && $plugin['group'] != $group ) {
+ if ( isset( $this->groups[ $plugin['group'] ] ) ) {
+ $group_name = $this->groups[ $plugin['group'] ];
+ if ( isset( $plugins_group_titles[ $group_name ] ) ) {
+ $group_name = $plugins_group_titles[ $group_name ];
+ }
+ } else {
+ $group_name = $plugin['group'];
+ }
+
+ // Starting a new group, close off the divs of the last one
+ if ( ! empty( $group ) ) {
+ echo '</div></div>';
+ }
+
+ echo '<div class="plugin-group"><h3>' . esc_html( $group_name ) . '</h3>';
+ // needs an extra wrapping div for nth-child selectors to work
+ echo '<div class="plugin-items">';
+
+ $group = $plugin['group'];
+ }
+ $title = wp_kses( $plugin['name'], $plugins_allowedtags );
+
+ // Remove any HTML from the description.
+ $description = strip_tags( $plugin['short_description'] );
+ $version = wp_kses( $plugin['version'], $plugins_allowedtags );
+
+ $name = strip_tags( $title . ' ' . $version );
+
+ $author = wp_kses( $plugin['author'], $plugins_allowedtags );
+ if ( ! empty( $author ) ) {
+ $author = ' <cite>' . sprintf( __( 'By %s' ), $author ) . '</cite>';
+ }
+
+ $requires_php = isset( $plugin['requires_php'] ) ? $plugin['requires_php'] : null;
+ $requires_wp = isset( $plugin['requires'] ) ? $plugin['requires'] : null;
+
+ $compatible_php = is_php_version_compatible( $requires_php );
+ $compatible_wp = is_wp_version_compatible( $requires_wp );
+ $tested_wp = ( empty( $plugin['tested'] ) || version_compare( get_bloginfo( 'version' ), $plugin['tested'], '<=' ) );
+
+ $action_links = array();
+
+ if ( current_user_can( 'install_plugins' ) || current_user_can( 'update_plugins' ) ) {
+ $status = install_plugin_install_status( $plugin );
+
+ switch ( $status['status'] ) {
+ case 'install':
+ if ( $status['url'] ) {
+ if ( $compatible_php && $compatible_wp ) {
+ $action_links[] = sprintf(
+ '<a class="install-now button" data-slug="%s" href="%s" aria-label="%s" data-name="%s">%s</a>',
+ esc_attr( $plugin['slug'] ),
+ esc_url( $status['url'] ),
+ /* translators: %s: plugin name and version */
+ esc_attr( sprintf( __( 'Install %s now' ), $name ) ),
+ esc_attr( $name ),
+ __( 'Install Now' )
+ );
+ } else {
+ $action_links[] = sprintf(
+ '<button type="button" class="button button-disabled" disabled="disabled">%s</button>',
+ _x( 'Cannot Install', 'plugin' )
+ );
+ }
+ }
+ break;
+
+ case 'update_available':
+ if ( $status['url'] ) {
+ if ( $compatible_php && $compatible_wp ) {
+ $action_links[] = sprintf(
+ '<a class="update-now button aria-button-if-js" data-plugin="%s" data-slug="%s" href="%s" aria-label="%s" data-name="%s">%s</a>',
+ esc_attr( $status['file'] ),
+ esc_attr( $plugin['slug'] ),
+ esc_url( $status['url'] ),
+ /* translators: %s: plugin name and version */
+ esc_attr( sprintf( __( 'Update %s now' ), $name ) ),
+ esc_attr( $name ),
+ __( 'Update Now' )
+ );
+ } else {
+ $action_links[] = sprintf(
+ '<button type="button" class="button button-disabled" disabled="disabled">%s</button>',
+ _x( 'Cannot Update', 'plugin' )
+ );
+ }
+ }
+ break;
+
+ case 'latest_installed':
+ case 'newer_installed':
+ if ( is_plugin_active( $status['file'] ) ) {
+ $action_links[] = sprintf(
+ '<button type="button" class="button button-disabled" disabled="disabled">%s</button>',
+ _x( 'Active', 'plugin' )
+ );
+ } elseif ( current_user_can( 'activate_plugin', $status['file'] ) ) {
+ $button_text = __( 'Activate' );
+ /* translators: %s: plugin name */
+ $button_label = _x( 'Activate %s', 'plugin' );
+ $activate_url = add_query_arg(
+ array(
+ '_wpnonce' => wp_create_nonce( 'activate-plugin_' . $status['file'] ),
+ 'action' => 'activate',
+ 'plugin' => $status['file'],
+ ),
+ network_admin_url( 'plugins.php' )
+ );
+
+ if ( is_network_admin() ) {
+ $button_text = __( 'Network Activate' );
+ /* translators: %s: plugin name */
+ $button_label = _x( 'Network Activate %s', 'plugin' );
+ $activate_url = add_query_arg( array( 'networkwide' => 1 ), $activate_url );
+ }
+
+ $action_links[] = sprintf(
+ '<a href="%1$s" class="button activate-now" aria-label="%2$s">%3$s</a>',
+ esc_url( $activate_url ),
+ esc_attr( sprintf( $button_label, $plugin['name'] ) ),
+ $button_text
+ );
+ } else {
+ $action_links[] = sprintf(
+ '<button type="button" class="button button-disabled" disabled="disabled">%s</button>',
+ _x( 'Installed', 'plugin' )
+ );
+ }
+ break;
+ }
+ }
+
+ $details_link = self_admin_url(
+ 'plugin-install.php?tab=plugin-information&amp;plugin=' . $plugin['slug'] .
+ '&amp;TB_iframe=true&amp;width=600&amp;height=550'
+ );
+
+ $action_links[] = sprintf(
+ '<a href="%s" class="thickbox open-plugin-details-modal" aria-label="%s" data-title="%s">%s</a>',
+ esc_url( $details_link ),
+ /* translators: %s: plugin name and version */
+ esc_attr( sprintf( __( 'More information about %s' ), $name ) ),
+ esc_attr( $name ),
+ __( 'More Details' )
+ );
+
+ if ( ! empty( $plugin['icons']['svg'] ) ) {
+ $plugin_icon_url = $plugin['icons']['svg'];
+ } elseif ( ! empty( $plugin['icons']['2x'] ) ) {
+ $plugin_icon_url = $plugin['icons']['2x'];
+ } elseif ( ! empty( $plugin['icons']['1x'] ) ) {
+ $plugin_icon_url = $plugin['icons']['1x'];
+ } else {
+ $plugin_icon_url = $plugin['icons']['default'];
+ }
+
+ /**
+ * Filters the install action links for a plugin.
+ *
+ * @since 2.7.0
+ *
+ * @param string[] $action_links An array of plugin action links. Defaults are links to Details and Install Now.
+ * @param array $plugin The plugin currently being listed.
+ */
+ $action_links = apply_filters( 'plugin_install_action_links', $action_links, $plugin );
+
+ $last_updated_timestamp = strtotime( $plugin['last_updated'] );
+ ?>
+ <div class="plugin-card plugin-card-<?php echo sanitize_html_class( $plugin['slug'] ); ?>">
+ <?php
+ if ( ! $compatible_php || ! $compatible_wp ) {
+ echo '<div class="notice inline notice-error notice-alt"><p>';
+ if ( ! $compatible_php && ! $compatible_wp ) {
+ _e( 'This plugin doesn&#8217;t work with your versions of WordPress and PHP.' );
+ if ( current_user_can( 'update_core' ) && current_user_can( 'update_php' ) ) {
+ printf(
+ /* translators: 1: "Update WordPress" screen URL, 2: "Update PHP" page URL */
+ ' ' . __( '<a href="%1$s">Please update WordPress</a>, and then <a href="%2$s">learn more about updating PHP</a>.' ),
+ self_admin_url( 'update-core.php' ),
+ esc_url( wp_get_update_php_url() )
+ );
+ wp_update_php_annotation( '</p><p><em>', '</em>' );
+ } elseif ( current_user_can( 'update_core' ) ) {
+ printf(
+ /* translators: %s: "Update WordPress" screen URL */
+ ' ' . __( '<a href="%s">Please update WordPress</a>.' ),
+ self_admin_url( 'update-core.php' )
+ );
+ } elseif ( current_user_can( 'update_php' ) ) {
+ printf(
+ /* translators: %s: "Update PHP" page URL */
+ ' ' . __( '<a href="%s">Learn more about updating PHP</a>.' ),
+ esc_url( wp_get_update_php_url() )
+ );
+ wp_update_php_annotation( '</p><p><em>', '</em>' );
+ }
+ } elseif ( ! $compatible_wp ) {
+ _e( 'This plugin doesn&#8217;t work with your version of WordPress.' );
+ if ( current_user_can( 'update_core' ) ) {
+ printf(
+ /* translators: %s: "Update WordPress" screen URL */
+ ' ' . __( '<a href="%s">Please update WordPress</a>.' ),
+ self_admin_url( 'update-core.php' )
+ );
+ }
+ } elseif ( ! $compatible_php ) {
+ _e( 'This plugin doesn&#8217;t work with your version of PHP.' );
+ if ( current_user_can( 'update_php' ) ) {
+ printf(
+ /* translators: %s: "Update PHP" page URL */
+ ' ' . __( '<a href="%s">Learn more about updating PHP</a>.' ),
+ esc_url( wp_get_update_php_url() )
+ );
+ wp_update_php_annotation( '</p><p><em>', '</em>' );
+ }
+ }
+ echo '</p></div>';
+ }
+ ?>
+ <div class="plugin-card-top">
+ <div class="name column-name">
+ <h3>
+ <a href="<?php echo esc_url( $details_link ); ?>" class="thickbox open-plugin-details-modal">
+ <?php echo $title; ?>
+ <img src="<?php echo esc_attr( $plugin_icon_url ); ?>" class="plugin-icon" alt="">
+ </a>
+ </h3>
+ </div>
+ <div class="action-links">
+ <?php
+ if ( $action_links ) {
+ echo '<ul class="plugin-action-buttons"><li>' . implode( '</li><li>', $action_links ) . '</li></ul>';
+ }
+ ?>
+ </div>
+ <div class="desc column-description">
+ <p><?php echo $description; ?></p>
+ <p class="authors"><?php echo $author; ?></p>
+ </div>
+ </div>
+ <div class="plugin-card-bottom">
+ <div class="vers column-rating">
+ <?php
+ wp_star_rating(
+ array(
+ 'rating' => $plugin['rating'],
+ 'type' => 'percent',
+ 'number' => $plugin['num_ratings'],
+ )
+ );
+ ?>
+ <span class="num-ratings" aria-hidden="true">(<?php echo number_format_i18n( $plugin['num_ratings'] ); ?>)</span>
+ </div>
+ <div class="column-updated">
+ <strong><?php _e( 'Last Updated:' ); ?></strong> <?php printf( __( '%s ago' ), human_time_diff( $last_updated_timestamp ) ); ?>
+ </div>
+ <div class="column-downloaded">
+ <?php
+ if ( $plugin['active_installs'] >= 1000000 ) {
+ $active_installs_millions = floor( $plugin['active_installs'] / 1000000 );
+ $active_installs_text = sprintf(
+ _nx( '%s+ Million', '%s+ Million', $active_installs_millions, 'Active plugin installations' ),
+ number_format_i18n( $active_installs_millions )
+ );
+ } elseif ( 0 == $plugin['active_installs'] ) {
+ $active_installs_text = _x( 'Less Than 10', 'Active plugin installations' );
+ } else {
+ $active_installs_text = number_format_i18n( $plugin['active_installs'] ) . '+';
+ }
+ printf( __( '%s Active Installations' ), $active_installs_text );
+ ?>
+ </div>
+ <div class="column-compatibility">
+ <?php
+ if ( ! $tested_wp ) {
+ echo '<span class="compatibility-untested">' . __( 'Untested with your version of WordPress' ) . '</span>';
+ } elseif ( ! $compatible_wp ) {
+ echo '<span class="compatibility-incompatible">' . __( '<strong>Incompatible</strong> with your version of WordPress' ) . '</span>';
+ } else {
+ echo '<span class="compatibility-compatible">' . __( '<strong>Compatible</strong> with your version of WordPress' ) . '</span>';
+ }
+ ?>
+ </div>
+ </div>
+ </div>
+ <?php
+ }
+
+ // Close off the group divs of the last one
+ if ( ! empty( $group ) ) {
+ echo '</div></div>';
+ }
+ }
+}
diff --git a/www/crm/wp-admin/includes/class-wp-plugins-list-table.php b/www/crm/wp-admin/includes/class-wp-plugins-list-table.php
new file mode 100644
index 00000000..92d1a945
--- /dev/null
+++ b/www/crm/wp-admin/includes/class-wp-plugins-list-table.php
@@ -0,0 +1,954 @@
+<?php
+/**
+ * List Table API: WP_Plugins_List_Table class
+ *
+ * @package WordPress
+ * @subpackage Administration
+ * @since 3.1.0
+ */
+
+/**
+ * Core class used to implement displaying installed plugins in a list table.
+ *
+ * @since 3.1.0
+ * @access private
+ *
+ * @see WP_List_Table
+ */
+class WP_Plugins_List_Table extends WP_List_Table {
+
+ /**
+ * Constructor.
+ *
+ * @since 3.1.0
+ *
+ * @see WP_List_Table::__construct() for more information on default arguments.
+ *
+ * @global string $status
+ * @global int $page
+ *
+ * @param array $args An associative array of arguments.
+ */
+ public function __construct( $args = array() ) {
+ global $status, $page;
+
+ parent::__construct(
+ array(
+ 'plural' => 'plugins',
+ 'screen' => isset( $args['screen'] ) ? $args['screen'] : null,
+ )
+ );
+
+ $status = 'all';
+ if ( isset( $_REQUEST['plugin_status'] ) && in_array( $_REQUEST['plugin_status'], array( 'active', 'inactive', 'recently_activated', 'upgrade', 'mustuse', 'dropins', 'search', 'paused' ) ) ) {
+ $status = $_REQUEST['plugin_status'];
+ }
+
+ if ( isset( $_REQUEST['s'] ) ) {
+ $_SERVER['REQUEST_URI'] = add_query_arg( 's', wp_unslash( $_REQUEST['s'] ) );
+ }
+
+ $page = $this->get_pagenum();
+ }
+
+ /**
+ * @return array
+ */
+ protected function get_table_classes() {
+ return array( 'widefat', $this->_args['plural'] );
+ }
+
+ /**
+ * @return bool
+ */
+ public function ajax_user_can() {
+ return current_user_can( 'activate_plugins' );
+ }
+
+ /**
+ * @global string $status
+ * @global array $plugins
+ * @global array $totals
+ * @global int $page
+ * @global string $orderby
+ * @global string $order
+ * @global string $s
+ */
+ public function prepare_items() {
+ global $status, $plugins, $totals, $page, $orderby, $order, $s;
+
+ wp_reset_vars( array( 'orderby', 'order' ) );
+
+ /**
+ * Filters the full array of plugins to list in the Plugins list table.
+ *
+ * @since 3.0.0
+ *
+ * @see get_plugins()
+ *
+ * @param array $all_plugins An array of plugins to display in the list table.
+ */
+ $all_plugins = apply_filters( 'all_plugins', get_plugins() );
+
+ $plugins = array(
+ 'all' => $all_plugins,
+ 'search' => array(),
+ 'active' => array(),
+ 'inactive' => array(),
+ 'recently_activated' => array(),
+ 'upgrade' => array(),
+ 'mustuse' => array(),
+ 'dropins' => array(),
+ 'paused' => array(),
+ );
+
+ $screen = $this->screen;
+
+ if ( ! is_multisite() || ( $screen->in_admin( 'network' ) && current_user_can( 'manage_network_plugins' ) ) ) {
+
+ /**
+ * Filters whether to display the advanced plugins list table.
+ *
+ * There are two types of advanced plugins - must-use and drop-ins -
+ * which can be used in a single site or Multisite network.
+ *
+ * The $type parameter allows you to differentiate between the type of advanced
+ * plugins to filter the display of. Contexts include 'mustuse' and 'dropins'.
+ *
+ * @since 3.0.0
+ *
+ * @param bool $show Whether to show the advanced plugins for the specified
+ * plugin type. Default true.
+ * @param string $type The plugin type. Accepts 'mustuse', 'dropins'.
+ */
+ if ( apply_filters( 'show_advanced_plugins', true, 'mustuse' ) ) {
+ $plugins['mustuse'] = get_mu_plugins();
+ }
+
+ /** This action is documented in wp-admin/includes/class-wp-plugins-list-table.php */
+ if ( apply_filters( 'show_advanced_plugins', true, 'dropins' ) ) {
+ $plugins['dropins'] = get_dropins();
+ }
+
+ if ( current_user_can( 'update_plugins' ) ) {
+ $current = get_site_transient( 'update_plugins' );
+ foreach ( (array) $plugins['all'] as $plugin_file => $plugin_data ) {
+ if ( isset( $current->response[ $plugin_file ] ) ) {
+ $plugins['all'][ $plugin_file ]['update'] = true;
+ $plugins['upgrade'][ $plugin_file ] = $plugins['all'][ $plugin_file ];
+ }
+ }
+ }
+ }
+
+ if ( ! $screen->in_admin( 'network' ) ) {
+ $show = current_user_can( 'manage_network_plugins' );
+ /**
+ * Filters whether to display network-active plugins alongside plugins active for the current site.
+ *
+ * This also controls the display of inactive network-only plugins (plugins with
+ * "Network: true" in the plugin header).
+ *
+ * Plugins cannot be network-activated or network-deactivated from this screen.
+ *
+ * @since 4.4.0
+ *
+ * @param bool $show Whether to show network-active plugins. Default is whether the current
+ * user can manage network plugins (ie. a Super Admin).
+ */
+ $show_network_active = apply_filters( 'show_network_active_plugins', $show );
+ }
+
+ set_transient( 'plugin_slugs', array_keys( $plugins['all'] ), DAY_IN_SECONDS );
+
+ if ( $screen->in_admin( 'network' ) ) {
+ $recently_activated = get_site_option( 'recently_activated', array() );
+ } else {
+ $recently_activated = get_option( 'recently_activated', array() );
+ }
+
+ foreach ( $recently_activated as $key => $time ) {
+ if ( $time + WEEK_IN_SECONDS < time() ) {
+ unset( $recently_activated[ $key ] );
+ }
+ }
+
+ if ( $screen->in_admin( 'network' ) ) {
+ update_site_option( 'recently_activated', $recently_activated );
+ } else {
+ update_option( 'recently_activated', $recently_activated );
+ }
+
+ $plugin_info = get_site_transient( 'update_plugins' );
+
+ foreach ( (array) $plugins['all'] as $plugin_file => $plugin_data ) {
+ // Extra info if known. array_merge() ensures $plugin_data has precedence if keys collide.
+ if ( isset( $plugin_info->response[ $plugin_file ] ) ) {
+ $plugin_data = array_merge( (array) $plugin_info->response[ $plugin_file ], $plugin_data );
+ $plugins['all'][ $plugin_file ] = $plugin_data;
+ // Make sure that $plugins['upgrade'] also receives the extra info since it is used on ?plugin_status=upgrade
+ if ( isset( $plugins['upgrade'][ $plugin_file ] ) ) {
+ $plugins['upgrade'][ $plugin_file ] = $plugin_data;
+ }
+ } elseif ( isset( $plugin_info->no_update[ $plugin_file ] ) ) {
+ $plugin_data = array_merge( (array) $plugin_info->no_update[ $plugin_file ], $plugin_data );
+ $plugins['all'][ $plugin_file ] = $plugin_data;
+ // Make sure that $plugins['upgrade'] also receives the extra info since it is used on ?plugin_status=upgrade
+ if ( isset( $plugins['upgrade'][ $plugin_file ] ) ) {
+ $plugins['upgrade'][ $plugin_file ] = $plugin_data;
+ }
+ }
+
+ // Filter into individual sections
+ if ( is_multisite() && ! $screen->in_admin( 'network' ) && is_network_only_plugin( $plugin_file ) && ! is_plugin_active( $plugin_file ) ) {
+ if ( $show_network_active ) {
+ // On the non-network screen, show inactive network-only plugins if allowed
+ $plugins['inactive'][ $plugin_file ] = $plugin_data;
+ } else {
+ // On the non-network screen, filter out network-only plugins as long as they're not individually active
+ unset( $plugins['all'][ $plugin_file ] );
+ }
+ } elseif ( ! $screen->in_admin( 'network' ) && is_plugin_active_for_network( $plugin_file ) ) {
+ if ( $show_network_active ) {
+ // On the non-network screen, show network-active plugins if allowed
+ $plugins['active'][ $plugin_file ] = $plugin_data;
+ } else {
+ // On the non-network screen, filter out network-active plugins
+ unset( $plugins['all'][ $plugin_file ] );
+ }
+ } elseif ( ( ! $screen->in_admin( 'network' ) && is_plugin_active( $plugin_file ) )
+ || ( $screen->in_admin( 'network' ) && is_plugin_active_for_network( $plugin_file ) ) ) {
+ // On the non-network screen, populate the active list with plugins that are individually activated
+ // On the network-admin screen, populate the active list with plugins that are network activated
+ $plugins['active'][ $plugin_file ] = $plugin_data;
+
+ if ( ! $screen->in_admin( 'network' ) && is_plugin_paused( $plugin_file ) ) {
+ $plugins['paused'][ $plugin_file ] = $plugin_data;
+ }
+ } else {
+ if ( isset( $recently_activated[ $plugin_file ] ) ) {
+ // Populate the recently activated list with plugins that have been recently activated
+ $plugins['recently_activated'][ $plugin_file ] = $plugin_data;
+ }
+ // Populate the inactive list with plugins that aren't activated
+ $plugins['inactive'][ $plugin_file ] = $plugin_data;
+ }
+ }
+
+ if ( strlen( $s ) ) {
+ $status = 'search';
+ $plugins['search'] = array_filter( $plugins['all'], array( $this, '_search_callback' ) );
+ }
+
+ $totals = array();
+ foreach ( $plugins as $type => $list ) {
+ $totals[ $type ] = count( $list );
+ }
+
+ if ( empty( $plugins[ $status ] ) && ! in_array( $status, array( 'all', 'search' ) ) ) {
+ $status = 'all';
+ }
+
+ $this->items = array();
+ foreach ( $plugins[ $status ] as $plugin_file => $plugin_data ) {
+ // Translate, Don't Apply Markup, Sanitize HTML
+ $this->items[ $plugin_file ] = _get_plugin_data_markup_translate( $plugin_file, $plugin_data, false, true );
+ }
+
+ $total_this_page = $totals[ $status ];
+
+ $js_plugins = array();
+ foreach ( $plugins as $key => $list ) {
+ $js_plugins[ $key ] = array_keys( (array) $list );
+ }
+
+ wp_localize_script(
+ 'updates',
+ '_wpUpdatesItemCounts',
+ array(
+ 'plugins' => $js_plugins,
+ 'totals' => wp_get_update_data(),
+ )
+ );
+
+ if ( ! $orderby ) {
+ $orderby = 'Name';
+ } else {
+ $orderby = ucfirst( $orderby );
+ }
+
+ $order = strtoupper( $order );
+
+ uasort( $this->items, array( $this, '_order_callback' ) );
+
+ $plugins_per_page = $this->get_items_per_page( str_replace( '-', '_', $screen->id . '_per_page' ), 999 );
+
+ $start = ( $page - 1 ) * $plugins_per_page;
+
+ if ( $total_this_page > $plugins_per_page ) {
+ $this->items = array_slice( $this->items, $start, $plugins_per_page );
+ }
+
+ $this->set_pagination_args(
+ array(
+ 'total_items' => $total_this_page,
+ 'per_page' => $plugins_per_page,
+ )
+ );
+ }
+
+ /**
+ * @global string $s URL encoded search term.
+ *
+ * @param array $plugin
+ * @return bool
+ */
+ public function _search_callback( $plugin ) {
+ global $s;
+
+ foreach ( $plugin as $value ) {
+ if ( is_string( $value ) && false !== stripos( strip_tags( $value ), urldecode( $s ) ) ) {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ /**
+ * @global string $orderby
+ * @global string $order
+ * @param array $plugin_a
+ * @param array $plugin_b
+ * @return int
+ */
+ public function _order_callback( $plugin_a, $plugin_b ) {
+ global $orderby, $order;
+
+ $a = $plugin_a[ $orderby ];
+ $b = $plugin_b[ $orderby ];
+
+ if ( $a == $b ) {
+ return 0;
+ }
+
+ if ( 'DESC' === $order ) {
+ return strcasecmp( $b, $a );
+ } else {
+ return strcasecmp( $a, $b );
+ }
+ }
+
+ /**
+ * @global array $plugins
+ */
+ public function no_items() {
+ global $plugins;
+
+ if ( ! empty( $_REQUEST['s'] ) ) {
+ $s = esc_html( wp_unslash( $_REQUEST['s'] ) );
+
+ /* translators: %s: plugin search term */
+ printf( __( 'No plugins found for &#8220;%s&#8221;.' ), $s );
+
+ // We assume that somebody who can install plugins in multisite is experienced enough to not need this helper link.
+ if ( ! is_multisite() && current_user_can( 'install_plugins' ) ) {
+ echo ' <a href="' . esc_url( admin_url( 'plugin-install.php?tab=search&s=' . urlencode( $s ) ) ) . '">' . __( 'Search for plugins in the WordPress Plugin Directory.' ) . '</a>';
+ }
+ } elseif ( ! empty( $plugins['all'] ) ) {
+ _e( 'No plugins found.' );
+ } else {
+ _e( 'You do not appear to have any plugins available at this time.' );
+ }
+ }
+
+ /**
+ * Displays the search box.
+ *
+ * @since 4.6.0
+ *
+ * @param string $text The 'submit' button label.
+ * @param string $input_id ID attribute value for the search input field.
+ */
+ public function search_box( $text, $input_id ) {
+ if ( empty( $_REQUEST['s'] ) && ! $this->has_items() ) {
+ return;
+ }
+
+ $input_id = $input_id . '-search-input';
+
+ if ( ! empty( $_REQUEST['orderby'] ) ) {
+ echo '<input type="hidden" name="orderby" value="' . esc_attr( $_REQUEST['orderby'] ) . '" />';
+ }
+ if ( ! empty( $_REQUEST['order'] ) ) {
+ echo '<input type="hidden" name="order" value="' . esc_attr( $_REQUEST['order'] ) . '" />';
+ }
+ ?>
+ <p class="search-box">
+ <label class="screen-reader-text" for="<?php echo esc_attr( $input_id ); ?>"><?php echo $text; ?>:</label>
+ <input type="search" id="<?php echo esc_attr( $input_id ); ?>" class="wp-filter-search" name="s" value="<?php _admin_search_query(); ?>" placeholder="<?php esc_attr_e( 'Search installed plugins...' ); ?>"/>
+ <?php submit_button( $text, 'hide-if-js', '', false, array( 'id' => 'search-submit' ) ); ?>
+ </p>
+ <?php
+ }
+
+ /**
+ * @global string $status
+ * @return array
+ */
+ public function get_columns() {
+ global $status;
+
+ return array(
+ 'cb' => ! in_array( $status, array( 'mustuse', 'dropins' ) ) ? '<input type="checkbox" />' : '',
+ 'name' => __( 'Plugin' ),
+ 'description' => __( 'Description' ),
+ );
+ }
+
+ /**
+ * @return array
+ */
+ protected function get_sortable_columns() {
+ return array();
+ }
+
+ /**
+ * @global array $totals
+ * @global string $status
+ * @return array
+ */
+ protected function get_views() {
+ global $totals, $status;
+
+ $status_links = array();
+ foreach ( $totals as $type => $count ) {
+ if ( ! $count ) {
+ continue;
+ }
+
+ switch ( $type ) {
+ case 'all':
+ /* translators: %s: plugin count */
+ $text = _nx( 'All <span class="count">(%s)</span>', 'All <span class="count">(%s)</span>', $count, 'plugins' );
+ break;
+ case 'active':
+ /* translators: %s: plugin count */
+ $text = _n( 'Active <span class="count">(%s)</span>', 'Active <span class="count">(%s)</span>', $count );
+ break;
+ case 'recently_activated':
+ /* translators: %s: plugin count */
+ $text = _n( 'Recently Active <span class="count">(%s)</span>', 'Recently Active <span class="count">(%s)</span>', $count );
+ break;
+ case 'inactive':
+ /* translators: %s: plugin count */
+ $text = _n( 'Inactive <span class="count">(%s)</span>', 'Inactive <span class="count">(%s)</span>', $count );
+ break;
+ case 'mustuse':
+ /* translators: %s: plugin count */
+ $text = _n( 'Must-Use <span class="count">(%s)</span>', 'Must-Use <span class="count">(%s)</span>', $count );
+ break;
+ case 'dropins':
+ /* translators: %s: plugin count */
+ $text = _n( 'Drop-in <span class="count">(%s)</span>', 'Drop-ins <span class="count">(%s)</span>', $count );
+ break;
+ case 'paused':
+ /* translators: %s: plugin count */
+ $text = _n( 'Paused <span class="count">(%s)</span>', 'Paused <span class="count">(%s)</span>', $count );
+ break;
+ case 'upgrade':
+ /* translators: %s: plugin count */
+ $text = _n( 'Update Available <span class="count">(%s)</span>', 'Update Available <span class="count">(%s)</span>', $count );
+ break;
+ }
+
+ if ( 'search' !== $type ) {
+ $status_links[ $type ] = sprintf(
+ "<a href='%s'%s>%s</a>",
+ add_query_arg( 'plugin_status', $type, 'plugins.php' ),
+ ( $type === $status ) ? ' class="current" aria-current="page"' : '',
+ sprintf( $text, number_format_i18n( $count ) )
+ );
+ }
+ }
+
+ return $status_links;
+ }
+
+ /**
+ * @global string $status
+ * @return array
+ */
+ protected function get_bulk_actions() {
+ global $status;
+
+ $actions = array();
+
+ if ( 'active' != $status ) {
+ $actions['activate-selected'] = $this->screen->in_admin( 'network' ) ? __( 'Network Activate' ) : __( 'Activate' );
+ }
+
+ if ( 'inactive' != $status && 'recent' != $status ) {
+ $actions['deactivate-selected'] = $this->screen->in_admin( 'network' ) ? __( 'Network Deactivate' ) : __( 'Deactivate' );
+ }
+
+ if ( ! is_multisite() || $this->screen->in_admin( 'network' ) ) {
+ if ( current_user_can( 'update_plugins' ) ) {
+ $actions['update-selected'] = __( 'Update' );
+ }
+ if ( current_user_can( 'delete_plugins' ) && ( 'active' != $status ) ) {
+ $actions['delete-selected'] = __( 'Delete' );
+ }
+ }
+
+ return $actions;
+ }
+
+ /**
+ * @global string $status
+ * @param string $which
+ */
+ public function bulk_actions( $which = '' ) {
+ global $status;
+
+ if ( in_array( $status, array( 'mustuse', 'dropins' ) ) ) {
+ return;
+ }
+
+ parent::bulk_actions( $which );
+ }
+
+ /**
+ * @global string $status
+ * @param string $which
+ */
+ protected function extra_tablenav( $which ) {
+ global $status;
+
+ if ( ! in_array( $status, array( 'recently_activated', 'mustuse', 'dropins' ) ) ) {
+ return;
+ }
+
+ echo '<div class="alignleft actions">';
+
+ if ( 'recently_activated' == $status ) {
+ submit_button( __( 'Clear List' ), '', 'clear-recent-list', false );
+ } elseif ( 'top' === $which && 'mustuse' === $status ) {
+ echo '<p>' . sprintf(
+ /* translators: %s: mu-plugins directory name */
+ __( 'Files in the %s directory are executed automatically.' ),
+ '<code>' . str_replace( ABSPATH, '/', WPMU_PLUGIN_DIR ) . '</code>'
+ ) . '</p>';
+ } elseif ( 'top' === $which && 'dropins' === $status ) {
+ echo '<p>' . sprintf(
+ /* translators: %s: wp-content directory name */
+ __( 'Drop-ins are advanced plugins in the %s directory that replace WordPress functionality when present.' ),
+ '<code>' . str_replace( ABSPATH, '', WP_CONTENT_DIR ) . '</code>'
+ ) . '</p>';
+ }
+ echo '</div>';
+ }
+
+ /**
+ * @return string
+ */
+ public function current_action() {
+ if ( isset( $_POST['clear-recent-list'] ) ) {
+ return 'clear-recent-list';
+ }
+
+ return parent::current_action();
+ }
+
+ /**
+ * @global string $status
+ */
+ public function display_rows() {
+ global $status;
+
+ if ( is_multisite() && ! $this->screen->in_admin( 'network' ) && in_array( $status, array( 'mustuse', 'dropins' ) ) ) {
+ return;
+ }
+
+ foreach ( $this->items as $plugin_file => $plugin_data ) {
+ $this->single_row( array( $plugin_file, $plugin_data ) );
+ }
+ }
+
+ /**
+ * @global string $status
+ * @global int $page
+ * @global string $s
+ * @global array $totals
+ *
+ * @param array $item
+ */
+ public function single_row( $item ) {
+ global $status, $page, $s, $totals;
+
+ list( $plugin_file, $plugin_data ) = $item;
+ $context = $status;
+ $screen = $this->screen;
+
+ // Pre-order.
+ $actions = array(
+ 'deactivate' => '',
+ 'activate' => '',
+ 'details' => '',
+ 'delete' => '',
+ );
+
+ // Do not restrict by default
+ $restrict_network_active = false;
+ $restrict_network_only = false;
+
+ if ( 'mustuse' === $context ) {
+ $is_active = true;
+ } elseif ( 'dropins' === $context ) {
+ $dropins = _get_dropins();
+ $plugin_name = $plugin_file;
+ if ( $plugin_file != $plugin_data['Name'] ) {
+ $plugin_name .= '<br/>' . $plugin_data['Name'];
+ }
+ if ( true === ( $dropins[ $plugin_file ][1] ) ) { // Doesn't require a constant
+ $is_active = true;
+ $description = '<p><strong>' . $dropins[ $plugin_file ][0] . '</strong></p>';
+ } elseif ( defined( $dropins[ $plugin_file ][1] ) && constant( $dropins[ $plugin_file ][1] ) ) { // Constant is true
+ $is_active = true;
+ $description = '<p><strong>' . $dropins[ $plugin_file ][0] . '</strong></p>';
+ } else {
+ $is_active = false;
+ $description = '<p><strong>' . $dropins[ $plugin_file ][0] . ' <span class="error-message">' . __( 'Inactive:' ) . '</span></strong> ' .
+ sprintf(
+ /* translators: 1: drop-in constant name, 2: wp-config.php */
+ __( 'Requires %1$s in %2$s file.' ),
+ "<code>define('" . $dropins[ $plugin_file ][1] . "', true);</code>",
+ '<code>wp-config.php</code>'
+ ) . '</p>';
+ }
+ if ( $plugin_data['Description'] ) {
+ $description .= '<p>' . $plugin_data['Description'] . '</p>';
+ }
+ } else {
+ if ( $screen->in_admin( 'network' ) ) {
+ $is_active = is_plugin_active_for_network( $plugin_file );
+ } else {
+ $is_active = is_plugin_active( $plugin_file );
+ $restrict_network_active = ( is_multisite() && is_plugin_active_for_network( $plugin_file ) );
+ $restrict_network_only = ( is_multisite() && is_network_only_plugin( $plugin_file ) && ! $is_active );
+ }
+
+ if ( $screen->in_admin( 'network' ) ) {
+ if ( $is_active ) {
+ if ( current_user_can( 'manage_network_plugins' ) ) {
+ /* translators: %s: plugin name */
+ $actions['deactivate'] = '<a href="' . wp_nonce_url( 'plugins.php?action=deactivate&amp;plugin=' . urlencode( $plugin_file ) . '&amp;plugin_status=' . $context . '&amp;paged=' . $page . '&amp;s=' . $s, 'deactivate-plugin_' . $plugin_file ) . '" aria-label="' . esc_attr( sprintf( _x( 'Network Deactivate %s', 'plugin' ), $plugin_data['Name'] ) ) . '">' . __( 'Network Deactivate' ) . '</a>';
+ }
+ } else {
+ if ( current_user_can( 'manage_network_plugins' ) ) {
+ /* translators: %s: plugin name */
+ $actions['activate'] = '<a href="' . wp_nonce_url( 'plugins.php?action=activate&amp;plugin=' . urlencode( $plugin_file ) . '&amp;plugin_status=' . $context . '&amp;paged=' . $page . '&amp;s=' . $s, 'activate-plugin_' . $plugin_file ) . '" class="edit" aria-label="' . esc_attr( sprintf( _x( 'Network Activate %s', 'plugin' ), $plugin_data['Name'] ) ) . '">' . __( 'Network Activate' ) . '</a>';
+ }
+ if ( current_user_can( 'delete_plugins' ) && ! is_plugin_active( $plugin_file ) ) {
+ /* translators: %s: plugin name */
+ $actions['delete'] = '<a href="' . wp_nonce_url( 'plugins.php?action=delete-selected&amp;checked[]=' . urlencode( $plugin_file ) . '&amp;plugin_status=' . $context . '&amp;paged=' . $page . '&amp;s=' . $s, 'bulk-plugins' ) . '" class="delete" aria-label="' . esc_attr( sprintf( _x( 'Delete %s', 'plugin' ), $plugin_data['Name'] ) ) . '">' . __( 'Delete' ) . '</a>';
+ }
+ }
+ } else {
+ if ( $restrict_network_active ) {
+ $actions = array(
+ 'network_active' => __( 'Network Active' ),
+ );
+ } elseif ( $restrict_network_only ) {
+ $actions = array(
+ 'network_only' => __( 'Network Only' ),
+ );
+ } elseif ( $is_active ) {
+ if ( current_user_can( 'deactivate_plugin', $plugin_file ) ) {
+ /* translators: %s: plugin name */
+ $actions['deactivate'] = '<a href="' . wp_nonce_url( 'plugins.php?action=deactivate&amp;plugin=' . urlencode( $plugin_file ) . '&amp;plugin_status=' . $context . '&amp;paged=' . $page . '&amp;s=' . $s, 'deactivate-plugin_' . $plugin_file ) . '" aria-label="' . esc_attr( sprintf( _x( 'Deactivate %s', 'plugin' ), $plugin_data['Name'] ) ) . '">' . __( 'Deactivate' ) . '</a>';
+ }
+ if ( current_user_can( 'resume_plugin', $plugin_file ) && is_plugin_paused( $plugin_file ) ) {
+ /* translators: %s: plugin name */
+ $actions['resume'] = '<a class="resume-link" href="' . wp_nonce_url( 'plugins.php?action=resume&amp;plugin=' . urlencode( $plugin_file ) . '&amp;plugin_status=' . $context . '&amp;paged=' . $page . '&amp;s=' . $s, 'resume-plugin_' . $plugin_file ) . '" aria-label="' . esc_attr( sprintf( _x( 'Resume %s', 'plugin' ), $plugin_data['Name'] ) ) . '">' . __( 'Resume' ) . '</a>';
+ }
+ } else {
+ if ( current_user_can( 'activate_plugin', $plugin_file ) ) {
+ /* translators: %s: plugin name */
+ $actions['activate'] = '<a href="' . wp_nonce_url( 'plugins.php?action=activate&amp;plugin=' . urlencode( $plugin_file ) . '&amp;plugin_status=' . $context . '&amp;paged=' . $page . '&amp;s=' . $s, 'activate-plugin_' . $plugin_file ) . '" class="edit" aria-label="' . esc_attr( sprintf( _x( 'Activate %s', 'plugin' ), $plugin_data['Name'] ) ) . '">' . __( 'Activate' ) . '</a>';
+ }
+
+ if ( ! is_multisite() && current_user_can( 'delete_plugins' ) ) {
+ /* translators: %s: plugin name */
+ $actions['delete'] = '<a href="' . wp_nonce_url( 'plugins.php?action=delete-selected&amp;checked[]=' . urlencode( $plugin_file ) . '&amp;plugin_status=' . $context . '&amp;paged=' . $page . '&amp;s=' . $s, 'bulk-plugins' ) . '" class="delete" aria-label="' . esc_attr( sprintf( _x( 'Delete %s', 'plugin' ), $plugin_data['Name'] ) ) . '">' . __( 'Delete' ) . '</a>';
+ }
+ } // end if $is_active
+ } // end if $screen->in_admin( 'network' )
+ } // end if $context
+
+ $actions = array_filter( $actions );
+
+ if ( $screen->in_admin( 'network' ) ) {
+
+ /**
+ * Filters the action links displayed for each plugin in the Network Admin Plugins list table.
+ *
+ * @since 3.1.0
+ *
+ * @param string[] $actions An array of plugin action links. By default this can include 'activate',
+ * 'deactivate', and 'delete'.
+ * @param string $plugin_file Path to the plugin file relative to the plugins directory.
+ * @param array $plugin_data An array of plugin data. See `get_plugin_data()`.
+ * @param string $context The plugin context. By default this can include 'all', 'active', 'inactive',
+ * 'recently_activated', 'upgrade', 'mustuse', 'dropins', and 'search'.
+ */
+ $actions = apply_filters( 'network_admin_plugin_action_links', $actions, $plugin_file, $plugin_data, $context );
+
+ /**
+ * Filters the list of action links displayed for a specific plugin in the Network Admin Plugins list table.
+ *
+ * The dynamic portion of the hook name, `$plugin_file`, refers to the path
+ * to the plugin file, relative to the plugins directory.
+ *
+ * @since 3.1.0
+ *
+ * @param string[] $actions An array of plugin action links. By default this can include 'activate',
+ * 'deactivate', and 'delete'.
+ * @param string $plugin_file Path to the plugin file relative to the plugins directory.
+ * @param array $plugin_data An array of plugin data. See `get_plugin_data()`.
+ * @param string $context The plugin context. By default this can include 'all', 'active', 'inactive',
+ * 'recently_activated', 'upgrade', 'mustuse', 'dropins', and 'search'.
+ */
+ $actions = apply_filters( "network_admin_plugin_action_links_{$plugin_file}", $actions, $plugin_file, $plugin_data, $context );
+
+ } else {
+
+ /**
+ * Filters the action links displayed for each plugin in the Plugins list table.
+ *
+ * @since 2.5.0
+ * @since 2.6.0 The `$context` parameter was added.
+ * @since 4.9.0 The 'Edit' link was removed from the list of action links.
+ *
+ * @param string[] $actions An array of plugin action links. By default this can include 'activate',
+ * 'deactivate', and 'delete'. With Multisite active this can also include
+ * 'network_active' and 'network_only' items.
+ * @param string $plugin_file Path to the plugin file relative to the plugins directory.
+ * @param array $plugin_data An array of plugin data. See `get_plugin_data()`.
+ * @param string $context The plugin context. By default this can include 'all', 'active', 'inactive',
+ * 'recently_activated', 'upgrade', 'mustuse', 'dropins', and 'search'.
+ */
+ $actions = apply_filters( 'plugin_action_links', $actions, $plugin_file, $plugin_data, $context );
+
+ /**
+ * Filters the list of action links displayed for a specific plugin in the Plugins list table.
+ *
+ * The dynamic portion of the hook name, `$plugin_file`, refers to the path
+ * to the plugin file, relative to the plugins directory.
+ *
+ * @since 2.7.0
+ * @since 4.9.0 The 'Edit' link was removed from the list of action links.
+ *
+ * @param string[] $actions An array of plugin action links. By default this can include 'activate',
+ * 'deactivate', and 'delete'. With Multisite active this can also include
+ * 'network_active' and 'network_only' items.
+ * @param string $plugin_file Path to the plugin file relative to the plugins directory.
+ * @param array $plugin_data An array of plugin data. See `get_plugin_data()`.
+ * @param string $context The plugin context. By default this can include 'all', 'active', 'inactive',
+ * 'recently_activated', 'upgrade', 'mustuse', 'dropins', and 'search'.
+ */
+ $actions = apply_filters( "plugin_action_links_{$plugin_file}", $actions, $plugin_file, $plugin_data, $context );
+
+ }
+
+ $requires_php = isset( $plugin_data['requires_php'] ) ? $plugin_data['requires_php'] : null;
+ $compatible_php = is_php_version_compatible( $requires_php );
+ $class = $is_active ? 'active' : 'inactive';
+ $checkbox_id = 'checkbox_' . md5( $plugin_data['Name'] );
+ if ( $restrict_network_active || $restrict_network_only || in_array( $status, array( 'mustuse', 'dropins' ) ) || ! $compatible_php ) {
+ $checkbox = '';
+ } else {
+ /* translators: %s: plugin name */
+ $checkbox = "<label class='screen-reader-text' for='" . $checkbox_id . "' >" . sprintf( __( 'Select %s' ), $plugin_data['Name'] ) . '</label>'
+ . "<input type='checkbox' name='checked[]' value='" . esc_attr( $plugin_file ) . "' id='" . $checkbox_id . "' />";
+ }
+ if ( 'dropins' != $context ) {
+ $description = '<p>' . ( $plugin_data['Description'] ? $plugin_data['Description'] : '&nbsp;' ) . '</p>';
+ $plugin_name = $plugin_data['Name'];
+ }
+
+ if ( ! empty( $totals['upgrade'] ) && ! empty( $plugin_data['update'] ) ) {
+ $class .= ' update';
+ }
+
+ $paused = ! $screen->in_admin( 'network' ) && is_plugin_paused( $plugin_file );
+
+ if ( $paused ) {
+ $class .= ' paused';
+ }
+
+ $plugin_slug = isset( $plugin_data['slug'] ) ? $plugin_data['slug'] : sanitize_title( $plugin_name );
+ printf(
+ '<tr class="%s" data-slug="%s" data-plugin="%s">',
+ esc_attr( $class ),
+ esc_attr( $plugin_slug ),
+ esc_attr( $plugin_file )
+ );
+
+ list( $columns, $hidden, $sortable, $primary ) = $this->get_column_info();
+
+ foreach ( $columns as $column_name => $column_display_name ) {
+ $extra_classes = '';
+ if ( in_array( $column_name, $hidden ) ) {
+ $extra_classes = ' hidden';
+ }
+
+ switch ( $column_name ) {
+ case 'cb':
+ echo "<th scope='row' class='check-column'>$checkbox</th>";
+ break;
+ case 'name':
+ echo "<td class='plugin-title column-primary'><strong>$plugin_name</strong>";
+ echo $this->row_actions( $actions, true );
+ echo '</td>';
+ break;
+ case 'description':
+ $classes = 'column-description desc';
+
+ echo "<td class='$classes{$extra_classes}'>
+ <div class='plugin-description'>$description</div>
+ <div class='$class second plugin-version-author-uri'>";
+
+ $plugin_meta = array();
+ if ( ! empty( $plugin_data['Version'] ) ) {
+ /* translators: %s: plugin version number */
+ $plugin_meta[] = sprintf( __( 'Version %s' ), $plugin_data['Version'] );
+ }
+ if ( ! empty( $plugin_data['Author'] ) ) {
+ $author = $plugin_data['Author'];
+ if ( ! empty( $plugin_data['AuthorURI'] ) ) {
+ $author = '<a href="' . $plugin_data['AuthorURI'] . '">' . $plugin_data['Author'] . '</a>';
+ }
+ /* translators: %s: plugin version number */
+ $plugin_meta[] = sprintf( __( 'By %s' ), $author );
+ }
+
+ // Details link using API info, if available
+ if ( isset( $plugin_data['slug'] ) && current_user_can( 'install_plugins' ) ) {
+ $plugin_meta[] = sprintf(
+ '<a href="%s" class="thickbox open-plugin-details-modal" aria-label="%s" data-title="%s">%s</a>',
+ esc_url(
+ network_admin_url(
+ 'plugin-install.php?tab=plugin-information&plugin=' . $plugin_data['slug'] .
+ '&TB_iframe=true&width=600&height=550'
+ )
+ ),
+ /* translators: %s: plugin name */
+ esc_attr( sprintf( __( 'More information about %s' ), $plugin_name ) ),
+ esc_attr( $plugin_name ),
+ __( 'View details' )
+ );
+ } elseif ( ! empty( $plugin_data['PluginURI'] ) ) {
+ $plugin_meta[] = sprintf(
+ '<a href="%s">%s</a>',
+ esc_url( $plugin_data['PluginURI'] ),
+ __( 'Visit plugin site' )
+ );
+ }
+
+ /**
+ * Filters the array of row meta for each plugin in the Plugins list table.
+ *
+ * @since 2.8.0
+ *
+ * @param string[] $plugin_meta An array of the plugin's metadata,
+ * including the version, author,
+ * author URI, and plugin URI.
+ * @param string $plugin_file Path to the plugin file relative to the plugins directory.
+ * @param array $plugin_data An array of plugin data.
+ * @param string $status Status of the plugin. Defaults are 'All', 'Active',
+ * 'Inactive', 'Recently Activated', 'Upgrade', 'Must-Use',
+ * 'Drop-ins', 'Search', 'Paused'.
+ */
+ $plugin_meta = apply_filters( 'plugin_row_meta', $plugin_meta, $plugin_file, $plugin_data, $status );
+ echo implode( ' | ', $plugin_meta );
+
+ echo '</div>';
+
+ if ( $paused ) {
+ $notice_text = __( 'This plugin failed to load properly and is paused during recovery mode.' );
+
+ printf( '<p><span class="dashicons dashicons-warning"></span> <strong>%s</strong></p>', $notice_text );
+
+ $error = wp_get_plugin_error( $plugin_file );
+
+ if ( false !== $error ) {
+ printf( '<div class="error-display"><p>%s</p></div>', wp_get_extension_error_description( $error ) );
+ }
+ }
+
+ echo '</td>';
+ break;
+ default:
+ $classes = "$column_name column-$column_name $class";
+
+ echo "<td class='$classes{$extra_classes}'>";
+
+ /**
+ * Fires inside each custom column of the Plugins list table.
+ *
+ * @since 3.1.0
+ *
+ * @param string $column_name Name of the column.
+ * @param string $plugin_file Path to the plugin file relative to the plugins directory.
+ * @param array $plugin_data An array of plugin data.
+ */
+ do_action( 'manage_plugins_custom_column', $column_name, $plugin_file, $plugin_data );
+
+ echo '</td>';
+ }
+ }
+
+ echo '</tr>';
+
+ /**
+ * Fires after each row in the Plugins list table.
+ *
+ * @since 2.3.0
+ *
+ * @param string $plugin_file Path to the plugin file relative to the plugins directory.
+ * @param array $plugin_data An array of plugin data.
+ * @param string $status Status of the plugin. Defaults are 'All', 'Active',
+ * 'Inactive', 'Recently Activated', 'Upgrade', 'Must-Use',
+ * 'Drop-ins', 'Search', 'Paused'.
+ */
+ do_action( 'after_plugin_row', $plugin_file, $plugin_data, $status );
+
+ /**
+ * Fires after each specific row in the Plugins list table.
+ *
+ * The dynamic portion of the hook name, `$plugin_file`, refers to the path
+ * to the plugin file, relative to the plugins directory.
+ *
+ * @since 2.7.0
+ *
+ * @param string $plugin_file Path to the plugin file relative to the plugins directory.
+ * @param array $plugin_data An array of plugin data.
+ * @param string $status Status of the plugin. Defaults are 'All', 'Active',
+ * 'Inactive', 'Recently Activated', 'Upgrade', 'Must-Use',
+ * 'Drop-ins', 'Search', 'Paused'.
+ */
+ do_action( "after_plugin_row_{$plugin_file}", $plugin_file, $plugin_data, $status );
+ }
+
+ /**
+ * Gets the name of the primary column for this specific list table.
+ *
+ * @since 4.3.0
+ *
+ * @return string Unalterable name for the primary column, in this case, 'name'.
+ */
+ protected function get_primary_column_name() {
+ return 'name';
+ }
+}
diff --git a/www/crm/wp-admin/includes/class-wp-post-comments-list-table.php b/www/crm/wp-admin/includes/class-wp-post-comments-list-table.php
new file mode 100644
index 00000000..29dc2863
--- /dev/null
+++ b/www/crm/wp-admin/includes/class-wp-post-comments-list-table.php
@@ -0,0 +1,78 @@
+<?php
+/**
+ * List Table API: WP_Post_Comments_List_Table class
+ *
+ * @package WordPress
+ * @subpackage Administration
+ * @since 4.4.0
+ */
+
+/**
+ * Core class used to implement displaying post comments in a list table.
+ *
+ * @since 3.1.0
+ * @access private
+ *
+ * @see WP_Comments_List_Table
+ */
+class WP_Post_Comments_List_Table extends WP_Comments_List_Table {
+
+ /**
+ * @return array
+ */
+ protected function get_column_info() {
+ return array(
+ array(
+ 'author' => __( 'Author' ),
+ 'comment' => _x( 'Comment', 'column name' ),
+ ),
+ array(),
+ array(),
+ 'comment',
+ );
+ }
+
+ /**
+ * @return array
+ */
+ protected function get_table_classes() {
+ $classes = parent::get_table_classes();
+ $classes[] = 'wp-list-table';
+ $classes[] = 'comments-box';
+ return $classes;
+ }
+
+ /**
+ * @param bool $output_empty
+ */
+ public function display( $output_empty = false ) {
+ $singular = $this->_args['singular'];
+
+ wp_nonce_field( 'fetch-list-' . get_class( $this ), '_ajax_fetch_list_nonce' );
+ ?>
+<table class="<?php echo implode( ' ', $this->get_table_classes() ); ?>" style="display:none;">
+ <tbody id="the-comment-list"
+ <?php
+ if ( $singular ) {
+ echo " data-wp-lists='list:$singular'";
+ }
+ ?>
+ >
+ <?php
+ if ( ! $output_empty ) {
+ $this->display_rows_or_placeholder();
+ }
+ ?>
+ </tbody>
+</table>
+ <?php
+ }
+
+ /**
+ * @param bool $comment_status
+ * @return int
+ */
+ public function get_per_page( $comment_status = false ) {
+ return 10;
+ }
+}
diff --git a/www/crm/wp-admin/includes/class-wp-posts-list-table.php b/www/crm/wp-admin/includes/class-wp-posts-list-table.php
new file mode 100644
index 00000000..717e84fb
--- /dev/null
+++ b/www/crm/wp-admin/includes/class-wp-posts-list-table.php
@@ -0,0 +1,1914 @@
+<?php
+/**
+ * List Table API: WP_Posts_List_Table class
+ *
+ * @package WordPress
+ * @subpackage Administration
+ * @since 3.1.0
+ */
+
+/**
+ * Core class used to implement displaying posts in a list table.
+ *
+ * @since 3.1.0
+ * @access private
+ *
+ * @see WP_List_Table
+ */
+class WP_Posts_List_Table extends WP_List_Table {
+
+ /**
+ * Whether the items should be displayed hierarchically or linearly.
+ *
+ * @since 3.1.0
+ * @var bool
+ */
+ protected $hierarchical_display;
+
+ /**
+ * Holds the number of pending comments for each post.
+ *
+ * @since 3.1.0
+ * @var array
+ */
+ protected $comment_pending_count;
+
+ /**
+ * Holds the number of posts for this user.
+ *
+ * @since 3.1.0
+ * @var int
+ */
+ private $user_posts_count;
+
+ /**
+ * Holds the number of posts which are sticky.
+ *
+ * @since 3.1.0
+ * @var int
+ */
+ private $sticky_posts_count = 0;
+
+ private $is_trash;
+
+ /**
+ * Current level for output.
+ *
+ * @since 4.3.0
+ * @var int
+ */
+ protected $current_level = 0;
+
+ /**
+ * Constructor.
+ *
+ * @since 3.1.0
+ *
+ * @see WP_List_Table::__construct() for more information on default arguments.
+ *
+ * @global WP_Post_Type $post_type_object
+ * @global wpdb $wpdb
+ *
+ * @param array $args An associative array of arguments.
+ */
+ public function __construct( $args = array() ) {
+ global $post_type_object, $wpdb;
+
+ parent::__construct(
+ array(
+ 'plural' => 'posts',
+ 'screen' => isset( $args['screen'] ) ? $args['screen'] : null,
+ )
+ );
+
+ $post_type = $this->screen->post_type;
+ $post_type_object = get_post_type_object( $post_type );
+
+ $exclude_states = get_post_stati(
+ array(
+ 'show_in_admin_all_list' => false,
+ )
+ );
+ $this->user_posts_count = intval(
+ $wpdb->get_var(
+ $wpdb->prepare(
+ "
+ SELECT COUNT( 1 )
+ FROM $wpdb->posts
+ WHERE post_type = %s
+ AND post_status NOT IN ( '" . implode( "','", $exclude_states ) . "' )
+ AND post_author = %d
+ ",
+ $post_type,
+ get_current_user_id()
+ )
+ )
+ );
+
+ if ( $this->user_posts_count && ! current_user_can( $post_type_object->cap->edit_others_posts ) && empty( $_REQUEST['post_status'] ) && empty( $_REQUEST['all_posts'] ) && empty( $_REQUEST['author'] ) && empty( $_REQUEST['show_sticky'] ) ) {
+ $_GET['author'] = get_current_user_id();
+ }
+
+ if ( 'post' === $post_type && $sticky_posts = get_option( 'sticky_posts' ) ) {
+ $sticky_posts = implode( ', ', array_map( 'absint', (array) $sticky_posts ) );
+ $this->sticky_posts_count = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT( 1 ) FROM $wpdb->posts WHERE post_type = %s AND post_status NOT IN ('trash', 'auto-draft') AND ID IN ($sticky_posts)", $post_type ) );
+ }
+ }
+
+ /**
+ * Sets whether the table layout should be hierarchical or not.
+ *
+ * @since 4.2.0
+ *
+ * @param bool $display Whether the table layout should be hierarchical.
+ */
+ public function set_hierarchical_display( $display ) {
+ $this->hierarchical_display = $display;
+ }
+
+ /**
+ * @return bool
+ */
+ public function ajax_user_can() {
+ return current_user_can( get_post_type_object( $this->screen->post_type )->cap->edit_posts );
+ }
+
+ /**
+ * @global array $avail_post_stati
+ * @global WP_Query $wp_query
+ * @global int $per_page
+ * @global string $mode
+ */
+ public function prepare_items() {
+ global $avail_post_stati, $wp_query, $per_page, $mode;
+
+ // is going to call wp()
+ $avail_post_stati = wp_edit_posts_query();
+
+ $this->set_hierarchical_display( is_post_type_hierarchical( $this->screen->post_type ) && 'menu_order title' === $wp_query->query['orderby'] );
+
+ $post_type = $this->screen->post_type;
+ $per_page = $this->get_items_per_page( 'edit_' . $post_type . '_per_page' );
+
+ /** This filter is documented in wp-admin/includes/post.php */
+ $per_page = apply_filters( 'edit_posts_per_page', $per_page, $post_type );
+
+ if ( $this->hierarchical_display ) {
+ $total_items = $wp_query->post_count;
+ } elseif ( $wp_query->found_posts || $this->get_pagenum() === 1 ) {
+ $total_items = $wp_query->found_posts;
+ } else {
+ $post_counts = (array) wp_count_posts( $post_type, 'readable' );
+
+ if ( isset( $_REQUEST['post_status'] ) && in_array( $_REQUEST['post_status'], $avail_post_stati ) ) {
+ $total_items = $post_counts[ $_REQUEST['post_status'] ];
+ } elseif ( isset( $_REQUEST['show_sticky'] ) && $_REQUEST['show_sticky'] ) {
+ $total_items = $this->sticky_posts_count;
+ } elseif ( isset( $_GET['author'] ) && $_GET['author'] == get_current_user_id() ) {
+ $total_items = $this->user_posts_count;
+ } else {
+ $total_items = array_sum( $post_counts );
+
+ // Subtract post types that are not included in the admin all list.
+ foreach ( get_post_stati( array( 'show_in_admin_all_list' => false ) ) as $state ) {
+ $total_items -= $post_counts[ $state ];
+ }
+ }
+ }
+
+ if ( ! empty( $_REQUEST['mode'] ) ) {
+ $mode = $_REQUEST['mode'] === 'excerpt' ? 'excerpt' : 'list';
+ set_user_setting( 'posts_list_mode', $mode );
+ } else {
+ $mode = get_user_setting( 'posts_list_mode', 'list' );
+ }
+
+ $this->is_trash = isset( $_REQUEST['post_status'] ) && $_REQUEST['post_status'] === 'trash';
+
+ $this->set_pagination_args(
+ array(
+ 'total_items' => $total_items,
+ 'per_page' => $per_page,
+ )
+ );
+ }
+
+ /**
+ * @return bool
+ */
+ public function has_items() {
+ return have_posts();
+ }
+
+ /**
+ */
+ public function no_items() {
+ if ( isset( $_REQUEST['post_status'] ) && 'trash' === $_REQUEST['post_status'] ) {
+ echo get_post_type_object( $this->screen->post_type )->labels->not_found_in_trash;
+ } else {
+ echo get_post_type_object( $this->screen->post_type )->labels->not_found;
+ }
+ }
+
+ /**
+ * Determine if the current view is the "All" view.
+ *
+ * @since 4.2.0
+ *
+ * @return bool Whether the current view is the "All" view.
+ */
+ protected function is_base_request() {
+ $vars = $_GET;
+ unset( $vars['paged'] );
+
+ if ( empty( $vars ) ) {
+ return true;
+ } elseif ( 1 === count( $vars ) && ! empty( $vars['post_type'] ) ) {
+ return $this->screen->post_type === $vars['post_type'];
+ }
+
+ return 1 === count( $vars ) && ! empty( $vars['mode'] );
+ }
+
+ /**
+ * Helper to create links to edit.php with params.
+ *
+ * @since 4.4.0
+ *
+ * @param string[] $args Associative array of URL parameters for the link.
+ * @param string $label Link text.
+ * @param string $class Optional. Class attribute. Default empty string.
+ * @return string The formatted link string.
+ */
+ protected function get_edit_link( $args, $label, $class = '' ) {
+ $url = add_query_arg( $args, 'edit.php' );
+
+ $class_html = $aria_current = '';
+ if ( ! empty( $class ) ) {
+ $class_html = sprintf(
+ ' class="%s"',
+ esc_attr( $class )
+ );
+
+ if ( 'current' === $class ) {
+ $aria_current = ' aria-current="page"';
+ }
+ }
+
+ return sprintf(
+ '<a href="%s"%s%s>%s</a>',
+ esc_url( $url ),
+ $class_html,
+ $aria_current,
+ $label
+ );
+ }
+
+ /**
+ * @global array $locked_post_status This seems to be deprecated.
+ * @global array $avail_post_stati
+ * @return array
+ */
+ protected function get_views() {
+ global $locked_post_status, $avail_post_stati;
+
+ $post_type = $this->screen->post_type;
+
+ if ( ! empty( $locked_post_status ) ) {
+ return array();
+ }
+
+ $status_links = array();
+ $num_posts = wp_count_posts( $post_type, 'readable' );
+ $total_posts = array_sum( (array) $num_posts );
+ $class = '';
+
+ $current_user_id = get_current_user_id();
+ $all_args = array( 'post_type' => $post_type );
+ $mine = '';
+
+ // Subtract post types that are not included in the admin all list.
+ foreach ( get_post_stati( array( 'show_in_admin_all_list' => false ) ) as $state ) {
+ $total_posts -= $num_posts->$state;
+ }
+
+ if ( $this->user_posts_count && $this->user_posts_count !== $total_posts ) {
+ if ( isset( $_GET['author'] ) && ( $_GET['author'] == $current_user_id ) ) {
+ $class = 'current';
+ }
+
+ $mine_args = array(
+ 'post_type' => $post_type,
+ 'author' => $current_user_id,
+ );
+
+ $mine_inner_html = sprintf(
+ _nx(
+ 'Mine <span class="count">(%s)</span>',
+ 'Mine <span class="count">(%s)</span>',
+ $this->user_posts_count,
+ 'posts'
+ ),
+ number_format_i18n( $this->user_posts_count )
+ );
+
+ $mine = $this->get_edit_link( $mine_args, $mine_inner_html, $class );
+
+ $all_args['all_posts'] = 1;
+ $class = '';
+ }
+
+ if ( empty( $class ) && ( $this->is_base_request() || isset( $_REQUEST['all_posts'] ) ) ) {
+ $class = 'current';
+ }
+
+ $all_inner_html = sprintf(
+ _nx(
+ 'All <span class="count">(%s)</span>',
+ 'All <span class="count">(%s)</span>',
+ $total_posts,
+ 'posts'
+ ),
+ number_format_i18n( $total_posts )
+ );
+
+ $status_links['all'] = $this->get_edit_link( $all_args, $all_inner_html, $class );
+ if ( $mine ) {
+ $status_links['mine'] = $mine;
+ }
+
+ foreach ( get_post_stati( array( 'show_in_admin_status_list' => true ), 'objects' ) as $status ) {
+ $class = '';
+
+ $status_name = $status->name;
+
+ if ( ! in_array( $status_name, $avail_post_stati ) || empty( $num_posts->$status_name ) ) {
+ continue;
+ }
+
+ if ( isset( $_REQUEST['post_status'] ) && $status_name === $_REQUEST['post_status'] ) {
+ $class = 'current';
+ }
+
+ $status_args = array(
+ 'post_status' => $status_name,
+ 'post_type' => $post_type,
+ );
+
+ $status_label = sprintf(
+ translate_nooped_plural( $status->label_count, $num_posts->$status_name ),
+ number_format_i18n( $num_posts->$status_name )
+ );
+
+ $status_links[ $status_name ] = $this->get_edit_link( $status_args, $status_label, $class );
+ }
+
+ if ( ! empty( $this->sticky_posts_count ) ) {
+ $class = ! empty( $_REQUEST['show_sticky'] ) ? 'current' : '';
+
+ $sticky_args = array(
+ 'post_type' => $post_type,
+ 'show_sticky' => 1,
+ );
+
+ $sticky_inner_html = sprintf(
+ _nx(
+ 'Sticky <span class="count">(%s)</span>',
+ 'Sticky <span class="count">(%s)</span>',
+ $this->sticky_posts_count,
+ 'posts'
+ ),
+ number_format_i18n( $this->sticky_posts_count )
+ );
+
+ $sticky_link = array(
+ 'sticky' => $this->get_edit_link( $sticky_args, $sticky_inner_html, $class ),
+ );
+
+ // Sticky comes after Publish, or if not listed, after All.
+ $split = 1 + array_search( ( isset( $status_links['publish'] ) ? 'publish' : 'all' ), array_keys( $status_links ) );
+ $status_links = array_merge( array_slice( $status_links, 0, $split ), $sticky_link, array_slice( $status_links, $split ) );
+ }
+
+ return $status_links;
+ }
+
+ /**
+ * @return array
+ */
+ protected function get_bulk_actions() {
+ $actions = array();
+ $post_type_obj = get_post_type_object( $this->screen->post_type );
+
+ if ( current_user_can( $post_type_obj->cap->edit_posts ) ) {
+ if ( $this->is_trash ) {
+ $actions['untrash'] = __( 'Restore' );
+ } else {
+ $actions['edit'] = __( 'Edit' );
+ }
+ }
+
+ if ( current_user_can( $post_type_obj->cap->delete_posts ) ) {
+ if ( $this->is_trash || ! EMPTY_TRASH_DAYS ) {
+ $actions['delete'] = __( 'Delete Permanently' );
+ } else {
+ $actions['trash'] = __( 'Move to Trash' );
+ }
+ }
+
+ return $actions;
+ }
+
+ /**
+ * Displays a categories drop-down for filtering on the Posts list table.
+ *
+ * @since 4.6.0
+ *
+ * @global int $cat Currently selected category.
+ *
+ * @param string $post_type Post type slug.
+ */
+ protected function categories_dropdown( $post_type ) {
+ global $cat;
+
+ /**
+ * Filters whether to remove the 'Categories' drop-down from the post list table.
+ *
+ * @since 4.6.0
+ *
+ * @param bool $disable Whether to disable the categories drop-down. Default false.
+ * @param string $post_type Post type slug.
+ */
+ if ( false !== apply_filters( 'disable_categories_dropdown', false, $post_type ) ) {
+ return;
+ }
+
+ if ( is_object_in_taxonomy( $post_type, 'category' ) ) {
+ $dropdown_options = array(
+ 'show_option_all' => get_taxonomy( 'category' )->labels->all_items,
+ 'hide_empty' => 0,
+ 'hierarchical' => 1,
+ 'show_count' => 0,
+ 'orderby' => 'name',
+ 'selected' => $cat,
+ );
+
+ echo '<label class="screen-reader-text" for="cat">' . __( 'Filter by category' ) . '</label>';
+ wp_dropdown_categories( $dropdown_options );
+ }
+ }
+
+ /**
+ * Displays a formats drop-down for filtering items.
+ *
+ * @since 5.2.0
+ * @access protected
+ *
+ * @param string $post_type Post type key.
+ */
+ protected function formats_dropdown( $post_type ) {
+ /**
+ * Filters whether to remove the 'Formats' drop-down from the post list table.
+ *
+ * @since 5.2.0
+ *
+ * @param bool $disable Whether to disable the drop-down. Default false.
+ */
+ if ( apply_filters( 'disable_formats_dropdown', false ) ) {
+ return;
+ }
+
+ // Make sure the dropdown shows only formats with a post count greater than 0.
+ $used_post_formats = get_terms(
+ array(
+ 'taxonomy' => 'post_format',
+ 'hide_empty' => true,
+ )
+ );
+
+ /*
+ * Return if the post type doesn't have post formats, or there are no posts using formats,
+ * or if we're in the trash.
+ */
+ if ( ! is_object_in_taxonomy( $post_type, 'post_format' ) || ! $used_post_formats || $this->is_trash ) {
+ return;
+ }
+
+ $displayed_post_format = isset( $_GET['post_format'] ) ? $_GET['post_format'] : '';
+ ?>
+ <label for="filter-by-format" class="screen-reader-text"><?php _e( 'Filter by post format' ); ?></label>
+ <select name="post_format" id="filter-by-format">
+ <option<?php selected( $displayed_post_format, '' ); ?> value=""><?php _e( 'All formats' ); ?></option>
+ <?php
+ foreach ( $used_post_formats as $used_post_format ) {
+ // Post format slug.
+ $slug = str_replace( 'post-format-', '', $used_post_format->slug );
+ // Pretty, translated version of the post format slug.
+ $pretty_name = get_post_format_string( $slug );
+ // Skip the standard post format.
+ if ( 'standard' === $slug ) {
+ continue;
+ }
+ ?>
+ <option<?php selected( $displayed_post_format, $slug ); ?> value="<?php echo esc_attr( $slug ); ?>"><?php echo esc_html( $pretty_name ); ?></option>
+ <?php
+ }
+ ?>
+ </select>
+ <?php
+ }
+
+ /**
+ * @param string $which
+ */
+ protected function extra_tablenav( $which ) {
+ ?>
+ <div class="alignleft actions">
+ <?php
+ if ( 'top' === $which && ! is_singular() ) {
+ ob_start();
+
+ $this->months_dropdown( $this->screen->post_type );
+ $this->categories_dropdown( $this->screen->post_type );
+ $this->formats_dropdown( $this->screen->post_type );
+
+ /**
+ * Fires before the Filter button on the Posts and Pages list tables.
+ *
+ * The Filter button allows sorting by date and/or category on the
+ * Posts list table, and sorting by date on the Pages list table.
+ *
+ * @since 2.1.0
+ * @since 4.4.0 The `$post_type` parameter was added.
+ * @since 4.6.0 The `$which` parameter was added.
+ *
+ * @param string $post_type The post type slug.
+ * @param string $which The location of the extra table nav markup:
+ * 'top' or 'bottom' for WP_Posts_List_Table,
+ * 'bar' for WP_Media_List_Table.
+ */
+ do_action( 'restrict_manage_posts', $this->screen->post_type, $which );
+
+ $output = ob_get_clean();
+
+ if ( ! empty( $output ) ) {
+ echo $output;
+ submit_button( __( 'Filter' ), '', 'filter_action', false, array( 'id' => 'post-query-submit' ) );
+ }
+ }
+
+ if ( $this->is_trash && current_user_can( get_post_type_object( $this->screen->post_type )->cap->edit_others_posts ) && $this->has_items() ) {
+ submit_button( __( 'Empty Trash' ), 'apply', 'delete_all', false );
+ }
+ ?>
+ </div>
+ <?php
+ /**
+ * Fires immediately following the closing "actions" div in the tablenav for the posts
+ * list table.
+ *
+ * @since 4.4.0
+ *
+ * @param string $which The location of the extra table nav markup: 'top' or 'bottom'.
+ */
+ do_action( 'manage_posts_extra_tablenav', $which );
+ }
+
+ /**
+ * @return string
+ */
+ public function current_action() {
+ if ( isset( $_REQUEST['delete_all'] ) || isset( $_REQUEST['delete_all2'] ) ) {
+ return 'delete_all';
+ }
+
+ return parent::current_action();
+ }
+
+ /**
+ * @return array
+ */
+ protected function get_table_classes() {
+ return array( 'widefat', 'fixed', 'striped', is_post_type_hierarchical( $this->screen->post_type ) ? 'pages' : 'posts' );
+ }
+
+ /**
+ * @return array
+ */
+ public function get_columns() {
+ $post_type = $this->screen->post_type;
+
+ $posts_columns = array();
+
+ $posts_columns['cb'] = '<input type="checkbox" />';
+
+ /* translators: manage posts column name */
+ $posts_columns['title'] = _x( 'Title', 'column name' );
+
+ if ( post_type_supports( $post_type, 'author' ) ) {
+ $posts_columns['author'] = __( 'Author' );
+ }
+
+ $taxonomies = get_object_taxonomies( $post_type, 'objects' );
+ $taxonomies = wp_filter_object_list( $taxonomies, array( 'show_admin_column' => true ), 'and', 'name' );
+
+ /**
+ * Filters the taxonomy columns in the Posts list table.
+ *
+ * The dynamic portion of the hook name, `$post_type`, refers to the post
+ * type slug.
+ *
+ * @since 3.5.0
+ *
+ * @param string[] $taxonomies Array of taxonomy names to show columns for.
+ * @param string $post_type The post type.
+ */
+ $taxonomies = apply_filters( "manage_taxonomies_for_{$post_type}_columns", $taxonomies, $post_type );
+ $taxonomies = array_filter( $taxonomies, 'taxonomy_exists' );
+
+ foreach ( $taxonomies as $taxonomy ) {
+ if ( 'category' === $taxonomy ) {
+ $column_key = 'categories';
+ } elseif ( 'post_tag' === $taxonomy ) {
+ $column_key = 'tags';
+ } else {
+ $column_key = 'taxonomy-' . $taxonomy;
+ }
+
+ $posts_columns[ $column_key ] = get_taxonomy( $taxonomy )->labels->name;
+ }
+
+ $post_status = ! empty( $_REQUEST['post_status'] ) ? $_REQUEST['post_status'] : 'all';
+ if ( post_type_supports( $post_type, 'comments' ) && ! in_array( $post_status, array( 'pending', 'draft', 'future' ) ) ) {
+ $posts_columns['comments'] = '<span class="vers comment-grey-bubble" title="' . esc_attr__( 'Comments' ) . '"><span class="screen-reader-text">' . __( 'Comments' ) . '</span></span>';
+ }
+
+ $posts_columns['date'] = __( 'Date' );
+
+ if ( 'page' === $post_type ) {
+
+ /**
+ * Filters the columns displayed in the Pages list table.
+ *
+ * @since 2.5.0
+ *
+ * @param string[] $post_columns An associative array of column headings.
+ */
+ $posts_columns = apply_filters( 'manage_pages_columns', $posts_columns );
+ } else {
+
+ /**
+ * Filters the columns displayed in the Posts list table.
+ *
+ * @since 1.5.0
+ *
+ * @param string[] $post_columns An associative array of column headings.
+ * @param string $post_type The post type slug.
+ */
+ $posts_columns = apply_filters( 'manage_posts_columns', $posts_columns, $post_type );
+ }
+
+ /**
+ * Filters the columns displayed in the Posts list table for a specific post type.
+ *
+ * The dynamic portion of the hook name, `$post_type`, refers to the post type slug.
+ *
+ * @since 3.0.0
+ *
+ * @param string[] $post_columns An associative array of column headings.
+ */
+ return apply_filters( "manage_{$post_type}_posts_columns", $posts_columns );
+ }
+
+ /**
+ * @return array
+ */
+ protected function get_sortable_columns() {
+ return array(
+ 'title' => 'title',
+ 'parent' => 'parent',
+ 'comments' => 'comment_count',
+ 'date' => array( 'date', true ),
+ );
+ }
+
+ /**
+ * @global WP_Query $wp_query
+ * @global int $per_page
+ * @param array $posts
+ * @param int $level
+ */
+ public function display_rows( $posts = array(), $level = 0 ) {
+ global $wp_query, $per_page;
+
+ if ( empty( $posts ) ) {
+ $posts = $wp_query->posts;
+ }
+
+ add_filter( 'the_title', 'esc_html' );
+
+ if ( $this->hierarchical_display ) {
+ $this->_display_rows_hierarchical( $posts, $this->get_pagenum(), $per_page );
+ } else {
+ $this->_display_rows( $posts, $level );
+ }
+ }
+
+ /**
+ * @param array $posts
+ * @param int $level
+ */
+ private function _display_rows( $posts, $level = 0 ) {
+ $post_type = $this->screen->post_type;
+
+ // Create array of post IDs.
+ $post_ids = array();
+
+ foreach ( $posts as $a_post ) {
+ $post_ids[] = $a_post->ID;
+ }
+
+ if ( post_type_supports( $post_type, 'comments' ) ) {
+ $this->comment_pending_count = get_pending_comments_num( $post_ids );
+ }
+
+ foreach ( $posts as $post ) {
+ $this->single_row( $post, $level );
+ }
+ }
+
+ /**
+ * @global wpdb $wpdb
+ * @global WP_Post $post
+ * @param array $pages
+ * @param int $pagenum
+ * @param int $per_page
+ */
+ private function _display_rows_hierarchical( $pages, $pagenum = 1, $per_page = 20 ) {
+ global $wpdb;
+
+ $level = 0;
+
+ if ( ! $pages ) {
+ $pages = get_pages( array( 'sort_column' => 'menu_order' ) );
+
+ if ( ! $pages ) {
+ return;
+ }
+ }
+
+ /*
+ * Arrange pages into two parts: top level pages and children_pages
+ * children_pages is two dimensional array, eg.
+ * children_pages[10][] contains all sub-pages whose parent is 10.
+ * It only takes O( N ) to arrange this and it takes O( 1 ) for subsequent lookup operations
+ * If searching, ignore hierarchy and treat everything as top level
+ */
+ if ( empty( $_REQUEST['s'] ) ) {
+
+ $top_level_pages = array();
+ $children_pages = array();
+
+ foreach ( $pages as $page ) {
+
+ // Catch and repair bad pages.
+ if ( $page->post_parent == $page->ID ) {
+ $page->post_parent = 0;
+ $wpdb->update( $wpdb->posts, array( 'post_parent' => 0 ), array( 'ID' => $page->ID ) );
+ clean_post_cache( $page );
+ }
+
+ if ( 0 == $page->post_parent ) {
+ $top_level_pages[] = $page;
+ } else {
+ $children_pages[ $page->post_parent ][] = $page;
+ }
+ }
+
+ $pages = &$top_level_pages;
+ }
+
+ $count = 0;
+ $start = ( $pagenum - 1 ) * $per_page;
+ $end = $start + $per_page;
+ $to_display = array();
+
+ foreach ( $pages as $page ) {
+ if ( $count >= $end ) {
+ break;
+ }
+
+ if ( $count >= $start ) {
+ $to_display[ $page->ID ] = $level;
+ }
+
+ $count++;
+
+ if ( isset( $children_pages ) ) {
+ $this->_page_rows( $children_pages, $count, $page->ID, $level + 1, $pagenum, $per_page, $to_display );
+ }
+ }
+
+ // If it is the last pagenum and there are orphaned pages, display them with paging as well.
+ if ( isset( $children_pages ) && $count < $end ) {
+ foreach ( $children_pages as $orphans ) {
+ foreach ( $orphans as $op ) {
+ if ( $count >= $end ) {
+ break;
+ }
+
+ if ( $count >= $start ) {
+ $to_display[ $op->ID ] = 0;
+ }
+
+ $count++;
+ }
+ }
+ }
+
+ $ids = array_keys( $to_display );
+ _prime_post_caches( $ids );
+
+ if ( ! isset( $GLOBALS['post'] ) ) {
+ $GLOBALS['post'] = reset( $ids );
+ }
+
+ foreach ( $to_display as $page_id => $level ) {
+ echo "\t";
+ $this->single_row( $page_id, $level );
+ }
+ }
+
+ /**
+ * Given a top level page ID, display the nested hierarchy of sub-pages
+ * together with paging support
+ *
+ * @since 3.1.0 (Standalone function exists since 2.6.0)
+ * @since 4.2.0 Added the `$to_display` parameter.
+ *
+ * @param array $children_pages
+ * @param int $count
+ * @param int $parent
+ * @param int $level
+ * @param int $pagenum
+ * @param int $per_page
+ * @param array $to_display List of pages to be displayed. Passed by reference.
+ */
+ private function _page_rows( &$children_pages, &$count, $parent, $level, $pagenum, $per_page, &$to_display ) {
+ if ( ! isset( $children_pages[ $parent ] ) ) {
+ return;
+ }
+
+ $start = ( $pagenum - 1 ) * $per_page;
+ $end = $start + $per_page;
+
+ foreach ( $children_pages[ $parent ] as $page ) {
+ if ( $count >= $end ) {
+ break;
+ }
+
+ // If the page starts in a subtree, print the parents.
+ if ( $count == $start && $page->post_parent > 0 ) {
+ $my_parents = array();
+ $my_parent = $page->post_parent;
+ while ( $my_parent ) {
+ // Get the ID from the list or the attribute if my_parent is an object
+ $parent_id = $my_parent;
+ if ( is_object( $my_parent ) ) {
+ $parent_id = $my_parent->ID;
+ }
+
+ $my_parent = get_post( $parent_id );
+ $my_parents[] = $my_parent;
+ if ( ! $my_parent->post_parent ) {
+ break;
+ }
+ $my_parent = $my_parent->post_parent;
+ }
+ $num_parents = count( $my_parents );
+ while ( $my_parent = array_pop( $my_parents ) ) {
+ $to_display[ $my_parent->ID ] = $level - $num_parents;
+ $num_parents--;
+ }
+ }
+
+ if ( $count >= $start ) {
+ $to_display[ $page->ID ] = $level;
+ }
+
+ $count++;
+
+ $this->_page_rows( $children_pages, $count, $page->ID, $level + 1, $pagenum, $per_page, $to_display );
+ }
+
+ unset( $children_pages[ $parent ] ); //required in order to keep track of orphans
+ }
+
+ /**
+ * Handles the checkbox column output.
+ *
+ * @since 4.3.0
+ *
+ * @param WP_Post $post The current WP_Post object.
+ */
+ public function column_cb( $post ) {
+ if ( current_user_can( 'edit_post', $post->ID ) ) :
+ ?>
+ <label class="screen-reader-text" for="cb-select-<?php the_ID(); ?>">
+ <?php
+ printf( __( 'Select %s' ), _draft_or_post_title() );
+ ?>
+ </label>
+ <input id="cb-select-<?php the_ID(); ?>" type="checkbox" name="post[]" value="<?php the_ID(); ?>" />
+ <div class="locked-indicator">
+ <span class="locked-indicator-icon" aria-hidden="true"></span>
+ <span class="screen-reader-text">
+ <?php
+ printf(
+ /* translators: %s: post title */
+ __( '&#8220;%s&#8221; is locked' ),
+ _draft_or_post_title()
+ );
+ ?>
+ </span>
+ </div>
+ <?php
+ endif;
+ }
+
+ /**
+ * @since 4.3.0
+ *
+ * @param WP_Post $post
+ * @param string $classes
+ * @param string $data
+ * @param string $primary
+ */
+ protected function _column_title( $post, $classes, $data, $primary ) {
+ echo '<td class="' . $classes . ' page-title" ', $data, '>';
+ echo $this->column_title( $post );
+ echo $this->handle_row_actions( $post, 'title', $primary );
+ echo '</td>';
+ }
+
+ /**
+ * Handles the title column output.
+ *
+ * @since 4.3.0
+ *
+ * @global string $mode List table view mode.
+ *
+ * @param WP_Post $post The current WP_Post object.
+ */
+ public function column_title( $post ) {
+ global $mode;
+
+ if ( $this->hierarchical_display ) {
+ if ( 0 === $this->current_level && (int) $post->post_parent > 0 ) {
+ // Sent level 0 by accident, by default, or because we don't know the actual level.
+ $find_main_page = (int) $post->post_parent;
+ while ( $find_main_page > 0 ) {
+ $parent = get_post( $find_main_page );
+
+ if ( is_null( $parent ) ) {
+ break;
+ }
+
+ $this->current_level++;
+ $find_main_page = (int) $parent->post_parent;
+
+ if ( ! isset( $parent_name ) ) {
+ /** This filter is documented in wp-includes/post-template.php */
+ $parent_name = apply_filters( 'the_title', $parent->post_title, $parent->ID );
+ }
+ }
+ }
+ }
+
+ $can_edit_post = current_user_can( 'edit_post', $post->ID );
+
+ if ( $can_edit_post && $post->post_status != 'trash' ) {
+ $lock_holder = wp_check_post_lock( $post->ID );
+
+ if ( $lock_holder ) {
+ $lock_holder = get_userdata( $lock_holder );
+ $locked_avatar = get_avatar( $lock_holder->ID, 18 );
+ $locked_text = esc_html( sprintf( __( '%s is currently editing' ), $lock_holder->display_name ) );
+ } else {
+ $locked_avatar = $locked_text = '';
+ }
+
+ echo '<div class="locked-info"><span class="locked-avatar">' . $locked_avatar . '</span> <span class="locked-text">' . $locked_text . "</span></div>\n";
+ }
+
+ $pad = str_repeat( '&#8212; ', $this->current_level );
+ echo '<strong>';
+
+ $title = _draft_or_post_title();
+
+ if ( $can_edit_post && $post->post_status != 'trash' ) {
+ printf(
+ '<a class="row-title" href="%s" aria-label="%s">%s%s</a>',
+ get_edit_post_link( $post->ID ),
+ /* translators: %s: post title */
+ esc_attr( sprintf( __( '&#8220;%s&#8221; (Edit)' ), $title ) ),
+ $pad,
+ $title
+ );
+ } else {
+ printf(
+ '<span>%s%s</span>',
+ $pad,
+ $title
+ );
+ }
+ _post_states( $post );
+
+ if ( isset( $parent_name ) ) {
+ $post_type_object = get_post_type_object( $post->post_type );
+ echo ' | ' . $post_type_object->labels->parent_item_colon . ' ' . esc_html( $parent_name );
+ }
+ echo "</strong>\n";
+
+ if ( ! is_post_type_hierarchical( $this->screen->post_type ) && 'excerpt' === $mode && current_user_can( 'read_post', $post->ID ) ) {
+ if ( post_password_required( $post ) ) {
+ echo '<span class="protected-post-excerpt">' . esc_html( get_the_excerpt() ) . '</span>';
+ } else {
+ echo esc_html( get_the_excerpt() );
+ }
+ }
+
+ get_inline_data( $post );
+ }
+
+ /**
+ * Handles the post date column output.
+ *
+ * @since 4.3.0
+ *
+ * @global string $mode List table view mode.
+ *
+ * @param WP_Post $post The current WP_Post object.
+ */
+ public function column_date( $post ) {
+ global $mode;
+
+ if ( '0000-00-00 00:00:00' === $post->post_date ) {
+ $t_time = $h_time = __( 'Unpublished' );
+ $time_diff = 0;
+ } else {
+ $t_time = get_the_time( __( 'Y/m/d g:i:s a' ) );
+ $m_time = $post->post_date;
+ $time = get_post_time( 'G', true, $post );
+
+ $time_diff = time() - $time;
+
+ if ( $time_diff > 0 && $time_diff < DAY_IN_SECONDS ) {
+ $h_time = sprintf( __( '%s ago' ), human_time_diff( $time ) );
+ } else {
+ $h_time = mysql2date( __( 'Y/m/d' ), $m_time );
+ }
+ }
+
+ if ( 'publish' === $post->post_status ) {
+ $status = __( 'Published' );
+ } elseif ( 'future' === $post->post_status ) {
+ if ( $time_diff > 0 ) {
+ $status = '<strong class="error-message">' . __( 'Missed schedule' ) . '</strong>';
+ } else {
+ $status = __( 'Scheduled' );
+ }
+ } else {
+ $status = __( 'Last Modified' );
+ }
+
+ /**
+ * Filters the status text of the post.
+ *
+ * @since 4.8.0
+ *
+ * @param string $status The status text.
+ * @param WP_Post $post Post object.
+ * @param string $column_name The column name.
+ * @param string $mode The list display mode ('excerpt' or 'list').
+ */
+ $status = apply_filters( 'post_date_column_status', $status, $post, 'date', $mode );
+
+ if ( $status ) {
+ echo $status . '<br />';
+ }
+
+ if ( 'excerpt' === $mode ) {
+ /**
+ * Filters the published time of the post.
+ *
+ * If `$mode` equals 'excerpt', the published time and date are both displayed.
+ * If `$mode` equals 'list' (default), the publish date is displayed, with the
+ * time and date together available as an abbreviation definition.
+ *
+ * @since 2.5.1
+ *
+ * @param string $t_time The published time.
+ * @param WP_Post $post Post object.
+ * @param string $column_name The column name.
+ * @param string $mode The list display mode ('excerpt' or 'list').
+ */
+ echo apply_filters( 'post_date_column_time', $t_time, $post, 'date', $mode );
+ } else {
+
+ /** This filter is documented in wp-admin/includes/class-wp-posts-list-table.php */
+ echo '<abbr title="' . $t_time . '">' . apply_filters( 'post_date_column_time', $h_time, $post, 'date', $mode ) . '</abbr>';
+ }
+ }
+
+ /**
+ * Handles the comments column output.
+ *
+ * @since 4.3.0
+ *
+ * @param WP_Post $post The current WP_Post object.
+ */
+ public function column_comments( $post ) {
+ ?>
+ <div class="post-com-count-wrapper">
+ <?php
+ $pending_comments = isset( $this->comment_pending_count[ $post->ID ] ) ? $this->comment_pending_count[ $post->ID ] : 0;
+
+ $this->comments_bubble( $post->ID, $pending_comments );
+ ?>
+ </div>
+ <?php
+ }
+
+ /**
+ * Handles the post author column output.
+ *
+ * @since 4.3.0
+ *
+ * @param WP_Post $post The current WP_Post object.
+ */
+ public function column_author( $post ) {
+ $args = array(
+ 'post_type' => $post->post_type,
+ 'author' => get_the_author_meta( 'ID' ),
+ );
+ echo $this->get_edit_link( $args, get_the_author() );
+ }
+
+ /**
+ * Handles the default column output.
+ *
+ * @since 4.3.0
+ *
+ * @param WP_Post $post The current WP_Post object.
+ * @param string $column_name The current column name.
+ */
+ public function column_default( $post, $column_name ) {
+ if ( 'categories' === $column_name ) {
+ $taxonomy = 'category';
+ } elseif ( 'tags' === $column_name ) {
+ $taxonomy = 'post_tag';
+ } elseif ( 0 === strpos( $column_name, 'taxonomy-' ) ) {
+ $taxonomy = substr( $column_name, 9 );
+ } else {
+ $taxonomy = false;
+ }
+ if ( $taxonomy ) {
+ $taxonomy_object = get_taxonomy( $taxonomy );
+ $terms = get_the_terms( $post->ID, $taxonomy );
+ if ( is_array( $terms ) ) {
+ $term_links = array();
+ foreach ( $terms as $t ) {
+ $posts_in_term_qv = array();
+ if ( 'post' != $post->post_type ) {
+ $posts_in_term_qv['post_type'] = $post->post_type;
+ }
+ if ( $taxonomy_object->query_var ) {
+ $posts_in_term_qv[ $taxonomy_object->query_var ] = $t->slug;
+ } else {
+ $posts_in_term_qv['taxonomy'] = $taxonomy;
+ $posts_in_term_qv['term'] = $t->slug;
+ }
+
+ $label = esc_html( sanitize_term_field( 'name', $t->name, $t->term_id, $taxonomy, 'display' ) );
+
+ $term_links[] = $this->get_edit_link( $posts_in_term_qv, $label );
+ }
+
+ /**
+ * Filters the links in `$taxonomy` column of edit.php.
+ *
+ * @since 5.2.0
+ *
+ * @param array $term_links List of links to edit.php, filtered by the taxonomy term.
+ * @param string $taxonomy Taxonomy name.
+ * @param array $terms Array of terms appearing in the post row.
+ */
+ $term_links = apply_filters( 'post_column_taxonomy_links', $term_links, $taxonomy, $terms );
+
+ /* translators: used between list items, there is a space after the comma */
+ echo join( __( ', ' ), $term_links );
+ } else {
+ echo '<span aria-hidden="true">&#8212;</span><span class="screen-reader-text">' . $taxonomy_object->labels->no_terms . '</span>';
+ }
+ return;
+ }
+
+ if ( is_post_type_hierarchical( $post->post_type ) ) {
+
+ /**
+ * Fires in each custom column on the Posts list table.
+ *
+ * This hook only fires if the current post type is hierarchical,
+ * such as pages.
+ *
+ * @since 2.5.0
+ *
+ * @param string $column_name The name of the column to display.
+ * @param int $post_id The current post ID.
+ */
+ do_action( 'manage_pages_custom_column', $column_name, $post->ID );
+ } else {
+
+ /**
+ * Fires in each custom column in the Posts list table.
+ *
+ * This hook only fires if the current post type is non-hierarchical,
+ * such as posts.
+ *
+ * @since 1.5.0
+ *
+ * @param string $column_name The name of the column to display.
+ * @param int $post_id The current post ID.
+ */
+ do_action( 'manage_posts_custom_column', $column_name, $post->ID );
+ }
+
+ /**
+ * Fires for each custom column of a specific post type in the Posts list table.
+ *
+ * The dynamic portion of the hook name, `$post->post_type`, refers to the post type.
+ *
+ * @since 3.1.0
+ *
+ * @param string $column_name The name of the column to display.
+ * @param int $post_id The current post ID.
+ */
+ do_action( "manage_{$post->post_type}_posts_custom_column", $column_name, $post->ID );
+ }
+
+ /**
+ * @global WP_Post $post
+ *
+ * @param int|WP_Post $post
+ * @param int $level
+ */
+ public function single_row( $post, $level = 0 ) {
+ $global_post = get_post();
+
+ $post = get_post( $post );
+ $this->current_level = $level;
+
+ $GLOBALS['post'] = $post;
+ setup_postdata( $post );
+
+ $classes = 'iedit author-' . ( get_current_user_id() == $post->post_author ? 'self' : 'other' );
+
+ $lock_holder = wp_check_post_lock( $post->ID );
+ if ( $lock_holder ) {
+ $classes .= ' wp-locked';
+ }
+
+ if ( $post->post_parent ) {
+ $count = count( get_post_ancestors( $post->ID ) );
+ $classes .= ' level-' . $count;
+ } else {
+ $classes .= ' level-0';
+ }
+ ?>
+ <tr id="post-<?php echo $post->ID; ?>" class="<?php echo implode( ' ', get_post_class( $classes, $post->ID ) ); ?>">
+ <?php $this->single_row_columns( $post ); ?>
+ </tr>
+ <?php
+ $GLOBALS['post'] = $global_post;
+ }
+
+ /**
+ * Gets the name of the default primary column.
+ *
+ * @since 4.3.0
+ *
+ * @return string Name of the default primary column, in this case, 'title'.
+ */
+ protected function get_default_primary_column_name() {
+ return 'title';
+ }
+
+ /**
+ * Generates and displays row action links.
+ *
+ * @since 4.3.0
+ *
+ * @param object $post Post being acted upon.
+ * @param string $column_name Current column name.
+ * @param string $primary Primary column name.
+ * @return string Row actions output for posts.
+ */
+ protected function handle_row_actions( $post, $column_name, $primary ) {
+ if ( $primary !== $column_name ) {
+ return '';
+ }
+
+ $post_type_object = get_post_type_object( $post->post_type );
+ $can_edit_post = current_user_can( 'edit_post', $post->ID );
+ $actions = array();
+ $title = _draft_or_post_title();
+
+ if ( $can_edit_post && 'trash' != $post->post_status ) {
+ $actions['edit'] = sprintf(
+ '<a href="%s" aria-label="%s">%s</a>',
+ get_edit_post_link( $post->ID ),
+ /* translators: %s: post title */
+ esc_attr( sprintf( __( 'Edit &#8220;%s&#8221;' ), $title ) ),
+ __( 'Edit' )
+ );
+
+ if ( 'wp_block' !== $post->post_type ) {
+ $actions['inline hide-if-no-js'] = sprintf(
+ '<button type="button" class="button-link editinline" aria-label="%s" aria-expanded="false">%s</button>',
+ /* translators: %s: post title */
+ esc_attr( sprintf( __( 'Quick edit &#8220;%s&#8221; inline' ), $title ) ),
+ __( 'Quick&nbsp;Edit' )
+ );
+ }
+ }
+
+ if ( current_user_can( 'delete_post', $post->ID ) ) {
+ if ( 'trash' === $post->post_status ) {
+ $actions['untrash'] = sprintf(
+ '<a href="%s" aria-label="%s">%s</a>',
+ wp_nonce_url( admin_url( sprintf( $post_type_object->_edit_link . '&amp;action=untrash', $post->ID ) ), 'untrash-post_' . $post->ID ),
+ /* translators: %s: post title */
+ esc_attr( sprintf( __( 'Restore &#8220;%s&#8221; from the Trash' ), $title ) ),
+ __( 'Restore' )
+ );
+ } elseif ( EMPTY_TRASH_DAYS ) {
+ $actions['trash'] = sprintf(
+ '<a href="%s" class="submitdelete" aria-label="%s">%s</a>',
+ get_delete_post_link( $post->ID ),
+ /* translators: %s: post title */
+ esc_attr( sprintf( __( 'Move &#8220;%s&#8221; to the Trash' ), $title ) ),
+ _x( 'Trash', 'verb' )
+ );
+ }
+ if ( 'trash' === $post->post_status || ! EMPTY_TRASH_DAYS ) {
+ $actions['delete'] = sprintf(
+ '<a href="%s" class="submitdelete" aria-label="%s">%s</a>',
+ get_delete_post_link( $post->ID, '', true ),
+ /* translators: %s: post title */
+ esc_attr( sprintf( __( 'Delete &#8220;%s&#8221; permanently' ), $title ) ),
+ __( 'Delete Permanently' )
+ );
+ }
+ }
+
+ if ( is_post_type_viewable( $post_type_object ) ) {
+ if ( in_array( $post->post_status, array( 'pending', 'draft', 'future' ) ) ) {
+ if ( $can_edit_post ) {
+ $preview_link = get_preview_post_link( $post );
+ $actions['view'] = sprintf(
+ '<a href="%s" rel="bookmark" aria-label="%s">%s</a>',
+ esc_url( $preview_link ),
+ /* translators: %s: post title */
+ esc_attr( sprintf( __( 'Preview &#8220;%s&#8221;' ), $title ) ),
+ __( 'Preview' )
+ );
+ }
+ } elseif ( 'trash' != $post->post_status ) {
+ $actions['view'] = sprintf(
+ '<a href="%s" rel="bookmark" aria-label="%s">%s</a>',
+ get_permalink( $post->ID ),
+ /* translators: %s: post title */
+ esc_attr( sprintf( __( 'View &#8220;%s&#8221;' ), $title ) ),
+ __( 'View' )
+ );
+ }
+ }
+
+ if ( 'wp_block' === $post->post_type ) {
+ $actions['export'] = sprintf(
+ '<button type="button" class="wp-list-reusable-blocks__export button-link" data-id="%s" aria-label="%s">%s</button>',
+ $post->ID,
+ /* translators: %s: post title */
+ esc_attr( sprintf( __( 'Export &#8220;%s&#8221; as JSON' ), $title ) ),
+ __( 'Export as JSON' )
+ );
+ }
+
+ if ( is_post_type_hierarchical( $post->post_type ) ) {
+
+ /**
+ * Filters the array of row action links on the Pages list table.
+ *
+ * The filter is evaluated only for hierarchical post types.
+ *
+ * @since 2.8.0
+ *
+ * @param string[] $actions An array of row action links. Defaults are
+ * 'Edit', 'Quick Edit', 'Restore', 'Trash',
+ * 'Delete Permanently', 'Preview', and 'View'.
+ * @param WP_Post $post The post object.
+ */
+ $actions = apply_filters( 'page_row_actions', $actions, $post );
+ } else {
+
+ /**
+ * Filters the array of row action links on the Posts list table.
+ *
+ * The filter is evaluated only for non-hierarchical post types.
+ *
+ * @since 2.8.0
+ *
+ * @param string[] $actions An array of row action links. Defaults are
+ * 'Edit', 'Quick Edit', 'Restore', 'Trash',
+ * 'Delete Permanently', 'Preview', and 'View'.
+ * @param WP_Post $post The post object.
+ */
+ $actions = apply_filters( 'post_row_actions', $actions, $post );
+ }
+
+ return $this->row_actions( $actions );
+ }
+
+ /**
+ * Outputs the hidden row displayed when inline editing
+ *
+ * @since 3.1.0
+ *
+ * @global string $mode List table view mode.
+ */
+ public function inline_edit() {
+ global $mode;
+
+ $screen = $this->screen;
+
+ $post = get_default_post_to_edit( $screen->post_type );
+ $post_type_object = get_post_type_object( $screen->post_type );
+
+ $taxonomy_names = get_object_taxonomies( $screen->post_type );
+ $hierarchical_taxonomies = array();
+ $flat_taxonomies = array();
+ foreach ( $taxonomy_names as $taxonomy_name ) {
+
+ $taxonomy = get_taxonomy( $taxonomy_name );
+
+ $show_in_quick_edit = $taxonomy->show_in_quick_edit;
+
+ /**
+ * Filters whether the current taxonomy should be shown in the Quick Edit panel.
+ *
+ * @since 4.2.0
+ *
+ * @param bool $show_in_quick_edit Whether to show the current taxonomy in Quick Edit.
+ * @param string $taxonomy_name Taxonomy name.
+ * @param string $post_type Post type of current Quick Edit post.
+ */
+ if ( ! apply_filters( 'quick_edit_show_taxonomy', $show_in_quick_edit, $taxonomy_name, $screen->post_type ) ) {
+ continue;
+ }
+
+ if ( $taxonomy->hierarchical ) {
+ $hierarchical_taxonomies[] = $taxonomy;
+ } else {
+ $flat_taxonomies[] = $taxonomy;
+ }
+ }
+
+ $m = ( isset( $mode ) && 'excerpt' === $mode ) ? 'excerpt' : 'list';
+ $can_publish = current_user_can( $post_type_object->cap->publish_posts );
+ $core_columns = array(
+ 'cb' => true,
+ 'date' => true,
+ 'title' => true,
+ 'categories' => true,
+ 'tags' => true,
+ 'comments' => true,
+ 'author' => true,
+ );
+
+ ?>
+
+ <form method="get"><table style="display: none"><tbody id="inlineedit">
+ <?php
+ $hclass = count( $hierarchical_taxonomies ) ? 'post' : 'page';
+ $inline_edit_classes = "inline-edit-row inline-edit-row-$hclass";
+ $bulk_edit_classes = "bulk-edit-row bulk-edit-row-$hclass bulk-edit-{$screen->post_type}";
+ $quick_edit_classes = "quick-edit-row quick-edit-row-$hclass inline-edit-{$screen->post_type}";
+
+ $bulk = 0;
+ while ( $bulk < 2 ) {
+ ?>
+
+ <tr id="<?php echo $bulk ? 'bulk-edit' : 'inline-edit'; ?>" class="
+ <?php
+ echo $inline_edit_classes . ' ';
+ echo $bulk ? $bulk_edit_classes : $quick_edit_classes;
+ ?>
+ " style="display: none"><td colspan="<?php echo $this->get_column_count(); ?>" class="colspanchange">
+
+ <fieldset class="inline-edit-col-left">
+ <legend class="inline-edit-legend"><?php echo $bulk ? __( 'Bulk Edit' ) : __( 'Quick Edit' ); ?></legend>
+ <div class="inline-edit-col">
+ <?php
+
+ if ( post_type_supports( $screen->post_type, 'title' ) ) :
+ if ( $bulk ) :
+ ?>
+ <div id="bulk-title-div">
+ <div id="bulk-titles"></div>
+ </div>
+
+ <?php else : // $bulk ?>
+
+ <label>
+ <span class="title"><?php _e( 'Title' ); ?></span>
+ <span class="input-text-wrap"><input type="text" name="post_title" class="ptitle" value="" /></span>
+ </label>
+
+ <?php if ( is_post_type_viewable( $screen->post_type ) ) : // is_post_type_viewable check ?>
+
+ <label>
+ <span class="title"><?php _e( 'Slug' ); ?></span>
+ <span class="input-text-wrap"><input type="text" name="post_name" value="" /></span>
+ </label>
+
+ <?php
+ endif; // is_post_type_viewable check
+ endif; // $bulk
+ endif; // post_type_supports title
+ ?>
+
+ <?php if ( ! $bulk ) : ?>
+ <fieldset class="inline-edit-date">
+ <legend><span class="title"><?php _e( 'Date' ); ?></span></legend>
+ <?php touch_time( 1, 1, 0, 1 ); ?>
+ </fieldset>
+ <br class="clear" />
+ <?php
+ endif; // $bulk
+
+ if ( post_type_supports( $screen->post_type, 'author' ) ) :
+ $authors_dropdown = '';
+
+ if ( current_user_can( $post_type_object->cap->edit_others_posts ) ) :
+ $users_opt = array(
+ 'hide_if_only_one_author' => false,
+ 'who' => 'authors',
+ 'name' => 'post_author',
+ 'class' => 'authors',
+ 'multi' => 1,
+ 'echo' => 0,
+ 'show' => 'display_name_with_login',
+ );
+ if ( $bulk ) {
+ $users_opt['show_option_none'] = __( '&mdash; No Change &mdash;' );
+ }
+
+ if ( $authors = wp_dropdown_users( $users_opt ) ) :
+ $authors_dropdown = '<label class="inline-edit-author">';
+ $authors_dropdown .= '<span class="title">' . __( 'Author' ) . '</span>';
+ $authors_dropdown .= $authors;
+ $authors_dropdown .= '</label>';
+ endif;
+ endif; // authors
+ ?>
+
+ <?php
+ if ( ! $bulk ) {
+ echo $authors_dropdown;}
+ endif; // post_type_supports author
+
+ if ( ! $bulk && $can_publish ) :
+ ?>
+
+ <div class="inline-edit-group wp-clearfix">
+ <label class="alignleft">
+ <span class="title"><?php _e( 'Password' ); ?></span>
+ <span class="input-text-wrap"><input type="text" name="post_password" class="inline-edit-password-input" value="" /></span>
+ </label>
+
+ <em class="alignleft inline-edit-or">
+ <?php
+ /* translators: Between password field and private checkbox on post quick edit interface */
+ _e( '&ndash;OR&ndash;' );
+ ?>
+ </em>
+ <label class="alignleft inline-edit-private">
+ <input type="checkbox" name="keep_private" value="private" />
+ <span class="checkbox-title"><?php _e( 'Private' ); ?></span>
+ </label>
+ </div>
+
+ <?php endif; ?>
+
+ </div></fieldset>
+
+ <?php if ( count( $hierarchical_taxonomies ) && ! $bulk ) : ?>
+
+ <fieldset class="inline-edit-col-center inline-edit-categories"><div class="inline-edit-col">
+
+ <?php foreach ( $hierarchical_taxonomies as $taxonomy ) : ?>
+
+ <span class="title inline-edit-categories-label"><?php echo esc_html( $taxonomy->labels->name ); ?></span>
+ <input type="hidden" name="<?php echo ( $taxonomy->name === 'category' ) ? 'post_category[]' : 'tax_input[' . esc_attr( $taxonomy->name ) . '][]'; ?>" value="0" />
+ <ul class="cat-checklist <?php echo esc_attr( $taxonomy->name ); ?>-checklist">
+ <?php wp_terms_checklist( null, array( 'taxonomy' => $taxonomy->name ) ); ?>
+ </ul>
+
+ <?php endforeach; //$hierarchical_taxonomies as $taxonomy ?>
+
+ </div></fieldset>
+
+ <?php endif; // count( $hierarchical_taxonomies ) && !$bulk ?>
+
+ <fieldset class="inline-edit-col-right"><div class="inline-edit-col">
+
+ <?php
+ if ( post_type_supports( $screen->post_type, 'author' ) && $bulk ) {
+ echo $authors_dropdown;
+ }
+
+ if ( post_type_supports( $screen->post_type, 'page-attributes' ) ) :
+
+ if ( $post_type_object->hierarchical ) :
+ ?>
+ <label>
+ <span class="title"><?php _e( 'Parent' ); ?></span>
+ <?php
+ $dropdown_args = array(
+ 'post_type' => $post_type_object->name,
+ 'selected' => $post->post_parent,
+ 'name' => 'post_parent',
+ 'show_option_none' => __( 'Main Page (no parent)' ),
+ 'option_none_value' => 0,
+ 'sort_column' => 'menu_order, post_title',
+ );
+
+ if ( $bulk ) {
+ $dropdown_args['show_option_no_change'] = __( '&mdash; No Change &mdash;' );
+ }
+
+ /**
+ * Filters the arguments used to generate the Quick Edit page-parent drop-down.
+ *
+ * @since 2.7.0
+ *
+ * @see wp_dropdown_pages()
+ *
+ * @param array $dropdown_args An array of arguments.
+ */
+ $dropdown_args = apply_filters( 'quick_edit_dropdown_pages_args', $dropdown_args );
+
+ wp_dropdown_pages( $dropdown_args );
+ ?>
+ </label>
+
+ <?php
+ endif; // hierarchical
+
+ if ( ! $bulk ) :
+ ?>
+
+ <label>
+ <span class="title"><?php _e( 'Order' ); ?></span>
+ <span class="input-text-wrap"><input type="text" name="menu_order" class="inline-edit-menu-order-input" value="<?php echo $post->menu_order; ?>" /></span>
+ </label>
+
+ <?php
+ endif; // !$bulk
+ endif; // page-attributes
+ ?>
+
+ <?php if ( 0 < count( get_page_templates( null, $screen->post_type ) ) ) : ?>
+ <label>
+ <span class="title"><?php _e( 'Template' ); ?></span>
+ <select name="page_template">
+ <?php if ( $bulk ) : ?>
+ <option value="-1"><?php _e( '&mdash; No Change &mdash;' ); ?></option>
+ <?php endif; // $bulk ?>
+ <?php
+ /** This filter is documented in wp-admin/includes/meta-boxes.php */
+ $default_title = apply_filters( 'default_page_template_title', __( 'Default Template' ), 'quick-edit' );
+ ?>
+ <option value="default"><?php echo esc_html( $default_title ); ?></option>
+ <?php page_template_dropdown( '', $screen->post_type ); ?>
+ </select>
+ </label>
+ <?php endif; ?>
+
+ <?php if ( count( $flat_taxonomies ) && ! $bulk ) : ?>
+
+ <?php foreach ( $flat_taxonomies as $taxonomy ) : ?>
+ <?php
+ if ( current_user_can( $taxonomy->cap->assign_terms ) ) :
+ $taxonomy_name = esc_attr( $taxonomy->name );
+
+ ?>
+ <label class="inline-edit-tags">
+ <span class="title"><?php echo esc_html( $taxonomy->labels->name ); ?></span>
+ <textarea data-wp-taxonomy="<?php echo $taxonomy_name; ?>" cols="22" rows="1" name="tax_input[<?php echo $taxonomy_name; ?>]" class="tax_input_<?php echo $taxonomy_name; ?>"></textarea>
+ </label>
+ <?php endif; ?>
+
+ <?php endforeach; //$flat_taxonomies as $taxonomy ?>
+
+ <?php endif; // count( $flat_taxonomies ) && !$bulk ?>
+
+ <?php
+ if ( post_type_supports( $screen->post_type, 'comments' ) || post_type_supports( $screen->post_type, 'trackbacks' ) ) :
+ if ( $bulk ) :
+ ?>
+
+ <div class="inline-edit-group wp-clearfix">
+ <?php if ( post_type_supports( $screen->post_type, 'comments' ) ) : ?>
+ <label class="alignleft">
+ <span class="title"><?php _e( 'Comments' ); ?></span>
+ <select name="comment_status">
+ <option value=""><?php _e( '&mdash; No Change &mdash;' ); ?></option>
+ <option value="open"><?php _e( 'Allow' ); ?></option>
+ <option value="closed"><?php _e( 'Do not allow' ); ?></option>
+ </select>
+ </label>
+ <?php endif; if ( post_type_supports( $screen->post_type, 'trackbacks' ) ) : ?>
+ <label class="alignright">
+ <span class="title"><?php _e( 'Pings' ); ?></span>
+ <select name="ping_status">
+ <option value=""><?php _e( '&mdash; No Change &mdash;' ); ?></option>
+ <option value="open"><?php _e( 'Allow' ); ?></option>
+ <option value="closed"><?php _e( 'Do not allow' ); ?></option>
+ </select>
+ </label>
+ <?php endif; ?>
+ </div>
+
+ <?php else : // $bulk ?>
+
+ <div class="inline-edit-group wp-clearfix">
+ <?php if ( post_type_supports( $screen->post_type, 'comments' ) ) : ?>
+ <label class="alignleft">
+ <input type="checkbox" name="comment_status" value="open" />
+ <span class="checkbox-title"><?php _e( 'Allow Comments' ); ?></span>
+ </label>
+ <?php endif; if ( post_type_supports( $screen->post_type, 'trackbacks' ) ) : ?>
+ <label class="alignleft">
+ <input type="checkbox" name="ping_status" value="open" />
+ <span class="checkbox-title"><?php _e( 'Allow Pings' ); ?></span>
+ </label>
+ <?php endif; ?>
+ </div>
+
+ <?php
+ endif; // $bulk
+ endif; // post_type_supports comments or pings
+ ?>
+
+ <div class="inline-edit-group wp-clearfix">
+ <label class="inline-edit-status alignleft">
+ <span class="title"><?php _e( 'Status' ); ?></span>
+ <select name="_status">
+ <?php if ( $bulk ) : ?>
+ <option value="-1"><?php _e( '&mdash; No Change &mdash;' ); ?></option>
+ <?php endif; // $bulk ?>
+ <?php if ( $can_publish ) : // Contributors only get "Unpublished" and "Pending Review" ?>
+ <option value="publish"><?php _e( 'Published' ); ?></option>
+ <option value="future"><?php _e( 'Scheduled' ); ?></option>
+ <?php if ( $bulk ) : ?>
+ <option value="private"><?php _e( 'Private' ); ?></option>
+ <?php endif; // $bulk ?>
+ <?php endif; ?>
+ <option value="pending"><?php _e( 'Pending Review' ); ?></option>
+ <option value="draft"><?php _e( 'Draft' ); ?></option>
+ </select>
+ </label>
+
+ <?php if ( 'post' === $screen->post_type && $can_publish && current_user_can( $post_type_object->cap->edit_others_posts ) ) : ?>
+
+ <?php if ( $bulk ) : ?>
+
+ <label class="alignright">
+ <span class="title"><?php _e( 'Sticky' ); ?></span>
+ <select name="sticky">
+ <option value="-1"><?php _e( '&mdash; No Change &mdash;' ); ?></option>
+ <option value="sticky"><?php _e( 'Sticky' ); ?></option>
+ <option value="unsticky"><?php _e( 'Not Sticky' ); ?></option>
+ </select>
+ </label>
+
+ <?php else : // $bulk ?>
+
+ <label class="alignleft">
+ <input type="checkbox" name="sticky" value="sticky" />
+ <span class="checkbox-title"><?php _e( 'Make this post sticky' ); ?></span>
+ </label>
+
+ <?php endif; // $bulk ?>
+
+ <?php endif; // 'post' && $can_publish && current_user_can( 'edit_others_cap' ) ?>
+
+ </div>
+
+ <?php
+
+ if ( $bulk && current_theme_supports( 'post-formats' ) && post_type_supports( $screen->post_type, 'post-formats' ) ) {
+ $post_formats = get_theme_support( 'post-formats' );
+
+ ?>
+ <label class="alignleft">
+ <span class="title"><?php _ex( 'Format', 'post format' ); ?></span>
+ <select name="post_format">
+ <option value="-1"><?php _e( '&mdash; No Change &mdash;' ); ?></option>
+ <option value="0"><?php echo get_post_format_string( 'standard' ); ?></option>
+ <?php
+ if ( is_array( $post_formats[0] ) ) {
+ foreach ( $post_formats[0] as $format ) {
+ ?>
+ <option value="<?php echo esc_attr( $format ); ?>"><?php echo esc_html( get_post_format_string( $format ) ); ?></option>
+ <?php
+ }
+ }
+ ?>
+ </select></label>
+ <?php
+
+ }
+
+ ?>
+
+ </div></fieldset>
+
+ <?php
+ list( $columns ) = $this->get_column_info();
+
+ foreach ( $columns as $column_name => $column_display_name ) {
+ if ( isset( $core_columns[ $column_name ] ) ) {
+ continue;
+ }
+
+ if ( $bulk ) {
+
+ /**
+ * Fires once for each column in Bulk Edit mode.
+ *
+ * @since 2.7.0
+ *
+ * @param string $column_name Name of the column to edit.
+ * @param WP_Post $post_type The post type slug.
+ */
+ do_action( 'bulk_edit_custom_box', $column_name, $screen->post_type );
+ } else {
+
+ /**
+ * Fires once for each column in Quick Edit mode.
+ *
+ * @since 2.7.0
+ *
+ * @param string $column_name Name of the column to edit.
+ * @param string $post_type The post type slug, or current screen name if this is a taxonomy list table.
+ * @param string taxonomy The taxonomy name, if any.
+ */
+ do_action( 'quick_edit_custom_box', $column_name, $screen->post_type, '' );
+ }
+ }
+ ?>
+ <div class="submit inline-edit-save">
+ <button type="button" class="button cancel alignleft"><?php _e( 'Cancel' ); ?></button>
+ <?php
+ if ( ! $bulk ) {
+ wp_nonce_field( 'inlineeditnonce', '_inline_edit', false );
+ ?>
+ <button type="button" class="button button-primary save alignright"><?php _e( 'Update' ); ?></button>
+ <span class="spinner"></span>
+ <?php
+ } else {
+ submit_button( __( 'Update' ), 'primary alignright', 'bulk_edit', false );
+ }
+ ?>
+ <input type="hidden" name="post_view" value="<?php echo esc_attr( $m ); ?>" />
+ <input type="hidden" name="screen" value="<?php echo esc_attr( $screen->id ); ?>" />
+ <?php if ( ! $bulk && ! post_type_supports( $screen->post_type, 'author' ) ) { ?>
+ <input type="hidden" name="post_author" value="<?php echo esc_attr( $post->post_author ); ?>" />
+ <?php } ?>
+ <br class="clear" />
+ <div class="notice notice-error notice-alt inline hidden">
+ <p class="error"></p>
+ </div>
+ </div>
+ </td></tr>
+ <?php
+ $bulk++;
+ }
+ ?>
+ </tbody></table></form>
+ <?php
+ }
+}
diff --git a/www/crm/wp-admin/includes/class-wp-screen.php b/www/crm/wp-admin/includes/class-wp-screen.php
new file mode 100644
index 00000000..d75f6d33
--- /dev/null
+++ b/www/crm/wp-admin/includes/class-wp-screen.php
@@ -0,0 +1,1310 @@
+<?php
+/**
+ * Screen API: WP_Screen class
+ *
+ * @package WordPress
+ * @subpackage Administration
+ * @since 4.4.0
+ */
+
+/**
+ * Core class used to implement an admin screen API.
+ *
+ * @since 3.3.0
+ */
+final class WP_Screen {
+ /**
+ * Any action associated with the screen. 'add' for *-add.php and *-new.php screens. Empty otherwise.
+ *
+ * @since 3.3.0
+ * @var string
+ */
+ public $action;
+
+ /**
+ * The base type of the screen. This is typically the same as $id but with any post types and taxonomies stripped.
+ * For example, for an $id of 'edit-post' the base is 'edit'.
+ *
+ * @since 3.3.0
+ * @var string
+ */
+ public $base;
+
+ /**
+ * The number of columns to display. Access with get_columns().
+ *
+ * @since 3.4.0
+ * @var int
+ */
+ private $columns = 0;
+
+ /**
+ * The unique ID of the screen.
+ *
+ * @since 3.3.0
+ * @var string
+ */
+ public $id;
+
+ /**
+ * Which admin the screen is in. network | user | site | false
+ *
+ * @since 3.5.0
+ * @var string
+ */
+ protected $in_admin;
+
+ /**
+ * Whether the screen is in the network admin.
+ *
+ * Deprecated. Use in_admin() instead.
+ *
+ * @since 3.3.0
+ * @deprecated 3.5.0
+ * @var bool
+ */
+ public $is_network;
+
+ /**
+ * Whether the screen is in the user admin.
+ *
+ * Deprecated. Use in_admin() instead.
+ *
+ * @since 3.3.0
+ * @deprecated 3.5.0
+ * @var bool
+ */
+ public $is_user;
+
+ /**
+ * The base menu parent.
+ * This is derived from $parent_file by removing the query string and any .php extension.
+ * $parent_file values of 'edit.php?post_type=page' and 'edit.php?post_type=post' have a $parent_base of 'edit'.
+ *
+ * @since 3.3.0
+ * @var string
+ */
+ public $parent_base;
+
+ /**
+ * The parent_file for the screen per the admin menu system.
+ * Some $parent_file values are 'edit.php?post_type=page', 'edit.php', and 'options-general.php'.
+ *
+ * @since 3.3.0
+ * @var string
+ */
+ public $parent_file;
+
+ /**
+ * The post type associated with the screen, if any.
+ * The 'edit.php?post_type=page' screen has a post type of 'page'.
+ * The 'edit-tags.php?taxonomy=$taxonomy&post_type=page' screen has a post type of 'page'.
+ *
+ * @since 3.3.0
+ * @var string
+ */
+ public $post_type;
+
+ /**
+ * The taxonomy associated with the screen, if any.
+ * The 'edit-tags.php?taxonomy=category' screen has a taxonomy of 'category'.
+ *
+ * @since 3.3.0
+ * @var string
+ */
+ public $taxonomy;
+
+ /**
+ * The help tab data associated with the screen, if any.
+ *
+ * @since 3.3.0
+ * @var array
+ */
+ private $_help_tabs = array();
+
+ /**
+ * The help sidebar data associated with screen, if any.
+ *
+ * @since 3.3.0
+ * @var string
+ */
+ private $_help_sidebar = '';
+
+ /**
+ * The accessible hidden headings and text associated with the screen, if any.
+ *
+ * @since 4.4.0
+ * @var array
+ */
+ private $_screen_reader_content = array();
+
+ /**
+ * Stores old string-based help.
+ *
+ * @var array
+ */
+ private static $_old_compat_help = array();
+
+ /**
+ * The screen options associated with screen, if any.
+ *
+ * @since 3.3.0
+ * @var array
+ */
+ private $_options = array();
+
+ /**
+ * The screen object registry.
+ *
+ * @since 3.3.0
+ *
+ * @var array
+ */
+ private static $_registry = array();
+
+ /**
+ * Stores the result of the public show_screen_options function.
+ *
+ * @since 3.3.0
+ * @var bool
+ */
+ private $_show_screen_options;
+
+ /**
+ * Stores the 'screen_settings' section of screen options.
+ *
+ * @since 3.3.0
+ * @var string
+ */
+ private $_screen_settings;
+
+ /**
+ * Whether the screen is using the block editor.
+ *
+ * @since 5.0.0
+ * @var bool
+ */
+ public $is_block_editor = false;
+
+ /**
+ * Fetches a screen object.
+ *
+ * @since 3.3.0
+ *
+ * @global string $hook_suffix
+ *
+ * @param string|WP_Screen $hook_name Optional. The hook name (also known as the hook suffix) used to determine the screen.
+ * Defaults to the current $hook_suffix global.
+ * @return WP_Screen Screen object.
+ */
+ public static function get( $hook_name = '' ) {
+ if ( $hook_name instanceof WP_Screen ) {
+ return $hook_name;
+ }
+
+ $post_type = $taxonomy = null;
+ $in_admin = false;
+ $action = '';
+ $is_block_editor = false;
+
+ if ( $hook_name ) {
+ $id = $hook_name;
+ } else {
+ $id = $GLOBALS['hook_suffix'];
+ }
+
+ // For those pesky meta boxes.
+ if ( $hook_name && post_type_exists( $hook_name ) ) {
+ $post_type = $id;
+ $id = 'post'; // changes later. ends up being $base.
+ } else {
+ if ( '.php' == substr( $id, -4 ) ) {
+ $id = substr( $id, 0, -4 );
+ }
+
+ if ( 'post-new' == $id || 'link-add' == $id || 'media-new' == $id || 'user-new' == $id ) {
+ $id = substr( $id, 0, -4 );
+ $action = 'add';
+ }
+ }
+
+ if ( ! $post_type && $hook_name ) {
+ if ( '-network' == substr( $id, -8 ) ) {
+ $id = substr( $id, 0, -8 );
+ $in_admin = 'network';
+ } elseif ( '-user' == substr( $id, -5 ) ) {
+ $id = substr( $id, 0, -5 );
+ $in_admin = 'user';
+ }
+
+ $id = sanitize_key( $id );
+ if ( 'edit-comments' != $id && 'edit-tags' != $id && 'edit-' == substr( $id, 0, 5 ) ) {
+ $maybe = substr( $id, 5 );
+ if ( taxonomy_exists( $maybe ) ) {
+ $id = 'edit-tags';
+ $taxonomy = $maybe;
+ } elseif ( post_type_exists( $maybe ) ) {
+ $id = 'edit';
+ $post_type = $maybe;
+ }
+ }
+
+ if ( ! $in_admin ) {
+ $in_admin = 'site';
+ }
+ } else {
+ if ( defined( 'WP_NETWORK_ADMIN' ) && WP_NETWORK_ADMIN ) {
+ $in_admin = 'network';
+ } elseif ( defined( 'WP_USER_ADMIN' ) && WP_USER_ADMIN ) {
+ $in_admin = 'user';
+ } else {
+ $in_admin = 'site';
+ }
+ }
+
+ if ( 'index' == $id ) {
+ $id = 'dashboard';
+ } elseif ( 'front' == $id ) {
+ $in_admin = false;
+ }
+
+ $base = $id;
+
+ // If this is the current screen, see if we can be more accurate for post types and taxonomies.
+ if ( ! $hook_name ) {
+ if ( isset( $_REQUEST['post_type'] ) ) {
+ $post_type = post_type_exists( $_REQUEST['post_type'] ) ? $_REQUEST['post_type'] : false;
+ }
+ if ( isset( $_REQUEST['taxonomy'] ) ) {
+ $taxonomy = taxonomy_exists( $_REQUEST['taxonomy'] ) ? $_REQUEST['taxonomy'] : false;
+ }
+
+ switch ( $base ) {
+ case 'post':
+ if ( isset( $_GET['post'] ) && isset( $_POST['post_ID'] ) && (int) $_GET['post'] !== (int) $_POST['post_ID'] ) {
+ wp_die( __( 'A post ID mismatch has been detected.' ), __( 'Sorry, you are not allowed to edit this item.' ), 400 );
+ } elseif ( isset( $_GET['post'] ) ) {
+ $post_id = (int) $_GET['post'];
+ } elseif ( isset( $_POST['post_ID'] ) ) {
+ $post_id = (int) $_POST['post_ID'];
+ } else {
+ $post_id = 0;
+ }
+
+ if ( $post_id ) {
+ $post = get_post( $post_id );
+ if ( $post ) {
+ $post_type = $post->post_type;
+
+ /** This filter is documented in wp-admin/post.php */
+ $replace_editor = apply_filters( 'replace_editor', false, $post );
+
+ if ( ! $replace_editor ) {
+ $is_block_editor = use_block_editor_for_post( $post );
+ }
+ }
+ }
+ break;
+ case 'edit-tags':
+ case 'term':
+ if ( null === $post_type && is_object_in_taxonomy( 'post', $taxonomy ? $taxonomy : 'post_tag' ) ) {
+ $post_type = 'post';
+ }
+ break;
+ case 'upload':
+ $post_type = 'attachment';
+ break;
+ }
+ }
+
+ switch ( $base ) {
+ case 'post':
+ if ( null === $post_type ) {
+ $post_type = 'post';
+ }
+
+ // When creating a new post, use the default block editor support value for the post type.
+ if ( empty( $post_id ) ) {
+ $is_block_editor = use_block_editor_for_post_type( $post_type );
+ }
+
+ $id = $post_type;
+ break;
+ case 'edit':
+ if ( null === $post_type ) {
+ $post_type = 'post';
+ }
+ $id .= '-' . $post_type;
+ break;
+ case 'edit-tags':
+ case 'term':
+ if ( null === $taxonomy ) {
+ $taxonomy = 'post_tag';
+ }
+ // The edit-tags ID does not contain the post type. Look for it in the request.
+ if ( null === $post_type ) {
+ $post_type = 'post';
+ if ( isset( $_REQUEST['post_type'] ) && post_type_exists( $_REQUEST['post_type'] ) ) {
+ $post_type = $_REQUEST['post_type'];
+ }
+ }
+
+ $id = 'edit-' . $taxonomy;
+ break;
+ }
+
+ if ( 'network' == $in_admin ) {
+ $id .= '-network';
+ $base .= '-network';
+ } elseif ( 'user' == $in_admin ) {
+ $id .= '-user';
+ $base .= '-user';
+ }
+
+ if ( isset( self::$_registry[ $id ] ) ) {
+ $screen = self::$_registry[ $id ];
+ if ( $screen === get_current_screen() ) {
+ return $screen;
+ }
+ } else {
+ $screen = new WP_Screen();
+ $screen->id = $id;
+ }
+
+ $screen->base = $base;
+ $screen->action = $action;
+ $screen->post_type = (string) $post_type;
+ $screen->taxonomy = (string) $taxonomy;
+ $screen->is_user = ( 'user' == $in_admin );
+ $screen->is_network = ( 'network' == $in_admin );
+ $screen->in_admin = $in_admin;
+ $screen->is_block_editor = $is_block_editor;
+
+ self::$_registry[ $id ] = $screen;
+
+ return $screen;
+ }
+
+ /**
+ * Makes the screen object the current screen.
+ *
+ * @see set_current_screen()
+ * @since 3.3.0
+ *
+ * @global WP_Screen $current_screen
+ * @global string $taxnow
+ * @global string $typenow
+ */
+ public function set_current_screen() {
+ global $current_screen, $taxnow, $typenow;
+ $current_screen = $this;
+ $taxnow = $this->taxonomy;
+ $typenow = $this->post_type;
+
+ /**
+ * Fires after the current screen has been set.
+ *
+ * @since 3.0.0
+ *
+ * @param WP_Screen $current_screen Current WP_Screen object.
+ */
+ do_action( 'current_screen', $current_screen );
+ }
+
+ /**
+ * Constructor
+ *
+ * @since 3.3.0
+ */
+ private function __construct() {}
+
+ /**
+ * Indicates whether the screen is in a particular admin
+ *
+ * @since 3.5.0
+ *
+ * @param string $admin The admin to check against (network | user | site).
+ * If empty any of the three admins will result in true.
+ * @return bool True if the screen is in the indicated admin, false otherwise.
+ */
+ public function in_admin( $admin = null ) {
+ if ( empty( $admin ) ) {
+ return (bool) $this->in_admin;
+ }
+
+ return ( $admin == $this->in_admin );
+ }
+
+ /**
+ * Sets or returns whether the block editor is loading on the current screen.
+ *
+ * @since 5.0.0
+ *
+ * @param bool $set Optional. Sets whether the block editor is loading on the current screen or not.
+ * @return bool True if the block editor is being loaded, false otherwise.
+ */
+ public function is_block_editor( $set = null ) {
+ if ( $set !== null ) {
+ $this->is_block_editor = (bool) $set;
+ }
+
+ return $this->is_block_editor;
+ }
+
+ /**
+ * Sets the old string-based contextual help for the screen for backward compatibility.
+ *
+ * @since 3.3.0
+ *
+ * @param WP_Screen $screen A screen object.
+ * @param string $help Help text.
+ */
+ public static function add_old_compat_help( $screen, $help ) {
+ self::$_old_compat_help[ $screen->id ] = $help;
+ }
+
+ /**
+ * Set the parent information for the screen.
+ * This is called in admin-header.php after the menu parent for the screen has been determined.
+ *
+ * @since 3.3.0
+ *
+ * @param string $parent_file The parent file of the screen. Typically the $parent_file global.
+ */
+ public function set_parentage( $parent_file ) {
+ $this->parent_file = $parent_file;
+ list( $this->parent_base ) = explode( '?', $parent_file );
+ $this->parent_base = str_replace( '.php', '', $this->parent_base );
+ }
+
+ /**
+ * Adds an option for the screen.
+ * Call this in template files after admin.php is loaded and before admin-header.php is loaded to add screen options.
+ *
+ * @since 3.3.0
+ *
+ * @param string $option Option ID
+ * @param mixed $args Option-dependent arguments.
+ */
+ public function add_option( $option, $args = array() ) {
+ $this->_options[ $option ] = $args;
+ }
+
+ /**
+ * Remove an option from the screen.
+ *
+ * @since 3.8.0
+ *
+ * @param string $option Option ID.
+ */
+ public function remove_option( $option ) {
+ unset( $this->_options[ $option ] );
+ }
+
+ /**
+ * Remove all options from the screen.
+ *
+ * @since 3.8.0
+ */
+ public function remove_options() {
+ $this->_options = array();
+ }
+
+ /**
+ * Get the options registered for the screen.
+ *
+ * @since 3.8.0
+ *
+ * @return array Options with arguments.
+ */
+ public function get_options() {
+ return $this->_options;
+ }
+
+ /**
+ * Gets the arguments for an option for the screen.
+ *
+ * @since 3.3.0
+ *
+ * @param string $option Option name.
+ * @param string $key Optional. Specific array key for when the option is an array.
+ * Default false.
+ * @return string The option value if set, null otherwise.
+ */
+ public function get_option( $option, $key = false ) {
+ if ( ! isset( $this->_options[ $option ] ) ) {
+ return null;
+ }
+ if ( $key ) {
+ if ( isset( $this->_options[ $option ][ $key ] ) ) {
+ return $this->_options[ $option ][ $key ];
+ }
+ return null;
+ }
+ return $this->_options[ $option ];
+ }
+
+ /**
+ * Gets the help tabs registered for the screen.
+ *
+ * @since 3.4.0
+ * @since 4.4.0 Help tabs are ordered by their priority.
+ *
+ * @return array Help tabs with arguments.
+ */
+ public function get_help_tabs() {
+ $help_tabs = $this->_help_tabs;
+
+ $priorities = array();
+ foreach ( $help_tabs as $help_tab ) {
+ if ( isset( $priorities[ $help_tab['priority'] ] ) ) {
+ $priorities[ $help_tab['priority'] ][] = $help_tab;
+ } else {
+ $priorities[ $help_tab['priority'] ] = array( $help_tab );
+ }
+ }
+
+ ksort( $priorities );
+
+ $sorted = array();
+ foreach ( $priorities as $list ) {
+ foreach ( $list as $tab ) {
+ $sorted[ $tab['id'] ] = $tab;
+ }
+ }
+
+ return $sorted;
+ }
+
+ /**
+ * Gets the arguments for a help tab.
+ *
+ * @since 3.4.0
+ *
+ * @param string $id Help Tab ID.
+ * @return array Help tab arguments.
+ */
+ public function get_help_tab( $id ) {
+ if ( ! isset( $this->_help_tabs[ $id ] ) ) {
+ return null;
+ }
+ return $this->_help_tabs[ $id ];
+ }
+
+ /**
+ * Add a help tab to the contextual help for the screen.
+ * Call this on the load-$pagenow hook for the relevant screen.
+ *
+ * @since 3.3.0
+ * @since 4.4.0 The `$priority` argument was added.
+ *
+ * @param array $args {
+ * Array of arguments used to display the help tab.
+ *
+ * @type string $title Title for the tab. Default false.
+ * @type string $id Tab ID. Must be HTML-safe. Default false.
+ * @type string $content Optional. Help tab content in plain text or HTML. Default empty string.
+ * @type string $callback Optional. A callback to generate the tab content. Default false.
+ * @type int $priority Optional. The priority of the tab, used for ordering. Default 10.
+ * }
+ */
+ public function add_help_tab( $args ) {
+ $defaults = array(
+ 'title' => false,
+ 'id' => false,
+ 'content' => '',
+ 'callback' => false,
+ 'priority' => 10,
+ );
+ $args = wp_parse_args( $args, $defaults );
+
+ $args['id'] = sanitize_html_class( $args['id'] );
+
+ // Ensure we have an ID and title.
+ if ( ! $args['id'] || ! $args['title'] ) {
+ return;
+ }
+
+ // Allows for overriding an existing tab with that ID.
+ $this->_help_tabs[ $args['id'] ] = $args;
+ }
+
+ /**
+ * Removes a help tab from the contextual help for the screen.
+ *
+ * @since 3.3.0
+ *
+ * @param string $id The help tab ID.
+ */
+ public function remove_help_tab( $id ) {
+ unset( $this->_help_tabs[ $id ] );
+ }
+
+ /**
+ * Removes all help tabs from the contextual help for the screen.
+ *
+ * @since 3.3.0
+ */
+ public function remove_help_tabs() {
+ $this->_help_tabs = array();
+ }
+
+ /**
+ * Gets the content from a contextual help sidebar.
+ *
+ * @since 3.4.0
+ *
+ * @return string Contents of the help sidebar.
+ */
+ public function get_help_sidebar() {
+ return $this->_help_sidebar;
+ }
+
+ /**
+ * Add a sidebar to the contextual help for the screen.
+ * Call this in template files after admin.php is loaded and before admin-header.php is loaded to add a sidebar to the contextual help.
+ *
+ * @since 3.3.0
+ *
+ * @param string $content Sidebar content in plain text or HTML.
+ */
+ public function set_help_sidebar( $content ) {
+ $this->_help_sidebar = $content;
+ }
+
+ /**
+ * Gets the number of layout columns the user has selected.
+ *
+ * The layout_columns option controls the max number and default number of
+ * columns. This method returns the number of columns within that range selected
+ * by the user via Screen Options. If no selection has been made, the default
+ * provisioned in layout_columns is returned. If the screen does not support
+ * selecting the number of layout columns, 0 is returned.
+ *
+ * @since 3.4.0
+ *
+ * @return int Number of columns to display.
+ */
+ public function get_columns() {
+ return $this->columns;
+ }
+
+ /**
+ * Get the accessible hidden headings and text used in the screen.
+ *
+ * @since 4.4.0
+ *
+ * @see set_screen_reader_content() For more information on the array format.
+ *
+ * @return array An associative array of screen reader text strings.
+ */
+ public function get_screen_reader_content() {
+ return $this->_screen_reader_content;
+ }
+
+ /**
+ * Get a screen reader text string.
+ *
+ * @since 4.4.0
+ *
+ * @param string $key Screen reader text array named key.
+ * @return string Screen reader text string.
+ */
+ public function get_screen_reader_text( $key ) {
+ if ( ! isset( $this->_screen_reader_content[ $key ] ) ) {
+ return null;
+ }
+ return $this->_screen_reader_content[ $key ];
+ }
+
+ /**
+ * Add accessible hidden headings and text for the screen.
+ *
+ * @since 4.4.0
+ *
+ * @param array $content {
+ * An associative array of screen reader text strings.
+ *
+ * @type string $heading_views Screen reader text for the filter links heading.
+ * Default 'Filter items list'.
+ * @type string $heading_pagination Screen reader text for the pagination heading.
+ * Default 'Items list navigation'.
+ * @type string $heading_list Screen reader text for the items list heading.
+ * Default 'Items list'.
+ * }
+ */
+ public function set_screen_reader_content( $content = array() ) {
+ $defaults = array(
+ 'heading_views' => __( 'Filter items list' ),
+ 'heading_pagination' => __( 'Items list navigation' ),
+ 'heading_list' => __( 'Items list' ),
+ );
+ $content = wp_parse_args( $content, $defaults );
+
+ $this->_screen_reader_content = $content;
+ }
+
+ /**
+ * Remove all the accessible hidden headings and text for the screen.
+ *
+ * @since 4.4.0
+ */
+ public function remove_screen_reader_content() {
+ $this->_screen_reader_content = array();
+ }
+
+ /**
+ * Render the screen's help section.
+ *
+ * This will trigger the deprecated filters for backward compatibility.
+ *
+ * @since 3.3.0
+ *
+ * @global string $screen_layout_columns
+ */
+ public function render_screen_meta() {
+
+ /**
+ * Filters the legacy contextual help list.
+ *
+ * @since 2.7.0
+ * @deprecated 3.3.0 Use get_current_screen()->add_help_tab() or
+ * get_current_screen()->remove_help_tab() instead.
+ *
+ * @param array $old_compat_help Old contextual help.
+ * @param WP_Screen $this Current WP_Screen instance.
+ */
+ self::$_old_compat_help = apply_filters( 'contextual_help_list', self::$_old_compat_help, $this );
+
+ $old_help = isset( self::$_old_compat_help[ $this->id ] ) ? self::$_old_compat_help[ $this->id ] : '';
+
+ /**
+ * Filters the legacy contextual help text.
+ *
+ * @since 2.7.0
+ * @deprecated 3.3.0 Use get_current_screen()->add_help_tab() or
+ * get_current_screen()->remove_help_tab() instead.
+ *
+ * @param string $old_help Help text that appears on the screen.
+ * @param string $screen_id Screen ID.
+ * @param WP_Screen $this Current WP_Screen instance.
+ */
+ $old_help = apply_filters( 'contextual_help', $old_help, $this->id, $this );
+
+ // Default help only if there is no old-style block of text and no new-style help tabs.
+ if ( empty( $old_help ) && ! $this->get_help_tabs() ) {
+
+ /**
+ * Filters the default legacy contextual help text.
+ *
+ * @since 2.8.0
+ * @deprecated 3.3.0 Use get_current_screen()->add_help_tab() or
+ * get_current_screen()->remove_help_tab() instead.
+ *
+ * @param string $old_help_default Default contextual help text.
+ */
+ $default_help = apply_filters( 'default_contextual_help', '' );
+ if ( $default_help ) {
+ $old_help = '<p>' . $default_help . '</p>';
+ }
+ }
+
+ if ( $old_help ) {
+ $this->add_help_tab(
+ array(
+ 'id' => 'old-contextual-help',
+ 'title' => __( 'Overview' ),
+ 'content' => $old_help,
+ )
+ );
+ }
+
+ $help_sidebar = $this->get_help_sidebar();
+
+ $help_class = 'hidden';
+ if ( ! $help_sidebar ) {
+ $help_class .= ' no-sidebar';
+ }
+
+ // Time to render!
+ ?>
+ <div id="screen-meta" class="metabox-prefs">
+
+ <div id="contextual-help-wrap" class="<?php echo esc_attr( $help_class ); ?>" tabindex="-1" aria-label="<?php esc_attr_e( 'Contextual Help Tab' ); ?>">
+ <div id="contextual-help-back"></div>
+ <div id="contextual-help-columns">
+ <div class="contextual-help-tabs">
+ <ul>
+ <?php
+ $class = ' class="active"';
+ foreach ( $this->get_help_tabs() as $tab ) :
+ $link_id = "tab-link-{$tab['id']}";
+ $panel_id = "tab-panel-{$tab['id']}";
+ ?>
+
+ <li id="<?php echo esc_attr( $link_id ); ?>"<?php echo $class; ?>>
+ <a href="<?php echo esc_url( "#$panel_id" ); ?>" aria-controls="<?php echo esc_attr( $panel_id ); ?>">
+ <?php echo esc_html( $tab['title'] ); ?>
+ </a>
+ </li>
+ <?php
+ $class = '';
+ endforeach;
+ ?>
+ </ul>
+ </div>
+
+ <?php if ( $help_sidebar ) : ?>
+ <div class="contextual-help-sidebar">
+ <?php echo $help_sidebar; ?>
+ </div>
+ <?php endif; ?>
+
+ <div class="contextual-help-tabs-wrap">
+ <?php
+ $classes = 'help-tab-content active';
+ foreach ( $this->get_help_tabs() as $tab ) :
+ $panel_id = "tab-panel-{$tab['id']}";
+ ?>
+
+ <div id="<?php echo esc_attr( $panel_id ); ?>" class="<?php echo $classes; ?>">
+ <?php
+ // Print tab content.
+ echo $tab['content'];
+
+ // If it exists, fire tab callback.
+ if ( ! empty( $tab['callback'] ) ) {
+ call_user_func_array( $tab['callback'], array( $this, $tab ) );
+ }
+ ?>
+ </div>
+ <?php
+ $classes = 'help-tab-content';
+ endforeach;
+ ?>
+ </div>
+ </div>
+ </div>
+ <?php
+ // Setup layout columns
+
+ /**
+ * Filters the array of screen layout columns.
+ *
+ * This hook provides back-compat for plugins using the back-compat
+ * Filters instead of add_screen_option().
+ *
+ * @since 2.8.0
+ *
+ * @param array $empty_columns Empty array.
+ * @param string $screen_id Screen ID.
+ * @param WP_Screen $this Current WP_Screen instance.
+ */
+ $columns = apply_filters( 'screen_layout_columns', array(), $this->id, $this );
+
+ if ( ! empty( $columns ) && isset( $columns[ $this->id ] ) ) {
+ $this->add_option( 'layout_columns', array( 'max' => $columns[ $this->id ] ) );
+ }
+
+ if ( $this->get_option( 'layout_columns' ) ) {
+ $this->columns = (int) get_user_option( "screen_layout_$this->id" );
+
+ if ( ! $this->columns && $this->get_option( 'layout_columns', 'default' ) ) {
+ $this->columns = $this->get_option( 'layout_columns', 'default' );
+ }
+ }
+ $GLOBALS['screen_layout_columns'] = $this->columns; // Set the global for back-compat.
+
+ // Add screen options
+ if ( $this->show_screen_options() ) {
+ $this->render_screen_options();
+ }
+ ?>
+ </div>
+ <?php
+ if ( ! $this->get_help_tabs() && ! $this->show_screen_options() ) {
+ return;
+ }
+ ?>
+ <div id="screen-meta-links">
+ <?php if ( $this->show_screen_options() ) : ?>
+ <div id="screen-options-link-wrap" class="hide-if-no-js screen-meta-toggle">
+ <button type="button" id="show-settings-link" class="button show-settings" aria-controls="screen-options-wrap" aria-expanded="false"><?php _e( 'Screen Options' ); ?></button>
+ </div>
+ <?php
+ endif;
+ if ( $this->get_help_tabs() ) :
+ ?>
+ <div id="contextual-help-link-wrap" class="hide-if-no-js screen-meta-toggle">
+ <button type="button" id="contextual-help-link" class="button show-settings" aria-controls="contextual-help-wrap" aria-expanded="false"><?php _e( 'Help' ); ?></button>
+ </div>
+ <?php endif; ?>
+ </div>
+ <?php
+ }
+
+ /**
+ * @global array $wp_meta_boxes
+ *
+ * @return bool
+ */
+ public function show_screen_options() {
+ global $wp_meta_boxes;
+
+ if ( is_bool( $this->_show_screen_options ) ) {
+ return $this->_show_screen_options;
+ }
+
+ $columns = get_column_headers( $this );
+
+ $show_screen = ! empty( $wp_meta_boxes[ $this->id ] ) || $columns || $this->get_option( 'per_page' );
+
+ $this->_screen_settings = '';
+
+ if ( 'post' === $this->base ) {
+ $expand = '<fieldset class="editor-expand hidden"><legend>' . __( 'Additional settings' ) . '</legend><label for="editor-expand-toggle">';
+ $expand .= '<input type="checkbox" id="editor-expand-toggle"' . checked( get_user_setting( 'editor_expand', 'on' ), 'on', false ) . ' />';
+ $expand .= __( 'Enable full-height editor and distraction-free functionality.' ) . '</label></fieldset>';
+ $this->_screen_settings = $expand;
+ }
+
+ /**
+ * Filters the screen settings text displayed in the Screen Options tab.
+ *
+ * This filter is currently only used on the Widgets screen to enable
+ * accessibility mode.
+ *
+ * @since 3.0.0
+ *
+ * @param string $screen_settings Screen settings.
+ * @param WP_Screen $this WP_Screen object.
+ */
+ $this->_screen_settings = apply_filters( 'screen_settings', $this->_screen_settings, $this );
+
+ if ( $this->_screen_settings || $this->_options ) {
+ $show_screen = true;
+ }
+
+ /**
+ * Filters whether to show the Screen Options tab.
+ *
+ * @since 3.2.0
+ *
+ * @param bool $show_screen Whether to show Screen Options tab.
+ * Default true.
+ * @param WP_Screen $this Current WP_Screen instance.
+ */
+ $this->_show_screen_options = apply_filters( 'screen_options_show_screen', $show_screen, $this );
+ return $this->_show_screen_options;
+ }
+
+ /**
+ * Render the screen options tab.
+ *
+ * @since 3.3.0
+ *
+ * @param array $options {
+ * @type bool $wrap Whether the screen-options-wrap div will be included. Defaults to true.
+ * }
+ */
+ public function render_screen_options( $options = array() ) {
+ $options = wp_parse_args(
+ $options,
+ array(
+ 'wrap' => true,
+ )
+ );
+
+ $wrapper_start = $wrapper_end = $form_start = $form_end = '';
+
+ // Output optional wrapper.
+ if ( $options['wrap'] ) {
+ $wrapper_start = '<div id="screen-options-wrap" class="hidden" tabindex="-1" aria-label="' . esc_attr__( 'Screen Options Tab' ) . '">';
+ $wrapper_end = '</div>';
+ }
+
+ // Don't output the form and nonce for the widgets accessibility mode links.
+ if ( 'widgets' !== $this->base ) {
+ $form_start = "\n<form id='adv-settings' method='post'>\n";
+ $form_end = "\n" . wp_nonce_field( 'screen-options-nonce', 'screenoptionnonce', false, false ) . "\n</form>\n";
+ }
+
+ echo $wrapper_start . $form_start;
+
+ $this->render_meta_boxes_preferences();
+ $this->render_list_table_columns_preferences();
+ $this->render_screen_layout();
+ $this->render_per_page_options();
+ $this->render_view_mode();
+ echo $this->_screen_settings;
+
+ /**
+ * Filters whether to show the Screen Options submit button.
+ *
+ * @since 4.4.0
+ *
+ * @param bool $show_button Whether to show Screen Options submit button.
+ * Default false.
+ * @param WP_Screen $this Current WP_Screen instance.
+ */
+ $show_button = apply_filters( 'screen_options_show_submit', false, $this );
+
+ if ( $show_button ) {
+ submit_button( __( 'Apply' ), 'primary', 'screen-options-apply', true );
+ }
+
+ echo $form_end . $wrapper_end;
+ }
+
+ /**
+ * Render the meta boxes preferences.
+ *
+ * @since 4.4.0
+ *
+ * @global array $wp_meta_boxes
+ */
+ public function render_meta_boxes_preferences() {
+ global $wp_meta_boxes;
+
+ if ( ! isset( $wp_meta_boxes[ $this->id ] ) ) {
+ return;
+ }
+ ?>
+ <fieldset class="metabox-prefs">
+ <legend><?php _e( 'Boxes' ); ?></legend>
+ <?php
+ meta_box_prefs( $this );
+
+ if ( 'dashboard' === $this->id && has_action( 'welcome_panel' ) && current_user_can( 'edit_theme_options' ) ) {
+ if ( isset( $_GET['welcome'] ) ) {
+ $welcome_checked = empty( $_GET['welcome'] ) ? 0 : 1;
+ update_user_meta( get_current_user_id(), 'show_welcome_panel', $welcome_checked );
+ } else {
+ $welcome_checked = get_user_meta( get_current_user_id(), 'show_welcome_panel', true );
+ if ( 2 == $welcome_checked && wp_get_current_user()->user_email != get_option( 'admin_email' ) ) {
+ $welcome_checked = false;
+ }
+ }
+ echo '<label for="wp_welcome_panel-hide">';
+ echo '<input type="checkbox" id="wp_welcome_panel-hide"' . checked( (bool) $welcome_checked, true, false ) . ' />';
+ echo _x( 'Welcome', 'Welcome panel' ) . "</label>\n";
+ }
+ ?>
+ </fieldset>
+ <?php
+ }
+
+ /**
+ * Render the list table columns preferences.
+ *
+ * @since 4.4.0
+ */
+ public function render_list_table_columns_preferences() {
+
+ $columns = get_column_headers( $this );
+ $hidden = get_hidden_columns( $this );
+
+ if ( ! $columns ) {
+ return;
+ }
+
+ $legend = ! empty( $columns['_title'] ) ? $columns['_title'] : __( 'Columns' );
+ ?>
+ <fieldset class="metabox-prefs">
+ <legend><?php echo $legend; ?></legend>
+ <?php
+ $special = array( '_title', 'cb', 'comment', 'media', 'name', 'title', 'username', 'blogname' );
+
+ foreach ( $columns as $column => $title ) {
+ // Can't hide these for they are special
+ if ( in_array( $column, $special ) ) {
+ continue;
+ }
+
+ if ( empty( $title ) ) {
+ continue;
+ }
+
+ /*
+ * The Comments column uses HTML in the display name with some screen
+ * reader text. Make sure to strip tags from the Comments column
+ * title and any other custom column title plugins might add.
+ */
+ $title = wp_strip_all_tags( $title );
+
+ $id = "$column-hide";
+ echo '<label>';
+ echo '<input class="hide-column-tog" name="' . $id . '" type="checkbox" id="' . $id . '" value="' . $column . '"' . checked( ! in_array( $column, $hidden ), true, false ) . ' />';
+ echo "$title</label>\n";
+ }
+ ?>
+ </fieldset>
+ <?php
+ }
+
+ /**
+ * Render the option for number of columns on the page
+ *
+ * @since 3.3.0
+ */
+ public function render_screen_layout() {
+ if ( ! $this->get_option( 'layout_columns' ) ) {
+ return;
+ }
+
+ $screen_layout_columns = $this->get_columns();
+ $num = $this->get_option( 'layout_columns', 'max' );
+
+ ?>
+ <fieldset class='columns-prefs'>
+ <legend class="screen-layout"><?php _e( 'Layout' ); ?></legend>
+ <?php
+ for ( $i = 1; $i <= $num; ++$i ) :
+ ?>
+ <label class="columns-prefs-<?php echo $i; ?>">
+ <input type='radio' name='screen_columns' value='<?php echo esc_attr( $i ); ?>'
+ <?php checked( $screen_layout_columns, $i ); ?> />
+ <?php printf( _n( '%s column', '%s columns', $i ), number_format_i18n( $i ) ); ?>
+ </label>
+ <?php
+ endfor;
+ ?>
+ </fieldset>
+ <?php
+ }
+
+ /**
+ * Render the items per page option
+ *
+ * @since 3.3.0
+ */
+ public function render_per_page_options() {
+ if ( null === $this->get_option( 'per_page' ) ) {
+ return;
+ }
+
+ $per_page_label = $this->get_option( 'per_page', 'label' );
+ if ( null === $per_page_label ) {
+ $per_page_label = __( 'Number of items per page:' );
+ }
+
+ $option = $this->get_option( 'per_page', 'option' );
+ if ( ! $option ) {
+ $option = str_replace( '-', '_', "{$this->id}_per_page" );
+ }
+
+ $per_page = (int) get_user_option( $option );
+ if ( empty( $per_page ) || $per_page < 1 ) {
+ $per_page = $this->get_option( 'per_page', 'default' );
+ if ( ! $per_page ) {
+ $per_page = 20;
+ }
+ }
+
+ if ( 'edit_comments_per_page' == $option ) {
+ $comment_status = isset( $_REQUEST['comment_status'] ) ? $_REQUEST['comment_status'] : 'all';
+
+ /** This filter is documented in wp-admin/includes/class-wp-comments-list-table.php */
+ $per_page = apply_filters( 'comments_per_page', $per_page, $comment_status );
+ } elseif ( 'categories_per_page' == $option ) {
+ /** This filter is documented in wp-admin/includes/class-wp-terms-list-table.php */
+ $per_page = apply_filters( 'edit_categories_per_page', $per_page );
+ } else {
+ /** This filter is documented in wp-admin/includes/class-wp-list-table.php */
+ $per_page = apply_filters( "{$option}", $per_page );
+ }
+
+ // Back compat
+ if ( isset( $this->post_type ) ) {
+ /** This filter is documented in wp-admin/includes/post.php */
+ $per_page = apply_filters( 'edit_posts_per_page', $per_page, $this->post_type );
+ }
+
+ // This needs a submit button
+ add_filter( 'screen_options_show_submit', '__return_true' );
+
+ ?>
+ <fieldset class="screen-options">
+ <legend><?php _e( 'Pagination' ); ?></legend>
+ <?php if ( $per_page_label ) : ?>
+ <label for="<?php echo esc_attr( $option ); ?>"><?php echo $per_page_label; ?></label>
+ <input type="number" step="1" min="1" max="999" class="screen-per-page" name="wp_screen_options[value]"
+ id="<?php echo esc_attr( $option ); ?>" maxlength="3"
+ value="<?php echo esc_attr( $per_page ); ?>" />
+ <?php endif; ?>
+ <input type="hidden" name="wp_screen_options[option]" value="<?php echo esc_attr( $option ); ?>" />
+ </fieldset>
+ <?php
+ }
+
+ /**
+ * Render the list table view mode preferences.
+ *
+ * @since 4.4.0
+ *
+ * @global string $mode List table view mode.
+ */
+ public function render_view_mode() {
+ $screen = get_current_screen();
+
+ // Currently only enabled for posts lists
+ if ( 'edit' !== $screen->base ) {
+ return;
+ }
+
+ $view_mode_post_types = get_post_types(
+ array(
+ 'hierarchical' => false,
+ 'show_ui' => true,
+ )
+ );
+
+ /**
+ * Filters the post types that have different view mode options.
+ *
+ * @since 4.4.0
+ *
+ * @param string[] $view_mode_post_types Array of post types that can change view modes.
+ * Default non-hierarchical post types with show_ui on.
+ */
+ $view_mode_post_types = apply_filters( 'view_mode_post_types', $view_mode_post_types );
+
+ if ( ! in_array( $this->post_type, $view_mode_post_types ) ) {
+ return;
+ }
+
+ global $mode;
+
+ // This needs a submit button
+ add_filter( 'screen_options_show_submit', '__return_true' );
+ ?>
+ <fieldset class="metabox-prefs view-mode">
+ <legend><?php _e( 'View Mode' ); ?></legend>
+ <label for="list-view-mode">
+ <input id="list-view-mode" type="radio" name="mode" value="list" <?php checked( 'list', $mode ); ?> />
+ <?php _e( 'List View' ); ?>
+ </label>
+ <label for="excerpt-view-mode">
+ <input id="excerpt-view-mode" type="radio" name="mode" value="excerpt" <?php checked( 'excerpt', $mode ); ?> />
+ <?php _e( 'Excerpt View' ); ?>
+ </label>
+ </fieldset>
+ <?php
+ }
+
+ /**
+ * Render screen reader text.
+ *
+ * @since 4.4.0
+ *
+ * @param string $key The screen reader text array named key.
+ * @param string $tag Optional. The HTML tag to wrap the screen reader text. Default h2.
+ */
+ public function render_screen_reader_content( $key = '', $tag = 'h2' ) {
+
+ if ( ! isset( $this->_screen_reader_content[ $key ] ) ) {
+ return;
+ }
+ echo "<$tag class='screen-reader-text'>" . $this->_screen_reader_content[ $key ] . "</$tag>";
+ }
+}
diff --git a/www/crm/wp-admin/includes/class-wp-site-health-auto-updates.php b/www/crm/wp-admin/includes/class-wp-site-health-auto-updates.php
new file mode 100644
index 00000000..b202235f
--- /dev/null
+++ b/www/crm/wp-admin/includes/class-wp-site-health-auto-updates.php
@@ -0,0 +1,449 @@
+<?php
+/**
+ * Class for testing automatic updates in the WordPress code.
+ *
+ * @package WordPress
+ * @subpackage Site_Health
+ * @since 5.2.0
+ */
+
+class WP_Site_Health_Auto_Updates {
+ /**
+ * WP_Site_Health_Auto_Updates constructor.
+ * @since 5.2.0
+ */
+ public function __construct() {
+ include_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';
+ }
+
+
+ /**
+ * Run tests to determine if auto-updates can run.
+ *
+ * @since 5.2.0
+ *
+ * @return array The test results.
+ */
+ public function run_tests() {
+ $tests = array(
+ $this->test_constants( 'DISALLOW_FILE_MODS', false ),
+ $this->test_constants( 'AUTOMATIC_UPDATER_DISABLED', false ),
+ $this->test_constants( 'WP_AUTO_UPDATE_CORE', true ),
+ $this->test_wp_version_check_attached(),
+ $this->test_filters_automatic_updater_disabled(),
+ $this->test_if_failed_update(),
+ $this->test_vcs_abspath(),
+ $this->test_check_wp_filesystem_method(),
+ $this->test_all_files_writable(),
+ $this->test_accepts_dev_updates(),
+ $this->test_accepts_minor_updates(),
+ );
+
+ $tests = array_filter( $tests );
+ $tests = array_map(
+ function( $test ) {
+ $test = (object) $test;
+
+ if ( empty( $test->severity ) ) {
+ $test->severity = 'warning';
+ }
+
+ return $test;
+ },
+ $tests
+ );
+
+ return $tests;
+ }
+
+ /**
+ * Test if auto-updates related constants are set correctly.
+ *
+ * @since 5.2.0
+ *
+ * @param string $constant The name of the constant to check.
+ * @param bool $value The value that the constant should be, if set.
+ * @return array The test results.
+ */
+ public function test_constants( $constant, $value ) {
+ if ( defined( $constant ) && constant( $constant ) != $value ) {
+ return array(
+ 'description' => sprintf(
+ /* translators: %s: Name of the constant used. */
+ __( 'The %s constant is defined and enabled.' ),
+ "<code>$constant</code>"
+ ),
+ 'severity' => 'fail',
+ );
+ }
+ }
+
+ /**
+ * Check if updates are intercepted by a filter.
+ *
+ * @since 5.2.0
+ *
+ * @return array The test results.
+ */
+ public function test_wp_version_check_attached() {
+ if ( ! is_main_site() ) {
+ return;
+ }
+
+ $cookies = wp_unslash( $_COOKIE );
+ $timeout = 10;
+ $headers = array(
+ 'Cache-Control' => 'no-cache',
+ );
+
+ // Include Basic auth in loopback requests.
+ if ( isset( $_SERVER['PHP_AUTH_USER'] ) && isset( $_SERVER['PHP_AUTH_PW'] ) ) {
+ $headers['Authorization'] = 'Basic ' . base64_encode( wp_unslash( $_SERVER['PHP_AUTH_USER'] ) . ':' . wp_unslash( $_SERVER['PHP_AUTH_PW'] ) );
+ }
+
+ $url = add_query_arg(
+ array(
+ 'health-check-test-wp_version_check' => true,
+ ),
+ admin_url( 'site-health.php' )
+ );
+
+ $test = wp_remote_get( $url, compact( 'cookies', 'headers', 'timeout' ) );
+
+ if ( is_wp_error( $test ) ) {
+ return array(
+ 'description' => sprintf(
+ /* translators: %s: Name of the filter used. */
+ __( 'Could not confirm that the %s filter is available.' ),
+ '<code>wp_version_check()</code>'
+ ),
+ 'severity' => 'warning',
+ );
+ }
+
+ $response = wp_remote_retrieve_body( $test );
+
+ if ( 'yes' !== $response ) {
+ return array(
+ 'description' => sprintf(
+ /* translators: %s: Name of the filter used. */
+ __( 'A plugin has prevented updates by disabling %s.' ),
+ '<code>wp_version_check()</code>'
+ ),
+ 'severity' => 'fail',
+ );
+ }
+ }
+
+ /**
+ * Check if automatic updates are disabled by a filter.
+ *
+ * @since 5.2.0
+ *
+ * @return array The test results.
+ */
+ public function test_filters_automatic_updater_disabled() {
+ if ( apply_filters( 'automatic_updater_disabled', false ) ) {
+ return array(
+ 'description' => sprintf(
+ /* translators: %s: Name of the filter used. */
+ __( 'The %s filter is enabled.' ),
+ '<code>automatic_updater_disabled</code>'
+ ),
+ 'severity' => 'fail',
+ );
+ }
+ }
+
+ /**
+ * Check if automatic updates have tried to run, but failed, previously.
+ *
+ * @since 5.2.0
+ *
+ * @return array|bool The test results. false if the auto updates failed.
+ */
+ function test_if_failed_update() {
+ $failed = get_site_option( 'auto_core_update_failed' );
+
+ if ( ! $failed ) {
+ return false;
+ }
+
+ if ( ! empty( $failed['critical'] ) ) {
+ $description = __( 'A previous automatic background update ended with a critical failure, so updates are now disabled.' );
+ $description .= ' ' . __( 'You would have received an email because of this.' );
+ $description .= ' ' . __( "When you've been able to update using the \"Update Now\" button on Dashboard > Updates, we'll clear this error for future update attempts." );
+ $description .= ' ' . sprintf(
+ /* translators: %s: Code of error shown. */
+ __( 'The error code was %s.' ),
+ '<code>' . $failed['error_code'] . '</code>'
+ );
+ return array(
+ 'description' => $description,
+ 'severity' => 'warning',
+ );
+ }
+
+ $description = __( 'A previous automatic background update could not occur.' );
+ if ( empty( $failed['retry'] ) ) {
+ $description .= ' ' . __( 'You would have received an email because of this.' );
+ }
+
+ $description .= ' ' . __( "We'll try again with the next release." );
+ $description .= ' ' . sprintf(
+ /* translators: %s: Code of error shown. */
+ __( 'The error code was %s.' ),
+ '<code>' . $failed['error_code'] . '</code>'
+ );
+ return array(
+ 'description' => $description,
+ 'severity' => 'warning',
+ );
+ }
+
+ /**
+ * Check if WordPress is controlled by a VCS (Git, Subversion etc).
+ *
+ * @since 5.2.0
+ *
+ * @return array The test results.
+ */
+ public function test_vcs_abspath() {
+ $context_dirs = array( ABSPATH );
+ $vcs_dirs = array( '.svn', '.git', '.hg', '.bzr' );
+ $check_dirs = array();
+
+ foreach ( $context_dirs as $context_dir ) {
+ // Walk up from $context_dir to the root.
+ do {
+ $check_dirs[] = $context_dir;
+
+ // Once we've hit '/' or 'C:\', we need to stop. dirname will keep returning the input here.
+ if ( dirname( $context_dir ) == $context_dir ) {
+ break;
+ }
+
+ // Continue one level at a time.
+ } while ( $context_dir = dirname( $context_dir ) );
+ }
+
+ $check_dirs = array_unique( $check_dirs );
+
+ // Search all directories we've found for evidence of version control.
+ foreach ( $vcs_dirs as $vcs_dir ) {
+ foreach ( $check_dirs as $check_dir ) {
+ // phpcs:ignore
+ if ( $checkout = @is_dir( rtrim( $check_dir, '\\/' ) . "/$vcs_dir" ) ) {
+ break 2;
+ }
+ }
+ }
+
+ if ( $checkout && ! apply_filters( 'automatic_updates_is_vcs_checkout', true, ABSPATH ) ) {
+ return array(
+ 'description' => sprintf(
+ // translators: 1: Folder name. 2: Version control directory. 3: Filter name.
+ __( 'The folder %1$s was detected as being under version control (%2$s), but the %3$s filter is allowing updates.' ),
+ '<code>' . $check_dir . '</code>',
+ "<code>$vcs_dir</code>",
+ '<code>automatic_updates_is_vcs_checkout</code>'
+ ),
+ 'severity' => 'info',
+ );
+ }
+
+ if ( $checkout ) {
+ return array(
+ 'description' => sprintf(
+ // translators: 1: Folder name. 2: Version control directory.
+ __( 'The folder %1$s was detected as being under version control (%2$s).' ),
+ '<code>' . $check_dir . '</code>',
+ "<code>$vcs_dir</code>"
+ ),
+ 'severity' => 'fail',
+ );
+ }
+
+ return array(
+ 'description' => __( 'No version control systems were detected.' ),
+ 'severity' => 'pass',
+ );
+ }
+
+ /**
+ * Check if we can access files without providing credentials.
+ *
+ * @since 5.2.0
+ *
+ * @return array The test results.
+ */
+ function test_check_wp_filesystem_method() {
+ $skin = new Automatic_Upgrader_Skin;
+ $success = $skin->request_filesystem_credentials( false, ABSPATH );
+
+ if ( ! $success ) {
+ $description = __( 'Your installation of WordPress prompts for FTP credentials to perform updates.' );
+ $description .= ' ' . __( '(Your site is performing updates over FTP due to file ownership. Talk to your hosting company.)' );
+
+ return array(
+ 'description' => $description,
+ 'severity' => 'fail',
+ );
+ }
+
+ return array(
+ 'description' => __( "Your installation of WordPress doesn't require FTP credentials to perform updates." ),
+ 'severity' => 'pass',
+ );
+ }
+
+ /**
+ * Check if core files are writable by the web user/group.
+ *
+ * @since 5.2.0
+ *
+ * @global WP_Filesystem_Base $wp_filesystem WordPress filesystem subclass.
+ *
+ * @return array|bool The test results. false if they're not writeable.
+ */
+ function test_all_files_writable() {
+ global $wp_filesystem;
+
+ include ABSPATH . WPINC . '/version.php'; // $wp_version; // x.y.z
+
+ $skin = new Automatic_Upgrader_Skin;
+ $success = $skin->request_filesystem_credentials( false, ABSPATH );
+
+ if ( ! $success ) {
+ return false;
+ }
+
+ WP_Filesystem();
+
+ if ( 'direct' != $wp_filesystem->method ) {
+ return false;
+ }
+
+ $checksums = get_core_checksums( $wp_version, 'en_US' );
+ $dev = ( false !== strpos( $wp_version, '-' ) );
+ // Get the last stable version's files and test against that
+ if ( ! $checksums && $dev ) {
+ $checksums = get_core_checksums( (float) $wp_version - 0.1, 'en_US' );
+ }
+
+ // There aren't always checksums for development releases, so just skip the test if we still can't find any
+ if ( ! $checksums && $dev ) {
+ return false;
+ }
+
+ if ( ! $checksums ) {
+ $description = sprintf(
+ // translators: %s: WordPress version
+ __( "Couldn't retrieve a list of the checksums for WordPress %s." ),
+ $wp_version
+ );
+ $description .= ' ' . __( 'This could mean that connections are failing to WordPress.org.' );
+ return array(
+ 'description' => $description,
+ 'severity' => 'warning',
+ );
+ }
+
+ $unwritable_files = array();
+ foreach ( array_keys( $checksums ) as $file ) {
+ if ( 'wp-content' == substr( $file, 0, 10 ) ) {
+ continue;
+ }
+ if ( ! file_exists( ABSPATH . $file ) ) {
+ continue;
+ }
+ if ( ! is_writable( ABSPATH . $file ) ) {
+ $unwritable_files[] = $file;
+ }
+ }
+
+ if ( $unwritable_files ) {
+ if ( count( $unwritable_files ) > 20 ) {
+ $unwritable_files = array_slice( $unwritable_files, 0, 20 );
+ $unwritable_files[] = '...';
+ }
+ return array(
+ 'description' => __( 'Some files are not writable by WordPress:' ) . ' <ul><li>' . implode( '</li><li>', $unwritable_files ) . '</li></ul>',
+ 'severity' => 'fail',
+ );
+ } else {
+ return array(
+ 'description' => __( 'All of your WordPress files are writable.' ),
+ 'severity' => 'pass',
+ );
+ }
+ }
+
+ /**
+ * Check if the install is using a development branch and can use nightly packages.
+ *
+ * @since 5.2.0
+ *
+ * @return array|bool The test results. false if it isn't a development version.
+ */
+ function test_accepts_dev_updates() {
+ include ABSPATH . WPINC . '/version.php'; // $wp_version; // x.y.z
+ // Only for dev versions
+ if ( false === strpos( $wp_version, '-' ) ) {
+ return false;
+ }
+
+ if ( defined( 'WP_AUTO_UPDATE_CORE' ) && ( 'minor' === WP_AUTO_UPDATE_CORE || false === WP_AUTO_UPDATE_CORE ) ) {
+ return array(
+ 'description' => sprintf(
+ /* translators: %s: Name of the constant used. */
+ __( 'WordPress development updates are blocked by the %s constant.' ),
+ '<code>WP_AUTO_UPDATE_CORE</code>'
+ ),
+ 'severity' => 'fail',
+ );
+ }
+
+ if ( ! apply_filters( 'allow_dev_auto_core_updates', $wp_version ) ) {
+ return array(
+ 'description' => sprintf(
+ /* translators: %s: Name of the filter used. */
+ __( 'WordPress development updates are blocked by the %s filter.' ),
+ '<code>allow_dev_auto_core_updates</code>'
+ ),
+ 'severity' => 'fail',
+ );
+ }
+ }
+
+ /**
+ * Check if the site supports automatic minor updates.
+ *
+ * @since 5.2.0
+ *
+ * @return array The test results.
+ */
+ function test_accepts_minor_updates() {
+ if ( defined( 'WP_AUTO_UPDATE_CORE' ) && false === WP_AUTO_UPDATE_CORE ) {
+ return array(
+ 'description' => sprintf(
+ /* translators: %s: Name of the constant used. */
+ __( 'WordPress security and maintenance releases are blocked by %s.' ),
+ "<code>define( 'WP_AUTO_UPDATE_CORE', false );</code>"
+ ),
+ 'severity' => 'fail',
+ );
+ }
+
+ if ( ! apply_filters( 'allow_minor_auto_core_updates', true ) ) {
+ return array(
+ 'description' => sprintf(
+ /* translators: %s: Name of the filter used. */
+ __( 'WordPress security and maintenance releases are blocked by the %s filter.' ),
+ '<code>allow_minor_auto_core_updates</code>'
+ ),
+ 'severity' => 'fail',
+ );
+ }
+ }
+}
diff --git a/www/crm/wp-admin/includes/class-wp-site-health.php b/www/crm/wp-admin/includes/class-wp-site-health.php
new file mode 100644
index 00000000..12e12735
--- /dev/null
+++ b/www/crm/wp-admin/includes/class-wp-site-health.php
@@ -0,0 +1,1990 @@
+<?php
+/**
+ * Class for looking up a site's health based on a user's WordPress environment.
+ *
+ * @package WordPress
+ * @subpackage Site_Health
+ * @since 5.2.0
+ */
+
+class WP_Site_Health {
+ private $mysql_min_version_check;
+ private $mysql_rec_version_check;
+
+ public $is_mariadb = false;
+ private $mysql_server_version = '';
+ private $health_check_mysql_required_version = '5.5';
+ private $health_check_mysql_rec_version = '';
+
+ public $schedules;
+ public $crons;
+ public $last_missed_cron = null;
+
+ /**
+ * WP_Site_Health constructor.
+ *
+ * @since 5.2.0
+ */
+ public function __construct() {
+ $this->prepare_sql_data();
+
+ add_filter( 'admin_body_class', array( $this, 'admin_body_class' ) );
+
+ add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_scripts' ) );
+ }
+
+ /**
+ * Enqueues the site health scripts.
+ *
+ * @since 5.2.0
+ */
+ public function enqueue_scripts() {
+ $screen = get_current_screen();
+ if ( 'site-health' !== $screen->id ) {
+ return;
+ }
+
+ $health_check_js_variables = array(
+ 'screen' => $screen->id,
+ 'nonce' => array(
+ 'site_status' => wp_create_nonce( 'health-check-site-status' ),
+ 'site_status_result' => wp_create_nonce( 'health-check-site-status-result' ),
+ ),
+ 'site_status' => array(
+ 'direct' => array(),
+ 'async' => array(),
+ 'issues' => array(
+ 'good' => 0,
+ 'recommended' => 0,
+ 'critical' => 0,
+ ),
+ ),
+ );
+
+ $issue_counts = get_transient( 'health-check-site-status-result' );
+
+ if ( false !== $issue_counts ) {
+ $issue_counts = json_decode( $issue_counts );
+
+ $health_check_js_variables['site_status']['issues'] = $issue_counts;
+ }
+
+ if ( 'site-health' === $screen->id && ! isset( $_GET['tab'] ) ) {
+ $tests = WP_Site_Health::get_tests();
+
+ // Don't run https test on localhost
+ if ( 'localhost' === preg_replace( '|https?://|', '', get_site_url() ) ) {
+ unset( $tests['direct']['https_status'] );
+ }
+
+ foreach ( $tests['direct'] as $test ) {
+ if ( is_string( $test['test'] ) ) {
+ $test_function = sprintf(
+ 'get_test_%s',
+ $test['test']
+ );
+
+ if ( method_exists( $this, $test_function ) && is_callable( array( $this, $test_function ) ) ) {
+ $health_check_js_variables['site_status']['direct'][] = call_user_func( array( $this, $test_function ) );
+ continue;
+ }
+ }
+
+ if ( is_callable( $test['test'] ) ) {
+ $health_check_js_variables['site_status']['direct'][] = call_user_func( $test['test'] );
+ }
+ }
+
+ foreach ( $tests['async'] as $test ) {
+ if ( is_string( $test['test'] ) ) {
+ $health_check_js_variables['site_status']['async'][] = array(
+ 'test' => $test['test'],
+ 'completed' => false,
+ );
+ }
+ }
+ }
+
+ wp_localize_script( 'site-health', 'SiteHealth', $health_check_js_variables );
+ }
+
+ /**
+ * Run the SQL version checks.
+ *
+ * These values are used in later tests, but the part of preparing them is more easily managed early
+ * in the class for ease of access and discovery.
+ *
+ * @since 5.2.0
+ *
+ * @global wpdb $wpdb WordPress database abstraction object.
+ */
+ private function prepare_sql_data() {
+ global $wpdb;
+
+ if ( method_exists( $wpdb, 'db_version' ) ) {
+ if ( $wpdb->use_mysqli ) {
+ // phpcs:ignore WordPress.DB.RestrictedFunctions.mysql_mysqli_get_server_info
+ $mysql_server_type = mysqli_get_server_info( $wpdb->dbh );
+ } else {
+ // phpcs:ignore WordPress.DB.RestrictedFunctions.mysql_mysql_get_server_info
+ $mysql_server_type = mysql_get_server_info( $wpdb->dbh );
+ }
+
+ $this->mysql_server_version = $wpdb->get_var( 'SELECT VERSION()' );
+ }
+
+ $this->health_check_mysql_rec_version = '5.6';
+
+ if ( stristr( $mysql_server_type, 'mariadb' ) ) {
+ $this->is_mariadb = true;
+ $this->health_check_mysql_rec_version = '10.0';
+ }
+
+ $this->mysql_min_version_check = version_compare( '5.5', $this->mysql_server_version, '<=' );
+ $this->mysql_rec_version_check = version_compare( $this->health_check_mysql_rec_version, $this->mysql_server_version, '<=' );
+ }
+
+ /**
+ * Test if `wp_version_check` is blocked.
+ *
+ * It's possible to block updates with the `wp_version_check` filter, but this can't be checked during an
+ * AJAX call, as the filter is never introduced then.
+ *
+ * This filter overrides a normal page request if it's made by an admin through the AJAX call with the
+ * right query argument to check for this.
+ *
+ * @since 5.2.0
+ */
+ public function check_wp_version_check_exists() {
+ if ( ! is_admin() || ! is_user_logged_in() || ! current_user_can( 'update_core' ) || ! isset( $_GET['health-check-test-wp_version_check'] ) ) {
+ return;
+ }
+
+ echo ( has_filter( 'wp_version_check', 'wp_version_check' ) ? 'yes' : 'no' );
+
+ die();
+ }
+
+ /**
+ * Tests for WordPress version and outputs it.
+ *
+ * Gives various results depending on what kind of updates are available, if any, to encourage the
+ * user to install security updates as a priority.
+ *
+ * @since 5.2.0
+ *
+ * @return array The test result.
+ */
+ public function get_test_wordpress_version() {
+ $result = array(
+ 'label' => '',
+ 'status' => '',
+ 'badge' => array(
+ 'label' => __( 'Performance' ),
+ 'color' => 'blue',
+ ),
+ 'description' => '',
+ 'actions' => '',
+ 'test' => 'wordpress_version',
+ );
+
+ $core_current_version = get_bloginfo( 'version' );
+ $core_updates = get_core_updates();
+
+ if ( ! is_array( $core_updates ) ) {
+ $result['status'] = 'recommended';
+
+ $result['label'] = sprintf(
+ // translators: %s: Your current version of WordPress.
+ __( 'WordPress version %s' ),
+ $core_current_version
+ );
+
+ $result['description'] = sprintf(
+ '<p>%s</p>',
+ __( 'We were unable to check if any new versions of WordPress are available.' )
+ );
+
+ $result['actions'] = sprintf(
+ '<a href="%s">%s</a>',
+ esc_url( admin_url( 'update-core.php?force-check=1' ) ),
+ __( 'Check for updates manually' )
+ );
+ } else {
+ foreach ( $core_updates as $core => $update ) {
+ if ( 'upgrade' === $update->response ) {
+ $current_version = explode( '.', $core_current_version );
+ $new_version = explode( '.', $update->version );
+
+ $current_major = $current_version[0] . '.' . $current_version[1];
+ $new_major = $new_version[0] . '.' . $new_version[1];
+
+ $result['label'] = sprintf(
+ // translators: %s: The latest version of WordPress available.
+ __( 'WordPress update available (%s)' ),
+ $update->version
+ );
+
+ $result['actions'] = sprintf(
+ '<a href="%s">%s</a>',
+ esc_url( admin_url( 'update-core.php' ) ),
+ __( 'Install the latest version of WordPress' )
+ );
+
+ if ( $current_major !== $new_major ) {
+ // This is a major version mismatch.
+ $result['status'] = 'recommended';
+ $result['description'] = sprintf(
+ '<p>%s</p>',
+ __( 'A new version of WordPress is available.' )
+ );
+ } else {
+ // This is a minor version, sometimes considered more critical.
+ $result['status'] = 'critical';
+ $result['badge']['label'] = __( 'Security' );
+ $result['description'] = sprintf(
+ '<p>%s</p>',
+ __( 'A new minor update is available for your site. Because minor updates often address security, it&#8217;s important to install them.' )
+ );
+ }
+ } else {
+ $result['status'] = 'good';
+ $result['label'] = sprintf(
+ // translators: %s: The current version of WordPress installed on this site.
+ __( 'Your WordPress version is up to date (%s)' ),
+ $core_current_version
+ );
+
+ $result['description'] = sprintf(
+ '<p>%s</p>',
+ __( 'You are currently running the latest version of WordPress available, keep it up!' )
+ );
+ }
+ }
+ }
+
+ return $result;
+ }
+
+ /**
+ * Test if plugins are outdated, or unnecessary.
+ *
+ * The tests checks if your plugins are up to date, and encourages you to remove any that are not in use.
+ *
+ * @since 5.2.0
+ *
+ * @return array The test result.
+ */
+ public function get_test_plugin_version() {
+ $result = array(
+ 'label' => __( 'Your plugins are up to date' ),
+ 'status' => 'good',
+ 'badge' => array(
+ 'label' => __( 'Security' ),
+ 'color' => 'blue',
+ ),
+ 'description' => sprintf(
+ '<p>%s</p>',
+ __( 'Plugins extend your site&#8217;s functionality with things like contact forms, ecommerce and much more. That means they have deep access to your site, so it&#8217;s vital to keep them up to date.' )
+ ),
+ 'actions' => sprintf(
+ '<p><a href="%s">%s</a></p>',
+ esc_url( admin_url( 'plugins.php' ) ),
+ __( 'Manage your plugins' )
+ ),
+ 'test' => 'plugin_version',
+ );
+
+ $plugins = get_plugins();
+ $plugin_updates = get_plugin_updates();
+
+ $plugins_have_updates = false;
+ $plugins_active = 0;
+ $plugins_total = 0;
+ $plugins_need_update = 0;
+
+ // Loop over the available plugins and check their versions and active state.
+ foreach ( $plugins as $plugin_path => $plugin ) {
+ $plugins_total++;
+
+ if ( is_plugin_active( $plugin_path ) ) {
+ $plugins_active++;
+ }
+
+ $plugin_version = $plugin['Version'];
+
+ if ( array_key_exists( $plugin_path, $plugin_updates ) ) {
+ $plugins_need_update++;
+ $plugins_have_updates = true;
+ }
+ }
+
+ // Add a notice if there are outdated plugins.
+ if ( $plugins_need_update > 0 ) {
+ $result['status'] = 'critical';
+
+ $result['label'] = __( 'You have plugins waiting to be updated' );
+
+ $result['description'] .= sprintf(
+ '<p>%s</p>',
+ sprintf(
+ /* translators: %d: The number of outdated plugins. */
+ _n(
+ 'Your site has %d plugin waiting to be updated.',
+ 'Your site has %d plugins waiting to be updated.',
+ $plugins_need_update
+ ),
+ $plugins_need_update
+ )
+ );
+
+ $result['actions'] .= sprintf(
+ '<p><a href="%s">%s</a></p>',
+ esc_url( network_admin_url( 'plugins.php?plugin_status=upgrade' ) ),
+ __( 'Update your plugins' )
+ );
+ } else {
+ if ( 1 === $plugins_active ) {
+ $result['description'] .= sprintf(
+ '<p>%s</p>',
+ __( 'Your site has 1 active plugin, and it is up to date.' )
+ );
+ } else {
+ $result['description'] .= sprintf(
+ '<p>%s</p>',
+ sprintf(
+ /* translators: %d: The number of active plugins. */
+ _n(
+ 'Your site has %d active plugin, and it is up to date.',
+ 'Your site has %d active plugins, and they are all up to date.',
+ $plugins_active
+ ),
+ $plugins_active
+ )
+ );
+ }
+ }
+
+ // Check if there are inactive plugins.
+ if ( $plugins_total > $plugins_active && ! is_multisite() ) {
+ $unused_plugins = $plugins_total - $plugins_active;
+
+ $result['status'] = 'recommended';
+
+ $result['label'] = __( 'You should remove inactive plugins' );
+
+ $result['description'] .= sprintf(
+ '<p>%s %s</p>',
+ sprintf(
+ /* translators: %d: The number of inactive plugins. */
+ _n(
+ 'Your site has %d inactive plugin.',
+ 'Your site has %d inactive plugins.',
+ $unused_plugins
+ ),
+ $unused_plugins
+ ),
+ __( 'Inactive plugins are tempting targets for attackers. If you&#8217;re not going to use a plugin, we recommend you remove it.' )
+ );
+
+ $result['actions'] .= sprintf(
+ '<p><a href="%s">%s</a></p>',
+ esc_url( admin_url( 'plugins.php?plugin_status=inactive' ) ),
+ __( 'Manage inactive plugins' )
+ );
+ }
+
+ return $result;
+ }
+
+ /**
+ * Test if themes are outdated, or unnecessary.
+ *
+ * The tests checks if your site has a default theme (to fall back on if there is a need), if your themes
+ * are up to date and, finally, encourages you to remove any themes that are not needed.
+ *
+ * @since 5.2.0
+ *
+ * @return array The test results.
+ */
+ public function get_test_theme_version() {
+ $result = array(
+ 'label' => __( 'Your themes are up to date' ),
+ 'status' => 'good',
+ 'badge' => array(
+ 'label' => __( 'Security' ),
+ 'color' => 'blue',
+ ),
+ 'description' => sprintf(
+ '<p>%s</p>',
+ __( 'Themes add your site&#8217;s look and feel. It&#8217;s important to keep them up to date, to stay consistent with your brand and keep your site secure.' )
+ ),
+ 'actions' => sprintf(
+ '<p><a href="%s">%s</a></p>',
+ esc_url( admin_url( 'themes.php' ) ),
+ __( 'Manage your themes' )
+ ),
+ 'test' => 'theme_version',
+ );
+
+ $theme_updates = get_theme_updates();
+
+ $themes_total = 0;
+ $themes_need_updates = 0;
+ $themes_inactive = 0;
+
+ // This value is changed during processing to determine how many themes are considered a reasonable amount.
+ $allowed_theme_count = 1;
+
+ $has_default_theme = false;
+ $has_unused_themes = false;
+ $show_unused_themes = true;
+ $using_default_theme = false;
+
+ // Populate a list of all themes available in the install.
+ $all_themes = wp_get_themes();
+ $active_theme = wp_get_theme();
+
+ foreach ( $all_themes as $theme_slug => $theme ) {
+ $themes_total++;
+
+ if ( WP_DEFAULT_THEME === $theme_slug ) {
+ $has_default_theme = true;
+
+ if ( get_stylesheet() === $theme_slug ) {
+ $using_default_theme = true;
+ }
+ }
+
+ if ( array_key_exists( $theme_slug, $theme_updates ) ) {
+ $themes_need_updates++;
+ }
+ }
+
+ // If this is a child theme, increase the allowed theme count by one, to account for the parent.
+ if ( $active_theme->parent() ) {
+ $allowed_theme_count++;
+
+ if ( $active_theme->get_template() === WP_DEFAULT_THEME ) {
+ $using_default_theme = true;
+ }
+ }
+
+ // If there's a default theme installed and not in use, we count that as allowed as well.
+ if ( $has_default_theme && ! $using_default_theme ) {
+ $allowed_theme_count++;
+ }
+
+ if ( $themes_total > $allowed_theme_count ) {
+ $has_unused_themes = true;
+ $themes_inactive = ( $themes_total - $allowed_theme_count );
+ }
+
+ // Check if any themes need to be updated.
+ if ( $themes_need_updates > 0 ) {
+ $result['status'] = 'critical';
+
+ $result['label'] = __( 'You have themes waiting to be updated' );
+
+ $result['description'] .= sprintf(
+ '<p>%s</p>',
+ sprintf(
+ /* translators: %d: The number of outdated themes. */
+ _n(
+ 'Your site has %d theme waiting to be updated.',
+ 'Your site has %d themes waiting to be updated.',
+ $themes_need_updates
+ ),
+ $themes_need_updates
+ )
+ );
+ } else {
+ // Give positive feedback about the site being good about keeping things up to date.
+ if ( 1 === $themes_total ) {
+ $result['description'] .= sprintf(
+ '<p>%s</p>',
+ __( 'Your site has 1 installed theme, and it is up to date.' )
+ );
+ } else {
+ $result['description'] .= sprintf(
+ '<p>%s</p>',
+ sprintf(
+ /* translators: %d: The number of themes. */
+ _n(
+ 'Your site has %d installed theme, and it is up to date.',
+ 'Your site has %d installed themes, and they are all up to date.',
+ $themes_total
+ ),
+ $themes_total
+ )
+ );
+ }
+ }
+
+ if ( $has_unused_themes && $show_unused_themes && ! is_multisite() ) {
+
+ // This is a child theme, so we want to be a bit more explicit in our messages.
+ if ( $active_theme->parent() ) {
+ // Recommend removing inactive themes, except a default theme, your current one, and the parent theme.
+ $result['status'] = 'recommended';
+
+ $result['label'] = __( 'You should remove inactive themes' );
+
+ if ( $using_default_theme ) {
+ $result['description'] .= sprintf(
+ '<p>%s %s</p>',
+ sprintf(
+ /* translators: %d: The number of inactive themes. */
+ _n(
+ 'Your site has %d inactive theme.',
+ 'Your site has %d inactive themes.',
+ $themes_inactive
+ ),
+ $themes_inactive
+ ),
+ sprintf(
+ /* translators: 1: The currently active theme. 2: The active theme's parent theme. */
+ __( 'To enhance your site&#8217;s security, we recommend you remove any themes you&#8217;re not using. You should keep your current theme, %1$s, and %2$s, its parent theme.' ),
+ $active_theme->name,
+ $active_theme->parent()->name
+ )
+ );
+ } else {
+ $result['description'] .= sprintf(
+ '<p>%s %s</p>',
+ sprintf(
+ /* translators: %d: The number of inactive themes. */
+ _n(
+ 'Your site has %d inactive theme.',
+ 'Your site has %d inactive themes.',
+ $themes_inactive
+ ),
+ $themes_inactive
+ ),
+ sprintf(
+ /* translators: 1: The default theme for WordPress. 2: The currently active theme. 3: The active theme's parent theme. */
+ __( 'To enhance your site&#8217;s security, we recommend you remove any themes you&#8217;re not using. You should keep %1$s, the default WordPress theme, %2$s, your current theme, and %3$s, its parent theme.' ),
+ WP_DEFAULT_THEME,
+ $active_theme->name,
+ $active_theme->parent()->name
+ )
+ );
+ }
+ } else {
+ // Recommend removing all inactive themes.
+ $result['status'] = 'recommended';
+
+ $result['label'] = __( 'You should remove inactive themes' );
+
+ if ( $using_default_theme ) {
+ $result['description'] .= sprintf(
+ '<p>%s %s</p>',
+ sprintf(
+ /* translators: 1: The amount of inactive themes. 2: The currently active theme. */
+ _n(
+ 'Your site has %1$d inactive theme, other than %2$s, your active theme.',
+ 'Your site has %1$d inactive themes, other than %2$s, your active theme.',
+ $themes_inactive
+ ),
+ $themes_inactive,
+ $active_theme->name
+ ),
+ __( 'We recommend removing any unused themes to enhance your site&#8217;s security.' )
+ );
+ } else {
+ $result['description'] .= sprintf(
+ '<p>%s %s</p>',
+ sprintf(
+ /* translators: 1: The amount of inactive themes. 2: The default theme for WordPress. 3: The currently active theme. */
+ _n(
+ 'Your site has %1$d inactive theme, other than %2$s, the default WordPress theme, and %3$s, your active theme.',
+ 'Your site has %1$d inactive themes, other than %2$s, the default WordPress theme, and %3$s, your active theme.',
+ $themes_inactive
+ ),
+ $themes_inactive,
+ WP_DEFAULT_THEME,
+ $active_theme->name
+ ),
+ __( 'We recommend removing any unused themes to enhance your site&#8217;s security.' )
+ );
+ }
+ }
+ }
+
+ // If not default Twenty* theme exists.
+ if ( ! $has_default_theme ) {
+ $result['status'] = 'recommended';
+
+ $result['label'] = __( 'Have a default theme available' );
+
+ $result['description'] .= sprintf(
+ '<p>%s</p>',
+ __( 'Your site does not have any default theme. Default themes are used by WordPress automatically if anything is wrong with your normal theme.' )
+ );
+ }
+
+ return $result;
+ }
+
+ /**
+ * Test if the supplied PHP version is supported.
+ *
+ * @since 5.2.0
+ *
+ * @return array The test results.
+ */
+ public function get_test_php_version() {
+ $response = wp_check_php_version();
+
+ $result = array(
+ 'label' => sprintf(
+ // translators: %s: The current PHP version.
+ __( 'PHP is up to date (%s)' ),
+ PHP_VERSION
+ ),
+ 'status' => 'good',
+ 'badge' => array(
+ 'label' => __( 'Performance' ),
+ 'color' => 'blue',
+ ),
+ 'description' => sprintf(
+ '<p>%s</p>',
+ __( 'PHP is the programming language we use to build and maintain WordPress. Newer versions of PHP are both faster and more secure, so updating will have a positive effect on your site&#8217;s performance.' )
+ ),
+ 'actions' => sprintf(
+ '<p><a href="%s" target="_blank" rel="noopener noreferrer">%s <span class="screen-reader-text">%s</span><span aria-hidden="true" class="dashicons dashicons-external"></span></a></p>',
+ esc_url( wp_get_update_php_url() ),
+ __( 'Learn more about updating PHP' ),
+ /* translators: accessibility text */
+ __( '(opens in a new tab)' )
+ ),
+ 'test' => 'php_version',
+ );
+
+ // PHP is up to date.
+ if ( ! $response || version_compare( PHP_VERSION, $response['recommended_version'], '>=' ) ) {
+ return $result;
+ }
+
+ // The PHP version is older than the recommended version, but still acceptable.
+ if ( $response['is_supported'] ) {
+ $result['label'] = __( 'We recommend that you update PHP' );
+ $result['status'] = 'recommended';
+
+ return $result;
+ }
+
+ // The PHP version is only receiving security fixes.
+ if ( $response['is_secure'] ) {
+ $result['label'] = __( 'Your PHP version should be updated' );
+ $result['status'] = 'recommended';
+
+ return $result;
+ }
+
+ // Anything no longer secure must be updated.
+ $result['label'] = __( 'Your PHP version requires an update' );
+ $result['status'] = 'critical';
+ $result['badge']['label'] = __( 'Security' );
+
+ return $result;
+ }
+
+ /**
+ * Check if the passed extension or function are available.
+ *
+ * Make the check for available PHP modules into a simple boolean operator for a cleaner test runner.
+ *
+ * @since 5.2.0
+ *
+ * @param string $extension Optional. The extension name to test. Default null.
+ * @param string $function Optional. The function name to test. Default null.
+ *
+ * @return bool Whether or not the extension and function are available.
+ */
+ private function test_php_extension_availability( $extension = null, $function = null ) {
+ // If no extension or function is passed, claim to fail testing, as we have nothing to test against.
+ if ( ! $extension && ! $function ) {
+ return false;
+ }
+
+ if ( $extension && ! extension_loaded( $extension ) ) {
+ return false;
+ }
+ if ( $function && ! function_exists( $function ) ) {
+ return false;
+ }
+
+ return true;
+ }
+
+ /**
+ * Test if required PHP modules are installed on the host.
+ *
+ * This test builds on the recommendations made by the WordPress Hosting Team
+ * as seen at https://make.wordpress.org/hosting/handbook/handbook/server-environment/#php-extensions
+ *
+ * @since 5.2.0
+ *
+ * @return array
+ */
+ public function get_test_php_extensions() {
+ $result = array(
+ 'label' => __( 'Required and recommended modules are installed' ),
+ 'status' => 'good',
+ 'badge' => array(
+ 'label' => __( 'Performance' ),
+ 'color' => 'blue',
+ ),
+ 'description' => sprintf(
+ '<p>%s</p><p>%s</p>',
+ __( 'PHP modules perform most of the tasks on the server that make your site run. Any changes to these must be made by your server administrator.' ),
+ sprintf(
+ /* translators: 1: Link to the hosting group page about recommended PHP modules. 2: Additional link attributes. 3: Accessibility text. */
+ __( 'The WordPress Hosting Team maintains a list of those modules, both recommended and required, in <a href="%1$s" %2$s>the team handbook%3$s</a>.' ),
+ /* translators: Localized team handbook, if one exists. */
+ esc_url( __( 'https://make.wordpress.org/hosting/handbook/handbook/server-environment/#php-extensions' ) ),
+ 'target="_blank" rel="noopener noreferrer"',
+ sprintf(
+ ' <span class="screen-reader-text">%s</span><span aria-hidden="true" class="dashicons dashicons-external"></span>',
+ /* translators: accessibility text */
+ __( '(opens in a new tab)' )
+ )
+ )
+ ),
+ 'actions' => '',
+ 'test' => 'php_extensions',
+ );
+
+ $modules = array(
+ 'bcmath' => array(
+ 'function' => 'bcadd',
+ 'required' => false,
+ ),
+ 'curl' => array(
+ 'function' => 'curl_version',
+ 'required' => false,
+ ),
+ 'exif' => array(
+ 'function' => 'exif_read_data',
+ 'required' => false,
+ ),
+ 'filter' => array(
+ 'function' => 'filter_list',
+ 'required' => false,
+ ),
+ 'fileinfo' => array(
+ 'function' => 'finfo_file',
+ 'required' => false,
+ ),
+ 'mod_xml' => array(
+ 'extension' => 'libxml',
+ 'required' => false,
+ ),
+ 'mysqli' => array(
+ 'function' => 'mysqli_connect',
+ 'required' => false,
+ ),
+ 'libsodium' => array(
+ 'function' => 'sodium_compare',
+ 'required' => false,
+ 'php_bundled_version' => '7.2.0',
+ ),
+ 'openssl' => array(
+ 'function' => 'openssl_encrypt',
+ 'required' => false,
+ ),
+ 'pcre' => array(
+ 'function' => 'preg_match',
+ 'required' => false,
+ ),
+ 'imagick' => array(
+ 'extension' => 'imagick',
+ 'required' => false,
+ ),
+ 'gd' => array(
+ 'extension' => 'gd',
+ 'required' => false,
+ 'fallback_for' => 'imagick',
+ ),
+ 'mcrypt' => array(
+ 'extension' => 'mcrypt',
+ 'required' => false,
+ 'fallback_for' => 'libsodium',
+ ),
+ 'xmlreader' => array(
+ 'extension' => 'xmlreader',
+ 'required' => false,
+ 'fallback_for' => 'xml',
+ ),
+ 'zlib' => array(
+ 'extension' => 'zlib',
+ 'required' => false,
+ 'fallback_for' => 'zip',
+ ),
+ );
+
+ /**
+ * An array representing all the modules we wish to test for.
+ *
+ * @since 5.2.0
+ *
+ * @param array $modules {
+ * An associated array of modules to test for.
+ *
+ * array $module {
+ * An associated array of module properties used during testing.
+ * One of either `$function` or `$extension` must be provided, or they will fail by default.
+ *
+ * string $function Optional. A function name to test for the existence of.
+ * string $extension Optional. An extension to check if is loaded in PHP.
+ * bool $required Is this a required feature or not.
+ * string $fallback_for Optional. The module this module replaces as a fallback.
+ * }
+ * }
+ */
+ $modules = apply_filters( 'site_status_test_php_modules', $modules );
+
+ $failures = array();
+
+ foreach ( $modules as $library => $module ) {
+ $extension = ( isset( $module['extension'] ) ? $module['extension'] : null );
+ $function = ( isset( $module['function'] ) ? $module['function'] : null );
+
+ // If this module is a fallback for another function, check if that other function passed.
+ if ( isset( $module['fallback_for'] ) ) {
+ /*
+ * If that other function has a failure, mark this module as required for normal operations.
+ * If that other function hasn't failed, skip this test as it's only a fallback.
+ */
+ if ( isset( $failures[ $module['fallback_for'] ] ) ) {
+ $module['required'] = true;
+ } else {
+ continue;
+ }
+ }
+
+ if ( ! $this->test_php_extension_availability( $extension, $function ) && ( ! isset( $module['php_bundled_version'] ) || version_compare( PHP_VERSION, $module['php_bundled_version'], '<' ) ) ) {
+ if ( $module['required'] ) {
+ $result['status'] = 'critical';
+
+ $class = 'error';
+ $screen_reader = __( 'Error' );
+ $message = sprintf(
+ /* translators: %s: The module name. */
+ __( 'The required module, %s, is not installed, or has been disabled.' ),
+ $library
+ );
+ } else {
+ $class = 'warning';
+ $screen_reader = __( 'Warning' );
+ $message = sprintf(
+ /* translators: %s: The module name. */
+ __( 'The optional module, %s, is not installed, or has been disabled.' ),
+ $library
+ );
+ }
+
+ if ( ! $module['required'] && 'good' === $result['status'] ) {
+ $result['status'] = 'recommended';
+ }
+
+ $failures[ $library ] = "<span class='dashicons $class'><span class='screen-reader-text'>$screen_reader</span></span> $message";
+ }
+ }
+
+ if ( ! empty( $failures ) ) {
+ $output = '<ul>';
+
+ foreach ( $failures as $failure ) {
+ $output .= sprintf(
+ '<li>%s</li>',
+ $failure
+ );
+ }
+
+ $output .= '</ul>';
+ }
+
+ if ( 'good' !== $result['status'] ) {
+ if ( 'recommended' === $result['status'] ) {
+ $result['label'] = __( 'One or more recommended modules are missing' );
+ }
+ if ( 'critical' === $result['status'] ) {
+ $result['label'] = __( 'One or more required modules are missing' );
+ }
+
+ $result['description'] .= sprintf(
+ '<p>%s</p>',
+ $output
+ );
+ }
+
+ return $result;
+ }
+
+ /**
+ * Test if the SQL server is up to date.
+ *
+ * @since 5.2.0
+ *
+ * @return array The test results.
+ */
+ public function get_test_sql_server() {
+ $result = array(
+ 'label' => __( 'SQL server is up to date' ),
+ 'status' => 'good',
+ 'badge' => array(
+ 'label' => __( 'Performance' ),
+ 'color' => 'blue',
+ ),
+ 'description' => sprintf(
+ '<p>%s</p>',
+ __( 'The SQL server is a required piece of software for the database WordPress uses to store all your site&#8217;s content and settings.' )
+ ),
+ 'actions' => sprintf(
+ '<p><a href="%s" target="_blank" rel="noopener noreferrer">%s <span class="screen-reader-text">%s</span><span aria-hidden="true" class="dashicons dashicons-external"></span></a></p>',
+ /* translators: Localized version of WordPress requirements if one exists. */
+ esc_url( __( 'https://wordpress.org/about/requirements/' ) ),
+ __( 'Read more about what WordPress requires to run.' ),
+ /* translators: accessibility text */
+ __( '(opens in a new tab)' )
+ ),
+ 'test' => 'sql_server',
+ );
+
+ $db_dropin = file_exists( WP_CONTENT_DIR . '/db.php' );
+
+ if ( ! $this->mysql_rec_version_check ) {
+ $result['status'] = 'recommended';
+
+ $result['label'] = __( 'Outdated SQL server' );
+
+ $result['description'] .= sprintf(
+ '<p>%s</p>',
+ sprintf(
+ /* translators: 1: The database engine in use (MySQL or MariaDB). 2: Database server recommended version number. */
+ __( 'For optimal performance and security reasons, we recommend running %1$s version %2$s or higher. Contact your web hosting company to correct this.' ),
+ ( $this->is_mariadb ? 'MariaDB' : 'MySQL' ),
+ $this->health_check_mysql_rec_version
+ )
+ );
+ }
+
+ if ( ! $this->mysql_min_version_check ) {
+ $result['status'] = 'critical';
+
+ $result['label'] = __( 'Severely outdated SQL server' );
+ $result['badge']['label'] = __( 'Security' );
+
+ $result['description'] .= sprintf(
+ '<p>%s</p>',
+ sprintf(
+ /* translators: 1: The database engine in use (MySQL or MariaDB). 2: Database server minimum version number. */
+ __( 'WordPress requires %1$s version %2$s or higher. Contact your web hosting company to correct this.' ),
+ ( $this->is_mariadb ? 'MariaDB' : 'MySQL' ),
+ $this->health_check_mysql_required_version
+ )
+ );
+ }
+
+ if ( $db_dropin ) {
+ $result['description'] .= sprintf(
+ '<p>%s</p>',
+ wp_kses(
+ sprintf(
+ /* translators: 1: The name of the drop-in. 2: The name of the database engine. */
+ __( 'You are using a %1$s drop-in which might mean that a %2$s database is not being used.' ),
+ '<code>wp-content/db.php</code>',
+ ( $this->is_mariadb ? 'MariaDB' : 'MySQL' )
+ ),
+ array(
+ 'code' => true,
+ )
+ )
+ );
+ }
+
+ return $result;
+ }
+
+ /**
+ * Test if the database server is capable of using utf8mb4.
+ *
+ * @since 5.2.0
+ *
+ * @return array The test results.
+ */
+ public function get_test_utf8mb4_support() {
+ global $wpdb;
+
+ $result = array(
+ 'label' => __( 'UTF8MB4 is supported' ),
+ 'status' => 'good',
+ 'badge' => array(
+ 'label' => __( 'Performance' ),
+ 'color' => 'blue',
+ ),
+ 'description' => sprintf(
+ '<p>%s</p>',
+ __( 'UTF8MB4 is a database storage attribute that makes sure your site can store non-English text and other strings (for instance emoticons) without unexpected problems.' )
+ ),
+ 'actions' => '',
+ 'test' => 'utf8mb4_support',
+ );
+
+ if ( ! $this->is_mariadb ) {
+ if ( version_compare( $this->mysql_server_version, '5.5.3', '<' ) ) {
+ $result['status'] = 'recommended';
+
+ $result['label'] = __( 'utf8mb4 requires a MySQL update' );
+
+ $result['description'] .= sprintf(
+ '<p>%s</p>',
+ sprintf(
+ /* translators: %s: Version number. */
+ __( 'WordPress&#8217; utf8mb4 support requires MySQL version %s or greater. Please contact your server administrator.' ),
+ '5.5.3'
+ )
+ );
+ } else {
+ $result['description'] .= sprintf(
+ '<p>%s</p>',
+ __( 'Your MySQL version supports utf8mb4.' )
+ );
+ }
+ } else { // MariaDB introduced utf8mb4 support in 5.5.0
+ if ( version_compare( $this->mysql_server_version, '5.5.0', '<' ) ) {
+ $result['status'] = 'recommended';
+
+ $result['label'] = __( 'utf8mb4 requires a MariaDB update' );
+
+ $result['description'] .= sprintf(
+ '<p>%s</p>',
+ sprintf(
+ /* translators: %s: Version number. */
+ __( 'WordPress&#8217; utf8mb4 support requires MariaDB version %s or greater. Please contact your server administrator.' ),
+ '5.5.0'
+ )
+ );
+ } else {
+ $result['description'] .= sprintf(
+ '<p>%s</p>',
+ __( 'Your MariaDB version supports utf8mb4.' )
+ );
+ }
+ }
+
+ if ( $wpdb->use_mysqli ) {
+ // phpcs:ignore WordPress.DB.RestrictedFunctions.mysql_mysqli_get_client_info
+ $mysql_client_version = mysqli_get_client_info();
+ } else {
+ // phpcs:ignore WordPress.DB.RestrictedFunctions.mysql_mysql_get_client_info
+ $mysql_client_version = mysql_get_client_info();
+ }
+
+ /*
+ * libmysql has supported utf8mb4 since 5.5.3, same as the MySQL server.
+ * mysqlnd has supported utf8mb4 since 5.0.9.
+ */
+ if ( false !== strpos( $mysql_client_version, 'mysqlnd' ) ) {
+ $mysql_client_version = preg_replace( '/^\D+([\d.]+).*/', '$1', $mysql_client_version );
+ if ( version_compare( $mysql_client_version, '5.0.9', '<' ) ) {
+ $result['status'] = 'recommended';
+
+ $result['label'] = __( 'utf8mb4 requires a newer client library' );
+
+ $result['description'] .= sprintf(
+ '<p>%s</p>',
+ sprintf(
+ /* translators: 1: Name of the library, 2: Number of version. */
+ __( 'WordPress&#8217; utf8mb4 support requires MySQL client library (%1$s) version %2$s or newer. Please contact your server administrator.' ),
+ 'mysqlnd',
+ '5.0.9'
+ )
+ );
+ }
+ } else {
+ if ( version_compare( $mysql_client_version, '5.5.3', '<' ) ) {
+ $result['status'] = 'recommended';
+
+ $result['label'] = __( 'utf8mb4 requires a newer client library' );
+
+ $result['description'] .= sprintf(
+ '<p>%s</p>',
+ sprintf(
+ /* translators: 1: Name of the library, 2: Number of version. */
+ __( 'WordPress&#8217; utf8mb4 support requires MySQL client library (%1$s) version %2$s or newer. Please contact your server administrator.' ),
+ 'libmysql',
+ '5.5.3'
+ )
+ );
+ }
+ }
+
+ return $result;
+ }
+
+ /**
+ * Test if the site can communicate with WordPress.org.
+ *
+ * @since 5.2.0
+ *
+ * @return array The test results.
+ */
+ public function get_test_dotorg_communication() {
+ $result = array(
+ 'label' => __( 'Can communicate with WordPress.org' ),
+ 'status' => '',
+ 'badge' => array(
+ 'label' => __( 'Security' ),
+ 'color' => 'blue',
+ ),
+ 'description' => sprintf(
+ '<p>%s</p>',
+ __( 'Communicating with the WordPress servers is used to check for new versions, and to both install and update WordPress core, themes or plugins.' )
+ ),
+ 'actions' => '',
+ 'test' => 'dotorg_communication',
+ );
+
+ $wp_dotorg = wp_remote_get(
+ 'https://api.wordpress.org',
+ array(
+ 'timeout' => 10,
+ )
+ );
+ if ( ! is_wp_error( $wp_dotorg ) ) {
+ $result['status'] = 'good';
+ } else {
+ $result['status'] = 'critical';
+
+ $result['label'] = __( 'Could not reach WordPress.org' );
+
+ $result['description'] .= sprintf(
+ '<p>%s</p>',
+ sprintf(
+ '<span class="error"><span class="screen-reader-text">%s</span></span> %s',
+ __( 'Error' ),
+ sprintf(
+ /* translators: 1: The IP address WordPress.org resolves to. 2: The error returned by the lookup. */
+ __( 'Your site is unable to reach WordPress.org at %1$s, and returned the error: %2$s' ),
+ gethostbyname( 'api.wordpress.org' ),
+ $wp_dotorg->get_error_message()
+ )
+ )
+ );
+
+ $result['actions'] = sprintf(
+ '<p><a href="%s" target="_blank" rel="noopener noreferrer">%s <span class="screen-reader-text">%s</span><span aria-hidden="true" class="dashicons dashicons-external"></span></a></p>',
+ /* translators: Localized Support reference. */
+ esc_url( __( 'https://wordpress.org/support' ) ),
+ __( 'Get help resolving this issue.' ),
+ /* translators: accessibility text */
+ __( '(opens in a new tab)' )
+ );
+ }
+
+ return $result;
+ }
+
+ /**
+ * Test if debug information is enabled.
+ *
+ * When WP_DEBUG is enabled, errors and information may be disclosed to site visitors, or it may be
+ * logged to a publicly accessible file.
+ *
+ * Debugging is also frequently left enabled after looking for errors on a site, as site owners do
+ * not understand the implications of this.
+ *
+ * @since 5.2.0
+ *
+ * @return array The test results.
+ */
+ public function get_test_is_in_debug_mode() {
+ $result = array(
+ 'label' => __( 'Your site is not set to output debug information' ),
+ 'status' => 'good',
+ 'badge' => array(
+ 'label' => __( 'Security' ),
+ 'color' => 'blue',
+ ),
+ 'description' => sprintf(
+ '<p>%s</p>',
+ __( 'Debug mode is often enabled to gather more details about an error or site failure, but may contain sensitive information which should not be available on a publicly available website.' )
+ ),
+ 'actions' => sprintf(
+ '<p><a href="%s" target="_blank" rel="noopener noreferrer">%s <span class="screen-reader-text">%s</span><span aria-hidden="true" class="dashicons dashicons-external"></span></a></p>',
+ /* translators: Documentation explaining debugging in WordPress. */
+ esc_url( __( 'https://wordpress.org/support/article/debugging-in-wordpress/' ) ),
+ __( 'Read about debugging in WordPress.' ),
+ /* translators: accessibility text */
+ __( '(opens in a new tab)' )
+ ),
+ 'test' => 'is_in_debug_mode',
+ );
+
+ if ( defined( 'WP_DEBUG' ) && WP_DEBUG ) {
+ if ( defined( 'WP_DEBUG_LOG' ) && WP_DEBUG_LOG ) {
+ $result['label'] = __( 'Your site is set to log errors to a potentially public file.' );
+
+ $result['status'] = 'critical';
+
+ $result['description'] .= sprintf(
+ '<p>%s</p>',
+ sprintf(
+ /* translators: %s: WP_DEBUG_LOG */
+ __( 'The value, %s, has been added to this website&#8217;s configuration file. This means any errors on the site will be written to a file which is potentially available to normal users.' ),
+ '<code>WP_DEBUG_LOG</code>'
+ )
+ );
+ }
+
+ if ( defined( 'WP_DEBUG_DISPLAY' ) && WP_DEBUG_DISPLAY ) {
+ $result['label'] = __( 'Your site is set to display errors to site visitors' );
+
+ $result['status'] = 'critical';
+
+ $result['description'] .= sprintf(
+ '<p>%s</p>',
+ sprintf(
+ /* translators: 1: WP_DEBUG_DISPLAY, 2: WP_DEBUG */
+ __( 'The value, %1$s, has either been enabled by %2$s or added to your configuration file. This will make errors display on the front end of your site.' ),
+ '<code>WP_DEBUG_DISPLAY</code>',
+ '<code>WP_DEBUG</code>'
+ )
+ );
+ }
+ }
+
+ return $result;
+ }
+
+ /**
+ * Test if your site is serving content over HTTPS.
+ *
+ * Many sites have varying degrees of HTTPS support, the most common of which is sites that have it
+ * enabled, but only if you visit the right site address.
+ *
+ * @since 5.2.0
+ *
+ * @return array The test results.
+ */
+ public function get_test_https_status() {
+ $result = array(
+ 'label' => __( 'Your website is using an active HTTPS connection.' ),
+ 'status' => 'good',
+ 'badge' => array(
+ 'label' => __( 'Security' ),
+ 'color' => 'blue',
+ ),
+ 'description' => sprintf(
+ '<p>%s</p>',
+ __( 'An HTTPS connection is needed for many features on the web today, it also gains the trust of your visitors by helping to protecting their online privacy.' )
+ ),
+ 'actions' => sprintf(
+ '<p><a href="%s" target="_blank" rel="noopener noreferrer">%s <span class="screen-reader-text">%s</span><span aria-hidden="true" class="dashicons dashicons-external"></span></a></p>',
+ /* translators: Documentation explaining HTTPS and why it should be used. */
+ esc_url( __( 'https://wordpress.org/support/article/why-should-i-use-https/' ) ),
+ __( 'Read more about why you should use HTTPS' ),
+ /* translators: accessibility text */
+ __( '(opens in a new tab)' )
+ ),
+ 'test' => 'https_status',
+ );
+
+ if ( is_ssl() ) {
+ $wp_url = get_bloginfo( 'wpurl' );
+ $site_url = get_bloginfo( 'url' );
+
+ if ( 'https' !== substr( $wp_url, 0, 5 ) || 'https' !== substr( $site_url, 0, 5 ) ) {
+ $result['status'] = 'recommended';
+
+ $result['label'] = __( 'Only parts of your site are using HTTPS' );
+
+ $result['description'] = sprintf(
+ '<p>%s</p>',
+ sprintf(
+ /* translators: %s: URL to Settings > General to change options. */
+ __( 'You are accessing this website using HTTPS, but your <a href="%s">WordPress Address</a> is not set up to use HTTPS by default.' ),
+ esc_url( admin_url( 'options-general.php' ) )
+ )
+ );
+
+ $result['actions'] .= sprintf(
+ '<p><a href="%s">%s</a></p>',
+ esc_url( admin_url( 'options-general.php' ) ),
+ __( 'Update your site addresses' )
+ );
+ }
+ } else {
+ $result['status'] = 'recommended';
+
+ $result['label'] = __( 'Your site does not use HTTPS' );
+ }
+
+ return $result;
+ }
+
+ /**
+ * Check if the HTTP API can handle SSL/TLS requests.
+ *
+ * @since 5.2.0
+ *
+ * @return array The test results.
+ */
+ public function get_test_ssl_support() {
+ $result = array(
+ 'label' => '',
+ 'status' => '',
+ 'badge' => array(
+ 'label' => __( 'Security' ),
+ 'color' => 'blue',
+ ),
+ 'description' => sprintf(
+ '<p>%s</p>',
+ __( 'Securely communicating between servers are needed for transactions such as fetching files, conducting sales on store sites, and much more.' )
+ ),
+ 'actions' => '',
+ 'test' => 'ssl_support',
+ );
+
+ $supports_https = wp_http_supports( array( 'ssl' ) );
+
+ if ( $supports_https ) {
+ $result['status'] = 'good';
+
+ $result['label'] = __( 'Your site can communicate securely with other services' );
+ } else {
+ $result['status'] = 'critical';
+
+ $result['label'] = __( 'Your site is unable to communicate securely with other services' );
+
+ $result['description'] .= sprintf(
+ '<p>%s</p>',
+ __( 'Talk to your web host about OpenSSL support for PHP.' )
+ );
+ }
+
+ return $result;
+ }
+
+ /**
+ * Test if scheduled events run as intended.
+ *
+ * If scheduled events are not running, this may indicate something with WP_Cron is not working as intended,
+ * or that there are orphaned events hanging around from older code.
+ *
+ * @since 5.2.0
+ *
+ * @return array The test results.
+ */
+ public function get_test_scheduled_events() {
+ $result = array(
+ 'label' => __( 'Scheduled events are running' ),
+ 'status' => 'good',
+ 'badge' => array(
+ 'label' => __( 'Performance' ),
+ 'color' => 'blue',
+ ),
+ 'description' => sprintf(
+ '<p>%s</p>',
+ __( 'Scheduled events are what periodically looks for updates to plugins, themes and WordPress itself. It is also what makes sure scheduled posts are published on time. It may also be used by various plugins to make sure that planned actions are executed.' )
+ ),
+ 'actions' => '',
+ 'test' => 'scheduled_events',
+ );
+
+ $this->wp_schedule_test_init();
+
+ if ( is_wp_error( $this->has_missed_cron() ) ) {
+ $result['status'] = 'critical';
+
+ $result['label'] = __( 'It was not possible to check your scheduled events' );
+
+ $result['description'] = sprintf(
+ '<p>%s</p>',
+ sprintf(
+ /* translators: %s: The error message returned while from the cron scheduler. */
+ __( 'While trying to test your site&#8217;s scheduled events, the following error was returned: %s' ),
+ $this->has_missed_cron()->get_error_message()
+ )
+ );
+ } else {
+ if ( $this->has_missed_cron() ) {
+ $result['status'] = 'recommended';
+
+ $result['label'] = __( 'A scheduled event has failed' );
+
+ $result['description'] = sprintf(
+ '<p>%s</p>',
+ sprintf(
+ /* translators: %s: The name of the failed cron event. */
+ __( 'The scheduled event, %s, failed to run. Your site still works, but this may indicate that scheduling posts or automated updates may not work as intended.' ),
+ $this->last_missed_cron
+ )
+ );
+ }
+ }
+
+ return $result;
+ }
+
+ /**
+ * Test if WordPress can run automated background updates.
+ *
+ * Background updates in WordPress are primarily used for minor releases and security updates. It's important
+ * to either have these working, or be aware that they are intentionally disabled for whatever reason.
+ *
+ * @since 5.2.0
+ *
+ * @return array The test results.
+ */
+ public function get_test_background_updates() {
+ $result = array(
+ 'label' => __( 'Background updates are working' ),
+ 'status' => 'good',
+ 'badge' => array(
+ 'label' => __( 'Security' ),
+ 'color' => 'blue',
+ ),
+ 'description' => sprintf(
+ '<p>%s</p>',
+ __( 'Background updates ensure that WordPress can auto-update if a security update is released for the version you are currently using.' )
+ ),
+ 'actions' => '',
+ 'test' => 'background_updates',
+ );
+
+ if ( ! class_exists( 'WP_Site_Health_Auto_Updates' ) ) {
+ require_once( ABSPATH . 'wp-admin/includes/class-wp-site-health-auto-updates.php' );
+ }
+
+ // Run the auto-update tests in a separate class,
+ // as there are many considerations to be made.
+ $automatic_updates = new WP_Site_Health_Auto_Updates();
+ $tests = $automatic_updates->run_tests();
+
+ $output = '<ul>';
+
+ foreach ( $tests as $test ) {
+ $severity_string = __( 'Passed' );
+
+ if ( 'fail' === $test->severity ) {
+ $result['label'] = __( 'Background updates are not working as expected' );
+
+ $result['status'] = 'critical';
+
+ $severity_string = __( 'Error' );
+ }
+
+ if ( 'warning' === $test->severity && 'good' === $result['status'] ) {
+ $result['label'] = __( 'Background updates may not be working properly' );
+
+ $result['status'] = 'recommended';
+
+ $severity_string = __( 'Warning' );
+ }
+
+ $output .= sprintf(
+ '<li><span class="dashicons %s"><span class="screen-reader-text">%s</span></span> %s</li>',
+ esc_attr( $test->severity ),
+ $severity_string,
+ $test->description
+ );
+ }
+
+ $output .= '</ul>';
+
+ if ( 'good' !== $result['status'] ) {
+ $result['description'] .= sprintf(
+ '<p>%s</p>',
+ $output
+ );
+ }
+
+ return $result;
+ }
+
+ /**
+ * Test if loopbacks work as expected.
+ *
+ * A loopback is when WordPress queries itself, for example to start a new WP_Cron instance, or when editing a
+ * plugin or theme. This has shown itself to be a recurring issue as code can very easily break this interaction.
+ *
+ * @since 5.2.0
+ *
+ * @return array The test results.
+ */
+ public function get_test_loopback_requests() {
+ $result = array(
+ 'label' => __( 'Your site can perform loopback requests' ),
+ 'status' => 'good',
+ 'badge' => array(
+ 'label' => __( 'Performance' ),
+ 'color' => 'blue',
+ ),
+ 'description' => sprintf(
+ '<p>%s</p>',
+ __( 'Loopback requests are used to run scheduled events, and are also used by the built-in editors for themes and plugins to verify code stability.' )
+ ),
+ 'actions' => '',
+ 'test' => 'loopback_requests',
+ );
+
+ $check_loopback = $this->can_perform_loopback();
+
+ $result['status'] = $check_loopback->status;
+
+ if ( 'good' !== $check_loopback->status ) {
+ $result['label'] = __( 'Your site could not complete a loopback request' );
+
+ $result['description'] .= sprintf(
+ '<p>%s</p>',
+ $check_loopback->message
+ );
+ }
+
+ return $result;
+ }
+
+ /**
+ * Test if HTTP requests are blocked.
+ *
+ * It's possible to block all outgoing communication (with the possibility of whitelisting hosts) via the
+ * HTTP API. This may create problems for users as many features are running as services these days.
+ *
+ * @since 5.2.0
+ *
+ * @return array The test results.
+ */
+ public function get_test_http_requests() {
+ $result = array(
+ 'label' => __( 'HTTP requests seem to be working as expected' ),
+ 'status' => 'good',
+ 'badge' => array(
+ 'label' => __( 'Performance' ),
+ 'color' => 'blue',
+ ),
+ 'description' => sprintf(
+ '<p>%s</p>',
+ __( 'It is possible for site maintainers to block all, or some, communication to other sites and services. If set up incorrectly, this may prevent plugins and themes from working as intended.' )
+ ),
+ 'actions' => '',
+ 'test' => 'http_requests',
+ );
+
+ $blocked = false;
+ $hosts = array();
+
+ if ( defined( 'WP_HTTP_BLOCK_EXTERNAL' ) && WP_HTTP_BLOCK_EXTERNAL ) {
+ $blocked = true;
+ }
+
+ if ( defined( 'WP_ACCESSIBLE_HOSTS' ) ) {
+ $hosts = explode( ',', WP_ACCESSIBLE_HOSTS );
+ }
+
+ if ( $blocked && 0 === sizeof( $hosts ) ) {
+ $result['status'] = 'critical';
+
+ $result['label'] = __( 'HTTP requests are blocked' );
+
+ $result['description'] .= sprintf(
+ '<p>%s</p>',
+ sprintf(
+ /* translators: %s: Name of the constant used. */
+ __( 'HTTP requests have been blocked by the %s constant, with no allowed hosts.' ),
+ '<code>WP_HTTP_BLOCK_EXTERNAL</code>'
+ )
+ );
+ }
+
+ if ( $blocked && 0 < sizeof( $hosts ) ) {
+ $result['status'] = 'recommended';
+
+ $result['label'] = __( 'HTTP requests are partially blocked' );
+
+ $result['description'] .= sprintf(
+ '<p>%s</p>',
+ sprintf(
+ /* translators: 1: Name of the constant used. 2: List of hostnames whitelisted. */
+ __( 'HTTP requests have been blocked by the %1$s constant, with some hosts whitelisted: %2$s.' ),
+ '<code>WP_HTTP_BLOCK_EXTERNAL</code>',
+ implode( ',', $hosts )
+ )
+ );
+ }
+
+ return $result;
+ }
+
+ /**
+ * Test if the REST API is accessible.
+ *
+ * Various security measures may block the REST API from working, or it may have been disabled in general.
+ * This is required for the new block editor to work, so we explicitly test for this.
+ *
+ * @since 5.2.0
+ *
+ * @return array The test results.
+ */
+ public function get_test_rest_availability() {
+ $result = array(
+ 'label' => __( 'The REST API is available' ),
+ 'status' => 'good',
+ 'badge' => array(
+ 'label' => __( 'Performance' ),
+ 'color' => 'blue',
+ ),
+ 'description' => sprintf(
+ '<p>%s</p>',
+ __( 'The REST API is one way WordPress, and other applications, communicate with the server. One example is the block editor screen, which relies on this to display, and save, your posts and pages.' )
+ ),
+ 'actions' => '',
+ 'test' => 'rest_availability',
+ );
+
+ $cookies = wp_unslash( $_COOKIE );
+ $timeout = 10;
+ $headers = array(
+ 'Cache-Control' => 'no-cache',
+ 'X-WP-Nonce' => wp_create_nonce( 'wp_rest' ),
+ );
+
+ // Include Basic auth in loopback requests.
+ if ( isset( $_SERVER['PHP_AUTH_USER'] ) && isset( $_SERVER['PHP_AUTH_PW'] ) ) {
+ $headers['Authorization'] = 'Basic ' . base64_encode( wp_unslash( $_SERVER['PHP_AUTH_USER'] ) . ':' . wp_unslash( $_SERVER['PHP_AUTH_PW'] ) );
+ }
+
+ $url = rest_url( 'wp/v2/types/post' );
+
+ // The context for this is editing with the new block editor.
+ $url = add_query_arg(
+ array(
+ 'context' => 'edit',
+ ),
+ $url
+ );
+
+ $r = wp_remote_get( $url, compact( 'cookies', 'headers', 'timeout' ) );
+
+ if ( is_wp_error( $r ) ) {
+ $result['status'] = 'critical';
+
+ $result['label'] = __( 'The REST API encountered an error' );
+
+ $result['description'] .= sprintf(
+ '<p>%s</p>',
+ sprintf(
+ '%s<br>%s',
+ __( 'The REST API request failed due to an error.' ),
+ sprintf(
+ /* translators: 1: The HTTP response code. 2: The error message returned. */
+ __( 'Error: [%1$s] %2$s' ),
+ wp_remote_retrieve_response_code( $r ),
+ $r->get_error_message()
+ )
+ )
+ );
+ } elseif ( 200 !== wp_remote_retrieve_response_code( $r ) ) {
+ $result['status'] = 'recommended';
+
+ $result['label'] = __( 'The REST API encountered an unexpected result' );
+
+ $result['description'] .= sprintf(
+ '<p>%s</p>',
+ sprintf(
+ /* translators: 1: The HTTP response code returned. 2: The error message returned. */
+ __( 'The REST API call gave the following unexpected result: (%1$d) %2$s.' ),
+ wp_remote_retrieve_response_code( $r ),
+ wp_remote_retrieve_body( $r )
+ )
+ );
+ } else {
+ $json = json_decode( wp_remote_retrieve_body( $r ), true );
+
+ if ( false !== $json && ! isset( $json['capabilities'] ) ) {
+ $result['status'] = 'recommended';
+
+ $result['label'] = __( 'The REST API did not behave correctly' );
+
+ $result['description'] .= sprintf(
+ '<p>%s</p>',
+ sprintf(
+ /* translators: %s: the name of the query parameter being tested. */
+ __( 'The REST API did not process the %s query parameter correctly.' ),
+ '<code>context</code>'
+ )
+ );
+ }
+ }
+
+ return $result;
+ }
+
+ /**
+ * Return a set of tests that belong to the site status page.
+ *
+ * Each site status test is defined here, they may be `direct` tests, that run on page load, or `async` tests
+ * which will run later down the line via JavaScript calls to improve page performance and hopefully also user
+ * experiences.
+ *
+ * @since 5.2.0
+ *
+ * @return array The list of tests to run.
+ */
+ public static function get_tests() {
+ $tests = array(
+ 'direct' => array(
+ 'wordpress_version' => array(
+ 'label' => __( 'WordPress Version' ),
+ 'test' => 'wordpress_version',
+ ),
+ 'plugin_version' => array(
+ 'label' => __( 'Plugin Versions' ),
+ 'test' => 'plugin_version',
+ ),
+ 'theme_version' => array(
+ 'label' => __( 'Theme Versions' ),
+ 'test' => 'theme_version',
+ ),
+ 'php_version' => array(
+ 'label' => __( 'PHP Version' ),
+ 'test' => 'php_version',
+ ),
+ 'sql_server' => array(
+ 'label' => __( 'Database Server version' ),
+ 'test' => 'sql_server',
+ ),
+ 'php_extensions' => array(
+ 'label' => __( 'PHP Extensions' ),
+ 'test' => 'php_extensions',
+ ),
+ 'utf8mb4_support' => array(
+ 'label' => __( 'MySQL utf8mb4 support' ),
+ 'test' => 'utf8mb4_support',
+ ),
+ 'https_status' => array(
+ 'label' => __( 'HTTPS status' ),
+ 'test' => 'https_status',
+ ),
+ 'ssl_support' => array(
+ 'label' => __( 'Secure communication' ),
+ 'test' => 'ssl_support',
+ ),
+ 'scheduled_events' => array(
+ 'label' => __( 'Scheduled events' ),
+ 'test' => 'scheduled_events',
+ ),
+ 'http_requests' => array(
+ 'label' => __( 'HTTP Requests' ),
+ 'test' => 'http_requests',
+ ),
+ 'debug_enabled' => array(
+ 'label' => __( 'Debugging enabled' ),
+ 'test' => 'is_in_debug_mode',
+ ),
+ ),
+ 'async' => array(
+ 'dotorg_communication' => array(
+ 'label' => __( 'Communication with WordPress.org' ),
+ 'test' => 'dotorg_communication',
+ ),
+ 'background_updates' => array(
+ 'label' => __( 'Background updates' ),
+ 'test' => 'background_updates',
+ ),
+ 'loopback_requests' => array(
+ 'label' => __( 'Loopback request' ),
+ 'test' => 'loopback_requests',
+ ),
+ ),
+ );
+
+ // Conditionally include REST rules if the function for it exists.
+ if ( function_exists( 'rest_url' ) ) {
+ $tests['direct']['rest_availability'] = array(
+ 'label' => __( 'REST API availability' ),
+ 'test' => 'rest_availability',
+ );
+ }
+
+ /**
+ * Add or modify which site status tests are run on a site.
+ *
+ * The site health is determined by a set of tests based on best practices from
+ * both the WordPress Hosting Team, but also web standards in general.
+ *
+ * Some sites may not have the same requirements, for example the automatic update
+ * checks may be handled by a host, and are therefore disabled in core.
+ * Or maybe you want to introduce a new test, is caching enabled/disabled/stale for example.
+ *
+ * Tests may be added either as direct, or asynchronous ones. Any test that may require some time
+ * to complete should run asynchronously, to avoid extended loading periods within wp-admin.
+ *
+ * @since 5.2.0
+ *
+ * @param array $test_type {
+ * An associative array, where the `$test_type` is either `direct` or
+ * `async`, to declare if the test should run via AJAX calls after page load.
+ *
+ * @type array $identifier {
+ * `$identifier` should be a unique identifier for the test that should run.
+ * Plugins and themes are encouraged to prefix test identifiers with their slug
+ * to avoid any collisions between tests.
+ *
+ * @type string $label A friendly label for your test to identify it by.
+ * @type mixed $test A callable to perform a direct test, or a string AJAX action to be called
+ * to perform an async test.
+ * }
+ * }
+ */
+ $tests = apply_filters( 'site_status_tests', $tests );
+
+ return $tests;
+ }
+
+ /**
+ * Add a class to the body HTML tag.
+ *
+ * Filters the body class string for admin pages and adds our own class for easier styling.
+ *
+ * @since 5.2.0
+ *
+ * @param string $body_class The body class string.
+ * @return string The modified body class string.
+ */
+ public function admin_body_class( $body_class ) {
+ $body_class .= ' site-health';
+
+ return $body_class;
+ }
+
+ /**
+ * Initiate the WP_Cron schedule test cases.
+ *
+ * @since 5.2.0
+ */
+ private function wp_schedule_test_init() {
+ $this->schedules = wp_get_schedules();
+ $this->get_cron_tasks();
+ }
+
+ /**
+ * Populate our list of cron events and store them to a class-wide variable.
+ *
+ * @since 5.2.0
+ */
+ private function get_cron_tasks() {
+ $cron_tasks = _get_cron_array();
+
+ if ( empty( $cron_tasks ) ) {
+ $this->crons = new WP_Error( 'no_tasks', __( 'No scheduled events exist on this site.' ) );
+ return;
+ }
+
+ $this->crons = array();
+
+ foreach ( $cron_tasks as $time => $cron ) {
+ foreach ( $cron as $hook => $dings ) {
+ foreach ( $dings as $sig => $data ) {
+
+ $this->crons[ "$hook-$sig-$time" ] = (object) array(
+ 'hook' => $hook,
+ 'time' => $time,
+ 'sig' => $sig,
+ 'args' => $data['args'],
+ 'schedule' => $data['schedule'],
+ 'interval' => isset( $data['interval'] ) ? $data['interval'] : null,
+ );
+
+ }
+ }
+ }
+ }
+
+ /**
+ * Check if any scheduled tasks have been missed.
+ *
+ * Returns a boolean value of `true` if a scheduled task has been missed and ends processing. If the list of
+ * crons is an instance of WP_Error, return the instance instead of a boolean value.
+ *
+ * @since 5.2.0
+ *
+ * @return bool|WP_Error true if a cron was missed, false if it wasn't. WP_Error if the cron is set to that.
+ */
+ public function has_missed_cron() {
+ if ( is_wp_error( $this->crons ) ) {
+ return $this->crons;
+ }
+
+ foreach ( $this->crons as $id => $cron ) {
+ if ( ( $cron->time - time() ) < 0 ) {
+ $this->last_missed_cron = $cron->hook;
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ /**
+ * Run a loopback test on our site.
+ *
+ * Loopbacks are what WordPress uses to communicate with itself to start up WP_Cron, scheduled posts,
+ * make sure plugin or theme edits don't cause site failures and similar.
+ *
+ * @since 5.2.0
+ *
+ * @return object The test results.
+ */
+ function can_perform_loopback() {
+ $cookies = wp_unslash( $_COOKIE );
+ $timeout = 10;
+ $headers = array(
+ 'Cache-Control' => 'no-cache',
+ );
+
+ // Include Basic auth in loopback requests.
+ if ( isset( $_SERVER['PHP_AUTH_USER'] ) && isset( $_SERVER['PHP_AUTH_PW'] ) ) {
+ $headers['Authorization'] = 'Basic ' . base64_encode( wp_unslash( $_SERVER['PHP_AUTH_USER'] ) . ':' . wp_unslash( $_SERVER['PHP_AUTH_PW'] ) );
+ }
+
+ $url = admin_url();
+
+ $r = wp_remote_get( $url, compact( 'cookies', 'headers', 'timeout' ) );
+
+ if ( is_wp_error( $r ) ) {
+ return (object) array(
+ 'status' => 'critical',
+ 'message' => sprintf(
+ '%s<br>%s',
+ __( 'The loopback request to your site failed, this means features relying on them are not currently working as expected.' ),
+ sprintf(
+ // translators: 1: The HTTP response code. 2: The error message returned.
+ __( 'Error: [%1$s] %2$s' ),
+ wp_remote_retrieve_response_code( $r ),
+ $r->get_error_message()
+ )
+ ),
+ );
+ }
+
+ if ( 200 !== wp_remote_retrieve_response_code( $r ) ) {
+ return (object) array(
+ 'status' => 'recommended',
+ 'message' => sprintf(
+ // translators: %d: The HTTP response code returned.
+ __( 'The loopback request returned an unexpected http status code, %d, it was not possible to determine if this will prevent features from working as expected.' ),
+ wp_remote_retrieve_response_code( $r )
+ ),
+ );
+ }
+
+ return (object) array(
+ 'status' => 'good',
+ 'message' => __( 'The loopback request to your site completed successfully.' ),
+ );
+ }
+}
diff --git a/www/crm/wp-admin/includes/class-wp-site-icon.php b/www/crm/wp-admin/includes/class-wp-site-icon.php
new file mode 100644
index 00000000..a16565e7
--- /dev/null
+++ b/www/crm/wp-admin/includes/class-wp-site-icon.php
@@ -0,0 +1,233 @@
+<?php
+/**
+ * Administration API: WP_Site_Icon class
+ *
+ * @package WordPress
+ * @subpackage Administration
+ * @since 4.3.0
+ */
+
+/**
+ * Core class used to implement site icon functionality.
+ *
+ * @since 4.3.0
+ */
+class WP_Site_Icon {
+
+ /**
+ * The minimum size of the site icon.
+ *
+ * @since 4.3.0
+ * @var int
+ */
+ public $min_size = 512;
+
+ /**
+ * The size to which to crop the image so that we can display it in the UI nicely.
+ *
+ * @since 4.3.0
+ * @var int
+ */
+ public $page_crop = 512;
+
+ /**
+ * List of site icon sizes.
+ *
+ * @since 4.3.0
+ * @var int[]
+ */
+ public $site_icon_sizes = array(
+ /*
+ * Square, medium sized tiles for IE11+.
+ *
+ * See https://msdn.microsoft.com/library/dn455106(v=vs.85).aspx
+ */
+ 270,
+
+ /*
+ * App icon for Android/Chrome.
+ *
+ * @link https://developers.google.com/web/updates/2014/11/Support-for-theme-color-in-Chrome-39-for-Android
+ * @link https://developer.chrome.com/multidevice/android/installtohomescreen
+ */
+ 192,
+
+ /*
+ * App icons up to iPhone 6 Plus.
+ *
+ * See https://developer.apple.com/library/prerelease/ios/documentation/UserExperience/Conceptual/MobileHIG/IconMatrix.html
+ */
+ 180,
+
+ // Our regular Favicon.
+ 32,
+ );
+
+ /**
+ * Registers actions and filters.
+ *
+ * @since 4.3.0
+ */
+ public function __construct() {
+ add_action( 'delete_attachment', array( $this, 'delete_attachment_data' ) );
+ add_filter( 'get_post_metadata', array( $this, 'get_post_metadata' ), 10, 4 );
+ }
+
+ /**
+ * Creates an attachment 'object'.
+ *
+ * @since 4.3.0
+ *
+ * @param string $cropped Cropped image URL.
+ * @param int $parent_attachment_id Attachment ID of parent image.
+ * @return array Attachment object.
+ */
+ public function create_attachment_object( $cropped, $parent_attachment_id ) {
+ $parent = get_post( $parent_attachment_id );
+ $parent_url = wp_get_attachment_url( $parent->ID );
+ $url = str_replace( wp_basename( $parent_url ), wp_basename( $cropped ), $parent_url );
+
+ $size = @getimagesize( $cropped );
+ $image_type = ( $size ) ? $size['mime'] : 'image/jpeg';
+
+ $object = array(
+ 'ID' => $parent_attachment_id,
+ 'post_title' => wp_basename( $cropped ),
+ 'post_content' => $url,
+ 'post_mime_type' => $image_type,
+ 'guid' => $url,
+ 'context' => 'site-icon',
+ );
+
+ return $object;
+ }
+
+ /**
+ * Inserts an attachment.
+ *
+ * @since 4.3.0
+ *
+ * @param array $object Attachment object.
+ * @param string $file File path of the attached image.
+ * @return int Attachment ID
+ */
+ public function insert_attachment( $object, $file ) {
+ $attachment_id = wp_insert_attachment( $object, $file );
+ $metadata = wp_generate_attachment_metadata( $attachment_id, $file );
+
+ /**
+ * Filters the site icon attachment metadata.
+ *
+ * @since 4.3.0
+ *
+ * @see wp_generate_attachment_metadata()
+ *
+ * @param array $metadata Attachment metadata.
+ */
+ $metadata = apply_filters( 'site_icon_attachment_metadata', $metadata );
+ wp_update_attachment_metadata( $attachment_id, $metadata );
+
+ return $attachment_id;
+ }
+
+ /**
+ * Adds additional sizes to be made when creating the site icon images.
+ *
+ * @since 4.3.0
+ *
+ * @param array[] $sizes Array of arrays containing information for additional sizes.
+ * @return array[] Array of arrays containing additional image sizes.
+ */
+ public function additional_sizes( $sizes = array() ) {
+ $only_crop_sizes = array();
+
+ /**
+ * Filters the different dimensions that a site icon is saved in.
+ *
+ * @since 4.3.0
+ *
+ * @param int[] $site_icon_sizes Array of sizes available for the Site Icon.
+ */
+ $this->site_icon_sizes = apply_filters( 'site_icon_image_sizes', $this->site_icon_sizes );
+
+ // Use a natural sort of numbers.
+ natsort( $this->site_icon_sizes );
+ $this->site_icon_sizes = array_reverse( $this->site_icon_sizes );
+
+ // ensure that we only resize the image into
+ foreach ( $sizes as $name => $size_array ) {
+ if ( isset( $size_array['crop'] ) ) {
+ $only_crop_sizes[ $name ] = $size_array;
+ }
+ }
+
+ foreach ( $this->site_icon_sizes as $size ) {
+ if ( $size < $this->min_size ) {
+ $only_crop_sizes[ 'site_icon-' . $size ] = array(
+ 'width ' => $size,
+ 'height' => $size,
+ 'crop' => true,
+ );
+ }
+ }
+
+ return $only_crop_sizes;
+ }
+
+ /**
+ * Adds Site Icon sizes to the array of image sizes on demand.
+ *
+ * @since 4.3.0
+ *
+ * @param string[] $sizes Array of image size names.
+ * @return string[] Array of image size names.
+ */
+ public function intermediate_image_sizes( $sizes = array() ) {
+ /** This filter is documented in wp-admin/includes/class-wp-site-icon.php */
+ $this->site_icon_sizes = apply_filters( 'site_icon_image_sizes', $this->site_icon_sizes );
+ foreach ( $this->site_icon_sizes as $size ) {
+ $sizes[] = 'site_icon-' . $size;
+ }
+
+ return $sizes;
+ }
+
+ /**
+ * Deletes the Site Icon when the image file is deleted.
+ *
+ * @since 4.3.0
+ *
+ * @param int $post_id Attachment ID.
+ */
+ public function delete_attachment_data( $post_id ) {
+ $site_icon_id = get_option( 'site_icon' );
+
+ if ( $site_icon_id && $post_id == $site_icon_id ) {
+ delete_option( 'site_icon' );
+ }
+ }
+
+ /**
+ * Adds custom image sizes when meta data for an image is requested, that happens to be used as Site Icon.
+ *
+ * @since 4.3.0
+ *
+ * @param null|array|string $value The value get_metadata() should return a single metadata value, or an
+ * array of values.
+ * @param int $post_id Post ID.
+ * @param string $meta_key Meta key.
+ * @param string|array $single Meta value, or an array of values.
+ * @return array|null|string The attachment metadata value, array of values, or null.
+ */
+ public function get_post_metadata( $value, $post_id, $meta_key, $single ) {
+ if ( $single && '_wp_attachment_backup_sizes' === $meta_key ) {
+ $site_icon_id = get_option( 'site_icon' );
+
+ if ( $post_id == $site_icon_id ) {
+ add_filter( 'intermediate_image_sizes', array( $this, 'intermediate_image_sizes' ) );
+ }
+ }
+
+ return $value;
+ }
+}
diff --git a/www/crm/wp-admin/includes/class-wp-terms-list-table.php b/www/crm/wp-admin/includes/class-wp-terms-list-table.php
new file mode 100644
index 00000000..d30fb3d8
--- /dev/null
+++ b/www/crm/wp-admin/includes/class-wp-terms-list-table.php
@@ -0,0 +1,676 @@
+<?php
+/**
+ * List Table API: WP_Terms_List_Table class
+ *
+ * @package WordPress
+ * @subpackage Administration
+ * @since 3.1.0
+ */
+
+/**
+ * Core class used to implement displaying terms in a list table.
+ *
+ * @since 3.1.0
+ * @access private
+ *
+ * @see WP_List_Table
+ */
+class WP_Terms_List_Table extends WP_List_Table {
+
+ public $callback_args;
+
+ private $level;
+
+ /**
+ * Constructor.
+ *
+ * @since 3.1.0
+ *
+ * @see WP_List_Table::__construct() for more information on default arguments.
+ *
+ * @global string $post_type
+ * @global string $taxonomy
+ * @global string $action
+ * @global object $tax
+ *
+ * @param array $args An associative array of arguments.
+ */
+ public function __construct( $args = array() ) {
+ global $post_type, $taxonomy, $action, $tax;
+
+ parent::__construct(
+ array(
+ 'plural' => 'tags',
+ 'singular' => 'tag',
+ 'screen' => isset( $args['screen'] ) ? $args['screen'] : null,
+ )
+ );
+
+ $action = $this->screen->action;
+ $post_type = $this->screen->post_type;
+ $taxonomy = $this->screen->taxonomy;
+
+ if ( empty( $taxonomy ) ) {
+ $taxonomy = 'post_tag';
+ }
+
+ if ( ! taxonomy_exists( $taxonomy ) ) {
+ wp_die( __( 'Invalid taxonomy.' ) );
+ }
+
+ $tax = get_taxonomy( $taxonomy );
+
+ // @todo Still needed? Maybe just the show_ui part.
+ if ( empty( $post_type ) || ! in_array( $post_type, get_post_types( array( 'show_ui' => true ) ) ) ) {
+ $post_type = 'post';
+ }
+
+ }
+
+ /**
+ * @return bool
+ */
+ public function ajax_user_can() {
+ return current_user_can( get_taxonomy( $this->screen->taxonomy )->cap->manage_terms );
+ }
+
+ /**
+ */
+ public function prepare_items() {
+ $tags_per_page = $this->get_items_per_page( 'edit_' . $this->screen->taxonomy . '_per_page' );
+
+ if ( 'post_tag' === $this->screen->taxonomy ) {
+ /**
+ * Filters the number of terms displayed per page for the Tags list table.
+ *
+ * @since 2.8.0
+ *
+ * @param int $tags_per_page Number of tags to be displayed. Default 20.
+ */
+ $tags_per_page = apply_filters( 'edit_tags_per_page', $tags_per_page );
+
+ /**
+ * Filters the number of terms displayed per page for the Tags list table.
+ *
+ * @since 2.7.0
+ * @deprecated 2.8.0 Use edit_tags_per_page instead.
+ *
+ * @param int $tags_per_page Number of tags to be displayed. Default 20.
+ */
+ $tags_per_page = apply_filters( 'tagsperpage', $tags_per_page );
+ } elseif ( 'category' === $this->screen->taxonomy ) {
+ /**
+ * Filters the number of terms displayed per page for the Categories list table.
+ *
+ * @since 2.8.0
+ *
+ * @param int $tags_per_page Number of categories to be displayed. Default 20.
+ */
+ $tags_per_page = apply_filters( 'edit_categories_per_page', $tags_per_page );
+ }
+
+ $search = ! empty( $_REQUEST['s'] ) ? trim( wp_unslash( $_REQUEST['s'] ) ) : '';
+
+ $args = array(
+ 'search' => $search,
+ 'page' => $this->get_pagenum(),
+ 'number' => $tags_per_page,
+ );
+
+ if ( ! empty( $_REQUEST['orderby'] ) ) {
+ $args['orderby'] = trim( wp_unslash( $_REQUEST['orderby'] ) );
+ }
+
+ if ( ! empty( $_REQUEST['order'] ) ) {
+ $args['order'] = trim( wp_unslash( $_REQUEST['order'] ) );
+ }
+
+ $this->callback_args = $args;
+
+ $this->set_pagination_args(
+ array(
+ 'total_items' => wp_count_terms( $this->screen->taxonomy, compact( 'search' ) ),
+ 'per_page' => $tags_per_page,
+ )
+ );
+ }
+
+ /**
+ * @return bool
+ */
+ public function has_items() {
+ // todo: populate $this->items in prepare_items()
+ return true;
+ }
+
+ /**
+ */
+ public function no_items() {
+ echo get_taxonomy( $this->screen->taxonomy )->labels->not_found;
+ }
+
+ /**
+ * @return array
+ */
+ protected function get_bulk_actions() {
+ $actions = array();
+
+ if ( current_user_can( get_taxonomy( $this->screen->taxonomy )->cap->delete_terms ) ) {
+ $actions['delete'] = __( 'Delete' );
+ }
+
+ return $actions;
+ }
+
+ /**
+ * @return string
+ */
+ public function current_action() {
+ if ( isset( $_REQUEST['action'] ) && isset( $_REQUEST['delete_tags'] ) && ( 'delete' === $_REQUEST['action'] || 'delete' === $_REQUEST['action2'] ) ) {
+ return 'bulk-delete';
+ }
+
+ return parent::current_action();
+ }
+
+ /**
+ * @return array
+ */
+ public function get_columns() {
+ $columns = array(
+ 'cb' => '<input type="checkbox" />',
+ 'name' => _x( 'Name', 'term name' ),
+ 'description' => __( 'Description' ),
+ 'slug' => __( 'Slug' ),
+ );
+
+ if ( 'link_category' === $this->screen->taxonomy ) {
+ $columns['links'] = __( 'Links' );
+ } else {
+ $columns['posts'] = _x( 'Count', 'Number/count of items' );
+ }
+
+ return $columns;
+ }
+
+ /**
+ * @return array
+ */
+ protected function get_sortable_columns() {
+ return array(
+ 'name' => 'name',
+ 'description' => 'description',
+ 'slug' => 'slug',
+ 'posts' => 'count',
+ 'links' => 'count',
+ );
+ }
+
+ /**
+ */
+ public function display_rows_or_placeholder() {
+ $taxonomy = $this->screen->taxonomy;
+
+ $args = wp_parse_args(
+ $this->callback_args,
+ array(
+ 'page' => 1,
+ 'number' => 20,
+ 'search' => '',
+ 'hide_empty' => 0,
+ )
+ );
+
+ $page = $args['page'];
+
+ // Set variable because $args['number'] can be subsequently overridden.
+ $number = $args['number'];
+
+ $args['offset'] = $offset = ( $page - 1 ) * $number;
+
+ // Convert it to table rows.
+ $count = 0;
+
+ if ( is_taxonomy_hierarchical( $taxonomy ) && ! isset( $args['orderby'] ) ) {
+ // We'll need the full set of terms then.
+ $args['number'] = $args['offset'] = 0;
+ }
+ $terms = get_terms( $taxonomy, $args );
+
+ if ( empty( $terms ) || ! is_array( $terms ) ) {
+ echo '<tr class="no-items"><td class="colspanchange" colspan="' . $this->get_column_count() . '">';
+ $this->no_items();
+ echo '</td></tr>';
+ return;
+ }
+
+ if ( is_taxonomy_hierarchical( $taxonomy ) && ! isset( $args['orderby'] ) ) {
+ if ( ! empty( $args['search'] ) ) {// Ignore children on searches.
+ $children = array();
+ } else {
+ $children = _get_term_hierarchy( $taxonomy );
+ }
+ // Some funky recursion to get the job done( Paging & parents mainly ) is contained within, Skip it for non-hierarchical taxonomies for performance sake
+ $this->_rows( $taxonomy, $terms, $children, $offset, $number, $count );
+ } else {
+ foreach ( $terms as $term ) {
+ $this->single_row( $term );
+ }
+ }
+ }
+
+ /**
+ * @param string $taxonomy
+ * @param array $terms
+ * @param array $children
+ * @param int $start
+ * @param int $per_page
+ * @param int $count
+ * @param int $parent
+ * @param int $level
+ */
+ private function _rows( $taxonomy, $terms, &$children, $start, $per_page, &$count, $parent = 0, $level = 0 ) {
+
+ $end = $start + $per_page;
+
+ foreach ( $terms as $key => $term ) {
+
+ if ( $count >= $end ) {
+ break;
+ }
+
+ if ( $term->parent != $parent && empty( $_REQUEST['s'] ) ) {
+ continue;
+ }
+
+ // If the page starts in a subtree, print the parents.
+ if ( $count == $start && $term->parent > 0 && empty( $_REQUEST['s'] ) ) {
+ $my_parents = $parent_ids = array();
+ $p = $term->parent;
+ while ( $p ) {
+ $my_parent = get_term( $p, $taxonomy );
+ $my_parents[] = $my_parent;
+ $p = $my_parent->parent;
+ if ( in_array( $p, $parent_ids ) ) { // Prevent parent loops.
+ break;
+ }
+ $parent_ids[] = $p;
+ }
+ unset( $parent_ids );
+
+ $num_parents = count( $my_parents );
+ while ( $my_parent = array_pop( $my_parents ) ) {
+ echo "\t";
+ $this->single_row( $my_parent, $level - $num_parents );
+ $num_parents--;
+ }
+ }
+
+ if ( $count >= $start ) {
+ echo "\t";
+ $this->single_row( $term, $level );
+ }
+
+ ++$count;
+
+ unset( $terms[ $key ] );
+
+ if ( isset( $children[ $term->term_id ] ) && empty( $_REQUEST['s'] ) ) {
+ $this->_rows( $taxonomy, $terms, $children, $start, $per_page, $count, $term->term_id, $level + 1 );
+ }
+ }
+ }
+
+ /**
+ * @global string $taxonomy
+ * @param WP_Term $tag Term object.
+ * @param int $level
+ */
+ public function single_row( $tag, $level = 0 ) {
+ global $taxonomy;
+ $tag = sanitize_term( $tag, $taxonomy );
+
+ $this->level = $level;
+
+ if ( $tag->parent ) {
+ $count = count( get_ancestors( $tag->term_id, $taxonomy, 'taxonomy' ) );
+ $level = 'level-' . $count;
+ } else {
+ $level = 'level-0';
+ }
+
+ echo '<tr id="tag-' . $tag->term_id . '" class="' . $level . '">';
+ $this->single_row_columns( $tag );
+ echo '</tr>';
+ }
+
+ /**
+ * @param WP_Term $tag Term object.
+ * @return string
+ */
+ public function column_cb( $tag ) {
+ if ( current_user_can( 'delete_term', $tag->term_id ) ) {
+ return '<label class="screen-reader-text" for="cb-select-' . $tag->term_id . '">' . sprintf( __( 'Select %s' ), $tag->name ) . '</label>'
+ . '<input type="checkbox" name="delete_tags[]" value="' . $tag->term_id . '" id="cb-select-' . $tag->term_id . '" />';
+ }
+
+ return '&nbsp;';
+ }
+
+ /**
+ * @param WP_Term $tag Term object.
+ * @return string
+ */
+ public function column_name( $tag ) {
+ $taxonomy = $this->screen->taxonomy;
+
+ $pad = str_repeat( '&#8212; ', max( 0, $this->level ) );
+
+ /**
+ * Filters display of the term name in the terms list table.
+ *
+ * The default output may include padding due to the term's
+ * current level in the term hierarchy.
+ *
+ * @since 2.5.0
+ *
+ * @see WP_Terms_List_Table::column_name()
+ *
+ * @param string $pad_tag_name The term name, padded if not top-level.
+ * @param WP_Term $tag Term object.
+ */
+ $name = apply_filters( 'term_name', $pad . ' ' . $tag->name, $tag );
+
+ $qe_data = get_term( $tag->term_id, $taxonomy, OBJECT, 'edit' );
+
+ $uri = wp_doing_ajax() ? wp_get_referer() : $_SERVER['REQUEST_URI'];
+
+ $edit_link = get_edit_term_link( $tag->term_id, $taxonomy, $this->screen->post_type );
+
+ if ( $edit_link ) {
+ $edit_link = add_query_arg(
+ 'wp_http_referer',
+ urlencode( wp_unslash( $uri ) ),
+ $edit_link
+ );
+ $name = sprintf(
+ '<a class="row-title" href="%s" aria-label="%s">%s</a>',
+ esc_url( $edit_link ),
+ /* translators: %s: taxonomy term name */
+ esc_attr( sprintf( __( '&#8220;%s&#8221; (Edit)' ), $tag->name ) ),
+ $name
+ );
+ }
+
+ $out = sprintf(
+ '<strong>%s</strong><br />',
+ $name
+ );
+
+ $out .= '<div class="hidden" id="inline_' . $qe_data->term_id . '">';
+ $out .= '<div class="name">' . $qe_data->name . '</div>';
+
+ /** This filter is documented in wp-admin/edit-tag-form.php */
+ $out .= '<div class="slug">' . apply_filters( 'editable_slug', $qe_data->slug, $qe_data ) . '</div>';
+ $out .= '<div class="parent">' . $qe_data->parent . '</div></div>';
+
+ return $out;
+ }
+
+ /**
+ * Gets the name of the default primary column.
+ *
+ * @since 4.3.0
+ *
+ * @return string Name of the default primary column, in this case, 'name'.
+ */
+ protected function get_default_primary_column_name() {
+ return 'name';
+ }
+
+ /**
+ * Generates and displays row action links.
+ *
+ * @since 4.3.0
+ *
+ * @param WP_Term $tag Tag being acted upon.
+ * @param string $column_name Current column name.
+ * @param string $primary Primary column name.
+ * @return string Row actions output for terms.
+ */
+ protected function handle_row_actions( $tag, $column_name, $primary ) {
+ if ( $primary !== $column_name ) {
+ return '';
+ }
+
+ $taxonomy = $this->screen->taxonomy;
+ $tax = get_taxonomy( $taxonomy );
+ $uri = wp_doing_ajax() ? wp_get_referer() : $_SERVER['REQUEST_URI'];
+
+ $edit_link = add_query_arg(
+ 'wp_http_referer',
+ urlencode( wp_unslash( $uri ) ),
+ get_edit_term_link( $tag->term_id, $taxonomy, $this->screen->post_type )
+ );
+
+ $actions = array();
+ if ( current_user_can( 'edit_term', $tag->term_id ) ) {
+ $actions['edit'] = sprintf(
+ '<a href="%s" aria-label="%s">%s</a>',
+ esc_url( $edit_link ),
+ /* translators: %s: taxonomy term name */
+ esc_attr( sprintf( __( 'Edit &#8220;%s&#8221;' ), $tag->name ) ),
+ __( 'Edit' )
+ );
+ $actions['inline hide-if-no-js'] = sprintf(
+ '<button type="button" class="button-link editinline" aria-label="%s" aria-expanded="false">%s</button>',
+ /* translators: %s: taxonomy term name */
+ esc_attr( sprintf( __( 'Quick edit &#8220;%s&#8221; inline' ), $tag->name ) ),
+ __( 'Quick&nbsp;Edit' )
+ );
+ }
+ if ( current_user_can( 'delete_term', $tag->term_id ) ) {
+ $actions['delete'] = sprintf(
+ '<a href="%s" class="delete-tag aria-button-if-js" aria-label="%s">%s</a>',
+ wp_nonce_url( "edit-tags.php?action=delete&amp;taxonomy=$taxonomy&amp;tag_ID=$tag->term_id", 'delete-tag_' . $tag->term_id ),
+ /* translators: %s: taxonomy term name */
+ esc_attr( sprintf( __( 'Delete &#8220;%s&#8221;' ), $tag->name ) ),
+ __( 'Delete' )
+ );
+ }
+ if ( is_taxonomy_viewable( $tax ) ) {
+ $actions['view'] = sprintf(
+ '<a href="%s" aria-label="%s">%s</a>',
+ get_term_link( $tag ),
+ /* translators: %s: taxonomy term name */
+ esc_attr( sprintf( __( 'View &#8220;%s&#8221; archive' ), $tag->name ) ),
+ __( 'View' )
+ );
+ }
+
+ /**
+ * Filters the action links displayed for each term in the Tags list table.
+ *
+ * @since 2.8.0
+ * @deprecated 3.0.0 Use {$taxonomy}_row_actions instead.
+ *
+ * @param string[] $actions An array of action links to be displayed. Default
+ * 'Edit', 'Quick Edit', 'Delete', and 'View'.
+ * @param WP_Term $tag Term object.
+ */
+ $actions = apply_filters( 'tag_row_actions', $actions, $tag );
+
+ /**
+ * Filters the action links displayed for each term in the terms list table.
+ *
+ * The dynamic portion of the hook name, `$taxonomy`, refers to the taxonomy slug.
+ *
+ * @since 3.0.0
+ *
+ * @param string[] $actions An array of action links to be displayed. Default
+ * 'Edit', 'Quick Edit', 'Delete', and 'View'.
+ * @param WP_Term $tag Term object.
+ */
+ $actions = apply_filters( "{$taxonomy}_row_actions", $actions, $tag );
+
+ return $this->row_actions( $actions );
+ }
+
+ /**
+ * @param WP_Term $tag Term object.
+ * @return string
+ */
+ public function column_description( $tag ) {
+ if ( $tag->description ) {
+ return $tag->description;
+ } else {
+ return '<span aria-hidden="true">&#8212;</span><span class="screen-reader-text">' . __( 'No description' ) . '</span>';
+ }
+ }
+
+ /**
+ * @param WP_Term $tag Term object.
+ * @return string
+ */
+ public function column_slug( $tag ) {
+ /** This filter is documented in wp-admin/edit-tag-form.php */
+ return apply_filters( 'editable_slug', $tag->slug, $tag );
+ }
+
+ /**
+ * @param WP_Term $tag Term object.
+ * @return string
+ */
+ public function column_posts( $tag ) {
+ $count = number_format_i18n( $tag->count );
+
+ $tax = get_taxonomy( $this->screen->taxonomy );
+
+ $ptype_object = get_post_type_object( $this->screen->post_type );
+ if ( ! $ptype_object->show_ui ) {
+ return $count;
+ }
+
+ if ( $tax->query_var ) {
+ $args = array( $tax->query_var => $tag->slug );
+ } else {
+ $args = array(
+ 'taxonomy' => $tax->name,
+ 'term' => $tag->slug,
+ );
+ }
+
+ if ( 'post' != $this->screen->post_type ) {
+ $args['post_type'] = $this->screen->post_type;
+ }
+
+ if ( 'attachment' === $this->screen->post_type ) {
+ return "<a href='" . esc_url( add_query_arg( $args, 'upload.php' ) ) . "'>$count</a>";
+ }
+
+ return "<a href='" . esc_url( add_query_arg( $args, 'edit.php' ) ) . "'>$count</a>";
+ }
+
+ /**
+ * @param WP_Term $tag Term object.
+ * @return string
+ */
+ public function column_links( $tag ) {
+ $count = number_format_i18n( $tag->count );
+ if ( $count ) {
+ $count = "<a href='link-manager.php?cat_id=$tag->term_id'>$count</a>";
+ }
+ return $count;
+ }
+
+ /**
+ * @param WP_Term $tag Term object.
+ * @param string $column_name
+ * @return string
+ */
+ public function column_default( $tag, $column_name ) {
+ /**
+ * Filters the displayed columns in the terms list table.
+ *
+ * The dynamic portion of the hook name, `$this->screen->taxonomy`,
+ * refers to the slug of the current taxonomy.
+ *
+ * @since 2.8.0
+ *
+ * @param string $string Blank string.
+ * @param string $column_name Name of the column.
+ * @param int $term_id Term ID.
+ */
+ return apply_filters( "manage_{$this->screen->taxonomy}_custom_column", '', $column_name, $tag->term_id );
+ }
+
+ /**
+ * Outputs the hidden row displayed when inline editing
+ *
+ * @since 3.1.0
+ */
+ public function inline_edit() {
+ $tax = get_taxonomy( $this->screen->taxonomy );
+
+ if ( ! current_user_can( $tax->cap->edit_terms ) ) {
+ return;
+ }
+ ?>
+
+ <form method="get"><table style="display: none"><tbody id="inlineedit">
+ <tr id="inline-edit" class="inline-edit-row" style="display: none"><td colspan="<?php echo $this->get_column_count(); ?>" class="colspanchange">
+
+ <fieldset>
+ <legend class="inline-edit-legend"><?php _e( 'Quick Edit' ); ?></legend>
+ <div class="inline-edit-col">
+ <label>
+ <span class="title"><?php _ex( 'Name', 'term name' ); ?></span>
+ <span class="input-text-wrap"><input type="text" name="name" class="ptitle" value="" /></span>
+ </label>
+ <?php if ( ! global_terms_enabled() ) { ?>
+ <label>
+ <span class="title"><?php _e( 'Slug' ); ?></span>
+ <span class="input-text-wrap"><input type="text" name="slug" class="ptitle" value="" /></span>
+ </label>
+ <?php } ?>
+ </div></fieldset>
+ <?php
+
+ $core_columns = array(
+ 'cb' => true,
+ 'description' => true,
+ 'name' => true,
+ 'slug' => true,
+ 'posts' => true,
+ );
+
+ list( $columns ) = $this->get_column_info();
+
+ foreach ( $columns as $column_name => $column_display_name ) {
+ if ( isset( $core_columns[ $column_name ] ) ) {
+ continue;
+ }
+
+ /** This action is documented in wp-admin/includes/class-wp-posts-list-table.php */
+ do_action( 'quick_edit_custom_box', $column_name, 'edit-tags', $this->screen->taxonomy );
+ }
+
+ ?>
+
+ <div class="inline-edit-save submit">
+ <button type="button" class="cancel button alignleft"><?php _e( 'Cancel' ); ?></button>
+ <button type="button" class="save button button-primary alignright"><?php echo $tax->labels->update_item; ?></button>
+ <span class="spinner"></span>
+ <?php wp_nonce_field( 'taxinlineeditnonce', '_inline_edit', false ); ?>
+ <input type="hidden" name="taxonomy" value="<?php echo esc_attr( $this->screen->taxonomy ); ?>" />
+ <input type="hidden" name="post_type" value="<?php echo esc_attr( $this->screen->post_type ); ?>" />
+ <br class="clear" />
+ <div class="notice notice-error notice-alt inline hidden">
+ <p class="error"></p>
+ </div>
+ </div>
+ </td></tr>
+ </tbody></table></form>
+ <?php
+ }
+}
diff --git a/www/crm/wp-admin/includes/class-wp-theme-install-list-table.php b/www/crm/wp-admin/includes/class-wp-theme-install-list-table.php
new file mode 100644
index 00000000..475056d8
--- /dev/null
+++ b/www/crm/wp-admin/includes/class-wp-theme-install-list-table.php
@@ -0,0 +1,555 @@
+<?php
+/**
+ * List Table API: WP_Theme_Install_List_Table class
+ *
+ * @package WordPress
+ * @subpackage Administration
+ * @since 3.1.0
+ */
+
+/**
+ * Core class used to implement displaying themes to install in a list table.
+ *
+ * @since 3.1.0
+ * @access private
+ *
+ * @see WP_Themes_List_Table
+ */
+class WP_Theme_Install_List_Table extends WP_Themes_List_Table {
+
+ public $features = array();
+
+ /**
+ * @return bool
+ */
+ public function ajax_user_can() {
+ return current_user_can( 'install_themes' );
+ }
+
+ /**
+ * @global array $tabs
+ * @global string $tab
+ * @global int $paged
+ * @global string $type
+ * @global array $theme_field_defaults
+ */
+ public function prepare_items() {
+ include( ABSPATH . 'wp-admin/includes/theme-install.php' );
+
+ global $tabs, $tab, $paged, $type, $theme_field_defaults;
+ wp_reset_vars( array( 'tab' ) );
+
+ $search_terms = array();
+ $search_string = '';
+ if ( ! empty( $_REQUEST['s'] ) ) {
+ $search_string = strtolower( wp_unslash( $_REQUEST['s'] ) );
+ $search_terms = array_unique( array_filter( array_map( 'trim', explode( ',', $search_string ) ) ) );
+ }
+
+ if ( ! empty( $_REQUEST['features'] ) ) {
+ $this->features = $_REQUEST['features'];
+ }
+
+ $paged = $this->get_pagenum();
+
+ $per_page = 36;
+
+ // These are the tabs which are shown on the page,
+ $tabs = array();
+ $tabs['dashboard'] = __( 'Search' );
+ if ( 'search' === $tab ) {
+ $tabs['search'] = __( 'Search Results' );
+ }
+ $tabs['upload'] = __( 'Upload' );
+ $tabs['featured'] = _x( 'Featured', 'themes' );
+ //$tabs['popular'] = _x( 'Popular', 'themes' );
+ $tabs['new'] = _x( 'Latest', 'themes' );
+ $tabs['updated'] = _x( 'Recently Updated', 'themes' );
+
+ $nonmenu_tabs = array( 'theme-information' ); // Valid actions to perform which do not have a Menu item.
+
+ /** This filter is documented in wp-admin/theme-install.php */
+ $tabs = apply_filters( 'install_themes_tabs', $tabs );
+
+ /**
+ * Filters tabs not associated with a menu item on the Install Themes screen.
+ *
+ * @since 2.8.0
+ *
+ * @param string[] $nonmenu_tabs The tabs that don't have a menu item on
+ * the Install Themes screen.
+ */
+ $nonmenu_tabs = apply_filters( 'install_themes_nonmenu_tabs', $nonmenu_tabs );
+
+ // If a non-valid menu tab has been selected, And it's not a non-menu action.
+ if ( empty( $tab ) || ( ! isset( $tabs[ $tab ] ) && ! in_array( $tab, (array) $nonmenu_tabs ) ) ) {
+ $tab = key( $tabs );
+ }
+
+ $args = array(
+ 'page' => $paged,
+ 'per_page' => $per_page,
+ 'fields' => $theme_field_defaults,
+ );
+
+ switch ( $tab ) {
+ case 'search':
+ $type = isset( $_REQUEST['type'] ) ? wp_unslash( $_REQUEST['type'] ) : 'term';
+ switch ( $type ) {
+ case 'tag':
+ $args['tag'] = array_map( 'sanitize_key', $search_terms );
+ break;
+ case 'term':
+ $args['search'] = $search_string;
+ break;
+ case 'author':
+ $args['author'] = $search_string;
+ break;
+ }
+
+ if ( ! empty( $this->features ) ) {
+ $args['tag'] = $this->features;
+ $_REQUEST['s'] = implode( ',', $this->features );
+ $_REQUEST['type'] = 'tag';
+ }
+
+ add_action( 'install_themes_table_header', 'install_theme_search_form', 10, 0 );
+ break;
+
+ case 'featured':
+ // case 'popular':
+ case 'new':
+ case 'updated':
+ $args['browse'] = $tab;
+ break;
+
+ default:
+ $args = false;
+ break;
+ }
+
+ /**
+ * Filters API request arguments for each Install Themes screen tab.
+ *
+ * The dynamic portion of the hook name, `$tab`, refers to the theme install
+ * tabs. Default tabs are 'dashboard', 'search', 'upload', 'featured',
+ * 'new', and 'updated'.
+ *
+ * @since 3.7.0
+ *
+ * @param array $args An array of themes API arguments.
+ */
+ $args = apply_filters( "install_themes_table_api_args_{$tab}", $args );
+
+ if ( ! $args ) {
+ return;
+ }
+
+ $api = themes_api( 'query_themes', $args );
+
+ if ( is_wp_error( $api ) ) {
+ wp_die( $api->get_error_message() . '</p> <p><a href="#" onclick="document.location.reload(); return false;">' . __( 'Try again' ) . '</a>' );
+ }
+
+ $this->items = $api->themes;
+
+ $this->set_pagination_args(
+ array(
+ 'total_items' => $api->info['results'],
+ 'per_page' => $args['per_page'],
+ 'infinite_scroll' => true,
+ )
+ );
+ }
+
+ /**
+ */
+ public function no_items() {
+ _e( 'No themes match your request.' );
+ }
+
+ /**
+ * @global array $tabs
+ * @global string $tab
+ * @return array
+ */
+ protected function get_views() {
+ global $tabs, $tab;
+
+ $display_tabs = array();
+ foreach ( (array) $tabs as $action => $text ) {
+ $current_link_attributes = ( $action === $tab ) ? ' class="current" aria-current="page"' : '';
+ $href = self_admin_url( 'theme-install.php?tab=' . $action );
+ $display_tabs[ 'theme-install-' . $action ] = "<a href='$href'$current_link_attributes>$text</a>";
+ }
+
+ return $display_tabs;
+ }
+
+ /**
+ */
+ public function display() {
+ wp_nonce_field( 'fetch-list-' . get_class( $this ), '_ajax_fetch_list_nonce' );
+ ?>
+ <div class="tablenav top themes">
+ <div class="alignleft actions">
+ <?php
+ /**
+ * Fires in the Install Themes list table header.
+ *
+ * @since 2.8.0
+ */
+ do_action( 'install_themes_table_header' );
+ ?>
+ </div>
+ <?php $this->pagination( 'top' ); ?>
+ <br class="clear" />
+ </div>
+
+ <div id="availablethemes">
+ <?php $this->display_rows_or_placeholder(); ?>
+ </div>
+
+ <?php
+ $this->tablenav( 'bottom' );
+ }
+
+ /**
+ */
+ public function display_rows() {
+ $themes = $this->items;
+ foreach ( $themes as $theme ) {
+ ?>
+ <div class="available-theme installable-theme">
+ <?php
+ $this->single_row( $theme );
+ ?>
+ </div>
+ <?php
+ } // end foreach $theme_names
+
+ $this->theme_installer();
+ }
+
+ /**
+ * Prints a theme from the WordPress.org API.
+ *
+ * @since 3.1.0
+ *
+ * @global array $themes_allowedtags
+ *
+ * @param object $theme {
+ * An object that contains theme data returned by the WordPress.org API.
+ *
+ * @type string $name Theme name, e.g. 'Twenty Nineteen'.
+ * @type string $slug Theme slug, e.g. 'twentynineteen'.
+ * @type string $version Theme version, e.g. '1.1'.
+ * @type string $author Theme author username, e.g. 'melchoyce'.
+ * @type string $preview_url Preview URL, e.g. 'http://2019.wordpress.net/'.
+ * @type string $screenshot_url Screenshot URL, e.g. 'https://wordpress.org/themes/twentynineteen/'.
+ * @type float $rating Rating score.
+ * @type int $num_ratings The number of ratings.
+ * @type string $homepage Theme homepage, e.g. 'https://wordpress.org/themes/twentynineteen/'.
+ * @type string $description Theme description.
+ * @type string $download_link Theme ZIP download URL.
+ * }
+ */
+ public function single_row( $theme ) {
+ global $themes_allowedtags;
+
+ if ( empty( $theme ) ) {
+ return;
+ }
+
+ $name = wp_kses( $theme->name, $themes_allowedtags );
+ $author = wp_kses( $theme->author, $themes_allowedtags );
+
+ /* translators: %s: theme name */
+ $preview_title = sprintf( __( 'Preview &#8220;%s&#8221;' ), $name );
+ $preview_url = add_query_arg(
+ array(
+ 'tab' => 'theme-information',
+ 'theme' => $theme->slug,
+ ),
+ self_admin_url( 'theme-install.php' )
+ );
+
+ $actions = array();
+
+ $install_url = add_query_arg(
+ array(
+ 'action' => 'install-theme',
+ 'theme' => $theme->slug,
+ ),
+ self_admin_url( 'update.php' )
+ );
+
+ $update_url = add_query_arg(
+ array(
+ 'action' => 'upgrade-theme',
+ 'theme' => $theme->slug,
+ ),
+ self_admin_url( 'update.php' )
+ );
+
+ $status = $this->_get_theme_status( $theme );
+
+ switch ( $status ) {
+ case 'update_available':
+ $actions[] = sprintf(
+ '<a class="install-now" href="%s" title="%s">%s</a>',
+ esc_url( wp_nonce_url( $update_url, 'upgrade-theme_' . $theme->slug ) ),
+ /* translators: %s: theme version */
+ esc_attr( sprintf( __( 'Update to version %s' ), $theme->version ) ),
+ __( 'Update' )
+ );
+ break;
+ case 'newer_installed':
+ case 'latest_installed':
+ $actions[] = sprintf(
+ '<span class="install-now" title="%s">%s</span>',
+ esc_attr__( 'This theme is already installed and is up to date' ),
+ _x( 'Installed', 'theme' )
+ );
+ break;
+ case 'install':
+ default:
+ $actions[] = sprintf(
+ '<a class="install-now" href="%s" title="%s">%s</a>',
+ esc_url( wp_nonce_url( $install_url, 'install-theme_' . $theme->slug ) ),
+ /* translators: %s: theme name */
+ esc_attr( sprintf( __( 'Install %s' ), $name ) ),
+ __( 'Install Now' )
+ );
+ break;
+ }
+
+ $actions[] = sprintf(
+ '<a class="install-theme-preview" href="%s" title="%s">%s</a>',
+ esc_url( $preview_url ),
+ /* translators: %s: theme name */
+ esc_attr( sprintf( __( 'Preview %s' ), $name ) ),
+ __( 'Preview' )
+ );
+
+ /**
+ * Filters the install action links for a theme in the Install Themes list table.
+ *
+ * @since 3.4.0
+ *
+ * @param string[] $actions An array of theme action links. Defaults are
+ * links to Install Now, Preview, and Details.
+ * @param WP_Theme $theme Theme object.
+ */
+ $actions = apply_filters( 'theme_install_actions', $actions, $theme );
+
+ ?>
+ <a class="screenshot install-theme-preview" href="<?php echo esc_url( $preview_url ); ?>" title="<?php echo esc_attr( $preview_title ); ?>">
+ <img src="<?php echo esc_url( $theme->screenshot_url ); ?>" width="150" alt="" />
+ </a>
+
+ <h3><?php echo $name; ?></h3>
+ <div class="theme-author">
+ <?php
+ /* translators: %s: theme author */
+ printf( __( 'By %s' ), $author );
+ ?>
+ </div>
+
+ <div class="action-links">
+ <ul>
+ <?php foreach ( $actions as $action ) : ?>
+ <li><?php echo $action; ?></li>
+ <?php endforeach; ?>
+ <li class="hide-if-no-js"><a href="#" class="theme-detail"><?php _e( 'Details' ); ?></a></li>
+ </ul>
+ </div>
+
+ <?php
+ $this->install_theme_info( $theme );
+ }
+
+ /**
+ * Prints the wrapper for the theme installer.
+ */
+ public function theme_installer() {
+ ?>
+ <div id="theme-installer" class="wp-full-overlay expanded">
+ <div class="wp-full-overlay-sidebar">
+ <div class="wp-full-overlay-header">
+ <a href="#" class="close-full-overlay button"><?php _e( 'Close' ); ?></a>
+ <span class="theme-install"></span>
+ </div>
+ <div class="wp-full-overlay-sidebar-content">
+ <div class="install-theme-info"></div>
+ </div>
+ <div class="wp-full-overlay-footer">
+ <button type="button" class="collapse-sidebar button" aria-expanded="true" aria-label="<?php esc_attr_e( 'Collapse Sidebar' ); ?>">
+ <span class="collapse-sidebar-arrow"></span>
+ <span class="collapse-sidebar-label"><?php _e( 'Collapse' ); ?></span>
+ </button>
+ </div>
+ </div>
+ <div class="wp-full-overlay-main"></div>
+ </div>
+ <?php
+ }
+
+ /**
+ * Prints the wrapper for the theme installer with a provided theme's data.
+ * Used to make the theme installer work for no-js.
+ *
+ * @param object $theme - A WordPress.org Theme API object.
+ */
+ public function theme_installer_single( $theme ) {
+ ?>
+ <div id="theme-installer" class="wp-full-overlay single-theme">
+ <div class="wp-full-overlay-sidebar">
+ <?php $this->install_theme_info( $theme ); ?>
+ </div>
+ <div class="wp-full-overlay-main">
+ <iframe src="<?php echo esc_url( $theme->preview_url ); ?>"></iframe>
+ </div>
+ </div>
+ <?php
+ }
+
+ /**
+ * Prints the info for a theme (to be used in the theme installer modal).
+ *
+ * @global array $themes_allowedtags
+ *
+ * @param object $theme - A WordPress.org Theme API object.
+ */
+ public function install_theme_info( $theme ) {
+ global $themes_allowedtags;
+
+ if ( empty( $theme ) ) {
+ return;
+ }
+
+ $name = wp_kses( $theme->name, $themes_allowedtags );
+ $author = wp_kses( $theme->author, $themes_allowedtags );
+
+ $install_url = add_query_arg(
+ array(
+ 'action' => 'install-theme',
+ 'theme' => $theme->slug,
+ ),
+ self_admin_url( 'update.php' )
+ );
+
+ $update_url = add_query_arg(
+ array(
+ 'action' => 'upgrade-theme',
+ 'theme' => $theme->slug,
+ ),
+ self_admin_url( 'update.php' )
+ );
+
+ $status = $this->_get_theme_status( $theme );
+
+ ?>
+ <div class="install-theme-info">
+ <?php
+ switch ( $status ) {
+ case 'update_available':
+ printf(
+ '<a class="theme-install button button-primary" href="%s" title="%s">%s</a>',
+ esc_url( wp_nonce_url( $update_url, 'upgrade-theme_' . $theme->slug ) ),
+ /* translators: %s: theme version */
+ esc_attr( sprintf( __( 'Update to version %s' ), $theme->version ) ),
+ __( 'Update' )
+ );
+ break;
+ case 'newer_installed':
+ case 'latest_installed':
+ printf(
+ '<span class="theme-install" title="%s">%s</span>',
+ esc_attr__( 'This theme is already installed and is up to date' ),
+ _x( 'Installed', 'theme' )
+ );
+ break;
+ case 'install':
+ default:
+ printf(
+ '<a class="theme-install button button-primary" href="%s">%s</a>',
+ esc_url( wp_nonce_url( $install_url, 'install-theme_' . $theme->slug ) ),
+ __( 'Install' )
+ );
+ break;
+ }
+ ?>
+ <h3 class="theme-name"><?php echo $name; ?></h3>
+ <span class="theme-by">
+ <?php
+ /* translators: %s: theme author */
+ printf( __( 'By %s' ), $author );
+ ?>
+ </span>
+ <?php if ( isset( $theme->screenshot_url ) ) : ?>
+ <img class="theme-screenshot" src="<?php echo esc_url( $theme->screenshot_url ); ?>" alt="" />
+ <?php endif; ?>
+ <div class="theme-details">
+ <?php
+ wp_star_rating(
+ array(
+ 'rating' => $theme->rating,
+ 'type' => 'percent',
+ 'number' => $theme->num_ratings,
+ )
+ );
+ ?>
+ <div class="theme-version">
+ <strong><?php _e( 'Version:' ); ?> </strong>
+ <?php echo wp_kses( $theme->version, $themes_allowedtags ); ?>
+ </div>
+ <div class="theme-description">
+ <?php echo wp_kses( $theme->description, $themes_allowedtags ); ?>
+ </div>
+ </div>
+ <input class="theme-preview-url" type="hidden" value="<?php echo esc_url( $theme->preview_url ); ?>" />
+ </div>
+ <?php
+ }
+
+ /**
+ * Send required variables to JavaScript land
+ *
+ * @since 3.4.0
+ *
+ * @global string $tab Current tab within Themes->Install screen
+ * @global string $type Type of search.
+ *
+ * @param array $extra_args Unused.
+ */
+ public function _js_vars( $extra_args = array() ) {
+ global $tab, $type;
+ parent::_js_vars( compact( 'tab', 'type' ) );
+ }
+
+ /**
+ * Check to see if the theme is already installed.
+ *
+ * @since 3.4.0
+ *
+ * @param object $theme - A WordPress.org Theme API object.
+ * @return string Theme status.
+ */
+ private function _get_theme_status( $theme ) {
+ $status = 'install';
+
+ $installed_theme = wp_get_theme( $theme->slug );
+ if ( $installed_theme->exists() ) {
+ if ( version_compare( $installed_theme->get( 'Version' ), $theme->version, '=' ) ) {
+ $status = 'latest_installed';
+ } elseif ( version_compare( $installed_theme->get( 'Version' ), $theme->version, '>' ) ) {
+ $status = 'newer_installed';
+ } else {
+ $status = 'update_available';
+ }
+ }
+
+ return $status;
+ }
+}
diff --git a/www/crm/wp-admin/includes/class-wp-themes-list-table.php b/www/crm/wp-admin/includes/class-wp-themes-list-table.php
new file mode 100644
index 00000000..d040b7d2
--- /dev/null
+++ b/www/crm/wp-admin/includes/class-wp-themes-list-table.php
@@ -0,0 +1,321 @@
+<?php
+/**
+ * List Table API: WP_Themes_List_Table class
+ *
+ * @package WordPress
+ * @subpackage Administration
+ * @since 3.1.0
+ */
+
+/**
+ * Core class used to implement displaying installed themes in a list table.
+ *
+ * @since 3.1.0
+ * @access private
+ *
+ * @see WP_List_Table
+ */
+class WP_Themes_List_Table extends WP_List_Table {
+
+ protected $search_terms = array();
+ public $features = array();
+
+ /**
+ * Constructor.
+ *
+ * @since 3.1.0
+ *
+ * @see WP_List_Table::__construct() for more information on default arguments.
+ *
+ * @param array $args An associative array of arguments.
+ */
+ public function __construct( $args = array() ) {
+ parent::__construct(
+ array(
+ 'ajax' => true,
+ 'screen' => isset( $args['screen'] ) ? $args['screen'] : null,
+ )
+ );
+ }
+
+ /**
+ * @return bool
+ */
+ public function ajax_user_can() {
+ // Do not check edit_theme_options here. Ajax calls for available themes require switch_themes.
+ return current_user_can( 'switch_themes' );
+ }
+
+ /**
+ */
+ public function prepare_items() {
+ $themes = wp_get_themes( array( 'allowed' => true ) );
+
+ if ( ! empty( $_REQUEST['s'] ) ) {
+ $this->search_terms = array_unique( array_filter( array_map( 'trim', explode( ',', strtolower( wp_unslash( $_REQUEST['s'] ) ) ) ) ) );
+ }
+
+ if ( ! empty( $_REQUEST['features'] ) ) {
+ $this->features = $_REQUEST['features'];
+ }
+
+ if ( $this->search_terms || $this->features ) {
+ foreach ( $themes as $key => $theme ) {
+ if ( ! $this->search_theme( $theme ) ) {
+ unset( $themes[ $key ] );
+ }
+ }
+ }
+
+ unset( $themes[ get_option( 'stylesheet' ) ] );
+ WP_Theme::sort_by_name( $themes );
+
+ $per_page = 36;
+ $page = $this->get_pagenum();
+
+ $start = ( $page - 1 ) * $per_page;
+
+ $this->items = array_slice( $themes, $start, $per_page, true );
+
+ $this->set_pagination_args(
+ array(
+ 'total_items' => count( $themes ),
+ 'per_page' => $per_page,
+ 'infinite_scroll' => true,
+ )
+ );
+ }
+
+ /**
+ */
+ public function no_items() {
+ if ( $this->search_terms || $this->features ) {
+ _e( 'No items found.' );
+ return;
+ }
+
+ $blog_id = get_current_blog_id();
+ if ( is_multisite() ) {
+ if ( current_user_can( 'install_themes' ) && current_user_can( 'manage_network_themes' ) ) {
+ printf( __( 'You only have one theme enabled for this site right now. Visit the Network Admin to <a href="%1$s">enable</a> or <a href="%2$s">install</a> more themes.' ), network_admin_url( 'site-themes.php?id=' . $blog_id ), network_admin_url( 'theme-install.php' ) );
+
+ return;
+ } elseif ( current_user_can( 'manage_network_themes' ) ) {
+ printf( __( 'You only have one theme enabled for this site right now. Visit the Network Admin to <a href="%1$s">enable</a> more themes.' ), network_admin_url( 'site-themes.php?id=' . $blog_id ) );
+
+ return;
+ }
+ // Else, fallthrough. install_themes doesn't help if you can't enable it.
+ } else {
+ if ( current_user_can( 'install_themes' ) ) {
+ printf( __( 'You only have one theme installed right now. Live a little! You can choose from over 1,000 free themes in the WordPress Theme Directory at any time: just click on the <a href="%s">Install Themes</a> tab above.' ), admin_url( 'theme-install.php' ) );
+
+ return;
+ }
+ }
+ // Fallthrough.
+ printf( __( 'Only the current theme is available to you. Contact the %s administrator for information about accessing additional themes.' ), get_site_option( 'site_name' ) );
+ }
+
+ /**
+ * @param string $which
+ */
+ public function tablenav( $which = 'top' ) {
+ if ( $this->get_pagination_arg( 'total_pages' ) <= 1 ) {
+ return;
+ }
+ ?>
+ <div class="tablenav themes <?php echo $which; ?>">
+ <?php $this->pagination( $which ); ?>
+ <span class="spinner"></span>
+ <br class="clear" />
+ </div>
+ <?php
+ }
+
+ /**
+ */
+ public function display() {
+ wp_nonce_field( 'fetch-list-' . get_class( $this ), '_ajax_fetch_list_nonce' );
+ ?>
+ <?php $this->tablenav( 'top' ); ?>
+
+ <div id="availablethemes">
+ <?php $this->display_rows_or_placeholder(); ?>
+ </div>
+
+ <?php $this->tablenav( 'bottom' ); ?>
+ <?php
+ }
+
+ /**
+ * @return array
+ */
+ public function get_columns() {
+ return array();
+ }
+
+ /**
+ */
+ public function display_rows_or_placeholder() {
+ if ( $this->has_items() ) {
+ $this->display_rows();
+ } else {
+ echo '<div class="no-items">';
+ $this->no_items();
+ echo '</div>';
+ }
+ }
+
+ /**
+ */
+ public function display_rows() {
+ $themes = $this->items;
+
+ foreach ( $themes as $theme ) :
+ ?>
+ <div class="available-theme">
+ <?php
+
+ $template = $theme->get_template();
+ $stylesheet = $theme->get_stylesheet();
+ $title = $theme->display( 'Name' );
+ $version = $theme->display( 'Version' );
+ $author = $theme->display( 'Author' );
+
+ $activate_link = wp_nonce_url( 'themes.php?action=activate&amp;template=' . urlencode( $template ) . '&amp;stylesheet=' . urlencode( $stylesheet ), 'switch-theme_' . $stylesheet );
+
+ $actions = array();
+ $actions['activate'] = '<a href="' . $activate_link . '" class="activatelink" title="'
+ . esc_attr( sprintf( __( 'Activate &#8220;%s&#8221;' ), $title ) ) . '">' . __( 'Activate' ) . '</a>';
+
+ if ( current_user_can( 'edit_theme_options' ) && current_user_can( 'customize' ) ) {
+ $actions['preview'] .= '<a href="' . wp_customize_url( $stylesheet ) . '" class="load-customize hide-if-no-customize">'
+ . __( 'Live Preview' ) . '</a>';
+ }
+
+ if ( ! is_multisite() && current_user_can( 'delete_themes' ) ) {
+ $actions['delete'] = '<a class="submitdelete deletion" href="' . wp_nonce_url( 'themes.php?action=delete&amp;stylesheet=' . urlencode( $stylesheet ), 'delete-theme_' . $stylesheet )
+ . '" onclick="' . "return confirm( '" . esc_js( sprintf( __( "You are about to delete this theme '%s'\n 'Cancel' to stop, 'OK' to delete." ), $title ) )
+ . "' );" . '">' . __( 'Delete' ) . '</a>';
+ }
+
+ /** This filter is documented in wp-admin/includes/class-wp-ms-themes-list-table.php */
+ $actions = apply_filters( 'theme_action_links', $actions, $theme, 'all' );
+
+ /** This filter is documented in wp-admin/includes/class-wp-ms-themes-list-table.php */
+ $actions = apply_filters( "theme_action_links_$stylesheet", $actions, $theme, 'all' );
+ $delete_action = isset( $actions['delete'] ) ? '<div class="delete-theme">' . $actions['delete'] . '</div>' : '';
+ unset( $actions['delete'] );
+
+ ?>
+
+ <span class="screenshot hide-if-customize">
+ <?php if ( $screenshot = $theme->get_screenshot() ) : ?>
+ <img src="<?php echo esc_url( $screenshot ); ?>" alt="" />
+ <?php endif; ?>
+ </span>
+ <a href="<?php echo wp_customize_url( $stylesheet ); ?>" class="screenshot load-customize hide-if-no-customize">
+ <?php if ( $screenshot = $theme->get_screenshot() ) : ?>
+ <img src="<?php echo esc_url( $screenshot ); ?>" alt="" />
+ <?php endif; ?>
+ </a>
+
+ <h3><?php echo $title; ?></h3>
+ <div class="theme-author"><?php printf( __( 'By %s' ), $author ); ?></div>
+ <div class="action-links">
+ <ul>
+ <?php foreach ( $actions as $action ) : ?>
+ <li><?php echo $action; ?></li>
+ <?php endforeach; ?>
+ <li class="hide-if-no-js"><a href="#" class="theme-detail"><?php _e( 'Details' ); ?></a></li>
+ </ul>
+ <?php echo $delete_action; ?>
+
+ <?php theme_update_available( $theme ); ?>
+ </div>
+
+ <div class="themedetaildiv hide-if-js">
+ <p><strong><?php _e( 'Version:' ); ?></strong> <?php echo $version; ?></p>
+ <p><?php echo $theme->display( 'Description' ); ?></p>
+ <?php
+ if ( $theme->parent() ) {
+ printf(
+ /* translators: %s: link to documentation on child themes */
+ ' <p class="howto">' . __( 'This <a href="%1$s">child theme</a> requires its parent theme, %2$s.' ) . '</p>',
+ __( 'https://developer.wordpress.org/themes/advanced-topics/child-themes/' ),
+ $theme->parent()->display( 'Name' )
+ );
+ }
+ ?>
+ </div>
+
+ </div>
+ <?php
+ endforeach;
+ }
+
+ /**
+ * @param WP_Theme $theme
+ * @return bool
+ */
+ public function search_theme( $theme ) {
+ // Search the features
+ foreach ( $this->features as $word ) {
+ if ( ! in_array( $word, $theme->get( 'Tags' ) ) ) {
+ return false;
+ }
+ }
+
+ // Match all phrases
+ foreach ( $this->search_terms as $word ) {
+ if ( in_array( $word, $theme->get( 'Tags' ) ) ) {
+ continue;
+ }
+
+ foreach ( array( 'Name', 'Description', 'Author', 'AuthorURI' ) as $header ) {
+ // Don't mark up; Do translate.
+ if ( false !== stripos( strip_tags( $theme->display( $header, false, true ) ), $word ) ) {
+ continue 2;
+ }
+ }
+
+ if ( false !== stripos( $theme->get_stylesheet(), $word ) ) {
+ continue;
+ }
+
+ if ( false !== stripos( $theme->get_template(), $word ) ) {
+ continue;
+ }
+
+ return false;
+ }
+
+ return true;
+ }
+
+ /**
+ * Send required variables to JavaScript land
+ *
+ * @since 3.4.0
+ *
+ * @param array $extra_args
+ */
+ public function _js_vars( $extra_args = array() ) {
+ $search_string = isset( $_REQUEST['s'] ) ? esc_attr( wp_unslash( $_REQUEST['s'] ) ) : '';
+
+ $args = array(
+ 'search' => $search_string,
+ 'features' => $this->features,
+ 'paged' => $this->get_pagenum(),
+ 'total_pages' => ! empty( $this->_pagination_args['total_pages'] ) ? $this->_pagination_args['total_pages'] : 1,
+ );
+
+ if ( is_array( $extra_args ) ) {
+ $args = array_merge( $args, $extra_args );
+ }
+
+ printf( "<script type='text/javascript'>var theme_list_args = %s;</script>\n", wp_json_encode( $args ) );
+ parent::_js_vars();
+ }
+}
diff --git a/www/crm/wp-admin/includes/class-wp-upgrader-skin.php b/www/crm/wp-admin/includes/class-wp-upgrader-skin.php
new file mode 100644
index 00000000..ddcfd19f
--- /dev/null
+++ b/www/crm/wp-admin/includes/class-wp-upgrader-skin.php
@@ -0,0 +1,209 @@
+<?php
+/**
+ * Upgrader API: WP_Upgrader_Skin class
+ *
+ * @package WordPress
+ * @subpackage Upgrader
+ * @since 4.6.0
+ */
+
+/**
+ * Generic Skin for the WordPress Upgrader classes. This skin is designed to be extended for specific purposes.
+ *
+ * @since 2.8.0
+ * @since 4.6.0 Moved to its own file from wp-admin/includes/class-wp-upgrader-skins.php.
+ */
+class WP_Upgrader_Skin {
+
+ public $upgrader;
+ public $done_header = false;
+ public $done_footer = false;
+
+ /**
+ * Holds the result of an upgrade.
+ *
+ * @since 2.8.0
+ * @var string|bool|WP_Error
+ */
+ public $result = false;
+ public $options = array();
+
+ /**
+ * @param array $args
+ */
+ public function __construct( $args = array() ) {
+ $defaults = array(
+ 'url' => '',
+ 'nonce' => '',
+ 'title' => '',
+ 'context' => false,
+ );
+ $this->options = wp_parse_args( $args, $defaults );
+ }
+
+ /**
+ * @param WP_Upgrader $upgrader
+ */
+ public function set_upgrader( &$upgrader ) {
+ if ( is_object( $upgrader ) ) {
+ $this->upgrader =& $upgrader;
+ }
+ $this->add_strings();
+ }
+
+ /**
+ */
+ public function add_strings() {
+ }
+
+ /**
+ * Sets the result of an upgrade.
+ *
+ * @since 2.8.0
+ *
+ * @param string|bool|WP_Error $result The result of an upgrade.
+ */
+ public function set_result( $result ) {
+ $this->result = $result;
+ }
+
+ /**
+ * Displays a form to the user to request for their FTP/SSH details in order
+ * to connect to the filesystem.
+ *
+ * @since 2.8.0
+ * @since 4.6.0 The `$context` parameter default changed from `false` to an empty string.
+ *
+ * @see request_filesystem_credentials()
+ *
+ * @param bool $error Optional. Whether the current request has failed to connect.
+ * Default false.
+ * @param string $context Optional. Full path to the directory that is tested
+ * for being writable. Default empty.
+ * @param bool $allow_relaxed_file_ownership Optional. Whether to allow Group/World writable. Default false.
+ * @return bool False on failure, true on success.
+ */
+ public function request_filesystem_credentials( $error = false, $context = '', $allow_relaxed_file_ownership = false ) {
+ $url = $this->options['url'];
+ if ( ! $context ) {
+ $context = $this->options['context'];
+ }
+ if ( ! empty( $this->options['nonce'] ) ) {
+ $url = wp_nonce_url( $url, $this->options['nonce'] );
+ }
+
+ $extra_fields = array();
+
+ return request_filesystem_credentials( $url, '', $error, $context, $extra_fields, $allow_relaxed_file_ownership );
+ }
+
+ /**
+ */
+ public function header() {
+ if ( $this->done_header ) {
+ return;
+ }
+ $this->done_header = true;
+ echo '<div class="wrap">';
+ echo '<h1>' . $this->options['title'] . '</h1>';
+ }
+
+ /**
+ */
+ public function footer() {
+ if ( $this->done_footer ) {
+ return;
+ }
+ $this->done_footer = true;
+ echo '</div>';
+ }
+
+ /**
+ * @param string|WP_Error $errors
+ */
+ public function error( $errors ) {
+ if ( ! $this->done_header ) {
+ $this->header();
+ }
+ if ( is_string( $errors ) ) {
+ $this->feedback( $errors );
+ } elseif ( is_wp_error( $errors ) && $errors->has_errors() ) {
+ foreach ( $errors->get_error_messages() as $message ) {
+ if ( $errors->get_error_data() && is_string( $errors->get_error_data() ) ) {
+ $this->feedback( $message . ' ' . esc_html( strip_tags( $errors->get_error_data() ) ) );
+ } else {
+ $this->feedback( $message );
+ }
+ }
+ }
+ }
+
+ /**
+ * @param string $string
+ */
+ public function feedback( $string ) {
+ if ( isset( $this->upgrader->strings[ $string ] ) ) {
+ $string = $this->upgrader->strings[ $string ];
+ }
+
+ if ( strpos( $string, '%' ) !== false ) {
+ $args = func_get_args();
+ $args = array_splice( $args, 1 );
+ if ( $args ) {
+ $args = array_map( 'strip_tags', $args );
+ $args = array_map( 'esc_html', $args );
+ $string = vsprintf( $string, $args );
+ }
+ }
+ if ( empty( $string ) ) {
+ return;
+ }
+ show_message( $string );
+ }
+
+ /**
+ */
+ public function before() {}
+
+ /**
+ */
+ public function after() {}
+
+ /**
+ * Output JavaScript that calls function to decrement the update counts.
+ *
+ * @since 3.9.0
+ *
+ * @param string $type Type of update count to decrement. Likely values include 'plugin',
+ * 'theme', 'translation', etc.
+ */
+ protected function decrement_update_count( $type ) {
+ if ( ! $this->result || is_wp_error( $this->result ) || 'up_to_date' === $this->result ) {
+ return;
+ }
+
+ if ( defined( 'IFRAME_REQUEST' ) ) {
+ echo '<script type="text/javascript">
+ if ( window.postMessage && JSON ) {
+ window.parent.postMessage( JSON.stringify( { action: "decrementUpdateCount", upgradeType: "' . $type . '" } ), window.location.protocol + "//" + window.location.hostname );
+ }
+ </script>';
+ } else {
+ echo '<script type="text/javascript">
+ (function( wp ) {
+ if ( wp && wp.updates && wp.updates.decrementCount ) {
+ wp.updates.decrementCount( "' . $type . '" );
+ }
+ })( window.wp );
+ </script>';
+ }
+ }
+
+ /**
+ */
+ public function bulk_header() {}
+
+ /**
+ */
+ public function bulk_footer() {}
+}
diff --git a/www/crm/wp-admin/includes/class-wp-upgrader-skins.php b/www/crm/wp-admin/includes/class-wp-upgrader-skins.php
new file mode 100644
index 00000000..183a0119
--- /dev/null
+++ b/www/crm/wp-admin/includes/class-wp-upgrader-skins.php
@@ -0,0 +1,43 @@
+<?php
+/**
+ * The User Interface "Skins" for the WordPress File Upgrader
+ *
+ * @package WordPress
+ * @subpackage Upgrader
+ * @since 2.8.0
+ */
+
+_deprecated_file( basename( __FILE__ ), '4.7.0', 'class-wp-upgrader.php' );
+
+/** WP_Upgrader_Skin class */
+require_once ABSPATH . 'wp-admin/includes/class-wp-upgrader-skin.php';
+
+/** Plugin_Upgrader_Skin class */
+require_once ABSPATH . 'wp-admin/includes/class-plugin-upgrader-skin.php';
+
+/** Theme_Upgrader_Skin class */
+require_once ABSPATH . 'wp-admin/includes/class-theme-upgrader-skin.php';
+
+/** Bulk_Upgrader_Skin class */
+require_once ABSPATH . 'wp-admin/includes/class-bulk-upgrader-skin.php';
+
+/** Bulk_Plugin_Upgrader_Skin class */
+require_once ABSPATH . 'wp-admin/includes/class-bulk-plugin-upgrader-skin.php';
+
+/** Bulk_Theme_Upgrader_Skin class */
+require_once ABSPATH . 'wp-admin/includes/class-bulk-theme-upgrader-skin.php';
+
+/** Plugin_Installer_Skin class */
+require_once ABSPATH . 'wp-admin/includes/class-plugin-installer-skin.php';
+
+/** Theme_Installer_Skin class */
+require_once ABSPATH . 'wp-admin/includes/class-theme-installer-skin.php';
+
+/** Language_Pack_Upgrader_Skin class */
+require_once ABSPATH . 'wp-admin/includes/class-language-pack-upgrader-skin.php';
+
+/** Automatic_Upgrader_Skin class */
+require_once ABSPATH . 'wp-admin/includes/class-automatic-upgrader-skin.php';
+
+/** WP_Ajax_Upgrader_Skin class */
+require_once ABSPATH . 'wp-admin/includes/class-wp-ajax-upgrader-skin.php';
diff --git a/www/crm/wp-admin/includes/class-wp-upgrader.php b/www/crm/wp-admin/includes/class-wp-upgrader.php
new file mode 100644
index 00000000..b8258d4b
--- /dev/null
+++ b/www/crm/wp-admin/includes/class-wp-upgrader.php
@@ -0,0 +1,946 @@
+<?php
+/**
+ * Upgrade API: WP_Upgrader class
+ *
+ * Requires skin classes and WP_Upgrader subclasses for backward compatibility.
+ *
+ * @package WordPress
+ * @subpackage Upgrader
+ * @since 2.8.0
+ */
+
+/** WP_Upgrader_Skin class */
+require_once ABSPATH . 'wp-admin/includes/class-wp-upgrader-skin.php';
+
+/** Plugin_Upgrader_Skin class */
+require_once ABSPATH . 'wp-admin/includes/class-plugin-upgrader-skin.php';
+
+/** Theme_Upgrader_Skin class */
+require_once ABSPATH . 'wp-admin/includes/class-theme-upgrader-skin.php';
+
+/** Bulk_Upgrader_Skin class */
+require_once ABSPATH . 'wp-admin/includes/class-bulk-upgrader-skin.php';
+
+/** Bulk_Plugin_Upgrader_Skin class */
+require_once ABSPATH . 'wp-admin/includes/class-bulk-plugin-upgrader-skin.php';
+
+/** Bulk_Theme_Upgrader_Skin class */
+require_once ABSPATH . 'wp-admin/includes/class-bulk-theme-upgrader-skin.php';
+
+/** Plugin_Installer_Skin class */
+require_once ABSPATH . 'wp-admin/includes/class-plugin-installer-skin.php';
+
+/** Theme_Installer_Skin class */
+require_once ABSPATH . 'wp-admin/includes/class-theme-installer-skin.php';
+
+/** Language_Pack_Upgrader_Skin class */
+require_once ABSPATH . 'wp-admin/includes/class-language-pack-upgrader-skin.php';
+
+/** Automatic_Upgrader_Skin class */
+require_once ABSPATH . 'wp-admin/includes/class-automatic-upgrader-skin.php';
+
+/** WP_Ajax_Upgrader_Skin class */
+require_once ABSPATH . 'wp-admin/includes/class-wp-ajax-upgrader-skin.php';
+
+/**
+ * Core class used for upgrading/installing a local set of files via
+ * the Filesystem Abstraction classes from a Zip file.
+ *
+ * @since 2.8.0
+ */
+class WP_Upgrader {
+
+ /**
+ * The error/notification strings used to update the user on the progress.
+ *
+ * @since 2.8.0
+ * @var array $strings
+ */
+ public $strings = array();
+
+ /**
+ * The upgrader skin being used.
+ *
+ * @since 2.8.0
+ * @var Automatic_Upgrader_Skin|WP_Upgrader_Skin $skin
+ */
+ public $skin = null;
+
+ /**
+ * The result of the installation.
+ *
+ * This is set by WP_Upgrader::install_package(), only when the package is installed
+ * successfully. It will then be an array, unless a WP_Error is returned by the
+ * {@see 'upgrader_post_install'} filter. In that case, the WP_Error will be assigned to
+ * it.
+ *
+ * @since 2.8.0
+ *
+ * @var WP_Error|array $result {
+ * @type string $source The full path to the source the files were installed from.
+ * @type string $source_files List of all the files in the source directory.
+ * @type string $destination The full path to the installation destination folder.
+ * @type string $destination_name The name of the destination folder, or empty if `$destination`
+ * and `$local_destination` are the same.
+ * @type string $local_destination The full local path to the destination folder. This is usually
+ * the same as `$destination`.
+ * @type string $remote_destination The full remote path to the destination folder
+ * (i.e., from `$wp_filesystem`).
+ * @type bool $clear_destination Whether the destination folder was cleared.
+ * }
+ */
+ public $result = array();
+
+ /**
+ * The total number of updates being performed.
+ *
+ * Set by the bulk update methods.
+ *
+ * @since 3.0.0
+ * @var int $update_count
+ */
+ public $update_count = 0;
+
+ /**
+ * The current update if multiple updates are being performed.
+ *
+ * Used by the bulk update methods, and incremented for each update.
+ *
+ * @since 3.0.0
+ * @var int
+ */
+ public $update_current = 0;
+
+ /**
+ * Construct the upgrader with a skin.
+ *
+ * @since 2.8.0
+ *
+ * @param WP_Upgrader_Skin $skin The upgrader skin to use. Default is a WP_Upgrader_Skin.
+ * instance.
+ */
+ public function __construct( $skin = null ) {
+ if ( null == $skin ) {
+ $this->skin = new WP_Upgrader_Skin();
+ } else {
+ $this->skin = $skin;
+ }
+ }
+
+ /**
+ * Initialize the upgrader.
+ *
+ * This will set the relationship between the skin being used and this upgrader,
+ * and also add the generic strings to `WP_Upgrader::$strings`.
+ *
+ * @since 2.8.0
+ */
+ public function init() {
+ $this->skin->set_upgrader( $this );
+ $this->generic_strings();
+ }
+
+ /**
+ * Add the generic strings to WP_Upgrader::$strings.
+ *
+ * @since 2.8.0
+ */
+ public function generic_strings() {
+ $this->strings['bad_request'] = __( 'Invalid data provided.' );
+ $this->strings['fs_unavailable'] = __( 'Could not access filesystem.' );
+ $this->strings['fs_error'] = __( 'Filesystem error.' );
+ $this->strings['fs_no_root_dir'] = __( 'Unable to locate WordPress root directory.' );
+ $this->strings['fs_no_content_dir'] = __( 'Unable to locate WordPress content directory (wp-content).' );
+ $this->strings['fs_no_plugins_dir'] = __( 'Unable to locate WordPress plugin directory.' );
+ $this->strings['fs_no_themes_dir'] = __( 'Unable to locate WordPress theme directory.' );
+ /* translators: %s: directory name */
+ $this->strings['fs_no_folder'] = __( 'Unable to locate needed folder (%s).' );
+
+ $this->strings['download_failed'] = __( 'Download failed.' );
+ $this->strings['installing_package'] = __( 'Installing the latest version&#8230;' );
+ $this->strings['no_files'] = __( 'The package contains no files.' );
+ $this->strings['folder_exists'] = __( 'Destination folder already exists.' );
+ $this->strings['mkdir_failed'] = __( 'Could not create directory.' );
+ $this->strings['incompatible_archive'] = __( 'The package could not be installed.' );
+ $this->strings['files_not_writable'] = __( 'The update cannot be installed because we will be unable to copy some files. This is usually due to inconsistent file permissions.' );
+
+ $this->strings['maintenance_start'] = __( 'Enabling Maintenance mode&#8230;' );
+ $this->strings['maintenance_end'] = __( 'Disabling Maintenance mode&#8230;' );
+ }
+
+ /**
+ * Connect to the filesystem.
+ *
+ * @since 2.8.0
+ *
+ * @global WP_Filesystem_Base $wp_filesystem WordPress filesystem subclass.
+ *
+ * @param array $directories Optional. A list of directories. If any of these do
+ * not exist, a WP_Error object will be returned.
+ * Default empty array.
+ * @param bool $allow_relaxed_file_ownership Whether to allow relaxed file ownership.
+ * Default false.
+ * @return bool|WP_Error True if able to connect, false or a WP_Error otherwise.
+ */
+ public function fs_connect( $directories = array(), $allow_relaxed_file_ownership = false ) {
+ global $wp_filesystem;
+
+ if ( false === ( $credentials = $this->skin->request_filesystem_credentials( false, $directories[0], $allow_relaxed_file_ownership ) ) ) {
+ return false;
+ }
+
+ if ( ! WP_Filesystem( $credentials, $directories[0], $allow_relaxed_file_ownership ) ) {
+ $error = true;
+ if ( is_object( $wp_filesystem ) && $wp_filesystem->errors->has_errors() ) {
+ $error = $wp_filesystem->errors;
+ }
+ // Failed to connect, Error and request again
+ $this->skin->request_filesystem_credentials( $error, $directories[0], $allow_relaxed_file_ownership );
+ return false;
+ }
+
+ if ( ! is_object( $wp_filesystem ) ) {
+ return new WP_Error( 'fs_unavailable', $this->strings['fs_unavailable'] );
+ }
+
+ if ( is_wp_error( $wp_filesystem->errors ) && $wp_filesystem->errors->has_errors() ) {
+ return new WP_Error( 'fs_error', $this->strings['fs_error'], $wp_filesystem->errors );
+ }
+
+ foreach ( (array) $directories as $dir ) {
+ switch ( $dir ) {
+ case ABSPATH:
+ if ( ! $wp_filesystem->abspath() ) {
+ return new WP_Error( 'fs_no_root_dir', $this->strings['fs_no_root_dir'] );
+ }
+ break;
+ case WP_CONTENT_DIR:
+ if ( ! $wp_filesystem->wp_content_dir() ) {
+ return new WP_Error( 'fs_no_content_dir', $this->strings['fs_no_content_dir'] );
+ }
+ break;
+ case WP_PLUGIN_DIR:
+ if ( ! $wp_filesystem->wp_plugins_dir() ) {
+ return new WP_Error( 'fs_no_plugins_dir', $this->strings['fs_no_plugins_dir'] );
+ }
+ break;
+ case get_theme_root():
+ if ( ! $wp_filesystem->wp_themes_dir() ) {
+ return new WP_Error( 'fs_no_themes_dir', $this->strings['fs_no_themes_dir'] );
+ }
+ break;
+ default:
+ if ( ! $wp_filesystem->find_folder( $dir ) ) {
+ return new WP_Error( 'fs_no_folder', sprintf( $this->strings['fs_no_folder'], esc_html( basename( $dir ) ) ) );
+ }
+ break;
+ }
+ }
+ return true;
+ } //end fs_connect();
+
+ /**
+ * Download a package.
+ *
+ * @since 2.8.0
+ *
+ * @param string $package The URI of the package. If this is the full path to an
+ * existing local file, it will be returned untouched.
+ * @param bool $check_signatures Whether to validate file signatures. Default false.
+ * @return string|WP_Error The full path to the downloaded package file, or a WP_Error object.
+ */
+ public function download_package( $package, $check_signatures = false ) {
+
+ /**
+ * Filters whether to return the package.
+ *
+ * @since 3.7.0
+ *
+ * @param bool $reply Whether to bail without returning the package.
+ * Default false.
+ * @param string $package The package file name.
+ * @param WP_Upgrader $this The WP_Upgrader instance.
+ */
+ $reply = apply_filters( 'upgrader_pre_download', false, $package, $this );
+ if ( false !== $reply ) {
+ return $reply;
+ }
+
+ if ( ! preg_match( '!^(http|https|ftp)://!i', $package ) && file_exists( $package ) ) { //Local file or remote?
+ return $package; //must be a local file..
+ }
+
+ if ( empty( $package ) ) {
+ return new WP_Error( 'no_package', $this->strings['no_package'] );
+ }
+
+ $this->skin->feedback( 'downloading_package', $package );
+
+ $download_file = download_url( $package, 300, $check_signatures );
+
+ if ( is_wp_error( $download_file ) && ! $download_file->get_error_data( 'softfail-filename' ) ) {
+ return new WP_Error( 'download_failed', $this->strings['download_failed'], $download_file->get_error_message() );
+ }
+
+ return $download_file;
+ }
+
+ /**
+ * Unpack a compressed package file.
+ *
+ * @since 2.8.0
+ *
+ * @global WP_Filesystem_Base $wp_filesystem WordPress filesystem subclass.
+ *
+ * @param string $package Full path to the package file.
+ * @param bool $delete_package Optional. Whether to delete the package file after attempting
+ * to unpack it. Default true.
+ * @return string|WP_Error The path to the unpacked contents, or a WP_Error on failure.
+ */
+ public function unpack_package( $package, $delete_package = true ) {
+ global $wp_filesystem;
+
+ $this->skin->feedback( 'unpack_package' );
+
+ $upgrade_folder = $wp_filesystem->wp_content_dir() . 'upgrade/';
+
+ //Clean up contents of upgrade directory beforehand.
+ $upgrade_files = $wp_filesystem->dirlist( $upgrade_folder );
+ if ( ! empty( $upgrade_files ) ) {
+ foreach ( $upgrade_files as $file ) {
+ $wp_filesystem->delete( $upgrade_folder . $file['name'], true );
+ }
+ }
+
+ // We need a working directory - Strip off any .tmp or .zip suffixes
+ $working_dir = $upgrade_folder . basename( basename( $package, '.tmp' ), '.zip' );
+
+ // Clean up working directory
+ if ( $wp_filesystem->is_dir( $working_dir ) ) {
+ $wp_filesystem->delete( $working_dir, true );
+ }
+
+ // Unzip package to working directory
+ $result = unzip_file( $package, $working_dir );
+
+ // Once extracted, delete the package if required.
+ if ( $delete_package ) {
+ unlink( $package );
+ }
+
+ if ( is_wp_error( $result ) ) {
+ $wp_filesystem->delete( $working_dir, true );
+ if ( 'incompatible_archive' == $result->get_error_code() ) {
+ return new WP_Error( 'incompatible_archive', $this->strings['incompatible_archive'], $result->get_error_data() );
+ }
+ return $result;
+ }
+
+ return $working_dir;
+ }
+
+ /**
+ * Flatten the results of WP_Filesystem::dirlist() for iterating over.
+ *
+ * @since 4.9.0
+ * @access protected
+ *
+ * @param array $nested_files Array of files as returned by WP_Filesystem::dirlist()
+ * @param string $path Relative path to prepend to child nodes. Optional.
+ * @return array $files A flattened array of the $nested_files specified.
+ */
+ protected function flatten_dirlist( $nested_files, $path = '' ) {
+ $files = array();
+
+ foreach ( $nested_files as $name => $details ) {
+ $files[ $path . $name ] = $details;
+
+ // Append children recursively
+ if ( ! empty( $details['files'] ) ) {
+ $children = $this->flatten_dirlist( $details['files'], $path . $name . '/' );
+
+ // Merge keeping possible numeric keys, which array_merge() will reindex from 0..n
+ $files = $files + $children;
+ }
+ }
+
+ return $files;
+ }
+
+ /**
+ * Clears the directory where this item is going to be installed into.
+ *
+ * @since 4.3.0
+ *
+ * @global WP_Filesystem_Base $wp_filesystem WordPress filesystem subclass.
+ *
+ * @param string $remote_destination The location on the remote filesystem to be cleared
+ * @return bool|WP_Error True upon success, WP_Error on failure.
+ */
+ public function clear_destination( $remote_destination ) {
+ global $wp_filesystem;
+
+ $files = $wp_filesystem->dirlist( $remote_destination, true, true );
+
+ // False indicates that the $remote_destination doesn't exist.
+ if ( false === $files ) {
+ return true;
+ }
+
+ // Flatten the file list to iterate over
+ $files = $this->flatten_dirlist( $files );
+
+ // Check all files are writable before attempting to clear the destination.
+ $unwritable_files = array();
+
+ // Check writability.
+ foreach ( $files as $filename => $file_details ) {
+ if ( ! $wp_filesystem->is_writable( $remote_destination . $filename ) ) {
+ // Attempt to alter permissions to allow writes and try again.
+ $wp_filesystem->chmod( $remote_destination . $filename, ( 'd' == $file_details['type'] ? FS_CHMOD_DIR : FS_CHMOD_FILE ) );
+ if ( ! $wp_filesystem->is_writable( $remote_destination . $filename ) ) {
+ $unwritable_files[] = $filename;
+ }
+ }
+ }
+
+ if ( ! empty( $unwritable_files ) ) {
+ return new WP_Error( 'files_not_writable', $this->strings['files_not_writable'], implode( ', ', $unwritable_files ) );
+ }
+
+ if ( ! $wp_filesystem->delete( $remote_destination, true ) ) {
+ return new WP_Error( 'remove_old_failed', $this->strings['remove_old_failed'] );
+ }
+
+ return true;
+ }
+
+ /**
+ * Install a package.
+ *
+ * Copies the contents of a package form a source directory, and installs them in
+ * a destination directory. Optionally removes the source. It can also optionally
+ * clear out the destination folder if it already exists.
+ *
+ * @since 2.8.0
+ *
+ * @global WP_Filesystem_Base $wp_filesystem WordPress filesystem subclass.
+ * @global array $wp_theme_directories
+ *
+ * @param array|string $args {
+ * Optional. Array or string of arguments for installing a package. Default empty array.
+ *
+ * @type string $source Required path to the package source. Default empty.
+ * @type string $destination Required path to a folder to install the package in.
+ * Default empty.
+ * @type bool $clear_destination Whether to delete any files already in the destination
+ * folder. Default false.
+ * @type bool $clear_working Whether to delete the files form the working directory
+ * after copying to the destination. Default false.
+ * @type bool $abort_if_destination_exists Whether to abort the installation if
+ * the destination folder already exists. Default true.
+ * @type array $hook_extra Extra arguments to pass to the filter hooks called by
+ * WP_Upgrader::install_package(). Default empty array.
+ * }
+ *
+ * @return array|WP_Error The result (also stored in `WP_Upgrader::$result`), or a WP_Error on failure.
+ */
+ public function install_package( $args = array() ) {
+ global $wp_filesystem, $wp_theme_directories;
+
+ $defaults = array(
+ 'source' => '', // Please always pass this
+ 'destination' => '', // and this
+ 'clear_destination' => false,
+ 'clear_working' => false,
+ 'abort_if_destination_exists' => true,
+ 'hook_extra' => array(),
+ );
+
+ $args = wp_parse_args( $args, $defaults );
+
+ // These were previously extract()'d.
+ $source = $args['source'];
+ $destination = $args['destination'];
+ $clear_destination = $args['clear_destination'];
+
+ @set_time_limit( 300 );
+
+ if ( empty( $source ) || empty( $destination ) ) {
+ return new WP_Error( 'bad_request', $this->strings['bad_request'] );
+ }
+ $this->skin->feedback( 'installing_package' );
+
+ /**
+ * Filters the install response before the installation has started.
+ *
+ * Returning a truthy value, or one that could be evaluated as a WP_Error
+ * will effectively short-circuit the installation, returning that value
+ * instead.
+ *
+ * @since 2.8.0
+ *
+ * @param bool|WP_Error $response Response.
+ * @param array $hook_extra Extra arguments passed to hooked filters.
+ */
+ $res = apply_filters( 'upgrader_pre_install', true, $args['hook_extra'] );
+
+ if ( is_wp_error( $res ) ) {
+ return $res;
+ }
+
+ //Retain the Original source and destinations
+ $remote_source = $args['source'];
+ $local_destination = $destination;
+
+ $source_files = array_keys( $wp_filesystem->dirlist( $remote_source ) );
+ $remote_destination = $wp_filesystem->find_folder( $local_destination );
+
+ //Locate which directory to copy to the new folder, This is based on the actual folder holding the files.
+ if ( 1 == count( $source_files ) && $wp_filesystem->is_dir( trailingslashit( $args['source'] ) . $source_files[0] . '/' ) ) { //Only one folder? Then we want its contents.
+ $source = trailingslashit( $args['source'] ) . trailingslashit( $source_files[0] );
+ } elseif ( count( $source_files ) == 0 ) {
+ return new WP_Error( 'incompatible_archive_empty', $this->strings['incompatible_archive'], $this->strings['no_files'] ); // There are no files?
+ } else { // It's only a single file, the upgrader will use the folder name of this file as the destination folder. Folder name is based on zip filename.
+ $source = trailingslashit( $args['source'] );
+ }
+
+ /**
+ * Filters the source file location for the upgrade package.
+ *
+ * @since 2.8.0
+ * @since 4.4.0 The $hook_extra parameter became available.
+ *
+ * @param string $source File source location.
+ * @param string $remote_source Remote file source location.
+ * @param WP_Upgrader $this WP_Upgrader instance.
+ * @param array $hook_extra Extra arguments passed to hooked filters.
+ */
+ $source = apply_filters( 'upgrader_source_selection', $source, $remote_source, $this, $args['hook_extra'] );
+
+ if ( is_wp_error( $source ) ) {
+ return $source;
+ }
+
+ // Has the source location changed? If so, we need a new source_files list.
+ if ( $source !== $remote_source ) {
+ $source_files = array_keys( $wp_filesystem->dirlist( $source ) );
+ }
+
+ /*
+ * Protection against deleting files in any important base directories.
+ * Theme_Upgrader & Plugin_Upgrader also trigger this, as they pass the
+ * destination directory (WP_PLUGIN_DIR / wp-content/themes) intending
+ * to copy the directory into the directory, whilst they pass the source
+ * as the actual files to copy.
+ */
+ $protected_directories = array( ABSPATH, WP_CONTENT_DIR, WP_PLUGIN_DIR, WP_CONTENT_DIR . '/themes' );
+
+ if ( is_array( $wp_theme_directories ) ) {
+ $protected_directories = array_merge( $protected_directories, $wp_theme_directories );
+ }
+
+ if ( in_array( $destination, $protected_directories ) ) {
+ $remote_destination = trailingslashit( $remote_destination ) . trailingslashit( basename( $source ) );
+ $destination = trailingslashit( $destination ) . trailingslashit( basename( $source ) );
+ }
+
+ if ( $clear_destination ) {
+ // We're going to clear the destination if there's something there.
+ $this->skin->feedback( 'remove_old' );
+
+ $removed = $this->clear_destination( $remote_destination );
+
+ /**
+ * Filters whether the upgrader cleared the destination.
+ *
+ * @since 2.8.0
+ *
+ * @param mixed $removed Whether the destination was cleared. true on success, WP_Error on failure
+ * @param string $local_destination The local package destination.
+ * @param string $remote_destination The remote package destination.
+ * @param array $hook_extra Extra arguments passed to hooked filters.
+ */
+ $removed = apply_filters( 'upgrader_clear_destination', $removed, $local_destination, $remote_destination, $args['hook_extra'] );
+
+ if ( is_wp_error( $removed ) ) {
+ return $removed;
+ }
+ } elseif ( $args['abort_if_destination_exists'] && $wp_filesystem->exists( $remote_destination ) ) {
+ //If we're not clearing the destination folder and something exists there already, Bail.
+ //But first check to see if there are actually any files in the folder.
+ $_files = $wp_filesystem->dirlist( $remote_destination );
+ if ( ! empty( $_files ) ) {
+ $wp_filesystem->delete( $remote_source, true ); //Clear out the source files.
+ return new WP_Error( 'folder_exists', $this->strings['folder_exists'], $remote_destination );
+ }
+ }
+
+ //Create destination if needed
+ if ( ! $wp_filesystem->exists( $remote_destination ) ) {
+ if ( ! $wp_filesystem->mkdir( $remote_destination, FS_CHMOD_DIR ) ) {
+ return new WP_Error( 'mkdir_failed_destination', $this->strings['mkdir_failed'], $remote_destination );
+ }
+ }
+ // Copy new version of item into place.
+ $result = copy_dir( $source, $remote_destination );
+ if ( is_wp_error( $result ) ) {
+ if ( $args['clear_working'] ) {
+ $wp_filesystem->delete( $remote_source, true );
+ }
+ return $result;
+ }
+
+ //Clear the Working folder?
+ if ( $args['clear_working'] ) {
+ $wp_filesystem->delete( $remote_source, true );
+ }
+
+ $destination_name = basename( str_replace( $local_destination, '', $destination ) );
+ if ( '.' == $destination_name ) {
+ $destination_name = '';
+ }
+
+ $this->result = compact( 'source', 'source_files', 'destination', 'destination_name', 'local_destination', 'remote_destination', 'clear_destination' );
+
+ /**
+ * Filters the installation response after the installation has finished.
+ *
+ * @since 2.8.0
+ *
+ * @param bool $response Installation response.
+ * @param array $hook_extra Extra arguments passed to hooked filters.
+ * @param array $result Installation result data.
+ */
+ $res = apply_filters( 'upgrader_post_install', true, $args['hook_extra'], $this->result );
+
+ if ( is_wp_error( $res ) ) {
+ $this->result = $res;
+ return $res;
+ }
+
+ //Bombard the calling function will all the info which we've just used.
+ return $this->result;
+ }
+
+ /**
+ * Run an upgrade/installation.
+ *
+ * Attempts to download the package (if it is not a local file), unpack it, and
+ * install it in the destination folder.
+ *
+ * @since 2.8.0
+ *
+ * @param array $options {
+ * Array or string of arguments for upgrading/installing a package.
+ *
+ * @type string $package The full path or URI of the package to install.
+ * Default empty.
+ * @type string $destination The full path to the destination folder.
+ * Default empty.
+ * @type bool $clear_destination Whether to delete any files already in the
+ * destination folder. Default false.
+ * @type bool $clear_working Whether to delete the files form the working
+ * directory after copying to the destination.
+ * Default false.
+ * @type bool $abort_if_destination_exists Whether to abort the installation if the destination
+ * folder already exists. When true, `$clear_destination`
+ * should be false. Default true.
+ * @type bool $is_multi Whether this run is one of multiple upgrade/installation
+ * actions being performed in bulk. When true, the skin
+ * WP_Upgrader::header() and WP_Upgrader::footer()
+ * aren't called. Default false.
+ * @type array $hook_extra Extra arguments to pass to the filter hooks called by
+ * WP_Upgrader::run().
+ * }
+ * @return array|false|WP_error The result from self::install_package() on success, otherwise a WP_Error,
+ * or false if unable to connect to the filesystem.
+ */
+ public function run( $options ) {
+
+ $defaults = array(
+ 'package' => '', // Please always pass this.
+ 'destination' => '', // And this
+ 'clear_destination' => false,
+ 'abort_if_destination_exists' => true, // Abort if the Destination directory exists, Pass clear_destination as false please
+ 'clear_working' => true,
+ 'is_multi' => false,
+ 'hook_extra' => array(), // Pass any extra $hook_extra args here, this will be passed to any hooked filters.
+ );
+
+ $options = wp_parse_args( $options, $defaults );
+
+ /**
+ * Filters the package options before running an update.
+ *
+ * See also {@see 'upgrader_process_complete'}.
+ *
+ * @since 4.3.0
+ *
+ * @param array $options {
+ * Options used by the upgrader.
+ *
+ * @type string $package Package for update.
+ * @type string $destination Update location.
+ * @type bool $clear_destination Clear the destination resource.
+ * @type bool $clear_working Clear the working resource.
+ * @type bool $abort_if_destination_exists Abort if the Destination directory exists.
+ * @type bool $is_multi Whether the upgrader is running multiple times.
+ * @type array $hook_extra {
+ * Extra hook arguments.
+ *
+ * @type string $action Type of action. Default 'update'.
+ * @type string $type Type of update process. Accepts 'plugin', 'theme', or 'core'.
+ * @type bool $bulk Whether the update process is a bulk update. Default true.
+ * @type string $plugin Path to the plugin file relative to the plugins directory.
+ * @type string $theme The stylesheet or template name of the theme.
+ * @type string $language_update_type The language pack update type. Accepts 'plugin', 'theme',
+ * or 'core'.
+ * @type object $language_update The language pack update offer.
+ * }
+ * }
+ */
+ $options = apply_filters( 'upgrader_package_options', $options );
+
+ if ( ! $options['is_multi'] ) { // call $this->header separately if running multiple times
+ $this->skin->header();
+ }
+
+ // Connect to the Filesystem first.
+ $res = $this->fs_connect( array( WP_CONTENT_DIR, $options['destination'] ) );
+ // Mainly for non-connected filesystem.
+ if ( ! $res ) {
+ if ( ! $options['is_multi'] ) {
+ $this->skin->footer();
+ }
+ return false;
+ }
+
+ $this->skin->before();
+
+ if ( is_wp_error( $res ) ) {
+ $this->skin->error( $res );
+ $this->skin->after();
+ if ( ! $options['is_multi'] ) {
+ $this->skin->footer();
+ }
+ return $res;
+ }
+
+ /*
+ * Download the package (Note, This just returns the filename
+ * of the file if the package is a local file)
+ */
+ $download = $this->download_package( $options['package'], true );
+
+ // Allow for signature soft-fail.
+ // WARNING: This may be removed in the future.
+ if ( is_wp_error( $download ) && $download->get_error_data( 'softfail-filename' ) ) {
+
+ // Don't output the 'no signature could be found' failure message for now.
+ if ( 'signature_verification_no_signature' != $download->get_error_code() || WP_DEBUG ) {
+ // Outout the failure error as a normal feedback, and not as an error:
+ $this->skin->feedback( $download->get_error_message() );
+
+ // Report this failure back to WordPress.org for debugging purposes.
+ wp_version_check(
+ array(
+ 'signature_failure_code' => $download->get_error_code(),
+ 'signature_failure_data' => $download->get_error_data(),
+ )
+ );
+ }
+
+ // Pretend this error didn't happen.
+ $download = $download->get_error_data( 'softfail-filename' );
+ }
+
+ if ( is_wp_error( $download ) ) {
+ $this->skin->error( $download );
+ $this->skin->after();
+ if ( ! $options['is_multi'] ) {
+ $this->skin->footer();
+ }
+ return $download;
+ }
+
+ $delete_package = ( $download != $options['package'] ); // Do not delete a "local" file
+
+ // Unzips the file into a temporary directory.
+ $working_dir = $this->unpack_package( $download, $delete_package );
+ if ( is_wp_error( $working_dir ) ) {
+ $this->skin->error( $working_dir );
+ $this->skin->after();
+ if ( ! $options['is_multi'] ) {
+ $this->skin->footer();
+ }
+ return $working_dir;
+ }
+
+ // With the given options, this installs it to the destination directory.
+ $result = $this->install_package(
+ array(
+ 'source' => $working_dir,
+ 'destination' => $options['destination'],
+ 'clear_destination' => $options['clear_destination'],
+ 'abort_if_destination_exists' => $options['abort_if_destination_exists'],
+ 'clear_working' => $options['clear_working'],
+ 'hook_extra' => $options['hook_extra'],
+ )
+ );
+
+ $this->skin->set_result( $result );
+ if ( is_wp_error( $result ) ) {
+ $this->skin->error( $result );
+ $this->skin->feedback( 'process_failed' );
+ } else {
+ // Installation succeeded.
+ $this->skin->feedback( 'process_success' );
+ }
+
+ $this->skin->after();
+
+ if ( ! $options['is_multi'] ) {
+
+ /**
+ * Fires when the upgrader process is complete.
+ *
+ * See also {@see 'upgrader_package_options'}.
+ *
+ * @since 3.6.0
+ * @since 3.7.0 Added to WP_Upgrader::run().
+ * @since 4.6.0 `$translations` was added as a possible argument to `$hook_extra`.
+ *
+ * @param WP_Upgrader $this WP_Upgrader instance. In other contexts, $this, might be a
+ * Theme_Upgrader, Plugin_Upgrader, Core_Upgrade, or Language_Pack_Upgrader instance.
+ * @param array $hook_extra {
+ * Array of bulk item update data.
+ *
+ * @type string $action Type of action. Default 'update'.
+ * @type string $type Type of update process. Accepts 'plugin', 'theme', 'translation', or 'core'.
+ * @type bool $bulk Whether the update process is a bulk update. Default true.
+ * @type array $plugins Array of the basename paths of the plugins' main files.
+ * @type array $themes The theme slugs.
+ * @type array $translations {
+ * Array of translations update data.
+ *
+ * @type string $language The locale the translation is for.
+ * @type string $type Type of translation. Accepts 'plugin', 'theme', or 'core'.
+ * @type string $slug Text domain the translation is for. The slug of a theme/plugin or
+ * 'default' for core translations.
+ * @type string $version The version of a theme, plugin, or core.
+ * }
+ * }
+ */
+ do_action( 'upgrader_process_complete', $this, $options['hook_extra'] );
+
+ $this->skin->footer();
+ }
+
+ return $result;
+ }
+
+ /**
+ * Toggle maintenance mode for the site.
+ *
+ * Creates/deletes the maintenance file to enable/disable maintenance mode.
+ *
+ * @since 2.8.0
+ *
+ * @global WP_Filesystem_Base $wp_filesystem Subclass
+ *
+ * @param bool $enable True to enable maintenance mode, false to disable.
+ */
+ public function maintenance_mode( $enable = false ) {
+ global $wp_filesystem;
+ $file = $wp_filesystem->abspath() . '.maintenance';
+ if ( $enable ) {
+ $this->skin->feedback( 'maintenance_start' );
+ // Create maintenance file to signal that we are upgrading
+ $maintenance_string = '<?php $upgrading = ' . time() . '; ?>';
+ $wp_filesystem->delete( $file );
+ $wp_filesystem->put_contents( $file, $maintenance_string, FS_CHMOD_FILE );
+ } elseif ( ! $enable && $wp_filesystem->exists( $file ) ) {
+ $this->skin->feedback( 'maintenance_end' );
+ $wp_filesystem->delete( $file );
+ }
+ }
+
+ /**
+ * Creates a lock using WordPress options.
+ *
+ * @since 4.5.0
+ *
+ * @param string $lock_name The name of this unique lock.
+ * @param int $release_timeout Optional. The duration in seconds to respect an existing lock.
+ * Default: 1 hour.
+ * @return bool False if a lock couldn't be created or if the lock is still valid. True otherwise.
+ */
+ public static function create_lock( $lock_name, $release_timeout = null ) {
+ global $wpdb;
+ if ( ! $release_timeout ) {
+ $release_timeout = HOUR_IN_SECONDS;
+ }
+ $lock_option = $lock_name . '.lock';
+
+ // Try to lock.
+ $lock_result = $wpdb->query( $wpdb->prepare( "INSERT IGNORE INTO `$wpdb->options` ( `option_name`, `option_value`, `autoload` ) VALUES (%s, %s, 'no') /* LOCK */", $lock_option, time() ) );
+
+ if ( ! $lock_result ) {
+ $lock_result = get_option( $lock_option );
+
+ // If a lock couldn't be created, and there isn't a lock, bail.
+ if ( ! $lock_result ) {
+ return false;
+ }
+
+ // Check to see if the lock is still valid. If it is, bail.
+ if ( $lock_result > ( time() - $release_timeout ) ) {
+ return false;
+ }
+
+ // There must exist an expired lock, clear it and re-gain it.
+ WP_Upgrader::release_lock( $lock_name );
+
+ return WP_Upgrader::create_lock( $lock_name, $release_timeout );
+ }
+
+ // Update the lock, as by this point we've definitely got a lock, just need to fire the actions.
+ update_option( $lock_option, time() );
+
+ return true;
+ }
+
+ /**
+ * Releases an upgrader lock.
+ *
+ * @since 4.5.0
+ *
+ * @see WP_Upgrader::create_lock()
+ *
+ * @param string $lock_name The name of this unique lock.
+ * @return bool True if the lock was successfully released. False on failure.
+ */
+ public static function release_lock( $lock_name ) {
+ return delete_option( $lock_name . '.lock' );
+ }
+
+}
+
+/** Plugin_Upgrader class */
+require_once ABSPATH . 'wp-admin/includes/class-plugin-upgrader.php';
+
+/** Theme_Upgrader class */
+require_once ABSPATH . 'wp-admin/includes/class-theme-upgrader.php';
+
+/** Language_Pack_Upgrader class */
+require_once ABSPATH . 'wp-admin/includes/class-language-pack-upgrader.php';
+
+/** Core_Upgrader class */
+require_once ABSPATH . 'wp-admin/includes/class-core-upgrader.php';
+
+/** File_Upload_Upgrader class */
+require_once ABSPATH . 'wp-admin/includes/class-file-upload-upgrader.php';
+
+/** WP_Automatic_Updater class */
+require_once ABSPATH . 'wp-admin/includes/class-wp-automatic-updater.php';
diff --git a/www/crm/wp-admin/includes/class-wp-users-list-table.php b/www/crm/wp-admin/includes/class-wp-users-list-table.php
new file mode 100644
index 00000000..28e19787
--- /dev/null
+++ b/www/crm/wp-admin/includes/class-wp-users-list-table.php
@@ -0,0 +1,602 @@
+<?php
+/**
+ * List Table API: WP_Users_List_Table class
+ *
+ * @package WordPress
+ * @subpackage Administration
+ * @since 3.1.0
+ */
+
+/**
+ * Core class used to implement displaying users in a list table.
+ *
+ * @since 3.1.0
+ * @access private
+ *
+ * @see WP_List_Table
+ */
+class WP_Users_List_Table extends WP_List_Table {
+
+ /**
+ * Site ID to generate the Users list table for.
+ *
+ * @since 3.1.0
+ * @var int
+ */
+ public $site_id;
+
+ /**
+ * Whether or not the current Users list table is for Multisite.
+ *
+ * @since 3.1.0
+ * @var bool
+ */
+ public $is_site_users;
+
+ /**
+ * Constructor.
+ *
+ * @since 3.1.0
+ *
+ * @see WP_List_Table::__construct() for more information on default arguments.
+ *
+ * @param array $args An associative array of arguments.
+ */
+ public function __construct( $args = array() ) {
+ parent::__construct(
+ array(
+ 'singular' => 'user',
+ 'plural' => 'users',
+ 'screen' => isset( $args['screen'] ) ? $args['screen'] : null,
+ )
+ );
+
+ $this->is_site_users = 'site-users-network' === $this->screen->id;
+
+ if ( $this->is_site_users ) {
+ $this->site_id = isset( $_REQUEST['id'] ) ? intval( $_REQUEST['id'] ) : 0;
+ }
+ }
+
+ /**
+ * Check the current user's permissions.
+ *
+ * @since 3.1.0
+ *
+ * @return bool
+ */
+ public function ajax_user_can() {
+ if ( $this->is_site_users ) {
+ return current_user_can( 'manage_sites' );
+ } else {
+ return current_user_can( 'list_users' );
+ }
+ }
+
+ /**
+ * Prepare the users list for display.
+ *
+ * @since 3.1.0
+ *
+ * @global string $role
+ * @global string $usersearch
+ */
+ public function prepare_items() {
+ global $role, $usersearch;
+
+ $usersearch = isset( $_REQUEST['s'] ) ? wp_unslash( trim( $_REQUEST['s'] ) ) : '';
+
+ $role = isset( $_REQUEST['role'] ) ? $_REQUEST['role'] : '';
+
+ $per_page = ( $this->is_site_users ) ? 'site_users_network_per_page' : 'users_per_page';
+ $users_per_page = $this->get_items_per_page( $per_page );
+
+ $paged = $this->get_pagenum();
+
+ if ( 'none' === $role ) {
+ $args = array(
+ 'number' => $users_per_page,
+ 'offset' => ( $paged - 1 ) * $users_per_page,
+ 'include' => wp_get_users_with_no_role( $this->site_id ),
+ 'search' => $usersearch,
+ 'fields' => 'all_with_meta',
+ );
+ } else {
+ $args = array(
+ 'number' => $users_per_page,
+ 'offset' => ( $paged - 1 ) * $users_per_page,
+ 'role' => $role,
+ 'search' => $usersearch,
+ 'fields' => 'all_with_meta',
+ );
+ }
+
+ if ( '' !== $args['search'] ) {
+ $args['search'] = '*' . $args['search'] . '*';
+ }
+
+ if ( $this->is_site_users ) {
+ $args['blog_id'] = $this->site_id;
+ }
+
+ if ( isset( $_REQUEST['orderby'] ) ) {
+ $args['orderby'] = $_REQUEST['orderby'];
+ }
+
+ if ( isset( $_REQUEST['order'] ) ) {
+ $args['order'] = $_REQUEST['order'];
+ }
+
+ /**
+ * Filters the query arguments used to retrieve users for the current users list table.
+ *
+ * @since 4.4.0
+ *
+ * @param array $args Arguments passed to WP_User_Query to retrieve items for the current
+ * users list table.
+ */
+ $args = apply_filters( 'users_list_table_query_args', $args );
+
+ // Query the user IDs for this page
+ $wp_user_search = new WP_User_Query( $args );
+
+ $this->items = $wp_user_search->get_results();
+
+ $this->set_pagination_args(
+ array(
+ 'total_items' => $wp_user_search->get_total(),
+ 'per_page' => $users_per_page,
+ )
+ );
+ }
+
+ /**
+ * Output 'no users' message.
+ *
+ * @since 3.1.0
+ */
+ public function no_items() {
+ _e( 'No users found.' );
+ }
+
+ /**
+ * Return an associative array listing all the views that can be used
+ * with this table.
+ *
+ * Provides a list of roles and user count for that role for easy
+ * Filtersing of the user table.
+ *
+ * @since 3.1.0
+ *
+ * @global string $role
+ *
+ * @return array An array of HTML links, one for each view.
+ */
+ protected function get_views() {
+ global $role;
+
+ $wp_roles = wp_roles();
+
+ if ( $this->is_site_users ) {
+ $url = 'site-users.php?id=' . $this->site_id;
+ switch_to_blog( $this->site_id );
+ $users_of_blog = count_users( 'time', $this->site_id );
+ restore_current_blog();
+ } else {
+ $url = 'users.php';
+ $users_of_blog = count_users();
+ }
+
+ $total_users = $users_of_blog['total_users'];
+ $avail_roles =& $users_of_blog['avail_roles'];
+ unset( $users_of_blog );
+
+ $current_link_attributes = empty( $role ) ? ' class="current" aria-current="page"' : '';
+
+ $role_links = array();
+ $role_links['all'] = "<a href='$url'$current_link_attributes>" . sprintf( _nx( 'All <span class="count">(%s)</span>', 'All <span class="count">(%s)</span>', $total_users, 'users' ), number_format_i18n( $total_users ) ) . '</a>';
+ foreach ( $wp_roles->get_names() as $this_role => $name ) {
+ if ( ! isset( $avail_roles[ $this_role ] ) ) {
+ continue;
+ }
+
+ $current_link_attributes = '';
+
+ if ( $this_role === $role ) {
+ $current_link_attributes = ' class="current" aria-current="page"';
+ }
+
+ $name = translate_user_role( $name );
+ /* translators: User role name with count */
+ $name = sprintf( __( '%1$s <span class="count">(%2$s)</span>' ), $name, number_format_i18n( $avail_roles[ $this_role ] ) );
+ $role_links[ $this_role ] = "<a href='" . esc_url( add_query_arg( 'role', $this_role, $url ) ) . "'$current_link_attributes>$name</a>";
+ }
+
+ if ( ! empty( $avail_roles['none'] ) ) {
+
+ $current_link_attributes = '';
+
+ if ( 'none' === $role ) {
+ $current_link_attributes = ' class="current" aria-current="page"';
+ }
+
+ $name = __( 'No role' );
+ /* translators: User role name with count */
+ $name = sprintf( __( '%1$s <span class="count">(%2$s)</span>' ), $name, number_format_i18n( $avail_roles['none'] ) );
+ $role_links['none'] = "<a href='" . esc_url( add_query_arg( 'role', 'none', $url ) ) . "'$current_link_attributes>$name</a>";
+
+ }
+
+ return $role_links;
+ }
+
+ /**
+ * Retrieve an associative array of bulk actions available on this table.
+ *
+ * @since 3.1.0
+ *
+ * @return array Array of bulk actions.
+ */
+ protected function get_bulk_actions() {
+ $actions = array();
+
+ if ( is_multisite() ) {
+ if ( current_user_can( 'remove_users' ) ) {
+ $actions['remove'] = __( 'Remove' );
+ }
+ } else {
+ if ( current_user_can( 'delete_users' ) ) {
+ $actions['delete'] = __( 'Delete' );
+ }
+ }
+
+ return $actions;
+ }
+
+ /**
+ * Output the controls to allow user roles to be changed in bulk.
+ *
+ * @since 3.1.0
+ *
+ * @param string $which Whether this is being invoked above ("top")
+ * or below the table ("bottom").
+ */
+ protected function extra_tablenav( $which ) {
+ $id = 'bottom' === $which ? 'new_role2' : 'new_role';
+ $button_id = 'bottom' === $which ? 'changeit2' : 'changeit';
+ ?>
+ <div class="alignleft actions">
+ <?php if ( current_user_can( 'promote_users' ) && $this->has_items() ) : ?>
+ <label class="screen-reader-text" for="<?php echo $id; ?>"><?php _e( 'Change role to&hellip;' ); ?></label>
+ <select name="<?php echo $id; ?>" id="<?php echo $id; ?>">
+ <option value=""><?php _e( 'Change role to&hellip;' ); ?></option>
+ <?php wp_dropdown_roles(); ?>
+ </select>
+ <?php
+ submit_button( __( 'Change' ), '', $button_id, false );
+ endif;
+
+ /**
+ * Fires just before the closing div containing the bulk role-change controls
+ * in the Users list table.
+ *
+ * @since 3.5.0
+ * @since 4.6.0 The `$which` parameter was added.
+ *
+ * @param string $which The location of the extra table nav markup: 'top' or 'bottom'.
+ */
+ do_action( 'restrict_manage_users', $which );
+ ?>
+ </div>
+ <?php
+ /**
+ * Fires immediately following the closing "actions" div in the tablenav for the users
+ * list table.
+ *
+ * @since 4.9.0
+ *
+ * @param string $which The location of the extra table nav markup: 'top' or 'bottom'.
+ */
+ do_action( 'manage_users_extra_tablenav', $which );
+ }
+
+ /**
+ * Capture the bulk action required, and return it.
+ *
+ * Overridden from the base class implementation to capture
+ * the role change drop-down.
+ *
+ * @since 3.1.0
+ *
+ * @return string The bulk action required.
+ */
+ public function current_action() {
+ if ( ( isset( $_REQUEST['changeit'] ) || isset( $_REQUEST['changeit2'] ) ) &&
+ ( ! empty( $_REQUEST['new_role'] ) || ! empty( $_REQUEST['new_role2'] ) ) ) {
+ return 'promote';
+ }
+
+ return parent::current_action();
+ }
+
+ /**
+ * Get a list of columns for the list table.
+ *
+ * @since 3.1.0
+ *
+ * @return array Array in which the key is the ID of the column,
+ * and the value is the description.
+ */
+ public function get_columns() {
+ $c = array(
+ 'cb' => '<input type="checkbox" />',
+ 'username' => __( 'Username' ),
+ 'name' => __( 'Name' ),
+ 'email' => __( 'Email' ),
+ 'role' => __( 'Role' ),
+ 'posts' => __( 'Posts' ),
+ );
+
+ if ( $this->is_site_users ) {
+ unset( $c['posts'] );
+ }
+
+ return $c;
+ }
+
+ /**
+ * Get a list of sortable columns for the list table.
+ *
+ * @since 3.1.0
+ *
+ * @return array Array of sortable columns.
+ */
+ protected function get_sortable_columns() {
+ $c = array(
+ 'username' => 'login',
+ 'email' => 'email',
+ );
+
+ return $c;
+ }
+
+ /**
+ * Generate the list table rows.
+ *
+ * @since 3.1.0
+ */
+ public function display_rows() {
+ // Query the post counts for this page
+ if ( ! $this->is_site_users ) {
+ $post_counts = count_many_users_posts( array_keys( $this->items ) );
+ }
+
+ foreach ( $this->items as $userid => $user_object ) {
+ echo "\n\t" . $this->single_row( $user_object, '', '', isset( $post_counts ) ? $post_counts[ $userid ] : 0 );
+ }
+ }
+
+ /**
+ * Generate HTML for a single row on the users.php admin panel.
+ *
+ * @since 3.1.0
+ * @since 4.2.0 The `$style` parameter was deprecated.
+ * @since 4.4.0 The `$role` parameter was deprecated.
+ *
+ * @param WP_User $user_object The current user object.
+ * @param string $style Deprecated. Not used.
+ * @param string $role Deprecated. Not used.
+ * @param int $numposts Optional. Post count to display for this user. Defaults
+ * to zero, as in, a new user has made zero posts.
+ * @return string Output for a single row.
+ */
+ public function single_row( $user_object, $style = '', $role = '', $numposts = 0 ) {
+ if ( ! ( $user_object instanceof WP_User ) ) {
+ $user_object = get_userdata( (int) $user_object );
+ }
+ $user_object->filter = 'display';
+ $email = $user_object->user_email;
+
+ if ( $this->is_site_users ) {
+ $url = "site-users.php?id={$this->site_id}&amp;";
+ } else {
+ $url = 'users.php?';
+ }
+
+ $user_roles = $this->get_role_list( $user_object );
+
+ // Set up the hover actions for this user
+ $actions = array();
+ $checkbox = '';
+ $super_admin = '';
+
+ if ( is_multisite() && current_user_can( 'manage_network_users' ) ) {
+ if ( in_array( $user_object->user_login, get_super_admins(), true ) ) {
+ $super_admin = ' &mdash; ' . __( 'Super Admin' );
+ }
+ }
+
+ // Check if the user for this row is editable
+ if ( current_user_can( 'list_users' ) ) {
+ // Set up the user editing link
+ $edit_link = esc_url( add_query_arg( 'wp_http_referer', urlencode( wp_unslash( $_SERVER['REQUEST_URI'] ) ), get_edit_user_link( $user_object->ID ) ) );
+
+ if ( current_user_can( 'edit_user', $user_object->ID ) ) {
+ $edit = "<strong><a href=\"{$edit_link}\">{$user_object->user_login}</a>{$super_admin}</strong><br />";
+ $actions['edit'] = '<a href="' . $edit_link . '">' . __( 'Edit' ) . '</a>';
+ } else {
+ $edit = "<strong>{$user_object->user_login}{$super_admin}</strong><br />";
+ }
+
+ if ( ! is_multisite() && get_current_user_id() != $user_object->ID && current_user_can( 'delete_user', $user_object->ID ) ) {
+ $actions['delete'] = "<a class='submitdelete' href='" . wp_nonce_url( "users.php?action=delete&amp;user=$user_object->ID", 'bulk-users' ) . "'>" . __( 'Delete' ) . '</a>';
+ }
+ if ( is_multisite() && get_current_user_id() != $user_object->ID && current_user_can( 'remove_user', $user_object->ID ) ) {
+ $actions['remove'] = "<a class='submitdelete' href='" . wp_nonce_url( $url . "action=remove&amp;user=$user_object->ID", 'bulk-users' ) . "'>" . __( 'Remove' ) . '</a>';
+ }
+
+ // Add a link to the user's author archive, if not empty.
+ $author_posts_url = get_author_posts_url( $user_object->ID );
+ if ( $author_posts_url ) {
+ $actions['view'] = sprintf(
+ '<a href="%s" aria-label="%s">%s</a>',
+ esc_url( $author_posts_url ),
+ /* translators: %s: author's display name */
+ esc_attr( sprintf( __( 'View posts by %s' ), $user_object->display_name ) ),
+ __( 'View' )
+ );
+ }
+
+ /**
+ * Filters the action links displayed under each user in the Users list table.
+ *
+ * @since 2.8.0
+ *
+ * @param string[] $actions An array of action links to be displayed.
+ * Default 'Edit', 'Delete' for single site, and
+ * 'Edit', 'Remove' for Multisite.
+ * @param WP_User $user_object WP_User object for the currently listed user.
+ */
+ $actions = apply_filters( 'user_row_actions', $actions, $user_object );
+
+ // Role classes.
+ $role_classes = esc_attr( implode( ' ', array_keys( $user_roles ) ) );
+
+ // Set up the checkbox ( because the user is editable, otherwise it's empty )
+ $checkbox = '<label class="screen-reader-text" for="user_' . $user_object->ID . '">' . sprintf( __( 'Select %s' ), $user_object->user_login ) . '</label>'
+ . "<input type='checkbox' name='users[]' id='user_{$user_object->ID}' class='{$role_classes}' value='{$user_object->ID}' />";
+
+ } else {
+ $edit = "<strong>{$user_object->user_login}{$super_admin}</strong>";
+ }
+ $avatar = get_avatar( $user_object->ID, 32 );
+
+ // Comma-separated list of user roles.
+ $roles_list = implode( ', ', $user_roles );
+
+ $r = "<tr id='user-$user_object->ID'>";
+
+ list( $columns, $hidden, $sortable, $primary ) = $this->get_column_info();
+
+ foreach ( $columns as $column_name => $column_display_name ) {
+ $classes = "$column_name column-$column_name";
+ if ( $primary === $column_name ) {
+ $classes .= ' has-row-actions column-primary';
+ }
+ if ( 'posts' === $column_name ) {
+ $classes .= ' num'; // Special case for that column
+ }
+
+ if ( in_array( $column_name, $hidden ) ) {
+ $classes .= ' hidden';
+ }
+
+ $data = 'data-colname="' . wp_strip_all_tags( $column_display_name ) . '"';
+
+ $attributes = "class='$classes' $data";
+
+ if ( 'cb' === $column_name ) {
+ $r .= "<th scope='row' class='check-column'>$checkbox</th>";
+ } else {
+ $r .= "<td $attributes>";
+ switch ( $column_name ) {
+ case 'username':
+ $r .= "$avatar $edit";
+ break;
+ case 'name':
+ if ( $user_object->first_name && $user_object->last_name ) {
+ $r .= "$user_object->first_name $user_object->last_name";
+ } elseif ( $user_object->first_name ) {
+ $r .= $user_object->first_name;
+ } elseif ( $user_object->last_name ) {
+ $r .= $user_object->last_name;
+ } else {
+ $r .= '<span aria-hidden="true">&#8212;</span><span class="screen-reader-text">' . _x( 'Unknown', 'name' ) . '</span>';
+ }
+ break;
+ case 'email':
+ $r .= "<a href='" . esc_url( "mailto:$email" ) . "'>$email</a>";
+ break;
+ case 'role':
+ $r .= esc_html( $roles_list );
+ break;
+ case 'posts':
+ if ( $numposts > 0 ) {
+ $r .= "<a href='edit.php?author=$user_object->ID' class='edit'>";
+ $r .= '<span aria-hidden="true">' . $numposts . '</span>';
+ $r .= '<span class="screen-reader-text">' . sprintf( _n( '%s post by this author', '%s posts by this author', $numposts ), number_format_i18n( $numposts ) ) . '</span>';
+ $r .= '</a>';
+ } else {
+ $r .= 0;
+ }
+ break;
+ default:
+ /**
+ * Filters the display output of custom columns in the Users list table.
+ *
+ * @since 2.8.0
+ *
+ * @param string $output Custom column output. Default empty.
+ * @param string $column_name Column name.
+ * @param int $user_id ID of the currently-listed user.
+ */
+ $r .= apply_filters( 'manage_users_custom_column', '', $column_name, $user_object->ID );
+ }
+
+ if ( $primary === $column_name ) {
+ $r .= $this->row_actions( $actions );
+ }
+ $r .= '</td>';
+ }
+ }
+ $r .= '</tr>';
+
+ return $r;
+ }
+
+ /**
+ * Gets the name of the default primary column.
+ *
+ * @since 4.3.0
+ *
+ * @return string Name of the default primary column, in this case, 'username'.
+ */
+ protected function get_default_primary_column_name() {
+ return 'username';
+ }
+
+ /**
+ * Returns an array of user roles for a given user object.
+ *
+ * @since 4.4.0
+ *
+ * @param WP_User $user_object The WP_User object.
+ * @return string[] An array of user roles.
+ */
+ protected function get_role_list( $user_object ) {
+ $wp_roles = wp_roles();
+
+ $role_list = array();
+
+ foreach ( $user_object->roles as $role ) {
+ if ( isset( $wp_roles->role_names[ $role ] ) ) {
+ $role_list[ $role ] = translate_user_role( $wp_roles->role_names[ $role ] );
+ }
+ }
+
+ if ( empty( $role_list ) ) {
+ $role_list['none'] = _x( 'None', 'no user roles' );
+ }
+
+ /**
+ * Filters the returned array of roles for a user.
+ *
+ * @since 4.4.0
+ *
+ * @param string[] $role_list An array of user roles.
+ * @param WP_User $user_object A WP_User object.
+ */
+ return apply_filters( 'get_role_list', $role_list, $user_object );
+ }
+
+}
diff --git a/www/crm/wp-admin/includes/comment.php b/www/crm/wp-admin/includes/comment.php
new file mode 100644
index 00000000..543cc8b2
--- /dev/null
+++ b/www/crm/wp-admin/includes/comment.php
@@ -0,0 +1,212 @@
+<?php
+/**
+ * WordPress Comment Administration API.
+ *
+ * @package WordPress
+ * @subpackage Administration
+ * @since 2.3.0
+ */
+
+/**
+ * Determine if a comment exists based on author and date.
+ *
+ * For best performance, use `$timezone = 'gmt'`, which queries a field that is properly indexed. The default value
+ * for `$timezone` is 'blog' for legacy reasons.
+ *
+ * @since 2.0.0
+ * @since 4.4.0 Added the `$timezone` parameter.
+ *
+ * @global wpdb $wpdb WordPress database abstraction object.
+ *
+ * @param string $comment_author Author of the comment.
+ * @param string $comment_date Date of the comment.
+ * @param string $timezone Timezone. Accepts 'blog' or 'gmt'. Default 'blog'.
+ *
+ * @return mixed Comment post ID on success.
+ */
+function comment_exists( $comment_author, $comment_date, $timezone = 'blog' ) {
+ global $wpdb;
+
+ $date_field = 'comment_date';
+ if ( 'gmt' === $timezone ) {
+ $date_field = 'comment_date_gmt';
+ }
+
+ return $wpdb->get_var(
+ $wpdb->prepare(
+ "SELECT comment_post_ID FROM $wpdb->comments
+ WHERE comment_author = %s AND $date_field = %s",
+ stripslashes( $comment_author ),
+ stripslashes( $comment_date )
+ )
+ );
+}
+
+/**
+ * Update a comment with values provided in $_POST.
+ *
+ * @since 2.0.0
+ */
+function edit_comment() {
+ if ( ! current_user_can( 'edit_comment', (int) $_POST['comment_ID'] ) ) {
+ wp_die( __( 'Sorry, you are not allowed to edit comments on this post.' ) );
+ }
+
+ if ( isset( $_POST['newcomment_author'] ) ) {
+ $_POST['comment_author'] = $_POST['newcomment_author'];
+ }
+ if ( isset( $_POST['newcomment_author_email'] ) ) {
+ $_POST['comment_author_email'] = $_POST['newcomment_author_email'];
+ }
+ if ( isset( $_POST['newcomment_author_url'] ) ) {
+ $_POST['comment_author_url'] = $_POST['newcomment_author_url'];
+ }
+ if ( isset( $_POST['comment_status'] ) ) {
+ $_POST['comment_approved'] = $_POST['comment_status'];
+ }
+ if ( isset( $_POST['content'] ) ) {
+ $_POST['comment_content'] = $_POST['content'];
+ }
+ if ( isset( $_POST['comment_ID'] ) ) {
+ $_POST['comment_ID'] = (int) $_POST['comment_ID'];
+ }
+
+ foreach ( array( 'aa', 'mm', 'jj', 'hh', 'mn' ) as $timeunit ) {
+ if ( ! empty( $_POST[ 'hidden_' . $timeunit ] ) && $_POST[ 'hidden_' . $timeunit ] != $_POST[ $timeunit ] ) {
+ $_POST['edit_date'] = '1';
+ break;
+ }
+ }
+
+ if ( ! empty( $_POST['edit_date'] ) ) {
+ $aa = $_POST['aa'];
+ $mm = $_POST['mm'];
+ $jj = $_POST['jj'];
+ $hh = $_POST['hh'];
+ $mn = $_POST['mn'];
+ $ss = $_POST['ss'];
+ $jj = ( $jj > 31 ) ? 31 : $jj;
+ $hh = ( $hh > 23 ) ? $hh - 24 : $hh;
+ $mn = ( $mn > 59 ) ? $mn - 60 : $mn;
+ $ss = ( $ss > 59 ) ? $ss - 60 : $ss;
+ $_POST['comment_date'] = "$aa-$mm-$jj $hh:$mn:$ss";
+ }
+
+ wp_update_comment( $_POST );
+}
+
+/**
+ * Returns a WP_Comment object based on comment ID.
+ *
+ * @since 2.0.0
+ *
+ * @param int $id ID of comment to retrieve.
+ * @return WP_Comment|false Comment if found. False on failure.
+ */
+function get_comment_to_edit( $id ) {
+ if ( ! $comment = get_comment( $id ) ) {
+ return false;
+ }
+
+ $comment->comment_ID = (int) $comment->comment_ID;
+ $comment->comment_post_ID = (int) $comment->comment_post_ID;
+
+ $comment->comment_content = format_to_edit( $comment->comment_content );
+ /**
+ * Filters the comment content before editing.
+ *
+ * @since 2.0.0
+ *
+ * @param string $comment->comment_content Comment content.
+ */
+ $comment->comment_content = apply_filters( 'comment_edit_pre', $comment->comment_content );
+
+ $comment->comment_author = format_to_edit( $comment->comment_author );
+ $comment->comment_author_email = format_to_edit( $comment->comment_author_email );
+ $comment->comment_author_url = format_to_edit( $comment->comment_author_url );
+ $comment->comment_author_url = esc_url( $comment->comment_author_url );
+
+ return $comment;
+}
+
+/**
+ * Get the number of pending comments on a post or posts
+ *
+ * @since 2.3.0
+ *
+ * @global wpdb $wpdb WordPress database abstraction object.
+ *
+ * @param int|array $post_id Either a single Post ID or an array of Post IDs
+ * @return int|array Either a single Posts pending comments as an int or an array of ints keyed on the Post IDs
+ */
+function get_pending_comments_num( $post_id ) {
+ global $wpdb;
+
+ $single = false;
+ if ( ! is_array( $post_id ) ) {
+ $post_id_array = (array) $post_id;
+ $single = true;
+ } else {
+ $post_id_array = $post_id;
+ }
+ $post_id_array = array_map( 'intval', $post_id_array );
+ $post_id_in = "'" . implode( "', '", $post_id_array ) . "'";
+
+ $pending = $wpdb->get_results( "SELECT comment_post_ID, COUNT(comment_ID) as num_comments FROM $wpdb->comments WHERE comment_post_ID IN ( $post_id_in ) AND comment_approved = '0' GROUP BY comment_post_ID", ARRAY_A );
+
+ if ( $single ) {
+ if ( empty( $pending ) ) {
+ return 0;
+ } else {
+ return absint( $pending[0]['num_comments'] );
+ }
+ }
+
+ $pending_keyed = array();
+
+ // Default to zero pending for all posts in request
+ foreach ( $post_id_array as $id ) {
+ $pending_keyed[ $id ] = 0;
+ }
+
+ if ( ! empty( $pending ) ) {
+ foreach ( $pending as $pend ) {
+ $pending_keyed[ $pend['comment_post_ID'] ] = absint( $pend['num_comments'] );
+ }
+ }
+
+ return $pending_keyed;
+}
+
+/**
+ * Add avatars to relevant places in admin, or try to.
+ *
+ * @since 2.5.0
+ *
+ * @param string $name User name.
+ * @return string Avatar with Admin name.
+ */
+function floated_admin_avatar( $name ) {
+ $avatar = get_avatar( get_comment(), 32, 'mystery' );
+ return "$avatar $name";
+}
+
+/**
+ * @since 2.7.0
+ */
+function enqueue_comment_hotkeys_js() {
+ if ( 'true' == get_user_option( 'comment_shortcuts' ) ) {
+ wp_enqueue_script( 'jquery-table-hotkeys' );
+ }
+}
+
+/**
+ * Display error message at bottom of comments.
+ *
+ * @param string $msg Error Message. Assumed to contain HTML and be sanitized.
+ */
+function comment_footer_die( $msg ) {
+ echo "<div class='wrap'><p>$msg</p></div>";
+ include( ABSPATH . 'wp-admin/admin-footer.php' );
+ die;
+}
diff --git a/www/crm/wp-admin/includes/continents-cities.php b/www/crm/wp-admin/includes/continents-cities.php
new file mode 100644
index 00000000..7ddfe74c
--- /dev/null
+++ b/www/crm/wp-admin/includes/continents-cities.php
@@ -0,0 +1,554 @@
+<?php
+/**
+ * Translation API: Continent and city translations for timezone selection
+ *
+ * This file is not included anywhere. It exists solely for use by xgettext.
+ *
+ * @package WordPress
+ * @subpackage i18n
+ * @since 2.8.0
+ */
+
+__( 'Africa', 'continents-cities' );
+__( 'Abidjan', 'continents-cities' );
+__( 'Accra', 'continents-cities' );
+__( 'Addis Ababa', 'continents-cities' );
+__( 'Algiers', 'continents-cities' );
+__( 'Asmara', 'continents-cities' );
+__( 'Asmera', 'continents-cities' );
+__( 'Bamako', 'continents-cities' );
+__( 'Bangui', 'continents-cities' );
+__( 'Banjul', 'continents-cities' );
+__( 'Bissau', 'continents-cities' );
+__( 'Blantyre', 'continents-cities' );
+__( 'Brazzaville', 'continents-cities' );
+__( 'Bujumbura', 'continents-cities' );
+__( 'Cairo', 'continents-cities' );
+__( 'Casablanca', 'continents-cities' );
+__( 'Ceuta', 'continents-cities' );
+__( 'Conakry', 'continents-cities' );
+__( 'Dakar', 'continents-cities' );
+__( 'Dar es Salaam', 'continents-cities' );
+__( 'Djibouti', 'continents-cities' );
+__( 'Douala', 'continents-cities' );
+__( 'El Aaiun', 'continents-cities' );
+__( 'Freetown', 'continents-cities' );
+__( 'Gaborone', 'continents-cities' );
+__( 'Harare', 'continents-cities' );
+__( 'Johannesburg', 'continents-cities' );
+__( 'Juba', 'continents-cities' );
+__( 'Kampala', 'continents-cities' );
+__( 'Khartoum', 'continents-cities' );
+__( 'Kigali', 'continents-cities' );
+__( 'Kinshasa', 'continents-cities' );
+__( 'Lagos', 'continents-cities' );
+__( 'Libreville', 'continents-cities' );
+__( 'Lome', 'continents-cities' );
+__( 'Luanda', 'continents-cities' );
+__( 'Lubumbashi', 'continents-cities' );
+__( 'Lusaka', 'continents-cities' );
+__( 'Malabo', 'continents-cities' );
+__( 'Maputo', 'continents-cities' );
+__( 'Maseru', 'continents-cities' );
+__( 'Mbabane', 'continents-cities' );
+__( 'Mogadishu', 'continents-cities' );
+__( 'Monrovia', 'continents-cities' );
+__( 'Nairobi', 'continents-cities' );
+__( 'Ndjamena', 'continents-cities' );
+__( 'Niamey', 'continents-cities' );
+__( 'Nouakchott', 'continents-cities' );
+__( 'Ouagadougou', 'continents-cities' );
+__( 'Porto-Novo', 'continents-cities' );
+__( 'Sao Tome', 'continents-cities' );
+__( 'Timbuktu', 'continents-cities' );
+__( 'Tripoli', 'continents-cities' );
+__( 'Tunis', 'continents-cities' );
+__( 'Windhoek', 'continents-cities' );
+
+__( 'America', 'continents-cities' );
+__( 'Adak', 'continents-cities' );
+__( 'Anchorage', 'continents-cities' );
+__( 'Anguilla', 'continents-cities' );
+__( 'Antigua', 'continents-cities' );
+__( 'Araguaina', 'continents-cities' );
+__( 'Argentina', 'continents-cities' );
+__( 'Buenos Aires', 'continents-cities' );
+__( 'Catamarca', 'continents-cities' );
+__( 'ComodRivadavia', 'continents-cities' );
+__( 'Cordoba', 'continents-cities' );
+__( 'Jujuy', 'continents-cities' );
+__( 'La Rioja', 'continents-cities' );
+__( 'Mendoza', 'continents-cities' );
+__( 'Rio Gallegos', 'continents-cities' );
+__( 'Salta', 'continents-cities' );
+__( 'San Juan', 'continents-cities' );
+__( 'San Luis', 'continents-cities' );
+__( 'Tucuman', 'continents-cities' );
+__( 'Ushuaia', 'continents-cities' );
+__( 'Aruba', 'continents-cities' );
+__( 'Asuncion', 'continents-cities' );
+__( 'Atikokan', 'continents-cities' );
+__( 'Atka', 'continents-cities' );
+__( 'Bahia', 'continents-cities' );
+__( 'Bahia Banderas', 'continents-cities' );
+__( 'Barbados', 'continents-cities' );
+__( 'Belem', 'continents-cities' );
+__( 'Belize', 'continents-cities' );
+__( 'Blanc-Sablon', 'continents-cities' );
+__( 'Boa Vista', 'continents-cities' );
+__( 'Bogota', 'continents-cities' );
+__( 'Boise', 'continents-cities' );
+__( 'Buenos Aires', 'continents-cities' );
+__( 'Cambridge Bay', 'continents-cities' );
+__( 'Campo Grande', 'continents-cities' );
+__( 'Cancun', 'continents-cities' );
+__( 'Caracas', 'continents-cities' );
+__( 'Catamarca', 'continents-cities' );
+__( 'Cayenne', 'continents-cities' );
+__( 'Cayman', 'continents-cities' );
+__( 'Chicago', 'continents-cities' );
+__( 'Chihuahua', 'continents-cities' );
+__( 'Coral Harbour', 'continents-cities' );
+__( 'Cordoba', 'continents-cities' );
+__( 'Costa Rica', 'continents-cities' );
+__( 'Creston', 'continents-cities' );
+__( 'Cuiaba', 'continents-cities' );
+__( 'Curacao', 'continents-cities' );
+__( 'Danmarkshavn', 'continents-cities' );
+__( 'Dawson', 'continents-cities' );
+__( 'Dawson Creek', 'continents-cities' );
+__( 'Denver', 'continents-cities' );
+__( 'Detroit', 'continents-cities' );
+__( 'Dominica', 'continents-cities' );
+__( 'Edmonton', 'continents-cities' );
+__( 'Eirunepe', 'continents-cities' );
+__( 'El Salvador', 'continents-cities' );
+__( 'Ensenada', 'continents-cities' );
+__( 'Fort Nelson', 'continents-cities' );
+__( 'Fort Wayne', 'continents-cities' );
+__( 'Fortaleza', 'continents-cities' );
+__( 'Glace Bay', 'continents-cities' );
+__( 'Godthab', 'continents-cities' );
+__( 'Goose Bay', 'continents-cities' );
+__( 'Grand Turk', 'continents-cities' );
+__( 'Grenada', 'continents-cities' );
+__( 'Guadeloupe', 'continents-cities' );
+__( 'Guatemala', 'continents-cities' );
+__( 'Guayaquil', 'continents-cities' );
+__( 'Guyana', 'continents-cities' );
+__( 'Halifax', 'continents-cities' );
+__( 'Havana', 'continents-cities' );
+__( 'Hermosillo', 'continents-cities' );
+__( 'Indiana', 'continents-cities' );
+__( 'Indianapolis', 'continents-cities' );
+__( 'Knox', 'continents-cities' );
+__( 'Marengo', 'continents-cities' );
+__( 'Petersburg', 'continents-cities' );
+__( 'Tell City', 'continents-cities' );
+__( 'Vevay', 'continents-cities' );
+__( 'Vincennes', 'continents-cities' );
+__( 'Winamac', 'continents-cities' );
+__( 'Indianapolis', 'continents-cities' );
+__( 'Inuvik', 'continents-cities' );
+__( 'Iqaluit', 'continents-cities' );
+__( 'Jamaica', 'continents-cities' );
+__( 'Jujuy', 'continents-cities' );
+__( 'Juneau', 'continents-cities' );
+__( 'Kentucky', 'continents-cities' );
+__( 'Louisville', 'continents-cities' );
+__( 'Monticello', 'continents-cities' );
+__( 'Knox IN', 'continents-cities' );
+__( 'Kralendijk', 'continents-cities' );
+__( 'La Paz', 'continents-cities' );
+__( 'Lima', 'continents-cities' );
+__( 'Los Angeles', 'continents-cities' );
+__( 'Louisville', 'continents-cities' );
+__( 'Lower Princes', 'continents-cities' );
+__( 'Maceio', 'continents-cities' );
+__( 'Managua', 'continents-cities' );
+__( 'Manaus', 'continents-cities' );
+__( 'Marigot', 'continents-cities' );
+__( 'Martinique', 'continents-cities' );
+__( 'Matamoros', 'continents-cities' );
+__( 'Mazatlan', 'continents-cities' );
+__( 'Mendoza', 'continents-cities' );
+__( 'Menominee', 'continents-cities' );
+__( 'Merida', 'continents-cities' );
+__( 'Metlakatla', 'continents-cities' );
+__( 'Mexico City', 'continents-cities' );
+__( 'Miquelon', 'continents-cities' );
+__( 'Moncton', 'continents-cities' );
+__( 'Monterrey', 'continents-cities' );
+__( 'Montevideo', 'continents-cities' );
+__( 'Montreal', 'continents-cities' );
+__( 'Montserrat', 'continents-cities' );
+__( 'Nassau', 'continents-cities' );
+__( 'New York', 'continents-cities' );
+__( 'Nipigon', 'continents-cities' );
+__( 'Nome', 'continents-cities' );
+__( 'Noronha', 'continents-cities' );
+__( 'North Dakota', 'continents-cities' );
+__( 'Beulah', 'continents-cities' );
+__( 'Center', 'continents-cities' );
+__( 'New Salem', 'continents-cities' );
+__( 'Ojinaga', 'continents-cities' );
+__( 'Panama', 'continents-cities' );
+__( 'Pangnirtung', 'continents-cities' );
+__( 'Paramaribo', 'continents-cities' );
+__( 'Phoenix', 'continents-cities' );
+__( 'Port of Spain', 'continents-cities' );
+__( 'Port-au-Prince', 'continents-cities' );
+__( 'Porto Acre', 'continents-cities' );
+__( 'Porto Velho', 'continents-cities' );
+__( 'Puerto Rico', 'continents-cities' );
+__( 'Punta Arenas', 'continents-cities' );
+__( 'Rainy River', 'continents-cities' );
+__( 'Rankin Inlet', 'continents-cities' );
+__( 'Recife', 'continents-cities' );
+__( 'Regina', 'continents-cities' );
+__( 'Resolute', 'continents-cities' );
+__( 'Rio Branco', 'continents-cities' );
+__( 'Rosario', 'continents-cities' );
+__( 'Santa Isabel', 'continents-cities' );
+__( 'Santarem', 'continents-cities' );
+__( 'Santiago', 'continents-cities' );
+__( 'Santo Domingo', 'continents-cities' );
+__( 'Sao Paulo', 'continents-cities' );
+__( 'Scoresbysund', 'continents-cities' );
+__( 'Shiprock', 'continents-cities' );
+__( 'Sitka', 'continents-cities' );
+__( 'St Barthelemy', 'continents-cities' );
+__( 'St Johns', 'continents-cities' );
+__( 'St Kitts', 'continents-cities' );
+__( 'St Lucia', 'continents-cities' );
+__( 'St Thomas', 'continents-cities' );
+__( 'St Vincent', 'continents-cities' );
+__( 'Swift Current', 'continents-cities' );
+__( 'Tegucigalpa', 'continents-cities' );
+__( 'Thule', 'continents-cities' );
+__( 'Thunder Bay', 'continents-cities' );
+__( 'Tijuana', 'continents-cities' );
+__( 'Toronto', 'continents-cities' );
+__( 'Tortola', 'continents-cities' );
+__( 'Vancouver', 'continents-cities' );
+__( 'Virgin', 'continents-cities' );
+__( 'Whitehorse', 'continents-cities' );
+__( 'Winnipeg', 'continents-cities' );
+__( 'Yakutat', 'continents-cities' );
+__( 'Yellowknife', 'continents-cities' );
+
+__( 'Antarctica', 'continents-cities' );
+__( 'Casey', 'continents-cities' );
+__( 'Davis', 'continents-cities' );
+__( 'DumontDUrville', 'continents-cities' );
+__( 'Macquarie', 'continents-cities' );
+__( 'Mawson', 'continents-cities' );
+__( 'McMurdo', 'continents-cities' );
+__( 'Palmer', 'continents-cities' );
+__( 'Rothera', 'continents-cities' );
+__( 'South Pole', 'continents-cities' );
+__( 'Syowa', 'continents-cities' );
+__( 'Troll', 'continents-cities' );
+__( 'Vostok', 'continents-cities' );
+
+__( 'Arctic', 'continents-cities' );
+__( 'Longyearbyen', 'continents-cities' );
+
+__( 'Asia', 'continents-cities' );
+__( 'Aden', 'continents-cities' );
+__( 'Almaty', 'continents-cities' );
+__( 'Amman', 'continents-cities' );
+__( 'Anadyr', 'continents-cities' );
+__( 'Aqtau', 'continents-cities' );
+__( 'Aqtobe', 'continents-cities' );
+__( 'Ashgabat', 'continents-cities' );
+__( 'Ashkhabad', 'continents-cities' );
+__( 'Atyrau', 'continents-cities' );
+__( 'Baghdad', 'continents-cities' );
+__( 'Bahrain', 'continents-cities' );
+__( 'Baku', 'continents-cities' );
+__( 'Bangkok', 'continents-cities' );
+__( 'Barnaul', 'continents-cities' );
+__( 'Beirut', 'continents-cities' );
+__( 'Bishkek', 'continents-cities' );
+__( 'Brunei', 'continents-cities' );
+__( 'Calcutta', 'continents-cities' );
+__( 'Chita', 'continents-cities' );
+__( 'Choibalsan', 'continents-cities' );
+__( 'Chongqing', 'continents-cities' );
+__( 'Chungking', 'continents-cities' );
+__( 'Colombo', 'continents-cities' );
+__( 'Dacca', 'continents-cities' );
+__( 'Damascus', 'continents-cities' );
+__( 'Dhaka', 'continents-cities' );
+__( 'Dili', 'continents-cities' );
+__( 'Dubai', 'continents-cities' );
+__( 'Dushanbe', 'continents-cities' );
+__( 'Famagusta', 'continents-cities' );
+__( 'Gaza', 'continents-cities' );
+__( 'Harbin', 'continents-cities' );
+__( 'Hebron', 'continents-cities' );
+__( 'Ho Chi Minh', 'continents-cities' );
+__( 'Hong Kong', 'continents-cities' );
+__( 'Hovd', 'continents-cities' );
+__( 'Irkutsk', 'continents-cities' );
+__( 'Istanbul', 'continents-cities' );
+__( 'Jakarta', 'continents-cities' );
+__( 'Jayapura', 'continents-cities' );
+__( 'Jerusalem', 'continents-cities' );
+__( 'Kabul', 'continents-cities' );
+__( 'Kamchatka', 'continents-cities' );
+__( 'Karachi', 'continents-cities' );
+__( 'Kashgar', 'continents-cities' );
+__( 'Kathmandu', 'continents-cities' );
+__( 'Katmandu', 'continents-cities' );
+__( 'Khandyga', 'continents-cities' );
+__( 'Kolkata', 'continents-cities' );
+__( 'Krasnoyarsk', 'continents-cities' );
+__( 'Kuala Lumpur', 'continents-cities' );
+__( 'Kuching', 'continents-cities' );
+__( 'Kuwait', 'continents-cities' );
+__( 'Macao', 'continents-cities' );
+__( 'Macau', 'continents-cities' );
+__( 'Magadan', 'continents-cities' );
+__( 'Makassar', 'continents-cities' );
+__( 'Manila', 'continents-cities' );
+__( 'Muscat', 'continents-cities' );
+__( 'Nicosia', 'continents-cities' );
+__( 'Novokuznetsk', 'continents-cities' );
+__( 'Novosibirsk', 'continents-cities' );
+__( 'Omsk', 'continents-cities' );
+__( 'Oral', 'continents-cities' );
+__( 'Phnom Penh', 'continents-cities' );
+__( 'Pontianak', 'continents-cities' );
+__( 'Pyongyang', 'continents-cities' );
+__( 'Qatar', 'continents-cities' );
+__( 'Qyzylorda', 'continents-cities' );
+__( 'Rangoon', 'continents-cities' );
+__( 'Riyadh', 'continents-cities' );
+__( 'Saigon', 'continents-cities' );
+__( 'Sakhalin', 'continents-cities' );
+__( 'Samarkand', 'continents-cities' );
+__( 'Seoul', 'continents-cities' );
+__( 'Shanghai', 'continents-cities' );
+__( 'Singapore', 'continents-cities' );
+__( 'Srednekolymsk', 'continents-cities' );
+__( 'Taipei', 'continents-cities' );
+__( 'Tashkent', 'continents-cities' );
+__( 'Tbilisi', 'continents-cities' );
+__( 'Tehran', 'continents-cities' );
+__( 'Tel Aviv', 'continents-cities' );
+__( 'Thimbu', 'continents-cities' );
+__( 'Thimphu', 'continents-cities' );
+__( 'Tokyo', 'continents-cities' );
+__( 'Tomsk', 'continents-cities' );
+__( 'Ujung Pandang', 'continents-cities' );
+__( 'Ulaanbaatar', 'continents-cities' );
+__( 'Ulan Bator', 'continents-cities' );
+__( 'Urumqi', 'continents-cities' );
+__( 'Ust-Nera', 'continents-cities' );
+__( 'Vientiane', 'continents-cities' );
+__( 'Vladivostok', 'continents-cities' );
+__( 'Yakutsk', 'continents-cities' );
+__( 'Yangon', 'continents-cities' );
+__( 'Yekaterinburg', 'continents-cities' );
+__( 'Yerevan', 'continents-cities' );
+
+__( 'Atlantic', 'continents-cities' );
+__( 'Azores', 'continents-cities' );
+__( 'Bermuda', 'continents-cities' );
+__( 'Canary', 'continents-cities' );
+__( 'Cape Verde', 'continents-cities' );
+__( 'Faeroe', 'continents-cities' );
+__( 'Faroe', 'continents-cities' );
+__( 'Jan Mayen', 'continents-cities' );
+__( 'Madeira', 'continents-cities' );
+__( 'Reykjavik', 'continents-cities' );
+__( 'South Georgia', 'continents-cities' );
+__( 'St Helena', 'continents-cities' );
+__( 'Stanley', 'continents-cities' );
+
+__( 'Australia', 'continents-cities' );
+__( 'ACT', 'continents-cities' );
+__( 'Adelaide', 'continents-cities' );
+__( 'Brisbane', 'continents-cities' );
+__( 'Broken Hill', 'continents-cities' );
+__( 'Canberra', 'continents-cities' );
+__( 'Currie', 'continents-cities' );
+__( 'Darwin', 'continents-cities' );
+__( 'Eucla', 'continents-cities' );
+__( 'Hobart', 'continents-cities' );
+__( 'LHI', 'continents-cities' );
+__( 'Lindeman', 'continents-cities' );
+__( 'Lord Howe', 'continents-cities' );
+__( 'Melbourne', 'continents-cities' );
+__( 'NSW', 'continents-cities' );
+__( 'North', 'continents-cities' );
+__( 'Perth', 'continents-cities' );
+__( 'Queensland', 'continents-cities' );
+__( 'South', 'continents-cities' );
+__( 'Sydney', 'continents-cities' );
+__( 'Tasmania', 'continents-cities' );
+__( 'Victoria', 'continents-cities' );
+__( 'West', 'continents-cities' );
+__( 'Yancowinna', 'continents-cities' );
+
+__( 'Etc', 'continents-cities' );
+__( 'GMT', 'continents-cities' );
+__( 'GMT+0', 'continents-cities' );
+__( 'GMT+1', 'continents-cities' );
+__( 'GMT+10', 'continents-cities' );
+__( 'GMT+11', 'continents-cities' );
+__( 'GMT+12', 'continents-cities' );
+__( 'GMT+2', 'continents-cities' );
+__( 'GMT+3', 'continents-cities' );
+__( 'GMT+4', 'continents-cities' );
+__( 'GMT+5', 'continents-cities' );
+__( 'GMT+6', 'continents-cities' );
+__( 'GMT+7', 'continents-cities' );
+__( 'GMT+8', 'continents-cities' );
+__( 'GMT+9', 'continents-cities' );
+__( 'GMT-0', 'continents-cities' );
+__( 'GMT-1', 'continents-cities' );
+__( 'GMT-10', 'continents-cities' );
+__( 'GMT-11', 'continents-cities' );
+__( 'GMT-12', 'continents-cities' );
+__( 'GMT-13', 'continents-cities' );
+__( 'GMT-14', 'continents-cities' );
+__( 'GMT-2', 'continents-cities' );
+__( 'GMT-3', 'continents-cities' );
+__( 'GMT-4', 'continents-cities' );
+__( 'GMT-5', 'continents-cities' );
+__( 'GMT-6', 'continents-cities' );
+__( 'GMT-7', 'continents-cities' );
+__( 'GMT-8', 'continents-cities' );
+__( 'GMT-9', 'continents-cities' );
+__( 'GMT0', 'continents-cities' );
+__( 'Greenwich', 'continents-cities' );
+__( 'UCT', 'continents-cities' );
+__( 'UTC', 'continents-cities' );
+__( 'Universal', 'continents-cities' );
+__( 'Zulu', 'continents-cities' );
+
+__( 'Europe', 'continents-cities' );
+__( 'Amsterdam', 'continents-cities' );
+__( 'Andorra', 'continents-cities' );
+__( 'Astrakhan', 'continents-cities' );
+__( 'Athens', 'continents-cities' );
+__( 'Belfast', 'continents-cities' );
+__( 'Belgrade', 'continents-cities' );
+__( 'Berlin', 'continents-cities' );
+__( 'Bratislava', 'continents-cities' );
+__( 'Brussels', 'continents-cities' );
+__( 'Bucharest', 'continents-cities' );
+__( 'Budapest', 'continents-cities' );
+__( 'Busingen', 'continents-cities' );
+__( 'Chisinau', 'continents-cities' );
+__( 'Copenhagen', 'continents-cities' );
+__( 'Dublin', 'continents-cities' );
+__( 'Gibraltar', 'continents-cities' );
+__( 'Guernsey', 'continents-cities' );
+__( 'Helsinki', 'continents-cities' );
+__( 'Isle of Man', 'continents-cities' );
+__( 'Istanbul', 'continents-cities' );
+__( 'Jersey', 'continents-cities' );
+__( 'Kaliningrad', 'continents-cities' );
+__( 'Kiev', 'continents-cities' );
+__( 'Kirov', 'continents-cities' );
+__( 'Lisbon', 'continents-cities' );
+__( 'Ljubljana', 'continents-cities' );
+__( 'London', 'continents-cities' );
+__( 'Luxembourg', 'continents-cities' );
+__( 'Madrid', 'continents-cities' );
+__( 'Malta', 'continents-cities' );
+__( 'Mariehamn', 'continents-cities' );
+__( 'Minsk', 'continents-cities' );
+__( 'Monaco', 'continents-cities' );
+__( 'Moscow', 'continents-cities' );
+__( 'Nicosia', 'continents-cities' );
+__( 'Oslo', 'continents-cities' );
+__( 'Paris', 'continents-cities' );
+__( 'Podgorica', 'continents-cities' );
+__( 'Prague', 'continents-cities' );
+__( 'Riga', 'continents-cities' );
+__( 'Rome', 'continents-cities' );
+__( 'Samara', 'continents-cities' );
+__( 'San Marino', 'continents-cities' );
+__( 'Sarajevo', 'continents-cities' );
+__( 'Saratov', 'continents-cities' );
+__( 'Simferopol', 'continents-cities' );
+__( 'Skopje', 'continents-cities' );
+__( 'Sofia', 'continents-cities' );
+__( 'Stockholm', 'continents-cities' );
+__( 'Tallinn', 'continents-cities' );
+__( 'Tirane', 'continents-cities' );
+__( 'Tiraspol', 'continents-cities' );
+__( 'Ulyanovsk', 'continents-cities' );
+__( 'Uzhgorod', 'continents-cities' );
+__( 'Vaduz', 'continents-cities' );
+__( 'Vatican', 'continents-cities' );
+__( 'Vienna', 'continents-cities' );
+__( 'Vilnius', 'continents-cities' );
+__( 'Volgograd', 'continents-cities' );
+__( 'Warsaw', 'continents-cities' );
+__( 'Zagreb', 'continents-cities' );
+__( 'Zaporozhye', 'continents-cities' );
+__( 'Zurich', 'continents-cities' );
+
+__( 'Indian', 'continents-cities' );
+__( 'Antananarivo', 'continents-cities' );
+__( 'Chagos', 'continents-cities' );
+__( 'Christmas', 'continents-cities' );
+__( 'Cocos', 'continents-cities' );
+__( 'Comoro', 'continents-cities' );
+__( 'Kerguelen', 'continents-cities' );
+__( 'Mahe', 'continents-cities' );
+__( 'Maldives', 'continents-cities' );
+__( 'Mauritius', 'continents-cities' );
+__( 'Mayotte', 'continents-cities' );
+__( 'Reunion', 'continents-cities' );
+
+__( 'Pacific', 'continents-cities' );
+__( 'Apia', 'continents-cities' );
+__( 'Auckland', 'continents-cities' );
+__( 'Bougainville', 'continents-cities' );
+__( 'Chatham', 'continents-cities' );
+__( 'Chuuk', 'continents-cities' );
+__( 'Easter', 'continents-cities' );
+__( 'Efate', 'continents-cities' );
+__( 'Enderbury', 'continents-cities' );
+__( 'Fakaofo', 'continents-cities' );
+__( 'Fiji', 'continents-cities' );
+__( 'Funafuti', 'continents-cities' );
+__( 'Galapagos', 'continents-cities' );
+__( 'Gambier', 'continents-cities' );
+__( 'Guadalcanal', 'continents-cities' );
+__( 'Guam', 'continents-cities' );
+__( 'Honolulu', 'continents-cities' );
+__( 'Johnston', 'continents-cities' );
+__( 'Kiritimati', 'continents-cities' );
+__( 'Kosrae', 'continents-cities' );
+__( 'Kwajalein', 'continents-cities' );
+__( 'Majuro', 'continents-cities' );
+__( 'Marquesas', 'continents-cities' );
+__( 'Midway', 'continents-cities' );
+__( 'Nauru', 'continents-cities' );
+__( 'Niue', 'continents-cities' );
+__( 'Norfolk', 'continents-cities' );
+__( 'Noumea', 'continents-cities' );
+__( 'Pago Pago', 'continents-cities' );
+__( 'Palau', 'continents-cities' );
+__( 'Pitcairn', 'continents-cities' );
+__( 'Pohnpei', 'continents-cities' );
+__( 'Ponape', 'continents-cities' );
+__( 'Port Moresby', 'continents-cities' );
+__( 'Rarotonga', 'continents-cities' );
+__( 'Saipan', 'continents-cities' );
+__( 'Samoa', 'continents-cities' );
+__( 'Tahiti', 'continents-cities' );
+__( 'Tarawa', 'continents-cities' );
+__( 'Tongatapu', 'continents-cities' );
+__( 'Truk', 'continents-cities' );
+__( 'Wake', 'continents-cities' );
+__( 'Wallis', 'continents-cities' );
+__( 'Yap', 'continents-cities' );
diff --git a/www/crm/wp-admin/includes/credits.php b/www/crm/wp-admin/includes/credits.php
new file mode 100644
index 00000000..d558e9c8
--- /dev/null
+++ b/www/crm/wp-admin/includes/credits.php
@@ -0,0 +1,78 @@
+<?php
+/**
+ * WordPress Credits Administration API.
+ *
+ * @package WordPress
+ * @subpackage Administration
+ * @since 4.4.0
+ */
+
+/**
+ * Retrieve the contributor credits.
+ *
+ * @since 3.2.0
+ *
+ * @return array|false A list of all of the contributors, or false on error.
+ */
+function wp_credits() {
+ // include an unmodified $wp_version
+ include( ABSPATH . WPINC . '/version.php' );
+
+ $locale = get_user_locale();
+
+ $results = get_site_transient( 'wordpress_credits_' . $locale );
+
+ if ( ! is_array( $results )
+ || false !== strpos( $wp_version, '-' )
+ || ( isset( $results['data']['version'] ) && strpos( $wp_version, $results['data']['version'] ) !== 0 )
+ ) {
+ $url = "http://api.wordpress.org/core/credits/1.1/?version={$wp_version}&locale={$locale}";
+ $options = array( 'user-agent' => 'WordPress/' . $wp_version . '; ' . home_url( '/' ) );
+
+ if ( wp_http_supports( array( 'ssl' ) ) ) {
+ $url = set_url_scheme( $url, 'https' );
+ }
+
+ $response = wp_remote_get( $url, $options );
+
+ if ( is_wp_error( $response ) || 200 != wp_remote_retrieve_response_code( $response ) ) {
+ return false;
+ }
+
+ $results = json_decode( wp_remote_retrieve_body( $response ), true );
+
+ if ( ! is_array( $results ) ) {
+ return false;
+ }
+
+ set_site_transient( 'wordpress_credits_' . $locale, $results, DAY_IN_SECONDS );
+ }
+
+ return $results;
+}
+
+/**
+ * Retrieve the link to a contributor's WordPress.org profile page.
+ *
+ * @access private
+ * @since 3.2.0
+ *
+ * @param string $display_name The contributor's display name (passed by reference).
+ * @param string $username The contributor's username.
+ * @param string $profiles URL to the contributor's WordPress.org profile page.
+ */
+function _wp_credits_add_profile_link( &$display_name, $username, $profiles ) {
+ $display_name = '<a href="' . esc_url( sprintf( $profiles, $username ) ) . '">' . esc_html( $display_name ) . '</a>';
+}
+
+/**
+ * Retrieve the link to an external library used in WordPress.
+ *
+ * @access private
+ * @since 3.2.0
+ *
+ * @param string $data External library data (passed by reference).
+ */
+function _wp_credits_build_object_link( &$data ) {
+ $data = '<a href="' . esc_url( $data[1] ) . '">' . esc_html( $data[0] ) . '</a>';
+}
diff --git a/www/crm/wp-admin/includes/dashboard.php b/www/crm/wp-admin/includes/dashboard.php
new file mode 100644
index 00000000..ad02909c
--- /dev/null
+++ b/www/crm/wp-admin/includes/dashboard.php
@@ -0,0 +1,1742 @@
+<?php
+/**
+ * WordPress Dashboard Widget Administration Screen API
+ *
+ * @package WordPress
+ * @subpackage Administration
+ */
+
+/**
+ * Registers dashboard widgets.
+ *
+ * Handles POST data, sets up filters.
+ *
+ * @since 2.5.0
+ *
+ * @global array $wp_registered_widgets
+ * @global array $wp_registered_widget_controls
+ * @global array $wp_dashboard_control_callbacks
+ */
+function wp_dashboard_setup() {
+ global $wp_registered_widgets, $wp_registered_widget_controls, $wp_dashboard_control_callbacks;
+ $wp_dashboard_control_callbacks = array();
+ $screen = get_current_screen();
+
+ /* Register Widgets and Controls */
+
+ $response = wp_check_browser_version();
+
+ if ( $response && $response['upgrade'] ) {
+ add_filter( 'postbox_classes_dashboard_dashboard_browser_nag', 'dashboard_browser_nag_class' );
+ if ( $response['insecure'] ) {
+ wp_add_dashboard_widget( 'dashboard_browser_nag', __( 'You are using an insecure browser!' ), 'wp_dashboard_browser_nag' );
+ } else {
+ wp_add_dashboard_widget( 'dashboard_browser_nag', __( 'Your browser is out of date!' ), 'wp_dashboard_browser_nag' );
+ }
+ }
+
+ // PHP Version.
+ $response = wp_check_php_version();
+ if ( $response && isset( $response['is_acceptable'] ) && ! $response['is_acceptable'] && current_user_can( 'update_php' ) ) {
+ add_filter( 'postbox_classes_dashboard_dashboard_php_nag', 'dashboard_php_nag_class' );
+ wp_add_dashboard_widget( 'dashboard_php_nag', __( 'PHP Update Required' ), 'wp_dashboard_php_nag' );
+ }
+
+ // Right Now
+ if ( is_blog_admin() && current_user_can( 'edit_posts' ) ) {
+ wp_add_dashboard_widget( 'dashboard_right_now', __( 'At a Glance' ), 'wp_dashboard_right_now' );
+ }
+
+ if ( is_network_admin() ) {
+ wp_add_dashboard_widget( 'network_dashboard_right_now', __( 'Right Now' ), 'wp_network_dashboard_right_now' );
+ }
+
+ // Activity Widget
+ if ( is_blog_admin() ) {
+ wp_add_dashboard_widget( 'dashboard_activity', __( 'Activity' ), 'wp_dashboard_site_activity' );
+ }
+
+ // QuickPress Widget
+ if ( is_blog_admin() && current_user_can( get_post_type_object( 'post' )->cap->create_posts ) ) {
+ $quick_draft_title = sprintf( '<span class="hide-if-no-js">%1$s</span> <span class="hide-if-js">%2$s</span>', __( 'Quick Draft' ), __( 'Your Recent Drafts' ) );
+ wp_add_dashboard_widget( 'dashboard_quick_press', $quick_draft_title, 'wp_dashboard_quick_press' );
+ }
+
+ // WordPress Events and News
+ wp_add_dashboard_widget( 'dashboard_primary', __( 'WordPress Events and News' ), 'wp_dashboard_events_news' );
+
+ if ( is_network_admin() ) {
+
+ /**
+ * Fires after core widgets for the Network Admin dashboard have been registered.
+ *
+ * @since 3.1.0
+ */
+ do_action( 'wp_network_dashboard_setup' );
+
+ /**
+ * Filters the list of widgets to load for the Network Admin dashboard.
+ *
+ * @since 3.1.0
+ *
+ * @param string[] $dashboard_widgets An array of dashboard widget IDs.
+ */
+ $dashboard_widgets = apply_filters( 'wp_network_dashboard_widgets', array() );
+ } elseif ( is_user_admin() ) {
+
+ /**
+ * Fires after core widgets for the User Admin dashboard have been registered.
+ *
+ * @since 3.1.0
+ */
+ do_action( 'wp_user_dashboard_setup' );
+
+ /**
+ * Filters the list of widgets to load for the User Admin dashboard.
+ *
+ * @since 3.1.0
+ *
+ * @param string[] $dashboard_widgets An array of dashboard widget IDs.
+ */
+ $dashboard_widgets = apply_filters( 'wp_user_dashboard_widgets', array() );
+ } else {
+
+ /**
+ * Fires after core widgets for the admin dashboard have been registered.
+ *
+ * @since 2.5.0
+ */
+ do_action( 'wp_dashboard_setup' );
+
+ /**
+ * Filters the list of widgets to load for the admin dashboard.
+ *
+ * @since 2.5.0
+ *
+ * @param string[] $dashboard_widgets An array of dashboard widget IDs.
+ */
+ $dashboard_widgets = apply_filters( 'wp_dashboard_widgets', array() );
+ }
+
+ foreach ( $dashboard_widgets as $widget_id ) {
+ $name = empty( $wp_registered_widgets[ $widget_id ]['all_link'] ) ? $wp_registered_widgets[ $widget_id ]['name'] : $wp_registered_widgets[ $widget_id ]['name'] . " <a href='{$wp_registered_widgets[$widget_id]['all_link']}' class='edit-box open-box'>" . __( 'View all' ) . '</a>';
+ wp_add_dashboard_widget( $widget_id, $name, $wp_registered_widgets[ $widget_id ]['callback'], $wp_registered_widget_controls[ $widget_id ]['callback'] );
+ }
+
+ if ( 'POST' == $_SERVER['REQUEST_METHOD'] && isset( $_POST['widget_id'] ) ) {
+ check_admin_referer( 'edit-dashboard-widget_' . $_POST['widget_id'], 'dashboard-widget-nonce' );
+ ob_start(); // hack - but the same hack wp-admin/widgets.php uses
+ wp_dashboard_trigger_widget_control( $_POST['widget_id'] );
+ ob_end_clean();
+ wp_redirect( remove_query_arg( 'edit' ) );
+ exit;
+ }
+
+ /** This action is documented in wp-admin/includes/meta-boxes.php */
+ do_action( 'do_meta_boxes', $screen->id, 'normal', '' );
+
+ /** This action is documented in wp-admin/includes/meta-boxes.php */
+ do_action( 'do_meta_boxes', $screen->id, 'side', '' );
+}
+
+/**
+ * Adds a new dashboard widget.
+ *
+ * @since 2.7.0
+ *
+ * @global array $wp_dashboard_control_callbacks
+ *
+ * @param string $widget_id Widget ID (used in the 'id' attribute for the widget).
+ * @param string $widget_name Title of the widget.
+ * @param callable $callback Function that fills the widget with the desired content.
+ * The function should echo its output.
+ * @param callable $control_callback Optional. Function that outputs controls for the widget. Default null.
+ * @param array $callback_args Optional. Data that should be set as the $args property of the widget array
+ * (which is the second parameter passed to your callback). Default null.
+ */
+function wp_add_dashboard_widget( $widget_id, $widget_name, $callback, $control_callback = null, $callback_args = null ) {
+ $screen = get_current_screen();
+ global $wp_dashboard_control_callbacks;
+
+ $private_callback_args = array( '__widget_basename' => $widget_name );
+
+ if ( is_null( $callback_args ) ) {
+ $callback_args = $private_callback_args;
+ } elseif ( is_array( $callback_args ) ) {
+ $callback_args = array_merge( $callback_args, $private_callback_args );
+ }
+
+ if ( $control_callback && current_user_can( 'edit_dashboard' ) && is_callable( $control_callback ) ) {
+ $wp_dashboard_control_callbacks[ $widget_id ] = $control_callback;
+ if ( isset( $_GET['edit'] ) && $widget_id == $_GET['edit'] ) {
+ list($url) = explode( '#', add_query_arg( 'edit', false ), 2 );
+ $widget_name .= ' <span class="postbox-title-action"><a href="' . esc_url( $url ) . '">' . __( 'Cancel' ) . '</a></span>';
+ $callback = '_wp_dashboard_control_callback';
+ } else {
+ list($url) = explode( '#', add_query_arg( 'edit', $widget_id ), 2 );
+ $widget_name .= ' <span class="postbox-title-action"><a href="' . esc_url( "$url#$widget_id" ) . '" class="edit-box open-box">' . __( 'Configure' ) . '</a></span>';
+ }
+ }
+
+ $side_widgets = array( 'dashboard_quick_press', 'dashboard_primary' );
+
+ $location = 'normal';
+ if ( in_array( $widget_id, $side_widgets ) ) {
+ $location = 'side';
+ }
+
+ $high_priority_widgets = array( 'dashboard_browser_nag', 'dashboard_php_nag' );
+
+ $priority = 'core';
+ if ( in_array( $widget_id, $high_priority_widgets, true ) ) {
+ $priority = 'high';
+ }
+
+ add_meta_box( $widget_id, $widget_name, $callback, $screen, $location, $priority, $callback_args );
+}
+
+/**
+ * Outputs controls for the current dashboard widget.
+ *
+ * @access private
+ * @since 2.7.0
+ *
+ * @param mixed $dashboard
+ * @param array $meta_box
+ */
+function _wp_dashboard_control_callback( $dashboard, $meta_box ) {
+ echo '<form method="post" class="dashboard-widget-control-form wp-clearfix">';
+ wp_dashboard_trigger_widget_control( $meta_box['id'] );
+ wp_nonce_field( 'edit-dashboard-widget_' . $meta_box['id'], 'dashboard-widget-nonce' );
+ echo '<input type="hidden" name="widget_id" value="' . esc_attr( $meta_box['id'] ) . '" />';
+ submit_button( __( 'Submit' ) );
+ echo '</form>';
+}
+
+/**
+ * Displays the dashboard.
+ *
+ * @since 2.5.0
+ */
+function wp_dashboard() {
+ $screen = get_current_screen();
+ $columns = absint( $screen->get_columns() );
+ $columns_css = '';
+ if ( $columns ) {
+ $columns_css = " columns-$columns";
+ }
+
+ ?>
+<div id="dashboard-widgets" class="metabox-holder<?php echo $columns_css; ?>">
+ <div id="postbox-container-1" class="postbox-container">
+ <?php do_meta_boxes( $screen->id, 'normal', '' ); ?>
+ </div>
+ <div id="postbox-container-2" class="postbox-container">
+ <?php do_meta_boxes( $screen->id, 'side', '' ); ?>
+ </div>
+ <div id="postbox-container-3" class="postbox-container">
+ <?php do_meta_boxes( $screen->id, 'column3', '' ); ?>
+ </div>
+ <div id="postbox-container-4" class="postbox-container">
+ <?php do_meta_boxes( $screen->id, 'column4', '' ); ?>
+ </div>
+</div>
+
+ <?php
+ wp_nonce_field( 'closedpostboxes', 'closedpostboxesnonce', false );
+ wp_nonce_field( 'meta-box-order', 'meta-box-order-nonce', false );
+
+}
+
+//
+// Dashboard Widgets
+//
+
+/**
+ * Dashboard widget that displays some basic stats about the site.
+ *
+ * Formerly 'Right Now'. A streamlined 'At a Glance' as of 3.8.
+ *
+ * @since 2.7.0
+ */
+function wp_dashboard_right_now() {
+ ?>
+ <div class="main">
+ <ul>
+ <?php
+ // Posts and Pages
+ foreach ( array( 'post', 'page' ) as $post_type ) {
+ $num_posts = wp_count_posts( $post_type );
+ if ( $num_posts && $num_posts->publish ) {
+ if ( 'post' == $post_type ) {
+ $text = _n( '%s Post', '%s Posts', $num_posts->publish );
+ } else {
+ $text = _n( '%s Page', '%s Pages', $num_posts->publish );
+ }
+ $text = sprintf( $text, number_format_i18n( $num_posts->publish ) );
+ $post_type_object = get_post_type_object( $post_type );
+ if ( $post_type_object && current_user_can( $post_type_object->cap->edit_posts ) ) {
+ printf( '<li class="%1$s-count"><a href="edit.php?post_type=%1$s">%2$s</a></li>', $post_type, $text );
+ } else {
+ printf( '<li class="%1$s-count"><span>%2$s</span></li>', $post_type, $text );
+ }
+ }
+ }
+ // Comments
+ $num_comm = wp_count_comments();
+ if ( $num_comm && ( $num_comm->approved || $num_comm->moderated ) ) {
+ $text = sprintf( _n( '%s Comment', '%s Comments', $num_comm->approved ), number_format_i18n( $num_comm->approved ) );
+ ?>
+ <li class="comment-count"><a href="edit-comments.php"><?php echo $text; ?></a></li>
+ <?php
+ $moderated_comments_count_i18n = number_format_i18n( $num_comm->moderated );
+ /* translators: %s: number of comments in moderation */
+ $text = sprintf( _n( '%s Comment in moderation', '%s Comments in moderation', $num_comm->moderated ), $moderated_comments_count_i18n );
+ ?>
+ <li class="comment-mod-count
+ <?php
+ if ( ! $num_comm->moderated ) {
+ echo ' hidden';
+ }
+ ?>
+ "><a href="edit-comments.php?comment_status=moderated" class="comments-in-moderation-text"><?php echo $text; ?></a></li>
+ <?php
+ }
+
+ /**
+ * Filters the array of extra elements to list in the 'At a Glance'
+ * dashboard widget.
+ *
+ * Prior to 3.8.0, the widget was named 'Right Now'. Each element
+ * is wrapped in list-item tags on output.
+ *
+ * @since 3.8.0
+ *
+ * @param string[] $items Array of extra 'At a Glance' widget items.
+ */
+ $elements = apply_filters( 'dashboard_glance_items', array() );
+
+ if ( $elements ) {
+ echo '<li>' . implode( "</li>\n<li>", $elements ) . "</li>\n";
+ }
+
+ ?>
+ </ul>
+ <?php
+ update_right_now_message();
+
+ // Check if search engines are asked not to index this site.
+ if ( ! is_network_admin() && ! is_user_admin() && current_user_can( 'manage_options' ) && '0' == get_option( 'blog_public' ) ) {
+
+ /**
+ * Filters the link title attribute for the 'Search Engines Discouraged'
+ * message displayed in the 'At a Glance' dashboard widget.
+ *
+ * Prior to 3.8.0, the widget was named 'Right Now'.
+ *
+ * @since 3.0.0
+ * @since 4.5.0 The default for `$title` was updated to an empty string.
+ *
+ * @param string $title Default attribute text.
+ */
+ $title = apply_filters( 'privacy_on_link_title', '' );
+
+ /**
+ * Filters the link label for the 'Search Engines Discouraged' message
+ * displayed in the 'At a Glance' dashboard widget.
+ *
+ * Prior to 3.8.0, the widget was named 'Right Now'.
+ *
+ * @since 3.0.0
+ *
+ * @param string $content Default text.
+ */
+ $content = apply_filters( 'privacy_on_link_text', __( 'Search Engines Discouraged' ) );
+ $title_attr = '' === $title ? '' : " title='$title'";
+
+ echo "<p><a href='options-reading.php'$title_attr>$content</a></p>";
+ }
+ ?>
+ </div>
+ <?php
+ /*
+ * activity_box_end has a core action, but only prints content when multisite.
+ * Using an output buffer is the only way to really check if anything's displayed here.
+ */
+ ob_start();
+
+ /**
+ * Fires at the end of the 'At a Glance' dashboard widget.
+ *
+ * Prior to 3.8.0, the widget was named 'Right Now'.
+ *
+ * @since 2.5.0
+ */
+ do_action( 'rightnow_end' );
+
+ /**
+ * Fires at the end of the 'At a Glance' dashboard widget.
+ *
+ * Prior to 3.8.0, the widget was named 'Right Now'.
+ *
+ * @since 2.0.0
+ */
+ do_action( 'activity_box_end' );
+
+ $actions = ob_get_clean();
+
+ if ( ! empty( $actions ) ) :
+ ?>
+ <div class="sub">
+ <?php echo $actions; ?>
+ </div>
+ <?php
+ endif;
+}
+
+/**
+ * @since 3.1.0
+ */
+function wp_network_dashboard_right_now() {
+ $actions = array();
+ if ( current_user_can( 'create_sites' ) ) {
+ $actions['create-site'] = '<a href="' . network_admin_url( 'site-new.php' ) . '">' . __( 'Create a New Site' ) . '</a>';
+ }
+ if ( current_user_can( 'create_users' ) ) {
+ $actions['create-user'] = '<a href="' . network_admin_url( 'user-new.php' ) . '">' . __( 'Create a New User' ) . '</a>';
+ }
+
+ $c_users = get_user_count();
+ $c_blogs = get_blog_count();
+
+ /* translators: %s: number of users on the network */
+ $user_text = sprintf( _n( '%s user', '%s users', $c_users ), number_format_i18n( $c_users ) );
+ /* translators: %s: number of sites on the network */
+ $blog_text = sprintf( _n( '%s site', '%s sites', $c_blogs ), number_format_i18n( $c_blogs ) );
+
+ /* translators: 1: text indicating the number of sites on the network, 2: text indicating the number of users on the network */
+ $sentence = sprintf( __( 'You have %1$s and %2$s.' ), $blog_text, $user_text );
+
+ if ( $actions ) {
+ echo '<ul class="subsubsub">';
+ foreach ( $actions as $class => $action ) {
+ $actions[ $class ] = "\t<li class='$class'>$action";
+ }
+ echo implode( " |</li>\n", $actions ) . "</li>\n";
+ echo '</ul>';
+ }
+ ?>
+ <br class="clear" />
+
+ <p class="youhave"><?php echo $sentence; ?></p>
+
+
+ <?php
+ /**
+ * Fires in the Network Admin 'Right Now' dashboard widget
+ * just before the user and site search form fields.
+ *
+ * @since MU (3.0.0)
+ */
+ do_action( 'wpmuadminresult' );
+ ?>
+
+ <form action="<?php echo network_admin_url( 'users.php' ); ?>" method="get">
+ <p>
+ <label class="screen-reader-text" for="search-users"><?php _e( 'Search Users' ); ?></label>
+ <input type="search" name="s" value="" size="30" autocomplete="off" id="search-users"/>
+ <?php submit_button( __( 'Search Users' ), '', false, false, array( 'id' => 'submit_users' ) ); ?>
+ </p>
+ </form>
+
+ <form action="<?php echo network_admin_url( 'sites.php' ); ?>" method="get">
+ <p>
+ <label class="screen-reader-text" for="search-sites"><?php _e( 'Search Sites' ); ?></label>
+ <input type="search" name="s" value="" size="30" autocomplete="off" id="search-sites"/>
+ <?php submit_button( __( 'Search Sites' ), '', false, false, array( 'id' => 'submit_sites' ) ); ?>
+ </p>
+ </form>
+ <?php
+ /**
+ * Fires at the end of the 'Right Now' widget in the Network Admin dashboard.
+ *
+ * @since MU (3.0.0)
+ */
+ do_action( 'mu_rightnow_end' );
+
+ /**
+ * Fires at the end of the 'Right Now' widget in the Network Admin dashboard.
+ *
+ * @since MU (3.0.0)
+ */
+ do_action( 'mu_activity_box_end' );
+}
+
+/**
+ * The Quick Draft widget display and creation of drafts.
+ *
+ * @since 3.8.0
+ *
+ * @global int $post_ID
+ *
+ * @param string $error_msg Optional. Error message. Default false.
+ */
+function wp_dashboard_quick_press( $error_msg = false ) {
+ global $post_ID;
+
+ if ( ! current_user_can( 'edit_posts' ) ) {
+ return;
+ }
+
+ /* Check if a new auto-draft (= no new post_ID) is needed or if the old can be used */
+ $last_post_id = (int) get_user_option( 'dashboard_quick_press_last_post_id' ); // Get the last post_ID
+ if ( $last_post_id ) {
+ $post = get_post( $last_post_id );
+ if ( empty( $post ) || $post->post_status != 'auto-draft' ) { // auto-draft doesn't exists anymore
+ $post = get_default_post_to_edit( 'post', true );
+ update_user_option( get_current_user_id(), 'dashboard_quick_press_last_post_id', (int) $post->ID ); // Save post_ID
+ } else {
+ $post->post_title = ''; // Remove the auto draft title
+ }
+ } else {
+ $post = get_default_post_to_edit( 'post', true );
+ $user_id = get_current_user_id();
+ // Don't create an option if this is a super admin who does not belong to this site.
+ if ( in_array( get_current_blog_id(), array_keys( get_blogs_of_user( $user_id ) ) ) ) {
+ update_user_option( $user_id, 'dashboard_quick_press_last_post_id', (int) $post->ID ); // Save post_ID
+ }
+ }
+
+ $post_ID = (int) $post->ID;
+ ?>
+
+ <form name="post" action="<?php echo esc_url( admin_url( 'post.php' ) ); ?>" method="post" id="quick-press" class="initial-form hide-if-no-js">
+
+ <?php if ( $error_msg ) : ?>
+ <div class="error"><?php echo $error_msg; ?></div>
+ <?php endif; ?>
+
+ <div class="input-text-wrap" id="title-wrap">
+ <label for="title">
+ <?php
+ /** This filter is documented in wp-admin/edit-form-advanced.php */
+ echo apply_filters( 'enter_title_here', __( 'Title' ), $post );
+ ?>
+ </label>
+ <input type="text" name="post_title" id="title" autocomplete="off" />
+ </div>
+
+ <div class="textarea-wrap" id="description-wrap">
+ <label for="content"><?php _e( 'Content' ); ?></label>
+ <textarea name="content" id="content" placeholder="<?php esc_attr_e( 'What&#8217;s on your mind?' ); ?>" class="mceEditor" rows="3" cols="15" autocomplete="off"></textarea>
+ </div>
+
+ <p class="submit">
+ <input type="hidden" name="action" id="quickpost-action" value="post-quickdraft-save" />
+ <input type="hidden" name="post_ID" value="<?php echo $post_ID; ?>" />
+ <input type="hidden" name="post_type" value="post" />
+ <?php wp_nonce_field( 'add-post' ); ?>
+ <?php submit_button( __( 'Save Draft' ), 'primary', 'save', false, array( 'id' => 'save-post' ) ); ?>
+ <br class="clear" />
+ </p>
+
+ </form>
+ <?php
+ wp_dashboard_recent_drafts();
+}
+
+/**
+ * Show recent drafts of the user on the dashboard.
+ *
+ * @since 2.7.0
+ *
+ * @param WP_Post[] $drafts Optional. Array of posts to display. Default false.
+ */
+function wp_dashboard_recent_drafts( $drafts = false ) {
+ if ( ! $drafts ) {
+ $query_args = array(
+ 'post_type' => 'post',
+ 'post_status' => 'draft',
+ 'author' => get_current_user_id(),
+ 'posts_per_page' => 4,
+ 'orderby' => 'modified',
+ 'order' => 'DESC',
+ );
+
+ /**
+ * Filters the post query arguments for the 'Recent Drafts' dashboard widget.
+ *
+ * @since 4.4.0
+ *
+ * @param array $query_args The query arguments for the 'Recent Drafts' dashboard widget.
+ */
+ $query_args = apply_filters( 'dashboard_recent_drafts_query_args', $query_args );
+
+ $drafts = get_posts( $query_args );
+ if ( ! $drafts ) {
+ return;
+ }
+ }
+
+ echo '<div class="drafts">';
+ if ( count( $drafts ) > 3 ) {
+ echo '<p class="view-all"><a href="' . esc_url( admin_url( 'edit.php?post_status=draft' ) ) . '">' . __( 'View all drafts' ) . "</a></p>\n";
+ }
+ echo '<h2 class="hide-if-no-js">' . __( 'Your Recent Drafts' ) . "</h2>\n<ul>";
+
+ $drafts = array_slice( $drafts, 0, 3 );
+ foreach ( $drafts as $draft ) {
+ $url = get_edit_post_link( $draft->ID );
+ $title = _draft_or_post_title( $draft->ID );
+ echo "<li>\n";
+ /* translators: %s: post title */
+ echo '<div class="draft-title"><a href="' . esc_url( $url ) . '" aria-label="' . esc_attr( sprintf( __( 'Edit &#8220;%s&#8221;' ), $title ) ) . '">' . esc_html( $title ) . '</a>';
+ echo '<time datetime="' . get_the_time( 'c', $draft ) . '">' . get_the_time( __( 'F j, Y' ), $draft ) . '</time></div>';
+ if ( $the_content = wp_trim_words( $draft->post_content, 10 ) ) {
+ echo '<p>' . $the_content . '</p>';
+ }
+ echo "</li>\n";
+ }
+ echo "</ul>\n</div>";
+}
+
+/**
+ * Outputs a row for the Recent Comments widget.
+ *
+ * @access private
+ * @since 2.7.0
+ *
+ * @global WP_Comment $comment
+ *
+ * @param WP_Comment $comment The current comment.
+ * @param bool $show_date Optional. Whether to display the date.
+ */
+function _wp_dashboard_recent_comments_row( &$comment, $show_date = true ) {
+ $GLOBALS['comment'] = clone $comment;
+
+ if ( $comment->comment_post_ID > 0 ) {
+
+ $comment_post_title = _draft_or_post_title( $comment->comment_post_ID );
+ $comment_post_url = get_the_permalink( $comment->comment_post_ID );
+ $comment_post_link = "<a href='$comment_post_url'>$comment_post_title</a>";
+ } else {
+ $comment_post_link = '';
+ }
+
+ $actions_string = '';
+ if ( current_user_can( 'edit_comment', $comment->comment_ID ) ) {
+ // Pre-order it: Approve | Reply | Edit | Spam | Trash.
+ $actions = array(
+ 'approve' => '',
+ 'unapprove' => '',
+ 'reply' => '',
+ 'edit' => '',
+ 'spam' => '',
+ 'trash' => '',
+ 'delete' => '',
+ 'view' => '',
+ );
+
+ $del_nonce = esc_html( '_wpnonce=' . wp_create_nonce( "delete-comment_$comment->comment_ID" ) );
+ $approve_nonce = esc_html( '_wpnonce=' . wp_create_nonce( "approve-comment_$comment->comment_ID" ) );
+
+ $approve_url = esc_url( "comment.php?action=approvecomment&p=$comment->comment_post_ID&c=$comment->comment_ID&$approve_nonce" );
+ $unapprove_url = esc_url( "comment.php?action=unapprovecomment&p=$comment->comment_post_ID&c=$comment->comment_ID&$approve_nonce" );
+ $spam_url = esc_url( "comment.php?action=spamcomment&p=$comment->comment_post_ID&c=$comment->comment_ID&$del_nonce" );
+ $trash_url = esc_url( "comment.php?action=trashcomment&p=$comment->comment_post_ID&c=$comment->comment_ID&$del_nonce" );
+ $delete_url = esc_url( "comment.php?action=deletecomment&p=$comment->comment_post_ID&c=$comment->comment_ID&$del_nonce" );
+
+ $actions['approve'] = "<a href='$approve_url' data-wp-lists='dim:the-comment-list:comment-$comment->comment_ID:unapproved:e7e7d3:e7e7d3:new=approved' class='vim-a aria-button-if-js' aria-label='" . esc_attr__( 'Approve this comment' ) . "'>" . __( 'Approve' ) . '</a>';
+ $actions['unapprove'] = "<a href='$unapprove_url' data-wp-lists='dim:the-comment-list:comment-$comment->comment_ID:unapproved:e7e7d3:e7e7d3:new=unapproved' class='vim-u aria-button-if-js' aria-label='" . esc_attr__( 'Unapprove this comment' ) . "'>" . __( 'Unapprove' ) . '</a>';
+ $actions['edit'] = "<a href='comment.php?action=editcomment&amp;c={$comment->comment_ID}' aria-label='" . esc_attr__( 'Edit this comment' ) . "'>" . __( 'Edit' ) . '</a>';
+ $actions['reply'] = '<button type="button" onclick="window.commentReply && commentReply.open(\'' . $comment->comment_ID . '\',\'' . $comment->comment_post_ID . '\');" class="vim-r button-link hide-if-no-js" aria-label="' . esc_attr__( 'Reply to this comment' ) . '">' . __( 'Reply' ) . '</button>';
+ $actions['spam'] = "<a href='$spam_url' data-wp-lists='delete:the-comment-list:comment-$comment->comment_ID::spam=1' class='vim-s vim-destructive aria-button-if-js' aria-label='" . esc_attr__( 'Mark this comment as spam' ) . "'>" . /* translators: mark as spam link */ _x( 'Spam', 'verb' ) . '</a>';
+
+ if ( ! EMPTY_TRASH_DAYS ) {
+ $actions['delete'] = "<a href='$delete_url' data-wp-lists='delete:the-comment-list:comment-$comment->comment_ID::trash=1' class='delete vim-d vim-destructive aria-button-if-js' aria-label='" . esc_attr__( 'Delete this comment permanently' ) . "'>" . __( 'Delete Permanently' ) . '</a>';
+ } else {
+ $actions['trash'] = "<a href='$trash_url' data-wp-lists='delete:the-comment-list:comment-$comment->comment_ID::trash=1' class='delete vim-d vim-destructive aria-button-if-js' aria-label='" . esc_attr__( 'Move this comment to the Trash' ) . "'>" . _x( 'Trash', 'verb' ) . '</a>';
+ }
+
+ $actions['view'] = '<a class="comment-link" href="' . esc_url( get_comment_link( $comment ) ) . '" aria-label="' . esc_attr__( 'View this comment' ) . '">' . __( 'View' ) . '</a>';
+
+ /**
+ * Filters the action links displayed for each comment in the 'Recent Comments'
+ * dashboard widget.
+ *
+ * @since 2.6.0
+ *
+ * @param string[] $actions An array of comment actions. Default actions include:
+ * 'Approve', 'Unapprove', 'Edit', 'Reply', 'Spam',
+ * 'Delete', and 'Trash'.
+ * @param WP_Comment $comment The comment object.
+ */
+ $actions = apply_filters( 'comment_row_actions', array_filter( $actions ), $comment );
+
+ $i = 0;
+ foreach ( $actions as $action => $link ) {
+ ++$i;
+ ( ( ( 'approve' == $action || 'unapprove' == $action ) && 2 === $i ) || 1 === $i ) ? $sep = '' : $sep = ' | ';
+
+ // Reply and quickedit need a hide-if-no-js span
+ if ( 'reply' == $action || 'quickedit' == $action ) {
+ $action .= ' hide-if-no-js';
+ }
+
+ if ( 'view' === $action && '1' !== $comment->comment_approved ) {
+ $action .= ' hidden';
+ }
+ $actions_string .= "<span class='$action'>$sep$link</span>";
+ }
+ }
+ ?>
+
+ <li id="comment-<?php echo $comment->comment_ID; ?>" <?php comment_class( array( 'comment-item', wp_get_comment_status( $comment ) ), $comment ); ?>>
+
+ <?php echo get_avatar( $comment, 50, 'mystery' ); ?>
+
+ <?php if ( ! $comment->comment_type || 'comment' == $comment->comment_type ) : ?>
+
+ <div class="dashboard-comment-wrap has-row-actions">
+ <p class="comment-meta">
+ <?php
+ // Comments might not have a post they relate to, e.g. programmatically created ones.
+ if ( $comment_post_link ) {
+ printf(
+ /* translators: 1: comment author, 2: post link, 3: notification if the comment is pending */
+ __( 'From %1$s on %2$s %3$s' ),
+ '<cite class="comment-author">' . get_comment_author_link( $comment ) . '</cite>',
+ $comment_post_link,
+ '<span class="approve">' . __( '[Pending]' ) . '</span>'
+ );
+ } else {
+ printf(
+ /* translators: 1: comment author, 2: notification if the comment is pending */
+ __( 'From %1$s %2$s' ),
+ '<cite class="comment-author">' . get_comment_author_link( $comment ) . '</cite>',
+ '<span class="approve">' . __( '[Pending]' ) . '</span>'
+ );
+ }
+ ?>
+ </p>
+
+ <?php
+ else :
+ switch ( $comment->comment_type ) {
+ case 'pingback':
+ $type = __( 'Pingback' );
+ break;
+ case 'trackback':
+ $type = __( 'Trackback' );
+ break;
+ default:
+ $type = ucwords( $comment->comment_type );
+ }
+ $type = esc_html( $type );
+ ?>
+ <div class="dashboard-comment-wrap has-row-actions">
+ <p class="comment-meta">
+ <?php
+ // Pingbacks, Trackbacks or custom comment types might not have a post they relate to, e.g. programmatically created ones.
+ if ( $comment_post_link ) {
+ printf(
+ /* translators: 1: type of comment, 2: post link, 3: notification if the comment is pending */
+ _x( '%1$s on %2$s %3$s', 'dashboard' ),
+ "<strong>$type</strong>",
+ $comment_post_link,
+ '<span class="approve">' . __( '[Pending]' ) . '</span>'
+ );
+ } else {
+ printf(
+ /* translators: 1: type of comment, 2: notification if the comment is pending */
+ _x( '%1$s %2$s', 'dashboard' ),
+ "<strong>$type</strong>",
+ '<span class="approve">' . __( '[Pending]' ) . '</span>'
+ );
+ }
+ ?>
+ </p>
+ <p class="comment-author"><?php comment_author_link( $comment ); ?></p>
+
+ <?php endif; // comment_type ?>
+ <blockquote><p><?php comment_excerpt( $comment ); ?></p></blockquote>
+ <?php if ( $actions_string ) : ?>
+ <p class="row-actions"><?php echo $actions_string; ?></p>
+ <?php endif; ?>
+ </div>
+ </li>
+ <?php
+ $GLOBALS['comment'] = null;
+}
+
+/**
+ * Callback function for Activity widget.
+ *
+ * @since 3.8.0
+ */
+function wp_dashboard_site_activity() {
+
+ echo '<div id="activity-widget">';
+
+ $future_posts = wp_dashboard_recent_posts(
+ array(
+ 'max' => 5,
+ 'status' => 'future',
+ 'order' => 'ASC',
+ 'title' => __( 'Publishing Soon' ),
+ 'id' => 'future-posts',
+ )
+ );
+ $recent_posts = wp_dashboard_recent_posts(
+ array(
+ 'max' => 5,
+ 'status' => 'publish',
+ 'order' => 'DESC',
+ 'title' => __( 'Recently Published' ),
+ 'id' => 'published-posts',
+ )
+ );
+
+ $recent_comments = wp_dashboard_recent_comments();
+
+ if ( ! $future_posts && ! $recent_posts && ! $recent_comments ) {
+ echo '<div class="no-activity">';
+ echo '<p class="smiley" aria-hidden="true"></p>';
+ echo '<p>' . __( 'No activity yet!' ) . '</p>';
+ echo '</div>';
+ }
+
+ echo '</div>';
+}
+
+/**
+ * Generates Publishing Soon and Recently Published sections.
+ *
+ * @since 3.8.0
+ *
+ * @param array $args {
+ * An array of query and display arguments.
+ *
+ * @type int $max Number of posts to display.
+ * @type string $status Post status.
+ * @type string $order Designates ascending ('ASC') or descending ('DESC') order.
+ * @type string $title Section title.
+ * @type string $id The container id.
+ * }
+ * @return bool False if no posts were found. True otherwise.
+ */
+function wp_dashboard_recent_posts( $args ) {
+ $query_args = array(
+ 'post_type' => 'post',
+ 'post_status' => $args['status'],
+ 'orderby' => 'date',
+ 'order' => $args['order'],
+ 'posts_per_page' => intval( $args['max'] ),
+ 'no_found_rows' => true,
+ 'cache_results' => false,
+ 'perm' => ( 'future' === $args['status'] ) ? 'editable' : 'readable',
+ );
+
+ /**
+ * Filters the query arguments used for the Recent Posts widget.
+ *
+ * @since 4.2.0
+ *
+ * @param array $query_args The arguments passed to WP_Query to produce the list of posts.
+ */
+ $query_args = apply_filters( 'dashboard_recent_posts_query_args', $query_args );
+ $posts = new WP_Query( $query_args );
+
+ if ( $posts->have_posts() ) {
+
+ echo '<div id="' . $args['id'] . '" class="activity-block">';
+
+ echo '<h3>' . $args['title'] . '</h3>';
+
+ echo '<ul>';
+
+ $today = current_time( 'Y-m-d' );
+ $tomorrow = gmdate( 'Y-m-d', strtotime( '+1 day', current_time( 'timestamp' ) ) );
+ $year = current_time( 'Y' );
+
+ while ( $posts->have_posts() ) {
+ $posts->the_post();
+
+ $time = get_the_time( 'U' );
+ if ( date( 'Y-m-d', $time ) == $today ) {
+ $relative = __( 'Today' );
+ } elseif ( date( 'Y-m-d', $time ) == $tomorrow ) {
+ $relative = __( 'Tomorrow' );
+ } elseif ( date( 'Y', $time ) !== $year ) {
+ /* translators: date and time format for recent posts on the dashboard, from a different calendar year, see https://secure.php.net/date */
+ $relative = date_i18n( __( 'M jS Y' ), $time );
+ } else {
+ /* translators: date and time format for recent posts on the dashboard, see https://secure.php.net/date */
+ $relative = date_i18n( __( 'M jS' ), $time );
+ }
+
+ // Use the post edit link for those who can edit, the permalink otherwise.
+ $recent_post_link = current_user_can( 'edit_post', get_the_ID() ) ? get_edit_post_link() : get_permalink();
+
+ $draft_or_post_title = _draft_or_post_title();
+ printf(
+ '<li><span>%1$s</span> <a href="%2$s" aria-label="%3$s">%4$s</a></li>',
+ /* translators: 1: relative date, 2: time */
+ sprintf( _x( '%1$s, %2$s', 'dashboard' ), $relative, get_the_time() ),
+ $recent_post_link,
+ /* translators: %s: post title */
+ esc_attr( sprintf( __( 'Edit &#8220;%s&#8221;' ), $draft_or_post_title ) ),
+ $draft_or_post_title
+ );
+ }
+
+ echo '</ul>';
+ echo '</div>';
+
+ } else {
+ return false;
+ }
+
+ wp_reset_postdata();
+
+ return true;
+}
+
+/**
+ * Show Comments section.
+ *
+ * @since 3.8.0
+ *
+ * @param int $total_items Optional. Number of comments to query. Default 5.
+ * @return bool False if no comments were found. True otherwise.
+ */
+function wp_dashboard_recent_comments( $total_items = 5 ) {
+ // Select all comment types and filter out spam later for better query performance.
+ $comments = array();
+
+ $comments_query = array(
+ 'number' => $total_items * 5,
+ 'offset' => 0,
+ );
+ if ( ! current_user_can( 'edit_posts' ) ) {
+ $comments_query['status'] = 'approve';
+ }
+
+ while ( count( $comments ) < $total_items && $possible = get_comments( $comments_query ) ) {
+ if ( ! is_array( $possible ) ) {
+ break;
+ }
+ foreach ( $possible as $comment ) {
+ if ( ! current_user_can( 'read_post', $comment->comment_post_ID ) ) {
+ continue;
+ }
+ $comments[] = $comment;
+ if ( count( $comments ) == $total_items ) {
+ break 2;
+ }
+ }
+ $comments_query['offset'] += $comments_query['number'];
+ $comments_query['number'] = $total_items * 10;
+ }
+
+ if ( $comments ) {
+ echo '<div id="latest-comments" class="activity-block">';
+ echo '<h3>' . __( 'Recent Comments' ) . '</h3>';
+
+ echo '<ul id="the-comment-list" data-wp-lists="list:comment">';
+ foreach ( $comments as $comment ) {
+ _wp_dashboard_recent_comments_row( $comment );
+ }
+ echo '</ul>';
+
+ if ( current_user_can( 'edit_posts' ) ) {
+ echo '<h3 class="screen-reader-text">' . __( 'View more comments' ) . '</h3>';
+ _get_list_table( 'WP_Comments_List_Table' )->views();
+ }
+
+ wp_comment_reply( -1, false, 'dashboard', false );
+ wp_comment_trashnotice();
+
+ echo '</div>';
+ } else {
+ return false;
+ }
+ return true;
+}
+
+/**
+ * Display generic dashboard RSS widget feed.
+ *
+ * @since 2.5.0
+ *
+ * @param string $widget_id
+ */
+function wp_dashboard_rss_output( $widget_id ) {
+ $widgets = get_option( 'dashboard_widget_options' );
+ echo '<div class="rss-widget">';
+ wp_widget_rss_output( $widgets[ $widget_id ] );
+ echo '</div>';
+}
+
+/**
+ * Checks to see if all of the feed url in $check_urls are cached.
+ *
+ * If $check_urls is empty, look for the rss feed url found in the dashboard
+ * widget options of $widget_id. If cached, call $callback, a function that
+ * echoes out output for this widget. If not cache, echo a "Loading..." stub
+ * which is later replaced by Ajax call (see top of /wp-admin/index.php)
+ *
+ * @since 2.5.0
+ *
+ * @param string $widget_id
+ * @param callable $callback
+ * @param array $check_urls RSS feeds
+ * @return bool False on failure. True on success.
+ */
+function wp_dashboard_cached_rss_widget( $widget_id, $callback, $check_urls = array() ) {
+ $loading = '<p class="widget-loading hide-if-no-js">' . __( 'Loading&#8230;' ) . '</p><div class="hide-if-js notice notice-error inline"><p>' . __( 'This widget requires JavaScript.' ) . '</p></div>';
+ $doing_ajax = wp_doing_ajax();
+
+ if ( empty( $check_urls ) ) {
+ $widgets = get_option( 'dashboard_widget_options' );
+ if ( empty( $widgets[ $widget_id ]['url'] ) && ! $doing_ajax ) {
+ echo $loading;
+ return false;
+ }
+ $check_urls = array( $widgets[ $widget_id ]['url'] );
+ }
+
+ $locale = get_user_locale();
+ $cache_key = 'dash_v2_' . md5( $widget_id . '_' . $locale );
+ if ( false !== ( $output = get_transient( $cache_key ) ) ) {
+ echo $output;
+ return true;
+ }
+
+ if ( ! $doing_ajax ) {
+ echo $loading;
+ return false;
+ }
+
+ if ( $callback && is_callable( $callback ) ) {
+ $args = array_slice( func_get_args(), 3 );
+ array_unshift( $args, $widget_id, $check_urls );
+ ob_start();
+ call_user_func_array( $callback, $args );
+ set_transient( $cache_key, ob_get_flush(), 12 * HOUR_IN_SECONDS ); // Default lifetime in cache of 12 hours (same as the feeds)
+ }
+
+ return true;
+}
+
+//
+// Dashboard Widgets Controls
+//
+
+/**
+ * Calls widget control callback.
+ *
+ * @since 2.5.0
+ *
+ * @global array $wp_dashboard_control_callbacks
+ *
+ * @param int $widget_control_id Registered Widget ID.
+ */
+function wp_dashboard_trigger_widget_control( $widget_control_id = false ) {
+ global $wp_dashboard_control_callbacks;
+
+ if ( is_scalar( $widget_control_id ) && $widget_control_id && isset( $wp_dashboard_control_callbacks[ $widget_control_id ] ) && is_callable( $wp_dashboard_control_callbacks[ $widget_control_id ] ) ) {
+ call_user_func(
+ $wp_dashboard_control_callbacks[ $widget_control_id ],
+ '',
+ array(
+ 'id' => $widget_control_id,
+ 'callback' => $wp_dashboard_control_callbacks[ $widget_control_id ],
+ )
+ );
+ }
+}
+
+/**
+ * The RSS dashboard widget control.
+ *
+ * Sets up $args to be used as input to wp_widget_rss_form(). Handles POST data
+ * from RSS-type widgets.
+ *
+ * @since 2.5.0
+ *
+ * @param string $widget_id
+ * @param array $form_inputs
+ */
+function wp_dashboard_rss_control( $widget_id, $form_inputs = array() ) {
+ if ( ! $widget_options = get_option( 'dashboard_widget_options' ) ) {
+ $widget_options = array();
+ }
+
+ if ( ! isset( $widget_options[ $widget_id ] ) ) {
+ $widget_options[ $widget_id ] = array();
+ }
+
+ $number = 1; // Hack to use wp_widget_rss_form()
+ $widget_options[ $widget_id ]['number'] = $number;
+
+ if ( 'POST' == $_SERVER['REQUEST_METHOD'] && isset( $_POST['widget-rss'][ $number ] ) ) {
+ $_POST['widget-rss'][ $number ] = wp_unslash( $_POST['widget-rss'][ $number ] );
+ $widget_options[ $widget_id ] = wp_widget_rss_process( $_POST['widget-rss'][ $number ] );
+ $widget_options[ $widget_id ]['number'] = $number;
+
+ // Title is optional. If black, fill it if possible.
+ if ( ! $widget_options[ $widget_id ]['title'] && isset( $_POST['widget-rss'][ $number ]['title'] ) ) {
+ $rss = fetch_feed( $widget_options[ $widget_id ]['url'] );
+ if ( is_wp_error( $rss ) ) {
+ $widget_options[ $widget_id ]['title'] = htmlentities( __( 'Unknown Feed' ) );
+ } else {
+ $widget_options[ $widget_id ]['title'] = htmlentities( strip_tags( $rss->get_title() ) );
+ $rss->__destruct();
+ unset( $rss );
+ }
+ }
+ update_option( 'dashboard_widget_options', $widget_options );
+ $locale = get_user_locale();
+ $cache_key = 'dash_v2_' . md5( $widget_id . '_' . $locale );
+ delete_transient( $cache_key );
+ }
+
+ wp_widget_rss_form( $widget_options[ $widget_id ], $form_inputs );
+}
+
+
+/**
+ * Renders the Events and News dashboard widget.
+ *
+ * @since 4.8.0
+ */
+function wp_dashboard_events_news() {
+ wp_print_community_events_markup();
+
+ ?>
+
+ <div class="wordpress-news hide-if-no-js">
+ <?php wp_dashboard_primary(); ?>
+ </div>
+
+ <p class="community-events-footer">
+ <?php
+ printf(
+ '<a href="%1$s" target="_blank">%2$s <span class="screen-reader-text">%3$s</span><span aria-hidden="true" class="dashicons dashicons-external"></span></a>',
+ 'https://make.wordpress.org/community/meetups-landing-page',
+ __( 'Meetups' ),
+ /* translators: accessibility text */
+ __( '(opens in a new tab)' )
+ );
+ ?>
+
+ |
+
+ <?php
+ printf(
+ '<a href="%1$s" target="_blank">%2$s <span class="screen-reader-text">%3$s</span><span aria-hidden="true" class="dashicons dashicons-external"></span></a>',
+ 'https://central.wordcamp.org/schedule/',
+ __( 'WordCamps' ),
+ /* translators: accessibility text */
+ __( '(opens in a new tab)' )
+ );
+ ?>
+
+ |
+
+ <?php
+ printf(
+ '<a href="%1$s" target="_blank">%2$s <span class="screen-reader-text">%3$s</span><span aria-hidden="true" class="dashicons dashicons-external"></span></a>',
+ /* translators: If a Rosetta site exists (e.g. https://es.wordpress.org/news/), then use that. Otherwise, leave untranslated. */
+ esc_url( _x( 'https://wordpress.org/news/', 'Events and News dashboard widget' ) ),
+ __( 'News' ),
+ /* translators: accessibility text */
+ __( '(opens in a new tab)' )
+ );
+ ?>
+ </p>
+
+ <?php
+}
+
+/**
+ * Prints the markup for the Community Events section of the Events and News Dashboard widget.
+ *
+ * @since 4.8.0
+ */
+function wp_print_community_events_markup() {
+ ?>
+
+ <div class="community-events-errors notice notice-error inline hide-if-js">
+ <p class="hide-if-js">
+ <?php _e( 'This widget requires JavaScript.' ); ?>
+ </p>
+
+ <p class="community-events-error-occurred" aria-hidden="true">
+ <?php _e( 'An error occurred. Please try again.' ); ?>
+ </p>
+
+ <p class="community-events-could-not-locate" aria-hidden="true"></p>
+ </div>
+
+ <div class="community-events-loading hide-if-no-js">
+ <?php _e( 'Loading&hellip;' ); ?>
+ </div>
+
+ <?php
+ /*
+ * Hide the main element when the page first loads, because the content
+ * won't be ready until wp.communityEvents.renderEventsTemplate() has run.
+ */
+ ?>
+ <div id="community-events" class="community-events" aria-hidden="true">
+ <div class="activity-block">
+ <p>
+ <span id="community-events-location-message"></span>
+
+ <button class="button-link community-events-toggle-location" aria-label="<?php esc_attr_e( 'Edit city' ); ?>" aria-expanded="false">
+ <span class="dashicons dashicons-edit"></span>
+ </button>
+ </p>
+
+ <form class="community-events-form" aria-hidden="true" action="<?php echo esc_url( admin_url( 'admin-ajax.php' ) ); ?>" method="post">
+ <label for="community-events-location">
+ <?php _e( 'City:' ); ?>
+ </label>
+ <?php
+ /* translators: Replace with a city related to your locale.
+ * Test that it matches the expected location and has upcoming
+ * events before including it. If no cities related to your
+ * locale have events, then use a city related to your locale
+ * that would be recognizable to most users. Use only the city
+ * name itself, without any region or country. Use the endonym
+ * (native locale name) instead of the English name if possible.
+ */
+ ?>
+ <input id="community-events-location" class="regular-text" type="text" name="community-events-location" placeholder="<?php esc_attr_e( 'Cincinnati' ); ?>" />
+
+ <?php submit_button( __( 'Submit' ), 'secondary', 'community-events-submit', false ); ?>
+
+ <button class="community-events-cancel button-link" type="button" aria-expanded="false">
+ <?php _e( 'Cancel' ); ?>
+ </button>
+
+ <span class="spinner"></span>
+ </form>
+ </div>
+
+ <ul class="community-events-results activity-block last"></ul>
+ </div>
+
+ <?php
+}
+
+/**
+ * Renders the events templates for the Event and News widget.
+ *
+ * @since 4.8.0
+ */
+function wp_print_community_events_templates() {
+ ?>
+
+ <script id="tmpl-community-events-attend-event-near" type="text/template">
+ <?php
+ printf(
+ /* translators: %s: the name of a city */
+ __( 'Attend an upcoming event near %s.' ),
+ '<strong>{{ data.location.description }}</strong>'
+ );
+ ?>
+ </script>
+
+ <script id="tmpl-community-events-could-not-locate" type="text/template">
+ <?php
+ printf(
+ /* translators: %s is the name of the city we couldn't locate.
+ * Replace the examples with cities in your locale, but test
+ * that they match the expected location before including them.
+ * Use endonyms (native locale names) whenever possible.
+ */
+ __( 'We couldn&#8217;t locate %s. Please try another nearby city. For example: Kansas City; Springfield; Portland.' ),
+ '<em>{{data.unknownCity}}</em>'
+ );
+ ?>
+ </script>
+
+ <script id="tmpl-community-events-event-list" type="text/template">
+ <# _.each( data.events, function( event ) { #>
+ <li class="event event-{{ event.type }} wp-clearfix">
+ <div class="event-info">
+ <div class="dashicons event-icon" aria-hidden="true"></div>
+ <div class="event-info-inner">
+ <a class="event-title" href="{{ event.url }}">{{ event.title }}</a>
+ <span class="event-city">{{ event.location.location }}</span>
+ </div>
+ </div>
+
+ <div class="event-date-time">
+ <span class="event-date">{{ event.formatted_date }}</span>
+ <# if ( 'meetup' === event.type ) { #>
+ <span class="event-time">{{ event.formatted_time }}</span>
+ <# } #>
+ </div>
+ </li>
+ <# } ) #>
+ </script>
+
+ <script id="tmpl-community-events-no-upcoming-events" type="text/template">
+ <li class="event-none">
+ <# if ( data.location.description ) { #>
+ <?php
+ printf(
+ /* translators: 1: the city the user searched for, 2: meetup organization documentation URL */
+ __( 'There aren&#8217;t any events scheduled near %1$s at the moment. Would you like to <a href="%2$s">organize one</a>?' ),
+ '{{ data.location.description }}',
+ __( 'https://make.wordpress.org/community/handbook/meetup-organizer/welcome/' )
+ );
+ ?>
+
+ <# } else { #>
+ <?php
+ printf(
+ /* translators: %s: meetup organization documentation URL */
+ __( 'There aren&#8217;t any events scheduled near you at the moment. Would you like to <a href="%s">organize one</a>?' ),
+ __( 'https://make.wordpress.org/community/handbook/meetup-organizer/welcome/' )
+ );
+ ?>
+ <# } #>
+ </li>
+ </script>
+ <?php
+}
+
+/**
+ * 'WordPress Events and News' dashboard widget.
+ *
+ * @since 2.7.0
+ * @since 4.8.0 Removed popular plugins feed.
+ */
+function wp_dashboard_primary() {
+ $feeds = array(
+ 'news' => array(
+
+ /**
+ * Filters the primary link URL for the 'WordPress Events and News' dashboard widget.
+ *
+ * @since 2.5.0
+ *
+ * @param string $link The widget's primary link URL.
+ */
+ 'link' => apply_filters( 'dashboard_primary_link', __( 'https://wordpress.org/news/' ) ),
+
+ /**
+ * Filters the primary feed URL for the 'WordPress Events and News' dashboard widget.
+ *
+ * @since 2.3.0
+ *
+ * @param string $url The widget's primary feed URL.
+ */
+ 'url' => apply_filters( 'dashboard_primary_feed', __( 'https://wordpress.org/news/feed/' ) ),
+
+ /**
+ * Filters the primary link title for the 'WordPress Events and News' dashboard widget.
+ *
+ * @since 2.3.0
+ *
+ * @param string $title Title attribute for the widget's primary link.
+ */
+ 'title' => apply_filters( 'dashboard_primary_title', __( 'WordPress Blog' ) ),
+ 'items' => 1,
+ 'show_summary' => 0,
+ 'show_author' => 0,
+ 'show_date' => 0,
+ ),
+ 'planet' => array(
+
+ /**
+ * Filters the secondary link URL for the 'WordPress Events and News' dashboard widget.
+ *
+ * @since 2.3.0
+ *
+ * @param string $link The widget's secondary link URL.
+ */
+ 'link' => apply_filters( 'dashboard_secondary_link', __( 'https://planet.wordpress.org/' ) ),
+
+ /**
+ * Filters the secondary feed URL for the 'WordPress Events and News' dashboard widget.
+ *
+ * @since 2.3.0
+ *
+ * @param string $url The widget's secondary feed URL.
+ */
+ 'url' => apply_filters( 'dashboard_secondary_feed', __( 'https://planet.wordpress.org/feed/' ) ),
+
+ /**
+ * Filters the secondary link title for the 'WordPress Events and News' dashboard widget.
+ *
+ * @since 2.3.0
+ *
+ * @param string $title Title attribute for the widget's secondary link.
+ */
+ 'title' => apply_filters( 'dashboard_secondary_title', __( 'Other WordPress News' ) ),
+
+ /**
+ * Filters the number of secondary link items for the 'WordPress Events and News' dashboard widget.
+ *
+ * @since 4.4.0
+ *
+ * @param string $items How many items to show in the secondary feed.
+ */
+ 'items' => apply_filters( 'dashboard_secondary_items', 3 ),
+ 'show_summary' => 0,
+ 'show_author' => 0,
+ 'show_date' => 0,
+ ),
+ );
+
+ wp_dashboard_cached_rss_widget( 'dashboard_primary', 'wp_dashboard_primary_output', $feeds );
+}
+
+/**
+ * Display the WordPress events and news feeds.
+ *
+ * @since 3.8.0
+ * @since 4.8.0 Removed popular plugins feed.
+ *
+ * @param string $widget_id Widget ID.
+ * @param array $feeds Array of RSS feeds.
+ */
+function wp_dashboard_primary_output( $widget_id, $feeds ) {
+ foreach ( $feeds as $type => $args ) {
+ $args['type'] = $type;
+ echo '<div class="rss-widget">';
+ wp_widget_rss_output( $args['url'], $args );
+ echo '</div>';
+ }
+}
+
+/**
+ * Display file upload quota on dashboard.
+ *
+ * Runs on the {@see 'activity_box_end'} hook in wp_dashboard_right_now().
+ *
+ * @since 3.0.0
+ *
+ * @return bool|null True if not multisite, user can't upload files, or the space check option is disabled.
+ */
+function wp_dashboard_quota() {
+ if ( ! is_multisite() || ! current_user_can( 'upload_files' ) || get_site_option( 'upload_space_check_disabled' ) ) {
+ return true;
+ }
+
+ $quota = get_space_allowed();
+ $used = get_space_used();
+
+ if ( $used > $quota ) {
+ $percentused = '100';
+ } else {
+ $percentused = ( $used / $quota ) * 100;
+ }
+ $used_class = ( $percentused >= 70 ) ? ' warning' : '';
+ $used = round( $used, 2 );
+ $percentused = number_format( $percentused );
+
+ ?>
+ <h3 class="mu-storage"><?php _e( 'Storage Space' ); ?></h3>
+ <div class="mu-storage">
+ <ul>
+ <li class="storage-count">
+ <?php
+ $text = sprintf(
+ /* translators: %s: number of megabytes */
+ __( '%s MB Space Allowed' ),
+ number_format_i18n( $quota )
+ );
+ printf(
+ '<a href="%1$s">%2$s <span class="screen-reader-text">(%3$s)</span></a>',
+ esc_url( admin_url( 'upload.php' ) ),
+ $text,
+ __( 'Manage Uploads' )
+ );
+ ?>
+ </li><li class="storage-count <?php echo $used_class; ?>">
+ <?php
+ $text = sprintf(
+ /* translators: 1: number of megabytes, 2: percentage */
+ __( '%1$s MB (%2$s%%) Space Used' ),
+ number_format_i18n( $used, 2 ),
+ $percentused
+ );
+ printf(
+ '<a href="%1$s" class="musublink">%2$s <span class="screen-reader-text">(%3$s)</span></a>',
+ esc_url( admin_url( 'upload.php' ) ),
+ $text,
+ __( 'Manage Uploads' )
+ );
+ ?>
+ </li>
+ </ul>
+ </div>
+ <?php
+}
+
+// Display Browser Nag Meta Box
+function wp_dashboard_browser_nag() {
+ $notice = '';
+ $response = wp_check_browser_version();
+
+ if ( $response ) {
+ if ( $response['insecure'] ) {
+ /* translators: %s: browser name and link */
+ $msg = sprintf(
+ __( "It looks like you're using an insecure version of %s. Using an outdated browser makes your computer unsafe. For the best WordPress experience, please update your browser." ),
+ sprintf( '<a href="%s">%s</a>', esc_url( $response['update_url'] ), esc_html( $response['name'] ) )
+ );
+ } else {
+ /* translators: %s: browser name and link */
+ $msg = sprintf(
+ __( "It looks like you're using an old version of %s. For the best WordPress experience, please update your browser." ),
+ sprintf( '<a href="%s">%s</a>', esc_url( $response['update_url'] ), esc_html( $response['name'] ) )
+ );
+ }
+
+ $browser_nag_class = '';
+ if ( ! empty( $response['img_src'] ) ) {
+ $img_src = ( is_ssl() && ! empty( $response['img_src_ssl'] ) ) ? $response['img_src_ssl'] : $response['img_src'];
+
+ $notice .= '<div class="alignright browser-icon"><a href="' . esc_attr( $response['update_url'] ) . '"><img src="' . esc_attr( $img_src ) . '" alt="" /></a></div>';
+ $browser_nag_class = ' has-browser-icon';
+ }
+ $notice .= "<p class='browser-update-nag{$browser_nag_class}'>{$msg}</p>";
+
+ $browsehappy = 'https://browsehappy.com/';
+ $locale = get_user_locale();
+ if ( 'en_US' !== $locale ) {
+ $browsehappy = add_query_arg( 'locale', $locale, $browsehappy );
+ }
+
+ $notice .= '<p>' . sprintf( __( '<a href="%1$s" class="update-browser-link">Update %2$s</a> or learn how to <a href="%3$s" class="browse-happy-link">browse happy</a>' ), esc_attr( $response['update_url'] ), esc_html( $response['name'] ), esc_url( $browsehappy ) ) . '</p>';
+ $notice .= '<p class="hide-if-no-js"><a href="" class="dismiss" aria-label="' . esc_attr__( 'Dismiss the browser warning panel' ) . '">' . __( 'Dismiss' ) . '</a></p>';
+ $notice .= '<div class="clear"></div>';
+ }
+
+ /**
+ * Filters the notice output for the 'Browse Happy' nag meta box.
+ *
+ * @since 3.2.0
+ *
+ * @param string $notice The notice content.
+ * @param array $response An array containing web browser information. See `wp_check_browser_version()`.
+ */
+ echo apply_filters( 'browse-happy-notice', $notice, $response );
+}
+
+/**
+ * @since 3.2.0
+ *
+ * @param array $classes
+ * @return array
+ */
+function dashboard_browser_nag_class( $classes ) {
+ $response = wp_check_browser_version();
+
+ if ( $response && $response['insecure'] ) {
+ $classes[] = 'browser-insecure';
+ }
+
+ return $classes;
+}
+
+/**
+ * Check if the user needs a browser update
+ *
+ * @since 3.2.0
+ *
+ * @return array|bool False on failure, array of browser data on success.
+ */
+function wp_check_browser_version() {
+ if ( empty( $_SERVER['HTTP_USER_AGENT'] ) ) {
+ return false;
+ }
+
+ $key = md5( $_SERVER['HTTP_USER_AGENT'] );
+
+ if ( false === ( $response = get_site_transient( 'browser_' . $key ) ) ) {
+ // include an unmodified $wp_version
+ include( ABSPATH . WPINC . '/version.php' );
+
+ $url = 'http://api.wordpress.org/core/browse-happy/1.1/';
+ $options = array(
+ 'body' => array( 'useragent' => $_SERVER['HTTP_USER_AGENT'] ),
+ 'user-agent' => 'WordPress/' . $wp_version . '; ' . home_url( '/' ),
+ );
+
+ if ( wp_http_supports( array( 'ssl' ) ) ) {
+ $url = set_url_scheme( $url, 'https' );
+ }
+
+ $response = wp_remote_post( $url, $options );
+
+ if ( is_wp_error( $response ) || 200 != wp_remote_retrieve_response_code( $response ) ) {
+ return false;
+ }
+
+ /**
+ * Response should be an array with:
+ * 'platform' - string - A user-friendly platform name, if it can be determined
+ * 'name' - string - A user-friendly browser name
+ * 'version' - string - The version of the browser the user is using
+ * 'current_version' - string - The most recent version of the browser
+ * 'upgrade' - boolean - Whether the browser needs an upgrade
+ * 'insecure' - boolean - Whether the browser is deemed insecure
+ * 'update_url' - string - The url to visit to upgrade
+ * 'img_src' - string - An image representing the browser
+ * 'img_src_ssl' - string - An image (over SSL) representing the browser
+ */
+ $response = json_decode( wp_remote_retrieve_body( $response ), true );
+
+ if ( ! is_array( $response ) ) {
+ return false;
+ }
+
+ set_site_transient( 'browser_' . $key, $response, WEEK_IN_SECONDS );
+ }
+
+ return $response;
+}
+
+/**
+ * Displays the PHP update nag.
+ *
+ * @since 5.1.0
+ */
+function wp_dashboard_php_nag() {
+ $response = wp_check_php_version();
+
+ if ( ! $response ) {
+ return;
+ }
+
+ if ( isset( $response['is_secure'] ) && ! $response['is_secure'] ) {
+ $msg = __( 'WordPress has detected that your site is running on an insecure version of PHP.' );
+ } else {
+ $msg = __( 'WordPress has detected that your site is running on an outdated version of PHP.' );
+ }
+
+ ?>
+ <p><?php echo $msg; ?></p>
+
+ <h3><?php _e( 'What is PHP and how does it affect my site?' ); ?></h3>
+ <p><?php _e( 'PHP is the programming language we use to build and maintain WordPress. Newer versions of PHP are both faster and more secure, so updating will have a positive effect on your site&#8217;s performance.' ); ?></p>
+
+ <p class="button-container">
+ <?php
+ printf(
+ '<a class="button button-primary" href="%1$s" target="_blank" rel="noopener noreferrer">%2$s <span class="screen-reader-text">%3$s</span><span aria-hidden="true" class="dashicons dashicons-external"></span></a>',
+ esc_url( wp_get_update_php_url() ),
+ __( 'Learn more about updating PHP' ),
+ /* translators: accessibility text */
+ __( '(opens in a new tab)' )
+ );
+ ?>
+ </p>
+ <?php
+
+ wp_update_php_annotation();
+ wp_direct_php_update_button();
+}
+
+/**
+ * Adds an additional class to the PHP nag if the current version is insecure.
+ *
+ * @since 5.1.0
+ *
+ * @param array $classes Metabox classes.
+ * @return array Modified metabox classes.
+ */
+function dashboard_php_nag_class( $classes ) {
+ $response = wp_check_php_version();
+
+ if ( $response && isset( $response['is_secure'] ) && ! $response['is_secure'] ) {
+ $classes[] = 'php-insecure';
+ }
+
+ return $classes;
+}
+
+/**
+ * Empty function usable by plugins to output empty dashboard widget (to be populated later by JS).
+ */
+function wp_dashboard_empty() {}
+
+/**
+ * Displays a welcome panel to introduce users to WordPress.
+ *
+ * @since 3.3.0
+ */
+function wp_welcome_panel() {
+ ?>
+ <div class="welcome-panel-content">
+ <h2><?php _e( 'Welcome to WordPress!' ); ?></h2>
+ <p class="about-description"><?php _e( 'We&#8217;ve assembled some links to get you started:' ); ?></p>
+ <div class="welcome-panel-column-container">
+ <div class="welcome-panel-column">
+ <?php if ( current_user_can( 'customize' ) ) : ?>
+ <h3><?php _e( 'Get Started' ); ?></h3>
+ <a class="button button-primary button-hero load-customize hide-if-no-customize" href="<?php echo wp_customize_url(); ?>"><?php _e( 'Customize Your Site' ); ?></a>
+ <?php endif; ?>
+ <a class="button button-primary button-hero hide-if-customize" href="<?php echo admin_url( 'themes.php' ); ?>"><?php _e( 'Customize Your Site' ); ?></a>
+ <?php if ( current_user_can( 'install_themes' ) || ( current_user_can( 'switch_themes' ) && count( wp_get_themes( array( 'allowed' => true ) ) ) > 1 ) ) : ?>
+ <?php $themes_link = current_user_can( 'customize' ) ? add_query_arg( 'autofocus[panel]', 'themes', admin_url( 'customize.php' ) ) : admin_url( 'themes.php' ); ?>
+ <p class="hide-if-no-customize"><?php printf( __( 'or, <a href="%s">change your theme completely</a>' ), $themes_link ); ?></p>
+ <?php endif; ?>
+ </div>
+ <div class="welcome-panel-column">
+ <h3><?php _e( 'Next Steps' ); ?></h3>
+ <ul>
+ <?php if ( 'page' == get_option( 'show_on_front' ) && ! get_option( 'page_for_posts' ) ) : ?>
+ <li><?php printf( '<a href="%s" class="welcome-icon welcome-edit-page">' . __( 'Edit your front page' ) . '</a>', get_edit_post_link( get_option( 'page_on_front' ) ) ); ?></li>
+ <li><?php printf( '<a href="%s" class="welcome-icon welcome-add-page">' . __( 'Add additional pages' ) . '</a>', admin_url( 'post-new.php?post_type=page' ) ); ?></li>
+ <?php elseif ( 'page' == get_option( 'show_on_front' ) ) : ?>
+ <li><?php printf( '<a href="%s" class="welcome-icon welcome-edit-page">' . __( 'Edit your front page' ) . '</a>', get_edit_post_link( get_option( 'page_on_front' ) ) ); ?></li>
+ <li><?php printf( '<a href="%s" class="welcome-icon welcome-add-page">' . __( 'Add additional pages' ) . '</a>', admin_url( 'post-new.php?post_type=page' ) ); ?></li>
+ <li><?php printf( '<a href="%s" class="welcome-icon welcome-write-blog">' . __( 'Add a blog post' ) . '</a>', admin_url( 'post-new.php' ) ); ?></li>
+ <?php else : ?>
+ <li><?php printf( '<a href="%s" class="welcome-icon welcome-write-blog">' . __( 'Write your first blog post' ) . '</a>', admin_url( 'post-new.php' ) ); ?></li>
+ <li><?php printf( '<a href="%s" class="welcome-icon welcome-add-page">' . __( 'Add an About page' ) . '</a>', admin_url( 'post-new.php?post_type=page' ) ); ?></li>
+ <li><?php printf( '<a href="%s" class="welcome-icon welcome-setup-home">' . __( 'Set up your homepage' ) . '</a>', current_user_can( 'customize' ) ? add_query_arg( 'autofocus[section]', 'static_front_page', admin_url( 'customize.php' ) ) : admin_url( 'options-reading.php' ) ); ?></li>
+ <?php endif; ?>
+ <li><?php printf( '<a href="%s" class="welcome-icon welcome-view-site">' . __( 'View your site' ) . '</a>', home_url( '/' ) ); ?></li>
+ </ul>
+ </div>
+ <div class="welcome-panel-column welcome-panel-last">
+ <h3><?php _e( 'More Actions' ); ?></h3>
+ <ul>
+ <?php if ( current_theme_supports( 'widgets' ) || current_theme_supports( 'menus' ) ) : ?>
+ <li><div class="welcome-icon welcome-widgets-menus">
+ <?php
+ if ( current_theme_supports( 'widgets' ) && current_theme_supports( 'menus' ) ) {
+ printf(
+ __( 'Manage <a href="%1$s">widgets</a> or <a href="%2$s">menus</a>' ),
+ admin_url( 'widgets.php' ),
+ admin_url( 'nav-menus.php' )
+ );
+ } elseif ( current_theme_supports( 'widgets' ) ) {
+ echo '<a href="' . admin_url( 'widgets.php' ) . '">' . __( 'Manage widgets' ) . '</a>';
+ } else {
+ echo '<a href="' . admin_url( 'nav-menus.php' ) . '">' . __( 'Manage menus' ) . '</a>';
+ }
+ ?>
+ </div></li>
+ <?php endif; ?>
+ <?php if ( current_user_can( 'manage_options' ) ) : ?>
+ <li><?php printf( '<a href="%s" class="welcome-icon welcome-comments">' . __( 'Turn comments on or off' ) . '</a>', admin_url( 'options-discussion.php' ) ); ?></li>
+ <?php endif; ?>
+ <li><?php printf( '<a href="%s" class="welcome-icon welcome-learn-more">' . __( 'Learn more about getting started' ) . '</a>', __( 'https://codex.wordpress.org/First_Steps_With_WordPress' ) ); ?></li>
+ </ul>
+ </div>
+ </div>
+ </div>
+ <?php
+}
diff --git a/www/crm/wp-admin/includes/deprecated.php b/www/crm/wp-admin/includes/deprecated.php
new file mode 100644
index 00000000..e65fe5a7
--- /dev/null
+++ b/www/crm/wp-admin/includes/deprecated.php
@@ -0,0 +1,1516 @@
+<?php
+/**
+ * Deprecated admin functions from past WordPress versions. You shouldn't use these
+ * functions and look for the alternatives instead. The functions will be removed
+ * in a later version.
+ *
+ * @package WordPress
+ * @subpackage Deprecated
+ */
+
+/*
+ * Deprecated functions come here to die.
+ */
+
+/**
+ * @since 2.1.0
+ * @deprecated 2.1.0 Use wp_editor()
+ * @see wp_editor()
+ */
+function tinymce_include() {
+ _deprecated_function( __FUNCTION__, '2.1.0', 'wp_editor()' );
+
+ wp_tiny_mce();
+}
+
+/**
+ * Unused Admin function.
+ *
+ * @since 2.0.0
+ * @deprecated 2.5.0
+ *
+ */
+function documentation_link() {
+ _deprecated_function( __FUNCTION__, '2.5.0' );
+}
+
+/**
+ * Calculates the new dimensions for a downsampled image.
+ *
+ * @since 2.0.0
+ * @deprecated 3.0.0 Use wp_constrain_dimensions()
+ * @see wp_constrain_dimensions()
+ *
+ * @param int $width Current width of the image
+ * @param int $height Current height of the image
+ * @param int $wmax Maximum wanted width
+ * @param int $hmax Maximum wanted height
+ * @return array Shrunk dimensions (width, height).
+ */
+function wp_shrink_dimensions( $width, $height, $wmax = 128, $hmax = 96 ) {
+ _deprecated_function( __FUNCTION__, '3.0.0', 'wp_constrain_dimensions()' );
+ return wp_constrain_dimensions( $width, $height, $wmax, $hmax );
+}
+
+/**
+ * Calculated the new dimensions for a downsampled image.
+ *
+ * @since 2.0.0
+ * @deprecated 3.5.0 Use wp_constrain_dimensions()
+ * @see wp_constrain_dimensions()
+ *
+ * @param int $width Current width of the image
+ * @param int $height Current height of the image
+ * @return array Shrunk dimensions (width, height).
+ */
+function get_udims( $width, $height ) {
+ _deprecated_function( __FUNCTION__, '3.5.0', 'wp_constrain_dimensions()' );
+ return wp_constrain_dimensions( $width, $height, 128, 96 );
+}
+
+/**
+ * Legacy function used to generate the categories checklist control.
+ *
+ * @since 0.71
+ * @deprecated 2.6.0 Use wp_category_checklist()
+ * @see wp_category_checklist()
+ *
+ * @param int $default Unused.
+ * @param int $parent Unused.
+ * @param array $popular_ids Unused.
+ */
+function dropdown_categories( $default = 0, $parent = 0, $popular_ids = array() ) {
+ _deprecated_function( __FUNCTION__, '2.6.0', 'wp_category_checklist()' );
+ global $post_ID;
+ wp_category_checklist( $post_ID );
+}
+
+/**
+ * Legacy function used to generate a link categories checklist control.
+ *
+ * @since 2.1.0
+ * @deprecated 2.6.0 Use wp_link_category_checklist()
+ * @see wp_link_category_checklist()
+ *
+ * @param int $default Unused.
+ */
+function dropdown_link_categories( $default = 0 ) {
+ _deprecated_function( __FUNCTION__, '2.6.0', 'wp_link_category_checklist()' );
+ global $link_id;
+ wp_link_category_checklist( $link_id );
+}
+
+/**
+ * Get the real filesystem path to a file to edit within the admin.
+ *
+ * @since 1.5.0
+ * @deprecated 2.9.0
+ * @uses WP_CONTENT_DIR Full filesystem path to the wp-content directory.
+ *
+ * @param string $file Filesystem path relative to the wp-content directory.
+ * @return string Full filesystem path to edit.
+ */
+function get_real_file_to_edit( $file ) {
+ _deprecated_function( __FUNCTION__, '2.9.0' );
+
+ return WP_CONTENT_DIR . $file;
+}
+
+/**
+ * Legacy function used for generating a categories drop-down control.
+ *
+ * @since 1.2.0
+ * @deprecated 3.0.0 Use wp_dropdown_categories()
+ * @see wp_dropdown_categories()
+ *
+ * @param int $currentcat Optional. ID of the current category. Default 0.
+ * @param int $currentparent Optional. Current parent category ID. Default 0.
+ * @param int $parent Optional. Parent ID to retrieve categories for. Default 0.
+ * @param int $level Optional. Number of levels deep to display. Default 0.
+ * @param array $categories Optional. Categories to include in the control. Default 0.
+ * @return bool|null False if no categories were found.
+ */
+function wp_dropdown_cats( $currentcat = 0, $currentparent = 0, $parent = 0, $level = 0, $categories = 0 ) {
+ _deprecated_function( __FUNCTION__, '3.0.0', 'wp_dropdown_categories()' );
+ if (!$categories )
+ $categories = get_categories( array('hide_empty' => 0) );
+
+ if ( $categories ) {
+ foreach ( $categories as $category ) {
+ if ( $currentcat != $category->term_id && $parent == $category->parent) {
+ $pad = str_repeat( '&#8211; ', $level );
+ $category->name = esc_html( $category->name );
+ echo "\n\t<option value='$category->term_id'";
+ if ( $currentparent == $category->term_id )
+ echo " selected='selected'";
+ echo ">$pad$category->name</option>";
+ wp_dropdown_cats( $currentcat, $currentparent, $category->term_id, $level +1, $categories );
+ }
+ }
+ } else {
+ return false;
+ }
+}
+
+/**
+ * Register a setting and its sanitization callback
+ *
+ * @since 2.7.0
+ * @deprecated 3.0.0 Use register_setting()
+ * @see register_setting()
+ *
+ * @param string $option_group A settings group name. Should correspond to a whitelisted option key name.
+ * Default whitelisted option key names include "general," "discussion," and "reading," among others.
+ * @param string $option_name The name of an option to sanitize and save.
+ * @param callable $sanitize_callback A callback function that sanitizes the option's value.
+ */
+function add_option_update_handler( $option_group, $option_name, $sanitize_callback = '' ) {
+ _deprecated_function( __FUNCTION__, '3.0.0', 'register_setting()' );
+ register_setting( $option_group, $option_name, $sanitize_callback );
+}
+
+/**
+ * Unregister a setting
+ *
+ * @since 2.7.0
+ * @deprecated 3.0.0 Use unregister_setting()
+ * @see unregister_setting()
+ *
+ * @param string $option_group
+ * @param string $option_name
+ * @param callable $sanitize_callback
+ */
+function remove_option_update_handler( $option_group, $option_name, $sanitize_callback = '' ) {
+ _deprecated_function( __FUNCTION__, '3.0.0', 'unregister_setting()' );
+ unregister_setting( $option_group, $option_name, $sanitize_callback );
+}
+
+/**
+ * Determines the language to use for CodePress syntax highlighting.
+ *
+ * @since 2.8.0
+ * @deprecated 3.0.0
+ *
+ * @param string $filename
+**/
+function codepress_get_lang( $filename ) {
+ _deprecated_function( __FUNCTION__, '3.0.0' );
+}
+
+/**
+ * Adds JavaScript required to make CodePress work on the theme/plugin editors.
+ *
+ * @since 2.8.0
+ * @deprecated 3.0.0
+**/
+function codepress_footer_js() {
+ _deprecated_function( __FUNCTION__, '3.0.0' );
+}
+
+/**
+ * Determine whether to use CodePress.
+ *
+ * @since 2.8.0
+ * @deprecated 3.0.0
+**/
+function use_codepress() {
+ _deprecated_function( __FUNCTION__, '3.0.0' );
+}
+
+/**
+ * Get all user IDs.
+ *
+ * @deprecated 3.1.0 Use get_users()
+ *
+ * @global wpdb $wpdb WordPress database abstraction object.
+ *
+ * @return array List of user IDs.
+ */
+function get_author_user_ids() {
+ _deprecated_function( __FUNCTION__, '3.1.0', 'get_users()' );
+
+ global $wpdb;
+ if ( !is_multisite() )
+ $level_key = $wpdb->get_blog_prefix() . 'user_level';
+ else
+ $level_key = $wpdb->get_blog_prefix() . 'capabilities'; // wpmu site admins don't have user_levels
+
+ return $wpdb->get_col( $wpdb->prepare("SELECT user_id FROM $wpdb->usermeta WHERE meta_key = %s AND meta_value != '0'", $level_key) );
+}
+
+/**
+ * Gets author users who can edit posts.
+ *
+ * @deprecated 3.1.0 Use get_users()
+ *
+ * @global wpdb $wpdb WordPress database abstraction object.
+ *
+ * @param int $user_id User ID.
+ * @return array|bool List of editable authors. False if no editable users.
+ */
+function get_editable_authors( $user_id ) {
+ _deprecated_function( __FUNCTION__, '3.1.0', 'get_users()' );
+
+ global $wpdb;
+
+ $editable = get_editable_user_ids( $user_id );
+
+ if ( !$editable ) {
+ return false;
+ } else {
+ $editable = join(',', $editable);
+ $authors = $wpdb->get_results( "SELECT * FROM $wpdb->users WHERE ID IN ($editable) ORDER BY display_name" );
+ }
+
+ return apply_filters('get_editable_authors', $authors);
+}
+
+/**
+ * Gets the IDs of any users who can edit posts.
+ *
+ * @deprecated 3.1.0 Use get_users()
+ *
+ * @global wpdb $wpdb WordPress database abstraction object.
+ *
+ * @param int $user_id User ID.
+ * @param bool $exclude_zeros Optional. Whether to exclude zeroes. Default true.
+ * @return array Array of editable user IDs, empty array otherwise.
+ */
+function get_editable_user_ids( $user_id, $exclude_zeros = true, $post_type = 'post' ) {
+ _deprecated_function( __FUNCTION__, '3.1.0', 'get_users()' );
+
+ global $wpdb;
+
+ if ( ! $user = get_userdata( $user_id ) )
+ return array();
+ $post_type_obj = get_post_type_object($post_type);
+
+ if ( ! $user->has_cap($post_type_obj->cap->edit_others_posts) ) {
+ if ( $user->has_cap($post_type_obj->cap->edit_posts) || ! $exclude_zeros )
+ return array($user->ID);
+ else
+ return array();
+ }
+
+ if ( !is_multisite() )
+ $level_key = $wpdb->get_blog_prefix() . 'user_level';
+ else
+ $level_key = $wpdb->get_blog_prefix() . 'capabilities'; // wpmu site admins don't have user_levels
+
+ $query = $wpdb->prepare("SELECT user_id FROM $wpdb->usermeta WHERE meta_key = %s", $level_key);
+ if ( $exclude_zeros )
+ $query .= " AND meta_value != '0'";
+
+ return $wpdb->get_col( $query );
+}
+
+/**
+ * Gets all users who are not authors.
+ *
+ * @deprecated 3.1.0 Use get_users()
+ *
+ * @global wpdb $wpdb WordPress database abstraction object.
+ */
+function get_nonauthor_user_ids() {
+ _deprecated_function( __FUNCTION__, '3.1.0', 'get_users()' );
+
+ global $wpdb;
+
+ if ( !is_multisite() )
+ $level_key = $wpdb->get_blog_prefix() . 'user_level';
+ else
+ $level_key = $wpdb->get_blog_prefix() . 'capabilities'; // wpmu site admins don't have user_levels
+
+ return $wpdb->get_col( $wpdb->prepare("SELECT user_id FROM $wpdb->usermeta WHERE meta_key = %s AND meta_value = '0'", $level_key) );
+}
+
+if ( ! class_exists( 'WP_User_Search', false ) ) :
+/**
+ * WordPress User Search class.
+ *
+ * @since 2.1.0
+ * @deprecated 3.1.0 Use WP_User_Query
+ */
+class WP_User_Search {
+
+ /**
+ * {@internal Missing Description}}
+ *
+ * @since 2.1.0
+ * @access private
+ * @var mixed
+ */
+ var $results;
+
+ /**
+ * {@internal Missing Description}}
+ *
+ * @since 2.1.0
+ * @access private
+ * @var string
+ */
+ var $search_term;
+
+ /**
+ * Page number.
+ *
+ * @since 2.1.0
+ * @access private
+ * @var int
+ */
+ var $page;
+
+ /**
+ * Role name that users have.
+ *
+ * @since 2.5.0
+ * @access private
+ * @var string
+ */
+ var $role;
+
+ /**
+ * Raw page number.
+ *
+ * @since 2.1.0
+ * @access private
+ * @var int|bool
+ */
+ var $raw_page;
+
+ /**
+ * Amount of users to display per page.
+ *
+ * @since 2.1.0
+ * @access public
+ * @var int
+ */
+ var $users_per_page = 50;
+
+ /**
+ * {@internal Missing Description}}
+ *
+ * @since 2.1.0
+ * @access private
+ * @var int
+ */
+ var $first_user;
+
+ /**
+ * {@internal Missing Description}}
+ *
+ * @since 2.1.0
+ * @access private
+ * @var int
+ */
+ var $last_user;
+
+ /**
+ * {@internal Missing Description}}
+ *
+ * @since 2.1.0
+ * @access private
+ * @var string
+ */
+ var $query_limit;
+
+ /**
+ * {@internal Missing Description}}
+ *
+ * @since 3.0.0
+ * @access private
+ * @var string
+ */
+ var $query_orderby;
+
+ /**
+ * {@internal Missing Description}}
+ *
+ * @since 3.0.0
+ * @access private
+ * @var string
+ */
+ var $query_from;
+
+ /**
+ * {@internal Missing Description}}
+ *
+ * @since 3.0.0
+ * @access private
+ * @var string
+ */
+ var $query_where;
+
+ /**
+ * {@internal Missing Description}}
+ *
+ * @since 2.1.0
+ * @access private
+ * @var int
+ */
+ var $total_users_for_query = 0;
+
+ /**
+ * {@internal Missing Description}}
+ *
+ * @since 2.1.0
+ * @access private
+ * @var bool
+ */
+ var $too_many_total_users = false;
+
+ /**
+ * {@internal Missing Description}}
+ *
+ * @since 2.1.0
+ * @access private
+ * @var WP_Error
+ */
+ var $search_errors;
+
+ /**
+ * {@internal Missing Description}}
+ *
+ * @since 2.7.0
+ * @access private
+ * @var string
+ */
+ var $paging_text;
+
+ /**
+ * PHP5 Constructor - Sets up the object properties.
+ *
+ * @since 2.1.0
+ *
+ * @param string $search_term Search terms string.
+ * @param int $page Optional. Page ID.
+ * @param string $role Role name.
+ * @return WP_User_Search
+ */
+ function __construct( $search_term = '', $page = '', $role = '' ) {
+ _deprecated_function( __FUNCTION__, '3.1.0', 'WP_User_Query' );
+
+ $this->search_term = wp_unslash( $search_term );
+ $this->raw_page = ( '' == $page ) ? false : (int) $page;
+ $this->page = (int) ( '' == $page ) ? 1 : $page;
+ $this->role = $role;
+
+ $this->prepare_query();
+ $this->query();
+ $this->do_paging();
+ }
+
+ /**
+ * PHP4 Constructor - Sets up the object properties.
+ *
+ * @since 2.1.0
+ *
+ * @param string $search_term Search terms string.
+ * @param int $page Optional. Page ID.
+ * @param string $role Role name.
+ * @return WP_User_Search
+ */
+ public function WP_User_Search( $search_term = '', $page = '', $role = '' ) {
+ self::__construct( $search_term, $page, $role );
+ }
+
+ /**
+ * Prepares the user search query (legacy).
+ *
+ * @since 2.1.0
+ * @access public
+ */
+ public function prepare_query() {
+ global $wpdb;
+ $this->first_user = ($this->page - 1) * $this->users_per_page;
+
+ $this->query_limit = $wpdb->prepare(" LIMIT %d, %d", $this->first_user, $this->users_per_page);
+ $this->query_orderby = ' ORDER BY user_login';
+
+ $search_sql = '';
+ if ( $this->search_term ) {
+ $searches = array();
+ $search_sql = 'AND (';
+ foreach ( array('user_login', 'user_nicename', 'user_email', 'user_url', 'display_name') as $col )
+ $searches[] = $wpdb->prepare( $col . ' LIKE %s', '%' . like_escape($this->search_term) . '%' );
+ $search_sql .= implode(' OR ', $searches);
+ $search_sql .= ')';
+ }
+
+ $this->query_from = " FROM $wpdb->users";
+ $this->query_where = " WHERE 1=1 $search_sql";
+
+ if ( $this->role ) {
+ $this->query_from .= " INNER JOIN $wpdb->usermeta ON $wpdb->users.ID = $wpdb->usermeta.user_id";
+ $this->query_where .= $wpdb->prepare(" AND $wpdb->usermeta.meta_key = '{$wpdb->prefix}capabilities' AND $wpdb->usermeta.meta_value LIKE %s", '%' . $this->role . '%');
+ } elseif ( is_multisite() ) {
+ $level_key = $wpdb->prefix . 'capabilities'; // wpmu site admins don't have user_levels
+ $this->query_from .= ", $wpdb->usermeta";
+ $this->query_where .= " AND $wpdb->users.ID = $wpdb->usermeta.user_id AND meta_key = '{$level_key}'";
+ }
+
+ do_action_ref_array( 'pre_user_search', array( &$this ) );
+ }
+
+ /**
+ * Executes the user search query.
+ *
+ * @since 2.1.0
+ * @access public
+ */
+ public function query() {
+ global $wpdb;
+
+ $this->results = $wpdb->get_col("SELECT DISTINCT($wpdb->users.ID)" . $this->query_from . $this->query_where . $this->query_orderby . $this->query_limit);
+
+ if ( $this->results )
+ $this->total_users_for_query = $wpdb->get_var("SELECT COUNT(DISTINCT($wpdb->users.ID))" . $this->query_from . $this->query_where); // no limit
+ else
+ $this->search_errors = new WP_Error('no_matching_users_found', __('No users found.'));
+ }
+
+ /**
+ * Prepares variables for use in templates.
+ *
+ * @since 2.1.0
+ * @access public
+ */
+ function prepare_vars_for_template_usage() {}
+
+ /**
+ * Handles paging for the user search query.
+ *
+ * @since 2.1.0
+ * @access public
+ */
+ public function do_paging() {
+ if ( $this->total_users_for_query > $this->users_per_page ) { // have to page the results
+ $args = array();
+ if ( ! empty($this->search_term) )
+ $args['usersearch'] = urlencode($this->search_term);
+ if ( ! empty($this->role) )
+ $args['role'] = urlencode($this->role);
+
+ $this->paging_text = paginate_links( array(
+ 'total' => ceil($this->total_users_for_query / $this->users_per_page),
+ 'current' => $this->page,
+ 'base' => 'users.php?%_%',
+ 'format' => 'userspage=%#%',
+ 'add_args' => $args
+ ) );
+ if ( $this->paging_text ) {
+ $this->paging_text = sprintf( '<span class="displaying-num">' . __( 'Displaying %s&#8211;%s of %s' ) . '</span>%s',
+ number_format_i18n( ( $this->page - 1 ) * $this->users_per_page + 1 ),
+ number_format_i18n( min( $this->page * $this->users_per_page, $this->total_users_for_query ) ),
+ number_format_i18n( $this->total_users_for_query ),
+ $this->paging_text
+ );
+ }
+ }
+ }
+
+ /**
+ * Retrieves the user search query results.
+ *
+ * @since 2.1.0
+ * @access public
+ *
+ * @return array
+ */
+ public function get_results() {
+ return (array) $this->results;
+ }
+
+ /**
+ * Displaying paging text.
+ *
+ * @see do_paging() Builds paging text.
+ *
+ * @since 2.1.0
+ * @access public
+ */
+ function page_links() {
+ echo $this->paging_text;
+ }
+
+ /**
+ * Whether paging is enabled.
+ *
+ * @see do_paging() Builds paging text.
+ *
+ * @since 2.1.0
+ * @access public
+ *
+ * @return bool
+ */
+ function results_are_paged() {
+ if ( $this->paging_text )
+ return true;
+ return false;
+ }
+
+ /**
+ * Whether there are search terms.
+ *
+ * @since 2.1.0
+ * @access public
+ *
+ * @return bool
+ */
+ function is_search() {
+ if ( $this->search_term )
+ return true;
+ return false;
+ }
+}
+endif;
+
+/**
+ * Retrieves editable posts from other users.
+ *
+ * @since 2.3.0
+ * @deprecated 3.1.0 Use get_posts()
+ * @see get_posts()
+ *
+ * @global wpdb $wpdb WordPress database abstraction object.
+ *
+ * @param int $user_id User ID to not retrieve posts from.
+ * @param string $type Optional. Post type to retrieve. Accepts 'draft', 'pending' or 'any' (all).
+ * Default 'any'.
+ * @return array List of posts from others.
+ */
+function get_others_unpublished_posts( $user_id, $type = 'any' ) {
+ _deprecated_function( __FUNCTION__, '3.1.0' );
+
+ global $wpdb;
+
+ $editable = get_editable_user_ids( $user_id );
+
+ if ( in_array($type, array('draft', 'pending')) )
+ $type_sql = " post_status = '$type' ";
+ else
+ $type_sql = " ( post_status = 'draft' OR post_status = 'pending' ) ";
+
+ $dir = ( 'pending' == $type ) ? 'ASC' : 'DESC';
+
+ if ( !$editable ) {
+ $other_unpubs = '';
+ } else {
+ $editable = join(',', $editable);
+ $other_unpubs = $wpdb->get_results( $wpdb->prepare("SELECT ID, post_title, post_author FROM $wpdb->posts WHERE post_type = 'post' AND $type_sql AND post_author IN ($editable) AND post_author != %d ORDER BY post_modified $dir", $user_id) );
+ }
+
+ return apply_filters('get_others_drafts', $other_unpubs);
+}
+
+/**
+ * Retrieve drafts from other users.
+ *
+ * @deprecated 3.1.0 Use get_posts()
+ * @see get_posts()
+ *
+ * @param int $user_id User ID.
+ * @return array List of drafts from other users.
+ */
+function get_others_drafts($user_id) {
+ _deprecated_function( __FUNCTION__, '3.1.0' );
+
+ return get_others_unpublished_posts($user_id, 'draft');
+}
+
+/**
+ * Retrieve pending review posts from other users.
+ *
+ * @deprecated 3.1.0 Use get_posts()
+ * @see get_posts()
+ *
+ * @param int $user_id User ID.
+ * @return array List of posts with pending review post type from other users.
+ */
+function get_others_pending($user_id) {
+ _deprecated_function( __FUNCTION__, '3.1.0' );
+
+ return get_others_unpublished_posts($user_id, 'pending');
+}
+
+/**
+ * Output the QuickPress dashboard widget.
+ *
+ * @since 3.0.0
+ * @deprecated 3.2.0 Use wp_dashboard_quick_press()
+ * @see wp_dashboard_quick_press()
+ */
+function wp_dashboard_quick_press_output() {
+ _deprecated_function( __FUNCTION__, '3.2.0', 'wp_dashboard_quick_press()' );
+ wp_dashboard_quick_press();
+}
+
+/**
+ * Outputs the TinyMCE editor.
+ *
+ * @since 2.7.0
+ * @deprecated 3.3.0 Use wp_editor()
+ * @see wp_editor()
+ *
+ * @staticvar int $num
+ */
+function wp_tiny_mce( $teeny = false, $settings = false ) {
+ _deprecated_function( __FUNCTION__, '3.3.0', 'wp_editor()' );
+
+ static $num = 1;
+
+ if ( ! class_exists( '_WP_Editors', false ) )
+ require_once( ABSPATH . WPINC . '/class-wp-editor.php' );
+
+ $editor_id = 'content' . $num++;
+
+ $set = array(
+ 'teeny' => $teeny,
+ 'tinymce' => $settings ? $settings : true,
+ 'quicktags' => false
+ );
+
+ $set = _WP_Editors::parse_settings($editor_id, $set);
+ _WP_Editors::editor_settings($editor_id, $set);
+}
+
+/**
+ * Preloads TinyMCE dialogs.
+ *
+ * @deprecated 3.3.0 Use wp_editor()
+ * @see wp_editor()
+ */
+function wp_preload_dialogs() {
+ _deprecated_function( __FUNCTION__, '3.3.0', 'wp_editor()' );
+}
+
+/**
+ * Prints TinyMCE editor JS.
+ *
+ * @deprecated 3.3.0 Use wp_editor()
+ * @see wp_editor()
+ */
+function wp_print_editor_js() {
+ _deprecated_function( __FUNCTION__, '3.3.0', 'wp_editor()' );
+}
+
+/**
+ * Handles quicktags.
+ *
+ * @deprecated 3.3.0 Use wp_editor()
+ * @see wp_editor()
+ */
+function wp_quicktags() {
+ _deprecated_function( __FUNCTION__, '3.3.0', 'wp_editor()' );
+}
+
+/**
+ * Returns the screen layout options.
+ *
+ * @since 2.8.0
+ * @deprecated 3.3.0 WP_Screen::render_screen_layout()
+ * @see WP_Screen::render_screen_layout()
+ */
+function screen_layout( $screen ) {
+ _deprecated_function( __FUNCTION__, '3.3.0', '$current_screen->render_screen_layout()' );
+
+ $current_screen = get_current_screen();
+
+ if ( ! $current_screen )
+ return '';
+
+ ob_start();
+ $current_screen->render_screen_layout();
+ return ob_get_clean();
+}
+
+/**
+ * Returns the screen's per-page options.
+ *
+ * @since 2.8.0
+ * @deprecated 3.3.0 Use WP_Screen::render_per_page_options()
+ * @see WP_Screen::render_per_page_options()
+ */
+function screen_options( $screen ) {
+ _deprecated_function( __FUNCTION__, '3.3.0', '$current_screen->render_per_page_options()' );
+
+ $current_screen = get_current_screen();
+
+ if ( ! $current_screen )
+ return '';
+
+ ob_start();
+ $current_screen->render_per_page_options();
+ return ob_get_clean();
+}
+
+/**
+ * Renders the screen's help.
+ *
+ * @since 2.7.0
+ * @deprecated 3.3.0 Use WP_Screen::render_screen_meta()
+ * @see WP_Screen::render_screen_meta()
+ */
+function screen_meta( $screen ) {
+ $current_screen = get_current_screen();
+ $current_screen->render_screen_meta();
+}
+
+/**
+ * Favorite actions were deprecated in version 3.2. Use the admin bar instead.
+ *
+ * @since 2.7.0
+ * @deprecated 3.2.0 Use WP_Admin_Bar
+ * @see WP_Admin_Bar
+ */
+function favorite_actions() {
+ _deprecated_function( __FUNCTION__, '3.2.0', 'WP_Admin_Bar' );
+}
+
+/**
+ * Handles uploading an image.
+ *
+ * @deprecated 3.3.0 Use wp_media_upload_handler()
+ * @see wp_media_upload_handler()
+ *
+ * @return null|string
+ */
+function media_upload_image() {
+ _deprecated_function( __FUNCTION__, '3.3.0', 'wp_media_upload_handler()' );
+ return wp_media_upload_handler();
+}
+
+/**
+ * Handles uploading an audio file.
+ *
+ * @deprecated 3.3.0 Use wp_media_upload_handler()
+ * @see wp_media_upload_handler()
+ *
+ * @return null|string
+ */
+function media_upload_audio() {
+ _deprecated_function( __FUNCTION__, '3.3.0', 'wp_media_upload_handler()' );
+ return wp_media_upload_handler();
+}
+
+/**
+ * Handles uploading a video file.
+ *
+ * @deprecated 3.3.0 Use wp_media_upload_handler()
+ * @see wp_media_upload_handler()
+ *
+ * @return null|string
+ */
+function media_upload_video() {
+ _deprecated_function( __FUNCTION__, '3.3.0', 'wp_media_upload_handler()' );
+ return wp_media_upload_handler();
+}
+
+/**
+ * Handles uploading a generic file.
+ *
+ * @deprecated 3.3.0 Use wp_media_upload_handler()
+ * @see wp_media_upload_handler()
+ *
+ * @return null|string
+ */
+function media_upload_file() {
+ _deprecated_function( __FUNCTION__, '3.3.0', 'wp_media_upload_handler()' );
+ return wp_media_upload_handler();
+}
+
+/**
+ * Handles retrieving the insert-from-URL form for an image.
+ *
+ * @deprecated 3.3.0 Use wp_media_insert_url_form()
+ * @see wp_media_insert_url_form()
+ *
+ * @return string
+ */
+function type_url_form_image() {
+ _deprecated_function( __FUNCTION__, '3.3.0', "wp_media_insert_url_form('image')" );
+ return wp_media_insert_url_form( 'image' );
+}
+
+/**
+ * Handles retrieving the insert-from-URL form for an audio file.
+ *
+ * @deprecated 3.3.0 Use wp_media_insert_url_form()
+ * @see wp_media_insert_url_form()
+ *
+ * @return string
+ */
+function type_url_form_audio() {
+ _deprecated_function( __FUNCTION__, '3.3.0', "wp_media_insert_url_form('audio')" );
+ return wp_media_insert_url_form( 'audio' );
+}
+
+/**
+ * Handles retrieving the insert-from-URL form for a video file.
+ *
+ * @deprecated 3.3.0 Use wp_media_insert_url_form()
+ * @see wp_media_insert_url_form()
+ *
+ * @return string
+ */
+function type_url_form_video() {
+ _deprecated_function( __FUNCTION__, '3.3.0', "wp_media_insert_url_form('video')" );
+ return wp_media_insert_url_form( 'video' );
+}
+
+/**
+ * Handles retrieving the insert-from-URL form for a generic file.
+ *
+ * @deprecated 3.3.0 Use wp_media_insert_url_form()
+ * @see wp_media_insert_url_form()
+ *
+ * @return string
+ */
+function type_url_form_file() {
+ _deprecated_function( __FUNCTION__, '3.3.0', "wp_media_insert_url_form('file')" );
+ return wp_media_insert_url_form( 'file' );
+}
+
+/**
+ * Add contextual help text for a page.
+ *
+ * Creates an 'Overview' help tab.
+ *
+ * @since 2.7.0
+ * @deprecated 3.3.0 Use WP_Screen::add_help_tab()
+ * @see WP_Screen::add_help_tab()
+ *
+ * @param string $screen The handle for the screen to add help to. This is usually the hook name returned by the add_*_page() functions.
+ * @param string $help The content of an 'Overview' help tab.
+ */
+function add_contextual_help( $screen, $help ) {
+ _deprecated_function( __FUNCTION__, '3.3.0', 'get_current_screen()->add_help_tab()' );
+
+ if ( is_string( $screen ) )
+ $screen = convert_to_screen( $screen );
+
+ WP_Screen::add_old_compat_help( $screen, $help );
+}
+
+/**
+ * Get the allowed themes for the current site.
+ *
+ * @since 3.0.0
+ * @deprecated 3.4.0 Use wp_get_themes()
+ * @see wp_get_themes()
+ *
+ * @return array $themes Array of allowed themes.
+ */
+function get_allowed_themes() {
+ _deprecated_function( __FUNCTION__, '3.4.0', "wp_get_themes( array( 'allowed' => true ) )" );
+
+ $themes = wp_get_themes( array( 'allowed' => true ) );
+
+ $wp_themes = array();
+ foreach ( $themes as $theme ) {
+ $wp_themes[ $theme->get('Name') ] = $theme;
+ }
+
+ return $wp_themes;
+}
+
+/**
+ * Retrieves a list of broken themes.
+ *
+ * @since 1.5.0
+ * @deprecated 3.4.0 Use wp_get_themes()
+ * @see wp_get_themes()
+ *
+ * @return array
+ */
+function get_broken_themes() {
+ _deprecated_function( __FUNCTION__, '3.4.0', "wp_get_themes( array( 'errors' => true )" );
+
+ $themes = wp_get_themes( array( 'errors' => true ) );
+ $broken = array();
+ foreach ( $themes as $theme ) {
+ $name = $theme->get('Name');
+ $broken[ $name ] = array(
+ 'Name' => $name,
+ 'Title' => $name,
+ 'Description' => $theme->errors()->get_error_message(),
+ );
+ }
+ return $broken;
+}
+
+/**
+ * Retrieves information on the current active theme.
+ *
+ * @since 2.0.0
+ * @deprecated 3.4.0 Use wp_get_theme()
+ * @see wp_get_theme()
+ *
+ * @return WP_Theme
+ */
+function current_theme_info() {
+ _deprecated_function( __FUNCTION__, '3.4.0', 'wp_get_theme()' );
+
+ return wp_get_theme();
+}
+
+/**
+ * This was once used to display an 'Insert into Post' button.
+ *
+ * Now it is deprecated and stubbed.
+ *
+ * @deprecated 3.5.0
+ */
+function _insert_into_post_button( $type ) {
+ _deprecated_function( __FUNCTION__, '3.5.0' );
+}
+
+/**
+ * This was once used to display a media button.
+ *
+ * Now it is deprecated and stubbed.
+ *
+ * @deprecated 3.5.0
+ */
+function _media_button($title, $icon, $type, $id) {
+ _deprecated_function( __FUNCTION__, '3.5.0' );
+}
+
+/**
+ * Gets an existing post and format it for editing.
+ *
+ * @since 2.0.0
+ * @deprecated 3.5.0 Use get_post()
+ * @see get_post()
+ *
+ * @param int $id
+ * @return object
+ */
+function get_post_to_edit( $id ) {
+ _deprecated_function( __FUNCTION__, '3.5.0', 'get_post()' );
+
+ return get_post( $id, OBJECT, 'edit' );
+}
+
+/**
+ * Gets the default page information to use.
+ *
+ * @since 2.5.0
+ * @deprecated 3.5.0 Use get_default_post_to_edit()
+ * @see get_default_post_to_edit()
+ *
+ * @return WP_Post Post object containing all the default post data as attributes
+ */
+function get_default_page_to_edit() {
+ _deprecated_function( __FUNCTION__, '3.5.0', "get_default_post_to_edit( 'page' )" );
+
+ $page = get_default_post_to_edit();
+ $page->post_type = 'page';
+ return $page;
+}
+
+/**
+ * This was once used to create a thumbnail from an Image given a maximum side size.
+ *
+ * @since 1.2.0
+ * @deprecated 3.5.0 Use image_resize()
+ * @see image_resize()
+ *
+ * @param mixed $file Filename of the original image, Or attachment id.
+ * @param int $max_side Maximum length of a single side for the thumbnail.
+ * @param mixed $deprecated Never used.
+ * @return string Thumbnail path on success, Error string on failure.
+ */
+function wp_create_thumbnail( $file, $max_side, $deprecated = '' ) {
+ _deprecated_function( __FUNCTION__, '3.5.0', 'image_resize()' );
+ return apply_filters( 'wp_create_thumbnail', image_resize( $file, $max_side, $max_side ) );
+}
+
+/**
+ * This was once used to display a meta box for the nav menu theme locations.
+ *
+ * Deprecated in favor of a 'Manage Locations' tab added to nav menus management screen.
+ *
+ * @since 3.0.0
+ * @deprecated 3.6.0
+ */
+function wp_nav_menu_locations_meta_box() {
+ _deprecated_function( __FUNCTION__, '3.6.0' );
+}
+
+/**
+ * This was once used to kick-off the Core Updater.
+ *
+ * Deprecated in favor of instantating a Core_Upgrader instance directly,
+ * and calling the 'upgrade' method.
+ *
+ * @since 2.7.0
+ * @deprecated 3.7.0 Use Core_Upgrader
+ * @see Core_Upgrader
+ */
+function wp_update_core($current, $feedback = '') {
+ _deprecated_function( __FUNCTION__, '3.7.0', 'new Core_Upgrader();' );
+
+ if ( !empty($feedback) )
+ add_filter('update_feedback', $feedback);
+
+ include( ABSPATH . 'wp-admin/includes/class-wp-upgrader.php' );
+ $upgrader = new Core_Upgrader();
+ return $upgrader->upgrade($current);
+
+}
+
+/**
+ * This was once used to kick-off the Plugin Updater.
+ *
+ * Deprecated in favor of instantating a Plugin_Upgrader instance directly,
+ * and calling the 'upgrade' method.
+ * Unused since 2.8.0.
+ *
+ * @since 2.5.0
+ * @deprecated 3.7.0 Use Plugin_Upgrader
+ * @see Plugin_Upgrader
+ */
+function wp_update_plugin($plugin, $feedback = '') {
+ _deprecated_function( __FUNCTION__, '3.7.0', 'new Plugin_Upgrader();' );
+
+ if ( !empty($feedback) )
+ add_filter('update_feedback', $feedback);
+
+ include( ABSPATH . 'wp-admin/includes/class-wp-upgrader.php' );
+ $upgrader = new Plugin_Upgrader();
+ return $upgrader->upgrade($plugin);
+}
+
+/**
+ * This was once used to kick-off the Theme Updater.
+ *
+ * Deprecated in favor of instantiating a Theme_Upgrader instance directly,
+ * and calling the 'upgrade' method.
+ * Unused since 2.8.0.
+ *
+ * @since 2.7.0
+ * @deprecated 3.7.0 Use Theme_Upgrader
+ * @see Theme_Upgrader
+ */
+function wp_update_theme($theme, $feedback = '') {
+ _deprecated_function( __FUNCTION__, '3.7.0', 'new Theme_Upgrader();' );
+
+ if ( !empty($feedback) )
+ add_filter('update_feedback', $feedback);
+
+ include( ABSPATH . 'wp-admin/includes/class-wp-upgrader.php' );
+ $upgrader = new Theme_Upgrader();
+ return $upgrader->upgrade($theme);
+}
+
+/**
+ * This was once used to display attachment links. Now it is deprecated and stubbed.
+ *
+ * @since 2.0.0
+ * @deprecated 3.7.0
+ *
+ * @param int|bool $id
+ */
+function the_attachment_links( $id = false ) {
+ _deprecated_function( __FUNCTION__, '3.7.0' );
+}
+
+/**
+ * Displays a screen icon.
+ *
+ * @since 2.7.0
+ * @deprecated 3.8.0
+ */
+function screen_icon() {
+ _deprecated_function( __FUNCTION__, '3.8.0' );
+ echo get_screen_icon();
+}
+
+/**
+ * Retrieves the screen icon (no longer used in 3.8+).
+ *
+ * @since 3.2.0
+ * @deprecated 3.8.0
+ *
+ * @return string An HTML comment explaining that icons are no longer used.
+ */
+function get_screen_icon() {
+ _deprecated_function( __FUNCTION__, '3.8.0' );
+ return '<!-- Screen icons are no longer used as of WordPress 3.8. -->';
+}
+
+/**
+ * Deprecated dashboard widget controls.
+ *
+ * @since 2.5.0
+ * @deprecated 3.8.0
+ */
+function wp_dashboard_incoming_links_output() {}
+
+/**
+ * Deprecated dashboard secondary output.
+ *
+ * @deprecated 3.8.0
+ */
+function wp_dashboard_secondary_output() {}
+
+/**
+ * Deprecated dashboard widget controls.
+ *
+ * @since 2.7.0
+ * @deprecated 3.8.0
+ */
+function wp_dashboard_incoming_links() {}
+
+/**
+ * Deprecated dashboard incoming links control.
+ *
+ * @deprecated 3.8.0
+ */
+function wp_dashboard_incoming_links_control() {}
+
+/**
+ * Deprecated dashboard plugins control.
+ *
+ * @deprecated 3.8.0
+ */
+function wp_dashboard_plugins() {}
+
+/**
+ * Deprecated dashboard primary control.
+ *
+ * @deprecated 3.8.0
+ */
+function wp_dashboard_primary_control() {}
+
+/**
+ * Deprecated dashboard recent comments control.
+ *
+ * @deprecated 3.8.0
+ */
+function wp_dashboard_recent_comments_control() {}
+
+/**
+ * Deprecated dashboard secondary section.
+ *
+ * @deprecated 3.8.0
+ */
+function wp_dashboard_secondary() {}
+
+/**
+ * Deprecated dashboard secondary control.
+ *
+ * @deprecated 3.8.0
+ */
+function wp_dashboard_secondary_control() {}
+
+/**
+ * Display plugins text for the WordPress news widget.
+ *
+ * @since 2.5.0
+ * @deprecated 4.8.0
+ *
+ * @param string $rss The RSS feed URL.
+ * @param array $args Array of arguments for this RSS feed.
+ */
+function wp_dashboard_plugins_output( $rss, $args = array() ) {
+ _deprecated_function( __FUNCTION__, '4.8.0' );
+
+ // Plugin feeds plus link to install them
+ $popular = fetch_feed( $args['url']['popular'] );
+
+ if ( false === $plugin_slugs = get_transient( 'plugin_slugs' ) ) {
+ $plugin_slugs = array_keys( get_plugins() );
+ set_transient( 'plugin_slugs', $plugin_slugs, DAY_IN_SECONDS );
+ }
+
+ echo '<ul>';
+
+ foreach ( array( $popular ) as $feed ) {
+ if ( is_wp_error( $feed ) || ! $feed->get_item_quantity() )
+ continue;
+
+ $items = $feed->get_items(0, 5);
+
+ // Pick a random, non-installed plugin
+ while ( true ) {
+ // Abort this foreach loop iteration if there's no plugins left of this type
+ if ( 0 == count($items) )
+ continue 2;
+
+ $item_key = array_rand($items);
+ $item = $items[$item_key];
+
+ list($link, $frag) = explode( '#', $item->get_link() );
+
+ $link = esc_url($link);
+ if ( preg_match( '|/([^/]+?)/?$|', $link, $matches ) )
+ $slug = $matches[1];
+ else {
+ unset( $items[$item_key] );
+ continue;
+ }
+
+ // Is this random plugin's slug already installed? If so, try again.
+ reset( $plugin_slugs );
+ foreach ( $plugin_slugs as $plugin_slug ) {
+ if ( $slug == substr( $plugin_slug, 0, strlen( $slug ) ) ) {
+ unset( $items[$item_key] );
+ continue 2;
+ }
+ }
+
+ // If we get to this point, then the random plugin isn't installed and we can stop the while().
+ break;
+ }
+
+ // Eliminate some common badly formed plugin descriptions
+ while ( ( null !== $item_key = array_rand($items) ) && false !== strpos( $items[$item_key]->get_description(), 'Plugin Name:' ) )
+ unset($items[$item_key]);
+
+ if ( !isset($items[$item_key]) )
+ continue;
+
+ $raw_title = $item->get_title();
+
+ $ilink = wp_nonce_url('plugin-install.php?tab=plugin-information&plugin=' . $slug, 'install-plugin_' . $slug) . '&amp;TB_iframe=true&amp;width=600&amp;height=800';
+ echo '<li class="dashboard-news-plugin"><span>' . __( 'Popular Plugin' ) . ':</span> ' . esc_html( $raw_title ) .
+ '&nbsp;<a href="' . $ilink . '" class="thickbox open-plugin-details-modal" aria-label="' .
+ /* translators: %s: plugin name */
+ esc_attr( sprintf( __( 'Install %s' ), $raw_title ) ) . '">(' . __( 'Install' ) . ')</a></li>';
+
+ $feed->__destruct();
+ unset( $feed );
+ }
+
+ echo '</ul>';
+}
+
+/**
+ * This was once used to move child posts to a new parent.
+ *
+ * @since 2.3.0
+ * @deprecated 3.9.0
+ * @access private
+ *
+ * @param int $old_ID
+ * @param int $new_ID
+ */
+function _relocate_children( $old_ID, $new_ID ) {
+ _deprecated_function( __FUNCTION__, '3.9.0' );
+}
+
+/**
+ * Add a top-level menu page in the 'objects' section.
+ *
+ * This function takes a capability which will be used to determine whether
+ * or not a page is included in the menu.
+ *
+ * The function which is hooked in to handle the output of the page must check
+ * that the user has the required capability as well.
+ *
+ * @since 2.7.0
+ *
+ * @deprecated 4.5.0 Use add_menu_page()
+ * @see add_menu_page()
+ * @global int $_wp_last_object_menu
+ *
+ * @param string $page_title The text to be displayed in the title tags of the page when the menu is selected.
+ * @param string $menu_title The text to be used for the menu.
+ * @param string $capability The capability required for this menu to be displayed to the user.
+ * @param string $menu_slug The slug name to refer to this menu by (should be unique for this menu).
+ * @param callable $function The function to be called to output the content for this page.
+ * @param string $icon_url The url to the icon to be used for this menu.
+ * @return string The resulting page's hook_suffix.
+ */
+function add_object_page( $page_title, $menu_title, $capability, $menu_slug, $function = '', $icon_url = '') {
+ _deprecated_function( __FUNCTION__, '4.5.0', 'add_menu_page()' );
+
+ global $_wp_last_object_menu;
+
+ $_wp_last_object_menu++;
+
+ return add_menu_page($page_title, $menu_title, $capability, $menu_slug, $function, $icon_url, $_wp_last_object_menu);
+}
+
+/**
+ * Add a top-level menu page in the 'utility' section.
+ *
+ * This function takes a capability which will be used to determine whether
+ * or not a page is included in the menu.
+ *
+ * The function which is hooked in to handle the output of the page must check
+ * that the user has the required capability as well.
+ *
+ * @since 2.7.0
+ *
+ * @deprecated 4.5.0 Use add_menu_page()
+ * @see add_menu_page()
+ * @global int $_wp_last_utility_menu
+ *
+ * @param string $page_title The text to be displayed in the title tags of the page when the menu is selected.
+ * @param string $menu_title The text to be used for the menu.
+ * @param string $capability The capability required for this menu to be displayed to the user.
+ * @param string $menu_slug The slug name to refer to this menu by (should be unique for this menu).
+ * @param callable $function The function to be called to output the content for this page.
+ * @param string $icon_url The url to the icon to be used for this menu.
+ * @return string The resulting page's hook_suffix.
+ */
+function add_utility_page( $page_title, $menu_title, $capability, $menu_slug, $function = '', $icon_url = '') {
+ _deprecated_function( __FUNCTION__, '4.5.0', 'add_menu_page()' );
+
+ global $_wp_last_utility_menu;
+
+ $_wp_last_utility_menu++;
+
+ return add_menu_page($page_title, $menu_title, $capability, $menu_slug, $function, $icon_url, $_wp_last_utility_menu);
+}
+
+/**
+ * Disables autocomplete on the 'post' form (Add/Edit Post screens) for WebKit browsers,
+ * as they disregard the autocomplete setting on the editor textarea. That can break the editor
+ * when the user navigates to it with the browser's Back button. See #28037
+ *
+ * Replaced with wp_page_reload_on_back_button_js() that also fixes this problem.
+ *
+ * @since 4.0.0
+ * @deprecated 4.6.0
+ *
+ * @link https://core.trac.wordpress.org/ticket/35852
+ *
+ * @global bool $is_safari
+ * @global bool $is_chrome
+ */
+function post_form_autocomplete_off() {
+ global $is_safari, $is_chrome;
+
+ _deprecated_function( __FUNCTION__, '4.6.0' );
+
+ if ( $is_safari || $is_chrome ) {
+ echo ' autocomplete="off"';
+ }
+}
+
+/**
+ * Display JavaScript on the page.
+ *
+ * @since 3.5.0
+ * @deprecated 4.9.0
+ */
+function options_permalink_add_js() {
+ ?>
+ <script type="text/javascript">
+ jQuery(document).ready(function() {
+ jQuery('.permalink-structure input:radio').change(function() {
+ if ( 'custom' == this.value )
+ return;
+ jQuery('#permalink_structure').val( this.value );
+ });
+ jQuery( '#permalink_structure' ).on( 'click input', function() {
+ jQuery( '#custom_selection' ).prop( 'checked', true );
+ });
+ });
+ </script>
+ <?php
+}
diff --git a/www/crm/wp-admin/includes/edit-tag-messages.php b/www/crm/wp-admin/includes/edit-tag-messages.php
new file mode 100644
index 00000000..6dc5e7ab
--- /dev/null
+++ b/www/crm/wp-admin/includes/edit-tag-messages.php
@@ -0,0 +1,58 @@
+<?php
+/**
+ * Edit Tags Administration: Messages
+ *
+ * @package WordPress
+ * @subpackage Administration
+ * @since 4.4.0
+ */
+
+$messages = array();
+// 0 = unused. Messages start at index 1.
+$messages['_item'] = array(
+ 0 => '',
+ 1 => __( 'Item added.' ),
+ 2 => __( 'Item deleted.' ),
+ 3 => __( 'Item updated.' ),
+ 4 => __( 'Item not added.' ),
+ 5 => __( 'Item not updated.' ),
+ 6 => __( 'Items deleted.' ),
+);
+
+$messages['category'] = array(
+ 0 => '',
+ 1 => __( 'Category added.' ),
+ 2 => __( 'Category deleted.' ),
+ 3 => __( 'Category updated.' ),
+ 4 => __( 'Category not added.' ),
+ 5 => __( 'Category not updated.' ),
+ 6 => __( 'Categories deleted.' ),
+);
+
+$messages['post_tag'] = array(
+ 0 => '',
+ 1 => __( 'Tag added.' ),
+ 2 => __( 'Tag deleted.' ),
+ 3 => __( 'Tag updated.' ),
+ 4 => __( 'Tag not added.' ),
+ 5 => __( 'Tag not updated.' ),
+ 6 => __( 'Tags deleted.' ),
+);
+
+/**
+ * Filters the messages displayed when a tag is updated.
+ *
+ * @since 3.7.0
+ *
+ * @param array $messages The messages to be displayed.
+ */
+$messages = apply_filters( 'term_updated_messages', $messages );
+
+$message = false;
+if ( isset( $_REQUEST['message'] ) && ( $msg = (int) $_REQUEST['message'] ) ) {
+ if ( isset( $messages[ $taxonomy ][ $msg ] ) ) {
+ $message = $messages[ $taxonomy ][ $msg ];
+ } elseif ( ! isset( $messages[ $taxonomy ] ) && isset( $messages['_item'][ $msg ] ) ) {
+ $message = $messages['_item'][ $msg ];
+ }
+}
diff --git a/www/crm/wp-admin/includes/export.php b/www/crm/wp-admin/includes/export.php
new file mode 100644
index 00000000..56003714
--- /dev/null
+++ b/www/crm/wp-admin/includes/export.php
@@ -0,0 +1,660 @@
+<?php
+/**
+ * WordPress Export Administration API
+ *
+ * @package WordPress
+ * @subpackage Administration
+ */
+
+/**
+ * Version number for the export format.
+ *
+ * Bump this when something changes that might affect compatibility.
+ *
+ * @since 2.5.0
+ */
+define( 'WXR_VERSION', '1.2' );
+
+/**
+ * Generates the WXR export file for download.
+ *
+ * Default behavior is to export all content, however, note that post content will only
+ * be exported for post types with the `can_export` argument enabled. Any posts with the
+ * 'auto-draft' status will be skipped.
+ *
+ * @since 2.1.0
+ *
+ * @global wpdb $wpdb WordPress database abstraction object.
+ * @global WP_Post $post Global `$post`.
+ *
+ * @param array $args {
+ * Optional. Arguments for generating the WXR export file for download. Default empty array.
+ *
+ * @type string $content Type of content to export. If set, only the post content of this post type
+ * will be exported. Accepts 'all', 'post', 'page', 'attachment', or a defined
+ * custom post. If an invalid custom post type is supplied, every post type for
+ * which `can_export` is enabled will be exported instead. If a valid custom post
+ * type is supplied but `can_export` is disabled, then 'posts' will be exported
+ * instead. When 'all' is supplied, only post types with `can_export` enabled will
+ * be exported. Default 'all'.
+ * @type string $author Author to export content for. Only used when `$content` is 'post', 'page', or
+ * 'attachment'. Accepts false (all) or a specific author ID. Default false (all).
+ * @type string $category Category (slug) to export content for. Used only when `$content` is 'post'. If
+ * set, only post content assigned to `$category` will be exported. Accepts false
+ * or a specific category slug. Default is false (all categories).
+ * @type string $start_date Start date to export content from. Expected date format is 'Y-m-d'. Used only
+ * when `$content` is 'post', 'page' or 'attachment'. Default false (since the
+ * beginning of time).
+ * @type string $end_date End date to export content to. Expected date format is 'Y-m-d'. Used only when
+ * `$content` is 'post', 'page' or 'attachment'. Default false (latest publish date).
+ * @type string $status Post status to export posts for. Used only when `$content` is 'post' or 'page'.
+ * Accepts false (all statuses except 'auto-draft'), or a specific status, i.e.
+ * 'publish', 'pending', 'draft', 'auto-draft', 'future', 'private', 'inherit', or
+ * 'trash'. Default false (all statuses except 'auto-draft').
+ * }
+ */
+function export_wp( $args = array() ) {
+ global $wpdb, $post;
+
+ $defaults = array(
+ 'content' => 'all',
+ 'author' => false,
+ 'category' => false,
+ 'start_date' => false,
+ 'end_date' => false,
+ 'status' => false,
+ );
+ $args = wp_parse_args( $args, $defaults );
+
+ /**
+ * Fires at the beginning of an export, before any headers are sent.
+ *
+ * @since 2.3.0
+ *
+ * @param array $args An array of export arguments.
+ */
+ do_action( 'export_wp', $args );
+
+ $sitename = sanitize_key( get_bloginfo( 'name' ) );
+ if ( ! empty( $sitename ) ) {
+ $sitename .= '.';
+ }
+ $date = date( 'Y-m-d' );
+ $wp_filename = $sitename . 'WordPress.' . $date . '.xml';
+ /**
+ * Filters the export filename.
+ *
+ * @since 4.4.0
+ *
+ * @param string $wp_filename The name of the file for download.
+ * @param string $sitename The site name.
+ * @param string $date Today's date, formatted.
+ */
+ $filename = apply_filters( 'export_wp_filename', $wp_filename, $sitename, $date );
+
+ header( 'Content-Description: File Transfer' );
+ header( 'Content-Disposition: attachment; filename=' . $filename );
+ header( 'Content-Type: text/xml; charset=' . get_option( 'blog_charset' ), true );
+
+ if ( 'all' != $args['content'] && post_type_exists( $args['content'] ) ) {
+ $ptype = get_post_type_object( $args['content'] );
+ if ( ! $ptype->can_export ) {
+ $args['content'] = 'post';
+ }
+
+ $where = $wpdb->prepare( "{$wpdb->posts}.post_type = %s", $args['content'] );
+ } else {
+ $post_types = get_post_types( array( 'can_export' => true ) );
+ $esses = array_fill( 0, count( $post_types ), '%s' );
+ $where = $wpdb->prepare( "{$wpdb->posts}.post_type IN (" . implode( ',', $esses ) . ')', $post_types );
+ }
+
+ if ( $args['status'] && ( 'post' == $args['content'] || 'page' == $args['content'] ) ) {
+ $where .= $wpdb->prepare( " AND {$wpdb->posts}.post_status = %s", $args['status'] );
+ } else {
+ $where .= " AND {$wpdb->posts}.post_status != 'auto-draft'";
+ }
+
+ $join = '';
+ if ( $args['category'] && 'post' == $args['content'] ) {
+ if ( $term = term_exists( $args['category'], 'category' ) ) {
+ $join = "INNER JOIN {$wpdb->term_relationships} ON ({$wpdb->posts}.ID = {$wpdb->term_relationships}.object_id)";
+ $where .= $wpdb->prepare( " AND {$wpdb->term_relationships}.term_taxonomy_id = %d", $term['term_taxonomy_id'] );
+ }
+ }
+
+ if ( 'post' == $args['content'] || 'page' == $args['content'] || 'attachment' == $args['content'] ) {
+ if ( $args['author'] ) {
+ $where .= $wpdb->prepare( " AND {$wpdb->posts}.post_author = %d", $args['author'] );
+ }
+
+ if ( $args['start_date'] ) {
+ $where .= $wpdb->prepare( " AND {$wpdb->posts}.post_date >= %s", date( 'Y-m-d', strtotime( $args['start_date'] ) ) );
+ }
+
+ if ( $args['end_date'] ) {
+ $where .= $wpdb->prepare( " AND {$wpdb->posts}.post_date < %s", date( 'Y-m-d', strtotime( '+1 month', strtotime( $args['end_date'] ) ) ) );
+ }
+ }
+
+ // Grab a snapshot of post IDs, just in case it changes during the export.
+ $post_ids = $wpdb->get_col( "SELECT ID FROM {$wpdb->posts} $join WHERE $where" );
+
+ /*
+ * Get the requested terms ready, empty unless posts filtered by category
+ * or all content.
+ */
+ $cats = $tags = $terms = array();
+ if ( isset( $term ) && $term ) {
+ $cat = get_term( $term['term_id'], 'category' );
+ $cats = array( $cat->term_id => $cat );
+ unset( $term, $cat );
+ } elseif ( 'all' == $args['content'] ) {
+ $categories = (array) get_categories( array( 'get' => 'all' ) );
+ $tags = (array) get_tags( array( 'get' => 'all' ) );
+
+ $custom_taxonomies = get_taxonomies( array( '_builtin' => false ) );
+ $custom_terms = (array) get_terms( $custom_taxonomies, array( 'get' => 'all' ) );
+
+ // Put categories in order with no child going before its parent.
+ while ( $cat = array_shift( $categories ) ) {
+ if ( $cat->parent == 0 || isset( $cats[ $cat->parent ] ) ) {
+ $cats[ $cat->term_id ] = $cat;
+ } else {
+ $categories[] = $cat;
+ }
+ }
+
+ // Put terms in order with no child going before its parent.
+ while ( $t = array_shift( $custom_terms ) ) {
+ if ( $t->parent == 0 || isset( $terms[ $t->parent ] ) ) {
+ $terms[ $t->term_id ] = $t;
+ } else {
+ $custom_terms[] = $t;
+ }
+ }
+
+ unset( $categories, $custom_taxonomies, $custom_terms );
+ }
+
+ /**
+ * Wrap given string in XML CDATA tag.
+ *
+ * @since 2.1.0
+ *
+ * @param string $str String to wrap in XML CDATA tag.
+ * @return string
+ */
+ function wxr_cdata( $str ) {
+ if ( ! seems_utf8( $str ) ) {
+ $str = utf8_encode( $str );
+ }
+ // $str = ent2ncr(esc_html($str));
+ $str = '<![CDATA[' . str_replace( ']]>', ']]]]><![CDATA[>', $str ) . ']]>';
+
+ return $str;
+ }
+
+ /**
+ * Return the URL of the site
+ *
+ * @since 2.5.0
+ *
+ * @return string Site URL.
+ */
+ function wxr_site_url() {
+ if ( is_multisite() ) {
+ // Multisite: the base URL.
+ return network_home_url();
+ } else {
+ // WordPress (single site): the blog URL.
+ return get_bloginfo_rss( 'url' );
+ }
+ }
+
+ /**
+ * Output a cat_name XML tag from a given category object
+ *
+ * @since 2.1.0
+ *
+ * @param object $category Category Object
+ */
+ function wxr_cat_name( $category ) {
+ if ( empty( $category->name ) ) {
+ return;
+ }
+
+ echo '<wp:cat_name>' . wxr_cdata( $category->name ) . "</wp:cat_name>\n";
+ }
+
+ /**
+ * Output a category_description XML tag from a given category object
+ *
+ * @since 2.1.0
+ *
+ * @param object $category Category Object
+ */
+ function wxr_category_description( $category ) {
+ if ( empty( $category->description ) ) {
+ return;
+ }
+
+ echo '<wp:category_description>' . wxr_cdata( $category->description ) . "</wp:category_description>\n";
+ }
+
+ /**
+ * Output a tag_name XML tag from a given tag object
+ *
+ * @since 2.3.0
+ *
+ * @param object $tag Tag Object
+ */
+ function wxr_tag_name( $tag ) {
+ if ( empty( $tag->name ) ) {
+ return;
+ }
+
+ echo '<wp:tag_name>' . wxr_cdata( $tag->name ) . "</wp:tag_name>\n";
+ }
+
+ /**
+ * Output a tag_description XML tag from a given tag object
+ *
+ * @since 2.3.0
+ *
+ * @param object $tag Tag Object
+ */
+ function wxr_tag_description( $tag ) {
+ if ( empty( $tag->description ) ) {
+ return;
+ }
+
+ echo '<wp:tag_description>' . wxr_cdata( $tag->description ) . "</wp:tag_description>\n";
+ }
+
+ /**
+ * Output a term_name XML tag from a given term object
+ *
+ * @since 2.9.0
+ *
+ * @param object $term Term Object
+ */
+ function wxr_term_name( $term ) {
+ if ( empty( $term->name ) ) {
+ return;
+ }
+
+ echo '<wp:term_name>' . wxr_cdata( $term->name ) . "</wp:term_name>\n";
+ }
+
+ /**
+ * Output a term_description XML tag from a given term object
+ *
+ * @since 2.9.0
+ *
+ * @param object $term Term Object
+ */
+ function wxr_term_description( $term ) {
+ if ( empty( $term->description ) ) {
+ return;
+ }
+
+ echo "\t\t<wp:term_description>" . wxr_cdata( $term->description ) . "</wp:term_description>\n";
+ }
+
+ /**
+ * Output term meta XML tags for a given term object.
+ *
+ * @since 4.6.0
+ *
+ * @param WP_Term $term Term object.
+ */
+ function wxr_term_meta( $term ) {
+ global $wpdb;
+
+ $termmeta = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM $wpdb->termmeta WHERE term_id = %d", $term->term_id ) );
+
+ foreach ( $termmeta as $meta ) {
+ /**
+ * Filters whether to selectively skip term meta used for WXR exports.
+ *
+ * Returning a truthy value to the filter will skip the current meta
+ * object from being exported.
+ *
+ * @since 4.6.0
+ *
+ * @param bool $skip Whether to skip the current piece of term meta. Default false.
+ * @param string $meta_key Current meta key.
+ * @param object $meta Current meta object.
+ */
+ if ( ! apply_filters( 'wxr_export_skip_termmeta', false, $meta->meta_key, $meta ) ) {
+ printf( "\t\t<wp:termmeta>\n\t\t\t<wp:meta_key>%s</wp:meta_key>\n\t\t\t<wp:meta_value>%s</wp:meta_value>\n\t\t</wp:termmeta>\n", wxr_cdata( $meta->meta_key ), wxr_cdata( $meta->meta_value ) );
+ }
+ }
+ }
+
+ /**
+ * Output list of authors with posts
+ *
+ * @since 3.1.0
+ *
+ * @global wpdb $wpdb WordPress database abstraction object.
+ *
+ * @param int[] $post_ids Optional. Array of post IDs to filter the query by.
+ */
+ function wxr_authors_list( array $post_ids = null ) {
+ global $wpdb;
+
+ if ( ! empty( $post_ids ) ) {
+ $post_ids = array_map( 'absint', $post_ids );
+ $and = 'AND ID IN ( ' . implode( ', ', $post_ids ) . ')';
+ } else {
+ $and = '';
+ }
+
+ $authors = array();
+ $results = $wpdb->get_results( "SELECT DISTINCT post_author FROM $wpdb->posts WHERE post_status != 'auto-draft' $and" );
+ foreach ( (array) $results as $result ) {
+ $authors[] = get_userdata( $result->post_author );
+ }
+
+ $authors = array_filter( $authors );
+
+ foreach ( $authors as $author ) {
+ echo "\t<wp:author>";
+ echo '<wp:author_id>' . intval( $author->ID ) . '</wp:author_id>';
+ echo '<wp:author_login>' . wxr_cdata( $author->user_login ) . '</wp:author_login>';
+ echo '<wp:author_email>' . wxr_cdata( $author->user_email ) . '</wp:author_email>';
+ echo '<wp:author_display_name>' . wxr_cdata( $author->display_name ) . '</wp:author_display_name>';
+ echo '<wp:author_first_name>' . wxr_cdata( $author->first_name ) . '</wp:author_first_name>';
+ echo '<wp:author_last_name>' . wxr_cdata( $author->last_name ) . '</wp:author_last_name>';
+ echo "</wp:author>\n";
+ }
+ }
+
+ /**
+ * Output all navigation menu terms
+ *
+ * @since 3.1.0
+ */
+ function wxr_nav_menu_terms() {
+ $nav_menus = wp_get_nav_menus();
+ if ( empty( $nav_menus ) || ! is_array( $nav_menus ) ) {
+ return;
+ }
+
+ foreach ( $nav_menus as $menu ) {
+ echo "\t<wp:term>";
+ echo '<wp:term_id>' . intval( $menu->term_id ) . '</wp:term_id>';
+ echo '<wp:term_taxonomy>nav_menu</wp:term_taxonomy>';
+ echo '<wp:term_slug>' . wxr_cdata( $menu->slug ) . '</wp:term_slug>';
+ wxr_term_name( $menu );
+ echo "</wp:term>\n";
+ }
+ }
+
+ /**
+ * Output list of taxonomy terms, in XML tag format, associated with a post
+ *
+ * @since 2.3.0
+ */
+ function wxr_post_taxonomy() {
+ $post = get_post();
+
+ $taxonomies = get_object_taxonomies( $post->post_type );
+ if ( empty( $taxonomies ) ) {
+ return;
+ }
+ $terms = wp_get_object_terms( $post->ID, $taxonomies );
+
+ foreach ( (array) $terms as $term ) {
+ echo "\t\t<category domain=\"{$term->taxonomy}\" nicename=\"{$term->slug}\">" . wxr_cdata( $term->name ) . "</category>\n";
+ }
+ }
+
+ /**
+ * @param bool $return_me
+ * @param string $meta_key
+ * @return bool
+ */
+ function wxr_filter_postmeta( $return_me, $meta_key ) {
+ if ( '_edit_lock' == $meta_key ) {
+ $return_me = true;
+ }
+ return $return_me;
+ }
+ add_filter( 'wxr_export_skip_postmeta', 'wxr_filter_postmeta', 10, 2 );
+
+ echo '<?xml version="1.0" encoding="' . get_bloginfo( 'charset' ) . "\" ?>\n";
+
+ ?>
+<!-- This is a WordPress eXtended RSS file generated by WordPress as an export of your site. -->
+<!-- It contains information about your site's posts, pages, comments, categories, and other content. -->
+<!-- You may use this file to transfer that content from one site to another. -->
+<!-- This file is not intended to serve as a complete backup of your site. -->
+
+<!-- To import this information into a WordPress site follow these steps: -->
+<!-- 1. Log in to that site as an administrator. -->
+<!-- 2. Go to Tools: Import in the WordPress admin panel. -->
+<!-- 3. Install the "WordPress" importer from the list. -->
+<!-- 4. Activate & Run Importer. -->
+<!-- 5. Upload this file using the form provided on that page. -->
+<!-- 6. You will first be asked to map the authors in this export file to users -->
+<!-- on the site. For each author, you may choose to map to an -->
+<!-- existing user on the site or to create a new user. -->
+<!-- 7. WordPress will then import each of the posts, pages, comments, categories, etc. -->
+<!-- contained in this file into your site. -->
+
+ <?php the_generator( 'export' ); ?>
+<rss version="2.0"
+ xmlns:excerpt="http://wordpress.org/export/<?php echo WXR_VERSION; ?>/excerpt/"
+ xmlns:content="http://purl.org/rss/1.0/modules/content/"
+ xmlns:wfw="http://wellformedweb.org/CommentAPI/"
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:wp="http://wordpress.org/export/<?php echo WXR_VERSION; ?>/"
+>
+
+<channel>
+ <title><?php bloginfo_rss( 'name' ); ?></title>
+ <link><?php bloginfo_rss( 'url' ); ?></link>
+ <description><?php bloginfo_rss( 'description' ); ?></description>
+ <pubDate><?php echo date( 'D, d M Y H:i:s +0000' ); ?></pubDate>
+ <language><?php bloginfo_rss( 'language' ); ?></language>
+ <wp:wxr_version><?php echo WXR_VERSION; ?></wp:wxr_version>
+ <wp:base_site_url><?php echo wxr_site_url(); ?></wp:base_site_url>
+ <wp:base_blog_url><?php bloginfo_rss( 'url' ); ?></wp:base_blog_url>
+
+ <?php wxr_authors_list( $post_ids ); ?>
+
+ <?php foreach ( $cats as $c ) : ?>
+ <wp:category>
+ <wp:term_id><?php echo intval( $c->term_id ); ?></wp:term_id>
+ <wp:category_nicename><?php echo wxr_cdata( $c->slug ); ?></wp:category_nicename>
+ <wp:category_parent><?php echo wxr_cdata( $c->parent ? $cats[ $c->parent ]->slug : '' ); ?></wp:category_parent>
+ <?php
+ wxr_cat_name( $c );
+ wxr_category_description( $c );
+ wxr_term_meta( $c );
+ ?>
+ </wp:category>
+ <?php endforeach; ?>
+ <?php foreach ( $tags as $t ) : ?>
+ <wp:tag>
+ <wp:term_id><?php echo intval( $t->term_id ); ?></wp:term_id>
+ <wp:tag_slug><?php echo wxr_cdata( $t->slug ); ?></wp:tag_slug>
+ <?php
+ wxr_tag_name( $t );
+ wxr_tag_description( $t );
+ wxr_term_meta( $t );
+ ?>
+ </wp:tag>
+ <?php endforeach; ?>
+ <?php foreach ( $terms as $t ) : ?>
+ <wp:term>
+ <wp:term_id><?php echo wxr_cdata( $t->term_id ); ?></wp:term_id>
+ <wp:term_taxonomy><?php echo wxr_cdata( $t->taxonomy ); ?></wp:term_taxonomy>
+ <wp:term_slug><?php echo wxr_cdata( $t->slug ); ?></wp:term_slug>
+ <wp:term_parent><?php echo wxr_cdata( $t->parent ? $terms[ $t->parent ]->slug : '' ); ?></wp:term_parent>
+ <?php
+ wxr_term_name( $t );
+ wxr_term_description( $t );
+ wxr_term_meta( $t );
+ ?>
+ </wp:term>
+ <?php endforeach; ?>
+ <?php
+ if ( 'all' == $args['content'] ) {
+ wxr_nav_menu_terms();}
+ ?>
+
+ <?php
+ /** This action is documented in wp-includes/feed-rss2.php */
+ do_action( 'rss2_head' );
+ ?>
+
+ <?php
+ if ( $post_ids ) {
+ /**
+ * @global WP_Query $wp_query
+ */
+ global $wp_query;
+
+ // Fake being in the loop.
+ $wp_query->in_the_loop = true;
+
+ // Fetch 20 posts at a time rather than loading the entire table into memory.
+ while ( $next_posts = array_splice( $post_ids, 0, 20 ) ) {
+ $where = 'WHERE ID IN (' . join( ',', $next_posts ) . ')';
+ $posts = $wpdb->get_results( "SELECT * FROM {$wpdb->posts} $where" );
+
+ // Begin Loop.
+ foreach ( $posts as $post ) {
+ setup_postdata( $post );
+
+ /** This filter is documented in wp-includes/feed.php */
+ $title = apply_filters( 'the_title_rss', $post->post_title );
+
+ /**
+ * Filters the post content used for WXR exports.
+ *
+ * @since 2.5.0
+ *
+ * @param string $post_content Content of the current post.
+ */
+ $content = wxr_cdata( apply_filters( 'the_content_export', $post->post_content ) );
+
+ /**
+ * Filters the post excerpt used for WXR exports.
+ *
+ * @since 2.6.0
+ *
+ * @param string $post_excerpt Excerpt for the current post.
+ */
+ $excerpt = wxr_cdata( apply_filters( 'the_excerpt_export', $post->post_excerpt ) );
+
+ $is_sticky = is_sticky( $post->ID ) ? 1 : 0;
+ ?>
+ <item>
+ <title><?php echo $title; ?></title>
+ <link><?php the_permalink_rss(); ?></link>
+ <pubDate><?php echo mysql2date( 'D, d M Y H:i:s +0000', get_post_time( 'Y-m-d H:i:s', true ), false ); ?></pubDate>
+ <dc:creator><?php echo wxr_cdata( get_the_author_meta( 'login' ) ); ?></dc:creator>
+ <guid isPermaLink="false"><?php the_guid(); ?></guid>
+ <description></description>
+ <content:encoded><?php echo $content; ?></content:encoded>
+ <excerpt:encoded><?php echo $excerpt; ?></excerpt:encoded>
+ <wp:post_id><?php echo intval( $post->ID ); ?></wp:post_id>
+ <wp:post_date><?php echo wxr_cdata( $post->post_date ); ?></wp:post_date>
+ <wp:post_date_gmt><?php echo wxr_cdata( $post->post_date_gmt ); ?></wp:post_date_gmt>
+ <wp:comment_status><?php echo wxr_cdata( $post->comment_status ); ?></wp:comment_status>
+ <wp:ping_status><?php echo wxr_cdata( $post->ping_status ); ?></wp:ping_status>
+ <wp:post_name><?php echo wxr_cdata( $post->post_name ); ?></wp:post_name>
+ <wp:status><?php echo wxr_cdata( $post->post_status ); ?></wp:status>
+ <wp:post_parent><?php echo intval( $post->post_parent ); ?></wp:post_parent>
+ <wp:menu_order><?php echo intval( $post->menu_order ); ?></wp:menu_order>
+ <wp:post_type><?php echo wxr_cdata( $post->post_type ); ?></wp:post_type>
+ <wp:post_password><?php echo wxr_cdata( $post->post_password ); ?></wp:post_password>
+ <wp:is_sticky><?php echo intval( $is_sticky ); ?></wp:is_sticky>
+ <?php if ( $post->post_type == 'attachment' ) : ?>
+ <wp:attachment_url><?php echo wxr_cdata( wp_get_attachment_url( $post->ID ) ); ?></wp:attachment_url>
+ <?php endif; ?>
+ <?php wxr_post_taxonomy(); ?>
+ <?php
+ $postmeta = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM $wpdb->postmeta WHERE post_id = %d", $post->ID ) );
+ foreach ( $postmeta as $meta ) :
+ /**
+ * Filters whether to selectively skip post meta used for WXR exports.
+ *
+ * Returning a truthy value to the filter will skip the current meta
+ * object from being exported.
+ *
+ * @since 3.3.0
+ *
+ * @param bool $skip Whether to skip the current post meta. Default false.
+ * @param string $meta_key Current meta key.
+ * @param object $meta Current meta object.
+ */
+ if ( apply_filters( 'wxr_export_skip_postmeta', false, $meta->meta_key, $meta ) ) {
+ continue;
+ }
+ ?>
+ <wp:postmeta>
+ <wp:meta_key><?php echo wxr_cdata( $meta->meta_key ); ?></wp:meta_key>
+ <wp:meta_value><?php echo wxr_cdata( $meta->meta_value ); ?></wp:meta_value>
+ </wp:postmeta>
+ <?php
+ endforeach;
+
+ $_comments = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM $wpdb->comments WHERE comment_post_ID = %d AND comment_approved <> 'spam'", $post->ID ) );
+ $comments = array_map( 'get_comment', $_comments );
+ foreach ( $comments as $c ) :
+ ?>
+ <wp:comment>
+ <wp:comment_id><?php echo intval( $c->comment_ID ); ?></wp:comment_id>
+ <wp:comment_author><?php echo wxr_cdata( $c->comment_author ); ?></wp:comment_author>
+ <wp:comment_author_email><?php echo wxr_cdata( $c->comment_author_email ); ?></wp:comment_author_email>
+ <wp:comment_author_url><?php echo esc_url_raw( $c->comment_author_url ); ?></wp:comment_author_url>
+ <wp:comment_author_IP><?php echo wxr_cdata( $c->comment_author_IP ); ?></wp:comment_author_IP>
+ <wp:comment_date><?php echo wxr_cdata( $c->comment_date ); ?></wp:comment_date>
+ <wp:comment_date_gmt><?php echo wxr_cdata( $c->comment_date_gmt ); ?></wp:comment_date_gmt>
+ <wp:comment_content><?php echo wxr_cdata( $c->comment_content ); ?></wp:comment_content>
+ <wp:comment_approved><?php echo wxr_cdata( $c->comment_approved ); ?></wp:comment_approved>
+ <wp:comment_type><?php echo wxr_cdata( $c->comment_type ); ?></wp:comment_type>
+ <wp:comment_parent><?php echo intval( $c->comment_parent ); ?></wp:comment_parent>
+ <wp:comment_user_id><?php echo intval( $c->user_id ); ?></wp:comment_user_id>
+ <?php
+ $c_meta = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM $wpdb->commentmeta WHERE comment_id = %d", $c->comment_ID ) );
+ foreach ( $c_meta as $meta ) :
+ /**
+ * Filters whether to selectively skip comment meta used for WXR exports.
+ *
+ * Returning a truthy value to the filter will skip the current meta
+ * object from being exported.
+ *
+ * @since 4.0.0
+ *
+ * @param bool $skip Whether to skip the current comment meta. Default false.
+ * @param string $meta_key Current meta key.
+ * @param object $meta Current meta object.
+ */
+ if ( apply_filters( 'wxr_export_skip_commentmeta', false, $meta->meta_key, $meta ) ) {
+ continue;
+ }
+ ?>
+ <wp:commentmeta>
+ <wp:meta_key><?php echo wxr_cdata( $meta->meta_key ); ?></wp:meta_key>
+ <wp:meta_value><?php echo wxr_cdata( $meta->meta_value ); ?></wp:meta_value>
+ </wp:commentmeta>
+ <?php endforeach; ?>
+ </wp:comment>
+ <?php endforeach; ?>
+ </item>
+ <?php
+ }
+ }
+ }
+ ?>
+</channel>
+</rss>
+ <?php
+}
diff --git a/www/crm/wp-admin/includes/file.php b/www/crm/wp-admin/includes/file.php
new file mode 100644
index 00000000..885217ec
--- /dev/null
+++ b/www/crm/wp-admin/includes/file.php
@@ -0,0 +1,2651 @@
+<?php
+/**
+ * Filesystem API: Top-level functionality
+ *
+ * Functions for reading, writing, modifying, and deleting files on the file system.
+ * Includes functionality for theme-specific files as well as operations for uploading,
+ * archiving, and rendering output when necessary.
+ *
+ * @package WordPress
+ * @subpackage Filesystem
+ * @since 2.3.0
+ */
+
+/** The descriptions for theme files. */
+$wp_file_descriptions = array(
+ 'functions.php' => __( 'Theme Functions' ),
+ 'header.php' => __( 'Theme Header' ),
+ 'footer.php' => __( 'Theme Footer' ),
+ 'sidebar.php' => __( 'Sidebar' ),
+ 'comments.php' => __( 'Comments' ),
+ 'searchform.php' => __( 'Search Form' ),
+ '404.php' => __( '404 Template' ),
+ 'link.php' => __( 'Links Template' ),
+ // Archives
+ 'index.php' => __( 'Main Index Template' ),
+ 'archive.php' => __( 'Archives' ),
+ 'author.php' => __( 'Author Template' ),
+ 'taxonomy.php' => __( 'Taxonomy Template' ),
+ 'category.php' => __( 'Category Template' ),
+ 'tag.php' => __( 'Tag Template' ),
+ 'home.php' => __( 'Posts Page' ),
+ 'search.php' => __( 'Search Results' ),
+ 'date.php' => __( 'Date Template' ),
+ // Content
+ 'singular.php' => __( 'Singular Template' ),
+ 'single.php' => __( 'Single Post' ),
+ 'page.php' => __( 'Single Page' ),
+ 'front-page.php' => __( 'Homepage' ),
+ 'privacy-policy.php' => __( 'Privacy Policy Page' ),
+ // Attachments
+ 'attachment.php' => __( 'Attachment Template' ),
+ 'image.php' => __( 'Image Attachment Template' ),
+ 'video.php' => __( 'Video Attachment Template' ),
+ 'audio.php' => __( 'Audio Attachment Template' ),
+ 'application.php' => __( 'Application Attachment Template' ),
+ // Embeds
+ 'embed.php' => __( 'Embed Template' ),
+ 'embed-404.php' => __( 'Embed 404 Template' ),
+ 'embed-content.php' => __( 'Embed Content Template' ),
+ 'header-embed.php' => __( 'Embed Header Template' ),
+ 'footer-embed.php' => __( 'Embed Footer Template' ),
+ // Stylesheets
+ 'style.css' => __( 'Stylesheet' ),
+ 'editor-style.css' => __( 'Visual Editor Stylesheet' ),
+ 'editor-style-rtl.css' => __( 'Visual Editor RTL Stylesheet' ),
+ 'rtl.css' => __( 'RTL Stylesheet' ),
+ // Other
+ 'my-hacks.php' => __( 'my-hacks.php (legacy hacks support)' ),
+ '.htaccess' => __( '.htaccess (for rewrite rules )' ),
+ // Deprecated files
+ 'wp-layout.css' => __( 'Stylesheet' ),
+ 'wp-comments.php' => __( 'Comments Template' ),
+ 'wp-comments-popup.php' => __( 'Popup Comments Template' ),
+ 'comments-popup.php' => __( 'Popup Comments' ),
+);
+
+/**
+ * Get the description for standard WordPress theme files and other various standard
+ * WordPress files
+ *
+ * @since 1.5.0
+ *
+ * @global array $wp_file_descriptions Theme file descriptions.
+ * @global array $allowed_files List of allowed files.
+ * @param string $file Filesystem path or filename
+ * @return string Description of file from $wp_file_descriptions or basename of $file if description doesn't exist.
+ * Appends 'Page Template' to basename of $file if the file is a page template
+ */
+function get_file_description( $file ) {
+ global $wp_file_descriptions, $allowed_files;
+
+ $dirname = pathinfo( $file, PATHINFO_DIRNAME );
+
+ $file_path = $allowed_files[ $file ];
+ if ( isset( $wp_file_descriptions[ basename( $file ) ] ) && '.' === $dirname ) {
+ return $wp_file_descriptions[ basename( $file ) ];
+ } elseif ( file_exists( $file_path ) && is_file( $file_path ) ) {
+ $template_data = implode( '', file( $file_path ) );
+ if ( preg_match( '|Template Name:(.*)$|mi', $template_data, $name ) ) {
+ return sprintf( __( '%s Page Template' ), _cleanup_header_comment( $name[1] ) );
+ }
+ }
+
+ return trim( basename( $file ) );
+}
+
+/**
+ * Get the absolute filesystem path to the root of the WordPress installation
+ *
+ * @since 1.5.0
+ *
+ * @return string Full filesystem path to the root of the WordPress installation
+ */
+function get_home_path() {
+ $home = set_url_scheme( get_option( 'home' ), 'http' );
+ $siteurl = set_url_scheme( get_option( 'siteurl' ), 'http' );
+ if ( ! empty( $home ) && 0 !== strcasecmp( $home, $siteurl ) ) {
+ $wp_path_rel_to_home = str_ireplace( $home, '', $siteurl ); /* $siteurl - $home */
+ $pos = strripos( str_replace( '\\', '/', $_SERVER['SCRIPT_FILENAME'] ), trailingslashit( $wp_path_rel_to_home ) );
+ $home_path = substr( $_SERVER['SCRIPT_FILENAME'], 0, $pos );
+ $home_path = trailingslashit( $home_path );
+ } else {
+ $home_path = ABSPATH;
+ }
+
+ return str_replace( '\\', '/', $home_path );
+}
+
+/**
+ * Returns a listing of all files in the specified folder and all subdirectories up to 100 levels deep.
+ * The depth of the recursiveness can be controlled by the $levels param.
+ *
+ * @since 2.6.0
+ * @since 4.9.0 Added the `$exclusions` parameter.
+ *
+ * @param string $folder Optional. Full path to folder. Default empty.
+ * @param int $levels Optional. Levels of folders to follow, Default 100 (PHP Loop limit).
+ * @param string[] $exclusions Optional. List of folders and files to skip.
+ * @return bool|string[] False on failure, else array of files.
+ */
+function list_files( $folder = '', $levels = 100, $exclusions = array() ) {
+ if ( empty( $folder ) ) {
+ return false;
+ }
+
+ $folder = trailingslashit( $folder );
+
+ if ( ! $levels ) {
+ return false;
+ }
+
+ $files = array();
+
+ $dir = @opendir( $folder );
+ if ( $dir ) {
+ while ( ( $file = readdir( $dir ) ) !== false ) {
+ // Skip current and parent folder links.
+ if ( in_array( $file, array( '.', '..' ), true ) ) {
+ continue;
+ }
+
+ // Skip hidden and excluded files.
+ if ( '.' === $file[0] || in_array( $file, $exclusions, true ) ) {
+ continue;
+ }
+
+ if ( is_dir( $folder . $file ) ) {
+ $files2 = list_files( $folder . $file, $levels - 1 );
+ if ( $files2 ) {
+ $files = array_merge( $files, $files2 );
+ } else {
+ $files[] = $folder . $file . '/';
+ }
+ } else {
+ $files[] = $folder . $file;
+ }
+ }
+ }
+ @closedir( $dir );
+
+ return $files;
+}
+
+/**
+ * Get list of file extensions that are editable in plugins.
+ *
+ * @since 4.9.0
+ *
+ * @param string $plugin Path to the plugin file relative to the plugins directory.
+ * @return string[] Array of editable file extensions.
+ */
+function wp_get_plugin_file_editable_extensions( $plugin ) {
+
+ $editable_extensions = array(
+ 'bash',
+ 'conf',
+ 'css',
+ 'diff',
+ 'htm',
+ 'html',
+ 'http',
+ 'inc',
+ 'include',
+ 'js',
+ 'json',
+ 'jsx',
+ 'less',
+ 'md',
+ 'patch',
+ 'php',
+ 'php3',
+ 'php4',
+ 'php5',
+ 'php7',
+ 'phps',
+ 'phtml',
+ 'sass',
+ 'scss',
+ 'sh',
+ 'sql',
+ 'svg',
+ 'text',
+ 'txt',
+ 'xml',
+ 'yaml',
+ 'yml',
+ );
+
+ /**
+ * Filters file type extensions editable in the plugin editor.
+ *
+ * @since 2.8.0
+ * @since 4.9.0 Added the `$plugin` parameter.
+ *
+ * @param string[] $editable_extensions An array of editable plugin file extensions.
+ * @param string $plugin Path to the plugin file relative to the plugins directory.
+ */
+ $editable_extensions = (array) apply_filters( 'editable_extensions', $editable_extensions, $plugin );
+
+ return $editable_extensions;
+}
+
+/**
+ * Get list of file extensions that are editable for a given theme.
+ *
+ * @param WP_Theme $theme Theme object.
+ * @return string[] Array of editable file extensions.
+ */
+function wp_get_theme_file_editable_extensions( $theme ) {
+
+ $default_types = array(
+ 'bash',
+ 'conf',
+ 'css',
+ 'diff',
+ 'htm',
+ 'html',
+ 'http',
+ 'inc',
+ 'include',
+ 'js',
+ 'json',
+ 'jsx',
+ 'less',
+ 'md',
+ 'patch',
+ 'php',
+ 'php3',
+ 'php4',
+ 'php5',
+ 'php7',
+ 'phps',
+ 'phtml',
+ 'sass',
+ 'scss',
+ 'sh',
+ 'sql',
+ 'svg',
+ 'text',
+ 'txt',
+ 'xml',
+ 'yaml',
+ 'yml',
+ );
+
+ /**
+ * Filters the list of file types allowed for editing in the Theme editor.
+ *
+ * @since 4.4.0
+ *
+ * @param string[] $default_types List of allowed file types.
+ * @param WP_Theme $theme The current Theme object.
+ */
+ $file_types = apply_filters( 'wp_theme_editor_filetypes', $default_types, $theme );
+
+ // Ensure that default types are still there.
+ return array_unique( array_merge( $file_types, $default_types ) );
+}
+
+/**
+ * Print file editor templates (for plugins and themes).
+ *
+ * @since 4.9.0
+ */
+function wp_print_file_editor_templates() {
+ ?>
+ <script type="text/html" id="tmpl-wp-file-editor-notice">
+ <div class="notice inline notice-{{ data.type || 'info' }} {{ data.alt ? 'notice-alt' : '' }} {{ data.dismissible ? 'is-dismissible' : '' }} {{ data.classes || '' }}">
+ <# if ( 'php_error' === data.code ) { #>
+ <p>
+ <?php
+ printf(
+ /* translators: 1: line number, 2: file path */
+ __( 'Your PHP code changes were rolled back due to an error on line %1$s of file %2$s. Please fix and try saving again.' ),
+ '{{ data.line }}',
+ '{{ data.file }}'
+ );
+ ?>
+ </p>
+ <pre>{{ data.message }}</pre>
+ <# } else if ( 'file_not_writable' === data.code ) { #>
+ <p><?php _e( 'You need to make this file writable before you can save your changes. See <a href="https://codex.wordpress.org/Changing_File_Permissions">the Codex</a> for more information.' ); ?></p>
+ <# } else { #>
+ <p>{{ data.message || data.code }}</p>
+
+ <# if ( 'lint_errors' === data.code ) { #>
+ <p>
+ <# var elementId = 'el-' + String( Math.random() ); #>
+ <input id="{{ elementId }}" type="checkbox">
+ <label for="{{ elementId }}"><?php _e( 'Update anyway, even though it might break your site?' ); ?></label>
+ </p>
+ <# } #>
+ <# } #>
+ <# if ( data.dismissible ) { #>
+ <button type="button" class="notice-dismiss"><span class="screen-reader-text"><?php _e( 'Dismiss' ); ?></span></button>
+ <# } #>
+ </div>
+ </script>
+ <?php
+}
+
+/**
+ * Attempt to edit a file for a theme or plugin.
+ *
+ * When editing a PHP file, loopback requests will be made to the admin and the homepage
+ * to attempt to see if there is a fatal error introduced. If so, the PHP change will be
+ * reverted.
+ *
+ * @since 4.9.0
+ *
+ * @param string[] $args {
+ * Args. Note that all of the arg values are already unslashed. They are, however,
+ * coming straight from `$_POST` and are not validated or sanitized in any way.
+ *
+ * @type string $file Relative path to file.
+ * @type string $plugin Path to the plugin file relative to the plugins directory.
+ * @type string $theme Theme being edited.
+ * @type string $newcontent New content for the file.
+ * @type string $nonce Nonce.
+ * }
+ * @return true|WP_Error True on success or `WP_Error` on failure.
+ */
+function wp_edit_theme_plugin_file( $args ) {
+ if ( empty( $args['file'] ) ) {
+ return new WP_Error( 'missing_file' );
+ }
+ $file = $args['file'];
+ if ( 0 !== validate_file( $file ) ) {
+ return new WP_Error( 'bad_file' );
+ }
+
+ if ( ! isset( $args['newcontent'] ) ) {
+ return new WP_Error( 'missing_content' );
+ }
+ $content = $args['newcontent'];
+
+ if ( ! isset( $args['nonce'] ) ) {
+ return new WP_Error( 'missing_nonce' );
+ }
+
+ $plugin = null;
+ $theme = null;
+ $real_file = null;
+ if ( ! empty( $args['plugin'] ) ) {
+ $plugin = $args['plugin'];
+
+ if ( ! current_user_can( 'edit_plugins' ) ) {
+ return new WP_Error( 'unauthorized', __( 'Sorry, you are not allowed to edit plugins for this site.' ) );
+ }
+
+ if ( ! wp_verify_nonce( $args['nonce'], 'edit-plugin_' . $file ) ) {
+ return new WP_Error( 'nonce_failure' );
+ }
+
+ if ( ! array_key_exists( $plugin, get_plugins() ) ) {
+ return new WP_Error( 'invalid_plugin' );
+ }
+
+ if ( 0 !== validate_file( $file, get_plugin_files( $plugin ) ) ) {
+ return new WP_Error( 'bad_plugin_file_path', __( 'Sorry, that file cannot be edited.' ) );
+ }
+
+ $editable_extensions = wp_get_plugin_file_editable_extensions( $plugin );
+
+ $real_file = WP_PLUGIN_DIR . '/' . $file;
+
+ $is_active = in_array(
+ $plugin,
+ (array) get_option( 'active_plugins', array() ),
+ true
+ );
+
+ } elseif ( ! empty( $args['theme'] ) ) {
+ $stylesheet = $args['theme'];
+ if ( 0 !== validate_file( $stylesheet ) ) {
+ return new WP_Error( 'bad_theme_path' );
+ }
+
+ if ( ! current_user_can( 'edit_themes' ) ) {
+ return new WP_Error( 'unauthorized', __( 'Sorry, you are not allowed to edit templates for this site.' ) );
+ }
+
+ $theme = wp_get_theme( $stylesheet );
+ if ( ! $theme->exists() ) {
+ return new WP_Error( 'non_existent_theme', __( 'The requested theme does not exist.' ) );
+ }
+
+ if ( ! wp_verify_nonce( $args['nonce'], 'edit-theme_' . $stylesheet . '_' . $file ) ) {
+ return new WP_Error( 'nonce_failure' );
+ }
+
+ if ( $theme->errors() && 'theme_no_stylesheet' === $theme->errors()->get_error_code() ) {
+ return new WP_Error(
+ 'theme_no_stylesheet',
+ __( 'The requested theme does not exist.' ) . ' ' . $theme->errors()->get_error_message()
+ );
+ }
+
+ $editable_extensions = wp_get_theme_file_editable_extensions( $theme );
+
+ $allowed_files = array();
+ foreach ( $editable_extensions as $type ) {
+ switch ( $type ) {
+ case 'php':
+ $allowed_files = array_merge( $allowed_files, $theme->get_files( 'php', -1 ) );
+ break;
+ case 'css':
+ $style_files = $theme->get_files( 'css', -1 );
+ $allowed_files['style.css'] = $style_files['style.css'];
+ $allowed_files = array_merge( $allowed_files, $style_files );
+ break;
+ default:
+ $allowed_files = array_merge( $allowed_files, $theme->get_files( $type, -1 ) );
+ break;
+ }
+ }
+
+ // Compare based on relative paths
+ if ( 0 !== validate_file( $file, array_keys( $allowed_files ) ) ) {
+ return new WP_Error( 'disallowed_theme_file', __( 'Sorry, that file cannot be edited.' ) );
+ }
+
+ $real_file = $theme->get_stylesheet_directory() . '/' . $file;
+
+ $is_active = ( get_stylesheet() === $stylesheet || get_template() === $stylesheet );
+
+ } else {
+ return new WP_Error( 'missing_theme_or_plugin' );
+ }
+
+ // Ensure file is real.
+ if ( ! is_file( $real_file ) ) {
+ return new WP_Error( 'file_does_not_exist', __( 'No such file exists! Double check the name and try again.' ) );
+ }
+
+ // Ensure file extension is allowed.
+ $extension = null;
+ if ( preg_match( '/\.([^.]+)$/', $real_file, $matches ) ) {
+ $extension = strtolower( $matches[1] );
+ if ( ! in_array( $extension, $editable_extensions, true ) ) {
+ return new WP_Error( 'illegal_file_type', __( 'Files of this type are not editable.' ) );
+ }
+ }
+
+ $previous_content = file_get_contents( $real_file );
+
+ if ( ! is_writeable( $real_file ) ) {
+ return new WP_Error( 'file_not_writable' );
+ }
+
+ $f = fopen( $real_file, 'w+' );
+ if ( false === $f ) {
+ return new WP_Error( 'file_not_writable' );
+ }
+
+ $written = fwrite( $f, $content );
+ fclose( $f );
+ if ( false === $written ) {
+ return new WP_Error( 'unable_to_write', __( 'Unable to write to file.' ) );
+ }
+ if ( 'php' === $extension && function_exists( 'opcache_invalidate' ) ) {
+ opcache_invalidate( $real_file, true );
+ }
+
+ if ( $is_active && 'php' === $extension ) {
+
+ $scrape_key = md5( rand() );
+ $transient = 'scrape_key_' . $scrape_key;
+ $scrape_nonce = strval( rand() );
+ set_transient( $transient, $scrape_nonce, 60 ); // It shouldn't take more than 60 seconds to make the two loopback requests.
+
+ $cookies = wp_unslash( $_COOKIE );
+ $scrape_params = array(
+ 'wp_scrape_key' => $scrape_key,
+ 'wp_scrape_nonce' => $scrape_nonce,
+ );
+ $headers = array(
+ 'Cache-Control' => 'no-cache',
+ );
+
+ // Include Basic auth in loopback requests.
+ if ( isset( $_SERVER['PHP_AUTH_USER'] ) && isset( $_SERVER['PHP_AUTH_PW'] ) ) {
+ $headers['Authorization'] = 'Basic ' . base64_encode( wp_unslash( $_SERVER['PHP_AUTH_USER'] ) . ':' . wp_unslash( $_SERVER['PHP_AUTH_PW'] ) );
+ }
+
+ // Make sure PHP process doesn't die before loopback requests complete.
+ @set_time_limit( 300 );
+
+ // Time to wait for loopback requests to finish.
+ $timeout = 100;
+
+ $needle_start = "###### wp_scraping_result_start:$scrape_key ######";
+ $needle_end = "###### wp_scraping_result_end:$scrape_key ######";
+
+ // Attempt loopback request to editor to see if user just whitescreened themselves.
+ if ( $plugin ) {
+ $url = add_query_arg( compact( 'plugin', 'file' ), admin_url( 'plugin-editor.php' ) );
+ } elseif ( isset( $stylesheet ) ) {
+ $url = add_query_arg(
+ array(
+ 'theme' => $stylesheet,
+ 'file' => $file,
+ ),
+ admin_url( 'theme-editor.php' )
+ );
+ } else {
+ $url = admin_url();
+ }
+ $url = add_query_arg( $scrape_params, $url );
+ $r = wp_remote_get( $url, compact( 'cookies', 'headers', 'timeout' ) );
+ $body = wp_remote_retrieve_body( $r );
+ $scrape_result_position = strpos( $body, $needle_start );
+
+ $loopback_request_failure = array(
+ 'code' => 'loopback_request_failed',
+ 'message' => __( 'Unable to communicate back with site to check for fatal errors, so the PHP change was reverted. You will need to upload your PHP file change by some other means, such as by using SFTP.' ),
+ );
+ $json_parse_failure = array(
+ 'code' => 'json_parse_error',
+ );
+
+ $result = null;
+ if ( false === $scrape_result_position ) {
+ $result = $loopback_request_failure;
+ } else {
+ $error_output = substr( $body, $scrape_result_position + strlen( $needle_start ) );
+ $error_output = substr( $error_output, 0, strpos( $error_output, $needle_end ) );
+ $result = json_decode( trim( $error_output ), true );
+ if ( empty( $result ) ) {
+ $result = $json_parse_failure;
+ }
+ }
+
+ // Try making request to homepage as well to see if visitors have been whitescreened.
+ if ( true === $result ) {
+ $url = home_url( '/' );
+ $url = add_query_arg( $scrape_params, $url );
+ $r = wp_remote_get( $url, compact( 'cookies', 'headers', 'timeout' ) );
+ $body = wp_remote_retrieve_body( $r );
+ $scrape_result_position = strpos( $body, $needle_start );
+
+ if ( false === $scrape_result_position ) {
+ $result = $loopback_request_failure;
+ } else {
+ $error_output = substr( $body, $scrape_result_position + strlen( $needle_start ) );
+ $error_output = substr( $error_output, 0, strpos( $error_output, $needle_end ) );
+ $result = json_decode( trim( $error_output ), true );
+ if ( empty( $result ) ) {
+ $result = $json_parse_failure;
+ }
+ }
+ }
+
+ delete_transient( $transient );
+
+ if ( true !== $result ) {
+
+ // Roll-back file change.
+ file_put_contents( $real_file, $previous_content );
+ if ( function_exists( 'opcache_invalidate' ) ) {
+ opcache_invalidate( $real_file, true );
+ }
+
+ if ( ! isset( $result['message'] ) ) {
+ $message = __( 'Something went wrong.' );
+ } else {
+ $message = $result['message'];
+ unset( $result['message'] );
+ }
+ return new WP_Error( 'php_error', $message, $result );
+ }
+ }
+
+ if ( $theme instanceof WP_Theme ) {
+ $theme->cache_delete();
+ }
+
+ return true;
+}
+
+
+/**
+ * Returns a filename of a Temporary unique file.
+ * Please note that the calling function must unlink() this itself.
+ *
+ * The filename is based off the passed parameter or defaults to the current unix timestamp,
+ * while the directory can either be passed as well, or by leaving it blank, default to a writable temporary directory.
+ *
+ * @since 2.6.0
+ *
+ * @param string $filename Optional. Filename to base the Unique file off. Default empty.
+ * @param string $dir Optional. Directory to store the file in. Default empty.
+ * @return string a writable filename
+ */
+function wp_tempnam( $filename = '', $dir = '' ) {
+ if ( empty( $dir ) ) {
+ $dir = get_temp_dir();
+ }
+
+ if ( empty( $filename ) || '.' == $filename || '/' == $filename || '\\' == $filename ) {
+ $filename = uniqid();
+ }
+
+ // Use the basename of the given file without the extension as the name for the temporary directory
+ $temp_filename = basename( $filename );
+ $temp_filename = preg_replace( '|\.[^.]*$|', '', $temp_filename );
+
+ // If the folder is falsey, use its parent directory name instead.
+ if ( ! $temp_filename ) {
+ return wp_tempnam( dirname( $filename ), $dir );
+ }
+
+ // Suffix some random data to avoid filename conflicts
+ $temp_filename .= '-' . wp_generate_password( 6, false );
+ $temp_filename .= '.tmp';
+ $temp_filename = $dir . wp_unique_filename( $dir, $temp_filename );
+
+ $fp = @fopen( $temp_filename, 'x' );
+ if ( ! $fp && is_writable( $dir ) && file_exists( $temp_filename ) ) {
+ return wp_tempnam( $filename, $dir );
+ }
+ if ( $fp ) {
+ fclose( $fp );
+ }
+
+ return $temp_filename;
+}
+
+/**
+ * Makes sure that the file that was requested to be edited is allowed to be edited.
+ *
+ * Function will die if you are not allowed to edit the file.
+ *
+ * @since 1.5.0
+ *
+ * @param string $file File the user is attempting to edit.
+ * @param string[] $allowed_files Optional. Array of allowed files to edit. `$file` must match an entry exactly.
+ * @return string|void Returns the file name on success, dies on failure.
+ */
+function validate_file_to_edit( $file, $allowed_files = array() ) {
+ $code = validate_file( $file, $allowed_files );
+
+ if ( ! $code ) {
+ return $file;
+ }
+
+ switch ( $code ) {
+ case 1:
+ wp_die( __( 'Sorry, that file cannot be edited.' ) );
+
+ // case 2 :
+ // wp_die( __('Sorry, can&#8217;t call files with their real path.' ));
+
+ case 3:
+ wp_die( __( 'Sorry, that file cannot be edited.' ) );
+ }
+}
+
+/**
+ * Handle PHP uploads in WordPress, sanitizing file names, checking extensions for mime type,
+ * and moving the file to the appropriate directory within the uploads directory.
+ *
+ * @access private
+ * @since 4.0.0
+ *
+ * @see wp_handle_upload_error
+ *
+ * @param string[] $file Reference to a single element of `$_FILES`. Call the function once for each uploaded file.
+ * @param string[]|false $overrides An associative array of names => values to override default variables. Default false.
+ * @param string $time Time formatted in 'yyyy/mm'.
+ * @param string $action Expected value for `$_POST['action']`.
+ * @return string[] On success, returns an associative array of file attributes. On failure, returns
+ * `$overrides['upload_error_handler'](&$file, $message )` or `array( 'error'=>$message )`.
+ */
+function _wp_handle_upload( &$file, $overrides, $time, $action ) {
+ // The default error handler.
+ if ( ! function_exists( 'wp_handle_upload_error' ) ) {
+ function wp_handle_upload_error( &$file, $message ) {
+ return array( 'error' => $message );
+ }
+ }
+
+ /**
+ * Filters the data for a file before it is uploaded to WordPress.
+ *
+ * The dynamic portion of the hook name, `$action`, refers to the post action.
+ *
+ * @since 2.9.0 as 'wp_handle_upload_prefilter'.
+ * @since 4.0.0 Converted to a dynamic hook with `$action`.
+ *
+ * @param string[] $file An array of data for a single file.
+ */
+ $file = apply_filters( "{$action}_prefilter", $file );
+
+ // You may define your own function and pass the name in $overrides['upload_error_handler']
+ $upload_error_handler = 'wp_handle_upload_error';
+ if ( isset( $overrides['upload_error_handler'] ) ) {
+ $upload_error_handler = $overrides['upload_error_handler'];
+ }
+
+ // You may have had one or more 'wp_handle_upload_prefilter' functions error out the file. Handle that gracefully.
+ if ( isset( $file['error'] ) && ! is_numeric( $file['error'] ) && $file['error'] ) {
+ return call_user_func_array( $upload_error_handler, array( &$file, $file['error'] ) );
+ }
+
+ // Install user overrides. Did we mention that this voids your warranty?
+
+ // You may define your own function and pass the name in $overrides['unique_filename_callback']
+ $unique_filename_callback = null;
+ if ( isset( $overrides['unique_filename_callback'] ) ) {
+ $unique_filename_callback = $overrides['unique_filename_callback'];
+ }
+
+ /*
+ * This may not have orignially been intended to be overrideable,
+ * but historically has been.
+ */
+ if ( isset( $overrides['upload_error_strings'] ) ) {
+ $upload_error_strings = $overrides['upload_error_strings'];
+ } else {
+ // Courtesy of php.net, the strings that describe the error indicated in $_FILES[{form field}]['error'].
+ $upload_error_strings = array(
+ false,
+ __( 'The uploaded file exceeds the upload_max_filesize directive in php.ini.' ),
+ __( 'The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form.' ),
+ __( 'The uploaded file was only partially uploaded.' ),
+ __( 'No file was uploaded.' ),
+ '',
+ __( 'Missing a temporary folder.' ),
+ __( 'Failed to write file to disk.' ),
+ __( 'File upload stopped by extension.' ),
+ );
+ }
+
+ // All tests are on by default. Most can be turned off by $overrides[{test_name}] = false;
+ $test_form = isset( $overrides['test_form'] ) ? $overrides['test_form'] : true;
+ $test_size = isset( $overrides['test_size'] ) ? $overrides['test_size'] : true;
+
+ // If you override this, you must provide $ext and $type!!
+ $test_type = isset( $overrides['test_type'] ) ? $overrides['test_type'] : true;
+ $mimes = isset( $overrides['mimes'] ) ? $overrides['mimes'] : false;
+
+ // A correct form post will pass this test.
+ if ( $test_form && ( ! isset( $_POST['action'] ) || ( $_POST['action'] != $action ) ) ) {
+ return call_user_func_array( $upload_error_handler, array( &$file, __( 'Invalid form submission.' ) ) );
+ }
+ // A successful upload will pass this test. It makes no sense to override this one.
+ if ( isset( $file['error'] ) && $file['error'] > 0 ) {
+ return call_user_func_array( $upload_error_handler, array( &$file, $upload_error_strings[ $file['error'] ] ) );
+ }
+
+ // A properly uploaded file will pass this test. There should be no reason to override this one.
+ $test_uploaded_file = 'wp_handle_upload' === $action ? @ is_uploaded_file( $file['tmp_name'] ) : @ is_readable( $file['tmp_name'] );
+ if ( ! $test_uploaded_file ) {
+ return call_user_func_array( $upload_error_handler, array( &$file, __( 'Specified file failed upload test.' ) ) );
+ }
+
+ $test_file_size = 'wp_handle_upload' === $action ? $file['size'] : filesize( $file['tmp_name'] );
+ // A non-empty file will pass this test.
+ if ( $test_size && ! ( $test_file_size > 0 ) ) {
+ if ( is_multisite() ) {
+ $error_msg = __( 'File is empty. Please upload something more substantial.' );
+ } else {
+ $error_msg = __( 'File is empty. Please upload something more substantial. This error could also be caused by uploads being disabled in your php.ini or by post_max_size being defined as smaller than upload_max_filesize in php.ini.' );
+ }
+ return call_user_func_array( $upload_error_handler, array( &$file, $error_msg ) );
+ }
+
+ // A correct MIME type will pass this test. Override $mimes or use the upload_mimes filter.
+ if ( $test_type ) {
+ $wp_filetype = wp_check_filetype_and_ext( $file['tmp_name'], $file['name'], $mimes );
+ $ext = empty( $wp_filetype['ext'] ) ? '' : $wp_filetype['ext'];
+ $type = empty( $wp_filetype['type'] ) ? '' : $wp_filetype['type'];
+ $proper_filename = empty( $wp_filetype['proper_filename'] ) ? '' : $wp_filetype['proper_filename'];
+
+ // Check to see if wp_check_filetype_and_ext() determined the filename was incorrect
+ if ( $proper_filename ) {
+ $file['name'] = $proper_filename;
+ }
+ if ( ( ! $type || ! $ext ) && ! current_user_can( 'unfiltered_upload' ) ) {
+ return call_user_func_array( $upload_error_handler, array( &$file, __( 'Sorry, this file type is not permitted for security reasons.' ) ) );
+ }
+ if ( ! $type ) {
+ $type = $file['type'];
+ }
+ } else {
+ $type = '';
+ }
+
+ /*
+ * A writable uploads dir will pass this test. Again, there's no point
+ * overriding this one.
+ */
+ if ( ! ( ( $uploads = wp_upload_dir( $time ) ) && false === $uploads['error'] ) ) {
+ return call_user_func_array( $upload_error_handler, array( &$file, $uploads['error'] ) );
+ }
+
+ $filename = wp_unique_filename( $uploads['path'], $file['name'], $unique_filename_callback );
+
+ // Move the file to the uploads dir.
+ $new_file = $uploads['path'] . "/$filename";
+
+ /**
+ * Filters whether to short-circuit moving the uploaded file after passing all checks.
+ *
+ * If a non-null value is passed to the filter, moving the file and any related error
+ * reporting will be completely skipped.
+ *
+ * @since 4.9.0
+ *
+ * @param string $move_new_file If null (default) move the file after the upload.
+ * @param string $file An array of data for a single file.
+ * @param string $new_file Filename of the newly-uploaded file.
+ * @param string $type File type.
+ */
+ $move_new_file = apply_filters( 'pre_move_uploaded_file', null, $file, $new_file, $type );
+
+ if ( null === $move_new_file ) {
+ if ( 'wp_handle_upload' === $action ) {
+ $move_new_file = @ move_uploaded_file( $file['tmp_name'], $new_file );
+ } else {
+ // use copy and unlink because rename breaks streams.
+ $move_new_file = @ copy( $file['tmp_name'], $new_file );
+ unlink( $file['tmp_name'] );
+ }
+
+ if ( false === $move_new_file ) {
+ if ( 0 === strpos( $uploads['basedir'], ABSPATH ) ) {
+ $error_path = str_replace( ABSPATH, '', $uploads['basedir'] ) . $uploads['subdir'];
+ } else {
+ $error_path = basename( $uploads['basedir'] ) . $uploads['subdir'];
+ }
+ return $upload_error_handler( $file, sprintf( __( 'The uploaded file could not be moved to %s.' ), $error_path ) );
+ }
+ }
+
+ // Set correct file permissions.
+ $stat = stat( dirname( $new_file ) );
+ $perms = $stat['mode'] & 0000666;
+ @ chmod( $new_file, $perms );
+
+ // Compute the URL.
+ $url = $uploads['url'] . "/$filename";
+
+ if ( is_multisite() ) {
+ delete_transient( 'dirsize_cache' );
+ }
+
+ /**
+ * Filters the data array for the uploaded file.
+ *
+ * @since 2.1.0
+ *
+ * @param array $upload {
+ * Array of upload data.
+ *
+ * @type string $file Filename of the newly-uploaded file.
+ * @type string $url URL of the uploaded file.
+ * @type string $type File type.
+ * }
+ * @param string $context The type of upload action. Values include 'upload' or 'sideload'.
+ */
+ return apply_filters(
+ 'wp_handle_upload',
+ array(
+ 'file' => $new_file,
+ 'url' => $url,
+ 'type' => $type,
+ ),
+ 'wp_handle_sideload' === $action ? 'sideload' : 'upload'
+ );
+}
+
+/**
+ * Wrapper for _wp_handle_upload().
+ *
+ * Passes the {@see 'wp_handle_upload'} action.
+ *
+ * @since 2.0.0
+ *
+ * @see _wp_handle_upload()
+ *
+ * @param array $file Reference to a single element of `$_FILES`. Call the function once for
+ * each uploaded file.
+ * @param array|bool $overrides Optional. An associative array of names=>values to override default
+ * variables. Default false.
+ * @param string $time Optional. Time formatted in 'yyyy/mm'. Default null.
+ * @return array On success, returns an associative array of file attributes. On failure, returns
+ * $overrides['upload_error_handler'](&$file, $message ) or array( 'error'=>$message ).
+ */
+function wp_handle_upload( &$file, $overrides = false, $time = null ) {
+ /*
+ * $_POST['action'] must be set and its value must equal $overrides['action']
+ * or this:
+ */
+ $action = 'wp_handle_upload';
+ if ( isset( $overrides['action'] ) ) {
+ $action = $overrides['action'];
+ }
+
+ return _wp_handle_upload( $file, $overrides, $time, $action );
+}
+
+/**
+ * Wrapper for _wp_handle_upload().
+ *
+ * Passes the {@see 'wp_handle_sideload'} action.
+ *
+ * @since 2.6.0
+ *
+ * @see _wp_handle_upload()
+ *
+ * @param array $file An array similar to that of a PHP `$_FILES` POST array
+ * @param array|bool $overrides Optional. An associative array of names=>values to override default
+ * variables. Default false.
+ * @param string $time Optional. Time formatted in 'yyyy/mm'. Default null.
+ * @return array On success, returns an associative array of file attributes. On failure, returns
+ * $overrides['upload_error_handler'](&$file, $message ) or array( 'error'=>$message ).
+ */
+function wp_handle_sideload( &$file, $overrides = false, $time = null ) {
+ /*
+ * $_POST['action'] must be set and its value must equal $overrides['action']
+ * or this:
+ */
+ $action = 'wp_handle_sideload';
+ if ( isset( $overrides['action'] ) ) {
+ $action = $overrides['action'];
+ }
+ return _wp_handle_upload( $file, $overrides, $time, $action );
+}
+
+
+/**
+ * Downloads a URL to a local temporary file using the WordPress HTTP API.
+ *
+ * Please note that the calling function must unlink() the file.
+ *
+ * @since 2.5.0
+ * @since 5.2.0 Signature Verification with SoftFail was added.
+ *
+ * @param string $url The URL of the file to download.
+ * @param int $timeout The timeout for the request to download the file. Default 300 seconds.
+ * @param bool $signature_verification Whether to perform Signature Verification. Default false.
+ * @return string|WP_Error Filename on success, WP_Error on failure.
+ */
+function download_url( $url, $timeout = 300, $signature_verification = false ) {
+ //WARNING: The file is not automatically deleted, The script must unlink() the file.
+ if ( ! $url ) {
+ return new WP_Error( 'http_no_url', __( 'Invalid URL Provided.' ) );
+ }
+
+ $url_filename = basename( parse_url( $url, PHP_URL_PATH ) );
+
+ $tmpfname = wp_tempnam( $url_filename );
+ if ( ! $tmpfname ) {
+ return new WP_Error( 'http_no_file', __( 'Could not create Temporary file.' ) );
+ }
+
+ $response = wp_safe_remote_get(
+ $url,
+ array(
+ 'timeout' => $timeout,
+ 'stream' => true,
+ 'filename' => $tmpfname,
+ )
+ );
+
+ if ( is_wp_error( $response ) ) {
+ unlink( $tmpfname );
+ return $response;
+ }
+
+ $response_code = wp_remote_retrieve_response_code( $response );
+
+ if ( 200 != $response_code ) {
+ $data = array(
+ 'code' => $response_code,
+ );
+
+ // Retrieve a sample of the response body for debugging purposes.
+ $tmpf = fopen( $tmpfname, 'rb' );
+ if ( $tmpf ) {
+ /**
+ * Filters the maximum error response body size in `download_url()`.
+ *
+ * @since 5.1.0
+ *
+ * @see download_url()
+ *
+ * @param int $size The maximum error response body size. Default 1 KB.
+ */
+ $response_size = apply_filters( 'download_url_error_max_body_size', KB_IN_BYTES );
+ $data['body'] = fread( $tmpf, $response_size );
+ fclose( $tmpf );
+ }
+
+ unlink( $tmpfname );
+ return new WP_Error( 'http_404', trim( wp_remote_retrieve_response_message( $response ) ), $data );
+ }
+
+ $content_md5 = wp_remote_retrieve_header( $response, 'content-md5' );
+ if ( $content_md5 ) {
+ $md5_check = verify_file_md5( $tmpfname, $content_md5 );
+ if ( is_wp_error( $md5_check ) ) {
+ unlink( $tmpfname );
+ return $md5_check;
+ }
+ }
+
+ // If the caller expects signature verification to occur, check to see if this URL supports it.
+ if ( $signature_verification ) {
+ /**
+ * Filters the list of hosts which should have Signature Verification attempteds on.
+ *
+ * @since 5.2.0
+ *
+ * @param array List of hostnames.
+ */
+ $signed_hostnames = apply_filters( 'wp_signature_hosts', array( 'wordpress.org', 'downloads.wordpress.org', 's.w.org' ) );
+ $signature_verification = in_array( parse_url( $url, PHP_URL_HOST ), $signed_hostnames, true );
+ }
+
+ // Perform signature valiation if supported.
+ if ( $signature_verification ) {
+ $signature = wp_remote_retrieve_header( $response, 'x-content-signature' );
+ if ( ! $signature ) {
+ // Retrieve signatures from a file if the header wasn't included.
+ // WordPress.org stores signatures at $package_url.sig
+
+ $signature_url = false;
+ $url_path = parse_url( $url, PHP_URL_PATH );
+ if ( substr( $url_path, -4 ) == '.zip' || substr( $url_path, -7 ) == '.tar.gz' ) {
+ $signature_url = str_replace( $url_path, $url_path . '.sig', $url );
+ }
+
+ /**
+ * Filter the URL where the signature for a file is located.
+ *
+ * @since 5.2.0
+ *
+ * @param false|string $signature_url The URL where signatures can be found for a file, or false if none are known.
+ * @param string $url The URL being verified.
+ */
+ $signature_url = apply_filters( 'wp_signature_url', $signature_url, $url );
+
+ if ( $signature_url ) {
+ $signature_request = wp_safe_remote_get(
+ $signature_url,
+ array(
+ 'limit_response_size' => 10 * 1024, // 10KB should be large enough for quite a few signatures.
+ )
+ );
+
+ if ( ! is_wp_error( $signature_request ) && 200 === wp_remote_retrieve_response_code( $signature_request ) ) {
+ $signature = explode( "\n", wp_remote_retrieve_body( $signature_request ) );
+ }
+ }
+ }
+
+ // Perform the checks.
+ $signature_verification = verify_file_signature( $tmpfname, $signature, basename( parse_url( $url, PHP_URL_PATH ) ) );
+ }
+
+ if ( is_wp_error( $signature_verification ) ) {
+ if (
+ /**
+ * Filters whether Signature Verification failures should be allowed to soft fail.
+ *
+ * WARNING: This may be removed from a future release.
+ *
+ * @since 5.2.0
+ *
+ * @param bool $signature_softfail If a softfail is allowed.
+ * @param string $url The url being accessed.
+ */
+ apply_filters( 'wp_signature_softfail', true, $url )
+ ) {
+ $signature_verification->add_data( $tmpfname, 'softfail-filename' );
+ } else {
+ // Hard-fail.
+ unlink( $tmpfname );
+ }
+
+ return $signature_verification;
+ }
+
+ return $tmpfname;
+}
+
+/**
+ * Calculates and compares the MD5 of a file to its expected value.
+ *
+ * @since 3.7.0
+ *
+ * @param string $filename The filename to check the MD5 of.
+ * @param string $expected_md5 The expected MD5 of the file, either a base64-encoded raw md5,
+ * or a hex-encoded md5.
+ * @return bool|WP_Error True on success, false when the MD5 format is unknown/unexpected,
+ * WP_Error on failure.
+ */
+function verify_file_md5( $filename, $expected_md5 ) {
+ if ( 32 == strlen( $expected_md5 ) ) {
+ $expected_raw_md5 = pack( 'H*', $expected_md5 );
+ } elseif ( 24 == strlen( $expected_md5 ) ) {
+ $expected_raw_md5 = base64_decode( $expected_md5 );
+ } else {
+ return false; // unknown format
+ }
+
+ $file_md5 = md5_file( $filename, true );
+
+ if ( $file_md5 === $expected_raw_md5 ) {
+ return true;
+ }
+
+ return new WP_Error( 'md5_mismatch', sprintf( __( 'The checksum of the file (%1$s) does not match the expected checksum value (%2$s).' ), bin2hex( $file_md5 ), bin2hex( $expected_raw_md5 ) ) );
+}
+
+/**
+ * Verifies the contents of a file against its ED25519 signature.
+ *
+ * @since 5.2.0
+ *
+ * @param string $filename The file to validate.
+ * @param string|array $signatures A Signature provided for the file.
+ * @param string $filename_for_errors A friendly filename for errors. Optional.
+ *
+ * @return bool|WP_Error true on success, false if verificaiton not attempted, or WP_Error describing an error condition.
+ */
+function verify_file_signature( $filename, $signatures, $filename_for_errors = false ) {
+ if ( ! $filename_for_errors ) {
+ $filename_for_errors = wp_basename( $filename );
+ }
+
+ // Check we can process signatures.
+ if ( ! function_exists( 'sodium_crypto_sign_verify_detached' ) || ! in_array( 'sha384', array_map( 'strtolower', hash_algos() ) ) ) {
+ return new WP_Error(
+ 'signature_verification_unsupported',
+ sprintf(
+ /* translators: %s: The filename of the package. */
+ __( 'The authenticity of %s could not be verified as signature verification is unavailable on this system.' ),
+ '<span class="code">' . esc_html( $filename_for_errors ) . '</span>'
+ ),
+ ( ! function_exists( 'sodium_crypto_sign_verify_detached' ) ? 'sodium_crypto_sign_verify_detached' : 'sha384' )
+ );
+ }
+
+ // Check for a edge-case affecting PHP Maths abilities
+ if (
+ ! extension_loaded( 'sodium' ) &&
+ in_array( PHP_VERSION_ID, [ 70200, 70201, 70202 ], true ) &&
+ extension_loaded( 'opcache' )
+ ) {
+ // Sodium_Compat isn't compatible with PHP 7.2.0~7.2.2 due to a bug in the PHP Opcache extension, bail early as it'll fail.
+ // https://bugs.php.net/bug.php?id=75938
+
+ return new WP_Error(
+ 'signature_verification_unsupported',
+ sprintf(
+ /* translators: %s: The filename of the package. */
+ __( 'The authenticity of %s could not be verified as signature verification is unavailable on this system.' ),
+ '<span class="code">' . esc_html( $filename_for_errors ) . '</span>'
+ ),
+ array(
+ 'php' => phpversion(),
+ 'sodium' => defined( 'SODIUM_LIBRARY_VERSION' ) ? SODIUM_LIBRARY_VERSION : ( defined( 'ParagonIE_Sodium_Compat::VERSION_STRING' ) ? ParagonIE_Sodium_Compat::VERSION_STRING : false ),
+ )
+ );
+
+ }
+
+ // Verify runtime speed of Sodium_Compat is acceptable.
+ if ( ! extension_loaded( 'sodium' ) && ! ParagonIE_Sodium_Compat::polyfill_is_fast() ) {
+ $sodium_compat_is_fast = false;
+
+ // Allow for an old version of Sodium_Compat being loaded before the bundled WordPress one.
+ if ( method_exists( 'ParagonIE_Sodium_Compat', 'runtime_speed_test' ) ) {
+ // Run `ParagonIE_Sodium_Compat::runtime_speed_test()` in optimized integer mode, as that's what WordPress utilises during signing verifications.
+ $old_fastMult = ParagonIE_Sodium_Compat::$fastMult;
+ ParagonIE_Sodium_Compat::$fastMult = true;
+ $sodium_compat_is_fast = ParagonIE_Sodium_Compat::runtime_speed_test( 100, 10 );
+ ParagonIE_Sodium_Compat::$fastMult = $old_fastMult;
+ }
+
+ // This cannot be performed in a reasonable amount of time
+ // https://github.com/paragonie/sodium_compat#help-sodium_compat-is-slow-how-can-i-make-it-fast
+ if ( ! $sodium_compat_is_fast ) {
+ return new WP_Error(
+ 'signature_verification_unsupported',
+ sprintf(
+ /* translators: %s: The filename of the package. */
+ __( 'The authenticity of %s could not be verified as signature verification is unavailable on this system.' ),
+ '<span class="code">' . esc_html( $filename_for_errors ) . '</span>'
+ ),
+ array(
+ 'php' => phpversion(),
+ 'sodium' => defined( 'SODIUM_LIBRARY_VERSION' ) ? SODIUM_LIBRARY_VERSION : ( defined( 'ParagonIE_Sodium_Compat::VERSION_STRING' ) ? ParagonIE_Sodium_Compat::VERSION_STRING : false ),
+ 'polyfill_is_fast' => false,
+ 'max_execution_time' => ini_get( 'max_execution_time' ),
+ )
+ );
+ }
+ }
+
+ if ( ! $signatures ) {
+ return new WP_Error(
+ 'signature_verification_no_signature',
+ sprintf(
+ /* translators: %s: The filename of the package. */
+ __( 'The authenticity of %s could not be verified as no signature was found.' ),
+ '<span class="code">' . esc_html( $filename_for_errors ) . '</span>'
+ ),
+ array(
+ 'filename' => $filename_for_errors,
+ )
+ );
+ }
+
+ $trusted_keys = wp_trusted_keys();
+ $file_hash = hash_file( 'sha384', $filename, true );
+
+ mbstring_binary_safe_encoding();
+
+ $skipped_key = $skipped_signature = 0;
+
+ foreach ( (array) $signatures as $signature ) {
+ $signature_raw = base64_decode( $signature );
+
+ // Ensure only valid-length signatures are considered.
+ if ( SODIUM_CRYPTO_SIGN_BYTES !== strlen( $signature_raw ) ) {
+ $skipped_signature++;
+ continue;
+ }
+
+ foreach ( (array) $trusted_keys as $key ) {
+ $key_raw = base64_decode( $key );
+
+ // Only pass valid public keys through.
+ if ( SODIUM_CRYPTO_SIGN_PUBLICKEYBYTES !== strlen( $key_raw ) ) {
+ $skipped_key++;
+ continue;
+ }
+
+ if ( sodium_crypto_sign_verify_detached( $signature_raw, $file_hash, $key_raw ) ) {
+ reset_mbstring_encoding();
+ return true;
+ }
+ }
+ }
+
+ reset_mbstring_encoding();
+
+ return new WP_Error(
+ 'signature_verification_failed',
+ sprintf(
+ /* translators: %s: The filename of the package. */
+ __( 'The authenticity of %s could not be verified.' ),
+ '<span class="code">' . esc_html( $filename_for_errors ) . '</span>'
+ ),
+ // Error data helpful for debugging:
+ array(
+ 'filename' => $filename_for_errors,
+ 'keys' => $trusted_keys,
+ 'signatures' => $signatures,
+ 'hash' => bin2hex( $file_hash ),
+ 'skipped_key' => $skipped_key,
+ 'skipped_sig' => $skipped_signature,
+ 'php' => phpversion(),
+ 'sodium' => defined( 'SODIUM_LIBRARY_VERSION' ) ? SODIUM_LIBRARY_VERSION : ( defined( 'ParagonIE_Sodium_Compat::VERSION_STRING' ) ? ParagonIE_Sodium_Compat::VERSION_STRING : false ),
+ )
+ );
+}
+
+/**
+ * Retrieve the list of signing keys trusted by WordPress.
+ *
+ * @since 5.2.0
+ *
+ * @return array List of base64-encoded Signing keys.
+ */
+function wp_trusted_keys() {
+ $trusted_keys = array();
+
+ if ( time() < 1617235200 ) {
+ // WordPress.org Key #1 - This key is only valid before April 1st, 2021.
+ $trusted_keys[] = 'fRPyrxb/MvVLbdsYi+OOEv4xc+Eqpsj+kkAS6gNOkI0=';
+ }
+
+ // TODO: Add key #2 with longer expiration.
+
+ /**
+ * Filter the valid Signing keys used to verify the contents of files.
+ *
+ * @since 5.2.0
+ *
+ * @param array $trusted_keys The trusted keys that may sign packages.
+ */
+ return apply_filters( 'wp_trusted_keys', $trusted_keys );
+}
+
+/**
+ * Unzips a specified ZIP file to a location on the filesystem via the WordPress
+ * Filesystem Abstraction.
+ *
+ * Assumes that WP_Filesystem() has already been called and set up. Does not extract
+ * a root-level __MACOSX directory, if present.
+ *
+ * Attempts to increase the PHP memory limit to 256M before uncompressing. However,
+ * the most memory required shouldn't be much larger than the archive itself.
+ *
+ * @since 2.5.0
+ *
+ * @global WP_Filesystem_Base $wp_filesystem WordPress filesystem subclass.
+ *
+ * @param string $file Full path and filename of ZIP archive.
+ * @param string $to Full path on the filesystem to extract archive to.
+ * @return true|WP_Error True on success, WP_Error on failure.
+ */
+function unzip_file( $file, $to ) {
+ global $wp_filesystem;
+
+ if ( ! $wp_filesystem || ! is_object( $wp_filesystem ) ) {
+ return new WP_Error( 'fs_unavailable', __( 'Could not access filesystem.' ) );
+ }
+
+ // Unzip can use a lot of memory, but not this much hopefully.
+ wp_raise_memory_limit( 'admin' );
+
+ $needed_dirs = array();
+ $to = trailingslashit( $to );
+
+ // Determine any parent directories needed (of the upgrade directory).
+ if ( ! $wp_filesystem->is_dir( $to ) ) { // Only do parents if no children exist.
+ $path = preg_split( '![/\\\]!', untrailingslashit( $to ) );
+ for ( $i = count( $path ); $i >= 0; $i-- ) {
+ if ( empty( $path[ $i ] ) ) {
+ continue;
+ }
+
+ $dir = implode( '/', array_slice( $path, 0, $i + 1 ) );
+ if ( preg_match( '!^[a-z]:$!i', $dir ) ) { // Skip it if it looks like a Windows Drive letter.
+ continue;
+ }
+
+ if ( ! $wp_filesystem->is_dir( $dir ) ) {
+ $needed_dirs[] = $dir;
+ } else {
+ break; // A folder exists, therefore we don't need to check the levels below this.
+ }
+ }
+ }
+
+ /**
+ * Filters whether to use ZipArchive to unzip archives.
+ *
+ * @since 3.0.0
+ *
+ * @param bool $ziparchive Whether to use ZipArchive. Default true.
+ */
+ if ( class_exists( 'ZipArchive', false ) && apply_filters( 'unzip_file_use_ziparchive', true ) ) {
+ $result = _unzip_file_ziparchive( $file, $to, $needed_dirs );
+ if ( true === $result ) {
+ return $result;
+ } elseif ( is_wp_error( $result ) ) {
+ if ( 'incompatible_archive' != $result->get_error_code() ) {
+ return $result;
+ }
+ }
+ }
+ // Fall through to PclZip if ZipArchive is not available, or encountered an error opening the file.
+ return _unzip_file_pclzip( $file, $to, $needed_dirs );
+}
+
+/**
+ * Attempts to unzip an archive using the ZipArchive class.
+ *
+ * This function should not be called directly, use `unzip_file()` instead.
+ *
+ * Assumes that WP_Filesystem() has already been called and set up.
+ *
+ * @since 3.0.0
+ * @see unzip_file()
+ * @access private
+ *
+ * @global WP_Filesystem_Base $wp_filesystem WordPress filesystem subclass.
+ *
+ * @param string $file Full path and filename of ZIP archive.
+ * @param string $to Full path on the filesystem to extract archive to.
+ * @param array $needed_dirs A partial list of required folders needed to be created.
+ * @return true|WP_Error True on success, WP_Error on failure.
+ */
+function _unzip_file_ziparchive( $file, $to, $needed_dirs = array() ) {
+ global $wp_filesystem;
+
+ $z = new ZipArchive();
+
+ $zopen = $z->open( $file, ZIPARCHIVE::CHECKCONS );
+ if ( true !== $zopen ) {
+ return new WP_Error( 'incompatible_archive', __( 'Incompatible Archive.' ), array( 'ziparchive_error' => $zopen ) );
+ }
+
+ $uncompressed_size = 0;
+
+ for ( $i = 0; $i < $z->numFiles; $i++ ) {
+ if ( ! $info = $z->statIndex( $i ) ) {
+ return new WP_Error( 'stat_failed_ziparchive', __( 'Could not retrieve file from archive.' ) );
+ }
+
+ if ( '__MACOSX/' === substr( $info['name'], 0, 9 ) ) { // Skip the OS X-created __MACOSX directory
+ continue;
+ }
+
+ // Don't extract invalid files:
+ if ( 0 !== validate_file( $info['name'] ) ) {
+ continue;
+ }
+
+ $uncompressed_size += $info['size'];
+
+ if ( '/' === substr( $info['name'], -1 ) ) {
+ // Directory.
+ $needed_dirs[] = $to . untrailingslashit( $info['name'] );
+ } elseif ( '.' !== $dirname = dirname( $info['name'] ) ) {
+ // Path to a file.
+ $needed_dirs[] = $to . untrailingslashit( $dirname );
+ }
+ }
+
+ /*
+ * disk_free_space() could return false. Assume that any falsey value is an error.
+ * A disk that has zero free bytes has bigger problems.
+ * Require we have enough space to unzip the file and copy its contents, with a 10% buffer.
+ */
+ if ( wp_doing_cron() ) {
+ $available_space = @disk_free_space( WP_CONTENT_DIR );
+ if ( $available_space && ( $uncompressed_size * 2.1 ) > $available_space ) {
+ return new WP_Error( 'disk_full_unzip_file', __( 'Could not copy files. You may have run out of disk space.' ), compact( 'uncompressed_size', 'available_space' ) );
+ }
+ }
+
+ $needed_dirs = array_unique( $needed_dirs );
+ foreach ( $needed_dirs as $dir ) {
+ // Check the parent folders of the folders all exist within the creation array.
+ if ( untrailingslashit( $to ) == $dir ) { // Skip over the working directory, We know this exists (or will exist)
+ continue;
+ }
+ if ( strpos( $dir, $to ) === false ) { // If the directory is not within the working directory, Skip it
+ continue;
+ }
+
+ $parent_folder = dirname( $dir );
+ while ( ! empty( $parent_folder ) && untrailingslashit( $to ) != $parent_folder && ! in_array( $parent_folder, $needed_dirs ) ) {
+ $needed_dirs[] = $parent_folder;
+ $parent_folder = dirname( $parent_folder );
+ }
+ }
+ asort( $needed_dirs );
+
+ // Create those directories if need be:
+ foreach ( $needed_dirs as $_dir ) {
+ // Only check to see if the Dir exists upon creation failure. Less I/O this way.
+ if ( ! $wp_filesystem->mkdir( $_dir, FS_CHMOD_DIR ) && ! $wp_filesystem->is_dir( $_dir ) ) {
+ return new WP_Error( 'mkdir_failed_ziparchive', __( 'Could not create directory.' ), substr( $_dir, strlen( $to ) ) );
+ }
+ }
+ unset( $needed_dirs );
+
+ for ( $i = 0; $i < $z->numFiles; $i++ ) {
+ if ( ! $info = $z->statIndex( $i ) ) {
+ return new WP_Error( 'stat_failed_ziparchive', __( 'Could not retrieve file from archive.' ) );
+ }
+
+ if ( '/' == substr( $info['name'], -1 ) ) { // directory
+ continue;
+ }
+
+ if ( '__MACOSX/' === substr( $info['name'], 0, 9 ) ) { // Don't extract the OS X-created __MACOSX directory files
+ continue;
+ }
+
+ // Don't extract invalid files:
+ if ( 0 !== validate_file( $info['name'] ) ) {
+ continue;
+ }
+
+ $contents = $z->getFromIndex( $i );
+ if ( false === $contents ) {
+ return new WP_Error( 'extract_failed_ziparchive', __( 'Could not extract file from archive.' ), $info['name'] );
+ }
+
+ if ( ! $wp_filesystem->put_contents( $to . $info['name'], $contents, FS_CHMOD_FILE ) ) {
+ return new WP_Error( 'copy_failed_ziparchive', __( 'Could not copy file.' ), $info['name'] );
+ }
+ }
+
+ $z->close();
+
+ return true;
+}
+
+/**
+ * Attempts to unzip an archive using the PclZip library.
+ *
+ * This function should not be called directly, use `unzip_file()` instead.
+ *
+ * Assumes that WP_Filesystem() has already been called and set up.
+ *
+ * @since 3.0.0
+ * @see unzip_file()
+ * @access private
+ *
+ * @global WP_Filesystem_Base $wp_filesystem WordPress filesystem subclass.
+ *
+ * @param string $file Full path and filename of ZIP archive.
+ * @param string $to Full path on the filesystem to extract archive to.
+ * @param array $needed_dirs A partial list of required folders needed to be created.
+ * @return true|WP_Error True on success, WP_Error on failure.
+ */
+function _unzip_file_pclzip( $file, $to, $needed_dirs = array() ) {
+ global $wp_filesystem;
+
+ mbstring_binary_safe_encoding();
+
+ require_once( ABSPATH . 'wp-admin/includes/class-pclzip.php' );
+
+ $archive = new PclZip( $file );
+
+ $archive_files = $archive->extract( PCLZIP_OPT_EXTRACT_AS_STRING );
+
+ reset_mbstring_encoding();
+
+ // Is the archive valid?
+ if ( ! is_array( $archive_files ) ) {
+ return new WP_Error( 'incompatible_archive', __( 'Incompatible Archive.' ), $archive->errorInfo( true ) );
+ }
+
+ if ( 0 == count( $archive_files ) ) {
+ return new WP_Error( 'empty_archive_pclzip', __( 'Empty archive.' ) );
+ }
+
+ $uncompressed_size = 0;
+
+ // Determine any children directories needed (From within the archive)
+ foreach ( $archive_files as $file ) {
+ if ( '__MACOSX/' === substr( $file['filename'], 0, 9 ) ) { // Skip the OS X-created __MACOSX directory
+ continue;
+ }
+
+ $uncompressed_size += $file['size'];
+
+ $needed_dirs[] = $to . untrailingslashit( $file['folder'] ? $file['filename'] : dirname( $file['filename'] ) );
+ }
+
+ /*
+ * disk_free_space() could return false. Assume that any falsey value is an error.
+ * A disk that has zero free bytes has bigger problems.
+ * Require we have enough space to unzip the file and copy its contents, with a 10% buffer.
+ */
+ if ( wp_doing_cron() ) {
+ $available_space = @disk_free_space( WP_CONTENT_DIR );
+ if ( $available_space && ( $uncompressed_size * 2.1 ) > $available_space ) {
+ return new WP_Error( 'disk_full_unzip_file', __( 'Could not copy files. You may have run out of disk space.' ), compact( 'uncompressed_size', 'available_space' ) );
+ }
+ }
+
+ $needed_dirs = array_unique( $needed_dirs );
+ foreach ( $needed_dirs as $dir ) {
+ // Check the parent folders of the folders all exist within the creation array.
+ if ( untrailingslashit( $to ) == $dir ) { // Skip over the working directory, We know this exists (or will exist)
+ continue;
+ }
+ if ( strpos( $dir, $to ) === false ) { // If the directory is not within the working directory, Skip it
+ continue;
+ }
+
+ $parent_folder = dirname( $dir );
+ while ( ! empty( $parent_folder ) && untrailingslashit( $to ) != $parent_folder && ! in_array( $parent_folder, $needed_dirs ) ) {
+ $needed_dirs[] = $parent_folder;
+ $parent_folder = dirname( $parent_folder );
+ }
+ }
+ asort( $needed_dirs );
+
+ // Create those directories if need be:
+ foreach ( $needed_dirs as $_dir ) {
+ // Only check to see if the dir exists upon creation failure. Less I/O this way.
+ if ( ! $wp_filesystem->mkdir( $_dir, FS_CHMOD_DIR ) && ! $wp_filesystem->is_dir( $_dir ) ) {
+ return new WP_Error( 'mkdir_failed_pclzip', __( 'Could not create directory.' ), substr( $_dir, strlen( $to ) ) );
+ }
+ }
+ unset( $needed_dirs );
+
+ // Extract the files from the zip
+ foreach ( $archive_files as $file ) {
+ if ( $file['folder'] ) {
+ continue;
+ }
+
+ if ( '__MACOSX/' === substr( $file['filename'], 0, 9 ) ) { // Don't extract the OS X-created __MACOSX directory files
+ continue;
+ }
+
+ // Don't extract invalid files:
+ if ( 0 !== validate_file( $file['filename'] ) ) {
+ continue;
+ }
+
+ if ( ! $wp_filesystem->put_contents( $to . $file['filename'], $file['content'], FS_CHMOD_FILE ) ) {
+ return new WP_Error( 'copy_failed_pclzip', __( 'Could not copy file.' ), $file['filename'] );
+ }
+ }
+ return true;
+}
+
+/**
+ * Copies a directory from one location to another via the WordPress Filesystem
+ * Abstraction.
+ *
+ * Assumes that WP_Filesystem() has already been called and setup.
+ *
+ * @since 2.5.0
+ *
+ * @global WP_Filesystem_Base $wp_filesystem WordPress filesystem subclass.
+ *
+ * @param string $from Source directory.
+ * @param string $to Destination directory.
+ * @param array $skip_list A list of files/folders to skip copying.
+ * @return true|WP_Error True on success, WP_Error on failure.
+ */
+function copy_dir( $from, $to, $skip_list = array() ) {
+ global $wp_filesystem;
+
+ $dirlist = $wp_filesystem->dirlist( $from );
+
+ $from = trailingslashit( $from );
+ $to = trailingslashit( $to );
+
+ foreach ( (array) $dirlist as $filename => $fileinfo ) {
+ if ( in_array( $filename, $skip_list ) ) {
+ continue;
+ }
+
+ if ( 'f' == $fileinfo['type'] ) {
+ if ( ! $wp_filesystem->copy( $from . $filename, $to . $filename, true, FS_CHMOD_FILE ) ) {
+ // If copy failed, chmod file to 0644 and try again.
+ $wp_filesystem->chmod( $to . $filename, FS_CHMOD_FILE );
+ if ( ! $wp_filesystem->copy( $from . $filename, $to . $filename, true, FS_CHMOD_FILE ) ) {
+ return new WP_Error( 'copy_failed_copy_dir', __( 'Could not copy file.' ), $to . $filename );
+ }
+ }
+ } elseif ( 'd' == $fileinfo['type'] ) {
+ if ( ! $wp_filesystem->is_dir( $to . $filename ) ) {
+ if ( ! $wp_filesystem->mkdir( $to . $filename, FS_CHMOD_DIR ) ) {
+ return new WP_Error( 'mkdir_failed_copy_dir', __( 'Could not create directory.' ), $to . $filename );
+ }
+ }
+
+ // generate the $sub_skip_list for the subdirectory as a sub-set of the existing $skip_list
+ $sub_skip_list = array();
+ foreach ( $skip_list as $skip_item ) {
+ if ( 0 === strpos( $skip_item, $filename . '/' ) ) {
+ $sub_skip_list[] = preg_replace( '!^' . preg_quote( $filename, '!' ) . '/!i', '', $skip_item );
+ }
+ }
+
+ $result = copy_dir( $from . $filename, $to . $filename, $sub_skip_list );
+ if ( is_wp_error( $result ) ) {
+ return $result;
+ }
+ }
+ }
+ return true;
+}
+
+/**
+ * Initialises and connects the WordPress Filesystem Abstraction classes.
+ *
+ * This function will include the chosen transport and attempt connecting.
+ *
+ * Plugins may add extra transports, And force WordPress to use them by returning
+ * the filename via the {@see 'filesystem_method_file'} filter.
+ *
+ * @since 2.5.0
+ *
+ * @global WP_Filesystem_Base $wp_filesystem WordPress filesystem subclass.
+ *
+ * @param array|false $args Optional. Connection args, These are passed directly to
+ * the `WP_Filesystem_*()` classes. Default false.
+ * @param string|false $context Optional. Context for get_filesystem_method(). Default false.
+ * @param bool $allow_relaxed_file_ownership Optional. Whether to allow Group/World writable. Default false.
+ * @return bool|null True on success, false on failure, null if the filesystem method class file does not exist.
+ */
+function WP_Filesystem( $args = false, $context = false, $allow_relaxed_file_ownership = false ) {
+ global $wp_filesystem;
+
+ require_once( ABSPATH . 'wp-admin/includes/class-wp-filesystem-base.php' );
+
+ $method = get_filesystem_method( $args, $context, $allow_relaxed_file_ownership );
+
+ if ( ! $method ) {
+ return false;
+ }
+
+ if ( ! class_exists( "WP_Filesystem_$method" ) ) {
+
+ /**
+ * Filters the path for a specific filesystem method class file.
+ *
+ * @since 2.6.0
+ *
+ * @see get_filesystem_method()
+ *
+ * @param string $path Path to the specific filesystem method class file.
+ * @param string $method The filesystem method to use.
+ */
+ $abstraction_file = apply_filters( 'filesystem_method_file', ABSPATH . 'wp-admin/includes/class-wp-filesystem-' . $method . '.php', $method );
+
+ if ( ! file_exists( $abstraction_file ) ) {
+ return;
+ }
+
+ require_once( $abstraction_file );
+ }
+ $method = "WP_Filesystem_$method";
+
+ $wp_filesystem = new $method( $args );
+
+ //Define the timeouts for the connections. Only available after the construct is called to allow for per-transport overriding of the default.
+ if ( ! defined( 'FS_CONNECT_TIMEOUT' ) ) {
+ define( 'FS_CONNECT_TIMEOUT', 30 );
+ }
+ if ( ! defined( 'FS_TIMEOUT' ) ) {
+ define( 'FS_TIMEOUT', 30 );
+ }
+
+ if ( is_wp_error( $wp_filesystem->errors ) && $wp_filesystem->errors->has_errors() ) {
+ return false;
+ }
+
+ if ( ! $wp_filesystem->connect() ) {
+ return false; //There was an error connecting to the server.
+ }
+
+ // Set the permission constants if not already set.
+ if ( ! defined( 'FS_CHMOD_DIR' ) ) {
+ define( 'FS_CHMOD_DIR', ( fileperms( ABSPATH ) & 0777 | 0755 ) );
+ }
+ if ( ! defined( 'FS_CHMOD_FILE' ) ) {
+ define( 'FS_CHMOD_FILE', ( fileperms( ABSPATH . 'index.php' ) & 0777 | 0644 ) );
+ }
+
+ return true;
+}
+
+/**
+ * Determines which method to use for reading, writing, modifying, or deleting
+ * files on the filesystem.
+ *
+ * The priority of the transports are: Direct, SSH2, FTP PHP Extension, FTP Sockets
+ * (Via Sockets class, or `fsockopen()`). Valid values for these are: 'direct', 'ssh2',
+ * 'ftpext' or 'ftpsockets'.
+ *
+ * The return value can be overridden by defining the `FS_METHOD` constant in `wp-config.php`,
+ * or filtering via {@see 'filesystem_method'}.
+ *
+ * @link https://codex.wordpress.org/Editing_wp-config.php#WordPress_Upgrade_Constants
+ *
+ * Plugins may define a custom transport handler, See WP_Filesystem().
+ *
+ * @since 2.5.0
+ *
+ * @global callable $_wp_filesystem_direct_method
+ *
+ * @param array $args Optional. Connection details. Default empty array.
+ * @param string $context Optional. Full path to the directory that is tested
+ * for being writable. Default empty.
+ * @param bool $allow_relaxed_file_ownership Optional. Whether to allow Group/World writable.
+ * Default false.
+ * @return string The transport to use, see description for valid return values.
+ */
+function get_filesystem_method( $args = array(), $context = '', $allow_relaxed_file_ownership = false ) {
+ $method = defined( 'FS_METHOD' ) ? FS_METHOD : false; // Please ensure that this is either 'direct', 'ssh2', 'ftpext' or 'ftpsockets'
+
+ if ( ! $context ) {
+ $context = WP_CONTENT_DIR;
+ }
+
+ // If the directory doesn't exist (wp-content/languages) then use the parent directory as we'll create it.
+ if ( WP_LANG_DIR == $context && ! is_dir( $context ) ) {
+ $context = dirname( $context );
+ }
+
+ $context = trailingslashit( $context );
+
+ if ( ! $method ) {
+
+ $temp_file_name = $context . 'temp-write-test-' . str_replace( '.', '-', uniqid( '', true ) );
+ $temp_handle = @fopen( $temp_file_name, 'w' );
+ if ( $temp_handle ) {
+
+ // Attempt to determine the file owner of the WordPress files, and that of newly created files
+ $wp_file_owner = $temp_file_owner = false;
+ if ( function_exists( 'fileowner' ) ) {
+ $wp_file_owner = @fileowner( __FILE__ );
+ $temp_file_owner = @fileowner( $temp_file_name );
+ }
+
+ if ( $wp_file_owner !== false && $wp_file_owner === $temp_file_owner ) {
+ // WordPress is creating files as the same owner as the WordPress files,
+ // this means it's safe to modify & create new files via PHP.
+ $method = 'direct';
+ $GLOBALS['_wp_filesystem_direct_method'] = 'file_owner';
+ } elseif ( $allow_relaxed_file_ownership ) {
+ // The $context directory is writable, and $allow_relaxed_file_ownership is set, this means we can modify files
+ // safely in this directory. This mode doesn't create new files, only alter existing ones.
+ $method = 'direct';
+ $GLOBALS['_wp_filesystem_direct_method'] = 'relaxed_ownership';
+ }
+
+ @fclose( $temp_handle );
+ @unlink( $temp_file_name );
+ }
+ }
+
+ if ( ! $method && isset( $args['connection_type'] ) && 'ssh' == $args['connection_type'] && extension_loaded( 'ssh2' ) && function_exists( 'stream_get_contents' ) ) {
+ $method = 'ssh2';
+ }
+ if ( ! $method && extension_loaded( 'ftp' ) ) {
+ $method = 'ftpext';
+ }
+ if ( ! $method && ( extension_loaded( 'sockets' ) || function_exists( 'fsockopen' ) ) ) {
+ $method = 'ftpsockets'; //Sockets: Socket extension; PHP Mode: FSockopen / fwrite / fread
+ }
+
+ /**
+ * Filters the filesystem method to use.
+ *
+ * @since 2.6.0
+ *
+ * @param string $method Filesystem method to return.
+ * @param array $args An array of connection details for the method.
+ * @param string $context Full path to the directory that is tested for being writable.
+ * @param bool $allow_relaxed_file_ownership Whether to allow Group/World writable.
+ */
+ return apply_filters( 'filesystem_method', $method, $args, $context, $allow_relaxed_file_ownership );
+}
+
+/**
+ * Displays a form to the user to request for their FTP/SSH details in order
+ * to connect to the filesystem.
+ *
+ * All chosen/entered details are saved, excluding the password.
+ *
+ * Hostnames may be in the form of hostname:portnumber (eg: wordpress.org:2467)
+ * to specify an alternate FTP/SSH port.
+ *
+ * Plugins may override this form by returning true|false via the {@see 'request_filesystem_credentials'} filter.
+ *
+ * @since 2.5.0
+ * @since 4.6.0 The `$context` parameter default changed from `false` to an empty string.
+ *
+ * @global string $pagenow
+ *
+ * @param string $form_post The URL to post the form to.
+ * @param string $type Optional. Chosen type of filesystem. Default empty.
+ * @param bool $error Optional. Whether the current request has failed to connect.
+ * Default false.
+ * @param string $context Optional. Full path to the directory that is tested for being
+ * writable. Default empty.
+ * @param array $extra_fields Optional. Extra `POST` fields to be checked for inclusion in
+ * the post. Default null.
+ * @param bool $allow_relaxed_file_ownership Optional. Whether to allow Group/World writable. Default false.
+ *
+ * @return bool True on success, false on failure.
+ */
+function request_filesystem_credentials( $form_post, $type = '', $error = false, $context = '', $extra_fields = null, $allow_relaxed_file_ownership = false ) {
+ global $pagenow;
+
+ /**
+ * Filters the filesystem credentials form output.
+ *
+ * Returning anything other than an empty string will effectively short-circuit
+ * output of the filesystem credentials form, returning that value instead.
+ *
+ * @since 2.5.0
+ * @since 4.6.0 The `$context` parameter default changed from `false` to an empty string.
+ *
+ * @param mixed $output Form output to return instead. Default empty.
+ * @param string $form_post The URL to post the form to.
+ * @param string $type Chosen type of filesystem.
+ * @param bool $error Whether the current request has failed to connect.
+ * Default false.
+ * @param string $context Full path to the directory that is tested for
+ * being writable.
+ * @param bool $allow_relaxed_file_ownership Whether to allow Group/World writable.
+ * Default false.
+ * @param array $extra_fields Extra POST fields.
+ */
+ $req_cred = apply_filters( 'request_filesystem_credentials', '', $form_post, $type, $error, $context, $extra_fields, $allow_relaxed_file_ownership );
+ if ( '' !== $req_cred ) {
+ return $req_cred;
+ }
+
+ if ( empty( $type ) ) {
+ $type = get_filesystem_method( array(), $context, $allow_relaxed_file_ownership );
+ }
+
+ if ( 'direct' == $type ) {
+ return true;
+ }
+
+ if ( is_null( $extra_fields ) ) {
+ $extra_fields = array( 'version', 'locale' );
+ }
+
+ $credentials = get_option(
+ 'ftp_credentials',
+ array(
+ 'hostname' => '',
+ 'username' => '',
+ )
+ );
+
+ $submitted_form = wp_unslash( $_POST );
+
+ // Verify nonce, or unset submitted form field values on failure
+ if ( ! isset( $_POST['_fs_nonce'] ) || ! wp_verify_nonce( $_POST['_fs_nonce'], 'filesystem-credentials' ) ) {
+ unset(
+ $submitted_form['hostname'],
+ $submitted_form['username'],
+ $submitted_form['password'],
+ $submitted_form['public_key'],
+ $submitted_form['private_key'],
+ $submitted_form['connection_type']
+ );
+ }
+
+ // If defined, set it to that, Else, If POST'd, set it to that, If not, Set it to whatever it previously was(saved details in option)
+ $credentials['hostname'] = defined( 'FTP_HOST' ) ? FTP_HOST : ( ! empty( $submitted_form['hostname'] ) ? $submitted_form['hostname'] : $credentials['hostname'] );
+ $credentials['username'] = defined( 'FTP_USER' ) ? FTP_USER : ( ! empty( $submitted_form['username'] ) ? $submitted_form['username'] : $credentials['username'] );
+ $credentials['password'] = defined( 'FTP_PASS' ) ? FTP_PASS : ( ! empty( $submitted_form['password'] ) ? $submitted_form['password'] : '' );
+
+ // Check to see if we are setting the public/private keys for ssh
+ $credentials['public_key'] = defined( 'FTP_PUBKEY' ) ? FTP_PUBKEY : ( ! empty( $submitted_form['public_key'] ) ? $submitted_form['public_key'] : '' );
+ $credentials['private_key'] = defined( 'FTP_PRIKEY' ) ? FTP_PRIKEY : ( ! empty( $submitted_form['private_key'] ) ? $submitted_form['private_key'] : '' );
+
+ // Sanitize the hostname, Some people might pass in odd-data:
+ $credentials['hostname'] = preg_replace( '|\w+://|', '', $credentials['hostname'] ); //Strip any schemes off
+
+ if ( strpos( $credentials['hostname'], ':' ) ) {
+ list( $credentials['hostname'], $credentials['port'] ) = explode( ':', $credentials['hostname'], 2 );
+ if ( ! is_numeric( $credentials['port'] ) ) {
+ unset( $credentials['port'] );
+ }
+ } else {
+ unset( $credentials['port'] );
+ }
+
+ if ( ( defined( 'FTP_SSH' ) && FTP_SSH ) || ( defined( 'FS_METHOD' ) && 'ssh2' == FS_METHOD ) ) {
+ $credentials['connection_type'] = 'ssh';
+ } elseif ( ( defined( 'FTP_SSL' ) && FTP_SSL ) && 'ftpext' == $type ) { //Only the FTP Extension understands SSL
+ $credentials['connection_type'] = 'ftps';
+ } elseif ( ! empty( $submitted_form['connection_type'] ) ) {
+ $credentials['connection_type'] = $submitted_form['connection_type'];
+ } elseif ( ! isset( $credentials['connection_type'] ) ) { //All else fails (And it's not defaulted to something else saved), Default to FTP
+ $credentials['connection_type'] = 'ftp';
+ }
+ if ( ! $error &&
+ (
+ ( ! empty( $credentials['password'] ) && ! empty( $credentials['username'] ) && ! empty( $credentials['hostname'] ) ) ||
+ ( 'ssh' == $credentials['connection_type'] && ! empty( $credentials['public_key'] ) && ! empty( $credentials['private_key'] ) )
+ ) ) {
+ $stored_credentials = $credentials;
+ if ( ! empty( $stored_credentials['port'] ) ) { //save port as part of hostname to simplify above code.
+ $stored_credentials['hostname'] .= ':' . $stored_credentials['port'];
+ }
+
+ unset( $stored_credentials['password'], $stored_credentials['port'], $stored_credentials['private_key'], $stored_credentials['public_key'] );
+ if ( ! wp_installing() ) {
+ update_option( 'ftp_credentials', $stored_credentials );
+ }
+ return $credentials;
+ }
+ $hostname = isset( $credentials['hostname'] ) ? $credentials['hostname'] : '';
+ $username = isset( $credentials['username'] ) ? $credentials['username'] : '';
+ $public_key = isset( $credentials['public_key'] ) ? $credentials['public_key'] : '';
+ $private_key = isset( $credentials['private_key'] ) ? $credentials['private_key'] : '';
+ $port = isset( $credentials['port'] ) ? $credentials['port'] : '';
+ $connection_type = isset( $credentials['connection_type'] ) ? $credentials['connection_type'] : '';
+
+ if ( $error ) {
+ $error_string = __( '<strong>ERROR:</strong> There was an error connecting to the server, Please verify the settings are correct.' );
+ if ( is_wp_error( $error ) ) {
+ $error_string = esc_html( $error->get_error_message() );
+ }
+ echo '<div id="message" class="error"><p>' . $error_string . '</p></div>';
+ }
+
+ $types = array();
+ if ( extension_loaded( 'ftp' ) || extension_loaded( 'sockets' ) || function_exists( 'fsockopen' ) ) {
+ $types['ftp'] = __( 'FTP' );
+ }
+ if ( extension_loaded( 'ftp' ) ) { //Only this supports FTPS
+ $types['ftps'] = __( 'FTPS (SSL)' );
+ }
+ if ( extension_loaded( 'ssh2' ) && function_exists( 'stream_get_contents' ) ) {
+ $types['ssh'] = __( 'SSH2' );
+ }
+
+ /**
+ * Filters the connection types to output to the filesystem credentials form.
+ *
+ * @since 2.9.0
+ * @since 4.6.0 The `$context` parameter default changed from `false` to an empty string.
+ *
+ * @param array $types Types of connections.
+ * @param array $credentials Credentials to connect with.
+ * @param string $type Chosen filesystem method.
+ * @param object $error Error object.
+ * @param string $context Full path to the directory that is tested
+ * for being writable.
+ */
+ $types = apply_filters( 'fs_ftp_connection_types', $types, $credentials, $type, $error, $context );
+
+ ?>
+<form action="<?php echo esc_url( $form_post ); ?>" method="post">
+<div id="request-filesystem-credentials-form" class="request-filesystem-credentials-form">
+ <?php
+ // Print a H1 heading in the FTP credentials modal dialog, default is a H2.
+ $heading_tag = 'h2';
+ if ( 'plugins.php' === $pagenow || 'plugin-install.php' === $pagenow ) {
+ $heading_tag = 'h1';
+ }
+ echo "<$heading_tag id='request-filesystem-credentials-title'>" . __( 'Connection Information' ) . "</$heading_tag>";
+ ?>
+<p id="request-filesystem-credentials-desc">
+ <?php
+ $label_user = __( 'Username' );
+ $label_pass = __( 'Password' );
+ _e( 'To perform the requested action, WordPress needs to access your web server.' );
+ echo ' ';
+ if ( ( isset( $types['ftp'] ) || isset( $types['ftps'] ) ) ) {
+ if ( isset( $types['ssh'] ) ) {
+ _e( 'Please enter your FTP or SSH credentials to proceed.' );
+ $label_user = __( 'FTP/SSH Username' );
+ $label_pass = __( 'FTP/SSH Password' );
+ } else {
+ _e( 'Please enter your FTP credentials to proceed.' );
+ $label_user = __( 'FTP Username' );
+ $label_pass = __( 'FTP Password' );
+ }
+ echo ' ';
+ }
+ _e( 'If you do not remember your credentials, you should contact your web host.' );
+
+ $hostname_value = esc_attr( $hostname );
+ if ( ! empty( $port ) ) {
+ $hostname_value .= ":$port";
+ }
+
+ $password_value = '';
+ if ( defined( 'FTP_PASS' ) ) {
+ $password_value = '*****';
+ }
+ ?>
+</p>
+<label for="hostname">
+ <span class="field-title"><?php _e( 'Hostname' ); ?></span>
+ <input name="hostname" type="text" id="hostname" aria-describedby="request-filesystem-credentials-desc" class="code" placeholder="<?php esc_attr_e( 'example: www.wordpress.org' ); ?>" value="<?php echo $hostname_value; ?>"<?php disabled( defined( 'FTP_HOST' ) ); ?> />
+</label>
+<div class="ftp-username">
+ <label for="username">
+ <span class="field-title"><?php echo $label_user; ?></span>
+ <input name="username" type="text" id="username" value="<?php echo esc_attr( $username ); ?>"<?php disabled( defined( 'FTP_USER' ) ); ?> />
+ </label>
+</div>
+<div class="ftp-password">
+ <label for="password">
+ <span class="field-title"><?php echo $label_pass; ?></span>
+ <input name="password" type="password" id="password" value="<?php echo $password_value; ?>"<?php disabled( defined( 'FTP_PASS' ) ); ?> />
+ <em>
+ <?php
+ if ( ! defined( 'FTP_PASS' ) ) {
+ _e( 'This password will not be stored on the server.' );}
+ ?>
+</em>
+ </label>
+</div>
+<fieldset>
+<legend><?php _e( 'Connection Type' ); ?></legend>
+ <?php
+ $disabled = disabled( ( defined( 'FTP_SSL' ) && FTP_SSL ) || ( defined( 'FTP_SSH' ) && FTP_SSH ), true, false );
+ foreach ( $types as $name => $text ) :
+ ?>
+ <label for="<?php echo esc_attr( $name ); ?>">
+ <input type="radio" name="connection_type" id="<?php echo esc_attr( $name ); ?>" value="<?php echo esc_attr( $name ); ?>" <?php checked( $name, $connection_type ); ?> <?php echo $disabled; ?> />
+ <?php echo $text; ?>
+ </label>
+ <?php
+ endforeach;
+ ?>
+</fieldset>
+ <?php
+ if ( isset( $types['ssh'] ) ) {
+ $hidden_class = '';
+ if ( 'ssh' != $connection_type || empty( $connection_type ) ) {
+ $hidden_class = ' class="hidden"';
+ }
+ ?>
+<fieldset id="ssh-keys"<?php echo $hidden_class; ?>>
+<legend><?php _e( 'Authentication Keys' ); ?></legend>
+<label for="public_key">
+ <span class="field-title"><?php _e( 'Public Key:' ); ?></span>
+ <input name="public_key" type="text" id="public_key" aria-describedby="auth-keys-desc" value="<?php echo esc_attr( $public_key ); ?>"<?php disabled( defined( 'FTP_PUBKEY' ) ); ?> />
+</label>
+<label for="private_key">
+ <span class="field-title"><?php _e( 'Private Key:' ); ?></span>
+ <input name="private_key" type="text" id="private_key" value="<?php echo esc_attr( $private_key ); ?>"<?php disabled( defined( 'FTP_PRIKEY' ) ); ?> />
+</label>
+<p id="auth-keys-desc"><?php _e( 'Enter the location on the server where the public and private keys are located. If a passphrase is needed, enter that in the password field above.' ); ?></p>
+</fieldset>
+ <?php
+ }
+
+ foreach ( (array) $extra_fields as $field ) {
+ if ( isset( $submitted_form[ $field ] ) ) {
+ echo '<input type="hidden" name="' . esc_attr( $field ) . '" value="' . esc_attr( $submitted_form[ $field ] ) . '" />';
+ }
+ }
+ ?>
+ <p class="request-filesystem-credentials-action-buttons">
+ <?php wp_nonce_field( 'filesystem-credentials', '_fs_nonce', false, true ); ?>
+ <button class="button cancel-button" data-js-action="close" type="button"><?php _e( 'Cancel' ); ?></button>
+ <?php submit_button( __( 'Proceed' ), '', 'upgrade', false ); ?>
+ </p>
+</div>
+</form>
+ <?php
+ return false;
+}
+
+/**
+ * Print the filesystem credentials modal when needed.
+ *
+ * @since 4.2.0
+ */
+function wp_print_request_filesystem_credentials_modal() {
+ $filesystem_method = get_filesystem_method();
+ ob_start();
+ $filesystem_credentials_are_stored = request_filesystem_credentials( self_admin_url() );
+ ob_end_clean();
+ $request_filesystem_credentials = ( $filesystem_method != 'direct' && ! $filesystem_credentials_are_stored );
+ if ( ! $request_filesystem_credentials ) {
+ return;
+ }
+ ?>
+ <div id="request-filesystem-credentials-dialog" class="notification-dialog-wrap request-filesystem-credentials-dialog">
+ <div class="notification-dialog-background"></div>
+ <div class="notification-dialog" role="dialog" aria-labelledby="request-filesystem-credentials-title" tabindex="0">
+ <div class="request-filesystem-credentials-dialog-content">
+ <?php request_filesystem_credentials( site_url() ); ?>
+ </div>
+ </div>
+ </div>
+ <?php
+}
+
+/**
+ * Generate a single group for the personal data export report.
+ *
+ * @since 4.9.6
+ *
+ * @param array $group_data {
+ * The group data to render.
+ *
+ * @type string $group_label The user-facing heading for the group, e.g. 'Comments'.
+ * @type array $items {
+ * An array of group items.
+ *
+ * @type array $group_item_data {
+ * An array of name-value pairs for the item.
+ *
+ * @type string $name The user-facing name of an item name-value pair, e.g. 'IP Address'.
+ * @type string $value The user-facing value of an item data pair, e.g. '50.60.70.0'.
+ * }
+ * }
+ * }
+ * @return string The HTML for this group and its items.
+ */
+function wp_privacy_generate_personal_data_export_group_html( $group_data ) {
+ $group_html = '<h2>' . esc_html( $group_data['group_label'] ) . '</h2>';
+ $group_html .= '<div>';
+
+ foreach ( (array) $group_data['items'] as $group_item_id => $group_item_data ) {
+ $group_html .= '<table>';
+ $group_html .= '<tbody>';
+
+ foreach ( (array) $group_item_data as $group_item_datum ) {
+ $value = $group_item_datum['value'];
+ // If it looks like a link, make it a link.
+ if ( false === strpos( $value, ' ' ) && ( 0 === strpos( $value, 'http://' ) || 0 === strpos( $value, 'https://' ) ) ) {
+ $value = '<a href="' . esc_url( $value ) . '">' . esc_html( $value ) . '</a>';
+ }
+
+ $group_html .= '<tr>';
+ $group_html .= '<th>' . esc_html( $group_item_datum['name'] ) . '</th>';
+ $group_html .= '<td>' . wp_kses( $value, 'personal_data_export' ) . '</td>';
+ $group_html .= '</tr>';
+ }
+
+ $group_html .= '</tbody>';
+ $group_html .= '</table>';
+ }
+
+ $group_html .= '</div>';
+
+ return $group_html;
+}
+
+/**
+ * Generate the personal data export file.
+ *
+ * @since 4.9.6
+ *
+ * @param int $request_id The export request ID.
+ */
+function wp_privacy_generate_personal_data_export_file( $request_id ) {
+ if ( ! class_exists( 'ZipArchive' ) ) {
+ wp_send_json_error( __( 'Unable to generate export file. ZipArchive not available.' ) );
+ }
+
+ // Get the request data.
+ $request = wp_get_user_request_data( $request_id );
+
+ if ( ! $request || 'export_personal_data' !== $request->action_name ) {
+ wp_send_json_error( __( 'Invalid request ID when generating export file.' ) );
+ }
+
+ $email_address = $request->email;
+
+ if ( ! is_email( $email_address ) ) {
+ wp_send_json_error( __( 'Invalid email address when generating export file.' ) );
+ }
+
+ // Create the exports folder if needed.
+ $exports_dir = wp_privacy_exports_dir();
+ $exports_url = wp_privacy_exports_url();
+
+ if ( ! wp_mkdir_p( $exports_dir ) ) {
+ wp_send_json_error( __( 'Unable to create export folder.' ) );
+ }
+
+ // Protect export folder from browsing.
+ $index_pathname = $exports_dir . 'index.html';
+ if ( ! file_exists( $index_pathname ) ) {
+ $file = fopen( $index_pathname, 'w' );
+ if ( false === $file ) {
+ wp_send_json_error( __( 'Unable to protect export folder from browsing.' ) );
+ }
+ fwrite( $file, '<!-- Silence is golden. -->' );
+ fclose( $file );
+ }
+
+ $stripped_email = str_replace( '@', '-at-', $email_address );
+ $stripped_email = sanitize_title( $stripped_email ); // slugify the email address
+ $obscura = wp_generate_password( 32, false, false );
+ $file_basename = 'wp-personal-data-file-' . $stripped_email . '-' . $obscura;
+ $html_report_filename = $file_basename . '.html';
+ $html_report_pathname = wp_normalize_path( $exports_dir . $html_report_filename );
+ $file = fopen( $html_report_pathname, 'w' );
+ if ( false === $file ) {
+ wp_send_json_error( __( 'Unable to open export file (HTML report) for writing.' ) );
+ }
+
+ $title = sprintf(
+ /* translators: %s: user's email address */
+ __( 'Personal Data Export for %s' ),
+ $email_address
+ );
+
+ // Open HTML.
+ fwrite( $file, "<!DOCTYPE html>\n" );
+ fwrite( $file, "<html>\n" );
+
+ // Head.
+ fwrite( $file, "<head>\n" );
+ fwrite( $file, "<meta http-equiv='Content-Type' content='text/html; charset=UTF-8' />\n" );
+ fwrite( $file, "<style type='text/css'>" );
+ fwrite( $file, 'body { color: black; font-family: Arial, sans-serif; font-size: 11pt; margin: 15px auto; width: 860px; }' );
+ fwrite( $file, 'table { background: #f0f0f0; border: 1px solid #ddd; margin-bottom: 20px; width: 100%; }' );
+ fwrite( $file, 'th { padding: 5px; text-align: left; width: 20%; }' );
+ fwrite( $file, 'td { padding: 5px; }' );
+ fwrite( $file, 'tr:nth-child(odd) { background-color: #fafafa; }' );
+ fwrite( $file, '</style>' );
+ fwrite( $file, '<title>' );
+ fwrite( $file, esc_html( $title ) );
+ fwrite( $file, '</title>' );
+ fwrite( $file, "</head>\n" );
+
+ // Body.
+ fwrite( $file, "<body>\n" );
+
+ // Heading.
+ fwrite( $file, '<h1>' . esc_html__( 'Personal Data Export' ) . '</h1>' );
+
+ // And now, all the Groups.
+ $groups = get_post_meta( $request_id, '_export_data_grouped', true );
+
+ // First, build an "About" group on the fly for this report.
+ $about_group = array(
+ /* translators: Header for the About section in a personal data export. */
+ 'group_label' => _x( 'About', 'personal data group label' ),
+ 'items' => array(
+ 'about-1' => array(
+ array(
+ 'name' => _x( 'Report generated for', 'email address' ),
+ 'value' => $email_address,
+ ),
+ array(
+ 'name' => _x( 'For site', 'website name' ),
+ 'value' => get_bloginfo( 'name' ),
+ ),
+ array(
+ 'name' => _x( 'At URL', 'website URL' ),
+ 'value' => get_bloginfo( 'url' ),
+ ),
+ array(
+ 'name' => _x( 'On', 'date/time' ),
+ 'value' => current_time( 'mysql' ),
+ ),
+ ),
+ ),
+ );
+
+ // Merge in the special about group.
+ $groups = array_merge( array( 'about' => $about_group ), $groups );
+
+ // Now, iterate over every group in $groups and have the formatter render it in HTML.
+ foreach ( (array) $groups as $group_id => $group_data ) {
+ fwrite( $file, wp_privacy_generate_personal_data_export_group_html( $group_data ) );
+ }
+
+ fwrite( $file, "</body>\n" );
+
+ // Close HTML.
+ fwrite( $file, "</html>\n" );
+ fclose( $file );
+
+ /*
+ * Now, generate the ZIP.
+ *
+ * If an archive has already been generated, then remove it and reuse the
+ * filename, to avoid breaking any URLs that may have been previously sent
+ * via email.
+ */
+ $error = false;
+ $archive_url = get_post_meta( $request_id, '_export_file_url', true );
+ $archive_pathname = get_post_meta( $request_id, '_export_file_path', true );
+
+ if ( empty( $archive_pathname ) || empty( $archive_url ) ) {
+ $archive_filename = $file_basename . '.zip';
+ $archive_pathname = $exports_dir . $archive_filename;
+ $archive_url = $exports_url . $archive_filename;
+
+ update_post_meta( $request_id, '_export_file_url', $archive_url );
+ update_post_meta( $request_id, '_export_file_path', wp_normalize_path( $archive_pathname ) );
+ }
+
+ if ( ! empty( $archive_pathname ) && file_exists( $archive_pathname ) ) {
+ wp_delete_file( $archive_pathname );
+ }
+
+ $zip = new ZipArchive;
+ if ( true === $zip->open( $archive_pathname, ZipArchive::CREATE ) ) {
+ if ( ! $zip->addFile( $html_report_pathname, 'index.html' ) ) {
+ $error = __( 'Unable to add data to export file.' );
+ }
+
+ $zip->close();
+
+ if ( ! $error ) {
+ /**
+ * Fires right after all personal data has been written to the export file.
+ *
+ * @since 4.9.6
+ *
+ * @param string $archive_pathname The full path to the export file on the filesystem.
+ * @param string $archive_url The URL of the archive file.
+ * @param string $html_report_pathname The full path to the personal data report on the filesystem.
+ * @param int $request_id The export request ID.
+ */
+ do_action( 'wp_privacy_personal_data_export_file_created', $archive_pathname, $archive_url, $html_report_pathname, $request_id );
+ }
+ } else {
+ $error = __( 'Unable to open export file (archive) for writing.' );
+ }
+
+ // And remove the HTML file.
+ unlink( $html_report_pathname );
+
+ if ( $error ) {
+ wp_send_json_error( $error );
+ }
+}
+
+/**
+ * Send an email to the user with a link to the personal data export file
+ *
+ * @since 4.9.6
+ *
+ * @param int $request_id The request ID for this personal data export.
+ * @return true|WP_Error True on success or `WP_Error` on failure.
+ */
+function wp_privacy_send_personal_data_export_email( $request_id ) {
+ // Get the request data.
+ $request = wp_get_user_request_data( $request_id );
+
+ if ( ! $request || 'export_personal_data' !== $request->action_name ) {
+ return new WP_Error( 'invalid_request', __( 'Invalid request ID when sending personal data export email.' ) );
+ }
+
+ // Localize message content for user; fallback to site default for visitors.
+ if ( ! empty( $request->user_id ) ) {
+ $locale = get_user_locale( $request->user_id );
+ } else {
+ $locale = get_locale();
+ }
+
+ $switched_locale = switch_to_locale( $locale );
+
+ /** This filter is documented in wp-includes/functions.php */
+ $expiration = apply_filters( 'wp_privacy_export_expiration', 3 * DAY_IN_SECONDS );
+ $expiration_date = date_i18n( get_option( 'date_format' ), time() + $expiration );
+
+ /* translators: Do not translate EXPIRATION, LINK, SITENAME, SITEURL: those are placeholders. */
+ $email_text = __(
+ 'Howdy,
+
+Your request for an export of personal data has been completed. You may
+download your personal data by clicking on the link below. For privacy
+and security, we will automatically delete the file on ###EXPIRATION###,
+so please download it before then.
+
+###LINK###
+
+Regards,
+All at ###SITENAME###
+###SITEURL###'
+ );
+
+ /**
+ * Filters the text of the email sent with a personal data export file.
+ *
+ * The following strings have a special meaning and will get replaced dynamically:
+ * ###EXPIRATION### The date when the URL will be automatically deleted.
+ * ###LINK### URL of the personal data export file for the user.
+ * ###SITENAME### The name of the site.
+ * ###SITEURL### The URL to the site.
+ *
+ * @since 4.9.6
+ *
+ * @param string $email_text Text in the email.
+ * @param int $request_id The request ID for this personal data export.
+ */
+ $content = apply_filters( 'wp_privacy_personal_data_email_content', $email_text, $request_id );
+
+ $email_address = $request->email;
+ $export_file_url = get_post_meta( $request_id, '_export_file_url', true );
+ $site_name = wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES );
+ $site_url = home_url();
+
+ $content = str_replace( '###EXPIRATION###', $expiration_date, $content );
+ $content = str_replace( '###LINK###', esc_url_raw( $export_file_url ), $content );
+ $content = str_replace( '###EMAIL###', $email_address, $content );
+ $content = str_replace( '###SITENAME###', $site_name, $content );
+ $content = str_replace( '###SITEURL###', esc_url_raw( $site_url ), $content );
+
+ $mail_success = wp_mail(
+ $email_address,
+ sprintf(
+ /* translators: Personal data export notification email subject. %s: Site title */
+ __( '[%s] Personal Data Export' ),
+ $site_name
+ ),
+ $content
+ );
+
+ if ( $switched_locale ) {
+ restore_previous_locale();
+ }
+
+ if ( ! $mail_success ) {
+ return new WP_Error( 'privacy_email_error', __( 'Unable to send personal data export email.' ) );
+ }
+
+ return true;
+}
+
+/**
+ * Intercept personal data exporter page ajax responses in order to assemble the personal data export file.
+ * @see wp_privacy_personal_data_export_page
+ * @since 4.9.6
+ *
+ * @param array $response The response from the personal data exporter for the given page.
+ * @param int $exporter_index The index of the personal data exporter. Begins at 1.
+ * @param string $email_address The email address of the user whose personal data this is.
+ * @param int $page The page of personal data for this exporter. Begins at 1.
+ * @param int $request_id The request ID for this personal data export.
+ * @param bool $send_as_email Whether the final results of the export should be emailed to the user.
+ * @param string $exporter_key The slug (key) of the exporter.
+ * @return array The filtered response.
+ */
+function wp_privacy_process_personal_data_export_page( $response, $exporter_index, $email_address, $page, $request_id, $send_as_email, $exporter_key ) {
+ /* Do some simple checks on the shape of the response from the exporter.
+ * If the exporter response is malformed, don't attempt to consume it - let it
+ * pass through to generate a warning to the user by default ajax processing.
+ */
+ if ( ! is_array( $response ) ) {
+ return $response;
+ }
+
+ if ( ! array_key_exists( 'done', $response ) ) {
+ return $response;
+ }
+
+ if ( ! array_key_exists( 'data', $response ) ) {
+ return $response;
+ }
+
+ if ( ! is_array( $response['data'] ) ) {
+ return $response;
+ }
+
+ // Get the request data.
+ $request = wp_get_user_request_data( $request_id );
+
+ if ( ! $request || 'export_personal_data' !== $request->action_name ) {
+ wp_send_json_error( __( 'Invalid request ID when merging exporter data.' ) );
+ }
+
+ $export_data = array();
+
+ // First exporter, first page? Reset the report data accumulation array.
+ if ( 1 === $exporter_index && 1 === $page ) {
+ update_post_meta( $request_id, '_export_data_raw', $export_data );
+ } else {
+ $export_data = get_post_meta( $request_id, '_export_data_raw', true );
+ }
+
+ // Now, merge the data from the exporter response into the data we have accumulated already.
+ $export_data = array_merge( $export_data, $response['data'] );
+ update_post_meta( $request_id, '_export_data_raw', $export_data );
+
+ // If we are not yet on the last page of the last exporter, return now.
+ /** This filter is documented in wp-admin/includes/ajax-actions.php */
+ $exporters = apply_filters( 'wp_privacy_personal_data_exporters', array() );
+ $is_last_exporter = $exporter_index === count( $exporters );
+ $exporter_done = $response['done'];
+ if ( ! $is_last_exporter || ! $exporter_done ) {
+ return $response;
+ }
+
+ // Last exporter, last page - let's prepare the export file.
+
+ // First we need to re-organize the raw data hierarchically in groups and items.
+ $groups = array();
+ foreach ( (array) $export_data as $export_datum ) {
+ $group_id = $export_datum['group_id'];
+ $group_label = $export_datum['group_label'];
+ if ( ! array_key_exists( $group_id, $groups ) ) {
+ $groups[ $group_id ] = array(
+ 'group_label' => $group_label,
+ 'items' => array(),
+ );
+ }
+
+ $item_id = $export_datum['item_id'];
+ if ( ! array_key_exists( $item_id, $groups[ $group_id ]['items'] ) ) {
+ $groups[ $group_id ]['items'][ $item_id ] = array();
+ }
+
+ $old_item_data = $groups[ $group_id ]['items'][ $item_id ];
+ $merged_item_data = array_merge( $export_datum['data'], $old_item_data );
+ $groups[ $group_id ]['items'][ $item_id ] = $merged_item_data;
+ }
+
+ // Then save the grouped data into the request.
+ delete_post_meta( $request_id, '_export_data_raw' );
+ update_post_meta( $request_id, '_export_data_grouped', $groups );
+
+ /**
+ * Generate the export file from the collected, grouped personal data.
+ *
+ * @since 4.9.6
+ *
+ * @param int $request_id The export request ID.
+ */
+ do_action( 'wp_privacy_personal_data_export_file', $request_id );
+
+ // Clear the grouped data now that it is no longer needed.
+ delete_post_meta( $request_id, '_export_data_grouped' );
+
+ // If the destination is email, send it now.
+ if ( $send_as_email ) {
+ $mail_success = wp_privacy_send_personal_data_export_email( $request_id );
+ if ( is_wp_error( $mail_success ) ) {
+ wp_send_json_error( $mail_success->get_error_message() );
+ }
+
+ // Update the request to completed state when the export email is sent.
+ _wp_privacy_completed_request( $request_id );
+ } else {
+ // Modify the response to include the URL of the export file so the browser can fetch it.
+ $export_file_url = get_post_meta( $request_id, '_export_file_url', true );
+ if ( ! empty( $export_file_url ) ) {
+ $response['url'] = $export_file_url;
+ }
+ }
+
+ return $response;
+}
diff --git a/www/crm/wp-admin/includes/image-edit.php b/www/crm/wp-admin/includes/image-edit.php
new file mode 100644
index 00000000..e1ae86b6
--- /dev/null
+++ b/www/crm/wp-admin/includes/image-edit.php
@@ -0,0 +1,967 @@
+<?php
+/**
+ * WordPress Image Editor
+ *
+ * @package WordPress
+ * @subpackage Administration
+ */
+
+/**
+ * Loads the WP image-editing interface.
+ *
+ * @since 2.9.0
+ *
+ * @param int $post_id Post ID.
+ * @param bool|object $msg Optional. Message to display for image editor updates or errors.
+ * Default false.
+ */
+function wp_image_editor( $post_id, $msg = false ) {
+ $nonce = wp_create_nonce( "image_editor-$post_id" );
+ $meta = wp_get_attachment_metadata( $post_id );
+ $thumb = image_get_intermediate_size( $post_id, 'thumbnail' );
+ $sub_sizes = isset( $meta['sizes'] ) && is_array( $meta['sizes'] );
+ $note = '';
+
+ if ( isset( $meta['width'], $meta['height'] ) ) {
+ $big = max( $meta['width'], $meta['height'] );
+ } else {
+ die( __( 'Image data does not exist. Please re-upload the image.' ) );
+ }
+
+ $sizer = $big > 400 ? 400 / $big : 1;
+
+ $backup_sizes = get_post_meta( $post_id, '_wp_attachment_backup_sizes', true );
+ $can_restore = false;
+ if ( ! empty( $backup_sizes ) && isset( $backup_sizes['full-orig'], $meta['file'] ) ) {
+ $can_restore = $backup_sizes['full-orig']['file'] != wp_basename( $meta['file'] );
+ }
+
+ if ( $msg ) {
+ if ( isset( $msg->error ) ) {
+ $note = "<div class='error'><p>$msg->error</p></div>";
+ } elseif ( isset( $msg->msg ) ) {
+ $note = "<div class='updated'><p>$msg->msg</p></div>";
+ }
+ }
+
+ ?>
+ <div class="imgedit-wrap wp-clearfix">
+ <div id="imgedit-panel-<?php echo $post_id; ?>">
+
+ <div class="imgedit-settings">
+ <div class="imgedit-group">
+ <div class="imgedit-group-top">
+ <h2><?php _e( 'Scale Image' ); ?></h2>
+ <button type="button" class="dashicons dashicons-editor-help imgedit-help-toggle" onclick="imageEdit.toggleHelp(this);return false;" aria-expanded="false"><span class="screen-reader-text"><?php esc_html_e( 'Scale Image Help' ); ?></span></button>
+ <div class="imgedit-help">
+ <p><?php _e( 'You can proportionally scale the original image. For best results, scaling should be done before you crop, flip, or rotate. Images can only be scaled down, not up.' ); ?></p>
+ </div>
+ <?php if ( isset( $meta['width'], $meta['height'] ) ) : ?>
+ <p><?php printf( __( 'Original dimensions %s' ), $meta['width'] . ' &times; ' . $meta['height'] ); ?></p>
+ <?php endif ?>
+ <div class="imgedit-submit">
+
+ <fieldset class="imgedit-scale">
+ <legend><?php _e( 'New dimensions:' ); ?></legend>
+ <div class="nowrap">
+ <label><span class="screen-reader-text"><?php _e( 'scale width' ); ?></span>
+ <input type="text" id="imgedit-scale-width-<?php echo $post_id; ?>" onkeyup="imageEdit.scaleChanged(<?php echo $post_id; ?>, 1, this)" onblur="imageEdit.scaleChanged(<?php echo $post_id; ?>, 1, this)" value="<?php echo isset( $meta['width'] ) ? $meta['width'] : 0; ?>" />
+ </label>
+ <span class="imgedit-separator">&times;</span>
+ <label><span class="screen-reader-text"><?php _e( 'scale height' ); ?></span>
+ <input type="text" id="imgedit-scale-height-<?php echo $post_id; ?>" onkeyup="imageEdit.scaleChanged(<?php echo $post_id; ?>, 0, this)" onblur="imageEdit.scaleChanged(<?php echo $post_id; ?>, 0, this)" value="<?php echo isset( $meta['height'] ) ? $meta['height'] : 0; ?>" />
+ </label>
+ <span class="imgedit-scale-warn" id="imgedit-scale-warn-<?php echo $post_id; ?>">!</span>
+ <input id="imgedit-scale-button" type="button" onclick="imageEdit.action(<?php echo "$post_id, '$nonce'"; ?>, 'scale')" class="button button-primary" value="<?php esc_attr_e( 'Scale' ); ?>" />
+ </div>
+ </fieldset>
+
+ </div>
+ </div>
+ </div>
+
+ <?php if ( $can_restore ) { ?>
+
+ <div class="imgedit-group">
+ <div class="imgedit-group-top">
+ <h2><button type="button" onclick="imageEdit.toggleHelp(this);" class="button-link"><?php _e( 'Restore Original Image' ); ?> <span class="dashicons dashicons-arrow-down imgedit-help-toggle"></span></button></h2>
+ <div class="imgedit-help">
+ <p>
+ <?php
+ _e( 'Discard any changes and restore the original image.' );
+
+ if ( ! defined( 'IMAGE_EDIT_OVERWRITE' ) || ! IMAGE_EDIT_OVERWRITE ) {
+ echo ' ' . __( 'Previously edited copies of the image will not be deleted.' );
+ }
+
+ ?>
+ </p>
+ <div class="imgedit-submit">
+ <input type="button" onclick="imageEdit.action(<?php echo "$post_id, '$nonce'"; ?>, 'restore')" class="button button-primary" value="<?php esc_attr_e( 'Restore image' ); ?>" <?php echo $can_restore; ?> />
+ </div>
+ </div>
+ </div>
+ </div>
+
+ <?php } ?>
+
+ <div class="imgedit-group">
+ <div class="imgedit-group-top">
+ <h2><?php _e( 'Image Crop' ); ?></h2>
+ <button type="button" class="dashicons dashicons-editor-help imgedit-help-toggle" onclick="imageEdit.toggleHelp(this);return false;" aria-expanded="false"><span class="screen-reader-text"><?php esc_html_e( 'Image Crop Help' ); ?></span></button>
+
+ <div class="imgedit-help">
+ <p><?php _e( 'To crop the image, click on it and drag to make your selection.' ); ?></p>
+
+ <p><strong><?php _e( 'Crop Aspect Ratio' ); ?></strong><br />
+ <?php _e( 'The aspect ratio is the relationship between the width and height. You can preserve the aspect ratio by holding down the shift key while resizing your selection. Use the input box to specify the aspect ratio, e.g. 1:1 (square), 4:3, 16:9, etc.' ); ?></p>
+
+ <p><strong><?php _e( 'Crop Selection' ); ?></strong><br />
+ <?php _e( 'Once you have made your selection, you can adjust it by entering the size in pixels. The minimum selection size is the thumbnail size as set in the Media settings.' ); ?></p>
+ </div>
+ </div>
+
+ <fieldset class="imgedit-crop-ratio">
+ <legend><?php _e( 'Aspect ratio:' ); ?></legend>
+ <div class="nowrap">
+ <label><span class="screen-reader-text"><?php _e( 'crop ratio width' ); ?></span>
+ <input type="text" id="imgedit-crop-width-<?php echo $post_id; ?>" onkeyup="imageEdit.setRatioSelection(<?php echo $post_id; ?>, 0, this)" onblur="imageEdit.setRatioSelection(<?php echo $post_id; ?>, 0, this)" />
+ </label>
+ <span class="imgedit-separator">:</span>
+ <label><span class="screen-reader-text"><?php _e( 'crop ratio height' ); ?></span>
+ <input type="text" id="imgedit-crop-height-<?php echo $post_id; ?>" onkeyup="imageEdit.setRatioSelection(<?php echo $post_id; ?>, 1, this)" onblur="imageEdit.setRatioSelection(<?php echo $post_id; ?>, 1, this)" />
+ </label>
+ </div>
+ </fieldset>
+
+ <fieldset id="imgedit-crop-sel-<?php echo $post_id; ?>" class="imgedit-crop-sel">
+ <legend><?php _e( 'Selection:' ); ?></legend>
+ <div class="nowrap">
+ <label><span class="screen-reader-text"><?php _e( 'selection width' ); ?></span>
+ <input type="text" id="imgedit-sel-width-<?php echo $post_id; ?>" onkeyup="imageEdit.setNumSelection(<?php echo $post_id; ?>, this)" onblur="imageEdit.setNumSelection(<?php echo $post_id; ?>, this)" />
+ </label>
+ <span class="imgedit-separator">&times;</span>
+ <label><span class="screen-reader-text"><?php _e( 'selection height' ); ?></span>
+ <input type="text" id="imgedit-sel-height-<?php echo $post_id; ?>" onkeyup="imageEdit.setNumSelection(<?php echo $post_id; ?>, this)" onblur="imageEdit.setNumSelection(<?php echo $post_id; ?>, this)" />
+ </label>
+ </div>
+ </fieldset>
+
+ </div>
+
+ <?php
+ if ( $thumb && $sub_sizes ) {
+ $thumb_img = wp_constrain_dimensions( $thumb['width'], $thumb['height'], 160, 120 );
+ ?>
+
+ <div class="imgedit-group imgedit-applyto">
+ <div class="imgedit-group-top">
+ <h2><?php _e( 'Thumbnail Settings' ); ?></h2>
+ <button type="button" class="dashicons dashicons-editor-help imgedit-help-toggle" onclick="imageEdit.toggleHelp(this);return false;" aria-expanded="false"><span class="screen-reader-text"><?php esc_html_e( 'Thumbnail Settings Help' ); ?></span></button>
+ <p class="imgedit-help"><?php _e( 'You can edit the image while preserving the thumbnail. For example, you may wish to have a square thumbnail that displays just a section of the image.' ); ?></p>
+ </div>
+
+ <figure class="imgedit-thumbnail-preview">
+ <img src="<?php echo $thumb['url']; ?>" width="<?php echo $thumb_img[0]; ?>" height="<?php echo $thumb_img[1]; ?>" class="imgedit-size-preview" alt="" draggable="false" />
+ <figcaption class="imgedit-thumbnail-preview-caption"><?php _e( 'Current thumbnail' ); ?></figcaption>
+ </figure>
+
+ <div id="imgedit-save-target-<?php echo $post_id; ?>" class="imgedit-save-target">
+ <fieldset>
+ <legend><strong><?php _e( 'Apply changes to:' ); ?></strong></legend>
+
+ <label class="imgedit-label">
+ <input type="radio" name="imgedit-target-<?php echo $post_id; ?>" value="all" checked="checked" />
+ <?php _e( 'All image sizes' ); ?></label>
+
+ <label class="imgedit-label">
+ <input type="radio" name="imgedit-target-<?php echo $post_id; ?>" value="thumbnail" />
+ <?php _e( 'Thumbnail' ); ?></label>
+
+ <label class="imgedit-label">
+ <input type="radio" name="imgedit-target-<?php echo $post_id; ?>" value="nothumb" />
+ <?php _e( 'All sizes except thumbnail' ); ?></label>
+ </fieldset>
+ </div>
+ </div>
+
+ <?php } ?>
+
+ </div>
+
+ <div class="imgedit-panel-content wp-clearfix">
+ <?php echo $note; ?>
+ <div class="imgedit-menu wp-clearfix">
+ <button type="button" onclick="imageEdit.handleCropToolClick( <?php echo "$post_id, '$nonce'"; ?>, this )" class="imgedit-crop button disabled" disabled><span class="screen-reader-text"><?php esc_html_e( 'Crop' ); ?></span></button>
+ <?php
+
+ // On some setups GD library does not provide imagerotate() - Ticket #11536
+ if ( wp_image_editor_supports(
+ array(
+ 'mime_type' => get_post_mime_type( $post_id ),
+ 'methods' => array( 'rotate' ),
+ )
+ ) ) {
+ $note_no_rotate = '';
+ ?>
+ <button type="button" class="imgedit-rleft button" onclick="imageEdit.rotate( 90, <?php echo "$post_id, '$nonce'"; ?>, this)"><span class="screen-reader-text"><?php esc_html_e( 'Rotate counter-clockwise' ); ?></span></button>
+ <button type="button" class="imgedit-rright button" onclick="imageEdit.rotate(-90, <?php echo "$post_id, '$nonce'"; ?>, this)"><span class="screen-reader-text"><?php esc_html_e( 'Rotate clockwise' ); ?></span></button>
+ <?php
+ } else {
+ $note_no_rotate = '<p class="note-no-rotate"><em>' . __( 'Image rotation is not supported by your web host.' ) . '</em></p>';
+ ?>
+ <button type="button" class="imgedit-rleft button disabled" disabled></button>
+ <button type="button" class="imgedit-rright button disabled" disabled></button>
+ <?php } ?>
+
+ <button type="button" onclick="imageEdit.flip(1, <?php echo "$post_id, '$nonce'"; ?>, this)" class="imgedit-flipv button"><span class="screen-reader-text"><?php esc_html_e( 'Flip vertically' ); ?></span></button>
+ <button type="button" onclick="imageEdit.flip(2, <?php echo "$post_id, '$nonce'"; ?>, this)" class="imgedit-fliph button"><span class="screen-reader-text"><?php esc_html_e( 'Flip horizontally' ); ?></span></button>
+
+ <button type="button" id="image-undo-<?php echo $post_id; ?>" onclick="imageEdit.undo(<?php echo "$post_id, '$nonce'"; ?>, this)" class="imgedit-undo button disabled" disabled><span class="screen-reader-text"><?php esc_html_e( 'Undo' ); ?></span></button>
+ <button type="button" id="image-redo-<?php echo $post_id; ?>" onclick="imageEdit.redo(<?php echo "$post_id, '$nonce'"; ?>, this)" class="imgedit-redo button disabled" disabled><span class="screen-reader-text"><?php esc_html_e( 'Redo' ); ?></span></button>
+ <?php echo $note_no_rotate; ?>
+ </div>
+
+ <input type="hidden" id="imgedit-sizer-<?php echo $post_id; ?>" value="<?php echo $sizer; ?>" />
+ <input type="hidden" id="imgedit-history-<?php echo $post_id; ?>" value="" />
+ <input type="hidden" id="imgedit-undone-<?php echo $post_id; ?>" value="0" />
+ <input type="hidden" id="imgedit-selection-<?php echo $post_id; ?>" value="" />
+ <input type="hidden" id="imgedit-x-<?php echo $post_id; ?>" value="<?php echo isset( $meta['width'] ) ? $meta['width'] : 0; ?>" />
+ <input type="hidden" id="imgedit-y-<?php echo $post_id; ?>" value="<?php echo isset( $meta['height'] ) ? $meta['height'] : 0; ?>" />
+
+ <div id="imgedit-crop-<?php echo $post_id; ?>" class="imgedit-crop-wrap">
+ <img id="image-preview-<?php echo $post_id; ?>" onload="imageEdit.imgLoaded('<?php echo $post_id; ?>')" src="<?php echo admin_url( 'admin-ajax.php', 'relative' ); ?>?action=imgedit-preview&amp;_ajax_nonce=<?php echo $nonce; ?>&amp;postid=<?php echo $post_id; ?>&amp;rand=<?php echo rand( 1, 99999 ); ?>" alt="" />
+ </div>
+
+ <div class="imgedit-submit">
+ <input type="button" onclick="imageEdit.close(<?php echo $post_id; ?>, 1)" class="button imgedit-cancel-btn" value="<?php esc_attr_e( 'Cancel' ); ?>" />
+ <input type="button" onclick="imageEdit.save(<?php echo "$post_id, '$nonce'"; ?>)" disabled="disabled" class="button button-primary imgedit-submit-btn" value="<?php esc_attr_e( 'Save' ); ?>" />
+ </div>
+ </div>
+
+ </div>
+ <div class="imgedit-wait" id="imgedit-wait-<?php echo $post_id; ?>"></div>
+ <div class="hidden" id="imgedit-leaving-<?php echo $post_id; ?>"><?php _e( "There are unsaved changes that will be lost. 'OK' to continue, 'Cancel' to return to the Image Editor." ); ?></div>
+ </div>
+ <?php
+}
+
+/**
+ * Streams image in WP_Image_Editor to browser.
+ *
+ * @since 2.9.0
+ *
+ * @param WP_Image_Editor $image The image editor instance.
+ * @param string $mime_type The mime type of the image.
+ * @param int $attachment_id The image's attachment post ID.
+ * @return bool True on success, false on failure.
+ */
+function wp_stream_image( $image, $mime_type, $attachment_id ) {
+ if ( $image instanceof WP_Image_Editor ) {
+
+ /**
+ * Filters the WP_Image_Editor instance for the image to be streamed to the browser.
+ *
+ * @since 3.5.0
+ *
+ * @param WP_Image_Editor $image The image editor instance.
+ * @param int $attachment_id The attachment post ID.
+ */
+ $image = apply_filters( 'image_editor_save_pre', $image, $attachment_id );
+
+ if ( is_wp_error( $image->stream( $mime_type ) ) ) {
+ return false;
+ }
+
+ return true;
+ } else {
+ _deprecated_argument( __FUNCTION__, '3.5.0', __( '$image needs to be an WP_Image_Editor object' ) );
+
+ /**
+ * Filters the GD image resource to be streamed to the browser.
+ *
+ * @since 2.9.0
+ * @deprecated 3.5.0 Use image_editor_save_pre instead.
+ *
+ * @param resource $image Image resource to be streamed.
+ * @param int $attachment_id The attachment post ID.
+ */
+ $image = apply_filters( 'image_save_pre', $image, $attachment_id );
+
+ switch ( $mime_type ) {
+ case 'image/jpeg':
+ header( 'Content-Type: image/jpeg' );
+ return imagejpeg( $image, null, 90 );
+ case 'image/png':
+ header( 'Content-Type: image/png' );
+ return imagepng( $image );
+ case 'image/gif':
+ header( 'Content-Type: image/gif' );
+ return imagegif( $image );
+ default:
+ return false;
+ }
+ }
+}
+
+/**
+ * Saves image to file.
+ *
+ * @since 2.9.0
+ *
+ * @param string $filename
+ * @param WP_Image_Editor $image
+ * @param string $mime_type
+ * @param int $post_id
+ * @return bool
+ */
+function wp_save_image_file( $filename, $image, $mime_type, $post_id ) {
+ if ( $image instanceof WP_Image_Editor ) {
+
+ /** This filter is documented in wp-admin/includes/image-edit.php */
+ $image = apply_filters( 'image_editor_save_pre', $image, $post_id );
+
+ /**
+ * Filters whether to skip saving the image file.
+ *
+ * Returning a non-null value will short-circuit the save method,
+ * returning that value instead.
+ *
+ * @since 3.5.0
+ *
+ * @param mixed $override Value to return instead of saving. Default null.
+ * @param string $filename Name of the file to be saved.
+ * @param WP_Image_Editor $image WP_Image_Editor instance.
+ * @param string $mime_type Image mime type.
+ * @param int $post_id Post ID.
+ */
+ $saved = apply_filters( 'wp_save_image_editor_file', null, $filename, $image, $mime_type, $post_id );
+
+ if ( null !== $saved ) {
+ return $saved;
+ }
+
+ return $image->save( $filename, $mime_type );
+ } else {
+ _deprecated_argument( __FUNCTION__, '3.5.0', __( '$image needs to be an WP_Image_Editor object' ) );
+
+ /** This filter is documented in wp-admin/includes/image-edit.php */
+ $image = apply_filters( 'image_save_pre', $image, $post_id );
+
+ /**
+ * Filters whether to skip saving the image file.
+ *
+ * Returning a non-null value will short-circuit the save method,
+ * returning that value instead.
+ *
+ * @since 2.9.0
+ * @deprecated 3.5.0 Use wp_save_image_editor_file instead.
+ *
+ * @param mixed $override Value to return instead of saving. Default null.
+ * @param string $filename Name of the file to be saved.
+ * @param WP_Image_Editor $image WP_Image_Editor instance.
+ * @param string $mime_type Image mime type.
+ * @param int $post_id Post ID.
+ */
+ $saved = apply_filters( 'wp_save_image_file', null, $filename, $image, $mime_type, $post_id );
+
+ if ( null !== $saved ) {
+ return $saved;
+ }
+
+ switch ( $mime_type ) {
+ case 'image/jpeg':
+ /** This filter is documented in wp-includes/class-wp-image-editor.php */
+ return imagejpeg( $image, $filename, apply_filters( 'jpeg_quality', 90, 'edit_image' ) );
+ case 'image/png':
+ return imagepng( $image, $filename );
+ case 'image/gif':
+ return imagegif( $image, $filename );
+ default:
+ return false;
+ }
+ }
+}
+
+/**
+ * Image preview ratio. Internal use only.
+ *
+ * @since 2.9.0
+ *
+ * @ignore
+ * @param int $w Image width in pixels.
+ * @param int $h Image height in pixels.
+ * @return float|int Image preview ratio.
+ */
+function _image_get_preview_ratio( $w, $h ) {
+ $max = max( $w, $h );
+ return $max > 400 ? ( 400 / $max ) : 1;
+}
+
+/**
+ * Returns an image resource. Internal use only.
+ *
+ * @since 2.9.0
+ * @deprecated 3.5.0 Use WP_Image_Editor::rotate()
+ * @see WP_Image_Editor::rotate()
+ *
+ * @ignore
+ * @param resource $img Image resource.
+ * @param float|int $angle Image rotation angle, in degrees.
+ * @return resource|false GD image resource, false otherwise.
+ */
+function _rotate_image_resource( $img, $angle ) {
+ _deprecated_function( __FUNCTION__, '3.5.0', 'WP_Image_Editor::rotate()' );
+ if ( function_exists( 'imagerotate' ) ) {
+ $rotated = imagerotate( $img, $angle, 0 );
+ if ( is_resource( $rotated ) ) {
+ imagedestroy( $img );
+ $img = $rotated;
+ }
+ }
+ return $img;
+}
+
+/**
+ * Flips an image resource. Internal use only.
+ *
+ * @since 2.9.0
+ * @deprecated 3.5.0 Use WP_Image_Editor::flip()
+ * @see WP_Image_Editor::flip()
+ *
+ * @ignore
+ * @param resource $img Image resource.
+ * @param bool $horz Whether to flip horizontally.
+ * @param bool $vert Whether to flip vertically.
+ * @return resource (maybe) flipped image resource.
+ */
+function _flip_image_resource( $img, $horz, $vert ) {
+ _deprecated_function( __FUNCTION__, '3.5.0', 'WP_Image_Editor::flip()' );
+ $w = imagesx( $img );
+ $h = imagesy( $img );
+ $dst = wp_imagecreatetruecolor( $w, $h );
+ if ( is_resource( $dst ) ) {
+ $sx = $vert ? ( $w - 1 ) : 0;
+ $sy = $horz ? ( $h - 1 ) : 0;
+ $sw = $vert ? -$w : $w;
+ $sh = $horz ? -$h : $h;
+
+ if ( imagecopyresampled( $dst, $img, 0, 0, $sx, $sy, $w, $h, $sw, $sh ) ) {
+ imagedestroy( $img );
+ $img = $dst;
+ }
+ }
+ return $img;
+}
+
+/**
+ * Crops an image resource. Internal use only.
+ *
+ * @since 2.9.0
+ *
+ * @ignore
+ * @param resource $img Image resource.
+ * @param float $x Source point x-coordinate.
+ * @param float $y Source point y-cooredinate.
+ * @param float $w Source width.
+ * @param float $h Source height.
+ * @return resource (maybe) cropped image resource.
+ */
+function _crop_image_resource( $img, $x, $y, $w, $h ) {
+ $dst = wp_imagecreatetruecolor( $w, $h );
+ if ( is_resource( $dst ) ) {
+ if ( imagecopy( $dst, $img, 0, 0, $x, $y, $w, $h ) ) {
+ imagedestroy( $img );
+ $img = $dst;
+ }
+ }
+ return $img;
+}
+
+/**
+ * Performs group of changes on Editor specified.
+ *
+ * @since 2.9.0
+ *
+ * @param WP_Image_Editor $image WP_Image_Editor instance.
+ * @param array $changes Array of change operations.
+ * @return WP_Image_Editor WP_Image_Editor instance with changes applied.
+ */
+function image_edit_apply_changes( $image, $changes ) {
+ if ( is_resource( $image ) ) {
+ _deprecated_argument( __FUNCTION__, '3.5.0', __( '$image needs to be an WP_Image_Editor object' ) );
+ }
+
+ if ( ! is_array( $changes ) ) {
+ return $image;
+ }
+
+ // Expand change operations.
+ foreach ( $changes as $key => $obj ) {
+ if ( isset( $obj->r ) ) {
+ $obj->type = 'rotate';
+ $obj->angle = $obj->r;
+ unset( $obj->r );
+ } elseif ( isset( $obj->f ) ) {
+ $obj->type = 'flip';
+ $obj->axis = $obj->f;
+ unset( $obj->f );
+ } elseif ( isset( $obj->c ) ) {
+ $obj->type = 'crop';
+ $obj->sel = $obj->c;
+ unset( $obj->c );
+ }
+ $changes[ $key ] = $obj;
+ }
+
+ // Combine operations.
+ if ( count( $changes ) > 1 ) {
+ $filtered = array( $changes[0] );
+ for ( $i = 0, $j = 1, $c = count( $changes ); $j < $c; $j++ ) {
+ $combined = false;
+ if ( $filtered[ $i ]->type == $changes[ $j ]->type ) {
+ switch ( $filtered[ $i ]->type ) {
+ case 'rotate':
+ $filtered[ $i ]->angle += $changes[ $j ]->angle;
+ $combined = true;
+ break;
+ case 'flip':
+ $filtered[ $i ]->axis ^= $changes[ $j ]->axis;
+ $combined = true;
+ break;
+ }
+ }
+ if ( ! $combined ) {
+ $filtered[ ++$i ] = $changes[ $j ];
+ }
+ }
+ $changes = $filtered;
+ unset( $filtered );
+ }
+
+ // Image resource before applying the changes.
+ if ( $image instanceof WP_Image_Editor ) {
+
+ /**
+ * Filters the WP_Image_Editor instance before applying changes to the image.
+ *
+ * @since 3.5.0
+ *
+ * @param WP_Image_Editor $image WP_Image_Editor instance.
+ * @param array $changes Array of change operations.
+ */
+ $image = apply_filters( 'wp_image_editor_before_change', $image, $changes );
+ } elseif ( is_resource( $image ) ) {
+
+ /**
+ * Filters the GD image resource before applying changes to the image.
+ *
+ * @since 2.9.0
+ * @deprecated 3.5.0 Use wp_image_editor_before_change instead.
+ *
+ * @param resource $image GD image resource.
+ * @param array $changes Array of change operations.
+ */
+ $image = apply_filters( 'image_edit_before_change', $image, $changes );
+ }
+
+ foreach ( $changes as $operation ) {
+ switch ( $operation->type ) {
+ case 'rotate':
+ if ( $operation->angle != 0 ) {
+ if ( $image instanceof WP_Image_Editor ) {
+ $image->rotate( $operation->angle );
+ } else {
+ $image = _rotate_image_resource( $image, $operation->angle );
+ }
+ }
+ break;
+ case 'flip':
+ if ( $operation->axis != 0 ) {
+ if ( $image instanceof WP_Image_Editor ) {
+ $image->flip( ( $operation->axis & 1 ) != 0, ( $operation->axis & 2 ) != 0 );
+ } else {
+ $image = _flip_image_resource( $image, ( $operation->axis & 1 ) != 0, ( $operation->axis & 2 ) != 0 );
+ }
+ }
+ break;
+ case 'crop':
+ $sel = $operation->sel;
+
+ if ( $image instanceof WP_Image_Editor ) {
+ $size = $image->get_size();
+ $w = $size['width'];
+ $h = $size['height'];
+
+ $scale = 1 / _image_get_preview_ratio( $w, $h ); // discard preview scaling
+ $image->crop( $sel->x * $scale, $sel->y * $scale, $sel->w * $scale, $sel->h * $scale );
+ } else {
+ $scale = 1 / _image_get_preview_ratio( imagesx( $image ), imagesy( $image ) ); // discard preview scaling
+ $image = _crop_image_resource( $image, $sel->x * $scale, $sel->y * $scale, $sel->w * $scale, $sel->h * $scale );
+ }
+ break;
+ }
+ }
+
+ return $image;
+}
+
+
+/**
+ * Streams image in post to browser, along with enqueued changes
+ * in $_REQUEST['history']
+ *
+ * @since 2.9.0
+ *
+ * @param int $post_id
+ * @return bool
+ */
+function stream_preview_image( $post_id ) {
+ $post = get_post( $post_id );
+
+ wp_raise_memory_limit( 'admin' );
+
+ $img = wp_get_image_editor( _load_image_to_edit_path( $post_id ) );
+
+ if ( is_wp_error( $img ) ) {
+ return false;
+ }
+
+ $changes = ! empty( $_REQUEST['history'] ) ? json_decode( wp_unslash( $_REQUEST['history'] ) ) : null;
+ if ( $changes ) {
+ $img = image_edit_apply_changes( $img, $changes );
+ }
+
+ // Scale the image.
+ $size = $img->get_size();
+ $w = $size['width'];
+ $h = $size['height'];
+
+ $ratio = _image_get_preview_ratio( $w, $h );
+ $w2 = max( 1, $w * $ratio );
+ $h2 = max( 1, $h * $ratio );
+
+ if ( is_wp_error( $img->resize( $w2, $h2 ) ) ) {
+ return false;
+ }
+
+ return wp_stream_image( $img, $post->post_mime_type, $post_id );
+}
+
+/**
+ * Restores the metadata for a given attachment.
+ *
+ * @since 2.9.0
+ *
+ * @param int $post_id Attachment post ID.
+ * @return stdClass Image restoration message object.
+ */
+function wp_restore_image( $post_id ) {
+ $meta = wp_get_attachment_metadata( $post_id );
+ $file = get_attached_file( $post_id );
+ $backup_sizes = $old_backup_sizes = get_post_meta( $post_id, '_wp_attachment_backup_sizes', true );
+ $restored = false;
+ $msg = new stdClass;
+
+ if ( ! is_array( $backup_sizes ) ) {
+ $msg->error = __( 'Cannot load image metadata.' );
+ return $msg;
+ }
+
+ $parts = pathinfo( $file );
+ $suffix = time() . rand( 100, 999 );
+ $default_sizes = get_intermediate_image_sizes();
+
+ if ( isset( $backup_sizes['full-orig'] ) && is_array( $backup_sizes['full-orig'] ) ) {
+ $data = $backup_sizes['full-orig'];
+
+ if ( $parts['basename'] != $data['file'] ) {
+ if ( defined( 'IMAGE_EDIT_OVERWRITE' ) && IMAGE_EDIT_OVERWRITE ) {
+
+ // Delete only if it's an edited image.
+ if ( preg_match( '/-e[0-9]{13}\./', $parts['basename'] ) ) {
+ wp_delete_file( $file );
+ }
+ } elseif ( isset( $meta['width'], $meta['height'] ) ) {
+ $backup_sizes[ "full-$suffix" ] = array(
+ 'width' => $meta['width'],
+ 'height' => $meta['height'],
+ 'file' => $parts['basename'],
+ );
+ }
+ }
+
+ $restored_file = path_join( $parts['dirname'], $data['file'] );
+ $restored = update_attached_file( $post_id, $restored_file );
+
+ $meta['file'] = _wp_relative_upload_path( $restored_file );
+ $meta['width'] = $data['width'];
+ $meta['height'] = $data['height'];
+ }
+
+ foreach ( $default_sizes as $default_size ) {
+ if ( isset( $backup_sizes[ "$default_size-orig" ] ) ) {
+ $data = $backup_sizes[ "$default_size-orig" ];
+ if ( isset( $meta['sizes'][ $default_size ] ) && $meta['sizes'][ $default_size ]['file'] != $data['file'] ) {
+ if ( defined( 'IMAGE_EDIT_OVERWRITE' ) && IMAGE_EDIT_OVERWRITE ) {
+
+ // Delete only if it's an edited image.
+ if ( preg_match( '/-e[0-9]{13}-/', $meta['sizes'][ $default_size ]['file'] ) ) {
+ $delete_file = path_join( $parts['dirname'], $meta['sizes'][ $default_size ]['file'] );
+ wp_delete_file( $delete_file );
+ }
+ } else {
+ $backup_sizes[ "$default_size-{$suffix}" ] = $meta['sizes'][ $default_size ];
+ }
+ }
+
+ $meta['sizes'][ $default_size ] = $data;
+ } else {
+ unset( $meta['sizes'][ $default_size ] );
+ }
+ }
+
+ if ( ! wp_update_attachment_metadata( $post_id, $meta ) ||
+ ( $old_backup_sizes !== $backup_sizes && ! update_post_meta( $post_id, '_wp_attachment_backup_sizes', $backup_sizes ) ) ) {
+
+ $msg->error = __( 'Cannot save image metadata.' );
+ return $msg;
+ }
+
+ if ( ! $restored ) {
+ $msg->error = __( 'Image metadata is inconsistent.' );
+ } else {
+ $msg->msg = __( 'Image restored successfully.' );
+ }
+
+ return $msg;
+}
+
+/**
+ * Saves image to post along with enqueued changes
+ * in $_REQUEST['history']
+ *
+ * @since 2.9.0
+ *
+ * @param int $post_id
+ * @return \stdClass
+ */
+function wp_save_image( $post_id ) {
+ $_wp_additional_image_sizes = wp_get_additional_image_sizes();
+
+ $return = new stdClass;
+ $success = $delete = $scaled = $nocrop = false;
+ $post = get_post( $post_id );
+
+ $img = wp_get_image_editor( _load_image_to_edit_path( $post_id, 'full' ) );
+ if ( is_wp_error( $img ) ) {
+ $return->error = esc_js( __( 'Unable to create new image.' ) );
+ return $return;
+ }
+
+ $fwidth = ! empty( $_REQUEST['fwidth'] ) ? intval( $_REQUEST['fwidth'] ) : 0;
+ $fheight = ! empty( $_REQUEST['fheight'] ) ? intval( $_REQUEST['fheight'] ) : 0;
+ $target = ! empty( $_REQUEST['target'] ) ? preg_replace( '/[^a-z0-9_-]+/i', '', $_REQUEST['target'] ) : '';
+ $scale = ! empty( $_REQUEST['do'] ) && 'scale' == $_REQUEST['do'];
+
+ if ( $scale && $fwidth > 0 && $fheight > 0 ) {
+ $size = $img->get_size();
+ $sX = $size['width'];
+ $sY = $size['height'];
+
+ // Check if it has roughly the same w / h ratio.
+ $diff = round( $sX / $sY, 2 ) - round( $fwidth / $fheight, 2 );
+ if ( -0.1 < $diff && $diff < 0.1 ) {
+ // Scale the full size image.
+ if ( $img->resize( $fwidth, $fheight ) ) {
+ $scaled = true;
+ }
+ }
+
+ if ( ! $scaled ) {
+ $return->error = esc_js( __( 'Error while saving the scaled image. Please reload the page and try again.' ) );
+ return $return;
+ }
+ } elseif ( ! empty( $_REQUEST['history'] ) ) {
+ $changes = json_decode( wp_unslash( $_REQUEST['history'] ) );
+ if ( $changes ) {
+ $img = image_edit_apply_changes( $img, $changes );
+ }
+ } else {
+ $return->error = esc_js( __( 'Nothing to save, the image has not changed.' ) );
+ return $return;
+ }
+
+ $meta = wp_get_attachment_metadata( $post_id );
+ $backup_sizes = get_post_meta( $post->ID, '_wp_attachment_backup_sizes', true );
+
+ if ( ! is_array( $meta ) ) {
+ $return->error = esc_js( __( 'Image data does not exist. Please re-upload the image.' ) );
+ return $return;
+ }
+
+ if ( ! is_array( $backup_sizes ) ) {
+ $backup_sizes = array();
+ }
+
+ // Generate new filename.
+ $path = get_attached_file( $post_id );
+
+ $basename = pathinfo( $path, PATHINFO_BASENAME );
+ $dirname = pathinfo( $path, PATHINFO_DIRNAME );
+ $ext = pathinfo( $path, PATHINFO_EXTENSION );
+ $filename = pathinfo( $path, PATHINFO_FILENAME );
+ $suffix = time() . rand( 100, 999 );
+
+ if ( defined( 'IMAGE_EDIT_OVERWRITE' ) && IMAGE_EDIT_OVERWRITE &&
+ isset( $backup_sizes['full-orig'] ) && $backup_sizes['full-orig']['file'] != $basename ) {
+
+ if ( 'thumbnail' == $target ) {
+ $new_path = "{$dirname}/{$filename}-temp.{$ext}";
+ } else {
+ $new_path = $path;
+ }
+ } else {
+ while ( true ) {
+ $filename = preg_replace( '/-e([0-9]+)$/', '', $filename );
+ $filename .= "-e{$suffix}";
+ $new_filename = "{$filename}.{$ext}";
+ $new_path = "{$dirname}/$new_filename";
+ if ( file_exists( $new_path ) ) {
+ $suffix++;
+ } else {
+ break;
+ }
+ }
+ }
+
+ // Save the full-size file, also needed to create sub-sizes.
+ if ( ! wp_save_image_file( $new_path, $img, $post->post_mime_type, $post_id ) ) {
+ $return->error = esc_js( __( 'Unable to save the image.' ) );
+ return $return;
+ }
+
+ if ( 'nothumb' === $target || 'all' === $target || 'full' === $target || $scaled ) {
+ $tag = false;
+ if ( isset( $backup_sizes['full-orig'] ) ) {
+ if ( ( ! defined( 'IMAGE_EDIT_OVERWRITE' ) || ! IMAGE_EDIT_OVERWRITE ) && $backup_sizes['full-orig']['file'] !== $basename ) {
+ $tag = "full-$suffix";
+ }
+ } else {
+ $tag = 'full-orig';
+ }
+
+ if ( $tag ) {
+ $backup_sizes[ $tag ] = array(
+ 'width' => $meta['width'],
+ 'height' => $meta['height'],
+ 'file' => $basename,
+ );
+ }
+ $success = ( $path === $new_path ) || update_attached_file( $post_id, $new_path );
+
+ $meta['file'] = _wp_relative_upload_path( $new_path );
+
+ $size = $img->get_size();
+ $meta['width'] = $size['width'];
+ $meta['height'] = $size['height'];
+
+ if ( $success && ( 'nothumb' == $target || 'all' == $target ) ) {
+ $sizes = get_intermediate_image_sizes();
+ if ( 'nothumb' == $target ) {
+ $sizes = array_diff( $sizes, array( 'thumbnail' ) );
+ }
+ }
+
+ $return->fw = $meta['width'];
+ $return->fh = $meta['height'];
+ } elseif ( 'thumbnail' == $target ) {
+ $sizes = array( 'thumbnail' );
+ $success = $delete = $nocrop = true;
+ }
+
+ /*
+ * We need to remove any existing resized image files because
+ * a new crop or rotate could generate different sizes (and hence, filenames),
+ * keeping the new resized images from overwriting the existing image files.
+ * https://core.trac.wordpress.org/ticket/32171
+ */
+ if ( defined( 'IMAGE_EDIT_OVERWRITE' ) && IMAGE_EDIT_OVERWRITE && ! empty( $meta['sizes'] ) ) {
+ foreach ( $meta['sizes'] as $size ) {
+ if ( ! empty( $size['file'] ) && preg_match( '/-e[0-9]{13}-/', $size['file'] ) ) {
+ $delete_file = path_join( $dirname, $size['file'] );
+ wp_delete_file( $delete_file );
+ }
+ }
+ }
+
+ if ( isset( $sizes ) ) {
+ $_sizes = array();
+
+ foreach ( $sizes as $size ) {
+ $tag = false;
+ if ( isset( $meta['sizes'][ $size ] ) ) {
+ if ( isset( $backup_sizes[ "$size-orig" ] ) ) {
+ if ( ( ! defined( 'IMAGE_EDIT_OVERWRITE' ) || ! IMAGE_EDIT_OVERWRITE ) && $backup_sizes[ "$size-orig" ]['file'] != $meta['sizes'][ $size ]['file'] ) {
+ $tag = "$size-$suffix";
+ }
+ } else {
+ $tag = "$size-orig";
+ }
+
+ if ( $tag ) {
+ $backup_sizes[ $tag ] = $meta['sizes'][ $size ];
+ }
+ }
+
+ if ( isset( $_wp_additional_image_sizes[ $size ] ) ) {
+ $width = intval( $_wp_additional_image_sizes[ $size ]['width'] );
+ $height = intval( $_wp_additional_image_sizes[ $size ]['height'] );
+ $crop = ( $nocrop ) ? false : $_wp_additional_image_sizes[ $size ]['crop'];
+ } else {
+ $height = get_option( "{$size}_size_h" );
+ $width = get_option( "{$size}_size_w" );
+ $crop = ( $nocrop ) ? false : get_option( "{$size}_crop" );
+ }
+
+ $_sizes[ $size ] = array(
+ 'width' => $width,
+ 'height' => $height,
+ 'crop' => $crop,
+ );
+ }
+
+ $meta['sizes'] = array_merge( $meta['sizes'], $img->multi_resize( $_sizes ) );
+ }
+
+ unset( $img );
+
+ if ( $success ) {
+ wp_update_attachment_metadata( $post_id, $meta );
+ update_post_meta( $post_id, '_wp_attachment_backup_sizes', $backup_sizes );
+
+ if ( $target == 'thumbnail' || $target == 'all' || $target == 'full' ) {
+ // Check if it's an image edit from attachment edit screen
+ if ( ! empty( $_REQUEST['context'] ) && 'edit-attachment' == $_REQUEST['context'] ) {
+ $thumb_url = wp_get_attachment_image_src( $post_id, array( 900, 600 ), true );
+ $return->thumbnail = $thumb_url[0];
+ } else {
+ $file_url = wp_get_attachment_url( $post_id );
+ if ( ! empty( $meta['sizes']['thumbnail'] ) && $thumb = $meta['sizes']['thumbnail'] ) {
+ $return->thumbnail = path_join( dirname( $file_url ), $thumb['file'] );
+ } else {
+ $return->thumbnail = "$file_url?w=128&h=128";
+ }
+ }
+ }
+ } else {
+ $delete = true;
+ }
+
+ if ( $delete ) {
+ wp_delete_file( $new_path );
+ }
+
+ $return->msg = esc_js( __( 'Image saved' ) );
+ return $return;
+}
diff --git a/www/crm/wp-admin/includes/image.php b/www/crm/wp-admin/includes/image.php
new file mode 100644
index 00000000..d0a2954e
--- /dev/null
+++ b/www/crm/wp-admin/includes/image.php
@@ -0,0 +1,731 @@
+<?php
+/**
+ * File contains all the administration image manipulation functions.
+ *
+ * @package WordPress
+ * @subpackage Administration
+ */
+
+/**
+ * Crop an Image to a given size.
+ *
+ * @since 2.1.0
+ *
+ * @param string|int $src The source file or Attachment ID.
+ * @param int $src_x The start x position to crop from.
+ * @param int $src_y The start y position to crop from.
+ * @param int $src_w The width to crop.
+ * @param int $src_h The height to crop.
+ * @param int $dst_w The destination width.
+ * @param int $dst_h The destination height.
+ * @param int $src_abs Optional. If the source crop points are absolute.
+ * @param string $dst_file Optional. The destination file to write to.
+ * @return string|WP_Error New filepath on success, WP_Error on failure.
+ */
+function wp_crop_image( $src, $src_x, $src_y, $src_w, $src_h, $dst_w, $dst_h, $src_abs = false, $dst_file = false ) {
+ $src_file = $src;
+ if ( is_numeric( $src ) ) { // Handle int as attachment ID
+ $src_file = get_attached_file( $src );
+
+ if ( ! file_exists( $src_file ) ) {
+ // If the file doesn't exist, attempt a URL fopen on the src link.
+ // This can occur with certain file replication plugins.
+ $src = _load_image_to_edit_path( $src, 'full' );
+ } else {
+ $src = $src_file;
+ }
+ }
+
+ $editor = wp_get_image_editor( $src );
+ if ( is_wp_error( $editor ) ) {
+ return $editor;
+ }
+
+ $src = $editor->crop( $src_x, $src_y, $src_w, $src_h, $dst_w, $dst_h, $src_abs );
+ if ( is_wp_error( $src ) ) {
+ return $src;
+ }
+
+ if ( ! $dst_file ) {
+ $dst_file = str_replace( wp_basename( $src_file ), 'cropped-' . wp_basename( $src_file ), $src_file );
+ }
+
+ /*
+ * The directory containing the original file may no longer exist when
+ * using a replication plugin.
+ */
+ wp_mkdir_p( dirname( $dst_file ) );
+
+ $dst_file = dirname( $dst_file ) . '/' . wp_unique_filename( dirname( $dst_file ), wp_basename( $dst_file ) );
+
+ $result = $editor->save( $dst_file );
+ if ( is_wp_error( $result ) ) {
+ return $result;
+ }
+
+ return $dst_file;
+}
+
+/**
+ * Generate post thumbnail attachment meta data.
+ *
+ * @since 2.1.0
+ *
+ * @param int $attachment_id Attachment Id to process.
+ * @param string $file Filepath of the Attached image.
+ * @return mixed Metadata for attachment.
+ */
+function wp_generate_attachment_metadata( $attachment_id, $file ) {
+ $attachment = get_post( $attachment_id );
+
+ $metadata = array();
+ $support = false;
+ $mime_type = get_post_mime_type( $attachment );
+
+ if ( preg_match( '!^image/!', $mime_type ) && file_is_displayable_image( $file ) ) {
+ $imagesize = getimagesize( $file );
+ $metadata['width'] = $imagesize[0];
+ $metadata['height'] = $imagesize[1];
+
+ // Make the file path relative to the upload dir.
+ $metadata['file'] = _wp_relative_upload_path( $file );
+
+ // Make thumbnails and other intermediate sizes.
+ $_wp_additional_image_sizes = wp_get_additional_image_sizes();
+
+ $sizes = array();
+ foreach ( get_intermediate_image_sizes() as $s ) {
+ $sizes[ $s ] = array(
+ 'width' => '',
+ 'height' => '',
+ 'crop' => false,
+ );
+ if ( isset( $_wp_additional_image_sizes[ $s ]['width'] ) ) {
+ // For theme-added sizes
+ $sizes[ $s ]['width'] = intval( $_wp_additional_image_sizes[ $s ]['width'] );
+ } else {
+ // For default sizes set in options
+ $sizes[ $s ]['width'] = get_option( "{$s}_size_w" );
+ }
+
+ if ( isset( $_wp_additional_image_sizes[ $s ]['height'] ) ) {
+ // For theme-added sizes
+ $sizes[ $s ]['height'] = intval( $_wp_additional_image_sizes[ $s ]['height'] );
+ } else {
+ // For default sizes set in options
+ $sizes[ $s ]['height'] = get_option( "{$s}_size_h" );
+ }
+
+ if ( isset( $_wp_additional_image_sizes[ $s ]['crop'] ) ) {
+ // For theme-added sizes
+ $sizes[ $s ]['crop'] = $_wp_additional_image_sizes[ $s ]['crop'];
+ } else {
+ // For default sizes set in options
+ $sizes[ $s ]['crop'] = get_option( "{$s}_crop" );
+ }
+ }
+
+ /**
+ * Filters the image sizes automatically generated when uploading an image.
+ *
+ * @since 2.9.0
+ * @since 4.4.0 Added the `$metadata` argument.
+ * @since 5.1.0 Added the `$attachment_id` argument.
+ *
+ * @param array $sizes An associative array of image sizes.
+ * @param array $metadata An associative array of image metadata: width, height, file.
+ * @param int $attachment_id Current attachment ID.
+ */
+ $sizes = apply_filters( 'intermediate_image_sizes_advanced', $sizes, $metadata, $attachment_id );
+
+ if ( $sizes ) {
+ $editor = wp_get_image_editor( $file );
+
+ if ( ! is_wp_error( $editor ) ) {
+ $metadata['sizes'] = $editor->multi_resize( $sizes );
+ }
+ } else {
+ $metadata['sizes'] = array();
+ }
+
+ // Fetch additional metadata from EXIF/IPTC.
+ $image_meta = wp_read_image_metadata( $file );
+ if ( $image_meta ) {
+ $metadata['image_meta'] = $image_meta;
+ }
+ } elseif ( wp_attachment_is( 'video', $attachment ) ) {
+ $metadata = wp_read_video_metadata( $file );
+ $support = current_theme_supports( 'post-thumbnails', 'attachment:video' ) || post_type_supports( 'attachment:video', 'thumbnail' );
+ } elseif ( wp_attachment_is( 'audio', $attachment ) ) {
+ $metadata = wp_read_audio_metadata( $file );
+ $support = current_theme_supports( 'post-thumbnails', 'attachment:audio' ) || post_type_supports( 'attachment:audio', 'thumbnail' );
+ }
+
+ if ( $support && ! empty( $metadata['image']['data'] ) ) {
+ // Check for existing cover.
+ $hash = md5( $metadata['image']['data'] );
+ $posts = get_posts(
+ array(
+ 'fields' => 'ids',
+ 'post_type' => 'attachment',
+ 'post_mime_type' => $metadata['image']['mime'],
+ 'post_status' => 'inherit',
+ 'posts_per_page' => 1,
+ 'meta_key' => '_cover_hash',
+ 'meta_value' => $hash,
+ )
+ );
+ $exists = reset( $posts );
+
+ if ( ! empty( $exists ) ) {
+ update_post_meta( $attachment_id, '_thumbnail_id', $exists );
+ } else {
+ $ext = '.jpg';
+ switch ( $metadata['image']['mime'] ) {
+ case 'image/gif':
+ $ext = '.gif';
+ break;
+ case 'image/png':
+ $ext = '.png';
+ break;
+ }
+ $basename = str_replace( '.', '-', wp_basename( $file ) ) . '-image' . $ext;
+ $uploaded = wp_upload_bits( $basename, '', $metadata['image']['data'] );
+ if ( false === $uploaded['error'] ) {
+ $image_attachment = array(
+ 'post_mime_type' => $metadata['image']['mime'],
+ 'post_type' => 'attachment',
+ 'post_content' => '',
+ );
+ /**
+ * Filters the parameters for the attachment thumbnail creation.
+ *
+ * @since 3.9.0
+ *
+ * @param array $image_attachment An array of parameters to create the thumbnail.
+ * @param array $metadata Current attachment metadata.
+ * @param array $uploaded An array containing the thumbnail path and url.
+ */
+ $image_attachment = apply_filters( 'attachment_thumbnail_args', $image_attachment, $metadata, $uploaded );
+
+ $sub_attachment_id = wp_insert_attachment( $image_attachment, $uploaded['file'] );
+ add_post_meta( $sub_attachment_id, '_cover_hash', $hash );
+ $attach_data = wp_generate_attachment_metadata( $sub_attachment_id, $uploaded['file'] );
+ wp_update_attachment_metadata( $sub_attachment_id, $attach_data );
+ update_post_meta( $attachment_id, '_thumbnail_id', $sub_attachment_id );
+ }
+ }
+ } elseif ( 'application/pdf' === $mime_type ) {
+ // Try to create image thumbnails for PDFs.
+
+ $fallback_sizes = array(
+ 'thumbnail',
+ 'medium',
+ 'large',
+ );
+
+ /**
+ * Filters the image sizes generated for non-image mime types.
+ *
+ * @since 4.7.0
+ *
+ * @param array $fallback_sizes An array of image size names.
+ * @param array $metadata Current attachment metadata.
+ */
+ $fallback_sizes = apply_filters( 'fallback_intermediate_image_sizes', $fallback_sizes, $metadata );
+
+ $sizes = array();
+ $_wp_additional_image_sizes = wp_get_additional_image_sizes();
+
+ foreach ( $fallback_sizes as $s ) {
+ if ( isset( $_wp_additional_image_sizes[ $s ]['width'] ) ) {
+ $sizes[ $s ]['width'] = intval( $_wp_additional_image_sizes[ $s ]['width'] );
+ } else {
+ $sizes[ $s ]['width'] = get_option( "{$s}_size_w" );
+ }
+
+ if ( isset( $_wp_additional_image_sizes[ $s ]['height'] ) ) {
+ $sizes[ $s ]['height'] = intval( $_wp_additional_image_sizes[ $s ]['height'] );
+ } else {
+ $sizes[ $s ]['height'] = get_option( "{$s}_size_h" );
+ }
+
+ if ( isset( $_wp_additional_image_sizes[ $s ]['crop'] ) ) {
+ $sizes[ $s ]['crop'] = $_wp_additional_image_sizes[ $s ]['crop'];
+ } else {
+ // Force thumbnails to be soft crops.
+ if ( 'thumbnail' !== $s ) {
+ $sizes[ $s ]['crop'] = get_option( "{$s}_crop" );
+ }
+ }
+ }
+
+ // Only load PDFs in an image editor if we're processing sizes.
+ if ( ! empty( $sizes ) ) {
+ $editor = wp_get_image_editor( $file );
+
+ if ( ! is_wp_error( $editor ) ) { // No support for this type of file
+ /*
+ * PDFs may have the same file filename as JPEGs.
+ * Ensure the PDF preview image does not overwrite any JPEG images that already exist.
+ */
+ $dirname = dirname( $file ) . '/';
+ $ext = '.' . pathinfo( $file, PATHINFO_EXTENSION );
+ $preview_file = $dirname . wp_unique_filename( $dirname, wp_basename( $file, $ext ) . '-pdf.jpg' );
+
+ $uploaded = $editor->save( $preview_file, 'image/jpeg' );
+ unset( $editor );
+
+ // Resize based on the full size image, rather than the source.
+ if ( ! is_wp_error( $uploaded ) ) {
+ $editor = wp_get_image_editor( $uploaded['path'] );
+ unset( $uploaded['path'] );
+
+ if ( ! is_wp_error( $editor ) ) {
+ $metadata['sizes'] = $editor->multi_resize( $sizes );
+ $metadata['sizes']['full'] = $uploaded;
+ }
+ }
+ }
+ }
+ }
+
+ // Remove the blob of binary data from the array.
+ if ( $metadata ) {
+ unset( $metadata['image']['data'] );
+ }
+
+ /**
+ * Filters the generated attachment meta data.
+ *
+ * @since 2.1.0
+ *
+ * @param array $metadata An array of attachment meta data.
+ * @param int $attachment_id Current attachment ID.
+ */
+ return apply_filters( 'wp_generate_attachment_metadata', $metadata, $attachment_id );
+}
+
+/**
+ * Convert a fraction string to a decimal.
+ *
+ * @since 2.5.0
+ *
+ * @param string $str
+ * @return int|float
+ */
+function wp_exif_frac2dec( $str ) {
+ @list( $n, $d ) = explode( '/', $str );
+ if ( ! empty( $d ) ) {
+ return $n / $d;
+ }
+ return $str;
+}
+
+/**
+ * Convert the exif date format to a unix timestamp.
+ *
+ * @since 2.5.0
+ *
+ * @param string $str
+ * @return int
+ */
+function wp_exif_date2ts( $str ) {
+ @list( $date, $time ) = explode( ' ', trim( $str ) );
+ @list( $y, $m, $d ) = explode( ':', $date );
+
+ return strtotime( "{$y}-{$m}-{$d} {$time}" );
+}
+
+/**
+ * Get extended image metadata, exif or iptc as available.
+ *
+ * Retrieves the EXIF metadata aperture, credit, camera, caption, copyright, iso
+ * created_timestamp, focal_length, shutter_speed, and title.
+ *
+ * The IPTC metadata that is retrieved is APP13, credit, byline, created date
+ * and time, caption, copyright, and title. Also includes FNumber, Model,
+ * DateTimeDigitized, FocalLength, ISOSpeedRatings, and ExposureTime.
+ *
+ * @todo Try other exif libraries if available.
+ * @since 2.5.0
+ *
+ * @param string $file
+ * @return bool|array False on failure. Image metadata array on success.
+ */
+function wp_read_image_metadata( $file ) {
+ if ( ! file_exists( $file ) ) {
+ return false;
+ }
+
+ list( , , $image_type ) = @getimagesize( $file );
+
+ /*
+ * EXIF contains a bunch of data we'll probably never need formatted in ways
+ * that are difficult to use. We'll normalize it and just extract the fields
+ * that are likely to be useful. Fractions and numbers are converted to
+ * floats, dates to unix timestamps, and everything else to strings.
+ */
+ $meta = array(
+ 'aperture' => 0,
+ 'credit' => '',
+ 'camera' => '',
+ 'caption' => '',
+ 'created_timestamp' => 0,
+ 'copyright' => '',
+ 'focal_length' => 0,
+ 'iso' => 0,
+ 'shutter_speed' => 0,
+ 'title' => '',
+ 'orientation' => 0,
+ 'keywords' => array(),
+ );
+
+ $iptc = array();
+ /*
+ * Read IPTC first, since it might contain data not available in exif such
+ * as caption, description etc.
+ */
+ if ( is_callable( 'iptcparse' ) ) {
+ @getimagesize( $file, $info );
+
+ if ( ! empty( $info['APP13'] ) ) {
+ $iptc = @iptcparse( $info['APP13'] );
+
+ // Headline, "A brief synopsis of the caption."
+ if ( ! empty( $iptc['2#105'][0] ) ) {
+ $meta['title'] = trim( $iptc['2#105'][0] );
+ /*
+ * Title, "Many use the Title field to store the filename of the image,
+ * though the field may be used in many ways."
+ */
+ } elseif ( ! empty( $iptc['2#005'][0] ) ) {
+ $meta['title'] = trim( $iptc['2#005'][0] );
+ }
+
+ if ( ! empty( $iptc['2#120'][0] ) ) { // description / legacy caption
+ $caption = trim( $iptc['2#120'][0] );
+
+ mbstring_binary_safe_encoding();
+ $caption_length = strlen( $caption );
+ reset_mbstring_encoding();
+
+ if ( empty( $meta['title'] ) && $caption_length < 80 ) {
+ // Assume the title is stored in 2:120 if it's short.
+ $meta['title'] = $caption;
+ }
+
+ $meta['caption'] = $caption;
+ }
+
+ if ( ! empty( $iptc['2#110'][0] ) ) { // credit
+ $meta['credit'] = trim( $iptc['2#110'][0] );
+ } elseif ( ! empty( $iptc['2#080'][0] ) ) { // creator / legacy byline
+ $meta['credit'] = trim( $iptc['2#080'][0] );
+ }
+
+ if ( ! empty( $iptc['2#055'][0] ) && ! empty( $iptc['2#060'][0] ) ) { // created date and time
+ $meta['created_timestamp'] = strtotime( $iptc['2#055'][0] . ' ' . $iptc['2#060'][0] );
+ }
+
+ if ( ! empty( $iptc['2#116'][0] ) ) { // copyright
+ $meta['copyright'] = trim( $iptc['2#116'][0] );
+ }
+
+ if ( ! empty( $iptc['2#025'][0] ) ) { // keywords array
+ $meta['keywords'] = array_values( $iptc['2#025'] );
+ }
+ }
+ }
+
+ $exif = array();
+
+ /**
+ * Filters the image types to check for exif data.
+ *
+ * @since 2.5.0
+ *
+ * @param array $image_types Image types to check for exif data.
+ */
+ $exif_image_types = apply_filters( 'wp_read_image_metadata_types', array( IMAGETYPE_JPEG, IMAGETYPE_TIFF_II, IMAGETYPE_TIFF_MM ) );
+
+ if ( is_callable( 'exif_read_data' ) && in_array( $image_type, $exif_image_types ) ) {
+ $exif = @exif_read_data( $file );
+
+ if ( ! empty( $exif['ImageDescription'] ) ) {
+ mbstring_binary_safe_encoding();
+ $description_length = strlen( $exif['ImageDescription'] );
+ reset_mbstring_encoding();
+
+ if ( empty( $meta['title'] ) && $description_length < 80 ) {
+ // Assume the title is stored in ImageDescription
+ $meta['title'] = trim( $exif['ImageDescription'] );
+ }
+
+ if ( empty( $meta['caption'] ) && ! empty( $exif['COMPUTED']['UserComment'] ) ) {
+ $meta['caption'] = trim( $exif['COMPUTED']['UserComment'] );
+ }
+
+ if ( empty( $meta['caption'] ) ) {
+ $meta['caption'] = trim( $exif['ImageDescription'] );
+ }
+ } elseif ( empty( $meta['caption'] ) && ! empty( $exif['Comments'] ) ) {
+ $meta['caption'] = trim( $exif['Comments'] );
+ }
+
+ if ( empty( $meta['credit'] ) ) {
+ if ( ! empty( $exif['Artist'] ) ) {
+ $meta['credit'] = trim( $exif['Artist'] );
+ } elseif ( ! empty( $exif['Author'] ) ) {
+ $meta['credit'] = trim( $exif['Author'] );
+ }
+ }
+
+ if ( empty( $meta['copyright'] ) && ! empty( $exif['Copyright'] ) ) {
+ $meta['copyright'] = trim( $exif['Copyright'] );
+ }
+ if ( ! empty( $exif['FNumber'] ) ) {
+ $meta['aperture'] = round( wp_exif_frac2dec( $exif['FNumber'] ), 2 );
+ }
+ if ( ! empty( $exif['Model'] ) ) {
+ $meta['camera'] = trim( $exif['Model'] );
+ }
+ if ( empty( $meta['created_timestamp'] ) && ! empty( $exif['DateTimeDigitized'] ) ) {
+ $meta['created_timestamp'] = wp_exif_date2ts( $exif['DateTimeDigitized'] );
+ }
+ if ( ! empty( $exif['FocalLength'] ) ) {
+ $meta['focal_length'] = (string) wp_exif_frac2dec( $exif['FocalLength'] );
+ }
+ if ( ! empty( $exif['ISOSpeedRatings'] ) ) {
+ $meta['iso'] = is_array( $exif['ISOSpeedRatings'] ) ? reset( $exif['ISOSpeedRatings'] ) : $exif['ISOSpeedRatings'];
+ $meta['iso'] = trim( $meta['iso'] );
+ }
+ if ( ! empty( $exif['ExposureTime'] ) ) {
+ $meta['shutter_speed'] = (string) wp_exif_frac2dec( $exif['ExposureTime'] );
+ }
+ if ( ! empty( $exif['Orientation'] ) ) {
+ $meta['orientation'] = $exif['Orientation'];
+ }
+ }
+
+ foreach ( array( 'title', 'caption', 'credit', 'copyright', 'camera', 'iso' ) as $key ) {
+ if ( $meta[ $key ] && ! seems_utf8( $meta[ $key ] ) ) {
+ $meta[ $key ] = utf8_encode( $meta[ $key ] );
+ }
+ }
+
+ foreach ( $meta['keywords'] as $key => $keyword ) {
+ if ( ! seems_utf8( $keyword ) ) {
+ $meta['keywords'][ $key ] = utf8_encode( $keyword );
+ }
+ }
+
+ $meta = wp_kses_post_deep( $meta );
+
+ /**
+ * Filters the array of meta data read from an image's exif data.
+ *
+ * @since 2.5.0
+ * @since 4.4.0 The `$iptc` parameter was added.
+ * @since 5.0.0 The `$exif` parameter was added.
+ *
+ * @param array $meta Image meta data.
+ * @param string $file Path to image file.
+ * @param int $image_type Type of image, one of the `IMAGETYPE_XXX` constants.
+ * @param array $iptc IPTC data.
+ * @param array $exif EXIF data.
+ */
+ return apply_filters( 'wp_read_image_metadata', $meta, $file, $image_type, $iptc, $exif );
+
+}
+
+/**
+ * Validate that file is an image.
+ *
+ * @since 2.5.0
+ *
+ * @param string $path File path to test if valid image.
+ * @return bool True if valid image, false if not valid image.
+ */
+function file_is_valid_image( $path ) {
+ $size = @getimagesize( $path );
+ return ! empty( $size );
+}
+
+/**
+ * Validate that file is suitable for displaying within a web page.
+ *
+ * @since 2.5.0
+ *
+ * @param string $path File path to test.
+ * @return bool True if suitable, false if not suitable.
+ */
+function file_is_displayable_image( $path ) {
+ $displayable_image_types = array( IMAGETYPE_GIF, IMAGETYPE_JPEG, IMAGETYPE_PNG, IMAGETYPE_BMP );
+
+ // IMAGETYPE_ICO is only defined in PHP 5.3+.
+ if ( defined( 'IMAGETYPE_ICO' ) ) {
+ $displayable_image_types[] = IMAGETYPE_ICO;
+ }
+
+ $info = @getimagesize( $path );
+ if ( empty( $info ) ) {
+ $result = false;
+ } elseif ( ! in_array( $info[2], $displayable_image_types ) ) {
+ $result = false;
+ } else {
+ $result = true;
+ }
+
+ /**
+ * Filters whether the current image is displayable in the browser.
+ *
+ * @since 2.5.0
+ *
+ * @param bool $result Whether the image can be displayed. Default true.
+ * @param string $path Path to the image.
+ */
+ return apply_filters( 'file_is_displayable_image', $result, $path );
+}
+
+/**
+ * Load an image resource for editing.
+ *
+ * @since 2.9.0
+ *
+ * @param string $attachment_id Attachment ID.
+ * @param string $mime_type Image mime type.
+ * @param string $size Optional. Image size, defaults to 'full'.
+ * @return resource|false The resulting image resource on success, false on failure.
+ */
+function load_image_to_edit( $attachment_id, $mime_type, $size = 'full' ) {
+ $filepath = _load_image_to_edit_path( $attachment_id, $size );
+ if ( empty( $filepath ) ) {
+ return false;
+ }
+
+ switch ( $mime_type ) {
+ case 'image/jpeg':
+ $image = imagecreatefromjpeg( $filepath );
+ break;
+ case 'image/png':
+ $image = imagecreatefrompng( $filepath );
+ break;
+ case 'image/gif':
+ $image = imagecreatefromgif( $filepath );
+ break;
+ default:
+ $image = false;
+ break;
+ }
+ if ( is_resource( $image ) ) {
+ /**
+ * Filters the current image being loaded for editing.
+ *
+ * @since 2.9.0
+ *
+ * @param resource $image Current image.
+ * @param string $attachment_id Attachment ID.
+ * @param string $size Image size.
+ */
+ $image = apply_filters( 'load_image_to_edit', $image, $attachment_id, $size );
+ if ( function_exists( 'imagealphablending' ) && function_exists( 'imagesavealpha' ) ) {
+ imagealphablending( $image, false );
+ imagesavealpha( $image, true );
+ }
+ }
+ return $image;
+}
+
+/**
+ * Retrieve the path or url of an attachment's attached file.
+ *
+ * If the attached file is not present on the local filesystem (usually due to replication plugins),
+ * then the url of the file is returned if url fopen is supported.
+ *
+ * @since 3.4.0
+ * @access private
+ *
+ * @param string $attachment_id Attachment ID.
+ * @param string $size Optional. Image size, defaults to 'full'.
+ * @return string|false File path or url on success, false on failure.
+ */
+function _load_image_to_edit_path( $attachment_id, $size = 'full' ) {
+ $filepath = get_attached_file( $attachment_id );
+
+ if ( $filepath && file_exists( $filepath ) ) {
+ if ( 'full' != $size && ( $data = image_get_intermediate_size( $attachment_id, $size ) ) ) {
+ /**
+ * Filters the path to the current image.
+ *
+ * The filter is evaluated for all image sizes except 'full'.
+ *
+ * @since 3.1.0
+ *
+ * @param string $path Path to the current image.
+ * @param string $attachment_id Attachment ID.
+ * @param string $size Size of the image.
+ */
+ $filepath = apply_filters( 'load_image_to_edit_filesystempath', path_join( dirname( $filepath ), $data['file'] ), $attachment_id, $size );
+ }
+ } elseif ( function_exists( 'fopen' ) && true == ini_get( 'allow_url_fopen' ) ) {
+ /**
+ * Filters the image URL if not in the local filesystem.
+ *
+ * The filter is only evaluated if fopen is enabled on the server.
+ *
+ * @since 3.1.0
+ *
+ * @param string $image_url Current image URL.
+ * @param string $attachment_id Attachment ID.
+ * @param string $size Size of the image.
+ */
+ $filepath = apply_filters( 'load_image_to_edit_attachmenturl', wp_get_attachment_url( $attachment_id ), $attachment_id, $size );
+ }
+
+ /**
+ * Filters the returned path or URL of the current image.
+ *
+ * @since 2.9.0
+ *
+ * @param string|bool $filepath File path or URL to current image, or false.
+ * @param string $attachment_id Attachment ID.
+ * @param string $size Size of the image.
+ */
+ return apply_filters( 'load_image_to_edit_path', $filepath, $attachment_id, $size );
+}
+
+/**
+ * Copy an existing image file.
+ *
+ * @since 3.4.0
+ * @access private
+ *
+ * @param string $attachment_id Attachment ID.
+ * @return string|false New file path on success, false on failure.
+ */
+function _copy_image_file( $attachment_id ) {
+ $dst_file = $src_file = get_attached_file( $attachment_id );
+ if ( ! file_exists( $src_file ) ) {
+ $src_file = _load_image_to_edit_path( $attachment_id );
+ }
+
+ if ( $src_file ) {
+ $dst_file = str_replace( wp_basename( $dst_file ), 'copy-' . wp_basename( $dst_file ), $dst_file );
+ $dst_file = dirname( $dst_file ) . '/' . wp_unique_filename( dirname( $dst_file ), wp_basename( $dst_file ) );
+
+ /*
+ * The directory containing the original file may no longer
+ * exist when using a replication plugin.
+ */
+ wp_mkdir_p( dirname( $dst_file ) );
+
+ if ( ! @copy( $src_file, $dst_file ) ) {
+ $dst_file = false;
+ }
+ } else {
+ $dst_file = false;
+ }
+
+ return $dst_file;
+}
diff --git a/www/crm/wp-admin/includes/import.php b/www/crm/wp-admin/includes/import.php
new file mode 100644
index 00000000..7b6ff886
--- /dev/null
+++ b/www/crm/wp-admin/includes/import.php
@@ -0,0 +1,231 @@
+<?php
+/**
+ * WordPress Administration Importer API.
+ *
+ * @package WordPress
+ * @subpackage Administration
+ */
+
+/**
+ * Retrieve list of importers.
+ *
+ * @since 2.0.0
+ *
+ * @global array $wp_importers
+ * @return array
+ */
+function get_importers() {
+ global $wp_importers;
+ if ( is_array( $wp_importers ) ) {
+ uasort( $wp_importers, '_usort_by_first_member' );
+ }
+ return $wp_importers;
+}
+
+/**
+ * Sorts a multidimensional array by first member of each top level member
+ *
+ * Used by uasort() as a callback, should not be used directly.
+ *
+ * @since 2.9.0
+ * @access private
+ *
+ * @param array $a
+ * @param array $b
+ * @return int
+ */
+function _usort_by_first_member( $a, $b ) {
+ return strnatcasecmp( $a[0], $b[0] );
+}
+
+/**
+ * Register importer for WordPress.
+ *
+ * @since 2.0.0
+ *
+ * @global array $wp_importers
+ *
+ * @param string $id Importer tag. Used to uniquely identify importer.
+ * @param string $name Importer name and title.
+ * @param string $description Importer description.
+ * @param callable $callback Callback to run.
+ * @return WP_Error Returns WP_Error when $callback is WP_Error.
+ */
+function register_importer( $id, $name, $description, $callback ) {
+ global $wp_importers;
+ if ( is_wp_error( $callback ) ) {
+ return $callback;
+ }
+ $wp_importers[ $id ] = array( $name, $description, $callback );
+}
+
+/**
+ * Cleanup importer.
+ *
+ * Removes attachment based on ID.
+ *
+ * @since 2.0.0
+ *
+ * @param string $id Importer ID.
+ */
+function wp_import_cleanup( $id ) {
+ wp_delete_attachment( $id );
+}
+
+/**
+ * Handle importer uploading and add attachment.
+ *
+ * @since 2.0.0
+ *
+ * @return array Uploaded file's details on success, error message on failure
+ */
+function wp_import_handle_upload() {
+ if ( ! isset( $_FILES['import'] ) ) {
+ return array(
+ 'error' => __( 'File is empty. Please upload something more substantial. This error could also be caused by uploads being disabled in your php.ini or by post_max_size being defined as smaller than upload_max_filesize in php.ini.' ),
+ );
+ }
+
+ $overrides = array(
+ 'test_form' => false,
+ 'test_type' => false,
+ );
+ $_FILES['import']['name'] .= '.txt';
+ $upload = wp_handle_upload( $_FILES['import'], $overrides );
+
+ if ( isset( $upload['error'] ) ) {
+ return $upload;
+ }
+
+ // Construct the object array
+ $object = array(
+ 'post_title' => wp_basename( $upload['file'] ),
+ 'post_content' => $upload['url'],
+ 'post_mime_type' => $upload['type'],
+ 'guid' => $upload['url'],
+ 'context' => 'import',
+ 'post_status' => 'private',
+ );
+
+ // Save the data
+ $id = wp_insert_attachment( $object, $upload['file'] );
+
+ /*
+ * Schedule a cleanup for one day from now in case of failed
+ * import or missing wp_import_cleanup() call.
+ */
+ wp_schedule_single_event( time() + DAY_IN_SECONDS, 'importer_scheduled_cleanup', array( $id ) );
+
+ return array(
+ 'file' => $upload['file'],
+ 'id' => $id,
+ );
+}
+
+/**
+ * Returns a list from WordPress.org of popular importer plugins.
+ *
+ * @since 3.5.0
+ *
+ * @return array Importers with metadata for each.
+ */
+function wp_get_popular_importers() {
+ include( ABSPATH . WPINC . '/version.php' ); // include an unmodified $wp_version
+
+ $locale = get_user_locale();
+ $cache_key = 'popular_importers_' . md5( $locale . $wp_version );
+ $popular_importers = get_site_transient( $cache_key );
+
+ if ( ! $popular_importers ) {
+ $url = add_query_arg(
+ array(
+ 'locale' => $locale,
+ 'version' => $wp_version,
+ ),
+ 'http://api.wordpress.org/core/importers/1.1/'
+ );
+ $options = array( 'user-agent' => 'WordPress/' . $wp_version . '; ' . home_url( '/' ) );
+
+ if ( wp_http_supports( array( 'ssl' ) ) ) {
+ $url = set_url_scheme( $url, 'https' );
+ }
+
+ $response = wp_remote_get( $url, $options );
+ $popular_importers = json_decode( wp_remote_retrieve_body( $response ), true );
+
+ if ( is_array( $popular_importers ) ) {
+ set_site_transient( $cache_key, $popular_importers, 2 * DAY_IN_SECONDS );
+ } else {
+ $popular_importers = false;
+ }
+ }
+
+ if ( is_array( $popular_importers ) ) {
+ // If the data was received as translated, return it as-is.
+ if ( $popular_importers['translated'] ) {
+ return $popular_importers['importers'];
+ }
+
+ foreach ( $popular_importers['importers'] as &$importer ) {
+ // phpcs:ignore WordPress.WP.I18n.LowLevelTranslationFunction,WordPress.WP.I18n.NonSingularStringLiteralText
+ $importer['description'] = translate( $importer['description'] );
+ if ( $importer['name'] != 'WordPress' ) {
+ // phpcs:ignore WordPress.WP.I18n.LowLevelTranslationFunction,WordPress.WP.I18n.NonSingularStringLiteralText
+ $importer['name'] = translate( $importer['name'] );
+ }
+ }
+ return $popular_importers['importers'];
+ }
+
+ return array(
+ // slug => name, description, plugin slug, and register_importer() slug
+ 'blogger' => array(
+ 'name' => __( 'Blogger' ),
+ 'description' => __( 'Import posts, comments, and users from a Blogger blog.' ),
+ 'plugin-slug' => 'blogger-importer',
+ 'importer-id' => 'blogger',
+ ),
+ 'wpcat2tag' => array(
+ 'name' => __( 'Categories and Tags Converter' ),
+ 'description' => __( 'Convert existing categories to tags or tags to categories, selectively.' ),
+ 'plugin-slug' => 'wpcat2tag-importer',
+ 'importer-id' => 'wp-cat2tag',
+ ),
+ 'livejournal' => array(
+ 'name' => __( 'LiveJournal' ),
+ 'description' => __( 'Import posts from LiveJournal using their API.' ),
+ 'plugin-slug' => 'livejournal-importer',
+ 'importer-id' => 'livejournal',
+ ),
+ 'movabletype' => array(
+ 'name' => __( 'Movable Type and TypePad' ),
+ 'description' => __( 'Import posts and comments from a Movable Type or TypePad blog.' ),
+ 'plugin-slug' => 'movabletype-importer',
+ 'importer-id' => 'mt',
+ ),
+ 'opml' => array(
+ 'name' => __( 'Blogroll' ),
+ 'description' => __( 'Import links in OPML format.' ),
+ 'plugin-slug' => 'opml-importer',
+ 'importer-id' => 'opml',
+ ),
+ 'rss' => array(
+ 'name' => __( 'RSS' ),
+ 'description' => __( 'Import posts from an RSS feed.' ),
+ 'plugin-slug' => 'rss-importer',
+ 'importer-id' => 'rss',
+ ),
+ 'tumblr' => array(
+ 'name' => __( 'Tumblr' ),
+ 'description' => __( 'Import posts &amp; media from Tumblr using their API.' ),
+ 'plugin-slug' => 'tumblr-importer',
+ 'importer-id' => 'tumblr',
+ ),
+ 'wordpress' => array(
+ 'name' => 'WordPress',
+ 'description' => __( 'Import posts, pages, comments, custom fields, categories, and tags from a WordPress export file.' ),
+ 'plugin-slug' => 'wordpress-importer',
+ 'importer-id' => 'wordpress',
+ ),
+ );
+}
diff --git a/www/crm/wp-admin/includes/list-table.php b/www/crm/wp-admin/includes/list-table.php
new file mode 100644
index 00000000..168aebbd
--- /dev/null
+++ b/www/crm/wp-admin/includes/list-table.php
@@ -0,0 +1,86 @@
+<?php
+/**
+ * Helper functions for displaying a list of items in an ajaxified HTML table.
+ *
+ * @package WordPress
+ * @subpackage List_Table
+ * @since 3.1.0
+ */
+
+/**
+ * Fetches an instance of a WP_List_Table class.
+ *
+ * @access private
+ * @since 3.1.0
+ *
+ * @global string $hook_suffix
+ *
+ * @param string $class The type of the list table, which is the class name.
+ * @param array $args Optional. Arguments to pass to the class. Accepts 'screen'.
+ * @return WP_List_Table|bool List table object on success, false if the class does not exist.
+ */
+function _get_list_table( $class, $args = array() ) {
+ $core_classes = array(
+ //Site Admin
+ 'WP_Posts_List_Table' => 'posts',
+ 'WP_Media_List_Table' => 'media',
+ 'WP_Terms_List_Table' => 'terms',
+ 'WP_Users_List_Table' => 'users',
+ 'WP_Comments_List_Table' => 'comments',
+ 'WP_Post_Comments_List_Table' => array( 'comments', 'post-comments' ),
+ 'WP_Links_List_Table' => 'links',
+ 'WP_Plugin_Install_List_Table' => 'plugin-install',
+ 'WP_Themes_List_Table' => 'themes',
+ 'WP_Theme_Install_List_Table' => array( 'themes', 'theme-install' ),
+ 'WP_Plugins_List_Table' => 'plugins',
+ // Network Admin
+ 'WP_MS_Sites_List_Table' => 'ms-sites',
+ 'WP_MS_Users_List_Table' => 'ms-users',
+ 'WP_MS_Themes_List_Table' => 'ms-themes',
+ );
+
+ if ( isset( $core_classes[ $class ] ) ) {
+ foreach ( (array) $core_classes[ $class ] as $required ) {
+ require_once( ABSPATH . 'wp-admin/includes/class-wp-' . $required . '-list-table.php' );
+ }
+
+ if ( isset( $args['screen'] ) ) {
+ $args['screen'] = convert_to_screen( $args['screen'] );
+ } elseif ( isset( $GLOBALS['hook_suffix'] ) ) {
+ $args['screen'] = get_current_screen();
+ } else {
+ $args['screen'] = null;
+ }
+
+ return new $class( $args );
+ }
+
+ return false;
+}
+
+/**
+ * Register column headers for a particular screen.
+ *
+ * @since 2.7.0
+ *
+ * @param string $screen The handle for the screen to add help to. This is usually the hook name returned by the add_*_page() functions.
+ * @param array $columns An array of columns with column IDs as the keys and translated column names as the values
+ * @see get_column_headers(), print_column_headers(), get_hidden_columns()
+ */
+function register_column_headers( $screen, $columns ) {
+ new _WP_List_Table_Compat( $screen, $columns );
+}
+
+/**
+ * Prints column headers for a particular screen.
+ *
+ * @since 2.7.0
+ *
+ * @param string|WP_Screen $screen The screen hook name or screen object.
+ * @param bool $with_id Whether to set the id attribute or not.
+ */
+function print_column_headers( $screen, $with_id = true ) {
+ $wp_list_table = new _WP_List_Table_Compat( $screen );
+
+ $wp_list_table->print_column_headers( $with_id );
+}
diff --git a/www/crm/wp-admin/includes/media.php b/www/crm/wp-admin/includes/media.php
new file mode 100644
index 00000000..5c54b214
--- /dev/null
+++ b/www/crm/wp-admin/includes/media.php
@@ -0,0 +1,3524 @@
+<?php
+/**
+ * WordPress Administration Media API.
+ *
+ * @package WordPress
+ * @subpackage Administration
+ */
+
+/**
+ * Defines the default media upload tabs
+ *
+ * @since 2.5.0
+ *
+ * @return array default tabs
+ */
+function media_upload_tabs() {
+ $_default_tabs = array(
+ 'type' => __( 'From Computer' ), // handler action suffix => tab text
+ 'type_url' => __( 'From URL' ),
+ 'gallery' => __( 'Gallery' ),
+ 'library' => __( 'Media Library' ),
+ );
+
+ /**
+ * Filters the available tabs in the legacy (pre-3.5.0) media popup.
+ *
+ * @since 2.5.0
+ *
+ * @param array $_default_tabs An array of media tabs.
+ */
+ return apply_filters( 'media_upload_tabs', $_default_tabs );
+}
+
+/**
+ * Adds the gallery tab back to the tabs array if post has image attachments
+ *
+ * @since 2.5.0
+ *
+ * @global wpdb $wpdb WordPress database abstraction object.
+ *
+ * @param array $tabs
+ * @return array $tabs with gallery if post has image attachment
+ */
+function update_gallery_tab( $tabs ) {
+ global $wpdb;
+
+ if ( ! isset( $_REQUEST['post_id'] ) ) {
+ unset( $tabs['gallery'] );
+ return $tabs;
+ }
+
+ $post_id = intval( $_REQUEST['post_id'] );
+
+ if ( $post_id ) {
+ $attachments = intval( $wpdb->get_var( $wpdb->prepare( "SELECT count(*) FROM $wpdb->posts WHERE post_type = 'attachment' AND post_status != 'trash' AND post_parent = %d", $post_id ) ) );
+ }
+
+ if ( empty( $attachments ) ) {
+ unset( $tabs['gallery'] );
+ return $tabs;
+ }
+
+ $tabs['gallery'] = sprintf( __( 'Gallery (%s)' ), "<span id='attachments-count'>$attachments</span>" );
+
+ return $tabs;
+}
+
+/**
+ * Outputs the legacy media upload tabs UI.
+ *
+ * @since 2.5.0
+ *
+ * @global string $redir_tab
+ */
+function the_media_upload_tabs() {
+ global $redir_tab;
+ $tabs = media_upload_tabs();
+ $default = 'type';
+
+ if ( ! empty( $tabs ) ) {
+ echo "<ul id='sidemenu'>\n";
+ if ( isset( $redir_tab ) && array_key_exists( $redir_tab, $tabs ) ) {
+ $current = $redir_tab;
+ } elseif ( isset( $_GET['tab'] ) && array_key_exists( $_GET['tab'], $tabs ) ) {
+ $current = $_GET['tab'];
+ } else {
+ /** This filter is documented in wp-admin/media-upload.php */
+ $current = apply_filters( 'media_upload_default_tab', $default );
+ }
+
+ foreach ( $tabs as $callback => $text ) {
+ $class = '';
+
+ if ( $current == $callback ) {
+ $class = " class='current'";
+ }
+
+ $href = add_query_arg(
+ array(
+ 'tab' => $callback,
+ 's' => false,
+ 'paged' => false,
+ 'post_mime_type' => false,
+ 'm' => false,
+ )
+ );
+ $link = "<a href='" . esc_url( $href ) . "'$class>$text</a>";
+ echo "\t<li id='" . esc_attr( "tab-$callback" ) . "'>$link</li>\n";
+ }
+ echo "</ul>\n";
+ }
+}
+
+/**
+ * Retrieves the image HTML to send to the editor.
+ *
+ * @since 2.5.0
+ *
+ * @param int $id Image attachment id.
+ * @param string $caption Image caption.
+ * @param string $title Image title attribute.
+ * @param string $align Image CSS alignment property.
+ * @param string $url Optional. Image src URL. Default empty.
+ * @param bool|string $rel Optional. Value for rel attribute or whether to add a default value. Default false.
+ * @param string|array $size Optional. Image size. Accepts any valid image size, or an array of width
+ * and height values in pixels (in that order). Default 'medium'.
+ * @param string $alt Optional. Image alt attribute. Default empty.
+ * @return string The HTML output to insert into the editor.
+ */
+function get_image_send_to_editor( $id, $caption, $title, $align, $url = '', $rel = false, $size = 'medium', $alt = '' ) {
+
+ $html = get_image_tag( $id, $alt, '', $align, $size );
+
+ if ( $rel ) {
+ if ( is_string( $rel ) ) {
+ $rel = ' rel="' . esc_attr( $rel ) . '"';
+ } else {
+ $rel = ' rel="attachment wp-att-' . intval( $id ) . '"';
+ }
+ } else {
+ $rel = '';
+ }
+
+ if ( $url ) {
+ $html = '<a href="' . esc_attr( $url ) . '"' . $rel . '>' . $html . '</a>';
+ }
+
+ /**
+ * Filters the image HTML markup to send to the editor when inserting an image.
+ *
+ * @since 2.5.0
+ *
+ * @param string $html The image HTML markup to send.
+ * @param int $id The attachment id.
+ * @param string $caption The image caption.
+ * @param string $title The image title.
+ * @param string $align The image alignment.
+ * @param string $url The image source URL.
+ * @param string|array $size Size of image. Image size or array of width and height values
+ * (in that order). Default 'medium'.
+ * @param string $alt The image alternative, or alt, text.
+ */
+ $html = apply_filters( 'image_send_to_editor', $html, $id, $caption, $title, $align, $url, $size, $alt );
+
+ return $html;
+}
+
+/**
+ * Adds image shortcode with caption to editor
+ *
+ * @since 2.6.0
+ *
+ * @param string $html The image HTML markup to send.
+ * @param integer $id Image attachment ID.
+ * @param string $caption Image caption.
+ * @param string $title Image title attribute (not used).
+ * @param string $align Image CSS alignment property.
+ * @param string $url Image source URL (not used).
+ * @param string $size Image size (`thumbnail`, `medium`, `large`, `full`, or added with `add_image_size()`) (not used).
+ * @param string $alt Image `alt` attribute (not used).
+ * @return string The image HTML markup with caption shortcode.
+ */
+function image_add_caption( $html, $id, $caption, $title, $align, $url, $size, $alt = '' ) {
+
+ /**
+ * Filters the caption text.
+ *
+ * Note: If the caption text is empty, the caption shortcode will not be appended
+ * to the image HTML when inserted into the editor.
+ *
+ * Passing an empty value also prevents the {@see 'image_add_caption_shortcode'}
+ * Filters from being evaluated at the end of image_add_caption().
+ *
+ * @since 4.1.0
+ *
+ * @param string $caption The original caption text.
+ * @param int $id The attachment ID.
+ */
+ $caption = apply_filters( 'image_add_caption_text', $caption, $id );
+
+ /**
+ * Filters whether to disable captions.
+ *
+ * Prevents image captions from being appended to image HTML when inserted into the editor.
+ *
+ * @since 2.6.0
+ *
+ * @param bool $bool Whether to disable appending captions. Returning true to the filter
+ * will disable captions. Default empty string.
+ */
+ if ( empty( $caption ) || apply_filters( 'disable_captions', '' ) ) {
+ return $html;
+ }
+
+ $id = ( 0 < (int) $id ) ? 'attachment_' . $id : '';
+
+ if ( ! preg_match( '/width=["\']([0-9]+)/', $html, $matches ) ) {
+ return $html;
+ }
+
+ $width = $matches[1];
+
+ $caption = str_replace( array( "\r\n", "\r" ), "\n", $caption );
+ $caption = preg_replace_callback( '/<[a-zA-Z0-9]+(?: [^<>]+>)*/', '_cleanup_image_add_caption', $caption );
+
+ // Convert any remaining line breaks to <br>.
+ $caption = preg_replace( '/[ \n\t]*\n[ \t]*/', '<br />', $caption );
+
+ $html = preg_replace( '/(class=["\'][^\'"]*)align(none|left|right|center)\s?/', '$1', $html );
+ if ( empty( $align ) ) {
+ $align = 'none';
+ }
+
+ $shcode = '[caption id="' . $id . '" align="align' . $align . '" width="' . $width . '"]' . $html . ' ' . $caption . '[/caption]';
+
+ /**
+ * Filters the image HTML markup including the caption shortcode.
+ *
+ * @since 2.6.0
+ *
+ * @param string $shcode The image HTML markup with caption shortcode.
+ * @param string $html The image HTML markup.
+ */
+ return apply_filters( 'image_add_caption_shortcode', $shcode, $html );
+}
+
+/**
+ * Private preg_replace callback used in image_add_caption()
+ *
+ * @access private
+ * @since 3.4.0
+ */
+function _cleanup_image_add_caption( $matches ) {
+ // Remove any line breaks from inside the tags.
+ return preg_replace( '/[\r\n\t]+/', ' ', $matches[0] );
+}
+
+/**
+ * Adds image html to editor
+ *
+ * @since 2.5.0
+ *
+ * @param string $html
+ */
+function media_send_to_editor( $html ) {
+ ?>
+<script type="text/javascript">
+var win = window.dialogArguments || opener || parent || top;
+win.send_to_editor( <?php echo wp_json_encode( $html ); ?> );
+</script>
+ <?php
+ exit;
+}
+
+/**
+ * Save a file submitted from a POST request and create an attachment post for it.
+ *
+ * @since 2.5.0
+ *
+ * @param string $file_id Index of the `$_FILES` array that the file was sent. Required.
+ * @param int $post_id The post ID of a post to attach the media item to. Required, but can
+ * be set to 0, creating a media item that has no relationship to a post.
+ * @param array $post_data Overwrite some of the attachment. Optional.
+ * @param array $overrides Override the wp_handle_upload() behavior. Optional.
+ * @return int|WP_Error ID of the attachment or a WP_Error object on failure.
+ */
+function media_handle_upload( $file_id, $post_id, $post_data = array(), $overrides = array( 'test_form' => false ) ) {
+
+ $time = current_time( 'mysql' );
+ if ( $post = get_post( $post_id ) ) {
+ // The post date doesn't usually matter for pages, so don't backdate this upload.
+ if ( 'page' !== $post->post_type && substr( $post->post_date, 0, 4 ) > 0 ) {
+ $time = $post->post_date;
+ }
+ }
+
+ $file = wp_handle_upload( $_FILES[ $file_id ], $overrides, $time );
+
+ if ( isset( $file['error'] ) ) {
+ return new WP_Error( 'upload_error', $file['error'] );
+ }
+
+ $name = $_FILES[ $file_id ]['name'];
+ $ext = pathinfo( $name, PATHINFO_EXTENSION );
+ $name = wp_basename( $name, ".$ext" );
+
+ $url = $file['url'];
+ $type = $file['type'];
+ $file = $file['file'];
+ $title = sanitize_text_field( $name );
+ $content = '';
+ $excerpt = '';
+
+ if ( preg_match( '#^audio#', $type ) ) {
+ $meta = wp_read_audio_metadata( $file );
+
+ if ( ! empty( $meta['title'] ) ) {
+ $title = $meta['title'];
+ }
+
+ if ( ! empty( $title ) ) {
+
+ if ( ! empty( $meta['album'] ) && ! empty( $meta['artist'] ) ) {
+ /* translators: 1: audio track title, 2: album title, 3: artist name */
+ $content .= sprintf( __( '"%1$s" from %2$s by %3$s.' ), $title, $meta['album'], $meta['artist'] );
+ } elseif ( ! empty( $meta['album'] ) ) {
+ /* translators: 1: audio track title, 2: album title */
+ $content .= sprintf( __( '"%1$s" from %2$s.' ), $title, $meta['album'] );
+ } elseif ( ! empty( $meta['artist'] ) ) {
+ /* translators: 1: audio track title, 2: artist name */
+ $content .= sprintf( __( '"%1$s" by %2$s.' ), $title, $meta['artist'] );
+ } else {
+ /* translators: 1: audio track title */
+ $content .= sprintf( __( '"%s".' ), $title );
+ }
+ } elseif ( ! empty( $meta['album'] ) ) {
+
+ if ( ! empty( $meta['artist'] ) ) {
+ /* translators: 1: audio album title, 2: artist name */
+ $content .= sprintf( __( '%1$s by %2$s.' ), $meta['album'], $meta['artist'] );
+ } else {
+ $content .= $meta['album'] . '.';
+ }
+ } elseif ( ! empty( $meta['artist'] ) ) {
+
+ $content .= $meta['artist'] . '.';
+
+ }
+
+ if ( ! empty( $meta['year'] ) ) {
+ /* translators: Audio file track information. %d: Year of audio track release */
+ $content .= ' ' . sprintf( __( 'Released: %d.' ), $meta['year'] );
+ }
+
+ if ( ! empty( $meta['track_number'] ) ) {
+ $track_number = explode( '/', $meta['track_number'] );
+ if ( isset( $track_number[1] ) ) {
+ /* translators: Audio file track information. 1: Audio track number, 2: Total audio tracks */
+ $content .= ' ' . sprintf( __( 'Track %1$s of %2$s.' ), number_format_i18n( $track_number[0] ), number_format_i18n( $track_number[1] ) );
+ } else {
+ /* translators: Audio file track information. %s: Audio track number */
+ $content .= ' ' . sprintf( __( 'Track %s.' ), number_format_i18n( $track_number[0] ) );
+ }
+ }
+
+ if ( ! empty( $meta['genre'] ) ) {
+ /* translators: Audio file genre information. %s: Audio genre name */
+ $content .= ' ' . sprintf( __( 'Genre: %s.' ), $meta['genre'] );
+ }
+
+ // Use image exif/iptc data for title and caption defaults if possible.
+ } elseif ( 0 === strpos( $type, 'image/' ) && $image_meta = wp_read_image_metadata( $file ) ) {
+ if ( trim( $image_meta['title'] ) && ! is_numeric( sanitize_title( $image_meta['title'] ) ) ) {
+ $title = $image_meta['title'];
+ }
+
+ if ( trim( $image_meta['caption'] ) ) {
+ $excerpt = $image_meta['caption'];
+ }
+ }
+
+ // Construct the attachment array
+ $attachment = array_merge(
+ array(
+ 'post_mime_type' => $type,
+ 'guid' => $url,
+ 'post_parent' => $post_id,
+ 'post_title' => $title,
+ 'post_content' => $content,
+ 'post_excerpt' => $excerpt,
+ ),
+ $post_data
+ );
+
+ // This should never be set as it would then overwrite an existing attachment.
+ unset( $attachment['ID'] );
+
+ // Save the data
+ $id = wp_insert_attachment( $attachment, $file, $post_id, true );
+ if ( ! is_wp_error( $id ) ) {
+ wp_update_attachment_metadata( $id, wp_generate_attachment_metadata( $id, $file ) );
+ }
+
+ return $id;
+
+}
+
+/**
+ * Handles a side-loaded file in the same way as an uploaded file is handled by media_handle_upload().
+ *
+ * @since 2.6.0
+ *
+ * @param array $file_array Array similar to a `$_FILES` upload array.
+ * @param int $post_id The post ID the media is associated with.
+ * @param string $desc Optional. Description of the side-loaded file. Default null.
+ * @param array $post_data Optional. Post data to override. Default empty array.
+ * @return int|object The ID of the attachment or a WP_Error on failure.
+ */
+function media_handle_sideload( $file_array, $post_id, $desc = null, $post_data = array() ) {
+ $overrides = array( 'test_form' => false );
+
+ $time = current_time( 'mysql' );
+ if ( $post = get_post( $post_id ) ) {
+ if ( substr( $post->post_date, 0, 4 ) > 0 ) {
+ $time = $post->post_date;
+ }
+ }
+
+ $file = wp_handle_sideload( $file_array, $overrides, $time );
+ if ( isset( $file['error'] ) ) {
+ return new WP_Error( 'upload_error', $file['error'] );
+ }
+
+ $url = $file['url'];
+ $type = $file['type'];
+ $file = $file['file'];
+ $title = preg_replace( '/\.[^.]+$/', '', wp_basename( $file ) );
+ $content = '';
+
+ // Use image exif/iptc data for title and caption defaults if possible.
+ if ( $image_meta = wp_read_image_metadata( $file ) ) {
+ if ( trim( $image_meta['title'] ) && ! is_numeric( sanitize_title( $image_meta['title'] ) ) ) {
+ $title = $image_meta['title'];
+ }
+ if ( trim( $image_meta['caption'] ) ) {
+ $content = $image_meta['caption'];
+ }
+ }
+
+ if ( isset( $desc ) ) {
+ $title = $desc;
+ }
+
+ // Construct the attachment array.
+ $attachment = array_merge(
+ array(
+ 'post_mime_type' => $type,
+ 'guid' => $url,
+ 'post_parent' => $post_id,
+ 'post_title' => $title,
+ 'post_content' => $content,
+ ),
+ $post_data
+ );
+
+ // This should never be set as it would then overwrite an existing attachment.
+ unset( $attachment['ID'] );
+
+ // Save the attachment metadata
+ $id = wp_insert_attachment( $attachment, $file, $post_id, true );
+ if ( ! is_wp_error( $id ) ) {
+ wp_update_attachment_metadata( $id, wp_generate_attachment_metadata( $id, $file ) );
+ }
+
+ return $id;
+}
+
+/**
+ * Adds the iframe to display content for the media upload page
+ *
+ * @since 2.5.0
+ *
+ * @global int $body_id
+ *
+ * @param string|callable $content_func
+ */
+function wp_iframe( $content_func /* ... */ ) {
+ _wp_admin_html_begin();
+ ?>
+<title><?php bloginfo( 'name' ); ?> &rsaquo; <?php _e( 'Uploads' ); ?> &#8212; <?php _e( 'WordPress' ); ?></title>
+ <?php
+
+ wp_enqueue_style( 'colors' );
+ // Check callback name for 'media'
+ if ( ( is_array( $content_func ) && ! empty( $content_func[1] ) && 0 === strpos( (string) $content_func[1], 'media' ) )
+ || ( ! is_array( $content_func ) && 0 === strpos( $content_func, 'media' ) ) ) {
+ wp_enqueue_style( 'deprecated-media' );
+ }
+ wp_enqueue_style( 'ie' );
+ ?>
+<script type="text/javascript">
+addLoadEvent = function(func){if(typeof jQuery!="undefined")jQuery(document).ready(func);else if(typeof wpOnload!='function'){wpOnload=func;}else{var oldonload=wpOnload;wpOnload=function(){oldonload();func();}}};
+var ajaxurl = '<?php echo admin_url( 'admin-ajax.php', 'relative' ); ?>', pagenow = 'media-upload-popup', adminpage = 'media-upload-popup',
+isRtl = <?php echo (int) is_rtl(); ?>;
+</script>
+ <?php
+ /** This action is documented in wp-admin/admin-header.php */
+ do_action( 'admin_enqueue_scripts', 'media-upload-popup' );
+
+ /**
+ * Fires when admin styles enqueued for the legacy (pre-3.5.0) media upload popup are printed.
+ *
+ * @since 2.9.0
+ */
+ do_action( 'admin_print_styles-media-upload-popup' );
+
+ /** This action is documented in wp-admin/admin-header.php */
+ do_action( 'admin_print_styles' );
+
+ /**
+ * Fires when admin scripts enqueued for the legacy (pre-3.5.0) media upload popup are printed.
+ *
+ * @since 2.9.0
+ */
+ do_action( 'admin_print_scripts-media-upload-popup' );
+
+ /** This action is documented in wp-admin/admin-header.php */
+ do_action( 'admin_print_scripts' );
+
+ /**
+ * Fires when scripts enqueued for the admin header for the legacy (pre-3.5.0)
+ * media upload popup are printed.
+ *
+ * @since 2.9.0
+ */
+ do_action( 'admin_head-media-upload-popup' );
+
+ /** This action is documented in wp-admin/admin-header.php */
+ do_action( 'admin_head' );
+
+ if ( is_string( $content_func ) ) {
+ /**
+ * Fires in the admin header for each specific form tab in the legacy
+ * (pre-3.5.0) media upload popup.
+ *
+ * The dynamic portion of the hook, `$content_func`, refers to the form
+ * callback for the media upload type. Possible values include
+ * 'media_upload_type_form', 'media_upload_type_url_form', and
+ * 'media_upload_library_form'.
+ *
+ * @since 2.5.0
+ */
+ do_action( "admin_head_{$content_func}" );
+ }
+
+ $body_id_attr = '';
+ if ( isset( $GLOBALS['body_id'] ) ) {
+ $body_id_attr = ' id="' . $GLOBALS['body_id'] . '"';
+ }
+ ?>
+</head>
+<body<?php echo $body_id_attr; ?> class="wp-core-ui no-js">
+<script type="text/javascript">
+document.body.className = document.body.className.replace('no-js', 'js');
+</script>
+ <?php
+ $args = func_get_args();
+ $args = array_slice( $args, 1 );
+ call_user_func_array( $content_func, $args );
+
+ /** This action is documented in wp-admin/admin-footer.php */
+ do_action( 'admin_print_footer_scripts' );
+ ?>
+<script type="text/javascript">if(typeof wpOnload=='function')wpOnload();</script>
+</body>
+</html>
+ <?php
+}
+
+/**
+ * Adds the media button to the editor
+ *
+ * @since 2.5.0
+ *
+ * @global int $post_ID
+ *
+ * @staticvar int $instance
+ *
+ * @param string $editor_id
+ */
+function media_buttons( $editor_id = 'content' ) {
+ static $instance = 0;
+ $instance++;
+
+ $post = get_post();
+ if ( ! $post && ! empty( $GLOBALS['post_ID'] ) ) {
+ $post = $GLOBALS['post_ID'];
+ }
+
+ wp_enqueue_media(
+ array(
+ 'post' => $post,
+ )
+ );
+
+ $img = '<span class="wp-media-buttons-icon"></span> ';
+
+ $id_attribute = $instance === 1 ? ' id="insert-media-button"' : '';
+ printf(
+ '<button type="button"%s class="button insert-media add_media" data-editor="%s">%s</button>',
+ $id_attribute,
+ esc_attr( $editor_id ),
+ $img . __( 'Add Media' )
+ );
+ /**
+ * Filters the legacy (pre-3.5.0) media buttons.
+ *
+ * Use {@see 'media_buttons'} action instead.
+ *
+ * @since 2.5.0
+ * @deprecated 3.5.0 Use {@see 'media_buttons'} action instead.
+ *
+ * @param string $string Media buttons context. Default empty.
+ */
+ $legacy_filter = apply_filters( 'media_buttons_context', '' );
+
+ if ( $legacy_filter ) {
+ // #WP22559. Close <a> if a plugin started by closing <a> to open their own <a> tag.
+ if ( 0 === stripos( trim( $legacy_filter ), '</a>' ) ) {
+ $legacy_filter .= '</a>';
+ }
+ echo $legacy_filter;
+ }
+}
+
+/**
+ * @global int $post_ID
+ * @param string $type
+ * @param int $post_id
+ * @param string $tab
+ * @return string
+ */
+function get_upload_iframe_src( $type = null, $post_id = null, $tab = null ) {
+ global $post_ID;
+
+ if ( empty( $post_id ) ) {
+ $post_id = $post_ID;
+ }
+
+ $upload_iframe_src = add_query_arg( 'post_id', (int) $post_id, admin_url( 'media-upload.php' ) );
+
+ if ( $type && 'media' != $type ) {
+ $upload_iframe_src = add_query_arg( 'type', $type, $upload_iframe_src );
+ }
+
+ if ( ! empty( $tab ) ) {
+ $upload_iframe_src = add_query_arg( 'tab', $tab, $upload_iframe_src );
+ }
+
+ /**
+ * Filters the upload iframe source URL for a specific media type.
+ *
+ * The dynamic portion of the hook name, `$type`, refers to the type
+ * of media uploaded.
+ *
+ * @since 3.0.0
+ *
+ * @param string $upload_iframe_src The upload iframe source URL by type.
+ */
+ $upload_iframe_src = apply_filters( "{$type}_upload_iframe_src", $upload_iframe_src );
+
+ return add_query_arg( 'TB_iframe', true, $upload_iframe_src );
+}
+
+/**
+ * Handles form submissions for the legacy media uploader.
+ *
+ * @since 2.5.0
+ *
+ * @return mixed void|object WP_Error on failure
+ */
+function media_upload_form_handler() {
+ check_admin_referer( 'media-form' );
+
+ $errors = null;
+
+ if ( isset( $_POST['send'] ) ) {
+ $keys = array_keys( $_POST['send'] );
+ $send_id = (int) reset( $keys );
+ }
+
+ if ( ! empty( $_POST['attachments'] ) ) {
+ foreach ( $_POST['attachments'] as $attachment_id => $attachment ) {
+ $post = $_post = get_post( $attachment_id, ARRAY_A );
+
+ if ( ! current_user_can( 'edit_post', $attachment_id ) ) {
+ continue;
+ }
+
+ if ( isset( $attachment['post_content'] ) ) {
+ $post['post_content'] = $attachment['post_content'];
+ }
+ if ( isset( $attachment['post_title'] ) ) {
+ $post['post_title'] = $attachment['post_title'];
+ }
+ if ( isset( $attachment['post_excerpt'] ) ) {
+ $post['post_excerpt'] = $attachment['post_excerpt'];
+ }
+ if ( isset( $attachment['menu_order'] ) ) {
+ $post['menu_order'] = $attachment['menu_order'];
+ }
+
+ if ( isset( $send_id ) && $attachment_id == $send_id ) {
+ if ( isset( $attachment['post_parent'] ) ) {
+ $post['post_parent'] = $attachment['post_parent'];
+ }
+ }
+
+ /**
+ * Filters the attachment fields to be saved.
+ *
+ * @since 2.5.0
+ *
+ * @see wp_get_attachment_metadata()
+ *
+ * @param array $post An array of post data.
+ * @param array $attachment An array of attachment metadata.
+ */
+ $post = apply_filters( 'attachment_fields_to_save', $post, $attachment );
+
+ if ( isset( $attachment['image_alt'] ) ) {
+ $image_alt = wp_unslash( $attachment['image_alt'] );
+ if ( $image_alt != get_post_meta( $attachment_id, '_wp_attachment_image_alt', true ) ) {
+ $image_alt = wp_strip_all_tags( $image_alt, true );
+
+ // Update_meta expects slashed.
+ update_post_meta( $attachment_id, '_wp_attachment_image_alt', wp_slash( $image_alt ) );
+ }
+ }
+
+ if ( isset( $post['errors'] ) ) {
+ $errors[ $attachment_id ] = $post['errors'];
+ unset( $post['errors'] );
+ }
+
+ if ( $post != $_post ) {
+ wp_update_post( $post );
+ }
+
+ foreach ( get_attachment_taxonomies( $post ) as $t ) {
+ if ( isset( $attachment[ $t ] ) ) {
+ wp_set_object_terms( $attachment_id, array_map( 'trim', preg_split( '/,+/', $attachment[ $t ] ) ), $t, false );
+ }
+ }
+ }
+ }
+
+ if ( isset( $_POST['insert-gallery'] ) || isset( $_POST['update-gallery'] ) ) {
+ ?>
+ <script type="text/javascript">
+ var win = window.dialogArguments || opener || parent || top;
+ win.tb_remove();
+ </script>
+ <?php
+ exit;
+ }
+
+ if ( isset( $send_id ) ) {
+ $attachment = wp_unslash( $_POST['attachments'][ $send_id ] );
+
+ $html = isset( $attachment['post_title'] ) ? $attachment['post_title'] : '';
+ if ( ! empty( $attachment['url'] ) ) {
+ $rel = '';
+ if ( strpos( $attachment['url'], 'attachment_id' ) || get_attachment_link( $send_id ) == $attachment['url'] ) {
+ $rel = " rel='attachment wp-att-" . esc_attr( $send_id ) . "'";
+ }
+ $html = "<a href='{$attachment['url']}'$rel>$html</a>";
+ }
+
+ /**
+ * Filters the HTML markup for a media item sent to the editor.
+ *
+ * @since 2.5.0
+ *
+ * @see wp_get_attachment_metadata()
+ *
+ * @param string $html HTML markup for a media item sent to the editor.
+ * @param int $send_id The first key from the $_POST['send'] data.
+ * @param array $attachment Array of attachment metadata.
+ */
+ $html = apply_filters( 'media_send_to_editor', $html, $send_id, $attachment );
+ return media_send_to_editor( $html );
+ }
+
+ return $errors;
+}
+
+/**
+ * Handles the process of uploading media.
+ *
+ * @since 2.5.0
+ *
+ * @return null|string
+ */
+function wp_media_upload_handler() {
+ $errors = array();
+ $id = 0;
+
+ if ( isset( $_POST['html-upload'] ) && ! empty( $_FILES ) ) {
+ check_admin_referer( 'media-form' );
+ // Upload File button was clicked
+ $id = media_handle_upload( 'async-upload', $_REQUEST['post_id'] );
+ unset( $_FILES );
+ if ( is_wp_error( $id ) ) {
+ $errors['upload_error'] = $id;
+ $id = false;
+ }
+ }
+
+ if ( ! empty( $_POST['insertonlybutton'] ) ) {
+ $src = $_POST['src'];
+ if ( ! empty( $src ) && ! strpos( $src, '://' ) ) {
+ $src = "http://$src";
+ }
+
+ if ( isset( $_POST['media_type'] ) && 'image' != $_POST['media_type'] ) {
+ $title = esc_html( wp_unslash( $_POST['title'] ) );
+ if ( empty( $title ) ) {
+ $title = esc_html( wp_basename( $src ) );
+ }
+
+ if ( $title && $src ) {
+ $html = "<a href='" . esc_url( $src ) . "'>$title</a>";
+ }
+
+ $type = 'file';
+ if ( ( $ext = preg_replace( '/^.+?\.([^.]+)$/', '$1', $src ) ) && ( $ext_type = wp_ext2type( $ext ) )
+ && ( 'audio' == $ext_type || 'video' == $ext_type ) ) {
+ $type = $ext_type;
+ }
+
+ /**
+ * Filters the URL sent to the editor for a specific media type.
+ *
+ * The dynamic portion of the hook name, `$type`, refers to the type
+ * of media being sent.
+ *
+ * @since 3.3.0
+ *
+ * @param string $html HTML markup sent to the editor.
+ * @param string $src Media source URL.
+ * @param string $title Media title.
+ */
+ $html = apply_filters( "{$type}_send_to_editor_url", $html, esc_url_raw( $src ), $title );
+ } else {
+ $align = '';
+ $alt = esc_attr( wp_unslash( $_POST['alt'] ) );
+ if ( isset( $_POST['align'] ) ) {
+ $align = esc_attr( wp_unslash( $_POST['align'] ) );
+ $class = " class='align$align'";
+ }
+ if ( ! empty( $src ) ) {
+ $html = "<img src='" . esc_url( $src ) . "' alt='$alt'$class />";
+ }
+
+ /**
+ * Filters the image URL sent to the editor.
+ *
+ * @since 2.8.0
+ *
+ * @param string $html HTML markup sent to the editor for an image.
+ * @param string $src Image source URL.
+ * @param string $alt Image alternate, or alt, text.
+ * @param string $align The image alignment. Default 'alignnone'. Possible values include
+ * 'alignleft', 'aligncenter', 'alignright', 'alignnone'.
+ */
+ $html = apply_filters( 'image_send_to_editor_url', $html, esc_url_raw( $src ), $alt, $align );
+ }
+
+ return media_send_to_editor( $html );
+ }
+
+ if ( isset( $_POST['save'] ) ) {
+ $errors['upload_notice'] = __( 'Saved.' );
+ wp_enqueue_script( 'admin-gallery' );
+ return wp_iframe( 'media_upload_gallery_form', $errors );
+
+ } elseif ( ! empty( $_POST ) ) {
+ $return = media_upload_form_handler();
+
+ if ( is_string( $return ) ) {
+ return $return;
+ }
+ if ( is_array( $return ) ) {
+ $errors = $return;
+ }
+ }
+
+ if ( isset( $_GET['tab'] ) && $_GET['tab'] == 'type_url' ) {
+ $type = 'image';
+ if ( isset( $_GET['type'] ) && in_array( $_GET['type'], array( 'video', 'audio', 'file' ) ) ) {
+ $type = $_GET['type'];
+ }
+ return wp_iframe( 'media_upload_type_url_form', $type, $errors, $id );
+ }
+
+ return wp_iframe( 'media_upload_type_form', 'image', $errors, $id );
+}
+
+/**
+ * Downloads an image from the specified URL and attaches it to a post.
+ *
+ * @since 2.6.0
+ * @since 4.2.0 Introduced the `$return` parameter.
+ * @since 4.8.0 Introduced the 'id' option within the `$return` parameter.
+ *
+ * @param string $file The URL of the image to download.
+ * @param int $post_id The post ID the media is to be associated with.
+ * @param string $desc Optional. Description of the image.
+ * @param string $return Optional. Accepts 'html' (image tag html) or 'src' (URL), or 'id' (attachment ID). Default 'html'.
+ * @return string|WP_Error Populated HTML img tag on success, WP_Error object otherwise.
+ */
+function media_sideload_image( $file, $post_id, $desc = null, $return = 'html' ) {
+ if ( ! empty( $file ) ) {
+
+ // Set variables for storage, fix file filename for query strings.
+ preg_match( '/[^\?]+\.(jpe?g|jpe|gif|png)\b/i', $file, $matches );
+ if ( ! $matches ) {
+ return new WP_Error( 'image_sideload_failed', __( 'Invalid image URL' ) );
+ }
+
+ $file_array = array();
+ $file_array['name'] = wp_basename( $matches[0] );
+
+ // Download file to temp location.
+ $file_array['tmp_name'] = download_url( $file );
+
+ // If error storing temporarily, return the error.
+ if ( is_wp_error( $file_array['tmp_name'] ) ) {
+ return $file_array['tmp_name'];
+ }
+
+ // Do the validation and storage stuff.
+ $id = media_handle_sideload( $file_array, $post_id, $desc );
+
+ // If error storing permanently, unlink.
+ if ( is_wp_error( $id ) ) {
+ @unlink( $file_array['tmp_name'] );
+ return $id;
+ // If attachment id was requested, return it early.
+ } elseif ( $return === 'id' ) {
+ return $id;
+ }
+
+ $src = wp_get_attachment_url( $id );
+ }
+
+ // Finally, check to make sure the file has been saved, then return the HTML.
+ if ( ! empty( $src ) ) {
+ if ( $return === 'src' ) {
+ return $src;
+ }
+
+ $alt = isset( $desc ) ? esc_attr( $desc ) : '';
+ $html = "<img src='$src' alt='$alt' />";
+ return $html;
+ } else {
+ return new WP_Error( 'image_sideload_failed' );
+ }
+}
+
+/**
+ * Retrieves the legacy media uploader form in an iframe.
+ *
+ * @since 2.5.0
+ *
+ * @return string|null
+ */
+function media_upload_gallery() {
+ $errors = array();
+
+ if ( ! empty( $_POST ) ) {
+ $return = media_upload_form_handler();
+
+ if ( is_string( $return ) ) {
+ return $return;
+ }
+ if ( is_array( $return ) ) {
+ $errors = $return;
+ }
+ }
+
+ wp_enqueue_script( 'admin-gallery' );
+ return wp_iframe( 'media_upload_gallery_form', $errors );
+}
+
+/**
+ * Retrieves the legacy media library form in an iframe.
+ *
+ * @since 2.5.0
+ *
+ * @return string|null
+ */
+function media_upload_library() {
+ $errors = array();
+ if ( ! empty( $_POST ) ) {
+ $return = media_upload_form_handler();
+
+ if ( is_string( $return ) ) {
+ return $return;
+ }
+ if ( is_array( $return ) ) {
+ $errors = $return;
+ }
+ }
+
+ return wp_iframe( 'media_upload_library_form', $errors );
+}
+
+/**
+ * Retrieve HTML for the image alignment radio buttons with the specified one checked.
+ *
+ * @since 2.7.0
+ *
+ * @param WP_Post $post
+ * @param string $checked
+ * @return string
+ */
+function image_align_input_fields( $post, $checked = '' ) {
+
+ if ( empty( $checked ) ) {
+ $checked = get_user_setting( 'align', 'none' );
+ }
+
+ $alignments = array(
+ 'none' => __( 'None' ),
+ 'left' => __( 'Left' ),
+ 'center' => __( 'Center' ),
+ 'right' => __( 'Right' ),
+ );
+ if ( ! array_key_exists( (string) $checked, $alignments ) ) {
+ $checked = 'none';
+ }
+
+ $out = array();
+ foreach ( $alignments as $name => $label ) {
+ $name = esc_attr( $name );
+ $out[] = "<input type='radio' name='attachments[{$post->ID}][align]' id='image-align-{$name}-{$post->ID}' value='$name'" .
+ ( $checked == $name ? " checked='checked'" : '' ) .
+ " /><label for='image-align-{$name}-{$post->ID}' class='align image-align-{$name}-label'>$label</label>";
+ }
+ return join( "\n", $out );
+}
+
+/**
+ * Retrieve HTML for the size radio buttons with the specified one checked.
+ *
+ * @since 2.7.0
+ *
+ * @param WP_Post $post
+ * @param bool|string $check
+ * @return array
+ */
+function image_size_input_fields( $post, $check = '' ) {
+ /**
+ * Filters the names and labels of the default image sizes.
+ *
+ * @since 3.3.0
+ *
+ * @param array $size_names Array of image sizes and their names. Default values
+ * include 'Thumbnail', 'Medium', 'Large', 'Full Size'.
+ */
+ $size_names = apply_filters(
+ 'image_size_names_choose',
+ array(
+ 'thumbnail' => __( 'Thumbnail' ),
+ 'medium' => __( 'Medium' ),
+ 'large' => __( 'Large' ),
+ 'full' => __( 'Full Size' ),
+ )
+ );
+
+ if ( empty( $check ) ) {
+ $check = get_user_setting( 'imgsize', 'medium' );
+ }
+ $out = array();
+
+ foreach ( $size_names as $size => $label ) {
+ $downsize = image_downsize( $post->ID, $size );
+ $checked = '';
+
+ // Is this size selectable?
+ $enabled = ( $downsize[3] || 'full' == $size );
+ $css_id = "image-size-{$size}-{$post->ID}";
+
+ // If this size is the default but that's not available, don't select it.
+ if ( $size == $check ) {
+ if ( $enabled ) {
+ $checked = " checked='checked'";
+ } else {
+ $check = '';
+ }
+ } elseif ( ! $check && $enabled && 'thumbnail' != $size ) {
+ /*
+ * If $check is not enabled, default to the first available size
+ * that's bigger than a thumbnail.
+ */
+ $check = $size;
+ $checked = " checked='checked'";
+ }
+
+ $html = "<div class='image-size-item'><input type='radio' " . disabled( $enabled, false, false ) . "name='attachments[$post->ID][image-size]' id='{$css_id}' value='{$size}'$checked />";
+
+ $html .= "<label for='{$css_id}'>$label</label>";
+
+ // Only show the dimensions if that choice is available.
+ if ( $enabled ) {
+ $html .= " <label for='{$css_id}' class='help'>" . sprintf( '(%d&nbsp;&times;&nbsp;%d)', $downsize[1], $downsize[2] ) . '</label>';
+ }
+ $html .= '</div>';
+
+ $out[] = $html;
+ }
+
+ return array(
+ 'label' => __( 'Size' ),
+ 'input' => 'html',
+ 'html' => join( "\n", $out ),
+ );
+}
+
+/**
+ * Retrieve HTML for the Link URL buttons with the default link type as specified.
+ *
+ * @since 2.7.0
+ *
+ * @param WP_Post $post
+ * @param string $url_type
+ * @return string
+ */
+function image_link_input_fields( $post, $url_type = '' ) {
+
+ $file = wp_get_attachment_url( $post->ID );
+ $link = get_attachment_link( $post->ID );
+
+ if ( empty( $url_type ) ) {
+ $url_type = get_user_setting( 'urlbutton', 'post' );
+ }
+
+ $url = '';
+ if ( $url_type == 'file' ) {
+ $url = $file;
+ } elseif ( $url_type == 'post' ) {
+ $url = $link;
+ }
+
+ return "
+ <input type='text' class='text urlfield' name='attachments[$post->ID][url]' value='" . esc_attr( $url ) . "' /><br />
+ <button type='button' class='button urlnone' data-link-url=''>" . __( 'None' ) . "</button>
+ <button type='button' class='button urlfile' data-link-url='" . esc_attr( $file ) . "'>" . __( 'File URL' ) . "</button>
+ <button type='button' class='button urlpost' data-link-url='" . esc_attr( $link ) . "'>" . __( 'Attachment Post URL' ) . '</button>
+';
+}
+
+/**
+ * Output a textarea element for inputting an attachment caption.
+ *
+ * @since 3.4.0
+ *
+ * @param WP_Post $edit_post Attachment WP_Post object.
+ * @return string HTML markup for the textarea element.
+ */
+function wp_caption_input_textarea( $edit_post ) {
+ // Post data is already escaped.
+ $name = "attachments[{$edit_post->ID}][post_excerpt]";
+
+ return '<textarea name="' . $name . '" id="' . $name . '">' . $edit_post->post_excerpt . '</textarea>';
+}
+
+/**
+ * Retrieves the image attachment fields to edit form fields.
+ *
+ * @since 2.5.0
+ *
+ * @param array $form_fields
+ * @param object $post
+ * @return array
+ */
+function image_attachment_fields_to_edit( $form_fields, $post ) {
+ return $form_fields;
+}
+
+/**
+ * Retrieves the single non-image attachment fields to edit form fields.
+ *
+ * @since 2.5.0
+ *
+ * @param array $form_fields An array of attachment form fields.
+ * @param WP_Post $post The WP_Post attachment object.
+ * @return array Filtered attachment form fields.
+ */
+function media_single_attachment_fields_to_edit( $form_fields, $post ) {
+ unset( $form_fields['url'], $form_fields['align'], $form_fields['image-size'] );
+ return $form_fields;
+}
+
+/**
+ * Retrieves the post non-image attachment fields to edito form fields.
+ *
+ * @since 2.8.0
+ *
+ * @param array $form_fields An array of attachment form fields.
+ * @param WP_Post $post The WP_Post attachment object.
+ * @return array Filtered attachment form fields.
+ */
+function media_post_single_attachment_fields_to_edit( $form_fields, $post ) {
+ unset( $form_fields['image_url'] );
+ return $form_fields;
+}
+
+/**
+ * Filters input from media_upload_form_handler() and assigns a default
+ * post_title from the file name if none supplied.
+ *
+ * Illustrates the use of the {@see 'attachment_fields_to_save'} filter
+ * which can be used to add default values to any field before saving to DB.
+ *
+ * @since 2.5.0
+ *
+ * @param array $post The WP_Post attachment object converted to an array.
+ * @param array $attachment An array of attachment metadata.
+ * @return array Filtered attachment post object.
+ */
+function image_attachment_fields_to_save( $post, $attachment ) {
+ if ( substr( $post['post_mime_type'], 0, 5 ) == 'image' ) {
+ if ( strlen( trim( $post['post_title'] ) ) == 0 ) {
+ $attachment_url = ( isset( $post['attachment_url'] ) ) ? $post['attachment_url'] : $post['guid'];
+ $post['post_title'] = preg_replace( '/\.\w+$/', '', wp_basename( $attachment_url ) );
+ $post['errors']['post_title']['errors'][] = __( 'Empty Title filled from filename.' );
+ }
+ }
+
+ return $post;
+}
+
+/**
+ * Retrieves the media element HTML to send to the editor.
+ *
+ * @since 2.5.0
+ *
+ * @param string $html
+ * @param integer $attachment_id
+ * @param array $attachment
+ * @return string
+ */
+function image_media_send_to_editor( $html, $attachment_id, $attachment ) {
+ $post = get_post( $attachment_id );
+ if ( substr( $post->post_mime_type, 0, 5 ) == 'image' ) {
+ $url = $attachment['url'];
+ $align = ! empty( $attachment['align'] ) ? $attachment['align'] : 'none';
+ $size = ! empty( $attachment['image-size'] ) ? $attachment['image-size'] : 'medium';
+ $alt = ! empty( $attachment['image_alt'] ) ? $attachment['image_alt'] : '';
+ $rel = ( strpos( $url, 'attachment_id' ) || $url === get_attachment_link( $attachment_id ) );
+
+ return get_image_send_to_editor( $attachment_id, $attachment['post_excerpt'], $attachment['post_title'], $align, $url, $rel, $size, $alt );
+ }
+
+ return $html;
+}
+
+/**
+ * Retrieves the attachment fields to edit form fields.
+ *
+ * @since 2.5.0
+ *
+ * @param WP_Post $post
+ * @param array $errors
+ * @return array
+ */
+function get_attachment_fields_to_edit( $post, $errors = null ) {
+ if ( is_int( $post ) ) {
+ $post = get_post( $post );
+ }
+ if ( is_array( $post ) ) {
+ $post = new WP_Post( (object) $post );
+ }
+
+ $image_url = wp_get_attachment_url( $post->ID );
+
+ $edit_post = sanitize_post( $post, 'edit' );
+
+ $form_fields = array(
+ 'post_title' => array(
+ 'label' => __( 'Title' ),
+ 'value' => $edit_post->post_title,
+ ),
+ 'image_alt' => array(),
+ 'post_excerpt' => array(
+ 'label' => __( 'Caption' ),
+ 'input' => 'html',
+ 'html' => wp_caption_input_textarea( $edit_post ),
+ ),
+ 'post_content' => array(
+ 'label' => __( 'Description' ),
+ 'value' => $edit_post->post_content,
+ 'input' => 'textarea',
+ ),
+ 'url' => array(
+ 'label' => __( 'Link URL' ),
+ 'input' => 'html',
+ 'html' => image_link_input_fields( $post, get_option( 'image_default_link_type' ) ),
+ 'helps' => __( 'Enter a link URL or click above for presets.' ),
+ ),
+ 'menu_order' => array(
+ 'label' => __( 'Order' ),
+ 'value' => $edit_post->menu_order,
+ ),
+ 'image_url' => array(
+ 'label' => __( 'File URL' ),
+ 'input' => 'html',
+ 'html' => "<input type='text' class='text urlfield' readonly='readonly' name='attachments[$post->ID][url]' value='" . esc_attr( $image_url ) . "' /><br />",
+ 'value' => wp_get_attachment_url( $post->ID ),
+ 'helps' => __( 'Location of the uploaded file.' ),
+ ),
+ );
+
+ foreach ( get_attachment_taxonomies( $post ) as $taxonomy ) {
+ $t = (array) get_taxonomy( $taxonomy );
+ if ( ! $t['public'] || ! $t['show_ui'] ) {
+ continue;
+ }
+ if ( empty( $t['label'] ) ) {
+ $t['label'] = $taxonomy;
+ }
+ if ( empty( $t['args'] ) ) {
+ $t['args'] = array();
+ }
+
+ $terms = get_object_term_cache( $post->ID, $taxonomy );
+ if ( false === $terms ) {
+ $terms = wp_get_object_terms( $post->ID, $taxonomy, $t['args'] );
+ }
+
+ $values = array();
+
+ foreach ( $terms as $term ) {
+ $values[] = $term->slug;
+ }
+ $t['value'] = join( ', ', $values );
+
+ $form_fields[ $taxonomy ] = $t;
+ }
+
+ // Merge default fields with their errors, so any key passed with the error (e.g. 'error', 'helps', 'value') will replace the default
+ // The recursive merge is easily traversed with array casting: foreach ( (array) $things as $thing )
+ $form_fields = array_merge_recursive( $form_fields, (array) $errors );
+
+ // This was formerly in image_attachment_fields_to_edit().
+ if ( substr( $post->post_mime_type, 0, 5 ) == 'image' ) {
+ $alt = get_post_meta( $post->ID, '_wp_attachment_image_alt', true );
+ if ( empty( $alt ) ) {
+ $alt = '';
+ }
+
+ $form_fields['post_title']['required'] = true;
+
+ $form_fields['image_alt'] = array(
+ 'value' => $alt,
+ 'label' => __( 'Alternative Text' ),
+ 'helps' => __( 'Alt text for the image, e.g. &#8220;The Mona Lisa&#8221;' ),
+ );
+
+ $form_fields['align'] = array(
+ 'label' => __( 'Alignment' ),
+ 'input' => 'html',
+ 'html' => image_align_input_fields( $post, get_option( 'image_default_align' ) ),
+ );
+
+ $form_fields['image-size'] = image_size_input_fields( $post, get_option( 'image_default_size', 'medium' ) );
+
+ } else {
+ unset( $form_fields['image_alt'] );
+ }
+
+ /**
+ * Filters the attachment fields to edit.
+ *
+ * @since 2.5.0
+ *
+ * @param array $form_fields An array of attachment form fields.
+ * @param WP_Post $post The WP_Post attachment object.
+ */
+ $form_fields = apply_filters( 'attachment_fields_to_edit', $form_fields, $post );
+
+ return $form_fields;
+}
+
+/**
+ * Retrieve HTML for media items of post gallery.
+ *
+ * The HTML markup retrieved will be created for the progress of SWF Upload
+ * component. Will also create link for showing and hiding the form to modify
+ * the image attachment.
+ *
+ * @since 2.5.0
+ *
+ * @global WP_Query $wp_the_query
+ *
+ * @param int $post_id Optional. Post ID.
+ * @param array $errors Errors for attachment, if any.
+ * @return string
+ */
+function get_media_items( $post_id, $errors ) {
+ $attachments = array();
+ if ( $post_id ) {
+ $post = get_post( $post_id );
+ if ( $post && $post->post_type == 'attachment' ) {
+ $attachments = array( $post->ID => $post );
+ } else {
+ $attachments = get_children(
+ array(
+ 'post_parent' => $post_id,
+ 'post_type' => 'attachment',
+ 'orderby' => 'menu_order ASC, ID',
+ 'order' => 'DESC',
+ )
+ );
+ }
+ } else {
+ if ( is_array( $GLOBALS['wp_the_query']->posts ) ) {
+ foreach ( $GLOBALS['wp_the_query']->posts as $attachment ) {
+ $attachments[ $attachment->ID ] = $attachment;
+ }
+ }
+ }
+
+ $output = '';
+ foreach ( (array) $attachments as $id => $attachment ) {
+ if ( $attachment->post_status == 'trash' ) {
+ continue;
+ }
+ if ( $item = get_media_item( $id, array( 'errors' => isset( $errors[ $id ] ) ? $errors[ $id ] : null ) ) ) {
+ $output .= "\n<div id='media-item-$id' class='media-item child-of-$attachment->post_parent preloaded'><div class='progress hidden'><div class='bar'></div></div><div id='media-upload-error-$id' class='hidden'></div><div class='filename hidden'></div>$item\n</div>";
+ }
+ }
+
+ return $output;
+}
+
+/**
+ * Retrieve HTML form for modifying the image attachment.
+ *
+ * @since 2.5.0
+ *
+ * @global string $redir_tab
+ *
+ * @param int $attachment_id Attachment ID for modification.
+ * @param string|array $args Optional. Override defaults.
+ * @return string HTML form for attachment.
+ */
+function get_media_item( $attachment_id, $args = null ) {
+ global $redir_tab;
+
+ if ( ( $attachment_id = intval( $attachment_id ) ) && $thumb_url = wp_get_attachment_image_src( $attachment_id, 'thumbnail', true ) ) {
+ $thumb_url = $thumb_url[0];
+ } else {
+ $thumb_url = false;
+ }
+
+ $post = get_post( $attachment_id );
+ $current_post_id = ! empty( $_GET['post_id'] ) ? (int) $_GET['post_id'] : 0;
+
+ $default_args = array(
+ 'errors' => null,
+ 'send' => $current_post_id ? post_type_supports( get_post_type( $current_post_id ), 'editor' ) : true,
+ 'delete' => true,
+ 'toggle' => true,
+ 'show_title' => true,
+ );
+ $args = wp_parse_args( $args, $default_args );
+
+ /**
+ * Filters the arguments used to retrieve an image for the edit image form.
+ *
+ * @since 3.1.0
+ *
+ * @see get_media_item
+ *
+ * @param array $args An array of arguments.
+ */
+ $r = apply_filters( 'get_media_item_args', $args );
+
+ $toggle_on = __( 'Show' );
+ $toggle_off = __( 'Hide' );
+
+ $file = get_attached_file( $post->ID );
+ $filename = esc_html( wp_basename( $file ) );
+ $title = esc_attr( $post->post_title );
+
+ $post_mime_types = get_post_mime_types();
+ $keys = array_keys( wp_match_mime_types( array_keys( $post_mime_types ), $post->post_mime_type ) );
+ $type = reset( $keys );
+ $type_html = "<input type='hidden' id='type-of-$attachment_id' value='" . esc_attr( $type ) . "' />";
+
+ $form_fields = get_attachment_fields_to_edit( $post, $r['errors'] );
+
+ if ( $r['toggle'] ) {
+ $class = empty( $r['errors'] ) ? 'startclosed' : 'startopen';
+ $toggle_links = "
+ <a class='toggle describe-toggle-on' href='#'>$toggle_on</a>
+ <a class='toggle describe-toggle-off' href='#'>$toggle_off</a>";
+ } else {
+ $class = '';
+ $toggle_links = '';
+ }
+
+ $display_title = ( ! empty( $title ) ) ? $title : $filename; // $title shouldn't ever be empty, but just in case
+ $display_title = $r['show_title'] ? "<div class='filename new'><span class='title'>" . wp_html_excerpt( $display_title, 60, '&hellip;' ) . '</span></div>' : '';
+
+ $gallery = ( ( isset( $_REQUEST['tab'] ) && 'gallery' == $_REQUEST['tab'] ) || ( isset( $redir_tab ) && 'gallery' == $redir_tab ) );
+ $order = '';
+
+ foreach ( $form_fields as $key => $val ) {
+ if ( 'menu_order' == $key ) {
+ if ( $gallery ) {
+ $order = "<div class='menu_order'> <input class='menu_order_input' type='text' id='attachments[$attachment_id][menu_order]' name='attachments[$attachment_id][menu_order]' value='" . esc_attr( $val['value'] ) . "' /></div>";
+ } else {
+ $order = "<input type='hidden' name='attachments[$attachment_id][menu_order]' value='" . esc_attr( $val['value'] ) . "' />";
+ }
+
+ unset( $form_fields['menu_order'] );
+ break;
+ }
+ }
+
+ $media_dims = '';
+ $meta = wp_get_attachment_metadata( $post->ID );
+ if ( isset( $meta['width'], $meta['height'] ) ) {
+ $media_dims .= "<span id='media-dims-$post->ID'>{$meta['width']}&nbsp;&times;&nbsp;{$meta['height']}</span> ";
+ }
+
+ /**
+ * Filters the media metadata.
+ *
+ * @since 2.5.0
+ *
+ * @param string $media_dims The HTML markup containing the media dimensions.
+ * @param WP_Post $post The WP_Post attachment object.
+ */
+ $media_dims = apply_filters( 'media_meta', $media_dims, $post );
+
+ $image_edit_button = '';
+ if ( wp_attachment_is_image( $post->ID ) && wp_image_editor_supports( array( 'mime_type' => $post->post_mime_type ) ) ) {
+ $nonce = wp_create_nonce( "image_editor-$post->ID" );
+ $image_edit_button = "<input type='button' id='imgedit-open-btn-$post->ID' onclick='imageEdit.open( $post->ID, \"$nonce\" )' class='button' value='" . esc_attr__( 'Edit Image' ) . "' /> <span class='spinner'></span>";
+ }
+
+ $attachment_url = get_permalink( $attachment_id );
+
+ $item = "
+ $type_html
+ $toggle_links
+ $order
+ $display_title
+ <table class='slidetoggle describe $class'>
+ <thead class='media-item-info' id='media-head-$post->ID'>
+ <tr>
+ <td class='A1B1' id='thumbnail-head-$post->ID'>
+ <p><a href='$attachment_url' target='_blank'><img class='thumbnail' src='$thumb_url' alt='' /></a></p>
+ <p>$image_edit_button</p>
+ </td>
+ <td>
+ <p><strong>" . __( 'File name:' ) . "</strong> $filename</p>
+ <p><strong>" . __( 'File type:' ) . "</strong> $post->post_mime_type</p>
+ <p><strong>" . __( 'Upload date:' ) . '</strong> ' . mysql2date( __( 'F j, Y' ), $post->post_date ) . '</p>';
+ if ( ! empty( $media_dims ) ) {
+ $item .= '<p><strong>' . __( 'Dimensions:' ) . "</strong> $media_dims</p>\n";
+ }
+
+ $item .= "</td></tr>\n";
+
+ $item .= "
+ </thead>
+ <tbody>
+ <tr><td colspan='2' class='imgedit-response' id='imgedit-response-$post->ID'></td></tr>\n
+ <tr><td style='display:none' colspan='2' class='image-editor' id='image-editor-$post->ID'></td></tr>\n
+ <tr><td colspan='2'><p class='media-types media-types-required-info'>" . sprintf( __( 'Required fields are marked %s' ), '<span class="required">*</span>' ) . "</p></td></tr>\n";
+
+ $defaults = array(
+ 'input' => 'text',
+ 'required' => false,
+ 'value' => '',
+ 'extra_rows' => array(),
+ );
+
+ if ( $r['send'] ) {
+ $r['send'] = get_submit_button( __( 'Insert into Post' ), '', "send[$attachment_id]", false );
+ }
+
+ $delete = empty( $r['delete'] ) ? '' : $r['delete'];
+ if ( $delete && current_user_can( 'delete_post', $attachment_id ) ) {
+ if ( ! EMPTY_TRASH_DAYS ) {
+ $delete = "<a href='" . wp_nonce_url( "post.php?action=delete&amp;post=$attachment_id", 'delete-post_' . $attachment_id ) . "' id='del[$attachment_id]' class='delete-permanently'>" . __( 'Delete Permanently' ) . '</a>';
+ } elseif ( ! MEDIA_TRASH ) {
+ $delete = "<a href='#' class='del-link' onclick=\"document.getElementById('del_attachment_$attachment_id').style.display='block';return false;\">" . __( 'Delete' ) . "</a>
+ <div id='del_attachment_$attachment_id' class='del-attachment' style='display:none;'>" .
+ /* translators: %s: file name */
+ '<p>' . sprintf( __( 'You are about to delete %s.' ), '<strong>' . $filename . '</strong>' ) . "</p>
+ <a href='" . wp_nonce_url( "post.php?action=delete&amp;post=$attachment_id", 'delete-post_' . $attachment_id ) . "' id='del[$attachment_id]' class='button'>" . __( 'Continue' ) . "</a>
+ <a href='#' class='button' onclick=\"this.parentNode.style.display='none';return false;\">" . __( 'Cancel' ) . '</a>
+ </div>';
+ } else {
+ $delete = "<a href='" . wp_nonce_url( "post.php?action=trash&amp;post=$attachment_id", 'trash-post_' . $attachment_id ) . "' id='del[$attachment_id]' class='delete'>" . __( 'Move to Trash' ) . "</a>
+ <a href='" . wp_nonce_url( "post.php?action=untrash&amp;post=$attachment_id", 'untrash-post_' . $attachment_id ) . "' id='undo[$attachment_id]' class='undo hidden'>" . __( 'Undo' ) . '</a>';
+ }
+ } else {
+ $delete = '';
+ }
+
+ $thumbnail = '';
+ $calling_post_id = 0;
+ if ( isset( $_GET['post_id'] ) ) {
+ $calling_post_id = absint( $_GET['post_id'] );
+ } elseif ( isset( $_POST ) && count( $_POST ) ) {// Like for async-upload where $_GET['post_id'] isn't set
+ $calling_post_id = $post->post_parent;
+ }
+ if ( 'image' == $type && $calling_post_id && current_theme_supports( 'post-thumbnails', get_post_type( $calling_post_id ) )
+ && post_type_supports( get_post_type( $calling_post_id ), 'thumbnail' ) && get_post_thumbnail_id( $calling_post_id ) != $attachment_id ) {
+
+ $calling_post = get_post( $calling_post_id );
+ $calling_post_type_object = get_post_type_object( $calling_post->post_type );
+
+ $ajax_nonce = wp_create_nonce( "set_post_thumbnail-$calling_post_id" );
+ $thumbnail = "<a class='wp-post-thumbnail' id='wp-post-thumbnail-" . $attachment_id . "' href='#' onclick='WPSetAsThumbnail(\"$attachment_id\", \"$ajax_nonce\");return false;'>" . esc_html( $calling_post_type_object->labels->use_featured_image ) . '</a>';
+ }
+
+ if ( ( $r['send'] || $thumbnail || $delete ) && ! isset( $form_fields['buttons'] ) ) {
+ $form_fields['buttons'] = array( 'tr' => "\t\t<tr class='submit'><td></td><td class='savesend'>" . $r['send'] . " $thumbnail $delete</td></tr>\n" );
+ }
+ $hidden_fields = array();
+
+ foreach ( $form_fields as $id => $field ) {
+ if ( $id[0] == '_' ) {
+ continue;
+ }
+
+ if ( ! empty( $field['tr'] ) ) {
+ $item .= $field['tr'];
+ continue;
+ }
+
+ $field = array_merge( $defaults, $field );
+ $name = "attachments[$attachment_id][$id]";
+
+ if ( $field['input'] == 'hidden' ) {
+ $hidden_fields[ $name ] = $field['value'];
+ continue;
+ }
+
+ $required = $field['required'] ? '<span class="required">*</span>' : '';
+ $required_attr = $field['required'] ? ' required' : '';
+ $class = $id;
+ $class .= $field['required'] ? ' form-required' : '';
+
+ $item .= "\t\t<tr class='$class'>\n\t\t\t<th scope='row' class='label'><label for='$name'><span class='alignleft'>{$field['label']}{$required}</span><br class='clear' /></label></th>\n\t\t\t<td class='field'>";
+ if ( ! empty( $field[ $field['input'] ] ) ) {
+ $item .= $field[ $field['input'] ];
+ } elseif ( $field['input'] == 'textarea' ) {
+ if ( 'post_content' == $id && user_can_richedit() ) {
+ // Sanitize_post() skips the post_content when user_can_richedit.
+ $field['value'] = htmlspecialchars( $field['value'], ENT_QUOTES );
+ }
+ // Post_excerpt is already escaped by sanitize_post() in get_attachment_fields_to_edit().
+ $item .= "<textarea id='$name' name='$name'{$required_attr}>" . $field['value'] . '</textarea>';
+ } else {
+ $item .= "<input type='text' class='text' id='$name' name='$name' value='" . esc_attr( $field['value'] ) . "'{$required_attr} />";
+ }
+ if ( ! empty( $field['helps'] ) ) {
+ $item .= "<p class='help'>" . join( "</p>\n<p class='help'>", array_unique( (array) $field['helps'] ) ) . '</p>';
+ }
+ $item .= "</td>\n\t\t</tr>\n";
+
+ $extra_rows = array();
+
+ if ( ! empty( $field['errors'] ) ) {
+ foreach ( array_unique( (array) $field['errors'] ) as $error ) {
+ $extra_rows['error'][] = $error;
+ }
+ }
+
+ if ( ! empty( $field['extra_rows'] ) ) {
+ foreach ( $field['extra_rows'] as $class => $rows ) {
+ foreach ( (array) $rows as $html ) {
+ $extra_rows[ $class ][] = $html;
+ }
+ }
+ }
+
+ foreach ( $extra_rows as $class => $rows ) {
+ foreach ( $rows as $html ) {
+ $item .= "\t\t<tr><td></td><td class='$class'>$html</td></tr>\n";
+ }
+ }
+ }
+
+ if ( ! empty( $form_fields['_final'] ) ) {
+ $item .= "\t\t<tr class='final'><td colspan='2'>{$form_fields['_final']}</td></tr>\n";
+ }
+ $item .= "\t</tbody>\n";
+ $item .= "\t</table>\n";
+
+ foreach ( $hidden_fields as $name => $value ) {
+ $item .= "\t<input type='hidden' name='$name' id='$name' value='" . esc_attr( $value ) . "' />\n";
+ }
+
+ if ( $post->post_parent < 1 && isset( $_REQUEST['post_id'] ) ) {
+ $parent = (int) $_REQUEST['post_id'];
+ $parent_name = "attachments[$attachment_id][post_parent]";
+ $item .= "\t<input type='hidden' name='$parent_name' id='$parent_name' value='$parent' />\n";
+ }
+
+ return $item;
+}
+
+/**
+ * @since 3.5.0
+ *
+ * @param int $attachment_id
+ * @param array $args
+ * @return array
+ */
+function get_compat_media_markup( $attachment_id, $args = null ) {
+ $post = get_post( $attachment_id );
+
+ $default_args = array(
+ 'errors' => null,
+ 'in_modal' => false,
+ );
+
+ $user_can_edit = current_user_can( 'edit_post', $attachment_id );
+
+ $args = wp_parse_args( $args, $default_args );
+
+ /** This filter is documented in wp-admin/includes/media.php */
+ $args = apply_filters( 'get_media_item_args', $args );
+
+ $form_fields = array();
+
+ if ( $args['in_modal'] ) {
+ foreach ( get_attachment_taxonomies( $post ) as $taxonomy ) {
+ $t = (array) get_taxonomy( $taxonomy );
+ if ( ! $t['public'] || ! $t['show_ui'] ) {
+ continue;
+ }
+ if ( empty( $t['label'] ) ) {
+ $t['label'] = $taxonomy;
+ }
+ if ( empty( $t['args'] ) ) {
+ $t['args'] = array();
+ }
+
+ $terms = get_object_term_cache( $post->ID, $taxonomy );
+ if ( false === $terms ) {
+ $terms = wp_get_object_terms( $post->ID, $taxonomy, $t['args'] );
+ }
+
+ $values = array();
+
+ foreach ( $terms as $term ) {
+ $values[] = $term->slug;
+ }
+ $t['value'] = join( ', ', $values );
+ $t['taxonomy'] = true;
+
+ $form_fields[ $taxonomy ] = $t;
+ }
+ }
+
+ // Merge default fields with their errors, so any key passed with the error (e.g. 'error', 'helps', 'value') will replace the default
+ // The recursive merge is easily traversed with array casting: foreach ( (array) $things as $thing )
+ $form_fields = array_merge_recursive( $form_fields, (array) $args['errors'] );
+
+ /** This filter is documented in wp-admin/includes/media.php */
+ $form_fields = apply_filters( 'attachment_fields_to_edit', $form_fields, $post );
+
+ unset(
+ $form_fields['image-size'],
+ $form_fields['align'],
+ $form_fields['image_alt'],
+ $form_fields['post_title'],
+ $form_fields['post_excerpt'],
+ $form_fields['post_content'],
+ $form_fields['url'],
+ $form_fields['menu_order'],
+ $form_fields['image_url']
+ );
+
+ /** This filter is documented in wp-admin/includes/media.php */
+ $media_meta = apply_filters( 'media_meta', '', $post );
+
+ $defaults = array(
+ 'input' => 'text',
+ 'required' => false,
+ 'value' => '',
+ 'extra_rows' => array(),
+ 'show_in_edit' => true,
+ 'show_in_modal' => true,
+ );
+
+ $hidden_fields = array();
+
+ $item = '';
+ foreach ( $form_fields as $id => $field ) {
+ if ( $id[0] == '_' ) {
+ continue;
+ }
+
+ $name = "attachments[$attachment_id][$id]";
+ $id_attr = "attachments-$attachment_id-$id";
+
+ if ( ! empty( $field['tr'] ) ) {
+ $item .= $field['tr'];
+ continue;
+ }
+
+ $field = array_merge( $defaults, $field );
+
+ if ( ( ! $field['show_in_edit'] && ! $args['in_modal'] ) || ( ! $field['show_in_modal'] && $args['in_modal'] ) ) {
+ continue;
+ }
+
+ if ( $field['input'] == 'hidden' ) {
+ $hidden_fields[ $name ] = $field['value'];
+ continue;
+ }
+
+ $readonly = ! $user_can_edit && ! empty( $field['taxonomy'] ) ? " readonly='readonly' " : '';
+ $required = $field['required'] ? '<span class="required">*</span>' : '';
+ $required_attr = $field['required'] ? ' required' : '';
+ $class = 'compat-field-' . $id;
+ $class .= $field['required'] ? ' form-required' : '';
+
+ $item .= "\t\t<tr class='$class'>";
+ $item .= "\t\t\t<th scope='row' class='label'><label for='$id_attr'><span class='alignleft'>{$field['label']}</span>$required<br class='clear' /></label>";
+ $item .= "</th>\n\t\t\t<td class='field'>";
+
+ if ( ! empty( $field[ $field['input'] ] ) ) {
+ $item .= $field[ $field['input'] ];
+ } elseif ( $field['input'] == 'textarea' ) {
+ if ( 'post_content' == $id && user_can_richedit() ) {
+ // sanitize_post() skips the post_content when user_can_richedit.
+ $field['value'] = htmlspecialchars( $field['value'], ENT_QUOTES );
+ }
+ $item .= "<textarea id='$id_attr' name='$name'{$required_attr}>" . $field['value'] . '</textarea>';
+ } else {
+ $item .= "<input type='text' class='text' id='$id_attr' name='$name' value='" . esc_attr( $field['value'] ) . "' $readonly{$required_attr} />";
+ }
+ if ( ! empty( $field['helps'] ) ) {
+ $item .= "<p class='help'>" . join( "</p>\n<p class='help'>", array_unique( (array) $field['helps'] ) ) . '</p>';
+ }
+ $item .= "</td>\n\t\t</tr>\n";
+
+ $extra_rows = array();
+
+ if ( ! empty( $field['errors'] ) ) {
+ foreach ( array_unique( (array) $field['errors'] ) as $error ) {
+ $extra_rows['error'][] = $error;
+ }
+ }
+
+ if ( ! empty( $field['extra_rows'] ) ) {
+ foreach ( $field['extra_rows'] as $class => $rows ) {
+ foreach ( (array) $rows as $html ) {
+ $extra_rows[ $class ][] = $html;
+ }
+ }
+ }
+
+ foreach ( $extra_rows as $class => $rows ) {
+ foreach ( $rows as $html ) {
+ $item .= "\t\t<tr><td></td><td class='$class'>$html</td></tr>\n";
+ }
+ }
+ }
+
+ if ( ! empty( $form_fields['_final'] ) ) {
+ $item .= "\t\t<tr class='final'><td colspan='2'>{$form_fields['_final']}</td></tr>\n";
+ }
+
+ if ( $item ) {
+ $item = '<p class="media-types media-types-required-info">' .
+ sprintf( __( 'Required fields are marked %s' ), '<span class="required">*</span>' ) . '</p>
+ <table class="compat-attachment-fields">' . $item . '</table>';
+ }
+
+ foreach ( $hidden_fields as $hidden_field => $value ) {
+ $item .= '<input type="hidden" name="' . esc_attr( $hidden_field ) . '" value="' . esc_attr( $value ) . '" />' . "\n";
+ }
+
+ if ( $item ) {
+ $item = '<input type="hidden" name="attachments[' . $attachment_id . '][menu_order]" value="' . esc_attr( $post->menu_order ) . '" />' . $item;
+ }
+
+ return array(
+ 'item' => $item,
+ 'meta' => $media_meta,
+ );
+}
+
+/**
+ * Outputs the legacy media upload header.
+ *
+ * @since 2.5.0
+ */
+function media_upload_header() {
+ $post_id = isset( $_REQUEST['post_id'] ) ? intval( $_REQUEST['post_id'] ) : 0;
+
+ echo '<script type="text/javascript">post_id = ' . $post_id . ';</script>';
+ if ( empty( $_GET['chromeless'] ) ) {
+ echo '<div id="media-upload-header">';
+ the_media_upload_tabs();
+ echo '</div>';
+ }
+}
+
+/**
+ * Outputs the legacy media upload form.
+ *
+ * @since 2.5.0
+ *
+ * @global string $type
+ * @global string $tab
+ * @global bool $is_IE
+ * @global bool $is_opera
+ *
+ * @param array $errors
+ */
+function media_upload_form( $errors = null ) {
+ global $type, $tab, $is_IE, $is_opera;
+
+ if ( ! _device_can_upload() ) {
+ echo '<p>' . sprintf( __( 'The web browser on your device cannot be used to upload files. You may be able to use the <a href="%s">native app for your device</a> instead.' ), 'https://apps.wordpress.org/' ) . '</p>';
+ return;
+ }
+
+ $upload_action_url = admin_url( 'async-upload.php' );
+ $post_id = isset( $_REQUEST['post_id'] ) ? intval( $_REQUEST['post_id'] ) : 0;
+ $_type = isset( $type ) ? $type : '';
+ $_tab = isset( $tab ) ? $tab : '';
+
+ $max_upload_size = wp_max_upload_size();
+ if ( ! $max_upload_size ) {
+ $max_upload_size = 0;
+ }
+ ?>
+
+<div id="media-upload-notice">
+ <?php
+
+ if ( isset( $errors['upload_notice'] ) ) {
+ echo $errors['upload_notice'];
+ }
+
+ ?>
+</div>
+<div id="media-upload-error">
+ <?php
+
+ if ( isset( $errors['upload_error'] ) && is_wp_error( $errors['upload_error'] ) ) {
+ echo $errors['upload_error']->get_error_message();
+ }
+
+ ?>
+</div>
+ <?php
+ if ( is_multisite() && ! is_upload_space_available() ) {
+ /**
+ * Fires when an upload will exceed the defined upload space quota for a network site.
+ *
+ * @since 3.5.0
+ */
+ do_action( 'upload_ui_over_quota' );
+ return;
+ }
+
+ /**
+ * Fires just before the legacy (pre-3.5.0) upload interface is loaded.
+ *
+ * @since 2.6.0
+ */
+ do_action( 'pre-upload-ui' );
+
+ $post_params = array(
+ 'post_id' => $post_id,
+ '_wpnonce' => wp_create_nonce( 'media-form' ),
+ 'type' => $_type,
+ 'tab' => $_tab,
+ 'short' => '1',
+ );
+
+ /**
+ * Filters the media upload post parameters.
+ *
+ * @since 3.1.0 As 'swfupload_post_params'
+ * @since 3.3.0
+ *
+ * @param array $post_params An array of media upload parameters used by Plupload.
+ */
+ $post_params = apply_filters( 'upload_post_params', $post_params );
+
+ /*
+ * Since 4.9 the `runtimes` setting is hardcoded in our version of Plupload to `html5,html4`,
+ * and the `flash_swf_url` and `silverlight_xap_url` are not used.
+ */
+ $plupload_init = array(
+ 'browse_button' => 'plupload-browse-button',
+ 'container' => 'plupload-upload-ui',
+ 'drop_element' => 'drag-drop-area',
+ 'file_data_name' => 'async-upload',
+ 'url' => $upload_action_url,
+ 'filters' => array(
+ 'max_file_size' => $max_upload_size . 'b',
+ ),
+ 'multipart_params' => $post_params,
+ );
+
+ // Currently only iOS Safari supports multiple files uploading but iOS 7.x has a bug that prevents uploading of videos
+ // when enabled. See #29602.
+ if ( wp_is_mobile() && strpos( $_SERVER['HTTP_USER_AGENT'], 'OS 7_' ) !== false &&
+ strpos( $_SERVER['HTTP_USER_AGENT'], 'like Mac OS X' ) !== false ) {
+
+ $plupload_init['multi_selection'] = false;
+ }
+
+ /**
+ * Filters the default Plupload settings.
+ *
+ * @since 3.3.0
+ *
+ * @param array $plupload_init An array of default settings used by Plupload.
+ */
+ $plupload_init = apply_filters( 'plupload_init', $plupload_init );
+
+ ?>
+
+<script type="text/javascript">
+ <?php
+ // Verify size is an int. If not return default value.
+ $large_size_h = absint( get_option( 'large_size_h' ) );
+ if ( ! $large_size_h ) {
+ $large_size_h = 1024;
+ }
+ $large_size_w = absint( get_option( 'large_size_w' ) );
+ if ( ! $large_size_w ) {
+ $large_size_w = 1024;
+ }
+ ?>
+var resize_height = <?php echo $large_size_h; ?>, resize_width = <?php echo $large_size_w; ?>,
+wpUploaderInit = <?php echo wp_json_encode( $plupload_init ); ?>;
+</script>
+
+<div id="plupload-upload-ui" class="hide-if-no-js">
+ <?php
+ /**
+ * Fires before the upload interface loads.
+ *
+ * @since 2.6.0 As 'pre-flash-upload-ui'
+ * @since 3.3.0
+ */
+ do_action( 'pre-plupload-upload-ui' );
+ ?>
+<div id="drag-drop-area">
+ <div class="drag-drop-inside">
+ <p class="drag-drop-info"><?php _e( 'Drop files here' ); ?></p>
+ <p><?php _ex( 'or', 'Uploader: Drop files here - or - Select Files' ); ?></p>
+ <p class="drag-drop-buttons"><input id="plupload-browse-button" type="button" value="<?php esc_attr_e( 'Select Files' ); ?>" class="button" /></p>
+ </div>
+</div>
+ <?php
+ /**
+ * Fires after the upload interface loads.
+ *
+ * @since 2.6.0 As 'post-flash-upload-ui'
+ * @since 3.3.0
+ */
+ do_action( 'post-plupload-upload-ui' );
+ ?>
+</div>
+
+<div id="html-upload-ui" class="hide-if-js">
+ <?php
+ /**
+ * Fires before the upload button in the media upload interface.
+ *
+ * @since 2.6.0
+ */
+ do_action( 'pre-html-upload-ui' );
+ ?>
+ <p id="async-upload-wrap">
+ <label class="screen-reader-text" for="async-upload"><?php _e( 'Upload' ); ?></label>
+ <input type="file" name="async-upload" id="async-upload" />
+ <?php submit_button( __( 'Upload' ), 'primary', 'html-upload', false ); ?>
+ <a href="#" onclick="try{top.tb_remove();}catch(e){}; return false;"><?php _e( 'Cancel' ); ?></a>
+ </p>
+ <div class="clear"></div>
+ <?php
+ /**
+ * Fires after the upload button in the media upload interface.
+ *
+ * @since 2.6.0
+ */
+ do_action( 'post-html-upload-ui' );
+ ?>
+</div>
+
+<p class="max-upload-size"><?php printf( __( 'Maximum upload file size: %s.' ), esc_html( size_format( $max_upload_size ) ) ); ?></p>
+ <?php
+
+ /**
+ * Fires on the post upload UI screen.
+ *
+ * Legacy (pre-3.5.0) media workflow hook.
+ *
+ * @since 2.6.0
+ */
+ do_action( 'post-upload-ui' );
+}
+
+/**
+ * Outputs the legacy media upload form for a given media type.
+ *
+ * @since 2.5.0
+ *
+ * @param string $type
+ * @param object $errors
+ * @param integer $id
+ */
+function media_upload_type_form( $type = 'file', $errors = null, $id = null ) {
+
+ media_upload_header();
+
+ $post_id = isset( $_REQUEST['post_id'] ) ? intval( $_REQUEST['post_id'] ) : 0;
+
+ $form_action_url = admin_url( "media-upload.php?type=$type&tab=type&post_id=$post_id" );
+
+ /**
+ * Filters the media upload form action URL.
+ *
+ * @since 2.6.0
+ *
+ * @param string $form_action_url The media upload form action URL.
+ * @param string $type The type of media. Default 'file'.
+ */
+ $form_action_url = apply_filters( 'media_upload_form_url', $form_action_url, $type );
+ $form_class = 'media-upload-form type-form validate';
+
+ if ( get_user_setting( 'uploader' ) ) {
+ $form_class .= ' html-uploader';
+ }
+ ?>
+
+<form enctype="multipart/form-data" method="post" action="<?php echo esc_url( $form_action_url ); ?>" class="<?php echo $form_class; ?>" id="<?php echo $type; ?>-form">
+ <?php submit_button( '', 'hidden', 'save', false ); ?>
+<input type="hidden" name="post_id" id="post_id" value="<?php echo (int) $post_id; ?>" />
+ <?php wp_nonce_field( 'media-form' ); ?>
+
+<h3 class="media-title"><?php _e( 'Add media files from your computer' ); ?></h3>
+
+ <?php media_upload_form( $errors ); ?>
+
+<script type="text/javascript">
+jQuery(function($){
+ var preloaded = $(".media-item.preloaded");
+ if ( preloaded.length > 0 ) {
+ preloaded.each(function(){prepareMediaItem({id:this.id.replace(/[^0-9]/g, '')},'');});
+ }
+ updateMediaForm();
+});
+</script>
+<div id="media-items">
+ <?php
+
+ if ( $id ) {
+ if ( ! is_wp_error( $id ) ) {
+ add_filter( 'attachment_fields_to_edit', 'media_post_single_attachment_fields_to_edit', 10, 2 );
+ echo get_media_items( $id, $errors );
+ } else {
+ echo '<div id="media-upload-error">' . esc_html( $id->get_error_message() ) . '</div></div>';
+ exit;
+ }
+ }
+ ?>
+</div>
+
+<p class="savebutton ml-submit">
+ <?php submit_button( __( 'Save all changes' ), '', 'save', false ); ?>
+</p>
+</form>
+ <?php
+}
+
+/**
+ * Outputs the legacy media upload form for external media.
+ *
+ * @since 2.7.0
+ *
+ * @param string $type
+ * @param object $errors
+ * @param integer $id
+ */
+function media_upload_type_url_form( $type = null, $errors = null, $id = null ) {
+ if ( null === $type ) {
+ $type = 'image';
+ }
+
+ media_upload_header();
+
+ $post_id = isset( $_REQUEST['post_id'] ) ? intval( $_REQUEST['post_id'] ) : 0;
+
+ $form_action_url = admin_url( "media-upload.php?type=$type&tab=type&post_id=$post_id" );
+ /** This filter is documented in wp-admin/includes/media.php */
+ $form_action_url = apply_filters( 'media_upload_form_url', $form_action_url, $type );
+ $form_class = 'media-upload-form type-form validate';
+
+ if ( get_user_setting( 'uploader' ) ) {
+ $form_class .= ' html-uploader';
+ }
+ ?>
+
+<form enctype="multipart/form-data" method="post" action="<?php echo esc_url( $form_action_url ); ?>" class="<?php echo $form_class; ?>" id="<?php echo $type; ?>-form">
+<input type="hidden" name="post_id" id="post_id" value="<?php echo (int) $post_id; ?>" />
+ <?php wp_nonce_field( 'media-form' ); ?>
+
+<h3 class="media-title"><?php _e( 'Insert media from another website' ); ?></h3>
+
+<script type="text/javascript">
+var addExtImage = {
+
+ width : '',
+ height : '',
+ align : 'alignnone',
+
+ insert : function() {
+ var t = this, html, f = document.forms[0], cls, title = '', alt = '', caption = '';
+
+ if ( '' == f.src.value || '' == t.width )
+ return false;
+
+ if ( f.alt.value )
+ alt = f.alt.value.replace(/'/g, '&#039;').replace(/"/g, '&quot;').replace(/</g, '&lt;').replace(/>/g, '&gt;');
+
+ <?php
+ /** This filter is documented in wp-admin/includes/media.php */
+ if ( ! apply_filters( 'disable_captions', '' ) ) {
+ ?>
+ if ( f.caption.value ) {
+ caption = f.caption.value.replace(/\r\n|\r/g, '\n');
+ caption = caption.replace(/<[a-zA-Z0-9]+( [^<>]+)?>/g, function(a){
+ return a.replace(/[\r\n\t]+/, ' ');
+ });
+
+ caption = caption.replace(/\s*\n\s*/g, '<br />');
+ }
+ <?php } ?>
+
+ cls = caption ? '' : ' class="'+t.align+'"';
+
+ html = '<img alt="'+alt+'" src="'+f.src.value+'"'+cls+' width="'+t.width+'" height="'+t.height+'" />';
+
+ if ( f.url.value ) {
+ url = f.url.value.replace(/'/g, '&#039;').replace(/"/g, '&quot;').replace(/</g, '&lt;').replace(/>/g, '&gt;');
+ html = '<a href="'+url+'">'+html+'</a>';
+ }
+
+ if ( caption )
+ html = '[caption id="" align="'+t.align+'" width="'+t.width+'"]'+html+caption+'[/caption]';
+
+ var win = window.dialogArguments || opener || parent || top;
+ win.send_to_editor(html);
+ return false;
+ },
+
+ resetImageData : function() {
+ var t = addExtImage;
+
+ t.width = t.height = '';
+ document.getElementById('go_button').style.color = '#bbb';
+ if ( ! document.forms[0].src.value )
+ document.getElementById('status_img').innerHTML = '';
+ else document.getElementById('status_img').innerHTML = '<img src="<?php echo esc_url( admin_url( 'images/no.png' ) ); ?>" alt="" />';
+ },
+
+ updateImageData : function() {
+ var t = addExtImage;
+
+ t.width = t.preloadImg.width;
+ t.height = t.preloadImg.height;
+ document.getElementById('go_button').style.color = '#333';
+ document.getElementById('status_img').innerHTML = '<img src="<?php echo esc_url( admin_url( 'images/yes.png' ) ); ?>" alt="" />';
+ },
+
+ getImageData : function() {
+ if ( jQuery('table.describe').hasClass('not-image') )
+ return;
+
+ var t = addExtImage, src = document.forms[0].src.value;
+
+ if ( ! src ) {
+ t.resetImageData();
+ return false;
+ }
+
+ document.getElementById('status_img').innerHTML = '<img src="<?php echo esc_url( admin_url( 'images/spinner-2x.gif' ) ); ?>" alt="" width="16" height="16" />';
+ t.preloadImg = new Image();
+ t.preloadImg.onload = t.updateImageData;
+ t.preloadImg.onerror = t.resetImageData;
+ t.preloadImg.src = src;
+ }
+};
+
+jQuery(document).ready( function($) {
+ $('.media-types input').click( function() {
+ $('table.describe').toggleClass('not-image', $('#not-image').prop('checked') );
+ });
+});
+</script>
+
+<div id="media-items">
+<div class="media-item media-blank">
+ <?php
+ /**
+ * Filters the insert media from URL form HTML.
+ *
+ * @since 3.3.0
+ *
+ * @param string $form_html The insert from URL form HTML.
+ */
+ echo apply_filters( 'type_url_form_media', wp_media_insert_url_form( $type ) );
+ ?>
+</div>
+</div>
+</form>
+ <?php
+}
+
+/**
+ * Adds gallery form to upload iframe
+ *
+ * @since 2.5.0
+ *
+ * @global string $redir_tab
+ * @global string $type
+ * @global string $tab
+ *
+ * @param array $errors
+ */
+function media_upload_gallery_form( $errors ) {
+ global $redir_tab, $type;
+
+ $redir_tab = 'gallery';
+ media_upload_header();
+
+ $post_id = intval( $_REQUEST['post_id'] );
+ $form_action_url = admin_url( "media-upload.php?type=$type&tab=gallery&post_id=$post_id" );
+ /** This filter is documented in wp-admin/includes/media.php */
+ $form_action_url = apply_filters( 'media_upload_form_url', $form_action_url, $type );
+ $form_class = 'media-upload-form validate';
+
+ if ( get_user_setting( 'uploader' ) ) {
+ $form_class .= ' html-uploader';
+ }
+ ?>
+
+<script type="text/javascript">
+jQuery(function($){
+ var preloaded = $(".media-item.preloaded");
+ if ( preloaded.length > 0 ) {
+ preloaded.each(function(){prepareMediaItem({id:this.id.replace(/[^0-9]/g, '')},'');});
+ updateMediaForm();
+ }
+});
+</script>
+<div id="sort-buttons" class="hide-if-no-js">
+<span>
+ <?php _e( 'All Tabs:' ); ?>
+<a href="#" id="showall"><?php _e( 'Show' ); ?></a>
+<a href="#" id="hideall" style="display:none;"><?php _e( 'Hide' ); ?></a>
+</span>
+ <?php _e( 'Sort Order:' ); ?>
+<a href="#" id="asc"><?php _e( 'Ascending' ); ?></a> |
+<a href="#" id="desc"><?php _e( 'Descending' ); ?></a> |
+<a href="#" id="clear"><?php _ex( 'Clear', 'verb' ); ?></a>
+</div>
+<form enctype="multipart/form-data" method="post" action="<?php echo esc_url( $form_action_url ); ?>" class="<?php echo $form_class; ?>" id="gallery-form">
+ <?php wp_nonce_field( 'media-form' ); ?>
+ <?php //media_upload_form( $errors ); ?>
+<table class="widefat">
+<thead><tr>
+<th><?php _e( 'Media' ); ?></th>
+<th class="order-head"><?php _e( 'Order' ); ?></th>
+<th class="actions-head"><?php _e( 'Actions' ); ?></th>
+</tr></thead>
+</table>
+<div id="media-items">
+ <?php add_filter( 'attachment_fields_to_edit', 'media_post_single_attachment_fields_to_edit', 10, 2 ); ?>
+ <?php echo get_media_items( $post_id, $errors ); ?>
+</div>
+
+<p class="ml-submit">
+ <?php
+ submit_button(
+ __( 'Save all changes' ),
+ 'savebutton',
+ 'save',
+ false,
+ array(
+ 'id' => 'save-all',
+ 'style' => 'display: none;',
+ )
+ );
+ ?>
+<input type="hidden" name="post_id" id="post_id" value="<?php echo (int) $post_id; ?>" />
+<input type="hidden" name="type" value="<?php echo esc_attr( $GLOBALS['type'] ); ?>" />
+<input type="hidden" name="tab" value="<?php echo esc_attr( $GLOBALS['tab'] ); ?>" />
+</p>
+
+<div id="gallery-settings" style="display:none;">
+<div class="title"><?php _e( 'Gallery Settings' ); ?></div>
+<table id="basic" class="describe"><tbody>
+ <tr>
+ <th scope="row" class="label">
+ <label>
+ <span class="alignleft"><?php _e( 'Link thumbnails to:' ); ?></span>
+ </label>
+ </th>
+ <td class="field">
+ <input type="radio" name="linkto" id="linkto-file" value="file" />
+ <label for="linkto-file" class="radio"><?php _e( 'Image File' ); ?></label>
+
+ <input type="radio" checked="checked" name="linkto" id="linkto-post" value="post" />
+ <label for="linkto-post" class="radio"><?php _e( 'Attachment Page' ); ?></label>
+ </td>
+ </tr>
+
+ <tr>
+ <th scope="row" class="label">
+ <label>
+ <span class="alignleft"><?php _e( 'Order images by:' ); ?></span>
+ </label>
+ </th>
+ <td class="field">
+ <select id="orderby" name="orderby">
+ <option value="menu_order" selected="selected"><?php _e( 'Menu order' ); ?></option>
+ <option value="title"><?php _e( 'Title' ); ?></option>
+ <option value="post_date"><?php _e( 'Date/Time' ); ?></option>
+ <option value="rand"><?php _e( 'Random' ); ?></option>
+ </select>
+ </td>
+ </tr>
+
+ <tr>
+ <th scope="row" class="label">
+ <label>
+ <span class="alignleft"><?php _e( 'Order:' ); ?></span>
+ </label>
+ </th>
+ <td class="field">
+ <input type="radio" checked="checked" name="order" id="order-asc" value="asc" />
+ <label for="order-asc" class="radio"><?php _e( 'Ascending' ); ?></label>
+
+ <input type="radio" name="order" id="order-desc" value="desc" />
+ <label for="order-desc" class="radio"><?php _e( 'Descending' ); ?></label>
+ </td>
+ </tr>
+
+ <tr>
+ <th scope="row" class="label">
+ <label>
+ <span class="alignleft"><?php _e( 'Gallery columns:' ); ?></span>
+ </label>
+ </th>
+ <td class="field">
+ <select id="columns" name="columns">
+ <option value="1">1</option>
+ <option value="2">2</option>
+ <option value="3" selected="selected">3</option>
+ <option value="4">4</option>
+ <option value="5">5</option>
+ <option value="6">6</option>
+ <option value="7">7</option>
+ <option value="8">8</option>
+ <option value="9">9</option>
+ </select>
+ </td>
+ </tr>
+</tbody></table>
+
+<p class="ml-submit">
+<input type="button" class="button" style="display:none;" onMouseDown="wpgallery.update();" name="insert-gallery" id="insert-gallery" value="<?php esc_attr_e( 'Insert gallery' ); ?>" />
+<input type="button" class="button" style="display:none;" onMouseDown="wpgallery.update();" name="update-gallery" id="update-gallery" value="<?php esc_attr_e( 'Update gallery settings' ); ?>" />
+</p>
+</div>
+</form>
+ <?php
+}
+
+/**
+ * Outputs the legacy media upload form for the media library.
+ *
+ * @since 2.5.0
+ *
+ * @global wpdb $wpdb
+ * @global WP_Query $wp_query
+ * @global WP_Locale $wp_locale
+ * @global string $type
+ * @global string $tab
+ * @global array $post_mime_types
+ *
+ * @param array $errors
+ */
+function media_upload_library_form( $errors ) {
+ global $wpdb, $wp_query, $wp_locale, $type, $tab, $post_mime_types;
+
+ media_upload_header();
+
+ $post_id = isset( $_REQUEST['post_id'] ) ? intval( $_REQUEST['post_id'] ) : 0;
+
+ $form_action_url = admin_url( "media-upload.php?type=$type&tab=library&post_id=$post_id" );
+ /** This filter is documented in wp-admin/includes/media.php */
+ $form_action_url = apply_filters( 'media_upload_form_url', $form_action_url, $type );
+ $form_class = 'media-upload-form validate';
+
+ if ( get_user_setting( 'uploader' ) ) {
+ $form_class .= ' html-uploader';
+ }
+
+ $q = $_GET;
+ $q['posts_per_page'] = 10;
+ $q['paged'] = isset( $q['paged'] ) ? intval( $q['paged'] ) : 0;
+ if ( $q['paged'] < 1 ) {
+ $q['paged'] = 1;
+ }
+ $q['offset'] = ( $q['paged'] - 1 ) * 10;
+ if ( $q['offset'] < 1 ) {
+ $q['offset'] = 0;
+ }
+
+ list($post_mime_types, $avail_post_mime_types) = wp_edit_attachments_query( $q );
+
+ ?>
+
+<form id="filter" method="get">
+<input type="hidden" name="type" value="<?php echo esc_attr( $type ); ?>" />
+<input type="hidden" name="tab" value="<?php echo esc_attr( $tab ); ?>" />
+<input type="hidden" name="post_id" value="<?php echo (int) $post_id; ?>" />
+<input type="hidden" name="post_mime_type" value="<?php echo isset( $_GET['post_mime_type'] ) ? esc_attr( $_GET['post_mime_type'] ) : ''; ?>" />
+<input type="hidden" name="context" value="<?php echo isset( $_GET['context'] ) ? esc_attr( $_GET['context'] ) : ''; ?>" />
+
+<p id="media-search" class="search-box">
+ <label class="screen-reader-text" for="media-search-input"><?php _e( 'Search Media' ); ?>:</label>
+ <input type="search" id="media-search-input" name="s" value="<?php the_search_query(); ?>" />
+ <?php submit_button( __( 'Search Media' ), '', '', false ); ?>
+</p>
+
+<ul class="subsubsub">
+ <?php
+ $type_links = array();
+ $_num_posts = (array) wp_count_attachments();
+ $matches = wp_match_mime_types( array_keys( $post_mime_types ), array_keys( $_num_posts ) );
+ foreach ( $matches as $_type => $reals ) {
+ foreach ( $reals as $real ) {
+ if ( isset( $num_posts[ $_type ] ) ) {
+ $num_posts[ $_type ] += $_num_posts[ $real ];
+ } else {
+ $num_posts[ $_type ] = $_num_posts[ $real ];
+ }
+ }
+ }
+ // If available type specified by media button clicked, filter by that type
+ if ( empty( $_GET['post_mime_type'] ) && ! empty( $num_posts[ $type ] ) ) {
+ $_GET['post_mime_type'] = $type;
+ list($post_mime_types, $avail_post_mime_types) = wp_edit_attachments_query();
+ }
+ if ( empty( $_GET['post_mime_type'] ) || $_GET['post_mime_type'] == 'all' ) {
+ $class = ' class="current"';
+ } else {
+ $class = '';
+ }
+ $type_links[] = '<li><a href="' . esc_url(
+ add_query_arg(
+ array(
+ 'post_mime_type' => 'all',
+ 'paged' => false,
+ 'm' => false,
+ )
+ )
+ ) . '"' . $class . '>' . __( 'All Types' ) . '</a>';
+ foreach ( $post_mime_types as $mime_type => $label ) {
+ $class = '';
+
+ if ( ! wp_match_mime_types( $mime_type, $avail_post_mime_types ) ) {
+ continue;
+ }
+
+ if ( isset( $_GET['post_mime_type'] ) && wp_match_mime_types( $mime_type, $_GET['post_mime_type'] ) ) {
+ $class = ' class="current"';
+ }
+
+ $type_links[] = '<li><a href="' . esc_url(
+ add_query_arg(
+ array(
+ 'post_mime_type' => $mime_type,
+ 'paged' => false,
+ )
+ )
+ ) . '"' . $class . '>' . sprintf( translate_nooped_plural( $label[2], $num_posts[ $mime_type ] ), '<span id="' . $mime_type . '-counter">' . number_format_i18n( $num_posts[ $mime_type ] ) . '</span>' ) . '</a>';
+ }
+ /**
+ * Filters the media upload mime type list items.
+ *
+ * Returned values should begin with an `<li>` tag.
+ *
+ * @since 3.1.0
+ *
+ * @param string[] $type_links An array of list items containing mime type link HTML.
+ */
+ echo implode( ' | </li>', apply_filters( 'media_upload_mime_type_links', $type_links ) ) . '</li>';
+ unset( $type_links );
+ ?>
+</ul>
+
+<div class="tablenav">
+
+ <?php
+ $page_links = paginate_links(
+ array(
+ 'base' => add_query_arg( 'paged', '%#%' ),
+ 'format' => '',
+ 'prev_text' => __( '&laquo;' ),
+ 'next_text' => __( '&raquo;' ),
+ 'total' => ceil( $wp_query->found_posts / 10 ),
+ 'current' => $q['paged'],
+ )
+ );
+
+ if ( $page_links ) {
+ echo "<div class='tablenav-pages'>$page_links</div>";
+ }
+ ?>
+
+<div class="alignleft actions">
+ <?php
+
+ $arc_query = "SELECT DISTINCT YEAR(post_date) AS yyear, MONTH(post_date) AS mmonth FROM $wpdb->posts WHERE post_type = 'attachment' ORDER BY post_date DESC";
+
+ $arc_result = $wpdb->get_results( $arc_query );
+
+ $month_count = count( $arc_result );
+ $selected_month = isset( $_GET['m'] ) ? $_GET['m'] : 0;
+
+ if ( $month_count && ! ( 1 == $month_count && 0 == $arc_result[0]->mmonth ) ) {
+ ?>
+<select name='m'>
+<option<?php selected( $selected_month, 0 ); ?> value='0'><?php _e( 'All dates' ); ?></option>
+ <?php
+ foreach ( $arc_result as $arc_row ) {
+ if ( $arc_row->yyear == 0 ) {
+ continue;
+ }
+ $arc_row->mmonth = zeroise( $arc_row->mmonth, 2 );
+
+ if ( $arc_row->yyear . $arc_row->mmonth == $selected_month ) {
+ $default = ' selected="selected"';
+ } else {
+ $default = '';
+ }
+
+ echo "<option$default value='" . esc_attr( $arc_row->yyear . $arc_row->mmonth ) . "'>";
+ echo esc_html( $wp_locale->get_month( $arc_row->mmonth ) . " $arc_row->yyear" );
+ echo "</option>\n";
+ }
+ ?>
+</select>
+ <?php } ?>
+
+ <?php submit_button( __( 'Filter &#187;' ), '', 'post-query-submit', false ); ?>
+
+</div>
+
+<br class="clear" />
+</div>
+</form>
+
+<form enctype="multipart/form-data" method="post" action="<?php echo esc_url( $form_action_url ); ?>" class="<?php echo $form_class; ?>" id="library-form">
+
+ <?php wp_nonce_field( 'media-form' ); ?>
+ <?php //media_upload_form( $errors ); ?>
+
+<script type="text/javascript">
+<!--
+jQuery(function($){
+ var preloaded = $(".media-item.preloaded");
+ if ( preloaded.length > 0 ) {
+ preloaded.each(function(){prepareMediaItem({id:this.id.replace(/[^0-9]/g, '')},'');});
+ updateMediaForm();
+ }
+});
+-->
+</script>
+
+<div id="media-items">
+ <?php add_filter( 'attachment_fields_to_edit', 'media_post_single_attachment_fields_to_edit', 10, 2 ); ?>
+ <?php echo get_media_items( null, $errors ); ?>
+</div>
+<p class="ml-submit">
+ <?php submit_button( __( 'Save all changes' ), 'savebutton', 'save', false ); ?>
+<input type="hidden" name="post_id" id="post_id" value="<?php echo (int) $post_id; ?>" />
+</p>
+</form>
+ <?php
+}
+
+/**
+ * Creates the form for external url
+ *
+ * @since 2.7.0
+ *
+ * @param string $default_view
+ * @return string the form html
+ */
+function wp_media_insert_url_form( $default_view = 'image' ) {
+ /** This filter is documented in wp-admin/includes/media.php */
+ if ( ! apply_filters( 'disable_captions', '' ) ) {
+ $caption = '
+ <tr class="image-only">
+ <th scope="row" class="label">
+ <label for="caption"><span class="alignleft">' . __( 'Image Caption' ) . '</span></label>
+ </th>
+ <td class="field"><textarea id="caption" name="caption"></textarea></td>
+ </tr>
+';
+ } else {
+ $caption = '';
+ }
+
+ $default_align = get_option( 'image_default_align' );
+ if ( empty( $default_align ) ) {
+ $default_align = 'none';
+ }
+
+ if ( 'image' == $default_view ) {
+ $view = 'image-only';
+ $table_class = '';
+ } else {
+ $view = $table_class = 'not-image';
+ }
+
+ return '
+ <p class="media-types"><label><input type="radio" name="media_type" value="image" id="image-only"' . checked( 'image-only', $view, false ) . ' /> ' . __( 'Image' ) . '</label> &nbsp; &nbsp; <label><input type="radio" name="media_type" value="generic" id="not-image"' . checked( 'not-image', $view, false ) . ' /> ' . __( 'Audio, Video, or Other File' ) . '</label></p>
+ <p class="media-types media-types-required-info">' . sprintf( __( 'Required fields are marked %s' ), '<span class="required">*</span>' ) . '</p>
+ <table class="describe ' . $table_class . '"><tbody>
+ <tr>
+ <th scope="row" class="label" style="width:130px;">
+ <label for="src"><span class="alignleft">' . __( 'URL' ) . '</span> <span class="required">*</span></label>
+ <span class="alignright" id="status_img"></span>
+ </th>
+ <td class="field"><input id="src" name="src" value="" type="text" required onblur="addExtImage.getImageData()" /></td>
+ </tr>
+
+ <tr>
+ <th scope="row" class="label">
+ <label for="title"><span class="alignleft">' . __( 'Title' ) . '</span> <span class="required">*</span></label>
+ </th>
+ <td class="field"><input id="title" name="title" value="" type="text" required /></td>
+ </tr>
+
+ <tr class="not-image"><td></td><td><p class="help">' . __( 'Link text, e.g. &#8220;Ransom Demands (PDF)&#8221;' ) . '</p></td></tr>
+
+ <tr class="image-only">
+ <th scope="row" class="label">
+ <label for="alt"><span class="alignleft">' . __( 'Alternative Text' ) . '</span></label>
+ </th>
+ <td class="field"><input id="alt" name="alt" value="" type="text" required />
+ <p class="help">' . __( 'Alt text for the image, e.g. &#8220;The Mona Lisa&#8221;' ) . '</p></td>
+ </tr>
+ ' . $caption . '
+ <tr class="align image-only">
+ <th scope="row" class="label"><p><label for="align">' . __( 'Alignment' ) . '</label></p></th>
+ <td class="field">
+ <input name="align" id="align-none" value="none" onclick="addExtImage.align=\'align\'+this.value" type="radio"' . ( $default_align == 'none' ? ' checked="checked"' : '' ) . ' />
+ <label for="align-none" class="align image-align-none-label">' . __( 'None' ) . '</label>
+ <input name="align" id="align-left" value="left" onclick="addExtImage.align=\'align\'+this.value" type="radio"' . ( $default_align == 'left' ? ' checked="checked"' : '' ) . ' />
+ <label for="align-left" class="align image-align-left-label">' . __( 'Left' ) . '</label>
+ <input name="align" id="align-center" value="center" onclick="addExtImage.align=\'align\'+this.value" type="radio"' . ( $default_align == 'center' ? ' checked="checked"' : '' ) . ' />
+ <label for="align-center" class="align image-align-center-label">' . __( 'Center' ) . '</label>
+ <input name="align" id="align-right" value="right" onclick="addExtImage.align=\'align\'+this.value" type="radio"' . ( $default_align == 'right' ? ' checked="checked"' : '' ) . ' />
+ <label for="align-right" class="align image-align-right-label">' . __( 'Right' ) . '</label>
+ </td>
+ </tr>
+
+ <tr class="image-only">
+ <th scope="row" class="label">
+ <label for="url"><span class="alignleft">' . __( 'Link Image To:' ) . '</span></label>
+ </th>
+ <td class="field"><input id="url" name="url" value="" type="text" /><br />
+
+ <button type="button" class="button" value="" onclick="document.forms[0].url.value=null">' . __( 'None' ) . '</button>
+ <button type="button" class="button" value="" onclick="document.forms[0].url.value=document.forms[0].src.value">' . __( 'Link to image' ) . '</button>
+ <p class="help">' . __( 'Enter a link URL or click above for presets.' ) . '</p></td>
+ </tr>
+ <tr class="image-only">
+ <td></td>
+ <td>
+ <input type="button" class="button" id="go_button" style="color:#bbb;" onclick="addExtImage.insert()" value="' . esc_attr__( 'Insert into Post' ) . '" />
+ </td>
+ </tr>
+ <tr class="not-image">
+ <td></td>
+ <td>
+ ' . get_submit_button( __( 'Insert into Post' ), '', 'insertonlybutton', false ) . '
+ </td>
+ </tr>
+ </tbody></table>
+';
+
+}
+
+/**
+ * Displays the multi-file uploader message.
+ *
+ * @since 2.6.0
+ *
+ * @global int $post_ID
+ */
+function media_upload_flash_bypass() {
+ $browser_uploader = admin_url( 'media-new.php?browser-uploader' );
+
+ if ( $post = get_post() ) {
+ $browser_uploader .= '&amp;post_id=' . intval( $post->ID );
+ } elseif ( ! empty( $GLOBALS['post_ID'] ) ) {
+ $browser_uploader .= '&amp;post_id=' . intval( $GLOBALS['post_ID'] );
+ }
+
+ ?>
+ <p class="upload-flash-bypass">
+ <?php printf( __( 'You are using the multi-file uploader. Problems? Try the <a href="%1$s" target="%2$s">browser uploader</a> instead.' ), $browser_uploader, '_blank' ); ?>
+ </p>
+ <?php
+}
+
+/**
+ * Displays the browser's built-in uploader message.
+ *
+ * @since 2.6.0
+ */
+function media_upload_html_bypass() {
+ ?>
+ <p class="upload-html-bypass hide-if-no-js">
+ <?php _e( 'You are using the browser&#8217;s built-in file uploader. The WordPress uploader includes multiple file selection and drag and drop capability. <a href="#">Switch to the multi-file uploader</a>.' ); ?>
+ </p>
+ <?php
+}
+
+/**
+ * Used to display a "After a file has been uploaded..." help message.
+ *
+ * @since 3.3.0
+ */
+function media_upload_text_after() {}
+
+/**
+ * Displays the checkbox to scale images.
+ *
+ * @since 3.3.0
+ */
+function media_upload_max_image_resize() {
+ $checked = get_user_setting( 'upload_resize' ) ? ' checked="true"' : '';
+ $a = $end = '';
+
+ if ( current_user_can( 'manage_options' ) ) {
+ $a = '<a href="' . esc_url( admin_url( 'options-media.php' ) ) . '" target="_blank">';
+ $end = '</a>';
+ }
+ ?>
+<p class="hide-if-no-js"><label>
+<input name="image_resize" type="checkbox" id="image_resize" value="true"<?php echo $checked; ?> />
+ <?php
+ /* translators: 1: link start tag, 2: link end tag, 3: width, 4: height */
+ printf( __( 'Scale images to match the large size selected in %1$simage options%2$s (%3$d &times; %4$d).' ), $a, $end, (int) get_option( 'large_size_w', '1024' ), (int) get_option( 'large_size_h', '1024' ) );
+ ?>
+</label></p>
+ <?php
+}
+
+/**
+ * Displays the out of storage quota message in Multisite.
+ *
+ * @since 3.5.0
+ */
+function multisite_over_quota_message() {
+ echo '<p>' . sprintf(
+ /* translators: %s: allowed space allocation */
+ __( 'Sorry, you have used your space allocation of %s. Please delete some files to upload more files.' ),
+ size_format( get_space_allowed() * MB_IN_BYTES )
+ ) . '</p>';
+}
+
+/**
+ * Displays the image and editor in the post editor
+ *
+ * @since 3.5.0
+ *
+ * @param WP_Post $post A post object.
+ */
+function edit_form_image_editor( $post ) {
+ $open = isset( $_GET['image-editor'] );
+ if ( $open ) {
+ require_once ABSPATH . 'wp-admin/includes/image-edit.php';
+ }
+
+ $thumb_url = false;
+ if ( $attachment_id = intval( $post->ID ) ) {
+ $thumb_url = wp_get_attachment_image_src( $attachment_id, array( 900, 450 ), true );
+ }
+
+ $alt_text = get_post_meta( $post->ID, '_wp_attachment_image_alt', true );
+
+ $att_url = wp_get_attachment_url( $post->ID );
+ ?>
+ <div class="wp_attachment_holder wp-clearfix">
+ <?php
+ if ( wp_attachment_is_image( $post->ID ) ) :
+ $image_edit_button = '';
+ if ( wp_image_editor_supports( array( 'mime_type' => $post->post_mime_type ) ) ) {
+ $nonce = wp_create_nonce( "image_editor-$post->ID" );
+ $image_edit_button = "<input type='button' id='imgedit-open-btn-$post->ID' onclick='imageEdit.open( $post->ID, \"$nonce\" )' class='button' value='" . esc_attr__( 'Edit Image' ) . "' /> <span class='spinner'></span>";
+ }
+
+ $open_style = $not_open_style = '';
+ if ( $open ) {
+ $open_style = ' style="display:none"';
+ } else {
+ $not_open_style = ' style="display:none"';
+ }
+ ?>
+
+ <div class="imgedit-response" id="imgedit-response-<?php echo $attachment_id; ?>"></div>
+
+ <div<?php echo $open_style; ?> class="wp_attachment_image wp-clearfix" id="media-head-<?php echo $attachment_id; ?>">
+ <p id="thumbnail-head-<?php echo $attachment_id; ?>"><img class="thumbnail" src="<?php echo set_url_scheme( $thumb_url[0] ); ?>" style="max-width:100%" alt="" /></p>
+ <p><?php echo $image_edit_button; ?></p>
+ </div>
+ <div<?php echo $not_open_style; ?> class="image-editor" id="image-editor-<?php echo $attachment_id; ?>">
+ <?php
+ if ( $open ) {
+ wp_image_editor( $attachment_id );}
+ ?>
+ </div>
+ <?php
+ elseif ( $attachment_id && wp_attachment_is( 'audio', $post ) ) :
+
+ wp_maybe_generate_attachment_metadata( $post );
+
+ echo wp_audio_shortcode( array( 'src' => $att_url ) );
+
+ elseif ( $attachment_id && wp_attachment_is( 'video', $post ) ) :
+
+ wp_maybe_generate_attachment_metadata( $post );
+
+ $meta = wp_get_attachment_metadata( $attachment_id );
+ $w = ! empty( $meta['width'] ) ? min( $meta['width'], 640 ) : 0;
+ $h = ! empty( $meta['height'] ) ? $meta['height'] : 0;
+ if ( $h && $w < $meta['width'] ) {
+ $h = round( ( $meta['height'] * $w ) / $meta['width'] );
+ }
+
+ $attr = array( 'src' => $att_url );
+ if ( ! empty( $w ) && ! empty( $h ) ) {
+ $attr['width'] = $w;
+ $attr['height'] = $h;
+ }
+
+ $thumb_id = get_post_thumbnail_id( $attachment_id );
+ if ( ! empty( $thumb_id ) ) {
+ $attr['poster'] = wp_get_attachment_url( $thumb_id );
+ }
+
+ echo wp_video_shortcode( $attr );
+
+ elseif ( isset( $thumb_url[0] ) ) :
+
+ ?>
+ <div class="wp_attachment_image wp-clearfix" id="media-head-<?php echo $attachment_id; ?>">
+ <p id="thumbnail-head-<?php echo $attachment_id; ?>">
+ <img class="thumbnail" src="<?php echo set_url_scheme( $thumb_url[0] ); ?>" style="max-width:100%" alt="" />
+ </p>
+ </div>
+ <?php
+
+ else :
+
+ /**
+ * Fires when an attachment type can't be rendered in the edit form.
+ *
+ * @since 4.6.0
+ *
+ * @param WP_Post $post A post object.
+ */
+ do_action( 'wp_edit_form_attachment_display', $post );
+
+ endif;
+ ?>
+ </div>
+ <div class="wp_attachment_details edit-form-section">
+ <?php if ( 'image' === substr( $post->post_mime_type, 0, 5 ) ) : ?>
+ <p class="attachment-alt-text">
+ <label for="attachment_alt"><strong><?php _e( 'Alternative Text' ); ?></strong></label><br />
+ <input type="text" class="widefat" name="_wp_attachment_image_alt" id="attachment_alt" aria-describedby="alt-text-description" value="<?php echo esc_attr( $alt_text ); ?>" />
+ </p>
+ <p class="attachment-alt-text-description" id="alt-text-description">
+ <?php
+ printf(
+ /* translators: 1: link to tutorial, 2: additional link attributes, 3: accessibility text */
+ __( '<a href="%1$s" %2$s>Describe the purpose of the image%3$s</a>. Leave empty if the image is purely decorative.' ),
+ esc_url( 'https://www.w3.org/WAI/tutorials/images/decision-tree' ),
+ 'target="_blank" rel="noopener noreferrer"',
+ sprintf(
+ '<span class="screen-reader-text"> %s</span>',
+ /* translators: accessibility text */
+ __( '(opens in a new tab)' )
+ )
+ );
+ ?>
+ </p>
+ <?php endif; ?>
+
+ <p>
+ <label for="attachment_caption"><strong><?php _e( 'Caption' ); ?></strong></label><br />
+ <textarea class="widefat" name="excerpt" id="attachment_caption"><?php echo $post->post_excerpt; ?></textarea>
+ </p>
+
+ <?php
+ $quicktags_settings = array( 'buttons' => 'strong,em,link,block,del,ins,img,ul,ol,li,code,close' );
+ $editor_args = array(
+ 'textarea_name' => 'content',
+ 'textarea_rows' => 5,
+ 'media_buttons' => false,
+ 'tinymce' => false,
+ 'quicktags' => $quicktags_settings,
+ );
+ ?>
+
+ <label for="attachment_content"><strong><?php _e( 'Description' ); ?></strong>
+ <?php
+ if ( preg_match( '#^(audio|video)/#', $post->post_mime_type ) ) {
+ echo ': ' . __( 'Displayed on attachment pages.' );
+ }
+ ?>
+ </label>
+ <?php wp_editor( $post->post_content, 'attachment_content', $editor_args ); ?>
+
+ </div>
+ <?php
+ $extras = get_compat_media_markup( $post->ID );
+ echo $extras['item'];
+ echo '<input type="hidden" id="image-edit-context" value="edit-attachment" />' . "\n";
+}
+
+/**
+ * Displays non-editable attachment metadata in the publish meta box.
+ *
+ * @since 3.5.0
+ */
+function attachment_submitbox_metadata() {
+ $post = get_post();
+
+ $file = get_attached_file( $post->ID );
+ $filename = esc_html( wp_basename( $file ) );
+
+ $media_dims = '';
+ $meta = wp_get_attachment_metadata( $post->ID );
+ if ( isset( $meta['width'], $meta['height'] ) ) {
+ $media_dims .= "<span id='media-dims-$post->ID'>{$meta['width']}&nbsp;&times;&nbsp;{$meta['height']}</span> ";
+ }
+ /** This filter is documented in wp-admin/includes/media.php */
+ $media_dims = apply_filters( 'media_meta', $media_dims, $post );
+
+ $att_url = wp_get_attachment_url( $post->ID );
+ ?>
+ <div class="misc-pub-section misc-pub-attachment">
+ <label for="attachment_url"><?php _e( 'File URL:' ); ?></label>
+ <input type="text" class="widefat urlfield" readonly="readonly" name="attachment_url" id="attachment_url" value="<?php echo esc_attr( $att_url ); ?>" />
+ </div>
+ <div class="misc-pub-section misc-pub-filename">
+ <?php _e( 'File name:' ); ?> <strong><?php echo $filename; ?></strong>
+ </div>
+ <div class="misc-pub-section misc-pub-filetype">
+ <?php _e( 'File type:' ); ?> <strong>
+ <?php
+ if ( preg_match( '/^.*?\.(\w+)$/', get_attached_file( $post->ID ), $matches ) ) {
+ echo esc_html( strtoupper( $matches[1] ) );
+ list( $mime_type ) = explode( '/', $post->post_mime_type );
+ if ( $mime_type !== 'image' && ! empty( $meta['mime_type'] ) ) {
+ if ( $meta['mime_type'] !== "$mime_type/" . strtolower( $matches[1] ) ) {
+ echo ' (' . $meta['mime_type'] . ')';
+ }
+ }
+ } else {
+ echo strtoupper( str_replace( 'image/', '', $post->post_mime_type ) );
+ }
+ ?>
+ </strong>
+ </div>
+
+ <?php
+ $file_size = false;
+
+ if ( isset( $meta['filesize'] ) ) {
+ $file_size = $meta['filesize'];
+ } elseif ( file_exists( $file ) ) {
+ $file_size = filesize( $file );
+ }
+
+ if ( ! empty( $file_size ) ) :
+ ?>
+ <div class="misc-pub-section misc-pub-filesize">
+ <?php _e( 'File size:' ); ?> <strong><?php echo size_format( $file_size ); ?></strong>
+ </div>
+ <?php
+ endif;
+
+ if ( preg_match( '#^(audio|video)/#', $post->post_mime_type ) ) {
+ $fields = array(
+ 'length_formatted' => __( 'Length:' ),
+ 'bitrate' => __( 'Bitrate:' ),
+ );
+
+ /**
+ * Filters the audio and video metadata fields to be shown in the publish meta box.
+ *
+ * The key for each item in the array should correspond to an attachment
+ * metadata key, and the value should be the desired label.
+ *
+ * @since 3.7.0
+ * @since 4.9.0 Added the `$post` parameter.
+ *
+ * @param array $fields An array of the attachment metadata keys and labels.
+ * @param WP_Post $post WP_Post object for the current attachment.
+ */
+ $fields = apply_filters( 'media_submitbox_misc_sections', $fields, $post );
+
+ foreach ( $fields as $key => $label ) {
+ if ( empty( $meta[ $key ] ) ) {
+ continue;
+ }
+ ?>
+ <div class="misc-pub-section misc-pub-mime-meta misc-pub-<?php echo sanitize_html_class( $key ); ?>">
+ <?php echo $label; ?> <strong>
+ <?php
+ switch ( $key ) {
+ case 'bitrate':
+ echo round( $meta['bitrate'] / 1000 ) . 'kb/s';
+ if ( ! empty( $meta['bitrate_mode'] ) ) {
+ echo ' ' . strtoupper( esc_html( $meta['bitrate_mode'] ) );
+ }
+ break;
+ default:
+ echo esc_html( $meta[ $key ] );
+ break;
+ }
+ ?>
+ </strong>
+ </div>
+ <?php
+ }
+
+ $fields = array(
+ 'dataformat' => __( 'Audio Format:' ),
+ 'codec' => __( 'Audio Codec:' ),
+ );
+
+ /**
+ * Filters the audio attachment metadata fields to be shown in the publish meta box.
+ *
+ * The key for each item in the array should correspond to an attachment
+ * metadata key, and the value should be the desired label.
+ *
+ * @since 3.7.0
+ * @since 4.9.0 Added the `$post` parameter.
+ *
+ * @param array $fields An array of the attachment metadata keys and labels.
+ * @param WP_Post $post WP_Post object for the current attachment.
+ */
+ $audio_fields = apply_filters( 'audio_submitbox_misc_sections', $fields, $post );
+
+ foreach ( $audio_fields as $key => $label ) {
+ if ( empty( $meta['audio'][ $key ] ) ) {
+ continue;
+ }
+ ?>
+ <div class="misc-pub-section misc-pub-audio misc-pub-<?php echo sanitize_html_class( $key ); ?>">
+ <?php echo $label; ?> <strong><?php echo esc_html( $meta['audio'][ $key ] ); ?></strong>
+ </div>
+ <?php
+ }
+ }
+
+ if ( $media_dims ) :
+ ?>
+ <div class="misc-pub-section misc-pub-dimensions">
+ <?php _e( 'Dimensions:' ); ?> <strong><?php echo $media_dims; ?></strong>
+ </div>
+ <?php
+ endif;
+}
+
+/**
+ * Parse ID3v2, ID3v1, and getID3 comments to extract usable data
+ *
+ * @since 3.6.0
+ *
+ * @param array $metadata An existing array with data
+ * @param array $data Data supplied by ID3 tags
+ */
+function wp_add_id3_tag_data( &$metadata, $data ) {
+ foreach ( array( 'id3v2', 'id3v1' ) as $version ) {
+ if ( ! empty( $data[ $version ]['comments'] ) ) {
+ foreach ( $data[ $version ]['comments'] as $key => $list ) {
+ if ( 'length' !== $key && ! empty( $list ) ) {
+ $metadata[ $key ] = wp_kses_post( reset( $list ) );
+ // Fix bug in byte stream analysis.
+ if ( 'terms_of_use' === $key && 0 === strpos( $metadata[ $key ], 'yright notice.' ) ) {
+ $metadata[ $key ] = 'Cop' . $metadata[ $key ];
+ }
+ }
+ }
+ break;
+ }
+ }
+
+ if ( ! empty( $data['id3v2']['APIC'] ) ) {
+ $image = reset( $data['id3v2']['APIC'] );
+ if ( ! empty( $image['data'] ) ) {
+ $metadata['image'] = array(
+ 'data' => $image['data'],
+ 'mime' => $image['image_mime'],
+ 'width' => $image['image_width'],
+ 'height' => $image['image_height'],
+ );
+ }
+ } elseif ( ! empty( $data['comments']['picture'] ) ) {
+ $image = reset( $data['comments']['picture'] );
+ if ( ! empty( $image['data'] ) ) {
+ $metadata['image'] = array(
+ 'data' => $image['data'],
+ 'mime' => $image['image_mime'],
+ );
+ }
+ }
+}
+
+/**
+ * Retrieve metadata from a video file's ID3 tags
+ *
+ * @since 3.6.0
+ *
+ * @param string $file Path to file.
+ * @return array|bool Returns array of metadata, if found.
+ */
+function wp_read_video_metadata( $file ) {
+ if ( ! file_exists( $file ) ) {
+ return false;
+ }
+
+ $metadata = array();
+
+ if ( ! defined( 'GETID3_TEMP_DIR' ) ) {
+ define( 'GETID3_TEMP_DIR', get_temp_dir() );
+ }
+
+ if ( ! class_exists( 'getID3', false ) ) {
+ require( ABSPATH . WPINC . '/ID3/getid3.php' );
+ }
+ $id3 = new getID3();
+ $data = $id3->analyze( $file );
+
+ if ( isset( $data['video']['lossless'] ) ) {
+ $metadata['lossless'] = $data['video']['lossless'];
+ }
+ if ( ! empty( $data['video']['bitrate'] ) ) {
+ $metadata['bitrate'] = (int) $data['video']['bitrate'];
+ }
+ if ( ! empty( $data['video']['bitrate_mode'] ) ) {
+ $metadata['bitrate_mode'] = $data['video']['bitrate_mode'];
+ }
+ if ( ! empty( $data['filesize'] ) ) {
+ $metadata['filesize'] = (int) $data['filesize'];
+ }
+ if ( ! empty( $data['mime_type'] ) ) {
+ $metadata['mime_type'] = $data['mime_type'];
+ }
+ if ( ! empty( $data['playtime_seconds'] ) ) {
+ $metadata['length'] = (int) round( $data['playtime_seconds'] );
+ }
+ if ( ! empty( $data['playtime_string'] ) ) {
+ $metadata['length_formatted'] = $data['playtime_string'];
+ }
+ if ( ! empty( $data['video']['resolution_x'] ) ) {
+ $metadata['width'] = (int) $data['video']['resolution_x'];
+ }
+ if ( ! empty( $data['video']['resolution_y'] ) ) {
+ $metadata['height'] = (int) $data['video']['resolution_y'];
+ }
+ if ( ! empty( $data['fileformat'] ) ) {
+ $metadata['fileformat'] = $data['fileformat'];
+ }
+ if ( ! empty( $data['video']['dataformat'] ) ) {
+ $metadata['dataformat'] = $data['video']['dataformat'];
+ }
+ if ( ! empty( $data['video']['encoder'] ) ) {
+ $metadata['encoder'] = $data['video']['encoder'];
+ }
+ if ( ! empty( $data['video']['codec'] ) ) {
+ $metadata['codec'] = $data['video']['codec'];
+ }
+
+ if ( ! empty( $data['audio'] ) ) {
+ unset( $data['audio']['streams'] );
+ $metadata['audio'] = $data['audio'];
+ }
+
+ if ( empty( $metadata['created_timestamp'] ) ) {
+ $created_timestamp = wp_get_media_creation_timestamp( $data );
+
+ if ( $created_timestamp !== false ) {
+ $metadata['created_timestamp'] = $created_timestamp;
+ }
+ }
+
+ wp_add_id3_tag_data( $metadata, $data );
+
+ $file_format = isset( $metadata['fileformat'] ) ? $metadata['fileformat'] : null;
+
+ /**
+ * Filters the array of metadata retrieved from a video.
+ *
+ * In core, usually this selection is what is stored.
+ * More complete data can be parsed from the `$data` parameter.
+ *
+ * @since 4.9.0
+ *
+ * @param array $metadata Filtered Video metadata.
+ * @param string $file Path to video file.
+ * @param string $file_format File format of video, as analyzed by getID3.
+ * @param string $data Raw metadata from getID3.
+ */
+ return apply_filters( 'wp_read_video_metadata', $metadata, $file, $file_format, $data );
+}
+
+/**
+ * Retrieve metadata from an audio file's ID3 tags.
+ *
+ * @since 3.6.0
+ *
+ * @param string $file Path to file.
+ * @return array|bool Returns array of metadata, if found.
+ */
+function wp_read_audio_metadata( $file ) {
+ if ( ! file_exists( $file ) ) {
+ return false;
+ }
+ $metadata = array();
+
+ if ( ! defined( 'GETID3_TEMP_DIR' ) ) {
+ define( 'GETID3_TEMP_DIR', get_temp_dir() );
+ }
+
+ if ( ! class_exists( 'getID3', false ) ) {
+ require( ABSPATH . WPINC . '/ID3/getid3.php' );
+ }
+ $id3 = new getID3();
+ $data = $id3->analyze( $file );
+
+ if ( ! empty( $data['audio'] ) ) {
+ unset( $data['audio']['streams'] );
+ $metadata = $data['audio'];
+ }
+
+ if ( ! empty( $data['fileformat'] ) ) {
+ $metadata['fileformat'] = $data['fileformat'];
+ }
+ if ( ! empty( $data['filesize'] ) ) {
+ $metadata['filesize'] = (int) $data['filesize'];
+ }
+ if ( ! empty( $data['mime_type'] ) ) {
+ $metadata['mime_type'] = $data['mime_type'];
+ }
+ if ( ! empty( $data['playtime_seconds'] ) ) {
+ $metadata['length'] = (int) round( $data['playtime_seconds'] );
+ }
+ if ( ! empty( $data['playtime_string'] ) ) {
+ $metadata['length_formatted'] = $data['playtime_string'];
+ }
+
+ if ( empty( $metadata['created_timestamp'] ) ) {
+ $created_timestamp = wp_get_media_creation_timestamp( $data );
+
+ if ( false !== $created_timestamp ) {
+ $metadata['created_timestamp'] = $created_timestamp;
+ }
+ }
+
+ wp_add_id3_tag_data( $metadata, $data );
+
+ return $metadata;
+}
+
+/**
+ * Parse creation date from media metadata.
+ *
+ * The getID3 library doesn't have a standard method for getting creation dates,
+ * so the location of this data can vary based on the MIME type.
+ *
+ * @since 4.9.0
+ *
+ * @link https://github.com/JamesHeinrich/getID3/blob/master/structure.txt
+ *
+ * @param array $metadata The metadata returned by getID3::analyze().
+ * @return int|bool A UNIX timestamp for the media's creation date if available
+ * or a boolean FALSE if a timestamp could not be determined.
+ */
+function wp_get_media_creation_timestamp( $metadata ) {
+ $creation_date = false;
+
+ if ( empty( $metadata['fileformat'] ) ) {
+ return $creation_date;
+ }
+
+ switch ( $metadata['fileformat'] ) {
+ case 'asf':
+ if ( isset( $metadata['asf']['file_properties_object']['creation_date_unix'] ) ) {
+ $creation_date = (int) $metadata['asf']['file_properties_object']['creation_date_unix'];
+ }
+ break;
+
+ case 'matroska':
+ case 'webm':
+ if ( isset( $metadata['matroska']['comments']['creation_time']['0'] ) ) {
+ $creation_date = strtotime( $metadata['matroska']['comments']['creation_time']['0'] );
+ } elseif ( isset( $metadata['matroska']['info']['0']['DateUTC_unix'] ) ) {
+ $creation_date = (int) $metadata['matroska']['info']['0']['DateUTC_unix'];
+ }
+ break;
+
+ case 'quicktime':
+ case 'mp4':
+ if ( isset( $metadata['quicktime']['moov']['subatoms']['0']['creation_time_unix'] ) ) {
+ $creation_date = (int) $metadata['quicktime']['moov']['subatoms']['0']['creation_time_unix'];
+ }
+ break;
+ }
+
+ return $creation_date;
+}
+
+/**
+ * Encapsulate logic for Attach/Detach actions
+ *
+ * @since 4.2.0
+ *
+ * @global wpdb $wpdb WordPress database abstraction object.
+ *
+ * @param int $parent_id Attachment parent ID.
+ * @param string $action Optional. Attach/detach action. Accepts 'attach' or 'detach'.
+ * Default 'attach'.
+ */
+function wp_media_attach_action( $parent_id, $action = 'attach' ) {
+ global $wpdb;
+
+ if ( ! $parent_id ) {
+ return;
+ }
+
+ if ( ! current_user_can( 'edit_post', $parent_id ) ) {
+ wp_die( __( 'Sorry, you are not allowed to edit this post.' ) );
+ }
+ $ids = array();
+ foreach ( (array) $_REQUEST['media'] as $att_id ) {
+ $att_id = (int) $att_id;
+
+ if ( ! current_user_can( 'edit_post', $att_id ) ) {
+ continue;
+ }
+
+ $ids[] = $att_id;
+ }
+
+ if ( ! empty( $ids ) ) {
+ $ids_string = implode( ',', $ids );
+ if ( 'attach' === $action ) {
+ $result = $wpdb->query( $wpdb->prepare( "UPDATE $wpdb->posts SET post_parent = %d WHERE post_type = 'attachment' AND ID IN ( $ids_string )", $parent_id ) );
+ } else {
+ $result = $wpdb->query( "UPDATE $wpdb->posts SET post_parent = 0 WHERE post_type = 'attachment' AND ID IN ( $ids_string )" );
+ }
+
+ foreach ( $ids as $att_id ) {
+ clean_attachment_cache( $att_id );
+ }
+ }
+
+ if ( isset( $result ) ) {
+ $location = 'upload.php';
+ if ( $referer = wp_get_referer() ) {
+ if ( false !== strpos( $referer, 'upload.php' ) ) {
+ $location = remove_query_arg( array( 'attached', 'detach' ), $referer );
+ }
+ }
+
+ $key = 'attach' === $action ? 'attached' : 'detach';
+ $location = add_query_arg( array( $key => $result ), $location );
+ wp_redirect( $location );
+ exit;
+ }
+}
diff --git a/www/crm/wp-admin/includes/menu.php b/www/crm/wp-admin/includes/menu.php
new file mode 100644
index 00000000..cea9c758
--- /dev/null
+++ b/www/crm/wp-admin/includes/menu.php
@@ -0,0 +1,351 @@
+<?php
+/**
+ * Build Administration Menu.
+ *
+ * @package WordPress
+ * @subpackage Administration
+ */
+
+if ( is_network_admin() ) {
+
+ /**
+ * Fires before the administration menu loads in the Network Admin.
+ *
+ * The hook fires before menus and sub-menus are removed based on user privileges.
+ *
+ * @private
+ * @since 3.1.0
+ */
+ do_action( '_network_admin_menu' );
+} elseif ( is_user_admin() ) {
+
+ /**
+ * Fires before the administration menu loads in the User Admin.
+ *
+ * The hook fires before menus and sub-menus are removed based on user privileges.
+ *
+ * @private
+ * @since 3.1.0
+ */
+ do_action( '_user_admin_menu' );
+} else {
+
+ /**
+ * Fires before the administration menu loads in the admin.
+ *
+ * The hook fires before menus and sub-menus are removed based on user privileges.
+ *
+ * @private
+ * @since 2.2.0
+ */
+ do_action( '_admin_menu' );
+}
+
+// Create list of page plugin hook names.
+foreach ( $menu as $menu_page ) {
+ if ( false !== $pos = strpos( $menu_page[2], '?' ) ) {
+ // Handle post_type=post|page|foo pages.
+ $hook_name = substr( $menu_page[2], 0, $pos );
+ $hook_args = substr( $menu_page[2], $pos + 1 );
+ wp_parse_str( $hook_args, $hook_args );
+ // Set the hook name to be the post type.
+ if ( isset( $hook_args['post_type'] ) ) {
+ $hook_name = $hook_args['post_type'];
+ } else {
+ $hook_name = basename( $hook_name, '.php' );
+ }
+ unset( $hook_args );
+ } else {
+ $hook_name = basename( $menu_page[2], '.php' );
+ }
+ $hook_name = sanitize_title( $hook_name );
+
+ if ( isset( $compat[ $hook_name ] ) ) {
+ $hook_name = $compat[ $hook_name ];
+ } elseif ( ! $hook_name ) {
+ continue;
+ }
+
+ $admin_page_hooks[ $menu_page[2] ] = $hook_name;
+}
+unset( $menu_page, $compat );
+
+$_wp_submenu_nopriv = array();
+$_wp_menu_nopriv = array();
+// Loop over submenus and remove pages for which the user does not have privs.
+foreach ( $submenu as $parent => $sub ) {
+ foreach ( $sub as $index => $data ) {
+ if ( ! current_user_can( $data[1] ) ) {
+ unset( $submenu[ $parent ][ $index ] );
+ $_wp_submenu_nopriv[ $parent ][ $data[2] ] = true;
+ }
+ }
+ unset( $index, $data );
+
+ if ( empty( $submenu[ $parent ] ) ) {
+ unset( $submenu[ $parent ] );
+ }
+}
+unset( $sub, $parent );
+
+/*
+ * Loop over the top-level menu.
+ * Menus for which the original parent is not accessible due to lack of privileges
+ * will have the next submenu in line be assigned as the new menu parent.
+ */
+foreach ( $menu as $id => $data ) {
+ if ( empty( $submenu[ $data[2] ] ) ) {
+ continue;
+ }
+ $subs = $submenu[ $data[2] ];
+ $first_sub = reset( $subs );
+ $old_parent = $data[2];
+ $new_parent = $first_sub[2];
+ /*
+ * If the first submenu is not the same as the assigned parent,
+ * make the first submenu the new parent.
+ */
+ if ( $new_parent != $old_parent ) {
+ $_wp_real_parent_file[ $old_parent ] = $new_parent;
+ $menu[ $id ][2] = $new_parent;
+
+ foreach ( $submenu[ $old_parent ] as $index => $data ) {
+ $submenu[ $new_parent ][ $index ] = $submenu[ $old_parent ][ $index ];
+ unset( $submenu[ $old_parent ][ $index ] );
+ }
+ unset( $submenu[ $old_parent ], $index );
+
+ if ( isset( $_wp_submenu_nopriv[ $old_parent ] ) ) {
+ $_wp_submenu_nopriv[ $new_parent ] = $_wp_submenu_nopriv[ $old_parent ];
+ }
+ }
+}
+unset( $id, $data, $subs, $first_sub, $old_parent, $new_parent );
+
+if ( is_network_admin() ) {
+
+ /**
+ * Fires before the administration menu loads in the Network Admin.
+ *
+ * @since 3.1.0
+ *
+ * @param string $context Empty context.
+ */
+ do_action( 'network_admin_menu', '' );
+} elseif ( is_user_admin() ) {
+
+ /**
+ * Fires before the administration menu loads in the User Admin.
+ *
+ * @since 3.1.0
+ *
+ * @param string $context Empty context.
+ */
+ do_action( 'user_admin_menu', '' );
+} else {
+
+ /**
+ * Fires before the administration menu loads in the admin.
+ *
+ * @since 1.5.0
+ *
+ * @param string $context Empty context.
+ */
+ do_action( 'admin_menu', '' );
+}
+
+/*
+ * Remove menus that have no accessible submenus and require privileges
+ * that the user does not have. Run re-parent loop again.
+ */
+foreach ( $menu as $id => $data ) {
+ if ( ! current_user_can( $data[1] ) ) {
+ $_wp_menu_nopriv[ $data[2] ] = true;
+ }
+
+ /*
+ * If there is only one submenu and it is has same destination as the parent,
+ * remove the submenu.
+ */
+ if ( ! empty( $submenu[ $data[2] ] ) && 1 == count( $submenu[ $data[2] ] ) ) {
+ $subs = $submenu[ $data[2] ];
+ $first_sub = reset( $subs );
+ if ( $data[2] == $first_sub[2] ) {
+ unset( $submenu[ $data[2] ] );
+ }
+ }
+
+ // If submenu is empty...
+ if ( empty( $submenu[ $data[2] ] ) ) {
+ // And user doesn't have privs, remove menu.
+ if ( isset( $_wp_menu_nopriv[ $data[2] ] ) ) {
+ unset( $menu[ $id ] );
+ }
+ }
+}
+unset( $id, $data, $subs, $first_sub );
+
+/**
+ * @param string $add
+ * @param string $class
+ * @return string
+ */
+function add_cssclass( $add, $class ) {
+ $class = empty( $class ) ? $add : $class .= ' ' . $add;
+ return $class;
+}
+
+/**
+ * @param array $menu
+ * @return array
+ */
+function add_menu_classes( $menu ) {
+ $first = $lastorder = false;
+ $i = 0;
+ $mc = count( $menu );
+ foreach ( $menu as $order => $top ) {
+ $i++;
+
+ if ( 0 == $order ) { // dashboard is always shown/single
+ $menu[0][4] = add_cssclass( 'menu-top-first', $top[4] );
+ $lastorder = 0;
+ continue;
+ }
+
+ if ( 0 === strpos( $top[2], 'separator' ) && false !== $lastorder ) { // if separator
+ $first = true;
+ $c = $menu[ $lastorder ][4];
+ $menu[ $lastorder ][4] = add_cssclass( 'menu-top-last', $c );
+ continue;
+ }
+
+ if ( $first ) {
+ $c = $menu[ $order ][4];
+ $menu[ $order ][4] = add_cssclass( 'menu-top-first', $c );
+ $first = false;
+ }
+
+ if ( $mc == $i ) { // last item
+ $c = $menu[ $order ][4];
+ $menu[ $order ][4] = add_cssclass( 'menu-top-last', $c );
+ }
+
+ $lastorder = $order;
+ }
+
+ /**
+ * Filters administration menus array with classes added for top-level items.
+ *
+ * @since 2.7.0
+ *
+ * @param array $menu Associative array of administration menu items.
+ */
+ return apply_filters( 'add_menu_classes', $menu );
+}
+
+uksort( $menu, 'strnatcasecmp' ); // make it all pretty
+
+/**
+ * Filters whether to enable custom ordering of the administration menu.
+ *
+ * See the {@see 'menu_order'} filter for reordering menu items.
+ *
+ * @since 2.8.0
+ *
+ * @param bool $custom Whether custom ordering is enabled. Default false.
+ */
+if ( apply_filters( 'custom_menu_order', false ) ) {
+ $menu_order = array();
+ foreach ( $menu as $menu_item ) {
+ $menu_order[] = $menu_item[2];
+ }
+ unset( $menu_item );
+ $default_menu_order = $menu_order;
+
+ /**
+ * Filters the order of administration menu items.
+ *
+ * A truthy value must first be passed to the {@see 'custom_menu_order'} filter
+ * for this filter to work. Use the following to enable custom menu ordering:
+ *
+ * add_filter( 'custom_menu_order', '__return_true' );
+ *
+ * @since 2.8.0
+ *
+ * @param array $menu_order An ordered array of menu items.
+ */
+ $menu_order = apply_filters( 'menu_order', $menu_order );
+ $menu_order = array_flip( $menu_order );
+ $default_menu_order = array_flip( $default_menu_order );
+
+ /**
+ * @global array $menu_order
+ * @global array $default_menu_order
+ *
+ * @param array $a
+ * @param array $b
+ * @return int
+ */
+ function sort_menu( $a, $b ) {
+ global $menu_order, $default_menu_order;
+ $a = $a[2];
+ $b = $b[2];
+ if ( isset( $menu_order[ $a ] ) && ! isset( $menu_order[ $b ] ) ) {
+ return -1;
+ } elseif ( ! isset( $menu_order[ $a ] ) && isset( $menu_order[ $b ] ) ) {
+ return 1;
+ } elseif ( isset( $menu_order[ $a ] ) && isset( $menu_order[ $b ] ) ) {
+ if ( $menu_order[ $a ] == $menu_order[ $b ] ) {
+ return 0;
+ }
+ return ( $menu_order[ $a ] < $menu_order[ $b ] ) ? -1 : 1;
+ } else {
+ return ( $default_menu_order[ $a ] <= $default_menu_order[ $b ] ) ? -1 : 1;
+ }
+ }
+
+ usort( $menu, 'sort_menu' );
+ unset( $menu_order, $default_menu_order );
+}
+
+// Prevent adjacent separators
+$prev_menu_was_separator = false;
+foreach ( $menu as $id => $data ) {
+ if ( false === stristr( $data[4], 'wp-menu-separator' ) ) {
+
+ // This item is not a separator, so falsey the toggler and do nothing
+ $prev_menu_was_separator = false;
+ } else {
+
+ // The previous item was a separator, so unset this one
+ if ( true === $prev_menu_was_separator ) {
+ unset( $menu[ $id ] );
+ }
+
+ // This item is a separator, so truthy the toggler and move on
+ $prev_menu_was_separator = true;
+ }
+}
+unset( $id, $data, $prev_menu_was_separator );
+
+// Remove the last menu item if it is a separator.
+$last_menu_key = array_keys( $menu );
+$last_menu_key = array_pop( $last_menu_key );
+if ( ! empty( $menu ) && 'wp-menu-separator' == $menu[ $last_menu_key ][4] ) {
+ unset( $menu[ $last_menu_key ] );
+}
+unset( $last_menu_key );
+
+if ( ! user_can_access_admin_page() ) {
+
+ /**
+ * Fires when access to an admin page is denied.
+ *
+ * @since 2.5.0
+ */
+ do_action( 'admin_page_access_denied' );
+
+ wp_die( __( 'Sorry, you are not allowed to access this page.' ), 403 );
+}
+
+$menu = add_menu_classes( $menu );
diff --git a/www/crm/wp-admin/includes/meta-boxes.php b/www/crm/wp-admin/includes/meta-boxes.php
new file mode 100644
index 00000000..f1b5307d
--- /dev/null
+++ b/www/crm/wp-admin/includes/meta-boxes.php
@@ -0,0 +1,1555 @@
+<?php
+
+// -- Post related Meta Boxes
+
+/**
+ * Displays post submit form fields.
+ *
+ * @since 2.7.0
+ *
+ * @global string $action
+ *
+ * @param WP_Post $post Current post object.
+ * @param array $args {
+ * Array of arguments for building the post submit meta box.
+ *
+ * @type string $id Meta box 'id' attribute.
+ * @type string $title Meta box title.
+ * @type callable $callback Meta box display callback.
+ * @type array $args Extra meta box arguments.
+ * }
+ */
+function post_submit_meta_box( $post, $args = array() ) {
+ global $action;
+
+ $post_type = $post->post_type;
+ $post_type_object = get_post_type_object( $post_type );
+ $can_publish = current_user_can( $post_type_object->cap->publish_posts );
+ ?>
+<div class="submitbox" id="submitpost">
+
+<div id="minor-publishing">
+
+ <?php // Hidden submit button early on so that the browser chooses the right button when form is submitted with Return key ?>
+<div style="display:none;">
+ <?php submit_button( __( 'Save' ), '', 'save' ); ?>
+</div>
+
+<div id="minor-publishing-actions">
+<div id="save-action">
+ <?php
+ if ( 'publish' != $post->post_status && 'future' != $post->post_status && 'pending' != $post->post_status ) {
+ $private_style = '';
+ if ( 'private' == $post->post_status ) {
+ $private_style = 'style="display:none"';
+ }
+ ?>
+<input <?php echo $private_style; ?> type="submit" name="save" id="save-post" value="<?php esc_attr_e( 'Save Draft' ); ?>" class="button" />
+<span class="spinner"></span>
+<?php } elseif ( 'pending' == $post->post_status && $can_publish ) { ?>
+<input type="submit" name="save" id="save-post" value="<?php esc_attr_e( 'Save as Pending' ); ?>" class="button" />
+<span class="spinner"></span>
+<?php } ?>
+</div>
+ <?php if ( is_post_type_viewable( $post_type_object ) ) : ?>
+<div id="preview-action">
+ <?php
+ $preview_link = esc_url( get_preview_post_link( $post ) );
+ if ( 'publish' == $post->post_status ) {
+ $preview_button_text = __( 'Preview Changes' );
+ } else {
+ $preview_button_text = __( 'Preview' );
+ }
+
+ $preview_button = sprintf(
+ '%1$s<span class="screen-reader-text"> %2$s</span>',
+ $preview_button_text,
+ /* translators: accessibility text */
+ __( '(opens in a new tab)' )
+ );
+ ?>
+<a class="preview button" href="<?php echo $preview_link; ?>" target="wp-preview-<?php echo (int) $post->ID; ?>" id="post-preview"><?php echo $preview_button; ?></a>
+<input type="hidden" name="wp-preview" id="wp-preview" value="" />
+</div>
+<?php endif; // public post type ?>
+ <?php
+ /**
+ * Fires before the post time/date setting in the Publish meta box.
+ *
+ * @since 4.4.0
+ *
+ * @param WP_Post $post WP_Post object for the current post.
+ */
+ do_action( 'post_submitbox_minor_actions', $post );
+ ?>
+<div class="clear"></div>
+</div><!-- #minor-publishing-actions -->
+
+<div id="misc-publishing-actions">
+
+<div class="misc-pub-section misc-pub-post-status">
+ <?php _e( 'Status:' ); ?> <span id="post-status-display">
+ <?php
+
+ switch ( $post->post_status ) {
+ case 'private':
+ _e( 'Privately Published' );
+ break;
+ case 'publish':
+ _e( 'Published' );
+ break;
+ case 'future':
+ _e( 'Scheduled' );
+ break;
+ case 'pending':
+ _e( 'Pending Review' );
+ break;
+ case 'draft':
+ case 'auto-draft':
+ _e( 'Draft' );
+ break;
+ }
+ ?>
+</span>
+ <?php
+ if ( 'publish' == $post->post_status || 'private' == $post->post_status || $can_publish ) {
+ $private_style = '';
+ if ( 'private' == $post->post_status ) {
+ $private_style = 'style="display:none"';
+ }
+ ?>
+<a href="#post_status" <?php echo $private_style; ?> class="edit-post-status hide-if-no-js" role="button"><span aria-hidden="true"><?php _e( 'Edit' ); ?></span> <span class="screen-reader-text"><?php _e( 'Edit status' ); ?></span></a>
+
+<div id="post-status-select" class="hide-if-js">
+<input type="hidden" name="hidden_post_status" id="hidden_post_status" value="<?php echo esc_attr( ( 'auto-draft' == $post->post_status ) ? 'draft' : $post->post_status ); ?>" />
+<label for="post_status" class="screen-reader-text"><?php _e( 'Set status' ); ?></label>
+<select name="post_status" id="post_status">
+ <?php if ( 'publish' == $post->post_status ) : ?>
+<option<?php selected( $post->post_status, 'publish' ); ?> value='publish'><?php _e( 'Published' ); ?></option>
+<?php elseif ( 'private' == $post->post_status ) : ?>
+<option<?php selected( $post->post_status, 'private' ); ?> value='publish'><?php _e( 'Privately Published' ); ?></option>
+<?php elseif ( 'future' == $post->post_status ) : ?>
+<option<?php selected( $post->post_status, 'future' ); ?> value='future'><?php _e( 'Scheduled' ); ?></option>
+<?php endif; ?>
+<option<?php selected( $post->post_status, 'pending' ); ?> value='pending'><?php _e( 'Pending Review' ); ?></option>
+ <?php if ( 'auto-draft' == $post->post_status ) : ?>
+<option<?php selected( $post->post_status, 'auto-draft' ); ?> value='draft'><?php _e( 'Draft' ); ?></option>
+<?php else : ?>
+<option<?php selected( $post->post_status, 'draft' ); ?> value='draft'><?php _e( 'Draft' ); ?></option>
+<?php endif; ?>
+</select>
+<a href="#post_status" class="save-post-status hide-if-no-js button"><?php _e( 'OK' ); ?></a>
+<a href="#post_status" class="cancel-post-status hide-if-no-js button-cancel"><?php _e( 'Cancel' ); ?></a>
+</div>
+
+<?php } ?>
+</div><!-- .misc-pub-section -->
+
+<div class="misc-pub-section misc-pub-visibility" id="visibility">
+ <?php _e( 'Visibility:' ); ?> <span id="post-visibility-display">
+ <?php
+
+ if ( 'private' == $post->post_status ) {
+ $post->post_password = '';
+ $visibility = 'private';
+ $visibility_trans = __( 'Private' );
+ } elseif ( ! empty( $post->post_password ) ) {
+ $visibility = 'password';
+ $visibility_trans = __( 'Password protected' );
+ } elseif ( $post_type == 'post' && is_sticky( $post->ID ) ) {
+ $visibility = 'public';
+ $visibility_trans = __( 'Public, Sticky' );
+ } else {
+ $visibility = 'public';
+ $visibility_trans = __( 'Public' );
+ }
+
+ echo esc_html( $visibility_trans );
+ ?>
+</span>
+ <?php if ( $can_publish ) { ?>
+<a href="#visibility" class="edit-visibility hide-if-no-js" role="button"><span aria-hidden="true"><?php _e( 'Edit' ); ?></span> <span class="screen-reader-text"><?php _e( 'Edit visibility' ); ?></span></a>
+
+<div id="post-visibility-select" class="hide-if-js">
+<input type="hidden" name="hidden_post_password" id="hidden-post-password" value="<?php echo esc_attr( $post->post_password ); ?>" />
+ <?php if ( $post_type == 'post' ) : ?>
+<input type="checkbox" style="display:none" name="hidden_post_sticky" id="hidden-post-sticky" value="sticky" <?php checked( is_sticky( $post->ID ) ); ?> />
+<?php endif; ?>
+<input type="hidden" name="hidden_post_visibility" id="hidden-post-visibility" value="<?php echo esc_attr( $visibility ); ?>" />
+<input type="radio" name="visibility" id="visibility-radio-public" value="public" <?php checked( $visibility, 'public' ); ?> /> <label for="visibility-radio-public" class="selectit"><?php _e( 'Public' ); ?></label><br />
+ <?php if ( $post_type == 'post' && current_user_can( 'edit_others_posts' ) ) : ?>
+<span id="sticky-span"><input id="sticky" name="sticky" type="checkbox" value="sticky" <?php checked( is_sticky( $post->ID ) ); ?> /> <label for="sticky" class="selectit"><?php _e( 'Stick this post to the front page' ); ?></label><br /></span>
+<?php endif; ?>
+<input type="radio" name="visibility" id="visibility-radio-password" value="password" <?php checked( $visibility, 'password' ); ?> /> <label for="visibility-radio-password" class="selectit"><?php _e( 'Password protected' ); ?></label><br />
+<span id="password-span"><label for="post_password"><?php _e( 'Password:' ); ?></label> <input type="text" name="post_password" id="post_password" value="<?php echo esc_attr( $post->post_password ); ?>" maxlength="255" /><br /></span>
+<input type="radio" name="visibility" id="visibility-radio-private" value="private" <?php checked( $visibility, 'private' ); ?> /> <label for="visibility-radio-private" class="selectit"><?php _e( 'Private' ); ?></label><br />
+
+<p>
+ <a href="#visibility" class="save-post-visibility hide-if-no-js button"><?php _e( 'OK' ); ?></a>
+ <a href="#visibility" class="cancel-post-visibility hide-if-no-js button-cancel"><?php _e( 'Cancel' ); ?></a>
+</p>
+</div>
+<?php } ?>
+
+</div><!-- .misc-pub-section -->
+
+ <?php
+ /* translators: Publish box date format, see https://secure.php.net/date */
+ $datef = __( 'M j, Y @ H:i' );
+ if ( 0 != $post->ID ) {
+ if ( 'future' == $post->post_status ) { // scheduled for publishing at a future date
+ /* translators: Post date information. %s: Date on which the post is currently scheduled to be published */
+ $stamp = __( 'Scheduled for: <b>%s</b>' );
+ } elseif ( 'publish' == $post->post_status || 'private' == $post->post_status ) { // already published
+ /* translators: Post date information. %s: Date on which the post was published */
+ $stamp = __( 'Published on: <b>%s</b>' );
+ } elseif ( '0000-00-00 00:00:00' == $post->post_date_gmt ) { // draft, 1 or more saves, no date specified
+ $stamp = __( 'Publish <b>immediately</b>' );
+ } elseif ( time() < strtotime( $post->post_date_gmt . ' +0000' ) ) { // draft, 1 or more saves, future date specified
+ /* translators: Post date information. %s: Date on which the post is to be published */
+ $stamp = __( 'Schedule for: <b>%s</b>' );
+ } else { // draft, 1 or more saves, date specified
+ /* translators: Post date information. %s: Date on which the post is to be published */
+ $stamp = __( 'Publish on: <b>%s</b>' );
+ }
+ $date = date_i18n( $datef, strtotime( $post->post_date ) );
+ } else { // draft (no saves, and thus no date specified)
+ $stamp = __( 'Publish <b>immediately</b>' );
+ $date = date_i18n( $datef, strtotime( current_time( 'mysql' ) ) );
+ }
+
+ if ( ! empty( $args['args']['revisions_count'] ) ) :
+ ?>
+<div class="misc-pub-section misc-pub-revisions">
+ <?php
+ /* translators: Post revisions heading. %s: The number of available revisions */
+ printf( __( 'Revisions: %s' ), '<b>' . number_format_i18n( $args['args']['revisions_count'] ) . '</b>' );
+ ?>
+ <a class="hide-if-no-js" href="<?php echo esc_url( get_edit_post_link( $args['args']['revision_id'] ) ); ?>"><span aria-hidden="true"><?php _ex( 'Browse', 'revisions' ); ?></span> <span class="screen-reader-text"><?php _e( 'Browse revisions' ); ?></span></a>
+</div>
+ <?php
+endif;
+
+ if ( $can_publish ) : // Contributors don't get to choose the date of publish
+ ?>
+<div class="misc-pub-section curtime misc-pub-curtime">
+ <span id="timestamp">
+ <?php printf( $stamp, $date ); ?></span>
+ <a href="#edit_timestamp" class="edit-timestamp hide-if-no-js" role="button"><span aria-hidden="true"><?php _e( 'Edit' ); ?></span> <span class="screen-reader-text"><?php _e( 'Edit date and time' ); ?></span></a>
+ <fieldset id="timestampdiv" class="hide-if-js">
+ <legend class="screen-reader-text"><?php _e( 'Date and time' ); ?></legend>
+ <?php touch_time( ( $action === 'edit' ), 1 ); ?>
+ </fieldset>
+</div><?php // /misc-pub-section ?>
+<?php endif; ?>
+
+ <?php if ( 'draft' === $post->post_status && get_post_meta( $post->ID, '_customize_changeset_uuid', true ) ) : ?>
+ <div class="notice notice-info notice-alt inline">
+ <p>
+ <?php
+ echo sprintf(
+ /* translators: %s: URL to the Customizer */
+ __( 'This draft comes from your <a href="%s">unpublished customization changes</a>. You can edit, but there&#8217;s no need to publish now. It will be published automatically with those changes.' ),
+ esc_url(
+ add_query_arg(
+ 'changeset_uuid',
+ rawurlencode( get_post_meta( $post->ID, '_customize_changeset_uuid', true ) ),
+ admin_url( 'customize.php' )
+ )
+ )
+ );
+ ?>
+ </p>
+ </div>
+ <?php endif; ?>
+
+ <?php
+ /**
+ * Fires after the post time/date setting in the Publish meta box.
+ *
+ * @since 2.9.0
+ * @since 4.4.0 Added the `$post` parameter.
+ *
+ * @param WP_Post $post WP_Post object for the current post.
+ */
+ do_action( 'post_submitbox_misc_actions', $post );
+ ?>
+</div>
+<div class="clear"></div>
+</div>
+
+<div id="major-publishing-actions">
+ <?php
+ /**
+ * Fires at the beginning of the publishing actions section of the Publish meta box.
+ *
+ * @since 2.7.0
+ * @since 4.9.0 Added the `$post` parameter.
+ *
+ * @param WP_Post|null $post WP_Post object for the current post on Edit Post screen,
+ * null on Edit Link screen.
+ */
+ do_action( 'post_submitbox_start', $post );
+ ?>
+<div id="delete-action">
+ <?php
+ if ( current_user_can( 'delete_post', $post->ID ) ) {
+ if ( ! EMPTY_TRASH_DAYS ) {
+ $delete_text = __( 'Delete Permanently' );
+ } else {
+ $delete_text = __( 'Move to Trash' );
+ }
+ ?>
+<a class="submitdelete deletion" href="<?php echo get_delete_post_link( $post->ID ); ?>"><?php echo $delete_text; ?></a>
+ <?php
+ }
+ ?>
+</div>
+
+<div id="publishing-action">
+<span class="spinner"></span>
+ <?php
+ if ( ! in_array( $post->post_status, array( 'publish', 'future', 'private' ) ) || 0 == $post->ID ) {
+ if ( $can_publish ) :
+ if ( ! empty( $post->post_date_gmt ) && time() < strtotime( $post->post_date_gmt . ' +0000' ) ) :
+ ?>
+ <input name="original_publish" type="hidden" id="original_publish" value="<?php echo esc_attr_x( 'Schedule', 'post action/button label' ); ?>" />
+ <?php submit_button( _x( 'Schedule', 'post action/button label' ), 'primary large', 'publish', false ); ?>
+ <?php else : ?>
+ <input name="original_publish" type="hidden" id="original_publish" value="<?php esc_attr_e( 'Publish' ); ?>" />
+ <?php submit_button( __( 'Publish' ), 'primary large', 'publish', false ); ?>
+ <?php
+ endif;
+ else :
+ ?>
+ <input name="original_publish" type="hidden" id="original_publish" value="<?php esc_attr_e( 'Submit for Review' ); ?>" />
+ <?php submit_button( __( 'Submit for Review' ), 'primary large', 'publish', false ); ?>
+ <?php
+ endif;
+ } else {
+ ?>
+ <input name="original_publish" type="hidden" id="original_publish" value="<?php esc_attr_e( 'Update' ); ?>" />
+ <input name="save" type="submit" class="button button-primary button-large" id="publish" value="<?php esc_attr_e( 'Update' ); ?>" />
+ <?php
+ }
+ ?>
+</div>
+<div class="clear"></div>
+</div>
+</div>
+
+ <?php
+}
+
+/**
+ * Display attachment submit form fields.
+ *
+ * @since 3.5.0
+ *
+ * @param object $post
+ */
+function attachment_submit_meta_box( $post ) {
+ ?>
+<div class="submitbox" id="submitpost">
+
+<div id="minor-publishing">
+
+ <?php // Hidden submit button early on so that the browser chooses the right button when form is submitted with Return key ?>
+<div style="display:none;">
+ <?php submit_button( __( 'Save' ), '', 'save' ); ?>
+</div>
+
+
+<div id="misc-publishing-actions">
+ <div class="misc-pub-section curtime misc-pub-curtime">
+ <span id="timestamp">
+ <?php
+ $date = date_i18n(
+ /* translators: Publish box date format, see https://secure.php.net/date */
+ __( 'M j, Y @ H:i' ),
+ strtotime( $post->post_date )
+ );
+ printf(
+ /* translators: Attachment information. %s: Date the attachment was uploaded */
+ __( 'Uploaded on: %s' ),
+ '<b>' . $date . '</b>'
+ );
+ ?>
+ </span>
+ </div><!-- .misc-pub-section -->
+
+ <?php
+ /**
+ * Fires after the 'Uploaded on' section of the Save meta box
+ * in the attachment editing screen.
+ *
+ * @since 3.5.0
+ * @since 4.9.0 Added the `$post` parameter.
+ *
+ * @param WP_Post $post WP_Post object for the current attachment.
+ */
+ do_action( 'attachment_submitbox_misc_actions', $post );
+ ?>
+</div><!-- #misc-publishing-actions -->
+<div class="clear"></div>
+</div><!-- #minor-publishing -->
+
+<div id="major-publishing-actions">
+ <div id="delete-action">
+ <?php
+ if ( current_user_can( 'delete_post', $post->ID ) ) {
+ if ( EMPTY_TRASH_DAYS && MEDIA_TRASH ) {
+ echo "<a class='submitdelete deletion' href='" . get_delete_post_link( $post->ID ) . "'>" . __( 'Move to Trash' ) . '</a>';
+ } else {
+ $delete_ays = ! MEDIA_TRASH ? " onclick='return showNotice.warn();'" : '';
+ echo "<a class='submitdelete deletion'$delete_ays href='" . get_delete_post_link( $post->ID, null, true ) . "'>" . __( 'Delete Permanently' ) . '</a>';
+ }
+ }
+ ?>
+ </div>
+
+ <div id="publishing-action">
+ <span class="spinner"></span>
+ <input name="original_publish" type="hidden" id="original_publish" value="<?php esc_attr_e( 'Update' ); ?>" />
+ <input name="save" type="submit" class="button button-primary button-large" id="publish" value="<?php esc_attr_e( 'Update' ); ?>" />
+ </div>
+ <div class="clear"></div>
+</div><!-- #major-publishing-actions -->
+
+</div>
+
+ <?php
+}
+
+/**
+ * Display post format form elements.
+ *
+ * @since 3.1.0
+ *
+ * @param WP_Post $post Post object.
+ * @param array $box {
+ * Post formats meta box arguments.
+ *
+ * @type string $id Meta box 'id' attribute.
+ * @type string $title Meta box title.
+ * @type callable $callback Meta box display callback.
+ * @type array $args Extra meta box arguments.
+ * }
+ */
+function post_format_meta_box( $post, $box ) {
+ if ( current_theme_supports( 'post-formats' ) && post_type_supports( $post->post_type, 'post-formats' ) ) :
+ $post_formats = get_theme_support( 'post-formats' );
+
+ if ( is_array( $post_formats[0] ) ) :
+ $post_format = get_post_format( $post->ID );
+ if ( ! $post_format ) {
+ $post_format = '0';
+ }
+ // Add in the current one if it isn't there yet, in case the current theme doesn't support it
+ if ( $post_format && ! in_array( $post_format, $post_formats[0] ) ) {
+ $post_formats[0][] = $post_format;
+ }
+ ?>
+ <div id="post-formats-select">
+ <fieldset>
+ <legend class="screen-reader-text"><?php _e( 'Post Formats' ); ?></legend>
+ <input type="radio" name="post_format" class="post-format" id="post-format-0" value="0" <?php checked( $post_format, '0' ); ?> /> <label for="post-format-0" class="post-format-icon post-format-standard"><?php echo get_post_format_string( 'standard' ); ?></label>
+ <?php foreach ( $post_formats[0] as $format ) : ?>
+ <br /><input type="radio" name="post_format" class="post-format" id="post-format-<?php echo esc_attr( $format ); ?>" value="<?php echo esc_attr( $format ); ?>" <?php checked( $post_format, $format ); ?> /> <label for="post-format-<?php echo esc_attr( $format ); ?>" class="post-format-icon post-format-<?php echo esc_attr( $format ); ?>"><?php echo esc_html( get_post_format_string( $format ) ); ?></label>
+ <?php endforeach; ?>
+ </fieldset>
+ </div>
+ <?php
+ endif;
+endif;
+}
+
+/**
+ * Display post tags form fields.
+ *
+ * @since 2.6.0
+ *
+ * @todo Create taxonomy-agnostic wrapper for this.
+ *
+ * @param WP_Post $post Post object.
+ * @param array $box {
+ * Tags meta box arguments.
+ *
+ * @type string $id Meta box 'id' attribute.
+ * @type string $title Meta box title.
+ * @type callable $callback Meta box display callback.
+ * @type array $args {
+ * Extra meta box arguments.
+ *
+ * @type string $taxonomy Taxonomy. Default 'post_tag'.
+ * }
+ * }
+ */
+function post_tags_meta_box( $post, $box ) {
+ $defaults = array( 'taxonomy' => 'post_tag' );
+ if ( ! isset( $box['args'] ) || ! is_array( $box['args'] ) ) {
+ $args = array();
+ } else {
+ $args = $box['args'];
+ }
+ $r = wp_parse_args( $args, $defaults );
+ $tax_name = esc_attr( $r['taxonomy'] );
+ $taxonomy = get_taxonomy( $r['taxonomy'] );
+ $user_can_assign_terms = current_user_can( $taxonomy->cap->assign_terms );
+ $comma = _x( ',', 'tag delimiter' );
+ $terms_to_edit = get_terms_to_edit( $post->ID, $tax_name );
+ if ( ! is_string( $terms_to_edit ) ) {
+ $terms_to_edit = '';
+ }
+ ?>
+<div class="tagsdiv" id="<?php echo $tax_name; ?>">
+ <div class="jaxtag">
+ <div class="nojs-tags hide-if-js">
+ <label for="tax-input-<?php echo $tax_name; ?>"><?php echo $taxonomy->labels->add_or_remove_items; ?></label>
+ <p><textarea name="<?php echo "tax_input[$tax_name]"; ?>" rows="3" cols="20" class="the-tags" id="tax-input-<?php echo $tax_name; ?>" <?php disabled( ! $user_can_assign_terms ); ?> aria-describedby="new-tag-<?php echo $tax_name; ?>-desc"><?php echo str_replace( ',', $comma . ' ', $terms_to_edit ); // textarea_escaped by esc_attr() ?></textarea></p>
+ </div>
+ <?php if ( $user_can_assign_terms ) : ?>
+ <div class="ajaxtag hide-if-no-js">
+ <label class="screen-reader-text" for="new-tag-<?php echo $tax_name; ?>"><?php echo $taxonomy->labels->add_new_item; ?></label>
+ <input data-wp-taxonomy="<?php echo $tax_name; ?>" type="text" id="new-tag-<?php echo $tax_name; ?>" name="newtag[<?php echo $tax_name; ?>]" class="newtag form-input-tip" size="16" autocomplete="off" aria-describedby="new-tag-<?php echo $tax_name; ?>-desc" value="" />
+ <input type="button" class="button tagadd" value="<?php esc_attr_e( 'Add' ); ?>" />
+ </div>
+ <p class="howto" id="new-tag-<?php echo $tax_name; ?>-desc"><?php echo $taxonomy->labels->separate_items_with_commas; ?></p>
+ <?php elseif ( empty( $terms_to_edit ) ) : ?>
+ <p><?php echo $taxonomy->labels->no_terms; ?></p>
+ <?php endif; ?>
+ </div>
+ <ul class="tagchecklist" role="list"></ul>
+</div>
+ <?php if ( $user_can_assign_terms ) : ?>
+<p class="hide-if-no-js"><button type="button" class="button-link tagcloud-link" id="link-<?php echo $tax_name; ?>" aria-expanded="false"><?php echo $taxonomy->labels->choose_from_most_used; ?></button></p>
+<?php endif; ?>
+ <?php
+}
+
+/**
+ * Display post categories form fields.
+ *
+ * @since 2.6.0
+ *
+ * @todo Create taxonomy-agnostic wrapper for this.
+ *
+ * @param WP_Post $post Post object.
+ * @param array $box {
+ * Categories meta box arguments.
+ *
+ * @type string $id Meta box 'id' attribute.
+ * @type string $title Meta box title.
+ * @type callable $callback Meta box display callback.
+ * @type array $args {
+ * Extra meta box arguments.
+ *
+ * @type string $taxonomy Taxonomy. Default 'category'.
+ * }
+ * }
+ */
+function post_categories_meta_box( $post, $box ) {
+ $defaults = array( 'taxonomy' => 'category' );
+ if ( ! isset( $box['args'] ) || ! is_array( $box['args'] ) ) {
+ $args = array();
+ } else {
+ $args = $box['args'];
+ }
+ $r = wp_parse_args( $args, $defaults );
+ $tax_name = esc_attr( $r['taxonomy'] );
+ $taxonomy = get_taxonomy( $r['taxonomy'] );
+ ?>
+ <div id="taxonomy-<?php echo $tax_name; ?>" class="categorydiv">
+ <ul id="<?php echo $tax_name; ?>-tabs" class="category-tabs">
+ <li class="tabs"><a href="#<?php echo $tax_name; ?>-all"><?php echo $taxonomy->labels->all_items; ?></a></li>
+ <li class="hide-if-no-js"><a href="#<?php echo $tax_name; ?>-pop"><?php echo esc_html( $taxonomy->labels->most_used ); ?></a></li>
+ </ul>
+
+ <div id="<?php echo $tax_name; ?>-pop" class="tabs-panel" style="display: none;">
+ <ul id="<?php echo $tax_name; ?>checklist-pop" class="categorychecklist form-no-clear" >
+ <?php $popular_ids = wp_popular_terms_checklist( $tax_name ); ?>
+ </ul>
+ </div>
+
+ <div id="<?php echo $tax_name; ?>-all" class="tabs-panel">
+ <?php
+ $name = ( $tax_name == 'category' ) ? 'post_category' : 'tax_input[' . $tax_name . ']';
+ echo "<input type='hidden' name='{$name}[]' value='0' />"; // Allows for an empty term set to be sent. 0 is an invalid Term ID and will be ignored by empty() checks.
+ ?>
+ <ul id="<?php echo $tax_name; ?>checklist" data-wp-lists="list:<?php echo $tax_name; ?>" class="categorychecklist form-no-clear">
+ <?php
+ wp_terms_checklist(
+ $post->ID,
+ array(
+ 'taxonomy' => $tax_name,
+ 'popular_cats' => $popular_ids,
+ )
+ );
+ ?>
+ </ul>
+ </div>
+ <?php if ( current_user_can( $taxonomy->cap->edit_terms ) ) : ?>
+ <div id="<?php echo $tax_name; ?>-adder" class="wp-hidden-children">
+ <a id="<?php echo $tax_name; ?>-add-toggle" href="#<?php echo $tax_name; ?>-add" class="hide-if-no-js taxonomy-add-new">
+ <?php
+ /* translators: %s: add new taxonomy label */
+ printf( __( '+ %s' ), $taxonomy->labels->add_new_item );
+ ?>
+ </a>
+ <p id="<?php echo $tax_name; ?>-add" class="category-add wp-hidden-child">
+ <label class="screen-reader-text" for="new<?php echo $tax_name; ?>"><?php echo $taxonomy->labels->add_new_item; ?></label>
+ <input type="text" name="new<?php echo $tax_name; ?>" id="new<?php echo $tax_name; ?>" class="form-required form-input-tip" value="<?php echo esc_attr( $taxonomy->labels->new_item_name ); ?>" aria-required="true"/>
+ <label class="screen-reader-text" for="new<?php echo $tax_name; ?>_parent">
+ <?php echo $taxonomy->labels->parent_item_colon; ?>
+ </label>
+ <?php
+ $parent_dropdown_args = array(
+ 'taxonomy' => $tax_name,
+ 'hide_empty' => 0,
+ 'name' => 'new' . $tax_name . '_parent',
+ 'orderby' => 'name',
+ 'hierarchical' => 1,
+ 'show_option_none' => '&mdash; ' . $taxonomy->labels->parent_item . ' &mdash;',
+ );
+
+ /**
+ * Filters the arguments for the taxonomy parent dropdown on the Post Edit page.
+ *
+ * @since 4.4.0
+ *
+ * @param array $parent_dropdown_args {
+ * Optional. Array of arguments to generate parent dropdown.
+ *
+ * @type string $taxonomy Name of the taxonomy to retrieve.
+ * @type bool $hide_if_empty True to skip generating markup if no
+ * categories are found. Default 0.
+ * @type string $name Value for the 'name' attribute
+ * of the select element.
+ * Default "new{$tax_name}_parent".
+ * @type string $orderby Which column to use for ordering
+ * terms. Default 'name'.
+ * @type bool|int $hierarchical Whether to traverse the taxonomy
+ * hierarchy. Default 1.
+ * @type string $show_option_none Text to display for the "none" option.
+ * Default "&mdash; {$parent} &mdash;",
+ * where `$parent` is 'parent_item'
+ * taxonomy label.
+ * }
+ */
+ $parent_dropdown_args = apply_filters( 'post_edit_category_parent_dropdown_args', $parent_dropdown_args );
+
+ wp_dropdown_categories( $parent_dropdown_args );
+ ?>
+ <input type="button" id="<?php echo $tax_name; ?>-add-submit" data-wp-lists="add:<?php echo $tax_name; ?>checklist:<?php echo $tax_name; ?>-add" class="button category-add-submit" value="<?php echo esc_attr( $taxonomy->labels->add_new_item ); ?>" />
+ <?php wp_nonce_field( 'add-' . $tax_name, '_ajax_nonce-add-' . $tax_name, false ); ?>
+ <span id="<?php echo $tax_name; ?>-ajax-response"></span>
+ </p>
+ </div>
+ <?php endif; ?>
+ </div>
+ <?php
+}
+
+/**
+ * Display post excerpt form fields.
+ *
+ * @since 2.6.0
+ *
+ * @param object $post
+ */
+function post_excerpt_meta_box( $post ) {
+ ?>
+<label class="screen-reader-text" for="excerpt"><?php _e( 'Excerpt' ); ?></label><textarea rows="1" cols="40" name="excerpt" id="excerpt"><?php echo $post->post_excerpt; // textarea_escaped ?></textarea>
+<p>
+ <?php
+ printf(
+ /* translators: %s: Codex URL */
+ __( 'Excerpts are optional hand-crafted summaries of your content that can be used in your theme. <a href="%s">Learn more about manual excerpts</a>.' ),
+ __( 'https://codex.wordpress.org/Excerpt' )
+ );
+ ?>
+</p>
+ <?php
+}
+
+/**
+ * Display trackback links form fields.
+ *
+ * @since 2.6.0
+ *
+ * @param object $post
+ */
+function post_trackback_meta_box( $post ) {
+ $form_trackback = '<input type="text" name="trackback_url" id="trackback_url" class="code" value="' .
+ esc_attr( str_replace( "\n", ' ', $post->to_ping ) ) . '" aria-describedby="trackback-url-desc" />';
+ if ( '' != $post->pinged ) {
+ $pings = '<p>' . __( 'Already pinged:' ) . '</p><ul>';
+ $already_pinged = explode( "\n", trim( $post->pinged ) );
+ foreach ( $already_pinged as $pinged_url ) {
+ $pings .= "\n\t<li>" . esc_html( $pinged_url ) . '</li>';
+ }
+ $pings .= '</ul>';
+ }
+
+ ?>
+<p>
+ <label for="trackback_url"><?php _e( 'Send trackbacks to:' ); ?></label>
+ <?php echo $form_trackback; ?>
+</p>
+<p id="trackback-url-desc" class="howto"><?php _e( 'Separate multiple URLs with spaces' ); ?></p>
+<p>
+ <?php
+ printf(
+ /* translators: %s: Codex URL */
+ __( 'Trackbacks are a way to notify legacy blog systems that you&#8217;ve linked to them. If you link other WordPress sites, they&#8217;ll be notified automatically using <a href="%s">pingbacks</a>, no other action necessary.' ),
+ __( 'https://codex.wordpress.org/Introduction_to_Blogging#Managing_Comments' )
+ );
+ ?>
+</p>
+ <?php
+ if ( ! empty( $pings ) ) {
+ echo $pings;
+ }
+}
+
+/**
+ * Display custom fields form fields.
+ *
+ * @since 2.6.0
+ *
+ * @param object $post
+ */
+function post_custom_meta_box( $post ) {
+ ?>
+<div id="postcustomstuff">
+<div id="ajax-response"></div>
+ <?php
+ $metadata = has_meta( $post->ID );
+ foreach ( $metadata as $key => $value ) {
+ if ( is_protected_meta( $metadata[ $key ]['meta_key'], 'post' ) || ! current_user_can( 'edit_post_meta', $post->ID, $metadata[ $key ]['meta_key'] ) ) {
+ unset( $metadata[ $key ] );
+ }
+ }
+ list_meta( $metadata );
+ meta_form( $post );
+ ?>
+</div>
+<p>
+ <?php
+ printf(
+ /* translators: %s: Codex URL */
+ __( 'Custom fields can be used to add extra metadata to a post that you can <a href="%s">use in your theme</a>.' ),
+ __( 'https://codex.wordpress.org/Using_Custom_Fields' )
+ );
+ ?>
+</p>
+ <?php
+}
+
+/**
+ * Display comments status form fields.
+ *
+ * @since 2.6.0
+ *
+ * @param object $post
+ */
+function post_comment_status_meta_box( $post ) {
+ ?>
+<input name="advanced_view" type="hidden" value="1" />
+<p class="meta-options">
+ <label for="comment_status" class="selectit"><input name="comment_status" type="checkbox" id="comment_status" value="open" <?php checked( $post->comment_status, 'open' ); ?> /> <?php _e( 'Allow comments' ); ?></label><br />
+ <label for="ping_status" class="selectit"><input name="ping_status" type="checkbox" id="ping_status" value="open" <?php checked( $post->ping_status, 'open' ); ?> />
+ <?php
+ printf(
+ /* translators: %s: Codex URL */
+ __( 'Allow <a href="%s">trackbacks and pingbacks</a> on this page' ),
+ __( 'https://codex.wordpress.org/Introduction_to_Blogging#Managing_Comments' )
+ );
+ ?>
+ </label>
+ <?php
+ /**
+ * Fires at the end of the Discussion meta box on the post editing screen.
+ *
+ * @since 3.1.0
+ *
+ * @param WP_Post $post WP_Post object of the current post.
+ */
+ do_action( 'post_comment_status_meta_box-options', $post );
+ ?>
+</p>
+ <?php
+}
+
+/**
+ * Display comments for post table header
+ *
+ * @since 3.0.0
+ *
+ * @param array $result table header rows
+ * @return array
+ */
+function post_comment_meta_box_thead( $result ) {
+ unset( $result['cb'], $result['response'] );
+ return $result;
+}
+
+/**
+ * Display comments for post.
+ *
+ * @since 2.8.0
+ *
+ * @param object $post
+ */
+function post_comment_meta_box( $post ) {
+ wp_nonce_field( 'get-comments', 'add_comment_nonce', false );
+ ?>
+ <p class="hide-if-no-js" id="add-new-comment"><button type="button" class="button" onclick="window.commentReply && commentReply.addcomment(<?php echo $post->ID; ?>);"><?php _e( 'Add comment' ); ?></button></p>
+ <?php
+
+ $total = get_comments(
+ array(
+ 'post_id' => $post->ID,
+ 'number' => 1,
+ 'count' => true,
+ )
+ );
+ $wp_list_table = _get_list_table( 'WP_Post_Comments_List_Table' );
+ $wp_list_table->display( true );
+
+ if ( 1 > $total ) {
+ echo '<p id="no-comments">' . __( 'No comments yet.' ) . '</p>';
+ } else {
+ $hidden = get_hidden_meta_boxes( get_current_screen() );
+ if ( ! in_array( 'commentsdiv', $hidden ) ) {
+ ?>
+ <script type="text/javascript">jQuery(document).ready(function(){commentsBox.get(<?php echo $total; ?>, 10);});</script>
+ <?php
+ }
+
+ ?>
+ <p class="hide-if-no-js" id="show-comments"><a href="#commentstatusdiv" onclick="commentsBox.load(<?php echo $total; ?>);return false;"><?php _e( 'Show comments' ); ?></a> <span class="spinner"></span></p>
+ <?php
+ }
+
+ wp_comment_trashnotice();
+}
+
+/**
+ * Display slug form fields.
+ *
+ * @since 2.6.0
+ *
+ * @param object $post
+ */
+function post_slug_meta_box( $post ) {
+ /** This filter is documented in wp-admin/edit-tag-form.php */
+ $editable_slug = apply_filters( 'editable_slug', $post->post_name, $post );
+ ?>
+<label class="screen-reader-text" for="post_name"><?php _e( 'Slug' ); ?></label><input name="post_name" type="text" size="13" id="post_name" value="<?php echo esc_attr( $editable_slug ); ?>" />
+ <?php
+}
+
+/**
+ * Display form field with list of authors.
+ *
+ * @since 2.6.0
+ *
+ * @global int $user_ID
+ *
+ * @param object $post
+ */
+function post_author_meta_box( $post ) {
+ global $user_ID;
+ ?>
+<label class="screen-reader-text" for="post_author_override"><?php _e( 'Author' ); ?></label>
+ <?php
+ wp_dropdown_users(
+ array(
+ 'who' => 'authors',
+ 'name' => 'post_author_override',
+ 'selected' => empty( $post->ID ) ? $user_ID : $post->post_author,
+ 'include_selected' => true,
+ 'show' => 'display_name_with_login',
+ )
+ );
+}
+
+/**
+ * Display list of revisions.
+ *
+ * @since 2.6.0
+ *
+ * @param object $post
+ */
+function post_revisions_meta_box( $post ) {
+ wp_list_post_revisions( $post );
+}
+
+// -- Page related Meta Boxes
+
+/**
+ * Display page attributes form fields.
+ *
+ * @since 2.7.0
+ *
+ * @param object $post
+ */
+function page_attributes_meta_box( $post ) {
+ if ( is_post_type_hierarchical( $post->post_type ) ) :
+ $dropdown_args = array(
+ 'post_type' => $post->post_type,
+ 'exclude_tree' => $post->ID,
+ 'selected' => $post->post_parent,
+ 'name' => 'parent_id',
+ 'show_option_none' => __( '(no parent)' ),
+ 'sort_column' => 'menu_order, post_title',
+ 'echo' => 0,
+ );
+
+ /**
+ * Filters the arguments used to generate a Pages drop-down element.
+ *
+ * @since 3.3.0
+ *
+ * @see wp_dropdown_pages()
+ *
+ * @param array $dropdown_args Array of arguments used to generate the pages drop-down.
+ * @param WP_Post $post The current post.
+ */
+ $dropdown_args = apply_filters( 'page_attributes_dropdown_pages_args', $dropdown_args, $post );
+ $pages = wp_dropdown_pages( $dropdown_args );
+ if ( ! empty( $pages ) ) :
+ ?>
+<p class="post-attributes-label-wrapper"><label class="post-attributes-label" for="parent_id"><?php _e( 'Parent' ); ?></label></p>
+ <?php echo $pages; ?>
+ <?php
+ endif; // end empty pages check
+ endif; // end hierarchical check.
+
+ if ( count( get_page_templates( $post ) ) > 0 && get_option( 'page_for_posts' ) != $post->ID ) :
+ $template = ! empty( $post->page_template ) ? $post->page_template : false;
+ ?>
+<p class="post-attributes-label-wrapper"><label class="post-attributes-label" for="page_template"><?php _e( 'Template' ); ?></label>
+ <?php
+ /**
+ * Fires immediately after the label inside the 'Template' section
+ * of the 'Page Attributes' meta box.
+ *
+ * @since 4.4.0
+ *
+ * @param string $template The template used for the current post.
+ * @param WP_Post $post The current post.
+ */
+ do_action( 'page_attributes_meta_box_template', $template, $post );
+ ?>
+</p>
+<select name="page_template" id="page_template">
+ <?php
+ /**
+ * Filters the title of the default page template displayed in the drop-down.
+ *
+ * @since 4.1.0
+ *
+ * @param string $label The display value for the default page template title.
+ * @param string $context Where the option label is displayed. Possible values
+ * include 'meta-box' or 'quick-edit'.
+ */
+ $default_title = apply_filters( 'default_page_template_title', __( 'Default Template' ), 'meta-box' );
+ ?>
+<option value="default"><?php echo esc_html( $default_title ); ?></option>
+ <?php page_template_dropdown( $template, $post->post_type ); ?>
+</select>
+<?php endif; ?>
+ <?php if ( post_type_supports( $post->post_type, 'page-attributes' ) ) : ?>
+<p class="post-attributes-label-wrapper"><label class="post-attributes-label" for="menu_order"><?php _e( 'Order' ); ?></label></p>
+<input name="menu_order" type="text" size="4" id="menu_order" value="<?php echo esc_attr( $post->menu_order ); ?>" />
+ <?php
+ /**
+ * Fires before the help hint text in the 'Page Attributes' meta box.
+ *
+ * @since 4.9.0
+ *
+ * @param WP_Post $post The current post.
+ */
+ do_action( 'page_attributes_misc_attributes', $post );
+ ?>
+ <?php if ( 'page' == $post->post_type && get_current_screen()->get_help_tabs() ) : ?>
+<p><?php _e( 'Need help? Use the Help tab above the screen title.' ); ?></p>
+ <?php
+ endif;
+ endif;
+}
+
+// -- Link related Meta Boxes
+
+/**
+ * Display link create form fields.
+ *
+ * @since 2.7.0
+ *
+ * @param object $link
+ */
+function link_submit_meta_box( $link ) {
+ ?>
+<div class="submitbox" id="submitlink">
+
+<div id="minor-publishing">
+
+ <?php // Hidden submit button early on so that the browser chooses the right button when form is submitted with Return key ?>
+<div style="display:none;">
+ <?php submit_button( __( 'Save' ), '', 'save', false ); ?>
+</div>
+
+<div id="minor-publishing-actions">
+<div id="preview-action">
+ <?php if ( ! empty( $link->link_id ) ) { ?>
+ <a class="preview button" href="<?php echo $link->link_url; ?>" target="_blank"><?php _e( 'Visit Link' ); ?></a>
+<?php } ?>
+</div>
+<div class="clear"></div>
+</div>
+
+<div id="misc-publishing-actions">
+<div class="misc-pub-section misc-pub-private">
+ <label for="link_private" class="selectit"><input id="link_private" name="link_visible" type="checkbox" value="N" <?php checked( $link->link_visible, 'N' ); ?> /> <?php _e( 'Keep this link private' ); ?></label>
+</div>
+</div>
+
+</div>
+
+<div id="major-publishing-actions">
+ <?php
+ /** This action is documented in wp-admin/includes/meta-boxes.php */
+ do_action( 'post_submitbox_start', null );
+ ?>
+<div id="delete-action">
+ <?php
+ if ( ! empty( $_GET['action'] ) && 'edit' == $_GET['action'] && current_user_can( 'manage_links' ) ) {
+ ?>
+ <a class="submitdelete deletion" href="<?php echo wp_nonce_url( "link.php?action=delete&amp;link_id=$link->link_id", 'delete-bookmark_' . $link->link_id ); ?>" onclick="if ( confirm('<?php echo esc_js( sprintf( __( "You are about to delete this link '%s'\n 'Cancel' to stop, 'OK' to delete." ), $link->link_name ) ); ?>') ) {return true;}return false;"><?php _e( 'Delete' ); ?></a>
+<?php } ?>
+</div>
+
+<div id="publishing-action">
+ <?php if ( ! empty( $link->link_id ) ) { ?>
+ <input name="save" type="submit" class="button button-primary button-large" id="publish" value="<?php esc_attr_e( 'Update Link' ); ?>" />
+<?php } else { ?>
+ <input name="save" type="submit" class="button button-primary button-large" id="publish" value="<?php esc_attr_e( 'Add Link' ); ?>" />
+<?php } ?>
+</div>
+<div class="clear"></div>
+</div>
+ <?php
+ /**
+ * Fires at the end of the Publish box in the Link editing screen.
+ *
+ * @since 2.5.0
+ */
+ do_action( 'submitlink_box' );
+ ?>
+<div class="clear"></div>
+</div>
+ <?php
+}
+
+/**
+ * Display link categories form fields.
+ *
+ * @since 2.6.0
+ *
+ * @param object $link
+ */
+function link_categories_meta_box( $link ) {
+ ?>
+<div id="taxonomy-linkcategory" class="categorydiv">
+ <ul id="category-tabs" class="category-tabs">
+ <li class="tabs"><a href="#categories-all"><?php _e( 'All Categories' ); ?></a></li>
+ <li class="hide-if-no-js"><a href="#categories-pop"><?php _ex( 'Most Used', 'categories' ); ?></a></li>
+ </ul>
+
+ <div id="categories-all" class="tabs-panel">
+ <ul id="categorychecklist" data-wp-lists="list:category" class="categorychecklist form-no-clear">
+ <?php
+ if ( isset( $link->link_id ) ) {
+ wp_link_category_checklist( $link->link_id );
+ } else {
+ wp_link_category_checklist();
+ }
+ ?>
+ </ul>
+ </div>
+
+ <div id="categories-pop" class="tabs-panel" style="display: none;">
+ <ul id="categorychecklist-pop" class="categorychecklist form-no-clear">
+ <?php wp_popular_terms_checklist( 'link_category' ); ?>
+ </ul>
+ </div>
+
+ <div id="category-adder" class="wp-hidden-children">
+ <a id="category-add-toggle" href="#category-add" class="taxonomy-add-new"><?php _e( '+ Add New Category' ); ?></a>
+ <p id="link-category-add" class="wp-hidden-child">
+ <label class="screen-reader-text" for="newcat"><?php _e( '+ Add New Category' ); ?></label>
+ <input type="text" name="newcat" id="newcat" class="form-required form-input-tip" value="<?php esc_attr_e( 'New category name' ); ?>" aria-required="true" />
+ <input type="button" id="link-category-add-submit" data-wp-lists="add:categorychecklist:link-category-add" class="button" value="<?php esc_attr_e( 'Add' ); ?>" />
+ <?php wp_nonce_field( 'add-link-category', '_ajax_nonce', false ); ?>
+ <span id="category-ajax-response"></span>
+ </p>
+ </div>
+</div>
+ <?php
+}
+
+/**
+ * Display form fields for changing link target.
+ *
+ * @since 2.6.0
+ *
+ * @param object $link
+ */
+function link_target_meta_box( $link ) {
+
+ ?>
+<fieldset><legend class="screen-reader-text"><span><?php _e( 'Target' ); ?></span></legend>
+<p><label for="link_target_blank" class="selectit">
+<input id="link_target_blank" type="radio" name="link_target" value="_blank" <?php echo ( isset( $link->link_target ) && ( $link->link_target == '_blank' ) ? 'checked="checked"' : '' ); ?> />
+ <?php _e( '<code>_blank</code> &mdash; new window or tab.' ); ?></label></p>
+<p><label for="link_target_top" class="selectit">
+<input id="link_target_top" type="radio" name="link_target" value="_top" <?php echo ( isset( $link->link_target ) && ( $link->link_target == '_top' ) ? 'checked="checked"' : '' ); ?> />
+ <?php _e( '<code>_top</code> &mdash; current window or tab, with no frames.' ); ?></label></p>
+<p><label for="link_target_none" class="selectit">
+<input id="link_target_none" type="radio" name="link_target" value="" <?php echo ( isset( $link->link_target ) && ( $link->link_target == '' ) ? 'checked="checked"' : '' ); ?> />
+ <?php _e( '<code>_none</code> &mdash; same window or tab.' ); ?></label></p>
+</fieldset>
+<p><?php _e( 'Choose the target frame for your link.' ); ?></p>
+ <?php
+}
+
+/**
+ * Display checked checkboxes attribute for xfn microformat options.
+ *
+ * @since 1.0.1
+ *
+ * @global object $link
+ *
+ * @param string $class
+ * @param string $value
+ * @param mixed $deprecated Never used.
+ */
+function xfn_check( $class, $value = '', $deprecated = '' ) {
+ global $link;
+
+ if ( ! empty( $deprecated ) ) {
+ _deprecated_argument( __FUNCTION__, '2.5.0' ); // Never implemented
+ }
+
+ $link_rel = isset( $link->link_rel ) ? $link->link_rel : ''; // In PHP 5.3: $link_rel = $link->link_rel ?: '';
+ $rels = preg_split( '/\s+/', $link_rel );
+
+ if ( '' != $value && in_array( $value, $rels ) ) {
+ echo ' checked="checked"';
+ }
+
+ if ( '' == $value ) {
+ if ( 'family' == $class && strpos( $link_rel, 'child' ) === false && strpos( $link_rel, 'parent' ) === false && strpos( $link_rel, 'sibling' ) === false && strpos( $link_rel, 'spouse' ) === false && strpos( $link_rel, 'kin' ) === false ) {
+ echo ' checked="checked"';
+ }
+ if ( 'friendship' == $class && strpos( $link_rel, 'friend' ) === false && strpos( $link_rel, 'acquaintance' ) === false && strpos( $link_rel, 'contact' ) === false ) {
+ echo ' checked="checked"';
+ }
+ if ( 'geographical' == $class && strpos( $link_rel, 'co-resident' ) === false && strpos( $link_rel, 'neighbor' ) === false ) {
+ echo ' checked="checked"';
+ }
+ if ( 'identity' == $class && in_array( 'me', $rels ) ) {
+ echo ' checked="checked"';
+ }
+ }
+}
+
+/**
+ * Display xfn form fields.
+ *
+ * @since 2.6.0
+ *
+ * @param object $link
+ */
+function link_xfn_meta_box( $link ) {
+ ?>
+<table class="links-table">
+ <tr>
+ <th scope="row"><label for="link_rel"><?php /* translators: xfn: http://gmpg.org/xfn/ */ _e( 'rel:' ); ?></label></th>
+ <td><input type="text" name="link_rel" id="link_rel" value="<?php echo ( isset( $link->link_rel ) ? esc_attr( $link->link_rel ) : '' ); ?>" /></td>
+ </tr>
+ <tr>
+ <th scope="row"><?php /* translators: xfn: http://gmpg.org/xfn/ */ _e( 'identity' ); ?></th>
+ <td><fieldset><legend class="screen-reader-text"><span><?php /* translators: xfn: http://gmpg.org/xfn/ */ _e( 'identity' ); ?></span></legend>
+ <label for="me">
+ <input type="checkbox" name="identity" value="me" id="me" <?php xfn_check( 'identity', 'me' ); ?> />
+ <?php _e( 'another web address of mine' ); ?></label>
+ </fieldset></td>
+ </tr>
+ <tr>
+ <th scope="row"><?php /* translators: xfn: http://gmpg.org/xfn/ */ _e( 'friendship' ); ?></th>
+ <td><fieldset><legend class="screen-reader-text"><span><?php /* translators: xfn: http://gmpg.org/xfn/ */ _e( 'friendship' ); ?></span></legend>
+ <label for="contact">
+ <input class="valinp" type="radio" name="friendship" value="contact" id="contact" <?php xfn_check( 'friendship', 'contact' ); ?> />&nbsp;<?php /* translators: xfn: http://gmpg.org/xfn/ */ _e( 'contact' ); ?>
+ </label>
+ <label for="acquaintance">
+ <input class="valinp" type="radio" name="friendship" value="acquaintance" id="acquaintance" <?php xfn_check( 'friendship', 'acquaintance' ); ?> />&nbsp;<?php /* translators: xfn: http://gmpg.org/xfn/ */ _e( 'acquaintance' ); ?>
+ </label>
+ <label for="friend">
+ <input class="valinp" type="radio" name="friendship" value="friend" id="friend" <?php xfn_check( 'friendship', 'friend' ); ?> />&nbsp;<?php /* translators: xfn: http://gmpg.org/xfn/ */ _e( 'friend' ); ?>
+ </label>
+ <label for="friendship">
+ <input name="friendship" type="radio" class="valinp" value="" id="friendship" <?php xfn_check( 'friendship' ); ?> />&nbsp;<?php /* translators: xfn: http://gmpg.org/xfn/ */ _e( 'none' ); ?>
+ </label>
+ </fieldset></td>
+ </tr>
+ <tr>
+ <th scope="row"> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e( 'physical' ); ?> </th>
+ <td><fieldset><legend class="screen-reader-text"><span><?php /* translators: xfn: http://gmpg.org/xfn/ */ _e( 'physical' ); ?></span></legend>
+ <label for="met">
+ <input class="valinp" type="checkbox" name="physical" value="met" id="met" <?php xfn_check( 'physical', 'met' ); ?> />&nbsp;<?php /* translators: xfn: http://gmpg.org/xfn/ */ _e( 'met' ); ?>
+ </label>
+ </fieldset></td>
+ </tr>
+ <tr>
+ <th scope="row"> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e( 'professional' ); ?> </th>
+ <td><fieldset><legend class="screen-reader-text"><span><?php /* translators: xfn: http://gmpg.org/xfn/ */ _e( 'professional' ); ?></span></legend>
+ <label for="co-worker">
+ <input class="valinp" type="checkbox" name="professional" value="co-worker" id="co-worker" <?php xfn_check( 'professional', 'co-worker' ); ?> />&nbsp;<?php /* translators: xfn: http://gmpg.org/xfn/ */ _e( 'co-worker' ); ?>
+ </label>
+ <label for="colleague">
+ <input class="valinp" type="checkbox" name="professional" value="colleague" id="colleague" <?php xfn_check( 'professional', 'colleague' ); ?> />&nbsp;<?php /* translators: xfn: http://gmpg.org/xfn/ */ _e( 'colleague' ); ?>
+ </label>
+ </fieldset></td>
+ </tr>
+ <tr>
+ <th scope="row"><?php /* translators: xfn: http://gmpg.org/xfn/ */ _e( 'geographical' ); ?></th>
+ <td><fieldset><legend class="screen-reader-text"><span> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e( 'geographical' ); ?> </span></legend>
+ <label for="co-resident">
+ <input class="valinp" type="radio" name="geographical" value="co-resident" id="co-resident" <?php xfn_check( 'geographical', 'co-resident' ); ?> />&nbsp;<?php /* translators: xfn: http://gmpg.org/xfn/ */ _e( 'co-resident' ); ?>
+ </label>
+ <label for="neighbor">
+ <input class="valinp" type="radio" name="geographical" value="neighbor" id="neighbor" <?php xfn_check( 'geographical', 'neighbor' ); ?> />&nbsp;<?php /* translators: xfn: http://gmpg.org/xfn/ */ _e( 'neighbor' ); ?>
+ </label>
+ <label for="geographical">
+ <input class="valinp" type="radio" name="geographical" value="" id="geographical" <?php xfn_check( 'geographical' ); ?> />&nbsp;<?php /* translators: xfn: http://gmpg.org/xfn/ */ _e( 'none' ); ?>
+ </label>
+ </fieldset></td>
+ </tr>
+ <tr>
+ <th scope="row"><?php /* translators: xfn: http://gmpg.org/xfn/ */ _e( 'family' ); ?></th>
+ <td><fieldset><legend class="screen-reader-text"><span> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e( 'family' ); ?> </span></legend>
+ <label for="child">
+ <input class="valinp" type="radio" name="family" value="child" id="child" <?php xfn_check( 'family', 'child' ); ?> />&nbsp;<?php /* translators: xfn: http://gmpg.org/xfn/ */ _e( 'child' ); ?>
+ </label>
+ <label for="kin">
+ <input class="valinp" type="radio" name="family" value="kin" id="kin" <?php xfn_check( 'family', 'kin' ); ?> />&nbsp;<?php /* translators: xfn: http://gmpg.org/xfn/ */ _e( 'kin' ); ?>
+ </label>
+ <label for="parent">
+ <input class="valinp" type="radio" name="family" value="parent" id="parent" <?php xfn_check( 'family', 'parent' ); ?> />&nbsp;<?php /* translators: xfn: http://gmpg.org/xfn/ */ _e( 'parent' ); ?>
+ </label>
+ <label for="sibling">
+ <input class="valinp" type="radio" name="family" value="sibling" id="sibling" <?php xfn_check( 'family', 'sibling' ); ?> />&nbsp;<?php /* translators: xfn: http://gmpg.org/xfn/ */ _e( 'sibling' ); ?>
+ </label>
+ <label for="spouse">
+ <input class="valinp" type="radio" name="family" value="spouse" id="spouse" <?php xfn_check( 'family', 'spouse' ); ?> />&nbsp;<?php /* translators: xfn: http://gmpg.org/xfn/ */ _e( 'spouse' ); ?>
+ </label>
+ <label for="family">
+ <input class="valinp" type="radio" name="family" value="" id="family" <?php xfn_check( 'family' ); ?> />&nbsp;<?php /* translators: xfn: http://gmpg.org/xfn/ */ _e( 'none' ); ?>
+ </label>
+ </fieldset></td>
+ </tr>
+ <tr>
+ <th scope="row"><?php /* translators: xfn: http://gmpg.org/xfn/ */ _e( 'romantic' ); ?></th>
+ <td><fieldset><legend class="screen-reader-text"><span> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e( 'romantic' ); ?> </span></legend>
+ <label for="muse">
+ <input class="valinp" type="checkbox" name="romantic" value="muse" id="muse" <?php xfn_check( 'romantic', 'muse' ); ?> />&nbsp;<?php /* translators: xfn: http://gmpg.org/xfn/ */ _e( 'muse' ); ?>
+ </label>
+ <label for="crush">
+ <input class="valinp" type="checkbox" name="romantic" value="crush" id="crush" <?php xfn_check( 'romantic', 'crush' ); ?> />&nbsp;<?php /* translators: xfn: http://gmpg.org/xfn/ */ _e( 'crush' ); ?>
+ </label>
+ <label for="date">
+ <input class="valinp" type="checkbox" name="romantic" value="date" id="date" <?php xfn_check( 'romantic', 'date' ); ?> />&nbsp;<?php /* translators: xfn: http://gmpg.org/xfn/ */ _e( 'date' ); ?>
+ </label>
+ <label for="romantic">
+ <input class="valinp" type="checkbox" name="romantic" value="sweetheart" id="romantic" <?php xfn_check( 'romantic', 'sweetheart' ); ?> />&nbsp;<?php /* translators: xfn: http://gmpg.org/xfn/ */ _e( 'sweetheart' ); ?>
+ </label>
+ </fieldset></td>
+ </tr>
+
+</table>
+<p><?php _e( 'If the link is to a person, you can specify your relationship with them using the above form. If you would like to learn more about the idea check out <a href="http://gmpg.org/xfn/">XFN</a>.' ); ?></p>
+ <?php
+}
+
+/**
+ * Display advanced link options form fields.
+ *
+ * @since 2.6.0
+ *
+ * @param object $link
+ */
+function link_advanced_meta_box( $link ) {
+ ?>
+<table class="links-table" cellpadding="0">
+ <tr>
+ <th scope="row"><label for="link_image"><?php _e( 'Image Address' ); ?></label></th>
+ <td><input type="text" name="link_image" class="code" id="link_image" maxlength="255" value="<?php echo ( isset( $link->link_image ) ? esc_attr( $link->link_image ) : '' ); ?>" /></td>
+ </tr>
+ <tr>
+ <th scope="row"><label for="rss_uri"><?php _e( 'RSS Address' ); ?></label></th>
+ <td><input name="link_rss" class="code" type="text" id="rss_uri" maxlength="255" value="<?php echo ( isset( $link->link_rss ) ? esc_attr( $link->link_rss ) : '' ); ?>" /></td>
+ </tr>
+ <tr>
+ <th scope="row"><label for="link_notes"><?php _e( 'Notes' ); ?></label></th>
+ <td><textarea name="link_notes" id="link_notes" rows="10"><?php echo ( isset( $link->link_notes ) ? $link->link_notes : '' ); // textarea_escaped ?></textarea></td>
+ </tr>
+ <tr>
+ <th scope="row"><label for="link_rating"><?php _e( 'Rating' ); ?></label></th>
+ <td><select name="link_rating" id="link_rating" size="1">
+ <?php
+ for ( $r = 0; $r <= 10; $r++ ) {
+ echo '<option value="' . $r . '"';
+ if ( isset( $link->link_rating ) && $link->link_rating == $r ) {
+ echo ' selected="selected"';
+ }
+ echo( '>' . $r . '</option>' );
+ }
+ ?>
+ </select>&nbsp;<?php _e( '(Leave at 0 for no rating.)' ); ?>
+ </td>
+ </tr>
+</table>
+ <?php
+}
+
+/**
+ * Display post thumbnail meta box.
+ *
+ * @since 2.9.0
+ *
+ * @param WP_Post $post A post object.
+ */
+function post_thumbnail_meta_box( $post ) {
+ $thumbnail_id = get_post_meta( $post->ID, '_thumbnail_id', true );
+ echo _wp_post_thumbnail_html( $thumbnail_id, $post->ID );
+}
+
+/**
+ * Display fields for ID3 data
+ *
+ * @since 3.9.0
+ *
+ * @param WP_Post $post A post object.
+ */
+function attachment_id3_data_meta_box( $post ) {
+ $meta = array();
+ if ( ! empty( $post->ID ) ) {
+ $meta = wp_get_attachment_metadata( $post->ID );
+ }
+
+ foreach ( wp_get_attachment_id3_keys( $post, 'edit' ) as $key => $label ) :
+ $value = '';
+ if ( ! empty( $meta[ $key ] ) ) {
+ $value = $meta[ $key ];
+ }
+ ?>
+ <p>
+ <label for="title"><?php echo $label; ?></label><br />
+ <input type="text" name="id3_<?php echo esc_attr( $key ); ?>" id="id3_<?php echo esc_attr( $key ); ?>" class="large-text" value="<?php echo esc_attr( $value ); ?>" />
+ </p>
+ <?php
+ endforeach;
+}
+
+/**
+ * Registers the default post meta boxes, and runs the `do_meta_boxes` actions.
+ *
+ * @since 5.0.0
+ *
+ * @param WP_Post $post The post object that these meta boxes are being generated for.
+ */
+function register_and_do_post_meta_boxes( $post ) {
+ $post_type = $post->post_type;
+ $post_type_object = get_post_type_object( $post_type );
+
+ $thumbnail_support = current_theme_supports( 'post-thumbnails', $post_type ) && post_type_supports( $post_type, 'thumbnail' );
+ if ( ! $thumbnail_support && 'attachment' === $post_type && $post->post_mime_type ) {
+ if ( wp_attachment_is( 'audio', $post ) ) {
+ $thumbnail_support = post_type_supports( 'attachment:audio', 'thumbnail' ) || current_theme_supports( 'post-thumbnails', 'attachment:audio' );
+ } elseif ( wp_attachment_is( 'video', $post ) ) {
+ $thumbnail_support = post_type_supports( 'attachment:video', 'thumbnail' ) || current_theme_supports( 'post-thumbnails', 'attachment:video' );
+ }
+ }
+
+ $publish_callback_args = array( '__back_compat_meta_box' => true );
+ if ( post_type_supports( $post_type, 'revisions' ) && 'auto-draft' != $post->post_status ) {
+ $revisions = wp_get_post_revisions( $post->ID );
+
+ // We should aim to show the revisions meta box only when there are revisions.
+ if ( count( $revisions ) > 1 ) {
+ reset( $revisions ); // Reset pointer for key()
+ $publish_callback_args = array(
+ 'revisions_count' => count( $revisions ),
+ 'revision_id' => key( $revisions ),
+ '__back_compat_meta_box' => true,
+ );
+ add_meta_box( 'revisionsdiv', __( 'Revisions' ), 'post_revisions_meta_box', null, 'normal', 'core', array( '__back_compat_meta_box' => true ) );
+ }
+ }
+
+ if ( 'attachment' == $post_type ) {
+ wp_enqueue_script( 'image-edit' );
+ wp_enqueue_style( 'imgareaselect' );
+ add_meta_box( 'submitdiv', __( 'Save' ), 'attachment_submit_meta_box', null, 'side', 'core', array( '__back_compat_meta_box' => true ) );
+ add_action( 'edit_form_after_title', 'edit_form_image_editor' );
+
+ if ( wp_attachment_is( 'audio', $post ) ) {
+ add_meta_box( 'attachment-id3', __( 'Metadata' ), 'attachment_id3_data_meta_box', null, 'normal', 'core', array( '__back_compat_meta_box' => true ) );
+ }
+ } else {
+ add_meta_box( 'submitdiv', __( 'Publish' ), 'post_submit_meta_box', null, 'side', 'core', $publish_callback_args );
+ }
+
+ if ( current_theme_supports( 'post-formats' ) && post_type_supports( $post_type, 'post-formats' ) ) {
+ add_meta_box( 'formatdiv', _x( 'Format', 'post format' ), 'post_format_meta_box', null, 'side', 'core', array( '__back_compat_meta_box' => true ) );
+ }
+
+ // all taxonomies
+ foreach ( get_object_taxonomies( $post ) as $tax_name ) {
+ $taxonomy = get_taxonomy( $tax_name );
+ if ( ! $taxonomy->show_ui || false === $taxonomy->meta_box_cb ) {
+ continue;
+ }
+
+ $label = $taxonomy->labels->name;
+
+ if ( ! is_taxonomy_hierarchical( $tax_name ) ) {
+ $tax_meta_box_id = 'tagsdiv-' . $tax_name;
+ } else {
+ $tax_meta_box_id = $tax_name . 'div';
+ }
+
+ add_meta_box(
+ $tax_meta_box_id,
+ $label,
+ $taxonomy->meta_box_cb,
+ null,
+ 'side',
+ 'core',
+ array(
+ 'taxonomy' => $tax_name,
+ '__back_compat_meta_box' => true,
+ )
+ );
+ }
+
+ if ( post_type_supports( $post_type, 'page-attributes' ) || count( get_page_templates( $post ) ) > 0 ) {
+ add_meta_box( 'pageparentdiv', $post_type_object->labels->attributes, 'page_attributes_meta_box', null, 'side', 'core', array( '__back_compat_meta_box' => true ) );
+ }
+
+ if ( $thumbnail_support && current_user_can( 'upload_files' ) ) {
+ add_meta_box( 'postimagediv', esc_html( $post_type_object->labels->featured_image ), 'post_thumbnail_meta_box', null, 'side', 'low', array( '__back_compat_meta_box' => true ) );
+ }
+
+ if ( post_type_supports( $post_type, 'excerpt' ) ) {
+ add_meta_box( 'postexcerpt', __( 'Excerpt' ), 'post_excerpt_meta_box', null, 'normal', 'core', array( '__back_compat_meta_box' => true ) );
+ }
+
+ if ( post_type_supports( $post_type, 'trackbacks' ) ) {
+ add_meta_box( 'trackbacksdiv', __( 'Send Trackbacks' ), 'post_trackback_meta_box', null, 'normal', 'core', array( '__back_compat_meta_box' => true ) );
+ }
+
+ if ( post_type_supports( $post_type, 'custom-fields' ) ) {
+ add_meta_box(
+ 'postcustom',
+ __( 'Custom Fields' ),
+ 'post_custom_meta_box',
+ null,
+ 'normal',
+ 'core',
+ array(
+ '__back_compat_meta_box' => ! (bool) get_user_meta( get_current_user_id(), 'enable_custom_fields', true ),
+ '__block_editor_compatible_meta_box' => true,
+ )
+ );
+ }
+
+ /**
+ * Fires in the middle of built-in meta box registration.
+ *
+ * @since 2.1.0
+ * @deprecated 3.7.0 Use 'add_meta_boxes' instead.
+ *
+ * @param WP_Post $post Post object.
+ */
+ do_action( 'dbx_post_advanced', $post );
+
+ // Allow the Discussion meta box to show up if the post type supports comments,
+ // or if comments or pings are open.
+ if ( comments_open( $post ) || pings_open( $post ) || post_type_supports( $post_type, 'comments' ) ) {
+ add_meta_box( 'commentstatusdiv', __( 'Discussion' ), 'post_comment_status_meta_box', null, 'normal', 'core', array( '__back_compat_meta_box' => true ) );
+ }
+
+ $stati = get_post_stati( array( 'public' => true ) );
+ if ( empty( $stati ) ) {
+ $stati = array( 'publish' );
+ }
+ $stati[] = 'private';
+
+ if ( in_array( get_post_status( $post ), $stati ) ) {
+ // If the post type support comments, or the post has comments, allow the
+ // Comments meta box.
+ if ( comments_open( $post ) || pings_open( $post ) || $post->comment_count > 0 || post_type_supports( $post_type, 'comments' ) ) {
+ add_meta_box( 'commentsdiv', __( 'Comments' ), 'post_comment_meta_box', null, 'normal', 'core', array( '__back_compat_meta_box' => true ) );
+ }
+ }
+
+ if ( ! ( 'pending' == get_post_status( $post ) && ! current_user_can( $post_type_object->cap->publish_posts ) ) ) {
+ add_meta_box( 'slugdiv', __( 'Slug' ), 'post_slug_meta_box', null, 'normal', 'core', array( '__back_compat_meta_box' => true ) );
+ }
+
+ if ( post_type_supports( $post_type, 'author' ) && current_user_can( $post_type_object->cap->edit_others_posts ) ) {
+ add_meta_box( 'authordiv', __( 'Author' ), 'post_author_meta_box', null, 'normal', 'core', array( '__back_compat_meta_box' => true ) );
+ }
+
+ /**
+ * Fires after all built-in meta boxes have been added.
+ *
+ * @since 3.0.0
+ *
+ * @param string $post_type Post type.
+ * @param WP_Post $post Post object.
+ */
+ do_action( 'add_meta_boxes', $post_type, $post );
+
+ /**
+ * Fires after all built-in meta boxes have been added, contextually for the given post type.
+ *
+ * The dynamic portion of the hook, `$post_type`, refers to the post type of the post.
+ *
+ * @since 3.0.0
+ *
+ * @param WP_Post $post Post object.
+ */
+ do_action( "add_meta_boxes_{$post_type}", $post );
+
+ /**
+ * Fires after meta boxes have been added.
+ *
+ * Fires once for each of the default meta box contexts: normal, advanced, and side.
+ *
+ * @since 3.0.0
+ *
+ * @param string $post_type Post type of the post.
+ * @param string $context string Meta box context.
+ * @param WP_Post $post Post object.
+ */
+ do_action( 'do_meta_boxes', $post_type, 'normal', $post );
+ /** This action is documented in wp-admin/includes/meta-boxes.php */
+ do_action( 'do_meta_boxes', $post_type, 'advanced', $post );
+ /** This action is documented in wp-admin/includes/meta-boxes.php */
+ do_action( 'do_meta_boxes', $post_type, 'side', $post );
+}
diff --git a/www/crm/wp-admin/includes/misc.php b/www/crm/wp-admin/includes/misc.php
new file mode 100644
index 00000000..0dcebdfe
--- /dev/null
+++ b/www/crm/wp-admin/includes/misc.php
@@ -0,0 +1,2096 @@
+<?php
+/**
+ * Misc WordPress Administration API.
+ *
+ * @package WordPress
+ * @subpackage Administration
+ */
+
+/**
+ * Returns whether the server is running Apache with the mod_rewrite module loaded.
+ *
+ * @since 2.0.0
+ *
+ * @return bool
+ */
+function got_mod_rewrite() {
+ $got_rewrite = apache_mod_loaded( 'mod_rewrite', true );
+
+ /**
+ * Filters whether Apache and mod_rewrite are present.
+ *
+ * This filter was previously used to force URL rewriting for other servers,
+ * like nginx. Use the {@see 'got_url_rewrite'} filter in got_url_rewrite() instead.
+ *
+ * @since 2.5.0
+ *
+ * @see got_url_rewrite()
+ *
+ * @param bool $got_rewrite Whether Apache and mod_rewrite are present.
+ */
+ return apply_filters( 'got_rewrite', $got_rewrite );
+}
+
+/**
+ * Returns whether the server supports URL rewriting.
+ *
+ * Detects Apache's mod_rewrite, IIS 7.0+ permalink support, and nginx.
+ *
+ * @since 3.7.0
+ *
+ * @global bool $is_nginx
+ *
+ * @return bool Whether the server supports URL rewriting.
+ */
+function got_url_rewrite() {
+ $got_url_rewrite = ( got_mod_rewrite() || $GLOBALS['is_nginx'] || iis7_supports_permalinks() );
+
+ /**
+ * Filters whether URL rewriting is available.
+ *
+ * @since 3.7.0
+ *
+ * @param bool $got_url_rewrite Whether URL rewriting is available.
+ */
+ return apply_filters( 'got_url_rewrite', $got_url_rewrite );
+}
+
+/**
+ * Extracts strings from between the BEGIN and END markers in the .htaccess file.
+ *
+ * @since 1.5.0
+ *
+ * @param string $filename
+ * @param string $marker
+ * @return array An array of strings from a file (.htaccess ) from between BEGIN and END markers.
+ */
+function extract_from_markers( $filename, $marker ) {
+ $result = array();
+
+ if ( ! file_exists( $filename ) ) {
+ return $result;
+ }
+
+ $markerdata = explode( "\n", implode( '', file( $filename ) ) );
+
+ $state = false;
+ foreach ( $markerdata as $markerline ) {
+ if ( false !== strpos( $markerline, '# END ' . $marker ) ) {
+ $state = false;
+ }
+ if ( $state ) {
+ $result[] = $markerline;
+ }
+ if ( false !== strpos( $markerline, '# BEGIN ' . $marker ) ) {
+ $state = true;
+ }
+ }
+
+ return $result;
+}
+
+/**
+ * Inserts an array of strings into a file (.htaccess ), placing it between
+ * BEGIN and END markers.
+ *
+ * Replaces existing marked info. Retains surrounding
+ * data. Creates file if none exists.
+ *
+ * @since 1.5.0
+ *
+ * @param string $filename Filename to alter.
+ * @param string $marker The marker to alter.
+ * @param array|string $insertion The new content to insert.
+ * @return bool True on write success, false on failure.
+ */
+function insert_with_markers( $filename, $marker, $insertion ) {
+ if ( ! file_exists( $filename ) ) {
+ if ( ! is_writable( dirname( $filename ) ) ) {
+ return false;
+ }
+ if ( ! touch( $filename ) ) {
+ return false;
+ }
+ } elseif ( ! is_writeable( $filename ) ) {
+ return false;
+ }
+
+ if ( ! is_array( $insertion ) ) {
+ $insertion = explode( "\n", $insertion );
+ }
+
+ $start_marker = "# BEGIN {$marker}";
+ $end_marker = "# END {$marker}";
+
+ $fp = fopen( $filename, 'r+' );
+ if ( ! $fp ) {
+ return false;
+ }
+
+ // Attempt to get a lock. If the filesystem supports locking, this will block until the lock is acquired.
+ flock( $fp, LOCK_EX );
+
+ $lines = array();
+ while ( ! feof( $fp ) ) {
+ $lines[] = rtrim( fgets( $fp ), "\r\n" );
+ }
+
+ // Split out the existing file into the preceding lines, and those that appear after the marker
+ $pre_lines = $post_lines = $existing_lines = array();
+ $found_marker = $found_end_marker = false;
+ foreach ( $lines as $line ) {
+ if ( ! $found_marker && false !== strpos( $line, $start_marker ) ) {
+ $found_marker = true;
+ continue;
+ } elseif ( ! $found_end_marker && false !== strpos( $line, $end_marker ) ) {
+ $found_end_marker = true;
+ continue;
+ }
+ if ( ! $found_marker ) {
+ $pre_lines[] = $line;
+ } elseif ( $found_marker && $found_end_marker ) {
+ $post_lines[] = $line;
+ } else {
+ $existing_lines[] = $line;
+ }
+ }
+
+ // Check to see if there was a change
+ if ( $existing_lines === $insertion ) {
+ flock( $fp, LOCK_UN );
+ fclose( $fp );
+
+ return true;
+ }
+
+ // Generate the new file data
+ $new_file_data = implode(
+ "\n",
+ array_merge(
+ $pre_lines,
+ array( $start_marker ),
+ $insertion,
+ array( $end_marker ),
+ $post_lines
+ )
+ );
+
+ // Write to the start of the file, and truncate it to that length
+ fseek( $fp, 0 );
+ $bytes = fwrite( $fp, $new_file_data );
+ if ( $bytes ) {
+ ftruncate( $fp, ftell( $fp ) );
+ }
+ fflush( $fp );
+ flock( $fp, LOCK_UN );
+ fclose( $fp );
+
+ return (bool) $bytes;
+}
+
+/**
+ * Updates the htaccess file with the current rules if it is writable.
+ *
+ * Always writes to the file if it exists and is writable to ensure that we
+ * blank out old rules.
+ *
+ * @since 1.5.0
+ *
+ * @global WP_Rewrite $wp_rewrite
+ *
+ * @return bool|null True on write success, false on failure. Null in multisite.
+ */
+function save_mod_rewrite_rules() {
+ if ( is_multisite() ) {
+ return;
+ }
+
+ global $wp_rewrite;
+
+ // Ensure get_home_path() is declared.
+ require_once( ABSPATH . 'wp-admin/includes/file.php' );
+
+ $home_path = get_home_path();
+ $htaccess_file = $home_path . '.htaccess';
+
+ /*
+ * If the file doesn't already exist check for write access to the directory
+ * and whether we have some rules. Else check for write access to the file.
+ */
+ if ( ( ! file_exists( $htaccess_file ) && is_writable( $home_path ) && $wp_rewrite->using_mod_rewrite_permalinks() ) || is_writable( $htaccess_file ) ) {
+ if ( got_mod_rewrite() ) {
+ $rules = explode( "\n", $wp_rewrite->mod_rewrite_rules() );
+ return insert_with_markers( $htaccess_file, 'WordPress', $rules );
+ }
+ }
+
+ return false;
+}
+
+/**
+ * Updates the IIS web.config file with the current rules if it is writable.
+ * If the permalinks do not require rewrite rules then the rules are deleted from the web.config file.
+ *
+ * @since 2.8.0
+ *
+ * @global WP_Rewrite $wp_rewrite
+ *
+ * @return bool|null True on write success, false on failure. Null in multisite.
+ */
+function iis7_save_url_rewrite_rules() {
+ if ( is_multisite() ) {
+ return;
+ }
+
+ global $wp_rewrite;
+
+ // Ensure get_home_path() is declared.
+ require_once( ABSPATH . 'wp-admin/includes/file.php' );
+
+ $home_path = get_home_path();
+ $web_config_file = $home_path . 'web.config';
+
+ // Using win_is_writable() instead of is_writable() because of a bug in Windows PHP
+ if ( iis7_supports_permalinks() && ( ( ! file_exists( $web_config_file ) && win_is_writable( $home_path ) && $wp_rewrite->using_mod_rewrite_permalinks() ) || win_is_writable( $web_config_file ) ) ) {
+ $rule = $wp_rewrite->iis7_url_rewrite_rules( false );
+ if ( ! empty( $rule ) ) {
+ return iis7_add_rewrite_rule( $web_config_file, $rule );
+ } else {
+ return iis7_delete_rewrite_rule( $web_config_file );
+ }
+ }
+ return false;
+}
+
+/**
+ * Update the "recently-edited" file for the plugin or theme editor.
+ *
+ * @since 1.5.0
+ *
+ * @param string $file
+ */
+function update_recently_edited( $file ) {
+ $oldfiles = (array) get_option( 'recently_edited' );
+ if ( $oldfiles ) {
+ $oldfiles = array_reverse( $oldfiles );
+ $oldfiles[] = $file;
+ $oldfiles = array_reverse( $oldfiles );
+ $oldfiles = array_unique( $oldfiles );
+ if ( 5 < count( $oldfiles ) ) {
+ array_pop( $oldfiles );
+ }
+ } else {
+ $oldfiles[] = $file;
+ }
+ update_option( 'recently_edited', $oldfiles );
+}
+
+/**
+ * Makes a tree structure for the theme editor's file list.
+ *
+ * @since 4.9.0
+ * @access private
+ *
+ * @param array $allowed_files List of theme file paths.
+ * @return array Tree structure for listing theme files.
+ */
+function wp_make_theme_file_tree( $allowed_files ) {
+ $tree_list = array();
+ foreach ( $allowed_files as $file_name => $absolute_filename ) {
+ $list = explode( '/', $file_name );
+ $last_dir = &$tree_list;
+ foreach ( $list as $dir ) {
+ $last_dir =& $last_dir[ $dir ];
+ }
+ $last_dir = $file_name;
+ }
+ return $tree_list;
+}
+
+/**
+ * Outputs the formatted file list for the theme editor.
+ *
+ * @since 4.9.0
+ * @access private
+ *
+ * @global string $relative_file Name of the file being edited relative to the
+ * theme directory.
+ * @global string $stylesheet The stylesheet name of the theme being edited.
+ *
+ * @param array|string $tree List of file/folder paths, or filename.
+ * @param int $level The aria-level for the current iteration.
+ * @param int $size The aria-setsize for the current iteration.
+ * @param int $index The aria-posinset for the current iteration.
+ */
+function wp_print_theme_file_tree( $tree, $level = 2, $size = 1, $index = 1 ) {
+ global $relative_file, $stylesheet;
+
+ if ( is_array( $tree ) ) {
+ $index = 0;
+ $size = count( $tree );
+ foreach ( $tree as $label => $theme_file ) :
+ $index++;
+ if ( ! is_array( $theme_file ) ) {
+ wp_print_theme_file_tree( $theme_file, $level, $index, $size );
+ continue;
+ }
+ ?>
+ <li role="treeitem" aria-expanded="true" tabindex="-1"
+ aria-level="<?php echo esc_attr( $level ); ?>"
+ aria-setsize="<?php echo esc_attr( $size ); ?>"
+ aria-posinset="<?php echo esc_attr( $index ); ?>">
+ <span class="folder-label"><?php echo esc_html( $label ); ?> <span class="screen-reader-text"><?php _e( 'folder' ); ?></span><span aria-hidden="true" class="icon"></span></span>
+ <ul role="group" class="tree-folder"><?php wp_print_theme_file_tree( $theme_file, $level + 1, $index, $size ); ?></ul>
+ </li>
+ <?php
+ endforeach;
+ } else {
+ $filename = $tree;
+ $url = add_query_arg(
+ array(
+ 'file' => rawurlencode( $tree ),
+ 'theme' => rawurlencode( $stylesheet ),
+ ),
+ self_admin_url( 'theme-editor.php' )
+ );
+ ?>
+ <li role="none" class="<?php echo esc_attr( $relative_file === $filename ? 'current-file' : '' ); ?>">
+ <a role="treeitem" tabindex="<?php echo esc_attr( $relative_file === $filename ? '0' : '-1' ); ?>"
+ href="<?php echo esc_url( $url ); ?>"
+ aria-level="<?php echo esc_attr( $level ); ?>"
+ aria-setsize="<?php echo esc_attr( $size ); ?>"
+ aria-posinset="<?php echo esc_attr( $index ); ?>">
+ <?php
+ $file_description = esc_html( get_file_description( $filename ) );
+ if ( $file_description !== $filename && wp_basename( $filename ) !== $file_description ) {
+ $file_description .= '<br /><span class="nonessential">(' . esc_html( $filename ) . ')</span>';
+ }
+
+ if ( $relative_file === $filename ) {
+ echo '<span class="notice notice-info">' . $file_description . '</span>';
+ } else {
+ echo $file_description;
+ }
+ ?>
+ </a>
+ </li>
+ <?php
+ }
+}
+
+/**
+ * Makes a tree structure for the plugin editor's file list.
+ *
+ * @since 4.9.0
+ * @access private
+ *
+ * @param array $plugin_editable_files List of plugin file paths.
+ * @return array Tree structure for listing plugin files.
+ */
+function wp_make_plugin_file_tree( $plugin_editable_files ) {
+ $tree_list = array();
+ foreach ( $plugin_editable_files as $plugin_file ) {
+ $list = explode( '/', preg_replace( '#^.+?/#', '', $plugin_file ) );
+ $last_dir = &$tree_list;
+ foreach ( $list as $dir ) {
+ $last_dir =& $last_dir[ $dir ];
+ }
+ $last_dir = $plugin_file;
+ }
+ return $tree_list;
+}
+
+/**
+ * Outputs the formatted file list for the plugin editor.
+ *
+ * @since 4.9.0
+ * @access private
+ *
+ * @param array|string $tree List of file/folder paths, or filename.
+ * @param string $label Name of file or folder to print.
+ * @param int $level The aria-level for the current iteration.
+ * @param int $size The aria-setsize for the current iteration.
+ * @param int $index The aria-posinset for the current iteration.
+ */
+function wp_print_plugin_file_tree( $tree, $label = '', $level = 2, $size = 1, $index = 1 ) {
+ global $file, $plugin;
+ if ( is_array( $tree ) ) {
+ $index = 0;
+ $size = count( $tree );
+ foreach ( $tree as $label => $plugin_file ) :
+ $index++;
+ if ( ! is_array( $plugin_file ) ) {
+ wp_print_plugin_file_tree( $plugin_file, $label, $level, $index, $size );
+ continue;
+ }
+ ?>
+ <li role="treeitem" aria-expanded="true" tabindex="-1"
+ aria-level="<?php echo esc_attr( $level ); ?>"
+ aria-setsize="<?php echo esc_attr( $size ); ?>"
+ aria-posinset="<?php echo esc_attr( $index ); ?>">
+ <span class="folder-label"><?php echo esc_html( $label ); ?> <span class="screen-reader-text"><?php _e( 'folder' ); ?></span><span aria-hidden="true" class="icon"></span></span>
+ <ul role="group" class="tree-folder"><?php wp_print_plugin_file_tree( $plugin_file, '', $level + 1, $index, $size ); ?></ul>
+ </li>
+ <?php
+ endforeach;
+ } else {
+ $url = add_query_arg(
+ array(
+ 'file' => rawurlencode( $tree ),
+ 'plugin' => rawurlencode( $plugin ),
+ ),
+ self_admin_url( 'plugin-editor.php' )
+ );
+ ?>
+ <li role="none" class="<?php echo esc_attr( $file === $tree ? 'current-file' : '' ); ?>">
+ <a role="treeitem" tabindex="<?php echo esc_attr( $file === $tree ? '0' : '-1' ); ?>"
+ href="<?php echo esc_url( $url ); ?>"
+ aria-level="<?php echo esc_attr( $level ); ?>"
+ aria-setsize="<?php echo esc_attr( $size ); ?>"
+ aria-posinset="<?php echo esc_attr( $index ); ?>">
+ <?php
+ if ( $file === $tree ) {
+ echo '<span class="notice notice-info">' . esc_html( $label ) . '</span>';
+ } else {
+ echo esc_html( $label );
+ }
+ ?>
+ </a>
+ </li>
+ <?php
+ }
+}
+
+/**
+ * Flushes rewrite rules if siteurl, home or page_on_front changed.
+ *
+ * @since 2.1.0
+ *
+ * @param string $old_value
+ * @param string $value
+ */
+function update_home_siteurl( $old_value, $value ) {
+ if ( wp_installing() ) {
+ return;
+ }
+
+ if ( is_multisite() && ms_is_switched() ) {
+ delete_option( 'rewrite_rules' );
+ } else {
+ flush_rewrite_rules();
+ }
+}
+
+
+/**
+ * Resets global variables based on $_GET and $_POST
+ *
+ * This function resets global variables based on the names passed
+ * in the $vars array to the value of $_POST[$var] or $_GET[$var] or ''
+ * if neither is defined.
+ *
+ * @since 2.0.0
+ *
+ * @param array $vars An array of globals to reset.
+ */
+function wp_reset_vars( $vars ) {
+ foreach ( $vars as $var ) {
+ if ( empty( $_POST[ $var ] ) ) {
+ if ( empty( $_GET[ $var ] ) ) {
+ $GLOBALS[ $var ] = '';
+ } else {
+ $GLOBALS[ $var ] = $_GET[ $var ];
+ }
+ } else {
+ $GLOBALS[ $var ] = $_POST[ $var ];
+ }
+ }
+}
+
+/**
+ * Displays the given administration message.
+ *
+ * @since 2.1.0
+ *
+ * @param string|WP_Error $message
+ */
+function show_message( $message ) {
+ if ( is_wp_error( $message ) ) {
+ if ( $message->get_error_data() && is_string( $message->get_error_data() ) ) {
+ $message = $message->get_error_message() . ': ' . $message->get_error_data();
+ } else {
+ $message = $message->get_error_message();
+ }
+ }
+ echo "<p>$message</p>\n";
+ wp_ob_end_flush_all();
+ flush();
+}
+
+/**
+ * @since 2.8.0
+ *
+ * @param string $content
+ * @return array
+ */
+function wp_doc_link_parse( $content ) {
+ if ( ! is_string( $content ) || empty( $content ) ) {
+ return array();
+ }
+
+ if ( ! function_exists( 'token_get_all' ) ) {
+ return array();
+ }
+
+ $tokens = token_get_all( $content );
+ $count = count( $tokens );
+ $functions = array();
+ $ignore_functions = array();
+ for ( $t = 0; $t < $count - 2; $t++ ) {
+ if ( ! is_array( $tokens[ $t ] ) ) {
+ continue;
+ }
+
+ if ( T_STRING == $tokens[ $t ][0] && ( '(' == $tokens[ $t + 1 ] || '(' == $tokens[ $t + 2 ] ) ) {
+ // If it's a function or class defined locally, there's not going to be any docs available
+ if ( ( isset( $tokens[ $t - 2 ][1] ) && in_array( $tokens[ $t - 2 ][1], array( 'function', 'class' ) ) ) || ( isset( $tokens[ $t - 2 ][0] ) && T_OBJECT_OPERATOR == $tokens[ $t - 1 ][0] ) ) {
+ $ignore_functions[] = $tokens[ $t ][1];
+ }
+ // Add this to our stack of unique references
+ $functions[] = $tokens[ $t ][1];
+ }
+ }
+
+ $functions = array_unique( $functions );
+ sort( $functions );
+
+ /**
+ * Filters the list of functions and classes to be ignored from the documentation lookup.
+ *
+ * @since 2.8.0
+ *
+ * @param string[] $ignore_functions Array of names of functions and classes to be ignored.
+ */
+ $ignore_functions = apply_filters( 'documentation_ignore_functions', $ignore_functions );
+
+ $ignore_functions = array_unique( $ignore_functions );
+
+ $out = array();
+ foreach ( $functions as $function ) {
+ if ( in_array( $function, $ignore_functions ) ) {
+ continue;
+ }
+ $out[] = $function;
+ }
+
+ return $out;
+}
+
+/**
+ * Saves option for number of rows when listing posts, pages, comments, etc.
+ *
+ * @since 2.8.0
+ */
+function set_screen_options() {
+
+ if ( isset( $_POST['wp_screen_options'] ) && is_array( $_POST['wp_screen_options'] ) ) {
+ check_admin_referer( 'screen-options-nonce', 'screenoptionnonce' );
+
+ if ( ! $user = wp_get_current_user() ) {
+ return;
+ }
+ $option = $_POST['wp_screen_options']['option'];
+ $value = $_POST['wp_screen_options']['value'];
+
+ if ( $option != sanitize_key( $option ) ) {
+ return;
+ }
+
+ $map_option = $option;
+ $type = str_replace( 'edit_', '', $map_option );
+ $type = str_replace( '_per_page', '', $type );
+ if ( in_array( $type, get_taxonomies() ) ) {
+ $map_option = 'edit_tags_per_page';
+ } elseif ( in_array( $type, get_post_types() ) ) {
+ $map_option = 'edit_per_page';
+ } else {
+ $option = str_replace( '-', '_', $option );
+ }
+
+ switch ( $map_option ) {
+ case 'edit_per_page':
+ case 'users_per_page':
+ case 'edit_comments_per_page':
+ case 'upload_per_page':
+ case 'edit_tags_per_page':
+ case 'plugins_per_page':
+ case 'export_personal_data_requests_per_page':
+ case 'remove_personal_data_requests_per_page':
+ // Network admin
+ case 'sites_network_per_page':
+ case 'users_network_per_page':
+ case 'site_users_network_per_page':
+ case 'plugins_network_per_page':
+ case 'themes_network_per_page':
+ case 'site_themes_network_per_page':
+ $value = (int) $value;
+ if ( $value < 1 || $value > 999 ) {
+ return;
+ }
+ break;
+ default:
+ /**
+ * Filters a screen option value before it is set.
+ *
+ * The filter can also be used to modify non-standard [items]_per_page
+ * settings. See the parent function for a full list of standard options.
+ *
+ * Returning false to the filter will skip saving the current option.
+ *
+ * @since 2.8.0
+ *
+ * @see set_screen_options()
+ *
+ * @param bool $keep Whether to save or skip saving the screen option value. Default false.
+ * @param string $option The option name.
+ * @param int $value The number of rows to use.
+ */
+ $value = apply_filters( 'set-screen-option', false, $option, $value );
+
+ if ( false === $value ) {
+ return;
+ }
+ break;
+ }
+
+ update_user_meta( $user->ID, $option, $value );
+
+ $url = remove_query_arg( array( 'pagenum', 'apage', 'paged' ), wp_get_referer() );
+ if ( isset( $_POST['mode'] ) ) {
+ $url = add_query_arg( array( 'mode' => $_POST['mode'] ), $url );
+ }
+
+ wp_safe_redirect( $url );
+ exit;
+ }
+}
+
+/**
+ * Check if rewrite rule for WordPress already exists in the IIS 7+ configuration file
+ *
+ * @since 2.8.0
+ *
+ * @return bool
+ * @param string $filename The file path to the configuration file
+ */
+function iis7_rewrite_rule_exists( $filename ) {
+ if ( ! file_exists( $filename ) ) {
+ return false;
+ }
+ if ( ! class_exists( 'DOMDocument', false ) ) {
+ return false;
+ }
+
+ $doc = new DOMDocument();
+ if ( $doc->load( $filename ) === false ) {
+ return false;
+ }
+ $xpath = new DOMXPath( $doc );
+ $rules = $xpath->query( '/configuration/system.webServer/rewrite/rules/rule[starts-with(@name,\'wordpress\')] | /configuration/system.webServer/rewrite/rules/rule[starts-with(@name,\'WordPress\')]' );
+ if ( $rules->length == 0 ) {
+ return false;
+ } else {
+ return true;
+ }
+}
+
+/**
+ * Delete WordPress rewrite rule from web.config file if it exists there
+ *
+ * @since 2.8.0
+ *
+ * @param string $filename Name of the configuration file
+ * @return bool
+ */
+function iis7_delete_rewrite_rule( $filename ) {
+ // If configuration file does not exist then rules also do not exist so there is nothing to delete
+ if ( ! file_exists( $filename ) ) {
+ return true;
+ }
+
+ if ( ! class_exists( 'DOMDocument', false ) ) {
+ return false;
+ }
+
+ $doc = new DOMDocument();
+ $doc->preserveWhiteSpace = false;
+
+ if ( $doc->load( $filename ) === false ) {
+ return false;
+ }
+ $xpath = new DOMXPath( $doc );
+ $rules = $xpath->query( '/configuration/system.webServer/rewrite/rules/rule[starts-with(@name,\'wordpress\')] | /configuration/system.webServer/rewrite/rules/rule[starts-with(@name,\'WordPress\')]' );
+ if ( $rules->length > 0 ) {
+ $child = $rules->item( 0 );
+ $parent = $child->parentNode;
+ $parent->removeChild( $child );
+ $doc->formatOutput = true;
+ saveDomDocument( $doc, $filename );
+ }
+ return true;
+}
+
+/**
+ * Add WordPress rewrite rule to the IIS 7+ configuration file.
+ *
+ * @since 2.8.0
+ *
+ * @param string $filename The file path to the configuration file
+ * @param string $rewrite_rule The XML fragment with URL Rewrite rule
+ * @return bool
+ */
+function iis7_add_rewrite_rule( $filename, $rewrite_rule ) {
+ if ( ! class_exists( 'DOMDocument', false ) ) {
+ return false;
+ }
+
+ // If configuration file does not exist then we create one.
+ if ( ! file_exists( $filename ) ) {
+ $fp = fopen( $filename, 'w' );
+ fwrite( $fp, '<configuration/>' );
+ fclose( $fp );
+ }
+
+ $doc = new DOMDocument();
+ $doc->preserveWhiteSpace = false;
+
+ if ( $doc->load( $filename ) === false ) {
+ return false;
+ }
+
+ $xpath = new DOMXPath( $doc );
+
+ // First check if the rule already exists as in that case there is no need to re-add it
+ $wordpress_rules = $xpath->query( '/configuration/system.webServer/rewrite/rules/rule[starts-with(@name,\'wordpress\')] | /configuration/system.webServer/rewrite/rules/rule[starts-with(@name,\'WordPress\')]' );
+ if ( $wordpress_rules->length > 0 ) {
+ return true;
+ }
+
+ // Check the XPath to the rewrite rule and create XML nodes if they do not exist
+ $xmlnodes = $xpath->query( '/configuration/system.webServer/rewrite/rules' );
+ if ( $xmlnodes->length > 0 ) {
+ $rules_node = $xmlnodes->item( 0 );
+ } else {
+ $rules_node = $doc->createElement( 'rules' );
+
+ $xmlnodes = $xpath->query( '/configuration/system.webServer/rewrite' );
+ if ( $xmlnodes->length > 0 ) {
+ $rewrite_node = $xmlnodes->item( 0 );
+ $rewrite_node->appendChild( $rules_node );
+ } else {
+ $rewrite_node = $doc->createElement( 'rewrite' );
+ $rewrite_node->appendChild( $rules_node );
+
+ $xmlnodes = $xpath->query( '/configuration/system.webServer' );
+ if ( $xmlnodes->length > 0 ) {
+ $system_webServer_node = $xmlnodes->item( 0 );
+ $system_webServer_node->appendChild( $rewrite_node );
+ } else {
+ $system_webServer_node = $doc->createElement( 'system.webServer' );
+ $system_webServer_node->appendChild( $rewrite_node );
+
+ $xmlnodes = $xpath->query( '/configuration' );
+ if ( $xmlnodes->length > 0 ) {
+ $config_node = $xmlnodes->item( 0 );
+ $config_node->appendChild( $system_webServer_node );
+ } else {
+ $config_node = $doc->createElement( 'configuration' );
+ $doc->appendChild( $config_node );
+ $config_node->appendChild( $system_webServer_node );
+ }
+ }
+ }
+ }
+
+ $rule_fragment = $doc->createDocumentFragment();
+ $rule_fragment->appendXML( $rewrite_rule );
+ $rules_node->appendChild( $rule_fragment );
+
+ $doc->encoding = 'UTF-8';
+ $doc->formatOutput = true;
+ saveDomDocument( $doc, $filename );
+
+ return true;
+}
+
+/**
+ * Saves the XML document into a file
+ *
+ * @since 2.8.0
+ *
+ * @param DOMDocument $doc
+ * @param string $filename
+ */
+function saveDomDocument( $doc, $filename ) {
+ $config = $doc->saveXML();
+ $config = preg_replace( "/([^\r])\n/", "$1\r\n", $config );
+ $fp = fopen( $filename, 'w' );
+ fwrite( $fp, $config );
+ fclose( $fp );
+}
+
+/**
+ * Display the default admin color scheme picker (Used in user-edit.php)
+ *
+ * @since 3.0.0
+ *
+ * @global array $_wp_admin_css_colors
+ *
+ * @param int $user_id User ID.
+ */
+function admin_color_scheme_picker( $user_id ) {
+ global $_wp_admin_css_colors;
+
+ ksort( $_wp_admin_css_colors );
+
+ if ( isset( $_wp_admin_css_colors['fresh'] ) ) {
+ // Set Default ('fresh') and Light should go first.
+ $_wp_admin_css_colors = array_filter(
+ array_merge(
+ array(
+ 'fresh' => '',
+ 'light' => '',
+ ),
+ $_wp_admin_css_colors
+ )
+ );
+ }
+
+ $current_color = get_user_option( 'admin_color', $user_id );
+
+ if ( empty( $current_color ) || ! isset( $_wp_admin_css_colors[ $current_color ] ) ) {
+ $current_color = 'fresh';
+ }
+
+ ?>
+ <fieldset id="color-picker" class="scheme-list">
+ <legend class="screen-reader-text"><span><?php _e( 'Admin Color Scheme' ); ?></span></legend>
+ <?php
+ wp_nonce_field( 'save-color-scheme', 'color-nonce', false );
+ foreach ( $_wp_admin_css_colors as $color => $color_info ) :
+
+ ?>
+ <div class="color-option <?php echo ( $color == $current_color ) ? 'selected' : ''; ?>">
+ <input name="admin_color" id="admin_color_<?php echo esc_attr( $color ); ?>" type="radio" value="<?php echo esc_attr( $color ); ?>" class="tog" <?php checked( $color, $current_color ); ?> />
+ <input type="hidden" class="css_url" value="<?php echo esc_url( $color_info->url ); ?>" />
+ <input type="hidden" class="icon_colors" value="<?php echo esc_attr( wp_json_encode( array( 'icons' => $color_info->icon_colors ) ) ); ?>" />
+ <label for="admin_color_<?php echo esc_attr( $color ); ?>"><?php echo esc_html( $color_info->name ); ?></label>
+ <table class="color-palette">
+ <tr>
+ <?php
+
+ foreach ( $color_info->colors as $html_color ) {
+ ?>
+ <td style="background-color: <?php echo esc_attr( $html_color ); ?>">&nbsp;</td>
+ <?php
+ }
+
+ ?>
+ </tr>
+ </table>
+ </div>
+ <?php
+
+ endforeach;
+
+ ?>
+ </fieldset>
+ <?php
+}
+
+/**
+ *
+ * @global array $_wp_admin_css_colors
+ */
+function wp_color_scheme_settings() {
+ global $_wp_admin_css_colors;
+
+ $color_scheme = get_user_option( 'admin_color' );
+
+ // It's possible to have a color scheme set that is no longer registered.
+ if ( empty( $_wp_admin_css_colors[ $color_scheme ] ) ) {
+ $color_scheme = 'fresh';
+ }
+
+ if ( ! empty( $_wp_admin_css_colors[ $color_scheme ]->icon_colors ) ) {
+ $icon_colors = $_wp_admin_css_colors[ $color_scheme ]->icon_colors;
+ } elseif ( ! empty( $_wp_admin_css_colors['fresh']->icon_colors ) ) {
+ $icon_colors = $_wp_admin_css_colors['fresh']->icon_colors;
+ } else {
+ // Fall back to the default set of icon colors if the default scheme is missing.
+ $icon_colors = array(
+ 'base' => '#a0a5aa',
+ 'focus' => '#00a0d2',
+ 'current' => '#fff',
+ );
+ }
+
+ echo '<script type="text/javascript">var _wpColorScheme = ' . wp_json_encode( array( 'icons' => $icon_colors ) ) . ";</script>\n";
+}
+
+/**
+ * @since 3.3.0
+ */
+function _ipad_meta() {
+ if ( wp_is_mobile() ) {
+ ?>
+ <meta name="viewport" id="viewport-meta" content="width=device-width, initial-scale=1">
+ <?php
+ }
+}
+
+/**
+ * Check lock status for posts displayed on the Posts screen
+ *
+ * @since 3.6.0
+ *
+ * @param array $response The Heartbeat response.
+ * @param array $data The $_POST data sent.
+ * @param string $screen_id The screen id.
+ * @return array The Heartbeat response.
+ */
+function wp_check_locked_posts( $response, $data, $screen_id ) {
+ $checked = array();
+
+ if ( array_key_exists( 'wp-check-locked-posts', $data ) && is_array( $data['wp-check-locked-posts'] ) ) {
+ foreach ( $data['wp-check-locked-posts'] as $key ) {
+ if ( ! $post_id = absint( substr( $key, 5 ) ) ) {
+ continue;
+ }
+
+ if ( ( $user_id = wp_check_post_lock( $post_id ) ) && ( $user = get_userdata( $user_id ) ) && current_user_can( 'edit_post', $post_id ) ) {
+ $send = array( 'text' => sprintf( __( '%s is currently editing' ), $user->display_name ) );
+
+ if ( ( $avatar = get_avatar( $user->ID, 18 ) ) && preg_match( "|src='([^']+)'|", $avatar, $matches ) ) {
+ $send['avatar_src'] = $matches[1];
+ }
+
+ $checked[ $key ] = $send;
+ }
+ }
+ }
+
+ if ( ! empty( $checked ) ) {
+ $response['wp-check-locked-posts'] = $checked;
+ }
+
+ return $response;
+}
+
+/**
+ * Check lock status on the New/Edit Post screen and refresh the lock
+ *
+ * @since 3.6.0
+ *
+ * @param array $response The Heartbeat response.
+ * @param array $data The $_POST data sent.
+ * @param string $screen_id The screen id.
+ * @return array The Heartbeat response.
+ */
+function wp_refresh_post_lock( $response, $data, $screen_id ) {
+ if ( array_key_exists( 'wp-refresh-post-lock', $data ) ) {
+ $received = $data['wp-refresh-post-lock'];
+ $send = array();
+
+ if ( ! $post_id = absint( $received['post_id'] ) ) {
+ return $response;
+ }
+
+ if ( ! current_user_can( 'edit_post', $post_id ) ) {
+ return $response;
+ }
+
+ if ( ( $user_id = wp_check_post_lock( $post_id ) ) && ( $user = get_userdata( $user_id ) ) ) {
+ $error = array(
+ 'text' => sprintf( __( '%s has taken over and is currently editing.' ), $user->display_name ),
+ );
+
+ if ( $avatar = get_avatar( $user->ID, 64 ) ) {
+ if ( preg_match( "|src='([^']+)'|", $avatar, $matches ) ) {
+ $error['avatar_src'] = $matches[1];
+ }
+ }
+
+ $send['lock_error'] = $error;
+ } else {
+ if ( $new_lock = wp_set_post_lock( $post_id ) ) {
+ $send['new_lock'] = implode( ':', $new_lock );
+ }
+ }
+
+ $response['wp-refresh-post-lock'] = $send;
+ }
+
+ return $response;
+}
+
+/**
+ * Check nonce expiration on the New/Edit Post screen and refresh if needed
+ *
+ * @since 3.6.0
+ *
+ * @param array $response The Heartbeat response.
+ * @param array $data The $_POST data sent.
+ * @param string $screen_id The screen id.
+ * @return array The Heartbeat response.
+ */
+function wp_refresh_post_nonces( $response, $data, $screen_id ) {
+ if ( array_key_exists( 'wp-refresh-post-nonces', $data ) ) {
+ $received = $data['wp-refresh-post-nonces'];
+ $response['wp-refresh-post-nonces'] = array( 'check' => 1 );
+
+ if ( ! $post_id = absint( $received['post_id'] ) ) {
+ return $response;
+ }
+
+ if ( ! current_user_can( 'edit_post', $post_id ) ) {
+ return $response;
+ }
+
+ $response['wp-refresh-post-nonces'] = array(
+ 'replace' => array(
+ 'getpermalinknonce' => wp_create_nonce( 'getpermalink' ),
+ 'samplepermalinknonce' => wp_create_nonce( 'samplepermalink' ),
+ 'closedpostboxesnonce' => wp_create_nonce( 'closedpostboxes' ),
+ '_ajax_linking_nonce' => wp_create_nonce( 'internal-linking' ),
+ '_wpnonce' => wp_create_nonce( 'update-post_' . $post_id ),
+ ),
+ );
+ }
+
+ return $response;
+}
+
+/**
+ * Add the latest Heartbeat and REST-API nonce to the Heartbeat response.
+ *
+ * @since 5.0.0
+ *
+ * @param array $response The Heartbeat response.
+ * @return array The Heartbeat response.
+ */
+function wp_refresh_heartbeat_nonces( $response ) {
+ // Refresh the Rest API nonce.
+ $response['rest_nonce'] = wp_create_nonce( 'wp_rest' );
+
+ // Refresh the Heartbeat nonce.
+ $response['heartbeat_nonce'] = wp_create_nonce( 'heartbeat-nonce' );
+ return $response;
+}
+
+/**
+ * Disable suspension of Heartbeat on the Add/Edit Post screens.
+ *
+ * @since 3.8.0
+ *
+ * @global string $pagenow
+ *
+ * @param array $settings An array of Heartbeat settings.
+ * @return array Filtered Heartbeat settings.
+ */
+function wp_heartbeat_set_suspension( $settings ) {
+ global $pagenow;
+
+ if ( 'post.php' === $pagenow || 'post-new.php' === $pagenow ) {
+ $settings['suspension'] = 'disable';
+ }
+
+ return $settings;
+}
+
+/**
+ * Autosave with heartbeat
+ *
+ * @since 3.9.0
+ *
+ * @param array $response The Heartbeat response.
+ * @param array $data The $_POST data sent.
+ * @return array The Heartbeat response.
+ */
+function heartbeat_autosave( $response, $data ) {
+ if ( ! empty( $data['wp_autosave'] ) ) {
+ $saved = wp_autosave( $data['wp_autosave'] );
+
+ if ( is_wp_error( $saved ) ) {
+ $response['wp_autosave'] = array(
+ 'success' => false,
+ 'message' => $saved->get_error_message(),
+ );
+ } elseif ( empty( $saved ) ) {
+ $response['wp_autosave'] = array(
+ 'success' => false,
+ 'message' => __( 'Error while saving.' ),
+ );
+ } else {
+ /* translators: draft saved date format, see https://secure.php.net/date */
+ $draft_saved_date_format = __( 'g:i:s a' );
+ /* translators: %s: date and time */
+ $response['wp_autosave'] = array(
+ 'success' => true,
+ 'message' => sprintf( __( 'Draft saved at %s.' ), date_i18n( $draft_saved_date_format ) ),
+ );
+ }
+ }
+
+ return $response;
+}
+
+/**
+ * Remove single-use URL parameters and create canonical link based on new URL.
+ *
+ * Remove specific query string parameters from a URL, create the canonical link,
+ * put it in the admin header, and change the current URL to match.
+ *
+ * @since 4.2.0
+ */
+function wp_admin_canonical_url() {
+ $removable_query_args = wp_removable_query_args();
+
+ if ( empty( $removable_query_args ) ) {
+ return;
+ }
+
+ // Ensure we're using an absolute URL.
+ $current_url = set_url_scheme( 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] );
+ $filtered_url = remove_query_arg( $removable_query_args, $current_url );
+ ?>
+ <link id="wp-admin-canonical" rel="canonical" href="<?php echo esc_url( $filtered_url ); ?>" />
+ <script>
+ if ( window.history.replaceState ) {
+ window.history.replaceState( null, null, document.getElementById( 'wp-admin-canonical' ).href + window.location.hash );
+ }
+ </script>
+ <?php
+}
+
+/**
+ * Send a referrer policy header so referrers are not sent externally from administration screens.
+ *
+ * @since 4.9.0
+ */
+function wp_admin_headers() {
+ $policy = 'strict-origin-when-cross-origin';
+
+ /**
+ * Filters the admin referrer policy header value.
+ *
+ * @since 4.9.0
+ * @since 4.9.5 The default value was changed to 'strict-origin-when-cross-origin'.
+ *
+ * @link https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Referrer-Policy
+ *
+ * @param string $policy The admin referrer policy header value. Default 'strict-origin-when-cross-origin'.
+ */
+ $policy = apply_filters( 'admin_referrer_policy', $policy );
+
+ header( sprintf( 'Referrer-Policy: %s', $policy ) );
+}
+
+/**
+ * Outputs JS that reloads the page if the user navigated to it with the Back or Forward button.
+ *
+ * Used on the Edit Post and Add New Post screens. Needed to ensure the page is not loaded from browser cache,
+ * so the post title and editor content are the last saved versions. Ideally this script should run first in the head.
+ *
+ * @since 4.6.0
+ */
+function wp_page_reload_on_back_button_js() {
+ ?>
+ <script>
+ if ( typeof performance !== 'undefined' && performance.navigation && performance.navigation.type === 2 ) {
+ document.location.reload( true );
+ }
+ </script>
+ <?php
+}
+
+/**
+ * Send a confirmation request email when a change of site admin email address is attempted.
+ *
+ * The new site admin address will not become active until confirmed.
+ *
+ * @since 3.0.0
+ * @since 4.9.0 This function was moved from wp-admin/includes/ms.php so it's no longer Multisite specific.
+ *
+ * @param string $old_value The old site admin email address.
+ * @param string $value The proposed new site admin email address.
+ */
+function update_option_new_admin_email( $old_value, $value ) {
+ if ( $value == get_option( 'admin_email' ) || ! is_email( $value ) ) {
+ return;
+ }
+
+ $hash = md5( $value . time() . wp_rand() );
+ $new_admin_email = array(
+ 'hash' => $hash,
+ 'newemail' => $value,
+ );
+ update_option( 'adminhash', $new_admin_email );
+
+ $switched_locale = switch_to_locale( get_user_locale() );
+
+ /* translators: Do not translate USERNAME, ADMIN_URL, EMAIL, SITENAME, SITEURL: those are placeholders. */
+ $email_text = __(
+ 'Howdy ###USERNAME###,
+
+You recently requested to have the administration email address on
+your site changed.
+
+If this is correct, please click on the following link to change it:
+###ADMIN_URL###
+
+You can safely ignore and delete this email if you do not want to
+take this action.
+
+This email has been sent to ###EMAIL###
+
+Regards,
+All at ###SITENAME###
+###SITEURL###'
+ );
+
+ /**
+ * Filters the text of the email sent when a change of site admin email address is attempted.
+ *
+ * The following strings have a special meaning and will get replaced dynamically:
+ * ###USERNAME### The current user's username.
+ * ###ADMIN_URL### The link to click on to confirm the email change.
+ * ###EMAIL### The proposed new site admin email address.
+ * ###SITENAME### The name of the site.
+ * ###SITEURL### The URL to the site.
+ *
+ * @since MU (3.0.0)
+ * @since 4.9.0 This filter is no longer Multisite specific.
+ *
+ * @param string $email_text Text in the email.
+ * @param array $new_admin_email {
+ * Data relating to the new site admin email address.
+ *
+ * @type string $hash The secure hash used in the confirmation link URL.
+ * @type string $newemail The proposed new site admin email address.
+ * }
+ */
+ $content = apply_filters( 'new_admin_email_content', $email_text, $new_admin_email );
+
+ $current_user = wp_get_current_user();
+ $content = str_replace( '###USERNAME###', $current_user->user_login, $content );
+ $content = str_replace( '###ADMIN_URL###', esc_url( self_admin_url( 'options.php?adminhash=' . $hash ) ), $content );
+ $content = str_replace( '###EMAIL###', $value, $content );
+ $content = str_replace( '###SITENAME###', wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES ), $content );
+ $content = str_replace( '###SITEURL###', home_url(), $content );
+
+ /* translators: New admin email address notification email subject. %s: Site title */
+ wp_mail( $value, sprintf( __( '[%s] New Admin Email Address' ), wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES ) ), $content );
+
+ if ( $switched_locale ) {
+ restore_previous_locale();
+ }
+}
+
+/**
+ * Appends '(Draft)' to draft page titles in the privacy page dropdown
+ * so that unpublished content is obvious.
+ *
+ * @since 4.9.8
+ * @access private
+ *
+ * @param string $title Page title.
+ * @param WP_Post $page Page data object.
+ *
+ * @return string Page title.
+ */
+function _wp_privacy_settings_filter_draft_page_titles( $title, $page ) {
+ if ( 'draft' === $page->post_status && 'privacy' === get_current_screen()->id ) {
+ /* translators: %s: Page Title */
+ $title = sprintf( __( '%s (Draft)' ), $title );
+ }
+
+ return $title;
+}
+
+/**
+ * WP_Privacy_Policy_Content class.
+ * TODO: move this to a new file.
+ *
+ * @since 4.9.6
+ */
+final class WP_Privacy_Policy_Content {
+
+ private static $policy_content = array();
+
+ /**
+ * Constructor
+ *
+ * @since 4.9.6
+ */
+ private function __construct() {}
+
+ /**
+ * Add content to the postbox shown when editing the privacy policy.
+ *
+ * Plugins and themes should suggest text for inclusion in the site's privacy policy.
+ * The suggested text should contain information about any functionality that affects user privacy,
+ * and will be shown in the Suggested Privacy Policy Content postbox.
+ *
+ * Intended for use from `wp_add_privacy_policy_content()`.
+ *
+ * @since 4.9.6
+ *
+ * @param string $plugin_name The name of the plugin or theme that is suggesting content for the site's privacy policy.
+ * @param string $policy_text The suggested content for inclusion in the policy.
+ */
+ public static function add( $plugin_name, $policy_text ) {
+ if ( empty( $plugin_name ) || empty( $policy_text ) ) {
+ return;
+ }
+
+ $data = array(
+ 'plugin_name' => $plugin_name,
+ 'policy_text' => $policy_text,
+ );
+
+ if ( ! in_array( $data, self::$policy_content, true ) ) {
+ self::$policy_content[] = $data;
+ }
+ }
+
+ /**
+ * Quick check if any privacy info has changed.
+ *
+ * @since 4.9.6
+ */
+ public static function text_change_check() {
+
+ $policy_page_id = (int) get_option( 'wp_page_for_privacy_policy' );
+
+ // The site doesn't have a privacy policy.
+ if ( empty( $policy_page_id ) ) {
+ return false;
+ }
+
+ if ( ! current_user_can( 'edit_post', $policy_page_id ) ) {
+ return false;
+ }
+
+ $old = (array) get_post_meta( $policy_page_id, '_wp_suggested_privacy_policy_content' );
+
+ // Updates are not relevant if the user has not reviewed any suggestions yet.
+ if ( empty( $old ) ) {
+ return false;
+ }
+
+ $cached = get_option( '_wp_suggested_policy_text_has_changed' );
+
+ /*
+ * When this function is called before `admin_init`, `self::$policy_content`
+ * has not been populated yet, so use the cached result from the last
+ * execution instead.
+ */
+ if ( ! did_action( 'admin_init' ) ) {
+ return 'changed' === $cached;
+ }
+
+ $new = self::$policy_content;
+
+ // Remove the extra values added to the meta.
+ foreach ( $old as $key => $data ) {
+ if ( ! empty( $data['removed'] ) ) {
+ unset( $old[ $key ] );
+ continue;
+ }
+
+ $old[ $key ] = array(
+ 'plugin_name' => $data['plugin_name'],
+ 'policy_text' => $data['policy_text'],
+ );
+ }
+
+ // Normalize the order of texts, to facilitate comparison.
+ sort( $old );
+ sort( $new );
+
+ // The == operator (equal, not identical) was used intentionally.
+ // See http://php.net/manual/en/language.operators.array.php
+ if ( $new != $old ) {
+ // A plugin was activated or deactivated, or some policy text has changed.
+ // Show a notice on the relevant screens to inform the admin.
+ add_action( 'admin_notices', array( 'WP_Privacy_Policy_Content', 'policy_text_changed_notice' ) );
+ $state = 'changed';
+ } else {
+ $state = 'not-changed';
+ }
+
+ // Cache the result for use before `admin_init` (see above).
+ if ( $cached !== $state ) {
+ update_option( '_wp_suggested_policy_text_has_changed', $state );
+ }
+
+ return 'changed' === $state;
+ }
+
+ /**
+ * Output a warning when some privacy info has changed.
+ *
+ * @since 4.9.6
+ */
+ public static function policy_text_changed_notice() {
+ global $post;
+
+ $screen = get_current_screen()->id;
+
+ if ( 'privacy' !== $screen ) {
+ return;
+ }
+
+ ?>
+ <div class="policy-text-updated notice notice-warning is-dismissible">
+ <p>
+ <?php
+ printf(
+ /* translators: %s: Privacy Policy Guide URL */
+ __( 'The suggested privacy policy text has changed. Please <a href="%s">review the guide</a> and update your privacy policy.' ),
+ esc_url( admin_url( 'tools.php?wp-privacy-policy-guide=1' ) )
+ );
+ ?>
+ </p>
+ </div>
+ <?php
+ }
+
+ /**
+ * Update the cached policy info when the policy page is updated.
+ *
+ * @since 4.9.6
+ * @access private
+ */
+ public static function _policy_page_updated( $post_id ) {
+ $policy_page_id = (int) get_option( 'wp_page_for_privacy_policy' );
+
+ if ( ! $policy_page_id || $policy_page_id !== (int) $post_id ) {
+ return;
+ }
+
+ // Remove updated|removed status.
+ $old = (array) get_post_meta( $policy_page_id, '_wp_suggested_privacy_policy_content' );
+ $done = array();
+ $update_cache = false;
+
+ foreach ( $old as $old_key => $old_data ) {
+ if ( ! empty( $old_data['removed'] ) ) {
+ // Remove the old policy text.
+ $update_cache = true;
+ continue;
+ }
+
+ if ( ! empty( $old_data['updated'] ) ) {
+ // 'updated' is now 'added'.
+ $done[] = array(
+ 'plugin_name' => $old_data['plugin_name'],
+ 'policy_text' => $old_data['policy_text'],
+ 'added' => $old_data['updated'],
+ );
+ $update_cache = true;
+ } else {
+ $done[] = $old_data;
+ }
+ }
+
+ if ( $update_cache ) {
+ delete_post_meta( $policy_page_id, '_wp_suggested_privacy_policy_content' );
+ // Update the cache.
+ foreach ( $done as $data ) {
+ add_post_meta( $policy_page_id, '_wp_suggested_privacy_policy_content', $data );
+ }
+ }
+ }
+
+ /**
+ * Check for updated, added or removed privacy policy information from plugins.
+ *
+ * Caches the current info in post_meta of the policy page.
+ *
+ * @since 4.9.6
+ *
+ * @return array The privacy policy text/informtion added by core and plugins.
+ */
+ public static function get_suggested_policy_text() {
+ $policy_page_id = (int) get_option( 'wp_page_for_privacy_policy' );
+ $checked = array();
+ $time = time();
+ $update_cache = false;
+ $new = self::$policy_content;
+ $old = array();
+
+ if ( $policy_page_id ) {
+ $old = (array) get_post_meta( $policy_page_id, '_wp_suggested_privacy_policy_content' );
+ }
+
+ // Check for no-changes and updates.
+ foreach ( $new as $new_key => $new_data ) {
+ foreach ( $old as $old_key => $old_data ) {
+ $found = false;
+
+ if ( $new_data['policy_text'] === $old_data['policy_text'] ) {
+ // Use the new plugin name in case it was changed, translated, etc.
+ if ( $old_data['plugin_name'] !== $new_data['plugin_name'] ) {
+ $old_data['plugin_name'] = $new_data['plugin_name'];
+ $update_cache = true;
+ }
+
+ // A plugin was re-activated.
+ if ( ! empty( $old_data['removed'] ) ) {
+ unset( $old_data['removed'] );
+ $old_data['added'] = $time;
+ $update_cache = true;
+ }
+
+ $checked[] = $old_data;
+ $found = true;
+ } elseif ( $new_data['plugin_name'] === $old_data['plugin_name'] ) {
+ // The info for the policy was updated.
+ $checked[] = array(
+ 'plugin_name' => $new_data['plugin_name'],
+ 'policy_text' => $new_data['policy_text'],
+ 'updated' => $time,
+ );
+ $found = $update_cache = true;
+ }
+
+ if ( $found ) {
+ unset( $new[ $new_key ], $old[ $old_key ] );
+ continue 2;
+ }
+ }
+ }
+
+ if ( ! empty( $new ) ) {
+ // A plugin was activated.
+ foreach ( $new as $new_data ) {
+ if ( ! empty( $new_data['plugin_name'] ) && ! empty( $new_data['policy_text'] ) ) {
+ $new_data['added'] = $time;
+ $checked[] = $new_data;
+ }
+ }
+ $update_cache = true;
+ }
+
+ if ( ! empty( $old ) ) {
+ // A plugin was deactivated.
+ foreach ( $old as $old_data ) {
+ if ( ! empty( $old_data['plugin_name'] ) && ! empty( $old_data['policy_text'] ) ) {
+ $data = array(
+ 'plugin_name' => $old_data['plugin_name'],
+ 'policy_text' => $old_data['policy_text'],
+ 'removed' => $time,
+ );
+
+ $checked[] = $data;
+ }
+ }
+ $update_cache = true;
+ }
+
+ if ( $update_cache && $policy_page_id ) {
+ delete_post_meta( $policy_page_id, '_wp_suggested_privacy_policy_content' );
+ // Update the cache.
+ foreach ( $checked as $data ) {
+ add_post_meta( $policy_page_id, '_wp_suggested_privacy_policy_content', $data );
+ }
+ }
+
+ return $checked;
+ }
+
+ /**
+ * Add a notice with a link to the guide when editing the privacy policy page.
+ *
+ * @since 4.9.6
+ * @since 5.0.0 The $post parameter is now optional.
+ *
+ * @param WP_Post|null $post The currently edited post. Default null.
+ */
+ public static function notice( $post = null ) {
+ if ( is_null( $post ) ) {
+ global $post;
+ } else {
+ $post = get_post( $post );
+ }
+
+ if ( ! ( $post instanceof WP_Post ) ) {
+ return;
+ }
+
+ if ( ! current_user_can( 'manage_privacy_options' ) ) {
+ return;
+ }
+
+ $policy_page_id = (int) get_option( 'wp_page_for_privacy_policy' );
+
+ if ( ! $policy_page_id || $policy_page_id !== $post->ID ) {
+ return;
+ }
+
+ $message = __( 'Need help putting together your new Privacy Policy page? Check out our guide for recommendations on what content to include, along with policies suggested by your plugins and theme.' );
+ $url = esc_url( admin_url( 'tools.php?wp-privacy-policy-guide=1' ) );
+ $label = __( 'View Privacy Policy Guide.' );
+
+ if ( get_current_screen()->is_block_editor() ) {
+ wp_enqueue_script( 'wp-notices' );
+ $action = array(
+ 'url' => $url,
+ 'label' => $label,
+ );
+ wp_add_inline_script(
+ 'wp-notices',
+ sprintf(
+ 'wp.data.dispatch( "core/notices" ).createWarningNotice( "%s", { actions: [ %s ], isDismissible: false } )',
+ $message,
+ wp_json_encode( $action )
+ ),
+ 'after'
+ );
+ } else {
+ ?>
+ <div class="notice notice-warning inline wp-pp-notice">
+ <p>
+ <?php
+ echo $message;
+ printf(
+ ' <a href="%s" target="_blank">%s <span class="screen-reader-text">%s</span></a>',
+ $url,
+ $label,
+ /* translators: accessibility text */
+ __( '(opens in a new tab)' )
+ );
+ ?>
+ </p>
+ </div>
+ <?php
+ }
+ }
+
+ /**
+ * Output the privacy policy guide together with content from the theme and plugins.
+ *
+ * @since 4.9.6
+ */
+ public static function privacy_policy_guide() {
+
+ $content_array = self::get_suggested_policy_text();
+
+ $content = '';
+ $toc = array( '<li><a href="#wp-privacy-policy-guide-introduction">' . __( 'Introduction' ) . '</a></li>' );
+ $date_format = __( 'F j, Y' );
+ $copy = __( 'Copy this section to clipboard' );
+ $return_to_top = '<a href="#" class="return-to-top">' . __( '&uarr; Return to Top' ) . '</a>';
+
+ foreach ( $content_array as $section ) {
+ $class = $meta = $removed = '';
+
+ if ( ! empty( $section['removed'] ) ) {
+ $class = ' text-removed';
+ $date = date_i18n( $date_format, $section['removed'] );
+ $meta = sprintf( __( 'Removed %s.' ), $date );
+
+ $removed = __( 'You deactivated this plugin on %s and may no longer need this policy.' );
+ $removed = '<div class="error inline"><p>' . sprintf( $removed, $date ) . '</p></div>';
+ } elseif ( ! empty( $section['updated'] ) ) {
+ $class = ' text-updated';
+ $date = date_i18n( $date_format, $section['updated'] );
+ $meta = sprintf( __( 'Updated %s.' ), $date );
+ }
+
+ if ( $meta ) {
+ $meta = '<br><span class="privacy-text-meta">' . $meta . '</span>';
+ }
+
+ $plugin_name = esc_html( $section['plugin_name'] );
+ $toc_id = 'wp-privacy-policy-guide-' . sanitize_title( $plugin_name );
+ $toc[] = sprintf( '<li><a href="#%1$s">%2$s</a>' . $meta . '</li>', $toc_id, $plugin_name );
+
+ $content .= '<div class="privacy-text-section' . $class . '">';
+ $content .= '<a id="' . $toc_id . '">&nbsp;</a>';
+ /* translators: %s: plugin name */
+ $content .= '<h2>' . sprintf( __( 'Source: %s' ), $plugin_name ) . '</h2>';
+ $content .= $removed;
+
+ $content .= '<div class="policy-text">' . $section['policy_text'] . '</div>';
+ $content .= $return_to_top;
+
+ if ( empty( $section['removed'] ) ) {
+ $content .= '<div class="privacy-text-actions">';
+ $content .= '<button type="button" class="privacy-text-copy button">';
+ $content .= $copy;
+ $content .= '<span class="screen-reader-text">' . sprintf( __( 'Copy suggested policy text from %s.' ), $plugin_name ) . '</span>';
+ $content .= '</button>';
+ $content .= '</div>';
+ }
+
+ $content .= "</div>\n"; // End of .privacy-text-section.
+ }
+
+ if ( count( $toc ) > 2 ) {
+ ?>
+ <div class="privacy-text-box-toc">
+ <p><?php _e( 'Table of Contents' ); ?></p>
+ <ol>
+ <?php echo implode( "\n", $toc ); ?>
+ </ol>
+ </div>
+ <?php
+ }
+
+ ?>
+ <div class="privacy-text-box">
+ <div class="privacy-text-box-head">
+ <a id="wp-privacy-policy-guide-introduction">&nbsp;</a>
+ <h2><?php _e( 'Introduction' ); ?></h2>
+ <p><?php _e( 'Hello,' ); ?></p>
+ <p><?php _e( 'This text template will help you to create your web site&#8217;s privacy policy.' ); ?></p>
+ <p><?php _e( 'We have suggested the sections you will need. Under each section heading you will find a short summary of what information you should provide, which will help you to get started. Some sections include suggested policy content, others will have to be completed with information from your theme and plugins.' ); ?></p>
+ <p><?php _e( 'Please edit your privacy policy content, making sure to delete the summaries, and adding any information from your theme and plugins. Once you publish your policy page, remember to add it to your navigation menu.' ); ?></p>
+ <p><?php _e( 'It is your responsibility to write a comprehensive privacy policy, to make sure it reflects all national and international legal requirements on privacy, and to keep your policy current and accurate.' ); ?></p>
+ </div>
+
+ <div class="privacy-text-box-body">
+ <?php echo $content; ?>
+ </div>
+ </div>
+ <?php
+ }
+
+ /**
+ * Return the default suggested privacy policy content.
+ *
+ * @since 4.9.6
+ * @since 5.0.0 Added the `$blocks` parameter.
+ *
+ * @param bool $description Whether to include the descriptions under the section headings. Default false.
+ * @param bool $blocks Whether to format the content for the block editor. Default true.
+ * @return string The default policy content.
+ */
+ public static function get_default_content( $description = false, $blocks = true ) {
+ $suggested_text = $description ? '<strong class="privacy-policy-tutorial">' . __( 'Suggested text:' ) . ' </strong>' : '';
+ $content = '';
+ $strings = array();
+
+ // Start of the suggested privacy policy text.
+ if ( $description ) {
+ $strings[] = '<div class="wp-suggested-text">';
+ }
+
+ /* translators: default privacy policy heading. */
+ $strings[] = '<h2>' . __( 'Who we are' ) . '</h2>';
+
+ if ( $description ) {
+ /* translators: privacy policy tutorial. */
+ $strings[] = '<p class="privacy-policy-tutorial">' . __( 'In this section you should note your site URL, as well as the name of the company, organization, or individual behind it, and some accurate contact information.' ) . '</p>';
+ /* translators: privacy policy tutorial. */
+ $strings[] = '<p class="privacy-policy-tutorial">' . __( 'The amount of information you may be required to show will vary depending on your local or national business regulations. You may, for example, be required to display a physical address, a registered address, or your company registration number.' ) . '</p>';
+ }
+
+ /* translators: default privacy policy text, %s Site URL. */
+ $strings[] = '<p>' . $suggested_text . sprintf( __( 'Our website address is: %s.' ), get_bloginfo( 'url', 'display' ) ) . '</p>';
+
+ /* translators: default privacy policy heading. */
+ $strings[] = '<h2>' . __( 'What personal data we collect and why we collect it' ) . '</h2>';
+
+ if ( $description ) {
+ /* translators: privacy policy tutorial. */
+ $strings[] = '<p class="privacy-policy-tutorial">' . __( 'In this section you should note what personal data you collect from users and site visitors. This may include personal data, such as name, email address, personal account preferences; transactional data, such as purchase information; and technical data, such as information about cookies.' ) . '</p>';
+ /* translators: privacy policy tutorial. */
+ $strings[] = '<p class="privacy-policy-tutorial">' . __( 'You should also note any collection and retention of sensitive personal data, such as data concerning health.' ) . '</p>';
+ /* translators: privacy policy tutorial. */
+ $strings[] = '<p class="privacy-policy-tutorial">' . __( 'In addition to listing what personal data you collect, you need to note why you collect it. These explanations must note either the legal basis for your data collection and retention or the active consent the user has given.' ) . '</p>';
+ /* translators: privacy policy tutorial. */
+ $strings[] = '<p class="privacy-policy-tutorial">' . __( 'Personal data is not just created by a user&#8217;s interactions with your site. Personal data is also generated from technical processes such as contact forms, comments, cookies, analytics, and third party embeds.' ) . '</p>';
+ /* translators: privacy policy tutorial. */
+ $strings[] = '<p class="privacy-policy-tutorial">' . __( 'By default WordPress does not collect any personal data about visitors, and only collects the data shown on the User Profile screen from registered users. However some of your plugins may collect personal data. You should add the relevant information below.' ) . '</p>';
+ }
+
+ /* translators: default privacy policy heading. */
+ $strings[] = '<h3>' . __( 'Comments' ) . '</h3>';
+
+ if ( $description ) {
+ /* translators: privacy policy tutorial. */
+ $strings[] = '<p class="privacy-policy-tutorial">' . __( 'In this subsection you should note what information is captured through comments. We have noted the data which WordPress collects by default.' ) . '</p>';
+ }
+
+ /* translators: default privacy policy text. */
+ $strings[] = '<p>' . $suggested_text . __( 'When visitors leave comments on the site we collect the data shown in the comments form, and also the visitor&#8217;s IP address and browser user agent string to help spam detection.' ) . '</p>';
+ /* translators: default privacy policy text. */
+ $strings[] = '<p>' . __( 'An anonymized string created from your email address (also called a hash) may be provided to the Gravatar service to see if you are using it. The Gravatar service privacy policy is available here: https://automattic.com/privacy/. After approval of your comment, your profile picture is visible to the public in the context of your comment.' ) . '</p>';
+
+ /* translators: default privacy policy heading. */
+ $strings[] = '<h3>' . __( 'Media' ) . '</h3>';
+
+ if ( $description ) {
+ /* translators: privacy policy tutorial. */
+ $strings[] = '<p class="privacy-policy-tutorial">' . __( 'In this subsection you should note what information may be disclosed by users who can upload media files. All uploaded files are usually publicly accessible.' ) . '</p>';
+ }
+
+ /* translators: default privacy policy text. */
+ $strings[] = '<p>' . $suggested_text . __( 'If you upload images to the website, you should avoid uploading images with embedded location data (EXIF GPS) included. Visitors to the website can download and extract any location data from images on the website.' ) . '</p>';
+
+ /* translators: default privacy policy heading. */
+ $strings[] = '<h3>' . __( 'Contact forms' ) . '</h3>';
+
+ if ( $description ) {
+ /* translators: privacy policy tutorial. */
+ $strings[] = '<p class="privacy-policy-tutorial">' . __( 'By default, WordPress does not include a contact form. If you use a contact form plugin, use this subsection to note what personal data is captured when someone submits a contact form, and how long you keep it. For example, you may note that you keep contact form submissions for a certain period for customer service purposes, but you do not use the information submitted through them for marketing purposes.' ) . '</p>';
+ }
+
+ /* translators: default privacy policy heading. */
+ $strings[] = '<h3>' . __( 'Cookies' ) . '</h3>';
+
+ if ( $description ) {
+ /* translators: privacy policy tutorial. */
+ $strings[] = '<p class="privacy-policy-tutorial">' . __( 'In this subsection you should list the cookies your web site uses, including those set by your plugins, social media, and analytics. We have provided the cookies which WordPress installs by default.' ) . '</p>';
+ }
+
+ /* translators: default privacy policy text. */
+ $strings[] = '<p>' . $suggested_text . __( 'If you leave a comment on our site you may opt-in to saving your name, email address and website in cookies. These are for your convenience so that you do not have to fill in your details again when you leave another comment. These cookies will last for one year.' ) . '</p>';
+ /* translators: default privacy policy text. */
+ $strings[] = '<p>' . __( 'If you visit our login page, we will set a temporary cookie to determine if your browser accepts cookies. This cookie contains no personal data and is discarded when you close your browser.' ) . '</p>';
+ /* translators: default privacy policy text. */
+ $strings[] = '<p>' . __( 'When you log in, we will also set up several cookies to save your login information and your screen display choices. Login cookies last for two days, and screen options cookies last for a year. If you select &quot;Remember Me&quot;, your login will persist for two weeks. If you log out of your account, the login cookies will be removed.' ) . '</p>';
+ /* translators: default privacy policy text. */
+ $strings[] = '<p>' . __( 'If you edit or publish an article, an additional cookie will be saved in your browser. This cookie includes no personal data and simply indicates the post ID of the article you just edited. It expires after 1 day.' ) . '</p>';
+
+ /* translators: default privacy policy heading. */
+ $strings[] = '<h3>' . __( 'Embedded content from other websites' ) . '</h3>';
+ /* translators: default privacy policy text. */
+ $strings[] = '<p>' . $suggested_text . __( 'Articles on this site may include embedded content (e.g. videos, images, articles, etc.). Embedded content from other websites behaves in the exact same way as if the visitor has visited the other website.' ) . '</p>';
+ /* translators: default privacy policy text. */
+ $strings[] = '<p>' . __( 'These websites may collect data about you, use cookies, embed additional third-party tracking, and monitor your interaction with that embedded content, including tracking your interaction with the embedded content if you have an account and are logged in to that website.' ) . '</p>';
+
+ /* translators: default privacy policy heading. */
+ $strings[] = '<h3>' . __( 'Analytics' ) . '</h3>';
+
+ if ( $description ) {
+ /* translators: privacy policy tutorial. */
+ $strings[] = '<p class="privacy-policy-tutorial">' . __( 'In this subsection you should note what analytics package you use, how users can opt out of analytics tracking, and a link to your analytics provider&#8217;s privacy policy, if any.' ) . '</p>';
+ /* translators: privacy policy tutorial. */
+ $strings[] = '<p class="privacy-policy-tutorial">' . __( 'By default WordPress does not collect any analytics data. However, many web hosting accounts collect some anonymous analytics data. You may also have installed a WordPress plugin that provides analytics services. In that case, add information from that plugin here.' ) . '</p>';
+ }
+
+ /* translators: default privacy policy heading. */
+ $strings[] = '<h2>' . __( 'Who we share your data with' ) . '</h2>';
+
+ if ( $description ) {
+ /* translators: privacy policy tutorial. */
+ $strings[] = '<p class="privacy-policy-tutorial">' . __( 'In this section you should name and list all third party providers with whom you share site data, including partners, cloud-based services, payment processors, and third party service providers, and note what data you share with them and why. Link to their own privacy policies if possible.' ) . '</p>';
+ /* translators: privacy policy tutorial. */
+ $strings[] = '<p class="privacy-policy-tutorial">' . __( 'By default WordPress does not share any personal data with anyone.' ) . '</p>';
+ }
+
+ /* translators: default privacy policy heading. */
+ $strings[] = '<h2>' . __( 'How long we retain your data' ) . '</h2>';
+
+ if ( $description ) {
+ /* translators: privacy policy tutorial. */
+ $strings[] = '<p class="privacy-policy-tutorial">' . __( 'In this section you should explain how long you retain personal data collected or processed by the web site. While it is your responsibility to come up with the schedule of how long you keep each dataset for and why you keep it, that information does need to be listed here. For example, you may want to say that you keep contact form entries for six months, analytics records for a year, and customer purchase records for ten years.' ) . '</p>';
+ }
+
+ /* translators: default privacy policy text. */
+ $strings[] = '<p>' . $suggested_text . __( 'If you leave a comment, the comment and its metadata are retained indefinitely. This is so we can recognize and approve any follow-up comments automatically instead of holding them in a moderation queue.' ) . '</p>';
+ /* translators: default privacy policy text. */
+ $strings[] = '<p>' . __( 'For users that register on our website (if any), we also store the personal information they provide in their user profile. All users can see, edit, or delete their personal information at any time (except they cannot change their username). Website administrators can also see and edit that information.' ) . '</p>';
+
+ /* translators: default privacy policy heading. */
+ $strings[] = '<h2>' . __( 'What rights you have over your data' ) . '</h2>';
+
+ if ( $description ) {
+ /* translators: privacy policy tutorial. */
+ $strings[] = '<p class="privacy-policy-tutorial">' . __( 'In this section you should explain what rights your users have over their data and how they can invoke those rights.' ) . '</p>';
+ }
+
+ /* translators: default privacy policy text. */
+ $strings[] = '<p>' . $suggested_text . __( 'If you have an account on this site, or have left comments, you can request to receive an exported file of the personal data we hold about you, including any data you have provided to us. You can also request that we erase any personal data we hold about you. This does not include any data we are obliged to keep for administrative, legal, or security purposes.' ) . '</p>';
+
+ /* translators: default privacy policy heading. */
+ $strings[] = '<h2>' . __( 'Where we send your data' ) . '</h2>';
+
+ if ( $description ) {
+ /* translators: privacy policy tutorial. */
+ $strings[] = '<p class="privacy-policy-tutorial">' . __( 'In this section you should list all transfers of your site data outside the European Union and describe the means by which that data is safeguarded to European data protection standards. This could include your web hosting, cloud storage, or other third party services.' ) . '</p>';
+ /* translators: privacy policy tutorial. */
+ $strings[] = '<p class="privacy-policy-tutorial">' . __( 'European data protection law requires data about European residents which is transferred outside the European Union to be safeguarded to the same standards as if the data was in Europe. So in addition to listing where data goes, you should describe how you ensure that these standards are met either by yourself or by your third party providers, whether that is through an agreement such as Privacy Shield, model clauses in your contracts, or binding corporate rules.' ) . '</p>';
+ }
+
+ /* translators: default privacy policy text. */
+ $strings[] = '<p>' . $suggested_text . __( 'Visitor comments may be checked through an automated spam detection service.' ) . '</p>';
+
+ /* translators: default privacy policy heading. */
+ $strings[] = '<h2>' . __( 'Your contact information' ) . '</h2>';
+
+ if ( $description ) {
+ /* translators: privacy policy tutorial. */
+ $strings[] = '<p class="privacy-policy-tutorial">' . __( 'In this section you should provide a contact method for privacy-specific concerns. If you are required to have a Data Protection Officer, list their name and full contact details here as well.' ) . '</p>';
+ }
+
+ /* translators: default privacy policy heading. */
+ $strings[] = '<h2>' . __( 'Additional information' ) . '</h2>';
+
+ if ( $description ) {
+ /* translators: privacy policy tutorial. */
+ $strings[] = '<p class="privacy-policy-tutorial">' . __( 'If you use your site for commercial purposes and you engage in more complex collection or processing of personal data, you should note the following information in your privacy policy in addition to the information we have already discussed.' ) . '</p>';
+ }
+
+ /* translators: default privacy policy heading. */
+ $strings[] = '<h3>' . __( 'How we protect your data' ) . '</h3>';
+
+ if ( $description ) {
+ /* translators: privacy policy tutorial. */
+ $strings[] = '<p class="privacy-policy-tutorial">' . __( 'In this section you should explain what measures you have taken to protect your users&#8217; data. This could include technical measures such as encryption; security measures such as two factor authentication; and measures such as staff training in data protection. If you have carried out a Privacy Impact Assessment, you can mention it here too.' ) . '</p>';
+ }
+
+ /* translators: default privacy policy heading. */
+ $strings[] = '<h3>' . __( 'What data breach procedures we have in place' ) . '</h3>';
+
+ if ( $description ) {
+ /* translators: privacy policy tutorial. */
+ $strings[] = '<p class="privacy-policy-tutorial">' . __( 'In this section you should explain what procedures you have in place to deal with data breaches, either potential or real, such as internal reporting systems, contact mechanisms, or bug bounties.' ) . '</p>';
+ }
+
+ /* translators: default privacy policy heading. */
+ $strings[] = '<h3>' . __( 'What third parties we receive data from' ) . '</h3>';
+
+ if ( $description ) {
+ /* translators: privacy policy tutorial. */
+ $strings[] = '<p class="privacy-policy-tutorial">' . __( 'If your web site receives data about users from third parties, including advertisers, this information must be included within the section of your privacy policy dealing with third party data.' ) . '</p>';
+ }
+
+ /* translators: default privacy policy heading. */
+ $strings[] = '<h3>' . __( 'What automated decision making and/or profiling we do with user data' ) . '</h3>';
+
+ if ( $description ) {
+ /* translators: privacy policy tutorial. */
+ $strings[] = '<p class="privacy-policy-tutorial">' . __( 'If your web site provides a service which includes automated decision making - for example, allowing customers to apply for credit, or aggregating their data into an advertising profile - you must note that this is taking place, and include information about how that information is used, what decisions are made with that aggregated data, and what rights users have over decisions made without human intervention.' ) . '</p>';
+ }
+
+ /* translators: default privacy policy heading. */
+ $strings[] = '<h3>' . __( 'Industry regulatory disclosure requirements' ) . '</h3>';
+
+ if ( $description ) {
+ /* translators: privacy policy tutorial. */
+ $strings[] = '<p class="privacy-policy-tutorial">' . __( 'If you are a member of a regulated industry, or if you are subject to additional privacy laws, you may be required to disclose that information here.' ) . '</p>';
+ $strings[] = '</div>';
+ }
+
+ if ( $blocks ) {
+ foreach ( $strings as $key => $string ) {
+ if ( 0 === strpos( $string, '<p>' ) ) {
+ $strings[ $key ] = '<!-- wp:paragraph -->' . $string . '<!-- /wp:paragraph -->';
+ }
+
+ if ( 0 === strpos( $string, '<h2>' ) ) {
+ $strings[ $key ] = '<!-- wp:heading -->' . $string . '<!-- /wp:heading -->';
+ }
+
+ if ( 0 === strpos( $string, '<h3>' ) ) {
+ $strings[ $key ] = '<!-- wp:heading {"level":3} -->' . $string . '<!-- /wp:heading -->';
+ }
+ }
+ }
+
+ $content = implode( '', $strings );
+ // End of the suggested privacy policy text.
+
+ /**
+ * Filters the default content suggested for inclusion in a privacy policy.
+ *
+ * @since 4.9.6
+ * @since 5.0.0 Added the `$strings`, `$description`, and `$blocks` parameters.
+ *
+ * @param string $content The default policy content.
+ * @param array $strings An array of privacy policy content strings.
+ * @param bool $description Whether policy descriptions should be included.
+ * @param bool $blocks Whether the content should be formatted for the block editor.
+ */
+ return apply_filters( 'wp_get_default_privacy_policy_content', $content, $strings, $description, $blocks );
+ }
+
+ /**
+ * Add the suggested privacy policy text to the policy postbox.
+ *
+ * @since 4.9.6
+ */
+ public static function add_suggested_content() {
+ $content = self::get_default_content( true, false );
+ wp_add_privacy_policy_content( __( 'WordPress' ), $content );
+ }
+}
+
+/**
+ * Checks if the user needs to update PHP.
+ *
+ * @since 5.1.0
+ * @since 5.1.1 Added the {@see 'wp_is_php_version_acceptable'} filter.
+ *
+ * @return array|false $response Array of PHP version data. False on failure.
+ */
+function wp_check_php_version() {
+ $version = phpversion();
+ $key = md5( $version );
+
+ $response = get_site_transient( 'php_check_' . $key );
+ if ( false === $response ) {
+ $url = 'http://api.wordpress.org/core/serve-happy/1.0/';
+ if ( wp_http_supports( array( 'ssl' ) ) ) {
+ $url = set_url_scheme( $url, 'https' );
+ }
+
+ $url = add_query_arg( 'php_version', $version, $url );
+
+ $response = wp_remote_get( $url );
+
+ if ( is_wp_error( $response ) || 200 !== wp_remote_retrieve_response_code( $response ) ) {
+ return false;
+ }
+
+ /**
+ * Response should be an array with:
+ * 'recommended_version' - string - The PHP version recommended by WordPress.
+ * 'is_supported' - boolean - Whether the PHP version is actively supported.
+ * 'is_secure' - boolean - Whether the PHP version receives security updates.
+ * 'is_acceptable' - boolean - Whether the PHP version is still acceptable for WordPress.
+ */
+ $response = json_decode( wp_remote_retrieve_body( $response ), true );
+
+ if ( ! is_array( $response ) ) {
+ return false;
+ }
+
+ set_site_transient( 'php_check_' . $key, $response, WEEK_IN_SECONDS );
+ }
+
+ if ( isset( $response['is_acceptable'] ) && $response['is_acceptable'] ) {
+ /**
+ * Filters whether the active PHP version is considered acceptable by WordPress.
+ *
+ * Returning false will trigger a PHP version warning to show up in the admin dashboard to administrators.
+ *
+ * This filter is only run if the wordpress.org Serve Happy API considers the PHP version acceptable, ensuring
+ * that this filter can only make this check stricter, but not loosen it.
+ *
+ * @since 5.1.1
+ *
+ * @param bool $is_acceptable Whether the PHP version is considered acceptable. Default true.
+ * @param string $version PHP version checked.
+ */
+ $response['is_acceptable'] = (bool) apply_filters( 'wp_is_php_version_acceptable', true, $version );
+ }
+
+ return $response;
+}
diff --git a/www/crm/wp-admin/includes/ms-admin-filters.php b/www/crm/wp-admin/includes/ms-admin-filters.php
new file mode 100644
index 00000000..dd4cf9e3
--- /dev/null
+++ b/www/crm/wp-admin/includes/ms-admin-filters.php
@@ -0,0 +1,44 @@
+<?php
+/**
+ * Multisite Administration hooks
+ *
+ * @package WordPress
+ * @subpackage Administration
+ * @since 4.3.0
+ */
+
+// Media Hooks.
+add_filter( 'wp_handle_upload_prefilter', 'check_upload_size' );
+
+// User Hooks
+add_action( 'user_admin_notices', 'new_user_email_admin_notice' );
+add_action( 'network_admin_notices', 'new_user_email_admin_notice' );
+
+add_action( 'admin_page_access_denied', '_access_denied_splash', 99 );
+
+// Site Hooks.
+add_action( 'wpmueditblogaction', 'upload_space_setting' );
+
+// Network hooks
+add_action( 'update_site_option_admin_email', 'wp_network_admin_email_change_notification', 10, 4 );
+
+// Taxonomy Hooks
+add_filter( 'get_term', 'sync_category_tag_slugs', 10, 2 );
+
+// Post Hooks.
+add_filter( 'wp_insert_post_data', 'avoid_blog_page_permalink_collision', 10, 2 );
+
+// Tools Hooks.
+add_filter( 'import_allow_create_users', 'check_import_new_users' );
+
+// Notices Hooks
+add_action( 'admin_notices', 'site_admin_notice' );
+add_action( 'network_admin_notices', 'site_admin_notice' );
+
+// Update Hooks
+add_action( 'network_admin_notices', 'update_nag', 3 );
+add_action( 'network_admin_notices', 'maintenance_nag', 10 );
+
+// Network Admin Hooks
+add_action( 'add_site_option_new_admin_email', 'update_network_option_new_admin_email', 10, 2 );
+add_action( 'update_site_option_new_admin_email', 'update_network_option_new_admin_email', 10, 2 );
diff --git a/www/crm/wp-admin/includes/ms-deprecated.php b/www/crm/wp-admin/includes/ms-deprecated.php
new file mode 100644
index 00000000..811fda74
--- /dev/null
+++ b/www/crm/wp-admin/includes/ms-deprecated.php
@@ -0,0 +1,110 @@
+<?php
+/**
+ * Multisite: Deprecated admin functions from past versions and WordPress MU
+ *
+ * These functions should not be used and will be removed in a later version.
+ * It is suggested to use for the alternatives instead when available.
+ *
+ * @package WordPress
+ * @subpackage Deprecated
+ * @since 3.0.0
+ */
+
+/**
+ * Outputs the WPMU menu.
+ *
+ * @deprecated 3.0.0
+ */
+function wpmu_menu() {
+ _deprecated_function( __FUNCTION__, '3.0.0' );
+ // Deprecated. See #11763.
+}
+
+/**
+ * Determines if the available space defined by the admin has been exceeded by the user.
+ *
+ * @deprecated 3.0.0 Use is_upload_space_available()
+ * @see is_upload_space_available()
+ */
+function wpmu_checkAvailableSpace() {
+ _deprecated_function( __FUNCTION__, '3.0.0', 'is_upload_space_available()' );
+
+ if ( ! is_upload_space_available() ) {
+ wp_die( sprintf(
+ /* translators: %s: allowed space allocation */
+ __( 'Sorry, you have used your space allocation of %s. Please delete some files to upload more files.' ),
+ size_format( get_space_allowed() * MB_IN_BYTES )
+ ) );
+ }
+}
+
+/**
+ * WPMU options.
+ *
+ * @deprecated 3.0.0
+ */
+function mu_options( $options ) {
+ _deprecated_function( __FUNCTION__, '3.0.0' );
+ return $options;
+}
+
+/**
+ * Deprecated functionality for activating a network-only plugin.
+ *
+ * @deprecated 3.0.0 Use activate_plugin()
+ * @see activate_plugin()
+ */
+function activate_sitewide_plugin() {
+ _deprecated_function( __FUNCTION__, '3.0.0', 'activate_plugin()' );
+ return false;
+}
+
+/**
+ * Deprecated functionality for deactivating a network-only plugin.
+ *
+ * @deprecated 3.0.0 Use deactivate_plugin()
+ * @see deactivate_plugin()
+ */
+function deactivate_sitewide_plugin( $plugin = false ) {
+ _deprecated_function( __FUNCTION__, '3.0.0', 'deactivate_plugin()' );
+}
+
+/**
+ * Deprecated functionality for determining if the current plugin is network-only.
+ *
+ * @deprecated 3.0.0 Use is_network_only_plugin()
+ * @see is_network_only_plugin()
+ */
+function is_wpmu_sitewide_plugin( $file ) {
+ _deprecated_function( __FUNCTION__, '3.0.0', 'is_network_only_plugin()' );
+ return is_network_only_plugin( $file );
+}
+
+/**
+ * Deprecated functionality for getting themes network-enabled themes.
+ *
+ * @deprecated 3.4.0 Use WP_Theme::get_allowed_on_network()
+ * @see WP_Theme::get_allowed_on_network()
+ */
+function get_site_allowed_themes() {
+ _deprecated_function( __FUNCTION__, '3.4.0', 'WP_Theme::get_allowed_on_network()' );
+ return array_map( 'intval', WP_Theme::get_allowed_on_network() );
+}
+
+/**
+ * Deprecated functionality for getting themes allowed on a specific site.
+ *
+ * @deprecated 3.4.0 Use WP_Theme::get_allowed_on_site()
+ * @see WP_Theme::get_allowed_on_site()
+ */
+function wpmu_get_blog_allowedthemes( $blog_id = 0 ) {
+ _deprecated_function( __FUNCTION__, '3.4.0', 'WP_Theme::get_allowed_on_site()' );
+ return array_map( 'intval', WP_Theme::get_allowed_on_site( $blog_id ) );
+}
+
+/**
+ * Deprecated functionality for determining whether a file is deprecated.
+ *
+ * @deprecated 3.5.0
+ */
+function ms_deprecated_blogs_file() {}
diff --git a/www/crm/wp-admin/includes/ms.php b/www/crm/wp-admin/includes/ms.php
new file mode 100644
index 00000000..54d638f6
--- /dev/null
+++ b/www/crm/wp-admin/includes/ms.php
@@ -0,0 +1,1177 @@
+<?php
+/**
+ * Multisite administration functions.
+ *
+ * @package WordPress
+ * @subpackage Multisite
+ * @since 3.0.0
+ */
+
+/**
+ * Determine if uploaded file exceeds space quota.
+ *
+ * @since 3.0.0
+ *
+ * @param array $file $_FILES array for a given file.
+ * @return array $_FILES array with 'error' key set if file exceeds quota. 'error' is empty otherwise.
+ */
+function check_upload_size( $file ) {
+ if ( get_site_option( 'upload_space_check_disabled' ) ) {
+ return $file;
+ }
+
+ if ( $file['error'] != '0' ) { // there's already an error
+ return $file;
+ }
+
+ if ( defined( 'WP_IMPORTING' ) ) {
+ return $file;
+ }
+
+ $space_left = get_upload_space_available();
+
+ $file_size = filesize( $file['tmp_name'] );
+ if ( $space_left < $file_size ) {
+ /* translators: %s: required disk space in kilobytes */
+ $file['error'] = sprintf( __( 'Not enough space to upload. %s KB needed.' ), number_format( ( $file_size - $space_left ) / KB_IN_BYTES ) );
+ }
+
+ if ( $file_size > ( KB_IN_BYTES * get_site_option( 'fileupload_maxk', 1500 ) ) ) {
+ /* translators: %s: maximum allowed file size in kilobytes */
+ $file['error'] = sprintf( __( 'This file is too big. Files must be less than %s KB in size.' ), get_site_option( 'fileupload_maxk', 1500 ) );
+ }
+
+ if ( upload_is_user_over_quota( false ) ) {
+ $file['error'] = __( 'You have used your space quota. Please delete files before uploading.' );
+ }
+
+ if ( $file['error'] != '0' && ! isset( $_POST['html-upload'] ) && ! wp_doing_ajax() ) {
+ wp_die( $file['error'] . ' <a href="javascript:history.go(-1)">' . __( 'Back' ) . '</a>' );
+ }
+
+ return $file;
+}
+
+/**
+ * Delete a site.
+ *
+ * @since 3.0.0
+ * @since 5.1.0 Use wp_delete_site() internally to delete the site row from the database.
+ *
+ * @global wpdb $wpdb WordPress database abstraction object.
+ *
+ * @param int $blog_id Site ID.
+ * @param bool $drop True if site's database tables should be dropped. Default is false.
+ */
+function wpmu_delete_blog( $blog_id, $drop = false ) {
+ global $wpdb;
+
+ $switch = false;
+ if ( get_current_blog_id() != $blog_id ) {
+ $switch = true;
+ switch_to_blog( $blog_id );
+ }
+
+ $blog = get_site( $blog_id );
+
+ $current_network = get_network();
+
+ // If a full blog object is not available, do not destroy anything.
+ if ( $drop && ! $blog ) {
+ $drop = false;
+ }
+
+ // Don't destroy the initial, main, or root blog.
+ if ( $drop && ( 1 == $blog_id || is_main_site( $blog_id ) || ( $blog->path == $current_network->path && $blog->domain == $current_network->domain ) ) ) {
+ $drop = false;
+ }
+
+ $upload_path = trim( get_option( 'upload_path' ) );
+
+ // If ms_files_rewriting is enabled and upload_path is empty, wp_upload_dir is not reliable.
+ if ( $drop && get_site_option( 'ms_files_rewriting' ) && empty( $upload_path ) ) {
+ $drop = false;
+ }
+
+ if ( $drop ) {
+ wp_delete_site( $blog_id );
+ } else {
+ /** This action is documented in wp-includes/ms-blogs.php */
+ do_action_deprecated( 'delete_blog', array( $blog_id, false ), '5.1.0' );
+
+ $users = get_users(
+ array(
+ 'blog_id' => $blog_id,
+ 'fields' => 'ids',
+ )
+ );
+
+ // Remove users from this blog.
+ if ( ! empty( $users ) ) {
+ foreach ( $users as $user_id ) {
+ remove_user_from_blog( $user_id, $blog_id );
+ }
+ }
+
+ update_blog_status( $blog_id, 'deleted', 1 );
+
+ /** This action is documented in wp-includes/ms-blogs.php */
+ do_action_deprecated( 'deleted_blog', array( $blog_id, false ), '5.1.0' );
+ }
+
+ if ( $switch ) {
+ restore_current_blog();
+ }
+}
+
+/**
+ * Delete a user from the network and remove from all sites.
+ *
+ * @since 3.0.0
+ *
+ * @todo Merge with wp_delete_user() ?
+ *
+ * @global wpdb $wpdb WordPress database abstraction object.
+ *
+ * @param int $id The user ID.
+ * @return bool True if the user was deleted, otherwise false.
+ */
+function wpmu_delete_user( $id ) {
+ global $wpdb;
+
+ if ( ! is_numeric( $id ) ) {
+ return false;
+ }
+
+ $id = (int) $id;
+ $user = new WP_User( $id );
+
+ if ( ! $user->exists() ) {
+ return false;
+ }
+
+ // Global super-administrators are protected, and cannot be deleted.
+ $_super_admins = get_super_admins();
+ if ( in_array( $user->user_login, $_super_admins, true ) ) {
+ return false;
+ }
+
+ /**
+ * Fires before a user is deleted from the network.
+ *
+ * @since MU (3.0.0)
+ *
+ * @param int $id ID of the user about to be deleted from the network.
+ */
+ do_action( 'wpmu_delete_user', $id );
+
+ $blogs = get_blogs_of_user( $id );
+
+ if ( ! empty( $blogs ) ) {
+ foreach ( $blogs as $blog ) {
+ switch_to_blog( $blog->userblog_id );
+ remove_user_from_blog( $id, $blog->userblog_id );
+
+ $post_ids = $wpdb->get_col( $wpdb->prepare( "SELECT ID FROM $wpdb->posts WHERE post_author = %d", $id ) );
+ foreach ( (array) $post_ids as $post_id ) {
+ wp_delete_post( $post_id );
+ }
+
+ // Clean links
+ $link_ids = $wpdb->get_col( $wpdb->prepare( "SELECT link_id FROM $wpdb->links WHERE link_owner = %d", $id ) );
+
+ if ( $link_ids ) {
+ foreach ( $link_ids as $link_id ) {
+ wp_delete_link( $link_id );
+ }
+ }
+
+ restore_current_blog();
+ }
+ }
+
+ $meta = $wpdb->get_col( $wpdb->prepare( "SELECT umeta_id FROM $wpdb->usermeta WHERE user_id = %d", $id ) );
+ foreach ( $meta as $mid ) {
+ delete_metadata_by_mid( 'user', $mid );
+ }
+
+ $wpdb->delete( $wpdb->users, array( 'ID' => $id ) );
+
+ clean_user_cache( $user );
+
+ /** This action is documented in wp-admin/includes/user.php */
+ do_action( 'deleted_user', $id, null );
+
+ return true;
+}
+
+/**
+ * Check whether a site has used its allotted upload space.
+ *
+ * @since MU (3.0.0)
+ *
+ * @param bool $echo Optional. If $echo is set and the quota is exceeded, a warning message is echoed. Default is true.
+ * @return bool True if user is over upload space quota, otherwise false.
+ */
+function upload_is_user_over_quota( $echo = true ) {
+ if ( get_site_option( 'upload_space_check_disabled' ) ) {
+ return false;
+ }
+
+ $space_allowed = get_space_allowed();
+ if ( ! is_numeric( $space_allowed ) ) {
+ $space_allowed = 10; // Default space allowed is 10 MB
+ }
+ $space_used = get_space_used();
+
+ if ( ( $space_allowed - $space_used ) < 0 ) {
+ if ( $echo ) {
+ printf(
+ /* translators: %s: allowed space allocation */
+ __( 'Sorry, you have used your space allocation of %s. Please delete some files to upload more files.' ),
+ size_format( $space_allowed * MB_IN_BYTES )
+ );
+ }
+ return true;
+ } else {
+ return false;
+ }
+}
+
+/**
+ * Displays the amount of disk space used by the current site. Not used in core.
+ *
+ * @since MU (3.0.0)
+ */
+function display_space_usage() {
+ $space_allowed = get_space_allowed();
+ $space_used = get_space_used();
+
+ $percent_used = ( $space_used / $space_allowed ) * 100;
+
+ if ( $space_allowed > 1000 ) {
+ $space = number_format( $space_allowed / KB_IN_BYTES );
+ /* translators: Gigabytes */
+ $space .= __( 'GB' );
+ } else {
+ $space = number_format( $space_allowed );
+ /* translators: Megabytes */
+ $space .= __( 'MB' );
+ }
+ ?>
+ <strong>
+ <?php
+ /* translators: Storage space that's been used. 1: Percentage of used space, 2: Total space allowed in megabytes or gigabytes */
+ printf( __( 'Used: %1$s%% of %2$s' ), number_format( $percent_used ), $space );
+ ?>
+ </strong>
+ <?php
+}
+
+/**
+ * Get the remaining upload space for this site.
+ *
+ * @since MU (3.0.0)
+ *
+ * @param int $size Current max size in bytes
+ * @return int Max size in bytes
+ */
+function fix_import_form_size( $size ) {
+ if ( upload_is_user_over_quota( false ) ) {
+ return 0;
+ }
+ $available = get_upload_space_available();
+ return min( $size, $available );
+}
+
+/**
+ * Displays the site upload space quota setting form on the Edit Site Settings screen.
+ *
+ * @since 3.0.0
+ *
+ * @param int $id The ID of the site to display the setting for.
+ */
+function upload_space_setting( $id ) {
+ switch_to_blog( $id );
+ $quota = get_option( 'blog_upload_space' );
+ restore_current_blog();
+
+ if ( ! $quota ) {
+ $quota = '';
+ }
+
+ ?>
+ <tr>
+ <th><label for="blog-upload-space-number"><?php _e( 'Site Upload Space Quota' ); ?></label></th>
+ <td>
+ <input type="number" step="1" min="0" style="width: 100px" name="option[blog_upload_space]" id="blog-upload-space-number" aria-describedby="blog-upload-space-desc" value="<?php echo $quota; ?>" />
+ <span id="blog-upload-space-desc"><span class="screen-reader-text"><?php _e( 'Size in megabytes' ); ?></span> <?php _e( 'MB (Leave blank for network default)' ); ?></span>
+ </td>
+ </tr>
+ <?php
+}
+
+/**
+ * Update the status of a user in the database.
+ *
+ * Used in core to mark a user as spam or "ham" (not spam) in Multisite.
+ *
+ * @since 3.0.0
+ *
+ * @global wpdb $wpdb WordPress database abstraction object.
+ *
+ * @param int $id The user ID.
+ * @param string $pref The column in the wp_users table to update the user's status
+ * in (presumably user_status, spam, or deleted).
+ * @param int $value The new status for the user.
+ * @param null $deprecated Deprecated as of 3.0.2 and should not be used.
+ * @return int The initially passed $value.
+ */
+function update_user_status( $id, $pref, $value, $deprecated = null ) {
+ global $wpdb;
+
+ if ( null !== $deprecated ) {
+ _deprecated_argument( __FUNCTION__, '3.0.2' );
+ }
+
+ $wpdb->update( $wpdb->users, array( sanitize_key( $pref ) => $value ), array( 'ID' => $id ) );
+
+ $user = new WP_User( $id );
+ clean_user_cache( $user );
+
+ if ( $pref == 'spam' ) {
+ if ( $value == 1 ) {
+ /**
+ * Fires after the user is marked as a SPAM user.
+ *
+ * @since 3.0.0
+ *
+ * @param int $id ID of the user marked as SPAM.
+ */
+ do_action( 'make_spam_user', $id );
+ } else {
+ /**
+ * Fires after the user is marked as a HAM user. Opposite of SPAM.
+ *
+ * @since 3.0.0
+ *
+ * @param int $id ID of the user marked as HAM.
+ */
+ do_action( 'make_ham_user', $id );
+ }
+ }
+
+ return $value;
+}
+
+/**
+ * Cleans the user cache for a specific user.
+ *
+ * @since 3.0.0
+ *
+ * @param int $id The user ID.
+ * @return bool|int The ID of the refreshed user or false if the user does not exist.
+ */
+function refresh_user_details( $id ) {
+ $id = (int) $id;
+
+ if ( ! $user = get_userdata( $id ) ) {
+ return false;
+ }
+
+ clean_user_cache( $user );
+
+ return $id;
+}
+
+/**
+ * Returns the language for a language code.
+ *
+ * @since 3.0.0
+ *
+ * @param string $code Optional. The two-letter language code. Default empty.
+ * @return string The language corresponding to $code if it exists. If it does not exist,
+ * then the first two letters of $code is returned.
+ */
+function format_code_lang( $code = '' ) {
+ $code = strtolower( substr( $code, 0, 2 ) );
+ $lang_codes = array(
+ 'aa' => 'Afar',
+ 'ab' => 'Abkhazian',
+ 'af' => 'Afrikaans',
+ 'ak' => 'Akan',
+ 'sq' => 'Albanian',
+ 'am' => 'Amharic',
+ 'ar' => 'Arabic',
+ 'an' => 'Aragonese',
+ 'hy' => 'Armenian',
+ 'as' => 'Assamese',
+ 'av' => 'Avaric',
+ 'ae' => 'Avestan',
+ 'ay' => 'Aymara',
+ 'az' => 'Azerbaijani',
+ 'ba' => 'Bashkir',
+ 'bm' => 'Bambara',
+ 'eu' => 'Basque',
+ 'be' => 'Belarusian',
+ 'bn' => 'Bengali',
+ 'bh' => 'Bihari',
+ 'bi' => 'Bislama',
+ 'bs' => 'Bosnian',
+ 'br' => 'Breton',
+ 'bg' => 'Bulgarian',
+ 'my' => 'Burmese',
+ 'ca' => 'Catalan; Valencian',
+ 'ch' => 'Chamorro',
+ 'ce' => 'Chechen',
+ 'zh' => 'Chinese',
+ 'cu' => 'Church Slavic; Old Slavonic; Church Slavonic; Old Bulgarian; Old Church Slavonic',
+ 'cv' => 'Chuvash',
+ 'kw' => 'Cornish',
+ 'co' => 'Corsican',
+ 'cr' => 'Cree',
+ 'cs' => 'Czech',
+ 'da' => 'Danish',
+ 'dv' => 'Divehi; Dhivehi; Maldivian',
+ 'nl' => 'Dutch; Flemish',
+ 'dz' => 'Dzongkha',
+ 'en' => 'English',
+ 'eo' => 'Esperanto',
+ 'et' => 'Estonian',
+ 'ee' => 'Ewe',
+ 'fo' => 'Faroese',
+ 'fj' => 'Fijjian',
+ 'fi' => 'Finnish',
+ 'fr' => 'French',
+ 'fy' => 'Western Frisian',
+ 'ff' => 'Fulah',
+ 'ka' => 'Georgian',
+ 'de' => 'German',
+ 'gd' => 'Gaelic; Scottish Gaelic',
+ 'ga' => 'Irish',
+ 'gl' => 'Galician',
+ 'gv' => 'Manx',
+ 'el' => 'Greek, Modern',
+ 'gn' => 'Guarani',
+ 'gu' => 'Gujarati',
+ 'ht' => 'Haitian; Haitian Creole',
+ 'ha' => 'Hausa',
+ 'he' => 'Hebrew',
+ 'hz' => 'Herero',
+ 'hi' => 'Hindi',
+ 'ho' => 'Hiri Motu',
+ 'hu' => 'Hungarian',
+ 'ig' => 'Igbo',
+ 'is' => 'Icelandic',
+ 'io' => 'Ido',
+ 'ii' => 'Sichuan Yi',
+ 'iu' => 'Inuktitut',
+ 'ie' => 'Interlingue',
+ 'ia' => 'Interlingua (International Auxiliary Language Association)',
+ 'id' => 'Indonesian',
+ 'ik' => 'Inupiaq',
+ 'it' => 'Italian',
+ 'jv' => 'Javanese',
+ 'ja' => 'Japanese',
+ 'kl' => 'Kalaallisut; Greenlandic',
+ 'kn' => 'Kannada',
+ 'ks' => 'Kashmiri',
+ 'kr' => 'Kanuri',
+ 'kk' => 'Kazakh',
+ 'km' => 'Central Khmer',
+ 'ki' => 'Kikuyu; Gikuyu',
+ 'rw' => 'Kinyarwanda',
+ 'ky' => 'Kirghiz; Kyrgyz',
+ 'kv' => 'Komi',
+ 'kg' => 'Kongo',
+ 'ko' => 'Korean',
+ 'kj' => 'Kuanyama; Kwanyama',
+ 'ku' => 'Kurdish',
+ 'lo' => 'Lao',
+ 'la' => 'Latin',
+ 'lv' => 'Latvian',
+ 'li' => 'Limburgan; Limburger; Limburgish',
+ 'ln' => 'Lingala',
+ 'lt' => 'Lithuanian',
+ 'lb' => 'Luxembourgish; Letzeburgesch',
+ 'lu' => 'Luba-Katanga',
+ 'lg' => 'Ganda',
+ 'mk' => 'Macedonian',
+ 'mh' => 'Marshallese',
+ 'ml' => 'Malayalam',
+ 'mi' => 'Maori',
+ 'mr' => 'Marathi',
+ 'ms' => 'Malay',
+ 'mg' => 'Malagasy',
+ 'mt' => 'Maltese',
+ 'mo' => 'Moldavian',
+ 'mn' => 'Mongolian',
+ 'na' => 'Nauru',
+ 'nv' => 'Navajo; Navaho',
+ 'nr' => 'Ndebele, South; South Ndebele',
+ 'nd' => 'Ndebele, North; North Ndebele',
+ 'ng' => 'Ndonga',
+ 'ne' => 'Nepali',
+ 'nn' => 'Norwegian Nynorsk; Nynorsk, Norwegian',
+ 'nb' => 'Bokmål, Norwegian, Norwegian Bokmål',
+ 'no' => 'Norwegian',
+ 'ny' => 'Chichewa; Chewa; Nyanja',
+ 'oc' => 'Occitan, Provençal',
+ 'oj' => 'Ojibwa',
+ 'or' => 'Oriya',
+ 'om' => 'Oromo',
+ 'os' => 'Ossetian; Ossetic',
+ 'pa' => 'Panjabi; Punjabi',
+ 'fa' => 'Persian',
+ 'pi' => 'Pali',
+ 'pl' => 'Polish',
+ 'pt' => 'Portuguese',
+ 'ps' => 'Pushto',
+ 'qu' => 'Quechua',
+ 'rm' => 'Romansh',
+ 'ro' => 'Romanian',
+ 'rn' => 'Rundi',
+ 'ru' => 'Russian',
+ 'sg' => 'Sango',
+ 'sa' => 'Sanskrit',
+ 'sr' => 'Serbian',
+ 'hr' => 'Croatian',
+ 'si' => 'Sinhala; Sinhalese',
+ 'sk' => 'Slovak',
+ 'sl' => 'Slovenian',
+ 'se' => 'Northern Sami',
+ 'sm' => 'Samoan',
+ 'sn' => 'Shona',
+ 'sd' => 'Sindhi',
+ 'so' => 'Somali',
+ 'st' => 'Sotho, Southern',
+ 'es' => 'Spanish; Castilian',
+ 'sc' => 'Sardinian',
+ 'ss' => 'Swati',
+ 'su' => 'Sundanese',
+ 'sw' => 'Swahili',
+ 'sv' => 'Swedish',
+ 'ty' => 'Tahitian',
+ 'ta' => 'Tamil',
+ 'tt' => 'Tatar',
+ 'te' => 'Telugu',
+ 'tg' => 'Tajik',
+ 'tl' => 'Tagalog',
+ 'th' => 'Thai',
+ 'bo' => 'Tibetan',
+ 'ti' => 'Tigrinya',
+ 'to' => 'Tonga (Tonga Islands)',
+ 'tn' => 'Tswana',
+ 'ts' => 'Tsonga',
+ 'tk' => 'Turkmen',
+ 'tr' => 'Turkish',
+ 'tw' => 'Twi',
+ 'ug' => 'Uighur; Uyghur',
+ 'uk' => 'Ukrainian',
+ 'ur' => 'Urdu',
+ 'uz' => 'Uzbek',
+ 've' => 'Venda',
+ 'vi' => 'Vietnamese',
+ 'vo' => 'Volapük',
+ 'cy' => 'Welsh',
+ 'wa' => 'Walloon',
+ 'wo' => 'Wolof',
+ 'xh' => 'Xhosa',
+ 'yi' => 'Yiddish',
+ 'yo' => 'Yoruba',
+ 'za' => 'Zhuang; Chuang',
+ 'zu' => 'Zulu',
+ );
+
+ /**
+ * Filters the language codes.
+ *
+ * @since MU (3.0.0)
+ *
+ * @param string[] $lang_codes Array of key/value pairs of language codes where key is the short version.
+ * @param string $code A two-letter designation of the language.
+ */
+ $lang_codes = apply_filters( 'lang_codes', $lang_codes, $code );
+ return strtr( $code, $lang_codes );
+}
+
+/**
+ * Synchronizes category and post tag slugs when global terms are enabled.
+ *
+ * @since 3.0.0
+ *
+ * @param WP_Term|array $term The term.
+ * @param string $taxonomy The taxonomy for `$term`. Should be 'category' or 'post_tag', as these are
+ * the only taxonomies which are processed by this function; anything else
+ * will be returned untouched.
+ * @return WP_Term|array Returns `$term`, after filtering the 'slug' field with `sanitize_title()`
+ * if `$taxonomy` is 'category' or 'post_tag'.
+ */
+function sync_category_tag_slugs( $term, $taxonomy ) {
+ if ( global_terms_enabled() && ( $taxonomy == 'category' || $taxonomy == 'post_tag' ) ) {
+ if ( is_object( $term ) ) {
+ $term->slug = sanitize_title( $term->name );
+ } else {
+ $term['slug'] = sanitize_title( $term['name'] );
+ }
+ }
+ return $term;
+}
+
+/**
+ * Displays an access denied message when a user tries to view a site's dashboard they
+ * do not have access to.
+ *
+ * @since 3.2.0
+ * @access private
+ */
+function _access_denied_splash() {
+ if ( ! is_user_logged_in() || is_network_admin() ) {
+ return;
+ }
+
+ $blogs = get_blogs_of_user( get_current_user_id() );
+
+ if ( wp_list_filter( $blogs, array( 'userblog_id' => get_current_blog_id() ) ) ) {
+ return;
+ }
+
+ $blog_name = get_bloginfo( 'name' );
+
+ if ( empty( $blogs ) ) {
+ wp_die( sprintf( __( 'You attempted to access the "%1$s" dashboard, but you do not currently have privileges on this site. If you believe you should be able to access the "%1$s" dashboard, please contact your network administrator.' ), $blog_name ), 403 );
+ }
+
+ $output = '<p>' . sprintf( __( 'You attempted to access the "%1$s" dashboard, but you do not currently have privileges on this site. If you believe you should be able to access the "%1$s" dashboard, please contact your network administrator.' ), $blog_name ) . '</p>';
+ $output .= '<p>' . __( 'If you reached this screen by accident and meant to visit one of your own sites, here are some shortcuts to help you find your way.' ) . '</p>';
+
+ $output .= '<h3>' . __( 'Your Sites' ) . '</h3>';
+ $output .= '<table>';
+
+ foreach ( $blogs as $blog ) {
+ $output .= '<tr>';
+ $output .= "<td>{$blog->blogname}</td>";
+ $output .= '<td><a href="' . esc_url( get_admin_url( $blog->userblog_id ) ) . '">' . __( 'Visit Dashboard' ) . '</a> | ' .
+ '<a href="' . esc_url( get_home_url( $blog->userblog_id ) ) . '">' . __( 'View Site' ) . '</a></td>';
+ $output .= '</tr>';
+ }
+
+ $output .= '</table>';
+
+ wp_die( $output, 403 );
+}
+
+/**
+ * Checks if the current user has permissions to import new users.
+ *
+ * @since 3.0.0
+ *
+ * @param string $permission A permission to be checked. Currently not used.
+ * @return bool True if the user has proper permissions, false if they do not.
+ */
+function check_import_new_users( $permission ) {
+ if ( ! current_user_can( 'manage_network_users' ) ) {
+ return false;
+ }
+
+ return true;
+}
+// See "import_allow_fetch_attachments" and "import_attachment_size_limit" filters too.
+
+/**
+ * Generates and displays a drop-down of available languages.
+ *
+ * @since 3.0.0
+ *
+ * @param string[] $lang_files Optional. An array of the language files. Default empty array.
+ * @param string $current Optional. The current language code. Default empty.
+ */
+function mu_dropdown_languages( $lang_files = array(), $current = '' ) {
+ $flag = false;
+ $output = array();
+
+ foreach ( (array) $lang_files as $val ) {
+ $code_lang = basename( $val, '.mo' );
+
+ if ( $code_lang == 'en_US' ) { // American English
+ $flag = true;
+ $ae = __( 'American English' );
+ $output[ $ae ] = '<option value="' . esc_attr( $code_lang ) . '"' . selected( $current, $code_lang, false ) . '> ' . $ae . '</option>';
+ } elseif ( $code_lang == 'en_GB' ) { // British English
+ $flag = true;
+ $be = __( 'British English' );
+ $output[ $be ] = '<option value="' . esc_attr( $code_lang ) . '"' . selected( $current, $code_lang, false ) . '> ' . $be . '</option>';
+ } else {
+ $translated = format_code_lang( $code_lang );
+ $output[ $translated ] = '<option value="' . esc_attr( $code_lang ) . '"' . selected( $current, $code_lang, false ) . '> ' . esc_html( $translated ) . '</option>';
+ }
+ }
+
+ if ( $flag === false ) { // WordPress english
+ $output[] = '<option value=""' . selected( $current, '', false ) . '>' . __( 'English' ) . '</option>';
+ }
+
+ // Order by name
+ uksort( $output, 'strnatcasecmp' );
+
+ /**
+ * Filters the languages available in the dropdown.
+ *
+ * @since MU (3.0.0)
+ *
+ * @param string[] $output Array of HTML output for the dropdown.
+ * @param string[] $lang_files Array of available language files.
+ * @param string $current The current language code.
+ */
+ $output = apply_filters( 'mu_dropdown_languages', $output, $lang_files, $current );
+
+ echo implode( "\n\t", $output );
+}
+
+/**
+ * Displays an admin notice to upgrade all sites after a core upgrade.
+ *
+ * @since 3.0.0
+ *
+ * @global int $wp_db_version The version number of the database.
+ * @global string $pagenow
+ *
+ * @return false False if the current user is not a super admin.
+ */
+function site_admin_notice() {
+ global $wp_db_version, $pagenow;
+
+ if ( ! current_user_can( 'upgrade_network' ) ) {
+ return false;
+ }
+
+ if ( 'upgrade.php' == $pagenow ) {
+ return;
+ }
+
+ if ( get_site_option( 'wpmu_upgrade_site' ) != $wp_db_version ) {
+ echo "<div class='update-nag'>" . sprintf( __( 'Thank you for Updating! Please visit the <a href="%s">Upgrade Network</a> page to update all your sites.' ), esc_url( network_admin_url( 'upgrade.php' ) ) ) . '</div>';
+ }
+}
+
+/**
+ * Avoids a collision between a site slug and a permalink slug.
+ *
+ * In a subdirectory installation this will make sure that a site and a post do not use the
+ * same subdirectory by checking for a site with the same name as a new post.
+ *
+ * @since 3.0.0
+ *
+ * @param array $data An array of post data.
+ * @param array $postarr An array of posts. Not currently used.
+ * @return array The new array of post data after checking for collisions.
+ */
+function avoid_blog_page_permalink_collision( $data, $postarr ) {
+ if ( is_subdomain_install() ) {
+ return $data;
+ }
+ if ( $data['post_type'] != 'page' ) {
+ return $data;
+ }
+ if ( ! isset( $data['post_name'] ) || $data['post_name'] == '' ) {
+ return $data;
+ }
+ if ( ! is_main_site() ) {
+ return $data;
+ }
+
+ $post_name = $data['post_name'];
+ $c = 0;
+ while ( $c < 10 && get_id_from_blogname( $post_name ) ) {
+ $post_name .= mt_rand( 1, 10 );
+ $c ++;
+ }
+ if ( $post_name != $data['post_name'] ) {
+ $data['post_name'] = $post_name;
+ }
+ return $data;
+}
+
+/**
+ * Handles the display of choosing a user's primary site.
+ *
+ * This displays the user's primary site and allows the user to choose
+ * which site is primary.
+ *
+ * @since 3.0.0
+ */
+function choose_primary_blog() {
+ ?>
+ <table class="form-table" role="presentation">
+ <tr>
+ <?php /* translators: My sites label */ ?>
+ <th scope="row"><label for="primary_blog"><?php _e( 'Primary Site' ); ?></label></th>
+ <td>
+ <?php
+ $all_blogs = get_blogs_of_user( get_current_user_id() );
+ $primary_blog = get_user_meta( get_current_user_id(), 'primary_blog', true );
+ if ( count( $all_blogs ) > 1 ) {
+ $found = false;
+ ?>
+ <select name="primary_blog" id="primary_blog">
+ <?php
+ foreach ( (array) $all_blogs as $blog ) {
+ if ( $primary_blog == $blog->userblog_id ) {
+ $found = true;
+ }
+ ?>
+ <option value="<?php echo $blog->userblog_id; ?>"<?php selected( $primary_blog, $blog->userblog_id ); ?>><?php echo esc_url( get_home_url( $blog->userblog_id ) ); ?></option>
+ <?php
+ }
+ ?>
+ </select>
+ <?php
+ if ( ! $found ) {
+ $blog = reset( $all_blogs );
+ update_user_meta( get_current_user_id(), 'primary_blog', $blog->userblog_id );
+ }
+ } elseif ( count( $all_blogs ) == 1 ) {
+ $blog = reset( $all_blogs );
+ echo esc_url( get_home_url( $blog->userblog_id ) );
+ if ( $primary_blog != $blog->userblog_id ) { // Set the primary blog again if it's out of sync with blog list.
+ update_user_meta( get_current_user_id(), 'primary_blog', $blog->userblog_id );
+ }
+ } else {
+ echo 'N/A';
+ }
+ ?>
+ </td>
+ </tr>
+ </table>
+ <?php
+}
+
+/**
+ * Whether or not we can edit this network from this page.
+ *
+ * By default editing of network is restricted to the Network Admin for that `$network_id`.
+ * This function allows for this to be overridden.
+ *
+ * @since 3.1.0
+ *
+ * @param int $network_id The network ID to check.
+ * @return bool True if network can be edited, otherwise false.
+ */
+function can_edit_network( $network_id ) {
+ if ( $network_id == get_current_network_id() ) {
+ $result = true;
+ } else {
+ $result = false;
+ }
+
+ /**
+ * Filters whether this network can be edited from this page.
+ *
+ * @since 3.1.0
+ *
+ * @param bool $result Whether the network can be edited from this page.
+ * @param int $network_id The network ID to check.
+ */
+ return apply_filters( 'can_edit_network', $result, $network_id );
+}
+
+/**
+ * Thickbox image paths for Network Admin.
+ *
+ * @since 3.1.0
+ *
+ * @access private
+ */
+function _thickbox_path_admin_subfolder() {
+ ?>
+<script type="text/javascript">
+var tb_pathToImage = "<?php echo includes_url( 'js/thickbox/loadingAnimation.gif', 'relative' ); ?>";
+</script>
+ <?php
+}
+
+/**
+ * @param array $users
+ */
+function confirm_delete_users( $users ) {
+ $current_user = wp_get_current_user();
+ if ( ! is_array( $users ) || empty( $users ) ) {
+ return false;
+ }
+ ?>
+ <h1><?php esc_html_e( 'Users' ); ?></h1>
+
+ <?php if ( 1 == count( $users ) ) : ?>
+ <p><?php _e( 'You have chosen to delete the user from all networks and sites.' ); ?></p>
+ <?php else : ?>
+ <p><?php _e( 'You have chosen to delete the following users from all networks and sites.' ); ?></p>
+ <?php endif; ?>
+
+ <form action="users.php?action=dodelete" method="post">
+ <input type="hidden" name="dodelete" />
+ <?php
+ wp_nonce_field( 'ms-users-delete' );
+ $site_admins = get_super_admins();
+ $admin_out = '<option value="' . esc_attr( $current_user->ID ) . '">' . $current_user->user_login . '</option>';
+ ?>
+ <table class="form-table" role="presentation">
+ <?php
+ foreach ( ( $allusers = (array) $_POST['allusers'] ) as $user_id ) {
+ if ( $user_id != '' && $user_id != '0' ) {
+ $delete_user = get_userdata( $user_id );
+
+ if ( ! current_user_can( 'delete_user', $delete_user->ID ) ) {
+ wp_die( sprintf( __( 'Warning! User %s cannot be deleted.' ), $delete_user->user_login ) );
+ }
+
+ if ( in_array( $delete_user->user_login, $site_admins ) ) {
+ wp_die( sprintf( __( 'Warning! User cannot be deleted. The user %s is a network administrator.' ), '<em>' . $delete_user->user_login . '</em>' ) );
+ }
+ ?>
+ <tr>
+ <th scope="row"><?php echo $delete_user->user_login; ?>
+ <?php echo '<input type="hidden" name="user[]" value="' . esc_attr( $user_id ) . '" />' . "\n"; ?>
+ </th>
+ <?php
+ $blogs = get_blogs_of_user( $user_id, true );
+
+ if ( ! empty( $blogs ) ) {
+ ?>
+ <td><fieldset><p><legend>
+ <?php
+ printf(
+ /* translators: user login */
+ __( 'What should be done with content owned by %s?' ),
+ '<em>' . $delete_user->user_login . '</em>'
+ );
+ ?>
+ </legend></p>
+ <?php
+ foreach ( (array) $blogs as $key => $details ) {
+ $blog_users = get_users(
+ array(
+ 'blog_id' => $details->userblog_id,
+ 'fields' => array( 'ID', 'user_login' ),
+ )
+ );
+ if ( is_array( $blog_users ) && ! empty( $blog_users ) ) {
+ $user_site = "<a href='" . esc_url( get_home_url( $details->userblog_id ) ) . "'>{$details->blogname}</a>";
+ $user_dropdown = '<label for="reassign_user" class="screen-reader-text">' . __( 'Select a user' ) . '</label>';
+ $user_dropdown .= "<select name='blog[$user_id][$key]' id='reassign_user'>";
+ $user_list = '';
+ foreach ( $blog_users as $user ) {
+ if ( ! in_array( $user->ID, $allusers ) ) {
+ $user_list .= "<option value='{$user->ID}'>{$user->user_login}</option>";
+ }
+ }
+ if ( '' == $user_list ) {
+ $user_list = $admin_out;
+ }
+ $user_dropdown .= $user_list;
+ $user_dropdown .= "</select>\n";
+ ?>
+ <ul style="list-style:none;">
+ <li><?php printf( __( 'Site: %s' ), $user_site ); ?></li>
+ <li><label><input type="radio" id="delete_option0" name="delete[<?php echo $details->userblog_id . '][' . $delete_user->ID; ?>]" value="delete" checked="checked" />
+ <?php _e( 'Delete all content.' ); ?></label></li>
+ <li><label><input type="radio" id="delete_option1" name="delete[<?php echo $details->userblog_id . '][' . $delete_user->ID; ?>]" value="reassign" />
+ <?php _e( 'Attribute all content to:' ); ?></label>
+ <?php echo $user_dropdown; ?></li>
+ </ul>
+ <?php
+ }
+ }
+ echo '</fieldset></td></tr>';
+ } else {
+ ?>
+ <td><p><?php _e( 'User has no sites or content and will be deleted.' ); ?></p></td>
+ <?php } ?>
+ </tr>
+ <?php
+ }
+ }
+
+ ?>
+ </table>
+ <?php
+ /** This action is documented in wp-admin/users.php */
+ do_action( 'delete_user_form', $current_user, $allusers );
+
+ if ( 1 == count( $users ) ) :
+ ?>
+ <p><?php _e( 'Once you hit &#8220;Confirm Deletion&#8221;, the user will be permanently removed.' ); ?></p>
+ <?php else : ?>
+ <p><?php _e( 'Once you hit &#8220;Confirm Deletion&#8221;, these users will be permanently removed.' ); ?></p>
+ <?php
+ endif;
+
+ submit_button( __( 'Confirm Deletion' ), 'primary' );
+ ?>
+ </form>
+ <?php
+ return true;
+}
+
+/**
+ * Print JavaScript in the header on the Network Settings screen.
+ *
+ * @since 4.1.0
+ */
+function network_settings_add_js() {
+ ?>
+<script type="text/javascript">
+jQuery(document).ready( function($) {
+ var languageSelect = $( '#WPLANG' );
+ $( 'form' ).submit( function() {
+ // Don't show a spinner for English and installed languages,
+ // as there is nothing to download.
+ if ( ! languageSelect.find( 'option:selected' ).data( 'installed' ) ) {
+ $( '#submit', this ).after( '<span class="spinner language-install-spinner is-active" />' );
+ }
+ });
+});
+</script>
+ <?php
+}
+
+/**
+ * Outputs the HTML for a network's "Edit Site" tabular interface.
+ *
+ * @since 4.6.0
+ *
+ * @param $args {
+ * Optional. Array or string of Query parameters. Default empty array.
+ *
+ * @type int $blog_id The site ID. Default is the current site.
+ * @type array $links The tabs to include with (label|url|cap) keys.
+ * @type string $selected The ID of the selected link.
+ * }
+ */
+function network_edit_site_nav( $args = array() ) {
+
+ /**
+ * Filters the links that appear on site-editing network pages.
+ *
+ * Default links: 'site-info', 'site-users', 'site-themes', and 'site-settings'.
+ *
+ * @since 4.6.0
+ *
+ * @param array $links {
+ * An array of link data representing individual network admin pages.
+ *
+ * @type array $link_slug {
+ * An array of information about the individual link to a page.
+ *
+ * $type string $label Label to use for the link.
+ * $type string $url URL, relative to `network_admin_url()` to use for the link.
+ * $type string $cap Capability required to see the link.
+ * }
+ * }
+ */
+ $links = apply_filters(
+ 'network_edit_site_nav_links',
+ array(
+ 'site-info' => array(
+ 'label' => __( 'Info' ),
+ 'url' => 'site-info.php',
+ 'cap' => 'manage_sites',
+ ),
+ 'site-users' => array(
+ 'label' => __( 'Users' ),
+ 'url' => 'site-users.php',
+ 'cap' => 'manage_sites',
+ ),
+ 'site-themes' => array(
+ 'label' => __( 'Themes' ),
+ 'url' => 'site-themes.php',
+ 'cap' => 'manage_sites',
+ ),
+ 'site-settings' => array(
+ 'label' => __( 'Settings' ),
+ 'url' => 'site-settings.php',
+ 'cap' => 'manage_sites',
+ ),
+ )
+ );
+
+ // Parse arguments
+ $r = wp_parse_args(
+ $args,
+ array(
+ 'blog_id' => isset( $_GET['blog_id'] ) ? (int) $_GET['blog_id'] : 0,
+ 'links' => $links,
+ 'selected' => 'site-info',
+ )
+ );
+
+ // Setup the links array
+ $screen_links = array();
+
+ // Loop through tabs
+ foreach ( $r['links'] as $link_id => $link ) {
+
+ // Skip link if user can't access
+ if ( ! current_user_can( $link['cap'], $r['blog_id'] ) ) {
+ continue;
+ }
+
+ // Link classes
+ $classes = array( 'nav-tab' );
+
+ // Aria-current attribute.
+ $aria_current = '';
+
+ // Selected is set by the parent OR assumed by the $pagenow global
+ if ( $r['selected'] === $link_id || $link['url'] === $GLOBALS['pagenow'] ) {
+ $classes[] = 'nav-tab-active';
+ $aria_current = ' aria-current="page"';
+ }
+
+ // Escape each class
+ $esc_classes = implode( ' ', $classes );
+
+ // Get the URL for this link
+ $url = add_query_arg( array( 'id' => $r['blog_id'] ), network_admin_url( $link['url'] ) );
+
+ // Add link to nav links
+ $screen_links[ $link_id ] = '<a href="' . esc_url( $url ) . '" id="' . esc_attr( $link_id ) . '" class="' . $esc_classes . '"' . $aria_current . '>' . esc_html( $link['label'] ) . '</a>';
+ }
+
+ // All done!
+ echo '<nav class="nav-tab-wrapper wp-clearfix" aria-label="' . esc_attr__( 'Secondary menu' ) . '">';
+ echo implode( '', $screen_links );
+ echo '</nav>';
+}
+
+/**
+ * Returns the arguments for the help tab on the Edit Site screens.
+ *
+ * @since 4.9.0
+ *
+ * @return array Help tab arguments.
+ */
+function get_site_screen_help_tab_args() {
+ return array(
+ 'id' => 'overview',
+ 'title' => __( 'Overview' ),
+ 'content' =>
+ '<p>' . __( 'The menu is for editing information specific to individual sites, particularly if the admin area of a site is unavailable.' ) . '</p>' .
+ '<p>' . __( '<strong>Info</strong> &mdash; The site URL is rarely edited as this can cause the site to not work properly. The Registered date and Last Updated date are displayed. Network admins can mark a site as archived, spam, deleted and mature, to remove from public listings or disable.' ) . '</p>' .
+ '<p>' . __( '<strong>Users</strong> &mdash; This displays the users associated with this site. You can also change their role, reset their password, or remove them from the site. Removing the user from the site does not remove the user from the network.' ) . '</p>' .
+ '<p>' . sprintf( __( '<strong>Themes</strong> &mdash; This area shows themes that are not already enabled across the network. Enabling a theme in this menu makes it accessible to this site. It does not activate the theme, but allows it to show in the site&#8217;s Appearance menu. To enable a theme for the entire network, see the <a href="%s">Network Themes</a> screen.' ), network_admin_url( 'themes.php' ) ) . '</p>' .
+ '<p>' . __( '<strong>Settings</strong> &mdash; This page shows a list of all settings associated with this site. Some are created by WordPress and others are created by plugins you activate. Note that some fields are grayed out and say Serialized Data. You cannot modify these values due to the way the setting is stored in the database.' ) . '</p>',
+ );
+}
+
+/**
+ * Returns the content for the help sidebar on the Edit Site screens.
+ *
+ * @since 4.9.0
+ *
+ * @return string Help sidebar content.
+ */
+function get_site_screen_help_sidebar_content() {
+ return '<p><strong>' . __( 'For more information:' ) . '</strong></p>' .
+ '<p>' . __( '<a href="https://codex.wordpress.org/Network_Admin_Sites_Screen">Documentation on Site Management</a>' ) . '</p>' .
+ '<p>' . __( '<a href="https://wordpress.org/support/forum/multisite/">Support Forums</a>' ) . '</p>';
+}
diff --git a/www/crm/wp-admin/includes/nav-menu.php b/www/crm/wp-admin/includes/nav-menu.php
new file mode 100644
index 00000000..0539e7f2
--- /dev/null
+++ b/www/crm/wp-admin/includes/nav-menu.php
@@ -0,0 +1,1250 @@
+<?php
+/**
+ * Core Navigation Menu API
+ *
+ * @package WordPress
+ * @subpackage Nav_Menus
+ * @since 3.0.0
+ */
+
+/** Walker_Nav_Menu_Edit class */
+require_once( ABSPATH . 'wp-admin/includes/class-walker-nav-menu-edit.php' );
+
+/** Walker_Nav_Menu_Checklist class */
+require_once( ABSPATH . 'wp-admin/includes/class-walker-nav-menu-checklist.php' );
+
+/**
+ * Prints the appropriate response to a menu quick search.
+ *
+ * @since 3.0.0
+ *
+ * @param array $request The unsanitized request values.
+ */
+function _wp_ajax_menu_quick_search( $request = array() ) {
+ $args = array();
+ $type = isset( $request['type'] ) ? $request['type'] : '';
+ $object_type = isset( $request['object_type'] ) ? $request['object_type'] : '';
+ $query = isset( $request['q'] ) ? $request['q'] : '';
+ $response_format = isset( $request['response-format'] ) && in_array( $request['response-format'], array( 'json', 'markup' ) ) ? $request['response-format'] : 'json';
+
+ if ( 'markup' == $response_format ) {
+ $args['walker'] = new Walker_Nav_Menu_Checklist;
+ }
+
+ if ( 'get-post-item' == $type ) {
+ if ( post_type_exists( $object_type ) ) {
+ if ( isset( $request['ID'] ) ) {
+ $object_id = (int) $request['ID'];
+ if ( 'markup' == $response_format ) {
+ echo walk_nav_menu_tree( array_map( 'wp_setup_nav_menu_item', array( get_post( $object_id ) ) ), 0, (object) $args );
+ } elseif ( 'json' == $response_format ) {
+ echo wp_json_encode(
+ array(
+ 'ID' => $object_id,
+ 'post_title' => get_the_title( $object_id ),
+ 'post_type' => get_post_type( $object_id ),
+ )
+ );
+ echo "\n";
+ }
+ }
+ } elseif ( taxonomy_exists( $object_type ) ) {
+ if ( isset( $request['ID'] ) ) {
+ $object_id = (int) $request['ID'];
+ if ( 'markup' == $response_format ) {
+ echo walk_nav_menu_tree( array_map( 'wp_setup_nav_menu_item', array( get_term( $object_id, $object_type ) ) ), 0, (object) $args );
+ } elseif ( 'json' == $response_format ) {
+ $post_obj = get_term( $object_id, $object_type );
+ echo wp_json_encode(
+ array(
+ 'ID' => $object_id,
+ 'post_title' => $post_obj->name,
+ 'post_type' => $object_type,
+ )
+ );
+ echo "\n";
+ }
+ }
+ }
+ } elseif ( preg_match( '/quick-search-(posttype|taxonomy)-([a-zA-Z_-]*\b)/', $type, $matches ) ) {
+ if ( 'posttype' == $matches[1] && get_post_type_object( $matches[2] ) ) {
+ $post_type_obj = _wp_nav_menu_meta_box_object( get_post_type_object( $matches[2] ) );
+ $args = array_merge(
+ $args,
+ array(
+ 'no_found_rows' => true,
+ 'update_post_meta_cache' => false,
+ 'update_post_term_cache' => false,
+ 'posts_per_page' => 10,
+ 'post_type' => $matches[2],
+ 's' => $query,
+ )
+ );
+ if ( isset( $post_type_obj->_default_query ) ) {
+ $args = array_merge( $args, (array) $post_type_obj->_default_query );
+ }
+ $search_results_query = new WP_Query( $args );
+ if ( ! $search_results_query->have_posts() ) {
+ return;
+ }
+ while ( $search_results_query->have_posts() ) {
+ $post = $search_results_query->next_post();
+ if ( 'markup' == $response_format ) {
+ $var_by_ref = $post->ID;
+ echo walk_nav_menu_tree( array_map( 'wp_setup_nav_menu_item', array( get_post( $var_by_ref ) ) ), 0, (object) $args );
+ } elseif ( 'json' == $response_format ) {
+ echo wp_json_encode(
+ array(
+ 'ID' => $post->ID,
+ 'post_title' => get_the_title( $post->ID ),
+ 'post_type' => $matches[2],
+ )
+ );
+ echo "\n";
+ }
+ }
+ } elseif ( 'taxonomy' == $matches[1] ) {
+ $terms = get_terms(
+ array(
+ 'taxonomy' => $matches[2],
+ 'name__like' => $query,
+ 'number' => 10,
+ )
+ );
+ if ( empty( $terms ) || is_wp_error( $terms ) ) {
+ return;
+ }
+ foreach ( (array) $terms as $term ) {
+ if ( 'markup' == $response_format ) {
+ echo walk_nav_menu_tree( array_map( 'wp_setup_nav_menu_item', array( $term ) ), 0, (object) $args );
+ } elseif ( 'json' == $response_format ) {
+ echo wp_json_encode(
+ array(
+ 'ID' => $term->term_id,
+ 'post_title' => $term->name,
+ 'post_type' => $matches[2],
+ )
+ );
+ echo "\n";
+ }
+ }
+ }
+ }
+}
+
+/**
+ * Register nav menu meta boxes and advanced menu items.
+ *
+ * @since 3.0.0
+ */
+function wp_nav_menu_setup() {
+ // Register meta boxes
+ wp_nav_menu_post_type_meta_boxes();
+ add_meta_box( 'add-custom-links', __( 'Custom Links' ), 'wp_nav_menu_item_link_meta_box', 'nav-menus', 'side', 'default' );
+ wp_nav_menu_taxonomy_meta_boxes();
+
+ // Register advanced menu items (columns)
+ add_filter( 'manage_nav-menus_columns', 'wp_nav_menu_manage_columns' );
+
+ // If first time editing, disable advanced items by default.
+ if ( false === get_user_option( 'managenav-menuscolumnshidden' ) ) {
+ $user = wp_get_current_user();
+ update_user_option(
+ $user->ID,
+ 'managenav-menuscolumnshidden',
+ array(
+ 0 => 'link-target',
+ 1 => 'css-classes',
+ 2 => 'xfn',
+ 3 => 'description',
+ 4 => 'title-attribute',
+ ),
+ true
+ );
+ }
+}
+
+/**
+ * Limit the amount of meta boxes to pages, posts, links, and categories for first time users.
+ *
+ * @since 3.0.0
+ *
+ * @global array $wp_meta_boxes
+ */
+function wp_initial_nav_menu_meta_boxes() {
+ global $wp_meta_boxes;
+
+ if ( get_user_option( 'metaboxhidden_nav-menus' ) !== false || ! is_array( $wp_meta_boxes ) ) {
+ return;
+ }
+
+ $initial_meta_boxes = array( 'add-post-type-page', 'add-post-type-post', 'add-custom-links', 'add-category' );
+ $hidden_meta_boxes = array();
+
+ foreach ( array_keys( $wp_meta_boxes['nav-menus'] ) as $context ) {
+ foreach ( array_keys( $wp_meta_boxes['nav-menus'][ $context ] ) as $priority ) {
+ foreach ( $wp_meta_boxes['nav-menus'][ $context ][ $priority ] as $box ) {
+ if ( in_array( $box['id'], $initial_meta_boxes ) ) {
+ unset( $box['id'] );
+ } else {
+ $hidden_meta_boxes[] = $box['id'];
+ }
+ }
+ }
+ }
+
+ $user = wp_get_current_user();
+ update_user_option( $user->ID, 'metaboxhidden_nav-menus', $hidden_meta_boxes, true );
+}
+
+/**
+ * Creates meta boxes for any post type menu item..
+ *
+ * @since 3.0.0
+ */
+function wp_nav_menu_post_type_meta_boxes() {
+ $post_types = get_post_types( array( 'show_in_nav_menus' => true ), 'object' );
+
+ if ( ! $post_types ) {
+ return;
+ }
+
+ foreach ( $post_types as $post_type ) {
+ /**
+ * Filters whether a menu items meta box will be added for the current
+ * object type.
+ *
+ * If a falsey value is returned instead of an object, the menu items
+ * meta box for the current meta box object will not be added.
+ *
+ * @since 3.0.0
+ *
+ * @param object $meta_box_object The current object to add a menu items
+ * meta box for.
+ */
+ $post_type = apply_filters( 'nav_menu_meta_box_object', $post_type );
+ if ( $post_type ) {
+ $id = $post_type->name;
+ // Give pages a higher priority.
+ $priority = ( 'page' == $post_type->name ? 'core' : 'default' );
+ add_meta_box( "add-post-type-{$id}", $post_type->labels->name, 'wp_nav_menu_item_post_type_meta_box', 'nav-menus', 'side', $priority, $post_type );
+ }
+ }
+}
+
+/**
+ * Creates meta boxes for any taxonomy menu item.
+ *
+ * @since 3.0.0
+ */
+function wp_nav_menu_taxonomy_meta_boxes() {
+ $taxonomies = get_taxonomies( array( 'show_in_nav_menus' => true ), 'object' );
+
+ if ( ! $taxonomies ) {
+ return;
+ }
+
+ foreach ( $taxonomies as $tax ) {
+ /** This filter is documented in wp-admin/includes/nav-menu.php */
+ $tax = apply_filters( 'nav_menu_meta_box_object', $tax );
+ if ( $tax ) {
+ $id = $tax->name;
+ add_meta_box( "add-{$id}", $tax->labels->name, 'wp_nav_menu_item_taxonomy_meta_box', 'nav-menus', 'side', 'default', $tax );
+ }
+ }
+}
+
+/**
+ * Check whether to disable the Menu Locations meta box submit button
+ *
+ * @since 3.6.0
+ *
+ * @global bool $one_theme_location_no_menus to determine if no menus exist
+ *
+ * @param int|string $nav_menu_selected_id (id, name or slug) of the currently-selected menu
+ * @return string Disabled attribute if at least one menu exists, false if not
+ */
+function wp_nav_menu_disabled_check( $nav_menu_selected_id ) {
+ global $one_theme_location_no_menus;
+
+ if ( $one_theme_location_no_menus ) {
+ return false;
+ }
+
+ return disabled( $nav_menu_selected_id, 0 );
+}
+
+/**
+ * Displays a meta box for the custom links menu item.
+ *
+ * @since 3.0.0
+ *
+ * @global int $_nav_menu_placeholder
+ * @global int|string $nav_menu_selected_id
+ */
+function wp_nav_menu_item_link_meta_box() {
+ global $_nav_menu_placeholder, $nav_menu_selected_id;
+
+ $_nav_menu_placeholder = 0 > $_nav_menu_placeholder ? $_nav_menu_placeholder - 1 : -1;
+
+ ?>
+ <div class="customlinkdiv" id="customlinkdiv">
+ <input type="hidden" value="custom" name="menu-item[<?php echo $_nav_menu_placeholder; ?>][menu-item-type]" />
+ <p id="menu-item-url-wrap" class="wp-clearfix">
+ <label class="howto" for="custom-menu-item-url"><?php _e( 'URL' ); ?></label>
+ <input id="custom-menu-item-url" name="menu-item[<?php echo $_nav_menu_placeholder; ?>][menu-item-url]" type="text" class="code menu-item-textbox" value="http://" />
+ </p>
+
+ <p id="menu-item-name-wrap" class="wp-clearfix">
+ <label class="howto" for="custom-menu-item-name"><?php _e( 'Link Text' ); ?></label>
+ <input id="custom-menu-item-name" name="menu-item[<?php echo $_nav_menu_placeholder; ?>][menu-item-title]" type="text" class="regular-text menu-item-textbox" />
+ </p>
+
+ <p class="button-controls wp-clearfix">
+ <span class="add-to-menu">
+ <input type="submit"<?php wp_nav_menu_disabled_check( $nav_menu_selected_id ); ?> class="button submit-add-to-menu right" value="<?php esc_attr_e( 'Add to Menu' ); ?>" name="add-custom-menu-item" id="submit-customlinkdiv" />
+ <span class="spinner"></span>
+ </span>
+ </p>
+
+ </div><!-- /.customlinkdiv -->
+ <?php
+}
+
+/**
+ * Displays a meta box for a post type menu item.
+ *
+ * @since 3.0.0
+ *
+ * @global int $_nav_menu_placeholder
+ * @global int|string $nav_menu_selected_id
+ *
+ * @param string $object Not used.
+ * @param array $box {
+ * Post type menu item meta box arguments.
+ *
+ * @type string $id Meta box 'id' attribute.
+ * @type string $title Meta box title.
+ * @type string $callback Meta box display callback.
+ * @type WP_Post_Type $args Extra meta box arguments (the post type object for this meta box).
+ * }
+ */
+function wp_nav_menu_item_post_type_meta_box( $object, $box ) {
+ global $_nav_menu_placeholder, $nav_menu_selected_id;
+
+ $post_type_name = $box['args']->name;
+
+ // Paginate browsing for large numbers of post objects.
+ $per_page = 50;
+ $pagenum = isset( $_REQUEST[ $post_type_name . '-tab' ] ) && isset( $_REQUEST['paged'] ) ? absint( $_REQUEST['paged'] ) : 1;
+ $offset = 0 < $pagenum ? $per_page * ( $pagenum - 1 ) : 0;
+
+ $args = array(
+ 'offset' => $offset,
+ 'order' => 'ASC',
+ 'orderby' => 'title',
+ 'posts_per_page' => $per_page,
+ 'post_type' => $post_type_name,
+ 'suppress_filters' => true,
+ 'update_post_term_cache' => false,
+ 'update_post_meta_cache' => false,
+ );
+
+ if ( isset( $box['args']->_default_query ) ) {
+ $args = array_merge( $args, (array) $box['args']->_default_query );
+ }
+
+ // @todo transient caching of these results with proper invalidation on updating of a post of this type
+ $get_posts = new WP_Query;
+ $posts = $get_posts->query( $args );
+ if ( ! $get_posts->post_count ) {
+ echo '<p>' . __( 'No items.' ) . '</p>';
+ return;
+ }
+
+ $num_pages = $get_posts->max_num_pages;
+
+ $page_links = paginate_links(
+ array(
+ 'base' => add_query_arg(
+ array(
+ $post_type_name . '-tab' => 'all',
+ 'paged' => '%#%',
+ 'item-type' => 'post_type',
+ 'item-object' => $post_type_name,
+ )
+ ),
+ 'format' => '',
+ 'prev_text' => '<span aria-label="' . esc_attr__( 'Previous page' ) . '">' . __( '&laquo;' ) . '</span>',
+ 'next_text' => '<span aria-label="' . esc_attr__( 'Next page' ) . '">' . __( '&raquo;' ) . '</span>',
+ 'before_page_number' => '<span class="screen-reader-text">' . __( 'Page' ) . '</span> ',
+ 'total' => $num_pages,
+ 'current' => $pagenum,
+ )
+ );
+
+ $db_fields = false;
+ if ( is_post_type_hierarchical( $post_type_name ) ) {
+ $db_fields = array(
+ 'parent' => 'post_parent',
+ 'id' => 'ID',
+ );
+ }
+
+ $walker = new Walker_Nav_Menu_Checklist( $db_fields );
+
+ $current_tab = 'most-recent';
+ if ( isset( $_REQUEST[ $post_type_name . '-tab' ] ) && in_array( $_REQUEST[ $post_type_name . '-tab' ], array( 'all', 'search' ) ) ) {
+ $current_tab = $_REQUEST[ $post_type_name . '-tab' ];
+ }
+
+ if ( ! empty( $_REQUEST[ 'quick-search-posttype-' . $post_type_name ] ) ) {
+ $current_tab = 'search';
+ }
+
+ $removed_args = array(
+ 'action',
+ 'customlink-tab',
+ 'edit-menu-item',
+ 'menu-item',
+ 'page-tab',
+ '_wpnonce',
+ );
+
+ $most_recent_url = $view_all_url = $search_url = '';
+ if ( $nav_menu_selected_id ) {
+ $most_recent_url = esc_url( add_query_arg( $post_type_name . '-tab', 'most-recent', remove_query_arg( $removed_args ) ) );
+ $view_all_url = esc_url( add_query_arg( $post_type_name . '-tab', 'all', remove_query_arg( $removed_args ) ) );
+ $search_url = esc_url( add_query_arg( $post_type_name . '-tab', 'search', remove_query_arg( $removed_args ) ) );
+ }
+ ?>
+ <div id="posttype-<?php echo $post_type_name; ?>" class="posttypediv">
+ <ul id="posttype-<?php echo $post_type_name; ?>-tabs" class="posttype-tabs add-menu-item-tabs">
+ <li <?php echo ( 'most-recent' == $current_tab ? ' class="tabs"' : '' ); ?>>
+ <a class="nav-tab-link" data-type="tabs-panel-posttype-<?php echo esc_attr( $post_type_name ); ?>-most-recent" href="<?php echo $most_recent_url; ?>#tabs-panel-posttype-<?php echo $post_type_name; ?>-most-recent">
+ <?php _e( 'Most Recent' ); ?>
+ </a>
+ </li>
+ <li <?php echo ( 'all' == $current_tab ? ' class="tabs"' : '' ); ?>>
+ <a class="nav-tab-link" data-type="<?php echo esc_attr( $post_type_name ); ?>-all" href="<?php echo $view_all_url; ?>#<?php echo $post_type_name; ?>-all">
+ <?php _e( 'View All' ); ?>
+ </a>
+ </li>
+ <li <?php echo ( 'search' == $current_tab ? ' class="tabs"' : '' ); ?>>
+ <a class="nav-tab-link" data-type="tabs-panel-posttype-<?php echo esc_attr( $post_type_name ); ?>-search" href="<?php echo $search_url; ?>#tabs-panel-posttype-<?php echo $post_type_name; ?>-search">
+ <?php _e( 'Search' ); ?>
+ </a>
+ </li>
+ </ul><!-- .posttype-tabs -->
+
+ <div id="tabs-panel-posttype-<?php echo $post_type_name; ?>-most-recent" class="tabs-panel <?php echo ( 'most-recent' == $current_tab ? 'tabs-panel-active' : 'tabs-panel-inactive' ); ?>">
+ <ul id="<?php echo $post_type_name; ?>checklist-most-recent" class="categorychecklist form-no-clear">
+ <?php
+ $recent_args = array_merge(
+ $args,
+ array(
+ 'orderby' => 'post_date',
+ 'order' => 'DESC',
+ 'posts_per_page' => 15,
+ )
+ );
+ $most_recent = $get_posts->query( $recent_args );
+ $args['walker'] = $walker;
+
+ /**
+ * Filters the posts displayed in the 'Most Recent' tab of the current
+ * post type's menu items meta box.
+ *
+ * The dynamic portion of the hook name, `$post_type_name`, refers to the post type name.
+ *
+ * @since 4.3.0
+ * @since 4.9.0 Added the `$recent_args` parameter.
+ *
+ * @param WP_Post[] $most_recent An array of post objects being listed.
+ * @param array $args An array of `WP_Query` arguments for the meta box.
+ * @param array $box Arguments passed to `wp_nav_menu_item_post_type_meta_box()`.
+ * @param array $recent_args An array of `WP_Query` arguments for 'Most Recent' tab.
+ */
+ $most_recent = apply_filters( "nav_menu_items_{$post_type_name}_recent", $most_recent, $args, $box, $recent_args );
+
+ echo walk_nav_menu_tree( array_map( 'wp_setup_nav_menu_item', $most_recent ), 0, (object) $args );
+ ?>
+ </ul>
+ </div><!-- /.tabs-panel -->
+
+ <div class="tabs-panel <?php echo ( 'search' == $current_tab ? 'tabs-panel-active' : 'tabs-panel-inactive' ); ?>" id="tabs-panel-posttype-<?php echo $post_type_name; ?>-search">
+ <?php
+ if ( isset( $_REQUEST[ 'quick-search-posttype-' . $post_type_name ] ) ) {
+ $searched = esc_attr( $_REQUEST[ 'quick-search-posttype-' . $post_type_name ] );
+ $search_results = get_posts(
+ array(
+ 's' => $searched,
+ 'post_type' => $post_type_name,
+ 'fields' => 'all',
+ 'order' => 'DESC',
+ )
+ );
+ } else {
+ $searched = '';
+ $search_results = array();
+ }
+ ?>
+ <p class="quick-search-wrap">
+ <label for="quick-search-posttype-<?php echo $post_type_name; ?>" class="screen-reader-text"><?php _e( 'Search' ); ?></label>
+ <input type="search" class="quick-search" value="<?php echo $searched; ?>" name="quick-search-posttype-<?php echo $post_type_name; ?>" id="quick-search-posttype-<?php echo $post_type_name; ?>" />
+ <span class="spinner"></span>
+ <?php submit_button( __( 'Search' ), 'small quick-search-submit hide-if-js', 'submit', false, array( 'id' => 'submit-quick-search-posttype-' . $post_type_name ) ); ?>
+ </p>
+
+ <ul id="<?php echo $post_type_name; ?>-search-checklist" data-wp-lists="list:<?php echo $post_type_name; ?>" class="categorychecklist form-no-clear">
+ <?php if ( ! empty( $search_results ) && ! is_wp_error( $search_results ) ) : ?>
+ <?php
+ $args['walker'] = $walker;
+ echo walk_nav_menu_tree( array_map( 'wp_setup_nav_menu_item', $search_results ), 0, (object) $args );
+ ?>
+ <?php elseif ( is_wp_error( $search_results ) ) : ?>
+ <li><?php echo $search_results->get_error_message(); ?></li>
+ <?php elseif ( ! empty( $searched ) ) : ?>
+ <li><?php _e( 'No results found.' ); ?></li>
+ <?php endif; ?>
+ </ul>
+ </div><!-- /.tabs-panel -->
+
+ <div id="<?php echo $post_type_name; ?>-all" class="tabs-panel tabs-panel-view-all <?php echo ( 'all' == $current_tab ? 'tabs-panel-active' : 'tabs-panel-inactive' ); ?>">
+ <?php if ( ! empty( $page_links ) ) : ?>
+ <div class="add-menu-item-pagelinks">
+ <?php echo $page_links; ?>
+ </div>
+ <?php endif; ?>
+ <ul id="<?php echo $post_type_name; ?>checklist" data-wp-lists="list:<?php echo $post_type_name; ?>" class="categorychecklist form-no-clear">
+ <?php
+ $args['walker'] = $walker;
+
+ /*
+ * If we're dealing with pages, let's put a checkbox for the front
+ * page at the top of the list.
+ */
+ if ( 'page' == $post_type_name ) {
+ $front_page = 'page' == get_option( 'show_on_front' ) ? (int) get_option( 'page_on_front' ) : 0;
+ if ( ! empty( $front_page ) ) {
+ $front_page_obj = get_post( $front_page );
+ $front_page_obj->front_or_home = true;
+ array_unshift( $posts, $front_page_obj );
+ } else {
+ $_nav_menu_placeholder = ( 0 > $_nav_menu_placeholder ) ? intval( $_nav_menu_placeholder ) - 1 : -1;
+ array_unshift(
+ $posts,
+ (object) array(
+ 'front_or_home' => true,
+ 'ID' => 0,
+ 'object_id' => $_nav_menu_placeholder,
+ 'post_content' => '',
+ 'post_excerpt' => '',
+ 'post_parent' => '',
+ 'post_title' => _x( 'Home', 'nav menu home label' ),
+ 'post_type' => 'nav_menu_item',
+ 'type' => 'custom',
+ 'url' => home_url( '/' ),
+ )
+ );
+ }
+ }
+
+ $post_type = get_post_type_object( $post_type_name );
+
+ if ( $post_type->has_archive ) {
+ $_nav_menu_placeholder = ( 0 > $_nav_menu_placeholder ) ? intval( $_nav_menu_placeholder ) - 1 : -1;
+ array_unshift(
+ $posts,
+ (object) array(
+ 'ID' => 0,
+ 'object_id' => $_nav_menu_placeholder,
+ 'object' => $post_type_name,
+ 'post_content' => '',
+ 'post_excerpt' => '',
+ 'post_title' => $post_type->labels->archives,
+ 'post_type' => 'nav_menu_item',
+ 'type' => 'post_type_archive',
+ 'url' => get_post_type_archive_link( $post_type_name ),
+ )
+ );
+ }
+
+ /**
+ * Filters the posts displayed in the 'View All' tab of the current
+ * post type's menu items meta box.
+ *
+ * The dynamic portion of the hook name, `$post_type_name`, refers
+ * to the slug of the current post type.
+ *
+ * @since 3.2.0
+ * @since 4.6.0 Converted the `$post_type` parameter to accept a WP_Post_Type object.
+ *
+ * @see WP_Query::query()
+ *
+ * @param object[] $posts The posts for the current post type. Mostly `WP_Post` objects, but
+ * can also contain "fake" post objects to represent other menu items.
+ * @param array $args An array of `WP_Query` arguments.
+ * @param WP_Post_Type $post_type The current post type object for this menu item meta box.
+ */
+ $posts = apply_filters( "nav_menu_items_{$post_type_name}", $posts, $args, $post_type );
+
+ $checkbox_items = walk_nav_menu_tree( array_map( 'wp_setup_nav_menu_item', $posts ), 0, (object) $args );
+
+ if ( 'all' == $current_tab && ! empty( $_REQUEST['selectall'] ) ) {
+ $checkbox_items = preg_replace( '/(type=(.)checkbox(\2))/', '$1 checked=$2checked$2', $checkbox_items );
+
+ }
+
+ echo $checkbox_items;
+ ?>
+ </ul>
+ <?php if ( ! empty( $page_links ) ) : ?>
+ <div class="add-menu-item-pagelinks">
+ <?php echo $page_links; ?>
+ </div>
+ <?php endif; ?>
+ </div><!-- /.tabs-panel -->
+
+ <p class="button-controls wp-clearfix">
+ <span class="list-controls">
+ <a href="
+ <?php
+ echo esc_url(
+ add_query_arg(
+ array(
+ $post_type_name . '-tab' => 'all',
+ 'selectall' => 1,
+ ),
+ remove_query_arg( $removed_args )
+ )
+ );
+ ?>
+ #posttype-<?php echo $post_type_name; ?>" class="select-all aria-button-if-js"><?php _e( 'Select All' ); ?></a>
+ </span>
+
+ <span class="add-to-menu">
+ <input type="submit"<?php wp_nav_menu_disabled_check( $nav_menu_selected_id ); ?> class="button submit-add-to-menu right" value="<?php esc_attr_e( 'Add to Menu' ); ?>" name="add-post-type-menu-item" id="<?php echo esc_attr( 'submit-posttype-' . $post_type_name ); ?>" />
+ <span class="spinner"></span>
+ </span>
+ </p>
+
+ </div><!-- /.posttypediv -->
+ <?php
+}
+
+/**
+ * Displays a meta box for a taxonomy menu item.
+ *
+ * @since 3.0.0
+ *
+ * @global int|string $nav_menu_selected_id
+ *
+ * @param string $object Not used.
+ * @param array $box {
+ * Taxonomy menu item meta box arguments.
+ *
+ * @type string $id Meta box 'id' attribute.
+ * @type string $title Meta box title.
+ * @type string $callback Meta box display callback.
+ * @type object $args Extra meta box arguments (the taxonomy object for this meta box).
+ * }
+ */
+function wp_nav_menu_item_taxonomy_meta_box( $object, $box ) {
+ global $nav_menu_selected_id;
+ $taxonomy_name = $box['args']->name;
+ $taxonomy = get_taxonomy( $taxonomy_name );
+
+ // Paginate browsing for large numbers of objects.
+ $per_page = 50;
+ $pagenum = isset( $_REQUEST[ $taxonomy_name . '-tab' ] ) && isset( $_REQUEST['paged'] ) ? absint( $_REQUEST['paged'] ) : 1;
+ $offset = 0 < $pagenum ? $per_page * ( $pagenum - 1 ) : 0;
+
+ $args = array(
+ 'child_of' => 0,
+ 'exclude' => '',
+ 'hide_empty' => false,
+ 'hierarchical' => 1,
+ 'include' => '',
+ 'number' => $per_page,
+ 'offset' => $offset,
+ 'order' => 'ASC',
+ 'orderby' => 'name',
+ 'pad_counts' => false,
+ );
+
+ $terms = get_terms( $taxonomy_name, $args );
+
+ if ( ! $terms || is_wp_error( $terms ) ) {
+ echo '<p>' . __( 'No items.' ) . '</p>';
+ return;
+ }
+
+ $num_pages = ceil(
+ wp_count_terms(
+ $taxonomy_name,
+ array_merge(
+ $args,
+ array(
+ 'number' => '',
+ 'offset' => '',
+ )
+ )
+ ) / $per_page
+ );
+
+ $page_links = paginate_links(
+ array(
+ 'base' => add_query_arg(
+ array(
+ $taxonomy_name . '-tab' => 'all',
+ 'paged' => '%#%',
+ 'item-type' => 'taxonomy',
+ 'item-object' => $taxonomy_name,
+ )
+ ),
+ 'format' => '',
+ 'prev_text' => '<span aria-label="' . esc_attr__( 'Previous page' ) . '">' . __( '&laquo;' ) . '</span>',
+ 'next_text' => '<span aria-label="' . esc_attr__( 'Next page' ) . '">' . __( '&raquo;' ) . '</span>',
+ 'before_page_number' => '<span class="screen-reader-text">' . __( 'Page' ) . '</span> ',
+ 'total' => $num_pages,
+ 'current' => $pagenum,
+ )
+ );
+
+ $db_fields = false;
+ if ( is_taxonomy_hierarchical( $taxonomy_name ) ) {
+ $db_fields = array(
+ 'parent' => 'parent',
+ 'id' => 'term_id',
+ );
+ }
+
+ $walker = new Walker_Nav_Menu_Checklist( $db_fields );
+
+ $current_tab = 'most-used';
+ if ( isset( $_REQUEST[ $taxonomy_name . '-tab' ] ) && in_array( $_REQUEST[ $taxonomy_name . '-tab' ], array( 'all', 'most-used', 'search' ) ) ) {
+ $current_tab = $_REQUEST[ $taxonomy_name . '-tab' ];
+ }
+
+ if ( ! empty( $_REQUEST[ 'quick-search-taxonomy-' . $taxonomy_name ] ) ) {
+ $current_tab = 'search';
+ }
+
+ $removed_args = array(
+ 'action',
+ 'customlink-tab',
+ 'edit-menu-item',
+ 'menu-item',
+ 'page-tab',
+ '_wpnonce',
+ );
+
+ $most_used_url = $view_all_url = $search_url = '';
+ if ( $nav_menu_selected_id ) {
+ $most_used_url = esc_url( add_query_arg( $taxonomy_name . '-tab', 'most-used', remove_query_arg( $removed_args ) ) );
+ $view_all_url = esc_url( add_query_arg( $taxonomy_name . '-tab', 'all', remove_query_arg( $removed_args ) ) );
+ $search_url = esc_url( add_query_arg( $taxonomy_name . '-tab', 'search', remove_query_arg( $removed_args ) ) );
+ }
+ ?>
+ <div id="taxonomy-<?php echo $taxonomy_name; ?>" class="taxonomydiv">
+ <ul id="taxonomy-<?php echo $taxonomy_name; ?>-tabs" class="taxonomy-tabs add-menu-item-tabs">
+ <li <?php echo ( 'most-used' == $current_tab ? ' class="tabs"' : '' ); ?>>
+ <a class="nav-tab-link" data-type="tabs-panel-<?php echo esc_attr( $taxonomy_name ); ?>-pop" href="<?php echo $most_used_url; ?>#tabs-panel-<?php echo $taxonomy_name; ?>-pop">
+ <?php echo esc_html( $taxonomy->labels->most_used ); ?>
+ </a>
+ </li>
+ <li <?php echo ( 'all' == $current_tab ? ' class="tabs"' : '' ); ?>>
+ <a class="nav-tab-link" data-type="tabs-panel-<?php echo esc_attr( $taxonomy_name ); ?>-all" href="<?php echo $view_all_url; ?>#tabs-panel-<?php echo $taxonomy_name; ?>-all">
+ <?php _e( 'View All' ); ?>
+ </a>
+ </li>
+ <li <?php echo ( 'search' == $current_tab ? ' class="tabs"' : '' ); ?>>
+ <a class="nav-tab-link" data-type="tabs-panel-search-taxonomy-<?php echo esc_attr( $taxonomy_name ); ?>" href="<?php echo $search_url; ?>#tabs-panel-search-taxonomy-<?php echo $taxonomy_name; ?>">
+ <?php _e( 'Search' ); ?>
+ </a>
+ </li>
+ </ul><!-- .taxonomy-tabs -->
+
+ <div id="tabs-panel-<?php echo $taxonomy_name; ?>-pop" class="tabs-panel <?php echo ( 'most-used' == $current_tab ? 'tabs-panel-active' : 'tabs-panel-inactive' ); ?> ">
+ <ul id="<?php echo $taxonomy_name; ?>checklist-pop" class="categorychecklist form-no-clear" >
+ <?php
+ $popular_terms = get_terms(
+ $taxonomy_name,
+ array(
+ 'orderby' => 'count',
+ 'order' => 'DESC',
+ 'number' => 10,
+ 'hierarchical' => false,
+ )
+ );
+ $args['walker'] = $walker;
+ echo walk_nav_menu_tree( array_map( 'wp_setup_nav_menu_item', $popular_terms ), 0, (object) $args );
+ ?>
+ </ul>
+ </div><!-- /.tabs-panel -->
+
+ <div id="tabs-panel-<?php echo $taxonomy_name; ?>-all" class="tabs-panel tabs-panel-view-all <?php echo ( 'all' == $current_tab ? 'tabs-panel-active' : 'tabs-panel-inactive' ); ?> ">
+ <?php if ( ! empty( $page_links ) ) : ?>
+ <div class="add-menu-item-pagelinks">
+ <?php echo $page_links; ?>
+ </div>
+ <?php endif; ?>
+ <ul id="<?php echo $taxonomy_name; ?>checklist" data-wp-lists="list:<?php echo $taxonomy_name; ?>" class="categorychecklist form-no-clear">
+ <?php
+ $args['walker'] = $walker;
+ echo walk_nav_menu_tree( array_map( 'wp_setup_nav_menu_item', $terms ), 0, (object) $args );
+ ?>
+ </ul>
+ <?php if ( ! empty( $page_links ) ) : ?>
+ <div class="add-menu-item-pagelinks">
+ <?php echo $page_links; ?>
+ </div>
+ <?php endif; ?>
+ </div><!-- /.tabs-panel -->
+
+ <div class="tabs-panel <?php echo ( 'search' == $current_tab ? 'tabs-panel-active' : 'tabs-panel-inactive' ); ?>" id="tabs-panel-search-taxonomy-<?php echo $taxonomy_name; ?>">
+ <?php
+ if ( isset( $_REQUEST[ 'quick-search-taxonomy-' . $taxonomy_name ] ) ) {
+ $searched = esc_attr( $_REQUEST[ 'quick-search-taxonomy-' . $taxonomy_name ] );
+ $search_results = get_terms(
+ $taxonomy_name,
+ array(
+ 'name__like' => $searched,
+ 'fields' => 'all',
+ 'orderby' => 'count',
+ 'order' => 'DESC',
+ 'hierarchical' => false,
+ )
+ );
+ } else {
+ $searched = '';
+ $search_results = array();
+ }
+ ?>
+ <p class="quick-search-wrap">
+ <label for="quick-search-taxonomy-<?php echo $taxonomy_name; ?>" class="screen-reader-text"><?php _e( 'Search' ); ?></label>
+ <input type="search" class="quick-search" value="<?php echo $searched; ?>" name="quick-search-taxonomy-<?php echo $taxonomy_name; ?>" id="quick-search-taxonomy-<?php echo $taxonomy_name; ?>" />
+ <span class="spinner"></span>
+ <?php submit_button( __( 'Search' ), 'small quick-search-submit hide-if-js', 'submit', false, array( 'id' => 'submit-quick-search-taxonomy-' . $taxonomy_name ) ); ?>
+ </p>
+
+ <ul id="<?php echo $taxonomy_name; ?>-search-checklist" data-wp-lists="list:<?php echo $taxonomy_name; ?>" class="categorychecklist form-no-clear">
+ <?php if ( ! empty( $search_results ) && ! is_wp_error( $search_results ) ) : ?>
+ <?php
+ $args['walker'] = $walker;
+ echo walk_nav_menu_tree( array_map( 'wp_setup_nav_menu_item', $search_results ), 0, (object) $args );
+ ?>
+ <?php elseif ( is_wp_error( $search_results ) ) : ?>
+ <li><?php echo $search_results->get_error_message(); ?></li>
+ <?php elseif ( ! empty( $searched ) ) : ?>
+ <li><?php _e( 'No results found.' ); ?></li>
+ <?php endif; ?>
+ </ul>
+ </div><!-- /.tabs-panel -->
+
+ <p class="button-controls wp-clearfix">
+ <span class="list-controls">
+ <a href="
+ <?php
+ echo esc_url(
+ add_query_arg(
+ array(
+ $taxonomy_name . '-tab' => 'all',
+ 'selectall' => 1,
+ ),
+ remove_query_arg( $removed_args )
+ )
+ );
+ ?>
+ #taxonomy-<?php echo $taxonomy_name; ?>" class="select-all aria-button-if-js"><?php _e( 'Select All' ); ?></a>
+ </span>
+
+ <span class="add-to-menu">
+ <input type="submit"<?php wp_nav_menu_disabled_check( $nav_menu_selected_id ); ?> class="button submit-add-to-menu right" value="<?php esc_attr_e( 'Add to Menu' ); ?>" name="add-taxonomy-menu-item" id="<?php echo esc_attr( 'submit-taxonomy-' . $taxonomy_name ); ?>" />
+ <span class="spinner"></span>
+ </span>
+ </p>
+
+ </div><!-- /.taxonomydiv -->
+ <?php
+}
+
+/**
+ * Save posted nav menu item data.
+ *
+ * @since 3.0.0
+ *
+ * @param int $menu_id The menu ID for which to save this item. Value of 0 makes a draft, orphaned menu item. Default 0.
+ * @param array[] $menu_data The unsanitized POSTed menu item data.
+ * @return int[] The database IDs of the items saved
+ */
+function wp_save_nav_menu_items( $menu_id = 0, $menu_data = array() ) {
+ $menu_id = (int) $menu_id;
+ $items_saved = array();
+
+ if ( 0 == $menu_id || is_nav_menu( $menu_id ) ) {
+
+ // Loop through all the menu items' POST values.
+ foreach ( (array) $menu_data as $_possible_db_id => $_item_object_data ) {
+ if (
+ // Checkbox is not checked.
+ empty( $_item_object_data['menu-item-object-id'] ) &&
+ (
+ // And item type either isn't set.
+ ! isset( $_item_object_data['menu-item-type'] ) ||
+ // Or URL is the default.
+ in_array( $_item_object_data['menu-item-url'], array( 'http://', '' ) ) ||
+ ! ( 'custom' == $_item_object_data['menu-item-type'] && ! isset( $_item_object_data['menu-item-db-id'] ) ) || // or it's not a custom menu item (but not the custom home page)
+ // Or it *is* a custom menu item that already exists.
+ ! empty( $_item_object_data['menu-item-db-id'] )
+ )
+ ) {
+ // Then this potential menu item is not getting added to this menu.
+ continue;
+ }
+
+ // If this possible menu item doesn't actually have a menu database ID yet.
+ if (
+ empty( $_item_object_data['menu-item-db-id'] ) ||
+ ( 0 > $_possible_db_id ) ||
+ $_possible_db_id != $_item_object_data['menu-item-db-id']
+ ) {
+ $_actual_db_id = 0;
+ } else {
+ $_actual_db_id = (int) $_item_object_data['menu-item-db-id'];
+ }
+
+ $args = array(
+ 'menu-item-db-id' => ( isset( $_item_object_data['menu-item-db-id'] ) ? $_item_object_data['menu-item-db-id'] : '' ),
+ 'menu-item-object-id' => ( isset( $_item_object_data['menu-item-object-id'] ) ? $_item_object_data['menu-item-object-id'] : '' ),
+ 'menu-item-object' => ( isset( $_item_object_data['menu-item-object'] ) ? $_item_object_data['menu-item-object'] : '' ),
+ 'menu-item-parent-id' => ( isset( $_item_object_data['menu-item-parent-id'] ) ? $_item_object_data['menu-item-parent-id'] : '' ),
+ 'menu-item-position' => ( isset( $_item_object_data['menu-item-position'] ) ? $_item_object_data['menu-item-position'] : '' ),
+ 'menu-item-type' => ( isset( $_item_object_data['menu-item-type'] ) ? $_item_object_data['menu-item-type'] : '' ),
+ 'menu-item-title' => ( isset( $_item_object_data['menu-item-title'] ) ? $_item_object_data['menu-item-title'] : '' ),
+ 'menu-item-url' => ( isset( $_item_object_data['menu-item-url'] ) ? $_item_object_data['menu-item-url'] : '' ),
+ 'menu-item-description' => ( isset( $_item_object_data['menu-item-description'] ) ? $_item_object_data['menu-item-description'] : '' ),
+ 'menu-item-attr-title' => ( isset( $_item_object_data['menu-item-attr-title'] ) ? $_item_object_data['menu-item-attr-title'] : '' ),
+ 'menu-item-target' => ( isset( $_item_object_data['menu-item-target'] ) ? $_item_object_data['menu-item-target'] : '' ),
+ 'menu-item-classes' => ( isset( $_item_object_data['menu-item-classes'] ) ? $_item_object_data['menu-item-classes'] : '' ),
+ 'menu-item-xfn' => ( isset( $_item_object_data['menu-item-xfn'] ) ? $_item_object_data['menu-item-xfn'] : '' ),
+ );
+
+ $items_saved[] = wp_update_nav_menu_item( $menu_id, $_actual_db_id, $args );
+
+ }
+ }
+ return $items_saved;
+}
+
+/**
+ * Adds custom arguments to some of the meta box object types.
+ *
+ * @since 3.0.0
+ *
+ * @access private
+ *
+ * @param object $object The post type or taxonomy meta-object.
+ * @return object The post type of taxonomy object.
+ */
+function _wp_nav_menu_meta_box_object( $object = null ) {
+ if ( isset( $object->name ) ) {
+
+ if ( 'page' == $object->name ) {
+ $object->_default_query = array(
+ 'orderby' => 'menu_order title',
+ 'post_status' => 'publish',
+ );
+
+ // Posts should show only published items.
+ } elseif ( 'post' == $object->name ) {
+ $object->_default_query = array(
+ 'post_status' => 'publish',
+ );
+
+ // Categories should be in reverse chronological order.
+ } elseif ( 'category' == $object->name ) {
+ $object->_default_query = array(
+ 'orderby' => 'id',
+ 'order' => 'DESC',
+ );
+
+ // Custom post types should show only published items.
+ } else {
+ $object->_default_query = array(
+ 'post_status' => 'publish',
+ );
+ }
+ }
+
+ return $object;
+}
+
+/**
+ * Returns the menu formatted to edit.
+ *
+ * @since 3.0.0
+ *
+ * @param int $menu_id Optional. The ID of the menu to format. Default 0.
+ * @return string|WP_Error $output The menu formatted to edit or error object on failure.
+ */
+function wp_get_nav_menu_to_edit( $menu_id = 0 ) {
+ $menu = wp_get_nav_menu_object( $menu_id );
+
+ // If the menu exists, get its items.
+ if ( is_nav_menu( $menu ) ) {
+ $menu_items = wp_get_nav_menu_items( $menu->term_id, array( 'post_status' => 'any' ) );
+ $result = '<div id="menu-instructions" class="post-body-plain';
+ $result .= ( ! empty( $menu_items ) ) ? ' menu-instructions-inactive">' : '">';
+ $result .= '<p>' . __( 'Add menu items from the column on the left.' ) . '</p>';
+ $result .= '</div>';
+
+ if ( empty( $menu_items ) ) {
+ return $result . ' <ul class="menu" id="menu-to-edit"> </ul>';
+ }
+
+ /**
+ * Filters the Walker class used when adding nav menu items.
+ *
+ * @since 3.0.0
+ *
+ * @param string $class The walker class to use. Default 'Walker_Nav_Menu_Edit'.
+ * @param int $menu_id ID of the menu being rendered.
+ */
+ $walker_class_name = apply_filters( 'wp_edit_nav_menu_walker', 'Walker_Nav_Menu_Edit', $menu_id );
+
+ if ( class_exists( $walker_class_name ) ) {
+ $walker = new $walker_class_name;
+ } else {
+ return new WP_Error(
+ 'menu_walker_not_exist',
+ /* translators: %s: walker class name */
+ sprintf(
+ __( 'The Walker class named %s does not exist.' ),
+ '<strong>' . $walker_class_name . '</strong>'
+ )
+ );
+ }
+
+ $some_pending_menu_items = $some_invalid_menu_items = false;
+ foreach ( (array) $menu_items as $menu_item ) {
+ if ( isset( $menu_item->post_status ) && 'draft' == $menu_item->post_status ) {
+ $some_pending_menu_items = true;
+ }
+ if ( ! empty( $menu_item->_invalid ) ) {
+ $some_invalid_menu_items = true;
+ }
+ }
+
+ if ( $some_pending_menu_items ) {
+ $result .= '<div class="notice notice-info notice-alt inline"><p>' . __( 'Click Save Menu to make pending menu items public.' ) . '</p></div>';
+ }
+
+ if ( $some_invalid_menu_items ) {
+ $result .= '<div class="notice notice-error notice-alt inline"><p>' . __( 'There are some invalid menu items. Please check or delete them.' ) . '</p></div>';
+ }
+
+ $result .= '<ul class="menu" id="menu-to-edit"> ';
+ $result .= walk_nav_menu_tree( array_map( 'wp_setup_nav_menu_item', $menu_items ), 0, (object) array( 'walker' => $walker ) );
+ $result .= ' </ul> ';
+ return $result;
+ } elseif ( is_wp_error( $menu ) ) {
+ return $menu;
+ }
+
+}
+
+/**
+ * Returns the columns for the nav menus page.
+ *
+ * @since 3.0.0
+ *
+ * @return array Columns.
+ */
+function wp_nav_menu_manage_columns() {
+ return array(
+ '_title' => __( 'Show advanced menu properties' ),
+ 'cb' => '<input type="checkbox" />',
+ 'link-target' => __( 'Link Target' ),
+ 'title-attribute' => __( 'Title Attribute' ),
+ 'css-classes' => __( 'CSS Classes' ),
+ 'xfn' => __( 'Link Relationship (XFN)' ),
+ 'description' => __( 'Description' ),
+ );
+}
+
+/**
+ * Deletes orphaned draft menu items
+ *
+ * @access private
+ * @since 3.0.0
+ *
+ * @global wpdb $wpdb WordPress database abstraction object.
+ */
+function _wp_delete_orphaned_draft_menu_items() {
+ global $wpdb;
+ $delete_timestamp = time() - ( DAY_IN_SECONDS * EMPTY_TRASH_DAYS );
+
+ // Delete orphaned draft menu items.
+ $menu_items_to_delete = $wpdb->get_col( $wpdb->prepare( "SELECT ID FROM $wpdb->posts AS p LEFT JOIN $wpdb->postmeta AS m ON p.ID = m.post_id WHERE post_type = 'nav_menu_item' AND post_status = 'draft' AND meta_key = '_menu_item_orphaned' AND meta_value < %d", $delete_timestamp ) );
+
+ foreach ( (array) $menu_items_to_delete as $menu_item_id ) {
+ wp_delete_post( $menu_item_id, true );
+ }
+}
+
+/**
+ * Saves nav menu items
+ *
+ * @since 3.6.0
+ *
+ * @param int|string $nav_menu_selected_id (id, slug, or name ) of the currently-selected menu
+ * @param string $nav_menu_selected_title Title of the currently-selected menu
+ * @return array $messages The menu updated message
+ */
+function wp_nav_menu_update_menu_items( $nav_menu_selected_id, $nav_menu_selected_title ) {
+ $unsorted_menu_items = wp_get_nav_menu_items(
+ $nav_menu_selected_id,
+ array(
+ 'orderby' => 'ID',
+ 'output' => ARRAY_A,
+ 'output_key' => 'ID',
+ 'post_status' => 'draft,publish',
+ )
+ );
+ $messages = array();
+ $menu_items = array();
+ // Index menu items by db ID
+ foreach ( $unsorted_menu_items as $_item ) {
+ $menu_items[ $_item->db_id ] = $_item;
+ }
+
+ $post_fields = array(
+ 'menu-item-db-id',
+ 'menu-item-object-id',
+ 'menu-item-object',
+ 'menu-item-parent-id',
+ 'menu-item-position',
+ 'menu-item-type',
+ 'menu-item-title',
+ 'menu-item-url',
+ 'menu-item-description',
+ 'menu-item-attr-title',
+ 'menu-item-target',
+ 'menu-item-classes',
+ 'menu-item-xfn',
+ );
+
+ wp_defer_term_counting( true );
+ // Loop through all the menu items' POST variables
+ if ( ! empty( $_POST['menu-item-db-id'] ) ) {
+ foreach ( (array) $_POST['menu-item-db-id'] as $_key => $k ) {
+
+ // Menu item title can't be blank
+ if ( ! isset( $_POST['menu-item-title'][ $_key ] ) || '' == $_POST['menu-item-title'][ $_key ] ) {
+ continue;
+ }
+
+ $args = array();
+ foreach ( $post_fields as $field ) {
+ $args[ $field ] = isset( $_POST[ $field ][ $_key ] ) ? $_POST[ $field ][ $_key ] : '';
+ }
+
+ $menu_item_db_id = wp_update_nav_menu_item( $nav_menu_selected_id, ( $_POST['menu-item-db-id'][ $_key ] != $_key ? 0 : $_key ), $args );
+
+ if ( is_wp_error( $menu_item_db_id ) ) {
+ $messages[] = '<div id="message" class="error"><p>' . $menu_item_db_id->get_error_message() . '</p></div>';
+ } else {
+ unset( $menu_items[ $menu_item_db_id ] );
+ }
+ }
+ }
+
+ // Remove menu items from the menu that weren't in $_POST
+ if ( ! empty( $menu_items ) ) {
+ foreach ( array_keys( $menu_items ) as $menu_item_id ) {
+ if ( is_nav_menu_item( $menu_item_id ) ) {
+ wp_delete_post( $menu_item_id );
+ }
+ }
+ }
+
+ // Store 'auto-add' pages.
+ $auto_add = ! empty( $_POST['auto-add-pages'] );
+ $nav_menu_option = (array) get_option( 'nav_menu_options' );
+ if ( ! isset( $nav_menu_option['auto_add'] ) ) {
+ $nav_menu_option['auto_add'] = array();
+ }
+ if ( $auto_add ) {
+ if ( ! in_array( $nav_menu_selected_id, $nav_menu_option['auto_add'] ) ) {
+ $nav_menu_option['auto_add'][] = $nav_menu_selected_id;
+ }
+ } else {
+ if ( false !== ( $key = array_search( $nav_menu_selected_id, $nav_menu_option['auto_add'] ) ) ) {
+ unset( $nav_menu_option['auto_add'][ $key ] );
+ }
+ }
+ // Remove nonexistent/deleted menus
+ $nav_menu_option['auto_add'] = array_intersect( $nav_menu_option['auto_add'], wp_get_nav_menus( array( 'fields' => 'ids' ) ) );
+ update_option( 'nav_menu_options', $nav_menu_option );
+
+ wp_defer_term_counting( false );
+
+ /** This action is documented in wp-includes/nav-menu.php */
+ do_action( 'wp_update_nav_menu', $nav_menu_selected_id );
+
+ $messages[] = '<div id="message" class="updated notice is-dismissible"><p>' .
+ /* translators: %s: nav menu title */
+ sprintf(
+ __( '%s has been updated.' ),
+ '<strong>' . $nav_menu_selected_title . '</strong>'
+ ) . '</p></div>';
+
+ unset( $menu_items, $unsorted_menu_items );
+
+ return $messages;
+}
+
+/**
+ * If a JSON blob of navigation menu data is in POST data, expand it and inject
+ * it into `$_POST` to avoid PHP `max_input_vars` limitations. See #14134.
+ *
+ * @ignore
+ * @since 4.5.3
+ * @access private
+ */
+function _wp_expand_nav_menu_post_data() {
+ if ( ! isset( $_POST['nav-menu-data'] ) ) {
+ return;
+ }
+
+ $data = json_decode( stripslashes( $_POST['nav-menu-data'] ) );
+
+ if ( ! is_null( $data ) && $data ) {
+ foreach ( $data as $post_input_data ) {
+ // For input names that are arrays (e.g. `menu-item-db-id[3][4][5]`),
+ // derive the array path keys via regex and set the value in $_POST.
+ preg_match( '#([^\[]*)(\[(.+)\])?#', $post_input_data->name, $matches );
+
+ $array_bits = array( $matches[1] );
+
+ if ( isset( $matches[3] ) ) {
+ $array_bits = array_merge( $array_bits, explode( '][', $matches[3] ) );
+ }
+
+ $new_post_data = array();
+
+ // Build the new array value from leaf to trunk.
+ for ( $i = count( $array_bits ) - 1; $i >= 0; $i -- ) {
+ if ( $i == count( $array_bits ) - 1 ) {
+ $new_post_data[ $array_bits[ $i ] ] = wp_slash( $post_input_data->value );
+ } else {
+ $new_post_data = array( $array_bits[ $i ] => $new_post_data );
+ }
+ }
+
+ $_POST = array_replace_recursive( $_POST, $new_post_data );
+ }
+ }
+}
diff --git a/www/crm/wp-admin/includes/network.php b/www/crm/wp-admin/includes/network.php
new file mode 100644
index 00000000..055d193c
--- /dev/null
+++ b/www/crm/wp-admin/includes/network.php
@@ -0,0 +1,665 @@
+<?php
+/**
+ * WordPress Network Administration API.
+ *
+ * @package WordPress
+ * @subpackage Administration
+ * @since 4.4.0
+ */
+
+/**
+ * Check for an existing network.
+ *
+ * @since 3.0.0
+ *
+ * @global wpdb $wpdb WordPress database abstraction object.
+ *
+ * @return string|false Base domain if network exists, otherwise false.
+ */
+function network_domain_check() {
+ global $wpdb;
+
+ $sql = $wpdb->prepare( 'SHOW TABLES LIKE %s', $wpdb->esc_like( $wpdb->site ) );
+ if ( $wpdb->get_var( $sql ) ) {
+ return $wpdb->get_var( "SELECT domain FROM $wpdb->site ORDER BY id ASC LIMIT 1" );
+ }
+ return false;
+}
+
+/**
+ * Allow subdomain installation
+ *
+ * @since 3.0.0
+ * @return bool Whether subdomain installation is allowed
+ */
+function allow_subdomain_install() {
+ $domain = preg_replace( '|https?://([^/]+)|', '$1', get_option( 'home' ) );
+ if ( parse_url( get_option( 'home' ), PHP_URL_PATH ) || 'localhost' == $domain || preg_match( '|^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$|', $domain ) ) {
+ return false;
+ }
+
+ return true;
+}
+
+/**
+ * Allow subdirectory installation.
+ *
+ * @since 3.0.0
+ *
+ * @global wpdb $wpdb WordPress database abstraction object.
+ *
+ * @return bool Whether subdirectory installation is allowed
+ */
+function allow_subdirectory_install() {
+ global $wpdb;
+ /**
+ * Filters whether to enable the subdirectory installation feature in Multisite.
+ *
+ * @since 3.0.0
+ *
+ * @param bool $allow Whether to enable the subdirectory installation feature in Multisite. Default is false.
+ */
+ if ( apply_filters( 'allow_subdirectory_install', false ) ) {
+ return true;
+ }
+
+ if ( defined( 'ALLOW_SUBDIRECTORY_INSTALL' ) && ALLOW_SUBDIRECTORY_INSTALL ) {
+ return true;
+ }
+
+ $post = $wpdb->get_row( "SELECT ID FROM $wpdb->posts WHERE post_date < DATE_SUB(NOW(), INTERVAL 1 MONTH) AND post_status = 'publish'" );
+ if ( empty( $post ) ) {
+ return true;
+ }
+
+ return false;
+}
+
+/**
+ * Get base domain of network.
+ *
+ * @since 3.0.0
+ * @return string Base domain.
+ */
+function get_clean_basedomain() {
+ if ( $existing_domain = network_domain_check() ) {
+ return $existing_domain;
+ }
+ $domain = preg_replace( '|https?://|', '', get_option( 'siteurl' ) );
+ if ( $slash = strpos( $domain, '/' ) ) {
+ $domain = substr( $domain, 0, $slash );
+ }
+ return $domain;
+}
+
+/**
+ * Prints step 1 for Network installation process.
+ *
+ * @todo Realistically, step 1 should be a welcome screen explaining what a Network is and such. Navigating to Tools > Network
+ * should not be a sudden "Welcome to a new install process! Fill this out and click here." See also contextual help todo.
+ *
+ * @since 3.0.0
+ *
+ * @global bool $is_apache
+ *
+ * @param WP_Error $errors
+ */
+function network_step1( $errors = false ) {
+ global $is_apache;
+
+ if ( defined( 'DO_NOT_UPGRADE_GLOBAL_TABLES' ) ) {
+ echo '<div class="error"><p><strong>' . __( 'ERROR:' ) . '</strong> ' . sprintf(
+ /* translators: %s: DO_NOT_UPGRADE_GLOBAL_TABLES */
+ __( 'The constant %s cannot be defined when creating a network.' ),
+ '<code>DO_NOT_UPGRADE_GLOBAL_TABLES</code>'
+ ) . '</p></div>';
+ echo '</div>';
+ include( ABSPATH . 'wp-admin/admin-footer.php' );
+ die();
+ }
+
+ $active_plugins = get_option( 'active_plugins' );
+ if ( ! empty( $active_plugins ) ) {
+ echo '<div class="updated"><p><strong>' . __( 'Warning:' ) . '</strong> ' . sprintf(
+ /* translators: %s: Plugins screen URL */
+ __( 'Please <a href="%s">deactivate your plugins</a> before enabling the Network feature.' ),
+ admin_url( 'plugins.php?plugin_status=active' )
+ ) . '</p></div>';
+ echo '<p>' . __( 'Once the network is created, you may reactivate your plugins.' ) . '</p>';
+ echo '</div>';
+ include( ABSPATH . 'wp-admin/admin-footer.php' );
+ die();
+ }
+
+ $hostname = get_clean_basedomain();
+ $has_ports = strstr( $hostname, ':' );
+ if ( ( false !== $has_ports && ! in_array( $has_ports, array( ':80', ':443' ) ) ) ) {
+ echo '<div class="error"><p><strong>' . __( 'ERROR:' ) . '</strong> ' . __( 'You cannot install a network of sites with your server address.' ) . '</p></div>';
+ echo '<p>' . sprintf(
+ /* translators: %s: port number */
+ __( 'You cannot use port numbers such as %s.' ),
+ '<code>' . $has_ports . '</code>'
+ ) . '</p>';
+ echo '<a href="' . esc_url( admin_url() ) . '">' . __( 'Return to Dashboard' ) . '</a>';
+ echo '</div>';
+ include( ABSPATH . 'wp-admin/admin-footer.php' );
+ die();
+ }
+
+ echo '<form method="post">';
+
+ wp_nonce_field( 'install-network-1' );
+
+ $error_codes = array();
+ if ( is_wp_error( $errors ) ) {
+ echo '<div class="error"><p><strong>' . __( 'ERROR: The network could not be created.' ) . '</strong></p>';
+ foreach ( $errors->get_error_messages() as $error ) {
+ echo "<p>$error</p>";
+ }
+ echo '</div>';
+ $error_codes = $errors->get_error_codes();
+ }
+
+ if ( ! empty( $_POST['sitename'] ) && ! in_array( 'empty_sitename', $error_codes ) ) {
+ $site_name = $_POST['sitename'];
+ } else {
+ /* translators: %s: Default network name */
+ $site_name = sprintf( __( '%s Sites' ), get_option( 'blogname' ) );
+ }
+
+ if ( ! empty( $_POST['email'] ) && ! in_array( 'invalid_email', $error_codes ) ) {
+ $admin_email = $_POST['email'];
+ } else {
+ $admin_email = get_option( 'admin_email' );
+ }
+ ?>
+ <p><?php _e( 'Welcome to the Network installation process!' ); ?></p>
+ <p><?php _e( 'Fill in the information below and you&#8217;ll be on your way to creating a network of WordPress sites. We will create configuration files in the next step.' ); ?></p>
+ <?php
+
+ if ( isset( $_POST['subdomain_install'] ) ) {
+ $subdomain_install = (bool) $_POST['subdomain_install'];
+ } elseif ( apache_mod_loaded( 'mod_rewrite' ) ) { // assume nothing
+ $subdomain_install = true;
+ } elseif ( ! allow_subdirectory_install() ) {
+ $subdomain_install = true;
+ } else {
+ $subdomain_install = false;
+ if ( $got_mod_rewrite = got_mod_rewrite() ) { // dangerous assumptions
+ echo '<div class="updated inline"><p><strong>' . __( 'Note:' ) . '</strong> ';
+ /* translators: %s: mod_rewrite */
+ printf(
+ __( 'Please make sure the Apache %s module is installed as it will be used at the end of this installation.' ),
+ '<code>mod_rewrite</code>'
+ );
+ echo '</p>';
+ } elseif ( $is_apache ) {
+ echo '<div class="error inline"><p><strong>' . __( 'Warning:' ) . '</strong> ';
+ /* translators: %s: mod_rewrite */
+ printf(
+ __( 'It looks like the Apache %s module is not installed.' ),
+ '<code>mod_rewrite</code>'
+ );
+ echo '</p>';
+ }
+
+ if ( $got_mod_rewrite || $is_apache ) { // Protect against mod_rewrite mimicry (but ! Apache)
+ echo '<p>';
+ /* translators: 1: mod_rewrite, 2: mod_rewrite documentation URL, 3: Google search for mod_rewrite */
+ printf(
+ __( 'If %1$s is disabled, ask your administrator to enable that module, or look at the <a href="%2$s">Apache documentation</a> or <a href="%3$s">elsewhere</a> for help setting it up.' ),
+ '<code>mod_rewrite</code>',
+ 'https://httpd.apache.org/docs/mod/mod_rewrite.html',
+ 'https://www.google.com/search?q=apache+mod_rewrite'
+ );
+ echo '</p></div>';
+ }
+ }
+
+ if ( allow_subdomain_install() && allow_subdirectory_install() ) :
+ ?>
+ <h3><?php esc_html_e( 'Addresses of Sites in your Network' ); ?></h3>
+ <p><?php _e( 'Please choose whether you would like sites in your WordPress network to use sub-domains or sub-directories.' ); ?>
+ <strong><?php _e( 'You cannot change this later.' ); ?></strong></p>
+ <p><?php _e( 'You will need a wildcard DNS record if you are going to use the virtual host (sub-domain) functionality.' ); ?></p>
+ <?php // @todo: Link to an MS readme? ?>
+ <table class="form-table" role="presentation">
+ <tr>
+ <th><label><input type="radio" name="subdomain_install" value="1"<?php checked( $subdomain_install ); ?> /> <?php _e( 'Sub-domains' ); ?></label></th>
+ <td>
+ <?php
+ printf(
+ /* translators: 1: hostname */
+ _x( 'like <code>site1.%1$s</code> and <code>site2.%1$s</code>', 'subdomain examples' ),
+ $hostname
+ );
+ ?>
+ </td>
+ </tr>
+ <tr>
+ <th><label><input type="radio" name="subdomain_install" value="0"<?php checked( ! $subdomain_install ); ?> /> <?php _e( 'Sub-directories' ); ?></label></th>
+ <td>
+ <?php
+ printf(
+ /* translators: 1: hostname */
+ _x( 'like <code>%1$s/site1</code> and <code>%1$s/site2</code>', 'subdirectory examples' ),
+ $hostname
+ );
+ ?>
+ </td>
+ </tr>
+ </table>
+
+ <?php
+ endif;
+
+ if ( WP_CONTENT_DIR != ABSPATH . 'wp-content' && ( allow_subdirectory_install() || ! allow_subdomain_install() ) ) {
+ echo '<div class="error inline"><p><strong>' . __( 'Warning:' ) . '</strong> ' . __( 'Subdirectory networks may not be fully compatible with custom wp-content directories.' ) . '</p></div>';
+ }
+
+ $is_www = ( 0 === strpos( $hostname, 'www.' ) );
+ if ( $is_www ) :
+ ?>
+ <h3><?php esc_html_e( 'Server Address' ); ?></h3>
+ <p>
+ <?php
+ printf(
+ /* translators: 1: site url, 2: host name, 3: www */
+ __( 'We recommend you change your siteurl to %1$s before enabling the network feature. It will still be possible to visit your site using the %3$s prefix with an address like %2$s but any links will not have the %3$s prefix.' ),
+ '<code>' . substr( $hostname, 4 ) . '</code>',
+ '<code>' . $hostname . '</code>',
+ '<code>www</code>'
+ );
+ ?>
+ </p>
+ <table class="form-table" role="presentation">
+ <tr>
+ <th scope='row'><?php esc_html_e( 'Server Address' ); ?></th>
+ <td>
+ <?php
+ printf(
+ /* translators: %s: host name */
+ __( 'The internet address of your network will be %s.' ),
+ '<code>' . $hostname . '</code>'
+ );
+ ?>
+ </td>
+ </tr>
+ </table>
+ <?php endif; ?>
+
+ <h3><?php esc_html_e( 'Network Details' ); ?></h3>
+ <table class="form-table" role="presentation">
+ <?php if ( 'localhost' == $hostname ) : ?>
+ <tr>
+ <th scope="row"><?php esc_html_e( 'Sub-directory Installation' ); ?></th>
+ <td>
+ <?php
+ printf(
+ /* translators: 1: localhost, 2: localhost.localdomain */
+ __( 'Because you are using %1$s, the sites in your WordPress network must use sub-directories. Consider using %2$s if you wish to use sub-domains.' ),
+ '<code>localhost</code>',
+ '<code>localhost.localdomain</code>'
+ );
+ // Uh oh:
+ if ( ! allow_subdirectory_install() ) {
+ echo ' <strong>' . __( 'Warning:' ) . ' ' . __( 'The main site in a sub-directory installation will need to use a modified permalink structure, potentially breaking existing links.' ) . '</strong>';
+ }
+ ?>
+ </td>
+ </tr>
+ <?php elseif ( ! allow_subdomain_install() ) : ?>
+ <tr>
+ <th scope="row"><?php esc_html_e( 'Sub-directory Installation' ); ?></th>
+ <td>
+ <?php
+ _e( 'Because your installation is in a directory, the sites in your WordPress network must use sub-directories.' );
+ // Uh oh:
+ if ( ! allow_subdirectory_install() ) {
+ echo ' <strong>' . __( 'Warning:' ) . ' ' . __( 'The main site in a sub-directory installation will need to use a modified permalink structure, potentially breaking existing links.' ) . '</strong>';
+ }
+ ?>
+ </td>
+ </tr>
+ <?php elseif ( ! allow_subdirectory_install() ) : ?>
+ <tr>
+ <th scope="row"><?php esc_html_e( 'Sub-domain Installation' ); ?></th>
+ <td>
+ <?php
+ _e( 'Because your installation is not new, the sites in your WordPress network must use sub-domains.' );
+ echo ' <strong>' . __( 'The main site in a sub-directory installation will need to use a modified permalink structure, potentially breaking existing links.' ) . '</strong>';
+ ?>
+ </td>
+ </tr>
+ <?php endif; ?>
+ <?php if ( ! $is_www ) : ?>
+ <tr>
+ <th scope='row'><?php esc_html_e( 'Server Address' ); ?></th>
+ <td>
+ <?php
+ printf(
+ /* translators: %s: host name */
+ __( 'The internet address of your network will be %s.' ),
+ '<code>' . $hostname . '</code>'
+ );
+ ?>
+ </td>
+ </tr>
+ <?php endif; ?>
+ <tr>
+ <th scope='row'><label for="sitename"><?php esc_html_e( 'Network Title' ); ?></label></th>
+ <td>
+ <input name='sitename' id='sitename' type='text' size='45' value='<?php echo esc_attr( $site_name ); ?>' />
+ <p class="description">
+ <?php _e( 'What would you like to call your network?' ); ?>
+ </p>
+ </td>
+ </tr>
+ <tr>
+ <th scope='row'><label for="email"><?php esc_html_e( 'Network Admin Email' ); ?></label></th>
+ <td>
+ <input name='email' id='email' type='text' size='45' value='<?php echo esc_attr( $admin_email ); ?>' />
+ <p class="description">
+ <?php _e( 'Your email address.' ); ?>
+ </p>
+ </td>
+ </tr>
+ </table>
+ <?php submit_button( __( 'Install' ), 'primary', 'submit' ); ?>
+ </form>
+ <?php
+}
+
+/**
+ * Prints step 2 for Network installation process.
+ *
+ * @since 3.0.0
+ *
+ * @global wpdb $wpdb WordPress database abstraction object.
+ *
+ * @param WP_Error $errors
+ */
+function network_step2( $errors = false ) {
+ global $wpdb;
+
+ $hostname = get_clean_basedomain();
+ $slashed_home = trailingslashit( get_option( 'home' ) );
+ $base = parse_url( $slashed_home, PHP_URL_PATH );
+ $document_root_fix = str_replace( '\\', '/', realpath( $_SERVER['DOCUMENT_ROOT'] ) );
+ $abspath_fix = str_replace( '\\', '/', ABSPATH );
+ $home_path = 0 === strpos( $abspath_fix, $document_root_fix ) ? $document_root_fix . $base : get_home_path();
+ $wp_siteurl_subdir = preg_replace( '#^' . preg_quote( $home_path, '#' ) . '#', '', $abspath_fix );
+ $rewrite_base = ! empty( $wp_siteurl_subdir ) ? ltrim( trailingslashit( $wp_siteurl_subdir ), '/' ) : '';
+
+ $location_of_wp_config = $abspath_fix;
+ if ( ! file_exists( ABSPATH . 'wp-config.php' ) && file_exists( dirname( ABSPATH ) . '/wp-config.php' ) ) {
+ $location_of_wp_config = dirname( $abspath_fix );
+ }
+ $location_of_wp_config = trailingslashit( $location_of_wp_config );
+
+ // Wildcard DNS message.
+ if ( is_wp_error( $errors ) ) {
+ echo '<div class="error">' . $errors->get_error_message() . '</div>';
+ }
+
+ if ( $_POST ) {
+ if ( allow_subdomain_install() ) {
+ $subdomain_install = allow_subdirectory_install() ? ! empty( $_POST['subdomain_install'] ) : true;
+ } else {
+ $subdomain_install = false;
+ }
+ } else {
+ if ( is_multisite() ) {
+ $subdomain_install = is_subdomain_install();
+ ?>
+ <p><?php _e( 'The original configuration steps are shown here for reference.' ); ?></p>
+ <?php
+ } else {
+ $subdomain_install = (bool) $wpdb->get_var( "SELECT meta_value FROM $wpdb->sitemeta WHERE site_id = 1 AND meta_key = 'subdomain_install'" );
+ ?>
+ <div class="error"><p><strong><?php _e( 'Warning:' ); ?></strong> <?php _e( 'An existing WordPress network was detected.' ); ?></p></div>
+ <p><?php _e( 'Please complete the configuration steps. To create a new network, you will need to empty or remove the network database tables.' ); ?></p>
+ <?php
+ }
+ }
+
+ $subdir_match = $subdomain_install ? '' : '([_0-9a-zA-Z-]+/)?';
+ $subdir_replacement_01 = $subdomain_install ? '' : '$1';
+ $subdir_replacement_12 = $subdomain_install ? '$1' : '$2';
+
+ if ( $_POST || ! is_multisite() ) {
+ ?>
+ <h3><?php esc_html_e( 'Enabling the Network' ); ?></h3>
+ <p><?php _e( 'Complete the following steps to enable the features for creating a network of sites.' ); ?></p>
+ <div class="updated inline"><p>
+ <?php
+ if ( file_exists( $home_path . '.htaccess' ) ) {
+ echo '<strong>' . __( 'Caution:' ) . '</strong> ';
+ printf(
+ /* translators: 1: wp-config.php, 2: .htaccess */
+ __( 'We recommend you back up your existing %1$s and %2$s files.' ),
+ '<code>wp-config.php</code>',
+ '<code>.htaccess</code>'
+ );
+ } elseif ( file_exists( $home_path . 'web.config' ) ) {
+ echo '<strong>' . __( 'Caution:' ) . '</strong> ';
+ printf(
+ /* translators: 1: wp-config.php, 2: web.config */
+ __( 'We recommend you back up your existing %1$s and %2$s files.' ),
+ '<code>wp-config.php</code>',
+ '<code>web.config</code>'
+ );
+ } else {
+ echo '<strong>' . __( 'Caution:' ) . '</strong> ';
+ printf(
+ /* translators: %s: wp-config.php */
+ __( 'We recommend you back up your existing %s file.' ),
+ '<code>wp-config.php</code>'
+ );
+ }
+ ?>
+ </p></div>
+ <?php
+ }
+ ?>
+ <ol>
+ <li><p>
+ <?php
+ printf(
+ /* translators: 1: wp-config.php, 2: location of wp-config file, 3: translated version of "That's all, stop editing! Happy publishing." */
+ __( 'Add the following to your %1$s file in %2$s <strong>above</strong> the line reading %3$s:' ),
+ '<code>wp-config.php</code>',
+ '<code>' . $location_of_wp_config . '</code>',
+ /*
+ * translators: This string should only be translated if wp-config-sample.php is localized.
+ * You can check the localized release package or
+ * https://i18n.svn.wordpress.org/<locale code>/branches/<wp version>/dist/wp-config-sample.php
+ */
+ '<code>/* ' . __( 'That&#8217;s all, stop editing! Happy publishing.' ) . ' */</code>'
+ );
+ ?>
+ </p>
+ <textarea class="code" readonly="readonly" cols="100" rows="7">
+define('MULTISITE', true);
+define('SUBDOMAIN_INSTALL', <?php echo $subdomain_install ? 'true' : 'false'; ?>);
+define('DOMAIN_CURRENT_SITE', '<?php echo $hostname; ?>');
+define('PATH_CURRENT_SITE', '<?php echo $base; ?>');
+define('SITE_ID_CURRENT_SITE', 1);
+define('BLOG_ID_CURRENT_SITE', 1);
+</textarea>
+ <?php
+ $keys_salts = array(
+ 'AUTH_KEY' => '',
+ 'SECURE_AUTH_KEY' => '',
+ 'LOGGED_IN_KEY' => '',
+ 'NONCE_KEY' => '',
+ 'AUTH_SALT' => '',
+ 'SECURE_AUTH_SALT' => '',
+ 'LOGGED_IN_SALT' => '',
+ 'NONCE_SALT' => '',
+ );
+ foreach ( $keys_salts as $c => $v ) {
+ if ( defined( $c ) ) {
+ unset( $keys_salts[ $c ] );
+ }
+ }
+
+ if ( ! empty( $keys_salts ) ) {
+ $keys_salts_str = '';
+ $from_api = wp_remote_get( 'https://api.wordpress.org/secret-key/1.1/salt/' );
+ if ( is_wp_error( $from_api ) ) {
+ foreach ( $keys_salts as $c => $v ) {
+ $keys_salts_str .= "\ndefine( '$c', '" . wp_generate_password( 64, true, true ) . "' );";
+ }
+ } else {
+ $from_api = explode( "\n", wp_remote_retrieve_body( $from_api ) );
+ foreach ( $keys_salts as $c => $v ) {
+ $keys_salts_str .= "\ndefine( '$c', '" . substr( array_shift( $from_api ), 28, 64 ) . "' );";
+ }
+ }
+ $num_keys_salts = count( $keys_salts );
+ ?>
+<p>
+ <?php
+ if ( 1 == $num_keys_salts ) {
+ printf(
+ /* translators: %s: wp-config.php */
+ __( 'This unique authentication key is also missing from your %s file.' ),
+ '<code>wp-config.php</code>'
+ );
+ } else {
+ printf(
+ /* translators: %s: wp-config.php */
+ __( 'These unique authentication keys are also missing from your %s file.' ),
+ '<code>wp-config.php</code>'
+ );
+ }
+ ?>
+ <?php _e( 'To make your installation more secure, you should also add:' ); ?>
+ </p>
+ <textarea class="code" readonly="readonly" cols="100" rows="<?php echo $num_keys_salts; ?>"><?php echo esc_textarea( $keys_salts_str ); ?></textarea>
+ <?php
+ }
+ ?>
+</li>
+ <?php
+ if ( iis7_supports_permalinks() ) :
+ // IIS doesn't support RewriteBase, all your RewriteBase are belong to us
+ $iis_subdir_match = ltrim( $base, '/' ) . $subdir_match;
+ $iis_rewrite_base = ltrim( $base, '/' ) . $rewrite_base;
+ $iis_subdir_replacement = $subdomain_install ? '' : '{R:1}';
+
+ $web_config_file = '<?xml version="1.0" encoding="UTF-8"?>
+<configuration>
+ <system.webServer>
+ <rewrite>
+ <rules>
+ <rule name="WordPress Rule 1" stopProcessing="true">
+ <match url="^index\.php$" ignoreCase="false" />
+ <action type="None" />
+ </rule>';
+ if ( is_multisite() && get_site_option( 'ms_files_rewriting' ) ) {
+ $web_config_file .= '
+ <rule name="WordPress Rule for Files" stopProcessing="true">
+ <match url="^' . $iis_subdir_match . 'files/(.+)" ignoreCase="false" />
+ <action type="Rewrite" url="' . $iis_rewrite_base . WPINC . '/ms-files.php?file={R:1}" appendQueryString="false" />
+ </rule>';
+ }
+ $web_config_file .= '
+ <rule name="WordPress Rule 2" stopProcessing="true">
+ <match url="^' . $iis_subdir_match . 'wp-admin$" ignoreCase="false" />
+ <action type="Redirect" url="' . $iis_subdir_replacement . 'wp-admin/" redirectType="Permanent" />
+ </rule>
+ <rule name="WordPress Rule 3" stopProcessing="true">
+ <match url="^" ignoreCase="false" />
+ <conditions logicalGrouping="MatchAny">
+ <add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" />
+ <add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" />
+ </conditions>
+ <action type="None" />
+ </rule>
+ <rule name="WordPress Rule 4" stopProcessing="true">
+ <match url="^' . $iis_subdir_match . '(wp-(content|admin|includes).*)" ignoreCase="false" />
+ <action type="Rewrite" url="' . $iis_rewrite_base . '{R:1}" />
+ </rule>
+ <rule name="WordPress Rule 5" stopProcessing="true">
+ <match url="^' . $iis_subdir_match . '([_0-9a-zA-Z-]+/)?(.*\.php)$" ignoreCase="false" />
+ <action type="Rewrite" url="' . $iis_rewrite_base . '{R:2}" />
+ </rule>
+ <rule name="WordPress Rule 6" stopProcessing="true">
+ <match url="." ignoreCase="false" />
+ <action type="Rewrite" url="index.php" />
+ </rule>
+ </rules>
+ </rewrite>
+ </system.webServer>
+</configuration>
+';
+
+ echo '<li><p>';
+ printf(
+ /* translators: 1: a filename like .htaccess, 2: a file path */
+ __( 'Add the following to your %1$s file in %2$s, <strong>replacing</strong> other WordPress rules:' ),
+ '<code>web.config</code>',
+ '<code>' . $home_path . '</code>'
+ );
+ echo '</p>';
+ if ( ! $subdomain_install && WP_CONTENT_DIR != ABSPATH . 'wp-content' ) {
+ echo '<p><strong>' . __( 'Warning:' ) . ' ' . __( 'Subdirectory networks may not be fully compatible with custom wp-content directories.' ) . '</strong></p>';
+ }
+ ?>
+ <textarea class="code" readonly="readonly" cols="100" rows="20"><?php echo esc_textarea( $web_config_file ); ?>
+ </textarea></li>
+ </ol>
+
+ <?php
+ else : // end iis7_supports_permalinks(). construct an htaccess file instead:
+
+ $ms_files_rewriting = '';
+ if ( is_multisite() && get_site_option( 'ms_files_rewriting' ) ) {
+ $ms_files_rewriting = "\n# uploaded files\nRewriteRule ^";
+ $ms_files_rewriting .= $subdir_match . "files/(.+) {$rewrite_base}" . WPINC . "/ms-files.php?file={$subdir_replacement_12} [L]" . "\n";
+ }
+
+ $htaccess_file = <<<EOF
+RewriteEngine On
+RewriteBase {$base}
+RewriteRule ^index\.php$ - [L]
+{$ms_files_rewriting}
+# add a trailing slash to /wp-admin
+RewriteRule ^{$subdir_match}wp-admin$ {$subdir_replacement_01}wp-admin/ [R=301,L]
+
+RewriteCond %{REQUEST_FILENAME} -f [OR]
+RewriteCond %{REQUEST_FILENAME} -d
+RewriteRule ^ - [L]
+RewriteRule ^{$subdir_match}(wp-(content|admin|includes).*) {$rewrite_base}{$subdir_replacement_12} [L]
+RewriteRule ^{$subdir_match}(.*\.php)$ {$rewrite_base}$subdir_replacement_12 [L]
+RewriteRule . index.php [L]
+
+EOF;
+
+ echo '<li><p>';
+ printf(
+ /* translators: 1: a filename like .htaccess, 2: a file path */
+ __( 'Add the following to your %1$s file in %2$s, <strong>replacing</strong> other WordPress rules:' ),
+ '<code>.htaccess</code>',
+ '<code>' . $home_path . '</code>'
+ );
+ echo '</p>';
+ if ( ! $subdomain_install && WP_CONTENT_DIR != ABSPATH . 'wp-content' ) {
+ echo '<p><strong>' . __( 'Warning:' ) . ' ' . __( 'Subdirectory networks may not be fully compatible with custom wp-content directories.' ) . '</strong></p>';
+ }
+ ?>
+ <textarea class="code" readonly="readonly" cols="100" rows="<?php echo substr_count( $htaccess_file, "\n" ) + 1; ?>">
+ <?php echo esc_textarea( $htaccess_file ); ?></textarea></li>
+ </ol>
+
+ <?php
+ endif; // end IIS/Apache code branches.
+
+ if ( ! is_multisite() ) {
+ ?>
+ <p><?php _e( 'Once you complete these steps, your network is enabled and configured. You will have to log in again.' ); ?> <a href="<?php echo esc_url( wp_login_url() ); ?>"><?php _e( 'Log In' ); ?></a></p>
+ <?php
+ }
+}
diff --git a/www/crm/wp-admin/includes/noop.php b/www/crm/wp-admin/includes/noop.php
new file mode 100644
index 00000000..134bef7e
--- /dev/null
+++ b/www/crm/wp-admin/includes/noop.php
@@ -0,0 +1,114 @@
+<?php
+/**
+ * Noop functions for load-scripts.php and load-styles.php.
+ *
+ * @package WordPress
+ * @subpackage Administration
+ * @since 4.4.0
+ */
+
+/**
+ * @ignore
+ */
+function __() {}
+
+/**
+ * @ignore
+ */
+function _x() {}
+
+/**
+ * @ignore
+ */
+function add_filter() {}
+
+/**
+ * @ignore
+ */
+function esc_attr() {}
+
+/**
+ * @ignore
+ */
+function apply_filters() {}
+
+/**
+ * @ignore
+ */
+function get_option() {}
+
+/**
+ * @ignore
+ */
+function is_lighttpd_before_150() {}
+
+/**
+ * @ignore
+ */
+function add_action() {}
+
+/**
+ * @ignore
+ */
+function did_action() {}
+
+/**
+ * @ignore
+ */
+function do_action_ref_array() {}
+
+/**
+ * @ignore
+ */
+function get_bloginfo() {}
+
+/**
+ * @ignore
+ */
+function is_admin() {
+ return true;}
+
+/**
+ * @ignore
+ */
+function site_url() {}
+
+/**
+ * @ignore
+ */
+function admin_url() {}
+
+/**
+ * @ignore
+ */
+function home_url() {}
+
+/**
+ * @ignore
+ */
+function includes_url() {}
+
+/**
+ * @ignore
+ */
+function wp_guess_url() {}
+
+if ( ! function_exists( 'json_encode' ) ) :
+ /**
+ * @ignore
+ */
+ function json_encode() {}
+endif;
+
+function get_file( $path ) {
+
+ if ( function_exists( 'realpath' ) ) {
+ $path = realpath( $path );
+ }
+
+ if ( ! $path || ! @is_file( $path ) ) {
+ return '';
+ }
+
+ return @file_get_contents( $path );
+}
diff --git a/www/crm/wp-admin/includes/options.php b/www/crm/wp-admin/includes/options.php
new file mode 100644
index 00000000..502af4b0
--- /dev/null
+++ b/www/crm/wp-admin/includes/options.php
@@ -0,0 +1,133 @@
+<?php
+/**
+ * WordPress Options Administration API.
+ *
+ * @package WordPress
+ * @subpackage Administration
+ * @since 4.4.0
+ */
+
+/**
+ * Output JavaScript to toggle display of additional settings if avatars are disabled.
+ *
+ * @since 4.2.0
+ */
+function options_discussion_add_js() {
+ ?>
+ <script>
+ (function($){
+ var parent = $( '#show_avatars' ),
+ children = $( '.avatar-settings' );
+ parent.change(function(){
+ children.toggleClass( 'hide-if-js', ! this.checked );
+ });
+ })(jQuery);
+ </script>
+ <?php
+}
+
+/**
+ * Display JavaScript on the page.
+ *
+ * @since 3.5.0
+ */
+function options_general_add_js() {
+ ?>
+<script type="text/javascript">
+ jQuery(document).ready(function($){
+ var $siteName = $( '#wp-admin-bar-site-name' ).children( 'a' ).first(),
+ homeURL = ( <?php echo wp_json_encode( get_home_url() ); ?> || '' ).replace( /^(https?:\/\/)?(www\.)?/, '' );
+
+ $( '#blogname' ).on( 'input', function() {
+ var title = $.trim( $( this ).val() ) || homeURL;
+
+ // Truncate to 40 characters.
+ if ( 40 < title.length ) {
+ title = title.substring( 0, 40 ) + '\u2026';
+ }
+
+ $siteName.text( title );
+ });
+
+ $("input[name='date_format']").click(function(){
+ if ( "date_format_custom_radio" != $(this).attr("id") )
+ $( 'input[name="date_format_custom"]' ).val( $( this ).val() ).closest( 'fieldset' ).find( '.example' ).text( $( this ).parent( 'label' ).children( '.format-i18n' ).text() );
+ });
+ $( 'input[name="date_format_custom"]' ).on( 'click input', function() {
+ $( '#date_format_custom_radio' ).prop( 'checked', true );
+ });
+
+ $("input[name='time_format']").click(function(){
+ if ( "time_format_custom_radio" != $(this).attr("id") )
+ $( 'input[name="time_format_custom"]' ).val( $( this ).val() ).closest( 'fieldset' ).find( '.example' ).text( $( this ).parent( 'label' ).children( '.format-i18n' ).text() );
+ });
+
+ $( 'input[name="time_format_custom"]' ).on( 'click input', function() {
+ $( '#time_format_custom_radio' ).prop( 'checked', true );
+ });
+
+ $( 'input[name="date_format_custom"], input[name="time_format_custom"]' ).on( 'input', function() {
+ var format = $( this ),
+ fieldset = format.closest( 'fieldset' ),
+ example = fieldset.find( '.example' ),
+ spinner = fieldset.find( '.spinner' );
+
+ // Debounce the event callback while users are typing.
+ clearTimeout( $.data( this, 'timer' ) );
+ $( this ).data( 'timer', setTimeout( function() {
+ // If custom date is not empty.
+ if ( format.val() ) {
+ spinner.addClass( 'is-active' );
+
+ $.post( ajaxurl, {
+ action: 'date_format_custom' == format.attr( 'name' ) ? 'date_format' : 'time_format',
+ date : format.val()
+ }, function( d ) { spinner.removeClass( 'is-active' ); example.text( d ); } );
+ }
+ }, 500 ) );
+ } );
+
+ var languageSelect = $( '#WPLANG' );
+ $( 'form' ).submit( function() {
+ // Don't show a spinner for English and installed languages,
+ // as there is nothing to download.
+ if ( ! languageSelect.find( 'option:selected' ).data( 'installed' ) ) {
+ $( '#submit', this ).after( '<span class="spinner language-install-spinner is-active" />' );
+ }
+ });
+ });
+</script>
+ <?php
+}
+
+/**
+ * Display JavaScript on the page.
+ *
+ * @since 3.5.0
+ */
+function options_reading_add_js() {
+ ?>
+<script type="text/javascript">
+ jQuery(document).ready(function($){
+ var section = $('#front-static-pages'),
+ staticPage = section.find('input:radio[value="page"]'),
+ selects = section.find('select'),
+ check_disabled = function(){
+ selects.prop( 'disabled', ! staticPage.prop('checked') );
+ };
+ check_disabled();
+ section.find( 'input:radio' ).change( check_disabled );
+ });
+</script>
+ <?php
+}
+
+/**
+ * Render the site charset setting.
+ *
+ * @since 3.5.0
+ */
+function options_reading_blog_charset() {
+ echo '<input name="blog_charset" type="text" id="blog_charset" value="' . esc_attr( get_option( 'blog_charset' ) ) . '" class="regular-text" />';
+ echo '<p class="description">' . __( 'The <a href="https://codex.wordpress.org/Glossary#Character_set">character encoding</a> of your site (UTF-8 is recommended)' ) . '</p>';
+}
diff --git a/www/crm/wp-admin/includes/plugin-install.php b/www/crm/wp-admin/includes/plugin-install.php
new file mode 100644
index 00000000..4fa007e3
--- /dev/null
+++ b/www/crm/wp-admin/includes/plugin-install.php
@@ -0,0 +1,854 @@
+<?php
+/**
+ * WordPress Plugin Install Administration API
+ *
+ * @package WordPress
+ * @subpackage Administration
+ */
+
+/**
+ * Retrieves plugin installer pages from the WordPress.org Plugins API.
+ *
+ * It is possible for a plugin to override the Plugin API result with three
+ * filters. Assume this is for plugins, which can extend on the Plugin Info to
+ * offer more choices. This is very powerful and must be used with care when
+ * overriding the filters.
+ *
+ * The first filter, {@see 'plugins_api_args'}, is for the args and gives the action
+ * as the second parameter. The hook for {@see 'plugins_api_args'} must ensure that
+ * an object is returned.
+ *
+ * The second filter, {@see 'plugins_api'}, allows a plugin to override the WordPress.org
+ * Plugin Installation API entirely. If `$action` is 'query_plugins' or 'plugin_information',
+ * an object MUST be passed. If `$action` is 'hot_tags' or 'hot_categories', an array MUST
+ * be passed.
+ *
+ * Finally, the third filter, {@see 'plugins_api_result'}, makes it possible to filter the
+ * response object or array, depending on the `$action` type.
+ *
+ * Supported arguments per action:
+ *
+ * | Argument Name | query_plugins | plugin_information | hot_tags | hot_categories |
+ * | -------------------- | :-----------: | :----------------: | :------: | :------------: |
+ * | `$slug` | No | Yes | No | No |
+ * | `$per_page` | Yes | No | No | No |
+ * | `$page` | Yes | No | No | No |
+ * | `$number` | No | No | Yes | Yes |
+ * | `$search` | Yes | No | No | No |
+ * | `$tag` | Yes | No | No | No |
+ * | `$author` | Yes | No | No | No |
+ * | `$user` | Yes | No | No | No |
+ * | `$browse` | Yes | No | No | No |
+ * | `$locale` | Yes | Yes | No | No |
+ * | `$installed_plugins` | Yes | No | No | No |
+ * | `$is_ssl` | Yes | Yes | No | No |
+ * | `$fields` | Yes | Yes | No | No |
+ *
+ * @since 2.7.0
+ *
+ * @param string $action API action to perform: 'query_plugins', 'plugin_information',
+ * 'hot_tags' or 'hot_categories'.
+ * @param array|object $args {
+ * Optional. Array or object of arguments to serialize for the Plugin Info API.
+ *
+ * @type string $slug The plugin slug. Default empty.
+ * @type int $per_page Number of plugins per page. Default 24.
+ * @type int $page Number of current page. Default 1.
+ * @type int $number Number of tags or categories to be queried.
+ * @type string $search A search term. Default empty.
+ * @type string $tag Tag to filter plugins. Default empty.
+ * @type string $author Username of an plugin author to filter plugins. Default empty.
+ * @type string $user Username to query for their favorites. Default empty.
+ * @type string $browse Browse view: 'popular', 'new', 'beta', 'recommended'.
+ * @type string $locale Locale to provide context-sensitive results. Default is the value
+ * of get_locale().
+ * @type string $installed_plugins Installed plugins to provide context-sensitive results.
+ * @type bool $is_ssl Whether links should be returned with https or not. Default false.
+ * @type array $fields {
+ * Array of fields which should or should not be returned.
+ *
+ * @type bool $short_description Whether to return the plugin short description. Default true.
+ * @type bool $description Whether to return the plugin full description. Default false.
+ * @type bool $sections Whether to return the plugin readme sections: description, installation,
+ * FAQ, screenshots, other notes, and changelog. Default false.
+ * @type bool $tested Whether to return the 'Compatible up to' value. Default true.
+ * @type bool $requires Whether to return the required WordPress version. Default true.
+ * @type bool $rating Whether to return the rating in percent and total number of ratings.
+ * Default true.
+ * @type bool $ratings Whether to return the number of rating for each star (1-5). Default true.
+ * @type bool $downloaded Whether to return the download count. Default true.
+ * @type bool $downloadlink Whether to return the download link for the package. Default true.
+ * @type bool $last_updated Whether to return the date of the last update. Default true.
+ * @type bool $added Whether to return the date when the plugin was added to the wordpress.org
+ * repository. Default true.
+ * @type bool $tags Whether to return the assigned tags. Default true.
+ * @type bool $compatibility Whether to return the WordPress compatibility list. Default true.
+ * @type bool $homepage Whether to return the plugin homepage link. Default true.
+ * @type bool $versions Whether to return the list of all available versions. Default false.
+ * @type bool $donate_link Whether to return the donation link. Default true.
+ * @type bool $reviews Whether to return the plugin reviews. Default false.
+ * @type bool $banners Whether to return the banner images links. Default false.
+ * @type bool $icons Whether to return the icon links. Default false.
+ * @type bool $active_installs Whether to return the number of active installations. Default false.
+ * @type bool $group Whether to return the assigned group. Default false.
+ * @type bool $contributors Whether to return the list of contributors. Default false.
+ * }
+ * }
+ * @return object|array|WP_Error Response object or array on success, WP_Error on failure. See the
+ * {@link https://developer.wordpress.org/reference/functions/plugins_api/ function reference article}
+ * for more information on the make-up of possible return values depending on the value of `$action`.
+ */
+function plugins_api( $action, $args = array() ) {
+ // include an unmodified $wp_version
+ include( ABSPATH . WPINC . '/version.php' );
+
+ if ( is_array( $args ) ) {
+ $args = (object) $args;
+ }
+
+ if ( 'query_plugins' == $action ) {
+ if ( ! isset( $args->per_page ) ) {
+ $args->per_page = 24;
+ }
+ }
+
+ if ( ! isset( $args->locale ) ) {
+ $args->locale = get_user_locale();
+ }
+
+ if ( ! isset( $args->wp_version ) ) {
+ $args->wp_version = substr( $wp_version, 0, 3 ); // X.y
+ }
+
+ /**
+ * Filters the WordPress.org Plugin Installation API arguments.
+ *
+ * Important: An object MUST be returned to this filter.
+ *
+ * @since 2.7.0
+ *
+ * @param object $args Plugin API arguments.
+ * @param string $action The type of information being requested from the Plugin Installation API.
+ */
+ $args = apply_filters( 'plugins_api_args', $args, $action );
+
+ /**
+ * Filters the response for the current WordPress.org Plugin Installation API request.
+ *
+ * Passing a non-false value will effectively short-circuit the WordPress.org API request.
+ *
+ * If `$action` is 'query_plugins' or 'plugin_information', an object MUST be passed.
+ * If `$action` is 'hot_tags' or 'hot_categories', an array should be passed.
+ *
+ * @since 2.7.0
+ *
+ * @param false|object|array $result The result object or array. Default false.
+ * @param string $action The type of information being requested from the Plugin Installation API.
+ * @param object $args Plugin API arguments.
+ */
+ $res = apply_filters( 'plugins_api', false, $action, $args );
+
+ if ( false === $res ) {
+
+ $url = 'http://api.wordpress.org/plugins/info/1.2/';
+ $url = add_query_arg(
+ array(
+ 'action' => $action,
+ 'request' => $args,
+ ),
+ $url
+ );
+
+ $http_url = $url;
+ if ( $ssl = wp_http_supports( array( 'ssl' ) ) ) {
+ $url = set_url_scheme( $url, 'https' );
+ }
+
+ $http_args = array(
+ 'timeout' => 15,
+ 'user-agent' => 'WordPress/' . $wp_version . '; ' . home_url( '/' ),
+ );
+ $request = wp_remote_get( $url, $http_args );
+
+ if ( $ssl && is_wp_error( $request ) ) {
+ trigger_error(
+ sprintf(
+ /* translators: %s: support forums URL */
+ __( 'An unexpected error occurred. Something may be wrong with WordPress.org or this server&#8217;s configuration. If you continue to have problems, please try the <a href="%s">support forums</a>.' ),
+ __( 'https://wordpress.org/support/' )
+ ) . ' ' . __( '(WordPress could not establish a secure connection to WordPress.org. Please contact your server administrator.)' ),
+ headers_sent() || WP_DEBUG ? E_USER_WARNING : E_USER_NOTICE
+ );
+ $request = wp_remote_get( $http_url, $http_args );
+ }
+
+ if ( is_wp_error( $request ) ) {
+ $res = new WP_Error(
+ 'plugins_api_failed',
+ sprintf(
+ /* translators: %s: support forums URL */
+ __( 'An unexpected error occurred. Something may be wrong with WordPress.org or this server&#8217;s configuration. If you continue to have problems, please try the <a href="%s">support forums</a>.' ),
+ __( 'https://wordpress.org/support/' )
+ ),
+ $request->get_error_message()
+ );
+ } else {
+ $res = json_decode( wp_remote_retrieve_body( $request ), true );
+ if ( is_array( $res ) ) {
+ // Object casting is required in order to match the info/1.0 format.
+ $res = (object) $res;
+ } elseif ( null === $res ) {
+ $res = new WP_Error(
+ 'plugins_api_failed',
+ sprintf(
+ /* translators: %s: support forums URL */
+ __( 'An unexpected error occurred. Something may be wrong with WordPress.org or this server&#8217;s configuration. If you continue to have problems, please try the <a href="%s">support forums</a>.' ),
+ __( 'https://wordpress.org/support/' )
+ ),
+ wp_remote_retrieve_body( $request )
+ );
+ }
+
+ if ( isset( $res->error ) ) {
+ $res = new WP_Error( 'plugins_api_failed', $res->error );
+ }
+ }
+ } elseif ( ! is_wp_error( $res ) ) {
+ $res->external = true;
+ }
+
+ /**
+ * Filters the Plugin Installation API response results.
+ *
+ * @since 2.7.0
+ *
+ * @param object|WP_Error $res Response object or WP_Error.
+ * @param string $action The type of information being requested from the Plugin Installation API.
+ * @param object $args Plugin API arguments.
+ */
+ return apply_filters( 'plugins_api_result', $res, $action, $args );
+}
+
+/**
+ * Retrieve popular WordPress plugin tags.
+ *
+ * @since 2.7.0
+ *
+ * @param array $args
+ * @return array
+ */
+function install_popular_tags( $args = array() ) {
+ $key = md5( serialize( $args ) );
+ if ( false !== ( $tags = get_site_transient( 'poptags_' . $key ) ) ) {
+ return $tags;
+ }
+
+ $tags = plugins_api( 'hot_tags', $args );
+
+ if ( is_wp_error( $tags ) ) {
+ return $tags;
+ }
+
+ set_site_transient( 'poptags_' . $key, $tags, 3 * HOUR_IN_SECONDS );
+
+ return $tags;
+}
+
+/**
+ * @since 2.7.0
+ */
+function install_dashboard() {
+ ?>
+ <p><?php printf( __( 'Plugins extend and expand the functionality of WordPress. You may automatically install plugins from the <a href="%1$s">WordPress Plugin Directory</a> or upload a plugin in .zip format by clicking the button at the top of this page.' ), __( 'https://wordpress.org/plugins/' ) ); ?></p>
+
+ <?php display_plugins_table(); ?>
+
+ <div class="plugins-popular-tags-wrapper">
+ <h2><?php _e( 'Popular tags' ); ?></h2>
+ <p><?php _e( 'You may also browse based on the most popular tags in the Plugin Directory:' ); ?></p>
+ <?php
+
+ $api_tags = install_popular_tags();
+
+ echo '<p class="popular-tags">';
+ if ( is_wp_error( $api_tags ) ) {
+ echo $api_tags->get_error_message();
+ } else {
+ //Set up the tags in a way which can be interpreted by wp_generate_tag_cloud()
+ $tags = array();
+ foreach ( (array) $api_tags as $tag ) {
+ $url = self_admin_url( 'plugin-install.php?tab=search&type=tag&s=' . urlencode( $tag['name'] ) );
+ $data = array(
+ 'link' => esc_url( $url ),
+ 'name' => $tag['name'],
+ 'slug' => $tag['slug'],
+ 'id' => sanitize_title_with_dashes( $tag['name'] ),
+ 'count' => $tag['count'],
+ );
+ $tags[ $tag['name'] ] = (object) $data;
+ }
+ echo wp_generate_tag_cloud(
+ $tags,
+ array(
+ 'single_text' => __( '%s plugin' ),
+ 'multiple_text' => __( '%s plugins' ),
+ )
+ );
+ }
+ echo '</p><br class="clear" /></div>';
+}
+
+/**
+ * Displays a search form for searching plugins.
+ *
+ * @since 2.7.0
+ * @since 4.6.0 The `$type_selector` parameter was deprecated.
+ *
+ * @param bool $deprecated Not used.
+ */
+function install_search_form( $deprecated = true ) {
+ $type = isset( $_REQUEST['type'] ) ? wp_unslash( $_REQUEST['type'] ) : 'term';
+ $term = isset( $_REQUEST['s'] ) ? wp_unslash( $_REQUEST['s'] ) : '';
+ ?>
+ <form class="search-form search-plugins" method="get">
+ <input type="hidden" name="tab" value="search" />
+ <label class="screen-reader-text" for="typeselector"><?php _e( 'Search plugins by:' ); ?></label>
+ <select name="type" id="typeselector">
+ <option value="term"<?php selected( 'term', $type ); ?>><?php _e( 'Keyword' ); ?></option>
+ <option value="author"<?php selected( 'author', $type ); ?>><?php _e( 'Author' ); ?></option>
+ <option value="tag"<?php selected( 'tag', $type ); ?>><?php _ex( 'Tag', 'Plugin Installer' ); ?></option>
+ </select>
+ <label><span class="screen-reader-text"><?php _e( 'Search Plugins' ); ?></span>
+ <input type="search" name="s" value="<?php echo esc_attr( $term ); ?>" class="wp-filter-search" placeholder="<?php esc_attr_e( 'Search plugins...' ); ?>" />
+ </label>
+ <?php submit_button( __( 'Search Plugins' ), 'hide-if-js', false, false, array( 'id' => 'search-submit' ) ); ?>
+ </form>
+ <?php
+}
+
+/**
+ * Upload from zip
+ *
+ * @since 2.8.0
+ */
+function install_plugins_upload() {
+ ?>
+<div class="upload-plugin">
+ <p class="install-help"><?php _e( 'If you have a plugin in a .zip format, you may install it by uploading it here.' ); ?></p>
+ <form method="post" enctype="multipart/form-data" class="wp-upload-form" action="<?php echo self_admin_url( 'update.php?action=upload-plugin' ); ?>">
+ <?php wp_nonce_field( 'plugin-upload' ); ?>
+ <label class="screen-reader-text" for="pluginzip"><?php _e( 'Plugin zip file' ); ?></label>
+ <input type="file" id="pluginzip" name="pluginzip" />
+ <?php submit_button( __( 'Install Now' ), '', 'install-plugin-submit', false ); ?>
+ </form>
+</div>
+ <?php
+}
+
+/**
+ * Show a username form for the favorites page
+ *
+ * @since 3.5.0
+ */
+function install_plugins_favorites_form() {
+ $user = get_user_option( 'wporg_favorites' );
+ $action = 'save_wporg_username_' . get_current_user_id();
+ ?>
+ <p class="install-help"><?php _e( 'If you have marked plugins as favorites on WordPress.org, you can browse them here.' ); ?></p>
+ <form method="get">
+ <input type="hidden" name="tab" value="favorites" />
+ <p>
+ <label for="user"><?php _e( 'Your WordPress.org username:' ); ?></label>
+ <input type="search" id="user" name="user" value="<?php echo esc_attr( $user ); ?>" />
+ <input type="submit" class="button" value="<?php esc_attr_e( 'Get Favorites' ); ?>" />
+ <input type="hidden" id="wporg-username-nonce" name="_wpnonce" value="<?php echo esc_attr( wp_create_nonce( $action ) ); ?>" />
+ </p>
+ </form>
+ <?php
+}
+
+/**
+ * Display plugin content based on plugin list.
+ *
+ * @since 2.7.0
+ *
+ * @global WP_List_Table $wp_list_table
+ */
+function display_plugins_table() {
+ global $wp_list_table;
+
+ switch ( current_filter() ) {
+ case 'install_plugins_favorites':
+ if ( empty( $_GET['user'] ) && ! get_user_option( 'wporg_favorites' ) ) {
+ return;
+ }
+ break;
+ case 'install_plugins_recommended':
+ echo '<p>' . __( 'These suggestions are based on the plugins you and other users have installed.' ) . '</p>';
+ break;
+ case 'install_plugins_beta':
+ printf(
+ '<p>' . __( 'You are using a development version of WordPress. These feature plugins are also under development. <a href="%s">Learn more</a>.' ) . '</p>',
+ 'https://make.wordpress.org/core/handbook/about/release-cycle/features-as-plugins/'
+ );
+ break;
+ }
+
+ ?>
+ <form id="plugin-filter" method="post">
+ <?php $wp_list_table->display(); ?>
+ </form>
+ <?php
+}
+
+/**
+ * Determine the status we can perform on a plugin.
+ *
+ * @since 3.0.0
+ *
+ * @param array|object $api Data about the plugin retrieved from the API.
+ * @param bool $loop Optional. Disable further loops. Default false.
+ * @return array {
+ * Plugin installation status data.
+ *
+ * @type string $status Status of a plugin. Could be one of 'install', 'update_available', 'latest_installed' or 'newer_installed'.
+ * @type string $url Plugin installation URL.
+ * @type string $version The most recent version of the plugin.
+ * @type string $file Plugin filename relative to the plugins directory.
+ * }
+ */
+function install_plugin_install_status( $api, $loop = false ) {
+ // This function is called recursively, $loop prevents further loops.
+ if ( is_array( $api ) ) {
+ $api = (object) $api;
+ }
+
+ // Default to a "new" plugin
+ $status = 'install';
+ $url = false;
+ $update_file = false;
+ $version = '';
+
+ /*
+ * Check to see if this plugin is known to be installed,
+ * and has an update awaiting it.
+ */
+ $update_plugins = get_site_transient( 'update_plugins' );
+ if ( isset( $update_plugins->response ) ) {
+ foreach ( (array) $update_plugins->response as $file => $plugin ) {
+ if ( $plugin->slug === $api->slug ) {
+ $status = 'update_available';
+ $update_file = $file;
+ $version = $plugin->new_version;
+ if ( current_user_can( 'update_plugins' ) ) {
+ $url = wp_nonce_url( self_admin_url( 'update.php?action=upgrade-plugin&plugin=' . $update_file ), 'upgrade-plugin_' . $update_file );
+ }
+ break;
+ }
+ }
+ }
+
+ if ( 'install' == $status ) {
+ if ( is_dir( WP_PLUGIN_DIR . '/' . $api->slug ) ) {
+ $installed_plugin = get_plugins( '/' . $api->slug );
+ if ( empty( $installed_plugin ) ) {
+ if ( current_user_can( 'install_plugins' ) ) {
+ $url = wp_nonce_url( self_admin_url( 'update.php?action=install-plugin&plugin=' . $api->slug ), 'install-plugin_' . $api->slug );
+ }
+ } else {
+ $key = array_keys( $installed_plugin );
+ $key = reset( $key ); //Use the first plugin regardless of the name, Could have issues for multiple-plugins in one directory if they share different version numbers
+ $update_file = $api->slug . '/' . $key;
+ if ( version_compare( $api->version, $installed_plugin[ $key ]['Version'], '=' ) ) {
+ $status = 'latest_installed';
+ } elseif ( version_compare( $api->version, $installed_plugin[ $key ]['Version'], '<' ) ) {
+ $status = 'newer_installed';
+ $version = $installed_plugin[ $key ]['Version'];
+ } else {
+ //If the above update check failed, Then that probably means that the update checker has out-of-date information, force a refresh
+ if ( ! $loop ) {
+ delete_site_transient( 'update_plugins' );
+ wp_update_plugins();
+ return install_plugin_install_status( $api, true );
+ }
+ }
+ }
+ } else {
+ // "install" & no directory with that slug
+ if ( current_user_can( 'install_plugins' ) ) {
+ $url = wp_nonce_url( self_admin_url( 'update.php?action=install-plugin&plugin=' . $api->slug ), 'install-plugin_' . $api->slug );
+ }
+ }
+ }
+ if ( isset( $_GET['from'] ) ) {
+ $url .= '&amp;from=' . urlencode( wp_unslash( $_GET['from'] ) );
+ }
+
+ $file = $update_file;
+ return compact( 'status', 'url', 'version', 'file' );
+}
+
+/**
+ * Display plugin information in dialog box form.
+ *
+ * @since 2.7.0
+ *
+ * @global string $tab
+ */
+function install_plugin_information() {
+ global $tab;
+
+ if ( empty( $_REQUEST['plugin'] ) ) {
+ return;
+ }
+
+ $api = plugins_api(
+ 'plugin_information',
+ array(
+ 'slug' => wp_unslash( $_REQUEST['plugin'] ),
+ )
+ );
+
+ if ( is_wp_error( $api ) ) {
+ wp_die( $api );
+ }
+
+ $plugins_allowedtags = array(
+ 'a' => array(
+ 'href' => array(),
+ 'title' => array(),
+ 'target' => array(),
+ ),
+ 'abbr' => array( 'title' => array() ),
+ 'acronym' => array( 'title' => array() ),
+ 'code' => array(),
+ 'pre' => array(),
+ 'em' => array(),
+ 'strong' => array(),
+ 'div' => array( 'class' => array() ),
+ 'span' => array( 'class' => array() ),
+ 'p' => array(),
+ 'br' => array(),
+ 'ul' => array(),
+ 'ol' => array(),
+ 'li' => array(),
+ 'h1' => array(),
+ 'h2' => array(),
+ 'h3' => array(),
+ 'h4' => array(),
+ 'h5' => array(),
+ 'h6' => array(),
+ 'img' => array(
+ 'src' => array(),
+ 'class' => array(),
+ 'alt' => array(),
+ ),
+ 'blockquote' => array( 'cite' => true ),
+ );
+
+ $plugins_section_titles = array(
+ 'description' => _x( 'Description', 'Plugin installer section title' ),
+ 'installation' => _x( 'Installation', 'Plugin installer section title' ),
+ 'faq' => _x( 'FAQ', 'Plugin installer section title' ),
+ 'screenshots' => _x( 'Screenshots', 'Plugin installer section title' ),
+ 'changelog' => _x( 'Changelog', 'Plugin installer section title' ),
+ 'reviews' => _x( 'Reviews', 'Plugin installer section title' ),
+ 'other_notes' => _x( 'Other Notes', 'Plugin installer section title' ),
+ );
+
+ // Sanitize HTML
+ foreach ( (array) $api->sections as $section_name => $content ) {
+ $api->sections[ $section_name ] = wp_kses( $content, $plugins_allowedtags );
+ }
+
+ foreach ( array( 'version', 'author', 'requires', 'tested', 'homepage', 'downloaded', 'slug' ) as $key ) {
+ if ( isset( $api->$key ) ) {
+ $api->$key = wp_kses( $api->$key, $plugins_allowedtags );
+ }
+ }
+
+ $_tab = esc_attr( $tab );
+
+ $section = isset( $_REQUEST['section'] ) ? wp_unslash( $_REQUEST['section'] ) : 'description'; // Default to the Description tab, Do not translate, API returns English.
+ if ( empty( $section ) || ! isset( $api->sections[ $section ] ) ) {
+ $section_titles = array_keys( (array) $api->sections );
+ $section = reset( $section_titles );
+ }
+
+ iframe_header( __( 'Plugin Installation' ) );
+
+ $_with_banner = '';
+
+ if ( ! empty( $api->banners ) && ( ! empty( $api->banners['low'] ) || ! empty( $api->banners['high'] ) ) ) {
+ $_with_banner = 'with-banner';
+ $low = empty( $api->banners['low'] ) ? $api->banners['high'] : $api->banners['low'];
+ $high = empty( $api->banners['high'] ) ? $api->banners['low'] : $api->banners['high'];
+ ?>
+ <style type="text/css">
+ #plugin-information-title.with-banner {
+ background-image: url( <?php echo esc_url( $low ); ?> );
+ }
+ @media only screen and ( -webkit-min-device-pixel-ratio: 1.5 ) {
+ #plugin-information-title.with-banner {
+ background-image: url( <?php echo esc_url( $high ); ?> );
+ }
+ }
+ </style>
+ <?php
+ }
+
+ echo '<div id="plugin-information-scrollable">';
+ echo "<div id='{$_tab}-title' class='{$_with_banner}'><div class='vignette'></div><h2>{$api->name}</h2></div>";
+ echo "<div id='{$_tab}-tabs' class='{$_with_banner}'>\n";
+
+ foreach ( (array) $api->sections as $section_name => $content ) {
+ if ( 'reviews' === $section_name && ( empty( $api->ratings ) || 0 === array_sum( (array) $api->ratings ) ) ) {
+ continue;
+ }
+
+ if ( isset( $plugins_section_titles[ $section_name ] ) ) {
+ $title = $plugins_section_titles[ $section_name ];
+ } else {
+ $title = ucwords( str_replace( '_', ' ', $section_name ) );
+ }
+
+ $class = ( $section_name === $section ) ? ' class="current"' : '';
+ $href = add_query_arg(
+ array(
+ 'tab' => $tab,
+ 'section' => $section_name,
+ )
+ );
+ $href = esc_url( $href );
+ $san_section = esc_attr( $section_name );
+ echo "\t<a name='$san_section' href='$href' $class>$title</a>\n";
+ }
+
+ echo "</div>\n";
+
+ ?>
+<div id="<?php echo $_tab; ?>-content" class='<?php echo $_with_banner; ?>'>
+ <div class="fyi">
+ <ul>
+ <?php if ( ! empty( $api->version ) ) { ?>
+ <li><strong><?php _e( 'Version:' ); ?></strong> <?php echo $api->version; ?></li>
+ <?php } if ( ! empty( $api->author ) ) { ?>
+ <li><strong><?php _e( 'Author:' ); ?></strong> <?php echo links_add_target( $api->author, '_blank' ); ?></li>
+ <?php } if ( ! empty( $api->last_updated ) ) { ?>
+ <li><strong><?php _e( 'Last Updated:' ); ?></strong>
+ <?php
+ /* translators: %s: Time since the last update */
+ printf( __( '%s ago' ), human_time_diff( strtotime( $api->last_updated ) ) );
+ ?>
+ </li>
+ <?php } if ( ! empty( $api->requires ) ) { ?>
+ <li>
+ <strong><?php _e( 'Requires WordPress Version:' ); ?></strong>
+ <?php
+ /* translators: %s: version number */
+ printf( __( '%s or higher' ), $api->requires );
+ ?>
+ </li>
+ <?php } if ( ! empty( $api->tested ) ) { ?>
+ <li><strong><?php _e( 'Compatible up to:' ); ?></strong> <?php echo $api->tested; ?></li>
+ <?php } if ( ! empty( $api->requires_php ) ) { ?>
+ <li>
+ <strong><?php _e( 'Requires PHP Version:' ); ?></strong>
+ <?php
+ /* translators: %s: version number */
+ printf( __( '%s or higher' ), $api->requires_php );
+ ?>
+ </li>
+ <?php } if ( isset( $api->active_installs ) ) { ?>
+ <li><strong><?php _e( 'Active Installations:' ); ?></strong>
+ <?php
+ if ( $api->active_installs >= 1000000 ) {
+ $active_installs_millions = floor( $api->active_installs / 1000000 );
+ printf(
+ _nx( '%s+ Million', '%s+ Million', $active_installs_millions, 'Active plugin installations' ),
+ number_format_i18n( $active_installs_millions )
+ );
+ } elseif ( 0 == $api->active_installs ) {
+ _ex( 'Less Than 10', 'Active plugin installations' );
+ } else {
+ echo number_format_i18n( $api->active_installs ) . '+';
+ }
+ ?>
+ </li>
+ <?php } if ( ! empty( $api->slug ) && empty( $api->external ) ) { ?>
+ <li><a target="_blank" href="<?php echo __( 'https://wordpress.org/plugins/' ) . $api->slug; ?>/"><?php _e( 'WordPress.org Plugin Page &#187;' ); ?></a></li>
+ <?php } if ( ! empty( $api->homepage ) ) { ?>
+ <li><a target="_blank" href="<?php echo esc_url( $api->homepage ); ?>"><?php _e( 'Plugin Homepage &#187;' ); ?></a></li>
+ <?php } if ( ! empty( $api->donate_link ) && empty( $api->contributors ) ) { ?>
+ <li><a target="_blank" href="<?php echo esc_url( $api->donate_link ); ?>"><?php _e( 'Donate to this plugin &#187;' ); ?></a></li>
+ <?php } ?>
+ </ul>
+ <?php if ( ! empty( $api->rating ) ) { ?>
+ <h3><?php _e( 'Average Rating' ); ?></h3>
+ <?php
+ wp_star_rating(
+ array(
+ 'rating' => $api->rating,
+ 'type' => 'percent',
+ 'number' => $api->num_ratings,
+ )
+ );
+ ?>
+ <p aria-hidden="true" class="fyi-description"><?php printf( _n( '(based on %s rating)', '(based on %s ratings)', $api->num_ratings ), number_format_i18n( $api->num_ratings ) ); ?></p>
+ <?php
+ }
+
+ if ( ! empty( $api->ratings ) && array_sum( (array) $api->ratings ) > 0 ) {
+ ?>
+ <h3><?php _e( 'Reviews' ); ?></h3>
+ <p class="fyi-description"><?php _e( 'Read all reviews on WordPress.org or write your own!' ); ?></p>
+ <?php
+ foreach ( $api->ratings as $key => $ratecount ) {
+ // Avoid div-by-zero.
+ $_rating = $api->num_ratings ? ( $ratecount / $api->num_ratings ) : 0;
+ /* translators: 1: number of stars (used to determine singular/plural), 2: number of reviews */
+ $aria_label = esc_attr(
+ sprintf(
+ _n( 'Reviews with %1$d star: %2$s. Opens in a new tab.', 'Reviews with %1$d stars: %2$s. Opens in a new tab.', $key ),
+ $key,
+ number_format_i18n( $ratecount )
+ )
+ );
+ ?>
+ <div class="counter-container">
+ <span class="counter-label">
+ <a href="https://wordpress.org/support/plugin/<?php echo $api->slug; ?>/reviews/?filter=<?php echo $key; ?>"
+ target="_blank" aria-label="<?php echo $aria_label; ?>"><?php printf( _n( '%d star', '%d stars', $key ), $key ); ?></a>
+ </span>
+ <span class="counter-back">
+ <span class="counter-bar" style="width: <?php echo 92 * $_rating; ?>px;"></span>
+ </span>
+ <span class="counter-count" aria-hidden="true"><?php echo number_format_i18n( $ratecount ); ?></span>
+ </div>
+ <?php
+ }
+ }
+ if ( ! empty( $api->contributors ) ) {
+ ?>
+ <h3><?php _e( 'Contributors' ); ?></h3>
+ <ul class="contributors">
+ <?php
+ foreach ( (array) $api->contributors as $contrib_username => $contrib_details ) {
+ $contrib_name = $contrib_details['display_name'];
+ if ( ! $contrib_name ) {
+ $contrib_name = $contrib_username;
+ }
+ $contrib_name = esc_html( $contrib_name );
+
+ $contrib_profile = esc_url( $contrib_details['profile'] );
+ $contrib_avatar = esc_url( add_query_arg( 's', '36', $contrib_details['avatar'] ) );
+
+ echo "<li><a href='{$contrib_profile}' target='_blank'><img src='{$contrib_avatar}' width='18' height='18' alt='' />{$contrib_name}</a></li>";
+ }
+ ?>
+ </ul>
+ <?php if ( ! empty( $api->donate_link ) ) { ?>
+ <a target="_blank" href="<?php echo esc_url( $api->donate_link ); ?>"><?php _e( 'Donate to this plugin &#187;' ); ?></a>
+ <?php } ?>
+ <?php } ?>
+ </div>
+ <div id="section-holder">
+ <?php
+ $requires_php = isset( $api->requires_php ) ? $api->requires_php : null;
+ $requires_wp = isset( $api->requires ) ? $api->requires : null;
+
+ $compatible_php = is_php_version_compatible( $requires_php );
+ $compatible_wp = is_wp_version_compatible( $requires_wp );
+ $tested_wp = ( empty( $api->tested ) || version_compare( get_bloginfo( 'version' ), $api->tested, '<=' ) );
+
+ if ( ! $compatible_php ) {
+ echo '<div class="notice notice-error notice-alt"><p>';
+ _e( '<strong>Error:</strong> This plugin <strong>requires a newer version of PHP</strong>.' );
+ if ( current_user_can( 'update_php' ) ) {
+ printf(
+ /* translators: %s: "Update PHP" page URL */
+ ' ' . __( '<a href="%s" target="_blank">Click here to learn more about updating PHP</a>.' ),
+ esc_url( wp_get_update_php_url() )
+ );
+
+ wp_update_php_annotation( '</p><p><em>', '</em>' );
+ } else {
+ echo '</p>';
+ }
+ echo '</div>';
+ }
+
+ if ( ! $tested_wp ) {
+ echo '<div class="notice notice-warning notice-alt"><p>';
+ _e( '<strong>Warning:</strong> This plugin <strong>has not been tested</strong> with your current version of WordPress.' );
+ echo '</p></div>';
+ } elseif ( ! $compatible_wp ) {
+ echo '<div class="notice notice-error notice-alt"><p>';
+ _e( '<strong>Error:</strong> This plugin <strong>requires a newer version of WordPress</strong>.' );
+ if ( current_user_can( 'update_core' ) ) {
+ printf(
+ /* translators: %s: "Update WordPress" screen URL */
+ ' ' . __( '<a href="%s" target="_parent">Click here to update WordPress</a>.' ),
+ self_admin_url( 'update-core.php' )
+ );
+ }
+ echo '</p></div>';
+ }
+
+ foreach ( (array) $api->sections as $section_name => $content ) {
+ $content = links_add_base_url( $content, 'https://wordpress.org/plugins/' . $api->slug . '/' );
+ $content = links_add_target( $content, '_blank' );
+
+ $san_section = esc_attr( $section_name );
+
+ $display = ( $section_name === $section ) ? 'block' : 'none';
+
+ echo "\t<div id='section-{$san_section}' class='section' style='display: {$display};'>\n";
+ echo $content;
+ echo "\t</div>\n";
+ }
+ echo "</div>\n";
+ echo "</div>\n";
+ echo "</div>\n"; // #plugin-information-scrollable
+ echo "<div id='$tab-footer'>\n";
+ if ( ! empty( $api->download_link ) && ( current_user_can( 'install_plugins' ) || current_user_can( 'update_plugins' ) ) ) {
+ $status = install_plugin_install_status( $api );
+ switch ( $status['status'] ) {
+ case 'install':
+ if ( $status['url'] ) {
+ if ( $compatible_php && $compatible_wp ) {
+ echo '<a data-slug="' . esc_attr( $api->slug ) . '" id="plugin_install_from_iframe" class="button button-primary right" href="' . $status['url'] . '" target="_parent">' . __( 'Install Now' ) . '</a>';
+ } else {
+ printf(
+ '<button type="button" class="button button-primary button-disabled right" disabled="disabled">%s</button>',
+ _x( 'Cannot Install', 'plugin' )
+ );
+ }
+ }
+ break;
+ case 'update_available':
+ if ( $status['url'] ) {
+ if ( $compatible_php ) {
+ echo '<a data-slug="' . esc_attr( $api->slug ) . '" data-plugin="' . esc_attr( $status['file'] ) . '" id="plugin_update_from_iframe" class="button button-primary right" href="' . $status['url'] . '" target="_parent">' . __( 'Install Update Now' ) . '</a>';
+ } else {
+ printf(
+ '<button type="button" class="button button-primary button-disabled right" disabled="disabled">%s</button>',
+ _x( 'Cannot Update', 'plugin' )
+ );
+ }
+ }
+ break;
+ case 'newer_installed':
+ /* translators: %s: Plugin version */
+ echo '<a class="button button-primary right disabled">' . sprintf( __( 'Newer Version (%s) Installed' ), $status['version'] ) . '</a>';
+ break;
+ case 'latest_installed':
+ echo '<a class="button button-primary right disabled">' . __( 'Latest Version Installed' ) . '</a>';
+ break;
+ }
+ }
+ echo "</div>\n";
+
+ iframe_footer();
+ exit;
+}
diff --git a/www/crm/wp-admin/includes/plugin.php b/www/crm/wp-admin/includes/plugin.php
new file mode 100644
index 00000000..7a1b0385
--- /dev/null
+++ b/www/crm/wp-admin/includes/plugin.php
@@ -0,0 +1,2323 @@
+<?php
+/**
+ * WordPress Plugin Administration API
+ *
+ * @package WordPress
+ * @subpackage Administration
+ */
+
+/**
+ * Parses the plugin contents to retrieve plugin's metadata.
+ *
+ * The metadata of the plugin's data searches for the following in the plugin's
+ * header. All plugin data must be on its own line. For plugin description, it
+ * must not have any newlines or only parts of the description will be displayed
+ * and the same goes for the plugin data. The below is formatted for printing.
+ *
+ * /*
+ * Plugin Name: Name of Plugin
+ * Plugin URI: Link to plugin information
+ * Description: Plugin Description
+ * Author: Plugin author's name
+ * Author URI: Link to the author's web site
+ * Version: Must be set in the plugin for WordPress 2.3+
+ * Text Domain: Optional. Unique identifier, should be same as the one used in
+ * load_plugin_textdomain()
+ * Domain Path: Optional. Only useful if the translations are located in a
+ * folder above the plugin's base path. For example, if .mo files are
+ * located in the locale folder then Domain Path will be "/locale/" and
+ * must have the first slash. Defaults to the base folder the plugin is
+ * located in.
+ * Network: Optional. Specify "Network: true" to require that a plugin is activated
+ * across all sites in an installation. This will prevent a plugin from being
+ * activated on a single site when Multisite is enabled.
+ * * / # Remove the space to close comment
+ *
+ * Some users have issues with opening large files and manipulating the contents
+ * for want is usually the first 1kiB or 2kiB. This function stops pulling in
+ * the plugin contents when it has all of the required plugin data.
+ *
+ * The first 8kiB of the file will be pulled in and if the plugin data is not
+ * within that first 8kiB, then the plugin author should correct their plugin
+ * and move the plugin data headers to the top.
+ *
+ * The plugin file is assumed to have permissions to allow for scripts to read
+ * the file. This is not checked however and the file is only opened for
+ * reading.
+ *
+ * @since 1.5.0
+ *
+ * @param string $plugin_file Absolute path to the main plugin file.
+ * @param bool $markup Optional. If the returned data should have HTML markup applied.
+ * Default true.
+ * @param bool $translate Optional. If the returned data should be translated. Default true.
+ * @return array {
+ * Plugin data. Values will be empty if not supplied by the plugin.
+ *
+ * @type string $Name Name of the plugin. Should be unique.
+ * @type string $Title Title of the plugin and link to the plugin's site (if set).
+ * @type string $Description Plugin description.
+ * @type string $Author Author's name.
+ * @type string $AuthorURI Author's website address (if set).
+ * @type string $Version Plugin version.
+ * @type string $TextDomain Plugin textdomain.
+ * @type string $DomainPath Plugins relative directory path to .mo files.
+ * @type bool $Network Whether the plugin can only be activated network-wide.
+ * }
+ */
+function get_plugin_data( $plugin_file, $markup = true, $translate = true ) {
+
+ $default_headers = array(
+ 'Name' => 'Plugin Name',
+ 'PluginURI' => 'Plugin URI',
+ 'Version' => 'Version',
+ 'Description' => 'Description',
+ 'Author' => 'Author',
+ 'AuthorURI' => 'Author URI',
+ 'TextDomain' => 'Text Domain',
+ 'DomainPath' => 'Domain Path',
+ 'Network' => 'Network',
+ // Site Wide Only is deprecated in favor of Network.
+ '_sitewide' => 'Site Wide Only',
+ );
+
+ $plugin_data = get_file_data( $plugin_file, $default_headers, 'plugin' );
+
+ // Site Wide Only is the old header for Network
+ if ( ! $plugin_data['Network'] && $plugin_data['_sitewide'] ) {
+ /* translators: 1: Site Wide Only: true, 2: Network: true */
+ _deprecated_argument( __FUNCTION__, '3.0.0', sprintf( __( 'The %1$s plugin header is deprecated. Use %2$s instead.' ), '<code>Site Wide Only: true</code>', '<code>Network: true</code>' ) );
+ $plugin_data['Network'] = $plugin_data['_sitewide'];
+ }
+ $plugin_data['Network'] = ( 'true' == strtolower( $plugin_data['Network'] ) );
+ unset( $plugin_data['_sitewide'] );
+
+ // If no text domain is defined fall back to the plugin slug.
+ if ( ! $plugin_data['TextDomain'] ) {
+ $plugin_slug = dirname( plugin_basename( $plugin_file ) );
+ if ( '.' !== $plugin_slug && false === strpos( $plugin_slug, '/' ) ) {
+ $plugin_data['TextDomain'] = $plugin_slug;
+ }
+ }
+
+ if ( $markup || $translate ) {
+ $plugin_data = _get_plugin_data_markup_translate( $plugin_file, $plugin_data, $markup, $translate );
+ } else {
+ $plugin_data['Title'] = $plugin_data['Name'];
+ $plugin_data['AuthorName'] = $plugin_data['Author'];
+ }
+
+ return $plugin_data;
+}
+
+/**
+ * Sanitizes plugin data, optionally adds markup, optionally translates.
+ *
+ * @since 2.7.0
+ *
+ * @see get_plugin_data()
+ *
+ * @access private
+ *
+ * @param string $plugin_file Path to the main plugin file.
+ * @param array $plugin_data An array of plugin data. See `get_plugin_data()`.
+ * @param bool $markup Optional. If the returned data should have HTML markup applied.
+ * Default true.
+ * @param bool $translate Optional. If the returned data should be translated. Default true.
+ * @return array {
+ * Plugin data. Values will be empty if not supplied by the plugin.
+ *
+ * @type string $Name Name of the plugin. Should be unique.
+ * @type string $Title Title of the plugin and link to the plugin's site (if set).
+ * @type string $Description Plugin description.
+ * @type string $Author Author's name.
+ * @type string $AuthorURI Author's website address (if set).
+ * @type string $Version Plugin version.
+ * @type string $TextDomain Plugin textdomain.
+ * @type string $DomainPath Plugins relative directory path to .mo files.
+ * @type bool $Network Whether the plugin can only be activated network-wide.
+ * }
+ */
+function _get_plugin_data_markup_translate( $plugin_file, $plugin_data, $markup = true, $translate = true ) {
+
+ // Sanitize the plugin filename to a WP_PLUGIN_DIR relative path
+ $plugin_file = plugin_basename( $plugin_file );
+
+ // Translate fields
+ if ( $translate ) {
+ if ( $textdomain = $plugin_data['TextDomain'] ) {
+ if ( ! is_textdomain_loaded( $textdomain ) ) {
+ if ( $plugin_data['DomainPath'] ) {
+ load_plugin_textdomain( $textdomain, false, dirname( $plugin_file ) . $plugin_data['DomainPath'] );
+ } else {
+ load_plugin_textdomain( $textdomain, false, dirname( $plugin_file ) );
+ }
+ }
+ } elseif ( 'hello.php' == basename( $plugin_file ) ) {
+ $textdomain = 'default';
+ }
+ if ( $textdomain ) {
+ foreach ( array( 'Name', 'PluginURI', 'Description', 'Author', 'AuthorURI', 'Version' ) as $field ) {
+ // phpcs:ignore WordPress.WP.I18n.LowLevelTranslationFunction,WordPress.WP.I18n.NonSingularStringLiteralText,WordPress.WP.I18n.NonSingularStringLiteralDomain
+ $plugin_data[ $field ] = translate( $plugin_data[ $field ], $textdomain );
+ }
+ }
+ }
+
+ // Sanitize fields
+ $allowed_tags_in_links = array(
+ 'abbr' => array( 'title' => true ),
+ 'acronym' => array( 'title' => true ),
+ 'code' => true,
+ 'em' => true,
+ 'strong' => true,
+ );
+
+ $allowed_tags = $allowed_tags_in_links;
+ $allowed_tags['a'] = array(
+ 'href' => true,
+ 'title' => true,
+ );
+
+ // Name is marked up inside <a> tags. Don't allow these.
+ // Author is too, but some plugins have used <a> here (omitting Author URI).
+ $plugin_data['Name'] = wp_kses( $plugin_data['Name'], $allowed_tags_in_links );
+ $plugin_data['Author'] = wp_kses( $plugin_data['Author'], $allowed_tags );
+
+ $plugin_data['Description'] = wp_kses( $plugin_data['Description'], $allowed_tags );
+ $plugin_data['Version'] = wp_kses( $plugin_data['Version'], $allowed_tags );
+
+ $plugin_data['PluginURI'] = esc_url( $plugin_data['PluginURI'] );
+ $plugin_data['AuthorURI'] = esc_url( $plugin_data['AuthorURI'] );
+
+ $plugin_data['Title'] = $plugin_data['Name'];
+ $plugin_data['AuthorName'] = $plugin_data['Author'];
+
+ // Apply markup
+ if ( $markup ) {
+ if ( $plugin_data['PluginURI'] && $plugin_data['Name'] ) {
+ $plugin_data['Title'] = '<a href="' . $plugin_data['PluginURI'] . '">' . $plugin_data['Name'] . '</a>';
+ }
+
+ if ( $plugin_data['AuthorURI'] && $plugin_data['Author'] ) {
+ $plugin_data['Author'] = '<a href="' . $plugin_data['AuthorURI'] . '">' . $plugin_data['Author'] . '</a>';
+ }
+
+ $plugin_data['Description'] = wptexturize( $plugin_data['Description'] );
+
+ if ( $plugin_data['Author'] ) {
+ $plugin_data['Description'] .= ' <cite>' . sprintf( __( 'By %s.' ), $plugin_data['Author'] ) . '</cite>';
+ }
+ }
+
+ return $plugin_data;
+}
+
+/**
+ * Get a list of a plugin's files.
+ *
+ * @since 2.8.0
+ *
+ * @param string $plugin Path to the plugin file relative to the plugins directory.
+ * @return array List of files relative to the plugin root.
+ */
+function get_plugin_files( $plugin ) {
+ $plugin_file = WP_PLUGIN_DIR . '/' . $plugin;
+ $dir = dirname( $plugin_file );
+
+ $plugin_files = array( plugin_basename( $plugin_file ) );
+
+ if ( is_dir( $dir ) && WP_PLUGIN_DIR !== $dir ) {
+
+ /**
+ * Filters the array of excluded directories and files while scanning the folder.
+ *
+ * @since 4.9.0
+ *
+ * @param string[] $exclusions Array of excluded directories and files.
+ */
+ $exclusions = (array) apply_filters( 'plugin_files_exclusions', array( 'CVS', 'node_modules', 'vendor', 'bower_components' ) );
+
+ $list_files = list_files( $dir, 100, $exclusions );
+ $list_files = array_map( 'plugin_basename', $list_files );
+
+ $plugin_files = array_merge( $plugin_files, $list_files );
+ $plugin_files = array_values( array_unique( $plugin_files ) );
+ }
+
+ return $plugin_files;
+}
+
+/**
+ * Check the plugins directory and retrieve all plugin files with plugin data.
+ *
+ * WordPress only supports plugin files in the base plugins directory
+ * (wp-content/plugins) and in one directory above the plugins directory
+ * (wp-content/plugins/my-plugin). The file it looks for has the plugin data
+ * and must be found in those two locations. It is recommended to keep your
+ * plugin files in their own directories.
+ *
+ * The file with the plugin data is the file that will be included and therefore
+ * needs to have the main execution for the plugin. This does not mean
+ * everything must be contained in the file and it is recommended that the file
+ * be split for maintainability. Keep everything in one file for extreme
+ * optimization purposes.
+ *
+ * @since 1.5.0
+ *
+ * @param string $plugin_folder Optional. Relative path to single plugin folder.
+ * @return array Key is the plugin file path and the value is an array of the plugin data.
+ */
+function get_plugins( $plugin_folder = '' ) {
+
+ $cache_plugins = wp_cache_get( 'plugins', 'plugins' );
+ if ( ! $cache_plugins ) {
+ $cache_plugins = array();
+ }
+
+ if ( isset( $cache_plugins[ $plugin_folder ] ) ) {
+ return $cache_plugins[ $plugin_folder ];
+ }
+
+ $wp_plugins = array();
+ $plugin_root = WP_PLUGIN_DIR;
+ if ( ! empty( $plugin_folder ) ) {
+ $plugin_root .= $plugin_folder;
+ }
+
+ // Files in wp-content/plugins directory
+ $plugins_dir = @ opendir( $plugin_root );
+ $plugin_files = array();
+ if ( $plugins_dir ) {
+ while ( ( $file = readdir( $plugins_dir ) ) !== false ) {
+ if ( substr( $file, 0, 1 ) == '.' ) {
+ continue;
+ }
+ if ( is_dir( $plugin_root . '/' . $file ) ) {
+ $plugins_subdir = @ opendir( $plugin_root . '/' . $file );
+ if ( $plugins_subdir ) {
+ while ( ( $subfile = readdir( $plugins_subdir ) ) !== false ) {
+ if ( substr( $subfile, 0, 1 ) == '.' ) {
+ continue;
+ }
+ if ( substr( $subfile, -4 ) == '.php' ) {
+ $plugin_files[] = "$file/$subfile";
+ }
+ }
+ closedir( $plugins_subdir );
+ }
+ } else {
+ if ( substr( $file, -4 ) == '.php' ) {
+ $plugin_files[] = $file;
+ }
+ }
+ }
+ closedir( $plugins_dir );
+ }
+
+ if ( empty( $plugin_files ) ) {
+ return $wp_plugins;
+ }
+
+ foreach ( $plugin_files as $plugin_file ) {
+ if ( ! is_readable( "$plugin_root/$plugin_file" ) ) {
+ continue;
+ }
+
+ $plugin_data = get_plugin_data( "$plugin_root/$plugin_file", false, false ); //Do not apply markup/translate as it'll be cached.
+
+ if ( empty( $plugin_data['Name'] ) ) {
+ continue;
+ }
+
+ $wp_plugins[ plugin_basename( $plugin_file ) ] = $plugin_data;
+ }
+
+ uasort( $wp_plugins, '_sort_uname_callback' );
+
+ $cache_plugins[ $plugin_folder ] = $wp_plugins;
+ wp_cache_set( 'plugins', $cache_plugins, 'plugins' );
+
+ return $wp_plugins;
+}
+
+/**
+ * Check the mu-plugins directory and retrieve all mu-plugin files with any plugin data.
+ *
+ * WordPress only includes mu-plugin files in the base mu-plugins directory (wp-content/mu-plugins).
+ *
+ * @since 3.0.0
+ * @return array Key is the mu-plugin file path and the value is an array of the mu-plugin data.
+ */
+function get_mu_plugins() {
+ $wp_plugins = array();
+ // Files in wp-content/mu-plugins directory
+ $plugin_files = array();
+
+ if ( ! is_dir( WPMU_PLUGIN_DIR ) ) {
+ return $wp_plugins;
+ }
+ if ( $plugins_dir = @ opendir( WPMU_PLUGIN_DIR ) ) {
+ while ( ( $file = readdir( $plugins_dir ) ) !== false ) {
+ if ( substr( $file, -4 ) == '.php' ) {
+ $plugin_files[] = $file;
+ }
+ }
+ } else {
+ return $wp_plugins;
+ }
+
+ @closedir( $plugins_dir );
+
+ if ( empty( $plugin_files ) ) {
+ return $wp_plugins;
+ }
+
+ foreach ( $plugin_files as $plugin_file ) {
+ if ( ! is_readable( WPMU_PLUGIN_DIR . "/$plugin_file" ) ) {
+ continue;
+ }
+
+ $plugin_data = get_plugin_data( WPMU_PLUGIN_DIR . "/$plugin_file", false, false ); //Do not apply markup/translate as it'll be cached.
+
+ if ( empty( $plugin_data['Name'] ) ) {
+ $plugin_data['Name'] = $plugin_file;
+ }
+
+ $wp_plugins[ $plugin_file ] = $plugin_data;
+ }
+
+ if ( isset( $wp_plugins['index.php'] ) && filesize( WPMU_PLUGIN_DIR . '/index.php' ) <= 30 ) { // silence is golden
+ unset( $wp_plugins['index.php'] );
+ }
+
+ uasort( $wp_plugins, '_sort_uname_callback' );
+
+ return $wp_plugins;
+}
+
+/**
+ * Callback to sort array by a 'Name' key.
+ *
+ * @since 3.1.0
+ *
+ * @access private
+ *
+ * @param array $a array with 'Name' key.
+ * @param array $b array with 'Name' key.
+ * @return int Return 0 or 1 based on two string comparison.
+ */
+function _sort_uname_callback( $a, $b ) {
+ return strnatcasecmp( $a['Name'], $b['Name'] );
+}
+
+/**
+ * Check the wp-content directory and retrieve all drop-ins with any plugin data.
+ *
+ * @since 3.0.0
+ * @return array Key is the file path and the value is an array of the plugin data.
+ */
+function get_dropins() {
+ $dropins = array();
+ $plugin_files = array();
+
+ $_dropins = _get_dropins();
+
+ // These exist in the wp-content directory
+ if ( $plugins_dir = @ opendir( WP_CONTENT_DIR ) ) {
+ while ( ( $file = readdir( $plugins_dir ) ) !== false ) {
+ if ( isset( $_dropins[ $file ] ) ) {
+ $plugin_files[] = $file;
+ }
+ }
+ } else {
+ return $dropins;
+ }
+
+ @closedir( $plugins_dir );
+
+ if ( empty( $plugin_files ) ) {
+ return $dropins;
+ }
+
+ foreach ( $plugin_files as $plugin_file ) {
+ if ( ! is_readable( WP_CONTENT_DIR . "/$plugin_file" ) ) {
+ continue;
+ }
+ $plugin_data = get_plugin_data( WP_CONTENT_DIR . "/$plugin_file", false, false ); //Do not apply markup/translate as it'll be cached.
+ if ( empty( $plugin_data['Name'] ) ) {
+ $plugin_data['Name'] = $plugin_file;
+ }
+ $dropins[ $plugin_file ] = $plugin_data;
+ }
+
+ uksort( $dropins, 'strnatcasecmp' );
+
+ return $dropins;
+}
+
+/**
+ * Returns drop-ins that WordPress uses.
+ *
+ * Includes Multisite drop-ins only when is_multisite()
+ *
+ * @since 3.0.0
+ * @return array Key is file name. The value is an array, with the first value the
+ * purpose of the drop-in and the second value the name of the constant that must be
+ * true for the drop-in to be used, or true if no constant is required.
+ */
+function _get_dropins() {
+ $dropins = array(
+ 'advanced-cache.php' => array( __( 'Advanced caching plugin.' ), 'WP_CACHE' ), // WP_CACHE
+ 'db.php' => array( __( 'Custom database class.' ), true ), // auto on load
+ 'db-error.php' => array( __( 'Custom database error message.' ), true ), // auto on error
+ 'install.php' => array( __( 'Custom installation script.' ), true ), // auto on installation
+ 'maintenance.php' => array( __( 'Custom maintenance message.' ), true ), // auto on maintenance
+ 'object-cache.php' => array( __( 'External object cache.' ), true ), // auto on load
+ 'php-error.php' => array( __( 'Custom PHP error message.' ), true ), // auto on error
+ 'fatal-error-handler.php' => array( __( 'Custom PHP fatal error handler.' ), true ), // auto on error
+ );
+
+ if ( is_multisite() ) {
+ $dropins['sunrise.php'] = array( __( 'Executed before Multisite is loaded.' ), 'SUNRISE' ); // SUNRISE
+ $dropins['blog-deleted.php'] = array( __( 'Custom site deleted message.' ), true ); // auto on deleted blog
+ $dropins['blog-inactive.php'] = array( __( 'Custom site inactive message.' ), true ); // auto on inactive blog
+ $dropins['blog-suspended.php'] = array( __( 'Custom site suspended message.' ), true ); // auto on archived or spammed blog
+ }
+
+ return $dropins;
+}
+
+/**
+ * Determines whether a plugin is active.
+ *
+ * Only plugins installed in the plugins/ folder can be active.
+ *
+ * Plugins in the mu-plugins/ folder can't be "activated," so this function will
+ * return false for those plugins.
+ *
+ * For more information on this and similar theme functions, check out
+ * the {@link https://developer.wordpress.org/themes/basics/conditional-tags/
+ * Conditional Tags} article in the Theme Developer Handbook.
+ *
+ * @since 2.5.0
+ *
+ * @param string $plugin Path to the plugin file relative to the plugins directory.
+ * @return bool True, if in the active plugins list. False, not in the list.
+ */
+function is_plugin_active( $plugin ) {
+ return in_array( $plugin, (array) get_option( 'active_plugins', array() ) ) || is_plugin_active_for_network( $plugin );
+}
+
+/**
+ * Determines whether the plugin is inactive.
+ *
+ * Reverse of is_plugin_active(). Used as a callback.
+ *
+ * For more information on this and similar theme functions, check out
+ * the {@link https://developer.wordpress.org/themes/basics/conditional-tags/
+ * Conditional Tags} article in the Theme Developer Handbook.
+ *
+ * @since 3.1.0
+ * @see is_plugin_active()
+ *
+ * @param string $plugin Path to the plugin file relative to the plugins directory.
+ * @return bool True if inactive. False if active.
+ */
+function is_plugin_inactive( $plugin ) {
+ return ! is_plugin_active( $plugin );
+}
+
+/**
+ * Determines whether the plugin is active for the entire network.
+ *
+ * Only plugins installed in the plugins/ folder can be active.
+ *
+ * Plugins in the mu-plugins/ folder can't be "activated," so this function will
+ * return false for those plugins.
+ *
+ * For more information on this and similar theme functions, check out
+ * the {@link https://developer.wordpress.org/themes/basics/conditional-tags/
+ * Conditional Tags} article in the Theme Developer Handbook.
+ *
+ * @since 3.0.0
+ *
+ * @param string $plugin Path to the plugin file relative to the plugins directory.
+ * @return bool True if active for the network, otherwise false.
+ */
+function is_plugin_active_for_network( $plugin ) {
+ if ( ! is_multisite() ) {
+ return false;
+ }
+
+ $plugins = get_site_option( 'active_sitewide_plugins' );
+ if ( isset( $plugins[ $plugin ] ) ) {
+ return true;
+ }
+
+ return false;
+}
+
+/**
+ * Checks for "Network: true" in the plugin header to see if this should
+ * be activated only as a network wide plugin. The plugin would also work
+ * when Multisite is not enabled.
+ *
+ * Checks for "Site Wide Only: true" for backward compatibility.
+ *
+ * @since 3.0.0
+ *
+ * @param string $plugin Path to the plugin file relative to the plugins directory.
+ * @return bool True if plugin is network only, false otherwise.
+ */
+function is_network_only_plugin( $plugin ) {
+ $plugin_data = get_plugin_data( WP_PLUGIN_DIR . '/' . $plugin );
+ if ( $plugin_data ) {
+ return $plugin_data['Network'];
+ }
+ return false;
+}
+
+/**
+ * Attempts activation of plugin in a "sandbox" and redirects on success.
+ *
+ * A plugin that is already activated will not attempt to be activated again.
+ *
+ * The way it works is by setting the redirection to the error before trying to
+ * include the plugin file. If the plugin fails, then the redirection will not
+ * be overwritten with the success message. Also, the options will not be
+ * updated and the activation hook will not be called on plugin error.
+ *
+ * It should be noted that in no way the below code will actually prevent errors
+ * within the file. The code should not be used elsewhere to replicate the
+ * "sandbox", which uses redirection to work.
+ * {@source 13 1}
+ *
+ * If any errors are found or text is outputted, then it will be captured to
+ * ensure that the success redirection will update the error redirection.
+ *
+ * @since 2.5.0
+ * @since 5.2.0 Test for WordPress version and PHP version compatibility.
+ *
+ * @param string $plugin Path to the plugin file relative to the plugins directory.
+ * @param string $redirect Optional. URL to redirect to.
+ * @param bool $network_wide Optional. Whether to enable the plugin for all sites in the network
+ * or just the current site. Multisite only. Default false.
+ * @param bool $silent Optional. Whether to prevent calling activation hooks. Default false.
+ * @return WP_Error|null WP_Error on invalid file or null on success.
+ */
+function activate_plugin( $plugin, $redirect = '', $network_wide = false, $silent = false ) {
+ $plugin = plugin_basename( trim( $plugin ) );
+
+ if ( is_multisite() && ( $network_wide || is_network_only_plugin( $plugin ) ) ) {
+ $network_wide = true;
+ $current = get_site_option( 'active_sitewide_plugins', array() );
+ $_GET['networkwide'] = 1; // Back compat for plugins looking for this value.
+ } else {
+ $current = get_option( 'active_plugins', array() );
+ }
+
+ $valid = validate_plugin( $plugin );
+ if ( is_wp_error( $valid ) ) {
+ return $valid;
+ }
+
+ $requirements = validate_plugin_requirements( $plugin );
+ if ( is_wp_error( $requirements ) ) {
+ return $requirements;
+ }
+
+ if ( ( $network_wide && ! isset( $current[ $plugin ] ) ) || ( ! $network_wide && ! in_array( $plugin, $current ) ) ) {
+ if ( ! empty( $redirect ) ) {
+ wp_redirect( add_query_arg( '_error_nonce', wp_create_nonce( 'plugin-activation-error_' . $plugin ), $redirect ) ); // we'll override this later if the plugin can be included without fatal error
+ }
+
+ ob_start();
+ wp_register_plugin_realpath( WP_PLUGIN_DIR . '/' . $plugin );
+ $_wp_plugin_file = $plugin;
+ if ( ! defined( 'WP_SANDBOX_SCRAPING' ) ) {
+ define( 'WP_SANDBOX_SCRAPING', true );
+ }
+ include_once( WP_PLUGIN_DIR . '/' . $plugin );
+ $plugin = $_wp_plugin_file; // Avoid stomping of the $plugin variable in a plugin.
+
+ if ( ! $silent ) {
+ /**
+ * Fires before a plugin is activated.
+ *
+ * If a plugin is silently activated (such as during an update),
+ * this hook does not fire.
+ *
+ * @since 2.9.0
+ *
+ * @param string $plugin Path to the plugin file relative to the plugins directory.
+ * @param bool $network_wide Whether to enable the plugin for all sites in the network
+ * or just the current site. Multisite only. Default is false.
+ */
+ do_action( 'activate_plugin', $plugin, $network_wide );
+
+ /**
+ * Fires as a specific plugin is being activated.
+ *
+ * This hook is the "activation" hook used internally by register_activation_hook().
+ * The dynamic portion of the hook name, `$plugin`, refers to the plugin basename.
+ *
+ * If a plugin is silently activated (such as during an update), this hook does not fire.
+ *
+ * @since 2.0.0
+ *
+ * @param bool $network_wide Whether to enable the plugin for all sites in the network
+ * or just the current site. Multisite only. Default is false.
+ */
+ do_action( "activate_{$plugin}", $network_wide );
+ }
+
+ if ( $network_wide ) {
+ $current = get_site_option( 'active_sitewide_plugins', array() );
+ $current[ $plugin ] = time();
+ update_site_option( 'active_sitewide_plugins', $current );
+ } else {
+ $current = get_option( 'active_plugins', array() );
+ $current[] = $plugin;
+ sort( $current );
+ update_option( 'active_plugins', $current );
+ }
+
+ if ( ! $silent ) {
+ /**
+ * Fires after a plugin has been activated.
+ *
+ * If a plugin is silently activated (such as during an update),
+ * this hook does not fire.
+ *
+ * @since 2.9.0
+ *
+ * @param string $plugin Path to the plugin file relative to the plugins directory.
+ * @param bool $network_wide Whether to enable the plugin for all sites in the network
+ * or just the current site. Multisite only. Default is false.
+ */
+ do_action( 'activated_plugin', $plugin, $network_wide );
+ }
+
+ if ( ob_get_length() > 0 ) {
+ $output = ob_get_clean();
+ return new WP_Error( 'unexpected_output', __( 'The plugin generated unexpected output.' ), $output );
+ }
+ ob_end_clean();
+ }
+
+ return null;
+}
+
+/**
+ * Deactivate a single plugin or multiple plugins.
+ *
+ * The deactivation hook is disabled by the plugin upgrader by using the $silent
+ * parameter.
+ *
+ * @since 2.5.0
+ *
+ * @param string|array $plugins Single plugin or list of plugins to deactivate.
+ * @param bool $silent Prevent calling deactivation hooks. Default is false.
+ * @param mixed $network_wide Whether to deactivate the plugin for all sites in the network.
+ * A value of null (the default) will deactivate plugins for both the site and the network.
+ */
+function deactivate_plugins( $plugins, $silent = false, $network_wide = null ) {
+ if ( is_multisite() ) {
+ $network_current = get_site_option( 'active_sitewide_plugins', array() );
+ }
+ $current = get_option( 'active_plugins', array() );
+ $do_blog = $do_network = false;
+
+ foreach ( (array) $plugins as $plugin ) {
+ $plugin = plugin_basename( trim( $plugin ) );
+ if ( ! is_plugin_active( $plugin ) ) {
+ continue;
+ }
+
+ $network_deactivating = false !== $network_wide && is_plugin_active_for_network( $plugin );
+
+ if ( ! $silent ) {
+ /**
+ * Fires before a plugin is deactivated.
+ *
+ * If a plugin is silently deactivated (such as during an update),
+ * this hook does not fire.
+ *
+ * @since 2.9.0
+ *
+ * @param string $plugin Path to the plugin file relative to the plugins directory.
+ * @param bool $network_deactivating Whether the plugin is deactivated for all sites in the network
+ * or just the current site. Multisite only. Default is false.
+ */
+ do_action( 'deactivate_plugin', $plugin, $network_deactivating );
+ }
+
+ if ( false !== $network_wide ) {
+ if ( is_plugin_active_for_network( $plugin ) ) {
+ $do_network = true;
+ unset( $network_current[ $plugin ] );
+ } elseif ( $network_wide ) {
+ continue;
+ }
+ }
+
+ if ( true !== $network_wide ) {
+ $key = array_search( $plugin, $current );
+ if ( false !== $key ) {
+ $do_blog = true;
+ unset( $current[ $key ] );
+ }
+ }
+
+ if ( $do_blog && wp_is_recovery_mode() ) {
+ list( $extension ) = explode( '/', $plugin );
+ wp_paused_plugins()->delete( $extension );
+ }
+
+ if ( ! $silent ) {
+ /**
+ * Fires as a specific plugin is being deactivated.
+ *
+ * This hook is the "deactivation" hook used internally by register_deactivation_hook().
+ * The dynamic portion of the hook name, `$plugin`, refers to the plugin basename.
+ *
+ * If a plugin is silently deactivated (such as during an update), this hook does not fire.
+ *
+ * @since 2.0.0
+ *
+ * @param bool $network_deactivating Whether the plugin is deactivated for all sites in the network
+ * or just the current site. Multisite only. Default is false.
+ */
+ do_action( "deactivate_{$plugin}", $network_deactivating );
+
+ /**
+ * Fires after a plugin is deactivated.
+ *
+ * If a plugin is silently deactivated (such as during an update),
+ * this hook does not fire.
+ *
+ * @since 2.9.0
+ *
+ * @param string $plugin Path to the plugin file relative to the plugins directory.
+ * @param bool $network_deactivating Whether the plugin is deactivated for all sites in the network.
+ * or just the current site. Multisite only. Default false.
+ */
+ do_action( 'deactivated_plugin', $plugin, $network_deactivating );
+ }
+ }
+
+ if ( $do_blog ) {
+ update_option( 'active_plugins', $current );
+ }
+ if ( $do_network ) {
+ update_site_option( 'active_sitewide_plugins', $network_current );
+ }
+}
+
+/**
+ * Activate multiple plugins.
+ *
+ * When WP_Error is returned, it does not mean that one of the plugins had
+ * errors. It means that one or more of the plugins file path was invalid.
+ *
+ * The execution will be halted as soon as one of the plugins has an error.
+ *
+ * @since 2.6.0
+ *
+ * @param string|array $plugins Single plugin or list of plugins to activate.
+ * @param string $redirect Redirect to page after successful activation.
+ * @param bool $network_wide Whether to enable the plugin for all sites in the network.
+ * @param bool $silent Prevent calling activation hooks. Default is false.
+ * @return bool|WP_Error True when finished or WP_Error if there were errors during a plugin activation.
+ */
+function activate_plugins( $plugins, $redirect = '', $network_wide = false, $silent = false ) {
+ if ( ! is_array( $plugins ) ) {
+ $plugins = array( $plugins );
+ }
+
+ $errors = array();
+ foreach ( $plugins as $plugin ) {
+ if ( ! empty( $redirect ) ) {
+ $redirect = add_query_arg( 'plugin', $plugin, $redirect );
+ }
+ $result = activate_plugin( $plugin, $redirect, $network_wide, $silent );
+ if ( is_wp_error( $result ) ) {
+ $errors[ $plugin ] = $result;
+ }
+ }
+
+ if ( ! empty( $errors ) ) {
+ return new WP_Error( 'plugins_invalid', __( 'One of the plugins is invalid.' ), $errors );
+ }
+
+ return true;
+}
+
+/**
+ * Remove directory and files of a plugin for a list of plugins.
+ *
+ * @since 2.6.0
+ *
+ * @global WP_Filesystem_Base $wp_filesystem WordPress filesystem subclass.
+ *
+ * @param string[] $plugins List of plugin paths to delete, relative to the plugins directory.
+ * @param string $deprecated Not used.
+ * @return bool|null|WP_Error True on success, false if `$plugins` is empty, `WP_Error` on failure.
+ * `null` if filesystem credentials are required to proceed.
+ */
+function delete_plugins( $plugins, $deprecated = '' ) {
+ global $wp_filesystem;
+
+ if ( empty( $plugins ) ) {
+ return false;
+ }
+
+ $checked = array();
+ foreach ( $plugins as $plugin ) {
+ $checked[] = 'checked[]=' . $plugin;
+ }
+
+ $url = wp_nonce_url( 'plugins.php?action=delete-selected&verify-delete=1&' . implode( '&', $checked ), 'bulk-plugins' );
+
+ ob_start();
+ $credentials = request_filesystem_credentials( $url );
+ $data = ob_get_clean();
+
+ if ( false === $credentials ) {
+ if ( ! empty( $data ) ) {
+ include_once( ABSPATH . 'wp-admin/admin-header.php' );
+ echo $data;
+ include( ABSPATH . 'wp-admin/admin-footer.php' );
+ exit;
+ }
+ return;
+ }
+
+ if ( ! WP_Filesystem( $credentials ) ) {
+ ob_start();
+ request_filesystem_credentials( $url, '', true ); // Failed to connect, Error and request again.
+ $data = ob_get_clean();
+
+ if ( ! empty( $data ) ) {
+ include_once( ABSPATH . 'wp-admin/admin-header.php' );
+ echo $data;
+ include( ABSPATH . 'wp-admin/admin-footer.php' );
+ exit;
+ }
+ return;
+ }
+
+ if ( ! is_object( $wp_filesystem ) ) {
+ return new WP_Error( 'fs_unavailable', __( 'Could not access filesystem.' ) );
+ }
+
+ if ( is_wp_error( $wp_filesystem->errors ) && $wp_filesystem->errors->has_errors() ) {
+ return new WP_Error( 'fs_error', __( 'Filesystem error.' ), $wp_filesystem->errors );
+ }
+
+ // Get the base plugin folder.
+ $plugins_dir = $wp_filesystem->wp_plugins_dir();
+ if ( empty( $plugins_dir ) ) {
+ return new WP_Error( 'fs_no_plugins_dir', __( 'Unable to locate WordPress plugin directory.' ) );
+ }
+
+ $plugins_dir = trailingslashit( $plugins_dir );
+
+ $plugin_translations = wp_get_installed_translations( 'plugins' );
+
+ $errors = array();
+
+ foreach ( $plugins as $plugin_file ) {
+ // Run Uninstall hook.
+ if ( is_uninstallable_plugin( $plugin_file ) ) {
+ uninstall_plugin( $plugin_file );
+ }
+
+ /**
+ * Fires immediately before a plugin deletion attempt.
+ *
+ * @since 4.4.0
+ *
+ * @param string $plugin_file Path to the plugin file relative to the plugins directory.
+ */
+ do_action( 'delete_plugin', $plugin_file );
+
+ $this_plugin_dir = trailingslashit( dirname( $plugins_dir . $plugin_file ) );
+
+ // If plugin is in its own directory, recursively delete the directory.
+ if ( strpos( $plugin_file, '/' ) && $this_plugin_dir != $plugins_dir ) { //base check on if plugin includes directory separator AND that it's not the root plugin folder
+ $deleted = $wp_filesystem->delete( $this_plugin_dir, true );
+ } else {
+ $deleted = $wp_filesystem->delete( $plugins_dir . $plugin_file );
+ }
+
+ /**
+ * Fires immediately after a plugin deletion attempt.
+ *
+ * @since 4.4.0
+ *
+ * @param string $plugin_file Path to the plugin file relative to the plugins directory.
+ * @param bool $deleted Whether the plugin deletion was successful.
+ */
+ do_action( 'deleted_plugin', $plugin_file, $deleted );
+
+ if ( ! $deleted ) {
+ $errors[] = $plugin_file;
+ continue;
+ }
+
+ // Remove language files, silently.
+ $plugin_slug = dirname( $plugin_file );
+ if ( '.' !== $plugin_slug && ! empty( $plugin_translations[ $plugin_slug ] ) ) {
+ $translations = $plugin_translations[ $plugin_slug ];
+
+ foreach ( $translations as $translation => $data ) {
+ $wp_filesystem->delete( WP_LANG_DIR . '/plugins/' . $plugin_slug . '-' . $translation . '.po' );
+ $wp_filesystem->delete( WP_LANG_DIR . '/plugins/' . $plugin_slug . '-' . $translation . '.mo' );
+
+ $json_translation_files = glob( WP_LANG_DIR . '/plugins/' . $plugin_slug . '-' . $translation . '-*.json' );
+ if ( $json_translation_files ) {
+ array_map( array( $wp_filesystem, 'delete' ), $json_translation_files );
+ }
+ }
+ }
+ }
+
+ // Remove deleted plugins from the plugin updates list.
+ if ( $current = get_site_transient( 'update_plugins' ) ) {
+ // Don't remove the plugins that weren't deleted.
+ $deleted = array_diff( $plugins, $errors );
+
+ foreach ( $deleted as $plugin_file ) {
+ unset( $current->response[ $plugin_file ] );
+ }
+
+ set_site_transient( 'update_plugins', $current );
+ }
+
+ if ( ! empty( $errors ) ) {
+ if ( 1 === count( $errors ) ) {
+ /* translators: %s: plugin filename */
+ $message = __( 'Could not fully remove the plugin %s.' );
+ } else {
+ /* translators: %s: comma-separated list of plugin filenames */
+ $message = __( 'Could not fully remove the plugins %s.' );
+ }
+
+ return new WP_Error( 'could_not_remove_plugin', sprintf( $message, implode( ', ', $errors ) ) );
+ }
+
+ return true;
+}
+
+/**
+ * Validate active plugins
+ *
+ * Validate all active plugins, deactivates invalid and
+ * returns an array of deactivated ones.
+ *
+ * @since 2.5.0
+ * @return array invalid plugins, plugin as key, error as value
+ */
+function validate_active_plugins() {
+ $plugins = get_option( 'active_plugins', array() );
+ // Validate vartype: array.
+ if ( ! is_array( $plugins ) ) {
+ update_option( 'active_plugins', array() );
+ $plugins = array();
+ }
+
+ if ( is_multisite() && current_user_can( 'manage_network_plugins' ) ) {
+ $network_plugins = (array) get_site_option( 'active_sitewide_plugins', array() );
+ $plugins = array_merge( $plugins, array_keys( $network_plugins ) );
+ }
+
+ if ( empty( $plugins ) ) {
+ return array();
+ }
+
+ $invalid = array();
+
+ // Invalid plugins get deactivated.
+ foreach ( $plugins as $plugin ) {
+ $result = validate_plugin( $plugin );
+ if ( is_wp_error( $result ) ) {
+ $invalid[ $plugin ] = $result;
+ deactivate_plugins( $plugin, true );
+ }
+ }
+ return $invalid;
+}
+
+/**
+ * Validate the plugin path.
+ *
+ * Checks that the main plugin file exists and is a valid plugin. See validate_file().
+ *
+ * @since 2.5.0
+ *
+ * @param string $plugin Path to the plugin file relative to the plugins directory.
+ * @return WP_Error|int 0 on success, WP_Error on failure.
+ */
+function validate_plugin( $plugin ) {
+ if ( validate_file( $plugin ) ) {
+ return new WP_Error( 'plugin_invalid', __( 'Invalid plugin path.' ) );
+ }
+ if ( ! file_exists( WP_PLUGIN_DIR . '/' . $plugin ) ) {
+ return new WP_Error( 'plugin_not_found', __( 'Plugin file does not exist.' ) );
+ }
+
+ $installed_plugins = get_plugins();
+ if ( ! isset( $installed_plugins[ $plugin ] ) ) {
+ return new WP_Error( 'no_plugin_header', __( 'The plugin does not have a valid header.' ) );
+ }
+ return 0;
+}
+
+/**
+ * Validate the plugin requirements for WP version and PHP version.
+ *
+ * @since 5.2.0
+ *
+ * @param string $plugin Path to the plugin file relative to the plugins directory.
+ * @return true|WP_Error True if requirements are met, WP_Error on failure.
+ */
+function validate_plugin_requirements( $plugin ) {
+ $readme_file = WP_PLUGIN_DIR . '/' . dirname( $plugin ) . '/readme.txt';
+
+ if ( file_exists( $readme_file ) ) {
+ $plugin_data = get_file_data(
+ $readme_file,
+ array(
+ 'requires' => 'Requires at least',
+ 'requires_php' => 'Requires PHP',
+ ),
+ 'plugin'
+ );
+ } else {
+ return true;
+ }
+
+ $plugin_data['wp_compatible'] = is_wp_version_compatible( $plugin_data['requires'] );
+ $plugin_data['php_compatible'] = is_php_version_compatible( $plugin_data['requires_php'] );
+
+ $plugin_data = array_merge( $plugin_data, get_plugin_data( WP_PLUGIN_DIR . '/' . $plugin ) );
+
+ if ( ! $plugin_data['wp_compatible'] && ! $plugin_data['php_compatible'] ) {
+ return new WP_Error(
+ 'plugin_wp_php_incompatible',
+ sprintf(
+ /* translators: %s: plugin name */
+ __( '<strong>Error:</strong> Current WordPress and PHP versions do not meet minimum requirements for %s.' ),
+ $plugin_data['Name']
+ )
+ );
+ } elseif ( ! $plugin_data['php_compatible'] ) {
+ return new WP_Error(
+ 'plugin_php_incompatible',
+ sprintf(
+ /* translators: %s: plugin name */
+ __( '<strong>Error:</strong> Current PHP version does not meet minimum requirements for %s.' ),
+ $plugin_data['Name']
+ )
+ );
+ } elseif ( ! $plugin_data['wp_compatible'] ) {
+ return new WP_Error(
+ 'plugin_wp_incompatible',
+ sprintf(
+ /* translators: %s: plugin name */
+ __( '<strong>Error:</strong> Current WordPress version does not meet minimum requirements for %s.' ),
+ $plugin_data['Name']
+ )
+ );
+ }
+
+ return true;
+}
+
+/**
+ * Whether the plugin can be uninstalled.
+ *
+ * @since 2.7.0
+ *
+ * @param string $plugin Path to the plugin file relative to the plugins directory.
+ * @return bool Whether plugin can be uninstalled.
+ */
+function is_uninstallable_plugin( $plugin ) {
+ $file = plugin_basename( $plugin );
+
+ $uninstallable_plugins = (array) get_option( 'uninstall_plugins' );
+ if ( isset( $uninstallable_plugins[ $file ] ) || file_exists( WP_PLUGIN_DIR . '/' . dirname( $file ) . '/uninstall.php' ) ) {
+ return true;
+ }
+
+ return false;
+}
+
+/**
+ * Uninstall a single plugin.
+ *
+ * Calls the uninstall hook, if it is available.
+ *
+ * @since 2.7.0
+ *
+ * @param string $plugin Path to the plugin file relative to the plugins directory.
+ * @return true True if a plugin's uninstall.php file has been found and included.
+ */
+function uninstall_plugin( $plugin ) {
+ $file = plugin_basename( $plugin );
+
+ $uninstallable_plugins = (array) get_option( 'uninstall_plugins' );
+
+ /**
+ * Fires in uninstall_plugin() immediately before the plugin is uninstalled.
+ *
+ * @since 4.5.0
+ *
+ * @param string $plugin Path to the plugin file relative to the plugins directory.
+ * @param array $uninstallable_plugins Uninstallable plugins.
+ */
+ do_action( 'pre_uninstall_plugin', $plugin, $uninstallable_plugins );
+
+ if ( file_exists( WP_PLUGIN_DIR . '/' . dirname( $file ) . '/uninstall.php' ) ) {
+ if ( isset( $uninstallable_plugins[ $file ] ) ) {
+ unset( $uninstallable_plugins[ $file ] );
+ update_option( 'uninstall_plugins', $uninstallable_plugins );
+ }
+ unset( $uninstallable_plugins );
+
+ define( 'WP_UNINSTALL_PLUGIN', $file );
+ wp_register_plugin_realpath( WP_PLUGIN_DIR . '/' . $file );
+ include( WP_PLUGIN_DIR . '/' . dirname( $file ) . '/uninstall.php' );
+
+ return true;
+ }
+
+ if ( isset( $uninstallable_plugins[ $file ] ) ) {
+ $callable = $uninstallable_plugins[ $file ];
+ unset( $uninstallable_plugins[ $file ] );
+ update_option( 'uninstall_plugins', $uninstallable_plugins );
+ unset( $uninstallable_plugins );
+
+ wp_register_plugin_realpath( WP_PLUGIN_DIR . '/' . $file );
+ include( WP_PLUGIN_DIR . '/' . $file );
+
+ add_action( "uninstall_{$file}", $callable );
+
+ /**
+ * Fires in uninstall_plugin() once the plugin has been uninstalled.
+ *
+ * The action concatenates the 'uninstall_' prefix with the basename of the
+ * plugin passed to uninstall_plugin() to create a dynamically-named action.
+ *
+ * @since 2.7.0
+ */
+ do_action( "uninstall_{$file}" );
+ }
+}
+
+//
+// Menu
+//
+
+/**
+ * Add a top-level menu page.
+ *
+ * This function takes a capability which will be used to determine whether
+ * or not a page is included in the menu.
+ *
+ * The function which is hooked in to handle the output of the page must check
+ * that the user has the required capability as well.
+ *
+ * @since 1.5.0
+ *
+ * @global array $menu
+ * @global array $admin_page_hooks
+ * @global array $_registered_pages
+ * @global array $_parent_pages
+ *
+ * @param string $page_title The text to be displayed in the title tags of the page when the menu is selected.
+ * @param string $menu_title The text to be used for the menu.
+ * @param string $capability The capability required for this menu to be displayed to the user.
+ * @param string $menu_slug The slug name to refer to this menu by. Should be unique for this menu page and only
+ * include lowercase alphanumeric, dashes, and underscores characters to be compatible
+ * with sanitize_key().
+ * @param callable $function The function to be called to output the content for this page.
+ * @param string $icon_url The URL to the icon to be used for this menu.
+ * * Pass a base64-encoded SVG using a data URI, which will be colored to match
+ * the color scheme. This should begin with 'data:image/svg+xml;base64,'.
+ * * Pass the name of a Dashicons helper class to use a font icon,
+ * e.g. 'dashicons-chart-pie'.
+ * * Pass 'none' to leave div.wp-menu-image empty so an icon can be added via CSS.
+ * @param int $position The position in the menu order this one should appear.
+ * @return string The resulting page's hook_suffix.
+ */
+function add_menu_page( $page_title, $menu_title, $capability, $menu_slug, $function = '', $icon_url = '', $position = null ) {
+ global $menu, $admin_page_hooks, $_registered_pages, $_parent_pages;
+
+ $menu_slug = plugin_basename( $menu_slug );
+
+ $admin_page_hooks[ $menu_slug ] = sanitize_title( $menu_title );
+
+ $hookname = get_plugin_page_hookname( $menu_slug, '' );
+
+ if ( ! empty( $function ) && ! empty( $hookname ) && current_user_can( $capability ) ) {
+ add_action( $hookname, $function );
+ }
+
+ if ( empty( $icon_url ) ) {
+ $icon_url = 'dashicons-admin-generic';
+ $icon_class = 'menu-icon-generic ';
+ } else {
+ $icon_url = set_url_scheme( $icon_url );
+ $icon_class = '';
+ }
+
+ $new_menu = array( $menu_title, $capability, $menu_slug, $page_title, 'menu-top ' . $icon_class . $hookname, $hookname, $icon_url );
+
+ if ( null === $position ) {
+ $menu[] = $new_menu;
+ } elseif ( isset( $menu[ "$position" ] ) ) {
+ $position = $position + substr( base_convert( md5( $menu_slug . $menu_title ), 16, 10 ), -5 ) * 0.00001;
+ $menu[ "$position" ] = $new_menu;
+ } else {
+ $menu[ $position ] = $new_menu;
+ }
+
+ $_registered_pages[ $hookname ] = true;
+
+ // No parent as top level
+ $_parent_pages[ $menu_slug ] = false;
+
+ return $hookname;
+}
+
+/**
+ * Add a submenu page.
+ *
+ * This function takes a capability which will be used to determine whether
+ * or not a page is included in the menu.
+ *
+ * The function which is hooked in to handle the output of the page must check
+ * that the user has the required capability as well.
+ *
+ * @since 1.5.0
+ *
+ * @global array $submenu
+ * @global array $menu
+ * @global array $_wp_real_parent_file
+ * @global bool $_wp_submenu_nopriv
+ * @global array $_registered_pages
+ * @global array $_parent_pages
+ *
+ * @param string $parent_slug The slug name for the parent menu (or the file name of a standard
+ * WordPress admin page).
+ * @param string $page_title The text to be displayed in the title tags of the page when the menu
+ * is selected.
+ * @param string $menu_title The text to be used for the menu.
+ * @param string $capability The capability required for this menu to be displayed to the user.
+ * @param string $menu_slug The slug name to refer to this menu by. Should be unique for this menu
+ * and only include lowercase alphanumeric, dashes, and underscores characters
+ * to be compatible with sanitize_key().
+ * @param callable $function The function to be called to output the content for this page.
+ * @return false|string The resulting page's hook_suffix, or false if the user does not have the capability required.
+ */
+function add_submenu_page( $parent_slug, $page_title, $menu_title, $capability, $menu_slug, $function = '' ) {
+ global $submenu, $menu, $_wp_real_parent_file, $_wp_submenu_nopriv,
+ $_registered_pages, $_parent_pages;
+
+ $menu_slug = plugin_basename( $menu_slug );
+ $parent_slug = plugin_basename( $parent_slug );
+
+ if ( isset( $_wp_real_parent_file[ $parent_slug ] ) ) {
+ $parent_slug = $_wp_real_parent_file[ $parent_slug ];
+ }
+
+ if ( ! current_user_can( $capability ) ) {
+ $_wp_submenu_nopriv[ $parent_slug ][ $menu_slug ] = true;
+ return false;
+ }
+
+ /*
+ * If the parent doesn't already have a submenu, add a link to the parent
+ * as the first item in the submenu. If the submenu file is the same as the
+ * parent file someone is trying to link back to the parent manually. In
+ * this case, don't automatically add a link back to avoid duplication.
+ */
+ if ( ! isset( $submenu[ $parent_slug ] ) && $menu_slug != $parent_slug ) {
+ foreach ( (array) $menu as $parent_menu ) {
+ if ( $parent_menu[2] == $parent_slug && current_user_can( $parent_menu[1] ) ) {
+ $submenu[ $parent_slug ][] = array_slice( $parent_menu, 0, 4 );
+ }
+ }
+ }
+
+ $submenu[ $parent_slug ][] = array( $menu_title, $capability, $menu_slug, $page_title );
+
+ $hookname = get_plugin_page_hookname( $menu_slug, $parent_slug );
+ if ( ! empty( $function ) && ! empty( $hookname ) ) {
+ add_action( $hookname, $function );
+ }
+
+ $_registered_pages[ $hookname ] = true;
+
+ /*
+ * Backward-compatibility for plugins using add_management_page().
+ * See wp-admin/admin.php for redirect from edit.php to tools.php.
+ */
+ if ( 'tools.php' == $parent_slug ) {
+ $_registered_pages[ get_plugin_page_hookname( $menu_slug, 'edit.php' ) ] = true;
+ }
+
+ // No parent as top level.
+ $_parent_pages[ $menu_slug ] = $parent_slug;
+
+ return $hookname;
+}
+
+/**
+ * Add submenu page to the Tools main menu.
+ *
+ * This function takes a capability which will be used to determine whether
+ * or not a page is included in the menu.
+ *
+ * The function which is hooked in to handle the output of the page must check
+ * that the user has the required capability as well.
+ *
+ * @since 1.5.0
+ *
+ * @param string $page_title The text to be displayed in the title tags of the page when the menu is selected.
+ * @param string $menu_title The text to be used for the menu.
+ * @param string $capability The capability required for this menu to be displayed to the user.
+ * @param string $menu_slug The slug name to refer to this menu by (should be unique for this menu).
+ * @param callable $function The function to be called to output the content for this page.
+ * @return false|string The resulting page's hook_suffix, or false if the user does not have the capability required.
+ */
+function add_management_page( $page_title, $menu_title, $capability, $menu_slug, $function = '' ) {
+ return add_submenu_page( 'tools.php', $page_title, $menu_title, $capability, $menu_slug, $function );
+}
+
+/**
+ * Add submenu page to the Settings main menu.
+ *
+ * This function takes a capability which will be used to determine whether
+ * or not a page is included in the menu.
+ *
+ * The function which is hooked in to handle the output of the page must check
+ * that the user has the required capability as well.
+ *
+ * @since 1.5.0
+ *
+ * @param string $page_title The text to be displayed in the title tags of the page when the menu is selected.
+ * @param string $menu_title The text to be used for the menu.
+ * @param string $capability The capability required for this menu to be displayed to the user.
+ * @param string $menu_slug The slug name to refer to this menu by (should be unique for this menu).
+ * @param callable $function The function to be called to output the content for this page.
+ * @return false|string The resulting page's hook_suffix, or false if the user does not have the capability required.
+ */
+function add_options_page( $page_title, $menu_title, $capability, $menu_slug, $function = '' ) {
+ return add_submenu_page( 'options-general.php', $page_title, $menu_title, $capability, $menu_slug, $function );
+}
+
+/**
+ * Add submenu page to the Appearance main menu.
+ *
+ * This function takes a capability which will be used to determine whether
+ * or not a page is included in the menu.
+ *
+ * The function which is hooked in to handle the output of the page must check
+ * that the user has the required capability as well.
+ *
+ * @since 2.0.0
+ *
+ * @param string $page_title The text to be displayed in the title tags of the page when the menu is selected.
+ * @param string $menu_title The text to be used for the menu.
+ * @param string $capability The capability required for this menu to be displayed to the user.
+ * @param string $menu_slug The slug name to refer to this menu by (should be unique for this menu).
+ * @param callable $function The function to be called to output the content for this page.
+ * @return false|string The resulting page's hook_suffix, or false if the user does not have the capability required.
+ */
+function add_theme_page( $page_title, $menu_title, $capability, $menu_slug, $function = '' ) {
+ return add_submenu_page( 'themes.php', $page_title, $menu_title, $capability, $menu_slug, $function );
+}
+
+/**
+ * Add submenu page to the Plugins main menu.
+ *
+ * This function takes a capability which will be used to determine whether
+ * or not a page is included in the menu.
+ *
+ * The function which is hooked in to handle the output of the page must check
+ * that the user has the required capability as well.
+ *
+ * @since 3.0.0
+ *
+ * @param string $page_title The text to be displayed in the title tags of the page when the menu is selected.
+ * @param string $menu_title The text to be used for the menu.
+ * @param string $capability The capability required for this menu to be displayed to the user.
+ * @param string $menu_slug The slug name to refer to this menu by (should be unique for this menu).
+ * @param callable $function The function to be called to output the content for this page.
+ * @return false|string The resulting page's hook_suffix, or false if the user does not have the capability required.
+ */
+function add_plugins_page( $page_title, $menu_title, $capability, $menu_slug, $function = '' ) {
+ return add_submenu_page( 'plugins.php', $page_title, $menu_title, $capability, $menu_slug, $function );
+}
+
+/**
+ * Add submenu page to the Users/Profile main menu.
+ *
+ * This function takes a capability which will be used to determine whether
+ * or not a page is included in the menu.
+ *
+ * The function which is hooked in to handle the output of the page must check
+ * that the user has the required capability as well.
+ *
+ * @since 2.1.3
+ *
+ * @param string $page_title The text to be displayed in the title tags of the page when the menu is selected.
+ * @param string $menu_title The text to be used for the menu.
+ * @param string $capability The capability required for this menu to be displayed to the user.
+ * @param string $menu_slug The slug name to refer to this menu by (should be unique for this menu).
+ * @param callable $function The function to be called to output the content for this page.
+ * @return false|string The resulting page's hook_suffix, or false if the user does not have the capability required.
+ */
+function add_users_page( $page_title, $menu_title, $capability, $menu_slug, $function = '' ) {
+ if ( current_user_can( 'edit_users' ) ) {
+ $parent = 'users.php';
+ } else {
+ $parent = 'profile.php';
+ }
+ return add_submenu_page( $parent, $page_title, $menu_title, $capability, $menu_slug, $function );
+}
+/**
+ * Add submenu page to the Dashboard main menu.
+ *
+ * This function takes a capability which will be used to determine whether
+ * or not a page is included in the menu.
+ *
+ * The function which is hooked in to handle the output of the page must check
+ * that the user has the required capability as well.
+ *
+ * @since 2.7.0
+ *
+ * @param string $page_title The text to be displayed in the title tags of the page when the menu is selected.
+ * @param string $menu_title The text to be used for the menu.
+ * @param string $capability The capability required for this menu to be displayed to the user.
+ * @param string $menu_slug The slug name to refer to this menu by (should be unique for this menu).
+ * @param callable $function The function to be called to output the content for this page.
+ * @return false|string The resulting page's hook_suffix, or false if the user does not have the capability required.
+ */
+function add_dashboard_page( $page_title, $menu_title, $capability, $menu_slug, $function = '' ) {
+ return add_submenu_page( 'index.php', $page_title, $menu_title, $capability, $menu_slug, $function );
+}
+
+/**
+ * Add submenu page to the Posts main menu.
+ *
+ * This function takes a capability which will be used to determine whether
+ * or not a page is included in the menu.
+ *
+ * The function which is hooked in to handle the output of the page must check
+ * that the user has the required capability as well.
+ *
+ * @since 2.7.0
+ *
+ * @param string $page_title The text to be displayed in the title tags of the page when the menu is selected.
+ * @param string $menu_title The text to be used for the menu.
+ * @param string $capability The capability required for this menu to be displayed to the user.
+ * @param string $menu_slug The slug name to refer to this menu by (should be unique for this menu).
+ * @param callable $function The function to be called to output the content for this page.
+ * @return false|string The resulting page's hook_suffix, or false if the user does not have the capability required.
+ */
+function add_posts_page( $page_title, $menu_title, $capability, $menu_slug, $function = '' ) {
+ return add_submenu_page( 'edit.php', $page_title, $menu_title, $capability, $menu_slug, $function );
+}
+
+/**
+ * Add submenu page to the Media main menu.
+ *
+ * This function takes a capability which will be used to determine whether
+ * or not a page is included in the menu.
+ *
+ * The function which is hooked in to handle the output of the page must check
+ * that the user has the required capability as well.
+ *
+ * @since 2.7.0
+ *
+ * @param string $page_title The text to be displayed in the title tags of the page when the menu is selected.
+ * @param string $menu_title The text to be used for the menu.
+ * @param string $capability The capability required for this menu to be displayed to the user.
+ * @param string $menu_slug The slug name to refer to this menu by (should be unique for this menu).
+ * @param callable $function The function to be called to output the content for this page.
+ * @return false|string The resulting page's hook_suffix, or false if the user does not have the capability required.
+ */
+function add_media_page( $page_title, $menu_title, $capability, $menu_slug, $function = '' ) {
+ return add_submenu_page( 'upload.php', $page_title, $menu_title, $capability, $menu_slug, $function );
+}
+
+/**
+ * Add submenu page to the Links main menu.
+ *
+ * This function takes a capability which will be used to determine whether
+ * or not a page is included in the menu.
+ *
+ * The function which is hooked in to handle the output of the page must check
+ * that the user has the required capability as well.
+ *
+ * @since 2.7.0
+ *
+ * @param string $page_title The text to be displayed in the title tags of the page when the menu is selected.
+ * @param string $menu_title The text to be used for the menu.
+ * @param string $capability The capability required for this menu to be displayed to the user.
+ * @param string $menu_slug The slug name to refer to this menu by (should be unique for this menu).
+ * @param callable $function The function to be called to output the content for this page.
+ * @return false|string The resulting page's hook_suffix, or false if the user does not have the capability required.
+ */
+function add_links_page( $page_title, $menu_title, $capability, $menu_slug, $function = '' ) {
+ return add_submenu_page( 'link-manager.php', $page_title, $menu_title, $capability, $menu_slug, $function );
+}
+
+/**
+ * Add submenu page to the Pages main menu.
+ *
+ * This function takes a capability which will be used to determine whether
+ * or not a page is included in the menu.
+ *
+ * The function which is hooked in to handle the output of the page must check
+ * that the user has the required capability as well.
+ *
+ * @since 2.7.0
+ *
+ * @param string $page_title The text to be displayed in the title tags of the page when the menu is selected.
+ * @param string $menu_title The text to be used for the menu.
+ * @param string $capability The capability required for this menu to be displayed to the user.
+ * @param string $menu_slug The slug name to refer to this menu by (should be unique for this menu).
+ * @param callable $function The function to be called to output the content for this page.
+ * @return false|string The resulting page's hook_suffix, or false if the user does not have the capability required.
+ */
+function add_pages_page( $page_title, $menu_title, $capability, $menu_slug, $function = '' ) {
+ return add_submenu_page( 'edit.php?post_type=page', $page_title, $menu_title, $capability, $menu_slug, $function );
+}
+
+/**
+ * Add submenu page to the Comments main menu.
+ *
+ * This function takes a capability which will be used to determine whether
+ * or not a page is included in the menu.
+ *
+ * The function which is hooked in to handle the output of the page must check
+ * that the user has the required capability as well.
+ *
+ * @since 2.7.0
+ *
+ * @param string $page_title The text to be displayed in the title tags of the page when the menu is selected.
+ * @param string $menu_title The text to be used for the menu.
+ * @param string $capability The capability required for this menu to be displayed to the user.
+ * @param string $menu_slug The slug name to refer to this menu by (should be unique for this menu).
+ * @param callable $function The function to be called to output the content for this page.
+ * @return false|string The resulting page's hook_suffix, or false if the user does not have the capability required.
+ */
+function add_comments_page( $page_title, $menu_title, $capability, $menu_slug, $function = '' ) {
+ return add_submenu_page( 'edit-comments.php', $page_title, $menu_title, $capability, $menu_slug, $function );
+}
+
+/**
+ * Remove a top-level admin menu.
+ *
+ * @since 3.1.0
+ *
+ * @global array $menu
+ *
+ * @param string $menu_slug The slug of the menu.
+ * @return array|bool The removed menu on success, false if not found.
+ */
+function remove_menu_page( $menu_slug ) {
+ global $menu;
+
+ foreach ( $menu as $i => $item ) {
+ if ( $menu_slug == $item[2] ) {
+ unset( $menu[ $i ] );
+ return $item;
+ }
+ }
+
+ return false;
+}
+
+/**
+ * Remove an admin submenu.
+ *
+ * @since 3.1.0
+ *
+ * @global array $submenu
+ *
+ * @param string $menu_slug The slug for the parent menu.
+ * @param string $submenu_slug The slug of the submenu.
+ * @return array|bool The removed submenu on success, false if not found.
+ */
+function remove_submenu_page( $menu_slug, $submenu_slug ) {
+ global $submenu;
+
+ if ( ! isset( $submenu[ $menu_slug ] ) ) {
+ return false;
+ }
+
+ foreach ( $submenu[ $menu_slug ] as $i => $item ) {
+ if ( $submenu_slug == $item[2] ) {
+ unset( $submenu[ $menu_slug ][ $i ] );
+ return $item;
+ }
+ }
+
+ return false;
+}
+
+/**
+ * Get the url to access a particular menu page based on the slug it was registered with.
+ *
+ * If the slug hasn't been registered properly no url will be returned
+ *
+ * @since 3.0.0
+ *
+ * @global array $_parent_pages
+ *
+ * @param string $menu_slug The slug name to refer to this menu by (should be unique for this menu)
+ * @param bool $echo Whether or not to echo the url - default is true
+ * @return string the url
+ */
+function menu_page_url( $menu_slug, $echo = true ) {
+ global $_parent_pages;
+
+ if ( isset( $_parent_pages[ $menu_slug ] ) ) {
+ $parent_slug = $_parent_pages[ $menu_slug ];
+ if ( $parent_slug && ! isset( $_parent_pages[ $parent_slug ] ) ) {
+ $url = admin_url( add_query_arg( 'page', $menu_slug, $parent_slug ) );
+ } else {
+ $url = admin_url( 'admin.php?page=' . $menu_slug );
+ }
+ } else {
+ $url = '';
+ }
+
+ $url = esc_url( $url );
+
+ if ( $echo ) {
+ echo $url;
+ }
+
+ return $url;
+}
+
+//
+// Pluggable Menu Support -- Private
+//
+/**
+ * @global string $parent_file
+ * @global array $menu
+ * @global array $submenu
+ * @global string $pagenow
+ * @global string $typenow
+ * @global string $plugin_page
+ * @global array $_wp_real_parent_file
+ * @global array $_wp_menu_nopriv
+ * @global array $_wp_submenu_nopriv
+ *
+ * @return string
+ */
+function get_admin_page_parent( $parent = '' ) {
+ global $parent_file, $menu, $submenu, $pagenow, $typenow,
+ $plugin_page, $_wp_real_parent_file, $_wp_menu_nopriv, $_wp_submenu_nopriv;
+
+ if ( ! empty( $parent ) && 'admin.php' != $parent ) {
+ if ( isset( $_wp_real_parent_file[ $parent ] ) ) {
+ $parent = $_wp_real_parent_file[ $parent ];
+ }
+ return $parent;
+ }
+
+ if ( $pagenow == 'admin.php' && isset( $plugin_page ) ) {
+ foreach ( (array) $menu as $parent_menu ) {
+ if ( $parent_menu[2] == $plugin_page ) {
+ $parent_file = $plugin_page;
+ if ( isset( $_wp_real_parent_file[ $parent_file ] ) ) {
+ $parent_file = $_wp_real_parent_file[ $parent_file ];
+ }
+ return $parent_file;
+ }
+ }
+ if ( isset( $_wp_menu_nopriv[ $plugin_page ] ) ) {
+ $parent_file = $plugin_page;
+ if ( isset( $_wp_real_parent_file[ $parent_file ] ) ) {
+ $parent_file = $_wp_real_parent_file[ $parent_file ];
+ }
+ return $parent_file;
+ }
+ }
+
+ if ( isset( $plugin_page ) && isset( $_wp_submenu_nopriv[ $pagenow ][ $plugin_page ] ) ) {
+ $parent_file = $pagenow;
+ if ( isset( $_wp_real_parent_file[ $parent_file ] ) ) {
+ $parent_file = $_wp_real_parent_file[ $parent_file ];
+ }
+ return $parent_file;
+ }
+
+ foreach ( array_keys( (array) $submenu ) as $parent ) {
+ foreach ( $submenu[ $parent ] as $submenu_array ) {
+ if ( isset( $_wp_real_parent_file[ $parent ] ) ) {
+ $parent = $_wp_real_parent_file[ $parent ];
+ }
+ if ( ! empty( $typenow ) && ( $submenu_array[2] == "$pagenow?post_type=$typenow" ) ) {
+ $parent_file = $parent;
+ return $parent;
+ } elseif ( $submenu_array[2] == $pagenow && empty( $typenow ) && ( empty( $parent_file ) || false === strpos( $parent_file, '?' ) ) ) {
+ $parent_file = $parent;
+ return $parent;
+ } elseif ( isset( $plugin_page ) && ( $plugin_page == $submenu_array[2] ) ) {
+ $parent_file = $parent;
+ return $parent;
+ }
+ }
+ }
+
+ if ( empty( $parent_file ) ) {
+ $parent_file = '';
+ }
+ return '';
+}
+
+/**
+ * @global string $title
+ * @global array $menu
+ * @global array $submenu
+ * @global string $pagenow
+ * @global string $plugin_page
+ * @global string $typenow
+ *
+ * @return string
+ */
+function get_admin_page_title() {
+ global $title, $menu, $submenu, $pagenow, $plugin_page, $typenow;
+
+ if ( ! empty( $title ) ) {
+ return $title;
+ }
+
+ $hook = get_plugin_page_hook( $plugin_page, $pagenow );
+
+ $parent = $parent1 = get_admin_page_parent();
+
+ if ( empty( $parent ) ) {
+ foreach ( (array) $menu as $menu_array ) {
+ if ( isset( $menu_array[3] ) ) {
+ if ( $menu_array[2] == $pagenow ) {
+ $title = $menu_array[3];
+ return $menu_array[3];
+ } elseif ( isset( $plugin_page ) && ( $plugin_page == $menu_array[2] ) && ( $hook == $menu_array[3] ) ) {
+ $title = $menu_array[3];
+ return $menu_array[3];
+ }
+ } else {
+ $title = $menu_array[0];
+ return $title;
+ }
+ }
+ } else {
+ foreach ( array_keys( $submenu ) as $parent ) {
+ foreach ( $submenu[ $parent ] as $submenu_array ) {
+ if ( isset( $plugin_page ) &&
+ ( $plugin_page == $submenu_array[2] ) &&
+ (
+ ( $parent == $pagenow ) ||
+ ( $parent == $plugin_page ) ||
+ ( $plugin_page == $hook ) ||
+ ( $pagenow == 'admin.php' && $parent1 != $submenu_array[2] ) ||
+ ( ! empty( $typenow ) && $parent == $pagenow . '?post_type=' . $typenow )
+ )
+ ) {
+ $title = $submenu_array[3];
+ return $submenu_array[3];
+ }
+
+ if ( $submenu_array[2] != $pagenow || isset( $_GET['page'] ) ) { // not the current page
+ continue;
+ }
+
+ if ( isset( $submenu_array[3] ) ) {
+ $title = $submenu_array[3];
+ return $submenu_array[3];
+ } else {
+ $title = $submenu_array[0];
+ return $title;
+ }
+ }
+ }
+ if ( empty( $title ) ) {
+ foreach ( $menu as $menu_array ) {
+ if ( isset( $plugin_page ) &&
+ ( $plugin_page == $menu_array[2] ) &&
+ ( $pagenow == 'admin.php' ) &&
+ ( $parent1 == $menu_array[2] ) ) {
+ $title = $menu_array[3];
+ return $menu_array[3];
+ }
+ }
+ }
+ }
+
+ return $title;
+}
+
+/**
+ * @since 2.3.0
+ *
+ * @param string $plugin_page The slug name of the plugin page.
+ * @param string $parent_page The slug name for the parent menu (or the file name of a standard
+ * WordPress admin page).
+ * @return string|null Hook attached to the plugin page, null otherwise.
+ */
+function get_plugin_page_hook( $plugin_page, $parent_page ) {
+ $hook = get_plugin_page_hookname( $plugin_page, $parent_page );
+ if ( has_action( $hook ) ) {
+ return $hook;
+ } else {
+ return null;
+ }
+}
+
+/**
+ * @global array $admin_page_hooks
+ *
+ * @param string $plugin_page The slug name of the plugin page.
+ * @param string $parent_page The slug name for the parent menu (or the file name of a standard
+ * WordPress admin page).
+ * @return string Hook name for the plugin page.
+ */
+function get_plugin_page_hookname( $plugin_page, $parent_page ) {
+ global $admin_page_hooks;
+
+ $parent = get_admin_page_parent( $parent_page );
+
+ $page_type = 'admin';
+ if ( empty( $parent_page ) || 'admin.php' == $parent_page || isset( $admin_page_hooks[ $plugin_page ] ) ) {
+ if ( isset( $admin_page_hooks[ $plugin_page ] ) ) {
+ $page_type = 'toplevel';
+ } elseif ( isset( $admin_page_hooks[ $parent ] ) ) {
+ $page_type = $admin_page_hooks[ $parent ];
+ }
+ } elseif ( isset( $admin_page_hooks[ $parent ] ) ) {
+ $page_type = $admin_page_hooks[ $parent ];
+ }
+
+ $plugin_name = preg_replace( '!\.php!', '', $plugin_page );
+
+ return $page_type . '_page_' . $plugin_name;
+}
+
+/**
+ * @global string $pagenow
+ * @global array $menu
+ * @global array $submenu
+ * @global array $_wp_menu_nopriv
+ * @global array $_wp_submenu_nopriv
+ * @global string $plugin_page
+ * @global array $_registered_pages
+ *
+ * @return bool Whether the current user can access the current admin page.
+ */
+function user_can_access_admin_page() {
+ global $pagenow, $menu, $submenu, $_wp_menu_nopriv, $_wp_submenu_nopriv,
+ $plugin_page, $_registered_pages;
+
+ $parent = get_admin_page_parent();
+
+ if ( ! isset( $plugin_page ) && isset( $_wp_submenu_nopriv[ $parent ][ $pagenow ] ) ) {
+ return false;
+ }
+
+ if ( isset( $plugin_page ) ) {
+ if ( isset( $_wp_submenu_nopriv[ $parent ][ $plugin_page ] ) ) {
+ return false;
+ }
+
+ $hookname = get_plugin_page_hookname( $plugin_page, $parent );
+
+ if ( ! isset( $_registered_pages[ $hookname ] ) ) {
+ return false;
+ }
+ }
+
+ if ( empty( $parent ) ) {
+ if ( isset( $_wp_menu_nopriv[ $pagenow ] ) ) {
+ return false;
+ }
+ if ( isset( $_wp_submenu_nopriv[ $pagenow ][ $pagenow ] ) ) {
+ return false;
+ }
+ if ( isset( $plugin_page ) && isset( $_wp_submenu_nopriv[ $pagenow ][ $plugin_page ] ) ) {
+ return false;
+ }
+ if ( isset( $plugin_page ) && isset( $_wp_menu_nopriv[ $plugin_page ] ) ) {
+ return false;
+ }
+ foreach ( array_keys( $_wp_submenu_nopriv ) as $key ) {
+ if ( isset( $_wp_submenu_nopriv[ $key ][ $pagenow ] ) ) {
+ return false;
+ }
+ if ( isset( $plugin_page ) && isset( $_wp_submenu_nopriv[ $key ][ $plugin_page ] ) ) {
+ return false;
+ }
+ }
+ return true;
+ }
+
+ if ( isset( $plugin_page ) && ( $plugin_page == $parent ) && isset( $_wp_menu_nopriv[ $plugin_page ] ) ) {
+ return false;
+ }
+
+ if ( isset( $submenu[ $parent ] ) ) {
+ foreach ( $submenu[ $parent ] as $submenu_array ) {
+ if ( isset( $plugin_page ) && ( $submenu_array[2] == $plugin_page ) ) {
+ if ( current_user_can( $submenu_array[1] ) ) {
+ return true;
+ } else {
+ return false;
+ }
+ } elseif ( $submenu_array[2] == $pagenow ) {
+ if ( current_user_can( $submenu_array[1] ) ) {
+ return true;
+ } else {
+ return false;
+ }
+ }
+ }
+ }
+
+ foreach ( $menu as $menu_array ) {
+ if ( $menu_array[2] == $parent ) {
+ if ( current_user_can( $menu_array[1] ) ) {
+ return true;
+ } else {
+ return false;
+ }
+ }
+ }
+
+ return true;
+}
+
+/* Whitelist functions */
+
+/**
+ * Refreshes the value of the options whitelist available via the 'whitelist_options' hook.
+ *
+ * See the {@see 'whitelist_options'} filter.
+ *
+ * @since 2.7.0
+ *
+ * @global array $new_whitelist_options
+ *
+ * @param array $options
+ * @return array
+ */
+function option_update_filter( $options ) {
+ global $new_whitelist_options;
+
+ if ( is_array( $new_whitelist_options ) ) {
+ $options = add_option_whitelist( $new_whitelist_options, $options );
+ }
+
+ return $options;
+}
+
+/**
+ * Adds an array of options to the options whitelist.
+ *
+ * @since 2.7.0
+ *
+ * @global array $whitelist_options
+ *
+ * @param array $new_options
+ * @param string|array $options
+ * @return array
+ */
+function add_option_whitelist( $new_options, $options = '' ) {
+ if ( $options == '' ) {
+ global $whitelist_options;
+ } else {
+ $whitelist_options = $options;
+ }
+
+ foreach ( $new_options as $page => $keys ) {
+ foreach ( $keys as $key ) {
+ if ( ! isset( $whitelist_options[ $page ] ) || ! is_array( $whitelist_options[ $page ] ) ) {
+ $whitelist_options[ $page ] = array();
+ $whitelist_options[ $page ][] = $key;
+ } else {
+ $pos = array_search( $key, $whitelist_options[ $page ] );
+ if ( $pos === false ) {
+ $whitelist_options[ $page ][] = $key;
+ }
+ }
+ }
+ }
+
+ return $whitelist_options;
+}
+
+/**
+ * Removes a list of options from the options whitelist.
+ *
+ * @since 2.7.0
+ *
+ * @global array $whitelist_options
+ *
+ * @param array $del_options
+ * @param string|array $options
+ * @return array
+ */
+function remove_option_whitelist( $del_options, $options = '' ) {
+ if ( $options == '' ) {
+ global $whitelist_options;
+ } else {
+ $whitelist_options = $options;
+ }
+
+ foreach ( $del_options as $page => $keys ) {
+ foreach ( $keys as $key ) {
+ if ( isset( $whitelist_options[ $page ] ) && is_array( $whitelist_options[ $page ] ) ) {
+ $pos = array_search( $key, $whitelist_options[ $page ] );
+ if ( $pos !== false ) {
+ unset( $whitelist_options[ $page ][ $pos ] );
+ }
+ }
+ }
+ }
+
+ return $whitelist_options;
+}
+
+/**
+ * Output nonce, action, and option_page fields for a settings page.
+ *
+ * @since 2.7.0
+ *
+ * @param string $option_group A settings group name. This should match the group name used in register_setting().
+ */
+function settings_fields( $option_group ) {
+ echo "<input type='hidden' name='option_page' value='" . esc_attr( $option_group ) . "' />";
+ echo '<input type="hidden" name="action" value="update" />';
+ wp_nonce_field( "$option_group-options" );
+}
+
+/**
+ * Clears the Plugins cache used by get_plugins() and by default, the Plugin Update cache.
+ *
+ * @since 3.7.0
+ *
+ * @param bool $clear_update_cache Whether to clear the Plugin updates cache
+ */
+function wp_clean_plugins_cache( $clear_update_cache = true ) {
+ if ( $clear_update_cache ) {
+ delete_site_transient( 'update_plugins' );
+ }
+ wp_cache_delete( 'plugins', 'plugins' );
+}
+
+/**
+ * Load a given plugin attempt to generate errors.
+ *
+ * @since 3.0.0
+ * @since 4.4.0 Function was moved into the `wp-admin/includes/plugin.php` file.
+ *
+ * @param string $plugin Path to the plugin file relative to the plugins directory.
+ */
+function plugin_sandbox_scrape( $plugin ) {
+ if ( ! defined( 'WP_SANDBOX_SCRAPING' ) ) {
+ define( 'WP_SANDBOX_SCRAPING', true );
+ }
+ wp_register_plugin_realpath( WP_PLUGIN_DIR . '/' . $plugin );
+ include( WP_PLUGIN_DIR . '/' . $plugin );
+}
+
+/**
+ * Helper function for adding content to the Privacy Policy Guide.
+ *
+ * Plugins and themes should suggest text for inclusion in the site's privacy policy.
+ * The suggested text should contain information about any functionality that affects user privacy,
+ * and will be shown on the Privacy Policy Guide screen.
+ *
+ * A plugin or theme can use this function multiple times as long as it will help to better present
+ * the suggested policy content. For example modular plugins such as WooCommerse or Jetpack
+ * can add or remove suggested content depending on the modules/extensions that are enabled.
+ * For more information see the Plugin Handbook:
+ * https://developer.wordpress.org/plugins/privacy/suggesting-text-for-the-site-privacy-policy/.
+ *
+ * Intended for use with the `'admin_init'` action.
+ *
+ * @since 4.9.6
+ *
+ * @param string $plugin_name The name of the plugin or theme that is suggesting content for the site's privacy policy.
+ * @param string $policy_text The suggested content for inclusion in the policy.
+ */
+function wp_add_privacy_policy_content( $plugin_name, $policy_text ) {
+ if ( ! is_admin() ) {
+ _doing_it_wrong(
+ __FUNCTION__,
+ sprintf(
+ /* translators: %s: admin_init */
+ __( 'The suggested privacy policy content should be added only in wp-admin by using the %s (or later) action.' ),
+ '<code>admin_init</code>'
+ ),
+ '4.9.7'
+ );
+ return;
+ } elseif ( ! doing_action( 'admin_init' ) && ! did_action( 'admin_init' ) ) {
+ _doing_it_wrong(
+ __FUNCTION__,
+ sprintf(
+ /* translators: %s: admin_init */
+ __( 'The suggested privacy policy content should be added by using the %s (or later) action. Please see the inline documentation.' ),
+ '<code>admin_init</code>'
+ ),
+ '4.9.7'
+ );
+ return;
+ }
+
+ if ( ! class_exists( 'WP_Privacy_Policy_Content' ) ) {
+ require_once( ABSPATH . 'wp-admin/includes/misc.php' );
+ }
+
+ WP_Privacy_Policy_Content::add( $plugin_name, $policy_text );
+}
+
+/**
+ * Determines whether a plugin is technically active but was paused while
+ * loading.
+ *
+ * For more information on this and similar theme functions, check out
+ * the {@link https://developer.wordpress.org/themes/basics/conditional-tags/
+ * Conditional Tags} article in the Theme Developer Handbook.
+ *
+ * @since 5.2.0
+ *
+ * @param string $plugin Path to the plugin file relative to the plugins directory.
+ * @return bool True, if in the list of paused plugins. False, not in the list.
+ */
+function is_plugin_paused( $plugin ) {
+ if ( ! isset( $GLOBALS['_paused_plugins'] ) ) {
+ return false;
+ }
+
+ if ( ! is_plugin_active( $plugin ) ) {
+ return false;
+ }
+
+ list( $plugin ) = explode( '/', $plugin );
+
+ return array_key_exists( $plugin, $GLOBALS['_paused_plugins'] );
+}
+
+/**
+ * Gets the error that was recorded for a paused plugin.
+ *
+ * @since 5.2.0
+ *
+ * @param string $plugin Path to the plugin file relative to the plugins
+ * directory.
+ * @return array|false Array of error information as it was returned by
+ * `error_get_last()`, or false if none was recorded.
+ */
+function wp_get_plugin_error( $plugin ) {
+ if ( ! isset( $GLOBALS['_paused_plugins'] ) ) {
+ return false;
+ }
+
+ list( $plugin ) = explode( '/', $plugin );
+
+ if ( ! array_key_exists( $plugin, $GLOBALS['_paused_plugins'] ) ) {
+ return false;
+ }
+
+ return $GLOBALS['_paused_plugins'][ $plugin ];
+}
+
+/**
+ * Tries to resume a single plugin.
+ *
+ * If a redirect was provided, we first ensure the plugin does not throw fatal
+ * errors anymore.
+ *
+ * The way it works is by setting the redirection to the error before trying to
+ * include the plugin file. If the plugin fails, then the redirection will not
+ * be overwritten with the success message and the plugin will not be resumed.
+ *
+ * @since 5.2.0
+ *
+ * @param string $plugin Single plugin to resume.
+ * @param string $redirect Optional. URL to redirect to. Default empty string.
+ * @return bool|WP_Error True on success, false if `$plugin` was not paused,
+ * `WP_Error` on failure.
+ */
+function resume_plugin( $plugin, $redirect = '' ) {
+ /*
+ * We'll override this later if the plugin could be resumed without
+ * creating a fatal error.
+ */
+ if ( ! empty( $redirect ) ) {
+ wp_redirect(
+ add_query_arg(
+ '_error_nonce',
+ wp_create_nonce( 'plugin-resume-error_' . $plugin ),
+ $redirect
+ )
+ );
+
+ // Load the plugin to test whether it throws a fatal error.
+ ob_start();
+ plugin_sandbox_scrape( $plugin );
+ ob_clean();
+ }
+
+ list( $extension ) = explode( '/', $plugin );
+
+ $result = wp_paused_plugins()->delete( $extension );
+
+ if ( ! $result ) {
+ return new WP_Error(
+ 'could_not_resume_plugin',
+ __( 'Could not resume the plugin.' )
+ );
+ }
+
+ return true;
+}
+
+/**
+ * Renders an admin notice in case some plugins have been paused due to errors.
+ *
+ * @since 5.2.0
+ */
+function paused_plugins_notice() {
+ if ( 'plugins.php' === $GLOBALS['pagenow'] ) {
+ return;
+ }
+
+ if ( ! current_user_can( 'resume_plugins' ) ) {
+ return;
+ }
+
+ if ( ! isset( $GLOBALS['_paused_plugins'] ) || empty( $GLOBALS['_paused_plugins'] ) ) {
+ return;
+ }
+
+ printf(
+ '<div class="notice notice-error"><p><strong>%s</strong><br>%s</p><p><a href="%s">%s</a></p></div>',
+ __( 'One or more plugins failed to load properly.' ),
+ __( 'You can find more details and make changes on the Plugins screen.' ),
+ esc_url( admin_url( 'plugins.php?plugin_status=paused' ) ),
+ __( 'Go to the Plugins screen' )
+ );
+}
diff --git a/www/crm/wp-admin/includes/post.php b/www/crm/wp-admin/includes/post.php
new file mode 100644
index 00000000..dc341bf9
--- /dev/null
+++ b/www/crm/wp-admin/includes/post.php
@@ -0,0 +1,2410 @@
+<?php
+/**
+ * WordPress Post Administration API.
+ *
+ * @package WordPress
+ * @subpackage Administration
+ */
+
+/**
+ * Rename $_POST data from form names to DB post columns.
+ *
+ * Manipulates $_POST directly.
+ *
+ * @since 2.6.0
+ *
+ * @param bool $update Are we updating a pre-existing post?
+ * @param array $post_data Array of post data. Defaults to the contents of $_POST.
+ * @return object|bool WP_Error on failure, true on success.
+ */
+function _wp_translate_postdata( $update = false, $post_data = null ) {
+
+ if ( empty( $post_data ) ) {
+ $post_data = &$_POST;
+ }
+
+ if ( $update ) {
+ $post_data['ID'] = (int) $post_data['post_ID'];
+ }
+
+ $ptype = get_post_type_object( $post_data['post_type'] );
+
+ if ( $update && ! current_user_can( 'edit_post', $post_data['ID'] ) ) {
+ if ( 'page' == $post_data['post_type'] ) {
+ return new WP_Error( 'edit_others_pages', __( 'Sorry, you are not allowed to edit pages as this user.' ) );
+ } else {
+ return new WP_Error( 'edit_others_posts', __( 'Sorry, you are not allowed to edit posts as this user.' ) );
+ }
+ } elseif ( ! $update && ! current_user_can( $ptype->cap->create_posts ) ) {
+ if ( 'page' == $post_data['post_type'] ) {
+ return new WP_Error( 'edit_others_pages', __( 'Sorry, you are not allowed to create pages as this user.' ) );
+ } else {
+ return new WP_Error( 'edit_others_posts', __( 'Sorry, you are not allowed to create posts as this user.' ) );
+ }
+ }
+
+ if ( isset( $post_data['content'] ) ) {
+ $post_data['post_content'] = $post_data['content'];
+ }
+
+ if ( isset( $post_data['excerpt'] ) ) {
+ $post_data['post_excerpt'] = $post_data['excerpt'];
+ }
+
+ if ( isset( $post_data['parent_id'] ) ) {
+ $post_data['post_parent'] = (int) $post_data['parent_id'];
+ }
+
+ if ( isset( $post_data['trackback_url'] ) ) {
+ $post_data['to_ping'] = $post_data['trackback_url'];
+ }
+
+ $post_data['user_ID'] = get_current_user_id();
+
+ if ( ! empty( $post_data['post_author_override'] ) ) {
+ $post_data['post_author'] = (int) $post_data['post_author_override'];
+ } else {
+ if ( ! empty( $post_data['post_author'] ) ) {
+ $post_data['post_author'] = (int) $post_data['post_author'];
+ } else {
+ $post_data['post_author'] = (int) $post_data['user_ID'];
+ }
+ }
+
+ if ( isset( $post_data['user_ID'] ) && ( $post_data['post_author'] != $post_data['user_ID'] )
+ && ! current_user_can( $ptype->cap->edit_others_posts ) ) {
+
+ if ( $update ) {
+ if ( 'page' == $post_data['post_type'] ) {
+ return new WP_Error( 'edit_others_pages', __( 'Sorry, you are not allowed to edit pages as this user.' ) );
+ } else {
+ return new WP_Error( 'edit_others_posts', __( 'Sorry, you are not allowed to edit posts as this user.' ) );
+ }
+ } else {
+ if ( 'page' == $post_data['post_type'] ) {
+ return new WP_Error( 'edit_others_pages', __( 'Sorry, you are not allowed to create pages as this user.' ) );
+ } else {
+ return new WP_Error( 'edit_others_posts', __( 'Sorry, you are not allowed to create posts as this user.' ) );
+ }
+ }
+ }
+
+ if ( ! empty( $post_data['post_status'] ) ) {
+ $post_data['post_status'] = sanitize_key( $post_data['post_status'] );
+
+ // No longer an auto-draft
+ if ( 'auto-draft' === $post_data['post_status'] ) {
+ $post_data['post_status'] = 'draft';
+ }
+
+ if ( ! get_post_status_object( $post_data['post_status'] ) ) {
+ unset( $post_data['post_status'] );
+ }
+ }
+
+ // What to do based on which button they pressed
+ if ( isset( $post_data['saveasdraft'] ) && '' != $post_data['saveasdraft'] ) {
+ $post_data['post_status'] = 'draft';
+ }
+ if ( isset( $post_data['saveasprivate'] ) && '' != $post_data['saveasprivate'] ) {
+ $post_data['post_status'] = 'private';
+ }
+ if ( isset( $post_data['publish'] ) && ( '' != $post_data['publish'] ) && ( ! isset( $post_data['post_status'] ) || $post_data['post_status'] != 'private' ) ) {
+ $post_data['post_status'] = 'publish';
+ }
+ if ( isset( $post_data['advanced'] ) && '' != $post_data['advanced'] ) {
+ $post_data['post_status'] = 'draft';
+ }
+ if ( isset( $post_data['pending'] ) && '' != $post_data['pending'] ) {
+ $post_data['post_status'] = 'pending';
+ }
+
+ if ( isset( $post_data['ID'] ) ) {
+ $post_id = $post_data['ID'];
+ } else {
+ $post_id = false;
+ }
+ $previous_status = $post_id ? get_post_field( 'post_status', $post_id ) : false;
+
+ if ( isset( $post_data['post_status'] ) && 'private' == $post_data['post_status'] && ! current_user_can( $ptype->cap->publish_posts ) ) {
+ $post_data['post_status'] = $previous_status ? $previous_status : 'pending';
+ }
+
+ $published_statuses = array( 'publish', 'future' );
+
+ // Posts 'submitted for approval' present are submitted to $_POST the same as if they were being published.
+ // Change status from 'publish' to 'pending' if user lacks permissions to publish or to resave published posts.
+ if ( isset( $post_data['post_status'] ) && ( in_array( $post_data['post_status'], $published_statuses ) && ! current_user_can( $ptype->cap->publish_posts ) ) ) {
+ if ( ! in_array( $previous_status, $published_statuses ) || ! current_user_can( 'edit_post', $post_id ) ) {
+ $post_data['post_status'] = 'pending';
+ }
+ }
+
+ if ( ! isset( $post_data['post_status'] ) ) {
+ $post_data['post_status'] = 'auto-draft' === $previous_status ? 'draft' : $previous_status;
+ }
+
+ if ( isset( $post_data['post_password'] ) && ! current_user_can( $ptype->cap->publish_posts ) ) {
+ unset( $post_data['post_password'] );
+ }
+
+ if ( ! isset( $post_data['comment_status'] ) ) {
+ $post_data['comment_status'] = 'closed';
+ }
+
+ if ( ! isset( $post_data['ping_status'] ) ) {
+ $post_data['ping_status'] = 'closed';
+ }
+
+ foreach ( array( 'aa', 'mm', 'jj', 'hh', 'mn' ) as $timeunit ) {
+ if ( ! empty( $post_data[ 'hidden_' . $timeunit ] ) && $post_data[ 'hidden_' . $timeunit ] != $post_data[ $timeunit ] ) {
+ $post_data['edit_date'] = '1';
+ break;
+ }
+ }
+
+ if ( ! empty( $post_data['edit_date'] ) ) {
+ $aa = $post_data['aa'];
+ $mm = $post_data['mm'];
+ $jj = $post_data['jj'];
+ $hh = $post_data['hh'];
+ $mn = $post_data['mn'];
+ $ss = $post_data['ss'];
+ $aa = ( $aa <= 0 ) ? date( 'Y' ) : $aa;
+ $mm = ( $mm <= 0 ) ? date( 'n' ) : $mm;
+ $jj = ( $jj > 31 ) ? 31 : $jj;
+ $jj = ( $jj <= 0 ) ? date( 'j' ) : $jj;
+ $hh = ( $hh > 23 ) ? $hh - 24 : $hh;
+ $mn = ( $mn > 59 ) ? $mn - 60 : $mn;
+ $ss = ( $ss > 59 ) ? $ss - 60 : $ss;
+ $post_data['post_date'] = sprintf( '%04d-%02d-%02d %02d:%02d:%02d', $aa, $mm, $jj, $hh, $mn, $ss );
+ $valid_date = wp_checkdate( $mm, $jj, $aa, $post_data['post_date'] );
+ if ( ! $valid_date ) {
+ return new WP_Error( 'invalid_date', __( 'Invalid date.' ) );
+ }
+ $post_data['post_date_gmt'] = get_gmt_from_date( $post_data['post_date'] );
+ }
+
+ if ( isset( $post_data['post_category'] ) ) {
+ $category_object = get_taxonomy( 'category' );
+ if ( ! current_user_can( $category_object->cap->assign_terms ) ) {
+ unset( $post_data['post_category'] );
+ }
+ }
+
+ return $post_data;
+}
+
+/**
+ * Returns only allowed post data fields
+ *
+ * @since 5.0.1
+ *
+ * @param array $post_data Array of post data. Defaults to the contents of $_POST.
+ * @return object|bool WP_Error on failure, true on success.
+ */
+function _wp_get_allowed_postdata( $post_data = null ) {
+ if ( empty( $post_data ) ) {
+ $post_data = $_POST;
+ }
+
+ // Pass through errors
+ if ( is_wp_error( $post_data ) ) {
+ return $post_data;
+ }
+
+ return array_diff_key( $post_data, array_flip( array( 'meta_input', 'file', 'guid' ) ) );
+}
+
+/**
+ * Update an existing post with values provided in $_POST.
+ *
+ * @since 1.5.0
+ *
+ * @global wpdb $wpdb WordPress database abstraction object.
+ *
+ * @param array $post_data Optional.
+ * @return int Post ID.
+ */
+function edit_post( $post_data = null ) {
+ global $wpdb;
+
+ if ( empty( $post_data ) ) {
+ $post_data = &$_POST;
+ }
+
+ // Clear out any data in internal vars.
+ unset( $post_data['filter'] );
+
+ $post_ID = (int) $post_data['post_ID'];
+ $post = get_post( $post_ID );
+ $post_data['post_type'] = $post->post_type;
+ $post_data['post_mime_type'] = $post->post_mime_type;
+
+ if ( ! empty( $post_data['post_status'] ) ) {
+ $post_data['post_status'] = sanitize_key( $post_data['post_status'] );
+
+ if ( 'inherit' == $post_data['post_status'] ) {
+ unset( $post_data['post_status'] );
+ }
+ }
+
+ $ptype = get_post_type_object( $post_data['post_type'] );
+ if ( ! current_user_can( 'edit_post', $post_ID ) ) {
+ if ( 'page' == $post_data['post_type'] ) {
+ wp_die( __( 'Sorry, you are not allowed to edit this page.' ) );
+ } else {
+ wp_die( __( 'Sorry, you are not allowed to edit this post.' ) );
+ }
+ }
+
+ if ( post_type_supports( $ptype->name, 'revisions' ) ) {
+ $revisions = wp_get_post_revisions(
+ $post_ID,
+ array(
+ 'order' => 'ASC',
+ 'posts_per_page' => 1,
+ )
+ );
+ $revision = current( $revisions );
+
+ // Check if the revisions have been upgraded
+ if ( $revisions && _wp_get_post_revision_version( $revision ) < 1 ) {
+ _wp_upgrade_revisions_of_post( $post, wp_get_post_revisions( $post_ID ) );
+ }
+ }
+
+ if ( isset( $post_data['visibility'] ) ) {
+ switch ( $post_data['visibility'] ) {
+ case 'public':
+ $post_data['post_password'] = '';
+ break;
+ case 'password':
+ unset( $post_data['sticky'] );
+ break;
+ case 'private':
+ $post_data['post_status'] = 'private';
+ $post_data['post_password'] = '';
+ unset( $post_data['sticky'] );
+ break;
+ }
+ }
+
+ $post_data = _wp_translate_postdata( true, $post_data );
+ if ( is_wp_error( $post_data ) ) {
+ wp_die( $post_data->get_error_message() );
+ }
+ $translated = _wp_get_allowed_postdata( $post_data );
+
+ // Post Formats
+ if ( isset( $post_data['post_format'] ) ) {
+ set_post_format( $post_ID, $post_data['post_format'] );
+ }
+
+ $format_meta_urls = array( 'url', 'link_url', 'quote_source_url' );
+ foreach ( $format_meta_urls as $format_meta_url ) {
+ $keyed = '_format_' . $format_meta_url;
+ if ( isset( $post_data[ $keyed ] ) ) {
+ update_post_meta( $post_ID, $keyed, wp_slash( esc_url_raw( wp_unslash( $post_data[ $keyed ] ) ) ) );
+ }
+ }
+
+ $format_keys = array( 'quote', 'quote_source_name', 'image', 'gallery', 'audio_embed', 'video_embed' );
+
+ foreach ( $format_keys as $key ) {
+ $keyed = '_format_' . $key;
+ if ( isset( $post_data[ $keyed ] ) ) {
+ if ( current_user_can( 'unfiltered_html' ) ) {
+ update_post_meta( $post_ID, $keyed, $post_data[ $keyed ] );
+ } else {
+ update_post_meta( $post_ID, $keyed, wp_filter_post_kses( $post_data[ $keyed ] ) );
+ }
+ }
+ }
+
+ if ( 'attachment' === $post_data['post_type'] && preg_match( '#^(audio|video)/#', $post_data['post_mime_type'] ) ) {
+ $id3data = wp_get_attachment_metadata( $post_ID );
+ if ( ! is_array( $id3data ) ) {
+ $id3data = array();
+ }
+
+ foreach ( wp_get_attachment_id3_keys( $post, 'edit' ) as $key => $label ) {
+ if ( isset( $post_data[ 'id3_' . $key ] ) ) {
+ $id3data[ $key ] = sanitize_text_field( wp_unslash( $post_data[ 'id3_' . $key ] ) );
+ }
+ }
+ wp_update_attachment_metadata( $post_ID, $id3data );
+ }
+
+ // Meta Stuff
+ if ( isset( $post_data['meta'] ) && $post_data['meta'] ) {
+ foreach ( $post_data['meta'] as $key => $value ) {
+ if ( ! $meta = get_post_meta_by_id( $key ) ) {
+ continue;
+ }
+ if ( $meta->post_id != $post_ID ) {
+ continue;
+ }
+ if ( is_protected_meta( $meta->meta_key, 'post' ) || ! current_user_can( 'edit_post_meta', $post_ID, $meta->meta_key ) ) {
+ continue;
+ }
+ if ( is_protected_meta( $value['key'], 'post' ) || ! current_user_can( 'edit_post_meta', $post_ID, $value['key'] ) ) {
+ continue;
+ }
+ update_meta( $key, $value['key'], $value['value'] );
+ }
+ }
+
+ if ( isset( $post_data['deletemeta'] ) && $post_data['deletemeta'] ) {
+ foreach ( $post_data['deletemeta'] as $key => $value ) {
+ if ( ! $meta = get_post_meta_by_id( $key ) ) {
+ continue;
+ }
+ if ( $meta->post_id != $post_ID ) {
+ continue;
+ }
+ if ( is_protected_meta( $meta->meta_key, 'post' ) || ! current_user_can( 'delete_post_meta', $post_ID, $meta->meta_key ) ) {
+ continue;
+ }
+ delete_meta( $key );
+ }
+ }
+
+ // Attachment stuff
+ if ( 'attachment' == $post_data['post_type'] ) {
+ if ( isset( $post_data['_wp_attachment_image_alt'] ) ) {
+ $image_alt = wp_unslash( $post_data['_wp_attachment_image_alt'] );
+ if ( $image_alt != get_post_meta( $post_ID, '_wp_attachment_image_alt', true ) ) {
+ $image_alt = wp_strip_all_tags( $image_alt, true );
+ // update_meta expects slashed.
+ update_post_meta( $post_ID, '_wp_attachment_image_alt', wp_slash( $image_alt ) );
+ }
+ }
+
+ $attachment_data = isset( $post_data['attachments'][ $post_ID ] ) ? $post_data['attachments'][ $post_ID ] : array();
+
+ /** This filter is documented in wp-admin/includes/media.php */
+ $translated = apply_filters( 'attachment_fields_to_save', $translated, $attachment_data );
+ }
+
+ // Convert taxonomy input to term IDs, to avoid ambiguity.
+ if ( isset( $post_data['tax_input'] ) ) {
+ foreach ( (array) $post_data['tax_input'] as $taxonomy => $terms ) {
+ $tax_object = get_taxonomy( $taxonomy );
+
+ if ( $tax_object && isset( $tax_object->meta_box_sanitize_cb ) ) {
+ $translated['tax_input'][ $taxonomy ] = call_user_func_array( $tax_object->meta_box_sanitize_cb, array( $taxonomy, $terms ) );
+ }
+ }
+ }
+
+ add_meta( $post_ID );
+
+ update_post_meta( $post_ID, '_edit_last', get_current_user_id() );
+
+ $success = wp_update_post( $translated );
+ // If the save failed, see if we can sanity check the main fields and try again
+ if ( ! $success && is_callable( array( $wpdb, 'strip_invalid_text_for_column' ) ) ) {
+ $fields = array( 'post_title', 'post_content', 'post_excerpt' );
+
+ foreach ( $fields as $field ) {
+ if ( isset( $translated[ $field ] ) ) {
+ $translated[ $field ] = $wpdb->strip_invalid_text_for_column( $wpdb->posts, $field, $translated[ $field ] );
+ }
+ }
+
+ wp_update_post( $translated );
+ }
+
+ // Now that we have an ID we can fix any attachment anchor hrefs
+ _fix_attachment_links( $post_ID );
+
+ wp_set_post_lock( $post_ID );
+
+ if ( current_user_can( $ptype->cap->edit_others_posts ) && current_user_can( $ptype->cap->publish_posts ) ) {
+ if ( ! empty( $post_data['sticky'] ) ) {
+ stick_post( $post_ID );
+ } else {
+ unstick_post( $post_ID );
+ }
+ }
+
+ return $post_ID;
+}
+
+/**
+ * Process the post data for the bulk editing of posts.
+ *
+ * Updates all bulk edited posts/pages, adding (but not removing) tags and
+ * categories. Skips pages when they would be their own parent or child.
+ *
+ * @since 2.7.0
+ *
+ * @global wpdb $wpdb WordPress database abstraction object.
+ *
+ * @param array $post_data Optional, the array of post data to process if not provided will use $_POST superglobal.
+ * @return array
+ */
+function bulk_edit_posts( $post_data = null ) {
+ global $wpdb;
+
+ if ( empty( $post_data ) ) {
+ $post_data = &$_POST;
+ }
+
+ if ( isset( $post_data['post_type'] ) ) {
+ $ptype = get_post_type_object( $post_data['post_type'] );
+ } else {
+ $ptype = get_post_type_object( 'post' );
+ }
+
+ if ( ! current_user_can( $ptype->cap->edit_posts ) ) {
+ if ( 'page' == $ptype->name ) {
+ wp_die( __( 'Sorry, you are not allowed to edit pages.' ) );
+ } else {
+ wp_die( __( 'Sorry, you are not allowed to edit posts.' ) );
+ }
+ }
+
+ if ( -1 == $post_data['_status'] ) {
+ $post_data['post_status'] = null;
+ unset( $post_data['post_status'] );
+ } else {
+ $post_data['post_status'] = $post_data['_status'];
+ }
+ unset( $post_data['_status'] );
+
+ if ( ! empty( $post_data['post_status'] ) ) {
+ $post_data['post_status'] = sanitize_key( $post_data['post_status'] );
+
+ if ( 'inherit' == $post_data['post_status'] ) {
+ unset( $post_data['post_status'] );
+ }
+ }
+
+ $post_IDs = array_map( 'intval', (array) $post_data['post'] );
+
+ $reset = array(
+ 'post_author',
+ 'post_status',
+ 'post_password',
+ 'post_parent',
+ 'page_template',
+ 'comment_status',
+ 'ping_status',
+ 'keep_private',
+ 'tax_input',
+ 'post_category',
+ 'sticky',
+ 'post_format',
+ );
+
+ foreach ( $reset as $field ) {
+ if ( isset( $post_data[ $field ] ) && ( '' == $post_data[ $field ] || -1 == $post_data[ $field ] ) ) {
+ unset( $post_data[ $field ] );
+ }
+ }
+
+ if ( isset( $post_data['post_category'] ) ) {
+ if ( is_array( $post_data['post_category'] ) && ! empty( $post_data['post_category'] ) ) {
+ $new_cats = array_map( 'absint', $post_data['post_category'] );
+ } else {
+ unset( $post_data['post_category'] );
+ }
+ }
+
+ $tax_input = array();
+ if ( isset( $post_data['tax_input'] ) ) {
+ foreach ( $post_data['tax_input'] as $tax_name => $terms ) {
+ if ( empty( $terms ) ) {
+ continue;
+ }
+ if ( is_taxonomy_hierarchical( $tax_name ) ) {
+ $tax_input[ $tax_name ] = array_map( 'absint', $terms );
+ } else {
+ $comma = _x( ',', 'tag delimiter' );
+ if ( ',' !== $comma ) {
+ $terms = str_replace( $comma, ',', $terms );
+ }
+ $tax_input[ $tax_name ] = explode( ',', trim( $terms, " \n\t\r\0\x0B," ) );
+ }
+ }
+ }
+
+ if ( isset( $post_data['post_parent'] ) && ( $parent = (int) $post_data['post_parent'] ) ) {
+ $pages = $wpdb->get_results( "SELECT ID, post_parent FROM $wpdb->posts WHERE post_type = 'page'" );
+ $children = array();
+
+ for ( $i = 0; $i < 50 && $parent > 0; $i++ ) {
+ $children[] = $parent;
+
+ foreach ( $pages as $page ) {
+ if ( $page->ID == $parent ) {
+ $parent = $page->post_parent;
+ break;
+ }
+ }
+ }
+ }
+
+ $updated = $skipped = $locked = array();
+ $shared_post_data = $post_data;
+
+ foreach ( $post_IDs as $post_ID ) {
+ // Start with fresh post data with each iteration.
+ $post_data = $shared_post_data;
+
+ $post_type_object = get_post_type_object( get_post_type( $post_ID ) );
+
+ if ( ! isset( $post_type_object ) || ( isset( $children ) && in_array( $post_ID, $children ) ) || ! current_user_can( 'edit_post', $post_ID ) ) {
+ $skipped[] = $post_ID;
+ continue;
+ }
+
+ if ( wp_check_post_lock( $post_ID ) ) {
+ $locked[] = $post_ID;
+ continue;
+ }
+
+ $post = get_post( $post_ID );
+ $tax_names = get_object_taxonomies( $post );
+ foreach ( $tax_names as $tax_name ) {
+ $taxonomy_obj = get_taxonomy( $tax_name );
+ if ( isset( $tax_input[ $tax_name ] ) && current_user_can( $taxonomy_obj->cap->assign_terms ) ) {
+ $new_terms = $tax_input[ $tax_name ];
+ } else {
+ $new_terms = array();
+ }
+
+ if ( $taxonomy_obj->hierarchical ) {
+ $current_terms = (array) wp_get_object_terms( $post_ID, $tax_name, array( 'fields' => 'ids' ) );
+ } else {
+ $current_terms = (array) wp_get_object_terms( $post_ID, $tax_name, array( 'fields' => 'names' ) );
+ }
+
+ $post_data['tax_input'][ $tax_name ] = array_merge( $current_terms, $new_terms );
+ }
+
+ if ( isset( $new_cats ) && in_array( 'category', $tax_names ) ) {
+ $cats = (array) wp_get_post_categories( $post_ID );
+ $post_data['post_category'] = array_unique( array_merge( $cats, $new_cats ) );
+ unset( $post_data['tax_input']['category'] );
+ }
+
+ $post_data['post_ID'] = $post_ID;
+ $post_data['post_type'] = $post->post_type;
+ $post_data['post_mime_type'] = $post->post_mime_type;
+
+ foreach ( array( 'comment_status', 'ping_status', 'post_author' ) as $field ) {
+ if ( ! isset( $post_data[ $field ] ) ) {
+ $post_data[ $field ] = $post->$field;
+ }
+ }
+
+ $post_data = _wp_translate_postdata( true, $post_data );
+ if ( is_wp_error( $post_data ) ) {
+ $skipped[] = $post_ID;
+ continue;
+ }
+ $post_data = _wp_get_allowed_postdata( $post_data );
+
+ if ( isset( $shared_post_data['post_format'] ) ) {
+ set_post_format( $post_ID, $shared_post_data['post_format'] );
+ }
+
+ // Prevent wp_insert_post() from overwriting post format with the old data.
+ unset( $post_data['tax_input']['post_format'] );
+
+ $updated[] = wp_update_post( $post_data );
+
+ if ( isset( $post_data['sticky'] ) && current_user_can( $ptype->cap->edit_others_posts ) ) {
+ if ( 'sticky' == $post_data['sticky'] ) {
+ stick_post( $post_ID );
+ } else {
+ unstick_post( $post_ID );
+ }
+ }
+ }
+
+ return array(
+ 'updated' => $updated,
+ 'skipped' => $skipped,
+ 'locked' => $locked,
+ );
+}
+
+/**
+ * Default post information to use when populating the "Write Post" form.
+ *
+ * @since 2.0.0
+ *
+ * @param string $post_type Optional. A post type string. Default 'post'.
+ * @param bool $create_in_db Optional. Whether to insert the post into database. Default false.
+ * @return WP_Post Post object containing all the default post data as attributes
+ */
+function get_default_post_to_edit( $post_type = 'post', $create_in_db = false ) {
+ $post_title = '';
+ if ( ! empty( $_REQUEST['post_title'] ) ) {
+ $post_title = esc_html( wp_unslash( $_REQUEST['post_title'] ) );
+ }
+
+ $post_content = '';
+ if ( ! empty( $_REQUEST['content'] ) ) {
+ $post_content = esc_html( wp_unslash( $_REQUEST['content'] ) );
+ }
+
+ $post_excerpt = '';
+ if ( ! empty( $_REQUEST['excerpt'] ) ) {
+ $post_excerpt = esc_html( wp_unslash( $_REQUEST['excerpt'] ) );
+ }
+
+ if ( $create_in_db ) {
+ $post_id = wp_insert_post(
+ array(
+ 'post_title' => __( 'Auto Draft' ),
+ 'post_type' => $post_type,
+ 'post_status' => 'auto-draft',
+ )
+ );
+ $post = get_post( $post_id );
+ if ( current_theme_supports( 'post-formats' ) && post_type_supports( $post->post_type, 'post-formats' ) && get_option( 'default_post_format' ) ) {
+ set_post_format( $post, get_option( 'default_post_format' ) );
+ }
+
+ // Schedule auto-draft cleanup
+ if ( ! wp_next_scheduled( 'wp_scheduled_auto_draft_delete' ) ) {
+ wp_schedule_event( time(), 'daily', 'wp_scheduled_auto_draft_delete' );
+ }
+ } else {
+ $post = new stdClass;
+ $post->ID = 0;
+ $post->post_author = '';
+ $post->post_date = '';
+ $post->post_date_gmt = '';
+ $post->post_password = '';
+ $post->post_name = '';
+ $post->post_type = $post_type;
+ $post->post_status = 'draft';
+ $post->to_ping = '';
+ $post->pinged = '';
+ $post->comment_status = get_default_comment_status( $post_type );
+ $post->ping_status = get_default_comment_status( $post_type, 'pingback' );
+ $post->post_pingback = get_option( 'default_pingback_flag' );
+ $post->post_category = get_option( 'default_category' );
+ $post->page_template = 'default';
+ $post->post_parent = 0;
+ $post->menu_order = 0;
+ $post = new WP_Post( $post );
+ }
+
+ /**
+ * Filters the default post content initially used in the "Write Post" form.
+ *
+ * @since 1.5.0
+ *
+ * @param string $post_content Default post content.
+ * @param WP_Post $post Post object.
+ */
+ $post->post_content = (string) apply_filters( 'default_content', $post_content, $post );
+
+ /**
+ * Filters the default post title initially used in the "Write Post" form.
+ *
+ * @since 1.5.0
+ *
+ * @param string $post_title Default post title.
+ * @param WP_Post $post Post object.
+ */
+ $post->post_title = (string) apply_filters( 'default_title', $post_title, $post );
+
+ /**
+ * Filters the default post excerpt initially used in the "Write Post" form.
+ *
+ * @since 1.5.0
+ *
+ * @param string $post_excerpt Default post excerpt.
+ * @param WP_Post $post Post object.
+ */
+ $post->post_excerpt = (string) apply_filters( 'default_excerpt', $post_excerpt, $post );
+
+ return $post;
+}
+
+/**
+ * Determines if a post exists based on title, content, date and type.
+ *
+ * @since 2.0.0
+ * @since 5.2.0 Added the `$type` parameter.
+ *
+ * @global wpdb $wpdb WordPress database abstraction object.
+ *
+ * @param string $title Post title.
+ * @param string $content Optional post content.
+ * @param string $date Optional post date.
+ * @param string $type Optional post type.
+ * @return int Post ID if post exists, 0 otherwise.
+ */
+function post_exists( $title, $content = '', $date = '', $type = '' ) {
+ global $wpdb;
+
+ $post_title = wp_unslash( sanitize_post_field( 'post_title', $title, 0, 'db' ) );
+ $post_content = wp_unslash( sanitize_post_field( 'post_content', $content, 0, 'db' ) );
+ $post_date = wp_unslash( sanitize_post_field( 'post_date', $date, 0, 'db' ) );
+ $post_type = wp_unslash( sanitize_post_field( 'post_type', $type, 0, 'db' ) );
+
+ $query = "SELECT ID FROM $wpdb->posts WHERE 1=1";
+ $args = array();
+
+ if ( ! empty( $date ) ) {
+ $query .= ' AND post_date = %s';
+ $args[] = $post_date;
+ }
+
+ if ( ! empty( $title ) ) {
+ $query .= ' AND post_title = %s';
+ $args[] = $post_title;
+ }
+
+ if ( ! empty( $content ) ) {
+ $query .= ' AND post_content = %s';
+ $args[] = $post_content;
+ }
+
+ if ( ! empty( $type ) ) {
+ $query .= ' AND post_type = %s';
+ $args[] = $post_type;
+ }
+
+ if ( ! empty( $args ) ) {
+ return (int) $wpdb->get_var( $wpdb->prepare( $query, $args ) );
+ }
+
+ return 0;
+}
+
+/**
+ * Creates a new post from the "Write Post" form using $_POST information.
+ *
+ * @since 2.1.0
+ *
+ * @global WP_User $current_user
+ *
+ * @return int|WP_Error
+ */
+function wp_write_post() {
+ if ( isset( $_POST['post_type'] ) ) {
+ $ptype = get_post_type_object( $_POST['post_type'] );
+ } else {
+ $ptype = get_post_type_object( 'post' );
+ }
+
+ if ( ! current_user_can( $ptype->cap->edit_posts ) ) {
+ if ( 'page' == $ptype->name ) {
+ return new WP_Error( 'edit_pages', __( 'Sorry, you are not allowed to create pages on this site.' ) );
+ } else {
+ return new WP_Error( 'edit_posts', __( 'Sorry, you are not allowed to create posts or drafts on this site.' ) );
+ }
+ }
+
+ $_POST['post_mime_type'] = '';
+
+ // Clear out any data in internal vars.
+ unset( $_POST['filter'] );
+
+ // Edit don't write if we have a post id.
+ if ( isset( $_POST['post_ID'] ) ) {
+ return edit_post();
+ }
+
+ if ( isset( $_POST['visibility'] ) ) {
+ switch ( $_POST['visibility'] ) {
+ case 'public':
+ $_POST['post_password'] = '';
+ break;
+ case 'password':
+ unset( $_POST['sticky'] );
+ break;
+ case 'private':
+ $_POST['post_status'] = 'private';
+ $_POST['post_password'] = '';
+ unset( $_POST['sticky'] );
+ break;
+ }
+ }
+
+ $translated = _wp_translate_postdata( false );
+ if ( is_wp_error( $translated ) ) {
+ return $translated;
+ }
+ $translated = _wp_get_allowed_postdata( $translated );
+
+ // Create the post.
+ $post_ID = wp_insert_post( $translated );
+ if ( is_wp_error( $post_ID ) ) {
+ return $post_ID;
+ }
+
+ if ( empty( $post_ID ) ) {
+ return 0;
+ }
+
+ add_meta( $post_ID );
+
+ add_post_meta( $post_ID, '_edit_last', $GLOBALS['current_user']->ID );
+
+ // Now that we have an ID we can fix any attachment anchor hrefs
+ _fix_attachment_links( $post_ID );
+
+ wp_set_post_lock( $post_ID );
+
+ return $post_ID;
+}
+
+/**
+ * Calls wp_write_post() and handles the errors.
+ *
+ * @since 2.0.0
+ *
+ * @return int|null
+ */
+function write_post() {
+ $result = wp_write_post();
+ if ( is_wp_error( $result ) ) {
+ wp_die( $result->get_error_message() );
+ } else {
+ return $result;
+ }
+}
+
+//
+// Post Meta
+//
+
+/**
+ * Add post meta data defined in $_POST superglobal for post with given ID.
+ *
+ * @since 1.2.0
+ *
+ * @param int $post_ID
+ * @return int|bool
+ */
+function add_meta( $post_ID ) {
+ $post_ID = (int) $post_ID;
+
+ $metakeyselect = isset( $_POST['metakeyselect'] ) ? wp_unslash( trim( $_POST['metakeyselect'] ) ) : '';
+ $metakeyinput = isset( $_POST['metakeyinput'] ) ? wp_unslash( trim( $_POST['metakeyinput'] ) ) : '';
+ $metavalue = isset( $_POST['metavalue'] ) ? $_POST['metavalue'] : '';
+ if ( is_string( $metavalue ) ) {
+ $metavalue = trim( $metavalue );
+ }
+
+ if ( ( ( '#NONE#' != $metakeyselect ) && ! empty( $metakeyselect ) ) || ! empty( $metakeyinput ) ) {
+ /*
+ * We have a key/value pair. If both the select and the input
+ * for the key have data, the input takes precedence.
+ */
+ if ( '#NONE#' != $metakeyselect ) {
+ $metakey = $metakeyselect;
+ }
+
+ if ( $metakeyinput ) {
+ $metakey = $metakeyinput; // default
+ }
+
+ if ( is_protected_meta( $metakey, 'post' ) || ! current_user_can( 'add_post_meta', $post_ID, $metakey ) ) {
+ return false;
+ }
+
+ $metakey = wp_slash( $metakey );
+
+ return add_post_meta( $post_ID, $metakey, $metavalue );
+ }
+
+ return false;
+} // add_meta
+
+/**
+ * Delete post meta data by meta ID.
+ *
+ * @since 1.2.0
+ *
+ * @param int $mid
+ * @return bool
+ */
+function delete_meta( $mid ) {
+ return delete_metadata_by_mid( 'post', $mid );
+}
+
+/**
+ * Get a list of previously defined keys.
+ *
+ * @since 1.2.0
+ *
+ * @global wpdb $wpdb WordPress database abstraction object.
+ *
+ * @return mixed
+ */
+function get_meta_keys() {
+ global $wpdb;
+
+ $keys = $wpdb->get_col(
+ "
+ SELECT meta_key
+ FROM $wpdb->postmeta
+ GROUP BY meta_key
+ ORDER BY meta_key"
+ );
+
+ return $keys;
+}
+
+/**
+ * Get post meta data by meta ID.
+ *
+ * @since 2.1.0
+ *
+ * @param int $mid
+ * @return object|bool
+ */
+function get_post_meta_by_id( $mid ) {
+ return get_metadata_by_mid( 'post', $mid );
+}
+
+/**
+ * Get meta data for the given post ID.
+ *
+ * @since 1.2.0
+ *
+ * @global wpdb $wpdb WordPress database abstraction object.
+ *
+ * @param int $postid
+ * @return mixed
+ */
+function has_meta( $postid ) {
+ global $wpdb;
+
+ return $wpdb->get_results(
+ $wpdb->prepare(
+ "SELECT meta_key, meta_value, meta_id, post_id
+ FROM $wpdb->postmeta WHERE post_id = %d
+ ORDER BY meta_key,meta_id",
+ $postid
+ ),
+ ARRAY_A
+ );
+}
+
+/**
+ * Update post meta data by meta ID.
+ *
+ * @since 1.2.0
+ *
+ * @param int $meta_id
+ * @param string $meta_key Expect Slashed
+ * @param string $meta_value Expect Slashed
+ * @return bool
+ */
+function update_meta( $meta_id, $meta_key, $meta_value ) {
+ $meta_key = wp_unslash( $meta_key );
+ $meta_value = wp_unslash( $meta_value );
+
+ return update_metadata_by_mid( 'post', $meta_id, $meta_value, $meta_key );
+}
+
+//
+// Private
+//
+
+/**
+ * Replace hrefs of attachment anchors with up-to-date permalinks.
+ *
+ * @since 2.3.0
+ * @access private
+ *
+ * @param int|object $post Post ID or post object.
+ * @return void|int|WP_Error Void if nothing fixed. 0 or WP_Error on update failure. The post ID on update success.
+ */
+function _fix_attachment_links( $post ) {
+ $post = get_post( $post, ARRAY_A );
+ $content = $post['post_content'];
+
+ // Don't run if no pretty permalinks or post is not published, scheduled, or privately published.
+ if ( ! get_option( 'permalink_structure' ) || ! in_array( $post['post_status'], array( 'publish', 'future', 'private' ) ) ) {
+ return;
+ }
+
+ // Short if there aren't any links or no '?attachment_id=' strings (strpos cannot be zero)
+ if ( ! strpos( $content, '?attachment_id=' ) || ! preg_match_all( '/<a ([^>]+)>[\s\S]+?<\/a>/', $content, $link_matches ) ) {
+ return;
+ }
+
+ $site_url = get_bloginfo( 'url' );
+ $site_url = substr( $site_url, (int) strpos( $site_url, '://' ) ); // remove the http(s)
+ $replace = '';
+
+ foreach ( $link_matches[1] as $key => $value ) {
+ if ( ! strpos( $value, '?attachment_id=' ) || ! strpos( $value, 'wp-att-' )
+ || ! preg_match( '/href=(["\'])[^"\']*\?attachment_id=(\d+)[^"\']*\\1/', $value, $url_match )
+ || ! preg_match( '/rel=["\'][^"\']*wp-att-(\d+)/', $value, $rel_match ) ) {
+ continue;
+ }
+
+ $quote = $url_match[1]; // the quote (single or double)
+ $url_id = (int) $url_match[2];
+ $rel_id = (int) $rel_match[1];
+
+ if ( ! $url_id || ! $rel_id || $url_id != $rel_id || strpos( $url_match[0], $site_url ) === false ) {
+ continue;
+ }
+
+ $link = $link_matches[0][ $key ];
+ $replace = str_replace( $url_match[0], 'href=' . $quote . get_attachment_link( $url_id ) . $quote, $link );
+
+ $content = str_replace( $link, $replace, $content );
+ }
+
+ if ( $replace ) {
+ $post['post_content'] = $content;
+ // Escape data pulled from DB.
+ $post = add_magic_quotes( $post );
+
+ return wp_update_post( $post );
+ }
+}
+
+/**
+ * Get all the possible statuses for a post_type
+ *
+ * @since 2.5.0
+ *
+ * @param string $type The post_type you want the statuses for
+ * @return array As array of all the statuses for the supplied post type
+ */
+function get_available_post_statuses( $type = 'post' ) {
+ $stati = wp_count_posts( $type );
+
+ return array_keys( get_object_vars( $stati ) );
+}
+
+/**
+ * Run the wp query to fetch the posts for listing on the edit posts page
+ *
+ * @since 2.5.0
+ *
+ * @param array|bool $q Array of query variables to use to build the query or false to use $_GET superglobal.
+ * @return array
+ */
+function wp_edit_posts_query( $q = false ) {
+ if ( false === $q ) {
+ $q = $_GET;
+ }
+ $q['m'] = isset( $q['m'] ) ? (int) $q['m'] : 0;
+ $q['cat'] = isset( $q['cat'] ) ? (int) $q['cat'] : 0;
+ $post_stati = get_post_stati();
+
+ if ( isset( $q['post_type'] ) && in_array( $q['post_type'], get_post_types() ) ) {
+ $post_type = $q['post_type'];
+ } else {
+ $post_type = 'post';
+ }
+
+ $avail_post_stati = get_available_post_statuses( $post_type );
+ $post_status = '';
+ $perm = '';
+
+ if ( isset( $q['post_status'] ) && in_array( $q['post_status'], $post_stati ) ) {
+ $post_status = $q['post_status'];
+ $perm = 'readable';
+ }
+
+ $orderby = '';
+
+ if ( isset( $q['orderby'] ) ) {
+ $orderby = $q['orderby'];
+ } elseif ( isset( $q['post_status'] ) && in_array( $q['post_status'], array( 'pending', 'draft' ) ) ) {
+ $orderby = 'modified';
+ }
+
+ $order = '';
+
+ if ( isset( $q['order'] ) ) {
+ $order = $q['order'];
+ } elseif ( isset( $q['post_status'] ) && 'pending' == $q['post_status'] ) {
+ $order = 'ASC';
+ }
+
+ $per_page = "edit_{$post_type}_per_page";
+ $posts_per_page = (int) get_user_option( $per_page );
+ if ( empty( $posts_per_page ) || $posts_per_page < 1 ) {
+ $posts_per_page = 20;
+ }
+
+ /**
+ * Filters the number of items per page to show for a specific 'per_page' type.
+ *
+ * The dynamic portion of the hook name, `$post_type`, refers to the post type.
+ *
+ * Some examples of filter hooks generated here include: 'edit_attachment_per_page',
+ * 'edit_post_per_page', 'edit_page_per_page', etc.
+ *
+ * @since 3.0.0
+ *
+ * @param int $posts_per_page Number of posts to display per page for the given post
+ * type. Default 20.
+ */
+ $posts_per_page = apply_filters( "edit_{$post_type}_per_page", $posts_per_page );
+
+ /**
+ * Filters the number of posts displayed per page when specifically listing "posts".
+ *
+ * @since 2.8.0
+ *
+ * @param int $posts_per_page Number of posts to be displayed. Default 20.
+ * @param string $post_type The post type.
+ */
+ $posts_per_page = apply_filters( 'edit_posts_per_page', $posts_per_page, $post_type );
+
+ $query = compact( 'post_type', 'post_status', 'perm', 'order', 'orderby', 'posts_per_page' );
+
+ // Hierarchical types require special args.
+ if ( is_post_type_hierarchical( $post_type ) && empty( $orderby ) ) {
+ $query['orderby'] = 'menu_order title';
+ $query['order'] = 'asc';
+ $query['posts_per_page'] = -1;
+ $query['posts_per_archive_page'] = -1;
+ $query['fields'] = 'id=>parent';
+ }
+
+ if ( ! empty( $q['show_sticky'] ) ) {
+ $query['post__in'] = (array) get_option( 'sticky_posts' );
+ }
+
+ wp( $query );
+
+ return $avail_post_stati;
+}
+
+/**
+ * Get the query variables for the current attachments request.
+ *
+ * @since 4.2.0
+ *
+ * @param array|false $q Optional. Array of query variables to use to build the query or false
+ * to use $_GET superglobal. Default false.
+ * @return array The parsed query vars.
+ */
+function wp_edit_attachments_query_vars( $q = false ) {
+ if ( false === $q ) {
+ $q = $_GET;
+ }
+ $q['m'] = isset( $q['m'] ) ? (int) $q['m'] : 0;
+ $q['cat'] = isset( $q['cat'] ) ? (int) $q['cat'] : 0;
+ $q['post_type'] = 'attachment';
+ $post_type = get_post_type_object( 'attachment' );
+ $states = 'inherit';
+ if ( current_user_can( $post_type->cap->read_private_posts ) ) {
+ $states .= ',private';
+ }
+
+ $q['post_status'] = isset( $q['status'] ) && 'trash' == $q['status'] ? 'trash' : $states;
+ $q['post_status'] = isset( $q['attachment-filter'] ) && 'trash' == $q['attachment-filter'] ? 'trash' : $states;
+
+ $media_per_page = (int) get_user_option( 'upload_per_page' );
+ if ( empty( $media_per_page ) || $media_per_page < 1 ) {
+ $media_per_page = 20;
+ }
+
+ /**
+ * Filters the number of items to list per page when listing media items.
+ *
+ * @since 2.9.0
+ *
+ * @param int $media_per_page Number of media to list. Default 20.
+ */
+ $q['posts_per_page'] = apply_filters( 'upload_per_page', $media_per_page );
+
+ $post_mime_types = get_post_mime_types();
+ if ( isset( $q['post_mime_type'] ) && ! array_intersect( (array) $q['post_mime_type'], array_keys( $post_mime_types ) ) ) {
+ unset( $q['post_mime_type'] );
+ }
+
+ foreach ( array_keys( $post_mime_types ) as $type ) {
+ if ( isset( $q['attachment-filter'] ) && "post_mime_type:$type" == $q['attachment-filter'] ) {
+ $q['post_mime_type'] = $type;
+ break;
+ }
+ }
+
+ if ( isset( $q['detached'] ) || ( isset( $q['attachment-filter'] ) && 'detached' == $q['attachment-filter'] ) ) {
+ $q['post_parent'] = 0;
+ }
+
+ if ( isset( $q['mine'] ) || ( isset( $q['attachment-filter'] ) && 'mine' == $q['attachment-filter'] ) ) {
+ $q['author'] = get_current_user_id();
+ }
+
+ // Filter query clauses to include filenames.
+ if ( isset( $q['s'] ) ) {
+ add_filter( 'posts_clauses', '_filter_query_attachment_filenames' );
+ }
+
+ return $q;
+}
+
+/**
+ * Executes a query for attachments. An array of WP_Query arguments
+ * can be passed in, which will override the arguments set by this function.
+ *
+ * @since 2.5.0
+ *
+ * @param array|false $q Array of query variables to use to build the query or false to use $_GET superglobal.
+ * @return array
+ */
+function wp_edit_attachments_query( $q = false ) {
+ wp( wp_edit_attachments_query_vars( $q ) );
+
+ $post_mime_types = get_post_mime_types();
+ $avail_post_mime_types = get_available_post_mime_types( 'attachment' );
+
+ return array( $post_mime_types, $avail_post_mime_types );
+}
+
+/**
+ * Returns the list of classes to be used by a meta box.
+ *
+ * @since 2.5.0
+ *
+ * @param string $box_id Meta box ID (used in the 'id' attribute for the meta box).
+ * @param string $screen_id The screen on which the meta box is shown.
+ * @return string Space-separated string of class names.
+ */
+function postbox_classes( $box_id, $screen_id ) {
+ if ( isset( $_GET['edit'] ) && $_GET['edit'] == $box_id ) {
+ $classes = array( '' );
+ } elseif ( $closed = get_user_option( 'closedpostboxes_' . $screen_id ) ) {
+ if ( ! is_array( $closed ) ) {
+ $classes = array( '' );
+ } else {
+ $classes = in_array( $box_id, $closed ) ? array( 'closed' ) : array( '' );
+ }
+ } else {
+ $classes = array( '' );
+ }
+
+ /**
+ * Filters the postbox classes for a specific screen and box ID combo.
+ *
+ * The dynamic portions of the hook name, `$screen_id` and `$box_id`, refer to
+ * the screen ID and meta box ID, respectively.
+ *
+ * @since 3.2.0
+ *
+ * @param string[] $classes An array of postbox classes.
+ */
+ $classes = apply_filters( "postbox_classes_{$screen_id}_{$box_id}", $classes );
+ return implode( ' ', $classes );
+}
+
+/**
+ * Get a sample permalink based off of the post name.
+ *
+ * @since 2.5.0
+ *
+ * @param int $id Post ID or post object.
+ * @param string $title Optional. Title to override the post's current title when generating the post name. Default null.
+ * @param string $name Optional. Name to override the post name. Default null.
+ * @return array Array containing the sample permalink with placeholder for the post name, and the post name.
+ */
+function get_sample_permalink( $id, $title = null, $name = null ) {
+ $post = get_post( $id );
+ if ( ! $post ) {
+ return array( '', '' );
+ }
+
+ $ptype = get_post_type_object( $post->post_type );
+
+ $original_status = $post->post_status;
+ $original_date = $post->post_date;
+ $original_name = $post->post_name;
+
+ // Hack: get_permalink() would return ugly permalink for drafts, so we will fake that our post is published.
+ if ( in_array( $post->post_status, array( 'draft', 'pending', 'future' ) ) ) {
+ $post->post_status = 'publish';
+ $post->post_name = sanitize_title( $post->post_name ? $post->post_name : $post->post_title, $post->ID );
+ }
+
+ // If the user wants to set a new name -- override the current one
+ // Note: if empty name is supplied -- use the title instead, see #6072
+ if ( ! is_null( $name ) ) {
+ $post->post_name = sanitize_title( $name ? $name : $title, $post->ID );
+ }
+
+ $post->post_name = wp_unique_post_slug( $post->post_name, $post->ID, $post->post_status, $post->post_type, $post->post_parent );
+
+ $post->filter = 'sample';
+
+ $permalink = get_permalink( $post, true );
+
+ // Replace custom post_type Token with generic pagename token for ease of use.
+ $permalink = str_replace( "%$post->post_type%", '%pagename%', $permalink );
+
+ // Handle page hierarchy
+ if ( $ptype->hierarchical ) {
+ $uri = get_page_uri( $post );
+ if ( $uri ) {
+ $uri = untrailingslashit( $uri );
+ $uri = strrev( stristr( strrev( $uri ), '/' ) );
+ $uri = untrailingslashit( $uri );
+ }
+
+ /** This filter is documented in wp-admin/edit-tag-form.php */
+ $uri = apply_filters( 'editable_slug', $uri, $post );
+ if ( ! empty( $uri ) ) {
+ $uri .= '/';
+ }
+ $permalink = str_replace( '%pagename%', "{$uri}%pagename%", $permalink );
+ }
+
+ /** This filter is documented in wp-admin/edit-tag-form.php */
+ $permalink = array( $permalink, apply_filters( 'editable_slug', $post->post_name, $post ) );
+ $post->post_status = $original_status;
+ $post->post_date = $original_date;
+ $post->post_name = $original_name;
+ unset( $post->filter );
+
+ /**
+ * Filters the sample permalink.
+ *
+ * @since 4.4.0
+ *
+ * @param array $permalink Array containing the sample permalink with placeholder for the post name, and the post name.
+ * @param int $post_id Post ID.
+ * @param string $title Post title.
+ * @param string $name Post name (slug).
+ * @param WP_Post $post Post object.
+ */
+ return apply_filters( 'get_sample_permalink', $permalink, $post->ID, $title, $name, $post );
+}
+
+/**
+ * Returns the HTML of the sample permalink slug editor.
+ *
+ * @since 2.5.0
+ *
+ * @param int $id Post ID or post object.
+ * @param string $new_title Optional. New title. Default null.
+ * @param string $new_slug Optional. New slug. Default null.
+ * @return string The HTML of the sample permalink slug editor.
+ */
+function get_sample_permalink_html( $id, $new_title = null, $new_slug = null ) {
+ $post = get_post( $id );
+ if ( ! $post ) {
+ return '';
+ }
+
+ list($permalink, $post_name) = get_sample_permalink( $post->ID, $new_title, $new_slug );
+
+ $view_link = false;
+ $preview_target = '';
+
+ if ( current_user_can( 'read_post', $post->ID ) ) {
+ if ( 'draft' === $post->post_status || empty( $post->post_name ) ) {
+ $view_link = get_preview_post_link( $post );
+ $preview_target = " target='wp-preview-{$post->ID}'";
+ } else {
+ if ( 'publish' === $post->post_status || 'attachment' === $post->post_type ) {
+ $view_link = get_permalink( $post );
+ } else {
+ // Allow non-published (private, future) to be viewed at a pretty permalink, in case $post->post_name is set
+ $view_link = str_replace( array( '%pagename%', '%postname%' ), $post->post_name, $permalink );
+ }
+ }
+ }
+
+ // Permalinks without a post/page name placeholder don't have anything to edit
+ if ( false === strpos( $permalink, '%postname%' ) && false === strpos( $permalink, '%pagename%' ) ) {
+ $return = '<strong>' . __( 'Permalink:' ) . "</strong>\n";
+
+ if ( false !== $view_link ) {
+ $display_link = urldecode( $view_link );
+ $return .= '<a id="sample-permalink" href="' . esc_url( $view_link ) . '"' . $preview_target . '>' . esc_html( $display_link ) . "</a>\n";
+ } else {
+ $return .= '<span id="sample-permalink">' . $permalink . "</span>\n";
+ }
+
+ // Encourage a pretty permalink setting
+ if ( '' == get_option( 'permalink_structure' ) && current_user_can( 'manage_options' ) && ! ( 'page' == get_option( 'show_on_front' ) && $id == get_option( 'page_on_front' ) ) ) {
+ $return .= '<span id="change-permalinks"><a href="options-permalink.php" class="button button-small" target="_blank">' . __( 'Change Permalinks' ) . "</a></span>\n";
+ }
+ } else {
+ if ( mb_strlen( $post_name ) > 34 ) {
+ $post_name_abridged = mb_substr( $post_name, 0, 16 ) . '&hellip;' . mb_substr( $post_name, -16 );
+ } else {
+ $post_name_abridged = $post_name;
+ }
+
+ $post_name_html = '<span id="editable-post-name">' . esc_html( $post_name_abridged ) . '</span>';
+ $display_link = str_replace( array( '%pagename%', '%postname%' ), $post_name_html, esc_html( urldecode( $permalink ) ) );
+
+ $return = '<strong>' . __( 'Permalink:' ) . "</strong>\n";
+ $return .= '<span id="sample-permalink"><a href="' . esc_url( $view_link ) . '"' . $preview_target . '>' . $display_link . "</a></span>\n";
+ $return .= '&lrm;'; // Fix bi-directional text display defect in RTL languages.
+ $return .= '<span id="edit-slug-buttons"><button type="button" class="edit-slug button button-small hide-if-no-js" aria-label="' . __( 'Edit permalink' ) . '">' . __( 'Edit' ) . "</button></span>\n";
+ $return .= '<span id="editable-post-name-full">' . esc_html( $post_name ) . "</span>\n";
+ }
+
+ /**
+ * Filters the sample permalink HTML markup.
+ *
+ * @since 2.9.0
+ * @since 4.4.0 Added `$post` parameter.
+ *
+ * @param string $return Sample permalink HTML markup.
+ * @param int $post_id Post ID.
+ * @param string $new_title New sample permalink title.
+ * @param string $new_slug New sample permalink slug.
+ * @param WP_Post $post Post object.
+ */
+ $return = apply_filters( 'get_sample_permalink_html', $return, $post->ID, $new_title, $new_slug, $post );
+
+ return $return;
+}
+
+/**
+ * Output HTML for the post thumbnail meta-box.
+ *
+ * @since 2.9.0
+ *
+ * @param int $thumbnail_id ID of the attachment used for thumbnail
+ * @param mixed $post The post ID or object associated with the thumbnail, defaults to global $post.
+ * @return string html
+ */
+function _wp_post_thumbnail_html( $thumbnail_id = null, $post = null ) {
+ $_wp_additional_image_sizes = wp_get_additional_image_sizes();
+
+ $post = get_post( $post );
+ $post_type_object = get_post_type_object( $post->post_type );
+ $set_thumbnail_link = '<p class="hide-if-no-js"><a href="%s" id="set-post-thumbnail"%s class="thickbox">%s</a></p>';
+ $upload_iframe_src = get_upload_iframe_src( 'image', $post->ID );
+
+ $content = sprintf(
+ $set_thumbnail_link,
+ esc_url( $upload_iframe_src ),
+ '', // Empty when there's no featured image set, `aria-describedby` attribute otherwise.
+ esc_html( $post_type_object->labels->set_featured_image )
+ );
+
+ if ( $thumbnail_id && get_post( $thumbnail_id ) ) {
+ $size = isset( $_wp_additional_image_sizes['post-thumbnail'] ) ? 'post-thumbnail' : array( 266, 266 );
+
+ /**
+ * Filters the size used to display the post thumbnail image in the 'Featured Image' meta box.
+ *
+ * Note: When a theme adds 'post-thumbnail' support, a special 'post-thumbnail'
+ * image size is registered, which differs from the 'thumbnail' image size
+ * managed via the Settings > Media screen. See the `$size` parameter description
+ * for more information on default values.
+ *
+ * @since 4.4.0
+ *
+ * @param string|array $size Post thumbnail image size to display in the meta box. Accepts any valid
+ * image size, or an array of width and height values in pixels (in that order).
+ * If the 'post-thumbnail' size is set, default is 'post-thumbnail'. Otherwise,
+ * default is an array with 266 as both the height and width values.
+ * @param int $thumbnail_id Post thumbnail attachment ID.
+ * @param WP_Post $post The post object associated with the thumbnail.
+ */
+ $size = apply_filters( 'admin_post_thumbnail_size', $size, $thumbnail_id, $post );
+
+ $thumbnail_html = wp_get_attachment_image( $thumbnail_id, $size );
+
+ if ( ! empty( $thumbnail_html ) ) {
+ $content = sprintf(
+ $set_thumbnail_link,
+ esc_url( $upload_iframe_src ),
+ ' aria-describedby="set-post-thumbnail-desc"',
+ $thumbnail_html
+ );
+ $content .= '<p class="hide-if-no-js howto" id="set-post-thumbnail-desc">' . __( 'Click the image to edit or update' ) . '</p>';
+ $content .= '<p class="hide-if-no-js"><a href="#" id="remove-post-thumbnail">' . esc_html( $post_type_object->labels->remove_featured_image ) . '</a></p>';
+ }
+ }
+
+ $content .= '<input type="hidden" id="_thumbnail_id" name="_thumbnail_id" value="' . esc_attr( $thumbnail_id ? $thumbnail_id : '-1' ) . '" />';
+
+ /**
+ * Filters the admin post thumbnail HTML markup to return.
+ *
+ * @since 2.9.0
+ * @since 3.5.0 Added the `$post_id` parameter.
+ * @since 4.6.0 Added the `$thumbnail_id` parameter.
+ *
+ * @param string $content Admin post thumbnail HTML markup.
+ * @param int $post_id Post ID.
+ * @param int|null $thumbnail_id Thumbnail attachment ID, or null if there isn't one.
+ */
+ return apply_filters( 'admin_post_thumbnail_html', $content, $post->ID, $thumbnail_id );
+}
+
+/**
+ * Check to see if the post is currently being edited by another user.
+ *
+ * @since 2.5.0
+ *
+ * @param int $post_id ID of the post to check for editing.
+ * @return int|false ID of the user with lock. False if the post does not exist, post is not locked,
+ * the user with lock does not exist, or the post is locked by current user.
+ */
+function wp_check_post_lock( $post_id ) {
+ if ( ! $post = get_post( $post_id ) ) {
+ return false;
+ }
+
+ if ( ! $lock = get_post_meta( $post->ID, '_edit_lock', true ) ) {
+ return false;
+ }
+
+ $lock = explode( ':', $lock );
+ $time = $lock[0];
+ $user = isset( $lock[1] ) ? $lock[1] : get_post_meta( $post->ID, '_edit_last', true );
+
+ if ( ! get_userdata( $user ) ) {
+ return false;
+ }
+
+ /** This filter is documented in wp-admin/includes/ajax-actions.php */
+ $time_window = apply_filters( 'wp_check_post_lock_window', 150 );
+
+ if ( $time && $time > time() - $time_window && $user != get_current_user_id() ) {
+ return $user;
+ }
+
+ return false;
+}
+
+/**
+ * Mark the post as currently being edited by the current user
+ *
+ * @since 2.5.0
+ *
+ * @param int $post_id ID of the post being edited.
+ * @return array|false Array of the lock time and user ID. False if the post does not exist, or
+ * there is no current user.
+ */
+function wp_set_post_lock( $post_id ) {
+ if ( ! $post = get_post( $post_id ) ) {
+ return false;
+ }
+
+ if ( 0 == ( $user_id = get_current_user_id() ) ) {
+ return false;
+ }
+
+ $now = time();
+ $lock = "$now:$user_id";
+
+ update_post_meta( $post->ID, '_edit_lock', $lock );
+
+ return array( $now, $user_id );
+}
+
+/**
+ * Outputs the HTML for the notice to say that someone else is editing or has taken over editing of this post.
+ *
+ * @since 2.8.5
+ * @return none
+ */
+function _admin_notice_post_locked() {
+ if ( ! $post = get_post() ) {
+ return;
+ }
+
+ $user = null;
+ if ( $user_id = wp_check_post_lock( $post->ID ) ) {
+ $user = get_userdata( $user_id );
+ }
+
+ if ( $user ) {
+
+ /**
+ * Filters whether to show the post locked dialog.
+ *
+ * Returning a falsey value to the filter will short-circuit displaying the dialog.
+ *
+ * @since 3.6.0
+ *
+ * @param bool $display Whether to display the dialog. Default true.
+ * @param WP_Post $post Post object.
+ * @param WP_User|bool $user WP_User object on success, false otherwise.
+ */
+ if ( ! apply_filters( 'show_post_locked_dialog', true, $post, $user ) ) {
+ return;
+ }
+
+ $locked = true;
+ } else {
+ $locked = false;
+ }
+
+ if ( $locked && ( $sendback = wp_get_referer() ) &&
+ false === strpos( $sendback, 'post.php' ) && false === strpos( $sendback, 'post-new.php' ) ) {
+
+ $sendback_text = __( 'Go back' );
+ } else {
+ $sendback = admin_url( 'edit.php' );
+
+ if ( 'post' != $post->post_type ) {
+ $sendback = add_query_arg( 'post_type', $post->post_type, $sendback );
+ }
+
+ $sendback_text = get_post_type_object( $post->post_type )->labels->all_items;
+ }
+
+ $hidden = $locked ? '' : ' hidden';
+
+ ?>
+ <div id="post-lock-dialog" class="notification-dialog-wrap<?php echo $hidden; ?>">
+ <div class="notification-dialog-background"></div>
+ <div class="notification-dialog">
+ <?php
+
+ if ( $locked ) {
+ $query_args = array();
+ if ( get_post_type_object( $post->post_type )->public ) {
+ if ( 'publish' == $post->post_status || $user->ID != $post->post_author ) {
+ // Latest content is in autosave
+ $nonce = wp_create_nonce( 'post_preview_' . $post->ID );
+ $query_args['preview_id'] = $post->ID;
+ $query_args['preview_nonce'] = $nonce;
+ }
+ }
+
+ $preview_link = get_preview_post_link( $post->ID, $query_args );
+
+ /**
+ * Filters whether to allow the post lock to be overridden.
+ *
+ * Returning a falsey value to the filter will disable the ability
+ * to override the post lock.
+ *
+ * @since 3.6.0
+ *
+ * @param bool $override Whether to allow overriding post locks. Default true.
+ * @param WP_Post $post Post object.
+ * @param WP_User $user User object.
+ */
+ $override = apply_filters( 'override_post_lock', true, $post, $user );
+ $tab_last = $override ? '' : ' wp-tab-last';
+
+ ?>
+ <div class="post-locked-message">
+ <div class="post-locked-avatar"><?php echo get_avatar( $user->ID, 64 ); ?></div>
+ <p class="currently-editing wp-tab-first" tabindex="0">
+ <?php
+ if ( $override ) {
+ /* translators: %s: user's display name */
+ printf( __( '%s is already editing this post. Do you want to take over?' ), esc_html( $user->display_name ) );
+ } else {
+ /* translators: %s: user's display name */
+ printf( __( '%s is already editing this post.' ), esc_html( $user->display_name ) );
+ }
+ ?>
+ </p>
+ <?php
+ /**
+ * Fires inside the post locked dialog before the buttons are displayed.
+ *
+ * @since 3.6.0
+ *
+ * @param WP_Post $post Post object.
+ */
+ do_action( 'post_locked_dialog', $post );
+ ?>
+ <p>
+ <a class="button" href="<?php echo esc_url( $sendback ); ?>"><?php echo $sendback_text; ?></a>
+ <?php if ( $preview_link ) { ?>
+ <a class="button<?php echo $tab_last; ?>" href="<?php echo esc_url( $preview_link ); ?>"><?php _e( 'Preview' ); ?></a>
+ <?php
+ }
+
+ // Allow plugins to prevent some users overriding the post lock
+ if ( $override ) {
+ ?>
+ <a class="button button-primary wp-tab-last" href="<?php echo esc_url( add_query_arg( 'get-post-lock', '1', wp_nonce_url( get_edit_post_link( $post->ID, 'url' ), 'lock-post_' . $post->ID ) ) ); ?>"><?php _e( 'Take over' ); ?></a>
+ <?php
+ }
+
+ ?>
+ </p>
+ </div>
+ <?php
+ } else {
+ ?>
+ <div class="post-taken-over">
+ <div class="post-locked-avatar"></div>
+ <p class="wp-tab-first" tabindex="0">
+ <span class="currently-editing"></span><br />
+ <span class="locked-saving hidden"><img src="<?php echo esc_url( admin_url( 'images/spinner-2x.gif' ) ); ?>" width="16" height="16" alt="" /> <?php _e( 'Saving revision&hellip;' ); ?></span>
+ <span class="locked-saved hidden"><?php _e( 'Your latest changes were saved as a revision.' ); ?></span>
+ </p>
+ <?php
+ /**
+ * Fires inside the dialog displayed when a user has lost the post lock.
+ *
+ * @since 3.6.0
+ *
+ * @param WP_Post $post Post object.
+ */
+ do_action( 'post_lock_lost_dialog', $post );
+ ?>
+ <p><a class="button button-primary wp-tab-last" href="<?php echo esc_url( $sendback ); ?>"><?php echo $sendback_text; ?></a></p>
+ </div>
+ <?php
+ }
+
+ ?>
+ </div>
+ </div>
+ <?php
+}
+
+/**
+ * Creates autosave data for the specified post from $_POST data.
+ *
+ * @since 2.6.0
+ *
+ * @param mixed $post_data Associative array containing the post data or int post ID.
+ * @return mixed The autosave revision ID. WP_Error or 0 on error.
+ */
+function wp_create_post_autosave( $post_data ) {
+ if ( is_numeric( $post_data ) ) {
+ $post_id = $post_data;
+ $post_data = $_POST;
+ } else {
+ $post_id = (int) $post_data['post_ID'];
+ }
+
+ $post_data = _wp_translate_postdata( true, $post_data );
+ if ( is_wp_error( $post_data ) ) {
+ return $post_data;
+ }
+ $post_data = _wp_get_allowed_postdata( $post_data );
+
+ $post_author = get_current_user_id();
+
+ // Store one autosave per author. If there is already an autosave, overwrite it.
+ if ( $old_autosave = wp_get_post_autosave( $post_id, $post_author ) ) {
+ $new_autosave = _wp_post_revision_data( $post_data, true );
+ $new_autosave['ID'] = $old_autosave->ID;
+ $new_autosave['post_author'] = $post_author;
+
+ // If the new autosave has the same content as the post, delete the autosave.
+ $post = get_post( $post_id );
+ $autosave_is_different = false;
+ foreach ( array_intersect( array_keys( $new_autosave ), array_keys( _wp_post_revision_fields( $post ) ) ) as $field ) {
+ if ( normalize_whitespace( $new_autosave[ $field ] ) != normalize_whitespace( $post->$field ) ) {
+ $autosave_is_different = true;
+ break;
+ }
+ }
+
+ if ( ! $autosave_is_different ) {
+ wp_delete_post_revision( $old_autosave->ID );
+ return 0;
+ }
+
+ /**
+ * Fires before an autosave is stored.
+ *
+ * @since 4.1.0
+ *
+ * @param array $new_autosave Post array - the autosave that is about to be saved.
+ */
+ do_action( 'wp_creating_autosave', $new_autosave );
+
+ return wp_update_post( $new_autosave );
+ }
+
+ // _wp_put_post_revision() expects unescaped.
+ $post_data = wp_unslash( $post_data );
+
+ // Otherwise create the new autosave as a special post revision
+ return _wp_put_post_revision( $post_data, true );
+}
+
+/**
+ * Saves a draft or manually autosaves for the purpose of showing a post preview.
+ *
+ * @since 2.7.0
+ *
+ * @return string URL to redirect to show the preview.
+ */
+function post_preview() {
+
+ $post_ID = (int) $_POST['post_ID'];
+ $_POST['ID'] = $post_ID;
+
+ if ( ! $post = get_post( $post_ID ) ) {
+ wp_die( __( 'Sorry, you are not allowed to edit this post.' ) );
+ }
+
+ if ( ! current_user_can( 'edit_post', $post->ID ) ) {
+ wp_die( __( 'Sorry, you are not allowed to edit this post.' ) );
+ }
+
+ $is_autosave = false;
+
+ if ( ! wp_check_post_lock( $post->ID ) && get_current_user_id() == $post->post_author && ( 'draft' == $post->post_status || 'auto-draft' == $post->post_status ) ) {
+ $saved_post_id = edit_post();
+ } else {
+ $is_autosave = true;
+
+ if ( isset( $_POST['post_status'] ) && 'auto-draft' == $_POST['post_status'] ) {
+ $_POST['post_status'] = 'draft';
+ }
+
+ $saved_post_id = wp_create_post_autosave( $post->ID );
+ }
+
+ if ( is_wp_error( $saved_post_id ) ) {
+ wp_die( $saved_post_id->get_error_message() );
+ }
+
+ $query_args = array();
+
+ if ( $is_autosave && $saved_post_id ) {
+ $query_args['preview_id'] = $post->ID;
+ $query_args['preview_nonce'] = wp_create_nonce( 'post_preview_' . $post->ID );
+
+ if ( isset( $_POST['post_format'] ) ) {
+ $query_args['post_format'] = empty( $_POST['post_format'] ) ? 'standard' : sanitize_key( $_POST['post_format'] );
+ }
+
+ if ( isset( $_POST['_thumbnail_id'] ) ) {
+ $query_args['_thumbnail_id'] = ( intval( $_POST['_thumbnail_id'] ) <= 0 ) ? '-1' : intval( $_POST['_thumbnail_id'] );
+ }
+ }
+
+ return get_preview_post_link( $post, $query_args );
+}
+
+/**
+ * Save a post submitted with XHR
+ *
+ * Intended for use with heartbeat and autosave.js
+ *
+ * @since 3.9.0
+ *
+ * @param array $post_data Associative array of the submitted post data.
+ * @return mixed The value 0 or WP_Error on failure. The saved post ID on success.
+ * The ID can be the draft post_id or the autosave revision post_id.
+ */
+function wp_autosave( $post_data ) {
+ // Back-compat
+ if ( ! defined( 'DOING_AUTOSAVE' ) ) {
+ define( 'DOING_AUTOSAVE', true );
+ }
+
+ $post_id = (int) $post_data['post_id'];
+ $post_data['ID'] = $post_data['post_ID'] = $post_id;
+
+ if ( false === wp_verify_nonce( $post_data['_wpnonce'], 'update-post_' . $post_id ) ) {
+ return new WP_Error( 'invalid_nonce', __( 'Error while saving.' ) );
+ }
+
+ $post = get_post( $post_id );
+
+ if ( ! current_user_can( 'edit_post', $post->ID ) ) {
+ return new WP_Error( 'edit_posts', __( 'Sorry, you are not allowed to edit this item.' ) );
+ }
+
+ if ( 'auto-draft' == $post->post_status ) {
+ $post_data['post_status'] = 'draft';
+ }
+
+ if ( $post_data['post_type'] != 'page' && ! empty( $post_data['catslist'] ) ) {
+ $post_data['post_category'] = explode( ',', $post_data['catslist'] );
+ }
+
+ if ( ! wp_check_post_lock( $post->ID ) && get_current_user_id() == $post->post_author && ( 'auto-draft' == $post->post_status || 'draft' == $post->post_status ) ) {
+ // Drafts and auto-drafts are just overwritten by autosave for the same user if the post is not locked
+ return edit_post( wp_slash( $post_data ) );
+ } else {
+ // Non drafts or other users drafts are not overwritten. The autosave is stored in a special post revision for each user.
+ return wp_create_post_autosave( wp_slash( $post_data ) );
+ }
+}
+
+/**
+ * Redirect to previous page.
+ *
+ * @param int $post_id Optional. Post ID.
+ */
+function redirect_post( $post_id = '' ) {
+ if ( isset( $_POST['save'] ) || isset( $_POST['publish'] ) ) {
+ $status = get_post_status( $post_id );
+
+ if ( isset( $_POST['publish'] ) ) {
+ switch ( $status ) {
+ case 'pending':
+ $message = 8;
+ break;
+ case 'future':
+ $message = 9;
+ break;
+ default:
+ $message = 6;
+ }
+ } else {
+ $message = 'draft' == $status ? 10 : 1;
+ }
+
+ $location = add_query_arg( 'message', $message, get_edit_post_link( $post_id, 'url' ) );
+ } elseif ( isset( $_POST['addmeta'] ) && $_POST['addmeta'] ) {
+ $location = add_query_arg( 'message', 2, wp_get_referer() );
+ $location = explode( '#', $location );
+ $location = $location[0] . '#postcustom';
+ } elseif ( isset( $_POST['deletemeta'] ) && $_POST['deletemeta'] ) {
+ $location = add_query_arg( 'message', 3, wp_get_referer() );
+ $location = explode( '#', $location );
+ $location = $location[0] . '#postcustom';
+ } else {
+ $location = add_query_arg( 'message', 4, get_edit_post_link( $post_id, 'url' ) );
+ }
+
+ /**
+ * Filters the post redirect destination URL.
+ *
+ * @since 2.9.0
+ *
+ * @param string $location The destination URL.
+ * @param int $post_id The post ID.
+ */
+ wp_redirect( apply_filters( 'redirect_post_location', $location, $post_id ) );
+ exit;
+}
+
+/**
+ * Sanitizes POST values from a checkbox taxonomy metabox.
+ *
+ * @since 5.1.0
+ *
+ * @param mixed $terms Raw term data from the 'tax_input' field.
+ * @return array
+ */
+function taxonomy_meta_box_sanitize_cb_checkboxes( $taxonomy, $terms ) {
+ return array_map( 'intval', $terms );
+}
+
+/**
+ * Sanitizes POST values from an input taxonomy metabox.
+ *
+ * @since 5.1.0
+ *
+ * @param mixed $terms Raw term data from the 'tax_input' field.
+ * @return array
+ */
+function taxonomy_meta_box_sanitize_cb_input( $taxonomy, $terms ) {
+ /*
+ * Assume that a 'tax_input' string is a comma-separated list of term names.
+ * Some languages may use a character other than a comma as a delimiter, so we standardize on
+ * commas before parsing the list.
+ */
+ if ( ! is_array( $terms ) ) {
+ $comma = _x( ',', 'tag delimiter' );
+ if ( ',' !== $comma ) {
+ $terms = str_replace( $comma, ',', $terms );
+ }
+ $terms = explode( ',', trim( $terms, " \n\t\r\0\x0B," ) );
+ }
+
+ $clean_terms = array();
+ foreach ( $terms as $term ) {
+ // Empty terms are invalid input.
+ if ( empty( $term ) ) {
+ continue;
+ }
+
+ $_term = get_terms(
+ $taxonomy,
+ array(
+ 'name' => $term,
+ 'fields' => 'ids',
+ 'hide_empty' => false,
+ )
+ );
+
+ if ( ! empty( $_term ) ) {
+ $clean_terms[] = intval( $_term[0] );
+ } else {
+ // No existing term was found, so pass the string. A new term will be created.
+ $clean_terms[] = $term;
+ }
+ }
+
+ return $clean_terms;
+}
+
+/**
+ * Return whether the post can be edited in the block editor.
+ *
+ * @since 5.0.0
+ *
+ * @param int|WP_Post $post Post ID or WP_Post object.
+ * @return bool Whether the post can be edited in the block editor.
+ */
+function use_block_editor_for_post( $post ) {
+ $post = get_post( $post );
+
+ if ( ! $post ) {
+ return false;
+ }
+
+ // We're in the meta box loader, so don't use the block editor.
+ if ( isset( $_GET['meta-box-loader'] ) ) {
+ check_admin_referer( 'meta-box-loader', 'meta-box-loader-nonce' );
+ return false;
+ }
+
+ // The posts page can't be edited in the block editor.
+ if ( absint( get_option( 'page_for_posts' ) ) === $post->ID && empty( $post->post_content ) ) {
+ return false;
+ }
+
+ $use_block_editor = use_block_editor_for_post_type( $post->post_type );
+
+ /**
+ * Filter whether a post is able to be edited in the block editor.
+ *
+ * @since 5.0.0
+ *
+ * @param bool $use_block_editor Whether the post can be edited or not.
+ * @param WP_Post $post The post being checked.
+ */
+ return apply_filters( 'use_block_editor_for_post', $use_block_editor, $post );
+}
+
+/**
+ * Return whether a post type is compatible with the block editor.
+ *
+ * The block editor depends on the REST API, and if the post type is not shown in the
+ * REST API, then it won't work with the block editor.
+ *
+ * @since 5.0.0
+ *
+ * @param string $post_type The post type.
+ * @return bool Whether the post type can be edited with the block editor.
+ */
+function use_block_editor_for_post_type( $post_type ) {
+ if ( ! post_type_exists( $post_type ) ) {
+ return false;
+ }
+
+ if ( ! post_type_supports( $post_type, 'editor' ) ) {
+ return false;
+ }
+
+ $post_type_object = get_post_type_object( $post_type );
+ if ( $post_type_object && ! $post_type_object->show_in_rest ) {
+ return false;
+ }
+
+ /**
+ * Filter whether a post is able to be edited in the block editor.
+ *
+ * @since 5.0.0
+ *
+ * @param bool $use_block_editor Whether the post type can be edited or not. Default true.
+ * @param string $post_type The post type being checked.
+ */
+ return apply_filters( 'use_block_editor_for_post_type', true, $post_type );
+}
+
+/**
+ * Returns all the block categories that will be shown in the block editor.
+ *
+ * @since 5.0.0
+ *
+ * @param WP_Post $post Post object.
+ * @return array Array of block categories.
+ */
+function get_block_categories( $post ) {
+ $default_categories = array(
+ array(
+ 'slug' => 'common',
+ 'title' => __( 'Common Blocks' ),
+ 'icon' => null,
+ ),
+ array(
+ 'slug' => 'formatting',
+ 'title' => __( 'Formatting' ),
+ 'icon' => null,
+ ),
+ array(
+ 'slug' => 'layout',
+ 'title' => __( 'Layout Elements' ),
+ 'icon' => null,
+ ),
+ array(
+ 'slug' => 'widgets',
+ 'title' => __( 'Widgets' ),
+ 'icon' => null,
+ ),
+ array(
+ 'slug' => 'embed',
+ 'title' => __( 'Embeds' ),
+ 'icon' => null,
+ ),
+ array(
+ 'slug' => 'reusable',
+ 'title' => __( 'Reusable Blocks' ),
+ 'icon' => null,
+ ),
+ );
+
+ /**
+ * Filter the default array of block categories.
+ *
+ * @since 5.0.0
+ *
+ * @param array $default_categories Array of block categories.
+ * @param WP_Post $post Post being loaded.
+ */
+ return apply_filters( 'block_categories', $default_categories, $post );
+}
+
+/**
+ * Prepares server-registered blocks for the block editor.
+ *
+ * Returns an associative array of registered block data keyed by block name. Data includes properties
+ * of a block relevant for client registration.
+ *
+ * @since 5.0.0
+ *
+ * @return array An associative array of registered block data.
+ */
+function get_block_editor_server_block_settings() {
+ $block_registry = WP_Block_Type_Registry::get_instance();
+ $blocks = array();
+ $keys_to_pick = array( 'title', 'description', 'icon', 'category', 'keywords', 'supports', 'attributes' );
+
+ foreach ( $block_registry->get_all_registered() as $block_name => $block_type ) {
+ foreach ( $keys_to_pick as $key ) {
+ if ( ! isset( $block_type->{ $key } ) ) {
+ continue;
+ }
+
+ if ( ! isset( $blocks[ $block_name ] ) ) {
+ $blocks[ $block_name ] = array();
+ }
+
+ $blocks[ $block_name ][ $key ] = $block_type->{ $key };
+ }
+ }
+
+ return $blocks;
+}
+
+/**
+ * Renders the meta boxes forms.
+ *
+ * @since 5.0.0
+ */
+function the_block_editor_meta_boxes() {
+ global $post, $current_screen, $wp_meta_boxes;
+
+ // Handle meta box state.
+ $_original_meta_boxes = $wp_meta_boxes;
+
+ /**
+ * Fires right before the meta boxes are rendered.
+ *
+ * This allows for the filtering of meta box data, that should already be
+ * present by this point. Do not use as a means of adding meta box data.
+ *
+ * @since 5.0.0
+ *
+ * @param array $wp_meta_boxes Global meta box state.
+ */
+ $wp_meta_boxes = apply_filters( 'filter_block_editor_meta_boxes', $wp_meta_boxes );
+ $locations = array( 'side', 'normal', 'advanced' );
+ $priorities = array( 'high', 'sorted', 'core', 'default', 'low' );
+
+ // Render meta boxes.
+ ?>
+ <form class="metabox-base-form">
+ <?php the_block_editor_meta_box_post_form_hidden_fields( $post ); ?>
+ </form>
+ <form id="toggle-custom-fields-form" method="post" action="<?php echo esc_attr( admin_url( 'post.php' ) ); ?>">
+ <?php wp_nonce_field( 'toggle-custom-fields' ); ?>
+ <input type="hidden" name="action" value="toggle-custom-fields" />
+ </form>
+ <?php foreach ( $locations as $location ) : ?>
+ <form class="metabox-location-<?php echo esc_attr( $location ); ?>" onsubmit="return false;">
+ <div id="poststuff" class="sidebar-open">
+ <div id="postbox-container-2" class="postbox-container">
+ <?php
+ do_meta_boxes(
+ $current_screen,
+ $location,
+ $post
+ );
+ ?>
+ </div>
+ </div>
+ </form>
+ <?php endforeach; ?>
+ <?php
+
+ $meta_boxes_per_location = array();
+ foreach ( $locations as $location ) {
+ $meta_boxes_per_location[ $location ] = array();
+
+ if ( ! isset( $wp_meta_boxes[ $current_screen->id ][ $location ] ) ) {
+ continue;
+ }
+
+ foreach ( $priorities as $priority ) {
+ if ( ! isset( $wp_meta_boxes[ $current_screen->id ][ $location ][ $priority ] ) ) {
+ continue;
+ }
+
+ $meta_boxes = (array) $wp_meta_boxes[ $current_screen->id ][ $location ][ $priority ];
+ foreach ( $meta_boxes as $meta_box ) {
+ if ( false == $meta_box || ! $meta_box['title'] ) {
+ continue;
+ }
+
+ // If a meta box is just here for back compat, don't show it in the block editor.
+ if ( isset( $meta_box['args']['__back_compat_meta_box'] ) && $meta_box['args']['__back_compat_meta_box'] ) {
+ continue;
+ }
+
+ $meta_boxes_per_location[ $location ][] = array(
+ 'id' => $meta_box['id'],
+ 'title' => $meta_box['title'],
+ );
+ }
+ }
+ }
+
+ /**
+ * Sadly we probably can not add this data directly into editor settings.
+ *
+ * Some meta boxes need admin_head to fire for meta box registry.
+ * admin_head fires after admin_enqueue_scripts, which is where we create our
+ * editor instance.
+ */
+ $script = 'window._wpLoadBlockEditor.then( function() {
+ wp.data.dispatch( \'core/edit-post\' ).setAvailableMetaBoxesPerLocation( ' . wp_json_encode( $meta_boxes_per_location ) . ' );
+ } );';
+
+ wp_add_inline_script( 'wp-edit-post', $script );
+
+ /**
+ * When `wp-edit-post` is output in the `<head>`, the inline script needs to be manually printed. Otherwise,
+ * meta boxes will not display because inline scripts for `wp-edit-post` will not be printed again after this point.
+ */
+ if ( wp_script_is( 'wp-edit-post', 'done' ) ) {
+ printf( "<script type='text/javascript'>\n%s\n</script>\n", trim( $script ) );
+ }
+
+ /**
+ * If the 'postcustom' meta box is enabled, then we need to perform some
+ * extra initialization on it.
+ */
+ $enable_custom_fields = (bool) get_user_meta( get_current_user_id(), 'enable_custom_fields', true );
+ if ( $enable_custom_fields ) {
+ $script = "( function( $ ) {
+ if ( $('#postcustom').length ) {
+ $( '#the-list' ).wpList( {
+ addBefore: function( s ) {
+ s.data += '&post_id=$post->ID';
+ return s;
+ },
+ addAfter: function() {
+ $('table#list-table').show();
+ }
+ });
+ }
+ } )( jQuery );";
+ wp_enqueue_script( 'wp-lists' );
+ wp_add_inline_script( 'wp-lists', $script );
+ }
+
+ // Reset meta box data.
+ $wp_meta_boxes = $_original_meta_boxes;
+}
+
+/**
+ * Renders the hidden form required for the meta boxes form.
+ *
+ * @since 5.0.0
+ *
+ * @param WP_Post $post Current post object.
+ */
+function the_block_editor_meta_box_post_form_hidden_fields( $post ) {
+ $form_extra = '';
+ if ( 'auto-draft' === $post->post_status ) {
+ $form_extra .= "<input type='hidden' id='auto_draft' name='auto_draft' value='1' />";
+ }
+ $form_action = 'editpost';
+ $nonce_action = 'update-post_' . $post->ID;
+ $form_extra .= "<input type='hidden' id='post_ID' name='post_ID' value='" . esc_attr( $post->ID ) . "' />";
+ $referer = wp_get_referer();
+ $current_user = wp_get_current_user();
+ $user_id = $current_user->ID;
+ wp_nonce_field( $nonce_action );
+
+ /*
+ * Some meta boxes hook into these actions to add hidden input fields in the classic post form. For backwards
+ * compatibility, we can capture the output from these actions, and extract the hidden input fields.
+ */
+ ob_start();
+ /** This filter is documented in wp-admin/edit-form-advanced.php */
+ do_action( 'edit_form_after_title', $post );
+ /** This filter is documented in wp-admin/edit-form-advanced.php */
+ do_action( 'edit_form_advanced', $post );
+ $classic_output = ob_get_clean();
+
+ $classic_elements = wp_html_split( $classic_output );
+ $hidden_inputs = '';
+ foreach ( $classic_elements as $element ) {
+ if ( 0 !== strpos( $element, '<input ' ) ) {
+ continue;
+ }
+
+ if ( preg_match( '/\stype=[\'"]hidden[\'"]\s/', $element ) ) {
+ echo $element;
+ }
+ }
+ ?>
+ <input type="hidden" id="user-id" name="user_ID" value="<?php echo (int) $user_id; ?>" />
+ <input type="hidden" id="hiddenaction" name="action" value="<?php echo esc_attr( $form_action ); ?>" />
+ <input type="hidden" id="originalaction" name="originalaction" value="<?php echo esc_attr( $form_action ); ?>" />
+ <input type="hidden" id="post_type" name="post_type" value="<?php echo esc_attr( $post->post_type ); ?>" />
+ <input type="hidden" id="original_post_status" name="original_post_status" value="<?php echo esc_attr( $post->post_status ); ?>" />
+ <input type="hidden" id="referredby" name="referredby" value="<?php echo $referer ? esc_url( $referer ) : ''; ?>" />
+
+ <?php
+ if ( 'draft' !== get_post_status( $post ) ) {
+ wp_original_referer_field( true, 'previous' );
+ }
+ echo $form_extra;
+ wp_nonce_field( 'meta-box-order', 'meta-box-order-nonce', false );
+ wp_nonce_field( 'closedpostboxes', 'closedpostboxesnonce', false );
+ // Permalink title nonce.
+ wp_nonce_field( 'samplepermalink', 'samplepermalinknonce', false );
+
+ /**
+ * Add hidden input fields to the meta box save form.
+ *
+ * Hook into this action to print `<input type="hidden" ... />` fields, which will be POSTed back to
+ * the server when meta boxes are saved.
+ *
+ * @since 5.0.0
+ *
+ * @params WP_Post $post The post that is being edited.
+ */
+ do_action( 'block_editor_meta_box_hidden_fields', $post );
+}
diff --git a/www/crm/wp-admin/includes/revision.php b/www/crm/wp-admin/includes/revision.php
new file mode 100644
index 00000000..1f03ae71
--- /dev/null
+++ b/www/crm/wp-admin/includes/revision.php
@@ -0,0 +1,456 @@
+<?php
+/**
+ * WordPress Administration Revisions API
+ *
+ * @package WordPress
+ * @subpackage Administration
+ * @since 3.6.0
+ */
+
+/**
+ * Get the revision UI diff.
+ *
+ * @since 3.6.0
+ *
+ * @param object|int $post The post object. Also accepts a post ID.
+ * @param int $compare_from The revision ID to compare from.
+ * @param int $compare_to The revision ID to come to.
+ *
+ * @return array|bool Associative array of a post's revisioned fields and their diffs.
+ * Or, false on failure.
+ */
+function wp_get_revision_ui_diff( $post, $compare_from, $compare_to ) {
+ if ( ! $post = get_post( $post ) ) {
+ return false;
+ }
+
+ if ( $compare_from ) {
+ if ( ! $compare_from = get_post( $compare_from ) ) {
+ return false;
+ }
+ } else {
+ // If we're dealing with the first revision...
+ $compare_from = false;
+ }
+
+ if ( ! $compare_to = get_post( $compare_to ) ) {
+ return false;
+ }
+
+ // If comparing revisions, make sure we're dealing with the right post parent.
+ // The parent post may be a 'revision' when revisions are disabled and we're looking at autosaves.
+ if ( $compare_from && $compare_from->post_parent !== $post->ID && $compare_from->ID !== $post->ID ) {
+ return false;
+ }
+ if ( $compare_to->post_parent !== $post->ID && $compare_to->ID !== $post->ID ) {
+ return false;
+ }
+
+ if ( $compare_from && strtotime( $compare_from->post_date_gmt ) > strtotime( $compare_to->post_date_gmt ) ) {
+ $temp = $compare_from;
+ $compare_from = $compare_to;
+ $compare_to = $temp;
+ }
+
+ // Add default title if title field is empty
+ if ( $compare_from && empty( $compare_from->post_title ) ) {
+ $compare_from->post_title = __( '(no title)' );
+ }
+ if ( empty( $compare_to->post_title ) ) {
+ $compare_to->post_title = __( '(no title)' );
+ }
+
+ $return = array();
+
+ foreach ( _wp_post_revision_fields( $post ) as $field => $name ) {
+ /**
+ * Contextually filter a post revision field.
+ *
+ * The dynamic portion of the hook name, `$field`, corresponds to each of the post
+ * fields of the revision object being iterated over in a foreach statement.
+ *
+ * @since 3.6.0
+ *
+ * @param string $compare_from->$field The current revision field to compare to or from.
+ * @param string $field The current revision field.
+ * @param WP_Post $compare_from The revision post object to compare to or from.
+ * @param string null The context of whether the current revision is the old
+ * or the new one. Values are 'to' or 'from'.
+ */
+ $content_from = $compare_from ? apply_filters( "_wp_post_revision_field_{$field}", $compare_from->$field, $field, $compare_from, 'from' ) : '';
+
+ /** This filter is documented in wp-admin/includes/revision.php */
+ $content_to = apply_filters( "_wp_post_revision_field_{$field}", $compare_to->$field, $field, $compare_to, 'to' );
+
+ $args = array(
+ 'show_split_view' => true,
+ );
+
+ /**
+ * Filters revisions text diff options.
+ *
+ * Filters the options passed to wp_text_diff() when viewing a post revision.
+ *
+ * @since 4.1.0
+ *
+ * @param array $args {
+ * Associative array of options to pass to wp_text_diff().
+ *
+ * @type bool $show_split_view True for split view (two columns), false for
+ * un-split view (single column). Default true.
+ * }
+ * @param string $field The current revision field.
+ * @param WP_Post $compare_from The revision post to compare from.
+ * @param WP_Post $compare_to The revision post to compare to.
+ */
+ $args = apply_filters( 'revision_text_diff_options', $args, $field, $compare_from, $compare_to );
+
+ $diff = wp_text_diff( $content_from, $content_to, $args );
+
+ if ( ! $diff && 'post_title' === $field ) {
+ // It's a better user experience to still show the Title, even if it didn't change.
+ // No, you didn't see this.
+ $diff = '<table class="diff"><colgroup><col class="content diffsplit left"><col class="content diffsplit middle"><col class="content diffsplit right"></colgroup><tbody><tr>';
+
+ // In split screen mode, show the title before/after side by side.
+ if ( true === $args['show_split_view'] ) {
+ $diff .= '<td>' . esc_html( $compare_from->post_title ) . '</td><td></td><td>' . esc_html( $compare_to->post_title ) . '</td>';
+ } else {
+ $diff .= '<td>' . esc_html( $compare_from->post_title ) . '</td>';
+
+ // In single column mode, only show the title once if unchanged.
+ if ( $compare_from->post_title !== $compare_to->post_title ) {
+ $diff .= '</tr><tr><td>' . esc_html( $compare_to->post_title ) . '</td>';
+ }
+ }
+
+ $diff .= '</tr></tbody>';
+ $diff .= '</table>';
+ }
+
+ if ( $diff ) {
+ $return[] = array(
+ 'id' => $field,
+ 'name' => $name,
+ 'diff' => $diff,
+ );
+ }
+ }
+
+ /**
+ * Filters the fields displayed in the post revision diff UI.
+ *
+ * @since 4.1.0
+ *
+ * @param array[] $return Array of revision UI fields. Each item is an array of id, name, and diff.
+ * @param WP_Post $compare_from The revision post to compare from.
+ * @param WP_Post $compare_to The revision post to compare to.
+ */
+ return apply_filters( 'wp_get_revision_ui_diff', $return, $compare_from, $compare_to );
+
+}
+
+/**
+ * Prepare revisions for JavaScript.
+ *
+ * @since 3.6.0
+ *
+ * @param object|int $post The post object. Also accepts a post ID.
+ * @param int $selected_revision_id The selected revision ID.
+ * @param int $from Optional. The revision ID to compare from.
+ *
+ * @return array An associative array of revision data and related settings.
+ */
+function wp_prepare_revisions_for_js( $post, $selected_revision_id, $from = null ) {
+ $post = get_post( $post );
+ $authors = array();
+ $now_gmt = time();
+
+ $revisions = wp_get_post_revisions(
+ $post->ID,
+ array(
+ 'order' => 'ASC',
+ 'check_enabled' => false,
+ )
+ );
+ // If revisions are disabled, we only want autosaves and the current post.
+ if ( ! wp_revisions_enabled( $post ) ) {
+ foreach ( $revisions as $revision_id => $revision ) {
+ if ( ! wp_is_post_autosave( $revision ) ) {
+ unset( $revisions[ $revision_id ] );
+ }
+ }
+ $revisions = array( $post->ID => $post ) + $revisions;
+ }
+
+ $show_avatars = get_option( 'show_avatars' );
+
+ cache_users( wp_list_pluck( $revisions, 'post_author' ) );
+
+ $can_restore = current_user_can( 'edit_post', $post->ID );
+ $current_id = false;
+
+ foreach ( $revisions as $revision ) {
+ $modified = strtotime( $revision->post_modified );
+ $modified_gmt = strtotime( $revision->post_modified_gmt . ' +0000' );
+ if ( $can_restore ) {
+ $restore_link = str_replace(
+ '&amp;',
+ '&',
+ wp_nonce_url(
+ add_query_arg(
+ array(
+ 'revision' => $revision->ID,
+ 'action' => 'restore',
+ ),
+ admin_url( 'revision.php' )
+ ),
+ "restore-post_{$revision->ID}"
+ )
+ );
+ }
+
+ if ( ! isset( $authors[ $revision->post_author ] ) ) {
+ $authors[ $revision->post_author ] = array(
+ 'id' => (int) $revision->post_author,
+ 'avatar' => $show_avatars ? get_avatar( $revision->post_author, 32 ) : '',
+ 'name' => get_the_author_meta( 'display_name', $revision->post_author ),
+ );
+ }
+
+ $autosave = (bool) wp_is_post_autosave( $revision );
+ $current = ! $autosave && $revision->post_modified_gmt === $post->post_modified_gmt;
+ if ( $current && ! empty( $current_id ) ) {
+ // If multiple revisions have the same post_modified_gmt, highest ID is current.
+ if ( $current_id < $revision->ID ) {
+ $revisions[ $current_id ]['current'] = false;
+ $current_id = $revision->ID;
+ } else {
+ $current = false;
+ }
+ } elseif ( $current ) {
+ $current_id = $revision->ID;
+ }
+
+ $revisions_data = array(
+ 'id' => $revision->ID,
+ 'title' => get_the_title( $post->ID ),
+ 'author' => $authors[ $revision->post_author ],
+ 'date' => date_i18n( __( 'M j, Y @ H:i' ), $modified ),
+ 'dateShort' => date_i18n( _x( 'j M @ H:i', 'revision date short format' ), $modified ),
+ 'timeAgo' => sprintf( __( '%s ago' ), human_time_diff( $modified_gmt, $now_gmt ) ),
+ 'autosave' => $autosave,
+ 'current' => $current,
+ 'restoreUrl' => $can_restore ? $restore_link : false,
+ );
+
+ /**
+ * Filters the array of revisions used on the revisions screen.
+ *
+ * @since 4.4.0
+ *
+ * @param array $revisions_data {
+ * The bootstrapped data for the revisions screen.
+ *
+ * @type int $id Revision ID.
+ * @type string $title Title for the revision's parent WP_Post object.
+ * @type int $author Revision post author ID.
+ * @type string $date Date the revision was modified.
+ * @type string $dateShort Short-form version of the date the revision was modified.
+ * @type string $timeAgo GMT-aware amount of time ago the revision was modified.
+ * @type bool $autosave Whether the revision is an autosave.
+ * @type bool $current Whether the revision is both not an autosave and the post
+ * modified date matches the revision modified date (GMT-aware).
+ * @type bool|false $restoreUrl URL if the revision can be restored, false otherwise.
+ * }
+ * @param WP_Post $revision The revision's WP_Post object.
+ * @param WP_Post $post The revision's parent WP_Post object.
+ */
+ $revisions[ $revision->ID ] = apply_filters( 'wp_prepare_revision_for_js', $revisions_data, $revision, $post );
+ }
+
+ /**
+ * If we only have one revision, the initial revision is missing; This happens
+ * when we have an autsosave and the user has clicked 'View the Autosave'
+ */
+ if ( 1 === sizeof( $revisions ) ) {
+ $revisions[ $post->ID ] = array(
+ 'id' => $post->ID,
+ 'title' => get_the_title( $post->ID ),
+ 'author' => $authors[ $post->post_author ],
+ 'date' => date_i18n( __( 'M j, Y @ H:i' ), strtotime( $post->post_modified ) ),
+ 'dateShort' => date_i18n( _x( 'j M @ H:i', 'revision date short format' ), strtotime( $post->post_modified ) ),
+ 'timeAgo' => sprintf( __( '%s ago' ), human_time_diff( strtotime( $post->post_modified_gmt ), $now_gmt ) ),
+ 'autosave' => false,
+ 'current' => true,
+ 'restoreUrl' => false,
+ );
+ $current_id = $post->ID;
+ }
+
+ /*
+ * If a post has been saved since the last revision (no revisioned fields
+ * were changed), we may not have a "current" revision. Mark the latest
+ * revision as "current".
+ */
+ if ( empty( $current_id ) ) {
+ if ( $revisions[ $revision->ID ]['autosave'] ) {
+ $revision = end( $revisions );
+ while ( $revision['autosave'] ) {
+ $revision = prev( $revisions );
+ }
+ $current_id = $revision['id'];
+ } else {
+ $current_id = $revision->ID;
+ }
+ $revisions[ $current_id ]['current'] = true;
+ }
+
+ // Now, grab the initial diff.
+ $compare_two_mode = is_numeric( $from );
+ if ( ! $compare_two_mode ) {
+ $found = array_search( $selected_revision_id, array_keys( $revisions ) );
+ if ( $found ) {
+ $from = array_keys( array_slice( $revisions, $found - 1, 1, true ) );
+ $from = reset( $from );
+ } else {
+ $from = 0;
+ }
+ }
+
+ $from = absint( $from );
+
+ $diffs = array(
+ array(
+ 'id' => $from . ':' . $selected_revision_id,
+ 'fields' => wp_get_revision_ui_diff( $post->ID, $from, $selected_revision_id ),
+ ),
+ );
+
+ return array(
+ 'postId' => $post->ID,
+ 'nonce' => wp_create_nonce( 'revisions-ajax-nonce' ),
+ 'revisionData' => array_values( $revisions ),
+ 'to' => $selected_revision_id,
+ 'from' => $from,
+ 'diffData' => $diffs,
+ 'baseUrl' => parse_url( admin_url( 'revision.php' ), PHP_URL_PATH ),
+ 'compareTwoMode' => absint( $compare_two_mode ), // Apparently booleans are not allowed
+ 'revisionIds' => array_keys( $revisions ),
+ );
+}
+
+/**
+ * Print JavaScript templates required for the revisions experience.
+ *
+ * @since 4.1.0
+ *
+ * @global WP_Post $post The global `$post` object.
+ */
+function wp_print_revision_templates() {
+ global $post;
+ ?><script id="tmpl-revisions-frame" type="text/html">
+ <div class="revisions-control-frame"></div>
+ <div class="revisions-diff-frame"></div>
+ </script>
+
+ <script id="tmpl-revisions-buttons" type="text/html">
+ <div class="revisions-previous">
+ <input class="button" type="button" value="<?php echo esc_attr_x( 'Previous', 'Button label for a previous revision' ); ?>" />
+ </div>
+
+ <div class="revisions-next">
+ <input class="button" type="button" value="<?php echo esc_attr_x( 'Next', 'Button label for a next revision' ); ?>" />
+ </div>
+ </script>
+
+ <script id="tmpl-revisions-checkbox" type="text/html">
+ <div class="revision-toggle-compare-mode">
+ <label>
+ <input type="checkbox" class="compare-two-revisions"
+ <#
+ if ( 'undefined' !== typeof data && data.model.attributes.compareTwoMode ) {
+ #> checked="checked"<#
+ }
+ #>
+ />
+ <?php esc_html_e( 'Compare any two revisions' ); ?>
+ </label>
+ </div>
+ </script>
+
+ <script id="tmpl-revisions-meta" type="text/html">
+ <# if ( ! _.isUndefined( data.attributes ) ) { #>
+ <div class="diff-title">
+ <# if ( 'from' === data.type ) { #>
+ <strong><?php _ex( 'From:', 'Followed by post revision info' ); ?></strong>
+ <# } else if ( 'to' === data.type ) { #>
+ <strong><?php _ex( 'To:', 'Followed by post revision info' ); ?></strong>
+ <# } #>
+ <div class="author-card<# if ( data.attributes.autosave ) { #> autosave<# } #>">
+ {{{ data.attributes.author.avatar }}}
+ <div class="author-info">
+ <# if ( data.attributes.autosave ) { #>
+ <span class="byline">
+ <?php
+ printf(
+ __( 'Autosave by %s' ),
+ '<span class="author-name">{{ data.attributes.author.name }}</span>'
+ );
+ ?>
+ </span>
+ <# } else if ( data.attributes.current ) { #>
+ <span class="byline">
+ <?php
+ printf(
+ __( 'Current Revision by %s' ),
+ '<span class="author-name">{{ data.attributes.author.name }}</span>'
+ );
+ ?>
+ </span>
+ <# } else { #>
+ <span class="byline">
+ <?php
+ printf(
+ __( 'Revision by %s' ),
+ '<span class="author-name">{{ data.attributes.author.name }}</span>'
+ );
+ ?>
+ </span>
+ <# } #>
+ <span class="time-ago">{{ data.attributes.timeAgo }}</span>
+ <span class="date">({{ data.attributes.dateShort }})</span>
+ </div>
+ <# if ( 'to' === data.type && data.attributes.restoreUrl ) { #>
+ <input <?php if ( wp_check_post_lock( $post->ID ) ) { ?>
+ disabled="disabled"
+ <?php } else { ?>
+ <# if ( data.attributes.current ) { #>
+ disabled="disabled"
+ <# } #>
+ <?php } ?>
+ <# if ( data.attributes.autosave ) { #>
+ type="button" class="restore-revision button button-primary" value="<?php esc_attr_e( 'Restore This Autosave' ); ?>" />
+ <# } else { #>
+ type="button" class="restore-revision button button-primary" value="<?php esc_attr_e( 'Restore This Revision' ); ?>" />
+ <# } #>
+ <# } #>
+ </div>
+ <# if ( 'tooltip' === data.type ) { #>
+ <div class="revisions-tooltip-arrow"><span></span></div>
+ <# } #>
+ <# } #>
+ </script>
+
+ <script id="tmpl-revisions-diff" type="text/html">
+ <div class="loading-indicator"><span class="spinner"></span></div>
+ <div class="diff-error"><?php _e( 'Sorry, something went wrong. The requested comparison could not be loaded.' ); ?></div>
+ <div class="diff">
+ <# _.each( data.fields, function( field ) { #>
+ <h3>{{ field.name }}</h3>
+ {{{ field.diff }}}
+ <# }); #>
+ </div>
+ </script>
+ <?php
+}
diff --git a/www/crm/wp-admin/includes/schema.php b/www/crm/wp-admin/includes/schema.php
new file mode 100644
index 00000000..20853da3
--- /dev/null
+++ b/www/crm/wp-admin/includes/schema.php
@@ -0,0 +1,1332 @@
+<?php
+/**
+ * WordPress Administration Scheme API
+ *
+ * Here we keep the DB structure and option values.
+ *
+ * @package WordPress
+ * @subpackage Administration
+ */
+
+/**
+ * Declare these as global in case schema.php is included from a function.
+ *
+ * @global wpdb $wpdb
+ * @global array $wp_queries
+ * @global string $charset_collate
+ */
+global $wpdb, $wp_queries, $charset_collate;
+
+/**
+ * The database character collate.
+ */
+$charset_collate = $wpdb->get_charset_collate();
+
+/**
+ * Retrieve the SQL for creating database tables.
+ *
+ * @since 3.3.0
+ *
+ * @global wpdb $wpdb WordPress database abstraction object.
+ *
+ * @param string $scope Optional. The tables for which to retrieve SQL. Can be all, global, ms_global, or blog tables. Defaults to all.
+ * @param int $blog_id Optional. The site ID for which to retrieve SQL. Default is the current site ID.
+ * @return string The SQL needed to create the requested tables.
+ */
+function wp_get_db_schema( $scope = 'all', $blog_id = null ) {
+ global $wpdb;
+
+ $charset_collate = $wpdb->get_charset_collate();
+
+ if ( $blog_id && $blog_id != $wpdb->blogid ) {
+ $old_blog_id = $wpdb->set_blog_id( $blog_id );
+ }
+
+ // Engage multisite if in the middle of turning it on from network.php.
+ $is_multisite = is_multisite() || ( defined( 'WP_INSTALLING_NETWORK' ) && WP_INSTALLING_NETWORK );
+
+ /*
+ * Indexes have a maximum size of 767 bytes. Historically, we haven't need to be concerned about that.
+ * As of 4.2, however, we moved to utf8mb4, which uses 4 bytes per character. This means that an index which
+ * used to have room for floor(767/3) = 255 characters, now only has room for floor(767/4) = 191 characters.
+ */
+ $max_index_length = 191;
+
+ // Blog specific tables.
+ $blog_tables = "CREATE TABLE $wpdb->termmeta (
+ meta_id bigint(20) unsigned NOT NULL auto_increment,
+ term_id bigint(20) unsigned NOT NULL default '0',
+ meta_key varchar(255) default NULL,
+ meta_value longtext,
+ PRIMARY KEY (meta_id),
+ KEY term_id (term_id),
+ KEY meta_key (meta_key($max_index_length))
+) $charset_collate;
+CREATE TABLE $wpdb->terms (
+ term_id bigint(20) unsigned NOT NULL auto_increment,
+ name varchar(200) NOT NULL default '',
+ slug varchar(200) NOT NULL default '',
+ term_group bigint(10) NOT NULL default 0,
+ PRIMARY KEY (term_id),
+ KEY slug (slug($max_index_length)),
+ KEY name (name($max_index_length))
+) $charset_collate;
+CREATE TABLE $wpdb->term_taxonomy (
+ term_taxonomy_id bigint(20) unsigned NOT NULL auto_increment,
+ term_id bigint(20) unsigned NOT NULL default 0,
+ taxonomy varchar(32) NOT NULL default '',
+ description longtext NOT NULL,
+ parent bigint(20) unsigned NOT NULL default 0,
+ count bigint(20) NOT NULL default 0,
+ PRIMARY KEY (term_taxonomy_id),
+ UNIQUE KEY term_id_taxonomy (term_id,taxonomy),
+ KEY taxonomy (taxonomy)
+) $charset_collate;
+CREATE TABLE $wpdb->term_relationships (
+ object_id bigint(20) unsigned NOT NULL default 0,
+ term_taxonomy_id bigint(20) unsigned NOT NULL default 0,
+ term_order int(11) NOT NULL default 0,
+ PRIMARY KEY (object_id,term_taxonomy_id),
+ KEY term_taxonomy_id (term_taxonomy_id)
+) $charset_collate;
+CREATE TABLE $wpdb->commentmeta (
+ meta_id bigint(20) unsigned NOT NULL auto_increment,
+ comment_id bigint(20) unsigned NOT NULL default '0',
+ meta_key varchar(255) default NULL,
+ meta_value longtext,
+ PRIMARY KEY (meta_id),
+ KEY comment_id (comment_id),
+ KEY meta_key (meta_key($max_index_length))
+) $charset_collate;
+CREATE TABLE $wpdb->comments (
+ comment_ID bigint(20) unsigned NOT NULL auto_increment,
+ comment_post_ID bigint(20) unsigned NOT NULL default '0',
+ comment_author tinytext NOT NULL,
+ comment_author_email varchar(100) NOT NULL default '',
+ comment_author_url varchar(200) NOT NULL default '',
+ comment_author_IP varchar(100) NOT NULL default '',
+ comment_date datetime NOT NULL default '0000-00-00 00:00:00',
+ comment_date_gmt datetime NOT NULL default '0000-00-00 00:00:00',
+ comment_content text NOT NULL,
+ comment_karma int(11) NOT NULL default '0',
+ comment_approved varchar(20) NOT NULL default '1',
+ comment_agent varchar(255) NOT NULL default '',
+ comment_type varchar(20) NOT NULL default '',
+ comment_parent bigint(20) unsigned NOT NULL default '0',
+ user_id bigint(20) unsigned NOT NULL default '0',
+ PRIMARY KEY (comment_ID),
+ KEY comment_post_ID (comment_post_ID),
+ KEY comment_approved_date_gmt (comment_approved,comment_date_gmt),
+ KEY comment_date_gmt (comment_date_gmt),
+ KEY comment_parent (comment_parent),
+ KEY comment_author_email (comment_author_email(10))
+) $charset_collate;
+CREATE TABLE $wpdb->links (
+ link_id bigint(20) unsigned NOT NULL auto_increment,
+ link_url varchar(255) NOT NULL default '',
+ link_name varchar(255) NOT NULL default '',
+ link_image varchar(255) NOT NULL default '',
+ link_target varchar(25) NOT NULL default '',
+ link_description varchar(255) NOT NULL default '',
+ link_visible varchar(20) NOT NULL default 'Y',
+ link_owner bigint(20) unsigned NOT NULL default '1',
+ link_rating int(11) NOT NULL default '0',
+ link_updated datetime NOT NULL default '0000-00-00 00:00:00',
+ link_rel varchar(255) NOT NULL default '',
+ link_notes mediumtext NOT NULL,
+ link_rss varchar(255) NOT NULL default '',
+ PRIMARY KEY (link_id),
+ KEY link_visible (link_visible)
+) $charset_collate;
+CREATE TABLE $wpdb->options (
+ option_id bigint(20) unsigned NOT NULL auto_increment,
+ option_name varchar(191) NOT NULL default '',
+ option_value longtext NOT NULL,
+ autoload varchar(20) NOT NULL default 'yes',
+ PRIMARY KEY (option_id),
+ UNIQUE KEY option_name (option_name)
+) $charset_collate;
+CREATE TABLE $wpdb->postmeta (
+ meta_id bigint(20) unsigned NOT NULL auto_increment,
+ post_id bigint(20) unsigned NOT NULL default '0',
+ meta_key varchar(255) default NULL,
+ meta_value longtext,
+ PRIMARY KEY (meta_id),
+ KEY post_id (post_id),
+ KEY meta_key (meta_key($max_index_length))
+) $charset_collate;
+CREATE TABLE $wpdb->posts (
+ ID bigint(20) unsigned NOT NULL auto_increment,
+ post_author bigint(20) unsigned NOT NULL default '0',
+ post_date datetime NOT NULL default '0000-00-00 00:00:00',
+ post_date_gmt datetime NOT NULL default '0000-00-00 00:00:00',
+ post_content longtext NOT NULL,
+ post_title text NOT NULL,
+ post_excerpt text NOT NULL,
+ post_status varchar(20) NOT NULL default 'publish',
+ comment_status varchar(20) NOT NULL default 'open',
+ ping_status varchar(20) NOT NULL default 'open',
+ post_password varchar(255) NOT NULL default '',
+ post_name varchar(200) NOT NULL default '',
+ to_ping text NOT NULL,
+ pinged text NOT NULL,
+ post_modified datetime NOT NULL default '0000-00-00 00:00:00',
+ post_modified_gmt datetime NOT NULL default '0000-00-00 00:00:00',
+ post_content_filtered longtext NOT NULL,
+ post_parent bigint(20) unsigned NOT NULL default '0',
+ guid varchar(255) NOT NULL default '',
+ menu_order int(11) NOT NULL default '0',
+ post_type varchar(20) NOT NULL default 'post',
+ post_mime_type varchar(100) NOT NULL default '',
+ comment_count bigint(20) NOT NULL default '0',
+ PRIMARY KEY (ID),
+ KEY post_name (post_name($max_index_length)),
+ KEY type_status_date (post_type,post_status,post_date,ID),
+ KEY post_parent (post_parent),
+ KEY post_author (post_author)
+) $charset_collate;\n";
+
+ // Single site users table. The multisite flavor of the users table is handled below.
+ $users_single_table = "CREATE TABLE $wpdb->users (
+ ID bigint(20) unsigned NOT NULL auto_increment,
+ user_login varchar(60) NOT NULL default '',
+ user_pass varchar(255) NOT NULL default '',
+ user_nicename varchar(50) NOT NULL default '',
+ user_email varchar(100) NOT NULL default '',
+ user_url varchar(100) NOT NULL default '',
+ user_registered datetime NOT NULL default '0000-00-00 00:00:00',
+ user_activation_key varchar(255) NOT NULL default '',
+ user_status int(11) NOT NULL default '0',
+ display_name varchar(250) NOT NULL default '',
+ PRIMARY KEY (ID),
+ KEY user_login_key (user_login),
+ KEY user_nicename (user_nicename),
+ KEY user_email (user_email)
+) $charset_collate;\n";
+
+ // Multisite users table
+ $users_multi_table = "CREATE TABLE $wpdb->users (
+ ID bigint(20) unsigned NOT NULL auto_increment,
+ user_login varchar(60) NOT NULL default '',
+ user_pass varchar(255) NOT NULL default '',
+ user_nicename varchar(50) NOT NULL default '',
+ user_email varchar(100) NOT NULL default '',
+ user_url varchar(100) NOT NULL default '',
+ user_registered datetime NOT NULL default '0000-00-00 00:00:00',
+ user_activation_key varchar(255) NOT NULL default '',
+ user_status int(11) NOT NULL default '0',
+ display_name varchar(250) NOT NULL default '',
+ spam tinyint(2) NOT NULL default '0',
+ deleted tinyint(2) NOT NULL default '0',
+ PRIMARY KEY (ID),
+ KEY user_login_key (user_login),
+ KEY user_nicename (user_nicename),
+ KEY user_email (user_email)
+) $charset_collate;\n";
+
+ // Usermeta.
+ $usermeta_table = "CREATE TABLE $wpdb->usermeta (
+ umeta_id bigint(20) unsigned NOT NULL auto_increment,
+ user_id bigint(20) unsigned NOT NULL default '0',
+ meta_key varchar(255) default NULL,
+ meta_value longtext,
+ PRIMARY KEY (umeta_id),
+ KEY user_id (user_id),
+ KEY meta_key (meta_key($max_index_length))
+) $charset_collate;\n";
+
+ // Global tables
+ if ( $is_multisite ) {
+ $global_tables = $users_multi_table . $usermeta_table;
+ } else {
+ $global_tables = $users_single_table . $usermeta_table;
+ }
+
+ // Multisite global tables.
+ $ms_global_tables = "CREATE TABLE $wpdb->blogs (
+ blog_id bigint(20) NOT NULL auto_increment,
+ site_id bigint(20) NOT NULL default '0',
+ domain varchar(200) NOT NULL default '',
+ path varchar(100) NOT NULL default '',
+ registered datetime NOT NULL default '0000-00-00 00:00:00',
+ last_updated datetime NOT NULL default '0000-00-00 00:00:00',
+ public tinyint(2) NOT NULL default '1',
+ archived tinyint(2) NOT NULL default '0',
+ mature tinyint(2) NOT NULL default '0',
+ spam tinyint(2) NOT NULL default '0',
+ deleted tinyint(2) NOT NULL default '0',
+ lang_id int(11) NOT NULL default '0',
+ PRIMARY KEY (blog_id),
+ KEY domain (domain(50),path(5)),
+ KEY lang_id (lang_id)
+) $charset_collate;
+CREATE TABLE $wpdb->blog_versions (
+ blog_id bigint(20) NOT NULL default '0',
+ db_version varchar(20) NOT NULL default '',
+ last_updated datetime NOT NULL default '0000-00-00 00:00:00',
+ PRIMARY KEY (blog_id),
+ KEY db_version (db_version)
+) $charset_collate;
+CREATE TABLE $wpdb->blogmeta (
+ meta_id bigint(20) unsigned NOT NULL auto_increment,
+ blog_id bigint(20) NOT NULL default '0',
+ meta_key varchar(255) default NULL,
+ meta_value longtext,
+ PRIMARY KEY (meta_id),
+ KEY meta_key (meta_key($max_index_length)),
+ KEY blog_id (blog_id)
+) $charset_collate;
+CREATE TABLE $wpdb->registration_log (
+ ID bigint(20) NOT NULL auto_increment,
+ email varchar(255) NOT NULL default '',
+ IP varchar(30) NOT NULL default '',
+ blog_id bigint(20) NOT NULL default '0',
+ date_registered datetime NOT NULL default '0000-00-00 00:00:00',
+ PRIMARY KEY (ID),
+ KEY IP (IP)
+) $charset_collate;
+CREATE TABLE $wpdb->site (
+ id bigint(20) NOT NULL auto_increment,
+ domain varchar(200) NOT NULL default '',
+ path varchar(100) NOT NULL default '',
+ PRIMARY KEY (id),
+ KEY domain (domain(140),path(51))
+) $charset_collate;
+CREATE TABLE $wpdb->sitemeta (
+ meta_id bigint(20) NOT NULL auto_increment,
+ site_id bigint(20) NOT NULL default '0',
+ meta_key varchar(255) default NULL,
+ meta_value longtext,
+ PRIMARY KEY (meta_id),
+ KEY meta_key (meta_key($max_index_length)),
+ KEY site_id (site_id)
+) $charset_collate;
+CREATE TABLE $wpdb->signups (
+ signup_id bigint(20) NOT NULL auto_increment,
+ domain varchar(200) NOT NULL default '',
+ path varchar(100) NOT NULL default '',
+ title longtext NOT NULL,
+ user_login varchar(60) NOT NULL default '',
+ user_email varchar(100) NOT NULL default '',
+ registered datetime NOT NULL default '0000-00-00 00:00:00',
+ activated datetime NOT NULL default '0000-00-00 00:00:00',
+ active tinyint(1) NOT NULL default '0',
+ activation_key varchar(50) NOT NULL default '',
+ meta longtext,
+ PRIMARY KEY (signup_id),
+ KEY activation_key (activation_key),
+ KEY user_email (user_email),
+ KEY user_login_email (user_login,user_email),
+ KEY domain_path (domain(140),path(51))
+) $charset_collate;";
+
+ switch ( $scope ) {
+ case 'blog':
+ $queries = $blog_tables;
+ break;
+ case 'global':
+ $queries = $global_tables;
+ if ( $is_multisite ) {
+ $queries .= $ms_global_tables;
+ }
+ break;
+ case 'ms_global':
+ $queries = $ms_global_tables;
+ break;
+ case 'all':
+ default:
+ $queries = $global_tables . $blog_tables;
+ if ( $is_multisite ) {
+ $queries .= $ms_global_tables;
+ }
+ break;
+ }
+
+ if ( isset( $old_blog_id ) ) {
+ $wpdb->set_blog_id( $old_blog_id );
+ }
+
+ return $queries;
+}
+
+// Populate for back compat.
+$wp_queries = wp_get_db_schema( 'all' );
+
+/**
+ * Create WordPress options and set the default values.
+ *
+ * @since 1.5.0
+ * @since 5.1.0 The $options parameter has been added.
+ *
+ * @global wpdb $wpdb WordPress database abstraction object.
+ * @global int $wp_db_version
+ * @global int $wp_current_db_version
+ *
+ * @param array $options Optional. Custom option $key => $value pairs to use. Default empty array.
+ */
+function populate_options( array $options = array() ) {
+ global $wpdb, $wp_db_version, $wp_current_db_version;
+
+ $guessurl = wp_guess_url();
+ /**
+ * Fires before creating WordPress options and populating their default values.
+ *
+ * @since 2.6.0
+ */
+ do_action( 'populate_options' );
+
+ if ( ini_get( 'safe_mode' ) ) {
+ // Safe mode can break mkdir() so use a flat structure by default.
+ $uploads_use_yearmonth_folders = 0;
+ } else {
+ $uploads_use_yearmonth_folders = 1;
+ }
+
+ // If WP_DEFAULT_THEME doesn't exist, fall back to the latest core default theme.
+ $stylesheet = WP_DEFAULT_THEME;
+ $template = WP_DEFAULT_THEME;
+ $theme = wp_get_theme( WP_DEFAULT_THEME );
+ if ( ! $theme->exists() ) {
+ $theme = WP_Theme::get_core_default_theme();
+ }
+
+ // If we can't find a core default theme, WP_DEFAULT_THEME is the best we can do.
+ if ( $theme ) {
+ $stylesheet = $theme->get_stylesheet();
+ $template = $theme->get_template();
+ }
+
+ $timezone_string = '';
+ $gmt_offset = 0;
+ /*
+ * translators: default GMT offset or timezone string. Must be either a valid offset (-12 to 14)
+ * or a valid timezone string (America/New_York). See https://secure.php.net/manual/en/timezones.php
+ * for all timezone strings supported by PHP.
+ */
+ $offset_or_tz = _x( '0', 'default GMT offset or timezone string' ); // phpcs:ignore WordPress.WP.I18n.NoEmptyStrings
+ if ( is_numeric( $offset_or_tz ) ) {
+ $gmt_offset = $offset_or_tz;
+ } elseif ( $offset_or_tz && in_array( $offset_or_tz, timezone_identifiers_list() ) ) {
+ $timezone_string = $offset_or_tz;
+ }
+
+ $defaults = array(
+ 'siteurl' => $guessurl,
+ 'home' => $guessurl,
+ 'blogname' => __( 'My Site' ),
+ /* translators: site tagline */
+ 'blogdescription' => __( 'Just another WordPress site' ),
+ 'users_can_register' => 0,
+ 'admin_email' => 'you@example.com',
+ /* translators: default start of the week. 0 = Sunday, 1 = Monday */
+ 'start_of_week' => _x( '1', 'start of week' ),
+ 'use_balanceTags' => 0,
+ 'use_smilies' => 1,
+ 'require_name_email' => 1,
+ 'comments_notify' => 1,
+ 'posts_per_rss' => 10,
+ 'rss_use_excerpt' => 0,
+ 'mailserver_url' => 'mail.example.com',
+ 'mailserver_login' => 'login@example.com',
+ 'mailserver_pass' => 'password',
+ 'mailserver_port' => 110,
+ 'default_category' => 1,
+ 'default_comment_status' => 'open',
+ 'default_ping_status' => 'open',
+ 'default_pingback_flag' => 1,
+ 'posts_per_page' => 10,
+ /* translators: default date format, see https://secure.php.net/date */
+ 'date_format' => __( 'F j, Y' ),
+ /* translators: default time format, see https://secure.php.net/date */
+ 'time_format' => __( 'g:i a' ),
+ /* translators: links last updated date format, see https://secure.php.net/date */
+ 'links_updated_date_format' => __( 'F j, Y g:i a' ),
+ 'comment_moderation' => 0,
+ 'moderation_notify' => 1,
+ 'permalink_structure' => '',
+ 'rewrite_rules' => '',
+ 'hack_file' => 0,
+ 'blog_charset' => 'UTF-8',
+ 'moderation_keys' => '',
+ 'active_plugins' => array(),
+ 'category_base' => '',
+ 'ping_sites' => 'http://rpc.pingomatic.com/',
+ 'comment_max_links' => 2,
+ 'gmt_offset' => $gmt_offset,
+
+ // 1.5
+ 'default_email_category' => 1,
+ 'recently_edited' => '',
+ 'template' => $template,
+ 'stylesheet' => $stylesheet,
+ 'comment_whitelist' => 1,
+ 'blacklist_keys' => '',
+ 'comment_registration' => 0,
+ 'html_type' => 'text/html',
+
+ // 1.5.1
+ 'use_trackback' => 0,
+
+ // 2.0
+ 'default_role' => 'subscriber',
+ 'db_version' => $wp_db_version,
+
+ // 2.0.1
+ 'uploads_use_yearmonth_folders' => $uploads_use_yearmonth_folders,
+ 'upload_path' => '',
+
+ // 2.1
+ 'blog_public' => '1',
+ 'default_link_category' => 2,
+ 'show_on_front' => 'posts',
+
+ // 2.2
+ 'tag_base' => '',
+
+ // 2.5
+ 'show_avatars' => '1',
+ 'avatar_rating' => 'G',
+ 'upload_url_path' => '',
+ 'thumbnail_size_w' => 150,
+ 'thumbnail_size_h' => 150,
+ 'thumbnail_crop' => 1,
+ 'medium_size_w' => 300,
+ 'medium_size_h' => 300,
+
+ // 2.6
+ 'avatar_default' => 'mystery',
+
+ // 2.7
+ 'large_size_w' => 1024,
+ 'large_size_h' => 1024,
+ 'image_default_link_type' => 'none',
+ 'image_default_size' => '',
+ 'image_default_align' => '',
+ 'close_comments_for_old_posts' => 0,
+ 'close_comments_days_old' => 14,
+ 'thread_comments' => 1,
+ 'thread_comments_depth' => 5,
+ 'page_comments' => 0,
+ 'comments_per_page' => 50,
+ 'default_comments_page' => 'newest',
+ 'comment_order' => 'asc',
+ 'sticky_posts' => array(),
+ 'widget_categories' => array(),
+ 'widget_text' => array(),
+ 'widget_rss' => array(),
+ 'uninstall_plugins' => array(),
+
+ // 2.8
+ 'timezone_string' => $timezone_string,
+
+ // 3.0
+ 'page_for_posts' => 0,
+ 'page_on_front' => 0,
+
+ // 3.1
+ 'default_post_format' => 0,
+
+ // 3.5
+ 'link_manager_enabled' => 0,
+
+ // 4.3.0
+ 'finished_splitting_shared_terms' => 1,
+ 'site_icon' => 0,
+
+ // 4.4.0
+ 'medium_large_size_w' => 768,
+ 'medium_large_size_h' => 0,
+
+ // 4.9.6
+ 'wp_page_for_privacy_policy' => 0,
+
+ // 4.9.8
+ 'show_comments_cookies_opt_in' => 1,
+ );
+
+ // 3.3
+ if ( ! is_multisite() ) {
+ $defaults['initial_db_version'] = ! empty( $wp_current_db_version ) && $wp_current_db_version < $wp_db_version
+ ? $wp_current_db_version : $wp_db_version;
+ }
+
+ // 3.0 multisite
+ if ( is_multisite() ) {
+ /* translators: site tagline */
+ $defaults['blogdescription'] = sprintf( __( 'Just another %s site' ), get_network()->site_name );
+ $defaults['permalink_structure'] = '/%year%/%monthnum%/%day%/%postname%/';
+ }
+
+ $options = wp_parse_args( $options, $defaults );
+
+ // Set autoload to no for these options
+ $fat_options = array( 'moderation_keys', 'recently_edited', 'blacklist_keys', 'uninstall_plugins' );
+
+ $keys = "'" . implode( "', '", array_keys( $options ) ) . "'";
+ $existing_options = $wpdb->get_col( "SELECT option_name FROM $wpdb->options WHERE option_name in ( $keys )" ); // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared
+
+ $insert = '';
+ foreach ( $options as $option => $value ) {
+ if ( in_array( $option, $existing_options ) ) {
+ continue;
+ }
+ if ( in_array( $option, $fat_options ) ) {
+ $autoload = 'no';
+ } else {
+ $autoload = 'yes';
+ }
+
+ if ( is_array( $value ) ) {
+ $value = serialize( $value );
+ }
+ if ( ! empty( $insert ) ) {
+ $insert .= ', ';
+ }
+ $insert .= $wpdb->prepare( '(%s, %s, %s)', $option, $value, $autoload );
+ }
+
+ if ( ! empty( $insert ) ) {
+ $wpdb->query( "INSERT INTO $wpdb->options (option_name, option_value, autoload) VALUES " . $insert ); // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared
+ }
+
+ // In case it is set, but blank, update "home".
+ if ( ! __get_option( 'home' ) ) {
+ update_option( 'home', $guessurl );
+ }
+
+ // Delete unused options.
+ $unusedoptions = array(
+ 'blodotgsping_url',
+ 'bodyterminator',
+ 'emailtestonly',
+ 'phoneemail_separator',
+ 'smilies_directory',
+ 'subjectprefix',
+ 'use_bbcode',
+ 'use_blodotgsping',
+ 'use_phoneemail',
+ 'use_quicktags',
+ 'use_weblogsping',
+ 'weblogs_cache_file',
+ 'use_preview',
+ 'use_htmltrans',
+ 'smilies_directory',
+ 'fileupload_allowedusers',
+ 'use_phoneemail',
+ 'default_post_status',
+ 'default_post_category',
+ 'archive_mode',
+ 'time_difference',
+ 'links_minadminlevel',
+ 'links_use_adminlevels',
+ 'links_rating_type',
+ 'links_rating_char',
+ 'links_rating_ignore_zero',
+ 'links_rating_single_image',
+ 'links_rating_image0',
+ 'links_rating_image1',
+ 'links_rating_image2',
+ 'links_rating_image3',
+ 'links_rating_image4',
+ 'links_rating_image5',
+ 'links_rating_image6',
+ 'links_rating_image7',
+ 'links_rating_image8',
+ 'links_rating_image9',
+ 'links_recently_updated_time',
+ 'links_recently_updated_prepend',
+ 'links_recently_updated_append',
+ 'weblogs_cacheminutes',
+ 'comment_allowed_tags',
+ 'search_engine_friendly_urls',
+ 'default_geourl_lat',
+ 'default_geourl_lon',
+ 'use_default_geourl',
+ 'weblogs_xml_url',
+ 'new_users_can_blog',
+ '_wpnonce',
+ '_wp_http_referer',
+ 'Update',
+ 'action',
+ 'rich_editing',
+ 'autosave_interval',
+ 'deactivated_plugins',
+ 'can_compress_scripts',
+ 'page_uris',
+ 'update_core',
+ 'update_plugins',
+ 'update_themes',
+ 'doing_cron',
+ 'random_seed',
+ 'rss_excerpt_length',
+ 'secret',
+ 'use_linksupdate',
+ 'default_comment_status_page',
+ 'wporg_popular_tags',
+ 'what_to_show',
+ 'rss_language',
+ 'language',
+ 'enable_xmlrpc',
+ 'enable_app',
+ 'embed_autourls',
+ 'default_post_edit_rows',
+ 'gzipcompression',
+ 'advanced_edit',
+ );
+ foreach ( $unusedoptions as $option ) {
+ delete_option( $option );
+ }
+
+ // Delete obsolete magpie stuff.
+ $wpdb->query( "DELETE FROM $wpdb->options WHERE option_name REGEXP '^rss_[0-9a-f]{32}(_ts)?$'" );
+
+ // Clear expired transients
+ delete_expired_transients( true );
+}
+
+/**
+ * Execute WordPress role creation for the various WordPress versions.
+ *
+ * @since 2.0.0
+ */
+function populate_roles() {
+ populate_roles_160();
+ populate_roles_210();
+ populate_roles_230();
+ populate_roles_250();
+ populate_roles_260();
+ populate_roles_270();
+ populate_roles_280();
+ populate_roles_300();
+}
+
+/**
+ * Create the roles for WordPress 2.0
+ *
+ * @since 2.0.0
+ */
+function populate_roles_160() {
+ // Add roles
+
+ add_role( 'administrator', 'Administrator' );
+ add_role( 'editor', 'Editor' );
+ add_role( 'author', 'Author' );
+ add_role( 'contributor', 'Contributor' );
+ add_role( 'subscriber', 'Subscriber' );
+
+ // Add caps for Administrator role
+ $role = get_role( 'administrator' );
+ $role->add_cap( 'switch_themes' );
+ $role->add_cap( 'edit_themes' );
+ $role->add_cap( 'activate_plugins' );
+ $role->add_cap( 'edit_plugins' );
+ $role->add_cap( 'edit_users' );
+ $role->add_cap( 'edit_files' );
+ $role->add_cap( 'manage_options' );
+ $role->add_cap( 'moderate_comments' );
+ $role->add_cap( 'manage_categories' );
+ $role->add_cap( 'manage_links' );
+ $role->add_cap( 'upload_files' );
+ $role->add_cap( 'import' );
+ $role->add_cap( 'unfiltered_html' );
+ $role->add_cap( 'edit_posts' );
+ $role->add_cap( 'edit_others_posts' );
+ $role->add_cap( 'edit_published_posts' );
+ $role->add_cap( 'publish_posts' );
+ $role->add_cap( 'edit_pages' );
+ $role->add_cap( 'read' );
+ $role->add_cap( 'level_10' );
+ $role->add_cap( 'level_9' );
+ $role->add_cap( 'level_8' );
+ $role->add_cap( 'level_7' );
+ $role->add_cap( 'level_6' );
+ $role->add_cap( 'level_5' );
+ $role->add_cap( 'level_4' );
+ $role->add_cap( 'level_3' );
+ $role->add_cap( 'level_2' );
+ $role->add_cap( 'level_1' );
+ $role->add_cap( 'level_0' );
+
+ // Add caps for Editor role
+ $role = get_role( 'editor' );
+ $role->add_cap( 'moderate_comments' );
+ $role->add_cap( 'manage_categories' );
+ $role->add_cap( 'manage_links' );
+ $role->add_cap( 'upload_files' );
+ $role->add_cap( 'unfiltered_html' );
+ $role->add_cap( 'edit_posts' );
+ $role->add_cap( 'edit_others_posts' );
+ $role->add_cap( 'edit_published_posts' );
+ $role->add_cap( 'publish_posts' );
+ $role->add_cap( 'edit_pages' );
+ $role->add_cap( 'read' );
+ $role->add_cap( 'level_7' );
+ $role->add_cap( 'level_6' );
+ $role->add_cap( 'level_5' );
+ $role->add_cap( 'level_4' );
+ $role->add_cap( 'level_3' );
+ $role->add_cap( 'level_2' );
+ $role->add_cap( 'level_1' );
+ $role->add_cap( 'level_0' );
+
+ // Add caps for Author role
+ $role = get_role( 'author' );
+ $role->add_cap( 'upload_files' );
+ $role->add_cap( 'edit_posts' );
+ $role->add_cap( 'edit_published_posts' );
+ $role->add_cap( 'publish_posts' );
+ $role->add_cap( 'read' );
+ $role->add_cap( 'level_2' );
+ $role->add_cap( 'level_1' );
+ $role->add_cap( 'level_0' );
+
+ // Add caps for Contributor role
+ $role = get_role( 'contributor' );
+ $role->add_cap( 'edit_posts' );
+ $role->add_cap( 'read' );
+ $role->add_cap( 'level_1' );
+ $role->add_cap( 'level_0' );
+
+ // Add caps for Subscriber role
+ $role = get_role( 'subscriber' );
+ $role->add_cap( 'read' );
+ $role->add_cap( 'level_0' );
+}
+
+/**
+ * Create and modify WordPress roles for WordPress 2.1.
+ *
+ * @since 2.1.0
+ */
+function populate_roles_210() {
+ $roles = array( 'administrator', 'editor' );
+ foreach ( $roles as $role ) {
+ $role = get_role( $role );
+ if ( empty( $role ) ) {
+ continue;
+ }
+
+ $role->add_cap( 'edit_others_pages' );
+ $role->add_cap( 'edit_published_pages' );
+ $role->add_cap( 'publish_pages' );
+ $role->add_cap( 'delete_pages' );
+ $role->add_cap( 'delete_others_pages' );
+ $role->add_cap( 'delete_published_pages' );
+ $role->add_cap( 'delete_posts' );
+ $role->add_cap( 'delete_others_posts' );
+ $role->add_cap( 'delete_published_posts' );
+ $role->add_cap( 'delete_private_posts' );
+ $role->add_cap( 'edit_private_posts' );
+ $role->add_cap( 'read_private_posts' );
+ $role->add_cap( 'delete_private_pages' );
+ $role->add_cap( 'edit_private_pages' );
+ $role->add_cap( 'read_private_pages' );
+ }
+
+ $role = get_role( 'administrator' );
+ if ( ! empty( $role ) ) {
+ $role->add_cap( 'delete_users' );
+ $role->add_cap( 'create_users' );
+ }
+
+ $role = get_role( 'author' );
+ if ( ! empty( $role ) ) {
+ $role->add_cap( 'delete_posts' );
+ $role->add_cap( 'delete_published_posts' );
+ }
+
+ $role = get_role( 'contributor' );
+ if ( ! empty( $role ) ) {
+ $role->add_cap( 'delete_posts' );
+ }
+}
+
+/**
+ * Create and modify WordPress roles for WordPress 2.3.
+ *
+ * @since 2.3.0
+ */
+function populate_roles_230() {
+ $role = get_role( 'administrator' );
+
+ if ( ! empty( $role ) ) {
+ $role->add_cap( 'unfiltered_upload' );
+ }
+}
+
+/**
+ * Create and modify WordPress roles for WordPress 2.5.
+ *
+ * @since 2.5.0
+ */
+function populate_roles_250() {
+ $role = get_role( 'administrator' );
+
+ if ( ! empty( $role ) ) {
+ $role->add_cap( 'edit_dashboard' );
+ }
+}
+
+/**
+ * Create and modify WordPress roles for WordPress 2.6.
+ *
+ * @since 2.6.0
+ */
+function populate_roles_260() {
+ $role = get_role( 'administrator' );
+
+ if ( ! empty( $role ) ) {
+ $role->add_cap( 'update_plugins' );
+ $role->add_cap( 'delete_plugins' );
+ }
+}
+
+/**
+ * Create and modify WordPress roles for WordPress 2.7.
+ *
+ * @since 2.7.0
+ */
+function populate_roles_270() {
+ $role = get_role( 'administrator' );
+
+ if ( ! empty( $role ) ) {
+ $role->add_cap( 'install_plugins' );
+ $role->add_cap( 'update_themes' );
+ }
+}
+
+/**
+ * Create and modify WordPress roles for WordPress 2.8.
+ *
+ * @since 2.8.0
+ */
+function populate_roles_280() {
+ $role = get_role( 'administrator' );
+
+ if ( ! empty( $role ) ) {
+ $role->add_cap( 'install_themes' );
+ }
+}
+
+/**
+ * Create and modify WordPress roles for WordPress 3.0.
+ *
+ * @since 3.0.0
+ */
+function populate_roles_300() {
+ $role = get_role( 'administrator' );
+
+ if ( ! empty( $role ) ) {
+ $role->add_cap( 'update_core' );
+ $role->add_cap( 'list_users' );
+ $role->add_cap( 'remove_users' );
+ $role->add_cap( 'promote_users' );
+ $role->add_cap( 'edit_theme_options' );
+ $role->add_cap( 'delete_themes' );
+ $role->add_cap( 'export' );
+ }
+}
+
+if ( ! function_exists( 'install_network' ) ) :
+ /**
+ * Install Network.
+ *
+ * @since 3.0.0
+ */
+ function install_network() {
+ if ( ! defined( 'WP_INSTALLING_NETWORK' ) ) {
+ define( 'WP_INSTALLING_NETWORK', true );
+ }
+
+ dbDelta( wp_get_db_schema( 'global' ) );
+ }
+endif;
+
+/**
+ * Populate network settings.
+ *
+ * @since 3.0.0
+ *
+ * @global wpdb $wpdb
+ * @global object $current_site
+ * @global WP_Rewrite $wp_rewrite
+ *
+ * @param int $network_id ID of network to populate.
+ * @param string $domain The domain name for the network (eg. "example.com").
+ * @param string $email Email address for the network administrator.
+ * @param string $site_name The name of the network.
+ * @param string $path Optional. The path to append to the network's domain name. Default '/'.
+ * @param bool $subdomain_install Optional. Whether the network is a subdomain installation or a subdirectory installation.
+ * Default false, meaning the network is a subdirectory installation.
+ * @return bool|WP_Error True on success, or WP_Error on warning (with the installation otherwise successful,
+ * so the error code must be checked) or failure.
+ */
+function populate_network( $network_id = 1, $domain = '', $email = '', $site_name = '', $path = '/', $subdomain_install = false ) {
+ global $wpdb, $current_site, $wp_rewrite;
+
+ $errors = new WP_Error();
+ if ( '' == $domain ) {
+ $errors->add( 'empty_domain', __( 'You must provide a domain name.' ) );
+ }
+ if ( '' == $site_name ) {
+ $errors->add( 'empty_sitename', __( 'You must provide a name for your network of sites.' ) );
+ }
+
+ // Check for network collision.
+ $network_exists = false;
+ if ( is_multisite() ) {
+ if ( get_network( (int) $network_id ) ) {
+ $errors->add( 'siteid_exists', __( 'The network already exists.' ) );
+ }
+ } else {
+ if ( $network_id == $wpdb->get_var( $wpdb->prepare( "SELECT id FROM $wpdb->site WHERE id = %d", $network_id ) ) ) {
+ $errors->add( 'siteid_exists', __( 'The network already exists.' ) );
+ }
+ }
+
+ if ( ! is_email( $email ) ) {
+ $errors->add( 'invalid_email', __( 'You must provide a valid email address.' ) );
+ }
+
+ if ( $errors->has_errors() ) {
+ return $errors;
+ }
+
+ if ( 1 == $network_id ) {
+ $wpdb->insert(
+ $wpdb->site,
+ array(
+ 'domain' => $domain,
+ 'path' => $path,
+ )
+ );
+ $network_id = $wpdb->insert_id;
+ } else {
+ $wpdb->insert(
+ $wpdb->site,
+ array(
+ 'domain' => $domain,
+ 'path' => $path,
+ 'id' => $network_id,
+ )
+ );
+ }
+
+ populate_network_meta(
+ $network_id,
+ array(
+ 'admin_email' => $email,
+ 'site_name' => $site_name,
+ 'subdomain_install' => $subdomain_install,
+ )
+ );
+
+ $site_user = get_userdata( (int) $wpdb->get_var( $wpdb->prepare( "SELECT meta_value FROM $wpdb->sitemeta WHERE meta_key = %s AND site_id = %d", 'admin_user_id', $network_id ) ) );
+
+ /*
+ * When upgrading from single to multisite, assume the current site will
+ * become the main site of the network. When using populate_network()
+ * to create another network in an existing multisite environment, skip
+ * these steps since the main site of the new network has not yet been
+ * created.
+ */
+ if ( ! is_multisite() ) {
+ $current_site = new stdClass;
+ $current_site->domain = $domain;
+ $current_site->path = $path;
+ $current_site->site_name = ucfirst( $domain );
+ $wpdb->insert(
+ $wpdb->blogs,
+ array(
+ 'site_id' => $network_id,
+ 'blog_id' => 1,
+ 'domain' => $domain,
+ 'path' => $path,
+ 'registered' => current_time( 'mysql' ),
+ )
+ );
+ $current_site->blog_id = $wpdb->insert_id;
+ update_user_meta( $site_user->ID, 'source_domain', $domain );
+ update_user_meta( $site_user->ID, 'primary_blog', $current_site->blog_id );
+
+ if ( $subdomain_install ) {
+ $wp_rewrite->set_permalink_structure( '/%year%/%monthnum%/%day%/%postname%/' );
+ } else {
+ $wp_rewrite->set_permalink_structure( '/blog/%year%/%monthnum%/%day%/%postname%/' );
+ }
+
+ flush_rewrite_rules();
+
+ if ( ! $subdomain_install ) {
+ return true;
+ }
+
+ $vhost_ok = false;
+ $errstr = '';
+ $hostname = substr( md5( time() ), 0, 6 ) . '.' . $domain; // Very random hostname!
+ $page = wp_remote_get(
+ 'http://' . $hostname,
+ array(
+ 'timeout' => 5,
+ 'httpversion' => '1.1',
+ )
+ );
+ if ( is_wp_error( $page ) ) {
+ $errstr = $page->get_error_message();
+ } elseif ( 200 == wp_remote_retrieve_response_code( $page ) ) {
+ $vhost_ok = true;
+ }
+
+ if ( ! $vhost_ok ) {
+ $msg = '<p><strong>' . __( 'Warning! Wildcard DNS may not be configured correctly!' ) . '</strong></p>';
+
+ $msg .= '<p>' . sprintf(
+ /* translators: %s: host name */
+ __( 'The installer attempted to contact a random hostname (%s) on your domain.' ),
+ '<code>' . $hostname . '</code>'
+ );
+ if ( ! empty( $errstr ) ) {
+ /* translators: %s: error message */
+ $msg .= ' ' . sprintf( __( 'This resulted in an error message: %s' ), '<code>' . $errstr . '</code>' );
+ }
+ $msg .= '</p>';
+
+ $msg .= '<p>' . sprintf(
+ /* translators: %s: asterisk symbol (*) */
+ __( 'To use a subdomain configuration, you must have a wildcard entry in your DNS. This usually means adding a %s hostname record pointing at your web server in your DNS configuration tool.' ),
+ '<code>*</code>'
+ ) . '</p>';
+
+ $msg .= '<p>' . __( 'You can still use your site but any subdomain you create may not be accessible. If you know your DNS is correct, ignore this message.' ) . '</p>';
+
+ return new WP_Error( 'no_wildcard_dns', $msg );
+ }
+ }
+
+ return true;
+}
+
+/**
+ * Creates WordPress network meta and sets the default values.
+ *
+ * @since 5.1.0
+ *
+ * @global wpdb $wpdb WordPress database abstraction object.
+ * @global int $wp_db_version WordPress database version.
+ *
+ * @param int $network_id Network ID to populate meta for.
+ * @param array $meta Optional. Custom meta $key => $value pairs to use. Default empty array.
+ */
+function populate_network_meta( $network_id, array $meta = array() ) {
+ global $wpdb, $wp_db_version;
+
+ $network_id = (int) $network_id;
+
+ $email = ! empty( $meta['admin_email'] ) ? $meta['admin_email'] : '';
+ $subdomain_install = isset( $meta['subdomain_install'] ) ? (int) $meta['subdomain_install'] : 0;
+
+ // If a user with the provided email does not exist, default to the current user as the new network admin.
+ $site_user = ! empty( $email ) ? get_user_by( 'email', $email ) : false;
+ if ( false === $site_user ) {
+ $site_user = wp_get_current_user();
+ }
+
+ if ( empty( $email ) ) {
+ $email = $site_user->user_email;
+ }
+
+ $template = get_option( 'template' );
+ $stylesheet = get_option( 'stylesheet' );
+ $allowed_themes = array( $stylesheet => true );
+
+ if ( $template != $stylesheet ) {
+ $allowed_themes[ $template ] = true;
+ }
+
+ if ( WP_DEFAULT_THEME != $stylesheet && WP_DEFAULT_THEME != $template ) {
+ $allowed_themes[ WP_DEFAULT_THEME ] = true;
+ }
+
+ // If WP_DEFAULT_THEME doesn't exist, also whitelist the latest core default theme.
+ if ( ! wp_get_theme( WP_DEFAULT_THEME )->exists() ) {
+ $core_default = WP_Theme::get_core_default_theme();
+ if ( $core_default ) {
+ $allowed_themes[ $core_default->get_stylesheet() ] = true;
+ }
+ }
+
+ wp_cache_delete( 'networks_have_paths', 'site-options' );
+
+ if ( ! is_multisite() ) {
+ $site_admins = array( $site_user->user_login );
+ $users = get_users(
+ array(
+ 'fields' => array( 'user_login' ),
+ 'role' => 'administrator',
+ )
+ );
+ if ( $users ) {
+ foreach ( $users as $user ) {
+ $site_admins[] = $user->user_login;
+ }
+
+ $site_admins = array_unique( $site_admins );
+ }
+ } else {
+ $site_admins = get_site_option( 'site_admins' );
+ }
+
+ /* translators: Do not translate USERNAME, SITE_NAME, BLOG_URL, PASSWORD: those are placeholders. */
+ $welcome_email = __(
+ 'Howdy USERNAME,
+
+Your new SITE_NAME site has been successfully set up at:
+BLOG_URL
+
+You can log in to the administrator account with the following information:
+
+Username: USERNAME
+Password: PASSWORD
+Log in here: BLOG_URLwp-login.php
+
+We hope you enjoy your new site. Thanks!
+
+--The Team @ SITE_NAME'
+ );
+
+ $misc_exts = array(
+ // Images.
+ 'jpg',
+ 'jpeg',
+ 'png',
+ 'gif',
+ // Video.
+ 'mov',
+ 'avi',
+ 'mpg',
+ '3gp',
+ '3g2',
+ // "audio".
+ 'midi',
+ 'mid',
+ // Miscellaneous.
+ 'pdf',
+ 'doc',
+ 'ppt',
+ 'odt',
+ 'pptx',
+ 'docx',
+ 'pps',
+ 'ppsx',
+ 'xls',
+ 'xlsx',
+ 'key',
+ );
+ $audio_exts = wp_get_audio_extensions();
+ $video_exts = wp_get_video_extensions();
+ $upload_filetypes = array_unique( array_merge( $misc_exts, $audio_exts, $video_exts ) );
+
+ $sitemeta = array(
+ 'site_name' => __( 'My Network' ),
+ 'admin_email' => $email,
+ 'admin_user_id' => $site_user->ID,
+ 'registration' => 'none',
+ 'upload_filetypes' => implode( ' ', $upload_filetypes ),
+ 'blog_upload_space' => 100,
+ 'fileupload_maxk' => 1500,
+ 'site_admins' => $site_admins,
+ 'allowedthemes' => $allowed_themes,
+ 'illegal_names' => array( 'www', 'web', 'root', 'admin', 'main', 'invite', 'administrator', 'files' ),
+ 'wpmu_upgrade_site' => $wp_db_version,
+ 'welcome_email' => $welcome_email,
+ /* translators: %s: site link */
+ 'first_post' => __( 'Welcome to %s. This is your first post. Edit or delete it, then start writing!' ),
+ // @todo - network admins should have a method of editing the network siteurl (used for cookie hash)
+ 'siteurl' => get_option( 'siteurl' ) . '/',
+ 'add_new_users' => '0',
+ 'upload_space_check_disabled' => is_multisite() ? get_site_option( 'upload_space_check_disabled' ) : '1',
+ 'subdomain_install' => $subdomain_install,
+ 'global_terms_enabled' => global_terms_enabled() ? '1' : '0',
+ 'ms_files_rewriting' => is_multisite() ? get_site_option( 'ms_files_rewriting' ) : '0',
+ 'initial_db_version' => get_option( 'initial_db_version' ),
+ 'active_sitewide_plugins' => array(),
+ 'WPLANG' => get_locale(),
+ );
+ if ( ! $subdomain_install ) {
+ $sitemeta['illegal_names'][] = 'blog';
+ }
+
+ $sitemeta = wp_parse_args( $meta, $sitemeta );
+
+ /**
+ * Filters meta for a network on creation.
+ *
+ * @since 3.7.0
+ *
+ * @param array $sitemeta Associative array of network meta keys and values to be inserted.
+ * @param int $network_id ID of network to populate.
+ */
+ $sitemeta = apply_filters( 'populate_network_meta', $sitemeta, $network_id );
+
+ $insert = '';
+ foreach ( $sitemeta as $meta_key => $meta_value ) {
+ if ( is_array( $meta_value ) ) {
+ $meta_value = serialize( $meta_value );
+ }
+ if ( ! empty( $insert ) ) {
+ $insert .= ', ';
+ }
+ $insert .= $wpdb->prepare( '( %d, %s, %s)', $network_id, $meta_key, $meta_value );
+ }
+ $wpdb->query( "INSERT INTO $wpdb->sitemeta ( site_id, meta_key, meta_value ) VALUES " . $insert ); // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared
+}
+
+/**
+ * Creates WordPress site meta and sets the default values.
+ *
+ * @since 5.1.0
+ *
+ * @global wpdb $wpdb WordPress database abstraction object.
+ *
+ * @param int $site_id Site ID to populate meta for.
+ * @param array $meta Optional. Custom meta $key => $value pairs to use. Default empty array.
+ */
+function populate_site_meta( $site_id, array $meta = array() ) {
+ global $wpdb;
+
+ $site_id = (int) $site_id;
+
+ if ( ! is_site_meta_supported() ) {
+ return;
+ }
+
+ if ( empty( $meta ) ) {
+ return;
+ }
+
+ /**
+ * Filters meta for a site on creation.
+ *
+ * @since 5.2.0
+ *
+ * @param array $meta Associative array of site meta keys and values to be inserted.
+ * @param int $site_id ID of site to populate.
+ */
+ $site_meta = apply_filters( 'populate_site_meta', $meta, $site_id );
+
+ $insert = '';
+ foreach ( $site_meta as $meta_key => $meta_value ) {
+ if ( is_array( $meta_value ) ) {
+ $meta_value = serialize( $meta_value );
+ }
+ if ( ! empty( $insert ) ) {
+ $insert .= ', ';
+ }
+ $insert .= $wpdb->prepare( '( %d, %s, %s)', $site_id, $meta_key, $meta_value );
+ }
+
+ $wpdb->query( "INSERT INTO $wpdb->blogmeta ( blog_id, meta_key, meta_value ) VALUES " . $insert ); // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared
+
+ wp_cache_delete( $site_id, 'blog_meta' );
+ wp_cache_set_sites_last_changed();
+}
diff --git a/www/crm/wp-admin/includes/screen.php b/www/crm/wp-admin/includes/screen.php
new file mode 100644
index 00000000..8860c0d1
--- /dev/null
+++ b/www/crm/wp-admin/includes/screen.php
@@ -0,0 +1,242 @@
+<?php
+/**
+ * WordPress Administration Screen API.
+ *
+ * @package WordPress
+ * @subpackage Administration
+ */
+
+/**
+ * Get the column headers for a screen
+ *
+ * @since 2.7.0
+ *
+ * @staticvar array $column_headers
+ *
+ * @param string|WP_Screen $screen The screen you want the headers for
+ * @return array Containing the headers in the format id => UI String
+ */
+function get_column_headers( $screen ) {
+ if ( is_string( $screen ) ) {
+ $screen = convert_to_screen( $screen );
+ }
+
+ static $column_headers = array();
+
+ if ( ! isset( $column_headers[ $screen->id ] ) ) {
+
+ /**
+ * Filters the column headers for a list table on a specific screen.
+ *
+ * The dynamic portion of the hook name, `$screen->id`, refers to the
+ * ID of a specific screen. For example, the screen ID for the Posts
+ * list table is edit-post, so the filter for that screen would be
+ * manage_edit-post_columns.
+ *
+ * @since 3.0.0
+ *
+ * @param array $columns An array of column headers. Default empty.
+ */
+ $column_headers[ $screen->id ] = apply_filters( "manage_{$screen->id}_columns", array() );
+ }
+
+ return $column_headers[ $screen->id ];
+}
+
+/**
+ * Get a list of hidden columns.
+ *
+ * @since 2.7.0
+ *
+ * @param string|WP_Screen $screen The screen you want the hidden columns for
+ * @return array
+ */
+function get_hidden_columns( $screen ) {
+ if ( is_string( $screen ) ) {
+ $screen = convert_to_screen( $screen );
+ }
+
+ $hidden = get_user_option( 'manage' . $screen->id . 'columnshidden' );
+
+ $use_defaults = ! is_array( $hidden );
+
+ if ( $use_defaults ) {
+ $hidden = array();
+
+ /**
+ * Filters the default list of hidden columns.
+ *
+ * @since 4.4.0
+ *
+ * @param array $hidden An array of columns hidden by default.
+ * @param WP_Screen $screen WP_Screen object of the current screen.
+ */
+ $hidden = apply_filters( 'default_hidden_columns', $hidden, $screen );
+ }
+
+ /**
+ * Filters the list of hidden columns.
+ *
+ * @since 4.4.0
+ * @since 4.4.1 Added the `use_defaults` parameter.
+ *
+ * @param array $hidden An array of hidden columns.
+ * @param WP_Screen $screen WP_Screen object of the current screen.
+ * @param bool $use_defaults Whether to show the default columns.
+ */
+ return apply_filters( 'hidden_columns', $hidden, $screen, $use_defaults );
+}
+
+/**
+ * Prints the meta box preferences for screen meta.
+ *
+ * @since 2.7.0
+ *
+ * @global array $wp_meta_boxes
+ *
+ * @param WP_Screen $screen
+ */
+function meta_box_prefs( $screen ) {
+ global $wp_meta_boxes;
+
+ if ( is_string( $screen ) ) {
+ $screen = convert_to_screen( $screen );
+ }
+
+ if ( empty( $wp_meta_boxes[ $screen->id ] ) ) {
+ return;
+ }
+
+ $hidden = get_hidden_meta_boxes( $screen );
+
+ foreach ( array_keys( $wp_meta_boxes[ $screen->id ] ) as $context ) {
+ foreach ( array( 'high', 'core', 'default', 'low' ) as $priority ) {
+ if ( ! isset( $wp_meta_boxes[ $screen->id ][ $context ][ $priority ] ) ) {
+ continue;
+ }
+ foreach ( $wp_meta_boxes[ $screen->id ][ $context ][ $priority ] as $box ) {
+ if ( false == $box || ! $box['title'] ) {
+ continue;
+ }
+ // Submit box cannot be hidden
+ if ( 'submitdiv' == $box['id'] || 'linksubmitdiv' == $box['id'] ) {
+ continue;
+ }
+
+ $widget_title = $box['title'];
+
+ if ( is_array( $box['args'] ) && isset( $box['args']['__widget_basename'] ) ) {
+ $widget_title = $box['args']['__widget_basename'];
+ }
+
+ printf(
+ '<label for="%1$s-hide"><input class="hide-postbox-tog" name="%1$s-hide" type="checkbox" id="%1$s-hide" value="%1$s" %2$s />%3$s</label>',
+ esc_attr( $box['id'] ),
+ checked( in_array( $box['id'], $hidden ), false, false ),
+ $widget_title
+ );
+ }
+ }
+ }
+}
+
+/**
+ * Get Hidden Meta Boxes
+ *
+ * @since 2.7.0
+ *
+ * @param string|WP_Screen $screen Screen identifier
+ * @return array Hidden Meta Boxes
+ */
+function get_hidden_meta_boxes( $screen ) {
+ if ( is_string( $screen ) ) {
+ $screen = convert_to_screen( $screen );
+ }
+
+ $hidden = get_user_option( "metaboxhidden_{$screen->id}" );
+
+ $use_defaults = ! is_array( $hidden );
+
+ // Hide slug boxes by default
+ if ( $use_defaults ) {
+ $hidden = array();
+ if ( 'post' == $screen->base ) {
+ if ( 'post' == $screen->post_type || 'page' == $screen->post_type || 'attachment' == $screen->post_type ) {
+ $hidden = array( 'slugdiv', 'trackbacksdiv', 'postcustom', 'postexcerpt', 'commentstatusdiv', 'commentsdiv', 'authordiv', 'revisionsdiv' );
+ } else {
+ $hidden = array( 'slugdiv' );
+ }
+ }
+
+ /**
+ * Filters the default list of hidden meta boxes.
+ *
+ * @since 3.1.0
+ *
+ * @param array $hidden An array of meta boxes hidden by default.
+ * @param WP_Screen $screen WP_Screen object of the current screen.
+ */
+ $hidden = apply_filters( 'default_hidden_meta_boxes', $hidden, $screen );
+ }
+
+ /**
+ * Filters the list of hidden meta boxes.
+ *
+ * @since 3.3.0
+ *
+ * @param array $hidden An array of hidden meta boxes.
+ * @param WP_Screen $screen WP_Screen object of the current screen.
+ * @param bool $use_defaults Whether to show the default meta boxes.
+ * Default true.
+ */
+ return apply_filters( 'hidden_meta_boxes', $hidden, $screen, $use_defaults );
+}
+
+/**
+ * Register and configure an admin screen option
+ *
+ * @since 3.1.0
+ *
+ * @param string $option An option name.
+ * @param mixed $args Option-dependent arguments.
+ */
+function add_screen_option( $option, $args = array() ) {
+ $current_screen = get_current_screen();
+
+ if ( ! $current_screen ) {
+ return;
+ }
+
+ $current_screen->add_option( $option, $args );
+}
+
+/**
+ * Get the current screen object
+ *
+ * @since 3.1.0
+ *
+ * @global WP_Screen $current_screen
+ *
+ * @return WP_Screen|null Current screen object or null when screen not defined.
+ */
+function get_current_screen() {
+ global $current_screen;
+
+ if ( ! isset( $current_screen ) ) {
+ return null;
+ }
+
+ return $current_screen;
+}
+
+/**
+ * Set the current screen object
+ *
+ * @since 3.0.0
+ *
+ * @param mixed $hook_name Optional. The hook name (also known as the hook suffix) used to determine the screen,
+ * or an existing screen object.
+ */
+function set_current_screen( $hook_name = '' ) {
+ WP_Screen::get( $hook_name )->set_current_screen();
+}
diff --git a/www/crm/wp-admin/includes/taxonomy.php b/www/crm/wp-admin/includes/taxonomy.php
new file mode 100644
index 00000000..62988c3b
--- /dev/null
+++ b/www/crm/wp-admin/includes/taxonomy.php
@@ -0,0 +1,308 @@
+<?php
+/**
+ * WordPress Taxonomy Administration API.
+ *
+ * @package WordPress
+ * @subpackage Administration
+ */
+
+//
+// Category
+//
+
+/**
+ * Check whether a category exists.
+ *
+ * @since 2.0.0
+ *
+ * @see term_exists()
+ *
+ * @param int|string $cat_name Category name.
+ * @param int $parent Optional. ID of parent term.
+ * @return mixed
+ */
+function category_exists( $cat_name, $parent = null ) {
+ $id = term_exists( $cat_name, 'category', $parent );
+ if ( is_array( $id ) ) {
+ $id = $id['term_id'];
+ }
+ return $id;
+}
+
+/**
+ * Get category object for given ID and 'edit' filter context.
+ *
+ * @since 2.0.0
+ *
+ * @param int $id
+ * @return object
+ */
+function get_category_to_edit( $id ) {
+ $category = get_term( $id, 'category', OBJECT, 'edit' );
+ _make_cat_compat( $category );
+ return $category;
+}
+
+/**
+ * Add a new category to the database if it does not already exist.
+ *
+ * @since 2.0.0
+ *
+ * @param int|string $cat_name
+ * @param int $parent
+ * @return int|WP_Error
+ */
+function wp_create_category( $cat_name, $parent = 0 ) {
+ if ( $id = category_exists( $cat_name, $parent ) ) {
+ return $id;
+ }
+
+ return wp_insert_category(
+ array(
+ 'cat_name' => $cat_name,
+ 'category_parent' => $parent,
+ )
+ );
+}
+
+/**
+ * Create categories for the given post.
+ *
+ * @since 2.0.0
+ *
+ * @param string[] $categories Array of category names to create.
+ * @param int $post_id Optional. The post ID. Default empty.
+ * @return array List of categories to create for the given post.
+ */
+function wp_create_categories( $categories, $post_id = '' ) {
+ $cat_ids = array();
+ foreach ( $categories as $category ) {
+ if ( $id = category_exists( $category ) ) {
+ $cat_ids[] = $id;
+ } elseif ( $id = wp_create_category( $category ) ) {
+ $cat_ids[] = $id;
+ }
+ }
+
+ if ( $post_id ) {
+ wp_set_post_categories( $post_id, $cat_ids );
+ }
+
+ return $cat_ids;
+}
+
+/**
+ * Updates an existing Category or creates a new Category.
+ *
+ * @since 2.0.0
+ * @since 2.5.0 $wp_error parameter was added.
+ * @since 3.0.0 The 'taxonomy' argument was added.
+ *
+ * @param array $catarr {
+ * Array of arguments for inserting a new category.
+ *
+ * @type int $cat_ID Category ID. A non-zero value updates an existing category.
+ * Default 0.
+ * @type string $taxonomy Taxonomy slug. Default 'category'.
+ * @type string $cat_name Category name. Default empty.
+ * @type string $category_description Category description. Default empty.
+ * @type string $category_nicename Category nice (display) name. Default empty.
+ * @type int|string $category_parent Category parent ID. Default empty.
+ * }
+ * @param bool $wp_error Optional. Default false.
+ * @return int|object The ID number of the new or updated Category on success. Zero or a WP_Error on failure,
+ * depending on param $wp_error.
+ */
+function wp_insert_category( $catarr, $wp_error = false ) {
+ $cat_defaults = array(
+ 'cat_ID' => 0,
+ 'taxonomy' => 'category',
+ 'cat_name' => '',
+ 'category_description' => '',
+ 'category_nicename' => '',
+ 'category_parent' => '',
+ );
+ $catarr = wp_parse_args( $catarr, $cat_defaults );
+
+ if ( trim( $catarr['cat_name'] ) == '' ) {
+ if ( ! $wp_error ) {
+ return 0;
+ } else {
+ return new WP_Error( 'cat_name', __( 'You did not enter a category name.' ) );
+ }
+ }
+
+ $catarr['cat_ID'] = (int) $catarr['cat_ID'];
+
+ // Are we updating or creating?
+ $update = ! empty( $catarr['cat_ID'] );
+
+ $name = $catarr['cat_name'];
+ $description = $catarr['category_description'];
+ $slug = $catarr['category_nicename'];
+ $parent = (int) $catarr['category_parent'];
+ if ( $parent < 0 ) {
+ $parent = 0;
+ }
+
+ if ( empty( $parent )
+ || ! term_exists( $parent, $catarr['taxonomy'] )
+ || ( $catarr['cat_ID'] && term_is_ancestor_of( $catarr['cat_ID'], $parent, $catarr['taxonomy'] ) ) ) {
+ $parent = 0;
+ }
+
+ $args = compact( 'name', 'slug', 'parent', 'description' );
+
+ if ( $update ) {
+ $catarr['cat_ID'] = wp_update_term( $catarr['cat_ID'], $catarr['taxonomy'], $args );
+ } else {
+ $catarr['cat_ID'] = wp_insert_term( $catarr['cat_name'], $catarr['taxonomy'], $args );
+ }
+
+ if ( is_wp_error( $catarr['cat_ID'] ) ) {
+ if ( $wp_error ) {
+ return $catarr['cat_ID'];
+ } else {
+ return 0;
+ }
+ }
+ return $catarr['cat_ID']['term_id'];
+}
+
+/**
+ * Aliases wp_insert_category() with minimal args.
+ *
+ * If you want to update only some fields of an existing category, call this
+ * function with only the new values set inside $catarr.
+ *
+ * @since 2.0.0
+ *
+ * @param array $catarr The 'cat_ID' value is required. All other keys are optional.
+ * @return int|bool The ID number of the new or updated Category on success. Zero or FALSE on failure.
+ */
+function wp_update_category( $catarr ) {
+ $cat_ID = (int) $catarr['cat_ID'];
+
+ if ( isset( $catarr['category_parent'] ) && ( $cat_ID == $catarr['category_parent'] ) ) {
+ return false;
+ }
+
+ // First, get all of the original fields
+ $category = get_term( $cat_ID, 'category', ARRAY_A );
+ _make_cat_compat( $category );
+
+ // Escape data pulled from DB.
+ $category = wp_slash( $category );
+
+ // Merge old and new fields with new fields overwriting old ones.
+ $catarr = array_merge( $category, $catarr );
+
+ return wp_insert_category( $catarr );
+}
+
+//
+// Tags
+//
+
+/**
+ * Check whether a post tag with a given name exists.
+ *
+ * @since 2.3.0
+ *
+ * @param int|string $tag_name
+ * @return mixed
+ */
+function tag_exists( $tag_name ) {
+ return term_exists( $tag_name, 'post_tag' );
+}
+
+/**
+ * Add a new tag to the database if it does not already exist.
+ *
+ * @since 2.3.0
+ *
+ * @param int|string $tag_name
+ * @return array|WP_Error
+ */
+function wp_create_tag( $tag_name ) {
+ return wp_create_term( $tag_name, 'post_tag' );
+}
+
+/**
+ * Get comma-separated list of tags available to edit.
+ *
+ * @since 2.3.0
+ *
+ * @param int $post_id
+ * @param string $taxonomy Optional. The taxonomy for which to retrieve terms. Default 'post_tag'.
+ * @return string|bool|WP_Error
+ */
+function get_tags_to_edit( $post_id, $taxonomy = 'post_tag' ) {
+ return get_terms_to_edit( $post_id, $taxonomy );
+}
+
+/**
+ * Get comma-separated list of terms available to edit for the given post ID.
+ *
+ * @since 2.8.0
+ *
+ * @param int $post_id
+ * @param string $taxonomy Optional. The taxonomy for which to retrieve terms. Default 'post_tag'.
+ * @return string|bool|WP_Error
+ */
+function get_terms_to_edit( $post_id, $taxonomy = 'post_tag' ) {
+ $post_id = (int) $post_id;
+ if ( ! $post_id ) {
+ return false;
+ }
+
+ $terms = get_object_term_cache( $post_id, $taxonomy );
+ if ( false === $terms ) {
+ $terms = wp_get_object_terms( $post_id, $taxonomy );
+ wp_cache_add( $post_id, wp_list_pluck( $terms, 'term_id' ), $taxonomy . '_relationships' );
+ }
+
+ if ( ! $terms ) {
+ return false;
+ }
+ if ( is_wp_error( $terms ) ) {
+ return $terms;
+ }
+ $term_names = array();
+ foreach ( $terms as $term ) {
+ $term_names[] = $term->name;
+ }
+
+ $terms_to_edit = esc_attr( join( ',', $term_names ) );
+
+ /**
+ * Filters the comma-separated list of terms available to edit.
+ *
+ * @since 2.8.0
+ *
+ * @see get_terms_to_edit()
+ *
+ * @param string $terms_to_edit A comma-separated list of term names.
+ * @param string $taxonomy The taxonomy name for which to retrieve terms.
+ */
+ $terms_to_edit = apply_filters( 'terms_to_edit', $terms_to_edit, $taxonomy );
+
+ return $terms_to_edit;
+}
+
+/**
+ * Add a new term to the database if it does not already exist.
+ *
+ * @since 2.8.0
+ *
+ * @param int|string $tag_name
+ * @param string $taxonomy Optional. The taxonomy for which to retrieve terms. Default 'post_tag'.
+ * @return array|WP_Error
+ */
+function wp_create_term( $tag_name, $taxonomy = 'post_tag' ) {
+ if ( $id = term_exists( $tag_name, $taxonomy ) ) {
+ return $id;
+ }
+
+ return wp_insert_term( $tag_name, $taxonomy );
+}
diff --git a/www/crm/wp-admin/includes/template.php b/www/crm/wp-admin/includes/template.php
new file mode 100644
index 00000000..d6a705ea
--- /dev/null
+++ b/www/crm/wp-admin/includes/template.php
@@ -0,0 +1,2496 @@
+<?php
+/**
+ * Template WordPress Administration API.
+ *
+ * A Big Mess. Also some neat functions that are nicely written.
+ *
+ * @package WordPress
+ * @subpackage Administration
+ */
+
+/** Walker_Category_Checklist class */
+require_once( ABSPATH . 'wp-admin/includes/class-walker-category-checklist.php' );
+
+/** WP_Internal_Pointers class */
+require_once( ABSPATH . 'wp-admin/includes/class-wp-internal-pointers.php' );
+
+//
+// Category Checklists
+//
+
+/**
+ * Output an unordered list of checkbox input elements labeled with category names.
+ *
+ * @since 2.5.1
+ *
+ * @see wp_terms_checklist()
+ *
+ * @param int $post_id Optional. Post to generate a categories checklist for. Default 0.
+ * $selected_cats must not be an array. Default 0.
+ * @param int $descendants_and_self Optional. ID of the category to output along with its descendants.
+ * Default 0.
+ * @param int[] $selected_cats Optional. Array of category IDs to mark as checked. Default false.
+ * @param int[] $popular_cats Optional. Array of category IDs to receive the "popular-category" class.
+ * Default false.
+ * @param object $walker Optional. Walker object to use to build the output.
+ * Default is a Walker_Category_Checklist instance.
+ * @param bool $checked_ontop Optional. Whether to move checked items out of the hierarchy and to
+ * the top of the list. Default true.
+ */
+function wp_category_checklist( $post_id = 0, $descendants_and_self = 0, $selected_cats = false, $popular_cats = false, $walker = null, $checked_ontop = true ) {
+ wp_terms_checklist(
+ $post_id,
+ array(
+ 'taxonomy' => 'category',
+ 'descendants_and_self' => $descendants_and_self,
+ 'selected_cats' => $selected_cats,
+ 'popular_cats' => $popular_cats,
+ 'walker' => $walker,
+ 'checked_ontop' => $checked_ontop,
+ )
+ );
+}
+
+/**
+ * Output an unordered list of checkbox input elements labelled with term names.
+ *
+ * Taxonomy-independent version of wp_category_checklist().
+ *
+ * @since 3.0.0
+ * @since 4.4.0 Introduced the `$echo` argument.
+ *
+ * @param int $post_id Optional. Post ID. Default 0.
+ * @param array|string $args {
+ * Optional. Array or string of arguments for generating a terms checklist. Default empty array.
+ *
+ * @type int $descendants_and_self ID of the category to output along with its descendants.
+ * Default 0.
+ * @type int[] $selected_cats Array of category IDs to mark as checked. Default false.
+ * @type int[] $popular_cats Array of category IDs to receive the "popular-category" class.
+ * Default false.
+ * @type object $walker Walker object to use to build the output.
+ * Default is a Walker_Category_Checklist instance.
+ * @type string $taxonomy Taxonomy to generate the checklist for. Default 'category'.
+ * @type bool $checked_ontop Whether to move checked items out of the hierarchy and to
+ * the top of the list. Default true.
+ * @type bool $echo Whether to echo the generated markup. False to return the markup instead
+ * of echoing it. Default true.
+ * }
+ */
+function wp_terms_checklist( $post_id = 0, $args = array() ) {
+ $defaults = array(
+ 'descendants_and_self' => 0,
+ 'selected_cats' => false,
+ 'popular_cats' => false,
+ 'walker' => null,
+ 'taxonomy' => 'category',
+ 'checked_ontop' => true,
+ 'echo' => true,
+ );
+
+ /**
+ * Filters the taxonomy terms checklist arguments.
+ *
+ * @since 3.4.0
+ *
+ * @see wp_terms_checklist()
+ *
+ * @param array $args An array of arguments.
+ * @param int $post_id The post ID.
+ */
+ $params = apply_filters( 'wp_terms_checklist_args', $args, $post_id );
+
+ $r = wp_parse_args( $params, $defaults );
+
+ if ( empty( $r['walker'] ) || ! ( $r['walker'] instanceof Walker ) ) {
+ $walker = new Walker_Category_Checklist;
+ } else {
+ $walker = $r['walker'];
+ }
+
+ $taxonomy = $r['taxonomy'];
+ $descendants_and_self = (int) $r['descendants_and_self'];
+
+ $args = array( 'taxonomy' => $taxonomy );
+
+ $tax = get_taxonomy( $taxonomy );
+ $args['disabled'] = ! current_user_can( $tax->cap->assign_terms );
+
+ $args['list_only'] = ! empty( $r['list_only'] );
+
+ if ( is_array( $r['selected_cats'] ) ) {
+ $args['selected_cats'] = $r['selected_cats'];
+ } elseif ( $post_id ) {
+ $args['selected_cats'] = wp_get_object_terms( $post_id, $taxonomy, array_merge( $args, array( 'fields' => 'ids' ) ) );
+ } else {
+ $args['selected_cats'] = array();
+ }
+ if ( is_array( $r['popular_cats'] ) ) {
+ $args['popular_cats'] = $r['popular_cats'];
+ } else {
+ $args['popular_cats'] = get_terms(
+ $taxonomy,
+ array(
+ 'fields' => 'ids',
+ 'orderby' => 'count',
+ 'order' => 'DESC',
+ 'number' => 10,
+ 'hierarchical' => false,
+ )
+ );
+ }
+ if ( $descendants_and_self ) {
+ $categories = (array) get_terms(
+ $taxonomy,
+ array(
+ 'child_of' => $descendants_and_self,
+ 'hierarchical' => 0,
+ 'hide_empty' => 0,
+ )
+ );
+ $self = get_term( $descendants_and_self, $taxonomy );
+ array_unshift( $categories, $self );
+ } else {
+ $categories = (array) get_terms( $taxonomy, array( 'get' => 'all' ) );
+ }
+
+ $output = '';
+
+ if ( $r['checked_ontop'] ) {
+ // Post process $categories rather than adding an exclude to the get_terms() query to keep the query the same across all posts (for any query cache)
+ $checked_categories = array();
+ $keys = array_keys( $categories );
+
+ foreach ( $keys as $k ) {
+ if ( in_array( $categories[ $k ]->term_id, $args['selected_cats'] ) ) {
+ $checked_categories[] = $categories[ $k ];
+ unset( $categories[ $k ] );
+ }
+ }
+
+ // Put checked cats on top
+ $output .= call_user_func_array( array( $walker, 'walk' ), array( $checked_categories, 0, $args ) );
+ }
+ // Then the rest of them
+ $output .= call_user_func_array( array( $walker, 'walk' ), array( $categories, 0, $args ) );
+
+ if ( $r['echo'] ) {
+ echo $output;
+ }
+
+ return $output;
+}
+
+/**
+ * Retrieve a list of the most popular terms from the specified taxonomy.
+ *
+ * If the $echo argument is true then the elements for a list of checkbox
+ * `<input>` elements labelled with the names of the selected terms is output.
+ * If the $post_ID global isn't empty then the terms associated with that
+ * post will be marked as checked.
+ *
+ * @since 2.5.0
+ *
+ * @param string $taxonomy Taxonomy to retrieve terms from.
+ * @param int $default Not used.
+ * @param int $number Number of terms to retrieve. Defaults to 10.
+ * @param bool $echo Optionally output the list as well. Defaults to true.
+ * @return array List of popular term IDs.
+ */
+function wp_popular_terms_checklist( $taxonomy, $default = 0, $number = 10, $echo = true ) {
+ $post = get_post();
+
+ if ( $post && $post->ID ) {
+ $checked_terms = wp_get_object_terms( $post->ID, $taxonomy, array( 'fields' => 'ids' ) );
+ } else {
+ $checked_terms = array();
+ }
+
+ $terms = get_terms(
+ $taxonomy,
+ array(
+ 'orderby' => 'count',
+ 'order' => 'DESC',
+ 'number' => $number,
+ 'hierarchical' => false,
+ )
+ );
+
+ $tax = get_taxonomy( $taxonomy );
+
+ $popular_ids = array();
+ foreach ( (array) $terms as $term ) {
+ $popular_ids[] = $term->term_id;
+ if ( ! $echo ) { // Hack for Ajax use.
+ continue;
+ }
+ $id = "popular-$taxonomy-$term->term_id";
+ $checked = in_array( $term->term_id, $checked_terms ) ? 'checked="checked"' : '';
+ ?>
+
+ <li id="<?php echo $id; ?>" class="popular-category">
+ <label class="selectit">
+ <input id="in-<?php echo $id; ?>" type="checkbox" <?php echo $checked; ?> value="<?php echo (int) $term->term_id; ?>" <?php disabled( ! current_user_can( $tax->cap->assign_terms ) ); ?> />
+ <?php
+ /** This filter is documented in wp-includes/category-template.php */
+ echo esc_html( apply_filters( 'the_category', $term->name, '', '' ) );
+ ?>
+ </label>
+ </li>
+
+ <?php
+ }
+ return $popular_ids;
+}
+
+/**
+ * Outputs a link category checklist element.
+ *
+ * @since 2.5.1
+ *
+ * @param int $link_id
+ */
+function wp_link_category_checklist( $link_id = 0 ) {
+ $default = 1;
+
+ $checked_categories = array();
+
+ if ( $link_id ) {
+ $checked_categories = wp_get_link_cats( $link_id );
+ // No selected categories, strange
+ if ( ! count( $checked_categories ) ) {
+ $checked_categories[] = $default;
+ }
+ } else {
+ $checked_categories[] = $default;
+ }
+
+ $categories = get_terms(
+ 'link_category',
+ array(
+ 'orderby' => 'name',
+ 'hide_empty' => 0,
+ )
+ );
+
+ if ( empty( $categories ) ) {
+ return;
+ }
+
+ foreach ( $categories as $category ) {
+ $cat_id = $category->term_id;
+
+ /** This filter is documented in wp-includes/category-template.php */
+ $name = esc_html( apply_filters( 'the_category', $category->name, '', '' ) );
+ $checked = in_array( $cat_id, $checked_categories ) ? ' checked="checked"' : '';
+ echo '<li id="link-category-', $cat_id, '"><label for="in-link-category-', $cat_id, '" class="selectit"><input value="', $cat_id, '" type="checkbox" name="link_category[]" id="in-link-category-', $cat_id, '"', $checked, '/> ', $name, '</label></li>';
+ }
+}
+
+/**
+ * Adds hidden fields with the data for use in the inline editor for posts and pages.
+ *
+ * @since 2.7.0
+ *
+ * @param WP_Post $post Post object.
+ */
+function get_inline_data( $post ) {
+ $post_type_object = get_post_type_object( $post->post_type );
+ if ( ! current_user_can( 'edit_post', $post->ID ) ) {
+ return;
+ }
+
+ $title = esc_textarea( trim( $post->post_title ) );
+
+ /** This filter is documented in wp-admin/edit-tag-form.php */
+ echo '
+<div class="hidden" id="inline_' . $post->ID . '">
+ <div class="post_title">' . $title . '</div>' .
+ /** This filter is documented in wp-admin/edit-tag-form.php */
+ '<div class="post_name">' . apply_filters( 'editable_slug', $post->post_name, $post ) . '</div>
+ <div class="post_author">' . $post->post_author . '</div>
+ <div class="comment_status">' . esc_html( $post->comment_status ) . '</div>
+ <div class="ping_status">' . esc_html( $post->ping_status ) . '</div>
+ <div class="_status">' . esc_html( $post->post_status ) . '</div>
+ <div class="jj">' . mysql2date( 'd', $post->post_date, false ) . '</div>
+ <div class="mm">' . mysql2date( 'm', $post->post_date, false ) . '</div>
+ <div class="aa">' . mysql2date( 'Y', $post->post_date, false ) . '</div>
+ <div class="hh">' . mysql2date( 'H', $post->post_date, false ) . '</div>
+ <div class="mn">' . mysql2date( 'i', $post->post_date, false ) . '</div>
+ <div class="ss">' . mysql2date( 's', $post->post_date, false ) . '</div>
+ <div class="post_password">' . esc_html( $post->post_password ) . '</div>';
+
+ if ( $post_type_object->hierarchical ) {
+ echo '<div class="post_parent">' . $post->post_parent . '</div>';
+ }
+
+ echo '<div class="page_template">' . ( $post->page_template ? esc_html( $post->page_template ) : 'default' ) . '</div>';
+
+ if ( post_type_supports( $post->post_type, 'page-attributes' ) ) {
+ echo '<div class="menu_order">' . $post->menu_order . '</div>';
+ }
+
+ $taxonomy_names = get_object_taxonomies( $post->post_type );
+ foreach ( $taxonomy_names as $taxonomy_name ) {
+ $taxonomy = get_taxonomy( $taxonomy_name );
+
+ if ( $taxonomy->hierarchical && $taxonomy->show_ui ) {
+
+ $terms = get_object_term_cache( $post->ID, $taxonomy_name );
+ if ( false === $terms ) {
+ $terms = wp_get_object_terms( $post->ID, $taxonomy_name );
+ wp_cache_add( $post->ID, wp_list_pluck( $terms, 'term_id' ), $taxonomy_name . '_relationships' );
+ }
+ $term_ids = empty( $terms ) ? array() : wp_list_pluck( $terms, 'term_id' );
+
+ echo '<div class="post_category" id="' . $taxonomy_name . '_' . $post->ID . '">' . implode( ',', $term_ids ) . '</div>';
+
+ } elseif ( $taxonomy->show_ui ) {
+
+ $terms_to_edit = get_terms_to_edit( $post->ID, $taxonomy_name );
+ if ( ! is_string( $terms_to_edit ) ) {
+ $terms_to_edit = '';
+ }
+
+ echo '<div class="tags_input" id="' . $taxonomy_name . '_' . $post->ID . '">'
+ . esc_html( str_replace( ',', ', ', $terms_to_edit ) ) . '</div>';
+
+ }
+ }
+
+ if ( ! $post_type_object->hierarchical ) {
+ echo '<div class="sticky">' . ( is_sticky( $post->ID ) ? 'sticky' : '' ) . '</div>';
+ }
+
+ if ( post_type_supports( $post->post_type, 'post-formats' ) ) {
+ echo '<div class="post_format">' . esc_html( get_post_format( $post->ID ) ) . '</div>';
+ }
+
+ /**
+ * Fires after outputting the fields for the inline editor for posts and pages.
+ *
+ * @since 4.9.8
+ *
+ * @param WP_Post $post The current post object.
+ * @param WP_Post_Type $post_type_object The current post's post type object.
+ */
+ do_action( 'add_inline_data', $post, $post_type_object );
+
+ echo '</div>';
+}
+
+/**
+ * Outputs the in-line comment reply-to form in the Comments list table.
+ *
+ * @since 2.7.0
+ *
+ * @global WP_List_Table $wp_list_table
+ *
+ * @param int $position
+ * @param bool $checkbox
+ * @param string $mode
+ * @param bool $table_row
+ */
+function wp_comment_reply( $position = 1, $checkbox = false, $mode = 'single', $table_row = true ) {
+ global $wp_list_table;
+ /**
+ * Filters the in-line comment reply-to form output in the Comments
+ * list table.
+ *
+ * Returning a non-empty value here will short-circuit display
+ * of the in-line comment-reply form in the Comments list table,
+ * echoing the returned value instead.
+ *
+ * @since 2.7.0
+ *
+ * @see wp_comment_reply()
+ *
+ * @param string $content The reply-to form content.
+ * @param array $args An array of default args.
+ */
+ $content = apply_filters(
+ 'wp_comment_reply',
+ '',
+ array(
+ 'position' => $position,
+ 'checkbox' => $checkbox,
+ 'mode' => $mode,
+ )
+ );
+
+ if ( ! empty( $content ) ) {
+ echo $content;
+ return;
+ }
+
+ if ( ! $wp_list_table ) {
+ if ( $mode == 'single' ) {
+ $wp_list_table = _get_list_table( 'WP_Post_Comments_List_Table' );
+ } else {
+ $wp_list_table = _get_list_table( 'WP_Comments_List_Table' );
+ }
+ }
+
+ ?>
+<form method="get">
+ <?php if ( $table_row ) : ?>
+<table style="display:none;"><tbody id="com-reply"><tr id="replyrow" class="inline-edit-row" style="display:none;"><td colspan="<?php echo $wp_list_table->get_column_count(); ?>" class="colspanchange">
+<?php else : ?>
+<div id="com-reply" style="display:none;"><div id="replyrow" style="display:none;">
+<?php endif; ?>
+ <fieldset class="comment-reply">
+ <legend>
+ <span class="hidden" id="editlegend"><?php _e( 'Edit Comment' ); ?></span>
+ <span class="hidden" id="replyhead"><?php _e( 'Reply to Comment' ); ?></span>
+ <span class="hidden" id="addhead"><?php _e( 'Add new Comment' ); ?></span>
+ </legend>
+
+ <div id="replycontainer">
+ <label for="replycontent" class="screen-reader-text"><?php _e( 'Comment' ); ?></label>
+ <?php
+ $quicktags_settings = array( 'buttons' => 'strong,em,link,block,del,ins,img,ul,ol,li,code,close' );
+ wp_editor(
+ '',
+ 'replycontent',
+ array(
+ 'media_buttons' => false,
+ 'tinymce' => false,
+ 'quicktags' => $quicktags_settings,
+ )
+ );
+ ?>
+ </div>
+
+ <div id="edithead" style="display:none;">
+ <div class="inside">
+ <label for="author-name"><?php _e( 'Name' ); ?></label>
+ <input type="text" name="newcomment_author" size="50" value="" id="author-name" />
+ </div>
+
+ <div class="inside">
+ <label for="author-email"><?php _e( 'Email' ); ?></label>
+ <input type="text" name="newcomment_author_email" size="50" value="" id="author-email" />
+ </div>
+
+ <div class="inside">
+ <label for="author-url"><?php _e( 'URL' ); ?></label>
+ <input type="text" id="author-url" name="newcomment_author_url" class="code" size="103" value="" />
+ </div>
+ </div>
+
+ <div id="replysubmit" class="submit">
+ <p class="reply-submit-buttons">
+ <button type="button" class="save button button-primary">
+ <span id="addbtn" style="display: none;"><?php _e( 'Add Comment' ); ?></span>
+ <span id="savebtn" style="display: none;"><?php _e( 'Update Comment' ); ?></span>
+ <span id="replybtn" style="display: none;"><?php _e( 'Submit Reply' ); ?></span>
+ </button>
+ <button type="button" class="cancel button"><?php _e( 'Cancel' ); ?></button>
+ <span class="waiting spinner"></span>
+ </p>
+ <div class="notice notice-error notice-alt inline hidden">
+ <p class="error"></p>
+ </div>
+ </div>
+
+ <input type="hidden" name="action" id="action" value="" />
+ <input type="hidden" name="comment_ID" id="comment_ID" value="" />
+ <input type="hidden" name="comment_post_ID" id="comment_post_ID" value="" />
+ <input type="hidden" name="status" id="status" value="" />
+ <input type="hidden" name="position" id="position" value="<?php echo $position; ?>" />
+ <input type="hidden" name="checkbox" id="checkbox" value="<?php echo $checkbox ? 1 : 0; ?>" />
+ <input type="hidden" name="mode" id="mode" value="<?php echo esc_attr( $mode ); ?>" />
+ <?php
+ wp_nonce_field( 'replyto-comment', '_ajax_nonce-replyto-comment', false );
+ if ( current_user_can( 'unfiltered_html' ) ) {
+ wp_nonce_field( 'unfiltered-html-comment', '_wp_unfiltered_html_comment', false );
+ }
+ ?>
+ </fieldset>
+ <?php if ( $table_row ) : ?>
+</td></tr></tbody></table>
+ <?php else : ?>
+</div></div>
+ <?php endif; ?>
+</form>
+ <?php
+}
+
+/**
+ * Output 'undo move to trash' text for comments
+ *
+ * @since 2.9.0
+ */
+function wp_comment_trashnotice() {
+ ?>
+<div class="hidden" id="trash-undo-holder">
+ <div class="trash-undo-inside"><?php printf( __( 'Comment by %s moved to the trash.' ), '<strong></strong>' ); ?> <span class="undo untrash"><a href="#"><?php _e( 'Undo' ); ?></a></span></div>
+</div>
+<div class="hidden" id="spam-undo-holder">
+ <div class="spam-undo-inside"><?php printf( __( 'Comment by %s marked as spam.' ), '<strong></strong>' ); ?> <span class="undo unspam"><a href="#"><?php _e( 'Undo' ); ?></a></span></div>
+</div>
+ <?php
+}
+
+/**
+ * Outputs a post's public meta data in the Custom Fields meta box.
+ *
+ * @since 1.2.0
+ *
+ * @param array $meta
+ */
+function list_meta( $meta ) {
+ // Exit if no meta
+ if ( ! $meta ) {
+ echo '
+<table id="list-table" style="display: none;">
+ <thead>
+ <tr>
+ <th class="left">' . _x( 'Name', 'meta name' ) . '</th>
+ <th>' . __( 'Value' ) . '</th>
+ </tr>
+ </thead>
+ <tbody id="the-list" data-wp-lists="list:meta">
+ <tr><td></td></tr>
+ </tbody>
+</table>'; //TBODY needed for list-manipulation JS
+ return;
+ }
+ $count = 0;
+ ?>
+<table id="list-table">
+ <thead>
+ <tr>
+ <th class="left"><?php _ex( 'Name', 'meta name' ); ?></th>
+ <th><?php _e( 'Value' ); ?></th>
+ </tr>
+ </thead>
+ <tbody id='the-list' data-wp-lists='list:meta'>
+ <?php
+ foreach ( $meta as $entry ) {
+ echo _list_meta_row( $entry, $count );
+ }
+ ?>
+ </tbody>
+</table>
+ <?php
+}
+
+/**
+ * Outputs a single row of public meta data in the Custom Fields meta box.
+ *
+ * @since 2.5.0
+ *
+ * @staticvar string $update_nonce
+ *
+ * @param array $entry
+ * @param int $count
+ * @return string
+ */
+function _list_meta_row( $entry, &$count ) {
+ static $update_nonce = '';
+
+ if ( is_protected_meta( $entry['meta_key'], 'post' ) ) {
+ return '';
+ }
+
+ if ( ! $update_nonce ) {
+ $update_nonce = wp_create_nonce( 'add-meta' );
+ }
+
+ $r = '';
+ ++ $count;
+
+ if ( is_serialized( $entry['meta_value'] ) ) {
+ if ( is_serialized_string( $entry['meta_value'] ) ) {
+ // This is a serialized string, so we should display it.
+ $entry['meta_value'] = maybe_unserialize( $entry['meta_value'] );
+ } else {
+ // This is a serialized array/object so we should NOT display it.
+ --$count;
+ return '';
+ }
+ }
+
+ $entry['meta_key'] = esc_attr( $entry['meta_key'] );
+ $entry['meta_value'] = esc_textarea( $entry['meta_value'] ); // using a <textarea />
+ $entry['meta_id'] = (int) $entry['meta_id'];
+
+ $delete_nonce = wp_create_nonce( 'delete-meta_' . $entry['meta_id'] );
+
+ $r .= "\n\t<tr id='meta-{$entry['meta_id']}'>";
+ $r .= "\n\t\t<td class='left'><label class='screen-reader-text' for='meta-{$entry['meta_id']}-key'>" . __( 'Key' ) . "</label><input name='meta[{$entry['meta_id']}][key]' id='meta-{$entry['meta_id']}-key' type='text' size='20' value='{$entry['meta_key']}' />";
+
+ $r .= "\n\t\t<div class='submit'>";
+ $r .= get_submit_button( __( 'Delete' ), 'deletemeta small', "deletemeta[{$entry['meta_id']}]", false, array( 'data-wp-lists' => "delete:the-list:meta-{$entry['meta_id']}::_ajax_nonce=$delete_nonce" ) );
+ $r .= "\n\t\t";
+ $r .= get_submit_button( __( 'Update' ), 'updatemeta small', "meta-{$entry['meta_id']}-submit", false, array( 'data-wp-lists' => "add:the-list:meta-{$entry['meta_id']}::_ajax_nonce-add-meta=$update_nonce" ) );
+ $r .= '</div>';
+ $r .= wp_nonce_field( 'change-meta', '_ajax_nonce', false, false );
+ $r .= '</td>';
+
+ $r .= "\n\t\t<td><label class='screen-reader-text' for='meta-{$entry['meta_id']}-value'>" . __( 'Value' ) . "</label><textarea name='meta[{$entry['meta_id']}][value]' id='meta-{$entry['meta_id']}-value' rows='2' cols='30'>{$entry['meta_value']}</textarea></td>\n\t</tr>";
+ return $r;
+}
+
+/**
+ * Prints the form in the Custom Fields meta box.
+ *
+ * @since 1.2.0
+ *
+ * @global wpdb $wpdb WordPress database abstraction object.
+ *
+ * @param WP_Post $post Optional. The post being edited.
+ */
+function meta_form( $post = null ) {
+ global $wpdb;
+ $post = get_post( $post );
+
+ /**
+ * Filters values for the meta key dropdown in the Custom Fields meta box.
+ *
+ * Returning a non-null value will effectively short-circuit and avoid a
+ * potentially expensive query against postmeta.
+ *
+ * @since 4.4.0
+ *
+ * @param array|null $keys Pre-defined meta keys to be used in place of a postmeta query. Default null.
+ * @param WP_Post $post The current post object.
+ */
+ $keys = apply_filters( 'postmeta_form_keys', null, $post );
+
+ if ( null === $keys ) {
+ /**
+ * Filters the number of custom fields to retrieve for the drop-down
+ * in the Custom Fields meta box.
+ *
+ * @since 2.1.0
+ *
+ * @param int $limit Number of custom fields to retrieve. Default 30.
+ */
+ $limit = apply_filters( 'postmeta_form_limit', 30 );
+ $sql = "SELECT DISTINCT meta_key
+ FROM $wpdb->postmeta
+ WHERE meta_key NOT BETWEEN '_' AND '_z'
+ HAVING meta_key NOT LIKE %s
+ ORDER BY meta_key
+ LIMIT %d";
+ $keys = $wpdb->get_col( $wpdb->prepare( $sql, $wpdb->esc_like( '_' ) . '%', $limit ) );
+ }
+
+ if ( $keys ) {
+ natcasesort( $keys );
+ $meta_key_input_id = 'metakeyselect';
+ } else {
+ $meta_key_input_id = 'metakeyinput';
+ }
+ ?>
+<p><strong><?php _e( 'Add New Custom Field:' ); ?></strong></p>
+<table id="newmeta">
+<thead>
+<tr>
+<th class="left"><label for="<?php echo $meta_key_input_id; ?>"><?php _ex( 'Name', 'meta name' ); ?></label></th>
+<th><label for="metavalue"><?php _e( 'Value' ); ?></label></th>
+</tr>
+</thead>
+
+<tbody>
+<tr>
+<td id="newmetaleft" class="left">
+ <?php if ( $keys ) { ?>
+<select id="metakeyselect" name="metakeyselect">
+<option value="#NONE#"><?php _e( '&mdash; Select &mdash;' ); ?></option>
+ <?php
+
+ foreach ( $keys as $key ) {
+ if ( is_protected_meta( $key, 'post' ) || ! current_user_can( 'add_post_meta', $post->ID, $key ) ) {
+ continue;
+ }
+ echo "\n<option value='" . esc_attr( $key ) . "'>" . esc_html( $key ) . '</option>';
+ }
+ ?>
+</select>
+<input class="hide-if-js" type="text" id="metakeyinput" name="metakeyinput" value="" />
+<a href="#postcustomstuff" class="hide-if-no-js" onclick="jQuery('#metakeyinput, #metakeyselect, #enternew, #cancelnew').toggle();return false;">
+<span id="enternew"><?php _e( 'Enter new' ); ?></span>
+<span id="cancelnew" class="hidden"><?php _e( 'Cancel' ); ?></span></a>
+<?php } else { ?>
+<input type="text" id="metakeyinput" name="metakeyinput" value="" />
+<?php } ?>
+</td>
+<td><textarea id="metavalue" name="metavalue" rows="2" cols="25"></textarea></td>
+</tr>
+
+<tr><td colspan="2">
+<div class="submit">
+ <?php
+ submit_button(
+ __( 'Add Custom Field' ),
+ '',
+ 'addmeta',
+ false,
+ array(
+ 'id' => 'newmeta-submit',
+ 'data-wp-lists' => 'add:the-list:newmeta',
+ )
+ );
+ ?>
+</div>
+ <?php wp_nonce_field( 'add-meta', '_ajax_nonce-add-meta', false ); ?>
+</td></tr>
+</tbody>
+</table>
+ <?php
+
+}
+
+/**
+ * Print out HTML form date elements for editing post or comment publish date.
+ *
+ * @since 0.71
+ * @since 4.4.0 Converted to use get_comment() instead of the global `$comment`.
+ *
+ * @global WP_Locale $wp_locale
+ *
+ * @param int|bool $edit Accepts 1|true for editing the date, 0|false for adding the date.
+ * @param int|bool $for_post Accepts 1|true for applying the date to a post, 0|false for a comment.
+ * @param int $tab_index The tabindex attribute to add. Default 0.
+ * @param int|bool $multi Optional. Whether the additional fields and buttons should be added.
+ * Default 0|false.
+ */
+function touch_time( $edit = 1, $for_post = 1, $tab_index = 0, $multi = 0 ) {
+ global $wp_locale;
+ $post = get_post();
+
+ if ( $for_post ) {
+ $edit = ! ( in_array( $post->post_status, array( 'draft', 'pending' ) ) && ( ! $post->post_date_gmt || '0000-00-00 00:00:00' == $post->post_date_gmt ) );
+ }
+
+ $tab_index_attribute = '';
+ if ( (int) $tab_index > 0 ) {
+ $tab_index_attribute = " tabindex=\"$tab_index\"";
+ }
+
+ // todo: Remove this?
+ // echo '<label for="timestamp" style="display: block;"><input type="checkbox" class="checkbox" name="edit_date" value="1" id="timestamp"'.$tab_index_attribute.' /> '.__( 'Edit timestamp' ).'</label><br />';
+
+ $post_date = ( $for_post ) ? $post->post_date : get_comment()->comment_date;
+ $jj = ( $edit ) ? mysql2date( 'd', $post_date, false ) : current_time( 'd' );
+ $mm = ( $edit ) ? mysql2date( 'm', $post_date, false ) : current_time( 'm' );
+ $aa = ( $edit ) ? mysql2date( 'Y', $post_date, false ) : current_time( 'Y' );
+ $hh = ( $edit ) ? mysql2date( 'H', $post_date, false ) : current_time( 'H' );
+ $mn = ( $edit ) ? mysql2date( 'i', $post_date, false ) : current_time( 'i' );
+ $ss = ( $edit ) ? mysql2date( 's', $post_date, false ) : current_time( 's' );
+
+ $cur_jj = current_time( 'd' );
+ $cur_mm = current_time( 'm' );
+ $cur_aa = current_time( 'Y' );
+ $cur_hh = current_time( 'H' );
+ $cur_mn = current_time( 'i' );
+
+ $month = '<label><span class="screen-reader-text">' . __( 'Month' ) . '</span><select ' . ( $multi ? '' : 'id="mm" ' ) . 'name="mm"' . $tab_index_attribute . ">\n";
+ for ( $i = 1; $i < 13; $i = $i + 1 ) {
+ $monthnum = zeroise( $i, 2 );
+ $monthtext = $wp_locale->get_month_abbrev( $wp_locale->get_month( $i ) );
+ $month .= "\t\t\t" . '<option value="' . $monthnum . '" data-text="' . $monthtext . '" ' . selected( $monthnum, $mm, false ) . '>';
+ /* translators: 1: month number (01, 02, etc.), 2: month abbreviation */
+ $month .= sprintf( __( '%1$s-%2$s' ), $monthnum, $monthtext ) . "</option>\n";
+ }
+ $month .= '</select></label>';
+
+ $day = '<label><span class="screen-reader-text">' . __( 'Day' ) . '</span><input type="text" ' . ( $multi ? '' : 'id="jj" ' ) . 'name="jj" value="' . $jj . '" size="2" maxlength="2"' . $tab_index_attribute . ' autocomplete="off" /></label>';
+ $year = '<label><span class="screen-reader-text">' . __( 'Year' ) . '</span><input type="text" ' . ( $multi ? '' : 'id="aa" ' ) . 'name="aa" value="' . $aa . '" size="4" maxlength="4"' . $tab_index_attribute . ' autocomplete="off" /></label>';
+ $hour = '<label><span class="screen-reader-text">' . __( 'Hour' ) . '</span><input type="text" ' . ( $multi ? '' : 'id="hh" ' ) . 'name="hh" value="' . $hh . '" size="2" maxlength="2"' . $tab_index_attribute . ' autocomplete="off" /></label>';
+ $minute = '<label><span class="screen-reader-text">' . __( 'Minute' ) . '</span><input type="text" ' . ( $multi ? '' : 'id="mn" ' ) . 'name="mn" value="' . $mn . '" size="2" maxlength="2"' . $tab_index_attribute . ' autocomplete="off" /></label>';
+
+ echo '<div class="timestamp-wrap">';
+ /* translators: 1: month, 2: day, 3: year, 4: hour, 5: minute */
+ printf( __( '%1$s %2$s, %3$s @ %4$s:%5$s' ), $month, $day, $year, $hour, $minute );
+
+ echo '</div><input type="hidden" id="ss" name="ss" value="' . $ss . '" />';
+
+ if ( $multi ) {
+ return;
+ }
+
+ echo "\n\n";
+ $map = array(
+ 'mm' => array( $mm, $cur_mm ),
+ 'jj' => array( $jj, $cur_jj ),
+ 'aa' => array( $aa, $cur_aa ),
+ 'hh' => array( $hh, $cur_hh ),
+ 'mn' => array( $mn, $cur_mn ),
+ );
+ foreach ( $map as $timeunit => $value ) {
+ list( $unit, $curr ) = $value;
+
+ echo '<input type="hidden" id="hidden_' . $timeunit . '" name="hidden_' . $timeunit . '" value="' . $unit . '" />' . "\n";
+ $cur_timeunit = 'cur_' . $timeunit;
+ echo '<input type="hidden" id="' . $cur_timeunit . '" name="' . $cur_timeunit . '" value="' . $curr . '" />' . "\n";
+ }
+ ?>
+
+<p>
+<a href="#edit_timestamp" class="save-timestamp hide-if-no-js button"><?php _e( 'OK' ); ?></a>
+<a href="#edit_timestamp" class="cancel-timestamp hide-if-no-js button-cancel"><?php _e( 'Cancel' ); ?></a>
+</p>
+ <?php
+}
+
+/**
+ * Print out option HTML elements for the page templates drop-down.
+ *
+ * @since 1.5.0
+ * @since 4.7.0 Added the `$post_type` parameter.
+ *
+ * @param string $default Optional. The template file name. Default empty.
+ * @param string $post_type Optional. Post type to get templates for. Default 'post'.
+ */
+function page_template_dropdown( $default = '', $post_type = 'page' ) {
+ $templates = get_page_templates( null, $post_type );
+ ksort( $templates );
+ foreach ( array_keys( $templates ) as $template ) {
+ $selected = selected( $default, $templates[ $template ], false );
+ echo "\n\t<option value='" . esc_attr( $templates[ $template ] ) . "' $selected>" . esc_html( $template ) . '</option>';
+ }
+}
+
+/**
+ * Print out option HTML elements for the page parents drop-down.
+ *
+ * @since 1.5.0
+ * @since 4.4.0 `$post` argument was added.
+ *
+ * @global wpdb $wpdb WordPress database abstraction object.
+ *
+ * @param int $default Optional. The default page ID to be pre-selected. Default 0.
+ * @param int $parent Optional. The parent page ID. Default 0.
+ * @param int $level Optional. Page depth level. Default 0.
+ * @param int|WP_Post $post Post ID or WP_Post object.
+ *
+ * @return null|false Boolean False if page has no children, otherwise print out html elements.
+ */
+function parent_dropdown( $default = 0, $parent = 0, $level = 0, $post = null ) {
+ global $wpdb;
+ $post = get_post( $post );
+ $items = $wpdb->get_results( $wpdb->prepare( "SELECT ID, post_parent, post_title FROM $wpdb->posts WHERE post_parent = %d AND post_type = 'page' ORDER BY menu_order", $parent ) );
+
+ if ( $items ) {
+ foreach ( $items as $item ) {
+ // A page cannot be its own parent.
+ if ( $post && $post->ID && $item->ID == $post->ID ) {
+ continue;
+ }
+
+ $pad = str_repeat( '&nbsp;', $level * 3 );
+ $selected = selected( $default, $item->ID, false );
+
+ echo "\n\t<option class='level-$level' value='$item->ID' $selected>$pad " . esc_html( $item->post_title ) . '</option>';
+ parent_dropdown( $default, $item->ID, $level + 1 );
+ }
+ } else {
+ return false;
+ }
+}
+
+/**
+ * Print out option html elements for role selectors.
+ *
+ * @since 2.1.0
+ *
+ * @param string $selected Slug for the role that should be already selected.
+ */
+function wp_dropdown_roles( $selected = '' ) {
+ $r = '';
+
+ $editable_roles = array_reverse( get_editable_roles() );
+
+ foreach ( $editable_roles as $role => $details ) {
+ $name = translate_user_role( $details['name'] );
+ // preselect specified role
+ if ( $selected == $role ) {
+ $r .= "\n\t<option selected='selected' value='" . esc_attr( $role ) . "'>$name</option>";
+ } else {
+ $r .= "\n\t<option value='" . esc_attr( $role ) . "'>$name</option>";
+ }
+ }
+
+ echo $r;
+}
+
+/**
+ * Outputs the form used by the importers to accept the data to be imported
+ *
+ * @since 2.0.0
+ *
+ * @param string $action The action attribute for the form.
+ */
+function wp_import_upload_form( $action ) {
+
+ /**
+ * Filters the maximum allowed upload size for import files.
+ *
+ * @since 2.3.0
+ *
+ * @see wp_max_upload_size()
+ *
+ * @param int $max_upload_size Allowed upload size. Default 1 MB.
+ */
+ $bytes = apply_filters( 'import_upload_size_limit', wp_max_upload_size() );
+ $size = size_format( $bytes );
+ $upload_dir = wp_upload_dir();
+ if ( ! empty( $upload_dir['error'] ) ) :
+ ?>
+ <div class="error"><p><?php _e( 'Before you can upload your import file, you will need to fix the following error:' ); ?></p>
+ <p><strong><?php echo $upload_dir['error']; ?></strong></p></div>
+ <?php
+ else :
+ ?>
+<form enctype="multipart/form-data" id="import-upload-form" method="post" class="wp-upload-form" action="<?php echo esc_url( wp_nonce_url( $action, 'import-upload' ) ); ?>">
+<p>
+<label for="upload"><?php _e( 'Choose a file from your computer:' ); ?></label> (<?php printf( __( 'Maximum size: %s' ), $size ); ?>)
+<input type="file" id="upload" name="import" size="25" />
+<input type="hidden" name="action" value="save" />
+<input type="hidden" name="max_file_size" value="<?php echo $bytes; ?>" />
+</p>
+ <?php submit_button( __( 'Upload file and import' ), 'primary' ); ?>
+</form>
+ <?php
+ endif;
+}
+
+/**
+ * Adds a meta box to one or more screens.
+ *
+ * @since 2.5.0
+ * @since 4.4.0 The `$screen` parameter now accepts an array of screen IDs.
+ *
+ * @global array $wp_meta_boxes
+ *
+ * @param string $id Meta box ID (used in the 'id' attribute for the meta box).
+ * @param string $title Title of the meta box.
+ * @param callable $callback Function that fills the box with the desired content.
+ * The function should echo its output.
+ * @param string|array|WP_Screen $screen Optional. The screen or screens on which to show the box
+ * (such as a post type, 'link', or 'comment'). Accepts a single
+ * screen ID, WP_Screen object, or array of screen IDs. Default
+ * is the current screen. If you have used add_menu_page() or
+ * add_submenu_page() to create a new screen (and hence screen_id),
+ * make sure your menu slug conforms to the limits of sanitize_key()
+ * otherwise the 'screen' menu may not correctly render on your page.
+ * @param string $context Optional. The context within the screen where the boxes
+ * should display. Available contexts vary from screen to
+ * screen. Post edit screen contexts include 'normal', 'side',
+ * and 'advanced'. Comments screen contexts include 'normal'
+ * and 'side'. Menus meta boxes (accordion sections) all use
+ * the 'side' context. Global default is 'advanced'.
+ * @param string $priority Optional. The priority within the context where the boxes
+ * should show ('high', 'low'). Default 'default'.
+ * @param array $callback_args Optional. Data that should be set as the $args property
+ * of the box array (which is the second parameter passed
+ * to your callback). Default null.
+ */
+function add_meta_box( $id, $title, $callback, $screen = null, $context = 'advanced', $priority = 'default', $callback_args = null ) {
+ global $wp_meta_boxes;
+
+ if ( empty( $screen ) ) {
+ $screen = get_current_screen();
+ } elseif ( is_string( $screen ) ) {
+ $screen = convert_to_screen( $screen );
+ } elseif ( is_array( $screen ) ) {
+ foreach ( $screen as $single_screen ) {
+ add_meta_box( $id, $title, $callback, $single_screen, $context, $priority, $callback_args );
+ }
+ }
+
+ if ( ! isset( $screen->id ) ) {
+ return;
+ }
+
+ $page = $screen->id;
+
+ if ( ! isset( $wp_meta_boxes ) ) {
+ $wp_meta_boxes = array();
+ }
+ if ( ! isset( $wp_meta_boxes[ $page ] ) ) {
+ $wp_meta_boxes[ $page ] = array();
+ }
+ if ( ! isset( $wp_meta_boxes[ $page ][ $context ] ) ) {
+ $wp_meta_boxes[ $page ][ $context ] = array();
+ }
+
+ foreach ( array_keys( $wp_meta_boxes[ $page ] ) as $a_context ) {
+ foreach ( array( 'high', 'core', 'default', 'low' ) as $a_priority ) {
+ if ( ! isset( $wp_meta_boxes[ $page ][ $a_context ][ $a_priority ][ $id ] ) ) {
+ continue;
+ }
+
+ // If a core box was previously added or removed by a plugin, don't add.
+ if ( 'core' == $priority ) {
+ // If core box previously deleted, don't add
+ if ( false === $wp_meta_boxes[ $page ][ $a_context ][ $a_priority ][ $id ] ) {
+ return;
+ }
+
+ /*
+ * If box was added with default priority, give it core priority to
+ * maintain sort order.
+ */
+ if ( 'default' == $a_priority ) {
+ $wp_meta_boxes[ $page ][ $a_context ]['core'][ $id ] = $wp_meta_boxes[ $page ][ $a_context ]['default'][ $id ];
+ unset( $wp_meta_boxes[ $page ][ $a_context ]['default'][ $id ] );
+ }
+ return;
+ }
+ // If no priority given and id already present, use existing priority.
+ if ( empty( $priority ) ) {
+ $priority = $a_priority;
+ /*
+ * Else, if we're adding to the sorted priority, we don't know the title
+ * or callback. Grab them from the previously added context/priority.
+ */
+ } elseif ( 'sorted' == $priority ) {
+ $title = $wp_meta_boxes[ $page ][ $a_context ][ $a_priority ][ $id ]['title'];
+ $callback = $wp_meta_boxes[ $page ][ $a_context ][ $a_priority ][ $id ]['callback'];
+ $callback_args = $wp_meta_boxes[ $page ][ $a_context ][ $a_priority ][ $id ]['args'];
+ }
+ // An id can be in only one priority and one context.
+ if ( $priority != $a_priority || $context != $a_context ) {
+ unset( $wp_meta_boxes[ $page ][ $a_context ][ $a_priority ][ $id ] );
+ }
+ }
+ }
+
+ if ( empty( $priority ) ) {
+ $priority = 'low';
+ }
+
+ if ( ! isset( $wp_meta_boxes[ $page ][ $context ][ $priority ] ) ) {
+ $wp_meta_boxes[ $page ][ $context ][ $priority ] = array();
+ }
+
+ $wp_meta_boxes[ $page ][ $context ][ $priority ][ $id ] = array(
+ 'id' => $id,
+ 'title' => $title,
+ 'callback' => $callback,
+ 'args' => $callback_args,
+ );
+}
+
+
+/**
+ * Function that renders a "fake" meta box with an information message,
+ * shown on the block editor, when an incompatible meta box is found.
+ *
+ * @since 5.0.0
+ *
+ * @param mixed $object The data object being rendered on this screen.
+ * @param array $box {
+ * Custom formats meta box arguments.
+ *
+ * @type string $id Meta box 'id' attribute.
+ * @type string $title Meta box title.
+ * @type callable $old_callback The original callback for this meta box.
+ * @type array $args Extra meta box arguments.
+ * }
+ */
+function do_block_editor_incompatible_meta_box( $object, $box ) {
+ $plugin = _get_plugin_from_callback( $box['old_callback'] );
+ $plugins = get_plugins();
+ echo '<p>';
+ if ( $plugin ) {
+ /* translators: %s: the name of the plugin that generated this meta box. */
+ printf( __( "This meta box, from the %s plugin, isn't compatible with the block editor." ), "<strong>{$plugin['Name']}</strong>" );
+ } else {
+ _e( "This meta box isn't compatible with the block editor." );
+ }
+ echo '</p>';
+
+ if ( empty( $plugins['classic-editor/classic-editor.php'] ) ) {
+ if ( current_user_can( 'install_plugins' ) ) {
+ echo '<p>';
+ /* translators: %s: A link to install the Classic Editor plugin. */
+ printf( __( 'Please install the <a href="%s">Classic Editor plugin</a> to use this meta box.' ), esc_url( self_admin_url( 'plugin-install.php?tab=featured' ) ) );
+ echo '</p>';
+ }
+ } elseif ( is_plugin_inactive( 'classic-editor/classic-editor.php' ) ) {
+ if ( current_user_can( 'activate_plugins' ) ) {
+ $activate_url = wp_nonce_url( self_admin_url( 'plugins.php?action=activate&plugin=classic-editor/classic-editor.php' ), 'activate-plugin_classic-editor/classic-editor.php' );
+ echo '<p>';
+ /* translators: %s: A link to activate the Classic Editor plugin. */
+ printf( __( 'Please activate the <a href="%s">Classic Editor plugin</a> to use this meta box.' ), esc_url( $activate_url ) );
+ echo '</p>';
+ }
+ } elseif ( $object instanceof WP_Post ) {
+ $edit_url = add_query_arg(
+ array(
+ 'classic-editor' => '',
+ 'classic-editor__forget' => '',
+ ),
+ get_edit_post_link( $object )
+ );
+ echo '<p>';
+ /* translators: %s: A link to use the Classic Editor plugin. */
+ printf( __( 'Please open the <a href="%s">classic editor</a> to use this meta box.' ), esc_url( $edit_url ) );
+ echo '</p>';
+ }
+}
+
+/**
+ * Internal helper function to find the plugin from a meta box callback.
+ *
+ * @since 5.0.0
+ *
+ * @access private
+ *
+ * @param callable $callback The callback function to check.
+ * @return array|null The plugin that the callback belongs to, or null if it doesn't belong to a plugin.
+ */
+function _get_plugin_from_callback( $callback ) {
+ try {
+ if ( is_array( $callback ) ) {
+ $reflection = new ReflectionMethod( $callback[0], $callback[1] );
+ } elseif ( is_string( $callback ) && false !== strpos( $callback, '::' ) ) {
+ $reflection = new ReflectionMethod( $callback );
+ } else {
+ $reflection = new ReflectionFunction( $callback );
+ }
+ } catch ( ReflectionException $exception ) {
+ // We could not properly reflect on the callable, so we abort here.
+ return null;
+ }
+
+ // Don't show an error if it's an internal PHP function.
+ if ( ! $reflection->isInternal() ) {
+
+ // Only show errors if the meta box was registered by a plugin.
+ $filename = wp_normalize_path( $reflection->getFileName() );
+ $plugin_dir = wp_normalize_path( WP_PLUGIN_DIR );
+ if ( strpos( $filename, $plugin_dir ) === 0 ) {
+ $filename = str_replace( $plugin_dir, '', $filename );
+ $filename = preg_replace( '|^/([^/]*/).*$|', '\\1', $filename );
+
+ $plugins = get_plugins();
+ foreach ( $plugins as $name => $plugin ) {
+ if ( strpos( $name, $filename ) === 0 ) {
+ return $plugin;
+ }
+ }
+ }
+ }
+
+ return null;
+}
+
+/**
+ * Meta-Box template function.
+ *
+ * @since 2.5.0
+ *
+ * @global array $wp_meta_boxes
+ *
+ * @staticvar bool $already_sorted
+ *
+ * @param string|WP_Screen $screen Screen identifier. If you have used add_menu_page() or
+ * add_submenu_page() to create a new screen (and hence screen_id)
+ * make sure your menu slug conforms to the limits of sanitize_key()
+ * otherwise the 'screen' menu may not correctly render on your page.
+ * @param string $context The screen context for which to display meta boxes.
+ * @param mixed $object Gets passed to the first parameter of the meta box callback function.
+ * Often this is the object that's the focus of the current screen, for
+ * example a `WP_Post` or `WP_Comment` object.
+ * @return int number of meta_boxes
+ */
+function do_meta_boxes( $screen, $context, $object ) {
+ global $wp_meta_boxes;
+ static $already_sorted = false;
+
+ if ( empty( $screen ) ) {
+ $screen = get_current_screen();
+ } elseif ( is_string( $screen ) ) {
+ $screen = convert_to_screen( $screen );
+ }
+
+ $page = $screen->id;
+
+ $hidden = get_hidden_meta_boxes( $screen );
+
+ printf( '<div id="%s-sortables" class="meta-box-sortables">', esc_attr( $context ) );
+
+ // Grab the ones the user has manually sorted. Pull them out of their previous context/priority and into the one the user chose
+ if ( ! $already_sorted && $sorted = get_user_option( "meta-box-order_$page" ) ) {
+ foreach ( $sorted as $box_context => $ids ) {
+ foreach ( explode( ',', $ids ) as $id ) {
+ if ( $id && 'dashboard_browser_nag' !== $id ) {
+ add_meta_box( $id, null, null, $screen, $box_context, 'sorted' );
+ }
+ }
+ }
+ }
+
+ $already_sorted = true;
+
+ $i = 0;
+
+ if ( isset( $wp_meta_boxes[ $page ][ $context ] ) ) {
+ foreach ( array( 'high', 'sorted', 'core', 'default', 'low' ) as $priority ) {
+ if ( isset( $wp_meta_boxes[ $page ][ $context ][ $priority ] ) ) {
+ foreach ( (array) $wp_meta_boxes[ $page ][ $context ][ $priority ] as $box ) {
+ if ( false == $box || ! $box['title'] ) {
+ continue;
+ }
+
+ $block_compatible = true;
+ if ( is_array( $box['args'] ) ) {
+ // If a meta box is just here for back compat, don't show it in the block editor.
+ if ( $screen->is_block_editor() && isset( $box['args']['__back_compat_meta_box'] ) && $box['args']['__back_compat_meta_box'] ) {
+ continue;
+ }
+
+ if ( isset( $box['args']['__block_editor_compatible_meta_box'] ) ) {
+ $block_compatible = (bool) $box['args']['__block_editor_compatible_meta_box'];
+ unset( $box['args']['__block_editor_compatible_meta_box'] );
+ }
+
+ // If the meta box is declared as incompatible with the block editor, override the callback function.
+ if ( ! $block_compatible && $screen->is_block_editor() ) {
+ $box['old_callback'] = $box['callback'];
+ $box['callback'] = 'do_block_editor_incompatible_meta_box';
+ }
+
+ if ( isset( $box['args']['__back_compat_meta_box'] ) ) {
+ $block_compatible = $block_compatible || (bool) $box['args']['__back_compat_meta_box'];
+ unset( $box['args']['__back_compat_meta_box'] );
+ }
+ }
+
+ $i++;
+ // get_hidden_meta_boxes() doesn't apply in the block editor.
+ $hidden_class = ( ! $screen->is_block_editor() && in_array( $box['id'], $hidden ) ) ? ' hide-if-js' : '';
+ echo '<div id="' . $box['id'] . '" class="postbox ' . postbox_classes( $box['id'], $page ) . $hidden_class . '" ' . '>' . "\n";
+ if ( 'dashboard_browser_nag' != $box['id'] ) {
+ $widget_title = $box['title'];
+
+ if ( is_array( $box['args'] ) && isset( $box['args']['__widget_basename'] ) ) {
+ $widget_title = $box['args']['__widget_basename'];
+ // Do not pass this parameter to the user callback function.
+ unset( $box['args']['__widget_basename'] );
+ }
+
+ echo '<button type="button" class="handlediv" aria-expanded="true">';
+ echo '<span class="screen-reader-text">' . sprintf( __( 'Toggle panel: %s' ), $widget_title ) . '</span>';
+ echo '<span class="toggle-indicator" aria-hidden="true"></span>';
+ echo '</button>';
+ }
+ echo '<h2 class="hndle">';
+ if ( 'dashboard_php_nag' === $box['id'] ) {
+ echo '<span aria-hidden="true" class="dashicons dashicons-warning"></span>';
+ echo '<span class="screen-reader-text">' . __( 'Warning:' ) . ' </span>';
+ }
+ echo "<span>{$box['title']}</span>";
+ echo "</h2>\n";
+ echo '<div class="inside">' . "\n";
+
+ if ( WP_DEBUG && ! $block_compatible && 'edit' === $screen->parent_base && ! $screen->is_block_editor() && ! isset( $_GET['meta-box-loader'] ) ) {
+ $plugin = _get_plugin_from_callback( $box['callback'] );
+ if ( $plugin ) {
+ ?>
+ <div class="error inline">
+ <p>
+ <?php
+ /* translators: %s: the name of the plugin that generated this meta box. */
+ printf( __( "This meta box, from the %s plugin, isn't compatible with the block editor." ), "<strong>{$plugin['Name']}</strong>" );
+ ?>
+ </p>
+ </div>
+ <?php
+ }
+ }
+
+ call_user_func( $box['callback'], $object, $box );
+ echo "</div>\n";
+ echo "</div>\n";
+ }
+ }
+ }
+ }
+
+ echo '</div>';
+
+ return $i;
+
+}
+
+/**
+ * Removes a meta box from one or more screens.
+ *
+ * @since 2.6.0
+ * @since 4.4.0 The `$screen` parameter now accepts an array of screen IDs.
+ *
+ * @global array $wp_meta_boxes
+ *
+ * @param string $id Meta box ID (used in the 'id' attribute for the meta box).
+ * @param string|array|WP_Screen $screen The screen or screens on which the meta box is shown (such as a
+ * post type, 'link', or 'comment'). Accepts a single screen ID,
+ * WP_Screen object, or array of screen IDs.
+ * @param string $context The context within the screen where the box is set to display.
+ * Contexts vary from screen to screen. Post edit screen contexts
+ * include 'normal', 'side', and 'advanced'. Comments screen contexts
+ * include 'normal' and 'side'. Menus meta boxes (accordion sections)
+ * all use the 'side' context.
+ */
+function remove_meta_box( $id, $screen, $context ) {
+ global $wp_meta_boxes;
+
+ if ( empty( $screen ) ) {
+ $screen = get_current_screen();
+ } elseif ( is_string( $screen ) ) {
+ $screen = convert_to_screen( $screen );
+ } elseif ( is_array( $screen ) ) {
+ foreach ( $screen as $single_screen ) {
+ remove_meta_box( $id, $single_screen, $context );
+ }
+ }
+
+ if ( ! isset( $screen->id ) ) {
+ return;
+ }
+
+ $page = $screen->id;
+
+ if ( ! isset( $wp_meta_boxes ) ) {
+ $wp_meta_boxes = array();
+ }
+ if ( ! isset( $wp_meta_boxes[ $page ] ) ) {
+ $wp_meta_boxes[ $page ] = array();
+ }
+ if ( ! isset( $wp_meta_boxes[ $page ][ $context ] ) ) {
+ $wp_meta_boxes[ $page ][ $context ] = array();
+ }
+
+ foreach ( array( 'high', 'core', 'default', 'low' ) as $priority ) {
+ $wp_meta_boxes[ $page ][ $context ][ $priority ][ $id ] = false;
+ }
+}
+
+/**
+ * Meta Box Accordion Template Function.
+ *
+ * Largely made up of abstracted code from do_meta_boxes(), this
+ * function serves to build meta boxes as list items for display as
+ * a collapsible accordion.
+ *
+ * @since 3.6.0
+ *
+ * @uses global $wp_meta_boxes Used to retrieve registered meta boxes.
+ *
+ * @param string|object $screen The screen identifier.
+ * @param string $context The meta box context.
+ * @param mixed $object gets passed to the section callback function as first parameter.
+ * @return int number of meta boxes as accordion sections.
+ */
+function do_accordion_sections( $screen, $context, $object ) {
+ global $wp_meta_boxes;
+
+ wp_enqueue_script( 'accordion' );
+
+ if ( empty( $screen ) ) {
+ $screen = get_current_screen();
+ } elseif ( is_string( $screen ) ) {
+ $screen = convert_to_screen( $screen );
+ }
+
+ $page = $screen->id;
+
+ $hidden = get_hidden_meta_boxes( $screen );
+ ?>
+ <div id="side-sortables" class="accordion-container">
+ <ul class="outer-border">
+ <?php
+ $i = 0;
+ $first_open = false;
+
+ if ( isset( $wp_meta_boxes[ $page ][ $context ] ) ) {
+ foreach ( array( 'high', 'core', 'default', 'low' ) as $priority ) {
+ if ( isset( $wp_meta_boxes[ $page ][ $context ][ $priority ] ) ) {
+ foreach ( $wp_meta_boxes[ $page ][ $context ][ $priority ] as $box ) {
+ if ( false == $box || ! $box['title'] ) {
+ continue;
+ }
+ $i++;
+ $hidden_class = in_array( $box['id'], $hidden ) ? 'hide-if-js' : '';
+
+ $open_class = '';
+ if ( ! $first_open && empty( $hidden_class ) ) {
+ $first_open = true;
+ $open_class = 'open';
+ }
+ ?>
+ <li class="control-section accordion-section <?php echo $hidden_class; ?> <?php echo $open_class; ?> <?php echo esc_attr( $box['id'] ); ?>" id="<?php echo esc_attr( $box['id'] ); ?>">
+ <h3 class="accordion-section-title hndle" tabindex="0">
+ <?php echo esc_html( $box['title'] ); ?>
+ <span class="screen-reader-text"><?php _e( 'Press return or enter to open this section' ); ?></span>
+ </h3>
+ <div class="accordion-section-content <?php postbox_classes( $box['id'], $page ); ?>">
+ <div class="inside">
+ <?php call_user_func( $box['callback'], $object, $box ); ?>
+ </div><!-- .inside -->
+ </div><!-- .accordion-section-content -->
+ </li><!-- .accordion-section -->
+ <?php
+ }
+ }
+ }
+ }
+ ?>
+ </ul><!-- .outer-border -->
+ </div><!-- .accordion-container -->
+ <?php
+ return $i;
+}
+
+/**
+ * Add a new section to a settings page.
+ *
+ * Part of the Settings API. Use this to define new settings sections for an admin page.
+ * Show settings sections in your admin page callback function with do_settings_sections().
+ * Add settings fields to your section with add_settings_field().
+ *
+ * The $callback argument should be the name of a function that echoes out any
+ * content you want to show at the top of the settings section before the actual
+ * fields. It can output nothing if you want.
+ *
+ * @since 2.7.0
+ *
+ * @global $wp_settings_sections Storage array of all settings sections added to admin pages.
+ *
+ * @param string $id Slug-name to identify the section. Used in the 'id' attribute of tags.
+ * @param string $title Formatted title of the section. Shown as the heading for the section.
+ * @param callable $callback Function that echos out any content at the top of the section (between heading and fields).
+ * @param string $page The slug-name of the settings page on which to show the section. Built-in pages include
+ * 'general', 'reading', 'writing', 'discussion', 'media', etc. Create your own using
+ * add_options_page();
+ */
+function add_settings_section( $id, $title, $callback, $page ) {
+ global $wp_settings_sections;
+
+ if ( 'misc' == $page ) {
+ _deprecated_argument(
+ __FUNCTION__,
+ '3.0.0',
+ /* translators: %s: misc */
+ sprintf(
+ __( 'The "%s" options group has been removed. Use another settings group.' ),
+ 'misc'
+ )
+ );
+ $page = 'general';
+ }
+
+ if ( 'privacy' == $page ) {
+ _deprecated_argument(
+ __FUNCTION__,
+ '3.5.0',
+ /* translators: %s: privacy */
+ sprintf(
+ __( 'The "%s" options group has been removed. Use another settings group.' ),
+ 'privacy'
+ )
+ );
+ $page = 'reading';
+ }
+
+ $wp_settings_sections[ $page ][ $id ] = array(
+ 'id' => $id,
+ 'title' => $title,
+ 'callback' => $callback,
+ );
+}
+
+/**
+ * Add a new field to a section of a settings page.
+ *
+ * Part of the Settings API. Use this to define a settings field that will show
+ * as part of a settings section inside a settings page. The fields are shown using
+ * do_settings_fields() in do_settings-sections()
+ *
+ * The $callback argument should be the name of a function that echoes out the
+ * html input tags for this setting field. Use get_option() to retrieve existing
+ * values to show.
+ *
+ * @since 2.7.0
+ * @since 4.2.0 The `$class` argument was added.
+ *
+ * @global $wp_settings_fields Storage array of settings fields and info about their pages/sections.
+ *
+ * @param string $id Slug-name to identify the field. Used in the 'id' attribute of tags.
+ * @param string $title Formatted title of the field. Shown as the label for the field
+ * during output.
+ * @param callable $callback Function that fills the field with the desired form inputs. The
+ * function should echo its output.
+ * @param string $page The slug-name of the settings page on which to show the section
+ * (general, reading, writing, ...).
+ * @param string $section Optional. The slug-name of the section of the settings page
+ * in which to show the box. Default 'default'.
+ * @param array $args {
+ * Optional. Extra arguments used when outputting the field.
+ *
+ * @type string $label_for When supplied, the setting title will be wrapped
+ * in a `<label>` element, its `for` attribute populated
+ * with this value.
+ * @type string $class CSS Class to be added to the `<tr>` element when the
+ * field is output.
+ * }
+ */
+function add_settings_field( $id, $title, $callback, $page, $section = 'default', $args = array() ) {
+ global $wp_settings_fields;
+
+ if ( 'misc' == $page ) {
+ _deprecated_argument(
+ __FUNCTION__,
+ '3.0.0',
+ /* translators: %s: misc */
+ sprintf(
+ __( 'The "%s" options group has been removed. Use another settings group.' ),
+ 'misc'
+ )
+ );
+ $page = 'general';
+ }
+
+ if ( 'privacy' == $page ) {
+ _deprecated_argument(
+ __FUNCTION__,
+ '3.5.0',
+ /* translators: %s: privacy */
+ sprintf(
+ __( 'The "%s" options group has been removed. Use another settings group.' ),
+ 'privacy'
+ )
+ );
+ $page = 'reading';
+ }
+
+ $wp_settings_fields[ $page ][ $section ][ $id ] = array(
+ 'id' => $id,
+ 'title' => $title,
+ 'callback' => $callback,
+ 'args' => $args,
+ );
+}
+
+/**
+ * Prints out all settings sections added to a particular settings page
+ *
+ * Part of the Settings API. Use this in a settings page callback function
+ * to output all the sections and fields that were added to that $page with
+ * add_settings_section() and add_settings_field()
+ *
+ * @global $wp_settings_sections Storage array of all settings sections added to admin pages.
+ * @global $wp_settings_fields Storage array of settings fields and info about their pages/sections.
+ * @since 2.7.0
+ *
+ * @param string $page The slug name of the page whose settings sections you want to output.
+ */
+function do_settings_sections( $page ) {
+ global $wp_settings_sections, $wp_settings_fields;
+
+ if ( ! isset( $wp_settings_sections[ $page ] ) ) {
+ return;
+ }
+
+ foreach ( (array) $wp_settings_sections[ $page ] as $section ) {
+ if ( $section['title'] ) {
+ echo "<h2>{$section['title']}</h2>\n";
+ }
+
+ if ( $section['callback'] ) {
+ call_user_func( $section['callback'], $section );
+ }
+
+ if ( ! isset( $wp_settings_fields ) || ! isset( $wp_settings_fields[ $page ] ) || ! isset( $wp_settings_fields[ $page ][ $section['id'] ] ) ) {
+ continue;
+ }
+ echo '<table class="form-table" role="presentation">';
+ do_settings_fields( $page, $section['id'] );
+ echo '</table>';
+ }
+}
+
+/**
+ * Print out the settings fields for a particular settings section.
+ *
+ * Part of the Settings API. Use this in a settings page to output
+ * a specific section. Should normally be called by do_settings_sections()
+ * rather than directly.
+ *
+ * @global $wp_settings_fields Storage array of settings fields and their pages/sections.
+ *
+ * @since 2.7.0
+ *
+ * @param string $page Slug title of the admin page whose settings fields you want to show.
+ * @param string $section Slug title of the settings section whose fields you want to show.
+ */
+function do_settings_fields( $page, $section ) {
+ global $wp_settings_fields;
+
+ if ( ! isset( $wp_settings_fields[ $page ][ $section ] ) ) {
+ return;
+ }
+
+ foreach ( (array) $wp_settings_fields[ $page ][ $section ] as $field ) {
+ $class = '';
+
+ if ( ! empty( $field['args']['class'] ) ) {
+ $class = ' class="' . esc_attr( $field['args']['class'] ) . '"';
+ }
+
+ echo "<tr{$class}>";
+
+ if ( ! empty( $field['args']['label_for'] ) ) {
+ echo '<th scope="row"><label for="' . esc_attr( $field['args']['label_for'] ) . '">' . $field['title'] . '</label></th>';
+ } else {
+ echo '<th scope="row">' . $field['title'] . '</th>';
+ }
+
+ echo '<td>';
+ call_user_func( $field['callback'], $field['args'] );
+ echo '</td>';
+ echo '</tr>';
+ }
+}
+
+/**
+ * Register a settings error to be displayed to the user.
+ *
+ * Part of the Settings API. Use this to show messages to users about settings validation
+ * problems, missing settings or anything else.
+ *
+ * Settings errors should be added inside the $sanitize_callback function defined in
+ * register_setting() for a given setting to give feedback about the submission.
+ *
+ * By default messages will show immediately after the submission that generated the error.
+ * Additional calls to settings_errors() can be used to show errors even when the settings
+ * page is first accessed.
+ *
+ * @since 3.0.0
+ *
+ * @global array $wp_settings_errors Storage array of errors registered during this pageload
+ *
+ * @param string $setting Slug title of the setting to which this error applies.
+ * @param string $code Slug-name to identify the error. Used as part of 'id' attribute in HTML output.
+ * @param string $message The formatted message text to display to the user (will be shown inside styled
+ * `<div>` and `<p>` tags).
+ * @param string $type Optional. Message type, controls HTML class. Accepts 'error' or 'updated'.
+ * Default 'error'.
+ */
+function add_settings_error( $setting, $code, $message, $type = 'error' ) {
+ global $wp_settings_errors;
+
+ $wp_settings_errors[] = array(
+ 'setting' => $setting,
+ 'code' => $code,
+ 'message' => $message,
+ 'type' => $type,
+ );
+}
+
+/**
+ * Fetch settings errors registered by add_settings_error().
+ *
+ * Checks the $wp_settings_errors array for any errors declared during the current
+ * pageload and returns them.
+ *
+ * If changes were just submitted ($_GET['settings-updated']) and settings errors were saved
+ * to the 'settings_errors' transient then those errors will be returned instead. This
+ * is used to pass errors back across pageloads.
+ *
+ * Use the $sanitize argument to manually re-sanitize the option before returning errors.
+ * This is useful if you have errors or notices you want to show even when the user
+ * hasn't submitted data (i.e. when they first load an options page, or in the {@see 'admin_notices'}
+ * action hook).
+ *
+ * @since 3.0.0
+ *
+ * @global array $wp_settings_errors Storage array of errors registered during this pageload
+ *
+ * @param string $setting Optional slug title of a specific setting whose errors you want.
+ * @param boolean $sanitize Whether to re-sanitize the setting value before returning errors.
+ * @return array Array of settings errors.
+ */
+function get_settings_errors( $setting = '', $sanitize = false ) {
+ global $wp_settings_errors;
+
+ /*
+ * If $sanitize is true, manually re-run the sanitization for this option
+ * This allows the $sanitize_callback from register_setting() to run, adding
+ * any settings errors you want to show by default.
+ */
+ if ( $sanitize ) {
+ sanitize_option( $setting, get_option( $setting ) );
+ }
+
+ // If settings were passed back from options.php then use them.
+ if ( isset( $_GET['settings-updated'] ) && $_GET['settings-updated'] && get_transient( 'settings_errors' ) ) {
+ $wp_settings_errors = array_merge( (array) $wp_settings_errors, get_transient( 'settings_errors' ) );
+ delete_transient( 'settings_errors' );
+ }
+
+ // Check global in case errors have been added on this pageload.
+ if ( empty( $wp_settings_errors ) ) {
+ return array();
+ }
+
+ // Filter the results to those of a specific setting if one was set.
+ if ( $setting ) {
+ $setting_errors = array();
+ foreach ( (array) $wp_settings_errors as $key => $details ) {
+ if ( $setting == $details['setting'] ) {
+ $setting_errors[] = $wp_settings_errors[ $key ];
+ }
+ }
+ return $setting_errors;
+ }
+
+ return $wp_settings_errors;
+}
+
+/**
+ * Display settings errors registered by add_settings_error().
+ *
+ * Part of the Settings API. Outputs a div for each error retrieved by
+ * get_settings_errors().
+ *
+ * This is called automatically after a settings page based on the
+ * Settings API is submitted. Errors should be added during the validation
+ * callback function for a setting defined in register_setting().
+ *
+ * The $sanitize option is passed into get_settings_errors() and will
+ * re-run the setting sanitization
+ * on its current value.
+ *
+ * The $hide_on_update option will cause errors to only show when the settings
+ * page is first loaded. if the user has already saved new values it will be
+ * hidden to avoid repeating messages already shown in the default error
+ * reporting after submission. This is useful to show general errors like
+ * missing settings when the user arrives at the settings page.
+ *
+ * @since 3.0.0
+ *
+ * @param string $setting Optional slug title of a specific setting whose errors you want.
+ * @param bool $sanitize Whether to re-sanitize the setting value before returning errors.
+ * @param bool $hide_on_update If set to true errors will not be shown if the settings page has
+ * already been submitted.
+ */
+function settings_errors( $setting = '', $sanitize = false, $hide_on_update = false ) {
+
+ if ( $hide_on_update && ! empty( $_GET['settings-updated'] ) ) {
+ return;
+ }
+
+ $settings_errors = get_settings_errors( $setting, $sanitize );
+
+ if ( empty( $settings_errors ) ) {
+ return;
+ }
+
+ $output = '';
+ foreach ( $settings_errors as $key => $details ) {
+ $css_id = 'setting-error-' . $details['code'];
+ $css_class = $details['type'] . ' settings-error notice is-dismissible';
+ $output .= "<div id='$css_id' class='$css_class'> \n";
+ $output .= "<p><strong>{$details['message']}</strong></p>";
+ $output .= "</div> \n";
+ }
+ echo $output;
+}
+
+/**
+ * Outputs the modal window used for attaching media to posts or pages in the media-listing screen.
+ *
+ * @since 2.7.0
+ *
+ * @param string $found_action
+ */
+function find_posts_div( $found_action = '' ) {
+ ?>
+ <div id="find-posts" class="find-box" style="display: none;">
+ <div id="find-posts-head" class="find-box-head">
+ <?php _e( 'Attach to existing content' ); ?>
+ <button type="button" id="find-posts-close"><span class="screen-reader-text"><?php _e( 'Close media attachment panel' ); ?></span></button>
+ </div>
+ <div class="find-box-inside">
+ <div class="find-box-search">
+ <?php if ( $found_action ) { ?>
+ <input type="hidden" name="found_action" value="<?php echo esc_attr( $found_action ); ?>" />
+ <?php } ?>
+ <input type="hidden" name="affected" id="affected" value="" />
+ <?php wp_nonce_field( 'find-posts', '_ajax_nonce', false ); ?>
+ <label class="screen-reader-text" for="find-posts-input"><?php _e( 'Search' ); ?></label>
+ <input type="text" id="find-posts-input" name="ps" value="" />
+ <span class="spinner"></span>
+ <input type="button" id="find-posts-search" value="<?php esc_attr_e( 'Search' ); ?>" class="button" />
+ <div class="clear"></div>
+ </div>
+ <div id="find-posts-response"></div>
+ </div>
+ <div class="find-box-buttons">
+ <?php submit_button( __( 'Select' ), 'primary alignright', 'find-posts-submit', false ); ?>
+ <div class="clear"></div>
+ </div>
+ </div>
+ <?php
+}
+
+/**
+ * Displays the post password.
+ *
+ * The password is passed through esc_attr() to ensure that it is safe for placing in an html attribute.
+ *
+ * @since 2.7.0
+ */
+function the_post_password() {
+ $post = get_post();
+ if ( isset( $post->post_password ) ) {
+ echo esc_attr( $post->post_password );
+ }
+}
+
+/**
+ * Get the post title.
+ *
+ * The post title is fetched and if it is blank then a default string is
+ * returned.
+ *
+ * @since 2.7.0
+ *
+ * @param int|WP_Post $post Optional. Post ID or WP_Post object. Default is global $post.
+ * @return string The post title if set.
+ */
+function _draft_or_post_title( $post = 0 ) {
+ $title = get_the_title( $post );
+ if ( empty( $title ) ) {
+ $title = __( '(no title)' );
+ }
+ return esc_html( $title );
+}
+
+/**
+ * Displays the search query.
+ *
+ * A simple wrapper to display the "s" parameter in a `GET` URI. This function
+ * should only be used when the_search_query() cannot.
+ *
+ * @since 2.7.0
+ */
+function _admin_search_query() {
+ echo isset( $_REQUEST['s'] ) ? esc_attr( wp_unslash( $_REQUEST['s'] ) ) : '';
+}
+
+/**
+ * Generic Iframe header for use with Thickbox
+ *
+ * @since 2.7.0
+ *
+ * @global string $hook_suffix
+ * @global string $admin_body_class
+ * @global WP_Locale $wp_locale
+ *
+ * @param string $title Optional. Title of the Iframe page. Default empty.
+ * @param bool $deprecated Not used.
+ */
+function iframe_header( $title = '', $deprecated = false ) {
+ show_admin_bar( false );
+ global $hook_suffix, $admin_body_class, $wp_locale;
+ $admin_body_class = preg_replace( '/[^a-z0-9_-]+/i', '-', $hook_suffix );
+
+ $current_screen = get_current_screen();
+
+ @header( 'Content-Type: ' . get_option( 'html_type' ) . '; charset=' . get_option( 'blog_charset' ) );
+ _wp_admin_html_begin();
+ ?>
+<title><?php bloginfo( 'name' ); ?> &rsaquo; <?php echo $title; ?> &#8212; <?php _e( 'WordPress' ); ?></title>
+ <?php
+ wp_enqueue_style( 'colors' );
+ ?>
+<script type="text/javascript">
+addLoadEvent = function(func){if(typeof jQuery!="undefined")jQuery(document).ready(func);else if(typeof wpOnload!='function'){wpOnload=func;}else{var oldonload=wpOnload;wpOnload=function(){oldonload();func();}}};
+function tb_close(){var win=window.dialogArguments||opener||parent||top;win.tb_remove();}
+var ajaxurl = '<?php echo admin_url( 'admin-ajax.php', 'relative' ); ?>',
+ pagenow = '<?php echo $current_screen->id; ?>',
+ typenow = '<?php echo $current_screen->post_type; ?>',
+ adminpage = '<?php echo $admin_body_class; ?>',
+ thousandsSeparator = '<?php echo addslashes( $wp_locale->number_format['thousands_sep'] ); ?>',
+ decimalPoint = '<?php echo addslashes( $wp_locale->number_format['decimal_point'] ); ?>',
+ isRtl = <?php echo (int) is_rtl(); ?>;
+</script>
+ <?php
+ /** This action is documented in wp-admin/admin-header.php */
+ do_action( 'admin_enqueue_scripts', $hook_suffix );
+
+ /** This action is documented in wp-admin/admin-header.php */
+ do_action( "admin_print_styles-$hook_suffix" );
+
+ /** This action is documented in wp-admin/admin-header.php */
+ do_action( 'admin_print_styles' );
+
+ /** This action is documented in wp-admin/admin-header.php */
+ do_action( "admin_print_scripts-$hook_suffix" );
+
+ /** This action is documented in wp-admin/admin-header.php */
+ do_action( 'admin_print_scripts' );
+
+ /** This action is documented in wp-admin/admin-header.php */
+ do_action( "admin_head-$hook_suffix" );
+
+ /** This action is documented in wp-admin/admin-header.php */
+ do_action( 'admin_head' );
+
+ $admin_body_class .= ' locale-' . sanitize_html_class( strtolower( str_replace( '_', '-', get_user_locale() ) ) );
+
+ if ( is_rtl() ) {
+ $admin_body_class .= ' rtl';
+ }
+
+ ?>
+</head>
+ <?php
+ /** This filter is documented in wp-admin/admin-header.php */
+ $admin_body_classes = apply_filters( 'admin_body_class', '' );
+ $admin_body_classes = ltrim( $admin_body_classes . ' ' . $admin_body_class );
+ ?>
+<body
+ <?php
+ /**
+ * @global string $body_id
+ */
+ if ( isset( $GLOBALS['body_id'] ) ) {
+ echo ' id="' . $GLOBALS['body_id'] . '"';
+ }
+ ?>
+ class="wp-admin wp-core-ui no-js iframe <?php echo $admin_body_classes; ?>">
+<script type="text/javascript">
+(function(){
+var c = document.body.className;
+c = c.replace(/no-js/, 'js');
+document.body.className = c;
+})();
+</script>
+ <?php
+}
+
+/**
+ * Generic Iframe footer for use with Thickbox
+ *
+ * @since 2.7.0
+ */
+function iframe_footer() {
+ /*
+ * We're going to hide any footer output on iFrame pages,
+ * but run the hooks anyway since they output JavaScript
+ * or other needed content.
+ */
+
+ /**
+ * @global string $hook_suffix
+ */
+ global $hook_suffix;
+ ?>
+ <div class="hidden">
+ <?php
+ /** This action is documented in wp-admin/admin-footer.php */
+ do_action( 'admin_footer', $hook_suffix );
+
+ /** This action is documented in wp-admin/admin-footer.php */
+ do_action( "admin_print_footer_scripts-$hook_suffix" );
+
+ /** This action is documented in wp-admin/admin-footer.php */
+ do_action( 'admin_print_footer_scripts' );
+ ?>
+ </div>
+<script type="text/javascript">if(typeof wpOnload=="function")wpOnload();</script>
+</body>
+</html>
+ <?php
+}
+
+/**
+ * @param WP_Post $post
+ */
+function _post_states( $post ) {
+ $post_states = array();
+ if ( isset( $_REQUEST['post_status'] ) ) {
+ $post_status = $_REQUEST['post_status'];
+ } else {
+ $post_status = '';
+ }
+
+ if ( ! empty( $post->post_password ) ) {
+ $post_states['protected'] = __( 'Password protected' );
+ }
+ if ( 'private' == $post->post_status && 'private' != $post_status ) {
+ $post_states['private'] = __( 'Private' );
+ }
+ if ( 'draft' === $post->post_status ) {
+ if ( get_post_meta( $post->ID, '_customize_changeset_uuid', true ) ) {
+ $post_states[] = __( 'Customization Draft' );
+ } elseif ( 'draft' !== $post_status ) {
+ $post_states['draft'] = __( 'Draft' );
+ }
+ } elseif ( 'trash' === $post->post_status && get_post_meta( $post->ID, '_customize_changeset_uuid', true ) ) {
+ $post_states[] = __( 'Customization Draft' );
+ }
+ if ( 'pending' == $post->post_status && 'pending' != $post_status ) {
+ $post_states['pending'] = _x( 'Pending', 'post status' );
+ }
+ if ( is_sticky( $post->ID ) ) {
+ $post_states['sticky'] = __( 'Sticky' );
+ }
+
+ if ( 'future' === $post->post_status ) {
+ $post_states['scheduled'] = __( 'Scheduled' );
+ }
+
+ if ( 'page' === get_option( 'show_on_front' ) ) {
+ if ( intval( get_option( 'page_on_front' ) ) === $post->ID ) {
+ $post_states['page_on_front'] = __( 'Front Page' );
+ }
+
+ if ( intval( get_option( 'page_for_posts' ) ) === $post->ID ) {
+ $post_states['page_for_posts'] = __( 'Posts Page' );
+ }
+ }
+
+ if ( intval( get_option( 'wp_page_for_privacy_policy' ) ) === $post->ID ) {
+ $post_states['page_for_privacy_policy'] = __( 'Privacy Policy Page' );
+ }
+
+ /**
+ * Filters the default post display states used in the posts list table.
+ *
+ * @since 2.8.0
+ * @since 3.6.0 Added the `$post` parameter.
+ *
+ * @param string[] $post_states An array of post display states.
+ * @param WP_Post $post The current post object.
+ */
+ $post_states = apply_filters( 'display_post_states', $post_states, $post );
+
+ if ( ! empty( $post_states ) ) {
+ $state_count = count( $post_states );
+ $i = 0;
+ echo ' &mdash; ';
+ foreach ( $post_states as $state ) {
+ ++$i;
+ ( $i == $state_count ) ? $sep = '' : $sep = ', ';
+ echo "<span class='post-state'>$state$sep</span>";
+ }
+ }
+
+}
+
+/**
+ * @param WP_Post $post
+ */
+function _media_states( $post ) {
+ $media_states = array();
+ $stylesheet = get_option( 'stylesheet' );
+
+ if ( current_theme_supports( 'custom-header' ) ) {
+ $meta_header = get_post_meta( $post->ID, '_wp_attachment_is_custom_header', true );
+
+ if ( is_random_header_image() ) {
+ $header_images = wp_list_pluck( get_uploaded_header_images(), 'attachment_id' );
+
+ if ( $meta_header == $stylesheet && in_array( $post->ID, $header_images ) ) {
+ $media_states[] = __( 'Header Image' );
+ }
+ } else {
+ $header_image = get_header_image();
+
+ // Display "Header Image" if the image was ever used as a header image
+ if ( ! empty( $meta_header ) && $meta_header == $stylesheet && $header_image !== wp_get_attachment_url( $post->ID ) ) {
+ $media_states[] = __( 'Header Image' );
+ }
+
+ // Display "Current Header Image" if the image is currently the header image
+ if ( $header_image && $header_image == wp_get_attachment_url( $post->ID ) ) {
+ $media_states[] = __( 'Current Header Image' );
+ }
+ }
+ }
+
+ if ( current_theme_supports( 'custom-background' ) ) {
+ $meta_background = get_post_meta( $post->ID, '_wp_attachment_is_custom_background', true );
+
+ if ( ! empty( $meta_background ) && $meta_background == $stylesheet ) {
+ $media_states[] = __( 'Background Image' );
+
+ $background_image = get_background_image();
+ if ( $background_image && $background_image == wp_get_attachment_url( $post->ID ) ) {
+ $media_states[] = __( 'Current Background Image' );
+ }
+ }
+ }
+
+ if ( $post->ID == get_option( 'site_icon' ) ) {
+ $media_states[] = __( 'Site Icon' );
+ }
+
+ if ( $post->ID == get_theme_mod( 'custom_logo' ) ) {
+ $media_states[] = __( 'Logo' );
+ }
+
+ /**
+ * Filters the default media display states for items in the Media list table.
+ *
+ * @since 3.2.0
+ * @since 4.8.0 Added the `$post` parameter.
+ *
+ * @param string[] $media_states An array of media states. Default 'Header Image',
+ * 'Background Image', 'Site Icon', 'Logo'.
+ * @param WP_Post $post The current attachment object.
+ */
+ $media_states = apply_filters( 'display_media_states', $media_states, $post );
+
+ if ( ! empty( $media_states ) ) {
+ $state_count = count( $media_states );
+ $i = 0;
+ echo ' &mdash; ';
+ foreach ( $media_states as $state ) {
+ ++$i;
+ ( $i == $state_count ) ? $sep = '' : $sep = ', ';
+ echo "<span class='post-state'>$state$sep</span>";
+ }
+ }
+}
+
+/**
+ * Test support for compressing JavaScript from PHP
+ *
+ * Outputs JavaScript that tests if compression from PHP works as expected
+ * and sets an option with the result. Has no effect when the current user
+ * is not an administrator. To run the test again the option 'can_compress_scripts'
+ * has to be deleted.
+ *
+ * @since 2.8.0
+ */
+function compression_test() {
+ ?>
+ <script type="text/javascript">
+ var compressionNonce = <?php echo wp_json_encode( wp_create_nonce( 'update_can_compress_scripts' ) ); ?>;
+ var testCompression = {
+ get : function(test) {
+ var x;
+ if ( window.XMLHttpRequest ) {
+ x = new XMLHttpRequest();
+ } else {
+ try{x=new ActiveXObject('Msxml2.XMLHTTP');}catch(e){try{x=new ActiveXObject('Microsoft.XMLHTTP');}catch(e){};}
+ }
+
+ if (x) {
+ x.onreadystatechange = function() {
+ var r, h;
+ if ( x.readyState == 4 ) {
+ r = x.responseText.substr(0, 18);
+ h = x.getResponseHeader('Content-Encoding');
+ testCompression.check(r, h, test);
+ }
+ };
+
+ x.open('GET', ajaxurl + '?action=wp-compression-test&test='+test+'&_ajax_nonce='+compressionNonce+'&'+(new Date()).getTime(), true);
+ x.send('');
+ }
+ },
+
+ check : function(r, h, test) {
+ if ( ! r && ! test )
+ this.get(1);
+
+ if ( 1 == test ) {
+ if ( h && ( h.match(/deflate/i) || h.match(/gzip/i) ) )
+ this.get('no');
+ else
+ this.get(2);
+
+ return;
+ }
+
+ if ( 2 == test ) {
+ if ( '"wpCompressionTest' == r )
+ this.get('yes');
+ else
+ this.get('no');
+ }
+ }
+ };
+ testCompression.check();
+ </script>
+ <?php
+}
+
+/**
+ * Echoes a submit button, with provided text and appropriate class(es).
+ *
+ * @since 3.1.0
+ *
+ * @see get_submit_button()
+ *
+ * @param string $text The text of the button (defaults to 'Save Changes')
+ * @param string $type Optional. The type and CSS class(es) of the button. Core values
+ * include 'primary', 'small', and 'large'. Default 'primary'.
+ * @param string $name The HTML name of the submit button. Defaults to "submit". If no
+ * id attribute is given in $other_attributes below, $name will be
+ * used as the button's id.
+ * @param bool $wrap True if the output button should be wrapped in a paragraph tag,
+ * false otherwise. Defaults to true.
+ * @param array|string $other_attributes Other attributes that should be output with the button, mapping
+ * attributes to their values, such as setting tabindex to 1, etc.
+ * These key/value attribute pairs will be output as attribute="value",
+ * where attribute is the key. Other attributes can also be provided
+ * as a string such as 'tabindex="1"', though the array format is
+ * preferred. Default null.
+ */
+function submit_button( $text = null, $type = 'primary', $name = 'submit', $wrap = true, $other_attributes = null ) {
+ echo get_submit_button( $text, $type, $name, $wrap, $other_attributes );
+}
+
+/**
+ * Returns a submit button, with provided text and appropriate class
+ *
+ * @since 3.1.0
+ *
+ * @param string $text Optional. The text of the button. Default 'Save Changes'.
+ * @param string $type Optional. The type and CSS class(es) of the button. Core values
+ * include 'primary', 'small', and 'large'. Default 'primary large'.
+ * @param string $name Optional. The HTML name of the submit button. Defaults to "submit".
+ * If no id attribute is given in $other_attributes below, `$name` will
+ * be used as the button's id. Default 'submit'.
+ * @param bool $wrap Optional. True if the output button should be wrapped in a paragraph
+ * tag, false otherwise. Default true.
+ * @param array|string $other_attributes Optional. Other attributes that should be output with the button,
+ * mapping attributes to their values, such as `array( 'tabindex' => '1' )`.
+ * These attributes will be output as `attribute="value"`, such as
+ * `tabindex="1"`. Other attributes can also be provided as a string such
+ * as `tabindex="1"`, though the array format is typically cleaner.
+ * Default empty.
+ * @return string Submit button HTML.
+ */
+function get_submit_button( $text = '', $type = 'primary large', $name = 'submit', $wrap = true, $other_attributes = '' ) {
+ if ( ! is_array( $type ) ) {
+ $type = explode( ' ', $type );
+ }
+
+ $button_shorthand = array( 'primary', 'small', 'large' );
+ $classes = array( 'button' );
+ foreach ( $type as $t ) {
+ if ( 'secondary' === $t || 'button-secondary' === $t ) {
+ continue;
+ }
+ $classes[] = in_array( $t, $button_shorthand ) ? 'button-' . $t : $t;
+ }
+ // Remove empty items, remove duplicate items, and finally build a string.
+ $class = implode( ' ', array_unique( array_filter( $classes ) ) );
+
+ $text = $text ? $text : __( 'Save Changes' );
+
+ // Default the id attribute to $name unless an id was specifically provided in $other_attributes
+ $id = $name;
+ if ( is_array( $other_attributes ) && isset( $other_attributes['id'] ) ) {
+ $id = $other_attributes['id'];
+ unset( $other_attributes['id'] );
+ }
+
+ $attributes = '';
+ if ( is_array( $other_attributes ) ) {
+ foreach ( $other_attributes as $attribute => $value ) {
+ $attributes .= $attribute . '="' . esc_attr( $value ) . '" '; // Trailing space is important
+ }
+ } elseif ( ! empty( $other_attributes ) ) { // Attributes provided as a string
+ $attributes = $other_attributes;
+ }
+
+ // Don't output empty name and id attributes.
+ $name_attr = $name ? ' name="' . esc_attr( $name ) . '"' : '';
+ $id_attr = $id ? ' id="' . esc_attr( $id ) . '"' : '';
+
+ $button = '<input type="submit"' . $name_attr . $id_attr . ' class="' . esc_attr( $class );
+ $button .= '" value="' . esc_attr( $text ) . '" ' . $attributes . ' />';
+
+ if ( $wrap ) {
+ $button = '<p class="submit">' . $button . '</p>';
+ }
+
+ return $button;
+}
+
+/**
+ * @global bool $is_IE
+ */
+function _wp_admin_html_begin() {
+ global $is_IE;
+
+ $admin_html_class = ( is_admin_bar_showing() ) ? 'wp-toolbar' : '';
+
+ if ( $is_IE ) {
+ @header( 'X-UA-Compatible: IE=edge' );
+ }
+
+ ?>
+<!DOCTYPE html>
+<!--[if IE 8]>
+<html xmlns="http://www.w3.org/1999/xhtml" class="ie8 <?php echo $admin_html_class; ?>"
+ <?php
+ /**
+ * Fires inside the HTML tag in the admin header.
+ *
+ * @since 2.2.0
+ */
+ do_action( 'admin_xml_ns' );
+
+ language_attributes();
+ ?>
+ >
+<![endif]-->
+<!--[if !(IE 8) ]><!-->
+<html xmlns="http://www.w3.org/1999/xhtml" class="<?php echo $admin_html_class; ?>"
+ <?php
+ /** This action is documented in wp-admin/includes/template.php */
+ do_action( 'admin_xml_ns' );
+
+ language_attributes();
+ ?>
+ >
+<!--<![endif]-->
+<head>
+<meta http-equiv="Content-Type" content="<?php bloginfo( 'html_type' ); ?>; charset=<?php echo get_option( 'blog_charset' ); ?>" />
+ <?php
+}
+
+/**
+ * Convert a screen string to a screen object
+ *
+ * @since 3.0.0
+ *
+ * @param string $hook_name The hook name (also known as the hook suffix) used to determine the screen.
+ * @return WP_Screen Screen object.
+ */
+function convert_to_screen( $hook_name ) {
+ if ( ! class_exists( 'WP_Screen' ) ) {
+ _doing_it_wrong(
+ 'convert_to_screen(), add_meta_box()',
+ sprintf(
+ /* translators: 1: wp-admin/includes/template.php, 2: add_meta_box(), 3: add_meta_boxes */
+ __( 'Likely direct inclusion of %1$s in order to use %2$s. This is very wrong. Hook the %2$s call into the %3$s action instead.' ),
+ '<code>wp-admin/includes/template.php</code>',
+ '<code>add_meta_box()</code>',
+ '<code>add_meta_boxes</code>'
+ ),
+ '3.3.0'
+ );
+ return (object) array(
+ 'id' => '_invalid',
+ 'base' => '_are_belong_to_us',
+ );
+ }
+
+ return WP_Screen::get( $hook_name );
+}
+
+/**
+ * Output the HTML for restoring the post data from DOM storage
+ *
+ * @since 3.6.0
+ * @access private
+ */
+function _local_storage_notice() {
+ ?>
+ <div id="local-storage-notice" class="hidden notice is-dismissible">
+ <p class="local-restore">
+ <?php _e( 'The backup of this post in your browser is different from the version below.' ); ?>
+ <button type="button" class="button restore-backup"><?php _e( 'Restore the backup' ); ?></button>
+ </p>
+ <p class="help">
+ <?php _e( 'This will replace the current editor content with the last backup version. You can use undo and redo in the editor to get the old content back or to return to the restored version.' ); ?>
+ </p>
+ </div>
+ <?php
+}
+
+/**
+ * Output a HTML element with a star rating for a given rating.
+ *
+ * Outputs a HTML element with the star rating exposed on a 0..5 scale in
+ * half star increments (ie. 1, 1.5, 2 stars). Optionally, if specified, the
+ * number of ratings may also be displayed by passing the $number parameter.
+ *
+ * @since 3.8.0
+ * @since 4.4.0 Introduced the `echo` parameter.
+ *
+ * @param array $args {
+ * Optional. Array of star ratings arguments.
+ *
+ * @type int|float $rating The rating to display, expressed in either a 0.5 rating increment,
+ * or percentage. Default 0.
+ * @type string $type Format that the $rating is in. Valid values are 'rating' (default),
+ * or, 'percent'. Default 'rating'.
+ * @type int $number The number of ratings that makes up this rating. Default 0.
+ * @type bool $echo Whether to echo the generated markup. False to return the markup instead
+ * of echoing it. Default true.
+ * }
+ * @return string Star rating HTML.
+ */
+function wp_star_rating( $args = array() ) {
+ $defaults = array(
+ 'rating' => 0,
+ 'type' => 'rating',
+ 'number' => 0,
+ 'echo' => true,
+ );
+ $r = wp_parse_args( $args, $defaults );
+
+ // Non-English decimal places when the $rating is coming from a string
+ $rating = (float) str_replace( ',', '.', $r['rating'] );
+
+ // Convert Percentage to star rating, 0..5 in .5 increments
+ if ( 'percent' === $r['type'] ) {
+ $rating = round( $rating / 10, 0 ) / 2;
+ }
+
+ // Calculate the number of each type of star needed
+ $full_stars = floor( $rating );
+ $half_stars = ceil( $rating - $full_stars );
+ $empty_stars = 5 - $full_stars - $half_stars;
+
+ if ( $r['number'] ) {
+ /* translators: 1: the rating, 2: the number of ratings */
+ $format = _n( '%1$s rating based on %2$s rating', '%1$s rating based on %2$s ratings', $r['number'] );
+ $title = sprintf( $format, number_format_i18n( $rating, 1 ), number_format_i18n( $r['number'] ) );
+ } else {
+ /* translators: %s: the rating */
+ $title = sprintf( __( '%s rating' ), number_format_i18n( $rating, 1 ) );
+ }
+
+ $output = '<div class="star-rating">';
+ $output .= '<span class="screen-reader-text">' . $title . '</span>';
+ $output .= str_repeat( '<div class="star star-full" aria-hidden="true"></div>', $full_stars );
+ $output .= str_repeat( '<div class="star star-half" aria-hidden="true"></div>', $half_stars );
+ $output .= str_repeat( '<div class="star star-empty" aria-hidden="true"></div>', $empty_stars );
+ $output .= '</div>';
+
+ if ( $r['echo'] ) {
+ echo $output;
+ }
+
+ return $output;
+}
+
+/**
+ * Output a notice when editing the page for posts (internal use only).
+ *
+ * @ignore
+ * @since 4.2.0
+ */
+function _wp_posts_page_notice() {
+ echo '<div class="notice notice-warning inline"><p>' . __( 'You are currently editing the page that shows your latest posts.' ) . '</p></div>';
+}
diff --git a/www/crm/wp-admin/includes/theme-install.php b/www/crm/wp-admin/includes/theme-install.php
new file mode 100644
index 00000000..219295f9
--- /dev/null
+++ b/www/crm/wp-admin/includes/theme-install.php
@@ -0,0 +1,251 @@
+<?php
+/**
+ * WordPress Theme Installation Administration API
+ *
+ * @package WordPress
+ * @subpackage Administration
+ */
+
+$themes_allowedtags = array(
+ 'a' => array(
+ 'href' => array(),
+ 'title' => array(),
+ 'target' => array(),
+ ),
+ 'abbr' => array( 'title' => array() ),
+ 'acronym' => array( 'title' => array() ),
+ 'code' => array(),
+ 'pre' => array(),
+ 'em' => array(),
+ 'strong' => array(),
+ 'div' => array(),
+ 'p' => array(),
+ 'ul' => array(),
+ 'ol' => array(),
+ 'li' => array(),
+ 'h1' => array(),
+ 'h2' => array(),
+ 'h3' => array(),
+ 'h4' => array(),
+ 'h5' => array(),
+ 'h6' => array(),
+ 'img' => array(
+ 'src' => array(),
+ 'class' => array(),
+ 'alt' => array(),
+ ),
+);
+
+$theme_field_defaults = array(
+ 'description' => true,
+ 'sections' => false,
+ 'tested' => true,
+ 'requires' => true,
+ 'rating' => true,
+ 'downloaded' => true,
+ 'downloadlink' => true,
+ 'last_updated' => true,
+ 'homepage' => true,
+ 'tags' => true,
+ 'num_ratings' => true,
+);
+
+/**
+ * Retrieve list of WordPress theme features (aka theme tags).
+ *
+ * @since 2.8.0
+ *
+ * @deprecated since 3.1.0 Use get_theme_feature_list() instead.
+ *
+ * @return array
+ */
+function install_themes_feature_list() {
+ _deprecated_function( __FUNCTION__, '3.1.0', 'get_theme_feature_list()' );
+
+ if ( ! $cache = get_transient( 'wporg_theme_feature_list' ) ) {
+ set_transient( 'wporg_theme_feature_list', array(), 3 * HOUR_IN_SECONDS );
+ }
+
+ if ( $cache ) {
+ return $cache;
+ }
+
+ $feature_list = themes_api( 'feature_list', array() );
+ if ( is_wp_error( $feature_list ) ) {
+ return array();
+ }
+
+ set_transient( 'wporg_theme_feature_list', $feature_list, 3 * HOUR_IN_SECONDS );
+
+ return $feature_list;
+}
+
+/**
+ * Display search form for searching themes.
+ *
+ * @since 2.8.0
+ *
+ * @param bool $type_selector
+ */
+function install_theme_search_form( $type_selector = true ) {
+ $type = isset( $_REQUEST['type'] ) ? wp_unslash( $_REQUEST['type'] ) : 'term';
+ $term = isset( $_REQUEST['s'] ) ? wp_unslash( $_REQUEST['s'] ) : '';
+ if ( ! $type_selector ) {
+ echo '<p class="install-help">' . __( 'Search for themes by keyword.' ) . '</p>';
+ }
+ ?>
+<form id="search-themes" method="get">
+ <input type="hidden" name="tab" value="search" />
+ <?php if ( $type_selector ) : ?>
+ <label class="screen-reader-text" for="typeselector"><?php _e( 'Type of search' ); ?></label>
+ <select name="type" id="typeselector">
+ <option value="term" <?php selected( 'term', $type ); ?>><?php _e( 'Keyword' ); ?></option>
+ <option value="author" <?php selected( 'author', $type ); ?>><?php _e( 'Author' ); ?></option>
+ <option value="tag" <?php selected( 'tag', $type ); ?>><?php _ex( 'Tag', 'Theme Installer' ); ?></option>
+ </select>
+ <label class="screen-reader-text" for="s">
+ <?php
+ switch ( $type ) {
+ case 'term':
+ _e( 'Search by keyword' );
+ break;
+ case 'author':
+ _e( 'Search by author' );
+ break;
+ case 'tag':
+ _e( 'Search by tag' );
+ break;
+ }
+ ?>
+ </label>
+ <?php else : ?>
+ <label class="screen-reader-text" for="s"><?php _e( 'Search by keyword' ); ?></label>
+ <?php endif; ?>
+ <input type="search" name="s" id="s" size="30" value="<?php echo esc_attr( $term ); ?>" autofocus="autofocus" />
+ <?php submit_button( __( 'Search' ), '', 'search', false ); ?>
+</form>
+ <?php
+}
+
+/**
+ * Display tags filter for themes.
+ *
+ * @since 2.8.0
+ */
+function install_themes_dashboard() {
+ install_theme_search_form( false );
+ ?>
+<h4><?php _e( 'Feature Filter' ); ?></h4>
+<p class="install-help"><?php _e( 'Find a theme based on specific features.' ); ?></p>
+
+<form method="get">
+ <input type="hidden" name="tab" value="search" />
+ <?php
+ $feature_list = get_theme_feature_list();
+ echo '<div class="feature-filter">';
+
+ foreach ( (array) $feature_list as $feature_name => $features ) {
+ $feature_name = esc_html( $feature_name );
+ echo '<div class="feature-name">' . $feature_name . '</div>';
+
+ echo '<ol class="feature-group">';
+ foreach ( $features as $feature => $feature_name ) {
+ $feature_name = esc_html( $feature_name );
+ $feature = esc_attr( $feature );
+ ?>
+
+<li>
+ <input type="checkbox" name="features[]" id="feature-id-<?php echo $feature; ?>" value="<?php echo $feature; ?>" />
+ <label for="feature-id-<?php echo $feature; ?>"><?php echo $feature_name; ?></label>
+</li>
+
+<?php } ?>
+</ol>
+<br class="clear" />
+ <?php
+ }
+ ?>
+
+</div>
+<br class="clear" />
+ <?php submit_button( __( 'Find Themes' ), '', 'search' ); ?>
+</form>
+ <?php
+}
+
+/**
+ * @since 2.8.0
+ */
+function install_themes_upload() {
+ ?>
+<p class="install-help"><?php _e( 'If you have a theme in a .zip format, you may install it by uploading it here.' ); ?></p>
+<form method="post" enctype="multipart/form-data" class="wp-upload-form" action="<?php echo self_admin_url( 'update.php?action=upload-theme' ); ?>">
+ <?php wp_nonce_field( 'theme-upload' ); ?>
+ <label class="screen-reader-text" for="themezip"><?php _e( 'Theme zip file' ); ?></label>
+ <input type="file" id="themezip" name="themezip" />
+ <?php submit_button( __( 'Install Now' ), '', 'install-theme-submit', false ); ?>
+</form>
+ <?php
+}
+
+/**
+ * Prints a theme on the Install Themes pages.
+ *
+ * @deprecated 3.4.0
+ *
+ * @global WP_Theme_Install_List_Table $wp_list_table
+ *
+ * @param object $theme
+ */
+function display_theme( $theme ) {
+ _deprecated_function( __FUNCTION__, '3.4.0' );
+ global $wp_list_table;
+ if ( ! isset( $wp_list_table ) ) {
+ $wp_list_table = _get_list_table( 'WP_Theme_Install_List_Table' );
+ }
+ $wp_list_table->prepare_items();
+ $wp_list_table->single_row( $theme );
+}
+
+/**
+ * Display theme content based on theme list.
+ *
+ * @since 2.8.0
+ *
+ * @global WP_Theme_Install_List_Table $wp_list_table
+ */
+function display_themes() {
+ global $wp_list_table;
+
+ if ( ! isset( $wp_list_table ) ) {
+ $wp_list_table = _get_list_table( 'WP_Theme_Install_List_Table' );
+ }
+ $wp_list_table->prepare_items();
+ $wp_list_table->display();
+
+}
+
+/**
+ * Display theme information in dialog box form.
+ *
+ * @since 2.8.0
+ *
+ * @global WP_Theme_Install_List_Table $wp_list_table
+ */
+function install_theme_information() {
+ global $wp_list_table;
+
+ $theme = themes_api( 'theme_information', array( 'slug' => wp_unslash( $_REQUEST['theme'] ) ) );
+
+ if ( is_wp_error( $theme ) ) {
+ wp_die( $theme );
+ }
+
+ iframe_header( __( 'Theme Installation' ) );
+ if ( ! isset( $wp_list_table ) ) {
+ $wp_list_table = _get_list_table( 'WP_Theme_Install_List_Table' );
+ }
+ $wp_list_table->theme_installer_single( $theme );
+ iframe_footer();
+ exit;
+}
diff --git a/www/crm/wp-admin/includes/theme.php b/www/crm/wp-admin/includes/theme.php
new file mode 100644
index 00000000..f1d0d374
--- /dev/null
+++ b/www/crm/wp-admin/includes/theme.php
@@ -0,0 +1,912 @@
+<?php
+/**
+ * WordPress Theme Administration API
+ *
+ * @package WordPress
+ * @subpackage Administration
+ */
+
+/**
+ * Remove a theme
+ *
+ * @since 2.8.0
+ *
+ * @global WP_Filesystem_Base $wp_filesystem WordPress filesystem subclass.
+ *
+ * @param string $stylesheet Stylesheet of the theme to delete.
+ * @param string $redirect Redirect to page when complete.
+ * @return bool|null|WP_Error True on success, false if `$stylesheet` is empty, WP_Error on failure.
+ * Null if filesystem credentials are required to proceed.
+ */
+function delete_theme( $stylesheet, $redirect = '' ) {
+ global $wp_filesystem;
+
+ if ( empty( $stylesheet ) ) {
+ return false;
+ }
+
+ if ( empty( $redirect ) ) {
+ $redirect = wp_nonce_url( 'themes.php?action=delete&stylesheet=' . urlencode( $stylesheet ), 'delete-theme_' . $stylesheet );
+ }
+
+ ob_start();
+ $credentials = request_filesystem_credentials( $redirect );
+ $data = ob_get_clean();
+
+ if ( false === $credentials ) {
+ if ( ! empty( $data ) ) {
+ include_once( ABSPATH . 'wp-admin/admin-header.php' );
+ echo $data;
+ include( ABSPATH . 'wp-admin/admin-footer.php' );
+ exit;
+ }
+ return;
+ }
+
+ if ( ! WP_Filesystem( $credentials ) ) {
+ ob_start();
+ request_filesystem_credentials( $redirect, '', true ); // Failed to connect, Error and request again.
+ $data = ob_get_clean();
+
+ if ( ! empty( $data ) ) {
+ include_once( ABSPATH . 'wp-admin/admin-header.php' );
+ echo $data;
+ include( ABSPATH . 'wp-admin/admin-footer.php' );
+ exit;
+ }
+ return;
+ }
+
+ if ( ! is_object( $wp_filesystem ) ) {
+ return new WP_Error( 'fs_unavailable', __( 'Could not access filesystem.' ) );
+ }
+
+ if ( is_wp_error( $wp_filesystem->errors ) && $wp_filesystem->errors->has_errors() ) {
+ return new WP_Error( 'fs_error', __( 'Filesystem error.' ), $wp_filesystem->errors );
+ }
+
+ // Get the base plugin folder.
+ $themes_dir = $wp_filesystem->wp_themes_dir();
+ if ( empty( $themes_dir ) ) {
+ return new WP_Error( 'fs_no_themes_dir', __( 'Unable to locate WordPress theme directory.' ) );
+ }
+
+ $themes_dir = trailingslashit( $themes_dir );
+ $theme_dir = trailingslashit( $themes_dir . $stylesheet );
+ $deleted = $wp_filesystem->delete( $theme_dir, true );
+
+ if ( ! $deleted ) {
+ return new WP_Error( 'could_not_remove_theme', sprintf( __( 'Could not fully remove the theme %s.' ), $stylesheet ) );
+ }
+
+ $theme_translations = wp_get_installed_translations( 'themes' );
+
+ // Remove language files, silently.
+ if ( ! empty( $theme_translations[ $stylesheet ] ) ) {
+ $translations = $theme_translations[ $stylesheet ];
+
+ foreach ( $translations as $translation => $data ) {
+ $wp_filesystem->delete( WP_LANG_DIR . '/themes/' . $stylesheet . '-' . $translation . '.po' );
+ $wp_filesystem->delete( WP_LANG_DIR . '/themes/' . $stylesheet . '-' . $translation . '.mo' );
+
+ $json_translation_files = glob( WP_LANG_DIR . '/themes/' . $stylesheet . '-' . $translation . '-*.json' );
+ if ( $json_translation_files ) {
+ array_map( array( $wp_filesystem, 'delete' ), $json_translation_files );
+ }
+ }
+ }
+
+ // Remove the theme from allowed themes on the network.
+ if ( is_multisite() ) {
+ WP_Theme::network_disable_theme( $stylesheet );
+ }
+
+ // Force refresh of theme update information.
+ delete_site_transient( 'update_themes' );
+
+ return true;
+}
+
+/**
+ * Get the Page Templates available in this theme
+ *
+ * @since 1.5.0
+ * @since 4.7.0 Added the `$post_type` parameter.
+ *
+ * @param WP_Post|null $post Optional. The post being edited, provided for context.
+ * @param string $post_type Optional. Post type to get the templates for. Default 'page'.
+ * @return array Key is the template name, value is the filename of the template
+ */
+function get_page_templates( $post = null, $post_type = 'page' ) {
+ return array_flip( wp_get_theme()->get_page_templates( $post, $post_type ) );
+}
+
+/**
+ * Tidies a filename for url display by the theme editor.
+ *
+ * @since 2.9.0
+ * @access private
+ *
+ * @param string $fullpath Full path to the theme file
+ * @param string $containingfolder Path of the theme parent folder
+ * @return string
+ */
+function _get_template_edit_filename( $fullpath, $containingfolder ) {
+ return str_replace( dirname( dirname( $containingfolder ) ), '', $fullpath );
+}
+
+/**
+ * Check if there is an update for a theme available.
+ *
+ * Will display link, if there is an update available.
+ *
+ * @since 2.7.0
+ * @see get_theme_update_available()
+ *
+ * @param WP_Theme $theme Theme data object.
+ */
+function theme_update_available( $theme ) {
+ echo get_theme_update_available( $theme );
+}
+
+/**
+ * Retrieve the update link if there is a theme update available.
+ *
+ * Will return a link if there is an update available.
+ *
+ * @since 3.8.0
+ *
+ * @staticvar object $themes_update
+ *
+ * @param WP_Theme $theme WP_Theme object.
+ * @return false|string HTML for the update link, or false if invalid info was passed.
+ */
+function get_theme_update_available( $theme ) {
+ static $themes_update = null;
+
+ if ( ! current_user_can( 'update_themes' ) ) {
+ return false;
+ }
+
+ if ( ! isset( $themes_update ) ) {
+ $themes_update = get_site_transient( 'update_themes' );
+ }
+
+ if ( ! ( $theme instanceof WP_Theme ) ) {
+ return false;
+ }
+
+ $stylesheet = $theme->get_stylesheet();
+
+ $html = '';
+
+ if ( isset( $themes_update->response[ $stylesheet ] ) ) {
+ $update = $themes_update->response[ $stylesheet ];
+ $theme_name = $theme->display( 'Name' );
+ $details_url = add_query_arg(
+ array(
+ 'TB_iframe' => 'true',
+ 'width' => 1024,
+ 'height' => 800,
+ ),
+ $update['url']
+ ); //Theme browser inside WP? replace this, Also, theme preview JS will override this on the available list.
+ $update_url = wp_nonce_url( admin_url( 'update.php?action=upgrade-theme&amp;theme=' . urlencode( $stylesheet ) ), 'upgrade-theme_' . $stylesheet );
+
+ if ( ! is_multisite() ) {
+ if ( ! current_user_can( 'update_themes' ) ) {
+ /* translators: 1: theme name, 2: theme details URL, 3: additional link attributes, 4: version number */
+ $html = sprintf(
+ '<p><strong>' . __( 'There is a new version of %1$s available. <a href="%2$s" %3$s>View version %4$s details</a>.' ) . '</strong></p>',
+ $theme_name,
+ esc_url( $details_url ),
+ sprintf(
+ 'class="thickbox open-plugin-details-modal" aria-label="%s"',
+ /* translators: 1: theme name, 2: version number */
+ esc_attr( sprintf( __( 'View %1$s version %2$s details' ), $theme_name, $update['new_version'] ) )
+ ),
+ $update['new_version']
+ );
+ } elseif ( empty( $update['package'] ) ) {
+ /* translators: 1: theme name, 2: theme details URL, 3: additional link attributes, 4: version number */
+ $html = sprintf(
+ '<p><strong>' . __( 'There is a new version of %1$s available. <a href="%2$s" %3$s>View version %4$s details</a>. <em>Automatic update is unavailable for this theme.</em>' ) . '</strong></p>',
+ $theme_name,
+ esc_url( $details_url ),
+ sprintf(
+ 'class="thickbox open-plugin-details-modal" aria-label="%s"',
+ /* translators: 1: theme name, 2: version number */
+ esc_attr( sprintf( __( 'View %1$s version %2$s details' ), $theme_name, $update['new_version'] ) )
+ ),
+ $update['new_version']
+ );
+ } else {
+ /* translators: 1: theme name, 2: theme details URL, 3: additional link attributes, 4: version number, 5: update URL, 6: additional link attributes */
+ $html = sprintf(
+ '<p><strong>' . __( 'There is a new version of %1$s available. <a href="%2$s" %3$s>View version %4$s details</a> or <a href="%5$s" %6$s>update now</a>.' ) . '</strong></p>',
+ $theme_name,
+ esc_url( $details_url ),
+ sprintf(
+ 'class="thickbox open-plugin-details-modal" aria-label="%s"',
+ /* translators: 1: theme name, 2: version number */
+ esc_attr( sprintf( __( 'View %1$s version %2$s details' ), $theme_name, $update['new_version'] ) )
+ ),
+ $update['new_version'],
+ $update_url,
+ sprintf(
+ 'aria-label="%s" id="update-theme" data-slug="%s"',
+ /* translators: %s: theme name */
+ esc_attr( sprintf( __( 'Update %s now' ), $theme_name ) ),
+ $stylesheet
+ )
+ );
+ }
+ }
+ }
+
+ return $html;
+}
+
+/**
+ * Retrieve list of WordPress theme features (aka theme tags).
+ *
+ * @since 3.1.0
+ *
+ * @param bool $api Optional. Whether try to fetch tags from the WordPress.org API. Defaults to true.
+ * @return array Array of features keyed by category with translations keyed by slug.
+ */
+function get_theme_feature_list( $api = true ) {
+ // Hard-coded list is used if api not accessible.
+ $features = array(
+
+ __( 'Subject' ) => array(
+ 'blog' => __( 'Blog' ),
+ 'e-commerce' => __( 'E-Commerce' ),
+ 'education' => __( 'Education' ),
+ 'entertainment' => __( 'Entertainment' ),
+ 'food-and-drink' => __( 'Food & Drink' ),
+ 'holiday' => __( 'Holiday' ),
+ 'news' => __( 'News' ),
+ 'photography' => __( 'Photography' ),
+ 'portfolio' => __( 'Portfolio' ),
+ ),
+
+ __( 'Features' ) => array(
+ 'accessibility-ready' => __( 'Accessibility Ready' ),
+ 'custom-background' => __( 'Custom Background' ),
+ 'custom-colors' => __( 'Custom Colors' ),
+ 'custom-header' => __( 'Custom Header' ),
+ 'custom-logo' => __( 'Custom Logo' ),
+ 'editor-style' => __( 'Editor Style' ),
+ 'featured-image-header' => __( 'Featured Image Header' ),
+ 'featured-images' => __( 'Featured Images' ),
+ 'footer-widgets' => __( 'Footer Widgets' ),
+ 'full-width-template' => __( 'Full Width Template' ),
+ 'post-formats' => __( 'Post Formats' ),
+ 'sticky-post' => __( 'Sticky Post' ),
+ 'theme-options' => __( 'Theme Options' ),
+ ),
+
+ __( 'Layout' ) => array(
+ 'grid-layout' => __( 'Grid Layout' ),
+ 'one-column' => __( 'One Column' ),
+ 'two-columns' => __( 'Two Columns' ),
+ 'three-columns' => __( 'Three Columns' ),
+ 'four-columns' => __( 'Four Columns' ),
+ 'left-sidebar' => __( 'Left Sidebar' ),
+ 'right-sidebar' => __( 'Right Sidebar' ),
+ ),
+
+ );
+
+ if ( ! $api || ! current_user_can( 'install_themes' ) ) {
+ return $features;
+ }
+
+ if ( ! $feature_list = get_site_transient( 'wporg_theme_feature_list' ) ) {
+ set_site_transient( 'wporg_theme_feature_list', array(), 3 * HOUR_IN_SECONDS );
+ }
+
+ if ( ! $feature_list ) {
+ $feature_list = themes_api( 'feature_list', array() );
+ if ( is_wp_error( $feature_list ) ) {
+ return $features;
+ }
+ }
+
+ if ( ! $feature_list ) {
+ return $features;
+ }
+
+ set_site_transient( 'wporg_theme_feature_list', $feature_list, 3 * HOUR_IN_SECONDS );
+
+ $category_translations = array(
+ 'Layout' => __( 'Layout' ),
+ 'Features' => __( 'Features' ),
+ 'Subject' => __( 'Subject' ),
+ );
+
+ // Loop over the wporg canonical list and apply translations
+ $wporg_features = array();
+ foreach ( (array) $feature_list as $feature_category => $feature_items ) {
+ if ( isset( $category_translations[ $feature_category ] ) ) {
+ $feature_category = $category_translations[ $feature_category ];
+ }
+ $wporg_features[ $feature_category ] = array();
+
+ foreach ( $feature_items as $feature ) {
+ if ( isset( $features[ $feature_category ][ $feature ] ) ) {
+ $wporg_features[ $feature_category ][ $feature ] = $features[ $feature_category ][ $feature ];
+ } else {
+ $wporg_features[ $feature_category ][ $feature ] = $feature;
+ }
+ }
+ }
+
+ return $wporg_features;
+}
+
+/**
+ * Retrieves theme installer pages from the WordPress.org Themes API.
+ *
+ * It is possible for a theme to override the Themes API result with three
+ * filters. Assume this is for themes, which can extend on the Theme Info to
+ * offer more choices. This is very powerful and must be used with care, when
+ * overriding the filters.
+ *
+ * The first filter, {@see 'themes_api_args'}, is for the args and gives the action
+ * as the second parameter. The hook for {@see 'themes_api_args'} must ensure that
+ * an object is returned.
+ *
+ * The second filter, {@see 'themes_api'}, allows a plugin to override the WordPress.org
+ * Theme API entirely. If `$action` is 'query_themes', 'theme_information', or 'feature_list',
+ * an object MUST be passed. If `$action` is 'hot_tags', an array should be passed.
+ *
+ * Finally, the third filter, {@see 'themes_api_result'}, makes it possible to filter the
+ * response object or array, depending on the `$action` type.
+ *
+ * Supported arguments per action:
+ *
+ * | Argument Name | 'query_themes' | 'theme_information' | 'hot_tags' | 'feature_list' |
+ * | -------------------| :------------: | :-----------------: | :--------: | :--------------: |
+ * | `$slug` | No | Yes | No | No |
+ * | `$per_page` | Yes | No | No | No |
+ * | `$page` | Yes | No | No | No |
+ * | `$number` | No | No | Yes | No |
+ * | `$search` | Yes | No | No | No |
+ * | `$tag` | Yes | No | No | No |
+ * | `$author` | Yes | No | No | No |
+ * | `$user` | Yes | No | No | No |
+ * | `$browse` | Yes | No | No | No |
+ * | `$locale` | Yes | Yes | No | No |
+ * | `$fields` | Yes | Yes | No | No |
+ *
+ * @since 2.8.0
+ *
+ * @param string $action API action to perform: 'query_themes', 'theme_information',
+ * 'hot_tags' or 'feature_list'.
+ * @param array|object $args {
+ * Optional. Array or object of arguments to serialize for the Themes API.
+ *
+ * @type string $slug The theme slug. Default empty.
+ * @type int $per_page Number of themes per page. Default 24.
+ * @type int $page Number of current page. Default 1.
+ * @type int $number Number of tags to be queried.
+ * @type string $search A search term. Default empty.
+ * @type string $tag Tag to filter themes. Default empty.
+ * @type string $author Username of an author to filter themes. Default empty.
+ * @type string $user Username to query for their favorites. Default empty.
+ * @type string $browse Browse view: 'featured', 'popular', 'updated', 'favorites'.
+ * @type string $locale Locale to provide context-sensitive results. Default is the value of get_locale().
+ * @type array $fields {
+ * Array of fields which should or should not be returned.
+ *
+ * @type bool $description Whether to return the theme full description. Default false.
+ * @type bool $sections Whether to return the theme readme sections: description, installation,
+ * FAQ, screenshots, other notes, and changelog. Default false.
+ * @type bool $rating Whether to return the rating in percent and total number of ratings.
+ * Default false.
+ * @type bool $ratings Whether to return the number of rating for each star (1-5). Default false.
+ * @type bool $downloaded Whether to return the download count. Default false.
+ * @type bool $downloadlink Whether to return the download link for the package. Default false.
+ * @type bool $last_updated Whether to return the date of the last update. Default false.
+ * @type bool $tags Whether to return the assigned tags. Default false.
+ * @type bool $homepage Whether to return the theme homepage link. Default false.
+ * @type bool $screenshots Whether to return the screenshots. Default false.
+ * @type int $screenshot_count Number of screenshots to return. Default 1.
+ * @type bool $screenshot_url Whether to return the URL of the first screenshot. Default false.
+ * @type bool $photon_screenshots Whether to return the screenshots via Photon. Default false.
+ * @type bool $template Whether to return the slug of the parent theme. Default false.
+ * @type bool $parent Whether to return the slug, name and homepage of the parent theme. Default false.
+ * @type bool $versions Whether to return the list of all available versions. Default false.
+ * @type bool $theme_url Whether to return theme's URL. Default false.
+ * @type bool $extended_author Whether to return nicename or nicename and display name. Default false.
+ * }
+ * }
+ * @return object|array|WP_Error Response object or array on success, WP_Error on failure. See the
+ * {@link https://developer.wordpress.org/reference/functions/themes_api/ function reference article}
+ * for more information on the make-up of possible return objects depending on the value of `$action`.
+ */
+function themes_api( $action, $args = array() ) {
+ // include an unmodified $wp_version
+ include( ABSPATH . WPINC . '/version.php' );
+
+ if ( is_array( $args ) ) {
+ $args = (object) $args;
+ }
+
+ if ( 'query_themes' == $action ) {
+ if ( ! isset( $args->per_page ) ) {
+ $args->per_page = 24;
+ }
+ }
+
+ if ( ! isset( $args->locale ) ) {
+ $args->locale = get_user_locale();
+ }
+
+ if ( ! isset( $args->wp_version ) ) {
+ $args->wp_version = substr( $wp_version, 0, 3 ); // X.y
+ }
+
+ /**
+ * Filters arguments used to query for installer pages from the WordPress.org Themes API.
+ *
+ * Important: An object MUST be returned to this filter.
+ *
+ * @since 2.8.0
+ *
+ * @param object $args Arguments used to query for installer pages from the WordPress.org Themes API.
+ * @param string $action Requested action. Likely values are 'theme_information',
+ * 'feature_list', or 'query_themes'.
+ */
+ $args = apply_filters( 'themes_api_args', $args, $action );
+
+ /**
+ * Filters whether to override the WordPress.org Themes API.
+ *
+ * Passing a non-false value will effectively short-circuit the WordPress.org API request.
+ *
+ * If `$action` is 'query_themes', 'theme_information', or 'feature_list', an object MUST
+ * be passed. If `$action` is 'hot_tags', an array should be passed.
+ *
+ * @since 2.8.0
+ *
+ * @param false|object|array $override Whether to override the WordPress.org Themes API. Default false.
+ * @param string $action Requested action. Likely values are 'theme_information',
+ * 'feature_list', or 'query_themes'.
+ * @param object $args Arguments used to query for installer pages from the Themes API.
+ */
+ $res = apply_filters( 'themes_api', false, $action, $args );
+
+ if ( ! $res ) {
+ $url = 'http://api.wordpress.org/themes/info/1.2/';
+ $url = add_query_arg(
+ array(
+ 'action' => $action,
+ 'request' => $args,
+ ),
+ $url
+ );
+
+ $http_url = $url;
+ if ( $ssl = wp_http_supports( array( 'ssl' ) ) ) {
+ $url = set_url_scheme( $url, 'https' );
+ }
+
+ $http_args = array(
+ 'user-agent' => 'WordPress/' . $wp_version . '; ' . home_url( '/' ),
+ );
+ $request = wp_remote_get( $url, $http_args );
+
+ if ( $ssl && is_wp_error( $request ) ) {
+ if ( ! wp_doing_ajax() ) {
+ trigger_error(
+ sprintf(
+ /* translators: %s: support forums URL */
+ __( 'An unexpected error occurred. Something may be wrong with WordPress.org or this server&#8217;s configuration. If you continue to have problems, please try the <a href="%s">support forums</a>.' ),
+ __( 'https://wordpress.org/support/' )
+ ) . ' ' . __( '(WordPress could not establish a secure connection to WordPress.org. Please contact your server administrator.)' ),
+ headers_sent() || WP_DEBUG ? E_USER_WARNING : E_USER_NOTICE
+ );
+ }
+ $request = wp_remote_get( $http_url, $http_args );
+ }
+
+ if ( is_wp_error( $request ) ) {
+ $res = new WP_Error(
+ 'themes_api_failed',
+ sprintf(
+ /* translators: %s: support forums URL */
+ __( 'An unexpected error occurred. Something may be wrong with WordPress.org or this server&#8217;s configuration. If you continue to have problems, please try the <a href="%s">support forums</a>.' ),
+ __( 'https://wordpress.org/support/' )
+ ),
+ $request->get_error_message()
+ );
+ } else {
+ $res = json_decode( wp_remote_retrieve_body( $request ), true );
+ if ( is_array( $res ) ) {
+ // Object casting is required in order to match the info/1.0 format.
+ $res = (object) $res;
+ } elseif ( null === $res ) {
+ $res = new WP_Error(
+ 'themes_api_failed',
+ sprintf(
+ /* translators: %s: support forums URL */
+ __( 'An unexpected error occurred. Something may be wrong with WordPress.org or this server&#8217;s configuration. If you continue to have problems, please try the <a href="%s">support forums</a>.' ),
+ __( 'https://wordpress.org/support/' )
+ ),
+ wp_remote_retrieve_body( $request )
+ );
+ }
+
+ if ( isset( $res->error ) ) {
+ $res = new WP_Error( 'themes_api_failed', $res->error );
+ }
+ }
+
+ // Back-compat for info/1.2 API, upgrade the theme objects in query_themes to objects.
+ if ( 'query_themes' == $action ) {
+ foreach ( $res->themes as $i => $theme ) {
+ $res->themes[ $i ] = (object) $theme;
+ }
+ }
+ // Back-compat for info/1.2 API, downgrade the feature_list result back to an array.
+ if ( 'feature_list' == $action ) {
+ $res = (array) $res;
+ }
+ }
+
+ /**
+ * Filters the returned WordPress.org Themes API response.
+ *
+ * @since 2.8.0
+ *
+ * @param array|object|WP_Error $res WordPress.org Themes API response.
+ * @param string $action Requested action. Likely values are 'theme_information',
+ * 'feature_list', or 'query_themes'.
+ * @param object $args Arguments used to query for installer pages from the WordPress.org Themes API.
+ */
+ return apply_filters( 'themes_api_result', $res, $action, $args );
+}
+
+/**
+ * Prepare themes for JavaScript.
+ *
+ * @since 3.8.0
+ *
+ * @param WP_Theme[] $themes Optional. Array of theme objects to prepare.
+ * Defaults to all allowed themes.
+ *
+ * @return array An associative array of theme data, sorted by name.
+ */
+function wp_prepare_themes_for_js( $themes = null ) {
+ $current_theme = get_stylesheet();
+
+ /**
+ * Filters theme data before it is prepared for JavaScript.
+ *
+ * Passing a non-empty array will result in wp_prepare_themes_for_js() returning
+ * early with that value instead.
+ *
+ * @since 4.2.0
+ *
+ * @param array $prepared_themes An associative array of theme data. Default empty array.
+ * @param WP_Theme[]|null $themes An array of theme objects to prepare, if any.
+ * @param string $current_theme The current theme slug.
+ */
+ $prepared_themes = (array) apply_filters( 'pre_prepare_themes_for_js', array(), $themes, $current_theme );
+
+ if ( ! empty( $prepared_themes ) ) {
+ return $prepared_themes;
+ }
+
+ // Make sure the current theme is listed first.
+ $prepared_themes[ $current_theme ] = array();
+
+ if ( null === $themes ) {
+ $themes = wp_get_themes( array( 'allowed' => true ) );
+ if ( ! isset( $themes[ $current_theme ] ) ) {
+ $themes[ $current_theme ] = wp_get_theme();
+ }
+ }
+
+ $updates = array();
+ if ( current_user_can( 'update_themes' ) ) {
+ $updates_transient = get_site_transient( 'update_themes' );
+ if ( isset( $updates_transient->response ) ) {
+ $updates = $updates_transient->response;
+ }
+ }
+
+ WP_Theme::sort_by_name( $themes );
+
+ $parents = array();
+
+ foreach ( $themes as $theme ) {
+ $slug = $theme->get_stylesheet();
+ $encoded_slug = urlencode( $slug );
+
+ $parent = false;
+ if ( $theme->parent() ) {
+ $parent = $theme->parent();
+ $parents[ $slug ] = $parent->get_stylesheet();
+ $parent = $parent->display( 'Name' );
+ }
+
+ $customize_action = null;
+ if ( current_user_can( 'edit_theme_options' ) && current_user_can( 'customize' ) ) {
+ $customize_action = esc_url(
+ add_query_arg(
+ array(
+ 'return' => urlencode( esc_url_raw( remove_query_arg( wp_removable_query_args(), wp_unslash( $_SERVER['REQUEST_URI'] ) ) ) ),
+ ),
+ wp_customize_url( $slug )
+ )
+ );
+ }
+
+ $prepared_themes[ $slug ] = array(
+ 'id' => $slug,
+ 'name' => $theme->display( 'Name' ),
+ 'screenshot' => array( $theme->get_screenshot() ), // @todo multiple
+ 'description' => $theme->display( 'Description' ),
+ 'author' => $theme->display( 'Author', false, true ),
+ 'authorAndUri' => $theme->display( 'Author' ),
+ 'version' => $theme->display( 'Version' ),
+ 'tags' => $theme->display( 'Tags' ),
+ 'parent' => $parent,
+ 'active' => $slug === $current_theme,
+ 'hasUpdate' => isset( $updates[ $slug ] ),
+ 'hasPackage' => isset( $updates[ $slug ] ) && ! empty( $updates[ $slug ]['package'] ),
+ 'update' => get_theme_update_available( $theme ),
+ 'actions' => array(
+ 'activate' => current_user_can( 'switch_themes' ) ? wp_nonce_url( admin_url( 'themes.php?action=activate&amp;stylesheet=' . $encoded_slug ), 'switch-theme_' . $slug ) : null,
+ 'customize' => $customize_action,
+ 'delete' => current_user_can( 'delete_themes' ) ? wp_nonce_url( admin_url( 'themes.php?action=delete&amp;stylesheet=' . $encoded_slug ), 'delete-theme_' . $slug ) : null,
+ ),
+ );
+ }
+
+ // Remove 'delete' action if theme has an active child
+ if ( ! empty( $parents ) && array_key_exists( $current_theme, $parents ) ) {
+ unset( $prepared_themes[ $parents[ $current_theme ] ]['actions']['delete'] );
+ }
+
+ /**
+ * Filters the themes prepared for JavaScript, for themes.php.
+ *
+ * Could be useful for changing the order, which is by name by default.
+ *
+ * @since 3.8.0
+ *
+ * @param array $prepared_themes Array of themes.
+ */
+ $prepared_themes = apply_filters( 'wp_prepare_themes_for_js', $prepared_themes );
+ $prepared_themes = array_values( $prepared_themes );
+ return array_filter( $prepared_themes );
+}
+
+/**
+ * Print JS templates for the theme-browsing UI in the Customizer.
+ *
+ * @since 4.2.0
+ */
+function customize_themes_print_templates() {
+ ?>
+ <script type="text/html" id="tmpl-customize-themes-details-view">
+ <div class="theme-backdrop"></div>
+ <div class="theme-wrap wp-clearfix" role="document">
+ <div class="theme-header">
+ <button type="button" class="left dashicons dashicons-no"><span class="screen-reader-text"><?php _e( 'Show previous theme' ); ?></span></button>
+ <button type="button" class="right dashicons dashicons-no"><span class="screen-reader-text"><?php _e( 'Show next theme' ); ?></span></button>
+ <button type="button" class="close dashicons dashicons-no"><span class="screen-reader-text"><?php _e( 'Close details dialog' ); ?></span></button>
+ </div>
+ <div class="theme-about wp-clearfix">
+ <div class="theme-screenshots">
+ <# if ( data.screenshot && data.screenshot[0] ) { #>
+ <div class="screenshot"><img src="{{ data.screenshot[0] }}" alt="" /></div>
+ <# } else { #>
+ <div class="screenshot blank"></div>
+ <# } #>
+ </div>
+
+ <div class="theme-info">
+ <# if ( data.active ) { #>
+ <span class="current-label"><?php _e( 'Current Theme' ); ?></span>
+ <# } #>
+ <h2 class="theme-name">{{{ data.name }}}<span class="theme-version"><?php printf( __( 'Version: %s' ), '{{ data.version }}' ); ?></span></h2>
+ <h3 class="theme-author"><?php printf( __( 'By %s' ), '{{{ data.authorAndUri }}}' ); ?></h3>
+
+ <# if ( data.stars && 0 != data.num_ratings ) { #>
+ <div class="theme-rating">
+ {{{ data.stars }}}
+ <a class="num-ratings" target="_blank" href="{{ data.reviews_url }}">
+ <?php
+ printf(
+ '%1$s <span class="screen-reader-text">%2$s</span>',
+ /* translators: %s: number of ratings */
+ sprintf( __( '(%s ratings)' ), '{{ data.num_ratings }}' ),
+ /* translators: accessibility text */
+ __( '(opens in a new tab)' )
+ );
+ ?>
+ </a>
+ </div>
+ <# } #>
+
+ <# if ( data.hasUpdate ) { #>
+ <div class="notice notice-warning notice-alt notice-large" data-slug="{{ data.id }}">
+ <h3 class="notice-title"><?php _e( 'Update Available' ); ?></h3>
+ {{{ data.update }}}
+ </div>
+ <# } #>
+
+ <# if ( data.parent ) { #>
+ <p class="parent-theme"><?php printf( __( 'This is a child theme of %s.' ), '<strong>{{{ data.parent }}}</strong>' ); ?></p>
+ <# } #>
+
+ <p class="theme-description">{{{ data.description }}}</p>
+
+ <# if ( data.tags ) { #>
+ <p class="theme-tags"><span><?php _e( 'Tags:' ); ?></span> {{{ data.tags }}}</p>
+ <# } #>
+ </div>
+ </div>
+
+ <div class="theme-actions">
+ <# if ( data.active ) { #>
+ <button type="button" class="button button-primary customize-theme"><?php _e( 'Customize' ); ?></button>
+ <# } else if ( 'installed' === data.type ) { #>
+ <?php if ( current_user_can( 'delete_themes' ) ) { ?>
+ <# if ( data.actions && data.actions['delete'] ) { #>
+ <a href="{{{ data.actions['delete'] }}}" data-slug="{{ data.id }}" class="button button-secondary delete-theme"><?php _e( 'Delete' ); ?></a>
+ <# } #>
+ <?php } ?>
+ <button type="button" class="button button-primary preview-theme" data-slug="{{ data.id }}"><?php _e( 'Live Preview' ); ?></button>
+ <# } else { #>
+ <button type="button" class="button theme-install" data-slug="{{ data.id }}"><?php _e( 'Install' ); ?></button>
+ <button type="button" class="button button-primary theme-install preview" data-slug="{{ data.id }}"><?php _e( 'Install &amp; Preview' ); ?></button>
+ <# } #>
+ </div>
+ </div>
+ </script>
+ <?php
+}
+
+/**
+ * Determines whether a theme is technically active but was paused while
+ * loading.
+ *
+ * For more information on this and similar theme functions, check out
+ * the {@link https://developer.wordpress.org/themes/basics/conditional-tags/
+ * Conditional Tags} article in the Theme Developer Handbook.
+ *
+ * @since 5.2.0
+ *
+ * @param string $theme Path to the theme directory relative to the themes directory.
+ * @return bool True, if in the list of paused themes. False, not in the list.
+ */
+function is_theme_paused( $theme ) {
+ if ( ! isset( $GLOBALS['_paused_themes'] ) ) {
+ return false;
+ }
+
+ if ( get_stylesheet() !== $theme && get_template() !== $theme ) {
+ return false;
+ }
+
+ return array_key_exists( $theme, $GLOBALS['_paused_themes'] );
+}
+
+/**
+ * Gets the error that was recorded for a paused theme.
+ *
+ * @since 5.2.0
+ *
+ * @param string $theme Path to the theme directory relative to the themes
+ * directory.
+ * @return array|false Array of error information as it was returned by
+ * `error_get_last()`, or false if none was recorded.
+ */
+function wp_get_theme_error( $theme ) {
+ if ( ! isset( $GLOBALS['_paused_themes'] ) ) {
+ return false;
+ }
+
+ if ( ! array_key_exists( $theme, $GLOBALS['_paused_themes'] ) ) {
+ return false;
+ }
+
+ return $GLOBALS['_paused_themes'][ $theme ];
+}
+
+/**
+ * Tries to resume a single theme.
+ *
+ * If a redirect was provided and a functions.php file was found, we first ensure that
+ * functions.php file does not throw fatal errors anymore.
+ *
+ * The way it works is by setting the redirection to the error before trying to
+ * include the file. If the theme fails, then the redirection will not be overwritten
+ * with the success message and the theme will not be resumed.
+ *
+ * @since 5.2.0
+ *
+ * @param string $theme Single theme to resume.
+ * @param string $redirect Optional. URL to redirect to. Default empty string.
+ * @return bool|WP_Error True on success, false if `$theme` was not paused,
+ * `WP_Error` on failure.
+ */
+function resume_theme( $theme, $redirect = '' ) {
+ list( $extension ) = explode( '/', $theme );
+
+ /*
+ * We'll override this later if the theme could be resumed without
+ * creating a fatal error.
+ */
+ if ( ! empty( $redirect ) ) {
+ $functions_path = '';
+ if ( strpos( STYLESHEETPATH, $extension ) ) {
+ $functions_path = STYLESHEETPATH . '/functions.php';
+ } elseif ( strpos( TEMPLATEPATH, $extension ) ) {
+ $functions_path = TEMPLATEPATH . '/functions.php';
+ }
+
+ if ( ! empty( $functions_path ) ) {
+ wp_redirect(
+ add_query_arg(
+ '_error_nonce',
+ wp_create_nonce( 'theme-resume-error_' . $theme ),
+ $redirect
+ )
+ );
+
+ // Load the theme's functions.php to test whether it throws a fatal error.
+ ob_start();
+ if ( ! defined( 'WP_SANDBOX_SCRAPING' ) ) {
+ define( 'WP_SANDBOX_SCRAPING', true );
+ }
+ include $functions_path;
+ ob_clean();
+ }
+ }
+
+ $result = wp_paused_themes()->delete( $extension );
+
+ if ( ! $result ) {
+ return new WP_Error(
+ 'could_not_resume_theme',
+ __( 'Could not resume the theme.' )
+ );
+ }
+
+ return true;
+}
+
+/**
+ * Renders an admin notice in case some themes have been paused due to errors.
+ *
+ * @since 5.2.0
+ */
+function paused_themes_notice() {
+ if ( 'themes.php' === $GLOBALS['pagenow'] ) {
+ return;
+ }
+
+ if ( ! current_user_can( 'resume_themes' ) ) {
+ return;
+ }
+
+ if ( ! isset( $GLOBALS['_paused_themes'] ) || empty( $GLOBALS['_paused_themes'] ) ) {
+ return;
+ }
+
+ printf(
+ '<div class="notice notice-error"><p><strong>%s</strong><br>%s</p><p><a href="%s">%s</a></p></div>',
+ __( 'One or more themes failed to load properly.' ),
+ __( 'You can find more details and make changes on the Themes screen.' ),
+ esc_url( admin_url( 'themes.php' ) ),
+ __( 'Go to the Themes screen' )
+ );
+}
diff --git a/www/crm/wp-admin/includes/translation-install.php b/www/crm/wp-admin/includes/translation-install.php
new file mode 100644
index 00000000..73d27fb1
--- /dev/null
+++ b/www/crm/wp-admin/includes/translation-install.php
@@ -0,0 +1,270 @@
+<?php
+/**
+ * WordPress Translation Installation Administration API
+ *
+ * @package WordPress
+ * @subpackage Administration
+ */
+
+
+/**
+ * Retrieve translations from WordPress Translation API.
+ *
+ * @since 4.0.0
+ *
+ * @param string $type Type of translations. Accepts 'plugins', 'themes', 'core'.
+ * @param array|object $args Translation API arguments. Optional.
+ * @return object|WP_Error On success an object of translations, WP_Error on failure.
+ */
+function translations_api( $type, $args = null ) {
+ include( ABSPATH . WPINC . '/version.php' ); // include an unmodified $wp_version
+
+ if ( ! in_array( $type, array( 'plugins', 'themes', 'core' ) ) ) {
+ return new WP_Error( 'invalid_type', __( 'Invalid translation type.' ) );
+ }
+
+ /**
+ * Allows a plugin to override the WordPress.org Translation Installation API entirely.
+ *
+ * @since 4.0.0
+ *
+ * @param bool|array $result The result object. Default false.
+ * @param string $type The type of translations being requested.
+ * @param object $args Translation API arguments.
+ */
+ $res = apply_filters( 'translations_api', false, $type, $args );
+
+ if ( false === $res ) {
+ $url = $http_url = 'http://api.wordpress.org/translations/' . $type . '/1.0/';
+ if ( $ssl = wp_http_supports( array( 'ssl' ) ) ) {
+ $url = set_url_scheme( $url, 'https' );
+ }
+
+ $options = array(
+ 'timeout' => 3,
+ 'body' => array(
+ 'wp_version' => $wp_version,
+ 'locale' => get_locale(),
+ 'version' => $args['version'], // Version of plugin, theme or core
+ ),
+ );
+
+ if ( 'core' !== $type ) {
+ $options['body']['slug'] = $args['slug']; // Plugin or theme slug
+ }
+
+ $request = wp_remote_post( $url, $options );
+
+ if ( $ssl && is_wp_error( $request ) ) {
+ trigger_error(
+ sprintf(
+ /* translators: %s: support forums URL */
+ __( 'An unexpected error occurred. Something may be wrong with WordPress.org or this server&#8217;s configuration. If you continue to have problems, please try the <a href="%s">support forums</a>.' ),
+ __( 'https://wordpress.org/support/' )
+ ) . ' ' . __( '(WordPress could not establish a secure connection to WordPress.org. Please contact your server administrator.)' ),
+ headers_sent() || WP_DEBUG ? E_USER_WARNING : E_USER_NOTICE
+ );
+
+ $request = wp_remote_post( $http_url, $options );
+ }
+
+ if ( is_wp_error( $request ) ) {
+ $res = new WP_Error(
+ 'translations_api_failed',
+ sprintf(
+ /* translators: %s: support forums URL */
+ __( 'An unexpected error occurred. Something may be wrong with WordPress.org or this server&#8217;s configuration. If you continue to have problems, please try the <a href="%s">support forums</a>.' ),
+ __( 'https://wordpress.org/support/' )
+ ),
+ $request->get_error_message()
+ );
+ } else {
+ $res = json_decode( wp_remote_retrieve_body( $request ), true );
+ if ( ! is_object( $res ) && ! is_array( $res ) ) {
+ $res = new WP_Error(
+ 'translations_api_failed',
+ sprintf(
+ /* translators: %s: support forums URL */
+ __( 'An unexpected error occurred. Something may be wrong with WordPress.org or this server&#8217;s configuration. If you continue to have problems, please try the <a href="%s">support forums</a>.' ),
+ __( 'https://wordpress.org/support/' )
+ ),
+ wp_remote_retrieve_body( $request )
+ );
+ }
+ }
+ }
+
+ /**
+ * Filters the Translation Installation API response results.
+ *
+ * @since 4.0.0
+ *
+ * @param object|WP_Error $res Response object or WP_Error.
+ * @param string $type The type of translations being requested.
+ * @param object $args Translation API arguments.
+ */
+ return apply_filters( 'translations_api_result', $res, $type, $args );
+}
+
+/**
+ * Get available translations from the WordPress.org API.
+ *
+ * @since 4.0.0
+ *
+ * @see translations_api()
+ *
+ * @return array Array of translations, each an array of data. If the API response results
+ * in an error, an empty array will be returned.
+ */
+function wp_get_available_translations() {
+ if ( ! wp_installing() && false !== ( $translations = get_site_transient( 'available_translations' ) ) ) {
+ return $translations;
+ }
+
+ include( ABSPATH . WPINC . '/version.php' ); // include an unmodified $wp_version
+
+ $api = translations_api( 'core', array( 'version' => $wp_version ) );
+
+ if ( is_wp_error( $api ) || empty( $api['translations'] ) ) {
+ return array();
+ }
+
+ $translations = array();
+ // Key the array with the language code for now.
+ foreach ( $api['translations'] as $translation ) {
+ $translations[ $translation['language'] ] = $translation;
+ }
+
+ if ( ! defined( 'WP_INSTALLING' ) ) {
+ set_site_transient( 'available_translations', $translations, 3 * HOUR_IN_SECONDS );
+ }
+
+ return $translations;
+}
+
+/**
+ * Output the select form for the language selection on the installation screen.
+ *
+ * @since 4.0.0
+ *
+ * @global string $wp_local_package
+ *
+ * @param array $languages Array of available languages (populated via the Translation API).
+ */
+function wp_install_language_form( $languages ) {
+ global $wp_local_package;
+
+ $installed_languages = get_available_languages();
+
+ echo "<label class='screen-reader-text' for='language'>Select a default language</label>\n";
+ echo "<select size='14' name='language' id='language'>\n";
+ echo '<option value="" lang="en" selected="selected" data-continue="Continue" data-installed="1">English (United States)</option>';
+ echo "\n";
+
+ if ( ! empty( $wp_local_package ) && isset( $languages[ $wp_local_package ] ) ) {
+ if ( isset( $languages[ $wp_local_package ] ) ) {
+ $language = $languages[ $wp_local_package ];
+ printf(
+ '<option value="%s" lang="%s" data-continue="%s"%s>%s</option>' . "\n",
+ esc_attr( $language['language'] ),
+ esc_attr( current( $language['iso'] ) ),
+ esc_attr( $language['strings']['continue'] ),
+ in_array( $language['language'], $installed_languages ) ? ' data-installed="1"' : '',
+ esc_html( $language['native_name'] )
+ );
+
+ unset( $languages[ $wp_local_package ] );
+ }
+ }
+
+ foreach ( $languages as $language ) {
+ printf(
+ '<option value="%s" lang="%s" data-continue="%s"%s>%s</option>' . "\n",
+ esc_attr( $language['language'] ),
+ esc_attr( current( $language['iso'] ) ),
+ esc_attr( $language['strings']['continue'] ),
+ in_array( $language['language'], $installed_languages ) ? ' data-installed="1"' : '',
+ esc_html( $language['native_name'] )
+ );
+ }
+ echo "</select>\n";
+ echo '<p class="step"><span class="spinner"></span><input id="language-continue" type="submit" class="button button-primary button-large" value="Continue" /></p>';
+}
+
+/**
+ * Download a language pack.
+ *
+ * @since 4.0.0
+ *
+ * @see wp_get_available_translations()
+ *
+ * @param string $download Language code to download.
+ * @return string|bool Returns the language code if successfully downloaded
+ * (or already installed), or false on failure.
+ */
+function wp_download_language_pack( $download ) {
+ // Check if the translation is already installed.
+ if ( in_array( $download, get_available_languages() ) ) {
+ return $download;
+ }
+
+ if ( ! wp_is_file_mod_allowed( 'download_language_pack' ) ) {
+ return false;
+ }
+
+ // Confirm the translation is one we can download.
+ $translations = wp_get_available_translations();
+ if ( ! $translations ) {
+ return false;
+ }
+ foreach ( $translations as $translation ) {
+ if ( $translation['language'] === $download ) {
+ $translation_to_load = true;
+ break;
+ }
+ }
+
+ if ( empty( $translation_to_load ) ) {
+ return false;
+ }
+ $translation = (object) $translation;
+
+ require_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';
+ $skin = new Automatic_Upgrader_Skin;
+ $upgrader = new Language_Pack_Upgrader( $skin );
+ $translation->type = 'core';
+ $result = $upgrader->upgrade( $translation, array( 'clear_update_cache' => false ) );
+
+ if ( ! $result || is_wp_error( $result ) ) {
+ return false;
+ }
+
+ return $translation->language;
+}
+
+/**
+ * Check if WordPress has access to the filesystem without asking for
+ * credentials.
+ *
+ * @since 4.0.0
+ *
+ * @return bool Returns true on success, false on failure.
+ */
+function wp_can_install_language_pack() {
+ if ( ! wp_is_file_mod_allowed( 'can_install_language_pack' ) ) {
+ return false;
+ }
+
+ require_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';
+ $skin = new Automatic_Upgrader_Skin;
+ $upgrader = new Language_Pack_Upgrader( $skin );
+ $upgrader->init();
+
+ $check = $upgrader->fs_connect( array( WP_CONTENT_DIR, WP_LANG_DIR ) );
+
+ if ( ! $check || is_wp_error( $check ) ) {
+ return false;
+ }
+
+ return true;
+}
diff --git a/www/crm/wp-admin/includes/update-core.php b/www/crm/wp-admin/includes/update-core.php
new file mode 100644
index 00000000..d1282fa6
--- /dev/null
+++ b/www/crm/wp-admin/includes/update-core.php
@@ -0,0 +1,1448 @@
+<?php
+/**
+ * WordPress core upgrade functionality.
+ *
+ * @package WordPress
+ * @subpackage Administration
+ * @since 2.7.0
+ */
+
+/**
+ * Stores files to be deleted.
+ *
+ * @since 2.7.0
+ * @global array $_old_files
+ * @var array
+ * @name $_old_files
+ */
+global $_old_files;
+
+$_old_files = array(
+ // 2.0
+ 'wp-admin/import-b2.php',
+ 'wp-admin/import-blogger.php',
+ 'wp-admin/import-greymatter.php',
+ 'wp-admin/import-livejournal.php',
+ 'wp-admin/import-mt.php',
+ 'wp-admin/import-rss.php',
+ 'wp-admin/import-textpattern.php',
+ 'wp-admin/quicktags.js',
+ 'wp-images/fade-butt.png',
+ 'wp-images/get-firefox.png',
+ 'wp-images/header-shadow.png',
+ 'wp-images/smilies',
+ 'wp-images/wp-small.png',
+ 'wp-images/wpminilogo.png',
+ 'wp.php',
+ // 2.0.8
+ 'wp-includes/js/tinymce/plugins/inlinepopups/readme.txt',
+ // 2.1
+ 'wp-admin/edit-form-ajax-cat.php',
+ 'wp-admin/execute-pings.php',
+ 'wp-admin/inline-uploading.php',
+ 'wp-admin/link-categories.php',
+ 'wp-admin/list-manipulation.js',
+ 'wp-admin/list-manipulation.php',
+ 'wp-includes/comment-functions.php',
+ 'wp-includes/feed-functions.php',
+ 'wp-includes/functions-compat.php',
+ 'wp-includes/functions-formatting.php',
+ 'wp-includes/functions-post.php',
+ 'wp-includes/js/dbx-key.js',
+ 'wp-includes/js/tinymce/plugins/autosave/langs/cs.js',
+ 'wp-includes/js/tinymce/plugins/autosave/langs/sv.js',
+ 'wp-includes/links.php',
+ 'wp-includes/pluggable-functions.php',
+ 'wp-includes/template-functions-author.php',
+ 'wp-includes/template-functions-category.php',
+ 'wp-includes/template-functions-general.php',
+ 'wp-includes/template-functions-links.php',
+ 'wp-includes/template-functions-post.php',
+ 'wp-includes/wp-l10n.php',
+ // 2.2
+ 'wp-admin/cat-js.php',
+ 'wp-admin/import/b2.php',
+ 'wp-includes/js/autosave-js.php',
+ 'wp-includes/js/list-manipulation-js.php',
+ 'wp-includes/js/wp-ajax-js.php',
+ // 2.3
+ 'wp-admin/admin-db.php',
+ 'wp-admin/cat.js',
+ 'wp-admin/categories.js',
+ 'wp-admin/custom-fields.js',
+ 'wp-admin/dbx-admin-key.js',
+ 'wp-admin/edit-comments.js',
+ 'wp-admin/install-rtl.css',
+ 'wp-admin/install.css',
+ 'wp-admin/upgrade-schema.php',
+ 'wp-admin/upload-functions.php',
+ 'wp-admin/upload-rtl.css',
+ 'wp-admin/upload.css',
+ 'wp-admin/upload.js',
+ 'wp-admin/users.js',
+ 'wp-admin/widgets-rtl.css',
+ 'wp-admin/widgets.css',
+ 'wp-admin/xfn.js',
+ 'wp-includes/js/tinymce/license.html',
+ // 2.5
+ 'wp-admin/css/upload.css',
+ 'wp-admin/images/box-bg-left.gif',
+ 'wp-admin/images/box-bg-right.gif',
+ 'wp-admin/images/box-bg.gif',
+ 'wp-admin/images/box-butt-left.gif',
+ 'wp-admin/images/box-butt-right.gif',
+ 'wp-admin/images/box-butt.gif',
+ 'wp-admin/images/box-head-left.gif',
+ 'wp-admin/images/box-head-right.gif',
+ 'wp-admin/images/box-head.gif',
+ 'wp-admin/images/heading-bg.gif',
+ 'wp-admin/images/login-bkg-bottom.gif',
+ 'wp-admin/images/login-bkg-tile.gif',
+ 'wp-admin/images/notice.gif',
+ 'wp-admin/images/toggle.gif',
+ 'wp-admin/includes/upload.php',
+ 'wp-admin/js/dbx-admin-key.js',
+ 'wp-admin/js/link-cat.js',
+ 'wp-admin/profile-update.php',
+ 'wp-admin/templates.php',
+ 'wp-includes/images/wlw/WpComments.png',
+ 'wp-includes/images/wlw/WpIcon.png',
+ 'wp-includes/images/wlw/WpWatermark.png',
+ 'wp-includes/js/dbx.js',
+ 'wp-includes/js/fat.js',
+ 'wp-includes/js/list-manipulation.js',
+ 'wp-includes/js/tinymce/langs/en.js',
+ 'wp-includes/js/tinymce/plugins/autosave/editor_plugin_src.js',
+ 'wp-includes/js/tinymce/plugins/autosave/langs',
+ 'wp-includes/js/tinymce/plugins/directionality/images',
+ 'wp-includes/js/tinymce/plugins/directionality/langs',
+ 'wp-includes/js/tinymce/plugins/inlinepopups/css',
+ 'wp-includes/js/tinymce/plugins/inlinepopups/images',
+ 'wp-includes/js/tinymce/plugins/inlinepopups/jscripts',
+ 'wp-includes/js/tinymce/plugins/paste/images',
+ 'wp-includes/js/tinymce/plugins/paste/jscripts',
+ 'wp-includes/js/tinymce/plugins/paste/langs',
+ 'wp-includes/js/tinymce/plugins/spellchecker/classes/HttpClient.class.php',
+ 'wp-includes/js/tinymce/plugins/spellchecker/classes/TinyGoogleSpell.class.php',
+ 'wp-includes/js/tinymce/plugins/spellchecker/classes/TinyPspell.class.php',
+ 'wp-includes/js/tinymce/plugins/spellchecker/classes/TinyPspellShell.class.php',
+ 'wp-includes/js/tinymce/plugins/spellchecker/css/spellchecker.css',
+ 'wp-includes/js/tinymce/plugins/spellchecker/images',
+ 'wp-includes/js/tinymce/plugins/spellchecker/langs',
+ 'wp-includes/js/tinymce/plugins/spellchecker/tinyspell.php',
+ 'wp-includes/js/tinymce/plugins/wordpress/images',
+ 'wp-includes/js/tinymce/plugins/wordpress/langs',
+ 'wp-includes/js/tinymce/plugins/wordpress/wordpress.css',
+ 'wp-includes/js/tinymce/plugins/wphelp',
+ 'wp-includes/js/tinymce/themes/advanced/css',
+ 'wp-includes/js/tinymce/themes/advanced/images',
+ 'wp-includes/js/tinymce/themes/advanced/jscripts',
+ 'wp-includes/js/tinymce/themes/advanced/langs',
+ // 2.5.1
+ 'wp-includes/js/tinymce/tiny_mce_gzip.php',
+ // 2.6
+ 'wp-admin/bookmarklet.php',
+ 'wp-includes/js/jquery/jquery.dimensions.min.js',
+ 'wp-includes/js/tinymce/plugins/wordpress/popups.css',
+ 'wp-includes/js/wp-ajax.js',
+ // 2.7
+ 'wp-admin/css/press-this-ie-rtl.css',
+ 'wp-admin/css/press-this-ie.css',
+ 'wp-admin/css/upload-rtl.css',
+ 'wp-admin/edit-form.php',
+ 'wp-admin/images/comment-pill.gif',
+ 'wp-admin/images/comment-stalk-classic.gif',
+ 'wp-admin/images/comment-stalk-fresh.gif',
+ 'wp-admin/images/comment-stalk-rtl.gif',
+ 'wp-admin/images/del.png',
+ 'wp-admin/images/gear.png',
+ 'wp-admin/images/media-button-gallery.gif',
+ 'wp-admin/images/media-buttons.gif',
+ 'wp-admin/images/postbox-bg.gif',
+ 'wp-admin/images/tab.png',
+ 'wp-admin/images/tail.gif',
+ 'wp-admin/js/forms.js',
+ 'wp-admin/js/upload.js',
+ 'wp-admin/link-import.php',
+ 'wp-includes/images/audio.png',
+ 'wp-includes/images/css.png',
+ 'wp-includes/images/default.png',
+ 'wp-includes/images/doc.png',
+ 'wp-includes/images/exe.png',
+ 'wp-includes/images/html.png',
+ 'wp-includes/images/js.png',
+ 'wp-includes/images/pdf.png',
+ 'wp-includes/images/swf.png',
+ 'wp-includes/images/tar.png',
+ 'wp-includes/images/text.png',
+ 'wp-includes/images/video.png',
+ 'wp-includes/images/zip.png',
+ 'wp-includes/js/tinymce/tiny_mce_config.php',
+ 'wp-includes/js/tinymce/tiny_mce_ext.js',
+ // 2.8
+ 'wp-admin/js/users.js',
+ 'wp-includes/js/swfupload/plugins/swfupload.documentready.js',
+ 'wp-includes/js/swfupload/plugins/swfupload.graceful_degradation.js',
+ 'wp-includes/js/swfupload/swfupload_f9.swf',
+ 'wp-includes/js/tinymce/plugins/autosave',
+ 'wp-includes/js/tinymce/plugins/paste/css',
+ 'wp-includes/js/tinymce/utils/mclayer.js',
+ 'wp-includes/js/tinymce/wordpress.css',
+ // 2.8.5
+ 'wp-admin/import/btt.php',
+ 'wp-admin/import/jkw.php',
+ // 2.9
+ 'wp-admin/js/page.dev.js',
+ 'wp-admin/js/page.js',
+ 'wp-admin/js/set-post-thumbnail-handler.dev.js',
+ 'wp-admin/js/set-post-thumbnail-handler.js',
+ 'wp-admin/js/slug.dev.js',
+ 'wp-admin/js/slug.js',
+ 'wp-includes/gettext.php',
+ 'wp-includes/js/tinymce/plugins/wordpress/js',
+ 'wp-includes/streams.php',
+ // MU
+ 'README.txt',
+ 'htaccess.dist',
+ 'index-install.php',
+ 'wp-admin/css/mu-rtl.css',
+ 'wp-admin/css/mu.css',
+ 'wp-admin/images/site-admin.png',
+ 'wp-admin/includes/mu.php',
+ 'wp-admin/wpmu-admin.php',
+ 'wp-admin/wpmu-blogs.php',
+ 'wp-admin/wpmu-edit.php',
+ 'wp-admin/wpmu-options.php',
+ 'wp-admin/wpmu-themes.php',
+ 'wp-admin/wpmu-upgrade-site.php',
+ 'wp-admin/wpmu-users.php',
+ 'wp-includes/images/wordpress-mu.png',
+ 'wp-includes/wpmu-default-filters.php',
+ 'wp-includes/wpmu-functions.php',
+ 'wpmu-settings.php',
+ // 3.0
+ 'wp-admin/categories.php',
+ 'wp-admin/edit-category-form.php',
+ 'wp-admin/edit-page-form.php',
+ 'wp-admin/edit-pages.php',
+ 'wp-admin/images/admin-header-footer.png',
+ 'wp-admin/images/browse-happy.gif',
+ 'wp-admin/images/ico-add.png',
+ 'wp-admin/images/ico-close.png',
+ 'wp-admin/images/ico-edit.png',
+ 'wp-admin/images/ico-viewpage.png',
+ 'wp-admin/images/fav-top.png',
+ 'wp-admin/images/screen-options-left.gif',
+ 'wp-admin/images/wp-logo-vs.gif',
+ 'wp-admin/images/wp-logo.gif',
+ 'wp-admin/import',
+ 'wp-admin/js/wp-gears.dev.js',
+ 'wp-admin/js/wp-gears.js',
+ 'wp-admin/options-misc.php',
+ 'wp-admin/page-new.php',
+ 'wp-admin/page.php',
+ 'wp-admin/rtl.css',
+ 'wp-admin/rtl.dev.css',
+ 'wp-admin/update-links.php',
+ 'wp-admin/wp-admin.css',
+ 'wp-admin/wp-admin.dev.css',
+ 'wp-includes/js/codepress',
+ 'wp-includes/js/codepress/engines/khtml.js',
+ 'wp-includes/js/codepress/engines/older.js',
+ 'wp-includes/js/jquery/autocomplete.dev.js',
+ 'wp-includes/js/jquery/autocomplete.js',
+ 'wp-includes/js/jquery/interface.js',
+ 'wp-includes/js/scriptaculous/prototype.js',
+ // Following file added back in 5.1 see #45645
+ //'wp-includes/js/tinymce/wp-tinymce.js',
+ // 3.1
+ 'wp-admin/edit-attachment-rows.php',
+ 'wp-admin/edit-link-categories.php',
+ 'wp-admin/edit-link-category-form.php',
+ 'wp-admin/edit-post-rows.php',
+ 'wp-admin/images/button-grad-active-vs.png',
+ 'wp-admin/images/button-grad-vs.png',
+ 'wp-admin/images/fav-arrow-vs-rtl.gif',
+ 'wp-admin/images/fav-arrow-vs.gif',
+ 'wp-admin/images/fav-top-vs.gif',
+ 'wp-admin/images/list-vs.png',
+ 'wp-admin/images/screen-options-right-up.gif',
+ 'wp-admin/images/screen-options-right.gif',
+ 'wp-admin/images/visit-site-button-grad-vs.gif',
+ 'wp-admin/images/visit-site-button-grad.gif',
+ 'wp-admin/link-category.php',
+ 'wp-admin/sidebar.php',
+ 'wp-includes/classes.php',
+ 'wp-includes/js/tinymce/blank.htm',
+ 'wp-includes/js/tinymce/plugins/media/css/content.css',
+ 'wp-includes/js/tinymce/plugins/media/img',
+ 'wp-includes/js/tinymce/plugins/safari',
+ // 3.2
+ 'wp-admin/images/logo-login.gif',
+ 'wp-admin/images/star.gif',
+ 'wp-admin/js/list-table.dev.js',
+ 'wp-admin/js/list-table.js',
+ 'wp-includes/default-embeds.php',
+ 'wp-includes/js/tinymce/plugins/wordpress/img/help.gif',
+ 'wp-includes/js/tinymce/plugins/wordpress/img/more.gif',
+ 'wp-includes/js/tinymce/plugins/wordpress/img/toolbars.gif',
+ 'wp-includes/js/tinymce/themes/advanced/img/fm.gif',
+ 'wp-includes/js/tinymce/themes/advanced/img/sflogo.png',
+ // 3.3
+ 'wp-admin/css/colors-classic-rtl.css',
+ 'wp-admin/css/colors-classic-rtl.dev.css',
+ 'wp-admin/css/colors-fresh-rtl.css',
+ 'wp-admin/css/colors-fresh-rtl.dev.css',
+ 'wp-admin/css/dashboard-rtl.dev.css',
+ 'wp-admin/css/dashboard.dev.css',
+ 'wp-admin/css/global-rtl.css',
+ 'wp-admin/css/global-rtl.dev.css',
+ 'wp-admin/css/global.css',
+ 'wp-admin/css/global.dev.css',
+ 'wp-admin/css/install-rtl.dev.css',
+ 'wp-admin/css/login-rtl.dev.css',
+ 'wp-admin/css/login.dev.css',
+ 'wp-admin/css/ms.css',
+ 'wp-admin/css/ms.dev.css',
+ 'wp-admin/css/nav-menu-rtl.css',
+ 'wp-admin/css/nav-menu-rtl.dev.css',
+ 'wp-admin/css/nav-menu.css',
+ 'wp-admin/css/nav-menu.dev.css',
+ 'wp-admin/css/plugin-install-rtl.css',
+ 'wp-admin/css/plugin-install-rtl.dev.css',
+ 'wp-admin/css/plugin-install.css',
+ 'wp-admin/css/plugin-install.dev.css',
+ 'wp-admin/css/press-this-rtl.dev.css',
+ 'wp-admin/css/press-this.dev.css',
+ 'wp-admin/css/theme-editor-rtl.css',
+ 'wp-admin/css/theme-editor-rtl.dev.css',
+ 'wp-admin/css/theme-editor.css',
+ 'wp-admin/css/theme-editor.dev.css',
+ 'wp-admin/css/theme-install-rtl.css',
+ 'wp-admin/css/theme-install-rtl.dev.css',
+ 'wp-admin/css/theme-install.css',
+ 'wp-admin/css/theme-install.dev.css',
+ 'wp-admin/css/widgets-rtl.dev.css',
+ 'wp-admin/css/widgets.dev.css',
+ 'wp-admin/includes/internal-linking.php',
+ 'wp-includes/images/admin-bar-sprite-rtl.png',
+ 'wp-includes/js/jquery/ui.button.js',
+ 'wp-includes/js/jquery/ui.core.js',
+ 'wp-includes/js/jquery/ui.dialog.js',
+ 'wp-includes/js/jquery/ui.draggable.js',
+ 'wp-includes/js/jquery/ui.droppable.js',
+ 'wp-includes/js/jquery/ui.mouse.js',
+ 'wp-includes/js/jquery/ui.position.js',
+ 'wp-includes/js/jquery/ui.resizable.js',
+ 'wp-includes/js/jquery/ui.selectable.js',
+ 'wp-includes/js/jquery/ui.sortable.js',
+ 'wp-includes/js/jquery/ui.tabs.js',
+ 'wp-includes/js/jquery/ui.widget.js',
+ 'wp-includes/js/l10n.dev.js',
+ 'wp-includes/js/l10n.js',
+ 'wp-includes/js/tinymce/plugins/wplink/css',
+ 'wp-includes/js/tinymce/plugins/wplink/img',
+ 'wp-includes/js/tinymce/plugins/wplink/js',
+ 'wp-includes/js/tinymce/themes/advanced/img/wpicons.png',
+ 'wp-includes/js/tinymce/themes/advanced/skins/wp_theme/img/butt2.png',
+ 'wp-includes/js/tinymce/themes/advanced/skins/wp_theme/img/button_bg.png',
+ 'wp-includes/js/tinymce/themes/advanced/skins/wp_theme/img/down_arrow.gif',
+ 'wp-includes/js/tinymce/themes/advanced/skins/wp_theme/img/fade-butt.png',
+ 'wp-includes/js/tinymce/themes/advanced/skins/wp_theme/img/separator.gif',
+ // Don't delete, yet: 'wp-rss.php',
+ // Don't delete, yet: 'wp-rdf.php',
+ // Don't delete, yet: 'wp-rss2.php',
+ // Don't delete, yet: 'wp-commentsrss2.php',
+ // Don't delete, yet: 'wp-atom.php',
+ // Don't delete, yet: 'wp-feed.php',
+ // 3.4
+ 'wp-admin/images/gray-star.png',
+ 'wp-admin/images/logo-login.png',
+ 'wp-admin/images/star.png',
+ 'wp-admin/index-extra.php',
+ 'wp-admin/network/index-extra.php',
+ 'wp-admin/user/index-extra.php',
+ 'wp-admin/images/screenshots/admin-flyouts.png',
+ 'wp-admin/images/screenshots/coediting.png',
+ 'wp-admin/images/screenshots/drag-and-drop.png',
+ 'wp-admin/images/screenshots/help-screen.png',
+ 'wp-admin/images/screenshots/media-icon.png',
+ 'wp-admin/images/screenshots/new-feature-pointer.png',
+ 'wp-admin/images/screenshots/welcome-screen.png',
+ 'wp-includes/css/editor-buttons.css',
+ 'wp-includes/css/editor-buttons.dev.css',
+ 'wp-includes/js/tinymce/plugins/paste/blank.htm',
+ 'wp-includes/js/tinymce/plugins/wordpress/css',
+ 'wp-includes/js/tinymce/plugins/wordpress/editor_plugin.dev.js',
+ 'wp-includes/js/tinymce/plugins/wordpress/img/embedded.png',
+ 'wp-includes/js/tinymce/plugins/wordpress/img/more_bug.gif',
+ 'wp-includes/js/tinymce/plugins/wordpress/img/page_bug.gif',
+ 'wp-includes/js/tinymce/plugins/wpdialogs/editor_plugin.dev.js',
+ 'wp-includes/js/tinymce/plugins/wpeditimage/css/editimage-rtl.css',
+ 'wp-includes/js/tinymce/plugins/wpeditimage/editor_plugin.dev.js',
+ 'wp-includes/js/tinymce/plugins/wpfullscreen/editor_plugin.dev.js',
+ 'wp-includes/js/tinymce/plugins/wpgallery/editor_plugin.dev.js',
+ 'wp-includes/js/tinymce/plugins/wpgallery/img/gallery.png',
+ 'wp-includes/js/tinymce/plugins/wplink/editor_plugin.dev.js',
+ // Don't delete, yet: 'wp-pass.php',
+ // Don't delete, yet: 'wp-register.php',
+ // 3.5
+ 'wp-admin/gears-manifest.php',
+ 'wp-admin/includes/manifest.php',
+ 'wp-admin/images/archive-link.png',
+ 'wp-admin/images/blue-grad.png',
+ 'wp-admin/images/button-grad-active.png',
+ 'wp-admin/images/button-grad.png',
+ 'wp-admin/images/ed-bg-vs.gif',
+ 'wp-admin/images/ed-bg.gif',
+ 'wp-admin/images/fade-butt.png',
+ 'wp-admin/images/fav-arrow-rtl.gif',
+ 'wp-admin/images/fav-arrow.gif',
+ 'wp-admin/images/fav-vs.png',
+ 'wp-admin/images/fav.png',
+ 'wp-admin/images/gray-grad.png',
+ 'wp-admin/images/loading-publish.gif',
+ 'wp-admin/images/logo-ghost.png',
+ 'wp-admin/images/logo.gif',
+ 'wp-admin/images/menu-arrow-frame-rtl.png',
+ 'wp-admin/images/menu-arrow-frame.png',
+ 'wp-admin/images/menu-arrows.gif',
+ 'wp-admin/images/menu-bits-rtl-vs.gif',
+ 'wp-admin/images/menu-bits-rtl.gif',
+ 'wp-admin/images/menu-bits-vs.gif',
+ 'wp-admin/images/menu-bits.gif',
+ 'wp-admin/images/menu-dark-rtl-vs.gif',
+ 'wp-admin/images/menu-dark-rtl.gif',
+ 'wp-admin/images/menu-dark-vs.gif',
+ 'wp-admin/images/menu-dark.gif',
+ 'wp-admin/images/required.gif',
+ 'wp-admin/images/screen-options-toggle-vs.gif',
+ 'wp-admin/images/screen-options-toggle.gif',
+ 'wp-admin/images/toggle-arrow-rtl.gif',
+ 'wp-admin/images/toggle-arrow.gif',
+ 'wp-admin/images/upload-classic.png',
+ 'wp-admin/images/upload-fresh.png',
+ 'wp-admin/images/white-grad-active.png',
+ 'wp-admin/images/white-grad.png',
+ 'wp-admin/images/widgets-arrow-vs.gif',
+ 'wp-admin/images/widgets-arrow.gif',
+ 'wp-admin/images/wpspin_dark.gif',
+ 'wp-includes/images/upload.png',
+ 'wp-includes/js/prototype.js',
+ 'wp-includes/js/scriptaculous',
+ 'wp-admin/css/wp-admin-rtl.dev.css',
+ 'wp-admin/css/wp-admin.dev.css',
+ 'wp-admin/css/media-rtl.dev.css',
+ 'wp-admin/css/media.dev.css',
+ 'wp-admin/css/colors-classic.dev.css',
+ 'wp-admin/css/customize-controls-rtl.dev.css',
+ 'wp-admin/css/customize-controls.dev.css',
+ 'wp-admin/css/ie-rtl.dev.css',
+ 'wp-admin/css/ie.dev.css',
+ 'wp-admin/css/install.dev.css',
+ 'wp-admin/css/colors-fresh.dev.css',
+ 'wp-includes/js/customize-base.dev.js',
+ 'wp-includes/js/json2.dev.js',
+ 'wp-includes/js/comment-reply.dev.js',
+ 'wp-includes/js/customize-preview.dev.js',
+ 'wp-includes/js/wplink.dev.js',
+ 'wp-includes/js/tw-sack.dev.js',
+ 'wp-includes/js/wp-list-revisions.dev.js',
+ 'wp-includes/js/autosave.dev.js',
+ 'wp-includes/js/admin-bar.dev.js',
+ 'wp-includes/js/quicktags.dev.js',
+ 'wp-includes/js/wp-ajax-response.dev.js',
+ 'wp-includes/js/wp-pointer.dev.js',
+ 'wp-includes/js/hoverIntent.dev.js',
+ 'wp-includes/js/colorpicker.dev.js',
+ 'wp-includes/js/wp-lists.dev.js',
+ 'wp-includes/js/customize-loader.dev.js',
+ 'wp-includes/js/jquery/jquery.table-hotkeys.dev.js',
+ 'wp-includes/js/jquery/jquery.color.dev.js',
+ 'wp-includes/js/jquery/jquery.color.js',
+ 'wp-includes/js/jquery/jquery.hotkeys.dev.js',
+ 'wp-includes/js/jquery/jquery.form.dev.js',
+ 'wp-includes/js/jquery/suggest.dev.js',
+ 'wp-admin/js/xfn.dev.js',
+ 'wp-admin/js/set-post-thumbnail.dev.js',
+ 'wp-admin/js/comment.dev.js',
+ 'wp-admin/js/theme.dev.js',
+ 'wp-admin/js/cat.dev.js',
+ 'wp-admin/js/password-strength-meter.dev.js',
+ 'wp-admin/js/user-profile.dev.js',
+ 'wp-admin/js/theme-preview.dev.js',
+ 'wp-admin/js/post.dev.js',
+ 'wp-admin/js/media-upload.dev.js',
+ 'wp-admin/js/word-count.dev.js',
+ 'wp-admin/js/plugin-install.dev.js',
+ 'wp-admin/js/edit-comments.dev.js',
+ 'wp-admin/js/media-gallery.dev.js',
+ 'wp-admin/js/custom-fields.dev.js',
+ 'wp-admin/js/custom-background.dev.js',
+ 'wp-admin/js/common.dev.js',
+ 'wp-admin/js/inline-edit-tax.dev.js',
+ 'wp-admin/js/gallery.dev.js',
+ 'wp-admin/js/utils.dev.js',
+ 'wp-admin/js/widgets.dev.js',
+ 'wp-admin/js/wp-fullscreen.dev.js',
+ 'wp-admin/js/nav-menu.dev.js',
+ 'wp-admin/js/dashboard.dev.js',
+ 'wp-admin/js/link.dev.js',
+ 'wp-admin/js/user-suggest.dev.js',
+ 'wp-admin/js/postbox.dev.js',
+ 'wp-admin/js/tags.dev.js',
+ 'wp-admin/js/image-edit.dev.js',
+ 'wp-admin/js/media.dev.js',
+ 'wp-admin/js/customize-controls.dev.js',
+ 'wp-admin/js/inline-edit-post.dev.js',
+ 'wp-admin/js/categories.dev.js',
+ 'wp-admin/js/editor.dev.js',
+ 'wp-includes/js/tinymce/plugins/wpeditimage/js/editimage.dev.js',
+ 'wp-includes/js/tinymce/plugins/wpdialogs/js/popup.dev.js',
+ 'wp-includes/js/tinymce/plugins/wpdialogs/js/wpdialog.dev.js',
+ 'wp-includes/js/plupload/handlers.dev.js',
+ 'wp-includes/js/plupload/wp-plupload.dev.js',
+ 'wp-includes/js/swfupload/handlers.dev.js',
+ 'wp-includes/js/jcrop/jquery.Jcrop.dev.js',
+ 'wp-includes/js/jcrop/jquery.Jcrop.js',
+ 'wp-includes/js/jcrop/jquery.Jcrop.css',
+ 'wp-includes/js/imgareaselect/jquery.imgareaselect.dev.js',
+ 'wp-includes/css/wp-pointer.dev.css',
+ 'wp-includes/css/editor.dev.css',
+ 'wp-includes/css/jquery-ui-dialog.dev.css',
+ 'wp-includes/css/admin-bar-rtl.dev.css',
+ 'wp-includes/css/admin-bar.dev.css',
+ 'wp-includes/js/jquery/ui/jquery.effects.clip.min.js',
+ 'wp-includes/js/jquery/ui/jquery.effects.scale.min.js',
+ 'wp-includes/js/jquery/ui/jquery.effects.blind.min.js',
+ 'wp-includes/js/jquery/ui/jquery.effects.core.min.js',
+ 'wp-includes/js/jquery/ui/jquery.effects.shake.min.js',
+ 'wp-includes/js/jquery/ui/jquery.effects.fade.min.js',
+ 'wp-includes/js/jquery/ui/jquery.effects.explode.min.js',
+ 'wp-includes/js/jquery/ui/jquery.effects.slide.min.js',
+ 'wp-includes/js/jquery/ui/jquery.effects.drop.min.js',
+ 'wp-includes/js/jquery/ui/jquery.effects.highlight.min.js',
+ 'wp-includes/js/jquery/ui/jquery.effects.bounce.min.js',
+ 'wp-includes/js/jquery/ui/jquery.effects.pulsate.min.js',
+ 'wp-includes/js/jquery/ui/jquery.effects.transfer.min.js',
+ 'wp-includes/js/jquery/ui/jquery.effects.fold.min.js',
+ 'wp-admin/images/screenshots/captions-1.png',
+ 'wp-admin/images/screenshots/captions-2.png',
+ 'wp-admin/images/screenshots/flex-header-1.png',
+ 'wp-admin/images/screenshots/flex-header-2.png',
+ 'wp-admin/images/screenshots/flex-header-3.png',
+ 'wp-admin/images/screenshots/flex-header-media-library.png',
+ 'wp-admin/images/screenshots/theme-customizer.png',
+ 'wp-admin/images/screenshots/twitter-embed-1.png',
+ 'wp-admin/images/screenshots/twitter-embed-2.png',
+ 'wp-admin/js/utils.js',
+ 'wp-admin/options-privacy.php',
+ 'wp-app.php',
+ 'wp-includes/class-wp-atom-server.php',
+ 'wp-includes/js/tinymce/themes/advanced/skins/wp_theme/ui.css',
+ // 3.5.2
+ 'wp-includes/js/swfupload/swfupload-all.js',
+ // 3.6
+ 'wp-admin/js/revisions-js.php',
+ 'wp-admin/images/screenshots',
+ 'wp-admin/js/categories.js',
+ 'wp-admin/js/categories.min.js',
+ 'wp-admin/js/custom-fields.js',
+ 'wp-admin/js/custom-fields.min.js',
+ // 3.7
+ 'wp-admin/js/cat.js',
+ 'wp-admin/js/cat.min.js',
+ 'wp-includes/js/tinymce/plugins/wpeditimage/js/editimage.min.js',
+ // 3.8
+ 'wp-includes/js/tinymce/themes/advanced/skins/wp_theme/img/page_bug.gif',
+ 'wp-includes/js/tinymce/themes/advanced/skins/wp_theme/img/more_bug.gif',
+ 'wp-includes/js/thickbox/tb-close-2x.png',
+ 'wp-includes/js/thickbox/tb-close.png',
+ 'wp-includes/images/wpmini-blue-2x.png',
+ 'wp-includes/images/wpmini-blue.png',
+ 'wp-admin/css/colors-fresh.css',
+ 'wp-admin/css/colors-classic.css',
+ 'wp-admin/css/colors-fresh.min.css',
+ 'wp-admin/css/colors-classic.min.css',
+ 'wp-admin/js/about.min.js',
+ 'wp-admin/js/about.js',
+ 'wp-admin/images/arrows-dark-vs-2x.png',
+ 'wp-admin/images/wp-logo-vs.png',
+ 'wp-admin/images/arrows-dark-vs.png',
+ 'wp-admin/images/wp-logo.png',
+ 'wp-admin/images/arrows-pr.png',
+ 'wp-admin/images/arrows-dark.png',
+ 'wp-admin/images/press-this.png',
+ 'wp-admin/images/press-this-2x.png',
+ 'wp-admin/images/arrows-vs-2x.png',
+ 'wp-admin/images/welcome-icons.png',
+ 'wp-admin/images/wp-logo-2x.png',
+ 'wp-admin/images/stars-rtl-2x.png',
+ 'wp-admin/images/arrows-dark-2x.png',
+ 'wp-admin/images/arrows-pr-2x.png',
+ 'wp-admin/images/menu-shadow-rtl.png',
+ 'wp-admin/images/arrows-vs.png',
+ 'wp-admin/images/about-search-2x.png',
+ 'wp-admin/images/bubble_bg-rtl-2x.gif',
+ 'wp-admin/images/wp-badge-2x.png',
+ 'wp-admin/images/wordpress-logo-2x.png',
+ 'wp-admin/images/bubble_bg-rtl.gif',
+ 'wp-admin/images/wp-badge.png',
+ 'wp-admin/images/menu-shadow.png',
+ 'wp-admin/images/about-globe-2x.png',
+ 'wp-admin/images/welcome-icons-2x.png',
+ 'wp-admin/images/stars-rtl.png',
+ 'wp-admin/images/wp-logo-vs-2x.png',
+ 'wp-admin/images/about-updates-2x.png',
+ // 3.9
+ 'wp-admin/css/colors.css',
+ 'wp-admin/css/colors.min.css',
+ 'wp-admin/css/colors-rtl.css',
+ 'wp-admin/css/colors-rtl.min.css',
+ // Following files added back in 4.5 see #36083
+ // 'wp-admin/css/media-rtl.min.css',
+ // 'wp-admin/css/media.min.css',
+ // 'wp-admin/css/farbtastic-rtl.min.css',
+ 'wp-admin/images/lock-2x.png',
+ 'wp-admin/images/lock.png',
+ 'wp-admin/js/theme-preview.js',
+ 'wp-admin/js/theme-install.min.js',
+ 'wp-admin/js/theme-install.js',
+ 'wp-admin/js/theme-preview.min.js',
+ 'wp-includes/js/plupload/plupload.html4.js',
+ 'wp-includes/js/plupload/plupload.html5.js',
+ 'wp-includes/js/plupload/changelog.txt',
+ 'wp-includes/js/plupload/plupload.silverlight.js',
+ 'wp-includes/js/plupload/plupload.flash.js',
+ // Added back in 4.9 [41328], see #41755
+ // 'wp-includes/js/plupload/plupload.js',
+ 'wp-includes/js/tinymce/plugins/spellchecker',
+ 'wp-includes/js/tinymce/plugins/inlinepopups',
+ 'wp-includes/js/tinymce/plugins/media/js',
+ 'wp-includes/js/tinymce/plugins/media/css',
+ 'wp-includes/js/tinymce/plugins/wordpress/img',
+ 'wp-includes/js/tinymce/plugins/wpdialogs/js',
+ 'wp-includes/js/tinymce/plugins/wpeditimage/img',
+ 'wp-includes/js/tinymce/plugins/wpeditimage/js',
+ 'wp-includes/js/tinymce/plugins/wpeditimage/css',
+ 'wp-includes/js/tinymce/plugins/wpgallery/img',
+ 'wp-includes/js/tinymce/plugins/wpfullscreen/css',
+ 'wp-includes/js/tinymce/plugins/paste/js',
+ 'wp-includes/js/tinymce/themes/advanced',
+ 'wp-includes/js/tinymce/tiny_mce.js',
+ 'wp-includes/js/tinymce/mark_loaded_src.js',
+ 'wp-includes/js/tinymce/wp-tinymce-schema.js',
+ 'wp-includes/js/tinymce/plugins/media/editor_plugin.js',
+ 'wp-includes/js/tinymce/plugins/media/editor_plugin_src.js',
+ 'wp-includes/js/tinymce/plugins/media/media.htm',
+ 'wp-includes/js/tinymce/plugins/wpview/editor_plugin_src.js',
+ 'wp-includes/js/tinymce/plugins/wpview/editor_plugin.js',
+ 'wp-includes/js/tinymce/plugins/directionality/editor_plugin.js',
+ 'wp-includes/js/tinymce/plugins/directionality/editor_plugin_src.js',
+ 'wp-includes/js/tinymce/plugins/wordpress/editor_plugin.js',
+ 'wp-includes/js/tinymce/plugins/wordpress/editor_plugin_src.js',
+ 'wp-includes/js/tinymce/plugins/wpdialogs/editor_plugin_src.js',
+ 'wp-includes/js/tinymce/plugins/wpdialogs/editor_plugin.js',
+ 'wp-includes/js/tinymce/plugins/wpeditimage/editimage.html',
+ 'wp-includes/js/tinymce/plugins/wpeditimage/editor_plugin.js',
+ 'wp-includes/js/tinymce/plugins/wpeditimage/editor_plugin_src.js',
+ 'wp-includes/js/tinymce/plugins/fullscreen/editor_plugin_src.js',
+ 'wp-includes/js/tinymce/plugins/fullscreen/fullscreen.htm',
+ 'wp-includes/js/tinymce/plugins/fullscreen/editor_plugin.js',
+ 'wp-includes/js/tinymce/plugins/wplink/editor_plugin_src.js',
+ 'wp-includes/js/tinymce/plugins/wplink/editor_plugin.js',
+ 'wp-includes/js/tinymce/plugins/wpgallery/editor_plugin_src.js',
+ 'wp-includes/js/tinymce/plugins/wpgallery/editor_plugin.js',
+ 'wp-includes/js/tinymce/plugins/tabfocus/editor_plugin.js',
+ 'wp-includes/js/tinymce/plugins/tabfocus/editor_plugin_src.js',
+ 'wp-includes/js/tinymce/plugins/wpfullscreen/editor_plugin.js',
+ 'wp-includes/js/tinymce/plugins/wpfullscreen/editor_plugin_src.js',
+ 'wp-includes/js/tinymce/plugins/paste/editor_plugin.js',
+ 'wp-includes/js/tinymce/plugins/paste/pasteword.htm',
+ 'wp-includes/js/tinymce/plugins/paste/editor_plugin_src.js',
+ 'wp-includes/js/tinymce/plugins/paste/pastetext.htm',
+ 'wp-includes/js/tinymce/langs/wp-langs.php',
+ // 4.1
+ 'wp-includes/js/jquery/ui/jquery.ui.accordion.min.js',
+ 'wp-includes/js/jquery/ui/jquery.ui.autocomplete.min.js',
+ 'wp-includes/js/jquery/ui/jquery.ui.button.min.js',
+ 'wp-includes/js/jquery/ui/jquery.ui.core.min.js',
+ 'wp-includes/js/jquery/ui/jquery.ui.datepicker.min.js',
+ 'wp-includes/js/jquery/ui/jquery.ui.dialog.min.js',
+ 'wp-includes/js/jquery/ui/jquery.ui.draggable.min.js',
+ 'wp-includes/js/jquery/ui/jquery.ui.droppable.min.js',
+ 'wp-includes/js/jquery/ui/jquery.ui.effect-blind.min.js',
+ 'wp-includes/js/jquery/ui/jquery.ui.effect-bounce.min.js',
+ 'wp-includes/js/jquery/ui/jquery.ui.effect-clip.min.js',
+ 'wp-includes/js/jquery/ui/jquery.ui.effect-drop.min.js',
+ 'wp-includes/js/jquery/ui/jquery.ui.effect-explode.min.js',
+ 'wp-includes/js/jquery/ui/jquery.ui.effect-fade.min.js',
+ 'wp-includes/js/jquery/ui/jquery.ui.effect-fold.min.js',
+ 'wp-includes/js/jquery/ui/jquery.ui.effect-highlight.min.js',
+ 'wp-includes/js/jquery/ui/jquery.ui.effect-pulsate.min.js',
+ 'wp-includes/js/jquery/ui/jquery.ui.effect-scale.min.js',
+ 'wp-includes/js/jquery/ui/jquery.ui.effect-shake.min.js',
+ 'wp-includes/js/jquery/ui/jquery.ui.effect-slide.min.js',
+ 'wp-includes/js/jquery/ui/jquery.ui.effect-transfer.min.js',
+ 'wp-includes/js/jquery/ui/jquery.ui.effect.min.js',
+ 'wp-includes/js/jquery/ui/jquery.ui.menu.min.js',
+ 'wp-includes/js/jquery/ui/jquery.ui.mouse.min.js',
+ 'wp-includes/js/jquery/ui/jquery.ui.position.min.js',
+ 'wp-includes/js/jquery/ui/jquery.ui.progressbar.min.js',
+ 'wp-includes/js/jquery/ui/jquery.ui.resizable.min.js',
+ 'wp-includes/js/jquery/ui/jquery.ui.selectable.min.js',
+ 'wp-includes/js/jquery/ui/jquery.ui.slider.min.js',
+ 'wp-includes/js/jquery/ui/jquery.ui.sortable.min.js',
+ 'wp-includes/js/jquery/ui/jquery.ui.spinner.min.js',
+ 'wp-includes/js/jquery/ui/jquery.ui.tabs.min.js',
+ 'wp-includes/js/jquery/ui/jquery.ui.tooltip.min.js',
+ 'wp-includes/js/jquery/ui/jquery.ui.widget.min.js',
+ 'wp-includes/js/tinymce/skins/wordpress/images/dashicon-no-alt.png',
+ // 4.3
+ 'wp-admin/js/wp-fullscreen.js',
+ 'wp-admin/js/wp-fullscreen.min.js',
+ 'wp-includes/js/tinymce/wp-mce-help.php',
+ 'wp-includes/js/tinymce/plugins/wpfullscreen',
+ // 4.5
+ 'wp-includes/theme-compat/comments-popup.php',
+ // 4.6
+ 'wp-admin/includes/class-wp-automatic-upgrader.php', // Wrong file name, see #37628.
+ // 4.8
+ 'wp-includes/js/tinymce/plugins/wpembed',
+ 'wp-includes/js/tinymce/plugins/media/moxieplayer.swf',
+ 'wp-includes/js/tinymce/skins/lightgray/fonts/readme.md',
+ 'wp-includes/js/tinymce/skins/lightgray/fonts/tinymce-small.json',
+ 'wp-includes/js/tinymce/skins/lightgray/fonts/tinymce.json',
+ 'wp-includes/js/tinymce/skins/lightgray/skin.ie7.min.css',
+ // 4.9
+ 'wp-admin/css/press-this-editor-rtl.css',
+ 'wp-admin/css/press-this-editor-rtl.min.css',
+ 'wp-admin/css/press-this-editor.css',
+ 'wp-admin/css/press-this-editor.min.css',
+ 'wp-admin/css/press-this-rtl.css',
+ 'wp-admin/css/press-this-rtl.min.css',
+ 'wp-admin/css/press-this.css',
+ 'wp-admin/css/press-this.min.css',
+ 'wp-admin/includes/class-wp-press-this.php',
+ 'wp-admin/js/bookmarklet.js',
+ 'wp-admin/js/bookmarklet.min.js',
+ 'wp-admin/js/press-this.js',
+ 'wp-admin/js/press-this.min.js',
+ 'wp-includes/js/mediaelement/background.png',
+ 'wp-includes/js/mediaelement/bigplay.png',
+ 'wp-includes/js/mediaelement/bigplay.svg',
+ 'wp-includes/js/mediaelement/controls.png',
+ 'wp-includes/js/mediaelement/controls.svg',
+ 'wp-includes/js/mediaelement/flashmediaelement.swf',
+ 'wp-includes/js/mediaelement/froogaloop.min.js',
+ 'wp-includes/js/mediaelement/jumpforward.png',
+ 'wp-includes/js/mediaelement/loading.gif',
+ 'wp-includes/js/mediaelement/silverlightmediaelement.xap',
+ 'wp-includes/js/mediaelement/skipback.png',
+ 'wp-includes/js/plupload/plupload.flash.swf',
+ 'wp-includes/js/plupload/plupload.full.min.js',
+ 'wp-includes/js/plupload/plupload.silverlight.xap',
+ 'wp-includes/js/swfupload/plugins',
+ 'wp-includes/js/swfupload/swfupload.swf',
+ // 4.9.2
+ 'wp-includes/js/mediaelement/lang',
+ 'wp-includes/js/mediaelement/lang/ca.js',
+ 'wp-includes/js/mediaelement/lang/cs.js',
+ 'wp-includes/js/mediaelement/lang/de.js',
+ 'wp-includes/js/mediaelement/lang/es.js',
+ 'wp-includes/js/mediaelement/lang/fa.js',
+ 'wp-includes/js/mediaelement/lang/fr.js',
+ 'wp-includes/js/mediaelement/lang/hr.js',
+ 'wp-includes/js/mediaelement/lang/hu.js',
+ 'wp-includes/js/mediaelement/lang/it.js',
+ 'wp-includes/js/mediaelement/lang/ja.js',
+ 'wp-includes/js/mediaelement/lang/ko.js',
+ 'wp-includes/js/mediaelement/lang/nl.js',
+ 'wp-includes/js/mediaelement/lang/pl.js',
+ 'wp-includes/js/mediaelement/lang/pt.js',
+ 'wp-includes/js/mediaelement/lang/ro.js',
+ 'wp-includes/js/mediaelement/lang/ru.js',
+ 'wp-includes/js/mediaelement/lang/sk.js',
+ 'wp-includes/js/mediaelement/lang/sv.js',
+ 'wp-includes/js/mediaelement/lang/uk.js',
+ 'wp-includes/js/mediaelement/lang/zh-cn.js',
+ 'wp-includes/js/mediaelement/lang/zh.js',
+ 'wp-includes/js/mediaelement/mediaelement-flash-audio-ogg.swf',
+ 'wp-includes/js/mediaelement/mediaelement-flash-audio.swf',
+ 'wp-includes/js/mediaelement/mediaelement-flash-video-hls.swf',
+ 'wp-includes/js/mediaelement/mediaelement-flash-video-mdash.swf',
+ 'wp-includes/js/mediaelement/mediaelement-flash-video.swf',
+ 'wp-includes/js/mediaelement/renderers/dailymotion.js',
+ 'wp-includes/js/mediaelement/renderers/dailymotion.min.js',
+ 'wp-includes/js/mediaelement/renderers/facebook.js',
+ 'wp-includes/js/mediaelement/renderers/facebook.min.js',
+ 'wp-includes/js/mediaelement/renderers/soundcloud.js',
+ 'wp-includes/js/mediaelement/renderers/soundcloud.min.js',
+ 'wp-includes/js/mediaelement/renderers/twitch.js',
+ 'wp-includes/js/mediaelement/renderers/twitch.min.js',
+ // 5.0
+ 'wp-includes/js/codemirror/jshint.js',
+ // 5.1
+ 'wp-includes/random_compat/random_bytes_openssl.php',
+ 'wp-includes/js/tinymce/wp-tinymce.js.gz',
+);
+
+/**
+ * Stores new files in wp-content to copy
+ *
+ * The contents of this array indicate any new bundled plugins/themes which
+ * should be installed with the WordPress Upgrade. These items will not be
+ * re-installed in future upgrades, this behaviour is controlled by the
+ * introduced version present here being older than the current installed version.
+ *
+ * The content of this array should follow the following format:
+ * Filename (relative to wp-content) => Introduced version
+ * Directories should be noted by suffixing it with a trailing slash (/)
+ *
+ * @since 3.2.0
+ * @since 4.7.0 New themes were not automatically installed for 4.4-4.6 on
+ * upgrade. New themes are now installed again. To disable new
+ * themes from being installed on upgrade, explicitly define
+ * CORE_UPGRADE_SKIP_NEW_BUNDLED as false.
+ * @global array $_new_bundled_files
+ * @var array
+ * @name $_new_bundled_files
+ */
+global $_new_bundled_files;
+
+$_new_bundled_files = array(
+ 'plugins/akismet/' => '2.0',
+ 'themes/twentyten/' => '3.0',
+ 'themes/twentyeleven/' => '3.2',
+ 'themes/twentytwelve/' => '3.5',
+ 'themes/twentythirteen/' => '3.6',
+ 'themes/twentyfourteen/' => '3.8',
+ 'themes/twentyfifteen/' => '4.1',
+ 'themes/twentysixteen/' => '4.4',
+ 'themes/twentyseventeen/' => '4.7',
+ 'themes/twentynineteen/' => '5.0',
+);
+
+/**
+ * Upgrades the core of WordPress.
+ *
+ * This will create a .maintenance file at the base of the WordPress directory
+ * to ensure that people can not access the web site, when the files are being
+ * copied to their locations.
+ *
+ * The files in the `$_old_files` list will be removed and the new files
+ * copied from the zip file after the database is upgraded.
+ *
+ * The files in the `$_new_bundled_files` list will be added to the installation
+ * if the version is greater than or equal to the old version being upgraded.
+ *
+ * The steps for the upgrader for after the new release is downloaded and
+ * unzipped is:
+ * 1. Test unzipped location for select files to ensure that unzipped worked.
+ * 2. Create the .maintenance file in current WordPress base.
+ * 3. Copy new WordPress directory over old WordPress files.
+ * 4. Upgrade WordPress to new version.
+ * 4.1. Copy all files/folders other than wp-content
+ * 4.2. Copy any language files to WP_LANG_DIR (which may differ from WP_CONTENT_DIR
+ * 4.3. Copy any new bundled themes/plugins to their respective locations
+ * 5. Delete new WordPress directory path.
+ * 6. Delete .maintenance file.
+ * 7. Remove old files.
+ * 8. Delete 'update_core' option.
+ *
+ * There are several areas of failure. For instance if PHP times out before step
+ * 6, then you will not be able to access any portion of your site. Also, since
+ * the upgrade will not continue where it left off, you will not be able to
+ * automatically remove old files and remove the 'update_core' option. This
+ * isn't that bad.
+ *
+ * If the copy of the new WordPress over the old fails, then the worse is that
+ * the new WordPress directory will remain.
+ *
+ * If it is assumed that every file will be copied over, including plugins and
+ * themes, then if you edit the default theme, you should rename it, so that
+ * your changes remain.
+ *
+ * @since 2.7.0
+ *
+ * @global WP_Filesystem_Base $wp_filesystem WordPress filesystem subclass.
+ * @global array $_old_files
+ * @global array $_new_bundled_files
+ * @global wpdb $wpdb
+ * @global string $wp_version
+ * @global string $required_php_version
+ * @global string $required_mysql_version
+ *
+ * @param string $from New release unzipped path.
+ * @param string $to Path to old WordPress installation.
+ * @return WP_Error|null WP_Error on failure, null on success.
+ */
+function update_core( $from, $to ) {
+ global $wp_filesystem, $_old_files, $_new_bundled_files, $wpdb;
+
+ @set_time_limit( 300 );
+
+ /**
+ * Filters feedback messages displayed during the core update process.
+ *
+ * The filter is first evaluated after the zip file for the latest version
+ * has been downloaded and unzipped. It is evaluated five more times during
+ * the process:
+ *
+ * 1. Before WordPress begins the core upgrade process.
+ * 2. Before Maintenance Mode is enabled.
+ * 3. Before WordPress begins copying over the necessary files.
+ * 4. Before Maintenance Mode is disabled.
+ * 5. Before the database is upgraded.
+ *
+ * @since 2.5.0
+ *
+ * @param string $feedback The core update feedback messages.
+ */
+ apply_filters( 'update_feedback', __( 'Verifying the unpacked files&#8230;' ) );
+
+ // Sanity check the unzipped distribution.
+ $distro = '';
+ $roots = array( '/wordpress/', '/wordpress-mu/' );
+ foreach ( $roots as $root ) {
+ if ( $wp_filesystem->exists( $from . $root . 'readme.html' ) && $wp_filesystem->exists( $from . $root . 'wp-includes/version.php' ) ) {
+ $distro = $root;
+ break;
+ }
+ }
+ if ( ! $distro ) {
+ $wp_filesystem->delete( $from, true );
+ return new WP_Error( 'insane_distro', __( 'The update could not be unpacked' ) );
+ }
+
+ /*
+ * Import $wp_version, $required_php_version, and $required_mysql_version from the new version.
+ * DO NOT globalise any variables imported from `version-current.php` in this function.
+ *
+ * BC Note: $wp_filesystem->wp_content_dir() returned unslashed pre-2.8
+ */
+ $versions_file = trailingslashit( $wp_filesystem->wp_content_dir() ) . 'upgrade/version-current.php';
+ if ( ! $wp_filesystem->copy( $from . $distro . 'wp-includes/version.php', $versions_file ) ) {
+ $wp_filesystem->delete( $from, true );
+ return new WP_Error( 'copy_failed_for_version_file', __( 'The update cannot be installed because we will be unable to copy some files. This is usually due to inconsistent file permissions.' ), 'wp-includes/version.php' );
+ }
+
+ $wp_filesystem->chmod( $versions_file, FS_CHMOD_FILE );
+ require( WP_CONTENT_DIR . '/upgrade/version-current.php' );
+ $wp_filesystem->delete( $versions_file );
+
+ $php_version = phpversion();
+ $mysql_version = $wpdb->db_version();
+ $old_wp_version = $GLOBALS['wp_version']; // The version of WordPress we're updating from
+ $development_build = ( false !== strpos( $old_wp_version . $wp_version, '-' ) ); // a dash in the version indicates a Development release
+ $php_compat = version_compare( $php_version, $required_php_version, '>=' );
+ if ( file_exists( WP_CONTENT_DIR . '/db.php' ) && empty( $wpdb->is_mysql ) ) {
+ $mysql_compat = true;
+ } else {
+ $mysql_compat = version_compare( $mysql_version, $required_mysql_version, '>=' );
+ }
+
+ if ( ! $mysql_compat || ! $php_compat ) {
+ $wp_filesystem->delete( $from, true );
+ }
+
+ $php_update_message = '';
+ if ( function_exists( 'wp_get_update_php_url' ) ) {
+ /* translators: %s: Update PHP page URL */
+ $php_update_message = '</p><p>' . sprintf( __( '<a href="%s">Learn more about updating PHP</a>.' ), esc_url( wp_get_update_php_url() ) );
+
+ if ( function_exists( 'wp_get_update_php_annotation' ) ) {
+ $annotation = wp_get_update_php_annotation();
+ if ( $annotation ) {
+ $php_update_message .= '</p><p><em>' . $annotation . '</em>';
+ }
+ }
+ }
+
+ if ( ! $mysql_compat && ! $php_compat ) {
+ return new WP_Error( 'php_mysql_not_compatible', sprintf( __( 'The update cannot be installed because WordPress %1$s requires PHP version %2$s or higher and MySQL version %3$s or higher. You are running PHP version %4$s and MySQL version %5$s.' ), $wp_version, $required_php_version, $required_mysql_version, $php_version, $mysql_version ) . $php_update_message );
+ } elseif ( ! $php_compat ) {
+ return new WP_Error( 'php_not_compatible', sprintf( __( 'The update cannot be installed because WordPress %1$s requires PHP version %2$s or higher. You are running version %3$s.' ), $wp_version, $required_php_version, $php_version ) . $php_update_message );
+ } elseif ( ! $mysql_compat ) {
+ return new WP_Error( 'mysql_not_compatible', sprintf( __( 'The update cannot be installed because WordPress %1$s requires MySQL version %2$s or higher. You are running version %3$s.' ), $wp_version, $required_mysql_version, $mysql_version ) );
+ }
+
+ /** This filter is documented in wp-admin/includes/update-core.php */
+ apply_filters( 'update_feedback', __( 'Preparing to install the latest version&#8230;' ) );
+
+ // Don't copy wp-content, we'll deal with that below
+ // We also copy version.php last so failed updates report their old version
+ $skip = array( 'wp-content', 'wp-includes/version.php' );
+ $check_is_writable = array();
+
+ // Check to see which files don't really need updating - only available for 3.7 and higher
+ if ( function_exists( 'get_core_checksums' ) ) {
+ // Find the local version of the working directory
+ $working_dir_local = WP_CONTENT_DIR . '/upgrade/' . basename( $from ) . $distro;
+
+ $checksums = get_core_checksums( $wp_version, isset( $wp_local_package ) ? $wp_local_package : 'en_US' );
+ if ( is_array( $checksums ) && isset( $checksums[ $wp_version ] ) ) {
+ $checksums = $checksums[ $wp_version ]; // Compat code for 3.7-beta2
+ }
+ if ( is_array( $checksums ) ) {
+ foreach ( $checksums as $file => $checksum ) {
+ if ( 'wp-content' == substr( $file, 0, 10 ) ) {
+ continue;
+ }
+ if ( ! file_exists( ABSPATH . $file ) ) {
+ continue;
+ }
+ if ( ! file_exists( $working_dir_local . $file ) ) {
+ continue;
+ }
+ if ( '.' === dirname( $file ) && in_array( pathinfo( $file, PATHINFO_EXTENSION ), array( 'html', 'txt' ) ) ) {
+ continue;
+ }
+ if ( md5_file( ABSPATH . $file ) === $checksum ) {
+ $skip[] = $file;
+ } else {
+ $check_is_writable[ $file ] = ABSPATH . $file;
+ }
+ }
+ }
+ }
+
+ // If we're using the direct method, we can predict write failures that are due to permissions.
+ if ( $check_is_writable && 'direct' === $wp_filesystem->method ) {
+ $files_writable = array_filter( $check_is_writable, array( $wp_filesystem, 'is_writable' ) );
+ if ( $files_writable !== $check_is_writable ) {
+ $files_not_writable = array_diff_key( $check_is_writable, $files_writable );
+ foreach ( $files_not_writable as $relative_file_not_writable => $file_not_writable ) {
+ // If the writable check failed, chmod file to 0644 and try again, same as copy_dir().
+ $wp_filesystem->chmod( $file_not_writable, FS_CHMOD_FILE );
+ if ( $wp_filesystem->is_writable( $file_not_writable ) ) {
+ unset( $files_not_writable[ $relative_file_not_writable ] );
+ }
+ }
+
+ // Store package-relative paths (the key) of non-writable files in the WP_Error object.
+ $error_data = version_compare( $old_wp_version, '3.7-beta2', '>' ) ? array_keys( $files_not_writable ) : '';
+
+ if ( $files_not_writable ) {
+ return new WP_Error( 'files_not_writable', __( 'The update cannot be installed because we will be unable to copy some files. This is usually due to inconsistent file permissions.' ), implode( ', ', $error_data ) );
+ }
+ }
+ }
+
+ /** This filter is documented in wp-admin/includes/update-core.php */
+ apply_filters( 'update_feedback', __( 'Enabling Maintenance mode&#8230;' ) );
+ // Create maintenance file to signal that we are upgrading
+ $maintenance_string = '<?php $upgrading = ' . time() . '; ?>';
+ $maintenance_file = $to . '.maintenance';
+ $wp_filesystem->delete( $maintenance_file );
+ $wp_filesystem->put_contents( $maintenance_file, $maintenance_string, FS_CHMOD_FILE );
+
+ /** This filter is documented in wp-admin/includes/update-core.php */
+ apply_filters( 'update_feedback', __( 'Copying the required files&#8230;' ) );
+ // Copy new versions of WP files into place.
+ $result = _copy_dir( $from . $distro, $to, $skip );
+ if ( is_wp_error( $result ) ) {
+ $result = new WP_Error( $result->get_error_code(), $result->get_error_message(), substr( $result->get_error_data(), strlen( $to ) ) );
+ }
+
+ // Since we know the core files have copied over, we can now copy the version file
+ if ( ! is_wp_error( $result ) ) {
+ if ( ! $wp_filesystem->copy( $from . $distro . 'wp-includes/version.php', $to . 'wp-includes/version.php', true /* overwrite */ ) ) {
+ $wp_filesystem->delete( $from, true );
+ $result = new WP_Error( 'copy_failed_for_version_file', __( 'The update cannot be installed because we will be unable to copy some files. This is usually due to inconsistent file permissions.' ), 'wp-includes/version.php' );
+ }
+ $wp_filesystem->chmod( $to . 'wp-includes/version.php', FS_CHMOD_FILE );
+ }
+
+ // Check to make sure everything copied correctly, ignoring the contents of wp-content
+ $skip = array( 'wp-content' );
+ $failed = array();
+ if ( isset( $checksums ) && is_array( $checksums ) ) {
+ foreach ( $checksums as $file => $checksum ) {
+ if ( 'wp-content' == substr( $file, 0, 10 ) ) {
+ continue;
+ }
+ if ( ! file_exists( $working_dir_local . $file ) ) {
+ continue;
+ }
+ if ( '.' === dirname( $file ) && in_array( pathinfo( $file, PATHINFO_EXTENSION ), array( 'html', 'txt' ) ) ) {
+ $skip[] = $file;
+ continue;
+ }
+ if ( file_exists( ABSPATH . $file ) && md5_file( ABSPATH . $file ) == $checksum ) {
+ $skip[] = $file;
+ } else {
+ $failed[] = $file;
+ }
+ }
+ }
+
+ // Some files didn't copy properly
+ if ( ! empty( $failed ) ) {
+ $total_size = 0;
+ foreach ( $failed as $file ) {
+ if ( file_exists( $working_dir_local . $file ) ) {
+ $total_size += filesize( $working_dir_local . $file );
+ }
+ }
+
+ // If we don't have enough free space, it isn't worth trying again.
+ // Unlikely to be hit due to the check in unzip_file().
+ $available_space = @disk_free_space( ABSPATH );
+ if ( $available_space && $total_size >= $available_space ) {
+ $result = new WP_Error( 'disk_full', __( 'There is not enough free disk space to complete the update.' ) );
+ } else {
+ $result = _copy_dir( $from . $distro, $to, $skip );
+ if ( is_wp_error( $result ) ) {
+ $result = new WP_Error( $result->get_error_code() . '_retry', $result->get_error_message(), substr( $result->get_error_data(), strlen( $to ) ) );
+ }
+ }
+ }
+
+ // Custom Content Directory needs updating now.
+ // Copy Languages
+ if ( ! is_wp_error( $result ) && $wp_filesystem->is_dir( $from . $distro . 'wp-content/languages' ) ) {
+ if ( WP_LANG_DIR != ABSPATH . WPINC . '/languages' || @is_dir( WP_LANG_DIR ) ) {
+ $lang_dir = WP_LANG_DIR;
+ } else {
+ $lang_dir = WP_CONTENT_DIR . '/languages';
+ }
+
+ if ( ! @is_dir( $lang_dir ) && 0 === strpos( $lang_dir, ABSPATH ) ) { // Check the language directory exists first
+ $wp_filesystem->mkdir( $to . str_replace( ABSPATH, '', $lang_dir ), FS_CHMOD_DIR ); // If it's within the ABSPATH we can handle it here, otherwise they're out of luck.
+ clearstatcache(); // for FTP, Need to clear the stat cache
+ }
+
+ if ( @is_dir( $lang_dir ) ) {
+ $wp_lang_dir = $wp_filesystem->find_folder( $lang_dir );
+ if ( $wp_lang_dir ) {
+ $result = copy_dir( $from . $distro . 'wp-content/languages/', $wp_lang_dir );
+ if ( is_wp_error( $result ) ) {
+ $result = new WP_Error( $result->get_error_code() . '_languages', $result->get_error_message(), substr( $result->get_error_data(), strlen( $wp_lang_dir ) ) );
+ }
+ }
+ }
+ }
+
+ /** This filter is documented in wp-admin/includes/update-core.php */
+ apply_filters( 'update_feedback', __( 'Disabling Maintenance mode&#8230;' ) );
+ // Remove maintenance file, we're done with potential site-breaking changes
+ $wp_filesystem->delete( $maintenance_file );
+
+ // 3.5 -> 3.5+ - an empty twentytwelve directory was created upon upgrade to 3.5 for some users, preventing installation of Twenty Twelve.
+ if ( '3.5' == $old_wp_version ) {
+ if ( is_dir( WP_CONTENT_DIR . '/themes/twentytwelve' ) && ! file_exists( WP_CONTENT_DIR . '/themes/twentytwelve/style.css' ) ) {
+ $wp_filesystem->delete( $wp_filesystem->wp_themes_dir() . 'twentytwelve/' );
+ }
+ }
+
+ // Copy New bundled plugins & themes
+ // This gives us the ability to install new plugins & themes bundled with future versions of WordPress whilst avoiding the re-install upon upgrade issue.
+ // $development_build controls us overwriting bundled themes and plugins when a non-stable release is being updated
+ if ( ! is_wp_error( $result ) && ( ! defined( 'CORE_UPGRADE_SKIP_NEW_BUNDLED' ) || ! CORE_UPGRADE_SKIP_NEW_BUNDLED ) ) {
+ foreach ( (array) $_new_bundled_files as $file => $introduced_version ) {
+ // If a $development_build or if $introduced version is greater than what the site was previously running
+ if ( $development_build || version_compare( $introduced_version, $old_wp_version, '>' ) ) {
+ $directory = ( '/' == $file[ strlen( $file ) - 1 ] );
+ list($type, $filename) = explode( '/', $file, 2 );
+
+ // Check to see if the bundled items exist before attempting to copy them
+ if ( ! $wp_filesystem->exists( $from . $distro . 'wp-content/' . $file ) ) {
+ continue;
+ }
+
+ if ( 'plugins' == $type ) {
+ $dest = $wp_filesystem->wp_plugins_dir();
+ } elseif ( 'themes' == $type ) {
+ $dest = trailingslashit( $wp_filesystem->wp_themes_dir() ); // Back-compat, ::wp_themes_dir() did not return trailingslash'd pre-3.2
+ } else {
+ continue;
+ }
+
+ if ( ! $directory ) {
+ if ( ! $development_build && $wp_filesystem->exists( $dest . $filename ) ) {
+ continue;
+ }
+
+ if ( ! $wp_filesystem->copy( $from . $distro . 'wp-content/' . $file, $dest . $filename, FS_CHMOD_FILE ) ) {
+ $result = new WP_Error( "copy_failed_for_new_bundled_$type", __( 'Could not copy file.' ), $dest . $filename );
+ }
+ } else {
+ if ( ! $development_build && $wp_filesystem->is_dir( $dest . $filename ) ) {
+ continue;
+ }
+
+ $wp_filesystem->mkdir( $dest . $filename, FS_CHMOD_DIR );
+ $_result = copy_dir( $from . $distro . 'wp-content/' . $file, $dest . $filename );
+
+ // If a error occurs partway through this final step, keep the error flowing through, but keep process going.
+ if ( is_wp_error( $_result ) ) {
+ if ( ! is_wp_error( $result ) ) {
+ $result = new WP_Error;
+ }
+ $result->add( $_result->get_error_code() . "_$type", $_result->get_error_message(), substr( $_result->get_error_data(), strlen( $dest ) ) );
+ }
+ }
+ }
+ } //end foreach
+ }
+
+ // Handle $result error from the above blocks
+ if ( is_wp_error( $result ) ) {
+ $wp_filesystem->delete( $from, true );
+ return $result;
+ }
+
+ // Remove old files
+ foreach ( $_old_files as $old_file ) {
+ $old_file = $to . $old_file;
+ if ( ! $wp_filesystem->exists( $old_file ) ) {
+ continue;
+ }
+
+ // If the file isn't deleted, try writing an empty string to the file instead.
+ if ( ! $wp_filesystem->delete( $old_file, true ) && $wp_filesystem->is_file( $old_file ) ) {
+ $wp_filesystem->put_contents( $old_file, '' );
+ }
+ }
+
+ // Remove any Genericons example.html's from the filesystem
+ _upgrade_422_remove_genericons();
+
+ // Remove the REST API plugin if its version is Beta 4 or lower
+ _upgrade_440_force_deactivate_incompatible_plugins();
+
+ // Upgrade DB with separate request
+ /** This filter is documented in wp-admin/includes/update-core.php */
+ apply_filters( 'update_feedback', __( 'Upgrading database&#8230;' ) );
+ $db_upgrade_url = admin_url( 'upgrade.php?step=upgrade_db' );
+ wp_remote_post( $db_upgrade_url, array( 'timeout' => 60 ) );
+
+ // Clear the cache to prevent an update_option() from saving a stale db_version to the cache
+ wp_cache_flush();
+ // (Not all cache back ends listen to 'flush')
+ wp_cache_delete( 'alloptions', 'options' );
+
+ // Remove working directory
+ $wp_filesystem->delete( $from, true );
+
+ // Force refresh of update information
+ if ( function_exists( 'delete_site_transient' ) ) {
+ delete_site_transient( 'update_core' );
+ } else {
+ delete_option( 'update_core' );
+ }
+
+ /**
+ * Fires after WordPress core has been successfully updated.
+ *
+ * @since 3.3.0
+ *
+ * @param string $wp_version The current WordPress version.
+ */
+ do_action( '_core_updated_successfully', $wp_version );
+
+ // Clear the option that blocks auto updates after failures, now that we've been successful.
+ if ( function_exists( 'delete_site_option' ) ) {
+ delete_site_option( 'auto_core_update_failed' );
+ }
+
+ return $wp_version;
+}
+
+/**
+ * Copies a directory from one location to another via the WordPress Filesystem Abstraction.
+ * Assumes that WP_Filesystem() has already been called and setup.
+ *
+ * This is a temporary function for the 3.1 -> 3.2 upgrade, as well as for those upgrading to
+ * 3.7+
+ *
+ * @ignore
+ * @since 3.2.0
+ * @since 3.7.0 Updated not to use a regular expression for the skip list
+ * @see copy_dir()
+ *
+ * @global WP_Filesystem_Base $wp_filesystem
+ *
+ * @param string $from source directory
+ * @param string $to destination directory
+ * @param array $skip_list a list of files/folders to skip copying
+ * @return mixed WP_Error on failure, True on success.
+ */
+function _copy_dir( $from, $to, $skip_list = array() ) {
+ global $wp_filesystem;
+
+ $dirlist = $wp_filesystem->dirlist( $from );
+
+ $from = trailingslashit( $from );
+ $to = trailingslashit( $to );
+
+ foreach ( (array) $dirlist as $filename => $fileinfo ) {
+ if ( in_array( $filename, $skip_list ) ) {
+ continue;
+ }
+
+ if ( 'f' == $fileinfo['type'] ) {
+ if ( ! $wp_filesystem->copy( $from . $filename, $to . $filename, true, FS_CHMOD_FILE ) ) {
+ // If copy failed, chmod file to 0644 and try again.
+ $wp_filesystem->chmod( $to . $filename, FS_CHMOD_FILE );
+ if ( ! $wp_filesystem->copy( $from . $filename, $to . $filename, true, FS_CHMOD_FILE ) ) {
+ return new WP_Error( 'copy_failed__copy_dir', __( 'Could not copy file.' ), $to . $filename );
+ }
+ }
+ } elseif ( 'd' == $fileinfo['type'] ) {
+ if ( ! $wp_filesystem->is_dir( $to . $filename ) ) {
+ if ( ! $wp_filesystem->mkdir( $to . $filename, FS_CHMOD_DIR ) ) {
+ return new WP_Error( 'mkdir_failed__copy_dir', __( 'Could not create directory.' ), $to . $filename );
+ }
+ }
+
+ /*
+ * Generate the $sub_skip_list for the subdirectory as a sub-set
+ * of the existing $skip_list.
+ */
+ $sub_skip_list = array();
+ foreach ( $skip_list as $skip_item ) {
+ if ( 0 === strpos( $skip_item, $filename . '/' ) ) {
+ $sub_skip_list[] = preg_replace( '!^' . preg_quote( $filename, '!' ) . '/!i', '', $skip_item );
+ }
+ }
+
+ $result = _copy_dir( $from . $filename, $to . $filename, $sub_skip_list );
+ if ( is_wp_error( $result ) ) {
+ return $result;
+ }
+ }
+ }
+ return true;
+}
+
+/**
+ * Redirect to the About WordPress page after a successful upgrade.
+ *
+ * This function is only needed when the existing installation is older than 3.4.0.
+ *
+ * @since 3.3.0
+ *
+ * @global string $wp_version
+ * @global string $pagenow
+ * @global string $action
+ *
+ * @param string $new_version
+ */
+function _redirect_to_about_wordpress( $new_version ) {
+ global $wp_version, $pagenow, $action;
+
+ if ( version_compare( $wp_version, '3.4-RC1', '>=' ) ) {
+ return;
+ }
+
+ // Ensure we only run this on the update-core.php page. The Core_Upgrader may be used in other contexts.
+ if ( 'update-core.php' != $pagenow ) {
+ return;
+ }
+
+ if ( 'do-core-upgrade' != $action && 'do-core-reinstall' != $action ) {
+ return;
+ }
+
+ // Load the updated default text localization domain for new strings.
+ load_default_textdomain();
+
+ // See do_core_upgrade()
+ show_message( __( 'WordPress updated successfully' ) );
+
+ // self_admin_url() won't exist when upgrading from <= 3.0, so relative URLs are intentional.
+ show_message( '<span class="hide-if-no-js">' . sprintf( __( 'Welcome to WordPress %1$s. You will be redirected to the About WordPress screen. If not, click <a href="%2$s">here</a>.' ), $new_version, 'about.php?updated' ) . '</span>' );
+ show_message( '<span class="hide-if-js">' . sprintf( __( 'Welcome to WordPress %1$s. <a href="%2$s">Learn more</a>.' ), $new_version, 'about.php?updated' ) . '</span>' );
+ echo '</div>';
+ ?>
+<script type="text/javascript">
+window.location = 'about.php?updated';
+</script>
+ <?php
+
+ // Include admin-footer.php and exit.
+ include( ABSPATH . 'wp-admin/admin-footer.php' );
+ exit();
+}
+
+/**
+ * Cleans up Genericons example files.
+ *
+ * @since 4.2.2
+ *
+ * @global array $wp_theme_directories
+ * @global WP_Filesystem_Base $wp_filesystem
+ */
+function _upgrade_422_remove_genericons() {
+ global $wp_theme_directories, $wp_filesystem;
+
+ // A list of the affected files using the filesystem absolute paths.
+ $affected_files = array();
+
+ // Themes
+ foreach ( $wp_theme_directories as $directory ) {
+ $affected_theme_files = _upgrade_422_find_genericons_files_in_folder( $directory );
+ $affected_files = array_merge( $affected_files, $affected_theme_files );
+ }
+
+ // Plugins
+ $affected_plugin_files = _upgrade_422_find_genericons_files_in_folder( WP_PLUGIN_DIR );
+ $affected_files = array_merge( $affected_files, $affected_plugin_files );
+
+ foreach ( $affected_files as $file ) {
+ $gen_dir = $wp_filesystem->find_folder( trailingslashit( dirname( $file ) ) );
+ if ( empty( $gen_dir ) ) {
+ continue;
+ }
+
+ // The path when the file is accessed via WP_Filesystem may differ in the case of FTP
+ $remote_file = $gen_dir . basename( $file );
+
+ if ( ! $wp_filesystem->exists( $remote_file ) ) {
+ continue;
+ }
+
+ if ( ! $wp_filesystem->delete( $remote_file, false, 'f' ) ) {
+ $wp_filesystem->put_contents( $remote_file, '' );
+ }
+ }
+}
+
+/**
+ * Recursively find Genericons example files in a given folder.
+ *
+ * @ignore
+ * @since 4.2.2
+ *
+ * @param string $directory Directory path. Expects trailingslashed.
+ * @return array
+ */
+function _upgrade_422_find_genericons_files_in_folder( $directory ) {
+ $directory = trailingslashit( $directory );
+ $files = array();
+
+ if ( file_exists( "{$directory}example.html" ) && false !== strpos( file_get_contents( "{$directory}example.html" ), '<title>Genericons</title>' ) ) {
+ $files[] = "{$directory}example.html";
+ }
+
+ $dirs = glob( $directory . '*', GLOB_ONLYDIR );
+ if ( $dirs ) {
+ foreach ( $dirs as $dir ) {
+ $files = array_merge( $files, _upgrade_422_find_genericons_files_in_folder( $dir ) );
+ }
+ }
+
+ return $files;
+}
+
+/**
+ * @ignore
+ * @since 4.4.0
+ */
+function _upgrade_440_force_deactivate_incompatible_plugins() {
+ if ( defined( 'REST_API_VERSION' ) && version_compare( REST_API_VERSION, '2.0-beta4', '<=' ) ) {
+ deactivate_plugins( array( 'rest-api/plugin.php' ), true );
+ }
+}
diff --git a/www/crm/wp-admin/includes/update.php b/www/crm/wp-admin/includes/update.php
new file mode 100644
index 00000000..5dd9d63b
--- /dev/null
+++ b/www/crm/wp-admin/includes/update.php
@@ -0,0 +1,861 @@
+<?php
+/**
+ * WordPress Administration Update API
+ *
+ * @package WordPress
+ * @subpackage Administration
+ */
+
+/**
+ * Selects the first update version from the update_core option.
+ *
+ * @return object|array|false The response from the API on success, false on failure.
+ */
+function get_preferred_from_update_core() {
+ $updates = get_core_updates();
+ if ( ! is_array( $updates ) ) {
+ return false;
+ }
+ if ( empty( $updates ) ) {
+ return (object) array( 'response' => 'latest' );
+ }
+ return $updates[0];
+}
+
+/**
+ * Get available core updates.
+ *
+ * @param array $options Set $options['dismissed'] to true to show dismissed upgrades too,
+ * set $options['available'] to false to skip not-dismissed updates.
+ * @return array|false Array of the update objects on success, false on failure.
+ */
+function get_core_updates( $options = array() ) {
+ $options = array_merge(
+ array(
+ 'available' => true,
+ 'dismissed' => false,
+ ),
+ $options
+ );
+ $dismissed = get_site_option( 'dismissed_update_core' );
+
+ if ( ! is_array( $dismissed ) ) {
+ $dismissed = array();
+ }
+
+ $from_api = get_site_transient( 'update_core' );
+
+ if ( ! isset( $from_api->updates ) || ! is_array( $from_api->updates ) ) {
+ return false;
+ }
+
+ $updates = $from_api->updates;
+ $result = array();
+ foreach ( $updates as $update ) {
+ if ( $update->response == 'autoupdate' ) {
+ continue;
+ }
+
+ if ( array_key_exists( $update->current . '|' . $update->locale, $dismissed ) ) {
+ if ( $options['dismissed'] ) {
+ $update->dismissed = true;
+ $result[] = $update;
+ }
+ } else {
+ if ( $options['available'] ) {
+ $update->dismissed = false;
+ $result[] = $update;
+ }
+ }
+ }
+ return $result;
+}
+
+/**
+ * Gets the best available (and enabled) Auto-Update for WordPress Core.
+ *
+ * If there's 1.2.3 and 1.3 on offer, it'll choose 1.3 if the installation allows it, else, 1.2.3
+ *
+ * @since 3.7.0
+ *
+ * @return array|false False on failure, otherwise the core update offering.
+ */
+function find_core_auto_update() {
+ $updates = get_site_transient( 'update_core' );
+ if ( ! $updates || empty( $updates->updates ) ) {
+ return false;
+ }
+
+ include_once( ABSPATH . 'wp-admin/includes/class-wp-upgrader.php' );
+
+ $auto_update = false;
+ $upgrader = new WP_Automatic_Updater;
+ foreach ( $updates->updates as $update ) {
+ if ( 'autoupdate' != $update->response ) {
+ continue;
+ }
+
+ if ( ! $upgrader->should_update( 'core', $update, ABSPATH ) ) {
+ continue;
+ }
+
+ if ( ! $auto_update || version_compare( $update->current, $auto_update->current, '>' ) ) {
+ $auto_update = $update;
+ }
+ }
+ return $auto_update;
+}
+
+/**
+ * Gets and caches the checksums for the given version of WordPress.
+ *
+ * @since 3.7.0
+ *
+ * @param string $version Version string to query.
+ * @param string $locale Locale to query.
+ * @return bool|array False on failure. An array of checksums on success.
+ */
+function get_core_checksums( $version, $locale ) {
+ $url = $http_url = 'http://api.wordpress.org/core/checksums/1.0/?' . http_build_query( compact( 'version', 'locale' ), null, '&' );
+
+ if ( $ssl = wp_http_supports( array( 'ssl' ) ) ) {
+ $url = set_url_scheme( $url, 'https' );
+ }
+
+ $options = array(
+ 'timeout' => wp_doing_cron() ? 30 : 3,
+ );
+
+ $response = wp_remote_get( $url, $options );
+ if ( $ssl && is_wp_error( $response ) ) {
+ trigger_error(
+ sprintf(
+ /* translators: %s: support forums URL */
+ __( 'An unexpected error occurred. Something may be wrong with WordPress.org or this server&#8217;s configuration. If you continue to have problems, please try the <a href="%s">support forums</a>.' ),
+ __( 'https://wordpress.org/support/' )
+ ) . ' ' . __( '(WordPress could not establish a secure connection to WordPress.org. Please contact your server administrator.)' ),
+ headers_sent() || WP_DEBUG ? E_USER_WARNING : E_USER_NOTICE
+ );
+ $response = wp_remote_get( $http_url, $options );
+ }
+
+ if ( is_wp_error( $response ) || 200 != wp_remote_retrieve_response_code( $response ) ) {
+ return false;
+ }
+
+ $body = trim( wp_remote_retrieve_body( $response ) );
+ $body = json_decode( $body, true );
+
+ if ( ! is_array( $body ) || ! isset( $body['checksums'] ) || ! is_array( $body['checksums'] ) ) {
+ return false;
+ }
+
+ return $body['checksums'];
+}
+
+/**
+ * @param object $update
+ * @return bool
+ */
+function dismiss_core_update( $update ) {
+ $dismissed = get_site_option( 'dismissed_update_core' );
+ $dismissed[ $update->current . '|' . $update->locale ] = true;
+ return update_site_option( 'dismissed_update_core', $dismissed );
+}
+
+/**
+ * @param string $version
+ * @param string $locale
+ * @return bool
+ */
+function undismiss_core_update( $version, $locale ) {
+ $dismissed = get_site_option( 'dismissed_update_core' );
+ $key = $version . '|' . $locale;
+
+ if ( ! isset( $dismissed[ $key ] ) ) {
+ return false;
+ }
+
+ unset( $dismissed[ $key ] );
+ return update_site_option( 'dismissed_update_core', $dismissed );
+}
+
+/**
+ * @param string $version
+ * @param string $locale
+ * @return object|false
+ */
+function find_core_update( $version, $locale ) {
+ $from_api = get_site_transient( 'update_core' );
+
+ if ( ! isset( $from_api->updates ) || ! is_array( $from_api->updates ) ) {
+ return false;
+ }
+
+ $updates = $from_api->updates;
+ foreach ( $updates as $update ) {
+ if ( $update->current == $version && $update->locale == $locale ) {
+ return $update;
+ }
+ }
+ return false;
+}
+
+/**
+ * @param string $msg
+ * @return string
+ */
+function core_update_footer( $msg = '' ) {
+ if ( ! current_user_can( 'update_core' ) ) {
+ return sprintf( __( 'Version %s' ), get_bloginfo( 'version', 'display' ) );
+ }
+
+ $cur = get_preferred_from_update_core();
+ if ( ! is_object( $cur ) ) {
+ $cur = new stdClass;
+ }
+
+ if ( ! isset( $cur->current ) ) {
+ $cur->current = '';
+ }
+
+ if ( ! isset( $cur->url ) ) {
+ $cur->url = '';
+ }
+
+ if ( ! isset( $cur->response ) ) {
+ $cur->response = '';
+ }
+
+ switch ( $cur->response ) {
+ case 'development':
+ /* translators: 1: WordPress version number, 2: WordPress updates admin screen URL */
+ return sprintf( __( 'You are using a development version (%1$s). Cool! Please <a href="%2$s">stay updated</a>.' ), get_bloginfo( 'version', 'display' ), network_admin_url( 'update-core.php' ) );
+
+ case 'upgrade':
+ return '<strong><a href="' . network_admin_url( 'update-core.php' ) . '">' . sprintf( __( 'Get Version %s' ), $cur->current ) . '</a></strong>';
+
+ case 'latest':
+ default:
+ return sprintf( __( 'Version %s' ), get_bloginfo( 'version', 'display' ) );
+ }
+}
+
+/**
+ * @global string $pagenow
+ * @return false|void
+ */
+function update_nag() {
+ if ( is_multisite() && ! current_user_can( 'update_core' ) ) {
+ return false;
+ }
+
+ global $pagenow;
+
+ if ( 'update-core.php' == $pagenow ) {
+ return;
+ }
+
+ $cur = get_preferred_from_update_core();
+
+ if ( ! isset( $cur->response ) || $cur->response != 'upgrade' ) {
+ return false;
+ }
+
+ $version_url = sprintf(
+ /* translators: %s: WordPress version */
+ esc_url( __( 'https://wordpress.org/support/wordpress-version/version-%s/' ) ),
+ sanitize_title( $cur->current )
+ );
+
+ if ( current_user_can( 'update_core' ) ) {
+ $msg = sprintf(
+ /* translators: 1: URL to WordPress release notes, 2: new WordPress version, 3: URL to network admin, 4: accessibility text */
+ __( '<a href="%1$s">WordPress %2$s</a> is available! <a href="%3$s" aria-label="%4$s">Please update now</a>.' ),
+ $version_url,
+ $cur->current,
+ network_admin_url( 'update-core.php' ),
+ esc_attr__( 'Please update WordPress now' )
+ );
+ } else {
+ $msg = sprintf(
+ /* translators: 1: URL to WordPress release notes, 2: new WordPress version */
+ __( '<a href="%1$s">WordPress %2$s</a> is available! Please notify the site administrator.' ),
+ $version_url,
+ $cur->current
+ );
+ }
+ echo "<div class='update-nag'>$msg</div>";
+}
+
+// Called directly from dashboard
+function update_right_now_message() {
+ $theme_name = wp_get_theme();
+ if ( current_user_can( 'switch_themes' ) ) {
+ $theme_name = sprintf( '<a href="themes.php">%1$s</a>', $theme_name );
+ }
+
+ $msg = '';
+
+ if ( current_user_can( 'update_core' ) ) {
+ $cur = get_preferred_from_update_core();
+
+ if ( isset( $cur->response ) && $cur->response == 'upgrade' ) {
+ $msg .= '<a href="' . network_admin_url( 'update-core.php' ) . '" class="button" aria-describedby="wp-version">' . sprintf( __( 'Update to %s' ), $cur->current ? $cur->current : __( 'Latest' ) ) . '</a> ';
+ }
+ }
+
+ /* translators: 1: version number, 2: theme name */
+ $content = __( 'WordPress %1$s running %2$s theme.' );
+
+ /**
+ * Filters the text displayed in the 'At a Glance' dashboard widget.
+ *
+ * Prior to 3.8.0, the widget was named 'Right Now'.
+ *
+ * @since 4.4.0
+ *
+ * @param string $content Default text.
+ */
+ $content = apply_filters( 'update_right_now_text', $content );
+
+ $msg .= sprintf( '<span id="wp-version">' . $content . '</span>', get_bloginfo( 'version', 'display' ), $theme_name );
+
+ echo "<p id='wp-version-message'>$msg</p>";
+}
+
+/**
+ * @since 2.9.0
+ *
+ * @return array
+ */
+function get_plugin_updates() {
+ $all_plugins = get_plugins();
+ $upgrade_plugins = array();
+ $current = get_site_transient( 'update_plugins' );
+ foreach ( (array) $all_plugins as $plugin_file => $plugin_data ) {
+ if ( isset( $current->response[ $plugin_file ] ) ) {
+ $upgrade_plugins[ $plugin_file ] = (object) $plugin_data;
+ $upgrade_plugins[ $plugin_file ]->update = $current->response[ $plugin_file ];
+ }
+ }
+
+ return $upgrade_plugins;
+}
+
+/**
+ * @since 2.9.0
+ */
+function wp_plugin_update_rows() {
+ if ( ! current_user_can( 'update_plugins' ) ) {
+ return;
+ }
+
+ $plugins = get_site_transient( 'update_plugins' );
+ if ( isset( $plugins->response ) && is_array( $plugins->response ) ) {
+ $plugins = array_keys( $plugins->response );
+ foreach ( $plugins as $plugin_file ) {
+ add_action( "after_plugin_row_$plugin_file", 'wp_plugin_update_row', 10, 2 );
+ }
+ }
+}
+
+/**
+ * Displays update information for a plugin.
+ *
+ * @param string $file Plugin basename.
+ * @param array $plugin_data Plugin information.
+ * @return false|void
+ */
+function wp_plugin_update_row( $file, $plugin_data ) {
+ $current = get_site_transient( 'update_plugins' );
+ if ( ! isset( $current->response[ $file ] ) ) {
+ return false;
+ }
+
+ $response = $current->response[ $file ];
+
+ $plugins_allowedtags = array(
+ 'a' => array(
+ 'href' => array(),
+ 'title' => array(),
+ ),
+ 'abbr' => array( 'title' => array() ),
+ 'acronym' => array( 'title' => array() ),
+ 'code' => array(),
+ 'em' => array(),
+ 'strong' => array(),
+ );
+
+ $plugin_name = wp_kses( $plugin_data['Name'], $plugins_allowedtags );
+ $details_url = self_admin_url( 'plugin-install.php?tab=plugin-information&plugin=' . $response->slug . '&section=changelog&TB_iframe=true&width=600&height=800' );
+
+ /** @var WP_Plugins_List_Table $wp_list_table */
+ $wp_list_table = _get_list_table( 'WP_Plugins_List_Table' );
+
+ if ( is_network_admin() || ! is_multisite() ) {
+ if ( is_network_admin() ) {
+ $active_class = is_plugin_active_for_network( $file ) ? ' active' : '';
+ } else {
+ $active_class = is_plugin_active( $file ) ? ' active' : '';
+ }
+
+ $requires_php = isset( $response->requires_php ) ? $response->requires_php : null;
+ $compatible_php = is_php_version_compatible( $requires_php );
+ $notice_type = $compatible_php ? 'notice-warning' : 'notice-error';
+
+ echo '<tr class="plugin-update-tr' . $active_class . '" id="' . esc_attr( $response->slug . '-update' ) . '" data-slug="' . esc_attr( $response->slug ) . '" data-plugin="' . esc_attr( $file ) . '"><td colspan="' . esc_attr( $wp_list_table->get_column_count() ) . '" class="plugin-update colspanchange"><div class="update-message notice inline ' . $notice_type . ' notice-alt"><p>';
+
+ if ( ! current_user_can( 'update_plugins' ) ) {
+ /* translators: 1: plugin name, 2: details URL, 3: additional link attributes, 4: version number */
+ printf(
+ __( 'There is a new version of %1$s available. <a href="%2$s" %3$s>View version %4$s details</a>.' ),
+ $plugin_name,
+ esc_url( $details_url ),
+ sprintf(
+ 'class="thickbox open-plugin-details-modal" aria-label="%s"',
+ /* translators: 1: plugin name, 2: version number */
+ esc_attr( sprintf( __( 'View %1$s version %2$s details' ), $plugin_name, $response->new_version ) )
+ ),
+ esc_attr( $response->new_version )
+ );
+ } elseif ( empty( $response->package ) ) {
+ /* translators: 1: plugin name, 2: details URL, 3: additional link attributes, 4: version number */
+ printf(
+ __( 'There is a new version of %1$s available. <a href="%2$s" %3$s>View version %4$s details</a>. <em>Automatic update is unavailable for this plugin.</em>' ),
+ $plugin_name,
+ esc_url( $details_url ),
+ sprintf(
+ 'class="thickbox open-plugin-details-modal" aria-label="%s"',
+ /* translators: 1: plugin name, 2: version number */
+ esc_attr( sprintf( __( 'View %1$s version %2$s details' ), $plugin_name, $response->new_version ) )
+ ),
+ esc_attr( $response->new_version )
+ );
+ } else {
+ if ( $compatible_php ) {
+ /* translators: 1: plugin name, 2: details URL, 3: additional link attributes, 4: version number, 5: update URL, 6: additional link attributes */
+ printf(
+ __( 'There is a new version of %1$s available. <a href="%2$s" %3$s>View version %4$s details</a> or <a href="%5$s" %6$s>update now</a>.' ),
+ $plugin_name,
+ esc_url( $details_url ),
+ sprintf(
+ 'class="thickbox open-plugin-details-modal" aria-label="%s"',
+ /* translators: 1: plugin name, 2: version number */
+ esc_attr( sprintf( __( 'View %1$s version %2$s details' ), $plugin_name, $response->new_version ) )
+ ),
+ esc_attr( $response->new_version ),
+ wp_nonce_url( self_admin_url( 'update.php?action=upgrade-plugin&plugin=' ) . $file, 'upgrade-plugin_' . $file ),
+ sprintf(
+ 'class="update-link" aria-label="%s"',
+ /* translators: %s: plugin name */
+ esc_attr( sprintf( __( 'Update %s now' ), $plugin_name ) )
+ )
+ );
+ } else {
+ /* translators: 1: plugin name, 2: details URL, 3: additional link attributes, 4: version number 5: Update PHP page URL */
+ printf(
+ __( 'There is a new version of %1$s available, but it doesn&#8217;t work with your version of PHP. <a href="%2$s" %3$s>View version %4$s details</a> or <a href="%5$s">learn more about updating PHP</a>.' ),
+ $plugin_name,
+ esc_url( $details_url ),
+ sprintf(
+ 'class="thickbox open-plugin-details-modal" aria-label="%s"',
+ /* translators: 1: plugin name, 2: version number */
+ esc_attr( sprintf( __( 'View %1$s version %2$s details' ), $plugin_name, $response->new_version ) )
+ ),
+ esc_attr( $response->new_version ),
+ esc_url( wp_get_update_php_url() )
+ );
+ wp_update_php_annotation( '<br><em>', '</em>' );
+ }
+ }
+
+ /**
+ * Fires at the end of the update message container in each
+ * row of the plugins list table.
+ *
+ * The dynamic portion of the hook name, `$file`, refers to the path
+ * of the plugin's primary file relative to the plugins directory.
+ *
+ * @since 2.8.0
+ *
+ * @param array $plugin_data {
+ * An array of plugin metadata.
+ *
+ * @type string $name The human-readable name of the plugin.
+ * @type string $plugin_uri Plugin URI.
+ * @type string $version Plugin version.
+ * @type string $description Plugin description.
+ * @type string $author Plugin author.
+ * @type string $author_uri Plugin author URI.
+ * @type string $text_domain Plugin text domain.
+ * @type string $domain_path Relative path to the plugin's .mo file(s).
+ * @type bool $network Whether the plugin can only be activated network wide.
+ * @type string $title The human-readable title of the plugin.
+ * @type string $author_name Plugin author's name.
+ * @type bool $update Whether there's an available update. Default null.
+ * }
+ * @param array $response {
+ * An array of metadata about the available plugin update.
+ *
+ * @type int $id Plugin ID.
+ * @type string $slug Plugin slug.
+ * @type string $new_version New plugin version.
+ * @type string $url Plugin URL.
+ * @type string $package Plugin update package URL.
+ * }
+ */
+ do_action( "in_plugin_update_message-{$file}", $plugin_data, $response );
+
+ echo '</p></div></td></tr>';
+ }
+}
+
+/**
+ * @return array
+ */
+function get_theme_updates() {
+ $current = get_site_transient( 'update_themes' );
+
+ if ( ! isset( $current->response ) ) {
+ return array();
+ }
+
+ $update_themes = array();
+ foreach ( $current->response as $stylesheet => $data ) {
+ $update_themes[ $stylesheet ] = wp_get_theme( $stylesheet );
+ $update_themes[ $stylesheet ]->update = $data;
+ }
+
+ return $update_themes;
+}
+
+/**
+ * @since 3.1.0
+ */
+function wp_theme_update_rows() {
+ if ( ! current_user_can( 'update_themes' ) ) {
+ return;
+ }
+
+ $themes = get_site_transient( 'update_themes' );
+ if ( isset( $themes->response ) && is_array( $themes->response ) ) {
+ $themes = array_keys( $themes->response );
+
+ foreach ( $themes as $theme ) {
+ add_action( "after_theme_row_$theme", 'wp_theme_update_row', 10, 2 );
+ }
+ }
+}
+
+/**
+ * Displays update information for a theme.
+ *
+ * @param string $theme_key Theme stylesheet.
+ * @param WP_Theme $theme Theme object.
+ * @return false|void
+ */
+function wp_theme_update_row( $theme_key, $theme ) {
+ $current = get_site_transient( 'update_themes' );
+
+ if ( ! isset( $current->response[ $theme_key ] ) ) {
+ return false;
+ }
+
+ $response = $current->response[ $theme_key ];
+
+ $details_url = add_query_arg(
+ array(
+ 'TB_iframe' => 'true',
+ 'width' => 1024,
+ 'height' => 800,
+ ),
+ $current->response[ $theme_key ]['url']
+ );
+
+ /** @var WP_MS_Themes_List_Table $wp_list_table */
+ $wp_list_table = _get_list_table( 'WP_MS_Themes_List_Table' );
+
+ $active = $theme->is_allowed( 'network' ) ? ' active' : '';
+
+ echo '<tr class="plugin-update-tr' . $active . '" id="' . esc_attr( $theme->get_stylesheet() . '-update' ) . '" data-slug="' . esc_attr( $theme->get_stylesheet() ) . '"><td colspan="' . $wp_list_table->get_column_count() . '" class="plugin-update colspanchange"><div class="update-message notice inline notice-warning notice-alt"><p>';
+ if ( ! current_user_can( 'update_themes' ) ) {
+ /* translators: 1: theme name, 2: details URL, 3: additional link attributes, 4: version number */
+ printf(
+ __( 'There is a new version of %1$s available. <a href="%2$s" %3$s>View version %4$s details</a>.' ),
+ $theme['Name'],
+ esc_url( $details_url ),
+ sprintf(
+ 'class="thickbox open-plugin-details-modal" aria-label="%s"',
+ /* translators: 1: theme name, 2: version number */
+ esc_attr( sprintf( __( 'View %1$s version %2$s details' ), $theme['Name'], $response['new_version'] ) )
+ ),
+ $response['new_version']
+ );
+ } elseif ( empty( $response['package'] ) ) {
+ /* translators: 1: theme name, 2: details URL, 3: additional link attributes, 4: version number */
+ printf(
+ __( 'There is a new version of %1$s available. <a href="%2$s" %3$s>View version %4$s details</a>. <em>Automatic update is unavailable for this theme.</em>' ),
+ $theme['Name'],
+ esc_url( $details_url ),
+ sprintf(
+ 'class="thickbox open-plugin-details-modal" aria-label="%s"',
+ /* translators: 1: theme name, 2: version number */
+ esc_attr( sprintf( __( 'View %1$s version %2$s details' ), $theme['Name'], $response['new_version'] ) )
+ ),
+ $response['new_version']
+ );
+ } else {
+ /* translators: 1: theme name, 2: details URL, 3: additional link attributes, 4: version number, 5: update URL, 6: additional link attributes */
+ printf(
+ __( 'There is a new version of %1$s available. <a href="%2$s" %3$s>View version %4$s details</a> or <a href="%5$s" %6$s>update now</a>.' ),
+ $theme['Name'],
+ esc_url( $details_url ),
+ sprintf(
+ 'class="thickbox open-plugin-details-modal" aria-label="%s"',
+ /* translators: 1: theme name, 2: version number */
+ esc_attr( sprintf( __( 'View %1$s version %2$s details' ), $theme['Name'], $response['new_version'] ) )
+ ),
+ $response['new_version'],
+ wp_nonce_url( self_admin_url( 'update.php?action=upgrade-theme&theme=' ) . $theme_key, 'upgrade-theme_' . $theme_key ),
+ sprintf(
+ 'class="update-link" aria-label="%s"',
+ /* translators: %s: theme name */
+ esc_attr( sprintf( __( 'Update %s now' ), $theme['Name'] ) )
+ )
+ );
+ }
+
+ /**
+ * Fires at the end of the update message container in each
+ * row of the themes list table.
+ *
+ * The dynamic portion of the hook name, `$theme_key`, refers to
+ * the theme slug as found in the WordPress.org themes repository.
+ *
+ * @since 3.1.0
+ *
+ * @param WP_Theme $theme The WP_Theme object.
+ * @param array $response {
+ * An array of metadata about the available theme update.
+ *
+ * @type string $new_version New theme version.
+ * @type string $url Theme URL.
+ * @type string $package Theme update package URL.
+ * }
+ */
+ do_action( "in_theme_update_message-{$theme_key}", $theme, $response );
+
+ echo '</p></div></td></tr>';
+}
+
+/**
+ * @global int $upgrading
+ * @return false|void
+ */
+function maintenance_nag() {
+ include( ABSPATH . WPINC . '/version.php' ); // include an unmodified $wp_version
+ global $upgrading;
+ $nag = isset( $upgrading );
+ if ( ! $nag ) {
+ $failed = get_site_option( 'auto_core_update_failed' );
+ /*
+ * If an update failed critically, we may have copied over version.php but not other files.
+ * In that case, if the installation claims we're running the version we attempted, nag.
+ * This is serious enough to err on the side of nagging.
+ *
+ * If we simply failed to update before we tried to copy any files, then assume things are
+ * OK if they are now running the latest.
+ *
+ * This flag is cleared whenever a successful update occurs using Core_Upgrader.
+ */
+ $comparison = ! empty( $failed['critical'] ) ? '>=' : '>';
+ if ( version_compare( $failed['attempted'], $wp_version, $comparison ) ) {
+ $nag = true;
+ }
+ }
+
+ if ( ! $nag ) {
+ return false;
+ }
+
+ if ( current_user_can( 'update_core' ) ) {
+ $msg = sprintf( __( 'An automated WordPress update has failed to complete - <a href="%s">please attempt the update again now</a>.' ), 'update-core.php' );
+ } else {
+ $msg = __( 'An automated WordPress update has failed to complete! Please notify the site administrator.' );
+ }
+
+ echo "<div class='update-nag'>$msg</div>";
+}
+
+/**
+ * Prints the JavaScript templates for update admin notices.
+ *
+ * Template takes one argument with four values:
+ *
+ * param {object} data {
+ * Arguments for admin notice.
+ *
+ * @type string id ID of the notice.
+ * @type string className Class names for the notice.
+ * @type string message The notice's message.
+ * @type string type The type of update the notice is for. Either 'plugin' or 'theme'.
+ * }
+ *
+ * @since 4.6.0
+ */
+function wp_print_admin_notice_templates() {
+ ?>
+ <script id="tmpl-wp-updates-admin-notice" type="text/html">
+ <div <# if ( data.id ) { #>id="{{ data.id }}"<# } #> class="notice {{ data.className }}"><p>{{{ data.message }}}</p></div>
+ </script>
+ <script id="tmpl-wp-bulk-updates-admin-notice" type="text/html">
+ <div id="{{ data.id }}" class="{{ data.className }} notice <# if ( data.errors ) { #>notice-error<# } else { #>notice-success<# } #>">
+ <p>
+ <# if ( data.successes ) { #>
+ <# if ( 1 === data.successes ) { #>
+ <# if ( 'plugin' === data.type ) { #>
+ <?php
+ /* translators: %s: Number of plugins */
+ printf( __( '%s plugin successfully updated.' ), '{{ data.successes }}' );
+ ?>
+ <# } else { #>
+ <?php
+ /* translators: %s: Number of themes */
+ printf( __( '%s theme successfully updated.' ), '{{ data.successes }}' );
+ ?>
+ <# } #>
+ <# } else { #>
+ <# if ( 'plugin' === data.type ) { #>
+ <?php
+ /* translators: %s: Number of plugins */
+ printf( __( '%s plugins successfully updated.' ), '{{ data.successes }}' );
+ ?>
+ <# } else { #>
+ <?php
+ /* translators: %s: Number of themes */
+ printf( __( '%s themes successfully updated.' ), '{{ data.successes }}' );
+ ?>
+ <# } #>
+ <# } #>
+ <# } #>
+ <# if ( data.errors ) { #>
+ <button class="button-link bulk-action-errors-collapsed" aria-expanded="false">
+ <# if ( 1 === data.errors ) { #>
+ <?php
+ /* translators: %s: Number of failed updates */
+ printf( __( '%s update failed.' ), '{{ data.errors }}' );
+ ?>
+ <# } else { #>
+ <?php
+ /* translators: %s: Number of failed updates */
+ printf( __( '%s updates failed.' ), '{{ data.errors }}' );
+ ?>
+ <# } #>
+ <span class="screen-reader-text"><?php _e( 'Show more details' ); ?></span>
+ <span class="toggle-indicator" aria-hidden="true"></span>
+ </button>
+ <# } #>
+ </p>
+ <# if ( data.errors ) { #>
+ <ul class="bulk-action-errors hidden">
+ <# _.each( data.errorMessages, function( errorMessage ) { #>
+ <li>{{ errorMessage }}</li>
+ <# } ); #>
+ </ul>
+ <# } #>
+ </div>
+ </script>
+ <?php
+}
+
+/**
+ * Prints the JavaScript templates for update and deletion rows in list tables.
+ *
+ * The update template takes one argument with four values:
+ *
+ * param {object} data {
+ * Arguments for the update row
+ *
+ * @type string slug Plugin slug.
+ * @type string plugin Plugin base name.
+ * @type string colspan The number of table columns this row spans.
+ * @type string content The row content.
+ * }
+ *
+ * The delete template takes one argument with four values:
+ *
+ * param {object} data {
+ * Arguments for the update row
+ *
+ * @type string slug Plugin slug.
+ * @type string plugin Plugin base name.
+ * @type string name Plugin name.
+ * @type string colspan The number of table columns this row spans.
+ * }
+ *
+ * @since 4.6.0
+ */
+function wp_print_update_row_templates() {
+ ?>
+ <script id="tmpl-item-update-row" type="text/template">
+ <tr class="plugin-update-tr update" id="{{ data.slug }}-update" data-slug="{{ data.slug }}" <# if ( data.plugin ) { #>data-plugin="{{ data.plugin }}"<# } #>>
+ <td colspan="{{ data.colspan }}" class="plugin-update colspanchange">
+ {{{ data.content }}}
+ </td>
+ </tr>
+ </script>
+ <script id="tmpl-item-deleted-row" type="text/template">
+ <tr class="plugin-deleted-tr inactive deleted" id="{{ data.slug }}-deleted" data-slug="{{ data.slug }}" <# if ( data.plugin ) { #>data-plugin="{{ data.plugin }}"<# } #>>
+ <td colspan="{{ data.colspan }}" class="plugin-update colspanchange">
+ <# if ( data.plugin ) { #>
+ <?php
+ printf(
+ /* translators: %s: Plugin name */
+ _x( '%s was successfully deleted.', 'plugin' ),
+ '<strong>{{{ data.name }}}</strong>'
+ );
+ ?>
+ <# } else { #>
+ <?php
+ printf(
+ /* translators: %s: Theme name */
+ _x( '%s was successfully deleted.', 'theme' ),
+ '<strong>{{{ data.name }}}</strong>'
+ );
+ ?>
+ <# } #>
+ </td>
+ </tr>
+ </script>
+ <?php
+}
+
+/**
+ * Displays a notice when the user is in recovery mode.
+ *
+ * @since 5.2.0
+ */
+function wp_recovery_mode_nag() {
+ if ( ! wp_is_recovery_mode() ) {
+ return;
+ }
+
+ $url = wp_login_url();
+ $url = add_query_arg( 'action', WP_Recovery_Mode::EXIT_ACTION, $url );
+ $url = wp_nonce_url( $url, WP_Recovery_Mode::EXIT_ACTION );
+
+ ?>
+ <div class="notice notice-info">
+ <p>
+ <?php
+ printf(
+ /* translators: %s: Recovery Mode exit link */
+ __( 'You are in recovery mode. This means there may be an error with a theme or plugin. To exit recovery mode, log out or use the Exit button. <a href="%s">Exit Recovery Mode</a>' ),
+ esc_url( $url )
+ );
+ ?>
+ </p>
+ </div>
+ <?php
+}
diff --git a/www/crm/wp-admin/includes/upgrade.php b/www/crm/wp-admin/includes/upgrade.php
new file mode 100644
index 00000000..4de9b109
--- /dev/null
+++ b/www/crm/wp-admin/includes/upgrade.php
@@ -0,0 +1,3350 @@
+<?php
+/**
+ * WordPress Upgrade API
+ *
+ * Most of the functions are pluggable and can be overwritten.
+ *
+ * @package WordPress
+ * @subpackage Administration
+ */
+
+/** Include user installation customization script. */
+if ( file_exists( WP_CONTENT_DIR . '/install.php' ) ) {
+ require( WP_CONTENT_DIR . '/install.php' );
+}
+
+/** WordPress Administration API */
+require_once( ABSPATH . 'wp-admin/includes/admin.php' );
+
+/** WordPress Schema API */
+require_once( ABSPATH . 'wp-admin/includes/schema.php' );
+
+if ( ! function_exists( 'wp_install' ) ) :
+ /**
+ * Installs the site.
+ *
+ * Runs the required functions to set up and populate the database,
+ * including primary admin user and initial options.
+ *
+ * @since 2.1.0
+ *
+ * @param string $blog_title Site title.
+ * @param string $user_name User's username.
+ * @param string $user_email User's email.
+ * @param bool $public Whether site is public.
+ * @param string $deprecated Optional. Not used.
+ * @param string $user_password Optional. User's chosen password. Default empty (random password).
+ * @param string $language Optional. Language chosen. Default empty.
+ * @return array Array keys 'url', 'user_id', 'password', and 'password_message'.
+ */
+ function wp_install( $blog_title, $user_name, $user_email, $public, $deprecated = '', $user_password = '', $language = '' ) {
+ if ( ! empty( $deprecated ) ) {
+ _deprecated_argument( __FUNCTION__, '2.6.0' );
+ }
+
+ wp_check_mysql_version();
+ wp_cache_flush();
+ make_db_current_silent();
+ populate_options();
+ populate_roles();
+
+ update_option( 'blogname', $blog_title );
+ update_option( 'admin_email', $user_email );
+ update_option( 'blog_public', $public );
+
+ // Freshness of site - in the future, this could get more specific about actions taken, perhaps.
+ update_option( 'fresh_site', 1 );
+
+ if ( $language ) {
+ update_option( 'WPLANG', $language );
+ }
+
+ $guessurl = wp_guess_url();
+
+ update_option( 'siteurl', $guessurl );
+
+ // If not a public site, don't ping.
+ if ( ! $public ) {
+ update_option( 'default_pingback_flag', 0 );
+ }
+
+ /*
+ * Create default user. If the user already exists, the user tables are
+ * being shared among sites. Just set the role in that case.
+ */
+ $user_id = username_exists( $user_name );
+ $user_password = trim( $user_password );
+ $email_password = false;
+ if ( ! $user_id && empty( $user_password ) ) {
+ $user_password = wp_generate_password( 12, false );
+ $message = __( '<strong><em>Note that password</em></strong> carefully! It is a <em>random</em> password that was generated just for you.' );
+ $user_id = wp_create_user( $user_name, $user_password, $user_email );
+ update_user_option( $user_id, 'default_password_nag', true, true );
+ $email_password = true;
+ } elseif ( ! $user_id ) {
+ // Password has been provided
+ $message = '<em>' . __( 'Your chosen password.' ) . '</em>';
+ $user_id = wp_create_user( $user_name, $user_password, $user_email );
+ } else {
+ $message = __( 'User already exists. Password inherited.' );
+ }
+
+ $user = new WP_User( $user_id );
+ $user->set_role( 'administrator' );
+
+ wp_install_defaults( $user_id );
+
+ wp_install_maybe_enable_pretty_permalinks();
+
+ flush_rewrite_rules();
+
+ wp_new_blog_notification( $blog_title, $guessurl, $user_id, ( $email_password ? $user_password : __( 'The password you chose during installation.' ) ) );
+
+ wp_cache_flush();
+
+ /**
+ * Fires after a site is fully installed.
+ *
+ * @since 3.9.0
+ *
+ * @param WP_User $user The site owner.
+ */
+ do_action( 'wp_install', $user );
+
+ return array(
+ 'url' => $guessurl,
+ 'user_id' => $user_id,
+ 'password' => $user_password,
+ 'password_message' => $message,
+ );
+ }
+endif;
+
+if ( ! function_exists( 'wp_install_defaults' ) ) :
+ /**
+ * Creates the initial content for a newly-installed site.
+ *
+ * Adds the default "Uncategorized" category, the first post (with comment),
+ * first page, and default widgets for default theme for the current version.
+ *
+ * @since 2.1.0
+ *
+ * @global wpdb $wpdb
+ * @global WP_Rewrite $wp_rewrite
+ * @global string $table_prefix
+ *
+ * @param int $user_id User ID.
+ */
+ function wp_install_defaults( $user_id ) {
+ global $wpdb, $wp_rewrite, $table_prefix;
+
+ // Default category
+ $cat_name = __( 'Uncategorized' );
+ /* translators: Default category slug */
+ $cat_slug = sanitize_title( _x( 'Uncategorized', 'Default category slug' ) );
+
+ if ( global_terms_enabled() ) {
+ $cat_id = $wpdb->get_var( $wpdb->prepare( "SELECT cat_ID FROM {$wpdb->sitecategories} WHERE category_nicename = %s", $cat_slug ) );
+ if ( $cat_id == null ) {
+ $wpdb->insert(
+ $wpdb->sitecategories,
+ array(
+ 'cat_ID' => 0,
+ 'cat_name' => $cat_name,
+ 'category_nicename' => $cat_slug,
+ 'last_updated' => current_time( 'mysql', true ),
+ )
+ );
+ $cat_id = $wpdb->insert_id;
+ }
+ update_option( 'default_category', $cat_id );
+ } else {
+ $cat_id = 1;
+ }
+
+ $wpdb->insert(
+ $wpdb->terms,
+ array(
+ 'term_id' => $cat_id,
+ 'name' => $cat_name,
+ 'slug' => $cat_slug,
+ 'term_group' => 0,
+ )
+ );
+ $wpdb->insert(
+ $wpdb->term_taxonomy,
+ array(
+ 'term_id' => $cat_id,
+ 'taxonomy' => 'category',
+ 'description' => '',
+ 'parent' => 0,
+ 'count' => 1,
+ )
+ );
+ $cat_tt_id = $wpdb->insert_id;
+
+ // First post
+ $now = current_time( 'mysql' );
+ $now_gmt = current_time( 'mysql', 1 );
+ $first_post_guid = get_option( 'home' ) . '/?p=1';
+
+ if ( is_multisite() ) {
+ $first_post = get_site_option( 'first_post' );
+
+ if ( ! $first_post ) {
+ $first_post = "<!-- wp:paragraph -->\n<p>" .
+ /* translators: first post content, %s: site link */
+ __( 'Welcome to %s. This is your first post. Edit or delete it, then start writing!' ) .
+ "</p>\n<!-- /wp:paragraph -->";
+ }
+
+ $first_post = sprintf(
+ $first_post,
+ sprintf( '<a href="%s">%s</a>', esc_url( network_home_url() ), get_network()->site_name )
+ );
+
+ // Back-compat for pre-4.4
+ $first_post = str_replace( 'SITE_URL', esc_url( network_home_url() ), $first_post );
+ $first_post = str_replace( 'SITE_NAME', get_network()->site_name, $first_post );
+ } else {
+ $first_post = "<!-- wp:paragraph -->\n<p>" .
+ /* translators: first post content, %s: site link */
+ __( 'Welcome to WordPress. This is your first post. Edit or delete it, then start writing!' ) .
+ "</p>\n<!-- /wp:paragraph -->";
+ }
+
+ $wpdb->insert(
+ $wpdb->posts,
+ array(
+ 'post_author' => $user_id,
+ 'post_date' => $now,
+ 'post_date_gmt' => $now_gmt,
+ 'post_content' => $first_post,
+ 'post_excerpt' => '',
+ 'post_title' => __( 'Hello world!' ),
+ /* translators: Default post slug */
+ 'post_name' => sanitize_title( _x( 'hello-world', 'Default post slug' ) ),
+ 'post_modified' => $now,
+ 'post_modified_gmt' => $now_gmt,
+ 'guid' => $first_post_guid,
+ 'comment_count' => 1,
+ 'to_ping' => '',
+ 'pinged' => '',
+ 'post_content_filtered' => '',
+ )
+ );
+ $wpdb->insert(
+ $wpdb->term_relationships,
+ array(
+ 'term_taxonomy_id' => $cat_tt_id,
+ 'object_id' => 1,
+ )
+ );
+
+ // Default comment
+ if ( is_multisite() ) {
+ $first_comment_author = get_site_option( 'first_comment_author' );
+ $first_comment_email = get_site_option( 'first_comment_email' );
+ $first_comment_url = get_site_option( 'first_comment_url', network_home_url() );
+ $first_comment = get_site_option( 'first_comment' );
+ }
+
+ $first_comment_author = ! empty( $first_comment_author ) ? $first_comment_author : __( 'A WordPress Commenter' );
+ $first_comment_email = ! empty( $first_comment_email ) ? $first_comment_email : 'wapuu@wordpress.example';
+ $first_comment_url = ! empty( $first_comment_url ) ? $first_comment_url : 'https://wordpress.org/';
+ $first_comment = ! empty( $first_comment ) ? $first_comment : __(
+ 'Hi, this is a comment.
+To get started with moderating, editing, and deleting comments, please visit the Comments screen in the dashboard.
+Commenter avatars come from <a href="https://gravatar.com">Gravatar</a>.'
+ );
+ $wpdb->insert(
+ $wpdb->comments,
+ array(
+ 'comment_post_ID' => 1,
+ 'comment_author' => $first_comment_author,
+ 'comment_author_email' => $first_comment_email,
+ 'comment_author_url' => $first_comment_url,
+ 'comment_date' => $now,
+ 'comment_date_gmt' => $now_gmt,
+ 'comment_content' => $first_comment,
+ )
+ );
+
+ // First Page
+ if ( is_multisite() ) {
+ $first_page = get_site_option( 'first_page' );
+ }
+
+ if ( empty( $first_page ) ) {
+ $first_page = "<!-- wp:paragraph -->\n<p>";
+ /* translators: first page content */
+ $first_page .= __( "This is an example page. It's different from a blog post because it will stay in one place and will show up in your site navigation (in most themes). Most people start with an About page that introduces them to potential site visitors. It might say something like this:" );
+ $first_page .= "</p>\n<!-- /wp:paragraph -->\n\n";
+
+ $first_page .= "<!-- wp:quote -->\n<blockquote class=\"wp-block-quote\"><p>";
+ /* translators: first page content */
+ $first_page .= __( "Hi there! I'm a bike messenger by day, aspiring actor by night, and this is my website. I live in Los Angeles, have a great dog named Jack, and I like pi&#241;a coladas. (And gettin' caught in the rain.)" );
+ $first_page .= "</p></blockquote>\n<!-- /wp:quote -->\n\n";
+
+ $first_page .= "<!-- wp:paragraph -->\n<p>";
+ /* translators: first page content */
+ $first_page .= __( '...or something like this:' );
+ $first_page .= "</p>\n<!-- /wp:paragraph -->\n\n";
+
+ $first_page .= "<!-- wp:quote -->\n<blockquote class=\"wp-block-quote\"><p>";
+ /* translators: first page content */
+ $first_page .= __( 'The XYZ Doohickey Company was founded in 1971, and has been providing quality doohickeys to the public ever since. Located in Gotham City, XYZ employs over 2,000 people and does all kinds of awesome things for the Gotham community.' );
+ $first_page .= "</p></blockquote>\n<!-- /wp:quote -->\n\n";
+
+ $first_page .= "<!-- wp:paragraph -->\n<p>";
+ $first_page .= sprintf(
+ /* translators: first page content, %s: site admin URL */
+ __( 'As a new WordPress user, you should go to <a href="%s">your dashboard</a> to delete this page and create new pages for your content. Have fun!' ),
+ admin_url()
+ );
+ $first_page .= "</p>\n<!-- /wp:paragraph -->";
+ }
+
+ $first_post_guid = get_option( 'home' ) . '/?page_id=2';
+ $wpdb->insert(
+ $wpdb->posts,
+ array(
+ 'post_author' => $user_id,
+ 'post_date' => $now,
+ 'post_date_gmt' => $now_gmt,
+ 'post_content' => $first_page,
+ 'post_excerpt' => '',
+ 'comment_status' => 'closed',
+ 'post_title' => __( 'Sample Page' ),
+ /* translators: Default page slug */
+ 'post_name' => __( 'sample-page' ),
+ 'post_modified' => $now,
+ 'post_modified_gmt' => $now_gmt,
+ 'guid' => $first_post_guid,
+ 'post_type' => 'page',
+ 'to_ping' => '',
+ 'pinged' => '',
+ 'post_content_filtered' => '',
+ )
+ );
+ $wpdb->insert(
+ $wpdb->postmeta,
+ array(
+ 'post_id' => 2,
+ 'meta_key' => '_wp_page_template',
+ 'meta_value' => 'default',
+ )
+ );
+
+ // Privacy Policy page
+ if ( is_multisite() ) {
+ // Disable by default unless the suggested content is provided.
+ $privacy_policy_content = get_site_option( 'default_privacy_policy_content' );
+ } else {
+ if ( ! class_exists( 'WP_Privacy_Policy_Content' ) ) {
+ include_once( ABSPATH . 'wp-admin/includes/misc.php' );
+ }
+
+ $privacy_policy_content = WP_Privacy_Policy_Content::get_default_content();
+ }
+
+ if ( ! empty( $privacy_policy_content ) ) {
+ $privacy_policy_guid = get_option( 'home' ) . '/?page_id=3';
+
+ $wpdb->insert(
+ $wpdb->posts,
+ array(
+ 'post_author' => $user_id,
+ 'post_date' => $now,
+ 'post_date_gmt' => $now_gmt,
+ 'post_content' => $privacy_policy_content,
+ 'post_excerpt' => '',
+ 'comment_status' => 'closed',
+ 'post_title' => __( 'Privacy Policy' ),
+ /* translators: Privacy Policy page slug */
+ 'post_name' => __( 'privacy-policy' ),
+ 'post_modified' => $now,
+ 'post_modified_gmt' => $now_gmt,
+ 'guid' => $privacy_policy_guid,
+ 'post_type' => 'page',
+ 'post_status' => 'draft',
+ 'to_ping' => '',
+ 'pinged' => '',
+ 'post_content_filtered' => '',
+ )
+ );
+ $wpdb->insert(
+ $wpdb->postmeta,
+ array(
+ 'post_id' => 3,
+ 'meta_key' => '_wp_page_template',
+ 'meta_value' => 'default',
+ )
+ );
+ update_option( 'wp_page_for_privacy_policy', 3 );
+ }
+
+ // Set up default widgets for default theme.
+ update_option(
+ 'widget_search',
+ array(
+ 2 => array( 'title' => '' ),
+ '_multiwidget' => 1,
+ )
+ );
+ update_option(
+ 'widget_recent-posts',
+ array(
+ 2 => array(
+ 'title' => '',
+ 'number' => 5,
+ ),
+ '_multiwidget' => 1,
+ )
+ );
+ update_option(
+ 'widget_recent-comments',
+ array(
+ 2 => array(
+ 'title' => '',
+ 'number' => 5,
+ ),
+ '_multiwidget' => 1,
+ )
+ );
+ update_option(
+ 'widget_archives',
+ array(
+ 2 => array(
+ 'title' => '',
+ 'count' => 0,
+ 'dropdown' => 0,
+ ),
+ '_multiwidget' => 1,
+ )
+ );
+ update_option(
+ 'widget_categories',
+ array(
+ 2 => array(
+ 'title' => '',
+ 'count' => 0,
+ 'hierarchical' => 0,
+ 'dropdown' => 0,
+ ),
+ '_multiwidget' => 1,
+ )
+ );
+ update_option(
+ 'widget_meta',
+ array(
+ 2 => array( 'title' => '' ),
+ '_multiwidget' => 1,
+ )
+ );
+ update_option(
+ 'sidebars_widgets',
+ array(
+ 'wp_inactive_widgets' => array(),
+ 'sidebar-1' => array(
+ 0 => 'search-2',
+ 1 => 'recent-posts-2',
+ 2 => 'recent-comments-2',
+ 3 => 'archives-2',
+ 4 => 'categories-2',
+ 5 => 'meta-2',
+ ),
+ 'array_version' => 3,
+ )
+ );
+ if ( ! is_multisite() ) {
+ update_user_meta( $user_id, 'show_welcome_panel', 1 );
+ } elseif ( ! is_super_admin( $user_id ) && ! metadata_exists( 'user', $user_id, 'show_welcome_panel' ) ) {
+ update_user_meta( $user_id, 'show_welcome_panel', 2 );
+ }
+
+ if ( is_multisite() ) {
+ // Flush rules to pick up the new page.
+ $wp_rewrite->init();
+ $wp_rewrite->flush_rules();
+
+ $user = new WP_User( $user_id );
+ $wpdb->update( $wpdb->options, array( 'option_value' => $user->user_email ), array( 'option_name' => 'admin_email' ) );
+
+ // Remove all perms except for the login user.
+ $wpdb->query( $wpdb->prepare( "DELETE FROM $wpdb->usermeta WHERE user_id != %d AND meta_key = %s", $user_id, $table_prefix . 'user_level' ) );
+ $wpdb->query( $wpdb->prepare( "DELETE FROM $wpdb->usermeta WHERE user_id != %d AND meta_key = %s", $user_id, $table_prefix . 'capabilities' ) );
+
+ // Delete any caps that snuck into the previously active blog. (Hardcoded to blog 1 for now.) TODO: Get previous_blog_id.
+ if ( ! is_super_admin( $user_id ) && $user_id != 1 ) {
+ $wpdb->delete(
+ $wpdb->usermeta,
+ array(
+ 'user_id' => $user_id,
+ 'meta_key' => $wpdb->base_prefix . '1_capabilities',
+ )
+ );
+ }
+ }
+ }
+endif;
+
+/**
+ * Maybe enable pretty permalinks on installation.
+ *
+ * If after enabling pretty permalinks don't work, fallback to query-string permalinks.
+ *
+ * @since 4.2.0
+ *
+ * @global WP_Rewrite $wp_rewrite WordPress rewrite component.
+ *
+ * @return bool Whether pretty permalinks are enabled. False otherwise.
+ */
+function wp_install_maybe_enable_pretty_permalinks() {
+ global $wp_rewrite;
+
+ // Bail if a permalink structure is already enabled.
+ if ( get_option( 'permalink_structure' ) ) {
+ return true;
+ }
+
+ /*
+ * The Permalink structures to attempt.
+ *
+ * The first is designed for mod_rewrite or nginx rewriting.
+ *
+ * The second is PATHINFO-based permalinks for web server configurations
+ * without a true rewrite module enabled.
+ */
+ $permalink_structures = array(
+ '/%year%/%monthnum%/%day%/%postname%/',
+ '/index.php/%year%/%monthnum%/%day%/%postname%/',
+ );
+
+ foreach ( (array) $permalink_structures as $permalink_structure ) {
+ $wp_rewrite->set_permalink_structure( $permalink_structure );
+
+ /*
+ * Flush rules with the hard option to force refresh of the web-server's
+ * rewrite config file (e.g. .htaccess or web.config).
+ */
+ $wp_rewrite->flush_rules( true );
+
+ $test_url = '';
+
+ // Test against a real WordPress Post
+ $first_post = get_page_by_path( sanitize_title( _x( 'hello-world', 'Default post slug' ) ), OBJECT, 'post' );
+ if ( $first_post ) {
+ $test_url = get_permalink( $first_post->ID );
+ }
+
+ /*
+ * Send a request to the site, and check whether
+ * the 'x-pingback' header is returned as expected.
+ *
+ * Uses wp_remote_get() instead of wp_remote_head() because web servers
+ * can block head requests.
+ */
+ $response = wp_remote_get( $test_url, array( 'timeout' => 5 ) );
+ $x_pingback_header = wp_remote_retrieve_header( $response, 'x-pingback' );
+ $pretty_permalinks = $x_pingback_header && $x_pingback_header === get_bloginfo( 'pingback_url' );
+
+ if ( $pretty_permalinks ) {
+ return true;
+ }
+ }
+
+ /*
+ * If it makes it this far, pretty permalinks failed.
+ * Fallback to query-string permalinks.
+ */
+ $wp_rewrite->set_permalink_structure( '' );
+ $wp_rewrite->flush_rules( true );
+
+ return false;
+}
+
+if ( ! function_exists( 'wp_new_blog_notification' ) ) :
+ /**
+ * Notifies the site admin that the setup is complete.
+ *
+ * Sends an email with wp_mail to the new administrator that the site setup is complete,
+ * and provides them with a record of their login credentials.
+ *
+ * @since 2.1.0
+ *
+ * @param string $blog_title Site title.
+ * @param string $blog_url Site url.
+ * @param int $user_id User ID.
+ * @param string $password User's Password.
+ */
+ function wp_new_blog_notification( $blog_title, $blog_url, $user_id, $password ) {
+ $user = new WP_User( $user_id );
+ $email = $user->user_email;
+ $name = $user->user_login;
+ $login_url = wp_login_url();
+ /* translators: New site notification email. 1: New site URL, 2: User login, 3: User password or password reset link, 4: Login URL */
+ $message = sprintf(
+ __(
+ 'Your new WordPress site has been successfully set up at:
+
+%1$s
+
+You can log in to the administrator account with the following information:
+
+Username: %2$s
+Password: %3$s
+Log in here: %4$s
+
+We hope you enjoy your new site. Thanks!
+
+--The WordPress Team
+https://wordpress.org/
+'
+ ),
+ $blog_url,
+ $name,
+ $password,
+ $login_url
+ );
+
+ @wp_mail( $email, __( 'New WordPress Site' ), $message );
+ }
+endif;
+
+if ( ! function_exists( 'wp_upgrade' ) ) :
+ /**
+ * Runs WordPress Upgrade functions.
+ *
+ * Upgrades the database if needed during a site update.
+ *
+ * @since 2.1.0
+ *
+ * @global int $wp_current_db_version
+ * @global int $wp_db_version
+ * @global wpdb $wpdb WordPress database abstraction object.
+ */
+ function wp_upgrade() {
+ global $wp_current_db_version, $wp_db_version, $wpdb;
+
+ $wp_current_db_version = __get_option( 'db_version' );
+
+ // We are up-to-date. Nothing to do.
+ if ( $wp_db_version == $wp_current_db_version ) {
+ return;
+ }
+
+ if ( ! is_blog_installed() ) {
+ return;
+ }
+
+ wp_check_mysql_version();
+ wp_cache_flush();
+ pre_schema_upgrade();
+ make_db_current_silent();
+ upgrade_all();
+ if ( is_multisite() && is_main_site() ) {
+ upgrade_network();
+ }
+ wp_cache_flush();
+
+ if ( is_multisite() ) {
+ $site_id = get_current_blog_id();
+
+ if ( $wpdb->get_row( $wpdb->prepare( "SELECT blog_id FROM {$wpdb->blog_versions} WHERE blog_id = %d", $site_id ) ) ) {
+ $wpdb->query( $wpdb->prepare( "UPDATE {$wpdb->blog_versions} SET db_version = %d WHERE blog_id = %d", $wp_db_version, $site_id ) );
+ } else {
+ $wpdb->query( $wpdb->prepare( "INSERT INTO {$wpdb->blog_versions} ( `blog_id` , `db_version` , `last_updated` ) VALUES ( %d, %d, NOW() );", $site_id, $wp_db_version ) );
+ }
+ }
+
+ /**
+ * Fires after a site is fully upgraded.
+ *
+ * @since 3.9.0
+ *
+ * @param int $wp_db_version The new $wp_db_version.
+ * @param int $wp_current_db_version The old (current) $wp_db_version.
+ */
+ do_action( 'wp_upgrade', $wp_db_version, $wp_current_db_version );
+ }
+endif;
+
+/**
+ * Functions to be called in installation and upgrade scripts.
+ *
+ * Contains conditional checks to determine which upgrade scripts to run,
+ * based on database version and WP version being updated-to.
+ *
+ * @ignore
+ * @since 1.0.1
+ *
+ * @global int $wp_current_db_version
+ * @global int $wp_db_version
+ */
+function upgrade_all() {
+ global $wp_current_db_version, $wp_db_version;
+ $wp_current_db_version = __get_option( 'db_version' );
+
+ // We are up-to-date. Nothing to do.
+ if ( $wp_db_version == $wp_current_db_version ) {
+ return;
+ }
+
+ // If the version is not set in the DB, try to guess the version.
+ if ( empty( $wp_current_db_version ) ) {
+ $wp_current_db_version = 0;
+
+ // If the template option exists, we have 1.5.
+ $template = __get_option( 'template' );
+ if ( ! empty( $template ) ) {
+ $wp_current_db_version = 2541;
+ }
+ }
+
+ if ( $wp_current_db_version < 6039 ) {
+ upgrade_230_options_table();
+ }
+
+ populate_options();
+
+ if ( $wp_current_db_version < 2541 ) {
+ upgrade_100();
+ upgrade_101();
+ upgrade_110();
+ upgrade_130();
+ }
+
+ if ( $wp_current_db_version < 3308 ) {
+ upgrade_160();
+ }
+
+ if ( $wp_current_db_version < 4772 ) {
+ upgrade_210();
+ }
+
+ if ( $wp_current_db_version < 4351 ) {
+ upgrade_old_slugs();
+ }
+
+ if ( $wp_current_db_version < 5539 ) {
+ upgrade_230();
+ }
+
+ if ( $wp_current_db_version < 6124 ) {
+ upgrade_230_old_tables();
+ }
+
+ if ( $wp_current_db_version < 7499 ) {
+ upgrade_250();
+ }
+
+ if ( $wp_current_db_version < 7935 ) {
+ upgrade_252();
+ }
+
+ if ( $wp_current_db_version < 8201 ) {
+ upgrade_260();
+ }
+
+ if ( $wp_current_db_version < 8989 ) {
+ upgrade_270();
+ }
+
+ if ( $wp_current_db_version < 10360 ) {
+ upgrade_280();
+ }
+
+ if ( $wp_current_db_version < 11958 ) {
+ upgrade_290();
+ }
+
+ if ( $wp_current_db_version < 15260 ) {
+ upgrade_300();
+ }
+
+ if ( $wp_current_db_version < 19389 ) {
+ upgrade_330();
+ }
+
+ if ( $wp_current_db_version < 20080 ) {
+ upgrade_340();
+ }
+
+ if ( $wp_current_db_version < 22422 ) {
+ upgrade_350();
+ }
+
+ if ( $wp_current_db_version < 25824 ) {
+ upgrade_370();
+ }
+
+ if ( $wp_current_db_version < 26148 ) {
+ upgrade_372();
+ }
+
+ if ( $wp_current_db_version < 26691 ) {
+ upgrade_380();
+ }
+
+ if ( $wp_current_db_version < 29630 ) {
+ upgrade_400();
+ }
+
+ if ( $wp_current_db_version < 33055 ) {
+ upgrade_430();
+ }
+
+ if ( $wp_current_db_version < 33056 ) {
+ upgrade_431();
+ }
+
+ if ( $wp_current_db_version < 35700 ) {
+ upgrade_440();
+ }
+
+ if ( $wp_current_db_version < 36686 ) {
+ upgrade_450();
+ }
+
+ if ( $wp_current_db_version < 37965 ) {
+ upgrade_460();
+ }
+
+ if ( $wp_current_db_version < 44719 ) {
+ upgrade_510();
+ }
+
+ maybe_disable_link_manager();
+
+ maybe_disable_automattic_widgets();
+
+ update_option( 'db_version', $wp_db_version );
+ update_option( 'db_upgraded', true );
+}
+
+/**
+ * Execute changes made in WordPress 1.0.
+ *
+ * @ignore
+ * @since 1.0.0
+ *
+ * @global wpdb $wpdb WordPress database abstraction object.
+ */
+function upgrade_100() {
+ global $wpdb;
+
+ // Get the title and ID of every post, post_name to check if it already has a value
+ $posts = $wpdb->get_results( "SELECT ID, post_title, post_name FROM $wpdb->posts WHERE post_name = ''" );
+ if ( $posts ) {
+ foreach ( $posts as $post ) {
+ if ( '' == $post->post_name ) {
+ $newtitle = sanitize_title( $post->post_title );
+ $wpdb->query( $wpdb->prepare( "UPDATE $wpdb->posts SET post_name = %s WHERE ID = %d", $newtitle, $post->ID ) );
+ }
+ }
+ }
+
+ $categories = $wpdb->get_results( "SELECT cat_ID, cat_name, category_nicename FROM $wpdb->categories" );
+ foreach ( $categories as $category ) {
+ if ( '' == $category->category_nicename ) {
+ $newtitle = sanitize_title( $category->cat_name );
+ $wpdb->update( $wpdb->categories, array( 'category_nicename' => $newtitle ), array( 'cat_ID' => $category->cat_ID ) );
+ }
+ }
+
+ $sql = "UPDATE $wpdb->options
+ SET option_value = REPLACE(option_value, 'wp-links/links-images/', 'wp-images/links/')
+ WHERE option_name LIKE %s
+ AND option_value LIKE %s";
+ $wpdb->query( $wpdb->prepare( $sql, $wpdb->esc_like( 'links_rating_image' ) . '%', $wpdb->esc_like( 'wp-links/links-images/' ) . '%' ) );
+
+ $done_ids = $wpdb->get_results( "SELECT DISTINCT post_id FROM $wpdb->post2cat" );
+ if ( $done_ids ) :
+ $done_posts = array();
+ foreach ( $done_ids as $done_id ) :
+ $done_posts[] = $done_id->post_id;
+ endforeach;
+ $catwhere = ' AND ID NOT IN (' . implode( ',', $done_posts ) . ')';
+ else :
+ $catwhere = '';
+ endif;
+
+ $allposts = $wpdb->get_results( "SELECT ID, post_category FROM $wpdb->posts WHERE post_category != '0' $catwhere" );
+ if ( $allposts ) :
+ foreach ( $allposts as $post ) {
+ // Check to see if it's already been imported
+ $cat = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM $wpdb->post2cat WHERE post_id = %d AND category_id = %d", $post->ID, $post->post_category ) );
+ if ( ! $cat && 0 != $post->post_category ) { // If there's no result
+ $wpdb->insert(
+ $wpdb->post2cat,
+ array(
+ 'post_id' => $post->ID,
+ 'category_id' => $post->post_category,
+ )
+ );
+ }
+ }
+ endif;
+}
+
+/**
+ * Execute changes made in WordPress 1.0.1.
+ *
+ * @ignore
+ * @since 1.0.1
+ *
+ * @global wpdb $wpdb WordPress database abstraction object.
+ */
+function upgrade_101() {
+ global $wpdb;
+
+ // Clean up indices, add a few
+ add_clean_index( $wpdb->posts, 'post_name' );
+ add_clean_index( $wpdb->posts, 'post_status' );
+ add_clean_index( $wpdb->categories, 'category_nicename' );
+ add_clean_index( $wpdb->comments, 'comment_approved' );
+ add_clean_index( $wpdb->comments, 'comment_post_ID' );
+ add_clean_index( $wpdb->links, 'link_category' );
+ add_clean_index( $wpdb->links, 'link_visible' );
+}
+
+/**
+ * Execute changes made in WordPress 1.2.
+ *
+ * @ignore
+ * @since 1.2.0
+ *
+ * @global wpdb $wpdb WordPress database abstraction object.
+ */
+function upgrade_110() {
+ global $wpdb;
+
+ // Set user_nicename.
+ $users = $wpdb->get_results( "SELECT ID, user_nickname, user_nicename FROM $wpdb->users" );
+ foreach ( $users as $user ) {
+ if ( '' == $user->user_nicename ) {
+ $newname = sanitize_title( $user->user_nickname );
+ $wpdb->update( $wpdb->users, array( 'user_nicename' => $newname ), array( 'ID' => $user->ID ) );
+ }
+ }
+
+ $users = $wpdb->get_results( "SELECT ID, user_pass from $wpdb->users" );
+ foreach ( $users as $row ) {
+ if ( ! preg_match( '/^[A-Fa-f0-9]{32}$/', $row->user_pass ) ) {
+ $wpdb->update( $wpdb->users, array( 'user_pass' => md5( $row->user_pass ) ), array( 'ID' => $row->ID ) );
+ }
+ }
+
+ // Get the GMT offset, we'll use that later on
+ $all_options = get_alloptions_110();
+
+ $time_difference = $all_options->time_difference;
+
+ $server_time = time() + date( 'Z' );
+ $weblogger_time = $server_time + $time_difference * HOUR_IN_SECONDS;
+ $gmt_time = time();
+
+ $diff_gmt_server = ( $gmt_time - $server_time ) / HOUR_IN_SECONDS;
+ $diff_weblogger_server = ( $weblogger_time - $server_time ) / HOUR_IN_SECONDS;
+ $diff_gmt_weblogger = $diff_gmt_server - $diff_weblogger_server;
+ $gmt_offset = -$diff_gmt_weblogger;
+
+ // Add a gmt_offset option, with value $gmt_offset
+ add_option( 'gmt_offset', $gmt_offset );
+
+ // Check if we already set the GMT fields (if we did, then
+ // MAX(post_date_gmt) can't be '0000-00-00 00:00:00'
+ // <michel_v> I just slapped myself silly for not thinking about it earlier
+ $got_gmt_fields = ! ( $wpdb->get_var( "SELECT MAX(post_date_gmt) FROM $wpdb->posts" ) == '0000-00-00 00:00:00' );
+
+ if ( ! $got_gmt_fields ) {
+
+ // Add or subtract time to all dates, to get GMT dates
+ $add_hours = intval( $diff_gmt_weblogger );
+ $add_minutes = intval( 60 * ( $diff_gmt_weblogger - $add_hours ) );
+ $wpdb->query( "UPDATE $wpdb->posts SET post_date_gmt = DATE_ADD(post_date, INTERVAL '$add_hours:$add_minutes' HOUR_MINUTE)" );
+ $wpdb->query( "UPDATE $wpdb->posts SET post_modified = post_date" );
+ $wpdb->query( "UPDATE $wpdb->posts SET post_modified_gmt = DATE_ADD(post_modified, INTERVAL '$add_hours:$add_minutes' HOUR_MINUTE) WHERE post_modified != '0000-00-00 00:00:00'" );
+ $wpdb->query( "UPDATE $wpdb->comments SET comment_date_gmt = DATE_ADD(comment_date, INTERVAL '$add_hours:$add_minutes' HOUR_MINUTE)" );
+ $wpdb->query( "UPDATE $wpdb->users SET user_registered = DATE_ADD(user_registered, INTERVAL '$add_hours:$add_minutes' HOUR_MINUTE)" );
+ }
+
+}
+
+/**
+ * Execute changes made in WordPress 1.5.
+ *
+ * @ignore
+ * @since 1.5.0
+ *
+ * @global wpdb $wpdb WordPress database abstraction object.
+ */
+function upgrade_130() {
+ global $wpdb;
+
+ // Remove extraneous backslashes.
+ $posts = $wpdb->get_results( "SELECT ID, post_title, post_content, post_excerpt, guid, post_date, post_name, post_status, post_author FROM $wpdb->posts" );
+ if ( $posts ) {
+ foreach ( $posts as $post ) {
+ $post_content = addslashes( deslash( $post->post_content ) );
+ $post_title = addslashes( deslash( $post->post_title ) );
+ $post_excerpt = addslashes( deslash( $post->post_excerpt ) );
+ if ( empty( $post->guid ) ) {
+ $guid = get_permalink( $post->ID );
+ } else {
+ $guid = $post->guid;
+ }
+
+ $wpdb->update( $wpdb->posts, compact( 'post_title', 'post_content', 'post_excerpt', 'guid' ), array( 'ID' => $post->ID ) );
+
+ }
+ }
+
+ // Remove extraneous backslashes.
+ $comments = $wpdb->get_results( "SELECT comment_ID, comment_author, comment_content FROM $wpdb->comments" );
+ if ( $comments ) {
+ foreach ( $comments as $comment ) {
+ $comment_content = deslash( $comment->comment_content );
+ $comment_author = deslash( $comment->comment_author );
+
+ $wpdb->update( $wpdb->comments, compact( 'comment_content', 'comment_author' ), array( 'comment_ID' => $comment->comment_ID ) );
+ }
+ }
+
+ // Remove extraneous backslashes.
+ $links = $wpdb->get_results( "SELECT link_id, link_name, link_description FROM $wpdb->links" );
+ if ( $links ) {
+ foreach ( $links as $link ) {
+ $link_name = deslash( $link->link_name );
+ $link_description = deslash( $link->link_description );
+
+ $wpdb->update( $wpdb->links, compact( 'link_name', 'link_description' ), array( 'link_id' => $link->link_id ) );
+ }
+ }
+
+ $active_plugins = __get_option( 'active_plugins' );
+
+ /*
+ * If plugins are not stored in an array, they're stored in the old
+ * newline separated format. Convert to new format.
+ */
+ if ( ! is_array( $active_plugins ) ) {
+ $active_plugins = explode( "\n", trim( $active_plugins ) );
+ update_option( 'active_plugins', $active_plugins );
+ }
+
+ // Obsolete tables
+ $wpdb->query( 'DROP TABLE IF EXISTS ' . $wpdb->prefix . 'optionvalues' );
+ $wpdb->query( 'DROP TABLE IF EXISTS ' . $wpdb->prefix . 'optiontypes' );
+ $wpdb->query( 'DROP TABLE IF EXISTS ' . $wpdb->prefix . 'optiongroups' );
+ $wpdb->query( 'DROP TABLE IF EXISTS ' . $wpdb->prefix . 'optiongroup_options' );
+
+ // Update comments table to use comment_type
+ $wpdb->query( "UPDATE $wpdb->comments SET comment_type='trackback', comment_content = REPLACE(comment_content, '<trackback />', '') WHERE comment_content LIKE '<trackback />%'" );
+ $wpdb->query( "UPDATE $wpdb->comments SET comment_type='pingback', comment_content = REPLACE(comment_content, '<pingback />', '') WHERE comment_content LIKE '<pingback />%'" );
+
+ // Some versions have multiple duplicate option_name rows with the same values
+ $options = $wpdb->get_results( "SELECT option_name, COUNT(option_name) AS dupes FROM `$wpdb->options` GROUP BY option_name" );
+ foreach ( $options as $option ) {
+ if ( 1 != $option->dupes ) { // Could this be done in the query?
+ $limit = $option->dupes - 1;
+ $dupe_ids = $wpdb->get_col( $wpdb->prepare( "SELECT option_id FROM $wpdb->options WHERE option_name = %s LIMIT %d", $option->option_name, $limit ) );
+ if ( $dupe_ids ) {
+ $dupe_ids = join( $dupe_ids, ',' );
+ $wpdb->query( "DELETE FROM $wpdb->options WHERE option_id IN ($dupe_ids)" );
+ }
+ }
+ }
+
+ make_site_theme();
+}
+
+/**
+ * Execute changes made in WordPress 2.0.
+ *
+ * @ignore
+ * @since 2.0.0
+ *
+ * @global wpdb $wpdb WordPress database abstraction object.
+ * @global int $wp_current_db_version
+ */
+function upgrade_160() {
+ global $wpdb, $wp_current_db_version;
+
+ populate_roles_160();
+
+ $users = $wpdb->get_results( "SELECT * FROM $wpdb->users" );
+ foreach ( $users as $user ) :
+ if ( ! empty( $user->user_firstname ) ) {
+ update_user_meta( $user->ID, 'first_name', wp_slash( $user->user_firstname ) );
+ }
+ if ( ! empty( $user->user_lastname ) ) {
+ update_user_meta( $user->ID, 'last_name', wp_slash( $user->user_lastname ) );
+ }
+ if ( ! empty( $user->user_nickname ) ) {
+ update_user_meta( $user->ID, 'nickname', wp_slash( $user->user_nickname ) );
+ }
+ if ( ! empty( $user->user_level ) ) {
+ update_user_meta( $user->ID, $wpdb->prefix . 'user_level', $user->user_level );
+ }
+ if ( ! empty( $user->user_icq ) ) {
+ update_user_meta( $user->ID, 'icq', wp_slash( $user->user_icq ) );
+ }
+ if ( ! empty( $user->user_aim ) ) {
+ update_user_meta( $user->ID, 'aim', wp_slash( $user->user_aim ) );
+ }
+ if ( ! empty( $user->user_msn ) ) {
+ update_user_meta( $user->ID, 'msn', wp_slash( $user->user_msn ) );
+ }
+ if ( ! empty( $user->user_yim ) ) {
+ update_user_meta( $user->ID, 'yim', wp_slash( $user->user_icq ) );
+ }
+ if ( ! empty( $user->user_description ) ) {
+ update_user_meta( $user->ID, 'description', wp_slash( $user->user_description ) );
+ }
+
+ if ( isset( $user->user_idmode ) ) :
+ $idmode = $user->user_idmode;
+ if ( $idmode == 'nickname' ) {
+ $id = $user->user_nickname;
+ }
+ if ( $idmode == 'login' ) {
+ $id = $user->user_login;
+ }
+ if ( $idmode == 'firstname' ) {
+ $id = $user->user_firstname;
+ }
+ if ( $idmode == 'lastname' ) {
+ $id = $user->user_lastname;
+ }
+ if ( $idmode == 'namefl' ) {
+ $id = $user->user_firstname . ' ' . $user->user_lastname;
+ }
+ if ( $idmode == 'namelf' ) {
+ $id = $user->user_lastname . ' ' . $user->user_firstname;
+ }
+ if ( ! $idmode ) {
+ $id = $user->user_nickname;
+ }
+ $wpdb->update( $wpdb->users, array( 'display_name' => $id ), array( 'ID' => $user->ID ) );
+ endif;
+
+ // FIXME: RESET_CAPS is temporary code to reset roles and caps if flag is set.
+ $caps = get_user_meta( $user->ID, $wpdb->prefix . 'capabilities' );
+ if ( empty( $caps ) || defined( 'RESET_CAPS' ) ) {
+ $level = get_user_meta( $user->ID, $wpdb->prefix . 'user_level', true );
+ $role = translate_level_to_role( $level );
+ update_user_meta( $user->ID, $wpdb->prefix . 'capabilities', array( $role => true ) );
+ }
+
+ endforeach;
+ $old_user_fields = array( 'user_firstname', 'user_lastname', 'user_icq', 'user_aim', 'user_msn', 'user_yim', 'user_idmode', 'user_ip', 'user_domain', 'user_browser', 'user_description', 'user_nickname', 'user_level' );
+ $wpdb->hide_errors();
+ foreach ( $old_user_fields as $old ) {
+ $wpdb->query( "ALTER TABLE $wpdb->users DROP $old" );
+ }
+ $wpdb->show_errors();
+
+ // Populate comment_count field of posts table.
+ $comments = $wpdb->get_results( "SELECT comment_post_ID, COUNT(*) as c FROM $wpdb->comments WHERE comment_approved = '1' GROUP BY comment_post_ID" );
+ if ( is_array( $comments ) ) {
+ foreach ( $comments as $comment ) {
+ $wpdb->update( $wpdb->posts, array( 'comment_count' => $comment->c ), array( 'ID' => $comment->comment_post_ID ) );
+ }
+ }
+
+ /*
+ * Some alpha versions used a post status of object instead of attachment
+ * and put the mime type in post_type instead of post_mime_type.
+ */
+ if ( $wp_current_db_version > 2541 && $wp_current_db_version <= 3091 ) {
+ $objects = $wpdb->get_results( "SELECT ID, post_type FROM $wpdb->posts WHERE post_status = 'object'" );
+ foreach ( $objects as $object ) {
+ $wpdb->update(
+ $wpdb->posts,
+ array(
+ 'post_status' => 'attachment',
+ 'post_mime_type' => $object->post_type,
+ 'post_type' => '',
+ ),
+ array( 'ID' => $object->ID )
+ );
+
+ $meta = get_post_meta( $object->ID, 'imagedata', true );
+ if ( ! empty( $meta['file'] ) ) {
+ update_attached_file( $object->ID, $meta['file'] );
+ }
+ }
+ }
+}
+
+/**
+ * Execute changes made in WordPress 2.1.
+ *
+ * @ignore
+ * @since 2.1.0
+ *
+ * @global wpdb $wpdb WordPress database abstraction object.
+ * @global int $wp_current_db_version
+ */
+function upgrade_210() {
+ global $wpdb, $wp_current_db_version;
+
+ if ( $wp_current_db_version < 3506 ) {
+ // Update status and type.
+ $posts = $wpdb->get_results( "SELECT ID, post_status FROM $wpdb->posts" );
+
+ if ( ! empty( $posts ) ) {
+ foreach ( $posts as $post ) {
+ $status = $post->post_status;
+ $type = 'post';
+
+ if ( 'static' == $status ) {
+ $status = 'publish';
+ $type = 'page';
+ } elseif ( 'attachment' == $status ) {
+ $status = 'inherit';
+ $type = 'attachment';
+ }
+
+ $wpdb->query( $wpdb->prepare( "UPDATE $wpdb->posts SET post_status = %s, post_type = %s WHERE ID = %d", $status, $type, $post->ID ) );
+ }
+ }
+ }
+
+ if ( $wp_current_db_version < 3845 ) {
+ populate_roles_210();
+ }
+
+ if ( $wp_current_db_version < 3531 ) {
+ // Give future posts a post_status of future.
+ $now = gmdate( 'Y-m-d H:i:59' );
+ $wpdb->query( "UPDATE $wpdb->posts SET post_status = 'future' WHERE post_status = 'publish' AND post_date_gmt > '$now'" );
+
+ $posts = $wpdb->get_results( "SELECT ID, post_date FROM $wpdb->posts WHERE post_status ='future'" );
+ if ( ! empty( $posts ) ) {
+ foreach ( $posts as $post ) {
+ wp_schedule_single_event( mysql2date( 'U', $post->post_date, false ), 'publish_future_post', array( $post->ID ) );
+ }
+ }
+ }
+}
+
+/**
+ * Execute changes made in WordPress 2.3.
+ *
+ * @ignore
+ * @since 2.3.0
+ *
+ * @global wpdb $wpdb WordPress database abstraction object.
+ * @global int $wp_current_db_version
+ */
+function upgrade_230() {
+ global $wp_current_db_version, $wpdb;
+
+ if ( $wp_current_db_version < 5200 ) {
+ populate_roles_230();
+ }
+
+ // Convert categories to terms.
+ $tt_ids = array();
+ $have_tags = false;
+ $categories = $wpdb->get_results( "SELECT * FROM $wpdb->categories ORDER BY cat_ID" );
+ foreach ( $categories as $category ) {
+ $term_id = (int) $category->cat_ID;
+ $name = $category->cat_name;
+ $description = $category->category_description;
+ $slug = $category->category_nicename;
+ $parent = $category->category_parent;
+ $term_group = 0;
+
+ // Associate terms with the same slug in a term group and make slugs unique.
+ if ( $exists = $wpdb->get_results( $wpdb->prepare( "SELECT term_id, term_group FROM $wpdb->terms WHERE slug = %s", $slug ) ) ) {
+ $term_group = $exists[0]->term_group;
+ $id = $exists[0]->term_id;
+ $num = 2;
+ do {
+ $alt_slug = $slug . "-$num";
+ $num++;
+ $slug_check = $wpdb->get_var( $wpdb->prepare( "SELECT slug FROM $wpdb->terms WHERE slug = %s", $alt_slug ) );
+ } while ( $slug_check );
+
+ $slug = $alt_slug;
+
+ if ( empty( $term_group ) ) {
+ $term_group = $wpdb->get_var( "SELECT MAX(term_group) FROM $wpdb->terms GROUP BY term_group" ) + 1;
+ $wpdb->query( $wpdb->prepare( "UPDATE $wpdb->terms SET term_group = %d WHERE term_id = %d", $term_group, $id ) );
+ }
+ }
+
+ $wpdb->query(
+ $wpdb->prepare(
+ "INSERT INTO $wpdb->terms (term_id, name, slug, term_group) VALUES
+ (%d, %s, %s, %d)",
+ $term_id,
+ $name,
+ $slug,
+ $term_group
+ )
+ );
+
+ $count = 0;
+ if ( ! empty( $category->category_count ) ) {
+ $count = (int) $category->category_count;
+ $taxonomy = 'category';
+ $wpdb->query( $wpdb->prepare( "INSERT INTO $wpdb->term_taxonomy (term_id, taxonomy, description, parent, count) VALUES ( %d, %s, %s, %d, %d)", $term_id, $taxonomy, $description, $parent, $count ) );
+ $tt_ids[ $term_id ][ $taxonomy ] = (int) $wpdb->insert_id;
+ }
+
+ if ( ! empty( $category->link_count ) ) {
+ $count = (int) $category->link_count;
+ $taxonomy = 'link_category';
+ $wpdb->query( $wpdb->prepare( "INSERT INTO $wpdb->term_taxonomy (term_id, taxonomy, description, parent, count) VALUES ( %d, %s, %s, %d, %d)", $term_id, $taxonomy, $description, $parent, $count ) );
+ $tt_ids[ $term_id ][ $taxonomy ] = (int) $wpdb->insert_id;
+ }
+
+ if ( ! empty( $category->tag_count ) ) {
+ $have_tags = true;
+ $count = (int) $category->tag_count;
+ $taxonomy = 'post_tag';
+ $wpdb->insert( $wpdb->term_taxonomy, compact( 'term_id', 'taxonomy', 'description', 'parent', 'count' ) );
+ $tt_ids[ $term_id ][ $taxonomy ] = (int) $wpdb->insert_id;
+ }
+
+ if ( empty( $count ) ) {
+ $count = 0;
+ $taxonomy = 'category';
+ $wpdb->insert( $wpdb->term_taxonomy, compact( 'term_id', 'taxonomy', 'description', 'parent', 'count' ) );
+ $tt_ids[ $term_id ][ $taxonomy ] = (int) $wpdb->insert_id;
+ }
+ }
+
+ $select = 'post_id, category_id';
+ if ( $have_tags ) {
+ $select .= ', rel_type';
+ }
+
+ $posts = $wpdb->get_results( "SELECT $select FROM $wpdb->post2cat GROUP BY post_id, category_id" );
+ foreach ( $posts as $post ) {
+ $post_id = (int) $post->post_id;
+ $term_id = (int) $post->category_id;
+ $taxonomy = 'category';
+ if ( ! empty( $post->rel_type ) && 'tag' == $post->rel_type ) {
+ $taxonomy = 'tag';
+ }
+ $tt_id = $tt_ids[ $term_id ][ $taxonomy ];
+ if ( empty( $tt_id ) ) {
+ continue;
+ }
+
+ $wpdb->insert(
+ $wpdb->term_relationships,
+ array(
+ 'object_id' => $post_id,
+ 'term_taxonomy_id' => $tt_id,
+ )
+ );
+ }
+
+ // < 3570 we used linkcategories. >= 3570 we used categories and link2cat.
+ if ( $wp_current_db_version < 3570 ) {
+ /*
+ * Create link_category terms for link categories. Create a map of link
+ * cat IDs to link_category terms.
+ */
+ $link_cat_id_map = array();
+ $default_link_cat = 0;
+ $tt_ids = array();
+ $link_cats = $wpdb->get_results( 'SELECT cat_id, cat_name FROM ' . $wpdb->prefix . 'linkcategories' );
+ foreach ( $link_cats as $category ) {
+ $cat_id = (int) $category->cat_id;
+ $term_id = 0;
+ $name = wp_slash( $category->cat_name );
+ $slug = sanitize_title( $name );
+ $term_group = 0;
+
+ // Associate terms with the same slug in a term group and make slugs unique.
+ if ( $exists = $wpdb->get_results( $wpdb->prepare( "SELECT term_id, term_group FROM $wpdb->terms WHERE slug = %s", $slug ) ) ) {
+ $term_group = $exists[0]->term_group;
+ $term_id = $exists[0]->term_id;
+ }
+
+ if ( empty( $term_id ) ) {
+ $wpdb->insert( $wpdb->terms, compact( 'name', 'slug', 'term_group' ) );
+ $term_id = (int) $wpdb->insert_id;
+ }
+
+ $link_cat_id_map[ $cat_id ] = $term_id;
+ $default_link_cat = $term_id;
+
+ $wpdb->insert(
+ $wpdb->term_taxonomy,
+ array(
+ 'term_id' => $term_id,
+ 'taxonomy' => 'link_category',
+ 'description' => '',
+ 'parent' => 0,
+ 'count' => 0,
+ )
+ );
+ $tt_ids[ $term_id ] = (int) $wpdb->insert_id;
+ }
+
+ // Associate links to cats.
+ $links = $wpdb->get_results( "SELECT link_id, link_category FROM $wpdb->links" );
+ if ( ! empty( $links ) ) {
+ foreach ( $links as $link ) {
+ if ( 0 == $link->link_category ) {
+ continue;
+ }
+ if ( ! isset( $link_cat_id_map[ $link->link_category ] ) ) {
+ continue;
+ }
+ $term_id = $link_cat_id_map[ $link->link_category ];
+ $tt_id = $tt_ids[ $term_id ];
+ if ( empty( $tt_id ) ) {
+ continue;
+ }
+
+ $wpdb->insert(
+ $wpdb->term_relationships,
+ array(
+ 'object_id' => $link->link_id,
+ 'term_taxonomy_id' => $tt_id,
+ )
+ );
+ }
+ }
+
+ // Set default to the last category we grabbed during the upgrade loop.
+ update_option( 'default_link_category', $default_link_cat );
+ } else {
+ $links = $wpdb->get_results( "SELECT link_id, category_id FROM $wpdb->link2cat GROUP BY link_id, category_id" );
+ foreach ( $links as $link ) {
+ $link_id = (int) $link->link_id;
+ $term_id = (int) $link->category_id;
+ $taxonomy = 'link_category';
+ $tt_id = $tt_ids[ $term_id ][ $taxonomy ];
+ if ( empty( $tt_id ) ) {
+ continue;
+ }
+ $wpdb->insert(
+ $wpdb->term_relationships,
+ array(
+ 'object_id' => $link_id,
+ 'term_taxonomy_id' => $tt_id,
+ )
+ );
+ }
+ }
+
+ if ( $wp_current_db_version < 4772 ) {
+ // Obsolete linkcategories table
+ $wpdb->query( 'DROP TABLE IF EXISTS ' . $wpdb->prefix . 'linkcategories' );
+ }
+
+ // Recalculate all counts
+ $terms = $wpdb->get_results( "SELECT term_taxonomy_id, taxonomy FROM $wpdb->term_taxonomy" );
+ foreach ( (array) $terms as $term ) {
+ if ( ( 'post_tag' == $term->taxonomy ) || ( 'category' == $term->taxonomy ) ) {
+ $count = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(*) FROM $wpdb->term_relationships, $wpdb->posts WHERE $wpdb->posts.ID = $wpdb->term_relationships.object_id AND post_status = 'publish' AND post_type = 'post' AND term_taxonomy_id = %d", $term->term_taxonomy_id ) );
+ } else {
+ $count = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(*) FROM $wpdb->term_relationships WHERE term_taxonomy_id = %d", $term->term_taxonomy_id ) );
+ }
+ $wpdb->update( $wpdb->term_taxonomy, array( 'count' => $count ), array( 'term_taxonomy_id' => $term->term_taxonomy_id ) );
+ }
+}
+
+/**
+ * Remove old options from the database.
+ *
+ * @ignore
+ * @since 2.3.0
+ *
+ * @global wpdb $wpdb WordPress database abstraction object.
+ */
+function upgrade_230_options_table() {
+ global $wpdb;
+ $old_options_fields = array( 'option_can_override', 'option_type', 'option_width', 'option_height', 'option_description', 'option_admin_level' );
+ $wpdb->hide_errors();
+ foreach ( $old_options_fields as $old ) {
+ $wpdb->query( "ALTER TABLE $wpdb->options DROP $old" );
+ }
+ $wpdb->show_errors();
+}
+
+/**
+ * Remove old categories, link2cat, and post2cat database tables.
+ *
+ * @ignore
+ * @since 2.3.0
+ *
+ * @global wpdb $wpdb WordPress database abstraction object.
+ */
+function upgrade_230_old_tables() {
+ global $wpdb;
+ $wpdb->query( 'DROP TABLE IF EXISTS ' . $wpdb->prefix . 'categories' );
+ $wpdb->query( 'DROP TABLE IF EXISTS ' . $wpdb->prefix . 'link2cat' );
+ $wpdb->query( 'DROP TABLE IF EXISTS ' . $wpdb->prefix . 'post2cat' );
+}
+
+/**
+ * Upgrade old slugs made in version 2.2.
+ *
+ * @ignore
+ * @since 2.2.0
+ *
+ * @global wpdb $wpdb WordPress database abstraction object.
+ */
+function upgrade_old_slugs() {
+ // Upgrade people who were using the Redirect Old Slugs plugin.
+ global $wpdb;
+ $wpdb->query( "UPDATE $wpdb->postmeta SET meta_key = '_wp_old_slug' WHERE meta_key = 'old_slug'" );
+}
+
+/**
+ * Execute changes made in WordPress 2.5.0.
+ *
+ * @ignore
+ * @since 2.5.0
+ *
+ * @global int $wp_current_db_version
+ */
+function upgrade_250() {
+ global $wp_current_db_version;
+
+ if ( $wp_current_db_version < 6689 ) {
+ populate_roles_250();
+ }
+
+}
+
+/**
+ * Execute changes made in WordPress 2.5.2.
+ *
+ * @ignore
+ * @since 2.5.2
+ *
+ * @global wpdb $wpdb WordPress database abstraction object.
+ */
+function upgrade_252() {
+ global $wpdb;
+
+ $wpdb->query( "UPDATE $wpdb->users SET user_activation_key = ''" );
+}
+
+/**
+ * Execute changes made in WordPress 2.6.
+ *
+ * @ignore
+ * @since 2.6.0
+ *
+ * @global int $wp_current_db_version
+ */
+function upgrade_260() {
+ global $wp_current_db_version;
+
+ if ( $wp_current_db_version < 8000 ) {
+ populate_roles_260();
+ }
+}
+
+/**
+ * Execute changes made in WordPress 2.7.
+ *
+ * @ignore
+ * @since 2.7.0
+ *
+ * @global wpdb $wpdb WordPress database abstraction object.
+ * @global int $wp_current_db_version
+ */
+function upgrade_270() {
+ global $wpdb, $wp_current_db_version;
+
+ if ( $wp_current_db_version < 8980 ) {
+ populate_roles_270();
+ }
+
+ // Update post_date for unpublished posts with empty timestamp
+ if ( $wp_current_db_version < 8921 ) {
+ $wpdb->query( "UPDATE $wpdb->posts SET post_date = post_modified WHERE post_date = '0000-00-00 00:00:00'" );
+ }
+}
+
+/**
+ * Execute changes made in WordPress 2.8.
+ *
+ * @ignore
+ * @since 2.8.0
+ *
+ * @global int $wp_current_db_version
+ * @global wpdb $wpdb WordPress database abstraction object.
+ */
+function upgrade_280() {
+ global $wp_current_db_version, $wpdb;
+
+ if ( $wp_current_db_version < 10360 ) {
+ populate_roles_280();
+ }
+ if ( is_multisite() ) {
+ $start = 0;
+ while ( $rows = $wpdb->get_results( "SELECT option_name, option_value FROM $wpdb->options ORDER BY option_id LIMIT $start, 20" ) ) {
+ foreach ( $rows as $row ) {
+ $value = $row->option_value;
+ if ( ! @unserialize( $value ) ) {
+ $value = stripslashes( $value );
+ }
+ if ( $value !== $row->option_value ) {
+ update_option( $row->option_name, $value );
+ }
+ }
+ $start += 20;
+ }
+ clean_blog_cache( get_current_blog_id() );
+ }
+}
+
+/**
+ * Execute changes made in WordPress 2.9.
+ *
+ * @ignore
+ * @since 2.9.0
+ *
+ * @global int $wp_current_db_version
+ */
+function upgrade_290() {
+ global $wp_current_db_version;
+
+ if ( $wp_current_db_version < 11958 ) {
+ // Previously, setting depth to 1 would redundantly disable threading, but now 2 is the minimum depth to avoid confusion
+ if ( get_option( 'thread_comments_depth' ) == '1' ) {
+ update_option( 'thread_comments_depth', 2 );
+ update_option( 'thread_comments', 0 );
+ }
+ }
+}
+
+/**
+ * Execute changes made in WordPress 3.0.
+ *
+ * @ignore
+ * @since 3.0.0
+ *
+ * @global int $wp_current_db_version
+ * @global wpdb $wpdb WordPress database abstraction object.
+ */
+function upgrade_300() {
+ global $wp_current_db_version, $wpdb;
+
+ if ( $wp_current_db_version < 15093 ) {
+ populate_roles_300();
+ }
+
+ if ( $wp_current_db_version < 14139 && is_multisite() && is_main_site() && ! defined( 'MULTISITE' ) && get_site_option( 'siteurl' ) === false ) {
+ add_site_option( 'siteurl', '' );
+ }
+
+ // 3.0 screen options key name changes.
+ if ( wp_should_upgrade_global_tables() ) {
+ $sql = "DELETE FROM $wpdb->usermeta
+ WHERE meta_key LIKE %s
+ OR meta_key LIKE %s
+ OR meta_key LIKE %s
+ OR meta_key LIKE %s
+ OR meta_key LIKE %s
+ OR meta_key LIKE %s
+ OR meta_key = 'manageedittagscolumnshidden'
+ OR meta_key = 'managecategoriescolumnshidden'
+ OR meta_key = 'manageedit-tagscolumnshidden'
+ OR meta_key = 'manageeditcolumnshidden'
+ OR meta_key = 'categories_per_page'
+ OR meta_key = 'edit_tags_per_page'";
+ $prefix = $wpdb->esc_like( $wpdb->base_prefix );
+ $wpdb->query(
+ $wpdb->prepare(
+ $sql,
+ $prefix . '%' . $wpdb->esc_like( 'meta-box-hidden' ) . '%',
+ $prefix . '%' . $wpdb->esc_like( 'closedpostboxes' ) . '%',
+ $prefix . '%' . $wpdb->esc_like( 'manage-' ) . '%' . $wpdb->esc_like( '-columns-hidden' ) . '%',
+ $prefix . '%' . $wpdb->esc_like( 'meta-box-order' ) . '%',
+ $prefix . '%' . $wpdb->esc_like( 'metaboxorder' ) . '%',
+ $prefix . '%' . $wpdb->esc_like( 'screen_layout' ) . '%'
+ )
+ );
+ }
+
+}
+
+/**
+ * Execute changes made in WordPress 3.3.
+ *
+ * @ignore
+ * @since 3.3.0
+ *
+ * @global int $wp_current_db_version
+ * @global wpdb $wpdb
+ * @global array $wp_registered_widgets
+ * @global array $sidebars_widgets
+ */
+function upgrade_330() {
+ global $wp_current_db_version, $wpdb, $wp_registered_widgets, $sidebars_widgets;
+
+ if ( $wp_current_db_version < 19061 && wp_should_upgrade_global_tables() ) {
+ $wpdb->query( "DELETE FROM $wpdb->usermeta WHERE meta_key IN ('show_admin_bar_admin', 'plugins_last_view')" );
+ }
+
+ if ( $wp_current_db_version >= 11548 ) {
+ return;
+ }
+
+ $sidebars_widgets = get_option( 'sidebars_widgets', array() );
+ $_sidebars_widgets = array();
+
+ if ( isset( $sidebars_widgets['wp_inactive_widgets'] ) || empty( $sidebars_widgets ) ) {
+ $sidebars_widgets['array_version'] = 3;
+ } elseif ( ! isset( $sidebars_widgets['array_version'] ) ) {
+ $sidebars_widgets['array_version'] = 1;
+ }
+
+ switch ( $sidebars_widgets['array_version'] ) {
+ case 1:
+ foreach ( (array) $sidebars_widgets as $index => $sidebar ) {
+ if ( is_array( $sidebar ) ) {
+ foreach ( (array) $sidebar as $i => $name ) {
+ $id = strtolower( $name );
+ if ( isset( $wp_registered_widgets[ $id ] ) ) {
+ $_sidebars_widgets[ $index ][ $i ] = $id;
+ continue;
+ }
+ $id = sanitize_title( $name );
+ if ( isset( $wp_registered_widgets[ $id ] ) ) {
+ $_sidebars_widgets[ $index ][ $i ] = $id;
+ continue;
+ }
+
+ $found = false;
+
+ foreach ( $wp_registered_widgets as $widget_id => $widget ) {
+ if ( strtolower( $widget['name'] ) == strtolower( $name ) ) {
+ $_sidebars_widgets[ $index ][ $i ] = $widget['id'];
+ $found = true;
+ break;
+ } elseif ( sanitize_title( $widget['name'] ) == sanitize_title( $name ) ) {
+ $_sidebars_widgets[ $index ][ $i ] = $widget['id'];
+ $found = true;
+ break;
+ }
+ }
+
+ if ( $found ) {
+ continue;
+ }
+
+ unset( $_sidebars_widgets[ $index ][ $i ] );
+ }
+ }
+ }
+ $_sidebars_widgets['array_version'] = 2;
+ $sidebars_widgets = $_sidebars_widgets;
+ unset( $_sidebars_widgets );
+
+ // intentional fall-through to upgrade to the next version.
+ case 2:
+ $sidebars_widgets = retrieve_widgets();
+ $sidebars_widgets['array_version'] = 3;
+ update_option( 'sidebars_widgets', $sidebars_widgets );
+ }
+}
+
+/**
+ * Execute changes made in WordPress 3.4.
+ *
+ * @ignore
+ * @since 3.4.0
+ *
+ * @global int $wp_current_db_version
+ * @global wpdb $wpdb
+ */
+function upgrade_340() {
+ global $wp_current_db_version, $wpdb;
+
+ if ( $wp_current_db_version < 19798 ) {
+ $wpdb->hide_errors();
+ $wpdb->query( "ALTER TABLE $wpdb->options DROP COLUMN blog_id" );
+ $wpdb->show_errors();
+ }
+
+ if ( $wp_current_db_version < 19799 ) {
+ $wpdb->hide_errors();
+ $wpdb->query( "ALTER TABLE $wpdb->comments DROP INDEX comment_approved" );
+ $wpdb->show_errors();
+ }
+
+ if ( $wp_current_db_version < 20022 && wp_should_upgrade_global_tables() ) {
+ $wpdb->query( "DELETE FROM $wpdb->usermeta WHERE meta_key = 'themes_last_view'" );
+ }
+
+ if ( $wp_current_db_version < 20080 ) {
+ if ( 'yes' == $wpdb->get_var( "SELECT autoload FROM $wpdb->options WHERE option_name = 'uninstall_plugins'" ) ) {
+ $uninstall_plugins = get_option( 'uninstall_plugins' );
+ delete_option( 'uninstall_plugins' );
+ add_option( 'uninstall_plugins', $uninstall_plugins, null, 'no' );
+ }
+ }
+}
+
+/**
+ * Execute changes made in WordPress 3.5.
+ *
+ * @ignore
+ * @since 3.5.0
+ *
+ * @global int $wp_current_db_version
+ * @global wpdb $wpdb
+ */
+function upgrade_350() {
+ global $wp_current_db_version, $wpdb;
+
+ if ( $wp_current_db_version < 22006 && $wpdb->get_var( "SELECT link_id FROM $wpdb->links LIMIT 1" ) ) {
+ update_option( 'link_manager_enabled', 1 ); // Previously set to 0 by populate_options()
+ }
+
+ if ( $wp_current_db_version < 21811 && wp_should_upgrade_global_tables() ) {
+ $meta_keys = array();
+ foreach ( array_merge( get_post_types(), get_taxonomies() ) as $name ) {
+ if ( false !== strpos( $name, '-' ) ) {
+ $meta_keys[] = 'edit_' . str_replace( '-', '_', $name ) . '_per_page';
+ }
+ }
+ if ( $meta_keys ) {
+ $meta_keys = implode( "', '", $meta_keys );
+ $wpdb->query( "DELETE FROM $wpdb->usermeta WHERE meta_key IN ('$meta_keys')" );
+ }
+ }
+
+ if ( $wp_current_db_version < 22422 && $term = get_term_by( 'slug', 'post-format-standard', 'post_format' ) ) {
+ wp_delete_term( $term->term_id, 'post_format' );
+ }
+}
+
+/**
+ * Execute changes made in WordPress 3.7.
+ *
+ * @ignore
+ * @since 3.7.0
+ *
+ * @global int $wp_current_db_version
+ */
+function upgrade_370() {
+ global $wp_current_db_version;
+ if ( $wp_current_db_version < 25824 ) {
+ wp_clear_scheduled_hook( 'wp_auto_updates_maybe_update' );
+ }
+}
+
+/**
+ * Execute changes made in WordPress 3.7.2.
+ *
+ * @ignore
+ * @since 3.7.2
+ * @since 3.8.0
+ *
+ * @global int $wp_current_db_version
+ */
+function upgrade_372() {
+ global $wp_current_db_version;
+ if ( $wp_current_db_version < 26148 ) {
+ wp_clear_scheduled_hook( 'wp_maybe_auto_update' );
+ }
+}
+
+/**
+ * Execute changes made in WordPress 3.8.0.
+ *
+ * @ignore
+ * @since 3.8.0
+ *
+ * @global int $wp_current_db_version
+ */
+function upgrade_380() {
+ global $wp_current_db_version;
+ if ( $wp_current_db_version < 26691 ) {
+ deactivate_plugins( array( 'mp6/mp6.php' ), true );
+ }
+}
+
+/**
+ * Execute changes made in WordPress 4.0.0.
+ *
+ * @ignore
+ * @since 4.0.0
+ *
+ * @global int $wp_current_db_version
+ */
+function upgrade_400() {
+ global $wp_current_db_version;
+ if ( $wp_current_db_version < 29630 ) {
+ if ( ! is_multisite() && false === get_option( 'WPLANG' ) ) {
+ if ( defined( 'WPLANG' ) && ( '' !== WPLANG ) && in_array( WPLANG, get_available_languages() ) ) {
+ update_option( 'WPLANG', WPLANG );
+ } else {
+ update_option( 'WPLANG', '' );
+ }
+ }
+ }
+}
+
+/**
+ * Execute changes made in WordPress 4.2.0.
+ *
+ * @ignore
+ * @since 4.2.0
+ *
+ * @global int $wp_current_db_version
+ * @global wpdb $wpdb
+ */
+function upgrade_420() {}
+
+/**
+ * Executes changes made in WordPress 4.3.0.
+ *
+ * @ignore
+ * @since 4.3.0
+ *
+ * @global int $wp_current_db_version Current version.
+ * @global wpdb $wpdb WordPress database abstraction object.
+ */
+function upgrade_430() {
+ global $wp_current_db_version, $wpdb;
+
+ if ( $wp_current_db_version < 32364 ) {
+ upgrade_430_fix_comments();
+ }
+
+ // Shared terms are split in a separate process.
+ if ( $wp_current_db_version < 32814 ) {
+ update_option( 'finished_splitting_shared_terms', 0 );
+ wp_schedule_single_event( time() + ( 1 * MINUTE_IN_SECONDS ), 'wp_split_shared_term_batch' );
+ }
+
+ if ( $wp_current_db_version < 33055 && 'utf8mb4' === $wpdb->charset ) {
+ if ( is_multisite() ) {
+ $tables = $wpdb->tables( 'blog' );
+ } else {
+ $tables = $wpdb->tables( 'all' );
+ if ( ! wp_should_upgrade_global_tables() ) {
+ $global_tables = $wpdb->tables( 'global' );
+ $tables = array_diff_assoc( $tables, $global_tables );
+ }
+ }
+
+ foreach ( $tables as $table ) {
+ maybe_convert_table_to_utf8mb4( $table );
+ }
+ }
+}
+
+/**
+ * Executes comments changes made in WordPress 4.3.0.
+ *
+ * @ignore
+ * @since 4.3.0
+ *
+ * @global int $wp_current_db_version Current version.
+ * @global wpdb $wpdb WordPress database abstraction object.
+ */
+function upgrade_430_fix_comments() {
+ global $wp_current_db_version, $wpdb;
+
+ $content_length = $wpdb->get_col_length( $wpdb->comments, 'comment_content' );
+
+ if ( is_wp_error( $content_length ) ) {
+ return;
+ }
+
+ if ( false === $content_length ) {
+ $content_length = array(
+ 'type' => 'byte',
+ 'length' => 65535,
+ );
+ } elseif ( ! is_array( $content_length ) ) {
+ $length = (int) $content_length > 0 ? (int) $content_length : 65535;
+ $content_length = array(
+ 'type' => 'byte',
+ 'length' => $length,
+ );
+ }
+
+ if ( 'byte' !== $content_length['type'] || 0 === $content_length['length'] ) {
+ // Sites with malformed DB schemas are on their own.
+ return;
+ }
+
+ $allowed_length = intval( $content_length['length'] ) - 10;
+
+ $comments = $wpdb->get_results(
+ "SELECT `comment_ID` FROM `{$wpdb->comments}`
+ WHERE `comment_date_gmt` > '2015-04-26'
+ AND LENGTH( `comment_content` ) >= {$allowed_length}
+ AND ( `comment_content` LIKE '%<%' OR `comment_content` LIKE '%>%' )"
+ );
+
+ foreach ( $comments as $comment ) {
+ wp_delete_comment( $comment->comment_ID, true );
+ }
+}
+
+/**
+ * Executes changes made in WordPress 4.3.1.
+ *
+ * @ignore
+ * @since 4.3.1
+ */
+function upgrade_431() {
+ // Fix incorrect cron entries for term splitting
+ $cron_array = _get_cron_array();
+ if ( isset( $cron_array['wp_batch_split_terms'] ) ) {
+ unset( $cron_array['wp_batch_split_terms'] );
+ _set_cron_array( $cron_array );
+ }
+}
+
+/**
+ * Executes changes made in WordPress 4.4.0.
+ *
+ * @ignore
+ * @since 4.4.0
+ *
+ * @global int $wp_current_db_version Current version.
+ * @global wpdb $wpdb WordPress database abstraction object.
+ */
+function upgrade_440() {
+ global $wp_current_db_version, $wpdb;
+
+ if ( $wp_current_db_version < 34030 ) {
+ $wpdb->query( "ALTER TABLE {$wpdb->options} MODIFY option_name VARCHAR(191)" );
+ }
+
+ // Remove the unused 'add_users' role.
+ $roles = wp_roles();
+ foreach ( $roles->role_objects as $role ) {
+ if ( $role->has_cap( 'add_users' ) ) {
+ $role->remove_cap( 'add_users' );
+ }
+ }
+}
+
+/**
+ * Executes changes made in WordPress 4.5.0.
+ *
+ * @ignore
+ * @since 4.5.0
+ *
+ * @global int $wp_current_db_version Current database version.
+ * @global wpdb $wpdb WordPress database abstraction object.
+ */
+function upgrade_450() {
+ global $wp_current_db_version, $wpdb;
+
+ if ( $wp_current_db_version < 36180 ) {
+ wp_clear_scheduled_hook( 'wp_maybe_auto_update' );
+ }
+
+ // Remove unused email confirmation options, moved to usermeta.
+ if ( $wp_current_db_version < 36679 && is_multisite() ) {
+ $wpdb->query( "DELETE FROM $wpdb->options WHERE option_name REGEXP '^[0-9]+_new_email$'" );
+ }
+
+ // Remove unused user setting for wpLink.
+ delete_user_setting( 'wplink' );
+}
+
+/**
+ * Executes changes made in WordPress 4.6.0.
+ *
+ * @ignore
+ * @since 4.6.0
+ *
+ * @global int $wp_current_db_version Current database version.
+ */
+function upgrade_460() {
+ global $wp_current_db_version;
+
+ // Remove unused post meta.
+ if ( $wp_current_db_version < 37854 ) {
+ delete_post_meta_by_key( '_post_restored_from' );
+ }
+
+ // Remove plugins with callback as an array object/method as the uninstall hook, see #13786.
+ if ( $wp_current_db_version < 37965 ) {
+ $uninstall_plugins = get_option( 'uninstall_plugins', array() );
+
+ if ( ! empty( $uninstall_plugins ) ) {
+ foreach ( $uninstall_plugins as $basename => $callback ) {
+ if ( is_array( $callback ) && is_object( $callback[0] ) ) {
+ unset( $uninstall_plugins[ $basename ] );
+ }
+ }
+
+ update_option( 'uninstall_plugins', $uninstall_plugins );
+ }
+ }
+}
+
+/**
+ * Executes changes made in WordPress 5.0.0.
+ *
+ * @ignore
+ * @since 5.0.0
+ * @deprecated 5.1.0
+ */
+function upgrade_500() {
+}
+
+/**
+ * Executes changes made in WordPress 5.1.0.
+ *
+ * @ignore
+ * @since 5.1.0
+ */
+function upgrade_510() {
+ delete_site_option( 'upgrade_500_was_gutenberg_active' );
+}
+
+/**
+ * Executes network-level upgrade routines.
+ *
+ * @since 3.0.0
+ *
+ * @global int $wp_current_db_version
+ * @global wpdb $wpdb
+ */
+function upgrade_network() {
+ global $wp_current_db_version, $wpdb;
+
+ // Always clear expired transients
+ delete_expired_transients( true );
+
+ // 2.8.
+ if ( $wp_current_db_version < 11549 ) {
+ $wpmu_sitewide_plugins = get_site_option( 'wpmu_sitewide_plugins' );
+ $active_sitewide_plugins = get_site_option( 'active_sitewide_plugins' );
+ if ( $wpmu_sitewide_plugins ) {
+ if ( ! $active_sitewide_plugins ) {
+ $sitewide_plugins = (array) $wpmu_sitewide_plugins;
+ } else {
+ $sitewide_plugins = array_merge( (array) $active_sitewide_plugins, (array) $wpmu_sitewide_plugins );
+ }
+
+ update_site_option( 'active_sitewide_plugins', $sitewide_plugins );
+ }
+ delete_site_option( 'wpmu_sitewide_plugins' );
+ delete_site_option( 'deactivated_sitewide_plugins' );
+
+ $start = 0;
+ while ( $rows = $wpdb->get_results( "SELECT meta_key, meta_value FROM {$wpdb->sitemeta} ORDER BY meta_id LIMIT $start, 20" ) ) {
+ foreach ( $rows as $row ) {
+ $value = $row->meta_value;
+ if ( ! @unserialize( $value ) ) {
+ $value = stripslashes( $value );
+ }
+ if ( $value !== $row->meta_value ) {
+ update_site_option( $row->meta_key, $value );
+ }
+ }
+ $start += 20;
+ }
+ }
+
+ // 3.0
+ if ( $wp_current_db_version < 13576 ) {
+ update_site_option( 'global_terms_enabled', '1' );
+ }
+
+ // 3.3
+ if ( $wp_current_db_version < 19390 ) {
+ update_site_option( 'initial_db_version', $wp_current_db_version );
+ }
+
+ if ( $wp_current_db_version < 19470 ) {
+ if ( false === get_site_option( 'active_sitewide_plugins' ) ) {
+ update_site_option( 'active_sitewide_plugins', array() );
+ }
+ }
+
+ // 3.4
+ if ( $wp_current_db_version < 20148 ) {
+ // 'allowedthemes' keys things by stylesheet. 'allowed_themes' keyed things by name.
+ $allowedthemes = get_site_option( 'allowedthemes' );
+ $allowed_themes = get_site_option( 'allowed_themes' );
+ if ( false === $allowedthemes && is_array( $allowed_themes ) && $allowed_themes ) {
+ $converted = array();
+ $themes = wp_get_themes();
+ foreach ( $themes as $stylesheet => $theme_data ) {
+ if ( isset( $allowed_themes[ $theme_data->get( 'Name' ) ] ) ) {
+ $converted[ $stylesheet ] = true;
+ }
+ }
+ update_site_option( 'allowedthemes', $converted );
+ delete_site_option( 'allowed_themes' );
+ }
+ }
+
+ // 3.5
+ if ( $wp_current_db_version < 21823 ) {
+ update_site_option( 'ms_files_rewriting', '1' );
+ }
+
+ // 3.5.2
+ if ( $wp_current_db_version < 24448 ) {
+ $illegal_names = get_site_option( 'illegal_names' );
+ if ( is_array( $illegal_names ) && count( $illegal_names ) === 1 ) {
+ $illegal_name = reset( $illegal_names );
+ $illegal_names = explode( ' ', $illegal_name );
+ update_site_option( 'illegal_names', $illegal_names );
+ }
+ }
+
+ // 4.2
+ if ( $wp_current_db_version < 31351 && $wpdb->charset === 'utf8mb4' ) {
+ if ( wp_should_upgrade_global_tables() ) {
+ $wpdb->query( "ALTER TABLE $wpdb->usermeta DROP INDEX meta_key, ADD INDEX meta_key(meta_key(191))" );
+ $wpdb->query( "ALTER TABLE $wpdb->site DROP INDEX domain, ADD INDEX domain(domain(140),path(51))" );
+ $wpdb->query( "ALTER TABLE $wpdb->sitemeta DROP INDEX meta_key, ADD INDEX meta_key(meta_key(191))" );
+ $wpdb->query( "ALTER TABLE $wpdb->signups DROP INDEX domain_path, ADD INDEX domain_path(domain(140),path(51))" );
+
+ $tables = $wpdb->tables( 'global' );
+
+ // sitecategories may not exist.
+ if ( ! $wpdb->get_var( "SHOW TABLES LIKE '{$tables['sitecategories']}'" ) ) {
+ unset( $tables['sitecategories'] );
+ }
+
+ foreach ( $tables as $table ) {
+ maybe_convert_table_to_utf8mb4( $table );
+ }
+ }
+ }
+
+ // 4.3
+ if ( $wp_current_db_version < 33055 && 'utf8mb4' === $wpdb->charset ) {
+ if ( wp_should_upgrade_global_tables() ) {
+ $upgrade = false;
+ $indexes = $wpdb->get_results( "SHOW INDEXES FROM $wpdb->signups" );
+ foreach ( $indexes as $index ) {
+ if ( 'domain_path' == $index->Key_name && 'domain' == $index->Column_name && 140 != $index->Sub_part ) {
+ $upgrade = true;
+ break;
+ }
+ }
+
+ if ( $upgrade ) {
+ $wpdb->query( "ALTER TABLE $wpdb->signups DROP INDEX domain_path, ADD INDEX domain_path(domain(140),path(51))" );
+ }
+
+ $tables = $wpdb->tables( 'global' );
+
+ // sitecategories may not exist.
+ if ( ! $wpdb->get_var( "SHOW TABLES LIKE '{$tables['sitecategories']}'" ) ) {
+ unset( $tables['sitecategories'] );
+ }
+
+ foreach ( $tables as $table ) {
+ maybe_convert_table_to_utf8mb4( $table );
+ }
+ }
+ }
+
+ // 5.1
+ if ( $wp_current_db_version < 44467 ) {
+ $network_id = get_main_network_id();
+ delete_network_option( $network_id, 'site_meta_supported' );
+ is_site_meta_supported();
+ }
+}
+
+//
+// General functions we use to actually do stuff
+//
+
+/**
+ * Creates a table in the database if it doesn't already exist.
+ *
+ * This method checks for an existing database and creates a new one if it's not
+ * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
+ * to query all tables first and then run the SQL statement creating the table.
+ *
+ * @since 1.0.0
+ *
+ * @global wpdb $wpdb
+ *
+ * @param string $table_name Database table name to create.
+ * @param string $create_ddl SQL statement to create table.
+ * @return bool If table already exists or was created by function.
+ */
+function maybe_create_table( $table_name, $create_ddl ) {
+ global $wpdb;
+
+ $query = $wpdb->prepare( 'SHOW TABLES LIKE %s', $wpdb->esc_like( $table_name ) );
+
+ if ( $wpdb->get_var( $query ) == $table_name ) {
+ return true;
+ }
+
+ // Didn't find it try to create it..
+ $wpdb->query( $create_ddl );
+
+ // We cannot directly tell that whether this succeeded!
+ if ( $wpdb->get_var( $query ) == $table_name ) {
+ return true;
+ }
+ return false;
+}
+
+/**
+ * Drops a specified index from a table.
+ *
+ * @since 1.0.1
+ *
+ * @global wpdb $wpdb
+ *
+ * @param string $table Database table name.
+ * @param string $index Index name to drop.
+ * @return true True, when finished.
+ */
+function drop_index( $table, $index ) {
+ global $wpdb;
+ $wpdb->hide_errors();
+ $wpdb->query( "ALTER TABLE `$table` DROP INDEX `$index`" );
+ // Now we need to take out all the extra ones we may have created
+ for ( $i = 0; $i < 25; $i++ ) {
+ $wpdb->query( "ALTER TABLE `$table` DROP INDEX `{$index}_$i`" );
+ }
+ $wpdb->show_errors();
+ return true;
+}
+
+/**
+ * Adds an index to a specified table.
+ *
+ * @since 1.0.1
+ *
+ * @global wpdb $wpdb
+ *
+ * @param string $table Database table name.
+ * @param string $index Database table index column.
+ * @return true True, when done with execution.
+ */
+function add_clean_index( $table, $index ) {
+ global $wpdb;
+ drop_index( $table, $index );
+ $wpdb->query( "ALTER TABLE `$table` ADD INDEX ( `$index` )" );
+ return true;
+}
+
+/**
+ * Adds column to a database table if it doesn't already exist.
+ *
+ * @since 1.3.0
+ *
+ * @global wpdb $wpdb
+ *
+ * @param string $table_name The table name to modify.
+ * @param string $column_name The column name to add to the table.
+ * @param string $create_ddl The SQL statement used to add the column.
+ * @return bool True if already exists or on successful completion, false on error.
+ */
+function maybe_add_column( $table_name, $column_name, $create_ddl ) {
+ global $wpdb;
+ foreach ( $wpdb->get_col( "DESC $table_name", 0 ) as $column ) {
+ if ( $column == $column_name ) {
+ return true;
+ }
+ }
+
+ // Didn't find it try to create it.
+ $wpdb->query( $create_ddl );
+
+ // We cannot directly tell that whether this succeeded!
+ foreach ( $wpdb->get_col( "DESC $table_name", 0 ) as $column ) {
+ if ( $column == $column_name ) {
+ return true;
+ }
+ }
+ return false;
+}
+
+/**
+ * If a table only contains utf8 or utf8mb4 columns, convert it to utf8mb4.
+ *
+ * @since 4.2.0
+ *
+ * @global wpdb $wpdb
+ *
+ * @param string $table The table to convert.
+ * @return bool true if the table was converted, false if it wasn't.
+ */
+function maybe_convert_table_to_utf8mb4( $table ) {
+ global $wpdb;
+
+ $results = $wpdb->get_results( "SHOW FULL COLUMNS FROM `$table`" );
+ if ( ! $results ) {
+ return false;
+ }
+
+ foreach ( $results as $column ) {
+ if ( $column->Collation ) {
+ list( $charset ) = explode( '_', $column->Collation );
+ $charset = strtolower( $charset );
+ if ( 'utf8' !== $charset && 'utf8mb4' !== $charset ) {
+ // Don't upgrade tables that have non-utf8 columns.
+ return false;
+ }
+ }
+ }
+
+ $table_details = $wpdb->get_row( "SHOW TABLE STATUS LIKE '$table'" );
+ if ( ! $table_details ) {
+ return false;
+ }
+
+ list( $table_charset ) = explode( '_', $table_details->Collation );
+ $table_charset = strtolower( $table_charset );
+ if ( 'utf8mb4' === $table_charset ) {
+ return true;
+ }
+
+ return $wpdb->query( "ALTER TABLE $table CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci" );
+}
+
+/**
+ * Retrieve all options as it was for 1.2.
+ *
+ * @since 1.2.0
+ *
+ * @global wpdb $wpdb
+ *
+ * @return stdClass List of options.
+ */
+function get_alloptions_110() {
+ global $wpdb;
+ $all_options = new stdClass;
+ if ( $options = $wpdb->get_results( "SELECT option_name, option_value FROM $wpdb->options" ) ) {
+ foreach ( $options as $option ) {
+ if ( 'siteurl' == $option->option_name || 'home' == $option->option_name || 'category_base' == $option->option_name ) {
+ $option->option_value = untrailingslashit( $option->option_value );
+ }
+ $all_options->{$option->option_name} = stripslashes( $option->option_value );
+ }
+ }
+ return $all_options;
+}
+
+/**
+ * Utility version of get_option that is private to installation/upgrade.
+ *
+ * @ignore
+ * @since 1.5.1
+ * @access private
+ *
+ * @global wpdb $wpdb
+ *
+ * @param string $setting Option name.
+ * @return mixed
+ */
+function __get_option( $setting ) {
+ global $wpdb;
+
+ if ( $setting == 'home' && defined( 'WP_HOME' ) ) {
+ return untrailingslashit( WP_HOME );
+ }
+
+ if ( $setting == 'siteurl' && defined( 'WP_SITEURL' ) ) {
+ return untrailingslashit( WP_SITEURL );
+ }
+
+ $option = $wpdb->get_var( $wpdb->prepare( "SELECT option_value FROM $wpdb->options WHERE option_name = %s", $setting ) );
+
+ if ( 'home' == $setting && '' == $option ) {
+ return __get_option( 'siteurl' );
+ }
+
+ if ( 'siteurl' == $setting || 'home' == $setting || 'category_base' == $setting || 'tag_base' == $setting ) {
+ $option = untrailingslashit( $option );
+ }
+
+ return maybe_unserialize( $option );
+}
+
+/**
+ * Filters for content to remove unnecessary slashes.
+ *
+ * @since 1.5.0
+ *
+ * @param string $content The content to modify.
+ * @return string The de-slashed content.
+ */
+function deslash( $content ) {
+ // Note: \\\ inside a regex denotes a single backslash.
+
+ /*
+ * Replace one or more backslashes followed by a single quote with
+ * a single quote.
+ */
+ $content = preg_replace( "/\\\+'/", "'", $content );
+
+ /*
+ * Replace one or more backslashes followed by a double quote with
+ * a double quote.
+ */
+ $content = preg_replace( '/\\\+"/', '"', $content );
+
+ // Replace one or more backslashes with one backslash.
+ $content = preg_replace( '/\\\+/', '\\', $content );
+
+ return $content;
+}
+
+/**
+ * Modifies the database based on specified SQL statements.
+ *
+ * Useful for creating new tables and updating existing tables to a new structure.
+ *
+ * @since 1.5.0
+ *
+ * @global wpdb $wpdb
+ *
+ * @param string[]|string $queries Optional. The query to run. Can be multiple queries
+ * in an array, or a string of queries separated by
+ * semicolons. Default empty string.
+ * @param bool $execute Optional. Whether or not to execute the query right away.
+ * Default true.
+ * @return array Strings containing the results of the various update queries.
+ */
+function dbDelta( $queries = '', $execute = true ) {
+ global $wpdb;
+
+ if ( in_array( $queries, array( '', 'all', 'blog', 'global', 'ms_global' ), true ) ) {
+ $queries = wp_get_db_schema( $queries );
+ }
+
+ // Separate individual queries into an array
+ if ( ! is_array( $queries ) ) {
+ $queries = explode( ';', $queries );
+ $queries = array_filter( $queries );
+ }
+
+ /**
+ * Filters the dbDelta SQL queries.
+ *
+ * @since 3.3.0
+ *
+ * @param string[] $queries An array of dbDelta SQL queries.
+ */
+ $queries = apply_filters( 'dbdelta_queries', $queries );
+
+ $cqueries = array(); // Creation Queries
+ $iqueries = array(); // Insertion Queries
+ $for_update = array();
+
+ // Create a tablename index for an array ($cqueries) of queries
+ foreach ( $queries as $qry ) {
+ if ( preg_match( '|CREATE TABLE ([^ ]*)|', $qry, $matches ) ) {
+ $cqueries[ trim( $matches[1], '`' ) ] = $qry;
+ $for_update[ $matches[1] ] = 'Created table ' . $matches[1];
+ } elseif ( preg_match( '|CREATE DATABASE ([^ ]*)|', $qry, $matches ) ) {
+ array_unshift( $cqueries, $qry );
+ } elseif ( preg_match( '|INSERT INTO ([^ ]*)|', $qry, $matches ) ) {
+ $iqueries[] = $qry;
+ } elseif ( preg_match( '|UPDATE ([^ ]*)|', $qry, $matches ) ) {
+ $iqueries[] = $qry;
+ } else {
+ // Unrecognized query type
+ }
+ }
+
+ /**
+ * Filters the dbDelta SQL queries for creating tables and/or databases.
+ *
+ * Queries filterable via this hook contain "CREATE TABLE" or "CREATE DATABASE".
+ *
+ * @since 3.3.0
+ *
+ * @param string[] $cqueries An array of dbDelta create SQL queries.
+ */
+ $cqueries = apply_filters( 'dbdelta_create_queries', $cqueries );
+
+ /**
+ * Filters the dbDelta SQL queries for inserting or updating.
+ *
+ * Queries filterable via this hook contain "INSERT INTO" or "UPDATE".
+ *
+ * @since 3.3.0
+ *
+ * @param string[] $iqueries An array of dbDelta insert or update SQL queries.
+ */
+ $iqueries = apply_filters( 'dbdelta_insert_queries', $iqueries );
+
+ $text_fields = array( 'tinytext', 'text', 'mediumtext', 'longtext' );
+ $blob_fields = array( 'tinyblob', 'blob', 'mediumblob', 'longblob' );
+
+ $global_tables = $wpdb->tables( 'global' );
+ foreach ( $cqueries as $table => $qry ) {
+ // Upgrade global tables only for the main site. Don't upgrade at all if conditions are not optimal.
+ if ( in_array( $table, $global_tables ) && ! wp_should_upgrade_global_tables() ) {
+ unset( $cqueries[ $table ], $for_update[ $table ] );
+ continue;
+ }
+
+ // Fetch the table column structure from the database
+ $suppress = $wpdb->suppress_errors();
+ $tablefields = $wpdb->get_results( "DESCRIBE {$table};" );
+ $wpdb->suppress_errors( $suppress );
+
+ if ( ! $tablefields ) {
+ continue;
+ }
+
+ // Clear the field and index arrays.
+ $cfields = $indices = $indices_without_subparts = array();
+
+ // Get all of the field names in the query from between the parentheses.
+ preg_match( '|\((.*)\)|ms', $qry, $match2 );
+ $qryline = trim( $match2[1] );
+
+ // Separate field lines into an array.
+ $flds = explode( "\n", $qryline );
+
+ // For every field line specified in the query.
+ foreach ( $flds as $fld ) {
+ $fld = trim( $fld, " \t\n\r\0\x0B," ); // Default trim characters, plus ','.
+
+ // Extract the field name.
+ preg_match( '|^([^ ]*)|', $fld, $fvals );
+ $fieldname = trim( $fvals[1], '`' );
+ $fieldname_lowercased = strtolower( $fieldname );
+
+ // Verify the found field name.
+ $validfield = true;
+ switch ( $fieldname_lowercased ) {
+ case '':
+ case 'primary':
+ case 'index':
+ case 'fulltext':
+ case 'unique':
+ case 'key':
+ case 'spatial':
+ $validfield = false;
+
+ /*
+ * Normalize the index definition.
+ *
+ * This is done so the definition can be compared against the result of a
+ * `SHOW INDEX FROM $table_name` query which returns the current table
+ * index information.
+ */
+
+ // Extract type, name and columns from the definition.
+ // phpcs:disable Squiz.Strings.ConcatenationSpacing.PaddingFound -- don't remove regex indentation
+ preg_match(
+ '/^'
+ . '(?P<index_type>' // 1) Type of the index.
+ . 'PRIMARY\s+KEY|(?:UNIQUE|FULLTEXT|SPATIAL)\s+(?:KEY|INDEX)|KEY|INDEX'
+ . ')'
+ . '\s+' // Followed by at least one white space character.
+ . '(?:' // Name of the index. Optional if type is PRIMARY KEY.
+ . '`?' // Name can be escaped with a backtick.
+ . '(?P<index_name>' // 2) Name of the index.
+ . '(?:[0-9a-zA-Z$_-]|[\xC2-\xDF][\x80-\xBF])+'
+ . ')'
+ . '`?' // Name can be escaped with a backtick.
+ . '\s+' // Followed by at least one white space character.
+ . ')*'
+ . '\(' // Opening bracket for the columns.
+ . '(?P<index_columns>'
+ . '.+?' // 3) Column names, index prefixes, and orders.
+ . ')'
+ . '\)' // Closing bracket for the columns.
+ . '$/im',
+ $fld,
+ $index_matches
+ );
+ // phpcs:enable
+
+ // Uppercase the index type and normalize space characters.
+ $index_type = strtoupper( preg_replace( '/\s+/', ' ', trim( $index_matches['index_type'] ) ) );
+
+ // 'INDEX' is a synonym for 'KEY', standardize on 'KEY'.
+ $index_type = str_replace( 'INDEX', 'KEY', $index_type );
+
+ // Escape the index name with backticks. An index for a primary key has no name.
+ $index_name = ( 'PRIMARY KEY' === $index_type ) ? '' : '`' . strtolower( $index_matches['index_name'] ) . '`';
+
+ // Parse the columns. Multiple columns are separated by a comma.
+ $index_columns = $index_columns_without_subparts = array_map( 'trim', explode( ',', $index_matches['index_columns'] ) );
+
+ // Normalize columns.
+ foreach ( $index_columns as $id => &$index_column ) {
+ // Extract column name and number of indexed characters (sub_part).
+ preg_match(
+ '/'
+ . '`?' // Name can be escaped with a backtick.
+ . '(?P<column_name>' // 1) Name of the column.
+ . '(?:[0-9a-zA-Z$_-]|[\xC2-\xDF][\x80-\xBF])+'
+ . ')'
+ . '`?' // Name can be escaped with a backtick.
+ . '(?:' // Optional sub part.
+ . '\s*' // Optional white space character between name and opening bracket.
+ . '\(' // Opening bracket for the sub part.
+ . '\s*' // Optional white space character after opening bracket.
+ . '(?P<sub_part>'
+ . '\d+' // 2) Number of indexed characters.
+ . ')'
+ . '\s*' // Optional white space character before closing bracket.
+ . '\)' // Closing bracket for the sub part.
+ . ')?'
+ . '/',
+ $index_column,
+ $index_column_matches
+ );
+
+ // Escape the column name with backticks.
+ $index_column = '`' . $index_column_matches['column_name'] . '`';
+
+ // We don't need to add the subpart to $index_columns_without_subparts
+ $index_columns_without_subparts[ $id ] = $index_column;
+
+ // Append the optional sup part with the number of indexed characters.
+ if ( isset( $index_column_matches['sub_part'] ) ) {
+ $index_column .= '(' . $index_column_matches['sub_part'] . ')';
+ }
+ }
+
+ // Build the normalized index definition and add it to the list of indices.
+ $indices[] = "{$index_type} {$index_name} (" . implode( ',', $index_columns ) . ')';
+ $indices_without_subparts[] = "{$index_type} {$index_name} (" . implode( ',', $index_columns_without_subparts ) . ')';
+
+ // Destroy no longer needed variables.
+ unset( $index_column, $index_column_matches, $index_matches, $index_type, $index_name, $index_columns, $index_columns_without_subparts );
+
+ break;
+ }
+
+ // If it's a valid field, add it to the field array.
+ if ( $validfield ) {
+ $cfields[ $fieldname_lowercased ] = $fld;
+ }
+ }
+
+ // For every field in the table.
+ foreach ( $tablefields as $tablefield ) {
+ $tablefield_field_lowercased = strtolower( $tablefield->Field );
+ $tablefield_type_lowercased = strtolower( $tablefield->Type );
+
+ // If the table field exists in the field array ...
+ if ( array_key_exists( $tablefield_field_lowercased, $cfields ) ) {
+
+ // Get the field type from the query.
+ preg_match( '|`?' . $tablefield->Field . '`? ([^ ]*( unsigned)?)|i', $cfields[ $tablefield_field_lowercased ], $matches );
+ $fieldtype = $matches[1];
+ $fieldtype_lowercased = strtolower( $fieldtype );
+
+ // Is actual field type different from the field type in query?
+ if ( $tablefield->Type != $fieldtype ) {
+ $do_change = true;
+ if ( in_array( $fieldtype_lowercased, $text_fields ) && in_array( $tablefield_type_lowercased, $text_fields ) ) {
+ if ( array_search( $fieldtype_lowercased, $text_fields ) < array_search( $tablefield_type_lowercased, $text_fields ) ) {
+ $do_change = false;
+ }
+ }
+
+ if ( in_array( $fieldtype_lowercased, $blob_fields ) && in_array( $tablefield_type_lowercased, $blob_fields ) ) {
+ if ( array_search( $fieldtype_lowercased, $blob_fields ) < array_search( $tablefield_type_lowercased, $blob_fields ) ) {
+ $do_change = false;
+ }
+ }
+
+ if ( $do_change ) {
+ // Add a query to change the column type.
+ $cqueries[] = "ALTER TABLE {$table} CHANGE COLUMN `{$tablefield->Field}` " . $cfields[ $tablefield_field_lowercased ];
+ $for_update[ $table . '.' . $tablefield->Field ] = "Changed type of {$table}.{$tablefield->Field} from {$tablefield->Type} to {$fieldtype}";
+ }
+ }
+
+ // Get the default value from the array.
+ if ( preg_match( "| DEFAULT '(.*?)'|i", $cfields[ $tablefield_field_lowercased ], $matches ) ) {
+ $default_value = $matches[1];
+ if ( $tablefield->Default != $default_value ) {
+ // Add a query to change the column's default value
+ $cqueries[] = "ALTER TABLE {$table} ALTER COLUMN `{$tablefield->Field}` SET DEFAULT '{$default_value}'";
+ $for_update[ $table . '.' . $tablefield->Field ] = "Changed default value of {$table}.{$tablefield->Field} from {$tablefield->Default} to {$default_value}";
+ }
+ }
+
+ // Remove the field from the array (so it's not added).
+ unset( $cfields[ $tablefield_field_lowercased ] );
+ } else {
+ // This field exists in the table, but not in the creation queries?
+ }
+ }
+
+ // For every remaining field specified for the table.
+ foreach ( $cfields as $fieldname => $fielddef ) {
+ // Push a query line into $cqueries that adds the field to that table.
+ $cqueries[] = "ALTER TABLE {$table} ADD COLUMN $fielddef";
+ $for_update[ $table . '.' . $fieldname ] = 'Added column ' . $table . '.' . $fieldname;
+ }
+
+ // Index stuff goes here. Fetch the table index structure from the database.
+ $tableindices = $wpdb->get_results( "SHOW INDEX FROM {$table};" );
+
+ if ( $tableindices ) {
+ // Clear the index array.
+ $index_ary = array();
+
+ // For every index in the table.
+ foreach ( $tableindices as $tableindex ) {
+
+ // Add the index to the index data array.
+ $keyname = strtolower( $tableindex->Key_name );
+ $index_ary[ $keyname ]['columns'][] = array(
+ 'fieldname' => $tableindex->Column_name,
+ 'subpart' => $tableindex->Sub_part,
+ );
+ $index_ary[ $keyname ]['unique'] = ( $tableindex->Non_unique == 0 ) ? true : false;
+ $index_ary[ $keyname ]['index_type'] = $tableindex->Index_type;
+ }
+
+ // For each actual index in the index array.
+ foreach ( $index_ary as $index_name => $index_data ) {
+
+ // Build a create string to compare to the query.
+ $index_string = '';
+ if ( $index_name == 'primary' ) {
+ $index_string .= 'PRIMARY ';
+ } elseif ( $index_data['unique'] ) {
+ $index_string .= 'UNIQUE ';
+ }
+ if ( 'FULLTEXT' === strtoupper( $index_data['index_type'] ) ) {
+ $index_string .= 'FULLTEXT ';
+ }
+ if ( 'SPATIAL' === strtoupper( $index_data['index_type'] ) ) {
+ $index_string .= 'SPATIAL ';
+ }
+ $index_string .= 'KEY ';
+ if ( 'primary' !== $index_name ) {
+ $index_string .= '`' . $index_name . '`';
+ }
+ $index_columns = '';
+
+ // For each column in the index.
+ foreach ( $index_data['columns'] as $column_data ) {
+ if ( $index_columns != '' ) {
+ $index_columns .= ',';
+ }
+
+ // Add the field to the column list string.
+ $index_columns .= '`' . $column_data['fieldname'] . '`';
+ }
+
+ // Add the column list to the index create string.
+ $index_string .= " ($index_columns)";
+
+ // Check if the index definition exists, ignoring subparts.
+ if ( ! ( ( $aindex = array_search( $index_string, $indices_without_subparts ) ) === false ) ) {
+ // If the index already exists (even with different subparts), we don't need to create it.
+ unset( $indices_without_subparts[ $aindex ] );
+ unset( $indices[ $aindex ] );
+ }
+ }
+ }
+
+ // For every remaining index specified for the table.
+ foreach ( (array) $indices as $index ) {
+ // Push a query line into $cqueries that adds the index to that table.
+ $cqueries[] = "ALTER TABLE {$table} ADD $index";
+ $for_update[] = 'Added index ' . $table . ' ' . $index;
+ }
+
+ // Remove the original table creation query from processing.
+ unset( $cqueries[ $table ], $for_update[ $table ] );
+ }
+
+ $allqueries = array_merge( $cqueries, $iqueries );
+ if ( $execute ) {
+ foreach ( $allqueries as $query ) {
+ $wpdb->query( $query );
+ }
+ }
+
+ return $for_update;
+}
+
+/**
+ * Updates the database tables to a new schema.
+ *
+ * By default, updates all the tables to use the latest defined schema, but can also
+ * be used to update a specific set of tables in wp_get_db_schema().
+ *
+ * @since 1.5.0
+ *
+ * @uses dbDelta
+ *
+ * @param string $tables Optional. Which set of tables to update. Default is 'all'.
+ */
+function make_db_current( $tables = 'all' ) {
+ $alterations = dbDelta( $tables );
+ echo "<ol>\n";
+ foreach ( $alterations as $alteration ) {
+ echo "<li>$alteration</li>\n";
+ }
+ echo "</ol>\n";
+}
+
+/**
+ * Updates the database tables to a new schema, but without displaying results.
+ *
+ * By default, updates all the tables to use the latest defined schema, but can
+ * also be used to update a specific set of tables in wp_get_db_schema().
+ *
+ * @since 1.5.0
+ *
+ * @see make_db_current()
+ *
+ * @param string $tables Optional. Which set of tables to update. Default is 'all'.
+ */
+function make_db_current_silent( $tables = 'all' ) {
+ dbDelta( $tables );
+}
+
+/**
+ * Creates a site theme from an existing theme.
+ *
+ * {@internal Missing Long Description}}
+ *
+ * @since 1.5.0
+ *
+ * @param string $theme_name The name of the theme.
+ * @param string $template The directory name of the theme.
+ * @return bool
+ */
+function make_site_theme_from_oldschool( $theme_name, $template ) {
+ $home_path = get_home_path();
+ $site_dir = WP_CONTENT_DIR . "/themes/$template";
+
+ if ( ! file_exists( "$home_path/index.php" ) ) {
+ return false;
+ }
+
+ /*
+ * Copy files from the old locations to the site theme.
+ * TODO: This does not copy arbitrary include dependencies. Only the standard WP files are copied.
+ */
+ $files = array(
+ 'index.php' => 'index.php',
+ 'wp-layout.css' => 'style.css',
+ 'wp-comments.php' => 'comments.php',
+ 'wp-comments-popup.php' => 'comments-popup.php',
+ );
+
+ foreach ( $files as $oldfile => $newfile ) {
+ if ( $oldfile == 'index.php' ) {
+ $oldpath = $home_path;
+ } else {
+ $oldpath = ABSPATH;
+ }
+
+ // Check to make sure it's not a new index.
+ if ( $oldfile == 'index.php' ) {
+ $index = implode( '', file( "$oldpath/$oldfile" ) );
+ if ( strpos( $index, 'WP_USE_THEMES' ) !== false ) {
+ if ( ! @copy( WP_CONTENT_DIR . '/themes/' . WP_DEFAULT_THEME . '/index.php', "$site_dir/$newfile" ) ) {
+ return false;
+ }
+
+ // Don't copy anything.
+ continue;
+ }
+ }
+
+ if ( ! @copy( "$oldpath/$oldfile", "$site_dir/$newfile" ) ) {
+ return false;
+ }
+
+ chmod( "$site_dir/$newfile", 0777 );
+
+ // Update the blog header include in each file.
+ $lines = explode( "\n", implode( '', file( "$site_dir/$newfile" ) ) );
+ if ( $lines ) {
+ $f = fopen( "$site_dir/$newfile", 'w' );
+
+ foreach ( $lines as $line ) {
+ if ( preg_match( '/require.*wp-blog-header/', $line ) ) {
+ $line = '//' . $line;
+ }
+
+ // Update stylesheet references.
+ $line = str_replace( "<?php echo __get_option('siteurl'); ?>/wp-layout.css", "<?php bloginfo('stylesheet_url'); ?>", $line );
+
+ // Update comments template inclusion.
+ $line = str_replace( "<?php include(ABSPATH . 'wp-comments.php'); ?>", '<?php comments_template(); ?>', $line );
+
+ fwrite( $f, "{$line}\n" );
+ }
+ fclose( $f );
+ }
+ }
+
+ // Add a theme header.
+ $header = "/*\nTheme Name: $theme_name\nTheme URI: " . __get_option( 'siteurl' ) . "\nDescription: A theme automatically created by the update.\nVersion: 1.0\nAuthor: Moi\n*/\n";
+
+ $stylelines = file_get_contents( "$site_dir/style.css" );
+ if ( $stylelines ) {
+ $f = fopen( "$site_dir/style.css", 'w' );
+
+ fwrite( $f, $header );
+ fwrite( $f, $stylelines );
+ fclose( $f );
+ }
+
+ return true;
+}
+
+/**
+ * Creates a site theme from the default theme.
+ *
+ * {@internal Missing Long Description}}
+ *
+ * @since 1.5.0
+ *
+ * @param string $theme_name The name of the theme.
+ * @param string $template The directory name of the theme.
+ * @return false|void
+ */
+function make_site_theme_from_default( $theme_name, $template ) {
+ $site_dir = WP_CONTENT_DIR . "/themes/$template";
+ $default_dir = WP_CONTENT_DIR . '/themes/' . WP_DEFAULT_THEME;
+
+ // Copy files from the default theme to the site theme.
+ //$files = array('index.php', 'comments.php', 'comments-popup.php', 'footer.php', 'header.php', 'sidebar.php', 'style.css');
+
+ $theme_dir = @ opendir( $default_dir );
+ if ( $theme_dir ) {
+ while ( ( $theme_file = readdir( $theme_dir ) ) !== false ) {
+ if ( is_dir( "$default_dir/$theme_file" ) ) {
+ continue;
+ }
+ if ( ! @copy( "$default_dir/$theme_file", "$site_dir/$theme_file" ) ) {
+ return;
+ }
+ chmod( "$site_dir/$theme_file", 0777 );
+ }
+ }
+ @closedir( $theme_dir );
+
+ // Rewrite the theme header.
+ $stylelines = explode( "\n", implode( '', file( "$site_dir/style.css" ) ) );
+ if ( $stylelines ) {
+ $f = fopen( "$site_dir/style.css", 'w' );
+
+ foreach ( $stylelines as $line ) {
+ if ( strpos( $line, 'Theme Name:' ) !== false ) {
+ $line = 'Theme Name: ' . $theme_name;
+ } elseif ( strpos( $line, 'Theme URI:' ) !== false ) {
+ $line = 'Theme URI: ' . __get_option( 'url' );
+ } elseif ( strpos( $line, 'Description:' ) !== false ) {
+ $line = 'Description: Your theme.';
+ } elseif ( strpos( $line, 'Version:' ) !== false ) {
+ $line = 'Version: 1';
+ } elseif ( strpos( $line, 'Author:' ) !== false ) {
+ $line = 'Author: You';
+ }
+ fwrite( $f, $line . "\n" );
+ }
+ fclose( $f );
+ }
+
+ // Copy the images.
+ umask( 0 );
+ if ( ! mkdir( "$site_dir/images", 0777 ) ) {
+ return false;
+ }
+
+ $images_dir = @ opendir( "$default_dir/images" );
+ if ( $images_dir ) {
+ while ( ( $image = readdir( $images_dir ) ) !== false ) {
+ if ( is_dir( "$default_dir/images/$image" ) ) {
+ continue;
+ }
+ if ( ! @copy( "$default_dir/images/$image", "$site_dir/images/$image" ) ) {
+ return;
+ }
+ chmod( "$site_dir/images/$image", 0777 );
+ }
+ }
+ @closedir( $images_dir );
+}
+
+/**
+ * Creates a site theme.
+ *
+ * {@internal Missing Long Description}}
+ *
+ * @since 1.5.0
+ *
+ * @return false|string
+ */
+function make_site_theme() {
+ // Name the theme after the blog.
+ $theme_name = __get_option( 'blogname' );
+ $template = sanitize_title( $theme_name );
+ $site_dir = WP_CONTENT_DIR . "/themes/$template";
+
+ // If the theme already exists, nothing to do.
+ if ( is_dir( $site_dir ) ) {
+ return false;
+ }
+
+ // We must be able to write to the themes dir.
+ if ( ! is_writable( WP_CONTENT_DIR . '/themes' ) ) {
+ return false;
+ }
+
+ umask( 0 );
+ if ( ! mkdir( $site_dir, 0777 ) ) {
+ return false;
+ }
+
+ if ( file_exists( ABSPATH . 'wp-layout.css' ) ) {
+ if ( ! make_site_theme_from_oldschool( $theme_name, $template ) ) {
+ // TODO: rm -rf the site theme directory.
+ return false;
+ }
+ } else {
+ if ( ! make_site_theme_from_default( $theme_name, $template ) ) {
+ // TODO: rm -rf the site theme directory.
+ return false;
+ }
+ }
+
+ // Make the new site theme active.
+ $current_template = __get_option( 'template' );
+ if ( $current_template == WP_DEFAULT_THEME ) {
+ update_option( 'template', $template );
+ update_option( 'stylesheet', $template );
+ }
+ return $template;
+}
+
+/**
+ * Translate user level to user role name.
+ *
+ * @since 2.0.0
+ *
+ * @param int $level User level.
+ * @return string User role name.
+ */
+function translate_level_to_role( $level ) {
+ switch ( $level ) {
+ case 10:
+ case 9:
+ case 8:
+ return 'administrator';
+ case 7:
+ case 6:
+ case 5:
+ return 'editor';
+ case 4:
+ case 3:
+ case 2:
+ return 'author';
+ case 1:
+ return 'contributor';
+ case 0:
+ return 'subscriber';
+ }
+}
+
+/**
+ * Checks the version of the installed MySQL binary.
+ *
+ * @since 2.1.0
+ *
+ * @global wpdb $wpdb
+ */
+function wp_check_mysql_version() {
+ global $wpdb;
+ $result = $wpdb->check_database_version();
+ if ( is_wp_error( $result ) ) {
+ wp_die( $result );
+ }
+}
+
+/**
+ * Disables the Automattic widgets plugin, which was merged into core.
+ *
+ * @since 2.2.0
+ */
+function maybe_disable_automattic_widgets() {
+ $plugins = __get_option( 'active_plugins' );
+
+ foreach ( (array) $plugins as $plugin ) {
+ if ( basename( $plugin ) == 'widgets.php' ) {
+ array_splice( $plugins, array_search( $plugin, $plugins ), 1 );
+ update_option( 'active_plugins', $plugins );
+ break;
+ }
+ }
+}
+
+/**
+ * Disables the Link Manager on upgrade if, at the time of upgrade, no links exist in the DB.
+ *
+ * @since 3.5.0
+ *
+ * @global int $wp_current_db_version
+ * @global wpdb $wpdb WordPress database abstraction object.
+ */
+function maybe_disable_link_manager() {
+ global $wp_current_db_version, $wpdb;
+
+ if ( $wp_current_db_version >= 22006 && get_option( 'link_manager_enabled' ) && ! $wpdb->get_var( "SELECT link_id FROM $wpdb->links LIMIT 1" ) ) {
+ update_option( 'link_manager_enabled', 0 );
+ }
+}
+
+/**
+ * Runs before the schema is upgraded.
+ *
+ * @since 2.9.0
+ *
+ * @global int $wp_current_db_version
+ * @global wpdb $wpdb WordPress database abstraction object.
+ */
+function pre_schema_upgrade() {
+ global $wp_current_db_version, $wpdb;
+
+ // Upgrade versions prior to 2.9
+ if ( $wp_current_db_version < 11557 ) {
+ // Delete duplicate options. Keep the option with the highest option_id.
+ $wpdb->query( "DELETE o1 FROM $wpdb->options AS o1 JOIN $wpdb->options AS o2 USING (`option_name`) WHERE o2.option_id > o1.option_id" );
+
+ // Drop the old primary key and add the new.
+ $wpdb->query( "ALTER TABLE $wpdb->options DROP PRIMARY KEY, ADD PRIMARY KEY(option_id)" );
+
+ // Drop the old option_name index. dbDelta() doesn't do the drop.
+ $wpdb->query( "ALTER TABLE $wpdb->options DROP INDEX option_name" );
+ }
+
+ // Multisite schema upgrades.
+ if ( $wp_current_db_version < 25448 && is_multisite() && wp_should_upgrade_global_tables() ) {
+
+ // Upgrade versions prior to 3.7
+ if ( $wp_current_db_version < 25179 ) {
+ // New primary key for signups.
+ $wpdb->query( "ALTER TABLE $wpdb->signups ADD signup_id BIGINT(20) NOT NULL AUTO_INCREMENT PRIMARY KEY FIRST" );
+ $wpdb->query( "ALTER TABLE $wpdb->signups DROP INDEX domain" );
+ }
+
+ if ( $wp_current_db_version < 25448 ) {
+ // Convert archived from enum to tinyint.
+ $wpdb->query( "ALTER TABLE $wpdb->blogs CHANGE COLUMN archived archived varchar(1) NOT NULL default '0'" );
+ $wpdb->query( "ALTER TABLE $wpdb->blogs CHANGE COLUMN archived archived tinyint(2) NOT NULL default 0" );
+ }
+ }
+
+ // Upgrade versions prior to 4.2.
+ if ( $wp_current_db_version < 31351 ) {
+ if ( ! is_multisite() && wp_should_upgrade_global_tables() ) {
+ $wpdb->query( "ALTER TABLE $wpdb->usermeta DROP INDEX meta_key, ADD INDEX meta_key(meta_key(191))" );
+ }
+ $wpdb->query( "ALTER TABLE $wpdb->terms DROP INDEX slug, ADD INDEX slug(slug(191))" );
+ $wpdb->query( "ALTER TABLE $wpdb->terms DROP INDEX name, ADD INDEX name(name(191))" );
+ $wpdb->query( "ALTER TABLE $wpdb->commentmeta DROP INDEX meta_key, ADD INDEX meta_key(meta_key(191))" );
+ $wpdb->query( "ALTER TABLE $wpdb->postmeta DROP INDEX meta_key, ADD INDEX meta_key(meta_key(191))" );
+ $wpdb->query( "ALTER TABLE $wpdb->posts DROP INDEX post_name, ADD INDEX post_name(post_name(191))" );
+ }
+
+ // Upgrade versions prior to 4.4.
+ if ( $wp_current_db_version < 34978 ) {
+ // If compatible termmeta table is found, use it, but enforce a proper index and update collation.
+ if ( $wpdb->get_var( "SHOW TABLES LIKE '{$wpdb->termmeta}'" ) && $wpdb->get_results( "SHOW INDEX FROM {$wpdb->termmeta} WHERE Column_name = 'meta_key'" ) ) {
+ $wpdb->query( "ALTER TABLE $wpdb->termmeta DROP INDEX meta_key, ADD INDEX meta_key(meta_key(191))" );
+ maybe_convert_table_to_utf8mb4( $wpdb->termmeta );
+ }
+ }
+}
+
+if ( ! function_exists( 'install_global_terms' ) ) :
+ /**
+ * Install global terms.
+ *
+ * @since 3.0.0
+ *
+ * @global wpdb $wpdb
+ * @global string $charset_collate
+ */
+ function install_global_terms() {
+ global $wpdb, $charset_collate;
+ $ms_queries = "
+CREATE TABLE $wpdb->sitecategories (
+ cat_ID bigint(20) NOT NULL auto_increment,
+ cat_name varchar(55) NOT NULL default '',
+ category_nicename varchar(200) NOT NULL default '',
+ last_updated timestamp NOT NULL,
+ PRIMARY KEY (cat_ID),
+ KEY category_nicename (category_nicename),
+ KEY last_updated (last_updated)
+) $charset_collate;
+";
+ // now create tables
+ dbDelta( $ms_queries );
+ }
+endif;
+
+/**
+ * Determine if global tables should be upgraded.
+ *
+ * This function performs a series of checks to ensure the environment allows
+ * for the safe upgrading of global WordPress database tables. It is necessary
+ * because global tables will commonly grow to millions of rows on large
+ * installations, and the ability to control their upgrade routines can be
+ * critical to the operation of large networks.
+ *
+ * In a future iteration, this function may use `wp_is_large_network()` to more-
+ * intelligently prevent global table upgrades. Until then, we make sure
+ * WordPress is on the main site of the main network, to avoid running queries
+ * more than once in multi-site or multi-network environments.
+ *
+ * @since 4.3.0
+ *
+ * @return bool Whether to run the upgrade routines on global tables.
+ */
+function wp_should_upgrade_global_tables() {
+
+ // Return false early if explicitly not upgrading
+ if ( defined( 'DO_NOT_UPGRADE_GLOBAL_TABLES' ) ) {
+ return false;
+ }
+
+ // Assume global tables should be upgraded
+ $should_upgrade = true;
+
+ // Set to false if not on main network (does not matter if not multi-network)
+ if ( ! is_main_network() ) {
+ $should_upgrade = false;
+ }
+
+ // Set to false if not on main site of current network (does not matter if not multi-site)
+ if ( ! is_main_site() ) {
+ $should_upgrade = false;
+ }
+
+ /**
+ * Filters if upgrade routines should be run on global tables.
+ *
+ * @param bool $should_upgrade Whether to run the upgrade routines on global tables.
+ */
+ return apply_filters( 'wp_should_upgrade_global_tables', $should_upgrade );
+}
diff --git a/www/crm/wp-admin/includes/user.php b/www/crm/wp-admin/includes/user.php
new file mode 100644
index 00000000..558ff249
--- /dev/null
+++ b/www/crm/wp-admin/includes/user.php
@@ -0,0 +1,1723 @@
+<?php
+/**
+ * WordPress user administration API.
+ *
+ * @package WordPress
+ * @subpackage Administration
+ */
+
+/**
+ * Creates a new user from the "Users" form using $_POST information.
+ *
+ * @since 2.0.0
+ *
+ * @return int|WP_Error WP_Error or User ID.
+ */
+function add_user() {
+ return edit_user();
+}
+
+/**
+ * Edit user settings based on contents of $_POST
+ *
+ * Used on user-edit.php and profile.php to manage and process user options, passwords etc.
+ *
+ * @since 2.0.0
+ *
+ * @param int $user_id Optional. User ID.
+ * @return int|WP_Error user id of the updated user.
+ */
+function edit_user( $user_id = 0 ) {
+ $wp_roles = wp_roles();
+ $user = new stdClass;
+ $user_id = (int) $user_id;
+ if ( $user_id ) {
+ $update = true;
+ $user->ID = $user_id;
+ $userdata = get_userdata( $user_id );
+ $user->user_login = wp_slash( $userdata->user_login );
+ } else {
+ $update = false;
+ }
+
+ if ( ! $update && isset( $_POST['user_login'] ) ) {
+ $user->user_login = sanitize_user( $_POST['user_login'], true );
+ }
+
+ $pass1 = $pass2 = '';
+ if ( isset( $_POST['pass1'] ) ) {
+ $pass1 = $_POST['pass1'];
+ }
+ if ( isset( $_POST['pass2'] ) ) {
+ $pass2 = $_POST['pass2'];
+ }
+
+ if ( isset( $_POST['role'] ) && current_user_can( 'promote_users' ) && ( ! $user_id || current_user_can( 'promote_user', $user_id ) ) ) {
+ $new_role = sanitize_text_field( $_POST['role'] );
+
+ // If the new role isn't editable by the logged-in user die with error.
+ $editable_roles = get_editable_roles();
+ if ( ! empty( $new_role ) && empty( $editable_roles[ $new_role ] ) ) {
+ wp_die( __( 'Sorry, you are not allowed to give users that role.' ), 403 );
+ }
+
+ $potential_role = isset( $wp_roles->role_objects[ $new_role ] ) ? $wp_roles->role_objects[ $new_role ] : false;
+
+ /*
+ * Don't let anyone with 'promote_users' edit their own role to something without it.
+ * Multisite super admins can freely edit their roles, they possess all caps.
+ */
+ if (
+ ( is_multisite() && current_user_can( 'manage_network_users' ) ) ||
+ $user_id !== get_current_user_id() ||
+ ( $potential_role && $potential_role->has_cap( 'promote_users' ) )
+ ) {
+ $user->role = $new_role;
+ }
+ }
+
+ if ( isset( $_POST['email'] ) ) {
+ $user->user_email = sanitize_text_field( wp_unslash( $_POST['email'] ) );
+ }
+ if ( isset( $_POST['url'] ) ) {
+ if ( empty( $_POST['url'] ) || $_POST['url'] == 'http://' ) {
+ $user->user_url = '';
+ } else {
+ $user->user_url = esc_url_raw( $_POST['url'] );
+ $protocols = implode( '|', array_map( 'preg_quote', wp_allowed_protocols() ) );
+ $user->user_url = preg_match( '/^(' . $protocols . '):/is', $user->user_url ) ? $user->user_url : 'http://' . $user->user_url;
+ }
+ }
+ if ( isset( $_POST['first_name'] ) ) {
+ $user->first_name = sanitize_text_field( $_POST['first_name'] );
+ }
+ if ( isset( $_POST['last_name'] ) ) {
+ $user->last_name = sanitize_text_field( $_POST['last_name'] );
+ }
+ if ( isset( $_POST['nickname'] ) ) {
+ $user->nickname = sanitize_text_field( $_POST['nickname'] );
+ }
+ if ( isset( $_POST['display_name'] ) ) {
+ $user->display_name = sanitize_text_field( $_POST['display_name'] );
+ }
+
+ if ( isset( $_POST['description'] ) ) {
+ $user->description = trim( $_POST['description'] );
+ }
+
+ foreach ( wp_get_user_contact_methods( $user ) as $method => $name ) {
+ if ( isset( $_POST[ $method ] ) ) {
+ $user->$method = sanitize_text_field( $_POST[ $method ] );
+ }
+ }
+
+ if ( $update ) {
+ $user->rich_editing = isset( $_POST['rich_editing'] ) && 'false' === $_POST['rich_editing'] ? 'false' : 'true';
+ $user->syntax_highlighting = isset( $_POST['syntax_highlighting'] ) && 'false' === $_POST['syntax_highlighting'] ? 'false' : 'true';
+ $user->admin_color = isset( $_POST['admin_color'] ) ? sanitize_text_field( $_POST['admin_color'] ) : 'fresh';
+ $user->show_admin_bar_front = isset( $_POST['admin_bar_front'] ) ? 'true' : 'false';
+ $user->locale = '';
+
+ if ( isset( $_POST['locale'] ) ) {
+ $locale = sanitize_text_field( $_POST['locale'] );
+ if ( 'site-default' === $locale ) {
+ $locale = '';
+ } elseif ( '' === $locale ) {
+ $locale = 'en_US';
+ } elseif ( ! in_array( $locale, get_available_languages(), true ) ) {
+ $locale = '';
+ }
+
+ $user->locale = $locale;
+ }
+ }
+
+ $user->comment_shortcuts = isset( $_POST['comment_shortcuts'] ) && 'true' == $_POST['comment_shortcuts'] ? 'true' : '';
+
+ $user->use_ssl = 0;
+ if ( ! empty( $_POST['use_ssl'] ) ) {
+ $user->use_ssl = 1;
+ }
+
+ $errors = new WP_Error();
+
+ /* checking that username has been typed */
+ if ( $user->user_login == '' ) {
+ $errors->add( 'user_login', __( '<strong>ERROR</strong>: Please enter a username.' ) );
+ }
+
+ /* checking that nickname has been typed */
+ if ( $update && empty( $user->nickname ) ) {
+ $errors->add( 'nickname', __( '<strong>ERROR</strong>: Please enter a nickname.' ) );
+ }
+
+ /**
+ * Fires before the password and confirm password fields are checked for congruity.
+ *
+ * @since 1.5.1
+ *
+ * @param string $user_login The username.
+ * @param string $pass1 The password (passed by reference).
+ * @param string $pass2 The confirmed password (passed by reference).
+ */
+ do_action_ref_array( 'check_passwords', array( $user->user_login, &$pass1, &$pass2 ) );
+
+ // Check for blank password when adding a user.
+ if ( ! $update && empty( $pass1 ) ) {
+ $errors->add( 'pass', __( '<strong>ERROR</strong>: Please enter a password.' ), array( 'form-field' => 'pass1' ) );
+ }
+
+ // Check for "\" in password.
+ if ( false !== strpos( wp_unslash( $pass1 ), '\\' ) ) {
+ $errors->add( 'pass', __( '<strong>ERROR</strong>: Passwords may not contain the character "\\".' ), array( 'form-field' => 'pass1' ) );
+ }
+
+ // Checking the password has been typed twice the same.
+ if ( ( $update || ! empty( $pass1 ) ) && $pass1 != $pass2 ) {
+ $errors->add( 'pass', __( '<strong>ERROR</strong>: Please enter the same password in both password fields.' ), array( 'form-field' => 'pass1' ) );
+ }
+
+ if ( ! empty( $pass1 ) ) {
+ $user->user_pass = $pass1;
+ }
+
+ if ( ! $update && isset( $_POST['user_login'] ) && ! validate_username( $_POST['user_login'] ) ) {
+ $errors->add( 'user_login', __( '<strong>ERROR</strong>: This username is invalid because it uses illegal characters. Please enter a valid username.' ) );
+ }
+
+ if ( ! $update && username_exists( $user->user_login ) ) {
+ $errors->add( 'user_login', __( '<strong>ERROR</strong>: This username is already registered. Please choose another one.' ) );
+ }
+
+ /** This filter is documented in wp-includes/user.php */
+ $illegal_logins = (array) apply_filters( 'illegal_user_logins', array() );
+
+ if ( in_array( strtolower( $user->user_login ), array_map( 'strtolower', $illegal_logins ) ) ) {
+ $errors->add( 'invalid_username', __( '<strong>ERROR</strong>: Sorry, that username is not allowed.' ) );
+ }
+
+ /* checking email address */
+ if ( empty( $user->user_email ) ) {
+ $errors->add( 'empty_email', __( '<strong>ERROR</strong>: Please enter an email address.' ), array( 'form-field' => 'email' ) );
+ } elseif ( ! is_email( $user->user_email ) ) {
+ $errors->add( 'invalid_email', __( '<strong>ERROR</strong>: The email address isn&#8217;t correct.' ), array( 'form-field' => 'email' ) );
+ } elseif ( ( $owner_id = email_exists( $user->user_email ) ) && ( ! $update || ( $owner_id != $user->ID ) ) ) {
+ $errors->add( 'email_exists', __( '<strong>ERROR</strong>: This email is already registered, please choose another one.' ), array( 'form-field' => 'email' ) );
+ }
+
+ /**
+ * Fires before user profile update errors are returned.
+ *
+ * @since 2.8.0
+ *
+ * @param WP_Error $errors WP_Error object (passed by reference).
+ * @param bool $update Whether this is a user update.
+ * @param stdClass $user User object (passed by reference).
+ */
+ do_action_ref_array( 'user_profile_update_errors', array( &$errors, $update, &$user ) );
+
+ if ( $errors->has_errors() ) {
+ return $errors;
+ }
+
+ if ( $update ) {
+ $user_id = wp_update_user( $user );
+ } else {
+ $user_id = wp_insert_user( $user );
+ $notify = isset( $_POST['send_user_notification'] ) ? 'both' : 'admin';
+
+ /**
+ * Fires after a new user has been created.
+ *
+ * @since 4.4.0
+ *
+ * @param int $user_id ID of the newly created user.
+ * @param string $notify Type of notification that should happen. See wp_send_new_user_notifications()
+ * for more information on possible values.
+ */
+ do_action( 'edit_user_created_user', $user_id, $notify );
+ }
+ return $user_id;
+}
+
+/**
+ * Fetch a filtered list of user roles that the current user is
+ * allowed to edit.
+ *
+ * Simple function whose main purpose is to allow filtering of the
+ * list of roles in the $wp_roles object so that plugins can remove
+ * inappropriate ones depending on the situation or user making edits.
+ * Specifically because without filtering anyone with the edit_users
+ * capability can edit others to be administrators, even if they are
+ * only editors or authors. This filter allows admins to delegate
+ * user management.
+ *
+ * @since 2.8.0
+ *
+ * @return array[] Array of arrays containing role information.
+ */
+function get_editable_roles() {
+ $all_roles = wp_roles()->roles;
+
+ /**
+ * Filters the list of editable roles.
+ *
+ * @since 2.8.0
+ *
+ * @param array[] $all_roles Array of arrays containing role information.
+ */
+ $editable_roles = apply_filters( 'editable_roles', $all_roles );
+
+ return $editable_roles;
+}
+
+/**
+ * Retrieve user data and filter it.
+ *
+ * @since 2.0.5
+ *
+ * @param int $user_id User ID.
+ * @return WP_User|bool WP_User object on success, false on failure.
+ */
+function get_user_to_edit( $user_id ) {
+ $user = get_userdata( $user_id );
+
+ if ( $user ) {
+ $user->filter = 'edit';
+ }
+
+ return $user;
+}
+
+/**
+ * Retrieve the user's drafts.
+ *
+ * @since 2.0.0
+ *
+ * @global wpdb $wpdb WordPress database abstraction object.
+ *
+ * @param int $user_id User ID.
+ * @return array
+ */
+function get_users_drafts( $user_id ) {
+ global $wpdb;
+ $query = $wpdb->prepare( "SELECT ID, post_title FROM $wpdb->posts WHERE post_type = 'post' AND post_status = 'draft' AND post_author = %d ORDER BY post_modified DESC", $user_id );
+
+ /**
+ * Filters the user's drafts query string.
+ *
+ * @since 2.0.0
+ *
+ * @param string $query The user's drafts query string.
+ */
+ $query = apply_filters( 'get_users_drafts', $query );
+ return $wpdb->get_results( $query );
+}
+
+/**
+ * Remove user and optionally reassign posts and links to another user.
+ *
+ * If the $reassign parameter is not assigned to a User ID, then all posts will
+ * be deleted of that user. The action {@see 'delete_user'} that is passed the User ID
+ * being deleted will be run after the posts are either reassigned or deleted.
+ * The user meta will also be deleted that are for that User ID.
+ *
+ * @since 2.0.0
+ *
+ * @global wpdb $wpdb WordPress database abstraction object.
+ *
+ * @param int $id User ID.
+ * @param int $reassign Optional. Reassign posts and links to new User ID.
+ * @return bool True when finished.
+ */
+function wp_delete_user( $id, $reassign = null ) {
+ global $wpdb;
+
+ if ( ! is_numeric( $id ) ) {
+ return false;
+ }
+
+ $id = (int) $id;
+ $user = new WP_User( $id );
+
+ if ( ! $user->exists() ) {
+ return false;
+ }
+
+ // Normalize $reassign to null or a user ID. 'novalue' was an older default.
+ if ( 'novalue' === $reassign ) {
+ $reassign = null;
+ } elseif ( null !== $reassign ) {
+ $reassign = (int) $reassign;
+ }
+
+ /**
+ * Fires immediately before a user is deleted from the database.
+ *
+ * @since 2.0.0
+ *
+ * @param int $id ID of the user to delete.
+ * @param int|null $reassign ID of the user to reassign posts and links to.
+ * Default null, for no reassignment.
+ */
+ do_action( 'delete_user', $id, $reassign );
+
+ if ( null === $reassign ) {
+ $post_types_to_delete = array();
+ foreach ( get_post_types( array(), 'objects' ) as $post_type ) {
+ if ( $post_type->delete_with_user ) {
+ $post_types_to_delete[] = $post_type->name;
+ } elseif ( null === $post_type->delete_with_user && post_type_supports( $post_type->name, 'author' ) ) {
+ $post_types_to_delete[] = $post_type->name;
+ }
+ }
+
+ /**
+ * Filters the list of post types to delete with a user.
+ *
+ * @since 3.4.0
+ *
+ * @param string[] $post_types_to_delete Array of post types to delete.
+ * @param int $id User ID.
+ */
+ $post_types_to_delete = apply_filters( 'post_types_to_delete_with_user', $post_types_to_delete, $id );
+ $post_types_to_delete = implode( "', '", $post_types_to_delete );
+ $post_ids = $wpdb->get_col( $wpdb->prepare( "SELECT ID FROM $wpdb->posts WHERE post_author = %d AND post_type IN ('$post_types_to_delete')", $id ) );
+ if ( $post_ids ) {
+ foreach ( $post_ids as $post_id ) {
+ wp_delete_post( $post_id );
+ }
+ }
+
+ // Clean links
+ $link_ids = $wpdb->get_col( $wpdb->prepare( "SELECT link_id FROM $wpdb->links WHERE link_owner = %d", $id ) );
+
+ if ( $link_ids ) {
+ foreach ( $link_ids as $link_id ) {
+ wp_delete_link( $link_id );
+ }
+ }
+ } else {
+ $post_ids = $wpdb->get_col( $wpdb->prepare( "SELECT ID FROM $wpdb->posts WHERE post_author = %d", $id ) );
+ $wpdb->update( $wpdb->posts, array( 'post_author' => $reassign ), array( 'post_author' => $id ) );
+ if ( ! empty( $post_ids ) ) {
+ foreach ( $post_ids as $post_id ) {
+ clean_post_cache( $post_id );
+ }
+ }
+ $link_ids = $wpdb->get_col( $wpdb->prepare( "SELECT link_id FROM $wpdb->links WHERE link_owner = %d", $id ) );
+ $wpdb->update( $wpdb->links, array( 'link_owner' => $reassign ), array( 'link_owner' => $id ) );
+ if ( ! empty( $link_ids ) ) {
+ foreach ( $link_ids as $link_id ) {
+ clean_bookmark_cache( $link_id );
+ }
+ }
+ }
+
+ // FINALLY, delete user
+ if ( is_multisite() ) {
+ remove_user_from_blog( $id, get_current_blog_id() );
+ } else {
+ $meta = $wpdb->get_col( $wpdb->prepare( "SELECT umeta_id FROM $wpdb->usermeta WHERE user_id = %d", $id ) );
+ foreach ( $meta as $mid ) {
+ delete_metadata_by_mid( 'user', $mid );
+ }
+
+ $wpdb->delete( $wpdb->users, array( 'ID' => $id ) );
+ }
+
+ clean_user_cache( $user );
+
+ /**
+ * Fires immediately after a user is deleted from the database.
+ *
+ * @since 2.9.0
+ *
+ * @param int $id ID of the deleted user.
+ * @param int|null $reassign ID of the user to reassign posts and links to.
+ * Default null, for no reassignment.
+ */
+ do_action( 'deleted_user', $id, $reassign );
+
+ return true;
+}
+
+/**
+ * Remove all capabilities from user.
+ *
+ * @since 2.1.0
+ *
+ * @param int $id User ID.
+ */
+function wp_revoke_user( $id ) {
+ $id = (int) $id;
+
+ $user = new WP_User( $id );
+ $user->remove_all_caps();
+}
+
+/**
+ * @since 2.8.0
+ *
+ * @global int $user_ID
+ *
+ * @param false $errors Deprecated.
+ */
+function default_password_nag_handler( $errors = false ) {
+ global $user_ID;
+ // Short-circuit it.
+ if ( ! get_user_option( 'default_password_nag' ) ) {
+ return;
+ }
+
+ // get_user_setting = JS saved UI setting. else no-js-fallback code.
+ if ( 'hide' == get_user_setting( 'default_password_nag' ) || isset( $_GET['default_password_nag'] ) && '0' == $_GET['default_password_nag'] ) {
+ delete_user_setting( 'default_password_nag' );
+ update_user_option( $user_ID, 'default_password_nag', false, true );
+ }
+}
+
+/**
+ * @since 2.8.0
+ *
+ * @param int $user_ID
+ * @param object $old_data
+ */
+function default_password_nag_edit_user( $user_ID, $old_data ) {
+ // Short-circuit it.
+ if ( ! get_user_option( 'default_password_nag', $user_ID ) ) {
+ return;
+ }
+
+ $new_data = get_userdata( $user_ID );
+
+ // Remove the nag if the password has been changed.
+ if ( $new_data->user_pass != $old_data->user_pass ) {
+ delete_user_setting( 'default_password_nag' );
+ update_user_option( $user_ID, 'default_password_nag', false, true );
+ }
+}
+
+/**
+ * @since 2.8.0
+ *
+ * @global string $pagenow
+ */
+function default_password_nag() {
+ global $pagenow;
+ // Short-circuit it.
+ if ( 'profile.php' == $pagenow || ! get_user_option( 'default_password_nag' ) ) {
+ return;
+ }
+
+ echo '<div class="error default-password-nag">';
+ echo '<p>';
+ echo '<strong>' . __( 'Notice:' ) . '</strong> ';
+ _e( 'You&rsquo;re using the auto-generated password for your account. Would you like to change it?' );
+ echo '</p><p>';
+ printf( '<a href="%s">' . __( 'Yes, take me to my profile page' ) . '</a> | ', get_edit_profile_url() . '#password' );
+ printf( '<a href="%s" id="default-password-nag-no">' . __( 'No thanks, do not remind me again' ) . '</a>', '?default_password_nag=0' );
+ echo '</p></div>';
+}
+
+/**
+ * @since 3.5.0
+ * @access private
+ */
+function delete_users_add_js() {
+ ?>
+<script>
+jQuery(document).ready( function($) {
+ var submit = $('#submit').prop('disabled', true);
+ $('input[name="delete_option"]').one('change', function() {
+ submit.prop('disabled', false);
+ });
+ $('#reassign_user').focus( function() {
+ $('#delete_option1').prop('checked', true).trigger('change');
+ });
+});
+</script>
+ <?php
+}
+
+/**
+ * Optional SSL preference that can be turned on by hooking to the 'personal_options' action.
+ *
+ * See the {@see 'personal_options'} action.
+ *
+ * @since 2.7.0
+ *
+ * @param object $user User data object.
+ */
+function use_ssl_preference( $user ) {
+ ?>
+ <tr class="user-use-ssl-wrap">
+ <th scope="row"><?php _e( 'Use https' ); ?></th>
+ <td><label for="use_ssl"><input name="use_ssl" type="checkbox" id="use_ssl" value="1" <?php checked( '1', $user->use_ssl ); ?> /> <?php _e( 'Always use https when visiting the admin' ); ?></label></td>
+ </tr>
+ <?php
+}
+
+/**
+ * @param string $text
+ * @return string
+ */
+function admin_created_user_email( $text ) {
+ $roles = get_editable_roles();
+ $role = $roles[ $_REQUEST['role'] ];
+ /* translators: 1: site name, 2: site URL, 3: role */
+ return sprintf(
+ __(
+ 'Hi,
+You\'ve been invited to join \'%1$s\' at
+%2$s with the role of %3$s.
+If you do not want to join this site please ignore
+this email. This invitation will expire in a few days.
+
+Please click the following link to activate your user account:
+%%s'
+ ),
+ wp_specialchars_decode( get_bloginfo( 'name' ), ENT_QUOTES ),
+ home_url(),
+ wp_specialchars_decode( translate_user_role( $role['name'] ) )
+ );
+}
+
+/**
+ * Resend an existing request and return the result.
+ *
+ * @since 4.9.6
+ * @access private
+ *
+ * @param int $request_id Request ID.
+ * @return bool|WP_Error Returns true/false based on the success of sending the email, or a WP_Error object.
+ */
+function _wp_privacy_resend_request( $request_id ) {
+ $request_id = absint( $request_id );
+ $request = get_post( $request_id );
+
+ if ( ! $request || 'user_request' !== $request->post_type ) {
+ return new WP_Error( 'privacy_request_error', __( 'Invalid request.' ) );
+ }
+
+ $result = wp_send_user_request( $request_id );
+
+ if ( is_wp_error( $result ) ) {
+ return $result;
+ } elseif ( ! $result ) {
+ return new WP_Error( 'privacy_request_error', __( 'Unable to initiate confirmation request.' ) );
+ }
+
+ return true;
+}
+
+/**
+ * Marks a request as completed by the admin and logs the current timestamp.
+ *
+ * @since 4.9.6
+ * @access private
+ *
+ * @param int $request_id Request ID.
+ * @return int|WP_Error $result Request ID on success or WP_Error.
+ */
+function _wp_privacy_completed_request( $request_id ) {
+ $request_id = absint( $request_id );
+ $request = wp_get_user_request_data( $request_id );
+
+ if ( ! $request ) {
+ return new WP_Error( 'privacy_request_error', __( 'Invalid request.' ) );
+ }
+
+ update_post_meta( $request_id, '_wp_user_request_completed_timestamp', time() );
+
+ $result = wp_update_post(
+ array(
+ 'ID' => $request_id,
+ 'post_status' => 'request-completed',
+ )
+ );
+
+ return $result;
+}
+
+/**
+ * Handle list table actions.
+ *
+ * @since 4.9.6
+ * @access private
+ */
+function _wp_personal_data_handle_actions() {
+ if ( isset( $_POST['privacy_action_email_retry'] ) ) {
+ check_admin_referer( 'bulk-privacy_requests' );
+
+ $request_id = absint( current( array_keys( (array) wp_unslash( $_POST['privacy_action_email_retry'] ) ) ) );
+ $result = _wp_privacy_resend_request( $request_id );
+
+ if ( is_wp_error( $result ) ) {
+ add_settings_error(
+ 'privacy_action_email_retry',
+ 'privacy_action_email_retry',
+ $result->get_error_message(),
+ 'error'
+ );
+ } else {
+ add_settings_error(
+ 'privacy_action_email_retry',
+ 'privacy_action_email_retry',
+ __( 'Confirmation request sent again successfully.' ),
+ 'updated'
+ );
+ }
+ } elseif ( isset( $_POST['action'] ) ) {
+ $action = isset( $_POST['action'] ) ? sanitize_key( wp_unslash( $_POST['action'] ) ) : '';
+
+ switch ( $action ) {
+ case 'add_export_personal_data_request':
+ case 'add_remove_personal_data_request':
+ check_admin_referer( 'personal-data-request' );
+
+ if ( ! isset( $_POST['type_of_action'], $_POST['username_or_email_for_privacy_request'] ) ) {
+ add_settings_error(
+ 'action_type',
+ 'action_type',
+ __( 'Invalid action.' ),
+ 'error'
+ );
+ }
+ $action_type = sanitize_text_field( wp_unslash( $_POST['type_of_action'] ) );
+ $username_or_email_address = sanitize_text_field( wp_unslash( $_POST['username_or_email_for_privacy_request'] ) );
+ $email_address = '';
+
+ if ( ! in_array( $action_type, _wp_privacy_action_request_types(), true ) ) {
+ add_settings_error(
+ 'action_type',
+ 'action_type',
+ __( 'Invalid action.' ),
+ 'error'
+ );
+ }
+
+ if ( ! is_email( $username_or_email_address ) ) {
+ $user = get_user_by( 'login', $username_or_email_address );
+ if ( ! $user instanceof WP_User ) {
+ add_settings_error(
+ 'username_or_email_for_privacy_request',
+ 'username_or_email_for_privacy_request',
+ __( 'Unable to add this request. A valid email address or username must be supplied.' ),
+ 'error'
+ );
+ } else {
+ $email_address = $user->user_email;
+ }
+ } else {
+ $email_address = $username_or_email_address;
+ }
+
+ if ( empty( $email_address ) ) {
+ break;
+ }
+
+ $request_id = wp_create_user_request( $email_address, $action_type );
+
+ if ( is_wp_error( $request_id ) ) {
+ add_settings_error(
+ 'username_or_email_for_privacy_request',
+ 'username_or_email_for_privacy_request',
+ $request_id->get_error_message(),
+ 'error'
+ );
+ break;
+ } elseif ( ! $request_id ) {
+ add_settings_error(
+ 'username_or_email_for_privacy_request',
+ 'username_or_email_for_privacy_request',
+ __( 'Unable to initiate confirmation request.' ),
+ 'error'
+ );
+ break;
+ }
+
+ wp_send_user_request( $request_id );
+
+ add_settings_error(
+ 'username_or_email_for_privacy_request',
+ 'username_or_email_for_privacy_request',
+ __( 'Confirmation request initiated successfully.' ),
+ 'updated'
+ );
+ break;
+ }
+ }
+}
+
+/**
+ * Cleans up failed and expired requests before displaying the list table.
+ *
+ * @since 4.9.6
+ * @access private
+ */
+function _wp_personal_data_cleanup_requests() {
+ /** This filter is documented in wp-includes/user.php */
+ $expires = (int) apply_filters( 'user_request_key_expiration', DAY_IN_SECONDS );
+
+ $requests_query = new WP_Query(
+ array(
+ 'post_type' => 'user_request',
+ 'posts_per_page' => -1,
+ 'post_status' => 'request-pending',
+ 'fields' => 'ids',
+ 'date_query' => array(
+ array(
+ 'column' => 'post_modified_gmt',
+ 'before' => $expires . ' seconds ago',
+ ),
+ ),
+ )
+ );
+
+ $request_ids = $requests_query->posts;
+
+ foreach ( $request_ids as $request_id ) {
+ wp_update_post(
+ array(
+ 'ID' => $request_id,
+ 'post_status' => 'request-failed',
+ 'post_password' => '',
+ )
+ );
+ }
+}
+
+/**
+ * Personal data export.
+ *
+ * @since 4.9.6
+ * @access private
+ */
+function _wp_personal_data_export_page() {
+ if ( ! current_user_can( 'export_others_personal_data' ) ) {
+ wp_die( __( 'Sorry, you are not allowed to export personal data on this site.' ) );
+ }
+
+ _wp_personal_data_handle_actions();
+ _wp_personal_data_cleanup_requests();
+
+ // "Borrow" xfn.js for now so we don't have to create new files.
+ wp_enqueue_script( 'xfn' );
+
+ $requests_table = new WP_Privacy_Data_Export_Requests_Table(
+ array(
+ 'plural' => 'privacy_requests',
+ 'singular' => 'privacy_request',
+ 'screen' => 'export_personal_data',
+ )
+ );
+
+ $requests_table->screen->set_screen_reader_content(
+ array(
+ 'heading_views' => __( 'Filter export personal data list' ),
+ 'heading_pagination' => __( 'Export personal data list navigation' ),
+ 'heading_list' => __( 'Export personal data list' ),
+ )
+ );
+
+ $requests_table->process_bulk_action();
+ $requests_table->prepare_items();
+ ?>
+ <div class="wrap nosubsub">
+ <h1><?php esc_html_e( 'Export Personal Data' ); ?></h1>
+ <hr class="wp-header-end" />
+
+ <?php settings_errors(); ?>
+
+ <form action="<?php echo esc_url( admin_url( 'tools.php?page=export_personal_data' ) ); ?>" method="post" class="wp-privacy-request-form">
+ <h2><?php esc_html_e( 'Add Data Export Request' ); ?></h2>
+ <p><?php esc_html_e( 'An email will be sent to the user at this email address asking them to verify the request.' ); ?></p>
+
+ <div class="wp-privacy-request-form-field">
+ <label for="username_or_email_for_privacy_request"><?php esc_html_e( 'Username or email address' ); ?></label>
+ <input type="text" required class="regular-text" id="username_or_email_for_privacy_request" name="username_or_email_for_privacy_request" />
+ <?php submit_button( __( 'Send Request' ), 'secondary', 'submit', false ); ?>
+ </div>
+ <?php wp_nonce_field( 'personal-data-request' ); ?>
+ <input type="hidden" name="action" value="add_export_personal_data_request" />
+ <input type="hidden" name="type_of_action" value="export_personal_data" />
+ </form>
+ <hr />
+
+ <?php $requests_table->views(); ?>
+
+ <form class="search-form wp-clearfix">
+ <?php $requests_table->search_box( __( 'Search Requests' ), 'requests' ); ?>
+ <input type="hidden" name="page" value="export_personal_data" />
+ <input type="hidden" name="filter-status" value="<?php echo isset( $_REQUEST['filter-status'] ) ? esc_attr( sanitize_text_field( $_REQUEST['filter-status'] ) ) : ''; ?>" />
+ <input type="hidden" name="orderby" value="<?php echo isset( $_REQUEST['orderby'] ) ? esc_attr( sanitize_text_field( $_REQUEST['orderby'] ) ) : ''; ?>" />
+ <input type="hidden" name="order" value="<?php echo isset( $_REQUEST['order'] ) ? esc_attr( sanitize_text_field( $_REQUEST['order'] ) ) : ''; ?>" />
+ </form>
+
+ <form method="post">
+ <?php
+ $requests_table->display();
+ $requests_table->embed_scripts();
+ ?>
+ </form>
+ </div>
+ <?php
+}
+
+/**
+ * Personal data anonymization.
+ *
+ * @since 4.9.6
+ * @access private
+ */
+function _wp_personal_data_removal_page() {
+ /*
+ * Require both caps in order to make it explicitly clear that delegating
+ * erasure from network admins to single-site admins will give them the
+ * ability to affect global users, rather than being limited to the site
+ * that they administer.
+ */
+ if ( ! current_user_can( 'erase_others_personal_data' ) || ! current_user_can( 'delete_users' ) ) {
+ wp_die( __( 'Sorry, you are not allowed to erase data on this site.' ) );
+ }
+
+ _wp_personal_data_handle_actions();
+ _wp_personal_data_cleanup_requests();
+
+ // "Borrow" xfn.js for now so we don't have to create new files.
+ wp_enqueue_script( 'xfn' );
+
+ $requests_table = new WP_Privacy_Data_Removal_Requests_Table(
+ array(
+ 'plural' => 'privacy_requests',
+ 'singular' => 'privacy_request',
+ 'screen' => 'remove_personal_data',
+ )
+ );
+
+ $requests_table->screen->set_screen_reader_content(
+ array(
+ 'heading_views' => __( 'Filter erase personal data list' ),
+ 'heading_pagination' => __( 'Erase personal data list navigation' ),
+ 'heading_list' => __( 'Erase personal data list' ),
+ )
+ );
+
+ $requests_table->process_bulk_action();
+ $requests_table->prepare_items();
+
+ ?>
+ <div class="wrap nosubsub">
+ <h1><?php esc_html_e( 'Erase Personal Data' ); ?></h1>
+ <hr class="wp-header-end" />
+
+ <?php settings_errors(); ?>
+
+ <form action="<?php echo esc_url( admin_url( 'tools.php?page=remove_personal_data' ) ); ?>" method="post" class="wp-privacy-request-form">
+ <h2><?php esc_html_e( 'Add Data Erasure Request' ); ?></h2>
+ <p><?php esc_html_e( 'An email will be sent to the user at this email address asking them to verify the request.' ); ?></p>
+
+ <div class="wp-privacy-request-form-field">
+ <label for="username_or_email_for_privacy_request"><?php esc_html_e( 'Username or email address' ); ?></label>
+ <input type="text" required class="regular-text" id="username_or_email_for_privacy_request" name="username_or_email_for_privacy_request" />
+ <?php submit_button( __( 'Send Request' ), 'secondary', 'submit', false ); ?>
+ </div>
+ <?php wp_nonce_field( 'personal-data-request' ); ?>
+ <input type="hidden" name="action" value="add_remove_personal_data_request" />
+ <input type="hidden" name="type_of_action" value="remove_personal_data" />
+ </form>
+ <hr />
+
+ <?php $requests_table->views(); ?>
+
+ <form class="search-form wp-clearfix">
+ <?php $requests_table->search_box( __( 'Search Requests' ), 'requests' ); ?>
+ <input type="hidden" name="page" value="remove_personal_data" />
+ <input type="hidden" name="filter-status" value="<?php echo isset( $_REQUEST['filter-status'] ) ? esc_attr( sanitize_text_field( $_REQUEST['filter-status'] ) ) : ''; ?>" />
+ <input type="hidden" name="orderby" value="<?php echo isset( $_REQUEST['orderby'] ) ? esc_attr( sanitize_text_field( $_REQUEST['orderby'] ) ) : ''; ?>" />
+ <input type="hidden" name="order" value="<?php echo isset( $_REQUEST['order'] ) ? esc_attr( sanitize_text_field( $_REQUEST['order'] ) ) : ''; ?>" />
+ </form>
+
+ <form method="post">
+ <?php
+ $requests_table->display();
+ $requests_table->embed_scripts();
+ ?>
+ </form>
+ </div>
+ <?php
+}
+
+/**
+ * Mark erasure requests as completed after processing is finished.
+ *
+ * This intercepts the Ajax responses to personal data eraser page requests, and
+ * monitors the status of a request. Once all of the processing has finished, the
+ * request is marked as completed.
+ *
+ * @since 4.9.6
+ *
+ * @see wp_privacy_personal_data_erasure_page
+ *
+ * @param array $response The response from the personal data eraser for
+ * the given page.
+ * @param int $eraser_index The index of the personal data eraser. Begins
+ * at 1.
+ * @param string $email_address The email address of the user whose personal
+ * data this is.
+ * @param int $page The page of personal data for this eraser.
+ * Begins at 1.
+ * @param int $request_id The request ID for this personal data erasure.
+ * @return array The filtered response.
+ */
+function wp_privacy_process_personal_data_erasure_page( $response, $eraser_index, $email_address, $page, $request_id ) {
+ /*
+ * If the eraser response is malformed, don't attempt to consume it; let it
+ * pass through, so that the default Ajax processing will generate a warning
+ * to the user.
+ */
+ if ( ! is_array( $response ) ) {
+ return $response;
+ }
+
+ if ( ! array_key_exists( 'done', $response ) ) {
+ return $response;
+ }
+
+ if ( ! array_key_exists( 'items_removed', $response ) ) {
+ return $response;
+ }
+
+ if ( ! array_key_exists( 'items_retained', $response ) ) {
+ return $response;
+ }
+
+ if ( ! array_key_exists( 'messages', $response ) ) {
+ return $response;
+ }
+
+ $request = wp_get_user_request_data( $request_id );
+
+ if ( ! $request || 'remove_personal_data' !== $request->action_name ) {
+ wp_send_json_error( __( 'Invalid request ID when processing eraser data.' ) );
+ }
+
+ /** This filter is documented in wp-admin/includes/ajax-actions.php */
+ $erasers = apply_filters( 'wp_privacy_personal_data_erasers', array() );
+ $is_last_eraser = count( $erasers ) === $eraser_index;
+ $eraser_done = $response['done'];
+
+ if ( ! $is_last_eraser || ! $eraser_done ) {
+ return $response;
+ }
+
+ _wp_privacy_completed_request( $request_id );
+
+ /**
+ * Fires immediately after a personal data erasure request has been marked completed.
+ *
+ * @since 4.9.6
+ *
+ * @param int $request_id The privacy request post ID associated with this request.
+ */
+ do_action( 'wp_privacy_personal_data_erased', $request_id );
+
+ return $response;
+}
+
+/**
+ * Add requests pages.
+ *
+ * @since 4.9.6
+ * @access private
+ */
+function _wp_privacy_hook_requests_page() {
+ add_submenu_page( 'tools.php', __( 'Export Personal Data' ), __( 'Export Personal Data' ), 'export_others_personal_data', 'export_personal_data', '_wp_personal_data_export_page' );
+ add_submenu_page( 'tools.php', __( 'Erase Personal Data' ), __( 'Erase Personal Data' ), 'erase_others_personal_data', 'remove_personal_data', '_wp_personal_data_removal_page' );
+}
+
+/**
+ * Add options for the privacy requests screens.
+ *
+ * @since 4.9.8
+ * @access private
+ */
+function _wp_privacy_requests_screen_options() {
+ $args = array(
+ 'option' => str_replace( 'tools_page_', '', get_current_screen()->id ) . '_requests_per_page',
+ );
+ add_screen_option( 'per_page', $args );
+}
+
+// TODO: move the following classes in new files.
+if ( ! class_exists( 'WP_List_Table' ) ) {
+ require_once( ABSPATH . 'wp-admin/includes/class-wp-list-table.php' );
+}
+
+/**
+ * WP_Privacy_Requests_Table class.
+ *
+ * @since 4.9.6
+ */
+abstract class WP_Privacy_Requests_Table extends WP_List_Table {
+
+ /**
+ * Action name for the requests this table will work with. Classes
+ * which inherit from WP_Privacy_Requests_Table should define this.
+ *
+ * Example: 'export_personal_data'.
+ *
+ * @since 4.9.6
+ *
+ * @var string $request_type Name of action.
+ */
+ protected $request_type = 'INVALID';
+
+ /**
+ * Post type to be used.
+ *
+ * @since 4.9.6
+ *
+ * @var string $post_type The post type.
+ */
+ protected $post_type = 'INVALID';
+
+ /**
+ * Get columns to show in the list table.
+ *
+ * @since 4.9.6
+ *
+ * @return array Array of columns.
+ */
+ public function get_columns() {
+ $columns = array(
+ 'cb' => '<input type="checkbox" />',
+ 'email' => __( 'Requester' ),
+ 'status' => __( 'Status' ),
+ 'created_timestamp' => __( 'Requested' ),
+ 'next_steps' => __( 'Next Steps' ),
+ );
+ return $columns;
+ }
+
+ /**
+ * Get a list of sortable columns.
+ *
+ * @since 4.9.6
+ *
+ * @return array Default sortable columns.
+ */
+ protected function get_sortable_columns() {
+ // The initial sorting is by 'Requested' (post_date) and descending.
+ // With initial sorting, the first click on 'Requested' should be ascending.
+ // With 'Requester' sorting active, the next click on 'Requested' should be descending.
+ $desc_first = isset( $_GET['orderby'] );
+
+ return array(
+ 'email' => 'requester',
+ 'created_timestamp' => array( 'requested', $desc_first ),
+ );
+ }
+
+ /**
+ * Default primary column.
+ *
+ * @since 4.9.6
+ *
+ * @return string Default primary column name.
+ */
+ protected function get_default_primary_column_name() {
+ return 'email';
+ }
+
+ /**
+ * Count number of requests for each status.
+ *
+ * @since 4.9.6
+ *
+ * @return object Number of posts for each status.
+ */
+ protected function get_request_counts() {
+ global $wpdb;
+
+ $cache_key = $this->post_type . '-' . $this->request_type;
+ $counts = wp_cache_get( $cache_key, 'counts' );
+
+ if ( false !== $counts ) {
+ return $counts;
+ }
+
+ $query = "
+ SELECT post_status, COUNT( * ) AS num_posts
+ FROM {$wpdb->posts}
+ WHERE post_type = %s
+ AND post_name = %s
+ GROUP BY post_status";
+
+ $results = (array) $wpdb->get_results( $wpdb->prepare( $query, $this->post_type, $this->request_type ), ARRAY_A );
+ $counts = array_fill_keys( get_post_stati(), 0 );
+
+ foreach ( $results as $row ) {
+ $counts[ $row['post_status'] ] = $row['num_posts'];
+ }
+
+ $counts = (object) $counts;
+ wp_cache_set( $cache_key, $counts, 'counts' );
+
+ return $counts;
+ }
+
+ /**
+ * Get an associative array ( id => link ) with the list of views available on this table.
+ *
+ * @since 4.9.6
+ *
+ * @return array Associative array of views in the format of $view_name => $view_markup.
+ */
+ protected function get_views() {
+ $current_status = isset( $_REQUEST['filter-status'] ) ? sanitize_text_field( $_REQUEST['filter-status'] ) : '';
+ $statuses = _wp_privacy_statuses();
+ $views = array();
+ $admin_url = admin_url( 'tools.php?page=' . $this->request_type );
+ $counts = $this->get_request_counts();
+ $total_requests = absint( array_sum( (array) $counts ) );
+
+ $current_link_attributes = empty( $current_status ) ? ' class="current" aria-current="page"' : '';
+ $status_label = sprintf(
+ /* translators: %s: all requests count */
+ _nx(
+ 'All <span class="count">(%s)</span>',
+ 'All <span class="count">(%s)</span>',
+ $total_requests,
+ 'requests'
+ ),
+ number_format_i18n( $total_requests )
+ );
+
+ $views['all'] = sprintf(
+ '<a href="%s"%s>%s</a>',
+ esc_url( $admin_url ),
+ $current_link_attributes,
+ $status_label
+ );
+
+ foreach ( $statuses as $status => $label ) {
+ $post_status = get_post_status_object( $status );
+ if ( ! $post_status ) {
+ continue;
+ }
+
+ $current_link_attributes = $status === $current_status ? ' class="current" aria-current="page"' : '';
+ $total_status_requests = absint( $counts->{$status} );
+ $status_label = sprintf(
+ translate_nooped_plural( $post_status->label_count, $total_status_requests ),
+ number_format_i18n( $total_status_requests )
+ );
+ $status_link = add_query_arg( 'filter-status', $status, $admin_url );
+
+ $views[ $status ] = sprintf(
+ '<a href="%s"%s>%s</a>',
+ esc_url( $status_link ),
+ $current_link_attributes,
+ $status_label
+ );
+ }
+
+ return $views;
+ }
+
+ /**
+ * Get bulk actions.
+ *
+ * @since 4.9.6
+ *
+ * @return array List of bulk actions.
+ */
+ protected function get_bulk_actions() {
+ return array(
+ 'delete' => __( 'Remove' ),
+ 'resend' => __( 'Resend email' ),
+ );
+ }
+
+ /**
+ * Process bulk actions.
+ *
+ * @since 4.9.6
+ */
+ public function process_bulk_action() {
+ $action = $this->current_action();
+ $request_ids = isset( $_REQUEST['request_id'] ) ? wp_parse_id_list( wp_unslash( $_REQUEST['request_id'] ) ) : array();
+
+ $count = 0;
+
+ if ( $request_ids ) {
+ check_admin_referer( 'bulk-privacy_requests' );
+ }
+
+ switch ( $action ) {
+ case 'delete':
+ foreach ( $request_ids as $request_id ) {
+ if ( wp_delete_post( $request_id, true ) ) {
+ $count ++;
+ }
+ }
+
+ add_settings_error(
+ 'bulk_action',
+ 'bulk_action',
+ /* translators: %d: number of requests */
+ sprintf( _n( 'Deleted %d request', 'Deleted %d requests', $count ), $count ),
+ 'updated'
+ );
+ break;
+ case 'resend':
+ foreach ( $request_ids as $request_id ) {
+ $resend = _wp_privacy_resend_request( $request_id );
+
+ if ( $resend && ! is_wp_error( $resend ) ) {
+ $count++;
+ }
+ }
+
+ add_settings_error(
+ 'bulk_action',
+ 'bulk_action',
+ /* translators: %d: number of requests */
+ sprintf( _n( 'Re-sent %d request', 'Re-sent %d requests', $count ), $count ),
+ 'updated'
+ );
+ break;
+ }
+ }
+
+ /**
+ * Prepare items to output.
+ *
+ * @since 4.9.6
+ * @since 5.1.0 Added support for column sorting.
+ */
+ public function prepare_items() {
+ global $wpdb;
+
+ $this->items = array();
+ $posts_per_page = $this->get_items_per_page( $this->request_type . '_requests_per_page' );
+ $args = array(
+ 'post_type' => $this->post_type,
+ 'post_name__in' => array( $this->request_type ),
+ 'posts_per_page' => $posts_per_page,
+ 'offset' => isset( $_REQUEST['paged'] ) ? max( 0, absint( $_REQUEST['paged'] ) - 1 ) * $posts_per_page : 0,
+ 'post_status' => 'any',
+ 's' => isset( $_REQUEST['s'] ) ? sanitize_text_field( $_REQUEST['s'] ) : '',
+ );
+
+ $orderby_mapping = array(
+ 'requester' => 'post_title',
+ 'requested' => 'post_date',
+ );
+
+ if ( isset( $_REQUEST['orderby'] ) && isset( $orderby_mapping[ $_REQUEST['orderby'] ] ) ) {
+ $args['orderby'] = $orderby_mapping[ $_REQUEST['orderby'] ];
+ }
+
+ if ( isset( $_REQUEST['order'] ) && in_array( strtoupper( $_REQUEST['order'] ), array( 'ASC', 'DESC' ), true ) ) {
+ $args['order'] = strtoupper( $_REQUEST['order'] );
+ }
+
+ if ( ! empty( $_REQUEST['filter-status'] ) ) {
+ $filter_status = isset( $_REQUEST['filter-status'] ) ? sanitize_text_field( $_REQUEST['filter-status'] ) : '';
+ $args['post_status'] = $filter_status;
+ }
+
+ $requests_query = new WP_Query( $args );
+ $requests = $requests_query->posts;
+
+ foreach ( $requests as $request ) {
+ $this->items[] = wp_get_user_request_data( $request->ID );
+ }
+
+ $this->items = array_filter( $this->items );
+
+ $this->set_pagination_args(
+ array(
+ 'total_items' => $requests_query->found_posts,
+ 'per_page' => $posts_per_page,
+ )
+ );
+ }
+
+ /**
+ * Checkbox column.
+ *
+ * @since 4.9.6
+ *
+ * @param WP_User_Request $item Item being shown.
+ * @return string Checkbox column markup.
+ */
+ public function column_cb( $item ) {
+ return sprintf( '<input type="checkbox" name="request_id[]" value="%1$s" /><span class="spinner"></span>', esc_attr( $item->ID ) );
+ }
+
+ /**
+ * Status column.
+ *
+ * @since 4.9.6
+ *
+ * @param WP_User_Request $item Item being shown.
+ * @return string Status column markup.
+ */
+ public function column_status( $item ) {
+ $status = get_post_status( $item->ID );
+ $status_object = get_post_status_object( $status );
+
+ if ( ! $status_object || empty( $status_object->label ) ) {
+ return '-';
+ }
+
+ $timestamp = false;
+
+ switch ( $status ) {
+ case 'request-confirmed':
+ $timestamp = $item->confirmed_timestamp;
+ break;
+ case 'request-completed':
+ $timestamp = $item->completed_timestamp;
+ break;
+ }
+
+ echo '<span class="status-label status-' . esc_attr( $status ) . '">';
+ echo esc_html( $status_object->label );
+
+ if ( $timestamp ) {
+ echo ' (' . $this->get_timestamp_as_date( $timestamp ) . ')';
+ }
+
+ echo '</span>';
+ }
+
+ /**
+ * Convert timestamp for display.
+ *
+ * @since 4.9.6
+ *
+ * @param int $timestamp Event timestamp.
+ * @return string Human readable date.
+ */
+ protected function get_timestamp_as_date( $timestamp ) {
+ if ( empty( $timestamp ) ) {
+ return '';
+ }
+
+ $time_diff = time() - $timestamp;
+
+ if ( $time_diff >= 0 && $time_diff < DAY_IN_SECONDS ) {
+ /* translators: human readable timestamp */
+ return sprintf( __( '%s ago' ), human_time_diff( $timestamp ) );
+ }
+
+ return date_i18n( get_option( 'date_format' ), $timestamp );
+ }
+
+ /**
+ * Default column handler.
+ *
+ * @since 4.9.6
+ *
+ * @param WP_User_Request $item Item being shown.
+ * @param string $column_name Name of column being shown.
+ * @return string Default column output.
+ */
+ public function column_default( $item, $column_name ) {
+ $cell_value = $item->$column_name;
+
+ if ( in_array( $column_name, array( 'created_timestamp' ), true ) ) {
+ return $this->get_timestamp_as_date( $cell_value );
+ }
+
+ return $cell_value;
+ }
+
+ /**
+ * Actions column. Overridden by children.
+ *
+ * @since 4.9.6
+ *
+ * @param WP_User_Request $item Item being shown.
+ * @return string Email column markup.
+ */
+ public function column_email( $item ) {
+ return sprintf( '<a href="%1$s">%2$s</a> %3$s', esc_url( 'mailto:' . $item->email ), $item->email, $this->row_actions( array() ) );
+ }
+
+ /**
+ * Next steps column. Overridden by children.
+ *
+ * @since 4.9.6
+ *
+ * @param WP_User_Request $item Item being shown.
+ */
+ public function column_next_steps( $item ) {}
+
+ /**
+ * Generates content for a single row of the table,
+ *
+ * @since 4.9.6
+ *
+ * @param WP_User_Request $item The current item.
+ */
+ public function single_row( $item ) {
+ $status = $item->status;
+
+ echo '<tr id="request-' . esc_attr( $item->ID ) . '" class="status-' . esc_attr( $status ) . '">';
+ $this->single_row_columns( $item );
+ echo '</tr>';
+ }
+
+ /**
+ * Embed scripts used to perform actions. Overridden by children.
+ *
+ * @since 4.9.6
+ */
+ public function embed_scripts() {}
+}
+
+/**
+ * WP_Privacy_Data_Export_Requests_Table class.
+ *
+ * @since 4.9.6
+ */
+class WP_Privacy_Data_Export_Requests_Table extends WP_Privacy_Requests_Table {
+ /**
+ * Action name for the requests this table will work with.
+ *
+ * @since 4.9.6
+ *
+ * @var string $request_type Name of action.
+ */
+ protected $request_type = 'export_personal_data';
+
+ /**
+ * Post type for the requests.
+ *
+ * @since 4.9.6
+ *
+ * @var string $post_type The post type.
+ */
+ protected $post_type = 'user_request';
+
+ /**
+ * Actions column.
+ *
+ * @since 4.9.6
+ *
+ * @param WP_User_Request $item Item being shown.
+ * @return string Email column markup.
+ */
+ public function column_email( $item ) {
+ /** This filter is documented in wp-admin/includes/ajax-actions.php */
+ $exporters = apply_filters( 'wp_privacy_personal_data_exporters', array() );
+ $exporters_count = count( $exporters );
+ $request_id = $item->ID;
+ $nonce = wp_create_nonce( 'wp-privacy-export-personal-data-' . $request_id );
+
+ $download_data_markup = '<div class="export-personal-data" ' .
+ 'data-exporters-count="' . esc_attr( $exporters_count ) . '" ' .
+ 'data-request-id="' . esc_attr( $request_id ) . '" ' .
+ 'data-nonce="' . esc_attr( $nonce ) .
+ '">';
+
+ $download_data_markup .= '<span class="export-personal-data-idle"><button type="button" class="button-link export-personal-data-handle">' . __( 'Download Personal Data' ) . '</button></span>' .
+ '<span style="display:none" class="export-personal-data-processing" >' . __( 'Downloading Data...' ) . '</span>' .
+ '<span style="display:none" class="export-personal-data-success"><button type="button" class="button-link export-personal-data-handle">' . __( 'Download Personal Data Again' ) . '</button></span>' .
+ '<span style="display:none" class="export-personal-data-failed">' . __( 'Download failed.' ) . ' <button type="button" class="button-link">' . __( 'Retry' ) . '</button></span>';
+
+ $download_data_markup .= '</div>';
+
+ $row_actions = array(
+ 'download-data' => $download_data_markup,
+ );
+
+ return sprintf( '<a href="%1$s">%2$s</a> %3$s', esc_url( 'mailto:' . $item->email ), $item->email, $this->row_actions( $row_actions ) );
+ }
+
+ /**
+ * Displays the next steps column.
+ *
+ * @since 4.9.6
+ *
+ * @param WP_User_Request $item Item being shown.
+ */
+ public function column_next_steps( $item ) {
+ $status = $item->status;
+
+ switch ( $status ) {
+ case 'request-pending':
+ esc_html_e( 'Waiting for confirmation' );
+ break;
+ case 'request-confirmed':
+ /** This filter is documented in wp-admin/includes/ajax-actions.php */
+ $exporters = apply_filters( 'wp_privacy_personal_data_exporters', array() );
+ $exporters_count = count( $exporters );
+ $request_id = $item->ID;
+ $nonce = wp_create_nonce( 'wp-privacy-export-personal-data-' . $request_id );
+
+ echo '<div class="export-personal-data" ' .
+ 'data-send-as-email="1" ' .
+ 'data-exporters-count="' . esc_attr( $exporters_count ) . '" ' .
+ 'data-request-id="' . esc_attr( $request_id ) . '" ' .
+ 'data-nonce="' . esc_attr( $nonce ) .
+ '">';
+
+ ?>
+ <span class="export-personal-data-idle"><button type="button" class="button export-personal-data-handle"><?php _e( 'Send Export Link' ); ?></button></span>
+ <span style="display:none" class="export-personal-data-processing button updating-message" ><?php _e( 'Sending Email...' ); ?></span>
+ <span style="display:none" class="export-personal-data-success success-message" ><?php _e( 'Email sent.' ); ?></span>
+ <span style="display:none" class="export-personal-data-failed"><?php _e( 'Email could not be sent.' ); ?> <button type="button" class="button export-personal-data-handle"><?php _e( 'Retry' ); ?></button></span>
+ <?php
+
+ echo '</div>';
+ break;
+ case 'request-failed':
+ submit_button( __( 'Retry' ), 'secondary', 'privacy_action_email_retry[' . $item->ID . ']', false );
+ break;
+ case 'request-completed':
+ echo '<a href="' . esc_url(
+ wp_nonce_url(
+ add_query_arg(
+ array(
+ 'action' => 'delete',
+ 'request_id' => array( $item->ID ),
+ ),
+ admin_url( 'tools.php?page=export_personal_data' )
+ ),
+ 'bulk-privacy_requests'
+ )
+ ) . '" class="button">' . esc_html__( 'Remove request' ) . '</a>';
+ break;
+ }
+ }
+}
+
+/**
+ * WP_Privacy_Data_Removal_Requests_Table class.
+ *
+ * @since 4.9.6
+ */
+class WP_Privacy_Data_Removal_Requests_Table extends WP_Privacy_Requests_Table {
+ /**
+ * Action name for the requests this table will work with.
+ *
+ * @since 4.9.6
+ *
+ * @var string $request_type Name of action.
+ */
+ protected $request_type = 'remove_personal_data';
+
+ /**
+ * Post type for the requests.
+ *
+ * @since 4.9.6
+ *
+ * @var string $post_type The post type.
+ */
+ protected $post_type = 'user_request';
+
+ /**
+ * Actions column.
+ *
+ * @since 4.9.6
+ *
+ * @param WP_User_Request $item Item being shown.
+ * @return string Email column markup.
+ */
+ public function column_email( $item ) {
+ $row_actions = array();
+
+ // Allow the administrator to "force remove" the personal data even if confirmation has not yet been received.
+ $status = $item->status;
+ if ( 'request-confirmed' !== $status ) {
+ /** This filter is documented in wp-admin/includes/ajax-actions.php */
+ $erasers = apply_filters( 'wp_privacy_personal_data_erasers', array() );
+ $erasers_count = count( $erasers );
+ $request_id = $item->ID;
+ $nonce = wp_create_nonce( 'wp-privacy-erase-personal-data-' . $request_id );
+
+ $remove_data_markup = '<div class="remove-personal-data force-remove-personal-data" ' .
+ 'data-erasers-count="' . esc_attr( $erasers_count ) . '" ' .
+ 'data-request-id="' . esc_attr( $request_id ) . '" ' .
+ 'data-nonce="' . esc_attr( $nonce ) .
+ '">';
+
+ $remove_data_markup .= '<span class="remove-personal-data-idle"><button type="button" class="button-link remove-personal-data-handle">' . __( 'Force Erase Personal Data' ) . '</button></span>' .
+ '<span style="display:none" class="remove-personal-data-processing" >' . __( 'Erasing Data...' ) . '</span>' .
+ '<span style="display:none" class="remove-personal-data-failed">' . __( 'Force Erase has failed.' ) . ' <button type="button" class="button-link remove-personal-data-handle">' . __( 'Retry' ) . '</button></span>';
+
+ $remove_data_markup .= '</div>';
+
+ $row_actions = array(
+ 'remove-data' => $remove_data_markup,
+ );
+ }
+
+ return sprintf( '<a href="%1$s">%2$s</a> %3$s', esc_url( 'mailto:' . $item->email ), $item->email, $this->row_actions( $row_actions ) );
+ }
+
+ /**
+ * Next steps column.
+ *
+ * @since 4.9.6
+ *
+ * @param WP_User_Request $item Item being shown.
+ */
+ public function column_next_steps( $item ) {
+ $status = $item->status;
+
+ switch ( $status ) {
+ case 'request-pending':
+ esc_html_e( 'Waiting for confirmation' );
+ break;
+ case 'request-confirmed':
+ /** This filter is documented in wp-admin/includes/ajax-actions.php */
+ $erasers = apply_filters( 'wp_privacy_personal_data_erasers', array() );
+ $erasers_count = count( $erasers );
+ $request_id = $item->ID;
+ $nonce = wp_create_nonce( 'wp-privacy-erase-personal-data-' . $request_id );
+
+ echo '<div class="remove-personal-data" ' .
+ 'data-force-erase="1" ' .
+ 'data-erasers-count="' . esc_attr( $erasers_count ) . '" ' .
+ 'data-request-id="' . esc_attr( $request_id ) . '" ' .
+ 'data-nonce="' . esc_attr( $nonce ) .
+ '">';
+
+ ?>
+ <span class="remove-personal-data-idle"><button type="button" class="button remove-personal-data-handle"><?php _e( 'Erase Personal Data' ); ?></button></span>
+ <span style="display:none" class="remove-personal-data-processing button updating-message" ><?php _e( 'Erasing Data...' ); ?></span>
+ <span style="display:none" class="remove-personal-data-failed"><?php _e( 'Erasing Data has failed.' ); ?> <button type="button" class="button remove-personal-data-handle"><?php _e( 'Retry' ); ?></button></span>
+ <?php
+
+ echo '</div>';
+
+ break;
+ case 'request-failed':
+ submit_button( __( 'Retry' ), 'secondary', 'privacy_action_email_retry[' . $item->ID . ']', false );
+ break;
+ case 'request-completed':
+ echo '<a href="' . esc_url(
+ wp_nonce_url(
+ add_query_arg(
+ array(
+ 'action' => 'delete',
+ 'request_id' => array( $item->ID ),
+ ),
+ admin_url( 'tools.php?page=remove_personal_data' )
+ ),
+ 'bulk-privacy_requests'
+ )
+ ) . '" class="button">' . esc_html__( 'Remove request' ) . '</a>';
+ break;
+ }
+ }
+
+}
diff --git a/www/crm/wp-admin/includes/widgets.php b/www/crm/wp-admin/includes/widgets.php
new file mode 100644
index 00000000..e16d459c
--- /dev/null
+++ b/www/crm/wp-admin/includes/widgets.php
@@ -0,0 +1,316 @@
+<?php
+/**
+ * WordPress Widgets Administration API
+ *
+ * @package WordPress
+ * @subpackage Administration
+ */
+
+/**
+ * Display list of the available widgets.
+ *
+ * @since 2.5.0
+ *
+ * @global array $wp_registered_widgets
+ * @global array $wp_registered_widget_controls
+ */
+function wp_list_widgets() {
+ global $wp_registered_widgets, $wp_registered_widget_controls;
+
+ $sort = $wp_registered_widgets;
+ usort( $sort, '_sort_name_callback' );
+ $done = array();
+
+ foreach ( $sort as $widget ) {
+ if ( in_array( $widget['callback'], $done, true ) ) { // We already showed this multi-widget
+ continue;
+ }
+
+ $sidebar = is_active_widget( $widget['callback'], $widget['id'], false, false );
+ $done[] = $widget['callback'];
+
+ if ( ! isset( $widget['params'][0] ) ) {
+ $widget['params'][0] = array();
+ }
+
+ $args = array(
+ 'widget_id' => $widget['id'],
+ 'widget_name' => $widget['name'],
+ '_display' => 'template',
+ );
+
+ if ( isset( $wp_registered_widget_controls[ $widget['id'] ]['id_base'] ) && isset( $widget['params'][0]['number'] ) ) {
+ $id_base = $wp_registered_widget_controls[ $widget['id'] ]['id_base'];
+ $args['_temp_id'] = "$id_base-__i__";
+ $args['_multi_num'] = next_widget_id_number( $id_base );
+ $args['_add'] = 'multi';
+ } else {
+ $args['_add'] = 'single';
+ if ( $sidebar ) {
+ $args['_hide'] = '1';
+ }
+ }
+
+ $args = wp_list_widget_controls_dynamic_sidebar(
+ array(
+ 0 => $args,
+ 1 => $widget['params'][0],
+ )
+ );
+ call_user_func_array( 'wp_widget_control', $args );
+ }
+}
+
+/**
+ * Callback to sort array by a 'name' key.
+ *
+ * @since 3.1.0
+ * @access private
+ *
+ * @return int
+ */
+function _sort_name_callback( $a, $b ) {
+ return strnatcasecmp( $a['name'], $b['name'] );
+}
+
+/**
+ * Show the widgets and their settings for a sidebar.
+ * Used in the admin widget config screen.
+ *
+ * @since 2.5.0
+ *
+ * @param string $sidebar Sidebar ID.
+ * @param string $sidebar_name Optional. Sidebar name. Default empty.
+ */
+function wp_list_widget_controls( $sidebar, $sidebar_name = '' ) {
+ add_filter( 'dynamic_sidebar_params', 'wp_list_widget_controls_dynamic_sidebar' );
+
+ $description = wp_sidebar_description( $sidebar );
+
+ echo '<div id="' . esc_attr( $sidebar ) . '" class="widgets-sortables">';
+
+ if ( $sidebar_name ) {
+ $add_to = sprintf(
+ /* translators: %s: widgets sidebar name. */
+ __( 'Add to: %s' ),
+ $sidebar_name
+ );
+ ?>
+ <div class="sidebar-name" data-add-to="<?php echo esc_attr( $add_to ); ?>">
+ <button type="button" class="handlediv hide-if-no-js" aria-expanded="true">
+ <span class="screen-reader-text"><?php echo esc_html( $sidebar_name ); ?></span>
+ <span class="toggle-indicator" aria-hidden="true"></span>
+ </button>
+ <h2><?php echo esc_html( $sidebar_name ); ?> <span class="spinner"></span></h2>
+ </div>
+ <?php
+ }
+
+ if ( ! empty( $description ) ) {
+ ?>
+ <div class="sidebar-description">
+ <p class="description"><?php echo $description; ?></p>
+ </div>
+ <?php
+ }
+
+ dynamic_sidebar( $sidebar );
+
+ echo '</div>';
+}
+
+/**
+ * Retrieves the widget control arguments.
+ *
+ * @since 2.5.0
+ *
+ * @global array $wp_registered_widgets
+ *
+ * @staticvar int $i
+ *
+ * @param array $params
+ * @return array
+ */
+function wp_list_widget_controls_dynamic_sidebar( $params ) {
+ global $wp_registered_widgets;
+ static $i = 0;
+ $i++;
+
+ $widget_id = $params[0]['widget_id'];
+ $id = isset( $params[0]['_temp_id'] ) ? $params[0]['_temp_id'] : $widget_id;
+ $hidden = isset( $params[0]['_hide'] ) ? ' style="display:none;"' : '';
+
+ $params[0]['before_widget'] = "<div id='widget-{$i}_{$id}' class='widget'$hidden>";
+ $params[0]['after_widget'] = '</div>';
+ $params[0]['before_title'] = '%BEG_OF_TITLE%'; // deprecated
+ $params[0]['after_title'] = '%END_OF_TITLE%'; // deprecated
+ if ( is_callable( $wp_registered_widgets[ $widget_id ]['callback'] ) ) {
+ $wp_registered_widgets[ $widget_id ]['_callback'] = $wp_registered_widgets[ $widget_id ]['callback'];
+ $wp_registered_widgets[ $widget_id ]['callback'] = 'wp_widget_control';
+ }
+
+ return $params;
+}
+
+/**
+ * @global array $wp_registered_widgets
+ *
+ * @param string $id_base
+ * @return int
+ */
+function next_widget_id_number( $id_base ) {
+ global $wp_registered_widgets;
+ $number = 1;
+
+ foreach ( $wp_registered_widgets as $widget_id => $widget ) {
+ if ( preg_match( '/' . $id_base . '-([0-9]+)$/', $widget_id, $matches ) ) {
+ $number = max( $number, $matches[1] );
+ }
+ }
+ $number++;
+
+ return $number;
+}
+
+/**
+ * Meta widget used to display the control form for a widget.
+ *
+ * Called from dynamic_sidebar().
+ *
+ * @since 2.5.0
+ *
+ * @global array $wp_registered_widgets
+ * @global array $wp_registered_widget_controls
+ * @global array $sidebars_widgets
+ *
+ * @param array $sidebar_args
+ * @return array
+ */
+function wp_widget_control( $sidebar_args ) {
+ global $wp_registered_widgets, $wp_registered_widget_controls, $sidebars_widgets;
+
+ $widget_id = $sidebar_args['widget_id'];
+ $sidebar_id = isset( $sidebar_args['id'] ) ? $sidebar_args['id'] : false;
+ $key = $sidebar_id ? array_search( $widget_id, $sidebars_widgets[ $sidebar_id ] ) : '-1'; // position of widget in sidebar
+ $control = isset( $wp_registered_widget_controls[ $widget_id ] ) ? $wp_registered_widget_controls[ $widget_id ] : array();
+ $widget = $wp_registered_widgets[ $widget_id ];
+
+ $id_format = $widget['id'];
+ $widget_number = isset( $control['params'][0]['number'] ) ? $control['params'][0]['number'] : '';
+ $id_base = isset( $control['id_base'] ) ? $control['id_base'] : $widget_id;
+ $width = isset( $control['width'] ) ? $control['width'] : '';
+ $height = isset( $control['height'] ) ? $control['height'] : '';
+ $multi_number = isset( $sidebar_args['_multi_num'] ) ? $sidebar_args['_multi_num'] : '';
+ $add_new = isset( $sidebar_args['_add'] ) ? $sidebar_args['_add'] : '';
+
+ $before_form = isset( $sidebar_args['before_form'] ) ? $sidebar_args['before_form'] : '<form method="post">';
+ $after_form = isset( $sidebar_args['after_form'] ) ? $sidebar_args['after_form'] : '</form>';
+ $before_widget_content = isset( $sidebar_args['before_widget_content'] ) ? $sidebar_args['before_widget_content'] : '<div class="widget-content">';
+ $after_widget_content = isset( $sidebar_args['after_widget_content'] ) ? $sidebar_args['after_widget_content'] : '</div>';
+
+ $query_arg = array( 'editwidget' => $widget['id'] );
+ if ( $add_new ) {
+ $query_arg['addnew'] = 1;
+ if ( $multi_number ) {
+ $query_arg['num'] = $multi_number;
+ $query_arg['base'] = $id_base;
+ }
+ } else {
+ $query_arg['sidebar'] = $sidebar_id;
+ $query_arg['key'] = $key;
+ }
+
+ /*
+ * We aren't showing a widget control, we're outputting a template
+ * for a multi-widget control.
+ */
+ if ( isset( $sidebar_args['_display'] ) && 'template' == $sidebar_args['_display'] && $widget_number ) {
+ // number == -1 implies a template where id numbers are replaced by a generic '__i__'
+ $control['params'][0]['number'] = -1;
+ // With id_base widget id's are constructed like {$id_base}-{$id_number}.
+ if ( isset( $control['id_base'] ) ) {
+ $id_format = $control['id_base'] . '-__i__';
+ }
+ }
+
+ $wp_registered_widgets[ $widget_id ]['callback'] = $wp_registered_widgets[ $widget_id ]['_callback'];
+ unset( $wp_registered_widgets[ $widget_id ]['_callback'] );
+
+ $widget_title = esc_html( strip_tags( $sidebar_args['widget_name'] ) );
+ $has_form = 'noform';
+
+ echo $sidebar_args['before_widget'];
+ ?>
+ <div class="widget-top">
+ <div class="widget-title-action">
+ <button type="button" class="widget-action hide-if-no-js" aria-expanded="false">
+ <span class="screen-reader-text edit"><?php printf( __( 'Edit widget: %s' ), $widget_title ); ?></span>
+ <span class="screen-reader-text add"><?php printf( __( 'Add widget: %s' ), $widget_title ); ?></span>
+ <span class="toggle-indicator" aria-hidden="true"></span>
+ </button>
+ <a class="widget-control-edit hide-if-js" href="<?php echo esc_url( add_query_arg( $query_arg ) ); ?>">
+ <span class="edit"><?php _ex( 'Edit', 'widget' ); ?></span>
+ <span class="add"><?php _ex( 'Add', 'widget' ); ?></span>
+ <span class="screen-reader-text"><?php echo $widget_title; ?></span>
+ </a>
+ </div>
+ <div class="widget-title"><h3><?php echo $widget_title; ?><span class="in-widget-title"></span></h3></div>
+ </div>
+
+ <div class="widget-inside">
+ <?php echo $before_form; ?>
+ <?php echo $before_widget_content; ?>
+ <?php
+ if ( isset( $control['callback'] ) ) {
+ $has_form = call_user_func_array( $control['callback'], $control['params'] );
+ } else {
+ echo "\t\t<p>" . __( 'There are no options for this widget.' ) . "</p>\n";
+ }
+
+ $noform_class = '';
+ if ( 'noform' === $has_form ) {
+ $noform_class = ' widget-control-noform';
+ }
+ ?>
+ <?php echo $after_widget_content; ?>
+ <input type="hidden" name="widget-id" class="widget-id" value="<?php echo esc_attr( $id_format ); ?>" />
+ <input type="hidden" name="id_base" class="id_base" value="<?php echo esc_attr( $id_base ); ?>" />
+ <input type="hidden" name="widget-width" class="widget-width" value="<?php echo esc_attr( $width ); ?>" />
+ <input type="hidden" name="widget-height" class="widget-height" value="<?php echo esc_attr( $height ); ?>" />
+ <input type="hidden" name="widget_number" class="widget_number" value="<?php echo esc_attr( $widget_number ); ?>" />
+ <input type="hidden" name="multi_number" class="multi_number" value="<?php echo esc_attr( $multi_number ); ?>" />
+ <input type="hidden" name="add_new" class="add_new" value="<?php echo esc_attr( $add_new ); ?>" />
+
+ <div class="widget-control-actions">
+ <div class="alignleft">
+ <button type="button" class="button-link button-link-delete widget-control-remove"><?php _e( 'Delete' ); ?></button>
+ <span class="widget-control-close-wrapper">
+ |
+ <button type="button" class="button-link widget-control-close"><?php _e( 'Done' ); ?></button>
+ </span>
+ </div>
+ <div class="alignright<?php echo $noform_class; ?>">
+ <?php submit_button( __( 'Save' ), 'primary widget-control-save right', 'savewidget', false, array( 'id' => 'widget-' . esc_attr( $id_format ) . '-savewidget' ) ); ?>
+ <span class="spinner"></span>
+ </div>
+ <br class="clear" />
+ </div>
+ <?php echo $after_form; ?>
+ </div>
+
+ <div class="widget-description">
+ <?php echo ( $widget_description = wp_widget_description( $widget_id ) ) ? "$widget_description\n" : "$widget_title\n"; ?>
+ </div>
+ <?php
+ echo $sidebar_args['after_widget'];
+
+ return $sidebar_args;
+}
+
+/**
+ * @param string $classes
+ * @return string
+ */
+function wp_widgets_access_body_class( $classes ) {
+ return "$classes widgets_access ";
+}
diff --git a/www/crm/wp-admin/index.php b/www/crm/wp-admin/index.php
new file mode 100644
index 00000000..61eb6968
--- /dev/null
+++ b/www/crm/wp-admin/index.php
@@ -0,0 +1,156 @@
+<?php
+/**
+ * Dashboard Administration Screen
+ *
+ * @package WordPress
+ * @subpackage Administration
+ */
+
+/** Load WordPress Bootstrap */
+require_once( dirname( __FILE__ ) . '/admin.php' );
+
+/** Load WordPress dashboard API */
+require_once( ABSPATH . 'wp-admin/includes/dashboard.php' );
+
+wp_dashboard_setup();
+
+wp_enqueue_script( 'dashboard' );
+
+if ( current_user_can( 'install_plugins' ) ) {
+ wp_enqueue_script( 'plugin-install' );
+ wp_enqueue_script( 'updates' );
+}
+if ( current_user_can( 'upload_files' ) ) {
+ wp_enqueue_script( 'media-upload' );
+}
+add_thickbox();
+
+if ( wp_is_mobile() ) {
+ wp_enqueue_script( 'jquery-touch-punch' );
+}
+
+$title = __( 'Dashboard' );
+$parent_file = 'index.php';
+
+$help = '<p>' . __( 'Welcome to your WordPress Dashboard! This is the screen you will see when you log in to your site, and gives you access to all the site management features of WordPress. You can get help for any screen by clicking the Help tab above the screen title.' ) . '</p>';
+
+$screen = get_current_screen();
+
+$screen->add_help_tab(
+ array(
+ 'id' => 'overview',
+ 'title' => __( 'Overview' ),
+ 'content' => $help,
+ )
+);
+
+// Help tabs
+
+$help = '<p>' . __( 'The left-hand navigation menu provides links to all of the WordPress administration screens, with submenu items displayed on hover. You can minimize this menu to a narrow icon strip by clicking on the Collapse Menu arrow at the bottom.' ) . '</p>';
+$help .= '<p>' . __( 'Links in the Toolbar at the top of the screen connect your dashboard and the front end of your site, and provide access to your profile and helpful WordPress information.' ) . '</p>';
+
+$screen->add_help_tab(
+ array(
+ 'id' => 'help-navigation',
+ 'title' => __( 'Navigation' ),
+ 'content' => $help,
+ )
+);
+
+$help = '<p>' . __( 'You can use the following controls to arrange your Dashboard screen to suit your workflow. This is true on most other administration screens as well.' ) . '</p>';
+$help .= '<p>' . __( '<strong>Screen Options</strong> &mdash; Use the Screen Options tab to choose which Dashboard boxes to show.' ) . '</p>';
+$help .= '<p>' . __( '<strong>Drag and Drop</strong> &mdash; To rearrange the boxes, drag and drop by clicking on the title bar of the selected box and releasing when you see a gray dotted-line rectangle appear in the location you want to place the box.' ) . '</p>';
+$help .= '<p>' . __( '<strong>Box Controls</strong> &mdash; Click the title bar of the box to expand or collapse it. Some boxes added by plugins may have configurable content, and will show a &#8220;Configure&#8221; link in the title bar if you hover over it.' ) . '</p>';
+
+$screen->add_help_tab(
+ array(
+ 'id' => 'help-layout',
+ 'title' => __( 'Layout' ),
+ 'content' => $help,
+ )
+);
+
+$help = '<p>' . __( 'The boxes on your Dashboard screen are:' ) . '</p>';
+
+if ( current_user_can( 'edit_posts' ) ) {
+ $help .= '<p>' . __( '<strong>At A Glance</strong> &mdash; Displays a summary of the content on your site and identifies which theme and version of WordPress you are using.' ) . '</p>';
+}
+
+$help .= '<p>' . __( '<strong>Activity</strong> &mdash; Shows the upcoming scheduled posts, recently published posts, and the most recent comments on your posts and allows you to moderate them.' ) . '</p>';
+
+if ( is_blog_admin() && current_user_can( 'edit_posts' ) ) {
+ $help .= '<p>' . __( "<strong>Quick Draft</strong> &mdash; Allows you to create a new post and save it as a draft. Also displays links to the 3 most recent draft posts you've started." ) . '</p>';
+}
+
+$help .= '<p>' . sprintf(
+ /* translators: %s: WordPress Planet URL */
+ __( '<strong>WordPress Events and News</strong> &mdash; Upcoming events near you as well as the latest news from the official WordPress project and the <a href="%s">WordPress Planet</a>.' ),
+ __( 'https://planet.wordpress.org/' )
+) . '</p>';
+
+if ( current_user_can( 'edit_theme_options' ) ) {
+ $help .= '<p>' . __( '<strong>Welcome</strong> &mdash; Shows links for some of the most common tasks when setting up a new site.' ) . '</p>';
+}
+
+$screen->add_help_tab(
+ array(
+ 'id' => 'help-content',
+ 'title' => __( 'Content' ),
+ 'content' => $help,
+ )
+);
+
+unset( $help );
+
+$screen->set_help_sidebar(
+ '<p><strong>' . __( 'For more information:' ) . '</strong></p>' .
+ '<p>' . __( '<a href="https://codex.wordpress.org/Dashboard_Screen">Documentation on Dashboard</a>' ) . '</p>' .
+ '<p>' . __( '<a href="https://wordpress.org/support/">Support</a>' ) . '</p>'
+);
+
+include( ABSPATH . 'wp-admin/admin-header.php' );
+?>
+
+<div class="wrap">
+ <h1><?php echo esc_html( $title ); ?></h1>
+
+<?php
+if ( has_action( 'welcome_panel' ) && current_user_can( 'edit_theme_options' ) ) :
+ $classes = 'welcome-panel';
+
+ $option = get_user_meta( get_current_user_id(), 'show_welcome_panel', true );
+ // 0 = hide, 1 = toggled to show or single site creator, 2 = multisite site owner
+ $hide = 0 == $option || ( 2 == $option && wp_get_current_user()->user_email != get_option( 'admin_email' ) );
+ if ( $hide ) {
+ $classes .= ' hidden';
+ }
+ ?>
+
+ <div id="welcome-panel" class="<?php echo esc_attr( $classes ); ?>">
+ <?php wp_nonce_field( 'welcome-panel-nonce', 'welcomepanelnonce', false ); ?>
+ <a class="welcome-panel-close" href="<?php echo esc_url( admin_url( '?welcome=0' ) ); ?>" aria-label="<?php esc_attr_e( 'Dismiss the welcome panel' ); ?>"><?php _e( 'Dismiss' ); ?></a>
+ <?php
+ /**
+ * Add content to the welcome panel on the admin dashboard.
+ *
+ * To remove the default welcome panel, use remove_action():
+ *
+ * remove_action( 'welcome_panel', 'wp_welcome_panel' );
+ *
+ * @since 3.5.0
+ */
+ do_action( 'welcome_panel' );
+ ?>
+ </div>
+<?php endif; ?>
+
+ <div id="dashboard-widgets-wrap">
+ <?php wp_dashboard(); ?>
+ </div><!-- dashboard-widgets-wrap -->
+
+</div><!-- wrap -->
+
+<?php
+wp_print_community_events_templates();
+
+require( ABSPATH . 'wp-admin/admin-footer.php' );
diff --git a/www/crm/wp-admin/install-helper.php b/www/crm/wp-admin/install-helper.php
new file mode 100644
index 00000000..c13f3027
--- /dev/null
+++ b/www/crm/wp-admin/install-helper.php
@@ -0,0 +1,200 @@
+<?php
+/**
+ * Plugins may load this file to gain access to special helper functions for
+ * plugin installation. This file is not included by WordPress and it is
+ * recommended, to prevent fatal errors, that this file is included using
+ * require_once().
+ *
+ * These functions are not optimized for speed, but they should only be used
+ * once in a while, so speed shouldn't be a concern. If it is and you are
+ * needing to use these functions a lot, you might experience time outs. If you
+ * do, then it is advised to just write the SQL code yourself.
+ *
+ * check_column( 'wp_links', 'link_description', 'mediumtext' );
+ * if ( check_column( $wpdb->comments, 'comment_author', 'tinytext' ) ) {
+ * echo "ok\n";
+ * }
+ *
+ * $error_count = 0;
+ * $tablename = $wpdb->links;
+ * // Check the column.
+ * if ( ! check_column($wpdb->links, 'link_description', 'varchar( 255 )' ) ) {
+ * $ddl = "ALTER TABLE $wpdb->links MODIFY COLUMN link_description varchar(255) NOT NULL DEFAULT '' ";
+ * $q = $wpdb->query( $ddl );
+ * }
+ *
+ * if ( check_column( $wpdb->links, 'link_description', 'varchar( 255 )' ) ) {
+ * $res .= $tablename . ' - ok <br />';
+ * } else {
+ * $res .= 'There was a problem with ' . $tablename . '<br />';
+ * ++$error_count;
+ * }
+ *
+ * @package WordPress
+ * @subpackage Plugin
+ */
+
+/** Load WordPress Bootstrap */
+require_once( dirname( dirname( __FILE__ ) ) . '/wp-load.php' );
+
+if ( ! function_exists( 'maybe_create_table' ) ) :
+ /**
+ * Create database table, if it doesn't already exist.
+ *
+ * @since 1.0.0
+ *
+ * @global wpdb $wpdb WordPress database abstraction object.
+ *
+ * @param string $table_name Database table name.
+ * @param string $create_ddl Create database table SQL.
+ * @return bool False on error, true if already exists or success.
+ */
+ function maybe_create_table( $table_name, $create_ddl ) {
+ global $wpdb;
+ foreach ( $wpdb->get_col( 'SHOW TABLES', 0 ) as $table ) {
+ if ( $table == $table_name ) {
+ return true;
+ }
+ }
+ // Didn't find it, so try to create it.
+ $wpdb->query( $create_ddl );
+
+ // We cannot directly tell that whether this succeeded!
+ foreach ( $wpdb->get_col( 'SHOW TABLES', 0 ) as $table ) {
+ if ( $table == $table_name ) {
+ return true;
+ }
+ }
+ return false;
+ }
+endif;
+
+if ( ! function_exists( 'maybe_add_column' ) ) :
+ /**
+ * Add column to database table, if column doesn't already exist in table.
+ *
+ * @since 1.0.0
+ *
+ * @global wpdb $wpdb WordPress database abstraction object.
+ *
+ * @param string $table_name Database table name
+ * @param string $column_name Table column name
+ * @param string $create_ddl SQL to add column to table.
+ * @return bool False on failure. True, if already exists or was successful.
+ */
+ function maybe_add_column( $table_name, $column_name, $create_ddl ) {
+ global $wpdb;
+ foreach ( $wpdb->get_col( "DESC $table_name", 0 ) as $column ) {
+
+ if ( $column == $column_name ) {
+ return true;
+ }
+ }
+
+ // Didn't find it, so try to create it.
+ $wpdb->query( $create_ddl );
+
+ // We cannot directly tell that whether this succeeded!
+ foreach ( $wpdb->get_col( "DESC $table_name", 0 ) as $column ) {
+ if ( $column == $column_name ) {
+ return true;
+ }
+ }
+ return false;
+ }
+endif;
+
+/**
+ * Drop column from database table, if it exists.
+ *
+ * @since 1.0.0
+ *
+ * @global wpdb $wpdb WordPress database abstraction object.
+ *
+ * @param string $table_name Table name
+ * @param string $column_name Column name
+ * @param string $drop_ddl SQL statement to drop column.
+ * @return bool False on failure, true on success or doesn't exist.
+ */
+function maybe_drop_column( $table_name, $column_name, $drop_ddl ) {
+ global $wpdb;
+ foreach ( $wpdb->get_col( "DESC $table_name", 0 ) as $column ) {
+ if ( $column == $column_name ) {
+
+ // Found it, so try to drop it.
+ $wpdb->query( $drop_ddl );
+
+ // We cannot directly tell that whether this succeeded!
+ foreach ( $wpdb->get_col( "DESC $table_name", 0 ) as $column ) {
+ if ( $column == $column_name ) {
+ return false;
+ }
+ }
+ }
+ }
+ // Else didn't find it.
+ return true;
+}
+
+/**
+ * Check column matches criteria.
+ *
+ * Uses the SQL DESC for retrieving the table info for the column. It will help
+ * understand the parameters, if you do more research on what column information
+ * is returned by the SQL statement. Pass in null to skip checking that
+ * criteria.
+ *
+ * Column names returned from DESC table are case sensitive and are listed:
+ * Field
+ * Type
+ * Null
+ * Key
+ * Default
+ * Extra
+ *
+ * @since 1.0.0
+ *
+ * @global wpdb $wpdb WordPress database abstraction object.
+ *
+ * @param string $table_name Table name
+ * @param string $col_name Column name
+ * @param string $col_type Column type
+ * @param bool $is_null Optional. Check is null.
+ * @param mixed $key Optional. Key info.
+ * @param mixed $default Optional. Default value.
+ * @param mixed $extra Optional. Extra value.
+ * @return bool True, if matches. False, if not matching.
+ */
+function check_column( $table_name, $col_name, $col_type, $is_null = null, $key = null, $default = null, $extra = null ) {
+ global $wpdb;
+ $diffs = 0;
+ $results = $wpdb->get_results( "DESC $table_name" );
+
+ foreach ( $results as $row ) {
+
+ if ( $row->Field == $col_name ) {
+
+ // Got our column, check the params.
+ if ( ( $col_type != null ) && ( $row->Type != $col_type ) ) {
+ ++$diffs;
+ }
+ if ( ( $is_null != null ) && ( $row->Null != $is_null ) ) {
+ ++$diffs;
+ }
+ if ( ( $key != null ) && ( $row->Key != $key ) ) {
+ ++$diffs;
+ }
+ if ( ( $default != null ) && ( $row->Default != $default ) ) {
+ ++$diffs;
+ }
+ if ( ( $extra != null ) && ( $row->Extra != $extra ) ) {
+ ++$diffs;
+ }
+ if ( $diffs > 0 ) {
+ return false;
+ }
+ return true;
+ } // end if found our column
+ }
+ return false;
+}
diff --git a/www/crm/wp-admin/install.php b/www/crm/wp-admin/install.php
new file mode 100644
index 00000000..bd7e0e79
--- /dev/null
+++ b/www/crm/wp-admin/install.php
@@ -0,0 +1,434 @@
+<?php
+/**
+ * WordPress Installer
+ *
+ * @package WordPress
+ * @subpackage Administration
+ */
+
+// Sanity check.
+if ( false ) {
+ ?>
+<!DOCTYPE html>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+ <title>Error: PHP is not running</title>
+</head>
+<body class="wp-core-ui">
+ <p id="logo"><a href="https://wordpress.org/">WordPress</a></p>
+ <h1>Error: PHP is not running</h1>
+ <p>WordPress requires that your web server is running PHP. Your server does not have PHP installed, or PHP is turned off.</p>
+</body>
+</html>
+ <?php
+}
+
+/**
+ * We are installing WordPress.
+ *
+ * @since 1.5.1
+ * @var bool
+ */
+define( 'WP_INSTALLING', true );
+
+/** Load WordPress Bootstrap */
+require_once( dirname( dirname( __FILE__ ) ) . '/wp-load.php' );
+
+/** Load WordPress Administration Upgrade API */
+require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
+
+/** Load WordPress Translation Install API */
+require_once( ABSPATH . 'wp-admin/includes/translation-install.php' );
+
+/** Load wpdb */
+require_once( ABSPATH . WPINC . '/wp-db.php' );
+
+nocache_headers();
+
+$step = isset( $_GET['step'] ) ? (int) $_GET['step'] : 0;
+
+/**
+ * Display installation header.
+ *
+ * @since 2.5.0
+ *
+ * @param string $body_classes
+ */
+function display_header( $body_classes = '' ) {
+ header( 'Content-Type: text/html; charset=utf-8' );
+ if ( is_rtl() ) {
+ $body_classes .= 'rtl';
+ }
+ if ( $body_classes ) {
+ $body_classes = ' ' . $body_classes;
+ }
+ ?>
+<!DOCTYPE html>
+<html xmlns="http://www.w3.org/1999/xhtml" <?php language_attributes(); ?>>
+<head>
+ <meta name="viewport" content="width=device-width" />
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+ <meta name="robots" content="noindex,nofollow" />
+ <title><?php _e( 'WordPress &rsaquo; Installation' ); ?></title>
+ <?php wp_admin_css( 'install', true ); ?>
+</head>
+<body class="wp-core-ui<?php echo $body_classes; ?>">
+<p id="logo"><a href="<?php echo esc_url( __( 'https://wordpress.org/' ) ); ?>"><?php _e( 'WordPress' ); ?></a></p>
+
+ <?php
+} // end display_header()
+
+/**
+ * Display installer setup form.
+ *
+ * @since 2.8.0
+ *
+ * @global wpdb $wpdb WordPress database abstraction object.
+ *
+ * @param string|null $error
+ */
+function display_setup_form( $error = null ) {
+ global $wpdb;
+
+ $sql = $wpdb->prepare( 'SHOW TABLES LIKE %s', $wpdb->esc_like( $wpdb->users ) );
+ $user_table = ( $wpdb->get_var( $sql ) != null );
+
+ // Ensure that Blogs appear in search engines by default.
+ $blog_public = 1;
+ if ( isset( $_POST['weblog_title'] ) ) {
+ $blog_public = isset( $_POST['blog_public'] );
+ }
+
+ $weblog_title = isset( $_POST['weblog_title'] ) ? trim( wp_unslash( $_POST['weblog_title'] ) ) : '';
+ $user_name = isset( $_POST['user_name'] ) ? trim( wp_unslash( $_POST['user_name'] ) ) : '';
+ $admin_email = isset( $_POST['admin_email'] ) ? trim( wp_unslash( $_POST['admin_email'] ) ) : '';
+
+ if ( ! is_null( $error ) ) {
+ ?>
+<h1><?php _ex( 'Welcome', 'Howdy' ); ?></h1>
+<p class="message"><?php echo $error; ?></p>
+<?php } ?>
+<form id="setup" method="post" action="install.php?step=2" novalidate="novalidate">
+ <table class="form-table" role="presentation">
+ <tr>
+ <th scope="row"><label for="weblog_title"><?php _e( 'Site Title' ); ?></label></th>
+ <td><input name="weblog_title" type="text" id="weblog_title" size="25" value="<?php echo esc_attr( $weblog_title ); ?>" /></td>
+ </tr>
+ <tr>
+ <th scope="row"><label for="user_login"><?php _e( 'Username' ); ?></label></th>
+ <td>
+ <?php
+ if ( $user_table ) {
+ _e( 'User(s) already exists.' );
+ echo '<input name="user_name" type="hidden" value="admin" />';
+ } else {
+ ?>
+ <input name="user_name" type="text" id="user_login" size="25" value="<?php echo esc_attr( sanitize_user( $user_name, true ) ); ?>" />
+ <p><?php _e( 'Usernames can have only alphanumeric characters, spaces, underscores, hyphens, periods, and the @ symbol.' ); ?></p>
+ <?php
+ }
+ ?>
+ </td>
+ </tr>
+ <?php if ( ! $user_table ) : ?>
+ <tr class="form-field form-required user-pass1-wrap">
+ <th scope="row">
+ <label for="pass1">
+ <?php _e( 'Password' ); ?>
+ </label>
+ </th>
+ <td>
+ <div class="wp-pwd">
+ <?php $initial_password = isset( $_POST['admin_password'] ) ? stripslashes( $_POST['admin_password'] ) : wp_generate_password( 18 ); ?>
+ <input type="password" name="admin_password" id="pass1" class="regular-text" autocomplete="off" data-reveal="1" data-pw="<?php echo esc_attr( $initial_password ); ?>" aria-describedby="pass-strength-result" />
+ <button type="button" class="button wp-hide-pw hide-if-no-js" data-start-masked="<?php echo (int) isset( $_POST['admin_password'] ); ?>" data-toggle="0" aria-label="<?php esc_attr_e( 'Hide password' ); ?>">
+ <span class="dashicons dashicons-hidden"></span>
+ <span class="text"><?php _e( 'Hide' ); ?></span>
+ </button>
+ <div id="pass-strength-result" aria-live="polite"></div>
+ </div>
+ <p><span class="description important hide-if-no-js">
+ <strong><?php _e( 'Important:' ); ?></strong>
+ <?php /* translators: The non-breaking space prevents 1Password from thinking the text "log in" should trigger a password save prompt. */ ?>
+ <?php _e( 'You will need this password to log&nbsp;in. Please store it in a secure location.' ); ?></span></p>
+ </td>
+ </tr>
+ <tr class="form-field form-required user-pass2-wrap hide-if-js">
+ <th scope="row">
+ <label for="pass2"><?php _e( 'Repeat Password' ); ?>
+ <span class="description"><?php _e( '(required)' ); ?></span>
+ </label>
+ </th>
+ <td>
+ <input name="admin_password2" type="password" id="pass2" autocomplete="off" />
+ </td>
+ </tr>
+ <tr class="pw-weak">
+ <th scope="row"><?php _e( 'Confirm Password' ); ?></th>
+ <td>
+ <label>
+ <input type="checkbox" name="pw_weak" class="pw-checkbox" />
+ <?php _e( 'Confirm use of weak password' ); ?>
+ </label>
+ </td>
+ </tr>
+ <?php endif; ?>
+ <tr>
+ <th scope="row"><label for="admin_email"><?php _e( 'Your Email' ); ?></label></th>
+ <td><input name="admin_email" type="email" id="admin_email" size="25" value="<?php echo esc_attr( $admin_email ); ?>" />
+ <p><?php _e( 'Double-check your email address before continuing.' ); ?></p></td>
+ </tr>
+ <tr>
+ <th scope="row"><?php has_action( 'blog_privacy_selector' ) ? _e( 'Site Visibility' ) : _e( 'Search Engine Visibility' ); ?></th>
+ <td>
+ <fieldset>
+ <legend class="screen-reader-text"><span><?php has_action( 'blog_privacy_selector' ) ? _e( 'Site Visibility' ) : _e( 'Search Engine Visibility' ); ?> </span></legend>
+ <?php
+ if ( has_action( 'blog_privacy_selector' ) ) {
+ ?>
+ <input id="blog-public" type="radio" name="blog_public" value="1" <?php checked( 1, $blog_public ); ?> />
+ <label for="blog-public"><?php _e( 'Allow search engines to index this site' ); ?></label><br/>
+ <input id="blog-norobots" type="radio" name="blog_public" value="0" <?php checked( 0, $blog_public ); ?> />
+ <label for="blog-norobots"><?php _e( 'Discourage search engines from indexing this site' ); ?></label>
+ <p class="description"><?php _e( 'Note: Neither of these options blocks access to your site &mdash; it is up to search engines to honor your request.' ); ?></p>
+ <?php
+ /** This action is documented in wp-admin/options-reading.php */
+ do_action( 'blog_privacy_selector' );
+ } else {
+ ?>
+ <label for="blog_public"><input name="blog_public" type="checkbox" id="blog_public" value="0" <?php checked( 0, $blog_public ); ?> />
+ <?php _e( 'Discourage search engines from indexing this site' ); ?></label>
+ <p class="description"><?php _e( 'It is up to search engines to honor this request.' ); ?></p>
+ <?php } ?>
+ </fieldset>
+ </td>
+ </tr>
+ </table>
+ <p class="step"><?php submit_button( __( 'Install WordPress' ), 'large', 'Submit', false, array( 'id' => 'submit' ) ); ?></p>
+ <input type="hidden" name="language" value="<?php echo isset( $_REQUEST['language'] ) ? esc_attr( $_REQUEST['language'] ) : ''; ?>" />
+</form>
+ <?php
+} // end display_setup_form()
+
+// Let's check to make sure WP isn't already installed.
+if ( is_blog_installed() ) {
+ display_header();
+ die(
+ '<h1>' . __( 'Already Installed' ) . '</h1>' .
+ '<p>' . __( 'You appear to have already installed WordPress. To reinstall please clear your old database tables first.' ) . '</p>' .
+ '<p class="step"><a href="' . esc_url( wp_login_url() ) . '" class="button button-large">' . __( 'Log In' ) . '</a></p>' .
+ '</body></html>'
+ );
+}
+
+/**
+ * @global string $wp_version
+ * @global string $required_php_version
+ * @global string $required_mysql_version
+ */
+global $wp_version, $required_php_version, $required_mysql_version;
+
+$php_version = phpversion();
+$mysql_version = $wpdb->db_version();
+$php_compat = version_compare( $php_version, $required_php_version, '>=' );
+$mysql_compat = version_compare( $mysql_version, $required_mysql_version, '>=' ) || file_exists( WP_CONTENT_DIR . '/db.php' );
+
+$version_url = sprintf(
+ /* translators: %s: WordPress version */
+ esc_url( __( 'https://wordpress.org/support/wordpress-version/version-%s/' ) ),
+ sanitize_title( $wp_version )
+);
+
+/* translators: %s: Update PHP page URL */
+$php_update_message = '</p><p>' . sprintf( __( '<a href="%s">Learn more about updating PHP</a>.' ), esc_url( wp_get_update_php_url() ) );
+
+$annotation = wp_get_update_php_annotation();
+if ( $annotation ) {
+ $php_update_message .= '</p><p><em>' . $annotation . '</em>';
+}
+
+if ( ! $mysql_compat && ! $php_compat ) {
+ /* translators: 1: URL to WordPress release notes, 2: WordPress version number, 3: Minimum required PHP version number, 4: Minimum required MySQL version number, 5: Current PHP version number, 6: Current MySQL version number */
+ $compat = sprintf( __( 'You cannot install because <a href="%1$s">WordPress %2$s</a> requires PHP version %3$s or higher and MySQL version %4$s or higher. You are running PHP version %5$s and MySQL version %6$s.' ), $version_url, $wp_version, $required_php_version, $required_mysql_version, $php_version, $mysql_version ) . $php_update_message;
+} elseif ( ! $php_compat ) {
+ /* translators: 1: URL to WordPress release notes, 2: WordPress version number, 3: Minimum required PHP version number, 4: Current PHP version number */
+ $compat = sprintf( __( 'You cannot install because <a href="%1$s">WordPress %2$s</a> requires PHP version %3$s or higher. You are running version %4$s.' ), $version_url, $wp_version, $required_php_version, $php_version ) . $php_update_message;
+} elseif ( ! $mysql_compat ) {
+ /* translators: 1: URL to WordPress release notes, 2: WordPress version number, 3: Minimum required MySQL version number, 4: Current MySQL version number */
+ $compat = sprintf( __( 'You cannot install because <a href="%1$s">WordPress %2$s</a> requires MySQL version %3$s or higher. You are running version %4$s.' ), $version_url, $wp_version, $required_mysql_version, $mysql_version );
+}
+
+if ( ! $mysql_compat || ! $php_compat ) {
+ display_header();
+ die( '<h1>' . __( 'Insufficient Requirements' ) . '</h1><p>' . $compat . '</p></body></html>' );
+}
+
+if ( ! is_string( $wpdb->base_prefix ) || '' === $wpdb->base_prefix ) {
+ display_header();
+ die(
+ '<h1>' . __( 'Configuration Error' ) . '</h1>' .
+ '<p>' . sprintf(
+ /* translators: %s: wp-config.php */
+ __( 'Your %s file has an empty database table prefix, which is not supported.' ),
+ '<code>wp-config.php</code>'
+ ) . '</p></body></html>'
+ );
+}
+
+// Set error message if DO_NOT_UPGRADE_GLOBAL_TABLES isn't set as it will break install.
+if ( defined( 'DO_NOT_UPGRADE_GLOBAL_TABLES' ) ) {
+ display_header();
+ die(
+ '<h1>' . __( 'Configuration Error' ) . '</h1>' .
+ '<p>' . sprintf(
+ /* translators: %s: DO_NOT_UPGRADE_GLOBAL_TABLES */
+ __( 'The constant %s cannot be defined when installing WordPress.' ),
+ '<code>DO_NOT_UPGRADE_GLOBAL_TABLES</code>'
+ ) . '</p></body></html>'
+ );
+}
+
+/**
+ * @global string $wp_local_package
+ * @global WP_Locale $wp_locale
+ */
+$language = '';
+if ( ! empty( $_REQUEST['language'] ) ) {
+ $language = preg_replace( '/[^a-zA-Z0-9_]/', '', $_REQUEST['language'] );
+} elseif ( isset( $GLOBALS['wp_local_package'] ) ) {
+ $language = $GLOBALS['wp_local_package'];
+}
+
+$scripts_to_print = array( 'jquery' );
+
+switch ( $step ) {
+ case 0: // Step 0
+ if ( wp_can_install_language_pack() && empty( $language ) && ( $languages = wp_get_available_translations() ) ) {
+ $scripts_to_print[] = 'language-chooser';
+ display_header( 'language-chooser' );
+ echo '<form id="setup" method="post" action="?step=1">';
+ wp_install_language_form( $languages );
+ echo '</form>';
+ break;
+ }
+
+ // Deliberately fall through if we can't reach the translations API.
+
+ case 1: // Step 1, direct link or from language chooser.
+ if ( ! empty( $language ) ) {
+ $loaded_language = wp_download_language_pack( $language );
+ if ( $loaded_language ) {
+ load_default_textdomain( $loaded_language );
+ $GLOBALS['wp_locale'] = new WP_Locale();
+ }
+ }
+
+ $scripts_to_print[] = 'user-profile';
+
+ display_header();
+ ?>
+<h1><?php _ex( 'Welcome', 'Howdy' ); ?></h1>
+<p><?php _e( 'Welcome to the famous five-minute WordPress installation process! Just fill in the information below and you&#8217;ll be on your way to using the most extendable and powerful personal publishing platform in the world.' ); ?></p>
+
+<h2><?php _e( 'Information needed' ); ?></h2>
+<p><?php _e( 'Please provide the following information. Don&#8217;t worry, you can always change these settings later.' ); ?></p>
+
+ <?php
+ display_setup_form();
+ break;
+ case 2:
+ if ( ! empty( $language ) && load_default_textdomain( $language ) ) {
+ $loaded_language = $language;
+ $GLOBALS['wp_locale'] = new WP_Locale();
+ } else {
+ $loaded_language = 'en_US';
+ }
+
+ if ( ! empty( $wpdb->error ) ) {
+ wp_die( $wpdb->error->get_error_message() );
+ }
+
+ $scripts_to_print[] = 'user-profile';
+
+ display_header();
+ // Fill in the data we gathered
+ $weblog_title = isset( $_POST['weblog_title'] ) ? trim( wp_unslash( $_POST['weblog_title'] ) ) : '';
+ $user_name = isset( $_POST['user_name'] ) ? trim( wp_unslash( $_POST['user_name'] ) ) : '';
+ $admin_password = isset( $_POST['admin_password'] ) ? wp_unslash( $_POST['admin_password'] ) : '';
+ $admin_password_check = isset( $_POST['admin_password2'] ) ? wp_unslash( $_POST['admin_password2'] ) : '';
+ $admin_email = isset( $_POST['admin_email'] ) ? trim( wp_unslash( $_POST['admin_email'] ) ) : '';
+ $public = isset( $_POST['blog_public'] ) ? (int) $_POST['blog_public'] : 1;
+
+ // Check email address.
+ $error = false;
+ if ( empty( $user_name ) ) {
+ // TODO: poka-yoke
+ display_setup_form( __( 'Please provide a valid username.' ) );
+ $error = true;
+ } elseif ( $user_name != sanitize_user( $user_name, true ) ) {
+ display_setup_form( __( 'The username you provided has invalid characters.' ) );
+ $error = true;
+ } elseif ( $admin_password != $admin_password_check ) {
+ // TODO: poka-yoke
+ display_setup_form( __( 'Your passwords do not match. Please try again.' ) );
+ $error = true;
+ } elseif ( empty( $admin_email ) ) {
+ // TODO: poka-yoke
+ display_setup_form( __( 'You must provide an email address.' ) );
+ $error = true;
+ } elseif ( ! is_email( $admin_email ) ) {
+ // TODO: poka-yoke
+ display_setup_form( __( 'Sorry, that isn&#8217;t a valid email address. Email addresses look like <code>username@example.com</code>.' ) );
+ $error = true;
+ }
+
+ if ( $error === false ) {
+ $wpdb->show_errors();
+ $result = wp_install( $weblog_title, $user_name, $admin_email, $public, '', wp_slash( $admin_password ), $loaded_language );
+ ?>
+
+<h1><?php _e( 'Success!' ); ?></h1>
+
+<p><?php _e( 'WordPress has been installed. Thank you, and enjoy!' ); ?></p>
+
+<table class="form-table install-success">
+ <tr>
+ <th><?php _e( 'Username' ); ?></th>
+ <td><?php echo esc_html( sanitize_user( $user_name, true ) ); ?></td>
+ </tr>
+ <tr>
+ <th><?php _e( 'Password' ); ?></th>
+ <td>
+ <?php
+ if ( ! empty( $result['password'] ) && empty( $admin_password_check ) ) :
+ ?>
+ <code><?php echo esc_html( $result['password'] ); ?></code><br />
+ <?php endif ?>
+ <p><?php echo $result['password_message']; ?></p>
+ </td>
+ </tr>
+</table>
+
+<p class="step"><a href="<?php echo esc_url( wp_login_url() ); ?>" class="button button-large"><?php _e( 'Log In' ); ?></a></p>
+
+ <?php
+ }
+ break;
+}
+
+if ( ! wp_is_mobile() ) {
+ ?>
+<script type="text/javascript">var t = document.getElementById('weblog_title'); if (t){ t.focus(); }</script>
+ <?php
+}
+
+wp_print_scripts( $scripts_to_print );
+?>
+<script type="text/javascript">
+jQuery( function( $ ) {
+ $( '.hide-if-no-js' ).removeClass( 'hide-if-no-js' );
+} );
+</script>
+</body>
+</html>
diff --git a/www/crm/wp-admin/js/accordion.js b/www/crm/wp-admin/js/accordion.js
new file mode 100644
index 00000000..0bec1ce5
--- /dev/null
+++ b/www/crm/wp-admin/js/accordion.js
@@ -0,0 +1,94 @@
+/**
+ * Accordion-folding functionality.
+ *
+ * Markup with the appropriate classes will be automatically hidden,
+ * with one section opening at a time when its title is clicked.
+ * Use the following markup structure for accordion behavior:
+ *
+ * <div class="accordion-container">
+ * <div class="accordion-section open">
+ * <h3 class="accordion-section-title"></h3>
+ * <div class="accordion-section-content">
+ * </div>
+ * </div>
+ * <div class="accordion-section">
+ * <h3 class="accordion-section-title"></h3>
+ * <div class="accordion-section-content">
+ * </div>
+ * </div>
+ * <div class="accordion-section">
+ * <h3 class="accordion-section-title"></h3>
+ * <div class="accordion-section-content">
+ * </div>
+ * </div>
+ * </div>
+ *
+ * Note that any appropriate tags may be used, as long as the above classes are present.
+ *
+ * @since 3.6.0
+ * @output wp-admin/js/accordion.js
+ */
+
+( function( $ ){
+
+ $( document ).ready( function () {
+
+ // Expand/Collapse accordion sections on click.
+ $( '.accordion-container' ).on( 'click keydown', '.accordion-section-title', function( e ) {
+ if ( e.type === 'keydown' && 13 !== e.which ) { // "return" key
+ return;
+ }
+
+ e.preventDefault(); // Keep this AFTER the key filter above
+
+ accordionSwitch( $( this ) );
+ });
+
+ });
+
+ /**
+ * Close the current accordion section and open a new one.
+ *
+ * @param {Object} el Title element of the accordion section to toggle.
+ * @since 3.6.0
+ */
+ function accordionSwitch ( el ) {
+ var section = el.closest( '.accordion-section' ),
+ sectionToggleControl = section.find( '[aria-expanded]' ).first(),
+ container = section.closest( '.accordion-container' ),
+ siblings = container.find( '.open' ),
+ siblingsToggleControl = siblings.find( '[aria-expanded]' ).first(),
+ content = section.find( '.accordion-section-content' );
+
+ // This section has no content and cannot be expanded.
+ if ( section.hasClass( 'cannot-expand' ) ) {
+ return;
+ }
+
+ // Add a class to the container to let us know something is happening inside.
+ // This helps in cases such as hiding a scrollbar while animations are executing.
+ container.addClass( 'opening' );
+
+ if ( section.hasClass( 'open' ) ) {
+ section.toggleClass( 'open' );
+ content.toggle( true ).slideToggle( 150 );
+ } else {
+ siblingsToggleControl.attr( 'aria-expanded', 'false' );
+ siblings.removeClass( 'open' );
+ siblings.find( '.accordion-section-content' ).show().slideUp( 150 );
+ content.toggle( false ).slideToggle( 150 );
+ section.toggleClass( 'open' );
+ }
+
+ // We have to wait for the animations to finish
+ setTimeout(function(){
+ container.removeClass( 'opening' );
+ }, 150);
+
+ // If there's an element with an aria-expanded attribute, assume it's a toggle control and toggle the aria-expanded value.
+ if ( sectionToggleControl ) {
+ sectionToggleControl.attr( 'aria-expanded', String( sectionToggleControl.attr( 'aria-expanded' ) === 'false' ) );
+ }
+ }
+
+})(jQuery);
diff --git a/www/crm/wp-admin/js/accordion.min.js b/www/crm/wp-admin/js/accordion.min.js
new file mode 100644
index 00000000..6f22cd61
--- /dev/null
+++ b/www/crm/wp-admin/js/accordion.min.js
@@ -0,0 +1 @@
+!function(a){function b(a){var b=a.closest(".accordion-section"),c=b.find("[aria-expanded]").first(),d=b.closest(".accordion-container"),e=d.find(".open"),f=e.find("[aria-expanded]").first(),g=b.find(".accordion-section-content");b.hasClass("cannot-expand")||(d.addClass("opening"),b.hasClass("open")?(b.toggleClass("open"),g.toggle(!0).slideToggle(150)):(f.attr("aria-expanded","false"),e.removeClass("open"),e.find(".accordion-section-content").show().slideUp(150),g.toggle(!1).slideToggle(150),b.toggleClass("open")),setTimeout(function(){d.removeClass("opening")},150),c&&c.attr("aria-expanded",String("false"===c.attr("aria-expanded"))))}a(document).ready(function(){a(".accordion-container").on("click keydown",".accordion-section-title",function(c){"keydown"===c.type&&13!==c.which||(c.preventDefault(),b(a(this)))})})}(jQuery); \ No newline at end of file
diff --git a/www/crm/wp-admin/js/code-editor.js b/www/crm/wp-admin/js/code-editor.js
new file mode 100644
index 00000000..ea04cea2
--- /dev/null
+++ b/www/crm/wp-admin/js/code-editor.js
@@ -0,0 +1,342 @@
+/**
+ * @output wp-admin/js/code-editor.js
+ */
+
+if ( 'undefined' === typeof window.wp ) {
+ /**
+ * @namespace wp
+ */
+ window.wp = {};
+}
+if ( 'undefined' === typeof window.wp.codeEditor ) {
+ /**
+ * @namespace wp.codeEditor
+ */
+ window.wp.codeEditor = {};
+}
+
+( function( $, wp ) {
+ 'use strict';
+
+ /**
+ * Default settings for code editor.
+ *
+ * @since 4.9.0
+ * @type {object}
+ */
+ wp.codeEditor.defaultSettings = {
+ codemirror: {},
+ csslint: {},
+ htmlhint: {},
+ jshint: {},
+ onTabNext: function() {},
+ onTabPrevious: function() {},
+ onChangeLintingErrors: function() {},
+ onUpdateErrorNotice: function() {}
+ };
+
+ /**
+ * Configure linting.
+ *
+ * @param {CodeMirror} editor - Editor.
+ * @param {object} settings - Code editor settings.
+ * @param {object} settings.codeMirror - Settings for CodeMirror.
+ * @param {Function} settings.onChangeLintingErrors - Callback for when there are changes to linting errors.
+ * @param {Function} settings.onUpdateErrorNotice - Callback to update error notice.
+ *
+ * @returns {void}
+ */
+ function configureLinting( editor, settings ) { // eslint-disable-line complexity
+ var currentErrorAnnotations = [], previouslyShownErrorAnnotations = [];
+
+ /**
+ * Call the onUpdateErrorNotice if there are new errors to show.
+ *
+ * @returns {void}
+ */
+ function updateErrorNotice() {
+ if ( settings.onUpdateErrorNotice && ! _.isEqual( currentErrorAnnotations, previouslyShownErrorAnnotations ) ) {
+ settings.onUpdateErrorNotice( currentErrorAnnotations, editor );
+ previouslyShownErrorAnnotations = currentErrorAnnotations;
+ }
+ }
+
+ /**
+ * Get lint options.
+ *
+ * @returns {object} Lint options.
+ */
+ function getLintOptions() { // eslint-disable-line complexity
+ var options = editor.getOption( 'lint' );
+
+ if ( ! options ) {
+ return false;
+ }
+
+ if ( true === options ) {
+ options = {};
+ } else if ( _.isObject( options ) ) {
+ options = $.extend( {}, options );
+ }
+
+ // Note that rules must be sent in the "deprecated" lint.options property to prevent linter from complaining about unrecognized options. See <https://github.com/codemirror/CodeMirror/pull/4944>.
+ if ( ! options.options ) {
+ options.options = {};
+ }
+
+ // Configure JSHint.
+ if ( 'javascript' === settings.codemirror.mode && settings.jshint ) {
+ $.extend( options.options, settings.jshint );
+ }
+
+ // Configure CSSLint.
+ if ( 'css' === settings.codemirror.mode && settings.csslint ) {
+ $.extend( options.options, settings.csslint );
+ }
+
+ // Configure HTMLHint.
+ if ( 'htmlmixed' === settings.codemirror.mode && settings.htmlhint ) {
+ options.options.rules = $.extend( {}, settings.htmlhint );
+
+ if ( settings.jshint ) {
+ options.options.rules.jshint = settings.jshint;
+ }
+ if ( settings.csslint ) {
+ options.options.rules.csslint = settings.csslint;
+ }
+ }
+
+ // Wrap the onUpdateLinting CodeMirror event to route to onChangeLintingErrors and onUpdateErrorNotice.
+ options.onUpdateLinting = (function( onUpdateLintingOverridden ) {
+ return function( annotations, annotationsSorted, cm ) {
+ var errorAnnotations = _.filter( annotations, function( annotation ) {
+ return 'error' === annotation.severity;
+ } );
+
+ if ( onUpdateLintingOverridden ) {
+ onUpdateLintingOverridden.apply( annotations, annotationsSorted, cm );
+ }
+
+ // Skip if there are no changes to the errors.
+ if ( _.isEqual( errorAnnotations, currentErrorAnnotations ) ) {
+ return;
+ }
+
+ currentErrorAnnotations = errorAnnotations;
+
+ if ( settings.onChangeLintingErrors ) {
+ settings.onChangeLintingErrors( errorAnnotations, annotations, annotationsSorted, cm );
+ }
+
+ /*
+ * Update notifications when the editor is not focused to prevent error message
+ * from overwhelming the user during input, unless there are now no errors or there
+ * were previously errors shown. In these cases, update immediately so they can know
+ * that they fixed the errors.
+ */
+ if ( ! editor.state.focused || 0 === currentErrorAnnotations.length || previouslyShownErrorAnnotations.length > 0 ) {
+ updateErrorNotice();
+ }
+ };
+ })( options.onUpdateLinting );
+
+ return options;
+ }
+
+ editor.setOption( 'lint', getLintOptions() );
+
+ // Keep lint options populated.
+ editor.on( 'optionChange', function( cm, option ) {
+ var options, gutters, gutterName = 'CodeMirror-lint-markers';
+ if ( 'lint' !== option ) {
+ return;
+ }
+ gutters = editor.getOption( 'gutters' ) || [];
+ options = editor.getOption( 'lint' );
+ if ( true === options ) {
+ if ( ! _.contains( gutters, gutterName ) ) {
+ editor.setOption( 'gutters', [ gutterName ].concat( gutters ) );
+ }
+ editor.setOption( 'lint', getLintOptions() ); // Expand to include linting options.
+ } else if ( ! options ) {
+ editor.setOption( 'gutters', _.without( gutters, gutterName ) );
+ }
+
+ // Force update on error notice to show or hide.
+ if ( editor.getOption( 'lint' ) ) {
+ editor.performLint();
+ } else {
+ currentErrorAnnotations = [];
+ updateErrorNotice();
+ }
+ } );
+
+ // Update error notice when leaving the editor.
+ editor.on( 'blur', updateErrorNotice );
+
+ // Work around hint selection with mouse causing focus to leave editor.
+ editor.on( 'startCompletion', function() {
+ editor.off( 'blur', updateErrorNotice );
+ } );
+ editor.on( 'endCompletion', function() {
+ var editorRefocusWait = 500;
+ editor.on( 'blur', updateErrorNotice );
+
+ // Wait for editor to possibly get re-focused after selection.
+ _.delay( function() {
+ if ( ! editor.state.focused ) {
+ updateErrorNotice();
+ }
+ }, editorRefocusWait );
+ });
+
+ /*
+ * Make sure setting validities are set if the user tries to click Publish
+ * while an autocomplete dropdown is still open. The Customizer will block
+ * saving when a setting has an error notifications on it. This is only
+ * necessary for mouse interactions because keyboards will have already
+ * blurred the field and cause onUpdateErrorNotice to have already been
+ * called.
+ */
+ $( document.body ).on( 'mousedown', function( event ) {
+ if ( editor.state.focused && ! $.contains( editor.display.wrapper, event.target ) && ! $( event.target ).hasClass( 'CodeMirror-hint' ) ) {
+ updateErrorNotice();
+ }
+ });
+ }
+
+ /**
+ * Configure tabbing.
+ *
+ * @param {CodeMirror} codemirror - Editor.
+ * @param {object} settings - Code editor settings.
+ * @param {object} settings.codeMirror - Settings for CodeMirror.
+ * @param {Function} settings.onTabNext - Callback to handle tabbing to the next tabbable element.
+ * @param {Function} settings.onTabPrevious - Callback to handle tabbing to the previous tabbable element.
+ *
+ * @returns {void}
+ */
+ function configureTabbing( codemirror, settings ) {
+ var $textarea = $( codemirror.getTextArea() );
+
+ codemirror.on( 'blur', function() {
+ $textarea.data( 'next-tab-blurs', false );
+ });
+ codemirror.on( 'keydown', function onKeydown( editor, event ) {
+ var tabKeyCode = 9, escKeyCode = 27;
+
+ // Take note of the ESC keypress so that the next TAB can focus outside the editor.
+ if ( escKeyCode === event.keyCode ) {
+ $textarea.data( 'next-tab-blurs', true );
+ return;
+ }
+
+ // Short-circuit if tab key is not being pressed or the tab key press should move focus.
+ if ( tabKeyCode !== event.keyCode || ! $textarea.data( 'next-tab-blurs' ) ) {
+ return;
+ }
+
+ // Focus on previous or next focusable item.
+ if ( event.shiftKey ) {
+ settings.onTabPrevious( codemirror, event );
+ } else {
+ settings.onTabNext( codemirror, event );
+ }
+
+ // Reset tab state.
+ $textarea.data( 'next-tab-blurs', false );
+
+ // Prevent tab character from being added.
+ event.preventDefault();
+ });
+ }
+
+ /**
+ * @typedef {object} wp.codeEditor~CodeEditorInstance
+ * @property {object} settings - The code editor settings.
+ * @property {CodeMirror} codemirror - The CodeMirror instance.
+ */
+
+ /**
+ * Initialize Code Editor (CodeMirror) for an existing textarea.
+ *
+ * @since 4.9.0
+ *
+ * @param {string|jQuery|Element} textarea - The HTML id, jQuery object, or DOM Element for the textarea that is used for the editor.
+ * @param {object} [settings] - Settings to override defaults.
+ * @param {Function} [settings.onChangeLintingErrors] - Callback for when the linting errors have changed.
+ * @param {Function} [settings.onUpdateErrorNotice] - Callback for when error notice should be displayed.
+ * @param {Function} [settings.onTabPrevious] - Callback to handle tabbing to the previous tabbable element.
+ * @param {Function} [settings.onTabNext] - Callback to handle tabbing to the next tabbable element.
+ * @param {object} [settings.codemirror] - Options for CodeMirror.
+ * @param {object} [settings.csslint] - Rules for CSSLint.
+ * @param {object} [settings.htmlhint] - Rules for HTMLHint.
+ * @param {object} [settings.jshint] - Rules for JSHint.
+ *
+ * @returns {CodeEditorInstance} Instance.
+ */
+ wp.codeEditor.initialize = function initialize( textarea, settings ) {
+ var $textarea, codemirror, instanceSettings, instance;
+ if ( 'string' === typeof textarea ) {
+ $textarea = $( '#' + textarea );
+ } else {
+ $textarea = $( textarea );
+ }
+
+ instanceSettings = $.extend( {}, wp.codeEditor.defaultSettings, settings );
+ instanceSettings.codemirror = $.extend( {}, instanceSettings.codemirror );
+
+ codemirror = wp.CodeMirror.fromTextArea( $textarea[0], instanceSettings.codemirror );
+
+ configureLinting( codemirror, instanceSettings );
+
+ instance = {
+ settings: instanceSettings,
+ codemirror: codemirror
+ };
+
+ if ( codemirror.showHint ) {
+ codemirror.on( 'keyup', function( editor, event ) { // eslint-disable-line complexity
+ var shouldAutocomplete, isAlphaKey = /^[a-zA-Z]$/.test( event.key ), lineBeforeCursor, innerMode, token;
+ if ( codemirror.state.completionActive && isAlphaKey ) {
+ return;
+ }
+
+ // Prevent autocompletion in string literals or comments.
+ token = codemirror.getTokenAt( codemirror.getCursor() );
+ if ( 'string' === token.type || 'comment' === token.type ) {
+ return;
+ }
+
+ innerMode = wp.CodeMirror.innerMode( codemirror.getMode(), token.state ).mode.name;
+ lineBeforeCursor = codemirror.doc.getLine( codemirror.doc.getCursor().line ).substr( 0, codemirror.doc.getCursor().ch );
+ if ( 'html' === innerMode || 'xml' === innerMode ) {
+ shouldAutocomplete =
+ '<' === event.key ||
+ '/' === event.key && 'tag' === token.type ||
+ isAlphaKey && 'tag' === token.type ||
+ isAlphaKey && 'attribute' === token.type ||
+ '=' === token.string && token.state.htmlState && token.state.htmlState.tagName;
+ } else if ( 'css' === innerMode ) {
+ shouldAutocomplete =
+ isAlphaKey ||
+ ':' === event.key ||
+ ' ' === event.key && /:\s+$/.test( lineBeforeCursor );
+ } else if ( 'javascript' === innerMode ) {
+ shouldAutocomplete = isAlphaKey || '.' === event.key;
+ } else if ( 'clike' === innerMode && 'application/x-httpd-php' === codemirror.options.mode ) {
+ shouldAutocomplete = 'keyword' === token.type || 'variable' === token.type;
+ }
+ if ( shouldAutocomplete ) {
+ codemirror.showHint( { completeSingle: false } );
+ }
+ });
+ }
+
+ // Facilitate tabbing out of the editor.
+ configureTabbing( codemirror, settings );
+
+ return instance;
+ };
+
+})( window.jQuery, window.wp );
diff --git a/www/crm/wp-admin/js/code-editor.min.js b/www/crm/wp-admin/js/code-editor.min.js
new file mode 100644
index 00000000..c677ae23
--- /dev/null
+++ b/www/crm/wp-admin/js/code-editor.min.js
@@ -0,0 +1 @@
+"undefined"==typeof window.wp&&(window.wp={}),"undefined"==typeof window.wp.codeEditor&&(window.wp.codeEditor={}),function(a,b){"use strict";function c(b,c){function d(){c.onUpdateErrorNotice&&!_.isEqual(f,g)&&(c.onUpdateErrorNotice(f,b),g=f)}function e(){var e=b.getOption("lint");return!!e&&(!0===e?e={}:_.isObject(e)&&(e=a.extend({},e)),e.options||(e.options={}),"javascript"===c.codemirror.mode&&c.jshint&&a.extend(e.options,c.jshint),"css"===c.codemirror.mode&&c.csslint&&a.extend(e.options,c.csslint),"htmlmixed"===c.codemirror.mode&&c.htmlhint&&(e.options.rules=a.extend({},c.htmlhint),c.jshint&&(e.options.rules.jshint=c.jshint),c.csslint&&(e.options.rules.csslint=c.csslint)),e.onUpdateLinting=function(a){return function(e,h,i){var j=_.filter(e,function(a){return"error"===a.severity});a&&a.apply(e,h,i),_.isEqual(j,f)||(f=j,c.onChangeLintingErrors&&c.onChangeLintingErrors(j,e,h,i),(!b.state.focused||0===f.length||g.length>0)&&d())}}(e.onUpdateLinting),e)}var f=[],g=[];b.setOption("lint",e()),b.on("optionChange",function(a,c){var g,h,i="CodeMirror-lint-markers";"lint"===c&&(h=b.getOption("gutters")||[],g=b.getOption("lint"),!0===g?(_.contains(h,i)||b.setOption("gutters",[i].concat(h)),b.setOption("lint",e())):g||b.setOption("gutters",_.without(h,i)),b.getOption("lint")?b.performLint():(f=[],d()))}),b.on("blur",d),b.on("startCompletion",function(){b.off("blur",d)}),b.on("endCompletion",function(){var a=500;b.on("blur",d),_.delay(function(){b.state.focused||d()},a)}),a(document.body).on("mousedown",function(c){!b.state.focused||a.contains(b.display.wrapper,c.target)||a(c.target).hasClass("CodeMirror-hint")||d()})}function d(b,c){var d=a(b.getTextArea());b.on("blur",function(){d.data("next-tab-blurs",!1)}),b.on("keydown",function(a,e){var f=9,g=27;return g===e.keyCode?void d.data("next-tab-blurs",!0):void(f===e.keyCode&&d.data("next-tab-blurs")&&(e.shiftKey?c.onTabPrevious(b,e):c.onTabNext(b,e),d.data("next-tab-blurs",!1),e.preventDefault()))})}b.codeEditor.defaultSettings={codemirror:{},csslint:{},htmlhint:{},jshint:{},onTabNext:function(){},onTabPrevious:function(){},onChangeLintingErrors:function(){},onUpdateErrorNotice:function(){}},b.codeEditor.initialize=function(e,f){var g,h,i,j;return g=a("string"==typeof e?"#"+e:e),i=a.extend({},b.codeEditor.defaultSettings,f),i.codemirror=a.extend({},i.codemirror),h=b.CodeMirror.fromTextArea(g[0],i.codemirror),c(h,i),j={settings:i,codemirror:h},h.showHint&&h.on("keyup",function(a,c){var d,e,f,g,i=/^[a-zA-Z]$/.test(c.key);h.state.completionActive&&i||(g=h.getTokenAt(h.getCursor()),"string"!==g.type&&"comment"!==g.type&&(f=b.CodeMirror.innerMode(h.getMode(),g.state).mode.name,e=h.doc.getLine(h.doc.getCursor().line).substr(0,h.doc.getCursor().ch),"html"===f||"xml"===f?d="<"===c.key||"/"===c.key&&"tag"===g.type||i&&"tag"===g.type||i&&"attribute"===g.type||"="===g.string&&g.state.htmlState&&g.state.htmlState.tagName:"css"===f?d=i||":"===c.key||" "===c.key&&/:\s+$/.test(e):"javascript"===f?d=i||"."===c.key:"clike"===f&&"application/x-httpd-php"===h.options.mode&&(d="keyword"===g.type||"variable"===g.type),d&&h.showHint({completeSingle:!1})))}),d(h,f),j}}(window.jQuery,window.wp); \ No newline at end of file
diff --git a/www/crm/wp-admin/js/color-picker.js b/www/crm/wp-admin/js/color-picker.js
new file mode 100644
index 00000000..89e6db04
--- /dev/null
+++ b/www/crm/wp-admin/js/color-picker.js
@@ -0,0 +1,359 @@
+/**
+ * @output wp-admin/js/color-picker.js
+ */
+
+/* global wpColorPickerL10n */
+( function( $, undef ) {
+
+ var ColorPicker,
+ _before = '<button type="button" class="button wp-color-result" aria-expanded="false"><span class="wp-color-result-text"></span></button>',
+ _after = '<div class="wp-picker-holder" />',
+ _wrap = '<div class="wp-picker-container" />',
+ _button = '<input type="button" class="button button-small" />',
+ _wrappingLabel = '<label></label>',
+ _wrappingLabelText = '<span class="screen-reader-text"></span>';
+
+ /**
+ * Creates a jQuery UI color picker that is used in the theme customizer.
+ *
+ * @class $.widget.wp.wpColorPicker
+ *
+ * @since 3.5.0
+ */
+ ColorPicker = /** @lends $.widget.wp.wpColorPicker.prototype */{
+ options: {
+ defaultColor: false,
+ change: false,
+ clear: false,
+ hide: true,
+ palettes: true,
+ width: 255,
+ mode: 'hsv',
+ type: 'full',
+ slider: 'horizontal'
+ },
+ /**
+ * Creates a color picker that only allows you to adjust the hue.
+ *
+ * @since 3.5.0
+ *
+ * @access private
+ *
+ * @returns {void}
+ */
+ _createHueOnly: function() {
+ var self = this,
+ el = self.element,
+ color;
+
+ el.hide();
+
+ // Set the saturation to the maximum level.
+ color = 'hsl(' + el.val() + ', 100, 50)';
+
+ // Create an instance of the color picker, using the hsl mode.
+ el.iris( {
+ mode: 'hsl',
+ type: 'hue',
+ hide: false,
+ color: color,
+ /**
+ * Handles the onChange event if one has been defined in the options.
+ *
+ * @ignore
+ *
+ * @param {Event} event The event that's being called.
+ * @param {HTMLElement} ui The HTMLElement containing the color picker.
+ *
+ * @returns {void}
+ */
+ change: function( event, ui ) {
+ if ( $.isFunction( self.options.change ) ) {
+ self.options.change.call( this, event, ui );
+ }
+ },
+ width: self.options.width,
+ slider: self.options.slider
+ } );
+ },
+ /**
+ * Creates the color picker, sets default values, css classes and wraps it all in HTML.
+ *
+ * @since 3.5.0
+ *
+ * @access private
+ *
+ * @returns {void}
+ */
+ _create: function() {
+ // Return early if Iris support is missing.
+ if ( ! $.support.iris ) {
+ return;
+ }
+
+ var self = this,
+ el = self.element;
+
+ // Override default options with options bound to the element.
+ $.extend( self.options, el.data() );
+
+ // Create a color picker which only allows adjustments to the hue.
+ if ( self.options.type === 'hue' ) {
+ return self._createHueOnly();
+ }
+
+ // Bind the close event.
+ self.close = $.proxy( self.close, self );
+
+ self.initialValue = el.val();
+
+ // Add a CSS class to the input field.
+ el.addClass( 'wp-color-picker' );
+
+ /*
+ * Check if there's already a wrapping label, e.g. in the Customizer.
+ * If there's no label, add a default one to match the Customizer template.
+ */
+ if ( ! el.parent( 'label' ).length ) {
+ // Wrap the input field in the default label.
+ el.wrap( _wrappingLabel );
+ // Insert the default label text.
+ self.wrappingLabelText = $( _wrappingLabelText )
+ .insertBefore( el )
+ .text( wpColorPickerL10n.defaultLabel );
+ }
+
+ /*
+ * At this point, either it's the standalone version or the Customizer
+ * one, we have a wrapping label to use as hook in the DOM, let's store it.
+ */
+ self.wrappingLabel = el.parent();
+
+ // Wrap the label in the main wrapper.
+ self.wrappingLabel.wrap( _wrap );
+ // Store a reference to the main wrapper.
+ self.wrap = self.wrappingLabel.parent();
+ // Set up the toggle button and insert it before the wrapping label.
+ self.toggler = $( _before )
+ .insertBefore( self.wrappingLabel )
+ .css( { backgroundColor: self.initialValue } );
+ // Set the toggle button span element text.
+ self.toggler.find( '.wp-color-result-text' ).text( wpColorPickerL10n.pick );
+ // Set up the Iris container and insert it after the wrapping label.
+ self.pickerContainer = $( _after ).insertAfter( self.wrappingLabel );
+ // Store a reference to the Clear/Default button.
+ self.button = $( _button );
+
+ // Set up the Clear/Default button.
+ if ( self.options.defaultColor ) {
+ self.button
+ .addClass( 'wp-picker-default' )
+ .val( wpColorPickerL10n.defaultString )
+ .attr( 'aria-label', wpColorPickerL10n.defaultAriaLabel );
+ } else {
+ self.button
+ .addClass( 'wp-picker-clear' )
+ .val( wpColorPickerL10n.clear )
+ .attr( 'aria-label', wpColorPickerL10n.clearAriaLabel );
+ }
+
+ // Wrap the wrapping label in its wrapper and append the Clear/Default button.
+ self.wrappingLabel
+ .wrap( '<span class="wp-picker-input-wrap hidden" />' )
+ .after( self.button );
+
+ /*
+ * The input wrapper now contains the label+input+Clear/Default button.
+ * Store a reference to the input wrapper: we'll use this to toggle
+ * the controls visibility.
+ */
+ self.inputWrapper = el.closest( '.wp-picker-input-wrap' );
+
+ el.iris( {
+ target: self.pickerContainer,
+ hide: self.options.hide,
+ width: self.options.width,
+ mode: self.options.mode,
+ palettes: self.options.palettes,
+ /**
+ * Handles the onChange event if one has been defined in the options and additionally
+ * sets the background color for the toggler element.
+ *
+ * @since 3.5.0
+ *
+ * @ignore
+ *
+ * @param {Event} event The event that's being called.
+ * @param {HTMLElement} ui The HTMLElement containing the color picker.
+ *
+ * @returns {void}
+ */
+ change: function( event, ui ) {
+ self.toggler.css( { backgroundColor: ui.color.toString() } );
+
+ if ( $.isFunction( self.options.change ) ) {
+ self.options.change.call( this, event, ui );
+ }
+ }
+ } );
+
+ el.val( self.initialValue );
+ self._addListeners();
+
+ // Force the color picker to always be closed on initial load.
+ if ( ! self.options.hide ) {
+ self.toggler.click();
+ }
+ },
+ /**
+ * Binds event listeners to the color picker.
+ *
+ * @since 3.5.0
+ *
+ * @access private
+ *
+ * @returns {void}
+ */
+ _addListeners: function() {
+ var self = this;
+
+ /**
+ * Prevent any clicks inside this widget from leaking to the top and closing it.
+ *
+ * @since 3.5.0
+ *
+ * @param {Event} event The event that's being called.
+ *
+ * @returs {void}
+ */
+ self.wrap.on( 'click.wpcolorpicker', function( event ) {
+ event.stopPropagation();
+ });
+
+ /**
+ * Open or close the color picker depending on the class.
+ *
+ * @since 3.5
+ */
+ self.toggler.click( function(){
+ if ( self.toggler.hasClass( 'wp-picker-open' ) ) {
+ self.close();
+ } else {
+ self.open();
+ }
+ });
+
+ /**
+ * Checks if value is empty when changing the color in the color picker.
+ * If so, the background color is cleared.
+ *
+ * @since 3.5.0
+ *
+ * @param {Event} event The event that's being called.
+ *
+ * @returns {void}
+ */
+ self.element.change( function( event ) {
+ var me = $( this ),
+ val = me.val();
+
+ if ( val === '' || val === '#' ) {
+ self.toggler.css( 'backgroundColor', '' );
+ // Fire clear callback if we have one.
+ if ( $.isFunction( self.options.clear ) ) {
+ self.options.clear.call( this, event );
+ }
+ }
+ });
+
+ /**
+ * Enables the user to either clear the color in the color picker or revert back to the default color.
+ *
+ * @since 3.5.0
+ *
+ * @param {Event} event The event that's being called.
+ *
+ * @returns {void}
+ */
+ self.button.click( function( event ) {
+ var me = $( this );
+ if ( me.hasClass( 'wp-picker-clear' ) ) {
+ self.element.val( '' );
+ self.toggler.css( 'backgroundColor', '' );
+ if ( $.isFunction( self.options.clear ) ) {
+ self.options.clear.call( this, event );
+ }
+ } else if ( me.hasClass( 'wp-picker-default' ) ) {
+ self.element.val( self.options.defaultColor ).change();
+ }
+ });
+ },
+ /**
+ * Opens the color picker dialog.
+ *
+ * @since 3.5.0
+ *
+ * @returns {void}
+ */
+ open: function() {
+ this.element.iris( 'toggle' );
+ this.inputWrapper.removeClass( 'hidden' );
+ this.wrap.addClass( 'wp-picker-active' );
+ this.toggler
+ .addClass( 'wp-picker-open' )
+ .attr( 'aria-expanded', 'true' );
+ $( 'body' ).trigger( 'click.wpcolorpicker' ).on( 'click.wpcolorpicker', this.close );
+ },
+ /**
+ * Closes the color picker dialog.
+ *
+ * @since 3.5.0
+ *
+ * @returns {void}
+ */
+ close: function() {
+ this.element.iris( 'toggle' );
+ this.inputWrapper.addClass( 'hidden' );
+ this.wrap.removeClass( 'wp-picker-active' );
+ this.toggler
+ .removeClass( 'wp-picker-open' )
+ .attr( 'aria-expanded', 'false' );
+ $( 'body' ).off( 'click.wpcolorpicker', this.close );
+ },
+ /**
+ * Returns the iris object if no new color is provided. If a new color is provided, it sets the new color.
+ *
+ * @param newColor {string|*} The new color to use. Can be undefined.
+ *
+ * @since 3.5.0
+ *
+ * @returns {string} The element's color
+ */
+ color: function( newColor ) {
+ if ( newColor === undef ) {
+ return this.element.iris( 'option', 'color' );
+ }
+ this.element.iris( 'option', 'color', newColor );
+ },
+ /**
+ * Returns the iris object if no new default color is provided.
+ * If a new default color is provided, it sets the new default color.
+ *
+ * @param newDefaultColor {string|*} The new default color to use. Can be undefined.
+ *
+ * @since 3.5.0
+ *
+ * @returns {boolean|string} The element's color.
+ */
+ defaultColor: function( newDefaultColor ) {
+ if ( newDefaultColor === undef ) {
+ return this.options.defaultColor;
+ }
+
+ this.options.defaultColor = newDefaultColor;
+ }
+ };
+
+ // Register the color picker as a widget.
+ $.widget( 'wp.wpColorPicker', ColorPicker );
+}( jQuery ) );
diff --git a/www/crm/wp-admin/js/color-picker.min.js b/www/crm/wp-admin/js/color-picker.min.js
new file mode 100644
index 00000000..25d4277c
--- /dev/null
+++ b/www/crm/wp-admin/js/color-picker.min.js
@@ -0,0 +1 @@
+!function(a,b){var c,d='<button type="button" class="button wp-color-result" aria-expanded="false"><span class="wp-color-result-text"></span></button>',e='<div class="wp-picker-holder" />',f='<div class="wp-picker-container" />',g='<input type="button" class="button button-small" />',h="<label></label>",i='<span class="screen-reader-text"></span>';c={options:{defaultColor:!1,change:!1,clear:!1,hide:!0,palettes:!0,width:255,mode:"hsv",type:"full",slider:"horizontal"},_createHueOnly:function(){var b,c=this,d=c.element;d.hide(),b="hsl("+d.val()+", 100, 50)",d.iris({mode:"hsl",type:"hue",hide:!1,color:b,change:function(b,d){a.isFunction(c.options.change)&&c.options.change.call(this,b,d)},width:c.options.width,slider:c.options.slider})},_create:function(){if(a.support.iris){var b=this,c=b.element;if(a.extend(b.options,c.data()),"hue"===b.options.type)return b._createHueOnly();b.close=a.proxy(b.close,b),b.initialValue=c.val(),c.addClass("wp-color-picker"),c.parent("label").length||(c.wrap(h),b.wrappingLabelText=a(i).insertBefore(c).text(wpColorPickerL10n.defaultLabel)),b.wrappingLabel=c.parent(),b.wrappingLabel.wrap(f),b.wrap=b.wrappingLabel.parent(),b.toggler=a(d).insertBefore(b.wrappingLabel).css({backgroundColor:b.initialValue}),b.toggler.find(".wp-color-result-text").text(wpColorPickerL10n.pick),b.pickerContainer=a(e).insertAfter(b.wrappingLabel),b.button=a(g),b.options.defaultColor?b.button.addClass("wp-picker-default").val(wpColorPickerL10n.defaultString).attr("aria-label",wpColorPickerL10n.defaultAriaLabel):b.button.addClass("wp-picker-clear").val(wpColorPickerL10n.clear).attr("aria-label",wpColorPickerL10n.clearAriaLabel),b.wrappingLabel.wrap('<span class="wp-picker-input-wrap hidden" />').after(b.button),b.inputWrapper=c.closest(".wp-picker-input-wrap"),c.iris({target:b.pickerContainer,hide:b.options.hide,width:b.options.width,mode:b.options.mode,palettes:b.options.palettes,change:function(c,d){b.toggler.css({backgroundColor:d.color.toString()}),a.isFunction(b.options.change)&&b.options.change.call(this,c,d)}}),c.val(b.initialValue),b._addListeners(),b.options.hide||b.toggler.click()}},_addListeners:function(){var b=this;b.wrap.on("click.wpcolorpicker",function(a){a.stopPropagation()}),b.toggler.click(function(){b.toggler.hasClass("wp-picker-open")?b.close():b.open()}),b.element.change(function(c){var d=a(this),e=d.val();""!==e&&"#"!==e||(b.toggler.css("backgroundColor",""),a.isFunction(b.options.clear)&&b.options.clear.call(this,c))}),b.button.click(function(c){var d=a(this);d.hasClass("wp-picker-clear")?(b.element.val(""),b.toggler.css("backgroundColor",""),a.isFunction(b.options.clear)&&b.options.clear.call(this,c)):d.hasClass("wp-picker-default")&&b.element.val(b.options.defaultColor).change()})},open:function(){this.element.iris("toggle"),this.inputWrapper.removeClass("hidden"),this.wrap.addClass("wp-picker-active"),this.toggler.addClass("wp-picker-open").attr("aria-expanded","true"),a("body").trigger("click.wpcolorpicker").on("click.wpcolorpicker",this.close)},close:function(){this.element.iris("toggle"),this.inputWrapper.addClass("hidden"),this.wrap.removeClass("wp-picker-active"),this.toggler.removeClass("wp-picker-open").attr("aria-expanded","false"),a("body").off("click.wpcolorpicker",this.close)},color:function(a){return a===b?this.element.iris("option","color"):void this.element.iris("option","color",a)},defaultColor:function(a){return a===b?this.options.defaultColor:void(this.options.defaultColor=a)}},a.widget("wp.wpColorPicker",c)}(jQuery); \ No newline at end of file
diff --git a/www/crm/wp-admin/js/comment.js b/www/crm/wp-admin/js/comment.js
new file mode 100644
index 00000000..04d6e539
--- /dev/null
+++ b/www/crm/wp-admin/js/comment.js
@@ -0,0 +1,101 @@
+/**
+ * @output wp-admin/js/comment.js
+ */
+
+/* global postboxes, commentL10n */
+
+/**
+ * Binds to the document ready event.
+ *
+ * @since 2.5.0
+ *
+ * @param {jQuery} $ The jQuery object.
+ */
+jQuery(document).ready( function($) {
+
+ postboxes.add_postbox_toggles('comment');
+
+ var $timestampdiv = $('#timestampdiv'),
+ $timestamp = $( '#timestamp' ),
+ stamp = $timestamp.html(),
+ $timestampwrap = $timestampdiv.find( '.timestamp-wrap' ),
+ $edittimestamp = $timestampdiv.siblings( 'a.edit-timestamp' );
+
+ /**
+ * Adds event that opens the time stamp form if the form is hidden.
+ *
+ * @listens $edittimestamp:click
+ *
+ * @param {Event} event The event object.
+ * @returns {void}
+ */
+ $edittimestamp.click( function( event ) {
+ if ( $timestampdiv.is( ':hidden' ) ) {
+ // Slide down the form and set focus on the first field.
+ $timestampdiv.slideDown( 'fast', function() {
+ $( 'input, select', $timestampwrap ).first().focus();
+ } );
+ $(this).hide();
+ }
+ event.preventDefault();
+ });
+
+ /**
+ * Resets the time stamp values when the cancel button is clicked.
+ *
+ * @listens .cancel-timestamp:click
+ *
+ * @param {Event} event The event object.
+ * @returns {void}
+ */
+
+ $timestampdiv.find('.cancel-timestamp').click( function( event ) {
+ // Move focus back to the Edit link.
+ $edittimestamp.show().focus();
+ $timestampdiv.slideUp( 'fast' );
+ $('#mm').val($('#hidden_mm').val());
+ $('#jj').val($('#hidden_jj').val());
+ $('#aa').val($('#hidden_aa').val());
+ $('#hh').val($('#hidden_hh').val());
+ $('#mn').val($('#hidden_mn').val());
+ $timestamp.html( stamp );
+ event.preventDefault();
+ });
+
+ /**
+ * Sets the time stamp values when the ok button is clicked.
+ *
+ * @listens .save-timestamp:click
+ *
+ * @param {Event} event The event object.
+ * @returns {void}
+ */
+ $timestampdiv.find('.save-timestamp').click( function( event ) { // crazyhorse - multiple ok cancels
+ var aa = $('#aa').val(), mm = $('#mm').val(), jj = $('#jj').val(), hh = $('#hh').val(), mn = $('#mn').val(),
+ newD = new Date( aa, mm - 1, jj, hh, mn );
+
+ event.preventDefault();
+
+ if ( newD.getFullYear() != aa || (1 + newD.getMonth()) != mm || newD.getDate() != jj || newD.getMinutes() != mn ) {
+ $timestampwrap.addClass( 'form-invalid' );
+ return;
+ } else {
+ $timestampwrap.removeClass( 'form-invalid' );
+ }
+
+ $timestamp.html(
+ commentL10n.submittedOn + ' <b>' +
+ commentL10n.dateFormat
+ .replace( '%1$s', $( 'option[value="' + mm + '"]', '#mm' ).attr( 'data-text' ) )
+ .replace( '%2$s', parseInt( jj, 10 ) )
+ .replace( '%3$s', aa )
+ .replace( '%4$s', ( '00' + hh ).slice( -2 ) )
+ .replace( '%5$s', ( '00' + mn ).slice( -2 ) ) +
+ '</b> '
+ );
+
+ // Move focus back to the Edit link.
+ $edittimestamp.show().focus();
+ $timestampdiv.slideUp( 'fast' );
+ });
+});
diff --git a/www/crm/wp-admin/js/comment.min.js b/www/crm/wp-admin/js/comment.min.js
new file mode 100644
index 00000000..08512640
--- /dev/null
+++ b/www/crm/wp-admin/js/comment.min.js
@@ -0,0 +1 @@
+jQuery(document).ready(function(a){postboxes.add_postbox_toggles("comment");var b=a("#timestampdiv"),c=a("#timestamp"),d=c.html(),e=b.find(".timestamp-wrap"),f=b.siblings("a.edit-timestamp");f.click(function(c){b.is(":hidden")&&(b.slideDown("fast",function(){a("input, select",e).first().focus()}),a(this).hide()),c.preventDefault()}),b.find(".cancel-timestamp").click(function(e){f.show().focus(),b.slideUp("fast"),a("#mm").val(a("#hidden_mm").val()),a("#jj").val(a("#hidden_jj").val()),a("#aa").val(a("#hidden_aa").val()),a("#hh").val(a("#hidden_hh").val()),a("#mn").val(a("#hidden_mn").val()),c.html(d),e.preventDefault()}),b.find(".save-timestamp").click(function(d){var g=a("#aa").val(),h=a("#mm").val(),i=a("#jj").val(),j=a("#hh").val(),k=a("#mn").val(),l=new Date(g,h-1,i,j,k);return d.preventDefault(),l.getFullYear()!=g||1+l.getMonth()!=h||l.getDate()!=i||l.getMinutes()!=k?void e.addClass("form-invalid"):(e.removeClass("form-invalid"),c.html(commentL10n.submittedOn+" <b>"+commentL10n.dateFormat.replace("%1$s",a('option[value="'+h+'"]',"#mm").attr("data-text")).replace("%2$s",parseInt(i,10)).replace("%3$s",g).replace("%4$s",("00"+j).slice(-2)).replace("%5$s",("00"+k).slice(-2))+"</b> "),f.show().focus(),void b.slideUp("fast"))})}); \ No newline at end of file
diff --git a/www/crm/wp-admin/js/common.js b/www/crm/wp-admin/js/common.js
new file mode 100644
index 00000000..2fc0c388
--- /dev/null
+++ b/www/crm/wp-admin/js/common.js
@@ -0,0 +1,1623 @@
+/**
+ * @output wp-admin/js/common.js
+ */
+
+/* global setUserSetting, ajaxurl, commonL10n, alert, confirm, pagenow */
+/* global columns, screenMeta */
+
+/**
+ * Adds common WordPress functionality to the window.
+ *
+ * @param {jQuery} $ jQuery object.
+ * @param {Object} window The window object.
+ * @param {mixed} undefined Unused.
+ */
+( function( $, window, undefined ) {
+ var $document = $( document ),
+ $window = $( window ),
+ $body = $( document.body );
+
+/**
+ * Removed in 3.3.0, needed for back-compatibility.
+ *
+ * @since 2.7.0
+ * @deprecated 3.3.0
+ */
+window.adminMenu = {
+ init : function() {},
+ fold : function() {},
+ restoreMenuState : function() {},
+ toggle : function() {},
+ favorites : function() {}
+};
+
+// Show/hide/save table columns.
+window.columns = {
+
+ /**
+ * Initializes the column toggles in the screen options.
+ *
+ * Binds an onClick event to the checkboxes to show or hide the table columns
+ * based on their toggled state. And persists the toggled state.
+ *
+ * @since 2.7.0
+ *
+ * @returns {void}
+ */
+ init : function() {
+ var that = this;
+ $('.hide-column-tog', '#adv-settings').click( function() {
+ var $t = $(this), column = $t.val();
+ if ( $t.prop('checked') )
+ that.checked(column);
+ else
+ that.unchecked(column);
+
+ columns.saveManageColumnsState();
+ });
+ },
+
+ /**
+ * Saves the toggled state for the columns.
+ *
+ * Saves whether the columns should be shown or hidden on a page.
+ *
+ * @since 3.0.0
+ *
+ * @returns {void}
+ */
+ saveManageColumnsState : function() {
+ var hidden = this.hidden();
+ $.post(ajaxurl, {
+ action: 'hidden-columns',
+ hidden: hidden,
+ screenoptionnonce: $('#screenoptionnonce').val(),
+ page: pagenow
+ });
+ },
+
+ /**
+ * Makes a column visible and adjusts the column span for the table.
+ *
+ * @since 3.0.0
+ * @param {string} column The column name.
+ *
+ * @returns {void}
+ */
+ checked : function(column) {
+ $('.column-' + column).removeClass( 'hidden' );
+ this.colSpanChange(+1);
+ },
+
+ /**
+ * Hides a column and adjusts the column span for the table.
+ *
+ * @since 3.0.0
+ * @param {string} column The column name.
+ *
+ * @returns {void}
+ */
+ unchecked : function(column) {
+ $('.column-' + column).addClass( 'hidden' );
+ this.colSpanChange(-1);
+ },
+
+ /**
+ * Gets all hidden columns.
+ *
+ * @since 3.0.0
+ *
+ * @returns {string} The hidden column names separated by a comma.
+ */
+ hidden : function() {
+ return $( '.manage-column[id]' ).filter( '.hidden' ).map(function() {
+ return this.id;
+ }).get().join( ',' );
+ },
+
+ /**
+ * Gets the checked column toggles from the screen options.
+ *
+ * @since 3.0.0
+ *
+ * @returns {string} String containing the checked column names.
+ */
+ useCheckboxesForHidden : function() {
+ this.hidden = function(){
+ return $('.hide-column-tog').not(':checked').map(function() {
+ var id = this.id;
+ return id.substring( id, id.length - 5 );
+ }).get().join(',');
+ };
+ },
+
+ /**
+ * Adjusts the column span for the table.
+ *
+ * @since 3.1.0
+ *
+ * @param {int} diff The modifier for the column span.
+ */
+ colSpanChange : function(diff) {
+ var $t = $('table').find('.colspanchange'), n;
+ if ( !$t.length )
+ return;
+ n = parseInt( $t.attr('colspan'), 10 ) + diff;
+ $t.attr('colspan', n.toString());
+ }
+};
+
+$document.ready(function(){columns.init();});
+
+/**
+ * Validates that the required form fields are not empty.
+ *
+ * @since 2.9.0
+ *
+ * @param {jQuery} form The form to validate.
+ *
+ * @returns {boolean} Returns true if all required fields are not an empty string.
+ */
+window.validateForm = function( form ) {
+ return !$( form )
+ .find( '.form-required' )
+ .filter( function() { return $( ':input:visible', this ).val() === ''; } )
+ .addClass( 'form-invalid' )
+ .find( ':input:visible' )
+ .change( function() { $( this ).closest( '.form-invalid' ).removeClass( 'form-invalid' ); } )
+ .length;
+};
+
+// stub for doing better warnings
+/**
+ * Shows message pop-up notice or confirmation message.
+ *
+ * @since 2.7.0
+ *
+ * @type {{warn: showNotice.warn, note: showNotice.note}}
+ *
+ * @returns {void}
+ */
+window.showNotice = {
+
+ /**
+ * Shows a delete confirmation pop-up message.
+ *
+ * @since 2.7.0
+ *
+ * @returns {boolean} Returns true if the message is confirmed.
+ */
+ warn : function() {
+ var msg = commonL10n.warnDelete || '';
+ if ( confirm(msg) ) {
+ return true;
+ }
+
+ return false;
+ },
+
+ /**
+ * Shows an alert message.
+ *
+ * @since 2.7.0
+ *
+ * @param text The text to display in the message.
+ */
+ note : function(text) {
+ alert(text);
+ }
+};
+
+/**
+ * Represents the functions for the meta screen options panel.
+ *
+ * @since 3.2.0
+ *
+ * @type {{element: null, toggles: null, page: null, init: screenMeta.init,
+ * toggleEvent: screenMeta.toggleEvent, open: screenMeta.open,
+ * close: screenMeta.close}}
+ *
+ * @returns {void}
+ */
+window.screenMeta = {
+ element: null, // #screen-meta
+ toggles: null, // .screen-meta-toggle
+ page: null, // #wpcontent
+
+ /**
+ * Initializes the screen meta options panel.
+ *
+ * @since 3.2.0
+ *
+ * @returns {void}
+ */
+ init: function() {
+ this.element = $('#screen-meta');
+ this.toggles = $( '#screen-meta-links' ).find( '.show-settings' );
+ this.page = $('#wpcontent');
+
+ this.toggles.click( this.toggleEvent );
+ },
+
+ /**
+ * Toggles the screen meta options panel.
+ *
+ * @since 3.2.0
+ *
+ * @returns {void}
+ */
+ toggleEvent: function() {
+ var panel = $( '#' + $( this ).attr( 'aria-controls' ) );
+
+ if ( !panel.length )
+ return;
+
+ if ( panel.is(':visible') )
+ screenMeta.close( panel, $(this) );
+ else
+ screenMeta.open( panel, $(this) );
+ },
+
+ /**
+ * Opens the screen meta options panel.
+ *
+ * @since 3.2.0
+ *
+ * @param {jQuery} panel The screen meta options panel div.
+ * @param {jQuery} button The toggle button.
+ *
+ * @returns {void}
+ */
+ open: function( panel, button ) {
+
+ $( '#screen-meta-links' ).find( '.screen-meta-toggle' ).not( button.parent() ).css( 'visibility', 'hidden' );
+
+ panel.parent().show();
+
+ /**
+ * Sets the focus to the meta options panel and adds the necessary CSS classes.
+ *
+ * @since 3.2.0
+ *
+ * @returns {void}
+ */
+ panel.slideDown( 'fast', function() {
+ panel.focus();
+ button.addClass( 'screen-meta-active' ).attr( 'aria-expanded', true );
+ });
+
+ $document.trigger( 'screen:options:open' );
+ },
+
+ /**
+ * Closes the screen meta options panel.
+ *
+ * @since 3.2.0
+ *
+ * @param {jQuery} panel The screen meta options panel div.
+ * @param {jQuery} button The toggle button.
+ *
+ * @returns {void}
+ */
+ close: function( panel, button ) {
+ /**
+ * Hides the screen meta options panel.
+ *
+ * @since 3.2.0
+ *
+ * @returns {void}
+ */
+ panel.slideUp( 'fast', function() {
+ button.removeClass( 'screen-meta-active' ).attr( 'aria-expanded', false );
+ $('.screen-meta-toggle').css('visibility', '');
+ panel.parent().hide();
+ });
+
+ $document.trigger( 'screen:options:close' );
+ }
+};
+
+/**
+ * Initializes the help tabs in the help panel.
+ *
+ * @param {Event} e The event object.
+ *
+ * @returns {void}
+ */
+$('.contextual-help-tabs').delegate('a', 'click', function(e) {
+ var link = $(this),
+ panel;
+
+ e.preventDefault();
+
+ // Don't do anything if the click is for the tab already showing.
+ if ( link.is('.active a') )
+ return false;
+
+ // Links
+ $('.contextual-help-tabs .active').removeClass('active');
+ link.parent('li').addClass('active');
+
+ panel = $( link.attr('href') );
+
+ // Panels
+ $('.help-tab-content').not( panel ).removeClass('active').hide();
+ panel.addClass('active').show();
+});
+
+/**
+ * Update custom permalink structure via buttons.
+ */
+var permalinkStructureFocused = false,
+ $permalinkStructure = $( '#permalink_structure' ),
+ $permalinkStructureInputs = $( '.permalink-structure input:radio' ),
+ $permalinkCustomSelection = $( '#custom_selection' ),
+ $availableStructureTags = $( '.form-table.permalink-structure .available-structure-tags button' );
+
+// Change permalink structure input when selecting one of the common structures.
+$permalinkStructureInputs.on( 'change', function() {
+ if ( 'custom' === this.value ) {
+ return;
+ }
+
+ $permalinkStructure.val( this.value );
+
+ // Update button states after selection.
+ $availableStructureTags.each( function() {
+ changeStructureTagButtonState( $( this ) );
+ } );
+} );
+
+$permalinkStructure.on( 'click input', function() {
+ $permalinkCustomSelection.prop( 'checked', true );
+} );
+
+// Check if the permalink structure input field has had focus at least once.
+$permalinkStructure.on( 'focus', function( event ) {
+ permalinkStructureFocused = true;
+ $( this ).off( event );
+} );
+
+/**
+ * Enables or disables a structure tag button depending on its usage.
+ *
+ * If the structure is already used in the custom permalink structure,
+ * it will be disabled.
+ *
+ * @param {object} button Button jQuery object.
+ */
+function changeStructureTagButtonState( button ) {
+ if ( -1 !== $permalinkStructure.val().indexOf( button.text().trim() ) ) {
+ button.attr( 'data-label', button.attr( 'aria-label' ) );
+ button.attr( 'aria-label', button.attr( 'data-used' ) );
+ button.attr( 'aria-pressed', true );
+ button.addClass( 'active' );
+ } else if ( button.attr( 'data-label' ) ) {
+ button.attr( 'aria-label', button.attr( 'data-label' ) );
+ button.attr( 'aria-pressed', false );
+ button.removeClass( 'active' );
+ }
+}
+
+// Check initial button state.
+$availableStructureTags.each( function() {
+ changeStructureTagButtonState( $( this ) );
+} );
+
+// Observe permalink structure field and disable buttons of tags that are already present.
+$permalinkStructure.on( 'change', function() {
+ $availableStructureTags.each( function() {
+ changeStructureTagButtonState( $( this ) );
+ } );
+} );
+
+$availableStructureTags.on( 'click', function() {
+ var permalinkStructureValue = $permalinkStructure.val(),
+ selectionStart = $permalinkStructure[ 0 ].selectionStart,
+ selectionEnd = $permalinkStructure[ 0 ].selectionEnd,
+ textToAppend = $( this ).text().trim(),
+ textToAnnounce = $( this ).attr( 'data-added' ),
+ newSelectionStart;
+
+ // Remove structure tag if already part of the structure.
+ if ( -1 !== permalinkStructureValue.indexOf( textToAppend ) ) {
+ permalinkStructureValue = permalinkStructureValue.replace( textToAppend + '/', '' );
+
+ $permalinkStructure.val( '/' === permalinkStructureValue ? '' : permalinkStructureValue );
+
+ // Announce change to screen readers.
+ $( '#custom_selection_updated' ).text( textToAnnounce );
+
+ // Disable button.
+ changeStructureTagButtonState( $( this ) );
+
+ return;
+ }
+
+ // Input field never had focus, move selection to end of input.
+ if ( ! permalinkStructureFocused && 0 === selectionStart && 0 === selectionEnd ) {
+ selectionStart = selectionEnd = permalinkStructureValue.length;
+ }
+
+ $permalinkCustomSelection.prop( 'checked', true );
+
+ // Prepend and append slashes if necessary.
+ if ( '/' !== permalinkStructureValue.substr( 0, selectionStart ).substr( -1 ) ) {
+ textToAppend = '/' + textToAppend;
+ }
+
+ if ( '/' !== permalinkStructureValue.substr( selectionEnd, 1 ) ) {
+ textToAppend = textToAppend + '/';
+ }
+
+ // Insert structure tag at the specified position.
+ $permalinkStructure.val( permalinkStructureValue.substr( 0, selectionStart ) + textToAppend + permalinkStructureValue.substr( selectionEnd ) );
+
+ // Announce change to screen readers.
+ $( '#custom_selection_updated' ).text( textToAnnounce );
+
+ // Disable button.
+ changeStructureTagButtonState( $( this ) );
+
+ // If input had focus give it back with cursor right after appended text.
+ if ( permalinkStructureFocused && $permalinkStructure[0].setSelectionRange ) {
+ newSelectionStart = ( permalinkStructureValue.substr( 0, selectionStart ) + textToAppend ).length;
+ $permalinkStructure[0].setSelectionRange( newSelectionStart, newSelectionStart );
+ $permalinkStructure.focus();
+ }
+} );
+
+$document.ready( function() {
+ var checks, first, last, checked, sliced, mobileEvent, transitionTimeout, focusedRowActions,
+ lastClicked = false,
+ pageInput = $('input.current-page'),
+ currentPage = pageInput.val(),
+ isIOS = /iPhone|iPad|iPod/.test( navigator.userAgent ),
+ isAndroid = navigator.userAgent.indexOf( 'Android' ) !== -1,
+ isIE8 = $( document.documentElement ).hasClass( 'ie8' ),
+ $adminMenuWrap = $( '#adminmenuwrap' ),
+ $wpwrap = $( '#wpwrap' ),
+ $adminmenu = $( '#adminmenu' ),
+ $overlay = $( '#wp-responsive-overlay' ),
+ $toolbar = $( '#wp-toolbar' ),
+ $toolbarPopups = $toolbar.find( 'a[aria-haspopup="true"]' ),
+ $sortables = $('.meta-box-sortables'),
+ wpResponsiveActive = false,
+ $adminbar = $( '#wpadminbar' ),
+ lastScrollPosition = 0,
+ pinnedMenuTop = false,
+ pinnedMenuBottom = false,
+ menuTop = 0,
+ menuState,
+ menuIsPinned = false,
+ height = {
+ window: $window.height(),
+ wpwrap: $wpwrap.height(),
+ adminbar: $adminbar.height(),
+ menu: $adminMenuWrap.height()
+ },
+ $headerEnd = $( '.wp-header-end' );
+
+ /**
+ * Makes the fly-out submenu header clickable, when the menu is folded.
+ *
+ * @param {Event} e The event object.
+ *
+ * @returns {void}
+ */
+ $adminmenu.on('click.wp-submenu-head', '.wp-submenu-head', function(e){
+ $(e.target).parent().siblings('a').get(0).click();
+ });
+
+ /**
+ * Collapses the admin menu.
+ *
+ * @returns {void}
+ */
+ $( '#collapse-button' ).on( 'click.collapse-menu', function() {
+ var viewportWidth = getViewportWidth() || 961;
+
+ // reset any compensation for submenus near the bottom of the screen
+ $('#adminmenu div.wp-submenu').css('margin-top', '');
+
+ if ( viewportWidth < 960 ) {
+ if ( $body.hasClass('auto-fold') ) {
+ $body.removeClass('auto-fold').removeClass('folded');
+ setUserSetting('unfold', 1);
+ setUserSetting('mfold', 'o');
+ menuState = 'open';
+ } else {
+ $body.addClass('auto-fold');
+ setUserSetting('unfold', 0);
+ menuState = 'folded';
+ }
+ } else {
+ if ( $body.hasClass('folded') ) {
+ $body.removeClass('folded');
+ setUserSetting('mfold', 'o');
+ menuState = 'open';
+ } else {
+ $body.addClass('folded');
+ setUserSetting('mfold', 'f');
+ menuState = 'folded';
+ }
+ }
+
+ $document.trigger( 'wp-collapse-menu', { state: menuState } );
+ });
+
+ /**
+ * Handles the `aria-haspopup` attribute on the current menu item when it has a submenu.
+ *
+ * @since 4.4.0
+ *
+ * @returns {void}
+ */
+ function currentMenuItemHasPopup() {
+ var $current = $( 'a.wp-has-current-submenu' );
+
+ if ( 'folded' === menuState ) {
+ // When folded or auto-folded and not responsive view, the current menu item does have a fly-out sub-menu.
+ $current.attr( 'aria-haspopup', 'true' );
+ } else {
+ // When expanded or in responsive view, reset aria-haspopup.
+ $current.attr( 'aria-haspopup', 'false' );
+ }
+ }
+
+ $document.on( 'wp-menu-state-set wp-collapse-menu wp-responsive-activate wp-responsive-deactivate', currentMenuItemHasPopup );
+
+ /**
+ * Ensures an admin submenu is within the visual viewport.
+ *
+ * @since 4.1.0
+ *
+ * @param {jQuery} $menuItem The parent menu item containing the submenu.
+ *
+ * @returns {void}
+ */
+ function adjustSubmenu( $menuItem ) {
+ var bottomOffset, pageHeight, adjustment, theFold, menutop, wintop, maxtop,
+ $submenu = $menuItem.find( '.wp-submenu' );
+
+ menutop = $menuItem.offset().top;
+ wintop = $window.scrollTop();
+ maxtop = menutop - wintop - 30; // max = make the top of the sub almost touch admin bar
+
+ bottomOffset = menutop + $submenu.height() + 1; // Bottom offset of the menu
+ pageHeight = $wpwrap.height(); // Height of the entire page
+ adjustment = 60 + bottomOffset - pageHeight;
+ theFold = $window.height() + wintop - 50; // The fold
+
+ if ( theFold < ( bottomOffset - adjustment ) ) {
+ adjustment = bottomOffset - theFold;
+ }
+
+ if ( adjustment > maxtop ) {
+ adjustment = maxtop;
+ }
+
+ if ( adjustment > 1 ) {
+ $submenu.css( 'margin-top', '-' + adjustment + 'px' );
+ } else {
+ $submenu.css( 'margin-top', '' );
+ }
+ }
+
+ if ( 'ontouchstart' in window || /IEMobile\/[1-9]/.test(navigator.userAgent) ) { // touch screen device
+ // iOS Safari works with touchstart, the rest work with click
+ mobileEvent = isIOS ? 'touchstart' : 'click';
+
+ /**
+ * Closes any open submenus when touch/click is not on the menu.
+ *
+ * @param {Event} e The event object.
+ *
+ * @returns {void}
+ */
+ $body.on( mobileEvent+'.wp-mobile-hover', function(e) {
+ if ( $adminmenu.data('wp-responsive') ) {
+ return;
+ }
+
+ if ( ! $( e.target ).closest( '#adminmenu' ).length ) {
+ $adminmenu.find( 'li.opensub' ).removeClass( 'opensub' );
+ }
+ });
+
+ /**
+ * Handles the opening or closing the submenu based on the mobile click|touch event.
+ *
+ * @param {Event} event The event object.
+ *
+ * @returns {void}
+ */
+ $adminmenu.find( 'a.wp-has-submenu' ).on( mobileEvent + '.wp-mobile-hover', function( event ) {
+ var $menuItem = $(this).parent();
+
+ if ( $adminmenu.data( 'wp-responsive' ) ) {
+ return;
+ }
+
+ // Show the sub instead of following the link if:
+ // - the submenu is not open
+ // - the submenu is not shown inline or the menu is not folded
+ if ( ! $menuItem.hasClass( 'opensub' ) && ( ! $menuItem.hasClass( 'wp-menu-open' ) || $menuItem.width() < 40 ) ) {
+ event.preventDefault();
+ adjustSubmenu( $menuItem );
+ $adminmenu.find( 'li.opensub' ).removeClass( 'opensub' );
+ $menuItem.addClass('opensub');
+ }
+ });
+ }
+
+ if ( ! isIOS && ! isAndroid ) {
+ $adminmenu.find( 'li.wp-has-submenu' ).hoverIntent({
+
+ /**
+ * Opens the submenu when hovered over the menu item for desktops.
+ *
+ * @returns {void}
+ */
+ over: function() {
+ var $menuItem = $( this ),
+ $submenu = $menuItem.find( '.wp-submenu' ),
+ top = parseInt( $submenu.css( 'top' ), 10 );
+
+ if ( isNaN( top ) || top > -5 ) { // the submenu is visible
+ return;
+ }
+
+ if ( $adminmenu.data( 'wp-responsive' ) ) {
+ // The menu is in responsive mode, bail
+ return;
+ }
+
+ adjustSubmenu( $menuItem );
+ $adminmenu.find( 'li.opensub' ).removeClass( 'opensub' );
+ $menuItem.addClass( 'opensub' );
+ },
+
+ /**
+ * Closes the submenu when no longer hovering the menu item.
+ *
+ * @returns {void}
+ */
+ out: function(){
+ if ( $adminmenu.data( 'wp-responsive' ) ) {
+ // The menu is in responsive mode, bail
+ return;
+ }
+
+ $( this ).removeClass( 'opensub' ).find( '.wp-submenu' ).css( 'margin-top', '' );
+ },
+ timeout: 200,
+ sensitivity: 7,
+ interval: 90
+ });
+
+ /**
+ * Opens the submenu on when focused on the menu item.
+ *
+ * @param {Event} event The event object.
+ *
+ * @returns {void}
+ */
+ $adminmenu.on( 'focus.adminmenu', '.wp-submenu a', function( event ) {
+ if ( $adminmenu.data( 'wp-responsive' ) ) {
+ // The menu is in responsive mode, bail
+ return;
+ }
+
+ $( event.target ).closest( 'li.menu-top' ).addClass( 'opensub' );
+
+ /**
+ * Closes the submenu on blur from the menu item.
+ *
+ * @param {Event} event The event object.
+ *
+ * @returns {void}
+ */
+ }).on( 'blur.adminmenu', '.wp-submenu a', function( event ) {
+ if ( $adminmenu.data( 'wp-responsive' ) ) {
+ return;
+ }
+
+ $( event.target ).closest( 'li.menu-top' ).removeClass( 'opensub' );
+
+ /**
+ * Adjusts the size for the submenu.
+ *
+ * @returns {void}
+ */
+ }).find( 'li.wp-has-submenu.wp-not-current-submenu' ).on( 'focusin.adminmenu', function() {
+ adjustSubmenu( $( this ) );
+ });
+ }
+
+ /*
+ * The `.below-h2` class is here just for backward compatibility with plugins
+ * that are (incorrectly) using it. Do not use. Use `.inline` instead. See #34570.
+ * If '.wp-header-end' is found, append the notices after it otherwise
+ * after the first h1 or h2 heading found within the main content.
+ */
+ if ( ! $headerEnd.length ) {
+ $headerEnd = $( '.wrap h1, .wrap h2' ).first();
+ }
+ $( 'div.updated, div.error, div.notice' ).not( '.inline, .below-h2' ).insertAfter( $headerEnd );
+
+ /**
+ * Makes notices dismissible.
+ *
+ * @since 4.4.0
+ *
+ * @returns {void}
+ */
+ function makeNoticesDismissible() {
+ $( '.notice.is-dismissible' ).each( function() {
+ var $el = $( this ),
+ $button = $( '<button type="button" class="notice-dismiss"><span class="screen-reader-text"></span></button>' ),
+ btnText = commonL10n.dismiss || '';
+
+ // Ensure plain text
+ $button.find( '.screen-reader-text' ).text( btnText );
+ $button.on( 'click.wp-dismiss-notice', function( event ) {
+ event.preventDefault();
+ $el.fadeTo( 100, 0, function() {
+ $el.slideUp( 100, function() {
+ $el.remove();
+ });
+ });
+ });
+
+ $el.append( $button );
+ });
+ }
+
+ $document.on( 'wp-updates-notice-added wp-plugin-install-error wp-plugin-update-error wp-plugin-delete-error wp-theme-install-error wp-theme-delete-error', makeNoticesDismissible );
+
+ // Init screen meta
+ screenMeta.init();
+
+ /**
+ * Checks a checkbox.
+ *
+ * This event needs to be delegated. Ticket #37973.
+ *
+ * @returns {boolean} Returns whether a checkbox is checked or not.
+ */
+ $body.on( 'click', 'tbody > tr > .check-column :checkbox', function( event ) {
+ // Shift click to select a range of checkboxes.
+ if ( 'undefined' == event.shiftKey ) { return true; }
+ if ( event.shiftKey ) {
+ if ( !lastClicked ) { return true; }
+ checks = $( lastClicked ).closest( 'form' ).find( ':checkbox' ).filter( ':visible:enabled' );
+ first = checks.index( lastClicked );
+ last = checks.index( this );
+ checked = $(this).prop('checked');
+ if ( 0 < first && 0 < last && first != last ) {
+ sliced = ( last > first ) ? checks.slice( first, last ) : checks.slice( last, first );
+ sliced.prop( 'checked', function() {
+ if ( $(this).closest('tr').is(':visible') )
+ return checked;
+
+ return false;
+ });
+ }
+ }
+ lastClicked = this;
+
+ // Toggle the "Select all" checkboxes depending if the other ones are all checked or not.
+ var unchecked = $(this).closest('tbody').find(':checkbox').filter(':visible:enabled').not(':checked');
+
+ /**
+ * Determines if all checkboxes are checked.
+ *
+ * @returns {boolean} Returns true if there are no unchecked checkboxes.
+ */
+ $(this).closest('table').children('thead, tfoot').find(':checkbox').prop('checked', function() {
+ return ( 0 === unchecked.length );
+ });
+
+ return true;
+ });
+
+ /**
+ * Controls all the toggles on bulk toggle change.
+ *
+ * When the bulk checkbox is changed, all the checkboxes in the tables are changed accordingly.
+ * When the shift-button is pressed while changing the bulk checkbox the checkboxes in the table are inverted.
+ *
+ * This event needs to be delegated. Ticket #37973.
+ *
+ * @param {Event} event The event object.
+ *
+ * @returns {boolean}
+ */
+ $body.on( 'click.wp-toggle-checkboxes', 'thead .check-column :checkbox, tfoot .check-column :checkbox', function( event ) {
+ var $this = $(this),
+ $table = $this.closest( 'table' ),
+ controlChecked = $this.prop('checked'),
+ toggle = event.shiftKey || $this.data('wp-toggle');
+
+ $table.children( 'tbody' ).filter(':visible')
+ .children().children('.check-column').find(':checkbox')
+ /**
+ * Updates the checked state on the checkbox in the table.
+ *
+ * @returns {boolean} True checks the checkbox, False unchecks the checkbox.
+ */
+ .prop('checked', function() {
+ if ( $(this).is(':hidden,:disabled') ) {
+ return false;
+ }
+
+ if ( toggle ) {
+ return ! $(this).prop( 'checked' );
+ } else if ( controlChecked ) {
+ return true;
+ }
+
+ return false;
+ });
+
+ $table.children('thead, tfoot').filter(':visible')
+ .children().children('.check-column').find(':checkbox')
+
+ /**
+ * Syncs the bulk checkboxes on the top and bottom of the table.
+ *
+ * @returns {boolean} True checks the checkbox, False unchecks the checkbox.
+ */
+ .prop('checked', function() {
+ if ( toggle ) {
+ return false;
+ } else if ( controlChecked ) {
+ return true;
+ }
+
+ return false;
+ });
+ });
+
+ /**
+ * Shows row actions on focus of its parent container element or any other elements contained within.
+ *
+ * @returns {void}
+ */
+ $( '#wpbody-content' ).on({
+ focusin: function() {
+ clearTimeout( transitionTimeout );
+ focusedRowActions = $( this ).find( '.row-actions' );
+ // transitionTimeout is necessary for Firefox, but Chrome won't remove the CSS class without a little help.
+ $( '.row-actions' ).not( this ).removeClass( 'visible' );
+ focusedRowActions.addClass( 'visible' );
+ },
+ focusout: function() {
+ // Tabbing between post title and .row-actions links needs a brief pause, otherwise
+ // the .row-actions div gets hidden in transit in some browsers (ahem, Firefox).
+ transitionTimeout = setTimeout( function() {
+ focusedRowActions.removeClass( 'visible' );
+ }, 30 );
+ }
+ }, '.has-row-actions' );
+
+ // Toggle list table rows on small screens
+ $( 'tbody' ).on( 'click', '.toggle-row', function() {
+ $( this ).closest( 'tr' ).toggleClass( 'is-expanded' );
+ });
+
+ $('#default-password-nag-no').click( function() {
+ setUserSetting('default_password_nag', 'hide');
+ $('div.default-password-nag').hide();
+ return false;
+ });
+
+ /**
+ * Handles tab keypresses in theme and plugin editor textareas.
+ *
+ * @param {Event} e The event object.
+ *
+ * @returns {void}
+ */
+ $('#newcontent').bind('keydown.wpevent_InsertTab', function(e) {
+ var el = e.target, selStart, selEnd, val, scroll, sel;
+
+ // After pressing escape key (keyCode: 27), the tab key should tab out of the textarea.
+ if ( e.keyCode == 27 ) {
+ // when pressing Escape: Opera 12 and 27 blur form fields, IE 8 clears them
+ e.preventDefault();
+ $(el).data('tab-out', true);
+ return;
+ }
+
+ // Only listen for plain tab key (keyCode: 9) without any modifiers.
+ if ( e.keyCode != 9 || e.ctrlKey || e.altKey || e.shiftKey )
+ return;
+
+ // After tabbing out, reset it so next time the tab key can be used again.
+ if ( $(el).data('tab-out') ) {
+ $(el).data('tab-out', false);
+ return;
+ }
+
+ selStart = el.selectionStart;
+ selEnd = el.selectionEnd;
+ val = el.value;
+
+ // If any text is selected, replace the selection with a tab character.
+ if ( document.selection ) {
+ el.focus();
+ sel = document.selection.createRange();
+ sel.text = '\t';
+ } else if ( selStart >= 0 ) {
+ scroll = this.scrollTop;
+ el.value = val.substring(0, selStart).concat('\t', val.substring(selEnd) );
+ el.selectionStart = el.selectionEnd = selStart + 1;
+ this.scrollTop = scroll;
+ }
+
+ // Cancel the regular tab functionality, to prevent losing focus of the textarea.
+ if ( e.stopPropagation )
+ e.stopPropagation();
+ if ( e.preventDefault )
+ e.preventDefault();
+ });
+
+ // Reset page number variable for new filters/searches but not for bulk actions. See #17685.
+ if ( pageInput.length ) {
+
+ /**
+ * Handles pagination variable when filtering the list table.
+ *
+ * Set the pagination argument to the first page when the post-filter form is submitted.
+ * This happens when pressing the 'filter' button on the list table page.
+ *
+ * The pagination argument should not be touched when the bulk action dropdowns are set to do anything.
+ *
+ * The form closest to the pageInput is the post-filter form.
+ *
+ * @returns {void}
+ */
+ pageInput.closest('form').submit( function() {
+ /*
+ * action = bulk action dropdown at the top of the table
+ * action2 = bulk action dropdow at the bottom of the table
+ */
+ if ( $('select[name="action"]').val() == -1 && $('select[name="action2"]').val() == -1 && pageInput.val() == currentPage )
+ pageInput.val('1');
+ });
+ }
+
+ /**
+ * Resets the bulk actions when the search button is clicked.
+ *
+ * @returns {void}
+ */
+ $('.search-box input[type="search"], .search-box input[type="submit"]').mousedown(function () {
+ $('select[name^="action"]').val('-1');
+ });
+
+ /**
+ * Scrolls into view when focus.scroll-into-view is triggered.
+ *
+ * @param {Event} e The event object.
+ *
+ * @returns {void}
+ */
+ $('#contextual-help-link, #show-settings-link').on( 'focus.scroll-into-view', function(e){
+ if ( e.target.scrollIntoView )
+ e.target.scrollIntoView(false);
+ });
+
+ /**
+ * Disables the submit upload buttons when no data is entered.
+ *
+ * @returns {void}
+ */
+ (function(){
+ var button, input, form = $('form.wp-upload-form');
+
+ // Exit when no upload form is found.
+ if ( ! form.length )
+ return;
+
+ button = form.find('input[type="submit"]');
+ input = form.find('input[type="file"]');
+
+ /**
+ * Determines if any data is entered in any file upload input.
+ *
+ * @since 3.5.0
+ *
+ * @returns {void}
+ */
+ function toggleUploadButton() {
+ // When no inputs have a value, disable the upload buttons.
+ button.prop('disabled', '' === input.map( function() {
+ return $(this).val();
+ }).get().join(''));
+ }
+
+ // Update the status initially.
+ toggleUploadButton();
+ // Update the status when any file input changes.
+ input.on('change', toggleUploadButton);
+ })();
+
+ /**
+ * Pins the menu while distraction-free writing is enabled.
+ *
+ * @param {Event} event Event data.
+ *
+ * @since 4.1.0
+ *
+ * @returns {void}
+ */
+ function pinMenu( event ) {
+ var windowPos = $window.scrollTop(),
+ resizing = ! event || event.type !== 'scroll';
+
+ if ( isIOS || isIE8 || $adminmenu.data( 'wp-responsive' ) ) {
+ return;
+ }
+
+ /*
+ * When the menu is higher than the window and smaller than the entire page.
+ * It should be adjusted to be able to see the entire menu.
+ *
+ * Otherwise it can be accessed normally.
+ */
+ if ( height.menu + height.adminbar < height.window ||
+ height.menu + height.adminbar + 20 > height.wpwrap ) {
+ unpinMenu();
+ return;
+ }
+
+ menuIsPinned = true;
+
+ // If the menu is higher than the window, compensate on scroll.
+ if ( height.menu + height.adminbar > height.window ) {
+ // Check for overscrolling, this happens when swiping up at the top of the document in modern browsers.
+ if ( windowPos < 0 ) {
+ // Stick the menu to the top.
+ if ( ! pinnedMenuTop ) {
+ pinnedMenuTop = true;
+ pinnedMenuBottom = false;
+
+ $adminMenuWrap.css({
+ position: 'fixed',
+ top: '',
+ bottom: ''
+ });
+ }
+
+ return;
+ } else if ( windowPos + height.window > $document.height() - 1 ) {
+ // When overscrolling at the bottom, stick the menu to the bottom.
+ if ( ! pinnedMenuBottom ) {
+ pinnedMenuBottom = true;
+ pinnedMenuTop = false;
+
+ $adminMenuWrap.css({
+ position: 'fixed',
+ top: '',
+ bottom: 0
+ });
+ }
+
+ return;
+ }
+
+ if ( windowPos > lastScrollPosition ) {
+ // When a down scroll has been detected.
+
+ // If it was pinned to the top, unpin and calculate relative scroll.
+ if ( pinnedMenuTop ) {
+ pinnedMenuTop = false;
+ // Calculate new offset position.
+ menuTop = $adminMenuWrap.offset().top - height.adminbar - ( windowPos - lastScrollPosition );
+
+ if ( menuTop + height.menu + height.adminbar < windowPos + height.window ) {
+ menuTop = windowPos + height.window - height.menu - height.adminbar;
+ }
+
+ $adminMenuWrap.css({
+ position: 'absolute',
+ top: menuTop,
+ bottom: ''
+ });
+ } else if ( ! pinnedMenuBottom && $adminMenuWrap.offset().top + height.menu < windowPos + height.window ) {
+ // Pin it to the bottom.
+ pinnedMenuBottom = true;
+
+ $adminMenuWrap.css({
+ position: 'fixed',
+ top: '',
+ bottom: 0
+ });
+ }
+ } else if ( windowPos < lastScrollPosition ) {
+ // When a scroll up is detected.
+
+ // If it was pinned to the bottom, unpin and calculate relative scroll.
+ if ( pinnedMenuBottom ) {
+ pinnedMenuBottom = false;
+
+ // Calculate new offset position.
+ menuTop = $adminMenuWrap.offset().top - height.adminbar + ( lastScrollPosition - windowPos );
+
+ if ( menuTop + height.menu > windowPos + height.window ) {
+ menuTop = windowPos;
+ }
+
+ $adminMenuWrap.css({
+ position: 'absolute',
+ top: menuTop,
+ bottom: ''
+ });
+ } else if ( ! pinnedMenuTop && $adminMenuWrap.offset().top >= windowPos + height.adminbar ) {
+
+ // Pin it to the top.
+ pinnedMenuTop = true;
+
+ $adminMenuWrap.css({
+ position: 'fixed',
+ top: '',
+ bottom: ''
+ });
+ }
+ } else if ( resizing ) {
+ // Window is being resized.
+
+ pinnedMenuTop = pinnedMenuBottom = false;
+
+ // Calculate the new offset.
+ menuTop = windowPos + height.window - height.menu - height.adminbar - 1;
+
+ if ( menuTop > 0 ) {
+ $adminMenuWrap.css({
+ position: 'absolute',
+ top: menuTop,
+ bottom: ''
+ });
+ } else {
+ unpinMenu();
+ }
+ }
+ }
+
+ lastScrollPosition = windowPos;
+ }
+
+ /**
+ * Determines the height of certain elements.
+ *
+ * @since 4.1.0
+ *
+ * @returns {void}
+ */
+ function resetHeights() {
+ height = {
+ window: $window.height(),
+ wpwrap: $wpwrap.height(),
+ adminbar: $adminbar.height(),
+ menu: $adminMenuWrap.height()
+ };
+ }
+
+ /**
+ * Unpins the menu.
+ *
+ * @since 4.1.0
+ *
+ * @returns {void}
+ */
+ function unpinMenu() {
+ if ( isIOS || ! menuIsPinned ) {
+ return;
+ }
+
+ pinnedMenuTop = pinnedMenuBottom = menuIsPinned = false;
+ $adminMenuWrap.css({
+ position: '',
+ top: '',
+ bottom: ''
+ });
+ }
+
+ /**
+ * Pins and unpins the menu when applicable.
+ *
+ * @since 4.1.0
+ *
+ * @returns {void}
+ */
+ function setPinMenu() {
+ resetHeights();
+
+ if ( $adminmenu.data('wp-responsive') ) {
+ $body.removeClass( 'sticky-menu' );
+ unpinMenu();
+ } else if ( height.menu + height.adminbar > height.window ) {
+ pinMenu();
+ $body.removeClass( 'sticky-menu' );
+ } else {
+ $body.addClass( 'sticky-menu' );
+ unpinMenu();
+ }
+ }
+
+ if ( ! isIOS ) {
+ $window.on( 'scroll.pin-menu', pinMenu );
+ $document.on( 'tinymce-editor-init.pin-menu', function( event, editor ) {
+ editor.on( 'wp-autoresize', resetHeights );
+ });
+ }
+
+ /**
+ * Changes the sortables and responsiveness of metaboxes.
+ *
+ * @since 3.8.0
+ *
+ *@returns {void}
+ */
+ window.wpResponsive = {
+
+ /**
+ * Initializes the wpResponsive object.
+ *
+ * @since 3.8.0
+ *
+ * @returns {void}
+ */
+ init: function() {
+ var self = this;
+
+ // Modify functionality based on custom activate/deactivate event
+ $document.on( 'wp-responsive-activate.wp-responsive', function() {
+ self.activate();
+ }).on( 'wp-responsive-deactivate.wp-responsive', function() {
+ self.deactivate();
+ });
+
+ $( '#wp-admin-bar-menu-toggle a' ).attr( 'aria-expanded', 'false' );
+
+ // Toggle sidebar when toggle is clicked.
+ $( '#wp-admin-bar-menu-toggle' ).on( 'click.wp-responsive', function( event ) {
+ event.preventDefault();
+
+ // close any open toolbar submenus.
+ $adminbar.find( '.hover' ).removeClass( 'hover' );
+
+ $wpwrap.toggleClass( 'wp-responsive-open' );
+ if ( $wpwrap.hasClass( 'wp-responsive-open' ) ) {
+ $(this).find('a').attr( 'aria-expanded', 'true' );
+ $( '#adminmenu a:first' ).focus();
+ } else {
+ $(this).find('a').attr( 'aria-expanded', 'false' );
+ }
+ } );
+
+ // Add menu events.
+ $adminmenu.on( 'click.wp-responsive', 'li.wp-has-submenu > a', function( event ) {
+ if ( ! $adminmenu.data('wp-responsive') ) {
+ return;
+ }
+
+ $( this ).parent( 'li' ).toggleClass( 'selected' );
+ event.preventDefault();
+ });
+
+ self.trigger();
+ $document.on( 'wp-window-resized.wp-responsive', $.proxy( this.trigger, this ) );
+
+ // This needs to run later as UI Sortable may be initialized later on $(document).ready().
+ $window.on( 'load.wp-responsive', function() {
+ var width = navigator.userAgent.indexOf('AppleWebKit/') > -1 ? $window.width() : window.innerWidth;
+
+ if ( width <= 782 ) {
+ self.disableSortables();
+ }
+ });
+ },
+
+ /**
+ * Changes properties of body and admin menu.
+ *
+ * Pins and unpins the menu and adds the auto-fold class to the body.
+ * Makes the admin menu responsive and disables the metabox sortables.
+ *
+ * @since 3.8.0
+ *
+ * @returns {void}
+ */
+ activate: function() {
+ setPinMenu();
+
+ if ( ! $body.hasClass( 'auto-fold' ) ) {
+ $body.addClass( 'auto-fold' );
+ }
+
+ $adminmenu.data( 'wp-responsive', 1 );
+ this.disableSortables();
+ },
+
+ /**
+ * Changes properties of admin menu and enables metabox sortables.
+ *
+ * Pin and unpin the menu.
+ * Removes the responsiveness of the admin menu and enables the metabox sortables.
+ *
+ * @since 3.8.0
+ *
+ * @returns {void}
+ */
+ deactivate: function() {
+ setPinMenu();
+ $adminmenu.removeData('wp-responsive');
+ this.enableSortables();
+ },
+
+ /**
+ * Sets the responsiveness and enables the overlay based on the viewport width.
+ *
+ * @since 3.8.0
+ *
+ * @returns {void}
+ */
+ trigger: function() {
+ var viewportWidth = getViewportWidth();
+
+ // Exclude IE < 9, it doesn't support @media CSS rules.
+ if ( ! viewportWidth ) {
+ return;
+ }
+
+ if ( viewportWidth <= 782 ) {
+ if ( ! wpResponsiveActive ) {
+ $document.trigger( 'wp-responsive-activate' );
+ wpResponsiveActive = true;
+ }
+ } else {
+ if ( wpResponsiveActive ) {
+ $document.trigger( 'wp-responsive-deactivate' );
+ wpResponsiveActive = false;
+ }
+ }
+
+ if ( viewportWidth <= 480 ) {
+ this.enableOverlay();
+ } else {
+ this.disableOverlay();
+ }
+ },
+
+ /**
+ * Inserts a responsive overlay and toggles the window.
+ *
+ * @since 3.8.0
+ *
+ * @returns {void}
+ */
+ enableOverlay: function() {
+ if ( $overlay.length === 0 ) {
+ $overlay = $( '<div id="wp-responsive-overlay"></div>' )
+ .insertAfter( '#wpcontent' )
+ .hide()
+ .on( 'click.wp-responsive', function() {
+ $toolbar.find( '.menupop.hover' ).removeClass( 'hover' );
+ $( this ).hide();
+ });
+ }
+
+ $toolbarPopups.on( 'click.wp-responsive', function() {
+ $overlay.show();
+ });
+ },
+
+ /**
+ * Disables the responsive overlay and removes the overlay.
+ *
+ * @since 3.8.0
+ *
+ * @returns {void}
+ */
+ disableOverlay: function() {
+ $toolbarPopups.off( 'click.wp-responsive' );
+ $overlay.hide();
+ },
+
+ /**
+ * Disables sortables.
+ *
+ * @since 3.8.0
+ *
+ * @returns {void}
+ */
+ disableSortables: function() {
+ if ( $sortables.length ) {
+ try {
+ $sortables.sortable( 'disable' );
+ } catch ( e ) {}
+ }
+ },
+
+ /**
+ * Enables sortables.
+ *
+ * @since 3.8.0
+ *
+ * @returns {void}
+ */
+ enableSortables: function() {
+ if ( $sortables.length ) {
+ try {
+ $sortables.sortable( 'enable' );
+ } catch ( e ) {}
+ }
+ }
+ };
+
+ /**
+ * Add an ARIA role `button` to elements that behave like UI controls when JavaScript is on.
+ *
+ * @since 4.5.0
+ *
+ * @returns {void}
+ */
+ function aria_button_if_js() {
+ $( '.aria-button-if-js' ).attr( 'role', 'button' );
+ }
+
+ $( document ).ajaxComplete( function() {
+ aria_button_if_js();
+ });
+
+ /**
+ * Get the viewport width.
+ *
+ * @since 4.7.0
+ *
+ * @returns {number|boolean} The current viewport width or false if the
+ * browser doesn't support innerWidth (IE < 9).
+ */
+ function getViewportWidth() {
+ var viewportWidth = false;
+
+ if ( window.innerWidth ) {
+ // On phones, window.innerWidth is affected by zooming.
+ viewportWidth = Math.max( window.innerWidth, document.documentElement.clientWidth );
+ }
+
+ return viewportWidth;
+ }
+
+ /**
+ * Sets the admin menu collapsed/expanded state.
+ *
+ * Sets the global variable `menuState` and triggers a custom event passing
+ * the current menu state.
+ *
+ * @since 4.7.0
+ *
+ * @returns {void}
+ */
+ function setMenuState() {
+ var viewportWidth = getViewportWidth() || 961;
+
+ if ( viewportWidth <= 782 ) {
+ menuState = 'responsive';
+ } else if ( $body.hasClass( 'folded' ) || ( $body.hasClass( 'auto-fold' ) && viewportWidth <= 960 && viewportWidth > 782 ) ) {
+ menuState = 'folded';
+ } else {
+ menuState = 'open';
+ }
+
+ $document.trigger( 'wp-menu-state-set', { state: menuState } );
+ }
+
+ // Set the menu state when the window gets resized.
+ $document.on( 'wp-window-resized.set-menu-state', setMenuState );
+
+ /**
+ * Sets ARIA attributes on the collapse/expand menu button.
+ *
+ * When the admin menu is open or folded, updates the `aria-expanded` and
+ * `aria-label` attributes of the button to give feedback to assistive
+ * technologies. In the responsive view, the button is always hidden.
+ *
+ * @since 4.7.0
+ *
+ * @returns {void}
+ */
+ $document.on( 'wp-menu-state-set wp-collapse-menu', function( event, eventData ) {
+ var $collapseButton = $( '#collapse-button' ),
+ ariaExpanded = 'true',
+ ariaLabelText = commonL10n.collapseMenu;
+
+ if ( 'folded' === eventData.state ) {
+ ariaExpanded = 'false';
+ ariaLabelText = commonL10n.expandMenu;
+ }
+
+ $collapseButton.attr({
+ 'aria-expanded': ariaExpanded,
+ 'aria-label': ariaLabelText
+ });
+ });
+
+ window.wpResponsive.init();
+ setPinMenu();
+ setMenuState();
+ currentMenuItemHasPopup();
+ makeNoticesDismissible();
+ aria_button_if_js();
+
+ $document.on( 'wp-pin-menu wp-window-resized.pin-menu postboxes-columnchange.pin-menu postbox-toggled.pin-menu wp-collapse-menu.pin-menu wp-scroll-start.pin-menu', setPinMenu );
+
+ // Set initial focus on a specific element.
+ $( '.wp-initial-focus' ).focus();
+
+ // Toggle update details on update-core.php.
+ $body.on( 'click', '.js-update-details-toggle', function() {
+ var $updateNotice = $( this ).closest( '.js-update-details' ),
+ $progressDiv = $( '#' + $updateNotice.data( 'update-details' ) );
+
+ /*
+ * When clicking on "Show details" move the progress div below the update
+ * notice. Make sure it gets moved just the first time.
+ */
+ if ( ! $progressDiv.hasClass( 'update-details-moved' ) ) {
+ $progressDiv.insertAfter( $updateNotice ).addClass( 'update-details-moved' );
+ }
+
+ // Toggle the progress div visibility.
+ $progressDiv.toggle();
+ // Toggle the Show Details button expanded state.
+ $( this ).attr( 'aria-expanded', $progressDiv.is( ':visible' ) );
+ });
+});
+
+// Fire a custom jQuery event at the end of window resize.
+( function() {
+ var timeout;
+
+ /**
+ * Triggers the WP window-resize event.
+ *
+ * @since 3.8.0
+ *
+ * @returns {void}
+ */
+ function triggerEvent() {
+ $document.trigger( 'wp-window-resized' );
+ }
+
+ /**
+ * Fires the trigger event again after 200 ms.
+ *
+ * @since 3.8.0
+ *
+ * @returns {void}
+ */
+ function fireOnce() {
+ window.clearTimeout( timeout );
+ timeout = window.setTimeout( triggerEvent, 200 );
+ }
+
+ $window.on( 'resize.wp-fire-once', fireOnce );
+}());
+
+// Make Windows 8 devices play along nicely.
+(function(){
+ if ( '-ms-user-select' in document.documentElement.style && navigator.userAgent.match(/IEMobile\/10\.0/) ) {
+ var msViewportStyle = document.createElement( 'style' );
+ msViewportStyle.appendChild(
+ document.createTextNode( '@-ms-viewport{width:auto!important}' )
+ );
+ document.getElementsByTagName( 'head' )[0].appendChild( msViewportStyle );
+ }
+})();
+
+}( jQuery, window ));
diff --git a/www/crm/wp-admin/js/common.min.js b/www/crm/wp-admin/js/common.min.js
new file mode 100644
index 00000000..8181000a
--- /dev/null
+++ b/www/crm/wp-admin/js/common.min.js
@@ -0,0 +1 @@
+!function(a,b,c){function d(a){-1!==i.val().indexOf(a.text().trim())?(a.attr("data-label",a.attr("aria-label")),a.attr("aria-label",a.attr("data-used")),a.attr("aria-pressed",!0),a.addClass("active")):a.attr("data-label")&&(a.attr("aria-label",a.attr("data-label")),a.attr("aria-pressed",!1),a.removeClass("active"))}var e=a(document),f=a(b),g=a(document.body);b.adminMenu={init:function(){},fold:function(){},restoreMenuState:function(){},toggle:function(){},favorites:function(){}},b.columns={init:function(){var b=this;a(".hide-column-tog","#adv-settings").click(function(){var c=a(this),d=c.val();c.prop("checked")?b.checked(d):b.unchecked(d),columns.saveManageColumnsState()})},saveManageColumnsState:function(){var b=this.hidden();a.post(ajaxurl,{action:"hidden-columns",hidden:b,screenoptionnonce:a("#screenoptionnonce").val(),page:pagenow})},checked:function(b){a(".column-"+b).removeClass("hidden"),this.colSpanChange(1)},unchecked:function(b){a(".column-"+b).addClass("hidden"),this.colSpanChange(-1)},hidden:function(){return a(".manage-column[id]").filter(".hidden").map(function(){return this.id}).get().join(",")},useCheckboxesForHidden:function(){this.hidden=function(){return a(".hide-column-tog").not(":checked").map(function(){var a=this.id;return a.substring(a,a.length-5)}).get().join(",")}},colSpanChange:function(b){var c,d=a("table").find(".colspanchange");d.length&&(c=parseInt(d.attr("colspan"),10)+b,d.attr("colspan",c.toString()))}},e.ready(function(){columns.init()}),b.validateForm=function(b){return!a(b).find(".form-required").filter(function(){return""===a(":input:visible",this).val()}).addClass("form-invalid").find(":input:visible").change(function(){a(this).closest(".form-invalid").removeClass("form-invalid")}).length},b.showNotice={warn:function(){var a=commonL10n.warnDelete||"";return!!confirm(a)},note:function(a){alert(a)}},b.screenMeta={element:null,toggles:null,page:null,init:function(){this.element=a("#screen-meta"),this.toggles=a("#screen-meta-links").find(".show-settings"),this.page=a("#wpcontent"),this.toggles.click(this.toggleEvent)},toggleEvent:function(){var b=a("#"+a(this).attr("aria-controls"));b.length&&(b.is(":visible")?screenMeta.close(b,a(this)):screenMeta.open(b,a(this)))},open:function(b,c){a("#screen-meta-links").find(".screen-meta-toggle").not(c.parent()).css("visibility","hidden"),b.parent().show(),b.slideDown("fast",function(){b.focus(),c.addClass("screen-meta-active").attr("aria-expanded",!0)}),e.trigger("screen:options:open")},close:function(b,c){b.slideUp("fast",function(){c.removeClass("screen-meta-active").attr("aria-expanded",!1),a(".screen-meta-toggle").css("visibility",""),b.parent().hide()}),e.trigger("screen:options:close")}},a(".contextual-help-tabs").delegate("a","click",function(b){var c,d=a(this);return b.preventDefault(),!d.is(".active a")&&(a(".contextual-help-tabs .active").removeClass("active"),d.parent("li").addClass("active"),c=a(d.attr("href")),a(".help-tab-content").not(c).removeClass("active").hide(),void c.addClass("active").show())});var h=!1,i=a("#permalink_structure"),j=a(".permalink-structure input:radio"),k=a("#custom_selection"),l=a(".form-table.permalink-structure .available-structure-tags button");j.on("change",function(){"custom"!==this.value&&(i.val(this.value),l.each(function(){d(a(this))}))}),i.on("click input",function(){k.prop("checked",!0)}),i.on("focus",function(b){h=!0,a(this).off(b)}),l.each(function(){d(a(this))}),i.on("change",function(){l.each(function(){d(a(this))})}),l.on("click",function(){var b,c=i.val(),e=i[0].selectionStart,f=i[0].selectionEnd,g=a(this).text().trim(),j=a(this).attr("data-added");return-1!==c.indexOf(g)?(c=c.replace(g+"/",""),i.val("/"===c?"":c),a("#custom_selection_updated").text(j),void d(a(this))):(h||0!==e||0!==f||(e=f=c.length),k.prop("checked",!0),"/"!==c.substr(0,e).substr(-1)&&(g="/"+g),"/"!==c.substr(f,1)&&(g+="/"),i.val(c.substr(0,e)+g+c.substr(f)),a("#custom_selection_updated").text(j),d(a(this)),void(h&&i[0].setSelectionRange&&(b=(c.substr(0,e)+g).length,i[0].setSelectionRange(b,b),i.focus())))}),e.ready(function(){function c(){var b=a("a.wp-has-current-submenu");"folded"===x?b.attr("aria-haspopup","true"):b.attr("aria-haspopup","false")}function d(a){var b,c,d,e,g,h,i,j=a.find(".wp-submenu");g=a.offset().top,h=f.scrollTop(),i=g-h-30,b=g+j.height()+1,c=F.height(),d=60+b-c,e=f.height()+h-50,e<b-d&&(d=b-e),d>i&&(d=i),d>1?j.css("margin-top","-"+d+"px"):j.css("margin-top","")}function h(){a(".notice.is-dismissible").each(function(){var b=a(this),c=a('<button type="button" class="notice-dismiss"><span class="screen-reader-text"></span></button>'),d=commonL10n.dismiss||"";c.find(".screen-reader-text").text(d),c.on("click.wp-dismiss-notice",function(a){a.preventDefault(),b.fadeTo(100,0,function(){b.slideUp(100,function(){b.remove()})})}),b.append(c)})}function i(a){var b=f.scrollTop(),c=!a||"scroll"!==a.type;if(!(B||D||G.data("wp-responsive"))){if(S.menu+S.adminbar<S.window||S.menu+S.adminbar+20>S.wpwrap)return void k();if(R=!0,S.menu+S.adminbar>S.window){if(b<0)return void(O||(O=!0,P=!1,E.css({position:"fixed",top:"",bottom:""})));if(b+S.window>e.height()-1)return void(P||(P=!0,O=!1,E.css({position:"fixed",top:"",bottom:0})));b>N?O?(O=!1,Q=E.offset().top-S.adminbar-(b-N),Q+S.menu+S.adminbar<b+S.window&&(Q=b+S.window-S.menu-S.adminbar),E.css({position:"absolute",top:Q,bottom:""})):!P&&E.offset().top+S.menu<b+S.window&&(P=!0,E.css({position:"fixed",top:"",bottom:0})):b<N?P?(P=!1,Q=E.offset().top-S.adminbar+(N-b),Q+S.menu>b+S.window&&(Q=b),E.css({position:"absolute",top:Q,bottom:""})):!O&&E.offset().top>=b+S.adminbar&&(O=!0,E.css({position:"fixed",top:"",bottom:""})):c&&(O=P=!1,Q=b+S.window-S.menu-S.adminbar-1,Q>0?E.css({position:"absolute",top:Q,bottom:""}):k())}N=b}}function j(){S={window:f.height(),wpwrap:F.height(),adminbar:M.height(),menu:E.height()}}function k(){!B&&R&&(O=P=R=!1,E.css({position:"",top:"",bottom:""}))}function l(){j(),G.data("wp-responsive")?(g.removeClass("sticky-menu"),k()):S.menu+S.adminbar>S.window?(i(),g.removeClass("sticky-menu")):(g.addClass("sticky-menu"),k())}function m(){a(".aria-button-if-js").attr("role","button")}function n(){var a=!1;return b.innerWidth&&(a=Math.max(b.innerWidth,document.documentElement.clientWidth)),a}function o(){var a=n()||961;x=a<=782?"responsive":g.hasClass("folded")||g.hasClass("auto-fold")&&a<=960&&a>782?"folded":"open",e.trigger("wp-menu-state-set",{state:x})}var p,q,r,s,t,u,v,w,x,y=!1,z=a("input.current-page"),A=z.val(),B=/iPhone|iPad|iPod/.test(navigator.userAgent),C=navigator.userAgent.indexOf("Android")!==-1,D=a(document.documentElement).hasClass("ie8"),E=a("#adminmenuwrap"),F=a("#wpwrap"),G=a("#adminmenu"),H=a("#wp-responsive-overlay"),I=a("#wp-toolbar"),J=I.find('a[aria-haspopup="true"]'),K=a(".meta-box-sortables"),L=!1,M=a("#wpadminbar"),N=0,O=!1,P=!1,Q=0,R=!1,S={window:f.height(),wpwrap:F.height(),adminbar:M.height(),menu:E.height()},T=a(".wp-header-end");G.on("click.wp-submenu-head",".wp-submenu-head",function(b){a(b.target).parent().siblings("a").get(0).click()}),a("#collapse-button").on("click.collapse-menu",function(){var b=n()||961;a("#adminmenu div.wp-submenu").css("margin-top",""),b<960?g.hasClass("auto-fold")?(g.removeClass("auto-fold").removeClass("folded"),setUserSetting("unfold",1),setUserSetting("mfold","o"),x="open"):(g.addClass("auto-fold"),setUserSetting("unfold",0),x="folded"):g.hasClass("folded")?(g.removeClass("folded"),setUserSetting("mfold","o"),x="open"):(g.addClass("folded"),setUserSetting("mfold","f"),x="folded"),e.trigger("wp-collapse-menu",{state:x})}),e.on("wp-menu-state-set wp-collapse-menu wp-responsive-activate wp-responsive-deactivate",c),("ontouchstart"in b||/IEMobile\/[1-9]/.test(navigator.userAgent))&&(u=B?"touchstart":"click",g.on(u+".wp-mobile-hover",function(b){G.data("wp-responsive")||a(b.target).closest("#adminmenu").length||G.find("li.opensub").removeClass("opensub")}),G.find("a.wp-has-submenu").on(u+".wp-mobile-hover",function(b){var c=a(this).parent();G.data("wp-responsive")||c.hasClass("opensub")||c.hasClass("wp-menu-open")&&!(c.width()<40)||(b.preventDefault(),d(c),G.find("li.opensub").removeClass("opensub"),c.addClass("opensub"))})),B||C||(G.find("li.wp-has-submenu").hoverIntent({over:function(){var b=a(this),c=b.find(".wp-submenu"),e=parseInt(c.css("top"),10);isNaN(e)||e>-5||G.data("wp-responsive")||(d(b),G.find("li.opensub").removeClass("opensub"),b.addClass("opensub"))},out:function(){G.data("wp-responsive")||a(this).removeClass("opensub").find(".wp-submenu").css("margin-top","")},timeout:200,sensitivity:7,interval:90}),G.on("focus.adminmenu",".wp-submenu a",function(b){G.data("wp-responsive")||a(b.target).closest("li.menu-top").addClass("opensub")}).on("blur.adminmenu",".wp-submenu a",function(b){G.data("wp-responsive")||a(b.target).closest("li.menu-top").removeClass("opensub")}).find("li.wp-has-submenu.wp-not-current-submenu").on("focusin.adminmenu",function(){d(a(this))})),T.length||(T=a(".wrap h1, .wrap h2").first()),a("div.updated, div.error, div.notice").not(".inline, .below-h2").insertAfter(T),e.on("wp-updates-notice-added wp-plugin-install-error wp-plugin-update-error wp-plugin-delete-error wp-theme-install-error wp-theme-delete-error",h),screenMeta.init(),g.on("click","tbody > tr > .check-column :checkbox",function(b){if("undefined"==b.shiftKey)return!0;if(b.shiftKey){if(!y)return!0;p=a(y).closest("form").find(":checkbox").filter(":visible:enabled"),q=p.index(y),r=p.index(this),s=a(this).prop("checked"),0<q&&0<r&&q!=r&&(t=r>q?p.slice(q,r):p.slice(r,q),t.prop("checked",function(){return!!a(this).closest("tr").is(":visible")&&s}))}y=this;var c=a(this).closest("tbody").find(":checkbox").filter(":visible:enabled").not(":checked");return a(this).closest("table").children("thead, tfoot").find(":checkbox").prop("checked",function(){return 0===c.length}),!0}),g.on("click.wp-toggle-checkboxes","thead .check-column :checkbox, tfoot .check-column :checkbox",function(b){var c=a(this),d=c.closest("table"),e=c.prop("checked"),f=b.shiftKey||c.data("wp-toggle");d.children("tbody").filter(":visible").children().children(".check-column").find(":checkbox").prop("checked",function(){return!a(this).is(":hidden,:disabled")&&(f?!a(this).prop("checked"):!!e)}),d.children("thead, tfoot").filter(":visible").children().children(".check-column").find(":checkbox").prop("checked",function(){return!f&&!!e})}),a("#wpbody-content").on({focusin:function(){clearTimeout(v),w=a(this).find(".row-actions"),a(".row-actions").not(this).removeClass("visible"),w.addClass("visible")},focusout:function(){v=setTimeout(function(){w.removeClass("visible")},30)}},".has-row-actions"),a("tbody").on("click",".toggle-row",function(){a(this).closest("tr").toggleClass("is-expanded")}),a("#default-password-nag-no").click(function(){return setUserSetting("default_password_nag","hide"),a("div.default-password-nag").hide(),!1}),a("#newcontent").bind("keydown.wpevent_InsertTab",function(b){var c,d,e,f,g,h=b.target;if(27==b.keyCode)return b.preventDefault(),void a(h).data("tab-out",!0);if(!(9!=b.keyCode||b.ctrlKey||b.altKey||b.shiftKey)){if(a(h).data("tab-out"))return void a(h).data("tab-out",!1);c=h.selectionStart,d=h.selectionEnd,e=h.value,document.selection?(h.focus(),g=document.selection.createRange(),g.text="\t"):c>=0&&(f=this.scrollTop,h.value=e.substring(0,c).concat("\t",e.substring(d)),h.selectionStart=h.selectionEnd=c+1,this.scrollTop=f),b.stopPropagation&&b.stopPropagation(),b.preventDefault&&b.preventDefault()}}),z.length&&z.closest("form").submit(function(){a('select[name="action"]').val()==-1&&a('select[name="action2"]').val()==-1&&z.val()==A&&z.val("1")}),a('.search-box input[type="search"], .search-box input[type="submit"]').mousedown(function(){a('select[name^="action"]').val("-1")}),a("#contextual-help-link, #show-settings-link").on("focus.scroll-into-view",function(a){a.target.scrollIntoView&&a.target.scrollIntoView(!1)}),function(){function b(){c.prop("disabled",""===d.map(function(){return a(this).val()}).get().join(""))}var c,d,e=a("form.wp-upload-form");e.length&&(c=e.find('input[type="submit"]'),d=e.find('input[type="file"]'),b(),d.on("change",b))}(),B||(f.on("scroll.pin-menu",i),e.on("tinymce-editor-init.pin-menu",function(a,b){b.on("wp-autoresize",j)})),b.wpResponsive={init:function(){var c=this;e.on("wp-responsive-activate.wp-responsive",function(){c.activate()}).on("wp-responsive-deactivate.wp-responsive",function(){c.deactivate()}),a("#wp-admin-bar-menu-toggle a").attr("aria-expanded","false"),a("#wp-admin-bar-menu-toggle").on("click.wp-responsive",function(b){b.preventDefault(),M.find(".hover").removeClass("hover"),F.toggleClass("wp-responsive-open"),F.hasClass("wp-responsive-open")?(a(this).find("a").attr("aria-expanded","true"),a("#adminmenu a:first").focus()):a(this).find("a").attr("aria-expanded","false")}),G.on("click.wp-responsive","li.wp-has-submenu > a",function(b){G.data("wp-responsive")&&(a(this).parent("li").toggleClass("selected"),b.preventDefault())}),c.trigger(),e.on("wp-window-resized.wp-responsive",a.proxy(this.trigger,this)),f.on("load.wp-responsive",function(){var a=navigator.userAgent.indexOf("AppleWebKit/")>-1?f.width():b.innerWidth;a<=782&&c.disableSortables()})},activate:function(){l(),g.hasClass("auto-fold")||g.addClass("auto-fold"),G.data("wp-responsive",1),this.disableSortables()},deactivate:function(){l(),G.removeData("wp-responsive"),this.enableSortables()},trigger:function(){var a=n();a&&(a<=782?L||(e.trigger("wp-responsive-activate"),L=!0):L&&(e.trigger("wp-responsive-deactivate"),L=!1),a<=480?this.enableOverlay():this.disableOverlay())},enableOverlay:function(){0===H.length&&(H=a('<div id="wp-responsive-overlay"></div>').insertAfter("#wpcontent").hide().on("click.wp-responsive",function(){I.find(".menupop.hover").removeClass("hover"),a(this).hide()})),J.on("click.wp-responsive",function(){H.show()})},disableOverlay:function(){J.off("click.wp-responsive"),H.hide()},disableSortables:function(){if(K.length)try{K.sortable("disable")}catch(a){}},enableSortables:function(){if(K.length)try{K.sortable("enable")}catch(a){}}},a(document).ajaxComplete(function(){m()}),e.on("wp-window-resized.set-menu-state",o),e.on("wp-menu-state-set wp-collapse-menu",function(b,c){var d=a("#collapse-button"),e="true",f=commonL10n.collapseMenu;"folded"===c.state&&(e="false",f=commonL10n.expandMenu),d.attr({"aria-expanded":e,"aria-label":f})}),b.wpResponsive.init(),l(),o(),c(),h(),m(),e.on("wp-pin-menu wp-window-resized.pin-menu postboxes-columnchange.pin-menu postbox-toggled.pin-menu wp-collapse-menu.pin-menu wp-scroll-start.pin-menu",l),a(".wp-initial-focus").focus(),g.on("click",".js-update-details-toggle",function(){var b=a(this).closest(".js-update-details"),c=a("#"+b.data("update-details"));c.hasClass("update-details-moved")||c.insertAfter(b).addClass("update-details-moved"),c.toggle(),a(this).attr("aria-expanded",c.is(":visible"))})}),function(){function a(){e.trigger("wp-window-resized")}function c(){b.clearTimeout(d),d=b.setTimeout(a,200)}var d;f.on("resize.wp-fire-once",c)}(),function(){if("-ms-user-select"in document.documentElement.style&&navigator.userAgent.match(/IEMobile\/10\.0/)){var a=document.createElement("style");a.appendChild(document.createTextNode("@-ms-viewport{width:auto!important}")),document.getElementsByTagName("head")[0].appendChild(a)}}()}(jQuery,window); \ No newline at end of file
diff --git a/www/crm/wp-admin/js/custom-background.js b/www/crm/wp-admin/js/custom-background.js
new file mode 100644
index 00000000..a948e780
--- /dev/null
+++ b/www/crm/wp-admin/js/custom-background.js
@@ -0,0 +1,145 @@
+/**
+ * @output wp-admin/js/custom-background.js
+ */
+
+/* global ajaxurl */
+
+/**
+ * Registers all events for customizing the background.
+ *
+ * @since 3.0.0
+ *
+ * @requires jQuery
+ */
+(function($) {
+ $(document).ready(function() {
+ var frame,
+ bgImage = $( '#custom-background-image' );
+
+ /**
+ * Instantiates the WordPress color picker and binds the change and clear events.
+ *
+ * @since 3.5.0
+ *
+ * @returns {void}
+ */
+ $('#background-color').wpColorPicker({
+ change: function( event, ui ) {
+ bgImage.css('background-color', ui.color.toString());
+ },
+ clear: function() {
+ bgImage.css('background-color', '');
+ }
+ });
+
+ /**
+ * Alters the background size CSS property whenever the background size input has changed.
+ *
+ * @since 4.7.0
+ *
+ * @returns {void}
+ */
+ $( 'select[name="background-size"]' ).change( function() {
+ bgImage.css( 'background-size', $( this ).val() );
+ });
+
+ /**
+ * Alters the background position CSS property whenever the background position input has changed.
+ *
+ * @since 4.7.0
+ *
+ * @returns {void}
+ */
+ $( 'input[name="background-position"]' ).change( function() {
+ bgImage.css( 'background-position', $( this ).val() );
+ });
+
+ /**
+ * Alters the background repeat CSS property whenever the background repeat input has changed.
+ *
+ * @since 3.0.0
+ *
+ * @returns {void}
+ */
+ $( 'input[name="background-repeat"]' ).change( function() {
+ bgImage.css( 'background-repeat', $( this ).is( ':checked' ) ? 'repeat' : 'no-repeat' );
+ });
+
+ /**
+ * Alters the background attachment CSS property whenever the background attachment input has changed.
+ *
+ * @since 4.7.0
+ *
+ * @returns {void}
+ */
+ $( 'input[name="background-attachment"]' ).change( function() {
+ bgImage.css( 'background-attachment', $( this ).is( ':checked' ) ? 'scroll' : 'fixed' );
+ });
+
+ /**
+ * Binds the event for opening the WP Media dialog.
+ *
+ * @since 3.5.0
+ *
+ * @returns {void}
+ */
+ $('#choose-from-library-link').click( function( event ) {
+ var $el = $(this);
+
+ event.preventDefault();
+
+ // If the media frame already exists, reopen it.
+ if ( frame ) {
+ frame.open();
+ return;
+ }
+
+ // Create the media frame.
+ frame = wp.media.frames.customBackground = wp.media({
+ // Set the title of the modal.
+ title: $el.data('choose'),
+
+ // Tell the modal to show only images.
+ library: {
+ type: 'image'
+ },
+
+ // Customize the submit button.
+ button: {
+ // Set the text of the button.
+ text: $el.data('update'),
+ /*
+ * Tell the button not to close the modal, since we're
+ * going to refresh the page when the image is selected.
+ */
+ close: false
+ }
+ });
+
+ /**
+ * When an image is selected, run a callback.
+ *
+ * @since 3.5.0
+ *
+ * @returns {void}
+ */
+ frame.on( 'select', function() {
+ // Grab the selected attachment.
+ var attachment = frame.state().get('selection').first();
+
+ // Run an AJAX request to set the background image.
+ $.post( ajaxurl, {
+ action: 'set-background-image',
+ attachment_id: attachment.id,
+ size: 'full'
+ }).done( function() {
+ // When the request completes, reload the window.
+ window.location.reload();
+ });
+ });
+
+ // Finally, open the modal.
+ frame.open();
+ });
+ });
+})(jQuery);
diff --git a/www/crm/wp-admin/js/custom-background.min.js b/www/crm/wp-admin/js/custom-background.min.js
new file mode 100644
index 00000000..5e303882
--- /dev/null
+++ b/www/crm/wp-admin/js/custom-background.min.js
@@ -0,0 +1 @@
+!function(a){a(document).ready(function(){var b,c=a("#custom-background-image");a("#background-color").wpColorPicker({change:function(a,b){c.css("background-color",b.color.toString())},clear:function(){c.css("background-color","")}}),a('select[name="background-size"]').change(function(){c.css("background-size",a(this).val())}),a('input[name="background-position"]').change(function(){c.css("background-position",a(this).val())}),a('input[name="background-repeat"]').change(function(){c.css("background-repeat",a(this).is(":checked")?"repeat":"no-repeat")}),a('input[name="background-attachment"]').change(function(){c.css("background-attachment",a(this).is(":checked")?"scroll":"fixed")}),a("#choose-from-library-link").click(function(c){var d=a(this);return c.preventDefault(),b?void b.open():(b=wp.media.frames.customBackground=wp.media({title:d.data("choose"),library:{type:"image"},button:{text:d.data("update"),close:!1}}),b.on("select",function(){var c=b.state().get("selection").first();a.post(ajaxurl,{action:"set-background-image",attachment_id:c.id,size:"full"}).done(function(){window.location.reload()})}),void b.open())})})}(jQuery); \ No newline at end of file
diff --git a/www/crm/wp-admin/js/custom-header.js b/www/crm/wp-admin/js/custom-header.js
new file mode 100644
index 00000000..e00c70cd
--- /dev/null
+++ b/www/crm/wp-admin/js/custom-header.js
@@ -0,0 +1,88 @@
+/**
+ * @output wp-admin/js/custom-header.js
+ */
+
+/* global isRtl */
+
+/**
+ * Initializes the custom header selection page.
+ *
+ * @since 3.5.0
+ *
+ * @deprecated 4.1.0 The page this is used on is never linked to from the UI.
+ * Setting a custom header is completely handled by the Customizer.
+ */
+(function($) {
+ var frame;
+
+ $( function() {
+ // Fetch available headers.
+ var $headers = $('.available-headers');
+
+ // Apply jQuery.masonry once the images have loaded.
+ $headers.imagesLoaded( function() {
+ $headers.masonry({
+ itemSelector: '.default-header',
+ isRTL: !! ( 'undefined' != typeof isRtl && isRtl )
+ });
+ });
+
+ /**
+ * Opens the 'choose from library' frame and creates it if it doesn't exist.
+ *
+ * @since 3.5.0
+ * @deprecated 4.1.0
+ *
+ * @returns {void}
+ */
+ $('#choose-from-library-link').click( function( event ) {
+ var $el = $(this);
+ event.preventDefault();
+
+ // If the media frame already exists, reopen it.
+ if ( frame ) {
+ frame.open();
+ return;
+ }
+
+ // Create the media frame.
+ frame = wp.media.frames.customHeader = wp.media({
+ // Set the title of the modal.
+ title: $el.data('choose'),
+
+ // Tell the modal to show only images.
+ library: {
+ type: 'image'
+ },
+
+ // Customize the submit button.
+ button: {
+ // Set the text of the button.
+ text: $el.data('update'),
+ // Tell the button not to close the modal, since we're
+ // going to refresh the page when the image is selected.
+ close: false
+ }
+ });
+
+ /**
+ * Updates the window location to include the selected attachment.
+ *
+ * @since 3.5.0
+ * @deprecated 4.1.0
+ *
+ * @returns {void}
+ */
+ frame.on( 'select', function() {
+ // Grab the selected attachment.
+ var attachment = frame.state().get('selection').first(),
+ link = $el.data('updateLink');
+
+ // Tell the browser to navigate to the crop step.
+ window.location = link + '&file=' + attachment.id;
+ });
+
+ frame.open();
+ });
+ });
+}(jQuery));
diff --git a/www/crm/wp-admin/js/customize-controls.js b/www/crm/wp-admin/js/customize-controls.js
new file mode 100644
index 00000000..2edc498e
--- /dev/null
+++ b/www/crm/wp-admin/js/customize-controls.js
@@ -0,0 +1,9270 @@
+/**
+ * @output wp-admin/js/customize-controls.js
+ */
+
+/* global _wpCustomizeHeader, _wpCustomizeBackground, _wpMediaViewsL10n, MediaElementPlayer, console, confirm */
+(function( exports, $ ){
+ var Container, focus, normalizedTransitionendEventName, api = wp.customize;
+
+ api.OverlayNotification = api.Notification.extend(/** @lends wp.customize.OverlayNotification.prototype */{
+
+ /**
+ * Whether the notification should show a loading spinner.
+ *
+ * @since 4.9.0
+ * @var {boolean}
+ */
+ loading: false,
+
+ /**
+ * A notification that is displayed in a full-screen overlay.
+ *
+ * @constructs wp.customize.OverlayNotification
+ * @augments wp.customize.Notification
+ *
+ * @since 4.9.0
+ *
+ * @param {string} code - Code.
+ * @param {object} params - Params.
+ */
+ initialize: function( code, params ) {
+ var notification = this;
+ api.Notification.prototype.initialize.call( notification, code, params );
+ notification.containerClasses += ' notification-overlay';
+ if ( notification.loading ) {
+ notification.containerClasses += ' notification-loading';
+ }
+ },
+
+ /**
+ * Render notification.
+ *
+ * @since 4.9.0
+ *
+ * @return {jQuery} Notification container.
+ */
+ render: function() {
+ var li = api.Notification.prototype.render.call( this );
+ li.on( 'keydown', _.bind( this.handleEscape, this ) );
+ return li;
+ },
+
+ /**
+ * Stop propagation on escape key presses, but also dismiss notification if it is dismissible.
+ *
+ * @since 4.9.0
+ *
+ * @param {jQuery.Event} event - Event.
+ * @returns {void}
+ */
+ handleEscape: function( event ) {
+ var notification = this;
+ if ( 27 === event.which ) {
+ event.stopPropagation();
+ if ( notification.dismissible && notification.parent ) {
+ notification.parent.remove( notification.code );
+ }
+ }
+ }
+ });
+
+ api.Notifications = api.Values.extend(/** @lends wp.customize.Notifications.prototype */{
+
+ /**
+ * Whether the alternative style should be used.
+ *
+ * @since 4.9.0
+ * @type {boolean}
+ */
+ alt: false,
+
+ /**
+ * The default constructor for items of the collection.
+ *
+ * @since 4.9.0
+ * @type {object}
+ */
+ defaultConstructor: api.Notification,
+
+ /**
+ * A collection of observable notifications.
+ *
+ * @since 4.9.0
+ *
+ * @constructs wp.customize.Notifications
+ * @augments wp.customize.Values
+ *
+ * @param {object} options - Options.
+ * @param {jQuery} [options.container] - Container element for notifications. This can be injected later.
+ * @param {boolean} [options.alt] - Whether alternative style should be used when rendering notifications.
+ *
+ * @returns {void}
+ */
+ initialize: function( options ) {
+ var collection = this;
+
+ api.Values.prototype.initialize.call( collection, options );
+
+ _.bindAll( collection, 'constrainFocus' );
+
+ // Keep track of the order in which the notifications were added for sorting purposes.
+ collection._addedIncrement = 0;
+ collection._addedOrder = {};
+
+ // Trigger change event when notification is added or removed.
+ collection.bind( 'add', function( notification ) {
+ collection.trigger( 'change', notification );
+ });
+ collection.bind( 'removed', function( notification ) {
+ collection.trigger( 'change', notification );
+ });
+ },
+
+ /**
+ * Get the number of notifications added.
+ *
+ * @since 4.9.0
+ * @return {number} Count of notifications.
+ */
+ count: function() {
+ return _.size( this._value );
+ },
+
+ /**
+ * Add notification to the collection.
+ *
+ * @since 4.9.0
+ *
+ * @param {string|wp.customize.Notification} notification - Notification object to add. Alternatively code may be supplied, and in that case the second notificationObject argument must be supplied.
+ * @param {wp.customize.Notification} [notificationObject] - Notification to add when first argument is the code string.
+ * @returns {wp.customize.Notification} Added notification (or existing instance if it was already added).
+ */
+ add: function( notification, notificationObject ) {
+ var collection = this, code, instance;
+ if ( 'string' === typeof notification ) {
+ code = notification;
+ instance = notificationObject;
+ } else {
+ code = notification.code;
+ instance = notification;
+ }
+ if ( ! collection.has( code ) ) {
+ collection._addedIncrement += 1;
+ collection._addedOrder[ code ] = collection._addedIncrement;
+ }
+ return api.Values.prototype.add.call( collection, code, instance );
+ },
+
+ /**
+ * Add notification to the collection.
+ *
+ * @since 4.9.0
+ * @param {string} code - Notification code to remove.
+ * @return {api.Notification} Added instance (or existing instance if it was already added).
+ */
+ remove: function( code ) {
+ var collection = this;
+ delete collection._addedOrder[ code ];
+ return api.Values.prototype.remove.call( this, code );
+ },
+
+ /**
+ * Get list of notifications.
+ *
+ * Notifications may be sorted by type followed by added time.
+ *
+ * @since 4.9.0
+ * @param {object} args - Args.
+ * @param {boolean} [args.sort=false] - Whether to return the notifications sorted.
+ * @return {Array.<wp.customize.Notification>} Notifications.
+ */
+ get: function( args ) {
+ var collection = this, notifications, errorTypePriorities, params;
+ notifications = _.values( collection._value );
+
+ params = _.extend(
+ { sort: false },
+ args
+ );
+
+ if ( params.sort ) {
+ errorTypePriorities = { error: 4, warning: 3, success: 2, info: 1 };
+ notifications.sort( function( a, b ) {
+ var aPriority = 0, bPriority = 0;
+ if ( ! _.isUndefined( errorTypePriorities[ a.type ] ) ) {
+ aPriority = errorTypePriorities[ a.type ];
+ }
+ if ( ! _.isUndefined( errorTypePriorities[ b.type ] ) ) {
+ bPriority = errorTypePriorities[ b.type ];
+ }
+ if ( aPriority !== bPriority ) {
+ return bPriority - aPriority; // Show errors first.
+ }
+ return collection._addedOrder[ b.code ] - collection._addedOrder[ a.code ]; // Show newer notifications higher.
+ });
+ }
+
+ return notifications;
+ },
+
+ /**
+ * Render notifications area.
+ *
+ * @since 4.9.0
+ * @returns {void}
+ */
+ render: function() {
+ var collection = this,
+ notifications, hadOverlayNotification = false, hasOverlayNotification, overlayNotifications = [],
+ previousNotificationsByCode = {},
+ listElement, focusableElements;
+
+ // Short-circuit if there are no container to render into.
+ if ( ! collection.container || ! collection.container.length ) {
+ return;
+ }
+
+ notifications = collection.get( { sort: true } );
+ collection.container.toggle( 0 !== notifications.length );
+
+ // Short-circuit if there are no changes to the notifications.
+ if ( collection.container.is( collection.previousContainer ) && _.isEqual( notifications, collection.previousNotifications ) ) {
+ return;
+ }
+
+ // Make sure list is part of the container.
+ listElement = collection.container.children( 'ul' ).first();
+ if ( ! listElement.length ) {
+ listElement = $( '<ul></ul>' );
+ collection.container.append( listElement );
+ }
+
+ // Remove all notifications prior to re-rendering.
+ listElement.find( '> [data-code]' ).remove();
+
+ _.each( collection.previousNotifications, function( notification ) {
+ previousNotificationsByCode[ notification.code ] = notification;
+ });
+
+ // Add all notifications in the sorted order.
+ _.each( notifications, function( notification ) {
+ var notificationContainer;
+ if ( wp.a11y && ( ! previousNotificationsByCode[ notification.code ] || ! _.isEqual( notification.message, previousNotificationsByCode[ notification.code ].message ) ) ) {
+ wp.a11y.speak( notification.message, 'assertive' );
+ }
+ notificationContainer = $( notification.render() );
+ notification.container = notificationContainer;
+ listElement.append( notificationContainer ); // @todo Consider slideDown() as enhancement.
+
+ if ( notification.extended( api.OverlayNotification ) ) {
+ overlayNotifications.push( notification );
+ }
+ });
+ hasOverlayNotification = Boolean( overlayNotifications.length );
+
+ if ( collection.previousNotifications ) {
+ hadOverlayNotification = Boolean( _.find( collection.previousNotifications, function( notification ) {
+ return notification.extended( api.OverlayNotification );
+ } ) );
+ }
+
+ if ( hasOverlayNotification !== hadOverlayNotification ) {
+ $( document.body ).toggleClass( 'customize-loading', hasOverlayNotification );
+ collection.container.toggleClass( 'has-overlay-notifications', hasOverlayNotification );
+ if ( hasOverlayNotification ) {
+ collection.previousActiveElement = document.activeElement;
+ $( document ).on( 'keydown', collection.constrainFocus );
+ } else {
+ $( document ).off( 'keydown', collection.constrainFocus );
+ }
+ }
+
+ if ( hasOverlayNotification ) {
+ collection.focusContainer = overlayNotifications[ overlayNotifications.length - 1 ].container;
+ collection.focusContainer.prop( 'tabIndex', -1 );
+ focusableElements = collection.focusContainer.find( ':focusable' );
+ if ( focusableElements.length ) {
+ focusableElements.first().focus();
+ } else {
+ collection.focusContainer.focus();
+ }
+ } else if ( collection.previousActiveElement ) {
+ $( collection.previousActiveElement ).focus();
+ collection.previousActiveElement = null;
+ }
+
+ collection.previousNotifications = notifications;
+ collection.previousContainer = collection.container;
+ collection.trigger( 'rendered' );
+ },
+
+ /**
+ * Constrain focus on focus container.
+ *
+ * @since 4.9.0
+ *
+ * @param {jQuery.Event} event - Event.
+ * @returns {void}
+ */
+ constrainFocus: function constrainFocus( event ) {
+ var collection = this, focusableElements;
+
+ // Prevent keys from escaping.
+ event.stopPropagation();
+
+ if ( 9 !== event.which ) { // Tab key.
+ return;
+ }
+
+ focusableElements = collection.focusContainer.find( ':focusable' );
+ if ( 0 === focusableElements.length ) {
+ focusableElements = collection.focusContainer;
+ }
+
+ if ( ! $.contains( collection.focusContainer[0], event.target ) || ! $.contains( collection.focusContainer[0], document.activeElement ) ) {
+ event.preventDefault();
+ focusableElements.first().focus();
+ } else if ( focusableElements.last().is( event.target ) && ! event.shiftKey ) {
+ event.preventDefault();
+ focusableElements.first().focus();
+ } else if ( focusableElements.first().is( event.target ) && event.shiftKey ) {
+ event.preventDefault();
+ focusableElements.last().focus();
+ }
+ }
+ });
+
+ api.Setting = api.Value.extend(/** @lends wp.customize.Setting.prototype */{
+
+ /**
+ * Default params.
+ *
+ * @since 4.9.0
+ * @var {object}
+ */
+ defaults: {
+ transport: 'refresh',
+ dirty: false
+ },
+
+ /**
+ * A Customizer Setting.
+ *
+ * A setting is WordPress data (theme mod, option, menu, etc.) that the user can
+ * draft changes to in the Customizer.
+ *
+ * @see PHP class WP_Customize_Setting.
+ *
+ * @constructs wp.customize.Setting
+ * @augments wp.customize.Value
+ *
+ * @since 3.4.0
+ *
+ * @param {string} id - The setting ID.
+ * @param {*} value - The initial value of the setting.
+ * @param {object} [options={}] - Options.
+ * @param {string} [options.transport=refresh] - The transport to use for previewing. Supports 'refresh' and 'postMessage'.
+ * @param {boolean} [options.dirty=false] - Whether the setting should be considered initially dirty.
+ * @param {object} [options.previewer] - The Previewer instance to sync with. Defaults to wp.customize.previewer.
+ */
+ initialize: function( id, value, options ) {
+ var setting = this, params;
+ params = _.extend(
+ { previewer: api.previewer },
+ setting.defaults,
+ options || {}
+ );
+
+ api.Value.prototype.initialize.call( setting, value, params );
+
+ setting.id = id;
+ setting._dirty = params.dirty; // The _dirty property is what the Customizer reads from.
+ setting.notifications = new api.Notifications();
+
+ // Whenever the setting's value changes, refresh the preview.
+ setting.bind( setting.preview );
+ },
+
+ /**
+ * Refresh the preview, respective of the setting's refresh policy.
+ *
+ * If the preview hasn't sent a keep-alive message and is likely
+ * disconnected by having navigated to a non-allowed URL, then the
+ * refresh transport will be forced when postMessage is the transport.
+ * Note that postMessage does not throw an error when the recipient window
+ * fails to match the origin window, so using try/catch around the
+ * previewer.send() call to then fallback to refresh will not work.
+ *
+ * @since 3.4.0
+ * @access public
+ *
+ * @returns {void}
+ */
+ preview: function() {
+ var setting = this, transport;
+ transport = setting.transport;
+
+ if ( 'postMessage' === transport && ! api.state( 'previewerAlive' ).get() ) {
+ transport = 'refresh';
+ }
+
+ if ( 'postMessage' === transport ) {
+ setting.previewer.send( 'setting', [ setting.id, setting() ] );
+ } else if ( 'refresh' === transport ) {
+ setting.previewer.refresh();
+ }
+ },
+
+ /**
+ * Find controls associated with this setting.
+ *
+ * @since 4.6.0
+ * @returns {wp.customize.Control[]} Controls associated with setting.
+ */
+ findControls: function() {
+ var setting = this, controls = [];
+ api.control.each( function( control ) {
+ _.each( control.settings, function( controlSetting ) {
+ if ( controlSetting.id === setting.id ) {
+ controls.push( control );
+ }
+ } );
+ } );
+ return controls;
+ }
+ });
+
+ /**
+ * Current change count.
+ *
+ * @alias wp.customize._latestRevision
+ *
+ * @since 4.7.0
+ * @type {number}
+ * @protected
+ */
+ api._latestRevision = 0;
+
+ /**
+ * Last revision that was saved.
+ *
+ * @alias wp.customize._lastSavedRevision
+ *
+ * @since 4.7.0
+ * @type {number}
+ * @protected
+ */
+ api._lastSavedRevision = 0;
+
+ /**
+ * Latest revisions associated with the updated setting.
+ *
+ * @alias wp.customize._latestSettingRevisions
+ *
+ * @since 4.7.0
+ * @type {object}
+ * @protected
+ */
+ api._latestSettingRevisions = {};
+
+ /*
+ * Keep track of the revision associated with each updated setting so that
+ * requestChangesetUpdate knows which dirty settings to include. Also, once
+ * ready is triggered and all initial settings have been added, increment
+ * revision for each newly-created initially-dirty setting so that it will
+ * also be included in changeset update requests.
+ */
+ api.bind( 'change', function incrementChangedSettingRevision( setting ) {
+ api._latestRevision += 1;
+ api._latestSettingRevisions[ setting.id ] = api._latestRevision;
+ } );
+ api.bind( 'ready', function() {
+ api.bind( 'add', function incrementCreatedSettingRevision( setting ) {
+ if ( setting._dirty ) {
+ api._latestRevision += 1;
+ api._latestSettingRevisions[ setting.id ] = api._latestRevision;
+ }
+ } );
+ } );
+
+ /**
+ * Get the dirty setting values.
+ *
+ * @alias wp.customize.dirtyValues
+ *
+ * @since 4.7.0
+ * @access public
+ *
+ * @param {object} [options] Options.
+ * @param {boolean} [options.unsaved=false] Whether only values not saved yet into a changeset will be returned (differential changes).
+ * @returns {object} Dirty setting values.
+ */
+ api.dirtyValues = function dirtyValues( options ) {
+ var values = {};
+ api.each( function( setting ) {
+ var settingRevision;
+
+ if ( ! setting._dirty ) {
+ return;
+ }
+
+ settingRevision = api._latestSettingRevisions[ setting.id ];
+
+ // Skip including settings that have already been included in the changeset, if only requesting unsaved.
+ if ( api.state( 'changesetStatus' ).get() && ( options && options.unsaved ) && ( _.isUndefined( settingRevision ) || settingRevision <= api._lastSavedRevision ) ) {
+ return;
+ }
+
+ values[ setting.id ] = setting.get();
+ } );
+ return values;
+ };
+
+ /**
+ * Request updates to the changeset.
+ *
+ * @alias wp.customize.requestChangesetUpdate
+ *
+ * @since 4.7.0
+ * @access public
+ *
+ * @param {object} [changes] - Mapping of setting IDs to setting params each normally including a value property, or mapping to null.
+ * If not provided, then the changes will still be obtained from unsaved dirty settings.
+ * @param {object} [args] - Additional options for the save request.
+ * @param {boolean} [args.autosave=false] - Whether changes will be stored in autosave revision if the changeset has been promoted from an auto-draft.
+ * @param {boolean} [args.force=false] - Send request to update even when there are no changes to submit. This can be used to request the latest status of the changeset on the server.
+ * @param {string} [args.title] - Title to update in the changeset. Optional.
+ * @param {string} [args.date] - Date to update in the changeset. Optional.
+ * @returns {jQuery.Promise} Promise resolving with the response data.
+ */
+ api.requestChangesetUpdate = function requestChangesetUpdate( changes, args ) {
+ var deferred, request, submittedChanges = {}, data, submittedArgs;
+ deferred = new $.Deferred();
+
+ // Prevent attempting changeset update while request is being made.
+ if ( 0 !== api.state( 'processing' ).get() ) {
+ deferred.reject( 'already_processing' );
+ return deferred.promise();
+ }
+
+ submittedArgs = _.extend( {
+ title: null,
+ date: null,
+ autosave: false,
+ force: false
+ }, args );
+
+ if ( changes ) {
+ _.extend( submittedChanges, changes );
+ }
+
+ // Ensure all revised settings (changes pending save) are also included, but not if marked for deletion in changes.
+ _.each( api.dirtyValues( { unsaved: true } ), function( dirtyValue, settingId ) {
+ if ( ! changes || null !== changes[ settingId ] ) {
+ submittedChanges[ settingId ] = _.extend(
+ {},
+ submittedChanges[ settingId ] || {},
+ { value: dirtyValue }
+ );
+ }
+ } );
+
+ // Allow plugins to attach additional params to the settings.
+ api.trigger( 'changeset-save', submittedChanges, submittedArgs );
+
+ // Short-circuit when there are no pending changes.
+ if ( ! submittedArgs.force && _.isEmpty( submittedChanges ) && null === submittedArgs.title && null === submittedArgs.date ) {
+ deferred.resolve( {} );
+ return deferred.promise();
+ }
+
+ // A status would cause a revision to be made, and for this wp.customize.previewer.save() should be used. Status is also disallowed for revisions regardless.
+ if ( submittedArgs.status ) {
+ return deferred.reject( { code: 'illegal_status_in_changeset_update' } ).promise();
+ }
+
+ // Dates not beung allowed for revisions are is a technical limitation of post revisions.
+ if ( submittedArgs.date && submittedArgs.autosave ) {
+ return deferred.reject( { code: 'illegal_autosave_with_date_gmt' } ).promise();
+ }
+
+ // Make sure that publishing a changeset waits for all changeset update requests to complete.
+ api.state( 'processing' ).set( api.state( 'processing' ).get() + 1 );
+ deferred.always( function() {
+ api.state( 'processing' ).set( api.state( 'processing' ).get() - 1 );
+ } );
+
+ // Ensure that if any plugins add data to save requests by extending query() that they get included here.
+ data = api.previewer.query( { excludeCustomizedSaved: true } );
+ delete data.customized; // Being sent in customize_changeset_data instead.
+ _.extend( data, {
+ nonce: api.settings.nonce.save,
+ customize_theme: api.settings.theme.stylesheet,
+ customize_changeset_data: JSON.stringify( submittedChanges )
+ } );
+ if ( null !== submittedArgs.title ) {
+ data.customize_changeset_title = submittedArgs.title;
+ }
+ if ( null !== submittedArgs.date ) {
+ data.customize_changeset_date = submittedArgs.date;
+ }
+ if ( false !== submittedArgs.autosave ) {
+ data.customize_changeset_autosave = 'true';
+ }
+
+ // Allow plugins to modify the params included with the save request.
+ api.trigger( 'save-request-params', data );
+
+ request = wp.ajax.post( 'customize_save', data );
+
+ request.done( function requestChangesetUpdateDone( data ) {
+ var savedChangesetValues = {};
+
+ // Ensure that all settings updated subsequently will be included in the next changeset update request.
+ api._lastSavedRevision = Math.max( api._latestRevision, api._lastSavedRevision );
+
+ api.state( 'changesetStatus' ).set( data.changeset_status );
+
+ if ( data.changeset_date ) {
+ api.state( 'changesetDate' ).set( data.changeset_date );
+ }
+
+ deferred.resolve( data );
+ api.trigger( 'changeset-saved', data );
+
+ if ( data.setting_validities ) {
+ _.each( data.setting_validities, function( validity, settingId ) {
+ if ( true === validity && _.isObject( submittedChanges[ settingId ] ) && ! _.isUndefined( submittedChanges[ settingId ].value ) ) {
+ savedChangesetValues[ settingId ] = submittedChanges[ settingId ].value;
+ }
+ } );
+ }
+
+ api.previewer.send( 'changeset-saved', _.extend( {}, data, { saved_changeset_values: savedChangesetValues } ) );
+ } );
+ request.fail( function requestChangesetUpdateFail( data ) {
+ deferred.reject( data );
+ api.trigger( 'changeset-error', data );
+ } );
+ request.always( function( data ) {
+ if ( data.setting_validities ) {
+ api._handleSettingValidities( {
+ settingValidities: data.setting_validities
+ } );
+ }
+ } );
+
+ return deferred.promise();
+ };
+
+ /**
+ * Watch all changes to Value properties, and bubble changes to parent Values instance
+ *
+ * @alias wp.customize.utils.bubbleChildValueChanges
+ *
+ * @since 4.1.0
+ *
+ * @param {wp.customize.Class} instance
+ * @param {Array} properties The names of the Value instances to watch.
+ */
+ api.utils.bubbleChildValueChanges = function ( instance, properties ) {
+ $.each( properties, function ( i, key ) {
+ instance[ key ].bind( function ( to, from ) {
+ if ( instance.parent && to !== from ) {
+ instance.parent.trigger( 'change', instance );
+ }
+ } );
+ } );
+ };
+
+ /**
+ * Expand a panel, section, or control and focus on the first focusable element.
+ *
+ * @alias wp.customize~focus
+ *
+ * @since 4.1.0
+ *
+ * @param {Object} [params]
+ * @param {Function} [params.completeCallback]
+ */
+ focus = function ( params ) {
+ var construct, completeCallback, focus, focusElement;
+ construct = this;
+ params = params || {};
+ focus = function () {
+ var focusContainer;
+ if ( ( construct.extended( api.Panel ) || construct.extended( api.Section ) ) && construct.expanded && construct.expanded() ) {
+ focusContainer = construct.contentContainer;
+ } else {
+ focusContainer = construct.container;
+ }
+
+ focusElement = focusContainer.find( '.control-focus:first' );
+ if ( 0 === focusElement.length ) {
+ // Note that we can't use :focusable due to a jQuery UI issue. See: https://github.com/jquery/jquery-ui/pull/1583
+ focusElement = focusContainer.find( 'input, select, textarea, button, object, a[href], [tabindex]' ).filter( ':visible' ).first();
+ }
+ focusElement.focus();
+ };
+ if ( params.completeCallback ) {
+ completeCallback = params.completeCallback;
+ params.completeCallback = function () {
+ focus();
+ completeCallback();
+ };
+ } else {
+ params.completeCallback = focus;
+ }
+
+ api.state( 'paneVisible' ).set( true );
+ if ( construct.expand ) {
+ construct.expand( params );
+ } else {
+ params.completeCallback();
+ }
+ };
+
+ /**
+ * Stable sort for Panels, Sections, and Controls.
+ *
+ * If a.priority() === b.priority(), then sort by their respective params.instanceNumber.
+ *
+ * @alias wp.customize.utils.prioritySort
+ *
+ * @since 4.1.0
+ *
+ * @param {(wp.customize.Panel|wp.customize.Section|wp.customize.Control)} a
+ * @param {(wp.customize.Panel|wp.customize.Section|wp.customize.Control)} b
+ * @returns {Number}
+ */
+ api.utils.prioritySort = function ( a, b ) {
+ if ( a.priority() === b.priority() && typeof a.params.instanceNumber === 'number' && typeof b.params.instanceNumber === 'number' ) {
+ return a.params.instanceNumber - b.params.instanceNumber;
+ } else {
+ return a.priority() - b.priority();
+ }
+ };
+
+ /**
+ * Return whether the supplied Event object is for a keydown event but not the Enter key.
+ *
+ * @alias wp.customize.utils.isKeydownButNotEnterEvent
+ *
+ * @since 4.1.0
+ *
+ * @param {jQuery.Event} event
+ * @returns {boolean}
+ */
+ api.utils.isKeydownButNotEnterEvent = function ( event ) {
+ return ( 'keydown' === event.type && 13 !== event.which );
+ };
+
+ /**
+ * Return whether the two lists of elements are the same and are in the same order.
+ *
+ * @alias wp.customize.utils.areElementListsEqual
+ *
+ * @since 4.1.0
+ *
+ * @param {Array|jQuery} listA
+ * @param {Array|jQuery} listB
+ * @returns {boolean}
+ */
+ api.utils.areElementListsEqual = function ( listA, listB ) {
+ var equal = (
+ listA.length === listB.length && // if lists are different lengths, then naturally they are not equal
+ -1 === _.indexOf( _.map( // are there any false values in the list returned by map?
+ _.zip( listA, listB ), // pair up each element between the two lists
+ function ( pair ) {
+ return $( pair[0] ).is( pair[1] ); // compare to see if each pair are equal
+ }
+ ), false ) // check for presence of false in map's return value
+ );
+ return equal;
+ };
+
+ /**
+ * Highlight the existence of a button.
+ *
+ * This function reminds the user of a button represented by the specified
+ * UI element, after an optional delay. If the user focuses the element
+ * before the delay passes, the reminder is canceled.
+ *
+ * @alias wp.customize.utils.highlightButton
+ *
+ * @since 4.9.0
+ *
+ * @param {jQuery} button - The element to highlight.
+ * @param {object} [options] - Options.
+ * @param {number} [options.delay=0] - Delay in milliseconds.
+ * @param {jQuery} [options.focusTarget] - A target for user focus that defaults to the highlighted element.
+ * If the user focuses the target before the delay passes, the reminder
+ * is canceled. This option exists to accommodate compound buttons
+ * containing auxiliary UI, such as the Publish button augmented with a
+ * Settings button.
+ * @returns {Function} An idempotent function that cancels the reminder.
+ */
+ api.utils.highlightButton = function highlightButton( button, options ) {
+ var animationClass = 'button-see-me',
+ canceled = false,
+ params;
+
+ params = _.extend(
+ {
+ delay: 0,
+ focusTarget: button
+ },
+ options
+ );
+
+ function cancelReminder() {
+ canceled = true;
+ }
+
+ params.focusTarget.on( 'focusin', cancelReminder );
+ setTimeout( function() {
+ params.focusTarget.off( 'focusin', cancelReminder );
+
+ if ( ! canceled ) {
+ button.addClass( animationClass );
+ button.one( 'animationend', function() {
+ /*
+ * Remove animation class to avoid situations in Customizer where
+ * DOM nodes are moved (re-inserted) and the animation repeats.
+ */
+ button.removeClass( animationClass );
+ } );
+ }
+ }, params.delay );
+
+ return cancelReminder;
+ };
+
+ /**
+ * Get current timestamp adjusted for server clock time.
+ *
+ * Same functionality as the `current_time( 'mysql', false )` function in PHP.
+ *
+ * @alias wp.customize.utils.getCurrentTimestamp
+ *
+ * @since 4.9.0
+ *
+ * @returns {int} Current timestamp.
+ */
+ api.utils.getCurrentTimestamp = function getCurrentTimestamp() {
+ var currentDate, currentClientTimestamp, timestampDifferential;
+ currentClientTimestamp = _.now();
+ currentDate = new Date( api.settings.initialServerDate.replace( /-/g, '/' ) );
+ timestampDifferential = currentClientTimestamp - api.settings.initialClientTimestamp;
+ timestampDifferential += api.settings.initialClientTimestamp - api.settings.initialServerTimestamp;
+ currentDate.setTime( currentDate.getTime() + timestampDifferential );
+ return currentDate.getTime();
+ };
+
+ /**
+ * Get remaining time of when the date is set.
+ *
+ * @alias wp.customize.utils.getRemainingTime
+ *
+ * @since 4.9.0
+ *
+ * @param {string|int|Date} datetime - Date time or timestamp of the future date.
+ * @return {int} remainingTime - Remaining time in milliseconds.
+ */
+ api.utils.getRemainingTime = function getRemainingTime( datetime ) {
+ var millisecondsDivider = 1000, remainingTime, timestamp;
+ if ( datetime instanceof Date ) {
+ timestamp = datetime.getTime();
+ } else if ( 'string' === typeof datetime ) {
+ timestamp = ( new Date( datetime.replace( /-/g, '/' ) ) ).getTime();
+ } else {
+ timestamp = datetime;
+ }
+
+ remainingTime = timestamp - api.utils.getCurrentTimestamp();
+ remainingTime = Math.ceil( remainingTime / millisecondsDivider );
+ return remainingTime;
+ };
+
+ /**
+ * Return browser supported `transitionend` event name.
+ *
+ * @since 4.7.0
+ *
+ * @ignore
+ *
+ * @returns {string|null} Normalized `transitionend` event name or null if CSS transitions are not supported.
+ */
+ normalizedTransitionendEventName = (function () {
+ var el, transitions, prop;
+ el = document.createElement( 'div' );
+ transitions = {
+ 'transition' : 'transitionend',
+ 'OTransition' : 'oTransitionEnd',
+ 'MozTransition' : 'transitionend',
+ 'WebkitTransition': 'webkitTransitionEnd'
+ };
+ prop = _.find( _.keys( transitions ), function( prop ) {
+ return ! _.isUndefined( el.style[ prop ] );
+ } );
+ if ( prop ) {
+ return transitions[ prop ];
+ } else {
+ return null;
+ }
+ })();
+
+ Container = api.Class.extend(/** @lends wp.customize~Container.prototype */{
+ defaultActiveArguments: { duration: 'fast', completeCallback: $.noop },
+ defaultExpandedArguments: { duration: 'fast', completeCallback: $.noop },
+ containerType: 'container',
+ defaults: {
+ title: '',
+ description: '',
+ priority: 100,
+ type: 'default',
+ content: null,
+ active: true,
+ instanceNumber: null
+ },
+
+ /**
+ * Base class for Panel and Section.
+ *
+ * @constructs wp.customize~Container
+ * @augments wp.customize.Class
+ *
+ * @since 4.1.0
+ *
+ * @borrows wp.customize~focus as focus
+ *
+ * @param {string} id - The ID for the container.
+ * @param {object} options - Object containing one property: params.
+ * @param {string} options.title - Title shown when panel is collapsed and expanded.
+ * @param {string} [options.description] - Description shown at the top of the panel.
+ * @param {number} [options.priority=100] - The sort priority for the panel.
+ * @param {string} [options.templateId] - Template selector for container.
+ * @param {string} [options.type=default] - The type of the panel. See wp.customize.panelConstructor.
+ * @param {string} [options.content] - The markup to be used for the panel container. If empty, a JS template is used.
+ * @param {boolean} [options.active=true] - Whether the panel is active or not.
+ * @param {object} [options.params] - Deprecated wrapper for the above properties.
+ */
+ initialize: function ( id, options ) {
+ var container = this;
+ container.id = id;
+
+ if ( ! Container.instanceCounter ) {
+ Container.instanceCounter = 0;
+ }
+ Container.instanceCounter++;
+
+ $.extend( container, {
+ params: _.defaults(
+ options.params || options, // Passing the params is deprecated.
+ container.defaults
+ )
+ } );
+ if ( ! container.params.instanceNumber ) {
+ container.params.instanceNumber = Container.instanceCounter;
+ }
+ container.notifications = new api.Notifications();
+ container.templateSelector = container.params.templateId || 'customize-' + container.containerType + '-' + container.params.type;
+ container.container = $( container.params.content );
+ if ( 0 === container.container.length ) {
+ container.container = $( container.getContainer() );
+ }
+ container.headContainer = container.container;
+ container.contentContainer = container.getContent();
+ container.container = container.container.add( container.contentContainer );
+
+ container.deferred = {
+ embedded: new $.Deferred()
+ };
+ container.priority = new api.Value();
+ container.active = new api.Value();
+ container.activeArgumentsQueue = [];
+ container.expanded = new api.Value();
+ container.expandedArgumentsQueue = [];
+
+ container.active.bind( function ( active ) {
+ var args = container.activeArgumentsQueue.shift();
+ args = $.extend( {}, container.defaultActiveArguments, args );
+ active = ( active && container.isContextuallyActive() );
+ container.onChangeActive( active, args );
+ });
+ container.expanded.bind( function ( expanded ) {
+ var args = container.expandedArgumentsQueue.shift();
+ args = $.extend( {}, container.defaultExpandedArguments, args );
+ container.onChangeExpanded( expanded, args );
+ });
+
+ container.deferred.embedded.done( function () {
+ container.setupNotifications();
+ container.attachEvents();
+ });
+
+ api.utils.bubbleChildValueChanges( container, [ 'priority', 'active' ] );
+
+ container.priority.set( container.params.priority );
+ container.active.set( container.params.active );
+ container.expanded.set( false );
+ },
+
+ /**
+ * Get the element that will contain the notifications.
+ *
+ * @since 4.9.0
+ * @returns {jQuery} Notification container element.
+ */
+ getNotificationsContainerElement: function() {
+ var container = this;
+ return container.contentContainer.find( '.customize-control-notifications-container:first' );
+ },
+
+ /**
+ * Set up notifications.
+ *
+ * @since 4.9.0
+ * @returns {void}
+ */
+ setupNotifications: function() {
+ var container = this, renderNotifications;
+ container.notifications.container = container.getNotificationsContainerElement();
+
+ // Render notifications when they change and when the construct is expanded.
+ renderNotifications = function() {
+ if ( container.expanded.get() ) {
+ container.notifications.render();
+ }
+ };
+ container.expanded.bind( renderNotifications );
+ renderNotifications();
+ container.notifications.bind( 'change', _.debounce( renderNotifications ) );
+ },
+
+ /**
+ * @since 4.1.0
+ *
+ * @abstract
+ */
+ ready: function() {},
+
+ /**
+ * Get the child models associated with this parent, sorting them by their priority Value.
+ *
+ * @since 4.1.0
+ *
+ * @param {String} parentType
+ * @param {String} childType
+ * @returns {Array}
+ */
+ _children: function ( parentType, childType ) {
+ var parent = this,
+ children = [];
+ api[ childType ].each( function ( child ) {
+ if ( child[ parentType ].get() === parent.id ) {
+ children.push( child );
+ }
+ } );
+ children.sort( api.utils.prioritySort );
+ return children;
+ },
+
+ /**
+ * To override by subclass, to return whether the container has active children.
+ *
+ * @since 4.1.0
+ *
+ * @abstract
+ */
+ isContextuallyActive: function () {
+ throw new Error( 'Container.isContextuallyActive() must be overridden in a subclass.' );
+ },
+
+ /**
+ * Active state change handler.
+ *
+ * Shows the container if it is active, hides it if not.
+ *
+ * To override by subclass, update the container's UI to reflect the provided active state.
+ *
+ * @since 4.1.0
+ *
+ * @param {boolean} active - The active state to transiution to.
+ * @param {Object} [args] - Args.
+ * @param {Object} [args.duration] - The duration for the slideUp/slideDown animation.
+ * @param {boolean} [args.unchanged] - Whether the state is already known to not be changed, and so short-circuit with calling completeCallback early.
+ * @param {Function} [args.completeCallback] - Function to call when the slideUp/slideDown has completed.
+ */
+ onChangeActive: function( active, args ) {
+ var construct = this,
+ headContainer = construct.headContainer,
+ duration, expandedOtherPanel;
+
+ if ( args.unchanged ) {
+ if ( args.completeCallback ) {
+ args.completeCallback();
+ }
+ return;
+ }
+
+ duration = ( 'resolved' === api.previewer.deferred.active.state() ? args.duration : 0 );
+
+ if ( construct.extended( api.Panel ) ) {
+ // If this is a panel is not currently expanded but another panel is expanded, do not animate.
+ api.panel.each(function ( panel ) {
+ if ( panel !== construct && panel.expanded() ) {
+ expandedOtherPanel = panel;
+ duration = 0;
+ }
+ });
+
+ // Collapse any expanded sections inside of this panel first before deactivating.
+ if ( ! active ) {
+ _.each( construct.sections(), function( section ) {
+ section.collapse( { duration: 0 } );
+ } );
+ }
+ }
+
+ if ( ! $.contains( document, headContainer.get( 0 ) ) ) {
+ // If the element is not in the DOM, then jQuery.fn.slideUp() does nothing. In this case, a hard toggle is required instead.
+ headContainer.toggle( active );
+ if ( args.completeCallback ) {
+ args.completeCallback();
+ }
+ } else if ( active ) {
+ headContainer.slideDown( duration, args.completeCallback );
+ } else {
+ if ( construct.expanded() ) {
+ construct.collapse({
+ duration: duration,
+ completeCallback: function() {
+ headContainer.slideUp( duration, args.completeCallback );
+ }
+ });
+ } else {
+ headContainer.slideUp( duration, args.completeCallback );
+ }
+ }
+ },
+
+ /**
+ * @since 4.1.0
+ *
+ * @params {Boolean} active
+ * @param {Object} [params]
+ * @returns {Boolean} false if state already applied
+ */
+ _toggleActive: function ( active, params ) {
+ var self = this;
+ params = params || {};
+ if ( ( active && this.active.get() ) || ( ! active && ! this.active.get() ) ) {
+ params.unchanged = true;
+ self.onChangeActive( self.active.get(), params );
+ return false;
+ } else {
+ params.unchanged = false;
+ this.activeArgumentsQueue.push( params );
+ this.active.set( active );
+ return true;
+ }
+ },
+
+ /**
+ * @param {Object} [params]
+ * @returns {Boolean} false if already active
+ */
+ activate: function ( params ) {
+ return this._toggleActive( true, params );
+ },
+
+ /**
+ * @param {Object} [params]
+ * @returns {Boolean} false if already inactive
+ */
+ deactivate: function ( params ) {
+ return this._toggleActive( false, params );
+ },
+
+ /**
+ * To override by subclass, update the container's UI to reflect the provided active state.
+ * @abstract
+ */
+ onChangeExpanded: function () {
+ throw new Error( 'Must override with subclass.' );
+ },
+
+ /**
+ * Handle the toggle logic for expand/collapse.
+ *
+ * @param {Boolean} expanded - The new state to apply.
+ * @param {Object} [params] - Object containing options for expand/collapse.
+ * @param {Function} [params.completeCallback] - Function to call when expansion/collapse is complete.
+ * @returns {Boolean} false if state already applied or active state is false
+ */
+ _toggleExpanded: function( expanded, params ) {
+ var instance = this, previousCompleteCallback;
+ params = params || {};
+ previousCompleteCallback = params.completeCallback;
+
+ // Short-circuit expand() if the instance is not active.
+ if ( expanded && ! instance.active() ) {
+ return false;
+ }
+
+ api.state( 'paneVisible' ).set( true );
+ params.completeCallback = function() {
+ if ( previousCompleteCallback ) {
+ previousCompleteCallback.apply( instance, arguments );
+ }
+ if ( expanded ) {
+ instance.container.trigger( 'expanded' );
+ } else {
+ instance.container.trigger( 'collapsed' );
+ }
+ };
+ if ( ( expanded && instance.expanded.get() ) || ( ! expanded && ! instance.expanded.get() ) ) {
+ params.unchanged = true;
+ instance.onChangeExpanded( instance.expanded.get(), params );
+ return false;
+ } else {
+ params.unchanged = false;
+ instance.expandedArgumentsQueue.push( params );
+ instance.expanded.set( expanded );
+ return true;
+ }
+ },
+
+ /**
+ * @param {Object} [params]
+ * @returns {Boolean} false if already expanded or if inactive.
+ */
+ expand: function ( params ) {
+ return this._toggleExpanded( true, params );
+ },
+
+ /**
+ * @param {Object} [params]
+ * @returns {Boolean} false if already collapsed.
+ */
+ collapse: function ( params ) {
+ return this._toggleExpanded( false, params );
+ },
+
+ /**
+ * Animate container state change if transitions are supported by the browser.
+ *
+ * @since 4.7.0
+ * @private
+ *
+ * @param {function} completeCallback Function to be called after transition is completed.
+ * @returns {void}
+ */
+ _animateChangeExpanded: function( completeCallback ) {
+ // Return if CSS transitions are not supported.
+ if ( ! normalizedTransitionendEventName ) {
+ if ( completeCallback ) {
+ completeCallback();
+ }
+ return;
+ }
+
+ var construct = this,
+ content = construct.contentContainer,
+ overlay = content.closest( '.wp-full-overlay' ),
+ elements, transitionEndCallback, transitionParentPane;
+
+ // Determine set of elements that are affected by the animation.
+ elements = overlay.add( content );
+
+ if ( ! construct.panel || '' === construct.panel() ) {
+ transitionParentPane = true;
+ } else if ( api.panel( construct.panel() ).contentContainer.hasClass( 'skip-transition' ) ) {
+ transitionParentPane = true;
+ } else {
+ transitionParentPane = false;
+ }
+ if ( transitionParentPane ) {
+ elements = elements.add( '#customize-info, .customize-pane-parent' );
+ }
+
+ // Handle `transitionEnd` event.
+ transitionEndCallback = function( e ) {
+ if ( 2 !== e.eventPhase || ! $( e.target ).is( content ) ) {
+ return;
+ }
+ content.off( normalizedTransitionendEventName, transitionEndCallback );
+ elements.removeClass( 'busy' );
+ if ( completeCallback ) {
+ completeCallback();
+ }
+ };
+ content.on( normalizedTransitionendEventName, transitionEndCallback );
+ elements.addClass( 'busy' );
+
+ // Prevent screen flicker when pane has been scrolled before expanding.
+ _.defer( function() {
+ var container = content.closest( '.wp-full-overlay-sidebar-content' ),
+ currentScrollTop = container.scrollTop(),
+ previousScrollTop = content.data( 'previous-scrollTop' ) || 0,
+ expanded = construct.expanded();
+
+ if ( expanded && 0 < currentScrollTop ) {
+ content.css( 'top', currentScrollTop + 'px' );
+ content.data( 'previous-scrollTop', currentScrollTop );
+ } else if ( ! expanded && 0 < currentScrollTop + previousScrollTop ) {
+ content.css( 'top', previousScrollTop - currentScrollTop + 'px' );
+ container.scrollTop( previousScrollTop );
+ }
+ } );
+ },
+
+ /*
+ * is documented using @borrows in the constructor.
+ */
+ focus: focus,
+
+ /**
+ * Return the container html, generated from its JS template, if it exists.
+ *
+ * @since 4.3.0
+ */
+ getContainer: function () {
+ var template,
+ container = this;
+
+ if ( 0 !== $( '#tmpl-' + container.templateSelector ).length ) {
+ template = wp.template( container.templateSelector );
+ } else {
+ template = wp.template( 'customize-' + container.containerType + '-default' );
+ }
+ if ( template && container.container ) {
+ return $.trim( template( _.extend(
+ { id: container.id },
+ container.params
+ ) ) );
+ }
+
+ return '<li></li>';
+ },
+
+ /**
+ * Find content element which is displayed when the section is expanded.
+ *
+ * After a construct is initialized, the return value will be available via the `contentContainer` property.
+ * By default the element will be related it to the parent container with `aria-owns` and detached.
+ * Custom panels and sections (such as the `NewMenuSection`) that do not have a sliding pane should
+ * just return the content element without needing to add the `aria-owns` element or detach it from
+ * the container. Such non-sliding pane custom sections also need to override the `onChangeExpanded`
+ * method to handle animating the panel/section into and out of view.
+ *
+ * @since 4.7.0
+ * @access public
+ *
+ * @returns {jQuery} Detached content element.
+ */
+ getContent: function() {
+ var construct = this,
+ container = construct.container,
+ content = container.find( '.accordion-section-content, .control-panel-content' ).first(),
+ contentId = 'sub-' + container.attr( 'id' ),
+ ownedElements = contentId,
+ alreadyOwnedElements = container.attr( 'aria-owns' );
+
+ if ( alreadyOwnedElements ) {
+ ownedElements = ownedElements + ' ' + alreadyOwnedElements;
+ }
+ container.attr( 'aria-owns', ownedElements );
+
+ return content.detach().attr( {
+ 'id': contentId,
+ 'class': 'customize-pane-child ' + content.attr( 'class' ) + ' ' + container.attr( 'class' )
+ } );
+ }
+ });
+
+ api.Section = Container.extend(/** @lends wp.customize.Section.prototype */{
+ containerType: 'section',
+ containerParent: '#customize-theme-controls',
+ containerPaneParent: '.customize-pane-parent',
+ defaults: {
+ title: '',
+ description: '',
+ priority: 100,
+ type: 'default',
+ content: null,
+ active: true,
+ instanceNumber: null,
+ panel: null,
+ customizeAction: ''
+ },
+
+ /**
+ * @constructs wp.customize.Section
+ * @augments wp.customize~Container
+ *
+ * @since 4.1.0
+ *
+ * @param {string} id - The ID for the section.
+ * @param {object} options - Options.
+ * @param {string} options.title - Title shown when section is collapsed and expanded.
+ * @param {string} [options.description] - Description shown at the top of the section.
+ * @param {number} [options.priority=100] - The sort priority for the section.
+ * @param {string} [options.type=default] - The type of the section. See wp.customize.sectionConstructor.
+ * @param {string} [options.content] - The markup to be used for the section container. If empty, a JS template is used.
+ * @param {boolean} [options.active=true] - Whether the section is active or not.
+ * @param {string} options.panel - The ID for the panel this section is associated with.
+ * @param {string} [options.customizeAction] - Additional context information shown before the section title when expanded.
+ * @param {object} [options.params] - Deprecated wrapper for the above properties.
+ */
+ initialize: function ( id, options ) {
+ var section = this, params;
+ params = options.params || options;
+
+ // Look up the type if one was not supplied.
+ if ( ! params.type ) {
+ _.find( api.sectionConstructor, function( Constructor, type ) {
+ if ( Constructor === section.constructor ) {
+ params.type = type;
+ return true;
+ }
+ return false;
+ } );
+ }
+
+ Container.prototype.initialize.call( section, id, params );
+
+ section.id = id;
+ section.panel = new api.Value();
+ section.panel.bind( function ( id ) {
+ $( section.headContainer ).toggleClass( 'control-subsection', !! id );
+ });
+ section.panel.set( section.params.panel || '' );
+ api.utils.bubbleChildValueChanges( section, [ 'panel' ] );
+
+ section.embed();
+ section.deferred.embedded.done( function () {
+ section.ready();
+ });
+ },
+
+ /**
+ * Embed the container in the DOM when any parent panel is ready.
+ *
+ * @since 4.1.0
+ */
+ embed: function () {
+ var inject,
+ section = this;
+
+ section.containerParent = api.ensure( section.containerParent );
+
+ // Watch for changes to the panel state.
+ inject = function ( panelId ) {
+ var parentContainer;
+ if ( panelId ) {
+ // The panel has been supplied, so wait until the panel object is registered.
+ api.panel( panelId, function ( panel ) {
+ // The panel has been registered, wait for it to become ready/initialized.
+ panel.deferred.embedded.done( function () {
+ parentContainer = panel.contentContainer;
+ if ( ! section.headContainer.parent().is( parentContainer ) ) {
+ parentContainer.append( section.headContainer );
+ }
+ if ( ! section.contentContainer.parent().is( section.headContainer ) ) {
+ section.containerParent.append( section.contentContainer );
+ }
+ section.deferred.embedded.resolve();
+ });
+ } );
+ } else {
+ // There is no panel, so embed the section in the root of the customizer
+ parentContainer = api.ensure( section.containerPaneParent );
+ if ( ! section.headContainer.parent().is( parentContainer ) ) {
+ parentContainer.append( section.headContainer );
+ }
+ if ( ! section.contentContainer.parent().is( section.headContainer ) ) {
+ section.containerParent.append( section.contentContainer );
+ }
+ section.deferred.embedded.resolve();
+ }
+ };
+ section.panel.bind( inject );
+ inject( section.panel.get() ); // Since a section may never get a panel, assume that it won't ever get one.
+ },
+
+ /**
+ * Add behaviors for the accordion section.
+ *
+ * @since 4.1.0
+ */
+ attachEvents: function () {
+ var meta, content, section = this;
+
+ if ( section.container.hasClass( 'cannot-expand' ) ) {
+ return;
+ }
+
+ // Expand/Collapse accordion sections on click.
+ section.container.find( '.accordion-section-title, .customize-section-back' ).on( 'click keydown', function( event ) {
+ if ( api.utils.isKeydownButNotEnterEvent( event ) ) {
+ return;
+ }
+ event.preventDefault(); // Keep this AFTER the key filter above
+
+ if ( section.expanded() ) {
+ section.collapse();
+ } else {
+ section.expand();
+ }
+ });
+
+ // This is very similar to what is found for api.Panel.attachEvents().
+ section.container.find( '.customize-section-title .customize-help-toggle' ).on( 'click', function() {
+
+ meta = section.container.find( '.section-meta' );
+ if ( meta.hasClass( 'cannot-expand' ) ) {
+ return;
+ }
+ content = meta.find( '.customize-section-description:first' );
+ content.toggleClass( 'open' );
+ content.slideToggle( section.defaultExpandedArguments.duration, function() {
+ content.trigger( 'toggled' );
+ } );
+ $( this ).attr( 'aria-expanded', function( i, attr ) {
+ return 'true' === attr ? 'false' : 'true';
+ });
+ });
+ },
+
+ /**
+ * Return whether this section has any active controls.
+ *
+ * @since 4.1.0
+ *
+ * @returns {Boolean}
+ */
+ isContextuallyActive: function () {
+ var section = this,
+ controls = section.controls(),
+ activeCount = 0;
+ _( controls ).each( function ( control ) {
+ if ( control.active() ) {
+ activeCount += 1;
+ }
+ } );
+ return ( activeCount !== 0 );
+ },
+
+ /**
+ * Get the controls that are associated with this section, sorted by their priority Value.
+ *
+ * @since 4.1.0
+ *
+ * @returns {Array}
+ */
+ controls: function () {
+ return this._children( 'section', 'control' );
+ },
+
+ /**
+ * Update UI to reflect expanded state.
+ *
+ * @since 4.1.0
+ *
+ * @param {Boolean} expanded
+ * @param {Object} args
+ */
+ onChangeExpanded: function ( expanded, args ) {
+ var section = this,
+ container = section.headContainer.closest( '.wp-full-overlay-sidebar-content' ),
+ content = section.contentContainer,
+ overlay = section.headContainer.closest( '.wp-full-overlay' ),
+ backBtn = content.find( '.customize-section-back' ),
+ sectionTitle = section.headContainer.find( '.accordion-section-title' ).first(),
+ expand, panel;
+
+ if ( expanded && ! content.hasClass( 'open' ) ) {
+
+ if ( args.unchanged ) {
+ expand = args.completeCallback;
+ } else {
+ expand = $.proxy( function() {
+ section._animateChangeExpanded( function() {
+ sectionTitle.attr( 'tabindex', '-1' );
+ backBtn.attr( 'tabindex', '0' );
+
+ backBtn.focus();
+ content.css( 'top', '' );
+ container.scrollTop( 0 );
+
+ if ( args.completeCallback ) {
+ args.completeCallback();
+ }
+ } );
+
+ content.addClass( 'open' );
+ overlay.addClass( 'section-open' );
+ api.state( 'expandedSection' ).set( section );
+ }, this );
+ }
+
+ if ( ! args.allowMultiple ) {
+ api.section.each( function ( otherSection ) {
+ if ( otherSection !== section ) {
+ otherSection.collapse( { duration: args.duration } );
+ }
+ });
+ }
+
+ if ( section.panel() ) {
+ api.panel( section.panel() ).expand({
+ duration: args.duration,
+ completeCallback: expand
+ });
+ } else {
+ if ( ! args.allowMultiple ) {
+ api.panel.each( function( panel ) {
+ panel.collapse();
+ });
+ }
+ expand();
+ }
+
+ } else if ( ! expanded && content.hasClass( 'open' ) ) {
+ if ( section.panel() ) {
+ panel = api.panel( section.panel() );
+ if ( panel.contentContainer.hasClass( 'skip-transition' ) ) {
+ panel.collapse();
+ }
+ }
+ section._animateChangeExpanded( function() {
+ backBtn.attr( 'tabindex', '-1' );
+ sectionTitle.attr( 'tabindex', '0' );
+
+ sectionTitle.focus();
+ content.css( 'top', '' );
+
+ if ( args.completeCallback ) {
+ args.completeCallback();
+ }
+ } );
+
+ content.removeClass( 'open' );
+ overlay.removeClass( 'section-open' );
+ if ( section === api.state( 'expandedSection' ).get() ) {
+ api.state( 'expandedSection' ).set( false );
+ }
+
+ } else {
+ if ( args.completeCallback ) {
+ args.completeCallback();
+ }
+ }
+ }
+ });
+
+ api.ThemesSection = api.Section.extend(/** @lends wp.customize.ThemesSection.prototype */{
+ currentTheme: '',
+ overlay: '',
+ template: '',
+ screenshotQueue: null,
+ $window: null,
+ $body: null,
+ loaded: 0,
+ loading: false,
+ fullyLoaded: false,
+ term: '',
+ tags: '',
+ nextTerm: '',
+ nextTags: '',
+ filtersHeight: 0,
+ headerContainer: null,
+ updateCountDebounced: null,
+
+ /**
+ * wp.customize.ThemesSection
+ *
+ * Custom section for themes that loads themes by category, and also
+ * handles the theme-details view rendering and navigation.
+ *
+ * @constructs wp.customize.ThemesSection
+ * @augments wp.customize.Section
+ *
+ * @since 4.9.0
+ *
+ * @param {string} id - ID.
+ * @param {object} options - Options.
+ * @returns {void}
+ */
+ initialize: function( id, options ) {
+ var section = this;
+ section.headerContainer = $();
+ section.$window = $( window );
+ section.$body = $( document.body );
+ api.Section.prototype.initialize.call( section, id, options );
+ section.updateCountDebounced = _.debounce( section.updateCount, 500 );
+ },
+
+ /**
+ * Embed the section in the DOM when the themes panel is ready.
+ *
+ * Insert the section before the themes container. Assume that a themes section is within a panel, but not necessarily the themes panel.
+ *
+ * @since 4.9.0
+ */
+ embed: function() {
+ var inject,
+ section = this;
+
+ // Watch for changes to the panel state
+ inject = function( panelId ) {
+ var parentContainer;
+ api.panel( panelId, function( panel ) {
+
+ // The panel has been registered, wait for it to become ready/initialized
+ panel.deferred.embedded.done( function() {
+ parentContainer = panel.contentContainer;
+ if ( ! section.headContainer.parent().is( parentContainer ) ) {
+ parentContainer.find( '.customize-themes-full-container-container' ).before( section.headContainer );
+ }
+ if ( ! section.contentContainer.parent().is( section.headContainer ) ) {
+ section.containerParent.append( section.contentContainer );
+ }
+ section.deferred.embedded.resolve();
+ });
+ } );
+ };
+ section.panel.bind( inject );
+ inject( section.panel.get() ); // Since a section may never get a panel, assume that it won't ever get one
+ },
+
+ /**
+ * Set up.
+ *
+ * @since 4.2.0
+ *
+ * @returns {void}
+ */
+ ready: function() {
+ var section = this;
+ section.overlay = section.container.find( '.theme-overlay' );
+ section.template = wp.template( 'customize-themes-details-view' );
+
+ // Bind global keyboard events.
+ section.container.on( 'keydown', function( event ) {
+ if ( ! section.overlay.find( '.theme-wrap' ).is( ':visible' ) ) {
+ return;
+ }
+
+ // Pressing the right arrow key fires a theme:next event
+ if ( 39 === event.keyCode ) {
+ section.nextTheme();
+ }
+
+ // Pressing the left arrow key fires a theme:previous event
+ if ( 37 === event.keyCode ) {
+ section.previousTheme();
+ }
+
+ // Pressing the escape key fires a theme:collapse event
+ if ( 27 === event.keyCode ) {
+ if ( section.$body.hasClass( 'modal-open' ) ) {
+
+ // Escape from the details modal.
+ section.closeDetails();
+ } else {
+
+ // Escape from the inifinite scroll list.
+ section.headerContainer.find( '.customize-themes-section-title' ).focus();
+ }
+ event.stopPropagation(); // Prevent section from being collapsed.
+ }
+ });
+
+ section.renderScreenshots = _.throttle( section.renderScreenshots, 100 );
+
+ _.bindAll( section, 'renderScreenshots', 'loadMore', 'checkTerm', 'filtersChecked' );
+ },
+
+ /**
+ * Override Section.isContextuallyActive method.
+ *
+ * Ignore the active states' of the contained theme controls, and just
+ * use the section's own active state instead. This prevents empty search
+ * results for theme sections from causing the section to become inactive.
+ *
+ * @since 4.2.0
+ *
+ * @returns {Boolean}
+ */
+ isContextuallyActive: function () {
+ return this.active();
+ },
+
+ /**
+ * Attach events.
+ *
+ * @since 4.2.0
+ *
+ * @returns {void}
+ */
+ attachEvents: function () {
+ var section = this, debounced;
+
+ // Expand/Collapse accordion sections on click.
+ section.container.find( '.customize-section-back' ).on( 'click keydown', function( event ) {
+ if ( api.utils.isKeydownButNotEnterEvent( event ) ) {
+ return;
+ }
+ event.preventDefault(); // Keep this AFTER the key filter above
+ section.collapse();
+ });
+
+ section.headerContainer = $( '#accordion-section-' + section.id );
+
+ // Expand section/panel. Only collapse when opening another section.
+ section.headerContainer.on( 'click', '.customize-themes-section-title', function() {
+
+ // Toggle accordion filters under section headers.
+ if ( section.headerContainer.find( '.filter-details' ).length ) {
+ section.headerContainer.find( '.customize-themes-section-title' )
+ .toggleClass( 'details-open' )
+ .attr( 'aria-expanded', function( i, attr ) {
+ return 'true' === attr ? 'false' : 'true';
+ });
+ section.headerContainer.find( '.filter-details' ).slideToggle( 180 );
+ }
+
+ // Open the section.
+ if ( ! section.expanded() ) {
+ section.expand();
+ }
+ });
+
+ // Preview installed themes.
+ section.container.on( 'click', '.theme-actions .preview-theme', function() {
+ api.panel( 'themes' ).loadThemePreview( $( this ).data( 'slug' ) );
+ });
+
+ // Theme navigation in details view.
+ section.container.on( 'click', '.left', function() {
+ section.previousTheme();
+ });
+
+ section.container.on( 'click', '.right', function() {
+ section.nextTheme();
+ });
+
+ section.container.on( 'click', '.theme-backdrop, .close', function() {
+ section.closeDetails();
+ });
+
+ if ( 'local' === section.params.filter_type ) {
+
+ // Filter-search all theme objects loaded in the section.
+ section.container.on( 'input', '.wp-filter-search-themes', function( event ) {
+ section.filterSearch( event.currentTarget.value );
+ });
+
+ } else if ( 'remote' === section.params.filter_type ) {
+
+ // Event listeners for remote queries with user-entered terms.
+ // Search terms.
+ debounced = _.debounce( section.checkTerm, 500 ); // Wait until there is no input for 500 milliseconds to initiate a search.
+ section.contentContainer.on( 'input', '.wp-filter-search', function() {
+ if ( ! api.panel( 'themes' ).expanded() ) {
+ return;
+ }
+ debounced( section );
+ if ( ! section.expanded() ) {
+ section.expand();
+ }
+ });
+
+ // Feature filters.
+ section.contentContainer.on( 'click', '.filter-group input', function() {
+ section.filtersChecked();
+ section.checkTerm( section );
+ });
+ }
+
+ // Toggle feature filters.
+ section.contentContainer.on( 'click', '.feature-filter-toggle', function( e ) {
+ var $themeContainer = $( '.customize-themes-full-container' ),
+ $filterToggle = $( e.currentTarget );
+ section.filtersHeight = $filterToggle.parent().next( '.filter-drawer' ).height();
+
+ if ( 0 < $themeContainer.scrollTop() ) {
+ $themeContainer.animate( { scrollTop: 0 }, 400 );
+
+ if ( $filterToggle.hasClass( 'open' ) ) {
+ return;
+ }
+ }
+
+ $filterToggle
+ .toggleClass( 'open' )
+ .attr( 'aria-expanded', function( i, attr ) {
+ return 'true' === attr ? 'false' : 'true';
+ })
+ .parent().next( '.filter-drawer' ).slideToggle( 180, 'linear' );
+
+ if ( $filterToggle.hasClass( 'open' ) ) {
+ var marginOffset = 1018 < window.innerWidth ? 50 : 76;
+
+ section.contentContainer.find( '.themes' ).css( 'margin-top', section.filtersHeight + marginOffset );
+ } else {
+ section.contentContainer.find( '.themes' ).css( 'margin-top', 0 );
+ }
+ });
+
+ // Setup section cross-linking.
+ section.contentContainer.on( 'click', '.no-themes-local .search-dotorg-themes', function() {
+ api.section( 'wporg_themes' ).focus();
+ });
+
+ function updateSelectedState() {
+ var el = section.headerContainer.find( '.customize-themes-section-title' );
+ el.toggleClass( 'selected', section.expanded() );
+ el.attr( 'aria-expanded', section.expanded() ? 'true' : 'false' );
+ if ( ! section.expanded() ) {
+ el.removeClass( 'details-open' );
+ }
+ }
+ section.expanded.bind( updateSelectedState );
+ updateSelectedState();
+
+ // Move section controls to the themes area.
+ api.bind( 'ready', function () {
+ section.contentContainer = section.container.find( '.customize-themes-section' );
+ section.contentContainer.appendTo( $( '.customize-themes-full-container' ) );
+ section.container.add( section.headerContainer );
+ });
+ },
+
+ /**
+ * Update UI to reflect expanded state
+ *
+ * @since 4.2.0
+ *
+ * @param {Boolean} expanded
+ * @param {Object} args
+ * @param {Boolean} args.unchanged
+ * @param {Function} args.completeCallback
+ * @returns {void}
+ */
+ onChangeExpanded: function ( expanded, args ) {
+
+ // Note: there is a second argument 'args' passed
+ var section = this,
+ container = section.contentContainer.closest( '.customize-themes-full-container' );
+
+ // Immediately call the complete callback if there were no changes
+ if ( args.unchanged ) {
+ if ( args.completeCallback ) {
+ args.completeCallback();
+ }
+ return;
+ }
+
+ function expand() {
+
+ // Try to load controls if none are loaded yet.
+ if ( 0 === section.loaded ) {
+ section.loadThemes();
+ }
+
+ // Collapse any sibling sections/panels
+ api.section.each( function ( otherSection ) {
+ var searchTerm;
+
+ if ( otherSection !== section ) {
+
+ // Try to sync the current search term to the new section.
+ if ( 'themes' === otherSection.params.type ) {
+ searchTerm = otherSection.contentContainer.find( '.wp-filter-search' ).val();
+ section.contentContainer.find( '.wp-filter-search' ).val( searchTerm );
+
+ // Directly initialize an empty remote search to avoid a race condition.
+ if ( '' === searchTerm && '' !== section.term && 'local' !== section.params.filter_type ) {
+ section.term = '';
+ section.initializeNewQuery( section.term, section.tags );
+ } else {
+ if ( 'remote' === section.params.filter_type ) {
+ section.checkTerm( section );
+ } else if ( 'local' === section.params.filter_type ) {
+ section.filterSearch( searchTerm );
+ }
+ }
+ otherSection.collapse( { duration: args.duration } );
+ }
+ }
+ });
+
+ section.contentContainer.addClass( 'current-section' );
+ container.scrollTop();
+
+ container.on( 'scroll', _.throttle( section.renderScreenshots, 300 ) );
+ container.on( 'scroll', _.throttle( section.loadMore, 300 ) );
+
+ if ( args.completeCallback ) {
+ args.completeCallback();
+ }
+ section.updateCount(); // Show this section's count.
+ }
+
+ if ( expanded ) {
+ if ( section.panel() && api.panel.has( section.panel() ) ) {
+ api.panel( section.panel() ).expand({
+ duration: args.duration,
+ completeCallback: expand
+ });
+ } else {
+ expand();
+ }
+ } else {
+ section.contentContainer.removeClass( 'current-section' );
+
+ // Always hide, even if they don't exist or are already hidden.
+ section.headerContainer.find( '.filter-details' ).slideUp( 180 );
+
+ container.off( 'scroll' );
+
+ if ( args.completeCallback ) {
+ args.completeCallback();
+ }
+ }
+ },
+
+ /**
+ * Return the section's content element without detaching from the parent.
+ *
+ * @since 4.9.0
+ *
+ * @returns {jQuery}
+ */
+ getContent: function() {
+ return this.container.find( '.control-section-content' );
+ },
+
+ /**
+ * Load theme data via Ajax and add themes to the section as controls.
+ *
+ * @since 4.9.0
+ *
+ * @returns {void}
+ */
+ loadThemes: function() {
+ var section = this, params, page, request;
+
+ if ( section.loading ) {
+ return; // We're already loading a batch of themes.
+ }
+
+ // Parameters for every API query. Additional params are set in PHP.
+ page = Math.ceil( section.loaded / 100 ) + 1;
+ params = {
+ 'nonce': api.settings.nonce.switch_themes,
+ 'wp_customize': 'on',
+ 'theme_action': section.params.action,
+ 'customized_theme': api.settings.theme.stylesheet,
+ 'page': page
+ };
+
+ // Add fields for remote filtering.
+ if ( 'remote' === section.params.filter_type ) {
+ params.search = section.term;
+ params.tags = section.tags;
+ }
+
+ // Load themes.
+ section.headContainer.closest( '.wp-full-overlay' ).addClass( 'loading' );
+ section.loading = true;
+ section.container.find( '.no-themes' ).hide();
+ request = wp.ajax.post( 'customize_load_themes', params );
+ request.done(function( data ) {
+ var themes = data.themes;
+
+ // Stop and try again if the term changed while loading.
+ if ( '' !== section.nextTerm || '' !== section.nextTags ) {
+ if ( section.nextTerm ) {
+ section.term = section.nextTerm;
+ }
+ if ( section.nextTags ) {
+ section.tags = section.nextTags;
+ }
+ section.nextTerm = '';
+ section.nextTags = '';
+ section.loading = false;
+ section.loadThemes();
+ return;
+ }
+
+ if ( 0 !== themes.length ) {
+
+ section.loadControls( themes, page );
+
+ if ( 1 === page ) {
+
+ // Pre-load the first 3 theme screenshots.
+ _.each( section.controls().slice( 0, 3 ), function( control ) {
+ var img, src = control.params.theme.screenshot[0];
+ if ( src ) {
+ img = new Image();
+ img.src = src;
+ }
+ });
+ if ( 'local' !== section.params.filter_type ) {
+ wp.a11y.speak( api.settings.l10n.themeSearchResults.replace( '%d', data.info.results ) );
+ }
+ }
+
+ _.delay( section.renderScreenshots, 100 ); // Wait for the controls to become visible.
+
+ if ( 'local' === section.params.filter_type || 100 > themes.length ) { // If we have less than the requested 100 themes, it's the end of the list.
+ section.fullyLoaded = true;
+ }
+ } else {
+ if ( 0 === section.loaded ) {
+ section.container.find( '.no-themes' ).show();
+ wp.a11y.speak( section.container.find( '.no-themes' ).text() );
+ } else {
+ section.fullyLoaded = true;
+ }
+ }
+ if ( 'local' === section.params.filter_type ) {
+ section.updateCount(); // Count of visible theme controls.
+ } else {
+ section.updateCount( data.info.results ); // Total number of results including pages not yet loaded.
+ }
+ section.container.find( '.unexpected-error' ).hide(); // Hide error notice in case it was previously shown.
+
+ // This cannot run on request.always, as section.loading may turn false before the new controls load in the success case.
+ section.headContainer.closest( '.wp-full-overlay' ).removeClass( 'loading' );
+ section.loading = false;
+ });
+ request.fail(function( data ) {
+ if ( 'undefined' === typeof data ) {
+ section.container.find( '.unexpected-error' ).show();
+ wp.a11y.speak( section.container.find( '.unexpected-error' ).text() );
+ } else if ( 'undefined' !== typeof console && console.error ) {
+ console.error( data );
+ }
+
+ // This cannot run on request.always, as section.loading may turn false before the new controls load in the success case.
+ section.headContainer.closest( '.wp-full-overlay' ).removeClass( 'loading' );
+ section.loading = false;
+ });
+ },
+
+ /**
+ * Loads controls into the section from data received from loadThemes().
+ *
+ * @since 4.9.0
+ * @param {Array} themes - Array of theme data to create controls with.
+ * @param {integer} page - Page of results being loaded.
+ * @returns {void}
+ */
+ loadControls: function( themes, page ) {
+ var newThemeControls = [],
+ section = this;
+
+ // Add controls for each theme.
+ _.each( themes, function( theme ) {
+ var themeControl = new api.controlConstructor.theme( section.params.action + '_theme_' + theme.id, {
+ type: 'theme',
+ section: section.params.id,
+ theme: theme,
+ priority: section.loaded + 1
+ } );
+
+ api.control.add( themeControl );
+ newThemeControls.push( themeControl );
+ section.loaded = section.loaded + 1;
+ });
+
+ if ( 1 !== page ) {
+ Array.prototype.push.apply( section.screenshotQueue, newThemeControls ); // Add new themes to the screenshot queue.
+ }
+ },
+
+ /**
+ * Determines whether more themes should be loaded, and loads them.
+ *
+ * @since 4.9.0
+ * @returns {void}
+ */
+ loadMore: function() {
+ var section = this, container, bottom, threshold;
+ if ( ! section.fullyLoaded && ! section.loading ) {
+ container = section.container.closest( '.customize-themes-full-container' );
+
+ bottom = container.scrollTop() + container.height();
+ threshold = container.prop( 'scrollHeight' ) - 3000; // Use a fixed distance to the bottom of loaded results to avoid unnecessarily loading results sooner when using a percentage of scroll distance.
+
+ if ( bottom > threshold ) {
+ section.loadThemes();
+ }
+ }
+ },
+
+ /**
+ * Event handler for search input that filters visible controls.
+ *
+ * @since 4.9.0
+ *
+ * @param {string} term - The raw search input value.
+ * @returns {void}
+ */
+ filterSearch: function( term ) {
+ var count = 0,
+ visible = false,
+ section = this,
+ noFilter = ( api.section.has( 'wporg_themes' ) && 'remote' !== section.params.filter_type ) ? '.no-themes-local' : '.no-themes',
+ controls = section.controls(),
+ terms;
+
+ if ( section.loading ) {
+ return;
+ }
+
+ // Standardize search term format and split into an array of individual words.
+ terms = term.toLowerCase().trim().replace( /-/g, ' ' ).split( ' ' );
+
+ _.each( controls, function( control ) {
+ visible = control.filter( terms ); // Shows/hides and sorts control based on the applicability of the search term.
+ if ( visible ) {
+ count = count + 1;
+ }
+ });
+
+ if ( 0 === count ) {
+ section.container.find( noFilter ).show();
+ wp.a11y.speak( section.container.find( noFilter ).text() );
+ } else {
+ section.container.find( noFilter ).hide();
+ }
+
+ section.renderScreenshots();
+ api.reflowPaneContents();
+
+ // Update theme count.
+ section.updateCountDebounced( count );
+ },
+
+ /**
+ * Event handler for search input that determines if the terms have changed and loads new controls as needed.
+ *
+ * @since 4.9.0
+ *
+ * @param {wp.customize.ThemesSection} section - The current theme section, passed through the debouncer.
+ * @returns {void}
+ */
+ checkTerm: function( section ) {
+ var newTerm;
+ if ( 'remote' === section.params.filter_type ) {
+ newTerm = section.contentContainer.find( '.wp-filter-search' ).val();
+ if ( section.term !== newTerm.trim() ) {
+ section.initializeNewQuery( newTerm, section.tags );
+ }
+ }
+ },
+
+ /**
+ * Check for filters checked in the feature filter list and initialize a new query.
+ *
+ * @since 4.9.0
+ *
+ * @returns {void}
+ */
+ filtersChecked: function() {
+ var section = this,
+ items = section.container.find( '.filter-group' ).find( ':checkbox' ),
+ tags = [];
+
+ _.each( items.filter( ':checked' ), function( item ) {
+ tags.push( $( item ).prop( 'value' ) );
+ });
+
+ // When no filters are checked, restore initial state. Update filter count.
+ if ( 0 === tags.length ) {
+ tags = '';
+ section.contentContainer.find( '.feature-filter-toggle .filter-count-0' ).show();
+ section.contentContainer.find( '.feature-filter-toggle .filter-count-filters' ).hide();
+ } else {
+ section.contentContainer.find( '.feature-filter-toggle .theme-filter-count' ).text( tags.length );
+ section.contentContainer.find( '.feature-filter-toggle .filter-count-0' ).hide();
+ section.contentContainer.find( '.feature-filter-toggle .filter-count-filters' ).show();
+ }
+
+ // Check whether tags have changed, and either load or queue them.
+ if ( ! _.isEqual( section.tags, tags ) ) {
+ if ( section.loading ) {
+ section.nextTags = tags;
+ } else {
+ if ( 'remote' === section.params.filter_type ) {
+ section.initializeNewQuery( section.term, tags );
+ } else if ( 'local' === section.params.filter_type ) {
+ section.filterSearch( tags.join( ' ' ) );
+ }
+ }
+ }
+ },
+
+ /**
+ * Reset the current query and load new results.
+ *
+ * @since 4.9.0
+ *
+ * @param {string} newTerm - New term.
+ * @param {Array} newTags - New tags.
+ * @returns {void}
+ */
+ initializeNewQuery: function( newTerm, newTags ) {
+ var section = this;
+
+ // Clear the controls in the section.
+ _.each( section.controls(), function( control ) {
+ control.container.remove();
+ api.control.remove( control.id );
+ });
+ section.loaded = 0;
+ section.fullyLoaded = false;
+ section.screenshotQueue = null;
+
+ // Run a new query, with loadThemes handling paging, etc.
+ if ( ! section.loading ) {
+ section.term = newTerm;
+ section.tags = newTags;
+ section.loadThemes();
+ } else {
+ section.nextTerm = newTerm; // This will reload from loadThemes() with the newest term once the current batch is loaded.
+ section.nextTags = newTags; // This will reload from loadThemes() with the newest tags once the current batch is loaded.
+ }
+ if ( ! section.expanded() ) {
+ section.expand(); // Expand the section if it isn't expanded.
+ }
+ },
+
+ /**
+ * Render control's screenshot if the control comes into view.
+ *
+ * @since 4.2.0
+ *
+ * @returns {void}
+ */
+ renderScreenshots: function() {
+ var section = this;
+
+ // Fill queue initially, or check for more if empty.
+ if ( null === section.screenshotQueue || 0 === section.screenshotQueue.length ) {
+
+ // Add controls that haven't had their screenshots rendered.
+ section.screenshotQueue = _.filter( section.controls(), function( control ) {
+ return ! control.screenshotRendered;
+ });
+ }
+
+ // Are all screenshots rendered (for now)?
+ if ( ! section.screenshotQueue.length ) {
+ return;
+ }
+
+ section.screenshotQueue = _.filter( section.screenshotQueue, function( control ) {
+ var $imageWrapper = control.container.find( '.theme-screenshot' ),
+ $image = $imageWrapper.find( 'img' );
+
+ if ( ! $image.length ) {
+ return false;
+ }
+
+ if ( $image.is( ':hidden' ) ) {
+ return true;
+ }
+
+ // Based on unveil.js.
+ var wt = section.$window.scrollTop(),
+ wb = wt + section.$window.height(),
+ et = $image.offset().top,
+ ih = $imageWrapper.height(),
+ eb = et + ih,
+ threshold = ih * 3,
+ inView = eb >= wt - threshold && et <= wb + threshold;
+
+ if ( inView ) {
+ control.container.trigger( 'render-screenshot' );
+ }
+
+ // If the image is in view return false so it's cleared from the queue.
+ return ! inView;
+ } );
+ },
+
+ /**
+ * Get visible count.
+ *
+ * @since 4.9.0
+ *
+ * @returns {int} Visible count.
+ */
+ getVisibleCount: function() {
+ return this.contentContainer.find( 'li.customize-control:visible' ).length;
+ },
+
+ /**
+ * Update the number of themes in the section.
+ *
+ * @since 4.9.0
+ *
+ * @returns {void}
+ */
+ updateCount: function( count ) {
+ var section = this, countEl, displayed;
+
+ if ( ! count && 0 !== count ) {
+ count = section.getVisibleCount();
+ }
+
+ displayed = section.contentContainer.find( '.themes-displayed' );
+ countEl = section.contentContainer.find( '.theme-count' );
+
+ if ( 0 === count ) {
+ countEl.text( '0' );
+ } else {
+
+ // Animate the count change for emphasis.
+ displayed.fadeOut( 180, function() {
+ countEl.text( count );
+ displayed.fadeIn( 180 );
+ } );
+ wp.a11y.speak( api.settings.l10n.announceThemeCount.replace( '%d', count ) );
+ }
+ },
+
+ /**
+ * Advance the modal to the next theme.
+ *
+ * @since 4.2.0
+ *
+ * @returns {void}
+ */
+ nextTheme: function () {
+ var section = this;
+ if ( section.getNextTheme() ) {
+ section.showDetails( section.getNextTheme(), function() {
+ section.overlay.find( '.right' ).focus();
+ } );
+ }
+ },
+
+ /**
+ * Get the next theme model.
+ *
+ * @since 4.2.0
+ *
+ * @returns {wp.customize.ThemeControl|boolean} Next theme.
+ */
+ getNextTheme: function () {
+ var section = this, control, nextControl, sectionControls, i;
+ control = api.control( section.params.action + '_theme_' + section.currentTheme );
+ sectionControls = section.controls();
+ i = _.indexOf( sectionControls, control );
+ if ( -1 === i ) {
+ return false;
+ }
+
+ nextControl = sectionControls[ i + 1 ];
+ if ( ! nextControl ) {
+ return false;
+ }
+ return nextControl.params.theme;
+ },
+
+ /**
+ * Advance the modal to the previous theme.
+ *
+ * @since 4.2.0
+ * @returns {void}
+ */
+ previousTheme: function () {
+ var section = this;
+ if ( section.getPreviousTheme() ) {
+ section.showDetails( section.getPreviousTheme(), function() {
+ section.overlay.find( '.left' ).focus();
+ } );
+ }
+ },
+
+ /**
+ * Get the previous theme model.
+ *
+ * @since 4.2.0
+ * @returns {wp.customize.ThemeControl|boolean} Previous theme.
+ */
+ getPreviousTheme: function () {
+ var section = this, control, nextControl, sectionControls, i;
+ control = api.control( section.params.action + '_theme_' + section.currentTheme );
+ sectionControls = section.controls();
+ i = _.indexOf( sectionControls, control );
+ if ( -1 === i ) {
+ return false;
+ }
+
+ nextControl = sectionControls[ i - 1 ];
+ if ( ! nextControl ) {
+ return false;
+ }
+ return nextControl.params.theme;
+ },
+
+ /**
+ * Disable buttons when we're viewing the first or last theme.
+ *
+ * @since 4.2.0
+ *
+ * @returns {void}
+ */
+ updateLimits: function () {
+ if ( ! this.getNextTheme() ) {
+ this.overlay.find( '.right' ).addClass( 'disabled' );
+ }
+ if ( ! this.getPreviousTheme() ) {
+ this.overlay.find( '.left' ).addClass( 'disabled' );
+ }
+ },
+
+ /**
+ * Load theme preview.
+ *
+ * @since 4.7.0
+ * @access public
+ *
+ * @deprecated
+ * @param {string} themeId Theme ID.
+ * @returns {jQuery.promise} Promise.
+ */
+ loadThemePreview: function( themeId ) {
+ return api.ThemesPanel.prototype.loadThemePreview.call( this, themeId );
+ },
+
+ /**
+ * Render & show the theme details for a given theme model.
+ *
+ * @since 4.2.0
+ *
+ * @param {object} theme - Theme.
+ * @param {Function} [callback] - Callback once the details have been shown.
+ * @returns {void}
+ */
+ showDetails: function ( theme, callback ) {
+ var section = this, panel = api.panel( 'themes' );
+ section.currentTheme = theme.id;
+ section.overlay.html( section.template( theme ) )
+ .fadeIn( 'fast' )
+ .focus();
+
+ function disableSwitchButtons() {
+ return ! panel.canSwitchTheme( theme.id );
+ }
+
+ // Temporary special function since supplying SFTP credentials does not work yet. See #42184.
+ function disableInstallButtons() {
+ return disableSwitchButtons() || false === api.settings.theme._canInstall || true === api.settings.theme._filesystemCredentialsNeeded;
+ }
+
+ section.overlay.find( 'button.preview, button.preview-theme' ).toggleClass( 'disabled', disableSwitchButtons() );
+ section.overlay.find( 'button.theme-install' ).toggleClass( 'disabled', disableInstallButtons() );
+
+ section.$body.addClass( 'modal-open' );
+ section.containFocus( section.overlay );
+ section.updateLimits();
+ wp.a11y.speak( api.settings.l10n.announceThemeDetails.replace( '%s', theme.name ) );
+ if ( callback ) {
+ callback();
+ }
+ },
+
+ /**
+ * Close the theme details modal.
+ *
+ * @since 4.2.0
+ *
+ * @returns {void}
+ */
+ closeDetails: function () {
+ var section = this;
+ section.$body.removeClass( 'modal-open' );
+ section.overlay.fadeOut( 'fast' );
+ api.control( section.params.action + '_theme_' + section.currentTheme ).container.find( '.theme' ).focus();
+ },
+
+ /**
+ * Keep tab focus within the theme details modal.
+ *
+ * @since 4.2.0
+ *
+ * @param {jQuery} el - Element to contain focus.
+ * @returns {void}
+ */
+ containFocus: function( el ) {
+ var tabbables;
+
+ el.on( 'keydown', function( event ) {
+
+ // Return if it's not the tab key
+ // When navigating with prev/next focus is already handled
+ if ( 9 !== event.keyCode ) {
+ return;
+ }
+
+ // uses jQuery UI to get the tabbable elements
+ tabbables = $( ':tabbable', el );
+
+ // Keep focus within the overlay
+ if ( tabbables.last()[0] === event.target && ! event.shiftKey ) {
+ tabbables.first().focus();
+ return false;
+ } else if ( tabbables.first()[0] === event.target && event.shiftKey ) {
+ tabbables.last().focus();
+ return false;
+ }
+ });
+ }
+ });
+
+ api.OuterSection = api.Section.extend(/** @lends wp.customize.OuterSection.prototype */{
+
+ /**
+ * Class wp.customize.OuterSection.
+ *
+ * Creates section outside of the sidebar, there is no ui to trigger collapse/expand so
+ * it would require custom handling.
+ *
+ * @constructs wp.customize.OuterSection
+ * @augments wp.customize.Section
+ *
+ * @since 4.9.0
+ *
+ * @returns {void}
+ */
+ initialize: function() {
+ var section = this;
+ section.containerParent = '#customize-outer-theme-controls';
+ section.containerPaneParent = '.customize-outer-pane-parent';
+ api.Section.prototype.initialize.apply( section, arguments );
+ },
+
+ /**
+ * Overrides api.Section.prototype.onChangeExpanded to prevent collapse/expand effect
+ * on other sections and panels.
+ *
+ * @since 4.9.0
+ *
+ * @param {Boolean} expanded - The expanded state to transition to.
+ * @param {Object} [args] - Args.
+ * @param {boolean} [args.unchanged] - Whether the state is already known to not be changed, and so short-circuit with calling completeCallback early.
+ * @param {Function} [args.completeCallback] - Function to call when the slideUp/slideDown has completed.
+ * @param {Object} [args.duration] - The duration for the animation.
+ */
+ onChangeExpanded: function( expanded, args ) {
+ var section = this,
+ container = section.headContainer.closest( '.wp-full-overlay-sidebar-content' ),
+ content = section.contentContainer,
+ backBtn = content.find( '.customize-section-back' ),
+ sectionTitle = section.headContainer.find( '.accordion-section-title' ).first(),
+ body = $( document.body ),
+ expand, panel;
+
+ body.toggleClass( 'outer-section-open', expanded );
+ section.container.toggleClass( 'open', expanded );
+ section.container.removeClass( 'busy' );
+ api.section.each( function( _section ) {
+ if ( 'outer' === _section.params.type && _section.id !== section.id ) {
+ _section.container.removeClass( 'open' );
+ }
+ } );
+
+ if ( expanded && ! content.hasClass( 'open' ) ) {
+
+ if ( args.unchanged ) {
+ expand = args.completeCallback;
+ } else {
+ expand = $.proxy( function() {
+ section._animateChangeExpanded( function() {
+ sectionTitle.attr( 'tabindex', '-1' );
+ backBtn.attr( 'tabindex', '0' );
+
+ backBtn.focus();
+ content.css( 'top', '' );
+ container.scrollTop( 0 );
+
+ if ( args.completeCallback ) {
+ args.completeCallback();
+ }
+ } );
+
+ content.addClass( 'open' );
+ }, this );
+ }
+
+ if ( section.panel() ) {
+ api.panel( section.panel() ).expand({
+ duration: args.duration,
+ completeCallback: expand
+ });
+ } else {
+ expand();
+ }
+
+ } else if ( ! expanded && content.hasClass( 'open' ) ) {
+ if ( section.panel() ) {
+ panel = api.panel( section.panel() );
+ if ( panel.contentContainer.hasClass( 'skip-transition' ) ) {
+ panel.collapse();
+ }
+ }
+ section._animateChangeExpanded( function() {
+ backBtn.attr( 'tabindex', '-1' );
+ sectionTitle.attr( 'tabindex', '0' );
+
+ sectionTitle.focus();
+ content.css( 'top', '' );
+
+ if ( args.completeCallback ) {
+ args.completeCallback();
+ }
+ } );
+
+ content.removeClass( 'open' );
+
+ } else {
+ if ( args.completeCallback ) {
+ args.completeCallback();
+ }
+ }
+ }
+ });
+
+ api.Panel = Container.extend(/** @lends wp.customize.Panel.prototype */{
+ containerType: 'panel',
+
+ /**
+ * @constructs wp.customize.Panel
+ * @augments wp.customize~Container
+ *
+ * @since 4.1.0
+ *
+ * @param {string} id - The ID for the panel.
+ * @param {object} options - Object containing one property: params.
+ * @param {string} options.title - Title shown when panel is collapsed and expanded.
+ * @param {string} [options.description] - Description shown at the top of the panel.
+ * @param {number} [options.priority=100] - The sort priority for the panel.
+ * @param {string} [options.type=default] - The type of the panel. See wp.customize.panelConstructor.
+ * @param {string} [options.content] - The markup to be used for the panel container. If empty, a JS template is used.
+ * @param {boolean} [options.active=true] - Whether the panel is active or not.
+ * @param {object} [options.params] - Deprecated wrapper for the above properties.
+ */
+ initialize: function ( id, options ) {
+ var panel = this, params;
+ params = options.params || options;
+
+ // Look up the type if one was not supplied.
+ if ( ! params.type ) {
+ _.find( api.panelConstructor, function( Constructor, type ) {
+ if ( Constructor === panel.constructor ) {
+ params.type = type;
+ return true;
+ }
+ return false;
+ } );
+ }
+
+ Container.prototype.initialize.call( panel, id, params );
+
+ panel.embed();
+ panel.deferred.embedded.done( function () {
+ panel.ready();
+ });
+ },
+
+ /**
+ * Embed the container in the DOM when any parent panel is ready.
+ *
+ * @since 4.1.0
+ */
+ embed: function () {
+ var panel = this,
+ container = $( '#customize-theme-controls' ),
+ parentContainer = $( '.customize-pane-parent' ); // @todo This should be defined elsewhere, and to be configurable
+
+ if ( ! panel.headContainer.parent().is( parentContainer ) ) {
+ parentContainer.append( panel.headContainer );
+ }
+ if ( ! panel.contentContainer.parent().is( panel.headContainer ) ) {
+ container.append( panel.contentContainer );
+ }
+ panel.renderContent();
+
+ panel.deferred.embedded.resolve();
+ },
+
+ /**
+ * @since 4.1.0
+ */
+ attachEvents: function () {
+ var meta, panel = this;
+
+ // Expand/Collapse accordion sections on click.
+ panel.headContainer.find( '.accordion-section-title' ).on( 'click keydown', function( event ) {
+ if ( api.utils.isKeydownButNotEnterEvent( event ) ) {
+ return;
+ }
+ event.preventDefault(); // Keep this AFTER the key filter above
+
+ if ( ! panel.expanded() ) {
+ panel.expand();
+ }
+ });
+
+ // Close panel.
+ panel.container.find( '.customize-panel-back' ).on( 'click keydown', function( event ) {
+ if ( api.utils.isKeydownButNotEnterEvent( event ) ) {
+ return;
+ }
+ event.preventDefault(); // Keep this AFTER the key filter above
+
+ if ( panel.expanded() ) {
+ panel.collapse();
+ }
+ });
+
+ meta = panel.container.find( '.panel-meta:first' );
+
+ meta.find( '> .accordion-section-title .customize-help-toggle' ).on( 'click', function() {
+ if ( meta.hasClass( 'cannot-expand' ) ) {
+ return;
+ }
+
+ var content = meta.find( '.customize-panel-description:first' );
+ if ( meta.hasClass( 'open' ) ) {
+ meta.toggleClass( 'open' );
+ content.slideUp( panel.defaultExpandedArguments.duration, function() {
+ content.trigger( 'toggled' );
+ } );
+ $( this ).attr( 'aria-expanded', false );
+ } else {
+ content.slideDown( panel.defaultExpandedArguments.duration, function() {
+ content.trigger( 'toggled' );
+ } );
+ meta.toggleClass( 'open' );
+ $( this ).attr( 'aria-expanded', true );
+ }
+ });
+
+ },
+
+ /**
+ * Get the sections that are associated with this panel, sorted by their priority Value.
+ *
+ * @since 4.1.0
+ *
+ * @returns {Array}
+ */
+ sections: function () {
+ return this._children( 'panel', 'section' );
+ },
+
+ /**
+ * Return whether this panel has any active sections.
+ *
+ * @since 4.1.0
+ *
+ * @returns {boolean} Whether contextually active.
+ */
+ isContextuallyActive: function () {
+ var panel = this,
+ sections = panel.sections(),
+ activeCount = 0;
+ _( sections ).each( function ( section ) {
+ if ( section.active() && section.isContextuallyActive() ) {
+ activeCount += 1;
+ }
+ } );
+ return ( activeCount !== 0 );
+ },
+
+ /**
+ * Update UI to reflect expanded state.
+ *
+ * @since 4.1.0
+ *
+ * @param {Boolean} expanded
+ * @param {Object} args
+ * @param {Boolean} args.unchanged
+ * @param {Function} args.completeCallback
+ * @returns {void}
+ */
+ onChangeExpanded: function ( expanded, args ) {
+
+ // Immediately call the complete callback if there were no changes
+ if ( args.unchanged ) {
+ if ( args.completeCallback ) {
+ args.completeCallback();
+ }
+ return;
+ }
+
+ // Note: there is a second argument 'args' passed
+ var panel = this,
+ accordionSection = panel.contentContainer,
+ overlay = accordionSection.closest( '.wp-full-overlay' ),
+ container = accordionSection.closest( '.wp-full-overlay-sidebar-content' ),
+ topPanel = panel.headContainer.find( '.accordion-section-title' ),
+ backBtn = accordionSection.find( '.customize-panel-back' ),
+ childSections = panel.sections(),
+ skipTransition;
+
+ if ( expanded && ! accordionSection.hasClass( 'current-panel' ) ) {
+ // Collapse any sibling sections/panels
+ api.section.each( function ( section ) {
+ if ( panel.id !== section.panel() ) {
+ section.collapse( { duration: 0 } );
+ }
+ });
+ api.panel.each( function ( otherPanel ) {
+ if ( panel !== otherPanel ) {
+ otherPanel.collapse( { duration: 0 } );
+ }
+ });
+
+ if ( panel.params.autoExpandSoleSection && 1 === childSections.length && childSections[0].active.get() ) {
+ accordionSection.addClass( 'current-panel skip-transition' );
+ overlay.addClass( 'in-sub-panel' );
+
+ childSections[0].expand( {
+ completeCallback: args.completeCallback
+ } );
+ } else {
+ panel._animateChangeExpanded( function() {
+ topPanel.attr( 'tabindex', '-1' );
+ backBtn.attr( 'tabindex', '0' );
+
+ backBtn.focus();
+ accordionSection.css( 'top', '' );
+ container.scrollTop( 0 );
+
+ if ( args.completeCallback ) {
+ args.completeCallback();
+ }
+ } );
+
+ accordionSection.addClass( 'current-panel' );
+ overlay.addClass( 'in-sub-panel' );
+ }
+
+ api.state( 'expandedPanel' ).set( panel );
+
+ } else if ( ! expanded && accordionSection.hasClass( 'current-panel' ) ) {
+ skipTransition = accordionSection.hasClass( 'skip-transition' );
+ if ( ! skipTransition ) {
+ panel._animateChangeExpanded( function() {
+ topPanel.attr( 'tabindex', '0' );
+ backBtn.attr( 'tabindex', '-1' );
+
+ topPanel.focus();
+ accordionSection.css( 'top', '' );
+
+ if ( args.completeCallback ) {
+ args.completeCallback();
+ }
+ } );
+ } else {
+ accordionSection.removeClass( 'skip-transition' );
+ }
+
+ overlay.removeClass( 'in-sub-panel' );
+ accordionSection.removeClass( 'current-panel' );
+ if ( panel === api.state( 'expandedPanel' ).get() ) {
+ api.state( 'expandedPanel' ).set( false );
+ }
+ }
+ },
+
+ /**
+ * Render the panel from its JS template, if it exists.
+ *
+ * The panel's container must already exist in the DOM.
+ *
+ * @since 4.3.0
+ */
+ renderContent: function () {
+ var template,
+ panel = this;
+
+ // Add the content to the container.
+ if ( 0 !== $( '#tmpl-' + panel.templateSelector + '-content' ).length ) {
+ template = wp.template( panel.templateSelector + '-content' );
+ } else {
+ template = wp.template( 'customize-panel-default-content' );
+ }
+ if ( template && panel.headContainer ) {
+ panel.contentContainer.html( template( _.extend(
+ { id: panel.id },
+ panel.params
+ ) ) );
+ }
+ }
+ });
+
+ api.ThemesPanel = api.Panel.extend(/** @lends wp.customize.ThemsPanel.prototype */{
+
+ /**
+ * Class wp.customize.ThemesPanel.
+ *
+ * Custom section for themes that displays without the customize preview.
+ *
+ * @constructs wp.customize.ThemesPanel
+ * @augments wp.customize.Panel
+ *
+ * @since 4.9.0
+ *
+ * @param {string} id - The ID for the panel.
+ * @param {object} options - Options.
+ * @returns {void}
+ */
+ initialize: function( id, options ) {
+ var panel = this;
+ panel.installingThemes = [];
+ api.Panel.prototype.initialize.call( panel, id, options );
+ },
+
+ /**
+ * Determine whether a given theme can be switched to, or in general.
+ *
+ * @since 4.9.0
+ *
+ * @param {string} [slug] - Theme slug.
+ * @returns {boolean} Whether the theme can be switched to.
+ */
+ canSwitchTheme: function canSwitchTheme( slug ) {
+ if ( slug && slug === api.settings.theme.stylesheet ) {
+ return true;
+ }
+ return 'publish' === api.state( 'selectedChangesetStatus' ).get() && ( '' === api.state( 'changesetStatus' ).get() || 'auto-draft' === api.state( 'changesetStatus' ).get() );
+ },
+
+ /**
+ * Attach events.
+ *
+ * @since 4.9.0
+ * @returns {void}
+ */
+ attachEvents: function() {
+ var panel = this;
+
+ // Attach regular panel events.
+ api.Panel.prototype.attachEvents.apply( panel );
+
+ // Temporary since supplying SFTP credentials does not work yet. See #42184
+ if ( api.settings.theme._canInstall && api.settings.theme._filesystemCredentialsNeeded ) {
+ panel.notifications.add( new api.Notification( 'theme_install_unavailable', {
+ message: api.l10n.themeInstallUnavailable,
+ type: 'info',
+ dismissible: true
+ } ) );
+ }
+
+ function toggleDisabledNotifications() {
+ if ( panel.canSwitchTheme() ) {
+ panel.notifications.remove( 'theme_switch_unavailable' );
+ } else {
+ panel.notifications.add( new api.Notification( 'theme_switch_unavailable', {
+ message: api.l10n.themePreviewUnavailable,
+ type: 'warning'
+ } ) );
+ }
+ }
+ toggleDisabledNotifications();
+ api.state( 'selectedChangesetStatus' ).bind( toggleDisabledNotifications );
+ api.state( 'changesetStatus' ).bind( toggleDisabledNotifications );
+
+ // Collapse panel to customize the current theme.
+ panel.contentContainer.on( 'click', '.customize-theme', function() {
+ panel.collapse();
+ });
+
+ // Toggle between filtering and browsing themes on mobile.
+ panel.contentContainer.on( 'click', '.customize-themes-section-title, .customize-themes-mobile-back', function() {
+ $( '.wp-full-overlay' ).toggleClass( 'showing-themes' );
+ });
+
+ // Install (and maybe preview) a theme.
+ panel.contentContainer.on( 'click', '.theme-install', function( event ) {
+ panel.installTheme( event );
+ });
+
+ // Update a theme. Theme cards have the class, the details modal has the id.
+ panel.contentContainer.on( 'click', '.update-theme, #update-theme', function( event ) {
+
+ // #update-theme is a link.
+ event.preventDefault();
+ event.stopPropagation();
+
+ panel.updateTheme( event );
+ });
+
+ // Delete a theme.
+ panel.contentContainer.on( 'click', '.delete-theme', function( event ) {
+ panel.deleteTheme( event );
+ });
+
+ _.bindAll( panel, 'installTheme', 'updateTheme' );
+ },
+
+ /**
+ * Update UI to reflect expanded state
+ *
+ * @since 4.9.0
+ *
+ * @param {Boolean} expanded - Expanded state.
+ * @param {Object} args - Args.
+ * @param {Boolean} args.unchanged - Whether or not the state changed.
+ * @param {Function} args.completeCallback - Callback to execute when the animation completes.
+ * @returns {void}
+ */
+ onChangeExpanded: function( expanded, args ) {
+ var panel = this, overlay, sections, hasExpandedSection = false;
+
+ // Expand/collapse the panel normally.
+ api.Panel.prototype.onChangeExpanded.apply( this, [ expanded, args ] );
+
+ // Immediately call the complete callback if there were no changes
+ if ( args.unchanged ) {
+ if ( args.completeCallback ) {
+ args.completeCallback();
+ }
+ return;
+ }
+
+ overlay = panel.headContainer.closest( '.wp-full-overlay' );
+
+ if ( expanded ) {
+ overlay
+ .addClass( 'in-themes-panel' )
+ .delay( 200 ).find( '.customize-themes-full-container' ).addClass( 'animate' );
+
+ _.delay( function() {
+ overlay.addClass( 'themes-panel-expanded' );
+ }, 200 );
+
+ // Automatically open the first section (except on small screens), if one isn't already expanded.
+ if ( 600 < window.innerWidth ) {
+ sections = panel.sections();
+ _.each( sections, function( section ) {
+ if ( section.expanded() ) {
+ hasExpandedSection = true;
+ }
+ } );
+ if ( ! hasExpandedSection && sections.length > 0 ) {
+ sections[0].expand();
+ }
+ }
+ } else {
+ overlay
+ .removeClass( 'in-themes-panel themes-panel-expanded' )
+ .find( '.customize-themes-full-container' ).removeClass( 'animate' );
+ }
+ },
+
+ /**
+ * Install a theme via wp.updates.
+ *
+ * @since 4.9.0
+ *
+ * @param {jQuery.Event} event - Event.
+ * @returns {jQuery.promise} Promise.
+ */
+ installTheme: function( event ) {
+ var panel = this, preview, onInstallSuccess, slug = $( event.target ).data( 'slug' ), deferred = $.Deferred(), request;
+ preview = $( event.target ).hasClass( 'preview' );
+
+ // Temporary since supplying SFTP credentials does not work yet. See #42184.
+ if ( api.settings.theme._filesystemCredentialsNeeded ) {
+ deferred.reject({
+ errorCode: 'theme_install_unavailable'
+ });
+ return deferred.promise();
+ }
+
+ // Prevent loading a non-active theme preview when there is a drafted/scheduled changeset.
+ if ( ! panel.canSwitchTheme( slug ) ) {
+ deferred.reject({
+ errorCode: 'theme_switch_unavailable'
+ });
+ return deferred.promise();
+ }
+
+ // Theme is already being installed.
+ if ( _.contains( panel.installingThemes, slug ) ) {
+ deferred.reject({
+ errorCode: 'theme_already_installing'
+ });
+ return deferred.promise();
+ }
+
+ wp.updates.maybeRequestFilesystemCredentials( event );
+
+ onInstallSuccess = function( response ) {
+ var theme = false, themeControl;
+ if ( preview ) {
+ api.notifications.remove( 'theme_installing' );
+
+ panel.loadThemePreview( slug );
+
+ } else {
+ api.control.each( function( control ) {
+ if ( 'theme' === control.params.type && control.params.theme.id === response.slug ) {
+ theme = control.params.theme; // Used below to add theme control.
+ control.rerenderAsInstalled( true );
+ }
+ });
+
+ // Don't add the same theme more than once.
+ if ( ! theme || api.control.has( 'installed_theme_' + theme.id ) ) {
+ deferred.resolve( response );
+ return;
+ }
+
+ // Add theme control to installed section.
+ theme.type = 'installed';
+ themeControl = new api.controlConstructor.theme( 'installed_theme_' + theme.id, {
+ type: 'theme',
+ section: 'installed_themes',
+ theme: theme,
+ priority: 0 // Add all newly-installed themes to the top.
+ } );
+
+ api.control.add( themeControl );
+ api.control( themeControl.id ).container.trigger( 'render-screenshot' );
+
+ // Close the details modal if it's open to the installed theme.
+ api.section.each( function( section ) {
+ if ( 'themes' === section.params.type ) {
+ if ( theme.id === section.currentTheme ) { // Don't close the modal if the user has navigated elsewhere.
+ section.closeDetails();
+ }
+ }
+ });
+ }
+ deferred.resolve( response );
+ };
+
+ panel.installingThemes.push( slug ); // Note: we don't remove elements from installingThemes, since they shouldn't be installed again.
+ request = wp.updates.installTheme( {
+ slug: slug
+ } );
+
+ // Also preview the theme as the event is triggered on Install & Preview.
+ if ( preview ) {
+ api.notifications.add( new api.OverlayNotification( 'theme_installing', {
+ message: api.l10n.themeDownloading,
+ type: 'info',
+ loading: true
+ } ) );
+ }
+
+ request.done( onInstallSuccess );
+ request.fail( function() {
+ api.notifications.remove( 'theme_installing' );
+ } );
+
+ return deferred.promise();
+ },
+
+ /**
+ * Load theme preview.
+ *
+ * @since 4.9.0
+ *
+ * @param {string} themeId Theme ID.
+ * @returns {jQuery.promise} Promise.
+ */
+ loadThemePreview: function( themeId ) {
+ var panel = this, deferred = $.Deferred(), onceProcessingComplete, urlParser, queryParams;
+
+ // Prevent loading a non-active theme preview when there is a drafted/scheduled changeset.
+ if ( ! panel.canSwitchTheme( themeId ) ) {
+ deferred.reject({
+ errorCode: 'theme_switch_unavailable'
+ });
+ return deferred.promise();
+ }
+
+ urlParser = document.createElement( 'a' );
+ urlParser.href = location.href;
+ queryParams = _.extend(
+ api.utils.parseQueryString( urlParser.search.substr( 1 ) ),
+ {
+ theme: themeId,
+ changeset_uuid: api.settings.changeset.uuid,
+ 'return': api.settings.url['return']
+ }
+ );
+
+ // Include autosaved param to load autosave revision without prompting user to restore it.
+ if ( ! api.state( 'saved' ).get() ) {
+ queryParams.customize_autosaved = 'on';
+ }
+
+ urlParser.search = $.param( queryParams );
+
+ // Update loading message. Everything else is handled by reloading the page.
+ api.notifications.add( new api.OverlayNotification( 'theme_previewing', {
+ message: api.l10n.themePreviewWait,
+ type: 'info',
+ loading: true
+ } ) );
+
+ onceProcessingComplete = function() {
+ var request;
+ if ( api.state( 'processing' ).get() > 0 ) {
+ return;
+ }
+
+ api.state( 'processing' ).unbind( onceProcessingComplete );
+
+ request = api.requestChangesetUpdate( {}, { autosave: true } );
+ request.done( function() {
+ deferred.resolve();
+ $( window ).off( 'beforeunload.customize-confirm' );
+ location.replace( urlParser.href );
+ } );
+ request.fail( function() {
+
+ // @todo Show notification regarding failure.
+ api.notifications.remove( 'theme_previewing' );
+
+ deferred.reject();
+ } );
+ };
+
+ if ( 0 === api.state( 'processing' ).get() ) {
+ onceProcessingComplete();
+ } else {
+ api.state( 'processing' ).bind( onceProcessingComplete );
+ }
+
+ return deferred.promise();
+ },
+
+ /**
+ * Update a theme via wp.updates.
+ *
+ * @since 4.9.0
+ *
+ * @param {jQuery.Event} event - Event.
+ * @returns {void}
+ */
+ updateTheme: function( event ) {
+ wp.updates.maybeRequestFilesystemCredentials( event );
+
+ $( document ).one( 'wp-theme-update-success', function( e, response ) {
+
+ // Rerender the control to reflect the update.
+ api.control.each( function( control ) {
+ if ( 'theme' === control.params.type && control.params.theme.id === response.slug ) {
+ control.params.theme.hasUpdate = false;
+ control.params.theme.version = response.newVersion;
+ setTimeout( function() {
+ control.rerenderAsInstalled( true );
+ }, 2000 );
+ }
+ });
+ } );
+
+ wp.updates.updateTheme( {
+ slug: $( event.target ).closest( '.notice' ).data( 'slug' )
+ } );
+ },
+
+ /**
+ * Delete a theme via wp.updates.
+ *
+ * @since 4.9.0
+ *
+ * @param {jQuery.Event} event - Event.
+ * @returns {void}
+ */
+ deleteTheme: function( event ) {
+ var theme, section;
+ theme = $( event.target ).data( 'slug' );
+ section = api.section( 'installed_themes' );
+
+ event.preventDefault();
+
+ // Temporary since supplying SFTP credentials does not work yet. See #42184.
+ if ( api.settings.theme._filesystemCredentialsNeeded ) {
+ return;
+ }
+
+ // Confirmation dialog for deleting a theme.
+ if ( ! window.confirm( api.settings.l10n.confirmDeleteTheme ) ) {
+ return;
+ }
+
+ wp.updates.maybeRequestFilesystemCredentials( event );
+
+ $( document ).one( 'wp-theme-delete-success', function() {
+ var control = api.control( 'installed_theme_' + theme );
+
+ // Remove theme control.
+ control.container.remove();
+ api.control.remove( control.id );
+
+ // Update installed count.
+ section.loaded = section.loaded - 1;
+ section.updateCount();
+
+ // Rerender any other theme controls as uninstalled.
+ api.control.each( function( control ) {
+ if ( 'theme' === control.params.type && control.params.theme.id === theme ) {
+ control.rerenderAsInstalled( false );
+ }
+ });
+ } );
+
+ wp.updates.deleteTheme( {
+ slug: theme
+ } );
+
+ // Close modal and focus the section.
+ section.closeDetails();
+ section.focus();
+ }
+ });
+
+ api.Control = api.Class.extend(/** @lends wp.customize.Control.prototype */{
+ defaultActiveArguments: { duration: 'fast', completeCallback: $.noop },
+
+ /**
+ * Default params.
+ *
+ * @since 4.9.0
+ * @var {object}
+ */
+ defaults: {
+ label: '',
+ description: '',
+ active: true,
+ priority: 10
+ },
+
+ /**
+ * A Customizer Control.
+ *
+ * A control provides a UI element that allows a user to modify a Customizer Setting.
+ *
+ * @see PHP class WP_Customize_Control.
+ *
+ * @constructs wp.customize.Control
+ * @augments wp.customize.Class
+ *
+ * @borrows wp.customize~focus as this#focus
+ * @borrows wp.customize~Container#activate as this#activate
+ * @borrows wp.customize~Container#deactivate as this#deactivate
+ * @borrows wp.customize~Container#_toggleActive as this#_toggleActive
+ *
+ * @param {string} id - Unique identifier for the control instance.
+ * @param {object} options - Options hash for the control instance.
+ * @param {object} options.type - Type of control (e.g. text, radio, dropdown-pages, etc.)
+ * @param {string} [options.content] - The HTML content for the control or at least its container. This should normally be left blank and instead supplying a templateId.
+ * @param {string} [options.templateId] - Template ID for control's content.
+ * @param {string} [options.priority=10] - Order of priority to show the control within the section.
+ * @param {string} [options.active=true] - Whether the control is active.
+ * @param {string} options.section - The ID of the section the control belongs to.
+ * @param {mixed} [options.setting] - The ID of the main setting or an instance of this setting.
+ * @param {mixed} options.settings - An object with keys (e.g. default) that maps to setting IDs or Setting/Value objects, or an array of setting IDs or Setting/Value objects.
+ * @param {mixed} options.settings.default - The ID of the setting the control relates to.
+ * @param {string} options.settings.data - @todo Is this used?
+ * @param {string} options.label - Label.
+ * @param {string} options.description - Description.
+ * @param {number} [options.instanceNumber] - Order in which this instance was created in relation to other instances.
+ * @param {object} [options.params] - Deprecated wrapper for the above properties.
+ * @returns {void}
+ */
+ initialize: function( id, options ) {
+ var control = this, deferredSettingIds = [], settings, gatherSettings;
+
+ control.params = _.extend(
+ {},
+ control.defaults,
+ control.params || {}, // In case sub-class already defines.
+ options.params || options || {} // The options.params property is deprecated, but it is checked first for back-compat.
+ );
+
+ if ( ! api.Control.instanceCounter ) {
+ api.Control.instanceCounter = 0;
+ }
+ api.Control.instanceCounter++;
+ if ( ! control.params.instanceNumber ) {
+ control.params.instanceNumber = api.Control.instanceCounter;
+ }
+
+ // Look up the type if one was not supplied.
+ if ( ! control.params.type ) {
+ _.find( api.controlConstructor, function( Constructor, type ) {
+ if ( Constructor === control.constructor ) {
+ control.params.type = type;
+ return true;
+ }
+ return false;
+ } );
+ }
+
+ if ( ! control.params.content ) {
+ control.params.content = $( '<li></li>', {
+ id: 'customize-control-' + id.replace( /]/g, '' ).replace( /\[/g, '-' ),
+ 'class': 'customize-control customize-control-' + control.params.type
+ } );
+ }
+
+ control.id = id;
+ control.selector = '#customize-control-' + id.replace( /\]/g, '' ).replace( /\[/g, '-' ); // Deprecated, likely dead code from time before #28709.
+ if ( control.params.content ) {
+ control.container = $( control.params.content );
+ } else {
+ control.container = $( control.selector ); // Likely dead, per above. See #28709.
+ }
+
+ if ( control.params.templateId ) {
+ control.templateSelector = control.params.templateId;
+ } else {
+ control.templateSelector = 'customize-control-' + control.params.type + '-content';
+ }
+
+ control.deferred = _.extend( control.deferred || {}, {
+ embedded: new $.Deferred()
+ } );
+ control.section = new api.Value();
+ control.priority = new api.Value();
+ control.active = new api.Value();
+ control.activeArgumentsQueue = [];
+ control.notifications = new api.Notifications({
+ alt: control.altNotice
+ });
+
+ control.elements = [];
+
+ control.active.bind( function ( active ) {
+ var args = control.activeArgumentsQueue.shift();
+ args = $.extend( {}, control.defaultActiveArguments, args );
+ control.onChangeActive( active, args );
+ } );
+
+ control.section.set( control.params.section );
+ control.priority.set( isNaN( control.params.priority ) ? 10 : control.params.priority );
+ control.active.set( control.params.active );
+
+ api.utils.bubbleChildValueChanges( control, [ 'section', 'priority', 'active' ] );
+
+ control.settings = {};
+
+ settings = {};
+ if ( control.params.setting ) {
+ settings['default'] = control.params.setting;
+ }
+ _.extend( settings, control.params.settings );
+
+ // Note: Settings can be an array or an object, with values being either setting IDs or Setting (or Value) objects.
+ _.each( settings, function( value, key ) {
+ var setting;
+ if ( _.isObject( value ) && _.isFunction( value.extended ) && value.extended( api.Value ) ) {
+ control.settings[ key ] = value;
+ } else if ( _.isString( value ) ) {
+ setting = api( value );
+ if ( setting ) {
+ control.settings[ key ] = setting;
+ } else {
+ deferredSettingIds.push( value );
+ }
+ }
+ } );
+
+ gatherSettings = function() {
+
+ // Fill-in all resolved settings.
+ _.each( settings, function ( settingId, key ) {
+ if ( ! control.settings[ key ] && _.isString( settingId ) ) {
+ control.settings[ key ] = api( settingId );
+ }
+ } );
+
+ // Make sure settings passed as array gets associated with default.
+ if ( control.settings[0] && ! control.settings['default'] ) {
+ control.settings['default'] = control.settings[0];
+ }
+
+ // Identify the main setting.
+ control.setting = control.settings['default'] || null;
+
+ control.linkElements(); // Link initial elements present in server-rendered content.
+ control.embed();
+ };
+
+ if ( 0 === deferredSettingIds.length ) {
+ gatherSettings();
+ } else {
+ api.apply( api, deferredSettingIds.concat( gatherSettings ) );
+ }
+
+ // After the control is embedded on the page, invoke the "ready" method.
+ control.deferred.embedded.done( function () {
+ control.linkElements(); // Link any additional elements after template is rendered by renderContent().
+ control.setupNotifications();
+ control.ready();
+ });
+ },
+
+ /**
+ * Link elements between settings and inputs.
+ *
+ * @since 4.7.0
+ * @access public
+ *
+ * @returns {void}
+ */
+ linkElements: function () {
+ var control = this, nodes, radios, element;
+
+ nodes = control.container.find( '[data-customize-setting-link], [data-customize-setting-key-link]' );
+ radios = {};
+
+ nodes.each( function () {
+ var node = $( this ), name, setting;
+
+ if ( node.data( 'customizeSettingLinked' ) ) {
+ return;
+ }
+ node.data( 'customizeSettingLinked', true ); // Prevent re-linking element.
+
+ if ( node.is( ':radio' ) ) {
+ name = node.prop( 'name' );
+ if ( radios[name] ) {
+ return;
+ }
+
+ radios[name] = true;
+ node = nodes.filter( '[name="' + name + '"]' );
+ }
+
+ // Let link by default refer to setting ID. If it doesn't exist, fallback to looking up by setting key.
+ if ( node.data( 'customizeSettingLink' ) ) {
+ setting = api( node.data( 'customizeSettingLink' ) );
+ } else if ( node.data( 'customizeSettingKeyLink' ) ) {
+ setting = control.settings[ node.data( 'customizeSettingKeyLink' ) ];
+ }
+
+ if ( setting ) {
+ element = new api.Element( node );
+ control.elements.push( element );
+ element.sync( setting );
+ element.set( setting() );
+ }
+ } );
+ },
+
+ /**
+ * Embed the control into the page.
+ */
+ embed: function () {
+ var control = this,
+ inject;
+
+ // Watch for changes to the section state
+ inject = function ( sectionId ) {
+ var parentContainer;
+ if ( ! sectionId ) { // @todo allow a control to be embedded without a section, for instance a control embedded in the front end.
+ return;
+ }
+ // Wait for the section to be registered
+ api.section( sectionId, function ( section ) {
+ // Wait for the section to be ready/initialized
+ section.deferred.embedded.done( function () {
+ parentContainer = ( section.contentContainer.is( 'ul' ) ) ? section.contentContainer : section.contentContainer.find( 'ul:first' );
+ if ( ! control.container.parent().is( parentContainer ) ) {
+ parentContainer.append( control.container );
+ control.renderContent();
+ }
+ control.deferred.embedded.resolve();
+ });
+ });
+ };
+ control.section.bind( inject );
+ inject( control.section.get() );
+ },
+
+ /**
+ * Triggered when the control's markup has been injected into the DOM.
+ *
+ * @returns {void}
+ */
+ ready: function() {
+ var control = this, newItem;
+ if ( 'dropdown-pages' === control.params.type && control.params.allow_addition ) {
+ newItem = control.container.find( '.new-content-item' );
+ newItem.hide(); // Hide in JS to preserve flex display when showing.
+ control.container.on( 'click', '.add-new-toggle', function( e ) {
+ $( e.currentTarget ).slideUp( 180 );
+ newItem.slideDown( 180 );
+ newItem.find( '.create-item-input' ).focus();
+ });
+ control.container.on( 'click', '.add-content', function() {
+ control.addNewPage();
+ });
+ control.container.on( 'keydown', '.create-item-input', function( e ) {
+ if ( 13 === e.which ) { // Enter
+ control.addNewPage();
+ }
+ });
+ }
+ },
+
+ /**
+ * Get the element inside of a control's container that contains the validation error message.
+ *
+ * Control subclasses may override this to return the proper container to render notifications into.
+ * Injects the notification container for existing controls that lack the necessary container,
+ * including special handling for nav menu items and widgets.
+ *
+ * @since 4.6.0
+ * @returns {jQuery} Setting validation message element.
+ */
+ getNotificationsContainerElement: function() {
+ var control = this, controlTitle, notificationsContainer;
+
+ notificationsContainer = control.container.find( '.customize-control-notifications-container:first' );
+ if ( notificationsContainer.length ) {
+ return notificationsContainer;
+ }
+
+ notificationsContainer = $( '<div class="customize-control-notifications-container"></div>' );
+
+ if ( control.container.hasClass( 'customize-control-nav_menu_item' ) ) {
+ control.container.find( '.menu-item-settings:first' ).prepend( notificationsContainer );
+ } else if ( control.container.hasClass( 'customize-control-widget_form' ) ) {
+ control.container.find( '.widget-inside:first' ).prepend( notificationsContainer );
+ } else {
+ controlTitle = control.container.find( '.customize-control-title' );
+ if ( controlTitle.length ) {
+ controlTitle.after( notificationsContainer );
+ } else {
+ control.container.prepend( notificationsContainer );
+ }
+ }
+ return notificationsContainer;
+ },
+
+ /**
+ * Set up notifications.
+ *
+ * @since 4.9.0
+ * @returns {void}
+ */
+ setupNotifications: function() {
+ var control = this, renderNotificationsIfVisible, onSectionAssigned;
+
+ // Add setting notifications to the control notification.
+ _.each( control.settings, function( setting ) {
+ if ( ! setting.notifications ) {
+ return;
+ }
+ setting.notifications.bind( 'add', function( settingNotification ) {
+ var params = _.extend(
+ {},
+ settingNotification,
+ {
+ setting: setting.id
+ }
+ );
+ control.notifications.add( new api.Notification( setting.id + ':' + settingNotification.code, params ) );
+ } );
+ setting.notifications.bind( 'remove', function( settingNotification ) {
+ control.notifications.remove( setting.id + ':' + settingNotification.code );
+ } );
+ } );
+
+ renderNotificationsIfVisible = function() {
+ var sectionId = control.section();
+ if ( ! sectionId || ( api.section.has( sectionId ) && api.section( sectionId ).expanded() ) ) {
+ control.notifications.render();
+ }
+ };
+
+ control.notifications.bind( 'rendered', function() {
+ var notifications = control.notifications.get();
+ control.container.toggleClass( 'has-notifications', 0 !== notifications.length );
+ control.container.toggleClass( 'has-error', 0 !== _.where( notifications, { type: 'error' } ).length );
+ } );
+
+ onSectionAssigned = function( newSectionId, oldSectionId ) {
+ if ( oldSectionId && api.section.has( oldSectionId ) ) {
+ api.section( oldSectionId ).expanded.unbind( renderNotificationsIfVisible );
+ }
+ if ( newSectionId ) {
+ api.section( newSectionId, function( section ) {
+ section.expanded.bind( renderNotificationsIfVisible );
+ renderNotificationsIfVisible();
+ });
+ }
+ };
+
+ control.section.bind( onSectionAssigned );
+ onSectionAssigned( control.section.get() );
+ control.notifications.bind( 'change', _.debounce( renderNotificationsIfVisible ) );
+ },
+
+ /**
+ * Render notifications.
+ *
+ * Renders the `control.notifications` into the control's container.
+ * Control subclasses may override this method to do their own handling
+ * of rendering notifications.
+ *
+ * @deprecated in favor of `control.notifications.render()`
+ * @since 4.6.0
+ * @this {wp.customize.Control}
+ */
+ renderNotifications: function() {
+ var control = this, container, notifications, hasError = false;
+
+ if ( 'undefined' !== typeof console && console.warn ) {
+ console.warn( '[DEPRECATED] wp.customize.Control.prototype.renderNotifications() is deprecated in favor of instantating a wp.customize.Notifications and calling its render() method.' );
+ }
+
+ container = control.getNotificationsContainerElement();
+ if ( ! container || ! container.length ) {
+ return;
+ }
+ notifications = [];
+ control.notifications.each( function( notification ) {
+ notifications.push( notification );
+ if ( 'error' === notification.type ) {
+ hasError = true;
+ }
+ } );
+
+ if ( 0 === notifications.length ) {
+ container.stop().slideUp( 'fast' );
+ } else {
+ container.stop().slideDown( 'fast', null, function() {
+ $( this ).css( 'height', 'auto' );
+ } );
+ }
+
+ if ( ! control.notificationsTemplate ) {
+ control.notificationsTemplate = wp.template( 'customize-control-notifications' );
+ }
+
+ control.container.toggleClass( 'has-notifications', 0 !== notifications.length );
+ control.container.toggleClass( 'has-error', hasError );
+ container.empty().append( $.trim(
+ control.notificationsTemplate( { notifications: notifications, altNotice: Boolean( control.altNotice ) } )
+ ) );
+ },
+
+ /**
+ * Normal controls do not expand, so just expand its parent
+ *
+ * @param {Object} [params]
+ */
+ expand: function ( params ) {
+ api.section( this.section() ).expand( params );
+ },
+
+ /*
+ * Documented using @borrows in the constructor.
+ */
+ focus: focus,
+
+ /**
+ * Update UI in response to a change in the control's active state.
+ * This does not change the active state, it merely handles the behavior
+ * for when it does change.
+ *
+ * @since 4.1.0
+ *
+ * @param {Boolean} active
+ * @param {Object} args
+ * @param {Number} args.duration
+ * @param {Function} args.completeCallback
+ */
+ onChangeActive: function ( active, args ) {
+ if ( args.unchanged ) {
+ if ( args.completeCallback ) {
+ args.completeCallback();
+ }
+ return;
+ }
+
+ if ( ! $.contains( document, this.container[0] ) ) {
+ // jQuery.fn.slideUp is not hiding an element if it is not in the DOM
+ this.container.toggle( active );
+ if ( args.completeCallback ) {
+ args.completeCallback();
+ }
+ } else if ( active ) {
+ this.container.slideDown( args.duration, args.completeCallback );
+ } else {
+ this.container.slideUp( args.duration, args.completeCallback );
+ }
+ },
+
+ /**
+ * @deprecated 4.1.0 Use this.onChangeActive() instead.
+ */
+ toggle: function ( active ) {
+ return this.onChangeActive( active, this.defaultActiveArguments );
+ },
+
+ /*
+ * Documented using @borrows in the constructor
+ */
+ activate: Container.prototype.activate,
+
+ /*
+ * Documented using @borrows in the constructor
+ */
+ deactivate: Container.prototype.deactivate,
+
+ /*
+ * Documented using @borrows in the constructor
+ */
+ _toggleActive: Container.prototype._toggleActive,
+
+ // @todo This function appears to be dead code and can be removed.
+ dropdownInit: function() {
+ var control = this,
+ statuses = this.container.find('.dropdown-status'),
+ params = this.params,
+ toggleFreeze = false,
+ update = function( to ) {
+ if ( 'string' === typeof to && params.statuses && params.statuses[ to ] ) {
+ statuses.html( params.statuses[ to ] ).show();
+ } else {
+ statuses.hide();
+ }
+ };
+
+ // Support the .dropdown class to open/close complex elements
+ this.container.on( 'click keydown', '.dropdown', function( event ) {
+ if ( api.utils.isKeydownButNotEnterEvent( event ) ) {
+ return;
+ }
+
+ event.preventDefault();
+
+ if ( ! toggleFreeze ) {
+ control.container.toggleClass( 'open' );
+ }
+
+ if ( control.container.hasClass( 'open' ) ) {
+ control.container.parent().parent().find( 'li.library-selected' ).focus();
+ }
+
+ // Don't want to fire focus and click at same time
+ toggleFreeze = true;
+ setTimeout(function () {
+ toggleFreeze = false;
+ }, 400);
+ });
+
+ this.setting.bind( update );
+ update( this.setting() );
+ },
+
+ /**
+ * Render the control from its JS template, if it exists.
+ *
+ * The control's container must already exist in the DOM.
+ *
+ * @since 4.1.0
+ */
+ renderContent: function () {
+ var control = this, template, standardTypes, templateId, sectionId;
+
+ standardTypes = [
+ 'button',
+ 'checkbox',
+ 'date',
+ 'datetime-local',
+ 'email',
+ 'month',
+ 'number',
+ 'password',
+ 'radio',
+ 'range',
+ 'search',
+ 'select',
+ 'tel',
+ 'time',
+ 'text',
+ 'textarea',
+ 'week',
+ 'url'
+ ];
+
+ templateId = control.templateSelector;
+
+ // Use default content template when a standard HTML type is used, there isn't a more specific template existing, and the control container is empty.
+ if ( templateId === 'customize-control-' + control.params.type + '-content' &&
+ _.contains( standardTypes, control.params.type ) &&
+ ! document.getElementById( 'tmpl-' + templateId ) &&
+ 0 === control.container.children().length )
+ {
+ templateId = 'customize-control-default-content';
+ }
+
+ // Replace the container element's content with the control.
+ if ( document.getElementById( 'tmpl-' + templateId ) ) {
+ template = wp.template( templateId );
+ if ( template && control.container ) {
+ control.container.html( template( control.params ) );
+ }
+ }
+
+ // Re-render notifications after content has been re-rendered.
+ control.notifications.container = control.getNotificationsContainerElement();
+ sectionId = control.section();
+ if ( ! sectionId || ( api.section.has( sectionId ) && api.section( sectionId ).expanded() ) ) {
+ control.notifications.render();
+ }
+ },
+
+ /**
+ * Add a new page to a dropdown-pages control reusing menus code for this.
+ *
+ * @since 4.7.0
+ * @access private
+ * @returns {void}
+ */
+ addNewPage: function () {
+ var control = this, promise, toggle, container, input, title, select;
+
+ if ( 'dropdown-pages' !== control.params.type || ! control.params.allow_addition || ! api.Menus ) {
+ return;
+ }
+
+ toggle = control.container.find( '.add-new-toggle' );
+ container = control.container.find( '.new-content-item' );
+ input = control.container.find( '.create-item-input' );
+ title = input.val();
+ select = control.container.find( 'select' );
+
+ if ( ! title ) {
+ input.addClass( 'invalid' );
+ return;
+ }
+
+ input.removeClass( 'invalid' );
+ input.attr( 'disabled', 'disabled' );
+
+ // The menus functions add the page, publish when appropriate, and also add the new page to the dropdown-pages controls.
+ promise = api.Menus.insertAutoDraftPost( {
+ post_title: title,
+ post_type: 'page'
+ } );
+ promise.done( function( data ) {
+ var availableItem, $content, itemTemplate;
+
+ // Prepare the new page as an available menu item.
+ // See api.Menus.submitNew().
+ availableItem = new api.Menus.AvailableItemModel( {
+ 'id': 'post-' + data.post_id, // Used for available menu item Backbone models.
+ 'title': title,
+ 'type': 'post_type',
+ 'type_label': api.Menus.data.l10n.page_label,
+ 'object': 'page',
+ 'object_id': data.post_id,
+ 'url': data.url
+ } );
+
+ // Add the new item to the list of available menu items.
+ api.Menus.availableMenuItemsPanel.collection.add( availableItem );
+ $content = $( '#available-menu-items-post_type-page' ).find( '.available-menu-items-list' );
+ itemTemplate = wp.template( 'available-menu-item' );
+ $content.prepend( itemTemplate( availableItem.attributes ) );
+
+ // Focus the select control.
+ select.focus();
+ control.setting.set( String( data.post_id ) ); // Triggers a preview refresh and updates the setting.
+
+ // Reset the create page form.
+ container.slideUp( 180 );
+ toggle.slideDown( 180 );
+ } );
+ promise.always( function() {
+ input.val( '' ).removeAttr( 'disabled' );
+ } );
+ }
+ });
+
+ /**
+ * A colorpicker control.
+ *
+ * @class wp.customize.ColorControl
+ * @augments wp.customize.Control
+ */
+ api.ColorControl = api.Control.extend(/** @lends wp.customize.ColorControl.prototype */{
+ ready: function() {
+ var control = this,
+ isHueSlider = this.params.mode === 'hue',
+ updating = false,
+ picker;
+
+ if ( isHueSlider ) {
+ picker = this.container.find( '.color-picker-hue' );
+ picker.val( control.setting() ).wpColorPicker({
+ change: function( event, ui ) {
+ updating = true;
+ control.setting( ui.color.h() );
+ updating = false;
+ }
+ });
+ } else {
+ picker = this.container.find( '.color-picker-hex' );
+ picker.val( control.setting() ).wpColorPicker({
+ change: function() {
+ updating = true;
+ control.setting.set( picker.wpColorPicker( 'color' ) );
+ updating = false;
+ },
+ clear: function() {
+ updating = true;
+ control.setting.set( '' );
+ updating = false;
+ }
+ });
+ }
+
+ control.setting.bind( function ( value ) {
+ // Bail if the update came from the control itself.
+ if ( updating ) {
+ return;
+ }
+ picker.val( value );
+ picker.wpColorPicker( 'color', value );
+ } );
+
+ // Collapse color picker when hitting Esc instead of collapsing the current section.
+ control.container.on( 'keydown', function( event ) {
+ var pickerContainer;
+ if ( 27 !== event.which ) { // Esc.
+ return;
+ }
+ pickerContainer = control.container.find( '.wp-picker-container' );
+ if ( pickerContainer.hasClass( 'wp-picker-active' ) ) {
+ picker.wpColorPicker( 'close' );
+ control.container.find( '.wp-color-result' ).focus();
+ event.stopPropagation(); // Prevent section from being collapsed.
+ }
+ } );
+ }
+ });
+
+ /**
+ * A control that implements the media modal.
+ *
+ * @class wp.customize.MediaControl
+ * @augments wp.customize.Control
+ */
+ api.MediaControl = api.Control.extend(/** @lends wp.customize.MediaControl.prototype */{
+
+ /**
+ * When the control's DOM structure is ready,
+ * set up internal event bindings.
+ */
+ ready: function() {
+ var control = this;
+ // Shortcut so that we don't have to use _.bind every time we add a callback.
+ _.bindAll( control, 'restoreDefault', 'removeFile', 'openFrame', 'select', 'pausePlayer' );
+
+ // Bind events, with delegation to facilitate re-rendering.
+ control.container.on( 'click keydown', '.upload-button', control.openFrame );
+ control.container.on( 'click keydown', '.upload-button', control.pausePlayer );
+ control.container.on( 'click keydown', '.thumbnail-image img', control.openFrame );
+ control.container.on( 'click keydown', '.default-button', control.restoreDefault );
+ control.container.on( 'click keydown', '.remove-button', control.pausePlayer );
+ control.container.on( 'click keydown', '.remove-button', control.removeFile );
+ control.container.on( 'click keydown', '.remove-button', control.cleanupPlayer );
+
+ // Resize the player controls when it becomes visible (ie when section is expanded)
+ api.section( control.section() ).container
+ .on( 'expanded', function() {
+ if ( control.player ) {
+ control.player.setControlsSize();
+ }
+ })
+ .on( 'collapsed', function() {
+ control.pausePlayer();
+ });
+
+ /**
+ * Set attachment data and render content.
+ *
+ * Note that BackgroundImage.prototype.ready applies this ready method
+ * to itself. Since BackgroundImage is an UploadControl, the value
+ * is the attachment URL instead of the attachment ID. In this case
+ * we skip fetching the attachment data because we have no ID available,
+ * and it is the responsibility of the UploadControl to set the control's
+ * attachmentData before calling the renderContent method.
+ *
+ * @param {number|string} value Attachment
+ */
+ function setAttachmentDataAndRenderContent( value ) {
+ var hasAttachmentData = $.Deferred();
+
+ if ( control.extended( api.UploadControl ) ) {
+ hasAttachmentData.resolve();
+ } else {
+ value = parseInt( value, 10 );
+ if ( _.isNaN( value ) || value <= 0 ) {
+ delete control.params.attachment;
+ hasAttachmentData.resolve();
+ } else if ( control.params.attachment && control.params.attachment.id === value ) {
+ hasAttachmentData.resolve();
+ }
+ }
+
+ // Fetch the attachment data.
+ if ( 'pending' === hasAttachmentData.state() ) {
+ wp.media.attachment( value ).fetch().done( function() {
+ control.params.attachment = this.attributes;
+ hasAttachmentData.resolve();
+
+ // Send attachment information to the preview for possible use in `postMessage` transport.
+ wp.customize.previewer.send( control.setting.id + '-attachment-data', this.attributes );
+ } );
+ }
+
+ hasAttachmentData.done( function() {
+ control.renderContent();
+ } );
+ }
+
+ // Ensure attachment data is initially set (for dynamically-instantiated controls).
+ setAttachmentDataAndRenderContent( control.setting() );
+
+ // Update the attachment data and re-render the control when the setting changes.
+ control.setting.bind( setAttachmentDataAndRenderContent );
+ },
+
+ pausePlayer: function () {
+ this.player && this.player.pause();
+ },
+
+ cleanupPlayer: function () {
+ this.player && wp.media.mixin.removePlayer( this.player );
+ },
+
+ /**
+ * Open the media modal.
+ */
+ openFrame: function( event ) {
+ if ( api.utils.isKeydownButNotEnterEvent( event ) ) {
+ return;
+ }
+
+ event.preventDefault();
+
+ if ( ! this.frame ) {
+ this.initFrame();
+ }
+
+ this.frame.open();
+ },
+
+ /**
+ * Create a media modal select frame, and store it so the instance can be reused when needed.
+ */
+ initFrame: function() {
+ this.frame = wp.media({
+ button: {
+ text: this.params.button_labels.frame_button
+ },
+ states: [
+ new wp.media.controller.Library({
+ title: this.params.button_labels.frame_title,
+ library: wp.media.query({ type: this.params.mime_type }),
+ multiple: false,
+ date: false
+ })
+ ]
+ });
+
+ // When a file is selected, run a callback.
+ this.frame.on( 'select', this.select );
+ },
+
+ /**
+ * Callback handler for when an attachment is selected in the media modal.
+ * Gets the selected image information, and sets it within the control.
+ */
+ select: function() {
+ // Get the attachment from the modal frame.
+ var node,
+ attachment = this.frame.state().get( 'selection' ).first().toJSON(),
+ mejsSettings = window._wpmejsSettings || {};
+
+ this.params.attachment = attachment;
+
+ // Set the Customizer setting; the callback takes care of rendering.
+ this.setting( attachment.id );
+ node = this.container.find( 'audio, video' ).get(0);
+
+ // Initialize audio/video previews.
+ if ( node ) {
+ this.player = new MediaElementPlayer( node, mejsSettings );
+ } else {
+ this.cleanupPlayer();
+ }
+ },
+
+ /**
+ * Reset the setting to the default value.
+ */
+ restoreDefault: function( event ) {
+ if ( api.utils.isKeydownButNotEnterEvent( event ) ) {
+ return;
+ }
+ event.preventDefault();
+
+ this.params.attachment = this.params.defaultAttachment;
+ this.setting( this.params.defaultAttachment.url );
+ },
+
+ /**
+ * Called when the "Remove" link is clicked. Empties the setting.
+ *
+ * @param {object} event jQuery Event object
+ */
+ removeFile: function( event ) {
+ if ( api.utils.isKeydownButNotEnterEvent( event ) ) {
+ return;
+ }
+ event.preventDefault();
+
+ this.params.attachment = {};
+ this.setting( '' );
+ this.renderContent(); // Not bound to setting change when emptying.
+ }
+ });
+
+ /**
+ * An upload control, which utilizes the media modal.
+ *
+ * @class wp.customize.UploadControl
+ * @augments wp.customize.MediaControl
+ */
+ api.UploadControl = api.MediaControl.extend(/** @lends wp.customize.UploadControl.prototype */{
+
+ /**
+ * Callback handler for when an attachment is selected in the media modal.
+ * Gets the selected image information, and sets it within the control.
+ */
+ select: function() {
+ // Get the attachment from the modal frame.
+ var node,
+ attachment = this.frame.state().get( 'selection' ).first().toJSON(),
+ mejsSettings = window._wpmejsSettings || {};
+
+ this.params.attachment = attachment;
+
+ // Set the Customizer setting; the callback takes care of rendering.
+ this.setting( attachment.url );
+ node = this.container.find( 'audio, video' ).get(0);
+
+ // Initialize audio/video previews.
+ if ( node ) {
+ this.player = new MediaElementPlayer( node, mejsSettings );
+ } else {
+ this.cleanupPlayer();
+ }
+ },
+
+ // @deprecated
+ success: function() {},
+
+ // @deprecated
+ removerVisibility: function() {}
+ });
+
+ /**
+ * A control for uploading images.
+ *
+ * This control no longer needs to do anything more
+ * than what the upload control does in JS.
+ *
+ * @class wp.customize.ImageControl
+ * @augments wp.customize.UploadControl
+ */
+ api.ImageControl = api.UploadControl.extend(/** @lends wp.customize.ImageControl.prototype */{
+ // @deprecated
+ thumbnailSrc: function() {}
+ });
+
+ /**
+ * A control for uploading background images.
+ *
+ * @class wp.customize.BackgroundControl
+ * @augments wp.customize.UploadControl
+ */
+ api.BackgroundControl = api.UploadControl.extend(/** @lends wp.customize.BackgroundControl.prototype */{
+
+ /**
+ * When the control's DOM structure is ready,
+ * set up internal event bindings.
+ */
+ ready: function() {
+ api.UploadControl.prototype.ready.apply( this, arguments );
+ },
+
+ /**
+ * Callback handler for when an attachment is selected in the media modal.
+ * Does an additional AJAX request for setting the background context.
+ */
+ select: function() {
+ api.UploadControl.prototype.select.apply( this, arguments );
+
+ wp.ajax.post( 'custom-background-add', {
+ nonce: _wpCustomizeBackground.nonces.add,
+ wp_customize: 'on',
+ customize_theme: api.settings.theme.stylesheet,
+ attachment_id: this.params.attachment.id
+ } );
+ }
+ });
+
+ /**
+ * A control for positioning a background image.
+ *
+ * @since 4.7.0
+ *
+ * @class wp.customize.BackgroundPositionControl
+ * @augments wp.customize.Control
+ */
+ api.BackgroundPositionControl = api.Control.extend(/** @lends wp.customize.BackgroundPositionControl.prototype */{
+
+ /**
+ * Set up control UI once embedded in DOM and settings are created.
+ *
+ * @since 4.7.0
+ * @access public
+ */
+ ready: function() {
+ var control = this, updateRadios;
+
+ control.container.on( 'change', 'input[name="background-position"]', function() {
+ var position = $( this ).val().split( ' ' );
+ control.settings.x( position[0] );
+ control.settings.y( position[1] );
+ } );
+
+ updateRadios = _.debounce( function() {
+ var x, y, radioInput, inputValue;
+ x = control.settings.x.get();
+ y = control.settings.y.get();
+ inputValue = String( x ) + ' ' + String( y );
+ radioInput = control.container.find( 'input[name="background-position"][value="' + inputValue + '"]' );
+ radioInput.click();
+ } );
+ control.settings.x.bind( updateRadios );
+ control.settings.y.bind( updateRadios );
+
+ updateRadios(); // Set initial UI.
+ }
+ } );
+
+ /**
+ * A control for selecting and cropping an image.
+ *
+ * @class wp.customize.CroppedImageControl
+ * @augments wp.customize.MediaControl
+ */
+ api.CroppedImageControl = api.MediaControl.extend(/** @lends wp.customize.CroppedImageControl.prototype */{
+
+ /**
+ * Open the media modal to the library state.
+ */
+ openFrame: function( event ) {
+ if ( api.utils.isKeydownButNotEnterEvent( event ) ) {
+ return;
+ }
+
+ this.initFrame();
+ this.frame.setState( 'library' ).open();
+ },
+
+ /**
+ * Create a media modal select frame, and store it so the instance can be reused when needed.
+ */
+ initFrame: function() {
+ var l10n = _wpMediaViewsL10n;
+
+ this.frame = wp.media({
+ button: {
+ text: l10n.select,
+ close: false
+ },
+ states: [
+ new wp.media.controller.Library({
+ title: this.params.button_labels.frame_title,
+ library: wp.media.query({ type: 'image' }),
+ multiple: false,
+ date: false,
+ priority: 20,
+ suggestedWidth: this.params.width,
+ suggestedHeight: this.params.height
+ }),
+ new wp.media.controller.CustomizeImageCropper({
+ imgSelectOptions: this.calculateImageSelectOptions,
+ control: this
+ })
+ ]
+ });
+
+ this.frame.on( 'select', this.onSelect, this );
+ this.frame.on( 'cropped', this.onCropped, this );
+ this.frame.on( 'skippedcrop', this.onSkippedCrop, this );
+ },
+
+ /**
+ * After an image is selected in the media modal, switch to the cropper
+ * state if the image isn't the right size.
+ */
+ onSelect: function() {
+ var attachment = this.frame.state().get( 'selection' ).first().toJSON();
+
+ if ( this.params.width === attachment.width && this.params.height === attachment.height && ! this.params.flex_width && ! this.params.flex_height ) {
+ this.setImageFromAttachment( attachment );
+ this.frame.close();
+ } else {
+ this.frame.setState( 'cropper' );
+ }
+ },
+
+ /**
+ * After the image has been cropped, apply the cropped image data to the setting.
+ *
+ * @param {object} croppedImage Cropped attachment data.
+ */
+ onCropped: function( croppedImage ) {
+ this.setImageFromAttachment( croppedImage );
+ },
+
+ /**
+ * Returns a set of options, computed from the attached image data and
+ * control-specific data, to be fed to the imgAreaSelect plugin in
+ * wp.media.view.Cropper.
+ *
+ * @param {wp.media.model.Attachment} attachment
+ * @param {wp.media.controller.Cropper} controller
+ * @returns {Object} Options
+ */
+ calculateImageSelectOptions: function( attachment, controller ) {
+ var control = controller.get( 'control' ),
+ flexWidth = !! parseInt( control.params.flex_width, 10 ),
+ flexHeight = !! parseInt( control.params.flex_height, 10 ),
+ realWidth = attachment.get( 'width' ),
+ realHeight = attachment.get( 'height' ),
+ xInit = parseInt( control.params.width, 10 ),
+ yInit = parseInt( control.params.height, 10 ),
+ ratio = xInit / yInit,
+ xImg = xInit,
+ yImg = yInit,
+ x1, y1, imgSelectOptions;
+
+ controller.set( 'canSkipCrop', ! control.mustBeCropped( flexWidth, flexHeight, xInit, yInit, realWidth, realHeight ) );
+
+ if ( realWidth / realHeight > ratio ) {
+ yInit = realHeight;
+ xInit = yInit * ratio;
+ } else {
+ xInit = realWidth;
+ yInit = xInit / ratio;
+ }
+
+ x1 = ( realWidth - xInit ) / 2;
+ y1 = ( realHeight - yInit ) / 2;
+
+ imgSelectOptions = {
+ handles: true,
+ keys: true,
+ instance: true,
+ persistent: true,
+ imageWidth: realWidth,
+ imageHeight: realHeight,
+ minWidth: xImg > xInit ? xInit : xImg,
+ minHeight: yImg > yInit ? yInit : yImg,
+ x1: x1,
+ y1: y1,
+ x2: xInit + x1,
+ y2: yInit + y1
+ };
+
+ if ( flexHeight === false && flexWidth === false ) {
+ imgSelectOptions.aspectRatio = xInit + ':' + yInit;
+ }
+
+ if ( true === flexHeight ) {
+ delete imgSelectOptions.minHeight;
+ imgSelectOptions.maxWidth = realWidth;
+ }
+
+ if ( true === flexWidth ) {
+ delete imgSelectOptions.minWidth;
+ imgSelectOptions.maxHeight = realHeight;
+ }
+
+ return imgSelectOptions;
+ },
+
+ /**
+ * Return whether the image must be cropped, based on required dimensions.
+ *
+ * @param {bool} flexW
+ * @param {bool} flexH
+ * @param {int} dstW
+ * @param {int} dstH
+ * @param {int} imgW
+ * @param {int} imgH
+ * @return {bool}
+ */
+ mustBeCropped: function( flexW, flexH, dstW, dstH, imgW, imgH ) {
+ if ( true === flexW && true === flexH ) {
+ return false;
+ }
+
+ if ( true === flexW && dstH === imgH ) {
+ return false;
+ }
+
+ if ( true === flexH && dstW === imgW ) {
+ return false;
+ }
+
+ if ( dstW === imgW && dstH === imgH ) {
+ return false;
+ }
+
+ if ( imgW <= dstW ) {
+ return false;
+ }
+
+ return true;
+ },
+
+ /**
+ * If cropping was skipped, apply the image data directly to the setting.
+ */
+ onSkippedCrop: function() {
+ var attachment = this.frame.state().get( 'selection' ).first().toJSON();
+ this.setImageFromAttachment( attachment );
+ },
+
+ /**
+ * Updates the setting and re-renders the control UI.
+ *
+ * @param {object} attachment
+ */
+ setImageFromAttachment: function( attachment ) {
+ this.params.attachment = attachment;
+
+ // Set the Customizer setting; the callback takes care of rendering.
+ this.setting( attachment.id );
+ }
+ });
+
+ /**
+ * A control for selecting and cropping Site Icons.
+ *
+ * @class wp.customize.SiteIconControl
+ * @augments wp.customize.CroppedImageControl
+ */
+ api.SiteIconControl = api.CroppedImageControl.extend(/** @lends wp.customize.SiteIconControl.prototype */{
+
+ /**
+ * Create a media modal select frame, and store it so the instance can be reused when needed.
+ */
+ initFrame: function() {
+ var l10n = _wpMediaViewsL10n;
+
+ this.frame = wp.media({
+ button: {
+ text: l10n.select,
+ close: false
+ },
+ states: [
+ new wp.media.controller.Library({
+ title: this.params.button_labels.frame_title,
+ library: wp.media.query({ type: 'image' }),
+ multiple: false,
+ date: false,
+ priority: 20,
+ suggestedWidth: this.params.width,
+ suggestedHeight: this.params.height
+ }),
+ new wp.media.controller.SiteIconCropper({
+ imgSelectOptions: this.calculateImageSelectOptions,
+ control: this
+ })
+ ]
+ });
+
+ this.frame.on( 'select', this.onSelect, this );
+ this.frame.on( 'cropped', this.onCropped, this );
+ this.frame.on( 'skippedcrop', this.onSkippedCrop, this );
+ },
+
+ /**
+ * After an image is selected in the media modal, switch to the cropper
+ * state if the image isn't the right size.
+ */
+ onSelect: function() {
+ var attachment = this.frame.state().get( 'selection' ).first().toJSON(),
+ controller = this;
+
+ if ( this.params.width === attachment.width && this.params.height === attachment.height && ! this.params.flex_width && ! this.params.flex_height ) {
+ wp.ajax.post( 'crop-image', {
+ nonce: attachment.nonces.edit,
+ id: attachment.id,
+ context: 'site-icon',
+ cropDetails: {
+ x1: 0,
+ y1: 0,
+ width: this.params.width,
+ height: this.params.height,
+ dst_width: this.params.width,
+ dst_height: this.params.height
+ }
+ } ).done( function( croppedImage ) {
+ controller.setImageFromAttachment( croppedImage );
+ controller.frame.close();
+ } ).fail( function() {
+ controller.frame.trigger('content:error:crop');
+ } );
+ } else {
+ this.frame.setState( 'cropper' );
+ }
+ },
+
+ /**
+ * Updates the setting and re-renders the control UI.
+ *
+ * @param {object} attachment
+ */
+ setImageFromAttachment: function( attachment ) {
+ var sizes = [ 'site_icon-32', 'thumbnail', 'full' ], link,
+ icon;
+
+ _.each( sizes, function( size ) {
+ if ( ! icon && ! _.isUndefined ( attachment.sizes[ size ] ) ) {
+ icon = attachment.sizes[ size ];
+ }
+ } );
+
+ this.params.attachment = attachment;
+
+ // Set the Customizer setting; the callback takes care of rendering.
+ this.setting( attachment.id );
+
+ if ( ! icon ) {
+ return;
+ }
+
+ // Update the icon in-browser.
+ link = $( 'link[rel="icon"][sizes="32x32"]' );
+ link.attr( 'href', icon.url );
+ },
+
+ /**
+ * Called when the "Remove" link is clicked. Empties the setting.
+ *
+ * @param {object} event jQuery Event object
+ */
+ removeFile: function( event ) {
+ if ( api.utils.isKeydownButNotEnterEvent( event ) ) {
+ return;
+ }
+ event.preventDefault();
+
+ this.params.attachment = {};
+ this.setting( '' );
+ this.renderContent(); // Not bound to setting change when emptying.
+ $( 'link[rel="icon"][sizes="32x32"]' ).attr( 'href', '/favicon.ico' ); // Set to default.
+ }
+ });
+
+ /**
+ * @class wp.customize.HeaderControl
+ * @augments wp.customize.Control
+ */
+ api.HeaderControl = api.Control.extend(/** @lends wp.customize.HeaderControl.prototype */{
+ ready: function() {
+ this.btnRemove = $('#customize-control-header_image .actions .remove');
+ this.btnNew = $('#customize-control-header_image .actions .new');
+
+ _.bindAll(this, 'openMedia', 'removeImage');
+
+ this.btnNew.on( 'click', this.openMedia );
+ this.btnRemove.on( 'click', this.removeImage );
+
+ api.HeaderTool.currentHeader = this.getInitialHeaderImage();
+
+ new api.HeaderTool.CurrentView({
+ model: api.HeaderTool.currentHeader,
+ el: '#customize-control-header_image .current .container'
+ });
+
+ new api.HeaderTool.ChoiceListView({
+ collection: api.HeaderTool.UploadsList = new api.HeaderTool.ChoiceList(),
+ el: '#customize-control-header_image .choices .uploaded .list'
+ });
+
+ new api.HeaderTool.ChoiceListView({
+ collection: api.HeaderTool.DefaultsList = new api.HeaderTool.DefaultsList(),
+ el: '#customize-control-header_image .choices .default .list'
+ });
+
+ api.HeaderTool.combinedList = api.HeaderTool.CombinedList = new api.HeaderTool.CombinedList([
+ api.HeaderTool.UploadsList,
+ api.HeaderTool.DefaultsList
+ ]);
+
+ // Ensure custom-header-crop Ajax requests bootstrap the Customizer to activate the previewed theme.
+ wp.media.controller.Cropper.prototype.defaults.doCropArgs.wp_customize = 'on';
+ wp.media.controller.Cropper.prototype.defaults.doCropArgs.customize_theme = api.settings.theme.stylesheet;
+ },
+
+ /**
+ * Returns a new instance of api.HeaderTool.ImageModel based on the currently
+ * saved header image (if any).
+ *
+ * @since 4.2.0
+ *
+ * @returns {Object} Options
+ */
+ getInitialHeaderImage: function() {
+ if ( ! api.get().header_image || ! api.get().header_image_data || _.contains( [ 'remove-header', 'random-default-image', 'random-uploaded-image' ], api.get().header_image ) ) {
+ return new api.HeaderTool.ImageModel();
+ }
+
+ // Get the matching uploaded image object.
+ var currentHeaderObject = _.find( _wpCustomizeHeader.uploads, function( imageObj ) {
+ return ( imageObj.attachment_id === api.get().header_image_data.attachment_id );
+ } );
+ // Fall back to raw current header image.
+ if ( ! currentHeaderObject ) {
+ currentHeaderObject = {
+ url: api.get().header_image,
+ thumbnail_url: api.get().header_image,
+ attachment_id: api.get().header_image_data.attachment_id
+ };
+ }
+
+ return new api.HeaderTool.ImageModel({
+ header: currentHeaderObject,
+ choice: currentHeaderObject.url.split( '/' ).pop()
+ });
+ },
+
+ /**
+ * Returns a set of options, computed from the attached image data and
+ * theme-specific data, to be fed to the imgAreaSelect plugin in
+ * wp.media.view.Cropper.
+ *
+ * @param {wp.media.model.Attachment} attachment
+ * @param {wp.media.controller.Cropper} controller
+ * @returns {Object} Options
+ */
+ calculateImageSelectOptions: function(attachment, controller) {
+ var xInit = parseInt(_wpCustomizeHeader.data.width, 10),
+ yInit = parseInt(_wpCustomizeHeader.data.height, 10),
+ flexWidth = !! parseInt(_wpCustomizeHeader.data['flex-width'], 10),
+ flexHeight = !! parseInt(_wpCustomizeHeader.data['flex-height'], 10),
+ ratio, xImg, yImg, realHeight, realWidth,
+ imgSelectOptions;
+
+ realWidth = attachment.get('width');
+ realHeight = attachment.get('height');
+
+ this.headerImage = new api.HeaderTool.ImageModel();
+ this.headerImage.set({
+ themeWidth: xInit,
+ themeHeight: yInit,
+ themeFlexWidth: flexWidth,
+ themeFlexHeight: flexHeight,
+ imageWidth: realWidth,
+ imageHeight: realHeight
+ });
+
+ controller.set( 'canSkipCrop', ! this.headerImage.shouldBeCropped() );
+
+ ratio = xInit / yInit;
+ xImg = realWidth;
+ yImg = realHeight;
+
+ if ( xImg / yImg > ratio ) {
+ yInit = yImg;
+ xInit = yInit * ratio;
+ } else {
+ xInit = xImg;
+ yInit = xInit / ratio;
+ }
+
+ imgSelectOptions = {
+ handles: true,
+ keys: true,
+ instance: true,
+ persistent: true,
+ imageWidth: realWidth,
+ imageHeight: realHeight,
+ x1: 0,
+ y1: 0,
+ x2: xInit,
+ y2: yInit
+ };
+
+ if (flexHeight === false && flexWidth === false) {
+ imgSelectOptions.aspectRatio = xInit + ':' + yInit;
+ }
+ if (flexHeight === false ) {
+ imgSelectOptions.maxHeight = yInit;
+ }
+ if (flexWidth === false ) {
+ imgSelectOptions.maxWidth = xInit;
+ }
+
+ return imgSelectOptions;
+ },
+
+ /**
+ * Sets up and opens the Media Manager in order to select an image.
+ * Depending on both the size of the image and the properties of the
+ * current theme, a cropping step after selection may be required or
+ * skippable.
+ *
+ * @param {event} event
+ */
+ openMedia: function(event) {
+ var l10n = _wpMediaViewsL10n;
+
+ event.preventDefault();
+
+ this.frame = wp.media({
+ button: {
+ text: l10n.selectAndCrop,
+ close: false
+ },
+ states: [
+ new wp.media.controller.Library({
+ title: l10n.chooseImage,
+ library: wp.media.query({ type: 'image' }),
+ multiple: false,
+ date: false,
+ priority: 20,
+ suggestedWidth: _wpCustomizeHeader.data.width,
+ suggestedHeight: _wpCustomizeHeader.data.height
+ }),
+ new wp.media.controller.Cropper({
+ imgSelectOptions: this.calculateImageSelectOptions
+ })
+ ]
+ });
+
+ this.frame.on('select', this.onSelect, this);
+ this.frame.on('cropped', this.onCropped, this);
+ this.frame.on('skippedcrop', this.onSkippedCrop, this);
+
+ this.frame.open();
+ },
+
+ /**
+ * After an image is selected in the media modal,
+ * switch to the cropper state.
+ */
+ onSelect: function() {
+ this.frame.setState('cropper');
+ },
+
+ /**
+ * After the image has been cropped, apply the cropped image data to the setting.
+ *
+ * @param {object} croppedImage Cropped attachment data.
+ */
+ onCropped: function(croppedImage) {
+ var url = croppedImage.url,
+ attachmentId = croppedImage.attachment_id,
+ w = croppedImage.width,
+ h = croppedImage.height;
+ this.setImageFromURL(url, attachmentId, w, h);
+ },
+
+ /**
+ * If cropping was skipped, apply the image data directly to the setting.
+ *
+ * @param {object} selection
+ */
+ onSkippedCrop: function(selection) {
+ var url = selection.get('url'),
+ w = selection.get('width'),
+ h = selection.get('height');
+ this.setImageFromURL(url, selection.id, w, h);
+ },
+
+ /**
+ * Creates a new wp.customize.HeaderTool.ImageModel from provided
+ * header image data and inserts it into the user-uploaded headers
+ * collection.
+ *
+ * @param {String} url
+ * @param {Number} attachmentId
+ * @param {Number} width
+ * @param {Number} height
+ */
+ setImageFromURL: function(url, attachmentId, width, height) {
+ var choice, data = {};
+
+ data.url = url;
+ data.thumbnail_url = url;
+ data.timestamp = _.now();
+
+ if (attachmentId) {
+ data.attachment_id = attachmentId;
+ }
+
+ if (width) {
+ data.width = width;
+ }
+
+ if (height) {
+ data.height = height;
+ }
+
+ choice = new api.HeaderTool.ImageModel({
+ header: data,
+ choice: url.split('/').pop()
+ });
+ api.HeaderTool.UploadsList.add(choice);
+ api.HeaderTool.currentHeader.set(choice.toJSON());
+ choice.save();
+ choice.importImage();
+ },
+
+ /**
+ * Triggers the necessary events to deselect an image which was set as
+ * the currently selected one.
+ */
+ removeImage: function() {
+ api.HeaderTool.currentHeader.trigger('hide');
+ api.HeaderTool.CombinedList.trigger('control:removeImage');
+ }
+
+ });
+
+ /**
+ * wp.customize.ThemeControl
+ *
+ * @class wp.customize.ThemeControl
+ * @augments wp.customize.Control
+ */
+ api.ThemeControl = api.Control.extend(/** @lends wp.customize.ThemeControl.prototype */{
+
+ touchDrag: false,
+ screenshotRendered: false,
+
+ /**
+ * @since 4.2.0
+ */
+ ready: function() {
+ var control = this, panel = api.panel( 'themes' );
+
+ function disableSwitchButtons() {
+ return ! panel.canSwitchTheme( control.params.theme.id );
+ }
+
+ // Temporary special function since supplying SFTP credentials does not work yet. See #42184.
+ function disableInstallButtons() {
+ return disableSwitchButtons() || false === api.settings.theme._canInstall || true === api.settings.theme._filesystemCredentialsNeeded;
+ }
+ function updateButtons() {
+ control.container.find( 'button.preview, button.preview-theme' ).toggleClass( 'disabled', disableSwitchButtons() );
+ control.container.find( 'button.theme-install' ).toggleClass( 'disabled', disableInstallButtons() );
+ }
+
+ api.state( 'selectedChangesetStatus' ).bind( updateButtons );
+ api.state( 'changesetStatus' ).bind( updateButtons );
+ updateButtons();
+
+ control.container.on( 'touchmove', '.theme', function() {
+ control.touchDrag = true;
+ });
+
+ // Bind details view trigger.
+ control.container.on( 'click keydown touchend', '.theme', function( event ) {
+ var section;
+ if ( api.utils.isKeydownButNotEnterEvent( event ) ) {
+ return;
+ }
+
+ // Bail if the user scrolled on a touch device.
+ if ( control.touchDrag === true ) {
+ return control.touchDrag = false;
+ }
+
+ // Prevent the modal from showing when the user clicks the action button.
+ if ( $( event.target ).is( '.theme-actions .button, .update-theme' ) ) {
+ return;
+ }
+
+ event.preventDefault(); // Keep this AFTER the key filter above
+ section = api.section( control.section() );
+ section.showDetails( control.params.theme, function() {
+
+ // Temporary special function since supplying SFTP credentials does not work yet. See #42184.
+ if ( api.settings.theme._filesystemCredentialsNeeded ) {
+ section.overlay.find( '.theme-actions .delete-theme' ).remove();
+ }
+ } );
+ });
+
+ control.container.on( 'render-screenshot', function() {
+ var $screenshot = $( this ).find( 'img' ),
+ source = $screenshot.data( 'src' );
+
+ if ( source ) {
+ $screenshot.attr( 'src', source );
+ }
+ control.screenshotRendered = true;
+ });
+ },
+
+ /**
+ * Show or hide the theme based on the presence of the term in the title, description, tags, and author.
+ *
+ * @since 4.2.0
+ * @param {Array} terms - An array of terms to search for.
+ * @returns {boolean} Whether a theme control was activated or not.
+ */
+ filter: function( terms ) {
+ var control = this,
+ matchCount = 0,
+ haystack = control.params.theme.name + ' ' +
+ control.params.theme.description + ' ' +
+ control.params.theme.tags + ' ' +
+ control.params.theme.author + ' ';
+ haystack = haystack.toLowerCase().replace( '-', ' ' );
+
+ // Back-compat for behavior in WordPress 4.2.0 to 4.8.X.
+ if ( ! _.isArray( terms ) ) {
+ terms = [ terms ];
+ }
+
+ // Always give exact name matches highest ranking.
+ if ( control.params.theme.name.toLowerCase() === terms.join( ' ' ) ) {
+ matchCount = 100;
+ } else {
+
+ // Search for and weight (by 10) complete term matches.
+ matchCount = matchCount + 10 * ( haystack.split( terms.join( ' ' ) ).length - 1 );
+
+ // Search for each term individually (as whole-word and partial match) and sum weighted match counts.
+ _.each( terms, function( term ) {
+ matchCount = matchCount + 2 * ( haystack.split( term + ' ' ).length - 1 ); // Whole-word, double-weighted.
+ matchCount = matchCount + haystack.split( term ).length - 1; // Partial word, to minimize empty intermediate searches while typing.
+ });
+
+ // Upper limit on match ranking.
+ if ( matchCount > 99 ) {
+ matchCount = 99;
+ }
+ }
+
+ if ( 0 !== matchCount ) {
+ control.activate();
+ control.params.priority = 101 - matchCount; // Sort results by match count.
+ return true;
+ } else {
+ control.deactivate(); // Hide control
+ control.params.priority = 101;
+ return false;
+ }
+ },
+
+ /**
+ * Rerender the theme from its JS template with the installed type.
+ *
+ * @since 4.9.0
+ *
+ * @returns {void}
+ */
+ rerenderAsInstalled: function( installed ) {
+ var control = this, section;
+ if ( installed ) {
+ control.params.theme.type = 'installed';
+ } else {
+ section = api.section( control.params.section );
+ control.params.theme.type = section.params.action;
+ }
+ control.renderContent(); // Replaces existing content.
+ control.container.trigger( 'render-screenshot' );
+ }
+ });
+
+ /**
+ * Class wp.customize.CodeEditorControl
+ *
+ * @since 4.9.0
+ *
+ * @class wp.customize.CodeEditorControl
+ * @augments wp.customize.Control
+ */
+ api.CodeEditorControl = api.Control.extend(/** @lends wp.customize.CodeEditorControl.prototype */{
+
+ /**
+ * Initialize.
+ *
+ * @since 4.9.0
+ * @param {string} id - Unique identifier for the control instance.
+ * @param {object} options - Options hash for the control instance.
+ * @returns {void}
+ */
+ initialize: function( id, options ) {
+ var control = this;
+ control.deferred = _.extend( control.deferred || {}, {
+ codemirror: $.Deferred()
+ } );
+ api.Control.prototype.initialize.call( control, id, options );
+
+ // Note that rendering is debounced so the props will be used when rendering happens after add event.
+ control.notifications.bind( 'add', function( notification ) {
+
+ // Skip if control notification is not from setting csslint_error notification.
+ if ( notification.code !== control.setting.id + ':csslint_error' ) {
+ return;
+ }
+
+ // Customize the template and behavior of csslint_error notifications.
+ notification.templateId = 'customize-code-editor-lint-error-notification';
+ notification.render = (function( render ) {
+ return function() {
+ var li = render.call( this );
+ li.find( 'input[type=checkbox]' ).on( 'click', function() {
+ control.setting.notifications.remove( 'csslint_error' );
+ } );
+ return li;
+ };
+ })( notification.render );
+ } );
+ },
+
+ /**
+ * Initialize the editor when the containing section is ready and expanded.
+ *
+ * @since 4.9.0
+ * @returns {void}
+ */
+ ready: function() {
+ var control = this;
+ if ( ! control.section() ) {
+ control.initEditor();
+ return;
+ }
+
+ // Wait to initialize editor until section is embedded and expanded.
+ api.section( control.section(), function( section ) {
+ section.deferred.embedded.done( function() {
+ var onceExpanded;
+ if ( section.expanded() ) {
+ control.initEditor();
+ } else {
+ onceExpanded = function( isExpanded ) {
+ if ( isExpanded ) {
+ control.initEditor();
+ section.expanded.unbind( onceExpanded );
+ }
+ };
+ section.expanded.bind( onceExpanded );
+ }
+ } );
+ } );
+ },
+
+ /**
+ * Initialize editor.
+ *
+ * @since 4.9.0
+ * @returns {void}
+ */
+ initEditor: function() {
+ var control = this, element, editorSettings = false;
+
+ // Obtain editorSettings for instantiation.
+ if ( wp.codeEditor && ( _.isUndefined( control.params.editor_settings ) || false !== control.params.editor_settings ) ) {
+
+ // Obtain default editor settings.
+ editorSettings = wp.codeEditor.defaultSettings ? _.clone( wp.codeEditor.defaultSettings ) : {};
+ editorSettings.codemirror = _.extend(
+ {},
+ editorSettings.codemirror,
+ {
+ indentUnit: 2,
+ tabSize: 2
+ }
+ );
+
+ // Merge editor_settings param on top of defaults.
+ if ( _.isObject( control.params.editor_settings ) ) {
+ _.each( control.params.editor_settings, function( value, key ) {
+ if ( _.isObject( value ) ) {
+ editorSettings[ key ] = _.extend(
+ {},
+ editorSettings[ key ],
+ value
+ );
+ }
+ } );
+ }
+ }
+
+ element = new api.Element( control.container.find( 'textarea' ) );
+ control.elements.push( element );
+ element.sync( control.setting );
+ element.set( control.setting() );
+
+ if ( editorSettings ) {
+ control.initSyntaxHighlightingEditor( editorSettings );
+ } else {
+ control.initPlainTextareaEditor();
+ }
+ },
+
+ /**
+ * Make sure editor gets focused when control is focused.
+ *
+ * @since 4.9.0
+ * @param {Object} [params] - Focus params.
+ * @param {Function} [params.completeCallback] - Function to call when expansion is complete.
+ * @returns {void}
+ */
+ focus: function( params ) {
+ var control = this, extendedParams = _.extend( {}, params ), originalCompleteCallback;
+ originalCompleteCallback = extendedParams.completeCallback;
+ extendedParams.completeCallback = function() {
+ if ( originalCompleteCallback ) {
+ originalCompleteCallback();
+ }
+ if ( control.editor ) {
+ control.editor.codemirror.focus();
+ }
+ };
+ api.Control.prototype.focus.call( control, extendedParams );
+ },
+
+ /**
+ * Initialize syntax-highlighting editor.
+ *
+ * @since 4.9.0
+ * @param {object} codeEditorSettings - Code editor settings.
+ * @returns {void}
+ */
+ initSyntaxHighlightingEditor: function( codeEditorSettings ) {
+ var control = this, $textarea = control.container.find( 'textarea' ), settings, suspendEditorUpdate = false;
+
+ settings = _.extend( {}, codeEditorSettings, {
+ onTabNext: _.bind( control.onTabNext, control ),
+ onTabPrevious: _.bind( control.onTabPrevious, control ),
+ onUpdateErrorNotice: _.bind( control.onUpdateErrorNotice, control )
+ });
+
+ control.editor = wp.codeEditor.initialize( $textarea, settings );
+
+ // Improve the editor accessibility.
+ $( control.editor.codemirror.display.lineDiv )
+ .attr({
+ role: 'textbox',
+ 'aria-multiline': 'true',
+ 'aria-label': control.params.label,
+ 'aria-describedby': 'editor-keyboard-trap-help-1 editor-keyboard-trap-help-2 editor-keyboard-trap-help-3 editor-keyboard-trap-help-4'
+ });
+
+ // Focus the editor when clicking on its label.
+ control.container.find( 'label' ).on( 'click', function() {
+ control.editor.codemirror.focus();
+ });
+
+ /*
+ * When the CodeMirror instance changes, mirror to the textarea,
+ * where we have our "true" change event handler bound.
+ */
+ control.editor.codemirror.on( 'change', function( codemirror ) {
+ suspendEditorUpdate = true;
+ $textarea.val( codemirror.getValue() ).trigger( 'change' );
+ suspendEditorUpdate = false;
+ });
+
+ // Update CodeMirror when the setting is changed by another plugin.
+ control.setting.bind( function( value ) {
+ if ( ! suspendEditorUpdate ) {
+ control.editor.codemirror.setValue( value );
+ }
+ });
+
+ // Prevent collapsing section when hitting Esc to tab out of editor.
+ control.editor.codemirror.on( 'keydown', function onKeydown( codemirror, event ) {
+ var escKeyCode = 27;
+ if ( escKeyCode === event.keyCode ) {
+ event.stopPropagation();
+ }
+ });
+
+ control.deferred.codemirror.resolveWith( control, [ control.editor.codemirror ] );
+ },
+
+ /**
+ * Handle tabbing to the field after the editor.
+ *
+ * @since 4.9.0
+ * @returns {void}
+ */
+ onTabNext: function onTabNext() {
+ var control = this, controls, controlIndex, section;
+ section = api.section( control.section() );
+ controls = section.controls();
+ controlIndex = controls.indexOf( control );
+ if ( controls.length === controlIndex + 1 ) {
+ $( '#customize-footer-actions .collapse-sidebar' ).focus();
+ } else {
+ controls[ controlIndex + 1 ].container.find( ':focusable:first' ).focus();
+ }
+ },
+
+ /**
+ * Handle tabbing to the field before the editor.
+ *
+ * @since 4.9.0
+ * @returns {void}
+ */
+ onTabPrevious: function onTabPrevious() {
+ var control = this, controls, controlIndex, section;
+ section = api.section( control.section() );
+ controls = section.controls();
+ controlIndex = controls.indexOf( control );
+ if ( 0 === controlIndex ) {
+ section.contentContainer.find( '.customize-section-title .customize-help-toggle, .customize-section-title .customize-section-description.open .section-description-close' ).last().focus();
+ } else {
+ controls[ controlIndex - 1 ].contentContainer.find( ':focusable:first' ).focus();
+ }
+ },
+
+ /**
+ * Update error notice.
+ *
+ * @since 4.9.0
+ * @param {Array} errorAnnotations - Error annotations.
+ * @returns {void}
+ */
+ onUpdateErrorNotice: function onUpdateErrorNotice( errorAnnotations ) {
+ var control = this, message;
+ control.setting.notifications.remove( 'csslint_error' );
+
+ if ( 0 !== errorAnnotations.length ) {
+ if ( 1 === errorAnnotations.length ) {
+ message = api.l10n.customCssError.singular.replace( '%d', '1' );
+ } else {
+ message = api.l10n.customCssError.plural.replace( '%d', String( errorAnnotations.length ) );
+ }
+ control.setting.notifications.add( new api.Notification( 'csslint_error', {
+ message: message,
+ type: 'error'
+ } ) );
+ }
+ },
+
+ /**
+ * Initialize plain-textarea editor when syntax highlighting is disabled.
+ *
+ * @since 4.9.0
+ * @returns {void}
+ */
+ initPlainTextareaEditor: function() {
+ var control = this, $textarea = control.container.find( 'textarea' ), textarea = $textarea[0];
+
+ $textarea.on( 'blur', function onBlur() {
+ $textarea.data( 'next-tab-blurs', false );
+ } );
+
+ $textarea.on( 'keydown', function onKeydown( event ) {
+ var selectionStart, selectionEnd, value, tabKeyCode = 9, escKeyCode = 27;
+
+ if ( escKeyCode === event.keyCode ) {
+ if ( ! $textarea.data( 'next-tab-blurs' ) ) {
+ $textarea.data( 'next-tab-blurs', true );
+ event.stopPropagation(); // Prevent collapsing the section.
+ }
+ return;
+ }
+
+ // Short-circuit if tab key is not being pressed or if a modifier key *is* being pressed.
+ if ( tabKeyCode !== event.keyCode || event.ctrlKey || event.altKey || event.shiftKey ) {
+ return;
+ }
+
+ // Prevent capturing Tab characters if Esc was pressed.
+ if ( $textarea.data( 'next-tab-blurs' ) ) {
+ return;
+ }
+
+ selectionStart = textarea.selectionStart;
+ selectionEnd = textarea.selectionEnd;
+ value = textarea.value;
+
+ if ( selectionStart >= 0 ) {
+ textarea.value = value.substring( 0, selectionStart ).concat( '\t', value.substring( selectionEnd ) );
+ $textarea.selectionStart = textarea.selectionEnd = selectionStart + 1;
+ }
+
+ event.stopPropagation();
+ event.preventDefault();
+ });
+
+ control.deferred.codemirror.rejectWith( control );
+ }
+ });
+
+ /**
+ * Class wp.customize.DateTimeControl.
+ *
+ * @since 4.9.0
+ * @class wp.customize.DateTimeControl
+ * @augments wp.customize.Control
+ */
+ api.DateTimeControl = api.Control.extend(/** @lends wp.customize.DateTimeControl.prototype */{
+
+ /**
+ * Initialize behaviors.
+ *
+ * @since 4.9.0
+ * @returns {void}
+ */
+ ready: function ready() {
+ var control = this;
+
+ control.inputElements = {};
+ control.invalidDate = false;
+
+ _.bindAll( control, 'populateSetting', 'updateDaysForMonth', 'populateDateInputs' );
+
+ if ( ! control.setting ) {
+ throw new Error( 'Missing setting' );
+ }
+
+ control.container.find( '.date-input' ).each( function() {
+ var input = $( this ), component, element;
+ component = input.data( 'component' );
+ element = new api.Element( input );
+ control.inputElements[ component ] = element;
+ control.elements.push( element );
+
+ // Add invalid date error once user changes (and has blurred the input).
+ input.on( 'change', function() {
+ if ( control.invalidDate ) {
+ control.notifications.add( new api.Notification( 'invalid_date', {
+ message: api.l10n.invalidDate
+ } ) );
+ }
+ } );
+
+ // Remove the error immediately after validity change.
+ input.on( 'input', _.debounce( function() {
+ if ( ! control.invalidDate ) {
+ control.notifications.remove( 'invalid_date' );
+ }
+ } ) );
+
+ // Add zero-padding when blurring field.
+ input.on( 'blur', _.debounce( function() {
+ if ( ! control.invalidDate ) {
+ control.populateDateInputs();
+ }
+ } ) );
+ } );
+
+ control.inputElements.month.bind( control.updateDaysForMonth );
+ control.inputElements.year.bind( control.updateDaysForMonth );
+ control.populateDateInputs();
+ control.setting.bind( control.populateDateInputs );
+
+ // Start populating setting after inputs have been populated.
+ _.each( control.inputElements, function( element ) {
+ element.bind( control.populateSetting );
+ } );
+ },
+
+ /**
+ * Parse datetime string.
+ *
+ * @since 4.9.0
+ *
+ * @param {string} datetime - Date/Time string. Accepts Y-m-d[ H:i[:s]] format.
+ * @returns {object|null} Returns object containing date components or null if parse error.
+ */
+ parseDateTime: function parseDateTime( datetime ) {
+ var control = this, matches, date, midDayHour = 12;
+
+ if ( datetime ) {
+ matches = datetime.match( /^(\d\d\d\d)-(\d\d)-(\d\d)(?: (\d\d):(\d\d)(?::(\d\d))?)?$/ );
+ }
+
+ if ( ! matches ) {
+ return null;
+ }
+
+ matches.shift();
+
+ date = {
+ year: matches.shift(),
+ month: matches.shift(),
+ day: matches.shift(),
+ hour: matches.shift() || '00',
+ minute: matches.shift() || '00',
+ second: matches.shift() || '00'
+ };
+
+ if ( control.params.includeTime && control.params.twelveHourFormat ) {
+ date.hour = parseInt( date.hour, 10 );
+ date.meridian = date.hour >= midDayHour ? 'pm' : 'am';
+ date.hour = date.hour % midDayHour ? String( date.hour % midDayHour ) : String( midDayHour );
+ delete date.second; // @todo Why only if twelveHourFormat?
+ }
+
+ return date;
+ },
+
+ /**
+ * Validates if input components have valid date and time.
+ *
+ * @since 4.9.0
+ * @return {boolean} If date input fields has error.
+ */
+ validateInputs: function validateInputs() {
+ var control = this, components, validityInput;
+
+ control.invalidDate = false;
+
+ components = [ 'year', 'day' ];
+ if ( control.params.includeTime ) {
+ components.push( 'hour', 'minute' );
+ }
+
+ _.find( components, function( component ) {
+ var element, max, min, value;
+
+ element = control.inputElements[ component ];
+ validityInput = element.element.get( 0 );
+ max = parseInt( element.element.attr( 'max' ), 10 );
+ min = parseInt( element.element.attr( 'min' ), 10 );
+ value = parseInt( element(), 10 );
+ control.invalidDate = isNaN( value ) || value > max || value < min;
+
+ if ( ! control.invalidDate ) {
+ validityInput.setCustomValidity( '' );
+ }
+
+ return control.invalidDate;
+ } );
+
+ if ( control.inputElements.meridian && ! control.invalidDate ) {
+ validityInput = control.inputElements.meridian.element.get( 0 );
+ if ( 'am' !== control.inputElements.meridian.get() && 'pm' !== control.inputElements.meridian.get() ) {
+ control.invalidDate = true;
+ } else {
+ validityInput.setCustomValidity( '' );
+ }
+ }
+
+ if ( control.invalidDate ) {
+ validityInput.setCustomValidity( api.l10n.invalidValue );
+ } else {
+ validityInput.setCustomValidity( '' );
+ }
+ if ( ! control.section() || api.section.has( control.section() ) && api.section( control.section() ).expanded() ) {
+ _.result( validityInput, 'reportValidity' );
+ }
+
+ return control.invalidDate;
+ },
+
+ /**
+ * Updates number of days according to the month and year selected.
+ *
+ * @since 4.9.0
+ * @return {void}
+ */
+ updateDaysForMonth: function updateDaysForMonth() {
+ var control = this, daysInMonth, year, month, day;
+
+ month = parseInt( control.inputElements.month(), 10 );
+ year = parseInt( control.inputElements.year(), 10 );
+ day = parseInt( control.inputElements.day(), 10 );
+
+ if ( month && year ) {
+ daysInMonth = new Date( year, month, 0 ).getDate();
+ control.inputElements.day.element.attr( 'max', daysInMonth );
+
+ if ( day > daysInMonth ) {
+ control.inputElements.day( String( daysInMonth ) );
+ }
+ }
+ },
+
+ /**
+ * Populate setting value from the inputs.
+ *
+ * @since 4.9.0
+ * @returns {boolean} If setting updated.
+ */
+ populateSetting: function populateSetting() {
+ var control = this, date;
+
+ if ( control.validateInputs() || ! control.params.allowPastDate && ! control.isFutureDate() ) {
+ return false;
+ }
+
+ date = control.convertInputDateToString();
+ control.setting.set( date );
+ return true;
+ },
+
+ /**
+ * Converts input values to string in Y-m-d H:i:s format.
+ *
+ * @since 4.9.0
+ * @return {string} Date string.
+ */
+ convertInputDateToString: function convertInputDateToString() {
+ var control = this, date = '', dateFormat, hourInTwentyFourHourFormat,
+ getElementValue, pad;
+
+ pad = function( number, padding ) {
+ var zeros;
+ if ( String( number ).length < padding ) {
+ zeros = padding - String( number ).length;
+ number = Math.pow( 10, zeros ).toString().substr( 1 ) + String( number );
+ }
+ return number;
+ };
+
+ getElementValue = function( component ) {
+ var value = parseInt( control.inputElements[ component ].get(), 10 );
+
+ if ( _.contains( [ 'month', 'day', 'hour', 'minute' ], component ) ) {
+ value = pad( value, 2 );
+ } else if ( 'year' === component ) {
+ value = pad( value, 4 );
+ }
+ return value;
+ };
+
+ dateFormat = [ 'year', '-', 'month', '-', 'day' ];
+ if ( control.params.includeTime ) {
+ hourInTwentyFourHourFormat = control.inputElements.meridian ? control.convertHourToTwentyFourHourFormat( control.inputElements.hour(), control.inputElements.meridian() ) : control.inputElements.hour();
+ dateFormat = dateFormat.concat( [ ' ', pad( hourInTwentyFourHourFormat, 2 ), ':', 'minute', ':', '00' ] );
+ }
+
+ _.each( dateFormat, function( component ) {
+ date += control.inputElements[ component ] ? getElementValue( component ) : component;
+ } );
+
+ return date;
+ },
+
+ /**
+ * Check if the date is in the future.
+ *
+ * @since 4.9.0
+ * @returns {boolean} True if future date.
+ */
+ isFutureDate: function isFutureDate() {
+ var control = this;
+ return 0 < api.utils.getRemainingTime( control.convertInputDateToString() );
+ },
+
+ /**
+ * Convert hour in twelve hour format to twenty four hour format.
+ *
+ * @since 4.9.0
+ * @param {string} hourInTwelveHourFormat - Hour in twelve hour format.
+ * @param {string} meridian - Either 'am' or 'pm'.
+ * @returns {string} Hour in twenty four hour format.
+ */
+ convertHourToTwentyFourHourFormat: function convertHour( hourInTwelveHourFormat, meridian ) {
+ var hourInTwentyFourHourFormat, hour, midDayHour = 12;
+
+ hour = parseInt( hourInTwelveHourFormat, 10 );
+ if ( isNaN( hour ) ) {
+ return '';
+ }
+
+ if ( 'pm' === meridian && hour < midDayHour ) {
+ hourInTwentyFourHourFormat = hour + midDayHour;
+ } else if ( 'am' === meridian && midDayHour === hour ) {
+ hourInTwentyFourHourFormat = hour - midDayHour;
+ } else {
+ hourInTwentyFourHourFormat = hour;
+ }
+
+ return String( hourInTwentyFourHourFormat );
+ },
+
+ /**
+ * Populates date inputs in date fields.
+ *
+ * @since 4.9.0
+ * @returns {boolean} Whether the inputs were populated.
+ */
+ populateDateInputs: function populateDateInputs() {
+ var control = this, parsed;
+
+ parsed = control.parseDateTime( control.setting.get() );
+
+ if ( ! parsed ) {
+ return false;
+ }
+
+ _.each( control.inputElements, function( element, component ) {
+ var value = parsed[ component ]; // This will be zero-padded string.
+
+ // Set month and meridian regardless of focused state since they are dropdowns.
+ if ( 'month' === component || 'meridian' === component ) {
+
+ // Options in dropdowns are not zero-padded.
+ value = value.replace( /^0/, '' );
+
+ element.set( value );
+ } else {
+
+ value = parseInt( value, 10 );
+ if ( ! element.element.is( document.activeElement ) ) {
+
+ // Populate element with zero-padded value if not focused.
+ element.set( parsed[ component ] );
+ } else if ( value !== parseInt( element(), 10 ) ) {
+
+ // Forcibly update the value if its underlying value changed, regardless of zero-padding.
+ element.set( String( value ) );
+ }
+ }
+ } );
+
+ return true;
+ },
+
+ /**
+ * Toggle future date notification for date control.
+ *
+ * @since 4.9.0
+ * @param {boolean} notify Add or remove the notification.
+ * @return {wp.customize.DateTimeControl}
+ */
+ toggleFutureDateNotification: function toggleFutureDateNotification( notify ) {
+ var control = this, notificationCode, notification;
+
+ notificationCode = 'not_future_date';
+
+ if ( notify ) {
+ notification = new api.Notification( notificationCode, {
+ type: 'error',
+ message: api.l10n.futureDateError
+ } );
+ control.notifications.add( notification );
+ } else {
+ control.notifications.remove( notificationCode );
+ }
+
+ return control;
+ }
+ });
+
+ /**
+ * Class PreviewLinkControl.
+ *
+ * @since 4.9.0
+ * @class wp.customize.PreviewLinkControl
+ * @augments wp.customize.Control
+ */
+ api.PreviewLinkControl = api.Control.extend(/** @lends wp.customize.PreviewLinkControl.prototype */{
+
+ defaults: _.extend( {}, api.Control.prototype.defaults, {
+ templateId: 'customize-preview-link-control'
+ } ),
+
+ /**
+ * Initialize behaviors.
+ *
+ * @since 4.9.0
+ * @returns {void}
+ */
+ ready: function ready() {
+ var control = this, element, component, node, url, input, button;
+
+ _.bindAll( control, 'updatePreviewLink' );
+
+ if ( ! control.setting ) {
+ control.setting = new api.Value();
+ }
+
+ control.previewElements = {};
+
+ control.container.find( '.preview-control-element' ).each( function() {
+ node = $( this );
+ component = node.data( 'component' );
+ element = new api.Element( node );
+ control.previewElements[ component ] = element;
+ control.elements.push( element );
+ } );
+
+ url = control.previewElements.url;
+ input = control.previewElements.input;
+ button = control.previewElements.button;
+
+ input.link( control.setting );
+ url.link( control.setting );
+
+ url.bind( function( value ) {
+ url.element.parent().attr( {
+ href: value,
+ target: api.settings.changeset.uuid
+ } );
+ } );
+
+ api.bind( 'ready', control.updatePreviewLink );
+ api.state( 'saved' ).bind( control.updatePreviewLink );
+ api.state( 'changesetStatus' ).bind( control.updatePreviewLink );
+ api.state( 'activated' ).bind( control.updatePreviewLink );
+ api.previewer.previewUrl.bind( control.updatePreviewLink );
+
+ button.element.on( 'click', function( event ) {
+ event.preventDefault();
+ if ( control.setting() ) {
+ input.element.select();
+ document.execCommand( 'copy' );
+ button( button.element.data( 'copied-text' ) );
+ }
+ } );
+
+ url.element.parent().on( 'click', function( event ) {
+ if ( $( this ).hasClass( 'disabled' ) ) {
+ event.preventDefault();
+ }
+ } );
+
+ button.element.on( 'mouseenter', function() {
+ if ( control.setting() ) {
+ button( button.element.data( 'copy-text' ) );
+ }
+ } );
+ },
+
+ /**
+ * Updates Preview Link
+ *
+ * @since 4.9.0
+ * @return {void}
+ */
+ updatePreviewLink: function updatePreviewLink() {
+ var control = this, unsavedDirtyValues;
+
+ unsavedDirtyValues = ! api.state( 'saved' ).get() || '' === api.state( 'changesetStatus' ).get() || 'auto-draft' === api.state( 'changesetStatus' ).get();
+
+ control.toggleSaveNotification( unsavedDirtyValues );
+ control.previewElements.url.element.parent().toggleClass( 'disabled', unsavedDirtyValues );
+ control.previewElements.button.element.prop( 'disabled', unsavedDirtyValues );
+ control.setting.set( api.previewer.getFrontendPreviewUrl() );
+ },
+
+ /**
+ * Toggles save notification.
+ *
+ * @since 4.9.0
+ * @param {boolean} notify Add or remove notification.
+ * @return {void}
+ */
+ toggleSaveNotification: function toggleSaveNotification( notify ) {
+ var control = this, notificationCode, notification;
+
+ notificationCode = 'changes_not_saved';
+
+ if ( notify ) {
+ notification = new api.Notification( notificationCode, {
+ type: 'info',
+ message: api.l10n.saveBeforeShare
+ } );
+ control.notifications.add( notification );
+ } else {
+ control.notifications.remove( notificationCode );
+ }
+ }
+ });
+
+ /**
+ * Change objects contained within the main customize object to Settings.
+ *
+ * @alias wp.customize.defaultConstructor
+ */
+ api.defaultConstructor = api.Setting;
+
+ /**
+ * Callback for resolved controls.
+ *
+ * @callback wp.customize.deferredControlsCallback
+ * @param {wp.customize.Control[]} controls Resolved controls.
+ */
+
+ /**
+ * Collection of all registered controls.
+ *
+ * @alias wp.customize.control
+ *
+ * @since 3.4.0
+ *
+ * @type {Function}
+ * @param {...string} ids - One or more ids for controls to obtain.
+ * @param {deferredControlsCallback} [callback] - Function called when all supplied controls exist.
+ * @returns {wp.customize.Control|undefined|jQuery.promise} Control instance or undefined (if function called with one id param), or promise resolving to requested controls.
+ *
+ * @example <caption>Loop over all registered controls.</caption>
+ * wp.customize.control.each( function( control ) { ... } );
+ *
+ * @example <caption>Getting `background_color` control instance.</caption>
+ * control = wp.customize.control( 'background_color' );
+ *
+ * @example <caption>Check if control exists.</caption>
+ * hasControl = wp.customize.control.has( 'background_color' );
+ *
+ * @example <caption>Deferred getting of `background_color` control until it exists, using callback.</caption>
+ * wp.customize.control( 'background_color', function( control ) { ... } );
+ *
+ * @example <caption>Get title and tagline controls when they both exist, using promise (only available when multiple IDs are present).</caption>
+ * promise = wp.customize.control( 'blogname', 'blogdescription' );
+ * promise.done( function( titleControl, taglineControl ) { ... } );
+ *
+ * @example <caption>Get title and tagline controls when they both exist, using callback.</caption>
+ * wp.customize.control( 'blogname', 'blogdescription', function( titleControl, taglineControl ) { ... } );
+ *
+ * @example <caption>Getting setting value for `background_color` control.</caption>
+ * value = wp.customize.control( 'background_color ').setting.get();
+ * value = wp.customize( 'background_color' ).get(); // Same as above, since setting ID and control ID are the same.
+ *
+ * @example <caption>Add new control for site title.</caption>
+ * wp.customize.control.add( new wp.customize.Control( 'other_blogname', {
+ * setting: 'blogname',
+ * type: 'text',
+ * label: 'Site title',
+ * section: 'other_site_identify'
+ * } ) );
+ *
+ * @example <caption>Remove control.</caption>
+ * wp.customize.control.remove( 'other_blogname' );
+ *
+ * @example <caption>Listen for control being added.</caption>
+ * wp.customize.control.bind( 'add', function( addedControl ) { ... } )
+ *
+ * @example <caption>Listen for control being removed.</caption>
+ * wp.customize.control.bind( 'removed', function( removedControl ) { ... } )
+ */
+ api.control = new api.Values({ defaultConstructor: api.Control });
+
+ /**
+ * Callback for resolved sections.
+ *
+ * @callback wp.customize.deferredSectionsCallback
+ * @param {wp.customize.Section[]} sections Resolved sections.
+ */
+
+ /**
+ * Collection of all registered sections.
+ *
+ * @alias wp.customize.section
+ *
+ * @since 3.4.0
+ *
+ * @type {Function}
+ * @param {...string} ids - One or more ids for sections to obtain.
+ * @param {deferredSectionsCallback} [callback] - Function called when all supplied sections exist.
+ * @returns {wp.customize.Section|undefined|jQuery.promise} Section instance or undefined (if function called with one id param), or promise resolving to requested sections.
+ *
+ * @example <caption>Loop over all registered sections.</caption>
+ * wp.customize.section.each( function( section ) { ... } )
+ *
+ * @example <caption>Getting `title_tagline` section instance.</caption>
+ * section = wp.customize.section( 'title_tagline' )
+ *
+ * @example <caption>Expand dynamically-created section when it exists.</caption>
+ * wp.customize.section( 'dynamically_created', function( section ) {
+ * section.expand();
+ * } );
+ *
+ * @see {@link wp.customize.control} for further examples of how to interact with {@link wp.customize.Values} instances.
+ */
+ api.section = new api.Values({ defaultConstructor: api.Section });
+
+ /**
+ * Callback for resolved panels.
+ *
+ * @callback wp.customize.deferredPanelsCallback
+ * @param {wp.customize.Panel[]} panels Resolved panels.
+ */
+
+ /**
+ * Collection of all registered panels.
+ *
+ * @alias wp.customize.panel
+ *
+ * @since 4.0.0
+ *
+ * @type {Function}
+ * @param {...string} ids - One or more ids for panels to obtain.
+ * @param {deferredPanelsCallback} [callback] - Function called when all supplied panels exist.
+ * @returns {wp.customize.Panel|undefined|jQuery.promise} Panel instance or undefined (if function called with one id param), or promise resolving to requested panels.
+ *
+ * @example <caption>Loop over all registered panels.</caption>
+ * wp.customize.panel.each( function( panel ) { ... } )
+ *
+ * @example <caption>Getting nav_menus panel instance.</caption>
+ * panel = wp.customize.panel( 'nav_menus' );
+ *
+ * @example <caption>Expand dynamically-created panel when it exists.</caption>
+ * wp.customize.panel( 'dynamically_created', function( panel ) {
+ * panel.expand();
+ * } );
+ *
+ * @see {@link wp.customize.control} for further examples of how to interact with {@link wp.customize.Values} instances.
+ */
+ api.panel = new api.Values({ defaultConstructor: api.Panel });
+
+ /**
+ * Callback for resolved notifications.
+ *
+ * @callback wp.customize.deferredNotificationsCallback
+ * @param {wp.customize.Notification[]} notifications Resolved notifications.
+ */
+
+ /**
+ * Collection of all global notifications.
+ *
+ * @alias wp.customize.notifications
+ *
+ * @since 4.9.0
+ *
+ * @type {Function}
+ * @param {...string} codes - One or more codes for notifications to obtain.
+ * @param {deferredNotificationsCallback} [callback] - Function called when all supplied notifications exist.
+ * @returns {wp.customize.Notification|undefined|jQuery.promise} notification instance or undefined (if function called with one code param), or promise resolving to requested notifications.
+ *
+ * @example <caption>Check if existing notification</caption>
+ * exists = wp.customize.notifications.has( 'a_new_day_arrived' );
+ *
+ * @example <caption>Obtain existing notification</caption>
+ * notification = wp.customize.notifications( 'a_new_day_arrived' );
+ *
+ * @example <caption>Obtain notification that may not exist yet.</caption>
+ * wp.customize.notifications( 'a_new_day_arrived', function( notification ) { ... } );
+ *
+ * @example <caption>Add a warning notification.</caption>
+ * wp.customize.notifications.add( new wp.customize.Notification( 'midnight_almost_here', {
+ * type: 'warning',
+ * message: 'Midnight has almost arrived!',
+ * dismissible: true
+ * } ) );
+ *
+ * @example <caption>Remove a notification.</caption>
+ * wp.customize.notifications.remove( 'a_new_day_arrived' );
+ *
+ * @see {@link wp.customize.control} for further examples of how to interact with {@link wp.customize.Values} instances.
+ */
+ api.notifications = new api.Notifications();
+
+ api.PreviewFrame = api.Messenger.extend(/** @lends wp.customize.PreviewFrame.prototype */{
+ sensitivity: null, // Will get set to api.settings.timeouts.previewFrameSensitivity.
+
+ /**
+ * An object that fetches a preview in the background of the document, which
+ * allows for seamless replacement of an existing preview.
+ *
+ * @constructs wp.customize.PreviewFrame
+ * @augments wp.customize.Messenger
+ *
+ * @param {object} params.container
+ * @param {object} params.previewUrl
+ * @param {object} params.query
+ * @param {object} options
+ */
+ initialize: function( params, options ) {
+ var deferred = $.Deferred();
+
+ /*
+ * Make the instance of the PreviewFrame the promise object
+ * so other objects can easily interact with it.
+ */
+ deferred.promise( this );
+
+ this.container = params.container;
+
+ $.extend( params, { channel: api.PreviewFrame.uuid() });
+
+ api.Messenger.prototype.initialize.call( this, params, options );
+
+ this.add( 'previewUrl', params.previewUrl );
+
+ this.query = $.extend( params.query || {}, { customize_messenger_channel: this.channel() });
+
+ this.run( deferred );
+ },
+
+ /**
+ * Run the preview request.
+ *
+ * @param {object} deferred jQuery Deferred object to be resolved with
+ * the request.
+ */
+ run: function( deferred ) {
+ var previewFrame = this,
+ loaded = false,
+ ready = false,
+ readyData = null,
+ hasPendingChangesetUpdate = '{}' !== previewFrame.query.customized,
+ urlParser,
+ params,
+ form;
+
+ if ( previewFrame._ready ) {
+ previewFrame.unbind( 'ready', previewFrame._ready );
+ }
+
+ previewFrame._ready = function( data ) {
+ ready = true;
+ readyData = data;
+ previewFrame.container.addClass( 'iframe-ready' );
+ if ( ! data ) {
+ return;
+ }
+
+ if ( loaded ) {
+ deferred.resolveWith( previewFrame, [ data ] );
+ }
+ };
+
+ previewFrame.bind( 'ready', previewFrame._ready );
+
+ urlParser = document.createElement( 'a' );
+ urlParser.href = previewFrame.previewUrl();
+
+ params = _.extend(
+ api.utils.parseQueryString( urlParser.search.substr( 1 ) ),
+ {
+ customize_changeset_uuid: previewFrame.query.customize_changeset_uuid,
+ customize_theme: previewFrame.query.customize_theme,
+ customize_messenger_channel: previewFrame.query.customize_messenger_channel
+ }
+ );
+ if ( api.settings.changeset.autosaved || ! api.state( 'saved' ).get() ) {
+ params.customize_autosaved = 'on';
+ }
+
+ urlParser.search = $.param( params );
+ previewFrame.iframe = $( '<iframe />', {
+ title: api.l10n.previewIframeTitle,
+ name: 'customize-' + previewFrame.channel()
+ } );
+ previewFrame.iframe.attr( 'onmousewheel', '' ); // Workaround for Safari bug. See WP Trac #38149.
+ previewFrame.iframe.attr( 'sandbox', 'allow-forms allow-modals allow-orientation-lock allow-pointer-lock allow-popups allow-popups-to-escape-sandbox allow-presentation allow-same-origin allow-scripts' );
+
+ if ( ! hasPendingChangesetUpdate ) {
+ previewFrame.iframe.attr( 'src', urlParser.href );
+ } else {
+ previewFrame.iframe.attr( 'data-src', urlParser.href ); // For debugging purposes.
+ }
+
+ previewFrame.iframe.appendTo( previewFrame.container );
+ previewFrame.targetWindow( previewFrame.iframe[0].contentWindow );
+
+ /*
+ * Submit customized data in POST request to preview frame window since
+ * there are setting value changes not yet written to changeset.
+ */
+ if ( hasPendingChangesetUpdate ) {
+ form = $( '<form>', {
+ action: urlParser.href,
+ target: previewFrame.iframe.attr( 'name' ),
+ method: 'post',
+ hidden: 'hidden'
+ } );
+ form.append( $( '<input>', {
+ type: 'hidden',
+ name: '_method',
+ value: 'GET'
+ } ) );
+ _.each( previewFrame.query, function( value, key ) {
+ form.append( $( '<input>', {
+ type: 'hidden',
+ name: key,
+ value: value
+ } ) );
+ } );
+ previewFrame.container.append( form );
+ form.submit();
+ form.remove(); // No need to keep the form around after submitted.
+ }
+
+ previewFrame.bind( 'iframe-loading-error', function( error ) {
+ previewFrame.iframe.remove();
+
+ // Check if the user is not logged in.
+ if ( 0 === error ) {
+ previewFrame.login( deferred );
+ return;
+ }
+
+ // Check for cheaters.
+ if ( -1 === error ) {
+ deferred.rejectWith( previewFrame, [ 'cheatin' ] );
+ return;
+ }
+
+ deferred.rejectWith( previewFrame, [ 'request failure' ] );
+ } );
+
+ previewFrame.iframe.one( 'load', function() {
+ loaded = true;
+
+ if ( ready ) {
+ deferred.resolveWith( previewFrame, [ readyData ] );
+ } else {
+ setTimeout( function() {
+ deferred.rejectWith( previewFrame, [ 'ready timeout' ] );
+ }, previewFrame.sensitivity );
+ }
+ });
+ },
+
+ login: function( deferred ) {
+ var self = this,
+ reject;
+
+ reject = function() {
+ deferred.rejectWith( self, [ 'logged out' ] );
+ };
+
+ if ( this.triedLogin ) {
+ return reject();
+ }
+
+ // Check if we have an admin cookie.
+ $.get( api.settings.url.ajax, {
+ action: 'logged-in'
+ }).fail( reject ).done( function( response ) {
+ var iframe;
+
+ if ( '1' !== response ) {
+ reject();
+ }
+
+ iframe = $( '<iframe />', { 'src': self.previewUrl(), 'title': api.l10n.previewIframeTitle } ).hide();
+ iframe.appendTo( self.container );
+ iframe.on( 'load', function() {
+ self.triedLogin = true;
+
+ iframe.remove();
+ self.run( deferred );
+ });
+ });
+ },
+
+ destroy: function() {
+ api.Messenger.prototype.destroy.call( this );
+
+ if ( this.iframe ) {
+ this.iframe.remove();
+ }
+
+ delete this.iframe;
+ delete this.targetWindow;
+ }
+ });
+
+ (function(){
+ var id = 0;
+ /**
+ * Return an incremented ID for a preview messenger channel.
+ *
+ * This function is named "uuid" for historical reasons, but it is a
+ * misnomer as it is not an actual UUID, and it is not universally unique.
+ * This is not to be confused with `api.settings.changeset.uuid`.
+ *
+ * @return {string}
+ */
+ api.PreviewFrame.uuid = function() {
+ return 'preview-' + String( id++ );
+ };
+ }());
+
+ /**
+ * Set the document title of the customizer.
+ *
+ * @alias wp.customize.setDocumentTitle
+ *
+ * @since 4.1.0
+ *
+ * @param {string} documentTitle
+ */
+ api.setDocumentTitle = function ( documentTitle ) {
+ var tmpl, title;
+ tmpl = api.settings.documentTitleTmpl;
+ title = tmpl.replace( '%s', documentTitle );
+ document.title = title;
+ api.trigger( 'title', title );
+ };
+
+ api.Previewer = api.Messenger.extend(/** @lends wp.customize.Previewer.prototype */{
+ refreshBuffer: null, // Will get set to api.settings.timeouts.windowRefresh.
+
+ /**
+ * @constructs wp.customize.Previewer
+ * @augments wp.customize.Messenger
+ *
+ * @param {array} params.allowedUrls
+ * @param {string} params.container A selector or jQuery element for the preview
+ * frame to be placed.
+ * @param {string} params.form
+ * @param {string} params.previewUrl The URL to preview.
+ * @param {object} options
+ */
+ initialize: function( params, options ) {
+ var previewer = this,
+ urlParser = document.createElement( 'a' );
+
+ $.extend( previewer, options || {} );
+ previewer.deferred = {
+ active: $.Deferred()
+ };
+
+ // Debounce to prevent hammering server and then wait for any pending update requests.
+ previewer.refresh = _.debounce(
+ ( function( originalRefresh ) {
+ return function() {
+ var isProcessingComplete, refreshOnceProcessingComplete;
+ isProcessingComplete = function() {
+ return 0 === api.state( 'processing' ).get();
+ };
+ if ( isProcessingComplete() ) {
+ originalRefresh.call( previewer );
+ } else {
+ refreshOnceProcessingComplete = function() {
+ if ( isProcessingComplete() ) {
+ originalRefresh.call( previewer );
+ api.state( 'processing' ).unbind( refreshOnceProcessingComplete );
+ }
+ };
+ api.state( 'processing' ).bind( refreshOnceProcessingComplete );
+ }
+ };
+ }( previewer.refresh ) ),
+ previewer.refreshBuffer
+ );
+
+ previewer.container = api.ensure( params.container );
+ previewer.allowedUrls = params.allowedUrls;
+
+ params.url = window.location.href;
+
+ api.Messenger.prototype.initialize.call( previewer, params );
+
+ urlParser.href = previewer.origin();
+ previewer.add( 'scheme', urlParser.protocol.replace( /:$/, '' ) );
+
+ // Limit the URL to internal, front-end links.
+ //
+ // If the front end and the admin are served from the same domain, load the
+ // preview over ssl if the Customizer is being loaded over ssl. This avoids
+ // insecure content warnings. This is not attempted if the admin and front end
+ // are on different domains to avoid the case where the front end doesn't have
+ // ssl certs.
+
+ previewer.add( 'previewUrl', params.previewUrl ).setter( function( to ) {
+ var result = null, urlParser, queryParams, parsedAllowedUrl, parsedCandidateUrls = [];
+ urlParser = document.createElement( 'a' );
+ urlParser.href = to;
+
+ // Abort if URL is for admin or (static) files in wp-includes or wp-content.
+ if ( /\/wp-(admin|includes|content)(\/|$)/.test( urlParser.pathname ) ) {
+ return null;
+ }
+
+ // Remove state query params.
+ if ( urlParser.search.length > 1 ) {
+ queryParams = api.utils.parseQueryString( urlParser.search.substr( 1 ) );
+ delete queryParams.customize_changeset_uuid;
+ delete queryParams.customize_theme;
+ delete queryParams.customize_messenger_channel;
+ delete queryParams.customize_autosaved;
+ if ( _.isEmpty( queryParams ) ) {
+ urlParser.search = '';
+ } else {
+ urlParser.search = $.param( queryParams );
+ }
+ }
+
+ parsedCandidateUrls.push( urlParser );
+
+ // Prepend list with URL that matches the scheme/protocol of the iframe.
+ if ( previewer.scheme.get() + ':' !== urlParser.protocol ) {
+ urlParser = document.createElement( 'a' );
+ urlParser.href = parsedCandidateUrls[0].href;
+ urlParser.protocol = previewer.scheme.get() + ':';
+ parsedCandidateUrls.unshift( urlParser );
+ }
+
+ // Attempt to match the URL to the control frame's scheme and check if it's allowed. If not, try the original URL.
+ parsedAllowedUrl = document.createElement( 'a' );
+ _.find( parsedCandidateUrls, function( parsedCandidateUrl ) {
+ return ! _.isUndefined( _.find( previewer.allowedUrls, function( allowedUrl ) {
+ parsedAllowedUrl.href = allowedUrl;
+ if ( urlParser.protocol === parsedAllowedUrl.protocol && urlParser.host === parsedAllowedUrl.host && 0 === urlParser.pathname.indexOf( parsedAllowedUrl.pathname.replace( /\/$/, '' ) ) ) {
+ result = parsedCandidateUrl.href;
+ return true;
+ }
+ } ) );
+ } );
+
+ return result;
+ });
+
+ previewer.bind( 'ready', previewer.ready );
+
+ // Start listening for keep-alive messages when iframe first loads.
+ previewer.deferred.active.done( _.bind( previewer.keepPreviewAlive, previewer ) );
+
+ previewer.bind( 'synced', function() {
+ previewer.send( 'active' );
+ } );
+
+ // Refresh the preview when the URL is changed (but not yet).
+ previewer.previewUrl.bind( previewer.refresh );
+
+ previewer.scroll = 0;
+ previewer.bind( 'scroll', function( distance ) {
+ previewer.scroll = distance;
+ });
+
+ // Update the URL when the iframe sends a URL message, resetting scroll position. If URL is unchanged, then refresh.
+ previewer.bind( 'url', function( url ) {
+ var onUrlChange, urlChanged = false;
+ previewer.scroll = 0;
+ onUrlChange = function() {
+ urlChanged = true;
+ };
+ previewer.previewUrl.bind( onUrlChange );
+ previewer.previewUrl.set( url );
+ previewer.previewUrl.unbind( onUrlChange );
+ if ( ! urlChanged ) {
+ previewer.refresh();
+ }
+ } );
+
+ // Update the document title when the preview changes.
+ previewer.bind( 'documentTitle', function ( title ) {
+ api.setDocumentTitle( title );
+ } );
+ },
+
+ /**
+ * Handle the preview receiving the ready message.
+ *
+ * @since 4.7.0
+ * @access public
+ *
+ * @param {object} data - Data from preview.
+ * @param {string} data.currentUrl - Current URL.
+ * @param {object} data.activePanels - Active panels.
+ * @param {object} data.activeSections Active sections.
+ * @param {object} data.activeControls Active controls.
+ * @returns {void}
+ */
+ ready: function( data ) {
+ var previewer = this, synced = {}, constructs;
+
+ synced.settings = api.get();
+ synced['settings-modified-while-loading'] = previewer.settingsModifiedWhileLoading;
+ if ( 'resolved' !== previewer.deferred.active.state() || previewer.loading ) {
+ synced.scroll = previewer.scroll;
+ }
+ synced['edit-shortcut-visibility'] = api.state( 'editShortcutVisibility' ).get();
+ previewer.send( 'sync', synced );
+
+ // Set the previewUrl without causing the url to set the iframe.
+ if ( data.currentUrl ) {
+ previewer.previewUrl.unbind( previewer.refresh );
+ previewer.previewUrl.set( data.currentUrl );
+ previewer.previewUrl.bind( previewer.refresh );
+ }
+
+ /*
+ * Walk over all panels, sections, and controls and set their
+ * respective active states to true if the preview explicitly
+ * indicates as such.
+ */
+ constructs = {
+ panel: data.activePanels,
+ section: data.activeSections,
+ control: data.activeControls
+ };
+ _( constructs ).each( function ( activeConstructs, type ) {
+ api[ type ].each( function ( construct, id ) {
+ var isDynamicallyCreated = _.isUndefined( api.settings[ type + 's' ][ id ] );
+
+ /*
+ * If the construct was created statically in PHP (not dynamically in JS)
+ * then consider a missing (undefined) value in the activeConstructs to
+ * mean it should be deactivated (since it is gone). But if it is
+ * dynamically created then only toggle activation if the value is defined,
+ * as this means that the construct was also then correspondingly
+ * created statically in PHP and the active callback is available.
+ * Otherwise, dynamically-created constructs should normally have
+ * their active states toggled in JS rather than from PHP.
+ */
+ if ( ! isDynamicallyCreated || ! _.isUndefined( activeConstructs[ id ] ) ) {
+ if ( activeConstructs[ id ] ) {
+ construct.activate();
+ } else {
+ construct.deactivate();
+ }
+ }
+ } );
+ } );
+
+ if ( data.settingValidities ) {
+ api._handleSettingValidities( {
+ settingValidities: data.settingValidities,
+ focusInvalidControl: false
+ } );
+ }
+ },
+
+ /**
+ * Keep the preview alive by listening for ready and keep-alive messages.
+ *
+ * If a message is not received in the allotted time then the iframe will be set back to the last known valid URL.
+ *
+ * @since 4.7.0
+ * @access public
+ *
+ * @returns {void}
+ */
+ keepPreviewAlive: function keepPreviewAlive() {
+ var previewer = this, keepAliveTick, timeoutId, handleMissingKeepAlive, scheduleKeepAliveCheck;
+
+ /**
+ * Schedule a preview keep-alive check.
+ *
+ * Note that if a page load takes longer than keepAliveCheck milliseconds,
+ * the keep-alive messages will still be getting sent from the previous
+ * URL.
+ */
+ scheduleKeepAliveCheck = function() {
+ timeoutId = setTimeout( handleMissingKeepAlive, api.settings.timeouts.keepAliveCheck );
+ };
+
+ /**
+ * Set the previewerAlive state to true when receiving a message from the preview.
+ */
+ keepAliveTick = function() {
+ api.state( 'previewerAlive' ).set( true );
+ clearTimeout( timeoutId );
+ scheduleKeepAliveCheck();
+ };
+
+ /**
+ * Set the previewerAlive state to false if keepAliveCheck milliseconds have transpired without a message.
+ *
+ * This is most likely to happen in the case of a connectivity error, or if the theme causes the browser
+ * to navigate to a non-allowed URL. Setting this state to false will force settings with a postMessage
+ * transport to use refresh instead, causing the preview frame also to be replaced with the current
+ * allowed preview URL.
+ */
+ handleMissingKeepAlive = function() {
+ api.state( 'previewerAlive' ).set( false );
+ };
+ scheduleKeepAliveCheck();
+
+ previewer.bind( 'ready', keepAliveTick );
+ previewer.bind( 'keep-alive', keepAliveTick );
+ },
+
+ /**
+ * Query string data sent with each preview request.
+ *
+ * @abstract
+ */
+ query: function() {},
+
+ abort: function() {
+ if ( this.loading ) {
+ this.loading.destroy();
+ delete this.loading;
+ }
+ },
+
+ /**
+ * Refresh the preview seamlessly.
+ *
+ * @since 3.4.0
+ * @access public
+ * @returns {void}
+ */
+ refresh: function() {
+ var previewer = this, onSettingChange;
+
+ // Display loading indicator
+ previewer.send( 'loading-initiated' );
+
+ previewer.abort();
+
+ previewer.loading = new api.PreviewFrame({
+ url: previewer.url(),
+ previewUrl: previewer.previewUrl(),
+ query: previewer.query( { excludeCustomizedSaved: true } ) || {},
+ container: previewer.container
+ });
+
+ previewer.settingsModifiedWhileLoading = {};
+ onSettingChange = function( setting ) {
+ previewer.settingsModifiedWhileLoading[ setting.id ] = true;
+ };
+ api.bind( 'change', onSettingChange );
+ previewer.loading.always( function() {
+ api.unbind( 'change', onSettingChange );
+ } );
+
+ previewer.loading.done( function( readyData ) {
+ var loadingFrame = this, onceSynced;
+
+ previewer.preview = loadingFrame;
+ previewer.targetWindow( loadingFrame.targetWindow() );
+ previewer.channel( loadingFrame.channel() );
+
+ onceSynced = function() {
+ loadingFrame.unbind( 'synced', onceSynced );
+ if ( previewer._previousPreview ) {
+ previewer._previousPreview.destroy();
+ }
+ previewer._previousPreview = previewer.preview;
+ previewer.deferred.active.resolve();
+ delete previewer.loading;
+ };
+ loadingFrame.bind( 'synced', onceSynced );
+
+ // This event will be received directly by the previewer in normal navigation; this is only needed for seamless refresh.
+ previewer.trigger( 'ready', readyData );
+ });
+
+ previewer.loading.fail( function( reason ) {
+ previewer.send( 'loading-failed' );
+
+ if ( 'logged out' === reason ) {
+ if ( previewer.preview ) {
+ previewer.preview.destroy();
+ delete previewer.preview;
+ }
+
+ previewer.login().done( previewer.refresh );
+ }
+
+ if ( 'cheatin' === reason ) {
+ previewer.cheatin();
+ }
+ });
+ },
+
+ login: function() {
+ var previewer = this,
+ deferred, messenger, iframe;
+
+ if ( this._login ) {
+ return this._login;
+ }
+
+ deferred = $.Deferred();
+ this._login = deferred.promise();
+
+ messenger = new api.Messenger({
+ channel: 'login',
+ url: api.settings.url.login
+ });
+
+ iframe = $( '<iframe />', { 'src': api.settings.url.login, 'title': api.l10n.loginIframeTitle } ).appendTo( this.container );
+
+ messenger.targetWindow( iframe[0].contentWindow );
+
+ messenger.bind( 'login', function () {
+ var refreshNonces = previewer.refreshNonces();
+
+ refreshNonces.always( function() {
+ iframe.remove();
+ messenger.destroy();
+ delete previewer._login;
+ });
+
+ refreshNonces.done( function() {
+ deferred.resolve();
+ });
+
+ refreshNonces.fail( function() {
+ previewer.cheatin();
+ deferred.reject();
+ });
+ });
+
+ return this._login;
+ },
+
+ cheatin: function() {
+ $( document.body ).empty().addClass( 'cheatin' ).append(
+ '<h1>' + api.l10n.notAllowedHeading + '</h1>' +
+ '<p>' + api.l10n.notAllowed + '</p>'
+ );
+ },
+
+ refreshNonces: function() {
+ var request, deferred = $.Deferred();
+
+ deferred.promise();
+
+ request = wp.ajax.post( 'customize_refresh_nonces', {
+ wp_customize: 'on',
+ customize_theme: api.settings.theme.stylesheet
+ });
+
+ request.done( function( response ) {
+ api.trigger( 'nonce-refresh', response );
+ deferred.resolve();
+ });
+
+ request.fail( function() {
+ deferred.reject();
+ });
+
+ return deferred;
+ }
+ });
+
+ api.settingConstructor = {};
+ api.controlConstructor = {
+ color: api.ColorControl,
+ media: api.MediaControl,
+ upload: api.UploadControl,
+ image: api.ImageControl,
+ cropped_image: api.CroppedImageControl,
+ site_icon: api.SiteIconControl,
+ header: api.HeaderControl,
+ background: api.BackgroundControl,
+ background_position: api.BackgroundPositionControl,
+ theme: api.ThemeControl,
+ date_time: api.DateTimeControl,
+ code_editor: api.CodeEditorControl
+ };
+ api.panelConstructor = {
+ themes: api.ThemesPanel
+ };
+ api.sectionConstructor = {
+ themes: api.ThemesSection,
+ outer: api.OuterSection
+ };
+
+ /**
+ * Handle setting_validities in an error response for the customize-save request.
+ *
+ * Add notifications to the settings and focus on the first control that has an invalid setting.
+ *
+ * @alias wp.customize._handleSettingValidities
+ *
+ * @since 4.6.0
+ * @private
+ *
+ * @param {object} args
+ * @param {object} args.settingValidities
+ * @param {boolean} [args.focusInvalidControl=false]
+ * @returns {void}
+ */
+ api._handleSettingValidities = function handleSettingValidities( args ) {
+ var invalidSettingControls, invalidSettings = [], wasFocused = false;
+
+ // Find the controls that correspond to each invalid setting.
+ _.each( args.settingValidities, function( validity, settingId ) {
+ var setting = api( settingId );
+ if ( setting ) {
+
+ // Add notifications for invalidities.
+ if ( _.isObject( validity ) ) {
+ _.each( validity, function( params, code ) {
+ var notification, existingNotification, needsReplacement = false;
+ notification = new api.Notification( code, _.extend( { fromServer: true }, params ) );
+
+ // Remove existing notification if already exists for code but differs in parameters.
+ existingNotification = setting.notifications( notification.code );
+ if ( existingNotification ) {
+ needsReplacement = notification.type !== existingNotification.type || notification.message !== existingNotification.message || ! _.isEqual( notification.data, existingNotification.data );
+ }
+ if ( needsReplacement ) {
+ setting.notifications.remove( code );
+ }
+
+ if ( ! setting.notifications.has( notification.code ) ) {
+ setting.notifications.add( notification );
+ }
+ invalidSettings.push( setting.id );
+ } );
+ }
+
+ // Remove notification errors that are no longer valid.
+ setting.notifications.each( function( notification ) {
+ if ( notification.fromServer && 'error' === notification.type && ( true === validity || ! validity[ notification.code ] ) ) {
+ setting.notifications.remove( notification.code );
+ }
+ } );
+ }
+ } );
+
+ if ( args.focusInvalidControl ) {
+ invalidSettingControls = api.findControlsForSettings( invalidSettings );
+
+ // Focus on the first control that is inside of an expanded section (one that is visible).
+ _( _.values( invalidSettingControls ) ).find( function( controls ) {
+ return _( controls ).find( function( control ) {
+ var isExpanded = control.section() && api.section.has( control.section() ) && api.section( control.section() ).expanded();
+ if ( isExpanded && control.expanded ) {
+ isExpanded = control.expanded();
+ }
+ if ( isExpanded ) {
+ control.focus();
+ wasFocused = true;
+ }
+ return wasFocused;
+ } );
+ } );
+
+ // Focus on the first invalid control.
+ if ( ! wasFocused && ! _.isEmpty( invalidSettingControls ) ) {
+ _.values( invalidSettingControls )[0][0].focus();
+ }
+ }
+ };
+
+ /**
+ * Find all controls associated with the given settings.
+ *
+ * @alias wp.customize.findControlsForSettings
+ *
+ * @since 4.6.0
+ * @param {string[]} settingIds Setting IDs.
+ * @returns {object<string, wp.customize.Control>} Mapping setting ids to arrays of controls.
+ */
+ api.findControlsForSettings = function findControlsForSettings( settingIds ) {
+ var controls = {}, settingControls;
+ _.each( _.unique( settingIds ), function( settingId ) {
+ var setting = api( settingId );
+ if ( setting ) {
+ settingControls = setting.findControls();
+ if ( settingControls && settingControls.length > 0 ) {
+ controls[ settingId ] = settingControls;
+ }
+ }
+ } );
+ return controls;
+ };
+
+ /**
+ * Sort panels, sections, controls by priorities. Hide empty sections and panels.
+ *
+ * @alias wp.customize.reflowPaneContents
+ *
+ * @since 4.1.0
+ */
+ api.reflowPaneContents = _.bind( function () {
+
+ var appendContainer, activeElement, rootHeadContainers, rootNodes = [], wasReflowed = false;
+
+ if ( document.activeElement ) {
+ activeElement = $( document.activeElement );
+ }
+
+ // Sort the sections within each panel
+ api.panel.each( function ( panel ) {
+ if ( 'themes' === panel.id ) {
+ return; // Don't reflow theme sections, as doing so moves them after the themes container.
+ }
+
+ var sections = panel.sections(),
+ sectionHeadContainers = _.pluck( sections, 'headContainer' );
+ rootNodes.push( panel );
+ appendContainer = ( panel.contentContainer.is( 'ul' ) ) ? panel.contentContainer : panel.contentContainer.find( 'ul:first' );
+ if ( ! api.utils.areElementListsEqual( sectionHeadContainers, appendContainer.children( '[id]' ) ) ) {
+ _( sections ).each( function ( section ) {
+ appendContainer.append( section.headContainer );
+ } );
+ wasReflowed = true;
+ }
+ } );
+
+ // Sort the controls within each section
+ api.section.each( function ( section ) {
+ var controls = section.controls(),
+ controlContainers = _.pluck( controls, 'container' );
+ if ( ! section.panel() ) {
+ rootNodes.push( section );
+ }
+ appendContainer = ( section.contentContainer.is( 'ul' ) ) ? section.contentContainer : section.contentContainer.find( 'ul:first' );
+ if ( ! api.utils.areElementListsEqual( controlContainers, appendContainer.children( '[id]' ) ) ) {
+ _( controls ).each( function ( control ) {
+ appendContainer.append( control.container );
+ } );
+ wasReflowed = true;
+ }
+ } );
+
+ // Sort the root panels and sections
+ rootNodes.sort( api.utils.prioritySort );
+ rootHeadContainers = _.pluck( rootNodes, 'headContainer' );
+ appendContainer = $( '#customize-theme-controls .customize-pane-parent' ); // @todo This should be defined elsewhere, and to be configurable
+ if ( ! api.utils.areElementListsEqual( rootHeadContainers, appendContainer.children() ) ) {
+ _( rootNodes ).each( function ( rootNode ) {
+ appendContainer.append( rootNode.headContainer );
+ } );
+ wasReflowed = true;
+ }
+
+ // Now re-trigger the active Value callbacks to that the panels and sections can decide whether they can be rendered
+ api.panel.each( function ( panel ) {
+ var value = panel.active();
+ panel.active.callbacks.fireWith( panel.active, [ value, value ] );
+ } );
+ api.section.each( function ( section ) {
+ var value = section.active();
+ section.active.callbacks.fireWith( section.active, [ value, value ] );
+ } );
+
+ // Restore focus if there was a reflow and there was an active (focused) element
+ if ( wasReflowed && activeElement ) {
+ activeElement.focus();
+ }
+ api.trigger( 'pane-contents-reflowed' );
+ }, api );
+
+ // Define state values.
+ api.state = new api.Values();
+ _.each( [
+ 'saved',
+ 'saving',
+ 'trashing',
+ 'activated',
+ 'processing',
+ 'paneVisible',
+ 'expandedPanel',
+ 'expandedSection',
+ 'changesetDate',
+ 'selectedChangesetDate',
+ 'changesetStatus',
+ 'selectedChangesetStatus',
+ 'remainingTimeToPublish',
+ 'previewerAlive',
+ 'editShortcutVisibility',
+ 'changesetLocked',
+ 'previewedDevice'
+ ], function( name ) {
+ api.state.create( name );
+ });
+
+ $( function() {
+ api.settings = window._wpCustomizeSettings;
+ api.l10n = window._wpCustomizeControlsL10n;
+
+ // Check if we can run the Customizer.
+ if ( ! api.settings ) {
+ return;
+ }
+
+ // Bail if any incompatibilities are found.
+ if ( ! $.support.postMessage || ( ! $.support.cors && api.settings.isCrossDomain ) ) {
+ return;
+ }
+
+ if ( null === api.PreviewFrame.prototype.sensitivity ) {
+ api.PreviewFrame.prototype.sensitivity = api.settings.timeouts.previewFrameSensitivity;
+ }
+ if ( null === api.Previewer.prototype.refreshBuffer ) {
+ api.Previewer.prototype.refreshBuffer = api.settings.timeouts.windowRefresh;
+ }
+
+ var parent,
+ body = $( document.body ),
+ overlay = body.children( '.wp-full-overlay' ),
+ title = $( '#customize-info .panel-title.site-title' ),
+ closeBtn = $( '.customize-controls-close' ),
+ saveBtn = $( '#save' ),
+ btnWrapper = $( '#customize-save-button-wrapper' ),
+ publishSettingsBtn = $( '#publish-settings' ),
+ footerActions = $( '#customize-footer-actions' );
+
+ // Add publish settings section in JS instead of PHP since the Customizer depends on it to function.
+ api.bind( 'ready', function() {
+ api.section.add( new api.OuterSection( 'publish_settings', {
+ title: api.l10n.publishSettings,
+ priority: 0,
+ active: api.settings.theme.active
+ } ) );
+ } );
+
+ // Set up publish settings section and its controls.
+ api.section( 'publish_settings', function( section ) {
+ var updateButtonsState, trashControl, updateSectionActive, isSectionActive, statusControl, dateControl, toggleDateControl, publishWhenTime, pollInterval, updateTimeArrivedPoller, cancelScheduleButtonReminder, timeArrivedPollingInterval = 1000;
+
+ trashControl = new api.Control( 'trash_changeset', {
+ type: 'button',
+ section: section.id,
+ priority: 30,
+ input_attrs: {
+ 'class': 'button-link button-link-delete',
+ value: api.l10n.discardChanges
+ }
+ } );
+ api.control.add( trashControl );
+ trashControl.deferred.embedded.done( function() {
+ trashControl.container.find( '.button-link' ).on( 'click', function() {
+ if ( confirm( api.l10n.trashConfirm ) ) {
+ wp.customize.previewer.trash();
+ }
+ } );
+ } );
+
+ api.control.add( new api.PreviewLinkControl( 'changeset_preview_link', {
+ section: section.id,
+ priority: 100
+ } ) );
+
+ /**
+ * Return whether the pubish settings section should be active.
+ *
+ * @return {boolean} Is section active.
+ */
+ isSectionActive = function() {
+ if ( ! api.state( 'activated' ).get() ) {
+ return false;
+ }
+ if ( api.state( 'trashing' ).get() || 'trash' === api.state( 'changesetStatus' ).get() ) {
+ return false;
+ }
+ if ( '' === api.state( 'changesetStatus' ).get() && api.state( 'saved' ).get() ) {
+ return false;
+ }
+ return true;
+ };
+
+ // Make sure publish settings are not available while the theme is not active and the customizer is in a published state.
+ section.active.validate = isSectionActive;
+ updateSectionActive = function() {
+ section.active.set( isSectionActive() );
+ };
+ api.state( 'activated' ).bind( updateSectionActive );
+ api.state( 'trashing' ).bind( updateSectionActive );
+ api.state( 'saved' ).bind( updateSectionActive );
+ api.state( 'changesetStatus' ).bind( updateSectionActive );
+ updateSectionActive();
+
+ // Bind visibility of the publish settings button to whether the section is active.
+ updateButtonsState = function() {
+ publishSettingsBtn.toggle( section.active.get() );
+ saveBtn.toggleClass( 'has-next-sibling', section.active.get() );
+ };
+ updateButtonsState();
+ section.active.bind( updateButtonsState );
+
+ function highlightScheduleButton() {
+ if ( ! cancelScheduleButtonReminder ) {
+ cancelScheduleButtonReminder = api.utils.highlightButton( btnWrapper, {
+ delay: 1000,
+
+ // Only abort the reminder when the save button is focused.
+ // If the user clicks the settings button to toggle the
+ // settings closed, we'll still remind them.
+ focusTarget: saveBtn
+ } );
+ }
+ }
+ function cancelHighlightScheduleButton() {
+ if ( cancelScheduleButtonReminder ) {
+ cancelScheduleButtonReminder();
+ cancelScheduleButtonReminder = null;
+ }
+ }
+ api.state( 'selectedChangesetStatus' ).bind( cancelHighlightScheduleButton );
+
+ section.contentContainer.find( '.customize-action' ).text( api.l10n.updating );
+ section.contentContainer.find( '.customize-section-back' ).removeAttr( 'tabindex' );
+ publishSettingsBtn.prop( 'disabled', false );
+
+ publishSettingsBtn.on( 'click', function( event ) {
+ event.preventDefault();
+ section.expanded.set( ! section.expanded.get() );
+ } );
+
+ section.expanded.bind( function( isExpanded ) {
+ var defaultChangesetStatus;
+ publishSettingsBtn.attr( 'aria-expanded', String( isExpanded ) );
+ publishSettingsBtn.toggleClass( 'active', isExpanded );
+
+ if ( isExpanded ) {
+ cancelHighlightScheduleButton();
+ return;
+ }
+
+ defaultChangesetStatus = api.state( 'changesetStatus' ).get();
+ if ( '' === defaultChangesetStatus || 'auto-draft' === defaultChangesetStatus ) {
+ defaultChangesetStatus = 'publish';
+ }
+
+ if ( api.state( 'selectedChangesetStatus' ).get() !== defaultChangesetStatus ) {
+ highlightScheduleButton();
+ } else if ( 'future' === api.state( 'selectedChangesetStatus' ).get() && api.state( 'selectedChangesetDate' ).get() !== api.state( 'changesetDate' ).get() ) {
+ highlightScheduleButton();
+ }
+ } );
+
+ statusControl = new api.Control( 'changeset_status', {
+ priority: 10,
+ type: 'radio',
+ section: 'publish_settings',
+ setting: api.state( 'selectedChangesetStatus' ),
+ templateId: 'customize-selected-changeset-status-control',
+ label: api.l10n.action,
+ choices: api.settings.changeset.statusChoices
+ } );
+ api.control.add( statusControl );
+
+ dateControl = new api.DateTimeControl( 'changeset_scheduled_date', {
+ priority: 20,
+ section: 'publish_settings',
+ setting: api.state( 'selectedChangesetDate' ),
+ minYear: ( new Date() ).getFullYear(),
+ allowPastDate: false,
+ includeTime: true,
+ twelveHourFormat: /a/i.test( api.settings.timeFormat ),
+ description: api.l10n.scheduleDescription
+ } );
+ dateControl.notifications.alt = true;
+ api.control.add( dateControl );
+
+ publishWhenTime = function() {
+ api.state( 'selectedChangesetStatus' ).set( 'publish' );
+ api.previewer.save();
+ };
+
+ // Start countdown for when the dateTime arrives, or clear interval when it is .
+ updateTimeArrivedPoller = function() {
+ var shouldPoll = (
+ 'future' === api.state( 'changesetStatus' ).get() &&
+ 'future' === api.state( 'selectedChangesetStatus' ).get() &&
+ api.state( 'changesetDate' ).get() &&
+ api.state( 'selectedChangesetDate' ).get() === api.state( 'changesetDate' ).get() &&
+ api.utils.getRemainingTime( api.state( 'changesetDate' ).get() ) >= 0
+ );
+
+ if ( shouldPoll && ! pollInterval ) {
+ pollInterval = setInterval( function() {
+ var remainingTime = api.utils.getRemainingTime( api.state( 'changesetDate' ).get() );
+ api.state( 'remainingTimeToPublish' ).set( remainingTime );
+ if ( remainingTime <= 0 ) {
+ clearInterval( pollInterval );
+ pollInterval = 0;
+ publishWhenTime();
+ }
+ }, timeArrivedPollingInterval );
+ } else if ( ! shouldPoll && pollInterval ) {
+ clearInterval( pollInterval );
+ pollInterval = 0;
+ }
+ };
+
+ api.state( 'changesetDate' ).bind( updateTimeArrivedPoller );
+ api.state( 'selectedChangesetDate' ).bind( updateTimeArrivedPoller );
+ api.state( 'changesetStatus' ).bind( updateTimeArrivedPoller );
+ api.state( 'selectedChangesetStatus' ).bind( updateTimeArrivedPoller );
+ updateTimeArrivedPoller();
+
+ // Ensure dateControl only appears when selected status is future.
+ dateControl.active.validate = function() {
+ return 'future' === api.state( 'selectedChangesetStatus' ).get();
+ };
+ toggleDateControl = function( value ) {
+ dateControl.active.set( 'future' === value );
+ };
+ toggleDateControl( api.state( 'selectedChangesetStatus' ).get() );
+ api.state( 'selectedChangesetStatus' ).bind( toggleDateControl );
+
+ // Show notification on date control when status is future but it isn't a future date.
+ api.state( 'saving' ).bind( function( isSaving ) {
+ if ( isSaving && 'future' === api.state( 'selectedChangesetStatus' ).get() ) {
+ dateControl.toggleFutureDateNotification( ! dateControl.isFutureDate() );
+ }
+ } );
+ } );
+
+ // Prevent the form from saving when enter is pressed on an input or select element.
+ $('#customize-controls').on( 'keydown', function( e ) {
+ var isEnter = ( 13 === e.which ),
+ $el = $( e.target );
+
+ if ( isEnter && ( $el.is( 'input:not([type=button])' ) || $el.is( 'select' ) ) ) {
+ e.preventDefault();
+ }
+ });
+
+ // Expand/Collapse the main customizer customize info.
+ $( '.customize-info' ).find( '> .accordion-section-title .customize-help-toggle' ).on( 'click', function() {
+ var section = $( this ).closest( '.accordion-section' ),
+ content = section.find( '.customize-panel-description:first' );
+
+ if ( section.hasClass( 'cannot-expand' ) ) {
+ return;
+ }
+
+ if ( section.hasClass( 'open' ) ) {
+ section.toggleClass( 'open' );
+ content.slideUp( api.Panel.prototype.defaultExpandedArguments.duration, function() {
+ content.trigger( 'toggled' );
+ } );
+ $( this ).attr( 'aria-expanded', false );
+ } else {
+ content.slideDown( api.Panel.prototype.defaultExpandedArguments.duration, function() {
+ content.trigger( 'toggled' );
+ } );
+ section.toggleClass( 'open' );
+ $( this ).attr( 'aria-expanded', true );
+ }
+ });
+
+ /**
+ * Initialize Previewer
+ *
+ * @alias wp.customize.previewer
+ */
+ api.previewer = new api.Previewer({
+ container: '#customize-preview',
+ form: '#customize-controls',
+ previewUrl: api.settings.url.preview,
+ allowedUrls: api.settings.url.allowed
+ },/** @lends wp.customize.previewer */{
+
+ nonce: api.settings.nonce,
+
+ /**
+ * Build the query to send along with the Preview request.
+ *
+ * @since 3.4.0
+ * @since 4.7.0 Added options param.
+ * @access public
+ *
+ * @param {object} [options] Options.
+ * @param {boolean} [options.excludeCustomizedSaved=false] Exclude saved settings in customized response (values pending writing to changeset).
+ * @return {object} Query vars.
+ */
+ query: function( options ) {
+ var queryVars = {
+ wp_customize: 'on',
+ customize_theme: api.settings.theme.stylesheet,
+ nonce: this.nonce.preview,
+ customize_changeset_uuid: api.settings.changeset.uuid
+ };
+ if ( api.settings.changeset.autosaved || ! api.state( 'saved' ).get() ) {
+ queryVars.customize_autosaved = 'on';
+ }
+
+ /*
+ * Exclude customized data if requested especially for calls to requestChangesetUpdate.
+ * Changeset updates are differential and so it is a performance waste to send all of
+ * the dirty settings with each update.
+ */
+ queryVars.customized = JSON.stringify( api.dirtyValues( {
+ unsaved: options && options.excludeCustomizedSaved
+ } ) );
+
+ return queryVars;
+ },
+
+ /**
+ * Save (and publish) the customizer changeset.
+ *
+ * Updates to the changeset are transactional. If any of the settings
+ * are invalid then none of them will be written into the changeset.
+ * A revision will be made for the changeset post if revisions support
+ * has been added to the post type.
+ *
+ * @since 3.4.0
+ * @since 4.7.0 Added args param and return value.
+ *
+ * @param {object} [args] Args.
+ * @param {string} [args.status=publish] Status.
+ * @param {string} [args.date] Date, in local time in MySQL format.
+ * @param {string} [args.title] Title
+ * @returns {jQuery.promise} Promise.
+ */
+ save: function( args ) {
+ var previewer = this,
+ deferred = $.Deferred(),
+ changesetStatus = api.state( 'selectedChangesetStatus' ).get(),
+ selectedChangesetDate = api.state( 'selectedChangesetDate' ).get(),
+ processing = api.state( 'processing' ),
+ submitWhenDoneProcessing,
+ submit,
+ modifiedWhileSaving = {},
+ invalidSettings = [],
+ invalidControls = [],
+ invalidSettingLessControls = [];
+
+ if ( args && args.status ) {
+ changesetStatus = args.status;
+ }
+
+ if ( api.state( 'saving' ).get() ) {
+ deferred.reject( 'already_saving' );
+ deferred.promise();
+ }
+
+ api.state( 'saving' ).set( true );
+
+ function captureSettingModifiedDuringSave( setting ) {
+ modifiedWhileSaving[ setting.id ] = true;
+ }
+
+ submit = function () {
+ var request, query, settingInvalidities = {}, latestRevision = api._latestRevision, errorCode = 'client_side_error';
+
+ api.bind( 'change', captureSettingModifiedDuringSave );
+ api.notifications.remove( errorCode );
+
+ /*
+ * Block saving if there are any settings that are marked as
+ * invalid from the client (not from the server). Focus on
+ * the control.
+ */
+ api.each( function( setting ) {
+ setting.notifications.each( function( notification ) {
+ if ( 'error' === notification.type && ! notification.fromServer ) {
+ invalidSettings.push( setting.id );
+ if ( ! settingInvalidities[ setting.id ] ) {
+ settingInvalidities[ setting.id ] = {};
+ }
+ settingInvalidities[ setting.id ][ notification.code ] = notification;
+ }
+ } );
+ } );
+
+ // Find all invalid setting less controls with notification type error.
+ api.control.each( function( control ) {
+ if ( ! control.setting || ! control.setting.id && control.active.get() ) {
+ control.notifications.each( function( notification ) {
+ if ( 'error' === notification.type ) {
+ invalidSettingLessControls.push( [ control ] );
+ }
+ } );
+ }
+ } );
+
+ invalidControls = _.union( invalidSettingLessControls, _.values( api.findControlsForSettings( invalidSettings ) ) );
+ if ( ! _.isEmpty( invalidControls ) ) {
+
+ invalidControls[0][0].focus();
+ api.unbind( 'change', captureSettingModifiedDuringSave );
+
+ if ( invalidSettings.length ) {
+ api.notifications.add( new api.Notification( errorCode, {
+ message: ( 1 === invalidSettings.length ? api.l10n.saveBlockedError.singular : api.l10n.saveBlockedError.plural ).replace( /%s/g, String( invalidSettings.length ) ),
+ type: 'error',
+ dismissible: true,
+ saveFailure: true
+ } ) );
+ }
+
+ deferred.rejectWith( previewer, [
+ { setting_invalidities: settingInvalidities }
+ ] );
+ api.state( 'saving' ).set( false );
+ return deferred.promise();
+ }
+
+ /*
+ * Note that excludeCustomizedSaved is intentionally false so that the entire
+ * set of customized data will be included if bypassed changeset update.
+ */
+ query = $.extend( previewer.query( { excludeCustomizedSaved: false } ), {
+ nonce: previewer.nonce.save,
+ customize_changeset_status: changesetStatus
+ } );
+
+ if ( args && args.date ) {
+ query.customize_changeset_date = args.date;
+ } else if ( 'future' === changesetStatus && selectedChangesetDate ) {
+ query.customize_changeset_date = selectedChangesetDate;
+ }
+
+ if ( args && args.title ) {
+ query.customize_changeset_title = args.title;
+ }
+
+ // Allow plugins to modify the params included with the save request.
+ api.trigger( 'save-request-params', query );
+
+ /*
+ * Note that the dirty customized values will have already been set in the
+ * changeset and so technically query.customized could be deleted. However,
+ * it is remaining here to make sure that any settings that got updated
+ * quietly which may have not triggered an update request will also get
+ * included in the values that get saved to the changeset. This will ensure
+ * that values that get injected via the saved event will be included in
+ * the changeset. This also ensures that setting values that were invalid
+ * will get re-validated, perhaps in the case of settings that are invalid
+ * due to dependencies on other settings.
+ */
+ request = wp.ajax.post( 'customize_save', query );
+ api.state( 'processing' ).set( api.state( 'processing' ).get() + 1 );
+
+ api.trigger( 'save', request );
+
+ request.always( function () {
+ api.state( 'processing' ).set( api.state( 'processing' ).get() - 1 );
+ api.state( 'saving' ).set( false );
+ api.unbind( 'change', captureSettingModifiedDuringSave );
+ } );
+
+ // Remove notifications that were added due to save failures.
+ api.notifications.each( function( notification ) {
+ if ( notification.saveFailure ) {
+ api.notifications.remove( notification.code );
+ }
+ });
+
+ request.fail( function ( response ) {
+ var notification, notificationArgs;
+ notificationArgs = {
+ type: 'error',
+ dismissible: true,
+ fromServer: true,
+ saveFailure: true
+ };
+
+ if ( '0' === response ) {
+ response = 'not_logged_in';
+ } else if ( '-1' === response ) {
+ // Back-compat in case any other check_ajax_referer() call is dying
+ response = 'invalid_nonce';
+ }
+
+ if ( 'invalid_nonce' === response ) {
+ previewer.cheatin();
+ } else if ( 'not_logged_in' === response ) {
+ previewer.preview.iframe.hide();
+ previewer.login().done( function() {
+ previewer.save();
+ previewer.preview.iframe.show();
+ } );
+ } else if ( response.code ) {
+ if ( 'not_future_date' === response.code && api.section.has( 'publish_settings' ) && api.section( 'publish_settings' ).active.get() && api.control.has( 'changeset_scheduled_date' ) ) {
+ api.control( 'changeset_scheduled_date' ).toggleFutureDateNotification( true ).focus();
+ } else if ( 'changeset_locked' !== response.code ) {
+ notification = new api.Notification( response.code, _.extend( notificationArgs, {
+ message: response.message
+ } ) );
+ }
+ } else {
+ notification = new api.Notification( 'unknown_error', _.extend( notificationArgs, {
+ message: api.l10n.unknownRequestFail
+ } ) );
+ }
+
+ if ( notification ) {
+ api.notifications.add( notification );
+ }
+
+ if ( response.setting_validities ) {
+ api._handleSettingValidities( {
+ settingValidities: response.setting_validities,
+ focusInvalidControl: true
+ } );
+ }
+
+ deferred.rejectWith( previewer, [ response ] );
+ api.trigger( 'error', response );
+
+ // Start a new changeset if the underlying changeset was published.
+ if ( 'changeset_already_published' === response.code && response.next_changeset_uuid ) {
+ api.settings.changeset.uuid = response.next_changeset_uuid;
+ api.state( 'changesetStatus' ).set( '' );
+ if ( api.settings.changeset.branching ) {
+ parent.send( 'changeset-uuid', api.settings.changeset.uuid );
+ }
+ api.previewer.send( 'changeset-uuid', api.settings.changeset.uuid );
+ }
+ } );
+
+ request.done( function( response ) {
+
+ previewer.send( 'saved', response );
+
+ api.state( 'changesetStatus' ).set( response.changeset_status );
+ if ( response.changeset_date ) {
+ api.state( 'changesetDate' ).set( response.changeset_date );
+ }
+
+ if ( 'publish' === response.changeset_status ) {
+
+ // Mark all published as clean if they haven't been modified during the request.
+ api.each( function( setting ) {
+ /*
+ * Note that the setting revision will be undefined in the case of setting
+ * values that are marked as dirty when the customizer is loaded, such as
+ * when applying starter content. All other dirty settings will have an
+ * associated revision due to their modification triggering a change event.
+ */
+ if ( setting._dirty && ( _.isUndefined( api._latestSettingRevisions[ setting.id ] ) || api._latestSettingRevisions[ setting.id ] <= latestRevision ) ) {
+ setting._dirty = false;
+ }
+ } );
+
+ api.state( 'changesetStatus' ).set( '' );
+ api.settings.changeset.uuid = response.next_changeset_uuid;
+ if ( api.settings.changeset.branching ) {
+ parent.send( 'changeset-uuid', api.settings.changeset.uuid );
+ }
+ }
+
+ // Prevent subsequent requestChangesetUpdate() calls from including the settings that have been saved.
+ api._lastSavedRevision = Math.max( latestRevision, api._lastSavedRevision );
+
+ if ( response.setting_validities ) {
+ api._handleSettingValidities( {
+ settingValidities: response.setting_validities,
+ focusInvalidControl: true
+ } );
+ }
+
+ deferred.resolveWith( previewer, [ response ] );
+ api.trigger( 'saved', response );
+
+ // Restore the global dirty state if any settings were modified during save.
+ if ( ! _.isEmpty( modifiedWhileSaving ) ) {
+ api.state( 'saved' ).set( false );
+ }
+ } );
+ };
+
+ if ( 0 === processing() ) {
+ submit();
+ } else {
+ submitWhenDoneProcessing = function () {
+ if ( 0 === processing() ) {
+ api.state.unbind( 'change', submitWhenDoneProcessing );
+ submit();
+ }
+ };
+ api.state.bind( 'change', submitWhenDoneProcessing );
+ }
+
+ return deferred.promise();
+ },
+
+ /**
+ * Trash the current changes.
+ *
+ * Revert the Customizer to it's previously-published state.
+ *
+ * @since 4.9.0
+ *
+ * @returns {jQuery.promise} Promise.
+ */
+ trash: function trash() {
+ var request, success, fail;
+
+ api.state( 'trashing' ).set( true );
+ api.state( 'processing' ).set( api.state( 'processing' ).get() + 1 );
+
+ request = wp.ajax.post( 'customize_trash', {
+ customize_changeset_uuid: api.settings.changeset.uuid,
+ nonce: api.settings.nonce.trash
+ } );
+ api.notifications.add( new api.OverlayNotification( 'changeset_trashing', {
+ type: 'info',
+ message: api.l10n.revertingChanges,
+ loading: true
+ } ) );
+
+ success = function() {
+ var urlParser = document.createElement( 'a' ), queryParams;
+
+ api.state( 'changesetStatus' ).set( 'trash' );
+ api.each( function( setting ) {
+ setting._dirty = false;
+ } );
+ api.state( 'saved' ).set( true );
+
+ // Go back to Customizer without changeset.
+ urlParser.href = location.href;
+ queryParams = api.utils.parseQueryString( urlParser.search.substr( 1 ) );
+ delete queryParams.changeset_uuid;
+ queryParams['return'] = api.settings.url['return'];
+ urlParser.search = $.param( queryParams );
+ location.replace( urlParser.href );
+ };
+
+ fail = function( code, message ) {
+ var notificationCode = code || 'unknown_error';
+ api.state( 'processing' ).set( api.state( 'processing' ).get() - 1 );
+ api.state( 'trashing' ).set( false );
+ api.notifications.remove( 'changeset_trashing' );
+ api.notifications.add( new api.Notification( notificationCode, {
+ message: message || api.l10n.unknownError,
+ dismissible: true,
+ type: 'error'
+ } ) );
+ };
+
+ request.done( function( response ) {
+ success( response.message );
+ } );
+
+ request.fail( function( response ) {
+ var code = response.code || 'trashing_failed';
+ if ( response.success || 'non_existent_changeset' === code || 'changeset_already_trashed' === code ) {
+ success( response.message );
+ } else {
+ fail( code, response.message );
+ }
+ } );
+ },
+
+ /**
+ * Builds the front preview url with the current state of customizer.
+ *
+ * @since 4.9
+ *
+ * @return {string} Preview url.
+ */
+ getFrontendPreviewUrl: function() {
+ var previewer = this, params, urlParser;
+ urlParser = document.createElement( 'a' );
+ urlParser.href = previewer.previewUrl.get();
+ params = api.utils.parseQueryString( urlParser.search.substr( 1 ) );
+
+ if ( api.state( 'changesetStatus' ).get() && 'publish' !== api.state( 'changesetStatus' ).get() ) {
+ params.customize_changeset_uuid = api.settings.changeset.uuid;
+ }
+ if ( ! api.state( 'activated' ).get() ) {
+ params.customize_theme = api.settings.theme.stylesheet;
+ }
+
+ urlParser.search = $.param( params );
+ return urlParser.href;
+ }
+ });
+
+ // Ensure preview nonce is included with every customized request, to allow post data to be read.
+ $.ajaxPrefilter( function injectPreviewNonce( options ) {
+ if ( ! /wp_customize=on/.test( options.data ) ) {
+ return;
+ }
+ options.data += '&' + $.param({
+ customize_preview_nonce: api.settings.nonce.preview
+ });
+ });
+
+ // Refresh the nonces if the preview sends updated nonces over.
+ api.previewer.bind( 'nonce', function( nonce ) {
+ $.extend( this.nonce, nonce );
+ });
+
+ // Refresh the nonces if login sends updated nonces over.
+ api.bind( 'nonce-refresh', function( nonce ) {
+ $.extend( api.settings.nonce, nonce );
+ $.extend( api.previewer.nonce, nonce );
+ api.previewer.send( 'nonce-refresh', nonce );
+ });
+
+ // Create Settings
+ $.each( api.settings.settings, function( id, data ) {
+ var Constructor = api.settingConstructor[ data.type ] || api.Setting;
+ api.add( new Constructor( id, data.value, {
+ transport: data.transport,
+ previewer: api.previewer,
+ dirty: !! data.dirty
+ } ) );
+ });
+
+ // Create Panels
+ $.each( api.settings.panels, function ( id, data ) {
+ var Constructor = api.panelConstructor[ data.type ] || api.Panel, options;
+ options = _.extend( { params: data }, data ); // Inclusion of params alias is for back-compat for custom panels that expect to augment this property.
+ api.panel.add( new Constructor( id, options ) );
+ });
+
+ // Create Sections
+ $.each( api.settings.sections, function ( id, data ) {
+ var Constructor = api.sectionConstructor[ data.type ] || api.Section, options;
+ options = _.extend( { params: data }, data ); // Inclusion of params alias is for back-compat for custom sections that expect to augment this property.
+ api.section.add( new Constructor( id, options ) );
+ });
+
+ // Create Controls
+ $.each( api.settings.controls, function( id, data ) {
+ var Constructor = api.controlConstructor[ data.type ] || api.Control, options;
+ options = _.extend( { params: data }, data ); // Inclusion of params alias is for back-compat for custom controls that expect to augment this property.
+ api.control.add( new Constructor( id, options ) );
+ });
+
+ // Focus the autofocused element
+ _.each( [ 'panel', 'section', 'control' ], function( type ) {
+ var id = api.settings.autofocus[ type ];
+ if ( ! id ) {
+ return;
+ }
+
+ /*
+ * Defer focus until:
+ * 1. The panel, section, or control exists (especially for dynamically-created ones).
+ * 2. The instance is embedded in the document (and so is focusable).
+ * 3. The preview has finished loading so that the active states have been set.
+ */
+ api[ type ]( id, function( instance ) {
+ instance.deferred.embedded.done( function() {
+ api.previewer.deferred.active.done( function() {
+ instance.focus();
+ });
+ });
+ });
+ });
+
+ api.bind( 'ready', api.reflowPaneContents );
+ $( [ api.panel, api.section, api.control ] ).each( function ( i, values ) {
+ var debouncedReflowPaneContents = _.debounce( api.reflowPaneContents, api.settings.timeouts.reflowPaneContents );
+ values.bind( 'add', debouncedReflowPaneContents );
+ values.bind( 'change', debouncedReflowPaneContents );
+ values.bind( 'remove', debouncedReflowPaneContents );
+ } );
+
+ // Set up global notifications area.
+ api.bind( 'ready', function setUpGlobalNotificationsArea() {
+ var sidebar, containerHeight, containerInitialTop;
+ api.notifications.container = $( '#customize-notifications-area' );
+
+ api.notifications.bind( 'change', _.debounce( function() {
+ api.notifications.render();
+ } ) );
+
+ sidebar = $( '.wp-full-overlay-sidebar-content' );
+ api.notifications.bind( 'rendered', function updateSidebarTop() {
+ sidebar.css( 'top', '' );
+ if ( 0 !== api.notifications.count() ) {
+ containerHeight = api.notifications.container.outerHeight() + 1;
+ containerInitialTop = parseInt( sidebar.css( 'top' ), 10 );
+ sidebar.css( 'top', containerInitialTop + containerHeight + 'px' );
+ }
+ api.notifications.trigger( 'sidebarTopUpdated' );
+ });
+
+ api.notifications.render();
+ });
+
+ // Save and activated states
+ (function( state ) {
+ var saved = state.instance( 'saved' ),
+ saving = state.instance( 'saving' ),
+ trashing = state.instance( 'trashing' ),
+ activated = state.instance( 'activated' ),
+ processing = state.instance( 'processing' ),
+ paneVisible = state.instance( 'paneVisible' ),
+ expandedPanel = state.instance( 'expandedPanel' ),
+ expandedSection = state.instance( 'expandedSection' ),
+ changesetStatus = state.instance( 'changesetStatus' ),
+ selectedChangesetStatus = state.instance( 'selectedChangesetStatus' ),
+ changesetDate = state.instance( 'changesetDate' ),
+ selectedChangesetDate = state.instance( 'selectedChangesetDate' ),
+ previewerAlive = state.instance( 'previewerAlive' ),
+ editShortcutVisibility = state.instance( 'editShortcutVisibility' ),
+ changesetLocked = state.instance( 'changesetLocked' ),
+ populateChangesetUuidParam, defaultSelectedChangesetStatus;
+
+ state.bind( 'change', function() {
+ var canSave;
+
+ if ( ! activated() ) {
+ saveBtn.val( api.l10n.activate );
+ closeBtn.find( '.screen-reader-text' ).text( api.l10n.cancel );
+
+ } else if ( '' === changesetStatus.get() && saved() ) {
+ if ( api.settings.changeset.currentUserCanPublish ) {
+ saveBtn.val( api.l10n.published );
+ } else {
+ saveBtn.val( api.l10n.saved );
+ }
+ closeBtn.find( '.screen-reader-text' ).text( api.l10n.close );
+
+ } else {
+ if ( 'draft' === selectedChangesetStatus() ) {
+ if ( saved() && selectedChangesetStatus() === changesetStatus() ) {
+ saveBtn.val( api.l10n.draftSaved );
+ } else {
+ saveBtn.val( api.l10n.saveDraft );
+ }
+ } else if ( 'future' === selectedChangesetStatus() ) {
+ if ( saved() && selectedChangesetStatus() === changesetStatus() ) {
+ if ( changesetDate.get() !== selectedChangesetDate.get() ) {
+ saveBtn.val( api.l10n.schedule );
+ } else {
+ saveBtn.val( api.l10n.scheduled );
+ }
+ } else {
+ saveBtn.val( api.l10n.schedule );
+ }
+ } else if ( api.settings.changeset.currentUserCanPublish ) {
+ saveBtn.val( api.l10n.publish );
+ }
+ closeBtn.find( '.screen-reader-text' ).text( api.l10n.cancel );
+ }
+
+ /*
+ * Save (publish) button should be enabled if saving is not currently happening,
+ * and if the theme is not active or the changeset exists but is not published.
+ */
+ canSave = ! saving() && ! trashing() && ! changesetLocked() && ( ! activated() || ! saved() || ( changesetStatus() !== selectedChangesetStatus() && '' !== changesetStatus() ) || ( 'future' === selectedChangesetStatus() && changesetDate.get() !== selectedChangesetDate.get() ) );
+
+ saveBtn.prop( 'disabled', ! canSave );
+ });
+
+ selectedChangesetStatus.validate = function( status ) {
+ if ( '' === status || 'auto-draft' === status ) {
+ return null;
+ }
+ return status;
+ };
+
+ defaultSelectedChangesetStatus = api.settings.changeset.currentUserCanPublish ? 'publish' : 'draft';
+
+ // Set default states.
+ changesetStatus( api.settings.changeset.status );
+ changesetLocked( Boolean( api.settings.changeset.lockUser ) );
+ changesetDate( api.settings.changeset.publishDate );
+ selectedChangesetDate( api.settings.changeset.publishDate );
+ selectedChangesetStatus( '' === api.settings.changeset.status || 'auto-draft' === api.settings.changeset.status ? defaultSelectedChangesetStatus : api.settings.changeset.status );
+ selectedChangesetStatus.link( changesetStatus ); // Ensure that direct updates to status on server via wp.customizer.previewer.save() will update selection.
+ saved( true );
+ if ( '' === changesetStatus() ) { // Handle case for loading starter content.
+ api.each( function( setting ) {
+ if ( setting._dirty ) {
+ saved( false );
+ }
+ } );
+ }
+ saving( false );
+ activated( api.settings.theme.active );
+ processing( 0 );
+ paneVisible( true );
+ expandedPanel( false );
+ expandedSection( false );
+ previewerAlive( true );
+ editShortcutVisibility( 'visible' );
+
+ api.bind( 'change', function() {
+ if ( state( 'saved' ).get() ) {
+ state( 'saved' ).set( false );
+ }
+ });
+
+ // Populate changeset UUID param when state becomes dirty.
+ if ( api.settings.changeset.branching ) {
+ saved.bind( function( isSaved ) {
+ if ( ! isSaved ) {
+ populateChangesetUuidParam( true );
+ }
+ });
+ }
+
+ saving.bind( function( isSaving ) {
+ body.toggleClass( 'saving', isSaving );
+ } );
+ trashing.bind( function( isTrashing ) {
+ body.toggleClass( 'trashing', isTrashing );
+ } );
+
+ api.bind( 'saved', function( response ) {
+ state('saved').set( true );
+ if ( 'publish' === response.changeset_status ) {
+ state( 'activated' ).set( true );
+ }
+ });
+
+ activated.bind( function( to ) {
+ if ( to ) {
+ api.trigger( 'activated' );
+ }
+ });
+
+ /**
+ * Populate URL with UUID via `history.replaceState()`.
+ *
+ * @since 4.7.0
+ * @access private
+ *
+ * @param {boolean} isIncluded Is UUID included.
+ * @returns {void}
+ */
+ populateChangesetUuidParam = function( isIncluded ) {
+ var urlParser, queryParams;
+
+ // Abort on IE9 which doesn't support history management.
+ if ( ! history.replaceState ) {
+ return;
+ }
+
+ urlParser = document.createElement( 'a' );
+ urlParser.href = location.href;
+ queryParams = api.utils.parseQueryString( urlParser.search.substr( 1 ) );
+ if ( isIncluded ) {
+ if ( queryParams.changeset_uuid === api.settings.changeset.uuid ) {
+ return;
+ }
+ queryParams.changeset_uuid = api.settings.changeset.uuid;
+ } else {
+ if ( ! queryParams.changeset_uuid ) {
+ return;
+ }
+ delete queryParams.changeset_uuid;
+ }
+ urlParser.search = $.param( queryParams );
+ history.replaceState( {}, document.title, urlParser.href );
+ };
+
+ // Show changeset UUID in URL when in branching mode and there is a saved changeset.
+ if ( api.settings.changeset.branching ) {
+ changesetStatus.bind( function( newStatus ) {
+ populateChangesetUuidParam( '' !== newStatus && 'publish' !== newStatus && 'trash' !== newStatus );
+ } );
+ }
+ }( api.state ) );
+
+ /**
+ * Handles lock notice and take over request.
+ *
+ * @since 4.9.0
+ */
+ ( function checkAndDisplayLockNotice() {
+
+ var LockedNotification = api.OverlayNotification.extend(/** @lends wp.customize~LockedNotification.prototype */{
+
+ /**
+ * Template ID.
+ *
+ * @type {string}
+ */
+ templateId: 'customize-changeset-locked-notification',
+
+ /**
+ * Lock user.
+ *
+ * @type {object}
+ */
+ lockUser: null,
+
+ /**
+ * A notification that is displayed in a full-screen overlay with information about the locked changeset.
+ *
+ * @constructs wp.customize~LockedNotification
+ * @augments wp.customize.OverlayNotification
+ *
+ * @since 4.9.0
+ *
+ * @param {string} [code] - Code.
+ * @param {object} [params] - Params.
+ */
+ initialize: function( code, params ) {
+ var notification = this, _code, _params;
+ _code = code || 'changeset_locked';
+ _params = _.extend(
+ {
+ type: 'warning',
+ containerClasses: '',
+ lockUser: {}
+ },
+ params
+ );
+ _params.containerClasses += ' notification-changeset-locked';
+ api.OverlayNotification.prototype.initialize.call( notification, _code, _params );
+ },
+
+ /**
+ * Render notification.
+ *
+ * @since 4.9.0
+ *
+ * @return {jQuery} Notification container.
+ */
+ render: function() {
+ var notification = this, li, data, takeOverButton, request;
+ data = _.extend(
+ {
+ allowOverride: false,
+ returnUrl: api.settings.url['return'],
+ previewUrl: api.previewer.previewUrl.get(),
+ frontendPreviewUrl: api.previewer.getFrontendPreviewUrl()
+ },
+ this
+ );
+
+ li = api.OverlayNotification.prototype.render.call( data );
+
+ // Try to autosave the changeset now.
+ api.requestChangesetUpdate( {}, { autosave: true } ).fail( function( response ) {
+ if ( ! response.autosaved ) {
+ li.find( '.notice-error' ).prop( 'hidden', false ).text( response.message || api.l10n.unknownRequestFail );
+ }
+ } );
+
+ takeOverButton = li.find( '.customize-notice-take-over-button' );
+ takeOverButton.on( 'click', function( event ) {
+ event.preventDefault();
+ if ( request ) {
+ return;
+ }
+
+ takeOverButton.addClass( 'disabled' );
+ request = wp.ajax.post( 'customize_override_changeset_lock', {
+ wp_customize: 'on',
+ customize_theme: api.settings.theme.stylesheet,
+ customize_changeset_uuid: api.settings.changeset.uuid,
+ nonce: api.settings.nonce.override_lock
+ } );
+
+ request.done( function() {
+ api.notifications.remove( notification.code ); // Remove self.
+ api.state( 'changesetLocked' ).set( false );
+ } );
+
+ request.fail( function( response ) {
+ var message = response.message || api.l10n.unknownRequestFail;
+ li.find( '.notice-error' ).prop( 'hidden', false ).text( message );
+
+ request.always( function() {
+ takeOverButton.removeClass( 'disabled' );
+ } );
+ } );
+
+ request.always( function() {
+ request = null;
+ } );
+ } );
+
+ return li;
+ }
+ });
+
+ /**
+ * Start lock.
+ *
+ * @since 4.9.0
+ *
+ * @param {object} [args] - Args.
+ * @param {object} [args.lockUser] - Lock user data.
+ * @param {boolean} [args.allowOverride=false] - Whether override is allowed.
+ * @returns {void}
+ */
+ function startLock( args ) {
+ if ( args && args.lockUser ) {
+ api.settings.changeset.lockUser = args.lockUser;
+ }
+ api.state( 'changesetLocked' ).set( true );
+ api.notifications.add( new LockedNotification( 'changeset_locked', {
+ lockUser: api.settings.changeset.lockUser,
+ allowOverride: Boolean( args && args.allowOverride )
+ } ) );
+ }
+
+ // Show initial notification.
+ if ( api.settings.changeset.lockUser ) {
+ startLock( { allowOverride: true } );
+ }
+
+ // Check for lock when sending heartbeat requests.
+ $( document ).on( 'heartbeat-send.update_lock_notice', function( event, data ) {
+ data.check_changeset_lock = true;
+ data.changeset_uuid = api.settings.changeset.uuid;
+ } );
+
+ // Handle heartbeat ticks.
+ $( document ).on( 'heartbeat-tick.update_lock_notice', function( event, data ) {
+ var notification, code = 'changeset_locked';
+ if ( ! data.customize_changeset_lock_user ) {
+ return;
+ }
+
+ // Update notification when a different user takes over.
+ notification = api.notifications( code );
+ if ( notification && notification.lockUser.id !== api.settings.changeset.lockUser.id ) {
+ api.notifications.remove( code );
+ }
+
+ startLock( {
+ lockUser: data.customize_changeset_lock_user
+ } );
+ } );
+
+ // Handle locking in response to changeset save errors.
+ api.bind( 'error', function( response ) {
+ if ( 'changeset_locked' === response.code && response.lock_user ) {
+ startLock( {
+ lockUser: response.lock_user
+ } );
+ }
+ } );
+ } )();
+
+ // Set up initial notifications.
+ (function() {
+ var removedQueryParams = [], autosaveDismissed = false;
+
+ /**
+ * Obtain the URL to restore the autosave.
+ *
+ * @returns {string} Customizer URL.
+ */
+ function getAutosaveRestorationUrl() {
+ var urlParser, queryParams;
+ urlParser = document.createElement( 'a' );
+ urlParser.href = location.href;
+ queryParams = api.utils.parseQueryString( urlParser.search.substr( 1 ) );
+ if ( api.settings.changeset.latestAutoDraftUuid ) {
+ queryParams.changeset_uuid = api.settings.changeset.latestAutoDraftUuid;
+ } else {
+ queryParams.customize_autosaved = 'on';
+ }
+ queryParams['return'] = api.settings.url['return'];
+ urlParser.search = $.param( queryParams );
+ return urlParser.href;
+ }
+
+ /**
+ * Remove parameter from the URL.
+ *
+ * @param {Array} params - Parameter names to remove.
+ * @returns {void}
+ */
+ function stripParamsFromLocation( params ) {
+ var urlParser = document.createElement( 'a' ), queryParams, strippedParams = 0;
+ urlParser.href = location.href;
+ queryParams = api.utils.parseQueryString( urlParser.search.substr( 1 ) );
+ _.each( params, function( param ) {
+ if ( 'undefined' !== typeof queryParams[ param ] ) {
+ strippedParams += 1;
+ delete queryParams[ param ];
+ }
+ } );
+ if ( 0 === strippedParams ) {
+ return;
+ }
+
+ urlParser.search = $.param( queryParams );
+ history.replaceState( {}, document.title, urlParser.href );
+ }
+
+ /**
+ * Dismiss autosave.
+ *
+ * @returns {void}
+ */
+ function dismissAutosave() {
+ if ( autosaveDismissed ) {
+ return;
+ }
+ wp.ajax.post( 'customize_dismiss_autosave_or_lock', {
+ wp_customize: 'on',
+ customize_theme: api.settings.theme.stylesheet,
+ customize_changeset_uuid: api.settings.changeset.uuid,
+ nonce: api.settings.nonce.dismiss_autosave_or_lock,
+ dismiss_autosave: true
+ } );
+ autosaveDismissed = true;
+ }
+
+ /**
+ * Add notification regarding the availability of an autosave to restore.
+ *
+ * @returns {void}
+ */
+ function addAutosaveRestoreNotification() {
+ var code = 'autosave_available', onStateChange;
+
+ // Since there is an autosave revision and the user hasn't loaded with autosaved, add notification to prompt to load autosaved version.
+ api.notifications.add( new api.Notification( code, {
+ message: api.l10n.autosaveNotice,
+ type: 'warning',
+ dismissible: true,
+ render: function() {
+ var li = api.Notification.prototype.render.call( this ), link;
+
+ // Handle clicking on restoration link.
+ link = li.find( 'a' );
+ link.prop( 'href', getAutosaveRestorationUrl() );
+ link.on( 'click', function( event ) {
+ event.preventDefault();
+ location.replace( getAutosaveRestorationUrl() );
+ } );
+
+ // Handle dismissal of notice.
+ li.find( '.notice-dismiss' ).on( 'click', dismissAutosave );
+
+ return li;
+ }
+ } ) );
+
+ // Remove the notification once the user starts making changes.
+ onStateChange = function() {
+ dismissAutosave();
+ api.notifications.remove( code );
+ api.unbind( 'change', onStateChange );
+ api.state( 'changesetStatus' ).unbind( onStateChange );
+ };
+ api.bind( 'change', onStateChange );
+ api.state( 'changesetStatus' ).bind( onStateChange );
+ }
+
+ if ( api.settings.changeset.autosaved ) {
+ api.state( 'saved' ).set( false );
+ removedQueryParams.push( 'customize_autosaved' );
+ }
+ if ( ! api.settings.changeset.branching && ( ! api.settings.changeset.status || 'auto-draft' === api.settings.changeset.status ) ) {
+ removedQueryParams.push( 'changeset_uuid' ); // Remove UUID when restoring autosave auto-draft.
+ }
+ if ( removedQueryParams.length > 0 ) {
+ stripParamsFromLocation( removedQueryParams );
+ }
+ if ( api.settings.changeset.latestAutoDraftUuid || api.settings.changeset.hasAutosaveRevision ) {
+ addAutosaveRestoreNotification();
+ }
+ })();
+
+ // Check if preview url is valid and load the preview frame.
+ if ( api.previewer.previewUrl() ) {
+ api.previewer.refresh();
+ } else {
+ api.previewer.previewUrl( api.settings.url.home );
+ }
+
+ // Button bindings.
+ saveBtn.click( function( event ) {
+ api.previewer.save();
+ event.preventDefault();
+ }).keydown( function( event ) {
+ if ( 9 === event.which ) { // Tab.
+ return;
+ }
+ if ( 13 === event.which ) { // Enter.
+ api.previewer.save();
+ }
+ event.preventDefault();
+ });
+
+ closeBtn.keydown( function( event ) {
+ if ( 9 === event.which ) { // Tab.
+ return;
+ }
+ if ( 13 === event.which ) { // Enter.
+ this.click();
+ }
+ event.preventDefault();
+ });
+
+ $( '.collapse-sidebar' ).on( 'click', function() {
+ api.state( 'paneVisible' ).set( ! api.state( 'paneVisible' ).get() );
+ });
+
+ api.state( 'paneVisible' ).bind( function( paneVisible ) {
+ overlay.toggleClass( 'preview-only', ! paneVisible );
+ overlay.toggleClass( 'expanded', paneVisible );
+ overlay.toggleClass( 'collapsed', ! paneVisible );
+
+ if ( ! paneVisible ) {
+ $( '.collapse-sidebar' ).attr({ 'aria-expanded': 'false', 'aria-label': api.l10n.expandSidebar });
+ } else {
+ $( '.collapse-sidebar' ).attr({ 'aria-expanded': 'true', 'aria-label': api.l10n.collapseSidebar });
+ }
+ });
+
+ // Keyboard shortcuts - esc to exit section/panel.
+ body.on( 'keydown', function( event ) {
+ var collapsedObject, expandedControls = [], expandedSections = [], expandedPanels = [];
+
+ if ( 27 !== event.which ) { // Esc.
+ return;
+ }
+
+ /*
+ * Abort if the event target is not the body (the default) and not inside of #customize-controls.
+ * This ensures that ESC meant to collapse a modal dialog or a TinyMCE toolbar won't collapse something else.
+ */
+ if ( ! $( event.target ).is( 'body' ) && ! $.contains( $( '#customize-controls' )[0], event.target ) ) {
+ return;
+ }
+
+ // Check for expanded expandable controls (e.g. widgets and nav menus items), sections, and panels.
+ api.control.each( function( control ) {
+ if ( control.expanded && control.expanded() && _.isFunction( control.collapse ) ) {
+ expandedControls.push( control );
+ }
+ });
+ api.section.each( function( section ) {
+ if ( section.expanded() ) {
+ expandedSections.push( section );
+ }
+ });
+ api.panel.each( function( panel ) {
+ if ( panel.expanded() ) {
+ expandedPanels.push( panel );
+ }
+ });
+
+ // Skip collapsing expanded controls if there are no expanded sections.
+ if ( expandedControls.length > 0 && 0 === expandedSections.length ) {
+ expandedControls.length = 0;
+ }
+
+ // Collapse the most granular expanded object.
+ collapsedObject = expandedControls[0] || expandedSections[0] || expandedPanels[0];
+ if ( collapsedObject ) {
+ if ( 'themes' === collapsedObject.params.type ) {
+
+ // Themes panel or section.
+ if ( body.hasClass( 'modal-open' ) ) {
+ collapsedObject.closeDetails();
+ } else if ( api.panel.has( 'themes' ) ) {
+
+ // If we're collapsing a section, collapse the panel also.
+ api.panel( 'themes' ).collapse();
+ }
+ return;
+ }
+ collapsedObject.collapse();
+ event.preventDefault();
+ }
+ });
+
+ $( '.customize-controls-preview-toggle' ).on( 'click', function() {
+ api.state( 'paneVisible' ).set( ! api.state( 'paneVisible' ).get() );
+ });
+
+ /*
+ * Sticky header feature.
+ */
+ (function initStickyHeaders() {
+ var parentContainer = $( '.wp-full-overlay-sidebar-content' ),
+ changeContainer, updateHeaderHeight, releaseStickyHeader, resetStickyHeader, positionStickyHeader,
+ activeHeader, lastScrollTop;
+
+ /**
+ * Determine which panel or section is currently expanded.
+ *
+ * @since 4.7.0
+ * @access private
+ *
+ * @param {wp.customize.Panel|wp.customize.Section} container Construct.
+ * @returns {void}
+ */
+ changeContainer = function( container ) {
+ var newInstance = container,
+ expandedSection = api.state( 'expandedSection' ).get(),
+ expandedPanel = api.state( 'expandedPanel' ).get(),
+ headerElement;
+
+ if ( activeHeader && activeHeader.element ) {
+ // Release previously active header element.
+ releaseStickyHeader( activeHeader.element );
+
+ // Remove event listener in the previous panel or section.
+ activeHeader.element.find( '.description' ).off( 'toggled', updateHeaderHeight );
+ }
+
+ if ( ! newInstance ) {
+ if ( ! expandedSection && expandedPanel && expandedPanel.contentContainer ) {
+ newInstance = expandedPanel;
+ } else if ( ! expandedPanel && expandedSection && expandedSection.contentContainer ) {
+ newInstance = expandedSection;
+ } else {
+ activeHeader = false;
+ return;
+ }
+ }
+
+ headerElement = newInstance.contentContainer.find( '.customize-section-title, .panel-meta' ).first();
+ if ( headerElement.length ) {
+ activeHeader = {
+ instance: newInstance,
+ element: headerElement,
+ parent: headerElement.closest( '.customize-pane-child' ),
+ height: headerElement.outerHeight()
+ };
+
+ // Update header height whenever help text is expanded or collapsed.
+ activeHeader.element.find( '.description' ).on( 'toggled', updateHeaderHeight );
+
+ if ( expandedSection ) {
+ resetStickyHeader( activeHeader.element, activeHeader.parent );
+ }
+ } else {
+ activeHeader = false;
+ }
+ };
+ api.state( 'expandedSection' ).bind( changeContainer );
+ api.state( 'expandedPanel' ).bind( changeContainer );
+
+ // Throttled scroll event handler.
+ parentContainer.on( 'scroll', _.throttle( function() {
+ if ( ! activeHeader ) {
+ return;
+ }
+
+ var scrollTop = parentContainer.scrollTop(),
+ scrollDirection;
+
+ if ( ! lastScrollTop ) {
+ scrollDirection = 1;
+ } else {
+ if ( scrollTop === lastScrollTop ) {
+ scrollDirection = 0;
+ } else if ( scrollTop > lastScrollTop ) {
+ scrollDirection = 1;
+ } else {
+ scrollDirection = -1;
+ }
+ }
+ lastScrollTop = scrollTop;
+ if ( 0 !== scrollDirection ) {
+ positionStickyHeader( activeHeader, scrollTop, scrollDirection );
+ }
+ }, 8 ) );
+
+ // Update header position on sidebar layout change.
+ api.notifications.bind( 'sidebarTopUpdated', function() {
+ if ( activeHeader && activeHeader.element.hasClass( 'is-sticky' ) ) {
+ activeHeader.element.css( 'top', parentContainer.css( 'top' ) );
+ }
+ });
+
+ // Release header element if it is sticky.
+ releaseStickyHeader = function( headerElement ) {
+ if ( ! headerElement.hasClass( 'is-sticky' ) ) {
+ return;
+ }
+ headerElement
+ .removeClass( 'is-sticky' )
+ .addClass( 'maybe-sticky is-in-view' )
+ .css( 'top', parentContainer.scrollTop() + 'px' );
+ };
+
+ // Reset position of the sticky header.
+ resetStickyHeader = function( headerElement, headerParent ) {
+ if ( headerElement.hasClass( 'is-in-view' ) ) {
+ headerElement
+ .removeClass( 'maybe-sticky is-in-view' )
+ .css( {
+ width: '',
+ top: ''
+ } );
+ headerParent.css( 'padding-top', '' );
+ }
+ };
+
+ /**
+ * Update active header height.
+ *
+ * @since 4.7.0
+ * @access private
+ *
+ * @returns {void}
+ */
+ updateHeaderHeight = function() {
+ activeHeader.height = activeHeader.element.outerHeight();
+ };
+
+ /**
+ * Reposition header on throttled `scroll` event.
+ *
+ * @since 4.7.0
+ * @access private
+ *
+ * @param {object} header - Header.
+ * @param {number} scrollTop - Scroll top.
+ * @param {number} scrollDirection - Scroll direction, negative number being up and positive being down.
+ * @returns {void}
+ */
+ positionStickyHeader = function( header, scrollTop, scrollDirection ) {
+ var headerElement = header.element,
+ headerParent = header.parent,
+ headerHeight = header.height,
+ headerTop = parseInt( headerElement.css( 'top' ), 10 ),
+ maybeSticky = headerElement.hasClass( 'maybe-sticky' ),
+ isSticky = headerElement.hasClass( 'is-sticky' ),
+ isInView = headerElement.hasClass( 'is-in-view' ),
+ isScrollingUp = ( -1 === scrollDirection );
+
+ // When scrolling down, gradually hide sticky header.
+ if ( ! isScrollingUp ) {
+ if ( isSticky ) {
+ headerTop = scrollTop;
+ headerElement
+ .removeClass( 'is-sticky' )
+ .css( {
+ top: headerTop + 'px',
+ width: ''
+ } );
+ }
+ if ( isInView && scrollTop > headerTop + headerHeight ) {
+ headerElement.removeClass( 'is-in-view' );
+ headerParent.css( 'padding-top', '' );
+ }
+ return;
+ }
+
+ // Scrolling up.
+ if ( ! maybeSticky && scrollTop >= headerHeight ) {
+ maybeSticky = true;
+ headerElement.addClass( 'maybe-sticky' );
+ } else if ( 0 === scrollTop ) {
+ // Reset header in base position.
+ headerElement
+ .removeClass( 'maybe-sticky is-in-view is-sticky' )
+ .css( {
+ top: '',
+ width: ''
+ } );
+ headerParent.css( 'padding-top', '' );
+ return;
+ }
+
+ if ( isInView && ! isSticky ) {
+ // Header is in the view but is not yet sticky.
+ if ( headerTop >= scrollTop ) {
+ // Header is fully visible.
+ headerElement
+ .addClass( 'is-sticky' )
+ .css( {
+ top: parentContainer.css( 'top' ),
+ width: headerParent.outerWidth() + 'px'
+ } );
+ }
+ } else if ( maybeSticky && ! isInView ) {
+ // Header is out of the view.
+ headerElement
+ .addClass( 'is-in-view' )
+ .css( 'top', ( scrollTop - headerHeight ) + 'px' );
+ headerParent.css( 'padding-top', headerHeight + 'px' );
+ }
+ };
+ }());
+
+ // Previewed device bindings. (The api.previewedDevice property is how this Value was first introduced, but since it has moved to api.state.)
+ api.previewedDevice = api.state( 'previewedDevice' );
+
+ // Set the default device.
+ api.bind( 'ready', function() {
+ _.find( api.settings.previewableDevices, function( value, key ) {
+ if ( true === value['default'] ) {
+ api.previewedDevice.set( key );
+ return true;
+ }
+ } );
+ } );
+
+ // Set the toggled device.
+ footerActions.find( '.devices button' ).on( 'click', function( event ) {
+ api.previewedDevice.set( $( event.currentTarget ).data( 'device' ) );
+ });
+
+ // Bind device changes.
+ api.previewedDevice.bind( function( newDevice ) {
+ var overlay = $( '.wp-full-overlay' ),
+ devices = '';
+
+ footerActions.find( '.devices button' )
+ .removeClass( 'active' )
+ .attr( 'aria-pressed', false );
+
+ footerActions.find( '.devices .preview-' + newDevice )
+ .addClass( 'active' )
+ .attr( 'aria-pressed', true );
+
+ $.each( api.settings.previewableDevices, function( device ) {
+ devices += ' preview-' + device;
+ } );
+
+ overlay
+ .removeClass( devices )
+ .addClass( 'preview-' + newDevice );
+ } );
+
+ // Bind site title display to the corresponding field.
+ if ( title.length ) {
+ api( 'blogname', function( setting ) {
+ var updateTitle = function() {
+ title.text( $.trim( setting() ) || api.l10n.untitledBlogName );
+ };
+ setting.bind( updateTitle );
+ updateTitle();
+ } );
+ }
+
+ /*
+ * Create a postMessage connection with a parent frame,
+ * in case the Customizer frame was opened with the Customize loader.
+ *
+ * @see wp.customize.Loader
+ */
+ parent = new api.Messenger({
+ url: api.settings.url.parent,
+ channel: 'loader'
+ });
+
+ // Handle exiting of Customizer.
+ (function() {
+ var isInsideIframe = false;
+
+ function isCleanState() {
+ var defaultChangesetStatus;
+
+ /*
+ * Handle special case of previewing theme switch since some settings (for nav menus and widgets)
+ * are pre-dirty and non-active themes can only ever be auto-drafts.
+ */
+ if ( ! api.state( 'activated' ).get() ) {
+ return 0 === api._latestRevision;
+ }
+
+ // Dirty if the changeset status has been changed but not saved yet.
+ defaultChangesetStatus = api.state( 'changesetStatus' ).get();
+ if ( '' === defaultChangesetStatus || 'auto-draft' === defaultChangesetStatus ) {
+ defaultChangesetStatus = 'publish';
+ }
+ if ( api.state( 'selectedChangesetStatus' ).get() !== defaultChangesetStatus ) {
+ return false;
+ }
+
+ // Dirty if scheduled but the changeset date hasn't been saved yet.
+ if ( 'future' === api.state( 'selectedChangesetStatus' ).get() && api.state( 'selectedChangesetDate' ).get() !== api.state( 'changesetDate' ).get() ) {
+ return false;
+ }
+
+ return api.state( 'saved' ).get() && 'auto-draft' !== api.state( 'changesetStatus' ).get();
+ }
+
+ /*
+ * If we receive a 'back' event, we're inside an iframe.
+ * Send any clicks to the 'Return' link to the parent page.
+ */
+ parent.bind( 'back', function() {
+ isInsideIframe = true;
+ });
+
+ function startPromptingBeforeUnload() {
+ api.unbind( 'change', startPromptingBeforeUnload );
+ api.state( 'selectedChangesetStatus' ).unbind( startPromptingBeforeUnload );
+ api.state( 'selectedChangesetDate' ).unbind( startPromptingBeforeUnload );
+
+ // Prompt user with AYS dialog if leaving the Customizer with unsaved changes
+ $( window ).on( 'beforeunload.customize-confirm', function() {
+ if ( ! isCleanState() && ! api.state( 'changesetLocked' ).get() ) {
+ setTimeout( function() {
+ overlay.removeClass( 'customize-loading' );
+ }, 1 );
+ return api.l10n.saveAlert;
+ }
+ });
+ }
+ api.bind( 'change', startPromptingBeforeUnload );
+ api.state( 'selectedChangesetStatus' ).bind( startPromptingBeforeUnload );
+ api.state( 'selectedChangesetDate' ).bind( startPromptingBeforeUnload );
+
+ function requestClose() {
+ var clearedToClose = $.Deferred(), dismissAutoSave = false, dismissLock = false;
+
+ if ( isCleanState() ) {
+ dismissLock = true;
+ } else if ( confirm( api.l10n.saveAlert ) ) {
+
+ dismissLock = true;
+
+ // Mark all settings as clean to prevent another call to requestChangesetUpdate.
+ api.each( function( setting ) {
+ setting._dirty = false;
+ });
+ $( document ).off( 'visibilitychange.wp-customize-changeset-update' );
+ $( window ).off( 'beforeunload.wp-customize-changeset-update' );
+
+ closeBtn.css( 'cursor', 'progress' );
+ if ( '' !== api.state( 'changesetStatus' ).get() ) {
+ dismissAutoSave = true;
+ }
+ } else {
+ clearedToClose.reject();
+ }
+
+ if ( dismissLock || dismissAutoSave ) {
+ wp.ajax.send( 'customize_dismiss_autosave_or_lock', {
+ timeout: 500, // Don't wait too long.
+ data: {
+ wp_customize: 'on',
+ customize_theme: api.settings.theme.stylesheet,
+ customize_changeset_uuid: api.settings.changeset.uuid,
+ nonce: api.settings.nonce.dismiss_autosave_or_lock,
+ dismiss_autosave: dismissAutoSave,
+ dismiss_lock: dismissLock
+ }
+ } ).always( function() {
+ clearedToClose.resolve();
+ } );
+ }
+
+ return clearedToClose.promise();
+ }
+
+ parent.bind( 'confirm-close', function() {
+ requestClose().done( function() {
+ parent.send( 'confirmed-close', true );
+ } ).fail( function() {
+ parent.send( 'confirmed-close', false );
+ } );
+ } );
+
+ closeBtn.on( 'click.customize-controls-close', function( event ) {
+ event.preventDefault();
+ if ( isInsideIframe ) {
+ parent.send( 'close' ); // See confirm-close logic above.
+ } else {
+ requestClose().done( function() {
+ $( window ).off( 'beforeunload.customize-confirm' );
+ window.location.href = closeBtn.prop( 'href' );
+ } );
+ }
+ });
+ })();
+
+ // Pass events through to the parent.
+ $.each( [ 'saved', 'change' ], function ( i, event ) {
+ api.bind( event, function() {
+ parent.send( event );
+ });
+ } );
+
+ // Pass titles to the parent
+ api.bind( 'title', function( newTitle ) {
+ parent.send( 'title', newTitle );
+ });
+
+ if ( api.settings.changeset.branching ) {
+ parent.send( 'changeset-uuid', api.settings.changeset.uuid );
+ }
+
+ // Initialize the connection with the parent frame.
+ parent.send( 'ready' );
+
+ // Control visibility for default controls
+ $.each({
+ 'background_image': {
+ controls: [ 'background_preset', 'background_position', 'background_size', 'background_repeat', 'background_attachment' ],
+ callback: function( to ) { return !! to; }
+ },
+ 'show_on_front': {
+ controls: [ 'page_on_front', 'page_for_posts' ],
+ callback: function( to ) { return 'page' === to; }
+ },
+ 'header_textcolor': {
+ controls: [ 'header_textcolor' ],
+ callback: function( to ) { return 'blank' !== to; }
+ }
+ }, function( settingId, o ) {
+ api( settingId, function( setting ) {
+ $.each( o.controls, function( i, controlId ) {
+ api.control( controlId, function( control ) {
+ var visibility = function( to ) {
+ control.container.toggle( o.callback( to ) );
+ };
+
+ visibility( setting.get() );
+ setting.bind( visibility );
+ });
+ });
+ });
+ });
+
+ api.control( 'background_preset', function( control ) {
+ var visibility, defaultValues, values, toggleVisibility, updateSettings, preset;
+
+ visibility = { // position, size, repeat, attachment
+ 'default': [ false, false, false, false ],
+ 'fill': [ true, false, false, false ],
+ 'fit': [ true, false, true, false ],
+ 'repeat': [ true, false, false, true ],
+ 'custom': [ true, true, true, true ]
+ };
+
+ defaultValues = [
+ _wpCustomizeBackground.defaults['default-position-x'],
+ _wpCustomizeBackground.defaults['default-position-y'],
+ _wpCustomizeBackground.defaults['default-size'],
+ _wpCustomizeBackground.defaults['default-repeat'],
+ _wpCustomizeBackground.defaults['default-attachment']
+ ];
+
+ values = { // position_x, position_y, size, repeat, attachment
+ 'default': defaultValues,
+ 'fill': [ 'left', 'top', 'cover', 'no-repeat', 'fixed' ],
+ 'fit': [ 'left', 'top', 'contain', 'no-repeat', 'fixed' ],
+ 'repeat': [ 'left', 'top', 'auto', 'repeat', 'scroll' ]
+ };
+
+ // @todo These should actually toggle the active state, but without the preview overriding the state in data.activeControls.
+ toggleVisibility = function( preset ) {
+ _.each( [ 'background_position', 'background_size', 'background_repeat', 'background_attachment' ], function( controlId, i ) {
+ var control = api.control( controlId );
+ if ( control ) {
+ control.container.toggle( visibility[ preset ][ i ] );
+ }
+ } );
+ };
+
+ updateSettings = function( preset ) {
+ _.each( [ 'background_position_x', 'background_position_y', 'background_size', 'background_repeat', 'background_attachment' ], function( settingId, i ) {
+ var setting = api( settingId );
+ if ( setting ) {
+ setting.set( values[ preset ][ i ] );
+ }
+ } );
+ };
+
+ preset = control.setting.get();
+ toggleVisibility( preset );
+
+ control.setting.bind( 'change', function( preset ) {
+ toggleVisibility( preset );
+ if ( 'custom' !== preset ) {
+ updateSettings( preset );
+ }
+ } );
+ } );
+
+ api.control( 'background_repeat', function( control ) {
+ control.elements[0].unsync( api( 'background_repeat' ) );
+
+ control.element = new api.Element( control.container.find( 'input' ) );
+ control.element.set( 'no-repeat' !== control.setting() );
+
+ control.element.bind( function( to ) {
+ control.setting.set( to ? 'repeat' : 'no-repeat' );
+ } );
+
+ control.setting.bind( function( to ) {
+ control.element.set( 'no-repeat' !== to );
+ } );
+ } );
+
+ api.control( 'background_attachment', function( control ) {
+ control.elements[0].unsync( api( 'background_attachment' ) );
+
+ control.element = new api.Element( control.container.find( 'input' ) );
+ control.element.set( 'fixed' !== control.setting() );
+
+ control.element.bind( function( to ) {
+ control.setting.set( to ? 'scroll' : 'fixed' );
+ } );
+
+ control.setting.bind( function( to ) {
+ control.element.set( 'fixed' !== to );
+ } );
+ } );
+
+ // Juggle the two controls that use header_textcolor
+ api.control( 'display_header_text', function( control ) {
+ var last = '';
+
+ control.elements[0].unsync( api( 'header_textcolor' ) );
+
+ control.element = new api.Element( control.container.find('input') );
+ control.element.set( 'blank' !== control.setting() );
+
+ control.element.bind( function( to ) {
+ if ( ! to ) {
+ last = api( 'header_textcolor' ).get();
+ }
+
+ control.setting.set( to ? last : 'blank' );
+ });
+
+ control.setting.bind( function( to ) {
+ control.element.set( 'blank' !== to );
+ });
+ });
+
+ // Add behaviors to the static front page controls.
+ api( 'show_on_front', 'page_on_front', 'page_for_posts', function( showOnFront, pageOnFront, pageForPosts ) {
+ var handleChange = function() {
+ var setting = this, pageOnFrontId, pageForPostsId, errorCode = 'show_on_front_page_collision';
+ pageOnFrontId = parseInt( pageOnFront(), 10 );
+ pageForPostsId = parseInt( pageForPosts(), 10 );
+
+ if ( 'page' === showOnFront() ) {
+
+ // Change previewed URL to the homepage when changing the page_on_front.
+ if ( setting === pageOnFront && pageOnFrontId > 0 ) {
+ api.previewer.previewUrl.set( api.settings.url.home );
+ }
+
+ // Change the previewed URL to the selected page when changing the page_for_posts.
+ if ( setting === pageForPosts && pageForPostsId > 0 ) {
+ api.previewer.previewUrl.set( api.settings.url.home + '?page_id=' + pageForPostsId );
+ }
+ }
+
+ // Toggle notification when the homepage and posts page are both set and the same.
+ if ( 'page' === showOnFront() && pageOnFrontId && pageForPostsId && pageOnFrontId === pageForPostsId ) {
+ showOnFront.notifications.add( new api.Notification( errorCode, {
+ type: 'error',
+ message: api.l10n.pageOnFrontError
+ } ) );
+ } else {
+ showOnFront.notifications.remove( errorCode );
+ }
+ };
+ showOnFront.bind( handleChange );
+ pageOnFront.bind( handleChange );
+ pageForPosts.bind( handleChange );
+ handleChange.call( showOnFront, showOnFront() ); // Make sure initial notification is added after loading existing changeset.
+
+ // Move notifications container to the bottom.
+ api.control( 'show_on_front', function( showOnFrontControl ) {
+ showOnFrontControl.deferred.embedded.done( function() {
+ showOnFrontControl.container.append( showOnFrontControl.getNotificationsContainerElement() );
+ });
+ });
+ });
+
+ // Add code editor for Custom CSS.
+ (function() {
+ var sectionReady = $.Deferred();
+
+ api.section( 'custom_css', function( section ) {
+ section.deferred.embedded.done( function() {
+ if ( section.expanded() ) {
+ sectionReady.resolve( section );
+ } else {
+ section.expanded.bind( function( isExpanded ) {
+ if ( isExpanded ) {
+ sectionReady.resolve( section );
+ }
+ } );
+ }
+ });
+ });
+
+ // Set up the section description behaviors.
+ sectionReady.done( function setupSectionDescription( section ) {
+ var control = api.control( 'custom_css' );
+
+ // Hide redundant label for visual users.
+ control.container.find( '.customize-control-title:first' ).addClass( 'screen-reader-text' );
+
+ // Close the section description when clicking the close button.
+ section.container.find( '.section-description-buttons .section-description-close' ).on( 'click', function() {
+ section.container.find( '.section-meta .customize-section-description:first' )
+ .removeClass( 'open' )
+ .slideUp();
+
+ section.container.find( '.customize-help-toggle' )
+ .attr( 'aria-expanded', 'false' )
+ .focus(); // Avoid focus loss.
+ });
+
+ // Reveal help text if setting is empty.
+ if ( control && ! control.setting.get() ) {
+ section.container.find( '.section-meta .customize-section-description:first' )
+ .addClass( 'open' )
+ .show()
+ .trigger( 'toggled' );
+
+ section.container.find( '.customize-help-toggle' ).attr( 'aria-expanded', 'true' );
+ }
+ });
+ })();
+
+ // Toggle visibility of Header Video notice when active state change.
+ api.control( 'header_video', function( headerVideoControl ) {
+ headerVideoControl.deferred.embedded.done( function() {
+ var toggleNotice = function() {
+ var section = api.section( headerVideoControl.section() ), noticeCode = 'video_header_not_available';
+ if ( ! section ) {
+ return;
+ }
+ if ( headerVideoControl.active.get() ) {
+ section.notifications.remove( noticeCode );
+ } else {
+ section.notifications.add( new api.Notification( noticeCode, {
+ type: 'info',
+ message: api.l10n.videoHeaderNotice
+ } ) );
+ }
+ };
+ toggleNotice();
+ headerVideoControl.active.bind( toggleNotice );
+ } );
+ } );
+
+ // Update the setting validities.
+ api.previewer.bind( 'selective-refresh-setting-validities', function handleSelectiveRefreshedSettingValidities( settingValidities ) {
+ api._handleSettingValidities( {
+ settingValidities: settingValidities,
+ focusInvalidControl: false
+ } );
+ } );
+
+ // Focus on the control that is associated with the given setting.
+ api.previewer.bind( 'focus-control-for-setting', function( settingId ) {
+ var matchedControls = [];
+ api.control.each( function( control ) {
+ var settingIds = _.pluck( control.settings, 'id' );
+ if ( -1 !== _.indexOf( settingIds, settingId ) ) {
+ matchedControls.push( control );
+ }
+ } );
+
+ // Focus on the matched control with the lowest priority (appearing higher).
+ if ( matchedControls.length ) {
+ matchedControls.sort( function( a, b ) {
+ return a.priority() - b.priority();
+ } );
+ matchedControls[0].focus();
+ }
+ } );
+
+ // Refresh the preview when it requests.
+ api.previewer.bind( 'refresh', function() {
+ api.previewer.refresh();
+ });
+
+ // Update the edit shortcut visibility state.
+ api.state( 'paneVisible' ).bind( function( isPaneVisible ) {
+ var isMobileScreen;
+ if ( window.matchMedia ) {
+ isMobileScreen = window.matchMedia( 'screen and ( max-width: 640px )' ).matches;
+ } else {
+ isMobileScreen = $( window ).width() <= 640;
+ }
+ api.state( 'editShortcutVisibility' ).set( isPaneVisible || isMobileScreen ? 'visible' : 'hidden' );
+ } );
+ if ( window.matchMedia ) {
+ window.matchMedia( 'screen and ( max-width: 640px )' ).addListener( function() {
+ var state = api.state( 'paneVisible' );
+ state.callbacks.fireWith( state, [ state.get(), state.get() ] );
+ } );
+ }
+ api.previewer.bind( 'edit-shortcut-visibility', function( visibility ) {
+ api.state( 'editShortcutVisibility' ).set( visibility );
+ } );
+ api.state( 'editShortcutVisibility' ).bind( function( visibility ) {
+ api.previewer.send( 'edit-shortcut-visibility', visibility );
+ } );
+
+ // Autosave changeset.
+ function startAutosaving() {
+ var timeoutId, updateChangesetWithReschedule, scheduleChangesetUpdate, updatePending = false;
+
+ api.unbind( 'change', startAutosaving ); // Ensure startAutosaving only fires once.
+
+ function onChangeSaved( isSaved ) {
+ if ( ! isSaved && ! api.settings.changeset.autosaved ) {
+ api.settings.changeset.autosaved = true; // Once a change is made then autosaving kicks in.
+ api.previewer.send( 'autosaving' );
+ }
+ }
+ api.state( 'saved' ).bind( onChangeSaved );
+ onChangeSaved( api.state( 'saved' ).get() );
+
+ /**
+ * Request changeset update and then re-schedule the next changeset update time.
+ *
+ * @since 4.7.0
+ * @private
+ */
+ updateChangesetWithReschedule = function() {
+ if ( ! updatePending ) {
+ updatePending = true;
+ api.requestChangesetUpdate( {}, { autosave: true } ).always( function() {
+ updatePending = false;
+ } );
+ }
+ scheduleChangesetUpdate();
+ };
+
+ /**
+ * Schedule changeset update.
+ *
+ * @since 4.7.0
+ * @private
+ */
+ scheduleChangesetUpdate = function() {
+ clearTimeout( timeoutId );
+ timeoutId = setTimeout( function() {
+ updateChangesetWithReschedule();
+ }, api.settings.timeouts.changesetAutoSave );
+ };
+
+ // Start auto-save interval for updating changeset.
+ scheduleChangesetUpdate();
+
+ // Save changeset when focus removed from window.
+ $( document ).on( 'visibilitychange.wp-customize-changeset-update', function() {
+ if ( document.hidden ) {
+ updateChangesetWithReschedule();
+ }
+ } );
+
+ // Save changeset before unloading window.
+ $( window ).on( 'beforeunload.wp-customize-changeset-update', function() {
+ updateChangesetWithReschedule();
+ } );
+ }
+ api.bind( 'change', startAutosaving );
+
+ // Make sure TinyMCE dialogs appear above Customizer UI.
+ $( document ).one( 'tinymce-editor-setup', function() {
+ if ( window.tinymce.ui.FloatPanel && ( ! window.tinymce.ui.FloatPanel.zIndex || window.tinymce.ui.FloatPanel.zIndex < 500001 ) ) {
+ window.tinymce.ui.FloatPanel.zIndex = 500001;
+ }
+ } );
+
+ body.addClass( 'ready' );
+ api.trigger( 'ready' );
+ });
+
+})( wp, jQuery );
diff --git a/www/crm/wp-admin/js/customize-controls.min.js b/www/crm/wp-admin/js/customize-controls.min.js
new file mode 100644
index 00000000..66e10d32
--- /dev/null
+++ b/www/crm/wp-admin/js/customize-controls.min.js
@@ -0,0 +1,4 @@
+!function(a,b){var c,d,e,f=wp.customize;f.OverlayNotification=f.Notification.extend({loading:!1,initialize:function(a,b){var c=this;f.Notification.prototype.initialize.call(c,a,b),c.containerClasses+=" notification-overlay",c.loading&&(c.containerClasses+=" notification-loading")},render:function(){var a=f.Notification.prototype.render.call(this);return a.on("keydown",_.bind(this.handleEscape,this)),a},handleEscape:function(a){var b=this;27===a.which&&(a.stopPropagation(),b.dismissible&&b.parent&&b.parent.remove(b.code))}}),f.Notifications=f.Values.extend({alt:!1,defaultConstructor:f.Notification,initialize:function(a){var b=this;f.Values.prototype.initialize.call(b,a),_.bindAll(b,"constrainFocus"),b._addedIncrement=0,b._addedOrder={},b.bind("add",function(a){b.trigger("change",a)}),b.bind("removed",function(a){b.trigger("change",a)})},count:function(){return _.size(this._value)},add:function(a,b){var c,d,e=this;return"string"==typeof a?(c=a,d=b):(c=a.code,d=a),e.has(c)||(e._addedIncrement+=1,e._addedOrder[c]=e._addedIncrement),f.Values.prototype.add.call(e,c,d)},remove:function(a){var b=this;return delete b._addedOrder[a],f.Values.prototype.remove.call(this,a)},get:function(a){var b,c,d,e=this;return b=_.values(e._value),d=_.extend({sort:!1},a),d.sort&&(c={error:4,warning:3,success:2,info:1},b.sort(function(a,b){var d=0,f=0;return _.isUndefined(c[a.type])||(d=c[a.type]),_.isUndefined(c[b.type])||(f=c[b.type]),d!==f?f-d:e._addedOrder[b.code]-e._addedOrder[a.code]})),b},render:function(){var a,c,d,e,g=this,h=!1,i=[],j={};g.container&&g.container.length&&(a=g.get({sort:!0}),g.container.toggle(0!==a.length),g.container.is(g.previousContainer)&&_.isEqual(a,g.previousNotifications)||(d=g.container.children("ul").first(),d.length||(d=b("<ul></ul>"),g.container.append(d)),d.find("> [data-code]").remove(),_.each(g.previousNotifications,function(a){j[a.code]=a}),_.each(a,function(a){var c;!wp.a11y||j[a.code]&&_.isEqual(a.message,j[a.code].message)||wp.a11y.speak(a.message,"assertive"),c=b(a.render()),a.container=c,d.append(c),a.extended(f.OverlayNotification)&&i.push(a)}),c=Boolean(i.length),g.previousNotifications&&(h=Boolean(_.find(g.previousNotifications,function(a){return a.extended(f.OverlayNotification)}))),c!==h&&(b(document.body).toggleClass("customize-loading",c),g.container.toggleClass("has-overlay-notifications",c),c?(g.previousActiveElement=document.activeElement,b(document).on("keydown",g.constrainFocus)):b(document).off("keydown",g.constrainFocus)),c?(g.focusContainer=i[i.length-1].container,g.focusContainer.prop("tabIndex",-1),e=g.focusContainer.find(":focusable"),e.length?e.first().focus():g.focusContainer.focus()):g.previousActiveElement&&(b(g.previousActiveElement).focus(),g.previousActiveElement=null),g.previousNotifications=a,g.previousContainer=g.container,g.trigger("rendered")))},constrainFocus:function(a){var c,d=this;a.stopPropagation(),9===a.which&&(c=d.focusContainer.find(":focusable"),0===c.length&&(c=d.focusContainer),b.contains(d.focusContainer[0],a.target)&&b.contains(d.focusContainer[0],document.activeElement)?c.last().is(a.target)&&!a.shiftKey?(a.preventDefault(),c.first().focus()):c.first().is(a.target)&&a.shiftKey&&(a.preventDefault(),c.last().focus()):(a.preventDefault(),c.first().focus()))}}),f.Setting=f.Value.extend({defaults:{transport:"refresh",dirty:!1},initialize:function(a,b,c){var d,e=this;d=_.extend({previewer:f.previewer},e.defaults,c||{}),f.Value.prototype.initialize.call(e,b,d),e.id=a,e._dirty=d.dirty,e.notifications=new f.Notifications,e.bind(e.preview)},preview:function(){var a,b=this;a=b.transport,"postMessage"!==a||f.state("previewerAlive").get()||(a="refresh"),"postMessage"===a?b.previewer.send("setting",[b.id,b()]):"refresh"===a&&b.previewer.refresh()},findControls:function(){var a=this,b=[];return f.control.each(function(c){_.each(c.settings,function(d){d.id===a.id&&b.push(c)})}),b}}),f._latestRevision=0,f._lastSavedRevision=0,f._latestSettingRevisions={},f.bind("change",function(a){f._latestRevision+=1,f._latestSettingRevisions[a.id]=f._latestRevision}),f.bind("ready",function(){f.bind("add",function(a){a._dirty&&(f._latestRevision+=1,f._latestSettingRevisions[a.id]=f._latestRevision)})}),f.dirtyValues=function(a){var b={};return f.each(function(c){var d;c._dirty&&(d=f._latestSettingRevisions[c.id],f.state("changesetStatus").get()&&a&&a.unsaved&&(_.isUndefined(d)||d<=f._lastSavedRevision)||(b[c.id]=c.get()))}),b},f.requestChangesetUpdate=function(a,c){var d,e,g,h,i={};return d=new b.Deferred,0!==f.state("processing").get()?(d.reject("already_processing"),d.promise()):(h=_.extend({title:null,date:null,autosave:!1,force:!1},c),a&&_.extend(i,a),_.each(f.dirtyValues({unsaved:!0}),function(b,c){a&&null===a[c]||(i[c]=_.extend({},i[c]||{},{value:b}))}),f.trigger("changeset-save",i,h),!h.force&&_.isEmpty(i)&&null===h.title&&null===h.date?(d.resolve({}),d.promise()):h.status?d.reject({code:"illegal_status_in_changeset_update"}).promise():h.date&&h.autosave?d.reject({code:"illegal_autosave_with_date_gmt"}).promise():(f.state("processing").set(f.state("processing").get()+1),d.always(function(){f.state("processing").set(f.state("processing").get()-1)}),g=f.previewer.query({excludeCustomizedSaved:!0}),delete g.customized,_.extend(g,{nonce:f.settings.nonce.save,customize_theme:f.settings.theme.stylesheet,customize_changeset_data:JSON.stringify(i)}),null!==h.title&&(g.customize_changeset_title=h.title),null!==h.date&&(g.customize_changeset_date=h.date),!1!==h.autosave&&(g.customize_changeset_autosave="true"),f.trigger("save-request-params",g),e=wp.ajax.post("customize_save",g),e.done(function(a){var b={};f._lastSavedRevision=Math.max(f._latestRevision,f._lastSavedRevision),f.state("changesetStatus").set(a.changeset_status),a.changeset_date&&f.state("changesetDate").set(a.changeset_date),d.resolve(a),f.trigger("changeset-saved",a),a.setting_validities&&_.each(a.setting_validities,function(a,c){!0===a&&_.isObject(i[c])&&!_.isUndefined(i[c].value)&&(b[c]=i[c].value)}),f.previewer.send("changeset-saved",_.extend({},a,{saved_changeset_values:b}))}),e.fail(function(a){d.reject(a),f.trigger("changeset-error",a)}),e.always(function(a){a.setting_validities&&f._handleSettingValidities({settingValidities:a.setting_validities})}),d.promise()))},f.utils.bubbleChildValueChanges=function(a,c){b.each(c,function(b,c){a[c].bind(function(b,c){a.parent&&b!==c&&a.parent.trigger("change",a)})})},d=function(a){var b,c,d,e;b=this,a=a||{},d=function(){var a;a=(b.extended(f.Panel)||b.extended(f.Section))&&b.expanded&&b.expanded()?b.contentContainer:b.container,e=a.find(".control-focus:first"),0===e.length&&(e=a.find("input, select, textarea, button, object, a[href], [tabindex]").filter(":visible").first()),e.focus()},a.completeCallback?(c=a.completeCallback,a.completeCallback=function(){d(),c()}):a.completeCallback=d,f.state("paneVisible").set(!0),b.expand?b.expand(a):a.completeCallback()},f.utils.prioritySort=function(a,b){return a.priority()===b.priority()&&"number"==typeof a.params.instanceNumber&&"number"==typeof b.params.instanceNumber?a.params.instanceNumber-b.params.instanceNumber:a.priority()-b.priority()},f.utils.isKeydownButNotEnterEvent=function(a){return"keydown"===a.type&&13!==a.which},f.utils.areElementListsEqual=function(a,c){var d=a.length===c.length&&-1===_.indexOf(_.map(_.zip(a,c),function(a){return b(a[0]).is(a[1])}),!1);return d},f.utils.highlightButton=function(a,b){function c(){f=!0}var d,e="button-see-me",f=!1;return d=_.extend({delay:0,focusTarget:a},b),d.focusTarget.on("focusin",c),setTimeout(function(){d.focusTarget.off("focusin",c),f||(a.addClass(e),a.one("animationend",function(){a.removeClass(e)}))},d.delay),c},f.utils.getCurrentTimestamp=function(){var a,b,c;return b=_.now(),a=new Date(f.settings.initialServerDate.replace(/-/g,"/")),c=b-f.settings.initialClientTimestamp,c+=f.settings.initialClientTimestamp-f.settings.initialServerTimestamp,a.setTime(a.getTime()+c),a.getTime()},f.utils.getRemainingTime=function(a){var b,c,d=1e3;return c=a instanceof Date?a.getTime():"string"==typeof a?new Date(a.replace(/-/g,"/")).getTime():a,b=c-f.utils.getCurrentTimestamp(),b=Math.ceil(b/d)},e=function(){var a,b,c;return a=document.createElement("div"),b={transition:"transitionend",OTransition:"oTransitionEnd",MozTransition:"transitionend",WebkitTransition:"webkitTransitionEnd"},c=_.find(_.keys(b),function(b){return!_.isUndefined(a.style[b])}),c?b[c]:null}(),c=f.Class.extend({defaultActiveArguments:{duration:"fast",completeCallback:b.noop},defaultExpandedArguments:{duration:"fast",completeCallback:b.noop},containerType:"container",defaults:{title:"",description:"",priority:100,type:"default",content:null,active:!0,instanceNumber:null},initialize:function(a,d){var e=this;e.id=a,c.instanceCounter||(c.instanceCounter=0),c.instanceCounter++,b.extend(e,{params:_.defaults(d.params||d,e.defaults)}),e.params.instanceNumber||(e.params.instanceNumber=c.instanceCounter),e.notifications=new f.Notifications,e.templateSelector=e.params.templateId||"customize-"+e.containerType+"-"+e.params.type,e.container=b(e.params.content),0===e.container.length&&(e.container=b(e.getContainer())),e.headContainer=e.container,e.contentContainer=e.getContent(),e.container=e.container.add(e.contentContainer),e.deferred={embedded:new b.Deferred},e.priority=new f.Value,e.active=new f.Value,e.activeArgumentsQueue=[],e.expanded=new f.Value,e.expandedArgumentsQueue=[],e.active.bind(function(a){var c=e.activeArgumentsQueue.shift();c=b.extend({},e.defaultActiveArguments,c),a=a&&e.isContextuallyActive(),e.onChangeActive(a,c)}),e.expanded.bind(function(a){var c=e.expandedArgumentsQueue.shift();c=b.extend({},e.defaultExpandedArguments,c),e.onChangeExpanded(a,c)}),e.deferred.embedded.done(function(){e.setupNotifications(),e.attachEvents()}),f.utils.bubbleChildValueChanges(e,["priority","active"]),e.priority.set(e.params.priority),e.active.set(e.params.active),e.expanded.set(!1)},getNotificationsContainerElement:function(){var a=this;return a.contentContainer.find(".customize-control-notifications-container:first")},setupNotifications:function(){var a,b=this;b.notifications.container=b.getNotificationsContainerElement(),a=function(){b.expanded.get()&&b.notifications.render()},b.expanded.bind(a),a(),b.notifications.bind("change",_.debounce(a))},ready:function(){},_children:function(a,b){var c=this,d=[];return f[b].each(function(b){b[a].get()===c.id&&d.push(b)}),d.sort(f.utils.prioritySort),d},isContextuallyActive:function(){throw new Error("Container.isContextuallyActive() must be overridden in a subclass.")},onChangeActive:function(a,c){var d,e,g=this,h=g.headContainer;return c.unchanged?void(c.completeCallback&&c.completeCallback()):(d="resolved"===f.previewer.deferred.active.state()?c.duration:0,g.extended(f.Panel)&&(f.panel.each(function(a){a!==g&&a.expanded()&&(e=a,d=0)}),a||_.each(g.sections(),function(a){a.collapse({duration:0})})),void(b.contains(document,h.get(0))?a?h.slideDown(d,c.completeCallback):g.expanded()?g.collapse({duration:d,completeCallback:function(){h.slideUp(d,c.completeCallback)}}):h.slideUp(d,c.completeCallback):(h.toggle(a),c.completeCallback&&c.completeCallback())))},_toggleActive:function(a,b){var c=this;return b=b||{},a&&this.active.get()||!a&&!this.active.get()?(b.unchanged=!0,c.onChangeActive(c.active.get(),b),!1):(b.unchanged=!1,this.activeArgumentsQueue.push(b),this.active.set(a),!0)},activate:function(a){return this._toggleActive(!0,a)},deactivate:function(a){return this._toggleActive(!1,a)},onChangeExpanded:function(){throw new Error("Must override with subclass.")},_toggleExpanded:function(a,b){var c,d=this;return b=b||{},c=b.completeCallback,!(a&&!d.active())&&(f.state("paneVisible").set(!0),b.completeCallback=function(){c&&c.apply(d,arguments),a?d.container.trigger("expanded"):d.container.trigger("collapsed")},a&&d.expanded.get()||!a&&!d.expanded.get()?(b.unchanged=!0,d.onChangeExpanded(d.expanded.get(),b),!1):(b.unchanged=!1,d.expandedArgumentsQueue.push(b),d.expanded.set(a),!0))},expand:function(a){return this._toggleExpanded(!0,a)},collapse:function(a){return this._toggleExpanded(!1,a)},_animateChangeExpanded:function(a){if(!e)return void(a&&a());var c,d,g,h=this,i=h.contentContainer,j=i.closest(".wp-full-overlay");c=j.add(i),g=!h.panel||""===h.panel()||!!f.panel(h.panel()).contentContainer.hasClass("skip-transition"),g&&(c=c.add("#customize-info, .customize-pane-parent")),d=function(f){2===f.eventPhase&&b(f.target).is(i)&&(i.off(e,d),c.removeClass("busy"),a&&a())},i.on(e,d),c.addClass("busy"),_.defer(function(){var a=i.closest(".wp-full-overlay-sidebar-content"),b=a.scrollTop(),c=i.data("previous-scrollTop")||0,d=h.expanded();d&&0<b?(i.css("top",b+"px"),i.data("previous-scrollTop",b)):!d&&0<b+c&&(i.css("top",c-b+"px"),a.scrollTop(c))})},focus:d,getContainer:function(){var a,c=this;return a=0!==b("#tmpl-"+c.templateSelector).length?wp.template(c.templateSelector):wp.template("customize-"+c.containerType+"-default"),a&&c.container?b.trim(a(_.extend({id:c.id},c.params))):"<li></li>"},getContent:function(){var a=this,b=a.container,c=b.find(".accordion-section-content, .control-panel-content").first(),d="sub-"+b.attr("id"),e=d,f=b.attr("aria-owns");return f&&(e=e+" "+f),b.attr("aria-owns",e),c.detach().attr({id:d,"class":"customize-pane-child "+c.attr("class")+" "+b.attr("class")})}}),f.Section=c.extend({containerType:"section",containerParent:"#customize-theme-controls",containerPaneParent:".customize-pane-parent",defaults:{title:"",description:"",priority:100,type:"default",content:null,active:!0,instanceNumber:null,panel:null,customizeAction:""},initialize:function(a,d){var e,g=this;e=d.params||d,e.type||_.find(f.sectionConstructor,function(a,b){return a===g.constructor&&(e.type=b,!0)}),c.prototype.initialize.call(g,a,e),g.id=a,g.panel=new f.Value,g.panel.bind(function(a){b(g.headContainer).toggleClass("control-subsection",!!a)}),g.panel.set(g.params.panel||""),f.utils.bubbleChildValueChanges(g,["panel"]),g.embed(),g.deferred.embedded.done(function(){g.ready()})},embed:function(){var a,b=this;b.containerParent=f.ensure(b.containerParent),a=function(a){var c;a?f.panel(a,function(a){a.deferred.embedded.done(function(){c=a.contentContainer,b.headContainer.parent().is(c)||c.append(b.headContainer),b.contentContainer.parent().is(b.headContainer)||b.containerParent.append(b.contentContainer),b.deferred.embedded.resolve()})}):(c=f.ensure(b.containerPaneParent),b.headContainer.parent().is(c)||c.append(b.headContainer),b.contentContainer.parent().is(b.headContainer)||b.containerParent.append(b.contentContainer),b.deferred.embedded.resolve())},b.panel.bind(a),a(b.panel.get())},attachEvents:function(){var a,c,d=this;d.container.hasClass("cannot-expand")||(d.container.find(".accordion-section-title, .customize-section-back").on("click keydown",function(a){f.utils.isKeydownButNotEnterEvent(a)||(a.preventDefault(),d.expanded()?d.collapse():d.expand())}),d.container.find(".customize-section-title .customize-help-toggle").on("click",function(){a=d.container.find(".section-meta"),a.hasClass("cannot-expand")||(c=a.find(".customize-section-description:first"),c.toggleClass("open"),c.slideToggle(d.defaultExpandedArguments.duration,function(){c.trigger("toggled")}),b(this).attr("aria-expanded",function(a,b){return"true"===b?"false":"true"}))}))},isContextuallyActive:function(){var a=this,b=a.controls(),c=0;return _(b).each(function(a){a.active()&&(c+=1)}),0!==c},controls:function(){return this._children("section","control")},onChangeExpanded:function(a,c){var d,e,g=this,h=g.headContainer.closest(".wp-full-overlay-sidebar-content"),i=g.contentContainer,j=g.headContainer.closest(".wp-full-overlay"),k=i.find(".customize-section-back"),l=g.headContainer.find(".accordion-section-title").first();a&&!i.hasClass("open")?(d=c.unchanged?c.completeCallback:b.proxy(function(){g._animateChangeExpanded(function(){l.attr("tabindex","-1"),k.attr("tabindex","0"),k.focus(),i.css("top",""),h.scrollTop(0),c.completeCallback&&c.completeCallback()}),i.addClass("open"),j.addClass("section-open"),f.state("expandedSection").set(g)},this),c.allowMultiple||f.section.each(function(a){a!==g&&a.collapse({duration:c.duration})}),g.panel()?f.panel(g.panel()).expand({duration:c.duration,completeCallback:d}):(c.allowMultiple||f.panel.each(function(a){a.collapse()}),d())):!a&&i.hasClass("open")?(g.panel()&&(e=f.panel(g.panel()),e.contentContainer.hasClass("skip-transition")&&e.collapse()),g._animateChangeExpanded(function(){k.attr("tabindex","-1"),l.attr("tabindex","0"),l.focus(),i.css("top",""),c.completeCallback&&c.completeCallback()}),i.removeClass("open"),j.removeClass("section-open"),g===f.state("expandedSection").get()&&f.state("expandedSection").set(!1)):c.completeCallback&&c.completeCallback()}}),f.ThemesSection=f.Section.extend({currentTheme:"",overlay:"",template:"",screenshotQueue:null,$window:null,$body:null,loaded:0,loading:!1,fullyLoaded:!1,term:"",tags:"",nextTerm:"",nextTags:"",filtersHeight:0,headerContainer:null,updateCountDebounced:null,initialize:function(a,c){var d=this;d.headerContainer=b(),d.$window=b(window),d.$body=b(document.body),f.Section.prototype.initialize.call(d,a,c),d.updateCountDebounced=_.debounce(d.updateCount,500)},embed:function(){var a,b=this;a=function(a){var c;f.panel(a,function(a){a.deferred.embedded.done(function(){c=a.contentContainer,b.headContainer.parent().is(c)||c.find(".customize-themes-full-container-container").before(b.headContainer),b.contentContainer.parent().is(b.headContainer)||b.containerParent.append(b.contentContainer),b.deferred.embedded.resolve()})})},b.panel.bind(a),a(b.panel.get())},ready:function(){var a=this;a.overlay=a.container.find(".theme-overlay"),a.template=wp.template("customize-themes-details-view"),a.container.on("keydown",function(b){a.overlay.find(".theme-wrap").is(":visible")&&(39===b.keyCode&&a.nextTheme(),37===b.keyCode&&a.previousTheme(),27===b.keyCode&&(a.$body.hasClass("modal-open")?a.closeDetails():a.headerContainer.find(".customize-themes-section-title").focus(),b.stopPropagation()))}),a.renderScreenshots=_.throttle(a.renderScreenshots,100),_.bindAll(a,"renderScreenshots","loadMore","checkTerm","filtersChecked")},isContextuallyActive:function(){return this.active()},attachEvents:function(){function a(){var a=d.headerContainer.find(".customize-themes-section-title");a.toggleClass("selected",d.expanded()),a.attr("aria-expanded",d.expanded()?"true":"false"),d.expanded()||a.removeClass("details-open")}var c,d=this;d.container.find(".customize-section-back").on("click keydown",function(a){f.utils.isKeydownButNotEnterEvent(a)||(a.preventDefault(),d.collapse())}),d.headerContainer=b("#accordion-section-"+d.id),d.headerContainer.on("click",".customize-themes-section-title",function(){d.headerContainer.find(".filter-details").length&&(d.headerContainer.find(".customize-themes-section-title").toggleClass("details-open").attr("aria-expanded",function(a,b){return"true"===b?"false":"true"}),d.headerContainer.find(".filter-details").slideToggle(180)),d.expanded()||d.expand()}),d.container.on("click",".theme-actions .preview-theme",function(){f.panel("themes").loadThemePreview(b(this).data("slug"))}),d.container.on("click",".left",function(){d.previousTheme()}),d.container.on("click",".right",function(){d.nextTheme()}),d.container.on("click",".theme-backdrop, .close",function(){d.closeDetails()}),"local"===d.params.filter_type?d.container.on("input",".wp-filter-search-themes",function(a){d.filterSearch(a.currentTarget.value)}):"remote"===d.params.filter_type&&(c=_.debounce(d.checkTerm,500),d.contentContainer.on("input",".wp-filter-search",function(){f.panel("themes").expanded()&&(c(d),d.expanded()||d.expand())}),d.contentContainer.on("click",".filter-group input",function(){d.filtersChecked(),d.checkTerm(d)})),d.contentContainer.on("click",".feature-filter-toggle",function(a){var c=b(".customize-themes-full-container"),e=b(a.currentTarget);if(d.filtersHeight=e.parent().next(".filter-drawer").height(),!(0<c.scrollTop()&&(c.animate({scrollTop:0},400),e.hasClass("open"))))if(e.toggleClass("open").attr("aria-expanded",function(a,b){return"true"===b?"false":"true"}).parent().next(".filter-drawer").slideToggle(180,"linear"),e.hasClass("open")){var f=1018<window.innerWidth?50:76;d.contentContainer.find(".themes").css("margin-top",d.filtersHeight+f)}else d.contentContainer.find(".themes").css("margin-top",0)}),d.contentContainer.on("click",".no-themes-local .search-dotorg-themes",function(){f.section("wporg_themes").focus()}),d.expanded.bind(a),a(),f.bind("ready",function(){d.contentContainer=d.container.find(".customize-themes-section"),d.contentContainer.appendTo(b(".customize-themes-full-container")),d.container.add(d.headerContainer)})},onChangeExpanded:function(a,b){function c(){0===d.loaded&&d.loadThemes(),f.section.each(function(a){var c;a!==d&&"themes"===a.params.type&&(c=a.contentContainer.find(".wp-filter-search").val(),d.contentContainer.find(".wp-filter-search").val(c),""===c&&""!==d.term&&"local"!==d.params.filter_type?(d.term="",d.initializeNewQuery(d.term,d.tags)):"remote"===d.params.filter_type?d.checkTerm(d):"local"===d.params.filter_type&&d.filterSearch(c),a.collapse({duration:b.duration}))}),d.contentContainer.addClass("current-section"),e.scrollTop(),e.on("scroll",_.throttle(d.renderScreenshots,300)),e.on("scroll",_.throttle(d.loadMore,300)),b.completeCallback&&b.completeCallback(),d.updateCount()}var d=this,e=d.contentContainer.closest(".customize-themes-full-container");return b.unchanged?void(b.completeCallback&&b.completeCallback()):void(a?d.panel()&&f.panel.has(d.panel())?f.panel(d.panel()).expand({duration:b.duration,completeCallback:c}):c():(d.contentContainer.removeClass("current-section"),d.headerContainer.find(".filter-details").slideUp(180),e.off("scroll"),b.completeCallback&&b.completeCallback()))},getContent:function(){return this.container.find(".control-section-content")},loadThemes:function(){var a,b,c,d=this;d.loading||(b=Math.ceil(d.loaded/100)+1,a={nonce:f.settings.nonce.switch_themes,wp_customize:"on",theme_action:d.params.action,customized_theme:f.settings.theme.stylesheet,page:b},"remote"===d.params.filter_type&&(a.search=d.term,a.tags=d.tags),d.headContainer.closest(".wp-full-overlay").addClass("loading"),d.loading=!0,d.container.find(".no-themes").hide(),c=wp.ajax.post("customize_load_themes",a),c.done(function(a){var c=a.themes;return""!==d.nextTerm||""!==d.nextTags?(d.nextTerm&&(d.term=d.nextTerm),d.nextTags&&(d.tags=d.nextTags),d.nextTerm="",d.nextTags="",d.loading=!1,void d.loadThemes()):(0!==c.length?(d.loadControls(c,b),1===b&&(_.each(d.controls().slice(0,3),function(a){var b,c=a.params.theme.screenshot[0];c&&(b=new Image,b.src=c)}),"local"!==d.params.filter_type&&wp.a11y.speak(f.settings.l10n.themeSearchResults.replace("%d",a.info.results))),_.delay(d.renderScreenshots,100),("local"===d.params.filter_type||100>c.length)&&(d.fullyLoaded=!0)):0===d.loaded?(d.container.find(".no-themes").show(),wp.a11y.speak(d.container.find(".no-themes").text())):d.fullyLoaded=!0,"local"===d.params.filter_type?d.updateCount():d.updateCount(a.info.results),d.container.find(".unexpected-error").hide(),d.headContainer.closest(".wp-full-overlay").removeClass("loading"),void(d.loading=!1))}),c.fail(function(a){"undefined"==typeof a?(d.container.find(".unexpected-error").show(),wp.a11y.speak(d.container.find(".unexpected-error").text())):"undefined"!=typeof console&&console.error&&console.error(a),d.headContainer.closest(".wp-full-overlay").removeClass("loading"),d.loading=!1}))},loadControls:function(a,b){var c=[],d=this;_.each(a,function(a){var b=new f.controlConstructor.theme(d.params.action+"_theme_"+a.id,{type:"theme",section:d.params.id,theme:a,priority:d.loaded+1});f.control.add(b),c.push(b),d.loaded=d.loaded+1}),1!==b&&Array.prototype.push.apply(d.screenshotQueue,c)},loadMore:function(){var a,b,c,d=this;d.fullyLoaded||d.loading||(a=d.container.closest(".customize-themes-full-container"),b=a.scrollTop()+a.height(),c=a.prop("scrollHeight")-3e3,b>c&&d.loadThemes())},filterSearch:function(a){var b,c=0,d=!1,e=this,g=f.section.has("wporg_themes")&&"remote"!==e.params.filter_type?".no-themes-local":".no-themes",h=e.controls();e.loading||(b=a.toLowerCase().trim().replace(/-/g," ").split(" "),_.each(h,function(a){d=a.filter(b),d&&(c+=1)}),0===c?(e.container.find(g).show(),wp.a11y.speak(e.container.find(g).text())):e.container.find(g).hide(),e.renderScreenshots(),f.reflowPaneContents(),e.updateCountDebounced(c))},checkTerm:function(a){var b;"remote"===a.params.filter_type&&(b=a.contentContainer.find(".wp-filter-search").val(),a.term!==b.trim()&&a.initializeNewQuery(b,a.tags))},filtersChecked:function(){var a=this,c=a.container.find(".filter-group").find(":checkbox"),d=[];_.each(c.filter(":checked"),function(a){d.push(b(a).prop("value"))}),0===d.length?(d="",a.contentContainer.find(".feature-filter-toggle .filter-count-0").show(),a.contentContainer.find(".feature-filter-toggle .filter-count-filters").hide()):(a.contentContainer.find(".feature-filter-toggle .theme-filter-count").text(d.length),a.contentContainer.find(".feature-filter-toggle .filter-count-0").hide(),a.contentContainer.find(".feature-filter-toggle .filter-count-filters").show()),_.isEqual(a.tags,d)||(a.loading?a.nextTags=d:"remote"===a.params.filter_type?a.initializeNewQuery(a.term,d):"local"===a.params.filter_type&&a.filterSearch(d.join(" ")))},initializeNewQuery:function(a,b){var c=this;_.each(c.controls(),function(a){a.container.remove(),f.control.remove(a.id)}),c.loaded=0,c.fullyLoaded=!1,c.screenshotQueue=null,c.loading?(c.nextTerm=a,c.nextTags=b):(c.term=a,c.tags=b,c.loadThemes()),c.expanded()||c.expand()},renderScreenshots:function(){var a=this;null!==a.screenshotQueue&&0!==a.screenshotQueue.length||(a.screenshotQueue=_.filter(a.controls(),function(a){return!a.screenshotRendered})),a.screenshotQueue.length&&(a.screenshotQueue=_.filter(a.screenshotQueue,function(b){var c=b.container.find(".theme-screenshot"),d=c.find("img");if(!d.length)return!1;if(d.is(":hidden"))return!0;var e=a.$window.scrollTop(),f=e+a.$window.height(),g=d.offset().top,h=c.height(),i=g+h,j=3*h,k=i>=e-j&&g<=f+j;return k&&b.container.trigger("render-screenshot"),!k}))},getVisibleCount:function(){return this.contentContainer.find("li.customize-control:visible").length},updateCount:function(a){var b,c,d=this;a||0===a||(a=d.getVisibleCount()),c=d.contentContainer.find(".themes-displayed"),b=d.contentContainer.find(".theme-count"),0===a?b.text("0"):(c.fadeOut(180,function(){b.text(a),c.fadeIn(180)}),wp.a11y.speak(f.settings.l10n.announceThemeCount.replace("%d",a)))},nextTheme:function(){var a=this;a.getNextTheme()&&a.showDetails(a.getNextTheme(),function(){a.overlay.find(".right").focus()})},getNextTheme:function(){var a,b,c,d,e=this;return a=f.control(e.params.action+"_theme_"+e.currentTheme),c=e.controls(),d=_.indexOf(c,a),-1!==d&&(b=c[d+1],!!b&&b.params.theme)},previousTheme:function(){var a=this;a.getPreviousTheme()&&a.showDetails(a.getPreviousTheme(),function(){a.overlay.find(".left").focus()})},getPreviousTheme:function(){var a,b,c,d,e=this;return a=f.control(e.params.action+"_theme_"+e.currentTheme),c=e.controls(),d=_.indexOf(c,a),-1!==d&&(b=c[d-1],!!b&&b.params.theme)},updateLimits:function(){this.getNextTheme()||this.overlay.find(".right").addClass("disabled"),this.getPreviousTheme()||this.overlay.find(".left").addClass("disabled")},loadThemePreview:function(a){return f.ThemesPanel.prototype.loadThemePreview.call(this,a)},showDetails:function(a,b){function c(){return!g.canSwitchTheme(a.id)}function d(){return c()||!1===f.settings.theme._canInstall||!0===f.settings.theme._filesystemCredentialsNeeded}var e=this,g=f.panel("themes");e.currentTheme=a.id,e.overlay.html(e.template(a)).fadeIn("fast").focus(),e.overlay.find("button.preview, button.preview-theme").toggleClass("disabled",c()),e.overlay.find("button.theme-install").toggleClass("disabled",d()),e.$body.addClass("modal-open"),e.containFocus(e.overlay),e.updateLimits(),wp.a11y.speak(f.settings.l10n.announceThemeDetails.replace("%s",a.name)),b&&b()},closeDetails:function(){var a=this;a.$body.removeClass("modal-open"),a.overlay.fadeOut("fast"),f.control(a.params.action+"_theme_"+a.currentTheme).container.find(".theme").focus()},containFocus:function(a){var c;a.on("keydown",function(d){if(9===d.keyCode)return c=b(":tabbable",a),c.last()[0]!==d.target||d.shiftKey?c.first()[0]===d.target&&d.shiftKey?(c.last().focus(),!1):void 0:(c.first().focus(),!1)})}}),f.OuterSection=f.Section.extend({initialize:function(){var a=this;a.containerParent="#customize-outer-theme-controls",a.containerPaneParent=".customize-outer-pane-parent",f.Section.prototype.initialize.apply(a,arguments)},onChangeExpanded:function(a,c){var d,e,g=this,h=g.headContainer.closest(".wp-full-overlay-sidebar-content"),i=g.contentContainer,j=i.find(".customize-section-back"),k=g.headContainer.find(".accordion-section-title").first(),l=b(document.body);l.toggleClass("outer-section-open",a),g.container.toggleClass("open",a),g.container.removeClass("busy"),f.section.each(function(a){"outer"===a.params.type&&a.id!==g.id&&a.container.removeClass("open")}),a&&!i.hasClass("open")?(d=c.unchanged?c.completeCallback:b.proxy(function(){g._animateChangeExpanded(function(){k.attr("tabindex","-1"),j.attr("tabindex","0"),j.focus(),i.css("top",""),h.scrollTop(0),c.completeCallback&&c.completeCallback()}),i.addClass("open")},this),g.panel()?f.panel(g.panel()).expand({duration:c.duration,completeCallback:d}):d()):!a&&i.hasClass("open")?(g.panel()&&(e=f.panel(g.panel()),e.contentContainer.hasClass("skip-transition")&&e.collapse()),g._animateChangeExpanded(function(){j.attr("tabindex","-1"),k.attr("tabindex","0"),k.focus(),i.css("top",""),c.completeCallback&&c.completeCallback()}),i.removeClass("open")):c.completeCallback&&c.completeCallback()}}),f.Panel=c.extend({containerType:"panel",initialize:function(a,b){var d,e=this;d=b.params||b,d.type||_.find(f.panelConstructor,function(a,b){return a===e.constructor&&(d.type=b,!0)}),c.prototype.initialize.call(e,a,d),e.embed(),e.deferred.embedded.done(function(){e.ready()})},embed:function(){var a=this,c=b("#customize-theme-controls"),d=b(".customize-pane-parent");a.headContainer.parent().is(d)||d.append(a.headContainer),a.contentContainer.parent().is(a.headContainer)||c.append(a.contentContainer),a.renderContent(),a.deferred.embedded.resolve()},attachEvents:function(){var a,c=this;c.headContainer.find(".accordion-section-title").on("click keydown",function(a){f.utils.isKeydownButNotEnterEvent(a)||(a.preventDefault(),c.expanded()||c.expand())}),c.container.find(".customize-panel-back").on("click keydown",function(a){f.utils.isKeydownButNotEnterEvent(a)||(a.preventDefault(),c.expanded()&&c.collapse())}),a=c.container.find(".panel-meta:first"),a.find("> .accordion-section-title .customize-help-toggle").on("click",function(){if(!a.hasClass("cannot-expand")){var d=a.find(".customize-panel-description:first");a.hasClass("open")?(a.toggleClass("open"),d.slideUp(c.defaultExpandedArguments.duration,function(){d.trigger("toggled")}),b(this).attr("aria-expanded",!1)):(d.slideDown(c.defaultExpandedArguments.duration,function(){d.trigger("toggled")}),a.toggleClass("open"),b(this).attr("aria-expanded",!0))}})},sections:function(){return this._children("panel","section")},isContextuallyActive:function(){var a=this,b=a.sections(),c=0;return _(b).each(function(a){a.active()&&a.isContextuallyActive()&&(c+=1)}),0!==c},onChangeExpanded:function(a,b){if(b.unchanged)return void(b.completeCallback&&b.completeCallback());var c,d=this,e=d.contentContainer,g=e.closest(".wp-full-overlay"),h=e.closest(".wp-full-overlay-sidebar-content"),i=d.headContainer.find(".accordion-section-title"),j=e.find(".customize-panel-back"),k=d.sections();a&&!e.hasClass("current-panel")?(f.section.each(function(a){d.id!==a.panel()&&a.collapse({duration:0})}),f.panel.each(function(a){d!==a&&a.collapse({duration:0});
+}),d.params.autoExpandSoleSection&&1===k.length&&k[0].active.get()?(e.addClass("current-panel skip-transition"),g.addClass("in-sub-panel"),k[0].expand({completeCallback:b.completeCallback})):(d._animateChangeExpanded(function(){i.attr("tabindex","-1"),j.attr("tabindex","0"),j.focus(),e.css("top",""),h.scrollTop(0),b.completeCallback&&b.completeCallback()}),e.addClass("current-panel"),g.addClass("in-sub-panel")),f.state("expandedPanel").set(d)):!a&&e.hasClass("current-panel")&&(c=e.hasClass("skip-transition"),c?e.removeClass("skip-transition"):d._animateChangeExpanded(function(){i.attr("tabindex","0"),j.attr("tabindex","-1"),i.focus(),e.css("top",""),b.completeCallback&&b.completeCallback()}),g.removeClass("in-sub-panel"),e.removeClass("current-panel"),d===f.state("expandedPanel").get()&&f.state("expandedPanel").set(!1))},renderContent:function(){var a,c=this;a=0!==b("#tmpl-"+c.templateSelector+"-content").length?wp.template(c.templateSelector+"-content"):wp.template("customize-panel-default-content"),a&&c.headContainer&&c.contentContainer.html(a(_.extend({id:c.id},c.params)))}}),f.ThemesPanel=f.Panel.extend({initialize:function(a,b){var c=this;c.installingThemes=[],f.Panel.prototype.initialize.call(c,a,b)},canSwitchTheme:function(a){return!(!a||a!==f.settings.theme.stylesheet)||"publish"===f.state("selectedChangesetStatus").get()&&(""===f.state("changesetStatus").get()||"auto-draft"===f.state("changesetStatus").get())},attachEvents:function(){function a(){c.canSwitchTheme()?c.notifications.remove("theme_switch_unavailable"):c.notifications.add(new f.Notification("theme_switch_unavailable",{message:f.l10n.themePreviewUnavailable,type:"warning"}))}var c=this;f.Panel.prototype.attachEvents.apply(c),f.settings.theme._canInstall&&f.settings.theme._filesystemCredentialsNeeded&&c.notifications.add(new f.Notification("theme_install_unavailable",{message:f.l10n.themeInstallUnavailable,type:"info",dismissible:!0})),a(),f.state("selectedChangesetStatus").bind(a),f.state("changesetStatus").bind(a),c.contentContainer.on("click",".customize-theme",function(){c.collapse()}),c.contentContainer.on("click",".customize-themes-section-title, .customize-themes-mobile-back",function(){b(".wp-full-overlay").toggleClass("showing-themes")}),c.contentContainer.on("click",".theme-install",function(a){c.installTheme(a)}),c.contentContainer.on("click",".update-theme, #update-theme",function(a){a.preventDefault(),a.stopPropagation(),c.updateTheme(a)}),c.contentContainer.on("click",".delete-theme",function(a){c.deleteTheme(a)}),_.bindAll(c,"installTheme","updateTheme")},onChangeExpanded:function(a,b){var c,d,e=this,g=!1;return f.Panel.prototype.onChangeExpanded.apply(this,[a,b]),b.unchanged?void(b.completeCallback&&b.completeCallback()):(c=e.headContainer.closest(".wp-full-overlay"),void(a?(c.addClass("in-themes-panel").delay(200).find(".customize-themes-full-container").addClass("animate"),_.delay(function(){c.addClass("themes-panel-expanded")},200),600<window.innerWidth&&(d=e.sections(),_.each(d,function(a){a.expanded()&&(g=!0)}),!g&&d.length>0&&d[0].expand())):c.removeClass("in-themes-panel themes-panel-expanded").find(".customize-themes-full-container").removeClass("animate")))},installTheme:function(a){var c,d,e,g=this,h=b(a.target).data("slug"),i=b.Deferred();return c=b(a.target).hasClass("preview"),f.settings.theme._filesystemCredentialsNeeded?(i.reject({errorCode:"theme_install_unavailable"}),i.promise()):g.canSwitchTheme(h)?_.contains(g.installingThemes,h)?(i.reject({errorCode:"theme_already_installing"}),i.promise()):(wp.updates.maybeRequestFilesystemCredentials(a),d=function(a){var b,d=!1;if(c)f.notifications.remove("theme_installing"),g.loadThemePreview(h);else{if(f.control.each(function(b){"theme"===b.params.type&&b.params.theme.id===a.slug&&(d=b.params.theme,b.rerenderAsInstalled(!0))}),!d||f.control.has("installed_theme_"+d.id))return void i.resolve(a);d.type="installed",b=new f.controlConstructor.theme("installed_theme_"+d.id,{type:"theme",section:"installed_themes",theme:d,priority:0}),f.control.add(b),f.control(b.id).container.trigger("render-screenshot"),f.section.each(function(a){"themes"===a.params.type&&d.id===a.currentTheme&&a.closeDetails()})}i.resolve(a)},g.installingThemes.push(h),e=wp.updates.installTheme({slug:h}),c&&f.notifications.add(new f.OverlayNotification("theme_installing",{message:f.l10n.themeDownloading,type:"info",loading:!0})),e.done(d),e.fail(function(){f.notifications.remove("theme_installing")}),i.promise()):(i.reject({errorCode:"theme_switch_unavailable"}),i.promise())},loadThemePreview:function(a){var c,d,e,g=this,h=b.Deferred();return g.canSwitchTheme(a)?(d=document.createElement("a"),d.href=location.href,e=_.extend(f.utils.parseQueryString(d.search.substr(1)),{theme:a,changeset_uuid:f.settings.changeset.uuid,"return":f.settings.url["return"]}),f.state("saved").get()||(e.customize_autosaved="on"),d.search=b.param(e),f.notifications.add(new f.OverlayNotification("theme_previewing",{message:f.l10n.themePreviewWait,type:"info",loading:!0})),c=function(){var a;f.state("processing").get()>0||(f.state("processing").unbind(c),a=f.requestChangesetUpdate({},{autosave:!0}),a.done(function(){h.resolve(),b(window).off("beforeunload.customize-confirm"),location.replace(d.href)}),a.fail(function(){f.notifications.remove("theme_previewing"),h.reject()}))},0===f.state("processing").get()?c():f.state("processing").bind(c),h.promise()):(h.reject({errorCode:"theme_switch_unavailable"}),h.promise())},updateTheme:function(a){wp.updates.maybeRequestFilesystemCredentials(a),b(document).one("wp-theme-update-success",function(a,b){f.control.each(function(a){"theme"===a.params.type&&a.params.theme.id===b.slug&&(a.params.theme.hasUpdate=!1,a.params.theme.version=b.newVersion,setTimeout(function(){a.rerenderAsInstalled(!0)},2e3))})}),wp.updates.updateTheme({slug:b(a.target).closest(".notice").data("slug")})},deleteTheme:function(a){var c,d;c=b(a.target).data("slug"),d=f.section("installed_themes"),a.preventDefault(),f.settings.theme._filesystemCredentialsNeeded||window.confirm(f.settings.l10n.confirmDeleteTheme)&&(wp.updates.maybeRequestFilesystemCredentials(a),b(document).one("wp-theme-delete-success",function(){var a=f.control("installed_theme_"+c);a.container.remove(),f.control.remove(a.id),d.loaded=d.loaded-1,d.updateCount(),f.control.each(function(a){"theme"===a.params.type&&a.params.theme.id===c&&a.rerenderAsInstalled(!1)})}),wp.updates.deleteTheme({slug:c}),d.closeDetails(),d.focus())}}),f.Control=f.Class.extend({defaultActiveArguments:{duration:"fast",completeCallback:b.noop},defaults:{label:"",description:"",active:!0,priority:10},initialize:function(a,c){var d,e,g=this,h=[];g.params=_.extend({},g.defaults,g.params||{},c.params||c||{}),f.Control.instanceCounter||(f.Control.instanceCounter=0),f.Control.instanceCounter++,g.params.instanceNumber||(g.params.instanceNumber=f.Control.instanceCounter),g.params.type||_.find(f.controlConstructor,function(a,b){return a===g.constructor&&(g.params.type=b,!0)}),g.params.content||(g.params.content=b("<li></li>",{id:"customize-control-"+a.replace(/]/g,"").replace(/\[/g,"-"),"class":"customize-control customize-control-"+g.params.type})),g.id=a,g.selector="#customize-control-"+a.replace(/\]/g,"").replace(/\[/g,"-"),g.params.content?g.container=b(g.params.content):g.container=b(g.selector),g.params.templateId?g.templateSelector=g.params.templateId:g.templateSelector="customize-control-"+g.params.type+"-content",g.deferred=_.extend(g.deferred||{},{embedded:new b.Deferred}),g.section=new f.Value,g.priority=new f.Value,g.active=new f.Value,g.activeArgumentsQueue=[],g.notifications=new f.Notifications({alt:g.altNotice}),g.elements=[],g.active.bind(function(a){var c=g.activeArgumentsQueue.shift();c=b.extend({},g.defaultActiveArguments,c),g.onChangeActive(a,c)}),g.section.set(g.params.section),g.priority.set(isNaN(g.params.priority)?10:g.params.priority),g.active.set(g.params.active),f.utils.bubbleChildValueChanges(g,["section","priority","active"]),g.settings={},d={},g.params.setting&&(d["default"]=g.params.setting),_.extend(d,g.params.settings),_.each(d,function(a,b){var c;_.isObject(a)&&_.isFunction(a.extended)&&a.extended(f.Value)?g.settings[b]=a:_.isString(a)&&(c=f(a),c?g.settings[b]=c:h.push(a))}),e=function(){_.each(d,function(a,b){!g.settings[b]&&_.isString(a)&&(g.settings[b]=f(a))}),g.settings[0]&&!g.settings["default"]&&(g.settings["default"]=g.settings[0]),g.setting=g.settings["default"]||null,g.linkElements(),g.embed()},0===h.length?e():f.apply(f,h.concat(e)),g.deferred.embedded.done(function(){g.linkElements(),g.setupNotifications(),g.ready()})},linkElements:function(){var a,c,d,e=this;a=e.container.find("[data-customize-setting-link], [data-customize-setting-key-link]"),c={},a.each(function(){var g,h,i=b(this);if(!i.data("customizeSettingLinked")){if(i.data("customizeSettingLinked",!0),i.is(":radio")){if(g=i.prop("name"),c[g])return;c[g]=!0,i=a.filter('[name="'+g+'"]')}i.data("customizeSettingLink")?h=f(i.data("customizeSettingLink")):i.data("customizeSettingKeyLink")&&(h=e.settings[i.data("customizeSettingKeyLink")]),h&&(d=new f.Element(i),e.elements.push(d),d.sync(h),d.set(h()))}})},embed:function(){var a,b=this;a=function(a){var c;a&&f.section(a,function(a){a.deferred.embedded.done(function(){c=a.contentContainer.is("ul")?a.contentContainer:a.contentContainer.find("ul:first"),b.container.parent().is(c)||(c.append(b.container),b.renderContent()),b.deferred.embedded.resolve()})})},b.section.bind(a),a(b.section.get())},ready:function(){var a,c=this;"dropdown-pages"===c.params.type&&c.params.allow_addition&&(a=c.container.find(".new-content-item"),a.hide(),c.container.on("click",".add-new-toggle",function(c){b(c.currentTarget).slideUp(180),a.slideDown(180),a.find(".create-item-input").focus()}),c.container.on("click",".add-content",function(){c.addNewPage()}),c.container.on("keydown",".create-item-input",function(a){13===a.which&&c.addNewPage()}))},getNotificationsContainerElement:function(){var a,c,d=this;return c=d.container.find(".customize-control-notifications-container:first"),c.length?c:(c=b('<div class="customize-control-notifications-container"></div>'),d.container.hasClass("customize-control-nav_menu_item")?d.container.find(".menu-item-settings:first").prepend(c):d.container.hasClass("customize-control-widget_form")?d.container.find(".widget-inside:first").prepend(c):(a=d.container.find(".customize-control-title"),a.length?a.after(c):d.container.prepend(c)),c)},setupNotifications:function(){var a,b,c=this;_.each(c.settings,function(a){a.notifications&&(a.notifications.bind("add",function(b){var d=_.extend({},b,{setting:a.id});c.notifications.add(new f.Notification(a.id+":"+b.code,d))}),a.notifications.bind("remove",function(b){c.notifications.remove(a.id+":"+b.code)}))}),a=function(){var a=c.section();(!a||f.section.has(a)&&f.section(a).expanded())&&c.notifications.render()},c.notifications.bind("rendered",function(){var a=c.notifications.get();c.container.toggleClass("has-notifications",0!==a.length),c.container.toggleClass("has-error",0!==_.where(a,{type:"error"}).length)}),b=function(b,c){c&&f.section.has(c)&&f.section(c).expanded.unbind(a),b&&f.section(b,function(b){b.expanded.bind(a),a()})},c.section.bind(b),b(c.section.get()),c.notifications.bind("change",_.debounce(a))},renderNotifications:function(){var a,c,d=this,e=!1;"undefined"!=typeof console&&console.warn&&console.warn("[DEPRECATED] wp.customize.Control.prototype.renderNotifications() is deprecated in favor of instantating a wp.customize.Notifications and calling its render() method."),a=d.getNotificationsContainerElement(),a&&a.length&&(c=[],d.notifications.each(function(a){c.push(a),"error"===a.type&&(e=!0)}),0===c.length?a.stop().slideUp("fast"):a.stop().slideDown("fast",null,function(){b(this).css("height","auto")}),d.notificationsTemplate||(d.notificationsTemplate=wp.template("customize-control-notifications")),d.container.toggleClass("has-notifications",0!==c.length),d.container.toggleClass("has-error",e),a.empty().append(b.trim(d.notificationsTemplate({notifications:c,altNotice:Boolean(d.altNotice)}))))},expand:function(a){f.section(this.section()).expand(a)},focus:d,onChangeActive:function(a,c){return c.unchanged?void(c.completeCallback&&c.completeCallback()):void(b.contains(document,this.container[0])?a?this.container.slideDown(c.duration,c.completeCallback):this.container.slideUp(c.duration,c.completeCallback):(this.container.toggle(a),c.completeCallback&&c.completeCallback()))},toggle:function(a){return this.onChangeActive(a,this.defaultActiveArguments)},activate:c.prototype.activate,deactivate:c.prototype.deactivate,_toggleActive:c.prototype._toggleActive,dropdownInit:function(){var a=this,b=this.container.find(".dropdown-status"),c=this.params,d=!1,e=function(a){"string"==typeof a&&c.statuses&&c.statuses[a]?b.html(c.statuses[a]).show():b.hide()};this.container.on("click keydown",".dropdown",function(b){f.utils.isKeydownButNotEnterEvent(b)||(b.preventDefault(),d||a.container.toggleClass("open"),a.container.hasClass("open")&&a.container.parent().parent().find("li.library-selected").focus(),d=!0,setTimeout(function(){d=!1},400))}),this.setting.bind(e),e(this.setting())},renderContent:function(){var a,b,c,d,e=this;b=["button","checkbox","date","datetime-local","email","month","number","password","radio","range","search","select","tel","time","text","textarea","week","url"],c=e.templateSelector,c==="customize-control-"+e.params.type+"-content"&&_.contains(b,e.params.type)&&!document.getElementById("tmpl-"+c)&&0===e.container.children().length&&(c="customize-control-default-content"),document.getElementById("tmpl-"+c)&&(a=wp.template(c),a&&e.container&&e.container.html(a(e.params))),e.notifications.container=e.getNotificationsContainerElement(),d=e.section(),(!d||f.section.has(d)&&f.section(d).expanded())&&e.notifications.render()},addNewPage:function(){var a,c,d,e,g,h,i=this;if("dropdown-pages"===i.params.type&&i.params.allow_addition&&f.Menus){if(c=i.container.find(".add-new-toggle"),d=i.container.find(".new-content-item"),e=i.container.find(".create-item-input"),g=e.val(),h=i.container.find("select"),!g)return void e.addClass("invalid");e.removeClass("invalid"),e.attr("disabled","disabled"),a=f.Menus.insertAutoDraftPost({post_title:g,post_type:"page"}),a.done(function(a){var e,j,k;e=new f.Menus.AvailableItemModel({id:"post-"+a.post_id,title:g,type:"post_type",type_label:f.Menus.data.l10n.page_label,object:"page",object_id:a.post_id,url:a.url}),f.Menus.availableMenuItemsPanel.collection.add(e),j=b("#available-menu-items-post_type-page").find(".available-menu-items-list"),k=wp.template("available-menu-item"),j.prepend(k(e.attributes)),h.focus(),i.setting.set(String(a.post_id)),d.slideUp(180),c.slideDown(180)}),a.always(function(){e.val("").removeAttr("disabled")})}}}),f.ColorControl=f.Control.extend({ready:function(){var a,b=this,c="hue"===this.params.mode,d=!1;c?(a=this.container.find(".color-picker-hue"),a.val(b.setting()).wpColorPicker({change:function(a,c){d=!0,b.setting(c.color.h()),d=!1}})):(a=this.container.find(".color-picker-hex"),a.val(b.setting()).wpColorPicker({change:function(){d=!0,b.setting.set(a.wpColorPicker("color")),d=!1},clear:function(){d=!0,b.setting.set(""),d=!1}})),b.setting.bind(function(b){d||(a.val(b),a.wpColorPicker("color",b))}),b.container.on("keydown",function(c){var d;27===c.which&&(d=b.container.find(".wp-picker-container"),d.hasClass("wp-picker-active")&&(a.wpColorPicker("close"),b.container.find(".wp-color-result").focus(),c.stopPropagation()))})}}),f.MediaControl=f.Control.extend({ready:function(){function a(a){var d=b.Deferred();c.extended(f.UploadControl)?d.resolve():(a=parseInt(a,10),_.isNaN(a)||a<=0?(delete c.params.attachment,d.resolve()):c.params.attachment&&c.params.attachment.id===a&&d.resolve()),"pending"===d.state()&&wp.media.attachment(a).fetch().done(function(){c.params.attachment=this.attributes,d.resolve(),wp.customize.previewer.send(c.setting.id+"-attachment-data",this.attributes)}),d.done(function(){c.renderContent()})}var c=this;_.bindAll(c,"restoreDefault","removeFile","openFrame","select","pausePlayer"),c.container.on("click keydown",".upload-button",c.openFrame),c.container.on("click keydown",".upload-button",c.pausePlayer),c.container.on("click keydown",".thumbnail-image img",c.openFrame),c.container.on("click keydown",".default-button",c.restoreDefault),c.container.on("click keydown",".remove-button",c.pausePlayer),c.container.on("click keydown",".remove-button",c.removeFile),c.container.on("click keydown",".remove-button",c.cleanupPlayer),f.section(c.section()).container.on("expanded",function(){c.player&&c.player.setControlsSize()}).on("collapsed",function(){c.pausePlayer()}),a(c.setting()),c.setting.bind(a)},pausePlayer:function(){this.player&&this.player.pause()},cleanupPlayer:function(){this.player&&wp.media.mixin.removePlayer(this.player)},openFrame:function(a){f.utils.isKeydownButNotEnterEvent(a)||(a.preventDefault(),this.frame||this.initFrame(),this.frame.open())},initFrame:function(){this.frame=wp.media({button:{text:this.params.button_labels.frame_button},states:[new wp.media.controller.Library({title:this.params.button_labels.frame_title,library:wp.media.query({type:this.params.mime_type}),multiple:!1,date:!1})]}),this.frame.on("select",this.select)},select:function(){var a,b=this.frame.state().get("selection").first().toJSON(),c=window._wpmejsSettings||{};this.params.attachment=b,this.setting(b.id),a=this.container.find("audio, video").get(0),a?this.player=new MediaElementPlayer(a,c):this.cleanupPlayer()},restoreDefault:function(a){f.utils.isKeydownButNotEnterEvent(a)||(a.preventDefault(),this.params.attachment=this.params.defaultAttachment,this.setting(this.params.defaultAttachment.url))},removeFile:function(a){f.utils.isKeydownButNotEnterEvent(a)||(a.preventDefault(),this.params.attachment={},this.setting(""),this.renderContent())}}),f.UploadControl=f.MediaControl.extend({select:function(){var a,b=this.frame.state().get("selection").first().toJSON(),c=window._wpmejsSettings||{};this.params.attachment=b,this.setting(b.url),a=this.container.find("audio, video").get(0),a?this.player=new MediaElementPlayer(a,c):this.cleanupPlayer()},success:function(){},removerVisibility:function(){}}),f.ImageControl=f.UploadControl.extend({thumbnailSrc:function(){}}),f.BackgroundControl=f.UploadControl.extend({ready:function(){f.UploadControl.prototype.ready.apply(this,arguments)},select:function(){f.UploadControl.prototype.select.apply(this,arguments),wp.ajax.post("custom-background-add",{nonce:_wpCustomizeBackground.nonces.add,wp_customize:"on",customize_theme:f.settings.theme.stylesheet,attachment_id:this.params.attachment.id})}}),f.BackgroundPositionControl=f.Control.extend({ready:function(){var a,c=this;c.container.on("change",'input[name="background-position"]',function(){var a=b(this).val().split(" ");c.settings.x(a[0]),c.settings.y(a[1])}),a=_.debounce(function(){var a,b,d,e;a=c.settings.x.get(),b=c.settings.y.get(),e=String(a)+" "+String(b),d=c.container.find('input[name="background-position"][value="'+e+'"]'),d.click()}),c.settings.x.bind(a),c.settings.y.bind(a),a()}}),f.CroppedImageControl=f.MediaControl.extend({openFrame:function(a){f.utils.isKeydownButNotEnterEvent(a)||(this.initFrame(),this.frame.setState("library").open())},initFrame:function(){var a=_wpMediaViewsL10n;this.frame=wp.media({button:{text:a.select,close:!1},states:[new wp.media.controller.Library({title:this.params.button_labels.frame_title,library:wp.media.query({type:"image"}),multiple:!1,date:!1,priority:20,suggestedWidth:this.params.width,suggestedHeight:this.params.height}),new wp.media.controller.CustomizeImageCropper({imgSelectOptions:this.calculateImageSelectOptions,control:this})]}),this.frame.on("select",this.onSelect,this),this.frame.on("cropped",this.onCropped,this),this.frame.on("skippedcrop",this.onSkippedCrop,this)},onSelect:function(){var a=this.frame.state().get("selection").first().toJSON();this.params.width!==a.width||this.params.height!==a.height||this.params.flex_width||this.params.flex_height?this.frame.setState("cropper"):(this.setImageFromAttachment(a),this.frame.close())},onCropped:function(a){this.setImageFromAttachment(a)},calculateImageSelectOptions:function(a,b){var c,d,e,f=b.get("control"),g=!!parseInt(f.params.flex_width,10),h=!!parseInt(f.params.flex_height,10),i=a.get("width"),j=a.get("height"),k=parseInt(f.params.width,10),l=parseInt(f.params.height,10),m=k/l,n=k,o=l;return b.set("canSkipCrop",!f.mustBeCropped(g,h,k,l,i,j)),i/j>m?(l=j,k=l*m):(k=i,l=k/m),c=(i-k)/2,d=(j-l)/2,e={handles:!0,keys:!0,instance:!0,persistent:!0,imageWidth:i,imageHeight:j,minWidth:n>k?k:n,minHeight:o>l?l:o,x1:c,y1:d,x2:k+c,y2:l+d},h===!1&&g===!1&&(e.aspectRatio=k+":"+l),!0===h&&(delete e.minHeight,e.maxWidth=i),!0===g&&(delete e.minWidth,e.maxHeight=j),e},mustBeCropped:function(a,b,c,d,e,f){return(!0!==a||!0!==b)&&((!0!==a||d!==f)&&((!0!==b||c!==e)&&((c!==e||d!==f)&&!(e<=c))))},onSkippedCrop:function(){var a=this.frame.state().get("selection").first().toJSON();this.setImageFromAttachment(a)},setImageFromAttachment:function(a){this.params.attachment=a,this.setting(a.id)}}),f.SiteIconControl=f.CroppedImageControl.extend({initFrame:function(){var a=_wpMediaViewsL10n;this.frame=wp.media({button:{text:a.select,close:!1},states:[new wp.media.controller.Library({title:this.params.button_labels.frame_title,library:wp.media.query({type:"image"}),multiple:!1,date:!1,priority:20,suggestedWidth:this.params.width,suggestedHeight:this.params.height}),new wp.media.controller.SiteIconCropper({imgSelectOptions:this.calculateImageSelectOptions,control:this})]}),this.frame.on("select",this.onSelect,this),this.frame.on("cropped",this.onCropped,this),this.frame.on("skippedcrop",this.onSkippedCrop,this)},onSelect:function(){var a=this.frame.state().get("selection").first().toJSON(),b=this;this.params.width!==a.width||this.params.height!==a.height||this.params.flex_width||this.params.flex_height?this.frame.setState("cropper"):wp.ajax.post("crop-image",{nonce:a.nonces.edit,id:a.id,context:"site-icon",cropDetails:{x1:0,y1:0,width:this.params.width,height:this.params.height,dst_width:this.params.width,dst_height:this.params.height}}).done(function(a){b.setImageFromAttachment(a),b.frame.close()}).fail(function(){b.frame.trigger("content:error:crop")})},setImageFromAttachment:function(a){var c,d,e=["site_icon-32","thumbnail","full"];_.each(e,function(b){d||_.isUndefined(a.sizes[b])||(d=a.sizes[b])}),this.params.attachment=a,this.setting(a.id),d&&(c=b('link[rel="icon"][sizes="32x32"]'),c.attr("href",d.url))},removeFile:function(a){f.utils.isKeydownButNotEnterEvent(a)||(a.preventDefault(),this.params.attachment={},this.setting(""),this.renderContent(),b('link[rel="icon"][sizes="32x32"]').attr("href","/favicon.ico"))}}),f.HeaderControl=f.Control.extend({ready:function(){this.btnRemove=b("#customize-control-header_image .actions .remove"),this.btnNew=b("#customize-control-header_image .actions .new"),_.bindAll(this,"openMedia","removeImage"),this.btnNew.on("click",this.openMedia),this.btnRemove.on("click",this.removeImage),f.HeaderTool.currentHeader=this.getInitialHeaderImage(),new f.HeaderTool.CurrentView({model:f.HeaderTool.currentHeader,el:"#customize-control-header_image .current .container"}),new f.HeaderTool.ChoiceListView({collection:f.HeaderTool.UploadsList=new f.HeaderTool.ChoiceList,el:"#customize-control-header_image .choices .uploaded .list"}),new f.HeaderTool.ChoiceListView({collection:f.HeaderTool.DefaultsList=new f.HeaderTool.DefaultsList,el:"#customize-control-header_image .choices .default .list"}),f.HeaderTool.combinedList=f.HeaderTool.CombinedList=new f.HeaderTool.CombinedList([f.HeaderTool.UploadsList,f.HeaderTool.DefaultsList]),wp.media.controller.Cropper.prototype.defaults.doCropArgs.wp_customize="on",wp.media.controller.Cropper.prototype.defaults.doCropArgs.customize_theme=f.settings.theme.stylesheet},getInitialHeaderImage:function(){if(!f.get().header_image||!f.get().header_image_data||_.contains(["remove-header","random-default-image","random-uploaded-image"],f.get().header_image))return new f.HeaderTool.ImageModel;var a=_.find(_wpCustomizeHeader.uploads,function(a){return a.attachment_id===f.get().header_image_data.attachment_id});return a||(a={url:f.get().header_image,thumbnail_url:f.get().header_image,attachment_id:f.get().header_image_data.attachment_id}),new f.HeaderTool.ImageModel({header:a,choice:a.url.split("/").pop()})},calculateImageSelectOptions:function(a,b){var c,d,e,g,h,i,j=parseInt(_wpCustomizeHeader.data.width,10),k=parseInt(_wpCustomizeHeader.data.height,10),l=!!parseInt(_wpCustomizeHeader.data["flex-width"],10),m=!!parseInt(_wpCustomizeHeader.data["flex-height"],10);return h=a.get("width"),g=a.get("height"),this.headerImage=new f.HeaderTool.ImageModel,this.headerImage.set({themeWidth:j,themeHeight:k,themeFlexWidth:l,themeFlexHeight:m,imageWidth:h,imageHeight:g}),b.set("canSkipCrop",!this.headerImage.shouldBeCropped()),c=j/k,d=h,e=g,d/e>c?(k=e,j=k*c):(j=d,k=j/c),i={handles:!0,keys:!0,instance:!0,persistent:!0,imageWidth:h,imageHeight:g,x1:0,y1:0,x2:j,y2:k},m===!1&&l===!1&&(i.aspectRatio=j+":"+k),m===!1&&(i.maxHeight=k),l===!1&&(i.maxWidth=j),i},openMedia:function(a){var b=_wpMediaViewsL10n;a.preventDefault(),this.frame=wp.media({button:{text:b.selectAndCrop,close:!1},states:[new wp.media.controller.Library({title:b.chooseImage,library:wp.media.query({type:"image"}),multiple:!1,date:!1,priority:20,suggestedWidth:_wpCustomizeHeader.data.width,suggestedHeight:_wpCustomizeHeader.data.height}),new wp.media.controller.Cropper({imgSelectOptions:this.calculateImageSelectOptions})]}),this.frame.on("select",this.onSelect,this),this.frame.on("cropped",this.onCropped,this),this.frame.on("skippedcrop",this.onSkippedCrop,this),this.frame.open()},onSelect:function(){this.frame.setState("cropper")},onCropped:function(a){var b=a.url,c=a.attachment_id,d=a.width,e=a.height;this.setImageFromURL(b,c,d,e)},onSkippedCrop:function(a){var b=a.get("url"),c=a.get("width"),d=a.get("height");this.setImageFromURL(b,a.id,c,d)},setImageFromURL:function(a,b,c,d){var e,g={};g.url=a,g.thumbnail_url=a,g.timestamp=_.now(),b&&(g.attachment_id=b),c&&(g.width=c),d&&(g.height=d),e=new f.HeaderTool.ImageModel({header:g,choice:a.split("/").pop()}),f.HeaderTool.UploadsList.add(e),f.HeaderTool.currentHeader.set(e.toJSON()),e.save(),e.importImage()},removeImage:function(){f.HeaderTool.currentHeader.trigger("hide"),f.HeaderTool.CombinedList.trigger("control:removeImage")}}),f.ThemeControl=f.Control.extend({touchDrag:!1,screenshotRendered:!1,ready:function(){function a(){return!g.canSwitchTheme(e.params.theme.id)}function c(){return a()||!1===f.settings.theme._canInstall||!0===f.settings.theme._filesystemCredentialsNeeded}function d(){e.container.find("button.preview, button.preview-theme").toggleClass("disabled",a()),e.container.find("button.theme-install").toggleClass("disabled",c())}var e=this,g=f.panel("themes");f.state("selectedChangesetStatus").bind(d),f.state("changesetStatus").bind(d),d(),e.container.on("touchmove",".theme",function(){e.touchDrag=!0}),e.container.on("click keydown touchend",".theme",function(a){var c;if(!f.utils.isKeydownButNotEnterEvent(a))return e.touchDrag===!0?e.touchDrag=!1:void(b(a.target).is(".theme-actions .button, .update-theme")||(a.preventDefault(),c=f.section(e.section()),c.showDetails(e.params.theme,function(){f.settings.theme._filesystemCredentialsNeeded&&c.overlay.find(".theme-actions .delete-theme").remove()})))}),e.container.on("render-screenshot",function(){var a=b(this).find("img"),c=a.data("src");c&&a.attr("src",c),e.screenshotRendered=!0})},filter:function(a){var b=this,c=0,d=b.params.theme.name+" "+b.params.theme.description+" "+b.params.theme.tags+" "+b.params.theme.author+" ";return d=d.toLowerCase().replace("-"," "),_.isArray(a)||(a=[a]),b.params.theme.name.toLowerCase()===a.join(" ")?c=100:(c+=10*(d.split(a.join(" ")).length-1),_.each(a,function(a){c+=2*(d.split(a+" ").length-1),c=c+d.split(a).length-1}),c>99&&(c=99)),0!==c?(b.activate(),b.params.priority=101-c,!0):(b.deactivate(),b.params.priority=101,!1)},rerenderAsInstalled:function(a){var b,c=this;a?c.params.theme.type="installed":(b=f.section(c.params.section),c.params.theme.type=b.params.action),c.renderContent(),c.container.trigger("render-screenshot")}}),f.CodeEditorControl=f.Control.extend({initialize:function(a,c){var d=this;d.deferred=_.extend(d.deferred||{},{codemirror:b.Deferred()}),f.Control.prototype.initialize.call(d,a,c),d.notifications.bind("add",function(a){a.code===d.setting.id+":csslint_error"&&(a.templateId="customize-code-editor-lint-error-notification",a.render=function(a){return function(){var b=a.call(this);return b.find("input[type=checkbox]").on("click",function(){d.setting.notifications.remove("csslint_error")}),b}}(a.render))})},ready:function(){var a=this;return a.section()?void f.section(a.section(),function(b){b.deferred.embedded.done(function(){var c;b.expanded()?a.initEditor():(c=function(d){d&&(a.initEditor(),b.expanded.unbind(c))},b.expanded.bind(c))})}):void a.initEditor()},initEditor:function(){var a,b=this,c=!1;wp.codeEditor&&(_.isUndefined(b.params.editor_settings)||!1!==b.params.editor_settings)&&(c=wp.codeEditor.defaultSettings?_.clone(wp.codeEditor.defaultSettings):{},c.codemirror=_.extend({},c.codemirror,{indentUnit:2,tabSize:2}),_.isObject(b.params.editor_settings)&&_.each(b.params.editor_settings,function(a,b){_.isObject(a)&&(c[b]=_.extend({},c[b],a))})),a=new f.Element(b.container.find("textarea")),b.elements.push(a),a.sync(b.setting),a.set(b.setting()),c?b.initSyntaxHighlightingEditor(c):b.initPlainTextareaEditor()},focus:function(a){var b,c=this,d=_.extend({},a);b=d.completeCallback,d.completeCallback=function(){b&&b(),c.editor&&c.editor.codemirror.focus()},f.Control.prototype.focus.call(c,d)},initSyntaxHighlightingEditor:function(a){var c,d=this,e=d.container.find("textarea"),f=!1;c=_.extend({},a,{onTabNext:_.bind(d.onTabNext,d),onTabPrevious:_.bind(d.onTabPrevious,d),onUpdateErrorNotice:_.bind(d.onUpdateErrorNotice,d)}),d.editor=wp.codeEditor.initialize(e,c),b(d.editor.codemirror.display.lineDiv).attr({role:"textbox","aria-multiline":"true","aria-label":d.params.label,"aria-describedby":"editor-keyboard-trap-help-1 editor-keyboard-trap-help-2 editor-keyboard-trap-help-3 editor-keyboard-trap-help-4"}),d.container.find("label").on("click",function(){d.editor.codemirror.focus()}),d.editor.codemirror.on("change",function(a){f=!0,e.val(a.getValue()).trigger("change"),f=!1}),d.setting.bind(function(a){f||d.editor.codemirror.setValue(a)}),d.editor.codemirror.on("keydown",function(a,b){var c=27;c===b.keyCode&&b.stopPropagation()}),d.deferred.codemirror.resolveWith(d,[d.editor.codemirror])},onTabNext:function(){var a,c,d,e=this;d=f.section(e.section()),a=d.controls(),c=a.indexOf(e),a.length===c+1?b("#customize-footer-actions .collapse-sidebar").focus():a[c+1].container.find(":focusable:first").focus()},onTabPrevious:function(){var a,b,c,d=this;c=f.section(d.section()),a=c.controls(),b=a.indexOf(d),0===b?c.contentContainer.find(".customize-section-title .customize-help-toggle, .customize-section-title .customize-section-description.open .section-description-close").last().focus():a[b-1].contentContainer.find(":focusable:first").focus()},onUpdateErrorNotice:function(a){var b,c=this;c.setting.notifications.remove("csslint_error"),0!==a.length&&(b=1===a.length?f.l10n.customCssError.singular.replace("%d","1"):f.l10n.customCssError.plural.replace("%d",String(a.length)),c.setting.notifications.add(new f.Notification("csslint_error",{message:b,type:"error"})))},initPlainTextareaEditor:function(){var a=this,b=a.container.find("textarea"),c=b[0];b.on("blur",function(){b.data("next-tab-blurs",!1)}),b.on("keydown",function(a){var d,e,f,g=9,h=27;return h===a.keyCode?void(b.data("next-tab-blurs")||(b.data("next-tab-blurs",!0),a.stopPropagation())):void(g!==a.keyCode||a.ctrlKey||a.altKey||a.shiftKey||b.data("next-tab-blurs")||(d=c.selectionStart,
+e=c.selectionEnd,f=c.value,d>=0&&(c.value=f.substring(0,d).concat("\t",f.substring(e)),b.selectionStart=c.selectionEnd=d+1),a.stopPropagation(),a.preventDefault()))}),a.deferred.codemirror.rejectWith(a)}}),f.DateTimeControl=f.Control.extend({ready:function(){var a=this;if(a.inputElements={},a.invalidDate=!1,_.bindAll(a,"populateSetting","updateDaysForMonth","populateDateInputs"),!a.setting)throw new Error("Missing setting");a.container.find(".date-input").each(function(){var c,d,e=b(this);c=e.data("component"),d=new f.Element(e),a.inputElements[c]=d,a.elements.push(d),e.on("change",function(){a.invalidDate&&a.notifications.add(new f.Notification("invalid_date",{message:f.l10n.invalidDate}))}),e.on("input",_.debounce(function(){a.invalidDate||a.notifications.remove("invalid_date")})),e.on("blur",_.debounce(function(){a.invalidDate||a.populateDateInputs()}))}),a.inputElements.month.bind(a.updateDaysForMonth),a.inputElements.year.bind(a.updateDaysForMonth),a.populateDateInputs(),a.setting.bind(a.populateDateInputs),_.each(a.inputElements,function(b){b.bind(a.populateSetting)})},parseDateTime:function(a){var b,c,d=this,e=12;return a&&(b=a.match(/^(\d\d\d\d)-(\d\d)-(\d\d)(?: (\d\d):(\d\d)(?::(\d\d))?)?$/)),b?(b.shift(),c={year:b.shift(),month:b.shift(),day:b.shift(),hour:b.shift()||"00",minute:b.shift()||"00",second:b.shift()||"00"},d.params.includeTime&&d.params.twelveHourFormat&&(c.hour=parseInt(c.hour,10),c.meridian=c.hour>=e?"pm":"am",c.hour=c.hour%e?String(c.hour%e):String(e),delete c.second),c):null},validateInputs:function(){var a,b,c=this;return c.invalidDate=!1,a=["year","day"],c.params.includeTime&&a.push("hour","minute"),_.find(a,function(a){var d,e,f,g;return d=c.inputElements[a],b=d.element.get(0),e=parseInt(d.element.attr("max"),10),f=parseInt(d.element.attr("min"),10),g=parseInt(d(),10),c.invalidDate=isNaN(g)||g>e||g<f,c.invalidDate||b.setCustomValidity(""),c.invalidDate}),c.inputElements.meridian&&!c.invalidDate&&(b=c.inputElements.meridian.element.get(0),"am"!==c.inputElements.meridian.get()&&"pm"!==c.inputElements.meridian.get()?c.invalidDate=!0:b.setCustomValidity("")),c.invalidDate?b.setCustomValidity(f.l10n.invalidValue):b.setCustomValidity(""),(!c.section()||f.section.has(c.section())&&f.section(c.section()).expanded())&&_.result(b,"reportValidity"),c.invalidDate},updateDaysForMonth:function(){var a,b,c,d,e=this;c=parseInt(e.inputElements.month(),10),b=parseInt(e.inputElements.year(),10),d=parseInt(e.inputElements.day(),10),c&&b&&(a=new Date(b,c,0).getDate(),e.inputElements.day.element.attr("max",a),d>a&&e.inputElements.day(String(a)))},populateSetting:function(){var a,b=this;return!(b.validateInputs()||!b.params.allowPastDate&&!b.isFutureDate())&&(a=b.convertInputDateToString(),b.setting.set(a),!0)},convertInputDateToString:function(){var a,b,c,d,e=this,f="";return d=function(a,b){var c;return String(a).length<b&&(c=b-String(a).length,a=Math.pow(10,c).toString().substr(1)+String(a)),a},c=function(a){var b=parseInt(e.inputElements[a].get(),10);return _.contains(["month","day","hour","minute"],a)?b=d(b,2):"year"===a&&(b=d(b,4)),b},a=["year","-","month","-","day"],e.params.includeTime&&(b=e.inputElements.meridian?e.convertHourToTwentyFourHourFormat(e.inputElements.hour(),e.inputElements.meridian()):e.inputElements.hour(),a=a.concat([" ",d(b,2),":","minute",":","00"])),_.each(a,function(a){f+=e.inputElements[a]?c(a):a}),f},isFutureDate:function(){var a=this;return 0<f.utils.getRemainingTime(a.convertInputDateToString())},convertHourToTwentyFourHourFormat:function(a,b){var c,d,e=12;return d=parseInt(a,10),isNaN(d)?"":(c="pm"===b&&d<e?d+e:"am"===b&&e===d?d-e:d,String(c))},populateDateInputs:function(){var a,b=this;return!!(a=b.parseDateTime(b.setting.get()))&&(_.each(b.inputElements,function(b,c){var d=a[c];"month"===c||"meridian"===c?(d=d.replace(/^0/,""),b.set(d)):(d=parseInt(d,10),b.element.is(document.activeElement)?d!==parseInt(b(),10)&&b.set(String(d)):b.set(a[c]))}),!0)},toggleFutureDateNotification:function(a){var b,c,d=this;return b="not_future_date",a?(c=new f.Notification(b,{type:"error",message:f.l10n.futureDateError}),d.notifications.add(c)):d.notifications.remove(b),d}}),f.PreviewLinkControl=f.Control.extend({defaults:_.extend({},f.Control.prototype.defaults,{templateId:"customize-preview-link-control"}),ready:function(){var a,c,d,e,g,h,i=this;_.bindAll(i,"updatePreviewLink"),i.setting||(i.setting=new f.Value),i.previewElements={},i.container.find(".preview-control-element").each(function(){d=b(this),c=d.data("component"),a=new f.Element(d),i.previewElements[c]=a,i.elements.push(a)}),e=i.previewElements.url,g=i.previewElements.input,h=i.previewElements.button,g.link(i.setting),e.link(i.setting),e.bind(function(a){e.element.parent().attr({href:a,target:f.settings.changeset.uuid})}),f.bind("ready",i.updatePreviewLink),f.state("saved").bind(i.updatePreviewLink),f.state("changesetStatus").bind(i.updatePreviewLink),f.state("activated").bind(i.updatePreviewLink),f.previewer.previewUrl.bind(i.updatePreviewLink),h.element.on("click",function(a){a.preventDefault(),i.setting()&&(g.element.select(),document.execCommand("copy"),h(h.element.data("copied-text")))}),e.element.parent().on("click",function(a){b(this).hasClass("disabled")&&a.preventDefault()}),h.element.on("mouseenter",function(){i.setting()&&h(h.element.data("copy-text"))})},updatePreviewLink:function(){var a,b=this;a=!f.state("saved").get()||""===f.state("changesetStatus").get()||"auto-draft"===f.state("changesetStatus").get(),b.toggleSaveNotification(a),b.previewElements.url.element.parent().toggleClass("disabled",a),b.previewElements.button.element.prop("disabled",a),b.setting.set(f.previewer.getFrontendPreviewUrl())},toggleSaveNotification:function(a){var b,c,d=this;b="changes_not_saved",a?(c=new f.Notification(b,{type:"info",message:f.l10n.saveBeforeShare}),d.notifications.add(c)):d.notifications.remove(b)}}),f.defaultConstructor=f.Setting,f.control=new f.Values({defaultConstructor:f.Control}),f.section=new f.Values({defaultConstructor:f.Section}),f.panel=new f.Values({defaultConstructor:f.Panel}),f.notifications=new f.Notifications,f.PreviewFrame=f.Messenger.extend({sensitivity:null,initialize:function(a,c){var d=b.Deferred();d.promise(this),this.container=a.container,b.extend(a,{channel:f.PreviewFrame.uuid()}),f.Messenger.prototype.initialize.call(this,a,c),this.add("previewUrl",a.previewUrl),this.query=b.extend(a.query||{},{customize_messenger_channel:this.channel()}),this.run(d)},run:function(a){var c,d,e,g=this,h=!1,i=!1,j=null,k="{}"!==g.query.customized;g._ready&&g.unbind("ready",g._ready),g._ready=function(b){i=!0,j=b,g.container.addClass("iframe-ready"),b&&h&&a.resolveWith(g,[b])},g.bind("ready",g._ready),c=document.createElement("a"),c.href=g.previewUrl(),d=_.extend(f.utils.parseQueryString(c.search.substr(1)),{customize_changeset_uuid:g.query.customize_changeset_uuid,customize_theme:g.query.customize_theme,customize_messenger_channel:g.query.customize_messenger_channel}),!f.settings.changeset.autosaved&&f.state("saved").get()||(d.customize_autosaved="on"),c.search=b.param(d),g.iframe=b("<iframe />",{title:f.l10n.previewIframeTitle,name:"customize-"+g.channel()}),g.iframe.attr("onmousewheel",""),g.iframe.attr("sandbox","allow-forms allow-modals allow-orientation-lock allow-pointer-lock allow-popups allow-popups-to-escape-sandbox allow-presentation allow-same-origin allow-scripts"),k?g.iframe.attr("data-src",c.href):g.iframe.attr("src",c.href),g.iframe.appendTo(g.container),g.targetWindow(g.iframe[0].contentWindow),k&&(e=b("<form>",{action:c.href,target:g.iframe.attr("name"),method:"post",hidden:"hidden"}),e.append(b("<input>",{type:"hidden",name:"_method",value:"GET"})),_.each(g.query,function(a,c){e.append(b("<input>",{type:"hidden",name:c,value:a}))}),g.container.append(e),e.submit(),e.remove()),g.bind("iframe-loading-error",function(b){return g.iframe.remove(),0===b?void g.login(a):-1===b?void a.rejectWith(g,["cheatin"]):void a.rejectWith(g,["request failure"])}),g.iframe.one("load",function(){h=!0,i?a.resolveWith(g,[j]):setTimeout(function(){a.rejectWith(g,["ready timeout"])},g.sensitivity)})},login:function(a){var c,d=this;return c=function(){a.rejectWith(d,["logged out"])},this.triedLogin?c():void b.get(f.settings.url.ajax,{action:"logged-in"}).fail(c).done(function(e){var g;"1"!==e&&c(),g=b("<iframe />",{src:d.previewUrl(),title:f.l10n.previewIframeTitle}).hide(),g.appendTo(d.container),g.on("load",function(){d.triedLogin=!0,g.remove(),d.run(a)})})},destroy:function(){f.Messenger.prototype.destroy.call(this),this.iframe&&this.iframe.remove(),delete this.iframe,delete this.targetWindow}}),function(){var a=0;f.PreviewFrame.uuid=function(){return"preview-"+String(a++)}}(),f.setDocumentTitle=function(a){var b,c;b=f.settings.documentTitleTmpl,c=b.replace("%s",a),document.title=c,f.trigger("title",c)},f.Previewer=f.Messenger.extend({refreshBuffer:null,initialize:function(a,c){var d=this,e=document.createElement("a");b.extend(d,c||{}),d.deferred={active:b.Deferred()},d.refresh=_.debounce(function(a){return function(){var b,c;b=function(){return 0===f.state("processing").get()},b()?a.call(d):(c=function(){b()&&(a.call(d),f.state("processing").unbind(c))},f.state("processing").bind(c))}}(d.refresh),d.refreshBuffer),d.container=f.ensure(a.container),d.allowedUrls=a.allowedUrls,a.url=window.location.href,f.Messenger.prototype.initialize.call(d,a),e.href=d.origin(),d.add("scheme",e.protocol.replace(/:$/,"")),d.add("previewUrl",a.previewUrl).setter(function(a){var c,e,g,h=null,i=[];return c=document.createElement("a"),c.href=a,/\/wp-(admin|includes|content)(\/|$)/.test(c.pathname)?null:(c.search.length>1&&(e=f.utils.parseQueryString(c.search.substr(1)),delete e.customize_changeset_uuid,delete e.customize_theme,delete e.customize_messenger_channel,delete e.customize_autosaved,_.isEmpty(e)?c.search="":c.search=b.param(e)),i.push(c),d.scheme.get()+":"!==c.protocol&&(c=document.createElement("a"),c.href=i[0].href,c.protocol=d.scheme.get()+":",i.unshift(c)),g=document.createElement("a"),_.find(i,function(a){return!_.isUndefined(_.find(d.allowedUrls,function(b){if(g.href=b,c.protocol===g.protocol&&c.host===g.host&&0===c.pathname.indexOf(g.pathname.replace(/\/$/,"")))return h=a.href,!0}))}),h)}),d.bind("ready",d.ready),d.deferred.active.done(_.bind(d.keepPreviewAlive,d)),d.bind("synced",function(){d.send("active")}),d.previewUrl.bind(d.refresh),d.scroll=0,d.bind("scroll",function(a){d.scroll=a}),d.bind("url",function(a){var b,c=!1;d.scroll=0,b=function(){c=!0},d.previewUrl.bind(b),d.previewUrl.set(a),d.previewUrl.unbind(b),c||d.refresh()}),d.bind("documentTitle",function(a){f.setDocumentTitle(a)})},ready:function(a){var b,c=this,d={};d.settings=f.get(),d["settings-modified-while-loading"]=c.settingsModifiedWhileLoading,("resolved"!==c.deferred.active.state()||c.loading)&&(d.scroll=c.scroll),d["edit-shortcut-visibility"]=f.state("editShortcutVisibility").get(),c.send("sync",d),a.currentUrl&&(c.previewUrl.unbind(c.refresh),c.previewUrl.set(a.currentUrl),c.previewUrl.bind(c.refresh)),b={panel:a.activePanels,section:a.activeSections,control:a.activeControls},_(b).each(function(a,b){f[b].each(function(c,d){var e=_.isUndefined(f.settings[b+"s"][d]);e&&_.isUndefined(a[d])||(a[d]?c.activate():c.deactivate())})}),a.settingValidities&&f._handleSettingValidities({settingValidities:a.settingValidities,focusInvalidControl:!1})},keepPreviewAlive:function(){var a,b,c,d,e=this;d=function(){b=setTimeout(c,f.settings.timeouts.keepAliveCheck)},a=function(){f.state("previewerAlive").set(!0),clearTimeout(b),d()},c=function(){f.state("previewerAlive").set(!1)},d(),e.bind("ready",a),e.bind("keep-alive",a)},query:function(){},abort:function(){this.loading&&(this.loading.destroy(),delete this.loading)},refresh:function(){var a,b=this;b.send("loading-initiated"),b.abort(),b.loading=new f.PreviewFrame({url:b.url(),previewUrl:b.previewUrl(),query:b.query({excludeCustomizedSaved:!0})||{},container:b.container}),b.settingsModifiedWhileLoading={},a=function(a){b.settingsModifiedWhileLoading[a.id]=!0},f.bind("change",a),b.loading.always(function(){f.unbind("change",a)}),b.loading.done(function(a){var c,d=this;b.preview=d,b.targetWindow(d.targetWindow()),b.channel(d.channel()),c=function(){d.unbind("synced",c),b._previousPreview&&b._previousPreview.destroy(),b._previousPreview=b.preview,b.deferred.active.resolve(),delete b.loading},d.bind("synced",c),b.trigger("ready",a)}),b.loading.fail(function(a){b.send("loading-failed"),"logged out"===a&&(b.preview&&(b.preview.destroy(),delete b.preview),b.login().done(b.refresh)),"cheatin"===a&&b.cheatin()})},login:function(){var a,c,d,e=this;return this._login?this._login:(a=b.Deferred(),this._login=a.promise(),c=new f.Messenger({channel:"login",url:f.settings.url.login}),d=b("<iframe />",{src:f.settings.url.login,title:f.l10n.loginIframeTitle}).appendTo(this.container),c.targetWindow(d[0].contentWindow),c.bind("login",function(){var b=e.refreshNonces();b.always(function(){d.remove(),c.destroy(),delete e._login}),b.done(function(){a.resolve()}),b.fail(function(){e.cheatin(),a.reject()})}),this._login)},cheatin:function(){b(document.body).empty().addClass("cheatin").append("<h1>"+f.l10n.notAllowedHeading+"</h1><p>"+f.l10n.notAllowed+"</p>")},refreshNonces:function(){var a,c=b.Deferred();return c.promise(),a=wp.ajax.post("customize_refresh_nonces",{wp_customize:"on",customize_theme:f.settings.theme.stylesheet}),a.done(function(a){f.trigger("nonce-refresh",a),c.resolve()}),a.fail(function(){c.reject()}),c}}),f.settingConstructor={},f.controlConstructor={color:f.ColorControl,media:f.MediaControl,upload:f.UploadControl,image:f.ImageControl,cropped_image:f.CroppedImageControl,site_icon:f.SiteIconControl,header:f.HeaderControl,background:f.BackgroundControl,background_position:f.BackgroundPositionControl,theme:f.ThemeControl,date_time:f.DateTimeControl,code_editor:f.CodeEditorControl},f.panelConstructor={themes:f.ThemesPanel},f.sectionConstructor={themes:f.ThemesSection,outer:f.OuterSection},f._handleSettingValidities=function(a){var b,c=[],d=!1;_.each(a.settingValidities,function(a,b){var d=f(b);d&&(_.isObject(a)&&_.each(a,function(a,b){var e,g,h=!1;e=new f.Notification(b,_.extend({fromServer:!0},a)),g=d.notifications(e.code),g&&(h=e.type!==g.type||e.message!==g.message||!_.isEqual(e.data,g.data)),h&&d.notifications.remove(b),d.notifications.has(e.code)||d.notifications.add(e),c.push(d.id)}),d.notifications.each(function(b){!b.fromServer||"error"!==b.type||!0!==a&&a[b.code]||d.notifications.remove(b.code)}))}),a.focusInvalidControl&&(b=f.findControlsForSettings(c),_(_.values(b)).find(function(a){return _(a).find(function(a){var b=a.section()&&f.section.has(a.section())&&f.section(a.section()).expanded();return b&&a.expanded&&(b=a.expanded()),b&&(a.focus(),d=!0),d})}),d||_.isEmpty(b)||_.values(b)[0][0].focus())},f.findControlsForSettings=function(a){var b,c={};return _.each(_.unique(a),function(a){var d=f(a);d&&(b=d.findControls(),b&&b.length>0&&(c[a]=b))}),c},f.reflowPaneContents=_.bind(function(){var a,c,d,e=[],g=!1;document.activeElement&&(c=b(document.activeElement)),f.panel.each(function(b){if("themes"!==b.id){var c=b.sections(),d=_.pluck(c,"headContainer");e.push(b),a=b.contentContainer.is("ul")?b.contentContainer:b.contentContainer.find("ul:first"),f.utils.areElementListsEqual(d,a.children("[id]"))||(_(c).each(function(b){a.append(b.headContainer)}),g=!0)}}),f.section.each(function(b){var c=b.controls(),d=_.pluck(c,"container");b.panel()||e.push(b),a=b.contentContainer.is("ul")?b.contentContainer:b.contentContainer.find("ul:first"),f.utils.areElementListsEqual(d,a.children("[id]"))||(_(c).each(function(b){a.append(b.container)}),g=!0)}),e.sort(f.utils.prioritySort),d=_.pluck(e,"headContainer"),a=b("#customize-theme-controls .customize-pane-parent"),f.utils.areElementListsEqual(d,a.children())||(_(e).each(function(b){a.append(b.headContainer)}),g=!0),f.panel.each(function(a){var b=a.active();a.active.callbacks.fireWith(a.active,[b,b])}),f.section.each(function(a){var b=a.active();a.active.callbacks.fireWith(a.active,[b,b])}),g&&c&&c.focus(),f.trigger("pane-contents-reflowed")},f),f.state=new f.Values,_.each(["saved","saving","trashing","activated","processing","paneVisible","expandedPanel","expandedSection","changesetDate","selectedChangesetDate","changesetStatus","selectedChangesetStatus","remainingTimeToPublish","previewerAlive","editShortcutVisibility","changesetLocked","previewedDevice"],function(a){f.state.create(a)}),b(function(){function a(){function c(a){a||f.settings.changeset.autosaved||(f.settings.changeset.autosaved=!0,f.previewer.send("autosaving"))}var d,e,g,h=!1;f.unbind("change",a),f.state("saved").bind(c),c(f.state("saved").get()),e=function(){h||(h=!0,f.requestChangesetUpdate({},{autosave:!0}).always(function(){h=!1})),g()},g=function(){clearTimeout(d),d=setTimeout(function(){e()},f.settings.timeouts.changesetAutoSave)},g(),b(document).on("visibilitychange.wp-customize-changeset-update",function(){document.hidden&&e()}),b(window).on("beforeunload.wp-customize-changeset-update",function(){e()})}if(f.settings=window._wpCustomizeSettings,f.l10n=window._wpCustomizeControlsL10n,f.settings&&b.support.postMessage&&(b.support.cors||!f.settings.isCrossDomain)){null===f.PreviewFrame.prototype.sensitivity&&(f.PreviewFrame.prototype.sensitivity=f.settings.timeouts.previewFrameSensitivity),null===f.Previewer.prototype.refreshBuffer&&(f.Previewer.prototype.refreshBuffer=f.settings.timeouts.windowRefresh);var c,d=b(document.body),e=d.children(".wp-full-overlay"),g=b("#customize-info .panel-title.site-title"),h=b(".customize-controls-close"),i=b("#save"),j=b("#customize-save-button-wrapper"),k=b("#publish-settings"),l=b("#customize-footer-actions");f.bind("ready",function(){f.section.add(new f.OuterSection("publish_settings",{title:f.l10n.publishSettings,priority:0,active:f.settings.theme.active}))}),f.section("publish_settings",function(a){function b(){r||(r=f.utils.highlightButton(j,{delay:1e3,focusTarget:i}))}function c(){r&&(r(),r=null)}var d,e,g,h,l,m,n,o,p,q,r,s=1e3;e=new f.Control("trash_changeset",{type:"button",section:a.id,priority:30,input_attrs:{"class":"button-link button-link-delete",value:f.l10n.discardChanges}}),f.control.add(e),e.deferred.embedded.done(function(){e.container.find(".button-link").on("click",function(){confirm(f.l10n.trashConfirm)&&wp.customize.previewer.trash()})}),f.control.add(new f.PreviewLinkControl("changeset_preview_link",{section:a.id,priority:100})),h=function(){return!!f.state("activated").get()&&(!f.state("trashing").get()&&"trash"!==f.state("changesetStatus").get()&&(""!==f.state("changesetStatus").get()||!f.state("saved").get()))},a.active.validate=h,g=function(){a.active.set(h())},f.state("activated").bind(g),f.state("trashing").bind(g),f.state("saved").bind(g),f.state("changesetStatus").bind(g),g(),d=function(){k.toggle(a.active.get()),i.toggleClass("has-next-sibling",a.active.get())},d(),a.active.bind(d),f.state("selectedChangesetStatus").bind(c),a.contentContainer.find(".customize-action").text(f.l10n.updating),a.contentContainer.find(".customize-section-back").removeAttr("tabindex"),k.prop("disabled",!1),k.on("click",function(b){b.preventDefault(),a.expanded.set(!a.expanded.get())}),a.expanded.bind(function(a){var d;return k.attr("aria-expanded",String(a)),k.toggleClass("active",a),a?void c():(d=f.state("changesetStatus").get(),""!==d&&"auto-draft"!==d||(d="publish"),void(f.state("selectedChangesetStatus").get()!==d?b():"future"===f.state("selectedChangesetStatus").get()&&f.state("selectedChangesetDate").get()!==f.state("changesetDate").get()&&b()))}),l=new f.Control("changeset_status",{priority:10,type:"radio",section:"publish_settings",setting:f.state("selectedChangesetStatus"),templateId:"customize-selected-changeset-status-control",label:f.l10n.action,choices:f.settings.changeset.statusChoices}),f.control.add(l),m=new f.DateTimeControl("changeset_scheduled_date",{priority:20,section:"publish_settings",setting:f.state("selectedChangesetDate"),minYear:(new Date).getFullYear(),allowPastDate:!1,includeTime:!0,twelveHourFormat:/a/i.test(f.settings.timeFormat),description:f.l10n.scheduleDescription}),m.notifications.alt=!0,f.control.add(m),o=function(){f.state("selectedChangesetStatus").set("publish"),f.previewer.save()},q=function(){var a="future"===f.state("changesetStatus").get()&&"future"===f.state("selectedChangesetStatus").get()&&f.state("changesetDate").get()&&f.state("selectedChangesetDate").get()===f.state("changesetDate").get()&&f.utils.getRemainingTime(f.state("changesetDate").get())>=0;a&&!p?p=setInterval(function(){var a=f.utils.getRemainingTime(f.state("changesetDate").get());f.state("remainingTimeToPublish").set(a),a<=0&&(clearInterval(p),p=0,o())},s):!a&&p&&(clearInterval(p),p=0)},f.state("changesetDate").bind(q),f.state("selectedChangesetDate").bind(q),f.state("changesetStatus").bind(q),f.state("selectedChangesetStatus").bind(q),q(),m.active.validate=function(){return"future"===f.state("selectedChangesetStatus").get()},n=function(a){m.active.set("future"===a)},n(f.state("selectedChangesetStatus").get()),f.state("selectedChangesetStatus").bind(n),f.state("saving").bind(function(a){a&&"future"===f.state("selectedChangesetStatus").get()&&m.toggleFutureDateNotification(!m.isFutureDate())})}),b("#customize-controls").on("keydown",function(a){var c=13===a.which,d=b(a.target);c&&(d.is("input:not([type=button])")||d.is("select"))&&a.preventDefault()}),b(".customize-info").find("> .accordion-section-title .customize-help-toggle").on("click",function(){var a=b(this).closest(".accordion-section"),c=a.find(".customize-panel-description:first");a.hasClass("cannot-expand")||(a.hasClass("open")?(a.toggleClass("open"),c.slideUp(f.Panel.prototype.defaultExpandedArguments.duration,function(){c.trigger("toggled")}),b(this).attr("aria-expanded",!1)):(c.slideDown(f.Panel.prototype.defaultExpandedArguments.duration,function(){c.trigger("toggled")}),a.toggleClass("open"),b(this).attr("aria-expanded",!0)))}),f.previewer=new f.Previewer({container:"#customize-preview",form:"#customize-controls",previewUrl:f.settings.url.preview,allowedUrls:f.settings.url.allowed},{nonce:f.settings.nonce,query:function(a){var b={wp_customize:"on",customize_theme:f.settings.theme.stylesheet,nonce:this.nonce.preview,customize_changeset_uuid:f.settings.changeset.uuid};return!f.settings.changeset.autosaved&&f.state("saved").get()||(b.customize_autosaved="on"),b.customized=JSON.stringify(f.dirtyValues({unsaved:a&&a.excludeCustomizedSaved})),b},save:function(a){function d(a){m[a.id]=!0}var e,g,h=this,i=b.Deferred(),j=f.state("selectedChangesetStatus").get(),k=f.state("selectedChangesetDate").get(),l=f.state("processing"),m={},n=[],o=[],p=[];return a&&a.status&&(j=a.status),f.state("saving").get()&&(i.reject("already_saving"),i.promise()),f.state("saving").set(!0),g=function(){var e,g,l={},q=f._latestRevision,r="client_side_error";return f.bind("change",d),f.notifications.remove(r),f.each(function(a){a.notifications.each(function(b){"error"!==b.type||b.fromServer||(n.push(a.id),l[a.id]||(l[a.id]={}),l[a.id][b.code]=b)})}),f.control.each(function(a){(!a.setting||!a.setting.id&&a.active.get())&&a.notifications.each(function(b){"error"===b.type&&p.push([a])})}),o=_.union(p,_.values(f.findControlsForSettings(n))),_.isEmpty(o)?(g=b.extend(h.query({excludeCustomizedSaved:!1}),{nonce:h.nonce.save,customize_changeset_status:j}),a&&a.date?g.customize_changeset_date=a.date:"future"===j&&k&&(g.customize_changeset_date=k),a&&a.title&&(g.customize_changeset_title=a.title),f.trigger("save-request-params",g),e=wp.ajax.post("customize_save",g),f.state("processing").set(f.state("processing").get()+1),f.trigger("save",e),e.always(function(){f.state("processing").set(f.state("processing").get()-1),f.state("saving").set(!1),f.unbind("change",d)}),f.notifications.each(function(a){a.saveFailure&&f.notifications.remove(a.code)}),e.fail(function(a){var b,d;d={type:"error",dismissible:!0,fromServer:!0,saveFailure:!0},"0"===a?a="not_logged_in":"-1"===a&&(a="invalid_nonce"),"invalid_nonce"===a?h.cheatin():"not_logged_in"===a?(h.preview.iframe.hide(),h.login().done(function(){h.save(),h.preview.iframe.show()})):a.code?"not_future_date"===a.code&&f.section.has("publish_settings")&&f.section("publish_settings").active.get()&&f.control.has("changeset_scheduled_date")?f.control("changeset_scheduled_date").toggleFutureDateNotification(!0).focus():"changeset_locked"!==a.code&&(b=new f.Notification(a.code,_.extend(d,{message:a.message}))):b=new f.Notification("unknown_error",_.extend(d,{message:f.l10n.unknownRequestFail})),b&&f.notifications.add(b),a.setting_validities&&f._handleSettingValidities({settingValidities:a.setting_validities,focusInvalidControl:!0}),i.rejectWith(h,[a]),f.trigger("error",a),"changeset_already_published"===a.code&&a.next_changeset_uuid&&(f.settings.changeset.uuid=a.next_changeset_uuid,f.state("changesetStatus").set(""),f.settings.changeset.branching&&c.send("changeset-uuid",f.settings.changeset.uuid),f.previewer.send("changeset-uuid",f.settings.changeset.uuid))}),void e.done(function(a){h.send("saved",a),f.state("changesetStatus").set(a.changeset_status),a.changeset_date&&f.state("changesetDate").set(a.changeset_date),"publish"===a.changeset_status&&(f.each(function(a){a._dirty&&(_.isUndefined(f._latestSettingRevisions[a.id])||f._latestSettingRevisions[a.id]<=q)&&(a._dirty=!1)}),f.state("changesetStatus").set(""),f.settings.changeset.uuid=a.next_changeset_uuid,f.settings.changeset.branching&&c.send("changeset-uuid",f.settings.changeset.uuid)),f._lastSavedRevision=Math.max(q,f._lastSavedRevision),a.setting_validities&&f._handleSettingValidities({settingValidities:a.setting_validities,focusInvalidControl:!0}),i.resolveWith(h,[a]),f.trigger("saved",a),_.isEmpty(m)||f.state("saved").set(!1)})):(o[0][0].focus(),f.unbind("change",d),n.length&&f.notifications.add(new f.Notification(r,{message:(1===n.length?f.l10n.saveBlockedError.singular:f.l10n.saveBlockedError.plural).replace(/%s/g,String(n.length)),type:"error",dismissible:!0,saveFailure:!0})),i.rejectWith(h,[{setting_invalidities:l}]),f.state("saving").set(!1),i.promise())},0===l()?g():(e=function(){0===l()&&(f.state.unbind("change",e),g())},f.state.bind("change",e)),i.promise()},trash:function(){var a,c,d;f.state("trashing").set(!0),f.state("processing").set(f.state("processing").get()+1),a=wp.ajax.post("customize_trash",{customize_changeset_uuid:f.settings.changeset.uuid,nonce:f.settings.nonce.trash}),f.notifications.add(new f.OverlayNotification("changeset_trashing",{type:"info",message:f.l10n.revertingChanges,loading:!0})),c=function(){var a,c=document.createElement("a");f.state("changesetStatus").set("trash"),f.each(function(a){a._dirty=!1}),f.state("saved").set(!0),c.href=location.href,a=f.utils.parseQueryString(c.search.substr(1)),delete a.changeset_uuid,a["return"]=f.settings.url["return"],c.search=b.param(a),location.replace(c.href)},d=function(a,b){var c=a||"unknown_error";f.state("processing").set(f.state("processing").get()-1),f.state("trashing").set(!1),f.notifications.remove("changeset_trashing"),f.notifications.add(new f.Notification(c,{message:b||f.l10n.unknownError,dismissible:!0,type:"error"}))},a.done(function(a){c(a.message)}),a.fail(function(a){var b=a.code||"trashing_failed";a.success||"non_existent_changeset"===b||"changeset_already_trashed"===b?c(a.message):d(b,a.message)})},getFrontendPreviewUrl:function(){var a,c,d=this;return c=document.createElement("a"),c.href=d.previewUrl.get(),a=f.utils.parseQueryString(c.search.substr(1)),f.state("changesetStatus").get()&&"publish"!==f.state("changesetStatus").get()&&(a.customize_changeset_uuid=f.settings.changeset.uuid),f.state("activated").get()||(a.customize_theme=f.settings.theme.stylesheet),c.search=b.param(a),c.href}}),b.ajaxPrefilter(function(a){/wp_customize=on/.test(a.data)&&(a.data+="&"+b.param({customize_preview_nonce:f.settings.nonce.preview}))}),f.previewer.bind("nonce",function(a){b.extend(this.nonce,a)}),f.bind("nonce-refresh",function(a){b.extend(f.settings.nonce,a),b.extend(f.previewer.nonce,a),f.previewer.send("nonce-refresh",a)}),b.each(f.settings.settings,function(a,b){var c=f.settingConstructor[b.type]||f.Setting;f.add(new c(a,b.value,{transport:b.transport,previewer:f.previewer,dirty:!!b.dirty}))}),b.each(f.settings.panels,function(a,b){var c,d=f.panelConstructor[b.type]||f.Panel;c=_.extend({params:b},b),f.panel.add(new d(a,c))}),b.each(f.settings.sections,function(a,b){var c,d=f.sectionConstructor[b.type]||f.Section;c=_.extend({params:b},b),f.section.add(new d(a,c))}),b.each(f.settings.controls,function(a,b){var c,d=f.controlConstructor[b.type]||f.Control;c=_.extend({params:b},b),f.control.add(new d(a,c))}),_.each(["panel","section","control"],function(a){var b=f.settings.autofocus[a];b&&f[a](b,function(a){a.deferred.embedded.done(function(){f.previewer.deferred.active.done(function(){a.focus()})})})}),f.bind("ready",f.reflowPaneContents),b([f.panel,f.section,f.control]).each(function(a,b){var c=_.debounce(f.reflowPaneContents,f.settings.timeouts.reflowPaneContents);b.bind("add",c),b.bind("change",c),b.bind("remove",c)}),f.bind("ready",function(){var a,c,d;f.notifications.container=b("#customize-notifications-area"),f.notifications.bind("change",_.debounce(function(){f.notifications.render()})),a=b(".wp-full-overlay-sidebar-content"),f.notifications.bind("rendered",function(){a.css("top",""),0!==f.notifications.count()&&(c=f.notifications.container.outerHeight()+1,d=parseInt(a.css("top"),10),a.css("top",d+c+"px")),f.notifications.trigger("sidebarTopUpdated")}),f.notifications.render()}),function(a){var c,e,g=a.instance("saved"),j=a.instance("saving"),k=a.instance("trashing"),l=a.instance("activated"),m=a.instance("processing"),n=a.instance("paneVisible"),o=a.instance("expandedPanel"),p=a.instance("expandedSection"),q=a.instance("changesetStatus"),r=a.instance("selectedChangesetStatus"),s=a.instance("changesetDate"),t=a.instance("selectedChangesetDate"),u=a.instance("previewerAlive"),v=a.instance("editShortcutVisibility"),w=a.instance("changesetLocked");a.bind("change",function(){var a;l()?""===q.get()&&g()?(f.settings.changeset.currentUserCanPublish?i.val(f.l10n.published):i.val(f.l10n.saved),h.find(".screen-reader-text").text(f.l10n.close)):("draft"===r()?g()&&r()===q()?i.val(f.l10n.draftSaved):i.val(f.l10n.saveDraft):"future"===r()?g()&&r()===q()?s.get()!==t.get()?i.val(f.l10n.schedule):i.val(f.l10n.scheduled):i.val(f.l10n.schedule):f.settings.changeset.currentUserCanPublish&&i.val(f.l10n.publish),h.find(".screen-reader-text").text(f.l10n.cancel)):(i.val(f.l10n.activate),h.find(".screen-reader-text").text(f.l10n.cancel)),a=!j()&&!k()&&!w()&&(!l()||!g()||q()!==r()&&""!==q()||"future"===r()&&s.get()!==t.get()),i.prop("disabled",!a)}),r.validate=function(a){return""===a||"auto-draft"===a?null:a},e=f.settings.changeset.currentUserCanPublish?"publish":"draft",q(f.settings.changeset.status),w(Boolean(f.settings.changeset.lockUser)),s(f.settings.changeset.publishDate),t(f.settings.changeset.publishDate),r(""===f.settings.changeset.status||"auto-draft"===f.settings.changeset.status?e:f.settings.changeset.status),r.link(q),g(!0),""===q()&&f.each(function(a){a._dirty&&g(!1)}),j(!1),l(f.settings.theme.active),m(0),n(!0),o(!1),p(!1),u(!0),v("visible"),f.bind("change",function(){a("saved").get()&&a("saved").set(!1)}),f.settings.changeset.branching&&g.bind(function(a){a||c(!0)}),j.bind(function(a){d.toggleClass("saving",a)}),k.bind(function(a){d.toggleClass("trashing",a)}),f.bind("saved",function(b){a("saved").set(!0),"publish"===b.changeset_status&&a("activated").set(!0)}),l.bind(function(a){a&&f.trigger("activated")}),c=function(a){var c,d;if(history.replaceState){if(c=document.createElement("a"),c.href=location.href,d=f.utils.parseQueryString(c.search.substr(1)),a){if(d.changeset_uuid===f.settings.changeset.uuid)return;d.changeset_uuid=f.settings.changeset.uuid}else{
+if(!d.changeset_uuid)return;delete d.changeset_uuid}c.search=b.param(d),history.replaceState({},document.title,c.href)}},f.settings.changeset.branching&&q.bind(function(a){c(""!==a&&"publish"!==a&&"trash"!==a)})}(f.state),function(){function a(a){a&&a.lockUser&&(f.settings.changeset.lockUser=a.lockUser),f.state("changesetLocked").set(!0),f.notifications.add(new c("changeset_locked",{lockUser:f.settings.changeset.lockUser,allowOverride:Boolean(a&&a.allowOverride)}))}var c=f.OverlayNotification.extend({templateId:"customize-changeset-locked-notification",lockUser:null,initialize:function(a,b){var c,d,e=this;c=a||"changeset_locked",d=_.extend({type:"warning",containerClasses:"",lockUser:{}},b),d.containerClasses+=" notification-changeset-locked",f.OverlayNotification.prototype.initialize.call(e,c,d)},render:function(){var a,b,c,d,e=this;return b=_.extend({allowOverride:!1,returnUrl:f.settings.url["return"],previewUrl:f.previewer.previewUrl.get(),frontendPreviewUrl:f.previewer.getFrontendPreviewUrl()},this),a=f.OverlayNotification.prototype.render.call(b),f.requestChangesetUpdate({},{autosave:!0}).fail(function(b){b.autosaved||a.find(".notice-error").prop("hidden",!1).text(b.message||f.l10n.unknownRequestFail)}),c=a.find(".customize-notice-take-over-button"),c.on("click",function(b){b.preventDefault(),d||(c.addClass("disabled"),d=wp.ajax.post("customize_override_changeset_lock",{wp_customize:"on",customize_theme:f.settings.theme.stylesheet,customize_changeset_uuid:f.settings.changeset.uuid,nonce:f.settings.nonce.override_lock}),d.done(function(){f.notifications.remove(e.code),f.state("changesetLocked").set(!1)}),d.fail(function(b){var e=b.message||f.l10n.unknownRequestFail;a.find(".notice-error").prop("hidden",!1).text(e),d.always(function(){c.removeClass("disabled")})}),d.always(function(){d=null}))}),a}});f.settings.changeset.lockUser&&a({allowOverride:!0}),b(document).on("heartbeat-send.update_lock_notice",function(a,b){b.check_changeset_lock=!0,b.changeset_uuid=f.settings.changeset.uuid}),b(document).on("heartbeat-tick.update_lock_notice",function(b,c){var d,e="changeset_locked";c.customize_changeset_lock_user&&(d=f.notifications(e),d&&d.lockUser.id!==f.settings.changeset.lockUser.id&&f.notifications.remove(e),a({lockUser:c.customize_changeset_lock_user}))}),f.bind("error",function(b){"changeset_locked"===b.code&&b.lock_user&&a({lockUser:b.lock_user})})}(),function(){function a(){var a,c;return a=document.createElement("a"),a.href=location.href,c=f.utils.parseQueryString(a.search.substr(1)),f.settings.changeset.latestAutoDraftUuid?c.changeset_uuid=f.settings.changeset.latestAutoDraftUuid:c.customize_autosaved="on",c["return"]=f.settings.url["return"],a.search=b.param(c),a.href}function c(a){var c,d=document.createElement("a"),e=0;d.href=location.href,c=f.utils.parseQueryString(d.search.substr(1)),_.each(a,function(a){"undefined"!=typeof c[a]&&(e+=1,delete c[a])}),0!==e&&(d.search=b.param(c),history.replaceState({},document.title,d.href))}function d(){h||(wp.ajax.post("customize_dismiss_autosave_or_lock",{wp_customize:"on",customize_theme:f.settings.theme.stylesheet,customize_changeset_uuid:f.settings.changeset.uuid,nonce:f.settings.nonce.dismiss_autosave_or_lock,dismiss_autosave:!0}),h=!0)}function e(){var b,c="autosave_available";f.notifications.add(new f.Notification(c,{message:f.l10n.autosaveNotice,type:"warning",dismissible:!0,render:function(){var b,c=f.Notification.prototype.render.call(this);return b=c.find("a"),b.prop("href",a()),b.on("click",function(b){b.preventDefault(),location.replace(a())}),c.find(".notice-dismiss").on("click",d),c}})),b=function(){d(),f.notifications.remove(c),f.unbind("change",b),f.state("changesetStatus").unbind(b)},f.bind("change",b),f.state("changesetStatus").bind(b)}var g=[],h=!1;f.settings.changeset.autosaved&&(f.state("saved").set(!1),g.push("customize_autosaved")),f.settings.changeset.branching||f.settings.changeset.status&&"auto-draft"!==f.settings.changeset.status||g.push("changeset_uuid"),g.length>0&&c(g),(f.settings.changeset.latestAutoDraftUuid||f.settings.changeset.hasAutosaveRevision)&&e()}(),f.previewer.previewUrl()?f.previewer.refresh():f.previewer.previewUrl(f.settings.url.home),i.click(function(a){f.previewer.save(),a.preventDefault()}).keydown(function(a){9!==a.which&&(13===a.which&&f.previewer.save(),a.preventDefault())}),h.keydown(function(a){9!==a.which&&(13===a.which&&this.click(),a.preventDefault())}),b(".collapse-sidebar").on("click",function(){f.state("paneVisible").set(!f.state("paneVisible").get())}),f.state("paneVisible").bind(function(a){e.toggleClass("preview-only",!a),e.toggleClass("expanded",a),e.toggleClass("collapsed",!a),a?b(".collapse-sidebar").attr({"aria-expanded":"true","aria-label":f.l10n.collapseSidebar}):b(".collapse-sidebar").attr({"aria-expanded":"false","aria-label":f.l10n.expandSidebar})}),d.on("keydown",function(a){var c,e=[],g=[],h=[];if(27===a.which&&(b(a.target).is("body")||b.contains(b("#customize-controls")[0],a.target))&&(f.control.each(function(a){a.expanded&&a.expanded()&&_.isFunction(a.collapse)&&e.push(a)}),f.section.each(function(a){a.expanded()&&g.push(a)}),f.panel.each(function(a){a.expanded()&&h.push(a)}),e.length>0&&0===g.length&&(e.length=0),c=e[0]||g[0]||h[0])){if("themes"===c.params.type)return void(d.hasClass("modal-open")?c.closeDetails():f.panel.has("themes")&&f.panel("themes").collapse());c.collapse(),a.preventDefault()}}),b(".customize-controls-preview-toggle").on("click",function(){f.state("paneVisible").set(!f.state("paneVisible").get())}),function(){var a,c,d,e,g,h,i,j=b(".wp-full-overlay-sidebar-content");a=function(a){var b,g=a,i=f.state("expandedSection").get(),j=f.state("expandedPanel").get();if(h&&h.element&&(d(h.element),h.element.find(".description").off("toggled",c)),!g)if(!i&&j&&j.contentContainer)g=j;else{if(j||!i||!i.contentContainer)return void(h=!1);g=i}b=g.contentContainer.find(".customize-section-title, .panel-meta").first(),b.length?(h={instance:g,element:b,parent:b.closest(".customize-pane-child"),height:b.outerHeight()},h.element.find(".description").on("toggled",c),i&&e(h.element,h.parent)):h=!1},f.state("expandedSection").bind(a),f.state("expandedPanel").bind(a),j.on("scroll",_.throttle(function(){if(h){var a,b=j.scrollTop();a=i?b===i?0:b>i?1:-1:1,i=b,0!==a&&g(h,b,a)}},8)),f.notifications.bind("sidebarTopUpdated",function(){h&&h.element.hasClass("is-sticky")&&h.element.css("top",j.css("top"))}),d=function(a){a.hasClass("is-sticky")&&a.removeClass("is-sticky").addClass("maybe-sticky is-in-view").css("top",j.scrollTop()+"px")},e=function(a,b){a.hasClass("is-in-view")&&(a.removeClass("maybe-sticky is-in-view").css({width:"",top:""}),b.css("padding-top",""))},c=function(){h.height=h.element.outerHeight()},g=function(a,b,c){var d=a.element,e=a.parent,f=a.height,g=parseInt(d.css("top"),10),h=d.hasClass("maybe-sticky"),i=d.hasClass("is-sticky"),k=d.hasClass("is-in-view"),l=-1===c;if(!l)return i&&(g=b,d.removeClass("is-sticky").css({top:g+"px",width:""})),void(k&&b>g+f&&(d.removeClass("is-in-view"),e.css("padding-top","")));if(!h&&b>=f)h=!0,d.addClass("maybe-sticky");else if(0===b)return d.removeClass("maybe-sticky is-in-view is-sticky").css({top:"",width:""}),void e.css("padding-top","");k&&!i?g>=b&&d.addClass("is-sticky").css({top:j.css("top"),width:e.outerWidth()+"px"}):h&&!k&&(d.addClass("is-in-view").css("top",b-f+"px"),e.css("padding-top",f+"px"))}}(),f.previewedDevice=f.state("previewedDevice"),f.bind("ready",function(){_.find(f.settings.previewableDevices,function(a,b){if(!0===a["default"])return f.previewedDevice.set(b),!0})}),l.find(".devices button").on("click",function(a){f.previewedDevice.set(b(a.currentTarget).data("device"))}),f.previewedDevice.bind(function(a){var c=b(".wp-full-overlay"),d="";l.find(".devices button").removeClass("active").attr("aria-pressed",!1),l.find(".devices .preview-"+a).addClass("active").attr("aria-pressed",!0),b.each(f.settings.previewableDevices,function(a){d+=" preview-"+a}),c.removeClass(d).addClass("preview-"+a)}),g.length&&f("blogname",function(a){var c=function(){g.text(b.trim(a())||f.l10n.untitledBlogName)};a.bind(c),c()}),c=new f.Messenger({url:f.settings.url.parent,channel:"loader"}),function(){function a(){var a;return f.state("activated").get()?(a=f.state("changesetStatus").get(),""!==a&&"auto-draft"!==a||(a="publish"),f.state("selectedChangesetStatus").get()===a&&(("future"!==f.state("selectedChangesetStatus").get()||f.state("selectedChangesetDate").get()===f.state("changesetDate").get())&&(f.state("saved").get()&&"auto-draft"!==f.state("changesetStatus").get()))):0===f._latestRevision}function d(){f.unbind("change",d),f.state("selectedChangesetStatus").unbind(d),f.state("selectedChangesetDate").unbind(d),b(window).on("beforeunload.customize-confirm",function(){if(!a()&&!f.state("changesetLocked").get())return setTimeout(function(){e.removeClass("customize-loading")},1),f.l10n.saveAlert})}function g(){var c=b.Deferred(),d=!1,e=!1;return a()?e=!0:confirm(f.l10n.saveAlert)?(e=!0,f.each(function(a){a._dirty=!1}),b(document).off("visibilitychange.wp-customize-changeset-update"),b(window).off("beforeunload.wp-customize-changeset-update"),h.css("cursor","progress"),""!==f.state("changesetStatus").get()&&(d=!0)):c.reject(),(e||d)&&wp.ajax.send("customize_dismiss_autosave_or_lock",{timeout:500,data:{wp_customize:"on",customize_theme:f.settings.theme.stylesheet,customize_changeset_uuid:f.settings.changeset.uuid,nonce:f.settings.nonce.dismiss_autosave_or_lock,dismiss_autosave:d,dismiss_lock:e}}).always(function(){c.resolve()}),c.promise()}var i=!1;c.bind("back",function(){i=!0}),f.bind("change",d),f.state("selectedChangesetStatus").bind(d),f.state("selectedChangesetDate").bind(d),c.bind("confirm-close",function(){g().done(function(){c.send("confirmed-close",!0)}).fail(function(){c.send("confirmed-close",!1)})}),h.on("click.customize-controls-close",function(a){a.preventDefault(),i?c.send("close"):g().done(function(){b(window).off("beforeunload.customize-confirm"),window.location.href=h.prop("href")})})}(),b.each(["saved","change"],function(a,b){f.bind(b,function(){c.send(b)})}),f.bind("title",function(a){c.send("title",a)}),f.settings.changeset.branching&&c.send("changeset-uuid",f.settings.changeset.uuid),c.send("ready"),b.each({background_image:{controls:["background_preset","background_position","background_size","background_repeat","background_attachment"],callback:function(a){return!!a}},show_on_front:{controls:["page_on_front","page_for_posts"],callback:function(a){return"page"===a}},header_textcolor:{controls:["header_textcolor"],callback:function(a){return"blank"!==a}}},function(a,c){f(a,function(a){b.each(c.controls,function(b,d){f.control(d,function(b){var d=function(a){b.container.toggle(c.callback(a))};d(a.get()),a.bind(d)})})})}),f.control("background_preset",function(a){var b,c,d,e,g,h;b={"default":[!1,!1,!1,!1],fill:[!0,!1,!1,!1],fit:[!0,!1,!0,!1],repeat:[!0,!1,!1,!0],custom:[!0,!0,!0,!0]},c=[_wpCustomizeBackground.defaults["default-position-x"],_wpCustomizeBackground.defaults["default-position-y"],_wpCustomizeBackground.defaults["default-size"],_wpCustomizeBackground.defaults["default-repeat"],_wpCustomizeBackground.defaults["default-attachment"]],d={"default":c,fill:["left","top","cover","no-repeat","fixed"],fit:["left","top","contain","no-repeat","fixed"],repeat:["left","top","auto","repeat","scroll"]},e=function(a){_.each(["background_position","background_size","background_repeat","background_attachment"],function(c,d){var e=f.control(c);e&&e.container.toggle(b[a][d])})},g=function(a){_.each(["background_position_x","background_position_y","background_size","background_repeat","background_attachment"],function(b,c){var e=f(b);e&&e.set(d[a][c])})},h=a.setting.get(),e(h),a.setting.bind("change",function(a){e(a),"custom"!==a&&g(a)})}),f.control("background_repeat",function(a){a.elements[0].unsync(f("background_repeat")),a.element=new f.Element(a.container.find("input")),a.element.set("no-repeat"!==a.setting()),a.element.bind(function(b){a.setting.set(b?"repeat":"no-repeat")}),a.setting.bind(function(b){a.element.set("no-repeat"!==b)})}),f.control("background_attachment",function(a){a.elements[0].unsync(f("background_attachment")),a.element=new f.Element(a.container.find("input")),a.element.set("fixed"!==a.setting()),a.element.bind(function(b){a.setting.set(b?"scroll":"fixed")}),a.setting.bind(function(b){a.element.set("fixed"!==b)})}),f.control("display_header_text",function(a){var b="";a.elements[0].unsync(f("header_textcolor")),a.element=new f.Element(a.container.find("input")),a.element.set("blank"!==a.setting()),a.element.bind(function(c){c||(b=f("header_textcolor").get()),a.setting.set(c?b:"blank")}),a.setting.bind(function(b){a.element.set("blank"!==b)})}),f("show_on_front","page_on_front","page_for_posts",function(a,b,c){var d=function(){var d,e,g=this,h="show_on_front_page_collision";d=parseInt(b(),10),e=parseInt(c(),10),"page"===a()&&(g===b&&d>0&&f.previewer.previewUrl.set(f.settings.url.home),g===c&&e>0&&f.previewer.previewUrl.set(f.settings.url.home+"?page_id="+e)),"page"===a()&&d&&e&&d===e?a.notifications.add(new f.Notification(h,{type:"error",message:f.l10n.pageOnFrontError})):a.notifications.remove(h)};a.bind(d),b.bind(d),c.bind(d),d.call(a,a()),f.control("show_on_front",function(a){a.deferred.embedded.done(function(){a.container.append(a.getNotificationsContainerElement())})})}),function(){var a=b.Deferred();f.section("custom_css",function(b){b.deferred.embedded.done(function(){b.expanded()?a.resolve(b):b.expanded.bind(function(c){c&&a.resolve(b)})})}),a.done(function(a){var b=f.control("custom_css");b.container.find(".customize-control-title:first").addClass("screen-reader-text"),a.container.find(".section-description-buttons .section-description-close").on("click",function(){a.container.find(".section-meta .customize-section-description:first").removeClass("open").slideUp(),a.container.find(".customize-help-toggle").attr("aria-expanded","false").focus()}),b&&!b.setting.get()&&(a.container.find(".section-meta .customize-section-description:first").addClass("open").show().trigger("toggled"),a.container.find(".customize-help-toggle").attr("aria-expanded","true"))})}(),f.control("header_video",function(a){a.deferred.embedded.done(function(){var b=function(){var b=f.section(a.section()),c="video_header_not_available";b&&(a.active.get()?b.notifications.remove(c):b.notifications.add(new f.Notification(c,{type:"info",message:f.l10n.videoHeaderNotice})))};b(),a.active.bind(b)})}),f.previewer.bind("selective-refresh-setting-validities",function(a){f._handleSettingValidities({settingValidities:a,focusInvalidControl:!1})}),f.previewer.bind("focus-control-for-setting",function(a){var b=[];f.control.each(function(c){var d=_.pluck(c.settings,"id");-1!==_.indexOf(d,a)&&b.push(c)}),b.length&&(b.sort(function(a,b){return a.priority()-b.priority()}),b[0].focus())}),f.previewer.bind("refresh",function(){f.previewer.refresh()}),f.state("paneVisible").bind(function(a){var c;c=window.matchMedia?window.matchMedia("screen and ( max-width: 640px )").matches:b(window).width()<=640,f.state("editShortcutVisibility").set(a||c?"visible":"hidden")}),window.matchMedia&&window.matchMedia("screen and ( max-width: 640px )").addListener(function(){var a=f.state("paneVisible");a.callbacks.fireWith(a,[a.get(),a.get()])}),f.previewer.bind("edit-shortcut-visibility",function(a){f.state("editShortcutVisibility").set(a)}),f.state("editShortcutVisibility").bind(function(a){f.previewer.send("edit-shortcut-visibility",a)}),f.bind("change",a),b(document).one("tinymce-editor-setup",function(){window.tinymce.ui.FloatPanel&&(!window.tinymce.ui.FloatPanel.zIndex||window.tinymce.ui.FloatPanel.zIndex<500001)&&(window.tinymce.ui.FloatPanel.zIndex=500001)}),d.addClass("ready"),f.trigger("ready")}})}(wp,jQuery); \ No newline at end of file
diff --git a/www/crm/wp-admin/js/customize-nav-menus.js b/www/crm/wp-admin/js/customize-nav-menus.js
new file mode 100644
index 00000000..19962019
--- /dev/null
+++ b/www/crm/wp-admin/js/customize-nav-menus.js
@@ -0,0 +1,3464 @@
+/**
+ * @output wp-admin/js/customize-nav-menus.js
+ */
+
+/* global _wpCustomizeNavMenusSettings, wpNavMenu, console */
+( function( api, wp, $ ) {
+ 'use strict';
+
+ /**
+ * Set up wpNavMenu for drag and drop.
+ */
+ wpNavMenu.originalInit = wpNavMenu.init;
+ wpNavMenu.options.menuItemDepthPerLevel = 20;
+ wpNavMenu.options.sortableItems = '> .customize-control-nav_menu_item';
+ wpNavMenu.options.targetTolerance = 10;
+ wpNavMenu.init = function() {
+ this.jQueryExtensions();
+ };
+
+ /**
+ * @namespace wp.customize.Menus
+ */
+ api.Menus = api.Menus || {};
+
+ // Link settings.
+ api.Menus.data = {
+ itemTypes: [],
+ l10n: {},
+ settingTransport: 'refresh',
+ phpIntMax: 0,
+ defaultSettingValues: {
+ nav_menu: {},
+ nav_menu_item: {}
+ },
+ locationSlugMappedToName: {}
+ };
+ if ( 'undefined' !== typeof _wpCustomizeNavMenusSettings ) {
+ $.extend( api.Menus.data, _wpCustomizeNavMenusSettings );
+ }
+
+ /**
+ * Newly-created Nav Menus and Nav Menu Items have negative integer IDs which
+ * serve as placeholders until Save & Publish happens.
+ *
+ * @alias wp.customize.Menus.generatePlaceholderAutoIncrementId
+ *
+ * @return {number}
+ */
+ api.Menus.generatePlaceholderAutoIncrementId = function() {
+ return -Math.ceil( api.Menus.data.phpIntMax * Math.random() );
+ };
+
+ /**
+ * wp.customize.Menus.AvailableItemModel
+ *
+ * A single available menu item model. See PHP's WP_Customize_Nav_Menu_Item_Setting class.
+ *
+ * @class wp.customize.Menus.AvailableItemModel
+ * @augments Backbone.Model
+ */
+ api.Menus.AvailableItemModel = Backbone.Model.extend( $.extend(
+ {
+ id: null // This is only used by Backbone.
+ },
+ api.Menus.data.defaultSettingValues.nav_menu_item
+ ) );
+
+ /**
+ * wp.customize.Menus.AvailableItemCollection
+ *
+ * Collection for available menu item models.
+ *
+ * @class wp.customize.Menus.AvailableItemCollection
+ * @augments Backbone.Collection
+ */
+ api.Menus.AvailableItemCollection = Backbone.Collection.extend(/** @lends wp.customize.Menus.AvailableItemCollection.prototype */{
+ model: api.Menus.AvailableItemModel,
+
+ sort_key: 'order',
+
+ comparator: function( item ) {
+ return -item.get( this.sort_key );
+ },
+
+ sortByField: function( fieldName ) {
+ this.sort_key = fieldName;
+ this.sort();
+ }
+ });
+ api.Menus.availableMenuItems = new api.Menus.AvailableItemCollection( api.Menus.data.availableMenuItems );
+
+ /**
+ * Insert a new `auto-draft` post.
+ *
+ * @since 4.7.0
+ * @alias wp.customize.Menus.insertAutoDraftPost
+ *
+ * @param {object} params - Parameters for the draft post to create.
+ * @param {string} params.post_type - Post type to add.
+ * @param {string} params.post_title - Post title to use.
+ * @return {jQuery.promise} Promise resolved with the added post.
+ */
+ api.Menus.insertAutoDraftPost = function insertAutoDraftPost( params ) {
+ var request, deferred = $.Deferred();
+
+ request = wp.ajax.post( 'customize-nav-menus-insert-auto-draft', {
+ 'customize-menus-nonce': api.settings.nonce['customize-menus'],
+ 'wp_customize': 'on',
+ 'customize_changeset_uuid': api.settings.changeset.uuid,
+ 'params': params
+ } );
+
+ request.done( function( response ) {
+ if ( response.post_id ) {
+ api( 'nav_menus_created_posts' ).set(
+ api( 'nav_menus_created_posts' ).get().concat( [ response.post_id ] )
+ );
+
+ if ( 'page' === params.post_type ) {
+
+ // Activate static front page controls as this could be the first page created.
+ if ( api.section.has( 'static_front_page' ) ) {
+ api.section( 'static_front_page' ).activate();
+ }
+
+ // Add new page to dropdown-pages controls.
+ api.control.each( function( control ) {
+ var select;
+ if ( 'dropdown-pages' === control.params.type ) {
+ select = control.container.find( 'select[name^="_customize-dropdown-pages-"]' );
+ select.append( new Option( params.post_title, response.post_id ) );
+ }
+ } );
+ }
+ deferred.resolve( response );
+ }
+ } );
+
+ request.fail( function( response ) {
+ var error = response || '';
+
+ if ( 'undefined' !== typeof response.message ) {
+ error = response.message;
+ }
+
+ console.error( error );
+ deferred.rejectWith( error );
+ } );
+
+ return deferred.promise();
+ };
+
+ api.Menus.AvailableMenuItemsPanelView = wp.Backbone.View.extend(/** @lends wp.customize.Menus.AvailableMenuItemsPanelView.prototype */{
+
+ el: '#available-menu-items',
+
+ events: {
+ 'input #menu-items-search': 'debounceSearch',
+ 'focus .menu-item-tpl': 'focus',
+ 'click .menu-item-tpl': '_submit',
+ 'click #custom-menu-item-submit': '_submitLink',
+ 'keypress #custom-menu-item-name': '_submitLink',
+ 'click .new-content-item .add-content': '_submitNew',
+ 'keypress .create-item-input': '_submitNew',
+ 'keydown': 'keyboardAccessible'
+ },
+
+ // Cache current selected menu item.
+ selected: null,
+
+ // Cache menu control that opened the panel.
+ currentMenuControl: null,
+ debounceSearch: null,
+ $search: null,
+ $clearResults: null,
+ searchTerm: '',
+ rendered: false,
+ pages: {},
+ sectionContent: '',
+ loading: false,
+ addingNew: false,
+
+ /**
+ * wp.customize.Menus.AvailableMenuItemsPanelView
+ *
+ * View class for the available menu items panel.
+ *
+ * @constructs wp.customize.Menus.AvailableMenuItemsPanelView
+ * @augments wp.Backbone.View
+ */
+ initialize: function() {
+ var self = this;
+
+ if ( ! api.panel.has( 'nav_menus' ) ) {
+ return;
+ }
+
+ this.$search = $( '#menu-items-search' );
+ this.$clearResults = this.$el.find( '.clear-results' );
+ this.sectionContent = this.$el.find( '.available-menu-items-list' );
+
+ this.debounceSearch = _.debounce( self.search, 500 );
+
+ _.bindAll( this, 'close' );
+
+ // If the available menu items panel is open and the customize controls are
+ // interacted with (other than an item being deleted), then close the
+ // available menu items panel. Also close on back button click.
+ $( '#customize-controls, .customize-section-back' ).on( 'click keydown', function( e ) {
+ var isDeleteBtn = $( e.target ).is( '.item-delete, .item-delete *' ),
+ isAddNewBtn = $( e.target ).is( '.add-new-menu-item, .add-new-menu-item *' );
+ if ( $( 'body' ).hasClass( 'adding-menu-items' ) && ! isDeleteBtn && ! isAddNewBtn ) {
+ self.close();
+ }
+ } );
+
+ // Clear the search results and trigger a `keyup` event to fire a new search.
+ this.$clearResults.on( 'click', function() {
+ self.$search.val( '' ).focus().trigger( 'keyup' );
+ } );
+
+ this.$el.on( 'input', '#custom-menu-item-name.invalid, #custom-menu-item-url.invalid', function() {
+ $( this ).removeClass( 'invalid' );
+ });
+
+ // Load available items if it looks like we'll need them.
+ api.panel( 'nav_menus' ).container.bind( 'expanded', function() {
+ if ( ! self.rendered ) {
+ self.initList();
+ self.rendered = true;
+ }
+ });
+
+ // Load more items.
+ this.sectionContent.scroll( function() {
+ var totalHeight = self.$el.find( '.accordion-section.open .available-menu-items-list' ).prop( 'scrollHeight' ),
+ visibleHeight = self.$el.find( '.accordion-section.open' ).height();
+
+ if ( ! self.loading && $( this ).scrollTop() > 3 / 4 * totalHeight - visibleHeight ) {
+ var type = $( this ).data( 'type' ),
+ object = $( this ).data( 'object' );
+
+ if ( 'search' === type ) {
+ if ( self.searchTerm ) {
+ self.doSearch( self.pages.search );
+ }
+ } else {
+ self.loadItems( [
+ { type: type, object: object }
+ ] );
+ }
+ }
+ });
+
+ // Close the panel if the URL in the preview changes
+ api.previewer.bind( 'url', this.close );
+
+ self.delegateEvents();
+ },
+
+ // Search input change handler.
+ search: function( event ) {
+ var $searchSection = $( '#available-menu-items-search' ),
+ $otherSections = $( '#available-menu-items .accordion-section' ).not( $searchSection );
+
+ if ( ! event ) {
+ return;
+ }
+
+ if ( this.searchTerm === event.target.value ) {
+ return;
+ }
+
+ if ( '' !== event.target.value && ! $searchSection.hasClass( 'open' ) ) {
+ $otherSections.fadeOut( 100 );
+ $searchSection.find( '.accordion-section-content' ).slideDown( 'fast' );
+ $searchSection.addClass( 'open' );
+ this.$clearResults.addClass( 'is-visible' );
+ } else if ( '' === event.target.value ) {
+ $searchSection.removeClass( 'open' );
+ $otherSections.show();
+ this.$clearResults.removeClass( 'is-visible' );
+ }
+
+ this.searchTerm = event.target.value;
+ this.pages.search = 1;
+ this.doSearch( 1 );
+ },
+
+ // Get search results.
+ doSearch: function( page ) {
+ var self = this, params,
+ $section = $( '#available-menu-items-search' ),
+ $content = $section.find( '.accordion-section-content' ),
+ itemTemplate = wp.template( 'available-menu-item' );
+
+ if ( self.currentRequest ) {
+ self.currentRequest.abort();
+ }
+
+ if ( page < 0 ) {
+ return;
+ } else if ( page > 1 ) {
+ $section.addClass( 'loading-more' );
+ $content.attr( 'aria-busy', 'true' );
+ wp.a11y.speak( api.Menus.data.l10n.itemsLoadingMore );
+ } else if ( '' === self.searchTerm ) {
+ $content.html( '' );
+ wp.a11y.speak( '' );
+ return;
+ }
+
+ $section.addClass( 'loading' );
+ self.loading = true;
+
+ params = api.previewer.query( { excludeCustomizedSaved: true } );
+ _.extend( params, {
+ 'customize-menus-nonce': api.settings.nonce['customize-menus'],
+ 'wp_customize': 'on',
+ 'search': self.searchTerm,
+ 'page': page
+ } );
+
+ self.currentRequest = wp.ajax.post( 'search-available-menu-items-customizer', params );
+
+ self.currentRequest.done(function( data ) {
+ var items;
+ if ( 1 === page ) {
+ // Clear previous results as it's a new search.
+ $content.empty();
+ }
+ $section.removeClass( 'loading loading-more' );
+ $content.attr( 'aria-busy', 'false' );
+ $section.addClass( 'open' );
+ self.loading = false;
+ items = new api.Menus.AvailableItemCollection( data.items );
+ self.collection.add( items.models );
+ items.each( function( menuItem ) {
+ $content.append( itemTemplate( menuItem.attributes ) );
+ } );
+ if ( 20 > items.length ) {
+ self.pages.search = -1; // Up to 20 posts and 20 terms in results, if <20, no more results for either.
+ } else {
+ self.pages.search = self.pages.search + 1;
+ }
+ if ( items && page > 1 ) {
+ wp.a11y.speak( api.Menus.data.l10n.itemsFoundMore.replace( '%d', items.length ) );
+ } else if ( items && page === 1 ) {
+ wp.a11y.speak( api.Menus.data.l10n.itemsFound.replace( '%d', items.length ) );
+ }
+ });
+
+ self.currentRequest.fail(function( data ) {
+ // data.message may be undefined, for example when typing slow and the request is aborted.
+ if ( data.message ) {
+ $content.empty().append( $( '<li class="nothing-found"></li>' ).text( data.message ) );
+ wp.a11y.speak( data.message );
+ }
+ self.pages.search = -1;
+ });
+
+ self.currentRequest.always(function() {
+ $section.removeClass( 'loading loading-more' );
+ $content.attr( 'aria-busy', 'false' );
+ self.loading = false;
+ self.currentRequest = null;
+ });
+ },
+
+ // Render the individual items.
+ initList: function() {
+ var self = this;
+
+ // Render the template for each item by type.
+ _.each( api.Menus.data.itemTypes, function( itemType ) {
+ self.pages[ itemType.type + ':' + itemType.object ] = 0;
+ } );
+ self.loadItems( api.Menus.data.itemTypes );
+ },
+
+ /**
+ * Load available nav menu items.
+ *
+ * @since 4.3.0
+ * @since 4.7.0 Changed function signature to take list of item types instead of single type/object.
+ * @access private
+ *
+ * @param {Array.<object>} itemTypes List of objects containing type and key.
+ * @param {string} deprecated Formerly the object parameter.
+ * @returns {void}
+ */
+ loadItems: function( itemTypes, deprecated ) {
+ var self = this, _itemTypes, requestItemTypes = [], params, request, itemTemplate, availableMenuItemContainers = {};
+ itemTemplate = wp.template( 'available-menu-item' );
+
+ if ( _.isString( itemTypes ) && _.isString( deprecated ) ) {
+ _itemTypes = [ { type: itemTypes, object: deprecated } ];
+ } else {
+ _itemTypes = itemTypes;
+ }
+
+ _.each( _itemTypes, function( itemType ) {
+ var container, name = itemType.type + ':' + itemType.object;
+ if ( -1 === self.pages[ name ] ) {
+ return; // Skip types for which there are no more results.
+ }
+ container = $( '#available-menu-items-' + itemType.type + '-' + itemType.object );
+ container.find( '.accordion-section-title' ).addClass( 'loading' );
+ availableMenuItemContainers[ name ] = container;
+
+ requestItemTypes.push( {
+ object: itemType.object,
+ type: itemType.type,
+ page: self.pages[ name ]
+ } );
+ } );
+
+ if ( 0 === requestItemTypes.length ) {
+ return;
+ }
+
+ self.loading = true;
+
+ params = api.previewer.query( { excludeCustomizedSaved: true } );
+ _.extend( params, {
+ 'customize-menus-nonce': api.settings.nonce['customize-menus'],
+ 'wp_customize': 'on',
+ 'item_types': requestItemTypes
+ } );
+
+ request = wp.ajax.post( 'load-available-menu-items-customizer', params );
+
+ request.done(function( data ) {
+ var typeInner;
+ _.each( data.items, function( typeItems, name ) {
+ if ( 0 === typeItems.length ) {
+ if ( 0 === self.pages[ name ] ) {
+ availableMenuItemContainers[ name ].find( '.accordion-section-title' )
+ .addClass( 'cannot-expand' )
+ .removeClass( 'loading' )
+ .find( '.accordion-section-title > button' )
+ .prop( 'tabIndex', -1 );
+ }
+ self.pages[ name ] = -1;
+ return;
+ } else if ( ( 'post_type:page' === name ) && ( ! availableMenuItemContainers[ name ].hasClass( 'open' ) ) ) {
+ availableMenuItemContainers[ name ].find( '.accordion-section-title > button' ).click();
+ }
+ typeItems = new api.Menus.AvailableItemCollection( typeItems ); // @todo Why is this collection created and then thrown away?
+ self.collection.add( typeItems.models );
+ typeInner = availableMenuItemContainers[ name ].find( '.available-menu-items-list' );
+ typeItems.each( function( menuItem ) {
+ typeInner.append( itemTemplate( menuItem.attributes ) );
+ } );
+ self.pages[ name ] += 1;
+ });
+ });
+ request.fail(function( data ) {
+ if ( typeof console !== 'undefined' && console.error ) {
+ console.error( data );
+ }
+ });
+ request.always(function() {
+ _.each( availableMenuItemContainers, function( container ) {
+ container.find( '.accordion-section-title' ).removeClass( 'loading' );
+ } );
+ self.loading = false;
+ });
+ },
+
+ // Adjust the height of each section of items to fit the screen.
+ itemSectionHeight: function() {
+ var sections, lists, totalHeight, accordionHeight, diff;
+ totalHeight = window.innerHeight;
+ sections = this.$el.find( '.accordion-section:not( #available-menu-items-search ) .accordion-section-content' );
+ lists = this.$el.find( '.accordion-section:not( #available-menu-items-search ) .available-menu-items-list:not(":only-child")' );
+ accordionHeight = 46 * ( 1 + sections.length ) + 14; // Magic numbers.
+ diff = totalHeight - accordionHeight;
+ if ( 120 < diff && 290 > diff ) {
+ sections.css( 'max-height', diff );
+ lists.css( 'max-height', ( diff - 60 ) );
+ }
+ },
+
+ // Highlights a menu item.
+ select: function( menuitemTpl ) {
+ this.selected = $( menuitemTpl );
+ this.selected.siblings( '.menu-item-tpl' ).removeClass( 'selected' );
+ this.selected.addClass( 'selected' );
+ },
+
+ // Highlights a menu item on focus.
+ focus: function( event ) {
+ this.select( $( event.currentTarget ) );
+ },
+
+ // Submit handler for keypress and click on menu item.
+ _submit: function( event ) {
+ // Only proceed with keypress if it is Enter or Spacebar
+ if ( 'keypress' === event.type && ( 13 !== event.which && 32 !== event.which ) ) {
+ return;
+ }
+
+ this.submit( $( event.currentTarget ) );
+ },
+
+ // Adds a selected menu item to the menu.
+ submit: function( menuitemTpl ) {
+ var menuitemId, menu_item;
+
+ if ( ! menuitemTpl ) {
+ menuitemTpl = this.selected;
+ }
+
+ if ( ! menuitemTpl || ! this.currentMenuControl ) {
+ return;
+ }
+
+ this.select( menuitemTpl );
+
+ menuitemId = $( this.selected ).data( 'menu-item-id' );
+ menu_item = this.collection.findWhere( { id: menuitemId } );
+ if ( ! menu_item ) {
+ return;
+ }
+
+ this.currentMenuControl.addItemToMenu( menu_item.attributes );
+
+ $( menuitemTpl ).find( '.menu-item-handle' ).addClass( 'item-added' );
+ },
+
+ // Submit handler for keypress and click on custom menu item.
+ _submitLink: function( event ) {
+ // Only proceed with keypress if it is Enter.
+ if ( 'keypress' === event.type && 13 !== event.which ) {
+ return;
+ }
+
+ this.submitLink();
+ },
+
+ // Adds the custom menu item to the menu.
+ submitLink: function() {
+ var menuItem,
+ itemName = $( '#custom-menu-item-name' ),
+ itemUrl = $( '#custom-menu-item-url' ),
+ url = itemUrl.val().trim(),
+ urlRegex;
+
+ if ( ! this.currentMenuControl ) {
+ return;
+ }
+
+ /*
+ * Allow URLs including:
+ * - http://example.com/
+ * - //example.com
+ * - /directory/
+ * - ?query-param
+ * - #target
+ * - mailto:foo@example.com
+ *
+ * Any further validation will be handled on the server when the setting is attempted to be saved,
+ * so this pattern does not need to be complete.
+ */
+ urlRegex = /^((\w+:)?\/\/\w.*|\w+:(?!\/\/$)|\/|\?|#)/;
+
+ if ( '' === itemName.val() ) {
+ itemName.addClass( 'invalid' );
+ return;
+ } else if ( ! urlRegex.test( url ) ) {
+ itemUrl.addClass( 'invalid' );
+ return;
+ }
+
+ menuItem = {
+ 'title': itemName.val(),
+ 'url': url,
+ 'type': 'custom',
+ 'type_label': api.Menus.data.l10n.custom_label,
+ 'object': 'custom'
+ };
+
+ this.currentMenuControl.addItemToMenu( menuItem );
+
+ // Reset the custom link form.
+ itemUrl.val( 'http://' );
+ itemName.val( '' );
+ },
+
+ /**
+ * Submit handler for keypress (enter) on field and click on button.
+ *
+ * @since 4.7.0
+ * @private
+ *
+ * @param {jQuery.Event} event Event.
+ * @returns {void}
+ */
+ _submitNew: function( event ) {
+ var container;
+
+ // Only proceed with keypress if it is Enter.
+ if ( 'keypress' === event.type && 13 !== event.which ) {
+ return;
+ }
+
+ if ( this.addingNew ) {
+ return;
+ }
+
+ container = $( event.target ).closest( '.accordion-section' );
+
+ this.submitNew( container );
+ },
+
+ /**
+ * Creates a new object and adds an associated menu item to the menu.
+ *
+ * @since 4.7.0
+ * @private
+ *
+ * @param {jQuery} container
+ * @returns {void}
+ */
+ submitNew: function( container ) {
+ var panel = this,
+ itemName = container.find( '.create-item-input' ),
+ title = itemName.val(),
+ dataContainer = container.find( '.available-menu-items-list' ),
+ itemType = dataContainer.data( 'type' ),
+ itemObject = dataContainer.data( 'object' ),
+ itemTypeLabel = dataContainer.data( 'type_label' ),
+ promise;
+
+ if ( ! this.currentMenuControl ) {
+ return;
+ }
+
+ // Only posts are supported currently.
+ if ( 'post_type' !== itemType ) {
+ return;
+ }
+
+ if ( '' === $.trim( itemName.val() ) ) {
+ itemName.addClass( 'invalid' );
+ itemName.focus();
+ return;
+ } else {
+ itemName.removeClass( 'invalid' );
+ container.find( '.accordion-section-title' ).addClass( 'loading' );
+ }
+
+ panel.addingNew = true;
+ itemName.attr( 'disabled', 'disabled' );
+ promise = api.Menus.insertAutoDraftPost( {
+ post_title: title,
+ post_type: itemObject
+ } );
+ promise.done( function( data ) {
+ var availableItem, $content, itemElement;
+ availableItem = new api.Menus.AvailableItemModel( {
+ 'id': 'post-' + data.post_id, // Used for available menu item Backbone models.
+ 'title': itemName.val(),
+ 'type': itemType,
+ 'type_label': itemTypeLabel,
+ 'object': itemObject,
+ 'object_id': data.post_id,
+ 'url': data.url
+ } );
+
+ // Add new item to menu.
+ panel.currentMenuControl.addItemToMenu( availableItem.attributes );
+
+ // Add the new item to the list of available items.
+ api.Menus.availableMenuItemsPanel.collection.add( availableItem );
+ $content = container.find( '.available-menu-items-list' );
+ itemElement = $( wp.template( 'available-menu-item' )( availableItem.attributes ) );
+ itemElement.find( '.menu-item-handle:first' ).addClass( 'item-added' );
+ $content.prepend( itemElement );
+ $content.scrollTop();
+
+ // Reset the create content form.
+ itemName.val( '' ).removeAttr( 'disabled' );
+ panel.addingNew = false;
+ container.find( '.accordion-section-title' ).removeClass( 'loading' );
+ } );
+ },
+
+ // Opens the panel.
+ open: function( menuControl ) {
+ var panel = this, close;
+
+ this.currentMenuControl = menuControl;
+
+ this.itemSectionHeight();
+
+ if ( api.section.has( 'publish_settings' ) ) {
+ api.section( 'publish_settings' ).collapse();
+ }
+
+ $( 'body' ).addClass( 'adding-menu-items' );
+
+ close = function() {
+ panel.close();
+ $( this ).off( 'click', close );
+ };
+ $( '#customize-preview' ).on( 'click', close );
+
+ // Collapse all controls.
+ _( this.currentMenuControl.getMenuItemControls() ).each( function( control ) {
+ control.collapseForm();
+ } );
+
+ this.$el.find( '.selected' ).removeClass( 'selected' );
+
+ this.$search.focus();
+ },
+
+ // Closes the panel
+ close: function( options ) {
+ options = options || {};
+
+ if ( options.returnFocus && this.currentMenuControl ) {
+ this.currentMenuControl.container.find( '.add-new-menu-item' ).focus();
+ }
+
+ this.currentMenuControl = null;
+ this.selected = null;
+
+ $( 'body' ).removeClass( 'adding-menu-items' );
+ $( '#available-menu-items .menu-item-handle.item-added' ).removeClass( 'item-added' );
+
+ this.$search.val( '' ).trigger( 'keyup' );
+ },
+
+ // Add a few keyboard enhancements to the panel.
+ keyboardAccessible: function( event ) {
+ var isEnter = ( 13 === event.which ),
+ isEsc = ( 27 === event.which ),
+ isBackTab = ( 9 === event.which && event.shiftKey ),
+ isSearchFocused = $( event.target ).is( this.$search );
+
+ // If enter pressed but nothing entered, don't do anything
+ if ( isEnter && ! this.$search.val() ) {
+ return;
+ }
+
+ if ( isSearchFocused && isBackTab ) {
+ this.currentMenuControl.container.find( '.add-new-menu-item' ).focus();
+ event.preventDefault(); // Avoid additional back-tab.
+ } else if ( isEsc ) {
+ this.close( { returnFocus: true } );
+ }
+ }
+ });
+
+ /**
+ * wp.customize.Menus.MenusPanel
+ *
+ * Customizer panel for menus. This is used only for screen options management.
+ * Note that 'menus' must match the WP_Customize_Menu_Panel::$type.
+ *
+ * @class wp.customize.Menus.MenusPanel
+ * @augments wp.customize.Panel
+ */
+ api.Menus.MenusPanel = api.Panel.extend(/** @lends wp.customize.Menus.MenusPanel.prototype */{
+
+ attachEvents: function() {
+ api.Panel.prototype.attachEvents.call( this );
+
+ var panel = this,
+ panelMeta = panel.container.find( '.panel-meta' ),
+ help = panelMeta.find( '.customize-help-toggle' ),
+ content = panelMeta.find( '.customize-panel-description' ),
+ options = $( '#screen-options-wrap' ),
+ button = panelMeta.find( '.customize-screen-options-toggle' );
+ button.on( 'click keydown', function( event ) {
+ if ( api.utils.isKeydownButNotEnterEvent( event ) ) {
+ return;
+ }
+ event.preventDefault();
+
+ // Hide description
+ if ( content.not( ':hidden' ) ) {
+ content.slideUp( 'fast' );
+ help.attr( 'aria-expanded', 'false' );
+ }
+
+ if ( 'true' === button.attr( 'aria-expanded' ) ) {
+ button.attr( 'aria-expanded', 'false' );
+ panelMeta.removeClass( 'open' );
+ panelMeta.removeClass( 'active-menu-screen-options' );
+ options.slideUp( 'fast' );
+ } else {
+ button.attr( 'aria-expanded', 'true' );
+ panelMeta.addClass( 'open' );
+ panelMeta.addClass( 'active-menu-screen-options' );
+ options.slideDown( 'fast' );
+ }
+
+ return false;
+ } );
+
+ // Help toggle
+ help.on( 'click keydown', function( event ) {
+ if ( api.utils.isKeydownButNotEnterEvent( event ) ) {
+ return;
+ }
+ event.preventDefault();
+
+ if ( 'true' === button.attr( 'aria-expanded' ) ) {
+ button.attr( 'aria-expanded', 'false' );
+ help.attr( 'aria-expanded', 'true' );
+ panelMeta.addClass( 'open' );
+ panelMeta.removeClass( 'active-menu-screen-options' );
+ options.slideUp( 'fast' );
+ content.slideDown( 'fast' );
+ }
+ } );
+ },
+
+ /**
+ * Update field visibility when clicking on the field toggles.
+ */
+ ready: function() {
+ var panel = this;
+ panel.container.find( '.hide-column-tog' ).click( function() {
+ panel.saveManageColumnsState();
+ });
+
+ // Inject additional heading into the menu locations section's head container.
+ api.section( 'menu_locations', function( section ) {
+ section.headContainer.prepend(
+ wp.template( 'nav-menu-locations-header' )( api.Menus.data )
+ );
+ } );
+ },
+
+ /**
+ * Save hidden column states.
+ *
+ * @since 4.3.0
+ * @private
+ *
+ * @returns {void}
+ */
+ saveManageColumnsState: _.debounce( function() {
+ var panel = this;
+ if ( panel._updateHiddenColumnsRequest ) {
+ panel._updateHiddenColumnsRequest.abort();
+ }
+
+ panel._updateHiddenColumnsRequest = wp.ajax.post( 'hidden-columns', {
+ hidden: panel.hidden(),
+ screenoptionnonce: $( '#screenoptionnonce' ).val(),
+ page: 'nav-menus'
+ } );
+ panel._updateHiddenColumnsRequest.always( function() {
+ panel._updateHiddenColumnsRequest = null;
+ } );
+ }, 2000 ),
+
+ /**
+ * @deprecated Since 4.7.0 now that the nav_menu sections are responsible for toggling the classes on their own containers.
+ */
+ checked: function() {},
+
+ /**
+ * @deprecated Since 4.7.0 now that the nav_menu sections are responsible for toggling the classes on their own containers.
+ */
+ unchecked: function() {},
+
+ /**
+ * Get hidden fields.
+ *
+ * @since 4.3.0
+ * @private
+ *
+ * @returns {Array} Fields (columns) that are hidden.
+ */
+ hidden: function() {
+ return $( '.hide-column-tog' ).not( ':checked' ).map( function() {
+ var id = this.id;
+ return id.substring( 0, id.length - 5 );
+ }).get().join( ',' );
+ }
+ } );
+
+ /**
+ * wp.customize.Menus.MenuSection
+ *
+ * Customizer section for menus. This is used only for lazy-loading child controls.
+ * Note that 'nav_menu' must match the WP_Customize_Menu_Section::$type.
+ *
+ * @class wp.customize.Menus.MenuSection
+ * @augments wp.customize.Section
+ */
+ api.Menus.MenuSection = api.Section.extend(/** @lends wp.customize.Menus.MenuSection.prototype */{
+
+ /**
+ * Initialize.
+ *
+ * @since 4.3.0
+ *
+ * @param {String} id
+ * @param {Object} options
+ */
+ initialize: function( id, options ) {
+ var section = this;
+ api.Section.prototype.initialize.call( section, id, options );
+ section.deferred.initSortables = $.Deferred();
+ },
+
+ /**
+ * Ready.
+ */
+ ready: function() {
+ var section = this, fieldActiveToggles, handleFieldActiveToggle;
+
+ if ( 'undefined' === typeof section.params.menu_id ) {
+ throw new Error( 'params.menu_id was not defined' );
+ }
+
+ /*
+ * Since newly created sections won't be registered in PHP, we need to prevent the
+ * preview's sending of the activeSections to result in this control
+ * being deactivated when the preview refreshes. So we can hook onto
+ * the setting that has the same ID and its presence can dictate
+ * whether the section is active.
+ */
+ section.active.validate = function() {
+ if ( ! api.has( section.id ) ) {
+ return false;
+ }
+ return !! api( section.id ).get();
+ };
+
+ section.populateControls();
+
+ section.navMenuLocationSettings = {};
+ section.assignedLocations = new api.Value( [] );
+
+ api.each(function( setting, id ) {
+ var matches = id.match( /^nav_menu_locations\[(.+?)]/ );
+ if ( matches ) {
+ section.navMenuLocationSettings[ matches[1] ] = setting;
+ setting.bind( function() {
+ section.refreshAssignedLocations();
+ });
+ }
+ });
+
+ section.assignedLocations.bind(function( to ) {
+ section.updateAssignedLocationsInSectionTitle( to );
+ });
+
+ section.refreshAssignedLocations();
+
+ api.bind( 'pane-contents-reflowed', function() {
+ // Skip menus that have been removed.
+ if ( ! section.contentContainer.parent().length ) {
+ return;
+ }
+ section.container.find( '.menu-item .menu-item-reorder-nav button' ).attr({ 'tabindex': '0', 'aria-hidden': 'false' });
+ section.container.find( '.menu-item.move-up-disabled .menus-move-up' ).attr({ 'tabindex': '-1', 'aria-hidden': 'true' });
+ section.container.find( '.menu-item.move-down-disabled .menus-move-down' ).attr({ 'tabindex': '-1', 'aria-hidden': 'true' });
+ section.container.find( '.menu-item.move-left-disabled .menus-move-left' ).attr({ 'tabindex': '-1', 'aria-hidden': 'true' });
+ section.container.find( '.menu-item.move-right-disabled .menus-move-right' ).attr({ 'tabindex': '-1', 'aria-hidden': 'true' });
+ } );
+
+ /**
+ * Update the active field class for the content container for a given checkbox toggle.
+ *
+ * @this {jQuery}
+ * @returns {void}
+ */
+ handleFieldActiveToggle = function() {
+ var className = 'field-' + $( this ).val() + '-active';
+ section.contentContainer.toggleClass( className, $( this ).prop( 'checked' ) );
+ };
+ fieldActiveToggles = api.panel( 'nav_menus' ).contentContainer.find( '.metabox-prefs:first' ).find( '.hide-column-tog' );
+ fieldActiveToggles.each( handleFieldActiveToggle );
+ fieldActiveToggles.on( 'click', handleFieldActiveToggle );
+ },
+
+ populateControls: function() {
+ var section = this,
+ menuNameControlId,
+ menuLocationsControlId,
+ menuAutoAddControlId,
+ menuDeleteControlId,
+ menuControl,
+ menuNameControl,
+ menuLocationsControl,
+ menuAutoAddControl,
+ menuDeleteControl;
+
+ // Add the control for managing the menu name.
+ menuNameControlId = section.id + '[name]';
+ menuNameControl = api.control( menuNameControlId );
+ if ( ! menuNameControl ) {
+ menuNameControl = new api.controlConstructor.nav_menu_name( menuNameControlId, {
+ type: 'nav_menu_name',
+ label: api.Menus.data.l10n.menuNameLabel,
+ section: section.id,
+ priority: 0,
+ settings: {
+ 'default': section.id
+ }
+ } );
+ api.control.add( menuNameControl );
+ menuNameControl.active.set( true );
+ }
+
+ // Add the menu control.
+ menuControl = api.control( section.id );
+ if ( ! menuControl ) {
+ menuControl = new api.controlConstructor.nav_menu( section.id, {
+ type: 'nav_menu',
+ section: section.id,
+ priority: 998,
+ settings: {
+ 'default': section.id
+ },
+ menu_id: section.params.menu_id
+ } );
+ api.control.add( menuControl );
+ menuControl.active.set( true );
+ }
+
+ // Add the menu locations control.
+ menuLocationsControlId = section.id + '[locations]';
+ menuLocationsControl = api.control( menuLocationsControlId );
+ if ( ! menuLocationsControl ) {
+ menuLocationsControl = new api.controlConstructor.nav_menu_locations( menuLocationsControlId, {
+ section: section.id,
+ priority: 999,
+ settings: {
+ 'default': section.id
+ },
+ menu_id: section.params.menu_id
+ } );
+ api.control.add( menuLocationsControl.id, menuLocationsControl );
+ menuControl.active.set( true );
+ }
+
+ // Add the control for managing the menu auto_add.
+ menuAutoAddControlId = section.id + '[auto_add]';
+ menuAutoAddControl = api.control( menuAutoAddControlId );
+ if ( ! menuAutoAddControl ) {
+ menuAutoAddControl = new api.controlConstructor.nav_menu_auto_add( menuAutoAddControlId, {
+ type: 'nav_menu_auto_add',
+ label: '',
+ section: section.id,
+ priority: 1000,
+ settings: {
+ 'default': section.id
+ }
+ } );
+ api.control.add( menuAutoAddControl );
+ menuAutoAddControl.active.set( true );
+ }
+
+ // Add the control for deleting the menu
+ menuDeleteControlId = section.id + '[delete]';
+ menuDeleteControl = api.control( menuDeleteControlId );
+ if ( ! menuDeleteControl ) {
+ menuDeleteControl = new api.Control( menuDeleteControlId, {
+ section: section.id,
+ priority: 1001,
+ templateId: 'nav-menu-delete-button'
+ } );
+ api.control.add( menuDeleteControl.id, menuDeleteControl );
+ menuDeleteControl.active.set( true );
+ menuDeleteControl.deferred.embedded.done( function () {
+ menuDeleteControl.container.find( 'button' ).on( 'click', function() {
+ var menuId = section.params.menu_id;
+ var menuControl = api.Menus.getMenuControl( menuId );
+ menuControl.setting.set( false );
+ });
+ } );
+ }
+ },
+
+ /**
+ *
+ */
+ refreshAssignedLocations: function() {
+ var section = this,
+ menuTermId = section.params.menu_id,
+ currentAssignedLocations = [];
+ _.each( section.navMenuLocationSettings, function( setting, themeLocation ) {
+ if ( setting() === menuTermId ) {
+ currentAssignedLocations.push( themeLocation );
+ }
+ });
+ section.assignedLocations.set( currentAssignedLocations );
+ },
+
+ /**
+ * @param {Array} themeLocationSlugs Theme location slugs.
+ */
+ updateAssignedLocationsInSectionTitle: function( themeLocationSlugs ) {
+ var section = this,
+ $title;
+
+ $title = section.container.find( '.accordion-section-title:first' );
+ $title.find( '.menu-in-location' ).remove();
+ _.each( themeLocationSlugs, function( themeLocationSlug ) {
+ var $label, locationName;
+ $label = $( '<span class="menu-in-location"></span>' );
+ locationName = api.Menus.data.locationSlugMappedToName[ themeLocationSlug ];
+ $label.text( api.Menus.data.l10n.menuLocation.replace( '%s', locationName ) );
+ $title.append( $label );
+ });
+
+ section.container.toggleClass( 'assigned-to-menu-location', 0 !== themeLocationSlugs.length );
+
+ },
+
+ onChangeExpanded: function( expanded, args ) {
+ var section = this, completeCallback;
+
+ if ( expanded ) {
+ wpNavMenu.menuList = section.contentContainer;
+ wpNavMenu.targetList = wpNavMenu.menuList;
+
+ // Add attributes needed by wpNavMenu
+ $( '#menu-to-edit' ).removeAttr( 'id' );
+ wpNavMenu.menuList.attr( 'id', 'menu-to-edit' ).addClass( 'menu' );
+
+ _.each( api.section( section.id ).controls(), function( control ) {
+ if ( 'nav_menu_item' === control.params.type ) {
+ control.actuallyEmbed();
+ }
+ } );
+
+ // Make sure Sortables is initialized after the section has been expanded to prevent `offset` issues.
+ if ( args.completeCallback ) {
+ completeCallback = args.completeCallback;
+ }
+ args.completeCallback = function() {
+ if ( 'resolved' !== section.deferred.initSortables.state() ) {
+ wpNavMenu.initSortables(); // Depends on menu-to-edit ID being set above.
+ section.deferred.initSortables.resolve( wpNavMenu.menuList ); // Now MenuControl can extend the sortable.
+
+ // @todo Note that wp.customize.reflowPaneContents() is debounced, so this immediate change will show a slight flicker while priorities get updated.
+ api.control( 'nav_menu[' + String( section.params.menu_id ) + ']' ).reflowMenuItems();
+ }
+ if ( _.isFunction( completeCallback ) ) {
+ completeCallback();
+ }
+ };
+ }
+ api.Section.prototype.onChangeExpanded.call( section, expanded, args );
+ },
+
+ /**
+ * Highlight how a user may create new menu items.
+ *
+ * This method reminds the user to create new menu items and how.
+ * It's exposed this way because this class knows best which UI needs
+ * highlighted but those expanding this section know more about why and
+ * when the affordance should be highlighted.
+ *
+ * @since 4.9.0
+ *
+ * @returns {void}
+ */
+ highlightNewItemButton: function() {
+ api.utils.highlightButton( this.contentContainer.find( '.add-new-menu-item' ), { delay: 2000 } );
+ }
+ });
+
+ /**
+ * Create a nav menu setting and section.
+ *
+ * @since 4.9.0
+ *
+ * @param {string} [name=''] Nav menu name.
+ * @returns {wp.customize.Menus.MenuSection} Added nav menu.
+ */
+ api.Menus.createNavMenu = function createNavMenu( name ) {
+ var customizeId, placeholderId, setting;
+ placeholderId = api.Menus.generatePlaceholderAutoIncrementId();
+
+ customizeId = 'nav_menu[' + String( placeholderId ) + ']';
+
+ // Register the menu control setting.
+ setting = api.create( customizeId, customizeId, {}, {
+ type: 'nav_menu',
+ transport: api.Menus.data.settingTransport,
+ previewer: api.previewer
+ } );
+ setting.set( $.extend(
+ {},
+ api.Menus.data.defaultSettingValues.nav_menu,
+ {
+ name: name || ''
+ }
+ ) );
+
+ /*
+ * Add the menu section (and its controls).
+ * Note that this will automatically create the required controls
+ * inside via the Section's ready method.
+ */
+ return api.section.add( new api.Menus.MenuSection( customizeId, {
+ panel: 'nav_menus',
+ title: displayNavMenuName( name ),
+ customizeAction: api.Menus.data.l10n.customizingMenus,
+ priority: 10,
+ menu_id: placeholderId
+ } ) );
+ };
+
+ /**
+ * wp.customize.Menus.NewMenuSection
+ *
+ * Customizer section for new menus.
+ *
+ * @class wp.customize.Menus.NewMenuSection
+ * @augments wp.customize.Section
+ */
+ api.Menus.NewMenuSection = api.Section.extend(/** @lends wp.customize.Menus.NewMenuSection.prototype */{
+
+ /**
+ * Add behaviors for the accordion section.
+ *
+ * @since 4.3.0
+ */
+ attachEvents: function() {
+ var section = this,
+ container = section.container,
+ contentContainer = section.contentContainer,
+ navMenuSettingPattern = /^nav_menu\[/;
+
+ section.headContainer.find( '.accordion-section-title' ).replaceWith(
+ wp.template( 'nav-menu-create-menu-section-title' )
+ );
+
+ /*
+ * We have to manually handle section expanded because we do not
+ * apply the `accordion-section-title` class to this button-driven section.
+ */
+ container.on( 'click', '.customize-add-menu-button', function() {
+ section.expand();
+ });
+
+ contentContainer.on( 'keydown', '.menu-name-field', function( event ) {
+ if ( 13 === event.which ) { // Enter.
+ section.submit();
+ }
+ } );
+ contentContainer.on( 'click', '#customize-new-menu-submit', function( event ) {
+ section.submit();
+ event.stopPropagation();
+ event.preventDefault();
+ } );
+
+ /**
+ * Get number of non-deleted nav menus.
+ *
+ * @since 4.9.0
+ * @returns {number} Count.
+ */
+ function getNavMenuCount() {
+ var count = 0;
+ api.each( function( setting ) {
+ if ( navMenuSettingPattern.test( setting.id ) && false !== setting.get() ) {
+ count += 1;
+ }
+ } );
+ return count;
+ }
+
+ /**
+ * Update visibility of notice to prompt users to create menus.
+ *
+ * @since 4.9.0
+ * @returns {void}
+ */
+ function updateNoticeVisibility() {
+ container.find( '.add-new-menu-notice' ).prop( 'hidden', getNavMenuCount() > 0 );
+ }
+
+ /**
+ * Handle setting addition.
+ *
+ * @since 4.9.0
+ * @param {wp.customize.Setting} setting - Added setting.
+ * @returns {void}
+ */
+ function addChangeEventListener( setting ) {
+ if ( navMenuSettingPattern.test( setting.id ) ) {
+ setting.bind( updateNoticeVisibility );
+ updateNoticeVisibility();
+ }
+ }
+
+ /**
+ * Handle setting removal.
+ *
+ * @since 4.9.0
+ * @param {wp.customize.Setting} setting - Removed setting.
+ * @returns {void}
+ */
+ function removeChangeEventListener( setting ) {
+ if ( navMenuSettingPattern.test( setting.id ) ) {
+ setting.unbind( updateNoticeVisibility );
+ updateNoticeVisibility();
+ }
+ }
+
+ api.each( addChangeEventListener );
+ api.bind( 'add', addChangeEventListener );
+ api.bind( 'removed', removeChangeEventListener );
+ updateNoticeVisibility();
+
+ api.Section.prototype.attachEvents.apply( section, arguments );
+ },
+
+ /**
+ * Set up the control.
+ *
+ * @since 4.9.0
+ */
+ ready: function() {
+ this.populateControls();
+ },
+
+ /**
+ * Create the controls for this section.
+ *
+ * @since 4.9.0
+ */
+ populateControls: function() {
+ var section = this,
+ menuNameControlId,
+ menuLocationsControlId,
+ newMenuSubmitControlId,
+ menuNameControl,
+ menuLocationsControl,
+ newMenuSubmitControl;
+
+ menuNameControlId = section.id + '[name]';
+ menuNameControl = api.control( menuNameControlId );
+ if ( ! menuNameControl ) {
+ menuNameControl = new api.controlConstructor.nav_menu_name( menuNameControlId, {
+ label: api.Menus.data.l10n.menuNameLabel,
+ description: api.Menus.data.l10n.newMenuNameDescription,
+ section: section.id,
+ priority: 0
+ } );
+ api.control.add( menuNameControl.id, menuNameControl );
+ menuNameControl.active.set( true );
+ }
+
+ menuLocationsControlId = section.id + '[locations]';
+ menuLocationsControl = api.control( menuLocationsControlId );
+ if ( ! menuLocationsControl ) {
+ menuLocationsControl = new api.controlConstructor.nav_menu_locations( menuLocationsControlId, {
+ section: section.id,
+ priority: 1,
+ menu_id: '',
+ isCreating: true
+ } );
+ api.control.add( menuLocationsControlId, menuLocationsControl );
+ menuLocationsControl.active.set( true );
+ }
+
+ newMenuSubmitControlId = section.id + '[submit]';
+ newMenuSubmitControl = api.control( newMenuSubmitControlId );
+ if ( !newMenuSubmitControl ) {
+ newMenuSubmitControl = new api.Control( newMenuSubmitControlId, {
+ section: section.id,
+ priority: 1,
+ templateId: 'nav-menu-submit-new-button'
+ } );
+ api.control.add( newMenuSubmitControlId, newMenuSubmitControl );
+ newMenuSubmitControl.active.set( true );
+ }
+ },
+
+ /**
+ * Create the new menu with name and location supplied by the user.
+ *
+ * @since 4.9.0
+ */
+ submit: function() {
+ var section = this,
+ contentContainer = section.contentContainer,
+ nameInput = contentContainer.find( '.menu-name-field' ).first(),
+ name = nameInput.val(),
+ menuSection;
+
+ if ( ! name ) {
+ nameInput.addClass( 'invalid' );
+ nameInput.focus();
+ return;
+ }
+
+ menuSection = api.Menus.createNavMenu( name );
+
+ // Clear name field.
+ nameInput.val( '' );
+ nameInput.removeClass( 'invalid' );
+
+ contentContainer.find( '.assigned-menu-location input[type=checkbox]' ).each( function() {
+ var checkbox = $( this ),
+ navMenuLocationSetting;
+
+ if ( checkbox.prop( 'checked' ) ) {
+ navMenuLocationSetting = api( 'nav_menu_locations[' + checkbox.data( 'location-id' ) + ']' );
+ navMenuLocationSetting.set( menuSection.params.menu_id );
+
+ // Reset state for next new menu
+ checkbox.prop( 'checked', false );
+ }
+ } );
+
+ wp.a11y.speak( api.Menus.data.l10n.menuAdded );
+
+ // Focus on the new menu section.
+ menuSection.focus( {
+ completeCallback: function() {
+ menuSection.highlightNewItemButton();
+ }
+ } );
+ },
+
+ /**
+ * Select a default location.
+ *
+ * This method selects a single location by default so we can support
+ * creating a menu for a specific menu location.
+ *
+ * @since 4.9.0
+ *
+ * @param {string|null} locationId - The ID of the location to select. `null` clears all selections.
+ * @returns {void}
+ */
+ selectDefaultLocation: function( locationId ) {
+ var locationControl = api.control( this.id + '[locations]' ),
+ locationSelections = {};
+
+ if ( locationId !== null ) {
+ locationSelections[ locationId ] = true;
+ }
+
+ locationControl.setSelections( locationSelections );
+ }
+ });
+
+ /**
+ * wp.customize.Menus.MenuLocationControl
+ *
+ * Customizer control for menu locations (rendered as a <select>).
+ * Note that 'nav_menu_location' must match the WP_Customize_Nav_Menu_Location_Control::$type.
+ *
+ * @class wp.customize.Menus.MenuLocationControl
+ * @augments wp.customize.Control
+ */
+ api.Menus.MenuLocationControl = api.Control.extend(/** @lends wp.customize.Menus.MenuLocationControl.prototype */{
+ initialize: function( id, options ) {
+ var control = this,
+ matches = id.match( /^nav_menu_locations\[(.+?)]/ );
+ control.themeLocation = matches[1];
+ api.Control.prototype.initialize.call( control, id, options );
+ },
+
+ ready: function() {
+ var control = this, navMenuIdRegex = /^nav_menu\[(-?\d+)]/;
+
+ // @todo It would be better if this was added directly on the setting itself, as opposed to the control.
+ control.setting.validate = function( value ) {
+ if ( '' === value ) {
+ return 0;
+ } else {
+ return parseInt( value, 10 );
+ }
+ };
+
+ // Create and Edit menu buttons.
+ control.container.find( '.create-menu' ).on( 'click', function() {
+ var addMenuSection = api.section( 'add_menu' );
+ addMenuSection.selectDefaultLocation( this.dataset.locationId );
+ addMenuSection.focus();
+ } );
+ control.container.find( '.edit-menu' ).on( 'click', function() {
+ var menuId = control.setting();
+ api.section( 'nav_menu[' + menuId + ']' ).focus();
+ });
+ control.setting.bind( 'change', function() {
+ var menuIsSelected = 0 !== control.setting();
+ control.container.find( '.create-menu' ).toggleClass( 'hidden', menuIsSelected );
+ control.container.find( '.edit-menu' ).toggleClass( 'hidden', ! menuIsSelected );
+ });
+
+ // Add/remove menus from the available options when they are added and removed.
+ api.bind( 'add', function( setting ) {
+ var option, menuId, matches = setting.id.match( navMenuIdRegex );
+ if ( ! matches || false === setting() ) {
+ return;
+ }
+ menuId = matches[1];
+ option = new Option( displayNavMenuName( setting().name ), menuId );
+ control.container.find( 'select' ).append( option );
+ });
+ api.bind( 'remove', function( setting ) {
+ var menuId, matches = setting.id.match( navMenuIdRegex );
+ if ( ! matches ) {
+ return;
+ }
+ menuId = parseInt( matches[1], 10 );
+ if ( control.setting() === menuId ) {
+ control.setting.set( '' );
+ }
+ control.container.find( 'option[value=' + menuId + ']' ).remove();
+ });
+ api.bind( 'change', function( setting ) {
+ var menuId, matches = setting.id.match( navMenuIdRegex );
+ if ( ! matches ) {
+ return;
+ }
+ menuId = parseInt( matches[1], 10 );
+ if ( false === setting() ) {
+ if ( control.setting() === menuId ) {
+ control.setting.set( '' );
+ }
+ control.container.find( 'option[value=' + menuId + ']' ).remove();
+ } else {
+ control.container.find( 'option[value=' + menuId + ']' ).text( displayNavMenuName( setting().name ) );
+ }
+ });
+ }
+ });
+
+ api.Menus.MenuItemControl = api.Control.extend(/** @lends wp.customize.Menus.MenuItemControl.prototype */{
+
+ /**
+ * wp.customize.Menus.MenuItemControl
+ *
+ * Customizer control for menu items.
+ * Note that 'menu_item' must match the WP_Customize_Menu_Item_Control::$type.
+ *
+ * @constructs wp.customize.Menus.MenuItemControl
+ * @augments wp.customize.Control
+ *
+ * @inheritDoc
+ */
+ initialize: function( id, options ) {
+ var control = this;
+ control.expanded = new api.Value( false );
+ control.expandedArgumentsQueue = [];
+ control.expanded.bind( function( expanded ) {
+ var args = control.expandedArgumentsQueue.shift();
+ args = $.extend( {}, control.defaultExpandedArguments, args );
+ control.onChangeExpanded( expanded, args );
+ });
+ api.Control.prototype.initialize.call( control, id, options );
+ control.active.validate = function() {
+ var value, section = api.section( control.section() );
+ if ( section ) {
+ value = section.active();
+ } else {
+ value = false;
+ }
+ return value;
+ };
+ },
+
+ /**
+ * Override the embed() method to do nothing,
+ * so that the control isn't embedded on load,
+ * unless the containing section is already expanded.
+ *
+ * @since 4.3.0
+ */
+ embed: function() {
+ var control = this,
+ sectionId = control.section(),
+ section;
+ if ( ! sectionId ) {
+ return;
+ }
+ section = api.section( sectionId );
+ if ( ( section && section.expanded() ) || api.settings.autofocus.control === control.id ) {
+ control.actuallyEmbed();
+ }
+ },
+
+ /**
+ * This function is called in Section.onChangeExpanded() so the control
+ * will only get embedded when the Section is first expanded.
+ *
+ * @since 4.3.0
+ */
+ actuallyEmbed: function() {
+ var control = this;
+ if ( 'resolved' === control.deferred.embedded.state() ) {
+ return;
+ }
+ control.renderContent();
+ control.deferred.embedded.resolve(); // This triggers control.ready().
+ },
+
+ /**
+ * Set up the control.
+ */
+ ready: function() {
+ if ( 'undefined' === typeof this.params.menu_item_id ) {
+ throw new Error( 'params.menu_item_id was not defined' );
+ }
+
+ this._setupControlToggle();
+ this._setupReorderUI();
+ this._setupUpdateUI();
+ this._setupRemoveUI();
+ this._setupLinksUI();
+ this._setupTitleUI();
+ },
+
+ /**
+ * Show/hide the settings when clicking on the menu item handle.
+ */
+ _setupControlToggle: function() {
+ var control = this;
+
+ this.container.find( '.menu-item-handle' ).on( 'click', function( e ) {
+ e.preventDefault();
+ e.stopPropagation();
+ var menuControl = control.getMenuControl(),
+ isDeleteBtn = $( e.target ).is( '.item-delete, .item-delete *' ),
+ isAddNewBtn = $( e.target ).is( '.add-new-menu-item, .add-new-menu-item *' );
+
+ if ( $( 'body' ).hasClass( 'adding-menu-items' ) && ! isDeleteBtn && ! isAddNewBtn ) {
+ api.Menus.availableMenuItemsPanel.close();
+ }
+
+ if ( menuControl.isReordering || menuControl.isSorting ) {
+ return;
+ }
+ control.toggleForm();
+ } );
+ },
+
+ /**
+ * Set up the menu-item-reorder-nav
+ */
+ _setupReorderUI: function() {
+ var control = this, template, $reorderNav;
+
+ template = wp.template( 'menu-item-reorder-nav' );
+
+ // Add the menu item reordering elements to the menu item control.
+ control.container.find( '.item-controls' ).after( template );
+
+ // Handle clicks for up/down/left-right on the reorder nav.
+ $reorderNav = control.container.find( '.menu-item-reorder-nav' );
+ $reorderNav.find( '.menus-move-up, .menus-move-down, .menus-move-left, .menus-move-right' ).on( 'click', function() {
+ var moveBtn = $( this );
+ moveBtn.focus();
+
+ var isMoveUp = moveBtn.is( '.menus-move-up' ),
+ isMoveDown = moveBtn.is( '.menus-move-down' ),
+ isMoveLeft = moveBtn.is( '.menus-move-left' ),
+ isMoveRight = moveBtn.is( '.menus-move-right' );
+
+ if ( isMoveUp ) {
+ control.moveUp();
+ } else if ( isMoveDown ) {
+ control.moveDown();
+ } else if ( isMoveLeft ) {
+ control.moveLeft();
+ } else if ( isMoveRight ) {
+ control.moveRight();
+ }
+
+ moveBtn.focus(); // Re-focus after the container was moved.
+ } );
+ },
+
+ /**
+ * Set up event handlers for menu item updating.
+ */
+ _setupUpdateUI: function() {
+ var control = this,
+ settingValue = control.setting(),
+ updateNotifications;
+
+ control.elements = {};
+ control.elements.url = new api.Element( control.container.find( '.edit-menu-item-url' ) );
+ control.elements.title = new api.Element( control.container.find( '.edit-menu-item-title' ) );
+ control.elements.attr_title = new api.Element( control.container.find( '.edit-menu-item-attr-title' ) );
+ control.elements.target = new api.Element( control.container.find( '.edit-menu-item-target' ) );
+ control.elements.classes = new api.Element( control.container.find( '.edit-menu-item-classes' ) );
+ control.elements.xfn = new api.Element( control.container.find( '.edit-menu-item-xfn' ) );
+ control.elements.description = new api.Element( control.container.find( '.edit-menu-item-description' ) );
+ // @todo allow other elements, added by plugins, to be automatically picked up here; allow additional values to be added to setting array.
+
+ _.each( control.elements, function( element, property ) {
+ element.bind(function( value ) {
+ if ( element.element.is( 'input[type=checkbox]' ) ) {
+ value = ( value ) ? element.element.val() : '';
+ }
+
+ var settingValue = control.setting();
+ if ( settingValue && settingValue[ property ] !== value ) {
+ settingValue = _.clone( settingValue );
+ settingValue[ property ] = value;
+ control.setting.set( settingValue );
+ }
+ });
+ if ( settingValue ) {
+ if ( ( property === 'classes' || property === 'xfn' ) && _.isArray( settingValue[ property ] ) ) {
+ element.set( settingValue[ property ].join( ' ' ) );
+ } else {
+ element.set( settingValue[ property ] );
+ }
+ }
+ });
+
+ control.setting.bind(function( to, from ) {
+ var itemId = control.params.menu_item_id,
+ followingSiblingItemControls = [],
+ childrenItemControls = [],
+ menuControl;
+
+ if ( false === to ) {
+ menuControl = api.control( 'nav_menu[' + String( from.nav_menu_term_id ) + ']' );
+ control.container.remove();
+
+ _.each( menuControl.getMenuItemControls(), function( otherControl ) {
+ if ( from.menu_item_parent === otherControl.setting().menu_item_parent && otherControl.setting().position > from.position ) {
+ followingSiblingItemControls.push( otherControl );
+ } else if ( otherControl.setting().menu_item_parent === itemId ) {
+ childrenItemControls.push( otherControl );
+ }
+ });
+
+ // Shift all following siblings by the number of children this item has.
+ _.each( followingSiblingItemControls, function( followingSiblingItemControl ) {
+ var value = _.clone( followingSiblingItemControl.setting() );
+ value.position += childrenItemControls.length;
+ followingSiblingItemControl.setting.set( value );
+ });
+
+ // Now move the children up to be the new subsequent siblings.
+ _.each( childrenItemControls, function( childrenItemControl, i ) {
+ var value = _.clone( childrenItemControl.setting() );
+ value.position = from.position + i;
+ value.menu_item_parent = from.menu_item_parent;
+ childrenItemControl.setting.set( value );
+ });
+
+ menuControl.debouncedReflowMenuItems();
+ } else {
+ // Update the elements' values to match the new setting properties.
+ _.each( to, function( value, key ) {
+ if ( control.elements[ key] ) {
+ control.elements[ key ].set( to[ key ] );
+ }
+ } );
+ control.container.find( '.menu-item-data-parent-id' ).val( to.menu_item_parent );
+
+ // Handle UI updates when the position or depth (parent) change.
+ if ( to.position !== from.position || to.menu_item_parent !== from.menu_item_parent ) {
+ control.getMenuControl().debouncedReflowMenuItems();
+ }
+ }
+ });
+
+ // Style the URL field as invalid when there is an invalid_url notification.
+ updateNotifications = function() {
+ control.elements.url.element.toggleClass( 'invalid', control.setting.notifications.has( 'invalid_url' ) );
+ };
+ control.setting.notifications.bind( 'add', updateNotifications );
+ control.setting.notifications.bind( 'removed', updateNotifications );
+ },
+
+ /**
+ * Set up event handlers for menu item deletion.
+ */
+ _setupRemoveUI: function() {
+ var control = this, $removeBtn;
+
+ // Configure delete button.
+ $removeBtn = control.container.find( '.item-delete' );
+
+ $removeBtn.on( 'click', function() {
+ // Find an adjacent element to add focus to when this menu item goes away
+ var addingItems = true, $adjacentFocusTarget, $next, $prev;
+
+ if ( ! $( 'body' ).hasClass( 'adding-menu-items' ) ) {
+ addingItems = false;
+ }
+
+ $next = control.container.nextAll( '.customize-control-nav_menu_item:visible' ).first();
+ $prev = control.container.prevAll( '.customize-control-nav_menu_item:visible' ).first();
+
+ if ( $next.length ) {
+ $adjacentFocusTarget = $next.find( false === addingItems ? '.item-edit' : '.item-delete' ).first();
+ } else if ( $prev.length ) {
+ $adjacentFocusTarget = $prev.find( false === addingItems ? '.item-edit' : '.item-delete' ).first();
+ } else {
+ $adjacentFocusTarget = control.container.nextAll( '.customize-control-nav_menu' ).find( '.add-new-menu-item' ).first();
+ }
+
+ control.container.slideUp( function() {
+ control.setting.set( false );
+ wp.a11y.speak( api.Menus.data.l10n.itemDeleted );
+ $adjacentFocusTarget.focus(); // keyboard accessibility
+ } );
+
+ control.setting.set( false );
+ } );
+ },
+
+ _setupLinksUI: function() {
+ var $origBtn;
+
+ // Configure original link.
+ $origBtn = this.container.find( 'a.original-link' );
+
+ $origBtn.on( 'click', function( e ) {
+ e.preventDefault();
+ api.previewer.previewUrl( e.target.toString() );
+ } );
+ },
+
+ /**
+ * Update item handle title when changed.
+ */
+ _setupTitleUI: function() {
+ var control = this, titleEl;
+
+ // Ensure that whitespace is trimmed on blur so placeholder can be shown.
+ control.container.find( '.edit-menu-item-title' ).on( 'blur', function() {
+ $( this ).val( $.trim( $( this ).val() ) );
+ } );
+
+ titleEl = control.container.find( '.menu-item-title' );
+ control.setting.bind( function( item ) {
+ var trimmedTitle, titleText;
+ if ( ! item ) {
+ return;
+ }
+ trimmedTitle = $.trim( item.title );
+
+ titleText = trimmedTitle || item.original_title || api.Menus.data.l10n.untitled;
+
+ if ( item._invalid ) {
+ titleText = api.Menus.data.l10n.invalidTitleTpl.replace( '%s', titleText );
+ }
+
+ // Don't update to an empty title.
+ if ( trimmedTitle || item.original_title ) {
+ titleEl
+ .text( titleText )
+ .removeClass( 'no-title' );
+ } else {
+ titleEl
+ .text( titleText )
+ .addClass( 'no-title' );
+ }
+ } );
+ },
+
+ /**
+ *
+ * @returns {number}
+ */
+ getDepth: function() {
+ var control = this, setting = control.setting(), depth = 0;
+ if ( ! setting ) {
+ return 0;
+ }
+ while ( setting && setting.menu_item_parent ) {
+ depth += 1;
+ control = api.control( 'nav_menu_item[' + setting.menu_item_parent + ']' );
+ if ( ! control ) {
+ break;
+ }
+ setting = control.setting();
+ }
+ return depth;
+ },
+
+ /**
+ * Amend the control's params with the data necessary for the JS template just in time.
+ */
+ renderContent: function() {
+ var control = this,
+ settingValue = control.setting(),
+ containerClasses;
+
+ control.params.title = settingValue.title || '';
+ control.params.depth = control.getDepth();
+ control.container.data( 'item-depth', control.params.depth );
+ containerClasses = [
+ 'menu-item',
+ 'menu-item-depth-' + String( control.params.depth ),
+ 'menu-item-' + settingValue.object,
+ 'menu-item-edit-inactive'
+ ];
+
+ if ( settingValue._invalid ) {
+ containerClasses.push( 'menu-item-invalid' );
+ control.params.title = api.Menus.data.l10n.invalidTitleTpl.replace( '%s', control.params.title );
+ } else if ( 'draft' === settingValue.status ) {
+ containerClasses.push( 'pending' );
+ control.params.title = api.Menus.data.pendingTitleTpl.replace( '%s', control.params.title );
+ }
+
+ control.params.el_classes = containerClasses.join( ' ' );
+ control.params.item_type_label = settingValue.type_label;
+ control.params.item_type = settingValue.type;
+ control.params.url = settingValue.url;
+ control.params.target = settingValue.target;
+ control.params.attr_title = settingValue.attr_title;
+ control.params.classes = _.isArray( settingValue.classes ) ? settingValue.classes.join( ' ' ) : settingValue.classes;
+ control.params.attr_title = settingValue.attr_title;
+ control.params.xfn = settingValue.xfn;
+ control.params.description = settingValue.description;
+ control.params.parent = settingValue.menu_item_parent;
+ control.params.original_title = settingValue.original_title || '';
+
+ control.container.addClass( control.params.el_classes );
+
+ api.Control.prototype.renderContent.call( control );
+ },
+
+ /***********************************************************************
+ * Begin public API methods
+ **********************************************************************/
+
+ /**
+ * @return {wp.customize.controlConstructor.nav_menu|null}
+ */
+ getMenuControl: function() {
+ var control = this, settingValue = control.setting();
+ if ( settingValue && settingValue.nav_menu_term_id ) {
+ return api.control( 'nav_menu[' + settingValue.nav_menu_term_id + ']' );
+ } else {
+ return null;
+ }
+ },
+
+ /**
+ * Expand the accordion section containing a control
+ */
+ expandControlSection: function() {
+ var $section = this.container.closest( '.accordion-section' );
+ if ( ! $section.hasClass( 'open' ) ) {
+ $section.find( '.accordion-section-title:first' ).trigger( 'click' );
+ }
+ },
+
+ /**
+ * @since 4.6.0
+ *
+ * @param {Boolean} expanded
+ * @param {Object} [params]
+ * @returns {Boolean} false if state already applied
+ */
+ _toggleExpanded: api.Section.prototype._toggleExpanded,
+
+ /**
+ * @since 4.6.0
+ *
+ * @param {Object} [params]
+ * @returns {Boolean} false if already expanded
+ */
+ expand: api.Section.prototype.expand,
+
+ /**
+ * Expand the menu item form control.
+ *
+ * @since 4.5.0 Added params.completeCallback.
+ *
+ * @param {Object} [params] - Optional params.
+ * @param {Function} [params.completeCallback] - Function to call when the form toggle has finished animating.
+ */
+ expandForm: function( params ) {
+ this.expand( params );
+ },
+
+ /**
+ * @since 4.6.0
+ *
+ * @param {Object} [params]
+ * @returns {Boolean} false if already collapsed
+ */
+ collapse: api.Section.prototype.collapse,
+
+ /**
+ * Collapse the menu item form control.
+ *
+ * @since 4.5.0 Added params.completeCallback.
+ *
+ * @param {Object} [params] - Optional params.
+ * @param {Function} [params.completeCallback] - Function to call when the form toggle has finished animating.
+ */
+ collapseForm: function( params ) {
+ this.collapse( params );
+ },
+
+ /**
+ * Expand or collapse the menu item control.
+ *
+ * @deprecated this is poor naming, and it is better to directly set control.expanded( showOrHide )
+ * @since 4.5.0 Added params.completeCallback.
+ *
+ * @param {boolean} [showOrHide] - If not supplied, will be inverse of current visibility
+ * @param {Object} [params] - Optional params.
+ * @param {Function} [params.completeCallback] - Function to call when the form toggle has finished animating.
+ */
+ toggleForm: function( showOrHide, params ) {
+ if ( typeof showOrHide === 'undefined' ) {
+ showOrHide = ! this.expanded();
+ }
+ if ( showOrHide ) {
+ this.expand( params );
+ } else {
+ this.collapse( params );
+ }
+ },
+
+ /**
+ * Expand or collapse the menu item control.
+ *
+ * @since 4.6.0
+ * @param {boolean} [showOrHide] - If not supplied, will be inverse of current visibility
+ * @param {Object} [params] - Optional params.
+ * @param {Function} [params.completeCallback] - Function to call when the form toggle has finished animating.
+ */
+ onChangeExpanded: function( showOrHide, params ) {
+ var self = this, $menuitem, $inside, complete;
+
+ $menuitem = this.container;
+ $inside = $menuitem.find( '.menu-item-settings:first' );
+ if ( 'undefined' === typeof showOrHide ) {
+ showOrHide = ! $inside.is( ':visible' );
+ }
+
+ // Already expanded or collapsed.
+ if ( $inside.is( ':visible' ) === showOrHide ) {
+ if ( params && params.completeCallback ) {
+ params.completeCallback();
+ }
+ return;
+ }
+
+ if ( showOrHide ) {
+ // Close all other menu item controls before expanding this one.
+ api.control.each( function( otherControl ) {
+ if ( self.params.type === otherControl.params.type && self !== otherControl ) {
+ otherControl.collapseForm();
+ }
+ } );
+
+ complete = function() {
+ $menuitem
+ .removeClass( 'menu-item-edit-inactive' )
+ .addClass( 'menu-item-edit-active' );
+ self.container.trigger( 'expanded' );
+
+ if ( params && params.completeCallback ) {
+ params.completeCallback();
+ }
+ };
+
+ $menuitem.find( '.item-edit' ).attr( 'aria-expanded', 'true' );
+ $inside.slideDown( 'fast', complete );
+
+ self.container.trigger( 'expand' );
+ } else {
+ complete = function() {
+ $menuitem
+ .addClass( 'menu-item-edit-inactive' )
+ .removeClass( 'menu-item-edit-active' );
+ self.container.trigger( 'collapsed' );
+
+ if ( params && params.completeCallback ) {
+ params.completeCallback();
+ }
+ };
+
+ self.container.trigger( 'collapse' );
+
+ $menuitem.find( '.item-edit' ).attr( 'aria-expanded', 'false' );
+ $inside.slideUp( 'fast', complete );
+ }
+ },
+
+ /**
+ * Expand the containing menu section, expand the form, and focus on
+ * the first input in the control.
+ *
+ * @since 4.5.0 Added params.completeCallback.
+ *
+ * @param {Object} [params] - Params object.
+ * @param {Function} [params.completeCallback] - Optional callback function when focus has completed.
+ */
+ focus: function( params ) {
+ params = params || {};
+ var control = this, originalCompleteCallback = params.completeCallback, focusControl;
+
+ focusControl = function() {
+ control.expandControlSection();
+
+ params.completeCallback = function() {
+ var focusable;
+
+ // Note that we can't use :focusable due to a jQuery UI issue. See: https://github.com/jquery/jquery-ui/pull/1583
+ focusable = control.container.find( '.menu-item-settings' ).find( 'input, select, textarea, button, object, a[href], [tabindex]' ).filter( ':visible' );
+ focusable.first().focus();
+
+ if ( originalCompleteCallback ) {
+ originalCompleteCallback();
+ }
+ };
+
+ control.expandForm( params );
+ };
+
+ if ( api.section.has( control.section() ) ) {
+ api.section( control.section() ).expand( {
+ completeCallback: focusControl
+ } );
+ } else {
+ focusControl();
+ }
+ },
+
+ /**
+ * Move menu item up one in the menu.
+ */
+ moveUp: function() {
+ this._changePosition( -1 );
+ wp.a11y.speak( api.Menus.data.l10n.movedUp );
+ },
+
+ /**
+ * Move menu item up one in the menu.
+ */
+ moveDown: function() {
+ this._changePosition( 1 );
+ wp.a11y.speak( api.Menus.data.l10n.movedDown );
+ },
+ /**
+ * Move menu item and all children up one level of depth.
+ */
+ moveLeft: function() {
+ this._changeDepth( -1 );
+ wp.a11y.speak( api.Menus.data.l10n.movedLeft );
+ },
+
+ /**
+ * Move menu item and children one level deeper, as a submenu of the previous item.
+ */
+ moveRight: function() {
+ this._changeDepth( 1 );
+ wp.a11y.speak( api.Menus.data.l10n.movedRight );
+ },
+
+ /**
+ * Note that this will trigger a UI update, causing child items to
+ * move as well and cardinal order class names to be updated.
+ *
+ * @private
+ *
+ * @param {Number} offset 1|-1
+ */
+ _changePosition: function( offset ) {
+ var control = this,
+ adjacentSetting,
+ settingValue = _.clone( control.setting() ),
+ siblingSettings = [],
+ realPosition;
+
+ if ( 1 !== offset && -1 !== offset ) {
+ throw new Error( 'Offset changes by 1 are only supported.' );
+ }
+
+ // Skip moving deleted items.
+ if ( ! control.setting() ) {
+ return;
+ }
+
+ // Locate the other items under the same parent (siblings).
+ _( control.getMenuControl().getMenuItemControls() ).each(function( otherControl ) {
+ if ( otherControl.setting().menu_item_parent === settingValue.menu_item_parent ) {
+ siblingSettings.push( otherControl.setting );
+ }
+ });
+ siblingSettings.sort(function( a, b ) {
+ return a().position - b().position;
+ });
+
+ realPosition = _.indexOf( siblingSettings, control.setting );
+ if ( -1 === realPosition ) {
+ throw new Error( 'Expected setting to be among siblings.' );
+ }
+
+ // Skip doing anything if the item is already at the edge in the desired direction.
+ if ( ( realPosition === 0 && offset < 0 ) || ( realPosition === siblingSettings.length - 1 && offset > 0 ) ) {
+ // @todo Should we allow a menu item to be moved up to break it out of a parent? Adopt with previous or following parent?
+ return;
+ }
+
+ // Update any adjacent menu item setting to take on this item's position.
+ adjacentSetting = siblingSettings[ realPosition + offset ];
+ if ( adjacentSetting ) {
+ adjacentSetting.set( $.extend(
+ _.clone( adjacentSetting() ),
+ {
+ position: settingValue.position
+ }
+ ) );
+ }
+
+ settingValue.position += offset;
+ control.setting.set( settingValue );
+ },
+
+ /**
+ * Note that this will trigger a UI update, causing child items to
+ * move as well and cardinal order class names to be updated.
+ *
+ * @private
+ *
+ * @param {Number} offset 1|-1
+ */
+ _changeDepth: function( offset ) {
+ if ( 1 !== offset && -1 !== offset ) {
+ throw new Error( 'Offset changes by 1 are only supported.' );
+ }
+ var control = this,
+ settingValue = _.clone( control.setting() ),
+ siblingControls = [],
+ realPosition,
+ siblingControl,
+ parentControl;
+
+ // Locate the other items under the same parent (siblings).
+ _( control.getMenuControl().getMenuItemControls() ).each(function( otherControl ) {
+ if ( otherControl.setting().menu_item_parent === settingValue.menu_item_parent ) {
+ siblingControls.push( otherControl );
+ }
+ });
+ siblingControls.sort(function( a, b ) {
+ return a.setting().position - b.setting().position;
+ });
+
+ realPosition = _.indexOf( siblingControls, control );
+ if ( -1 === realPosition ) {
+ throw new Error( 'Expected control to be among siblings.' );
+ }
+
+ if ( -1 === offset ) {
+ // Skip moving left an item that is already at the top level.
+ if ( ! settingValue.menu_item_parent ) {
+ return;
+ }
+
+ parentControl = api.control( 'nav_menu_item[' + settingValue.menu_item_parent + ']' );
+
+ // Make this control the parent of all the following siblings.
+ _( siblingControls ).chain().slice( realPosition ).each(function( siblingControl, i ) {
+ siblingControl.setting.set(
+ $.extend(
+ {},
+ siblingControl.setting(),
+ {
+ menu_item_parent: control.params.menu_item_id,
+ position: i
+ }
+ )
+ );
+ });
+
+ // Increase the positions of the parent item's subsequent children to make room for this one.
+ _( control.getMenuControl().getMenuItemControls() ).each(function( otherControl ) {
+ var otherControlSettingValue, isControlToBeShifted;
+ isControlToBeShifted = (
+ otherControl.setting().menu_item_parent === parentControl.setting().menu_item_parent &&
+ otherControl.setting().position > parentControl.setting().position
+ );
+ if ( isControlToBeShifted ) {
+ otherControlSettingValue = _.clone( otherControl.setting() );
+ otherControl.setting.set(
+ $.extend(
+ otherControlSettingValue,
+ { position: otherControlSettingValue.position + 1 }
+ )
+ );
+ }
+ });
+
+ // Make this control the following sibling of its parent item.
+ settingValue.position = parentControl.setting().position + 1;
+ settingValue.menu_item_parent = parentControl.setting().menu_item_parent;
+ control.setting.set( settingValue );
+
+ } else if ( 1 === offset ) {
+ // Skip moving right an item that doesn't have a previous sibling.
+ if ( realPosition === 0 ) {
+ return;
+ }
+
+ // Make the control the last child of the previous sibling.
+ siblingControl = siblingControls[ realPosition - 1 ];
+ settingValue.menu_item_parent = siblingControl.params.menu_item_id;
+ settingValue.position = 0;
+ _( control.getMenuControl().getMenuItemControls() ).each(function( otherControl ) {
+ if ( otherControl.setting().menu_item_parent === settingValue.menu_item_parent ) {
+ settingValue.position = Math.max( settingValue.position, otherControl.setting().position );
+ }
+ });
+ settingValue.position += 1;
+ control.setting.set( settingValue );
+ }
+ }
+ } );
+
+ /**
+ * wp.customize.Menus.MenuNameControl
+ *
+ * Customizer control for a nav menu's name.
+ *
+ * @class wp.customize.Menus.MenuNameControl
+ * @augments wp.customize.Control
+ */
+ api.Menus.MenuNameControl = api.Control.extend(/** @lends wp.customize.Menus.MenuNameControl.prototype */{
+
+ ready: function() {
+ var control = this;
+
+ if ( control.setting ) {
+ var settingValue = control.setting();
+
+ control.nameElement = new api.Element( control.container.find( '.menu-name-field' ) );
+
+ control.nameElement.bind(function( value ) {
+ var settingValue = control.setting();
+ if ( settingValue && settingValue.name !== value ) {
+ settingValue = _.clone( settingValue );
+ settingValue.name = value;
+ control.setting.set( settingValue );
+ }
+ });
+ if ( settingValue ) {
+ control.nameElement.set( settingValue.name );
+ }
+
+ control.setting.bind(function( object ) {
+ if ( object ) {
+ control.nameElement.set( object.name );
+ }
+ });
+ }
+ }
+ });
+
+ /**
+ * wp.customize.Menus.MenuLocationsControl
+ *
+ * Customizer control for a nav menu's locations.
+ *
+ * @since 4.9.0
+ * @class wp.customize.Menus.MenuLocationsControl
+ * @augments wp.customize.Control
+ */
+ api.Menus.MenuLocationsControl = api.Control.extend(/** @lends wp.customize.Menus.MenuLocationsControl.prototype */{
+
+ /**
+ * Set up the control.
+ *
+ * @since 4.9.0
+ */
+ ready: function () {
+ var control = this;
+
+ control.container.find( '.assigned-menu-location' ).each(function() {
+ var container = $( this ),
+ checkbox = container.find( 'input[type=checkbox]' ),
+ element = new api.Element( checkbox ),
+ navMenuLocationSetting = api( 'nav_menu_locations[' + checkbox.data( 'location-id' ) + ']' ),
+ isNewMenu = control.params.menu_id === '',
+ updateCheckbox = isNewMenu ? _.noop : function( checked ) {
+ element.set( checked );
+ },
+ updateSetting = isNewMenu ? _.noop : function( checked ) {
+ navMenuLocationSetting.set( checked ? control.params.menu_id : 0 );
+ },
+ updateSelectedMenuLabel = function( selectedMenuId ) {
+ var menuSetting = api( 'nav_menu[' + String( selectedMenuId ) + ']' );
+ if ( ! selectedMenuId || ! menuSetting || ! menuSetting() ) {
+ container.find( '.theme-location-set' ).hide();
+ } else {
+ container.find( '.theme-location-set' ).show().find( 'span' ).text( displayNavMenuName( menuSetting().name ) );
+ }
+ };
+
+ updateCheckbox( navMenuLocationSetting.get() === control.params.menu_id );
+
+ checkbox.on( 'change', function() {
+ // Note: We can't use element.bind( function( checked ){ ... } ) here because it will trigger a change as well.
+ updateSetting( this.checked );
+ } );
+
+ navMenuLocationSetting.bind( function( selectedMenuId ) {
+ updateCheckbox( selectedMenuId === control.params.menu_id );
+ updateSelectedMenuLabel( selectedMenuId );
+ } );
+ updateSelectedMenuLabel( navMenuLocationSetting.get() );
+ });
+ },
+
+ /**
+ * Set the selected locations.
+ *
+ * This method sets the selected locations and allows us to do things like
+ * set the default location for a new menu.
+ *
+ * @since 4.9.0
+ *
+ * @param {Object.<string,boolean>} selections - A map of location selections.
+ * @returns {void}
+ */
+ setSelections: function( selections ) {
+ this.container.find( '.menu-location' ).each( function( i, checkboxNode ) {
+ var locationId = checkboxNode.dataset.locationId;
+ checkboxNode.checked = locationId in selections ? selections[ locationId ] : false;
+ } );
+ }
+ });
+
+ /**
+ * wp.customize.Menus.MenuAutoAddControl
+ *
+ * Customizer control for a nav menu's auto add.
+ *
+ * @class wp.customize.Menus.MenuAutoAddControl
+ * @augments wp.customize.Control
+ */
+ api.Menus.MenuAutoAddControl = api.Control.extend(/** @lends wp.customize.Menus.MenuAutoAddControl.prototype */{
+
+ ready: function() {
+ var control = this,
+ settingValue = control.setting();
+
+ /*
+ * Since the control is not registered in PHP, we need to prevent the
+ * preview's sending of the activeControls to result in this control
+ * being deactivated.
+ */
+ control.active.validate = function() {
+ var value, section = api.section( control.section() );
+ if ( section ) {
+ value = section.active();
+ } else {
+ value = false;
+ }
+ return value;
+ };
+
+ control.autoAddElement = new api.Element( control.container.find( 'input[type=checkbox].auto_add' ) );
+
+ control.autoAddElement.bind(function( value ) {
+ var settingValue = control.setting();
+ if ( settingValue && settingValue.name !== value ) {
+ settingValue = _.clone( settingValue );
+ settingValue.auto_add = value;
+ control.setting.set( settingValue );
+ }
+ });
+ if ( settingValue ) {
+ control.autoAddElement.set( settingValue.auto_add );
+ }
+
+ control.setting.bind(function( object ) {
+ if ( object ) {
+ control.autoAddElement.set( object.auto_add );
+ }
+ });
+ }
+
+ });
+
+ /**
+ * wp.customize.Menus.MenuControl
+ *
+ * Customizer control for menus.
+ * Note that 'nav_menu' must match the WP_Menu_Customize_Control::$type
+ *
+ * @class wp.customize.Menus.MenuControl
+ * @augments wp.customize.Control
+ */
+ api.Menus.MenuControl = api.Control.extend(/** @lends wp.customize.Menus.MenuControl.prototype */{
+ /**
+ * Set up the control.
+ */
+ ready: function() {
+ var control = this,
+ section = api.section( control.section() ),
+ menuId = control.params.menu_id,
+ menu = control.setting(),
+ name,
+ widgetTemplate,
+ select;
+
+ if ( 'undefined' === typeof this.params.menu_id ) {
+ throw new Error( 'params.menu_id was not defined' );
+ }
+
+ /*
+ * Since the control is not registered in PHP, we need to prevent the
+ * preview's sending of the activeControls to result in this control
+ * being deactivated.
+ */
+ control.active.validate = function() {
+ var value;
+ if ( section ) {
+ value = section.active();
+ } else {
+ value = false;
+ }
+ return value;
+ };
+
+ control.$controlSection = section.headContainer;
+ control.$sectionContent = control.container.closest( '.accordion-section-content' );
+
+ this._setupModel();
+
+ api.section( control.section(), function( section ) {
+ section.deferred.initSortables.done(function( menuList ) {
+ control._setupSortable( menuList );
+ });
+ } );
+
+ this._setupAddition();
+ this._setupTitle();
+
+ // Add menu to Navigation Menu widgets.
+ if ( menu ) {
+ name = displayNavMenuName( menu.name );
+
+ // Add the menu to the existing controls.
+ api.control.each( function( widgetControl ) {
+ if ( ! widgetControl.extended( api.controlConstructor.widget_form ) || 'nav_menu' !== widgetControl.params.widget_id_base ) {
+ return;
+ }
+ widgetControl.container.find( '.nav-menu-widget-form-controls:first' ).show();
+ widgetControl.container.find( '.nav-menu-widget-no-menus-message:first' ).hide();
+
+ select = widgetControl.container.find( 'select' );
+ if ( 0 === select.find( 'option[value=' + String( menuId ) + ']' ).length ) {
+ select.append( new Option( name, menuId ) );
+ }
+ } );
+
+ // Add the menu to the widget template.
+ widgetTemplate = $( '#available-widgets-list .widget-tpl:has( input.id_base[ value=nav_menu ] )' );
+ widgetTemplate.find( '.nav-menu-widget-form-controls:first' ).show();
+ widgetTemplate.find( '.nav-menu-widget-no-menus-message:first' ).hide();
+ select = widgetTemplate.find( '.widget-inside select:first' );
+ if ( 0 === select.find( 'option[value=' + String( menuId ) + ']' ).length ) {
+ select.append( new Option( name, menuId ) );
+ }
+ }
+
+ /*
+ * Wait for menu items to be added.
+ * Ideally, we'd bind to an event indicating construction is complete,
+ * but deferring appears to be the best option today.
+ */
+ _.defer( function () {
+ control.updateInvitationVisibility();
+ } );
+ },
+
+ /**
+ * Update ordering of menu item controls when the setting is updated.
+ */
+ _setupModel: function() {
+ var control = this,
+ menuId = control.params.menu_id;
+
+ control.setting.bind( function( to ) {
+ var name;
+ if ( false === to ) {
+ control._handleDeletion();
+ } else {
+ // Update names in the Navigation Menu widgets.
+ name = displayNavMenuName( to.name );
+ api.control.each( function( widgetControl ) {
+ if ( ! widgetControl.extended( api.controlConstructor.widget_form ) || 'nav_menu' !== widgetControl.params.widget_id_base ) {
+ return;
+ }
+ var select = widgetControl.container.find( 'select' );
+ select.find( 'option[value=' + String( menuId ) + ']' ).text( name );
+ });
+ }
+ } );
+ },
+
+ /**
+ * Allow items in each menu to be re-ordered, and for the order to be previewed.
+ *
+ * Notice that the UI aspects here are handled by wpNavMenu.initSortables()
+ * which is called in MenuSection.onChangeExpanded()
+ *
+ * @param {object} menuList - The element that has sortable().
+ */
+ _setupSortable: function( menuList ) {
+ var control = this;
+
+ if ( ! menuList.is( control.$sectionContent ) ) {
+ throw new Error( 'Unexpected menuList.' );
+ }
+
+ menuList.on( 'sortstart', function() {
+ control.isSorting = true;
+ });
+
+ menuList.on( 'sortstop', function() {
+ setTimeout( function() { // Next tick.
+ var menuItemContainerIds = control.$sectionContent.sortable( 'toArray' ),
+ menuItemControls = [],
+ position = 0,
+ priority = 10;
+
+ control.isSorting = false;
+
+ // Reset horizontal scroll position when done dragging.
+ control.$sectionContent.scrollLeft( 0 );
+
+ _.each( menuItemContainerIds, function( menuItemContainerId ) {
+ var menuItemId, menuItemControl, matches;
+ matches = menuItemContainerId.match( /^customize-control-nav_menu_item-(-?\d+)$/, '' );
+ if ( ! matches ) {
+ return;
+ }
+ menuItemId = parseInt( matches[1], 10 );
+ menuItemControl = api.control( 'nav_menu_item[' + String( menuItemId ) + ']' );
+ if ( menuItemControl ) {
+ menuItemControls.push( menuItemControl );
+ }
+ } );
+
+ _.each( menuItemControls, function( menuItemControl ) {
+ if ( false === menuItemControl.setting() ) {
+ // Skip deleted items.
+ return;
+ }
+ var setting = _.clone( menuItemControl.setting() );
+ position += 1;
+ priority += 1;
+ setting.position = position;
+ menuItemControl.priority( priority );
+
+ // Note that wpNavMenu will be setting this .menu-item-data-parent-id input's value.
+ setting.menu_item_parent = parseInt( menuItemControl.container.find( '.menu-item-data-parent-id' ).val(), 10 );
+ if ( ! setting.menu_item_parent ) {
+ setting.menu_item_parent = 0;
+ }
+
+ menuItemControl.setting.set( setting );
+ });
+ });
+
+ });
+ control.isReordering = false;
+
+ /**
+ * Keyboard-accessible reordering.
+ */
+ this.container.find( '.reorder-toggle' ).on( 'click', function() {
+ control.toggleReordering( ! control.isReordering );
+ } );
+ },
+
+ /**
+ * Set up UI for adding a new menu item.
+ */
+ _setupAddition: function() {
+ var self = this;
+
+ this.container.find( '.add-new-menu-item' ).on( 'click', function( event ) {
+ if ( self.$sectionContent.hasClass( 'reordering' ) ) {
+ return;
+ }
+
+ if ( ! $( 'body' ).hasClass( 'adding-menu-items' ) ) {
+ $( this ).attr( 'aria-expanded', 'true' );
+ api.Menus.availableMenuItemsPanel.open( self );
+ } else {
+ $( this ).attr( 'aria-expanded', 'false' );
+ api.Menus.availableMenuItemsPanel.close();
+ event.stopPropagation();
+ }
+ } );
+ },
+
+ _handleDeletion: function() {
+ var control = this,
+ section,
+ menuId = control.params.menu_id,
+ removeSection,
+ widgetTemplate,
+ navMenuCount = 0;
+ section = api.section( control.section() );
+ removeSection = function() {
+ section.container.remove();
+ api.section.remove( section.id );
+ };
+
+ if ( section && section.expanded() ) {
+ section.collapse({
+ completeCallback: function() {
+ removeSection();
+ wp.a11y.speak( api.Menus.data.l10n.menuDeleted );
+ api.panel( 'nav_menus' ).focus();
+ }
+ });
+ } else {
+ removeSection();
+ }
+
+ api.each(function( setting ) {
+ if ( /^nav_menu\[/.test( setting.id ) && false !== setting() ) {
+ navMenuCount += 1;
+ }
+ });
+
+ // Remove the menu from any Navigation Menu widgets.
+ api.control.each(function( widgetControl ) {
+ if ( ! widgetControl.extended( api.controlConstructor.widget_form ) || 'nav_menu' !== widgetControl.params.widget_id_base ) {
+ return;
+ }
+ var select = widgetControl.container.find( 'select' );
+ if ( select.val() === String( menuId ) ) {
+ select.prop( 'selectedIndex', 0 ).trigger( 'change' );
+ }
+
+ widgetControl.container.find( '.nav-menu-widget-form-controls:first' ).toggle( 0 !== navMenuCount );
+ widgetControl.container.find( '.nav-menu-widget-no-menus-message:first' ).toggle( 0 === navMenuCount );
+ widgetControl.container.find( 'option[value=' + String( menuId ) + ']' ).remove();
+ });
+
+ // Remove the menu to the nav menu widget template.
+ widgetTemplate = $( '#available-widgets-list .widget-tpl:has( input.id_base[ value=nav_menu ] )' );
+ widgetTemplate.find( '.nav-menu-widget-form-controls:first' ).toggle( 0 !== navMenuCount );
+ widgetTemplate.find( '.nav-menu-widget-no-menus-message:first' ).toggle( 0 === navMenuCount );
+ widgetTemplate.find( 'option[value=' + String( menuId ) + ']' ).remove();
+ },
+
+ /**
+ * Update Section Title as menu name is changed.
+ */
+ _setupTitle: function() {
+ var control = this;
+
+ control.setting.bind( function( menu ) {
+ if ( ! menu ) {
+ return;
+ }
+
+ var section = api.section( control.section() ),
+ menuId = control.params.menu_id,
+ controlTitle = section.headContainer.find( '.accordion-section-title' ),
+ sectionTitle = section.contentContainer.find( '.customize-section-title h3' ),
+ location = section.headContainer.find( '.menu-in-location' ),
+ action = sectionTitle.find( '.customize-action' ),
+ name = displayNavMenuName( menu.name );
+
+ // Update the control title
+ controlTitle.text( name );
+ if ( location.length ) {
+ location.appendTo( controlTitle );
+ }
+
+ // Update the section title
+ sectionTitle.text( name );
+ if ( action.length ) {
+ action.prependTo( sectionTitle );
+ }
+
+ // Update the nav menu name in location selects.
+ api.control.each( function( control ) {
+ if ( /^nav_menu_locations\[/.test( control.id ) ) {
+ control.container.find( 'option[value=' + menuId + ']' ).text( name );
+ }
+ } );
+
+ // Update the nav menu name in all location checkboxes.
+ section.contentContainer.find( '.customize-control-checkbox input' ).each( function() {
+ if ( $( this ).prop( 'checked' ) ) {
+ $( '.current-menu-location-name-' + $( this ).data( 'location-id' ) ).text( name );
+ }
+ } );
+ } );
+ },
+
+ /***********************************************************************
+ * Begin public API methods
+ **********************************************************************/
+
+ /**
+ * Enable/disable the reordering UI
+ *
+ * @param {Boolean} showOrHide to enable/disable reordering
+ */
+ toggleReordering: function( showOrHide ) {
+ var addNewItemBtn = this.container.find( '.add-new-menu-item' ),
+ reorderBtn = this.container.find( '.reorder-toggle' ),
+ itemsTitle = this.$sectionContent.find( '.item-title' );
+
+ showOrHide = Boolean( showOrHide );
+
+ if ( showOrHide === this.$sectionContent.hasClass( 'reordering' ) ) {
+ return;
+ }
+
+ this.isReordering = showOrHide;
+ this.$sectionContent.toggleClass( 'reordering', showOrHide );
+ this.$sectionContent.sortable( this.isReordering ? 'disable' : 'enable' );
+ if ( this.isReordering ) {
+ addNewItemBtn.attr({ 'tabindex': '-1', 'aria-hidden': 'true' });
+ reorderBtn.attr( 'aria-label', api.Menus.data.l10n.reorderLabelOff );
+ wp.a11y.speak( api.Menus.data.l10n.reorderModeOn );
+ itemsTitle.attr( 'aria-hidden', 'false' );
+ } else {
+ addNewItemBtn.removeAttr( 'tabindex aria-hidden' );
+ reorderBtn.attr( 'aria-label', api.Menus.data.l10n.reorderLabelOn );
+ wp.a11y.speak( api.Menus.data.l10n.reorderModeOff );
+ itemsTitle.attr( 'aria-hidden', 'true' );
+ }
+
+ if ( showOrHide ) {
+ _( this.getMenuItemControls() ).each( function( formControl ) {
+ formControl.collapseForm();
+ } );
+ }
+ },
+
+ /**
+ * @return {wp.customize.controlConstructor.nav_menu_item[]}
+ */
+ getMenuItemControls: function() {
+ var menuControl = this,
+ menuItemControls = [],
+ menuTermId = menuControl.params.menu_id;
+
+ api.control.each(function( control ) {
+ if ( 'nav_menu_item' === control.params.type && control.setting() && menuTermId === control.setting().nav_menu_term_id ) {
+ menuItemControls.push( control );
+ }
+ });
+
+ return menuItemControls;
+ },
+
+ /**
+ * Make sure that each menu item control has the proper depth.
+ */
+ reflowMenuItems: function() {
+ var menuControl = this,
+ menuItemControls = menuControl.getMenuItemControls(),
+ reflowRecursively;
+
+ reflowRecursively = function( context ) {
+ var currentMenuItemControls = [],
+ thisParent = context.currentParent;
+ _.each( context.menuItemControls, function( menuItemControl ) {
+ if ( thisParent === menuItemControl.setting().menu_item_parent ) {
+ currentMenuItemControls.push( menuItemControl );
+ // @todo We could remove this item from menuItemControls now, for efficiency.
+ }
+ });
+ currentMenuItemControls.sort( function( a, b ) {
+ return a.setting().position - b.setting().position;
+ });
+
+ _.each( currentMenuItemControls, function( menuItemControl ) {
+ // Update position.
+ context.currentAbsolutePosition += 1;
+ menuItemControl.priority.set( context.currentAbsolutePosition ); // This will change the sort order.
+
+ // Update depth.
+ if ( ! menuItemControl.container.hasClass( 'menu-item-depth-' + String( context.currentDepth ) ) ) {
+ _.each( menuItemControl.container.prop( 'className' ).match( /menu-item-depth-\d+/g ), function( className ) {
+ menuItemControl.container.removeClass( className );
+ });
+ menuItemControl.container.addClass( 'menu-item-depth-' + String( context.currentDepth ) );
+ }
+ menuItemControl.container.data( 'item-depth', context.currentDepth );
+
+ // Process any children items.
+ context.currentDepth += 1;
+ context.currentParent = menuItemControl.params.menu_item_id;
+ reflowRecursively( context );
+ context.currentDepth -= 1;
+ context.currentParent = thisParent;
+ });
+
+ // Update class names for reordering controls.
+ if ( currentMenuItemControls.length ) {
+ _( currentMenuItemControls ).each(function( menuItemControl ) {
+ menuItemControl.container.removeClass( 'move-up-disabled move-down-disabled move-left-disabled move-right-disabled' );
+ if ( 0 === context.currentDepth ) {
+ menuItemControl.container.addClass( 'move-left-disabled' );
+ } else if ( 10 === context.currentDepth ) {
+ menuItemControl.container.addClass( 'move-right-disabled' );
+ }
+ });
+
+ currentMenuItemControls[0].container
+ .addClass( 'move-up-disabled' )
+ .addClass( 'move-right-disabled' )
+ .toggleClass( 'move-down-disabled', 1 === currentMenuItemControls.length );
+ currentMenuItemControls[ currentMenuItemControls.length - 1 ].container
+ .addClass( 'move-down-disabled' )
+ .toggleClass( 'move-up-disabled', 1 === currentMenuItemControls.length );
+ }
+ };
+
+ reflowRecursively( {
+ menuItemControls: menuItemControls,
+ currentParent: 0,
+ currentDepth: 0,
+ currentAbsolutePosition: 0
+ } );
+
+ menuControl.updateInvitationVisibility( menuItemControls );
+ menuControl.container.find( '.reorder-toggle' ).toggle( menuItemControls.length > 1 );
+ },
+
+ /**
+ * Note that this function gets debounced so that when a lot of setting
+ * changes are made at once, for instance when moving a menu item that
+ * has child items, this function will only be called once all of the
+ * settings have been updated.
+ */
+ debouncedReflowMenuItems: _.debounce( function() {
+ this.reflowMenuItems.apply( this, arguments );
+ }, 0 ),
+
+ /**
+ * Add a new item to this menu.
+ *
+ * @param {object} item - Value for the nav_menu_item setting to be created.
+ * @returns {wp.customize.Menus.controlConstructor.nav_menu_item} The newly-created nav_menu_item control instance.
+ */
+ addItemToMenu: function( item ) {
+ var menuControl = this, customizeId, settingArgs, setting, menuItemControl, placeholderId, position = 0, priority = 10;
+
+ _.each( menuControl.getMenuItemControls(), function( control ) {
+ if ( false === control.setting() ) {
+ return;
+ }
+ priority = Math.max( priority, control.priority() );
+ if ( 0 === control.setting().menu_item_parent ) {
+ position = Math.max( position, control.setting().position );
+ }
+ });
+ position += 1;
+ priority += 1;
+
+ item = $.extend(
+ {},
+ api.Menus.data.defaultSettingValues.nav_menu_item,
+ item,
+ {
+ nav_menu_term_id: menuControl.params.menu_id,
+ original_title: item.title,
+ position: position
+ }
+ );
+ delete item.id; // only used by Backbone
+
+ placeholderId = api.Menus.generatePlaceholderAutoIncrementId();
+ customizeId = 'nav_menu_item[' + String( placeholderId ) + ']';
+ settingArgs = {
+ type: 'nav_menu_item',
+ transport: api.Menus.data.settingTransport,
+ previewer: api.previewer
+ };
+ setting = api.create( customizeId, customizeId, {}, settingArgs );
+ setting.set( item ); // Change from initial empty object to actual item to mark as dirty.
+
+ // Add the menu item control.
+ menuItemControl = new api.controlConstructor.nav_menu_item( customizeId, {
+ type: 'nav_menu_item',
+ section: menuControl.id,
+ priority: priority,
+ settings: {
+ 'default': customizeId
+ },
+ menu_item_id: placeholderId
+ } );
+
+ api.control.add( menuItemControl );
+ setting.preview();
+ menuControl.debouncedReflowMenuItems();
+
+ wp.a11y.speak( api.Menus.data.l10n.itemAdded );
+
+ return menuItemControl;
+ },
+
+ /**
+ * Show an invitation to add new menu items when there are no menu items.
+ *
+ * @since 4.9.0
+ *
+ * @param {wp.customize.controlConstructor.nav_menu_item[]} optionalMenuItemControls
+ */
+ updateInvitationVisibility: function ( optionalMenuItemControls ) {
+ var menuItemControls = optionalMenuItemControls || this.getMenuItemControls();
+
+ this.container.find( '.new-menu-item-invitation' ).toggle( menuItemControls.length === 0 );
+ }
+ } );
+
+ api.Menus.NewMenuControl = api.Control.extend(/** @lends wp.customize.Menus.NewMenuControl.prototype */{
+
+ /**
+ * wp.customize.Menus.NewMenuControl
+ *
+ * Customizer control for creating new menus and handling deletion of existing menus.
+ * Note that 'new_menu' must match the WP_Customize_New_Menu_Control::$type.
+ *
+ * @constructs wp.customize.Menus.NewMenuControl
+ * @augments wp.customize.Control
+ *
+ * @deprecated 4.9.0 This class is no longer used due to new menu creation UX.
+ */
+ initialize: function() {
+ if ( 'undefined' !== typeof console && console.warn ) {
+ console.warn( '[DEPRECATED] wp.customize.NewMenuControl will be removed. Please use wp.customize.Menus.createNavMenu() instead.' );
+ }
+ api.Control.prototype.initialize.apply( this, arguments );
+ },
+
+ /**
+ * Set up the control.
+ *
+ * @deprecated 4.9.0
+ */
+ ready: function() {
+ this._bindHandlers();
+ },
+
+ _bindHandlers: function() {
+ var self = this,
+ name = $( '#customize-control-new_menu_name input' ),
+ submit = $( '#create-new-menu-submit' );
+ name.on( 'keydown', function( event ) {
+ if ( 13 === event.which ) { // Enter.
+ self.submit();
+ }
+ } );
+ submit.on( 'click', function( event ) {
+ self.submit();
+ event.stopPropagation();
+ event.preventDefault();
+ } );
+ },
+
+ /**
+ * Create the new menu with the name supplied.
+ *
+ * @deprecated 4.9.0
+ */
+ submit: function() {
+
+ var control = this,
+ container = control.container.closest( '.accordion-section-new-menu' ),
+ nameInput = container.find( '.menu-name-field' ).first(),
+ name = nameInput.val(),
+ menuSection;
+
+ if ( ! name ) {
+ nameInput.addClass( 'invalid' );
+ nameInput.focus();
+ return;
+ }
+
+ menuSection = api.Menus.createNavMenu( name );
+
+ // Clear name field.
+ nameInput.val( '' );
+ nameInput.removeClass( 'invalid' );
+
+ wp.a11y.speak( api.Menus.data.l10n.menuAdded );
+
+ // Focus on the new menu section.
+ menuSection.focus();
+ }
+ });
+
+ /**
+ * Extends wp.customize.controlConstructor with control constructor for
+ * menu_location, menu_item, nav_menu, and new_menu.
+ */
+ $.extend( api.controlConstructor, {
+ nav_menu_location: api.Menus.MenuLocationControl,
+ nav_menu_item: api.Menus.MenuItemControl,
+ nav_menu: api.Menus.MenuControl,
+ nav_menu_name: api.Menus.MenuNameControl,
+ new_menu: api.Menus.NewMenuControl, // @todo Remove in a future release. See #42364.
+ nav_menu_locations: api.Menus.MenuLocationsControl,
+ nav_menu_auto_add: api.Menus.MenuAutoAddControl
+ });
+
+ /**
+ * Extends wp.customize.panelConstructor with section constructor for menus.
+ */
+ $.extend( api.panelConstructor, {
+ nav_menus: api.Menus.MenusPanel
+ });
+
+ /**
+ * Extends wp.customize.sectionConstructor with section constructor for menu.
+ */
+ $.extend( api.sectionConstructor, {
+ nav_menu: api.Menus.MenuSection,
+ new_menu: api.Menus.NewMenuSection
+ });
+
+ /**
+ * Init Customizer for menus.
+ */
+ api.bind( 'ready', function() {
+
+ // Set up the menu items panel.
+ api.Menus.availableMenuItemsPanel = new api.Menus.AvailableMenuItemsPanelView({
+ collection: api.Menus.availableMenuItems
+ });
+
+ api.bind( 'saved', function( data ) {
+ if ( data.nav_menu_updates || data.nav_menu_item_updates ) {
+ api.Menus.applySavedData( data );
+ }
+ } );
+
+ /*
+ * Reset the list of posts created in the customizer once published.
+ * The setting is updated quietly (bypassing events being triggered)
+ * so that the customized state doesn't become immediately dirty.
+ */
+ api.state( 'changesetStatus' ).bind( function( status ) {
+ if ( 'publish' === status ) {
+ api( 'nav_menus_created_posts' )._value = [];
+ }
+ } );
+
+ // Open and focus menu control.
+ api.previewer.bind( 'focus-nav-menu-item-control', api.Menus.focusMenuItemControl );
+ } );
+
+ /**
+ * When customize_save comes back with a success, make sure any inserted
+ * nav menus and items are properly re-added with their newly-assigned IDs.
+ *
+ * @alias wp.customize.Menus.applySavedData
+ *
+ * @param {object} data
+ * @param {array} data.nav_menu_updates
+ * @param {array} data.nav_menu_item_updates
+ */
+ api.Menus.applySavedData = function( data ) {
+
+ var insertedMenuIdMapping = {}, insertedMenuItemIdMapping = {};
+
+ _( data.nav_menu_updates ).each(function( update ) {
+ var oldCustomizeId, newCustomizeId, customizeId, oldSetting, newSetting, setting, settingValue, oldSection, newSection, wasSaved, widgetTemplate, navMenuCount, shouldExpandNewSection;
+ if ( 'inserted' === update.status ) {
+ if ( ! update.previous_term_id ) {
+ throw new Error( 'Expected previous_term_id' );
+ }
+ if ( ! update.term_id ) {
+ throw new Error( 'Expected term_id' );
+ }
+ oldCustomizeId = 'nav_menu[' + String( update.previous_term_id ) + ']';
+ if ( ! api.has( oldCustomizeId ) ) {
+ throw new Error( 'Expected setting to exist: ' + oldCustomizeId );
+ }
+ oldSetting = api( oldCustomizeId );
+ if ( ! api.section.has( oldCustomizeId ) ) {
+ throw new Error( 'Expected control to exist: ' + oldCustomizeId );
+ }
+ oldSection = api.section( oldCustomizeId );
+
+ settingValue = oldSetting.get();
+ if ( ! settingValue ) {
+ throw new Error( 'Did not expect setting to be empty (deleted).' );
+ }
+ settingValue = $.extend( _.clone( settingValue ), update.saved_value );
+
+ insertedMenuIdMapping[ update.previous_term_id ] = update.term_id;
+ newCustomizeId = 'nav_menu[' + String( update.term_id ) + ']';
+ newSetting = api.create( newCustomizeId, newCustomizeId, settingValue, {
+ type: 'nav_menu',
+ transport: api.Menus.data.settingTransport,
+ previewer: api.previewer
+ } );
+
+ shouldExpandNewSection = oldSection.expanded();
+ if ( shouldExpandNewSection ) {
+ oldSection.collapse();
+ }
+
+ // Add the menu section.
+ newSection = new api.Menus.MenuSection( newCustomizeId, {
+ panel: 'nav_menus',
+ title: settingValue.name,
+ customizeAction: api.Menus.data.l10n.customizingMenus,
+ type: 'nav_menu',
+ priority: oldSection.priority.get(),
+ menu_id: update.term_id
+ } );
+
+ // Add new control for the new menu.
+ api.section.add( newSection );
+
+ // Update the values for nav menus in Navigation Menu controls.
+ api.control.each( function( setting ) {
+ if ( ! setting.extended( api.controlConstructor.widget_form ) || 'nav_menu' !== setting.params.widget_id_base ) {
+ return;
+ }
+ var select, oldMenuOption, newMenuOption;
+ select = setting.container.find( 'select' );
+ oldMenuOption = select.find( 'option[value=' + String( update.previous_term_id ) + ']' );
+ newMenuOption = select.find( 'option[value=' + String( update.term_id ) + ']' );
+ newMenuOption.prop( 'selected', oldMenuOption.prop( 'selected' ) );
+ oldMenuOption.remove();
+ } );
+
+ // Delete the old placeholder nav_menu.
+ oldSetting.callbacks.disable(); // Prevent setting triggering Customizer dirty state when set.
+ oldSetting.set( false );
+ oldSetting.preview();
+ newSetting.preview();
+ oldSetting._dirty = false;
+
+ // Remove nav_menu section.
+ oldSection.container.remove();
+ api.section.remove( oldCustomizeId );
+
+ // Update the nav_menu widget to reflect removed placeholder menu.
+ navMenuCount = 0;
+ api.each(function( setting ) {
+ if ( /^nav_menu\[/.test( setting.id ) && false !== setting() ) {
+ navMenuCount += 1;
+ }
+ });
+ widgetTemplate = $( '#available-widgets-list .widget-tpl:has( input.id_base[ value=nav_menu ] )' );
+ widgetTemplate.find( '.nav-menu-widget-form-controls:first' ).toggle( 0 !== navMenuCount );
+ widgetTemplate.find( '.nav-menu-widget-no-menus-message:first' ).toggle( 0 === navMenuCount );
+ widgetTemplate.find( 'option[value=' + String( update.previous_term_id ) + ']' ).remove();
+
+ // Update the nav_menu_locations[...] controls to remove the placeholder menus from the dropdown options.
+ wp.customize.control.each(function( control ){
+ if ( /^nav_menu_locations\[/.test( control.id ) ) {
+ control.container.find( 'option[value=' + String( update.previous_term_id ) + ']' ).remove();
+ }
+ });
+
+ // Update nav_menu_locations to reference the new ID.
+ api.each( function( setting ) {
+ var wasSaved = api.state( 'saved' ).get();
+ if ( /^nav_menu_locations\[/.test( setting.id ) && setting.get() === update.previous_term_id ) {
+ setting.set( update.term_id );
+ setting._dirty = false; // Not dirty because this is has also just been done on server in WP_Customize_Nav_Menu_Setting::update().
+ api.state( 'saved' ).set( wasSaved );
+ setting.preview();
+ }
+ } );
+
+ if ( shouldExpandNewSection ) {
+ newSection.expand();
+ }
+ } else if ( 'updated' === update.status ) {
+ customizeId = 'nav_menu[' + String( update.term_id ) + ']';
+ if ( ! api.has( customizeId ) ) {
+ throw new Error( 'Expected setting to exist: ' + customizeId );
+ }
+
+ // Make sure the setting gets updated with its sanitized server value (specifically the conflict-resolved name).
+ setting = api( customizeId );
+ if ( ! _.isEqual( update.saved_value, setting.get() ) ) {
+ wasSaved = api.state( 'saved' ).get();
+ setting.set( update.saved_value );
+ setting._dirty = false;
+ api.state( 'saved' ).set( wasSaved );
+ }
+ }
+ } );
+
+ // Build up mapping of nav_menu_item placeholder IDs to inserted IDs.
+ _( data.nav_menu_item_updates ).each(function( update ) {
+ if ( update.previous_post_id ) {
+ insertedMenuItemIdMapping[ update.previous_post_id ] = update.post_id;
+ }
+ });
+
+ _( data.nav_menu_item_updates ).each(function( update ) {
+ var oldCustomizeId, newCustomizeId, oldSetting, newSetting, settingValue, oldControl, newControl;
+ if ( 'inserted' === update.status ) {
+ if ( ! update.previous_post_id ) {
+ throw new Error( 'Expected previous_post_id' );
+ }
+ if ( ! update.post_id ) {
+ throw new Error( 'Expected post_id' );
+ }
+ oldCustomizeId = 'nav_menu_item[' + String( update.previous_post_id ) + ']';
+ if ( ! api.has( oldCustomizeId ) ) {
+ throw new Error( 'Expected setting to exist: ' + oldCustomizeId );
+ }
+ oldSetting = api( oldCustomizeId );
+ if ( ! api.control.has( oldCustomizeId ) ) {
+ throw new Error( 'Expected control to exist: ' + oldCustomizeId );
+ }
+ oldControl = api.control( oldCustomizeId );
+
+ settingValue = oldSetting.get();
+ if ( ! settingValue ) {
+ throw new Error( 'Did not expect setting to be empty (deleted).' );
+ }
+ settingValue = _.clone( settingValue );
+
+ // If the parent menu item was also inserted, update the menu_item_parent to the new ID.
+ if ( settingValue.menu_item_parent < 0 ) {
+ if ( ! insertedMenuItemIdMapping[ settingValue.menu_item_parent ] ) {
+ throw new Error( 'inserted ID for menu_item_parent not available' );
+ }
+ settingValue.menu_item_parent = insertedMenuItemIdMapping[ settingValue.menu_item_parent ];
+ }
+
+ // If the menu was also inserted, then make sure it uses the new menu ID for nav_menu_term_id.
+ if ( insertedMenuIdMapping[ settingValue.nav_menu_term_id ] ) {
+ settingValue.nav_menu_term_id = insertedMenuIdMapping[ settingValue.nav_menu_term_id ];
+ }
+
+ newCustomizeId = 'nav_menu_item[' + String( update.post_id ) + ']';
+ newSetting = api.create( newCustomizeId, newCustomizeId, settingValue, {
+ type: 'nav_menu_item',
+ transport: api.Menus.data.settingTransport,
+ previewer: api.previewer
+ } );
+
+ // Add the menu control.
+ newControl = new api.controlConstructor.nav_menu_item( newCustomizeId, {
+ type: 'nav_menu_item',
+ menu_id: update.post_id,
+ section: 'nav_menu[' + String( settingValue.nav_menu_term_id ) + ']',
+ priority: oldControl.priority.get(),
+ settings: {
+ 'default': newCustomizeId
+ },
+ menu_item_id: update.post_id
+ } );
+
+ // Remove old control.
+ oldControl.container.remove();
+ api.control.remove( oldCustomizeId );
+
+ // Add new control to take its place.
+ api.control.add( newControl );
+
+ // Delete the placeholder and preview the new setting.
+ oldSetting.callbacks.disable(); // Prevent setting triggering Customizer dirty state when set.
+ oldSetting.set( false );
+ oldSetting.preview();
+ newSetting.preview();
+ oldSetting._dirty = false;
+
+ newControl.container.toggleClass( 'menu-item-edit-inactive', oldControl.container.hasClass( 'menu-item-edit-inactive' ) );
+ }
+ });
+
+ /*
+ * Update the settings for any nav_menu widgets that had selected a placeholder ID.
+ */
+ _.each( data.widget_nav_menu_updates, function( widgetSettingValue, widgetSettingId ) {
+ var setting = api( widgetSettingId );
+ if ( setting ) {
+ setting._value = widgetSettingValue;
+ setting.preview(); // Send to the preview now so that menu refresh will use the inserted menu.
+ }
+ });
+ };
+
+ /**
+ * Focus a menu item control.
+ *
+ * @alias wp.customize.Menus.focusMenuItemControl
+ *
+ * @param {string} menuItemId
+ */
+ api.Menus.focusMenuItemControl = function( menuItemId ) {
+ var control = api.Menus.getMenuItemControl( menuItemId );
+ if ( control ) {
+ control.focus();
+ }
+ };
+
+ /**
+ * Get the control for a given menu.
+ *
+ * @alias wp.customize.Menus.getMenuControl
+ *
+ * @param menuId
+ * @return {wp.customize.controlConstructor.menus[]}
+ */
+ api.Menus.getMenuControl = function( menuId ) {
+ return api.control( 'nav_menu[' + menuId + ']' );
+ };
+
+ /**
+ * Given a menu item ID, get the control associated with it.
+ *
+ * @alias wp.customize.Menus.getMenuItemControl
+ *
+ * @param {string} menuItemId
+ * @return {object|null}
+ */
+ api.Menus.getMenuItemControl = function( menuItemId ) {
+ return api.control( menuItemIdToSettingId( menuItemId ) );
+ };
+
+ /**
+ * @alias wp.customize.Menus~menuItemIdToSettingId
+ *
+ * @param {String} menuItemId
+ */
+ function menuItemIdToSettingId( menuItemId ) {
+ return 'nav_menu_item[' + menuItemId + ']';
+ }
+
+ /**
+ * Apply sanitize_text_field()-like logic to the supplied name, returning a
+ * "unnammed" fallback string if the name is then empty.
+ *
+ * @alias wp.customize.Menus~displayNavMenuName
+ *
+ * @param {string} name
+ * @returns {string}
+ */
+ function displayNavMenuName( name ) {
+ name = name || '';
+ name = wp.sanitize.stripTagsAndEncodeText( name ); // Remove any potential tags from name.
+ name = $.trim( name );
+ return name || api.Menus.data.l10n.unnamed;
+ }
+
+})( wp.customize, wp, jQuery );
diff --git a/www/crm/wp-admin/js/customize-nav-menus.min.js b/www/crm/wp-admin/js/customize-nav-menus.min.js
new file mode 100644
index 00000000..4bc3d158
--- /dev/null
+++ b/www/crm/wp-admin/js/customize-nav-menus.min.js
@@ -0,0 +1,2 @@
+!function(a,b,c){"use strict";function d(a){return"nav_menu_item["+a+"]"}function e(d){return d=d||"",d=b.sanitize.stripTagsAndEncodeText(d),d=c.trim(d),d||a.Menus.data.l10n.unnamed}wpNavMenu.originalInit=wpNavMenu.init,wpNavMenu.options.menuItemDepthPerLevel=20,wpNavMenu.options.sortableItems="> .customize-control-nav_menu_item",wpNavMenu.options.targetTolerance=10,wpNavMenu.init=function(){this.jQueryExtensions()},a.Menus=a.Menus||{},a.Menus.data={itemTypes:[],l10n:{},settingTransport:"refresh",phpIntMax:0,defaultSettingValues:{nav_menu:{},nav_menu_item:{}},locationSlugMappedToName:{}},"undefined"!=typeof _wpCustomizeNavMenusSettings&&c.extend(a.Menus.data,_wpCustomizeNavMenusSettings),a.Menus.generatePlaceholderAutoIncrementId=function(){return-Math.ceil(a.Menus.data.phpIntMax*Math.random())},a.Menus.AvailableItemModel=Backbone.Model.extend(c.extend({id:null},a.Menus.data.defaultSettingValues.nav_menu_item)),a.Menus.AvailableItemCollection=Backbone.Collection.extend({model:a.Menus.AvailableItemModel,sort_key:"order",comparator:function(a){return-a.get(this.sort_key)},sortByField:function(a){this.sort_key=a,this.sort()}}),a.Menus.availableMenuItems=new a.Menus.AvailableItemCollection(a.Menus.data.availableMenuItems),a.Menus.insertAutoDraftPost=function(d){var e,f=c.Deferred();return e=b.ajax.post("customize-nav-menus-insert-auto-draft",{"customize-menus-nonce":a.settings.nonce["customize-menus"],wp_customize:"on",customize_changeset_uuid:a.settings.changeset.uuid,params:d}),e.done(function(b){b.post_id&&(a("nav_menus_created_posts").set(a("nav_menus_created_posts").get().concat([b.post_id])),"page"===d.post_type&&(a.section.has("static_front_page")&&a.section("static_front_page").activate(),a.control.each(function(a){var c;"dropdown-pages"===a.params.type&&(c=a.container.find('select[name^="_customize-dropdown-pages-"]'),c.append(new Option(d.post_title,b.post_id)))})),f.resolve(b))}),e.fail(function(a){var b=a||"";"undefined"!=typeof a.message&&(b=a.message),console.error(b),f.rejectWith(b)}),f.promise()},a.Menus.AvailableMenuItemsPanelView=b.Backbone.View.extend({el:"#available-menu-items",events:{"input #menu-items-search":"debounceSearch","focus .menu-item-tpl":"focus","click .menu-item-tpl":"_submit","click #custom-menu-item-submit":"_submitLink","keypress #custom-menu-item-name":"_submitLink","click .new-content-item .add-content":"_submitNew","keypress .create-item-input":"_submitNew",keydown:"keyboardAccessible"},selected:null,currentMenuControl:null,debounceSearch:null,$search:null,$clearResults:null,searchTerm:"",rendered:!1,pages:{},sectionContent:"",loading:!1,addingNew:!1,initialize:function(){var b=this;a.panel.has("nav_menus")&&(this.$search=c("#menu-items-search"),this.$clearResults=this.$el.find(".clear-results"),this.sectionContent=this.$el.find(".available-menu-items-list"),this.debounceSearch=_.debounce(b.search,500),_.bindAll(this,"close"),c("#customize-controls, .customize-section-back").on("click keydown",function(a){var d=c(a.target).is(".item-delete, .item-delete *"),e=c(a.target).is(".add-new-menu-item, .add-new-menu-item *");!c("body").hasClass("adding-menu-items")||d||e||b.close()}),this.$clearResults.on("click",function(){b.$search.val("").focus().trigger("keyup")}),this.$el.on("input","#custom-menu-item-name.invalid, #custom-menu-item-url.invalid",function(){c(this).removeClass("invalid")}),a.panel("nav_menus").container.bind("expanded",function(){b.rendered||(b.initList(),b.rendered=!0)}),this.sectionContent.scroll(function(){var a=b.$el.find(".accordion-section.open .available-menu-items-list").prop("scrollHeight"),d=b.$el.find(".accordion-section.open").height();if(!b.loading&&c(this).scrollTop()>.75*a-d){var e=c(this).data("type"),f=c(this).data("object");"search"===e?b.searchTerm&&b.doSearch(b.pages.search):b.loadItems([{type:e,object:f}])}}),a.previewer.bind("url",this.close),b.delegateEvents())},search:function(a){var b=c("#available-menu-items-search"),d=c("#available-menu-items .accordion-section").not(b);a&&this.searchTerm!==a.target.value&&(""===a.target.value||b.hasClass("open")?""===a.target.value&&(b.removeClass("open"),d.show(),this.$clearResults.removeClass("is-visible")):(d.fadeOut(100),b.find(".accordion-section-content").slideDown("fast"),b.addClass("open"),this.$clearResults.addClass("is-visible")),this.searchTerm=a.target.value,this.pages.search=1,this.doSearch(1))},doSearch:function(d){var e,f=this,g=c("#available-menu-items-search"),h=g.find(".accordion-section-content"),i=b.template("available-menu-item");if(f.currentRequest&&f.currentRequest.abort(),!(d<0)){if(d>1)g.addClass("loading-more"),h.attr("aria-busy","true"),b.a11y.speak(a.Menus.data.l10n.itemsLoadingMore);else if(""===f.searchTerm)return h.html(""),void b.a11y.speak("");g.addClass("loading"),f.loading=!0,e=a.previewer.query({excludeCustomizedSaved:!0}),_.extend(e,{"customize-menus-nonce":a.settings.nonce["customize-menus"],wp_customize:"on",search:f.searchTerm,page:d}),f.currentRequest=b.ajax.post("search-available-menu-items-customizer",e),f.currentRequest.done(function(c){var e;1===d&&h.empty(),g.removeClass("loading loading-more"),h.attr("aria-busy","false"),g.addClass("open"),f.loading=!1,e=new a.Menus.AvailableItemCollection(c.items),f.collection.add(e.models),e.each(function(a){h.append(i(a.attributes))}),20>e.length?f.pages.search=-1:f.pages.search=f.pages.search+1,e&&d>1?b.a11y.speak(a.Menus.data.l10n.itemsFoundMore.replace("%d",e.length)):e&&1===d&&b.a11y.speak(a.Menus.data.l10n.itemsFound.replace("%d",e.length))}),f.currentRequest.fail(function(a){a.message&&(h.empty().append(c('<li class="nothing-found"></li>').text(a.message)),b.a11y.speak(a.message)),f.pages.search=-1}),f.currentRequest.always(function(){g.removeClass("loading loading-more"),h.attr("aria-busy","false"),f.loading=!1,f.currentRequest=null})}},initList:function(){var b=this;_.each(a.Menus.data.itemTypes,function(a){b.pages[a.type+":"+a.object]=0}),b.loadItems(a.Menus.data.itemTypes)},loadItems:function(d,e){var f,g,h,i,j=this,k=[],l={};i=b.template("available-menu-item"),f=_.isString(d)&&_.isString(e)?[{type:d,object:e}]:d,_.each(f,function(a){var b,d=a.type+":"+a.object;-1!==j.pages[d]&&(b=c("#available-menu-items-"+a.type+"-"+a.object),b.find(".accordion-section-title").addClass("loading"),l[d]=b,k.push({object:a.object,type:a.type,page:j.pages[d]}))}),0!==k.length&&(j.loading=!0,g=a.previewer.query({excludeCustomizedSaved:!0}),_.extend(g,{"customize-menus-nonce":a.settings.nonce["customize-menus"],wp_customize:"on",item_types:k}),h=b.ajax.post("load-available-menu-items-customizer",g),h.done(function(b){var c;_.each(b.items,function(b,d){return 0===b.length?(0===j.pages[d]&&l[d].find(".accordion-section-title").addClass("cannot-expand").removeClass("loading").find(".accordion-section-title > button").prop("tabIndex",-1),void(j.pages[d]=-1)):("post_type:page"!==d||l[d].hasClass("open")||l[d].find(".accordion-section-title > button").click(),b=new a.Menus.AvailableItemCollection(b),j.collection.add(b.models),c=l[d].find(".available-menu-items-list"),b.each(function(a){c.append(i(a.attributes))}),void(j.pages[d]+=1))})}),h.fail(function(a){"undefined"!=typeof console&&console.error&&console.error(a)}),h.always(function(){_.each(l,function(a){a.find(".accordion-section-title").removeClass("loading")}),j.loading=!1}))},itemSectionHeight:function(){var a,b,c,d,e;c=window.innerHeight,a=this.$el.find(".accordion-section:not( #available-menu-items-search ) .accordion-section-content"),b=this.$el.find('.accordion-section:not( #available-menu-items-search ) .available-menu-items-list:not(":only-child")'),d=46*(1+a.length)+14,e=c-d,120<e&&290>e&&(a.css("max-height",e),b.css("max-height",e-60))},select:function(a){this.selected=c(a),this.selected.siblings(".menu-item-tpl").removeClass("selected"),this.selected.addClass("selected")},focus:function(a){this.select(c(a.currentTarget))},_submit:function(a){"keypress"===a.type&&13!==a.which&&32!==a.which||this.submit(c(a.currentTarget))},submit:function(a){var b,d;a||(a=this.selected),a&&this.currentMenuControl&&(this.select(a),b=c(this.selected).data("menu-item-id"),d=this.collection.findWhere({id:b}),d&&(this.currentMenuControl.addItemToMenu(d.attributes),c(a).find(".menu-item-handle").addClass("item-added")))},_submitLink:function(a){"keypress"===a.type&&13!==a.which||this.submitLink()},submitLink:function(){var b,d,e=c("#custom-menu-item-name"),f=c("#custom-menu-item-url"),g=f.val().trim();if(this.currentMenuControl){if(d=/^((\w+:)?\/\/\w.*|\w+:(?!\/\/$)|\/|\?|#)/,""===e.val())return void e.addClass("invalid");if(!d.test(g))return void f.addClass("invalid");b={title:e.val(),url:g,type:"custom",type_label:a.Menus.data.l10n.custom_label,object:"custom"},this.currentMenuControl.addItemToMenu(b),f.val("http://"),e.val("")}},_submitNew:function(a){var b;"keypress"===a.type&&13!==a.which||this.addingNew||(b=c(a.target).closest(".accordion-section"),this.submitNew(b))},submitNew:function(d){var e,f=this,g=d.find(".create-item-input"),h=g.val(),i=d.find(".available-menu-items-list"),j=i.data("type"),k=i.data("object"),l=i.data("type_label");if(this.currentMenuControl&&"post_type"===j){if(""===c.trim(g.val()))return g.addClass("invalid"),void g.focus();g.removeClass("invalid"),d.find(".accordion-section-title").addClass("loading"),f.addingNew=!0,g.attr("disabled","disabled"),e=a.Menus.insertAutoDraftPost({post_title:h,post_type:k}),e.done(function(e){var h,i,m;h=new a.Menus.AvailableItemModel({id:"post-"+e.post_id,title:g.val(),type:j,type_label:l,object:k,object_id:e.post_id,url:e.url}),f.currentMenuControl.addItemToMenu(h.attributes),a.Menus.availableMenuItemsPanel.collection.add(h),i=d.find(".available-menu-items-list"),m=c(b.template("available-menu-item")(h.attributes)),m.find(".menu-item-handle:first").addClass("item-added"),i.prepend(m),i.scrollTop(),g.val("").removeAttr("disabled"),f.addingNew=!1,d.find(".accordion-section-title").removeClass("loading")})}},open:function(b){var d,e=this;this.currentMenuControl=b,this.itemSectionHeight(),a.section.has("publish_settings")&&a.section("publish_settings").collapse(),c("body").addClass("adding-menu-items"),d=function(){e.close(),c(this).off("click",d)},c("#customize-preview").on("click",d),_(this.currentMenuControl.getMenuItemControls()).each(function(a){a.collapseForm()}),this.$el.find(".selected").removeClass("selected"),this.$search.focus()},close:function(a){a=a||{},a.returnFocus&&this.currentMenuControl&&this.currentMenuControl.container.find(".add-new-menu-item").focus(),this.currentMenuControl=null,this.selected=null,c("body").removeClass("adding-menu-items"),c("#available-menu-items .menu-item-handle.item-added").removeClass("item-added"),this.$search.val("").trigger("keyup")},keyboardAccessible:function(a){var b=13===a.which,d=27===a.which,e=9===a.which&&a.shiftKey,f=c(a.target).is(this.$search);b&&!this.$search.val()||(f&&e?(this.currentMenuControl.container.find(".add-new-menu-item").focus(),a.preventDefault()):d&&this.close({returnFocus:!0}))}}),a.Menus.MenusPanel=a.Panel.extend({attachEvents:function(){a.Panel.prototype.attachEvents.call(this);var b=this,d=b.container.find(".panel-meta"),e=d.find(".customize-help-toggle"),f=d.find(".customize-panel-description"),g=c("#screen-options-wrap"),h=d.find(".customize-screen-options-toggle");h.on("click keydown",function(b){if(!a.utils.isKeydownButNotEnterEvent(b))return b.preventDefault(),f.not(":hidden")&&(f.slideUp("fast"),e.attr("aria-expanded","false")),"true"===h.attr("aria-expanded")?(h.attr("aria-expanded","false"),d.removeClass("open"),d.removeClass("active-menu-screen-options"),g.slideUp("fast")):(h.attr("aria-expanded","true"),d.addClass("open"),d.addClass("active-menu-screen-options"),g.slideDown("fast")),!1}),e.on("click keydown",function(b){a.utils.isKeydownButNotEnterEvent(b)||(b.preventDefault(),"true"===h.attr("aria-expanded")&&(h.attr("aria-expanded","false"),e.attr("aria-expanded","true"),d.addClass("open"),d.removeClass("active-menu-screen-options"),g.slideUp("fast"),f.slideDown("fast")))})},ready:function(){var c=this;c.container.find(".hide-column-tog").click(function(){c.saveManageColumnsState()}),a.section("menu_locations",function(c){c.headContainer.prepend(b.template("nav-menu-locations-header")(a.Menus.data))})},saveManageColumnsState:_.debounce(function(){var a=this;a._updateHiddenColumnsRequest&&a._updateHiddenColumnsRequest.abort(),a._updateHiddenColumnsRequest=b.ajax.post("hidden-columns",{hidden:a.hidden(),screenoptionnonce:c("#screenoptionnonce").val(),page:"nav-menus"}),a._updateHiddenColumnsRequest.always(function(){a._updateHiddenColumnsRequest=null})},2e3),checked:function(){},unchecked:function(){},hidden:function(){return c(".hide-column-tog").not(":checked").map(function(){var a=this.id;return a.substring(0,a.length-5)}).get().join(",")}}),a.Menus.MenuSection=a.Section.extend({initialize:function(b,d){var e=this;a.Section.prototype.initialize.call(e,b,d),e.deferred.initSortables=c.Deferred()},ready:function(){var b,d,e=this;if("undefined"==typeof e.params.menu_id)throw new Error("params.menu_id was not defined");e.active.validate=function(){return!!a.has(e.id)&&!!a(e.id).get()},e.populateControls(),e.navMenuLocationSettings={},e.assignedLocations=new a.Value([]),a.each(function(a,b){var c=b.match(/^nav_menu_locations\[(.+?)]/);c&&(e.navMenuLocationSettings[c[1]]=a,a.bind(function(){e.refreshAssignedLocations()}))}),e.assignedLocations.bind(function(a){e.updateAssignedLocationsInSectionTitle(a)}),e.refreshAssignedLocations(),a.bind("pane-contents-reflowed",function(){e.contentContainer.parent().length&&(e.container.find(".menu-item .menu-item-reorder-nav button").attr({tabindex:"0","aria-hidden":"false"}),e.container.find(".menu-item.move-up-disabled .menus-move-up").attr({tabindex:"-1","aria-hidden":"true"}),e.container.find(".menu-item.move-down-disabled .menus-move-down").attr({tabindex:"-1","aria-hidden":"true"}),e.container.find(".menu-item.move-left-disabled .menus-move-left").attr({tabindex:"-1","aria-hidden":"true"}),e.container.find(".menu-item.move-right-disabled .menus-move-right").attr({tabindex:"-1","aria-hidden":"true"}))}),d=function(){var a="field-"+c(this).val()+"-active";e.contentContainer.toggleClass(a,c(this).prop("checked"))},b=a.panel("nav_menus").contentContainer.find(".metabox-prefs:first").find(".hide-column-tog"),b.each(d),b.on("click",d)},populateControls:function(){var b,c,d,e,f,g,h,i,j,k=this;b=k.id+"[name]",g=a.control(b),g||(g=new a.controlConstructor.nav_menu_name(b,{type:"nav_menu_name",label:a.Menus.data.l10n.menuNameLabel,section:k.id,priority:0,settings:{"default":k.id}}),a.control.add(g),g.active.set(!0)),f=a.control(k.id),f||(f=new a.controlConstructor.nav_menu(k.id,{type:"nav_menu",section:k.id,priority:998,settings:{"default":k.id},menu_id:k.params.menu_id}),a.control.add(f),f.active.set(!0)),c=k.id+"[locations]",h=a.control(c),h||(h=new a.controlConstructor.nav_menu_locations(c,{section:k.id,priority:999,settings:{"default":k.id},menu_id:k.params.menu_id}),a.control.add(h.id,h),f.active.set(!0)),d=k.id+"[auto_add]",i=a.control(d),i||(i=new a.controlConstructor.nav_menu_auto_add(d,{type:"nav_menu_auto_add",label:"",section:k.id,priority:1e3,settings:{"default":k.id}}),a.control.add(i),i.active.set(!0)),e=k.id+"[delete]",j=a.control(e),j||(j=new a.Control(e,{section:k.id,priority:1001,templateId:"nav-menu-delete-button"}),a.control.add(j.id,j),j.active.set(!0),j.deferred.embedded.done(function(){j.container.find("button").on("click",function(){var b=k.params.menu_id,c=a.Menus.getMenuControl(b);c.setting.set(!1)})}))},refreshAssignedLocations:function(){var a=this,b=a.params.menu_id,c=[];_.each(a.navMenuLocationSettings,function(a,d){a()===b&&c.push(d)}),a.assignedLocations.set(c)},updateAssignedLocationsInSectionTitle:function(b){var d,e=this;d=e.container.find(".accordion-section-title:first"),d.find(".menu-in-location").remove(),_.each(b,function(b){var e,f;e=c('<span class="menu-in-location"></span>'),f=a.Menus.data.locationSlugMappedToName[b],e.text(a.Menus.data.l10n.menuLocation.replace("%s",f)),d.append(e)}),e.container.toggleClass("assigned-to-menu-location",0!==b.length)},onChangeExpanded:function(b,d){var e,f=this;b&&(wpNavMenu.menuList=f.contentContainer,wpNavMenu.targetList=wpNavMenu.menuList,c("#menu-to-edit").removeAttr("id"),wpNavMenu.menuList.attr("id","menu-to-edit").addClass("menu"),_.each(a.section(f.id).controls(),function(a){"nav_menu_item"===a.params.type&&a.actuallyEmbed()}),d.completeCallback&&(e=d.completeCallback),d.completeCallback=function(){"resolved"!==f.deferred.initSortables.state()&&(wpNavMenu.initSortables(),f.deferred.initSortables.resolve(wpNavMenu.menuList),a.control("nav_menu["+String(f.params.menu_id)+"]").reflowMenuItems()),_.isFunction(e)&&e()}),a.Section.prototype.onChangeExpanded.call(f,b,d)},highlightNewItemButton:function(){a.utils.highlightButton(this.contentContainer.find(".add-new-menu-item"),{delay:2e3})}}),a.Menus.createNavMenu=function(b){var d,f,g;return f=a.Menus.generatePlaceholderAutoIncrementId(),d="nav_menu["+String(f)+"]",g=a.create(d,d,{},{type:"nav_menu",transport:a.Menus.data.settingTransport,previewer:a.previewer}),g.set(c.extend({},a.Menus.data.defaultSettingValues.nav_menu,{name:b||""})),a.section.add(new a.Menus.MenuSection(d,{panel:"nav_menus",title:e(b),customizeAction:a.Menus.data.l10n.customizingMenus,priority:10,menu_id:f}))},a.Menus.NewMenuSection=a.Section.extend({attachEvents:function(){function c(){var b=0;return a.each(function(a){j.test(a.id)&&!1!==a.get()&&(b+=1)}),b}function d(){h.find(".add-new-menu-notice").prop("hidden",c()>0)}function e(a){j.test(a.id)&&(a.bind(d),d())}function f(a){j.test(a.id)&&(a.unbind(d),d())}var g=this,h=g.container,i=g.contentContainer,j=/^nav_menu\[/;g.headContainer.find(".accordion-section-title").replaceWith(b.template("nav-menu-create-menu-section-title")),h.on("click",".customize-add-menu-button",function(){g.expand()}),i.on("keydown",".menu-name-field",function(a){13===a.which&&g.submit()}),i.on("click","#customize-new-menu-submit",function(a){g.submit(),a.stopPropagation(),a.preventDefault()}),a.each(e),a.bind("add",e),a.bind("removed",f),d(),a.Section.prototype.attachEvents.apply(g,arguments)},ready:function(){this.populateControls()},populateControls:function(){var b,c,d,e,f,g,h=this;b=h.id+"[name]",e=a.control(b),e||(e=new a.controlConstructor.nav_menu_name(b,{label:a.Menus.data.l10n.menuNameLabel,description:a.Menus.data.l10n.newMenuNameDescription,section:h.id,priority:0}),a.control.add(e.id,e),e.active.set(!0)),c=h.id+"[locations]",f=a.control(c),f||(f=new a.controlConstructor.nav_menu_locations(c,{section:h.id,priority:1,menu_id:"",isCreating:!0}),a.control.add(c,f),f.active.set(!0)),d=h.id+"[submit]",g=a.control(d),g||(g=new a.Control(d,{section:h.id,priority:1,templateId:"nav-menu-submit-new-button"}),a.control.add(d,g),g.active.set(!0))},submit:function(){var d,e=this,f=e.contentContainer,g=f.find(".menu-name-field").first(),h=g.val();return h?(d=a.Menus.createNavMenu(h),g.val(""),g.removeClass("invalid"),f.find(".assigned-menu-location input[type=checkbox]").each(function(){var b,e=c(this);e.prop("checked")&&(b=a("nav_menu_locations["+e.data("location-id")+"]"),b.set(d.params.menu_id),e.prop("checked",!1))}),b.a11y.speak(a.Menus.data.l10n.menuAdded),void d.focus({completeCallback:function(){d.highlightNewItemButton()}})):(g.addClass("invalid"),void g.focus())},selectDefaultLocation:function(b){var c=a.control(this.id+"[locations]"),d={};null!==b&&(d[b]=!0),c.setSelections(d)}}),a.Menus.MenuLocationControl=a.Control.extend({initialize:function(b,c){var d=this,e=b.match(/^nav_menu_locations\[(.+?)]/);d.themeLocation=e[1],a.Control.prototype.initialize.call(d,b,c)},ready:function(){var b=this,c=/^nav_menu\[(-?\d+)]/;b.setting.validate=function(a){return""===a?0:parseInt(a,10)},b.container.find(".create-menu").on("click",function(){var b=a.section("add_menu");b.selectDefaultLocation(this.dataset.locationId),b.focus()}),b.container.find(".edit-menu").on("click",function(){var c=b.setting();a.section("nav_menu["+c+"]").focus()}),b.setting.bind("change",function(){var a=0!==b.setting();b.container.find(".create-menu").toggleClass("hidden",a),b.container.find(".edit-menu").toggleClass("hidden",!a)}),a.bind("add",function(a){var d,f,g=a.id.match(c);g&&!1!==a()&&(f=g[1],d=new Option(e(a().name),f),b.container.find("select").append(d))}),a.bind("remove",function(a){var d,e=a.id.match(c);e&&(d=parseInt(e[1],10),b.setting()===d&&b.setting.set(""),b.container.find("option[value="+d+"]").remove())}),a.bind("change",function(a){var d,f=a.id.match(c);f&&(d=parseInt(f[1],10),!1===a()?(b.setting()===d&&b.setting.set(""),b.container.find("option[value="+d+"]").remove()):b.container.find("option[value="+d+"]").text(e(a().name)))})}}),a.Menus.MenuItemControl=a.Control.extend({initialize:function(b,d){var e=this;e.expanded=new a.Value(!1),e.expandedArgumentsQueue=[],e.expanded.bind(function(a){var b=e.expandedArgumentsQueue.shift();b=c.extend({},e.defaultExpandedArguments,b),e.onChangeExpanded(a,b)}),a.Control.prototype.initialize.call(e,b,d),e.active.validate=function(){var b,c=a.section(e.section());return b=!!c&&c.active()}},embed:function(){var b,c=this,d=c.section();d&&(b=a.section(d),(b&&b.expanded()||a.settings.autofocus.control===c.id)&&c.actuallyEmbed())},actuallyEmbed:function(){var a=this;"resolved"!==a.deferred.embedded.state()&&(a.renderContent(),a.deferred.embedded.resolve())},ready:function(){if("undefined"==typeof this.params.menu_item_id)throw new Error("params.menu_item_id was not defined");this._setupControlToggle(),this._setupReorderUI(),this._setupUpdateUI(),this._setupRemoveUI(),this._setupLinksUI(),this._setupTitleUI()},_setupControlToggle:function(){var b=this;this.container.find(".menu-item-handle").on("click",function(d){d.preventDefault(),d.stopPropagation();var e=b.getMenuControl(),f=c(d.target).is(".item-delete, .item-delete *"),g=c(d.target).is(".add-new-menu-item, .add-new-menu-item *");!c("body").hasClass("adding-menu-items")||f||g||a.Menus.availableMenuItemsPanel.close(),e.isReordering||e.isSorting||b.toggleForm()})},_setupReorderUI:function(){var a,d,e=this;a=b.template("menu-item-reorder-nav"),e.container.find(".item-controls").after(a),d=e.container.find(".menu-item-reorder-nav"),d.find(".menus-move-up, .menus-move-down, .menus-move-left, .menus-move-right").on("click",function(){var a=c(this);a.focus();var b=a.is(".menus-move-up"),d=a.is(".menus-move-down"),f=a.is(".menus-move-left"),g=a.is(".menus-move-right");b?e.moveUp():d?e.moveDown():f?e.moveLeft():g&&e.moveRight(),a.focus()})},_setupUpdateUI:function(){var b,c=this,d=c.setting();c.elements={},c.elements.url=new a.Element(c.container.find(".edit-menu-item-url")),c.elements.title=new a.Element(c.container.find(".edit-menu-item-title")),c.elements.attr_title=new a.Element(c.container.find(".edit-menu-item-attr-title")),c.elements.target=new a.Element(c.container.find(".edit-menu-item-target")),c.elements.classes=new a.Element(c.container.find(".edit-menu-item-classes")),c.elements.xfn=new a.Element(c.container.find(".edit-menu-item-xfn")),c.elements.description=new a.Element(c.container.find(".edit-menu-item-description")),_.each(c.elements,function(a,b){a.bind(function(d){a.element.is("input[type=checkbox]")&&(d=d?a.element.val():"");var e=c.setting();e&&e[b]!==d&&(e=_.clone(e),e[b]=d,c.setting.set(e))}),d&&("classes"!==b&&"xfn"!==b||!_.isArray(d[b])?a.set(d[b]):a.set(d[b].join(" ")))}),c.setting.bind(function(b,d){var e,f=c.params.menu_item_id,g=[],h=[];!1===b?(e=a.control("nav_menu["+String(d.nav_menu_term_id)+"]"),c.container.remove(),_.each(e.getMenuItemControls(),function(a){d.menu_item_parent===a.setting().menu_item_parent&&a.setting().position>d.position?g.push(a):a.setting().menu_item_parent===f&&h.push(a)}),_.each(g,function(a){var b=_.clone(a.setting());b.position+=h.length,a.setting.set(b)}),_.each(h,function(a,b){var c=_.clone(a.setting());c.position=d.position+b,c.menu_item_parent=d.menu_item_parent,a.setting.set(c)}),e.debouncedReflowMenuItems()):(_.each(b,function(a,d){c.elements[d]&&c.elements[d].set(b[d])}),c.container.find(".menu-item-data-parent-id").val(b.menu_item_parent),b.position===d.position&&b.menu_item_parent===d.menu_item_parent||c.getMenuControl().debouncedReflowMenuItems())}),b=function(){c.elements.url.element.toggleClass("invalid",c.setting.notifications.has("invalid_url"))},c.setting.notifications.bind("add",b),c.setting.notifications.bind("removed",b)},_setupRemoveUI:function(){var d,e=this;d=e.container.find(".item-delete"),d.on("click",function(){var d,f,g,h=!0;c("body").hasClass("adding-menu-items")||(h=!1),f=e.container.nextAll(".customize-control-nav_menu_item:visible").first(),g=e.container.prevAll(".customize-control-nav_menu_item:visible").first(),d=f.length?f.find(!1===h?".item-edit":".item-delete").first():g.length?g.find(!1===h?".item-edit":".item-delete").first():e.container.nextAll(".customize-control-nav_menu").find(".add-new-menu-item").first(),e.container.slideUp(function(){e.setting.set(!1),b.a11y.speak(a.Menus.data.l10n.itemDeleted),d.focus()}),e.setting.set(!1)})},_setupLinksUI:function(){var b;b=this.container.find("a.original-link"),b.on("click",function(b){b.preventDefault(),a.previewer.previewUrl(b.target.toString())})},_setupTitleUI:function(){var b,d=this;d.container.find(".edit-menu-item-title").on("blur",function(){c(this).val(c.trim(c(this).val()))}),b=d.container.find(".menu-item-title"),d.setting.bind(function(d){var e,f;d&&(e=c.trim(d.title),f=e||d.original_title||a.Menus.data.l10n.untitled,d._invalid&&(f=a.Menus.data.l10n.invalidTitleTpl.replace("%s",f)),e||d.original_title?b.text(f).removeClass("no-title"):b.text(f).addClass("no-title"))})},getDepth:function(){var b=this,c=b.setting(),d=0;if(!c)return 0;for(;c&&c.menu_item_parent&&(d+=1,b=a.control("nav_menu_item["+c.menu_item_parent+"]"));)c=b.setting();return d},renderContent:function(){var b,c=this,d=c.setting();c.params.title=d.title||"",c.params.depth=c.getDepth(),c.container.data("item-depth",c.params.depth),b=["menu-item","menu-item-depth-"+String(c.params.depth),"menu-item-"+d.object,"menu-item-edit-inactive"],d._invalid?(b.push("menu-item-invalid"),c.params.title=a.Menus.data.l10n.invalidTitleTpl.replace("%s",c.params.title)):"draft"===d.status&&(b.push("pending"),c.params.title=a.Menus.data.pendingTitleTpl.replace("%s",c.params.title)),c.params.el_classes=b.join(" "),c.params.item_type_label=d.type_label,c.params.item_type=d.type,c.params.url=d.url,c.params.target=d.target,c.params.attr_title=d.attr_title,c.params.classes=_.isArray(d.classes)?d.classes.join(" "):d.classes,c.params.attr_title=d.attr_title,c.params.xfn=d.xfn,c.params.description=d.description,c.params.parent=d.menu_item_parent,c.params.original_title=d.original_title||"",c.container.addClass(c.params.el_classes),a.Control.prototype.renderContent.call(c)},getMenuControl:function(){var b=this,c=b.setting();return c&&c.nav_menu_term_id?a.control("nav_menu["+c.nav_menu_term_id+"]"):null},expandControlSection:function(){var a=this.container.closest(".accordion-section");a.hasClass("open")||a.find(".accordion-section-title:first").trigger("click")},_toggleExpanded:a.Section.prototype._toggleExpanded,expand:a.Section.prototype.expand,expandForm:function(a){this.expand(a)},collapse:a.Section.prototype.collapse,collapseForm:function(a){this.collapse(a)},toggleForm:function(a,b){"undefined"==typeof a&&(a=!this.expanded()),a?this.expand(b):this.collapse(b)},onChangeExpanded:function(b,c){var d,e,f,g=this;return d=this.container,e=d.find(".menu-item-settings:first"),"undefined"==typeof b&&(b=!e.is(":visible")),e.is(":visible")===b?void(c&&c.completeCallback&&c.completeCallback()):void(b?(a.control.each(function(a){g.params.type===a.params.type&&g!==a&&a.collapseForm()}),f=function(){d.removeClass("menu-item-edit-inactive").addClass("menu-item-edit-active"),g.container.trigger("expanded"),c&&c.completeCallback&&c.completeCallback()},d.find(".item-edit").attr("aria-expanded","true"),e.slideDown("fast",f),g.container.trigger("expand")):(f=function(){d.addClass("menu-item-edit-inactive").removeClass("menu-item-edit-active"),g.container.trigger("collapsed"),c&&c.completeCallback&&c.completeCallback()},g.container.trigger("collapse"),d.find(".item-edit").attr("aria-expanded","false"),e.slideUp("fast",f)))},focus:function(b){b=b||{};var c,d=this,e=b.completeCallback;c=function(){d.expandControlSection(),b.completeCallback=function(){var a;a=d.container.find(".menu-item-settings").find("input, select, textarea, button, object, a[href], [tabindex]").filter(":visible"),a.first().focus(),e&&e()},d.expandForm(b)},a.section.has(d.section())?a.section(d.section()).expand({completeCallback:c}):c()},moveUp:function(){this._changePosition(-1),b.a11y.speak(a.Menus.data.l10n.movedUp)},moveDown:function(){this._changePosition(1),b.a11y.speak(a.Menus.data.l10n.movedDown)},moveLeft:function(){this._changeDepth(-1),b.a11y.speak(a.Menus.data.l10n.movedLeft)},moveRight:function(){this._changeDepth(1),b.a11y.speak(a.Menus.data.l10n.movedRight)},_changePosition:function(a){var b,d,e=this,f=_.clone(e.setting()),g=[];if(1!==a&&-1!==a)throw new Error("Offset changes by 1 are only supported.");if(e.setting()){if(_(e.getMenuControl().getMenuItemControls()).each(function(a){a.setting().menu_item_parent===f.menu_item_parent&&g.push(a.setting)}),g.sort(function(a,b){return a().position-b().position}),d=_.indexOf(g,e.setting),-1===d)throw new Error("Expected setting to be among siblings.");0===d&&a<0||d===g.length-1&&a>0||(b=g[d+a],b&&b.set(c.extend(_.clone(b()),{position:f.position})),f.position+=a,e.setting.set(f))}},_changeDepth:function(b){if(1!==b&&-1!==b)throw new Error("Offset changes by 1 are only supported.");var d,e,f,g=this,h=_.clone(g.setting()),i=[];if(_(g.getMenuControl().getMenuItemControls()).each(function(a){a.setting().menu_item_parent===h.menu_item_parent&&i.push(a)}),i.sort(function(a,b){return a.setting().position-b.setting().position}),d=_.indexOf(i,g),-1===d)throw new Error("Expected control to be among siblings.");if(-1===b){if(!h.menu_item_parent)return;f=a.control("nav_menu_item["+h.menu_item_parent+"]"),_(i).chain().slice(d).each(function(a,b){a.setting.set(c.extend({},a.setting(),{menu_item_parent:g.params.menu_item_id,position:b}))}),_(g.getMenuControl().getMenuItemControls()).each(function(a){var b,d;d=a.setting().menu_item_parent===f.setting().menu_item_parent&&a.setting().position>f.setting().position,d&&(b=_.clone(a.setting()),a.setting.set(c.extend(b,{position:b.position+1})))}),h.position=f.setting().position+1,h.menu_item_parent=f.setting().menu_item_parent,g.setting.set(h)}else if(1===b){if(0===d)return;e=i[d-1],h.menu_item_parent=e.params.menu_item_id,h.position=0,_(g.getMenuControl().getMenuItemControls()).each(function(a){a.setting().menu_item_parent===h.menu_item_parent&&(h.position=Math.max(h.position,a.setting().position))}),h.position+=1,g.setting.set(h)}}}),a.Menus.MenuNameControl=a.Control.extend({ready:function(){var b=this;if(b.setting){var c=b.setting();b.nameElement=new a.Element(b.container.find(".menu-name-field")),b.nameElement.bind(function(a){var c=b.setting();c&&c.name!==a&&(c=_.clone(c),c.name=a,b.setting.set(c))}),c&&b.nameElement.set(c.name),b.setting.bind(function(a){a&&b.nameElement.set(a.name)})}}}),a.Menus.MenuLocationsControl=a.Control.extend({ready:function(){var b=this;b.container.find(".assigned-menu-location").each(function(){var d=c(this),f=d.find("input[type=checkbox]"),g=new a.Element(f),h=a("nav_menu_locations["+f.data("location-id")+"]"),i=""===b.params.menu_id,j=i?_.noop:function(a){g.set(a)},k=i?_.noop:function(a){h.set(a?b.params.menu_id:0)},l=function(b){var c=a("nav_menu["+String(b)+"]");b&&c&&c()?d.find(".theme-location-set").show().find("span").text(e(c().name)):d.find(".theme-location-set").hide()};j(h.get()===b.params.menu_id),f.on("change",function(){k(this.checked);
+}),h.bind(function(a){j(a===b.params.menu_id),l(a)}),l(h.get())})},setSelections:function(a){this.container.find(".menu-location").each(function(b,c){var d=c.dataset.locationId;c.checked=d in a&&a[d]})}}),a.Menus.MenuAutoAddControl=a.Control.extend({ready:function(){var b=this,c=b.setting();b.active.validate=function(){var c,d=a.section(b.section());return c=!!d&&d.active()},b.autoAddElement=new a.Element(b.container.find("input[type=checkbox].auto_add")),b.autoAddElement.bind(function(a){var c=b.setting();c&&c.name!==a&&(c=_.clone(c),c.auto_add=a,b.setting.set(c))}),c&&b.autoAddElement.set(c.auto_add),b.setting.bind(function(a){a&&b.autoAddElement.set(a.auto_add)})}}),a.Menus.MenuControl=a.Control.extend({ready:function(){var b,d,f,g=this,h=a.section(g.section()),i=g.params.menu_id,j=g.setting();if("undefined"==typeof this.params.menu_id)throw new Error("params.menu_id was not defined");g.active.validate=function(){var a;return a=!!h&&h.active()},g.$controlSection=h.headContainer,g.$sectionContent=g.container.closest(".accordion-section-content"),this._setupModel(),a.section(g.section(),function(a){a.deferred.initSortables.done(function(a){g._setupSortable(a)})}),this._setupAddition(),this._setupTitle(),j&&(b=e(j.name),a.control.each(function(c){c.extended(a.controlConstructor.widget_form)&&"nav_menu"===c.params.widget_id_base&&(c.container.find(".nav-menu-widget-form-controls:first").show(),c.container.find(".nav-menu-widget-no-menus-message:first").hide(),f=c.container.find("select"),0===f.find("option[value="+String(i)+"]").length&&f.append(new Option(b,i)))}),d=c("#available-widgets-list .widget-tpl:has( input.id_base[ value=nav_menu ] )"),d.find(".nav-menu-widget-form-controls:first").show(),d.find(".nav-menu-widget-no-menus-message:first").hide(),f=d.find(".widget-inside select:first"),0===f.find("option[value="+String(i)+"]").length&&f.append(new Option(b,i))),_.defer(function(){g.updateInvitationVisibility()})},_setupModel:function(){var b=this,c=b.params.menu_id;b.setting.bind(function(d){var f;!1===d?b._handleDeletion():(f=e(d.name),a.control.each(function(b){if(b.extended(a.controlConstructor.widget_form)&&"nav_menu"===b.params.widget_id_base){var d=b.container.find("select");d.find("option[value="+String(c)+"]").text(f)}}))})},_setupSortable:function(b){var c=this;if(!b.is(c.$sectionContent))throw new Error("Unexpected menuList.");b.on("sortstart",function(){c.isSorting=!0}),b.on("sortstop",function(){setTimeout(function(){var b=c.$sectionContent.sortable("toArray"),d=[],e=0,f=10;c.isSorting=!1,c.$sectionContent.scrollLeft(0),_.each(b,function(b){var c,e,f;f=b.match(/^customize-control-nav_menu_item-(-?\d+)$/,""),f&&(c=parseInt(f[1],10),e=a.control("nav_menu_item["+String(c)+"]"),e&&d.push(e))}),_.each(d,function(a){if(!1!==a.setting()){var b=_.clone(a.setting());e+=1,f+=1,b.position=e,a.priority(f),b.menu_item_parent=parseInt(a.container.find(".menu-item-data-parent-id").val(),10),b.menu_item_parent||(b.menu_item_parent=0),a.setting.set(b)}})})}),c.isReordering=!1,this.container.find(".reorder-toggle").on("click",function(){c.toggleReordering(!c.isReordering)})},_setupAddition:function(){var b=this;this.container.find(".add-new-menu-item").on("click",function(d){b.$sectionContent.hasClass("reordering")||(c("body").hasClass("adding-menu-items")?(c(this).attr("aria-expanded","false"),a.Menus.availableMenuItemsPanel.close(),d.stopPropagation()):(c(this).attr("aria-expanded","true"),a.Menus.availableMenuItemsPanel.open(b)))})},_handleDeletion:function(){var d,e,f,g=this,h=g.params.menu_id,i=0;d=a.section(g.section()),e=function(){d.container.remove(),a.section.remove(d.id)},d&&d.expanded()?d.collapse({completeCallback:function(){e(),b.a11y.speak(a.Menus.data.l10n.menuDeleted),a.panel("nav_menus").focus()}}):e(),a.each(function(a){/^nav_menu\[/.test(a.id)&&!1!==a()&&(i+=1)}),a.control.each(function(b){if(b.extended(a.controlConstructor.widget_form)&&"nav_menu"===b.params.widget_id_base){var c=b.container.find("select");c.val()===String(h)&&c.prop("selectedIndex",0).trigger("change"),b.container.find(".nav-menu-widget-form-controls:first").toggle(0!==i),b.container.find(".nav-menu-widget-no-menus-message:first").toggle(0===i),b.container.find("option[value="+String(h)+"]").remove()}}),f=c("#available-widgets-list .widget-tpl:has( input.id_base[ value=nav_menu ] )"),f.find(".nav-menu-widget-form-controls:first").toggle(0!==i),f.find(".nav-menu-widget-no-menus-message:first").toggle(0===i),f.find("option[value="+String(h)+"]").remove()},_setupTitle:function(){var b=this;b.setting.bind(function(d){if(d){var f=a.section(b.section()),g=b.params.menu_id,h=f.headContainer.find(".accordion-section-title"),i=f.contentContainer.find(".customize-section-title h3"),j=f.headContainer.find(".menu-in-location"),k=i.find(".customize-action"),l=e(d.name);h.text(l),j.length&&j.appendTo(h),i.text(l),k.length&&k.prependTo(i),a.control.each(function(a){/^nav_menu_locations\[/.test(a.id)&&a.container.find("option[value="+g+"]").text(l)}),f.contentContainer.find(".customize-control-checkbox input").each(function(){c(this).prop("checked")&&c(".current-menu-location-name-"+c(this).data("location-id")).text(l)})}})},toggleReordering:function(c){var d=this.container.find(".add-new-menu-item"),e=this.container.find(".reorder-toggle"),f=this.$sectionContent.find(".item-title");c=Boolean(c),c!==this.$sectionContent.hasClass("reordering")&&(this.isReordering=c,this.$sectionContent.toggleClass("reordering",c),this.$sectionContent.sortable(this.isReordering?"disable":"enable"),this.isReordering?(d.attr({tabindex:"-1","aria-hidden":"true"}),e.attr("aria-label",a.Menus.data.l10n.reorderLabelOff),b.a11y.speak(a.Menus.data.l10n.reorderModeOn),f.attr("aria-hidden","false")):(d.removeAttr("tabindex aria-hidden"),e.attr("aria-label",a.Menus.data.l10n.reorderLabelOn),b.a11y.speak(a.Menus.data.l10n.reorderModeOff),f.attr("aria-hidden","true")),c&&_(this.getMenuItemControls()).each(function(a){a.collapseForm()}))},getMenuItemControls:function(){var b=this,c=[],d=b.params.menu_id;return a.control.each(function(a){"nav_menu_item"===a.params.type&&a.setting()&&d===a.setting().nav_menu_term_id&&c.push(a)}),c},reflowMenuItems:function(){var a,b=this,c=b.getMenuItemControls();a=function(b){var c=[],d=b.currentParent;_.each(b.menuItemControls,function(a){d===a.setting().menu_item_parent&&c.push(a)}),c.sort(function(a,b){return a.setting().position-b.setting().position}),_.each(c,function(c){b.currentAbsolutePosition+=1,c.priority.set(b.currentAbsolutePosition),c.container.hasClass("menu-item-depth-"+String(b.currentDepth))||(_.each(c.container.prop("className").match(/menu-item-depth-\d+/g),function(a){c.container.removeClass(a)}),c.container.addClass("menu-item-depth-"+String(b.currentDepth))),c.container.data("item-depth",b.currentDepth),b.currentDepth+=1,b.currentParent=c.params.menu_item_id,a(b),b.currentDepth-=1,b.currentParent=d}),c.length&&(_(c).each(function(a){a.container.removeClass("move-up-disabled move-down-disabled move-left-disabled move-right-disabled"),0===b.currentDepth?a.container.addClass("move-left-disabled"):10===b.currentDepth&&a.container.addClass("move-right-disabled")}),c[0].container.addClass("move-up-disabled").addClass("move-right-disabled").toggleClass("move-down-disabled",1===c.length),c[c.length-1].container.addClass("move-down-disabled").toggleClass("move-up-disabled",1===c.length))},a({menuItemControls:c,currentParent:0,currentDepth:0,currentAbsolutePosition:0}),b.updateInvitationVisibility(c),b.container.find(".reorder-toggle").toggle(c.length>1)},debouncedReflowMenuItems:_.debounce(function(){this.reflowMenuItems.apply(this,arguments)},0),addItemToMenu:function(d){var e,f,g,h,i,j=this,k=0,l=10;return _.each(j.getMenuItemControls(),function(a){!1!==a.setting()&&(l=Math.max(l,a.priority()),0===a.setting().menu_item_parent&&(k=Math.max(k,a.setting().position)))}),k+=1,l+=1,d=c.extend({},a.Menus.data.defaultSettingValues.nav_menu_item,d,{nav_menu_term_id:j.params.menu_id,original_title:d.title,position:k}),delete d.id,i=a.Menus.generatePlaceholderAutoIncrementId(),e="nav_menu_item["+String(i)+"]",f={type:"nav_menu_item",transport:a.Menus.data.settingTransport,previewer:a.previewer},g=a.create(e,e,{},f),g.set(d),h=new a.controlConstructor.nav_menu_item(e,{type:"nav_menu_item",section:j.id,priority:l,settings:{"default":e},menu_item_id:i}),a.control.add(h),g.preview(),j.debouncedReflowMenuItems(),b.a11y.speak(a.Menus.data.l10n.itemAdded),h},updateInvitationVisibility:function(a){var b=a||this.getMenuItemControls();this.container.find(".new-menu-item-invitation").toggle(0===b.length)}}),a.Menus.NewMenuControl=a.Control.extend({initialize:function(){"undefined"!=typeof console&&console.warn&&console.warn("[DEPRECATED] wp.customize.NewMenuControl will be removed. Please use wp.customize.Menus.createNavMenu() instead."),a.Control.prototype.initialize.apply(this,arguments)},ready:function(){this._bindHandlers()},_bindHandlers:function(){var a=this,b=c("#customize-control-new_menu_name input"),d=c("#create-new-menu-submit");b.on("keydown",function(b){13===b.which&&a.submit()}),d.on("click",function(b){a.submit(),b.stopPropagation(),b.preventDefault()})},submit:function(){var c,d=this,e=d.container.closest(".accordion-section-new-menu"),f=e.find(".menu-name-field").first(),g=f.val();return g?(c=a.Menus.createNavMenu(g),f.val(""),f.removeClass("invalid"),b.a11y.speak(a.Menus.data.l10n.menuAdded),void c.focus()):(f.addClass("invalid"),void f.focus())}}),c.extend(a.controlConstructor,{nav_menu_location:a.Menus.MenuLocationControl,nav_menu_item:a.Menus.MenuItemControl,nav_menu:a.Menus.MenuControl,nav_menu_name:a.Menus.MenuNameControl,new_menu:a.Menus.NewMenuControl,nav_menu_locations:a.Menus.MenuLocationsControl,nav_menu_auto_add:a.Menus.MenuAutoAddControl}),c.extend(a.panelConstructor,{nav_menus:a.Menus.MenusPanel}),c.extend(a.sectionConstructor,{nav_menu:a.Menus.MenuSection,new_menu:a.Menus.NewMenuSection}),a.bind("ready",function(){a.Menus.availableMenuItemsPanel=new a.Menus.AvailableMenuItemsPanelView({collection:a.Menus.availableMenuItems}),a.bind("saved",function(b){(b.nav_menu_updates||b.nav_menu_item_updates)&&a.Menus.applySavedData(b)}),a.state("changesetStatus").bind(function(b){"publish"===b&&(a("nav_menus_created_posts")._value=[])}),a.previewer.bind("focus-nav-menu-item-control",a.Menus.focusMenuItemControl)}),a.Menus.applySavedData=function(d){var e={},f={};_(d.nav_menu_updates).each(function(d){var f,g,h,i,j,k,l,m,n,o,p,q,r;if("inserted"===d.status){if(!d.previous_term_id)throw new Error("Expected previous_term_id");if(!d.term_id)throw new Error("Expected term_id");if(f="nav_menu["+String(d.previous_term_id)+"]",!a.has(f))throw new Error("Expected setting to exist: "+f);if(i=a(f),!a.section.has(f))throw new Error("Expected control to exist: "+f);if(m=a.section(f),l=i.get(),!l)throw new Error("Did not expect setting to be empty (deleted).");l=c.extend(_.clone(l),d.saved_value),e[d.previous_term_id]=d.term_id,g="nav_menu["+String(d.term_id)+"]",j=a.create(g,g,l,{type:"nav_menu",transport:a.Menus.data.settingTransport,previewer:a.previewer}),r=m.expanded(),r&&m.collapse(),n=new a.Menus.MenuSection(g,{panel:"nav_menus",title:l.name,customizeAction:a.Menus.data.l10n.customizingMenus,type:"nav_menu",priority:m.priority.get(),menu_id:d.term_id}),a.section.add(n),a.control.each(function(b){if(b.extended(a.controlConstructor.widget_form)&&"nav_menu"===b.params.widget_id_base){var c,e,f;c=b.container.find("select"),e=c.find("option[value="+String(d.previous_term_id)+"]"),f=c.find("option[value="+String(d.term_id)+"]"),f.prop("selected",e.prop("selected")),e.remove()}}),i.callbacks.disable(),i.set(!1),i.preview(),j.preview(),i._dirty=!1,m.container.remove(),a.section.remove(f),q=0,a.each(function(a){/^nav_menu\[/.test(a.id)&&!1!==a()&&(q+=1)}),p=c("#available-widgets-list .widget-tpl:has( input.id_base[ value=nav_menu ] )"),p.find(".nav-menu-widget-form-controls:first").toggle(0!==q),p.find(".nav-menu-widget-no-menus-message:first").toggle(0===q),p.find("option[value="+String(d.previous_term_id)+"]").remove(),b.customize.control.each(function(a){/^nav_menu_locations\[/.test(a.id)&&a.container.find("option[value="+String(d.previous_term_id)+"]").remove()}),a.each(function(b){var c=a.state("saved").get();/^nav_menu_locations\[/.test(b.id)&&b.get()===d.previous_term_id&&(b.set(d.term_id),b._dirty=!1,a.state("saved").set(c),b.preview())}),r&&n.expand()}else if("updated"===d.status){if(h="nav_menu["+String(d.term_id)+"]",!a.has(h))throw new Error("Expected setting to exist: "+h);k=a(h),_.isEqual(d.saved_value,k.get())||(o=a.state("saved").get(),k.set(d.saved_value),k._dirty=!1,a.state("saved").set(o))}}),_(d.nav_menu_item_updates).each(function(a){a.previous_post_id&&(f[a.previous_post_id]=a.post_id)}),_(d.nav_menu_item_updates).each(function(b){var c,d,g,h,i,j,k;if("inserted"===b.status){if(!b.previous_post_id)throw new Error("Expected previous_post_id");if(!b.post_id)throw new Error("Expected post_id");if(c="nav_menu_item["+String(b.previous_post_id)+"]",!a.has(c))throw new Error("Expected setting to exist: "+c);if(g=a(c),!a.control.has(c))throw new Error("Expected control to exist: "+c);if(j=a.control(c),i=g.get(),!i)throw new Error("Did not expect setting to be empty (deleted).");if(i=_.clone(i),i.menu_item_parent<0){if(!f[i.menu_item_parent])throw new Error("inserted ID for menu_item_parent not available");i.menu_item_parent=f[i.menu_item_parent]}e[i.nav_menu_term_id]&&(i.nav_menu_term_id=e[i.nav_menu_term_id]),d="nav_menu_item["+String(b.post_id)+"]",h=a.create(d,d,i,{type:"nav_menu_item",transport:a.Menus.data.settingTransport,previewer:a.previewer}),k=new a.controlConstructor.nav_menu_item(d,{type:"nav_menu_item",menu_id:b.post_id,section:"nav_menu["+String(i.nav_menu_term_id)+"]",priority:j.priority.get(),settings:{"default":d},menu_item_id:b.post_id}),j.container.remove(),a.control.remove(c),a.control.add(k),g.callbacks.disable(),g.set(!1),g.preview(),h.preview(),g._dirty=!1,k.container.toggleClass("menu-item-edit-inactive",j.container.hasClass("menu-item-edit-inactive"))}}),_.each(d.widget_nav_menu_updates,function(b,c){var d=a(c);d&&(d._value=b,d.preview())})},a.Menus.focusMenuItemControl=function(b){var c=a.Menus.getMenuItemControl(b);c&&c.focus()},a.Menus.getMenuControl=function(b){return a.control("nav_menu["+b+"]")},a.Menus.getMenuItemControl=function(b){return a.control(d(b))}}(wp.customize,wp,jQuery); \ No newline at end of file
diff --git a/www/crm/wp-admin/js/customize-widgets.js b/www/crm/wp-admin/js/customize-widgets.js
new file mode 100644
index 00000000..77f44def
--- /dev/null
+++ b/www/crm/wp-admin/js/customize-widgets.js
@@ -0,0 +1,2367 @@
+/**
+ * @output wp-admin/js/customize-widgets.js
+ */
+
+/* global _wpCustomizeWidgetsSettings */
+(function( wp, $ ){
+
+ if ( ! wp || ! wp.customize ) { return; }
+
+ // Set up our namespace...
+ var api = wp.customize,
+ l10n;
+
+ /**
+ * @namespace wp.customize.Widgets
+ */
+ api.Widgets = api.Widgets || {};
+ api.Widgets.savedWidgetIds = {};
+
+ // Link settings
+ api.Widgets.data = _wpCustomizeWidgetsSettings || {};
+ l10n = api.Widgets.data.l10n;
+
+ /**
+ * wp.customize.Widgets.WidgetModel
+ *
+ * A single widget model.
+ *
+ * @class wp.customize.Widgets.WidgetModel
+ * @augments Backbone.Model
+ */
+ api.Widgets.WidgetModel = Backbone.Model.extend(/** @lends wp.customize.Widgets.WidgetModel.prototype */{
+ id: null,
+ temp_id: null,
+ classname: null,
+ control_tpl: null,
+ description: null,
+ is_disabled: null,
+ is_multi: null,
+ multi_number: null,
+ name: null,
+ id_base: null,
+ transport: null,
+ params: [],
+ width: null,
+ height: null,
+ search_matched: true
+ });
+
+ /**
+ * wp.customize.Widgets.WidgetCollection
+ *
+ * Collection for widget models.
+ *
+ * @class wp.customize.Widgets.WidgetCollection
+ * @augments Backbone.Collection
+ */
+ api.Widgets.WidgetCollection = Backbone.Collection.extend(/** @lends wp.customize.Widgets.WidgetCollection.prototype */{
+ model: api.Widgets.WidgetModel,
+
+ // Controls searching on the current widget collection
+ // and triggers an update event
+ doSearch: function( value ) {
+
+ // Don't do anything if we've already done this search
+ // Useful because the search handler fires multiple times per keystroke
+ if ( this.terms === value ) {
+ return;
+ }
+
+ // Updates terms with the value passed
+ this.terms = value;
+
+ // If we have terms, run a search...
+ if ( this.terms.length > 0 ) {
+ this.search( this.terms );
+ }
+
+ // If search is blank, set all the widgets as they matched the search to reset the views.
+ if ( this.terms === '' ) {
+ this.each( function ( widget ) {
+ widget.set( 'search_matched', true );
+ } );
+ }
+ },
+
+ // Performs a search within the collection
+ // @uses RegExp
+ search: function( term ) {
+ var match, haystack;
+
+ // Escape the term string for RegExp meta characters
+ term = term.replace( /[-\/\\^$*+?.()|[\]{}]/g, '\\$&' );
+
+ // Consider spaces as word delimiters and match the whole string
+ // so matching terms can be combined
+ term = term.replace( / /g, ')(?=.*' );
+ match = new RegExp( '^(?=.*' + term + ').+', 'i' );
+
+ this.each( function ( data ) {
+ haystack = [ data.get( 'name' ), data.get( 'id' ), data.get( 'description' ) ].join( ' ' );
+ data.set( 'search_matched', match.test( haystack ) );
+ } );
+ }
+ });
+ api.Widgets.availableWidgets = new api.Widgets.WidgetCollection( api.Widgets.data.availableWidgets );
+
+ /**
+ * wp.customize.Widgets.SidebarModel
+ *
+ * A single sidebar model.
+ *
+ * @class wp.customize.Widgets.SidebarModel
+ * @augments Backbone.Model
+ */
+ api.Widgets.SidebarModel = Backbone.Model.extend(/** @lends wp.customize.Widgets.SidebarModel.prototype */{
+ after_title: null,
+ after_widget: null,
+ before_title: null,
+ before_widget: null,
+ 'class': null,
+ description: null,
+ id: null,
+ name: null,
+ is_rendered: false
+ });
+
+ /**
+ * wp.customize.Widgets.SidebarCollection
+ *
+ * Collection for sidebar models.
+ *
+ * @class wp.customize.Widgets.SidebarCollection
+ * @augments Backbone.Collection
+ */
+ api.Widgets.SidebarCollection = Backbone.Collection.extend(/** @lends wp.customize.Widgets.SidebarCollection.prototype */{
+ model: api.Widgets.SidebarModel
+ });
+ api.Widgets.registeredSidebars = new api.Widgets.SidebarCollection( api.Widgets.data.registeredSidebars );
+
+ api.Widgets.AvailableWidgetsPanelView = wp.Backbone.View.extend(/** @lends wp.customize.Widgets.AvailableWidgetsPanelView.prototype */{
+
+ el: '#available-widgets',
+
+ events: {
+ 'input #widgets-search': 'search',
+ 'focus .widget-tpl' : 'focus',
+ 'click .widget-tpl' : '_submit',
+ 'keypress .widget-tpl' : '_submit',
+ 'keydown' : 'keyboardAccessible'
+ },
+
+ // Cache current selected widget
+ selected: null,
+
+ // Cache sidebar control which has opened panel
+ currentSidebarControl: null,
+ $search: null,
+ $clearResults: null,
+ searchMatchesCount: null,
+
+ /**
+ * View class for the available widgets panel.
+ *
+ * @constructs wp.customize.Widgets.AvailableWidgetsPanelView
+ * @augments wp.Backbone.View
+ */
+ initialize: function() {
+ var self = this;
+
+ this.$search = $( '#widgets-search' );
+
+ this.$clearResults = this.$el.find( '.clear-results' );
+
+ _.bindAll( this, 'close' );
+
+ this.listenTo( this.collection, 'change', this.updateList );
+
+ this.updateList();
+
+ // Set the initial search count to the number of available widgets.
+ this.searchMatchesCount = this.collection.length;
+
+ // If the available widgets panel is open and the customize controls are
+ // interacted with (i.e. available widgets panel is blurred) then close the
+ // available widgets panel. Also close on back button click.
+ $( '#customize-controls, #available-widgets .customize-section-title' ).on( 'click keydown', function( e ) {
+ var isAddNewBtn = $( e.target ).is( '.add-new-widget, .add-new-widget *' );
+ if ( $( 'body' ).hasClass( 'adding-widget' ) && ! isAddNewBtn ) {
+ self.close();
+ }
+ } );
+
+ // Clear the search results and trigger a `keyup` event to fire a new search.
+ this.$clearResults.on( 'click', function() {
+ self.$search.val( '' ).focus().trigger( 'keyup' );
+ } );
+
+ // Close the panel if the URL in the preview changes
+ api.previewer.bind( 'url', this.close );
+ },
+
+ /**
+ * Performs a search and handles selected widget.
+ */
+ search: _.debounce( function( event ) {
+ var firstVisible;
+
+ this.collection.doSearch( event.target.value );
+ // Update the search matches count.
+ this.updateSearchMatchesCount();
+ // Announce how many search results.
+ this.announceSearchMatches();
+
+ // Remove a widget from being selected if it is no longer visible
+ if ( this.selected && ! this.selected.is( ':visible' ) ) {
+ this.selected.removeClass( 'selected' );
+ this.selected = null;
+ }
+
+ // If a widget was selected but the filter value has been cleared out, clear selection
+ if ( this.selected && ! event.target.value ) {
+ this.selected.removeClass( 'selected' );
+ this.selected = null;
+ }
+
+ // If a filter has been entered and a widget hasn't been selected, select the first one shown
+ if ( ! this.selected && event.target.value ) {
+ firstVisible = this.$el.find( '> .widget-tpl:visible:first' );
+ if ( firstVisible.length ) {
+ this.select( firstVisible );
+ }
+ }
+
+ // Toggle the clear search results button.
+ if ( '' !== event.target.value ) {
+ this.$clearResults.addClass( 'is-visible' );
+ } else if ( '' === event.target.value ) {
+ this.$clearResults.removeClass( 'is-visible' );
+ }
+
+ // Set a CSS class on the search container when there are no search results.
+ if ( ! this.searchMatchesCount ) {
+ this.$el.addClass( 'no-widgets-found' );
+ } else {
+ this.$el.removeClass( 'no-widgets-found' );
+ }
+ }, 500 ),
+
+ /**
+ * Updates the count of the available widgets that have the `search_matched` attribute.
+ */
+ updateSearchMatchesCount: function() {
+ this.searchMatchesCount = this.collection.where({ search_matched: true }).length;
+ },
+
+ /**
+ * Sends a message to the aria-live region to announce how many search results.
+ */
+ announceSearchMatches: function() {
+ var message = l10n.widgetsFound.replace( '%d', this.searchMatchesCount ) ;
+
+ if ( ! this.searchMatchesCount ) {
+ message = l10n.noWidgetsFound;
+ }
+
+ wp.a11y.speak( message );
+ },
+
+ /**
+ * Changes visibility of available widgets.
+ */
+ updateList: function() {
+ this.collection.each( function( widget ) {
+ var widgetTpl = $( '#widget-tpl-' + widget.id );
+ widgetTpl.toggle( widget.get( 'search_matched' ) && ! widget.get( 'is_disabled' ) );
+ if ( widget.get( 'is_disabled' ) && widgetTpl.is( this.selected ) ) {
+ this.selected = null;
+ }
+ } );
+ },
+
+ /**
+ * Highlights a widget.
+ */
+ select: function( widgetTpl ) {
+ this.selected = $( widgetTpl );
+ this.selected.siblings( '.widget-tpl' ).removeClass( 'selected' );
+ this.selected.addClass( 'selected' );
+ },
+
+ /**
+ * Highlights a widget on focus.
+ */
+ focus: function( event ) {
+ this.select( $( event.currentTarget ) );
+ },
+
+ /**
+ * Handles submit for keypress and click on widget.
+ */
+ _submit: function( event ) {
+ // Only proceed with keypress if it is Enter or Spacebar
+ if ( event.type === 'keypress' && ( event.which !== 13 && event.which !== 32 ) ) {
+ return;
+ }
+
+ this.submit( $( event.currentTarget ) );
+ },
+
+ /**
+ * Adds a selected widget to the sidebar.
+ */
+ submit: function( widgetTpl ) {
+ var widgetId, widget, widgetFormControl;
+
+ if ( ! widgetTpl ) {
+ widgetTpl = this.selected;
+ }
+
+ if ( ! widgetTpl || ! this.currentSidebarControl ) {
+ return;
+ }
+
+ this.select( widgetTpl );
+
+ widgetId = $( this.selected ).data( 'widget-id' );
+ widget = this.collection.findWhere( { id: widgetId } );
+ if ( ! widget ) {
+ return;
+ }
+
+ widgetFormControl = this.currentSidebarControl.addWidget( widget.get( 'id_base' ) );
+ if ( widgetFormControl ) {
+ widgetFormControl.focus();
+ }
+
+ this.close();
+ },
+
+ /**
+ * Opens the panel.
+ */
+ open: function( sidebarControl ) {
+ this.currentSidebarControl = sidebarControl;
+
+ // Wide widget controls appear over the preview, and so they need to be collapsed when the panel opens
+ _( this.currentSidebarControl.getWidgetFormControls() ).each( function( control ) {
+ if ( control.params.is_wide ) {
+ control.collapseForm();
+ }
+ } );
+
+ if ( api.section.has( 'publish_settings' ) ) {
+ api.section( 'publish_settings' ).collapse();
+ }
+
+ $( 'body' ).addClass( 'adding-widget' );
+
+ this.$el.find( '.selected' ).removeClass( 'selected' );
+
+ // Reset search
+ this.collection.doSearch( '' );
+
+ if ( ! api.settings.browser.mobile ) {
+ this.$search.focus();
+ }
+ },
+
+ /**
+ * Closes the panel.
+ */
+ close: function( options ) {
+ options = options || {};
+
+ if ( options.returnFocus && this.currentSidebarControl ) {
+ this.currentSidebarControl.container.find( '.add-new-widget' ).focus();
+ }
+
+ this.currentSidebarControl = null;
+ this.selected = null;
+
+ $( 'body' ).removeClass( 'adding-widget' );
+
+ this.$search.val( '' );
+ },
+
+ /**
+ * Adds keyboard accessiblity to the panel.
+ */
+ keyboardAccessible: function( event ) {
+ var isEnter = ( event.which === 13 ),
+ isEsc = ( event.which === 27 ),
+ isDown = ( event.which === 40 ),
+ isUp = ( event.which === 38 ),
+ isTab = ( event.which === 9 ),
+ isShift = ( event.shiftKey ),
+ selected = null,
+ firstVisible = this.$el.find( '> .widget-tpl:visible:first' ),
+ lastVisible = this.$el.find( '> .widget-tpl:visible:last' ),
+ isSearchFocused = $( event.target ).is( this.$search ),
+ isLastWidgetFocused = $( event.target ).is( '.widget-tpl:visible:last' );
+
+ if ( isDown || isUp ) {
+ if ( isDown ) {
+ if ( isSearchFocused ) {
+ selected = firstVisible;
+ } else if ( this.selected && this.selected.nextAll( '.widget-tpl:visible' ).length !== 0 ) {
+ selected = this.selected.nextAll( '.widget-tpl:visible:first' );
+ }
+ } else if ( isUp ) {
+ if ( isSearchFocused ) {
+ selected = lastVisible;
+ } else if ( this.selected && this.selected.prevAll( '.widget-tpl:visible' ).length !== 0 ) {
+ selected = this.selected.prevAll( '.widget-tpl:visible:first' );
+ }
+ }
+
+ this.select( selected );
+
+ if ( selected ) {
+ selected.focus();
+ } else {
+ this.$search.focus();
+ }
+
+ return;
+ }
+
+ // If enter pressed but nothing entered, don't do anything
+ if ( isEnter && ! this.$search.val() ) {
+ return;
+ }
+
+ if ( isEnter ) {
+ this.submit();
+ } else if ( isEsc ) {
+ this.close( { returnFocus: true } );
+ }
+
+ if ( this.currentSidebarControl && isTab && ( isShift && isSearchFocused || ! isShift && isLastWidgetFocused ) ) {
+ this.currentSidebarControl.container.find( '.add-new-widget' ).focus();
+ event.preventDefault();
+ }
+ }
+ });
+
+ /**
+ * Handlers for the widget-synced event, organized by widget ID base.
+ * Other widgets may provide their own update handlers by adding
+ * listeners for the widget-synced event.
+ *
+ * @alias wp.customize.Widgets.formSyncHandlers
+ */
+ api.Widgets.formSyncHandlers = {
+
+ /**
+ * @param {jQuery.Event} e
+ * @param {jQuery} widget
+ * @param {String} newForm
+ */
+ rss: function( e, widget, newForm ) {
+ var oldWidgetError = widget.find( '.widget-error:first' ),
+ newWidgetError = $( '<div>' + newForm + '</div>' ).find( '.widget-error:first' );
+
+ if ( oldWidgetError.length && newWidgetError.length ) {
+ oldWidgetError.replaceWith( newWidgetError );
+ } else if ( oldWidgetError.length ) {
+ oldWidgetError.remove();
+ } else if ( newWidgetError.length ) {
+ widget.find( '.widget-content:first' ).prepend( newWidgetError );
+ }
+ }
+ };
+
+ api.Widgets.WidgetControl = api.Control.extend(/** @lends wp.customize.Widgets.WidgetControl.prototype */{
+ defaultExpandedArguments: {
+ duration: 'fast',
+ completeCallback: $.noop
+ },
+
+ /**
+ * wp.customize.Widgets.WidgetControl
+ *
+ * Customizer control for widgets.
+ * Note that 'widget_form' must match the WP_Widget_Form_Customize_Control::$type
+ *
+ * @since 4.1.0
+ *
+ * @constructs wp.customize.Widgets.WidgetControl
+ * @augments wp.customize.Control
+ */
+ initialize: function( id, options ) {
+ var control = this;
+
+ control.widgetControlEmbedded = false;
+ control.widgetContentEmbedded = false;
+ control.expanded = new api.Value( false );
+ control.expandedArgumentsQueue = [];
+ control.expanded.bind( function( expanded ) {
+ var args = control.expandedArgumentsQueue.shift();
+ args = $.extend( {}, control.defaultExpandedArguments, args );
+ control.onChangeExpanded( expanded, args );
+ });
+ control.altNotice = true;
+
+ api.Control.prototype.initialize.call( control, id, options );
+ },
+
+ /**
+ * Set up the control.
+ *
+ * @since 3.9.0
+ */
+ ready: function() {
+ var control = this;
+
+ /*
+ * Embed a placeholder once the section is expanded. The full widget
+ * form content will be embedded once the control itself is expanded,
+ * and at this point the widget-added event will be triggered.
+ */
+ if ( ! control.section() ) {
+ control.embedWidgetControl();
+ } else {
+ api.section( control.section(), function( section ) {
+ var onExpanded = function( isExpanded ) {
+ if ( isExpanded ) {
+ control.embedWidgetControl();
+ section.expanded.unbind( onExpanded );
+ }
+ };
+ if ( section.expanded() ) {
+ onExpanded( true );
+ } else {
+ section.expanded.bind( onExpanded );
+ }
+ } );
+ }
+ },
+
+ /**
+ * Embed the .widget element inside the li container.
+ *
+ * @since 4.4.0
+ */
+ embedWidgetControl: function() {
+ var control = this, widgetControl;
+
+ if ( control.widgetControlEmbedded ) {
+ return;
+ }
+ control.widgetControlEmbedded = true;
+
+ widgetControl = $( control.params.widget_control );
+ control.container.append( widgetControl );
+
+ control._setupModel();
+ control._setupWideWidget();
+ control._setupControlToggle();
+
+ control._setupWidgetTitle();
+ control._setupReorderUI();
+ control._setupHighlightEffects();
+ control._setupUpdateUI();
+ control._setupRemoveUI();
+ },
+
+ /**
+ * Embed the actual widget form inside of .widget-content and finally trigger the widget-added event.
+ *
+ * @since 4.4.0
+ */
+ embedWidgetContent: function() {
+ var control = this, widgetContent;
+
+ control.embedWidgetControl();
+ if ( control.widgetContentEmbedded ) {
+ return;
+ }
+ control.widgetContentEmbedded = true;
+
+ // Update the notification container element now that the widget content has been embedded.
+ control.notifications.container = control.getNotificationsContainerElement();
+ control.notifications.render();
+
+ widgetContent = $( control.params.widget_content );
+ control.container.find( '.widget-content:first' ).append( widgetContent );
+
+ /*
+ * Trigger widget-added event so that plugins can attach any event
+ * listeners and dynamic UI elements.
+ */
+ $( document ).trigger( 'widget-added', [ control.container.find( '.widget:first' ) ] );
+
+ },
+
+ /**
+ * Handle changes to the setting
+ */
+ _setupModel: function() {
+ var self = this, rememberSavedWidgetId;
+
+ // Remember saved widgets so we know which to trash (move to inactive widgets sidebar)
+ rememberSavedWidgetId = function() {
+ api.Widgets.savedWidgetIds[self.params.widget_id] = true;
+ };
+ api.bind( 'ready', rememberSavedWidgetId );
+ api.bind( 'saved', rememberSavedWidgetId );
+
+ this._updateCount = 0;
+ this.isWidgetUpdating = false;
+ this.liveUpdateMode = true;
+
+ // Update widget whenever model changes
+ this.setting.bind( function( to, from ) {
+ if ( ! _( from ).isEqual( to ) && ! self.isWidgetUpdating ) {
+ self.updateWidget( { instance: to } );
+ }
+ } );
+ },
+
+ /**
+ * Add special behaviors for wide widget controls
+ */
+ _setupWideWidget: function() {
+ var self = this, $widgetInside, $widgetForm, $customizeSidebar,
+ $themeControlsContainer, positionWidget;
+
+ if ( ! this.params.is_wide || $( window ).width() <= 640 /* max-width breakpoint in customize-controls.css */ ) {
+ return;
+ }
+
+ $widgetInside = this.container.find( '.widget-inside' );
+ $widgetForm = $widgetInside.find( '> .form' );
+ $customizeSidebar = $( '.wp-full-overlay-sidebar-content:first' );
+ this.container.addClass( 'wide-widget-control' );
+
+ this.container.find( '.form:first' ).css( {
+ 'max-width': this.params.width,
+ 'min-height': this.params.height
+ } );
+
+ /**
+ * Keep the widget-inside positioned so the top of fixed-positioned
+ * element is at the same top position as the widget-top. When the
+ * widget-top is scrolled out of view, keep the widget-top in view;
+ * likewise, don't allow the widget to drop off the bottom of the window.
+ * If a widget is too tall to fit in the window, don't let the height
+ * exceed the window height so that the contents of the widget control
+ * will become scrollable (overflow:auto).
+ */
+ positionWidget = function() {
+ var offsetTop = self.container.offset().top,
+ windowHeight = $( window ).height(),
+ formHeight = $widgetForm.outerHeight(),
+ top;
+ $widgetInside.css( 'max-height', windowHeight );
+ top = Math.max(
+ 0, // prevent top from going off screen
+ Math.min(
+ Math.max( offsetTop, 0 ), // distance widget in panel is from top of screen
+ windowHeight - formHeight // flush up against bottom of screen
+ )
+ );
+ $widgetInside.css( 'top', top );
+ };
+
+ $themeControlsContainer = $( '#customize-theme-controls' );
+ this.container.on( 'expand', function() {
+ positionWidget();
+ $customizeSidebar.on( 'scroll', positionWidget );
+ $( window ).on( 'resize', positionWidget );
+ $themeControlsContainer.on( 'expanded collapsed', positionWidget );
+ } );
+ this.container.on( 'collapsed', function() {
+ $customizeSidebar.off( 'scroll', positionWidget );
+ $( window ).off( 'resize', positionWidget );
+ $themeControlsContainer.off( 'expanded collapsed', positionWidget );
+ } );
+
+ // Reposition whenever a sidebar's widgets are changed
+ api.each( function( setting ) {
+ if ( 0 === setting.id.indexOf( 'sidebars_widgets[' ) ) {
+ setting.bind( function() {
+ if ( self.container.hasClass( 'expanded' ) ) {
+ positionWidget();
+ }
+ } );
+ }
+ } );
+ },
+
+ /**
+ * Show/hide the control when clicking on the form title, when clicking
+ * the close button
+ */
+ _setupControlToggle: function() {
+ var self = this, $closeBtn;
+
+ this.container.find( '.widget-top' ).on( 'click', function( e ) {
+ e.preventDefault();
+ var sidebarWidgetsControl = self.getSidebarWidgetsControl();
+ if ( sidebarWidgetsControl.isReordering ) {
+ return;
+ }
+ self.expanded( ! self.expanded() );
+ } );
+
+ $closeBtn = this.container.find( '.widget-control-close' );
+ $closeBtn.on( 'click', function() {
+ self.collapse();
+ self.container.find( '.widget-top .widget-action:first' ).focus(); // keyboard accessibility
+ } );
+ },
+
+ /**
+ * Update the title of the form if a title field is entered
+ */
+ _setupWidgetTitle: function() {
+ var self = this, updateTitle;
+
+ updateTitle = function() {
+ var title = self.setting().title,
+ inWidgetTitle = self.container.find( '.in-widget-title' );
+
+ if ( title ) {
+ inWidgetTitle.text( ': ' + title );
+ } else {
+ inWidgetTitle.text( '' );
+ }
+ };
+ this.setting.bind( updateTitle );
+ updateTitle();
+ },
+
+ /**
+ * Set up the widget-reorder-nav
+ */
+ _setupReorderUI: function() {
+ var self = this, selectSidebarItem, $moveWidgetArea,
+ $reorderNav, updateAvailableSidebars, template;
+
+ /**
+ * select the provided sidebar list item in the move widget area
+ *
+ * @param {jQuery} li
+ */
+ selectSidebarItem = function( li ) {
+ li.siblings( '.selected' ).removeClass( 'selected' );
+ li.addClass( 'selected' );
+ var isSelfSidebar = ( li.data( 'id' ) === self.params.sidebar_id );
+ self.container.find( '.move-widget-btn' ).prop( 'disabled', isSelfSidebar );
+ };
+
+ /**
+ * Add the widget reordering elements to the widget control
+ */
+ this.container.find( '.widget-title-action' ).after( $( api.Widgets.data.tpl.widgetReorderNav ) );
+
+
+ template = _.template( api.Widgets.data.tpl.moveWidgetArea );
+ $moveWidgetArea = $( template( {
+ sidebars: _( api.Widgets.registeredSidebars.toArray() ).pluck( 'attributes' )
+ } )
+ );
+ this.container.find( '.widget-top' ).after( $moveWidgetArea );
+
+ /**
+ * Update available sidebars when their rendered state changes
+ */
+ updateAvailableSidebars = function() {
+ var $sidebarItems = $moveWidgetArea.find( 'li' ), selfSidebarItem,
+ renderedSidebarCount = 0;
+
+ selfSidebarItem = $sidebarItems.filter( function(){
+ return $( this ).data( 'id' ) === self.params.sidebar_id;
+ } );
+
+ $sidebarItems.each( function() {
+ var li = $( this ),
+ sidebarId, sidebar, sidebarIsRendered;
+
+ sidebarId = li.data( 'id' );
+ sidebar = api.Widgets.registeredSidebars.get( sidebarId );
+ sidebarIsRendered = sidebar.get( 'is_rendered' );
+
+ li.toggle( sidebarIsRendered );
+
+ if ( sidebarIsRendered ) {
+ renderedSidebarCount += 1;
+ }
+
+ if ( li.hasClass( 'selected' ) && ! sidebarIsRendered ) {
+ selectSidebarItem( selfSidebarItem );
+ }
+ } );
+
+ if ( renderedSidebarCount > 1 ) {
+ self.container.find( '.move-widget' ).show();
+ } else {
+ self.container.find( '.move-widget' ).hide();
+ }
+ };
+
+ updateAvailableSidebars();
+ api.Widgets.registeredSidebars.on( 'change:is_rendered', updateAvailableSidebars );
+
+ /**
+ * Handle clicks for up/down/move on the reorder nav
+ */
+ $reorderNav = this.container.find( '.widget-reorder-nav' );
+ $reorderNav.find( '.move-widget, .move-widget-down, .move-widget-up' ).each( function() {
+ $( this ).prepend( self.container.find( '.widget-title' ).text() + ': ' );
+ } ).on( 'click keypress', function( event ) {
+ if ( event.type === 'keypress' && ( event.which !== 13 && event.which !== 32 ) ) {
+ return;
+ }
+ $( this ).focus();
+
+ if ( $( this ).is( '.move-widget' ) ) {
+ self.toggleWidgetMoveArea();
+ } else {
+ var isMoveDown = $( this ).is( '.move-widget-down' ),
+ isMoveUp = $( this ).is( '.move-widget-up' ),
+ i = self.getWidgetSidebarPosition();
+
+ if ( ( isMoveUp && i === 0 ) || ( isMoveDown && i === self.getSidebarWidgetsControl().setting().length - 1 ) ) {
+ return;
+ }
+
+ if ( isMoveUp ) {
+ self.moveUp();
+ wp.a11y.speak( l10n.widgetMovedUp );
+ } else {
+ self.moveDown();
+ wp.a11y.speak( l10n.widgetMovedDown );
+ }
+
+ $( this ).focus(); // re-focus after the container was moved
+ }
+ } );
+
+ /**
+ * Handle selecting a sidebar to move to
+ */
+ this.container.find( '.widget-area-select' ).on( 'click keypress', 'li', function( event ) {
+ if ( event.type === 'keypress' && ( event.which !== 13 && event.which !== 32 ) ) {
+ return;
+ }
+ event.preventDefault();
+ selectSidebarItem( $( this ) );
+ } );
+
+ /**
+ * Move widget to another sidebar
+ */
+ this.container.find( '.move-widget-btn' ).click( function() {
+ self.getSidebarWidgetsControl().toggleReordering( false );
+
+ var oldSidebarId = self.params.sidebar_id,
+ newSidebarId = self.container.find( '.widget-area-select li.selected' ).data( 'id' ),
+ oldSidebarWidgetsSetting, newSidebarWidgetsSetting,
+ oldSidebarWidgetIds, newSidebarWidgetIds, i;
+
+ oldSidebarWidgetsSetting = api( 'sidebars_widgets[' + oldSidebarId + ']' );
+ newSidebarWidgetsSetting = api( 'sidebars_widgets[' + newSidebarId + ']' );
+ oldSidebarWidgetIds = Array.prototype.slice.call( oldSidebarWidgetsSetting() );
+ newSidebarWidgetIds = Array.prototype.slice.call( newSidebarWidgetsSetting() );
+
+ i = self.getWidgetSidebarPosition();
+ oldSidebarWidgetIds.splice( i, 1 );
+ newSidebarWidgetIds.push( self.params.widget_id );
+
+ oldSidebarWidgetsSetting( oldSidebarWidgetIds );
+ newSidebarWidgetsSetting( newSidebarWidgetIds );
+
+ self.focus();
+ } );
+ },
+
+ /**
+ * Highlight widgets in preview when interacted with in the Customizer
+ */
+ _setupHighlightEffects: function() {
+ var self = this;
+
+ // Highlight whenever hovering or clicking over the form
+ this.container.on( 'mouseenter click', function() {
+ self.setting.previewer.send( 'highlight-widget', self.params.widget_id );
+ } );
+
+ // Highlight when the setting is updated
+ this.setting.bind( function() {
+ self.setting.previewer.send( 'highlight-widget', self.params.widget_id );
+ } );
+ },
+
+ /**
+ * Set up event handlers for widget updating
+ */
+ _setupUpdateUI: function() {
+ var self = this, $widgetRoot, $widgetContent,
+ $saveBtn, updateWidgetDebounced, formSyncHandler;
+
+ $widgetRoot = this.container.find( '.widget:first' );
+ $widgetContent = $widgetRoot.find( '.widget-content:first' );
+
+ // Configure update button
+ $saveBtn = this.container.find( '.widget-control-save' );
+ $saveBtn.val( l10n.saveBtnLabel );
+ $saveBtn.attr( 'title', l10n.saveBtnTooltip );
+ $saveBtn.removeClass( 'button-primary' );
+ $saveBtn.on( 'click', function( e ) {
+ e.preventDefault();
+ self.updateWidget( { disable_form: true } ); // @todo disable_form is unused?
+ } );
+
+ updateWidgetDebounced = _.debounce( function() {
+ self.updateWidget();
+ }, 250 );
+
+ // Trigger widget form update when hitting Enter within an input
+ $widgetContent.on( 'keydown', 'input', function( e ) {
+ if ( 13 === e.which ) { // Enter
+ e.preventDefault();
+ self.updateWidget( { ignoreActiveElement: true } );
+ }
+ } );
+
+ // Handle widgets that support live previews
+ $widgetContent.on( 'change input propertychange', ':input', function( e ) {
+ if ( ! self.liveUpdateMode ) {
+ return;
+ }
+ if ( e.type === 'change' || ( this.checkValidity && this.checkValidity() ) ) {
+ updateWidgetDebounced();
+ }
+ } );
+
+ // Remove loading indicators when the setting is saved and the preview updates
+ this.setting.previewer.channel.bind( 'synced', function() {
+ self.container.removeClass( 'previewer-loading' );
+ } );
+
+ api.previewer.bind( 'widget-updated', function( updatedWidgetId ) {
+ if ( updatedWidgetId === self.params.widget_id ) {
+ self.container.removeClass( 'previewer-loading' );
+ }
+ } );
+
+ formSyncHandler = api.Widgets.formSyncHandlers[ this.params.widget_id_base ];
+ if ( formSyncHandler ) {
+ $( document ).on( 'widget-synced', function( e, widget ) {
+ if ( $widgetRoot.is( widget ) ) {
+ formSyncHandler.apply( document, arguments );
+ }
+ } );
+ }
+ },
+
+ /**
+ * Update widget control to indicate whether it is currently rendered.
+ *
+ * Overrides api.Control.toggle()
+ *
+ * @since 4.1.0
+ *
+ * @param {Boolean} active
+ * @param {Object} args
+ * @param {function} args.completeCallback
+ */
+ onChangeActive: function ( active, args ) {
+ // Note: there is a second 'args' parameter being passed, merged on top of this.defaultActiveArguments
+ this.container.toggleClass( 'widget-rendered', active );
+ if ( args.completeCallback ) {
+ args.completeCallback();
+ }
+ },
+
+ /**
+ * Set up event handlers for widget removal
+ */
+ _setupRemoveUI: function() {
+ var self = this, $removeBtn, replaceDeleteWithRemove;
+
+ // Configure remove button
+ $removeBtn = this.container.find( '.widget-control-remove' );
+ $removeBtn.on( 'click', function() {
+ // Find an adjacent element to add focus to when this widget goes away
+ var $adjacentFocusTarget;
+ if ( self.container.next().is( '.customize-control-widget_form' ) ) {
+ $adjacentFocusTarget = self.container.next().find( '.widget-action:first' );
+ } else if ( self.container.prev().is( '.customize-control-widget_form' ) ) {
+ $adjacentFocusTarget = self.container.prev().find( '.widget-action:first' );
+ } else {
+ $adjacentFocusTarget = self.container.next( '.customize-control-sidebar_widgets' ).find( '.add-new-widget:first' );
+ }
+
+ self.container.slideUp( function() {
+ var sidebarsWidgetsControl = api.Widgets.getSidebarWidgetControlContainingWidget( self.params.widget_id ),
+ sidebarWidgetIds, i;
+
+ if ( ! sidebarsWidgetsControl ) {
+ return;
+ }
+
+ sidebarWidgetIds = sidebarsWidgetsControl.setting().slice();
+ i = _.indexOf( sidebarWidgetIds, self.params.widget_id );
+ if ( -1 === i ) {
+ return;
+ }
+
+ sidebarWidgetIds.splice( i, 1 );
+ sidebarsWidgetsControl.setting( sidebarWidgetIds );
+
+ $adjacentFocusTarget.focus(); // keyboard accessibility
+ } );
+ } );
+
+ replaceDeleteWithRemove = function() {
+ $removeBtn.text( l10n.removeBtnLabel ); // wp_widget_control() outputs the button as "Delete"
+ $removeBtn.attr( 'title', l10n.removeBtnTooltip );
+ };
+
+ if ( this.params.is_new ) {
+ api.bind( 'saved', replaceDeleteWithRemove );
+ } else {
+ replaceDeleteWithRemove();
+ }
+ },
+
+ /**
+ * Find all inputs in a widget container that should be considered when
+ * comparing the loaded form with the sanitized form, whose fields will
+ * be aligned to copy the sanitized over. The elements returned by this
+ * are passed into this._getInputsSignature(), and they are iterated
+ * over when copying sanitized values over to the form loaded.
+ *
+ * @param {jQuery} container element in which to look for inputs
+ * @returns {jQuery} inputs
+ * @private
+ */
+ _getInputs: function( container ) {
+ return $( container ).find( ':input[name]' );
+ },
+
+ /**
+ * Iterate over supplied inputs and create a signature string for all of them together.
+ * This string can be used to compare whether or not the form has all of the same fields.
+ *
+ * @param {jQuery} inputs
+ * @returns {string}
+ * @private
+ */
+ _getInputsSignature: function( inputs ) {
+ var inputsSignatures = _( inputs ).map( function( input ) {
+ var $input = $( input ), signatureParts;
+
+ if ( $input.is( ':checkbox, :radio' ) ) {
+ signatureParts = [ $input.attr( 'id' ), $input.attr( 'name' ), $input.prop( 'value' ) ];
+ } else {
+ signatureParts = [ $input.attr( 'id' ), $input.attr( 'name' ) ];
+ }
+
+ return signatureParts.join( ',' );
+ } );
+
+ return inputsSignatures.join( ';' );
+ },
+
+ /**
+ * Get the state for an input depending on its type.
+ *
+ * @param {jQuery|Element} input
+ * @returns {string|boolean|array|*}
+ * @private
+ */
+ _getInputState: function( input ) {
+ input = $( input );
+ if ( input.is( ':radio, :checkbox' ) ) {
+ return input.prop( 'checked' );
+ } else if ( input.is( 'select[multiple]' ) ) {
+ return input.find( 'option:selected' ).map( function () {
+ return $( this ).val();
+ } ).get();
+ } else {
+ return input.val();
+ }
+ },
+
+ /**
+ * Update an input's state based on its type.
+ *
+ * @param {jQuery|Element} input
+ * @param {string|boolean|array|*} state
+ * @private
+ */
+ _setInputState: function ( input, state ) {
+ input = $( input );
+ if ( input.is( ':radio, :checkbox' ) ) {
+ input.prop( 'checked', state );
+ } else if ( input.is( 'select[multiple]' ) ) {
+ if ( ! $.isArray( state ) ) {
+ state = [];
+ } else {
+ // Make sure all state items are strings since the DOM value is a string
+ state = _.map( state, function ( value ) {
+ return String( value );
+ } );
+ }
+ input.find( 'option' ).each( function () {
+ $( this ).prop( 'selected', -1 !== _.indexOf( state, String( this.value ) ) );
+ } );
+ } else {
+ input.val( state );
+ }
+ },
+
+ /***********************************************************************
+ * Begin public API methods
+ **********************************************************************/
+
+ /**
+ * @return {wp.customize.controlConstructor.sidebar_widgets[]}
+ */
+ getSidebarWidgetsControl: function() {
+ var settingId, sidebarWidgetsControl;
+
+ settingId = 'sidebars_widgets[' + this.params.sidebar_id + ']';
+ sidebarWidgetsControl = api.control( settingId );
+
+ if ( ! sidebarWidgetsControl ) {
+ return;
+ }
+
+ return sidebarWidgetsControl;
+ },
+
+ /**
+ * Submit the widget form via Ajax and get back the updated instance,
+ * along with the new widget control form to render.
+ *
+ * @param {object} [args]
+ * @param {Object|null} [args.instance=null] When the model changes, the instance is sent here; otherwise, the inputs from the form are used
+ * @param {Function|null} [args.complete=null] Function which is called when the request finishes. Context is bound to the control. First argument is any error. Following arguments are for success.
+ * @param {Boolean} [args.ignoreActiveElement=false] Whether or not updating a field will be deferred if focus is still on the element.
+ */
+ updateWidget: function( args ) {
+ var self = this, instanceOverride, completeCallback, $widgetRoot, $widgetContent,
+ updateNumber, params, data, $inputs, processing, jqxhr, isChanged;
+
+ // The updateWidget logic requires that the form fields to be fully present.
+ self.embedWidgetContent();
+
+ args = $.extend( {
+ instance: null,
+ complete: null,
+ ignoreActiveElement: false
+ }, args );
+
+ instanceOverride = args.instance;
+ completeCallback = args.complete;
+
+ this._updateCount += 1;
+ updateNumber = this._updateCount;
+
+ $widgetRoot = this.container.find( '.widget:first' );
+ $widgetContent = $widgetRoot.find( '.widget-content:first' );
+
+ // Remove a previous error message
+ $widgetContent.find( '.widget-error' ).remove();
+
+ this.container.addClass( 'widget-form-loading' );
+ this.container.addClass( 'previewer-loading' );
+ processing = api.state( 'processing' );
+ processing( processing() + 1 );
+
+ if ( ! this.liveUpdateMode ) {
+ this.container.addClass( 'widget-form-disabled' );
+ }
+
+ params = {};
+ params.action = 'update-widget';
+ params.wp_customize = 'on';
+ params.nonce = api.settings.nonce['update-widget'];
+ params.customize_theme = api.settings.theme.stylesheet;
+ params.customized = wp.customize.previewer.query().customized;
+
+ data = $.param( params );
+ $inputs = this._getInputs( $widgetContent );
+
+ // Store the value we're submitting in data so that when the response comes back,
+ // we know if it got sanitized; if there is no difference in the sanitized value,
+ // then we do not need to touch the UI and mess up the user's ongoing editing.
+ $inputs.each( function() {
+ $( this ).data( 'state' + updateNumber, self._getInputState( this ) );
+ } );
+
+ if ( instanceOverride ) {
+ data += '&' + $.param( { 'sanitized_widget_setting': JSON.stringify( instanceOverride ) } );
+ } else {
+ data += '&' + $inputs.serialize();
+ }
+ data += '&' + $widgetContent.find( '~ :input' ).serialize();
+
+ if ( this._previousUpdateRequest ) {
+ this._previousUpdateRequest.abort();
+ }
+ jqxhr = $.post( wp.ajax.settings.url, data );
+ this._previousUpdateRequest = jqxhr;
+
+ jqxhr.done( function( r ) {
+ var message, sanitizedForm, $sanitizedInputs, hasSameInputsInResponse,
+ isLiveUpdateAborted = false;
+
+ // Check if the user is logged out.
+ if ( '0' === r ) {
+ api.previewer.preview.iframe.hide();
+ api.previewer.login().done( function() {
+ self.updateWidget( args );
+ api.previewer.preview.iframe.show();
+ } );
+ return;
+ }
+
+ // Check for cheaters.
+ if ( '-1' === r ) {
+ api.previewer.cheatin();
+ return;
+ }
+
+ if ( r.success ) {
+ sanitizedForm = $( '<div>' + r.data.form + '</div>' );
+ $sanitizedInputs = self._getInputs( sanitizedForm );
+ hasSameInputsInResponse = self._getInputsSignature( $inputs ) === self._getInputsSignature( $sanitizedInputs );
+
+ // Restore live update mode if sanitized fields are now aligned with the existing fields
+ if ( hasSameInputsInResponse && ! self.liveUpdateMode ) {
+ self.liveUpdateMode = true;
+ self.container.removeClass( 'widget-form-disabled' );
+ self.container.find( 'input[name="savewidget"]' ).hide();
+ }
+
+ // Sync sanitized field states to existing fields if they are aligned
+ if ( hasSameInputsInResponse && self.liveUpdateMode ) {
+ $inputs.each( function( i ) {
+ var $input = $( this ),
+ $sanitizedInput = $( $sanitizedInputs[i] ),
+ submittedState, sanitizedState, canUpdateState;
+
+ submittedState = $input.data( 'state' + updateNumber );
+ sanitizedState = self._getInputState( $sanitizedInput );
+ $input.data( 'sanitized', sanitizedState );
+
+ canUpdateState = ( ! _.isEqual( submittedState, sanitizedState ) && ( args.ignoreActiveElement || ! $input.is( document.activeElement ) ) );
+ if ( canUpdateState ) {
+ self._setInputState( $input, sanitizedState );
+ }
+ } );
+
+ $( document ).trigger( 'widget-synced', [ $widgetRoot, r.data.form ] );
+
+ // Otherwise, if sanitized fields are not aligned with existing fields, disable live update mode if enabled
+ } else if ( self.liveUpdateMode ) {
+ self.liveUpdateMode = false;
+ self.container.find( 'input[name="savewidget"]' ).show();
+ isLiveUpdateAborted = true;
+
+ // Otherwise, replace existing form with the sanitized form
+ } else {
+ $widgetContent.html( r.data.form );
+
+ self.container.removeClass( 'widget-form-disabled' );
+
+ $( document ).trigger( 'widget-updated', [ $widgetRoot ] );
+ }
+
+ /**
+ * If the old instance is identical to the new one, there is nothing new
+ * needing to be rendered, and so we can preempt the event for the
+ * preview finishing loading.
+ */
+ isChanged = ! isLiveUpdateAborted && ! _( self.setting() ).isEqual( r.data.instance );
+ if ( isChanged ) {
+ self.isWidgetUpdating = true; // suppress triggering another updateWidget
+ self.setting( r.data.instance );
+ self.isWidgetUpdating = false;
+ } else {
+ // no change was made, so stop the spinner now instead of when the preview would updates
+ self.container.removeClass( 'previewer-loading' );
+ }
+
+ if ( completeCallback ) {
+ completeCallback.call( self, null, { noChange: ! isChanged, ajaxFinished: true } );
+ }
+ } else {
+ // General error message
+ message = l10n.error;
+
+ if ( r.data && r.data.message ) {
+ message = r.data.message;
+ }
+
+ if ( completeCallback ) {
+ completeCallback.call( self, message );
+ } else {
+ $widgetContent.prepend( '<p class="widget-error"><strong>' + message + '</strong></p>' );
+ }
+ }
+ } );
+
+ jqxhr.fail( function( jqXHR, textStatus ) {
+ if ( completeCallback ) {
+ completeCallback.call( self, textStatus );
+ }
+ } );
+
+ jqxhr.always( function() {
+ self.container.removeClass( 'widget-form-loading' );
+
+ $inputs.each( function() {
+ $( this ).removeData( 'state' + updateNumber );
+ } );
+
+ processing( processing() - 1 );
+ } );
+ },
+
+ /**
+ * Expand the accordion section containing a control
+ */
+ expandControlSection: function() {
+ api.Control.prototype.expand.call( this );
+ },
+
+ /**
+ * @since 4.1.0
+ *
+ * @param {Boolean} expanded
+ * @param {Object} [params]
+ * @returns {Boolean} false if state already applied
+ */
+ _toggleExpanded: api.Section.prototype._toggleExpanded,
+
+ /**
+ * @since 4.1.0
+ *
+ * @param {Object} [params]
+ * @returns {Boolean} false if already expanded
+ */
+ expand: api.Section.prototype.expand,
+
+ /**
+ * Expand the widget form control
+ *
+ * @deprecated 4.1.0 Use this.expand() instead.
+ */
+ expandForm: function() {
+ this.expand();
+ },
+
+ /**
+ * @since 4.1.0
+ *
+ * @param {Object} [params]
+ * @returns {Boolean} false if already collapsed
+ */
+ collapse: api.Section.prototype.collapse,
+
+ /**
+ * Collapse the widget form control
+ *
+ * @deprecated 4.1.0 Use this.collapse() instead.
+ */
+ collapseForm: function() {
+ this.collapse();
+ },
+
+ /**
+ * Expand or collapse the widget control
+ *
+ * @deprecated this is poor naming, and it is better to directly set control.expanded( showOrHide )
+ *
+ * @param {boolean|undefined} [showOrHide] If not supplied, will be inverse of current visibility
+ */
+ toggleForm: function( showOrHide ) {
+ if ( typeof showOrHide === 'undefined' ) {
+ showOrHide = ! this.expanded();
+ }
+ this.expanded( showOrHide );
+ },
+
+ /**
+ * Respond to change in the expanded state.
+ *
+ * @param {Boolean} expanded
+ * @param {Object} args merged on top of this.defaultActiveArguments
+ */
+ onChangeExpanded: function ( expanded, args ) {
+ var self = this, $widget, $inside, complete, prevComplete, expandControl, $toggleBtn;
+
+ self.embedWidgetControl(); // Make sure the outer form is embedded so that the expanded state can be set in the UI.
+ if ( expanded ) {
+ self.embedWidgetContent();
+ }
+
+ // If the expanded state is unchanged only manipulate container expanded states
+ if ( args.unchanged ) {
+ if ( expanded ) {
+ api.Control.prototype.expand.call( self, {
+ completeCallback: args.completeCallback
+ });
+ }
+ return;
+ }
+
+ $widget = this.container.find( 'div.widget:first' );
+ $inside = $widget.find( '.widget-inside:first' );
+ $toggleBtn = this.container.find( '.widget-top button.widget-action' );
+
+ expandControl = function() {
+
+ // Close all other widget controls before expanding this one
+ api.control.each( function( otherControl ) {
+ if ( self.params.type === otherControl.params.type && self !== otherControl ) {
+ otherControl.collapse();
+ }
+ } );
+
+ complete = function() {
+ self.container.removeClass( 'expanding' );
+ self.container.addClass( 'expanded' );
+ $widget.addClass( 'open' );
+ $toggleBtn.attr( 'aria-expanded', 'true' );
+ self.container.trigger( 'expanded' );
+ };
+ if ( args.completeCallback ) {
+ prevComplete = complete;
+ complete = function () {
+ prevComplete();
+ args.completeCallback();
+ };
+ }
+
+ if ( self.params.is_wide ) {
+ $inside.fadeIn( args.duration, complete );
+ } else {
+ $inside.slideDown( args.duration, complete );
+ }
+
+ self.container.trigger( 'expand' );
+ self.container.addClass( 'expanding' );
+ };
+
+ if ( expanded ) {
+ if ( api.section.has( self.section() ) ) {
+ api.section( self.section() ).expand( {
+ completeCallback: expandControl
+ } );
+ } else {
+ expandControl();
+ }
+ } else {
+ complete = function() {
+ self.container.removeClass( 'collapsing' );
+ self.container.removeClass( 'expanded' );
+ $widget.removeClass( 'open' );
+ $toggleBtn.attr( 'aria-expanded', 'false' );
+ self.container.trigger( 'collapsed' );
+ };
+ if ( args.completeCallback ) {
+ prevComplete = complete;
+ complete = function () {
+ prevComplete();
+ args.completeCallback();
+ };
+ }
+
+ self.container.trigger( 'collapse' );
+ self.container.addClass( 'collapsing' );
+
+ if ( self.params.is_wide ) {
+ $inside.fadeOut( args.duration, complete );
+ } else {
+ $inside.slideUp( args.duration, function() {
+ $widget.css( { width:'', margin:'' } );
+ complete();
+ } );
+ }
+ }
+ },
+
+ /**
+ * Get the position (index) of the widget in the containing sidebar
+ *
+ * @returns {Number}
+ */
+ getWidgetSidebarPosition: function() {
+ var sidebarWidgetIds, position;
+
+ sidebarWidgetIds = this.getSidebarWidgetsControl().setting();
+ position = _.indexOf( sidebarWidgetIds, this.params.widget_id );
+
+ if ( position === -1 ) {
+ return;
+ }
+
+ return position;
+ },
+
+ /**
+ * Move widget up one in the sidebar
+ */
+ moveUp: function() {
+ this._moveWidgetByOne( -1 );
+ },
+
+ /**
+ * Move widget up one in the sidebar
+ */
+ moveDown: function() {
+ this._moveWidgetByOne( 1 );
+ },
+
+ /**
+ * @private
+ *
+ * @param {Number} offset 1|-1
+ */
+ _moveWidgetByOne: function( offset ) {
+ var i, sidebarWidgetsSetting, sidebarWidgetIds, adjacentWidgetId;
+
+ i = this.getWidgetSidebarPosition();
+
+ sidebarWidgetsSetting = this.getSidebarWidgetsControl().setting;
+ sidebarWidgetIds = Array.prototype.slice.call( sidebarWidgetsSetting() ); // clone
+ adjacentWidgetId = sidebarWidgetIds[i + offset];
+ sidebarWidgetIds[i + offset] = this.params.widget_id;
+ sidebarWidgetIds[i] = adjacentWidgetId;
+
+ sidebarWidgetsSetting( sidebarWidgetIds );
+ },
+
+ /**
+ * Toggle visibility of the widget move area
+ *
+ * @param {Boolean} [showOrHide]
+ */
+ toggleWidgetMoveArea: function( showOrHide ) {
+ var self = this, $moveWidgetArea;
+
+ $moveWidgetArea = this.container.find( '.move-widget-area' );
+
+ if ( typeof showOrHide === 'undefined' ) {
+ showOrHide = ! $moveWidgetArea.hasClass( 'active' );
+ }
+
+ if ( showOrHide ) {
+ // reset the selected sidebar
+ $moveWidgetArea.find( '.selected' ).removeClass( 'selected' );
+
+ $moveWidgetArea.find( 'li' ).filter( function() {
+ return $( this ).data( 'id' ) === self.params.sidebar_id;
+ } ).addClass( 'selected' );
+
+ this.container.find( '.move-widget-btn' ).prop( 'disabled', true );
+ }
+
+ $moveWidgetArea.toggleClass( 'active', showOrHide );
+ },
+
+ /**
+ * Highlight the widget control and section
+ */
+ highlightSectionAndControl: function() {
+ var $target;
+
+ if ( this.container.is( ':hidden' ) ) {
+ $target = this.container.closest( '.control-section' );
+ } else {
+ $target = this.container;
+ }
+
+ $( '.highlighted' ).removeClass( 'highlighted' );
+ $target.addClass( 'highlighted' );
+
+ setTimeout( function() {
+ $target.removeClass( 'highlighted' );
+ }, 500 );
+ }
+ } );
+
+ /**
+ * wp.customize.Widgets.WidgetsPanel
+ *
+ * Customizer panel containing the widget area sections.
+ *
+ * @since 4.4.0
+ *
+ * @class wp.customize.Widgets.WidgetsPanel
+ * @augments wp.customize.Panel
+ */
+ api.Widgets.WidgetsPanel = api.Panel.extend(/** @lends wp.customize.Widgets.WigetsPanel.prototype */{
+
+ /**
+ * Add and manage the display of the no-rendered-areas notice.
+ *
+ * @since 4.4.0
+ */
+ ready: function () {
+ var panel = this;
+
+ api.Panel.prototype.ready.call( panel );
+
+ panel.deferred.embedded.done(function() {
+ var panelMetaContainer, noticeContainer, updateNotice, getActiveSectionCount, shouldShowNotice;
+ panelMetaContainer = panel.container.find( '.panel-meta' );
+
+ // @todo This should use the Notifications API introduced to panels. See <https://core.trac.wordpress.org/ticket/38794>.
+ noticeContainer = $( '<div></div>', {
+ 'class': 'no-widget-areas-rendered-notice'
+ });
+ panelMetaContainer.append( noticeContainer );
+
+ /**
+ * Get the number of active sections in the panel.
+ *
+ * @return {number} Number of active sidebar sections.
+ */
+ getActiveSectionCount = function() {
+ return _.filter( panel.sections(), function( section ) {
+ return 'sidebar' === section.params.type && section.active();
+ } ).length;
+ };
+
+ /**
+ * Determine whether or not the notice should be displayed.
+ *
+ * @return {boolean}
+ */
+ shouldShowNotice = function() {
+ var activeSectionCount = getActiveSectionCount();
+ if ( 0 === activeSectionCount ) {
+ return true;
+ } else {
+ return activeSectionCount !== api.Widgets.data.registeredSidebars.length;
+ }
+ };
+
+ /**
+ * Update the notice.
+ *
+ * @returns {void}
+ */
+ updateNotice = function() {
+ var activeSectionCount = getActiveSectionCount(), someRenderedMessage, nonRenderedAreaCount, registeredAreaCount;
+ noticeContainer.empty();
+
+ registeredAreaCount = api.Widgets.data.registeredSidebars.length;
+ if ( activeSectionCount !== registeredAreaCount ) {
+
+ if ( 0 !== activeSectionCount ) {
+ nonRenderedAreaCount = registeredAreaCount - activeSectionCount;
+ someRenderedMessage = l10n.someAreasShown[ nonRenderedAreaCount ];
+ } else {
+ someRenderedMessage = l10n.noAreasShown;
+ }
+ if ( someRenderedMessage ) {
+ noticeContainer.append( $( '<p></p>', {
+ text: someRenderedMessage
+ } ) );
+ }
+
+ noticeContainer.append( $( '<p></p>', {
+ text: l10n.navigatePreview
+ } ) );
+ }
+ };
+ updateNotice();
+
+ /*
+ * Set the initial visibility state for rendered notice.
+ * Update the visibility of the notice whenever a reflow happens.
+ */
+ noticeContainer.toggle( shouldShowNotice() );
+ api.previewer.deferred.active.done( function () {
+ noticeContainer.toggle( shouldShowNotice() );
+ });
+ api.bind( 'pane-contents-reflowed', function() {
+ var duration = ( 'resolved' === api.previewer.deferred.active.state() ) ? 'fast' : 0;
+ updateNotice();
+ if ( shouldShowNotice() ) {
+ noticeContainer.slideDown( duration );
+ } else {
+ noticeContainer.slideUp( duration );
+ }
+ });
+ });
+ },
+
+ /**
+ * Allow an active widgets panel to be contextually active even when it has no active sections (widget areas).
+ *
+ * This ensures that the widgets panel appears even when there are no
+ * sidebars displayed on the URL currently being previewed.
+ *
+ * @since 4.4.0
+ *
+ * @returns {boolean}
+ */
+ isContextuallyActive: function() {
+ var panel = this;
+ return panel.active();
+ }
+ });
+
+ /**
+ * wp.customize.Widgets.SidebarSection
+ *
+ * Customizer section representing a widget area widget
+ *
+ * @since 4.1.0
+ *
+ * @class wp.customize.Widgets.SidebarSection
+ * @augments wp.customize.Section
+ */
+ api.Widgets.SidebarSection = api.Section.extend(/** @lends wp.customize.Widgets.SidebarSection.prototype */{
+
+ /**
+ * Sync the section's active state back to the Backbone model's is_rendered attribute
+ *
+ * @since 4.1.0
+ */
+ ready: function () {
+ var section = this, registeredSidebar;
+ api.Section.prototype.ready.call( this );
+ registeredSidebar = api.Widgets.registeredSidebars.get( section.params.sidebarId );
+ section.active.bind( function ( active ) {
+ registeredSidebar.set( 'is_rendered', active );
+ });
+ registeredSidebar.set( 'is_rendered', section.active() );
+ }
+ });
+
+ /**
+ * wp.customize.Widgets.SidebarControl
+ *
+ * Customizer control for widgets.
+ * Note that 'sidebar_widgets' must match the WP_Widget_Area_Customize_Control::$type
+ *
+ * @since 3.9.0
+ *
+ * @class wp.customize.Widgets.SidebarControl
+ * @augments wp.customize.Control
+ */
+ api.Widgets.SidebarControl = api.Control.extend(/** @lends wp.customize.Widgets.SidebarControl.prototype */{
+
+ /**
+ * Set up the control
+ */
+ ready: function() {
+ this.$controlSection = this.container.closest( '.control-section' );
+ this.$sectionContent = this.container.closest( '.accordion-section-content' );
+
+ this._setupModel();
+ this._setupSortable();
+ this._setupAddition();
+ this._applyCardinalOrderClassNames();
+ },
+
+ /**
+ * Update ordering of widget control forms when the setting is updated
+ */
+ _setupModel: function() {
+ var self = this;
+
+ this.setting.bind( function( newWidgetIds, oldWidgetIds ) {
+ var widgetFormControls, removedWidgetIds, priority;
+
+ removedWidgetIds = _( oldWidgetIds ).difference( newWidgetIds );
+
+ // Filter out any persistent widget IDs for widgets which have been deactivated
+ newWidgetIds = _( newWidgetIds ).filter( function( newWidgetId ) {
+ var parsedWidgetId = parseWidgetId( newWidgetId );
+
+ return !! api.Widgets.availableWidgets.findWhere( { id_base: parsedWidgetId.id_base } );
+ } );
+
+ widgetFormControls = _( newWidgetIds ).map( function( widgetId ) {
+ var widgetFormControl = api.Widgets.getWidgetFormControlForWidget( widgetId );
+
+ if ( ! widgetFormControl ) {
+ widgetFormControl = self.addWidget( widgetId );
+ }
+
+ return widgetFormControl;
+ } );
+
+ // Sort widget controls to their new positions
+ widgetFormControls.sort( function( a, b ) {
+ var aIndex = _.indexOf( newWidgetIds, a.params.widget_id ),
+ bIndex = _.indexOf( newWidgetIds, b.params.widget_id );
+ return aIndex - bIndex;
+ });
+
+ priority = 0;
+ _( widgetFormControls ).each( function ( control ) {
+ control.priority( priority );
+ control.section( self.section() );
+ priority += 1;
+ });
+ self.priority( priority ); // Make sure sidebar control remains at end
+
+ // Re-sort widget form controls (including widgets form other sidebars newly moved here)
+ self._applyCardinalOrderClassNames();
+
+ // If the widget was dragged into the sidebar, make sure the sidebar_id param is updated
+ _( widgetFormControls ).each( function( widgetFormControl ) {
+ widgetFormControl.params.sidebar_id = self.params.sidebar_id;
+ } );
+
+ // Cleanup after widget removal
+ _( removedWidgetIds ).each( function( removedWidgetId ) {
+
+ // Using setTimeout so that when moving a widget to another sidebar, the other sidebars_widgets settings get a chance to update
+ setTimeout( function() {
+ var removedControl, wasDraggedToAnotherSidebar, inactiveWidgets, removedIdBase,
+ widget, isPresentInAnotherSidebar = false;
+
+ // Check if the widget is in another sidebar
+ api.each( function( otherSetting ) {
+ if ( otherSetting.id === self.setting.id || 0 !== otherSetting.id.indexOf( 'sidebars_widgets[' ) || otherSetting.id === 'sidebars_widgets[wp_inactive_widgets]' ) {
+ return;
+ }
+
+ var otherSidebarWidgets = otherSetting(), i;
+
+ i = _.indexOf( otherSidebarWidgets, removedWidgetId );
+ if ( -1 !== i ) {
+ isPresentInAnotherSidebar = true;
+ }
+ } );
+
+ // If the widget is present in another sidebar, abort!
+ if ( isPresentInAnotherSidebar ) {
+ return;
+ }
+
+ removedControl = api.Widgets.getWidgetFormControlForWidget( removedWidgetId );
+
+ // Detect if widget control was dragged to another sidebar
+ wasDraggedToAnotherSidebar = removedControl && $.contains( document, removedControl.container[0] ) && ! $.contains( self.$sectionContent[0], removedControl.container[0] );
+
+ // Delete any widget form controls for removed widgets
+ if ( removedControl && ! wasDraggedToAnotherSidebar ) {
+ api.control.remove( removedControl.id );
+ removedControl.container.remove();
+ }
+
+ // Move widget to inactive widgets sidebar (move it to trash) if has been previously saved
+ // This prevents the inactive widgets sidebar from overflowing with throwaway widgets
+ if ( api.Widgets.savedWidgetIds[removedWidgetId] ) {
+ inactiveWidgets = api.value( 'sidebars_widgets[wp_inactive_widgets]' )().slice();
+ inactiveWidgets.push( removedWidgetId );
+ api.value( 'sidebars_widgets[wp_inactive_widgets]' )( _( inactiveWidgets ).unique() );
+ }
+
+ // Make old single widget available for adding again
+ removedIdBase = parseWidgetId( removedWidgetId ).id_base;
+ widget = api.Widgets.availableWidgets.findWhere( { id_base: removedIdBase } );
+ if ( widget && ! widget.get( 'is_multi' ) ) {
+ widget.set( 'is_disabled', false );
+ }
+ } );
+
+ } );
+ } );
+ },
+
+ /**
+ * Allow widgets in sidebar to be re-ordered, and for the order to be previewed
+ */
+ _setupSortable: function() {
+ var self = this;
+
+ this.isReordering = false;
+
+ /**
+ * Update widget order setting when controls are re-ordered
+ */
+ this.$sectionContent.sortable( {
+ items: '> .customize-control-widget_form',
+ handle: '.widget-top',
+ axis: 'y',
+ tolerance: 'pointer',
+ connectWith: '.accordion-section-content:has(.customize-control-sidebar_widgets)',
+ update: function() {
+ var widgetContainerIds = self.$sectionContent.sortable( 'toArray' ), widgetIds;
+
+ widgetIds = $.map( widgetContainerIds, function( widgetContainerId ) {
+ return $( '#' + widgetContainerId ).find( ':input[name=widget-id]' ).val();
+ } );
+
+ self.setting( widgetIds );
+ }
+ } );
+
+ /**
+ * Expand other Customizer sidebar section when dragging a control widget over it,
+ * allowing the control to be dropped into another section
+ */
+ this.$controlSection.find( '.accordion-section-title' ).droppable({
+ accept: '.customize-control-widget_form',
+ over: function() {
+ var section = api.section( self.section.get() );
+ section.expand({
+ allowMultiple: true, // Prevent the section being dragged from to be collapsed
+ completeCallback: function () {
+ // @todo It is not clear when refreshPositions should be called on which sections, or if it is even needed
+ api.section.each( function ( otherSection ) {
+ if ( otherSection.container.find( '.customize-control-sidebar_widgets' ).length ) {
+ otherSection.container.find( '.accordion-section-content:first' ).sortable( 'refreshPositions' );
+ }
+ } );
+ }
+ });
+ }
+ });
+
+ /**
+ * Keyboard-accessible reordering
+ */
+ this.container.find( '.reorder-toggle' ).on( 'click', function() {
+ self.toggleReordering( ! self.isReordering );
+ } );
+ },
+
+ /**
+ * Set up UI for adding a new widget
+ */
+ _setupAddition: function() {
+ var self = this;
+
+ this.container.find( '.add-new-widget' ).on( 'click', function() {
+ var addNewWidgetBtn = $( this );
+
+ if ( self.$sectionContent.hasClass( 'reordering' ) ) {
+ return;
+ }
+
+ if ( ! $( 'body' ).hasClass( 'adding-widget' ) ) {
+ addNewWidgetBtn.attr( 'aria-expanded', 'true' );
+ api.Widgets.availableWidgetsPanel.open( self );
+ } else {
+ addNewWidgetBtn.attr( 'aria-expanded', 'false' );
+ api.Widgets.availableWidgetsPanel.close();
+ }
+ } );
+ },
+
+ /**
+ * Add classes to the widget_form controls to assist with styling
+ */
+ _applyCardinalOrderClassNames: function() {
+ var widgetControls = [];
+ _.each( this.setting(), function ( widgetId ) {
+ var widgetControl = api.Widgets.getWidgetFormControlForWidget( widgetId );
+ if ( widgetControl ) {
+ widgetControls.push( widgetControl );
+ }
+ });
+
+ if ( 0 === widgetControls.length || ( 1 === api.Widgets.registeredSidebars.length && widgetControls.length <= 1 ) ) {
+ this.container.find( '.reorder-toggle' ).hide();
+ return;
+ } else {
+ this.container.find( '.reorder-toggle' ).show();
+ }
+
+ $( widgetControls ).each( function () {
+ $( this.container )
+ .removeClass( 'first-widget' )
+ .removeClass( 'last-widget' )
+ .find( '.move-widget-down, .move-widget-up' ).prop( 'tabIndex', 0 );
+ });
+
+ _.first( widgetControls ).container
+ .addClass( 'first-widget' )
+ .find( '.move-widget-up' ).prop( 'tabIndex', -1 );
+
+ _.last( widgetControls ).container
+ .addClass( 'last-widget' )
+ .find( '.move-widget-down' ).prop( 'tabIndex', -1 );
+ },
+
+
+ /***********************************************************************
+ * Begin public API methods
+ **********************************************************************/
+
+ /**
+ * Enable/disable the reordering UI
+ *
+ * @param {Boolean} showOrHide to enable/disable reordering
+ *
+ * @todo We should have a reordering state instead and rename this to onChangeReordering
+ */
+ toggleReordering: function( showOrHide ) {
+ var addNewWidgetBtn = this.$sectionContent.find( '.add-new-widget' ),
+ reorderBtn = this.container.find( '.reorder-toggle' ),
+ widgetsTitle = this.$sectionContent.find( '.widget-title' );
+
+ showOrHide = Boolean( showOrHide );
+
+ if ( showOrHide === this.$sectionContent.hasClass( 'reordering' ) ) {
+ return;
+ }
+
+ this.isReordering = showOrHide;
+ this.$sectionContent.toggleClass( 'reordering', showOrHide );
+
+ if ( showOrHide ) {
+ _( this.getWidgetFormControls() ).each( function( formControl ) {
+ formControl.collapse();
+ } );
+
+ addNewWidgetBtn.attr({ 'tabindex': '-1', 'aria-hidden': 'true' });
+ reorderBtn.attr( 'aria-label', l10n.reorderLabelOff );
+ wp.a11y.speak( l10n.reorderModeOn );
+ // Hide widget titles while reordering: title is already in the reorder controls.
+ widgetsTitle.attr( 'aria-hidden', 'true' );
+ } else {
+ addNewWidgetBtn.removeAttr( 'tabindex aria-hidden' );
+ reorderBtn.attr( 'aria-label', l10n.reorderLabelOn );
+ wp.a11y.speak( l10n.reorderModeOff );
+ widgetsTitle.attr( 'aria-hidden', 'false' );
+ }
+ },
+
+ /**
+ * Get the widget_form Customize controls associated with the current sidebar.
+ *
+ * @since 3.9.0
+ * @return {wp.customize.controlConstructor.widget_form[]}
+ */
+ getWidgetFormControls: function() {
+ var formControls = [];
+
+ _( this.setting() ).each( function( widgetId ) {
+ var settingId = widgetIdToSettingId( widgetId ),
+ formControl = api.control( settingId );
+ if ( formControl ) {
+ formControls.push( formControl );
+ }
+ } );
+
+ return formControls;
+ },
+
+ /**
+ * @param {string} widgetId or an id_base for adding a previously non-existing widget
+ * @returns {object|false} widget_form control instance, or false on error
+ */
+ addWidget: function( widgetId ) {
+ var self = this, controlHtml, $widget, controlType = 'widget_form', controlContainer, controlConstructor,
+ parsedWidgetId = parseWidgetId( widgetId ),
+ widgetNumber = parsedWidgetId.number,
+ widgetIdBase = parsedWidgetId.id_base,
+ widget = api.Widgets.availableWidgets.findWhere( {id_base: widgetIdBase} ),
+ settingId, isExistingWidget, widgetFormControl, sidebarWidgets, settingArgs, setting;
+
+ if ( ! widget ) {
+ return false;
+ }
+
+ if ( widgetNumber && ! widget.get( 'is_multi' ) ) {
+ return false;
+ }
+
+ // Set up new multi widget
+ if ( widget.get( 'is_multi' ) && ! widgetNumber ) {
+ widget.set( 'multi_number', widget.get( 'multi_number' ) + 1 );
+ widgetNumber = widget.get( 'multi_number' );
+ }
+
+ controlHtml = $.trim( $( '#widget-tpl-' + widget.get( 'id' ) ).html() );
+ if ( widget.get( 'is_multi' ) ) {
+ controlHtml = controlHtml.replace( /<[^<>]+>/g, function( m ) {
+ return m.replace( /__i__|%i%/g, widgetNumber );
+ } );
+ } else {
+ widget.set( 'is_disabled', true ); // Prevent single widget from being added again now
+ }
+
+ $widget = $( controlHtml );
+
+ controlContainer = $( '<li/>' )
+ .addClass( 'customize-control' )
+ .addClass( 'customize-control-' + controlType )
+ .append( $widget );
+
+ // Remove icon which is visible inside the panel
+ controlContainer.find( '> .widget-icon' ).remove();
+
+ if ( widget.get( 'is_multi' ) ) {
+ controlContainer.find( 'input[name="widget_number"]' ).val( widgetNumber );
+ controlContainer.find( 'input[name="multi_number"]' ).val( widgetNumber );
+ }
+
+ widgetId = controlContainer.find( '[name="widget-id"]' ).val();
+
+ controlContainer.hide(); // to be slid-down below
+
+ settingId = 'widget_' + widget.get( 'id_base' );
+ if ( widget.get( 'is_multi' ) ) {
+ settingId += '[' + widgetNumber + ']';
+ }
+ controlContainer.attr( 'id', 'customize-control-' + settingId.replace( /\]/g, '' ).replace( /\[/g, '-' ) );
+
+ // Only create setting if it doesn't already exist (if we're adding a pre-existing inactive widget)
+ isExistingWidget = api.has( settingId );
+ if ( ! isExistingWidget ) {
+ settingArgs = {
+ transport: api.Widgets.data.selectiveRefreshableWidgets[ widget.get( 'id_base' ) ] ? 'postMessage' : 'refresh',
+ previewer: this.setting.previewer
+ };
+ setting = api.create( settingId, settingId, '', settingArgs );
+ setting.set( {} ); // mark dirty, changing from '' to {}
+ }
+
+ controlConstructor = api.controlConstructor[controlType];
+ widgetFormControl = new controlConstructor( settingId, {
+ settings: {
+ 'default': settingId
+ },
+ content: controlContainer,
+ sidebar_id: self.params.sidebar_id,
+ widget_id: widgetId,
+ widget_id_base: widget.get( 'id_base' ),
+ type: controlType,
+ is_new: ! isExistingWidget,
+ width: widget.get( 'width' ),
+ height: widget.get( 'height' ),
+ is_wide: widget.get( 'is_wide' )
+ } );
+ api.control.add( widgetFormControl );
+
+ // Make sure widget is removed from the other sidebars
+ api.each( function( otherSetting ) {
+ if ( otherSetting.id === self.setting.id ) {
+ return;
+ }
+
+ if ( 0 !== otherSetting.id.indexOf( 'sidebars_widgets[' ) ) {
+ return;
+ }
+
+ var otherSidebarWidgets = otherSetting().slice(),
+ i = _.indexOf( otherSidebarWidgets, widgetId );
+
+ if ( -1 !== i ) {
+ otherSidebarWidgets.splice( i );
+ otherSetting( otherSidebarWidgets );
+ }
+ } );
+
+ // Add widget to this sidebar
+ sidebarWidgets = this.setting().slice();
+ if ( -1 === _.indexOf( sidebarWidgets, widgetId ) ) {
+ sidebarWidgets.push( widgetId );
+ this.setting( sidebarWidgets );
+ }
+
+ controlContainer.slideDown( function() {
+ if ( isExistingWidget ) {
+ widgetFormControl.updateWidget( {
+ instance: widgetFormControl.setting()
+ } );
+ }
+ } );
+
+ return widgetFormControl;
+ }
+ } );
+
+ // Register models for custom panel, section, and control types
+ $.extend( api.panelConstructor, {
+ widgets: api.Widgets.WidgetsPanel
+ });
+ $.extend( api.sectionConstructor, {
+ sidebar: api.Widgets.SidebarSection
+ });
+ $.extend( api.controlConstructor, {
+ widget_form: api.Widgets.WidgetControl,
+ sidebar_widgets: api.Widgets.SidebarControl
+ });
+
+ /**
+ * Init Customizer for widgets.
+ */
+ api.bind( 'ready', function() {
+ // Set up the widgets panel
+ api.Widgets.availableWidgetsPanel = new api.Widgets.AvailableWidgetsPanelView({
+ collection: api.Widgets.availableWidgets
+ });
+
+ // Highlight widget control
+ api.previewer.bind( 'highlight-widget-control', api.Widgets.highlightWidgetFormControl );
+
+ // Open and focus widget control
+ api.previewer.bind( 'focus-widget-control', api.Widgets.focusWidgetFormControl );
+ } );
+
+ /**
+ * Highlight a widget control.
+ *
+ * @param {string} widgetId
+ */
+ api.Widgets.highlightWidgetFormControl = function( widgetId ) {
+ var control = api.Widgets.getWidgetFormControlForWidget( widgetId );
+
+ if ( control ) {
+ control.highlightSectionAndControl();
+ }
+ },
+
+ /**
+ * Focus a widget control.
+ *
+ * @param {string} widgetId
+ */
+ api.Widgets.focusWidgetFormControl = function( widgetId ) {
+ var control = api.Widgets.getWidgetFormControlForWidget( widgetId );
+
+ if ( control ) {
+ control.focus();
+ }
+ },
+
+ /**
+ * Given a widget control, find the sidebar widgets control that contains it.
+ * @param {string} widgetId
+ * @return {object|null}
+ */
+ api.Widgets.getSidebarWidgetControlContainingWidget = function( widgetId ) {
+ var foundControl = null;
+
+ // @todo this can use widgetIdToSettingId(), then pass into wp.customize.control( x ).getSidebarWidgetsControl()
+ api.control.each( function( control ) {
+ if ( control.params.type === 'sidebar_widgets' && -1 !== _.indexOf( control.setting(), widgetId ) ) {
+ foundControl = control;
+ }
+ } );
+
+ return foundControl;
+ };
+
+ /**
+ * Given a widget ID for a widget appearing in the preview, get the widget form control associated with it.
+ *
+ * @param {string} widgetId
+ * @return {object|null}
+ */
+ api.Widgets.getWidgetFormControlForWidget = function( widgetId ) {
+ var foundControl = null;
+
+ // @todo We can just use widgetIdToSettingId() here
+ api.control.each( function( control ) {
+ if ( control.params.type === 'widget_form' && control.params.widget_id === widgetId ) {
+ foundControl = control;
+ }
+ } );
+
+ return foundControl;
+ };
+
+ /**
+ * Initialize Edit Menu button in Nav Menu widget.
+ */
+ $( document ).on( 'widget-added', function( event, widgetContainer ) {
+ var parsedWidgetId, widgetControl, navMenuSelect, editMenuButton;
+ parsedWidgetId = parseWidgetId( widgetContainer.find( '> .widget-inside > .form > .widget-id' ).val() );
+ if ( 'nav_menu' !== parsedWidgetId.id_base ) {
+ return;
+ }
+ widgetControl = api.control( 'widget_nav_menu[' + String( parsedWidgetId.number ) + ']' );
+ if ( ! widgetControl ) {
+ return;
+ }
+ navMenuSelect = widgetContainer.find( 'select[name*="nav_menu"]' );
+ editMenuButton = widgetContainer.find( '.edit-selected-nav-menu > button' );
+ if ( 0 === navMenuSelect.length || 0 === editMenuButton.length ) {
+ return;
+ }
+ navMenuSelect.on( 'change', function() {
+ if ( api.section.has( 'nav_menu[' + navMenuSelect.val() + ']' ) ) {
+ editMenuButton.parent().show();
+ } else {
+ editMenuButton.parent().hide();
+ }
+ });
+ editMenuButton.on( 'click', function() {
+ var section = api.section( 'nav_menu[' + navMenuSelect.val() + ']' );
+ if ( section ) {
+ focusConstructWithBreadcrumb( section, widgetControl );
+ }
+ } );
+ } );
+
+ /**
+ * Focus (expand) one construct and then focus on another construct after the first is collapsed.
+ *
+ * This overrides the back button to serve the purpose of breadcrumb navigation.
+ *
+ * @param {wp.customize.Section|wp.customize.Panel|wp.customize.Control} focusConstruct - The object to initially focus.
+ * @param {wp.customize.Section|wp.customize.Panel|wp.customize.Control} returnConstruct - The object to return focus.
+ */
+ function focusConstructWithBreadcrumb( focusConstruct, returnConstruct ) {
+ focusConstruct.focus();
+ function onceCollapsed( isExpanded ) {
+ if ( ! isExpanded ) {
+ focusConstruct.expanded.unbind( onceCollapsed );
+ returnConstruct.focus();
+ }
+ }
+ focusConstruct.expanded.bind( onceCollapsed );
+ }
+
+ /**
+ * @param {String} widgetId
+ * @returns {Object}
+ */
+ function parseWidgetId( widgetId ) {
+ var matches, parsed = {
+ number: null,
+ id_base: null
+ };
+
+ matches = widgetId.match( /^(.+)-(\d+)$/ );
+ if ( matches ) {
+ parsed.id_base = matches[1];
+ parsed.number = parseInt( matches[2], 10 );
+ } else {
+ // likely an old single widget
+ parsed.id_base = widgetId;
+ }
+
+ return parsed;
+ }
+
+ /**
+ * @param {String} widgetId
+ * @returns {String} settingId
+ */
+ function widgetIdToSettingId( widgetId ) {
+ var parsed = parseWidgetId( widgetId ), settingId;
+
+ settingId = 'widget_' + parsed.id_base;
+ if ( parsed.number ) {
+ settingId += '[' + parsed.number + ']';
+ }
+
+ return settingId;
+ }
+
+})( window.wp, jQuery );
diff --git a/www/crm/wp-admin/js/customize-widgets.min.js b/www/crm/wp-admin/js/customize-widgets.min.js
new file mode 100644
index 00000000..7eb293ea
--- /dev/null
+++ b/www/crm/wp-admin/js/customize-widgets.min.js
@@ -0,0 +1 @@
+!function(a,b){function c(a,b){function c(d){d||(a.expanded.unbind(c),b.focus())}a.focus(),a.expanded.bind(c)}function d(a){var b,c={number:null,id_base:null};return b=a.match(/^(.+)-(\d+)$/),b?(c.id_base=b[1],c.number=parseInt(b[2],10)):c.id_base=a,c}function e(a){var b,c=d(a);return b="widget_"+c.id_base,c.number&&(b+="["+c.number+"]"),b}if(a&&a.customize){var f,g=a.customize;g.Widgets=g.Widgets||{},g.Widgets.savedWidgetIds={},g.Widgets.data=_wpCustomizeWidgetsSettings||{},f=g.Widgets.data.l10n,g.Widgets.WidgetModel=Backbone.Model.extend({id:null,temp_id:null,classname:null,control_tpl:null,description:null,is_disabled:null,is_multi:null,multi_number:null,name:null,id_base:null,transport:null,params:[],width:null,height:null,search_matched:!0}),g.Widgets.WidgetCollection=Backbone.Collection.extend({model:g.Widgets.WidgetModel,doSearch:function(a){this.terms!==a&&(this.terms=a,this.terms.length>0&&this.search(this.terms),""===this.terms&&this.each(function(a){a.set("search_matched",!0)}))},search:function(a){var b,c;a=a.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"),a=a.replace(/ /g,")(?=.*"),b=new RegExp("^(?=.*"+a+").+","i"),this.each(function(a){c=[a.get("name"),a.get("id"),a.get("description")].join(" "),a.set("search_matched",b.test(c))})}}),g.Widgets.availableWidgets=new g.Widgets.WidgetCollection(g.Widgets.data.availableWidgets),g.Widgets.SidebarModel=Backbone.Model.extend({after_title:null,after_widget:null,before_title:null,before_widget:null,"class":null,description:null,id:null,name:null,is_rendered:!1}),g.Widgets.SidebarCollection=Backbone.Collection.extend({model:g.Widgets.SidebarModel}),g.Widgets.registeredSidebars=new g.Widgets.SidebarCollection(g.Widgets.data.registeredSidebars),g.Widgets.AvailableWidgetsPanelView=a.Backbone.View.extend({el:"#available-widgets",events:{"input #widgets-search":"search","focus .widget-tpl":"focus","click .widget-tpl":"_submit","keypress .widget-tpl":"_submit",keydown:"keyboardAccessible"},selected:null,currentSidebarControl:null,$search:null,$clearResults:null,searchMatchesCount:null,initialize:function(){var a=this;this.$search=b("#widgets-search"),this.$clearResults=this.$el.find(".clear-results"),_.bindAll(this,"close"),this.listenTo(this.collection,"change",this.updateList),this.updateList(),this.searchMatchesCount=this.collection.length,b("#customize-controls, #available-widgets .customize-section-title").on("click keydown",function(c){var d=b(c.target).is(".add-new-widget, .add-new-widget *");b("body").hasClass("adding-widget")&&!d&&a.close()}),this.$clearResults.on("click",function(){a.$search.val("").focus().trigger("keyup")}),g.previewer.bind("url",this.close)},search:_.debounce(function(a){var b;this.collection.doSearch(a.target.value),this.updateSearchMatchesCount(),this.announceSearchMatches(),this.selected&&!this.selected.is(":visible")&&(this.selected.removeClass("selected"),this.selected=null),this.selected&&!a.target.value&&(this.selected.removeClass("selected"),this.selected=null),!this.selected&&a.target.value&&(b=this.$el.find("> .widget-tpl:visible:first"),b.length&&this.select(b)),""!==a.target.value?this.$clearResults.addClass("is-visible"):""===a.target.value&&this.$clearResults.removeClass("is-visible"),this.searchMatchesCount?this.$el.removeClass("no-widgets-found"):this.$el.addClass("no-widgets-found")},500),updateSearchMatchesCount:function(){this.searchMatchesCount=this.collection.where({search_matched:!0}).length},announceSearchMatches:function(){var b=f.widgetsFound.replace("%d",this.searchMatchesCount);this.searchMatchesCount||(b=f.noWidgetsFound),a.a11y.speak(b)},updateList:function(){this.collection.each(function(a){var c=b("#widget-tpl-"+a.id);c.toggle(a.get("search_matched")&&!a.get("is_disabled")),a.get("is_disabled")&&c.is(this.selected)&&(this.selected=null)})},select:function(a){this.selected=b(a),this.selected.siblings(".widget-tpl").removeClass("selected"),this.selected.addClass("selected")},focus:function(a){this.select(b(a.currentTarget))},_submit:function(a){"keypress"===a.type&&13!==a.which&&32!==a.which||this.submit(b(a.currentTarget))},submit:function(a){var c,d,e;a||(a=this.selected),a&&this.currentSidebarControl&&(this.select(a),c=b(this.selected).data("widget-id"),d=this.collection.findWhere({id:c}),d&&(e=this.currentSidebarControl.addWidget(d.get("id_base")),e&&e.focus(),this.close()))},open:function(a){this.currentSidebarControl=a,_(this.currentSidebarControl.getWidgetFormControls()).each(function(a){a.params.is_wide&&a.collapseForm()}),g.section.has("publish_settings")&&g.section("publish_settings").collapse(),b("body").addClass("adding-widget"),this.$el.find(".selected").removeClass("selected"),this.collection.doSearch(""),g.settings.browser.mobile||this.$search.focus()},close:function(a){a=a||{},a.returnFocus&&this.currentSidebarControl&&this.currentSidebarControl.container.find(".add-new-widget").focus(),this.currentSidebarControl=null,this.selected=null,b("body").removeClass("adding-widget"),this.$search.val("")},keyboardAccessible:function(a){var c=13===a.which,d=27===a.which,e=40===a.which,f=38===a.which,g=9===a.which,h=a.shiftKey,i=null,j=this.$el.find("> .widget-tpl:visible:first"),k=this.$el.find("> .widget-tpl:visible:last"),l=b(a.target).is(this.$search),m=b(a.target).is(".widget-tpl:visible:last");return e||f?(e?l?i=j:this.selected&&0!==this.selected.nextAll(".widget-tpl:visible").length&&(i=this.selected.nextAll(".widget-tpl:visible:first")):f&&(l?i=k:this.selected&&0!==this.selected.prevAll(".widget-tpl:visible").length&&(i=this.selected.prevAll(".widget-tpl:visible:first"))),this.select(i),void(i?i.focus():this.$search.focus())):void(c&&!this.$search.val()||(c?this.submit():d&&this.close({returnFocus:!0}),this.currentSidebarControl&&g&&(h&&l||!h&&m)&&(this.currentSidebarControl.container.find(".add-new-widget").focus(),a.preventDefault())))}}),g.Widgets.formSyncHandlers={rss:function(a,c,d){var e=c.find(".widget-error:first"),f=b("<div>"+d+"</div>").find(".widget-error:first");e.length&&f.length?e.replaceWith(f):e.length?e.remove():f.length&&c.find(".widget-content:first").prepend(f)}},g.Widgets.WidgetControl=g.Control.extend({defaultExpandedArguments:{duration:"fast",completeCallback:b.noop},initialize:function(a,c){var d=this;d.widgetControlEmbedded=!1,d.widgetContentEmbedded=!1,d.expanded=new g.Value(!1),d.expandedArgumentsQueue=[],d.expanded.bind(function(a){var c=d.expandedArgumentsQueue.shift();c=b.extend({},d.defaultExpandedArguments,c),d.onChangeExpanded(a,c)}),d.altNotice=!0,g.Control.prototype.initialize.call(d,a,c)},ready:function(){var a=this;a.section()?g.section(a.section(),function(b){var c=function(d){d&&(a.embedWidgetControl(),b.expanded.unbind(c))};b.expanded()?c(!0):b.expanded.bind(c)}):a.embedWidgetControl()},embedWidgetControl:function(){var a,c=this;c.widgetControlEmbedded||(c.widgetControlEmbedded=!0,a=b(c.params.widget_control),c.container.append(a),c._setupModel(),c._setupWideWidget(),c._setupControlToggle(),c._setupWidgetTitle(),c._setupReorderUI(),c._setupHighlightEffects(),c._setupUpdateUI(),c._setupRemoveUI())},embedWidgetContent:function(){var a,c=this;c.embedWidgetControl(),c.widgetContentEmbedded||(c.widgetContentEmbedded=!0,c.notifications.container=c.getNotificationsContainerElement(),c.notifications.render(),a=b(c.params.widget_content),c.container.find(".widget-content:first").append(a),b(document).trigger("widget-added",[c.container.find(".widget:first")]))},_setupModel:function(){var a,b=this;a=function(){g.Widgets.savedWidgetIds[b.params.widget_id]=!0},g.bind("ready",a),g.bind("saved",a),this._updateCount=0,this.isWidgetUpdating=!1,this.liveUpdateMode=!0,this.setting.bind(function(a,c){_(c).isEqual(a)||b.isWidgetUpdating||b.updateWidget({instance:a})})},_setupWideWidget:function(){var a,c,d,e,f,h=this;!this.params.is_wide||b(window).width()<=640||(a=this.container.find(".widget-inside"),c=a.find("> .form"),d=b(".wp-full-overlay-sidebar-content:first"),this.container.addClass("wide-widget-control"),this.container.find(".form:first").css({"max-width":this.params.width,"min-height":this.params.height}),f=function(){var d,e=h.container.offset().top,f=b(window).height(),g=c.outerHeight();a.css("max-height",f),d=Math.max(0,Math.min(Math.max(e,0),f-g)),a.css("top",d)},e=b("#customize-theme-controls"),this.container.on("expand",function(){f(),d.on("scroll",f),b(window).on("resize",f),e.on("expanded collapsed",f)}),this.container.on("collapsed",function(){d.off("scroll",f),b(window).off("resize",f),e.off("expanded collapsed",f)}),g.each(function(a){0===a.id.indexOf("sidebars_widgets[")&&a.bind(function(){h.container.hasClass("expanded")&&f()})}))},_setupControlToggle:function(){var a,b=this;this.container.find(".widget-top").on("click",function(a){a.preventDefault();var c=b.getSidebarWidgetsControl();c.isReordering||b.expanded(!b.expanded())}),a=this.container.find(".widget-control-close"),a.on("click",function(){b.collapse(),b.container.find(".widget-top .widget-action:first").focus()})},_setupWidgetTitle:function(){var a,b=this;a=function(){var a=b.setting().title,c=b.container.find(".in-widget-title");a?c.text(": "+a):c.text("")},this.setting.bind(a),a()},_setupReorderUI:function(){var c,d,e,h,i,j=this;c=function(a){a.siblings(".selected").removeClass("selected"),a.addClass("selected");var b=a.data("id")===j.params.sidebar_id;j.container.find(".move-widget-btn").prop("disabled",b)},this.container.find(".widget-title-action").after(b(g.Widgets.data.tpl.widgetReorderNav)),i=_.template(g.Widgets.data.tpl.moveWidgetArea),d=b(i({sidebars:_(g.Widgets.registeredSidebars.toArray()).pluck("attributes")})),this.container.find(".widget-top").after(d),h=function(){var a,e=d.find("li"),f=0;a=e.filter(function(){return b(this).data("id")===j.params.sidebar_id}),e.each(function(){var d,e,h,i=b(this);d=i.data("id"),e=g.Widgets.registeredSidebars.get(d),h=e.get("is_rendered"),i.toggle(h),h&&(f+=1),i.hasClass("selected")&&!h&&c(a)}),f>1?j.container.find(".move-widget").show():j.container.find(".move-widget").hide()},h(),g.Widgets.registeredSidebars.on("change:is_rendered",h),e=this.container.find(".widget-reorder-nav"),e.find(".move-widget, .move-widget-down, .move-widget-up").each(function(){b(this).prepend(j.container.find(".widget-title").text()+": ")}).on("click keypress",function(c){if("keypress"!==c.type||13===c.which||32===c.which)if(b(this).focus(),b(this).is(".move-widget"))j.toggleWidgetMoveArea();else{var d=b(this).is(".move-widget-down"),e=b(this).is(".move-widget-up"),g=j.getWidgetSidebarPosition();if(e&&0===g||d&&g===j.getSidebarWidgetsControl().setting().length-1)return;e?(j.moveUp(),a.a11y.speak(f.widgetMovedUp)):(j.moveDown(),a.a11y.speak(f.widgetMovedDown)),b(this).focus()}}),this.container.find(".widget-area-select").on("click keypress","li",function(a){"keypress"===a.type&&13!==a.which&&32!==a.which||(a.preventDefault(),c(b(this)))}),this.container.find(".move-widget-btn").click(function(){j.getSidebarWidgetsControl().toggleReordering(!1);var a,b,c,d,e,f=j.params.sidebar_id,h=j.container.find(".widget-area-select li.selected").data("id");a=g("sidebars_widgets["+f+"]"),b=g("sidebars_widgets["+h+"]"),c=Array.prototype.slice.call(a()),d=Array.prototype.slice.call(b()),e=j.getWidgetSidebarPosition(),c.splice(e,1),d.push(j.params.widget_id),a(c),b(d),j.focus()})},_setupHighlightEffects:function(){var a=this;this.container.on("mouseenter click",function(){a.setting.previewer.send("highlight-widget",a.params.widget_id)}),this.setting.bind(function(){a.setting.previewer.send("highlight-widget",a.params.widget_id)})},_setupUpdateUI:function(){var a,c,d,e,h,i=this;a=this.container.find(".widget:first"),c=a.find(".widget-content:first"),d=this.container.find(".widget-control-save"),d.val(f.saveBtnLabel),d.attr("title",f.saveBtnTooltip),d.removeClass("button-primary"),d.on("click",function(a){a.preventDefault(),i.updateWidget({disable_form:!0})}),e=_.debounce(function(){i.updateWidget()},250),c.on("keydown","input",function(a){13===a.which&&(a.preventDefault(),i.updateWidget({ignoreActiveElement:!0}))}),c.on("change input propertychange",":input",function(a){i.liveUpdateMode&&("change"===a.type||this.checkValidity&&this.checkValidity())&&e()}),this.setting.previewer.channel.bind("synced",function(){i.container.removeClass("previewer-loading")}),g.previewer.bind("widget-updated",function(a){a===i.params.widget_id&&i.container.removeClass("previewer-loading")}),h=g.Widgets.formSyncHandlers[this.params.widget_id_base],h&&b(document).on("widget-synced",function(b,c){a.is(c)&&h.apply(document,arguments)})},onChangeActive:function(a,b){this.container.toggleClass("widget-rendered",a),b.completeCallback&&b.completeCallback()},_setupRemoveUI:function(){var a,b,c=this;a=this.container.find(".widget-control-remove"),a.on("click",function(){var a;a=c.container.next().is(".customize-control-widget_form")?c.container.next().find(".widget-action:first"):c.container.prev().is(".customize-control-widget_form")?c.container.prev().find(".widget-action:first"):c.container.next(".customize-control-sidebar_widgets").find(".add-new-widget:first"),c.container.slideUp(function(){var b,d,e=g.Widgets.getSidebarWidgetControlContainingWidget(c.params.widget_id);e&&(b=e.setting().slice(),d=_.indexOf(b,c.params.widget_id),-1!==d&&(b.splice(d,1),e.setting(b),a.focus()))})}),b=function(){a.text(f.removeBtnLabel),a.attr("title",f.removeBtnTooltip)},this.params.is_new?g.bind("saved",b):b()},_getInputs:function(a){return b(a).find(":input[name]")},_getInputsSignature:function(a){var c=_(a).map(function(a){var c,d=b(a);return c=d.is(":checkbox, :radio")?[d.attr("id"),d.attr("name"),d.prop("value")]:[d.attr("id"),d.attr("name")],c.join(",")});return c.join(";")},_getInputState:function(a){return a=b(a),a.is(":radio, :checkbox")?a.prop("checked"):a.is("select[multiple]")?a.find("option:selected").map(function(){return b(this).val()}).get():a.val()},_setInputState:function(a,c){a=b(a),a.is(":radio, :checkbox")?a.prop("checked",c):a.is("select[multiple]")?(c=b.isArray(c)?_.map(c,function(a){return String(a)}):[],a.find("option").each(function(){b(this).prop("selected",-1!==_.indexOf(c,String(this.value)))})):a.val(c)},getSidebarWidgetsControl:function(){var a,b;if(a="sidebars_widgets["+this.params.sidebar_id+"]",b=g.control(a))return b},updateWidget:function(c){var d,e,h,i,j,k,l,m,n,o,p,q=this;q.embedWidgetContent(),c=b.extend({instance:null,complete:null,ignoreActiveElement:!1},c),d=c.instance,e=c.complete,this._updateCount+=1,j=this._updateCount,h=this.container.find(".widget:first"),i=h.find(".widget-content:first"),i.find(".widget-error").remove(),this.container.addClass("widget-form-loading"),this.container.addClass("previewer-loading"),n=g.state("processing"),n(n()+1),this.liveUpdateMode||this.container.addClass("widget-form-disabled"),k={},k.action="update-widget",k.wp_customize="on",k.nonce=g.settings.nonce["update-widget"],k.customize_theme=g.settings.theme.stylesheet,k.customized=a.customize.previewer.query().customized,l=b.param(k),m=this._getInputs(i),m.each(function(){b(this).data("state"+j,q._getInputState(this))}),l+=d?"&"+b.param({sanitized_widget_setting:JSON.stringify(d)}):"&"+m.serialize(),l+="&"+i.find("~ :input").serialize(),this._previousUpdateRequest&&this._previousUpdateRequest.abort(),o=b.post(a.ajax.settings.url,l),this._previousUpdateRequest=o,o.done(function(a){var d,k,l,n,o=!1;return"0"===a?(g.previewer.preview.iframe.hide(),void g.previewer.login().done(function(){q.updateWidget(c),g.previewer.preview.iframe.show()})):"-1"===a?void g.previewer.cheatin():void(a.success?(k=b("<div>"+a.data.form+"</div>"),l=q._getInputs(k),n=q._getInputsSignature(m)===q._getInputsSignature(l),n&&!q.liveUpdateMode&&(q.liveUpdateMode=!0,q.container.removeClass("widget-form-disabled"),q.container.find('input[name="savewidget"]').hide()),n&&q.liveUpdateMode?(m.each(function(a){var d,e,f,g=b(this),h=b(l[a]);d=g.data("state"+j),e=q._getInputState(h),g.data("sanitized",e),f=!_.isEqual(d,e)&&(c.ignoreActiveElement||!g.is(document.activeElement)),f&&q._setInputState(g,e)}),b(document).trigger("widget-synced",[h,a.data.form])):q.liveUpdateMode?(q.liveUpdateMode=!1,q.container.find('input[name="savewidget"]').show(),o=!0):(i.html(a.data.form),q.container.removeClass("widget-form-disabled"),b(document).trigger("widget-updated",[h])),p=!o&&!_(q.setting()).isEqual(a.data.instance),p?(q.isWidgetUpdating=!0,q.setting(a.data.instance),q.isWidgetUpdating=!1):q.container.removeClass("previewer-loading"),e&&e.call(q,null,{noChange:!p,ajaxFinished:!0})):(d=f.error,a.data&&a.data.message&&(d=a.data.message),e?e.call(q,d):i.prepend('<p class="widget-error"><strong>'+d+"</strong></p>")))}),o.fail(function(a,b){e&&e.call(q,b)}),o.always(function(){q.container.removeClass("widget-form-loading"),m.each(function(){b(this).removeData("state"+j)}),n(n()-1)})},expandControlSection:function(){g.Control.prototype.expand.call(this)},_toggleExpanded:g.Section.prototype._toggleExpanded,expand:g.Section.prototype.expand,expandForm:function(){this.expand()},collapse:g.Section.prototype.collapse,collapseForm:function(){this.collapse()},toggleForm:function(a){"undefined"==typeof a&&(a=!this.expanded()),this.expanded(a)},onChangeExpanded:function(a,b){var c,d,e,f,h,i,j=this;return j.embedWidgetControl(),a&&j.embedWidgetContent(),b.unchanged?void(a&&g.Control.prototype.expand.call(j,{completeCallback:b.completeCallback})):(c=this.container.find("div.widget:first"),d=c.find(".widget-inside:first"),i=this.container.find(".widget-top button.widget-action"),h=function(){g.control.each(function(a){j.params.type===a.params.type&&j!==a&&a.collapse()}),e=function(){j.container.removeClass("expanding"),j.container.addClass("expanded"),c.addClass("open"),i.attr("aria-expanded","true"),j.container.trigger("expanded")},b.completeCallback&&(f=e,e=function(){f(),b.completeCallback()}),j.params.is_wide?d.fadeIn(b.duration,e):d.slideDown(b.duration,e),j.container.trigger("expand"),j.container.addClass("expanding")},void(a?g.section.has(j.section())?g.section(j.section()).expand({completeCallback:h}):h():(e=function(){j.container.removeClass("collapsing"),j.container.removeClass("expanded"),c.removeClass("open"),i.attr("aria-expanded","false"),j.container.trigger("collapsed")},b.completeCallback&&(f=e,e=function(){f(),b.completeCallback()}),j.container.trigger("collapse"),j.container.addClass("collapsing"),j.params.is_wide?d.fadeOut(b.duration,e):d.slideUp(b.duration,function(){c.css({width:"",margin:""}),e()}))))},getWidgetSidebarPosition:function(){var a,b;if(a=this.getSidebarWidgetsControl().setting(),b=_.indexOf(a,this.params.widget_id),b!==-1)return b},moveUp:function(){this._moveWidgetByOne(-1)},moveDown:function(){this._moveWidgetByOne(1)},_moveWidgetByOne:function(a){var b,c,d,e;b=this.getWidgetSidebarPosition(),c=this.getSidebarWidgetsControl().setting,d=Array.prototype.slice.call(c()),e=d[b+a],d[b+a]=this.params.widget_id,d[b]=e,c(d)},toggleWidgetMoveArea:function(a){var c,d=this;c=this.container.find(".move-widget-area"),"undefined"==typeof a&&(a=!c.hasClass("active")),a&&(c.find(".selected").removeClass("selected"),c.find("li").filter(function(){return b(this).data("id")===d.params.sidebar_id}).addClass("selected"),this.container.find(".move-widget-btn").prop("disabled",!0)),c.toggleClass("active",a)},highlightSectionAndControl:function(){var a;a=this.container.is(":hidden")?this.container.closest(".control-section"):this.container,b(".highlighted").removeClass("highlighted"),a.addClass("highlighted"),setTimeout(function(){a.removeClass("highlighted")},500)}}),g.Widgets.WidgetsPanel=g.Panel.extend({ready:function(){var a=this;g.Panel.prototype.ready.call(a),a.deferred.embedded.done(function(){var c,d,e,h,i;c=a.container.find(".panel-meta"),d=b("<div></div>",{"class":"no-widget-areas-rendered-notice"}),c.append(d),h=function(){return _.filter(a.sections(),function(a){return"sidebar"===a.params.type&&a.active()}).length},i=function(){var a=h();return 0===a||a!==g.Widgets.data.registeredSidebars.length},e=function(){var a,c,e,i=h();d.empty(),e=g.Widgets.data.registeredSidebars.length,i!==e&&(0!==i?(c=e-i,a=f.someAreasShown[c]):a=f.noAreasShown,a&&d.append(b("<p></p>",{text:a})),d.append(b("<p></p>",{text:f.navigatePreview})))},e(),d.toggle(i()),g.previewer.deferred.active.done(function(){d.toggle(i())}),g.bind("pane-contents-reflowed",function(){var a="resolved"===g.previewer.deferred.active.state()?"fast":0;e(),i()?d.slideDown(a):d.slideUp(a)})})},isContextuallyActive:function(){var a=this;return a.active()}}),g.Widgets.SidebarSection=g.Section.extend({ready:function(){var a,b=this;g.Section.prototype.ready.call(this),a=g.Widgets.registeredSidebars.get(b.params.sidebarId),b.active.bind(function(b){a.set("is_rendered",b)}),a.set("is_rendered",b.active())}}),g.Widgets.SidebarControl=g.Control.extend({ready:function(){this.$controlSection=this.container.closest(".control-section"),this.$sectionContent=this.container.closest(".accordion-section-content"),this._setupModel(),this._setupSortable(),this._setupAddition(),this._applyCardinalOrderClassNames()},_setupModel:function(){var a=this;this.setting.bind(function(c,e){var f,h,i;h=_(e).difference(c),c=_(c).filter(function(a){var b=d(a);return!!g.Widgets.availableWidgets.findWhere({id_base:b.id_base})}),f=_(c).map(function(b){var c=g.Widgets.getWidgetFormControlForWidget(b);return c||(c=a.addWidget(b)),c}),f.sort(function(a,b){var d=_.indexOf(c,a.params.widget_id),e=_.indexOf(c,b.params.widget_id);return d-e}),i=0,_(f).each(function(b){b.priority(i),b.section(a.section()),i+=1}),a.priority(i),a._applyCardinalOrderClassNames(),_(f).each(function(b){b.params.sidebar_id=a.params.sidebar_id}),_(h).each(function(c){setTimeout(function(){var e,f,h,i,j,k=!1;g.each(function(b){if(b.id!==a.setting.id&&0===b.id.indexOf("sidebars_widgets[")&&"sidebars_widgets[wp_inactive_widgets]"!==b.id){var d,e=b();d=_.indexOf(e,c),-1!==d&&(k=!0)}}),k||(e=g.Widgets.getWidgetFormControlForWidget(c),f=e&&b.contains(document,e.container[0])&&!b.contains(a.$sectionContent[0],e.container[0]),e&&!f&&(g.control.remove(e.id),e.container.remove()),g.Widgets.savedWidgetIds[c]&&(h=g.value("sidebars_widgets[wp_inactive_widgets]")().slice(),h.push(c),g.value("sidebars_widgets[wp_inactive_widgets]")(_(h).unique())),i=d(c).id_base,j=g.Widgets.availableWidgets.findWhere({id_base:i}),j&&!j.get("is_multi")&&j.set("is_disabled",!1))})})})},_setupSortable:function(){var a=this;this.isReordering=!1,this.$sectionContent.sortable({items:"> .customize-control-widget_form",handle:".widget-top",axis:"y",tolerance:"pointer",connectWith:".accordion-section-content:has(.customize-control-sidebar_widgets)",update:function(){var c,d=a.$sectionContent.sortable("toArray");c=b.map(d,function(a){return b("#"+a).find(":input[name=widget-id]").val()}),a.setting(c)}}),this.$controlSection.find(".accordion-section-title").droppable({accept:".customize-control-widget_form",over:function(){var b=g.section(a.section.get());b.expand({allowMultiple:!0,completeCallback:function(){g.section.each(function(a){a.container.find(".customize-control-sidebar_widgets").length&&a.container.find(".accordion-section-content:first").sortable("refreshPositions")})}})}}),this.container.find(".reorder-toggle").on("click",function(){a.toggleReordering(!a.isReordering)})},_setupAddition:function(){var a=this;this.container.find(".add-new-widget").on("click",function(){var c=b(this);a.$sectionContent.hasClass("reordering")||(b("body").hasClass("adding-widget")?(c.attr("aria-expanded","false"),g.Widgets.availableWidgetsPanel.close()):(c.attr("aria-expanded","true"),g.Widgets.availableWidgetsPanel.open(a)))})},_applyCardinalOrderClassNames:function(){var a=[];return _.each(this.setting(),function(b){var c=g.Widgets.getWidgetFormControlForWidget(b);c&&a.push(c)}),0===a.length||1===g.Widgets.registeredSidebars.length&&a.length<=1?void this.container.find(".reorder-toggle").hide():(this.container.find(".reorder-toggle").show(),b(a).each(function(){b(this.container).removeClass("first-widget").removeClass("last-widget").find(".move-widget-down, .move-widget-up").prop("tabIndex",0)}),_.first(a).container.addClass("first-widget").find(".move-widget-up").prop("tabIndex",-1),void _.last(a).container.addClass("last-widget").find(".move-widget-down").prop("tabIndex",-1))},toggleReordering:function(b){var c=this.$sectionContent.find(".add-new-widget"),d=this.container.find(".reorder-toggle"),e=this.$sectionContent.find(".widget-title");b=Boolean(b),b!==this.$sectionContent.hasClass("reordering")&&(this.isReordering=b,this.$sectionContent.toggleClass("reordering",b),b?(_(this.getWidgetFormControls()).each(function(a){a.collapse()}),c.attr({tabindex:"-1","aria-hidden":"true"}),d.attr("aria-label",f.reorderLabelOff),a.a11y.speak(f.reorderModeOn),e.attr("aria-hidden","true")):(c.removeAttr("tabindex aria-hidden"),d.attr("aria-label",f.reorderLabelOn),a.a11y.speak(f.reorderModeOff),e.attr("aria-hidden","false")))},getWidgetFormControls:function(){var a=[];return _(this.setting()).each(function(b){var c=e(b),d=g.control(c);d&&a.push(d)}),a},addWidget:function(a){var c,e,f,h,i,j,k,l,m,n,o=this,p="widget_form",q=d(a),r=q.number,s=q.id_base,t=g.Widgets.availableWidgets.findWhere({id_base:s});return!!t&&(!(r&&!t.get("is_multi"))&&(t.get("is_multi")&&!r&&(t.set("multi_number",t.get("multi_number")+1),r=t.get("multi_number")),c=b.trim(b("#widget-tpl-"+t.get("id")).html()),t.get("is_multi")?c=c.replace(/<[^<>]+>/g,function(a){return a.replace(/__i__|%i%/g,r)}):t.set("is_disabled",!0),e=b(c),f=b("<li/>").addClass("customize-control").addClass("customize-control-"+p).append(e),f.find("> .widget-icon").remove(),t.get("is_multi")&&(f.find('input[name="widget_number"]').val(r),f.find('input[name="multi_number"]').val(r)),a=f.find('[name="widget-id"]').val(),f.hide(),i="widget_"+t.get("id_base"),t.get("is_multi")&&(i+="["+r+"]"),f.attr("id","customize-control-"+i.replace(/\]/g,"").replace(/\[/g,"-")),j=g.has(i),j||(m={transport:g.Widgets.data.selectiveRefreshableWidgets[t.get("id_base")]?"postMessage":"refresh",previewer:this.setting.previewer},n=g.create(i,i,"",m),n.set({})),h=g.controlConstructor[p],k=new h(i,{settings:{"default":i},content:f,sidebar_id:o.params.sidebar_id,widget_id:a,widget_id_base:t.get("id_base"),type:p,is_new:!j,width:t.get("width"),height:t.get("height"),is_wide:t.get("is_wide")}),g.control.add(k),g.each(function(b){if(b.id!==o.setting.id&&0===b.id.indexOf("sidebars_widgets[")){var c=b().slice(),d=_.indexOf(c,a);-1!==d&&(c.splice(d),b(c))}}),l=this.setting().slice(),-1===_.indexOf(l,a)&&(l.push(a),this.setting(l)),f.slideDown(function(){j&&k.updateWidget({instance:k.setting()})}),k))}}),b.extend(g.panelConstructor,{widgets:g.Widgets.WidgetsPanel}),b.extend(g.sectionConstructor,{sidebar:g.Widgets.SidebarSection}),b.extend(g.controlConstructor,{widget_form:g.Widgets.WidgetControl,sidebar_widgets:g.Widgets.SidebarControl}),g.bind("ready",function(){g.Widgets.availableWidgetsPanel=new g.Widgets.AvailableWidgetsPanelView({collection:g.Widgets.availableWidgets}),g.previewer.bind("highlight-widget-control",g.Widgets.highlightWidgetFormControl),g.previewer.bind("focus-widget-control",g.Widgets.focusWidgetFormControl)}),g.Widgets.highlightWidgetFormControl=function(a){var b=g.Widgets.getWidgetFormControlForWidget(a);b&&b.highlightSectionAndControl()},g.Widgets.focusWidgetFormControl=function(a){var b=g.Widgets.getWidgetFormControlForWidget(a);b&&b.focus()},g.Widgets.getSidebarWidgetControlContainingWidget=function(a){var b=null;return g.control.each(function(c){"sidebar_widgets"===c.params.type&&-1!==_.indexOf(c.setting(),a)&&(b=c)}),b},g.Widgets.getWidgetFormControlForWidget=function(a){var b=null;return g.control.each(function(c){"widget_form"===c.params.type&&c.params.widget_id===a&&(b=c)}),b},b(document).on("widget-added",function(a,b){var e,f,h,i;e=d(b.find("> .widget-inside > .form > .widget-id").val()),"nav_menu"===e.id_base&&(f=g.control("widget_nav_menu["+String(e.number)+"]"),f&&(h=b.find('select[name*="nav_menu"]'),i=b.find(".edit-selected-nav-menu > button"),0!==h.length&&0!==i.length&&(h.on("change",function(){g.section.has("nav_menu["+h.val()+"]")?i.parent().show():i.parent().hide()}),i.on("click",function(){var a=g.section("nav_menu["+h.val()+"]");a&&c(a,f)}))))})}}(window.wp,jQuery); \ No newline at end of file
diff --git a/www/crm/wp-admin/js/dashboard.js b/www/crm/wp-admin/js/dashboard.js
new file mode 100644
index 00000000..aa9f9218
--- /dev/null
+++ b/www/crm/wp-admin/js/dashboard.js
@@ -0,0 +1,593 @@
+/**
+ * @output wp-admin/js/dashboard.js
+ */
+
+/* global pagenow, ajaxurl, postboxes, wpActiveEditor:true, ajaxWidgets */
+/* global ajaxPopulateWidgets, quickPressLoad, */
+window.wp = window.wp || {};
+
+/**
+ * Initializes the dashboard widget functionality.
+ *
+ * @since 2.7.0
+ */
+jQuery(document).ready( function($) {
+ var welcomePanel = $( '#welcome-panel' ),
+ welcomePanelHide = $('#wp_welcome_panel-hide'),
+ updateWelcomePanel;
+
+ /**
+ * Saves the visibility of the welcome panel.
+ *
+ * @since 3.3.0
+ *
+ * @param {boolean} visible Should it be visible or not.
+ *
+ * @returns {void}
+ */
+ updateWelcomePanel = function( visible ) {
+ $.post( ajaxurl, {
+ action: 'update-welcome-panel',
+ visible: visible,
+ welcomepanelnonce: $( '#welcomepanelnonce' ).val()
+ });
+ };
+
+ // Unhide the welcome panel if the Welcome Option checkbox is checked.
+ if ( welcomePanel.hasClass('hidden') && welcomePanelHide.prop('checked') ) {
+ welcomePanel.removeClass('hidden');
+ }
+
+ // Hide the welcome panel when the dismiss button or close button is clicked.
+ $('.welcome-panel-close, .welcome-panel-dismiss a', welcomePanel).click( function(e) {
+ e.preventDefault();
+ welcomePanel.addClass('hidden');
+ updateWelcomePanel( 0 );
+ $('#wp_welcome_panel-hide').prop('checked', false);
+ });
+
+ // Set welcome panel visibility based on Welcome Option checkbox value.
+ welcomePanelHide.click( function() {
+ welcomePanel.toggleClass('hidden', ! this.checked );
+ updateWelcomePanel( this.checked ? 1 : 0 );
+ });
+
+ /**
+ * These widgets can be populated via ajax.
+ *
+ * @since 2.7.0
+ *
+ * @type {string[]}
+ *
+ * @global
+ */
+ window.ajaxWidgets = ['dashboard_primary'];
+
+ /**
+ * Triggers widget updates via AJAX.
+ *
+ * @since 2.7.0
+ *
+ * @global
+ *
+ * @param {string} el Optional. Widget to fetch or none to update all.
+ *
+ * @returns {void}
+ */
+ window.ajaxPopulateWidgets = function(el) {
+ /**
+ * Fetch the latest representation of the widget via Ajax and show it.
+ *
+ * @param {number} i Number of half-seconds to use as the timeout.
+ * @param {string} id ID of the element which is going to be checked for changes.
+ *
+ * @returns {void}
+ */
+ function show(i, id) {
+ var p, e = $('#' + id + ' div.inside:visible').find('.widget-loading');
+ // If the element is found in the dom, queue to load latest representation.
+ if ( e.length ) {
+ p = e.parent();
+ setTimeout( function(){
+ // Request the widget content.
+ p.load( ajaxurl + '?action=dashboard-widgets&widget=' + id + '&pagenow=' + pagenow, '', function() {
+ // Hide the parent and slide it out for visual fancyness.
+ p.hide().slideDown('normal', function(){
+ $(this).css('display', '');
+ });
+ });
+ }, i * 500 );
+ }
+ }
+
+ // If we have received a specific element to fetch, check if it is valid.
+ if ( el ) {
+ el = el.toString();
+ // If the element is available as AJAX widget, show it.
+ if ( $.inArray(el, ajaxWidgets) !== -1 ) {
+ // Show element without any delay.
+ show(0, el);
+ }
+ } else {
+ // Walk through all ajaxWidgets, loading them after each other.
+ $.each( ajaxWidgets, show );
+ }
+ };
+
+ // Initially populate ajax widgets.
+ ajaxPopulateWidgets();
+
+ // Register ajax widgets as postbox toggles.
+ postboxes.add_postbox_toggles(pagenow, { pbshow: ajaxPopulateWidgets } );
+
+ /**
+ * Control the Quick Press (Quick Draft) widget.
+ *
+ * @since 2.7.0
+ *
+ * @global
+ *
+ * @returns {void}
+ */
+ window.quickPressLoad = function() {
+ var act = $('#quickpost-action'), t;
+
+ // Enable the submit buttons.
+ $( '#quick-press .submit input[type="submit"], #quick-press .submit input[type="reset"]' ).prop( 'disabled' , false );
+
+ t = $('#quick-press').submit( function( e ) {
+ e.preventDefault();
+
+ // Show a spinner.
+ $('#dashboard_quick_press #publishing-action .spinner').show();
+
+ // Disable the submit button to prevent duplicate submissions.
+ $('#quick-press .submit input[type="submit"], #quick-press .submit input[type="reset"]').prop('disabled', true);
+
+ // Post the entered data to save it.
+ $.post( t.attr( 'action' ), t.serializeArray(), function( data ) {
+ // Replace the form, and prepend the published post.
+ $('#dashboard_quick_press .inside').html( data );
+ $('#quick-press').removeClass('initial-form');
+ quickPressLoad();
+ highlightLatestPost();
+
+ // Focus the title to allow for quickly drafting another post.
+ $('#title').focus();
+ });
+
+ /**
+ * Highlights the latest post for one second.
+ *
+ * @returns {void}
+ */
+ function highlightLatestPost () {
+ var latestPost = $('.drafts ul li').first();
+ latestPost.css('background', '#fffbe5');
+ setTimeout(function () {
+ latestPost.css('background', 'none');
+ }, 1000);
+ }
+ } );
+
+ // Change the QuickPost action to the publish value.
+ $('#publish').click( function() { act.val( 'post-quickpress-publish' ); } );
+
+ $('#quick-press').on( 'click focusin', function() {
+ wpActiveEditor = 'content';
+ });
+
+ autoResizeTextarea();
+ };
+ window.quickPressLoad();
+
+ // Enable the dragging functionality of the widgets.
+ $( '.meta-box-sortables' ).sortable( 'option', 'containment', '#wpwrap' );
+
+ /**
+ * Adjust the height of the textarea based on the content.
+ *
+ * @since 3.6.0
+ *
+ * @returns {void}
+ */
+ function autoResizeTextarea() {
+ // When IE8 or older is used to render this document, exit.
+ if ( document.documentMode && document.documentMode < 9 ) {
+ return;
+ }
+
+ // Add a hidden div. We'll copy over the text from the textarea to measure its height.
+ $('body').append( '<div class="quick-draft-textarea-clone" style="display: none;"></div>' );
+
+ var clone = $('.quick-draft-textarea-clone'),
+ editor = $('#content'),
+ editorHeight = editor.height(),
+ /*
+ * 100px roughly accounts for browser chrome and allows the
+ * save draft button to show on-screen at the same time.
+ */
+ editorMaxHeight = $(window).height() - 100;
+
+ /*
+ * Match up textarea and clone div as much as possible.
+ * Padding cannot be reliably retrieved using shorthand in all browsers.
+ */
+ clone.css({
+ 'font-family': editor.css('font-family'),
+ 'font-size': editor.css('font-size'),
+ 'line-height': editor.css('line-height'),
+ 'padding-bottom': editor.css('paddingBottom'),
+ 'padding-left': editor.css('paddingLeft'),
+ 'padding-right': editor.css('paddingRight'),
+ 'padding-top': editor.css('paddingTop'),
+ 'white-space': 'pre-wrap',
+ 'word-wrap': 'break-word',
+ 'display': 'none'
+ });
+
+ // The 'propertychange' is used in IE < 9.
+ editor.on('focus input propertychange', function() {
+ var $this = $(this),
+ // Add a non-breaking space to ensure that the height of a trailing newline is
+ // included.
+ textareaContent = $this.val() + '&nbsp;',
+ // Add 2px to compensate for border-top & border-bottom.
+ cloneHeight = clone.css('width', $this.css('width')).text(textareaContent).outerHeight() + 2;
+
+ // Default to show a vertical scrollbar, if needed.
+ editor.css('overflow-y', 'auto');
+
+ // Only change the height if it has changed and both heights are below the max.
+ if ( cloneHeight === editorHeight || ( cloneHeight >= editorMaxHeight && editorHeight >= editorMaxHeight ) ) {
+ return;
+ }
+
+ /*
+ * Don't allow editor to exceed the height of the window.
+ * This is also bound in CSS to a max-height of 1300px to be extra safe.
+ */
+ if ( cloneHeight > editorMaxHeight ) {
+ editorHeight = editorMaxHeight;
+ } else {
+ editorHeight = cloneHeight;
+ }
+
+ // Disable scrollbars because we adjust the height to the content.
+ editor.css('overflow', 'hidden');
+
+ $this.css('height', editorHeight + 'px');
+ });
+ }
+
+} );
+
+jQuery( function( $ ) {
+ 'use strict';
+
+ var communityEventsData = window.communityEventsData || {},
+ app;
+
+ /**
+ * Global Community Events namespace.
+ *
+ * @since 4.8.0
+ *
+ * @memberOf wp
+ * @namespace wp.communityEvents
+ */
+ app = window.wp.communityEvents = /** @lends wp.communityEvents */{
+ initialized: false,
+ model: null,
+
+ /**
+ * Initializes the wp.communityEvents object.
+ *
+ * @since 4.8.0
+ *
+ * @returns {void}
+ */
+ init: function() {
+ if ( app.initialized ) {
+ return;
+ }
+
+ var $container = $( '#community-events' );
+
+ /*
+ * When JavaScript is disabled, the errors container is shown, so
+ * that "This widget requires JavaScript" message can be seen.
+ *
+ * When JS is enabled, the container is hidden at first, and then
+ * revealed during the template rendering, if there actually are
+ * errors to show.
+ *
+ * The display indicator switches from `hide-if-js` to `aria-hidden`
+ * here in order to maintain consistency with all the other fields
+ * that key off of `aria-hidden` to determine their visibility.
+ * `aria-hidden` can't be used initially, because there would be no
+ * way to set it to false when JavaScript is disabled, which would
+ * prevent people from seeing the "This widget requires JavaScript"
+ * message.
+ */
+ $( '.community-events-errors' )
+ .attr( 'aria-hidden', 'true' )
+ .removeClass( 'hide-if-js' );
+
+ $container.on( 'click', '.community-events-toggle-location, .community-events-cancel', app.toggleLocationForm );
+
+ /**
+ * Filters events based on entered location.
+ *
+ * @returns {void}
+ */
+ $container.on( 'submit', '.community-events-form', function( event ) {
+ var location = $.trim( $( '#community-events-location' ).val() );
+
+ event.preventDefault();
+
+ /*
+ * Don't trigger a search if the search field is empty or the
+ * search term was made of only spaces before being trimmed.
+ */
+ if ( ! location ) {
+ return;
+ }
+
+ app.getEvents({
+ location: location
+ });
+ });
+
+ if ( communityEventsData && communityEventsData.cache && communityEventsData.cache.location && communityEventsData.cache.events ) {
+ app.renderEventsTemplate( communityEventsData.cache, 'app' );
+ } else {
+ app.getEvents();
+ }
+
+ app.initialized = true;
+ },
+
+ /**
+ * Toggles the visibility of the Edit Location form.
+ *
+ * @since 4.8.0
+ *
+ * @param {event|string} action 'show' or 'hide' to specify a state;
+ * or an event object to flip between states.
+ *
+ * @returns {void}
+ */
+ toggleLocationForm: function( action ) {
+ var $toggleButton = $( '.community-events-toggle-location' ),
+ $cancelButton = $( '.community-events-cancel' ),
+ $form = $( '.community-events-form' ),
+ $target = $();
+
+ if ( 'object' === typeof action ) {
+ // The action is the event object: get the clicked element.
+ $target = $( action.target );
+ /*
+ * Strict comparison doesn't work in this case because sometimes
+ * we explicitly pass a string as value of aria-expanded and
+ * sometimes a boolean as the result of an evaluation.
+ */
+ action = 'true' == $toggleButton.attr( 'aria-expanded' ) ? 'hide' : 'show';
+ }
+
+ if ( 'hide' === action ) {
+ $toggleButton.attr( 'aria-expanded', 'false' );
+ $cancelButton.attr( 'aria-expanded', 'false' );
+ $form.attr( 'aria-hidden', 'true' );
+ /*
+ * If the Cancel button has been clicked, bring the focus back
+ * to the toggle button so users relying on screen readers don't
+ * lose their place.
+ */
+ if ( $target.hasClass( 'community-events-cancel' ) ) {
+ $toggleButton.focus();
+ }
+ } else {
+ $toggleButton.attr( 'aria-expanded', 'true' );
+ $cancelButton.attr( 'aria-expanded', 'true' );
+ $form.attr( 'aria-hidden', 'false' );
+ }
+ },
+
+ /**
+ * Sends REST API requests to fetch events for the widget.
+ *
+ * @since 4.8.0
+ *
+ * @param {Object} requestParams REST API Request parameters object.
+ *
+ * @returns {void}
+ */
+ getEvents: function( requestParams ) {
+ var initiatedBy,
+ app = this,
+ $spinner = $( '.community-events-form' ).children( '.spinner' );
+
+ requestParams = requestParams || {};
+ requestParams._wpnonce = communityEventsData.nonce;
+ requestParams.timezone = window.Intl ? window.Intl.DateTimeFormat().resolvedOptions().timeZone : '';
+
+ initiatedBy = requestParams.location ? 'user' : 'app';
+
+ $spinner.addClass( 'is-active' );
+
+ wp.ajax.post( 'get-community-events', requestParams )
+ .always( function() {
+ $spinner.removeClass( 'is-active' );
+ })
+
+ .done( function( response ) {
+ if ( 'no_location_available' === response.error ) {
+ if ( requestParams.location ) {
+ response.unknownCity = requestParams.location;
+ } else {
+ /*
+ * No location was passed, which means that this was an automatic query
+ * based on IP, locale, and timezone. Since the user didn't initiate it,
+ * it should fail silently. Otherwise, the error could confuse and/or
+ * annoy them.
+ */
+ delete response.error;
+ }
+ }
+ app.renderEventsTemplate( response, initiatedBy );
+ })
+
+ .fail( function() {
+ app.renderEventsTemplate({
+ 'location' : false,
+ 'error' : true
+ }, initiatedBy );
+ });
+ },
+
+ /**
+ * Renders the template for the Events section of the Events & News widget.
+ *
+ * @since 4.8.0
+ *
+ * @param {Object} templateParams The various parameters that will get passed to wp.template.
+ * @param {string} initiatedBy 'user' to indicate that this was triggered manually by the user;
+ * 'app' to indicate it was triggered automatically by the app itself.
+ *
+ * @returns {void}
+ */
+ renderEventsTemplate: function( templateParams, initiatedBy ) {
+ var template,
+ elementVisibility,
+ l10nPlaceholder = /%(?:\d\$)?s/g, // Match `%s`, `%1$s`, `%2$s`, etc.
+ $toggleButton = $( '.community-events-toggle-location' ),
+ $locationMessage = $( '#community-events-location-message' ),
+ $results = $( '.community-events-results' );
+
+ /*
+ * Hide all toggleable elements by default, to keep the logic simple.
+ * Otherwise, each block below would have to turn hide everything that
+ * could have been shown at an earlier point.
+ *
+ * The exception to that is that the .community-events container is hidden
+ * when the page is first loaded, because the content isn't ready yet,
+ * but once we've reached this point, it should always be shown.
+ */
+ elementVisibility = {
+ '.community-events' : true,
+ '.community-events-loading' : false,
+ '.community-events-errors' : false,
+ '.community-events-error-occurred' : false,
+ '.community-events-could-not-locate' : false,
+ '#community-events-location-message' : false,
+ '.community-events-toggle-location' : false,
+ '.community-events-results' : false
+ };
+
+ /*
+ * Determine which templates should be rendered and which elements
+ * should be displayed.
+ */
+ if ( templateParams.location.ip ) {
+ /*
+ * If the API determined the location by geolocating an IP, it will
+ * provide events, but not a specific location.
+ */
+ $locationMessage.text( communityEventsData.l10n.attend_event_near_generic );
+
+ if ( templateParams.events.length ) {
+ template = wp.template( 'community-events-event-list' );
+ $results.html( template( templateParams ) );
+ } else {
+ template = wp.template( 'community-events-no-upcoming-events' );
+ $results.html( template( templateParams ) );
+ }
+
+ elementVisibility['#community-events-location-message'] = true;
+ elementVisibility['.community-events-toggle-location'] = true;
+ elementVisibility['.community-events-results'] = true;
+
+ } else if ( templateParams.location.description ) {
+ template = wp.template( 'community-events-attend-event-near' );
+ $locationMessage.html( template( templateParams ) );
+
+ if ( templateParams.events.length ) {
+ template = wp.template( 'community-events-event-list' );
+ $results.html( template( templateParams ) );
+ } else {
+ template = wp.template( 'community-events-no-upcoming-events' );
+ $results.html( template( templateParams ) );
+ }
+
+ if ( 'user' === initiatedBy ) {
+ wp.a11y.speak( communityEventsData.l10n.city_updated.replace( l10nPlaceholder, templateParams.location.description ), 'assertive' );
+ }
+
+ elementVisibility['#community-events-location-message'] = true;
+ elementVisibility['.community-events-toggle-location'] = true;
+ elementVisibility['.community-events-results'] = true;
+
+ } else if ( templateParams.unknownCity ) {
+ template = wp.template( 'community-events-could-not-locate' );
+ $( '.community-events-could-not-locate' ).html( template( templateParams ) );
+ wp.a11y.speak( communityEventsData.l10n.could_not_locate_city.replace( l10nPlaceholder, templateParams.unknownCity ) );
+
+ elementVisibility['.community-events-errors'] = true;
+ elementVisibility['.community-events-could-not-locate'] = true;
+
+ } else if ( templateParams.error && 'user' === initiatedBy ) {
+ /*
+ * Errors messages are only shown for requests that were initiated
+ * by the user, not for ones that were initiated by the app itself.
+ * Showing error messages for an event that user isn't aware of
+ * could be confusing or unnecessarily distracting.
+ */
+ wp.a11y.speak( communityEventsData.l10n.error_occurred_please_try_again );
+
+ elementVisibility['.community-events-errors'] = true;
+ elementVisibility['.community-events-error-occurred'] = true;
+ } else {
+ $locationMessage.text( communityEventsData.l10n.enter_closest_city );
+
+ elementVisibility['#community-events-location-message'] = true;
+ elementVisibility['.community-events-toggle-location'] = true;
+ }
+
+ // Set the visibility of toggleable elements.
+ _.each( elementVisibility, function( isVisible, element ) {
+ $( element ).attr( 'aria-hidden', ! isVisible );
+ });
+
+ $toggleButton.attr( 'aria-expanded', elementVisibility['.community-events-toggle-location'] );
+
+ if ( templateParams.location && ( templateParams.location.ip || templateParams.location.latitude ) ) {
+ // Hide the form when there's a valid location.
+ app.toggleLocationForm( 'hide' );
+
+ if ( 'user' === initiatedBy ) {
+ /*
+ * When the form is programmatically hidden after a user search,
+ * bring the focus back to the toggle button so users relying
+ * on screen readers don't lose their place.
+ */
+ $toggleButton.focus();
+ }
+ } else {
+ app.toggleLocationForm( 'show' );
+ }
+ }
+ };
+
+ if ( $( '#dashboard_primary' ).is( ':visible' ) ) {
+ app.init();
+ } else {
+ $( document ).on( 'postbox-toggled', function( event, postbox ) {
+ var $postbox = $( postbox );
+
+ if ( 'dashboard_primary' === $postbox.attr( 'id' ) && $postbox.is( ':visible' ) ) {
+ app.init();
+ }
+ });
+ }
+});
diff --git a/www/crm/wp-admin/js/dashboard.min.js b/www/crm/wp-admin/js/dashboard.min.js
new file mode 100644
index 00000000..bf939f83
--- /dev/null
+++ b/www/crm/wp-admin/js/dashboard.min.js
@@ -0,0 +1 @@
+window.wp=window.wp||{},jQuery(document).ready(function(a){function b(){if(!(document.documentMode&&document.documentMode<9)){a("body").append('<div class="quick-draft-textarea-clone" style="display: none;"></div>');var b=a(".quick-draft-textarea-clone"),c=a("#content"),d=c.height(),e=a(window).height()-100;b.css({"font-family":c.css("font-family"),"font-size":c.css("font-size"),"line-height":c.css("line-height"),"padding-bottom":c.css("paddingBottom"),"padding-left":c.css("paddingLeft"),"padding-right":c.css("paddingRight"),"padding-top":c.css("paddingTop"),"white-space":"pre-wrap","word-wrap":"break-word",display:"none"}),c.on("focus input propertychange",function(){var f=a(this),g=f.val()+"&nbsp;",h=b.css("width",f.css("width")).text(g).outerHeight()+2;c.css("overflow-y","auto"),h===d||h>=e&&d>=e||(d=h>e?e:h,c.css("overflow","hidden"),f.css("height",d+"px"))})}}var c,d=a("#welcome-panel"),e=a("#wp_welcome_panel-hide");c=function(b){a.post(ajaxurl,{action:"update-welcome-panel",visible:b,welcomepanelnonce:a("#welcomepanelnonce").val()})},d.hasClass("hidden")&&e.prop("checked")&&d.removeClass("hidden"),a(".welcome-panel-close, .welcome-panel-dismiss a",d).click(function(b){b.preventDefault(),d.addClass("hidden"),c(0),a("#wp_welcome_panel-hide").prop("checked",!1)}),e.click(function(){d.toggleClass("hidden",!this.checked),c(this.checked?1:0)}),window.ajaxWidgets=["dashboard_primary"],window.ajaxPopulateWidgets=function(b){function c(b,c){var d,e=a("#"+c+" div.inside:visible").find(".widget-loading");e.length&&(d=e.parent(),setTimeout(function(){d.load(ajaxurl+"?action=dashboard-widgets&widget="+c+"&pagenow="+pagenow,"",function(){d.hide().slideDown("normal",function(){a(this).css("display","")})})},500*b))}b?(b=b.toString(),a.inArray(b,ajaxWidgets)!==-1&&c(0,b)):a.each(ajaxWidgets,c)},ajaxPopulateWidgets(),postboxes.add_postbox_toggles(pagenow,{pbshow:ajaxPopulateWidgets}),window.quickPressLoad=function(){var c,d=a("#quickpost-action");a('#quick-press .submit input[type="submit"], #quick-press .submit input[type="reset"]').prop("disabled",!1),c=a("#quick-press").submit(function(b){function d(){var b=a(".drafts ul li").first();b.css("background","#fffbe5"),setTimeout(function(){b.css("background","none")},1e3)}b.preventDefault(),a("#dashboard_quick_press #publishing-action .spinner").show(),a('#quick-press .submit input[type="submit"], #quick-press .submit input[type="reset"]').prop("disabled",!0),a.post(c.attr("action"),c.serializeArray(),function(b){a("#dashboard_quick_press .inside").html(b),a("#quick-press").removeClass("initial-form"),quickPressLoad(),d(),a("#title").focus()})}),a("#publish").click(function(){d.val("post-quickpress-publish")}),a("#quick-press").on("click focusin",function(){wpActiveEditor="content"}),b()},window.quickPressLoad(),a(".meta-box-sortables").sortable("option","containment","#wpwrap")}),jQuery(function(a){"use strict";var b,c=window.communityEventsData||{};b=window.wp.communityEvents={initialized:!1,model:null,init:function(){if(!b.initialized){var d=a("#community-events");a(".community-events-errors").attr("aria-hidden","true").removeClass("hide-if-js"),d.on("click",".community-events-toggle-location, .community-events-cancel",b.toggleLocationForm),d.on("submit",".community-events-form",function(c){var d=a.trim(a("#community-events-location").val());c.preventDefault(),d&&b.getEvents({location:d})}),c&&c.cache&&c.cache.location&&c.cache.events?b.renderEventsTemplate(c.cache,"app"):b.getEvents(),b.initialized=!0}},toggleLocationForm:function(b){var c=a(".community-events-toggle-location"),d=a(".community-events-cancel"),e=a(".community-events-form"),f=a();"object"==typeof b&&(f=a(b.target),b="true"==c.attr("aria-expanded")?"hide":"show"),"hide"===b?(c.attr("aria-expanded","false"),d.attr("aria-expanded","false"),e.attr("aria-hidden","true"),f.hasClass("community-events-cancel")&&c.focus()):(c.attr("aria-expanded","true"),d.attr("aria-expanded","true"),e.attr("aria-hidden","false"))},getEvents:function(b){var d,e=this,f=a(".community-events-form").children(".spinner");b=b||{},b._wpnonce=c.nonce,b.timezone=window.Intl?window.Intl.DateTimeFormat().resolvedOptions().timeZone:"",d=b.location?"user":"app",f.addClass("is-active"),wp.ajax.post("get-community-events",b).always(function(){f.removeClass("is-active")}).done(function(a){"no_location_available"===a.error&&(b.location?a.unknownCity=b.location:delete a.error),e.renderEventsTemplate(a,d)}).fail(function(){e.renderEventsTemplate({location:!1,error:!0},d)})},renderEventsTemplate:function(d,e){var f,g,h=/%(?:\d\$)?s/g,i=a(".community-events-toggle-location"),j=a("#community-events-location-message"),k=a(".community-events-results");g={".community-events":!0,".community-events-loading":!1,".community-events-errors":!1,".community-events-error-occurred":!1,".community-events-could-not-locate":!1,"#community-events-location-message":!1,".community-events-toggle-location":!1,".community-events-results":!1},d.location.ip?(j.text(c.l10n.attend_event_near_generic),d.events.length?(f=wp.template("community-events-event-list"),k.html(f(d))):(f=wp.template("community-events-no-upcoming-events"),k.html(f(d))),g["#community-events-location-message"]=!0,g[".community-events-toggle-location"]=!0,g[".community-events-results"]=!0):d.location.description?(f=wp.template("community-events-attend-event-near"),j.html(f(d)),d.events.length?(f=wp.template("community-events-event-list"),k.html(f(d))):(f=wp.template("community-events-no-upcoming-events"),k.html(f(d))),"user"===e&&wp.a11y.speak(c.l10n.city_updated.replace(h,d.location.description),"assertive"),g["#community-events-location-message"]=!0,g[".community-events-toggle-location"]=!0,g[".community-events-results"]=!0):d.unknownCity?(f=wp.template("community-events-could-not-locate"),a(".community-events-could-not-locate").html(f(d)),wp.a11y.speak(c.l10n.could_not_locate_city.replace(h,d.unknownCity)),g[".community-events-errors"]=!0,g[".community-events-could-not-locate"]=!0):d.error&&"user"===e?(wp.a11y.speak(c.l10n.error_occurred_please_try_again),g[".community-events-errors"]=!0,g[".community-events-error-occurred"]=!0):(j.text(c.l10n.enter_closest_city),g["#community-events-location-message"]=!0,g[".community-events-toggle-location"]=!0),_.each(g,function(b,c){a(c).attr("aria-hidden",!b)}),i.attr("aria-expanded",g[".community-events-toggle-location"]),d.location&&(d.location.ip||d.location.latitude)?(b.toggleLocationForm("hide"),"user"===e&&i.focus()):b.toggleLocationForm("show")}},a("#dashboard_primary").is(":visible")?b.init():a(document).on("postbox-toggled",function(c,d){var e=a(d);"dashboard_primary"===e.attr("id")&&e.is(":visible")&&b.init()})}); \ No newline at end of file
diff --git a/www/crm/wp-admin/js/edit-comments.js b/www/crm/wp-admin/js/edit-comments.js
new file mode 100644
index 00000000..62fd7fa7
--- /dev/null
+++ b/www/crm/wp-admin/js/edit-comments.js
@@ -0,0 +1,1016 @@
+/**
+ * @output wp-admin/js/edit-comments.js
+ */
+
+/* global adminCommentsL10n, thousandsSeparator, list_args, QTags, ajaxurl, wpAjax */
+/* global commentReply, theExtraList, theList, setCommentsList */
+
+(function($) {
+var getCount, updateCount, updateCountText, updatePending, updateApproved,
+ updateHtmlTitle, updateDashboardText, updateInModerationText, adminTitle = document.title,
+ isDashboard = $('#dashboard_right_now').length,
+ titleDiv, titleRegEx;
+
+ getCount = function(el) {
+ var n = parseInt( el.html().replace(/[^0-9]+/g, ''), 10 );
+ if ( isNaN(n) ) {
+ return 0;
+ }
+ return n;
+ };
+
+ updateCount = function(el, n) {
+ var n1 = '';
+ if ( isNaN(n) ) {
+ return;
+ }
+ n = n < 1 ? '0' : n.toString();
+ if ( n.length > 3 ) {
+ while ( n.length > 3 ) {
+ n1 = thousandsSeparator + n.substr(n.length - 3) + n1;
+ n = n.substr(0, n.length - 3);
+ }
+ n = n + n1;
+ }
+ el.html(n);
+ };
+
+ updateApproved = function( diff, commentPostId ) {
+ var postSelector = '.post-com-count-' + commentPostId,
+ noClass = 'comment-count-no-comments',
+ approvedClass = 'comment-count-approved',
+ approved,
+ noComments;
+
+ updateCountText( 'span.approved-count', diff );
+
+ if ( ! commentPostId ) {
+ return;
+ }
+
+ // cache selectors to not get dupes
+ approved = $( 'span.' + approvedClass, postSelector );
+ noComments = $( 'span.' + noClass, postSelector );
+
+ approved.each(function() {
+ var a = $(this), n = getCount(a) + diff;
+ if ( n < 1 )
+ n = 0;
+
+ if ( 0 === n ) {
+ a.removeClass( approvedClass ).addClass( noClass );
+ } else {
+ a.addClass( approvedClass ).removeClass( noClass );
+ }
+ updateCount( a, n );
+ });
+
+ noComments.each(function() {
+ var a = $(this);
+ if ( diff > 0 ) {
+ a.removeClass( noClass ).addClass( approvedClass );
+ } else {
+ a.addClass( noClass ).removeClass( approvedClass );
+ }
+ updateCount( a, diff );
+ });
+ };
+
+ updateCountText = function( selector, diff ) {
+ $( selector ).each(function() {
+ var a = $(this), n = getCount(a) + diff;
+ if ( n < 1 ) {
+ n = 0;
+ }
+ updateCount( a, n );
+ });
+ };
+
+ updateDashboardText = function( response ) {
+ if ( ! isDashboard || ! response || ! response.i18n_comments_text ) {
+ return;
+ }
+
+ $( '.comment-count a', '#dashboard_right_now' ).text( response.i18n_comments_text );
+ };
+
+ /**
+ * Updates the "comments in moderation" text across the UI.
+ *
+ * @since 5.2.0
+ *
+ * @param {object} response Ajax response from the server.
+ *
+ * @return {void}
+ */
+ updateInModerationText = function( response ) {
+ if ( ! response || ! response.i18n_moderation_text ) {
+ return;
+ }
+
+ // Update the "comment in moderation" text across the UI.
+ $( '.comments-in-moderation-text' ).text( response.i18n_moderation_text );
+ // Hide the "comment in moderation" text in the Dashboard "At a Glance" widget.
+ if ( isDashboard && response.in_moderation ) {
+ $( '.comment-mod-count', '#dashboard_right_now' )
+ [ response.in_moderation > 0 ? 'removeClass' : 'addClass' ]( 'hidden' );
+ }
+ };
+
+ updateHtmlTitle = function( diff ) {
+ var newTitle, regExMatch, titleCount, commentFrag;
+
+ titleRegEx = titleRegEx || new RegExp( adminCommentsL10n.docTitleCommentsCount.replace( '%s', '\\([0-9' + thousandsSeparator + ']+\\)' ) + '?' );
+ // count funcs operate on a $'d element
+ titleDiv = titleDiv || $( '<div />' );
+ newTitle = adminTitle;
+
+ commentFrag = titleRegEx.exec( document.title );
+ if ( commentFrag ) {
+ commentFrag = commentFrag[0];
+ titleDiv.html( commentFrag );
+ titleCount = getCount( titleDiv ) + diff;
+ } else {
+ titleDiv.html( 0 );
+ titleCount = diff;
+ }
+
+ if ( titleCount >= 1 ) {
+ updateCount( titleDiv, titleCount );
+ regExMatch = titleRegEx.exec( document.title );
+ if ( regExMatch ) {
+ newTitle = document.title.replace( regExMatch[0], adminCommentsL10n.docTitleCommentsCount.replace( '%s', titleDiv.text() ) + ' ' );
+ }
+ } else {
+ regExMatch = titleRegEx.exec( newTitle );
+ if ( regExMatch ) {
+ newTitle = newTitle.replace( regExMatch[0], adminCommentsL10n.docTitleComments );
+ }
+ }
+ document.title = newTitle;
+ };
+
+ updatePending = function( diff, commentPostId ) {
+ var postSelector = '.post-com-count-' + commentPostId,
+ noClass = 'comment-count-no-pending',
+ noParentClass = 'post-com-count-no-pending',
+ pendingClass = 'comment-count-pending',
+ pending,
+ noPending;
+
+ if ( ! isDashboard ) {
+ updateHtmlTitle( diff );
+ }
+
+ $( 'span.pending-count' ).each(function() {
+ var a = $(this), n = getCount(a) + diff;
+ if ( n < 1 )
+ n = 0;
+ a.closest('.awaiting-mod')[ 0 === n ? 'addClass' : 'removeClass' ]('count-0');
+ updateCount( a, n );
+ });
+
+ if ( ! commentPostId ) {
+ return;
+ }
+
+ // cache selectors to not get dupes
+ pending = $( 'span.' + pendingClass, postSelector );
+ noPending = $( 'span.' + noClass, postSelector );
+
+ pending.each(function() {
+ var a = $(this), n = getCount(a) + diff;
+ if ( n < 1 )
+ n = 0;
+
+ if ( 0 === n ) {
+ a.parent().addClass( noParentClass );
+ a.removeClass( pendingClass ).addClass( noClass );
+ } else {
+ a.parent().removeClass( noParentClass );
+ a.addClass( pendingClass ).removeClass( noClass );
+ }
+ updateCount( a, n );
+ });
+
+ noPending.each(function() {
+ var a = $(this);
+ if ( diff > 0 ) {
+ a.parent().removeClass( noParentClass );
+ a.removeClass( noClass ).addClass( pendingClass );
+ } else {
+ a.parent().addClass( noParentClass );
+ a.addClass( noClass ).removeClass( pendingClass );
+ }
+ updateCount( a, diff );
+ });
+ };
+
+window.setCommentsList = function() {
+ var totalInput, perPageInput, pageInput, dimAfter, delBefore, updateTotalCount, delAfter, refillTheExtraList, diff,
+ lastConfidentTime = 0;
+
+ totalInput = $('input[name="_total"]', '#comments-form');
+ perPageInput = $('input[name="_per_page"]', '#comments-form');
+ pageInput = $('input[name="_page"]', '#comments-form');
+
+ // Updates the current total (stored in the _total input)
+ updateTotalCount = function( total, time, setConfidentTime ) {
+ if ( time < lastConfidentTime )
+ return;
+
+ if ( setConfidentTime )
+ lastConfidentTime = time;
+
+ totalInput.val( total.toString() );
+ };
+
+ // this fires when viewing "All"
+ dimAfter = function( r, settings ) {
+ var editRow, replyID, replyButton, response,
+ c = $( '#' + settings.element );
+
+ if ( true !== settings.parsed ) {
+ response = settings.parsed.responses[0];
+ }
+
+ editRow = $('#replyrow');
+ replyID = $('#comment_ID', editRow).val();
+ replyButton = $('#replybtn', editRow);
+
+ if ( c.is('.unapproved') ) {
+ if ( settings.data.id == replyID )
+ replyButton.text(adminCommentsL10n.replyApprove);
+
+ c.find( '.row-actions span.view' ).addClass( 'hidden' ).end()
+ .find( 'div.comment_status' ).html( '0' );
+
+ } else {
+ if ( settings.data.id == replyID )
+ replyButton.text(adminCommentsL10n.reply);
+
+ c.find( '.row-actions span.view' ).removeClass( 'hidden' ).end()
+ .find( 'div.comment_status' ).html( '1' );
+ }
+
+ diff = $('#' + settings.element).is('.' + settings.dimClass) ? 1 : -1;
+ if ( response ) {
+ updateDashboardText( response.supplemental );
+ updateInModerationText( response.supplemental );
+ updatePending( diff, response.supplemental.postId );
+ updateApproved( -1 * diff, response.supplemental.postId );
+ } else {
+ updatePending( diff );
+ updateApproved( -1 * diff );
+ }
+ };
+
+ // Send current total, page, per_page and url
+ delBefore = function( settings, list ) {
+ var note, id, el, n, h, a, author,
+ action = false,
+ wpListsData = $( settings.target ).attr( 'data-wp-lists' );
+
+ settings.data._total = totalInput.val() || 0;
+ settings.data._per_page = perPageInput.val() || 0;
+ settings.data._page = pageInput.val() || 0;
+ settings.data._url = document.location.href;
+ settings.data.comment_status = $('input[name="comment_status"]', '#comments-form').val();
+
+ if ( wpListsData.indexOf(':trash=1') != -1 )
+ action = 'trash';
+ else if ( wpListsData.indexOf(':spam=1') != -1 )
+ action = 'spam';
+
+ if ( action ) {
+ id = wpListsData.replace(/.*?comment-([0-9]+).*/, '$1');
+ el = $('#comment-' + id);
+ note = $('#' + action + '-undo-holder').html();
+
+ el.find('.check-column :checkbox').prop('checked', false); // Uncheck the row so as not to be affected by Bulk Edits.
+
+ if ( el.siblings('#replyrow').length && commentReply.cid == id )
+ commentReply.close();
+
+ if ( el.is('tr') ) {
+ n = el.children(':visible').length;
+ author = $('.author strong', el).text();
+ h = $('<tr id="undo-' + id + '" class="undo un' + action + '" style="display:none;"><td colspan="' + n + '">' + note + '</td></tr>');
+ } else {
+ author = $('.comment-author', el).text();
+ h = $('<div id="undo-' + id + '" style="display:none;" class="undo un' + action + '">' + note + '</div>');
+ }
+
+ el.before(h);
+
+ $('strong', '#undo-' + id).text(author);
+ a = $('.undo a', '#undo-' + id);
+ a.attr('href', 'comment.php?action=un' + action + 'comment&c=' + id + '&_wpnonce=' + settings.data._ajax_nonce);
+ a.attr('data-wp-lists', 'delete:the-comment-list:comment-' + id + '::un' + action + '=1');
+ a.attr('class', 'vim-z vim-destructive aria-button-if-js');
+ $('.avatar', el).first().clone().prependTo('#undo-' + id + ' .' + action + '-undo-inside');
+
+ a.click(function( e ){
+ e.preventDefault();
+ e.stopPropagation(); // ticket #35904
+ list.wpList.del(this);
+ $('#undo-' + id).css( {backgroundColor:'#ceb'} ).fadeOut(350, function(){
+ $(this).remove();
+ $('#comment-' + id).css('backgroundColor', '').fadeIn(300, function(){ $(this).show(); });
+ });
+ });
+ }
+
+ return settings;
+ };
+
+ // In admin-ajax.php, we send back the unix time stamp instead of 1 on success
+ delAfter = function( r, settings ) {
+ var total_items_i18n, total, animated, animatedCallback,
+ response = true === settings.parsed ? {} : settings.parsed.responses[0],
+ commentStatus = true === settings.parsed ? '' : response.supplemental.status,
+ commentPostId = true === settings.parsed ? '' : response.supplemental.postId,
+ newTotal = true === settings.parsed ? '' : response.supplemental,
+
+ targetParent = $( settings.target ).parent(),
+ commentRow = $('#' + settings.element),
+
+ spamDiff, trashDiff, pendingDiff, approvedDiff,
+
+ /*
+ * As `wpList` toggles only the `unapproved` class, the approved comment
+ * rows can have both the `approved` and `unapproved` classes.
+ */
+ approved = commentRow.hasClass( 'approved' ) && ! commentRow.hasClass( 'unapproved' ),
+ unapproved = commentRow.hasClass( 'unapproved' ),
+ spammed = commentRow.hasClass( 'spam' ),
+ trashed = commentRow.hasClass( 'trash' ),
+ undoing = false; // ticket #35904
+
+ updateDashboardText( newTotal );
+ updateInModerationText( newTotal );
+
+ // the order of these checks is important
+ // .unspam can also have .approve or .unapprove
+ // .untrash can also have .approve or .unapprove
+
+ if ( targetParent.is( 'span.undo' ) ) {
+ // the comment was spammed
+ if ( targetParent.hasClass( 'unspam' ) ) {
+ spamDiff = -1;
+
+ if ( 'trash' === commentStatus ) {
+ trashDiff = 1;
+ } else if ( '1' === commentStatus ) {
+ approvedDiff = 1;
+ } else if ( '0' === commentStatus ) {
+ pendingDiff = 1;
+ }
+
+ // the comment was trashed
+ } else if ( targetParent.hasClass( 'untrash' ) ) {
+ trashDiff = -1;
+
+ if ( 'spam' === commentStatus ) {
+ spamDiff = 1;
+ } else if ( '1' === commentStatus ) {
+ approvedDiff = 1;
+ } else if ( '0' === commentStatus ) {
+ pendingDiff = 1;
+ }
+ }
+
+ undoing = true;
+
+ // user clicked "Spam"
+ } else if ( targetParent.is( 'span.spam' ) ) {
+ // the comment is currently approved
+ if ( approved ) {
+ approvedDiff = -1;
+ // the comment is currently pending
+ } else if ( unapproved ) {
+ pendingDiff = -1;
+ // the comment was in the trash
+ } else if ( trashed ) {
+ trashDiff = -1;
+ }
+ // you can't spam an item on the spam screen
+ spamDiff = 1;
+
+ // user clicked "Unspam"
+ } else if ( targetParent.is( 'span.unspam' ) ) {
+ if ( approved ) {
+ pendingDiff = 1;
+ } else if ( unapproved ) {
+ approvedDiff = 1;
+ } else if ( trashed ) {
+ // the comment was previously approved
+ if ( targetParent.hasClass( 'approve' ) ) {
+ approvedDiff = 1;
+ // the comment was previously pending
+ } else if ( targetParent.hasClass( 'unapprove' ) ) {
+ pendingDiff = 1;
+ }
+ } else if ( spammed ) {
+ if ( targetParent.hasClass( 'approve' ) ) {
+ approvedDiff = 1;
+
+ } else if ( targetParent.hasClass( 'unapprove' ) ) {
+ pendingDiff = 1;
+ }
+ }
+ // you can Unspam an item on the spam screen
+ spamDiff = -1;
+
+ // user clicked "Trash"
+ } else if ( targetParent.is( 'span.trash' ) ) {
+ if ( approved ) {
+ approvedDiff = -1;
+ } else if ( unapproved ) {
+ pendingDiff = -1;
+ // the comment was in the spam queue
+ } else if ( spammed ) {
+ spamDiff = -1;
+ }
+ // you can't trash an item on the trash screen
+ trashDiff = 1;
+
+ // user clicked "Restore"
+ } else if ( targetParent.is( 'span.untrash' ) ) {
+ if ( approved ) {
+ pendingDiff = 1;
+ } else if ( unapproved ) {
+ approvedDiff = 1;
+ } else if ( trashed ) {
+ if ( targetParent.hasClass( 'approve' ) ) {
+ approvedDiff = 1;
+ } else if ( targetParent.hasClass( 'unapprove' ) ) {
+ pendingDiff = 1;
+ }
+ }
+ // you can't go from trash to spam
+ // you can untrash on the trash screen
+ trashDiff = -1;
+
+ // User clicked "Approve"
+ } else if ( targetParent.is( 'span.approve:not(.unspam):not(.untrash)' ) ) {
+ approvedDiff = 1;
+ pendingDiff = -1;
+
+ // User clicked "Unapprove"
+ } else if ( targetParent.is( 'span.unapprove:not(.unspam):not(.untrash)' ) ) {
+ approvedDiff = -1;
+ pendingDiff = 1;
+
+ // User clicked "Delete Permanently"
+ } else if ( targetParent.is( 'span.delete' ) ) {
+ if ( spammed ) {
+ spamDiff = -1;
+ } else if ( trashed ) {
+ trashDiff = -1;
+ }
+ }
+
+ if ( pendingDiff ) {
+ updatePending( pendingDiff, commentPostId );
+ updateCountText( 'span.all-count', pendingDiff );
+ }
+
+ if ( approvedDiff ) {
+ updateApproved( approvedDiff, commentPostId );
+ updateCountText( 'span.all-count', approvedDiff );
+ }
+
+ if ( spamDiff ) {
+ updateCountText( 'span.spam-count', spamDiff );
+ }
+
+ if ( trashDiff ) {
+ updateCountText( 'span.trash-count', trashDiff );
+ }
+
+ if (
+ ( ( 'trash' === settings.data.comment_status ) && !getCount( $( 'span.trash-count' ) ) ) ||
+ ( ( 'spam' === settings.data.comment_status ) && !getCount( $( 'span.spam-count' ) ) )
+ ) {
+ $( '#delete_all' ).hide();
+ }
+
+ if ( ! isDashboard ) {
+ total = totalInput.val() ? parseInt( totalInput.val(), 10 ) : 0;
+ if ( $(settings.target).parent().is('span.undo') )
+ total++;
+ else
+ total--;
+
+ if ( total < 0 )
+ total = 0;
+
+ if ( 'object' === typeof r ) {
+ if ( response.supplemental.total_items_i18n && lastConfidentTime < response.supplemental.time ) {
+ total_items_i18n = response.supplemental.total_items_i18n || '';
+ if ( total_items_i18n ) {
+ $('.displaying-num').text( total_items_i18n );
+ $('.total-pages').text( response.supplemental.total_pages_i18n );
+ $('.tablenav-pages').find('.next-page, .last-page').toggleClass('disabled', response.supplemental.total_pages == $('.current-page').val());
+ }
+ updateTotalCount( total, response.supplemental.time, true );
+ } else if ( response.supplemental.time ) {
+ updateTotalCount( total, response.supplemental.time, false );
+ }
+ } else {
+ updateTotalCount( total, r, false );
+ }
+ }
+
+ if ( ! theExtraList || theExtraList.length === 0 || theExtraList.children().length === 0 || undoing ) {
+ return;
+ }
+
+ theList.get(0).wpList.add( theExtraList.children( ':eq(0):not(.no-items)' ).remove().clone() );
+
+ refillTheExtraList();
+
+ animated = $( ':animated', '#the-comment-list' );
+ animatedCallback = function() {
+ if ( ! $( '#the-comment-list tr:visible' ).length ) {
+ theList.get(0).wpList.add( theExtraList.find( '.no-items' ).clone() );
+ }
+ };
+
+ if ( animated.length ) {
+ animated.promise().done( animatedCallback );
+ } else {
+ animatedCallback();
+ }
+ };
+
+ refillTheExtraList = function(ev) {
+ var args = $.query.get(), total_pages = $('.total-pages').text(), per_page = $('input[name="_per_page"]', '#comments-form').val();
+
+ if (! args.paged)
+ args.paged = 1;
+
+ if (args.paged > total_pages) {
+ return;
+ }
+
+ if (ev) {
+ theExtraList.empty();
+ args.number = Math.min(8, per_page); // see WP_Comments_List_Table::prepare_items() @ class-wp-comments-list-table.php
+ } else {
+ args.number = 1;
+ args.offset = Math.min(8, per_page) - 1; // fetch only the next item on the extra list
+ }
+
+ args.no_placeholder = true;
+
+ args.paged ++;
+
+ // $.query.get() needs some correction to be sent into an ajax request
+ if ( true === args.comment_type )
+ args.comment_type = '';
+
+ args = $.extend(args, {
+ 'action': 'fetch-list',
+ 'list_args': list_args,
+ '_ajax_fetch_list_nonce': $('#_ajax_fetch_list_nonce').val()
+ });
+
+ $.ajax({
+ url: ajaxurl,
+ global: false,
+ dataType: 'json',
+ data: args,
+ success: function(response) {
+ theExtraList.get(0).wpList.add( response.rows );
+ }
+ });
+ };
+
+ window.theExtraList = $('#the-extra-comment-list').wpList( { alt: '', delColor: 'none', addColor: 'none' } );
+ window.theList = $('#the-comment-list').wpList( { alt: '', delBefore: delBefore, dimAfter: dimAfter, delAfter: delAfter, addColor: 'none' } )
+ .bind('wpListDelEnd', function(e, s){
+ var wpListsData = $(s.target).attr('data-wp-lists'), id = s.element.replace(/[^0-9]+/g, '');
+
+ if ( wpListsData.indexOf(':trash=1') != -1 || wpListsData.indexOf(':spam=1') != -1 )
+ $('#undo-' + id).fadeIn(300, function(){ $(this).show(); });
+ });
+};
+
+window.commentReply = {
+ cid : '',
+ act : '',
+ originalContent : '',
+
+ init : function() {
+ var row = $('#replyrow');
+
+ $( '.cancel', row ).click( function() { return commentReply.revert(); } );
+ $( '.save', row ).click( function() { return commentReply.send(); } );
+ $( 'input#author-name, input#author-email, input#author-url', row ).keypress( function( e ) {
+ if ( e.which == 13 ) {
+ commentReply.send();
+ e.preventDefault();
+ return false;
+ }
+ });
+
+ // add events
+ $('#the-comment-list .column-comment > p').dblclick(function(){
+ commentReply.toggle($(this).parent());
+ });
+
+ $('#doaction, #doaction2, #post-query-submit').click(function(){
+ if ( $('#the-comment-list #replyrow').length > 0 )
+ commentReply.close();
+ });
+
+ this.comments_listing = $('#comments-form > input[name="comment_status"]').val() || '';
+ },
+
+ addEvents : function(r) {
+ r.each(function() {
+ $(this).find('.column-comment > p').dblclick(function(){
+ commentReply.toggle($(this).parent());
+ });
+ });
+ },
+
+ toggle : function(el) {
+ if ( 'none' !== $( el ).css( 'display' ) && ( $( '#replyrow' ).parent().is('#com-reply') || window.confirm( adminCommentsL10n.warnQuickEdit ) ) ) {
+ $( el ).find( 'a.vim-q' ).click();
+ }
+ },
+
+ revert : function() {
+
+ if ( $('#the-comment-list #replyrow').length < 1 )
+ return false;
+
+ $('#replyrow').fadeOut('fast', function(){
+ commentReply.close();
+ });
+ },
+
+ close : function() {
+ var commentRow = $(),
+ replyRow = $( '#replyrow' );
+
+ // replyrow is not showing?
+ if ( replyRow.parent().is( '#com-reply' ) ) {
+ return;
+ }
+
+ if ( this.cid ) {
+ commentRow = $( '#comment-' + this.cid );
+ }
+
+ /*
+ * When closing the Quick Edit form, show the comment row and move focus
+ * back to the Quick Edit button.
+ */
+ if ( 'edit-comment' === this.act ) {
+ commentRow.fadeIn( 300, function() {
+ commentRow
+ .show()
+ .find( '.vim-q' )
+ .attr( 'aria-expanded', 'false' )
+ .focus();
+ } ).css( 'backgroundColor', '' );
+ }
+
+ // When closing the Reply form, move focus back to the Reply button.
+ if ( 'replyto-comment' === this.act ) {
+ commentRow.find( '.vim-r' )
+ .attr( 'aria-expanded', 'false' )
+ .focus();
+ }
+
+ // reset the Quicktags buttons
+ if ( typeof QTags != 'undefined' )
+ QTags.closeAllTags('replycontent');
+
+ $('#add-new-comment').css('display', '');
+
+ replyRow.hide();
+ $( '#com-reply' ).append( replyRow );
+ $('#replycontent').css('height', '').val('');
+ $('#edithead input').val('');
+ $( '.notice-error', replyRow )
+ .addClass( 'hidden' )
+ .find( '.error' ).empty();
+ $( '.spinner', replyRow ).removeClass( 'is-active' );
+
+ this.cid = '';
+ this.originalContent = '';
+ },
+
+ open : function(comment_id, post_id, action) {
+ var editRow, rowData, act, replyButton, editHeight,
+ t = this,
+ c = $('#comment-' + comment_id),
+ h = c.height(),
+ colspanVal = 0;
+
+ if ( ! this.discardCommentChanges() ) {
+ return false;
+ }
+
+ t.close();
+ t.cid = comment_id;
+
+ editRow = $('#replyrow');
+ rowData = $('#inline-'+comment_id);
+ action = action || 'replyto';
+ act = 'edit' == action ? 'edit' : 'replyto';
+ act = t.act = act + '-comment';
+ t.originalContent = $('textarea.comment', rowData).val();
+ colspanVal = $( '> th:visible, > td:visible', c ).length;
+
+ // Make sure it's actually a table and there's a `colspan` value to apply.
+ if ( editRow.hasClass( 'inline-edit-row' ) && 0 !== colspanVal ) {
+ $( 'td', editRow ).attr( 'colspan', colspanVal );
+ }
+
+ $('#action', editRow).val(act);
+ $('#comment_post_ID', editRow).val(post_id);
+ $('#comment_ID', editRow).val(comment_id);
+
+ if ( action == 'edit' ) {
+ $( '#author-name', editRow ).val( $( 'div.author', rowData ).text() );
+ $('#author-email', editRow).val( $('div.author-email', rowData).text() );
+ $('#author-url', editRow).val( $('div.author-url', rowData).text() );
+ $('#status', editRow).val( $('div.comment_status', rowData).text() );
+ $('#replycontent', editRow).val( $('textarea.comment', rowData).val() );
+ $( '#edithead, #editlegend, #savebtn', editRow ).show();
+ $('#replyhead, #replybtn, #addhead, #addbtn', editRow).hide();
+
+ if ( h > 120 ) {
+ // Limit the maximum height when editing very long comments to make it more manageable.
+ // The textarea is resizable in most browsers, so the user can adjust it if needed.
+ editHeight = h > 500 ? 500 : h;
+ $('#replycontent', editRow).css('height', editHeight + 'px');
+ }
+
+ c.after( editRow ).fadeOut('fast', function(){
+ $('#replyrow').fadeIn(300, function(){ $(this).show(); });
+ });
+ } else if ( action == 'add' ) {
+ $('#addhead, #addbtn', editRow).show();
+ $( '#replyhead, #replybtn, #edithead, #editlegend, #savebtn', editRow ) .hide();
+ $('#the-comment-list').prepend(editRow);
+ $('#replyrow').fadeIn(300);
+ } else {
+ replyButton = $('#replybtn', editRow);
+ $( '#edithead, #editlegend, #savebtn, #addhead, #addbtn', editRow ).hide();
+ $('#replyhead, #replybtn', editRow).show();
+ c.after(editRow);
+
+ if ( c.hasClass('unapproved') ) {
+ replyButton.text(adminCommentsL10n.replyApprove);
+ } else {
+ replyButton.text(adminCommentsL10n.reply);
+ }
+
+ $('#replyrow').fadeIn(300, function(){ $(this).show(); });
+ }
+
+ setTimeout(function() {
+ var rtop, rbottom, scrollTop, vp, scrollBottom;
+
+ rtop = $('#replyrow').offset().top;
+ rbottom = rtop + $('#replyrow').height();
+ scrollTop = window.pageYOffset || document.documentElement.scrollTop;
+ vp = document.documentElement.clientHeight || window.innerHeight || 0;
+ scrollBottom = scrollTop + vp;
+
+ if ( scrollBottom - 20 < rbottom )
+ window.scroll(0, rbottom - vp + 35);
+ else if ( rtop - 20 < scrollTop )
+ window.scroll(0, rtop - 35);
+
+ $('#replycontent').focus().keyup(function(e){
+ if ( e.which == 27 )
+ commentReply.revert(); // close on Escape
+ });
+ }, 600);
+
+ return false;
+ },
+
+ send : function() {
+ var post = {},
+ $errorNotice = $( '#replysubmit .error-notice' );
+
+ $errorNotice.addClass( 'hidden' );
+ $( '#replysubmit .spinner' ).addClass( 'is-active' );
+
+ $('#replyrow input').not(':button').each(function() {
+ var t = $(this);
+ post[ t.attr('name') ] = t.val();
+ });
+
+ post.content = $('#replycontent').val();
+ post.id = post.comment_post_ID;
+ post.comments_listing = this.comments_listing;
+ post.p = $('[name="p"]').val();
+
+ if ( $('#comment-' + $('#comment_ID').val()).hasClass('unapproved') )
+ post.approve_parent = 1;
+
+ $.ajax({
+ type : 'POST',
+ url : ajaxurl,
+ data : post,
+ success : function(x) { commentReply.show(x); },
+ error : function(r) { commentReply.error(r); }
+ });
+ },
+
+ show : function(xml) {
+ var t = this, r, c, id, bg, pid;
+
+ if ( typeof(xml) == 'string' ) {
+ t.error({'responseText': xml});
+ return false;
+ }
+
+ r = wpAjax.parseAjaxResponse(xml);
+ if ( r.errors ) {
+ t.error({'responseText': wpAjax.broken});
+ return false;
+ }
+
+ t.revert();
+
+ r = r.responses[0];
+ id = '#comment-' + r.id;
+
+ if ( 'edit-comment' == t.act )
+ $(id).remove();
+
+ if ( r.supplemental.parent_approved ) {
+ pid = $('#comment-' + r.supplemental.parent_approved);
+ updatePending( -1, r.supplemental.parent_post_id );
+
+ if ( this.comments_listing == 'moderated' ) {
+ pid.animate( { 'backgroundColor':'#CCEEBB' }, 400, function(){
+ pid.fadeOut();
+ });
+ return;
+ }
+ }
+
+ if ( r.supplemental.i18n_comments_text ) {
+ updateDashboardText( r.supplemental );
+ updateInModerationText( r.supplemental );
+ updateApproved( 1, r.supplemental.parent_post_id );
+ updateCountText( 'span.all-count', 1 );
+ }
+
+ c = $.trim(r.data); // Trim leading whitespaces
+ $(c).hide();
+ $('#replyrow').after(c);
+
+ id = $(id);
+ t.addEvents(id);
+ bg = id.hasClass('unapproved') ? '#FFFFE0' : id.closest('.widefat, .postbox').css('backgroundColor');
+
+ id.animate( { 'backgroundColor':'#CCEEBB' }, 300 )
+ .animate( { 'backgroundColor': bg }, 300, function() {
+ if ( pid && pid.length ) {
+ pid.animate( { 'backgroundColor':'#CCEEBB' }, 300 )
+ .animate( { 'backgroundColor': bg }, 300 )
+ .removeClass('unapproved').addClass('approved')
+ .find('div.comment_status').html('1');
+ }
+ });
+
+ },
+
+ error : function(r) {
+ var er = r.statusText,
+ $errorNotice = $( '#replysubmit .notice-error' ),
+ $error = $errorNotice.find( '.error' );
+
+ $( '#replysubmit .spinner' ).removeClass( 'is-active' );
+
+ if ( r.responseText )
+ er = r.responseText.replace( /<.[^<>]*?>/g, '' );
+
+ if ( er ) {
+ $errorNotice.removeClass( 'hidden' );
+ $error.html( er );
+ }
+ },
+
+ addcomment: function(post_id) {
+ var t = this;
+
+ $('#add-new-comment').fadeOut(200, function(){
+ t.open(0, post_id, 'add');
+ $('table.comments-box').css('display', '');
+ $('#no-comments').remove();
+ });
+ },
+
+ /**
+ * Alert the user if they have unsaved changes on a comment that will be
+ * lost if they proceed.
+ *
+ * @returns {boolean}
+ */
+ discardCommentChanges: function() {
+ var editRow = $( '#replyrow' );
+
+ if ( this.originalContent === $( '#replycontent', editRow ).val() ) {
+ return true;
+ }
+
+ return window.confirm( adminCommentsL10n.warnCommentChanges );
+ }
+};
+
+$(document).ready(function(){
+ var make_hotkeys_redirect, edit_comment, toggle_all, make_bulk;
+
+ setCommentsList();
+ commentReply.init();
+
+ $(document).on( 'click', 'span.delete a.delete', function( e ) {
+ e.preventDefault();
+ });
+
+ if ( typeof $.table_hotkeys != 'undefined' ) {
+ make_hotkeys_redirect = function(which) {
+ return function() {
+ var first_last, l;
+
+ first_last = 'next' == which? 'first' : 'last';
+ l = $('.tablenav-pages .'+which+'-page:not(.disabled)');
+ if (l.length)
+ window.location = l[0].href.replace(/\&hotkeys_highlight_(first|last)=1/g, '')+'&hotkeys_highlight_'+first_last+'=1';
+ };
+ };
+
+ edit_comment = function(event, current_row) {
+ window.location = $('span.edit a', current_row).attr('href');
+ };
+
+ toggle_all = function() {
+ $('#cb-select-all-1').data( 'wp-toggle', 1 ).trigger( 'click' ).removeData( 'wp-toggle' );
+ };
+
+ make_bulk = function(value) {
+ return function() {
+ var scope = $('select[name="action"]');
+ $('option[value="' + value + '"]', scope).prop('selected', true);
+ $('#doaction').click();
+ };
+ };
+
+ $.table_hotkeys(
+ $('table.widefat'),
+ [
+ 'a', 'u', 's', 'd', 'r', 'q', 'z',
+ ['e', edit_comment],
+ ['shift+x', toggle_all],
+ ['shift+a', make_bulk('approve')],
+ ['shift+s', make_bulk('spam')],
+ ['shift+d', make_bulk('delete')],
+ ['shift+t', make_bulk('trash')],
+ ['shift+z', make_bulk('untrash')],
+ ['shift+u', make_bulk('unapprove')]
+ ],
+ {
+ highlight_first: adminCommentsL10n.hotkeys_highlight_first,
+ highlight_last: adminCommentsL10n.hotkeys_highlight_last,
+ prev_page_link_cb: make_hotkeys_redirect('prev'),
+ next_page_link_cb: make_hotkeys_redirect('next'),
+ hotkeys_opts: {
+ disableInInput: true,
+ type: 'keypress',
+ noDisable: '.check-column input[type="checkbox"]'
+ },
+ cycle_expr: '#the-comment-list tr',
+ start_row_index: 0
+ }
+ );
+ }
+
+ // Quick Edit and Reply have an inline comment editor.
+ $( '#the-comment-list' ).on( 'click', '.comment-inline', function() {
+ var $el = $( this ),
+ action = 'replyto';
+
+ if ( 'undefined' !== typeof $el.data( 'action' ) ) {
+ action = $el.data( 'action' );
+ }
+
+ $( this ).attr( 'aria-expanded', 'true' );
+ commentReply.open( $el.data( 'commentId' ), $el.data( 'postId' ), action );
+ } );
+});
+
+})(jQuery);
diff --git a/www/crm/wp-admin/js/edit-comments.min.js b/www/crm/wp-admin/js/edit-comments.min.js
new file mode 100644
index 00000000..b4bade3b
--- /dev/null
+++ b/www/crm/wp-admin/js/edit-comments.min.js
@@ -0,0 +1 @@
+!function(a){var b,c,d,e,f,g,h,i,j,k,l=document.title,m=a("#dashboard_right_now").length;b=function(a){var b=parseInt(a.html().replace(/[^0-9]+/g,""),10);return isNaN(b)?0:b},c=function(a,b){var c="";if(!isNaN(b)){if(b=b<1?"0":b.toString(),b.length>3){for(;b.length>3;)c=thousandsSeparator+b.substr(b.length-3)+c,b=b.substr(0,b.length-3);b+=c}a.html(b)}},f=function(e,f){var g,h,i=".post-com-count-"+f,j="comment-count-no-comments",k="comment-count-approved";d("span.approved-count",e),f&&(g=a("span."+k,i),h=a("span."+j,i),g.each(function(){var d=a(this),f=b(d)+e;f<1&&(f=0),0===f?d.removeClass(k).addClass(j):d.addClass(k).removeClass(j),c(d,f)}),h.each(function(){var b=a(this);e>0?b.removeClass(j).addClass(k):b.addClass(j).removeClass(k),c(b,e)}))},d=function(d,e){a(d).each(function(){var d=a(this),f=b(d)+e;f<1&&(f=0),c(d,f)})},h=function(b){m&&b&&b.i18n_comments_text&&a(".comment-count a","#dashboard_right_now").text(b.i18n_comments_text)},i=function(b){b&&b.i18n_moderation_text&&(a(".comments-in-moderation-text").text(b.i18n_moderation_text),m&&b.in_moderation&&a(".comment-mod-count","#dashboard_right_now")[b.in_moderation>0?"removeClass":"addClass"]("hidden"))},g=function(d){var e,f,g,h;k=k||new RegExp(adminCommentsL10n.docTitleCommentsCount.replace("%s","\\([0-9"+thousandsSeparator+"]+\\)")+"?"),j=j||a("<div />"),e=l,h=k.exec(document.title),h?(h=h[0],j.html(h),g=b(j)+d):(j.html(0),g=d),g>=1?(c(j,g),f=k.exec(document.title),f&&(e=document.title.replace(f[0],adminCommentsL10n.docTitleCommentsCount.replace("%s",j.text())+" "))):(f=k.exec(e),f&&(e=e.replace(f[0],adminCommentsL10n.docTitleComments))),document.title=e},e=function(d,e){var f,h,i=".post-com-count-"+e,j="comment-count-no-pending",k="post-com-count-no-pending",l="comment-count-pending";m||g(d),a("span.pending-count").each(function(){var e=a(this),f=b(e)+d;f<1&&(f=0),e.closest(".awaiting-mod")[0===f?"addClass":"removeClass"]("count-0"),c(e,f)}),e&&(f=a("span."+l,i),h=a("span."+j,i),f.each(function(){var e=a(this),f=b(e)+d;f<1&&(f=0),0===f?(e.parent().addClass(k),e.removeClass(l).addClass(j)):(e.parent().removeClass(k),e.addClass(l).removeClass(j)),c(e,f)}),h.each(function(){var b=a(this);d>0?(b.parent().removeClass(k),b.removeClass(j).addClass(l)):(b.parent().addClass(k),b.addClass(j).removeClass(l)),c(b,d)}))},window.setCommentsList=function(){var c,g,j,k,l,n,o,p,q,r=0;c=a('input[name="_total"]',"#comments-form"),g=a('input[name="_per_page"]',"#comments-form"),j=a('input[name="_page"]',"#comments-form"),n=function(a,b,d){b<r||(d&&(r=b),c.val(a.toString()))},k=function(b,c){var d,g,j,k,l=a("#"+c.element);!0!==c.parsed&&(k=c.parsed.responses[0]),d=a("#replyrow"),g=a("#comment_ID",d).val(),j=a("#replybtn",d),l.is(".unapproved")?(c.data.id==g&&j.text(adminCommentsL10n.replyApprove),l.find(".row-actions span.view").addClass("hidden").end().find("div.comment_status").html("0")):(c.data.id==g&&j.text(adminCommentsL10n.reply),l.find(".row-actions span.view").removeClass("hidden").end().find("div.comment_status").html("1")),q=a("#"+c.element).is("."+c.dimClass)?1:-1,k?(h(k.supplemental),i(k.supplemental),e(q,k.supplemental.postId),f(-1*q,k.supplemental.postId)):(e(q),f(-1*q))},l=function(b,d){var e,f,h,i,k,l,m,n=!1,o=a(b.target).attr("data-wp-lists");return b.data._total=c.val()||0,b.data._per_page=g.val()||0,b.data._page=j.val()||0,b.data._url=document.location.href,b.data.comment_status=a('input[name="comment_status"]',"#comments-form").val(),o.indexOf(":trash=1")!=-1?n="trash":o.indexOf(":spam=1")!=-1&&(n="spam"),n&&(f=o.replace(/.*?comment-([0-9]+).*/,"$1"),h=a("#comment-"+f),e=a("#"+n+"-undo-holder").html(),h.find(".check-column :checkbox").prop("checked",!1),h.siblings("#replyrow").length&&commentReply.cid==f&&commentReply.close(),h.is("tr")?(i=h.children(":visible").length,m=a(".author strong",h).text(),k=a('<tr id="undo-'+f+'" class="undo un'+n+'" style="display:none;"><td colspan="'+i+'">'+e+"</td></tr>")):(m=a(".comment-author",h).text(),k=a('<div id="undo-'+f+'" style="display:none;" class="undo un'+n+'">'+e+"</div>")),h.before(k),a("strong","#undo-"+f).text(m),l=a(".undo a","#undo-"+f),l.attr("href","comment.php?action=un"+n+"comment&c="+f+"&_wpnonce="+b.data._ajax_nonce),l.attr("data-wp-lists","delete:the-comment-list:comment-"+f+"::un"+n+"=1"),l.attr("class","vim-z vim-destructive aria-button-if-js"),a(".avatar",h).first().clone().prependTo("#undo-"+f+" ."+n+"-undo-inside"),l.click(function(b){b.preventDefault(),b.stopPropagation(),d.wpList.del(this),a("#undo-"+f).css({backgroundColor:"#ceb"}).fadeOut(350,function(){a(this).remove(),a("#comment-"+f).css("backgroundColor","").fadeIn(300,function(){a(this).show()})})})),b},o=function(g,j){var k,l,o,q,s,t,u,v,w=!0===j.parsed?{}:j.parsed.responses[0],x=!0===j.parsed?"":w.supplemental.status,y=!0===j.parsed?"":w.supplemental.postId,z=!0===j.parsed?"":w.supplemental,A=a(j.target).parent(),B=a("#"+j.element),C=B.hasClass("approved")&&!B.hasClass("unapproved"),D=B.hasClass("unapproved"),E=B.hasClass("spam"),F=B.hasClass("trash"),G=!1;h(z),i(z),A.is("span.undo")?(A.hasClass("unspam")?(s=-1,"trash"===x?t=1:"1"===x?v=1:"0"===x&&(u=1)):A.hasClass("untrash")&&(t=-1,"spam"===x?s=1:"1"===x?v=1:"0"===x&&(u=1)),G=!0):A.is("span.spam")?(C?v=-1:D?u=-1:F&&(t=-1),s=1):A.is("span.unspam")?(C?u=1:D?v=1:F?A.hasClass("approve")?v=1:A.hasClass("unapprove")&&(u=1):E&&(A.hasClass("approve")?v=1:A.hasClass("unapprove")&&(u=1)),s=-1):A.is("span.trash")?(C?v=-1:D?u=-1:E&&(s=-1),t=1):A.is("span.untrash")?(C?u=1:D?v=1:F&&(A.hasClass("approve")?v=1:A.hasClass("unapprove")&&(u=1)),t=-1):A.is("span.approve:not(.unspam):not(.untrash)")?(v=1,u=-1):A.is("span.unapprove:not(.unspam):not(.untrash)")?(v=-1,u=1):A.is("span.delete")&&(E?s=-1:F&&(t=-1)),u&&(e(u,y),d("span.all-count",u)),v&&(f(v,y),d("span.all-count",v)),s&&d("span.spam-count",s),t&&d("span.trash-count",t),("trash"===j.data.comment_status&&!b(a("span.trash-count"))||"spam"===j.data.comment_status&&!b(a("span.spam-count")))&&a("#delete_all").hide(),m||(l=c.val()?parseInt(c.val(),10):0,a(j.target).parent().is("span.undo")?l++:l--,l<0&&(l=0),"object"==typeof g?w.supplemental.total_items_i18n&&r<w.supplemental.time?(k=w.supplemental.total_items_i18n||"",k&&(a(".displaying-num").text(k),a(".total-pages").text(w.supplemental.total_pages_i18n),a(".tablenav-pages").find(".next-page, .last-page").toggleClass("disabled",w.supplemental.total_pages==a(".current-page").val())),n(l,w.supplemental.time,!0)):w.supplemental.time&&n(l,w.supplemental.time,!1):n(l,g,!1)),theExtraList&&0!==theExtraList.length&&0!==theExtraList.children().length&&!G&&(theList.get(0).wpList.add(theExtraList.children(":eq(0):not(.no-items)").remove().clone()),p(),o=a(":animated","#the-comment-list"),q=function(){a("#the-comment-list tr:visible").length||theList.get(0).wpList.add(theExtraList.find(".no-items").clone())},o.length?o.promise().done(q):q())},p=function(b){var c=a.query.get(),d=a(".total-pages").text(),e=a('input[name="_per_page"]',"#comments-form").val();c.paged||(c.paged=1),c.paged>d||(b?(theExtraList.empty(),c.number=Math.min(8,e)):(c.number=1,c.offset=Math.min(8,e)-1),c.no_placeholder=!0,c.paged++,!0===c.comment_type&&(c.comment_type=""),c=a.extend(c,{action:"fetch-list",list_args:list_args,_ajax_fetch_list_nonce:a("#_ajax_fetch_list_nonce").val()}),a.ajax({url:ajaxurl,global:!1,dataType:"json",data:c,success:function(a){theExtraList.get(0).wpList.add(a.rows)}}))},window.theExtraList=a("#the-extra-comment-list").wpList({alt:"",delColor:"none",addColor:"none"}),window.theList=a("#the-comment-list").wpList({alt:"",delBefore:l,dimAfter:k,delAfter:o,addColor:"none"}).bind("wpListDelEnd",function(b,c){var d=a(c.target).attr("data-wp-lists"),e=c.element.replace(/[^0-9]+/g,"");d.indexOf(":trash=1")==-1&&d.indexOf(":spam=1")==-1||a("#undo-"+e).fadeIn(300,function(){a(this).show()})})},window.commentReply={cid:"",act:"",originalContent:"",init:function(){var b=a("#replyrow");a(".cancel",b).click(function(){return commentReply.revert()}),a(".save",b).click(function(){return commentReply.send()}),a("input#author-name, input#author-email, input#author-url",b).keypress(function(a){if(13==a.which)return commentReply.send(),a.preventDefault(),!1}),a("#the-comment-list .column-comment > p").dblclick(function(){commentReply.toggle(a(this).parent())}),a("#doaction, #doaction2, #post-query-submit").click(function(){a("#the-comment-list #replyrow").length>0&&commentReply.close()}),this.comments_listing=a('#comments-form > input[name="comment_status"]').val()||""},addEvents:function(b){b.each(function(){a(this).find(".column-comment > p").dblclick(function(){commentReply.toggle(a(this).parent())})})},toggle:function(b){"none"!==a(b).css("display")&&(a("#replyrow").parent().is("#com-reply")||window.confirm(adminCommentsL10n.warnQuickEdit))&&a(b).find("a.vim-q").click()},revert:function(){return!(a("#the-comment-list #replyrow").length<1)&&void a("#replyrow").fadeOut("fast",function(){commentReply.close()})},close:function(){var b=a(),c=a("#replyrow");c.parent().is("#com-reply")||(this.cid&&(b=a("#comment-"+this.cid)),"edit-comment"===this.act&&b.fadeIn(300,function(){b.show().find(".vim-q").attr("aria-expanded","false").focus()}).css("backgroundColor",""),"replyto-comment"===this.act&&b.find(".vim-r").attr("aria-expanded","false").focus(),"undefined"!=typeof QTags&&QTags.closeAllTags("replycontent"),a("#add-new-comment").css("display",""),c.hide(),a("#com-reply").append(c),a("#replycontent").css("height","").val(""),a("#edithead input").val(""),a(".notice-error",c).addClass("hidden").find(".error").empty(),a(".spinner",c).removeClass("is-active"),this.cid="",this.originalContent="")},open:function(b,c,d){var e,f,g,h,i,j=this,k=a("#comment-"+b),l=k.height(),m=0;return!!this.discardCommentChanges()&&(j.close(),j.cid=b,e=a("#replyrow"),f=a("#inline-"+b),d=d||"replyto",g="edit"==d?"edit":"replyto",g=j.act=g+"-comment",j.originalContent=a("textarea.comment",f).val(),m=a("> th:visible, > td:visible",k).length,e.hasClass("inline-edit-row")&&0!==m&&a("td",e).attr("colspan",m),a("#action",e).val(g),a("#comment_post_ID",e).val(c),a("#comment_ID",e).val(b),"edit"==d?(a("#author-name",e).val(a("div.author",f).text()),a("#author-email",e).val(a("div.author-email",f).text()),a("#author-url",e).val(a("div.author-url",f).text()),a("#status",e).val(a("div.comment_status",f).text()),a("#replycontent",e).val(a("textarea.comment",f).val()),a("#edithead, #editlegend, #savebtn",e).show(),a("#replyhead, #replybtn, #addhead, #addbtn",e).hide(),l>120&&(i=l>500?500:l,a("#replycontent",e).css("height",i+"px")),k.after(e).fadeOut("fast",function(){a("#replyrow").fadeIn(300,function(){a(this).show()})})):"add"==d?(a("#addhead, #addbtn",e).show(),a("#replyhead, #replybtn, #edithead, #editlegend, #savebtn",e).hide(),a("#the-comment-list").prepend(e),a("#replyrow").fadeIn(300)):(h=a("#replybtn",e),a("#edithead, #editlegend, #savebtn, #addhead, #addbtn",e).hide(),a("#replyhead, #replybtn",e).show(),k.after(e),k.hasClass("unapproved")?h.text(adminCommentsL10n.replyApprove):h.text(adminCommentsL10n.reply),a("#replyrow").fadeIn(300,function(){a(this).show()})),setTimeout(function(){var b,c,d,e,f;b=a("#replyrow").offset().top,c=b+a("#replyrow").height(),d=window.pageYOffset||document.documentElement.scrollTop,e=document.documentElement.clientHeight||window.innerHeight||0,f=d+e,f-20<c?window.scroll(0,c-e+35):b-20<d&&window.scroll(0,b-35),a("#replycontent").focus().keyup(function(a){27==a.which&&commentReply.revert()})},600),!1)},send:function(){var b={},c=a("#replysubmit .error-notice");c.addClass("hidden"),a("#replysubmit .spinner").addClass("is-active"),a("#replyrow input").not(":button").each(function(){var c=a(this);b[c.attr("name")]=c.val()}),b.content=a("#replycontent").val(),b.id=b.comment_post_ID,b.comments_listing=this.comments_listing,b.p=a('[name="p"]').val(),a("#comment-"+a("#comment_ID").val()).hasClass("unapproved")&&(b.approve_parent=1),a.ajax({type:"POST",url:ajaxurl,data:b,success:function(a){commentReply.show(a)},error:function(a){commentReply.error(a)}})},show:function(b){var c,g,j,k,l,m=this;return"string"==typeof b?(m.error({responseText:b}),!1):(c=wpAjax.parseAjaxResponse(b),c.errors?(m.error({responseText:wpAjax.broken}),!1):(m.revert(),c=c.responses[0],j="#comment-"+c.id,"edit-comment"==m.act&&a(j).remove(),c.supplemental.parent_approved&&(l=a("#comment-"+c.supplemental.parent_approved),e(-1,c.supplemental.parent_post_id),"moderated"==this.comments_listing)?void l.animate({backgroundColor:"#CCEEBB"},400,function(){l.fadeOut()}):(c.supplemental.i18n_comments_text&&(h(c.supplemental),i(c.supplemental),f(1,c.supplemental.parent_post_id),d("span.all-count",1)),g=a.trim(c.data),a(g).hide(),a("#replyrow").after(g),j=a(j),m.addEvents(j),k=j.hasClass("unapproved")?"#FFFFE0":j.closest(".widefat, .postbox").css("backgroundColor"),void j.animate({backgroundColor:"#CCEEBB"},300).animate({backgroundColor:k},300,function(){l&&l.length&&l.animate({backgroundColor:"#CCEEBB"},300).animate({backgroundColor:k},300).removeClass("unapproved").addClass("approved").find("div.comment_status").html("1")}))))},error:function(b){var c=b.statusText,d=a("#replysubmit .notice-error"),e=d.find(".error");a("#replysubmit .spinner").removeClass("is-active"),b.responseText&&(c=b.responseText.replace(/<.[^<>]*?>/g,"")),c&&(d.removeClass("hidden"),e.html(c))},addcomment:function(b){var c=this;a("#add-new-comment").fadeOut(200,function(){c.open(0,b,"add"),a("table.comments-box").css("display",""),a("#no-comments").remove()})},discardCommentChanges:function(){var b=a("#replyrow");return this.originalContent===a("#replycontent",b).val()||window.confirm(adminCommentsL10n.warnCommentChanges)}},a(document).ready(function(){var b,c,d,e;setCommentsList(),commentReply.init(),a(document).on("click","span.delete a.delete",function(a){a.preventDefault()}),"undefined"!=typeof a.table_hotkeys&&(b=function(b){return function(){var c,d;c="next"==b?"first":"last",d=a(".tablenav-pages ."+b+"-page:not(.disabled)"),d.length&&(window.location=d[0].href.replace(/\&hotkeys_highlight_(first|last)=1/g,"")+"&hotkeys_highlight_"+c+"=1")}},c=function(b,c){window.location=a("span.edit a",c).attr("href")},d=function(){a("#cb-select-all-1").data("wp-toggle",1).trigger("click").removeData("wp-toggle")},e=function(b){return function(){var c=a('select[name="action"]');a('option[value="'+b+'"]',c).prop("selected",!0),a("#doaction").click()}},a.table_hotkeys(a("table.widefat"),["a","u","s","d","r","q","z",["e",c],["shift+x",d],["shift+a",e("approve")],["shift+s",e("spam")],["shift+d",e("delete")],["shift+t",e("trash")],["shift+z",e("untrash")],["shift+u",e("unapprove")]],{highlight_first:adminCommentsL10n.hotkeys_highlight_first,highlight_last:adminCommentsL10n.hotkeys_highlight_last,prev_page_link_cb:b("prev"),next_page_link_cb:b("next"),hotkeys_opts:{disableInInput:!0,type:"keypress",noDisable:'.check-column input[type="checkbox"]'},cycle_expr:"#the-comment-list tr",start_row_index:0})),a("#the-comment-list").on("click",".comment-inline",function(){var b=a(this),c="replyto";"undefined"!=typeof b.data("action")&&(c=b.data("action")),a(this).attr("aria-expanded","true"),commentReply.open(b.data("commentId"),b.data("postId"),c)})})}(jQuery); \ No newline at end of file
diff --git a/www/crm/wp-admin/js/editor-expand.js b/www/crm/wp-admin/js/editor-expand.js
new file mode 100644
index 00000000..030193a3
--- /dev/null
+++ b/www/crm/wp-admin/js/editor-expand.js
@@ -0,0 +1,1616 @@
+/**
+ * @output wp-admin/js/editor-expand.js
+ */
+
+( function( window, $, undefined ) {
+ 'use strict';
+
+ var $window = $( window ),
+ $document = $( document ),
+ $adminBar = $( '#wpadminbar' ),
+ $footer = $( '#wpfooter' );
+
+ /**
+ * Handles the resizing of the editor.
+ *
+ * @since 4.0.0
+ *
+ * @returns {void}
+ */
+ $( function() {
+ var $wrap = $( '#postdivrich' ),
+ $contentWrap = $( '#wp-content-wrap' ),
+ $tools = $( '#wp-content-editor-tools' ),
+ $visualTop = $(),
+ $visualEditor = $(),
+ $textTop = $( '#ed_toolbar' ),
+ $textEditor = $( '#content' ),
+ textEditor = $textEditor[0],
+ oldTextLength = 0,
+ $bottom = $( '#post-status-info' ),
+ $menuBar = $(),
+ $statusBar = $(),
+ $sideSortables = $( '#side-sortables' ),
+ $postboxContainer = $( '#postbox-container-1' ),
+ $postBody = $('#post-body'),
+ fullscreen = window.wp.editor && window.wp.editor.fullscreen,
+ mceEditor,
+ mceBind = function(){},
+ mceUnbind = function(){},
+ fixedTop = false,
+ fixedBottom = false,
+ fixedSideTop = false,
+ fixedSideBottom = false,
+ scrollTimer,
+ lastScrollPosition = 0,
+ pageYOffsetAtTop = 130,
+ pinnedToolsTop = 56,
+ sidebarBottom = 20,
+ autoresizeMinHeight = 300,
+ initialMode = $contentWrap.hasClass( 'tmce-active' ) ? 'tinymce' : 'html',
+ advanced = !! parseInt( window.getUserSetting( 'hidetb' ), 10 ),
+ // These are corrected when adjust() runs, except on scrolling if already set.
+ heights = {
+ windowHeight: 0,
+ windowWidth: 0,
+ adminBarHeight: 0,
+ toolsHeight: 0,
+ menuBarHeight: 0,
+ visualTopHeight: 0,
+ textTopHeight: 0,
+ bottomHeight: 0,
+ statusBarHeight: 0,
+ sideSortablesHeight: 0
+ };
+
+ /**
+ * Resizes textarea based on scroll height and width.
+ *
+ * Doesn't shrink the editor size below the 300px auto resize minimum height.
+ *
+ * @since 4.6.1
+ *
+ * @returns {void}
+ */
+ var shrinkTextarea = window._.throttle( function() {
+ var x = window.scrollX || document.documentElement.scrollLeft;
+ var y = window.scrollY || document.documentElement.scrollTop;
+ var height = parseInt( textEditor.style.height, 10 );
+
+ textEditor.style.height = autoresizeMinHeight + 'px';
+
+ if ( textEditor.scrollHeight > autoresizeMinHeight ) {
+ textEditor.style.height = textEditor.scrollHeight + 'px';
+ }
+
+ if ( typeof x !== 'undefined' ) {
+ window.scrollTo( x, y );
+ }
+
+ if ( textEditor.scrollHeight < height ) {
+ adjust();
+ }
+ }, 300 );
+
+ /**
+ * Resizes the text editor depending on the old text length.
+ *
+ * If there is an mceEditor and it is hidden, it resizes the editor depending
+ * on the old text length. If the current length of the text is smaller than
+ * the old text length, it shrinks the text area. Otherwise it resizes the editor to
+ * the scroll height.
+ *
+ * @since 4.6.1
+ *
+ * @returns {void}
+ */
+ function textEditorResize() {
+ var length = textEditor.value.length;
+
+ if ( mceEditor && ! mceEditor.isHidden() ) {
+ return;
+ }
+
+ if ( ! mceEditor && initialMode === 'tinymce' ) {
+ return;
+ }
+
+ if ( length < oldTextLength ) {
+ shrinkTextarea();
+ } else if ( parseInt( textEditor.style.height, 10 ) < textEditor.scrollHeight ) {
+ textEditor.style.height = Math.ceil( textEditor.scrollHeight ) + 'px';
+ adjust();
+ }
+
+ oldTextLength = length;
+ }
+
+ /**
+ * Gets the height and widths of elements.
+ *
+ * Gets the heights of the window, the adminbar, the tools, the menu,
+ * the visualTop, the textTop, the bottom, the statusbar and sideSortables
+ * and stores these in the heights object. Defaults to 0.
+ * Gets the width of the window and stores this in the heights object.
+ *
+ * @since 4.0.0
+ *
+ * @returns {void}
+ */
+ function getHeights() {
+ var windowWidth = $window.width();
+
+ heights = {
+ windowHeight: $window.height(),
+ windowWidth: windowWidth,
+ adminBarHeight: ( windowWidth > 600 ? $adminBar.outerHeight() : 0 ),
+ toolsHeight: $tools.outerHeight() || 0,
+ menuBarHeight: $menuBar.outerHeight() || 0,
+ visualTopHeight: $visualTop.outerHeight() || 0,
+ textTopHeight: $textTop.outerHeight() || 0,
+ bottomHeight: $bottom.outerHeight() || 0,
+ statusBarHeight: $statusBar.outerHeight() || 0,
+ sideSortablesHeight: $sideSortables.height() || 0
+ };
+
+ // Adjust for hidden menubar.
+ if ( heights.menuBarHeight < 3 ) {
+ heights.menuBarHeight = 0;
+ }
+ }
+
+ // We need to wait for TinyMCE to initialize.
+ /**
+ * Binds all necessary functions for editor expand to the editor when the editor
+ * is initialized.
+ *
+ * @since 4.0.0
+ *
+ * @param {event} event The TinyMCE editor init event.
+ * @param {object} editor The editor to bind the vents on.
+ *
+ * @returns {void}
+ */
+ $document.on( 'tinymce-editor-init.editor-expand', function( event, editor ) {
+ // VK contains the type of key pressed. VK = virtual keyboard.
+ var VK = window.tinymce.util.VK,
+ /**
+ * Hides any float panel with a hover state. Additionally hides tooltips.
+ *
+ * @returns {void}
+ */
+ hideFloatPanels = _.debounce( function() {
+ ! $( '.mce-floatpanel:hover' ).length && window.tinymce.ui.FloatPanel.hideAll();
+ $( '.mce-tooltip' ).hide();
+ }, 1000, true );
+
+ // Make sure it's the main editor.
+ if ( editor.id !== 'content' ) {
+ return;
+ }
+
+ // Copy the editor instance.
+ mceEditor = editor;
+
+ // Set the minimum height to the initial viewport height.
+ editor.settings.autoresize_min_height = autoresizeMinHeight;
+
+ // Get the necessary UI elements.
+ $visualTop = $contentWrap.find( '.mce-toolbar-grp' );
+ $visualEditor = $contentWrap.find( '.mce-edit-area' );
+ $statusBar = $contentWrap.find( '.mce-statusbar' );
+ $menuBar = $contentWrap.find( '.mce-menubar' );
+
+ /**
+ * Gets the offset of the editor.
+ *
+ * @returns {Number|Boolean} Returns the offset of the editor
+ * or false if there is no offset height.
+ */
+ function mceGetCursorOffset() {
+ var node = editor.selection.getNode(),
+ range, view, offset;
+
+ /*
+ * If editor.wp.getView and the selection node from the editor selection
+ * are defined, use this as a view for the offset.
+ */
+ if ( editor.wp && editor.wp.getView && ( view = editor.wp.getView( node ) ) ) {
+ offset = view.getBoundingClientRect();
+ } else {
+ range = editor.selection.getRng();
+
+ // Try to get the offset from a range.
+ try {
+ offset = range.getClientRects()[0];
+ } catch( er ) {}
+
+ // Get the offset from the bounding client rectangle of the node.
+ if ( ! offset ) {
+ offset = node.getBoundingClientRect();
+ }
+ }
+
+ return offset.height ? offset : false;
+ }
+
+ /**
+ * Filters the special keys that should not be used for scrolling.
+ *
+ * @since 4.0.0
+ *
+ * @param {event} event The event to get the key code from.
+ *
+ * @returns {void}
+ */
+ function mceKeyup( event ) {
+ var key = event.keyCode;
+
+ // Bail on special keys. Key code 47 is a /
+ if ( key <= 47 && ! ( key === VK.SPACEBAR || key === VK.ENTER || key === VK.DELETE || key === VK.BACKSPACE || key === VK.UP || key === VK.LEFT || key === VK.DOWN || key === VK.UP ) ) {
+ return;
+ // OS keys, function keys, num lock, scroll lock. Key code 91-93 are OS keys. Key code 112-123 are F1 to F12. Key code 144 is num lock. Key code 145 is scroll lock.
+ } else if ( ( key >= 91 && key <= 93 ) || ( key >= 112 && key <= 123 ) || key === 144 || key === 145 ) {
+ return;
+ }
+
+ mceScroll( key );
+ }
+
+ /**
+ * Makes sure the cursor is always visible in the editor.
+ *
+ * Makes sure the cursor is kept between the toolbars of the editor and scrolls
+ * the window when the cursor moves out of the viewport to a wpview.
+ * Setting a buffer > 0 will prevent the browser default.
+ * Some browsers will scroll to the middle,
+ * others to the top/bottom of the *window* when moving the cursor out of the viewport.
+ *
+ * @since 4.1.0
+ *
+ * @param {string} key The key code of the pressed key.
+ *
+ * @returns {void}
+ */
+ function mceScroll( key ) {
+ var offset = mceGetCursorOffset(),
+ buffer = 50,
+ cursorTop, cursorBottom, editorTop, editorBottom;
+
+ // Don't scroll if there is no offset.
+ if ( ! offset ) {
+ return;
+ }
+
+ // Determine the cursorTop based on the offset and the top of the editor iframe.
+ cursorTop = offset.top + editor.iframeElement.getBoundingClientRect().top;
+
+ // Determine the cursorBottom based on the cursorTop and offset height.
+ cursorBottom = cursorTop + offset.height;
+
+ // Subtract the buffer from the cursorTop.
+ cursorTop = cursorTop - buffer;
+
+ // Add the buffer to the cursorBottom.
+ cursorBottom = cursorBottom + buffer;
+ editorTop = heights.adminBarHeight + heights.toolsHeight + heights.menuBarHeight + heights.visualTopHeight;
+
+ /*
+ * Set the editorBottom based on the window Height, and add the bottomHeight and statusBarHeight if the
+ * advanced editor is enabled.
+ */
+ editorBottom = heights.windowHeight - ( advanced ? heights.bottomHeight + heights.statusBarHeight : 0 );
+
+ // Don't scroll if the node is taller than the visible part of the editor.
+ if ( editorBottom - editorTop < offset.height ) {
+ return;
+ }
+
+ /*
+ * If the cursorTop is smaller than the editorTop and the up, left
+ * or backspace key is pressed, scroll the editor to the position defined
+ * by the cursorTop, pageYOffset and editorTop.
+ */
+ if ( cursorTop < editorTop && ( key === VK.UP || key === VK.LEFT || key === VK.BACKSPACE ) ) {
+ window.scrollTo( window.pageXOffset, cursorTop + window.pageYOffset - editorTop );
+
+ /*
+ * If any other key is pressed or the cursorTop is bigger than the editorTop,
+ * scroll the editor to the position defined by the cursorBottom,
+ * pageYOffset and editorBottom.
+ */
+ } else if ( cursorBottom > editorBottom ) {
+ window.scrollTo( window.pageXOffset, cursorBottom + window.pageYOffset - editorBottom );
+ }
+ }
+
+ /**
+ * If the editor is fullscreen, calls adjust.
+ *
+ * @since 4.1.0
+ *
+ * @param {event} event The FullscreenStateChanged event.
+ *
+ * @returns {void}
+ */
+ function mceFullscreenToggled( event ) {
+ // event.state is true if the editor is fullscreen.
+ if ( ! event.state ) {
+ adjust();
+ }
+ }
+
+ /**
+ * Shows the editor when scrolled.
+ *
+ * Binds the hideFloatPanels function on the window scroll.mce-float-panels event.
+ * Executes the wpAutoResize on the active editor.
+ *
+ * @since 4.0.0
+ *
+ * @returns {void}
+ */
+ function mceShow() {
+ $window.on( 'scroll.mce-float-panels', hideFloatPanels );
+
+ setTimeout( function() {
+ editor.execCommand( 'wpAutoResize' );
+ adjust();
+ }, 300 );
+ }
+
+ /**
+ * Resizes the editor.
+ *
+ * Removes all functions from the window scroll.mce-float-panels event.
+ * Resizes the text editor and scrolls to a position based on the pageXOffset and adminBarHeight.
+ *
+ * @since 4.0.0
+ *
+ * @returns {void}
+ */
+ function mceHide() {
+ $window.off( 'scroll.mce-float-panels' );
+
+ setTimeout( function() {
+ var top = $contentWrap.offset().top;
+
+ if ( window.pageYOffset > top ) {
+ window.scrollTo( window.pageXOffset, top - heights.adminBarHeight );
+ }
+
+ textEditorResize();
+ adjust();
+ }, 100 );
+
+ adjust();
+ }
+
+ /**
+ * Toggles advanced states.
+ *
+ * @since 4.1.0
+ *
+ * @returns {void}
+ */
+ function toggleAdvanced() {
+ advanced = ! advanced;
+ }
+
+ /**
+ * Binds events of the editor and window.
+ *
+ * @since 4.0.0
+ *
+ * @returns {void}
+ */
+ mceBind = function() {
+ editor.on( 'keyup', mceKeyup );
+ editor.on( 'show', mceShow );
+ editor.on( 'hide', mceHide );
+ editor.on( 'wp-toolbar-toggle', toggleAdvanced );
+
+ // Adjust when the editor resizes.
+ editor.on( 'setcontent wp-autoresize wp-toolbar-toggle', adjust );
+
+ // Don't hide the caret after undo/redo.
+ editor.on( 'undo redo', mceScroll );
+
+ // Adjust when exiting TinyMCE's fullscreen mode.
+ editor.on( 'FullscreenStateChanged', mceFullscreenToggled );
+
+ $window.off( 'scroll.mce-float-panels' ).on( 'scroll.mce-float-panels', hideFloatPanels );
+ };
+
+ /**
+ * Unbinds the events of the editor and window.
+ *
+ * @since 4.0.0
+ *
+ * @returns {void}
+ */
+ mceUnbind = function() {
+ editor.off( 'keyup', mceKeyup );
+ editor.off( 'show', mceShow );
+ editor.off( 'hide', mceHide );
+ editor.off( 'wp-toolbar-toggle', toggleAdvanced );
+ editor.off( 'setcontent wp-autoresize wp-toolbar-toggle', adjust );
+ editor.off( 'undo redo', mceScroll );
+ editor.off( 'FullscreenStateChanged', mceFullscreenToggled );
+
+ $window.off( 'scroll.mce-float-panels' );
+ };
+
+ if ( $wrap.hasClass( 'wp-editor-expand' ) ) {
+
+ // Adjust "immediately".
+ mceBind();
+ initialResize( adjust );
+ }
+ } );
+
+ /**
+ * Adjusts the toolbars heights and positions.
+ *
+ * Adjusts the toolbars heights and positions based on the scroll position on
+ * the page, the active editor mode and the heights of the editor, admin bar and
+ * side bar.
+ *
+ * @since 4.0.0
+ *
+ * @param {event} event The event that calls this function.
+ *
+ * @returns {void}
+ */
+ function adjust( event ) {
+
+ // Makes sure we're not in fullscreen mode.
+ if ( fullscreen && fullscreen.settings.visible ) {
+ return;
+ }
+
+ var windowPos = $window.scrollTop(),
+ type = event && event.type,
+ resize = type !== 'scroll',
+ visual = mceEditor && ! mceEditor.isHidden(),
+ buffer = autoresizeMinHeight,
+ postBodyTop = $postBody.offset().top,
+ borderWidth = 1,
+ contentWrapWidth = $contentWrap.width(),
+ $top, $editor, sidebarTop, footerTop, canPin,
+ topPos, topHeight, editorPos, editorHeight;
+
+ /*
+ * Refresh the heights if type isn't 'scroll'
+ * or heights.windowHeight isn't set.
+ */
+ if ( resize || ! heights.windowHeight ) {
+ getHeights();
+ }
+
+ // Resize on resize event when the editor is in text mode.
+ if ( ! visual && type === 'resize' ) {
+ textEditorResize();
+ }
+
+ if ( visual ) {
+ $top = $visualTop;
+ $editor = $visualEditor;
+ topHeight = heights.visualTopHeight;
+ } else {
+ $top = $textTop;
+ $editor = $textEditor;
+ topHeight = heights.textTopHeight;
+ }
+
+ // Return if TinyMCE is still initializing.
+ if ( ! visual && ! $top.length ) {
+ return;
+ }
+
+ topPos = $top.parent().offset().top;
+ editorPos = $editor.offset().top;
+ editorHeight = $editor.outerHeight();
+
+ /*
+ * If in visual mode, checks if the editorHeight is greater than the autoresizeMinHeight + topHeight.
+ * If not in visual mode, checks if the editorHeight is greater than the autoresizeMinHeight + 20.
+ */
+ canPin = visual ? autoresizeMinHeight + topHeight : autoresizeMinHeight + 20; // 20px from textarea padding
+ canPin = editorHeight > ( canPin + 5 );
+
+ if ( ! canPin ) {
+ if ( resize ) {
+ $tools.css( {
+ position: 'absolute',
+ top: 0,
+ width: contentWrapWidth
+ } );
+
+ if ( visual && $menuBar.length ) {
+ $menuBar.css( {
+ position: 'absolute',
+ top: 0,
+ width: contentWrapWidth - ( borderWidth * 2 )
+ } );
+ }
+
+ $top.css( {
+ position: 'absolute',
+ top: heights.menuBarHeight,
+ width: contentWrapWidth - ( borderWidth * 2 ) - ( visual ? 0 : ( $top.outerWidth() - $top.width() ) )
+ } );
+
+ $statusBar.attr( 'style', advanced ? '' : 'visibility: hidden;' );
+ $bottom.attr( 'style', '' );
+ }
+ } else {
+ // Check if the top is not already in a fixed position.
+ if ( ( ! fixedTop || resize ) &&
+ ( windowPos >= ( topPos - heights.toolsHeight - heights.adminBarHeight ) &&
+ windowPos <= ( topPos - heights.toolsHeight - heights.adminBarHeight + editorHeight - buffer ) ) ) {
+ fixedTop = true;
+
+ $tools.css( {
+ position: 'fixed',
+ top: heights.adminBarHeight,
+ width: contentWrapWidth
+ } );
+
+ if ( visual && $menuBar.length ) {
+ $menuBar.css( {
+ position: 'fixed',
+ top: heights.adminBarHeight + heights.toolsHeight,
+ width: contentWrapWidth - ( borderWidth * 2 ) - ( visual ? 0 : ( $top.outerWidth() - $top.width() ) )
+ } );
+ }
+
+ $top.css( {
+ position: 'fixed',
+ top: heights.adminBarHeight + heights.toolsHeight + heights.menuBarHeight,
+ width: contentWrapWidth - ( borderWidth * 2 ) - ( visual ? 0 : ( $top.outerWidth() - $top.width() ) )
+ } );
+ // Check if the top is already in a fixed position.
+ } else if ( fixedTop || resize ) {
+ if ( windowPos <= ( topPos - heights.toolsHeight - heights.adminBarHeight ) ) {
+ fixedTop = false;
+
+ $tools.css( {
+ position: 'absolute',
+ top: 0,
+ width: contentWrapWidth
+ } );
+
+ if ( visual && $menuBar.length ) {
+ $menuBar.css( {
+ position: 'absolute',
+ top: 0,
+ width: contentWrapWidth - ( borderWidth * 2 )
+ } );
+ }
+
+ $top.css( {
+ position: 'absolute',
+ top: heights.menuBarHeight,
+ width: contentWrapWidth - ( borderWidth * 2 ) - ( visual ? 0 : ( $top.outerWidth() - $top.width() ) )
+ } );
+ } else if ( windowPos >= ( topPos - heights.toolsHeight - heights.adminBarHeight + editorHeight - buffer ) ) {
+ fixedTop = false;
+
+ $tools.css( {
+ position: 'absolute',
+ top: editorHeight - buffer,
+ width: contentWrapWidth
+ } );
+
+ if ( visual && $menuBar.length ) {
+ $menuBar.css( {
+ position: 'absolute',
+ top: editorHeight - buffer,
+ width: contentWrapWidth - ( borderWidth * 2 )
+ } );
+ }
+
+ $top.css( {
+ position: 'absolute',
+ top: editorHeight - buffer + heights.menuBarHeight,
+ width: contentWrapWidth - ( borderWidth * 2 ) - ( visual ? 0 : ( $top.outerWidth() - $top.width() ) )
+ } );
+ }
+ }
+
+ // Check if the bottom is not already in a fixed position.
+ if ( ( ! fixedBottom || ( resize && advanced ) ) &&
+ // Add borderWidth for the border around the .wp-editor-container.
+ ( windowPos + heights.windowHeight ) <= ( editorPos + editorHeight + heights.bottomHeight + heights.statusBarHeight + borderWidth ) ) {
+
+ if ( event && event.deltaHeight > 0 && event.deltaHeight < 100 ) {
+ window.scrollBy( 0, event.deltaHeight );
+ } else if ( visual && advanced ) {
+ fixedBottom = true;
+
+ $statusBar.css( {
+ position: 'fixed',
+ bottom: heights.bottomHeight,
+ visibility: '',
+ width: contentWrapWidth - ( borderWidth * 2 )
+ } );
+
+ $bottom.css( {
+ position: 'fixed',
+ bottom: 0,
+ width: contentWrapWidth
+ } );
+ }
+ } else if ( ( ! advanced && fixedBottom ) ||
+ ( ( fixedBottom || resize ) &&
+ ( windowPos + heights.windowHeight ) > ( editorPos + editorHeight + heights.bottomHeight + heights.statusBarHeight - borderWidth ) ) ) {
+ fixedBottom = false;
+
+ $statusBar.attr( 'style', advanced ? '' : 'visibility: hidden;' );
+ $bottom.attr( 'style', '' );
+ }
+ }
+
+ // The postbox container is positioned with @media from CSS. Ensure it is pinned on the side.
+ if ( $postboxContainer.width() < 300 && heights.windowWidth > 600 &&
+
+ // Check if the sidebar is not taller than the document height.
+ $document.height() > ( $sideSortables.height() + postBodyTop + 120 ) &&
+
+ // Check if the editor is taller than the viewport.
+ heights.windowHeight < editorHeight ) {
+
+ if ( ( heights.sideSortablesHeight + pinnedToolsTop + sidebarBottom ) > heights.windowHeight || fixedSideTop || fixedSideBottom ) {
+
+ // Reset the sideSortables style when scrolling to the top.
+ if ( windowPos + pinnedToolsTop <= postBodyTop ) {
+ $sideSortables.attr( 'style', '' );
+ fixedSideTop = fixedSideBottom = false;
+ } else {
+
+ // When scrolling down.
+ if ( windowPos > lastScrollPosition ) {
+ if ( fixedSideTop ) {
+
+ // Let it scroll.
+ fixedSideTop = false;
+ sidebarTop = $sideSortables.offset().top - heights.adminBarHeight;
+ footerTop = $footer.offset().top;
+
+ // Don't get over the footer.
+ if ( footerTop < sidebarTop + heights.sideSortablesHeight + sidebarBottom ) {
+ sidebarTop = footerTop - heights.sideSortablesHeight - 12;
+ }
+
+ $sideSortables.css({
+ position: 'absolute',
+ top: sidebarTop,
+ bottom: ''
+ });
+ } else if ( ! fixedSideBottom && heights.sideSortablesHeight + $sideSortables.offset().top + sidebarBottom < windowPos + heights.windowHeight ) {
+ // Pin the bottom.
+ fixedSideBottom = true;
+
+ $sideSortables.css({
+ position: 'fixed',
+ top: 'auto',
+ bottom: sidebarBottom
+ });
+ }
+
+ // When scrolling up.
+ } else if ( windowPos < lastScrollPosition ) {
+ if ( fixedSideBottom ) {
+ // Let it scroll.
+ fixedSideBottom = false;
+ sidebarTop = $sideSortables.offset().top - sidebarBottom;
+ footerTop = $footer.offset().top;
+
+ // Don't get over the footer.
+ if ( footerTop < sidebarTop + heights.sideSortablesHeight + sidebarBottom ) {
+ sidebarTop = footerTop - heights.sideSortablesHeight - 12;
+ }
+
+ $sideSortables.css({
+ position: 'absolute',
+ top: sidebarTop,
+ bottom: ''
+ });
+ } else if ( ! fixedSideTop && $sideSortables.offset().top >= windowPos + pinnedToolsTop ) {
+ // Pin the top.
+ fixedSideTop = true;
+
+ $sideSortables.css({
+ position: 'fixed',
+ top: pinnedToolsTop,
+ bottom: ''
+ });
+ }
+ }
+ }
+ } else {
+ // If the sidebar container is smaller than the viewport, then pin/unpin the top when scrolling.
+ if ( windowPos >= ( postBodyTop - pinnedToolsTop ) ) {
+
+ $sideSortables.css( {
+ position: 'fixed',
+ top: pinnedToolsTop
+ } );
+ } else {
+ $sideSortables.attr( 'style', '' );
+ }
+
+ fixedSideTop = fixedSideBottom = false;
+ }
+
+ lastScrollPosition = windowPos;
+ } else {
+ $sideSortables.attr( 'style', '' );
+ fixedSideTop = fixedSideBottom = false;
+ }
+
+ if ( resize ) {
+ $contentWrap.css( {
+ paddingTop: heights.toolsHeight
+ } );
+
+ if ( visual ) {
+ $visualEditor.css( {
+ paddingTop: heights.visualTopHeight + heights.menuBarHeight
+ } );
+ } else {
+ $textEditor.css( {
+ marginTop: heights.textTopHeight
+ } );
+ }
+ }
+ }
+
+ /**
+ * Resizes the editor and adjusts the toolbars.
+ *
+ * @since 4.0.0
+ *
+ * @returns {void}
+ */
+ function fullscreenHide() {
+ textEditorResize();
+ adjust();
+ }
+
+ /**
+ * Runs the passed function with 500ms intervals.
+ *
+ * @since 4.0.0
+ *
+ * @param {function} callback The function to run in the timeout.
+ *
+ * @returns {void}
+ */
+ function initialResize( callback ) {
+ for ( var i = 1; i < 6; i++ ) {
+ setTimeout( callback, 500 * i );
+ }
+ }
+
+ /**
+ * Runs adjust after 100ms.
+ *
+ * @since 4.0.0
+ *
+ * @returns {void}
+ */
+ function afterScroll() {
+ clearTimeout( scrollTimer );
+ scrollTimer = setTimeout( adjust, 100 );
+ }
+
+ /**
+ * Binds editor expand events on elements.
+ *
+ * @since 4.0.0
+ *
+ * @returns {void}
+ */
+ function on() {
+ /*
+ * Scroll to the top when triggering this from JS.
+ * Ensure the toolbars are pinned properly.
+ */
+ if ( window.pageYOffset && window.pageYOffset > pageYOffsetAtTop ) {
+ window.scrollTo( window.pageXOffset, 0 );
+ }
+
+ $wrap.addClass( 'wp-editor-expand' );
+
+ // Adjust when the window is scrolled or resized.
+ $window.on( 'scroll.editor-expand resize.editor-expand', function( event ) {
+ adjust( event.type );
+ afterScroll();
+ } );
+
+ /*
+ * Adjust when collapsing the menu, changing the columns
+ * or changing the body class.
+ */
+ $document.on( 'wp-collapse-menu.editor-expand postboxes-columnchange.editor-expand editor-classchange.editor-expand', adjust )
+ .on( 'postbox-toggled.editor-expand postbox-moved.editor-expand', function() {
+ if ( ! fixedSideTop && ! fixedSideBottom && window.pageYOffset > pinnedToolsTop ) {
+ fixedSideBottom = true;
+ window.scrollBy( 0, -1 );
+ adjust();
+ window.scrollBy( 0, 1 );
+ }
+
+ adjust();
+ }).on( 'wp-window-resized.editor-expand', function() {
+ if ( mceEditor && ! mceEditor.isHidden() ) {
+ mceEditor.execCommand( 'wpAutoResize' );
+ } else {
+ textEditorResize();
+ }
+ });
+
+ $textEditor.on( 'focus.editor-expand input.editor-expand propertychange.editor-expand', textEditorResize );
+ mceBind();
+
+ // Adjust when entering or exiting fullscreen mode.
+ fullscreen && fullscreen.pubsub.subscribe( 'hidden', fullscreenHide );
+
+ if ( mceEditor ) {
+ mceEditor.settings.wp_autoresize_on = true;
+ mceEditor.execCommand( 'wpAutoResizeOn' );
+
+ if ( ! mceEditor.isHidden() ) {
+ mceEditor.execCommand( 'wpAutoResize' );
+ }
+ }
+
+ if ( ! mceEditor || mceEditor.isHidden() ) {
+ textEditorResize();
+ }
+
+ adjust();
+
+ $document.trigger( 'editor-expand-on' );
+ }
+
+ /**
+ * Unbinds editor expand events.
+ *
+ * @since 4.0.0
+ *
+ * @returns {void}
+ */
+ function off() {
+ var height = parseInt( window.getUserSetting( 'ed_size', 300 ), 10 );
+
+ if ( height < 50 ) {
+ height = 50;
+ } else if ( height > 5000 ) {
+ height = 5000;
+ }
+
+ /*
+ * Scroll to the top when triggering this from JS.
+ * Ensure the toolbars are reset properly.
+ */
+ if ( window.pageYOffset && window.pageYOffset > pageYOffsetAtTop ) {
+ window.scrollTo( window.pageXOffset, 0 );
+ }
+
+ $wrap.removeClass( 'wp-editor-expand' );
+
+ $window.off( '.editor-expand' );
+ $document.off( '.editor-expand' );
+ $textEditor.off( '.editor-expand' );
+ mceUnbind();
+
+ // Adjust when entering or exiting fullscreen mode.
+ fullscreen && fullscreen.pubsub.unsubscribe( 'hidden', fullscreenHide );
+
+ // Reset all css
+ $.each( [ $visualTop, $textTop, $tools, $menuBar, $bottom, $statusBar, $contentWrap, $visualEditor, $textEditor, $sideSortables ], function( i, element ) {
+ element && element.attr( 'style', '' );
+ });
+
+ fixedTop = fixedBottom = fixedSideTop = fixedSideBottom = false;
+
+ if ( mceEditor ) {
+ mceEditor.settings.wp_autoresize_on = false;
+ mceEditor.execCommand( 'wpAutoResizeOff' );
+
+ if ( ! mceEditor.isHidden() ) {
+ $textEditor.hide();
+
+ if ( height ) {
+ mceEditor.theme.resizeTo( null, height );
+ }
+ }
+ }
+
+ // If there is a height found in the user setting.
+ if ( height ) {
+ $textEditor.height( height );
+ }
+
+ $document.trigger( 'editor-expand-off' );
+ }
+
+ // Start on load.
+ if ( $wrap.hasClass( 'wp-editor-expand' ) ) {
+ on();
+
+ // Resize just after CSS has fully loaded and QuickTags is ready.
+ if ( $contentWrap.hasClass( 'html-active' ) ) {
+ initialResize( function() {
+ adjust();
+ textEditorResize();
+ } );
+ }
+ }
+
+ // Show the on/off checkbox.
+ $( '#adv-settings .editor-expand' ).show();
+ $( '#editor-expand-toggle' ).on( 'change.editor-expand', function() {
+ if ( $(this).prop( 'checked' ) ) {
+ on();
+ window.setUserSetting( 'editor_expand', 'on' );
+ } else {
+ off();
+ window.setUserSetting( 'editor_expand', 'off' );
+ }
+ });
+
+ // Expose on() and off().
+ window.editorExpand = {
+ on: on,
+ off: off
+ };
+ } );
+
+ /**
+ * Handles the distraction free writing of TinyMCE.
+ *
+ * @since 4.1.0
+ *
+ * @returns {void}
+ */
+ $( function() {
+ var $body = $( document.body ),
+ $wrap = $( '#wpcontent' ),
+ $editor = $( '#post-body-content' ),
+ $title = $( '#title' ),
+ $content = $( '#content' ),
+ $overlay = $( document.createElement( 'DIV' ) ),
+ $slug = $( '#edit-slug-box' ),
+ $slugFocusEl = $slug.find( 'a' )
+ .add( $slug.find( 'button' ) )
+ .add( $slug.find( 'input' ) ),
+ $menuWrap = $( '#adminmenuwrap' ),
+ $editorWindow = $(),
+ $editorIframe = $(),
+ _isActive = window.getUserSetting( 'editor_expand', 'on' ) === 'on',
+ _isOn = _isActive ? window.getUserSetting( 'post_dfw' ) === 'on' : false,
+ traveledX = 0,
+ traveledY = 0,
+ buffer = 20,
+ faded, fadedAdminBar, fadedSlug,
+ editorRect, x, y, mouseY, scrollY,
+ focusLostTimer, overlayTimer, editorHasFocus;
+
+ $body.append( $overlay );
+
+ $overlay.css( {
+ display: 'none',
+ position: 'fixed',
+ top: $adminBar.height(),
+ right: 0,
+ bottom: 0,
+ left: 0,
+ 'z-index': 9997
+ } );
+
+ $editor.css( {
+ position: 'relative'
+ } );
+
+ $window.on( 'mousemove.focus', function( event ) {
+ mouseY = event.pageY;
+ } );
+
+ /**
+ * Recalculates the bottom and right position of the editor in the DOM.
+ *
+ * @since 4.1.0
+ *
+ * @returns {void}
+ */
+ function recalcEditorRect() {
+ editorRect = $editor.offset();
+ editorRect.right = editorRect.left + $editor.outerWidth();
+ editorRect.bottom = editorRect.top + $editor.outerHeight();
+ }
+
+ /**
+ * Activates the distraction free writing mode.
+ *
+ * @since 4.1.0
+ *
+ * @returns {void}
+ */
+ function activate() {
+ if ( ! _isActive ) {
+ _isActive = true;
+
+ $document.trigger( 'dfw-activate' );
+ $content.on( 'keydown.focus-shortcut', toggleViaKeyboard );
+ }
+ }
+
+ /**
+ * Deactivates the distraction free writing mode.
+ *
+ * @since 4.1.0
+ *
+ * @returns {void}
+ */
+ function deactivate() {
+ if ( _isActive ) {
+ off();
+
+ _isActive = false;
+
+ $document.trigger( 'dfw-deactivate' );
+ $content.off( 'keydown.focus-shortcut' );
+ }
+ }
+
+ /**
+ * Returns _isActive.
+ *
+ * @since 4.1.0
+ *
+ * @returns {boolean} Returns true is _isActive is true.
+ */
+ function isActive() {
+ return _isActive;
+ }
+
+ /**
+ * Binds events on the editor for distraction free writing.
+ *
+ * @since 4.1.0
+ *
+ * @returns {void}
+ */
+ function on() {
+ if ( ! _isOn && _isActive ) {
+ _isOn = true;
+
+ $content.on( 'keydown.focus', fadeOut );
+
+ $title.add( $content ).on( 'blur.focus', maybeFadeIn );
+
+ fadeOut();
+
+ window.setUserSetting( 'post_dfw', 'on' );
+
+ $document.trigger( 'dfw-on' );
+ }
+ }
+
+ /**
+ * Unbinds events on the editor for distraction free writing.
+ *
+ * @since 4.1.0
+ *
+ * @returns {void}
+ */
+ function off() {
+ if ( _isOn ) {
+ _isOn = false;
+
+ $title.add( $content ).off( '.focus' );
+
+ fadeIn();
+
+ $editor.off( '.focus' );
+
+ window.setUserSetting( 'post_dfw', 'off' );
+
+ $document.trigger( 'dfw-off' );
+ }
+ }
+
+ /**
+ * Binds or unbinds the editor expand events.
+ *
+ * @since 4.1.0
+ *
+ * @returns {void}
+ */
+ function toggle() {
+ if ( _isOn ) {
+ off();
+ } else {
+ on();
+ }
+ }
+
+ /**
+ * Returns the value of _isOn.
+ *
+ * @since 4.1.0
+ *
+ * @returns {boolean} Returns true if _isOn is true.
+ */
+ function isOn() {
+ return _isOn;
+ }
+
+ /**
+ * Fades out all elements except for the editor.
+ *
+ * The fading is done based on key presses and mouse movements.
+ * Also calls the fadeIn on certain key presses
+ * or if the mouse leaves the editor.
+ *
+ * @since 4.1.0
+ *
+ * @param event The event that triggers this function.
+ *
+ * @returns {void}
+ */
+ function fadeOut( event ) {
+ var isMac,
+ key = event && event.keyCode;
+
+ if ( window.navigator.platform ) {
+ isMac = ( window.navigator.platform.indexOf( 'Mac' ) > -1 );
+ }
+
+ // Fade in and returns on Escape and keyboard shortcut Alt+Shift+W and Ctrl+Opt+W.
+ if ( key === 27 || ( key === 87 && event.altKey && ( ( ! isMac && event.shiftKey ) || ( isMac && event.ctrlKey ) ) ) ) {
+ fadeIn( event );
+ return;
+ }
+
+ // Return if any of the following keys or combinations of keys is pressed.
+ if ( event && ( event.metaKey || ( event.ctrlKey && ! event.altKey ) || ( event.altKey && event.shiftKey ) || ( key && (
+ // Special keys ( tab, ctrl, alt, esc, arrow keys... )
+ ( key <= 47 && key !== 8 && key !== 13 && key !== 32 && key !== 46 ) ||
+ // Windows keys
+ ( key >= 91 && key <= 93 ) ||
+ // F keys
+ ( key >= 112 && key <= 135 ) ||
+ // Num Lock, Scroll Lock, OEM
+ ( key >= 144 && key <= 150 ) ||
+ // OEM or non-printable
+ key >= 224
+ ) ) ) ) {
+ return;
+ }
+
+ if ( ! faded ) {
+ faded = true;
+
+ clearTimeout( overlayTimer );
+
+ overlayTimer = setTimeout( function() {
+ $overlay.show();
+ }, 600 );
+
+ $editor.css( 'z-index', 9998 );
+
+ $overlay
+ // Always recalculate the editor area when entering the overlay with the mouse.
+ .on( 'mouseenter.focus', function() {
+ recalcEditorRect();
+
+ $window.on( 'scroll.focus', function() {
+ var nScrollY = window.pageYOffset;
+
+ if ( (
+ scrollY && mouseY &&
+ scrollY !== nScrollY
+ ) && (
+ mouseY < editorRect.top - buffer ||
+ mouseY > editorRect.bottom + buffer
+ ) ) {
+ fadeIn();
+ }
+
+ scrollY = nScrollY;
+ } );
+ } )
+ .on( 'mouseleave.focus', function() {
+ x = y = null;
+ traveledX = traveledY = 0;
+
+ $window.off( 'scroll.focus' );
+ } )
+ // Fade in when the mouse moves away form the editor area.
+ .on( 'mousemove.focus', function( event ) {
+ var nx = event.clientX,
+ ny = event.clientY,
+ pageYOffset = window.pageYOffset,
+ pageXOffset = window.pageXOffset;
+
+ if ( x && y && ( nx !== x || ny !== y ) ) {
+ if (
+ ( ny <= y && ny < editorRect.top - pageYOffset ) ||
+ ( ny >= y && ny > editorRect.bottom - pageYOffset ) ||
+ ( nx <= x && nx < editorRect.left - pageXOffset ) ||
+ ( nx >= x && nx > editorRect.right - pageXOffset )
+ ) {
+ traveledX += Math.abs( x - nx );
+ traveledY += Math.abs( y - ny );
+
+ if ( (
+ ny <= editorRect.top - buffer - pageYOffset ||
+ ny >= editorRect.bottom + buffer - pageYOffset ||
+ nx <= editorRect.left - buffer - pageXOffset ||
+ nx >= editorRect.right + buffer - pageXOffset
+ ) && (
+ traveledX > 10 ||
+ traveledY > 10
+ ) ) {
+ fadeIn();
+
+ x = y = null;
+ traveledX = traveledY = 0;
+
+ return;
+ }
+ } else {
+ traveledX = traveledY = 0;
+ }
+ }
+
+ x = nx;
+ y = ny;
+ } )
+
+ // When the overlay is touched, fade in and cancel the event.
+ .on( 'touchstart.focus', function( event ) {
+ event.preventDefault();
+ fadeIn();
+ } );
+
+ $editor.off( 'mouseenter.focus' );
+
+ if ( focusLostTimer ) {
+ clearTimeout( focusLostTimer );
+ focusLostTimer = null;
+ }
+
+ $body.addClass( 'focus-on' ).removeClass( 'focus-off' );
+ }
+
+ fadeOutAdminBar();
+ fadeOutSlug();
+ }
+
+ /**
+ * Fades all elements back in.
+ *
+ * @since 4.1.0
+ *
+ * @param event The event that triggers this function.
+ *
+ * @returns {void}
+ */
+ function fadeIn( event ) {
+ if ( faded ) {
+ faded = false;
+
+ clearTimeout( overlayTimer );
+
+ overlayTimer = setTimeout( function() {
+ $overlay.hide();
+ }, 200 );
+
+ $editor.css( 'z-index', '' );
+
+ $overlay.off( 'mouseenter.focus mouseleave.focus mousemove.focus touchstart.focus' );
+
+ /*
+ * When fading in, temporarily watch for refocus and fade back out - helps
+ * with 'accidental' editor exits with the mouse. When fading in and the event
+ * is a key event (Escape or Alt+Shift+W) don't watch for refocus.
+ */
+ if ( 'undefined' === typeof event ) {
+ $editor.on( 'mouseenter.focus', function() {
+ if ( $.contains( $editor.get( 0 ), document.activeElement ) || editorHasFocus ) {
+ fadeOut();
+ }
+ } );
+ }
+
+ focusLostTimer = setTimeout( function() {
+ focusLostTimer = null;
+ $editor.off( 'mouseenter.focus' );
+ }, 1000 );
+
+ $body.addClass( 'focus-off' ).removeClass( 'focus-on' );
+ }
+
+ fadeInAdminBar();
+ fadeInSlug();
+ }
+
+ /**
+ * Fades in if the focused element based on it position.
+ *
+ * @since 4.1.0
+ *
+ * @returns {void}
+ */
+ function maybeFadeIn() {
+ setTimeout( function() {
+ var position = document.activeElement.compareDocumentPosition( $editor.get( 0 ) );
+
+ function hasFocus( $el ) {
+ return $.contains( $el.get( 0 ), document.activeElement );
+ }
+
+ // The focused node is before or behind the editor area, and not outside the wrap.
+ if ( ( position === 2 || position === 4 ) && ( hasFocus( $menuWrap ) || hasFocus( $wrap ) || hasFocus( $footer ) ) ) {
+ fadeIn();
+ }
+ }, 0 );
+ }
+
+ /**
+ * Fades out the admin bar based on focus on the admin bar.
+ *
+ * @since 4.1.0
+ *
+ * @returns {void}
+ */
+ function fadeOutAdminBar() {
+ if ( ! fadedAdminBar && faded ) {
+ fadedAdminBar = true;
+
+ $adminBar
+ .on( 'mouseenter.focus', function() {
+ $adminBar.addClass( 'focus-off' );
+ } )
+ .on( 'mouseleave.focus', function() {
+ $adminBar.removeClass( 'focus-off' );
+ } );
+ }
+ }
+
+ /**
+ * Fades in the admin bar.
+ *
+ * @since 4.1.0
+ *
+ * @returns {void}
+ */
+ function fadeInAdminBar() {
+ if ( fadedAdminBar ) {
+ fadedAdminBar = false;
+
+ $adminBar.off( '.focus' );
+ }
+ }
+
+ /**
+ * Fades out the edit slug box.
+ *
+ * @since 4.1.0
+ *
+ * @returns {void}
+ */
+ function fadeOutSlug() {
+ if ( ! fadedSlug && faded && ! $slug.find( ':focus').length ) {
+ fadedSlug = true;
+
+ $slug.stop().fadeTo( 'fast', 0.3 ).on( 'mouseenter.focus', fadeInSlug ).off( 'mouseleave.focus' );
+
+ $slugFocusEl.on( 'focus.focus', fadeInSlug ).off( 'blur.focus' );
+ }
+ }
+
+ /**
+ * Fades in the edit slug box.
+ *
+ * @since 4.1.0
+ *
+ * @returns {void}
+ */
+ function fadeInSlug() {
+ if ( fadedSlug ) {
+ fadedSlug = false;
+
+ $slug.stop().fadeTo( 'fast', 1 ).on( 'mouseleave.focus', fadeOutSlug ).off( 'mouseenter.focus' );
+
+ $slugFocusEl.on( 'blur.focus', fadeOutSlug ).off( 'focus.focus' );
+ }
+ }
+
+ /**
+ * Triggers the toggle on Alt + Shift + W.
+ *
+ * Keycode 87 = w.
+ *
+ * @since 4.1.0
+ *
+ * @param {event} event The event to trigger the toggle.
+ *
+ * @returns {void}
+ */
+ function toggleViaKeyboard( event ) {
+ if ( event.altKey && event.shiftKey && 87 === event.keyCode ) {
+ toggle();
+ }
+ }
+
+ if ( $( '#postdivrich' ).hasClass( 'wp-editor-expand' ) ) {
+ $content.on( 'keydown.focus-shortcut', toggleViaKeyboard );
+ }
+
+ /**
+ * Adds the distraction free writing button when setting up TinyMCE.
+ *
+ * @since 4.1.0
+ *
+ * @param {event} event The TinyMCE editor setup event.
+ * @param {object} editor The editor to add the button to.
+ *
+ * @returns {void}
+ */
+ $document.on( 'tinymce-editor-setup.focus', function( event, editor ) {
+ editor.addButton( 'dfw', {
+ active: _isOn,
+ classes: 'wp-dfw btn widget',
+ disabled: ! _isActive,
+ onclick: toggle,
+ onPostRender: function() {
+ var button = this;
+
+ editor.on( 'init', function() {
+ if ( button.disabled() ) {
+ button.hide();
+ }
+ } );
+
+ $document
+ .on( 'dfw-activate.focus', function() {
+ button.disabled( false );
+ button.show();
+ } )
+ .on( 'dfw-deactivate.focus', function() {
+ button.disabled( true );
+ button.hide();
+ } )
+ .on( 'dfw-on.focus', function() {
+ button.active( true );
+ } )
+ .on( 'dfw-off.focus', function() {
+ button.active( false );
+ } );
+ },
+ tooltip: 'Distraction-free writing mode',
+ shortcut: 'Alt+Shift+W'
+ } );
+
+ editor.addCommand( 'wpToggleDFW', toggle );
+ editor.addShortcut( 'access+w', '', 'wpToggleDFW' );
+ } );
+
+ /**
+ * Binds and unbinds events on the editor.
+ *
+ * @since 4.1.0
+ *
+ * @param {event} event The TinyMCE editor init event.
+ * @param {object} editor The editor to bind events on.
+ *
+ * @returns {void}
+ */
+ $document.on( 'tinymce-editor-init.focus', function( event, editor ) {
+ var mceBind, mceUnbind;
+
+ function focus() {
+ editorHasFocus = true;
+ }
+
+ function blur() {
+ editorHasFocus = false;
+ }
+
+ if ( editor.id === 'content' ) {
+ $editorWindow = $( editor.getWin() );
+ $editorIframe = $( editor.getContentAreaContainer() ).find( 'iframe' );
+
+ mceBind = function() {
+ editor.on( 'keydown', fadeOut );
+ editor.on( 'blur', maybeFadeIn );
+ editor.on( 'focus', focus );
+ editor.on( 'blur', blur );
+ editor.on( 'wp-autoresize', recalcEditorRect );
+ };
+
+ mceUnbind = function() {
+ editor.off( 'keydown', fadeOut );
+ editor.off( 'blur', maybeFadeIn );
+ editor.off( 'focus', focus );
+ editor.off( 'blur', blur );
+ editor.off( 'wp-autoresize', recalcEditorRect );
+ };
+
+ if ( _isOn ) {
+ mceBind();
+ }
+
+ // Bind and unbind based on the distraction free writing focus.
+ $document.on( 'dfw-on.focus', mceBind ).on( 'dfw-off.focus', mceUnbind );
+
+ // Focuse the editor when it is the target of the click event.
+ editor.on( 'click', function( event ) {
+ if ( event.target === editor.getDoc().documentElement ) {
+ editor.focus();
+ }
+ } );
+ }
+ } );
+
+ /**
+ * Binds events on quicktags init.
+ *
+ * @since 4.1.0
+ *
+ * @param {event} event The quicktags init event.
+ * @param {object} editor The editor to bind events on.
+ *
+ * @returns {void}
+ */
+ $document.on( 'quicktags-init', function( event, editor ) {
+ var $button;
+
+ // Bind the distraction free writing events if the distraction free writing button is available.
+ if ( editor.settings.buttons && ( ',' + editor.settings.buttons + ',' ).indexOf( ',dfw,' ) !== -1 ) {
+ $button = $( '#' + editor.name + '_dfw' );
+
+ $( document )
+ .on( 'dfw-activate', function() {
+ $button.prop( 'disabled', false );
+ } )
+ .on( 'dfw-deactivate', function() {
+ $button.prop( 'disabled', true );
+ } )
+ .on( 'dfw-on', function() {
+ $button.addClass( 'active' );
+ } )
+ .on( 'dfw-off', function() {
+ $button.removeClass( 'active' );
+ } );
+ }
+ } );
+
+ $document.on( 'editor-expand-on.focus', activate ).on( 'editor-expand-off.focus', deactivate );
+
+ if ( _isOn ) {
+ $content.on( 'keydown.focus', fadeOut );
+
+ $title.add( $content ).on( 'blur.focus', maybeFadeIn );
+ }
+
+ window.wp = window.wp || {};
+ window.wp.editor = window.wp.editor || {};
+ window.wp.editor.dfw = {
+ activate: activate,
+ deactivate: deactivate,
+ isActive: isActive,
+ on: on,
+ off: off,
+ toggle: toggle,
+ isOn: isOn
+ };
+ } );
+} )( window, window.jQuery );
diff --git a/www/crm/wp-admin/js/editor-expand.min.js b/www/crm/wp-admin/js/editor-expand.min.js
new file mode 100644
index 00000000..d7714c1f
--- /dev/null
+++ b/www/crm/wp-admin/js/editor-expand.min.js
@@ -0,0 +1 @@
+!function(a,b,c){"use strict";var d=b(a),e=b(document),f=b("#wpadminbar"),g=b("#wpfooter");b(function(){function c(){var a=x.value.length;o&&!o.isHidden()||(o||"tinymce"!==R)&&(a<y?U():parseInt(x.style.height,10)<x.scrollHeight&&(x.style.height=Math.ceil(x.scrollHeight)+"px",i()),y=a)}function h(){var a=d.width();T={windowHeight:d.height(),windowWidth:a,adminBarHeight:a>600?f.outerHeight():0,toolsHeight:s.outerHeight()||0,menuBarHeight:A.outerHeight()||0,visualTopHeight:t.outerHeight()||0,textTopHeight:v.outerHeight()||0,bottomHeight:z.outerHeight()||0,statusBarHeight:B.outerHeight()||0,sideSortablesHeight:C.height()||0},T.menuBarHeight<3&&(T.menuBarHeight=0)}function i(b){if(!F||!F.settings.visible){var f,i,j,k,l,m,n,p,q,x=d.scrollTop(),y=b&&b.type,G="scroll"!==y,H=o&&!o.isHidden(),N=Q,R=E.offset().top,U=1,V=r.width();!G&&T.windowHeight||h(),H||"resize"!==y||c(),H?(f=t,i=u,n=T.visualTopHeight):(f=v,i=w,n=T.textTopHeight),(H||f.length)&&(m=f.parent().offset().top,p=i.offset().top,q=i.outerHeight(),l=H?Q+n:Q+20,l=q>l+5,l?((!I||G)&&x>=m-T.toolsHeight-T.adminBarHeight&&x<=m-T.toolsHeight-T.adminBarHeight+q-N?(I=!0,s.css({position:"fixed",top:T.adminBarHeight,width:V}),H&&A.length&&A.css({position:"fixed",top:T.adminBarHeight+T.toolsHeight,width:V-2*U-(H?0:f.outerWidth()-f.width())}),f.css({position:"fixed",top:T.adminBarHeight+T.toolsHeight+T.menuBarHeight,width:V-2*U-(H?0:f.outerWidth()-f.width())})):(I||G)&&(x<=m-T.toolsHeight-T.adminBarHeight?(I=!1,s.css({position:"absolute",top:0,width:V}),H&&A.length&&A.css({position:"absolute",top:0,width:V-2*U}),f.css({position:"absolute",top:T.menuBarHeight,width:V-2*U-(H?0:f.outerWidth()-f.width())})):x>=m-T.toolsHeight-T.adminBarHeight+q-N&&(I=!1,s.css({position:"absolute",top:q-N,width:V}),H&&A.length&&A.css({position:"absolute",top:q-N,width:V-2*U}),f.css({position:"absolute",top:q-N+T.menuBarHeight,width:V-2*U-(H?0:f.outerWidth()-f.width())}))),(!J||G&&S)&&x+T.windowHeight<=p+q+T.bottomHeight+T.statusBarHeight+U?b&&b.deltaHeight>0&&b.deltaHeight<100?a.scrollBy(0,b.deltaHeight):H&&S&&(J=!0,B.css({position:"fixed",bottom:T.bottomHeight,visibility:"",width:V-2*U}),z.css({position:"fixed",bottom:0,width:V})):(!S&&J||(J||G)&&x+T.windowHeight>p+q+T.bottomHeight+T.statusBarHeight-U)&&(J=!1,B.attr("style",S?"":"visibility: hidden;"),z.attr("style",""))):G&&(s.css({position:"absolute",top:0,width:V}),H&&A.length&&A.css({position:"absolute",top:0,width:V-2*U}),f.css({position:"absolute",top:T.menuBarHeight,width:V-2*U-(H?0:f.outerWidth()-f.width())}),B.attr("style",S?"":"visibility: hidden;"),z.attr("style","")),D.width()<300&&T.windowWidth>600&&e.height()>C.height()+R+120&&T.windowHeight<q?(T.sideSortablesHeight+O+P>T.windowHeight||K||L?x+O<=R?(C.attr("style",""),K=L=!1):x>M?K?(K=!1,j=C.offset().top-T.adminBarHeight,k=g.offset().top,k<j+T.sideSortablesHeight+P&&(j=k-T.sideSortablesHeight-12),C.css({position:"absolute",top:j,bottom:""})):!L&&T.sideSortablesHeight+C.offset().top+P<x+T.windowHeight&&(L=!0,C.css({position:"fixed",top:"auto",bottom:P})):x<M&&(L?(L=!1,j=C.offset().top-P,k=g.offset().top,k<j+T.sideSortablesHeight+P&&(j=k-T.sideSortablesHeight-12),C.css({position:"absolute",top:j,bottom:""})):!K&&C.offset().top>=x+O&&(K=!0,C.css({position:"fixed",top:O,bottom:""}))):(x>=R-O?C.css({position:"fixed",top:O}):C.attr("style",""),K=L=!1),M=x):(C.attr("style",""),K=L=!1),G&&(r.css({paddingTop:T.toolsHeight}),H?u.css({paddingTop:T.visualTopHeight+T.menuBarHeight}):w.css({marginTop:T.textTopHeight})))}}function j(){c(),i()}function k(a){for(var b=1;b<6;b++)setTimeout(a,500*b)}function l(){clearTimeout(p),p=setTimeout(i,100)}function m(){a.pageYOffset&&a.pageYOffset>N&&a.scrollTo(a.pageXOffset,0),q.addClass("wp-editor-expand"),d.on("scroll.editor-expand resize.editor-expand",function(a){i(a.type),l()}),e.on("wp-collapse-menu.editor-expand postboxes-columnchange.editor-expand editor-classchange.editor-expand",i).on("postbox-toggled.editor-expand postbox-moved.editor-expand",function(){!K&&!L&&a.pageYOffset>O&&(L=!0,a.scrollBy(0,-1),i(),a.scrollBy(0,1)),i()}).on("wp-window-resized.editor-expand",function(){o&&!o.isHidden()?o.execCommand("wpAutoResize"):c()}),w.on("focus.editor-expand input.editor-expand propertychange.editor-expand",c),G(),F&&F.pubsub.subscribe("hidden",j),o&&(o.settings.wp_autoresize_on=!0,o.execCommand("wpAutoResizeOn"),o.isHidden()||o.execCommand("wpAutoResize")),o&&!o.isHidden()||c(),i(),e.trigger("editor-expand-on")}function n(){var c=parseInt(a.getUserSetting("ed_size",300),10);c<50?c=50:c>5e3&&(c=5e3),a.pageYOffset&&a.pageYOffset>N&&a.scrollTo(a.pageXOffset,0),q.removeClass("wp-editor-expand"),d.off(".editor-expand"),e.off(".editor-expand"),w.off(".editor-expand"),H(),F&&F.pubsub.unsubscribe("hidden",j),b.each([t,v,s,A,z,B,r,u,w,C],function(a,b){b&&b.attr("style","")}),I=J=K=L=!1,o&&(o.settings.wp_autoresize_on=!1,o.execCommand("wpAutoResizeOff"),o.isHidden()||(w.hide(),c&&o.theme.resizeTo(null,c))),c&&w.height(c),e.trigger("editor-expand-off")}var o,p,q=b("#postdivrich"),r=b("#wp-content-wrap"),s=b("#wp-content-editor-tools"),t=b(),u=b(),v=b("#ed_toolbar"),w=b("#content"),x=w[0],y=0,z=b("#post-status-info"),A=b(),B=b(),C=b("#side-sortables"),D=b("#postbox-container-1"),E=b("#post-body"),F=a.wp.editor&&a.wp.editor.fullscreen,G=function(){},H=function(){},I=!1,J=!1,K=!1,L=!1,M=0,N=130,O=56,P=20,Q=300,R=r.hasClass("tmce-active")?"tinymce":"html",S=!!parseInt(a.getUserSetting("hidetb"),10),T={windowHeight:0,windowWidth:0,adminBarHeight:0,toolsHeight:0,menuBarHeight:0,visualTopHeight:0,textTopHeight:0,bottomHeight:0,statusBarHeight:0,sideSortablesHeight:0},U=a._.throttle(function(){var b=a.scrollX||document.documentElement.scrollLeft,c=a.scrollY||document.documentElement.scrollTop,d=parseInt(x.style.height,10);x.style.height=Q+"px",x.scrollHeight>Q&&(x.style.height=x.scrollHeight+"px"),"undefined"!=typeof b&&a.scrollTo(b,c),x.scrollHeight<d&&i()},300);e.on("tinymce-editor-init.editor-expand",function(e,f){function g(){var a,b,c,d=f.selection.getNode();if(f.wp&&f.wp.getView&&(b=f.wp.getView(d)))c=b.getBoundingClientRect();else{a=f.selection.getRng();try{c=a.getClientRects()[0]}catch(e){}c||(c=d.getBoundingClientRect())}return!!c.height&&c}function h(a){var b=a.keyCode;b<=47&&b!==s.SPACEBAR&&b!==s.ENTER&&b!==s.DELETE&&b!==s.BACKSPACE&&b!==s.UP&&b!==s.LEFT&&b!==s.DOWN&&b!==s.UP||b>=91&&b<=93||b>=112&&b<=123||144===b||145===b||j(b)}function j(b){var c,d,e,h,i=g(),j=50;i&&(c=i.top+f.iframeElement.getBoundingClientRect().top,d=c+i.height,c-=j,d+=j,e=T.adminBarHeight+T.toolsHeight+T.menuBarHeight+T.visualTopHeight,h=T.windowHeight-(S?T.bottomHeight+T.statusBarHeight:0),h-e<i.height||(c<e&&(b===s.UP||b===s.LEFT||b===s.BACKSPACE)?a.scrollTo(a.pageXOffset,c+a.pageYOffset-e):d>h&&a.scrollTo(a.pageXOffset,d+a.pageYOffset-h)))}function l(a){a.state||i()}function m(){d.on("scroll.mce-float-panels",v),setTimeout(function(){f.execCommand("wpAutoResize"),i()},300)}function n(){d.off("scroll.mce-float-panels"),setTimeout(function(){var b=r.offset().top;a.pageYOffset>b&&a.scrollTo(a.pageXOffset,b-T.adminBarHeight),c(),i()},100),i()}function p(){S=!S}var s=a.tinymce.util.VK,v=_.debounce(function(){!b(".mce-floatpanel:hover").length&&a.tinymce.ui.FloatPanel.hideAll(),b(".mce-tooltip").hide()},1e3,!0);"content"===f.id&&(o=f,f.settings.autoresize_min_height=Q,t=r.find(".mce-toolbar-grp"),u=r.find(".mce-edit-area"),B=r.find(".mce-statusbar"),A=r.find(".mce-menubar"),G=function(){f.on("keyup",h),f.on("show",m),f.on("hide",n),f.on("wp-toolbar-toggle",p),f.on("setcontent wp-autoresize wp-toolbar-toggle",i),f.on("undo redo",j),f.on("FullscreenStateChanged",l),d.off("scroll.mce-float-panels").on("scroll.mce-float-panels",v)},H=function(){f.off("keyup",h),f.off("show",m),f.off("hide",n),f.off("wp-toolbar-toggle",p),f.off("setcontent wp-autoresize wp-toolbar-toggle",i),f.off("undo redo",j),f.off("FullscreenStateChanged",l),d.off("scroll.mce-float-panels")},q.hasClass("wp-editor-expand")&&(G(),k(i)))}),q.hasClass("wp-editor-expand")&&(m(),r.hasClass("html-active")&&k(function(){i(),c()})),b("#adv-settings .editor-expand").show(),b("#editor-expand-toggle").on("change.editor-expand",function(){b(this).prop("checked")?(m(),a.setUserSetting("editor_expand","on")):(n(),a.setUserSetting("editor_expand","off"))}),a.editorExpand={on:m,off:n}}),b(function(){function c(){z=J.offset(),z.right=z.left+J.outerWidth(),z.bottom=z.top+J.outerHeight()}function h(){S||(S=!0,e.trigger("dfw-activate"),L.on("keydown.focus-shortcut",v))}function i(){S&&(l(),S=!1,e.trigger("dfw-deactivate"),L.off("keydown.focus-shortcut"))}function j(){return S}function k(){!T&&S&&(T=!0,L.on("keydown.focus",o),K.add(L).on("blur.focus",q),o(),a.setUserSetting("post_dfw","on"),e.trigger("dfw-on"))}function l(){T&&(T=!1,K.add(L).off(".focus"),p(),J.off(".focus"),a.setUserSetting("post_dfw","off"),e.trigger("dfw-off"))}function m(){T?l():k()}function n(){return T}function o(b){var e,f=b&&b.keyCode;return a.navigator.platform&&(e=a.navigator.platform.indexOf("Mac")>-1),27===f||87===f&&b.altKey&&(!e&&b.shiftKey||e&&b.ctrlKey)?void p(b):void(b&&(b.metaKey||b.ctrlKey&&!b.altKey||b.altKey&&b.shiftKey||f&&(f<=47&&8!==f&&13!==f&&32!==f&&46!==f||f>=91&&f<=93||f>=112&&f<=135||f>=144&&f<=150||f>=224))||(w||(w=!0,clearTimeout(F),F=setTimeout(function(){M.show()},600),J.css("z-index",9998),M.on("mouseenter.focus",function(){c(),d.on("scroll.focus",function(){var b=a.pageYOffset;D&&C&&D!==b&&(C<z.top-W||C>z.bottom+W)&&p(),D=b})}).on("mouseleave.focus",function(){A=B=null,U=V=0,d.off("scroll.focus")}).on("mousemove.focus",function(b){var c=b.clientX,d=b.clientY,e=a.pageYOffset,f=a.pageXOffset;if(A&&B&&(c!==A||d!==B))if(d<=B&&d<z.top-e||d>=B&&d>z.bottom-e||c<=A&&c<z.left-f||c>=A&&c>z.right-f){if(U+=Math.abs(A-c),V+=Math.abs(B-d),(d<=z.top-W-e||d>=z.bottom+W-e||c<=z.left-W-f||c>=z.right+W-f)&&(U>10||V>10))return p(),A=B=null,void(U=V=0)}else U=V=0;A=c,B=d}).on("touchstart.focus",function(a){a.preventDefault(),p()}),J.off("mouseenter.focus"),E&&(clearTimeout(E),E=null),H.addClass("focus-on").removeClass("focus-off")),r(),t()))}function p(a){w&&(w=!1,clearTimeout(F),F=setTimeout(function(){M.hide()},200),J.css("z-index",""),M.off("mouseenter.focus mouseleave.focus mousemove.focus touchstart.focus"),"undefined"==typeof a&&J.on("mouseenter.focus",function(){(b.contains(J.get(0),document.activeElement)||G)&&o()}),E=setTimeout(function(){E=null,J.off("mouseenter.focus")},1e3),H.addClass("focus-off").removeClass("focus-on")),s(),u()}function q(){setTimeout(function(){function a(a){return b.contains(a.get(0),document.activeElement)}var c=document.activeElement.compareDocumentPosition(J.get(0));2!==c&&4!==c||!(a(P)||a(I)||a(g))||p()},0)}function r(){!x&&w&&(x=!0,f.on("mouseenter.focus",function(){f.addClass("focus-off")}).on("mouseleave.focus",function(){f.removeClass("focus-off")}))}function s(){x&&(x=!1,f.off(".focus"))}function t(){y||!w||N.find(":focus").length||(y=!0,N.stop().fadeTo("fast",.3).on("mouseenter.focus",u).off("mouseleave.focus"),O.on("focus.focus",u).off("blur.focus"))}function u(){y&&(y=!1,N.stop().fadeTo("fast",1).on("mouseleave.focus",t).off("mouseenter.focus"),O.on("blur.focus",t).off("focus.focus"))}function v(a){a.altKey&&a.shiftKey&&87===a.keyCode&&m()}var w,x,y,z,A,B,C,D,E,F,G,H=b(document.body),I=b("#wpcontent"),J=b("#post-body-content"),K=b("#title"),L=b("#content"),M=b(document.createElement("DIV")),N=b("#edit-slug-box"),O=N.find("a").add(N.find("button")).add(N.find("input")),P=b("#adminmenuwrap"),Q=b(),R=b(),S="on"===a.getUserSetting("editor_expand","on"),T=!!S&&"on"===a.getUserSetting("post_dfw"),U=0,V=0,W=20;H.append(M),M.css({display:"none",position:"fixed",top:f.height(),right:0,bottom:0,left:0,"z-index":9997}),J.css({position:"relative"}),d.on("mousemove.focus",function(a){C=a.pageY}),b("#postdivrich").hasClass("wp-editor-expand")&&L.on("keydown.focus-shortcut",v),e.on("tinymce-editor-setup.focus",function(a,b){b.addButton("dfw",{active:T,classes:"wp-dfw btn widget",disabled:!S,onclick:m,onPostRender:function(){var a=this;b.on("init",function(){a.disabled()&&a.hide()}),e.on("dfw-activate.focus",function(){a.disabled(!1),a.show()}).on("dfw-deactivate.focus",function(){a.disabled(!0),a.hide()}).on("dfw-on.focus",function(){a.active(!0)}).on("dfw-off.focus",function(){a.active(!1)})},tooltip:"Distraction-free writing mode",shortcut:"Alt+Shift+W"}),b.addCommand("wpToggleDFW",m),b.addShortcut("access+w","","wpToggleDFW")}),e.on("tinymce-editor-init.focus",function(a,d){function f(){G=!0}function g(){G=!1}var h,i;"content"===d.id&&(Q=b(d.getWin()),R=b(d.getContentAreaContainer()).find("iframe"),h=function(){d.on("keydown",o),d.on("blur",q),d.on("focus",f),d.on("blur",g),d.on("wp-autoresize",c)},i=function(){d.off("keydown",o),d.off("blur",q),d.off("focus",f),d.off("blur",g),d.off("wp-autoresize",c)},T&&h(),e.on("dfw-on.focus",h).on("dfw-off.focus",i),d.on("click",function(a){a.target===d.getDoc().documentElement&&d.focus()}))}),e.on("quicktags-init",function(a,c){var d;c.settings.buttons&&(","+c.settings.buttons+",").indexOf(",dfw,")!==-1&&(d=b("#"+c.name+"_dfw"),b(document).on("dfw-activate",function(){d.prop("disabled",!1)}).on("dfw-deactivate",function(){d.prop("disabled",!0)}).on("dfw-on",function(){d.addClass("active")}).on("dfw-off",function(){d.removeClass("active")}))}),e.on("editor-expand-on.focus",h).on("editor-expand-off.focus",i),T&&(L.on("keydown.focus",o),K.add(L).on("blur.focus",q)),a.wp=a.wp||{},a.wp.editor=a.wp.editor||{},a.wp.editor.dfw={activate:h,deactivate:i,isActive:j,on:k,off:l,toggle:m,isOn:n}})}(window,window.jQuery); \ No newline at end of file
diff --git a/www/crm/wp-admin/js/editor.js b/www/crm/wp-admin/js/editor.js
new file mode 100644
index 00000000..0620b312
--- /dev/null
+++ b/www/crm/wp-admin/js/editor.js
@@ -0,0 +1,1414 @@
+/**
+ * @output wp-admin/js/editor.js
+ */
+
+window.wp = window.wp || {};
+
+( function( $, wp ) {
+ wp.editor = wp.editor || {};
+
+ /**
+ * Utility functions for the editor.
+ *
+ * @since 2.5.0
+ */
+ function SwitchEditors() {
+ var tinymce, $$,
+ exports = {};
+
+ function init() {
+ if ( ! tinymce && window.tinymce ) {
+ tinymce = window.tinymce;
+ $$ = tinymce.$;
+
+ /**
+ * Handles onclick events for the Visual/Text tabs.
+ *
+ * @since 4.3.0
+ *
+ * @returns {void}
+ */
+ $$( document ).on( 'click', function( event ) {
+ var id, mode,
+ target = $$( event.target );
+
+ if ( target.hasClass( 'wp-switch-editor' ) ) {
+ id = target.attr( 'data-wp-editor-id' );
+ mode = target.hasClass( 'switch-tmce' ) ? 'tmce' : 'html';
+ switchEditor( id, mode );
+ }
+ });
+ }
+ }
+
+ /**
+ * Returns the height of the editor toolbar(s) in px.
+ *
+ * @since 3.9.0
+ *
+ * @param {Object} editor The TinyMCE editor.
+ * @returns {number} If the height is between 10 and 200 return the height,
+ * else return 30.
+ */
+ function getToolbarHeight( editor ) {
+ var node = $$( '.mce-toolbar-grp', editor.getContainer() )[0],
+ height = node && node.clientHeight;
+
+ if ( height && height > 10 && height < 200 ) {
+ return parseInt( height, 10 );
+ }
+
+ return 30;
+ }
+
+ /**
+ * Switches the editor between Visual and Text mode.
+ *
+ * @since 2.5.0
+ *
+ * @memberof switchEditors
+ *
+ * @param {string} id The id of the editor you want to change the editor mode for. Default: `content`.
+ * @param {string} mode The mode you want to switch to. Default: `toggle`.
+ * @returns {void}
+ */
+ function switchEditor( id, mode ) {
+ id = id || 'content';
+ mode = mode || 'toggle';
+
+ var editorHeight, toolbarHeight, iframe,
+ editor = tinymce.get( id ),
+ wrap = $$( '#wp-' + id + '-wrap' ),
+ $textarea = $$( '#' + id ),
+ textarea = $textarea[0];
+
+ if ( 'toggle' === mode ) {
+ if ( editor && ! editor.isHidden() ) {
+ mode = 'html';
+ } else {
+ mode = 'tmce';
+ }
+ }
+
+ if ( 'tmce' === mode || 'tinymce' === mode ) {
+ // If the editor is visible we are already in `tinymce` mode.
+ if ( editor && ! editor.isHidden() ) {
+ return false;
+ }
+
+ // Insert closing tags for any open tags in QuickTags.
+ if ( typeof( window.QTags ) !== 'undefined' ) {
+ window.QTags.closeAllTags( id );
+ }
+
+ editorHeight = parseInt( textarea.style.height, 10 ) || 0;
+
+ var keepSelection = false;
+ if ( editor ) {
+ keepSelection = editor.getParam( 'wp_keep_scroll_position' );
+ } else {
+ keepSelection = window.tinyMCEPreInit.mceInit[ id ] &&
+ window.tinyMCEPreInit.mceInit[ id ].wp_keep_scroll_position;
+ }
+
+ if ( keepSelection ) {
+ // Save the selection
+ addHTMLBookmarkInTextAreaContent( $textarea );
+ }
+
+ if ( editor ) {
+ editor.show();
+
+ // No point to resize the iframe in iOS.
+ if ( ! tinymce.Env.iOS && editorHeight ) {
+ toolbarHeight = getToolbarHeight( editor );
+ editorHeight = editorHeight - toolbarHeight + 14;
+
+ // Sane limit for the editor height.
+ if ( editorHeight > 50 && editorHeight < 5000 ) {
+ editor.theme.resizeTo( null, editorHeight );
+ }
+ }
+
+ if ( editor.getParam( 'wp_keep_scroll_position' ) ) {
+ // Restore the selection
+ focusHTMLBookmarkInVisualEditor( editor );
+ }
+ } else {
+ tinymce.init( window.tinyMCEPreInit.mceInit[ id ] );
+ }
+
+ wrap.removeClass( 'html-active' ).addClass( 'tmce-active' );
+ $textarea.attr( 'aria-hidden', true );
+ window.setUserSetting( 'editor', 'tinymce' );
+
+ } else if ( 'html' === mode ) {
+ // If the editor is hidden (Quicktags is shown) we don't need to switch.
+ if ( editor && editor.isHidden() ) {
+ return false;
+ }
+
+ if ( editor ) {
+ // Don't resize the textarea in iOS. The iframe is forced to 100% height there, we shouldn't match it.
+ if ( ! tinymce.Env.iOS ) {
+ iframe = editor.iframeElement;
+ editorHeight = iframe ? parseInt( iframe.style.height, 10 ) : 0;
+
+ if ( editorHeight ) {
+ toolbarHeight = getToolbarHeight( editor );
+ editorHeight = editorHeight + toolbarHeight - 14;
+
+ // Sane limit for the textarea height.
+ if ( editorHeight > 50 && editorHeight < 5000 ) {
+ textarea.style.height = editorHeight + 'px';
+ }
+ }
+ }
+
+ var selectionRange = null;
+
+ if ( editor.getParam( 'wp_keep_scroll_position' ) ) {
+ selectionRange = findBookmarkedPosition( editor );
+ }
+
+ editor.hide();
+
+ if ( selectionRange ) {
+ selectTextInTextArea( editor, selectionRange );
+ }
+ } else {
+ // There is probably a JS error on the page. The TinyMCE editor instance doesn't exist. Show the textarea.
+ $textarea.css({ 'display': '', 'visibility': '' });
+ }
+
+ wrap.removeClass( 'tmce-active' ).addClass( 'html-active' );
+ $textarea.attr( 'aria-hidden', false );
+ window.setUserSetting( 'editor', 'html' );
+ }
+ }
+
+ /**
+ * Checks if a cursor is inside an HTML tag or comment.
+ *
+ * In order to prevent breaking HTML tags when selecting text, the cursor
+ * must be moved to either the start or end of the tag.
+ *
+ * This will prevent the selection marker to be inserted in the middle of an HTML tag.
+ *
+ * This function gives information whether the cursor is inside a tag or not, as well as
+ * the tag type, if it is a closing tag and check if the HTML tag is inside a shortcode tag,
+ * e.g. `[caption]<img.../>..`.
+ *
+ * @param {string} content The test content where the cursor is.
+ * @param {number} cursorPosition The cursor position inside the content.
+ *
+ * @returns {(null|Object)} Null if cursor is not in a tag, Object if the cursor is inside a tag.
+ */
+ function getContainingTagInfo( content, cursorPosition ) {
+ var lastLtPos = content.lastIndexOf( '<', cursorPosition - 1 ),
+ lastGtPos = content.lastIndexOf( '>', cursorPosition );
+
+ if ( lastLtPos > lastGtPos || content.substr( cursorPosition, 1 ) === '>' ) {
+ // find what the tag is
+ var tagContent = content.substr( lastLtPos ),
+ tagMatch = tagContent.match( /<\s*(\/)?(\w+|\!-{2}.*-{2})/ );
+
+ if ( ! tagMatch ) {
+ return null;
+ }
+
+ var tagType = tagMatch[2],
+ closingGt = tagContent.indexOf( '>' );
+
+ return {
+ ltPos: lastLtPos,
+ gtPos: lastLtPos + closingGt + 1, // offset by one to get the position _after_ the character,
+ tagType: tagType,
+ isClosingTag: !! tagMatch[1]
+ };
+ }
+ return null;
+ }
+
+ /**
+ * Checks if the cursor is inside a shortcode
+ *
+ * If the cursor is inside a shortcode wrapping tag, e.g. `[caption]` it's better to
+ * move the selection marker to before or after the shortcode.
+ *
+ * For example `[caption]` rewrites/removes anything that's between the `[caption]` tag and the
+ * `<img/>` tag inside.
+ *
+ * `[caption]<span>ThisIsGone</span><img .../>[caption]`
+ *
+ * Moving the selection to before or after the short code is better, since it allows to select
+ * something, instead of just losing focus and going to the start of the content.
+ *
+ * @param {string} content The text content to check against.
+ * @param {number} cursorPosition The cursor position to check.
+ *
+ * @return {(undefined|Object)} Undefined if the cursor is not wrapped in a shortcode tag.
+ * Information about the wrapping shortcode tag if it's wrapped in one.
+ */
+ function getShortcodeWrapperInfo( content, cursorPosition ) {
+ var contentShortcodes = getShortCodePositionsInText( content );
+
+ for ( var i = 0; i < contentShortcodes.length; i++ ) {
+ var element = contentShortcodes[ i ];
+
+ if ( cursorPosition >= element.startIndex && cursorPosition <= element.endIndex ) {
+ return element;
+ }
+ }
+ }
+
+ /**
+ * Gets a list of unique shortcodes or shortcode-look-alikes in the content.
+ *
+ * @param {string} content The content we want to scan for shortcodes.
+ */
+ function getShortcodesInText( content ) {
+ var shortcodes = content.match( /\[+([\w_-])+/g ),
+ result = [];
+
+ if ( shortcodes ) {
+ for ( var i = 0; i < shortcodes.length; i++ ) {
+ var shortcode = shortcodes[ i ].replace( /^\[+/g, '' );
+
+ if ( result.indexOf( shortcode ) === -1 ) {
+ result.push( shortcode );
+ }
+ }
+ }
+
+ return result;
+ }
+
+ /**
+ * Gets all shortcodes and their positions in the content
+ *
+ * This function returns all the shortcodes that could be found in the textarea content
+ * along with their character positions and boundaries.
+ *
+ * This is used to check if the selection cursor is inside the boundaries of a shortcode
+ * and move it accordingly, to avoid breakage.
+ *
+ * @link adjustTextAreaSelectionCursors
+ *
+ * The information can also be used in other cases when we need to lookup shortcode data,
+ * as it's already structured!
+ *
+ * @param {string} content The content we want to scan for shortcodes
+ */
+ function getShortCodePositionsInText( content ) {
+ var allShortcodes = getShortcodesInText( content ), shortcodeInfo;
+
+ if ( allShortcodes.length === 0 ) {
+ return [];
+ }
+
+ var shortcodeDetailsRegexp = wp.shortcode.regexp( allShortcodes.join( '|' ) ),
+ shortcodeMatch, // Define local scope for the variable to be used in the loop below.
+ shortcodesDetails = [];
+
+ while ( shortcodeMatch = shortcodeDetailsRegexp.exec( content ) ) {
+ /**
+ * Check if the shortcode should be shown as plain text.
+ *
+ * This corresponds to the [[shortcode]] syntax, which doesn't parse the shortcode
+ * and just shows it as text.
+ */
+ var showAsPlainText = shortcodeMatch[1] === '[';
+
+ shortcodeInfo = {
+ shortcodeName: shortcodeMatch[2],
+ showAsPlainText: showAsPlainText,
+ startIndex: shortcodeMatch.index,
+ endIndex: shortcodeMatch.index + shortcodeMatch[0].length,
+ length: shortcodeMatch[0].length
+ };
+
+ shortcodesDetails.push( shortcodeInfo );
+ }
+
+ /**
+ * Get all URL matches, and treat them as embeds.
+ *
+ * Since there isn't a good way to detect if a URL by itself on a line is a previewable
+ * object, it's best to treat all of them as such.
+ *
+ * This means that the selection will capture the whole URL, in a similar way shrotcodes
+ * are treated.
+ */
+ var urlRegexp = new RegExp(
+ '(^|[\\n\\r][\\n\\r]|<p>)(https?:\\/\\/[^\s"]+?)(<\\/p>\s*|[\\n\\r][\\n\\r]|$)', 'gi'
+ );
+
+ while ( shortcodeMatch = urlRegexp.exec( content ) ) {
+ shortcodeInfo = {
+ shortcodeName: 'url',
+ showAsPlainText: false,
+ startIndex: shortcodeMatch.index,
+ endIndex: shortcodeMatch.index + shortcodeMatch[ 0 ].length,
+ length: shortcodeMatch[ 0 ].length,
+ urlAtStartOfContent: shortcodeMatch[ 1 ] === '',
+ urlAtEndOfContent: shortcodeMatch[ 3 ] === ''
+ };
+
+ shortcodesDetails.push( shortcodeInfo );
+ }
+
+ return shortcodesDetails;
+ }
+
+ /**
+ * Generate a cursor marker element to be inserted in the content.
+ *
+ * `span` seems to be the least destructive element that can be used.
+ *
+ * Using DomQuery syntax to create it, since it's used as both text and as a DOM element.
+ *
+ * @param {Object} domLib DOM library instance.
+ * @param {string} content The content to insert into the cusror marker element.
+ */
+ function getCursorMarkerSpan( domLib, content ) {
+ return domLib( '<span>' ).css( {
+ display: 'inline-block',
+ width: 0,
+ overflow: 'hidden',
+ 'line-height': 0
+ } )
+ .html( content ? content : '' );
+ }
+
+ /**
+ * Gets adjusted selection cursor positions according to HTML tags, comments, and shortcodes.
+ *
+ * Shortcodes and HTML codes are a bit of a special case when selecting, since they may render
+ * content in Visual mode. If we insert selection markers somewhere inside them, it's really possible
+ * to break the syntax and render the HTML tag or shortcode broken.
+ *
+ * @link getShortcodeWrapperInfo
+ *
+ * @param {string} content Textarea content that the cursors are in
+ * @param {{cursorStart: number, cursorEnd: number}} cursorPositions Cursor start and end positions
+ *
+ * @return {{cursorStart: number, cursorEnd: number}}
+ */
+ function adjustTextAreaSelectionCursors( content, cursorPositions ) {
+ var voidElements = [
+ 'area', 'base', 'br', 'col', 'embed', 'hr', 'img', 'input',
+ 'keygen', 'link', 'meta', 'param', 'source', 'track', 'wbr'
+ ];
+
+ var cursorStart = cursorPositions.cursorStart,
+ cursorEnd = cursorPositions.cursorEnd,
+ // check if the cursor is in a tag and if so, adjust it
+ isCursorStartInTag = getContainingTagInfo( content, cursorStart );
+
+ if ( isCursorStartInTag ) {
+ /**
+ * Only move to the start of the HTML tag (to select the whole element) if the tag
+ * is part of the voidElements list above.
+ *
+ * This list includes tags that are self-contained and don't need a closing tag, according to the
+ * HTML5 specification.
+ *
+ * This is done in order to make selection of text a bit more consistent when selecting text in
+ * `<p>` tags or such.
+ *
+ * In cases where the tag is not a void element, the cursor is put to the end of the tag,
+ * so it's either between the opening and closing tag elements or after the closing tag.
+ */
+ if ( voidElements.indexOf( isCursorStartInTag.tagType ) !== -1 ) {
+ cursorStart = isCursorStartInTag.ltPos;
+ } else {
+ cursorStart = isCursorStartInTag.gtPos;
+ }
+ }
+
+ var isCursorEndInTag = getContainingTagInfo( content, cursorEnd );
+ if ( isCursorEndInTag ) {
+ cursorEnd = isCursorEndInTag.gtPos;
+ }
+
+ var isCursorStartInShortcode = getShortcodeWrapperInfo( content, cursorStart );
+ if ( isCursorStartInShortcode && ! isCursorStartInShortcode.showAsPlainText ) {
+ /**
+ * If a URL is at the start or the end of the content,
+ * the selection doesn't work, because it inserts a marker in the text,
+ * which breaks the embedURL detection.
+ *
+ * The best way to avoid that and not modify the user content is to
+ * adjust the cursor to either after or before URL.
+ */
+ if ( isCursorStartInShortcode.urlAtStartOfContent ) {
+ cursorStart = isCursorStartInShortcode.endIndex;
+ } else {
+ cursorStart = isCursorStartInShortcode.startIndex;
+ }
+ }
+
+ var isCursorEndInShortcode = getShortcodeWrapperInfo( content, cursorEnd );
+ if ( isCursorEndInShortcode && ! isCursorEndInShortcode.showAsPlainText ) {
+ if ( isCursorEndInShortcode.urlAtEndOfContent ) {
+ cursorEnd = isCursorEndInShortcode.startIndex;
+ } else {
+ cursorEnd = isCursorEndInShortcode.endIndex;
+ }
+ }
+
+ return {
+ cursorStart: cursorStart,
+ cursorEnd: cursorEnd
+ };
+ }
+
+ /**
+ * Adds text selection markers in the editor textarea.
+ *
+ * Adds selection markers in the content of the editor `textarea`.
+ * The method directly manipulates the `textarea` content, to allow TinyMCE plugins
+ * to run after the markers are added.
+ *
+ * @param {object} $textarea TinyMCE's textarea wrapped as a DomQuery object
+ */
+ function addHTMLBookmarkInTextAreaContent( $textarea ) {
+ if ( ! $textarea || ! $textarea.length ) {
+ // If no valid $textarea object is provided, there's nothing we can do.
+ return;
+ }
+
+ var textArea = $textarea[0],
+ textAreaContent = textArea.value,
+
+ adjustedCursorPositions = adjustTextAreaSelectionCursors( textAreaContent, {
+ cursorStart: textArea.selectionStart,
+ cursorEnd: textArea.selectionEnd
+ } ),
+
+ htmlModeCursorStartPosition = adjustedCursorPositions.cursorStart,
+ htmlModeCursorEndPosition = adjustedCursorPositions.cursorEnd,
+
+ mode = htmlModeCursorStartPosition !== htmlModeCursorEndPosition ? 'range' : 'single',
+
+ selectedText = null,
+ cursorMarkerSkeleton = getCursorMarkerSpan( $$, '&#65279;' ).attr( 'data-mce-type','bookmark' );
+
+ if ( mode === 'range' ) {
+ var markedText = textArea.value.slice( htmlModeCursorStartPosition, htmlModeCursorEndPosition ),
+ bookMarkEnd = cursorMarkerSkeleton.clone().addClass( 'mce_SELRES_end' );
+
+ selectedText = [
+ markedText,
+ bookMarkEnd[0].outerHTML
+ ].join( '' );
+ }
+
+ textArea.value = [
+ textArea.value.slice( 0, htmlModeCursorStartPosition ), // text until the cursor/selection position
+ cursorMarkerSkeleton.clone() // cursor/selection start marker
+ .addClass( 'mce_SELRES_start' )[0].outerHTML,
+ selectedText, // selected text with end cursor/position marker
+ textArea.value.slice( htmlModeCursorEndPosition ) // text from last cursor/selection position to end
+ ].join( '' );
+ }
+
+ /**
+ * Focuses the selection markers in Visual mode.
+ *
+ * The method checks for existing selection markers inside the editor DOM (Visual mode)
+ * and create a selection between the two nodes using the DOM `createRange` selection API
+ *
+ * If there is only a single node, select only the single node through TinyMCE's selection API
+ *
+ * @param {Object} editor TinyMCE editor instance.
+ */
+ function focusHTMLBookmarkInVisualEditor( editor ) {
+ var startNode = editor.$( '.mce_SELRES_start' ).attr( 'data-mce-bogus', 1 ),
+ endNode = editor.$( '.mce_SELRES_end' ).attr( 'data-mce-bogus', 1 );
+
+ if ( startNode.length ) {
+ editor.focus();
+
+ if ( ! endNode.length ) {
+ editor.selection.select( startNode[0] );
+ } else {
+ var selection = editor.getDoc().createRange();
+
+ selection.setStartAfter( startNode[0] );
+ selection.setEndBefore( endNode[0] );
+
+ editor.selection.setRng( selection );
+ }
+ }
+
+ if ( editor.getParam( 'wp_keep_scroll_position' ) ) {
+ scrollVisualModeToStartElement( editor, startNode );
+ }
+
+ removeSelectionMarker( startNode );
+ removeSelectionMarker( endNode );
+
+ editor.save();
+ }
+
+ /**
+ * Removes selection marker and the parent node if it is an empty paragraph.
+ *
+ * By default TinyMCE wraps loose inline tags in a `<p>`.
+ * When removing selection markers an empty `<p>` may be left behind, remove it.
+ *
+ * @param {object} $marker The marker to be removed from the editor DOM, wrapped in an instnce of `editor.$`
+ */
+ function removeSelectionMarker( $marker ) {
+ var $markerParent = $marker.parent();
+
+ $marker.remove();
+
+ //Remove empty paragraph left over after removing the marker.
+ if ( $markerParent.is( 'p' ) && ! $markerParent.children().length && ! $markerParent.text() ) {
+ $markerParent.remove();
+ }
+ }
+
+ /**
+ * Scrolls the content to place the selected element in the center of the screen.
+ *
+ * Takes an element, that is usually the selection start element, selected in
+ * `focusHTMLBookmarkInVisualEditor()` and scrolls the screen so the element appears roughly
+ * in the middle of the screen.
+ *
+ * I order to achieve the proper positioning, the editor media bar and toolbar are subtracted
+ * from the window height, to get the proper viewport window, that the user sees.
+ *
+ * @param {Object} editor TinyMCE editor instance.
+ * @param {Object} element HTMLElement that should be scrolled into view.
+ */
+ function scrollVisualModeToStartElement( editor, element ) {
+ var elementTop = editor.$( element ).offset().top,
+ TinyMCEContentAreaTop = editor.$( editor.getContentAreaContainer() ).offset().top,
+
+ toolbarHeight = getToolbarHeight( editor ),
+
+ edTools = $( '#wp-content-editor-tools' ),
+ edToolsHeight = 0,
+ edToolsOffsetTop = 0,
+
+ $scrollArea;
+
+ if ( edTools.length ) {
+ edToolsHeight = edTools.height();
+ edToolsOffsetTop = edTools.offset().top;
+ }
+
+ var windowHeight = window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight,
+
+ selectionPosition = TinyMCEContentAreaTop + elementTop,
+ visibleAreaHeight = windowHeight - ( edToolsHeight + toolbarHeight );
+
+ // There's no need to scroll if the selection is inside the visible area.
+ if ( selectionPosition < visibleAreaHeight ) {
+ return;
+ }
+
+ /**
+ * The minimum scroll height should be to the top of the editor, to offer a consistent
+ * experience.
+ *
+ * In order to find the top of the editor, we calculate the offset of `#wp-content-editor-tools` and
+ * subtracting the height. This gives the scroll position where the top of the editor tools aligns with
+ * the top of the viewport (under the Master Bar)
+ */
+ var adjustedScroll;
+ if ( editor.settings.wp_autoresize_on ) {
+ $scrollArea = $( 'html,body' );
+ adjustedScroll = Math.max( selectionPosition - visibleAreaHeight / 2, edToolsOffsetTop - edToolsHeight );
+ } else {
+ $scrollArea = $( editor.contentDocument ).find( 'html,body' );
+ adjustedScroll = elementTop;
+ }
+
+ $scrollArea.animate( {
+ scrollTop: parseInt( adjustedScroll, 10 )
+ }, 100 );
+ }
+
+ /**
+ * This method was extracted from the `SaveContent` hook in
+ * `wp-includes/js/tinymce/plugins/wordpress/plugin.js`.
+ *
+ * It's needed here, since the method changes the content a bit, which confuses the cursor position.
+ *
+ * @param {Object} event TinyMCE event object.
+ */
+ function fixTextAreaContent( event ) {
+ // Keep empty paragraphs :(
+ event.content = event.content.replace( /<p>(?:<br ?\/?>|\u00a0|\uFEFF| )*<\/p>/g, '<p>&nbsp;</p>' );
+ }
+
+ /**
+ * Finds the current selection position in the Visual editor.
+ *
+ * Find the current selection in the Visual editor by inserting marker elements at the start
+ * and end of the selection.
+ *
+ * Uses the standard DOM selection API to achieve that goal.
+ *
+ * Check the notes in the comments in the code below for more information on some gotchas
+ * and why this solution was chosen.
+ *
+ * @param {Object} editor The editor where we must find the selection
+ * @returns {(null|Object)} The selection range position in the editor
+ */
+ function findBookmarkedPosition( editor ) {
+ // Get the TinyMCE `window` reference, since we need to access the raw selection.
+ var TinyMCEWindow = editor.getWin(),
+ selection = TinyMCEWindow.getSelection();
+
+ if ( ! selection || selection.rangeCount < 1 ) {
+ // no selection, no need to continue.
+ return;
+ }
+
+ /**
+ * The ID is used to avoid replacing user generated content, that may coincide with the
+ * format specified below.
+ * @type {string}
+ */
+ var selectionID = 'SELRES_' + Math.random();
+
+ /**
+ * Create two marker elements that will be used to mark the start and the end of the range.
+ *
+ * The elements have hardcoded style that makes them invisible. This is done to avoid seeing
+ * random content flickering in the editor when switching between modes.
+ */
+ var spanSkeleton = getCursorMarkerSpan( editor.$, selectionID ),
+ startElement = spanSkeleton.clone().addClass( 'mce_SELRES_start' ),
+ endElement = spanSkeleton.clone().addClass( 'mce_SELRES_end' );
+
+ /**
+ * Inspired by:
+ * @link https://stackoverflow.com/a/17497803/153310
+ *
+ * Why do it this way and not with TinyMCE's bookmarks?
+ *
+ * TinyMCE's bookmarks are very nice when working with selections and positions, BUT
+ * there is no way to determine the precise position of the bookmark when switching modes, since
+ * TinyMCE does some serialization of the content, to fix things like shortcodes, run plugins, prettify
+ * HTML code and so on. In this process, the bookmark markup gets lost.
+ *
+ * If we decide to hook right after the bookmark is added, we can see where the bookmark is in the raw HTML
+ * in TinyMCE. Unfortunately this state is before the serialization, so any visual markup in the content will
+ * throw off the positioning.
+ *
+ * To avoid this, we insert two custom `span`s that will serve as the markers at the beginning and end of the
+ * selection.
+ *
+ * Why not use TinyMCE's selection API or the DOM API to wrap the contents? Because if we do that, this creates
+ * a new node, which is inserted in the dom. Now this will be fine, if we worked with fixed selections to
+ * full nodes. Unfortunately in our case, the user can select whatever they like, which means that the
+ * selection may start in the middle of one node and end in the middle of a completely different one. If we
+ * wrap the selection in another node, this will create artifacts in the content.
+ *
+ * Using the method below, we insert the custom `span` nodes at the start and at the end of the selection.
+ * This helps us not break the content and also gives us the option to work with multi-node selections without
+ * breaking the markup.
+ */
+ var range = selection.getRangeAt( 0 ),
+ startNode = range.startContainer,
+ startOffset = range.startOffset,
+ boundaryRange = range.cloneRange();
+
+ /**
+ * If the selection is on a shortcode with Live View, TinyMCE creates a bogus markup,
+ * which we have to account for.
+ */
+ if ( editor.$( startNode ).parents( '.mce-offscreen-selection' ).length > 0 ) {
+ startNode = editor.$( '[data-mce-selected]' )[0];
+
+ /**
+ * Marking the start and end element with `data-mce-object-selection` helps
+ * discern when the selected object is a Live Preview selection.
+ *
+ * This way we can adjust the selection to properly select only the content, ignoring
+ * whitespace inserted around the selected object by the Editor.
+ */
+ startElement.attr( 'data-mce-object-selection', 'true' );
+ endElement.attr( 'data-mce-object-selection', 'true' );
+
+ editor.$( startNode ).before( startElement[0] );
+ editor.$( startNode ).after( endElement[0] );
+ } else {
+ boundaryRange.collapse( false );
+ boundaryRange.insertNode( endElement[0] );
+
+ boundaryRange.setStart( startNode, startOffset );
+ boundaryRange.collapse( true );
+ boundaryRange.insertNode( startElement[0] );
+
+ range.setStartAfter( startElement[0] );
+ range.setEndBefore( endElement[0] );
+ selection.removeAllRanges();
+ selection.addRange( range );
+ }
+
+ /**
+ * Now the editor's content has the start/end nodes.
+ *
+ * Unfortunately the content goes through some more changes after this step, before it gets inserted
+ * in the `textarea`. This means that we have to do some minor cleanup on our own here.
+ */
+ editor.on( 'GetContent', fixTextAreaContent );
+
+ var content = removep( editor.getContent() );
+
+ editor.off( 'GetContent', fixTextAreaContent );
+
+ startElement.remove();
+ endElement.remove();
+
+ var startRegex = new RegExp(
+ '<span[^>]*\\s*class="mce_SELRES_start"[^>]+>\\s*' + selectionID + '[^<]*<\\/span>(\\s*)'
+ );
+
+ var endRegex = new RegExp(
+ '(\\s*)<span[^>]*\\s*class="mce_SELRES_end"[^>]+>\\s*' + selectionID + '[^<]*<\\/span>'
+ );
+
+ var startMatch = content.match( startRegex ),
+ endMatch = content.match( endRegex );
+
+ if ( ! startMatch ) {
+ return null;
+ }
+
+ var startIndex = startMatch.index,
+ startMatchLength = startMatch[0].length,
+ endIndex = null;
+
+ if (endMatch) {
+ /**
+ * Adjust the selection index, if the selection contains a Live Preview object or not.
+ *
+ * Check where the `data-mce-object-selection` attribute is set above for more context.
+ */
+ if ( startMatch[0].indexOf( 'data-mce-object-selection' ) !== -1 ) {
+ startMatchLength -= startMatch[1].length;
+ }
+
+ var endMatchIndex = endMatch.index;
+
+ if ( endMatch[0].indexOf( 'data-mce-object-selection' ) !== -1 ) {
+ endMatchIndex -= endMatch[1].length;
+ }
+
+ // We need to adjust the end position to discard the length of the range start marker
+ endIndex = endMatchIndex - startMatchLength;
+ }
+
+ return {
+ start: startIndex,
+ end: endIndex
+ };
+ }
+
+ /**
+ * Selects text in the TinyMCE `textarea`.
+ *
+ * Selects the text in TinyMCE's textarea that's between `selection.start` and `selection.end`.
+ *
+ * For `selection` parameter:
+ * @link findBookmarkedPosition
+ *
+ * @param {Object} editor TinyMCE's editor instance.
+ * @param {Object} selection Selection data.
+ */
+ function selectTextInTextArea( editor, selection ) {
+ // only valid in the text area mode and if we have selection
+ if ( ! selection ) {
+ return;
+ }
+
+ var textArea = editor.getElement(),
+ start = selection.start,
+ end = selection.end || selection.start;
+
+ if ( textArea.focus ) {
+ // Wait for the Visual editor to be hidden, then focus and scroll to the position
+ setTimeout( function() {
+ textArea.setSelectionRange( start, end );
+ if ( textArea.blur ) {
+ // defocus before focusing
+ textArea.blur();
+ }
+ textArea.focus();
+ }, 100 );
+ }
+ }
+
+ // Restore the selection when the editor is initialized. Needed when the Text editor is the default.
+ $( document ).on( 'tinymce-editor-init.keep-scroll-position', function( event, editor ) {
+ if ( editor.$( '.mce_SELRES_start' ).length ) {
+ focusHTMLBookmarkInVisualEditor( editor );
+ }
+ } );
+
+ /**
+ * Replaces <p> tags with two line breaks. "Opposite" of wpautop().
+ *
+ * Replaces <p> tags with two line breaks except where the <p> has attributes.
+ * Unifies whitespace.
+ * Indents <li>, <dt> and <dd> for better readability.
+ *
+ * @since 2.5.0
+ *
+ * @memberof switchEditors
+ *
+ * @param {string} html The content from the editor.
+ * @return {string} The content with stripped paragraph tags.
+ */
+ function removep( html ) {
+ var blocklist = 'blockquote|ul|ol|li|dl|dt|dd|table|thead|tbody|tfoot|tr|th|td|h[1-6]|fieldset|figure',
+ blocklist1 = blocklist + '|div|p',
+ blocklist2 = blocklist + '|pre',
+ preserve_linebreaks = false,
+ preserve_br = false,
+ preserve = [];
+
+ if ( ! html ) {
+ return '';
+ }
+
+ // Protect script and style tags.
+ if ( html.indexOf( '<script' ) !== -1 || html.indexOf( '<style' ) !== -1 ) {
+ html = html.replace( /<(script|style)[^>]*>[\s\S]*?<\/\1>/g, function( match ) {
+ preserve.push( match );
+ return '<wp-preserve>';
+ } );
+ }
+
+ // Protect pre tags.
+ if ( html.indexOf( '<pre' ) !== -1 ) {
+ preserve_linebreaks = true;
+ html = html.replace( /<pre[^>]*>[\s\S]+?<\/pre>/g, function( a ) {
+ a = a.replace( /<br ?\/?>(\r\n|\n)?/g, '<wp-line-break>' );
+ a = a.replace( /<\/?p( [^>]*)?>(\r\n|\n)?/g, '<wp-line-break>' );
+ return a.replace( /\r?\n/g, '<wp-line-break>' );
+ });
+ }
+
+ // Remove line breaks but keep <br> tags inside image captions.
+ if ( html.indexOf( '[caption' ) !== -1 ) {
+ preserve_br = true;
+ html = html.replace( /\[caption[\s\S]+?\[\/caption\]/g, function( a ) {
+ return a.replace( /<br([^>]*)>/g, '<wp-temp-br$1>' ).replace( /[\r\n\t]+/, '' );
+ });
+ }
+
+ // Normalize white space characters before and after block tags.
+ html = html.replace( new RegExp( '\\s*</(' + blocklist1 + ')>\\s*', 'g' ), '</$1>\n' );
+ html = html.replace( new RegExp( '\\s*<((?:' + blocklist1 + ')(?: [^>]*)?)>', 'g' ), '\n<$1>' );
+
+ // Mark </p> if it has any attributes.
+ html = html.replace( /(<p [^>]+>.*?)<\/p>/g, '$1</p#>' );
+
+ // Preserve the first <p> inside a <div>.
+ html = html.replace( /<div( [^>]*)?>\s*<p>/gi, '<div$1>\n\n' );
+
+ // Remove paragraph tags.
+ html = html.replace( /\s*<p>/gi, '' );
+ html = html.replace( /\s*<\/p>\s*/gi, '\n\n' );
+
+ // Normalize white space chars and remove multiple line breaks.
+ html = html.replace( /\n[\s\u00a0]+\n/g, '\n\n' );
+
+ // Replace <br> tags with line breaks.
+ html = html.replace( /(\s*)<br ?\/?>\s*/gi, function( match, space ) {
+ if ( space && space.indexOf( '\n' ) !== -1 ) {
+ return '\n\n';
+ }
+
+ return '\n';
+ });
+
+ // Fix line breaks around <div>.
+ html = html.replace( /\s*<div/g, '\n<div' );
+ html = html.replace( /<\/div>\s*/g, '</div>\n' );
+
+ // Fix line breaks around caption shortcodes.
+ html = html.replace( /\s*\[caption([^\[]+)\[\/caption\]\s*/gi, '\n\n[caption$1[/caption]\n\n' );
+ html = html.replace( /caption\]\n\n+\[caption/g, 'caption]\n\n[caption' );
+
+ // Pad block elements tags with a line break.
+ html = html.replace( new RegExp('\\s*<((?:' + blocklist2 + ')(?: [^>]*)?)\\s*>', 'g' ), '\n<$1>' );
+ html = html.replace( new RegExp('\\s*</(' + blocklist2 + ')>\\s*', 'g' ), '</$1>\n' );
+
+ // Indent <li>, <dt> and <dd> tags.
+ html = html.replace( /<((li|dt|dd)[^>]*)>/g, ' \t<$1>' );
+
+ // Fix line breaks around <select> and <option>.
+ if ( html.indexOf( '<option' ) !== -1 ) {
+ html = html.replace( /\s*<option/g, '\n<option' );
+ html = html.replace( /\s*<\/select>/g, '\n</select>' );
+ }
+
+ // Pad <hr> with two line breaks.
+ if ( html.indexOf( '<hr' ) !== -1 ) {
+ html = html.replace( /\s*<hr( [^>]*)?>\s*/g, '\n\n<hr$1>\n\n' );
+ }
+
+ // Remove line breaks in <object> tags.
+ if ( html.indexOf( '<object' ) !== -1 ) {
+ html = html.replace( /<object[\s\S]+?<\/object>/g, function( a ) {
+ return a.replace( /[\r\n]+/g, '' );
+ });
+ }
+
+ // Unmark special paragraph closing tags.
+ html = html.replace( /<\/p#>/g, '</p>\n' );
+
+ // Pad remaining <p> tags whit a line break.
+ html = html.replace( /\s*(<p [^>]+>[\s\S]*?<\/p>)/g, '\n$1' );
+
+ // Trim.
+ html = html.replace( /^\s+/, '' );
+ html = html.replace( /[\s\u00a0]+$/, '' );
+
+ if ( preserve_linebreaks ) {
+ html = html.replace( /<wp-line-break>/g, '\n' );
+ }
+
+ if ( preserve_br ) {
+ html = html.replace( /<wp-temp-br([^>]*)>/g, '<br$1>' );
+ }
+
+ // Restore preserved tags.
+ if ( preserve.length ) {
+ html = html.replace( /<wp-preserve>/g, function() {
+ return preserve.shift();
+ } );
+ }
+
+ return html;
+ }
+
+ /**
+ * Replaces two line breaks with a paragraph tag and one line break with a <br>.
+ *
+ * Similar to `wpautop()` in formatting.php.
+ *
+ * @since 2.5.0
+ *
+ * @memberof switchEditors
+ *
+ * @param {string} text The text input.
+ * @returns {string} The formatted text.
+ */
+ function autop( text ) {
+ var preserve_linebreaks = false,
+ preserve_br = false,
+ blocklist = 'table|thead|tfoot|caption|col|colgroup|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|pre' +
+ '|form|map|area|blockquote|address|math|style|p|h[1-6]|hr|fieldset|legend|section' +
+ '|article|aside|hgroup|header|footer|nav|figure|figcaption|details|menu|summary';
+
+ // Normalize line breaks.
+ text = text.replace( /\r\n|\r/g, '\n' );
+
+ // Remove line breaks from <object>.
+ if ( text.indexOf( '<object' ) !== -1 ) {
+ text = text.replace( /<object[\s\S]+?<\/object>/g, function( a ) {
+ return a.replace( /\n+/g, '' );
+ });
+ }
+
+ // Remove line breaks from tags.
+ text = text.replace( /<[^<>]+>/g, function( a ) {
+ return a.replace( /[\n\t ]+/g, ' ' );
+ });
+
+ // Preserve line breaks in <pre> and <script> tags.
+ if ( text.indexOf( '<pre' ) !== -1 || text.indexOf( '<script' ) !== -1 ) {
+ preserve_linebreaks = true;
+ text = text.replace( /<(pre|script)[^>]*>[\s\S]*?<\/\1>/g, function( a ) {
+ return a.replace( /\n/g, '<wp-line-break>' );
+ });
+ }
+
+ if ( text.indexOf( '<figcaption' ) !== -1 ) {
+ text = text.replace( /\s*(<figcaption[^>]*>)/g, '$1' );
+ text = text.replace( /<\/figcaption>\s*/g, '</figcaption>' );
+ }
+
+ // Keep <br> tags inside captions.
+ if ( text.indexOf( '[caption' ) !== -1 ) {
+ preserve_br = true;
+
+ text = text.replace( /\[caption[\s\S]+?\[\/caption\]/g, function( a ) {
+ a = a.replace( /<br([^>]*)>/g, '<wp-temp-br$1>' );
+
+ a = a.replace( /<[^<>]+>/g, function( b ) {
+ return b.replace( /[\n\t ]+/, ' ' );
+ });
+
+ return a.replace( /\s*\n\s*/g, '<wp-temp-br />' );
+ });
+ }
+
+ text = text + '\n\n';
+ text = text.replace( /<br \/>\s*<br \/>/gi, '\n\n' );
+
+ // Pad block tags with two line breaks.
+ text = text.replace( new RegExp( '(<(?:' + blocklist + ')(?: [^>]*)?>)', 'gi' ), '\n\n$1' );
+ text = text.replace( new RegExp( '(</(?:' + blocklist + ')>)', 'gi' ), '$1\n\n' );
+ text = text.replace( /<hr( [^>]*)?>/gi, '<hr$1>\n\n' );
+
+ // Remove white space chars around <option>.
+ text = text.replace( /\s*<option/gi, '<option' );
+ text = text.replace( /<\/option>\s*/gi, '</option>' );
+
+ // Normalize multiple line breaks and white space chars.
+ text = text.replace( /\n\s*\n+/g, '\n\n' );
+
+ // Convert two line breaks to a paragraph.
+ text = text.replace( /([\s\S]+?)\n\n/g, '<p>$1</p>\n' );
+
+ // Remove empty paragraphs.
+ text = text.replace( /<p>\s*?<\/p>/gi, '');
+
+ // Remove <p> tags that are around block tags.
+ text = text.replace( new RegExp( '<p>\\s*(</?(?:' + blocklist + ')(?: [^>]*)?>)\\s*</p>', 'gi' ), '$1' );
+ text = text.replace( /<p>(<li.+?)<\/p>/gi, '$1');
+
+ // Fix <p> in blockquotes.
+ text = text.replace( /<p>\s*<blockquote([^>]*)>/gi, '<blockquote$1><p>');
+ text = text.replace( /<\/blockquote>\s*<\/p>/gi, '</p></blockquote>');
+
+ // Remove <p> tags that are wrapped around block tags.
+ text = text.replace( new RegExp( '<p>\\s*(</?(?:' + blocklist + ')(?: [^>]*)?>)', 'gi' ), '$1' );
+ text = text.replace( new RegExp( '(</?(?:' + blocklist + ')(?: [^>]*)?>)\\s*</p>', 'gi' ), '$1' );
+
+ text = text.replace( /(<br[^>]*>)\s*\n/gi, '$1' );
+
+ // Add <br> tags.
+ text = text.replace( /\s*\n/g, '<br />\n');
+
+ // Remove <br> tags that are around block tags.
+ text = text.replace( new RegExp( '(</?(?:' + blocklist + ')[^>]*>)\\s*<br />', 'gi' ), '$1' );
+ text = text.replace( /<br \/>(\s*<\/?(?:p|li|div|dl|dd|dt|th|pre|td|ul|ol)>)/gi, '$1' );
+
+ // Remove <p> and <br> around captions.
+ text = text.replace( /(?:<p>|<br ?\/?>)*\s*\[caption([^\[]+)\[\/caption\]\s*(?:<\/p>|<br ?\/?>)*/gi, '[caption$1[/caption]' );
+
+ // Make sure there is <p> when there is </p> inside block tags that can contain other blocks.
+ text = text.replace( /(<(?:div|th|td|form|fieldset|dd)[^>]*>)(.*?)<\/p>/g, function( a, b, c ) {
+ if ( c.match( /<p( [^>]*)?>/ ) ) {
+ return a;
+ }
+
+ return b + '<p>' + c + '</p>';
+ });
+
+ // Restore the line breaks in <pre> and <script> tags.
+ if ( preserve_linebreaks ) {
+ text = text.replace( /<wp-line-break>/g, '\n' );
+ }
+
+ // Restore the <br> tags in captions.
+ if ( preserve_br ) {
+ text = text.replace( /<wp-temp-br([^>]*)>/g, '<br$1>' );
+ }
+
+ return text;
+ }
+
+ /**
+ * Fires custom jQuery events `beforePreWpautop` and `afterPreWpautop` when jQuery is available.
+ *
+ * @since 2.9.0
+ *
+ * @memberof switchEditors
+ *
+ * @param {String} html The content from the visual editor.
+ * @returns {String} the filtered content.
+ */
+ function pre_wpautop( html ) {
+ var obj = { o: exports, data: html, unfiltered: html };
+
+ if ( $ ) {
+ $( 'body' ).trigger( 'beforePreWpautop', [ obj ] );
+ }
+
+ obj.data = removep( obj.data );
+
+ if ( $ ) {
+ $( 'body' ).trigger( 'afterPreWpautop', [ obj ] );
+ }
+
+ return obj.data;
+ }
+
+ /**
+ * Fires custom jQuery events `beforeWpautop` and `afterWpautop` when jQuery is available.
+ *
+ * @since 2.9.0
+ *
+ * @memberof switchEditors
+ *
+ * @param {String} text The content from the text editor.
+ * @returns {String} filtered content.
+ */
+ function wpautop( text ) {
+ var obj = { o: exports, data: text, unfiltered: text };
+
+ if ( $ ) {
+ $( 'body' ).trigger( 'beforeWpautop', [ obj ] );
+ }
+
+ obj.data = autop( obj.data );
+
+ if ( $ ) {
+ $( 'body' ).trigger( 'afterWpautop', [ obj ] );
+ }
+
+ return obj.data;
+ }
+
+ if ( $ ) {
+ $( document ).ready( init );
+ } else if ( document.addEventListener ) {
+ document.addEventListener( 'DOMContentLoaded', init, false );
+ window.addEventListener( 'load', init, false );
+ } else if ( window.attachEvent ) {
+ window.attachEvent( 'onload', init );
+ document.attachEvent( 'onreadystatechange', function() {
+ if ( 'complete' === document.readyState ) {
+ init();
+ }
+ } );
+ }
+
+ wp.editor.autop = wpautop;
+ wp.editor.removep = pre_wpautop;
+
+ exports = {
+ go: switchEditor,
+ wpautop: wpautop,
+ pre_wpautop: pre_wpautop,
+ _wp_Autop: autop,
+ _wp_Nop: removep
+ };
+
+ return exports;
+ }
+
+ /**
+ * Expose the switch editors to be used globally.
+ *
+ * @namespace switchEditors
+ */
+ window.switchEditors = new SwitchEditors();
+
+ /**
+ * Initialize TinyMCE and/or Quicktags. For use with wp_enqueue_editor() (PHP).
+ *
+ * Intended for use with an existing textarea that will become the Text editor tab.
+ * The editor width will be the width of the textarea container, height will be adjustable.
+ *
+ * Settings for both TinyMCE and Quicktags can be passed on initialization, and are "filtered"
+ * with custom jQuery events on the document element, wp-before-tinymce-init and wp-before-quicktags-init.
+ *
+ * @since 4.8.0
+ *
+ * @param {string} id The HTML id of the textarea that is used for the editor.
+ * Has to be jQuery compliant. No brackets, special chars, etc.
+ * @param {object} settings Example:
+ * settings = {
+ * // See https://www.tinymce.com/docs/configure/integration-and-setup/.
+ * // Alternatively set to `true` to use the defaults.
+ * tinymce: {
+ * setup: function( editor ) {
+ * console.log( 'Editor initialized', editor );
+ * }
+ * }
+ *
+ * // Alternatively set to `true` to use the defaults.
+ * quicktags: {
+ * buttons: 'strong,em,link'
+ * }
+ * }
+ */
+ wp.editor.initialize = function( id, settings ) {
+ var init;
+ var defaults;
+
+ if ( ! $ || ! id || ! wp.editor.getDefaultSettings ) {
+ return;
+ }
+
+ defaults = wp.editor.getDefaultSettings();
+
+ // Initialize TinyMCE by default
+ if ( ! settings ) {
+ settings = {
+ tinymce: true
+ };
+ }
+
+ // Add wrap and the Visual|Text tabs.
+ if ( settings.tinymce && settings.quicktags ) {
+ var $textarea = $( '#' + id );
+
+ var $wrap = $( '<div>' ).attr( {
+ 'class': 'wp-core-ui wp-editor-wrap tmce-active',
+ id: 'wp-' + id + '-wrap'
+ } );
+
+ var $editorContainer = $( '<div class="wp-editor-container">' );
+
+ var $button = $( '<button>' ).attr( {
+ type: 'button',
+ 'data-wp-editor-id': id
+ } );
+
+ var $editorTools = $( '<div class="wp-editor-tools">' );
+
+ if ( settings.mediaButtons ) {
+ var buttonText = 'Add Media';
+
+ if ( window._wpMediaViewsL10n && window._wpMediaViewsL10n.addMedia ) {
+ buttonText = window._wpMediaViewsL10n.addMedia;
+ }
+
+ var $addMediaButton = $( '<button type="button" class="button insert-media add_media">' );
+
+ $addMediaButton.append( '<span class="wp-media-buttons-icon"></span>' );
+ $addMediaButton.append( document.createTextNode( ' ' + buttonText ) );
+ $addMediaButton.data( 'editor', id );
+
+ $editorTools.append(
+ $( '<div class="wp-media-buttons">' )
+ .append( $addMediaButton )
+ );
+ }
+
+ $wrap.append(
+ $editorTools
+ .append( $( '<div class="wp-editor-tabs">' )
+ .append( $button.clone().attr({
+ id: id + '-tmce',
+ 'class': 'wp-switch-editor switch-tmce'
+ }).text( window.tinymce.translate( 'Visual' ) ) )
+ .append( $button.attr({
+ id: id + '-html',
+ 'class': 'wp-switch-editor switch-html'
+ }).text( window.tinymce.translate( 'Text' ) ) )
+ ).append( $editorContainer )
+ );
+
+ $textarea.after( $wrap );
+ $editorContainer.append( $textarea );
+ }
+
+ if ( window.tinymce && settings.tinymce ) {
+ if ( typeof settings.tinymce !== 'object' ) {
+ settings.tinymce = {};
+ }
+
+ init = $.extend( {}, defaults.tinymce, settings.tinymce );
+ init.selector = '#' + id;
+
+ $( document ).trigger( 'wp-before-tinymce-init', init );
+ window.tinymce.init( init );
+
+ if ( ! window.wpActiveEditor ) {
+ window.wpActiveEditor = id;
+ }
+ }
+
+ if ( window.quicktags && settings.quicktags ) {
+ if ( typeof settings.quicktags !== 'object' ) {
+ settings.quicktags = {};
+ }
+
+ init = $.extend( {}, defaults.quicktags, settings.quicktags );
+ init.id = id;
+
+ $( document ).trigger( 'wp-before-quicktags-init', init );
+ window.quicktags( init );
+
+ if ( ! window.wpActiveEditor ) {
+ window.wpActiveEditor = init.id;
+ }
+ }
+ };
+
+ /**
+ * Remove one editor instance.
+ *
+ * Intended for use with editors that were initialized with wp.editor.initialize().
+ *
+ * @since 4.8.0
+ *
+ * @param {string} id The HTML id of the editor textarea.
+ */
+ wp.editor.remove = function( id ) {
+ var mceInstance, qtInstance,
+ $wrap = $( '#wp-' + id + '-wrap' );
+
+ if ( window.tinymce ) {
+ mceInstance = window.tinymce.get( id );
+
+ if ( mceInstance ) {
+ if ( ! mceInstance.isHidden() ) {
+ mceInstance.save();
+ }
+
+ mceInstance.remove();
+ }
+ }
+
+ if ( window.quicktags ) {
+ qtInstance = window.QTags.getInstance( id );
+
+ if ( qtInstance ) {
+ qtInstance.remove();
+ }
+ }
+
+ if ( $wrap.length ) {
+ $wrap.after( $( '#' + id ) );
+ $wrap.remove();
+ }
+ };
+
+ /**
+ * Get the editor content.
+ *
+ * Intended for use with editors that were initialized with wp.editor.initialize().
+ *
+ * @since 4.8.0
+ *
+ * @param {string} id The HTML id of the editor textarea.
+ * @return The editor content.
+ */
+ wp.editor.getContent = function( id ) {
+ var editor;
+
+ if ( ! $ || ! id ) {
+ return;
+ }
+
+ if ( window.tinymce ) {
+ editor = window.tinymce.get( id );
+
+ if ( editor && ! editor.isHidden() ) {
+ editor.save();
+ }
+ }
+
+ return $( '#' + id ).val();
+ };
+
+}( window.jQuery, window.wp ));
diff --git a/www/crm/wp-admin/js/editor.min.js b/www/crm/wp-admin/js/editor.min.js
new file mode 100644
index 00000000..d80a38d0
--- /dev/null
+++ b/www/crm/wp-admin/js/editor.min.js
@@ -0,0 +1 @@
+window.wp=window.wp||{},function(a,b){function c(){function c(){!w&&window.tinymce&&(w=window.tinymce,x=w.$,x(document).on("click",function(a){var b,c,d=x(a.target);d.hasClass("wp-switch-editor")&&(b=d.attr("data-wp-editor-id"),c=d.hasClass("switch-tmce")?"tmce":"html",e(b,c))}))}function d(a){var b=x(".mce-toolbar-grp",a.getContainer())[0],c=b&&b.clientHeight;return c&&c>10&&c<200?parseInt(c,10):30}function e(a,b){a=a||"content",b=b||"toggle";var c,e,f,g=w.get(a),h=x("#wp-"+a+"-wrap"),i=x("#"+a),j=i[0];if("toggle"===b&&(b=g&&!g.isHidden()?"html":"tmce"),"tmce"===b||"tinymce"===b){if(g&&!g.isHidden())return!1;"undefined"!=typeof window.QTags&&window.QTags.closeAllTags(a),c=parseInt(j.style.height,10)||0;var k=!1;k=g?g.getParam("wp_keep_scroll_position"):window.tinyMCEPreInit.mceInit[a]&&window.tinyMCEPreInit.mceInit[a].wp_keep_scroll_position,k&&l(i),g?(g.show(),!w.Env.iOS&&c&&(e=d(g),c=c-e+14,c>50&&c<5e3&&g.theme.resizeTo(null,c)),g.getParam("wp_keep_scroll_position")&&m(g)):w.init(window.tinyMCEPreInit.mceInit[a]),h.removeClass("html-active").addClass("tmce-active"),i.attr("aria-hidden",!0),window.setUserSetting("editor","tinymce")}else if("html"===b){if(g&&g.isHidden())return!1;if(g){w.Env.iOS||(f=g.iframeElement,c=f?parseInt(f.style.height,10):0,c&&(e=d(g),c=c+e-14,c>50&&c<5e3&&(j.style.height=c+"px")));var n=null;g.getParam("wp_keep_scroll_position")&&(n=q(g)),g.hide(),n&&r(g,n)}else i.css({display:"",visibility:""});h.removeClass("tmce-active").addClass("html-active"),i.attr("aria-hidden",!1),window.setUserSetting("editor","html")}}function f(a,b){var c=a.lastIndexOf("<",b-1),d=a.lastIndexOf(">",b);if(c>d||">"===a.substr(b,1)){var e=a.substr(c),f=e.match(/<\s*(\/)?(\w+|\!-{2}.*-{2})/);if(!f)return null;var g=f[2],h=e.indexOf(">");return{ltPos:c,gtPos:c+h+1,tagType:g,isClosingTag:!!f[1]}}return null}function g(a,b){for(var c=i(a),d=0;d<c.length;d++){var e=c[d];if(b>=e.startIndex&&b<=e.endIndex)return e}}function h(a){var b=a.match(/\[+([\w_-])+/g),c=[];if(b)for(var d=0;d<b.length;d++){var e=b[d].replace(/^\[+/g,"");c.indexOf(e)===-1&&c.push(e)}return c}function i(a){var c,d=h(a);if(0===d.length)return[];for(var e,f=b.shortcode.regexp(d.join("|")),g=[];e=f.exec(a);){var i="["===e[1];c={shortcodeName:e[2],showAsPlainText:i,startIndex:e.index,endIndex:e.index+e[0].length,length:e[0].length},g.push(c)}for(var j=new RegExp('(^|[\\n\\r][\\n\\r]|<p>)(https?:\\/\\/[^s"]+?)(<\\/p>s*|[\\n\\r][\\n\\r]|$)',"gi");e=j.exec(a);)c={shortcodeName:"url",showAsPlainText:!1,startIndex:e.index,endIndex:e.index+e[0].length,length:e[0].length,urlAtStartOfContent:""===e[1],urlAtEndOfContent:""===e[3]},g.push(c);return g}function j(a,b){return a("<span>").css({display:"inline-block",width:0,overflow:"hidden","line-height":0}).html(b?b:"")}function k(a,b){var c=["area","base","br","col","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],d=b.cursorStart,e=b.cursorEnd,h=f(a,d);h&&(d=c.indexOf(h.tagType)!==-1?h.ltPos:h.gtPos);var i=f(a,e);i&&(e=i.gtPos);var j=g(a,d);j&&!j.showAsPlainText&&(d=j.urlAtStartOfContent?j.endIndex:j.startIndex);var k=g(a,e);return k&&!k.showAsPlainText&&(e=k.urlAtEndOfContent?k.startIndex:k.endIndex),{cursorStart:d,cursorEnd:e}}function l(a){if(a&&a.length){var b=a[0],c=b.value,d=k(c,{cursorStart:b.selectionStart,cursorEnd:b.selectionEnd}),e=d.cursorStart,f=d.cursorEnd,g=e!==f?"range":"single",h=null,i=j(x,"&#65279;").attr("data-mce-type","bookmark");if("range"===g){var l=b.value.slice(e,f),m=i.clone().addClass("mce_SELRES_end");h=[l,m[0].outerHTML].join("")}b.value=[b.value.slice(0,e),i.clone().addClass("mce_SELRES_start")[0].outerHTML,h,b.value.slice(f)].join("")}}function m(a){var b=a.$(".mce_SELRES_start").attr("data-mce-bogus",1),c=a.$(".mce_SELRES_end").attr("data-mce-bogus",1);if(b.length)if(a.focus(),c.length){var d=a.getDoc().createRange();d.setStartAfter(b[0]),d.setEndBefore(c[0]),a.selection.setRng(d)}else a.selection.select(b[0]);a.getParam("wp_keep_scroll_position")&&o(a,b),n(b),n(c),a.save()}function n(a){var b=a.parent();a.remove(),!b.is("p")||b.children().length||b.text()||b.remove()}function o(b,c){var e,f=b.$(c).offset().top,g=b.$(b.getContentAreaContainer()).offset().top,h=d(b),i=a("#wp-content-editor-tools"),j=0,k=0;i.length&&(j=i.height(),k=i.offset().top);var l=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,m=g+f,n=l-(j+h);if(!(m<n)){var o;b.settings.wp_autoresize_on?(e=a("html,body"),o=Math.max(m-n/2,k-j)):(e=a(b.contentDocument).find("html,body"),o=f),e.animate({scrollTop:parseInt(o,10)},100)}}function p(a){a.content=a.content.replace(/<p>(?:<br ?\/?>|\u00a0|\uFEFF| )*<\/p>/g,"<p>&nbsp;</p>")}function q(a){var b=a.getWin(),c=b.getSelection();if(c&&!(c.rangeCount<1)){var d="SELRES_"+Math.random(),e=j(a.$,d),f=e.clone().addClass("mce_SELRES_start"),g=e.clone().addClass("mce_SELRES_end"),h=c.getRangeAt(0),i=h.startContainer,k=h.startOffset,l=h.cloneRange();a.$(i).parents(".mce-offscreen-selection").length>0?(i=a.$("[data-mce-selected]")[0],f.attr("data-mce-object-selection","true"),g.attr("data-mce-object-selection","true"),a.$(i).before(f[0]),a.$(i).after(g[0])):(l.collapse(!1),l.insertNode(g[0]),l.setStart(i,k),l.collapse(!0),l.insertNode(f[0]),h.setStartAfter(f[0]),h.setEndBefore(g[0]),c.removeAllRanges(),c.addRange(h)),a.on("GetContent",p);var m=s(a.getContent());a.off("GetContent",p),f.remove(),g.remove();var n=new RegExp('<span[^>]*\\s*class="mce_SELRES_start"[^>]+>\\s*'+d+"[^<]*<\\/span>(\\s*)"),o=new RegExp('(\\s*)<span[^>]*\\s*class="mce_SELRES_end"[^>]+>\\s*'+d+"[^<]*<\\/span>"),q=m.match(n),r=m.match(o);if(!q)return null;var t=q.index,u=q[0].length,v=null;if(r){q[0].indexOf("data-mce-object-selection")!==-1&&(u-=q[1].length);var w=r.index;r[0].indexOf("data-mce-object-selection")!==-1&&(w-=r[1].length),v=w-u}return{start:t,end:v}}}function r(a,b){if(b){var c=a.getElement(),d=b.start,e=b.end||b.start;c.focus&&setTimeout(function(){c.setSelectionRange(d,e),c.blur&&c.blur(),c.focus()},100)}}function s(a){var b="blockquote|ul|ol|li|dl|dt|dd|table|thead|tbody|tfoot|tr|th|td|h[1-6]|fieldset|figure",c=b+"|div|p",d=b+"|pre",e=!1,f=!1,g=[];return a?(a.indexOf("<script")===-1&&a.indexOf("<style")===-1||(a=a.replace(/<(script|style)[^>]*>[\s\S]*?<\/\1>/g,function(a){return g.push(a),"<wp-preserve>"})),a.indexOf("<pre")!==-1&&(e=!0,a=a.replace(/<pre[^>]*>[\s\S]+?<\/pre>/g,function(a){return a=a.replace(/<br ?\/?>(\r\n|\n)?/g,"<wp-line-break>"),a=a.replace(/<\/?p( [^>]*)?>(\r\n|\n)?/g,"<wp-line-break>"),a.replace(/\r?\n/g,"<wp-line-break>")})),a.indexOf("[caption")!==-1&&(f=!0,a=a.replace(/\[caption[\s\S]+?\[\/caption\]/g,function(a){return a.replace(/<br([^>]*)>/g,"<wp-temp-br$1>").replace(/[\r\n\t]+/,"")})),a=a.replace(new RegExp("\\s*</("+c+")>\\s*","g"),"</$1>\n"),a=a.replace(new RegExp("\\s*<((?:"+c+")(?: [^>]*)?)>","g"),"\n<$1>"),a=a.replace(/(<p [^>]+>.*?)<\/p>/g,"$1</p#>"),a=a.replace(/<div( [^>]*)?>\s*<p>/gi,"<div$1>\n\n"),a=a.replace(/\s*<p>/gi,""),a=a.replace(/\s*<\/p>\s*/gi,"\n\n"),a=a.replace(/\n[\s\u00a0]+\n/g,"\n\n"),a=a.replace(/(\s*)<br ?\/?>\s*/gi,function(a,b){return b&&b.indexOf("\n")!==-1?"\n\n":"\n"}),a=a.replace(/\s*<div/g,"\n<div"),a=a.replace(/<\/div>\s*/g,"</div>\n"),a=a.replace(/\s*\[caption([^\[]+)\[\/caption\]\s*/gi,"\n\n[caption$1[/caption]\n\n"),a=a.replace(/caption\]\n\n+\[caption/g,"caption]\n\n[caption"),a=a.replace(new RegExp("\\s*<((?:"+d+")(?: [^>]*)?)\\s*>","g"),"\n<$1>"),a=a.replace(new RegExp("\\s*</("+d+")>\\s*","g"),"</$1>\n"),a=a.replace(/<((li|dt|dd)[^>]*)>/g," \t<$1>"),a.indexOf("<option")!==-1&&(a=a.replace(/\s*<option/g,"\n<option"),a=a.replace(/\s*<\/select>/g,"\n</select>")),a.indexOf("<hr")!==-1&&(a=a.replace(/\s*<hr( [^>]*)?>\s*/g,"\n\n<hr$1>\n\n")),a.indexOf("<object")!==-1&&(a=a.replace(/<object[\s\S]+?<\/object>/g,function(a){return a.replace(/[\r\n]+/g,"")})),a=a.replace(/<\/p#>/g,"</p>\n"),a=a.replace(/\s*(<p [^>]+>[\s\S]*?<\/p>)/g,"\n$1"),a=a.replace(/^\s+/,""),a=a.replace(/[\s\u00a0]+$/,""),e&&(a=a.replace(/<wp-line-break>/g,"\n")),f&&(a=a.replace(/<wp-temp-br([^>]*)>/g,"<br$1>")),g.length&&(a=a.replace(/<wp-preserve>/g,function(){return g.shift()})),a):""}function t(a){var b=!1,c=!1,d="table|thead|tfoot|caption|col|colgroup|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|pre|form|map|area|blockquote|address|math|style|p|h[1-6]|hr|fieldset|legend|section|article|aside|hgroup|header|footer|nav|figure|figcaption|details|menu|summary";return a=a.replace(/\r\n|\r/g,"\n"),a.indexOf("<object")!==-1&&(a=a.replace(/<object[\s\S]+?<\/object>/g,function(a){return a.replace(/\n+/g,"")})),a=a.replace(/<[^<>]+>/g,function(a){return a.replace(/[\n\t ]+/g," ")}),a.indexOf("<pre")===-1&&a.indexOf("<script")===-1||(b=!0,a=a.replace(/<(pre|script)[^>]*>[\s\S]*?<\/\1>/g,function(a){return a.replace(/\n/g,"<wp-line-break>")})),a.indexOf("<figcaption")!==-1&&(a=a.replace(/\s*(<figcaption[^>]*>)/g,"$1"),a=a.replace(/<\/figcaption>\s*/g,"</figcaption>")),a.indexOf("[caption")!==-1&&(c=!0,a=a.replace(/\[caption[\s\S]+?\[\/caption\]/g,function(a){return a=a.replace(/<br([^>]*)>/g,"<wp-temp-br$1>"),a=a.replace(/<[^<>]+>/g,function(a){return a.replace(/[\n\t ]+/," ")}),a.replace(/\s*\n\s*/g,"<wp-temp-br />")})),a+="\n\n",a=a.replace(/<br \/>\s*<br \/>/gi,"\n\n"),a=a.replace(new RegExp("(<(?:"+d+")(?: [^>]*)?>)","gi"),"\n\n$1"),a=a.replace(new RegExp("(</(?:"+d+")>)","gi"),"$1\n\n"),a=a.replace(/<hr( [^>]*)?>/gi,"<hr$1>\n\n"),a=a.replace(/\s*<option/gi,"<option"),a=a.replace(/<\/option>\s*/gi,"</option>"),a=a.replace(/\n\s*\n+/g,"\n\n"),a=a.replace(/([\s\S]+?)\n\n/g,"<p>$1</p>\n"),a=a.replace(/<p>\s*?<\/p>/gi,""),a=a.replace(new RegExp("<p>\\s*(</?(?:"+d+")(?: [^>]*)?>)\\s*</p>","gi"),"$1"),a=a.replace(/<p>(<li.+?)<\/p>/gi,"$1"),a=a.replace(/<p>\s*<blockquote([^>]*)>/gi,"<blockquote$1><p>"),a=a.replace(/<\/blockquote>\s*<\/p>/gi,"</p></blockquote>"),a=a.replace(new RegExp("<p>\\s*(</?(?:"+d+")(?: [^>]*)?>)","gi"),"$1"),a=a.replace(new RegExp("(</?(?:"+d+")(?: [^>]*)?>)\\s*</p>","gi"),"$1"),a=a.replace(/(<br[^>]*>)\s*\n/gi,"$1"),a=a.replace(/\s*\n/g,"<br />\n"),a=a.replace(new RegExp("(</?(?:"+d+")[^>]*>)\\s*<br />","gi"),"$1"),a=a.replace(/<br \/>(\s*<\/?(?:p|li|div|dl|dd|dt|th|pre|td|ul|ol)>)/gi,"$1"),a=a.replace(/(?:<p>|<br ?\/?>)*\s*\[caption([^\[]+)\[\/caption\]\s*(?:<\/p>|<br ?\/?>)*/gi,"[caption$1[/caption]"),a=a.replace(/(<(?:div|th|td|form|fieldset|dd)[^>]*>)(.*?)<\/p>/g,function(a,b,c){return c.match(/<p( [^>]*)?>/)?a:b+"<p>"+c+"</p>"}),b&&(a=a.replace(/<wp-line-break>/g,"\n")),c&&(a=a.replace(/<wp-temp-br([^>]*)>/g,"<br$1>")),a}function u(b){var c={o:y,data:b,unfiltered:b};return a&&a("body").trigger("beforePreWpautop",[c]),c.data=s(c.data),a&&a("body").trigger("afterPreWpautop",[c]),c.data}function v(b){var c={o:y,data:b,unfiltered:b};return a&&a("body").trigger("beforeWpautop",[c]),c.data=t(c.data),a&&a("body").trigger("afterWpautop",[c]),c.data}var w,x,y={};return a(document).on("tinymce-editor-init.keep-scroll-position",function(a,b){b.$(".mce_SELRES_start").length&&m(b)}),a?a(document).ready(c):document.addEventListener?(document.addEventListener("DOMContentLoaded",c,!1),window.addEventListener("load",c,!1)):window.attachEvent&&(window.attachEvent("onload",c),document.attachEvent("onreadystatechange",function(){"complete"===document.readyState&&c()})),b.editor.autop=v,b.editor.removep=u,y={go:e,wpautop:v,pre_wpautop:u,_wp_Autop:t,_wp_Nop:s}}b.editor=b.editor||{},window.switchEditors=new c,b.editor.initialize=function(c,d){var e,f;if(a&&c&&b.editor.getDefaultSettings){if(f=b.editor.getDefaultSettings(),d||(d={tinymce:!0}),d.tinymce&&d.quicktags){var g=a("#"+c),h=a("<div>").attr({"class":"wp-core-ui wp-editor-wrap tmce-active",id:"wp-"+c+"-wrap"}),i=a('<div class="wp-editor-container">'),j=a("<button>").attr({type:"button","data-wp-editor-id":c}),k=a('<div class="wp-editor-tools">');if(d.mediaButtons){var l="Add Media";window._wpMediaViewsL10n&&window._wpMediaViewsL10n.addMedia&&(l=window._wpMediaViewsL10n.addMedia);var m=a('<button type="button" class="button insert-media add_media">');m.append('<span class="wp-media-buttons-icon"></span>'),m.append(document.createTextNode(" "+l)),m.data("editor",c),k.append(a('<div class="wp-media-buttons">').append(m))}h.append(k.append(a('<div class="wp-editor-tabs">').append(j.clone().attr({id:c+"-tmce","class":"wp-switch-editor switch-tmce"}).text(window.tinymce.translate("Visual"))).append(j.attr({id:c+"-html","class":"wp-switch-editor switch-html"}).text(window.tinymce.translate("Text")))).append(i)),g.after(h),i.append(g)}window.tinymce&&d.tinymce&&("object"!=typeof d.tinymce&&(d.tinymce={}),e=a.extend({},f.tinymce,d.tinymce),e.selector="#"+c,a(document).trigger("wp-before-tinymce-init",e),window.tinymce.init(e),window.wpActiveEditor||(window.wpActiveEditor=c)),window.quicktags&&d.quicktags&&("object"!=typeof d.quicktags&&(d.quicktags={}),e=a.extend({},f.quicktags,d.quicktags),e.id=c,a(document).trigger("wp-before-quicktags-init",e),window.quicktags(e),window.wpActiveEditor||(window.wpActiveEditor=e.id))}},b.editor.remove=function(b){var c,d,e=a("#wp-"+b+"-wrap");window.tinymce&&(c=window.tinymce.get(b),c&&(c.isHidden()||c.save(),c.remove())),window.quicktags&&(d=window.QTags.getInstance(b),d&&d.remove()),e.length&&(e.after(a("#"+b)),e.remove())},b.editor.getContent=function(b){var c;if(a&&b)return window.tinymce&&(c=window.tinymce.get(b),c&&!c.isHidden()&&c.save()),a("#"+b).val()}}(window.jQuery,window.wp); \ No newline at end of file
diff --git a/www/crm/wp-admin/js/farbtastic.js b/www/crm/wp-admin/js/farbtastic.js
new file mode 100644
index 00000000..5404fb6e
--- /dev/null
+++ b/www/crm/wp-admin/js/farbtastic.js
@@ -0,0 +1,276 @@
+/*!
+ * Farbtastic: jQuery color picker plug-in v1.3u
+ *
+ * Licensed under the GPL license:
+ * http://www.gnu.org/licenses/gpl.html
+ */
+(function($) {
+
+$.fn.farbtastic = function (options) {
+ $.farbtastic(this, options);
+ return this;
+};
+
+$.farbtastic = function (container, callback) {
+ var container = $(container).get(0);
+ return container.farbtastic || (container.farbtastic = new $._farbtastic(container, callback));
+};
+
+$._farbtastic = function (container, callback) {
+ // Store farbtastic object
+ var fb = this;
+
+ // Insert markup
+ $(container).html('<div class="farbtastic"><div class="color"></div><div class="wheel"></div><div class="overlay"></div><div class="h-marker marker"></div><div class="sl-marker marker"></div></div>');
+ var e = $('.farbtastic', container);
+ fb.wheel = $('.wheel', container).get(0);
+ // Dimensions
+ fb.radius = 84;
+ fb.square = 100;
+ fb.width = 194;
+
+ // Fix background PNGs in IE6
+ if (navigator.appVersion.match(/MSIE [0-6]\./)) {
+ $('*', e).each(function () {
+ if (this.currentStyle.backgroundImage != 'none') {
+ var image = this.currentStyle.backgroundImage;
+ image = this.currentStyle.backgroundImage.substring(5, image.length - 2);
+ $(this).css({
+ 'backgroundImage': 'none',
+ 'filter': "progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true, sizingMethod=crop, src='" + image + "')"
+ });
+ }
+ });
+ }
+
+ /**
+ * Link to the given element(s) or callback.
+ */
+ fb.linkTo = function (callback) {
+ // Unbind previous nodes
+ if (typeof fb.callback == 'object') {
+ $(fb.callback).unbind('keyup', fb.updateValue);
+ }
+
+ // Reset color
+ fb.color = null;
+
+ // Bind callback or elements
+ if (typeof callback == 'function') {
+ fb.callback = callback;
+ }
+ else if (typeof callback == 'object' || typeof callback == 'string') {
+ fb.callback = $(callback);
+ fb.callback.bind('keyup', fb.updateValue);
+ if (fb.callback.get(0).value) {
+ fb.setColor(fb.callback.get(0).value);
+ }
+ }
+ return this;
+ };
+ fb.updateValue = function (event) {
+ if (this.value && this.value != fb.color) {
+ fb.setColor(this.value);
+ }
+ };
+
+ /**
+ * Change color with HTML syntax #123456
+ */
+ fb.setColor = function (color) {
+ var unpack = fb.unpack(color);
+ if (fb.color != color && unpack) {
+ fb.color = color;
+ fb.rgb = unpack;
+ fb.hsl = fb.RGBToHSL(fb.rgb);
+ fb.updateDisplay();
+ }
+ return this;
+ };
+
+ /**
+ * Change color with HSL triplet [0..1, 0..1, 0..1]
+ */
+ fb.setHSL = function (hsl) {
+ fb.hsl = hsl;
+ fb.rgb = fb.HSLToRGB(hsl);
+ fb.color = fb.pack(fb.rgb);
+ fb.updateDisplay();
+ return this;
+ };
+
+ /////////////////////////////////////////////////////
+
+ /**
+ * Retrieve the coordinates of the given event relative to the center
+ * of the widget.
+ */
+ fb.widgetCoords = function (event) {
+ var offset = $(fb.wheel).offset();
+ return { x: (event.pageX - offset.left) - fb.width / 2, y: (event.pageY - offset.top) - fb.width / 2 };
+ };
+
+ /**
+ * Mousedown handler
+ */
+ fb.mousedown = function (event) {
+ // Capture mouse
+ if (!document.dragging) {
+ $(document).bind('mousemove', fb.mousemove).bind('mouseup', fb.mouseup);
+ document.dragging = true;
+ }
+
+ // Check which area is being dragged
+ var pos = fb.widgetCoords(event);
+ fb.circleDrag = Math.max(Math.abs(pos.x), Math.abs(pos.y)) * 2 > fb.square;
+
+ // Process
+ fb.mousemove(event);
+ return false;
+ };
+
+ /**
+ * Mousemove handler
+ */
+ fb.mousemove = function (event) {
+ // Get coordinates relative to color picker center
+ var pos = fb.widgetCoords(event);
+
+ // Set new HSL parameters
+ if (fb.circleDrag) {
+ var hue = Math.atan2(pos.x, -pos.y) / 6.28;
+ if (hue < 0) hue += 1;
+ fb.setHSL([hue, fb.hsl[1], fb.hsl[2]]);
+ }
+ else {
+ var sat = Math.max(0, Math.min(1, -(pos.x / fb.square) + .5));
+ var lum = Math.max(0, Math.min(1, -(pos.y / fb.square) + .5));
+ fb.setHSL([fb.hsl[0], sat, lum]);
+ }
+ return false;
+ };
+
+ /**
+ * Mouseup handler
+ */
+ fb.mouseup = function () {
+ // Uncapture mouse
+ $(document).unbind('mousemove', fb.mousemove);
+ $(document).unbind('mouseup', fb.mouseup);
+ document.dragging = false;
+ };
+
+ /**
+ * Update the markers and styles
+ */
+ fb.updateDisplay = function () {
+ // Markers
+ var angle = fb.hsl[0] * 6.28;
+ $('.h-marker', e).css({
+ left: Math.round(Math.sin(angle) * fb.radius + fb.width / 2) + 'px',
+ top: Math.round(-Math.cos(angle) * fb.radius + fb.width / 2) + 'px'
+ });
+
+ $('.sl-marker', e).css({
+ left: Math.round(fb.square * (.5 - fb.hsl[1]) + fb.width / 2) + 'px',
+ top: Math.round(fb.square * (.5 - fb.hsl[2]) + fb.width / 2) + 'px'
+ });
+
+ // Saturation/Luminance gradient
+ $('.color', e).css('backgroundColor', fb.pack(fb.HSLToRGB([fb.hsl[0], 1, 0.5])));
+
+ // Linked elements or callback
+ if (typeof fb.callback == 'object') {
+ // Set background/foreground color
+ $(fb.callback).css({
+ backgroundColor: fb.color,
+ color: fb.hsl[2] > 0.5 ? '#000' : '#fff'
+ });
+
+ // Change linked value
+ $(fb.callback).each(function() {
+ if (this.value && this.value != fb.color) {
+ this.value = fb.color;
+ }
+ });
+ }
+ else if (typeof fb.callback == 'function') {
+ fb.callback.call(fb, fb.color);
+ }
+ };
+
+ /* Various color utility functions */
+ fb.pack = function (rgb) {
+ var r = Math.round(rgb[0] * 255);
+ var g = Math.round(rgb[1] * 255);
+ var b = Math.round(rgb[2] * 255);
+ return '#' + (r < 16 ? '0' : '') + r.toString(16) +
+ (g < 16 ? '0' : '') + g.toString(16) +
+ (b < 16 ? '0' : '') + b.toString(16);
+ };
+
+ fb.unpack = function (color) {
+ if (color.length == 7) {
+ return [parseInt('0x' + color.substring(1, 3)) / 255,
+ parseInt('0x' + color.substring(3, 5)) / 255,
+ parseInt('0x' + color.substring(5, 7)) / 255];
+ }
+ else if (color.length == 4) {
+ return [parseInt('0x' + color.substring(1, 2)) / 15,
+ parseInt('0x' + color.substring(2, 3)) / 15,
+ parseInt('0x' + color.substring(3, 4)) / 15];
+ }
+ };
+
+ fb.HSLToRGB = function (hsl) {
+ var m1, m2, r, g, b;
+ var h = hsl[0], s = hsl[1], l = hsl[2];
+ m2 = (l <= 0.5) ? l * (s + 1) : l + s - l*s;
+ m1 = l * 2 - m2;
+ return [this.hueToRGB(m1, m2, h+0.33333),
+ this.hueToRGB(m1, m2, h),
+ this.hueToRGB(m1, m2, h-0.33333)];
+ };
+
+ fb.hueToRGB = function (m1, m2, h) {
+ h = (h < 0) ? h + 1 : ((h > 1) ? h - 1 : h);
+ if (h * 6 < 1) return m1 + (m2 - m1) * h * 6;
+ if (h * 2 < 1) return m2;
+ if (h * 3 < 2) return m1 + (m2 - m1) * (0.66666 - h) * 6;
+ return m1;
+ };
+
+ fb.RGBToHSL = function (rgb) {
+ var min, max, delta, h, s, l;
+ var r = rgb[0], g = rgb[1], b = rgb[2];
+ min = Math.min(r, Math.min(g, b));
+ max = Math.max(r, Math.max(g, b));
+ delta = max - min;
+ l = (min + max) / 2;
+ s = 0;
+ if (l > 0 && l < 1) {
+ s = delta / (l < 0.5 ? (2 * l) : (2 - 2 * l));
+ }
+ h = 0;
+ if (delta > 0) {
+ if (max == r && max != g) h += (g - b) / delta;
+ if (max == g && max != b) h += (2 + (b - r) / delta);
+ if (max == b && max != r) h += (4 + (r - g) / delta);
+ h /= 6;
+ }
+ return [h, s, l];
+ };
+
+ // Install mousedown handler (the others are set on the document on-demand)
+ $('*', e).mousedown(fb.mousedown);
+
+ // Init color
+ fb.setColor('#000000');
+
+ // Set linked elements/callback
+ if (callback) {
+ fb.linkTo(callback);
+ }
+};
+
+})(jQuery); \ No newline at end of file
diff --git a/www/crm/wp-admin/js/gallery.js b/www/crm/wp-admin/js/gallery.js
new file mode 100644
index 00000000..36cb0863
--- /dev/null
+++ b/www/crm/wp-admin/js/gallery.js
@@ -0,0 +1,241 @@
+/**
+ * @output wp-admin/js/gallery.js
+ */
+
+/* global unescape, getUserSetting, setUserSetting, wpgallery, tinymce */
+
+jQuery(document).ready(function($) {
+ var gallerySortable, gallerySortableInit, sortIt, clearAll, w, desc = false;
+
+ gallerySortableInit = function() {
+ gallerySortable = $('#media-items').sortable( {
+ items: 'div.media-item',
+ placeholder: 'sorthelper',
+ axis: 'y',
+ distance: 2,
+ handle: 'div.filename',
+ stop: function() {
+ // When an update has occurred, adjust the order for each item
+ var all = $('#media-items').sortable('toArray'), len = all.length;
+ $.each(all, function(i, id) {
+ var order = desc ? (len - i) : (1 + i);
+ $('#' + id + ' .menu_order input').val(order);
+ });
+ }
+ } );
+ };
+
+ sortIt = function() {
+ var all = $('.menu_order_input'), len = all.length;
+ all.each(function(i){
+ var order = desc ? (len - i) : (1 + i);
+ $(this).val(order);
+ });
+ };
+
+ clearAll = function(c) {
+ c = c || 0;
+ $('.menu_order_input').each( function() {
+ if ( this.value === '0' || c ) {
+ this.value = '';
+ }
+ });
+ };
+
+ $('#asc').click( function( e ) {
+ e.preventDefault();
+ desc = false;
+ sortIt();
+ });
+ $('#desc').click( function( e ) {
+ e.preventDefault();
+ desc = true;
+ sortIt();
+ });
+ $('#clear').click( function( e ) {
+ e.preventDefault();
+ clearAll(1);
+ });
+ $('#showall').click( function( e ) {
+ e.preventDefault();
+ $('#sort-buttons span a').toggle();
+ $('a.describe-toggle-on').hide();
+ $('a.describe-toggle-off, table.slidetoggle').show();
+ $('img.pinkynail').toggle(false);
+ });
+ $('#hideall').click( function( e ) {
+ e.preventDefault();
+ $('#sort-buttons span a').toggle();
+ $('a.describe-toggle-on').show();
+ $('a.describe-toggle-off, table.slidetoggle').hide();
+ $('img.pinkynail').toggle(true);
+ });
+
+ // initialize sortable
+ gallerySortableInit();
+ clearAll();
+
+ if ( $('#media-items>*').length > 1 ) {
+ w = wpgallery.getWin();
+
+ $('#save-all, #gallery-settings').show();
+ if ( typeof w.tinyMCE !== 'undefined' && w.tinyMCE.activeEditor && ! w.tinyMCE.activeEditor.isHidden() ) {
+ wpgallery.mcemode = true;
+ wpgallery.init();
+ } else {
+ $('#insert-gallery').show();
+ }
+ }
+});
+
+jQuery(window).unload( function () { window.tinymce = window.tinyMCE = window.wpgallery = null; } ); // Cleanup
+
+/* gallery settings */
+window.tinymce = null;
+
+window.wpgallery = {
+ mcemode : false,
+ editor : {},
+ dom : {},
+ is_update : false,
+ el : {},
+
+ I : function(e) {
+ return document.getElementById(e);
+ },
+
+ init: function() {
+ var t = this, li, q, i, it, w = t.getWin();
+
+ if ( ! t.mcemode ) {
+ return;
+ }
+
+ li = ('' + document.location.search).replace(/^\?/, '').split('&');
+ q = {};
+ for (i=0; i<li.length; i++) {
+ it = li[i].split('=');
+ q[unescape(it[0])] = unescape(it[1]);
+ }
+
+ if ( q.mce_rdomain ) {
+ document.domain = q.mce_rdomain;
+ }
+
+ // Find window & API
+ window.tinymce = w.tinymce;
+ window.tinyMCE = w.tinyMCE;
+ t.editor = tinymce.EditorManager.activeEditor;
+
+ t.setup();
+ },
+
+ getWin : function() {
+ return window.dialogArguments || opener || parent || top;
+ },
+
+ setup : function() {
+ var t = this, a, ed = t.editor, g, columns, link, order, orderby;
+ if ( ! t.mcemode ) {
+ return;
+ }
+
+ t.el = ed.selection.getNode();
+
+ if ( t.el.nodeName !== 'IMG' || ! ed.dom.hasClass(t.el, 'wpGallery') ) {
+ if ( ( g = ed.dom.select('img.wpGallery') ) && g[0] ) {
+ t.el = g[0];
+ } else {
+ if ( getUserSetting('galfile') === '1' ) {
+ t.I('linkto-file').checked = 'checked';
+ }
+ if ( getUserSetting('galdesc') === '1' ) {
+ t.I('order-desc').checked = 'checked';
+ }
+ if ( getUserSetting('galcols') ) {
+ t.I('columns').value = getUserSetting('galcols');
+ }
+ if ( getUserSetting('galord') ) {
+ t.I('orderby').value = getUserSetting('galord');
+ }
+ jQuery('#insert-gallery').show();
+ return;
+ }
+ }
+
+ a = ed.dom.getAttrib(t.el, 'title');
+ a = ed.dom.decode(a);
+
+ if ( a ) {
+ jQuery('#update-gallery').show();
+ t.is_update = true;
+
+ columns = a.match(/columns=['"]([0-9]+)['"]/);
+ link = a.match(/link=['"]([^'"]+)['"]/i);
+ order = a.match(/order=['"]([^'"]+)['"]/i);
+ orderby = a.match(/orderby=['"]([^'"]+)['"]/i);
+
+ if ( link && link[1] ) {
+ t.I('linkto-file').checked = 'checked';
+ }
+ if ( order && order[1] ) {
+ t.I('order-desc').checked = 'checked';
+ }
+ if ( columns && columns[1] ) {
+ t.I('columns').value = '' + columns[1];
+ }
+ if ( orderby && orderby[1] ) {
+ t.I('orderby').value = orderby[1];
+ }
+ } else {
+ jQuery('#insert-gallery').show();
+ }
+ },
+
+ update : function() {
+ var t = this, ed = t.editor, all = '', s;
+
+ if ( ! t.mcemode || ! t.is_update ) {
+ s = '[gallery' + t.getSettings() + ']';
+ t.getWin().send_to_editor(s);
+ return;
+ }
+
+ if ( t.el.nodeName !== 'IMG' ) {
+ return;
+ }
+
+ all = ed.dom.decode( ed.dom.getAttrib( t.el, 'title' ) );
+ all = all.replace(/\s*(order|link|columns|orderby)=['"]([^'"]+)['"]/gi, '');
+ all += t.getSettings();
+
+ ed.dom.setAttrib(t.el, 'title', all);
+ t.getWin().tb_remove();
+ },
+
+ getSettings : function() {
+ var I = this.I, s = '';
+
+ if ( I('linkto-file').checked ) {
+ s += ' link="file"';
+ setUserSetting('galfile', '1');
+ }
+
+ if ( I('order-desc').checked ) {
+ s += ' order="DESC"';
+ setUserSetting('galdesc', '1');
+ }
+
+ if ( I('columns').value !== 3 ) {
+ s += ' columns="' + I('columns').value + '"';
+ setUserSetting('galcols', I('columns').value);
+ }
+
+ if ( I('orderby').value !== 'menu_order' ) {
+ s += ' orderby="' + I('orderby').value + '"';
+ setUserSetting('galord', I('orderby').value);
+ }
+
+ return s;
+ }
+};
diff --git a/www/crm/wp-admin/js/gallery.min.js b/www/crm/wp-admin/js/gallery.min.js
new file mode 100644
index 00000000..96ebba87
--- /dev/null
+++ b/www/crm/wp-admin/js/gallery.min.js
@@ -0,0 +1 @@
+jQuery(document).ready(function(a){var b,c,d,e,f,g=!1;c=function(){b=a("#media-items").sortable({items:"div.media-item",placeholder:"sorthelper",axis:"y",distance:2,handle:"div.filename",stop:function(){var b=a("#media-items").sortable("toArray"),c=b.length;a.each(b,function(b,d){var e=g?c-b:1+b;a("#"+d+" .menu_order input").val(e)})}})},d=function(){var b=a(".menu_order_input"),c=b.length;b.each(function(b){var d=g?c-b:1+b;a(this).val(d)})},e=function(b){b=b||0,a(".menu_order_input").each(function(){("0"===this.value||b)&&(this.value="")})},a("#asc").click(function(a){a.preventDefault(),g=!1,d()}),a("#desc").click(function(a){a.preventDefault(),g=!0,d()}),a("#clear").click(function(a){a.preventDefault(),e(1)}),a("#showall").click(function(b){b.preventDefault(),a("#sort-buttons span a").toggle(),a("a.describe-toggle-on").hide(),a("a.describe-toggle-off, table.slidetoggle").show(),a("img.pinkynail").toggle(!1)}),a("#hideall").click(function(b){b.preventDefault(),a("#sort-buttons span a").toggle(),a("a.describe-toggle-on").show(),a("a.describe-toggle-off, table.slidetoggle").hide(),a("img.pinkynail").toggle(!0)}),c(),e(),a("#media-items>*").length>1&&(f=wpgallery.getWin(),a("#save-all, #gallery-settings").show(),"undefined"!=typeof f.tinyMCE&&f.tinyMCE.activeEditor&&!f.tinyMCE.activeEditor.isHidden()?(wpgallery.mcemode=!0,wpgallery.init()):a("#insert-gallery").show())}),jQuery(window).unload(function(){window.tinymce=window.tinyMCE=window.wpgallery=null}),window.tinymce=null,window.wpgallery={mcemode:!1,editor:{},dom:{},is_update:!1,el:{},I:function(a){return document.getElementById(a)},init:function(){var a,b,c,d,e=this,f=e.getWin();if(e.mcemode){for(a=(""+document.location.search).replace(/^\?/,"").split("&"),b={},c=0;c<a.length;c++)d=a[c].split("="),b[unescape(d[0])]=unescape(d[1]);b.mce_rdomain&&(document.domain=b.mce_rdomain),window.tinymce=f.tinymce,window.tinyMCE=f.tinyMCE,e.editor=tinymce.EditorManager.activeEditor,e.setup()}},getWin:function(){return window.dialogArguments||opener||parent||top},setup:function(){var a,b,c,d,e,f,g=this,h=g.editor;if(g.mcemode){if(g.el=h.selection.getNode(),"IMG"!==g.el.nodeName||!h.dom.hasClass(g.el,"wpGallery")){if(!(b=h.dom.select("img.wpGallery"))||!b[0])return"1"===getUserSetting("galfile")&&(g.I("linkto-file").checked="checked"),"1"===getUserSetting("galdesc")&&(g.I("order-desc").checked="checked"),getUserSetting("galcols")&&(g.I("columns").value=getUserSetting("galcols")),getUserSetting("galord")&&(g.I("orderby").value=getUserSetting("galord")),void jQuery("#insert-gallery").show();g.el=b[0]}a=h.dom.getAttrib(g.el,"title"),a=h.dom.decode(a),a?(jQuery("#update-gallery").show(),g.is_update=!0,c=a.match(/columns=['"]([0-9]+)['"]/),d=a.match(/link=['"]([^'"]+)['"]/i),e=a.match(/order=['"]([^'"]+)['"]/i),f=a.match(/orderby=['"]([^'"]+)['"]/i),d&&d[1]&&(g.I("linkto-file").checked="checked"),e&&e[1]&&(g.I("order-desc").checked="checked"),c&&c[1]&&(g.I("columns").value=""+c[1]),f&&f[1]&&(g.I("orderby").value=f[1])):jQuery("#insert-gallery").show()}},update:function(){var a,b=this,c=b.editor,d="";return b.mcemode&&b.is_update?void("IMG"===b.el.nodeName&&(d=c.dom.decode(c.dom.getAttrib(b.el,"title")),d=d.replace(/\s*(order|link|columns|orderby)=['"]([^'"]+)['"]/gi,""),d+=b.getSettings(),c.dom.setAttrib(b.el,"title",d),b.getWin().tb_remove())):(a="[gallery"+b.getSettings()+"]",void b.getWin().send_to_editor(a))},getSettings:function(){var a=this.I,b="";return a("linkto-file").checked&&(b+=' link="file"',setUserSetting("galfile","1")),a("order-desc").checked&&(b+=' order="DESC"',setUserSetting("galdesc","1")),3!==a("columns").value&&(b+=' columns="'+a("columns").value+'"',setUserSetting("galcols",a("columns").value)),"menu_order"!==a("orderby").value&&(b+=' orderby="'+a("orderby").value+'"',setUserSetting("galord",a("orderby").value)),b}}; \ No newline at end of file
diff --git a/www/crm/wp-admin/js/image-edit.js b/www/crm/wp-admin/js/image-edit.js
new file mode 100644
index 00000000..100f26e7
--- /dev/null
+++ b/www/crm/wp-admin/js/image-edit.js
@@ -0,0 +1,1126 @@
+/**
+ * The functions necessary for editing images.
+ *
+ * @since 2.9.0
+ * @output wp-admin/js/image-edit.js
+ */
+
+ /* global imageEditL10n, ajaxurl, confirm */
+
+(function($) {
+
+ /**
+ * Contains all the methods to initialise and control the image editor.
+ *
+ * @namespace imageEdit
+ */
+ var imageEdit = window.imageEdit = {
+ iasapi : {},
+ hold : {},
+ postid : '',
+ _view : false,
+
+ /**
+ * Handle crop tool clicks.
+ */
+ handleCropToolClick: function( postid, nonce, cropButton ) {
+ var img = $( '#image-preview-' + postid ),
+ selection = this.iasapi.getSelection();
+
+ // Ensure selection is available, otherwise reset to full image.
+ if ( isNaN( selection.x1 ) ) {
+ this.setCropSelection( postid, { 'x1': 0, 'y1': 0, 'x2': img.innerWidth(), 'y2': img.innerHeight(), 'width': img.innerWidth(), 'height': img.innerHeight() } );
+ selection = this.iasapi.getSelection();
+ }
+
+ // If we don't already have a selection, select the entire image.
+ if ( 0 === selection.x1 && 0 === selection.y1 && 0 === selection.x2 && 0 === selection.y2 ) {
+ this.iasapi.setSelection( 0, 0, img.innerWidth(), img.innerHeight(), true );
+ this.iasapi.setOptions( { show: true } );
+ this.iasapi.update();
+ } else {
+
+ // Otherwise, perform the crop.
+ imageEdit.crop( postid, nonce , cropButton );
+ }
+ },
+
+ /**
+ * Converts a value to an integer.
+ *
+ * @memberof imageEdit
+ * @since 2.9.0
+ *
+ * @param {number} f The float value that should be converted.
+ *
+ * @return {number} The integer representation from the float value.
+ */
+ intval : function(f) {
+ /*
+ * Bitwise OR operator: one of the obscure ways to truncate floating point figures,
+ * worth reminding JavaScript doesn't have a distinct "integer" type.
+ */
+ return f | 0;
+ },
+
+ /**
+ * Adds the disabled attribute and class to a single form element or a field set.
+ *
+ * @memberof imageEdit
+ * @since 2.9.0
+ *
+ * @param {jQuery} el The element that should be modified.
+ * @param {bool|number} s The state for the element. If set to true
+ * the element is disabled,
+ * otherwise the element is enabled.
+ * The function is sometimes called with a 0 or 1
+ * instead of true or false.
+ *
+ * @returns {void}
+ */
+ setDisabled : function( el, s ) {
+ /*
+ * `el` can be a single form element or a fieldset. Before #28864, the disabled state on
+ * some text fields was handled targeting $('input', el). Now we need to handle the
+ * disabled state on buttons too so we can just target `el` regardless if it's a single
+ * element or a fieldset because when a fieldset is disabled, its descendants are disabled too.
+ */
+ if ( s ) {
+ el.removeClass( 'disabled' ).prop( 'disabled', false );
+ } else {
+ el.addClass( 'disabled' ).prop( 'disabled', true );
+ }
+ },
+
+ /**
+ * Initializes the image editor.
+ *
+ * @memberof imageEdit
+ * @since 2.9.0
+ *
+ * @param {number} postid The post id.
+ *
+ * @returns {void}
+ */
+ init : function(postid) {
+ var t = this, old = $('#image-editor-' + t.postid),
+ x = t.intval( $('#imgedit-x-' + postid).val() ),
+ y = t.intval( $('#imgedit-y-' + postid).val() );
+
+ if ( t.postid !== postid && old.length ) {
+ t.close(t.postid);
+ }
+
+ t.hold.w = t.hold.ow = x;
+ t.hold.h = t.hold.oh = y;
+ t.hold.xy_ratio = x / y;
+ t.hold.sizer = parseFloat( $('#imgedit-sizer-' + postid).val() );
+ t.postid = postid;
+ $('#imgedit-response-' + postid).empty();
+
+ $('input[type="text"]', '#imgedit-panel-' + postid).keypress(function(e) {
+ var k = e.keyCode;
+
+ // Key codes 37 thru 40 are the arrow keys.
+ if ( 36 < k && k < 41 ) {
+ $(this).blur();
+ }
+
+ // The key code 13 is the enter key.
+ if ( 13 === k ) {
+ e.preventDefault();
+ e.stopPropagation();
+ return false;
+ }
+ });
+ },
+
+ /**
+ * Toggles the wait/load icon in the editor.
+ *
+ * @memberof imageEdit
+ * @since 2.9.0
+ *
+ * @param {number} postid The post id.
+ * @param {number} toggle Is 0 or 1, fades the icon in then 1 and out when 0.
+ *
+ * @returns {void}
+ */
+ toggleEditor : function(postid, toggle) {
+ var wait = $('#imgedit-wait-' + postid);
+
+ if ( toggle ) {
+ wait.fadeIn( 'fast' );
+ } else {
+ wait.fadeOut('fast');
+ }
+ },
+
+ /**
+ * Shows or hides the image edit help box.
+ *
+ * @memberof imageEdit
+ * @since 2.9.0
+ *
+ * @param {HTMLElement} el The element to create the help window in.
+ *
+ * @returns {boolean} Always returns false.
+ */
+ toggleHelp : function(el) {
+ var $el = $( el );
+ $el
+ .attr( 'aria-expanded', 'false' === $el.attr( 'aria-expanded' ) ? 'true' : 'false' )
+ .parents( '.imgedit-group-top' ).toggleClass( 'imgedit-help-toggled' ).find( '.imgedit-help' ).slideToggle( 'fast' );
+
+ return false;
+ },
+
+ /**
+ * Gets the value from the image edit target.
+ *
+ * The image edit target contains the image sizes where the (possible) changes
+ * have to be applied to.
+ *
+ * @memberof imageEdit
+ * @since 2.9.0
+ *
+ * @param {number} postid The post id.
+ *
+ * @returns {string} The value from the imagedit-save-target input field when available,
+ * or 'full' when not available.
+ */
+ getTarget : function(postid) {
+ return $('input[name="imgedit-target-' + postid + '"]:checked', '#imgedit-save-target-' + postid).val() || 'full';
+ },
+
+ /**
+ * Recalculates the height or width and keeps the original aspect ratio.
+ *
+ * If the original image size is exceeded a red exclamation mark is shown.
+ *
+ * @memberof imageEdit
+ * @since 2.9.0
+ *
+ * @param {number} postid The current post id.
+ * @param {number} x Is 0 when it applies the y-axis
+ * and 1 when applicable for the x-axis.
+ * @param {jQuery} el Element.
+ *
+ * @returns {void}
+ */
+ scaleChanged : function( postid, x, el ) {
+ var w = $('#imgedit-scale-width-' + postid), h = $('#imgedit-scale-height-' + postid),
+ warn = $('#imgedit-scale-warn-' + postid), w1 = '', h1 = '';
+
+ if ( false === this.validateNumeric( el ) ) {
+ return;
+ }
+
+ if ( x ) {
+ h1 = ( w.val() !== '' ) ? Math.round( w.val() / this.hold.xy_ratio ) : '';
+ h.val( h1 );
+ } else {
+ w1 = ( h.val() !== '' ) ? Math.round( h.val() * this.hold.xy_ratio ) : '';
+ w.val( w1 );
+ }
+
+ if ( ( h1 && h1 > this.hold.oh ) || ( w1 && w1 > this.hold.ow ) ) {
+ warn.css('visibility', 'visible');
+ } else {
+ warn.css('visibility', 'hidden');
+ }
+ },
+
+ /**
+ * Gets the selected aspect ratio.
+ *
+ * @memberof imageEdit
+ * @since 2.9.0
+ *
+ * @param {number} postid The post id.
+ *
+ * @returns {string} The aspect ratio.
+ */
+ getSelRatio : function(postid) {
+ var x = this.hold.w, y = this.hold.h,
+ X = this.intval( $('#imgedit-crop-width-' + postid).val() ),
+ Y = this.intval( $('#imgedit-crop-height-' + postid).val() );
+
+ if ( X && Y ) {
+ return X + ':' + Y;
+ }
+
+ if ( x && y ) {
+ return x + ':' + y;
+ }
+
+ return '1:1';
+ },
+
+ /**
+ * Removes the last action from the image edit history.
+ * The history consist of (edit) actions performed on the image.
+ *
+ * @memberof imageEdit
+ * @since 2.9.0
+ *
+ * @param {number} postid The post id.
+ * @param {number} setSize 0 or 1, when 1 the image resets to its original size.
+ *
+ * @returns {string} JSON string containing the history or an empty string if no history exists.
+ */
+ filterHistory : function(postid, setSize) {
+ // Apply undo state to history.
+ var history = $('#imgedit-history-' + postid).val(), pop, n, o, i, op = [];
+
+ if ( history !== '' ) {
+ // Read the JSON string with the image edit history.
+ history = JSON.parse(history);
+ pop = this.intval( $('#imgedit-undone-' + postid).val() );
+ if ( pop > 0 ) {
+ while ( pop > 0 ) {
+ history.pop();
+ pop--;
+ }
+ }
+
+ // Reset size to it's original state.
+ if ( setSize ) {
+ if ( !history.length ) {
+ this.hold.w = this.hold.ow;
+ this.hold.h = this.hold.oh;
+ return '';
+ }
+
+ // Restore original 'o'.
+ o = history[history.length - 1];
+
+ // c = 'crop', r = 'rotate', f = 'flip'
+ o = o.c || o.r || o.f || false;
+
+ if ( o ) {
+ // fw = Full image width
+ this.hold.w = o.fw;
+ // fh = Full image height
+ this.hold.h = o.fh;
+ }
+ }
+
+ // Filter the last step/action from the history.
+ for ( n in history ) {
+ i = history[n];
+ if ( i.hasOwnProperty('c') ) {
+ op[n] = { 'c': { 'x': i.c.x, 'y': i.c.y, 'w': i.c.w, 'h': i.c.h } };
+ } else if ( i.hasOwnProperty('r') ) {
+ op[n] = { 'r': i.r.r };
+ } else if ( i.hasOwnProperty('f') ) {
+ op[n] = { 'f': i.f.f };
+ }
+ }
+ return JSON.stringify(op);
+ }
+ return '';
+ },
+ /**
+ * Binds the necessary events to the image.
+ *
+ * When the image source is reloaded the image will be reloaded.
+ *
+ * @memberof imageEdit
+ * @since 2.9.0
+ *
+ * @param {number} postid The post id.
+ * @param {string} nonce The nonce to verify the request.
+ * @param {function} callback Function to execute when the image is loaded.
+ *
+ * @returns {void}
+ */
+ refreshEditor : function(postid, nonce, callback) {
+ var t = this, data, img;
+
+ t.toggleEditor(postid, 1);
+ data = {
+ 'action': 'imgedit-preview',
+ '_ajax_nonce': nonce,
+ 'postid': postid,
+ 'history': t.filterHistory(postid, 1),
+ 'rand': t.intval(Math.random() * 1000000)
+ };
+
+ img = $( '<img id="image-preview-' + postid + '" alt="" />' )
+ .on( 'load', { history: data.history }, function( event ) {
+ var max1, max2,
+ parent = $( '#imgedit-crop-' + postid ),
+ t = imageEdit,
+ historyObj;
+
+ // Checks if there already is some image-edit history.
+ if ( '' !== event.data.history ) {
+ historyObj = JSON.parse( event.data.history );
+ // If last executed action in history is a crop action.
+ if ( historyObj[historyObj.length - 1].hasOwnProperty( 'c' ) ) {
+ /*
+ * A crop action has completed and the crop button gets disabled
+ * ensure the undo button is enabled.
+ */
+ t.setDisabled( $( '#image-undo-' + postid) , true );
+ // Move focus to the undo button to avoid a focus loss.
+ $( '#image-undo-' + postid ).focus();
+ }
+ }
+
+ parent.empty().append(img);
+
+ // w, h are the new full size dims
+ max1 = Math.max( t.hold.w, t.hold.h );
+ max2 = Math.max( $(img).width(), $(img).height() );
+ t.hold.sizer = max1 > max2 ? max2 / max1 : 1;
+
+ t.initCrop(postid, img, parent);
+
+ if ( (typeof callback !== 'undefined') && callback !== null ) {
+ callback();
+ }
+
+ if ( $('#imgedit-history-' + postid).val() && $('#imgedit-undone-' + postid).val() === '0' ) {
+ $('input.imgedit-submit-btn', '#imgedit-panel-' + postid).removeAttr('disabled');
+ } else {
+ $('input.imgedit-submit-btn', '#imgedit-panel-' + postid).prop('disabled', true);
+ }
+
+ t.toggleEditor(postid, 0);
+ })
+ .on('error', function() {
+ $('#imgedit-crop-' + postid).empty().append('<div class="error"><p>' + imageEditL10n.error + '</p></div>');
+ t.toggleEditor(postid, 0);
+ })
+ .attr('src', ajaxurl + '?' + $.param(data));
+ },
+ /**
+ * Performs an image edit action.
+ *
+ * @memberof imageEdit
+ * @since 2.9.0
+ *
+ * @param {number} postid The post id.
+ * @param {string} nonce The nonce to verify the request.
+ * @param {string} action The action to perform on the image.
+ * The possible actions are: "scale" and "restore".
+ *
+ * @returns {boolean|void} Executes a post request that refreshes the page
+ * when the action is performed.
+ * Returns false if a invalid action is given,
+ * or when the action cannot be performed.
+ */
+ action : function(postid, nonce, action) {
+ var t = this, data, w, h, fw, fh;
+
+ if ( t.notsaved(postid) ) {
+ return false;
+ }
+
+ data = {
+ 'action': 'image-editor',
+ '_ajax_nonce': nonce,
+ 'postid': postid
+ };
+
+ if ( 'scale' === action ) {
+ w = $('#imgedit-scale-width-' + postid),
+ h = $('#imgedit-scale-height-' + postid),
+ fw = t.intval(w.val()),
+ fh = t.intval(h.val());
+
+ if ( fw < 1 ) {
+ w.focus();
+ return false;
+ } else if ( fh < 1 ) {
+ h.focus();
+ return false;
+ }
+
+ if ( fw === t.hold.ow || fh === t.hold.oh ) {
+ return false;
+ }
+
+ data['do'] = 'scale';
+ data.fwidth = fw;
+ data.fheight = fh;
+ } else if ( 'restore' === action ) {
+ data['do'] = 'restore';
+ } else {
+ return false;
+ }
+
+ t.toggleEditor(postid, 1);
+ $.post(ajaxurl, data, function(r) {
+ $('#image-editor-' + postid).empty().append(r);
+ t.toggleEditor(postid, 0);
+ // refresh the attachment model so that changes propagate
+ if ( t._view ) {
+ t._view.refresh();
+ }
+ });
+ },
+
+ /**
+ * Stores the changes that are made to the image.
+ *
+ * @memberof imageEdit
+ * @since 2.9.0
+ *
+ * @param {number} postid The post id to get the image from the database.
+ * @param {string} nonce The nonce to verify the request.
+ *
+ * @returns {boolean|void} If the actions are successfully saved a response message is shown.
+ * Returns false if there is no image editing history,
+ * thus there are not edit-actions performed on the image.
+ */
+ save : function(postid, nonce) {
+ var data,
+ target = this.getTarget(postid),
+ history = this.filterHistory(postid, 0),
+ self = this;
+
+ if ( '' === history ) {
+ return false;
+ }
+
+ this.toggleEditor(postid, 1);
+ data = {
+ 'action': 'image-editor',
+ '_ajax_nonce': nonce,
+ 'postid': postid,
+ 'history': history,
+ 'target': target,
+ 'context': $('#image-edit-context').length ? $('#image-edit-context').val() : null,
+ 'do': 'save'
+ };
+ // Post the image edit data to the backend.
+ $.post(ajaxurl, data, function(r) {
+ // Read the response.
+ var ret = JSON.parse(r);
+
+ // If a response is returned, close the editor and show an error.
+ if ( ret.error ) {
+ $('#imgedit-response-' + postid).html('<div class="error"><p>' + ret.error + '</p></div>');
+ imageEdit.close(postid);
+ return;
+ }
+
+ if ( ret.fw && ret.fh ) {
+ $('#media-dims-' + postid).html( ret.fw + ' &times; ' + ret.fh );
+ }
+
+ if ( ret.thumbnail ) {
+ $('.thumbnail', '#thumbnail-head-' + postid).attr('src', ''+ret.thumbnail);
+ }
+
+ if ( ret.msg ) {
+ $('#imgedit-response-' + postid).html('<div class="updated"><p>' + ret.msg + '</p></div>');
+ }
+
+ if ( self._view ) {
+ self._view.save();
+ } else {
+ imageEdit.close(postid);
+ }
+ });
+ },
+
+ /**
+ * Creates the image edit window.
+ *
+ * @memberof imageEdit
+ * @since 2.9.0
+ *
+ * @param {number} postid The post id for the image.
+ * @param {string} nonce The nonce to verify the request.
+ * @param {object} view The image editor view to be used for the editing.
+ *
+ * @returns {void|promise} Either returns void if the button was already activated
+ * or returns an instance of the image editor, wrapped in a promise.
+ */
+ open : function( postid, nonce, view ) {
+ this._view = view;
+
+ var dfd, data, elem = $('#image-editor-' + postid), head = $('#media-head-' + postid),
+ btn = $('#imgedit-open-btn-' + postid), spin = btn.siblings('.spinner');
+
+ /*
+ * Instead of disabling the button, which causes a focus loss and makes screen
+ * readers announce "unavailable", return if the button was already clicked.
+ */
+ if ( btn.hasClass( 'button-activated' ) ) {
+ return;
+ }
+
+ spin.addClass( 'is-active' );
+
+ data = {
+ 'action': 'image-editor',
+ '_ajax_nonce': nonce,
+ 'postid': postid,
+ 'do': 'open'
+ };
+
+ dfd = $.ajax({
+ url: ajaxurl,
+ type: 'post',
+ data: data,
+ beforeSend: function() {
+ btn.addClass( 'button-activated' );
+ }
+ }).done(function( html ) {
+ elem.html( html );
+ head.fadeOut('fast', function(){
+ elem.fadeIn('fast');
+ btn.removeClass( 'button-activated' );
+ spin.removeClass( 'is-active' );
+ });
+ // Initialise the Image Editor now that everything is ready.
+ imageEdit.init( postid );
+ });
+
+ return dfd;
+ },
+
+ /**
+ * Initializes the cropping tool and sets a default cropping selection.
+ *
+ * @memberof imageEdit
+ * @since 2.9.0
+ *
+ * @param {number} postid The post id.
+ *
+ * @returns {void}
+ */
+ imgLoaded : function(postid) {
+ var img = $('#image-preview-' + postid), parent = $('#imgedit-crop-' + postid);
+
+ // Ensure init has run even when directly loaded.
+ if ( 'undefined' === typeof this.hold.sizer ) {
+ this.init( postid );
+ }
+
+ this.initCrop(postid, img, parent);
+ this.setCropSelection( postid, { 'x1': 0, 'y1': 0, 'x2': 0, 'y2': 0, 'width': img.innerWidth(), 'height': img.innerHeight() } );
+
+ this.toggleEditor(postid, 0);
+ // Editor is ready, move focus to the first focusable element.
+ $( '.imgedit-wrap .imgedit-help-toggle' ).eq( 0 ).focus();
+ },
+
+ /**
+ * Initializes the cropping tool.
+ *
+ * @memberof imageEdit
+ * @since 2.9.0
+ *
+ * @param {number} postid The post id.
+ * @param {HTMLElement} image The preview image.
+ * @param {HTMLElement} parent The preview image container.
+ *
+ * @returns {void}
+ */
+ initCrop : function(postid, image, parent) {
+ var t = this,
+ selW = $('#imgedit-sel-width-' + postid),
+ selH = $('#imgedit-sel-height-' + postid),
+ $img;
+
+ t.iasapi = $(image).imgAreaSelect({
+ parent: parent,
+ instance: true,
+ handles: true,
+ keys: true,
+ minWidth: 3,
+ minHeight: 3,
+
+ /**
+ * Sets the CSS styles and binds events for locking the aspect ratio.
+ *
+ * @ignore
+ *
+ * @param {jQuery} img The preview image.
+ */
+ onInit: function( img ) {
+ // Ensure that the imgAreaSelect wrapper elements are position:absolute.
+ // (even if we're in a position:fixed modal)
+ $img = $( img );
+ $img.next().css( 'position', 'absolute' )
+ .nextAll( '.imgareaselect-outer' ).css( 'position', 'absolute' );
+ /**
+ * Binds mouse down event to the cropping container.
+ *
+ * @returns {void}
+ */
+ parent.children().on( 'mousedown, touchstart', function(e){
+ var ratio = false, sel, defRatio;
+
+ if ( e.shiftKey ) {
+ sel = t.iasapi.getSelection();
+ defRatio = t.getSelRatio(postid);
+ ratio = ( sel && sel.width && sel.height ) ? sel.width + ':' + sel.height : defRatio;
+ }
+
+ t.iasapi.setOptions({
+ aspectRatio: ratio
+ });
+ });
+ },
+
+ /**
+ * Event triggered when starting a selection.
+ *
+ * @ignore
+ *
+ * @returns {void}
+ */
+ onSelectStart: function() {
+ imageEdit.setDisabled($('#imgedit-crop-sel-' + postid), 1);
+ },
+ /**
+ * Event triggered when the selection is ended.
+ *
+ * @ignore
+ *
+ * @param {object} img jQuery object representing the image.
+ * @param {object} c The selection.
+ *
+ * @returns {object}
+ */
+ onSelectEnd: function(img, c) {
+ imageEdit.setCropSelection(postid, c);
+ },
+
+ /**
+ * Event triggered when the selection changes.
+ *
+ * @ignore
+ *
+ * @param {object} img jQuery object representing the image.
+ * @param {object} c The selection.
+ *
+ * @returns {void}
+ */
+ onSelectChange: function(img, c) {
+ var sizer = imageEdit.hold.sizer;
+ selW.val( imageEdit.round(c.width / sizer) );
+ selH.val( imageEdit.round(c.height / sizer) );
+ }
+ });
+ },
+
+ /**
+ * Stores the current crop selection.
+ *
+ * @memberof imageEdit
+ * @since 2.9.0
+ *
+ * @param {number} postid The post id.
+ * @param {object} c The selection.
+ *
+ * @returns {boolean}
+ */
+ setCropSelection : function(postid, c) {
+ var sel;
+
+ c = c || 0;
+
+ if ( !c || ( c.width < 3 && c.height < 3 ) ) {
+ this.setDisabled( $( '.imgedit-crop', '#imgedit-panel-' + postid ), 1 );
+ this.setDisabled( $( '#imgedit-crop-sel-' + postid ), 1 );
+ $('#imgedit-sel-width-' + postid).val('');
+ $('#imgedit-sel-height-' + postid).val('');
+ $('#imgedit-selection-' + postid).val('');
+ return false;
+ }
+
+ sel = { 'x': c.x1, 'y': c.y1, 'w': c.width, 'h': c.height };
+ this.setDisabled($('.imgedit-crop', '#imgedit-panel-' + postid), 1);
+ $('#imgedit-selection-' + postid).val( JSON.stringify(sel) );
+ },
+
+
+ /**
+ * Closes the image editor.
+ *
+ * @memberof imageEdit
+ * @since 2.9.0
+ *
+ * @param {number} postid The post id.
+ * @param {bool} warn Warning message.
+ *
+ * @returns {void|bool} Returns false if there is a warning.
+ */
+ close : function(postid, warn) {
+ warn = warn || false;
+
+ if ( warn && this.notsaved(postid) ) {
+ return false;
+ }
+
+ this.iasapi = {};
+ this.hold = {};
+
+ // If we've loaded the editor in the context of a Media Modal, then switch to the previous view,
+ // whatever that might have been.
+ if ( this._view ){
+ this._view.back();
+ }
+
+ // In case we are not accessing the image editor in the context of a View, close the editor the old-skool way
+ else {
+ $('#image-editor-' + postid).fadeOut('fast', function() {
+ $( '#media-head-' + postid ).fadeIn( 'fast', function() {
+ // Move focus back to the Edit Image button. Runs also when saving.
+ $( '#imgedit-open-btn-' + postid ).focus();
+ });
+ $(this).empty();
+ });
+ }
+
+
+ },
+
+ /**
+ * Checks if the image edit history is saved.
+ *
+ * @memberof imageEdit
+ * @since 2.9.0
+ *
+ * @param {number} postid The post id.
+ *
+ * @returns {boolean} Returns true if the history is not saved.
+ */
+ notsaved : function(postid) {
+ var h = $('#imgedit-history-' + postid).val(),
+ history = ( h !== '' ) ? JSON.parse(h) : [],
+ pop = this.intval( $('#imgedit-undone-' + postid).val() );
+
+ if ( pop < history.length ) {
+ if ( confirm( $('#imgedit-leaving-' + postid).html() ) ) {
+ return false;
+ }
+ return true;
+ }
+ return false;
+ },
+
+ /**
+ * Adds an image edit action to the history.
+ *
+ * @memberof imageEdit
+ * @since 2.9.0
+ *
+ * @param {object} op The original position.
+ * @param {number} postid The post id.
+ * @param {string} nonce The nonce.
+ *
+ * @returns {void}
+ */
+ addStep : function(op, postid, nonce) {
+ var t = this, elem = $('#imgedit-history-' + postid),
+ history = ( elem.val() !== '' ) ? JSON.parse( elem.val() ) : [],
+ undone = $( '#imgedit-undone-' + postid ),
+ pop = t.intval( undone.val() );
+
+ while ( pop > 0 ) {
+ history.pop();
+ pop--;
+ }
+ undone.val(0); // reset
+
+ history.push(op);
+ elem.val( JSON.stringify(history) );
+
+ t.refreshEditor(postid, nonce, function() {
+ t.setDisabled($('#image-undo-' + postid), true);
+ t.setDisabled($('#image-redo-' + postid), false);
+ });
+ },
+
+ /**
+ * Rotates the image.
+ *
+ * @memberof imageEdit
+ * @since 2.9.0
+ *
+ * @param {string} angle The angle the image is rotated with.
+ * @param {number} postid The post id.
+ * @param {string} nonce The nonce.
+ * @param {object} t The target element.
+ *
+ * @returns {boolean}
+ */
+ rotate : function(angle, postid, nonce, t) {
+ if ( $(t).hasClass('disabled') ) {
+ return false;
+ }
+
+ this.addStep({ 'r': { 'r': angle, 'fw': this.hold.h, 'fh': this.hold.w }}, postid, nonce);
+ },
+
+ /**
+ * Flips the image.
+ *
+ * @memberof imageEdit
+ * @since 2.9.0
+ *
+ * @param {number} axis The axle the image is flipped on.
+ * @param {number} postid The post id.
+ * @param {string} nonce The nonce.
+ * @param {object} t The target element.
+ *
+ * @returns {boolean}
+ */
+ flip : function (axis, postid, nonce, t) {
+ if ( $(t).hasClass('disabled') ) {
+ return false;
+ }
+
+ this.addStep({ 'f': { 'f': axis, 'fw': this.hold.w, 'fh': this.hold.h }}, postid, nonce);
+ },
+
+ /**
+ * Crops the image.
+ *
+ * @memberof imageEdit
+ * @since 2.9.0
+ *
+ * @param {number} postid The post id.
+ * @param {string} nonce The nonce.
+ * @param {object} t The target object.
+ *
+ * @returns {void|boolean} Returns false if the crop button is disabled.
+ */
+ crop : function (postid, nonce, t) {
+ var sel = $('#imgedit-selection-' + postid).val(),
+ w = this.intval( $('#imgedit-sel-width-' + postid).val() ),
+ h = this.intval( $('#imgedit-sel-height-' + postid).val() );
+
+ if ( $(t).hasClass('disabled') || sel === '' ) {
+ return false;
+ }
+
+ sel = JSON.parse(sel);
+ if ( sel.w > 0 && sel.h > 0 && w > 0 && h > 0 ) {
+ sel.fw = w;
+ sel.fh = h;
+ this.addStep({ 'c': sel }, postid, nonce);
+ }
+ },
+
+ /**
+ * Undoes an image edit action.
+ *
+ * @memberof imageEdit
+ * @since 2.9.0
+ *
+ * @param {number} postid The post id.
+ * @param {string} nonce The nonce.
+ *
+ * @returns {void|false} Returns false if the undo button is disabled.
+ */
+ undo : function (postid, nonce) {
+ var t = this, button = $('#image-undo-' + postid), elem = $('#imgedit-undone-' + postid),
+ pop = t.intval( elem.val() ) + 1;
+
+ if ( button.hasClass('disabled') ) {
+ return;
+ }
+
+ elem.val(pop);
+ t.refreshEditor(postid, nonce, function() {
+ var elem = $('#imgedit-history-' + postid),
+ history = ( elem.val() !== '' ) ? JSON.parse( elem.val() ) : [];
+
+ t.setDisabled($('#image-redo-' + postid), true);
+ t.setDisabled(button, pop < history.length);
+ // When undo gets disabled, move focus to the redo button to avoid a focus loss.
+ if ( history.length === pop ) {
+ $( '#image-redo-' + postid ).focus();
+ }
+ });
+ },
+
+ /**
+ * Reverts a undo action.
+ *
+ * @memberof imageEdit
+ * @since 2.9.0
+ *
+ * @param {number} postid The post id.
+ * @param {string} nonce The nonce.
+ *
+ * @returns {void}
+ */
+ redo : function(postid, nonce) {
+ var t = this, button = $('#image-redo-' + postid), elem = $('#imgedit-undone-' + postid),
+ pop = t.intval( elem.val() ) - 1;
+
+ if ( button.hasClass('disabled') ) {
+ return;
+ }
+
+ elem.val(pop);
+ t.refreshEditor(postid, nonce, function() {
+ t.setDisabled($('#image-undo-' + postid), true);
+ t.setDisabled(button, pop > 0);
+ // When redo gets disabled, move focus to the undo button to avoid a focus loss.
+ if ( 0 === pop ) {
+ $( '#image-undo-' + postid ).focus();
+ }
+ });
+ },
+
+ /**
+ * Sets the selection for the height and width in pixels.
+ *
+ * @memberof imageEdit
+ * @since 2.9.0
+ *
+ * @param {number} postid The post id.
+ * @param {jQuery} el The element containing the values.
+ *
+ * @returns {void|boolean} Returns false when the x or y value is lower than 1,
+ * void when the value is not numeric or when the operation
+ * is successful.
+ */
+ setNumSelection : function( postid, el ) {
+ var sel, elX = $('#imgedit-sel-width-' + postid), elY = $('#imgedit-sel-height-' + postid),
+ x = this.intval( elX.val() ), y = this.intval( elY.val() ),
+ img = $('#image-preview-' + postid), imgh = img.height(), imgw = img.width(),
+ sizer = this.hold.sizer, x1, y1, x2, y2, ias = this.iasapi;
+
+ if ( false === this.validateNumeric( el ) ) {
+ return;
+ }
+
+ if ( x < 1 ) {
+ elX.val('');
+ return false;
+ }
+
+ if ( y < 1 ) {
+ elY.val('');
+ return false;
+ }
+
+ if ( x && y && ( sel = ias.getSelection() ) ) {
+ x2 = sel.x1 + Math.round( x * sizer );
+ y2 = sel.y1 + Math.round( y * sizer );
+ x1 = sel.x1;
+ y1 = sel.y1;
+
+ if ( x2 > imgw ) {
+ x1 = 0;
+ x2 = imgw;
+ elX.val( Math.round( x2 / sizer ) );
+ }
+
+ if ( y2 > imgh ) {
+ y1 = 0;
+ y2 = imgh;
+ elY.val( Math.round( y2 / sizer ) );
+ }
+
+ ias.setSelection( x1, y1, x2, y2 );
+ ias.update();
+ this.setCropSelection(postid, ias.getSelection());
+ }
+ },
+
+ /**
+ * Rounds a number to a whole.
+ *
+ * @memberof imageEdit
+ * @since 2.9.0
+ *
+ * @param {number} num The number.
+ *
+ * @returns {number} The number rounded to a whole number.
+ */
+ round : function(num) {
+ var s;
+ num = Math.round(num);
+
+ if ( this.hold.sizer > 0.6 ) {
+ return num;
+ }
+
+ s = num.toString().slice(-1);
+
+ if ( '1' === s ) {
+ return num - 1;
+ } else if ( '9' === s ) {
+ return num + 1;
+ }
+
+ return num;
+ },
+
+ /**
+ * Sets a locked aspect ratio for the selection.
+ *
+ * @memberof imageEdit
+ * @since 2.9.0
+ *
+ * @param {number} postid The post id.
+ * @param {number} n The ratio to set.
+ * @param {jQuery} el The element containing the values.
+ *
+ * @returns {void}
+ */
+ setRatioSelection : function(postid, n, el) {
+ var sel, r, x = this.intval( $('#imgedit-crop-width-' + postid).val() ),
+ y = this.intval( $('#imgedit-crop-height-' + postid).val() ),
+ h = $('#image-preview-' + postid).height();
+
+ if ( false === this.validateNumeric( el ) ) {
+ return;
+ }
+
+ if ( x && y ) {
+ this.iasapi.setOptions({
+ aspectRatio: x + ':' + y
+ });
+
+ if ( sel = this.iasapi.getSelection(true) ) {
+ r = Math.ceil( sel.y1 + ( ( sel.x2 - sel.x1 ) / ( x / y ) ) );
+
+ if ( r > h ) {
+ r = h;
+ if ( n ) {
+ $('#imgedit-crop-height-' + postid).val('');
+ } else {
+ $('#imgedit-crop-width-' + postid).val('');
+ }
+ }
+
+ this.iasapi.setSelection( sel.x1, sel.y1, sel.x2, r );
+ this.iasapi.update();
+ }
+ }
+ },
+
+ /**
+ * Validates if a value in a jQuery.HTMLElement is numeric.
+ *
+ * @memberof imageEdit
+ * @since 4.6
+ *
+ * @param {jQuery} el The html element.
+ *
+ * @returns {void|boolean} Returns false if the value is not numeric,
+ * void when it is.
+ */
+ validateNumeric: function( el ) {
+ if ( ! this.intval( $( el ).val() ) ) {
+ $( el ).val( '' );
+ return false;
+ }
+ }
+};
+})(jQuery);
diff --git a/www/crm/wp-admin/js/image-edit.min.js b/www/crm/wp-admin/js/image-edit.min.js
new file mode 100644
index 00000000..43eb5260
--- /dev/null
+++ b/www/crm/wp-admin/js/image-edit.min.js
@@ -0,0 +1 @@
+!function(a){var b=window.imageEdit={iasapi:{},hold:{},postid:"",_view:!1,handleCropToolClick:function(c,d,e){var f=a("#image-preview-"+c),g=this.iasapi.getSelection();isNaN(g.x1)&&(this.setCropSelection(c,{x1:0,y1:0,x2:f.innerWidth(),y2:f.innerHeight(),width:f.innerWidth(),height:f.innerHeight()}),g=this.iasapi.getSelection()),0===g.x1&&0===g.y1&&0===g.x2&&0===g.y2?(this.iasapi.setSelection(0,0,f.innerWidth(),f.innerHeight(),!0),this.iasapi.setOptions({show:!0}),this.iasapi.update()):b.crop(c,d,e)},intval:function(a){return 0|a},setDisabled:function(a,b){b?a.removeClass("disabled").prop("disabled",!1):a.addClass("disabled").prop("disabled",!0)},init:function(b){var c=this,d=a("#image-editor-"+c.postid),e=c.intval(a("#imgedit-x-"+b).val()),f=c.intval(a("#imgedit-y-"+b).val());c.postid!==b&&d.length&&c.close(c.postid),c.hold.w=c.hold.ow=e,c.hold.h=c.hold.oh=f,c.hold.xy_ratio=e/f,c.hold.sizer=parseFloat(a("#imgedit-sizer-"+b).val()),c.postid=b,a("#imgedit-response-"+b).empty(),a('input[type="text"]',"#imgedit-panel-"+b).keypress(function(b){var c=b.keyCode;if(36<c&&c<41&&a(this).blur(),13===c)return b.preventDefault(),b.stopPropagation(),!1})},toggleEditor:function(b,c){var d=a("#imgedit-wait-"+b);c?d.fadeIn("fast"):d.fadeOut("fast")},toggleHelp:function(b){var c=a(b);return c.attr("aria-expanded","false"===c.attr("aria-expanded")?"true":"false").parents(".imgedit-group-top").toggleClass("imgedit-help-toggled").find(".imgedit-help").slideToggle("fast"),!1},getTarget:function(b){return a('input[name="imgedit-target-'+b+'"]:checked',"#imgedit-save-target-"+b).val()||"full"},scaleChanged:function(b,c,d){var e=a("#imgedit-scale-width-"+b),f=a("#imgedit-scale-height-"+b),g=a("#imgedit-scale-warn-"+b),h="",i="";!1!==this.validateNumeric(d)&&(c?(i=""!==e.val()?Math.round(e.val()/this.hold.xy_ratio):"",f.val(i)):(h=""!==f.val()?Math.round(f.val()*this.hold.xy_ratio):"",e.val(h)),i&&i>this.hold.oh||h&&h>this.hold.ow?g.css("visibility","visible"):g.css("visibility","hidden"))},getSelRatio:function(b){var c=this.hold.w,d=this.hold.h,e=this.intval(a("#imgedit-crop-width-"+b).val()),f=this.intval(a("#imgedit-crop-height-"+b).val());return e&&f?e+":"+f:c&&d?c+":"+d:"1:1"},filterHistory:function(b,c){var d,e,f,g,h=a("#imgedit-history-"+b).val(),i=[];if(""!==h){if(h=JSON.parse(h),d=this.intval(a("#imgedit-undone-"+b).val()),d>0)for(;d>0;)h.pop(),d--;if(c){if(!h.length)return this.hold.w=this.hold.ow,this.hold.h=this.hold.oh,"";f=h[h.length-1],f=f.c||f.r||f.f||!1,f&&(this.hold.w=f.fw,this.hold.h=f.fh)}for(e in h)g=h[e],g.hasOwnProperty("c")?i[e]={c:{x:g.c.x,y:g.c.y,w:g.c.w,h:g.c.h}}:g.hasOwnProperty("r")?i[e]={r:g.r.r}:g.hasOwnProperty("f")&&(i[e]={f:g.f.f});return JSON.stringify(i)}return""},refreshEditor:function(c,d,e){var f,g,h=this;h.toggleEditor(c,1),f={action:"imgedit-preview",_ajax_nonce:d,postid:c,history:h.filterHistory(c,1),rand:h.intval(1e6*Math.random())},g=a('<img id="image-preview-'+c+'" alt="" />').on("load",{history:f.history},function(d){var f,h,i,j=a("#imgedit-crop-"+c),k=b;""!==d.data.history&&(i=JSON.parse(d.data.history),i[i.length-1].hasOwnProperty("c")&&(k.setDisabled(a("#image-undo-"+c),!0),a("#image-undo-"+c).focus())),j.empty().append(g),f=Math.max(k.hold.w,k.hold.h),h=Math.max(a(g).width(),a(g).height()),k.hold.sizer=f>h?h/f:1,k.initCrop(c,g,j),"undefined"!=typeof e&&null!==e&&e(),a("#imgedit-history-"+c).val()&&"0"===a("#imgedit-undone-"+c).val()?a("input.imgedit-submit-btn","#imgedit-panel-"+c).removeAttr("disabled"):a("input.imgedit-submit-btn","#imgedit-panel-"+c).prop("disabled",!0),k.toggleEditor(c,0)}).on("error",function(){a("#imgedit-crop-"+c).empty().append('<div class="error"><p>'+imageEditL10n.error+"</p></div>"),h.toggleEditor(c,0)}).attr("src",ajaxurl+"?"+a.param(f))},action:function(b,c,d){var e,f,g,h,i,j=this;if(j.notsaved(b))return!1;if(e={action:"image-editor",_ajax_nonce:c,postid:b},"scale"===d){if(f=a("#imgedit-scale-width-"+b),g=a("#imgedit-scale-height-"+b),h=j.intval(f.val()),i=j.intval(g.val()),h<1)return f.focus(),!1;if(i<1)return g.focus(),!1;if(h===j.hold.ow||i===j.hold.oh)return!1;e["do"]="scale",e.fwidth=h,e.fheight=i}else{if("restore"!==d)return!1;e["do"]="restore"}j.toggleEditor(b,1),a.post(ajaxurl,e,function(c){a("#image-editor-"+b).empty().append(c),j.toggleEditor(b,0),j._view&&j._view.refresh()})},save:function(c,d){var e,f=this.getTarget(c),g=this.filterHistory(c,0),h=this;return""!==g&&(this.toggleEditor(c,1),e={action:"image-editor",_ajax_nonce:d,postid:c,history:g,target:f,context:a("#image-edit-context").length?a("#image-edit-context").val():null,"do":"save"},void a.post(ajaxurl,e,function(d){var e=JSON.parse(d);return e.error?(a("#imgedit-response-"+c).html('<div class="error"><p>'+e.error+"</p></div>"),void b.close(c)):(e.fw&&e.fh&&a("#media-dims-"+c).html(e.fw+" &times; "+e.fh),e.thumbnail&&a(".thumbnail","#thumbnail-head-"+c).attr("src",""+e.thumbnail),e.msg&&a("#imgedit-response-"+c).html('<div class="updated"><p>'+e.msg+"</p></div>"),void(h._view?h._view.save():b.close(c)))}))},open:function(c,d,e){this._view=e;var f,g,h=a("#image-editor-"+c),i=a("#media-head-"+c),j=a("#imgedit-open-btn-"+c),k=j.siblings(".spinner");if(!j.hasClass("button-activated"))return k.addClass("is-active"),g={action:"image-editor",_ajax_nonce:d,postid:c,"do":"open"},f=a.ajax({url:ajaxurl,type:"post",data:g,beforeSend:function(){j.addClass("button-activated")}}).done(function(a){h.html(a),i.fadeOut("fast",function(){h.fadeIn("fast"),j.removeClass("button-activated"),k.removeClass("is-active")}),b.init(c)})},imgLoaded:function(b){var c=a("#image-preview-"+b),d=a("#imgedit-crop-"+b);"undefined"==typeof this.hold.sizer&&this.init(b),this.initCrop(b,c,d),this.setCropSelection(b,{x1:0,y1:0,x2:0,y2:0,width:c.innerWidth(),height:c.innerHeight()}),this.toggleEditor(b,0),a(".imgedit-wrap .imgedit-help-toggle").eq(0).focus()},initCrop:function(c,d,e){var f,g=this,h=a("#imgedit-sel-width-"+c),i=a("#imgedit-sel-height-"+c);g.iasapi=a(d).imgAreaSelect({parent:e,instance:!0,handles:!0,keys:!0,minWidth:3,minHeight:3,onInit:function(b){f=a(b),f.next().css("position","absolute").nextAll(".imgareaselect-outer").css("position","absolute"),e.children().on("mousedown, touchstart",function(a){var b,d,e=!1;a.shiftKey&&(b=g.iasapi.getSelection(),d=g.getSelRatio(c),e=b&&b.width&&b.height?b.width+":"+b.height:d),g.iasapi.setOptions({aspectRatio:e})})},onSelectStart:function(){b.setDisabled(a("#imgedit-crop-sel-"+c),1)},onSelectEnd:function(a,d){b.setCropSelection(c,d)},onSelectChange:function(a,c){var d=b.hold.sizer;h.val(b.round(c.width/d)),i.val(b.round(c.height/d))}})},setCropSelection:function(b,c){var d;return c=c||0,!c||c.width<3&&c.height<3?(this.setDisabled(a(".imgedit-crop","#imgedit-panel-"+b),1),this.setDisabled(a("#imgedit-crop-sel-"+b),1),a("#imgedit-sel-width-"+b).val(""),a("#imgedit-sel-height-"+b).val(""),a("#imgedit-selection-"+b).val(""),!1):(d={x:c.x1,y:c.y1,w:c.width,h:c.height},this.setDisabled(a(".imgedit-crop","#imgedit-panel-"+b),1),void a("#imgedit-selection-"+b).val(JSON.stringify(d)))},close:function(b,c){return c=c||!1,(!c||!this.notsaved(b))&&(this.iasapi={},this.hold={},void(this._view?this._view.back():a("#image-editor-"+b).fadeOut("fast",function(){a("#media-head-"+b).fadeIn("fast",function(){a("#imgedit-open-btn-"+b).focus()}),a(this).empty()})))},notsaved:function(b){var c=a("#imgedit-history-"+b).val(),d=""!==c?JSON.parse(c):[],e=this.intval(a("#imgedit-undone-"+b).val());return e<d.length&&!confirm(a("#imgedit-leaving-"+b).html())},addStep:function(b,c,d){for(var e=this,f=a("#imgedit-history-"+c),g=""!==f.val()?JSON.parse(f.val()):[],h=a("#imgedit-undone-"+c),i=e.intval(h.val());i>0;)g.pop(),i--;h.val(0),g.push(b),f.val(JSON.stringify(g)),e.refreshEditor(c,d,function(){e.setDisabled(a("#image-undo-"+c),!0),e.setDisabled(a("#image-redo-"+c),!1)})},rotate:function(b,c,d,e){return!a(e).hasClass("disabled")&&void this.addStep({r:{r:b,fw:this.hold.h,fh:this.hold.w}},c,d)},flip:function(b,c,d,e){return!a(e).hasClass("disabled")&&void this.addStep({f:{f:b,fw:this.hold.w,fh:this.hold.h}},c,d)},crop:function(b,c,d){var e=a("#imgedit-selection-"+b).val(),f=this.intval(a("#imgedit-sel-width-"+b).val()),g=this.intval(a("#imgedit-sel-height-"+b).val());return!a(d).hasClass("disabled")&&""!==e&&(e=JSON.parse(e),void(e.w>0&&e.h>0&&f>0&&g>0&&(e.fw=f,e.fh=g,this.addStep({c:e},b,c))))},undo:function(b,c){var d=this,e=a("#image-undo-"+b),f=a("#imgedit-undone-"+b),g=d.intval(f.val())+1;e.hasClass("disabled")||(f.val(g),d.refreshEditor(b,c,function(){var c=a("#imgedit-history-"+b),f=""!==c.val()?JSON.parse(c.val()):[];d.setDisabled(a("#image-redo-"+b),!0),d.setDisabled(e,g<f.length),f.length===g&&a("#image-redo-"+b).focus()}))},redo:function(b,c){var d=this,e=a("#image-redo-"+b),f=a("#imgedit-undone-"+b),g=d.intval(f.val())-1;e.hasClass("disabled")||(f.val(g),d.refreshEditor(b,c,function(){d.setDisabled(a("#image-undo-"+b),!0),d.setDisabled(e,g>0),0===g&&a("#image-undo-"+b).focus()}))},setNumSelection:function(b,c){var d,e,f,g,h,i=a("#imgedit-sel-width-"+b),j=a("#imgedit-sel-height-"+b),k=this.intval(i.val()),l=this.intval(j.val()),m=a("#image-preview-"+b),n=m.height(),o=m.width(),p=this.hold.sizer,q=this.iasapi;if(!1!==this.validateNumeric(c))return k<1?(i.val(""),!1):l<1?(j.val(""),!1):void(k&&l&&(d=q.getSelection())&&(g=d.x1+Math.round(k*p),h=d.y1+Math.round(l*p),e=d.x1,f=d.y1,g>o&&(e=0,g=o,i.val(Math.round(g/p))),h>n&&(f=0,h=n,j.val(Math.round(h/p))),q.setSelection(e,f,g,h),q.update(),this.setCropSelection(b,q.getSelection())))},round:function(a){var b;return a=Math.round(a),this.hold.sizer>.6?a:(b=a.toString().slice(-1),"1"===b?a-1:"9"===b?a+1:a)},setRatioSelection:function(b,c,d){var e,f,g=this.intval(a("#imgedit-crop-width-"+b).val()),h=this.intval(a("#imgedit-crop-height-"+b).val()),i=a("#image-preview-"+b).height();!1!==this.validateNumeric(d)&&g&&h&&(this.iasapi.setOptions({aspectRatio:g+":"+h}),(e=this.iasapi.getSelection(!0))&&(f=Math.ceil(e.y1+(e.x2-e.x1)/(g/h)),f>i&&(f=i,c?a("#imgedit-crop-height-"+b).val(""):a("#imgedit-crop-width-"+b).val("")),this.iasapi.setSelection(e.x1,e.y1,e.x2,f),this.iasapi.update()))},validateNumeric:function(b){if(!this.intval(a(b).val()))return a(b).val(""),!1}}}(jQuery); \ No newline at end of file
diff --git a/www/crm/wp-admin/js/inline-edit-post.js b/www/crm/wp-admin/js/inline-edit-post.js
new file mode 100644
index 00000000..cdca55dd
--- /dev/null
+++ b/www/crm/wp-admin/js/inline-edit-post.js
@@ -0,0 +1,556 @@
+/**
+ * This file contains the functions needed for the inline editing of posts.
+ *
+ * @since 2.7.0
+ * @output wp-admin/js/inline-edit-post.js
+ */
+
+/* global inlineEditL10n, ajaxurl, typenow, inlineEditPost */
+
+window.wp = window.wp || {};
+
+/**
+ * Manages the quick edit and bulk edit windows for editing posts or pages.
+ *
+ * @namespace inlineEditPost
+ *
+ * @since 2.7.0
+ *
+ * @type {Object}
+ *
+ * @property {string} type The type of inline editor.
+ * @property {string} what The prefix before the post id.
+ *
+ */
+( function( $, wp ) {
+
+ window.inlineEditPost = {
+
+ /**
+ * Initializes the inline and bulk post editor.
+ *
+ * Binds event handlers to the escape key to close the inline editor
+ * and to the save and close buttons. Changes DOM to be ready for inline
+ * editing. Adds event handler to bulk edit.
+ *
+ * @memberof inlineEditPost
+ * @since 2.7.0
+ *
+ * @returns {void}
+ */
+ init : function(){
+ var t = this, qeRow = $('#inline-edit'), bulkRow = $('#bulk-edit');
+
+ t.type = $('table.widefat').hasClass('pages') ? 'page' : 'post';
+ // Post id prefix.
+ t.what = '#post-';
+
+ /**
+ * Binds the escape key to revert the changes and close the quick editor.
+ *
+ * @returns {boolean} The result of revert.
+ */
+ qeRow.keyup(function(e){
+ // Revert changes if escape key is pressed.
+ if ( e.which === 27 ) {
+ return inlineEditPost.revert();
+ }
+ });
+
+ /**
+ * Binds the escape key to revert the changes and close the bulk editor.
+ *
+ * @returns {boolean} The result of revert.
+ */
+ bulkRow.keyup(function(e){
+ // Revert changes if escape key is pressed.
+ if ( e.which === 27 ) {
+ return inlineEditPost.revert();
+ }
+ });
+
+ /**
+ * Reverts changes and close the quick editor if the cancel button is clicked.
+ *
+ * @returns {boolean} The result of revert.
+ */
+ $( '.cancel', qeRow ).click( function() {
+ return inlineEditPost.revert();
+ });
+
+ /**
+ * Saves changes in the quick editor if the save(named: update) button is clicked.
+ *
+ * @returns {boolean} The result of save.
+ */
+ $( '.save', qeRow ).click( function() {
+ return inlineEditPost.save(this);
+ });
+
+ /**
+ * If enter is pressed, and the target is not the cancel button, save the post.
+ *
+ * @returns {boolean} The result of save.
+ */
+ $('td', qeRow).keydown(function(e){
+ if ( e.which === 13 && ! $( e.target ).hasClass( 'cancel' ) ) {
+ return inlineEditPost.save(this);
+ }
+ });
+
+ /**
+ * Reverts changes and close the bulk editor if the cancel button is clicked.
+ *
+ * @returns {boolean} The result of revert.
+ */
+ $( '.cancel', bulkRow ).click( function() {
+ return inlineEditPost.revert();
+ });
+
+ /**
+ * Disables the password input field when the private post checkbox is checked.
+ */
+ $('#inline-edit .inline-edit-private input[value="private"]').click( function(){
+ var pw = $('input.inline-edit-password-input');
+ if ( $(this).prop('checked') ) {
+ pw.val('').prop('disabled', true);
+ } else {
+ pw.prop('disabled', false);
+ }
+ });
+
+ /**
+ * Binds click event to the .editinline button which opens the quick editor.
+ */
+ $( '#the-list' ).on( 'click', '.editinline', function() {
+ $( this ).attr( 'aria-expanded', 'true' );
+ inlineEditPost.edit( this );
+ });
+
+ $('#bulk-edit').find('fieldset:first').after(
+ $('#inline-edit fieldset.inline-edit-categories').clone()
+ ).siblings( 'fieldset:last' ).prepend(
+ $('#inline-edit label.inline-edit-tags').clone()
+ );
+
+ $('select[name="_status"] option[value="future"]', bulkRow).remove();
+
+ /**
+ * Adds onclick events to the apply buttons.
+ */
+ $('#doaction, #doaction2').click(function(e){
+ var n;
+
+ t.whichBulkButtonId = $( this ).attr( 'id' );
+ n = t.whichBulkButtonId.substr( 2 );
+
+ if ( 'edit' === $( 'select[name="' + n + '"]' ).val() ) {
+ e.preventDefault();
+ t.setBulk();
+ } else if ( $('form#posts-filter tr.inline-editor').length > 0 ) {
+ t.revert();
+ }
+ });
+ },
+
+ /**
+ * Toggles the quick edit window, hiding it when it's active and showing it when
+ * inactive.
+ *
+ * @memberof inlineEditPost
+ * @since 2.7.0
+ *
+ * @param {Object} el Element within a post table row.
+ */
+ toggle : function(el){
+ var t = this;
+ $( t.what + t.getId( el ) ).css( 'display' ) === 'none' ? t.revert() : t.edit( el );
+ },
+
+ /**
+ * Creates the bulk editor row to edit multiple posts at once.
+ *
+ * @memberof inlineEditPost
+ * @since 2.7.0
+ */
+ setBulk : function(){
+ var te = '', type = this.type, c = true;
+ this.revert();
+
+ $( '#bulk-edit td' ).attr( 'colspan', $( 'th:visible, td:visible', '.widefat:first thead' ).length );
+
+ // Insert the editor at the top of the table with an empty row above to maintain zebra striping.
+ $('table.widefat tbody').prepend( $('#bulk-edit') ).prepend('<tr class="hidden"></tr>');
+ $('#bulk-edit').addClass('inline-editor').show();
+
+ /**
+ * Create a HTML div with the title and a link(delete-icon) for each selected
+ * post.
+ *
+ * Get the selected posts based on the checked checkboxes in the post table.
+ */
+ $( 'tbody th.check-column input[type="checkbox"]' ).each( function() {
+
+ // If the checkbox for a post is selected, add the post to the edit list.
+ if ( $(this).prop('checked') ) {
+ c = false;
+ var id = $(this).val(), theTitle;
+ theTitle = $('#inline_'+id+' .post_title').html() || inlineEditL10n.notitle;
+ te += '<div id="ttle'+id+'"><a id="_'+id+'" class="ntdelbutton" title="'+inlineEditL10n.ntdeltitle+'">X</a>'+theTitle+'</div>';
+ }
+ });
+
+ // If no checkboxes where checked, just hide the quick/bulk edit rows.
+ if ( c ) {
+ return this.revert();
+ }
+
+ // Add onclick events to the delete-icons in the bulk editors the post title list.
+ $('#bulk-titles').html(te);
+ /**
+ * Binds on click events to the checkboxes before the posts in the table.
+ *
+ * @listens click
+ */
+ $('#bulk-titles a').click(function(){
+ var id = $(this).attr('id').substr(1);
+
+ $('table.widefat input[value="' + id + '"]').prop('checked', false);
+ $('#ttle'+id).remove();
+ });
+
+ // Enable auto-complete for tags when editing posts.
+ if ( 'post' === type ) {
+ $( 'tr.inline-editor textarea[data-wp-taxonomy]' ).each( function ( i, element ) {
+ /*
+ * While Quick Edit clones the form each time, Bulk Edit always re-uses
+ * the same form. Let's check if an autocomplete instance already exists.
+ */
+ if ( $( element ).autocomplete( 'instance' ) ) {
+ // jQuery equivalent of `continue` within an `each()` loop.
+ return;
+ }
+
+ $( element ).wpTagsSuggest();
+ } );
+ }
+
+ // Scrolls to the top of the table where the editor is rendered.
+ $('html, body').animate( { scrollTop: 0 }, 'fast' );
+ },
+
+ /**
+ * Creates a quick edit window for the post that has been clicked.
+ *
+ * @memberof inlineEditPost
+ * @since 2.7.0
+ *
+ * @param {number|Object} id The id of the clicked post or an element within a post
+ * table row.
+ * @returns {boolean} Always returns false at the end of execution.
+ */
+ edit : function(id) {
+ var t = this, fields, editRow, rowData, status, pageOpt, pageLevel, nextPage, pageLoop = true, nextLevel, f, val, pw;
+ t.revert();
+
+ if ( typeof(id) === 'object' ) {
+ id = t.getId(id);
+ }
+
+ fields = ['post_title', 'post_name', 'post_author', '_status', 'jj', 'mm', 'aa', 'hh', 'mn', 'ss', 'post_password', 'post_format', 'menu_order', 'page_template'];
+ if ( t.type === 'page' ) {
+ fields.push('post_parent');
+ }
+
+ // Add the new edit row with an extra blank row underneath to maintain zebra striping.
+ editRow = $('#inline-edit').clone(true);
+ $( 'td', editRow ).attr( 'colspan', $( 'th:visible, td:visible', '.widefat:first thead' ).length );
+
+ $(t.what+id).removeClass('is-expanded').hide().after(editRow).after('<tr class="hidden"></tr>');
+
+ // Populate fields in the quick edit window.
+ rowData = $('#inline_'+id);
+ if ( !$(':input[name="post_author"] option[value="' + $('.post_author', rowData).text() + '"]', editRow).val() ) {
+
+ // The post author no longer has edit capabilities, so we need to add them to the list of authors.
+ $(':input[name="post_author"]', editRow).prepend('<option value="' + $('.post_author', rowData).text() + '">' + $('#' + t.type + '-' + id + ' .author').text() + '</option>');
+ }
+ if ( $( ':input[name="post_author"] option', editRow ).length === 1 ) {
+ $('label.inline-edit-author', editRow).hide();
+ }
+
+ for ( f = 0; f < fields.length; f++ ) {
+ val = $('.'+fields[f], rowData);
+
+ /**
+ * Replaces the image for a Twemoji(Twitter emoji) with it's alternate text.
+ *
+ * @returns Alternate text from the image.
+ */
+ val.find( 'img' ).replaceWith( function() { return this.alt; } );
+ val = val.text();
+ $(':input[name="' + fields[f] + '"]', editRow).val( val );
+ }
+
+ if ( $( '.comment_status', rowData ).text() === 'open' ) {
+ $( 'input[name="comment_status"]', editRow ).prop( 'checked', true );
+ }
+ if ( $( '.ping_status', rowData ).text() === 'open' ) {
+ $( 'input[name="ping_status"]', editRow ).prop( 'checked', true );
+ }
+ if ( $( '.sticky', rowData ).text() === 'sticky' ) {
+ $( 'input[name="sticky"]', editRow ).prop( 'checked', true );
+ }
+
+ /**
+ * Creates the select boxes for the categories.
+ */
+ $('.post_category', rowData).each(function(){
+ var taxname,
+ term_ids = $(this).text();
+
+ if ( term_ids ) {
+ taxname = $(this).attr('id').replace('_'+id, '');
+ $('ul.'+taxname+'-checklist :checkbox', editRow).val(term_ids.split(','));
+ }
+ });
+
+ /**
+ * Gets all the taxonomies for live auto-fill suggestions when typing the name
+ * of a tag.
+ */
+ $('.tags_input', rowData).each(function(){
+ var terms = $(this),
+ taxname = $(this).attr('id').replace('_' + id, ''),
+ textarea = $('textarea.tax_input_' + taxname, editRow),
+ comma = inlineEditL10n.comma;
+
+ terms.find( 'img' ).replaceWith( function() { return this.alt; } );
+ terms = terms.text();
+
+ if ( terms ) {
+ if ( ',' !== comma ) {
+ terms = terms.replace(/,/g, comma);
+ }
+ textarea.val(terms);
+ }
+
+ textarea.wpTagsSuggest();
+ });
+
+ // Handle the post status.
+ status = $('._status', rowData).text();
+ if ( 'future' !== status ) {
+ $('select[name="_status"] option[value="future"]', editRow).remove();
+ }
+
+ pw = $( '.inline-edit-password-input' ).prop( 'disabled', false );
+ if ( 'private' === status ) {
+ $('input[name="keep_private"]', editRow).prop('checked', true);
+ pw.val( '' ).prop( 'disabled', true );
+ }
+
+ // Remove the current page and children from the parent dropdown.
+ pageOpt = $('select[name="post_parent"] option[value="' + id + '"]', editRow);
+ if ( pageOpt.length > 0 ) {
+ pageLevel = pageOpt[0].className.split('-')[1];
+ nextPage = pageOpt;
+ while ( pageLoop ) {
+ nextPage = nextPage.next('option');
+ if ( nextPage.length === 0 ) {
+ break;
+ }
+
+ nextLevel = nextPage[0].className.split('-')[1];
+
+ if ( nextLevel <= pageLevel ) {
+ pageLoop = false;
+ } else {
+ nextPage.remove();
+ nextPage = pageOpt;
+ }
+ }
+ pageOpt.remove();
+ }
+
+ $(editRow).attr('id', 'edit-'+id).addClass('inline-editor').show();
+ $('.ptitle', editRow).focus();
+
+ return false;
+ },
+
+ /**
+ * Saves the changes made in the quick edit window to the post.
+ * AJAX saving is only for Quick Edit and not for bulk edit.
+ *
+ * @since 2.7.0
+ *
+ * @param {int} id The id for the post that has been changed.
+ * @returns {boolean} false, so the form does not submit when pressing
+ * Enter on a focused field.
+ */
+ save : function(id) {
+ var params, fields, page = $('.post_status_page').val() || '';
+
+ if ( typeof(id) === 'object' ) {
+ id = this.getId(id);
+ }
+
+ $( 'table.widefat .spinner' ).addClass( 'is-active' );
+
+ params = {
+ action: 'inline-save',
+ post_type: typenow,
+ post_ID: id,
+ edit_date: 'true',
+ post_status: page
+ };
+
+ fields = $('#edit-'+id).find(':input').serialize();
+ params = fields + '&' + $.param(params);
+
+ // Make ajax request.
+ $.post( ajaxurl, params,
+ function(r) {
+ var $errorNotice = $( '#edit-' + id + ' .inline-edit-save .notice-error' ),
+ $error = $errorNotice.find( '.error' );
+
+ $( 'table.widefat .spinner' ).removeClass( 'is-active' );
+ $( '.ac_results' ).hide();
+
+ if (r) {
+ if ( -1 !== r.indexOf( '<tr' ) ) {
+ $(inlineEditPost.what+id).siblings('tr.hidden').addBack().remove();
+ $('#edit-'+id).before(r).remove();
+ $( inlineEditPost.what + id ).hide().fadeIn( 400, function() {
+ // Move focus back to the Quick Edit button. $( this ) is the row being animated.
+ $( this ).find( '.editinline' )
+ .attr( 'aria-expanded', 'false' )
+ .focus();
+ wp.a11y.speak( inlineEditL10n.saved );
+ });
+ } else {
+ r = r.replace( /<.[^<>]*?>/g, '' );
+ $errorNotice.removeClass( 'hidden' );
+ $error.html( r );
+ wp.a11y.speak( $error.text() );
+ }
+ } else {
+ $errorNotice.removeClass( 'hidden' );
+ $error.html( inlineEditL10n.error );
+ wp.a11y.speak( inlineEditL10n.error );
+ }
+ },
+ 'html');
+
+ // Prevent submitting the form when pressing Enter on a focused field.
+ return false;
+ },
+
+ /**
+ * Hides and empties the Quick Edit and/or Bulk Edit windows.
+ *
+ * @memberof inlineEditPost
+ * @since 2.7.0
+ *
+ * @returns {boolean} Always returns false.
+ */
+ revert : function(){
+ var $tableWideFat = $( '.widefat' ),
+ id = $( '.inline-editor', $tableWideFat ).attr( 'id' );
+
+ if ( id ) {
+ $( '.spinner', $tableWideFat ).removeClass( 'is-active' );
+ $( '.ac_results' ).hide();
+
+ if ( 'bulk-edit' === id ) {
+
+ // Hide the bulk editor.
+ $( '#bulk-edit', $tableWideFat ).removeClass( 'inline-editor' ).hide().siblings( '.hidden' ).remove();
+ $('#bulk-titles').empty();
+
+ // Store the empty bulk editor in a hidden element.
+ $('#inlineedit').append( $('#bulk-edit') );
+
+ // Move focus back to the Bulk Action button that was activated.
+ $( '#' + inlineEditPost.whichBulkButtonId ).focus();
+ } else {
+
+ // Remove both the inline-editor and its hidden tr siblings.
+ $('#'+id).siblings('tr.hidden').addBack().remove();
+ id = id.substr( id.lastIndexOf('-') + 1 );
+
+ // Show the post row and move focus back to the Quick Edit button.
+ $( this.what + id ).show().find( '.editinline' )
+ .attr( 'aria-expanded', 'false' )
+ .focus();
+ }
+ }
+
+ return false;
+ },
+
+ /**
+ * Gets the id for a the post that you want to quick edit from the row in the quick
+ * edit table.
+ *
+ * @memberof inlineEditPost
+ * @since 2.7.0
+ *
+ * @param {Object} o DOM row object to get the id for.
+ * @returns {string} The post id extracted from the table row in the object.
+ */
+ getId : function(o) {
+ var id = $(o).closest('tr').attr('id'),
+ parts = id.split('-');
+ return parts[parts.length - 1];
+ }
+};
+
+$( document ).ready( function(){ inlineEditPost.init(); } );
+
+// Show/hide locks on posts.
+$( document ).on( 'heartbeat-tick.wp-check-locked-posts', function( e, data ) {
+ var locked = data['wp-check-locked-posts'] || {};
+
+ $('#the-list tr').each( function(i, el) {
+ var key = el.id, row = $(el), lock_data, avatar;
+
+ if ( locked.hasOwnProperty( key ) ) {
+ if ( ! row.hasClass('wp-locked') ) {
+ lock_data = locked[key];
+ row.find('.column-title .locked-text').text( lock_data.text );
+ row.find('.check-column checkbox').prop('checked', false);
+
+ if ( lock_data.avatar_src ) {
+ avatar = $( '<img class="avatar avatar-18 photo" width="18" height="18" alt="" />' ).attr( 'src', lock_data.avatar_src.replace( /&amp;/g, '&' ) );
+ row.find('.column-title .locked-avatar').empty().append( avatar );
+ }
+ row.addClass('wp-locked');
+ }
+ } else if ( row.hasClass('wp-locked') ) {
+ // Make room for the CSS animation
+ row.removeClass('wp-locked').delay(1000).find('.locked-info span').empty();
+ }
+ });
+}).on( 'heartbeat-send.wp-check-locked-posts', function( e, data ) {
+ var check = [];
+
+ $('#the-list tr').each( function(i, el) {
+ if ( el.id ) {
+ check.push( el.id );
+ }
+ });
+
+ if ( check.length ) {
+ data['wp-check-locked-posts'] = check;
+ }
+}).ready( function() {
+
+ // Set the heartbeat interval to 15 sec.
+ if ( typeof wp !== 'undefined' && wp.heartbeat ) {
+ wp.heartbeat.interval( 15 );
+ }
+});
+
+})( jQuery, window.wp );
diff --git a/www/crm/wp-admin/js/inline-edit-post.min.js b/www/crm/wp-admin/js/inline-edit-post.min.js
new file mode 100644
index 00000000..4ddda711
--- /dev/null
+++ b/www/crm/wp-admin/js/inline-edit-post.min.js
@@ -0,0 +1 @@
+window.wp=window.wp||{},function(a,b){window.inlineEditPost={init:function(){var b=this,c=a("#inline-edit"),d=a("#bulk-edit");b.type=a("table.widefat").hasClass("pages")?"page":"post",b.what="#post-",c.keyup(function(a){if(27===a.which)return inlineEditPost.revert()}),d.keyup(function(a){if(27===a.which)return inlineEditPost.revert()}),a(".cancel",c).click(function(){return inlineEditPost.revert()}),a(".save",c).click(function(){return inlineEditPost.save(this)}),a("td",c).keydown(function(b){if(13===b.which&&!a(b.target).hasClass("cancel"))return inlineEditPost.save(this)}),a(".cancel",d).click(function(){return inlineEditPost.revert()}),a('#inline-edit .inline-edit-private input[value="private"]').click(function(){var b=a("input.inline-edit-password-input");a(this).prop("checked")?b.val("").prop("disabled",!0):b.prop("disabled",!1)}),a("#the-list").on("click",".editinline",function(){a(this).attr("aria-expanded","true"),inlineEditPost.edit(this)}),a("#bulk-edit").find("fieldset:first").after(a("#inline-edit fieldset.inline-edit-categories").clone()).siblings("fieldset:last").prepend(a("#inline-edit label.inline-edit-tags").clone()),a('select[name="_status"] option[value="future"]',d).remove(),a("#doaction, #doaction2").click(function(c){var d;b.whichBulkButtonId=a(this).attr("id"),d=b.whichBulkButtonId.substr(2),"edit"===a('select[name="'+d+'"]').val()?(c.preventDefault(),b.setBulk()):a("form#posts-filter tr.inline-editor").length>0&&b.revert()})},toggle:function(b){var c=this;"none"===a(c.what+c.getId(b)).css("display")?c.revert():c.edit(b)},setBulk:function(){var b="",c=this.type,d=!0;return this.revert(),a("#bulk-edit td").attr("colspan",a("th:visible, td:visible",".widefat:first thead").length),a("table.widefat tbody").prepend(a("#bulk-edit")).prepend('<tr class="hidden"></tr>'),a("#bulk-edit").addClass("inline-editor").show(),a('tbody th.check-column input[type="checkbox"]').each(function(){if(a(this).prop("checked")){d=!1;var c,e=a(this).val();c=a("#inline_"+e+" .post_title").html()||inlineEditL10n.notitle,b+='<div id="ttle'+e+'"><a id="_'+e+'" class="ntdelbutton" title="'+inlineEditL10n.ntdeltitle+'">X</a>'+c+"</div>"}}),d?this.revert():(a("#bulk-titles").html(b),a("#bulk-titles a").click(function(){var b=a(this).attr("id").substr(1);a('table.widefat input[value="'+b+'"]').prop("checked",!1),a("#ttle"+b).remove()}),"post"===c&&a("tr.inline-editor textarea[data-wp-taxonomy]").each(function(b,c){a(c).autocomplete("instance")||a(c).wpTagsSuggest()}),void a("html, body").animate({scrollTop:0},"fast"))},edit:function(b){var c,d,e,f,g,h,i,j,k,l,m,n=this,o=!0;for(n.revert(),"object"==typeof b&&(b=n.getId(b)),c=["post_title","post_name","post_author","_status","jj","mm","aa","hh","mn","ss","post_password","post_format","menu_order","page_template"],"page"===n.type&&c.push("post_parent"),d=a("#inline-edit").clone(!0),a("td",d).attr("colspan",a("th:visible, td:visible",".widefat:first thead").length),a(n.what+b).removeClass("is-expanded").hide().after(d).after('<tr class="hidden"></tr>'),e=a("#inline_"+b),a(':input[name="post_author"] option[value="'+a(".post_author",e).text()+'"]',d).val()||a(':input[name="post_author"]',d).prepend('<option value="'+a(".post_author",e).text()+'">'+a("#"+n.type+"-"+b+" .author").text()+"</option>"),1===a(':input[name="post_author"] option',d).length&&a("label.inline-edit-author",d).hide(),k=0;k<c.length;k++)l=a("."+c[k],e),l.find("img").replaceWith(function(){return this.alt}),l=l.text(),a(':input[name="'+c[k]+'"]',d).val(l);if("open"===a(".comment_status",e).text()&&a('input[name="comment_status"]',d).prop("checked",!0),"open"===a(".ping_status",e).text()&&a('input[name="ping_status"]',d).prop("checked",!0),"sticky"===a(".sticky",e).text()&&a('input[name="sticky"]',d).prop("checked",!0),a(".post_category",e).each(function(){var c,e=a(this).text();e&&(c=a(this).attr("id").replace("_"+b,""),a("ul."+c+"-checklist :checkbox",d).val(e.split(",")))}),a(".tags_input",e).each(function(){var c=a(this),e=a(this).attr("id").replace("_"+b,""),f=a("textarea.tax_input_"+e,d),g=inlineEditL10n.comma;c.find("img").replaceWith(function(){return this.alt}),c=c.text(),c&&(","!==g&&(c=c.replace(/,/g,g)),f.val(c)),f.wpTagsSuggest()}),f=a("._status",e).text(),"future"!==f&&a('select[name="_status"] option[value="future"]',d).remove(),m=a(".inline-edit-password-input").prop("disabled",!1),"private"===f&&(a('input[name="keep_private"]',d).prop("checked",!0),m.val("").prop("disabled",!0)),g=a('select[name="post_parent"] option[value="'+b+'"]',d),g.length>0){for(h=g[0].className.split("-")[1],i=g;o&&(i=i.next("option"),0!==i.length);)j=i[0].className.split("-")[1],j<=h?o=!1:(i.remove(),i=g);g.remove()}return a(d).attr("id","edit-"+b).addClass("inline-editor").show(),a(".ptitle",d).focus(),!1},save:function(c){var d,e,f=a(".post_status_page").val()||"";return"object"==typeof c&&(c=this.getId(c)),a("table.widefat .spinner").addClass("is-active"),d={action:"inline-save",post_type:typenow,post_ID:c,edit_date:"true",post_status:f},e=a("#edit-"+c).find(":input").serialize(),d=e+"&"+a.param(d),a.post(ajaxurl,d,function(d){var e=a("#edit-"+c+" .inline-edit-save .notice-error"),f=e.find(".error");a("table.widefat .spinner").removeClass("is-active"),a(".ac_results").hide(),d?-1!==d.indexOf("<tr")?(a(inlineEditPost.what+c).siblings("tr.hidden").addBack().remove(),a("#edit-"+c).before(d).remove(),a(inlineEditPost.what+c).hide().fadeIn(400,function(){a(this).find(".editinline").attr("aria-expanded","false").focus(),b.a11y.speak(inlineEditL10n.saved)})):(d=d.replace(/<.[^<>]*?>/g,""),e.removeClass("hidden"),f.html(d),b.a11y.speak(f.text())):(e.removeClass("hidden"),f.html(inlineEditL10n.error),b.a11y.speak(inlineEditL10n.error))},"html"),!1},revert:function(){var b=a(".widefat"),c=a(".inline-editor",b).attr("id");return c&&(a(".spinner",b).removeClass("is-active"),a(".ac_results").hide(),"bulk-edit"===c?(a("#bulk-edit",b).removeClass("inline-editor").hide().siblings(".hidden").remove(),a("#bulk-titles").empty(),a("#inlineedit").append(a("#bulk-edit")),a("#"+inlineEditPost.whichBulkButtonId).focus()):(a("#"+c).siblings("tr.hidden").addBack().remove(),c=c.substr(c.lastIndexOf("-")+1),a(this.what+c).show().find(".editinline").attr("aria-expanded","false").focus())),!1},getId:function(b){var c=a(b).closest("tr").attr("id"),d=c.split("-");return d[d.length-1]}},a(document).ready(function(){inlineEditPost.init()}),a(document).on("heartbeat-tick.wp-check-locked-posts",function(b,c){var d=c["wp-check-locked-posts"]||{};a("#the-list tr").each(function(b,c){var e,f,g=c.id,h=a(c);d.hasOwnProperty(g)?h.hasClass("wp-locked")||(e=d[g],h.find(".column-title .locked-text").text(e.text),h.find(".check-column checkbox").prop("checked",!1),e.avatar_src&&(f=a('<img class="avatar avatar-18 photo" width="18" height="18" alt="" />').attr("src",e.avatar_src.replace(/&amp;/g,"&")),h.find(".column-title .locked-avatar").empty().append(f)),h.addClass("wp-locked")):h.hasClass("wp-locked")&&h.removeClass("wp-locked").delay(1e3).find(".locked-info span").empty()})}).on("heartbeat-send.wp-check-locked-posts",function(b,c){var d=[];a("#the-list tr").each(function(a,b){b.id&&d.push(b.id)}),d.length&&(c["wp-check-locked-posts"]=d)}).ready(function(){"undefined"!=typeof b&&b.heartbeat&&b.heartbeat.interval(15)})}(jQuery,window.wp); \ No newline at end of file
diff --git a/www/crm/wp-admin/js/inline-edit-tax.js b/www/crm/wp-admin/js/inline-edit-tax.js
new file mode 100644
index 00000000..bea01963
--- /dev/null
+++ b/www/crm/wp-admin/js/inline-edit-tax.js
@@ -0,0 +1,294 @@
+/**
+ * This file is used on the term overview page to power quick-editing terms.
+ *
+ * @output wp-admin/js/inline-edit-tax.js
+ */
+
+/* global inlineEditL10n, ajaxurl, inlineEditTax */
+
+window.wp = window.wp || {};
+
+/**
+ * Consists of functions relevant to the inline taxonomy editor.
+ *
+ * @namespace inlineEditTax
+ *
+ * @property {string} type The type of inline edit we are currently on.
+ * @property {string} what The type property with a hash prefixed and a dash
+ * suffixed.
+ */
+( function( $, wp ) {
+
+window.inlineEditTax = {
+
+ /**
+ * Initializes the inline taxonomy editor by adding event handlers to be able to
+ * quick edit.
+ *
+ * @since 2.7.0
+ *
+ * @this inlineEditTax
+ * @memberof inlineEditTax
+ * @returns {void}
+ */
+ init : function() {
+ var t = this, row = $('#inline-edit');
+
+ t.type = $('#the-list').attr('data-wp-lists').substr(5);
+ t.what = '#'+t.type+'-';
+
+ $( '#the-list' ).on( 'click', '.editinline', function() {
+ $( this ).attr( 'aria-expanded', 'true' );
+ inlineEditTax.edit( this );
+ });
+
+ /**
+ * Cancels inline editing when pressing escape inside the inline editor.
+ *
+ * @param {Object} e The keyup event that has been triggered.
+ */
+ row.keyup( function( e ) {
+ // 27 = [escape]
+ if ( e.which === 27 ) {
+ return inlineEditTax.revert();
+ }
+ });
+
+ /**
+ * Cancels inline editing when clicking the cancel button.
+ */
+ $( '.cancel', row ).click( function() {
+ return inlineEditTax.revert();
+ });
+
+ /**
+ * Saves the inline edits when clicking the save button.
+ */
+ $( '.save', row ).click( function() {
+ return inlineEditTax.save(this);
+ });
+
+ /**
+ * Saves the inline edits when pressing enter inside the inline editor.
+ */
+ $( 'input, select', row ).keydown( function( e ) {
+ // 13 = [enter]
+ if ( e.which === 13 ) {
+ return inlineEditTax.save( this );
+ }
+ });
+
+ /**
+ * Saves the inline edits on submitting the inline edit form.
+ */
+ $( '#posts-filter input[type="submit"]' ).mousedown( function() {
+ t.revert();
+ });
+ },
+
+ /**
+ * Toggles the quick edit based on if it is currently shown or hidden.
+ *
+ * @since 2.7.0
+ *
+ * @this inlineEditTax
+ * @memberof inlineEditTax
+ *
+ * @param {HTMLElement} el An element within the table row or the table row
+ * itself that we want to quick edit.
+ * @returns {void}
+ */
+ toggle : function(el) {
+ var t = this;
+
+ $(t.what+t.getId(el)).css('display') === 'none' ? t.revert() : t.edit(el);
+ },
+
+ /**
+ * Shows the quick editor
+ *
+ * @since 2.7.0
+ *
+ * @this inlineEditTax
+ * @memberof inlineEditTax
+ *
+ * @param {string|HTMLElement} id The ID of the term we want to quick edit or an
+ * element within the table row or the
+ * table row itself.
+ * @returns {boolean} Always returns false.
+ */
+ edit : function(id) {
+ var editRow, rowData, val,
+ t = this;
+ t.revert();
+
+ // Makes sure we can pass an HTMLElement as the ID.
+ if ( typeof(id) === 'object' ) {
+ id = t.getId(id);
+ }
+
+ editRow = $('#inline-edit').clone(true), rowData = $('#inline_'+id);
+ $( 'td', editRow ).attr( 'colspan', $( 'th:visible, td:visible', '.wp-list-table.widefat:first thead' ).length );
+
+ $(t.what+id).hide().after(editRow).after('<tr class="hidden"></tr>');
+
+ val = $('.name', rowData);
+ val.find( 'img' ).replaceWith( function() { return this.alt; } );
+ val = val.text();
+ $(':input[name="name"]', editRow).val( val );
+
+ val = $('.slug', rowData);
+ val.find( 'img' ).replaceWith( function() { return this.alt; } );
+ val = val.text();
+ $(':input[name="slug"]', editRow).val( val );
+
+ $(editRow).attr('id', 'edit-'+id).addClass('inline-editor').show();
+ $('.ptitle', editRow).eq(0).focus();
+
+ return false;
+ },
+
+ /**
+ * Saves the quick edit data.
+ *
+ * Saves the quick edit data to the server and replaces the table row with the
+ * HTML retrieved from the server.
+ *
+ * @since 2.7.0
+ *
+ * @this inlineEditTax
+ * @memberof inlineEditTax
+ *
+ * @param {string|HTMLElement} id The ID of the term we want to quick edit or an
+ * element within the table row or the
+ * table row itself.
+ * @returns {boolean} Always returns false.
+ */
+ save : function(id) {
+ var params, fields, tax = $('input[name="taxonomy"]').val() || '';
+
+ // Makes sure we can pass an HTMLElement as the ID.
+ if( typeof(id) === 'object' ) {
+ id = this.getId(id);
+ }
+
+ $( 'table.widefat .spinner' ).addClass( 'is-active' );
+
+ params = {
+ action: 'inline-save-tax',
+ tax_type: this.type,
+ tax_ID: id,
+ taxonomy: tax
+ };
+
+ fields = $('#edit-'+id).find(':input').serialize();
+ params = fields + '&' + $.param(params);
+
+ // Do the ajax request to save the data to the server.
+ $.post( ajaxurl, params,
+ /**
+ * Handles the response from the server
+ *
+ * Handles the response from the server, replaces the table row with the response
+ * from the server.
+ *
+ * @param {string} r The string with which to replace the table row.
+ */
+ function(r) {
+ var row, new_id, option_value,
+ $errorNotice = $( '#edit-' + id + ' .inline-edit-save .notice-error' ),
+ $error = $errorNotice.find( '.error' );
+
+ $( 'table.widefat .spinner' ).removeClass( 'is-active' );
+
+ if (r) {
+ if ( -1 !== r.indexOf( '<tr' ) ) {
+ $(inlineEditTax.what+id).siblings('tr.hidden').addBack().remove();
+ new_id = $(r).attr('id');
+
+ $('#edit-'+id).before(r).remove();
+
+ if ( new_id ) {
+ option_value = new_id.replace( inlineEditTax.type + '-', '' );
+ row = $( '#' + new_id );
+ } else {
+ option_value = id;
+ row = $( inlineEditTax.what + id );
+ }
+
+ // Update the value in the Parent dropdown.
+ $( '#parent' ).find( 'option[value=' + option_value + ']' ).text( row.find( '.row-title' ).text() );
+
+ row.hide().fadeIn( 400, function() {
+ // Move focus back to the Quick Edit button.
+ row.find( '.editinline' )
+ .attr( 'aria-expanded', 'false' )
+ .focus();
+ wp.a11y.speak( inlineEditL10n.saved );
+ });
+
+ } else {
+ $errorNotice.removeClass( 'hidden' );
+ $error.html( r );
+ /*
+ * Some error strings may contain HTML entities (e.g. `&#8220`), let's use
+ * the HTML element's text.
+ */
+ wp.a11y.speak( $error.text() );
+ }
+ } else {
+ $errorNotice.removeClass( 'hidden' );
+ $error.html( inlineEditL10n.error );
+ wp.a11y.speak( inlineEditL10n.error );
+ }
+ }
+ );
+
+ // Prevent submitting the form when pressing Enter on a focused field.
+ return false;
+ },
+
+ /**
+ * Closes the quick edit form.
+ *
+ * @since 2.7.0
+ *
+ * @this inlineEditTax
+ * @memberof inlineEditTax
+ * @returns {void}
+ */
+ revert : function() {
+ var id = $('table.widefat tr.inline-editor').attr('id');
+
+ if ( id ) {
+ $( 'table.widefat .spinner' ).removeClass( 'is-active' );
+ $('#'+id).siblings('tr.hidden').addBack().remove();
+ id = id.substr( id.lastIndexOf('-') + 1 );
+
+ // Show the taxonomy row and move focus back to the Quick Edit button.
+ $( this.what + id ).show().find( '.editinline' )
+ .attr( 'aria-expanded', 'false' )
+ .focus();
+ }
+ },
+
+ /**
+ * Retrieves the ID of the term of the element inside the table row.
+ *
+ * @since 2.7.0
+ *
+ * @memberof inlineEditTax
+ *
+ * @param {HTMLElement} o An element within the table row or the table row itself.
+ * @returns {string} The ID of the term based on the element.
+ */
+ getId : function(o) {
+ var id = o.tagName === 'TR' ? o.id : $(o).parents('tr').attr('id'), parts = id.split('-');
+
+ return parts[parts.length - 1];
+ }
+};
+
+$(document).ready(function(){inlineEditTax.init();});
+
+})( jQuery, window.wp );
diff --git a/www/crm/wp-admin/js/inline-edit-tax.min.js b/www/crm/wp-admin/js/inline-edit-tax.min.js
new file mode 100644
index 00000000..be26ff87
--- /dev/null
+++ b/www/crm/wp-admin/js/inline-edit-tax.min.js
@@ -0,0 +1 @@
+window.wp=window.wp||{},function(a,b){window.inlineEditTax={init:function(){var b=this,c=a("#inline-edit");b.type=a("#the-list").attr("data-wp-lists").substr(5),b.what="#"+b.type+"-",a("#the-list").on("click",".editinline",function(){a(this).attr("aria-expanded","true"),inlineEditTax.edit(this)}),c.keyup(function(a){if(27===a.which)return inlineEditTax.revert()}),a(".cancel",c).click(function(){return inlineEditTax.revert()}),a(".save",c).click(function(){return inlineEditTax.save(this)}),a("input, select",c).keydown(function(a){if(13===a.which)return inlineEditTax.save(this)}),a('#posts-filter input[type="submit"]').mousedown(function(){b.revert()})},toggle:function(b){var c=this;"none"===a(c.what+c.getId(b)).css("display")?c.revert():c.edit(b)},edit:function(b){var c,d,e,f=this;return f.revert(),"object"==typeof b&&(b=f.getId(b)),c=a("#inline-edit").clone(!0),d=a("#inline_"+b),a("td",c).attr("colspan",a("th:visible, td:visible",".wp-list-table.widefat:first thead").length),a(f.what+b).hide().after(c).after('<tr class="hidden"></tr>'),e=a(".name",d),e.find("img").replaceWith(function(){return this.alt}),e=e.text(),a(':input[name="name"]',c).val(e),e=a(".slug",d),e.find("img").replaceWith(function(){return this.alt}),e=e.text(),a(':input[name="slug"]',c).val(e),a(c).attr("id","edit-"+b).addClass("inline-editor").show(),a(".ptitle",c).eq(0).focus(),!1},save:function(c){var d,e,f=a('input[name="taxonomy"]').val()||"";return"object"==typeof c&&(c=this.getId(c)),a("table.widefat .spinner").addClass("is-active"),d={action:"inline-save-tax",tax_type:this.type,tax_ID:c,taxonomy:f},e=a("#edit-"+c).find(":input").serialize(),d=e+"&"+a.param(d),a.post(ajaxurl,d,function(d){var e,f,g,h=a("#edit-"+c+" .inline-edit-save .notice-error"),i=h.find(".error");a("table.widefat .spinner").removeClass("is-active"),d?-1!==d.indexOf("<tr")?(a(inlineEditTax.what+c).siblings("tr.hidden").addBack().remove(),f=a(d).attr("id"),a("#edit-"+c).before(d).remove(),f?(g=f.replace(inlineEditTax.type+"-",""),e=a("#"+f)):(g=c,e=a(inlineEditTax.what+c)),a("#parent").find("option[value="+g+"]").text(e.find(".row-title").text()),e.hide().fadeIn(400,function(){e.find(".editinline").attr("aria-expanded","false").focus(),b.a11y.speak(inlineEditL10n.saved)})):(h.removeClass("hidden"),i.html(d),b.a11y.speak(i.text())):(h.removeClass("hidden"),i.html(inlineEditL10n.error),b.a11y.speak(inlineEditL10n.error))}),!1},revert:function(){var b=a("table.widefat tr.inline-editor").attr("id");b&&(a("table.widefat .spinner").removeClass("is-active"),a("#"+b).siblings("tr.hidden").addBack().remove(),b=b.substr(b.lastIndexOf("-")+1),a(this.what+b).show().find(".editinline").attr("aria-expanded","false").focus())},getId:function(b){var c="TR"===b.tagName?b.id:a(b).parents("tr").attr("id"),d=c.split("-");return d[d.length-1]}},a(document).ready(function(){inlineEditTax.init()})}(jQuery,window.wp); \ No newline at end of file
diff --git a/www/crm/wp-admin/js/iris.min.js b/www/crm/wp-admin/js/iris.min.js
new file mode 100644
index 00000000..e9ae4b6c
--- /dev/null
+++ b/www/crm/wp-admin/js/iris.min.js
@@ -0,0 +1,4 @@
+/*! Iris Color Picker - v1.1.0-beta - 2016-10-25
+* https://github.com/Automattic/Iris
+* Copyright (c) 2016 Matt Wiebe; Licensed GPLv2 */
+!function(a,b){function c(){var b,c,d="backgroundImage";j?k="filter":(b=a('<div id="iris-gradtest" />'),c="linear-gradient(top,#fff,#000)",a.each(l,function(a,e){if(b.css(d,e+c),b.css(d).match("gradient"))return k=a,!1}),k===!1&&(b.css("background","-webkit-gradient(linear,0% 0%,0% 100%,from(#fff),to(#000))"),b.css(d).match("gradient")&&(k="webkit")),b.remove())}function d(b,c){return b="top"===b?"top":"left",c=a.isArray(c)?c:Array.prototype.slice.call(arguments,1),"webkit"===k?f(b,c):l[k]+"linear-gradient("+b+", "+c.join(", ")+")"}function e(b,c){var d,e,f,h,i,j,k,l,m;b="top"===b?"top":"left",c=a.isArray(c)?c:Array.prototype.slice.call(arguments,1),d="top"===b?0:1,e=a(this),f=c.length-1,h="filter",i=1===d?"left":"top",j=1===d?"right":"bottom",k=1===d?"height":"width",l='<div class="iris-ie-gradient-shim" style="position:absolute;'+k+":100%;"+i+":%start%;"+j+":%end%;"+h+':%filter%;" data-color:"%color%"></div>',m="","static"===e.css("position")&&e.css({position:"relative"}),c=g(c),a.each(c,function(a,b){var e,g,h;return a!==f&&(e=c[a+1],void(b.stop!==e.stop&&(g=100-parseFloat(e.stop)+"%",b.octoHex=new Color(b.color).toIEOctoHex(),e.octoHex=new Color(e.color).toIEOctoHex(),h="progid:DXImageTransform.Microsoft.Gradient(GradientType="+d+", StartColorStr='"+b.octoHex+"', EndColorStr='"+e.octoHex+"')",m+=l.replace("%start%",b.stop).replace("%end%",g).replace("%filter%",h))))}),e.find(".iris-ie-gradient-shim").remove(),a(m).prependTo(e)}function f(b,c){var d=[];return b="top"===b?"0% 0%,0% 100%,":"0% 100%,100% 100%,",c=g(c),a.each(c,function(a,b){d.push("color-stop("+parseFloat(b.stop)/100+", "+b.color+")")}),"-webkit-gradient(linear,"+b+d.join(",")+")"}function g(b){var c=[],d=[],e=[],f=b.length-1;return a.each(b,function(a,b){var e=b,f=!1,g=b.match(/1?[0-9]{1,2}%$/);g&&(e=b.replace(/\s?1?[0-9]{1,2}%$/,""),f=g.shift()),c.push(e),d.push(f)}),d[0]===!1&&(d[0]="0%"),d[f]===!1&&(d[f]="100%"),d=h(d),a.each(d,function(a){e[a]={color:c[a],stop:d[a]}}),e}function h(b){var c,d,e,f,g=0,i=b.length-1,j=0,k=!1;if(b.length<=2||a.inArray(!1,b)<0)return b;for(;j<b.length-1;)k||b[j]!==!1?k&&b[j]!==!1&&(i=j,j=b.length):(g=j-1,k=!0),j++;for(d=i-g,f=parseInt(b[g].replace("%"),10),c=(parseFloat(b[i].replace("%"))-f)/d,j=g+1,e=1;j<i;)b[j]=f+e*c+"%",e++,j++;return h(b)}var i,j,k,l,m,n,o,p,q;return i='<div class="iris-picker"><div class="iris-picker-inner"><div class="iris-square"><a class="iris-square-value" href="#"><span class="iris-square-handle ui-slider-handle"></span></a><div class="iris-square-inner iris-square-horiz"></div><div class="iris-square-inner iris-square-vert"></div></div><div class="iris-slider iris-strip"><div class="iris-slider-offset"></div></div></div></div>',m='.iris-picker{display:block;position:relative}.iris-picker,.iris-picker *{-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box}input+.iris-picker{margin-top:4px}.iris-error{background-color:#ffafaf}.iris-border{border-radius:3px;border:1px solid #aaa;width:200px;background-color:#fff}.iris-picker-inner{position:absolute;top:0;right:0;left:0;bottom:0}.iris-border .iris-picker-inner{top:10px;right:10px;left:10px;bottom:10px}.iris-picker .iris-square-inner{position:absolute;left:0;right:0;top:0;bottom:0}.iris-picker .iris-square,.iris-picker .iris-slider,.iris-picker .iris-square-inner,.iris-picker .iris-palette{border-radius:3px;box-shadow:inset 0 0 5px rgba(0,0,0,.4);height:100%;width:12.5%;float:left;margin-right:5%}.iris-only-strip .iris-slider{width:100%}.iris-picker .iris-square{width:76%;margin-right:10%;position:relative}.iris-only-strip .iris-square{display:none}.iris-picker .iris-square-inner{width:auto;margin:0}.iris-ie-9 .iris-square,.iris-ie-9 .iris-slider,.iris-ie-9 .iris-square-inner,.iris-ie-9 .iris-palette{box-shadow:none;border-radius:0}.iris-ie-9 .iris-square,.iris-ie-9 .iris-slider,.iris-ie-9 .iris-palette{outline:1px solid rgba(0,0,0,.1)}.iris-ie-lt9 .iris-square,.iris-ie-lt9 .iris-slider,.iris-ie-lt9 .iris-square-inner,.iris-ie-lt9 .iris-palette{outline:1px solid #aaa}.iris-ie-lt9 .iris-square .ui-slider-handle{outline:1px solid #aaa;background-color:#fff;-ms-filter:"alpha(Opacity=30)"}.iris-ie-lt9 .iris-square .iris-square-handle{background:0 0;border:3px solid #fff;-ms-filter:"alpha(Opacity=50)"}.iris-picker .iris-strip{margin-right:0;position:relative}.iris-picker .iris-strip .ui-slider-handle{position:absolute;background:0 0;margin:0;right:-3px;left:-3px;border:4px solid #aaa;border-width:4px 3px;width:auto;height:6px;border-radius:4px;box-shadow:0 1px 2px rgba(0,0,0,.2);opacity:.9;z-index:5;cursor:ns-resize}.iris-strip-horiz .iris-strip .ui-slider-handle{right:auto;left:auto;bottom:-3px;top:-3px;height:auto;width:6px;cursor:ew-resize}.iris-strip .ui-slider-handle:before{content:" ";position:absolute;left:-2px;right:-2px;top:-3px;bottom:-3px;border:2px solid #fff;border-radius:3px}.iris-picker .iris-slider-offset{position:absolute;top:11px;left:0;right:0;bottom:-3px;width:auto;height:auto;background:transparent;border:0;border-radius:0}.iris-strip-horiz .iris-slider-offset{top:0;bottom:0;right:11px;left:-3px}.iris-picker .iris-square-handle{background:transparent;border:5px solid #aaa;border-radius:50%;border-color:rgba(128,128,128,.5);box-shadow:none;width:12px;height:12px;position:absolute;left:-10px;top:-10px;cursor:move;opacity:1;z-index:10}.iris-picker .ui-state-focus .iris-square-handle{opacity:.8}.iris-picker .iris-square-handle:hover{border-color:#999}.iris-picker .iris-square-value:focus .iris-square-handle{box-shadow:0 0 2px rgba(0,0,0,.75);opacity:.8}.iris-picker .iris-square-handle:hover::after{border-color:#fff}.iris-picker .iris-square-handle::after{position:absolute;bottom:-4px;right:-4px;left:-4px;top:-4px;border:3px solid #f9f9f9;border-color:rgba(255,255,255,.8);border-radius:50%;content:" "}.iris-picker .iris-square-value{width:8px;height:8px;position:absolute}.iris-ie-lt9 .iris-square-value,.iris-mozilla .iris-square-value{width:1px;height:1px}.iris-palette-container{position:absolute;bottom:0;left:0;margin:0;padding:0}.iris-border .iris-palette-container{left:10px;bottom:10px}.iris-picker .iris-palette{margin:0;cursor:pointer}.iris-square-handle,.ui-slider-handle{border:0;outline:0}',o=navigator.userAgent.toLowerCase(),p="Microsoft Internet Explorer"===navigator.appName,q=p?parseFloat(o.match(/msie ([0-9]{1,}[\.0-9]{0,})/)[1]):0,j=p&&q<10,k=!1,l=["-moz-","-webkit-","-o-","-ms-"],j&&q<=7?(a.fn.iris=a.noop,void(a.support.iris=!1)):(a.support.iris=!0,a.fn.gradient=function(){var b=arguments;return this.each(function(){j?e.apply(this,b):a(this).css("backgroundImage",d.apply(this,b))})},a.fn.rainbowGradient=function(b,c){var d,e,f,g;for(b=b||"top",d=a.extend({},{s:100,l:50},c),e="hsl(%h%,"+d.s+"%,"+d.l+"%)",f=0,g=[];f<=360;)g.push(e.replace("%h%",f)),f+=30;return this.each(function(){a(this).gradient(b,g)})},n={options:{color:!1,mode:"hsl",controls:{horiz:"s",vert:"l",strip:"h"},hide:!0,border:!0,target:!1,width:200,palettes:!1,type:"full",slider:"horizontal"},_color:"",_palettes:["#000","#fff","#d33","#d93","#ee2","#81d742","#1e73be","#8224e3"],_inited:!1,_defaultHSLControls:{horiz:"s",vert:"l",strip:"h"},_defaultHSVControls:{horiz:"h",vert:"v",strip:"s"},_scale:{h:360,s:100,l:100,v:100},_create:function(){var b=this,d=b.element,e=b.options.color||d.val();k===!1&&c(),d.is("input")?(b.options.target?b.picker=a(i).appendTo(b.options.target):b.picker=a(i).insertAfter(d),b._addInputListeners(d)):(d.append(i),b.picker=d.find(".iris-picker")),p?9===q?b.picker.addClass("iris-ie-9"):q<=8&&b.picker.addClass("iris-ie-lt9"):o.indexOf("compatible")<0&&o.indexOf("khtml")<0&&o.match(/mozilla/)&&b.picker.addClass("iris-mozilla"),b.options.palettes&&b._addPalettes(),b.onlySlider="hue"===b.options.type,b.horizontalSlider=b.onlySlider&&"horizontal"===b.options.slider,b.onlySlider&&(b.options.controls.strip="h",e||(e="hsl(10,100,50)")),b._color=new Color(e).setHSpace(b.options.mode),b.options.color=b._color.toString(),b.controls={square:b.picker.find(".iris-square"),squareDrag:b.picker.find(".iris-square-value"),horiz:b.picker.find(".iris-square-horiz"),vert:b.picker.find(".iris-square-vert"),strip:b.picker.find(".iris-strip"),stripSlider:b.picker.find(".iris-strip .iris-slider-offset")},"hsv"===b.options.mode&&b._has("l",b.options.controls)?b.options.controls=b._defaultHSVControls:"hsl"===b.options.mode&&b._has("v",b.options.controls)&&(b.options.controls=b._defaultHSLControls),b.hue=b._color.h(),b.options.hide&&b.picker.hide(),b.options.border&&!b.onlySlider&&b.picker.addClass("iris-border"),b._initControls(),b.active="external",b._dimensions(),b._change()},_has:function(b,c){var d=!1;return a.each(c,function(a,c){if(b===c)return d=!0,!1}),d},_addPalettes:function(){var b=a('<div class="iris-palette-container" />'),c=a('<a class="iris-palette" tabindex="0" />'),d=a.isArray(this.options.palettes)?this.options.palettes:this._palettes;this.picker.find(".iris-palette-container").length&&(b=this.picker.find(".iris-palette-container").detach().html("")),a.each(d,function(a,d){c.clone().data("color",d).css("backgroundColor",d).appendTo(b).height(10).width(10)}),this.picker.append(b)},_paint:function(){var a=this;a.horizontalSlider?a._paintDimension("left","strip"):a._paintDimension("top","strip"),a._paintDimension("top","vert"),a._paintDimension("left","horiz")},_paintDimension:function(a,b){var c,d=this,e=d._color,f=d.options.mode,g=d._getHSpaceColor(),h=d.controls[b],i=d.options.controls;if(b!==d.active&&("square"!==d.active||"strip"===b))switch(i[b]){case"h":if("hsv"===f){switch(g=e.clone(),b){case"horiz":g[i.vert](100);break;case"vert":g[i.horiz](100);break;case"strip":g.setHSpace("hsl")}c=g.toHsl()}else c="strip"===b?{s:g.s,l:g.l}:{s:100,l:g.l};h.rainbowGradient(a,c);break;case"s":"hsv"===f?"vert"===b?c=[e.clone().a(0).s(0).toCSS("rgba"),e.clone().a(1).s(0).toCSS("rgba")]:"strip"===b?c=[e.clone().s(100).toCSS("hsl"),e.clone().s(0).toCSS("hsl")]:"horiz"===b&&(c=["#fff","hsl("+g.h+",100%,50%)"]):c="vert"===b&&"h"===d.options.controls.horiz?["hsla(0, 0%, "+g.l+"%, 0)","hsla(0, 0%, "+g.l+"%, 1)"]:["hsl("+g.h+",0%,50%)","hsl("+g.h+",100%,50%)"],h.gradient(a,c);break;case"l":c="strip"===b?["hsl("+g.h+",100%,100%)","hsl("+g.h+", "+g.s+"%,50%)","hsl("+g.h+",100%,0%)"]:["#fff","rgba(255,255,255,0) 50%","rgba(0,0,0,0) 50%","rgba(0,0,0,1)"],h.gradient(a,c);break;case"v":c="strip"===b?[e.clone().v(100).toCSS(),e.clone().v(0).toCSS()]:["rgba(0,0,0,0)","#000"],h.gradient(a,c)}},_getHSpaceColor:function(){return"hsv"===this.options.mode?this._color.toHsv():this._color.toHsl()},_stripOnlyDimensions:function(){var a=this,b=this.options.width,c=.12*b;a.horizontalSlider?a.picker.css({width:b,height:c}).addClass("iris-only-strip iris-strip-horiz"):a.picker.css({width:c,height:b}).addClass("iris-only-strip iris-strip-vert")},_dimensions:function(b){if("hue"===this.options.type)return this._stripOnlyDimensions();var c,d,e,f,g=this,h=g.options,i=g.controls,j=i.square,k=g.picker.find(".iris-strip"),l="77.5%",m="12%",n=20,o=h.border?h.width-n:h.width,p=a.isArray(h.palettes)?h.palettes.length:g._palettes.length;return b&&(j.css("width",""),k.css("width",""),g.picker.css({width:"",height:""})),l=o*(parseFloat(l)/100),m=o*(parseFloat(m)/100),c=h.border?l+n:l,j.width(l).height(l),k.height(l).width(m),g.picker.css({width:h.width,height:c}),h.palettes?(d=2*l/100,f=l-(p-1)*d,e=f/p,g.picker.find(".iris-palette").each(function(b){var c=0===b?0:d;a(this).css({width:e,height:e,marginLeft:c})}),g.picker.css("paddingBottom",e+d),void k.height(e+d+l)):g.picker.css("paddingBottom","")},_addInputListeners:function(a){var b=this,c=100,d=function(c){var d=new Color(a.val()),e=a.val().replace(/^#/,"");a.removeClass("iris-error"),d.error?""!==e&&a.addClass("iris-error"):d.toString()!==b._color.toString()&&("keyup"===c.type&&e.match(/^[0-9a-fA-F]{3}$/)||b._setOption("color",d.toString()))};a.on("change",d).on("keyup",b._debounce(d,c)),b.options.hide&&a.one("focus",function(){b.show()})},_initControls:function(){var b=this,c=b.controls,d=c.square,e=b.options.controls,f=b._scale[e.strip],g=b.horizontalSlider?"horizontal":"vertical";c.stripSlider.slider({orientation:g,max:f,slide:function(a,c){b.active="strip","h"===e.strip&&"vertical"===g&&(c.value=f-c.value),b._color[e.strip](c.value),b._change.apply(b,arguments)}}),c.squareDrag.draggable({containment:c.square.find(".iris-square-inner"),zIndex:1e3,cursor:"move",drag:function(a,c){b._squareDrag(a,c)},start:function(){d.addClass("iris-dragging"),a(this).addClass("ui-state-focus")},stop:function(){d.removeClass("iris-dragging"),a(this).removeClass("ui-state-focus")}}).on("mousedown mouseup",function(c){var d="ui-state-focus";c.preventDefault(),"mousedown"===c.type?(b.picker.find("."+d).removeClass(d).blur(),a(this).addClass(d).focus()):a(this).removeClass(d)}).on("keydown",function(a){var d=c.square,e=c.squareDrag,f=e.position(),g=b.options.width/100;switch(a.altKey&&(g*=10),a.keyCode){case 37:f.left-=g;break;case 38:f.top-=g;break;case 39:f.left+=g;break;case 40:f.top+=g;break;default:return!0}f.left=Math.max(0,Math.min(f.left,d.width())),f.top=Math.max(0,Math.min(f.top,d.height())),e.css(f),b._squareDrag(a,{position:f}),a.preventDefault()}),d.mousedown(function(c){var d,e;1===c.which&&a(c.target).is("div")&&(d=b.controls.square.offset(),e={top:c.pageY-d.top,left:c.pageX-d.left},c.preventDefault(),b._squareDrag(c,{position:e}),c.target=b.controls.squareDrag.get(0),b.controls.squareDrag.css(e).trigger(c))}),b.options.palettes&&b._paletteListeners()},_paletteListeners:function(){var b=this;b.picker.find(".iris-palette-container").on("click.palette",".iris-palette",function(){b._color.fromCSS(a(this).data("color")),b.active="external",b._change()}).on("keydown.palette",".iris-palette",function(b){return 13!==b.keyCode&&32!==b.keyCode||(b.stopPropagation(),void a(this).click())})},_squareDrag:function(a,b){var c=this,d=c.options.controls,e=c._squareDimensions(),f=Math.round((e.h-b.position.top)/e.h*c._scale[d.vert]),g=c._scale[d.horiz]-Math.round((e.w-b.position.left)/e.w*c._scale[d.horiz]);c._color[d.horiz](g)[d.vert](f),c.active="square",c._change.apply(c,arguments)},_setOption:function(b,c){var d,e,f,g=this,h=g.options[b],i=!1;switch(g.options[b]=c,b){case"color":g.onlySlider?(c=parseInt(c,10),c=isNaN(c)||c<0||c>359?h:"hsl("+c+",100,50)",g.options.color=g.options[b]=c,g._color=new Color(c).setHSpace(g.options.mode),g.active="external",g._change()):(c=""+c,d=c.replace(/^#/,""),e=new Color(c).setHSpace(g.options.mode),e.error?g.options[b]=h:(g._color=e,g.options.color=g.options[b]=g._color.toString(),g.active="external",g._change()));break;case"palettes":i=!0,c?g._addPalettes():g.picker.find(".iris-palette-container").remove(),h||g._paletteListeners();break;case"width":i=!0;break;case"border":i=!0,f=c?"addClass":"removeClass",g.picker[f]("iris-border");break;case"mode":case"controls":if(h===c)return;return f=g.element,h=g.options,h.hide=!g.picker.is(":visible"),g.destroy(),g.picker.remove(),a(g.element).iris(h)}i&&g._dimensions(!0)},_squareDimensions:function(a){var c,d,e=this.controls.square;return a!==b&&e.data("dimensions")?e.data("dimensions"):(d=this.controls.squareDrag,c={w:e.width(),h:e.height()},e.data("dimensions",c),c)},_isNonHueControl:function(a,b){return"square"===a&&"h"===this.options.controls.strip||"external"!==b&&("h"!==b||"strip"!==a)},_change:function(){var b=this,c=b.controls,d=b._getHSpaceColor(),e=["square","strip"],f=b.options.controls,g=f[b.active]||"external",h=b.hue;"strip"===b.active?e=[]:"external"!==b.active&&e.pop(),a.each(e,function(a,e){var g,h,i;if(e!==b.active)switch(e){case"strip":g="h"!==f.strip||b.horizontalSlider?d[f.strip]:b._scale[f.strip]-d[f.strip],c.stripSlider.slider("value",g);break;case"square":h=b._squareDimensions(),i={left:d[f.horiz]/b._scale[f.horiz]*h.w,top:h.h-d[f.vert]/b._scale[f.vert]*h.h},b.controls.squareDrag.css(i)}}),d.h!==h&&b._isNonHueControl(b.active,g)&&b._color.h(h),b.hue=b._color.h(),b.options.color=b._color.toString(),b._inited&&b._trigger("change",{type:b.active},{color:b._color}),b.element.is(":input")&&!b._color.error&&(b.element.removeClass("iris-error"),b.onlySlider?b.element.val()!==b.hue&&b.element.val(b.hue):b.element.val()!==b._color.toString()&&b.element.val(b._color.toString())),b._paint(),b._inited=!0,b.active=!1},_debounce:function(a,b,c){var d,e;return function(){var f,g,h=this,i=arguments;return f=function(){d=null,c||(e=a.apply(h,i))},g=c&&!d,clearTimeout(d),d=setTimeout(f,b),g&&(e=a.apply(h,i)),e}},show:function(){this.picker.show()},hide:function(){this.picker.hide()},toggle:function(){this.picker.toggle()},color:function(a){return a===!0?this._color.clone():a===b?this._color.toString():void this.option("color",a)}},a.widget("a8c.iris",n),void a('<style id="iris-css">'+m+"</style>").appendTo("head"))}(jQuery),function(a,b){var c=function(a,b){return this instanceof c?this._init(a,b):new c(a,b)};c.fn=c.prototype={_color:0,_alpha:1,error:!1,_hsl:{h:0,s:0,l:0},_hsv:{h:0,s:0,v:0},_hSpace:"hsl",_init:function(a){var c="noop";switch(typeof a){case"object":return a.a!==b&&this.a(a.a),c=a.r!==b?"fromRgb":a.l!==b?"fromHsl":a.v!==b?"fromHsv":c,this[c](a);case"string":return this.fromCSS(a);case"number":return this.fromInt(parseInt(a,10))}return this},_error:function(){return this.error=!0,this},clone:function(){for(var a=new c(this.toInt()),b=["_alpha","_hSpace","_hsl","_hsv","error"],d=b.length-1;d>=0;d--)a[b[d]]=this[b[d]];return a},setHSpace:function(a){return this._hSpace="hsv"===a?a:"hsl",this},noop:function(){return this},fromCSS:function(a){var b,c=/^(rgb|hs(l|v))a?\(/;if(this.error=!1,a=a.replace(/^\s+/,"").replace(/\s+$/,"").replace(/;$/,""),a.match(c)&&a.match(/\)$/)){if(b=a.replace(/(\s|%)/g,"").replace(c,"").replace(/,?\);?$/,"").split(","),b.length<3)return this._error();if(4===b.length&&(this.a(parseFloat(b.pop())),this.error))return this;for(var d=b.length-1;d>=0;d--)if(b[d]=parseInt(b[d],10),isNaN(b[d]))return this._error();return a.match(/^rgb/)?this.fromRgb({r:b[0],g:b[1],b:b[2]}):a.match(/^hsv/)?this.fromHsv({h:b[0],s:b[1],v:b[2]}):this.fromHsl({h:b[0],s:b[1],l:b[2]})}return this.fromHex(a)},fromRgb:function(a,c){return"object"!=typeof a||a.r===b||a.g===b||a.b===b?this._error():(this.error=!1,this.fromInt(parseInt((a.r<<16)+(a.g<<8)+a.b,10),c))},fromHex:function(a){return a=a.replace(/^#/,"").replace(/^0x/,""),3===a.length&&(a=a[0]+a[0]+a[1]+a[1]+a[2]+a[2]),this.error=!/^[0-9A-F]{6}$/i.test(a),this.fromInt(parseInt(a,16))},fromHsl:function(a){var c,d,e,f,g,h,i,j;return"object"!=typeof a||a.h===b||a.s===b||a.l===b?this._error():(this._hsl=a,this._hSpace="hsl",h=a.h/360,i=a.s/100,j=a.l/100,0===i?c=d=e=j:(f=j<.5?j*(1+i):j+i-j*i,g=2*j-f,c=this.hue2rgb(g,f,h+1/3),d=this.hue2rgb(g,f,h),e=this.hue2rgb(g,f,h-1/3)),this.fromRgb({r:255*c,g:255*d,b:255*e},!0))},fromHsv:function(a){var c,d,e,f,g,h,i,j,k,l,m;if("object"!=typeof a||a.h===b||a.s===b||a.v===b)return this._error();switch(this._hsv=a,this._hSpace="hsv",c=a.h/360,d=a.s/100,e=a.v/100,i=Math.floor(6*c),j=6*c-i,k=e*(1-d),l=e*(1-j*d),m=e*(1-(1-j)*d),i%6){case 0:f=e,g=m,h=k;break;case 1:f=l,g=e,h=k;break;case 2:f=k,g=e,h=m;break;case 3:f=k,g=l,h=e;break;case 4:f=m,g=k,h=e;break;case 5:f=e,g=k,h=l}return this.fromRgb({r:255*f,g:255*g,b:255*h},!0)},fromInt:function(a,c){return this._color=parseInt(a,10),isNaN(this._color)&&(this._color=0),this._color>16777215?this._color=16777215:this._color<0&&(this._color=0),c===b&&(this._hsv.h=this._hsv.s=this._hsl.h=this._hsl.s=0),this},hue2rgb:function(a,b,c){return c<0&&(c+=1),c>1&&(c-=1),c<1/6?a+6*(b-a)*c:c<.5?b:c<2/3?a+(b-a)*(2/3-c)*6:a},toString:function(){var a=parseInt(this._color,10).toString(16);if(this.error)return"";if(a.length<6)for(var b=6-a.length-1;b>=0;b--)a="0"+a;return"#"+a},toCSS:function(a,b){switch(a=a||"hex",b=parseFloat(b||this._alpha),a){case"rgb":case"rgba":var c=this.toRgb();return b<1?"rgba( "+c.r+", "+c.g+", "+c.b+", "+b+" )":"rgb( "+c.r+", "+c.g+", "+c.b+" )";case"hsl":case"hsla":var d=this.toHsl();return b<1?"hsla( "+d.h+", "+d.s+"%, "+d.l+"%, "+b+" )":"hsl( "+d.h+", "+d.s+"%, "+d.l+"% )";default:return this.toString()}},toRgb:function(){return{r:255&this._color>>16,g:255&this._color>>8,b:255&this._color}},toHsl:function(){var a,b,c=this.toRgb(),d=c.r/255,e=c.g/255,f=c.b/255,g=Math.max(d,e,f),h=Math.min(d,e,f),i=(g+h)/2;if(g===h)a=b=0;else{var j=g-h;switch(b=i>.5?j/(2-g-h):j/(g+h),g){case d:a=(e-f)/j+(e<f?6:0);break;case e:a=(f-d)/j+2;break;case f:a=(d-e)/j+4}a/=6}return a=Math.round(360*a),0===a&&this._hsl.h!==a&&(a=this._hsl.h),b=Math.round(100*b),0===b&&this._hsl.s&&(b=this._hsl.s),{h:a,s:b,l:Math.round(100*i)}},toHsv:function(){var a,b,c=this.toRgb(),d=c.r/255,e=c.g/255,f=c.b/255,g=Math.max(d,e,f),h=Math.min(d,e,f),i=g,j=g-h;if(b=0===g?0:j/g,g===h)a=b=0;else{switch(g){case d:a=(e-f)/j+(e<f?6:0);break;case e:a=(f-d)/j+2;break;case f:a=(d-e)/j+4}a/=6}return a=Math.round(360*a),0===a&&this._hsv.h!==a&&(a=this._hsv.h),b=Math.round(100*b),0===b&&this._hsv.s&&(b=this._hsv.s),{h:a,s:b,v:Math.round(100*i)}},toInt:function(){return this._color},toIEOctoHex:function(){var a=this.toString(),b=parseInt(255*this._alpha,10).toString(16);return 1===b.length&&(b="0"+b),"#"+b+a.replace(/^#/,"")},toLuminosity:function(){var a=this.toRgb(),b={};for(var c in a)if(a.hasOwnProperty(c)){var d=a[c]/255;b[c]=d<=.03928?d/12.92:Math.pow((d+.055)/1.055,2.4)}return.2126*b.r+.7152*b.g+.0722*b.b},getDistanceLuminosityFrom:function(a){if(!(a instanceof c))throw"getDistanceLuminosityFrom requires a Color object";var b=this.toLuminosity(),d=a.toLuminosity();return b>d?(b+.05)/(d+.05):(d+.05)/(b+.05)},getMaxContrastColor:function(){var a=this.getDistanceLuminosityFrom(new c("#000")),b=this.getDistanceLuminosityFrom(new c("#fff")),d=a>=b?"#000":"#fff";return new c(d)},getReadableContrastingColor:function(a,d){if(!(a instanceof c))return this;var e,f,g,h=d===b?5:d,i=a.getDistanceLuminosityFrom(this);if(i>=h)return this;if(e=a.getMaxContrastColor(),f=e.getDistanceLuminosityFrom(a),f<=h)return e;for(g=0===e.toInt()?-1:1;i<h&&(this.l(g,!0),i=this.getDistanceLuminosityFrom(a),0!==this._color&&16777215!==this._color););return this},a:function(a){if(a===b)return this._alpha;var c=parseFloat(a);return isNaN(c)?this._error():(this._alpha=c,this)},darken:function(a){return a=a||5,this.l(-a,!0)},lighten:function(a){return a=a||5,this.l(a,!0)},saturate:function(a){return a=a||15,this.s(a,!0)},desaturate:function(a){return a=a||15,this.s(-a,!0)},toGrayscale:function(){return this.setHSpace("hsl").s(0)},getComplement:function(){return this.h(180,!0)},getSplitComplement:function(a){a=a||1;var b=180+30*a;return this.h(b,!0)},getAnalog:function(a){a=a||1;var b=30*a;return this.h(b,!0)},getTetrad:function(a){a=a||1;var b=60*a;return this.h(b,!0)},getTriad:function(a){a=a||1;var b=120*a;return this.h(b,!0)},_partial:function(a){var c=d[a];return function(d,e){var f=this._spaceFunc("to",c.space);return d===b?f[a]:(e===!0&&(d=f[a]+d),c.mod&&(d%=c.mod),c.range&&(d=d<c.range[0]?c.range[0]:d>c.range[1]?c.range[1]:d),f[a]=d,this._spaceFunc("from",c.space,f))}},_spaceFunc:function(a,b,c){var d=b||this._hSpace,e=a+d.charAt(0).toUpperCase()+d.substr(1);return this[e](c)}};var d={h:{mod:360},s:{range:[0,100]},l:{space:"hsl",range:[0,100]},v:{space:"hsv",range:[0,100]},r:{space:"rgb",range:[0,255]},g:{space:"rgb",range:[0,255]},b:{space:"rgb",range:[0,255]}};for(var e in d)d.hasOwnProperty(e)&&(c.fn[e]=c.fn._partial(e));"object"==typeof exports?module.exports=c:a.Color=c}(this); \ No newline at end of file
diff --git a/www/crm/wp-admin/js/language-chooser.js b/www/crm/wp-admin/js/language-chooser.js
new file mode 100644
index 00000000..8eb33b44
--- /dev/null
+++ b/www/crm/wp-admin/js/language-chooser.js
@@ -0,0 +1,36 @@
+/**
+ * @output wp-admin/js/language-chooser.js
+ */
+
+jQuery( function($) {
+/*
+ * Set the correct translation to the continue button and show a spinner
+ * when downloading a language.
+ */
+var select = $( '#language' ),
+ submit = $( '#language-continue' );
+
+if ( ! $( 'body' ).hasClass( 'language-chooser' ) ) {
+ return;
+}
+
+select.focus().on( 'change', function() {
+ /*
+ * When a language is selected, set matching translation to continue button
+ * and attach the language attribute.
+ */
+ var option = select.children( 'option:selected' );
+ submit.attr({
+ value: option.data( 'continue' ),
+ lang: option.attr( 'lang' )
+ });
+});
+
+$( 'form' ).submit( function() {
+ // Show spinner for languages that need to be downloaded.
+ if ( ! select.children( 'option:selected' ).data( 'installed' ) ) {
+ $( this ).find( '.step .spinner' ).css( 'visibility', 'visible' );
+ }
+});
+
+});
diff --git a/www/crm/wp-admin/js/language-chooser.min.js b/www/crm/wp-admin/js/language-chooser.min.js
new file mode 100644
index 00000000..38d65ebd
--- /dev/null
+++ b/www/crm/wp-admin/js/language-chooser.min.js
@@ -0,0 +1 @@
+jQuery(function(a){var b=a("#language"),c=a("#language-continue");a("body").hasClass("language-chooser")&&(b.focus().on("change",function(){var a=b.children("option:selected");c.attr({value:a.data("continue"),lang:a.attr("lang")})}),a("form").submit(function(){b.children("option:selected").data("installed")||a(this).find(".step .spinner").css("visibility","visible")}))}); \ No newline at end of file
diff --git a/www/crm/wp-admin/js/link.js b/www/crm/wp-admin/js/link.js
new file mode 100644
index 00000000..5b73fe61
--- /dev/null
+++ b/www/crm/wp-admin/js/link.js
@@ -0,0 +1,136 @@
+/**
+ * @output wp-admin/js/link.js
+ */
+
+/* global postboxes, deleteUserSetting, setUserSetting, getUserSetting */
+
+jQuery(document).ready( function($) {
+
+ var newCat, noSyncChecks = false, syncChecks, catAddAfter;
+
+ $('#link_name').focus();
+ // postboxes
+ postboxes.add_postbox_toggles('link');
+
+ /**
+ * Adds event that opens a particular category tab.
+ *
+ * @ignore
+ *
+ * @return {boolean} Always returns false to prevent the default behavior.
+ */
+ $('#category-tabs a').click(function(){
+ var t = $(this).attr('href');
+ $(this).parent().addClass('tabs').siblings('li').removeClass('tabs');
+ $('.tabs-panel').hide();
+ $(t).show();
+ if ( '#categories-all' == t )
+ deleteUserSetting('cats');
+ else
+ setUserSetting('cats','pop');
+ return false;
+ });
+ if ( getUserSetting('cats') )
+ $('#category-tabs a[href="#categories-pop"]').click();
+
+ // Ajax Cat
+ newCat = $('#newcat').one( 'focus', function() { $(this).val( '' ).removeClass( 'form-input-tip' ); } );
+
+ /**
+ * After adding a new category, focus on the category add input field.
+ *
+ * @return {void}
+ */
+ $('#link-category-add-submit').click( function() { newCat.focus(); } );
+
+ /**
+ * Synchronize category checkboxes.
+ *
+ * This function makes sure that the checkboxes are synced between the all
+ * categories tab and the most used categories tab.
+ *
+ * @since 2.5.0
+ *
+ * @return {void}
+ */
+ syncChecks = function() {
+ if ( noSyncChecks )
+ return;
+ noSyncChecks = true;
+ var th = $(this), c = th.is(':checked'), id = th.val().toString();
+ $('#in-link-category-' + id + ', #in-popular-link_category-' + id).prop( 'checked', c );
+ noSyncChecks = false;
+ };
+
+ /**
+ * Adds event listeners to an added category.
+ *
+ * This is run on the addAfter event to make sure the correct event listeners
+ * are bound to the DOM elements.
+ *
+ * @since 2.5.0
+ *
+ * @param {string} r Raw XML response returned from the server after adding a
+ * category.
+ * @param {Object} s List manager configuration object; settings for the Ajax
+ * request.
+ *
+ * @return {void}
+ */
+ catAddAfter = function( r, s ) {
+ $(s.what + ' response_data', r).each( function() {
+ var t = $($(this).text());
+ t.find( 'label' ).each( function() {
+ var th = $(this), val = th.find('input').val(), id = th.find('input')[0].id, name = $.trim( th.text() ), o;
+ $('#' + id).change( syncChecks );
+ o = $( '<option value="' + parseInt( val, 10 ) + '"></option>' ).text( name );
+ } );
+ } );
+ };
+
+ /*
+ * Instantiates the list manager.
+ *
+ * @see js/_enqueues/lib/lists.js
+ */
+ $('#categorychecklist').wpList( {
+ // CSS class name for alternate styling.
+ alt: '',
+
+ // The type of list.
+ what: 'link-category',
+
+ // ID of the element the parsed Ajax response will be stored in.
+ response: 'category-ajax-response',
+
+ // Callback that's run after an item got added to the list.
+ addAfter: catAddAfter
+ } );
+
+ // All categories is the default tab, so we delete the user setting.
+ $('a[href="#categories-all"]').click(function(){deleteUserSetting('cats');});
+
+ // Set a preference for the popular categories to cookies.
+ $('a[href="#categories-pop"]').click(function(){setUserSetting('cats','pop');});
+
+ if ( 'pop' == getUserSetting('cats') )
+ $('a[href="#categories-pop"]').click();
+
+ /**
+ * Adds event handler that shows the interface controls to add a new category.
+ *
+ * @ignore
+ *
+ * @param {Event} event The event object.
+ * @returns {boolean} Always returns false to prevent regular link
+ * functionality.
+ */
+ $('#category-add-toggle').click( function() {
+ $(this).parents('div:first').toggleClass( 'wp-hidden-children' );
+ $('#category-tabs a[href="#categories-all"]').click();
+ $('#newcategory').focus();
+ return false;
+ } );
+
+ $('.categorychecklist :checkbox').change( syncChecks ).filter( ':checked' ).change();
+});
diff --git a/www/crm/wp-admin/js/link.min.js b/www/crm/wp-admin/js/link.min.js
new file mode 100644
index 00000000..f1487770
--- /dev/null
+++ b/www/crm/wp-admin/js/link.min.js
@@ -0,0 +1 @@
+jQuery(document).ready(function(a){var b,c,d,e=!1;a("#link_name").focus(),postboxes.add_postbox_toggles("link"),a("#category-tabs a").click(function(){var b=a(this).attr("href");return a(this).parent().addClass("tabs").siblings("li").removeClass("tabs"),a(".tabs-panel").hide(),a(b).show(),"#categories-all"==b?deleteUserSetting("cats"):setUserSetting("cats","pop"),!1}),getUserSetting("cats")&&a('#category-tabs a[href="#categories-pop"]').click(),b=a("#newcat").one("focus",function(){a(this).val("").removeClass("form-input-tip")}),a("#link-category-add-submit").click(function(){b.focus()}),c=function(){if(!e){e=!0;var b=a(this),c=b.is(":checked"),d=b.val().toString();a("#in-link-category-"+d+", #in-popular-link_category-"+d).prop("checked",c),e=!1}},d=function(b,d){a(d.what+" response_data",b).each(function(){var b=a(a(this).text());b.find("label").each(function(){var b,d=a(this),e=d.find("input").val(),f=d.find("input")[0].id,g=a.trim(d.text());a("#"+f).change(c),b=a('<option value="'+parseInt(e,10)+'"></option>').text(g)})})},a("#categorychecklist").wpList({alt:"",what:"link-category",response:"category-ajax-response",addAfter:d}),a('a[href="#categories-all"]').click(function(){deleteUserSetting("cats")}),a('a[href="#categories-pop"]').click(function(){setUserSetting("cats","pop")}),"pop"==getUserSetting("cats")&&a('a[href="#categories-pop"]').click(),a("#category-add-toggle").click(function(){return a(this).parents("div:first").toggleClass("wp-hidden-children"),a('#category-tabs a[href="#categories-all"]').click(),a("#newcategory").focus(),!1}),a(".categorychecklist :checkbox").change(c).filter(":checked").change()}); \ No newline at end of file
diff --git a/www/crm/wp-admin/js/media-gallery.js b/www/crm/wp-admin/js/media-gallery.js
new file mode 100644
index 00000000..725d2beb
--- /dev/null
+++ b/www/crm/wp-admin/js/media-gallery.js
@@ -0,0 +1,41 @@
+/**
+ * This file is used on media-upload.php which has been replaced by media-new.php and upload.php
+ *
+ * @deprecated 3.5.0
+ * @output wp-admin/js/media-gallery.js
+ */
+
+ /* global ajaxurl */
+jQuery(function($) {
+ /**
+ * Adds a click event handler to the element with a 'wp-gallery' class.
+ */
+ $( 'body' ).bind( 'click.wp-gallery', function(e) {
+ var target = $( e.target ), id, img_size;
+
+ if ( target.hasClass( 'wp-set-header' ) ) {
+ // Opens the image to preview it full size.
+ ( window.dialogArguments || opener || parent || top ).location.href = target.data( 'location' );
+ e.preventDefault();
+ } else if ( target.hasClass( 'wp-set-background' ) ) {
+ // Sets the image as background of the theme.
+ id = target.data( 'attachment-id' );
+ img_size = $( 'input[name="attachments[' + id + '][image-size]"]:checked').val();
+
+ /**
+ * This AJAX action has been deprecated since 3.5.0, see custom-background.php
+ */
+ jQuery.post(ajaxurl, {
+ action: 'set-background-image',
+ attachment_id: id,
+ size: img_size
+ }, function() {
+ var win = window.dialogArguments || opener || parent || top;
+ win.tb_remove();
+ win.location.reload();
+ });
+
+ e.preventDefault();
+ }
+ });
+});
diff --git a/www/crm/wp-admin/js/media-gallery.min.js b/www/crm/wp-admin/js/media-gallery.min.js
new file mode 100644
index 00000000..dc66a26c
--- /dev/null
+++ b/www/crm/wp-admin/js/media-gallery.min.js
@@ -0,0 +1 @@
+jQuery(function(a){a("body").bind("click.wp-gallery",function(b){var c,d,e=a(b.target);e.hasClass("wp-set-header")?((window.dialogArguments||opener||parent||top).location.href=e.data("location"),b.preventDefault()):e.hasClass("wp-set-background")&&(c=e.data("attachment-id"),d=a('input[name="attachments['+c+'][image-size]"]:checked').val(),jQuery.post(ajaxurl,{action:"set-background-image",attachment_id:c,size:d},function(){var a=window.dialogArguments||opener||parent||top;a.tb_remove(),a.location.reload()}),b.preventDefault())})}); \ No newline at end of file
diff --git a/www/crm/wp-admin/js/media-upload.js b/www/crm/wp-admin/js/media-upload.js
new file mode 100644
index 00000000..9055cf9c
--- /dev/null
+++ b/www/crm/wp-admin/js/media-upload.js
@@ -0,0 +1,113 @@
+/**
+ * Contains global functions for the media upload within the post edit screen.
+ *
+ * Updates the ThickBox anchor href and the ThickBox's own properties in order
+ * to set the size and position on every resize event. Also adds a function to
+ * send HTML or text to the currently active editor.
+ *
+ * @file
+ * @since 2.5.0
+ * @output wp-admin/js/media-upload.js
+ *
+ * @requires jQuery
+ */
+
+/* global tinymce, QTags, wpActiveEditor, tb_position */
+
+/**
+ * Sends the HTML passed in the parameters to TinyMCE.
+ *
+ * @since 2.5.0
+ *
+ * @global
+ *
+ * @param {string} html The HTML to be sent to the editor.
+ * @returns {void|boolean} Returns false when both TinyMCE and QTags instances
+ * are unavailable. This means that the HTML was not
+ * sent to the editor.
+ */
+window.send_to_editor = function( html ) {
+ var editor,
+ hasTinymce = typeof tinymce !== 'undefined',
+ hasQuicktags = typeof QTags !== 'undefined';
+
+ // If no active editor is set, try to set it.
+ if ( ! wpActiveEditor ) {
+ if ( hasTinymce && tinymce.activeEditor ) {
+ editor = tinymce.activeEditor;
+ window.wpActiveEditor = editor.id;
+ } else if ( ! hasQuicktags ) {
+ return false;
+ }
+ } else if ( hasTinymce ) {
+ editor = tinymce.get( wpActiveEditor );
+ }
+
+ // If the editor is set and not hidden, insert the HTML into the content of the
+ // editor.
+ if ( editor && ! editor.isHidden() ) {
+ editor.execCommand( 'mceInsertContent', false, html );
+ } else if ( hasQuicktags ) {
+ // If quick tags are available, insert the HTML into its content.
+ QTags.insertContent( html );
+ } else {
+ // If neither the TinyMCE editor and the quick tags are available, add the HTML
+ // to the current active editor.
+ document.getElementById( wpActiveEditor ).value += html;
+ }
+
+ // If the old thickbox remove function exists, call it.
+ if ( window.tb_remove ) {
+ try { window.tb_remove(); } catch( e ) {}
+ }
+};
+
+(function($) {
+ /**
+ * Recalculates and applies the new ThickBox position based on the current
+ * window size.
+ *
+ * @since 2.6.0
+ *
+ * @global
+ *
+ * @returns {Object[]} Array containing jQuery objects for all the found
+ * ThickBox anchors.
+ */
+ window.tb_position = function() {
+ var tbWindow = $('#TB_window'),
+ width = $(window).width(),
+ H = $(window).height(),
+ W = ( 833 < width ) ? 833 : width,
+ adminbar_height = 0;
+
+ if ( $('#wpadminbar').length ) {
+ adminbar_height = parseInt( $('#wpadminbar').css('height'), 10 );
+ }
+
+ if ( tbWindow.length ) {
+ tbWindow.width( W - 50 ).height( H - 45 - adminbar_height );
+ $('#TB_iframeContent').width( W - 50 ).height( H - 75 - adminbar_height );
+ tbWindow.css({'margin-left': '-' + parseInt( ( ( W - 50 ) / 2 ), 10 ) + 'px'});
+ if ( typeof document.body.style.maxWidth !== 'undefined' )
+ tbWindow.css({'top': 20 + adminbar_height + 'px', 'margin-top': '0'});
+ }
+
+ /**
+ * Recalculates the new height and width for all links with a ThickBox class.
+ *
+ * @since 2.6.0
+ */
+ return $('a.thickbox').each( function() {
+ var href = $(this).attr('href');
+ if ( ! href ) return;
+ href = href.replace(/&width=[0-9]+/g, '');
+ href = href.replace(/&height=[0-9]+/g, '');
+ $(this).attr( 'href', href + '&width=' + ( W - 80 ) + '&height=' + ( H - 85 - adminbar_height ) );
+ });
+ };
+
+ // Add handler to recalculates the ThickBox position when the window is resized.
+ $(window).resize(function(){ tb_position(); });
+
+})(jQuery);
diff --git a/www/crm/wp-admin/js/media-upload.min.js b/www/crm/wp-admin/js/media-upload.min.js
new file mode 100644
index 00000000..42b1cef3
--- /dev/null
+++ b/www/crm/wp-admin/js/media-upload.min.js
@@ -0,0 +1 @@
+window.send_to_editor=function(a){var b,c="undefined"!=typeof tinymce,d="undefined"!=typeof QTags;if(wpActiveEditor)c&&(b=tinymce.get(wpActiveEditor));else if(c&&tinymce.activeEditor)b=tinymce.activeEditor,window.wpActiveEditor=b.id;else if(!d)return!1;if(b&&!b.isHidden()?b.execCommand("mceInsertContent",!1,a):d?QTags.insertContent(a):document.getElementById(wpActiveEditor).value+=a,window.tb_remove)try{window.tb_remove()}catch(e){}},function(a){window.tb_position=function(){var b=a("#TB_window"),c=a(window).width(),d=a(window).height(),e=833<c?833:c,f=0;return a("#wpadminbar").length&&(f=parseInt(a("#wpadminbar").css("height"),10)),b.length&&(b.width(e-50).height(d-45-f),a("#TB_iframeContent").width(e-50).height(d-75-f),b.css({"margin-left":"-"+parseInt((e-50)/2,10)+"px"}),"undefined"!=typeof document.body.style.maxWidth&&b.css({top:20+f+"px","margin-top":"0"})),a("a.thickbox").each(function(){var b=a(this).attr("href");b&&(b=b.replace(/&width=[0-9]+/g,""),b=b.replace(/&height=[0-9]+/g,""),a(this).attr("href",b+"&width="+(e-80)+"&height="+(d-85-f)))})},a(window).resize(function(){tb_position()})}(jQuery); \ No newline at end of file
diff --git a/www/crm/wp-admin/js/media.js b/www/crm/wp-admin/js/media.js
new file mode 100644
index 00000000..4d9a5ec4
--- /dev/null
+++ b/www/crm/wp-admin/js/media.js
@@ -0,0 +1,207 @@
+/**
+ * Creates a dialog containing posts that can have a particular media attached
+ * to it.
+ *
+ * @since 2.7.0
+ * @output wp-admin/js/media.js
+ *
+ * @namespace findPosts
+ *
+ * @requires jQuery
+ */
+
+/* global ajaxurl, attachMediaBoxL10n, _wpMediaGridSettings, showNotice, findPosts */
+
+( function( $ ){
+ window.findPosts = {
+ /**
+ * Opens a dialog to attach media to a post.
+ *
+ * Adds an overlay prior to retrieving a list of posts to attach the media to.
+ *
+ * @since 2.7.0
+ *
+ * @memberOf findPosts
+ *
+ * @param {string} af_name The name of the affected element.
+ * @param {string} af_val The value of the affected post element.
+ *
+ * @returns {boolean} Always returns false.
+ */
+ open: function( af_name, af_val ) {
+ var overlay = $( '.ui-find-overlay' );
+
+ if ( overlay.length === 0 ) {
+ $( 'body' ).append( '<div class="ui-find-overlay"></div>' );
+ findPosts.overlay();
+ }
+
+ overlay.show();
+
+ if ( af_name && af_val ) {
+ // #affected is a hidden input field in the dialog that keeps track of which media should be attached.
+ $( '#affected' ).attr( 'name', af_name ).val( af_val );
+ }
+
+ $( '#find-posts' ).show();
+
+ // Close the dialog when the escape key is pressed.
+ $('#find-posts-input').focus().keyup( function( event ){
+ if ( event.which == 27 ) {
+ findPosts.close();
+ }
+ });
+
+ // Retrieves a list of applicable posts for media attachment and shows them.
+ findPosts.send();
+
+ return false;
+ },
+
+ /**
+ * Clears the found posts lists before hiding the attach media dialog.
+ *
+ * @since 2.7.0
+ *
+ * @memberOf findPosts
+ *
+ * @returns {void}
+ */
+ close: function() {
+ $('#find-posts-response').empty();
+ $('#find-posts').hide();
+ $( '.ui-find-overlay' ).hide();
+ },
+
+ /**
+ * Binds a click event listener to the overlay which closes the attach media
+ * dialog.
+ *
+ * @since 3.5.0
+ *
+ * @memberOf findPosts
+ *
+ * @returns {void}
+ */
+ overlay: function() {
+ $( '.ui-find-overlay' ).on( 'click', function () {
+ findPosts.close();
+ });
+ },
+
+ /**
+ * Retrieves and displays posts based on the search term.
+ *
+ * Sends a post request to the admin_ajax.php, requesting posts based on the
+ * search term provided by the user. Defaults to all posts if no search term is
+ * provided.
+ *
+ * @since 2.7.0
+ *
+ * @memberOf findPosts
+ *
+ * @returns {void}
+ */
+ send: function() {
+ var post = {
+ ps: $( '#find-posts-input' ).val(),
+ action: 'find_posts',
+ _ajax_nonce: $('#_ajax_nonce').val()
+ },
+ spinner = $( '.find-box-search .spinner' );
+
+ spinner.addClass( 'is-active' );
+
+ /**
+ * Send a POST request to admin_ajax.php, hide the spinner and replace the list
+ * of posts with the response data. If an error occurs, display it.
+ */
+ $.ajax( ajaxurl, {
+ type: 'POST',
+ data: post,
+ dataType: 'json'
+ }).always( function() {
+ spinner.removeClass( 'is-active' );
+ }).done( function( x ) {
+ if ( ! x.success ) {
+ $( '#find-posts-response' ).text( attachMediaBoxL10n.error );
+ }
+
+ $( '#find-posts-response' ).html( x.data );
+ }).fail( function() {
+ $( '#find-posts-response' ).text( attachMediaBoxL10n.error );
+ });
+ }
+ };
+
+ /**
+ * Initializes the file once the DOM is fully loaded and attaches events to the
+ * various form elements.
+ *
+ * @returns {void}
+ */
+ $( document ).ready( function() {
+ var settings, $mediaGridWrap = $( '#wp-media-grid' );
+
+ // Opens a manage media frame into the grid.
+ if ( $mediaGridWrap.length && window.wp && window.wp.media ) {
+ settings = _wpMediaGridSettings;
+
+ window.wp.media({
+ frame: 'manage',
+ container: $mediaGridWrap,
+ library: settings.queryVars
+ }).open();
+ }
+
+ // Prevents form submission if no post has been selected.
+ $( '#find-posts-submit' ).click( function( event ) {
+ if ( ! $( '#find-posts-response input[type="radio"]:checked' ).length )
+ event.preventDefault();
+ });
+
+ // Submits the search query when hitting the enter key in the search input.
+ $( '#find-posts .find-box-search :input' ).keypress( function( event ) {
+ if ( 13 == event.which ) {
+ findPosts.send();
+ return false;
+ }
+ });
+
+ // Binds the click event to the search button.
+ $( '#find-posts-search' ).click( findPosts.send );
+
+ // Binds the close dialog click event.
+ $( '#find-posts-close' ).click( findPosts.close );
+
+ // Binds the bulk action events to the submit buttons.
+ $( '#doaction, #doaction2' ).click( function( event ) {
+
+ /*
+ * Retrieves all select elements for bulk actions that have a name starting with `action`
+ * and handle its action based on its value.
+ */
+ $( 'select[name^="action"]' ).each( function() {
+ var optionValue = $( this ).val();
+
+ if ( 'attach' === optionValue ) {
+ event.preventDefault();
+ findPosts.open();
+ } else if ( 'delete' === optionValue ) {
+ if ( ! showNotice.warn() ) {
+ event.preventDefault();
+ }
+ }
+ });
+ });
+
+ /**
+ * Enables clicking on the entire table row.
+ *
+ * @returns {void}
+ */
+ $( '.find-box-inside' ).on( 'click', 'tr', function() {
+ $( this ).find( '.found-radio input' ).prop( 'checked', true );
+ });
+ });
+})( jQuery );
diff --git a/www/crm/wp-admin/js/media.min.js b/www/crm/wp-admin/js/media.min.js
new file mode 100644
index 00000000..2dd57558
--- /dev/null
+++ b/www/crm/wp-admin/js/media.min.js
@@ -0,0 +1 @@
+!function(a){window.findPosts={open:function(b,c){var d=a(".ui-find-overlay");return 0===d.length&&(a("body").append('<div class="ui-find-overlay"></div>'),findPosts.overlay()),d.show(),b&&c&&a("#affected").attr("name",b).val(c),a("#find-posts").show(),a("#find-posts-input").focus().keyup(function(a){27==a.which&&findPosts.close()}),findPosts.send(),!1},close:function(){a("#find-posts-response").empty(),a("#find-posts").hide(),a(".ui-find-overlay").hide()},overlay:function(){a(".ui-find-overlay").on("click",function(){findPosts.close()})},send:function(){var b={ps:a("#find-posts-input").val(),action:"find_posts",_ajax_nonce:a("#_ajax_nonce").val()},c=a(".find-box-search .spinner");c.addClass("is-active"),a.ajax(ajaxurl,{type:"POST",data:b,dataType:"json"}).always(function(){c.removeClass("is-active")}).done(function(b){b.success||a("#find-posts-response").text(attachMediaBoxL10n.error),a("#find-posts-response").html(b.data)}).fail(function(){a("#find-posts-response").text(attachMediaBoxL10n.error)})}},a(document).ready(function(){var b,c=a("#wp-media-grid");c.length&&window.wp&&window.wp.media&&(b=_wpMediaGridSettings,window.wp.media({frame:"manage",container:c,library:b.queryVars}).open()),a("#find-posts-submit").click(function(b){a('#find-posts-response input[type="radio"]:checked').length||b.preventDefault()}),a("#find-posts .find-box-search :input").keypress(function(a){if(13==a.which)return findPosts.send(),!1}),a("#find-posts-search").click(findPosts.send),a("#find-posts-close").click(findPosts.close),a("#doaction, #doaction2").click(function(b){a('select[name^="action"]').each(function(){var c=a(this).val();"attach"===c?(b.preventDefault(),findPosts.open()):"delete"===c&&(showNotice.warn()||b.preventDefault())})}),a(".find-box-inside").on("click","tr",function(){a(this).find(".found-radio input").prop("checked",!0)})})}(jQuery); \ No newline at end of file
diff --git a/www/crm/wp-admin/js/nav-menu.js b/www/crm/wp-admin/js/nav-menu.js
new file mode 100644
index 00000000..3f1f9a74
--- /dev/null
+++ b/www/crm/wp-admin/js/nav-menu.js
@@ -0,0 +1,1302 @@
+/**
+ * WordPress Administration Navigation Menu
+ * Interface JS functions
+ *
+ * @version 2.0.0
+ *
+ * @package WordPress
+ * @subpackage Administration
+ * @output wp-admin/js/nav-menu.js
+ */
+
+/* global menus, postboxes, columns, isRtl, navMenuL10n, ajaxurl, wpNavMenu */
+
+(function($) {
+
+ var api;
+
+ /**
+ * Contains all the functions to handle WordPress navigation menus administration.
+ *
+ * @namespace wpNavMenu
+ */
+ api = window.wpNavMenu = {
+
+ options : {
+ menuItemDepthPerLevel : 30, // Do not use directly. Use depthToPx and pxToDepth instead.
+ globalMaxDepth: 11,
+ sortableItems: '> *',
+ targetTolerance: 0
+ },
+
+ menuList : undefined, // Set in init.
+ targetList : undefined, // Set in init.
+ menusChanged : false,
+ isRTL: !! ( 'undefined' != typeof isRtl && isRtl ),
+ negateIfRTL: ( 'undefined' != typeof isRtl && isRtl ) ? -1 : 1,
+ lastSearch: '',
+
+ // Functions that run on init.
+ init : function() {
+ api.menuList = $('#menu-to-edit');
+ api.targetList = api.menuList;
+
+ this.jQueryExtensions();
+
+ this.attachMenuEditListeners();
+
+ this.attachQuickSearchListeners();
+ this.attachThemeLocationsListeners();
+ this.attachMenuSaveSubmitListeners();
+
+ this.attachTabsPanelListeners();
+
+ this.attachUnsavedChangesListener();
+
+ if ( api.menuList.length )
+ this.initSortables();
+
+ if ( menus.oneThemeLocationNoMenus )
+ $( '#posttype-page' ).addSelectedToMenu( api.addMenuItemToBottom );
+
+ this.initManageLocations();
+
+ this.initAccessibility();
+
+ this.initToggles();
+
+ this.initPreviewing();
+ },
+
+ jQueryExtensions : function() {
+ // jQuery extensions
+ $.fn.extend({
+ menuItemDepth : function() {
+ var margin = api.isRTL ? this.eq(0).css('margin-right') : this.eq(0).css('margin-left');
+ return api.pxToDepth( margin && -1 != margin.indexOf('px') ? margin.slice(0, -2) : 0 );
+ },
+ updateDepthClass : function(current, prev) {
+ return this.each(function(){
+ var t = $(this);
+ prev = prev || t.menuItemDepth();
+ $(this).removeClass('menu-item-depth-'+ prev )
+ .addClass('menu-item-depth-'+ current );
+ });
+ },
+ shiftDepthClass : function(change) {
+ return this.each(function(){
+ var t = $(this),
+ depth = t.menuItemDepth(),
+ newDepth = depth + change;
+
+ t.removeClass( 'menu-item-depth-'+ depth )
+ .addClass( 'menu-item-depth-'+ ( newDepth ) );
+
+ if ( 0 === newDepth ) {
+ t.find( '.is-submenu' ).hide();
+ }
+ });
+ },
+ childMenuItems : function() {
+ var result = $();
+ this.each(function(){
+ var t = $(this), depth = t.menuItemDepth(), next = t.next( '.menu-item' );
+ while( next.length && next.menuItemDepth() > depth ) {
+ result = result.add( next );
+ next = next.next( '.menu-item' );
+ }
+ });
+ return result;
+ },
+ shiftHorizontally : function( dir ) {
+ return this.each(function(){
+ var t = $(this),
+ depth = t.menuItemDepth(),
+ newDepth = depth + dir;
+
+ // Change .menu-item-depth-n class
+ t.moveHorizontally( newDepth, depth );
+ });
+ },
+ moveHorizontally : function( newDepth, depth ) {
+ return this.each(function(){
+ var t = $(this),
+ children = t.childMenuItems(),
+ diff = newDepth - depth,
+ subItemText = t.find('.is-submenu');
+
+ // Change .menu-item-depth-n class
+ t.updateDepthClass( newDepth, depth ).updateParentMenuItemDBId();
+
+ // If it has children, move those too
+ if ( children ) {
+ children.each(function() {
+ var t = $(this),
+ thisDepth = t.menuItemDepth(),
+ newDepth = thisDepth + diff;
+ t.updateDepthClass(newDepth, thisDepth).updateParentMenuItemDBId();
+ });
+ }
+
+ // Show "Sub item" helper text
+ if (0 === newDepth)
+ subItemText.hide();
+ else
+ subItemText.show();
+ });
+ },
+ updateParentMenuItemDBId : function() {
+ return this.each(function(){
+ var item = $(this),
+ input = item.find( '.menu-item-data-parent-id' ),
+ depth = parseInt( item.menuItemDepth(), 10 ),
+ parentDepth = depth - 1,
+ parent = item.prevAll( '.menu-item-depth-' + parentDepth ).first();
+
+ if ( 0 === depth ) { // Item is on the top level, has no parent
+ input.val(0);
+ } else { // Find the parent item, and retrieve its object id.
+ input.val( parent.find( '.menu-item-data-db-id' ).val() );
+ }
+ });
+ },
+ hideAdvancedMenuItemFields : function() {
+ return this.each(function(){
+ var that = $(this);
+ $('.hide-column-tog').not(':checked').each(function(){
+ that.find('.field-' + $(this).val() ).addClass('hidden-field');
+ });
+ });
+ },
+ /**
+ * Adds selected menu items to the menu.
+ *
+ * @ignore
+ *
+ * @param jQuery metabox The metabox jQuery object.
+ */
+ addSelectedToMenu : function(processMethod) {
+ if ( 0 === $('#menu-to-edit').length ) {
+ return false;
+ }
+
+ return this.each(function() {
+ var t = $(this), menuItems = {},
+ checkboxes = ( menus.oneThemeLocationNoMenus && 0 === t.find( '.tabs-panel-active .categorychecklist li input:checked' ).length ) ? t.find( '#page-all li input[type="checkbox"]' ) : t.find( '.tabs-panel-active .categorychecklist li input:checked' ),
+ re = /menu-item\[([^\]]*)/;
+
+ processMethod = processMethod || api.addMenuItemToBottom;
+
+ // If no items are checked, bail.
+ if ( !checkboxes.length )
+ return false;
+
+ // Show the ajax spinner
+ t.find( '.button-controls .spinner' ).addClass( 'is-active' );
+
+ // Retrieve menu item data
+ $(checkboxes).each(function(){
+ var t = $(this),
+ listItemDBIDMatch = re.exec( t.attr('name') ),
+ listItemDBID = 'undefined' == typeof listItemDBIDMatch[1] ? 0 : parseInt(listItemDBIDMatch[1], 10);
+
+ if ( this.className && -1 != this.className.indexOf('add-to-top') )
+ processMethod = api.addMenuItemToTop;
+ menuItems[listItemDBID] = t.closest('li').getItemData( 'add-menu-item', listItemDBID );
+ });
+
+ // Add the items
+ api.addItemToMenu(menuItems, processMethod, function(){
+ // Deselect the items and hide the ajax spinner
+ checkboxes.removeAttr('checked');
+ t.find( '.button-controls .spinner' ).removeClass( 'is-active' );
+ });
+ });
+ },
+ getItemData : function( itemType, id ) {
+ itemType = itemType || 'menu-item';
+
+ var itemData = {}, i,
+ fields = [
+ 'menu-item-db-id',
+ 'menu-item-object-id',
+ 'menu-item-object',
+ 'menu-item-parent-id',
+ 'menu-item-position',
+ 'menu-item-type',
+ 'menu-item-title',
+ 'menu-item-url',
+ 'menu-item-description',
+ 'menu-item-attr-title',
+ 'menu-item-target',
+ 'menu-item-classes',
+ 'menu-item-xfn'
+ ];
+
+ if( !id && itemType == 'menu-item' ) {
+ id = this.find('.menu-item-data-db-id').val();
+ }
+
+ if( !id ) return itemData;
+
+ this.find('input').each(function() {
+ var field;
+ i = fields.length;
+ while ( i-- ) {
+ if( itemType == 'menu-item' )
+ field = fields[i] + '[' + id + ']';
+ else if( itemType == 'add-menu-item' )
+ field = 'menu-item[' + id + '][' + fields[i] + ']';
+
+ if (
+ this.name &&
+ field == this.name
+ ) {
+ itemData[fields[i]] = this.value;
+ }
+ }
+ });
+
+ return itemData;
+ },
+ setItemData : function( itemData, itemType, id ) { // Can take a type, such as 'menu-item', or an id.
+ itemType = itemType || 'menu-item';
+
+ if( !id && itemType == 'menu-item' ) {
+ id = $('.menu-item-data-db-id', this).val();
+ }
+
+ if( !id ) return this;
+
+ this.find('input').each(function() {
+ var t = $(this), field;
+ $.each( itemData, function( attr, val ) {
+ if( itemType == 'menu-item' )
+ field = attr + '[' + id + ']';
+ else if( itemType == 'add-menu-item' )
+ field = 'menu-item[' + id + '][' + attr + ']';
+
+ if ( field == t.attr('name') ) {
+ t.val( val );
+ }
+ });
+ });
+ return this;
+ }
+ });
+ },
+
+ countMenuItems : function( depth ) {
+ return $( '.menu-item-depth-' + depth ).length;
+ },
+
+ moveMenuItem : function( $this, dir ) {
+
+ var items, newItemPosition, newDepth,
+ menuItems = $( '#menu-to-edit li' ),
+ menuItemsCount = menuItems.length,
+ thisItem = $this.parents( 'li.menu-item' ),
+ thisItemChildren = thisItem.childMenuItems(),
+ thisItemData = thisItem.getItemData(),
+ thisItemDepth = parseInt( thisItem.menuItemDepth(), 10 ),
+ thisItemPosition = parseInt( thisItem.index(), 10 ),
+ nextItem = thisItem.next(),
+ nextItemChildren = nextItem.childMenuItems(),
+ nextItemDepth = parseInt( nextItem.menuItemDepth(), 10 ) + 1,
+ prevItem = thisItem.prev(),
+ prevItemDepth = parseInt( prevItem.menuItemDepth(), 10 ),
+ prevItemId = prevItem.getItemData()['menu-item-db-id'];
+
+ switch ( dir ) {
+ case 'up':
+ newItemPosition = thisItemPosition - 1;
+
+ // Already at top
+ if ( 0 === thisItemPosition )
+ break;
+
+ // If a sub item is moved to top, shift it to 0 depth
+ if ( 0 === newItemPosition && 0 !== thisItemDepth )
+ thisItem.moveHorizontally( 0, thisItemDepth );
+
+ // If prev item is sub item, shift to match depth
+ if ( 0 !== prevItemDepth )
+ thisItem.moveHorizontally( prevItemDepth, thisItemDepth );
+
+ // Does this item have sub items?
+ if ( thisItemChildren ) {
+ items = thisItem.add( thisItemChildren );
+ // Move the entire block
+ items.detach().insertBefore( menuItems.eq( newItemPosition ) ).updateParentMenuItemDBId();
+ } else {
+ thisItem.detach().insertBefore( menuItems.eq( newItemPosition ) ).updateParentMenuItemDBId();
+ }
+ break;
+ case 'down':
+ // Does this item have sub items?
+ if ( thisItemChildren ) {
+ items = thisItem.add( thisItemChildren ),
+ nextItem = menuItems.eq( items.length + thisItemPosition ),
+ nextItemChildren = 0 !== nextItem.childMenuItems().length;
+
+ if ( nextItemChildren ) {
+ newDepth = parseInt( nextItem.menuItemDepth(), 10 ) + 1;
+ thisItem.moveHorizontally( newDepth, thisItemDepth );
+ }
+
+ // Have we reached the bottom?
+ if ( menuItemsCount === thisItemPosition + items.length )
+ break;
+
+ items.detach().insertAfter( menuItems.eq( thisItemPosition + items.length ) ).updateParentMenuItemDBId();
+ } else {
+ // If next item has sub items, shift depth
+ if ( 0 !== nextItemChildren.length )
+ thisItem.moveHorizontally( nextItemDepth, thisItemDepth );
+
+ // Have we reached the bottom
+ if ( menuItemsCount === thisItemPosition + 1 )
+ break;
+ thisItem.detach().insertAfter( menuItems.eq( thisItemPosition + 1 ) ).updateParentMenuItemDBId();
+ }
+ break;
+ case 'top':
+ // Already at top
+ if ( 0 === thisItemPosition )
+ break;
+ // Does this item have sub items?
+ if ( thisItemChildren ) {
+ items = thisItem.add( thisItemChildren );
+ // Move the entire block
+ items.detach().insertBefore( menuItems.eq( 0 ) ).updateParentMenuItemDBId();
+ } else {
+ thisItem.detach().insertBefore( menuItems.eq( 0 ) ).updateParentMenuItemDBId();
+ }
+ break;
+ case 'left':
+ // As far left as possible
+ if ( 0 === thisItemDepth )
+ break;
+ thisItem.shiftHorizontally( -1 );
+ break;
+ case 'right':
+ // Can't be sub item at top
+ if ( 0 === thisItemPosition )
+ break;
+ // Already sub item of prevItem
+ if ( thisItemData['menu-item-parent-id'] === prevItemId )
+ break;
+ thisItem.shiftHorizontally( 1 );
+ break;
+ }
+ $this.focus();
+ api.registerChange();
+ api.refreshKeyboardAccessibility();
+ api.refreshAdvancedAccessibility();
+ },
+
+ initAccessibility : function() {
+ var menu = $( '#menu-to-edit' );
+
+ api.refreshKeyboardAccessibility();
+ api.refreshAdvancedAccessibility();
+
+ // Refresh the accessibility when the user comes close to the item in any way
+ menu.on( 'mouseenter.refreshAccessibility focus.refreshAccessibility touchstart.refreshAccessibility' , '.menu-item' , function(){
+ api.refreshAdvancedAccessibilityOfItem( $( this ).find( 'a.item-edit' ) );
+ } );
+
+ // We have to update on click as well because we might hover first, change the item, and then click.
+ menu.on( 'click', 'a.item-edit', function() {
+ api.refreshAdvancedAccessibilityOfItem( $( this ) );
+ } );
+
+ // Links for moving items
+ menu.on( 'click', '.menus-move', function () {
+ var $this = $( this ),
+ dir = $this.data( 'dir' );
+
+ if ( 'undefined' !== typeof dir ) {
+ api.moveMenuItem( $( this ).parents( 'li.menu-item' ).find( 'a.item-edit' ), dir );
+ }
+ });
+ },
+
+ /**
+ * refreshAdvancedAccessibilityOfItem( [itemToRefresh] )
+ *
+ * Refreshes advanced accessibility buttons for one menu item.
+ * Shows or hides buttons based on the location of the menu item.
+ *
+ * @param {object} itemToRefresh The menu item that might need its advanced accessibility buttons refreshed
+ */
+ refreshAdvancedAccessibilityOfItem : function( itemToRefresh ) {
+
+ // Only refresh accessibility when necessary
+ if ( true !== $( itemToRefresh ).data( 'needs_accessibility_refresh' ) ) {
+ return;
+ }
+
+ var thisLink, thisLinkText, primaryItems, itemPosition, title,
+ parentItem, parentItemId, parentItemName, subItems,
+ $this = $( itemToRefresh ),
+ menuItem = $this.closest( 'li.menu-item' ).first(),
+ depth = menuItem.menuItemDepth(),
+ isPrimaryMenuItem = ( 0 === depth ),
+ itemName = $this.closest( '.menu-item-handle' ).find( '.menu-item-title' ).text(),
+ position = parseInt( menuItem.index(), 10 ),
+ prevItemDepth = ( isPrimaryMenuItem ) ? depth : parseInt( depth - 1, 10 ),
+ prevItemNameLeft = menuItem.prevAll('.menu-item-depth-' + prevItemDepth).first().find( '.menu-item-title' ).text(),
+ prevItemNameRight = menuItem.prevAll('.menu-item-depth-' + depth).first().find( '.menu-item-title' ).text(),
+ totalMenuItems = $('#menu-to-edit li').length,
+ hasSameDepthSibling = menuItem.nextAll( '.menu-item-depth-' + depth ).length;
+
+ menuItem.find( '.field-move' ).toggle( totalMenuItems > 1 );
+
+ // Where can they move this menu item?
+ if ( 0 !== position ) {
+ thisLink = menuItem.find( '.menus-move-up' );
+ thisLink.attr( 'aria-label', menus.moveUp ).css( 'display', 'inline' );
+ }
+
+ if ( 0 !== position && isPrimaryMenuItem ) {
+ thisLink = menuItem.find( '.menus-move-top' );
+ thisLink.attr( 'aria-label', menus.moveToTop ).css( 'display', 'inline' );
+ }
+
+ if ( position + 1 !== totalMenuItems && 0 !== position ) {
+ thisLink = menuItem.find( '.menus-move-down' );
+ thisLink.attr( 'aria-label', menus.moveDown ).css( 'display', 'inline' );
+ }
+
+ if ( 0 === position && 0 !== hasSameDepthSibling ) {
+ thisLink = menuItem.find( '.menus-move-down' );
+ thisLink.attr( 'aria-label', menus.moveDown ).css( 'display', 'inline' );
+ }
+
+ if ( ! isPrimaryMenuItem ) {
+ thisLink = menuItem.find( '.menus-move-left' ),
+ thisLinkText = menus.outFrom.replace( '%s', prevItemNameLeft );
+ thisLink.attr( 'aria-label', menus.moveOutFrom.replace( '%s', prevItemNameLeft ) ).text( thisLinkText ).css( 'display', 'inline' );
+ }
+
+ if ( 0 !== position ) {
+ if ( menuItem.find( '.menu-item-data-parent-id' ).val() !== menuItem.prev().find( '.menu-item-data-db-id' ).val() ) {
+ thisLink = menuItem.find( '.menus-move-right' ),
+ thisLinkText = menus.under.replace( '%s', prevItemNameRight );
+ thisLink.attr( 'aria-label', menus.moveUnder.replace( '%s', prevItemNameRight ) ).text( thisLinkText ).css( 'display', 'inline' );
+ }
+ }
+
+ if ( isPrimaryMenuItem ) {
+ primaryItems = $( '.menu-item-depth-0' ),
+ itemPosition = primaryItems.index( menuItem ) + 1,
+ totalMenuItems = primaryItems.length,
+
+ // String together help text for primary menu items
+ title = menus.menuFocus.replace( '%1$s', itemName ).replace( '%2$d', itemPosition ).replace( '%3$d', totalMenuItems );
+ } else {
+ parentItem = menuItem.prevAll( '.menu-item-depth-' + parseInt( depth - 1, 10 ) ).first(),
+ parentItemId = parentItem.find( '.menu-item-data-db-id' ).val(),
+ parentItemName = parentItem.find( '.menu-item-title' ).text(),
+ subItems = $( '.menu-item .menu-item-data-parent-id[value="' + parentItemId + '"]' ),
+ itemPosition = $( subItems.parents('.menu-item').get().reverse() ).index( menuItem ) + 1;
+
+ // String together help text for sub menu items
+ title = menus.subMenuFocus.replace( '%1$s', itemName ).replace( '%2$d', itemPosition ).replace( '%3$s', parentItemName );
+ }
+
+ $this.attr( 'aria-label', title );
+
+ // Mark this item's accessibility as refreshed
+ $this.data( 'needs_accessibility_refresh', false );
+ },
+
+ /**
+ * refreshAdvancedAccessibility
+ *
+ * Hides all advanced accessibility buttons and marks them for refreshing.
+ */
+ refreshAdvancedAccessibility : function() {
+
+ // Hide all the move buttons by default.
+ $( '.menu-item-settings .field-move .menus-move' ).hide();
+
+ // Mark all menu items as unprocessed
+ $( 'a.item-edit' ).data( 'needs_accessibility_refresh', true );
+
+ // All open items have to be refreshed or they will show no links
+ $( '.menu-item-edit-active a.item-edit' ).each( function() {
+ api.refreshAdvancedAccessibilityOfItem( this );
+ } );
+ },
+
+ refreshKeyboardAccessibility : function() {
+ $( 'a.item-edit' ).off( 'focus' ).on( 'focus', function(){
+ $(this).off( 'keydown' ).on( 'keydown', function(e){
+
+ var arrows,
+ $this = $( this ),
+ thisItem = $this.parents( 'li.menu-item' ),
+ thisItemData = thisItem.getItemData();
+
+ // Bail if it's not an arrow key
+ if ( 37 != e.which && 38 != e.which && 39 != e.which && 40 != e.which )
+ return;
+
+ // Avoid multiple keydown events
+ $this.off('keydown');
+
+ // Bail if there is only one menu item
+ if ( 1 === $('#menu-to-edit li').length )
+ return;
+
+ // If RTL, swap left/right arrows
+ arrows = { '38': 'up', '40': 'down', '37': 'left', '39': 'right' };
+ if ( $('body').hasClass('rtl') )
+ arrows = { '38' : 'up', '40' : 'down', '39' : 'left', '37' : 'right' };
+
+ switch ( arrows[e.which] ) {
+ case 'up':
+ api.moveMenuItem( $this, 'up' );
+ break;
+ case 'down':
+ api.moveMenuItem( $this, 'down' );
+ break;
+ case 'left':
+ api.moveMenuItem( $this, 'left' );
+ break;
+ case 'right':
+ api.moveMenuItem( $this, 'right' );
+ break;
+ }
+ // Put focus back on same menu item
+ $( '#edit-' + thisItemData['menu-item-db-id'] ).focus();
+ return false;
+ });
+ });
+ },
+
+ initPreviewing : function() {
+ // Update the item handle title when the navigation label is changed.
+ $( '#menu-to-edit' ).on( 'change input', '.edit-menu-item-title', function(e) {
+ var input = $( e.currentTarget ), title, titleEl;
+ title = input.val();
+ titleEl = input.closest( '.menu-item' ).find( '.menu-item-title' );
+ // Don't update to empty title.
+ if ( title ) {
+ titleEl.text( title ).removeClass( 'no-title' );
+ } else {
+ titleEl.text( navMenuL10n.untitled ).addClass( 'no-title' );
+ }
+ } );
+ },
+
+ initToggles : function() {
+ // init postboxes
+ postboxes.add_postbox_toggles('nav-menus');
+
+ // adjust columns functions for menus UI
+ columns.useCheckboxesForHidden();
+ columns.checked = function(field) {
+ $('.field-' + field).removeClass('hidden-field');
+ };
+ columns.unchecked = function(field) {
+ $('.field-' + field).addClass('hidden-field');
+ };
+ // hide fields
+ api.menuList.hideAdvancedMenuItemFields();
+
+ $('.hide-postbox-tog').click(function () {
+ var hidden = $( '.accordion-container li.accordion-section' ).filter(':hidden').map(function() { return this.id; }).get().join(',');
+ $.post(ajaxurl, {
+ action: 'closed-postboxes',
+ hidden: hidden,
+ closedpostboxesnonce: jQuery('#closedpostboxesnonce').val(),
+ page: 'nav-menus'
+ });
+ });
+ },
+
+ initSortables : function() {
+ var currentDepth = 0, originalDepth, minDepth, maxDepth,
+ prev, next, prevBottom, nextThreshold, helperHeight, transport,
+ menuEdge = api.menuList.offset().left,
+ body = $('body'), maxChildDepth,
+ menuMaxDepth = initialMenuMaxDepth();
+
+ if( 0 !== $( '#menu-to-edit li' ).length )
+ $( '.drag-instructions' ).show();
+
+ // Use the right edge if RTL.
+ menuEdge += api.isRTL ? api.menuList.width() : 0;
+
+ api.menuList.sortable({
+ handle: '.menu-item-handle',
+ placeholder: 'sortable-placeholder',
+ items: api.options.sortableItems,
+ start: function(e, ui) {
+ var height, width, parent, children, tempHolder;
+
+ // handle placement for rtl orientation
+ if ( api.isRTL )
+ ui.item[0].style.right = 'auto';
+
+ transport = ui.item.children('.menu-item-transport');
+
+ // Set depths. currentDepth must be set before children are located.
+ originalDepth = ui.item.menuItemDepth();
+ updateCurrentDepth(ui, originalDepth);
+
+ // Attach child elements to parent
+ // Skip the placeholder
+ parent = ( ui.item.next()[0] == ui.placeholder[0] ) ? ui.item.next() : ui.item;
+ children = parent.childMenuItems();
+ transport.append( children );
+
+ // Update the height of the placeholder to match the moving item.
+ height = transport.outerHeight();
+ // If there are children, account for distance between top of children and parent
+ height += ( height > 0 ) ? (ui.placeholder.css('margin-top').slice(0, -2) * 1) : 0;
+ height += ui.helper.outerHeight();
+ helperHeight = height;
+ height -= 2; // Subtract 2 for borders
+ ui.placeholder.height(height);
+
+ // Update the width of the placeholder to match the moving item.
+ maxChildDepth = originalDepth;
+ children.each(function(){
+ var depth = $(this).menuItemDepth();
+ maxChildDepth = (depth > maxChildDepth) ? depth : maxChildDepth;
+ });
+ width = ui.helper.find('.menu-item-handle').outerWidth(); // Get original width
+ width += api.depthToPx(maxChildDepth - originalDepth); // Account for children
+ width -= 2; // Subtract 2 for borders
+ ui.placeholder.width(width);
+
+ // Update the list of menu items.
+ tempHolder = ui.placeholder.next( '.menu-item' );
+ tempHolder.css( 'margin-top', helperHeight + 'px' ); // Set the margin to absorb the placeholder
+ ui.placeholder.detach(); // detach or jQuery UI will think the placeholder is a menu item
+ $(this).sortable( 'refresh' ); // The children aren't sortable. We should let jQ UI know.
+ ui.item.after( ui.placeholder ); // reattach the placeholder.
+ tempHolder.css('margin-top', 0); // reset the margin
+
+ // Now that the element is complete, we can update...
+ updateSharedVars(ui);
+ },
+ stop: function(e, ui) {
+ var children, subMenuTitle,
+ depthChange = currentDepth - originalDepth;
+
+ // Return child elements to the list
+ children = transport.children().insertAfter(ui.item);
+
+ // Add "sub menu" description
+ subMenuTitle = ui.item.find( '.item-title .is-submenu' );
+ if ( 0 < currentDepth )
+ subMenuTitle.show();
+ else
+ subMenuTitle.hide();
+
+ // Update depth classes
+ if ( 0 !== depthChange ) {
+ ui.item.updateDepthClass( currentDepth );
+ children.shiftDepthClass( depthChange );
+ updateMenuMaxDepth( depthChange );
+ }
+ // Register a change
+ api.registerChange();
+ // Update the item data.
+ ui.item.updateParentMenuItemDBId();
+
+ // address sortable's incorrectly-calculated top in opera
+ ui.item[0].style.top = 0;
+
+ // handle drop placement for rtl orientation
+ if ( api.isRTL ) {
+ ui.item[0].style.left = 'auto';
+ ui.item[0].style.right = 0;
+ }
+
+ api.refreshKeyboardAccessibility();
+ api.refreshAdvancedAccessibility();
+ },
+ change: function(e, ui) {
+ // Make sure the placeholder is inside the menu.
+ // Otherwise fix it, or we're in trouble.
+ if( ! ui.placeholder.parent().hasClass('menu') )
+ (prev.length) ? prev.after( ui.placeholder ) : api.menuList.prepend( ui.placeholder );
+
+ updateSharedVars(ui);
+ },
+ sort: function(e, ui) {
+ var offset = ui.helper.offset(),
+ edge = api.isRTL ? offset.left + ui.helper.width() : offset.left,
+ depth = api.negateIfRTL * api.pxToDepth( edge - menuEdge );
+
+ // Check and correct if depth is not within range.
+ // Also, if the dragged element is dragged upwards over
+ // an item, shift the placeholder to a child position.
+ if ( depth > maxDepth || offset.top < ( prevBottom - api.options.targetTolerance ) ) {
+ depth = maxDepth;
+ } else if ( depth < minDepth ) {
+ depth = minDepth;
+ }
+
+ if( depth != currentDepth )
+ updateCurrentDepth(ui, depth);
+
+ // If we overlap the next element, manually shift downwards
+ if( nextThreshold && offset.top + helperHeight > nextThreshold ) {
+ next.after( ui.placeholder );
+ updateSharedVars( ui );
+ $( this ).sortable( 'refreshPositions' );
+ }
+ }
+ });
+
+ function updateSharedVars(ui) {
+ var depth;
+
+ prev = ui.placeholder.prev( '.menu-item' );
+ next = ui.placeholder.next( '.menu-item' );
+
+ // Make sure we don't select the moving item.
+ if( prev[0] == ui.item[0] ) prev = prev.prev( '.menu-item' );
+ if( next[0] == ui.item[0] ) next = next.next( '.menu-item' );
+
+ prevBottom = (prev.length) ? prev.offset().top + prev.height() : 0;
+ nextThreshold = (next.length) ? next.offset().top + next.height() / 3 : 0;
+ minDepth = (next.length) ? next.menuItemDepth() : 0;
+
+ if( prev.length )
+ maxDepth = ( (depth = prev.menuItemDepth() + 1) > api.options.globalMaxDepth ) ? api.options.globalMaxDepth : depth;
+ else
+ maxDepth = 0;
+ }
+
+ function updateCurrentDepth(ui, depth) {
+ ui.placeholder.updateDepthClass( depth, currentDepth );
+ currentDepth = depth;
+ }
+
+ function initialMenuMaxDepth() {
+ if( ! body[0].className ) return 0;
+ var match = body[0].className.match(/menu-max-depth-(\d+)/);
+ return match && match[1] ? parseInt( match[1], 10 ) : 0;
+ }
+
+ function updateMenuMaxDepth( depthChange ) {
+ var depth, newDepth = menuMaxDepth;
+ if ( depthChange === 0 ) {
+ return;
+ } else if ( depthChange > 0 ) {
+ depth = maxChildDepth + depthChange;
+ if( depth > menuMaxDepth )
+ newDepth = depth;
+ } else if ( depthChange < 0 && maxChildDepth == menuMaxDepth ) {
+ while( ! $('.menu-item-depth-' + newDepth, api.menuList).length && newDepth > 0 )
+ newDepth--;
+ }
+ // Update the depth class.
+ body.removeClass( 'menu-max-depth-' + menuMaxDepth ).addClass( 'menu-max-depth-' + newDepth );
+ menuMaxDepth = newDepth;
+ }
+ },
+
+ initManageLocations : function () {
+ $('#menu-locations-wrap form').submit(function(){
+ window.onbeforeunload = null;
+ });
+ $('.menu-location-menus select').on('change', function () {
+ var editLink = $(this).closest('tr').find('.locations-edit-menu-link');
+ if ($(this).find('option:selected').data('orig'))
+ editLink.show();
+ else
+ editLink.hide();
+ });
+ },
+
+ attachMenuEditListeners : function() {
+ var that = this;
+ $('#update-nav-menu').bind('click', function(e) {
+ if ( e.target && e.target.className ) {
+ if ( -1 != e.target.className.indexOf('item-edit') ) {
+ return that.eventOnClickEditLink(e.target);
+ } else if ( -1 != e.target.className.indexOf('menu-save') ) {
+ return that.eventOnClickMenuSave(e.target);
+ } else if ( -1 != e.target.className.indexOf('menu-delete') ) {
+ return that.eventOnClickMenuDelete(e.target);
+ } else if ( -1 != e.target.className.indexOf('item-delete') ) {
+ return that.eventOnClickMenuItemDelete(e.target);
+ } else if ( -1 != e.target.className.indexOf('item-cancel') ) {
+ return that.eventOnClickCancelLink(e.target);
+ }
+ }
+ });
+
+ $( '#menu-name' ).on( 'input', _.debounce( function () {
+ var menuName = $( document.getElementById( 'menu-name' ) ),
+ menuNameVal = menuName.val();
+
+ if ( ! menuNameVal || ! menuNameVal.replace( /\s+/, '' ) ) {
+ // Add warning for invalid menu name.
+ menuName.parent().addClass( 'form-invalid' );
+ } else {
+ // Remove warning for valid menu name.
+ menuName.parent().removeClass( 'form-invalid' );
+ }
+ }, 500 ) );
+
+ $('#add-custom-links input[type="text"]').keypress(function(e){
+ $('#customlinkdiv').removeClass('form-invalid');
+
+ if ( e.keyCode === 13 ) {
+ e.preventDefault();
+ $( '#submit-customlinkdiv' ).click();
+ }
+ });
+ },
+
+ attachMenuSaveSubmitListeners : function() {
+ /*
+ * When a navigation menu is saved, store a JSON representation of all form data
+ * in a single input to avoid PHP `max_input_vars` limitations. See #14134.
+ */
+ $( '#update-nav-menu' ).submit( function() {
+ var navMenuData = $( '#update-nav-menu' ).serializeArray();
+ $( '[name="nav-menu-data"]' ).val( JSON.stringify( navMenuData ) );
+ });
+ },
+
+ attachThemeLocationsListeners : function() {
+ var loc = $('#nav-menu-theme-locations'), params = {};
+ params.action = 'menu-locations-save';
+ params['menu-settings-column-nonce'] = $('#menu-settings-column-nonce').val();
+ loc.find('input[type="submit"]').click(function() {
+ loc.find('select').each(function() {
+ params[this.name] = $(this).val();
+ });
+ loc.find( '.spinner' ).addClass( 'is-active' );
+ $.post( ajaxurl, params, function() {
+ loc.find( '.spinner' ).removeClass( 'is-active' );
+ });
+ return false;
+ });
+ },
+
+ attachQuickSearchListeners : function() {
+ var searchTimer;
+
+ // Prevent form submission.
+ $( '#nav-menu-meta' ).on( 'submit', function( event ) {
+ event.preventDefault();
+ });
+
+ $( '#nav-menu-meta' ).on( 'input', '.quick-search', function() {
+ var $this = $( this );
+
+ $this.attr( 'autocomplete', 'off' );
+
+ if ( searchTimer ) {
+ clearTimeout( searchTimer );
+ }
+
+ searchTimer = setTimeout( function() {
+ api.updateQuickSearchResults( $this );
+ }, 500 );
+ }).on( 'blur', '.quick-search', function() {
+ api.lastSearch = '';
+ });
+ },
+
+ updateQuickSearchResults : function(input) {
+ var panel, params,
+ minSearchLength = 2,
+ q = input.val();
+
+ /*
+ * Minimum characters for a search. Also avoid a new AJAX search when
+ * the pressed key (e.g. arrows) doesn't change the searched term.
+ */
+ if ( q.length < minSearchLength || api.lastSearch == q ) {
+ return;
+ }
+
+ api.lastSearch = q;
+
+ panel = input.parents('.tabs-panel');
+ params = {
+ 'action': 'menu-quick-search',
+ 'response-format': 'markup',
+ 'menu': $('#menu').val(),
+ 'menu-settings-column-nonce': $('#menu-settings-column-nonce').val(),
+ 'q': q,
+ 'type': input.attr('name')
+ };
+
+ $( '.spinner', panel ).addClass( 'is-active' );
+
+ $.post( ajaxurl, params, function(menuMarkup) {
+ api.processQuickSearchQueryResponse(menuMarkup, params, panel);
+ });
+ },
+
+ addCustomLink : function( processMethod ) {
+ var url = $('#custom-menu-item-url').val().trim(),
+ label = $('#custom-menu-item-name').val();
+
+ processMethod = processMethod || api.addMenuItemToBottom;
+
+ if ( '' === url || 'http://' == url ) {
+ $('#customlinkdiv').addClass('form-invalid');
+ return false;
+ }
+
+ // Show the ajax spinner
+ $( '.customlinkdiv .spinner' ).addClass( 'is-active' );
+ this.addLinkToMenu( url, label, processMethod, function() {
+ // Remove the ajax spinner
+ $( '.customlinkdiv .spinner' ).removeClass( 'is-active' );
+ // Set custom link form back to defaults
+ $('#custom-menu-item-name').val('').blur();
+ $('#custom-menu-item-url').val('http://');
+ });
+ },
+
+ addLinkToMenu : function(url, label, processMethod, callback) {
+ processMethod = processMethod || api.addMenuItemToBottom;
+ callback = callback || function(){};
+
+ api.addItemToMenu({
+ '-1': {
+ 'menu-item-type': 'custom',
+ 'menu-item-url': url,
+ 'menu-item-title': label
+ }
+ }, processMethod, callback);
+ },
+
+ addItemToMenu : function(menuItem, processMethod, callback) {
+ var menu = $('#menu').val(),
+ nonce = $('#menu-settings-column-nonce').val(),
+ params;
+
+ processMethod = processMethod || function(){};
+ callback = callback || function(){};
+
+ params = {
+ 'action': 'add-menu-item',
+ 'menu': menu,
+ 'menu-settings-column-nonce': nonce,
+ 'menu-item': menuItem
+ };
+
+ $.post( ajaxurl, params, function(menuMarkup) {
+ var ins = $('#menu-instructions');
+
+ menuMarkup = $.trim( menuMarkup ); // Trim leading whitespaces
+ processMethod(menuMarkup, params);
+
+ // Make it stand out a bit more visually, by adding a fadeIn
+ $( 'li.pending' ).hide().fadeIn('slow');
+ $( '.drag-instructions' ).show();
+ if( ! ins.hasClass( 'menu-instructions-inactive' ) && ins.siblings().length )
+ ins.addClass( 'menu-instructions-inactive' );
+
+ callback();
+ });
+ },
+
+ /**
+ * Process the add menu item request response into menu list item. Appends to menu.
+ *
+ * @param {string} menuMarkup The text server response of menu item markup.
+ *
+ * @fires document#menu-item-added Passes menuMarkup as a jQuery object.
+ */
+ addMenuItemToBottom : function( menuMarkup ) {
+ var $menuMarkup = $( menuMarkup );
+ $menuMarkup.hideAdvancedMenuItemFields().appendTo( api.targetList );
+ api.refreshKeyboardAccessibility();
+ api.refreshAdvancedAccessibility();
+ $( document ).trigger( 'menu-item-added', [ $menuMarkup ] );
+ },
+
+ /**
+ * Process the add menu item request response into menu list item. Prepends to menu.
+ *
+ * @param {string} menuMarkup The text server response of menu item markup.
+ *
+ * @fires document#menu-item-added Passes menuMarkup as a jQuery object.
+ */
+ addMenuItemToTop : function( menuMarkup ) {
+ var $menuMarkup = $( menuMarkup );
+ $menuMarkup.hideAdvancedMenuItemFields().prependTo( api.targetList );
+ api.refreshKeyboardAccessibility();
+ api.refreshAdvancedAccessibility();
+ $( document ).trigger( 'menu-item-added', [ $menuMarkup ] );
+ },
+
+ attachUnsavedChangesListener : function() {
+ $('#menu-management input, #menu-management select, #menu-management, #menu-management textarea, .menu-location-menus select').change(function(){
+ api.registerChange();
+ });
+
+ if ( 0 !== $('#menu-to-edit').length || 0 !== $('.menu-location-menus select').length ) {
+ window.onbeforeunload = function(){
+ if ( api.menusChanged )
+ return navMenuL10n.saveAlert;
+ };
+ } else {
+ // Make the post boxes read-only, as they can't be used yet
+ $( '#menu-settings-column' ).find( 'input,select' ).end().find( 'a' ).attr( 'href', '#' ).unbind( 'click' );
+ }
+ },
+
+ registerChange : function() {
+ api.menusChanged = true;
+ },
+
+ attachTabsPanelListeners : function() {
+ $('#menu-settings-column').bind('click', function(e) {
+ var selectAreaMatch, panelId, wrapper, items,
+ target = $(e.target);
+
+ if ( target.hasClass('nav-tab-link') ) {
+
+ panelId = target.data( 'type' );
+
+ wrapper = target.parents('.accordion-section-content').first();
+
+ // upon changing tabs, we want to uncheck all checkboxes
+ $('input', wrapper).removeAttr('checked');
+
+ $('.tabs-panel-active', wrapper).removeClass('tabs-panel-active').addClass('tabs-panel-inactive');
+ $('#' + panelId, wrapper).removeClass('tabs-panel-inactive').addClass('tabs-panel-active');
+
+ $('.tabs', wrapper).removeClass('tabs');
+ target.parent().addClass('tabs');
+
+ // select the search bar
+ $('.quick-search', wrapper).focus();
+
+ // Hide controls in the search tab if no items found.
+ if ( ! wrapper.find( '.tabs-panel-active .menu-item-title' ).length ) {
+ wrapper.addClass( 'has-no-menu-item' );
+ } else {
+ wrapper.removeClass( 'has-no-menu-item' );
+ }
+
+ e.preventDefault();
+ } else if ( target.hasClass('select-all') ) {
+ selectAreaMatch = /#(.*)$/.exec(e.target.href);
+ if ( selectAreaMatch && selectAreaMatch[1] ) {
+ items = $('#' + selectAreaMatch[1] + ' .tabs-panel-active .menu-item-title input');
+ if( items.length === items.filter(':checked').length )
+ items.removeAttr('checked');
+ else
+ items.prop('checked', true);
+ return false;
+ }
+ } else if ( target.hasClass('submit-add-to-menu') ) {
+ api.registerChange();
+
+ if ( e.target.id && 'submit-customlinkdiv' == e.target.id )
+ api.addCustomLink( api.addMenuItemToBottom );
+ else if ( e.target.id && -1 != e.target.id.indexOf('submit-') )
+ $('#' + e.target.id.replace(/submit-/, '')).addSelectedToMenu( api.addMenuItemToBottom );
+ return false;
+ }
+ });
+
+ /*
+ * Delegate the `click` event and attach it just to the pagination
+ * links thus excluding the current page `<span>`. See ticket #35577.
+ */
+ $( '#nav-menu-meta' ).on( 'click', 'a.page-numbers', function() {
+ var $container = $( this ).closest( '.inside' );
+
+ $.post( ajaxurl, this.href.replace( /.*\?/, '' ).replace( /action=([^&]*)/, '' ) + '&action=menu-get-metabox',
+ function( resp ) {
+ var metaBoxData = $.parseJSON( resp ),
+ toReplace;
+
+ if ( -1 === resp.indexOf( 'replace-id' ) ) {
+ return;
+ }
+
+ // Get the post type menu meta box to update.
+ toReplace = document.getElementById( metaBoxData['replace-id'] );
+
+ if ( ! metaBoxData.markup || ! toReplace ) {
+ return;
+ }
+
+ // Update the post type menu meta box with new content from the response.
+ $container.html( metaBoxData.markup );
+ }
+ );
+
+ return false;
+ });
+ },
+
+ eventOnClickEditLink : function(clickedEl) {
+ var settings, item,
+ matchedSection = /#(.*)$/.exec(clickedEl.href);
+ if ( matchedSection && matchedSection[1] ) {
+ settings = $('#'+matchedSection[1]);
+ item = settings.parent();
+ if( 0 !== item.length ) {
+ if( item.hasClass('menu-item-edit-inactive') ) {
+ if( ! settings.data('menu-item-data') ) {
+ settings.data( 'menu-item-data', settings.getItemData() );
+ }
+ settings.slideDown('fast');
+ item.removeClass('menu-item-edit-inactive')
+ .addClass('menu-item-edit-active');
+ } else {
+ settings.slideUp('fast');
+ item.removeClass('menu-item-edit-active')
+ .addClass('menu-item-edit-inactive');
+ }
+ return false;
+ }
+ }
+ },
+
+ eventOnClickCancelLink : function(clickedEl) {
+ var settings = $( clickedEl ).closest( '.menu-item-settings' ),
+ thisMenuItem = $( clickedEl ).closest( '.menu-item' );
+ thisMenuItem.removeClass('menu-item-edit-active').addClass('menu-item-edit-inactive');
+ settings.setItemData( settings.data('menu-item-data') ).hide();
+ return false;
+ },
+
+ eventOnClickMenuSave : function() {
+ var locs = '',
+ menuName = $('#menu-name'),
+ menuNameVal = menuName.val();
+ // Cancel and warn if invalid menu name
+ if ( ! menuNameVal || ! menuNameVal.replace( /\s+/, '' ) ) {
+ menuName.parent().addClass( 'form-invalid' );
+ return false;
+ }
+ // Copy menu theme locations
+ $('#nav-menu-theme-locations select').each(function() {
+ locs += '<input type="hidden" name="' + this.name + '" value="' + $(this).val() + '" />';
+ });
+ $('#update-nav-menu').append( locs );
+ // Update menu item position data
+ api.menuList.find('.menu-item-data-position').val( function(index) { return index + 1; } );
+ window.onbeforeunload = null;
+
+ return true;
+ },
+
+ eventOnClickMenuDelete : function() {
+ // Delete warning AYS
+ if ( window.confirm( navMenuL10n.warnDeleteMenu ) ) {
+ window.onbeforeunload = null;
+ return true;
+ }
+ return false;
+ },
+
+ eventOnClickMenuItemDelete : function(clickedEl) {
+ var itemID = parseInt(clickedEl.id.replace('delete-', ''), 10);
+ api.removeMenuItem( $('#menu-item-' + itemID) );
+ api.registerChange();
+ return false;
+ },
+
+ /**
+ * Process the quick search response into a search result
+ *
+ * @param string resp The server response to the query.
+ * @param object req The request arguments.
+ * @param jQuery panel The tabs panel we're searching in.
+ */
+ processQuickSearchQueryResponse : function(resp, req, panel) {
+ var matched, newID,
+ takenIDs = {},
+ form = document.getElementById('nav-menu-meta'),
+ pattern = /menu-item[(\[^]\]*/,
+ $items = $('<div>').html(resp).find('li'),
+ wrapper = panel.closest( '.accordion-section-content' ),
+ $item;
+
+ if( ! $items.length ) {
+ $('.categorychecklist', panel).html( '<li><p>' + navMenuL10n.noResultsFound + '</p></li>' );
+ $( '.spinner', panel ).removeClass( 'is-active' );
+ wrapper.addClass( 'has-no-menu-item' );
+ return;
+ }
+
+ $items.each(function(){
+ $item = $(this);
+
+ // make a unique DB ID number
+ matched = pattern.exec($item.html());
+
+ if ( matched && matched[1] ) {
+ newID = matched[1];
+ while( form.elements['menu-item[' + newID + '][menu-item-type]'] || takenIDs[ newID ] ) {
+ newID--;
+ }
+
+ takenIDs[newID] = true;
+ if ( newID != matched[1] ) {
+ $item.html( $item.html().replace(new RegExp(
+ 'menu-item\\[' + matched[1] + '\\]', 'g'),
+ 'menu-item[' + newID + ']'
+ ) );
+ }
+ }
+ });
+
+ $('.categorychecklist', panel).html( $items );
+ $( '.spinner', panel ).removeClass( 'is-active' );
+ wrapper.removeClass( 'has-no-menu-item' );
+ },
+
+ /**
+ * Remove a menu item.
+ * @param {object} el The element to be removed as a jQuery object.
+ *
+ * @fires document#menu-removing-item Passes the element to be removed.
+ */
+ removeMenuItem : function(el) {
+ var children = el.childMenuItems();
+
+ $( document ).trigger( 'menu-removing-item', [ el ] );
+ el.addClass('deleting').animate({
+ opacity : 0,
+ height: 0
+ }, 350, function() {
+ var ins = $('#menu-instructions');
+ el.remove();
+ children.shiftDepthClass( -1 ).updateParentMenuItemDBId();
+ if ( 0 === $( '#menu-to-edit li' ).length ) {
+ $( '.drag-instructions' ).hide();
+ ins.removeClass( 'menu-instructions-inactive' );
+ }
+ api.refreshAdvancedAccessibility();
+ });
+ },
+
+ depthToPx : function(depth) {
+ return depth * api.options.menuItemDepthPerLevel;
+ },
+
+ pxToDepth : function(px) {
+ return Math.floor(px / api.options.menuItemDepthPerLevel);
+ }
+
+ };
+
+ $(document).ready(function(){ wpNavMenu.init(); });
+
+})(jQuery);
diff --git a/www/crm/wp-admin/js/nav-menu.min.js b/www/crm/wp-admin/js/nav-menu.min.js
new file mode 100644
index 00000000..b8e8f56a
--- /dev/null
+++ b/www/crm/wp-admin/js/nav-menu.min.js
@@ -0,0 +1 @@
+!function(a){var b;b=window.wpNavMenu={options:{menuItemDepthPerLevel:30,globalMaxDepth:11,sortableItems:"> *",targetTolerance:0},menuList:void 0,targetList:void 0,menusChanged:!1,isRTL:!("undefined"==typeof isRtl||!isRtl),negateIfRTL:"undefined"!=typeof isRtl&&isRtl?-1:1,lastSearch:"",init:function(){b.menuList=a("#menu-to-edit"),b.targetList=b.menuList,this.jQueryExtensions(),this.attachMenuEditListeners(),this.attachQuickSearchListeners(),this.attachThemeLocationsListeners(),this.attachMenuSaveSubmitListeners(),this.attachTabsPanelListeners(),this.attachUnsavedChangesListener(),b.menuList.length&&this.initSortables(),menus.oneThemeLocationNoMenus&&a("#posttype-page").addSelectedToMenu(b.addMenuItemToBottom),this.initManageLocations(),this.initAccessibility(),this.initToggles(),this.initPreviewing()},jQueryExtensions:function(){a.fn.extend({menuItemDepth:function(){var a=b.isRTL?this.eq(0).css("margin-right"):this.eq(0).css("margin-left");return b.pxToDepth(a&&-1!=a.indexOf("px")?a.slice(0,-2):0)},updateDepthClass:function(b,c){return this.each(function(){var d=a(this);c=c||d.menuItemDepth(),a(this).removeClass("menu-item-depth-"+c).addClass("menu-item-depth-"+b)})},shiftDepthClass:function(b){return this.each(function(){var c=a(this),d=c.menuItemDepth(),e=d+b;c.removeClass("menu-item-depth-"+d).addClass("menu-item-depth-"+e),0===e&&c.find(".is-submenu").hide()})},childMenuItems:function(){var b=a();return this.each(function(){for(var c=a(this),d=c.menuItemDepth(),e=c.next(".menu-item");e.length&&e.menuItemDepth()>d;)b=b.add(e),e=e.next(".menu-item")}),b},shiftHorizontally:function(b){return this.each(function(){var c=a(this),d=c.menuItemDepth(),e=d+b;c.moveHorizontally(e,d)})},moveHorizontally:function(b,c){return this.each(function(){var d=a(this),e=d.childMenuItems(),f=b-c,g=d.find(".is-submenu");d.updateDepthClass(b,c).updateParentMenuItemDBId(),e&&e.each(function(){var b=a(this),c=b.menuItemDepth(),d=c+f;b.updateDepthClass(d,c).updateParentMenuItemDBId()}),0===b?g.hide():g.show()})},updateParentMenuItemDBId:function(){return this.each(function(){var b=a(this),c=b.find(".menu-item-data-parent-id"),d=parseInt(b.menuItemDepth(),10),e=d-1,f=b.prevAll(".menu-item-depth-"+e).first();0===d?c.val(0):c.val(f.find(".menu-item-data-db-id").val())})},hideAdvancedMenuItemFields:function(){return this.each(function(){var b=a(this);a(".hide-column-tog").not(":checked").each(function(){b.find(".field-"+a(this).val()).addClass("hidden-field")})})},addSelectedToMenu:function(c){return 0!==a("#menu-to-edit").length&&this.each(function(){var d=a(this),e={},f=menus.oneThemeLocationNoMenus&&0===d.find(".tabs-panel-active .categorychecklist li input:checked").length?d.find('#page-all li input[type="checkbox"]'):d.find(".tabs-panel-active .categorychecklist li input:checked"),g=/menu-item\[([^\]]*)/;return c=c||b.addMenuItemToBottom,!!f.length&&(d.find(".button-controls .spinner").addClass("is-active"),a(f).each(function(){var d=a(this),f=g.exec(d.attr("name")),h="undefined"==typeof f[1]?0:parseInt(f[1],10);this.className&&-1!=this.className.indexOf("add-to-top")&&(c=b.addMenuItemToTop),e[h]=d.closest("li").getItemData("add-menu-item",h)}),void b.addItemToMenu(e,c,function(){f.removeAttr("checked"),d.find(".button-controls .spinner").removeClass("is-active")}))})},getItemData:function(a,b){a=a||"menu-item";var c,d={},e=["menu-item-db-id","menu-item-object-id","menu-item-object","menu-item-parent-id","menu-item-position","menu-item-type","menu-item-title","menu-item-url","menu-item-description","menu-item-attr-title","menu-item-target","menu-item-classes","menu-item-xfn"];return b||"menu-item"!=a||(b=this.find(".menu-item-data-db-id").val()),b?(this.find("input").each(function(){var f;for(c=e.length;c--;)"menu-item"==a?f=e[c]+"["+b+"]":"add-menu-item"==a&&(f="menu-item["+b+"]["+e[c]+"]"),this.name&&f==this.name&&(d[e[c]]=this.value)}),d):d},setItemData:function(b,c,d){return c=c||"menu-item",d||"menu-item"!=c||(d=a(".menu-item-data-db-id",this).val()),d?(this.find("input").each(function(){var e,f=a(this);a.each(b,function(a,b){"menu-item"==c?e=a+"["+d+"]":"add-menu-item"==c&&(e="menu-item["+d+"]["+a+"]"),e==f.attr("name")&&f.val(b)})}),this):this}})},countMenuItems:function(b){return a(".menu-item-depth-"+b).length},moveMenuItem:function(c,d){var e,f,g,h=a("#menu-to-edit li"),i=h.length,j=c.parents("li.menu-item"),k=j.childMenuItems(),l=j.getItemData(),m=parseInt(j.menuItemDepth(),10),n=parseInt(j.index(),10),o=j.next(),p=o.childMenuItems(),q=parseInt(o.menuItemDepth(),10)+1,r=j.prev(),s=parseInt(r.menuItemDepth(),10),t=r.getItemData()["menu-item-db-id"];switch(d){case"up":if(f=n-1,0===n)break;0===f&&0!==m&&j.moveHorizontally(0,m),0!==s&&j.moveHorizontally(s,m),k?(e=j.add(k),e.detach().insertBefore(h.eq(f)).updateParentMenuItemDBId()):j.detach().insertBefore(h.eq(f)).updateParentMenuItemDBId();break;case"down":if(k){if(e=j.add(k),o=h.eq(e.length+n),p=0!==o.childMenuItems().length,p&&(g=parseInt(o.menuItemDepth(),10)+1,j.moveHorizontally(g,m)),i===n+e.length)break;e.detach().insertAfter(h.eq(n+e.length)).updateParentMenuItemDBId()}else{if(0!==p.length&&j.moveHorizontally(q,m),i===n+1)break;j.detach().insertAfter(h.eq(n+1)).updateParentMenuItemDBId()}break;case"top":if(0===n)break;k?(e=j.add(k),e.detach().insertBefore(h.eq(0)).updateParentMenuItemDBId()):j.detach().insertBefore(h.eq(0)).updateParentMenuItemDBId();break;case"left":if(0===m)break;j.shiftHorizontally(-1);break;case"right":if(0===n)break;if(l["menu-item-parent-id"]===t)break;j.shiftHorizontally(1)}c.focus(),b.registerChange(),b.refreshKeyboardAccessibility(),b.refreshAdvancedAccessibility()},initAccessibility:function(){var c=a("#menu-to-edit");b.refreshKeyboardAccessibility(),b.refreshAdvancedAccessibility(),c.on("mouseenter.refreshAccessibility focus.refreshAccessibility touchstart.refreshAccessibility",".menu-item",function(){b.refreshAdvancedAccessibilityOfItem(a(this).find("a.item-edit"))}),c.on("click","a.item-edit",function(){b.refreshAdvancedAccessibilityOfItem(a(this))}),c.on("click",".menus-move",function(){var c=a(this),d=c.data("dir");"undefined"!=typeof d&&b.moveMenuItem(a(this).parents("li.menu-item").find("a.item-edit"),d)})},refreshAdvancedAccessibilityOfItem:function(b){if(!0===a(b).data("needs_accessibility_refresh")){var c,d,e,f,g,h,i,j,k,l=a(b),m=l.closest("li.menu-item").first(),n=m.menuItemDepth(),o=0===n,p=l.closest(".menu-item-handle").find(".menu-item-title").text(),q=parseInt(m.index(),10),r=o?n:parseInt(n-1,10),s=m.prevAll(".menu-item-depth-"+r).first().find(".menu-item-title").text(),t=m.prevAll(".menu-item-depth-"+n).first().find(".menu-item-title").text(),u=a("#menu-to-edit li").length,v=m.nextAll(".menu-item-depth-"+n).length;m.find(".field-move").toggle(u>1),0!==q&&(c=m.find(".menus-move-up"),c.attr("aria-label",menus.moveUp).css("display","inline")),0!==q&&o&&(c=m.find(".menus-move-top"),c.attr("aria-label",menus.moveToTop).css("display","inline")),q+1!==u&&0!==q&&(c=m.find(".menus-move-down"),c.attr("aria-label",menus.moveDown).css("display","inline")),0===q&&0!==v&&(c=m.find(".menus-move-down"),c.attr("aria-label",menus.moveDown).css("display","inline")),o||(c=m.find(".menus-move-left"),d=menus.outFrom.replace("%s",s),c.attr("aria-label",menus.moveOutFrom.replace("%s",s)).text(d).css("display","inline")),0!==q&&m.find(".menu-item-data-parent-id").val()!==m.prev().find(".menu-item-data-db-id").val()&&(c=m.find(".menus-move-right"),d=menus.under.replace("%s",t),c.attr("aria-label",menus.moveUnder.replace("%s",t)).text(d).css("display","inline")),o?(e=a(".menu-item-depth-0"),f=e.index(m)+1,u=e.length,g=menus.menuFocus.replace("%1$s",p).replace("%2$d",f).replace("%3$d",u)):(h=m.prevAll(".menu-item-depth-"+parseInt(n-1,10)).first(),i=h.find(".menu-item-data-db-id").val(),j=h.find(".menu-item-title").text(),k=a('.menu-item .menu-item-data-parent-id[value="'+i+'"]'),f=a(k.parents(".menu-item").get().reverse()).index(m)+1,g=menus.subMenuFocus.replace("%1$s",p).replace("%2$d",f).replace("%3$s",j)),l.attr("aria-label",g),l.data("needs_accessibility_refresh",!1)}},refreshAdvancedAccessibility:function(){a(".menu-item-settings .field-move .menus-move").hide(),a("a.item-edit").data("needs_accessibility_refresh",!0),a(".menu-item-edit-active a.item-edit").each(function(){b.refreshAdvancedAccessibilityOfItem(this)})},refreshKeyboardAccessibility:function(){a("a.item-edit").off("focus").on("focus",function(){a(this).off("keydown").on("keydown",function(c){var d,e=a(this),f=e.parents("li.menu-item"),g=f.getItemData();if((37==c.which||38==c.which||39==c.which||40==c.which)&&(e.off("keydown"),1!==a("#menu-to-edit li").length)){switch(d={38:"up",40:"down",37:"left",39:"right"},a("body").hasClass("rtl")&&(d={38:"up",40:"down",39:"left",37:"right"}),d[c.which]){case"up":b.moveMenuItem(e,"up");break;case"down":b.moveMenuItem(e,"down");break;case"left":b.moveMenuItem(e,"left");break;case"right":b.moveMenuItem(e,"right")}return a("#edit-"+g["menu-item-db-id"]).focus(),!1}})})},initPreviewing:function(){a("#menu-to-edit").on("change input",".edit-menu-item-title",function(b){var c,d,e=a(b.currentTarget);c=e.val(),d=e.closest(".menu-item").find(".menu-item-title"),c?d.text(c).removeClass("no-title"):d.text(navMenuL10n.untitled).addClass("no-title")})},initToggles:function(){postboxes.add_postbox_toggles("nav-menus"),columns.useCheckboxesForHidden(),columns.checked=function(b){a(".field-"+b).removeClass("hidden-field")},columns.unchecked=function(b){a(".field-"+b).addClass("hidden-field")},b.menuList.hideAdvancedMenuItemFields(),a(".hide-postbox-tog").click(function(){var b=a(".accordion-container li.accordion-section").filter(":hidden").map(function(){return this.id}).get().join(",");a.post(ajaxurl,{action:"closed-postboxes",hidden:b,closedpostboxesnonce:jQuery("#closedpostboxesnonce").val(),page:"nav-menus"})})},initSortables:function(){function c(a){var c;j=a.placeholder.prev(".menu-item"),k=a.placeholder.next(".menu-item"),j[0]==a.item[0]&&(j=j.prev(".menu-item")),k[0]==a.item[0]&&(k=k.next(".menu-item")),l=j.length?j.offset().top+j.height():0,m=k.length?k.offset().top+k.height()/3:0,h=k.length?k.menuItemDepth():0,i=j.length?(c=j.menuItemDepth()+1)>b.options.globalMaxDepth?b.options.globalMaxDepth:c:0}function d(a,b){a.placeholder.updateDepthClass(b,q),q=b}function e(){if(!s[0].className)return 0;var a=s[0].className.match(/menu-max-depth-(\d+)/);return a&&a[1]?parseInt(a[1],10):0}function f(c){var d,e=t;if(0!==c){if(c>0)d=p+c,d>t&&(e=d);else if(c<0&&p==t)for(;!a(".menu-item-depth-"+e,b.menuList).length&&e>0;)e--;s.removeClass("menu-max-depth-"+t).addClass("menu-max-depth-"+e),t=e}}var g,h,i,j,k,l,m,n,o,p,q=0,r=b.menuList.offset().left,s=a("body"),t=e();0!==a("#menu-to-edit li").length&&a(".drag-instructions").show(),r+=b.isRTL?b.menuList.width():0,b.menuList.sortable({handle:".menu-item-handle",placeholder:"sortable-placeholder",items:b.options.sortableItems,start:function(e,f){var h,i,j,k,l;b.isRTL&&(f.item[0].style.right="auto"),o=f.item.children(".menu-item-transport"),g=f.item.menuItemDepth(),d(f,g),j=f.item.next()[0]==f.placeholder[0]?f.item.next():f.item,k=j.childMenuItems(),o.append(k),h=o.outerHeight(),h+=h>0?1*f.placeholder.css("margin-top").slice(0,-2):0,h+=f.helper.outerHeight(),n=h,h-=2,f.placeholder.height(h),p=g,k.each(function(){var b=a(this).menuItemDepth();p=b>p?b:p}),i=f.helper.find(".menu-item-handle").outerWidth(),i+=b.depthToPx(p-g),i-=2,f.placeholder.width(i),l=f.placeholder.next(".menu-item"),l.css("margin-top",n+"px"),f.placeholder.detach(),a(this).sortable("refresh"),f.item.after(f.placeholder),l.css("margin-top",0),c(f)},stop:function(a,c){var d,e,h=q-g;d=o.children().insertAfter(c.item),e=c.item.find(".item-title .is-submenu"),0<q?e.show():e.hide(),0!==h&&(c.item.updateDepthClass(q),d.shiftDepthClass(h),f(h)),b.registerChange(),c.item.updateParentMenuItemDBId(),c.item[0].style.top=0,b.isRTL&&(c.item[0].style.left="auto",c.item[0].style.right=0),b.refreshKeyboardAccessibility(),b.refreshAdvancedAccessibility()},change:function(a,d){d.placeholder.parent().hasClass("menu")||(j.length?j.after(d.placeholder):b.menuList.prepend(d.placeholder)),c(d)},sort:function(e,f){var g=f.helper.offset(),j=b.isRTL?g.left+f.helper.width():g.left,o=b.negateIfRTL*b.pxToDepth(j-r);o>i||g.top<l-b.options.targetTolerance?o=i:o<h&&(o=h),o!=q&&d(f,o),m&&g.top+n>m&&(k.after(f.placeholder),c(f),a(this).sortable("refreshPositions"))}})},initManageLocations:function(){a("#menu-locations-wrap form").submit(function(){window.onbeforeunload=null}),a(".menu-location-menus select").on("change",function(){var b=a(this).closest("tr").find(".locations-edit-menu-link");a(this).find("option:selected").data("orig")?b.show():b.hide()})},attachMenuEditListeners:function(){var b=this;a("#update-nav-menu").bind("click",function(a){if(a.target&&a.target.className){if(-1!=a.target.className.indexOf("item-edit"))return b.eventOnClickEditLink(a.target);if(-1!=a.target.className.indexOf("menu-save"))return b.eventOnClickMenuSave(a.target);if(-1!=a.target.className.indexOf("menu-delete"))return b.eventOnClickMenuDelete(a.target);if(-1!=a.target.className.indexOf("item-delete"))return b.eventOnClickMenuItemDelete(a.target);if(-1!=a.target.className.indexOf("item-cancel"))return b.eventOnClickCancelLink(a.target)}}),a("#menu-name").on("input",_.debounce(function(){var b=a(document.getElementById("menu-name")),c=b.val();c&&c.replace(/\s+/,"")?b.parent().removeClass("form-invalid"):b.parent().addClass("form-invalid")},500)),a('#add-custom-links input[type="text"]').keypress(function(b){a("#customlinkdiv").removeClass("form-invalid"),13===b.keyCode&&(b.preventDefault(),a("#submit-customlinkdiv").click())})},attachMenuSaveSubmitListeners:function(){a("#update-nav-menu").submit(function(){var b=a("#update-nav-menu").serializeArray();a('[name="nav-menu-data"]').val(JSON.stringify(b))})},attachThemeLocationsListeners:function(){var b=a("#nav-menu-theme-locations"),c={};c.action="menu-locations-save",c["menu-settings-column-nonce"]=a("#menu-settings-column-nonce").val(),b.find('input[type="submit"]').click(function(){return b.find("select").each(function(){c[this.name]=a(this).val()}),b.find(".spinner").addClass("is-active"),a.post(ajaxurl,c,function(){b.find(".spinner").removeClass("is-active")}),!1})},attachQuickSearchListeners:function(){var c;a("#nav-menu-meta").on("submit",function(a){a.preventDefault()}),a("#nav-menu-meta").on("input",".quick-search",function(){var d=a(this);d.attr("autocomplete","off"),c&&clearTimeout(c),c=setTimeout(function(){b.updateQuickSearchResults(d)},500)}).on("blur",".quick-search",function(){b.lastSearch=""})},updateQuickSearchResults:function(c){var d,e,f=2,g=c.val();g.length<f||b.lastSearch==g||(b.lastSearch=g,d=c.parents(".tabs-panel"),e={action:"menu-quick-search","response-format":"markup",menu:a("#menu").val(),"menu-settings-column-nonce":a("#menu-settings-column-nonce").val(),q:g,type:c.attr("name")},a(".spinner",d).addClass("is-active"),a.post(ajaxurl,e,function(a){b.processQuickSearchQueryResponse(a,e,d)}))},addCustomLink:function(c){var d=a("#custom-menu-item-url").val().trim(),e=a("#custom-menu-item-name").val();return c=c||b.addMenuItemToBottom,""===d||"http://"==d?(a("#customlinkdiv").addClass("form-invalid"),!1):(a(".customlinkdiv .spinner").addClass("is-active"),void this.addLinkToMenu(d,e,c,function(){a(".customlinkdiv .spinner").removeClass("is-active"),a("#custom-menu-item-name").val("").blur(),a("#custom-menu-item-url").val("http://")}))},addLinkToMenu:function(a,c,d,e){d=d||b.addMenuItemToBottom,e=e||function(){},b.addItemToMenu({"-1":{"menu-item-type":"custom","menu-item-url":a,"menu-item-title":c}},d,e)},addItemToMenu:function(b,c,d){var e,f=a("#menu").val(),g=a("#menu-settings-column-nonce").val();c=c||function(){},d=d||function(){},e={action:"add-menu-item",menu:f,"menu-settings-column-nonce":g,"menu-item":b},a.post(ajaxurl,e,function(b){var f=a("#menu-instructions");b=a.trim(b),c(b,e),a("li.pending").hide().fadeIn("slow"),a(".drag-instructions").show(),!f.hasClass("menu-instructions-inactive")&&f.siblings().length&&f.addClass("menu-instructions-inactive"),d()})},addMenuItemToBottom:function(c){var d=a(c);d.hideAdvancedMenuItemFields().appendTo(b.targetList),b.refreshKeyboardAccessibility(),b.refreshAdvancedAccessibility(),a(document).trigger("menu-item-added",[d])},addMenuItemToTop:function(c){var d=a(c);d.hideAdvancedMenuItemFields().prependTo(b.targetList),b.refreshKeyboardAccessibility(),b.refreshAdvancedAccessibility(),a(document).trigger("menu-item-added",[d])},attachUnsavedChangesListener:function(){a("#menu-management input, #menu-management select, #menu-management, #menu-management textarea, .menu-location-menus select").change(function(){b.registerChange()}),0!==a("#menu-to-edit").length||0!==a(".menu-location-menus select").length?window.onbeforeunload=function(){if(b.menusChanged)return navMenuL10n.saveAlert}:a("#menu-settings-column").find("input,select").end().find("a").attr("href","#").unbind("click")},registerChange:function(){b.menusChanged=!0},attachTabsPanelListeners:function(){a("#menu-settings-column").bind("click",function(c){var d,e,f,g,h=a(c.target);if(h.hasClass("nav-tab-link"))e=h.data("type"),f=h.parents(".accordion-section-content").first(),a("input",f).removeAttr("checked"),a(".tabs-panel-active",f).removeClass("tabs-panel-active").addClass("tabs-panel-inactive"),a("#"+e,f).removeClass("tabs-panel-inactive").addClass("tabs-panel-active"),a(".tabs",f).removeClass("tabs"),h.parent().addClass("tabs"),a(".quick-search",f).focus(),f.find(".tabs-panel-active .menu-item-title").length?f.removeClass("has-no-menu-item"):f.addClass("has-no-menu-item"),c.preventDefault();else if(h.hasClass("select-all")){if(d=/#(.*)$/.exec(c.target.href),d&&d[1])return g=a("#"+d[1]+" .tabs-panel-active .menu-item-title input"),g.length===g.filter(":checked").length?g.removeAttr("checked"):g.prop("checked",!0),!1}else if(h.hasClass("submit-add-to-menu"))return b.registerChange(),c.target.id&&"submit-customlinkdiv"==c.target.id?b.addCustomLink(b.addMenuItemToBottom):c.target.id&&-1!=c.target.id.indexOf("submit-")&&a("#"+c.target.id.replace(/submit-/,"")).addSelectedToMenu(b.addMenuItemToBottom),!1}),a("#nav-menu-meta").on("click","a.page-numbers",function(){var b=a(this).closest(".inside");return a.post(ajaxurl,this.href.replace(/.*\?/,"").replace(/action=([^&]*)/,"")+"&action=menu-get-metabox",function(c){var d,e=a.parseJSON(c);-1!==c.indexOf("replace-id")&&(d=document.getElementById(e["replace-id"]),e.markup&&d&&b.html(e.markup))}),!1})},eventOnClickEditLink:function(b){var c,d,e=/#(.*)$/.exec(b.href);if(e&&e[1]&&(c=a("#"+e[1]),d=c.parent(),0!==d.length))return d.hasClass("menu-item-edit-inactive")?(c.data("menu-item-data")||c.data("menu-item-data",c.getItemData()),c.slideDown("fast"),d.removeClass("menu-item-edit-inactive").addClass("menu-item-edit-active")):(c.slideUp("fast"),d.removeClass("menu-item-edit-active").addClass("menu-item-edit-inactive")),!1},eventOnClickCancelLink:function(b){var c=a(b).closest(".menu-item-settings"),d=a(b).closest(".menu-item");return d.removeClass("menu-item-edit-active").addClass("menu-item-edit-inactive"),c.setItemData(c.data("menu-item-data")).hide(),!1},eventOnClickMenuSave:function(){var c="",d=a("#menu-name"),e=d.val();return e&&e.replace(/\s+/,"")?(a("#nav-menu-theme-locations select").each(function(){c+='<input type="hidden" name="'+this.name+'" value="'+a(this).val()+'" />'}),a("#update-nav-menu").append(c),b.menuList.find(".menu-item-data-position").val(function(a){return a+1}),window.onbeforeunload=null,!0):(d.parent().addClass("form-invalid"),!1)},eventOnClickMenuDelete:function(){return!!window.confirm(navMenuL10n.warnDeleteMenu)&&(window.onbeforeunload=null,!0)},eventOnClickMenuItemDelete:function(c){var d=parseInt(c.id.replace("delete-",""),10);return b.removeMenuItem(a("#menu-item-"+d)),b.registerChange(),!1},processQuickSearchQueryResponse:function(b,c,d){var e,f,g,h={},i=document.getElementById("nav-menu-meta"),j=/menu-item[(\[^]\]*/,k=a("<div>").html(b).find("li"),l=d.closest(".accordion-section-content");return k.length?(k.each(function(){if(g=a(this),e=j.exec(g.html()),e&&e[1]){for(f=e[1];i.elements["menu-item["+f+"][menu-item-type]"]||h[f];)f--;h[f]=!0,f!=e[1]&&g.html(g.html().replace(new RegExp("menu-item\\["+e[1]+"\\]","g"),"menu-item["+f+"]"))}}),a(".categorychecklist",d).html(k),a(".spinner",d).removeClass("is-active"),void l.removeClass("has-no-menu-item")):(a(".categorychecklist",d).html("<li><p>"+navMenuL10n.noResultsFound+"</p></li>"),a(".spinner",d).removeClass("is-active"),void l.addClass("has-no-menu-item"))},removeMenuItem:function(c){var d=c.childMenuItems();a(document).trigger("menu-removing-item",[c]),c.addClass("deleting").animate({opacity:0,height:0},350,function(){var e=a("#menu-instructions");c.remove(),d.shiftDepthClass(-1).updateParentMenuItemDBId(),0===a("#menu-to-edit li").length&&(a(".drag-instructions").hide(),e.removeClass("menu-instructions-inactive")),b.refreshAdvancedAccessibility()})},depthToPx:function(a){return a*b.options.menuItemDepthPerLevel},pxToDepth:function(a){return Math.floor(a/b.options.menuItemDepthPerLevel)}},a(document).ready(function(){wpNavMenu.init()})}(jQuery); \ No newline at end of file
diff --git a/www/crm/wp-admin/js/password-strength-meter.js b/www/crm/wp-admin/js/password-strength-meter.js
new file mode 100644
index 00000000..753f697c
--- /dev/null
+++ b/www/crm/wp-admin/js/password-strength-meter.js
@@ -0,0 +1,121 @@
+/**
+ * @output wp-admin/js/password-strength-meter.js
+ */
+
+/* global zxcvbn */
+window.wp = window.wp || {};
+
+(function($){
+
+ /**
+ * Contains functions to determine the password strength.
+ *
+ * @since 3.7.0
+ *
+ * @namespace
+ */
+ wp.passwordStrength = {
+ /**
+ * Determines the strength of a given password.
+ *
+ * Compares first password to the password confirmation.
+ *
+ * @since 3.7.0
+ *
+ * @param {string} password1 The subject password.
+ * @param {Array} blacklist An array of words that will lower the entropy of
+ * the password.
+ * @param {string} password2 The password confirmation.
+ *
+ * @returns {number} The password strength score.
+ */
+ meter : function( password1, blacklist, password2 ) {
+ if ( ! $.isArray( blacklist ) )
+ blacklist = [ blacklist.toString() ];
+
+ if (password1 != password2 && password2 && password2.length > 0)
+ return 5;
+
+ if ( 'undefined' === typeof window.zxcvbn ) {
+ // Password strength unknown.
+ return -1;
+ }
+
+ var result = zxcvbn( password1, blacklist );
+ return result.score;
+ },
+
+ /**
+ * Builds an array of words that should be penalized.
+ *
+ * Certain words need to be penalized because it would lower the entropy of a
+ * password if they were used. The blacklist is based on user input fields such
+ * as username, first name, email etc.
+ *
+ * @since 3.7.0
+ *
+ * @returns {string[]} The array of words to be blacklisted.
+ */
+ userInputBlacklist : function() {
+ var i, userInputFieldsLength, rawValuesLength, currentField,
+ rawValues = [],
+ blacklist = [],
+ userInputFields = [ 'user_login', 'first_name', 'last_name', 'nickname', 'display_name', 'email', 'url', 'description', 'weblog_title', 'admin_email' ];
+
+ // Collect all the strings we want to blacklist.
+ rawValues.push( document.title );
+ rawValues.push( document.URL );
+
+ userInputFieldsLength = userInputFields.length;
+ for ( i = 0; i < userInputFieldsLength; i++ ) {
+ currentField = $( '#' + userInputFields[ i ] );
+
+ if ( 0 === currentField.length ) {
+ continue;
+ }
+
+ rawValues.push( currentField[0].defaultValue );
+ rawValues.push( currentField.val() );
+ }
+
+ /*
+ * Strip out non-alphanumeric characters and convert each word to an
+ * individual entry.
+ */
+ rawValuesLength = rawValues.length;
+ for ( i = 0; i < rawValuesLength; i++ ) {
+ if ( rawValues[ i ] ) {
+ blacklist = blacklist.concat( rawValues[ i ].replace( /\W/g, ' ' ).split( ' ' ) );
+ }
+ }
+
+ /*
+ * Remove empty values, short words and duplicates. Short words are likely to
+ * cause many false positives.
+ */
+ blacklist = $.grep( blacklist, function( value, key ) {
+ if ( '' === value || 4 > value.length ) {
+ return false;
+ }
+
+ return $.inArray( value, blacklist ) === key;
+ });
+
+ return blacklist;
+ }
+ };
+
+ // Backward compatibility.
+
+ /**
+ * Password strength meter function.
+ *
+ * @since 2.5.0
+ * @deprecated 3.7.0 Use wp.passwordStrength.meter instead.
+ *
+ * @global
+ *
+ * @type {wp.passwordStrength.meter}
+ */
+ window.passwordStrength = wp.passwordStrength.meter;
+})(jQuery);
diff --git a/www/crm/wp-admin/js/password-strength-meter.min.js b/www/crm/wp-admin/js/password-strength-meter.min.js
new file mode 100644
index 00000000..95f2d07d
--- /dev/null
+++ b/www/crm/wp-admin/js/password-strength-meter.min.js
@@ -0,0 +1 @@
+window.wp=window.wp||{},function(a){wp.passwordStrength={meter:function(b,c,d){if(a.isArray(c)||(c=[c.toString()]),b!=d&&d&&d.length>0)return 5;if("undefined"==typeof window.zxcvbn)return-1;var e=zxcvbn(b,c);return e.score},userInputBlacklist:function(){var b,c,d,e,f=[],g=[],h=["user_login","first_name","last_name","nickname","display_name","email","url","description","weblog_title","admin_email"];for(f.push(document.title),f.push(document.URL),c=h.length,b=0;b<c;b++)e=a("#"+h[b]),0!==e.length&&(f.push(e[0].defaultValue),f.push(e.val()));for(d=f.length,b=0;b<d;b++)f[b]&&(g=g.concat(f[b].replace(/\W/g," ").split(" ")));return g=a.grep(g,function(b,c){return!(""===b||4>b.length)&&a.inArray(b,g)===c})}},window.passwordStrength=wp.passwordStrength.meter}(jQuery); \ No newline at end of file
diff --git a/www/crm/wp-admin/js/plugin-install.js b/www/crm/wp-admin/js/plugin-install.js
new file mode 100644
index 00000000..b6cd1d74
--- /dev/null
+++ b/www/crm/wp-admin/js/plugin-install.js
@@ -0,0 +1,222 @@
+/**
+ * @file Functionality for the plugin install screens.
+ *
+ * @output wp-admin/js/plugin-install.js
+ */
+
+/* global plugininstallL10n, tb_click, tb_remove, tb_position */
+
+jQuery( document ).ready( function( $ ) {
+
+ var tbWindow,
+ $iframeBody,
+ $tabbables,
+ $firstTabbable,
+ $lastTabbable,
+ $focusedBefore = $(),
+ $uploadViewToggle = $( '.upload-view-toggle' ),
+ $wrap = $ ( '.wrap' ),
+ $body = $( document.body );
+
+ window.tb_position = function() {
+ var width = $( window ).width(),
+ H = $( window ).height() - ( ( 792 < width ) ? 60 : 20 ),
+ W = ( 792 < width ) ? 772 : width - 20;
+
+ tbWindow = $( '#TB_window' );
+
+ if ( tbWindow.length ) {
+ tbWindow.width( W ).height( H );
+ $( '#TB_iframeContent' ).width( W ).height( H );
+ tbWindow.css({
+ 'margin-left': '-' + parseInt( ( W / 2 ), 10 ) + 'px'
+ });
+ if ( typeof document.body.style.maxWidth !== 'undefined' ) {
+ tbWindow.css({
+ 'top': '30px',
+ 'margin-top': '0'
+ });
+ }
+ }
+
+ return $( 'a.thickbox' ).each( function() {
+ var href = $( this ).attr( 'href' );
+ if ( ! href ) {
+ return;
+ }
+ href = href.replace( /&width=[0-9]+/g, '' );
+ href = href.replace( /&height=[0-9]+/g, '' );
+ $(this).attr( 'href', href + '&width=' + W + '&height=' + ( H ) );
+ });
+ };
+
+ $( window ).resize( function() {
+ tb_position();
+ });
+
+ /*
+ * Custom events: when a Thickbox iframe has loaded and when the Thickbox
+ * modal gets removed from the DOM.
+ */
+ $body
+ .on( 'thickbox:iframe:loaded', tbWindow, function() {
+ /*
+ * Return if it's not the modal with the plugin details iframe. Other
+ * thickbox instances might want to load an iframe with content from
+ * an external domain. Avoid to access the iframe contents when we're
+ * not sure the iframe loads from the same domain.
+ */
+ if ( ! tbWindow.hasClass( 'plugin-details-modal' ) ) {
+ return;
+ }
+
+ iframeLoaded();
+ })
+ .on( 'thickbox:removed', function() {
+ // Set focus back to the element that opened the modal dialog.
+ // Note: IE 8 would need this wrapped in a fake setTimeout `0`.
+ $focusedBefore.focus();
+ });
+
+ function iframeLoaded() {
+ var $iframe = tbWindow.find( '#TB_iframeContent' );
+
+ // Get the iframe body.
+ $iframeBody = $iframe.contents().find( 'body' );
+
+ // Get the tabbable elements and handle the keydown event on first load.
+ handleTabbables();
+
+ // Set initial focus on the "Close" button.
+ $firstTabbable.focus();
+
+ /*
+ * When the "Install" button is disabled (e.g. the Plugin is already installed)
+ * then we can't predict where the last focusable element is. We need to get
+ * the tabbable elements and handle the keydown event again and again,
+ * each time the active tab panel changes.
+ */
+ $( '#plugin-information-tabs a', $iframeBody ).on( 'click', function() {
+ handleTabbables();
+ });
+
+ // Close the modal when pressing Escape.
+ $iframeBody.on( 'keydown', function( event ) {
+ if ( 27 !== event.which ) {
+ return;
+ }
+ tb_remove();
+ });
+ }
+
+ /*
+ * Get the tabbable elements and detach/attach the keydown event.
+ * Called after the iframe has fully loaded so we have all the elements we need.
+ * Called again each time a Tab gets clicked.
+ * @todo Consider to implement a WordPress general utility for this and don't use jQuery UI.
+ */
+ function handleTabbables() {
+ var $firstAndLast;
+ // Get all the tabbable elements.
+ $tabbables = $( ':tabbable', $iframeBody );
+ // Our first tabbable element is always the "Close" button.
+ $firstTabbable = tbWindow.find( '#TB_closeWindowButton' );
+ // Get the last tabbable element.
+ $lastTabbable = $tabbables.last();
+ // Make a jQuery collection.
+ $firstAndLast = $firstTabbable.add( $lastTabbable );
+ // Detach any previously attached keydown event.
+ $firstAndLast.off( 'keydown.wp-plugin-details' );
+ // Attach again the keydown event on the first and last focusable elements.
+ $firstAndLast.on( 'keydown.wp-plugin-details', function( event ) {
+ constrainTabbing( event );
+ });
+ }
+
+ // Constrain tabbing within the plugin modal dialog.
+ function constrainTabbing( event ) {
+ if ( 9 !== event.which ) {
+ return;
+ }
+
+ if ( $lastTabbable[0] === event.target && ! event.shiftKey ) {
+ event.preventDefault();
+ $firstTabbable.focus();
+ } else if ( $firstTabbable[0] === event.target && event.shiftKey ) {
+ event.preventDefault();
+ $lastTabbable.focus();
+ }
+ }
+
+ /*
+ * Open the Plugin details modal. The event is delegated to get also the links
+ * in the plugins search tab, after the AJAX search rebuilds the HTML. It's
+ * delegated on the closest ancestor and not on the body to avoid conflicts
+ * with other handlers, see Trac ticket #43082.
+ */
+ $( '.wrap' ).on( 'click', '.thickbox.open-plugin-details-modal', function( e ) {
+ // The `data-title` attribute is used only in the Plugin screens.
+ var title = $( this ).data( 'title' ) ? plugininstallL10n.plugin_information + ' ' + $( this ).data( 'title' ) : plugininstallL10n.plugin_modal_label;
+
+ e.preventDefault();
+ e.stopPropagation();
+
+ // Store the element that has focus before opening the modal dialog, i.e. the control which opens it.
+ $focusedBefore = $( this );
+
+ tb_click.call(this);
+
+ // Set ARIA role, ARIA label, and add a CSS class.
+ tbWindow
+ .attr({
+ 'role': 'dialog',
+ 'aria-label': plugininstallL10n.plugin_modal_label
+ })
+ .addClass( 'plugin-details-modal' );
+
+ // Set title attribute on the iframe.
+ tbWindow.find( '#TB_iframeContent' ).attr( 'title', title );
+ });
+
+ /* Plugin install related JS */
+ $( '#plugin-information-tabs a' ).click( function( event ) {
+ var tab = $( this ).attr( 'name' );
+ event.preventDefault();
+
+ // Flip the tab
+ $( '#plugin-information-tabs a.current' ).removeClass( 'current' );
+ $( this ).addClass( 'current' );
+
+ // Only show the fyi box in the description section, on smaller screen, where it's otherwise always displayed at the top.
+ if ( 'description' !== tab && $( window ).width() < 772 ) {
+ $( '#plugin-information-content' ).find( '.fyi' ).hide();
+ } else {
+ $( '#plugin-information-content' ).find( '.fyi' ).show();
+ }
+
+ // Flip the content.
+ $( '#section-holder div.section' ).hide(); // Hide 'em all.
+ $( '#section-' + tab ).show();
+ });
+
+ /*
+ * When a user presses the "Upload Plugin" button, show the upload form in place
+ * rather than sending them to the devoted upload plugin page.
+ * The `?tab=upload` page still exists for no-js support and for plugins that
+ * might access it directly. When we're in this page, let the link behave
+ * like a link. Otherwise we're in the normal plugin installer pages and the
+ * link should behave like a toggle button.
+ */
+ if ( ! $wrap.hasClass( 'plugin-install-tab-upload' ) ) {
+ $uploadViewToggle
+ .attr({
+ role: 'button',
+ 'aria-expanded': 'false'
+ })
+ .on( 'click', function( event ) {
+ event.preventDefault();
+ $body.toggleClass( 'show-upload-view' );
+ $uploadViewToggle.attr( 'aria-expanded', $body.hasClass( 'show-upload-view' ) );
+ });
+ }
+});
diff --git a/www/crm/wp-admin/js/plugin-install.min.js b/www/crm/wp-admin/js/plugin-install.min.js
new file mode 100644
index 00000000..c34a7c0e
--- /dev/null
+++ b/www/crm/wp-admin/js/plugin-install.min.js
@@ -0,0 +1 @@
+jQuery(document).ready(function(a){function b(){var b=e.find("#TB_iframeContent");f=b.contents().find("body"),c(),h.focus(),a("#plugin-information-tabs a",f).on("click",function(){c()}),f.on("keydown",function(a){27===a.which&&tb_remove()})}function c(){var b;g=a(":tabbable",f),h=e.find("#TB_closeWindowButton"),i=g.last(),b=h.add(i),b.off("keydown.wp-plugin-details"),b.on("keydown.wp-plugin-details",function(a){d(a)})}function d(a){9===a.which&&(i[0]!==a.target||a.shiftKey?h[0]===a.target&&a.shiftKey&&(a.preventDefault(),i.focus()):(a.preventDefault(),h.focus()))}var e,f,g,h,i,j=a(),k=a(".upload-view-toggle"),l=a(".wrap"),m=a(document.body);window.tb_position=function(){var b=a(window).width(),c=a(window).height()-(792<b?60:20),d=792<b?772:b-20;return e=a("#TB_window"),e.length&&(e.width(d).height(c),a("#TB_iframeContent").width(d).height(c),e.css({"margin-left":"-"+parseInt(d/2,10)+"px"}),"undefined"!=typeof document.body.style.maxWidth&&e.css({top:"30px","margin-top":"0"})),a("a.thickbox").each(function(){var b=a(this).attr("href");b&&(b=b.replace(/&width=[0-9]+/g,""),b=b.replace(/&height=[0-9]+/g,""),a(this).attr("href",b+"&width="+d+"&height="+c))})},a(window).resize(function(){tb_position()}),m.on("thickbox:iframe:loaded",e,function(){e.hasClass("plugin-details-modal")&&b()}).on("thickbox:removed",function(){j.focus()}),a(".wrap").on("click",".thickbox.open-plugin-details-modal",function(b){var c=a(this).data("title")?plugininstallL10n.plugin_information+" "+a(this).data("title"):plugininstallL10n.plugin_modal_label;b.preventDefault(),b.stopPropagation(),j=a(this),tb_click.call(this),e.attr({role:"dialog","aria-label":plugininstallL10n.plugin_modal_label}).addClass("plugin-details-modal"),e.find("#TB_iframeContent").attr("title",c)}),a("#plugin-information-tabs a").click(function(b){var c=a(this).attr("name");b.preventDefault(),a("#plugin-information-tabs a.current").removeClass("current"),a(this).addClass("current"),"description"!==c&&a(window).width()<772?a("#plugin-information-content").find(".fyi").hide():a("#plugin-information-content").find(".fyi").show(),a("#section-holder div.section").hide(),a("#section-"+c).show()}),l.hasClass("plugin-install-tab-upload")||k.attr({role:"button","aria-expanded":"false"}).on("click",function(a){a.preventDefault(),m.toggleClass("show-upload-view"),k.attr("aria-expanded",m.hasClass("show-upload-view"))})}); \ No newline at end of file
diff --git a/www/crm/wp-admin/js/post.js b/www/crm/wp-admin/js/post.js
new file mode 100644
index 00000000..ec1a0d71
--- /dev/null
+++ b/www/crm/wp-admin/js/post.js
@@ -0,0 +1,1273 @@
+/**
+ * @file Contains all dynamic functionality needed on post and term pages.
+ *
+ * @output wp-admin/js/post.js
+ */
+
+ /* global postL10n, ajaxurl, wpAjax, setPostThumbnailL10n, postboxes, pagenow, tinymce, alert, deleteUserSetting */
+ /* global theList:true, theExtraList:true, getUserSetting, setUserSetting, commentReply, commentsBox */
+ /* global WPSetThumbnailHTML, wptitlehint */
+
+// Backwards compatibility: prevent fatal errors.
+window.makeSlugeditClickable = window.editPermalink = function(){};
+
+// Make sure the wp object exists.
+window.wp = window.wp || {};
+
+( function( $ ) {
+ var titleHasFocus = false;
+
+ /**
+ * Control loading of comments on the post and term edit pages.
+ *
+ * @type {{st: number, get: commentsBox.get, load: commentsBox.load}}
+ *
+ * @namespace commentsBox
+ */
+ window.commentsBox = {
+ // Comment offset to use when fetching new comments.
+ st : 0,
+
+ /**
+ * Fetch comments using AJAX and display them in the box.
+ *
+ * @memberof commentsBox
+ *
+ * @param {int} total Total number of comments for this post.
+ * @param {int} num Optional. Number of comments to fetch, defaults to 20.
+ * @returns {boolean} Always returns false.
+ */
+ get : function(total, num) {
+ var st = this.st, data;
+ if ( ! num )
+ num = 20;
+
+ this.st += num;
+ this.total = total;
+ $( '#commentsdiv .spinner' ).addClass( 'is-active' );
+
+ data = {
+ 'action' : 'get-comments',
+ 'mode' : 'single',
+ '_ajax_nonce' : $('#add_comment_nonce').val(),
+ 'p' : $('#post_ID').val(),
+ 'start' : st,
+ 'number' : num
+ };
+
+ $.post(
+ ajaxurl,
+ data,
+ function(r) {
+ r = wpAjax.parseAjaxResponse(r);
+ $('#commentsdiv .widefat').show();
+ $( '#commentsdiv .spinner' ).removeClass( 'is-active' );
+
+ if ( 'object' == typeof r && r.responses[0] ) {
+ $('#the-comment-list').append( r.responses[0].data );
+
+ theList = theExtraList = null;
+ $( 'a[className*=\':\']' ).unbind();
+
+ // If the offset is over the total number of comments we cannot fetch any more, so hide the button.
+ if ( commentsBox.st > commentsBox.total )
+ $('#show-comments').hide();
+ else
+ $('#show-comments').show().children('a').html(postL10n.showcomm);
+
+ return;
+ } else if ( 1 == r ) {
+ $('#show-comments').html(postL10n.endcomm);
+ return;
+ }
+
+ $('#the-comment-list').append('<tr><td colspan="2">'+wpAjax.broken+'</td></tr>');
+ }
+ );
+
+ return false;
+ },
+
+ /**
+ * Load the next batch of comments.
+ *
+ * @param {int} total Total number of comments to load.
+ *
+ * @memberof commentsBox
+ */
+ load: function(total){
+ this.st = jQuery('#the-comment-list tr.comment:visible').length;
+ this.get(total);
+ }
+ };
+
+ /**
+ * Overwrite the content of the Featured Image postbox
+ *
+ * @param {string} html New HTML to be displayed in the content area of the postbox.
+ *
+ * @global
+ */
+ window.WPSetThumbnailHTML = function(html){
+ $('.inside', '#postimagediv').html(html);
+ };
+
+ /**
+ * Set the Image ID of the Featured Image
+ *
+ * @param {int} id The post_id of the image to use as Featured Image.
+ *
+ * @global
+ */
+ window.WPSetThumbnailID = function(id){
+ var field = $('input[value="_thumbnail_id"]', '#list-table');
+ if ( field.length > 0 ) {
+ $('#meta\\[' + field.attr('id').match(/[0-9]+/) + '\\]\\[value\\]').text(id);
+ }
+ };
+
+ /**
+ * Remove the Featured Image
+ *
+ * @param {string} nonce Nonce to use in the request.
+ *
+ * @global
+ */
+ window.WPRemoveThumbnail = function(nonce){
+ $.post(ajaxurl, {
+ action: 'set-post-thumbnail', post_id: $( '#post_ID' ).val(), thumbnail_id: -1, _ajax_nonce: nonce, cookie: encodeURIComponent( document.cookie )
+ },
+ /**
+ * Handle server response
+ *
+ * @param {string} str Response, will be '0' when an error occurred otherwise contains link to add Featured Image.
+ */
+ function(str){
+ if ( str == '0' ) {
+ alert( setPostThumbnailL10n.error );
+ } else {
+ WPSetThumbnailHTML(str);
+ }
+ }
+ );
+ };
+
+ /**
+ * Heartbeat locks.
+ *
+ * Used to lock editing of an object by only one user at a time.
+ *
+ * When the user does not send a heartbeat in a heartbeat-time
+ * the user is no longer editing and another user can start editing.
+ */
+ $(document).on( 'heartbeat-send.refresh-lock', function( e, data ) {
+ var lock = $('#active_post_lock').val(),
+ post_id = $('#post_ID').val(),
+ send = {};
+
+ if ( ! post_id || ! $('#post-lock-dialog').length )
+ return;
+
+ send.post_id = post_id;
+
+ if ( lock )
+ send.lock = lock;
+
+ data['wp-refresh-post-lock'] = send;
+
+ }).on( 'heartbeat-tick.refresh-lock', function( e, data ) {
+ // Post locks: update the lock string or show the dialog if somebody has taken over editing.
+ var received, wrap, avatar;
+
+ if ( data['wp-refresh-post-lock'] ) {
+ received = data['wp-refresh-post-lock'];
+
+ if ( received.lock_error ) {
+ // Show "editing taken over" message.
+ wrap = $('#post-lock-dialog');
+
+ if ( wrap.length && ! wrap.is(':visible') ) {
+ if ( wp.autosave ) {
+ // Save the latest changes and disable.
+ $(document).one( 'heartbeat-tick', function() {
+ wp.autosave.server.suspend();
+ wrap.removeClass('saving').addClass('saved');
+ $(window).off( 'beforeunload.edit-post' );
+ });
+
+ wrap.addClass('saving');
+ wp.autosave.server.triggerSave();
+ }
+
+ if ( received.lock_error.avatar_src ) {
+ avatar = $( '<img class="avatar avatar-64 photo" width="64" height="64" alt="" />' ).attr( 'src', received.lock_error.avatar_src.replace( /&amp;/g, '&' ) );
+ wrap.find('div.post-locked-avatar').empty().append( avatar );
+ }
+
+ wrap.show().find('.currently-editing').text( received.lock_error.text );
+ wrap.find('.wp-tab-first').focus();
+ }
+ } else if ( received.new_lock ) {
+ $('#active_post_lock').val( received.new_lock );
+ }
+ }
+ }).on( 'before-autosave.update-post-slug', function() {
+ titleHasFocus = document.activeElement && document.activeElement.id === 'title';
+ }).on( 'after-autosave.update-post-slug', function() {
+
+ /*
+ * Create slug area only if not already there
+ * and the title field was not focused (user was not typing a title) when autosave ran.
+ */
+ if ( ! $('#edit-slug-box > *').length && ! titleHasFocus ) {
+ $.post( ajaxurl, {
+ action: 'sample-permalink',
+ post_id: $('#post_ID').val(),
+ new_title: $('#title').val(),
+ samplepermalinknonce: $('#samplepermalinknonce').val()
+ },
+ function( data ) {
+ if ( data != '-1' ) {
+ $('#edit-slug-box').html(data);
+ }
+ }
+ );
+ }
+ });
+
+}(jQuery));
+
+/**
+ * Heartbeat refresh nonces.
+ */
+(function($) {
+ var check, timeout;
+
+ /**
+ * Only allow to check for nonce refresh every 30 seconds.
+ */
+ function schedule() {
+ check = false;
+ window.clearTimeout( timeout );
+ timeout = window.setTimeout( function(){ check = true; }, 300000 );
+ }
+
+ $(document).on( 'heartbeat-send.wp-refresh-nonces', function( e, data ) {
+ var post_id,
+ $authCheck = $('#wp-auth-check-wrap');
+
+ if ( check || ( $authCheck.length && ! $authCheck.hasClass( 'hidden' ) ) ) {
+ if ( ( post_id = $('#post_ID').val() ) && $('#_wpnonce').val() ) {
+ data['wp-refresh-post-nonces'] = {
+ post_id: post_id
+ };
+ }
+ }
+ }).on( 'heartbeat-tick.wp-refresh-nonces', function( e, data ) {
+ var nonces = data['wp-refresh-post-nonces'];
+
+ if ( nonces ) {
+ schedule();
+
+ if ( nonces.replace ) {
+ $.each( nonces.replace, function( selector, value ) {
+ $( '#' + selector ).val( value );
+ });
+ }
+
+ if ( nonces.heartbeatNonce )
+ window.heartbeatSettings.nonce = nonces.heartbeatNonce;
+ }
+ }).ready( function() {
+ schedule();
+ });
+}(jQuery));
+
+/**
+ * All post and postbox controls and functionality.
+ */
+jQuery(document).ready( function($) {
+ var stamp, visibility, $submitButtons, updateVisibility, updateText,
+ sticky = '',
+ $textarea = $('#content'),
+ $document = $(document),
+ postId = $('#post_ID').val() || 0,
+ $submitpost = $('#submitpost'),
+ releaseLock = true,
+ $postVisibilitySelect = $('#post-visibility-select'),
+ $timestampdiv = $('#timestampdiv'),
+ $postStatusSelect = $('#post-status-select'),
+ isMac = window.navigator.platform ? window.navigator.platform.indexOf( 'Mac' ) !== -1 : false;
+
+ postboxes.add_postbox_toggles(pagenow);
+
+ /*
+ * Clear the window name. Otherwise if this is a former preview window where the user navigated to edit another post,
+ * and the first post is still being edited, clicking Preview there will use this window to show the preview.
+ */
+ window.name = '';
+
+ // Post locks: contain focus inside the dialog. If the dialog is shown, focus the first item.
+ $('#post-lock-dialog .notification-dialog').on( 'keydown', function(e) {
+ // Don't do anything when [tab] is pressed.
+ if ( e.which != 9 )
+ return;
+
+ var target = $(e.target);
+
+ // [shift] + [tab] on first tab cycles back to last tab.
+ if ( target.hasClass('wp-tab-first') && e.shiftKey ) {
+ $(this).find('.wp-tab-last').focus();
+ e.preventDefault();
+ // [tab] on last tab cycles back to first tab.
+ } else if ( target.hasClass('wp-tab-last') && ! e.shiftKey ) {
+ $(this).find('.wp-tab-first').focus();
+ e.preventDefault();
+ }
+ }).filter(':visible').find('.wp-tab-first').focus();
+
+ // Set the heartbeat interval to 15 sec. if post lock dialogs are enabled.
+ if ( wp.heartbeat && $('#post-lock-dialog').length ) {
+ wp.heartbeat.interval( 15 );
+ }
+
+ // The form is being submitted by the user.
+ $submitButtons = $submitpost.find( ':submit, a.submitdelete, #post-preview' ).on( 'click.edit-post', function( event ) {
+ var $button = $(this);
+
+ if ( $button.hasClass('disabled') ) {
+ event.preventDefault();
+ return;
+ }
+
+ if ( $button.hasClass('submitdelete') || $button.is( '#post-preview' ) ) {
+ return;
+ }
+
+ // The form submission can be blocked from JS or by using HTML 5.0 validation on some fields.
+ // Run this only on an actual 'submit'.
+ $('form#post').off( 'submit.edit-post' ).on( 'submit.edit-post', function( event ) {
+ if ( event.isDefaultPrevented() ) {
+ return;
+ }
+
+ // Stop auto save.
+ if ( wp.autosave ) {
+ wp.autosave.server.suspend();
+ }
+
+ if ( typeof commentReply !== 'undefined' ) {
+ /*
+ * Warn the user they have an unsaved comment before submitting
+ * the post data for update.
+ */
+ if ( ! commentReply.discardCommentChanges() ) {
+ return false;
+ }
+
+ /*
+ * Close the comment edit/reply form if open to stop the form
+ * action from interfering with the post's form action.
+ */
+ commentReply.close();
+ }
+
+ releaseLock = false;
+ $(window).off( 'beforeunload.edit-post' );
+
+ $submitButtons.addClass( 'disabled' );
+
+ if ( $button.attr('id') === 'publish' ) {
+ $submitpost.find( '#major-publishing-actions .spinner' ).addClass( 'is-active' );
+ } else {
+ $submitpost.find( '#minor-publishing .spinner' ).addClass( 'is-active' );
+ }
+ });
+ });
+
+ // Submit the form saving a draft or an autosave, and show a preview in a new tab
+ $('#post-preview').on( 'click.post-preview', function( event ) {
+ var $this = $(this),
+ $form = $('form#post'),
+ $previewField = $('input#wp-preview'),
+ target = $this.attr('target') || 'wp-preview',
+ ua = navigator.userAgent.toLowerCase();
+
+ event.preventDefault();
+
+ if ( $this.hasClass('disabled') ) {
+ return;
+ }
+
+ if ( wp.autosave ) {
+ wp.autosave.server.tempBlockSave();
+ }
+
+ $previewField.val('dopreview');
+ $form.attr( 'target', target ).submit().attr( 'target', '' );
+
+ // Workaround for WebKit bug preventing a form submitting twice to the same action.
+ // https://bugs.webkit.org/show_bug.cgi?id=28633
+ if ( ua.indexOf('safari') !== -1 && ua.indexOf('chrome') === -1 ) {
+ $form.attr( 'action', function( index, value ) {
+ return value + '?t=' + ( new Date() ).getTime();
+ });
+ }
+
+ $previewField.val('');
+ });
+
+ // This code is meant to allow tabbing from Title to Post content.
+ $('#title').on( 'keydown.editor-focus', function( event ) {
+ var editor;
+
+ if ( event.keyCode === 9 && ! event.ctrlKey && ! event.altKey && ! event.shiftKey ) {
+ editor = typeof tinymce != 'undefined' && tinymce.get('content');
+
+ if ( editor && ! editor.isHidden() ) {
+ editor.focus();
+ } else if ( $textarea.length ) {
+ $textarea.focus();
+ } else {
+ return;
+ }
+
+ event.preventDefault();
+ }
+ });
+
+ // Auto save new posts after a title is typed.
+ if ( $( '#auto_draft' ).val() ) {
+ $( '#title' ).blur( function() {
+ var cancel;
+
+ if ( ! this.value || $('#edit-slug-box > *').length ) {
+ return;
+ }
+
+ // Cancel the auto save when the blur was triggered by the user submitting the form.
+ $('form#post').one( 'submit', function() {
+ cancel = true;
+ });
+
+ window.setTimeout( function() {
+ if ( ! cancel && wp.autosave ) {
+ wp.autosave.server.triggerSave();
+ }
+ }, 200 );
+ });
+ }
+
+ $document.on( 'autosave-disable-buttons.edit-post', function() {
+ $submitButtons.addClass( 'disabled' );
+ }).on( 'autosave-enable-buttons.edit-post', function() {
+ if ( ! wp.heartbeat || ! wp.heartbeat.hasConnectionError() ) {
+ $submitButtons.removeClass( 'disabled' );
+ }
+ }).on( 'before-autosave.edit-post', function() {
+ $( '.autosave-message' ).text( postL10n.savingText );
+ }).on( 'after-autosave.edit-post', function( event, data ) {
+ $( '.autosave-message' ).text( data.message );
+
+ if ( $( document.body ).hasClass( 'post-new-php' ) ) {
+ $( '.submitbox .submitdelete' ).show();
+ }
+ });
+
+ /*
+ * When the user is trying to load another page, or reloads current page
+ * show a confirmation dialog when there are unsaved changes.
+ */
+ $(window).on( 'beforeunload.edit-post', function() {
+ var editor = typeof tinymce !== 'undefined' && tinymce.get('content');
+
+ if ( ( editor && ! editor.isHidden() && editor.isDirty() ) ||
+ ( wp.autosave && wp.autosave.server.postChanged() ) ) {
+
+ return postL10n.saveAlert;
+ }
+ }).on( 'unload.edit-post', function( event ) {
+ if ( ! releaseLock ) {
+ return;
+ }
+
+ /*
+ * Unload is triggered (by hand) on removing the Thickbox iframe.
+ * Make sure we process only the main document unload.
+ */
+ if ( event.target && event.target.nodeName != '#document' ) {
+ return;
+ }
+
+ var postID = $('#post_ID').val();
+ var postLock = $('#active_post_lock').val();
+
+ if ( ! postID || ! postLock ) {
+ return;
+ }
+
+ var data = {
+ action: 'wp-remove-post-lock',
+ _wpnonce: $('#_wpnonce').val(),
+ post_ID: postID,
+ active_post_lock: postLock
+ };
+
+ if ( window.FormData && window.navigator.sendBeacon ) {
+ var formData = new window.FormData();
+
+ $.each( data, function( key, value ) {
+ formData.append( key, value );
+ });
+
+ if ( window.navigator.sendBeacon( ajaxurl, formData ) ) {
+ return;
+ }
+ }
+
+ // Fall back to a synchronous POST request.
+ // See https://developer.mozilla.org/en-US/docs/Web/API/Navigator/sendBeacon
+ $.post({
+ async: false,
+ data: data,
+ url: ajaxurl
+ });
+ });
+
+ // Multiple Taxonomies.
+ if ( $('#tagsdiv-post_tag').length ) {
+ window.tagBox && window.tagBox.init();
+ } else {
+ $('.meta-box-sortables').children('div.postbox').each(function(){
+ if ( this.id.indexOf('tagsdiv-') === 0 ) {
+ window.tagBox && window.tagBox.init();
+ return false;
+ }
+ });
+ }
+
+ // Handle categories.
+ $('.categorydiv').each( function(){
+ var this_id = $(this).attr('id'), catAddBefore, catAddAfter, taxonomyParts, taxonomy, settingName;
+
+ taxonomyParts = this_id.split('-');
+ taxonomyParts.shift();
+ taxonomy = taxonomyParts.join('-');
+ settingName = taxonomy + '_tab';
+
+ if ( taxonomy == 'category' ) {
+ settingName = 'cats';
+ }
+
+ // TODO: move to jQuery 1.3+, support for multiple hierarchical taxonomies, see wp-lists.js
+ $('a', '#' + taxonomy + '-tabs').click( function( e ) {
+ e.preventDefault();
+ var t = $(this).attr('href');
+ $(this).parent().addClass('tabs').siblings('li').removeClass('tabs');
+ $('#' + taxonomy + '-tabs').siblings('.tabs-panel').hide();
+ $(t).show();
+ if ( '#' + taxonomy + '-all' == t ) {
+ deleteUserSetting( settingName );
+ } else {
+ setUserSetting( settingName, 'pop' );
+ }
+ });
+
+ if ( getUserSetting( settingName ) )
+ $('a[href="#' + taxonomy + '-pop"]', '#' + taxonomy + '-tabs').click();
+
+ // Add category button controls.
+ $('#new' + taxonomy).one( 'focus', function() {
+ $( this ).val( '' ).removeClass( 'form-input-tip' );
+ });
+
+ // On [enter] submit the taxonomy.
+ $('#new' + taxonomy).keypress( function(event){
+ if( 13 === event.keyCode ) {
+ event.preventDefault();
+ $('#' + taxonomy + '-add-submit').click();
+ }
+ });
+
+ // After submitting a new taxonomy, re-focus the input field.
+ $('#' + taxonomy + '-add-submit').click( function() {
+ $('#new' + taxonomy).focus();
+ });
+
+ /**
+ * Before adding a new taxonomy, disable submit button.
+ *
+ * @param {Object} s Taxonomy object which will be added.
+ *
+ * @returns {Object}
+ */
+ catAddBefore = function( s ) {
+ if ( !$('#new'+taxonomy).val() ) {
+ return false;
+ }
+
+ s.data += '&' + $( ':checked', '#'+taxonomy+'checklist' ).serialize();
+ $( '#' + taxonomy + '-add-submit' ).prop( 'disabled', true );
+ return s;
+ };
+
+ /**
+ * Re-enable submit button after a taxonomy has been added.
+ *
+ * Re-enable submit button.
+ * If the taxonomy has a parent place the taxonomy underneath the parent.
+ *
+ * @param {Object} r Response.
+ * @param {Object} s Taxonomy data.
+ *
+ * @returns void
+ */
+ catAddAfter = function( r, s ) {
+ var sup, drop = $('#new'+taxonomy+'_parent');
+
+ $( '#' + taxonomy + '-add-submit' ).prop( 'disabled', false );
+ if ( 'undefined' != s.parsed.responses[0] && (sup = s.parsed.responses[0].supplemental.newcat_parent) ) {
+ drop.before(sup);
+ drop.remove();
+ }
+ };
+
+ $('#' + taxonomy + 'checklist').wpList({
+ alt: '',
+ response: taxonomy + '-ajax-response',
+ addBefore: catAddBefore,
+ addAfter: catAddAfter
+ });
+
+ // Add new taxonomy button toggles input form visibility.
+ $('#' + taxonomy + '-add-toggle').click( function( e ) {
+ e.preventDefault();
+ $('#' + taxonomy + '-adder').toggleClass( 'wp-hidden-children' );
+ $('a[href="#' + taxonomy + '-all"]', '#' + taxonomy + '-tabs').click();
+ $('#new'+taxonomy).focus();
+ });
+
+ // Sync checked items between "All {taxonomy}" and "Most used" lists.
+ $('#' + taxonomy + 'checklist, #' + taxonomy + 'checklist-pop').on( 'click', 'li.popular-category > label input[type="checkbox"]', function() {
+ var t = $(this), c = t.is(':checked'), id = t.val();
+ if ( id && t.parents('#taxonomy-'+taxonomy).length )
+ $('#in-' + taxonomy + '-' + id + ', #in-popular-' + taxonomy + '-' + id).prop( 'checked', c );
+ });
+
+ }); // end cats
+
+ // Custom Fields postbox.
+ if ( $('#postcustom').length ) {
+ $( '#the-list' ).wpList( {
+ /**
+ * Add current post_ID to request to fetch custom fields
+ *
+ * @ignore
+ *
+ * @param {Object} s Request object.
+ *
+ * @returns {Object} Data modified with post_ID attached.
+ */
+ addBefore: function( s ) {
+ s.data += '&post_id=' + $('#post_ID').val();
+ return s;
+ },
+ /**
+ * Show the listing of custom fields after fetching.
+ *
+ * @ignore
+ */
+ addAfter: function() {
+ $('table#list-table').show();
+ }
+ });
+ }
+
+ /*
+ * Publish Post box (#submitdiv)
+ */
+ if ( $('#submitdiv').length ) {
+ stamp = $('#timestamp').html();
+ visibility = $('#post-visibility-display').html();
+
+ /**
+ * When the visibility of a post changes sub-options should be shown or hidden.
+ *
+ * @ignore
+ *
+ * @returns void
+ */
+ updateVisibility = function() {
+ // Show sticky for public posts.
+ if ( $postVisibilitySelect.find('input:radio:checked').val() != 'public' ) {
+ $('#sticky').prop('checked', false);
+ $('#sticky-span').hide();
+ } else {
+ $('#sticky-span').show();
+ }
+
+ // Show password input field for password protected post.
+ if ( $postVisibilitySelect.find('input:radio:checked').val() != 'password' ) {
+ $('#password-span').hide();
+ } else {
+ $('#password-span').show();
+ }
+ };
+
+ /**
+ * Make sure all labels represent the current settings.
+ *
+ * @ignore
+ *
+ * @returns {boolean} False when an invalid timestamp has been selected, otherwise True.
+ */
+ updateText = function() {
+
+ if ( ! $timestampdiv.length )
+ return true;
+
+ var attemptedDate, originalDate, currentDate, publishOn, postStatus = $('#post_status'),
+ optPublish = $('option[value="publish"]', postStatus), aa = $('#aa').val(),
+ mm = $('#mm').val(), jj = $('#jj').val(), hh = $('#hh').val(), mn = $('#mn').val();
+
+ attemptedDate = new Date( aa, mm - 1, jj, hh, mn );
+ originalDate = new Date( $('#hidden_aa').val(), $('#hidden_mm').val() -1, $('#hidden_jj').val(), $('#hidden_hh').val(), $('#hidden_mn').val() );
+ currentDate = new Date( $('#cur_aa').val(), $('#cur_mm').val() -1, $('#cur_jj').val(), $('#cur_hh').val(), $('#cur_mn').val() );
+
+ // Catch unexpected date problems.
+ if ( attemptedDate.getFullYear() != aa || (1 + attemptedDate.getMonth()) != mm || attemptedDate.getDate() != jj || attemptedDate.getMinutes() != mn ) {
+ $timestampdiv.find('.timestamp-wrap').addClass('form-invalid');
+ return false;
+ } else {
+ $timestampdiv.find('.timestamp-wrap').removeClass('form-invalid');
+ }
+
+ // Determine what the publish should be depending on the date and post status.
+ if ( attemptedDate > currentDate && $('#original_post_status').val() != 'future' ) {
+ publishOn = postL10n.publishOnFuture;
+ $('#publish').val( postL10n.schedule );
+ } else if ( attemptedDate <= currentDate && $('#original_post_status').val() != 'publish' ) {
+ publishOn = postL10n.publishOn;
+ $('#publish').val( postL10n.publish );
+ } else {
+ publishOn = postL10n.publishOnPast;
+ $('#publish').val( postL10n.update );
+ }
+
+ // If the date is the same, set it to trigger update events.
+ if ( originalDate.toUTCString() == attemptedDate.toUTCString() ) {
+ // Re-set to the current value.
+ $('#timestamp').html(stamp);
+ } else {
+ $('#timestamp').html(
+ '\n' + publishOn + ' <b>' +
+ postL10n.dateFormat
+ .replace( '%1$s', $( 'option[value="' + mm + '"]', '#mm' ).attr( 'data-text' ) )
+ .replace( '%2$s', parseInt( jj, 10 ) )
+ .replace( '%3$s', aa )
+ .replace( '%4$s', ( '00' + hh ).slice( -2 ) )
+ .replace( '%5$s', ( '00' + mn ).slice( -2 ) ) +
+ '</b> '
+ );
+ }
+
+ // Add "privately published" to post status when applies.
+ if ( $postVisibilitySelect.find('input:radio:checked').val() == 'private' ) {
+ $('#publish').val( postL10n.update );
+ if ( 0 === optPublish.length ) {
+ postStatus.append('<option value="publish">' + postL10n.privatelyPublished + '</option>');
+ } else {
+ optPublish.html( postL10n.privatelyPublished );
+ }
+ $('option[value="publish"]', postStatus).prop('selected', true);
+ $('#misc-publishing-actions .edit-post-status').hide();
+ } else {
+ if ( $('#original_post_status').val() == 'future' || $('#original_post_status').val() == 'draft' ) {
+ if ( optPublish.length ) {
+ optPublish.remove();
+ postStatus.val($('#hidden_post_status').val());
+ }
+ } else {
+ optPublish.html( postL10n.published );
+ }
+ if ( postStatus.is(':hidden') )
+ $('#misc-publishing-actions .edit-post-status').show();
+ }
+
+ // Update "Status:" to currently selected status.
+ $('#post-status-display').text(
+ wp.sanitize.stripTagsAndEncodeText( $('option:selected', postStatus).text() ) // Remove any potential tags from post status text.
+ );
+
+ // Show or hide the "Save Draft" button.
+ if ( $('option:selected', postStatus).val() == 'private' || $('option:selected', postStatus).val() == 'publish' ) {
+ $('#save-post').hide();
+ } else {
+ $('#save-post').show();
+ if ( $('option:selected', postStatus).val() == 'pending' ) {
+ $('#save-post').show().val( postL10n.savePending );
+ } else {
+ $('#save-post').show().val( postL10n.saveDraft );
+ }
+ }
+ return true;
+ };
+
+ // Show the visibility options and hide the toggle button when opened.
+ $( '#visibility .edit-visibility').click( function( e ) {
+ e.preventDefault();
+ if ( $postVisibilitySelect.is(':hidden') ) {
+ updateVisibility();
+ $postVisibilitySelect.slideDown( 'fast', function() {
+ $postVisibilitySelect.find( 'input[type="radio"]' ).first().focus();
+ } );
+ $(this).hide();
+ }
+ });
+
+ // Cancel visibility selection area and hide it from view.
+ $postVisibilitySelect.find('.cancel-post-visibility').click( function( event ) {
+ $postVisibilitySelect.slideUp('fast');
+ $('#visibility-radio-' + $('#hidden-post-visibility').val()).prop('checked', true);
+ $('#post_password').val($('#hidden-post-password').val());
+ $('#sticky').prop('checked', $('#hidden-post-sticky').prop('checked'));
+ $('#post-visibility-display').html(visibility);
+ $('#visibility .edit-visibility').show().focus();
+ updateText();
+ event.preventDefault();
+ });
+
+ // Set the selected visibility as current.
+ $postVisibilitySelect.find('.save-post-visibility').click( function( event ) { // crazyhorse - multiple ok cancels
+ $postVisibilitySelect.slideUp('fast');
+ $('#visibility .edit-visibility').show().focus();
+ updateText();
+
+ if ( $postVisibilitySelect.find('input:radio:checked').val() != 'public' ) {
+ $('#sticky').prop('checked', false);
+ }
+
+ if ( $('#sticky').prop('checked') ) {
+ sticky = 'Sticky';
+ } else {
+ sticky = '';
+ }
+
+ $('#post-visibility-display').html( postL10n[ $postVisibilitySelect.find('input:radio:checked').val() + sticky ] );
+ event.preventDefault();
+ });
+
+ // When the selection changes, update labels.
+ $postVisibilitySelect.find('input:radio').change( function() {
+ updateVisibility();
+ });
+
+ // Edit publish time click.
+ $timestampdiv.siblings('a.edit-timestamp').click( function( event ) {
+ if ( $timestampdiv.is( ':hidden' ) ) {
+ $timestampdiv.slideDown( 'fast', function() {
+ $( 'input, select', $timestampdiv.find( '.timestamp-wrap' ) ).first().focus();
+ } );
+ $(this).hide();
+ }
+ event.preventDefault();
+ });
+
+ // Cancel editing the publish time and hide the settings.
+ $timestampdiv.find('.cancel-timestamp').click( function( event ) {
+ $timestampdiv.slideUp('fast').siblings('a.edit-timestamp').show().focus();
+ $('#mm').val($('#hidden_mm').val());
+ $('#jj').val($('#hidden_jj').val());
+ $('#aa').val($('#hidden_aa').val());
+ $('#hh').val($('#hidden_hh').val());
+ $('#mn').val($('#hidden_mn').val());
+ updateText();
+ event.preventDefault();
+ });
+
+ // Save the changed timestamp.
+ $timestampdiv.find('.save-timestamp').click( function( event ) { // crazyhorse - multiple ok cancels
+ if ( updateText() ) {
+ $timestampdiv.slideUp('fast');
+ $timestampdiv.siblings('a.edit-timestamp').show().focus();
+ }
+ event.preventDefault();
+ });
+
+ // Cancel submit when an invalid timestamp has been selected.
+ $('#post').on( 'submit', function( event ) {
+ if ( ! updateText() ) {
+ event.preventDefault();
+ $timestampdiv.show();
+
+ if ( wp.autosave ) {
+ wp.autosave.enableButtons();
+ }
+
+ $( '#publishing-action .spinner' ).removeClass( 'is-active' );
+ }
+ });
+
+ // Post Status edit click.
+ $postStatusSelect.siblings('a.edit-post-status').click( function( event ) {
+ if ( $postStatusSelect.is( ':hidden' ) ) {
+ $postStatusSelect.slideDown( 'fast', function() {
+ $postStatusSelect.find('select').focus();
+ } );
+ $(this).hide();
+ }
+ event.preventDefault();
+ });
+
+ // Save the Post Status changes and hide the options.
+ $postStatusSelect.find('.save-post-status').click( function( event ) {
+ $postStatusSelect.slideUp( 'fast' ).siblings( 'a.edit-post-status' ).show().focus();
+ updateText();
+ event.preventDefault();
+ });
+
+ // Cancel Post Status editing and hide the options.
+ $postStatusSelect.find('.cancel-post-status').click( function( event ) {
+ $postStatusSelect.slideUp( 'fast' ).siblings( 'a.edit-post-status' ).show().focus();
+ $('#post_status').val( $('#hidden_post_status').val() );
+ updateText();
+ event.preventDefault();
+ });
+ }
+
+ /**
+ * Handle the editing of the post_name. Create the required HTML elements and
+ * update the changes via AJAX.
+ *
+ * @global
+ *
+ * @returns void
+ */
+ function editPermalink() {
+ var i, slug_value,
+ $el, revert_e,
+ c = 0,
+ real_slug = $('#post_name'),
+ revert_slug = real_slug.val(),
+ permalink = $( '#sample-permalink' ),
+ permalinkOrig = permalink.html(),
+ permalinkInner = $( '#sample-permalink a' ).html(),
+ buttons = $('#edit-slug-buttons'),
+ buttonsOrig = buttons.html(),
+ full = $('#editable-post-name-full');
+
+ // Deal with Twemoji in the post-name.
+ full.find( 'img' ).replaceWith( function() { return this.alt; } );
+ full = full.html();
+
+ permalink.html( permalinkInner );
+
+ // Save current content to revert to when cancelling.
+ $el = $( '#editable-post-name' );
+ revert_e = $el.html();
+
+ buttons.html( '<button type="button" class="save button button-small">' + postL10n.ok + '</button> <button type="button" class="cancel button-link">' + postL10n.cancel + '</button>' );
+
+ // Save permalink changes.
+ buttons.children( '.save' ).click( function() {
+ var new_slug = $el.children( 'input' ).val();
+
+ if ( new_slug == $('#editable-post-name-full').text() ) {
+ buttons.children('.cancel').click();
+ return;
+ }
+
+ $.post(
+ ajaxurl,
+ {
+ action: 'sample-permalink',
+ post_id: postId,
+ new_slug: new_slug,
+ new_title: $('#title').val(),
+ samplepermalinknonce: $('#samplepermalinknonce').val()
+ },
+ function(data) {
+ var box = $('#edit-slug-box');
+ box.html(data);
+ if (box.hasClass('hidden')) {
+ box.fadeIn('fast', function () {
+ box.removeClass('hidden');
+ });
+ }
+
+ buttons.html(buttonsOrig);
+ permalink.html(permalinkOrig);
+ real_slug.val(new_slug);
+ $( '.edit-slug' ).focus();
+ wp.a11y.speak( postL10n.permalinkSaved );
+ }
+ );
+ });
+
+ // Cancel editing of permalink.
+ buttons.children( '.cancel' ).click( function() {
+ $('#view-post-btn').show();
+ $el.html(revert_e);
+ buttons.html(buttonsOrig);
+ permalink.html(permalinkOrig);
+ real_slug.val(revert_slug);
+ $( '.edit-slug' ).focus();
+ });
+
+ // If more than 1/4th of 'full' is '%', make it empty.
+ for ( i = 0; i < full.length; ++i ) {
+ if ( '%' == full.charAt(i) )
+ c++;
+ }
+ slug_value = ( c > full.length / 4 ) ? '' : full;
+
+ $el.html( '<input type="text" id="new-post-slug" value="' + slug_value + '" autocomplete="off" />' ).children( 'input' ).keydown( function( e ) {
+ var key = e.which;
+ // On [enter], just save the new slug, don't save the post.
+ if ( 13 === key ) {
+ e.preventDefault();
+ buttons.children( '.save' ).click();
+ }
+ // On [esc] cancel the editing.
+ if ( 27 === key ) {
+ buttons.children( '.cancel' ).click();
+ }
+ } ).keyup( function() {
+ real_slug.val( this.value );
+ }).focus();
+ }
+
+ $( '#titlediv' ).on( 'click', '.edit-slug', function() {
+ editPermalink();
+ });
+
+ /**
+ * Adds screen reader text to the title label when needed.
+ *
+ * Use the 'screen-reader-text' class to emulate a placeholder attribute
+ * and hide the label when entering a value.
+ *
+ * @param {string} id Optional. HTML ID to add the screen reader helper text to.
+ *
+ * @global
+ *
+ * @returns void
+ */
+ window.wptitlehint = function( id ) {
+ id = id || 'title';
+
+ var title = $( '#' + id ), titleprompt = $( '#' + id + '-prompt-text' );
+
+ if ( '' === title.val() ) {
+ titleprompt.removeClass( 'screen-reader-text' );
+ }
+
+ title.on( 'input', function() {
+ if ( '' === this.value ) {
+ titleprompt.removeClass( 'screen-reader-text' );
+ return;
+ }
+
+ titleprompt.addClass( 'screen-reader-text' );
+ } );
+ };
+
+ wptitlehint();
+
+ // Resize the WYSIWYG and plain text editors.
+ ( function() {
+ var editor, offset, mce,
+ $handle = $('#post-status-info'),
+ $postdivrich = $('#postdivrich');
+
+ // If there are no textareas or we are on a touch device, we can't do anything.
+ if ( ! $textarea.length || 'ontouchstart' in window ) {
+ // Hide the resize handle.
+ $('#content-resize-handle').hide();
+ return;
+ }
+
+ /**
+ * Handle drag event.
+ *
+ * @param {Object} event Event containing details about the drag.
+ */
+ function dragging( event ) {
+ if ( $postdivrich.hasClass( 'wp-editor-expand' ) ) {
+ return;
+ }
+
+ if ( mce ) {
+ editor.theme.resizeTo( null, offset + event.pageY );
+ } else {
+ $textarea.height( Math.max( 50, offset + event.pageY ) );
+ }
+
+ event.preventDefault();
+ }
+
+ /**
+ * When the dragging stopped make sure we return focus and do a sanity check on the height.
+ */
+ function endDrag() {
+ var height, toolbarHeight;
+
+ if ( $postdivrich.hasClass( 'wp-editor-expand' ) ) {
+ return;
+ }
+
+ if ( mce ) {
+ editor.focus();
+ toolbarHeight = parseInt( $( '#wp-content-editor-container .mce-toolbar-grp' ).height(), 10 );
+
+ if ( toolbarHeight < 10 || toolbarHeight > 200 ) {
+ toolbarHeight = 30;
+ }
+
+ height = parseInt( $('#content_ifr').css('height'), 10 ) + toolbarHeight - 28;
+ } else {
+ $textarea.focus();
+ height = parseInt( $textarea.css('height'), 10 );
+ }
+
+ $document.off( '.wp-editor-resize' );
+
+ // Sanity check: normalize height to stay within acceptable ranges.
+ if ( height && height > 50 && height < 5000 ) {
+ setUserSetting( 'ed_size', height );
+ }
+ }
+
+ $handle.on( 'mousedown.wp-editor-resize', function( event ) {
+ if ( typeof tinymce !== 'undefined' ) {
+ editor = tinymce.get('content');
+ }
+
+ if ( editor && ! editor.isHidden() ) {
+ mce = true;
+ offset = $('#content_ifr').height() - event.pageY;
+ } else {
+ mce = false;
+ offset = $textarea.height() - event.pageY;
+ $textarea.blur();
+ }
+
+ $document.on( 'mousemove.wp-editor-resize', dragging )
+ .on( 'mouseup.wp-editor-resize mouseleave.wp-editor-resize', endDrag );
+
+ event.preventDefault();
+ }).on( 'mouseup.wp-editor-resize', endDrag );
+ })();
+
+ // TinyMCE specific handling of Post Format changes to reflect in the editor.
+ if ( typeof tinymce !== 'undefined' ) {
+ // When changing post formats, change the editor body class.
+ $( '#post-formats-select input.post-format' ).on( 'change.set-editor-class', function() {
+ var editor, body, format = this.id;
+
+ if ( format && $( this ).prop( 'checked' ) && ( editor = tinymce.get( 'content' ) ) ) {
+ body = editor.getBody();
+ body.className = body.className.replace( /\bpost-format-[^ ]+/, '' );
+ editor.dom.addClass( body, format == 'post-format-0' ? 'post-format-standard' : format );
+ $( document ).trigger( 'editor-classchange' );
+ }
+ });
+
+ // When changing page template, change the editor body class
+ $( '#page_template' ).on( 'change.set-editor-class', function() {
+ var editor, body, pageTemplate = $( this ).val() || '';
+
+ pageTemplate = pageTemplate.substr( pageTemplate.lastIndexOf( '/' ) + 1, pageTemplate.length )
+ .replace( /\.php$/, '' )
+ .replace( /\./g, '-' );
+
+ if ( pageTemplate && ( editor = tinymce.get( 'content' ) ) ) {
+ body = editor.getBody();
+ body.className = body.className.replace( /\bpage-template-[^ ]+/, '' );
+ editor.dom.addClass( body, 'page-template-' + pageTemplate );
+ $( document ).trigger( 'editor-classchange' );
+ }
+ });
+
+ }
+
+ // Save on pressing [ctrl]/[command] + [s] in the Text editor.
+ $textarea.on( 'keydown.wp-autosave', function( event ) {
+ // Key [s] has code 83.
+ if ( event.which === 83 ) {
+ if ( event.shiftKey || event.altKey || ( isMac && ( ! event.metaKey || event.ctrlKey ) ) || ( ! isMac && ! event.ctrlKey ) ) {
+ return;
+ }
+
+ wp.autosave && wp.autosave.server.triggerSave();
+ event.preventDefault();
+ }
+ });
+
+ // If the last status was auto-draft and the save is triggered, edit the current URL.
+ if ( $( '#original_post_status' ).val() === 'auto-draft' && window.history.replaceState ) {
+ var location;
+
+ $( '#publish' ).on( 'click', function() {
+ location = window.location.href;
+ location += ( location.indexOf( '?' ) !== -1 ) ? '&' : '?';
+ location += 'wp-post-new-reload=true';
+
+ window.history.replaceState( null, null, location );
+ });
+ }
+});
+
+/**
+ * TinyMCE word count display
+ */
+( function( $, counter ) {
+ $( function() {
+ var $content = $( '#content' ),
+ $count = $( '#wp-word-count' ).find( '.word-count' ),
+ prevCount = 0,
+ contentEditor;
+
+ /**
+ * Get the word count from TinyMCE and display it
+ */
+ function update() {
+ var text, count;
+
+ if ( ! contentEditor || contentEditor.isHidden() ) {
+ text = $content.val();
+ } else {
+ text = contentEditor.getContent( { format: 'raw' } );
+ }
+
+ count = counter.count( text );
+
+ if ( count !== prevCount ) {
+ $count.text( count );
+ }
+
+ prevCount = count;
+ }
+
+ /**
+ * Bind the word count update triggers.
+ *
+ * When a node change in the main TinyMCE editor has been triggered.
+ * When a key has been released in the plain text content editor.
+ */
+ $( document ).on( 'tinymce-editor-init', function( event, editor ) {
+ if ( editor.id !== 'content' ) {
+ return;
+ }
+
+ contentEditor = editor;
+
+ editor.on( 'nodechange keyup', _.debounce( update, 1000 ) );
+ } );
+
+ $content.on( 'input keyup', _.debounce( update, 1000 ) );
+
+ update();
+ } );
+
+} )( jQuery, new wp.utils.WordCounter() );
diff --git a/www/crm/wp-admin/js/post.min.js b/www/crm/wp-admin/js/post.min.js
new file mode 100644
index 00000000..bc93e1bc
--- /dev/null
+++ b/www/crm/wp-admin/js/post.min.js
@@ -0,0 +1 @@
+window.makeSlugeditClickable=window.editPermalink=function(){},window.wp=window.wp||{},function(a){var b=!1;window.commentsBox={st:0,get:function(b,c){var d,e=this.st;return c||(c=20),this.st+=c,this.total=b,a("#commentsdiv .spinner").addClass("is-active"),d={action:"get-comments",mode:"single",_ajax_nonce:a("#add_comment_nonce").val(),p:a("#post_ID").val(),start:e,number:c},a.post(ajaxurl,d,function(b){return b=wpAjax.parseAjaxResponse(b),a("#commentsdiv .widefat").show(),a("#commentsdiv .spinner").removeClass("is-active"),"object"==typeof b&&b.responses[0]?(a("#the-comment-list").append(b.responses[0].data),theList=theExtraList=null,a("a[className*=':']").unbind(),void(commentsBox.st>commentsBox.total?a("#show-comments").hide():a("#show-comments").show().children("a").html(postL10n.showcomm))):1==b?void a("#show-comments").html(postL10n.endcomm):void a("#the-comment-list").append('<tr><td colspan="2">'+wpAjax.broken+"</td></tr>")}),!1},load:function(a){this.st=jQuery("#the-comment-list tr.comment:visible").length,this.get(a)}},window.WPSetThumbnailHTML=function(b){a(".inside","#postimagediv").html(b)},window.WPSetThumbnailID=function(b){var c=a('input[value="_thumbnail_id"]',"#list-table");c.length>0&&a("#meta\\["+c.attr("id").match(/[0-9]+/)+"\\]\\[value\\]").text(b)},window.WPRemoveThumbnail=function(b){a.post(ajaxurl,{action:"set-post-thumbnail",post_id:a("#post_ID").val(),thumbnail_id:-1,_ajax_nonce:b,cookie:encodeURIComponent(document.cookie)},function(a){"0"==a?alert(setPostThumbnailL10n.error):WPSetThumbnailHTML(a)})},a(document).on("heartbeat-send.refresh-lock",function(b,c){var d=a("#active_post_lock").val(),e=a("#post_ID").val(),f={};e&&a("#post-lock-dialog").length&&(f.post_id=e,d&&(f.lock=d),c["wp-refresh-post-lock"]=f)}).on("heartbeat-tick.refresh-lock",function(b,c){var d,e,f;c["wp-refresh-post-lock"]&&(d=c["wp-refresh-post-lock"],d.lock_error?(e=a("#post-lock-dialog"),e.length&&!e.is(":visible")&&(wp.autosave&&(a(document).one("heartbeat-tick",function(){wp.autosave.server.suspend(),e.removeClass("saving").addClass("saved"),a(window).off("beforeunload.edit-post")}),e.addClass("saving"),wp.autosave.server.triggerSave()),d.lock_error.avatar_src&&(f=a('<img class="avatar avatar-64 photo" width="64" height="64" alt="" />').attr("src",d.lock_error.avatar_src.replace(/&amp;/g,"&")),e.find("div.post-locked-avatar").empty().append(f)),e.show().find(".currently-editing").text(d.lock_error.text),e.find(".wp-tab-first").focus())):d.new_lock&&a("#active_post_lock").val(d.new_lock))}).on("before-autosave.update-post-slug",function(){b=document.activeElement&&"title"===document.activeElement.id}).on("after-autosave.update-post-slug",function(){a("#edit-slug-box > *").length||b||a.post(ajaxurl,{action:"sample-permalink",post_id:a("#post_ID").val(),new_title:a("#title").val(),samplepermalinknonce:a("#samplepermalinknonce").val()},function(b){"-1"!=b&&a("#edit-slug-box").html(b)})})}(jQuery),function(a){function b(){c=!1,window.clearTimeout(d),d=window.setTimeout(function(){c=!0},3e5)}var c,d;a(document).on("heartbeat-send.wp-refresh-nonces",function(b,d){var e,f=a("#wp-auth-check-wrap");(c||f.length&&!f.hasClass("hidden"))&&(e=a("#post_ID").val())&&a("#_wpnonce").val()&&(d["wp-refresh-post-nonces"]={post_id:e})}).on("heartbeat-tick.wp-refresh-nonces",function(c,d){var e=d["wp-refresh-post-nonces"];e&&(b(),e.replace&&a.each(e.replace,function(b,c){a("#"+b).val(c)}),e.heartbeatNonce&&(window.heartbeatSettings.nonce=e.heartbeatNonce))}).ready(function(){b()})}(jQuery),jQuery(document).ready(function(a){function b(){var b,c,d,e,f=0,g=a("#post_name"),h=g.val(),i=a("#sample-permalink"),j=i.html(),l=a("#sample-permalink a").html(),m=a("#edit-slug-buttons"),n=m.html(),o=a("#editable-post-name-full");for(o.find("img").replaceWith(function(){return this.alt}),o=o.html(),i.html(l),d=a("#editable-post-name"),e=d.html(),m.html('<button type="button" class="save button button-small">'+postL10n.ok+'</button> <button type="button" class="cancel button-link">'+postL10n.cancel+"</button>"),m.children(".save").click(function(){var b=d.children("input").val();return b==a("#editable-post-name-full").text()?void m.children(".cancel").click():void a.post(ajaxurl,{action:"sample-permalink",post_id:k,new_slug:b,new_title:a("#title").val(),samplepermalinknonce:a("#samplepermalinknonce").val()},function(c){var d=a("#edit-slug-box");d.html(c),d.hasClass("hidden")&&d.fadeIn("fast",function(){d.removeClass("hidden")}),m.html(n),i.html(j),g.val(b),a(".edit-slug").focus(),wp.a11y.speak(postL10n.permalinkSaved)})}),m.children(".cancel").click(function(){a("#view-post-btn").show(),d.html(e),m.html(n),i.html(j),g.val(h),a(".edit-slug").focus()}),b=0;b<o.length;++b)"%"==o.charAt(b)&&f++;c=f>o.length/4?"":o,d.html('<input type="text" id="new-post-slug" value="'+c+'" autocomplete="off" />').children("input").keydown(function(a){var b=a.which;13===b&&(a.preventDefault(),m.children(".save").click()),27===b&&m.children(".cancel").click()}).keyup(function(){g.val(this.value)}).focus()}var c,d,e,f,g,h="",i=a("#content"),j=a(document),k=a("#post_ID").val()||0,l=a("#submitpost"),m=!0,n=a("#post-visibility-select"),o=a("#timestampdiv"),p=a("#post-status-select"),q=!!window.navigator.platform&&window.navigator.platform.indexOf("Mac")!==-1;if(postboxes.add_postbox_toggles(pagenow),window.name="",a("#post-lock-dialog .notification-dialog").on("keydown",function(b){if(9==b.which){var c=a(b.target);c.hasClass("wp-tab-first")&&b.shiftKey?(a(this).find(".wp-tab-last").focus(),b.preventDefault()):c.hasClass("wp-tab-last")&&!b.shiftKey&&(a(this).find(".wp-tab-first").focus(),b.preventDefault())}}).filter(":visible").find(".wp-tab-first").focus(),wp.heartbeat&&a("#post-lock-dialog").length&&wp.heartbeat.interval(15),e=l.find(":submit, a.submitdelete, #post-preview").on("click.edit-post",function(b){var c=a(this);return c.hasClass("disabled")?void b.preventDefault():void(c.hasClass("submitdelete")||c.is("#post-preview")||a("form#post").off("submit.edit-post").on("submit.edit-post",function(b){if(!b.isDefaultPrevented()){if(wp.autosave&&wp.autosave.server.suspend(),"undefined"!=typeof commentReply){if(!commentReply.discardCommentChanges())return!1;commentReply.close()}m=!1,a(window).off("beforeunload.edit-post"),e.addClass("disabled"),"publish"===c.attr("id")?l.find("#major-publishing-actions .spinner").addClass("is-active"):l.find("#minor-publishing .spinner").addClass("is-active")}}))}),a("#post-preview").on("click.post-preview",function(b){var c=a(this),d=a("form#post"),e=a("input#wp-preview"),f=c.attr("target")||"wp-preview",g=navigator.userAgent.toLowerCase();b.preventDefault(),c.hasClass("disabled")||(wp.autosave&&wp.autosave.server.tempBlockSave(),e.val("dopreview"),d.attr("target",f).submit().attr("target",""),g.indexOf("safari")!==-1&&g.indexOf("chrome")===-1&&d.attr("action",function(a,b){return b+"?t="+(new Date).getTime()}),e.val(""))}),a("#title").on("keydown.editor-focus",function(a){var b;if(9===a.keyCode&&!a.ctrlKey&&!a.altKey&&!a.shiftKey){if(b="undefined"!=typeof tinymce&&tinymce.get("content"),b&&!b.isHidden())b.focus();else{if(!i.length)return;i.focus()}a.preventDefault()}}),a("#auto_draft").val()&&a("#title").blur(function(){var b;this.value&&!a("#edit-slug-box > *").length&&(a("form#post").one("submit",function(){b=!0}),window.setTimeout(function(){!b&&wp.autosave&&wp.autosave.server.triggerSave()},200))}),j.on("autosave-disable-buttons.edit-post",function(){e.addClass("disabled")}).on("autosave-enable-buttons.edit-post",function(){wp.heartbeat&&wp.heartbeat.hasConnectionError()||e.removeClass("disabled")}).on("before-autosave.edit-post",function(){a(".autosave-message").text(postL10n.savingText)}).on("after-autosave.edit-post",function(b,c){a(".autosave-message").text(c.message),a(document.body).hasClass("post-new-php")&&a(".submitbox .submitdelete").show()}),a(window).on("beforeunload.edit-post",function(){var a="undefined"!=typeof tinymce&&tinymce.get("content");if(a&&!a.isHidden()&&a.isDirty()||wp.autosave&&wp.autosave.server.postChanged())return postL10n.saveAlert}).on("unload.edit-post",function(b){if(m&&(!b.target||"#document"==b.target.nodeName)){var c=a("#post_ID").val(),d=a("#active_post_lock").val();if(c&&d){var e={action:"wp-remove-post-lock",_wpnonce:a("#_wpnonce").val(),post_ID:c,active_post_lock:d};if(window.FormData&&window.navigator.sendBeacon){var f=new window.FormData;if(a.each(e,function(a,b){f.append(a,b)}),window.navigator.sendBeacon(ajaxurl,f))return}a.post({async:!1,data:e,url:ajaxurl})}}}),a("#tagsdiv-post_tag").length?window.tagBox&&window.tagBox.init():a(".meta-box-sortables").children("div.postbox").each(function(){if(0===this.id.indexOf("tagsdiv-"))return window.tagBox&&window.tagBox.init(),!1}),a(".categorydiv").each(function(){var b,c,d,e,f,g=a(this).attr("id");d=g.split("-"),d.shift(),e=d.join("-"),f=e+"_tab","category"==e&&(f="cats"),a("a","#"+e+"-tabs").click(function(b){b.preventDefault();var c=a(this).attr("href");a(this).parent().addClass("tabs").siblings("li").removeClass("tabs"),a("#"+e+"-tabs").siblings(".tabs-panel").hide(),a(c).show(),"#"+e+"-all"==c?deleteUserSetting(f):setUserSetting(f,"pop")}),getUserSetting(f)&&a('a[href="#'+e+'-pop"]',"#"+e+"-tabs").click(),a("#new"+e).one("focus",function(){a(this).val("").removeClass("form-input-tip")}),a("#new"+e).keypress(function(b){13===b.keyCode&&(b.preventDefault(),a("#"+e+"-add-submit").click())}),a("#"+e+"-add-submit").click(function(){a("#new"+e).focus()}),b=function(b){return!!a("#new"+e).val()&&(b.data+="&"+a(":checked","#"+e+"checklist").serialize(),a("#"+e+"-add-submit").prop("disabled",!0),b)},c=function(b,c){var d,f=a("#new"+e+"_parent");a("#"+e+"-add-submit").prop("disabled",!1),"undefined"!=c.parsed.responses[0]&&(d=c.parsed.responses[0].supplemental.newcat_parent)&&(f.before(d),f.remove())},a("#"+e+"checklist").wpList({alt:"",response:e+"-ajax-response",addBefore:b,addAfter:c}),a("#"+e+"-add-toggle").click(function(b){b.preventDefault(),a("#"+e+"-adder").toggleClass("wp-hidden-children"),a('a[href="#'+e+'-all"]',"#"+e+"-tabs").click(),a("#new"+e).focus()}),a("#"+e+"checklist, #"+e+"checklist-pop").on("click",'li.popular-category > label input[type="checkbox"]',function(){var b=a(this),c=b.is(":checked"),d=b.val();d&&b.parents("#taxonomy-"+e).length&&a("#in-"+e+"-"+d+", #in-popular-"+e+"-"+d).prop("checked",c)})}),a("#postcustom").length&&a("#the-list").wpList({addBefore:function(b){return b.data+="&post_id="+a("#post_ID").val(),b},addAfter:function(){a("table#list-table").show()}}),a("#submitdiv").length&&(c=a("#timestamp").html(),d=a("#post-visibility-display").html(),f=function(){"public"!=n.find("input:radio:checked").val()?(a("#sticky").prop("checked",!1),a("#sticky-span").hide()):a("#sticky-span").show(),"password"!=n.find("input:radio:checked").val()?a("#password-span").hide():a("#password-span").show()},g=function(){if(!o.length)return!0;var b,d,e,f,g=a("#post_status"),h=a('option[value="publish"]',g),i=a("#aa").val(),j=a("#mm").val(),k=a("#jj").val(),l=a("#hh").val(),m=a("#mn").val();return b=new Date(i,j-1,k,l,m),d=new Date(a("#hidden_aa").val(),a("#hidden_mm").val()-1,a("#hidden_jj").val(),a("#hidden_hh").val(),a("#hidden_mn").val()),e=new Date(a("#cur_aa").val(),a("#cur_mm").val()-1,a("#cur_jj").val(),a("#cur_hh").val(),a("#cur_mn").val()),b.getFullYear()!=i||1+b.getMonth()!=j||b.getDate()!=k||b.getMinutes()!=m?(o.find(".timestamp-wrap").addClass("form-invalid"),!1):(o.find(".timestamp-wrap").removeClass("form-invalid"),b>e&&"future"!=a("#original_post_status").val()?(f=postL10n.publishOnFuture,a("#publish").val(postL10n.schedule)):b<=e&&"publish"!=a("#original_post_status").val()?(f=postL10n.publishOn,a("#publish").val(postL10n.publish)):(f=postL10n.publishOnPast,a("#publish").val(postL10n.update)),d.toUTCString()==b.toUTCString()?a("#timestamp").html(c):a("#timestamp").html("\n"+f+" <b>"+postL10n.dateFormat.replace("%1$s",a('option[value="'+j+'"]',"#mm").attr("data-text")).replace("%2$s",parseInt(k,10)).replace("%3$s",i).replace("%4$s",("00"+l).slice(-2)).replace("%5$s",("00"+m).slice(-2))+"</b> "),"private"==n.find("input:radio:checked").val()?(a("#publish").val(postL10n.update),0===h.length?g.append('<option value="publish">'+postL10n.privatelyPublished+"</option>"):h.html(postL10n.privatelyPublished),a('option[value="publish"]',g).prop("selected",!0),a("#misc-publishing-actions .edit-post-status").hide()):("future"==a("#original_post_status").val()||"draft"==a("#original_post_status").val()?h.length&&(h.remove(),g.val(a("#hidden_post_status").val())):h.html(postL10n.published),g.is(":hidden")&&a("#misc-publishing-actions .edit-post-status").show()),a("#post-status-display").text(wp.sanitize.stripTagsAndEncodeText(a("option:selected",g).text())),"private"==a("option:selected",g).val()||"publish"==a("option:selected",g).val()?a("#save-post").hide():(a("#save-post").show(),"pending"==a("option:selected",g).val()?a("#save-post").show().val(postL10n.savePending):a("#save-post").show().val(postL10n.saveDraft)),!0)},a("#visibility .edit-visibility").click(function(b){b.preventDefault(),n.is(":hidden")&&(f(),n.slideDown("fast",function(){n.find('input[type="radio"]').first().focus()}),a(this).hide())}),n.find(".cancel-post-visibility").click(function(b){n.slideUp("fast"),a("#visibility-radio-"+a("#hidden-post-visibility").val()).prop("checked",!0),a("#post_password").val(a("#hidden-post-password").val()),a("#sticky").prop("checked",a("#hidden-post-sticky").prop("checked")),a("#post-visibility-display").html(d),a("#visibility .edit-visibility").show().focus(),g(),b.preventDefault()}),n.find(".save-post-visibility").click(function(b){n.slideUp("fast"),a("#visibility .edit-visibility").show().focus(),g(),"public"!=n.find("input:radio:checked").val()&&a("#sticky").prop("checked",!1),h=a("#sticky").prop("checked")?"Sticky":"",a("#post-visibility-display").html(postL10n[n.find("input:radio:checked").val()+h]),b.preventDefault()}),n.find("input:radio").change(function(){f()}),o.siblings("a.edit-timestamp").click(function(b){o.is(":hidden")&&(o.slideDown("fast",function(){a("input, select",o.find(".timestamp-wrap")).first().focus()}),a(this).hide()),b.preventDefault()}),o.find(".cancel-timestamp").click(function(b){o.slideUp("fast").siblings("a.edit-timestamp").show().focus(),a("#mm").val(a("#hidden_mm").val()),a("#jj").val(a("#hidden_jj").val()),a("#aa").val(a("#hidden_aa").val()),a("#hh").val(a("#hidden_hh").val()),a("#mn").val(a("#hidden_mn").val()),g(),b.preventDefault()}),o.find(".save-timestamp").click(function(a){g()&&(o.slideUp("fast"),o.siblings("a.edit-timestamp").show().focus()),a.preventDefault()}),a("#post").on("submit",function(b){g()||(b.preventDefault(),o.show(),wp.autosave&&wp.autosave.enableButtons(),a("#publishing-action .spinner").removeClass("is-active"))}),p.siblings("a.edit-post-status").click(function(b){p.is(":hidden")&&(p.slideDown("fast",function(){p.find("select").focus()}),a(this).hide()),b.preventDefault()}),p.find(".save-post-status").click(function(a){p.slideUp("fast").siblings("a.edit-post-status").show().focus(),g(),a.preventDefault()}),p.find(".cancel-post-status").click(function(b){p.slideUp("fast").siblings("a.edit-post-status").show().focus(),a("#post_status").val(a("#hidden_post_status").val()),g(),b.preventDefault()})),a("#titlediv").on("click",".edit-slug",function(){b()}),window.wptitlehint=function(b){b=b||"title";var c=a("#"+b),d=a("#"+b+"-prompt-text");""===c.val()&&d.removeClass("screen-reader-text"),c.on("input",function(){return""===this.value?void d.removeClass("screen-reader-text"):void d.addClass("screen-reader-text")})},wptitlehint(),function(){function b(a){h.hasClass("wp-editor-expand")||(f?d.theme.resizeTo(null,e+a.pageY):i.height(Math.max(50,e+a.pageY)),a.preventDefault())}function c(){var b,c;h.hasClass("wp-editor-expand")||(f?(d.focus(),c=parseInt(a("#wp-content-editor-container .mce-toolbar-grp").height(),10),(c<10||c>200)&&(c=30),b=parseInt(a("#content_ifr").css("height"),10)+c-28):(i.focus(),b=parseInt(i.css("height"),10)),j.off(".wp-editor-resize"),b&&b>50&&b<5e3&&setUserSetting("ed_size",b))}var d,e,f,g=a("#post-status-info"),h=a("#postdivrich");return!i.length||"ontouchstart"in window?void a("#content-resize-handle").hide():void g.on("mousedown.wp-editor-resize",function(g){"undefined"!=typeof tinymce&&(d=tinymce.get("content")),d&&!d.isHidden()?(f=!0,e=a("#content_ifr").height()-g.pageY):(f=!1,e=i.height()-g.pageY,i.blur()),j.on("mousemove.wp-editor-resize",b).on("mouseup.wp-editor-resize mouseleave.wp-editor-resize",c),g.preventDefault()}).on("mouseup.wp-editor-resize",c)}(),"undefined"!=typeof tinymce&&(a("#post-formats-select input.post-format").on("change.set-editor-class",function(){var b,c,d=this.id;d&&a(this).prop("checked")&&(b=tinymce.get("content"))&&(c=b.getBody(),c.className=c.className.replace(/\bpost-format-[^ ]+/,""),b.dom.addClass(c,"post-format-0"==d?"post-format-standard":d),a(document).trigger("editor-classchange"))}),a("#page_template").on("change.set-editor-class",function(){var b,c,d=a(this).val()||"";d=d.substr(d.lastIndexOf("/")+1,d.length).replace(/\.php$/,"").replace(/\./g,"-"),d&&(b=tinymce.get("content"))&&(c=b.getBody(),c.className=c.className.replace(/\bpage-template-[^ ]+/,""),b.dom.addClass(c,"page-template-"+d),a(document).trigger("editor-classchange"))})),i.on("keydown.wp-autosave",function(a){if(83===a.which){if(a.shiftKey||a.altKey||q&&(!a.metaKey||a.ctrlKey)||!q&&!a.ctrlKey)return;wp.autosave&&wp.autosave.server.triggerSave(),a.preventDefault()}}),"auto-draft"===a("#original_post_status").val()&&window.history.replaceState){var r;a("#publish").on("click",function(){r=window.location.href,r+=r.indexOf("?")!==-1?"&":"?",r+="wp-post-new-reload=true",window.history.replaceState(null,null,r)})}}),function(a,b){a(function(){function c(){var a,c;a=!d||d.isHidden()?e.val():d.getContent({format:"raw"}),c=b.count(a),c!==g&&f.text(c),g=c}var d,e=a("#content"),f=a("#wp-word-count").find(".word-count"),g=0;a(document).on("tinymce-editor-init",function(a,b){"content"===b.id&&(d=b,b.on("nodechange keyup",_.debounce(c,1e3)))}),e.on("input keyup",_.debounce(c,1e3)),c()})}(jQuery,new wp.utils.WordCounter); \ No newline at end of file
diff --git a/www/crm/wp-admin/js/postbox.js b/www/crm/wp-admin/js/postbox.js
new file mode 100644
index 00000000..88facb1a
--- /dev/null
+++ b/www/crm/wp-admin/js/postbox.js
@@ -0,0 +1,445 @@
+/**
+ * Contains the postboxes logic, opening and closing postboxes, reordering and saving
+ * the state and ordering to the database.
+ *
+ * @since 2.5.0
+ * @requires jQuery
+ * @output wp-admin/js/postbox.js
+ */
+
+/* global ajaxurl, postBoxL10n, postboxes */
+
+(function($) {
+ var $document = $( document );
+
+ /**
+ * This object contains all function to handle the behaviour of the post boxes. The post boxes are the boxes you see
+ * around the content on the edit page.
+ *
+ * @since 2.7.0
+ *
+ * @namespace postboxes
+ *
+ * @type {Object}
+ */
+ window.postboxes = {
+
+ /**
+ * Handles a click on either the postbox heading or the postbox open/close icon.
+ *
+ * Opens or closes the postbox. Expects `this` to equal the clicked element.
+ * Calls postboxes.pbshow if the postbox has been opened, calls postboxes.pbhide
+ * if the postbox has been closed.
+ *
+ * @since 4.4.0
+ * @memberof postboxes
+ * @fires postboxes#postbox-toggled
+ *
+ * @returns {void}
+ */
+ handle_click : function () {
+ var $el = $( this ),
+ p = $el.parent( '.postbox' ),
+ id = p.attr( 'id' ),
+ ariaExpandedValue;
+
+ if ( 'dashboard_browser_nag' === id ) {
+ return;
+ }
+
+ p.toggleClass( 'closed' );
+
+ ariaExpandedValue = ! p.hasClass( 'closed' );
+
+ if ( $el.hasClass( 'handlediv' ) ) {
+ // The handle button was clicked.
+ $el.attr( 'aria-expanded', ariaExpandedValue );
+ } else {
+ // The handle heading was clicked.
+ $el.closest( '.postbox' ).find( 'button.handlediv' )
+ .attr( 'aria-expanded', ariaExpandedValue );
+ }
+
+ if ( postboxes.page !== 'press-this' ) {
+ postboxes.save_state( postboxes.page );
+ }
+
+ if ( id ) {
+ if ( !p.hasClass('closed') && $.isFunction( postboxes.pbshow ) ) {
+ postboxes.pbshow( id );
+ } else if ( p.hasClass('closed') && $.isFunction( postboxes.pbhide ) ) {
+ postboxes.pbhide( id );
+ }
+ }
+
+ /**
+ * Fires when a postbox has been opened or closed.
+ *
+ * Contains a jQuery object with the relevant postbox element.
+ *
+ * @since 4.0.0
+ * @ignore
+ *
+ * @event postboxes#postbox-toggled
+ * @type {Object}
+ */
+ $document.trigger( 'postbox-toggled', p );
+ },
+
+ /**
+ * Adds event handlers to all postboxes and screen option on the current page.
+ *
+ * @since 2.7.0
+ * @memberof postboxes
+ *
+ * @param {string} page The page we are currently on.
+ * @param {Object} [args]
+ * @param {Function} args.pbshow A callback that is called when a postbox opens.
+ * @param {Function} args.pbhide A callback that is called when a postbox closes.
+ * @returns {void}
+ */
+ add_postbox_toggles : function (page, args) {
+ var $handles = $( '.postbox .hndle, .postbox .handlediv' );
+
+ this.page = page;
+ this.init( page, args );
+
+ $handles.on( 'click.postboxes', this.handle_click );
+
+ /**
+ * @since 2.7.0
+ */
+ $('.postbox .hndle a').click( function(e) {
+ e.stopPropagation();
+ });
+
+ /**
+ * Hides a postbox.
+ *
+ * Event handler for the postbox dismiss button. After clicking the button
+ * the postbox will be hidden.
+ *
+ * @since 3.2.0
+ *
+ * @returns {void}
+ */
+ $( '.postbox a.dismiss' ).on( 'click.postboxes', function( e ) {
+ var hide_id = $(this).parents('.postbox').attr('id') + '-hide';
+ e.preventDefault();
+ $( '#' + hide_id ).prop('checked', false).triggerHandler('click');
+ });
+
+ /**
+ * Hides the postbox element
+ *
+ * Event handler for the screen options checkboxes. When a checkbox is
+ * clicked this function will hide or show the relevant postboxes.
+ *
+ * @since 2.7.0
+ * @ignore
+ *
+ * @fires postboxes#postbox-toggled
+ *
+ * @returns {void}
+ */
+ $('.hide-postbox-tog').bind('click.postboxes', function() {
+ var $el = $(this),
+ boxId = $el.val(),
+ $postbox = $( '#' + boxId );
+
+ if ( $el.prop( 'checked' ) ) {
+ $postbox.show();
+ if ( $.isFunction( postboxes.pbshow ) ) {
+ postboxes.pbshow( boxId );
+ }
+ } else {
+ $postbox.hide();
+ if ( $.isFunction( postboxes.pbhide ) ) {
+ postboxes.pbhide( boxId );
+ }
+ }
+
+ postboxes.save_state( page );
+ postboxes._mark_area();
+
+ /**
+ * @since 4.0.0
+ * @see postboxes.handle_click
+ */
+ $document.trigger( 'postbox-toggled', $postbox );
+ });
+
+ /**
+ * Changes the amount of columns based on the layout preferences.
+ *
+ * @since 2.8.0
+ *
+ * @returns {void}
+ */
+ $('.columns-prefs input[type="radio"]').bind('click.postboxes', function(){
+ var n = parseInt($(this).val(), 10);
+
+ if ( n ) {
+ postboxes._pb_edit(n);
+ postboxes.save_order( page );
+ }
+ });
+ },
+
+ /**
+ * Initializes all the postboxes, mainly their sortable behaviour.
+ *
+ * @since 2.7.0
+ * @memberof postboxes
+ *
+ * @param {string} page The page we are currently on.
+ * @param {Object} [args={}] The arguments for the postbox initializer.
+ * @param {Function} args.pbshow A callback that is called when a postbox opens.
+ * @param {Function} args.pbhide A callback that is called when a postbox
+ * closes.
+ *
+ * @returns {void}
+ */
+ init : function(page, args) {
+ var isMobile = $( document.body ).hasClass( 'mobile' ),
+ $handleButtons = $( '.postbox .handlediv' );
+
+ $.extend( this, args || {} );
+ $('#wpbody-content').css('overflow','hidden');
+ $('.meta-box-sortables').sortable({
+ placeholder: 'sortable-placeholder',
+ connectWith: '.meta-box-sortables',
+ items: '.postbox',
+ handle: '.hndle',
+ cursor: 'move',
+ delay: ( isMobile ? 200 : 0 ),
+ distance: 2,
+ tolerance: 'pointer',
+ forcePlaceholderSize: true,
+ helper: function( event, element ) {
+ /* `helper: 'clone'` is equivalent to `return element.clone();`
+ * Cloning a checked radio and then inserting that clone next to the original
+ * radio unchecks the original radio (since only one of the two can be checked).
+ * We get around this by renaming the helper's inputs' name attributes so that,
+ * when the helper is inserted into the DOM for the sortable, no radios are
+ * duplicated, and no original radio gets unchecked.
+ */
+ return element.clone()
+ .find( ':input' )
+ .attr( 'name', function( i, currentName ) {
+ return 'sort_' + parseInt( Math.random() * 100000, 10 ).toString() + '_' + currentName;
+ } )
+ .end();
+ },
+ opacity: 0.65,
+ stop: function() {
+ var $el = $( this );
+
+ if ( $el.find( '#dashboard_browser_nag' ).is( ':visible' ) && 'dashboard_browser_nag' != this.firstChild.id ) {
+ $el.sortable('cancel');
+ return;
+ }
+
+ postboxes.save_order(page);
+ },
+ receive: function(e,ui) {
+ if ( 'dashboard_browser_nag' == ui.item[0].id )
+ $(ui.sender).sortable('cancel');
+
+ postboxes._mark_area();
+ $document.trigger( 'postbox-moved', ui.item );
+ }
+ });
+
+ if ( isMobile ) {
+ $(document.body).bind('orientationchange.postboxes', function(){ postboxes._pb_change(); });
+ this._pb_change();
+ }
+
+ this._mark_area();
+
+ // Set the handle buttons `aria-expanded` attribute initial value on page load.
+ $handleButtons.each( function () {
+ var $el = $( this );
+ $el.attr( 'aria-expanded', ! $el.parent( '.postbox' ).hasClass( 'closed' ) );
+ });
+ },
+
+ /**
+ * Saves the state of the postboxes to the server.
+ *
+ * It sends two lists, one with all the closed postboxes, one with all the
+ * hidden postboxes.
+ *
+ * @since 2.7.0
+ * @memberof postboxes
+ *
+ * @param {string} page The page we are currently on.
+ * @returns {void}
+ */
+ save_state : function(page) {
+ var closed, hidden;
+
+ // Return on the nav-menus.php screen, see #35112.
+ if ( 'nav-menus' === page ) {
+ return;
+ }
+
+ closed = $( '.postbox' ).filter( '.closed' ).map( function() { return this.id; } ).get().join( ',' );
+ hidden = $( '.postbox' ).filter( ':hidden' ).map( function() { return this.id; } ).get().join( ',' );
+
+ $.post(ajaxurl, {
+ action: 'closed-postboxes',
+ closed: closed,
+ hidden: hidden,
+ closedpostboxesnonce: jQuery('#closedpostboxesnonce').val(),
+ page: page
+ });
+ },
+
+ /**
+ * Saves the order of the postboxes to the server.
+ *
+ * Sends a list of all postboxes inside a sortable area to the server.
+ *
+ * @since 2.8.0
+ * @memberof postboxes
+ *
+ * @param {string} page The page we are currently on.
+ * @returns {void}
+ */
+ save_order : function(page) {
+ var postVars, page_columns = $('.columns-prefs input:checked').val() || 0;
+
+ postVars = {
+ action: 'meta-box-order',
+ _ajax_nonce: $('#meta-box-order-nonce').val(),
+ page_columns: page_columns,
+ page: page
+ };
+
+ $('.meta-box-sortables').each( function() {
+ postVars[ 'order[' + this.id.split( '-' )[0] + ']' ] = $( this ).sortable( 'toArray' ).join( ',' );
+ } );
+
+ $.post( ajaxurl, postVars );
+ },
+
+ /**
+ * Marks empty postbox areas.
+ *
+ * Adds a message to empty sortable areas on the dashboard page. Also adds a
+ * border around the side area on the post edit screen if there are no postboxes
+ * present.
+ *
+ * @since 3.3.0
+ * @memberof postboxes
+ * @access private
+ *
+ * @returns {void}
+ */
+ _mark_area : function() {
+ var visible = $('div.postbox:visible').length, side = $('#post-body #side-sortables');
+
+ $( '#dashboard-widgets .meta-box-sortables:visible' ).each( function() {
+ var t = $(this);
+
+ if ( visible == 1 || t.children('.postbox:visible').length ) {
+ t.removeClass('empty-container');
+ }
+ else {
+ t.addClass('empty-container');
+ t.attr('data-emptyString', postBoxL10n.postBoxEmptyString);
+ }
+ });
+
+ if ( side.length ) {
+ if ( side.children('.postbox:visible').length )
+ side.removeClass('empty-container');
+ else if ( $('#postbox-container-1').css('width') == '280px' )
+ side.addClass('empty-container');
+ }
+ },
+
+ /**
+ * Changes the amount of columns on the post edit page.
+ *
+ * @since 3.3.0
+ * @memberof postboxes
+ * @fires postboxes#postboxes-columnchange
+ * @access private
+ *
+ * @param {number} n The amount of columns to divide the post edit page in.
+ * @returns {void}
+ */
+ _pb_edit : function(n) {
+ var el = $('.metabox-holder').get(0);
+
+ if ( el ) {
+ el.className = el.className.replace(/columns-\d+/, 'columns-' + n);
+ }
+
+ /**
+ * Fires when the amount of columns on the post edit page has been changed.
+ *
+ * @since 4.0.0
+ * @ignore
+ *
+ * @event postboxes#postboxes-columnchange
+ */
+ $( document ).trigger( 'postboxes-columnchange' );
+ },
+
+ /**
+ * Changes the amount of columns the postboxes are in based on the current
+ * orientation of the browser.
+ *
+ * @since 3.3.0
+ * @memberof postboxes
+ * @access private
+ *
+ * @returns {void}
+ */
+ _pb_change : function() {
+ var check = $( 'label.columns-prefs-1 input[type="radio"]' );
+
+ switch ( window.orientation ) {
+ case 90:
+ case -90:
+ if ( !check.length || !check.is(':checked') )
+ this._pb_edit(2);
+ break;
+ case 0:
+ case 180:
+ if ( $('#poststuff').length ) {
+ this._pb_edit(1);
+ } else {
+ if ( !check.length || !check.is(':checked') )
+ this._pb_edit(2);
+ }
+ break;
+ }
+ },
+
+ /* Callbacks */
+
+ /**
+ * @since 2.7.0
+ * @memberof postboxes
+ * @access public
+ * @property {Function|boolean} pbshow A callback that is called when a postbox
+ * is opened.
+ */
+ pbshow : false,
+
+ /**
+ * @since 2.7.0
+ * @memberof postboxes
+ * @access public
+ * @property {Function|boolean} pbhide A callback that is called when a postbox
+ * is closed.
+ */
+ pbhide : false
+ };
+
+}(jQuery));
diff --git a/www/crm/wp-admin/js/postbox.min.js b/www/crm/wp-admin/js/postbox.min.js
new file mode 100644
index 00000000..c0634d18
--- /dev/null
+++ b/www/crm/wp-admin/js/postbox.min.js
@@ -0,0 +1 @@
+!function(a){var b=a(document);window.postboxes={handle_click:function(){var c,d=a(this),e=d.parent(".postbox"),f=e.attr("id");"dashboard_browser_nag"!==f&&(e.toggleClass("closed"),c=!e.hasClass("closed"),d.hasClass("handlediv")?d.attr("aria-expanded",c):d.closest(".postbox").find("button.handlediv").attr("aria-expanded",c),"press-this"!==postboxes.page&&postboxes.save_state(postboxes.page),f&&(!e.hasClass("closed")&&a.isFunction(postboxes.pbshow)?postboxes.pbshow(f):e.hasClass("closed")&&a.isFunction(postboxes.pbhide)&&postboxes.pbhide(f)),b.trigger("postbox-toggled",e))},add_postbox_toggles:function(c,d){var e=a(".postbox .hndle, .postbox .handlediv");this.page=c,this.init(c,d),e.on("click.postboxes",this.handle_click),a(".postbox .hndle a").click(function(a){a.stopPropagation()}),a(".postbox a.dismiss").on("click.postboxes",function(b){var c=a(this).parents(".postbox").attr("id")+"-hide";b.preventDefault(),a("#"+c).prop("checked",!1).triggerHandler("click")}),a(".hide-postbox-tog").bind("click.postboxes",function(){var d=a(this),e=d.val(),f=a("#"+e);d.prop("checked")?(f.show(),a.isFunction(postboxes.pbshow)&&postboxes.pbshow(e)):(f.hide(),a.isFunction(postboxes.pbhide)&&postboxes.pbhide(e)),postboxes.save_state(c),postboxes._mark_area(),b.trigger("postbox-toggled",f)}),a('.columns-prefs input[type="radio"]').bind("click.postboxes",function(){var b=parseInt(a(this).val(),10);b&&(postboxes._pb_edit(b),postboxes.save_order(c))})},init:function(c,d){var e=a(document.body).hasClass("mobile"),f=a(".postbox .handlediv");a.extend(this,d||{}),a("#wpbody-content").css("overflow","hidden"),a(".meta-box-sortables").sortable({placeholder:"sortable-placeholder",connectWith:".meta-box-sortables",items:".postbox",handle:".hndle",cursor:"move",delay:e?200:0,distance:2,tolerance:"pointer",forcePlaceholderSize:!0,helper:function(a,b){return b.clone().find(":input").attr("name",function(a,b){return"sort_"+parseInt(1e5*Math.random(),10).toString()+"_"+b}).end()},opacity:.65,stop:function(){var b=a(this);return b.find("#dashboard_browser_nag").is(":visible")&&"dashboard_browser_nag"!=this.firstChild.id?void b.sortable("cancel"):void postboxes.save_order(c)},receive:function(c,d){"dashboard_browser_nag"==d.item[0].id&&a(d.sender).sortable("cancel"),postboxes._mark_area(),b.trigger("postbox-moved",d.item)}}),e&&(a(document.body).bind("orientationchange.postboxes",function(){postboxes._pb_change()}),this._pb_change()),this._mark_area(),f.each(function(){var b=a(this);b.attr("aria-expanded",!b.parent(".postbox").hasClass("closed"))})},save_state:function(b){var c,d;"nav-menus"!==b&&(c=a(".postbox").filter(".closed").map(function(){return this.id}).get().join(","),d=a(".postbox").filter(":hidden").map(function(){return this.id}).get().join(","),a.post(ajaxurl,{action:"closed-postboxes",closed:c,hidden:d,closedpostboxesnonce:jQuery("#closedpostboxesnonce").val(),page:b}))},save_order:function(b){var c,d=a(".columns-prefs input:checked").val()||0;c={action:"meta-box-order",_ajax_nonce:a("#meta-box-order-nonce").val(),page_columns:d,page:b},a(".meta-box-sortables").each(function(){c["order["+this.id.split("-")[0]+"]"]=a(this).sortable("toArray").join(",")}),a.post(ajaxurl,c)},_mark_area:function(){var b=a("div.postbox:visible").length,c=a("#post-body #side-sortables");a("#dashboard-widgets .meta-box-sortables:visible").each(function(){var c=a(this);1==b||c.children(".postbox:visible").length?c.removeClass("empty-container"):(c.addClass("empty-container"),c.attr("data-emptyString",postBoxL10n.postBoxEmptyString))}),c.length&&(c.children(".postbox:visible").length?c.removeClass("empty-container"):"280px"==a("#postbox-container-1").css("width")&&c.addClass("empty-container"))},_pb_edit:function(b){var c=a(".metabox-holder").get(0);c&&(c.className=c.className.replace(/columns-\d+/,"columns-"+b)),a(document).trigger("postboxes-columnchange")},_pb_change:function(){var b=a('label.columns-prefs-1 input[type="radio"]');switch(window.orientation){case 90:case-90:b.length&&b.is(":checked")||this._pb_edit(2);break;case 0:case 180:a("#poststuff").length?this._pb_edit(1):b.length&&b.is(":checked")||this._pb_edit(2)}},pbshow:!1,pbhide:!1}}(jQuery); \ No newline at end of file
diff --git a/www/crm/wp-admin/js/revisions.js b/www/crm/wp-admin/js/revisions.js
new file mode 100644
index 00000000..adf58651
--- /dev/null
+++ b/www/crm/wp-admin/js/revisions.js
@@ -0,0 +1,1171 @@
+/**
+ * @file Revisions interface functions, Backbone classes and
+ * the revisions.php document.ready bootstrap.
+ *
+ * @output wp-admin/js/revisions.js
+ */
+
+/* global isRtl */
+
+window.wp = window.wp || {};
+
+(function($) {
+ var revisions;
+ /**
+ * Expose the module in window.wp.revisions.
+ */
+ revisions = wp.revisions = { model: {}, view: {}, controller: {} };
+
+ // Link post revisions data served from the back end.
+ revisions.settings = window._wpRevisionsSettings || {};
+
+ // For debugging
+ revisions.debug = false;
+
+ /**
+ * wp.revisions.log
+ *
+ * A debugging utility for revisions. Works only when a
+ * debug flag is on and the browser supports it.
+ */
+ revisions.log = function() {
+ if ( window.console && revisions.debug ) {
+ window.console.log.apply( window.console, arguments );
+ }
+ };
+
+ // Handy functions to help with positioning
+ $.fn.allOffsets = function() {
+ var offset = this.offset() || {top: 0, left: 0}, win = $(window);
+ return _.extend( offset, {
+ right: win.width() - offset.left - this.outerWidth(),
+ bottom: win.height() - offset.top - this.outerHeight()
+ });
+ };
+
+ $.fn.allPositions = function() {
+ var position = this.position() || {top: 0, left: 0}, parent = this.parent();
+ return _.extend( position, {
+ right: parent.outerWidth() - position.left - this.outerWidth(),
+ bottom: parent.outerHeight() - position.top - this.outerHeight()
+ });
+ };
+
+ /**
+ * ========================================================================
+ * MODELS
+ * ========================================================================
+ */
+ revisions.model.Slider = Backbone.Model.extend({
+ defaults: {
+ value: null,
+ values: null,
+ min: 0,
+ max: 1,
+ step: 1,
+ range: false,
+ compareTwoMode: false
+ },
+
+ initialize: function( options ) {
+ this.frame = options.frame;
+ this.revisions = options.revisions;
+
+ // Listen for changes to the revisions or mode from outside
+ this.listenTo( this.frame, 'update:revisions', this.receiveRevisions );
+ this.listenTo( this.frame, 'change:compareTwoMode', this.updateMode );
+
+ // Listen for internal changes
+ this.on( 'change:from', this.handleLocalChanges );
+ this.on( 'change:to', this.handleLocalChanges );
+ this.on( 'change:compareTwoMode', this.updateSliderSettings );
+ this.on( 'update:revisions', this.updateSliderSettings );
+
+ // Listen for changes to the hovered revision
+ this.on( 'change:hoveredRevision', this.hoverRevision );
+
+ this.set({
+ max: this.revisions.length - 1,
+ compareTwoMode: this.frame.get('compareTwoMode'),
+ from: this.frame.get('from'),
+ to: this.frame.get('to')
+ });
+ this.updateSliderSettings();
+ },
+
+ getSliderValue: function( a, b ) {
+ return isRtl ? this.revisions.length - this.revisions.indexOf( this.get(a) ) - 1 : this.revisions.indexOf( this.get(b) );
+ },
+
+ updateSliderSettings: function() {
+ if ( this.get('compareTwoMode') ) {
+ this.set({
+ values: [
+ this.getSliderValue( 'to', 'from' ),
+ this.getSliderValue( 'from', 'to' )
+ ],
+ value: null,
+ range: true // ensures handles cannot cross
+ });
+ } else {
+ this.set({
+ value: this.getSliderValue( 'to', 'to' ),
+ values: null,
+ range: false
+ });
+ }
+ this.trigger( 'update:slider' );
+ },
+
+ // Called when a revision is hovered
+ hoverRevision: function( model, value ) {
+ this.trigger( 'hovered:revision', value );
+ },
+
+ // Called when `compareTwoMode` changes
+ updateMode: function( model, value ) {
+ this.set({ compareTwoMode: value });
+ },
+
+ // Called when `from` or `to` changes in the local model
+ handleLocalChanges: function() {
+ this.frame.set({
+ from: this.get('from'),
+ to: this.get('to')
+ });
+ },
+
+ // Receives revisions changes from outside the model
+ receiveRevisions: function( from, to ) {
+ // Bail if nothing changed
+ if ( this.get('from') === from && this.get('to') === to ) {
+ return;
+ }
+
+ this.set({ from: from, to: to }, { silent: true });
+ this.trigger( 'update:revisions', from, to );
+ }
+
+ });
+
+ revisions.model.Tooltip = Backbone.Model.extend({
+ defaults: {
+ revision: null,
+ offset: {},
+ hovering: false, // Whether the mouse is hovering
+ scrubbing: false // Whether the mouse is scrubbing
+ },
+
+ initialize: function( options ) {
+ this.frame = options.frame;
+ this.revisions = options.revisions;
+ this.slider = options.slider;
+
+ this.listenTo( this.slider, 'hovered:revision', this.updateRevision );
+ this.listenTo( this.slider, 'change:hovering', this.setHovering );
+ this.listenTo( this.slider, 'change:scrubbing', this.setScrubbing );
+ },
+
+
+ updateRevision: function( revision ) {
+ this.set({ revision: revision });
+ },
+
+ setHovering: function( model, value ) {
+ this.set({ hovering: value });
+ },
+
+ setScrubbing: function( model, value ) {
+ this.set({ scrubbing: value });
+ }
+ });
+
+ revisions.model.Revision = Backbone.Model.extend({});
+
+ /**
+ * wp.revisions.model.Revisions
+ *
+ * A collection of post revisions.
+ */
+ revisions.model.Revisions = Backbone.Collection.extend({
+ model: revisions.model.Revision,
+
+ initialize: function() {
+ _.bindAll( this, 'next', 'prev' );
+ },
+
+ next: function( revision ) {
+ var index = this.indexOf( revision );
+
+ if ( index !== -1 && index !== this.length - 1 ) {
+ return this.at( index + 1 );
+ }
+ },
+
+ prev: function( revision ) {
+ var index = this.indexOf( revision );
+
+ if ( index !== -1 && index !== 0 ) {
+ return this.at( index - 1 );
+ }
+ }
+ });
+
+ revisions.model.Field = Backbone.Model.extend({});
+
+ revisions.model.Fields = Backbone.Collection.extend({
+ model: revisions.model.Field
+ });
+
+ revisions.model.Diff = Backbone.Model.extend({
+ initialize: function() {
+ var fields = this.get('fields');
+ this.unset('fields');
+
+ this.fields = new revisions.model.Fields( fields );
+ }
+ });
+
+ revisions.model.Diffs = Backbone.Collection.extend({
+ initialize: function( models, options ) {
+ _.bindAll( this, 'getClosestUnloaded' );
+ this.loadAll = _.once( this._loadAll );
+ this.revisions = options.revisions;
+ this.postId = options.postId;
+ this.requests = {};
+ },
+
+ model: revisions.model.Diff,
+
+ ensure: function( id, context ) {
+ var diff = this.get( id ),
+ request = this.requests[ id ],
+ deferred = $.Deferred(),
+ ids = {},
+ from = id.split(':')[0],
+ to = id.split(':')[1];
+ ids[id] = true;
+
+ wp.revisions.log( 'ensure', id );
+
+ this.trigger( 'ensure', ids, from, to, deferred.promise() );
+
+ if ( diff ) {
+ deferred.resolveWith( context, [ diff ] );
+ } else {
+ this.trigger( 'ensure:load', ids, from, to, deferred.promise() );
+ _.each( ids, _.bind( function( id ) {
+ // Remove anything that has an ongoing request
+ if ( this.requests[ id ] ) {
+ delete ids[ id ];
+ }
+ // Remove anything we already have
+ if ( this.get( id ) ) {
+ delete ids[ id ];
+ }
+ }, this ) );
+ if ( ! request ) {
+ // Always include the ID that started this ensure
+ ids[ id ] = true;
+ request = this.load( _.keys( ids ) );
+ }
+
+ request.done( _.bind( function() {
+ deferred.resolveWith( context, [ this.get( id ) ] );
+ }, this ) ).fail( _.bind( function() {
+ deferred.reject();
+ }) );
+ }
+
+ return deferred.promise();
+ },
+
+ // Returns an array of proximal diffs
+ getClosestUnloaded: function( ids, centerId ) {
+ var self = this;
+ return _.chain([0].concat( ids )).initial().zip( ids ).sortBy( function( pair ) {
+ return Math.abs( centerId - pair[1] );
+ }).map( function( pair ) {
+ return pair.join(':');
+ }).filter( function( diffId ) {
+ return _.isUndefined( self.get( diffId ) ) && ! self.requests[ diffId ];
+ }).value();
+ },
+
+ _loadAll: function( allRevisionIds, centerId, num ) {
+ var self = this, deferred = $.Deferred(),
+ diffs = _.first( this.getClosestUnloaded( allRevisionIds, centerId ), num );
+ if ( _.size( diffs ) > 0 ) {
+ this.load( diffs ).done( function() {
+ self._loadAll( allRevisionIds, centerId, num ).done( function() {
+ deferred.resolve();
+ });
+ }).fail( function() {
+ if ( 1 === num ) { // Already tried 1. This just isn't working. Give up.
+ deferred.reject();
+ } else { // Request fewer diffs this time
+ self._loadAll( allRevisionIds, centerId, Math.ceil( num / 2 ) ).done( function() {
+ deferred.resolve();
+ });
+ }
+ });
+ } else {
+ deferred.resolve();
+ }
+ return deferred;
+ },
+
+ load: function( comparisons ) {
+ wp.revisions.log( 'load', comparisons );
+ // Our collection should only ever grow, never shrink, so remove: false
+ return this.fetch({ data: { compare: comparisons }, remove: false }).done( function() {
+ wp.revisions.log( 'load:complete', comparisons );
+ });
+ },
+
+ sync: function( method, model, options ) {
+ if ( 'read' === method ) {
+ options = options || {};
+ options.context = this;
+ options.data = _.extend( options.data || {}, {
+ action: 'get-revision-diffs',
+ post_id: this.postId
+ });
+
+ var deferred = wp.ajax.send( options ),
+ requests = this.requests;
+
+ // Record that we're requesting each diff.
+ if ( options.data.compare ) {
+ _.each( options.data.compare, function( id ) {
+ requests[ id ] = deferred;
+ });
+ }
+
+ // When the request completes, clear the stored request.
+ deferred.always( function() {
+ if ( options.data.compare ) {
+ _.each( options.data.compare, function( id ) {
+ delete requests[ id ];
+ });
+ }
+ });
+
+ return deferred;
+
+ // Otherwise, fall back to `Backbone.sync()`.
+ } else {
+ return Backbone.Model.prototype.sync.apply( this, arguments );
+ }
+ }
+ });
+
+
+ /**
+ * wp.revisions.model.FrameState
+ *
+ * The frame state.
+ *
+ * @see wp.revisions.view.Frame
+ *
+ * @param {object} attributes Model attributes - none are required.
+ * @param {object} options Options for the model.
+ * @param {revisions.model.Revisions} options.revisions A collection of revisions.
+ */
+ revisions.model.FrameState = Backbone.Model.extend({
+ defaults: {
+ loading: false,
+ error: false,
+ compareTwoMode: false
+ },
+
+ initialize: function( attributes, options ) {
+ var state = this.get( 'initialDiffState' );
+ _.bindAll( this, 'receiveDiff' );
+ this._debouncedEnsureDiff = _.debounce( this._ensureDiff, 200 );
+
+ this.revisions = options.revisions;
+
+ this.diffs = new revisions.model.Diffs( [], {
+ revisions: this.revisions,
+ postId: this.get( 'postId' )
+ } );
+
+ // Set the initial diffs collection.
+ this.diffs.set( this.get( 'diffData' ) );
+
+ // Set up internal listeners
+ this.listenTo( this, 'change:from', this.changeRevisionHandler );
+ this.listenTo( this, 'change:to', this.changeRevisionHandler );
+ this.listenTo( this, 'change:compareTwoMode', this.changeMode );
+ this.listenTo( this, 'update:revisions', this.updatedRevisions );
+ this.listenTo( this.diffs, 'ensure:load', this.updateLoadingStatus );
+ this.listenTo( this, 'update:diff', this.updateLoadingStatus );
+
+ // Set the initial revisions, baseUrl, and mode as provided through attributes.
+
+ this.set( {
+ to : this.revisions.get( state.to ),
+ from : this.revisions.get( state.from ),
+ compareTwoMode : state.compareTwoMode
+ } );
+
+ // Start the router if browser supports History API
+ if ( window.history && window.history.pushState ) {
+ this.router = new revisions.Router({ model: this });
+ if ( Backbone.History.started ) {
+ Backbone.history.stop();
+ }
+ Backbone.history.start({ pushState: true });
+ }
+ },
+
+ updateLoadingStatus: function() {
+ this.set( 'error', false );
+ this.set( 'loading', ! this.diff() );
+ },
+
+ changeMode: function( model, value ) {
+ var toIndex = this.revisions.indexOf( this.get( 'to' ) );
+
+ // If we were on the first revision before switching to two-handled mode,
+ // bump the 'to' position over one
+ if ( value && 0 === toIndex ) {
+ this.set({
+ from: this.revisions.at( toIndex ),
+ to: this.revisions.at( toIndex + 1 )
+ });
+ }
+
+ // When switching back to single-handled mode, reset 'from' model to
+ // one position before the 'to' model
+ if ( ! value && 0 !== toIndex ) { // '! value' means switching to single-handled mode
+ this.set({
+ from: this.revisions.at( toIndex - 1 ),
+ to: this.revisions.at( toIndex )
+ });
+ }
+ },
+
+ updatedRevisions: function( from, to ) {
+ if ( this.get( 'compareTwoMode' ) ) {
+ // TODO: compare-two loading strategy
+ } else {
+ this.diffs.loadAll( this.revisions.pluck('id'), to.id, 40 );
+ }
+ },
+
+ // Fetch the currently loaded diff.
+ diff: function() {
+ return this.diffs.get( this._diffId );
+ },
+
+ // So long as `from` and `to` are changed at the same time, the diff
+ // will only be updated once. This is because Backbone updates all of
+ // the changed attributes in `set`, and then fires the `change` events.
+ updateDiff: function( options ) {
+ var from, to, diffId, diff;
+
+ options = options || {};
+ from = this.get('from');
+ to = this.get('to');
+ diffId = ( from ? from.id : 0 ) + ':' + to.id;
+
+ // Check if we're actually changing the diff id.
+ if ( this._diffId === diffId ) {
+ return $.Deferred().reject().promise();
+ }
+
+ this._diffId = diffId;
+ this.trigger( 'update:revisions', from, to );
+
+ diff = this.diffs.get( diffId );
+
+ // If we already have the diff, then immediately trigger the update.
+ if ( diff ) {
+ this.receiveDiff( diff );
+ return $.Deferred().resolve().promise();
+ // Otherwise, fetch the diff.
+ } else {
+ if ( options.immediate ) {
+ return this._ensureDiff();
+ } else {
+ this._debouncedEnsureDiff();
+ return $.Deferred().reject().promise();
+ }
+ }
+ },
+
+ // A simple wrapper around `updateDiff` to prevent the change event's
+ // parameters from being passed through.
+ changeRevisionHandler: function() {
+ this.updateDiff();
+ },
+
+ receiveDiff: function( diff ) {
+ // Did we actually get a diff?
+ if ( _.isUndefined( diff ) || _.isUndefined( diff.id ) ) {
+ this.set({
+ loading: false,
+ error: true
+ });
+ } else if ( this._diffId === diff.id ) { // Make sure the current diff didn't change
+ this.trigger( 'update:diff', diff );
+ }
+ },
+
+ _ensureDiff: function() {
+ return this.diffs.ensure( this._diffId, this ).always( this.receiveDiff );
+ }
+ });
+
+
+ /**
+ * ========================================================================
+ * VIEWS
+ * ========================================================================
+ */
+
+ /**
+ * wp.revisions.view.Frame
+ *
+ * Top level frame that orchestrates the revisions experience.
+ *
+ * @param {object} options The options hash for the view.
+ * @param {revisions.model.FrameState} options.model The frame state model.
+ */
+ revisions.view.Frame = wp.Backbone.View.extend({
+ className: 'revisions',
+ template: wp.template('revisions-frame'),
+
+ initialize: function() {
+ this.listenTo( this.model, 'update:diff', this.renderDiff );
+ this.listenTo( this.model, 'change:compareTwoMode', this.updateCompareTwoMode );
+ this.listenTo( this.model, 'change:loading', this.updateLoadingStatus );
+ this.listenTo( this.model, 'change:error', this.updateErrorStatus );
+
+ this.views.set( '.revisions-control-frame', new revisions.view.Controls({
+ model: this.model
+ }) );
+ },
+
+ render: function() {
+ wp.Backbone.View.prototype.render.apply( this, arguments );
+
+ $('html').css( 'overflow-y', 'scroll' );
+ $('#wpbody-content .wrap').append( this.el );
+ this.updateCompareTwoMode();
+ this.renderDiff( this.model.diff() );
+ this.views.ready();
+
+ return this;
+ },
+
+ renderDiff: function( diff ) {
+ this.views.set( '.revisions-diff-frame', new revisions.view.Diff({
+ model: diff
+ }) );
+ },
+
+ updateLoadingStatus: function() {
+ this.$el.toggleClass( 'loading', this.model.get('loading') );
+ },
+
+ updateErrorStatus: function() {
+ this.$el.toggleClass( 'diff-error', this.model.get('error') );
+ },
+
+ updateCompareTwoMode: function() {
+ this.$el.toggleClass( 'comparing-two-revisions', this.model.get('compareTwoMode') );
+ }
+ });
+
+ /**
+ * wp.revisions.view.Controls
+ *
+ * The controls view.
+ *
+ * Contains the revision slider, previous/next buttons, the meta info and the compare checkbox.
+ */
+ revisions.view.Controls = wp.Backbone.View.extend({
+ className: 'revisions-controls',
+
+ initialize: function() {
+ _.bindAll( this, 'setWidth' );
+
+ // Add the button view
+ this.views.add( new revisions.view.Buttons({
+ model: this.model
+ }) );
+
+ // Add the checkbox view
+ this.views.add( new revisions.view.Checkbox({
+ model: this.model
+ }) );
+
+ // Prep the slider model
+ var slider = new revisions.model.Slider({
+ frame: this.model,
+ revisions: this.model.revisions
+ }),
+
+ // Prep the tooltip model
+ tooltip = new revisions.model.Tooltip({
+ frame: this.model,
+ revisions: this.model.revisions,
+ slider: slider
+ });
+
+ // Add the tooltip view
+ this.views.add( new revisions.view.Tooltip({
+ model: tooltip
+ }) );
+
+ // Add the tickmarks view
+ this.views.add( new revisions.view.Tickmarks({
+ model: tooltip
+ }) );
+
+ // Add the slider view
+ this.views.add( new revisions.view.Slider({
+ model: slider
+ }) );
+
+ // Add the Metabox view
+ this.views.add( new revisions.view.Metabox({
+ model: this.model
+ }) );
+ },
+
+ ready: function() {
+ this.top = this.$el.offset().top;
+ this.window = $(window);
+ this.window.on( 'scroll.wp.revisions', {controls: this}, function(e) {
+ var controls = e.data.controls,
+ container = controls.$el.parent(),
+ scrolled = controls.window.scrollTop(),
+ frame = controls.views.parent;
+
+ if ( scrolled >= controls.top ) {
+ if ( ! frame.$el.hasClass('pinned') ) {
+ controls.setWidth();
+ container.css('height', container.height() + 'px' );
+ controls.window.on('resize.wp.revisions.pinning click.wp.revisions.pinning', {controls: controls}, function(e) {
+ e.data.controls.setWidth();
+ });
+ }
+ frame.$el.addClass('pinned');
+ } else if ( frame.$el.hasClass('pinned') ) {
+ controls.window.off('.wp.revisions.pinning');
+ controls.$el.css('width', 'auto');
+ frame.$el.removeClass('pinned');
+ container.css('height', 'auto');
+ controls.top = controls.$el.offset().top;
+ } else {
+ controls.top = controls.$el.offset().top;
+ }
+ });
+ },
+
+ setWidth: function() {
+ this.$el.css('width', this.$el.parent().width() + 'px');
+ }
+ });
+
+ // The tickmarks view
+ revisions.view.Tickmarks = wp.Backbone.View.extend({
+ className: 'revisions-tickmarks',
+ direction: isRtl ? 'right' : 'left',
+
+ initialize: function() {
+ this.listenTo( this.model, 'change:revision', this.reportTickPosition );
+ },
+
+ reportTickPosition: function( model, revision ) {
+ var offset, thisOffset, parentOffset, tick, index = this.model.revisions.indexOf( revision );
+ thisOffset = this.$el.allOffsets();
+ parentOffset = this.$el.parent().allOffsets();
+ if ( index === this.model.revisions.length - 1 ) {
+ // Last one
+ offset = {
+ rightPlusWidth: thisOffset.left - parentOffset.left + 1,
+ leftPlusWidth: thisOffset.right - parentOffset.right + 1
+ };
+ } else {
+ // Normal tick
+ tick = this.$('div:nth-of-type(' + (index + 1) + ')');
+ offset = tick.allPositions();
+ _.extend( offset, {
+ left: offset.left + thisOffset.left - parentOffset.left,
+ right: offset.right + thisOffset.right - parentOffset.right
+ });
+ _.extend( offset, {
+ leftPlusWidth: offset.left + tick.outerWidth(),
+ rightPlusWidth: offset.right + tick.outerWidth()
+ });
+ }
+ this.model.set({ offset: offset });
+ },
+
+ ready: function() {
+ var tickCount, tickWidth;
+ tickCount = this.model.revisions.length - 1;
+ tickWidth = 1 / tickCount;
+ this.$el.css('width', ( this.model.revisions.length * 50 ) + 'px');
+
+ _(tickCount).times( function( index ){
+ this.$el.append( '<div style="' + this.direction + ': ' + ( 100 * tickWidth * index ) + '%"></div>' );
+ }, this );
+ }
+ });
+
+ // The metabox view
+ revisions.view.Metabox = wp.Backbone.View.extend({
+ className: 'revisions-meta',
+
+ initialize: function() {
+ // Add the 'from' view
+ this.views.add( new revisions.view.MetaFrom({
+ model: this.model,
+ className: 'diff-meta diff-meta-from'
+ }) );
+
+ // Add the 'to' view
+ this.views.add( new revisions.view.MetaTo({
+ model: this.model
+ }) );
+ }
+ });
+
+ // The revision meta view (to be extended)
+ revisions.view.Meta = wp.Backbone.View.extend({
+ template: wp.template('revisions-meta'),
+
+ events: {
+ 'click .restore-revision': 'restoreRevision'
+ },
+
+ initialize: function() {
+ this.listenTo( this.model, 'update:revisions', this.render );
+ },
+
+ prepare: function() {
+ return _.extend( this.model.toJSON()[this.type] || {}, {
+ type: this.type
+ });
+ },
+
+ restoreRevision: function() {
+ document.location = this.model.get('to').attributes.restoreUrl;
+ }
+ });
+
+ // The revision meta 'from' view
+ revisions.view.MetaFrom = revisions.view.Meta.extend({
+ className: 'diff-meta diff-meta-from',
+ type: 'from'
+ });
+
+ // The revision meta 'to' view
+ revisions.view.MetaTo = revisions.view.Meta.extend({
+ className: 'diff-meta diff-meta-to',
+ type: 'to'
+ });
+
+ // The checkbox view.
+ revisions.view.Checkbox = wp.Backbone.View.extend({
+ className: 'revisions-checkbox',
+ template: wp.template('revisions-checkbox'),
+
+ events: {
+ 'click .compare-two-revisions': 'compareTwoToggle'
+ },
+
+ initialize: function() {
+ this.listenTo( this.model, 'change:compareTwoMode', this.updateCompareTwoMode );
+ },
+
+ ready: function() {
+ if ( this.model.revisions.length < 3 ) {
+ $('.revision-toggle-compare-mode').hide();
+ }
+ },
+
+ updateCompareTwoMode: function() {
+ this.$('.compare-two-revisions').prop( 'checked', this.model.get('compareTwoMode') );
+ },
+
+ // Toggle the compare two mode feature when the compare two checkbox is checked.
+ compareTwoToggle: function() {
+ // Activate compare two mode?
+ this.model.set({ compareTwoMode: $('.compare-two-revisions').prop('checked') });
+ }
+ });
+
+ // The tooltip view.
+ // Encapsulates the tooltip.
+ revisions.view.Tooltip = wp.Backbone.View.extend({
+ className: 'revisions-tooltip',
+ template: wp.template('revisions-meta'),
+
+ initialize: function() {
+ this.listenTo( this.model, 'change:offset', this.render );
+ this.listenTo( this.model, 'change:hovering', this.toggleVisibility );
+ this.listenTo( this.model, 'change:scrubbing', this.toggleVisibility );
+ },
+
+ prepare: function() {
+ if ( _.isNull( this.model.get('revision') ) ) {
+ return;
+ } else {
+ return _.extend( { type: 'tooltip' }, {
+ attributes: this.model.get('revision').toJSON()
+ });
+ }
+ },
+
+ render: function() {
+ var otherDirection,
+ direction,
+ directionVal,
+ flipped,
+ css = {},
+ position = this.model.revisions.indexOf( this.model.get('revision') ) + 1;
+
+ flipped = ( position / this.model.revisions.length ) > 0.5;
+ if ( isRtl ) {
+ direction = flipped ? 'left' : 'right';
+ directionVal = flipped ? 'leftPlusWidth' : direction;
+ } else {
+ direction = flipped ? 'right' : 'left';
+ directionVal = flipped ? 'rightPlusWidth' : direction;
+ }
+ otherDirection = 'right' === direction ? 'left': 'right';
+ wp.Backbone.View.prototype.render.apply( this, arguments );
+ css[direction] = this.model.get('offset')[directionVal] + 'px';
+ css[otherDirection] = '';
+ this.$el.toggleClass( 'flipped', flipped ).css( css );
+ },
+
+ visible: function() {
+ return this.model.get( 'scrubbing' ) || this.model.get( 'hovering' );
+ },
+
+ toggleVisibility: function() {
+ if ( this.visible() ) {
+ this.$el.stop().show().fadeTo( 100 - this.el.style.opacity * 100, 1 );
+ } else {
+ this.$el.stop().fadeTo( this.el.style.opacity * 300, 0, function(){ $(this).hide(); } );
+ }
+ return;
+ }
+ });
+
+ // The buttons view.
+ // Encapsulates all of the configuration for the previous/next buttons.
+ revisions.view.Buttons = wp.Backbone.View.extend({
+ className: 'revisions-buttons',
+ template: wp.template('revisions-buttons'),
+
+ events: {
+ 'click .revisions-next .button': 'nextRevision',
+ 'click .revisions-previous .button': 'previousRevision'
+ },
+
+ initialize: function() {
+ this.listenTo( this.model, 'update:revisions', this.disabledButtonCheck );
+ },
+
+ ready: function() {
+ this.disabledButtonCheck();
+ },
+
+ // Go to a specific model index
+ gotoModel: function( toIndex ) {
+ var attributes = {
+ to: this.model.revisions.at( toIndex )
+ };
+ // If we're at the first revision, unset 'from'.
+ if ( toIndex ) {
+ attributes.from = this.model.revisions.at( toIndex - 1 );
+ } else {
+ this.model.unset('from', { silent: true });
+ }
+
+ this.model.set( attributes );
+ },
+
+ // Go to the 'next' revision
+ nextRevision: function() {
+ var toIndex = this.model.revisions.indexOf( this.model.get('to') ) + 1;
+ this.gotoModel( toIndex );
+ },
+
+ // Go to the 'previous' revision
+ previousRevision: function() {
+ var toIndex = this.model.revisions.indexOf( this.model.get('to') ) - 1;
+ this.gotoModel( toIndex );
+ },
+
+ // Check to see if the Previous or Next buttons need to be disabled or enabled.
+ disabledButtonCheck: function() {
+ var maxVal = this.model.revisions.length - 1,
+ minVal = 0,
+ next = $('.revisions-next .button'),
+ previous = $('.revisions-previous .button'),
+ val = this.model.revisions.indexOf( this.model.get('to') );
+
+ // Disable "Next" button if you're on the last node.
+ next.prop( 'disabled', ( maxVal === val ) );
+
+ // Disable "Previous" button if you're on the first node.
+ previous.prop( 'disabled', ( minVal === val ) );
+ }
+ });
+
+
+ // The slider view.
+ revisions.view.Slider = wp.Backbone.View.extend({
+ className: 'wp-slider',
+ direction: isRtl ? 'right' : 'left',
+
+ events: {
+ 'mousemove' : 'mouseMove'
+ },
+
+ initialize: function() {
+ _.bindAll( this, 'start', 'slide', 'stop', 'mouseMove', 'mouseEnter', 'mouseLeave' );
+ this.listenTo( this.model, 'update:slider', this.applySliderSettings );
+ },
+
+ ready: function() {
+ this.$el.css('width', ( this.model.revisions.length * 50 ) + 'px');
+ this.$el.slider( _.extend( this.model.toJSON(), {
+ start: this.start,
+ slide: this.slide,
+ stop: this.stop
+ }) );
+
+ this.$el.hoverIntent({
+ over: this.mouseEnter,
+ out: this.mouseLeave,
+ timeout: 800
+ });
+
+ this.applySliderSettings();
+ },
+
+ mouseMove: function( e ) {
+ var zoneCount = this.model.revisions.length - 1, // One fewer zone than models
+ sliderFrom = this.$el.allOffsets()[this.direction], // "From" edge of slider
+ sliderWidth = this.$el.width(), // Width of slider
+ tickWidth = sliderWidth / zoneCount, // Calculated width of zone
+ actualX = ( isRtl ? $(window).width() - e.pageX : e.pageX ) - sliderFrom, // Flipped for RTL - sliderFrom;
+ currentModelIndex = Math.floor( ( actualX + ( tickWidth / 2 ) ) / tickWidth ); // Calculate the model index
+
+ // Ensure sane value for currentModelIndex.
+ if ( currentModelIndex < 0 ) {
+ currentModelIndex = 0;
+ } else if ( currentModelIndex >= this.model.revisions.length ) {
+ currentModelIndex = this.model.revisions.length - 1;
+ }
+
+ // Update the tooltip mode
+ this.model.set({ hoveredRevision: this.model.revisions.at( currentModelIndex ) });
+ },
+
+ mouseLeave: function() {
+ this.model.set({ hovering: false });
+ },
+
+ mouseEnter: function() {
+ this.model.set({ hovering: true });
+ },
+
+ applySliderSettings: function() {
+ this.$el.slider( _.pick( this.model.toJSON(), 'value', 'values', 'range' ) );
+ var handles = this.$('a.ui-slider-handle');
+
+ if ( this.model.get('compareTwoMode') ) {
+ // in RTL mode the 'left handle' is the second in the slider, 'right' is first
+ handles.first()
+ .toggleClass( 'to-handle', !! isRtl )
+ .toggleClass( 'from-handle', ! isRtl );
+ handles.last()
+ .toggleClass( 'from-handle', !! isRtl )
+ .toggleClass( 'to-handle', ! isRtl );
+ } else {
+ handles.removeClass('from-handle to-handle');
+ }
+ },
+
+ start: function( event, ui ) {
+ this.model.set({ scrubbing: true });
+
+ // Track the mouse position to enable smooth dragging,
+ // overrides default jQuery UI step behavior.
+ $( window ).on( 'mousemove.wp.revisions', { view: this }, function( e ) {
+ var handles,
+ view = e.data.view,
+ leftDragBoundary = view.$el.offset().left,
+ sliderOffset = leftDragBoundary,
+ sliderRightEdge = leftDragBoundary + view.$el.width(),
+ rightDragBoundary = sliderRightEdge,
+ leftDragReset = '0',
+ rightDragReset = '100%',
+ handle = $( ui.handle );
+
+ // In two handle mode, ensure handles can't be dragged past each other.
+ // Adjust left/right boundaries and reset points.
+ if ( view.model.get('compareTwoMode') ) {
+ handles = handle.parent().find('.ui-slider-handle');
+ if ( handle.is( handles.first() ) ) { // We're the left handle
+ rightDragBoundary = handles.last().offset().left;
+ rightDragReset = rightDragBoundary - sliderOffset;
+ } else { // We're the right handle
+ leftDragBoundary = handles.first().offset().left + handles.first().width();
+ leftDragReset = leftDragBoundary - sliderOffset;
+ }
+ }
+
+ // Follow mouse movements, as long as handle remains inside slider.
+ if ( e.pageX < leftDragBoundary ) {
+ handle.css( 'left', leftDragReset ); // Mouse to left of slider.
+ } else if ( e.pageX > rightDragBoundary ) {
+ handle.css( 'left', rightDragReset ); // Mouse to right of slider.
+ } else {
+ handle.css( 'left', e.pageX - sliderOffset ); // Mouse in slider.
+ }
+ } );
+ },
+
+ getPosition: function( position ) {
+ return isRtl ? this.model.revisions.length - position - 1: position;
+ },
+
+ // Responds to slide events
+ slide: function( event, ui ) {
+ var attributes, movedRevision;
+ // Compare two revisions mode
+ if ( this.model.get('compareTwoMode') ) {
+ // Prevent sliders from occupying same spot
+ if ( ui.values[1] === ui.values[0] ) {
+ return false;
+ }
+ if ( isRtl ) {
+ ui.values.reverse();
+ }
+ attributes = {
+ from: this.model.revisions.at( this.getPosition( ui.values[0] ) ),
+ to: this.model.revisions.at( this.getPosition( ui.values[1] ) )
+ };
+ } else {
+ attributes = {
+ to: this.model.revisions.at( this.getPosition( ui.value ) )
+ };
+ // If we're at the first revision, unset 'from'.
+ if ( this.getPosition( ui.value ) > 0 ) {
+ attributes.from = this.model.revisions.at( this.getPosition( ui.value ) - 1 );
+ } else {
+ attributes.from = undefined;
+ }
+ }
+ movedRevision = this.model.revisions.at( this.getPosition( ui.value ) );
+
+ // If we are scrubbing, a scrub to a revision is considered a hover
+ if ( this.model.get('scrubbing') ) {
+ attributes.hoveredRevision = movedRevision;
+ }
+
+ this.model.set( attributes );
+ },
+
+ stop: function() {
+ $( window ).off('mousemove.wp.revisions');
+ this.model.updateSliderSettings(); // To snap us back to a tick mark
+ this.model.set({ scrubbing: false });
+ }
+ });
+
+ // The diff view.
+ // This is the view for the current active diff.
+ revisions.view.Diff = wp.Backbone.View.extend({
+ className: 'revisions-diff',
+ template: wp.template('revisions-diff'),
+
+ // Generate the options to be passed to the template.
+ prepare: function() {
+ return _.extend({ fields: this.model.fields.toJSON() }, this.options );
+ }
+ });
+
+ // The revisions router.
+ // Maintains the URL routes so browser URL matches state.
+ revisions.Router = Backbone.Router.extend({
+ initialize: function( options ) {
+ this.model = options.model;
+
+ // Maintain state and history when navigating
+ this.listenTo( this.model, 'update:diff', _.debounce( this.updateUrl, 250 ) );
+ this.listenTo( this.model, 'change:compareTwoMode', this.updateUrl );
+ },
+
+ baseUrl: function( url ) {
+ return this.model.get('baseUrl') + url;
+ },
+
+ updateUrl: function() {
+ var from = this.model.has('from') ? this.model.get('from').id : 0,
+ to = this.model.get('to').id;
+ if ( this.model.get('compareTwoMode' ) ) {
+ this.navigate( this.baseUrl( '?from=' + from + '&to=' + to ), { replace: true } );
+ } else {
+ this.navigate( this.baseUrl( '?revision=' + to ), { replace: true } );
+ }
+ },
+
+ handleRoute: function( a, b ) {
+ var compareTwo = _.isUndefined( b );
+
+ if ( ! compareTwo ) {
+ b = this.model.revisions.get( a );
+ a = this.model.revisions.prev( b );
+ b = b ? b.id : 0;
+ a = a ? a.id : 0;
+ }
+ }
+ });
+
+ /**
+ * Initialize the revisions UI for revision.php.
+ */
+ revisions.init = function() {
+ var state;
+
+ // Bail if the current page is not revision.php.
+ if ( ! window.adminpage || 'revision-php' !== window.adminpage ) {
+ return;
+ }
+
+ state = new revisions.model.FrameState({
+ initialDiffState: {
+ // wp_localize_script doesn't stringifies ints, so cast them.
+ to: parseInt( revisions.settings.to, 10 ),
+ from: parseInt( revisions.settings.from, 10 ),
+ // wp_localize_script does not allow for top-level booleans so do a comparator here.
+ compareTwoMode: ( revisions.settings.compareTwoMode === '1' )
+ },
+ diffData: revisions.settings.diffData,
+ baseUrl: revisions.settings.baseUrl,
+ postId: parseInt( revisions.settings.postId, 10 )
+ }, {
+ revisions: new revisions.model.Revisions( revisions.settings.revisionData )
+ });
+
+ revisions.view.frame = new revisions.view.Frame({
+ model: state
+ }).render();
+ };
+
+ $( revisions.init );
+}(jQuery));
diff --git a/www/crm/wp-admin/js/revisions.min.js b/www/crm/wp-admin/js/revisions.min.js
new file mode 100644
index 00000000..48a6110c
--- /dev/null
+++ b/www/crm/wp-admin/js/revisions.min.js
@@ -0,0 +1 @@
+window.wp=window.wp||{},function(a){var b;b=wp.revisions={model:{},view:{},controller:{}},b.settings=window._wpRevisionsSettings||{},b.debug=!1,b.log=function(){window.console&&b.debug&&window.console.log.apply(window.console,arguments)},a.fn.allOffsets=function(){var b=this.offset()||{top:0,left:0},c=a(window);return _.extend(b,{right:c.width()-b.left-this.outerWidth(),bottom:c.height()-b.top-this.outerHeight()})},a.fn.allPositions=function(){var a=this.position()||{top:0,left:0},b=this.parent();return _.extend(a,{right:b.outerWidth()-a.left-this.outerWidth(),bottom:b.outerHeight()-a.top-this.outerHeight()})},b.model.Slider=Backbone.Model.extend({defaults:{value:null,values:null,min:0,max:1,step:1,range:!1,compareTwoMode:!1},initialize:function(a){this.frame=a.frame,this.revisions=a.revisions,this.listenTo(this.frame,"update:revisions",this.receiveRevisions),this.listenTo(this.frame,"change:compareTwoMode",this.updateMode),this.on("change:from",this.handleLocalChanges),this.on("change:to",this.handleLocalChanges),this.on("change:compareTwoMode",this.updateSliderSettings),this.on("update:revisions",this.updateSliderSettings),this.on("change:hoveredRevision",this.hoverRevision),this.set({max:this.revisions.length-1,compareTwoMode:this.frame.get("compareTwoMode"),from:this.frame.get("from"),to:this.frame.get("to")}),this.updateSliderSettings()},getSliderValue:function(a,b){return isRtl?this.revisions.length-this.revisions.indexOf(this.get(a))-1:this.revisions.indexOf(this.get(b))},updateSliderSettings:function(){this.get("compareTwoMode")?this.set({values:[this.getSliderValue("to","from"),this.getSliderValue("from","to")],value:null,range:!0}):this.set({value:this.getSliderValue("to","to"),values:null,range:!1}),this.trigger("update:slider")},hoverRevision:function(a,b){this.trigger("hovered:revision",b)},updateMode:function(a,b){this.set({compareTwoMode:b})},handleLocalChanges:function(){this.frame.set({from:this.get("from"),to:this.get("to")})},receiveRevisions:function(a,b){this.get("from")===a&&this.get("to")===b||(this.set({from:a,to:b},{silent:!0}),this.trigger("update:revisions",a,b))}}),b.model.Tooltip=Backbone.Model.extend({defaults:{revision:null,offset:{},hovering:!1,scrubbing:!1},initialize:function(a){this.frame=a.frame,this.revisions=a.revisions,this.slider=a.slider,this.listenTo(this.slider,"hovered:revision",this.updateRevision),this.listenTo(this.slider,"change:hovering",this.setHovering),this.listenTo(this.slider,"change:scrubbing",this.setScrubbing)},updateRevision:function(a){this.set({revision:a})},setHovering:function(a,b){this.set({hovering:b})},setScrubbing:function(a,b){this.set({scrubbing:b})}}),b.model.Revision=Backbone.Model.extend({}),b.model.Revisions=Backbone.Collection.extend({model:b.model.Revision,initialize:function(){_.bindAll(this,"next","prev")},next:function(a){var b=this.indexOf(a);if(b!==-1&&b!==this.length-1)return this.at(b+1)},prev:function(a){var b=this.indexOf(a);if(b!==-1&&0!==b)return this.at(b-1)}}),b.model.Field=Backbone.Model.extend({}),b.model.Fields=Backbone.Collection.extend({model:b.model.Field}),b.model.Diff=Backbone.Model.extend({initialize:function(){var a=this.get("fields");this.unset("fields"),this.fields=new b.model.Fields(a)}}),b.model.Diffs=Backbone.Collection.extend({initialize:function(a,b){_.bindAll(this,"getClosestUnloaded"),this.loadAll=_.once(this._loadAll),this.revisions=b.revisions,this.postId=b.postId,this.requests={}},model:b.model.Diff,ensure:function(b,c){var d=this.get(b),e=this.requests[b],f=a.Deferred(),g={},h=b.split(":")[0],i=b.split(":")[1];return g[b]=!0,wp.revisions.log("ensure",b),this.trigger("ensure",g,h,i,f.promise()),d?f.resolveWith(c,[d]):(this.trigger("ensure:load",g,h,i,f.promise()),_.each(g,_.bind(function(a){this.requests[a]&&delete g[a],this.get(a)&&delete g[a]},this)),e||(g[b]=!0,e=this.load(_.keys(g))),e.done(_.bind(function(){f.resolveWith(c,[this.get(b)])},this)).fail(_.bind(function(){f.reject()}))),f.promise()},getClosestUnloaded:function(a,b){var c=this;return _.chain([0].concat(a)).initial().zip(a).sortBy(function(a){return Math.abs(b-a[1])}).map(function(a){return a.join(":")}).filter(function(a){return _.isUndefined(c.get(a))&&!c.requests[a]}).value()},_loadAll:function(b,c,d){var e=this,f=a.Deferred(),g=_.first(this.getClosestUnloaded(b,c),d);return _.size(g)>0?this.load(g).done(function(){e._loadAll(b,c,d).done(function(){f.resolve()})}).fail(function(){1===d?f.reject():e._loadAll(b,c,Math.ceil(d/2)).done(function(){f.resolve()})}):f.resolve(),f},load:function(a){return wp.revisions.log("load",a),this.fetch({data:{compare:a},remove:!1}).done(function(){wp.revisions.log("load:complete",a)})},sync:function(a,b,c){if("read"===a){c=c||{},c.context=this,c.data=_.extend(c.data||{},{action:"get-revision-diffs",post_id:this.postId});var d=wp.ajax.send(c),e=this.requests;return c.data.compare&&_.each(c.data.compare,function(a){e[a]=d}),d.always(function(){c.data.compare&&_.each(c.data.compare,function(a){delete e[a]})}),d}return Backbone.Model.prototype.sync.apply(this,arguments)}}),b.model.FrameState=Backbone.Model.extend({defaults:{loading:!1,error:!1,compareTwoMode:!1},initialize:function(a,c){var d=this.get("initialDiffState");_.bindAll(this,"receiveDiff"),this._debouncedEnsureDiff=_.debounce(this._ensureDiff,200),this.revisions=c.revisions,this.diffs=new b.model.Diffs([],{revisions:this.revisions,postId:this.get("postId")}),this.diffs.set(this.get("diffData")),this.listenTo(this,"change:from",this.changeRevisionHandler),this.listenTo(this,"change:to",this.changeRevisionHandler),this.listenTo(this,"change:compareTwoMode",this.changeMode),this.listenTo(this,"update:revisions",this.updatedRevisions),this.listenTo(this.diffs,"ensure:load",this.updateLoadingStatus),this.listenTo(this,"update:diff",this.updateLoadingStatus),this.set({to:this.revisions.get(d.to),from:this.revisions.get(d.from),compareTwoMode:d.compareTwoMode}),window.history&&window.history.pushState&&(this.router=new b.Router({model:this}),Backbone.History.started&&Backbone.history.stop(),Backbone.history.start({pushState:!0}))},updateLoadingStatus:function(){this.set("error",!1),this.set("loading",!this.diff())},changeMode:function(a,b){var c=this.revisions.indexOf(this.get("to"));b&&0===c&&this.set({from:this.revisions.at(c),to:this.revisions.at(c+1)}),b||0===c||this.set({from:this.revisions.at(c-1),to:this.revisions.at(c)})},updatedRevisions:function(a,b){this.get("compareTwoMode")||this.diffs.loadAll(this.revisions.pluck("id"),b.id,40)},diff:function(){return this.diffs.get(this._diffId)},updateDiff:function(b){var c,d,e,f;return b=b||{},c=this.get("from"),d=this.get("to"),e=(c?c.id:0)+":"+d.id,this._diffId===e?a.Deferred().reject().promise():(this._diffId=e,this.trigger("update:revisions",c,d),f=this.diffs.get(e),f?(this.receiveDiff(f),a.Deferred().resolve().promise()):b.immediate?this._ensureDiff():(this._debouncedEnsureDiff(),a.Deferred().reject().promise()))},changeRevisionHandler:function(){this.updateDiff()},receiveDiff:function(a){_.isUndefined(a)||_.isUndefined(a.id)?this.set({loading:!1,error:!0}):this._diffId===a.id&&this.trigger("update:diff",a)},_ensureDiff:function(){return this.diffs.ensure(this._diffId,this).always(this.receiveDiff)}}),b.view.Frame=wp.Backbone.View.extend({className:"revisions",template:wp.template("revisions-frame"),initialize:function(){this.listenTo(this.model,"update:diff",this.renderDiff),this.listenTo(this.model,"change:compareTwoMode",this.updateCompareTwoMode),this.listenTo(this.model,"change:loading",this.updateLoadingStatus),this.listenTo(this.model,"change:error",this.updateErrorStatus),this.views.set(".revisions-control-frame",new b.view.Controls({model:this.model}))},render:function(){return wp.Backbone.View.prototype.render.apply(this,arguments),a("html").css("overflow-y","scroll"),a("#wpbody-content .wrap").append(this.el),this.updateCompareTwoMode(),this.renderDiff(this.model.diff()),this.views.ready(),this},renderDiff:function(a){this.views.set(".revisions-diff-frame",new b.view.Diff({model:a}))},updateLoadingStatus:function(){this.$el.toggleClass("loading",this.model.get("loading"))},updateErrorStatus:function(){this.$el.toggleClass("diff-error",this.model.get("error"))},updateCompareTwoMode:function(){this.$el.toggleClass("comparing-two-revisions",this.model.get("compareTwoMode"))}}),b.view.Controls=wp.Backbone.View.extend({className:"revisions-controls",initialize:function(){_.bindAll(this,"setWidth"),this.views.add(new b.view.Buttons({model:this.model})),this.views.add(new b.view.Checkbox({model:this.model}));var a=new b.model.Slider({frame:this.model,revisions:this.model.revisions}),c=new b.model.Tooltip({frame:this.model,revisions:this.model.revisions,slider:a});this.views.add(new b.view.Tooltip({model:c})),this.views.add(new b.view.Tickmarks({model:c})),this.views.add(new b.view.Slider({model:a})),this.views.add(new b.view.Metabox({model:this.model}))},ready:function(){this.top=this.$el.offset().top,this.window=a(window),this.window.on("scroll.wp.revisions",{controls:this},function(a){var b=a.data.controls,c=b.$el.parent(),d=b.window.scrollTop(),e=b.views.parent;d>=b.top?(e.$el.hasClass("pinned")||(b.setWidth(),c.css("height",c.height()+"px"),b.window.on("resize.wp.revisions.pinning click.wp.revisions.pinning",{controls:b},function(a){a.data.controls.setWidth()})),e.$el.addClass("pinned")):e.$el.hasClass("pinned")?(b.window.off(".wp.revisions.pinning"),b.$el.css("width","auto"),e.$el.removeClass("pinned"),c.css("height","auto"),b.top=b.$el.offset().top):b.top=b.$el.offset().top})},setWidth:function(){this.$el.css("width",this.$el.parent().width()+"px")}}),b.view.Tickmarks=wp.Backbone.View.extend({className:"revisions-tickmarks",direction:isRtl?"right":"left",initialize:function(){this.listenTo(this.model,"change:revision",this.reportTickPosition)},reportTickPosition:function(a,b){var c,d,e,f,g=this.model.revisions.indexOf(b);d=this.$el.allOffsets(),e=this.$el.parent().allOffsets(),g===this.model.revisions.length-1?c={rightPlusWidth:d.left-e.left+1,leftPlusWidth:d.right-e.right+1}:(f=this.$("div:nth-of-type("+(g+1)+")"),c=f.allPositions(),_.extend(c,{left:c.left+d.left-e.left,right:c.right+d.right-e.right}),_.extend(c,{leftPlusWidth:c.left+f.outerWidth(),rightPlusWidth:c.right+f.outerWidth()})),this.model.set({offset:c})},ready:function(){var a,b;a=this.model.revisions.length-1,b=1/a,this.$el.css("width",50*this.model.revisions.length+"px"),_(a).times(function(a){this.$el.append('<div style="'+this.direction+": "+100*b*a+'%"></div>')},this)}}),b.view.Metabox=wp.Backbone.View.extend({className:"revisions-meta",initialize:function(){this.views.add(new b.view.MetaFrom({model:this.model,className:"diff-meta diff-meta-from"})),this.views.add(new b.view.MetaTo({model:this.model}))}}),b.view.Meta=wp.Backbone.View.extend({template:wp.template("revisions-meta"),events:{"click .restore-revision":"restoreRevision"},initialize:function(){this.listenTo(this.model,"update:revisions",this.render)},prepare:function(){return _.extend(this.model.toJSON()[this.type]||{},{type:this.type})},restoreRevision:function(){document.location=this.model.get("to").attributes.restoreUrl}}),b.view.MetaFrom=b.view.Meta.extend({className:"diff-meta diff-meta-from",type:"from"}),b.view.MetaTo=b.view.Meta.extend({className:"diff-meta diff-meta-to",type:"to"}),b.view.Checkbox=wp.Backbone.View.extend({className:"revisions-checkbox",template:wp.template("revisions-checkbox"),events:{"click .compare-two-revisions":"compareTwoToggle"},initialize:function(){this.listenTo(this.model,"change:compareTwoMode",this.updateCompareTwoMode)},ready:function(){this.model.revisions.length<3&&a(".revision-toggle-compare-mode").hide()},updateCompareTwoMode:function(){this.$(".compare-two-revisions").prop("checked",this.model.get("compareTwoMode"))},compareTwoToggle:function(){this.model.set({compareTwoMode:a(".compare-two-revisions").prop("checked")})}}),b.view.Tooltip=wp.Backbone.View.extend({className:"revisions-tooltip",template:wp.template("revisions-meta"),initialize:function(){this.listenTo(this.model,"change:offset",this.render),this.listenTo(this.model,"change:hovering",this.toggleVisibility),this.listenTo(this.model,"change:scrubbing",this.toggleVisibility)},prepare:function(){return _.isNull(this.model.get("revision"))?void 0:_.extend({type:"tooltip"},{attributes:this.model.get("revision").toJSON()})},render:function(){var a,b,c,d,e={},f=this.model.revisions.indexOf(this.model.get("revision"))+1;d=f/this.model.revisions.length>.5,isRtl?(b=d?"left":"right",c=d?"leftPlusWidth":b):(b=d?"right":"left",c=d?"rightPlusWidth":b),a="right"===b?"left":"right",wp.Backbone.View.prototype.render.apply(this,arguments),e[b]=this.model.get("offset")[c]+"px",e[a]="",this.$el.toggleClass("flipped",d).css(e)},visible:function(){return this.model.get("scrubbing")||this.model.get("hovering")},toggleVisibility:function(){this.visible()?this.$el.stop().show().fadeTo(100-100*this.el.style.opacity,1):this.$el.stop().fadeTo(300*this.el.style.opacity,0,function(){a(this).hide()})}}),b.view.Buttons=wp.Backbone.View.extend({className:"revisions-buttons",template:wp.template("revisions-buttons"),events:{"click .revisions-next .button":"nextRevision","click .revisions-previous .button":"previousRevision"},initialize:function(){this.listenTo(this.model,"update:revisions",this.disabledButtonCheck)},ready:function(){this.disabledButtonCheck()},gotoModel:function(a){var b={to:this.model.revisions.at(a)};a?b.from=this.model.revisions.at(a-1):this.model.unset("from",{silent:!0}),this.model.set(b)},nextRevision:function(){var a=this.model.revisions.indexOf(this.model.get("to"))+1;this.gotoModel(a)},previousRevision:function(){var a=this.model.revisions.indexOf(this.model.get("to"))-1;this.gotoModel(a)},disabledButtonCheck:function(){var b=this.model.revisions.length-1,c=0,d=a(".revisions-next .button"),e=a(".revisions-previous .button"),f=this.model.revisions.indexOf(this.model.get("to"));d.prop("disabled",b===f),e.prop("disabled",c===f)}}),b.view.Slider=wp.Backbone.View.extend({className:"wp-slider",direction:isRtl?"right":"left",events:{mousemove:"mouseMove"},initialize:function(){_.bindAll(this,"start","slide","stop","mouseMove","mouseEnter","mouseLeave"),this.listenTo(this.model,"update:slider",this.applySliderSettings)},ready:function(){this.$el.css("width",50*this.model.revisions.length+"px"),this.$el.slider(_.extend(this.model.toJSON(),{start:this.start,slide:this.slide,stop:this.stop})),this.$el.hoverIntent({over:this.mouseEnter,out:this.mouseLeave,timeout:800}),this.applySliderSettings()},mouseMove:function(b){var c=this.model.revisions.length-1,d=this.$el.allOffsets()[this.direction],e=this.$el.width(),f=e/c,g=(isRtl?a(window).width()-b.pageX:b.pageX)-d,h=Math.floor((g+f/2)/f);h<0?h=0:h>=this.model.revisions.length&&(h=this.model.revisions.length-1),this.model.set({hoveredRevision:this.model.revisions.at(h)})},mouseLeave:function(){this.model.set({hovering:!1})},mouseEnter:function(){this.model.set({hovering:!0})},applySliderSettings:function(){this.$el.slider(_.pick(this.model.toJSON(),"value","values","range"));var a=this.$("a.ui-slider-handle");this.model.get("compareTwoMode")?(a.first().toggleClass("to-handle",!!isRtl).toggleClass("from-handle",!isRtl),a.last().toggleClass("from-handle",!!isRtl).toggleClass("to-handle",!isRtl)):a.removeClass("from-handle to-handle")},start:function(b,c){this.model.set({scrubbing:!0}),a(window).on("mousemove.wp.revisions",{view:this},function(b){var d,e=b.data.view,f=e.$el.offset().left,g=f,h=f+e.$el.width(),i=h,j="0",k="100%",l=a(c.handle);e.model.get("compareTwoMode")&&(d=l.parent().find(".ui-slider-handle"),l.is(d.first())?(i=d.last().offset().left,k=i-g):(f=d.first().offset().left+d.first().width(),j=f-g)),b.pageX<f?l.css("left",j):b.pageX>i?l.css("left",k):l.css("left",b.pageX-g)})},getPosition:function(a){return isRtl?this.model.revisions.length-a-1:a},slide:function(a,b){var c,d;if(this.model.get("compareTwoMode")){if(b.values[1]===b.values[0])return!1;isRtl&&b.values.reverse(),c={from:this.model.revisions.at(this.getPosition(b.values[0])),to:this.model.revisions.at(this.getPosition(b.values[1]))}}else c={to:this.model.revisions.at(this.getPosition(b.value))},this.getPosition(b.value)>0?c.from=this.model.revisions.at(this.getPosition(b.value)-1):c.from=void 0;d=this.model.revisions.at(this.getPosition(b.value)),this.model.get("scrubbing")&&(c.hoveredRevision=d),this.model.set(c)},stop:function(){a(window).off("mousemove.wp.revisions"),this.model.updateSliderSettings(),this.model.set({scrubbing:!1})}}),b.view.Diff=wp.Backbone.View.extend({className:"revisions-diff",template:wp.template("revisions-diff"),prepare:function(){return _.extend({fields:this.model.fields.toJSON()},this.options)}}),b.Router=Backbone.Router.extend({initialize:function(a){this.model=a.model,this.listenTo(this.model,"update:diff",_.debounce(this.updateUrl,250)),this.listenTo(this.model,"change:compareTwoMode",this.updateUrl)},baseUrl:function(a){return this.model.get("baseUrl")+a},updateUrl:function(){var a=this.model.has("from")?this.model.get("from").id:0,b=this.model.get("to").id;this.model.get("compareTwoMode")?this.navigate(this.baseUrl("?from="+a+"&to="+b),{replace:!0}):this.navigate(this.baseUrl("?revision="+b),{replace:!0})},handleRoute:function(a,b){var c=_.isUndefined(b);c||(b=this.model.revisions.get(a),a=this.model.revisions.prev(b),b=b?b.id:0,a=a?a.id:0)}}),b.init=function(){var a;window.adminpage&&"revision-php"===window.adminpage&&(a=new b.model.FrameState({initialDiffState:{to:parseInt(b.settings.to,10),from:parseInt(b.settings.from,10),compareTwoMode:"1"===b.settings.compareTwoMode},diffData:b.settings.diffData,baseUrl:b.settings.baseUrl,postId:parseInt(b.settings.postId,10)},{revisions:new b.model.Revisions(b.settings.revisionData)}),b.view.frame=new b.view.Frame({model:a}).render())},a(b.init)}(jQuery); \ No newline at end of file
diff --git a/www/crm/wp-admin/js/set-post-thumbnail.js b/www/crm/wp-admin/js/set-post-thumbnail.js
new file mode 100644
index 00000000..0f3849af
--- /dev/null
+++ b/www/crm/wp-admin/js/set-post-thumbnail.js
@@ -0,0 +1,28 @@
+/**
+ * @output wp-admin/js/set-post-thumbnail.js
+ */
+
+/* global setPostThumbnailL10n, ajaxurl, post_id, alert */
+/* exported WPSetAsThumbnail */
+
+window.WPSetAsThumbnail = function( id, nonce ) {
+ var $link = jQuery('a#wp-post-thumbnail-' + id);
+
+ $link.text( setPostThumbnailL10n.saving );
+ jQuery.post(ajaxurl, {
+ action: 'set-post-thumbnail', post_id: post_id, thumbnail_id: id, _ajax_nonce: nonce, cookie: encodeURIComponent( document.cookie )
+ }, function(str){
+ var win = window.dialogArguments || opener || parent || top;
+ $link.text( setPostThumbnailL10n.setThumbnail );
+ if ( str == '0' ) {
+ alert( setPostThumbnailL10n.error );
+ } else {
+ jQuery('a.wp-post-thumbnail').show();
+ $link.text( setPostThumbnailL10n.done );
+ $link.fadeOut( 2000 );
+ win.WPSetThumbnailID(id);
+ win.WPSetThumbnailHTML(str);
+ }
+ }
+ );
+};
diff --git a/www/crm/wp-admin/js/set-post-thumbnail.min.js b/www/crm/wp-admin/js/set-post-thumbnail.min.js
new file mode 100644
index 00000000..a45957b2
--- /dev/null
+++ b/www/crm/wp-admin/js/set-post-thumbnail.min.js
@@ -0,0 +1 @@
+window.WPSetAsThumbnail=function(a,b){var c=jQuery("a#wp-post-thumbnail-"+a);c.text(setPostThumbnailL10n.saving),jQuery.post(ajaxurl,{action:"set-post-thumbnail",post_id:post_id,thumbnail_id:a,_ajax_nonce:b,cookie:encodeURIComponent(document.cookie)},function(b){var d=window.dialogArguments||opener||parent||top;c.text(setPostThumbnailL10n.setThumbnail),"0"==b?alert(setPostThumbnailL10n.error):(jQuery("a.wp-post-thumbnail").show(),c.text(setPostThumbnailL10n.done),c.fadeOut(2e3),d.WPSetThumbnailID(a),d.WPSetThumbnailHTML(b))})}; \ No newline at end of file
diff --git a/www/crm/wp-admin/js/site-health.js b/www/crm/wp-admin/js/site-health.js
new file mode 100644
index 00000000..a8aa67b7
--- /dev/null
+++ b/www/crm/wp-admin/js/site-health.js
@@ -0,0 +1,316 @@
+/**
+ * Interactions used by the Site Health modules in WordPress.
+ *
+ * @output wp-admin/js/site-health.js
+ */
+
+/* global ajaxurl, ClipboardJS, SiteHealth, wp */
+
+jQuery( document ).ready( function( $ ) {
+
+ var __ = wp.i18n.__,
+ _n = wp.i18n._n,
+ sprintf = wp.i18n.sprintf;
+
+ var data;
+ var clipboard = new ClipboardJS( '.site-health-copy-buttons .copy-button' );
+ var isDebugTab = $( '.health-check-body.health-check-debug-tab' ).length;
+ var pathsSizesSection = $( '#health-check-accordion-block-wp-paths-sizes' );
+
+ // Debug information copy section.
+ clipboard.on( 'success', function( e ) {
+ var $wrapper = $( e.trigger ).closest( 'div' );
+ $( '.success', $wrapper ).addClass( 'visible' );
+
+ wp.a11y.speak( __( 'Site information has been added to your clipboard.' ) );
+ } );
+
+ // Accordion handling in various areas.
+ $( '.health-check-accordion' ).on( 'click', '.health-check-accordion-trigger', function() {
+ var isExpanded = ( 'true' === $( this ).attr( 'aria-expanded' ) );
+
+ if ( isExpanded ) {
+ $( this ).attr( 'aria-expanded', 'false' );
+ $( '#' + $( this ).attr( 'aria-controls' ) ).attr( 'hidden', true );
+ } else {
+ $( this ).attr( 'aria-expanded', 'true' );
+ $( '#' + $( this ).attr( 'aria-controls' ) ).attr( 'hidden', false );
+ }
+ } );
+
+ // Site Health test handling.
+
+ $( '.site-health-view-passed' ).on( 'click', function() {
+ var goodIssuesWrapper = $( '#health-check-issues-good' );
+
+ goodIssuesWrapper.toggleClass( 'hidden' );
+ $( this ).attr( 'aria-expanded', ! goodIssuesWrapper.hasClass( 'hidden' ) );
+ } );
+
+ /**
+ * Append a new issue to the issue list.
+ *
+ * @since 5.2.0
+ *
+ * @param {Object} issue The issue data.
+ */
+ function AppendIssue( issue ) {
+ var template = wp.template( 'health-check-issue' ),
+ issueWrapper = $( '#health-check-issues-' + issue.status ),
+ heading,
+ count;
+
+ SiteHealth.site_status.issues[ issue.status ]++;
+
+ count = SiteHealth.site_status.issues[ issue.status ];
+
+ if ( 'critical' === issue.status ) {
+ heading = sprintf( _n( '%s Critical issue', '%s Critical issues', count ), '<span class="issue-count">' + count + '</span>' );
+ } else if ( 'recommended' === issue.status ) {
+ heading = sprintf( _n( '%s Recommended improvement', '%s Recommended improvements', count ), '<span class="issue-count">' + count + '</span>' );
+ } else if ( 'good' === issue.status ) {
+ heading = sprintf( _n( '%s Item with no issues detected', '%s Items with no issues detected', count ), '<span class="issue-count">' + count + '</span>' );
+ }
+
+ if ( heading ) {
+ $( '.site-health-issue-count-title', issueWrapper ).html( heading );
+ }
+
+ $( '.issues', '#health-check-issues-' + issue.status ).append( template( issue ) );
+ }
+
+ /**
+ * Update site health status indicator as asynchronous tests are run and returned.
+ *
+ * @since 5.2.0
+ */
+ function RecalculateProgression() {
+ var r, c, pct;
+ var $progress = $( '.site-health-progress' );
+ var $progressCount = $progress.find( '.site-health-progress-count' );
+ var $circle = $( '.site-health-progress svg #bar' );
+ var totalTests = parseInt( SiteHealth.site_status.issues.good, 0 ) + parseInt( SiteHealth.site_status.issues.recommended, 0 ) + ( parseInt( SiteHealth.site_status.issues.critical, 0 ) * 1.5 );
+ var failedTests = parseInt( SiteHealth.site_status.issues.recommended, 0 ) + ( parseInt( SiteHealth.site_status.issues.critical, 0 ) * 1.5 );
+ var val = 100 - Math.ceil( ( failedTests / totalTests ) * 100 );
+
+ if ( 0 === totalTests ) {
+ $progress.addClass( 'hidden' );
+ return;
+ }
+
+ $progress.removeClass( 'loading' );
+
+ r = $circle.attr( 'r' );
+ c = Math.PI * ( r * 2 );
+
+ if ( 0 > val ) {
+ val = 0;
+ }
+ if ( 100 < val ) {
+ val = 100;
+ }
+
+ pct = ( ( 100 - val ) / 100 ) * c;
+
+ $circle.css( { strokeDashoffset: pct } );
+
+ if ( 1 > parseInt( SiteHealth.site_status.issues.critical, 0 ) ) {
+ $( '#health-check-issues-critical' ).addClass( 'hidden' );
+ }
+
+ if ( 1 > parseInt( SiteHealth.site_status.issues.recommended, 0 ) ) {
+ $( '#health-check-issues-recommended' ).addClass( 'hidden' );
+ }
+
+ if ( 50 <= val ) {
+ $circle.addClass( 'orange' ).removeClass( 'red' );
+ }
+
+ if ( 90 <= val ) {
+ $circle.addClass( 'green' ).removeClass( 'orange' );
+ }
+
+ if ( 100 === val ) {
+ $( '.site-status-all-clear' ).removeClass( 'hide' );
+ $( '.site-status-has-issues' ).addClass( 'hide' );
+ }
+
+ $progressCount.text( val + '%' );
+
+ if ( ! isDebugTab ) {
+ $.post(
+ ajaxurl,
+ {
+ 'action': 'health-check-site-status-result',
+ '_wpnonce': SiteHealth.nonce.site_status_result,
+ 'counts': SiteHealth.site_status.issues
+ }
+ );
+
+ wp.a11y.speak( sprintf(
+ // translators: %s: The percentage score for the tests.
+ __( 'All site health tests have finished running. Your site scored %s, and the results are now available on the page.' ),
+ val + '%'
+ ) );
+ }
+ }
+
+ /**
+ * Queue the next asynchronous test when we're ready to run it.
+ *
+ * @since 5.2.0
+ */
+ function maybeRunNextAsyncTest() {
+ var doCalculation = true;
+
+ if ( 1 <= SiteHealth.site_status.async.length ) {
+ $.each( SiteHealth.site_status.async, function() {
+ var data = {
+ 'action': 'health-check-' + this.test.replace( '_', '-' ),
+ '_wpnonce': SiteHealth.nonce.site_status
+ };
+
+ if ( this.completed ) {
+ return true;
+ }
+
+ doCalculation = false;
+
+ this.completed = true;
+
+ $.post(
+ ajaxurl,
+ data,
+ function( response ) {
+ AppendIssue( response.data );
+ maybeRunNextAsyncTest();
+ }
+ );
+
+ return false;
+ } );
+ }
+
+ if ( doCalculation ) {
+ RecalculateProgression();
+ }
+ }
+
+ if ( 'undefined' !== typeof SiteHealth && ! isDebugTab ) {
+ if ( 0 === SiteHealth.site_status.direct.length && 0 === SiteHealth.site_status.async.length ) {
+ RecalculateProgression();
+ } else {
+ SiteHealth.site_status.issues = {
+ 'good': 0,
+ 'recommended': 0,
+ 'critical': 0
+ };
+ }
+
+ if ( 0 < SiteHealth.site_status.direct.length ) {
+ $.each( SiteHealth.site_status.direct, function() {
+ AppendIssue( this );
+ } );
+ }
+
+ if ( 0 < SiteHealth.site_status.async.length ) {
+ data = {
+ 'action': 'health-check-' + SiteHealth.site_status.async[0].test.replace( '_', '-' ),
+ '_wpnonce': SiteHealth.nonce.site_status
+ };
+
+ SiteHealth.site_status.async[0].completed = true;
+
+ $.post(
+ ajaxurl,
+ data,
+ function( response ) {
+ AppendIssue( response.data );
+ maybeRunNextAsyncTest();
+ }
+ );
+ } else {
+ RecalculateProgression();
+ }
+ }
+
+ function getDirectorySizes() {
+ var data = {
+ action: 'health-check-get-sizes',
+ _wpnonce: SiteHealth.nonce.site_status_result
+ };
+
+ var timestamp = ( new Date().getTime() );
+
+ // After 3 seconds announce that we're still waiting for directory sizes.
+ var timeout = window.setTimeout( function() {
+ wp.a11y.speak( __( 'Please wait...' ) );
+ }, 3000 );
+
+ $.post( {
+ type: 'POST',
+ url: ajaxurl,
+ data: data,
+ dataType: 'json'
+ } ).done( function( response ) {
+ updateDirSizes( response.data || {} );
+ } ).always( function() {
+ var delay = ( new Date().getTime() ) - timestamp;
+
+ $( '.health-check-wp-paths-sizes.spinner' ).css( 'visibility', 'hidden' );
+ RecalculateProgression();
+
+ if ( delay > 3000 ) {
+ // We have announced that we're waiting.
+ // Announce that we're ready after giving at least 3 seconds for the first announcement
+ // to be read out, or the two may collide.
+ if ( delay > 6000 ) {
+ delay = 0;
+ } else {
+ delay = 6500 - delay;
+ }
+
+ window.setTimeout( function() {
+ wp.a11y.speak( __( 'All site health tests have finished running.' ) );
+ }, delay );
+ } else {
+ // Cancel the announcement.
+ window.clearTimeout( timeout );
+ }
+
+ $( document ).trigger( 'site-health-info-dirsizes-done' );
+ } );
+ }
+
+ function updateDirSizes( data ) {
+ var copyButton = $( 'button.button.copy-button' );
+ var clipdoardText = copyButton.attr( 'data-clipboard-text' );
+
+ $.each( data, function( name, value ) {
+ var text = value.debug || value.size;
+
+ if ( typeof text !== 'undefined' ) {
+ clipdoardText = clipdoardText.replace( name + ': loading...', name + ': ' + text );
+ }
+ } );
+
+ copyButton.attr( 'data-clipboard-text', clipdoardText );
+
+ pathsSizesSection.find( 'td[class]' ).each( function( i, element ) {
+ var td = $( element );
+ var name = td.attr( 'class' );
+
+ if ( data.hasOwnProperty( name ) && data[ name ].size ) {
+ td.text( data[ name ].size );
+ }
+ } );
+ }
+
+ if ( isDebugTab ) {
+ if ( pathsSizesSection.length ) {
+ getDirectorySizes();
+ } else {
+ RecalculateProgression();
+ }
+ }
+} );
diff --git a/www/crm/wp-admin/js/site-health.min.js b/www/crm/wp-admin/js/site-health.min.js
new file mode 100644
index 00000000..4d3a2bb6
--- /dev/null
+++ b/www/crm/wp-admin/js/site-health.min.js
@@ -0,0 +1 @@
+jQuery(document).ready(function(a){function b(b){var c,d,e=wp.template("health-check-issue"),f=a("#health-check-issues-"+b.status);SiteHealth.site_status.issues[b.status]++,d=SiteHealth.site_status.issues[b.status],"critical"===b.status?c=j(i("%s Critical issue","%s Critical issues",d),'<span class="issue-count">'+d+"</span>"):"recommended"===b.status?c=j(i("%s Recommended improvement","%s Recommended improvements",d),'<span class="issue-count">'+d+"</span>"):"good"===b.status&&(c=j(i("%s Item with no issues detected","%s Items with no issues detected",d),'<span class="issue-count">'+d+"</span>")),c&&a(".site-health-issue-count-title",f).html(c),a(".issues","#health-check-issues-"+b.status).append(e(b))}function c(){var b,c,d,e=a(".site-health-progress"),f=e.find(".site-health-progress-count"),g=a(".site-health-progress svg #bar"),i=parseInt(SiteHealth.site_status.issues.good,0)+parseInt(SiteHealth.site_status.issues.recommended,0)+1.5*parseInt(SiteHealth.site_status.issues.critical,0),k=parseInt(SiteHealth.site_status.issues.recommended,0)+1.5*parseInt(SiteHealth.site_status.issues.critical,0),m=100-Math.ceil(k/i*100);return 0===i?void e.addClass("hidden"):(e.removeClass("loading"),b=g.attr("r"),c=Math.PI*(2*b),0>m&&(m=0),100<m&&(m=100),d=(100-m)/100*c,g.css({strokeDashoffset:d}),1>parseInt(SiteHealth.site_status.issues.critical,0)&&a("#health-check-issues-critical").addClass("hidden"),1>parseInt(SiteHealth.site_status.issues.recommended,0)&&a("#health-check-issues-recommended").addClass("hidden"),50<=m&&g.addClass("orange").removeClass("red"),90<=m&&g.addClass("green").removeClass("orange"),100===m&&(a(".site-status-all-clear").removeClass("hide"),a(".site-status-has-issues").addClass("hide")),f.text(m+"%"),void(l||(a.post(ajaxurl,{action:"health-check-site-status-result",_wpnonce:SiteHealth.nonce.site_status_result,counts:SiteHealth.site_status.issues}),wp.a11y.speak(j(h("All site health tests have finished running. Your site scored %s, and the results are now available on the page."),m+"%")))))}function d(){var e=!0;1<=SiteHealth.site_status.async.length&&a.each(SiteHealth.site_status.async,function(){var c={action:"health-check-"+this.test.replace("_","-"),_wpnonce:SiteHealth.nonce.site_status};return!!this.completed||(e=!1,this.completed=!0,a.post(ajaxurl,c,function(a){b(a.data),d()}),!1)}),e&&c()}function e(){var b={action:"health-check-get-sizes",_wpnonce:SiteHealth.nonce.site_status_result},d=(new Date).getTime(),e=window.setTimeout(function(){wp.a11y.speak(h("Please wait..."))},3e3);a.post({type:"POST",url:ajaxurl,data:b,dataType:"json"}).done(function(a){f(a.data||{})}).always(function(){var b=(new Date).getTime()-d;a(".health-check-wp-paths-sizes.spinner").css("visibility","hidden"),c(),b>3e3?(b=b>6e3?0:6500-b,window.setTimeout(function(){wp.a11y.speak(h("All site health tests have finished running."))},b)):window.clearTimeout(e),a(document).trigger("site-health-info-dirsizes-done")})}function f(b){var c=a("button.button.copy-button"),d=c.attr("data-clipboard-text");a.each(b,function(a,b){var c=b.debug||b.size;"undefined"!=typeof c&&(d=d.replace(a+": loading...",a+": "+c))}),c.attr("data-clipboard-text",d),m.find("td[class]").each(function(c,d){var e=a(d),f=e.attr("class");b.hasOwnProperty(f)&&b[f].size&&e.text(b[f].size)})}var g,h=wp.i18n.__,i=wp.i18n._n,j=wp.i18n.sprintf,k=new ClipboardJS(".site-health-copy-buttons .copy-button"),l=a(".health-check-body.health-check-debug-tab").length,m=a("#health-check-accordion-block-wp-paths-sizes");k.on("success",function(b){var c=a(b.trigger).closest("div");a(".success",c).addClass("visible"),wp.a11y.speak(h("Site information has been added to your clipboard."))}),a(".health-check-accordion").on("click",".health-check-accordion-trigger",function(){var b="true"===a(this).attr("aria-expanded");b?(a(this).attr("aria-expanded","false"),a("#"+a(this).attr("aria-controls")).attr("hidden",!0)):(a(this).attr("aria-expanded","true"),a("#"+a(this).attr("aria-controls")).attr("hidden",!1))}),a(".site-health-view-passed").on("click",function(){var b=a("#health-check-issues-good");b.toggleClass("hidden"),a(this).attr("aria-expanded",!b.hasClass("hidden"))}),"undefined"==typeof SiteHealth||l||(0===SiteHealth.site_status.direct.length&&0===SiteHealth.site_status.async.length?c():SiteHealth.site_status.issues={good:0,recommended:0,critical:0},0<SiteHealth.site_status.direct.length&&a.each(SiteHealth.site_status.direct,function(){b(this)}),0<SiteHealth.site_status.async.length?(g={action:"health-check-"+SiteHealth.site_status.async[0].test.replace("_","-"),_wpnonce:SiteHealth.nonce.site_status},SiteHealth.site_status.async[0].completed=!0,a.post(ajaxurl,g,function(a){b(a.data),d()})):c()),l&&(m.length?e():c())}); \ No newline at end of file
diff --git a/www/crm/wp-admin/js/svg-painter.js b/www/crm/wp-admin/js/svg-painter.js
new file mode 100644
index 00000000..e0277f13
--- /dev/null
+++ b/www/crm/wp-admin/js/svg-painter.js
@@ -0,0 +1,241 @@
+/**
+ * Attempt to re-color SVG icons used in the admin menu or the toolbar
+ *
+ * @output wp-admin/js/svg-painter.js
+ */
+
+window.wp = window.wp || {};
+
+wp.svgPainter = ( function( $, window, document, undefined ) {
+ 'use strict';
+ var selector, base64, painter,
+ colorscheme = {},
+ elements = [];
+
+ $(document).ready( function() {
+ // detection for browser SVG capability
+ if ( document.implementation.hasFeature( 'http://www.w3.org/TR/SVG11/feature#Image', '1.1' ) ) {
+ $( document.body ).removeClass( 'no-svg' ).addClass( 'svg' );
+ wp.svgPainter.init();
+ }
+ });
+
+ /**
+ * Needed only for IE9
+ *
+ * Based on jquery.base64.js 0.0.3 - https://github.com/yckart/jquery.base64.js
+ *
+ * Based on: https://gist.github.com/Yaffle/1284012
+ *
+ * Copyright (c) 2012 Yannick Albert (http://yckart.com)
+ * Licensed under the MIT license
+ * http://www.opensource.org/licenses/mit-license.php
+ */
+ base64 = ( function() {
+ var c,
+ b64 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/',
+ a256 = '',
+ r64 = [256],
+ r256 = [256],
+ i = 0;
+
+ function init() {
+ while( i < 256 ) {
+ c = String.fromCharCode(i);
+ a256 += c;
+ r256[i] = i;
+ r64[i] = b64.indexOf(c);
+ ++i;
+ }
+ }
+
+ function code( s, discard, alpha, beta, w1, w2 ) {
+ var tmp, length,
+ buffer = 0,
+ i = 0,
+ result = '',
+ bitsInBuffer = 0;
+
+ s = String(s);
+ length = s.length;
+
+ while( i < length ) {
+ c = s.charCodeAt(i);
+ c = c < 256 ? alpha[c] : -1;
+
+ buffer = ( buffer << w1 ) + c;
+ bitsInBuffer += w1;
+
+ while( bitsInBuffer >= w2 ) {
+ bitsInBuffer -= w2;
+ tmp = buffer >> bitsInBuffer;
+ result += beta.charAt(tmp);
+ buffer ^= tmp << bitsInBuffer;
+ }
+ ++i;
+ }
+
+ if ( ! discard && bitsInBuffer > 0 ) {
+ result += beta.charAt( buffer << ( w2 - bitsInBuffer ) );
+ }
+
+ return result;
+ }
+
+ function btoa( plain ) {
+ if ( ! c ) {
+ init();
+ }
+
+ plain = code( plain, false, r256, b64, 8, 6 );
+ return plain + '===='.slice( ( plain.length % 4 ) || 4 );
+ }
+
+ function atob( coded ) {
+ var i;
+
+ if ( ! c ) {
+ init();
+ }
+
+ coded = coded.replace( /[^A-Za-z0-9\+\/\=]/g, '' );
+ coded = String(coded).split('=');
+ i = coded.length;
+
+ do {
+ --i;
+ coded[i] = code( coded[i], true, r64, a256, 6, 8 );
+ } while ( i > 0 );
+
+ coded = coded.join('');
+ return coded;
+ }
+
+ return {
+ atob: atob,
+ btoa: btoa
+ };
+ })();
+
+ return {
+ init: function() {
+ painter = this;
+ selector = $( '#adminmenu .wp-menu-image, #wpadminbar .ab-item' );
+
+ this.setColors();
+ this.findElements();
+ this.paint();
+ },
+
+ setColors: function( colors ) {
+ if ( typeof colors === 'undefined' && typeof window._wpColorScheme !== 'undefined' ) {
+ colors = window._wpColorScheme;
+ }
+
+ if ( colors && colors.icons && colors.icons.base && colors.icons.current && colors.icons.focus ) {
+ colorscheme = colors.icons;
+ }
+ },
+
+ findElements: function() {
+ selector.each( function() {
+ var $this = $(this), bgImage = $this.css( 'background-image' );
+
+ if ( bgImage && bgImage.indexOf( 'data:image/svg+xml;base64' ) != -1 ) {
+ elements.push( $this );
+ }
+ });
+ },
+
+ paint: function() {
+ // loop through all elements
+ $.each( elements, function( index, $element ) {
+ var $menuitem = $element.parent().parent();
+
+ if ( $menuitem.hasClass( 'current' ) || $menuitem.hasClass( 'wp-has-current-submenu' ) ) {
+ // paint icon in 'current' color
+ painter.paintElement( $element, 'current' );
+ } else {
+ // paint icon in base color
+ painter.paintElement( $element, 'base' );
+
+ // set hover callbacks
+ $menuitem.hover(
+ function() {
+ painter.paintElement( $element, 'focus' );
+ },
+ function() {
+ // Match the delay from hoverIntent
+ window.setTimeout( function() {
+ painter.paintElement( $element, 'base' );
+ }, 100 );
+ }
+ );
+ }
+ });
+ },
+
+ paintElement: function( $element, colorType ) {
+ var xml, encoded, color;
+
+ if ( ! colorType || ! colorscheme.hasOwnProperty( colorType ) ) {
+ return;
+ }
+
+ color = colorscheme[ colorType ];
+
+ // only accept hex colors: #101 or #101010
+ if ( ! color.match( /^(#[0-9a-f]{3}|#[0-9a-f]{6})$/i ) ) {
+ return;
+ }
+
+ xml = $element.data( 'wp-ui-svg-' + color );
+
+ if ( xml === 'none' ) {
+ return;
+ }
+
+ if ( ! xml ) {
+ encoded = $element.css( 'background-image' ).match( /.+data:image\/svg\+xml;base64,([A-Za-z0-9\+\/\=]+)/ );
+
+ if ( ! encoded || ! encoded[1] ) {
+ $element.data( 'wp-ui-svg-' + color, 'none' );
+ return;
+ }
+
+ try {
+ if ( 'atob' in window ) {
+ xml = window.atob( encoded[1] );
+ } else {
+ xml = base64.atob( encoded[1] );
+ }
+ } catch ( error ) {}
+
+ if ( xml ) {
+ // replace `fill` attributes
+ xml = xml.replace( /fill="(.+?)"/g, 'fill="' + color + '"');
+
+ // replace `style` attributes
+ xml = xml.replace( /style="(.+?)"/g, 'style="fill:' + color + '"');
+
+ // replace `fill` properties in `<style>` tags
+ xml = xml.replace( /fill:.*?;/g, 'fill: ' + color + ';');
+
+ if ( 'btoa' in window ) {
+ xml = window.btoa( xml );
+ } else {
+ xml = base64.btoa( xml );
+ }
+
+ $element.data( 'wp-ui-svg-' + color, xml );
+ } else {
+ $element.data( 'wp-ui-svg-' + color, 'none' );
+ return;
+ }
+ }
+
+ $element.attr( 'style', 'background-image: url("data:image/svg+xml;base64,' + xml + '") !important;' );
+ }
+ };
+
+})( jQuery, window, document );
diff --git a/www/crm/wp-admin/js/svg-painter.min.js b/www/crm/wp-admin/js/svg-painter.min.js
new file mode 100644
index 00000000..51a467ec
--- /dev/null
+++ b/www/crm/wp-admin/js/svg-painter.min.js
@@ -0,0 +1 @@
+window.wp=window.wp||{},wp.svgPainter=function(a,b,c,d){"use strict";var e,f,g,h={},i=[];return a(c).ready(function(){c.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#Image","1.1")&&(a(c.body).removeClass("no-svg").addClass("svg"),wp.svgPainter.init())}),f=function(){function a(){for(;j<256;)e=String.fromCharCode(j),g+=e,i[j]=j,h[j]=f.indexOf(e),++j}function b(a,b,c,d,f,g){var h,i,j=0,k=0,l="",m=0;for(a=String(a),i=a.length;k<i;){for(e=a.charCodeAt(k),e=e<256?c[e]:-1,j=(j<<f)+e,m+=f;m>=g;)m-=g,h=j>>m,l+=d.charAt(h),j^=h<<m;++k}return!b&&m>0&&(l+=d.charAt(j<<g-m)),l}function c(c){return e||a(),c=b(c,!1,i,f,8,6),c+"====".slice(c.length%4||4)}function d(c){var d;e||a(),c=c.replace(/[^A-Za-z0-9\+\/\=]/g,""),c=String(c).split("="),d=c.length;do--d,c[d]=b(c[d],!0,h,g,6,8);while(d>0);return c=c.join("")}var e,f="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",g="",h=[256],i=[256],j=0;return{atob:d,btoa:c}}(),{init:function(){g=this,e=a("#adminmenu .wp-menu-image, #wpadminbar .ab-item"),this.setColors(),this.findElements(),this.paint()},setColors:function(a){"undefined"==typeof a&&"undefined"!=typeof b._wpColorScheme&&(a=b._wpColorScheme),a&&a.icons&&a.icons.base&&a.icons.current&&a.icons.focus&&(h=a.icons)},findElements:function(){e.each(function(){var b=a(this),c=b.css("background-image");c&&c.indexOf("data:image/svg+xml;base64")!=-1&&i.push(b)})},paint:function(){a.each(i,function(a,c){var d=c.parent().parent();d.hasClass("current")||d.hasClass("wp-has-current-submenu")?g.paintElement(c,"current"):(g.paintElement(c,"base"),d.hover(function(){g.paintElement(c,"focus")},function(){b.setTimeout(function(){g.paintElement(c,"base")},100)}))})},paintElement:function(a,c){var d,e,g;if(c&&h.hasOwnProperty(c)&&(g=h[c],g.match(/^(#[0-9a-f]{3}|#[0-9a-f]{6})$/i)&&(d=a.data("wp-ui-svg-"+g),"none"!==d))){if(!d){if(e=a.css("background-image").match(/.+data:image\/svg\+xml;base64,([A-Za-z0-9\+\/\=]+)/),!e||!e[1])return void a.data("wp-ui-svg-"+g,"none");try{d="atob"in b?b.atob(e[1]):f.atob(e[1])}catch(i){}if(!d)return void a.data("wp-ui-svg-"+g,"none");d=d.replace(/fill="(.+?)"/g,'fill="'+g+'"'),d=d.replace(/style="(.+?)"/g,'style="fill:'+g+'"'),d=d.replace(/fill:.*?;/g,"fill: "+g+";"),d="btoa"in b?b.btoa(d):f.btoa(d),a.data("wp-ui-svg-"+g,d)}a.attr("style",'background-image: url("data:image/svg+xml;base64,'+d+'") !important;')}}}}(jQuery,window,document); \ No newline at end of file
diff --git a/www/crm/wp-admin/js/tags-box.js b/www/crm/wp-admin/js/tags-box.js
new file mode 100644
index 00000000..c4676f26
--- /dev/null
+++ b/www/crm/wp-admin/js/tags-box.js
@@ -0,0 +1,430 @@
+/**
+ * @output wp-admin/js/tags-box.js
+ */
+
+/* jshint curly: false, eqeqeq: false */
+/* global ajaxurl, tagBox, array_unique_noempty */
+
+( function( $ ) {
+ var tagDelimiter = ( window.tagsSuggestL10n && window.tagsSuggestL10n.tagDelimiter ) || ',';
+
+ /**
+ * Filters unique items and returns a new array.
+ *
+ * Filters all items from an array into a new array containing only the unique
+ * items. This also excludes whitespace or empty values.
+ *
+ * @since 2.8.0
+ *
+ * @global
+ *
+ * @param {Array} array The array to filter through.
+ *
+ * @return {Array} A new array containing only the unique items.
+ */
+ window.array_unique_noempty = function( array ) {
+ var out = [];
+
+ // Trim the values and ensure they are unique.
+ $.each( array, function( key, val ) {
+ val = $.trim( val );
+
+ if ( val && $.inArray( val, out ) === -1 ) {
+ out.push( val );
+ }
+ } );
+
+ return out;
+ };
+
+ /**
+ * The TagBox object.
+ *
+ * Contains functions to create and manage tags that can be associated with a
+ * post.
+ *
+ * @since 2.9.0
+ *
+ * @global
+ */
+ window.tagBox = {
+ /**
+ * Cleans up tags by removing redundant characters.
+ *
+ * @since 2.9.0
+ * @memberOf tagBox
+ *
+ * @param {string} tags Comma separated tags that need to be cleaned up.
+ *
+ * @return {string} The cleaned up tags.
+ */
+ clean : function( tags ) {
+ if ( ',' !== tagDelimiter ) {
+ tags = tags.replace( new RegExp( tagDelimiter, 'g' ), ',' );
+ }
+
+ tags = tags.replace(/\s*,\s*/g, ',').replace(/,+/g, ',').replace(/[,\s]+$/, '').replace(/^[,\s]+/, '');
+
+ if ( ',' !== tagDelimiter ) {
+ tags = tags.replace( /,/g, tagDelimiter );
+ }
+
+ return tags;
+ },
+
+ /**
+ * Parses tags and makes them editable.
+ *
+ * @since 2.9.0
+ * @memberOf tagBox
+ *
+ * @param {Object} el The tag element to retrieve the ID from.
+ *
+ * @return {boolean} Always returns false.
+ */
+ parseTags : function(el) {
+ var id = el.id,
+ num = id.split('-check-num-')[1],
+ taxbox = $(el).closest('.tagsdiv'),
+ thetags = taxbox.find('.the-tags'),
+ current_tags = thetags.val().split( tagDelimiter ),
+ new_tags = [];
+
+ delete current_tags[num];
+
+ // Sanitize the current tags and push them as if they're new tags.
+ $.each( current_tags, function( key, val ) {
+ val = $.trim( val );
+ if ( val ) {
+ new_tags.push( val );
+ }
+ });
+
+ thetags.val( this.clean( new_tags.join( tagDelimiter ) ) );
+
+ this.quickClicks( taxbox );
+ return false;
+ },
+
+ /**
+ * Creates clickable links, buttons and fields for adding or editing tags.
+ *
+ * @since 2.9.0
+ * @memberOf tagBox
+ *
+ * @param {Object} el The container HTML element.
+ *
+ * @return {void}
+ */
+ quickClicks : function( el ) {
+ var thetags = $('.the-tags', el),
+ tagchecklist = $('.tagchecklist', el),
+ id = $(el).attr('id'),
+ current_tags, disabled;
+
+ if ( ! thetags.length )
+ return;
+
+ disabled = thetags.prop('disabled');
+
+ current_tags = thetags.val().split( tagDelimiter );
+ tagchecklist.empty();
+
+ /**
+ * Creates a delete button if tag editing is enabled, before adding it to the tag list.
+ *
+ * @since 2.5.0
+ * @memberOf tagBox
+ *
+ * @param {string} key The index of the current tag.
+ * @param {string} val The value of the current tag.
+ *
+ * @return {void}
+ */
+ $.each( current_tags, function( key, val ) {
+ var listItem, xbutton;
+
+ val = $.trim( val );
+
+ if ( ! val )
+ return;
+
+ // Create a new list item, and ensure the text is properly escaped.
+ listItem = $( '<li />' ).text( val );
+
+ // If tags editing isn't disabled, create the X button.
+ if ( ! disabled ) {
+ /*
+ * Build the X buttons, hide the X icon with aria-hidden and
+ * use visually hidden text for screen readers.
+ */
+ xbutton = $( '<button type="button" id="' + id + '-check-num-' + key + '" class="ntdelbutton">' +
+ '<span class="remove-tag-icon" aria-hidden="true"></span>' +
+ '<span class="screen-reader-text">' + window.tagsSuggestL10n.removeTerm + ' ' + listItem.html() + '</span>' +
+ '</button>' );
+
+ /**
+ * Handles the click and keypress event of the tag remove button.
+ *
+ * Makes sure the focus ends up in the tag input field when using
+ * the keyboard to delete the tag.
+ *
+ * @since 4.2.0
+ *
+ * @param {Event} e The click or keypress event to handle.
+ *
+ * @return {void}
+ */
+ xbutton.on( 'click keypress', function( e ) {
+ // On click or when using the Enter/Spacebar keys.
+ if ( 'click' === e.type || 13 === e.keyCode || 32 === e.keyCode ) {
+ /*
+ * When using the keyboard, move focus back to the
+ * add new tag field. Note: when releasing the pressed
+ * key this will fire the `keyup` event on the input.
+ */
+ if ( 13 === e.keyCode || 32 === e.keyCode ) {
+ $( this ).closest( '.tagsdiv' ).find( 'input.newtag' ).focus();
+ }
+
+ tagBox.userAction = 'remove';
+ tagBox.parseTags( this );
+ }
+ });
+
+ listItem.prepend( '&nbsp;' ).prepend( xbutton );
+ }
+
+ // Append the list item to the tag list.
+ tagchecklist.append( listItem );
+ });
+
+ // The buttons list is built now, give feedback to screen reader users.
+ tagBox.screenReadersMessage();
+ },
+
+ /**
+ * Adds a new tag.
+ *
+ * Also ensures that the quick links are properly generated.
+ *
+ * @since 2.9.0
+ * @memberOf tagBox
+ *
+ * @param {Object} el The container HTML element.
+ * @param {Object|boolean} a When this is an HTML element the text of that
+ * element will be used for the new tag.
+ * @param {number|boolean} f If this value is not passed then the tag input
+ * field is focused.
+ *
+ * @return {boolean} Always returns false.
+ */
+ flushTags : function( el, a, f ) {
+ var tagsval, newtags, text,
+ tags = $( '.the-tags', el ),
+ newtag = $( 'input.newtag', el );
+
+ a = a || false;
+
+ text = a ? $(a).text() : newtag.val();
+
+ /*
+ * Return if there's no new tag or if the input field is empty.
+ * Note: when using the keyboard to add tags, focus is moved back to
+ * the input field and the `keyup` event attached on this field will
+ * fire when releasing the pressed key. Checking also for the field
+ * emptiness avoids to set the tags and call quickClicks() again.
+ */
+ if ( 'undefined' == typeof( text ) || '' === text ) {
+ return false;
+ }
+
+ tagsval = tags.val();
+ newtags = tagsval ? tagsval + tagDelimiter + text : text;
+
+ newtags = this.clean( newtags );
+ newtags = array_unique_noempty( newtags.split( tagDelimiter ) ).join( tagDelimiter );
+ tags.val( newtags );
+ this.quickClicks( el );
+
+ if ( ! a )
+ newtag.val('');
+ if ( 'undefined' == typeof( f ) )
+ newtag.focus();
+
+ return false;
+ },
+
+ /**
+ * Retrieves the available tags and creates a tagcloud.
+ *
+ * Retrieves the available tags from the database and creates an interactive
+ * tagcloud. Clicking a tag will add it.
+ *
+ * @since 2.9.0
+ * @memberOf tagBox
+ *
+ * @param {string} id The ID to extract the taxonomy from.
+ *
+ * @return {void}
+ */
+ get : function( id ) {
+ var tax = id.substr( id.indexOf('-') + 1 );
+
+ /**
+ * Puts a received tag cloud into a DOM element.
+ *
+ * The tag cloud HTML is generated on the server.
+ *
+ * @since 2.9.0
+ *
+ * @param {number|string} r The response message from the AJAX call.
+ * @param {string} stat The status of the AJAX request.
+ *
+ * @return {void}
+ */
+ $.post( ajaxurl, { 'action': 'get-tagcloud', 'tax': tax }, function( r, stat ) {
+ if ( 0 === r || 'success' != stat ) {
+ return;
+ }
+
+ r = $( '<div id="tagcloud-' + tax + '" class="the-tagcloud">' + r + '</div>' );
+
+ /**
+ * Adds a new tag when a tag in the tagcloud is clicked.
+ *
+ * @since 2.9.0
+ *
+ * @return {boolean} Returns false to prevent the default action.
+ */
+ $( 'a', r ).click( function() {
+ tagBox.userAction = 'add';
+ tagBox.flushTags( $( '#' + tax ), this );
+ return false;
+ });
+
+ $( '#' + id ).after( r );
+ });
+ },
+
+ /**
+ * Track the user's last action.
+ *
+ * @since 4.7.0
+ */
+ userAction: '',
+
+ /**
+ * Dispatches an audible message to screen readers.
+ *
+ * This will inform the user when a tag has been added or removed.
+ *
+ * @since 4.7.0
+ *
+ * @return {void}
+ */
+ screenReadersMessage: function() {
+ var message;
+
+ switch ( this.userAction ) {
+ case 'remove':
+ message = window.tagsSuggestL10n.termRemoved;
+ break;
+
+ case 'add':
+ message = window.tagsSuggestL10n.termAdded;
+ break;
+
+ default:
+ return;
+ }
+
+ window.wp.a11y.speak( message, 'assertive' );
+ },
+
+ /**
+ * Initializes the tags box by setting up the links, buttons. Sets up event
+ * handling.
+ *
+ * This includes handling of pressing the enter key in the input field and the
+ * retrieval of tag suggestions.
+ *
+ * @since 2.9.0
+ * @memberOf tagBox
+ *
+ * @return {void}
+ */
+ init : function() {
+ var ajaxtag = $('div.ajaxtag');
+
+ $('.tagsdiv').each( function() {
+ tagBox.quickClicks( this );
+ });
+
+ $( '.tagadd', ajaxtag ).click( function() {
+ tagBox.userAction = 'add';
+ tagBox.flushTags( $( this ).closest( '.tagsdiv' ) );
+ });
+
+ /**
+ * Handles pressing enter on the new tag input field.
+ *
+ * Prevents submitting the post edit form. Uses `keypress` to take
+ * into account Input Method Editor (IME) converters.
+ *
+ * @since 2.9.0
+ *
+ * @param {Event} event The keypress event that occurred.
+ *
+ * @return {void}
+ */
+ $( 'input.newtag', ajaxtag ).keypress( function( event ) {
+ if ( 13 == event.which ) {
+ tagBox.userAction = 'add';
+ tagBox.flushTags( $( this ).closest( '.tagsdiv' ) );
+ event.preventDefault();
+ event.stopPropagation();
+ }
+ }).each( function( i, element ) {
+ $( element ).wpTagsSuggest();
+ });
+
+ /**
+ * Before a post is saved the value currently in the new tag input field will be
+ * added as a tag.
+ *
+ * @since 2.9.0
+ *
+ * @return {void}
+ */
+ $('#post').submit(function(){
+ $('div.tagsdiv').each( function() {
+ tagBox.flushTags(this, false, 1);
+ });
+ });
+
+ /**
+ * Handles clicking on the tag cloud link.
+ *
+ * Makes sure the ARIA attributes are set correctly.
+ *
+ * @since 2.9.0
+ *
+ * @return {void}
+ */
+ $('.tagcloud-link').click(function(){
+ // On the first click, fetch the tag cloud and insert it in the DOM.
+ tagBox.get( $( this ).attr( 'id' ) );
+ // Update button state, remove previous click event and attach a new one to toggle the cloud.
+ $( this )
+ .attr( 'aria-expanded', 'true' )
+ .unbind()
+ .click( function() {
+ $( this )
+ .attr( 'aria-expanded', 'false' === $( this ).attr( 'aria-expanded' ) ? 'true' : 'false' )
+ .siblings( '.the-tagcloud' ).toggle();
+ });
+ });
+ }
+ };
+}( jQuery ));
diff --git a/www/crm/wp-admin/js/tags-box.min.js b/www/crm/wp-admin/js/tags-box.min.js
new file mode 100644
index 00000000..1e468334
--- /dev/null
+++ b/www/crm/wp-admin/js/tags-box.min.js
@@ -0,0 +1 @@
+!function(a){var b=window.tagsSuggestL10n&&window.tagsSuggestL10n.tagDelimiter||",";window.array_unique_noempty=function(b){var c=[];return a.each(b,function(b,d){d=a.trim(d),d&&a.inArray(d,c)===-1&&c.push(d)}),c},window.tagBox={clean:function(a){return","!==b&&(a=a.replace(new RegExp(b,"g"),",")),a=a.replace(/\s*,\s*/g,",").replace(/,+/g,",").replace(/[,\s]+$/,"").replace(/^[,\s]+/,""),","!==b&&(a=a.replace(/,/g,b)),a},parseTags:function(c){var d=c.id,e=d.split("-check-num-")[1],f=a(c).closest(".tagsdiv"),g=f.find(".the-tags"),h=g.val().split(b),i=[];return delete h[e],a.each(h,function(b,c){c=a.trim(c),c&&i.push(c)}),g.val(this.clean(i.join(b))),this.quickClicks(f),!1},quickClicks:function(c){var d,e,f=a(".the-tags",c),g=a(".tagchecklist",c),h=a(c).attr("id");f.length&&(e=f.prop("disabled"),d=f.val().split(b),g.empty(),a.each(d,function(b,c){var d,f;c=a.trim(c),c&&(d=a("<li />").text(c),e||(f=a('<button type="button" id="'+h+"-check-num-"+b+'" class="ntdelbutton"><span class="remove-tag-icon" aria-hidden="true"></span><span class="screen-reader-text">'+window.tagsSuggestL10n.removeTerm+" "+d.html()+"</span></button>"),f.on("click keypress",function(b){"click"!==b.type&&13!==b.keyCode&&32!==b.keyCode||(13!==b.keyCode&&32!==b.keyCode||a(this).closest(".tagsdiv").find("input.newtag").focus(),tagBox.userAction="remove",tagBox.parseTags(this))}),d.prepend("&nbsp;").prepend(f)),g.append(d))}),tagBox.screenReadersMessage())},flushTags:function(c,d,e){var f,g,h,i=a(".the-tags",c),j=a("input.newtag",c);return d=d||!1,h=d?a(d).text():j.val(),"undefined"!=typeof h&&""!==h&&(f=i.val(),g=f?f+b+h:h,g=this.clean(g),g=array_unique_noempty(g.split(b)).join(b),i.val(g),this.quickClicks(c),d||j.val(""),"undefined"==typeof e&&j.focus(),!1)},get:function(b){var c=b.substr(b.indexOf("-")+1);a.post(ajaxurl,{action:"get-tagcloud",tax:c},function(d,e){0!==d&&"success"==e&&(d=a('<div id="tagcloud-'+c+'" class="the-tagcloud">'+d+"</div>"),a("a",d).click(function(){return tagBox.userAction="add",tagBox.flushTags(a("#"+c),this),!1}),a("#"+b).after(d))})},userAction:"",screenReadersMessage:function(){var a;switch(this.userAction){case"remove":a=window.tagsSuggestL10n.termRemoved;break;case"add":a=window.tagsSuggestL10n.termAdded;break;default:return}window.wp.a11y.speak(a,"assertive")},init:function(){var b=a("div.ajaxtag");a(".tagsdiv").each(function(){tagBox.quickClicks(this)}),a(".tagadd",b).click(function(){tagBox.userAction="add",tagBox.flushTags(a(this).closest(".tagsdiv"))}),a("input.newtag",b).keypress(function(b){13==b.which&&(tagBox.userAction="add",tagBox.flushTags(a(this).closest(".tagsdiv")),b.preventDefault(),b.stopPropagation())}).each(function(b,c){a(c).wpTagsSuggest()}),a("#post").submit(function(){a("div.tagsdiv").each(function(){tagBox.flushTags(this,!1,1)})}),a(".tagcloud-link").click(function(){tagBox.get(a(this).attr("id")),a(this).attr("aria-expanded","true").unbind().click(function(){a(this).attr("aria-expanded","false"===a(this).attr("aria-expanded")?"true":"false").siblings(".the-tagcloud").toggle()})})}}}(jQuery); \ No newline at end of file
diff --git a/www/crm/wp-admin/js/tags-suggest.js b/www/crm/wp-admin/js/tags-suggest.js
new file mode 100644
index 00000000..866d7d06
--- /dev/null
+++ b/www/crm/wp-admin/js/tags-suggest.js
@@ -0,0 +1,193 @@
+/**
+ * Default settings for jQuery UI Autocomplete for use with non-hierarchical taxonomies.
+ *
+ * @output wp-admin/js/tags-suggest.js
+ */
+( function( $ ) {
+ if ( typeof window.tagsSuggestL10n === 'undefined' || typeof window.uiAutocompleteL10n === 'undefined' ) {
+ return;
+ }
+
+ var tempID = 0;
+ var separator = window.tagsSuggestL10n.tagDelimiter || ',';
+
+ function split( val ) {
+ return val.split( new RegExp( separator + '\\s*' ) );
+ }
+
+ function getLast( term ) {
+ return split( term ).pop();
+ }
+
+ /**
+ * Add UI Autocomplete to an input or textarea element with presets for use
+ * with non-hierarchical taxonomies.
+ *
+ * Example: `$( element ).wpTagsSuggest( options )`.
+ *
+ * The taxonomy can be passed in a `data-wp-taxonomy` attribute on the element or
+ * can be in `options.taxonomy`.
+ *
+ * @since 4.7.0
+ *
+ * @param {object} options Options that are passed to UI Autocomplete. Can be used to override the default settings.
+ * @returns {object} jQuery instance.
+ */
+ $.fn.wpTagsSuggest = function( options ) {
+ var cache;
+ var last;
+ var $element = $( this );
+
+ options = options || {};
+
+ var taxonomy = options.taxonomy || $element.attr( 'data-wp-taxonomy' ) || 'post_tag';
+
+ delete( options.taxonomy );
+
+ options = $.extend( {
+ source: function( request, response ) {
+ var term;
+
+ if ( last === request.term ) {
+ response( cache );
+ return;
+ }
+
+ term = getLast( request.term );
+
+ $.get( window.ajaxurl, {
+ action: 'ajax-tag-search',
+ tax: taxonomy,
+ q: term
+ } ).always( function() {
+ $element.removeClass( 'ui-autocomplete-loading' ); // UI fails to remove this sometimes?
+ } ).done( function( data ) {
+ var tagName;
+ var tags = [];
+
+ if ( data ) {
+ data = data.split( '\n' );
+
+ for ( tagName in data ) {
+ var id = ++tempID;
+
+ tags.push({
+ id: id,
+ name: data[tagName]
+ });
+ }
+
+ cache = tags;
+ response( tags );
+ } else {
+ response( tags );
+ }
+ } );
+
+ last = request.term;
+ },
+ focus: function( event, ui ) {
+ $element.attr( 'aria-activedescendant', 'wp-tags-autocomplete-' + ui.item.id );
+
+ // Don't empty the input field when using the arrow keys to
+ // highlight items. See api.jqueryui.com/autocomplete/#event-focus
+ event.preventDefault();
+ },
+ select: function( event, ui ) {
+ var tags = split( $element.val() );
+ // Remove the last user input.
+ tags.pop();
+ // Append the new tag and an empty element to get one more separator at the end.
+ tags.push( ui.item.name, '' );
+
+ $element.val( tags.join( separator + ' ' ) );
+
+ if ( $.ui.keyCode.TAB === event.keyCode ) {
+ // Audible confirmation message when a tag has been selected.
+ window.wp.a11y.speak( window.tagsSuggestL10n.termSelected, 'assertive' );
+ event.preventDefault();
+ } else if ( $.ui.keyCode.ENTER === event.keyCode ) {
+ // If we're in the edit post Tags meta box, add the tag.
+ if ( window.tagBox ) {
+ window.tagBox.userAction = 'add';
+ window.tagBox.flushTags( $( this ).closest( '.tagsdiv' ) );
+ }
+
+ // Do not close Quick Edit / Bulk Edit
+ event.preventDefault();
+ event.stopPropagation();
+ }
+
+ return false;
+ },
+ open: function() {
+ $element.attr( 'aria-expanded', 'true' );
+ },
+ close: function() {
+ $element.attr( 'aria-expanded', 'false' );
+ },
+ minLength: 2,
+ position: {
+ my: 'left top+2',
+ at: 'left bottom',
+ collision: 'none'
+ },
+ messages: {
+ noResults: window.uiAutocompleteL10n.noResults,
+ results: function( number ) {
+ if ( number > 1 ) {
+ return window.uiAutocompleteL10n.manyResults.replace( '%d', number );
+ }
+
+ return window.uiAutocompleteL10n.oneResult;
+ }
+ }
+ }, options );
+
+ $element.on( 'keydown', function() {
+ $element.removeAttr( 'aria-activedescendant' );
+ } )
+ .autocomplete( options )
+ .autocomplete( 'instance' )._renderItem = function( ul, item ) {
+ return $( '<li role="option" id="wp-tags-autocomplete-' + item.id + '">' )
+ .text( item.name )
+ .appendTo( ul );
+ };
+
+ $element.attr( {
+ 'role': 'combobox',
+ 'aria-autocomplete': 'list',
+ 'aria-expanded': 'false',
+ 'aria-owns': $element.autocomplete( 'widget' ).attr( 'id' )
+ } )
+ .on( 'focus', function() {
+ var inputValue = split( $element.val() ).pop();
+
+ // Don't trigger a search if the field is empty.
+ // Also, avoids screen readers announce `No search results`.
+ if ( inputValue ) {
+ $element.autocomplete( 'search' );
+ }
+ } )
+ // Returns a jQuery object containing the menu element.
+ .autocomplete( 'widget' )
+ .addClass( 'wp-tags-autocomplete' )
+ .attr( 'role', 'listbox' )
+ .removeAttr( 'tabindex' ) // Remove the `tabindex=0` attribute added by jQuery UI.
+
+ // Looks like Safari and VoiceOver need an `aria-selected` attribute. See ticket #33301.
+ // The `menufocus` and `menublur` events are the same events used to add and remove
+ // the `ui-state-focus` CSS class on the menu items. See jQuery UI Menu Widget.
+ .on( 'menufocus', function( event, ui ) {
+ ui.item.attr( 'aria-selected', 'true' );
+ })
+ .on( 'menublur', function() {
+ // The `menublur` event returns an object where the item is `null`
+ // so we need to find the active item with other means.
+ $( this ).find( '[aria-selected="true"]' ).removeAttr( 'aria-selected' );
+ });
+
+ return this;
+ };
+
+}( jQuery ) );
diff --git a/www/crm/wp-admin/js/tags-suggest.min.js b/www/crm/wp-admin/js/tags-suggest.min.js
new file mode 100644
index 00000000..a4f07eb9
--- /dev/null
+++ b/www/crm/wp-admin/js/tags-suggest.min.js
@@ -0,0 +1 @@
+!function(a){function b(a){return a.split(new RegExp(e+"\\s*"))}function c(a){return b(a).pop()}if("undefined"!=typeof window.tagsSuggestL10n&&"undefined"!=typeof window.uiAutocompleteL10n){var d=0,e=window.tagsSuggestL10n.tagDelimiter||",";a.fn.wpTagsSuggest=function(f){var g,h,i=a(this);f=f||{};var j=f.taxonomy||i.attr("data-wp-taxonomy")||"post_tag";return delete f.taxonomy,f=a.extend({source:function(b,e){var f;return h===b.term?void e(g):(f=c(b.term),a.get(window.ajaxurl,{action:"ajax-tag-search",tax:j,q:f}).always(function(){i.removeClass("ui-autocomplete-loading")}).done(function(a){var b,c=[];if(a){a=a.split("\n");for(b in a){var f=++d;c.push({id:f,name:a[b]})}g=c,e(c)}else e(c)}),void(h=b.term))},focus:function(a,b){i.attr("aria-activedescendant","wp-tags-autocomplete-"+b.item.id),a.preventDefault()},select:function(c,d){var f=b(i.val());return f.pop(),f.push(d.item.name,""),i.val(f.join(e+" ")),a.ui.keyCode.TAB===c.keyCode?(window.wp.a11y.speak(window.tagsSuggestL10n.termSelected,"assertive"),c.preventDefault()):a.ui.keyCode.ENTER===c.keyCode&&(window.tagBox&&(window.tagBox.userAction="add",window.tagBox.flushTags(a(this).closest(".tagsdiv"))),c.preventDefault(),c.stopPropagation()),!1},open:function(){i.attr("aria-expanded","true")},close:function(){i.attr("aria-expanded","false")},minLength:2,position:{my:"left top+2",at:"left bottom",collision:"none"},messages:{noResults:window.uiAutocompleteL10n.noResults,results:function(a){return a>1?window.uiAutocompleteL10n.manyResults.replace("%d",a):window.uiAutocompleteL10n.oneResult}}},f),i.on("keydown",function(){i.removeAttr("aria-activedescendant")}).autocomplete(f).autocomplete("instance")._renderItem=function(b,c){return a('<li role="option" id="wp-tags-autocomplete-'+c.id+'">').text(c.name).appendTo(b)},i.attr({role:"combobox","aria-autocomplete":"list","aria-expanded":"false","aria-owns":i.autocomplete("widget").attr("id")}).on("focus",function(){var a=b(i.val()).pop();a&&i.autocomplete("search")}).autocomplete("widget").addClass("wp-tags-autocomplete").attr("role","listbox").removeAttr("tabindex").on("menufocus",function(a,b){b.item.attr("aria-selected","true")}).on("menublur",function(){a(this).find('[aria-selected="true"]').removeAttr("aria-selected")}),this}}}(jQuery); \ No newline at end of file
diff --git a/www/crm/wp-admin/js/tags.js b/www/crm/wp-admin/js/tags.js
new file mode 100644
index 00000000..0f195c77
--- /dev/null
+++ b/www/crm/wp-admin/js/tags.js
@@ -0,0 +1,147 @@
+/**
+ * Contains logic for deleting and adding tags.
+ *
+ * For deleting tags it makes a request to the server to delete the tag.
+ * For adding tags it makes a request to the server to add the tag.
+ *
+ * @output wp-admin/js/tags.js
+ */
+
+ /* global ajaxurl, wpAjax, tagsl10n, showNotice, validateForm */
+
+jQuery(document).ready(function($) {
+
+ /**
+ * Adds an event handler to the delete term link on the term overview page.
+ *
+ * Cancels default event handling and event bubbling.
+ *
+ * @since 2.8.0
+ *
+ * @returns boolean Always returns false to cancel the default event handling.
+ */
+ $( '#the-list' ).on( 'click', '.delete-tag', function() {
+ var t = $(this), tr = t.parents('tr'), r = true, data;
+
+ if ( 'undefined' != showNotice )
+ r = showNotice.warn();
+
+ if ( r ) {
+ data = t.attr('href').replace(/[^?]*\?/, '').replace(/action=delete/, 'action=delete-tag');
+
+ /**
+ * Makes a request to the server to delete the term that corresponds to the
+ * delete term button.
+ *
+ * @param {string} r The response from the server.
+ *
+ * @returns {void}
+ */
+ $.post(ajaxurl, data, function(r){
+ if ( '1' == r ) {
+ $('#ajax-response').empty();
+ tr.fadeOut('normal', function(){ tr.remove(); });
+
+ /**
+ * Removes the term from the parent box and the tag cloud.
+ *
+ * `data.match(/tag_ID=(\d+)/)[1]` matches the term id from the data variable.
+ * This term id is then used to select the relevant HTML elements:
+ * The parent box and the tag cloud.
+ */
+ $('select#parent option[value="' + data.match(/tag_ID=(\d+)/)[1] + '"]').remove();
+ $('a.tag-link-' + data.match(/tag_ID=(\d+)/)[1]).remove();
+
+ } else if ( '-1' == r ) {
+ $('#ajax-response').empty().append('<div class="error"><p>' + tagsl10n.noPerm + '</p></div>');
+ tr.children().css('backgroundColor', '');
+
+ } else {
+ $('#ajax-response').empty().append('<div class="error"><p>' + tagsl10n.broken + '</p></div>');
+ tr.children().css('backgroundColor', '');
+ }
+ });
+
+ tr.children().css('backgroundColor', '#f33');
+ }
+
+ return false;
+ });
+
+ /**
+ * Adds a deletion confirmation when removing a tag.
+ *
+ * @since 4.8.0
+ *
+ * @returns {void}
+ */
+ $( '#edittag' ).on( 'click', '.delete', function( e ) {
+ if ( 'undefined' === typeof showNotice ) {
+ return true;
+ }
+
+ // Confirms the deletion, a negative response means the deletion must not be executed.
+ var response = showNotice.warn();
+ if ( ! response ) {
+ e.preventDefault();
+ }
+ });
+
+ /**
+ * Adds an event handler to the form submit on the term overview page.
+ *
+ * Cancels default event handling and event bubbling.
+ *
+ * @since 2.8.0
+ *
+ * @returns boolean Always returns false to cancel the default event handling.
+ */
+ $('#submit').click(function(){
+ var form = $(this).parents('form');
+
+ if ( ! validateForm( form ) )
+ return false;
+
+ /**
+ * Does a request to the server to add a new term to the database
+ *
+ * @param {string} r The response from the server.
+ *
+ * @returns {void}
+ */
+ $.post(ajaxurl, $('#addtag').serialize(), function(r){
+ var res, parent, term, indent, i;
+
+ $('#ajax-response').empty();
+ res = wpAjax.parseAjaxResponse( r, 'ajax-response' );
+ if ( ! res || res.errors )
+ return;
+
+ parent = form.find( 'select#parent' ).val();
+
+ if ( parent > 0 && $('#tag-' + parent ).length > 0 ) // If the parent exists on this page, insert it below. Else insert it at the top of the list.
+ $( '.tags #tag-' + parent ).after( res.responses[0].supplemental.noparents ); // As the parent exists, Insert the version with - - - prefixed
+ else
+ $( '.tags' ).prepend( res.responses[0].supplemental.parents ); // As the parent is not visible, Insert the version with Parent - Child - ThisTerm
+
+ $('.tags .no-items').remove();
+
+ if ( form.find('select#parent') ) {
+ // Parents field exists, Add new term to the list.
+ term = res.responses[1].supplemental;
+
+ // Create an indent for the Parent field
+ indent = '';
+ for ( i = 0; i < res.responses[1].position; i++ )
+ indent += '&nbsp;&nbsp;&nbsp;';
+
+ form.find( 'select#parent option:selected' ).after( '<option value="' + term.term_id + '">' + indent + term.name + '</option>' );
+ }
+
+ $('input[type="text"]:visible, textarea:visible', form).val('');
+ });
+
+ return false;
+ });
+
+});
diff --git a/www/crm/wp-admin/js/tags.min.js b/www/crm/wp-admin/js/tags.min.js
new file mode 100644
index 00000000..2f7db48d
--- /dev/null
+++ b/www/crm/wp-admin/js/tags.min.js
@@ -0,0 +1 @@
+jQuery(document).ready(function(a){a("#the-list").on("click",".delete-tag",function(){var b,c=a(this),d=c.parents("tr"),e=!0;return"undefined"!=showNotice&&(e=showNotice.warn()),e&&(b=c.attr("href").replace(/[^?]*\?/,"").replace(/action=delete/,"action=delete-tag"),a.post(ajaxurl,b,function(c){"1"==c?(a("#ajax-response").empty(),d.fadeOut("normal",function(){d.remove()}),a('select#parent option[value="'+b.match(/tag_ID=(\d+)/)[1]+'"]').remove(),a("a.tag-link-"+b.match(/tag_ID=(\d+)/)[1]).remove()):"-1"==c?(a("#ajax-response").empty().append('<div class="error"><p>'+tagsl10n.noPerm+"</p></div>"),d.children().css("backgroundColor","")):(a("#ajax-response").empty().append('<div class="error"><p>'+tagsl10n.broken+"</p></div>"),d.children().css("backgroundColor",""))}),d.children().css("backgroundColor","#f33")),!1}),a("#edittag").on("click",".delete",function(a){if("undefined"==typeof showNotice)return!0;var b=showNotice.warn();b||a.preventDefault()}),a("#submit").click(function(){var b=a(this).parents("form");return!!validateForm(b)&&(a.post(ajaxurl,a("#addtag").serialize(),function(c){var d,e,f,g,h;if(a("#ajax-response").empty(),d=wpAjax.parseAjaxResponse(c,"ajax-response"),d&&!d.errors){if(e=b.find("select#parent").val(),e>0&&a("#tag-"+e).length>0?a(".tags #tag-"+e).after(d.responses[0].supplemental.noparents):a(".tags").prepend(d.responses[0].supplemental.parents),a(".tags .no-items").remove(),b.find("select#parent")){for(f=d.responses[1].supplemental,g="",h=0;h<d.responses[1].position;h++)g+="&nbsp;&nbsp;&nbsp;";b.find("select#parent option:selected").after('<option value="'+f.term_id+'">'+g+f.name+"</option>")}a('input[type="text"]:visible, textarea:visible',b).val("")}}),!1)})}); \ No newline at end of file
diff --git a/www/crm/wp-admin/js/theme-plugin-editor.js b/www/crm/wp-admin/js/theme-plugin-editor.js
new file mode 100644
index 00000000..6127b2cf
--- /dev/null
+++ b/www/crm/wp-admin/js/theme-plugin-editor.js
@@ -0,0 +1,1006 @@
+/**
+ * @output wp-admin/js/theme-plugin-editor.js
+ */
+
+/* eslint no-magic-numbers: ["error", { "ignore": [-1, 0, 1] }] */
+
+if ( ! window.wp ) {
+ window.wp = {};
+}
+
+wp.themePluginEditor = (function( $ ) {
+ 'use strict';
+ var component, TreeLinks;
+
+ component = {
+ l10n: {
+ lintError: {
+ singular: '',
+ plural: ''
+ },
+ saveAlert: '',
+ saveError: ''
+ },
+ codeEditor: {},
+ instance: null,
+ noticeElements: {},
+ dirty: false,
+ lintErrors: []
+ };
+
+ /**
+ * Initialize component.
+ *
+ * @since 4.9.0
+ *
+ * @param {jQuery} form - Form element.
+ * @param {object} settings - Settings.
+ * @param {object|boolean} settings.codeEditor - Code editor settings (or `false` if syntax highlighting is disabled).
+ * @returns {void}
+ */
+ component.init = function init( form, settings ) {
+
+ component.form = form;
+ if ( settings ) {
+ $.extend( component, settings );
+ }
+
+ component.noticeTemplate = wp.template( 'wp-file-editor-notice' );
+ component.noticesContainer = component.form.find( '.editor-notices' );
+ component.submitButton = component.form.find( ':input[name=submit]' );
+ component.spinner = component.form.find( '.submit .spinner' );
+ component.form.on( 'submit', component.submit );
+ component.textarea = component.form.find( '#newcontent' );
+ component.textarea.on( 'change', component.onChange );
+ component.warning = $( '.file-editor-warning' );
+ component.docsLookUpButton = component.form.find( '#docs-lookup' );
+ component.docsLookUpList = component.form.find( '#docs-list' );
+
+ if ( component.warning.length > 0 ) {
+ component.showWarning();
+ }
+
+ if ( false !== component.codeEditor ) {
+ /*
+ * Defer adding notices until after DOM ready as workaround for WP Admin injecting
+ * its own managed dismiss buttons and also to prevent the editor from showing a notice
+ * when the file had linting errors to begin with.
+ */
+ _.defer( function() {
+ component.initCodeEditor();
+ } );
+ }
+
+ $( component.initFileBrowser );
+
+ $( window ).on( 'beforeunload', function() {
+ if ( component.dirty ) {
+ return component.l10n.saveAlert;
+ }
+ return undefined;
+ } );
+
+ component.docsLookUpList.on( 'change', function() {
+ var option = $( this ).val();
+ if ( '' === option ) {
+ component.docsLookUpButton.prop( 'disabled', true );
+ } else {
+ component.docsLookUpButton.prop( 'disabled', false );
+ }
+ } );
+ };
+
+ /**
+ * Set up and display the warning modal.
+ *
+ * @since 4.9.0
+ * @returns {void}
+ */
+ component.showWarning = function() {
+ // Get the text within the modal.
+ var rawMessage = component.warning.find( '.file-editor-warning-message' ).text();
+ // Hide all the #wpwrap content from assistive technologies.
+ $( '#wpwrap' ).attr( 'aria-hidden', 'true' );
+ // Detach the warning modal from its position and append it to the body.
+ $( document.body )
+ .addClass( 'modal-open' )
+ .append( component.warning.detach() );
+ // Reveal the modal and set focus on the go back button.
+ component.warning
+ .removeClass( 'hidden' )
+ .find( '.file-editor-warning-go-back' ).focus();
+ // Get the links and buttons within the modal.
+ component.warningTabbables = component.warning.find( 'a, button' );
+ // Attach event handlers.
+ component.warningTabbables.on( 'keydown', component.constrainTabbing );
+ component.warning.on( 'click', '.file-editor-warning-dismiss', component.dismissWarning );
+ // Make screen readers announce the warning message after a short delay (necessary for some screen readers).
+ setTimeout( function() {
+ wp.a11y.speak( wp.sanitize.stripTags( rawMessage.replace( /\s+/g, ' ' ) ), 'assertive' );
+ }, 1000 );
+ };
+
+ /**
+ * Constrain tabbing within the warning modal.
+ *
+ * @since 4.9.0
+ * @param {object} event jQuery event object.
+ * @returns {void}
+ */
+ component.constrainTabbing = function( event ) {
+ var firstTabbable, lastTabbable;
+
+ if ( 9 !== event.which ) {
+ return;
+ }
+
+ firstTabbable = component.warningTabbables.first()[0];
+ lastTabbable = component.warningTabbables.last()[0];
+
+ if ( lastTabbable === event.target && ! event.shiftKey ) {
+ firstTabbable.focus();
+ event.preventDefault();
+ } else if ( firstTabbable === event.target && event.shiftKey ) {
+ lastTabbable.focus();
+ event.preventDefault();
+ }
+ };
+
+ /**
+ * Dismiss the warning modal.
+ *
+ * @since 4.9.0
+ * @returns {void}
+ */
+ component.dismissWarning = function() {
+
+ wp.ajax.post( 'dismiss-wp-pointer', {
+ pointer: component.themeOrPlugin + '_editor_notice'
+ });
+
+ // Hide modal.
+ component.warning.remove();
+ $( '#wpwrap' ).removeAttr( 'aria-hidden' );
+ $( 'body' ).removeClass( 'modal-open' );
+ };
+
+ /**
+ * Callback for when a change happens.
+ *
+ * @since 4.9.0
+ * @returns {void}
+ */
+ component.onChange = function() {
+ component.dirty = true;
+ component.removeNotice( 'file_saved' );
+ };
+
+ /**
+ * Submit file via Ajax.
+ *
+ * @since 4.9.0
+ * @param {jQuery.Event} event - Event.
+ * @returns {void}
+ */
+ component.submit = function( event ) {
+ var data = {}, request;
+ event.preventDefault(); // Prevent form submission in favor of Ajax below.
+ $.each( component.form.serializeArray(), function() {
+ data[ this.name ] = this.value;
+ } );
+
+ // Use value from codemirror if present.
+ if ( component.instance ) {
+ data.newcontent = component.instance.codemirror.getValue();
+ }
+
+ if ( component.isSaving ) {
+ return;
+ }
+
+ // Scroll ot the line that has the error.
+ if ( component.lintErrors.length ) {
+ component.instance.codemirror.setCursor( component.lintErrors[0].from.line );
+ return;
+ }
+
+ component.isSaving = true;
+ component.textarea.prop( 'readonly', true );
+ if ( component.instance ) {
+ component.instance.codemirror.setOption( 'readOnly', true );
+ }
+
+ component.spinner.addClass( 'is-active' );
+ request = wp.ajax.post( 'edit-theme-plugin-file', data );
+
+ // Remove previous save notice before saving.
+ if ( component.lastSaveNoticeCode ) {
+ component.removeNotice( component.lastSaveNoticeCode );
+ }
+
+ request.done( function( response ) {
+ component.lastSaveNoticeCode = 'file_saved';
+ component.addNotice({
+ code: component.lastSaveNoticeCode,
+ type: 'success',
+ message: response.message,
+ dismissible: true
+ });
+ component.dirty = false;
+ } );
+
+ request.fail( function( response ) {
+ var notice = $.extend(
+ {
+ code: 'save_error',
+ message: component.l10n.saveError
+ },
+ response,
+ {
+ type: 'error',
+ dismissible: true
+ }
+ );
+ component.lastSaveNoticeCode = notice.code;
+ component.addNotice( notice );
+ } );
+
+ request.always( function() {
+ component.spinner.removeClass( 'is-active' );
+ component.isSaving = false;
+
+ component.textarea.prop( 'readonly', false );
+ if ( component.instance ) {
+ component.instance.codemirror.setOption( 'readOnly', false );
+ }
+ } );
+ };
+
+ /**
+ * Add notice.
+ *
+ * @since 4.9.0
+ *
+ * @param {object} notice - Notice.
+ * @param {string} notice.code - Code.
+ * @param {string} notice.type - Type.
+ * @param {string} notice.message - Message.
+ * @param {boolean} [notice.dismissible=false] - Dismissible.
+ * @param {Function} [notice.onDismiss] - Callback for when a user dismisses the notice.
+ * @returns {jQuery} Notice element.
+ */
+ component.addNotice = function( notice ) {
+ var noticeElement;
+
+ if ( ! notice.code ) {
+ throw new Error( 'Missing code.' );
+ }
+
+ // Only let one notice of a given type be displayed at a time.
+ component.removeNotice( notice.code );
+
+ noticeElement = $( component.noticeTemplate( notice ) );
+ noticeElement.hide();
+
+ noticeElement.find( '.notice-dismiss' ).on( 'click', function() {
+ component.removeNotice( notice.code );
+ if ( notice.onDismiss ) {
+ notice.onDismiss( notice );
+ }
+ } );
+
+ wp.a11y.speak( notice.message );
+
+ component.noticesContainer.append( noticeElement );
+ noticeElement.slideDown( 'fast' );
+ component.noticeElements[ notice.code ] = noticeElement;
+ return noticeElement;
+ };
+
+ /**
+ * Remove notice.
+ *
+ * @since 4.9.0
+ *
+ * @param {string} code - Notice code.
+ * @returns {boolean} Whether a notice was removed.
+ */
+ component.removeNotice = function( code ) {
+ if ( component.noticeElements[ code ] ) {
+ component.noticeElements[ code ].slideUp( 'fast', function() {
+ $( this ).remove();
+ } );
+ delete component.noticeElements[ code ];
+ return true;
+ }
+ return false;
+ };
+
+ /**
+ * Initialize code editor.
+ *
+ * @since 4.9.0
+ * @returns {void}
+ */
+ component.initCodeEditor = function initCodeEditor() {
+ var codeEditorSettings, editor;
+
+ codeEditorSettings = $.extend( {}, component.codeEditor );
+
+ /**
+ * Handle tabbing to the field before the editor.
+ *
+ * @since 4.9.0
+ *
+ * @returns {void}
+ */
+ codeEditorSettings.onTabPrevious = function() {
+ $( '#templateside' ).find( ':tabbable' ).last().focus();
+ };
+
+ /**
+ * Handle tabbing to the field after the editor.
+ *
+ * @since 4.9.0
+ *
+ * @returns {void}
+ */
+ codeEditorSettings.onTabNext = function() {
+ $( '#template' ).find( ':tabbable:not(.CodeMirror-code)' ).first().focus();
+ };
+
+ /**
+ * Handle change to the linting errors.
+ *
+ * @since 4.9.0
+ *
+ * @param {Array} errors - List of linting errors.
+ * @returns {void}
+ */
+ codeEditorSettings.onChangeLintingErrors = function( errors ) {
+ component.lintErrors = errors;
+
+ // Only disable the button in onUpdateErrorNotice when there are errors so users can still feel they can click the button.
+ if ( 0 === errors.length ) {
+ component.submitButton.toggleClass( 'disabled', false );
+ }
+ };
+
+ /**
+ * Update error notice.
+ *
+ * @since 4.9.0
+ *
+ * @param {Array} errorAnnotations - Error annotations.
+ * @returns {void}
+ */
+ codeEditorSettings.onUpdateErrorNotice = function onUpdateErrorNotice( errorAnnotations ) {
+ var message, noticeElement;
+
+ component.submitButton.toggleClass( 'disabled', errorAnnotations.length > 0 );
+
+ if ( 0 !== errorAnnotations.length ) {
+ if ( 1 === errorAnnotations.length ) {
+ message = component.l10n.lintError.singular.replace( '%d', '1' );
+ } else {
+ message = component.l10n.lintError.plural.replace( '%d', String( errorAnnotations.length ) );
+ }
+ noticeElement = component.addNotice({
+ code: 'lint_errors',
+ type: 'error',
+ message: message,
+ dismissible: false
+ });
+ noticeElement.find( 'input[type=checkbox]' ).on( 'click', function() {
+ codeEditorSettings.onChangeLintingErrors( [] );
+ component.removeNotice( 'lint_errors' );
+ } );
+ } else {
+ component.removeNotice( 'lint_errors' );
+ }
+ };
+
+ editor = wp.codeEditor.initialize( $( '#newcontent' ), codeEditorSettings );
+ editor.codemirror.on( 'change', component.onChange );
+
+ // Improve the editor accessibility.
+ $( editor.codemirror.display.lineDiv )
+ .attr({
+ role: 'textbox',
+ 'aria-multiline': 'true',
+ 'aria-labelledby': 'theme-plugin-editor-label',
+ 'aria-describedby': 'editor-keyboard-trap-help-1 editor-keyboard-trap-help-2 editor-keyboard-trap-help-3 editor-keyboard-trap-help-4'
+ });
+
+ // Focus the editor when clicking on its label.
+ $( '#theme-plugin-editor-label' ).on( 'click', function() {
+ editor.codemirror.focus();
+ });
+
+ component.instance = editor;
+ };
+
+ /**
+ * Initialization of the file browser's folder states.
+ *
+ * @since 4.9.0
+ * @returns {void}
+ */
+ component.initFileBrowser = function initFileBrowser() {
+
+ var $templateside = $( '#templateside' );
+
+ // Collapse all folders.
+ $templateside.find( '[role="group"]' ).parent().attr( 'aria-expanded', false );
+
+ // Expand ancestors to the current file.
+ $templateside.find( '.notice' ).parents( '[aria-expanded]' ).attr( 'aria-expanded', true );
+
+ // Find Tree elements and enhance them.
+ $templateside.find( '[role="tree"]' ).each( function() {
+ var treeLinks = new TreeLinks( this );
+ treeLinks.init();
+ } );
+
+ // Scroll the current file into view.
+ $templateside.find( '.current-file:first' ).each( function() {
+ if ( this.scrollIntoViewIfNeeded ) {
+ this.scrollIntoViewIfNeeded();
+ } else {
+ this.scrollIntoView( false );
+ }
+ } );
+ };
+
+ /* jshint ignore:start */
+ /* jscs:disable */
+ /* eslint-disable */
+
+ /**
+ * Creates a new TreeitemLink.
+ *
+ * @since 4.9.0
+ * @class
+ * @private
+ * @see {@link https://www.w3.org/TR/wai-aria-practices-1.1/examples/treeview/treeview-2/treeview-2b.html|W3C Treeview Example}
+ * @license W3C-20150513
+ */
+ var TreeitemLink = (function () {
+ /**
+ * This content is licensed according to the W3C Software License at
+ * https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document
+ *
+ * File: TreeitemLink.js
+ *
+ * Desc: Treeitem widget that implements ARIA Authoring Practices
+ * for a tree being used as a file viewer
+ *
+ * Author: Jon Gunderson, Ku Ja Eun and Nicholas Hoyt
+ */
+
+ /**
+ * @constructor
+ *
+ * @desc
+ * Treeitem object for representing the state and user interactions for a
+ * treeItem widget
+ *
+ * @param node
+ * An element with the role=tree attribute
+ */
+
+ var TreeitemLink = function (node, treeObj, group) {
+
+ // Check whether node is a DOM element
+ if (typeof node !== 'object') {
+ return;
+ }
+
+ node.tabIndex = -1;
+ this.tree = treeObj;
+ this.groupTreeitem = group;
+ this.domNode = node;
+ this.label = node.textContent.trim();
+ this.stopDefaultClick = false;
+
+ if (node.getAttribute('aria-label')) {
+ this.label = node.getAttribute('aria-label').trim();
+ }
+
+ this.isExpandable = false;
+ this.isVisible = false;
+ this.inGroup = false;
+
+ if (group) {
+ this.inGroup = true;
+ }
+
+ var elem = node.firstElementChild;
+
+ while (elem) {
+
+ if (elem.tagName.toLowerCase() == 'ul') {
+ elem.setAttribute('role', 'group');
+ this.isExpandable = true;
+ break;
+ }
+
+ elem = elem.nextElementSibling;
+ }
+
+ this.keyCode = Object.freeze({
+ RETURN: 13,
+ SPACE: 32,
+ PAGEUP: 33,
+ PAGEDOWN: 34,
+ END: 35,
+ HOME: 36,
+ LEFT: 37,
+ UP: 38,
+ RIGHT: 39,
+ DOWN: 40
+ });
+ };
+
+ TreeitemLink.prototype.init = function () {
+ this.domNode.tabIndex = -1;
+
+ if (!this.domNode.getAttribute('role')) {
+ this.domNode.setAttribute('role', 'treeitem');
+ }
+
+ this.domNode.addEventListener('keydown', this.handleKeydown.bind(this));
+ this.domNode.addEventListener('click', this.handleClick.bind(this));
+ this.domNode.addEventListener('focus', this.handleFocus.bind(this));
+ this.domNode.addEventListener('blur', this.handleBlur.bind(this));
+
+ if (this.isExpandable) {
+ this.domNode.firstElementChild.addEventListener('mouseover', this.handleMouseOver.bind(this));
+ this.domNode.firstElementChild.addEventListener('mouseout', this.handleMouseOut.bind(this));
+ }
+ else {
+ this.domNode.addEventListener('mouseover', this.handleMouseOver.bind(this));
+ this.domNode.addEventListener('mouseout', this.handleMouseOut.bind(this));
+ }
+ };
+
+ TreeitemLink.prototype.isExpanded = function () {
+
+ if (this.isExpandable) {
+ return this.domNode.getAttribute('aria-expanded') === 'true';
+ }
+
+ return false;
+
+ };
+
+ /* EVENT HANDLERS */
+
+ TreeitemLink.prototype.handleKeydown = function (event) {
+ var tgt = event.currentTarget,
+ flag = false,
+ _char = event.key,
+ clickEvent;
+
+ function isPrintableCharacter(str) {
+ return str.length === 1 && str.match(/\S/);
+ }
+
+ function printableCharacter(item) {
+ if (_char == '*') {
+ item.tree.expandAllSiblingItems(item);
+ flag = true;
+ }
+ else {
+ if (isPrintableCharacter(_char)) {
+ item.tree.setFocusByFirstCharacter(item, _char);
+ flag = true;
+ }
+ }
+ }
+
+ this.stopDefaultClick = false;
+
+ if (event.altKey || event.ctrlKey || event.metaKey) {
+ return;
+ }
+
+ if (event.shift) {
+ if (event.keyCode == this.keyCode.SPACE || event.keyCode == this.keyCode.RETURN) {
+ event.stopPropagation();
+ this.stopDefaultClick = true;
+ }
+ else {
+ if (isPrintableCharacter(_char)) {
+ printableCharacter(this);
+ }
+ }
+ }
+ else {
+ switch (event.keyCode) {
+ case this.keyCode.SPACE:
+ case this.keyCode.RETURN:
+ if (this.isExpandable) {
+ if (this.isExpanded()) {
+ this.tree.collapseTreeitem(this);
+ }
+ else {
+ this.tree.expandTreeitem(this);
+ }
+ flag = true;
+ }
+ else {
+ event.stopPropagation();
+ this.stopDefaultClick = true;
+ }
+ break;
+
+ case this.keyCode.UP:
+ this.tree.setFocusToPreviousItem(this);
+ flag = true;
+ break;
+
+ case this.keyCode.DOWN:
+ this.tree.setFocusToNextItem(this);
+ flag = true;
+ break;
+
+ case this.keyCode.RIGHT:
+ if (this.isExpandable) {
+ if (this.isExpanded()) {
+ this.tree.setFocusToNextItem(this);
+ }
+ else {
+ this.tree.expandTreeitem(this);
+ }
+ }
+ flag = true;
+ break;
+
+ case this.keyCode.LEFT:
+ if (this.isExpandable && this.isExpanded()) {
+ this.tree.collapseTreeitem(this);
+ flag = true;
+ }
+ else {
+ if (this.inGroup) {
+ this.tree.setFocusToParentItem(this);
+ flag = true;
+ }
+ }
+ break;
+
+ case this.keyCode.HOME:
+ this.tree.setFocusToFirstItem();
+ flag = true;
+ break;
+
+ case this.keyCode.END:
+ this.tree.setFocusToLastItem();
+ flag = true;
+ break;
+
+ default:
+ if (isPrintableCharacter(_char)) {
+ printableCharacter(this);
+ }
+ break;
+ }
+ }
+
+ if (flag) {
+ event.stopPropagation();
+ event.preventDefault();
+ }
+ };
+
+ TreeitemLink.prototype.handleClick = function (event) {
+
+ // only process click events that directly happened on this treeitem
+ if (event.target !== this.domNode && event.target !== this.domNode.firstElementChild) {
+ return;
+ }
+
+ if (this.isExpandable) {
+ if (this.isExpanded()) {
+ this.tree.collapseTreeitem(this);
+ }
+ else {
+ this.tree.expandTreeitem(this);
+ }
+ event.stopPropagation();
+ }
+ };
+
+ TreeitemLink.prototype.handleFocus = function (event) {
+ var node = this.domNode;
+ if (this.isExpandable) {
+ node = node.firstElementChild;
+ }
+ node.classList.add('focus');
+ };
+
+ TreeitemLink.prototype.handleBlur = function (event) {
+ var node = this.domNode;
+ if (this.isExpandable) {
+ node = node.firstElementChild;
+ }
+ node.classList.remove('focus');
+ };
+
+ TreeitemLink.prototype.handleMouseOver = function (event) {
+ event.currentTarget.classList.add('hover');
+ };
+
+ TreeitemLink.prototype.handleMouseOut = function (event) {
+ event.currentTarget.classList.remove('hover');
+ };
+
+ return TreeitemLink;
+ })();
+
+ /**
+ * Creates a new TreeLinks.
+ *
+ * @since 4.9.0
+ * @class
+ * @private
+ * @see {@link https://www.w3.org/TR/wai-aria-practices-1.1/examples/treeview/treeview-2/treeview-2b.html|W3C Treeview Example}
+ * @license W3C-20150513
+ */
+ TreeLinks = (function () {
+ /*
+ * This content is licensed according to the W3C Software License at
+ * https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document
+ *
+ * File: TreeLinks.js
+ *
+ * Desc: Tree widget that implements ARIA Authoring Practices
+ * for a tree being used as a file viewer
+ *
+ * Author: Jon Gunderson, Ku Ja Eun and Nicholas Hoyt
+ */
+
+ /*
+ * @constructor
+ *
+ * @desc
+ * Tree item object for representing the state and user interactions for a
+ * tree widget
+ *
+ * @param node
+ * An element with the role=tree attribute
+ */
+
+ var TreeLinks = function (node) {
+ // Check whether node is a DOM element
+ if (typeof node !== 'object') {
+ return;
+ }
+
+ this.domNode = node;
+
+ this.treeitems = [];
+ this.firstChars = [];
+
+ this.firstTreeitem = null;
+ this.lastTreeitem = null;
+
+ };
+
+ TreeLinks.prototype.init = function () {
+
+ function findTreeitems(node, tree, group) {
+
+ var elem = node.firstElementChild;
+ var ti = group;
+
+ while (elem) {
+
+ if ((elem.tagName.toLowerCase() === 'li' && elem.firstElementChild.tagName.toLowerCase() === 'span') || elem.tagName.toLowerCase() === 'a') {
+ ti = new TreeitemLink(elem, tree, group);
+ ti.init();
+ tree.treeitems.push(ti);
+ tree.firstChars.push(ti.label.substring(0, 1).toLowerCase());
+ }
+
+ if (elem.firstElementChild) {
+ findTreeitems(elem, tree, ti);
+ }
+
+ elem = elem.nextElementSibling;
+ }
+ }
+
+ // initialize pop up menus
+ if (!this.domNode.getAttribute('role')) {
+ this.domNode.setAttribute('role', 'tree');
+ }
+
+ findTreeitems(this.domNode, this, false);
+
+ this.updateVisibleTreeitems();
+
+ this.firstTreeitem.domNode.tabIndex = 0;
+
+ };
+
+ TreeLinks.prototype.setFocusToItem = function (treeitem) {
+
+ for (var i = 0; i < this.treeitems.length; i++) {
+ var ti = this.treeitems[i];
+
+ if (ti === treeitem) {
+ ti.domNode.tabIndex = 0;
+ ti.domNode.focus();
+ }
+ else {
+ ti.domNode.tabIndex = -1;
+ }
+ }
+
+ };
+
+ TreeLinks.prototype.setFocusToNextItem = function (currentItem) {
+
+ var nextItem = false;
+
+ for (var i = (this.treeitems.length - 1); i >= 0; i--) {
+ var ti = this.treeitems[i];
+ if (ti === currentItem) {
+ break;
+ }
+ if (ti.isVisible) {
+ nextItem = ti;
+ }
+ }
+
+ if (nextItem) {
+ this.setFocusToItem(nextItem);
+ }
+
+ };
+
+ TreeLinks.prototype.setFocusToPreviousItem = function (currentItem) {
+
+ var prevItem = false;
+
+ for (var i = 0; i < this.treeitems.length; i++) {
+ var ti = this.treeitems[i];
+ if (ti === currentItem) {
+ break;
+ }
+ if (ti.isVisible) {
+ prevItem = ti;
+ }
+ }
+
+ if (prevItem) {
+ this.setFocusToItem(prevItem);
+ }
+ };
+
+ TreeLinks.prototype.setFocusToParentItem = function (currentItem) {
+
+ if (currentItem.groupTreeitem) {
+ this.setFocusToItem(currentItem.groupTreeitem);
+ }
+ };
+
+ TreeLinks.prototype.setFocusToFirstItem = function () {
+ this.setFocusToItem(this.firstTreeitem);
+ };
+
+ TreeLinks.prototype.setFocusToLastItem = function () {
+ this.setFocusToItem(this.lastTreeitem);
+ };
+
+ TreeLinks.prototype.expandTreeitem = function (currentItem) {
+
+ if (currentItem.isExpandable) {
+ currentItem.domNode.setAttribute('aria-expanded', true);
+ this.updateVisibleTreeitems();
+ }
+
+ };
+
+ TreeLinks.prototype.expandAllSiblingItems = function (currentItem) {
+ for (var i = 0; i < this.treeitems.length; i++) {
+ var ti = this.treeitems[i];
+
+ if ((ti.groupTreeitem === currentItem.groupTreeitem) && ti.isExpandable) {
+ this.expandTreeitem(ti);
+ }
+ }
+
+ };
+
+ TreeLinks.prototype.collapseTreeitem = function (currentItem) {
+
+ var groupTreeitem = false;
+
+ if (currentItem.isExpanded()) {
+ groupTreeitem = currentItem;
+ }
+ else {
+ groupTreeitem = currentItem.groupTreeitem;
+ }
+
+ if (groupTreeitem) {
+ groupTreeitem.domNode.setAttribute('aria-expanded', false);
+ this.updateVisibleTreeitems();
+ this.setFocusToItem(groupTreeitem);
+ }
+
+ };
+
+ TreeLinks.prototype.updateVisibleTreeitems = function () {
+
+ this.firstTreeitem = this.treeitems[0];
+
+ for (var i = 0; i < this.treeitems.length; i++) {
+ var ti = this.treeitems[i];
+
+ var parent = ti.domNode.parentNode;
+
+ ti.isVisible = true;
+
+ while (parent && (parent !== this.domNode)) {
+
+ if (parent.getAttribute('aria-expanded') == 'false') {
+ ti.isVisible = false;
+ }
+ parent = parent.parentNode;
+ }
+
+ if (ti.isVisible) {
+ this.lastTreeitem = ti;
+ }
+ }
+
+ };
+
+ TreeLinks.prototype.setFocusByFirstCharacter = function (currentItem, _char) {
+ var start, index;
+ _char = _char.toLowerCase();
+
+ // Get start index for search based on position of currentItem
+ start = this.treeitems.indexOf(currentItem) + 1;
+ if (start === this.treeitems.length) {
+ start = 0;
+ }
+
+ // Check remaining slots in the menu
+ index = this.getIndexFirstChars(start, _char);
+
+ // If not found in remaining slots, check from beginning
+ if (index === -1) {
+ index = this.getIndexFirstChars(0, _char);
+ }
+
+ // If match was found...
+ if (index > -1) {
+ this.setFocusToItem(this.treeitems[index]);
+ }
+ };
+
+ TreeLinks.prototype.getIndexFirstChars = function (startIndex, _char) {
+ for (var i = startIndex; i < this.firstChars.length; i++) {
+ if (this.treeitems[i].isVisible) {
+ if (_char === this.firstChars[i]) {
+ return i;
+ }
+ }
+ }
+ return -1;
+ };
+
+ return TreeLinks;
+ })();
+
+ /* jshint ignore:end */
+ /* jscs:enable */
+ /* eslint-enable */
+
+ return component;
+})( jQuery );
diff --git a/www/crm/wp-admin/js/theme-plugin-editor.min.js b/www/crm/wp-admin/js/theme-plugin-editor.min.js
new file mode 100644
index 00000000..7c1195ef
--- /dev/null
+++ b/www/crm/wp-admin/js/theme-plugin-editor.min.js
@@ -0,0 +1 @@
+window.wp||(window.wp={}),wp.themePluginEditor=function(a){"use strict";var b,c;b={l10n:{lintError:{singular:"",plural:""},saveAlert:"",saveError:""},codeEditor:{},instance:null,noticeElements:{},dirty:!1,lintErrors:[]},b.init=function(c,d){b.form=c,d&&a.extend(b,d),b.noticeTemplate=wp.template("wp-file-editor-notice"),b.noticesContainer=b.form.find(".editor-notices"),b.submitButton=b.form.find(":input[name=submit]"),b.spinner=b.form.find(".submit .spinner"),b.form.on("submit",b.submit),b.textarea=b.form.find("#newcontent"),b.textarea.on("change",b.onChange),b.warning=a(".file-editor-warning"),b.docsLookUpButton=b.form.find("#docs-lookup"),b.docsLookUpList=b.form.find("#docs-list"),b.warning.length>0&&b.showWarning(),!1!==b.codeEditor&&_.defer(function(){b.initCodeEditor()}),a(b.initFileBrowser),a(window).on("beforeunload",function(){if(b.dirty)return b.l10n.saveAlert}),b.docsLookUpList.on("change",function(){var c=a(this).val();""===c?b.docsLookUpButton.prop("disabled",!0):b.docsLookUpButton.prop("disabled",!1)})},b.showWarning=function(){var c=b.warning.find(".file-editor-warning-message").text();a("#wpwrap").attr("aria-hidden","true"),a(document.body).addClass("modal-open").append(b.warning.detach()),b.warning.removeClass("hidden").find(".file-editor-warning-go-back").focus(),b.warningTabbables=b.warning.find("a, button"),b.warningTabbables.on("keydown",b.constrainTabbing),b.warning.on("click",".file-editor-warning-dismiss",b.dismissWarning),setTimeout(function(){wp.a11y.speak(wp.sanitize.stripTags(c.replace(/\s+/g," ")),"assertive")},1e3)},b.constrainTabbing=function(a){var c,d;9===a.which&&(c=b.warningTabbables.first()[0],d=b.warningTabbables.last()[0],d!==a.target||a.shiftKey?c===a.target&&a.shiftKey&&(d.focus(),a.preventDefault()):(c.focus(),a.preventDefault()))},b.dismissWarning=function(){wp.ajax.post("dismiss-wp-pointer",{pointer:b.themeOrPlugin+"_editor_notice"}),b.warning.remove(),a("#wpwrap").removeAttr("aria-hidden"),a("body").removeClass("modal-open")},b.onChange=function(){b.dirty=!0,b.removeNotice("file_saved")},b.submit=function(c){var d,e={};if(c.preventDefault(),a.each(b.form.serializeArray(),function(){e[this.name]=this.value}),b.instance&&(e.newcontent=b.instance.codemirror.getValue()),!b.isSaving){if(b.lintErrors.length)return void b.instance.codemirror.setCursor(b.lintErrors[0].from.line);b.isSaving=!0,b.textarea.prop("readonly",!0),b.instance&&b.instance.codemirror.setOption("readOnly",!0),b.spinner.addClass("is-active"),d=wp.ajax.post("edit-theme-plugin-file",e),b.lastSaveNoticeCode&&b.removeNotice(b.lastSaveNoticeCode),d.done(function(a){b.lastSaveNoticeCode="file_saved",b.addNotice({code:b.lastSaveNoticeCode,type:"success",message:a.message,dismissible:!0}),b.dirty=!1}),d.fail(function(c){var d=a.extend({code:"save_error",message:b.l10n.saveError},c,{type:"error",dismissible:!0});b.lastSaveNoticeCode=d.code,b.addNotice(d)}),d.always(function(){b.spinner.removeClass("is-active"),b.isSaving=!1,b.textarea.prop("readonly",!1),b.instance&&b.instance.codemirror.setOption("readOnly",!1)})}},b.addNotice=function(c){var d;if(!c.code)throw new Error("Missing code.");return b.removeNotice(c.code),d=a(b.noticeTemplate(c)),d.hide(),d.find(".notice-dismiss").on("click",function(){b.removeNotice(c.code),c.onDismiss&&c.onDismiss(c)}),wp.a11y.speak(c.message),b.noticesContainer.append(d),d.slideDown("fast"),b.noticeElements[c.code]=d,d},b.removeNotice=function(c){return!!b.noticeElements[c]&&(b.noticeElements[c].slideUp("fast",function(){a(this).remove()}),delete b.noticeElements[c],!0)},b.initCodeEditor=function(){var c,d;c=a.extend({},b.codeEditor),c.onTabPrevious=function(){a("#templateside").find(":tabbable").last().focus()},c.onTabNext=function(){a("#template").find(":tabbable:not(.CodeMirror-code)").first().focus()},c.onChangeLintingErrors=function(a){b.lintErrors=a,0===a.length&&b.submitButton.toggleClass("disabled",!1)},c.onUpdateErrorNotice=function(a){var d,e;b.submitButton.toggleClass("disabled",a.length>0),0!==a.length?(d=1===a.length?b.l10n.lintError.singular.replace("%d","1"):b.l10n.lintError.plural.replace("%d",String(a.length)),e=b.addNotice({code:"lint_errors",type:"error",message:d,dismissible:!1}),e.find("input[type=checkbox]").on("click",function(){c.onChangeLintingErrors([]),b.removeNotice("lint_errors")})):b.removeNotice("lint_errors")},d=wp.codeEditor.initialize(a("#newcontent"),c),d.codemirror.on("change",b.onChange),a(d.codemirror.display.lineDiv).attr({role:"textbox","aria-multiline":"true","aria-labelledby":"theme-plugin-editor-label","aria-describedby":"editor-keyboard-trap-help-1 editor-keyboard-trap-help-2 editor-keyboard-trap-help-3 editor-keyboard-trap-help-4"}),a("#theme-plugin-editor-label").on("click",function(){d.codemirror.focus()}),b.instance=d},b.initFileBrowser=function(){var b=a("#templateside");b.find('[role="group"]').parent().attr("aria-expanded",!1),b.find(".notice").parents("[aria-expanded]").attr("aria-expanded",!0),b.find('[role="tree"]').each(function(){var a=new c(this);a.init()}),b.find(".current-file:first").each(function(){this.scrollIntoViewIfNeeded?this.scrollIntoViewIfNeeded():this.scrollIntoView(!1)})};var d=function(){var a=function(a,b,c){if("object"==typeof a){a.tabIndex=-1,this.tree=b,this.groupTreeitem=c,this.domNode=a,this.label=a.textContent.trim(),this.stopDefaultClick=!1,a.getAttribute("aria-label")&&(this.label=a.getAttribute("aria-label").trim()),this.isExpandable=!1,this.isVisible=!1,this.inGroup=!1,c&&(this.inGroup=!0);for(var d=a.firstElementChild;d;){if("ul"==d.tagName.toLowerCase()){d.setAttribute("role","group"),this.isExpandable=!0;break}d=d.nextElementSibling}this.keyCode=Object.freeze({RETURN:13,SPACE:32,PAGEUP:33,PAGEDOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40})}};return a.prototype.init=function(){this.domNode.tabIndex=-1,this.domNode.getAttribute("role")||this.domNode.setAttribute("role","treeitem"),this.domNode.addEventListener("keydown",this.handleKeydown.bind(this)),this.domNode.addEventListener("click",this.handleClick.bind(this)),this.domNode.addEventListener("focus",this.handleFocus.bind(this)),this.domNode.addEventListener("blur",this.handleBlur.bind(this)),this.isExpandable?(this.domNode.firstElementChild.addEventListener("mouseover",this.handleMouseOver.bind(this)),this.domNode.firstElementChild.addEventListener("mouseout",this.handleMouseOut.bind(this))):(this.domNode.addEventListener("mouseover",this.handleMouseOver.bind(this)),this.domNode.addEventListener("mouseout",this.handleMouseOut.bind(this)))},a.prototype.isExpanded=function(){return!!this.isExpandable&&"true"===this.domNode.getAttribute("aria-expanded")},a.prototype.handleKeydown=function(a){function b(a){return 1===a.length&&a.match(/\S/)}function c(a){"*"==e?(a.tree.expandAllSiblingItems(a),d=!0):b(e)&&(a.tree.setFocusByFirstCharacter(a,e),d=!0)}var d=(a.currentTarget,!1),e=a.key;if(this.stopDefaultClick=!1,!(a.altKey||a.ctrlKey||a.metaKey)){if(a.shift)a.keyCode==this.keyCode.SPACE||a.keyCode==this.keyCode.RETURN?(a.stopPropagation(),this.stopDefaultClick=!0):b(e)&&c(this);else switch(a.keyCode){case this.keyCode.SPACE:case this.keyCode.RETURN:this.isExpandable?(this.isExpanded()?this.tree.collapseTreeitem(this):this.tree.expandTreeitem(this),d=!0):(a.stopPropagation(),this.stopDefaultClick=!0);break;case this.keyCode.UP:this.tree.setFocusToPreviousItem(this),d=!0;break;case this.keyCode.DOWN:this.tree.setFocusToNextItem(this),d=!0;break;case this.keyCode.RIGHT:this.isExpandable&&(this.isExpanded()?this.tree.setFocusToNextItem(this):this.tree.expandTreeitem(this)),d=!0;break;case this.keyCode.LEFT:this.isExpandable&&this.isExpanded()?(this.tree.collapseTreeitem(this),d=!0):this.inGroup&&(this.tree.setFocusToParentItem(this),d=!0);break;case this.keyCode.HOME:this.tree.setFocusToFirstItem(),d=!0;break;case this.keyCode.END:this.tree.setFocusToLastItem(),d=!0;break;default:b(e)&&c(this)}d&&(a.stopPropagation(),a.preventDefault())}},a.prototype.handleClick=function(a){a.target!==this.domNode&&a.target!==this.domNode.firstElementChild||this.isExpandable&&(this.isExpanded()?this.tree.collapseTreeitem(this):this.tree.expandTreeitem(this),a.stopPropagation())},a.prototype.handleFocus=function(a){var b=this.domNode;this.isExpandable&&(b=b.firstElementChild),b.classList.add("focus")},a.prototype.handleBlur=function(a){var b=this.domNode;this.isExpandable&&(b=b.firstElementChild),b.classList.remove("focus")},a.prototype.handleMouseOver=function(a){a.currentTarget.classList.add("hover")},a.prototype.handleMouseOut=function(a){a.currentTarget.classList.remove("hover")},a}();return c=function(){var a=function(a){"object"==typeof a&&(this.domNode=a,this.treeitems=[],this.firstChars=[],this.firstTreeitem=null,this.lastTreeitem=null)};return a.prototype.init=function(){function a(b,c,e){for(var f=b.firstElementChild,g=e;f;)("li"===f.tagName.toLowerCase()&&"span"===f.firstElementChild.tagName.toLowerCase()||"a"===f.tagName.toLowerCase())&&(g=new d(f,c,e),g.init(),c.treeitems.push(g),c.firstChars.push(g.label.substring(0,1).toLowerCase())),f.firstElementChild&&a(f,c,g),f=f.nextElementSibling}this.domNode.getAttribute("role")||this.domNode.setAttribute("role","tree"),a(this.domNode,this,!1),this.updateVisibleTreeitems(),this.firstTreeitem.domNode.tabIndex=0},a.prototype.setFocusToItem=function(a){for(var b=0;b<this.treeitems.length;b++){var c=this.treeitems[b];c===a?(c.domNode.tabIndex=0,c.domNode.focus()):c.domNode.tabIndex=-1}},a.prototype.setFocusToNextItem=function(a){for(var b=!1,c=this.treeitems.length-1;c>=0;c--){var d=this.treeitems[c];if(d===a)break;d.isVisible&&(b=d)}b&&this.setFocusToItem(b)},a.prototype.setFocusToPreviousItem=function(a){for(var b=!1,c=0;c<this.treeitems.length;c++){var d=this.treeitems[c];if(d===a)break;d.isVisible&&(b=d)}b&&this.setFocusToItem(b)},a.prototype.setFocusToParentItem=function(a){a.groupTreeitem&&this.setFocusToItem(a.groupTreeitem)},a.prototype.setFocusToFirstItem=function(){this.setFocusToItem(this.firstTreeitem)},a.prototype.setFocusToLastItem=function(){this.setFocusToItem(this.lastTreeitem)},a.prototype.expandTreeitem=function(a){a.isExpandable&&(a.domNode.setAttribute("aria-expanded",!0),this.updateVisibleTreeitems())},a.prototype.expandAllSiblingItems=function(a){for(var b=0;b<this.treeitems.length;b++){var c=this.treeitems[b];c.groupTreeitem===a.groupTreeitem&&c.isExpandable&&this.expandTreeitem(c)}},a.prototype.collapseTreeitem=function(a){var b=!1;b=a.isExpanded()?a:a.groupTreeitem,b&&(b.domNode.setAttribute("aria-expanded",!1),this.updateVisibleTreeitems(),this.setFocusToItem(b))},a.prototype.updateVisibleTreeitems=function(){this.firstTreeitem=this.treeitems[0];for(var a=0;a<this.treeitems.length;a++){var b=this.treeitems[a],c=b.domNode.parentNode;for(b.isVisible=!0;c&&c!==this.domNode;)"false"==c.getAttribute("aria-expanded")&&(b.isVisible=!1),c=c.parentNode;b.isVisible&&(this.lastTreeitem=b)}},a.prototype.setFocusByFirstCharacter=function(a,b){var c,d;b=b.toLowerCase(),c=this.treeitems.indexOf(a)+1,c===this.treeitems.length&&(c=0),d=this.getIndexFirstChars(c,b),d===-1&&(d=this.getIndexFirstChars(0,b)),d>-1&&this.setFocusToItem(this.treeitems[d])},a.prototype.getIndexFirstChars=function(a,b){for(var c=a;c<this.firstChars.length;c++)if(this.treeitems[c].isVisible&&b===this.firstChars[c])return c;return-1},a}(),b}(jQuery); \ No newline at end of file
diff --git a/www/crm/wp-admin/js/theme.js b/www/crm/wp-admin/js/theme.js
new file mode 100644
index 00000000..596b097f
--- /dev/null
+++ b/www/crm/wp-admin/js/theme.js
@@ -0,0 +1,2067 @@
+/**
+ * @output wp-admin/js/theme.js
+ */
+
+/* global _wpThemeSettings, confirm, tb_position */
+window.wp = window.wp || {};
+
+( function($) {
+
+// Set up our namespace...
+var themes, l10n;
+themes = wp.themes = wp.themes || {};
+
+// Store the theme data and settings for organized and quick access
+// themes.data.settings, themes.data.themes, themes.data.l10n
+themes.data = _wpThemeSettings;
+l10n = themes.data.l10n;
+
+// Shortcut for isInstall check
+themes.isInstall = !! themes.data.settings.isInstall;
+
+// Setup app structure
+_.extend( themes, { model: {}, view: {}, routes: {}, router: {}, template: wp.template });
+
+themes.Model = Backbone.Model.extend({
+ // Adds attributes to the default data coming through the .org themes api
+ // Map `id` to `slug` for shared code
+ initialize: function() {
+ var description;
+
+ // If theme is already installed, set an attribute.
+ if ( _.indexOf( themes.data.installedThemes, this.get( 'slug' ) ) !== -1 ) {
+ this.set({ installed: true });
+ }
+
+ // Set the attributes
+ this.set({
+ // slug is for installation, id is for existing.
+ id: this.get( 'slug' ) || this.get( 'id' )
+ });
+
+ // Map `section.description` to `description`
+ // as the API sometimes returns it differently
+ if ( this.has( 'sections' ) ) {
+ description = this.get( 'sections' ).description;
+ this.set({ description: description });
+ }
+ }
+});
+
+// Main view controller for themes.php
+// Unifies and renders all available views
+themes.view.Appearance = wp.Backbone.View.extend({
+
+ el: '#wpbody-content .wrap .theme-browser',
+
+ window: $( window ),
+ // Pagination instance
+ page: 0,
+
+ // Sets up a throttler for binding to 'scroll'
+ initialize: function( options ) {
+ // Scroller checks how far the scroll position is
+ _.bindAll( this, 'scroller' );
+
+ this.SearchView = options.SearchView ? options.SearchView : themes.view.Search;
+ // Bind to the scroll event and throttle
+ // the results from this.scroller
+ this.window.bind( 'scroll', _.throttle( this.scroller, 300 ) );
+ },
+
+ // Main render control
+ render: function() {
+ // Setup the main theme view
+ // with the current theme collection
+ this.view = new themes.view.Themes({
+ collection: this.collection,
+ parent: this
+ });
+
+ // Render search form.
+ this.search();
+
+ this.$el.removeClass( 'search-loading' );
+
+ // Render and append
+ this.view.render();
+ this.$el.empty().append( this.view.el ).addClass( 'rendered' );
+ },
+
+ // Defines search element container
+ searchContainer: $( '.search-form' ),
+
+ // Search input and view
+ // for current theme collection
+ search: function() {
+ var view,
+ self = this;
+
+ // Don't render the search if there is only one theme
+ if ( themes.data.themes.length === 1 ) {
+ return;
+ }
+
+ view = new this.SearchView({
+ collection: self.collection,
+ parent: this
+ });
+ self.SearchView = view;
+
+ // Render and append after screen title
+ view.render();
+ this.searchContainer
+ .append( $.parseHTML( '<label class="screen-reader-text" for="wp-filter-search-input">' + l10n.search + '</label>' ) )
+ .append( view.el )
+ .on( 'submit', function( event ) {
+ event.preventDefault();
+ });
+ },
+
+ // Checks when the user gets close to the bottom
+ // of the mage and triggers a theme:scroll event
+ scroller: function() {
+ var self = this,
+ bottom, threshold;
+
+ bottom = this.window.scrollTop() + self.window.height();
+ threshold = self.$el.offset().top + self.$el.outerHeight( false ) - self.window.height();
+ threshold = Math.round( threshold * 0.9 );
+
+ if ( bottom > threshold ) {
+ this.trigger( 'theme:scroll' );
+ }
+ }
+});
+
+// Set up the Collection for our theme data
+// @has 'id' 'name' 'screenshot' 'author' 'authorURI' 'version' 'active' ...
+themes.Collection = Backbone.Collection.extend({
+
+ model: themes.Model,
+
+ // Search terms
+ terms: '',
+
+ // Controls searching on the current theme collection
+ // and triggers an update event
+ doSearch: function( value ) {
+
+ // Don't do anything if we've already done this search
+ // Useful because the Search handler fires multiple times per keystroke
+ if ( this.terms === value ) {
+ return;
+ }
+
+ // Updates terms with the value passed
+ this.terms = value;
+
+ // If we have terms, run a search...
+ if ( this.terms.length > 0 ) {
+ this.search( this.terms );
+ }
+
+ // If search is blank, show all themes
+ // Useful for resetting the views when you clean the input
+ if ( this.terms === '' ) {
+ this.reset( themes.data.themes );
+ $( 'body' ).removeClass( 'no-results' );
+ }
+
+ // Trigger a 'themes:update' event
+ this.trigger( 'themes:update' );
+ },
+
+ // Performs a search within the collection
+ // @uses RegExp
+ search: function( term ) {
+ var match, results, haystack, name, description, author;
+
+ // Start with a full collection
+ this.reset( themes.data.themes, { silent: true } );
+
+ // Escape the term string for RegExp meta characters
+ term = term.replace( /[-\/\\^$*+?.()|[\]{}]/g, '\\$&' );
+
+ // Consider spaces as word delimiters and match the whole string
+ // so matching terms can be combined
+ term = term.replace( / /g, ')(?=.*' );
+ match = new RegExp( '^(?=.*' + term + ').+', 'i' );
+
+ // Find results
+ // _.filter and .test
+ results = this.filter( function( data ) {
+ name = data.get( 'name' ).replace( /(<([^>]+)>)/ig, '' );
+ description = data.get( 'description' ).replace( /(<([^>]+)>)/ig, '' );
+ author = data.get( 'author' ).replace( /(<([^>]+)>)/ig, '' );
+
+ haystack = _.union( [ name, data.get( 'id' ), description, author, data.get( 'tags' ) ] );
+
+ if ( match.test( data.get( 'author' ) ) && term.length > 2 ) {
+ data.set( 'displayAuthor', true );
+ }
+
+ return match.test( haystack );
+ });
+
+ if ( results.length === 0 ) {
+ this.trigger( 'query:empty' );
+ } else {
+ $( 'body' ).removeClass( 'no-results' );
+ }
+
+ this.reset( results );
+ },
+
+ // Paginates the collection with a helper method
+ // that slices the collection
+ paginate: function( instance ) {
+ var collection = this;
+ instance = instance || 0;
+
+ // Themes per instance are set at 20
+ collection = _( collection.rest( 20 * instance ) );
+ collection = _( collection.first( 20 ) );
+
+ return collection;
+ },
+
+ count: false,
+
+ // Handles requests for more themes
+ // and caches results
+ //
+ // When we are missing a cache object we fire an apiCall()
+ // which triggers events of `query:success` or `query:fail`
+ query: function( request ) {
+ /**
+ * @static
+ * @type Array
+ */
+ var queries = this.queries,
+ self = this,
+ query, isPaginated, count;
+
+ // Store current query request args
+ // for later use with the event `theme:end`
+ this.currentQuery.request = request;
+
+ // Search the query cache for matches.
+ query = _.find( queries, function( query ) {
+ return _.isEqual( query.request, request );
+ });
+
+ // If the request matches the stored currentQuery.request
+ // it means we have a paginated request.
+ isPaginated = _.has( request, 'page' );
+
+ // Reset the internal api page counter for non paginated queries.
+ if ( ! isPaginated ) {
+ this.currentQuery.page = 1;
+ }
+
+ // Otherwise, send a new API call and add it to the cache.
+ if ( ! query && ! isPaginated ) {
+ query = this.apiCall( request ).done( function( data ) {
+
+ // Update the collection with the queried data.
+ if ( data.themes ) {
+ self.reset( data.themes );
+ count = data.info.results;
+ // Store the results and the query request
+ queries.push( { themes: data.themes, request: request, total: count } );
+ }
+
+ // Trigger a collection refresh event
+ // and a `query:success` event with a `count` argument.
+ self.trigger( 'themes:update' );
+ self.trigger( 'query:success', count );
+
+ if ( data.themes && data.themes.length === 0 ) {
+ self.trigger( 'query:empty' );
+ }
+
+ }).fail( function() {
+ self.trigger( 'query:fail' );
+ });
+ } else {
+ // If it's a paginated request we need to fetch more themes...
+ if ( isPaginated ) {
+ return this.apiCall( request, isPaginated ).done( function( data ) {
+ // Add the new themes to the current collection
+ // @todo update counter
+ self.add( data.themes );
+ self.trigger( 'query:success' );
+
+ // We are done loading themes for now.
+ self.loadingThemes = false;
+
+ }).fail( function() {
+ self.trigger( 'query:fail' );
+ });
+ }
+
+ if ( query.themes.length === 0 ) {
+ self.trigger( 'query:empty' );
+ } else {
+ $( 'body' ).removeClass( 'no-results' );
+ }
+
+ // Only trigger an update event since we already have the themes
+ // on our cached object
+ if ( _.isNumber( query.total ) ) {
+ this.count = query.total;
+ }
+
+ this.reset( query.themes );
+ if ( ! query.total ) {
+ this.count = this.length;
+ }
+
+ this.trigger( 'themes:update' );
+ this.trigger( 'query:success', this.count );
+ }
+ },
+
+ // Local cache array for API queries
+ queries: [],
+
+ // Keep track of current query so we can handle pagination
+ currentQuery: {
+ page: 1,
+ request: {}
+ },
+
+ // Send request to api.wordpress.org/themes
+ apiCall: function( request, paginated ) {
+ return wp.ajax.send( 'query-themes', {
+ data: {
+ // Request data
+ request: _.extend({
+ per_page: 100
+ }, request)
+ },
+
+ beforeSend: function() {
+ if ( ! paginated ) {
+ // Spin it
+ $( 'body' ).addClass( 'loading-content' ).removeClass( 'no-results' );
+ }
+ }
+ });
+ },
+
+ // Static status controller for when we are loading themes.
+ loadingThemes: false
+});
+
+// This is the view that controls each theme item
+// that will be displayed on the screen
+themes.view.Theme = wp.Backbone.View.extend({
+
+ // Wrap theme data on a div.theme element
+ className: 'theme',
+
+ // Reflects which theme view we have
+ // 'grid' (default) or 'detail'
+ state: 'grid',
+
+ // The HTML template for each element to be rendered
+ html: themes.template( 'theme' ),
+
+ events: {
+ 'click': themes.isInstall ? 'preview': 'expand',
+ 'keydown': themes.isInstall ? 'preview': 'expand',
+ 'touchend': themes.isInstall ? 'preview': 'expand',
+ 'keyup': 'addFocus',
+ 'touchmove': 'preventExpand',
+ 'click .theme-install': 'installTheme',
+ 'click .update-message': 'updateTheme'
+ },
+
+ touchDrag: false,
+
+ initialize: function() {
+ this.model.on( 'change', this.render, this );
+ },
+
+ render: function() {
+ var data = this.model.toJSON();
+
+ // Render themes using the html template
+ this.$el.html( this.html( data ) ).attr({
+ tabindex: 0,
+ 'aria-describedby' : data.id + '-action ' + data.id + '-name',
+ 'data-slug': data.id
+ });
+
+ // Renders active theme styles
+ this.activeTheme();
+
+ if ( this.model.get( 'displayAuthor' ) ) {
+ this.$el.addClass( 'display-author' );
+ }
+ },
+
+ // Adds a class to the currently active theme
+ // and to the overlay in detailed view mode
+ activeTheme: function() {
+ if ( this.model.get( 'active' ) ) {
+ this.$el.addClass( 'active' );
+ }
+ },
+
+ // Add class of focus to the theme we are focused on.
+ addFocus: function() {
+ var $themeToFocus = ( $( ':focus' ).hasClass( 'theme' ) ) ? $( ':focus' ) : $(':focus').parents('.theme');
+
+ $('.theme.focus').removeClass('focus');
+ $themeToFocus.addClass('focus');
+ },
+
+ // Single theme overlay screen
+ // It's shown when clicking a theme
+ expand: function( event ) {
+ var self = this;
+
+ event = event || window.event;
+
+ // 'enter' and 'space' keys expand the details view when a theme is :focused
+ if ( event.type === 'keydown' && ( event.which !== 13 && event.which !== 32 ) ) {
+ return;
+ }
+
+ // Bail if the user scrolled on a touch device
+ if ( this.touchDrag === true ) {
+ return this.touchDrag = false;
+ }
+
+ // Prevent the modal from showing when the user clicks
+ // one of the direct action buttons
+ if ( $( event.target ).is( '.theme-actions a' ) ) {
+ return;
+ }
+
+ // Prevent the modal from showing when the user clicks one of the direct action buttons.
+ if ( $( event.target ).is( '.theme-actions a, .update-message, .button-link, .notice-dismiss' ) ) {
+ return;
+ }
+
+ // Set focused theme to current element
+ themes.focusedTheme = this.$el;
+
+ this.trigger( 'theme:expand', self.model.cid );
+ },
+
+ preventExpand: function() {
+ this.touchDrag = true;
+ },
+
+ preview: function( event ) {
+ var self = this,
+ current, preview;
+
+ event = event || window.event;
+
+ // Bail if the user scrolled on a touch device
+ if ( this.touchDrag === true ) {
+ return this.touchDrag = false;
+ }
+
+ // Allow direct link path to installing a theme.
+ if ( $( event.target ).not( '.install-theme-preview' ).parents( '.theme-actions' ).length ) {
+ return;
+ }
+
+ // 'enter' and 'space' keys expand the details view when a theme is :focused
+ if ( event.type === 'keydown' && ( event.which !== 13 && event.which !== 32 ) ) {
+ return;
+ }
+
+ // pressing enter while focused on the buttons shouldn't open the preview
+ if ( event.type === 'keydown' && event.which !== 13 && $( ':focus' ).hasClass( 'button' ) ) {
+ return;
+ }
+
+ event.preventDefault();
+
+ event = event || window.event;
+
+ // Set focus to current theme.
+ themes.focusedTheme = this.$el;
+
+ // Construct a new Preview view.
+ themes.preview = preview = new themes.view.Preview({
+ model: this.model
+ });
+
+ // Render the view and append it.
+ preview.render();
+ this.setNavButtonsState();
+
+ // Hide previous/next navigation if there is only one theme
+ if ( this.model.collection.length === 1 ) {
+ preview.$el.addClass( 'no-navigation' );
+ } else {
+ preview.$el.removeClass( 'no-navigation' );
+ }
+
+ // Append preview
+ $( 'div.wrap' ).append( preview.el );
+
+ // Listen to our preview object
+ // for `theme:next` and `theme:previous` events.
+ this.listenTo( preview, 'theme:next', function() {
+
+ // Keep local track of current theme model.
+ current = self.model;
+
+ // If we have ventured away from current model update the current model position.
+ if ( ! _.isUndefined( self.current ) ) {
+ current = self.current;
+ }
+
+ // Get next theme model.
+ self.current = self.model.collection.at( self.model.collection.indexOf( current ) + 1 );
+
+ // If we have no more themes, bail.
+ if ( _.isUndefined( self.current ) ) {
+ self.options.parent.parent.trigger( 'theme:end' );
+ return self.current = current;
+ }
+
+ preview.model = self.current;
+
+ // Render and append.
+ preview.render();
+ this.setNavButtonsState();
+ $( '.next-theme' ).focus();
+ })
+ .listenTo( preview, 'theme:previous', function() {
+
+ // Keep track of current theme model.
+ current = self.model;
+
+ // Bail early if we are at the beginning of the collection
+ if ( self.model.collection.indexOf( self.current ) === 0 ) {
+ return;
+ }
+
+ // If we have ventured away from current model update the current model position.
+ if ( ! _.isUndefined( self.current ) ) {
+ current = self.current;
+ }
+
+ // Get previous theme model.
+ self.current = self.model.collection.at( self.model.collection.indexOf( current ) - 1 );
+
+ // If we have no more themes, bail.
+ if ( _.isUndefined( self.current ) ) {
+ return;
+ }
+
+ preview.model = self.current;
+
+ // Render and append.
+ preview.render();
+ this.setNavButtonsState();
+ $( '.previous-theme' ).focus();
+ });
+
+ this.listenTo( preview, 'preview:close', function() {
+ self.current = self.model;
+ });
+
+ },
+
+ // Handles .disabled classes for previous/next buttons in theme installer preview
+ setNavButtonsState: function() {
+ var $themeInstaller = $( '.theme-install-overlay' ),
+ current = _.isUndefined( this.current ) ? this.model : this.current,
+ previousThemeButton = $themeInstaller.find( '.previous-theme' ),
+ nextThemeButton = $themeInstaller.find( '.next-theme' );
+
+ // Disable previous at the zero position
+ if ( 0 === this.model.collection.indexOf( current ) ) {
+ previousThemeButton
+ .addClass( 'disabled' )
+ .prop( 'disabled', true );
+
+ nextThemeButton.focus();
+ }
+
+ // Disable next if the next model is undefined
+ if ( _.isUndefined( this.model.collection.at( this.model.collection.indexOf( current ) + 1 ) ) ) {
+ nextThemeButton
+ .addClass( 'disabled' )
+ .prop( 'disabled', true );
+
+ previousThemeButton.focus();
+ }
+ },
+
+ installTheme: function( event ) {
+ var _this = this;
+
+ event.preventDefault();
+
+ wp.updates.maybeRequestFilesystemCredentials( event );
+
+ $( document ).on( 'wp-theme-install-success', function( event, response ) {
+ if ( _this.model.get( 'id' ) === response.slug ) {
+ _this.model.set( { 'installed': true } );
+ }
+ } );
+
+ wp.updates.installTheme( {
+ slug: $( event.target ).data( 'slug' )
+ } );
+ },
+
+ updateTheme: function( event ) {
+ var _this = this;
+
+ if ( ! this.model.get( 'hasPackage' ) ) {
+ return;
+ }
+
+ event.preventDefault();
+
+ wp.updates.maybeRequestFilesystemCredentials( event );
+
+ $( document ).on( 'wp-theme-update-success', function( event, response ) {
+ _this.model.off( 'change', _this.render, _this );
+ if ( _this.model.get( 'id' ) === response.slug ) {
+ _this.model.set( {
+ hasUpdate: false,
+ version: response.newVersion
+ } );
+ }
+ _this.model.on( 'change', _this.render, _this );
+ } );
+
+ wp.updates.updateTheme( {
+ slug: $( event.target ).parents( 'div.theme' ).first().data( 'slug' )
+ } );
+ }
+});
+
+// Theme Details view
+// Set ups a modal overlay with the expanded theme data
+themes.view.Details = wp.Backbone.View.extend({
+
+ // Wrap theme data on a div.theme element
+ className: 'theme-overlay',
+
+ events: {
+ 'click': 'collapse',
+ 'click .delete-theme': 'deleteTheme',
+ 'click .left': 'previousTheme',
+ 'click .right': 'nextTheme',
+ 'click #update-theme': 'updateTheme'
+ },
+
+ // The HTML template for the theme overlay
+ html: themes.template( 'theme-single' ),
+
+ render: function() {
+ var data = this.model.toJSON();
+ this.$el.html( this.html( data ) );
+ // Renders active theme styles
+ this.activeTheme();
+ // Set up navigation events
+ this.navigation();
+ // Checks screenshot size
+ this.screenshotCheck( this.$el );
+ // Contain "tabbing" inside the overlay
+ this.containFocus( this.$el );
+ },
+
+ // Adds a class to the currently active theme
+ // and to the overlay in detailed view mode
+ activeTheme: function() {
+ // Check the model has the active property
+ this.$el.toggleClass( 'active', this.model.get( 'active' ) );
+ },
+
+ // Set initial focus and constrain tabbing within the theme browser modal.
+ containFocus: function( $el ) {
+
+ // Set initial focus on the primary action control.
+ _.delay( function() {
+ $( '.theme-overlay' ).focus();
+ }, 100 );
+
+ // Constrain tabbing within the modal.
+ $el.on( 'keydown.wp-themes', function( event ) {
+ var $firstFocusable = $el.find( '.theme-header button:not(.disabled)' ).first(),
+ $lastFocusable = $el.find( '.theme-actions a:visible' ).last();
+
+ // Check for the Tab key.
+ if ( 9 === event.which ) {
+ if ( $firstFocusable[0] === event.target && event.shiftKey ) {
+ $lastFocusable.focus();
+ event.preventDefault();
+ } else if ( $lastFocusable[0] === event.target && ! event.shiftKey ) {
+ $firstFocusable.focus();
+ event.preventDefault();
+ }
+ }
+ });
+ },
+
+ // Single theme overlay screen
+ // It's shown when clicking a theme
+ collapse: function( event ) {
+ var self = this,
+ scroll;
+
+ event = event || window.event;
+
+ // Prevent collapsing detailed view when there is only one theme available
+ if ( themes.data.themes.length === 1 ) {
+ return;
+ }
+
+ // Detect if the click is inside the overlay
+ // and don't close it unless the target was
+ // the div.back button
+ if ( $( event.target ).is( '.theme-backdrop' ) || $( event.target ).is( '.close' ) || event.keyCode === 27 ) {
+
+ // Add a temporary closing class while overlay fades out
+ $( 'body' ).addClass( 'closing-overlay' );
+
+ // With a quick fade out animation
+ this.$el.fadeOut( 130, function() {
+ // Clicking outside the modal box closes the overlay
+ $( 'body' ).removeClass( 'closing-overlay' );
+ // Handle event cleanup
+ self.closeOverlay();
+
+ // Get scroll position to avoid jumping to the top
+ scroll = document.body.scrollTop;
+
+ // Clean the url structure
+ themes.router.navigate( themes.router.baseUrl( '' ) );
+
+ // Restore scroll position
+ document.body.scrollTop = scroll;
+
+ // Return focus to the theme div
+ if ( themes.focusedTheme ) {
+ themes.focusedTheme.focus();
+ }
+ });
+ }
+ },
+
+ // Handles .disabled classes for next/previous buttons
+ navigation: function() {
+
+ // Disable Left/Right when at the start or end of the collection
+ if ( this.model.cid === this.model.collection.at(0).cid ) {
+ this.$el.find( '.left' )
+ .addClass( 'disabled' )
+ .prop( 'disabled', true );
+ }
+ if ( this.model.cid === this.model.collection.at( this.model.collection.length - 1 ).cid ) {
+ this.$el.find( '.right' )
+ .addClass( 'disabled' )
+ .prop( 'disabled', true );
+ }
+ },
+
+ // Performs the actions to effectively close
+ // the theme details overlay
+ closeOverlay: function() {
+ $( 'body' ).removeClass( 'modal-open' );
+ this.remove();
+ this.unbind();
+ this.trigger( 'theme:collapse' );
+ },
+
+ updateTheme: function( event ) {
+ var _this = this;
+ event.preventDefault();
+
+ wp.updates.maybeRequestFilesystemCredentials( event );
+
+ $( document ).on( 'wp-theme-update-success', function( event, response ) {
+ if ( _this.model.get( 'id' ) === response.slug ) {
+ _this.model.set( {
+ hasUpdate: false,
+ version: response.newVersion
+ } );
+ }
+ _this.render();
+ } );
+
+ wp.updates.updateTheme( {
+ slug: $( event.target ).data( 'slug' )
+ } );
+ },
+
+ deleteTheme: function( event ) {
+ var _this = this,
+ _collection = _this.model.collection,
+ _themes = themes;
+ event.preventDefault();
+
+ // Confirmation dialog for deleting a theme.
+ if ( ! window.confirm( wp.themes.data.settings.confirmDelete ) ) {
+ return;
+ }
+
+ wp.updates.maybeRequestFilesystemCredentials( event );
+
+ $( document ).one( 'wp-theme-delete-success', function( event, response ) {
+ _this.$el.find( '.close' ).trigger( 'click' );
+ $( '[data-slug="' + response.slug + '"]' ).css( { backgroundColor:'#faafaa' } ).fadeOut( 350, function() {
+ $( this ).remove();
+ _themes.data.themes = _.without( _themes.data.themes, _.findWhere( _themes.data.themes, { id: response.slug } ) );
+
+ $( '.wp-filter-search' ).val( '' );
+ _collection.doSearch( '' );
+ _collection.remove( _this.model );
+ _collection.trigger( 'themes:update' );
+ } );
+ } );
+
+ wp.updates.deleteTheme( {
+ slug: this.model.get( 'id' )
+ } );
+ },
+
+ nextTheme: function() {
+ var self = this;
+ self.trigger( 'theme:next', self.model.cid );
+ return false;
+ },
+
+ previousTheme: function() {
+ var self = this;
+ self.trigger( 'theme:previous', self.model.cid );
+ return false;
+ },
+
+ // Checks if the theme screenshot is the old 300px width version
+ // and adds a corresponding class if it's true
+ screenshotCheck: function( el ) {
+ var screenshot, image;
+
+ screenshot = el.find( '.screenshot img' );
+ image = new Image();
+ image.src = screenshot.attr( 'src' );
+
+ // Width check
+ if ( image.width && image.width <= 300 ) {
+ el.addClass( 'small-screenshot' );
+ }
+ }
+});
+
+// Theme Preview view
+// Set ups a modal overlay with the expanded theme data
+themes.view.Preview = themes.view.Details.extend({
+
+ className: 'wp-full-overlay expanded',
+ el: '.theme-install-overlay',
+
+ events: {
+ 'click .close-full-overlay': 'close',
+ 'click .collapse-sidebar': 'collapse',
+ 'click .devices button': 'previewDevice',
+ 'click .previous-theme': 'previousTheme',
+ 'click .next-theme': 'nextTheme',
+ 'keyup': 'keyEvent',
+ 'click .theme-install': 'installTheme'
+ },
+
+ // The HTML template for the theme preview
+ html: themes.template( 'theme-preview' ),
+
+ render: function() {
+ var self = this,
+ currentPreviewDevice,
+ data = this.model.toJSON(),
+ $body = $( document.body );
+
+ $body.attr( 'aria-busy', 'true' );
+
+ this.$el.removeClass( 'iframe-ready' ).html( this.html( data ) );
+
+ currentPreviewDevice = this.$el.data( 'current-preview-device' );
+ if ( currentPreviewDevice ) {
+ self.tooglePreviewDeviceButtons( currentPreviewDevice );
+ }
+
+ themes.router.navigate( themes.router.baseUrl( themes.router.themePath + this.model.get( 'id' ) ), { replace: false } );
+
+ this.$el.fadeIn( 200, function() {
+ $body.addClass( 'theme-installer-active full-overlay-active' );
+ });
+
+ this.$el.find( 'iframe' ).one( 'load', function() {
+ self.iframeLoaded();
+ });
+ },
+
+ iframeLoaded: function() {
+ this.$el.addClass( 'iframe-ready' );
+ $( document.body ).attr( 'aria-busy', 'false' );
+ },
+
+ close: function() {
+ this.$el.fadeOut( 200, function() {
+ $( 'body' ).removeClass( 'theme-installer-active full-overlay-active' );
+
+ // Return focus to the theme div
+ if ( themes.focusedTheme ) {
+ themes.focusedTheme.focus();
+ }
+ }).removeClass( 'iframe-ready' );
+
+ // Restore the previous browse tab if available.
+ if ( themes.router.selectedTab ) {
+ themes.router.navigate( themes.router.baseUrl( '?browse=' + themes.router.selectedTab ) );
+ themes.router.selectedTab = false;
+ } else {
+ themes.router.navigate( themes.router.baseUrl( '' ) );
+ }
+ this.trigger( 'preview:close' );
+ this.undelegateEvents();
+ this.unbind();
+ return false;
+ },
+
+ collapse: function( event ) {
+ var $button = $( event.currentTarget );
+ if ( 'true' === $button.attr( 'aria-expanded' ) ) {
+ $button.attr({ 'aria-expanded': 'false', 'aria-label': l10n.expandSidebar });
+ } else {
+ $button.attr({ 'aria-expanded': 'true', 'aria-label': l10n.collapseSidebar });
+ }
+
+ this.$el.toggleClass( 'collapsed' ).toggleClass( 'expanded' );
+ return false;
+ },
+
+ previewDevice: function( event ) {
+ var device = $( event.currentTarget ).data( 'device' );
+
+ this.$el
+ .removeClass( 'preview-desktop preview-tablet preview-mobile' )
+ .addClass( 'preview-' + device )
+ .data( 'current-preview-device', device );
+
+ this.tooglePreviewDeviceButtons( device );
+ },
+
+ tooglePreviewDeviceButtons: function( newDevice ) {
+ var $devices = $( '.wp-full-overlay-footer .devices' );
+
+ $devices.find( 'button' )
+ .removeClass( 'active' )
+ .attr( 'aria-pressed', false );
+
+ $devices.find( 'button.preview-' + newDevice )
+ .addClass( 'active' )
+ .attr( 'aria-pressed', true );
+ },
+
+ keyEvent: function( event ) {
+ // The escape key closes the preview
+ if ( event.keyCode === 27 ) {
+ this.undelegateEvents();
+ this.close();
+ }
+ // The right arrow key, next theme
+ if ( event.keyCode === 39 ) {
+ _.once( this.nextTheme() );
+ }
+
+ // The left arrow key, previous theme
+ if ( event.keyCode === 37 ) {
+ this.previousTheme();
+ }
+ },
+
+ installTheme: function( event ) {
+ var _this = this,
+ $target = $( event.target );
+ event.preventDefault();
+
+ if ( $target.hasClass( 'disabled' ) ) {
+ return;
+ }
+
+ wp.updates.maybeRequestFilesystemCredentials( event );
+
+ $( document ).on( 'wp-theme-install-success', function() {
+ _this.model.set( { 'installed': true } );
+ } );
+
+ wp.updates.installTheme( {
+ slug: $target.data( 'slug' )
+ } );
+ }
+});
+
+// Controls the rendering of div.themes,
+// a wrapper that will hold all the theme elements
+themes.view.Themes = wp.Backbone.View.extend({
+
+ className: 'themes wp-clearfix',
+ $overlay: $( 'div.theme-overlay' ),
+
+ // Number to keep track of scroll position
+ // while in theme-overlay mode
+ index: 0,
+
+ // The theme count element
+ count: $( '.wrap .theme-count' ),
+
+ // The live themes count
+ liveThemeCount: 0,
+
+ initialize: function( options ) {
+ var self = this;
+
+ // Set up parent
+ this.parent = options.parent;
+
+ // Set current view to [grid]
+ this.setView( 'grid' );
+
+ // Move the active theme to the beginning of the collection
+ self.currentTheme();
+
+ // When the collection is updated by user input...
+ this.listenTo( self.collection, 'themes:update', function() {
+ self.parent.page = 0;
+ self.currentTheme();
+ self.render( this );
+ } );
+
+ // Update theme count to full result set when available.
+ this.listenTo( self.collection, 'query:success', function( count ) {
+ if ( _.isNumber( count ) ) {
+ self.count.text( count );
+ self.announceSearchResults( count );
+ } else {
+ self.count.text( self.collection.length );
+ self.announceSearchResults( self.collection.length );
+ }
+ });
+
+ this.listenTo( self.collection, 'query:empty', function() {
+ $( 'body' ).addClass( 'no-results' );
+ });
+
+ this.listenTo( this.parent, 'theme:scroll', function() {
+ self.renderThemes( self.parent.page );
+ });
+
+ this.listenTo( this.parent, 'theme:close', function() {
+ if ( self.overlay ) {
+ self.overlay.closeOverlay();
+ }
+ } );
+
+ // Bind keyboard events.
+ $( 'body' ).on( 'keyup', function( event ) {
+ if ( ! self.overlay ) {
+ return;
+ }
+
+ // Bail if the filesystem credentials dialog is shown.
+ if ( $( '#request-filesystem-credentials-dialog' ).is( ':visible' ) ) {
+ return;
+ }
+
+ // Pressing the right arrow key fires a theme:next event
+ if ( event.keyCode === 39 ) {
+ self.overlay.nextTheme();
+ }
+
+ // Pressing the left arrow key fires a theme:previous event
+ if ( event.keyCode === 37 ) {
+ self.overlay.previousTheme();
+ }
+
+ // Pressing the escape key fires a theme:collapse event
+ if ( event.keyCode === 27 ) {
+ self.overlay.collapse( event );
+ }
+ });
+ },
+
+ // Manages rendering of theme pages
+ // and keeping theme count in sync
+ render: function() {
+ // Clear the DOM, please
+ this.$el.empty();
+
+ // If the user doesn't have switch capabilities
+ // or there is only one theme in the collection
+ // render the detailed view of the active theme
+ if ( themes.data.themes.length === 1 ) {
+
+ // Constructs the view
+ this.singleTheme = new themes.view.Details({
+ model: this.collection.models[0]
+ });
+
+ // Render and apply a 'single-theme' class to our container
+ this.singleTheme.render();
+ this.$el.addClass( 'single-theme' );
+ this.$el.append( this.singleTheme.el );
+ }
+
+ // Generate the themes
+ // Using page instance
+ // While checking the collection has items
+ if ( this.options.collection.size() > 0 ) {
+ this.renderThemes( this.parent.page );
+ }
+
+ // Display a live theme count for the collection
+ this.liveThemeCount = this.collection.count ? this.collection.count : this.collection.length;
+ this.count.text( this.liveThemeCount );
+
+ /*
+ * In the theme installer the themes count is already announced
+ * because `announceSearchResults` is called on `query:success`.
+ */
+ if ( ! themes.isInstall ) {
+ this.announceSearchResults( this.liveThemeCount );
+ }
+ },
+
+ // Iterates through each instance of the collection
+ // and renders each theme module
+ renderThemes: function( page ) {
+ var self = this;
+
+ self.instance = self.collection.paginate( page );
+
+ // If we have no more themes bail
+ if ( self.instance.size() === 0 ) {
+ // Fire a no-more-themes event.
+ this.parent.trigger( 'theme:end' );
+ return;
+ }
+
+ // Make sure the add-new stays at the end
+ if ( ! themes.isInstall && page >= 1 ) {
+ $( '.add-new-theme' ).remove();
+ }
+
+ // Loop through the themes and setup each theme view
+ self.instance.each( function( theme ) {
+ self.theme = new themes.view.Theme({
+ model: theme,
+ parent: self
+ });
+
+ // Render the views...
+ self.theme.render();
+ // and append them to div.themes
+ self.$el.append( self.theme.el );
+
+ // Binds to theme:expand to show the modal box
+ // with the theme details
+ self.listenTo( self.theme, 'theme:expand', self.expand, self );
+ });
+
+ // 'Add new theme' element shown at the end of the grid
+ if ( ! themes.isInstall && themes.data.settings.canInstall ) {
+ this.$el.append( '<div class="theme add-new-theme"><a href="' + themes.data.settings.installURI + '"><div class="theme-screenshot"><span></span></div><h2 class="theme-name">' + l10n.addNew + '</h2></a></div>' );
+ }
+
+ this.parent.page++;
+ },
+
+ // Grabs current theme and puts it at the beginning of the collection
+ currentTheme: function() {
+ var self = this,
+ current;
+
+ current = self.collection.findWhere({ active: true });
+
+ // Move the active theme to the beginning of the collection
+ if ( current ) {
+ self.collection.remove( current );
+ self.collection.add( current, { at:0 } );
+ }
+ },
+
+ // Sets current view
+ setView: function( view ) {
+ return view;
+ },
+
+ // Renders the overlay with the ThemeDetails view
+ // Uses the current model data
+ expand: function( id ) {
+ var self = this, $card, $modal;
+
+ // Set the current theme model
+ this.model = self.collection.get( id );
+
+ // Trigger a route update for the current model
+ themes.router.navigate( themes.router.baseUrl( themes.router.themePath + this.model.id ) );
+
+ // Sets this.view to 'detail'
+ this.setView( 'detail' );
+ $( 'body' ).addClass( 'modal-open' );
+
+ // Set up the theme details view
+ this.overlay = new themes.view.Details({
+ model: self.model
+ });
+
+ this.overlay.render();
+
+ if ( this.model.get( 'hasUpdate' ) ) {
+ $card = $( '[data-slug="' + this.model.id + '"]' );
+ $modal = $( this.overlay.el );
+
+ if ( $card.find( '.updating-message' ).length ) {
+ $modal.find( '.notice-warning h3' ).remove();
+ $modal.find( '.notice-warning' )
+ .removeClass( 'notice-large' )
+ .addClass( 'updating-message' )
+ .find( 'p' ).text( wp.updates.l10n.updating );
+ } else if ( $card.find( '.notice-error' ).length ) {
+ $modal.find( '.notice-warning' ).remove();
+ }
+ }
+
+ this.$overlay.html( this.overlay.el );
+
+ // Bind to theme:next and theme:previous
+ // triggered by the arrow keys
+ //
+ // Keep track of the current model so we
+ // can infer an index position
+ this.listenTo( this.overlay, 'theme:next', function() {
+ // Renders the next theme on the overlay
+ self.next( [ self.model.cid ] );
+
+ })
+ .listenTo( this.overlay, 'theme:previous', function() {
+ // Renders the previous theme on the overlay
+ self.previous( [ self.model.cid ] );
+ });
+ },
+
+ // This method renders the next theme on the overlay modal
+ // based on the current position in the collection
+ // @params [model cid]
+ next: function( args ) {
+ var self = this,
+ model, nextModel;
+
+ // Get the current theme
+ model = self.collection.get( args[0] );
+ // Find the next model within the collection
+ nextModel = self.collection.at( self.collection.indexOf( model ) + 1 );
+
+ // Sanity check which also serves as a boundary test
+ if ( nextModel !== undefined ) {
+
+ // We have a new theme...
+ // Close the overlay
+ this.overlay.closeOverlay();
+
+ // Trigger a route update for the current model
+ self.theme.trigger( 'theme:expand', nextModel.cid );
+
+ }
+ },
+
+ // This method renders the previous theme on the overlay modal
+ // based on the current position in the collection
+ // @params [model cid]
+ previous: function( args ) {
+ var self = this,
+ model, previousModel;
+
+ // Get the current theme
+ model = self.collection.get( args[0] );
+ // Find the previous model within the collection
+ previousModel = self.collection.at( self.collection.indexOf( model ) - 1 );
+
+ if ( previousModel !== undefined ) {
+
+ // We have a new theme...
+ // Close the overlay
+ this.overlay.closeOverlay();
+
+ // Trigger a route update for the current model
+ self.theme.trigger( 'theme:expand', previousModel.cid );
+
+ }
+ },
+
+ // Dispatch audible search results feedback message
+ announceSearchResults: function( count ) {
+ if ( 0 === count ) {
+ wp.a11y.speak( l10n.noThemesFound );
+ } else {
+ wp.a11y.speak( l10n.themesFound.replace( '%d', count ) );
+ }
+ }
+});
+
+// Search input view controller.
+themes.view.Search = wp.Backbone.View.extend({
+
+ tagName: 'input',
+ className: 'wp-filter-search',
+ id: 'wp-filter-search-input',
+ searching: false,
+
+ attributes: {
+ placeholder: l10n.searchPlaceholder,
+ type: 'search',
+ 'aria-describedby': 'live-search-desc'
+ },
+
+ events: {
+ 'input': 'search',
+ 'keyup': 'search',
+ 'blur': 'pushState'
+ },
+
+ initialize: function( options ) {
+
+ this.parent = options.parent;
+
+ this.listenTo( this.parent, 'theme:close', function() {
+ this.searching = false;
+ } );
+
+ },
+
+ search: function( event ) {
+ // Clear on escape.
+ if ( event.type === 'keyup' && event.which === 27 ) {
+ event.target.value = '';
+ }
+
+ // Since doSearch is debounced, it will only run when user input comes to a rest.
+ this.doSearch( event );
+ },
+
+ // Runs a search on the theme collection.
+ doSearch: function( event ) {
+ var options = {};
+
+ this.collection.doSearch( event.target.value.replace( /\+/g, ' ' ) );
+
+ // if search is initiated and key is not return
+ if ( this.searching && event.which !== 13 ) {
+ options.replace = true;
+ } else {
+ this.searching = true;
+ }
+
+ // Update the URL hash
+ if ( event.target.value ) {
+ themes.router.navigate( themes.router.baseUrl( themes.router.searchPath + event.target.value ), options );
+ } else {
+ themes.router.navigate( themes.router.baseUrl( '' ) );
+ }
+ },
+
+ pushState: function( event ) {
+ var url = themes.router.baseUrl( '' );
+
+ if ( event.target.value ) {
+ url = themes.router.baseUrl( themes.router.searchPath + encodeURIComponent( event.target.value ) );
+ }
+
+ this.searching = false;
+ themes.router.navigate( url );
+
+ }
+});
+
+/**
+ * Navigate router.
+ *
+ * @since 4.9.0
+ *
+ * @param {string} url - URL to navigate to.
+ * @param {object} state - State.
+ * @returns {void}
+ */
+function navigateRouter( url, state ) {
+ var router = this;
+ if ( Backbone.history._hasPushState ) {
+ Backbone.Router.prototype.navigate.call( router, url, state );
+ }
+}
+
+// Sets up the routes events for relevant url queries
+// Listens to [theme] and [search] params
+themes.Router = Backbone.Router.extend({
+
+ routes: {
+ 'themes.php?theme=:slug': 'theme',
+ 'themes.php?search=:query': 'search',
+ 'themes.php?s=:query': 'search',
+ 'themes.php': 'themes',
+ '': 'themes'
+ },
+
+ baseUrl: function( url ) {
+ return 'themes.php' + url;
+ },
+
+ themePath: '?theme=',
+ searchPath: '?search=',
+
+ search: function( query ) {
+ $( '.wp-filter-search' ).val( query.replace( /\+/g, ' ' ) );
+ },
+
+ themes: function() {
+ $( '.wp-filter-search' ).val( '' );
+ },
+
+ navigate: navigateRouter
+
+});
+
+// Execute and setup the application
+themes.Run = {
+ init: function() {
+ // Initializes the blog's theme library view
+ // Create a new collection with data
+ this.themes = new themes.Collection( themes.data.themes );
+
+ // Set up the view
+ this.view = new themes.view.Appearance({
+ collection: this.themes
+ });
+
+ this.render();
+
+ // Start debouncing user searches after Backbone.history.start().
+ this.view.SearchView.doSearch = _.debounce( this.view.SearchView.doSearch, 500 );
+ },
+
+ render: function() {
+
+ // Render results
+ this.view.render();
+ this.routes();
+
+ if ( Backbone.History.started ) {
+ Backbone.history.stop();
+ }
+ Backbone.history.start({
+ root: themes.data.settings.adminUrl,
+ pushState: true,
+ hashChange: false
+ });
+ },
+
+ routes: function() {
+ var self = this;
+ // Bind to our global thx object
+ // so that the object is available to sub-views
+ themes.router = new themes.Router();
+
+ // Handles theme details route event
+ themes.router.on( 'route:theme', function( slug ) {
+ self.view.view.expand( slug );
+ });
+
+ themes.router.on( 'route:themes', function() {
+ self.themes.doSearch( '' );
+ self.view.trigger( 'theme:close' );
+ });
+
+ // Handles search route event
+ themes.router.on( 'route:search', function() {
+ $( '.wp-filter-search' ).trigger( 'keyup' );
+ });
+
+ this.extraRoutes();
+ },
+
+ extraRoutes: function() {
+ return false;
+ }
+};
+
+// Extend the main Search view
+themes.view.InstallerSearch = themes.view.Search.extend({
+
+ events: {
+ 'input': 'search',
+ 'keyup': 'search'
+ },
+
+ terms: '',
+
+ // Handles Ajax request for searching through themes in public repo
+ search: function( event ) {
+
+ // Tabbing or reverse tabbing into the search input shouldn't trigger a search
+ if ( event.type === 'keyup' && ( event.which === 9 || event.which === 16 ) ) {
+ return;
+ }
+
+ this.collection = this.options.parent.view.collection;
+
+ // Clear on escape.
+ if ( event.type === 'keyup' && event.which === 27 ) {
+ event.target.value = '';
+ }
+
+ this.doSearch( event.target.value );
+ },
+
+ doSearch: function( value ) {
+ var request = {};
+
+ // Don't do anything if the search terms haven't changed.
+ if ( this.terms === value ) {
+ return;
+ }
+
+ // Updates terms with the value passed.
+ this.terms = value;
+
+ request.search = value;
+
+ // Intercept an [author] search.
+ //
+ // If input value starts with `author:` send a request
+ // for `author` instead of a regular `search`
+ if ( value.substring( 0, 7 ) === 'author:' ) {
+ request.search = '';
+ request.author = value.slice( 7 );
+ }
+
+ // Intercept a [tag] search.
+ //
+ // If input value starts with `tag:` send a request
+ // for `tag` instead of a regular `search`
+ if ( value.substring( 0, 4 ) === 'tag:' ) {
+ request.search = '';
+ request.tag = [ value.slice( 4 ) ];
+ }
+
+ $( '.filter-links li > a.current' )
+ .removeClass( 'current' )
+ .removeAttr( 'aria-current' );
+
+ $( 'body' ).removeClass( 'show-filters filters-applied show-favorites-form' );
+ $( '.drawer-toggle' ).attr( 'aria-expanded', 'false' );
+
+ // Get the themes by sending Ajax POST request to api.wordpress.org/themes
+ // or searching the local cache
+ this.collection.query( request );
+
+ // Set route
+ themes.router.navigate( themes.router.baseUrl( themes.router.searchPath + encodeURIComponent( value ) ), { replace: true } );
+ }
+});
+
+themes.view.Installer = themes.view.Appearance.extend({
+
+ el: '#wpbody-content .wrap',
+
+ // Register events for sorting and filters in theme-navigation
+ events: {
+ 'click .filter-links li > a': 'onSort',
+ 'click .theme-filter': 'onFilter',
+ 'click .drawer-toggle': 'moreFilters',
+ 'click .filter-drawer .apply-filters': 'applyFilters',
+ 'click .filter-group [type="checkbox"]': 'addFilter',
+ 'click .filter-drawer .clear-filters': 'clearFilters',
+ 'click .edit-filters': 'backToFilters',
+ 'click .favorites-form-submit' : 'saveUsername',
+ 'keyup #wporg-username-input': 'saveUsername'
+ },
+
+ // Initial render method
+ render: function() {
+ var self = this;
+
+ this.search();
+ this.uploader();
+
+ this.collection = new themes.Collection();
+
+ // Bump `collection.currentQuery.page` and request more themes if we hit the end of the page.
+ this.listenTo( this, 'theme:end', function() {
+
+ // Make sure we are not already loading
+ if ( self.collection.loadingThemes ) {
+ return;
+ }
+
+ // Set loadingThemes to true and bump page instance of currentQuery.
+ self.collection.loadingThemes = true;
+ self.collection.currentQuery.page++;
+
+ // Use currentQuery.page to build the themes request.
+ _.extend( self.collection.currentQuery.request, { page: self.collection.currentQuery.page } );
+ self.collection.query( self.collection.currentQuery.request );
+ });
+
+ this.listenTo( this.collection, 'query:success', function() {
+ $( 'body' ).removeClass( 'loading-content' );
+ $( '.theme-browser' ).find( 'div.error' ).remove();
+ });
+
+ this.listenTo( this.collection, 'query:fail', function() {
+ $( 'body' ).removeClass( 'loading-content' );
+ $( '.theme-browser' ).find( 'div.error' ).remove();
+ $( '.theme-browser' ).find( 'div.themes' ).before( '<div class="error"><p>' + l10n.error + '</p><p><button class="button try-again">' + l10n.tryAgain + '</button></p></div>' );
+ $( '.theme-browser .error .try-again' ).on( 'click', function( e ) {
+ e.preventDefault();
+ $( 'input.wp-filter-search' ).trigger( 'input' );
+ } );
+ });
+
+ if ( this.view ) {
+ this.view.remove();
+ }
+
+ // Set ups the view and passes the section argument
+ this.view = new themes.view.Themes({
+ collection: this.collection,
+ parent: this
+ });
+
+ // Reset pagination every time the install view handler is run
+ this.page = 0;
+
+ // Render and append
+ this.$el.find( '.themes' ).remove();
+ this.view.render();
+ this.$el.find( '.theme-browser' ).append( this.view.el ).addClass( 'rendered' );
+ },
+
+ // Handles all the rendering of the public theme directory
+ browse: function( section ) {
+ // Create a new collection with the proper theme data
+ // for each section
+ this.collection.query( { browse: section } );
+ },
+
+ // Sorting navigation
+ onSort: function( event ) {
+ var $el = $( event.target ),
+ sort = $el.data( 'sort' );
+
+ event.preventDefault();
+
+ $( 'body' ).removeClass( 'filters-applied show-filters' );
+ $( '.drawer-toggle' ).attr( 'aria-expanded', 'false' );
+
+ // Bail if this is already active
+ if ( $el.hasClass( this.activeClass ) ) {
+ return;
+ }
+
+ this.sort( sort );
+
+ // Trigger a router.naviagte update
+ themes.router.navigate( themes.router.baseUrl( themes.router.browsePath + sort ) );
+ },
+
+ sort: function( sort ) {
+ this.clearSearch();
+
+ // Track sorting so we can restore the correct tab when closing preview.
+ themes.router.selectedTab = sort;
+
+ $( '.filter-links li > a, .theme-filter' )
+ .removeClass( this.activeClass )
+ .removeAttr( 'aria-current' );
+
+ $( '[data-sort="' + sort + '"]' )
+ .addClass( this.activeClass )
+ .attr( 'aria-current', 'page' );
+
+ if ( 'favorites' === sort ) {
+ $( 'body' ).addClass( 'show-favorites-form' );
+ } else {
+ $( 'body' ).removeClass( 'show-favorites-form' );
+ }
+
+ this.browse( sort );
+ },
+
+ // Filters and Tags
+ onFilter: function( event ) {
+ var request,
+ $el = $( event.target ),
+ filter = $el.data( 'filter' );
+
+ // Bail if this is already active
+ if ( $el.hasClass( this.activeClass ) ) {
+ return;
+ }
+
+ $( '.filter-links li > a, .theme-section' )
+ .removeClass( this.activeClass )
+ .removeAttr( 'aria-current' );
+ $el
+ .addClass( this.activeClass )
+ .attr( 'aria-current', 'page' );
+
+ if ( ! filter ) {
+ return;
+ }
+
+ // Construct the filter request
+ // using the default values
+ filter = _.union( [ filter, this.filtersChecked() ] );
+ request = { tag: [ filter ] };
+
+ // Get the themes by sending Ajax POST request to api.wordpress.org/themes
+ // or searching the local cache
+ this.collection.query( request );
+ },
+
+ // Clicking on a checkbox to add another filter to the request
+ addFilter: function() {
+ this.filtersChecked();
+ },
+
+ // Applying filters triggers a tag request
+ applyFilters: function( event ) {
+ var name,
+ tags = this.filtersChecked(),
+ request = { tag: tags },
+ filteringBy = $( '.filtered-by .tags' );
+
+ if ( event ) {
+ event.preventDefault();
+ }
+
+ if ( ! tags ) {
+ wp.a11y.speak( l10n.selectFeatureFilter );
+ return;
+ }
+
+ $( 'body' ).addClass( 'filters-applied' );
+ $( '.filter-links li > a.current' )
+ .removeClass( 'current' )
+ .removeAttr( 'aria-current' );
+
+ filteringBy.empty();
+
+ _.each( tags, function( tag ) {
+ name = $( 'label[for="filter-id-' + tag + '"]' ).text();
+ filteringBy.append( '<span class="tag">' + name + '</span>' );
+ });
+
+ // Get the themes by sending Ajax POST request to api.wordpress.org/themes
+ // or searching the local cache
+ this.collection.query( request );
+ },
+
+ // Save the user's WordPress.org username and get his favorite themes.
+ saveUsername: function ( event ) {
+ var username = $( '#wporg-username-input' ).val(),
+ nonce = $( '#wporg-username-nonce' ).val(),
+ request = { browse: 'favorites', user: username },
+ that = this;
+
+ if ( event ) {
+ event.preventDefault();
+ }
+
+ // save username on enter
+ if ( event.type === 'keyup' && event.which !== 13 ) {
+ return;
+ }
+
+ return wp.ajax.send( 'save-wporg-username', {
+ data: {
+ _wpnonce: nonce,
+ username: username
+ },
+ success: function () {
+ // Get the themes by sending Ajax POST request to api.wordpress.org/themes
+ // or searching the local cache
+ that.collection.query( request );
+ }
+ } );
+ },
+
+ // Get the checked filters
+ // @return {array} of tags or false
+ filtersChecked: function() {
+ var items = $( '.filter-group' ).find( ':checkbox' ),
+ tags = [];
+
+ _.each( items.filter( ':checked' ), function( item ) {
+ tags.push( $( item ).prop( 'value' ) );
+ });
+
+ // When no filters are checked, restore initial state and return
+ if ( tags.length === 0 ) {
+ $( '.filter-drawer .apply-filters' ).find( 'span' ).text( '' );
+ $( '.filter-drawer .clear-filters' ).hide();
+ $( 'body' ).removeClass( 'filters-applied' );
+ return false;
+ }
+
+ $( '.filter-drawer .apply-filters' ).find( 'span' ).text( tags.length );
+ $( '.filter-drawer .clear-filters' ).css( 'display', 'inline-block' );
+
+ return tags;
+ },
+
+ activeClass: 'current',
+
+ /*
+ * When users press the "Upload Theme" button, show the upload form in place.
+ */
+ uploader: function() {
+ var uploadViewToggle = $( '.upload-view-toggle' ),
+ $body = $( document.body );
+
+ uploadViewToggle.on( 'click', function() {
+ // Toggle the upload view.
+ $body.toggleClass( 'show-upload-view' );
+ // Toggle the `aria-expanded` button attribute.
+ uploadViewToggle.attr( 'aria-expanded', $body.hasClass( 'show-upload-view' ) );
+ });
+ },
+
+ // Toggle the full filters navigation
+ moreFilters: function( event ) {
+ var $body = $( 'body' ),
+ $toggleButton = $( '.drawer-toggle' );
+
+ event.preventDefault();
+
+ if ( $body.hasClass( 'filters-applied' ) ) {
+ return this.backToFilters();
+ }
+
+ this.clearSearch();
+
+ themes.router.navigate( themes.router.baseUrl( '' ) );
+ // Toggle the feature filters view.
+ $body.toggleClass( 'show-filters' );
+ // Toggle the `aria-expanded` button attribute.
+ $toggleButton.attr( 'aria-expanded', $body.hasClass( 'show-filters' ) );
+ },
+
+ // Clears all the checked filters
+ // @uses filtersChecked()
+ clearFilters: function( event ) {
+ var items = $( '.filter-group' ).find( ':checkbox' ),
+ self = this;
+
+ event.preventDefault();
+
+ _.each( items.filter( ':checked' ), function( item ) {
+ $( item ).prop( 'checked', false );
+ return self.filtersChecked();
+ });
+ },
+
+ backToFilters: function( event ) {
+ if ( event ) {
+ event.preventDefault();
+ }
+
+ $( 'body' ).removeClass( 'filters-applied' );
+ },
+
+ clearSearch: function() {
+ $( '#wp-filter-search-input').val( '' );
+ }
+});
+
+themes.InstallerRouter = Backbone.Router.extend({
+ routes: {
+ 'theme-install.php?theme=:slug': 'preview',
+ 'theme-install.php?browse=:sort': 'sort',
+ 'theme-install.php?search=:query': 'search',
+ 'theme-install.php': 'sort'
+ },
+
+ baseUrl: function( url ) {
+ return 'theme-install.php' + url;
+ },
+
+ themePath: '?theme=',
+ browsePath: '?browse=',
+ searchPath: '?search=',
+
+ search: function( query ) {
+ $( '.wp-filter-search' ).val( query.replace( /\+/g, ' ' ) );
+ },
+
+ navigate: navigateRouter
+});
+
+
+themes.RunInstaller = {
+
+ init: function() {
+ // Set up the view
+ // Passes the default 'section' as an option
+ this.view = new themes.view.Installer({
+ section: 'featured',
+ SearchView: themes.view.InstallerSearch
+ });
+
+ // Render results
+ this.render();
+
+ // Start debouncing user searches after Backbone.history.start().
+ this.view.SearchView.doSearch = _.debounce( this.view.SearchView.doSearch, 500 );
+ },
+
+ render: function() {
+
+ // Render results
+ this.view.render();
+ this.routes();
+
+ if ( Backbone.History.started ) {
+ Backbone.history.stop();
+ }
+ Backbone.history.start({
+ root: themes.data.settings.adminUrl,
+ pushState: true,
+ hashChange: false
+ });
+ },
+
+ routes: function() {
+ var self = this,
+ request = {};
+
+ // Bind to our global `wp.themes` object
+ // so that the router is available to sub-views
+ themes.router = new themes.InstallerRouter();
+
+ // Handles `theme` route event
+ // Queries the API for the passed theme slug
+ themes.router.on( 'route:preview', function( slug ) {
+
+ // Remove existing handlers.
+ if ( themes.preview ) {
+ themes.preview.undelegateEvents();
+ themes.preview.unbind();
+ }
+
+ // If the theme preview is active, set the current theme.
+ if ( self.view.view.theme && self.view.view.theme.preview ) {
+ self.view.view.theme.model = self.view.collection.findWhere( { 'slug': slug } );
+ self.view.view.theme.preview();
+ } else {
+
+ // Select the theme by slug.
+ request.theme = slug;
+ self.view.collection.query( request );
+ self.view.collection.trigger( 'update' );
+
+ // Open the theme preview.
+ self.view.collection.once( 'query:success', function() {
+ $( 'div[data-slug="' + slug + '"]' ).trigger( 'click' );
+ });
+
+ }
+ });
+
+ // Handles sorting / browsing routes
+ // Also handles the root URL triggering a sort request
+ // for `featured`, the default view
+ themes.router.on( 'route:sort', function( sort ) {
+ if ( ! sort ) {
+ sort = 'featured';
+ themes.router.navigate( themes.router.baseUrl( '?browse=featured' ), { replace: true } );
+ }
+ self.view.sort( sort );
+
+ // Close the preview if open.
+ if ( themes.preview ) {
+ themes.preview.close();
+ }
+ });
+
+ // The `search` route event. The router populates the input field.
+ themes.router.on( 'route:search', function() {
+ $( '.wp-filter-search' ).focus().trigger( 'keyup' );
+ });
+
+ this.extraRoutes();
+ },
+
+ extraRoutes: function() {
+ return false;
+ }
+};
+
+// Ready...
+$( document ).ready(function() {
+ if ( themes.isInstall ) {
+ themes.RunInstaller.init();
+ } else {
+ themes.Run.init();
+ }
+
+ // Update the return param just in time.
+ $( document.body ).on( 'click', '.load-customize', function() {
+ var link = $( this ), urlParser = document.createElement( 'a' );
+ urlParser.href = link.prop( 'href' );
+ urlParser.search = $.param( _.extend(
+ wp.customize.utils.parseQueryString( urlParser.search.substr( 1 ) ),
+ {
+ 'return': window.location.href
+ }
+ ) );
+ link.prop( 'href', urlParser.href );
+ });
+
+ $( '.broken-themes .delete-theme' ).on( 'click', function() {
+ return confirm( _wpThemeSettings.settings.confirmDelete );
+ });
+});
+
+})( jQuery );
+
+// Align theme browser thickbox
+jQuery(document).ready( function($) {
+ window.tb_position = function() {
+ var tbWindow = $('#TB_window'),
+ width = $(window).width(),
+ H = $(window).height(),
+ W = ( 1040 < width ) ? 1040 : width,
+ adminbar_height = 0;
+
+ if ( $('#wpadminbar').length ) {
+ adminbar_height = parseInt( $('#wpadminbar').css('height'), 10 );
+ }
+
+ if ( tbWindow.size() ) {
+ tbWindow.width( W - 50 ).height( H - 45 - adminbar_height );
+ $('#TB_iframeContent').width( W - 50 ).height( H - 75 - adminbar_height );
+ tbWindow.css({'margin-left': '-' + parseInt( ( ( W - 50 ) / 2 ), 10 ) + 'px'});
+ if ( typeof document.body.style.maxWidth !== 'undefined' ) {
+ tbWindow.css({'top': 20 + adminbar_height + 'px', 'margin-top': '0'});
+ }
+ }
+ };
+
+ $(window).resize(function(){ tb_position(); });
+});
diff --git a/www/crm/wp-admin/js/theme.min.js b/www/crm/wp-admin/js/theme.min.js
new file mode 100644
index 00000000..dc9e7566
--- /dev/null
+++ b/www/crm/wp-admin/js/theme.min.js
@@ -0,0 +1 @@
+window.wp=window.wp||{},function(a){function b(a,b){var c=this;Backbone.history._hasPushState&&Backbone.Router.prototype.navigate.call(c,a,b)}var c,d;c=wp.themes=wp.themes||{},c.data=_wpThemeSettings,d=c.data.l10n,c.isInstall=!!c.data.settings.isInstall,_.extend(c,{model:{},view:{},routes:{},router:{},template:wp.template}),c.Model=Backbone.Model.extend({initialize:function(){var a;_.indexOf(c.data.installedThemes,this.get("slug"))!==-1&&this.set({installed:!0}),this.set({id:this.get("slug")||this.get("id")}),this.has("sections")&&(a=this.get("sections").description,this.set({description:a}))}}),c.view.Appearance=wp.Backbone.View.extend({el:"#wpbody-content .wrap .theme-browser",window:a(window),page:0,initialize:function(a){_.bindAll(this,"scroller"),this.SearchView=a.SearchView?a.SearchView:c.view.Search,this.window.bind("scroll",_.throttle(this.scroller,300))},render:function(){this.view=new c.view.Themes({collection:this.collection,parent:this}),this.search(),this.$el.removeClass("search-loading"),this.view.render(),this.$el.empty().append(this.view.el).addClass("rendered")},searchContainer:a(".search-form"),search:function(){var b,e=this;1!==c.data.themes.length&&(b=new this.SearchView({collection:e.collection,parent:this}),e.SearchView=b,b.render(),this.searchContainer.append(a.parseHTML('<label class="screen-reader-text" for="wp-filter-search-input">'+d.search+"</label>")).append(b.el).on("submit",function(a){a.preventDefault()}))},scroller:function(){var a,b,c=this;a=this.window.scrollTop()+c.window.height(),b=c.$el.offset().top+c.$el.outerHeight(!1)-c.window.height(),b=Math.round(.9*b),a>b&&this.trigger("theme:scroll")}}),c.Collection=Backbone.Collection.extend({model:c.Model,terms:"",doSearch:function(b){this.terms!==b&&(this.terms=b,this.terms.length>0&&this.search(this.terms),""===this.terms&&(this.reset(c.data.themes),a("body").removeClass("no-results")),this.trigger("themes:update"))},search:function(b){var d,e,f,g,h,i;this.reset(c.data.themes,{silent:!0}),b=b.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"),b=b.replace(/ /g,")(?=.*"),d=new RegExp("^(?=.*"+b+").+","i"),e=this.filter(function(a){return g=a.get("name").replace(/(<([^>]+)>)/gi,""),h=a.get("description").replace(/(<([^>]+)>)/gi,""),i=a.get("author").replace(/(<([^>]+)>)/gi,""),f=_.union([g,a.get("id"),h,i,a.get("tags")]),d.test(a.get("author"))&&b.length>2&&a.set("displayAuthor",!0),d.test(f)}),0===e.length?this.trigger("query:empty"):a("body").removeClass("no-results"),this.reset(e)},paginate:function(a){var b=this;return a=a||0,b=_(b.rest(20*a)),b=_(b.first(20))},count:!1,query:function(b){var c,d,e,f=this.queries,g=this;if(this.currentQuery.request=b,c=_.find(f,function(a){return _.isEqual(a.request,b)}),d=_.has(b,"page"),d||(this.currentQuery.page=1),c||d){if(d)return this.apiCall(b,d).done(function(a){g.add(a.themes),g.trigger("query:success"),g.loadingThemes=!1}).fail(function(){g.trigger("query:fail")});0===c.themes.length?g.trigger("query:empty"):a("body").removeClass("no-results"),_.isNumber(c.total)&&(this.count=c.total),this.reset(c.themes),c.total||(this.count=this.length),this.trigger("themes:update"),this.trigger("query:success",this.count)}else c=this.apiCall(b).done(function(a){a.themes&&(g.reset(a.themes),e=a.info.results,f.push({themes:a.themes,request:b,total:e})),g.trigger("themes:update"),g.trigger("query:success",e),a.themes&&0===a.themes.length&&g.trigger("query:empty")}).fail(function(){g.trigger("query:fail")})},queries:[],currentQuery:{page:1,request:{}},apiCall:function(b,c){return wp.ajax.send("query-themes",{data:{request:_.extend({per_page:100},b)},beforeSend:function(){c||a("body").addClass("loading-content").removeClass("no-results")}})},loadingThemes:!1}),c.view.Theme=wp.Backbone.View.extend({className:"theme",state:"grid",html:c.template("theme"),events:{click:c.isInstall?"preview":"expand",keydown:c.isInstall?"preview":"expand",touchend:c.isInstall?"preview":"expand",keyup:"addFocus",touchmove:"preventExpand","click .theme-install":"installTheme","click .update-message":"updateTheme"},touchDrag:!1,initialize:function(){this.model.on("change",this.render,this)},render:function(){var a=this.model.toJSON();this.$el.html(this.html(a)).attr({tabindex:0,"aria-describedby":a.id+"-action "+a.id+"-name","data-slug":a.id}),this.activeTheme(),this.model.get("displayAuthor")&&this.$el.addClass("display-author")},activeTheme:function(){this.model.get("active")&&this.$el.addClass("active")},addFocus:function(){var b=a(":focus").hasClass("theme")?a(":focus"):a(":focus").parents(".theme");a(".theme.focus").removeClass("focus"),b.addClass("focus")},expand:function(b){var d=this;if(b=b||window.event,"keydown"!==b.type||13===b.which||32===b.which)return this.touchDrag===!0?this.touchDrag=!1:void(a(b.target).is(".theme-actions a")||a(b.target).is(".theme-actions a, .update-message, .button-link, .notice-dismiss")||(c.focusedTheme=this.$el,this.trigger("theme:expand",d.model.cid)))},preventExpand:function(){this.touchDrag=!0},preview:function(b){var d,e,f=this;return b=b||window.event,this.touchDrag===!0?this.touchDrag=!1:void(a(b.target).not(".install-theme-preview").parents(".theme-actions").length||"keydown"===b.type&&13!==b.which&&32!==b.which||"keydown"===b.type&&13!==b.which&&a(":focus").hasClass("button")||(b.preventDefault(),b=b||window.event,c.focusedTheme=this.$el,c.preview=e=new c.view.Preview({model:this.model}),e.render(),this.setNavButtonsState(),1===this.model.collection.length?e.$el.addClass("no-navigation"):e.$el.removeClass("no-navigation"),a("div.wrap").append(e.el),this.listenTo(e,"theme:next",function(){return d=f.model,_.isUndefined(f.current)||(d=f.current),f.current=f.model.collection.at(f.model.collection.indexOf(d)+1),_.isUndefined(f.current)?(f.options.parent.parent.trigger("theme:end"),f.current=d):(e.model=f.current,e.render(),this.setNavButtonsState(),void a(".next-theme").focus())}).listenTo(e,"theme:previous",function(){d=f.model,0!==f.model.collection.indexOf(f.current)&&(_.isUndefined(f.current)||(d=f.current),f.current=f.model.collection.at(f.model.collection.indexOf(d)-1),_.isUndefined(f.current)||(e.model=f.current,e.render(),this.setNavButtonsState(),a(".previous-theme").focus()))}),this.listenTo(e,"preview:close",function(){f.current=f.model})))},setNavButtonsState:function(){var b=a(".theme-install-overlay"),c=_.isUndefined(this.current)?this.model:this.current,d=b.find(".previous-theme"),e=b.find(".next-theme");0===this.model.collection.indexOf(c)&&(d.addClass("disabled").prop("disabled",!0),e.focus()),_.isUndefined(this.model.collection.at(this.model.collection.indexOf(c)+1))&&(e.addClass("disabled").prop("disabled",!0),d.focus())},installTheme:function(b){var c=this;b.preventDefault(),wp.updates.maybeRequestFilesystemCredentials(b),a(document).on("wp-theme-install-success",function(a,b){c.model.get("id")===b.slug&&c.model.set({installed:!0})}),wp.updates.installTheme({slug:a(b.target).data("slug")})},updateTheme:function(b){var c=this;this.model.get("hasPackage")&&(b.preventDefault(),wp.updates.maybeRequestFilesystemCredentials(b),a(document).on("wp-theme-update-success",function(a,b){c.model.off("change",c.render,c),c.model.get("id")===b.slug&&c.model.set({hasUpdate:!1,version:b.newVersion}),c.model.on("change",c.render,c)}),wp.updates.updateTheme({slug:a(b.target).parents("div.theme").first().data("slug")}))}}),c.view.Details=wp.Backbone.View.extend({className:"theme-overlay",events:{click:"collapse","click .delete-theme":"deleteTheme","click .left":"previousTheme","click .right":"nextTheme","click #update-theme":"updateTheme"},html:c.template("theme-single"),render:function(){var a=this.model.toJSON();this.$el.html(this.html(a)),this.activeTheme(),this.navigation(),this.screenshotCheck(this.$el),this.containFocus(this.$el)},activeTheme:function(){this.$el.toggleClass("active",this.model.get("active"))},containFocus:function(b){_.delay(function(){a(".theme-overlay").focus()},100),b.on("keydown.wp-themes",function(a){var c=b.find(".theme-header button:not(.disabled)").first(),d=b.find(".theme-actions a:visible").last();9===a.which&&(c[0]===a.target&&a.shiftKey?(d.focus(),a.preventDefault()):d[0]!==a.target||a.shiftKey||(c.focus(),a.preventDefault()))})},collapse:function(b){var d,e=this;b=b||window.event,1!==c.data.themes.length&&(a(b.target).is(".theme-backdrop")||a(b.target).is(".close")||27===b.keyCode)&&(a("body").addClass("closing-overlay"),this.$el.fadeOut(130,function(){a("body").removeClass("closing-overlay"),e.closeOverlay(),d=document.body.scrollTop,c.router.navigate(c.router.baseUrl("")),document.body.scrollTop=d,c.focusedTheme&&c.focusedTheme.focus()}))},navigation:function(){this.model.cid===this.model.collection.at(0).cid&&this.$el.find(".left").addClass("disabled").prop("disabled",!0),this.model.cid===this.model.collection.at(this.model.collection.length-1).cid&&this.$el.find(".right").addClass("disabled").prop("disabled",!0)},closeOverlay:function(){a("body").removeClass("modal-open"),this.remove(),this.unbind(),this.trigger("theme:collapse")},updateTheme:function(b){var c=this;b.preventDefault(),wp.updates.maybeRequestFilesystemCredentials(b),a(document).on("wp-theme-update-success",function(a,b){c.model.get("id")===b.slug&&c.model.set({hasUpdate:!1,version:b.newVersion}),c.render()}),wp.updates.updateTheme({slug:a(b.target).data("slug")})},deleteTheme:function(b){var d=this,e=d.model.collection,f=c;b.preventDefault(),window.confirm(wp.themes.data.settings.confirmDelete)&&(wp.updates.maybeRequestFilesystemCredentials(b),a(document).one("wp-theme-delete-success",function(b,c){d.$el.find(".close").trigger("click"),a('[data-slug="'+c.slug+'"]').css({backgroundColor:"#faafaa"}).fadeOut(350,function(){a(this).remove(),f.data.themes=_.without(f.data.themes,_.findWhere(f.data.themes,{id:c.slug})),a(".wp-filter-search").val(""),e.doSearch(""),e.remove(d.model),e.trigger("themes:update")})}),wp.updates.deleteTheme({slug:this.model.get("id")}))},nextTheme:function(){var a=this;return a.trigger("theme:next",a.model.cid),!1},previousTheme:function(){var a=this;return a.trigger("theme:previous",a.model.cid),!1},screenshotCheck:function(a){var b,c;b=a.find(".screenshot img"),c=new Image,c.src=b.attr("src"),c.width&&c.width<=300&&a.addClass("small-screenshot")}}),c.view.Preview=c.view.Details.extend({className:"wp-full-overlay expanded",el:".theme-install-overlay",events:{"click .close-full-overlay":"close","click .collapse-sidebar":"collapse","click .devices button":"previewDevice","click .previous-theme":"previousTheme","click .next-theme":"nextTheme",keyup:"keyEvent","click .theme-install":"installTheme"},html:c.template("theme-preview"),render:function(){var b,d=this,e=this.model.toJSON(),f=a(document.body);f.attr("aria-busy","true"),this.$el.removeClass("iframe-ready").html(this.html(e)),b=this.$el.data("current-preview-device"),b&&d.tooglePreviewDeviceButtons(b),c.router.navigate(c.router.baseUrl(c.router.themePath+this.model.get("id")),{replace:!1}),this.$el.fadeIn(200,function(){f.addClass("theme-installer-active full-overlay-active")}),this.$el.find("iframe").one("load",function(){d.iframeLoaded()})},iframeLoaded:function(){this.$el.addClass("iframe-ready"),a(document.body).attr("aria-busy","false")},close:function(){return this.$el.fadeOut(200,function(){a("body").removeClass("theme-installer-active full-overlay-active"),c.focusedTheme&&c.focusedTheme.focus()}).removeClass("iframe-ready"),c.router.selectedTab?(c.router.navigate(c.router.baseUrl("?browse="+c.router.selectedTab)),c.router.selectedTab=!1):c.router.navigate(c.router.baseUrl("")),this.trigger("preview:close"),this.undelegateEvents(),this.unbind(),!1},collapse:function(b){var c=a(b.currentTarget);return"true"===c.attr("aria-expanded")?c.attr({"aria-expanded":"false","aria-label":d.expandSidebar}):c.attr({"aria-expanded":"true","aria-label":d.collapseSidebar}),this.$el.toggleClass("collapsed").toggleClass("expanded"),!1},previewDevice:function(b){var c=a(b.currentTarget).data("device");this.$el.removeClass("preview-desktop preview-tablet preview-mobile").addClass("preview-"+c).data("current-preview-device",c),this.tooglePreviewDeviceButtons(c)},tooglePreviewDeviceButtons:function(b){var c=a(".wp-full-overlay-footer .devices");c.find("button").removeClass("active").attr("aria-pressed",!1),c.find("button.preview-"+b).addClass("active").attr("aria-pressed",!0)},keyEvent:function(a){27===a.keyCode&&(this.undelegateEvents(),this.close()),39===a.keyCode&&_.once(this.nextTheme()),37===a.keyCode&&this.previousTheme()},installTheme:function(b){var c=this,d=a(b.target);b.preventDefault(),d.hasClass("disabled")||(wp.updates.maybeRequestFilesystemCredentials(b),a(document).on("wp-theme-install-success",function(){c.model.set({installed:!0})}),wp.updates.installTheme({slug:d.data("slug")}))}}),c.view.Themes=wp.Backbone.View.extend({className:"themes wp-clearfix",$overlay:a("div.theme-overlay"),index:0,count:a(".wrap .theme-count"),liveThemeCount:0,initialize:function(b){var c=this;this.parent=b.parent,this.setView("grid"),c.currentTheme(),this.listenTo(c.collection,"themes:update",function(){c.parent.page=0,c.currentTheme(),c.render(this)}),this.listenTo(c.collection,"query:success",function(a){_.isNumber(a)?(c.count.text(a),c.announceSearchResults(a)):(c.count.text(c.collection.length),c.announceSearchResults(c.collection.length))}),this.listenTo(c.collection,"query:empty",function(){a("body").addClass("no-results")}),this.listenTo(this.parent,"theme:scroll",function(){c.renderThemes(c.parent.page)}),this.listenTo(this.parent,"theme:close",function(){c.overlay&&c.overlay.closeOverlay()}),a("body").on("keyup",function(b){c.overlay&&(a("#request-filesystem-credentials-dialog").is(":visible")||(39===b.keyCode&&c.overlay.nextTheme(),37===b.keyCode&&c.overlay.previousTheme(),27===b.keyCode&&c.overlay.collapse(b)))})},render:function(){this.$el.empty(),1===c.data.themes.length&&(this.singleTheme=new c.view.Details({model:this.collection.models[0]}),this.singleTheme.render(),this.$el.addClass("single-theme"),this.$el.append(this.singleTheme.el)),this.options.collection.size()>0&&this.renderThemes(this.parent.page),this.liveThemeCount=this.collection.count?this.collection.count:this.collection.length,this.count.text(this.liveThemeCount),c.isInstall||this.announceSearchResults(this.liveThemeCount)},renderThemes:function(b){var e=this;return e.instance=e.collection.paginate(b),0===e.instance.size()?void this.parent.trigger("theme:end"):(!c.isInstall&&b>=1&&a(".add-new-theme").remove(),e.instance.each(function(a){e.theme=new c.view.Theme({model:a,parent:e}),e.theme.render(),e.$el.append(e.theme.el),e.listenTo(e.theme,"theme:expand",e.expand,e)}),!c.isInstall&&c.data.settings.canInstall&&this.$el.append('<div class="theme add-new-theme"><a href="'+c.data.settings.installURI+'"><div class="theme-screenshot"><span></span></div><h2 class="theme-name">'+d.addNew+"</h2></a></div>"),void this.parent.page++)},currentTheme:function(){var a,b=this;a=b.collection.findWhere({active:!0}),a&&(b.collection.remove(a),b.collection.add(a,{at:0}))},setView:function(a){return a},expand:function(b){var d,e,f=this;this.model=f.collection.get(b),c.router.navigate(c.router.baseUrl(c.router.themePath+this.model.id)),this.setView("detail"),a("body").addClass("modal-open"),this.overlay=new c.view.Details({model:f.model}),this.overlay.render(),this.model.get("hasUpdate")&&(d=a('[data-slug="'+this.model.id+'"]'),e=a(this.overlay.el),d.find(".updating-message").length?(e.find(".notice-warning h3").remove(),e.find(".notice-warning").removeClass("notice-large").addClass("updating-message").find("p").text(wp.updates.l10n.updating)):d.find(".notice-error").length&&e.find(".notice-warning").remove()),this.$overlay.html(this.overlay.el),this.listenTo(this.overlay,"theme:next",function(){f.next([f.model.cid])}).listenTo(this.overlay,"theme:previous",function(){f.previous([f.model.cid])})},next:function(a){var b,c,d=this;b=d.collection.get(a[0]),c=d.collection.at(d.collection.indexOf(b)+1),void 0!==c&&(this.overlay.closeOverlay(),d.theme.trigger("theme:expand",c.cid))},previous:function(a){var b,c,d=this;b=d.collection.get(a[0]),c=d.collection.at(d.collection.indexOf(b)-1),void 0!==c&&(this.overlay.closeOverlay(),d.theme.trigger("theme:expand",c.cid))},announceSearchResults:function(a){0===a?wp.a11y.speak(d.noThemesFound):wp.a11y.speak(d.themesFound.replace("%d",a))}}),c.view.Search=wp.Backbone.View.extend({tagName:"input",className:"wp-filter-search",id:"wp-filter-search-input",searching:!1,attributes:{placeholder:d.searchPlaceholder,type:"search","aria-describedby":"live-search-desc"},events:{input:"search",keyup:"search",blur:"pushState"},initialize:function(a){this.parent=a.parent,this.listenTo(this.parent,"theme:close",function(){this.searching=!1})},search:function(a){"keyup"===a.type&&27===a.which&&(a.target.value=""),this.doSearch(a)},doSearch:function(a){var b={};this.collection.doSearch(a.target.value.replace(/\+/g," ")),this.searching&&13!==a.which?b.replace=!0:this.searching=!0,a.target.value?c.router.navigate(c.router.baseUrl(c.router.searchPath+a.target.value),b):c.router.navigate(c.router.baseUrl(""))},pushState:function(a){var b=c.router.baseUrl("");a.target.value&&(b=c.router.baseUrl(c.router.searchPath+encodeURIComponent(a.target.value))),this.searching=!1,c.router.navigate(b)}}),c.Router=Backbone.Router.extend({routes:{"themes.php?theme=:slug":"theme","themes.php?search=:query":"search","themes.php?s=:query":"search","themes.php":"themes","":"themes"},baseUrl:function(a){return"themes.php"+a},themePath:"?theme=",searchPath:"?search=",search:function(b){a(".wp-filter-search").val(b.replace(/\+/g," "))},themes:function(){a(".wp-filter-search").val("")},navigate:b}),c.Run={init:function(){this.themes=new c.Collection(c.data.themes),this.view=new c.view.Appearance({collection:this.themes}),this.render(),this.view.SearchView.doSearch=_.debounce(this.view.SearchView.doSearch,500)},render:function(){this.view.render(),this.routes(),Backbone.History.started&&Backbone.history.stop(),Backbone.history.start({root:c.data.settings.adminUrl,pushState:!0,hashChange:!1})},routes:function(){var b=this;c.router=new c.Router,c.router.on("route:theme",function(a){b.view.view.expand(a)}),c.router.on("route:themes",function(){b.themes.doSearch(""),b.view.trigger("theme:close")}),c.router.on("route:search",function(){a(".wp-filter-search").trigger("keyup")}),this.extraRoutes()},extraRoutes:function(){return!1}},c.view.InstallerSearch=c.view.Search.extend({events:{input:"search",keyup:"search"},terms:"",search:function(a){("keyup"!==a.type||9!==a.which&&16!==a.which)&&(this.collection=this.options.parent.view.collection,"keyup"===a.type&&27===a.which&&(a.target.value=""),this.doSearch(a.target.value))},doSearch:function(b){var d={};this.terms!==b&&(this.terms=b,d.search=b,"author:"===b.substring(0,7)&&(d.search="",d.author=b.slice(7)),"tag:"===b.substring(0,4)&&(d.search="",d.tag=[b.slice(4)]),a(".filter-links li > a.current").removeClass("current").removeAttr("aria-current"),a("body").removeClass("show-filters filters-applied show-favorites-form"),a(".drawer-toggle").attr("aria-expanded","false"),this.collection.query(d),c.router.navigate(c.router.baseUrl(c.router.searchPath+encodeURIComponent(b)),{replace:!0}))}}),c.view.Installer=c.view.Appearance.extend({el:"#wpbody-content .wrap",events:{"click .filter-links li > a":"onSort","click .theme-filter":"onFilter","click .drawer-toggle":"moreFilters","click .filter-drawer .apply-filters":"applyFilters",'click .filter-group [type="checkbox"]':"addFilter","click .filter-drawer .clear-filters":"clearFilters","click .edit-filters":"backToFilters","click .favorites-form-submit":"saveUsername","keyup #wporg-username-input":"saveUsername"},render:function(){var b=this;this.search(),this.uploader(),this.collection=new c.Collection,this.listenTo(this,"theme:end",function(){b.collection.loadingThemes||(b.collection.loadingThemes=!0,b.collection.currentQuery.page++,_.extend(b.collection.currentQuery.request,{page:b.collection.currentQuery.page}),b.collection.query(b.collection.currentQuery.request))}),this.listenTo(this.collection,"query:success",function(){a("body").removeClass("loading-content"),a(".theme-browser").find("div.error").remove()}),this.listenTo(this.collection,"query:fail",function(){a("body").removeClass("loading-content"),a(".theme-browser").find("div.error").remove(),a(".theme-browser").find("div.themes").before('<div class="error"><p>'+d.error+'</p><p><button class="button try-again">'+d.tryAgain+"</button></p></div>"),a(".theme-browser .error .try-again").on("click",function(b){b.preventDefault(),a("input.wp-filter-search").trigger("input")})}),this.view&&this.view.remove(),this.view=new c.view.Themes({collection:this.collection,parent:this}),this.page=0,this.$el.find(".themes").remove(),this.view.render(),this.$el.find(".theme-browser").append(this.view.el).addClass("rendered")},browse:function(a){this.collection.query({browse:a})},onSort:function(b){var d=a(b.target),e=d.data("sort");b.preventDefault(),a("body").removeClass("filters-applied show-filters"),a(".drawer-toggle").attr("aria-expanded","false"),d.hasClass(this.activeClass)||(this.sort(e),c.router.navigate(c.router.baseUrl(c.router.browsePath+e)))},sort:function(b){this.clearSearch(),c.router.selectedTab=b,a(".filter-links li > a, .theme-filter").removeClass(this.activeClass).removeAttr("aria-current"),a('[data-sort="'+b+'"]').addClass(this.activeClass).attr("aria-current","page"),"favorites"===b?a("body").addClass("show-favorites-form"):a("body").removeClass("show-favorites-form"),this.browse(b)},onFilter:function(b){var c,d=a(b.target),e=d.data("filter");d.hasClass(this.activeClass)||(a(".filter-links li > a, .theme-section").removeClass(this.activeClass).removeAttr("aria-current"),d.addClass(this.activeClass).attr("aria-current","page"),e&&(e=_.union([e,this.filtersChecked()]),c={tag:[e]},this.collection.query(c)))},addFilter:function(){this.filtersChecked()},applyFilters:function(b){var c,e=this.filtersChecked(),f={tag:e},g=a(".filtered-by .tags");return b&&b.preventDefault(),e?(a("body").addClass("filters-applied"),a(".filter-links li > a.current").removeClass("current").removeAttr("aria-current"),g.empty(),_.each(e,function(b){c=a('label[for="filter-id-'+b+'"]').text(),g.append('<span class="tag">'+c+"</span>")}),void this.collection.query(f)):void wp.a11y.speak(d.selectFeatureFilter)},saveUsername:function(b){var c=a("#wporg-username-input").val(),d=a("#wporg-username-nonce").val(),e={browse:"favorites",user:c},f=this;if(b&&b.preventDefault(),"keyup"!==b.type||13===b.which)return wp.ajax.send("save-wporg-username",{data:{_wpnonce:d,username:c},success:function(){f.collection.query(e)}})},filtersChecked:function(){var b=a(".filter-group").find(":checkbox"),c=[];return _.each(b.filter(":checked"),function(b){c.push(a(b).prop("value"))}),0===c.length?(a(".filter-drawer .apply-filters").find("span").text(""),a(".filter-drawer .clear-filters").hide(),a("body").removeClass("filters-applied"),!1):(a(".filter-drawer .apply-filters").find("span").text(c.length),a(".filter-drawer .clear-filters").css("display","inline-block"),c)},activeClass:"current",uploader:function(){var b=a(".upload-view-toggle"),c=a(document.body);b.on("click",function(){c.toggleClass("show-upload-view"),b.attr("aria-expanded",c.hasClass("show-upload-view"))})},moreFilters:function(b){var d=a("body"),e=a(".drawer-toggle");return b.preventDefault(),d.hasClass("filters-applied")?this.backToFilters():(this.clearSearch(),c.router.navigate(c.router.baseUrl("")),d.toggleClass("show-filters"),void e.attr("aria-expanded",d.hasClass("show-filters")))},clearFilters:function(b){var c=a(".filter-group").find(":checkbox"),d=this;b.preventDefault(),_.each(c.filter(":checked"),function(b){return a(b).prop("checked",!1),d.filtersChecked()})},backToFilters:function(b){b&&b.preventDefault(),a("body").removeClass("filters-applied")},clearSearch:function(){a("#wp-filter-search-input").val("")}}),c.InstallerRouter=Backbone.Router.extend({routes:{"theme-install.php?theme=:slug":"preview","theme-install.php?browse=:sort":"sort","theme-install.php?search=:query":"search","theme-install.php":"sort"},baseUrl:function(a){return"theme-install.php"+a},themePath:"?theme=",browsePath:"?browse=",searchPath:"?search=",search:function(b){a(".wp-filter-search").val(b.replace(/\+/g," "))},navigate:b}),c.RunInstaller={init:function(){this.view=new c.view.Installer({section:"featured",SearchView:c.view.InstallerSearch}),this.render(),this.view.SearchView.doSearch=_.debounce(this.view.SearchView.doSearch,500)},render:function(){this.view.render(),this.routes(),Backbone.History.started&&Backbone.history.stop(),Backbone.history.start({root:c.data.settings.adminUrl,pushState:!0,hashChange:!1})},routes:function(){var b=this,d={};c.router=new c.InstallerRouter,c.router.on("route:preview",function(e){c.preview&&(c.preview.undelegateEvents(),c.preview.unbind()),b.view.view.theme&&b.view.view.theme.preview?(b.view.view.theme.model=b.view.collection.findWhere({slug:e}),b.view.view.theme.preview()):(d.theme=e,b.view.collection.query(d),b.view.collection.trigger("update"),b.view.collection.once("query:success",function(){a('div[data-slug="'+e+'"]').trigger("click")}))}),c.router.on("route:sort",function(a){a||(a="featured",c.router.navigate(c.router.baseUrl("?browse=featured"),{replace:!0})),b.view.sort(a),c.preview&&c.preview.close()}),c.router.on("route:search",function(){a(".wp-filter-search").focus().trigger("keyup")}),this.extraRoutes()},extraRoutes:function(){return!1}},a(document).ready(function(){c.isInstall?c.RunInstaller.init():c.Run.init(),a(document.body).on("click",".load-customize",function(){var b=a(this),c=document.createElement("a");c.href=b.prop("href"),c.search=a.param(_.extend(wp.customize.utils.parseQueryString(c.search.substr(1)),{"return":window.location.href})),b.prop("href",c.href)}),a(".broken-themes .delete-theme").on("click",function(){return confirm(_wpThemeSettings.settings.confirmDelete)})})}(jQuery),jQuery(document).ready(function(a){window.tb_position=function(){var b=a("#TB_window"),c=a(window).width(),d=a(window).height(),e=1040<c?1040:c,f=0;a("#wpadminbar").length&&(f=parseInt(a("#wpadminbar").css("height"),10)),b.size()&&(b.width(e-50).height(d-45-f),a("#TB_iframeContent").width(e-50).height(d-75-f),b.css({"margin-left":"-"+parseInt((e-50)/2,10)+"px"}),"undefined"!=typeof document.body.style.maxWidth&&b.css({top:20+f+"px","margin-top":"0"}))},a(window).resize(function(){tb_position()})}); \ No newline at end of file
diff --git a/www/crm/wp-admin/js/updates.js b/www/crm/wp-admin/js/updates.js
new file mode 100644
index 00000000..9afa4957
--- /dev/null
+++ b/www/crm/wp-admin/js/updates.js
@@ -0,0 +1,2465 @@
+/**
+ * Functions for ajaxified updates, deletions and installs inside the WordPress admin.
+ *
+ * @version 4.2.0
+ * @output wp-admin/js/updates.js
+ */
+
+/* global pagenow */
+
+/**
+ * @param {jQuery} $ jQuery object.
+ * @param {object} wp WP object.
+ * @param {object} settings WP Updates settings.
+ * @param {string} settings.ajax_nonce AJAX nonce.
+ * @param {object} settings.l10n Translation strings.
+ * @param {object=} settings.plugins Base names of plugins in their different states.
+ * @param {Array} settings.plugins.all Base names of all plugins.
+ * @param {Array} settings.plugins.active Base names of active plugins.
+ * @param {Array} settings.plugins.inactive Base names of inactive plugins.
+ * @param {Array} settings.plugins.upgrade Base names of plugins with updates available.
+ * @param {Array} settings.plugins.recently_activated Base names of recently activated plugins.
+ * @param {object=} settings.themes Plugin/theme status information or null.
+ * @param {number} settings.themes.all Amount of all themes.
+ * @param {number} settings.themes.upgrade Amount of themes with updates available.
+ * @param {number} settings.themes.disabled Amount of disabled themes.
+ * @param {object=} settings.totals Combined information for available update counts.
+ * @param {number} settings.totals.count Holds the amount of available updates.
+ */
+(function( $, wp, settings ) {
+ var $document = $( document );
+
+ wp = wp || {};
+
+ /**
+ * The WP Updates object.
+ *
+ * @since 4.2.0
+ *
+ * @namespace wp.updates
+ */
+ wp.updates = {};
+
+ /**
+ * User nonce for ajax calls.
+ *
+ * @since 4.2.0
+ *
+ * @type {string}
+ */
+ wp.updates.ajaxNonce = settings.ajax_nonce;
+
+ /**
+ * Localized strings.
+ *
+ * @since 4.2.0
+ *
+ * @type {object}
+ */
+ wp.updates.l10n = settings.l10n;
+
+ /**
+ * Current search term.
+ *
+ * @since 4.6.0
+ *
+ * @type {string}
+ */
+ wp.updates.searchTerm = '';
+
+ /**
+ * Whether filesystem credentials need to be requested from the user.
+ *
+ * @since 4.2.0
+ *
+ * @type {bool}
+ */
+ wp.updates.shouldRequestFilesystemCredentials = false;
+
+ /**
+ * Filesystem credentials to be packaged along with the request.
+ *
+ * @since 4.2.0
+ * @since 4.6.0 Added `available` property to indicate whether credentials have been provided.
+ *
+ * @type {Object}
+ * @property {Object} filesystemCredentials.ftp Holds FTP credentials.
+ * @property {string} filesystemCredentials.ftp.host FTP host. Default empty string.
+ * @property {string} filesystemCredentials.ftp.username FTP user name. Default empty string.
+ * @property {string} filesystemCredentials.ftp.password FTP password. Default empty string.
+ * @property {string} filesystemCredentials.ftp.connectionType Type of FTP connection. 'ssh', 'ftp', or 'ftps'.
+ * Default empty string.
+ * @property {Object} filesystemCredentials.ssh Holds SSH credentials.
+ * @property {string} filesystemCredentials.ssh.publicKey The public key. Default empty string.
+ * @property {string} filesystemCredentials.ssh.privateKey The private key. Default empty string.
+ * @property {string} filesystemCredentials.fsNonce Filesystem credentials form nonce.
+ * @property {bool} filesystemCredentials.available Whether filesystem credentials have been provided.
+ * Default 'false'.
+ */
+ wp.updates.filesystemCredentials = {
+ ftp: {
+ host: '',
+ username: '',
+ password: '',
+ connectionType: ''
+ },
+ ssh: {
+ publicKey: '',
+ privateKey: ''
+ },
+ fsNonce: '',
+ available: false
+ };
+
+ /**
+ * Whether we're waiting for an Ajax request to complete.
+ *
+ * @since 4.2.0
+ * @since 4.6.0 More accurately named `ajaxLocked`.
+ *
+ * @type {bool}
+ */
+ wp.updates.ajaxLocked = false;
+
+ /**
+ * Admin notice template.
+ *
+ * @since 4.6.0
+ *
+ * @type {function}
+ */
+ wp.updates.adminNotice = wp.template( 'wp-updates-admin-notice' );
+
+ /**
+ * Update queue.
+ *
+ * If the user tries to update a plugin while an update is
+ * already happening, it can be placed in this queue to perform later.
+ *
+ * @since 4.2.0
+ * @since 4.6.0 More accurately named `queue`.
+ *
+ * @type {Array.object}
+ */
+ wp.updates.queue = [];
+
+ /**
+ * Holds a jQuery reference to return focus to when exiting the request credentials modal.
+ *
+ * @since 4.2.0
+ *
+ * @type {jQuery}
+ */
+ wp.updates.$elToReturnFocusToFromCredentialsModal = undefined;
+
+ /**
+ * Adds or updates an admin notice.
+ *
+ * @since 4.6.0
+ *
+ * @param {object} data
+ * @param {*=} data.selector Optional. Selector of an element to be replaced with the admin notice.
+ * @param {string=} data.id Optional. Unique id that will be used as the notice's id attribute.
+ * @param {string=} data.className Optional. Class names that will be used in the admin notice.
+ * @param {string=} data.message Optional. The message displayed in the notice.
+ * @param {number=} data.successes Optional. The amount of successful operations.
+ * @param {number=} data.errors Optional. The amount of failed operations.
+ * @param {Array=} data.errorMessages Optional. Error messages of failed operations.
+ *
+ */
+ wp.updates.addAdminNotice = function( data ) {
+ var $notice = $( data.selector ),
+ $headerEnd = $( '.wp-header-end' ),
+ $adminNotice;
+
+ delete data.selector;
+ $adminNotice = wp.updates.adminNotice( data );
+
+ // Check if this admin notice already exists.
+ if ( ! $notice.length ) {
+ $notice = $( '#' + data.id );
+ }
+
+ if ( $notice.length ) {
+ $notice.replaceWith( $adminNotice );
+ } else if ( $headerEnd.length ) {
+ $headerEnd.after( $adminNotice );
+ } else {
+ if ( 'customize' === pagenow ) {
+ $( '.customize-themes-notifications' ).append( $adminNotice );
+ } else {
+ $( '.wrap' ).find( '> h1' ).after( $adminNotice );
+ }
+ }
+
+ $document.trigger( 'wp-updates-notice-added' );
+ };
+
+ /**
+ * Handles Ajax requests to WordPress.
+ *
+ * @since 4.6.0
+ *
+ * @param {string} action The type of Ajax request ('update-plugin', 'install-theme', etc).
+ * @param {object} data Data that needs to be passed to the ajax callback.
+ * @return {$.promise} A jQuery promise that represents the request,
+ * decorated with an abort() method.
+ */
+ wp.updates.ajax = function( action, data ) {
+ var options = {};
+
+ if ( wp.updates.ajaxLocked ) {
+ wp.updates.queue.push( {
+ action: action,
+ data: data
+ } );
+
+ // Return a Deferred object so callbacks can always be registered.
+ return $.Deferred();
+ }
+
+ wp.updates.ajaxLocked = true;
+
+ if ( data.success ) {
+ options.success = data.success;
+ delete data.success;
+ }
+
+ if ( data.error ) {
+ options.error = data.error;
+ delete data.error;
+ }
+
+ options.data = _.extend( data, {
+ action: action,
+ _ajax_nonce: wp.updates.ajaxNonce,
+ _fs_nonce: wp.updates.filesystemCredentials.fsNonce,
+ username: wp.updates.filesystemCredentials.ftp.username,
+ password: wp.updates.filesystemCredentials.ftp.password,
+ hostname: wp.updates.filesystemCredentials.ftp.hostname,
+ connection_type: wp.updates.filesystemCredentials.ftp.connectionType,
+ public_key: wp.updates.filesystemCredentials.ssh.publicKey,
+ private_key: wp.updates.filesystemCredentials.ssh.privateKey
+ } );
+
+ return wp.ajax.send( options ).always( wp.updates.ajaxAlways );
+ };
+
+ /**
+ * Actions performed after every Ajax request.
+ *
+ * @since 4.6.0
+ *
+ * @param {object} response
+ * @param {array=} response.debug Optional. Debug information.
+ * @param {string=} response.errorCode Optional. Error code for an error that occurred.
+ */
+ wp.updates.ajaxAlways = function( response ) {
+ if ( ! response.errorCode || 'unable_to_connect_to_filesystem' !== response.errorCode ) {
+ wp.updates.ajaxLocked = false;
+ wp.updates.queueChecker();
+ }
+
+ if ( 'undefined' !== typeof response.debug && window.console && window.console.log ) {
+ _.map( response.debug, function( message ) {
+ // Remove all HTML tags and write a message to the console.
+ window.console.log( wp.sanitize.stripTagsAndEncodeText( message ) );
+ } );
+ }
+ };
+
+ /**
+ * Refreshes update counts everywhere on the screen.
+ *
+ * @since 4.7.0
+ */
+ wp.updates.refreshCount = function() {
+ var $adminBarUpdates = $( '#wp-admin-bar-updates' ),
+ $dashboardNavMenuUpdateCount = $( 'a[href="update-core.php"] .update-plugins' ),
+ $pluginsNavMenuUpdateCount = $( 'a[href="plugins.php"] .update-plugins' ),
+ $appearanceNavMenuUpdateCount = $( 'a[href="themes.php"] .update-plugins' ),
+ itemCount;
+
+ $adminBarUpdates.find( '.ab-item' ).removeAttr( 'title' );
+ $adminBarUpdates.find( '.ab-label' ).text( settings.totals.counts.total );
+
+ // Remove the update count from the toolbar if it's zero.
+ if ( 0 === settings.totals.counts.total ) {
+ $adminBarUpdates.find( '.ab-label' ).parents( 'li' ).remove();
+ }
+
+ // Update the "Updates" menu item.
+ $dashboardNavMenuUpdateCount.each( function( index, element ) {
+ element.className = element.className.replace( /count-\d+/, 'count-' + settings.totals.counts.total );
+ } );
+ if ( settings.totals.counts.total > 0 ) {
+ $dashboardNavMenuUpdateCount.find( '.update-count' ).text( settings.totals.counts.total );
+ } else {
+ $dashboardNavMenuUpdateCount.remove();
+ }
+
+ // Update the "Plugins" menu item.
+ $pluginsNavMenuUpdateCount.each( function( index, element ) {
+ element.className = element.className.replace( /count-\d+/, 'count-' + settings.totals.counts.plugins );
+ } );
+ if ( settings.totals.counts.total > 0 ) {
+ $pluginsNavMenuUpdateCount.find( '.plugin-count' ).text( settings.totals.counts.plugins );
+ } else {
+ $pluginsNavMenuUpdateCount.remove();
+ }
+
+ // Update the "Appearance" menu item.
+ $appearanceNavMenuUpdateCount.each( function( index, element ) {
+ element.className = element.className.replace( /count-\d+/, 'count-' + settings.totals.counts.themes );
+ } );
+ if ( settings.totals.counts.total > 0 ) {
+ $appearanceNavMenuUpdateCount.find( '.theme-count' ).text( settings.totals.counts.themes );
+ } else {
+ $appearanceNavMenuUpdateCount.remove();
+ }
+
+ // Update list table filter navigation.
+ if ( 'plugins' === pagenow || 'plugins-network' === pagenow ) {
+ itemCount = settings.totals.counts.plugins;
+ } else if ( 'themes' === pagenow || 'themes-network' === pagenow ) {
+ itemCount = settings.totals.counts.themes;
+ }
+
+ if ( itemCount > 0 ) {
+ $( '.subsubsub .upgrade .count' ).text( '(' + itemCount + ')' );
+ } else {
+ $( '.subsubsub .upgrade' ).remove();
+ $( '.subsubsub li:last' ).html( function() { return $( this ).children(); } );
+ }
+ };
+
+ /**
+ * Decrements the update counts throughout the various menus.
+ *
+ * This includes the toolbar, the "Updates" menu item and the menu items
+ * for plugins and themes.
+ *
+ * @since 3.9.0
+ *
+ * @param {string} type The type of item that was updated or deleted.
+ * Can be 'plugin', 'theme'.
+ */
+ wp.updates.decrementCount = function( type ) {
+ settings.totals.counts.total = Math.max( --settings.totals.counts.total, 0 );
+
+ if ( 'plugin' === type ) {
+ settings.totals.counts.plugins = Math.max( --settings.totals.counts.plugins, 0 );
+ } else if ( 'theme' === type ) {
+ settings.totals.counts.themes = Math.max( --settings.totals.counts.themes, 0 );
+ }
+
+ wp.updates.refreshCount( type );
+ };
+
+ /**
+ * Sends an Ajax request to the server to update a plugin.
+ *
+ * @since 4.2.0
+ * @since 4.6.0 More accurately named `updatePlugin`.
+ *
+ * @param {object} args Arguments.
+ * @param {string} args.plugin Plugin basename.
+ * @param {string} args.slug Plugin slug.
+ * @param {updatePluginSuccess=} args.success Optional. Success callback. Default: wp.updates.updatePluginSuccess
+ * @param {updatePluginError=} args.error Optional. Error callback. Default: wp.updates.updatePluginError
+ * @return {$.promise} A jQuery promise that represents the request,
+ * decorated with an abort() method.
+ */
+ wp.updates.updatePlugin = function( args ) {
+ var $updateRow, $card, $message, message;
+
+ args = _.extend( {
+ success: wp.updates.updatePluginSuccess,
+ error: wp.updates.updatePluginError
+ }, args );
+
+ if ( 'plugins' === pagenow || 'plugins-network' === pagenow ) {
+ $updateRow = $( 'tr[data-plugin="' + args.plugin + '"]' );
+ $message = $updateRow.find( '.update-message' ).removeClass( 'notice-error' ).addClass( 'updating-message notice-warning' ).find( 'p' );
+ message = wp.updates.l10n.pluginUpdatingLabel.replace( '%s', $updateRow.find( '.plugin-title strong' ).text() );
+ } else if ( 'plugin-install' === pagenow || 'plugin-install-network' === pagenow ) {
+ $card = $( '.plugin-card-' + args.slug );
+ $message = $card.find( '.update-now' ).addClass( 'updating-message' );
+ message = wp.updates.l10n.pluginUpdatingLabel.replace( '%s', $message.data( 'name' ) );
+
+ // Remove previous error messages, if any.
+ $card.removeClass( 'plugin-card-update-failed' ).find( '.notice.notice-error' ).remove();
+ }
+
+ if ( $message.html() !== wp.updates.l10n.updating ) {
+ $message.data( 'originaltext', $message.html() );
+ }
+
+ $message
+ .attr( 'aria-label', message )
+ .text( wp.updates.l10n.updating );
+
+ $document.trigger( 'wp-plugin-updating', args );
+
+ return wp.updates.ajax( 'update-plugin', args );
+ };
+
+ /**
+ * Updates the UI appropriately after a successful plugin update.
+ *
+ * @since 4.2.0
+ * @since 4.6.0 More accurately named `updatePluginSuccess`.
+ *
+ * @param {object} response Response from the server.
+ * @param {string} response.slug Slug of the plugin to be updated.
+ * @param {string} response.plugin Basename of the plugin to be updated.
+ * @param {string} response.pluginName Name of the plugin to be updated.
+ * @param {string} response.oldVersion Old version of the plugin.
+ * @param {string} response.newVersion New version of the plugin.
+ */
+ wp.updates.updatePluginSuccess = function( response ) {
+ var $pluginRow, $updateMessage, newText;
+
+ if ( 'plugins' === pagenow || 'plugins-network' === pagenow ) {
+ $pluginRow = $( 'tr[data-plugin="' + response.plugin + '"]' )
+ .removeClass( 'update' )
+ .addClass( 'updated' );
+ $updateMessage = $pluginRow.find( '.update-message' )
+ .removeClass( 'updating-message notice-warning' )
+ .addClass( 'updated-message notice-success' ).find( 'p' );
+
+ // Update the version number in the row.
+ newText = $pluginRow.find( '.plugin-version-author-uri' ).html().replace( response.oldVersion, response.newVersion );
+ $pluginRow.find( '.plugin-version-author-uri' ).html( newText );
+ } else if ( 'plugin-install' === pagenow || 'plugin-install-network' === pagenow ) {
+ $updateMessage = $( '.plugin-card-' + response.slug ).find( '.update-now' )
+ .removeClass( 'updating-message' )
+ .addClass( 'button-disabled updated-message' );
+ }
+
+ $updateMessage
+ .attr( 'aria-label', wp.updates.l10n.pluginUpdatedLabel.replace( '%s', response.pluginName ) )
+ .text( wp.updates.l10n.pluginUpdated );
+
+ wp.a11y.speak( wp.updates.l10n.updatedMsg, 'polite' );
+
+ wp.updates.decrementCount( 'plugin' );
+
+ $document.trigger( 'wp-plugin-update-success', response );
+ };
+
+ /**
+ * Updates the UI appropriately after a failed plugin update.
+ *
+ * @since 4.2.0
+ * @since 4.6.0 More accurately named `updatePluginError`.
+ *
+ * @param {object} response Response from the server.
+ * @param {string} response.slug Slug of the plugin to be updated.
+ * @param {string} response.plugin Basename of the plugin to be updated.
+ * @param {string=} response.pluginName Optional. Name of the plugin to be updated.
+ * @param {string} response.errorCode Error code for the error that occurred.
+ * @param {string} response.errorMessage The error that occurred.
+ */
+ wp.updates.updatePluginError = function( response ) {
+ var $card, $message, errorMessage;
+
+ if ( ! wp.updates.isValidResponse( response, 'update' ) ) {
+ return;
+ }
+
+ if ( wp.updates.maybeHandleCredentialError( response, 'update-plugin' ) ) {
+ return;
+ }
+
+ errorMessage = wp.updates.l10n.updateFailed.replace( '%s', response.errorMessage );
+
+ if ( 'plugins' === pagenow || 'plugins-network' === pagenow ) {
+ if ( response.plugin ) {
+ $message = $( 'tr[data-plugin="' + response.plugin + '"]' ).find( '.update-message' );
+ } else {
+ $message = $( 'tr[data-slug="' + response.slug + '"]' ).find( '.update-message' );
+ }
+ $message.removeClass( 'updating-message notice-warning' ).addClass( 'notice-error' ).find( 'p' ).html( errorMessage );
+
+ if ( response.pluginName ) {
+ $message.find( 'p' )
+ .attr( 'aria-label', wp.updates.l10n.pluginUpdateFailedLabel.replace( '%s', response.pluginName ) );
+ } else {
+ $message.find( 'p' ).removeAttr( 'aria-label' );
+ }
+ } else if ( 'plugin-install' === pagenow || 'plugin-install-network' === pagenow ) {
+ $card = $( '.plugin-card-' + response.slug )
+ .addClass( 'plugin-card-update-failed' )
+ .append( wp.updates.adminNotice( {
+ className: 'update-message notice-error notice-alt is-dismissible',
+ message: errorMessage
+ } ) );
+
+ $card.find( '.update-now' )
+ .text( wp.updates.l10n.updateFailedShort ).removeClass( 'updating-message' );
+
+ if ( response.pluginName ) {
+ $card.find( '.update-now' )
+ .attr( 'aria-label', wp.updates.l10n.pluginUpdateFailedLabel.replace( '%s', response.pluginName ) );
+ } else {
+ $card.find( '.update-now' ).removeAttr( 'aria-label' );
+ }
+
+ $card.on( 'click', '.notice.is-dismissible .notice-dismiss', function() {
+
+ // Use same delay as the total duration of the notice fadeTo + slideUp animation.
+ setTimeout( function() {
+ $card
+ .removeClass( 'plugin-card-update-failed' )
+ .find( '.column-name a' ).focus();
+
+ $card.find( '.update-now' )
+ .attr( 'aria-label', false )
+ .text( wp.updates.l10n.updateNow );
+ }, 200 );
+ } );
+ }
+
+ wp.a11y.speak( errorMessage, 'assertive' );
+
+ $document.trigger( 'wp-plugin-update-error', response );
+ };
+
+ /**
+ * Sends an Ajax request to the server to install a plugin.
+ *
+ * @since 4.6.0
+ *
+ * @param {object} args Arguments.
+ * @param {string} args.slug Plugin identifier in the WordPress.org Plugin repository.
+ * @param {installPluginSuccess=} args.success Optional. Success callback. Default: wp.updates.installPluginSuccess
+ * @param {installPluginError=} args.error Optional. Error callback. Default: wp.updates.installPluginError
+ * @return {$.promise} A jQuery promise that represents the request,
+ * decorated with an abort() method.
+ */
+ wp.updates.installPlugin = function( args ) {
+ var $card = $( '.plugin-card-' + args.slug ),
+ $message = $card.find( '.install-now' );
+
+ args = _.extend( {
+ success: wp.updates.installPluginSuccess,
+ error: wp.updates.installPluginError
+ }, args );
+
+ if ( 'import' === pagenow ) {
+ $message = $( '[data-slug="' + args.slug + '"]' );
+ }
+
+ if ( $message.html() !== wp.updates.l10n.installing ) {
+ $message.data( 'originaltext', $message.html() );
+ }
+
+ $message
+ .addClass( 'updating-message' )
+ .attr( 'aria-label', wp.updates.l10n.pluginInstallingLabel.replace( '%s', $message.data( 'name' ) ) )
+ .text( wp.updates.l10n.installing );
+
+ wp.a11y.speak( wp.updates.l10n.installingMsg, 'polite' );
+
+ // Remove previous error messages, if any.
+ $card.removeClass( 'plugin-card-install-failed' ).find( '.notice.notice-error' ).remove();
+
+ $document.trigger( 'wp-plugin-installing', args );
+
+ return wp.updates.ajax( 'install-plugin', args );
+ };
+
+ /**
+ * Updates the UI appropriately after a successful plugin install.
+ *
+ * @since 4.6.0
+ *
+ * @param {object} response Response from the server.
+ * @param {string} response.slug Slug of the installed plugin.
+ * @param {string} response.pluginName Name of the installed plugin.
+ * @param {string} response.activateUrl URL to activate the just installed plugin.
+ */
+ wp.updates.installPluginSuccess = function( response ) {
+ var $message = $( '.plugin-card-' + response.slug ).find( '.install-now' );
+
+ $message
+ .removeClass( 'updating-message' )
+ .addClass( 'updated-message installed button-disabled' )
+ .attr( 'aria-label', wp.updates.l10n.pluginInstalledLabel.replace( '%s', response.pluginName ) )
+ .text( wp.updates.l10n.pluginInstalled );
+
+ wp.a11y.speak( wp.updates.l10n.installedMsg, 'polite' );
+
+ $document.trigger( 'wp-plugin-install-success', response );
+
+ if ( response.activateUrl ) {
+ setTimeout( function() {
+
+ // Transform the 'Install' button into an 'Activate' button.
+ $message.removeClass( 'install-now installed button-disabled updated-message' ).addClass( 'activate-now button-primary' )
+ .attr( 'href', response.activateUrl )
+ .attr( 'aria-label', wp.updates.l10n.activatePluginLabel.replace( '%s', response.pluginName ) )
+ .text( wp.updates.l10n.activatePlugin );
+ }, 1000 );
+ }
+ };
+
+ /**
+ * Updates the UI appropriately after a failed plugin install.
+ *
+ * @since 4.6.0
+ *
+ * @param {object} response Response from the server.
+ * @param {string} response.slug Slug of the plugin to be installed.
+ * @param {string=} response.pluginName Optional. Name of the plugin to be installed.
+ * @param {string} response.errorCode Error code for the error that occurred.
+ * @param {string} response.errorMessage The error that occurred.
+ */
+ wp.updates.installPluginError = function( response ) {
+ var $card = $( '.plugin-card-' + response.slug ),
+ $button = $card.find( '.install-now' ),
+ errorMessage;
+
+ if ( ! wp.updates.isValidResponse( response, 'install' ) ) {
+ return;
+ }
+
+ if ( wp.updates.maybeHandleCredentialError( response, 'install-plugin' ) ) {
+ return;
+ }
+
+ errorMessage = wp.updates.l10n.installFailed.replace( '%s', response.errorMessage );
+
+ $card
+ .addClass( 'plugin-card-update-failed' )
+ .append( '<div class="notice notice-error notice-alt is-dismissible"><p>' + errorMessage + '</p></div>' );
+
+ $card.on( 'click', '.notice.is-dismissible .notice-dismiss', function() {
+
+ // Use same delay as the total duration of the notice fadeTo + slideUp animation.
+ setTimeout( function() {
+ $card
+ .removeClass( 'plugin-card-update-failed' )
+ .find( '.column-name a' ).focus();
+ }, 200 );
+ } );
+
+ $button
+ .removeClass( 'updating-message' ).addClass( 'button-disabled' )
+ .attr( 'aria-label', wp.updates.l10n.pluginInstallFailedLabel.replace( '%s', $button.data( 'name' ) ) )
+ .text( wp.updates.l10n.installFailedShort );
+
+ wp.a11y.speak( errorMessage, 'assertive' );
+
+ $document.trigger( 'wp-plugin-install-error', response );
+ };
+
+ /**
+ * Updates the UI appropriately after a successful importer install.
+ *
+ * @since 4.6.0
+ *
+ * @param {object} response Response from the server.
+ * @param {string} response.slug Slug of the installed plugin.
+ * @param {string} response.pluginName Name of the installed plugin.
+ * @param {string} response.activateUrl URL to activate the just installed plugin.
+ */
+ wp.updates.installImporterSuccess = function( response ) {
+ wp.updates.addAdminNotice( {
+ id: 'install-success',
+ className: 'notice-success is-dismissible',
+ message: wp.updates.l10n.importerInstalledMsg.replace( '%s', response.activateUrl + '&from=import' )
+ } );
+
+ $( '[data-slug="' + response.slug + '"]' )
+ .removeClass( 'install-now updating-message' )
+ .addClass( 'activate-now' )
+ .attr({
+ 'href': response.activateUrl + '&from=import',
+ 'aria-label': wp.updates.l10n.activateImporterLabel.replace( '%s', response.pluginName )
+ })
+ .text( wp.updates.l10n.activateImporter );
+
+ wp.a11y.speak( wp.updates.l10n.installedMsg, 'polite' );
+
+ $document.trigger( 'wp-importer-install-success', response );
+ };
+
+ /**
+ * Updates the UI appropriately after a failed importer install.
+ *
+ * @since 4.6.0
+ *
+ * @param {object} response Response from the server.
+ * @param {string} response.slug Slug of the plugin to be installed.
+ * @param {string=} response.pluginName Optional. Name of the plugin to be installed.
+ * @param {string} response.errorCode Error code for the error that occurred.
+ * @param {string} response.errorMessage The error that occurred.
+ */
+ wp.updates.installImporterError = function( response ) {
+ var errorMessage = wp.updates.l10n.installFailed.replace( '%s', response.errorMessage ),
+ $installLink = $( '[data-slug="' + response.slug + '"]' ),
+ pluginName = $installLink.data( 'name' );
+
+ if ( ! wp.updates.isValidResponse( response, 'install' ) ) {
+ return;
+ }
+
+ if ( wp.updates.maybeHandleCredentialError( response, 'install-plugin' ) ) {
+ return;
+ }
+
+ wp.updates.addAdminNotice( {
+ id: response.errorCode,
+ className: 'notice-error is-dismissible',
+ message: errorMessage
+ } );
+
+ $installLink
+ .removeClass( 'updating-message' )
+ .text( wp.updates.l10n.installNow )
+ .attr( 'aria-label', wp.updates.l10n.pluginInstallNowLabel.replace( '%s', pluginName ) );
+
+ wp.a11y.speak( errorMessage, 'assertive' );
+
+ $document.trigger( 'wp-importer-install-error', response );
+ };
+
+ /**
+ * Sends an Ajax request to the server to delete a plugin.
+ *
+ * @since 4.6.0
+ *
+ * @param {object} args Arguments.
+ * @param {string} args.plugin Basename of the plugin to be deleted.
+ * @param {string} args.slug Slug of the plugin to be deleted.
+ * @param {deletePluginSuccess=} args.success Optional. Success callback. Default: wp.updates.deletePluginSuccess
+ * @param {deletePluginError=} args.error Optional. Error callback. Default: wp.updates.deletePluginError
+ * @return {$.promise} A jQuery promise that represents the request,
+ * decorated with an abort() method.
+ */
+ wp.updates.deletePlugin = function( args ) {
+ var $link = $( '[data-plugin="' + args.plugin + '"]' ).find( '.row-actions a.delete' );
+
+ args = _.extend( {
+ success: wp.updates.deletePluginSuccess,
+ error: wp.updates.deletePluginError
+ }, args );
+
+ if ( $link.html() !== wp.updates.l10n.deleting ) {
+ $link
+ .data( 'originaltext', $link.html() )
+ .text( wp.updates.l10n.deleting );
+ }
+
+ wp.a11y.speak( wp.updates.l10n.deleting, 'polite' );
+
+ $document.trigger( 'wp-plugin-deleting', args );
+
+ return wp.updates.ajax( 'delete-plugin', args );
+ };
+
+ /**
+ * Updates the UI appropriately after a successful plugin deletion.
+ *
+ * @since 4.6.0
+ *
+ * @param {Object} response Response from the server.
+ * @param {string} response.slug Slug of the plugin that was deleted.
+ * @param {string} response.plugin Base name of the plugin that was deleted.
+ * @param {string} response.pluginName Name of the plugin that was deleted.
+ */
+ wp.updates.deletePluginSuccess = function( response ) {
+
+ // Removes the plugin and updates rows.
+ $( '[data-plugin="' + response.plugin + '"]' ).css( { backgroundColor: '#faafaa' } ).fadeOut( 350, function() {
+ var $form = $( '#bulk-action-form' ),
+ $views = $( '.subsubsub' ),
+ $pluginRow = $( this ),
+ columnCount = $form.find( 'thead th:not(.hidden), thead td' ).length,
+ pluginDeletedRow = wp.template( 'item-deleted-row' ),
+ /**
+ * Plugins Base names of plugins in their different states.
+ *
+ * @type {Object}
+ */
+ plugins = settings.plugins;
+
+ // Add a success message after deleting a plugin.
+ if ( ! $pluginRow.hasClass( 'plugin-update-tr' ) ) {
+ $pluginRow.after(
+ pluginDeletedRow( {
+ slug: response.slug,
+ plugin: response.plugin,
+ colspan: columnCount,
+ name: response.pluginName
+ } )
+ );
+ }
+
+ $pluginRow.remove();
+
+ // Remove plugin from update count.
+ if ( -1 !== _.indexOf( plugins.upgrade, response.plugin ) ) {
+ plugins.upgrade = _.without( plugins.upgrade, response.plugin );
+ wp.updates.decrementCount( 'plugin' );
+ }
+
+ // Remove from views.
+ if ( -1 !== _.indexOf( plugins.inactive, response.plugin ) ) {
+ plugins.inactive = _.without( plugins.inactive, response.plugin );
+ if ( plugins.inactive.length ) {
+ $views.find( '.inactive .count' ).text( '(' + plugins.inactive.length + ')' );
+ } else {
+ $views.find( '.inactive' ).remove();
+ }
+ }
+
+ if ( -1 !== _.indexOf( plugins.active, response.plugin ) ) {
+ plugins.active = _.without( plugins.active, response.plugin );
+ if ( plugins.active.length ) {
+ $views.find( '.active .count' ).text( '(' + plugins.active.length + ')' );
+ } else {
+ $views.find( '.active' ).remove();
+ }
+ }
+
+ if ( -1 !== _.indexOf( plugins.recently_activated, response.plugin ) ) {
+ plugins.recently_activated = _.without( plugins.recently_activated, response.plugin );
+ if ( plugins.recently_activated.length ) {
+ $views.find( '.recently_activated .count' ).text( '(' + plugins.recently_activated.length + ')' );
+ } else {
+ $views.find( '.recently_activated' ).remove();
+ }
+ }
+
+ plugins.all = _.without( plugins.all, response.plugin );
+
+ if ( plugins.all.length ) {
+ $views.find( '.all .count' ).text( '(' + plugins.all.length + ')' );
+ } else {
+ $form.find( '.tablenav' ).css( { visibility: 'hidden' } );
+ $views.find( '.all' ).remove();
+
+ if ( ! $form.find( 'tr.no-items' ).length ) {
+ $form.find( '#the-list' ).append( '<tr class="no-items"><td class="colspanchange" colspan="' + columnCount + '">' + wp.updates.l10n.noPlugins + '</td></tr>' );
+ }
+ }
+ } );
+
+ wp.a11y.speak( wp.updates.l10n.pluginDeleted, 'polite' );
+
+ $document.trigger( 'wp-plugin-delete-success', response );
+ };
+
+ /**
+ * Updates the UI appropriately after a failed plugin deletion.
+ *
+ * @since 4.6.0
+ *
+ * @param {object} response Response from the server.
+ * @param {string} response.slug Slug of the plugin to be deleted.
+ * @param {string} response.plugin Base name of the plugin to be deleted
+ * @param {string=} response.pluginName Optional. Name of the plugin to be deleted.
+ * @param {string} response.errorCode Error code for the error that occurred.
+ * @param {string} response.errorMessage The error that occurred.
+ */
+ wp.updates.deletePluginError = function( response ) {
+ var $plugin, $pluginUpdateRow,
+ pluginUpdateRow = wp.template( 'item-update-row' ),
+ noticeContent = wp.updates.adminNotice( {
+ className: 'update-message notice-error notice-alt',
+ message: response.errorMessage
+ } );
+
+ if ( response.plugin ) {
+ $plugin = $( 'tr.inactive[data-plugin="' + response.plugin + '"]' );
+ $pluginUpdateRow = $plugin.siblings( '[data-plugin="' + response.plugin + '"]' );
+ } else {
+ $plugin = $( 'tr.inactive[data-slug="' + response.slug + '"]' );
+ $pluginUpdateRow = $plugin.siblings( '[data-slug="' + response.slug + '"]' );
+ }
+
+ if ( ! wp.updates.isValidResponse( response, 'delete' ) ) {
+ return;
+ }
+
+ if ( wp.updates.maybeHandleCredentialError( response, 'delete-plugin' ) ) {
+ return;
+ }
+
+ // Add a plugin update row if it doesn't exist yet.
+ if ( ! $pluginUpdateRow.length ) {
+ $plugin.addClass( 'update' ).after(
+ pluginUpdateRow( {
+ slug: response.slug,
+ plugin: response.plugin || response.slug,
+ colspan: $( '#bulk-action-form' ).find( 'thead th:not(.hidden), thead td' ).length,
+ content: noticeContent
+ } )
+ );
+ } else {
+
+ // Remove previous error messages, if any.
+ $pluginUpdateRow.find( '.notice-error' ).remove();
+
+ $pluginUpdateRow.find( '.plugin-update' ).append( noticeContent );
+ }
+
+ $document.trigger( 'wp-plugin-delete-error', response );
+ };
+
+ /**
+ * Sends an Ajax request to the server to update a theme.
+ *
+ * @since 4.6.0
+ *
+ * @param {object} args Arguments.
+ * @param {string} args.slug Theme stylesheet.
+ * @param {updateThemeSuccess=} args.success Optional. Success callback. Default: wp.updates.updateThemeSuccess
+ * @param {updateThemeError=} args.error Optional. Error callback. Default: wp.updates.updateThemeError
+ * @return {$.promise} A jQuery promise that represents the request,
+ * decorated with an abort() method.
+ */
+ wp.updates.updateTheme = function( args ) {
+ var $notice;
+
+ args = _.extend( {
+ success: wp.updates.updateThemeSuccess,
+ error: wp.updates.updateThemeError
+ }, args );
+
+ if ( 'themes-network' === pagenow ) {
+ $notice = $( '[data-slug="' + args.slug + '"]' ).find( '.update-message' ).removeClass( 'notice-error' ).addClass( 'updating-message notice-warning' ).find( 'p' );
+
+ } else if ( 'customize' === pagenow ) {
+
+ // Update the theme details UI.
+ $notice = $( '[data-slug="' + args.slug + '"].notice' ).removeClass( 'notice-large' );
+
+ $notice.find( 'h3' ).remove();
+
+ // Add the top-level UI, and update both.
+ $notice = $notice.add( $( '#customize-control-installed_theme_' + args.slug ).find( '.update-message' ) );
+ $notice = $notice.addClass( 'updating-message' ).find( 'p' );
+
+ } else {
+ $notice = $( '#update-theme' ).closest( '.notice' ).removeClass( 'notice-large' );
+
+ $notice.find( 'h3' ).remove();
+
+ $notice = $notice.add( $( '[data-slug="' + args.slug + '"]' ).find( '.update-message' ) );
+ $notice = $notice.addClass( 'updating-message' ).find( 'p' );
+ }
+
+ if ( $notice.html() !== wp.updates.l10n.updating ) {
+ $notice.data( 'originaltext', $notice.html() );
+ }
+
+ wp.a11y.speak( wp.updates.l10n.updatingMsg, 'polite' );
+ $notice.text( wp.updates.l10n.updating );
+
+ $document.trigger( 'wp-theme-updating', args );
+
+ return wp.updates.ajax( 'update-theme', args );
+ };
+
+ /**
+ * Updates the UI appropriately after a successful theme update.
+ *
+ * @since 4.6.0
+ *
+ * @param {object} response
+ * @param {string} response.slug Slug of the theme to be updated.
+ * @param {object} response.theme Updated theme.
+ * @param {string} response.oldVersion Old version of the theme.
+ * @param {string} response.newVersion New version of the theme.
+ */
+ wp.updates.updateThemeSuccess = function( response ) {
+ var isModalOpen = $( 'body.modal-open' ).length,
+ $theme = $( '[data-slug="' + response.slug + '"]' ),
+ updatedMessage = {
+ className: 'updated-message notice-success notice-alt',
+ message: wp.updates.l10n.themeUpdated
+ },
+ $notice, newText;
+
+ if ( 'customize' === pagenow ) {
+ $theme = $( '.updating-message' ).siblings( '.theme-name' );
+
+ if ( $theme.length ) {
+
+ // Update the version number in the row.
+ newText = $theme.html().replace( response.oldVersion, response.newVersion );
+ $theme.html( newText );
+ }
+
+ $notice = $( '.theme-info .notice' ).add( wp.customize.control( 'installed_theme_' + response.slug ).container.find( '.theme' ).find( '.update-message' ) );
+ } else if ( 'themes-network' === pagenow ) {
+ $notice = $theme.find( '.update-message' );
+
+ // Update the version number in the row.
+ newText = $theme.find( '.theme-version-author-uri' ).html().replace( response.oldVersion, response.newVersion );
+ $theme.find( '.theme-version-author-uri' ).html( newText );
+ } else {
+ $notice = $( '.theme-info .notice' ).add( $theme.find( '.update-message' ) );
+
+ // Focus on Customize button after updating.
+ if ( isModalOpen ) {
+ $( '.load-customize:visible' ).focus();
+ } else {
+ $theme.find( '.load-customize' ).focus();
+ }
+ }
+
+ wp.updates.addAdminNotice( _.extend( { selector: $notice }, updatedMessage ) );
+ wp.a11y.speak( wp.updates.l10n.updatedMsg, 'polite' );
+
+ wp.updates.decrementCount( 'theme' );
+
+ $document.trigger( 'wp-theme-update-success', response );
+
+ // Show updated message after modal re-rendered.
+ if ( isModalOpen && 'customize' !== pagenow ) {
+ $( '.theme-info .theme-author' ).after( wp.updates.adminNotice( updatedMessage ) );
+ }
+ };
+
+ /**
+ * Updates the UI appropriately after a failed theme update.
+ *
+ * @since 4.6.0
+ *
+ * @param {object} response Response from the server.
+ * @param {string} response.slug Slug of the theme to be updated.
+ * @param {string} response.errorCode Error code for the error that occurred.
+ * @param {string} response.errorMessage The error that occurred.
+ */
+ wp.updates.updateThemeError = function( response ) {
+ var $theme = $( '[data-slug="' + response.slug + '"]' ),
+ errorMessage = wp.updates.l10n.updateFailed.replace( '%s', response.errorMessage ),
+ $notice;
+
+ if ( ! wp.updates.isValidResponse( response, 'update' ) ) {
+ return;
+ }
+
+ if ( wp.updates.maybeHandleCredentialError( response, 'update-theme' ) ) {
+ return;
+ }
+
+ if ( 'customize' === pagenow ) {
+ $theme = wp.customize.control( 'installed_theme_' + response.slug ).container.find( '.theme' );
+ }
+
+ if ( 'themes-network' === pagenow ) {
+ $notice = $theme.find( '.update-message ' );
+ } else {
+ $notice = $( '.theme-info .notice' ).add( $theme.find( '.notice' ) );
+
+ $( 'body.modal-open' ).length ? $( '.load-customize:visible' ).focus() : $theme.find( '.load-customize' ).focus();
+ }
+
+ wp.updates.addAdminNotice( {
+ selector: $notice,
+ className: 'update-message notice-error notice-alt is-dismissible',
+ message: errorMessage
+ } );
+
+ wp.a11y.speak( errorMessage, 'polite' );
+
+ $document.trigger( 'wp-theme-update-error', response );
+ };
+
+ /**
+ * Sends an Ajax request to the server to install a theme.
+ *
+ * @since 4.6.0
+ *
+ * @param {object} args
+ * @param {string} args.slug Theme stylesheet.
+ * @param {installThemeSuccess=} args.success Optional. Success callback. Default: wp.updates.installThemeSuccess
+ * @param {installThemeError=} args.error Optional. Error callback. Default: wp.updates.installThemeError
+ * @return {$.promise} A jQuery promise that represents the request,
+ * decorated with an abort() method.
+ */
+ wp.updates.installTheme = function( args ) {
+ var $message = $( '.theme-install[data-slug="' + args.slug + '"]' );
+
+ args = _.extend( {
+ success: wp.updates.installThemeSuccess,
+ error: wp.updates.installThemeError
+ }, args );
+
+ $message.addClass( 'updating-message' );
+ $message.parents( '.theme' ).addClass( 'focus' );
+ if ( $message.html() !== wp.updates.l10n.installing ) {
+ $message.data( 'originaltext', $message.html() );
+ }
+
+ $message
+ .text( wp.updates.l10n.installing )
+ .attr( 'aria-label', wp.updates.l10n.themeInstallingLabel.replace( '%s', $message.data( 'name' ) ) );
+ wp.a11y.speak( wp.updates.l10n.installingMsg, 'polite' );
+
+ // Remove previous error messages, if any.
+ $( '.install-theme-info, [data-slug="' + args.slug + '"]' ).removeClass( 'theme-install-failed' ).find( '.notice.notice-error' ).remove();
+
+ $document.trigger( 'wp-theme-installing', args );
+
+ return wp.updates.ajax( 'install-theme', args );
+ };
+
+ /**
+ * Updates the UI appropriately after a successful theme install.
+ *
+ * @since 4.6.0
+ *
+ * @param {object} response Response from the server.
+ * @param {string} response.slug Slug of the theme to be installed.
+ * @param {string} response.customizeUrl URL to the Customizer for the just installed theme.
+ * @param {string} response.activateUrl URL to activate the just installed theme.
+ */
+ wp.updates.installThemeSuccess = function( response ) {
+ var $card = $( '.wp-full-overlay-header, [data-slug=' + response.slug + ']' ),
+ $message;
+
+ $document.trigger( 'wp-theme-install-success', response );
+
+ $message = $card.find( '.button-primary' )
+ .removeClass( 'updating-message' )
+ .addClass( 'updated-message disabled' )
+ .attr( 'aria-label', wp.updates.l10n.themeInstalledLabel.replace( '%s', response.themeName ) )
+ .text( wp.updates.l10n.themeInstalled );
+
+ wp.a11y.speak( wp.updates.l10n.installedMsg, 'polite' );
+
+ setTimeout( function() {
+
+ if ( response.activateUrl ) {
+
+ // Transform the 'Install' button into an 'Activate' button.
+ $message
+ .attr( 'href', response.activateUrl )
+ .removeClass( 'theme-install updated-message disabled' )
+ .addClass( 'activate' )
+ .attr( 'aria-label', wp.updates.l10n.activateThemeLabel.replace( '%s', response.themeName ) )
+ .text( wp.updates.l10n.activateTheme );
+ }
+
+ if ( response.customizeUrl ) {
+
+ // Transform the 'Preview' button into a 'Live Preview' button.
+ $message.siblings( '.preview' ).replaceWith( function () {
+ return $( '<a>' )
+ .attr( 'href', response.customizeUrl )
+ .addClass( 'button load-customize' )
+ .text( wp.updates.l10n.livePreview );
+ } );
+ }
+ }, 1000 );
+ };
+
+ /**
+ * Updates the UI appropriately after a failed theme install.
+ *
+ * @since 4.6.0
+ *
+ * @param {object} response Response from the server.
+ * @param {string} response.slug Slug of the theme to be installed.
+ * @param {string} response.errorCode Error code for the error that occurred.
+ * @param {string} response.errorMessage The error that occurred.
+ */
+ wp.updates.installThemeError = function( response ) {
+ var $card, $button,
+ errorMessage = wp.updates.l10n.installFailed.replace( '%s', response.errorMessage ),
+ $message = wp.updates.adminNotice( {
+ className: 'update-message notice-error notice-alt',
+ message: errorMessage
+ } );
+
+ if ( ! wp.updates.isValidResponse( response, 'install' ) ) {
+ return;
+ }
+
+ if ( wp.updates.maybeHandleCredentialError( response, 'install-theme' ) ) {
+ return;
+ }
+
+ if ( 'customize' === pagenow ) {
+ if ( $document.find( 'body' ).hasClass( 'modal-open' ) ) {
+ $button = $( '.theme-install[data-slug="' + response.slug + '"]' );
+ $card = $( '.theme-overlay .theme-info' ).prepend( $message );
+ } else {
+ $button = $( '.theme-install[data-slug="' + response.slug + '"]' );
+ $card = $button.closest( '.theme' ).addClass( 'theme-install-failed' ).append( $message );
+ }
+ wp.customize.notifications.remove( 'theme_installing' );
+ } else {
+ if ( $document.find( 'body' ).hasClass( 'full-overlay-active' ) ) {
+ $button = $( '.theme-install[data-slug="' + response.slug + '"]' );
+ $card = $( '.install-theme-info' ).prepend( $message );
+ } else {
+ $card = $( '[data-slug="' + response.slug + '"]' ).removeClass( 'focus' ).addClass( 'theme-install-failed' ).append( $message );
+ $button = $card.find( '.theme-install' );
+ }
+ }
+
+ $button
+ .removeClass( 'updating-message' )
+ .attr( 'aria-label', wp.updates.l10n.themeInstallFailedLabel.replace( '%s', $button.data( 'name' ) ) )
+ .text( wp.updates.l10n.installFailedShort );
+
+ wp.a11y.speak( errorMessage, 'assertive' );
+
+ $document.trigger( 'wp-theme-install-error', response );
+ };
+
+ /**
+ * Sends an Ajax request to the server to delete a theme.
+ *
+ * @since 4.6.0
+ *
+ * @param {object} args
+ * @param {string} args.slug Theme stylesheet.
+ * @param {deleteThemeSuccess=} args.success Optional. Success callback. Default: wp.updates.deleteThemeSuccess
+ * @param {deleteThemeError=} args.error Optional. Error callback. Default: wp.updates.deleteThemeError
+ * @return {$.promise} A jQuery promise that represents the request,
+ * decorated with an abort() method.
+ */
+ wp.updates.deleteTheme = function( args ) {
+ var $button;
+
+ if ( 'themes' === pagenow ) {
+ $button = $( '.theme-actions .delete-theme' );
+ } else if ( 'themes-network' === pagenow ) {
+ $button = $( '[data-slug="' + args.slug + '"]' ).find( '.row-actions a.delete' );
+ }
+
+ args = _.extend( {
+ success: wp.updates.deleteThemeSuccess,
+ error: wp.updates.deleteThemeError
+ }, args );
+
+ if ( $button && $button.html() !== wp.updates.l10n.deleting ) {
+ $button
+ .data( 'originaltext', $button.html() )
+ .text( wp.updates.l10n.deleting );
+ }
+
+ wp.a11y.speak( wp.updates.l10n.deleting, 'polite' );
+
+ // Remove previous error messages, if any.
+ $( '.theme-info .update-message' ).remove();
+
+ $document.trigger( 'wp-theme-deleting', args );
+
+ return wp.updates.ajax( 'delete-theme', args );
+ };
+
+ /**
+ * Updates the UI appropriately after a successful theme deletion.
+ *
+ * @since 4.6.0
+ *
+ * @param {object} response Response from the server.
+ * @param {string} response.slug Slug of the theme that was deleted.
+ */
+ wp.updates.deleteThemeSuccess = function( response ) {
+ var $themeRows = $( '[data-slug="' + response.slug + '"]' );
+
+ if ( 'themes-network' === pagenow ) {
+
+ // Removes the theme and updates rows.
+ $themeRows.css( { backgroundColor: '#faafaa' } ).fadeOut( 350, function() {
+ var $views = $( '.subsubsub' ),
+ $themeRow = $( this ),
+ totals = settings.themes,
+ deletedRow = wp.template( 'item-deleted-row' );
+
+ if ( ! $themeRow.hasClass( 'plugin-update-tr' ) ) {
+ $themeRow.after(
+ deletedRow( {
+ slug: response.slug,
+ colspan: $( '#bulk-action-form' ).find( 'thead th:not(.hidden), thead td' ).length,
+ name: $themeRow.find( '.theme-title strong' ).text()
+ } )
+ );
+ }
+
+ $themeRow.remove();
+
+ // Remove theme from update count.
+ if ( $themeRow.hasClass( 'update' ) ) {
+ totals.upgrade--;
+ wp.updates.decrementCount( 'theme' );
+ }
+
+ // Remove from views.
+ if ( $themeRow.hasClass( 'inactive' ) ) {
+ totals.disabled--;
+ if ( totals.disabled ) {
+ $views.find( '.disabled .count' ).text( '(' + totals.disabled + ')' );
+ } else {
+ $views.find( '.disabled' ).remove();
+ }
+ }
+
+ // There is always at least one theme available.
+ $views.find( '.all .count' ).text( '(' + --totals.all + ')' );
+ } );
+ }
+
+ wp.a11y.speak( wp.updates.l10n.themeDeleted, 'polite' );
+
+ $document.trigger( 'wp-theme-delete-success', response );
+ };
+
+ /**
+ * Updates the UI appropriately after a failed theme deletion.
+ *
+ * @since 4.6.0
+ *
+ * @param {object} response Response from the server.
+ * @param {string} response.slug Slug of the theme to be deleted.
+ * @param {string} response.errorCode Error code for the error that occurred.
+ * @param {string} response.errorMessage The error that occurred.
+ */
+ wp.updates.deleteThemeError = function( response ) {
+ var $themeRow = $( 'tr.inactive[data-slug="' + response.slug + '"]' ),
+ $button = $( '.theme-actions .delete-theme' ),
+ updateRow = wp.template( 'item-update-row' ),
+ $updateRow = $themeRow.siblings( '#' + response.slug + '-update' ),
+ errorMessage = wp.updates.l10n.deleteFailed.replace( '%s', response.errorMessage ),
+ $message = wp.updates.adminNotice( {
+ className: 'update-message notice-error notice-alt',
+ message: errorMessage
+ } );
+
+ if ( wp.updates.maybeHandleCredentialError( response, 'delete-theme' ) ) {
+ return;
+ }
+
+ if ( 'themes-network' === pagenow ) {
+ if ( ! $updateRow.length ) {
+ $themeRow.addClass( 'update' ).after(
+ updateRow( {
+ slug: response.slug,
+ colspan: $( '#bulk-action-form' ).find( 'thead th:not(.hidden), thead td' ).length,
+ content: $message
+ } )
+ );
+ } else {
+ // Remove previous error messages, if any.
+ $updateRow.find( '.notice-error' ).remove();
+ $updateRow.find( '.plugin-update' ).append( $message );
+ }
+ } else {
+ $( '.theme-info .theme-description' ).before( $message );
+ }
+
+ $button.html( $button.data( 'originaltext' ) );
+
+ wp.a11y.speak( errorMessage, 'assertive' );
+
+ $document.trigger( 'wp-theme-delete-error', response );
+ };
+
+ /**
+ * Adds the appropriate callback based on the type of action and the current page.
+ *
+ * @since 4.6.0
+ * @private
+ *
+ * @param {object} data AJAX payload.
+ * @param {string} action The type of request to perform.
+ * @return {object} The AJAX payload with the appropriate callbacks.
+ */
+ wp.updates._addCallbacks = function( data, action ) {
+ if ( 'import' === pagenow && 'install-plugin' === action ) {
+ data.success = wp.updates.installImporterSuccess;
+ data.error = wp.updates.installImporterError;
+ }
+
+ return data;
+ };
+
+ /**
+ * Pulls available jobs from the queue and runs them.
+ *
+ * @since 4.2.0
+ * @since 4.6.0 Can handle multiple job types.
+ */
+ wp.updates.queueChecker = function() {
+ var job;
+
+ if ( wp.updates.ajaxLocked || ! wp.updates.queue.length ) {
+ return;
+ }
+
+ job = wp.updates.queue.shift();
+
+ // Handle a queue job.
+ switch ( job.action ) {
+ case 'install-plugin':
+ wp.updates.installPlugin( job.data );
+ break;
+
+ case 'update-plugin':
+ wp.updates.updatePlugin( job.data );
+ break;
+
+ case 'delete-plugin':
+ wp.updates.deletePlugin( job.data );
+ break;
+
+ case 'install-theme':
+ wp.updates.installTheme( job.data );
+ break;
+
+ case 'update-theme':
+ wp.updates.updateTheme( job.data );
+ break;
+
+ case 'delete-theme':
+ wp.updates.deleteTheme( job.data );
+ break;
+
+ default:
+ break;
+ }
+ };
+
+ /**
+ * Requests the users filesystem credentials if they aren't already known.
+ *
+ * @since 4.2.0
+ *
+ * @param {Event=} event Optional. Event interface.
+ */
+ wp.updates.requestFilesystemCredentials = function( event ) {
+ if ( false === wp.updates.filesystemCredentials.available ) {
+ /*
+ * After exiting the credentials request modal,
+ * return the focus to the element triggering the request.
+ */
+ if ( event && ! wp.updates.$elToReturnFocusToFromCredentialsModal ) {
+ wp.updates.$elToReturnFocusToFromCredentialsModal = $( event.target );
+ }
+
+ wp.updates.ajaxLocked = true;
+ wp.updates.requestForCredentialsModalOpen();
+ }
+ };
+
+ /**
+ * Requests the users filesystem credentials if needed and there is no lock.
+ *
+ * @since 4.6.0
+ *
+ * @param {Event=} event Optional. Event interface.
+ */
+ wp.updates.maybeRequestFilesystemCredentials = function( event ) {
+ if ( wp.updates.shouldRequestFilesystemCredentials && ! wp.updates.ajaxLocked ) {
+ wp.updates.requestFilesystemCredentials( event );
+ }
+ };
+
+ /**
+ * Keydown handler for the request for credentials modal.
+ *
+ * Closes the modal when the escape key is pressed and
+ * constrains keyboard navigation to inside the modal.
+ *
+ * @since 4.2.0
+ *
+ * @param {Event} event Event interface.
+ */
+ wp.updates.keydown = function( event ) {
+ if ( 27 === event.keyCode ) {
+ wp.updates.requestForCredentialsModalCancel();
+ } else if ( 9 === event.keyCode ) {
+
+ // #upgrade button must always be the last focus-able element in the dialog.
+ if ( 'upgrade' === event.target.id && ! event.shiftKey ) {
+ $( '#hostname' ).focus();
+
+ event.preventDefault();
+ } else if ( 'hostname' === event.target.id && event.shiftKey ) {
+ $( '#upgrade' ).focus();
+
+ event.preventDefault();
+ }
+ }
+ };
+
+ /**
+ * Opens the request for credentials modal.
+ *
+ * @since 4.2.0
+ */
+ wp.updates.requestForCredentialsModalOpen = function() {
+ var $modal = $( '#request-filesystem-credentials-dialog' );
+
+ $( 'body' ).addClass( 'modal-open' );
+ $modal.show();
+ $modal.find( 'input:enabled:first' ).focus();
+ $modal.on( 'keydown', wp.updates.keydown );
+ };
+
+ /**
+ * Closes the request for credentials modal.
+ *
+ * @since 4.2.0
+ */
+ wp.updates.requestForCredentialsModalClose = function() {
+ $( '#request-filesystem-credentials-dialog' ).hide();
+ $( 'body' ).removeClass( 'modal-open' );
+
+ if ( wp.updates.$elToReturnFocusToFromCredentialsModal ) {
+ wp.updates.$elToReturnFocusToFromCredentialsModal.focus();
+ }
+ };
+
+ /**
+ * Takes care of the steps that need to happen when the modal is canceled out.
+ *
+ * @since 4.2.0
+ * @since 4.6.0 Triggers an event for callbacks to listen to and add their actions.
+ */
+ wp.updates.requestForCredentialsModalCancel = function() {
+
+ // Not ajaxLocked and no queue means we already have cleared things up.
+ if ( ! wp.updates.ajaxLocked && ! wp.updates.queue.length ) {
+ return;
+ }
+
+ _.each( wp.updates.queue, function( job ) {
+ $document.trigger( 'credential-modal-cancel', job );
+ } );
+
+ // Remove the lock, and clear the queue.
+ wp.updates.ajaxLocked = false;
+ wp.updates.queue = [];
+
+ wp.updates.requestForCredentialsModalClose();
+ };
+
+ /**
+ * Displays an error message in the request for credentials form.
+ *
+ * @since 4.2.0
+ *
+ * @param {string} message Error message.
+ */
+ wp.updates.showErrorInCredentialsForm = function( message ) {
+ var $filesystemForm = $( '#request-filesystem-credentials-form' );
+
+ // Remove any existing error.
+ $filesystemForm.find( '.notice' ).remove();
+ $filesystemForm.find( '#request-filesystem-credentials-title' ).after( '<div class="notice notice-alt notice-error"><p>' + message + '</p></div>' );
+ };
+
+ /**
+ * Handles credential errors and runs events that need to happen in that case.
+ *
+ * @since 4.2.0
+ *
+ * @param {object} response Ajax response.
+ * @param {string} action The type of request to perform.
+ */
+ wp.updates.credentialError = function( response, action ) {
+
+ // Restore callbacks.
+ response = wp.updates._addCallbacks( response, action );
+
+ wp.updates.queue.unshift( {
+ action: action,
+
+ /*
+ * Not cool that we're depending on response for this data.
+ * This would feel more whole in a view all tied together.
+ */
+ data: response
+ } );
+
+ wp.updates.filesystemCredentials.available = false;
+ wp.updates.showErrorInCredentialsForm( response.errorMessage );
+ wp.updates.requestFilesystemCredentials();
+ };
+
+ /**
+ * Handles credentials errors if it could not connect to the filesystem.
+ *
+ * @since 4.6.0
+ *
+ * @param {object} response Response from the server.
+ * @param {string} response.errorCode Error code for the error that occurred.
+ * @param {string} response.errorMessage The error that occurred.
+ * @param {string} action The type of request to perform.
+ * @returns {boolean} Whether there is an error that needs to be handled or not.
+ */
+ wp.updates.maybeHandleCredentialError = function( response, action ) {
+ if ( wp.updates.shouldRequestFilesystemCredentials && response.errorCode && 'unable_to_connect_to_filesystem' === response.errorCode ) {
+ wp.updates.credentialError( response, action );
+ return true;
+ }
+
+ return false;
+ };
+
+ /**
+ * Validates an AJAX response to ensure it's a proper object.
+ *
+ * If the response deems to be invalid, an admin notice is being displayed.
+ *
+ * @param {(object|string)} response Response from the server.
+ * @param {function=} response.always Optional. Callback for when the Deferred is resolved or rejected.
+ * @param {string=} response.statusText Optional. Status message corresponding to the status code.
+ * @param {string=} response.responseText Optional. Request response as text.
+ * @param {string} action Type of action the response is referring to. Can be 'delete',
+ * 'update' or 'install'.
+ */
+ wp.updates.isValidResponse = function( response, action ) {
+ var error = wp.updates.l10n.unknownError,
+ errorMessage;
+
+ // Make sure the response is a valid data object and not a Promise object.
+ if ( _.isObject( response ) && ! _.isFunction( response.always ) ) {
+ return true;
+ }
+
+ if ( _.isString( response ) && '-1' === response ) {
+ error = wp.updates.l10n.nonceError;
+ } else if ( _.isString( response ) ) {
+ error = response;
+ } else if ( 'undefined' !== typeof response.readyState && 0 === response.readyState ) {
+ error = wp.updates.l10n.connectionError;
+ } else if ( _.isString( response.responseText ) && '' !== response.responseText ) {
+ error = response.responseText;
+ } else if ( _.isString( response.statusText ) ) {
+ error = response.statusText;
+ }
+
+ switch ( action ) {
+ case 'update':
+ errorMessage = wp.updates.l10n.updateFailed;
+ break;
+
+ case 'install':
+ errorMessage = wp.updates.l10n.installFailed;
+ break;
+
+ case 'delete':
+ errorMessage = wp.updates.l10n.deleteFailed;
+ break;
+ }
+
+ // Messages are escaped, remove HTML tags to make them more readable.
+ error = error.replace( /<[\/a-z][^<>]*>/gi, '' );
+ errorMessage = errorMessage.replace( '%s', error );
+
+ // Add admin notice.
+ wp.updates.addAdminNotice( {
+ id: 'unknown_error',
+ className: 'notice-error is-dismissible',
+ message: _.escape( errorMessage )
+ } );
+
+ // Remove the lock, and clear the queue.
+ wp.updates.ajaxLocked = false;
+ wp.updates.queue = [];
+
+ // Change buttons of all running updates.
+ $( '.button.updating-message' )
+ .removeClass( 'updating-message' )
+ .removeAttr( 'aria-label' )
+ .prop( 'disabled', true )
+ .text( wp.updates.l10n.updateFailedShort );
+
+ $( '.updating-message:not(.button):not(.thickbox)' )
+ .removeClass( 'updating-message notice-warning' )
+ .addClass( 'notice-error' )
+ .find( 'p' )
+ .removeAttr( 'aria-label' )
+ .text( errorMessage );
+
+ wp.a11y.speak( errorMessage, 'assertive' );
+
+ return false;
+ };
+
+ /**
+ * Potentially adds an AYS to a user attempting to leave the page.
+ *
+ * If an update is on-going and a user attempts to leave the page,
+ * opens an "Are you sure?" alert.
+ *
+ * @since 4.2.0
+ */
+ wp.updates.beforeunload = function() {
+ if ( wp.updates.ajaxLocked ) {
+ return wp.updates.l10n.beforeunload;
+ }
+ };
+
+ $( function() {
+ var $pluginFilter = $( '#plugin-filter' ),
+ $bulkActionForm = $( '#bulk-action-form' ),
+ $filesystemForm = $( '#request-filesystem-credentials-form' ),
+ $filesystemModal = $( '#request-filesystem-credentials-dialog' ),
+ $pluginSearch = $( '.plugins-php .wp-filter-search' ),
+ $pluginInstallSearch = $( '.plugin-install-php .wp-filter-search' );
+
+ settings = _.extend( settings, window._wpUpdatesItemCounts || {} );
+
+ if ( settings.totals ) {
+ wp.updates.refreshCount();
+ }
+
+ /*
+ * Whether a user needs to submit filesystem credentials.
+ *
+ * This is based on whether the form was output on the page server-side.
+ *
+ * @see {wp_print_request_filesystem_credentials_modal() in PHP}
+ */
+ wp.updates.shouldRequestFilesystemCredentials = $filesystemModal.length > 0;
+
+ /**
+ * File system credentials form submit noop-er / handler.
+ *
+ * @since 4.2.0
+ */
+ $filesystemModal.on( 'submit', 'form', function( event ) {
+ event.preventDefault();
+
+ // Persist the credentials input by the user for the duration of the page load.
+ wp.updates.filesystemCredentials.ftp.hostname = $( '#hostname' ).val();
+ wp.updates.filesystemCredentials.ftp.username = $( '#username' ).val();
+ wp.updates.filesystemCredentials.ftp.password = $( '#password' ).val();
+ wp.updates.filesystemCredentials.ftp.connectionType = $( 'input[name="connection_type"]:checked' ).val();
+ wp.updates.filesystemCredentials.ssh.publicKey = $( '#public_key' ).val();
+ wp.updates.filesystemCredentials.ssh.privateKey = $( '#private_key' ).val();
+ wp.updates.filesystemCredentials.fsNonce = $( '#_fs_nonce' ).val();
+ wp.updates.filesystemCredentials.available = true;
+
+ // Unlock and invoke the queue.
+ wp.updates.ajaxLocked = false;
+ wp.updates.queueChecker();
+
+ wp.updates.requestForCredentialsModalClose();
+ } );
+
+ /**
+ * Closes the request credentials modal when clicking the 'Cancel' button or outside of the modal.
+ *
+ * @since 4.2.0
+ */
+ $filesystemModal.on( 'click', '[data-js-action="close"], .notification-dialog-background', wp.updates.requestForCredentialsModalCancel );
+
+ /**
+ * Hide SSH fields when not selected.
+ *
+ * @since 4.2.0
+ */
+ $filesystemForm.on( 'change', 'input[name="connection_type"]', function() {
+ $( '#ssh-keys' ).toggleClass( 'hidden', ( 'ssh' !== $( this ).val() ) );
+ } ).change();
+
+ /**
+ * Handles events after the credential modal was closed.
+ *
+ * @since 4.6.0
+ *
+ * @param {Event} event Event interface.
+ * @param {string} job The install/update.delete request.
+ */
+ $document.on( 'credential-modal-cancel', function( event, job ) {
+ var $updatingMessage = $( '.updating-message' ),
+ $message, originalText;
+
+ if ( 'import' === pagenow ) {
+ $updatingMessage.removeClass( 'updating-message' );
+ } else if ( 'plugins' === pagenow || 'plugins-network' === pagenow ) {
+ if ( 'update-plugin' === job.action ) {
+ $message = $( 'tr[data-plugin="' + job.data.plugin + '"]' ).find( '.update-message' );
+ } else if ( 'delete-plugin' === job.action ) {
+ $message = $( '[data-plugin="' + job.data.plugin + '"]' ).find( '.row-actions a.delete' );
+ }
+ } else if ( 'themes' === pagenow || 'themes-network' === pagenow ) {
+ if ( 'update-theme' === job.action ) {
+ $message = $( '[data-slug="' + job.data.slug + '"]' ).find( '.update-message' );
+ } else if ( 'delete-theme' === job.action && 'themes-network' === pagenow ) {
+ $message = $( '[data-slug="' + job.data.slug + '"]' ).find( '.row-actions a.delete' );
+ } else if ( 'delete-theme' === job.action && 'themes' === pagenow ) {
+ $message = $( '.theme-actions .delete-theme' );
+ }
+ } else {
+ $message = $updatingMessage;
+ }
+
+ if ( $message && $message.hasClass( 'updating-message' ) ) {
+ originalText = $message.data( 'originaltext' );
+
+ if ( 'undefined' === typeof originalText ) {
+ originalText = $( '<p>' ).html( $message.find( 'p' ).data( 'originaltext' ) );
+ }
+
+ $message
+ .removeClass( 'updating-message' )
+ .html( originalText );
+
+ if ( 'plugin-install' === pagenow || 'plugin-install-network' === pagenow ) {
+ if ( 'update-plugin' === job.action ) {
+ $message.attr( 'aria-label', wp.updates.l10n.pluginUpdateNowLabel.replace( '%s', $message.data( 'name' ) ) );
+ } else if ( 'install-plugin' === job.action ) {
+ $message.attr( 'aria-label', wp.updates.l10n.pluginInstallNowLabel.replace( '%s', $message.data( 'name' ) ) );
+ }
+ }
+ }
+
+ wp.a11y.speak( wp.updates.l10n.updateCancel, 'polite' );
+ } );
+
+ /**
+ * Click handler for plugin updates in List Table view.
+ *
+ * @since 4.2.0
+ *
+ * @param {Event} event Event interface.
+ */
+ $bulkActionForm.on( 'click', '[data-plugin] .update-link', function( event ) {
+ var $message = $( event.target ),
+ $pluginRow = $message.parents( 'tr' );
+
+ event.preventDefault();
+
+ if ( $message.hasClass( 'updating-message' ) || $message.hasClass( 'button-disabled' ) ) {
+ return;
+ }
+
+ wp.updates.maybeRequestFilesystemCredentials( event );
+
+ // Return the user to the input box of the plugin's table row after closing the modal.
+ wp.updates.$elToReturnFocusToFromCredentialsModal = $pluginRow.find( '.check-column input' );
+ wp.updates.updatePlugin( {
+ plugin: $pluginRow.data( 'plugin' ),
+ slug: $pluginRow.data( 'slug' )
+ } );
+ } );
+
+ /**
+ * Click handler for plugin updates in plugin install view.
+ *
+ * @since 4.2.0
+ *
+ * @param {Event} event Event interface.
+ */
+ $pluginFilter.on( 'click', '.update-now', function( event ) {
+ var $button = $( event.target );
+ event.preventDefault();
+
+ if ( $button.hasClass( 'updating-message' ) || $button.hasClass( 'button-disabled' ) ) {
+ return;
+ }
+
+ wp.updates.maybeRequestFilesystemCredentials( event );
+
+ wp.updates.updatePlugin( {
+ plugin: $button.data( 'plugin' ),
+ slug: $button.data( 'slug' )
+ } );
+ } );
+
+ /**
+ * Click handler for plugin installs in plugin install view.
+ *
+ * @since 4.6.0
+ *
+ * @param {Event} event Event interface.
+ */
+ $pluginFilter.on( 'click', '.install-now', function( event ) {
+ var $button = $( event.target );
+ event.preventDefault();
+
+ if ( $button.hasClass( 'updating-message' ) || $button.hasClass( 'button-disabled' ) ) {
+ return;
+ }
+
+ if ( wp.updates.shouldRequestFilesystemCredentials && ! wp.updates.ajaxLocked ) {
+ wp.updates.requestFilesystemCredentials( event );
+
+ $document.on( 'credential-modal-cancel', function() {
+ var $message = $( '.install-now.updating-message' );
+
+ $message
+ .removeClass( 'updating-message' )
+ .text( wp.updates.l10n.installNow );
+
+ wp.a11y.speak( wp.updates.l10n.updateCancel, 'polite' );
+ } );
+ }
+
+ wp.updates.installPlugin( {
+ slug: $button.data( 'slug' )
+ } );
+ } );
+
+ /**
+ * Click handler for importer plugins installs in the Import screen.
+ *
+ * @since 4.6.0
+ *
+ * @param {Event} event Event interface.
+ */
+ $document.on( 'click', '.importer-item .install-now', function( event ) {
+ var $button = $( event.target ),
+ pluginName = $( this ).data( 'name' );
+
+ event.preventDefault();
+
+ if ( $button.hasClass( 'updating-message' ) ) {
+ return;
+ }
+
+ if ( wp.updates.shouldRequestFilesystemCredentials && ! wp.updates.ajaxLocked ) {
+ wp.updates.requestFilesystemCredentials( event );
+
+ $document.on( 'credential-modal-cancel', function() {
+
+ $button
+ .removeClass( 'updating-message' )
+ .text( wp.updates.l10n.installNow )
+ .attr( 'aria-label', wp.updates.l10n.pluginInstallNowLabel.replace( '%s', pluginName ) );
+
+ wp.a11y.speak( wp.updates.l10n.updateCancel, 'polite' );
+ } );
+ }
+
+ wp.updates.installPlugin( {
+ slug: $button.data( 'slug' ),
+ pagenow: pagenow,
+ success: wp.updates.installImporterSuccess,
+ error: wp.updates.installImporterError
+ } );
+ } );
+
+ /**
+ * Click handler for plugin deletions.
+ *
+ * @since 4.6.0
+ *
+ * @param {Event} event Event interface.
+ */
+ $bulkActionForm.on( 'click', '[data-plugin] a.delete', function( event ) {
+ var $pluginRow = $( event.target ).parents( 'tr' );
+
+ event.preventDefault();
+
+ if ( ! window.confirm( wp.updates.l10n.aysDeleteUninstall.replace( '%s', $pluginRow.find( '.plugin-title strong' ).text() ) ) ) {
+ return;
+ }
+
+ wp.updates.maybeRequestFilesystemCredentials( event );
+
+ wp.updates.deletePlugin( {
+ plugin: $pluginRow.data( 'plugin' ),
+ slug: $pluginRow.data( 'slug' )
+ } );
+
+ } );
+
+ /**
+ * Click handler for theme updates.
+ *
+ * @since 4.6.0
+ *
+ * @param {Event} event Event interface.
+ */
+ $document.on( 'click', '.themes-php.network-admin .update-link', function( event ) {
+ var $message = $( event.target ),
+ $themeRow = $message.parents( 'tr' );
+
+ event.preventDefault();
+
+ if ( $message.hasClass( 'updating-message' ) || $message.hasClass( 'button-disabled' ) ) {
+ return;
+ }
+
+ wp.updates.maybeRequestFilesystemCredentials( event );
+
+ // Return the user to the input box of the theme's table row after closing the modal.
+ wp.updates.$elToReturnFocusToFromCredentialsModal = $themeRow.find( '.check-column input' );
+ wp.updates.updateTheme( {
+ slug: $themeRow.data( 'slug' )
+ } );
+ } );
+
+ /**
+ * Click handler for theme deletions.
+ *
+ * @since 4.6.0
+ *
+ * @param {Event} event Event interface.
+ */
+ $document.on( 'click', '.themes-php.network-admin a.delete', function( event ) {
+ var $themeRow = $( event.target ).parents( 'tr' );
+
+ event.preventDefault();
+
+ if ( ! window.confirm( wp.updates.l10n.aysDelete.replace( '%s', $themeRow.find( '.theme-title strong' ).text() ) ) ) {
+ return;
+ }
+
+ wp.updates.maybeRequestFilesystemCredentials( event );
+
+ wp.updates.deleteTheme( {
+ slug: $themeRow.data( 'slug' )
+ } );
+ } );
+
+ /**
+ * Bulk action handler for plugins and themes.
+ *
+ * Handles both deletions and updates.
+ *
+ * @since 4.6.0
+ *
+ * @param {Event} event Event interface.
+ */
+ $bulkActionForm.on( 'click', '[type="submit"]:not([name="clear-recent-list"])', function( event ) {
+ var bulkAction = $( event.target ).siblings( 'select' ).val(),
+ itemsSelected = $bulkActionForm.find( 'input[name="checked[]"]:checked' ),
+ success = 0,
+ error = 0,
+ errorMessages = [],
+ type, action;
+
+ // Determine which type of item we're dealing with.
+ switch ( pagenow ) {
+ case 'plugins':
+ case 'plugins-network':
+ type = 'plugin';
+ break;
+
+ case 'themes-network':
+ type = 'theme';
+ break;
+
+ default:
+ return;
+ }
+
+ // Bail if there were no items selected.
+ if ( ! itemsSelected.length ) {
+ event.preventDefault();
+ $( 'html, body' ).animate( { scrollTop: 0 } );
+
+ return wp.updates.addAdminNotice( {
+ id: 'no-items-selected',
+ className: 'notice-error is-dismissible',
+ message: wp.updates.l10n.noItemsSelected
+ } );
+ }
+
+ // Determine the type of request we're dealing with.
+ switch ( bulkAction ) {
+ case 'update-selected':
+ action = bulkAction.replace( 'selected', type );
+ break;
+
+ case 'delete-selected':
+ if ( ! window.confirm( 'plugin' === type ? wp.updates.l10n.aysBulkDelete : wp.updates.l10n.aysBulkDeleteThemes ) ) {
+ event.preventDefault();
+ return;
+ }
+
+ action = bulkAction.replace( 'selected', type );
+ break;
+
+ default:
+ return;
+ }
+
+ wp.updates.maybeRequestFilesystemCredentials( event );
+
+ event.preventDefault();
+
+ // Un-check the bulk checkboxes.
+ $bulkActionForm.find( '.manage-column [type="checkbox"]' ).prop( 'checked', false );
+
+ $document.trigger( 'wp-' + type + '-bulk-' + bulkAction, itemsSelected );
+
+ // Find all the checkboxes which have been checked.
+ itemsSelected.each( function( index, element ) {
+ var $checkbox = $( element ),
+ $itemRow = $checkbox.parents( 'tr' );
+
+ // Only add update-able items to the update queue.
+ if ( 'update-selected' === bulkAction && ( ! $itemRow.hasClass( 'update' ) || $itemRow.find( 'notice-error' ).length ) ) {
+
+ // Un-check the box.
+ $checkbox.prop( 'checked', false );
+ return;
+ }
+
+ // Add it to the queue.
+ wp.updates.queue.push( {
+ action: action,
+ data: {
+ plugin: $itemRow.data( 'plugin' ),
+ slug: $itemRow.data( 'slug' )
+ }
+ } );
+ } );
+
+ // Display bulk notification for updates of any kind.
+ $document.on( 'wp-plugin-update-success wp-plugin-update-error wp-theme-update-success wp-theme-update-error', function( event, response ) {
+ var $itemRow = $( '[data-slug="' + response.slug + '"]' ),
+ $bulkActionNotice, itemName;
+
+ if ( 'wp-' + response.update + '-update-success' === event.type ) {
+ success++;
+ } else {
+ itemName = response.pluginName ? response.pluginName : $itemRow.find( '.column-primary strong' ).text();
+
+ error++;
+ errorMessages.push( itemName + ': ' + response.errorMessage );
+ }
+
+ $itemRow.find( 'input[name="checked[]"]:checked' ).prop( 'checked', false );
+
+ wp.updates.adminNotice = wp.template( 'wp-bulk-updates-admin-notice' );
+
+ wp.updates.addAdminNotice( {
+ id: 'bulk-action-notice',
+ className: 'bulk-action-notice',
+ successes: success,
+ errors: error,
+ errorMessages: errorMessages,
+ type: response.update
+ } );
+
+ $bulkActionNotice = $( '#bulk-action-notice' ).on( 'click', 'button', function() {
+ // $( this ) is the clicked button, no need to get it again.
+ $( this )
+ .toggleClass( 'bulk-action-errors-collapsed' )
+ .attr( 'aria-expanded', ! $( this ).hasClass( 'bulk-action-errors-collapsed' ) );
+ // Show the errors list.
+ $bulkActionNotice.find( '.bulk-action-errors' ).toggleClass( 'hidden' );
+ } );
+
+ if ( error > 0 && ! wp.updates.queue.length ) {
+ $( 'html, body' ).animate( { scrollTop: 0 } );
+ }
+ } );
+
+ // Reset admin notice template after #bulk-action-notice was added.
+ $document.on( 'wp-updates-notice-added', function() {
+ wp.updates.adminNotice = wp.template( 'wp-updates-admin-notice' );
+ } );
+
+ // Check the queue, now that the event handlers have been added.
+ wp.updates.queueChecker();
+ } );
+
+ if ( $pluginInstallSearch.length ) {
+ $pluginInstallSearch.attr( 'aria-describedby', 'live-search-desc' );
+ }
+
+ /**
+ * Handles changes to the plugin search box on the new-plugin page,
+ * searching the repository dynamically.
+ *
+ * @since 4.6.0
+ */
+ $pluginInstallSearch.on( 'keyup input', _.debounce( function( event, eventtype ) {
+ var $searchTab = $( '.plugin-install-search' ), data, searchLocation;
+
+ data = {
+ _ajax_nonce: wp.updates.ajaxNonce,
+ s: event.target.value,
+ tab: 'search',
+ type: $( '#typeselector' ).val(),
+ pagenow: pagenow
+ };
+ searchLocation = location.href.split( '?' )[ 0 ] + '?' + $.param( _.omit( data, [ '_ajax_nonce', 'pagenow' ] ) );
+
+ // Clear on escape.
+ if ( 'keyup' === event.type && 27 === event.which ) {
+ event.target.value = '';
+ }
+
+ if ( wp.updates.searchTerm === data.s && 'typechange' !== eventtype ) {
+ return;
+ } else {
+ $pluginFilter.empty();
+ wp.updates.searchTerm = data.s;
+ }
+
+ if ( window.history && window.history.replaceState ) {
+ window.history.replaceState( null, '', searchLocation );
+ }
+
+ if ( ! $searchTab.length ) {
+ $searchTab = $( '<li class="plugin-install-search" />' )
+ .append( $( '<a />', {
+ 'class': 'current',
+ 'href': searchLocation,
+ 'text': wp.updates.l10n.searchResultsLabel
+ } ) );
+
+ $( '.wp-filter .filter-links .current' )
+ .removeClass( 'current' )
+ .parents( '.filter-links' )
+ .prepend( $searchTab );
+
+ $pluginFilter.prev( 'p' ).remove();
+ $( '.plugins-popular-tags-wrapper' ).remove();
+ }
+
+ if ( 'undefined' !== typeof wp.updates.searchRequest ) {
+ wp.updates.searchRequest.abort();
+ }
+ $( 'body' ).addClass( 'loading-content' );
+
+ wp.updates.searchRequest = wp.ajax.post( 'search-install-plugins', data ).done( function( response ) {
+ $( 'body' ).removeClass( 'loading-content' );
+ $pluginFilter.append( response.items );
+ delete wp.updates.searchRequest;
+
+ if ( 0 === response.count ) {
+ wp.a11y.speak( wp.updates.l10n.noPluginsFound );
+ } else {
+ wp.a11y.speak( wp.updates.l10n.pluginsFound.replace( '%d', response.count ) );
+ }
+ } );
+ }, 500 ) );
+
+ if ( $pluginSearch.length ) {
+ $pluginSearch.attr( 'aria-describedby', 'live-search-desc' );
+ }
+
+ /**
+ * Handles changes to the plugin search box on the Installed Plugins screen,
+ * searching the plugin list dynamically.
+ *
+ * @since 4.6.0
+ */
+ $pluginSearch.on( 'keyup input', _.debounce( function( event ) {
+ var data = {
+ _ajax_nonce: wp.updates.ajaxNonce,
+ s: event.target.value,
+ pagenow: pagenow,
+ plugin_status: 'all'
+ },
+ queryArgs;
+
+ // Clear on escape.
+ if ( 'keyup' === event.type && 27 === event.which ) {
+ event.target.value = '';
+ }
+
+ if ( wp.updates.searchTerm === data.s ) {
+ return;
+ } else {
+ wp.updates.searchTerm = data.s;
+ }
+
+ queryArgs = _.object( _.compact( _.map( location.search.slice( 1 ).split( '&' ), function( item ) {
+ if ( item ) return item.split( '=' );
+ } ) ) );
+
+ data.plugin_status = queryArgs.plugin_status || 'all';
+
+ if ( window.history && window.history.replaceState ) {
+ window.history.replaceState( null, '', location.href.split( '?' )[ 0 ] + '?s=' + data.s + '&plugin_status=' + data.plugin_status );
+ }
+
+ if ( 'undefined' !== typeof wp.updates.searchRequest ) {
+ wp.updates.searchRequest.abort();
+ }
+
+ $bulkActionForm.empty();
+ $( 'body' ).addClass( 'loading-content' );
+ $( '.subsubsub .current' ).removeClass( 'current' );
+
+ wp.updates.searchRequest = wp.ajax.post( 'search-plugins', data ).done( function( response ) {
+
+ // Can we just ditch this whole subtitle business?
+ var $subTitle = $( '<span />' ).addClass( 'subtitle' ).html( wp.updates.l10n.searchResults.replace( '%s', _.escape( data.s ) ) ),
+ $oldSubTitle = $( '.wrap .subtitle' );
+
+ if ( ! data.s.length ) {
+ $oldSubTitle.remove();
+ $( '.subsubsub .' + data.plugin_status + ' a' ).addClass( 'current' );
+ } else if ( $oldSubTitle.length ) {
+ $oldSubTitle.replaceWith( $subTitle );
+ } else {
+ $( '.wp-header-end' ).before( $subTitle );
+ }
+
+ $( 'body' ).removeClass( 'loading-content' );
+ $bulkActionForm.append( response.items );
+ delete wp.updates.searchRequest;
+
+ if ( 0 === response.count ) {
+ wp.a11y.speak( wp.updates.l10n.noPluginsFound );
+ } else {
+ wp.a11y.speak( wp.updates.l10n.pluginsFound.replace( '%d', response.count ) );
+ }
+ } );
+ }, 500 ) );
+
+ /**
+ * Trigger a search event when the search form gets submitted.
+ *
+ * @since 4.6.0
+ */
+ $document.on( 'submit', '.search-plugins', function( event ) {
+ event.preventDefault();
+
+ $( 'input.wp-filter-search' ).trigger( 'input' );
+ } );
+
+ /**
+ * Trigger a search event when the "Try Again" button is clicked.
+ *
+ * @since 4.9.0
+ */
+ $document.on( 'click', '.try-again', function( event ) {
+ event.preventDefault();
+ $pluginInstallSearch.trigger( 'input' );
+ } );
+
+ /**
+ * Trigger a search event when the search type gets changed.
+ *
+ * @since 4.6.0
+ */
+ $( '#typeselector' ).on( 'change', function() {
+ var $search = $( 'input[name="s"]' );
+
+ if ( $search.val().length ) {
+ $search.trigger( 'input', 'typechange' );
+ }
+ } );
+
+ /**
+ * Click handler for updating a plugin from the details modal on `plugin-install.php`.
+ *
+ * @since 4.2.0
+ *
+ * @param {Event} event Event interface.
+ */
+ $( '#plugin_update_from_iframe' ).on( 'click', function( event ) {
+ var target = window.parent === window ? null : window.parent,
+ update;
+
+ $.support.postMessage = !! window.postMessage;
+
+ if ( false === $.support.postMessage || null === target || -1 !== window.parent.location.pathname.indexOf( 'update-core.php' ) ) {
+ return;
+ }
+
+ event.preventDefault();
+
+ update = {
+ action: 'update-plugin',
+ data: {
+ plugin: $( this ).data( 'plugin' ),
+ slug: $( this ).data( 'slug' )
+ }
+ };
+
+ target.postMessage( JSON.stringify( update ), window.location.origin );
+ } );
+
+ /**
+ * Click handler for installing a plugin from the details modal on `plugin-install.php`.
+ *
+ * @since 4.6.0
+ *
+ * @param {Event} event Event interface.
+ */
+ $( '#plugin_install_from_iframe' ).on( 'click', function( event ) {
+ var target = window.parent === window ? null : window.parent,
+ install;
+
+ $.support.postMessage = !! window.postMessage;
+
+ if ( false === $.support.postMessage || null === target || -1 !== window.parent.location.pathname.indexOf( 'index.php' ) ) {
+ return;
+ }
+
+ event.preventDefault();
+
+ install = {
+ action: 'install-plugin',
+ data: {
+ slug: $( this ).data( 'slug' )
+ }
+ };
+
+ target.postMessage( JSON.stringify( install ), window.location.origin );
+ } );
+
+ /**
+ * Handles postMessage events.
+ *
+ * @since 4.2.0
+ * @since 4.6.0 Switched `update-plugin` action to use the queue.
+ *
+ * @param {Event} event Event interface.
+ */
+ $( window ).on( 'message', function( event ) {
+ var originalEvent = event.originalEvent,
+ expectedOrigin = document.location.protocol + '//' + document.location.hostname,
+ message;
+
+ if ( originalEvent.origin !== expectedOrigin ) {
+ return;
+ }
+
+ try {
+ message = $.parseJSON( originalEvent.data );
+ } catch ( e ) {
+ return;
+ }
+
+ if ( ! message || 'undefined' === typeof message.action ) {
+ return;
+ }
+
+ switch ( message.action ) {
+
+ // Called from `wp-admin/includes/class-wp-upgrader-skins.php`.
+ case 'decrementUpdateCount':
+ /** @property {string} message.upgradeType */
+ wp.updates.decrementCount( message.upgradeType );
+ break;
+
+ case 'install-plugin':
+ case 'update-plugin':
+ /* jscs:disable requireCamelCaseOrUpperCaseIdentifiers */
+ window.tb_remove();
+ /* jscs:enable */
+
+ message.data = wp.updates._addCallbacks( message.data, message.action );
+
+ wp.updates.queue.push( message );
+ wp.updates.queueChecker();
+ break;
+ }
+ } );
+
+ /**
+ * Adds a callback to display a warning before leaving the page.
+ *
+ * @since 4.2.0
+ */
+ $( window ).on( 'beforeunload', wp.updates.beforeunload );
+ } );
+})( jQuery, window.wp, window._wpUpdatesSettings );
diff --git a/www/crm/wp-admin/js/updates.min.js b/www/crm/wp-admin/js/updates.min.js
new file mode 100644
index 00000000..a6bb6e6b
--- /dev/null
+++ b/www/crm/wp-admin/js/updates.min.js
@@ -0,0 +1,2 @@
+!function(a,b,c){var d=a(document);b=b||{},b.updates={},b.updates.ajaxNonce=c.ajax_nonce,b.updates.l10n=c.l10n,b.updates.searchTerm="",b.updates.shouldRequestFilesystemCredentials=!1,b.updates.filesystemCredentials={ftp:{host:"",username:"",password:"",connectionType:""},ssh:{publicKey:"",privateKey:""},fsNonce:"",available:!1},b.updates.ajaxLocked=!1,b.updates.adminNotice=b.template("wp-updates-admin-notice"),b.updates.queue=[],b.updates.$elToReturnFocusToFromCredentialsModal=void 0,b.updates.addAdminNotice=function(c){var e,f=a(c.selector),g=a(".wp-header-end");delete c.selector,e=b.updates.adminNotice(c),f.length||(f=a("#"+c.id)),f.length?f.replaceWith(e):g.length?g.after(e):"customize"===pagenow?a(".customize-themes-notifications").append(e):a(".wrap").find("> h1").after(e),d.trigger("wp-updates-notice-added")},b.updates.ajax=function(c,d){var e={};return b.updates.ajaxLocked?(b.updates.queue.push({action:c,data:d}),a.Deferred()):(b.updates.ajaxLocked=!0,d.success&&(e.success=d.success,delete d.success),d.error&&(e.error=d.error,delete d.error),e.data=_.extend(d,{action:c,_ajax_nonce:b.updates.ajaxNonce,_fs_nonce:b.updates.filesystemCredentials.fsNonce,username:b.updates.filesystemCredentials.ftp.username,password:b.updates.filesystemCredentials.ftp.password,hostname:b.updates.filesystemCredentials.ftp.hostname,connection_type:b.updates.filesystemCredentials.ftp.connectionType,public_key:b.updates.filesystemCredentials.ssh.publicKey,private_key:b.updates.filesystemCredentials.ssh.privateKey}),b.ajax.send(e).always(b.updates.ajaxAlways))},b.updates.ajaxAlways=function(a){a.errorCode&&"unable_to_connect_to_filesystem"===a.errorCode||(b.updates.ajaxLocked=!1,b.updates.queueChecker()),"undefined"!=typeof a.debug&&window.console&&window.console.log&&_.map(a.debug,function(a){window.console.log(b.sanitize.stripTagsAndEncodeText(a))})},b.updates.refreshCount=function(){var b,d=a("#wp-admin-bar-updates"),e=a('a[href="update-core.php"] .update-plugins'),f=a('a[href="plugins.php"] .update-plugins'),g=a('a[href="themes.php"] .update-plugins');d.find(".ab-item").removeAttr("title"),d.find(".ab-label").text(c.totals.counts.total),0===c.totals.counts.total&&d.find(".ab-label").parents("li").remove(),e.each(function(a,b){b.className=b.className.replace(/count-\d+/,"count-"+c.totals.counts.total)}),c.totals.counts.total>0?e.find(".update-count").text(c.totals.counts.total):e.remove(),f.each(function(a,b){b.className=b.className.replace(/count-\d+/,"count-"+c.totals.counts.plugins)}),c.totals.counts.total>0?f.find(".plugin-count").text(c.totals.counts.plugins):f.remove(),g.each(function(a,b){b.className=b.className.replace(/count-\d+/,"count-"+c.totals.counts.themes)}),c.totals.counts.total>0?g.find(".theme-count").text(c.totals.counts.themes):g.remove(),"plugins"===pagenow||"plugins-network"===pagenow?b=c.totals.counts.plugins:"themes"!==pagenow&&"themes-network"!==pagenow||(b=c.totals.counts.themes),b>0?a(".subsubsub .upgrade .count").text("("+b+")"):(a(".subsubsub .upgrade").remove(),a(".subsubsub li:last").html(function(){return a(this).children()}))},b.updates.decrementCount=function(a){c.totals.counts.total=Math.max(--c.totals.counts.total,0),"plugin"===a?c.totals.counts.plugins=Math.max(--c.totals.counts.plugins,0):"theme"===a&&(c.totals.counts.themes=Math.max(--c.totals.counts.themes,0)),b.updates.refreshCount(a)},b.updates.updatePlugin=function(c){var e,f,g,h;return c=_.extend({success:b.updates.updatePluginSuccess,error:b.updates.updatePluginError},c),"plugins"===pagenow||"plugins-network"===pagenow?(e=a('tr[data-plugin="'+c.plugin+'"]'),g=e.find(".update-message").removeClass("notice-error").addClass("updating-message notice-warning").find("p"),h=b.updates.l10n.pluginUpdatingLabel.replace("%s",e.find(".plugin-title strong").text())):"plugin-install"!==pagenow&&"plugin-install-network"!==pagenow||(f=a(".plugin-card-"+c.slug),g=f.find(".update-now").addClass("updating-message"),h=b.updates.l10n.pluginUpdatingLabel.replace("%s",g.data("name")),f.removeClass("plugin-card-update-failed").find(".notice.notice-error").remove()),g.html()!==b.updates.l10n.updating&&g.data("originaltext",g.html()),g.attr("aria-label",h).text(b.updates.l10n.updating),d.trigger("wp-plugin-updating",c),b.updates.ajax("update-plugin",c)},b.updates.updatePluginSuccess=function(c){var e,f,g;"plugins"===pagenow||"plugins-network"===pagenow?(e=a('tr[data-plugin="'+c.plugin+'"]').removeClass("update").addClass("updated"),f=e.find(".update-message").removeClass("updating-message notice-warning").addClass("updated-message notice-success").find("p"),g=e.find(".plugin-version-author-uri").html().replace(c.oldVersion,c.newVersion),e.find(".plugin-version-author-uri").html(g)):"plugin-install"!==pagenow&&"plugin-install-network"!==pagenow||(f=a(".plugin-card-"+c.slug).find(".update-now").removeClass("updating-message").addClass("button-disabled updated-message")),f.attr("aria-label",b.updates.l10n.pluginUpdatedLabel.replace("%s",c.pluginName)).text(b.updates.l10n.pluginUpdated),b.a11y.speak(b.updates.l10n.updatedMsg,"polite"),b.updates.decrementCount("plugin"),d.trigger("wp-plugin-update-success",c)},b.updates.updatePluginError=function(c){var e,f,g;b.updates.isValidResponse(c,"update")&&(b.updates.maybeHandleCredentialError(c,"update-plugin")||(g=b.updates.l10n.updateFailed.replace("%s",c.errorMessage),"plugins"===pagenow||"plugins-network"===pagenow?(f=c.plugin?a('tr[data-plugin="'+c.plugin+'"]').find(".update-message"):a('tr[data-slug="'+c.slug+'"]').find(".update-message"),f.removeClass("updating-message notice-warning").addClass("notice-error").find("p").html(g),c.pluginName?f.find("p").attr("aria-label",b.updates.l10n.pluginUpdateFailedLabel.replace("%s",c.pluginName)):f.find("p").removeAttr("aria-label")):"plugin-install"!==pagenow&&"plugin-install-network"!==pagenow||(e=a(".plugin-card-"+c.slug).addClass("plugin-card-update-failed").append(b.updates.adminNotice({className:"update-message notice-error notice-alt is-dismissible",message:g})),e.find(".update-now").text(b.updates.l10n.updateFailedShort).removeClass("updating-message"),c.pluginName?e.find(".update-now").attr("aria-label",b.updates.l10n.pluginUpdateFailedLabel.replace("%s",c.pluginName)):e.find(".update-now").removeAttr("aria-label"),e.on("click",".notice.is-dismissible .notice-dismiss",function(){setTimeout(function(){e.removeClass("plugin-card-update-failed").find(".column-name a").focus(),e.find(".update-now").attr("aria-label",!1).text(b.updates.l10n.updateNow)},200)})),b.a11y.speak(g,"assertive"),d.trigger("wp-plugin-update-error",c)))},b.updates.installPlugin=function(c){var e=a(".plugin-card-"+c.slug),f=e.find(".install-now");return c=_.extend({success:b.updates.installPluginSuccess,error:b.updates.installPluginError},c),"import"===pagenow&&(f=a('[data-slug="'+c.slug+'"]')),f.html()!==b.updates.l10n.installing&&f.data("originaltext",f.html()),f.addClass("updating-message").attr("aria-label",b.updates.l10n.pluginInstallingLabel.replace("%s",f.data("name"))).text(b.updates.l10n.installing),b.a11y.speak(b.updates.l10n.installingMsg,"polite"),e.removeClass("plugin-card-install-failed").find(".notice.notice-error").remove(),d.trigger("wp-plugin-installing",c),b.updates.ajax("install-plugin",c)},b.updates.installPluginSuccess=function(c){var e=a(".plugin-card-"+c.slug).find(".install-now");e.removeClass("updating-message").addClass("updated-message installed button-disabled").attr("aria-label",b.updates.l10n.pluginInstalledLabel.replace("%s",c.pluginName)).text(b.updates.l10n.pluginInstalled),b.a11y.speak(b.updates.l10n.installedMsg,"polite"),d.trigger("wp-plugin-install-success",c),c.activateUrl&&setTimeout(function(){e.removeClass("install-now installed button-disabled updated-message").addClass("activate-now button-primary").attr("href",c.activateUrl).attr("aria-label",b.updates.l10n.activatePluginLabel.replace("%s",c.pluginName)).text(b.updates.l10n.activatePlugin)},1e3)},b.updates.installPluginError=function(c){var e,f=a(".plugin-card-"+c.slug),g=f.find(".install-now");b.updates.isValidResponse(c,"install")&&(b.updates.maybeHandleCredentialError(c,"install-plugin")||(e=b.updates.l10n.installFailed.replace("%s",c.errorMessage),f.addClass("plugin-card-update-failed").append('<div class="notice notice-error notice-alt is-dismissible"><p>'+e+"</p></div>"),f.on("click",".notice.is-dismissible .notice-dismiss",function(){setTimeout(function(){f.removeClass("plugin-card-update-failed").find(".column-name a").focus()},200)}),g.removeClass("updating-message").addClass("button-disabled").attr("aria-label",b.updates.l10n.pluginInstallFailedLabel.replace("%s",g.data("name"))).text(b.updates.l10n.installFailedShort),b.a11y.speak(e,"assertive"),d.trigger("wp-plugin-install-error",c)))},b.updates.installImporterSuccess=function(c){b.updates.addAdminNotice({id:"install-success",className:"notice-success is-dismissible",message:b.updates.l10n.importerInstalledMsg.replace("%s",c.activateUrl+"&from=import")}),a('[data-slug="'+c.slug+'"]').removeClass("install-now updating-message").addClass("activate-now").attr({href:c.activateUrl+"&from=import","aria-label":b.updates.l10n.activateImporterLabel.replace("%s",c.pluginName)}).text(b.updates.l10n.activateImporter),b.a11y.speak(b.updates.l10n.installedMsg,"polite"),d.trigger("wp-importer-install-success",c)},b.updates.installImporterError=function(c){var e=b.updates.l10n.installFailed.replace("%s",c.errorMessage),f=a('[data-slug="'+c.slug+'"]'),g=f.data("name");b.updates.isValidResponse(c,"install")&&(b.updates.maybeHandleCredentialError(c,"install-plugin")||(b.updates.addAdminNotice({id:c.errorCode,className:"notice-error is-dismissible",message:e}),f.removeClass("updating-message").text(b.updates.l10n.installNow).attr("aria-label",b.updates.l10n.pluginInstallNowLabel.replace("%s",g)),b.a11y.speak(e,"assertive"),d.trigger("wp-importer-install-error",c)))},b.updates.deletePlugin=function(c){var e=a('[data-plugin="'+c.plugin+'"]').find(".row-actions a.delete");return c=_.extend({success:b.updates.deletePluginSuccess,error:b.updates.deletePluginError},c),e.html()!==b.updates.l10n.deleting&&e.data("originaltext",e.html()).text(b.updates.l10n.deleting),b.a11y.speak(b.updates.l10n.deleting,"polite"),d.trigger("wp-plugin-deleting",c),b.updates.ajax("delete-plugin",c)},b.updates.deletePluginSuccess=function(e){a('[data-plugin="'+e.plugin+'"]').css({backgroundColor:"#faafaa"}).fadeOut(350,function(){var d=a("#bulk-action-form"),f=a(".subsubsub"),g=a(this),h=d.find("thead th:not(.hidden), thead td").length,i=b.template("item-deleted-row"),j=c.plugins;g.hasClass("plugin-update-tr")||g.after(i({slug:e.slug,plugin:e.plugin,colspan:h,name:e.pluginName})),g.remove(),-1!==_.indexOf(j.upgrade,e.plugin)&&(j.upgrade=_.without(j.upgrade,e.plugin),b.updates.decrementCount("plugin")),-1!==_.indexOf(j.inactive,e.plugin)&&(j.inactive=_.without(j.inactive,e.plugin),j.inactive.length?f.find(".inactive .count").text("("+j.inactive.length+")"):f.find(".inactive").remove()),-1!==_.indexOf(j.active,e.plugin)&&(j.active=_.without(j.active,e.plugin),j.active.length?f.find(".active .count").text("("+j.active.length+")"):f.find(".active").remove()),-1!==_.indexOf(j.recently_activated,e.plugin)&&(j.recently_activated=_.without(j.recently_activated,e.plugin),j.recently_activated.length?f.find(".recently_activated .count").text("("+j.recently_activated.length+")"):f.find(".recently_activated").remove()),j.all=_.without(j.all,e.plugin),j.all.length?f.find(".all .count").text("("+j.all.length+")"):(d.find(".tablenav").css({visibility:"hidden"}),f.find(".all").remove(),d.find("tr.no-items").length||d.find("#the-list").append('<tr class="no-items"><td class="colspanchange" colspan="'+h+'">'+b.updates.l10n.noPlugins+"</td></tr>"))}),b.a11y.speak(b.updates.l10n.pluginDeleted,"polite"),d.trigger("wp-plugin-delete-success",e)},b.updates.deletePluginError=function(c){var e,f,g=b.template("item-update-row"),h=b.updates.adminNotice({className:"update-message notice-error notice-alt",message:c.errorMessage});c.plugin?(e=a('tr.inactive[data-plugin="'+c.plugin+'"]'),f=e.siblings('[data-plugin="'+c.plugin+'"]')):(e=a('tr.inactive[data-slug="'+c.slug+'"]'),f=e.siblings('[data-slug="'+c.slug+'"]')),b.updates.isValidResponse(c,"delete")&&(b.updates.maybeHandleCredentialError(c,"delete-plugin")||(f.length?(f.find(".notice-error").remove(),f.find(".plugin-update").append(h)):e.addClass("update").after(g({slug:c.slug,plugin:c.plugin||c.slug,colspan:a("#bulk-action-form").find("thead th:not(.hidden), thead td").length,content:h})),d.trigger("wp-plugin-delete-error",c)))},b.updates.updateTheme=function(c){var e;return c=_.extend({success:b.updates.updateThemeSuccess,error:b.updates.updateThemeError},c),"themes-network"===pagenow?e=a('[data-slug="'+c.slug+'"]').find(".update-message").removeClass("notice-error").addClass("updating-message notice-warning").find("p"):"customize"===pagenow?(e=a('[data-slug="'+c.slug+'"].notice').removeClass("notice-large"),e.find("h3").remove(),e=e.add(a("#customize-control-installed_theme_"+c.slug).find(".update-message")),e=e.addClass("updating-message").find("p")):(e=a("#update-theme").closest(".notice").removeClass("notice-large"),e.find("h3").remove(),e=e.add(a('[data-slug="'+c.slug+'"]').find(".update-message")),e=e.addClass("updating-message").find("p")),e.html()!==b.updates.l10n.updating&&e.data("originaltext",e.html()),b.a11y.speak(b.updates.l10n.updatingMsg,"polite"),e.text(b.updates.l10n.updating),d.trigger("wp-theme-updating",c),b.updates.ajax("update-theme",c)},b.updates.updateThemeSuccess=function(c){var e,f,g=a("body.modal-open").length,h=a('[data-slug="'+c.slug+'"]'),i={className:"updated-message notice-success notice-alt",message:b.updates.l10n.themeUpdated};"customize"===pagenow?(h=a(".updating-message").siblings(".theme-name"),h.length&&(f=h.html().replace(c.oldVersion,c.newVersion),h.html(f)),e=a(".theme-info .notice").add(b.customize.control("installed_theme_"+c.slug).container.find(".theme").find(".update-message"))):"themes-network"===pagenow?(e=h.find(".update-message"),f=h.find(".theme-version-author-uri").html().replace(c.oldVersion,c.newVersion),h.find(".theme-version-author-uri").html(f)):(e=a(".theme-info .notice").add(h.find(".update-message")),g?a(".load-customize:visible").focus():h.find(".load-customize").focus()),b.updates.addAdminNotice(_.extend({selector:e},i)),b.a11y.speak(b.updates.l10n.updatedMsg,"polite"),b.updates.decrementCount("theme"),d.trigger("wp-theme-update-success",c),g&&"customize"!==pagenow&&a(".theme-info .theme-author").after(b.updates.adminNotice(i))},b.updates.updateThemeError=function(c){var e,f=a('[data-slug="'+c.slug+'"]'),g=b.updates.l10n.updateFailed.replace("%s",c.errorMessage);b.updates.isValidResponse(c,"update")&&(b.updates.maybeHandleCredentialError(c,"update-theme")||("customize"===pagenow&&(f=b.customize.control("installed_theme_"+c.slug).container.find(".theme")),"themes-network"===pagenow?e=f.find(".update-message "):(e=a(".theme-info .notice").add(f.find(".notice")),a("body.modal-open").length?a(".load-customize:visible").focus():f.find(".load-customize").focus()),b.updates.addAdminNotice({selector:e,className:"update-message notice-error notice-alt is-dismissible",message:g}),b.a11y.speak(g,"polite"),d.trigger("wp-theme-update-error",c)))},b.updates.installTheme=function(c){var e=a('.theme-install[data-slug="'+c.slug+'"]');return c=_.extend({success:b.updates.installThemeSuccess,error:b.updates.installThemeError},c),e.addClass("updating-message"),e.parents(".theme").addClass("focus"),e.html()!==b.updates.l10n.installing&&e.data("originaltext",e.html()),e.text(b.updates.l10n.installing).attr("aria-label",b.updates.l10n.themeInstallingLabel.replace("%s",e.data("name"))),b.a11y.speak(b.updates.l10n.installingMsg,"polite"),a('.install-theme-info, [data-slug="'+c.slug+'"]').removeClass("theme-install-failed").find(".notice.notice-error").remove(),d.trigger("wp-theme-installing",c),b.updates.ajax("install-theme",c)},b.updates.installThemeSuccess=function(c){var e,f=a(".wp-full-overlay-header, [data-slug="+c.slug+"]");d.trigger("wp-theme-install-success",c),e=f.find(".button-primary").removeClass("updating-message").addClass("updated-message disabled").attr("aria-label",b.updates.l10n.themeInstalledLabel.replace("%s",c.themeName)).text(b.updates.l10n.themeInstalled),b.a11y.speak(b.updates.l10n.installedMsg,"polite"),setTimeout(function(){c.activateUrl&&e.attr("href",c.activateUrl).removeClass("theme-install updated-message disabled").addClass("activate").attr("aria-label",b.updates.l10n.activateThemeLabel.replace("%s",c.themeName)).text(b.updates.l10n.activateTheme),c.customizeUrl&&e.siblings(".preview").replaceWith(function(){return a("<a>").attr("href",c.customizeUrl).addClass("button load-customize").text(b.updates.l10n.livePreview)})},1e3)},b.updates.installThemeError=function(c){var e,f,g=b.updates.l10n.installFailed.replace("%s",c.errorMessage),h=b.updates.adminNotice({className:"update-message notice-error notice-alt",message:g});b.updates.isValidResponse(c,"install")&&(b.updates.maybeHandleCredentialError(c,"install-theme")||("customize"===pagenow?(d.find("body").hasClass("modal-open")?(f=a('.theme-install[data-slug="'+c.slug+'"]'),e=a(".theme-overlay .theme-info").prepend(h)):(f=a('.theme-install[data-slug="'+c.slug+'"]'),e=f.closest(".theme").addClass("theme-install-failed").append(h)),b.customize.notifications.remove("theme_installing")):d.find("body").hasClass("full-overlay-active")?(f=a('.theme-install[data-slug="'+c.slug+'"]'),e=a(".install-theme-info").prepend(h)):(e=a('[data-slug="'+c.slug+'"]').removeClass("focus").addClass("theme-install-failed").append(h),f=e.find(".theme-install")),f.removeClass("updating-message").attr("aria-label",b.updates.l10n.themeInstallFailedLabel.replace("%s",f.data("name"))).text(b.updates.l10n.installFailedShort),b.a11y.speak(g,"assertive"),d.trigger("wp-theme-install-error",c)))},b.updates.deleteTheme=function(c){var e;return"themes"===pagenow?e=a(".theme-actions .delete-theme"):"themes-network"===pagenow&&(e=a('[data-slug="'+c.slug+'"]').find(".row-actions a.delete")),c=_.extend({success:b.updates.deleteThemeSuccess,error:b.updates.deleteThemeError},c),e&&e.html()!==b.updates.l10n.deleting&&e.data("originaltext",e.html()).text(b.updates.l10n.deleting),b.a11y.speak(b.updates.l10n.deleting,"polite"),a(".theme-info .update-message").remove(),d.trigger("wp-theme-deleting",c),b.updates.ajax("delete-theme",c)},b.updates.deleteThemeSuccess=function(e){var f=a('[data-slug="'+e.slug+'"]');"themes-network"===pagenow&&f.css({backgroundColor:"#faafaa"}).fadeOut(350,function(){var d=a(".subsubsub"),f=a(this),g=c.themes,h=b.template("item-deleted-row");f.hasClass("plugin-update-tr")||f.after(h({slug:e.slug,colspan:a("#bulk-action-form").find("thead th:not(.hidden), thead td").length,name:f.find(".theme-title strong").text()})),f.remove(),f.hasClass("update")&&(g.upgrade--,b.updates.decrementCount("theme")),f.hasClass("inactive")&&(g.disabled--,g.disabled?d.find(".disabled .count").text("("+g.disabled+")"):d.find(".disabled").remove()),d.find(".all .count").text("("+--g.all+")")}),b.a11y.speak(b.updates.l10n.themeDeleted,"polite"),d.trigger("wp-theme-delete-success",e)},b.updates.deleteThemeError=function(c){var e=a('tr.inactive[data-slug="'+c.slug+'"]'),f=a(".theme-actions .delete-theme"),g=b.template("item-update-row"),h=e.siblings("#"+c.slug+"-update"),i=b.updates.l10n.deleteFailed.replace("%s",c.errorMessage),j=b.updates.adminNotice({className:"update-message notice-error notice-alt",message:i});b.updates.maybeHandleCredentialError(c,"delete-theme")||("themes-network"===pagenow?h.length?(h.find(".notice-error").remove(),h.find(".plugin-update").append(j)):e.addClass("update").after(g({slug:c.slug,colspan:a("#bulk-action-form").find("thead th:not(.hidden), thead td").length,content:j})):a(".theme-info .theme-description").before(j),f.html(f.data("originaltext")),b.a11y.speak(i,"assertive"),d.trigger("wp-theme-delete-error",c))},b.updates._addCallbacks=function(a,c){return"import"===pagenow&&"install-plugin"===c&&(a.success=b.updates.installImporterSuccess,a.error=b.updates.installImporterError),a},b.updates.queueChecker=function(){var a;if(!b.updates.ajaxLocked&&b.updates.queue.length)switch(a=b.updates.queue.shift(),a.action){case"install-plugin":b.updates.installPlugin(a.data);break;case"update-plugin":b.updates.updatePlugin(a.data);break;case"delete-plugin":b.updates.deletePlugin(a.data);break;case"install-theme":b.updates.installTheme(a.data);break;case"update-theme":b.updates.updateTheme(a.data);break;case"delete-theme":b.updates.deleteTheme(a.data)}},b.updates.requestFilesystemCredentials=function(c){!1===b.updates.filesystemCredentials.available&&(c&&!b.updates.$elToReturnFocusToFromCredentialsModal&&(b.updates.$elToReturnFocusToFromCredentialsModal=a(c.target)),b.updates.ajaxLocked=!0,b.updates.requestForCredentialsModalOpen())},b.updates.maybeRequestFilesystemCredentials=function(a){b.updates.shouldRequestFilesystemCredentials&&!b.updates.ajaxLocked&&b.updates.requestFilesystemCredentials(a)},b.updates.keydown=function(c){27===c.keyCode?b.updates.requestForCredentialsModalCancel():9===c.keyCode&&("upgrade"!==c.target.id||c.shiftKey?"hostname"===c.target.id&&c.shiftKey&&(a("#upgrade").focus(),c.preventDefault()):(a("#hostname").focus(),c.preventDefault()))},b.updates.requestForCredentialsModalOpen=function(){var c=a("#request-filesystem-credentials-dialog");a("body").addClass("modal-open"),c.show(),c.find("input:enabled:first").focus(),c.on("keydown",b.updates.keydown)},b.updates.requestForCredentialsModalClose=function(){a("#request-filesystem-credentials-dialog").hide(),a("body").removeClass("modal-open"),b.updates.$elToReturnFocusToFromCredentialsModal&&b.updates.$elToReturnFocusToFromCredentialsModal.focus()},b.updates.requestForCredentialsModalCancel=function(){(b.updates.ajaxLocked||b.updates.queue.length)&&(_.each(b.updates.queue,function(a){d.trigger("credential-modal-cancel",a)}),b.updates.ajaxLocked=!1,b.updates.queue=[],b.updates.requestForCredentialsModalClose())},b.updates.showErrorInCredentialsForm=function(b){var c=a("#request-filesystem-credentials-form");c.find(".notice").remove(),c.find("#request-filesystem-credentials-title").after('<div class="notice notice-alt notice-error"><p>'+b+"</p></div>")},b.updates.credentialError=function(a,c){a=b.updates._addCallbacks(a,c),b.updates.queue.unshift({action:c,data:a}),b.updates.filesystemCredentials.available=!1,b.updates.showErrorInCredentialsForm(a.errorMessage),b.updates.requestFilesystemCredentials()},b.updates.maybeHandleCredentialError=function(a,c){return!(!b.updates.shouldRequestFilesystemCredentials||!a.errorCode||"unable_to_connect_to_filesystem"!==a.errorCode)&&(b.updates.credentialError(a,c),!0)},b.updates.isValidResponse=function(c,d){var e,f=b.updates.l10n.unknownError;if(_.isObject(c)&&!_.isFunction(c.always))return!0;switch(_.isString(c)&&"-1"===c?f=b.updates.l10n.nonceError:_.isString(c)?f=c:"undefined"!=typeof c.readyState&&0===c.readyState?f=b.updates.l10n.connectionError:_.isString(c.responseText)&&""!==c.responseText?f=c.responseText:_.isString(c.statusText)&&(f=c.statusText),d){case"update":e=b.updates.l10n.updateFailed;break;case"install":e=b.updates.l10n.installFailed;break;case"delete":e=b.updates.l10n.deleteFailed}return f=f.replace(/<[\/a-z][^<>]*>/gi,""),e=e.replace("%s",f),b.updates.addAdminNotice({id:"unknown_error",className:"notice-error is-dismissible",message:_.escape(e)}),b.updates.ajaxLocked=!1,b.updates.queue=[],a(".button.updating-message").removeClass("updating-message").removeAttr("aria-label").prop("disabled",!0).text(b.updates.l10n.updateFailedShort),a(".updating-message:not(.button):not(.thickbox)").removeClass("updating-message notice-warning").addClass("notice-error").find("p").removeAttr("aria-label").text(e),b.a11y.speak(e,"assertive"),!1},b.updates.beforeunload=function(){if(b.updates.ajaxLocked)return b.updates.l10n.beforeunload},a(function(){var e=a("#plugin-filter"),f=a("#bulk-action-form"),g=a("#request-filesystem-credentials-form"),h=a("#request-filesystem-credentials-dialog"),i=a(".plugins-php .wp-filter-search"),j=a(".plugin-install-php .wp-filter-search");c=_.extend(c,window._wpUpdatesItemCounts||{}),c.totals&&b.updates.refreshCount(),b.updates.shouldRequestFilesystemCredentials=h.length>0,h.on("submit","form",function(c){c.preventDefault(),b.updates.filesystemCredentials.ftp.hostname=a("#hostname").val(),b.updates.filesystemCredentials.ftp.username=a("#username").val(),b.updates.filesystemCredentials.ftp.password=a("#password").val(),b.updates.filesystemCredentials.ftp.connectionType=a('input[name="connection_type"]:checked').val(),b.updates.filesystemCredentials.ssh.publicKey=a("#public_key").val(),b.updates.filesystemCredentials.ssh.privateKey=a("#private_key").val(),b.updates.filesystemCredentials.fsNonce=a("#_fs_nonce").val(),b.updates.filesystemCredentials.available=!0,b.updates.ajaxLocked=!1,b.updates.queueChecker(),b.updates.requestForCredentialsModalClose()}),h.on("click",'[data-js-action="close"], .notification-dialog-background',b.updates.requestForCredentialsModalCancel),g.on("change",'input[name="connection_type"]',function(){a("#ssh-keys").toggleClass("hidden","ssh"!==a(this).val())}).change(),d.on("credential-modal-cancel",function(c,d){var e,f,g=a(".updating-message");"import"===pagenow?g.removeClass("updating-message"):"plugins"===pagenow||"plugins-network"===pagenow?"update-plugin"===d.action?e=a('tr[data-plugin="'+d.data.plugin+'"]').find(".update-message"):"delete-plugin"===d.action&&(e=a('[data-plugin="'+d.data.plugin+'"]').find(".row-actions a.delete")):"themes"===pagenow||"themes-network"===pagenow?"update-theme"===d.action?e=a('[data-slug="'+d.data.slug+'"]').find(".update-message"):"delete-theme"===d.action&&"themes-network"===pagenow?e=a('[data-slug="'+d.data.slug+'"]').find(".row-actions a.delete"):"delete-theme"===d.action&&"themes"===pagenow&&(e=a(".theme-actions .delete-theme")):e=g,e&&e.hasClass("updating-message")&&(f=e.data("originaltext"),"undefined"==typeof f&&(f=a("<p>").html(e.find("p").data("originaltext"))),e.removeClass("updating-message").html(f),"plugin-install"!==pagenow&&"plugin-install-network"!==pagenow||("update-plugin"===d.action?e.attr("aria-label",b.updates.l10n.pluginUpdateNowLabel.replace("%s",e.data("name"))):"install-plugin"===d.action&&e.attr("aria-label",b.updates.l10n.pluginInstallNowLabel.replace("%s",e.data("name"))))),b.a11y.speak(b.updates.l10n.updateCancel,"polite")}),f.on("click","[data-plugin] .update-link",function(c){var d=a(c.target),e=d.parents("tr");c.preventDefault(),d.hasClass("updating-message")||d.hasClass("button-disabled")||(b.updates.maybeRequestFilesystemCredentials(c),b.updates.$elToReturnFocusToFromCredentialsModal=e.find(".check-column input"),b.updates.updatePlugin({plugin:e.data("plugin"),slug:e.data("slug")}))}),e.on("click",".update-now",function(c){var d=a(c.target);c.preventDefault(),d.hasClass("updating-message")||d.hasClass("button-disabled")||(b.updates.maybeRequestFilesystemCredentials(c),b.updates.updatePlugin({plugin:d.data("plugin"),slug:d.data("slug")}))}),e.on("click",".install-now",function(c){var e=a(c.target);c.preventDefault(),e.hasClass("updating-message")||e.hasClass("button-disabled")||(b.updates.shouldRequestFilesystemCredentials&&!b.updates.ajaxLocked&&(b.updates.requestFilesystemCredentials(c),d.on("credential-modal-cancel",function(){var c=a(".install-now.updating-message");c.removeClass("updating-message").text(b.updates.l10n.installNow),b.a11y.speak(b.updates.l10n.updateCancel,"polite")})),b.updates.installPlugin({slug:e.data("slug")}))}),d.on("click",".importer-item .install-now",function(c){var e=a(c.target),f=a(this).data("name");c.preventDefault(),e.hasClass("updating-message")||(b.updates.shouldRequestFilesystemCredentials&&!b.updates.ajaxLocked&&(b.updates.requestFilesystemCredentials(c),d.on("credential-modal-cancel",function(){e.removeClass("updating-message").text(b.updates.l10n.installNow).attr("aria-label",b.updates.l10n.pluginInstallNowLabel.replace("%s",f)),b.a11y.speak(b.updates.l10n.updateCancel,"polite")})),b.updates.installPlugin({slug:e.data("slug"),pagenow:pagenow,success:b.updates.installImporterSuccess,error:b.updates.installImporterError}))}),f.on("click","[data-plugin] a.delete",function(c){var d=a(c.target).parents("tr");c.preventDefault(),window.confirm(b.updates.l10n.aysDeleteUninstall.replace("%s",d.find(".plugin-title strong").text()))&&(b.updates.maybeRequestFilesystemCredentials(c),b.updates.deletePlugin({plugin:d.data("plugin"),slug:d.data("slug")}))}),d.on("click",".themes-php.network-admin .update-link",function(c){var d=a(c.target),e=d.parents("tr");c.preventDefault(),d.hasClass("updating-message")||d.hasClass("button-disabled")||(b.updates.maybeRequestFilesystemCredentials(c),b.updates.$elToReturnFocusToFromCredentialsModal=e.find(".check-column input"),b.updates.updateTheme({slug:e.data("slug")}))}),d.on("click",".themes-php.network-admin a.delete",function(c){var d=a(c.target).parents("tr");c.preventDefault(),window.confirm(b.updates.l10n.aysDelete.replace("%s",d.find(".theme-title strong").text()))&&(b.updates.maybeRequestFilesystemCredentials(c),b.updates.deleteTheme({slug:d.data("slug")}))}),f.on("click",'[type="submit"]:not([name="clear-recent-list"])',function(c){var e,g,h=a(c.target).siblings("select").val(),i=f.find('input[name="checked[]"]:checked'),j=0,k=0,l=[];switch(pagenow){case"plugins":case"plugins-network":e="plugin";break;case"themes-network":e="theme";break;default:return}if(!i.length)return c.preventDefault(),a("html, body").animate({scrollTop:0}),b.updates.addAdminNotice({id:"no-items-selected",className:"notice-error is-dismissible",message:b.updates.l10n.noItemsSelected});switch(h){case"update-selected":g=h.replace("selected",e);break;case"delete-selected":if(!window.confirm("plugin"===e?b.updates.l10n.aysBulkDelete:b.updates.l10n.aysBulkDeleteThemes))return void c.preventDefault();g=h.replace("selected",e);break;default:return}b.updates.maybeRequestFilesystemCredentials(c),c.preventDefault(),f.find('.manage-column [type="checkbox"]').prop("checked",!1),d.trigger("wp-"+e+"-bulk-"+h,i),i.each(function(c,d){var e=a(d),f=e.parents("tr");return"update-selected"!==h||f.hasClass("update")&&!f.find("notice-error").length?void b.updates.queue.push({action:g,data:{plugin:f.data("plugin"),slug:f.data("slug")}}):void e.prop("checked",!1)}),d.on("wp-plugin-update-success wp-plugin-update-error wp-theme-update-success wp-theme-update-error",function(c,d){var e,f,g=a('[data-slug="'+d.slug+'"]');"wp-"+d.update+"-update-success"===c.type?j++:(f=d.pluginName?d.pluginName:g.find(".column-primary strong").text(),k++,l.push(f+": "+d.errorMessage)),g.find('input[name="checked[]"]:checked').prop("checked",!1),b.updates.adminNotice=b.template("wp-bulk-updates-admin-notice"),b.updates.addAdminNotice({id:"bulk-action-notice",className:"bulk-action-notice",successes:j,errors:k,errorMessages:l,type:d.update}),e=a("#bulk-action-notice").on("click","button",function(){a(this).toggleClass("bulk-action-errors-collapsed").attr("aria-expanded",!a(this).hasClass("bulk-action-errors-collapsed")),e.find(".bulk-action-errors").toggleClass("hidden")}),k>0&&!b.updates.queue.length&&a("html, body").animate({scrollTop:0})}),d.on("wp-updates-notice-added",function(){b.updates.adminNotice=b.template("wp-updates-admin-notice")}),b.updates.queueChecker()}),j.length&&j.attr("aria-describedby","live-search-desc"),j.on("keyup input",_.debounce(function(c,d){var f,g,h=a(".plugin-install-search");f={_ajax_nonce:b.updates.ajaxNonce,s:c.target.value,tab:"search",type:a("#typeselector").val(),pagenow:pagenow},g=location.href.split("?")[0]+"?"+a.param(_.omit(f,["_ajax_nonce","pagenow"])),"keyup"===c.type&&27===c.which&&(c.target.value=""),b.updates.searchTerm===f.s&&"typechange"!==d||(e.empty(),b.updates.searchTerm=f.s,
+window.history&&window.history.replaceState&&window.history.replaceState(null,"",g),h.length||(h=a('<li class="plugin-install-search" />').append(a("<a />",{"class":"current",href:g,text:b.updates.l10n.searchResultsLabel})),a(".wp-filter .filter-links .current").removeClass("current").parents(".filter-links").prepend(h),e.prev("p").remove(),a(".plugins-popular-tags-wrapper").remove()),"undefined"!=typeof b.updates.searchRequest&&b.updates.searchRequest.abort(),a("body").addClass("loading-content"),b.updates.searchRequest=b.ajax.post("search-install-plugins",f).done(function(c){a("body").removeClass("loading-content"),e.append(c.items),delete b.updates.searchRequest,0===c.count?b.a11y.speak(b.updates.l10n.noPluginsFound):b.a11y.speak(b.updates.l10n.pluginsFound.replace("%d",c.count))}))},500)),i.length&&i.attr("aria-describedby","live-search-desc"),i.on("keyup input",_.debounce(function(c){var d,e={_ajax_nonce:b.updates.ajaxNonce,s:c.target.value,pagenow:pagenow,plugin_status:"all"};"keyup"===c.type&&27===c.which&&(c.target.value=""),b.updates.searchTerm!==e.s&&(b.updates.searchTerm=e.s,d=_.object(_.compact(_.map(location.search.slice(1).split("&"),function(a){if(a)return a.split("=")}))),e.plugin_status=d.plugin_status||"all",window.history&&window.history.replaceState&&window.history.replaceState(null,"",location.href.split("?")[0]+"?s="+e.s+"&plugin_status="+e.plugin_status),"undefined"!=typeof b.updates.searchRequest&&b.updates.searchRequest.abort(),f.empty(),a("body").addClass("loading-content"),a(".subsubsub .current").removeClass("current"),b.updates.searchRequest=b.ajax.post("search-plugins",e).done(function(c){var d=a("<span />").addClass("subtitle").html(b.updates.l10n.searchResults.replace("%s",_.escape(e.s))),g=a(".wrap .subtitle");e.s.length?g.length?g.replaceWith(d):a(".wp-header-end").before(d):(g.remove(),a(".subsubsub ."+e.plugin_status+" a").addClass("current")),a("body").removeClass("loading-content"),f.append(c.items),delete b.updates.searchRequest,0===c.count?b.a11y.speak(b.updates.l10n.noPluginsFound):b.a11y.speak(b.updates.l10n.pluginsFound.replace("%d",c.count))}))},500)),d.on("submit",".search-plugins",function(b){b.preventDefault(),a("input.wp-filter-search").trigger("input")}),d.on("click",".try-again",function(a){a.preventDefault(),j.trigger("input")}),a("#typeselector").on("change",function(){var b=a('input[name="s"]');b.val().length&&b.trigger("input","typechange")}),a("#plugin_update_from_iframe").on("click",function(b){var c,d=window.parent===window?null:window.parent;a.support.postMessage=!!window.postMessage,!1!==a.support.postMessage&&null!==d&&-1===window.parent.location.pathname.indexOf("update-core.php")&&(b.preventDefault(),c={action:"update-plugin",data:{plugin:a(this).data("plugin"),slug:a(this).data("slug")}},d.postMessage(JSON.stringify(c),window.location.origin))}),a("#plugin_install_from_iframe").on("click",function(b){var c,d=window.parent===window?null:window.parent;a.support.postMessage=!!window.postMessage,!1!==a.support.postMessage&&null!==d&&-1===window.parent.location.pathname.indexOf("index.php")&&(b.preventDefault(),c={action:"install-plugin",data:{slug:a(this).data("slug")}},d.postMessage(JSON.stringify(c),window.location.origin))}),a(window).on("message",function(c){var d,e=c.originalEvent,f=document.location.protocol+"//"+document.location.hostname;if(e.origin===f){try{d=a.parseJSON(e.data)}catch(g){return}if(d&&"undefined"!=typeof d.action)switch(d.action){case"decrementUpdateCount":b.updates.decrementCount(d.upgradeType);break;case"install-plugin":case"update-plugin":window.tb_remove(),d.data=b.updates._addCallbacks(d.data,d.action),b.updates.queue.push(d),b.updates.queueChecker()}}}),a(window).on("beforeunload",b.updates.beforeunload)})}(jQuery,window.wp,window._wpUpdatesSettings); \ No newline at end of file
diff --git a/www/crm/wp-admin/js/user-profile.js b/www/crm/wp-admin/js/user-profile.js
new file mode 100644
index 00000000..386f8ae5
--- /dev/null
+++ b/www/crm/wp-admin/js/user-profile.js
@@ -0,0 +1,462 @@
+/**
+ * @output wp-admin/js/user-profile.js
+ */
+
+/* global ajaxurl, pwsL10n, userProfileL10n */
+(function($) {
+ var updateLock = false,
+
+ $pass1Row,
+ $pass1Wrap,
+ $pass1,
+ $pass1Text,
+ $pass1Label,
+ $pass2,
+ $weakRow,
+ $weakCheckbox,
+ $toggleButton,
+ $submitButtons,
+ $submitButton,
+ currentPass;
+
+ function generatePassword() {
+ if ( typeof zxcvbn !== 'function' ) {
+ setTimeout( generatePassword, 50 );
+ return;
+ } else if ( ! $pass1.val() ) {
+ // zxcvbn loaded before user entered password.
+ $pass1.val( $pass1.data( 'pw' ) );
+ $pass1.trigger( 'pwupdate' );
+ showOrHideWeakPasswordCheckbox();
+ }
+ else {
+ // zxcvbn loaded after the user entered password, check strength.
+ check_pass_strength();
+ showOrHideWeakPasswordCheckbox();
+ }
+
+ if ( 1 !== parseInt( $toggleButton.data( 'start-masked' ), 10 ) ) {
+ $pass1Wrap.addClass( 'show-password' );
+ } else {
+ $toggleButton.trigger( 'click' );
+ }
+
+ // Once zxcvbn loads, passwords strength is known.
+ $( '#pw-weak-text-label' ).html( userProfileL10n.warnWeak );
+ }
+
+ function bindPass1() {
+ currentPass = $pass1.val();
+
+ $pass1Wrap = $pass1.parent();
+
+ $pass1Text = $( '<input type="text"/>' )
+ .attr( {
+ 'id': 'pass1-text',
+ 'name': 'pass1-text',
+ 'autocomplete': 'off'
+ } )
+ .addClass( $pass1[0].className )
+ .data( 'pw', $pass1.data( 'pw' ) )
+ .val( $pass1.val() )
+ .on( 'input', function () {
+ if ( $pass1Text.val() === currentPass ) {
+ return;
+ }
+ $pass2.val( $pass1Text.val() );
+ $pass1.val( $pass1Text.val() ).trigger( 'pwupdate' );
+ currentPass = $pass1Text.val();
+ } );
+
+ $pass1.after( $pass1Text );
+
+ if ( 1 === parseInt( $pass1.data( 'reveal' ), 10 ) ) {
+ generatePassword();
+ }
+
+ $pass1.on( 'input' + ' pwupdate', function () {
+ if ( $pass1.val() === currentPass ) {
+ return;
+ }
+
+ currentPass = $pass1.val();
+ if ( $pass1Text.val() !== currentPass ) {
+ $pass1Text.val( currentPass );
+ }
+ $pass1.add( $pass1Text ).removeClass( 'short bad good strong' );
+ showOrHideWeakPasswordCheckbox();
+ } );
+ }
+
+ function resetToggle() {
+ $toggleButton
+ .data( 'toggle', 0 )
+ .attr({
+ 'aria-label': userProfileL10n.ariaHide
+ })
+ .find( '.text' )
+ .text( userProfileL10n.hide )
+ .end()
+ .find( '.dashicons' )
+ .removeClass( 'dashicons-visibility' )
+ .addClass( 'dashicons-hidden' );
+
+ $pass1Text.focus();
+
+ $pass1Label.attr( 'for', 'pass1-text' );
+ }
+
+ function bindToggleButton() {
+ $toggleButton = $pass1Row.find('.wp-hide-pw');
+ $toggleButton.show().on( 'click', function () {
+ if ( 1 === parseInt( $toggleButton.data( 'toggle' ), 10 ) ) {
+ $pass1Wrap.addClass( 'show-password' );
+
+ resetToggle();
+
+ if ( ! _.isUndefined( $pass1Text[0].setSelectionRange ) ) {
+ $pass1Text[0].setSelectionRange( 0, 100 );
+ }
+ } else {
+ $pass1Wrap.removeClass( 'show-password' );
+ $toggleButton
+ .data( 'toggle', 1 )
+ .attr({
+ 'aria-label': userProfileL10n.ariaShow
+ })
+ .find( '.text' )
+ .text( userProfileL10n.show )
+ .end()
+ .find( '.dashicons' )
+ .removeClass('dashicons-hidden')
+ .addClass('dashicons-visibility');
+
+ $pass1.focus();
+
+ $pass1Label.attr( 'for', 'pass1' );
+
+ if ( ! _.isUndefined( $pass1[0].setSelectionRange ) ) {
+ $pass1[0].setSelectionRange( 0, 100 );
+ }
+ }
+ });
+ }
+
+ function bindPasswordForm() {
+ var $passwordWrapper,
+ $generateButton,
+ $cancelButton;
+
+ $pass1Row = $('.user-pass1-wrap');
+ $pass1Label = $pass1Row.find('th label').attr( 'for', 'pass1-text' );
+
+ // hide this
+ $('.user-pass2-wrap').hide();
+
+ $submitButton = $( '#submit, #wp-submit' ).on( 'click', function () {
+ updateLock = false;
+ });
+
+ $submitButtons = $submitButton.add( ' #createusersub' );
+
+ $weakRow = $( '.pw-weak' );
+ $weakCheckbox = $weakRow.find( '.pw-checkbox' );
+ $weakCheckbox.change( function() {
+ $submitButtons.prop( 'disabled', ! $weakCheckbox.prop( 'checked' ) );
+ } );
+
+ $pass1 = $('#pass1');
+ if ( $pass1.length ) {
+ bindPass1();
+ }
+
+ /**
+ * Fix a LastPass mismatch issue, LastPass only changes pass2.
+ *
+ * This fixes the issue by copying any changes from the hidden
+ * pass2 field to the pass1 field, then running check_pass_strength.
+ */
+ $pass2 = $( '#pass2' ).on( 'input', function () {
+ if ( $pass2.val().length > 0 ) {
+ $pass1.val( $pass2.val() );
+ $pass2.val('');
+ currentPass = '';
+ $pass1.trigger( 'pwupdate' );
+ }
+ } );
+
+ // Disable hidden inputs to prevent autofill and submission.
+ if ( $pass1.is( ':hidden' ) ) {
+ $pass1.prop( 'disabled', true );
+ $pass2.prop( 'disabled', true );
+ $pass1Text.prop( 'disabled', true );
+ }
+
+ $passwordWrapper = $pass1Row.find( '.wp-pwd' );
+ $generateButton = $pass1Row.find( 'button.wp-generate-pw' );
+
+ bindToggleButton();
+
+ if ( $generateButton.length ) {
+ $passwordWrapper.hide();
+ }
+
+ $generateButton.show();
+ $generateButton.on( 'click', function () {
+ updateLock = true;
+
+ $generateButton.hide();
+ $passwordWrapper.show();
+
+ // Enable the inputs when showing.
+ $pass1.attr( 'disabled', false );
+ $pass2.attr( 'disabled', false );
+ $pass1Text.attr( 'disabled', false );
+
+ if ( $pass1Text.val().length === 0 ) {
+ generatePassword();
+ }
+
+ _.defer( function() {
+ $pass1Text.focus();
+ if ( ! _.isUndefined( $pass1Text[0].setSelectionRange ) ) {
+ $pass1Text[0].setSelectionRange( 0, 100 );
+ }
+ }, 0 );
+ } );
+
+ $cancelButton = $pass1Row.find( 'button.wp-cancel-pw' );
+ $cancelButton.on( 'click', function () {
+ updateLock = false;
+
+ // Clear any entered password.
+ $pass1Text.val( '' );
+
+ // Generate a new password.
+ wp.ajax.post( 'generate-password' )
+ .done( function( data ) {
+ $pass1.data( 'pw', data );
+ } );
+
+ $generateButton.show().focus();
+ $passwordWrapper.hide();
+
+ $weakRow.hide( 0, function () {
+ $weakCheckbox.removeProp( 'checked' );
+ } );
+
+ // Disable the inputs when hiding to prevent autofill and submission.
+ $pass1.prop( 'disabled', true );
+ $pass2.prop( 'disabled', true );
+ $pass1Text.prop( 'disabled', true );
+
+ resetToggle();
+
+ if ( $pass1Row.closest( 'form' ).is( '#your-profile' ) ) {
+ // Clear password field to prevent update
+ $pass1.val( '' ).trigger( 'pwupdate' );
+ $submitButtons.prop( 'disabled', false );
+ }
+ } );
+
+ $pass1Row.closest( 'form' ).on( 'submit', function () {
+ updateLock = false;
+
+ $pass1.prop( 'disabled', false );
+ $pass2.prop( 'disabled', false );
+ $pass2.val( $pass1.val() );
+ $pass1Wrap.removeClass( 'show-password' );
+ });
+ }
+
+ function check_pass_strength() {
+ var pass1 = $('#pass1').val(), strength;
+
+ $('#pass-strength-result').removeClass('short bad good strong');
+ if ( ! pass1 ) {
+ $('#pass-strength-result').html( '&nbsp;' );
+ return;
+ }
+
+ strength = wp.passwordStrength.meter( pass1, wp.passwordStrength.userInputBlacklist(), pass1 );
+
+ switch ( strength ) {
+ case -1:
+ $( '#pass-strength-result' ).addClass( 'bad' ).html( pwsL10n.unknown );
+ break;
+ case 2:
+ $('#pass-strength-result').addClass('bad').html( pwsL10n.bad );
+ break;
+ case 3:
+ $('#pass-strength-result').addClass('good').html( pwsL10n.good );
+ break;
+ case 4:
+ $('#pass-strength-result').addClass('strong').html( pwsL10n.strong );
+ break;
+ case 5:
+ $('#pass-strength-result').addClass('short').html( pwsL10n.mismatch );
+ break;
+ default:
+ $('#pass-strength-result').addClass('short').html( pwsL10n['short'] );
+ }
+ }
+
+ function showOrHideWeakPasswordCheckbox() {
+ var passStrength = $('#pass-strength-result')[0];
+
+ if ( passStrength.className ) {
+ $pass1.add( $pass1Text ).addClass( passStrength.className );
+ if ( $( passStrength ).is( '.short, .bad' ) ) {
+ if ( ! $weakCheckbox.prop( 'checked' ) ) {
+ $submitButtons.prop( 'disabled', true );
+ }
+ $weakRow.show();
+ } else {
+ $submitButtons.prop( 'disabled', false );
+ $weakRow.hide();
+ }
+ }
+ }
+
+ $(document).ready( function() {
+ var $colorpicker, $stylesheet, user_id, current_user_id,
+ select = $( '#display_name' ),
+ current_name = select.val(),
+ greeting = $( '#wp-admin-bar-my-account' ).find( '.display-name' );
+
+ $( '#pass1' ).val( '' ).on( 'input' + ' pwupdate', check_pass_strength );
+ $('#pass-strength-result').show();
+ $('.color-palette').click( function() {
+ $(this).siblings('input[name="admin_color"]').prop('checked', true);
+ });
+
+ if ( select.length ) {
+ $('#first_name, #last_name, #nickname').bind( 'blur.user_profile', function() {
+ var dub = [],
+ inputs = {
+ display_nickname : $('#nickname').val() || '',
+ display_username : $('#user_login').val() || '',
+ display_firstname : $('#first_name').val() || '',
+ display_lastname : $('#last_name').val() || ''
+ };
+
+ if ( inputs.display_firstname && inputs.display_lastname ) {
+ inputs.display_firstlast = inputs.display_firstname + ' ' + inputs.display_lastname;
+ inputs.display_lastfirst = inputs.display_lastname + ' ' + inputs.display_firstname;
+ }
+
+ $.each( $('option', select), function( i, el ){
+ dub.push( el.value );
+ });
+
+ $.each(inputs, function( id, value ) {
+ if ( ! value ) {
+ return;
+ }
+
+ var val = value.replace(/<\/?[a-z][^>]*>/gi, '');
+
+ if ( inputs[id].length && $.inArray( val, dub ) === -1 ) {
+ dub.push(val);
+ $('<option />', {
+ 'text': val
+ }).appendTo( select );
+ }
+ });
+ });
+
+ /**
+ * Replaces "Howdy, *" in the admin toolbar whenever the display name dropdown is updated for one's own profile.
+ */
+ select.on( 'change', function() {
+ if ( user_id !== current_user_id ) {
+ return;
+ }
+
+ var display_name = $.trim( this.value ) || current_name;
+
+ greeting.text( display_name );
+ } );
+ }
+
+ $colorpicker = $( '#color-picker' );
+ $stylesheet = $( '#colors-css' );
+ user_id = $( 'input#user_id' ).val();
+ current_user_id = $( 'input[name="checkuser_id"]' ).val();
+
+ $colorpicker.on( 'click.colorpicker', '.color-option', function() {
+ var colors,
+ $this = $(this);
+
+ if ( $this.hasClass( 'selected' ) ) {
+ return;
+ }
+
+ $this.siblings( '.selected' ).removeClass( 'selected' );
+ $this.addClass( 'selected' ).find( 'input[type="radio"]' ).prop( 'checked', true );
+
+ // Set color scheme
+ if ( user_id === current_user_id ) {
+ // Load the colors stylesheet.
+ // The default color scheme won't have one, so we'll need to create an element.
+ if ( 0 === $stylesheet.length ) {
+ $stylesheet = $( '<link rel="stylesheet" />' ).appendTo( 'head' );
+ }
+ $stylesheet.attr( 'href', $this.children( '.css_url' ).val() );
+
+ // repaint icons
+ if ( typeof wp !== 'undefined' && wp.svgPainter ) {
+ try {
+ colors = $.parseJSON( $this.children( '.icon_colors' ).val() );
+ } catch ( error ) {}
+
+ if ( colors ) {
+ wp.svgPainter.setColors( colors );
+ wp.svgPainter.paint();
+ }
+ }
+
+ // update user option
+ $.post( ajaxurl, {
+ action: 'save-user-color-scheme',
+ color_scheme: $this.children( 'input[name="admin_color"]' ).val(),
+ nonce: $('#color-nonce').val()
+ }).done( function( response ) {
+ if ( response.success ) {
+ $( 'body' ).removeClass( response.data.previousScheme ).addClass( response.data.currentScheme );
+ }
+ });
+ }
+ });
+
+ bindPasswordForm();
+ });
+
+ $( '#destroy-sessions' ).on( 'click', function( e ) {
+ var $this = $(this);
+
+ wp.ajax.post( 'destroy-sessions', {
+ nonce: $( '#_wpnonce' ).val(),
+ user_id: $( '#user_id' ).val()
+ }).done( function( response ) {
+ $this.prop( 'disabled', true );
+ $this.siblings( '.notice' ).remove();
+ $this.before( '<div class="notice notice-success inline"><p>' + response.message + '</p></div>' );
+ }).fail( function( response ) {
+ $this.siblings( '.notice' ).remove();
+ $this.before( '<div class="notice notice-error inline"><p>' + response.message + '</p></div>' );
+ });
+
+ e.preventDefault();
+ });
+
+ window.generatePassword = generatePassword;
+
+ /* Warn the user if password was generated but not saved */
+ $( window ).on( 'beforeunload', function () {
+ if ( true === updateLock ) {
+ return userProfileL10n.warn;
+ }
+ } );
+
+})(jQuery);
diff --git a/www/crm/wp-admin/js/user-profile.min.js b/www/crm/wp-admin/js/user-profile.min.js
new file mode 100644
index 00000000..f6b2d8f7
--- /dev/null
+++ b/www/crm/wp-admin/js/user-profile.min.js
@@ -0,0 +1 @@
+!function(a){function b(){return"function"!=typeof zxcvbn?void setTimeout(b,50):(k.val()?(g(),h()):(k.val(k.data("pw")),k.trigger("pwupdate"),h()),1!==parseInt(q.data("start-masked"),10)?j.addClass("show-password"):q.trigger("click"),void a("#pw-weak-text-label").html(userProfileL10n.warnWeak))}function c(){t=k.val(),j=k.parent(),l=a('<input type="text"/>').attr({id:"pass1-text",name:"pass1-text",autocomplete:"off"}).addClass(k[0].className).data("pw",k.data("pw")).val(k.val()).on("input",function(){l.val()!==t&&(n.val(l.val()),k.val(l.val()).trigger("pwupdate"),t=l.val())}),k.after(l),1===parseInt(k.data("reveal"),10)&&b(),k.on("input pwupdate",function(){k.val()!==t&&(t=k.val(),l.val()!==t&&l.val(t),k.add(l).removeClass("short bad good strong"),h())})}function d(){q.data("toggle",0).attr({"aria-label":userProfileL10n.ariaHide}).find(".text").text(userProfileL10n.hide).end().find(".dashicons").removeClass("dashicons-visibility").addClass("dashicons-hidden"),l.focus(),m.attr("for","pass1-text")}function e(){q=i.find(".wp-hide-pw"),q.show().on("click",function(){1===parseInt(q.data("toggle"),10)?(j.addClass("show-password"),d(),_.isUndefined(l[0].setSelectionRange)||l[0].setSelectionRange(0,100)):(j.removeClass("show-password"),q.data("toggle",1).attr({"aria-label":userProfileL10n.ariaShow}).find(".text").text(userProfileL10n.show).end().find(".dashicons").removeClass("dashicons-hidden").addClass("dashicons-visibility"),k.focus(),m.attr("for","pass1"),_.isUndefined(k[0].setSelectionRange)||k[0].setSelectionRange(0,100))})}function f(){var f,g,h;i=a(".user-pass1-wrap"),m=i.find("th label").attr("for","pass1-text"),a(".user-pass2-wrap").hide(),s=a("#submit, #wp-submit").on("click",function(){u=!1}),r=s.add(" #createusersub"),o=a(".pw-weak"),p=o.find(".pw-checkbox"),p.change(function(){r.prop("disabled",!p.prop("checked"))}),k=a("#pass1"),k.length&&c(),n=a("#pass2").on("input",function(){n.val().length>0&&(k.val(n.val()),n.val(""),t="",k.trigger("pwupdate"))}),k.is(":hidden")&&(k.prop("disabled",!0),n.prop("disabled",!0),l.prop("disabled",!0)),f=i.find(".wp-pwd"),g=i.find("button.wp-generate-pw"),e(),g.length&&f.hide(),g.show(),g.on("click",function(){u=!0,g.hide(),f.show(),k.attr("disabled",!1),n.attr("disabled",!1),l.attr("disabled",!1),0===l.val().length&&b(),_.defer(function(){l.focus(),_.isUndefined(l[0].setSelectionRange)||l[0].setSelectionRange(0,100)},0)}),h=i.find("button.wp-cancel-pw"),h.on("click",function(){u=!1,l.val(""),wp.ajax.post("generate-password").done(function(a){k.data("pw",a)}),g.show().focus(),f.hide(),o.hide(0,function(){p.removeProp("checked")}),k.prop("disabled",!0),n.prop("disabled",!0),l.prop("disabled",!0),d(),i.closest("form").is("#your-profile")&&(k.val("").trigger("pwupdate"),r.prop("disabled",!1))}),i.closest("form").on("submit",function(){u=!1,k.prop("disabled",!1),n.prop("disabled",!1),n.val(k.val()),j.removeClass("show-password")})}function g(){var b,c=a("#pass1").val();if(a("#pass-strength-result").removeClass("short bad good strong"),!c)return void a("#pass-strength-result").html("&nbsp;");switch(b=wp.passwordStrength.meter(c,wp.passwordStrength.userInputBlacklist(),c)){case-1:a("#pass-strength-result").addClass("bad").html(pwsL10n.unknown);break;case 2:a("#pass-strength-result").addClass("bad").html(pwsL10n.bad);break;case 3:a("#pass-strength-result").addClass("good").html(pwsL10n.good);break;case 4:a("#pass-strength-result").addClass("strong").html(pwsL10n.strong);break;case 5:a("#pass-strength-result").addClass("short").html(pwsL10n.mismatch);break;default:a("#pass-strength-result").addClass("short").html(pwsL10n["short"])}}function h(){var b=a("#pass-strength-result")[0];b.className&&(k.add(l).addClass(b.className),a(b).is(".short, .bad")?(p.prop("checked")||r.prop("disabled",!0),o.show()):(r.prop("disabled",!1),o.hide()))}var i,j,k,l,m,n,o,p,q,r,s,t,u=!1;a(document).ready(function(){var b,c,d,e,h=a("#display_name"),i=h.val(),j=a("#wp-admin-bar-my-account").find(".display-name");a("#pass1").val("").on("input pwupdate",g),a("#pass-strength-result").show(),a(".color-palette").click(function(){a(this).siblings('input[name="admin_color"]').prop("checked",!0)}),h.length&&(a("#first_name, #last_name, #nickname").bind("blur.user_profile",function(){var b=[],c={display_nickname:a("#nickname").val()||"",display_username:a("#user_login").val()||"",display_firstname:a("#first_name").val()||"",display_lastname:a("#last_name").val()||""};c.display_firstname&&c.display_lastname&&(c.display_firstlast=c.display_firstname+" "+c.display_lastname,c.display_lastfirst=c.display_lastname+" "+c.display_firstname),a.each(a("option",h),function(a,c){b.push(c.value)}),a.each(c,function(d,e){if(e){var f=e.replace(/<\/?[a-z][^>]*>/gi,"");c[d].length&&a.inArray(f,b)===-1&&(b.push(f),a("<option />",{text:f}).appendTo(h))}})}),h.on("change",function(){if(d===e){var b=a.trim(this.value)||i;j.text(b)}})),b=a("#color-picker"),c=a("#colors-css"),d=a("input#user_id").val(),e=a('input[name="checkuser_id"]').val(),b.on("click.colorpicker",".color-option",function(){var b,f=a(this);if(!f.hasClass("selected")&&(f.siblings(".selected").removeClass("selected"),f.addClass("selected").find('input[type="radio"]').prop("checked",!0),d===e)){if(0===c.length&&(c=a('<link rel="stylesheet" />').appendTo("head")),c.attr("href",f.children(".css_url").val()),"undefined"!=typeof wp&&wp.svgPainter){try{b=a.parseJSON(f.children(".icon_colors").val())}catch(g){}b&&(wp.svgPainter.setColors(b),wp.svgPainter.paint())}a.post(ajaxurl,{action:"save-user-color-scheme",color_scheme:f.children('input[name="admin_color"]').val(),nonce:a("#color-nonce").val()}).done(function(b){b.success&&a("body").removeClass(b.data.previousScheme).addClass(b.data.currentScheme)})}}),f()}),a("#destroy-sessions").on("click",function(b){var c=a(this);wp.ajax.post("destroy-sessions",{nonce:a("#_wpnonce").val(),user_id:a("#user_id").val()}).done(function(a){c.prop("disabled",!0),c.siblings(".notice").remove(),c.before('<div class="notice notice-success inline"><p>'+a.message+"</p></div>")}).fail(function(a){c.siblings(".notice").remove(),c.before('<div class="notice notice-error inline"><p>'+a.message+"</p></div>")}),b.preventDefault()}),window.generatePassword=b,a(window).on("beforeunload",function(){if(!0===u)return userProfileL10n.warn})}(jQuery); \ No newline at end of file
diff --git a/www/crm/wp-admin/js/user-suggest.js b/www/crm/wp-admin/js/user-suggest.js
new file mode 100644
index 00000000..19770df0
--- /dev/null
+++ b/www/crm/wp-admin/js/user-suggest.js
@@ -0,0 +1,64 @@
+/**
+ * Suggests users in a multisite environment.
+ *
+ * For input fields where the admin can select a user based on email or
+ * username, this script shows an autocompletion menu for these inputs. Should
+ * only be used in a multisite environment. Only users in the currently active
+ * site are shown.
+ *
+ * @since 3.4.0
+ * @output wp-admin/js/user-suggest.js
+ */
+
+/* global ajaxurl, current_site_id, isRtl */
+
+(function( $ ) {
+ var id = ( typeof current_site_id !== 'undefined' ) ? '&site_id=' + current_site_id : '';
+ $(document).ready( function() {
+ var position = { offset: '0, -1' };
+ if ( typeof isRtl !== 'undefined' && isRtl ) {
+ position.my = 'right top';
+ position.at = 'right bottom';
+ }
+
+ /**
+ * Adds an autocomplete function to input fields marked with the class
+ * 'wp-suggest-user'.
+ *
+ * A minimum of two characters is required to trigger the suggestions. The
+ * autocompletion menu is shown at the left bottom of the input field. On
+ * RTL installations, it is shown at the right top. Adds the class 'open' to
+ * the input field when the autocompletion menu is shown.
+ *
+ * Does a backend call to retrieve the users.
+ *
+ * Optional data-attributes:
+ * - data-autocomplete-type (add, search)
+ * The action that is going to be performed: search for existing users
+ * or add a new one. Default: add
+ * - data-autocomplete-field (user_login, user_email)
+ * The field that is returned as the value for the suggestion.
+ * Default: user_login
+ *
+ * @see wp-admin/includes/admin-actions.php:wp_ajax_autocomplete_user()
+ */
+ $( '.wp-suggest-user' ).each( function(){
+ var $this = $( this ),
+ autocompleteType = ( typeof $this.data( 'autocompleteType' ) !== 'undefined' ) ? $this.data( 'autocompleteType' ) : 'add',
+ autocompleteField = ( typeof $this.data( 'autocompleteField' ) !== 'undefined' ) ? $this.data( 'autocompleteField' ) : 'user_login';
+
+ $this.autocomplete({
+ source: ajaxurl + '?action=autocomplete-user&autocomplete_type=' + autocompleteType + '&autocomplete_field=' + autocompleteField + id,
+ delay: 500,
+ minLength: 2,
+ position: position,
+ open: function() {
+ $( this ).addClass( 'open' );
+ },
+ close: function() {
+ $( this ).removeClass( 'open' );
+ }
+ });
+ });
+ });
+})( jQuery );
diff --git a/www/crm/wp-admin/js/user-suggest.min.js b/www/crm/wp-admin/js/user-suggest.min.js
new file mode 100644
index 00000000..9caf1e5f
--- /dev/null
+++ b/www/crm/wp-admin/js/user-suggest.min.js
@@ -0,0 +1 @@
+!function(a){var b="undefined"!=typeof current_site_id?"&site_id="+current_site_id:"";a(document).ready(function(){var c={offset:"0, -1"};"undefined"!=typeof isRtl&&isRtl&&(c.my="right top",c.at="right bottom"),a(".wp-suggest-user").each(function(){var d=a(this),e="undefined"!=typeof d.data("autocompleteType")?d.data("autocompleteType"):"add",f="undefined"!=typeof d.data("autocompleteField")?d.data("autocompleteField"):"user_login";d.autocomplete({source:ajaxurl+"?action=autocomplete-user&autocomplete_type="+e+"&autocomplete_field="+f+b,delay:500,minLength:2,position:c,open:function(){a(this).addClass("open")},close:function(){a(this).removeClass("open")}})})})}(jQuery); \ No newline at end of file
diff --git a/www/crm/wp-admin/js/widgets.js b/www/crm/wp-admin/js/widgets.js
new file mode 100644
index 00000000..00ae62db
--- /dev/null
+++ b/www/crm/wp-admin/js/widgets.js
@@ -0,0 +1,761 @@
+/**
+ * @output wp-admin/js/widgets.js
+ */
+
+/* global ajaxurl, isRtl, wpWidgets */
+
+(function($) {
+ var $document = $( document );
+
+window.wpWidgets = {
+ /**
+ * A closed Sidebar that gets a Widget dragged over it.
+ *
+ * @var {element|null}
+ */
+ hoveredSidebar: null,
+
+ /**
+ * Translations.
+ *
+ * Exported from PHP in wp_default_scripts().
+ *
+ * @var {object}
+ */
+ l10n: {
+ save: '{save}',
+ saved: '{saved}',
+ saveAlert: '{saveAlert}',
+ widgetAdded: '{widgetAdded}'
+ },
+
+ /**
+ * Lookup of which widgets have had change events triggered.
+ *
+ * @var {object}
+ */
+ dirtyWidgets: {},
+
+ init : function() {
+ var rem, the_id,
+ self = this,
+ chooser = $('.widgets-chooser'),
+ selectSidebar = chooser.find('.widgets-chooser-sidebars'),
+ sidebars = $('div.widgets-sortables'),
+ isRTL = !! ( 'undefined' !== typeof isRtl && isRtl );
+
+ // Handle the widgets containers in the right column.
+ $( '#widgets-right .sidebar-name' )
+ /*
+ * Toggle the widgets containers when clicked and update the toggle
+ * button `aria-expanded` attribute value.
+ */
+ .click( function() {
+ var $this = $( this ),
+ $wrap = $this.closest( '.widgets-holder-wrap '),
+ $toggle = $this.find( '.handlediv' );
+
+ if ( $wrap.hasClass( 'closed' ) ) {
+ $wrap.removeClass( 'closed' );
+ $toggle.attr( 'aria-expanded', 'true' );
+ // Refresh the jQuery UI sortable items.
+ $this.parent().sortable( 'refresh' );
+ } else {
+ $wrap.addClass( 'closed' );
+ $toggle.attr( 'aria-expanded', 'false' );
+ }
+
+ // Update the admin menu "sticky" state.
+ $document.triggerHandler( 'wp-pin-menu' );
+ })
+ /*
+ * Set the initial `aria-expanded` attribute value on the widgets
+ * containers toggle button. The first one is expanded by default.
+ */
+ .find( '.handlediv' ).each( function( index ) {
+ if ( 0 === index ) {
+ // jQuery equivalent of `continue` within an `each()` loop.
+ return;
+ }
+
+ $( this ).attr( 'aria-expanded', 'false' );
+ });
+
+ // Show AYS dialog when there are unsaved widget changes.
+ $( window ).on( 'beforeunload.widgets', function( event ) {
+ var dirtyWidgetIds = [], unsavedWidgetsElements;
+ $.each( self.dirtyWidgets, function( widgetId, dirty ) {
+ if ( dirty ) {
+ dirtyWidgetIds.push( widgetId );
+ }
+ });
+ if ( 0 !== dirtyWidgetIds.length ) {
+ unsavedWidgetsElements = $( '#widgets-right' ).find( '.widget' ).filter( function() {
+ return -1 !== dirtyWidgetIds.indexOf( $( this ).prop( 'id' ).replace( /^widget-\d+_/, '' ) );
+ });
+ unsavedWidgetsElements.each( function() {
+ if ( ! $( this ).hasClass( 'open' ) ) {
+ $( this ).find( '.widget-title-action:first' ).click();
+ }
+ });
+
+ // Bring the first unsaved widget into view and focus on the first tabbable field.
+ unsavedWidgetsElements.first().each( function() {
+ if ( this.scrollIntoViewIfNeeded ) {
+ this.scrollIntoViewIfNeeded();
+ } else {
+ this.scrollIntoView();
+ }
+ $( this ).find( '.widget-inside :tabbable:first' ).focus();
+ } );
+
+ event.returnValue = wpWidgets.l10n.saveAlert;
+ return event.returnValue;
+ }
+ });
+
+ // Handle the widgets containers in the left column.
+ $( '#widgets-left .sidebar-name' ).click( function() {
+ var $wrap = $( this ).closest( '.widgets-holder-wrap' );
+
+ $wrap
+ .toggleClass( 'closed' )
+ .find( '.handlediv' ).attr( 'aria-expanded', ! $wrap.hasClass( 'closed' ) );
+
+ // Update the admin menu "sticky" state.
+ $document.triggerHandler( 'wp-pin-menu' );
+ });
+
+ $(document.body).bind('click.widgets-toggle', function(e) {
+ var target = $(e.target),
+ css = { 'z-index': 100 },
+ widget, inside, targetWidth, widgetWidth, margin, saveButton, widgetId,
+ toggleBtn = target.closest( '.widget' ).find( '.widget-top button.widget-action' );
+
+ if ( target.parents('.widget-top').length && ! target.parents('#available-widgets').length ) {
+ widget = target.closest('div.widget');
+ inside = widget.children('.widget-inside');
+ targetWidth = parseInt( widget.find('input.widget-width').val(), 10 );
+ widgetWidth = widget.parent().width();
+ widgetId = inside.find( '.widget-id' ).val();
+
+ // Save button is initially disabled, but is enabled when a field is changed.
+ if ( ! widget.data( 'dirty-state-initialized' ) ) {
+ saveButton = inside.find( '.widget-control-save' );
+ saveButton.prop( 'disabled', true ).val( wpWidgets.l10n.saved );
+ inside.on( 'input change', function() {
+ self.dirtyWidgets[ widgetId ] = true;
+ widget.addClass( 'widget-dirty' );
+ saveButton.prop( 'disabled', false ).val( wpWidgets.l10n.save );
+ });
+ widget.data( 'dirty-state-initialized', true );
+ }
+
+ if ( inside.is(':hidden') ) {
+ if ( targetWidth > 250 && ( targetWidth + 30 > widgetWidth ) && widget.closest('div.widgets-sortables').length ) {
+ if ( widget.closest('div.widget-liquid-right').length ) {
+ margin = isRTL ? 'margin-right' : 'margin-left';
+ } else {
+ margin = isRTL ? 'margin-left' : 'margin-right';
+ }
+
+ css[ margin ] = widgetWidth - ( targetWidth + 30 ) + 'px';
+ widget.css( css );
+ }
+ /*
+ * Don't change the order of attributes changes and animation:
+ * it's important for screen readers, see ticket #31476.
+ */
+ toggleBtn.attr( 'aria-expanded', 'true' );
+ inside.slideDown( 'fast', function() {
+ widget.addClass( 'open' );
+ });
+ } else {
+ /*
+ * Don't change the order of attributes changes and animation:
+ * it's important for screen readers, see ticket #31476.
+ */
+ toggleBtn.attr( 'aria-expanded', 'false' );
+ inside.slideUp( 'fast', function() {
+ widget.attr( 'style', '' );
+ widget.removeClass( 'open' );
+ });
+ }
+ } else if ( target.hasClass('widget-control-save') ) {
+ wpWidgets.save( target.closest('div.widget'), 0, 1, 0 );
+ e.preventDefault();
+ } else if ( target.hasClass('widget-control-remove') ) {
+ wpWidgets.save( target.closest('div.widget'), 1, 1, 0 );
+ } else if ( target.hasClass('widget-control-close') ) {
+ widget = target.closest('div.widget');
+ widget.removeClass( 'open' );
+ toggleBtn.attr( 'aria-expanded', 'false' );
+ wpWidgets.close( widget );
+ } else if ( target.attr( 'id' ) === 'inactive-widgets-control-remove' ) {
+ wpWidgets.removeInactiveWidgets();
+ e.preventDefault();
+ }
+ });
+
+ sidebars.children('.widget').each( function() {
+ var $this = $(this);
+
+ wpWidgets.appendTitle( this );
+
+ if ( $this.find( 'p.widget-error' ).length ) {
+ $this.find( '.widget-action' ).trigger( 'click' ).attr( 'aria-expanded', 'true' );
+ }
+ });
+
+ $('#widget-list').children('.widget').draggable({
+ connectToSortable: 'div.widgets-sortables',
+ handle: '> .widget-top > .widget-title',
+ distance: 2,
+ helper: 'clone',
+ zIndex: 100,
+ containment: '#wpwrap',
+ refreshPositions: true,
+ start: function( event, ui ) {
+ var chooser = $(this).find('.widgets-chooser');
+
+ ui.helper.find('div.widget-description').hide();
+ the_id = this.id;
+
+ if ( chooser.length ) {
+ // Hide the chooser and move it out of the widget
+ $( '#wpbody-content' ).append( chooser.hide() );
+ // Delete the cloned chooser from the drag helper
+ ui.helper.find('.widgets-chooser').remove();
+ self.clearWidgetSelection();
+ }
+ },
+ stop: function() {
+ if ( rem ) {
+ $(rem).hide();
+ }
+
+ rem = '';
+ }
+ });
+
+ /**
+ * Opens and closes previously closed Sidebars when Widgets are dragged over/out of them.
+ */
+ sidebars.droppable( {
+ tolerance: 'intersect',
+
+ /**
+ * Open Sidebar when a Widget gets dragged over it.
+ *
+ * @ignore
+ *
+ * @param {object} event jQuery event object.
+ */
+ over: function( event ) {
+ var $wrap = $( event.target ).parent();
+
+ if ( wpWidgets.hoveredSidebar && ! $wrap.is( wpWidgets.hoveredSidebar ) ) {
+ // Close the previous Sidebar as the Widget has been dragged onto another Sidebar.
+ wpWidgets.closeSidebar( event );
+ }
+
+ if ( $wrap.hasClass( 'closed' ) ) {
+ wpWidgets.hoveredSidebar = $wrap;
+ $wrap
+ .removeClass( 'closed' )
+ .find( '.handlediv' ).attr( 'aria-expanded', 'true' );
+ }
+
+ $( this ).sortable( 'refresh' );
+ },
+
+ /**
+ * Close Sidebar when the Widget gets dragged out of it.
+ *
+ * @ignore
+ *
+ * @param {object} event jQuery event object.
+ */
+ out: function( event ) {
+ if ( wpWidgets.hoveredSidebar ) {
+ wpWidgets.closeSidebar( event );
+ }
+ }
+ } );
+
+ sidebars.sortable({
+ placeholder: 'widget-placeholder',
+ items: '> .widget',
+ handle: '> .widget-top > .widget-title',
+ cursor: 'move',
+ distance: 2,
+ containment: '#wpwrap',
+ tolerance: 'pointer',
+ refreshPositions: true,
+ start: function( event, ui ) {
+ var height, $this = $(this),
+ $wrap = $this.parent(),
+ inside = ui.item.children('.widget-inside');
+
+ if ( inside.css('display') === 'block' ) {
+ ui.item.removeClass('open');
+ ui.item.find( '.widget-top button.widget-action' ).attr( 'aria-expanded', 'false' );
+ inside.hide();
+ $(this).sortable('refreshPositions');
+ }
+
+ if ( ! $wrap.hasClass('closed') ) {
+ // Lock all open sidebars min-height when starting to drag.
+ // Prevents jumping when dragging a widget from an open sidebar to a closed sidebar below.
+ height = ui.item.hasClass('ui-draggable') ? $this.height() : 1 + $this.height();
+ $this.css( 'min-height', height + 'px' );
+ }
+ },
+
+ stop: function( event, ui ) {
+ var addNew, widgetNumber, $sidebar, $children, child, item,
+ $widget = ui.item,
+ id = the_id;
+
+ // Reset the var to hold a previously closed sidebar.
+ wpWidgets.hoveredSidebar = null;
+
+ if ( $widget.hasClass('deleting') ) {
+ wpWidgets.save( $widget, 1, 0, 1 ); // delete widget
+ $widget.remove();
+ return;
+ }
+
+ addNew = $widget.find('input.add_new').val();
+ widgetNumber = $widget.find('input.multi_number').val();
+
+ $widget.attr( 'style', '' ).removeClass('ui-draggable');
+ the_id = '';
+
+ if ( addNew ) {
+ if ( 'multi' === addNew ) {
+ $widget.html(
+ $widget.html().replace( /<[^<>]+>/g, function( tag ) {
+ return tag.replace( /__i__|%i%/g, widgetNumber );
+ })
+ );
+
+ $widget.attr( 'id', id.replace( '__i__', widgetNumber ) );
+ widgetNumber++;
+
+ $( 'div#' + id ).find( 'input.multi_number' ).val( widgetNumber );
+ } else if ( 'single' === addNew ) {
+ $widget.attr( 'id', 'new-' + id );
+ rem = 'div#' + id;
+ }
+
+ wpWidgets.save( $widget, 0, 0, 1 );
+ $widget.find('input.add_new').val('');
+ $document.trigger( 'widget-added', [ $widget ] );
+ }
+
+ $sidebar = $widget.parent();
+
+ if ( $sidebar.parent().hasClass('closed') ) {
+ $sidebar.parent()
+ .removeClass( 'closed' )
+ .find( '.handlediv' ).attr( 'aria-expanded', 'true' );
+
+ $children = $sidebar.children('.widget');
+
+ // Make sure the dropped widget is at the top
+ if ( $children.length > 1 ) {
+ child = $children.get(0);
+ item = $widget.get(0);
+
+ if ( child.id && item.id && child.id !== item.id ) {
+ $( child ).before( $widget );
+ }
+ }
+ }
+
+ if ( addNew ) {
+ $widget.find( '.widget-action' ).trigger( 'click' );
+ } else {
+ wpWidgets.saveOrder( $sidebar.attr('id') );
+ }
+ },
+
+ activate: function() {
+ $(this).parent().addClass( 'widget-hover' );
+ },
+
+ deactivate: function() {
+ // Remove all min-height added on "start"
+ $(this).css( 'min-height', '' ).parent().removeClass( 'widget-hover' );
+ },
+
+ receive: function( event, ui ) {
+ var $sender = $( ui.sender );
+
+ // Don't add more widgets to orphaned sidebars
+ if ( this.id.indexOf('orphaned_widgets') > -1 ) {
+ $sender.sortable('cancel');
+ return;
+ }
+
+ // If the last widget was moved out of an orphaned sidebar, close and remove it.
+ if ( $sender.attr('id').indexOf('orphaned_widgets') > -1 && ! $sender.children('.widget').length ) {
+ $sender.parents('.orphan-sidebar').slideUp( 400, function(){ $(this).remove(); } );
+ }
+ }
+ }).sortable( 'option', 'connectWith', 'div.widgets-sortables' );
+
+ $('#available-widgets').droppable({
+ tolerance: 'pointer',
+ accept: function(o){
+ return $(o).parent().attr('id') !== 'widget-list';
+ },
+ drop: function(e,ui) {
+ ui.draggable.addClass('deleting');
+ $('#removing-widget').hide().children('span').empty();
+ },
+ over: function(e,ui) {
+ ui.draggable.addClass('deleting');
+ $('div.widget-placeholder').hide();
+
+ if ( ui.draggable.hasClass('ui-sortable-helper') ) {
+ $('#removing-widget').show().children('span')
+ .html( ui.draggable.find( 'div.widget-title' ).children( 'h3' ).html() );
+ }
+ },
+ out: function(e,ui) {
+ ui.draggable.removeClass('deleting');
+ $('div.widget-placeholder').show();
+ $('#removing-widget').hide().children('span').empty();
+ }
+ });
+
+ // Area Chooser
+ $( '#widgets-right .widgets-holder-wrap' ).each( function( index, element ) {
+ var $element = $( element ),
+ name = $element.find( '.sidebar-name h2' ).text(),
+ ariaLabel = $element.find( '.sidebar-name' ).data( 'add-to' ),
+ id = $element.find( '.widgets-sortables' ).attr( 'id' ),
+ li = $( '<li>' ),
+ button = $( '<button>', {
+ type: 'button',
+ 'aria-pressed': 'false',
+ 'class': 'widgets-chooser-button',
+ 'aria-label': ariaLabel
+ } ).text( $.trim( name ) );
+
+ li.append( button );
+
+ if ( index === 0 ) {
+ li.addClass( 'widgets-chooser-selected' );
+ button.attr( 'aria-pressed', 'true' );
+ }
+
+ selectSidebar.append( li );
+ li.data( 'sidebarId', id );
+ });
+
+ $( '#available-widgets .widget .widget-top' ).on( 'click.widgets-chooser', function() {
+ var $widget = $( this ).closest( '.widget' ),
+ toggleButton = $( this ).find( '.widget-action' ),
+ chooserButtons = selectSidebar.find( '.widgets-chooser-button' );
+
+ if ( $widget.hasClass( 'widget-in-question' ) || $( '#widgets-left' ).hasClass( 'chooser' ) ) {
+ toggleButton.attr( 'aria-expanded', 'false' );
+ self.closeChooser();
+ } else {
+ // Open the chooser
+ self.clearWidgetSelection();
+ $( '#widgets-left' ).addClass( 'chooser' );
+ // Add CSS class and insert the chooser after the widget description.
+ $widget.addClass( 'widget-in-question' ).children( '.widget-description' ).after( chooser );
+ // Open the chooser with a slide down animation.
+ chooser.slideDown( 300, function() {
+ // Update the toggle button aria-expanded attribute after previous DOM manipulations.
+ toggleButton.attr( 'aria-expanded', 'true' );
+ });
+
+ chooserButtons.on( 'click.widgets-chooser', function() {
+ selectSidebar.find( '.widgets-chooser-selected' ).removeClass( 'widgets-chooser-selected' );
+ chooserButtons.attr( 'aria-pressed', 'false' );
+ $( this )
+ .attr( 'aria-pressed', 'true' )
+ .closest( 'li' ).addClass( 'widgets-chooser-selected' );
+ } );
+ }
+ });
+
+ // Add event handlers
+ chooser.on( 'click.widgets-chooser', function( event ) {
+ var $target = $( event.target );
+
+ if ( $target.hasClass('button-primary') ) {
+ self.addWidget( chooser );
+ self.closeChooser();
+ } else if ( $target.hasClass( 'widgets-chooser-cancel' ) ) {
+ self.closeChooser();
+ }
+ }).on( 'keyup.widgets-chooser', function( event ) {
+ if ( event.which === $.ui.keyCode.ESCAPE ) {
+ self.closeChooser();
+ }
+ });
+ },
+
+ saveOrder : function( sidebarId ) {
+ var data = {
+ action: 'widgets-order',
+ savewidgets: $('#_wpnonce_widgets').val(),
+ sidebars: []
+ };
+
+ if ( sidebarId ) {
+ $( '#' + sidebarId ).find( '.spinner:first' ).addClass( 'is-active' );
+ }
+
+ $('div.widgets-sortables').each( function() {
+ if ( $(this).sortable ) {
+ data['sidebars[' + $(this).attr('id') + ']'] = $(this).sortable('toArray').join(',');
+ }
+ });
+
+ $.post( ajaxurl, data, function() {
+ $( '#inactive-widgets-control-remove' ).prop( 'disabled' , ! $( '#wp_inactive_widgets .widget' ).length );
+ $( '.spinner' ).removeClass( 'is-active' );
+ });
+ },
+
+ save : function( widget, del, animate, order ) {
+ var self = this, data, a,
+ sidebarId = widget.closest( 'div.widgets-sortables' ).attr( 'id' ),
+ form = widget.find( 'form' ),
+ isAdd = widget.find( 'input.add_new' ).val();
+
+ if ( ! del && ! isAdd && form.prop( 'checkValidity' ) && ! form[0].checkValidity() ) {
+ return;
+ }
+
+ data = form.serialize();
+
+ widget = $(widget);
+ $( '.spinner', widget ).addClass( 'is-active' );
+
+ a = {
+ action: 'save-widget',
+ savewidgets: $('#_wpnonce_widgets').val(),
+ sidebar: sidebarId
+ };
+
+ if ( del ) {
+ a.delete_widget = 1;
+ }
+
+ data += '&' + $.param(a);
+
+ $.post( ajaxurl, data, function(r) {
+ var id = $('input.widget-id', widget).val();
+
+ if ( del ) {
+ if ( ! $('input.widget_number', widget).val() ) {
+ $('#available-widgets').find('input.widget-id').each(function(){
+ if ( $(this).val() === id ) {
+ $(this).closest('div.widget').show();
+ }
+ });
+ }
+
+ if ( animate ) {
+ order = 0;
+ widget.slideUp( 'fast', function() {
+ $( this ).remove();
+ wpWidgets.saveOrder();
+ delete self.dirtyWidgets[ id ];
+ });
+ } else {
+ widget.remove();
+ delete self.dirtyWidgets[ id ];
+
+ if ( sidebarId === 'wp_inactive_widgets' ) {
+ $( '#inactive-widgets-control-remove' ).prop( 'disabled' , ! $( '#wp_inactive_widgets .widget' ).length );
+ }
+ }
+ } else {
+ $( '.spinner' ).removeClass( 'is-active' );
+ if ( r && r.length > 2 ) {
+ $( 'div.widget-content', widget ).html( r );
+ wpWidgets.appendTitle( widget );
+
+ // Re-disable the save button.
+ widget.find( '.widget-control-save' ).prop( 'disabled', true ).val( wpWidgets.l10n.saved );
+
+ widget.removeClass( 'widget-dirty' );
+
+ // Clear the dirty flag from the widget.
+ delete self.dirtyWidgets[ id ];
+
+ $document.trigger( 'widget-updated', [ widget ] );
+
+ if ( sidebarId === 'wp_inactive_widgets' ) {
+ $( '#inactive-widgets-control-remove' ).prop( 'disabled' , ! $( '#wp_inactive_widgets .widget' ).length );
+ }
+ }
+ }
+
+ if ( order ) {
+ wpWidgets.saveOrder();
+ }
+ });
+ },
+
+ removeInactiveWidgets : function() {
+ var $element = $( '.remove-inactive-widgets' ), self = this, a, data;
+
+ $( '.spinner', $element ).addClass( 'is-active' );
+
+ a = {
+ action : 'delete-inactive-widgets',
+ removeinactivewidgets : $( '#_wpnonce_remove_inactive_widgets' ).val()
+ };
+
+ data = $.param( a );
+
+ $.post( ajaxurl, data, function() {
+ $( '#wp_inactive_widgets .widget' ).each(function() {
+ var $widget = $( this );
+ delete self.dirtyWidgets[ $widget.find( 'input.widget-id' ).val() ];
+ $widget.remove();
+ });
+ $( '#inactive-widgets-control-remove' ).prop( 'disabled', true );
+ $( '.spinner', $element ).removeClass( 'is-active' );
+ } );
+ },
+
+ appendTitle : function(widget) {
+ var title = $('input[id*="-title"]', widget).val() || '';
+
+ if ( title ) {
+ title = ': ' + title.replace(/<[^<>]+>/g, '').replace(/</g, '&lt;').replace(/>/g, '&gt;');
+ }
+
+ $(widget).children('.widget-top').children('.widget-title').children()
+ .children('.in-widget-title').html(title);
+
+ },
+
+ close : function(widget) {
+ widget.children('.widget-inside').slideUp('fast', function() {
+ widget.attr( 'style', '' )
+ .find( '.widget-top button.widget-action' )
+ .attr( 'aria-expanded', 'false' )
+ .focus();
+ });
+ },
+
+ addWidget: function( chooser ) {
+ var widget, widgetId, add, n, viewportTop, viewportBottom, sidebarBounds,
+ sidebarId = chooser.find( '.widgets-chooser-selected' ).data('sidebarId'),
+ sidebar = $( '#' + sidebarId );
+
+ widget = $('#available-widgets').find('.widget-in-question').clone();
+ widgetId = widget.attr('id');
+ add = widget.find( 'input.add_new' ).val();
+ n = widget.find( 'input.multi_number' ).val();
+
+ // Remove the cloned chooser from the widget
+ widget.find('.widgets-chooser').remove();
+
+ if ( 'multi' === add ) {
+ widget.html(
+ widget.html().replace( /<[^<>]+>/g, function(m) {
+ return m.replace( /__i__|%i%/g, n );
+ })
+ );
+
+ widget.attr( 'id', widgetId.replace( '__i__', n ) );
+ n++;
+ $( '#' + widgetId ).find('input.multi_number').val(n);
+ } else if ( 'single' === add ) {
+ widget.attr( 'id', 'new-' + widgetId );
+ $( '#' + widgetId ).hide();
+ }
+
+ // Open the widgets container.
+ sidebar.closest( '.widgets-holder-wrap' )
+ .removeClass( 'closed' )
+ .find( '.handlediv' ).attr( 'aria-expanded', 'true' );
+
+ sidebar.append( widget );
+ sidebar.sortable('refresh');
+
+ wpWidgets.save( widget, 0, 0, 1 );
+ // No longer "new" widget
+ widget.find( 'input.add_new' ).val('');
+
+ $document.trigger( 'widget-added', [ widget ] );
+
+ /*
+ * Check if any part of the sidebar is visible in the viewport. If it is, don't scroll.
+ * Otherwise, scroll up to so the sidebar is in view.
+ *
+ * We do this by comparing the top and bottom, of the sidebar so see if they are within
+ * the bounds of the viewport.
+ */
+ viewportTop = $(window).scrollTop();
+ viewportBottom = viewportTop + $(window).height();
+ sidebarBounds = sidebar.offset();
+
+ sidebarBounds.bottom = sidebarBounds.top + sidebar.outerHeight();
+
+ if ( viewportTop > sidebarBounds.bottom || viewportBottom < sidebarBounds.top ) {
+ $( 'html, body' ).animate({
+ scrollTop: sidebarBounds.top - 130
+ }, 200 );
+ }
+
+ window.setTimeout( function() {
+ // Cannot use a callback in the animation above as it fires twice,
+ // have to queue this "by hand".
+ widget.find( '.widget-title' ).trigger('click');
+ // At the end of the animation, announce the widget has been added.
+ window.wp.a11y.speak( wpWidgets.l10n.widgetAdded, 'assertive' );
+ }, 250 );
+ },
+
+ closeChooser: function() {
+ var self = this,
+ widgetInQuestion = $( '#available-widgets .widget-in-question' );
+
+ $( '.widgets-chooser' ).slideUp( 200, function() {
+ $( '#wpbody-content' ).append( this );
+ self.clearWidgetSelection();
+ // Move focus back to the toggle button.
+ widgetInQuestion.find( '.widget-action' ).attr( 'aria-expanded', 'false' ).focus();
+ });
+ },
+
+ clearWidgetSelection: function() {
+ $( '#widgets-left' ).removeClass( 'chooser' );
+ $( '.widget-in-question' ).removeClass( 'widget-in-question' );
+ },
+
+ /**
+ * Closes a Sidebar that was previously closed, but opened by dragging a Widget over it.
+ *
+ * Used when a Widget gets dragged in/out of the Sidebar and never dropped.
+ *
+ * @param {object} event jQuery event object.
+ */
+ closeSidebar: function( event ) {
+ this.hoveredSidebar
+ .addClass( 'closed' )
+ .find( '.handlediv' ).attr( 'aria-expanded', 'false' );
+
+ $( event.target ).css( 'min-height', '' );
+ this.hoveredSidebar = null;
+ }
+};
+
+$document.ready( function(){ wpWidgets.init(); } );
+
+})(jQuery);
diff --git a/www/crm/wp-admin/js/widgets.min.js b/www/crm/wp-admin/js/widgets.min.js
new file mode 100644
index 00000000..4e79bf77
--- /dev/null
+++ b/www/crm/wp-admin/js/widgets.min.js
@@ -0,0 +1 @@
+!function(a){var b=a(document);window.wpWidgets={hoveredSidebar:null,l10n:{save:"{save}",saved:"{saved}",saveAlert:"{saveAlert}",widgetAdded:"{widgetAdded}"},dirtyWidgets:{},init:function(){var c,d,e=this,f=a(".widgets-chooser"),g=f.find(".widgets-chooser-sidebars"),h=a("div.widgets-sortables"),i=!("undefined"==typeof isRtl||!isRtl);a("#widgets-right .sidebar-name").click(function(){var c=a(this),d=c.closest(".widgets-holder-wrap "),e=c.find(".handlediv");d.hasClass("closed")?(d.removeClass("closed"),e.attr("aria-expanded","true"),c.parent().sortable("refresh")):(d.addClass("closed"),e.attr("aria-expanded","false")),b.triggerHandler("wp-pin-menu")}).find(".handlediv").each(function(b){0!==b&&a(this).attr("aria-expanded","false")}),a(window).on("beforeunload.widgets",function(b){var c,d=[];if(a.each(e.dirtyWidgets,function(a,b){b&&d.push(a)}),0!==d.length)return c=a("#widgets-right").find(".widget").filter(function(){return-1!==d.indexOf(a(this).prop("id").replace(/^widget-\d+_/,""))}),c.each(function(){a(this).hasClass("open")||a(this).find(".widget-title-action:first").click()}),c.first().each(function(){this.scrollIntoViewIfNeeded?this.scrollIntoViewIfNeeded():this.scrollIntoView(),a(this).find(".widget-inside :tabbable:first").focus()}),b.returnValue=wpWidgets.l10n.saveAlert,b.returnValue}),a("#widgets-left .sidebar-name").click(function(){var c=a(this).closest(".widgets-holder-wrap");c.toggleClass("closed").find(".handlediv").attr("aria-expanded",!c.hasClass("closed")),b.triggerHandler("wp-pin-menu")}),a(document.body).bind("click.widgets-toggle",function(b){var c,d,f,g,h,j,k,l=a(b.target),m={"z-index":100},n=l.closest(".widget").find(".widget-top button.widget-action");l.parents(".widget-top").length&&!l.parents("#available-widgets").length?(c=l.closest("div.widget"),d=c.children(".widget-inside"),f=parseInt(c.find("input.widget-width").val(),10),g=c.parent().width(),k=d.find(".widget-id").val(),c.data("dirty-state-initialized")||(j=d.find(".widget-control-save"),j.prop("disabled",!0).val(wpWidgets.l10n.saved),d.on("input change",function(){e.dirtyWidgets[k]=!0,c.addClass("widget-dirty"),j.prop("disabled",!1).val(wpWidgets.l10n.save)}),c.data("dirty-state-initialized",!0)),d.is(":hidden")?(f>250&&f+30>g&&c.closest("div.widgets-sortables").length&&(h=c.closest("div.widget-liquid-right").length?i?"margin-right":"margin-left":i?"margin-left":"margin-right",m[h]=g-(f+30)+"px",c.css(m)),n.attr("aria-expanded","true"),d.slideDown("fast",function(){c.addClass("open")})):(n.attr("aria-expanded","false"),d.slideUp("fast",function(){c.attr("style",""),c.removeClass("open")}))):l.hasClass("widget-control-save")?(wpWidgets.save(l.closest("div.widget"),0,1,0),b.preventDefault()):l.hasClass("widget-control-remove")?wpWidgets.save(l.closest("div.widget"),1,1,0):l.hasClass("widget-control-close")?(c=l.closest("div.widget"),c.removeClass("open"),n.attr("aria-expanded","false"),wpWidgets.close(c)):"inactive-widgets-control-remove"===l.attr("id")&&(wpWidgets.removeInactiveWidgets(),b.preventDefault())}),h.children(".widget").each(function(){var b=a(this);wpWidgets.appendTitle(this),b.find("p.widget-error").length&&b.find(".widget-action").trigger("click").attr("aria-expanded","true")}),a("#widget-list").children(".widget").draggable({connectToSortable:"div.widgets-sortables",handle:"> .widget-top > .widget-title",distance:2,helper:"clone",zIndex:100,containment:"#wpwrap",refreshPositions:!0,start:function(b,c){var f=a(this).find(".widgets-chooser");c.helper.find("div.widget-description").hide(),d=this.id,f.length&&(a("#wpbody-content").append(f.hide()),c.helper.find(".widgets-chooser").remove(),e.clearWidgetSelection())},stop:function(){c&&a(c).hide(),c=""}}),h.droppable({tolerance:"intersect",over:function(b){var c=a(b.target).parent();wpWidgets.hoveredSidebar&&!c.is(wpWidgets.hoveredSidebar)&&wpWidgets.closeSidebar(b),c.hasClass("closed")&&(wpWidgets.hoveredSidebar=c,c.removeClass("closed").find(".handlediv").attr("aria-expanded","true")),a(this).sortable("refresh")},out:function(a){wpWidgets.hoveredSidebar&&wpWidgets.closeSidebar(a)}}),h.sortable({placeholder:"widget-placeholder",items:"> .widget",handle:"> .widget-top > .widget-title",cursor:"move",distance:2,containment:"#wpwrap",tolerance:"pointer",refreshPositions:!0,start:function(b,c){var d,e=a(this),f=e.parent(),g=c.item.children(".widget-inside");"block"===g.css("display")&&(c.item.removeClass("open"),c.item.find(".widget-top button.widget-action").attr("aria-expanded","false"),g.hide(),a(this).sortable("refreshPositions")),f.hasClass("closed")||(d=c.item.hasClass("ui-draggable")?e.height():1+e.height(),e.css("min-height",d+"px"))},stop:function(e,f){var g,h,i,j,k,l,m=f.item,n=d;return wpWidgets.hoveredSidebar=null,m.hasClass("deleting")?(wpWidgets.save(m,1,0,1),void m.remove()):(g=m.find("input.add_new").val(),h=m.find("input.multi_number").val(),m.attr("style","").removeClass("ui-draggable"),d="",g&&("multi"===g?(m.html(m.html().replace(/<[^<>]+>/g,function(a){return a.replace(/__i__|%i%/g,h)})),m.attr("id",n.replace("__i__",h)),h++,a("div#"+n).find("input.multi_number").val(h)):"single"===g&&(m.attr("id","new-"+n),c="div#"+n),wpWidgets.save(m,0,0,1),m.find("input.add_new").val(""),b.trigger("widget-added",[m])),i=m.parent(),i.parent().hasClass("closed")&&(i.parent().removeClass("closed").find(".handlediv").attr("aria-expanded","true"),j=i.children(".widget"),j.length>1&&(k=j.get(0),l=m.get(0),k.id&&l.id&&k.id!==l.id&&a(k).before(m))),void(g?m.find(".widget-action").trigger("click"):wpWidgets.saveOrder(i.attr("id"))))},activate:function(){a(this).parent().addClass("widget-hover")},deactivate:function(){a(this).css("min-height","").parent().removeClass("widget-hover")},receive:function(b,c){var d=a(c.sender);return this.id.indexOf("orphaned_widgets")>-1?void d.sortable("cancel"):void(d.attr("id").indexOf("orphaned_widgets")>-1&&!d.children(".widget").length&&d.parents(".orphan-sidebar").slideUp(400,function(){a(this).remove()}))}}).sortable("option","connectWith","div.widgets-sortables"),a("#available-widgets").droppable({tolerance:"pointer",accept:function(b){return"widget-list"!==a(b).parent().attr("id")},drop:function(b,c){c.draggable.addClass("deleting"),a("#removing-widget").hide().children("span").empty()},over:function(b,c){c.draggable.addClass("deleting"),a("div.widget-placeholder").hide(),c.draggable.hasClass("ui-sortable-helper")&&a("#removing-widget").show().children("span").html(c.draggable.find("div.widget-title").children("h3").html())},out:function(b,c){c.draggable.removeClass("deleting"),a("div.widget-placeholder").show(),a("#removing-widget").hide().children("span").empty()}}),a("#widgets-right .widgets-holder-wrap").each(function(b,c){var d=a(c),e=d.find(".sidebar-name h2").text(),f=d.find(".sidebar-name").data("add-to"),h=d.find(".widgets-sortables").attr("id"),i=a("<li>"),j=a("<button>",{type:"button","aria-pressed":"false","class":"widgets-chooser-button","aria-label":f}).text(a.trim(e));i.append(j),0===b&&(i.addClass("widgets-chooser-selected"),j.attr("aria-pressed","true")),g.append(i),i.data("sidebarId",h)}),a("#available-widgets .widget .widget-top").on("click.widgets-chooser",function(){var b=a(this).closest(".widget"),c=a(this).find(".widget-action"),d=g.find(".widgets-chooser-button");b.hasClass("widget-in-question")||a("#widgets-left").hasClass("chooser")?(c.attr("aria-expanded","false"),e.closeChooser()):(e.clearWidgetSelection(),a("#widgets-left").addClass("chooser"),b.addClass("widget-in-question").children(".widget-description").after(f),f.slideDown(300,function(){c.attr("aria-expanded","true")}),d.on("click.widgets-chooser",function(){g.find(".widgets-chooser-selected").removeClass("widgets-chooser-selected"),d.attr("aria-pressed","false"),a(this).attr("aria-pressed","true").closest("li").addClass("widgets-chooser-selected")}))}),f.on("click.widgets-chooser",function(b){var c=a(b.target);c.hasClass("button-primary")?(e.addWidget(f),e.closeChooser()):c.hasClass("widgets-chooser-cancel")&&e.closeChooser()}).on("keyup.widgets-chooser",function(b){b.which===a.ui.keyCode.ESCAPE&&e.closeChooser()})},saveOrder:function(b){var c={action:"widgets-order",savewidgets:a("#_wpnonce_widgets").val(),sidebars:[]};b&&a("#"+b).find(".spinner:first").addClass("is-active"),a("div.widgets-sortables").each(function(){a(this).sortable&&(c["sidebars["+a(this).attr("id")+"]"]=a(this).sortable("toArray").join(","))}),a.post(ajaxurl,c,function(){a("#inactive-widgets-control-remove").prop("disabled",!a("#wp_inactive_widgets .widget").length),a(".spinner").removeClass("is-active")})},save:function(c,d,e,f){var g,h,i=this,j=c.closest("div.widgets-sortables").attr("id"),k=c.find("form"),l=c.find("input.add_new").val();(d||l||!k.prop("checkValidity")||k[0].checkValidity())&&(g=k.serialize(),c=a(c),a(".spinner",c).addClass("is-active"),h={action:"save-widget",savewidgets:a("#_wpnonce_widgets").val(),sidebar:j},d&&(h.delete_widget=1),g+="&"+a.param(h),a.post(ajaxurl,g,function(g){var h=a("input.widget-id",c).val();d?(a("input.widget_number",c).val()||a("#available-widgets").find("input.widget-id").each(function(){a(this).val()===h&&a(this).closest("div.widget").show()}),e?(f=0,c.slideUp("fast",function(){a(this).remove(),wpWidgets.saveOrder(),delete i.dirtyWidgets[h]})):(c.remove(),delete i.dirtyWidgets[h],"wp_inactive_widgets"===j&&a("#inactive-widgets-control-remove").prop("disabled",!a("#wp_inactive_widgets .widget").length))):(a(".spinner").removeClass("is-active"),g&&g.length>2&&(a("div.widget-content",c).html(g),wpWidgets.appendTitle(c),c.find(".widget-control-save").prop("disabled",!0).val(wpWidgets.l10n.saved),c.removeClass("widget-dirty"),delete i.dirtyWidgets[h],b.trigger("widget-updated",[c]),"wp_inactive_widgets"===j&&a("#inactive-widgets-control-remove").prop("disabled",!a("#wp_inactive_widgets .widget").length))),f&&wpWidgets.saveOrder()}))},removeInactiveWidgets:function(){var b,c,d=a(".remove-inactive-widgets"),e=this;a(".spinner",d).addClass("is-active"),b={action:"delete-inactive-widgets",removeinactivewidgets:a("#_wpnonce_remove_inactive_widgets").val()},c=a.param(b),a.post(ajaxurl,c,function(){a("#wp_inactive_widgets .widget").each(function(){var b=a(this);delete e.dirtyWidgets[b.find("input.widget-id").val()],b.remove()}),a("#inactive-widgets-control-remove").prop("disabled",!0),a(".spinner",d).removeClass("is-active")})},appendTitle:function(b){var c=a('input[id*="-title"]',b).val()||"";c&&(c=": "+c.replace(/<[^<>]+>/g,"").replace(/</g,"&lt;").replace(/>/g,"&gt;")),a(b).children(".widget-top").children(".widget-title").children().children(".in-widget-title").html(c)},close:function(a){a.children(".widget-inside").slideUp("fast",function(){a.attr("style","").find(".widget-top button.widget-action").attr("aria-expanded","false").focus()})},addWidget:function(c){var d,e,f,g,h,i,j,k=c.find(".widgets-chooser-selected").data("sidebarId"),l=a("#"+k);d=a("#available-widgets").find(".widget-in-question").clone(),e=d.attr("id"),f=d.find("input.add_new").val(),g=d.find("input.multi_number").val(),d.find(".widgets-chooser").remove(),"multi"===f?(d.html(d.html().replace(/<[^<>]+>/g,function(a){return a.replace(/__i__|%i%/g,g)})),d.attr("id",e.replace("__i__",g)),g++,a("#"+e).find("input.multi_number").val(g)):"single"===f&&(d.attr("id","new-"+e),a("#"+e).hide()),l.closest(".widgets-holder-wrap").removeClass("closed").find(".handlediv").attr("aria-expanded","true"),l.append(d),l.sortable("refresh"),wpWidgets.save(d,0,0,1),d.find("input.add_new").val(""),b.trigger("widget-added",[d]),h=a(window).scrollTop(),i=h+a(window).height(),j=l.offset(),j.bottom=j.top+l.outerHeight(),(h>j.bottom||i<j.top)&&a("html, body").animate({scrollTop:j.top-130},200),window.setTimeout(function(){d.find(".widget-title").trigger("click"),window.wp.a11y.speak(wpWidgets.l10n.widgetAdded,"assertive")},250)},closeChooser:function(){var b=this,c=a("#available-widgets .widget-in-question");a(".widgets-chooser").slideUp(200,function(){a("#wpbody-content").append(this),b.clearWidgetSelection(),c.find(".widget-action").attr("aria-expanded","false").focus()})},clearWidgetSelection:function(){a("#widgets-left").removeClass("chooser"),a(".widget-in-question").removeClass("widget-in-question")},closeSidebar:function(b){this.hoveredSidebar.addClass("closed").find(".handlediv").attr("aria-expanded","false"),a(b.target).css("min-height",""),this.hoveredSidebar=null}},b.ready(function(){wpWidgets.init()})}(jQuery); \ No newline at end of file
diff --git a/www/crm/wp-admin/js/widgets/custom-html-widgets.js b/www/crm/wp-admin/js/widgets/custom-html-widgets.js
new file mode 100644
index 00000000..93aa901c
--- /dev/null
+++ b/www/crm/wp-admin/js/widgets/custom-html-widgets.js
@@ -0,0 +1,456 @@
+/**
+ * @output wp-admin/js/widgets/custom-html-widgets.js
+ */
+
+/* global wp */
+/* eslint consistent-this: [ "error", "control" ] */
+/* eslint no-magic-numbers: ["error", { "ignore": [0,1,-1] }] */
+
+/**
+ * @namespace wp.customHtmlWidget
+ * @memberOf wp
+ */
+wp.customHtmlWidgets = ( function( $ ) {
+ 'use strict';
+
+ var component = {
+ idBases: [ 'custom_html' ],
+ codeEditorSettings: {},
+ l10n: {
+ errorNotice: {
+ singular: '',
+ plural: ''
+ }
+ }
+ };
+
+ component.CustomHtmlWidgetControl = Backbone.View.extend(/** @lends wp.customHtmlWidgets.CustomHtmlWidgetControl.prototype */{
+
+ /**
+ * View events.
+ *
+ * @type {Object}
+ */
+ events: {},
+
+ /**
+ * Text widget control.
+ *
+ * @constructs wp.customHtmlWidgets.CustomHtmlWidgetControl
+ * @augments Backbone.View
+ * @abstract
+ *
+ * @param {Object} options - Options.
+ * @param {jQuery} options.el - Control field container element.
+ * @param {jQuery} options.syncContainer - Container element where fields are synced for the server.
+ *
+ * @returns {void}
+ */
+ initialize: function initialize( options ) {
+ var control = this;
+
+ if ( ! options.el ) {
+ throw new Error( 'Missing options.el' );
+ }
+ if ( ! options.syncContainer ) {
+ throw new Error( 'Missing options.syncContainer' );
+ }
+
+ Backbone.View.prototype.initialize.call( control, options );
+ control.syncContainer = options.syncContainer;
+ control.widgetIdBase = control.syncContainer.parent().find( '.id_base' ).val();
+ control.widgetNumber = control.syncContainer.parent().find( '.widget_number' ).val();
+ control.customizeSettingId = 'widget_' + control.widgetIdBase + '[' + String( control.widgetNumber ) + ']';
+
+ control.$el.addClass( 'custom-html-widget-fields' );
+ control.$el.html( wp.template( 'widget-custom-html-control-fields' )( { codeEditorDisabled: component.codeEditorSettings.disabled } ) );
+
+ control.errorNoticeContainer = control.$el.find( '.code-editor-error-container' );
+ control.currentErrorAnnotations = [];
+ control.saveButton = control.syncContainer.add( control.syncContainer.parent().find( '.widget-control-actions' ) ).find( '.widget-control-save, #savewidget' );
+ control.saveButton.addClass( 'custom-html-widget-save-button' ); // To facilitate style targeting.
+
+ control.fields = {
+ title: control.$el.find( '.title' ),
+ content: control.$el.find( '.content' )
+ };
+
+ // Sync input fields to hidden sync fields which actually get sent to the server.
+ _.each( control.fields, function( fieldInput, fieldName ) {
+ fieldInput.on( 'input change', function updateSyncField() {
+ var syncInput = control.syncContainer.find( '.sync-input.' + fieldName );
+ if ( syncInput.val() !== fieldInput.val() ) {
+ syncInput.val( fieldInput.val() );
+ syncInput.trigger( 'change' );
+ }
+ });
+
+ // Note that syncInput cannot be re-used because it will be destroyed with each widget-updated event.
+ fieldInput.val( control.syncContainer.find( '.sync-input.' + fieldName ).val() );
+ });
+ },
+
+ /**
+ * Update input fields from the sync fields.
+ *
+ * This function is called at the widget-updated and widget-synced events.
+ * A field will only be updated if it is not currently focused, to avoid
+ * overwriting content that the user is entering.
+ *
+ * @returns {void}
+ */
+ updateFields: function updateFields() {
+ var control = this, syncInput;
+
+ if ( ! control.fields.title.is( document.activeElement ) ) {
+ syncInput = control.syncContainer.find( '.sync-input.title' );
+ control.fields.title.val( syncInput.val() );
+ }
+
+ /*
+ * Prevent updating content when the editor is focused or if there are current error annotations,
+ * to prevent the editor's contents from getting sanitized as soon as a user removes focus from
+ * the editor. This is particularly important for users who cannot unfiltered_html.
+ */
+ control.contentUpdateBypassed = control.fields.content.is( document.activeElement ) || control.editor && control.editor.codemirror.state.focused || 0 !== control.currentErrorAnnotations.length;
+ if ( ! control.contentUpdateBypassed ) {
+ syncInput = control.syncContainer.find( '.sync-input.content' );
+ control.fields.content.val( syncInput.val() );
+ }
+ },
+
+ /**
+ * Show linting error notice.
+ *
+ * @param {Array} errorAnnotations - Error annotations.
+ * @returns {void}
+ */
+ updateErrorNotice: function( errorAnnotations ) {
+ var control = this, errorNotice, message = '', customizeSetting;
+
+ if ( 1 === errorAnnotations.length ) {
+ message = component.l10n.errorNotice.singular.replace( '%d', '1' );
+ } else if ( errorAnnotations.length > 1 ) {
+ message = component.l10n.errorNotice.plural.replace( '%d', String( errorAnnotations.length ) );
+ }
+
+ if ( control.fields.content[0].setCustomValidity ) {
+ control.fields.content[0].setCustomValidity( message );
+ }
+
+ if ( wp.customize && wp.customize.has( control.customizeSettingId ) ) {
+ customizeSetting = wp.customize( control.customizeSettingId );
+ customizeSetting.notifications.remove( 'htmlhint_error' );
+ if ( 0 !== errorAnnotations.length ) {
+ customizeSetting.notifications.add( 'htmlhint_error', new wp.customize.Notification( 'htmlhint_error', {
+ message: message,
+ type: 'error'
+ } ) );
+ }
+ } else if ( 0 !== errorAnnotations.length ) {
+ errorNotice = $( '<div class="inline notice notice-error notice-alt"></div>' );
+ errorNotice.append( $( '<p></p>', {
+ text: message
+ } ) );
+ control.errorNoticeContainer.empty();
+ control.errorNoticeContainer.append( errorNotice );
+ control.errorNoticeContainer.slideDown( 'fast' );
+ wp.a11y.speak( message );
+ } else {
+ control.errorNoticeContainer.slideUp( 'fast' );
+ }
+ },
+
+ /**
+ * Initialize editor.
+ *
+ * @returns {void}
+ */
+ initializeEditor: function initializeEditor() {
+ var control = this, settings;
+
+ if ( component.codeEditorSettings.disabled ) {
+ return;
+ }
+
+ settings = _.extend( {}, component.codeEditorSettings, {
+
+ /**
+ * Handle tabbing to the field before the editor.
+ *
+ * @ignore
+ *
+ * @returns {void}
+ */
+ onTabPrevious: function onTabPrevious() {
+ control.fields.title.focus();
+ },
+
+ /**
+ * Handle tabbing to the field after the editor.
+ *
+ * @ignore
+ *
+ * @returns {void}
+ */
+ onTabNext: function onTabNext() {
+ var tabbables = control.syncContainer.add( control.syncContainer.parent().find( '.widget-position, .widget-control-actions' ) ).find( ':tabbable' );
+ tabbables.first().focus();
+ },
+
+ /**
+ * Disable save button and store linting errors for use in updateFields.
+ *
+ * @ignore
+ *
+ * @param {Array} errorAnnotations - Error notifications.
+ * @returns {void}
+ */
+ onChangeLintingErrors: function onChangeLintingErrors( errorAnnotations ) {
+ control.currentErrorAnnotations = errorAnnotations;
+ },
+
+ /**
+ * Update error notice.
+ *
+ * @ignore
+ *
+ * @param {Array} errorAnnotations - Error annotations.
+ * @returns {void}
+ */
+ onUpdateErrorNotice: function onUpdateErrorNotice( errorAnnotations ) {
+ control.saveButton.toggleClass( 'validation-blocked disabled', errorAnnotations.length > 0 );
+ control.updateErrorNotice( errorAnnotations );
+ }
+ });
+
+ control.editor = wp.codeEditor.initialize( control.fields.content, settings );
+
+ // Improve the editor accessibility.
+ $( control.editor.codemirror.display.lineDiv )
+ .attr({
+ role: 'textbox',
+ 'aria-multiline': 'true',
+ 'aria-labelledby': control.fields.content[0].id + '-label',
+ 'aria-describedby': 'editor-keyboard-trap-help-1 editor-keyboard-trap-help-2 editor-keyboard-trap-help-3 editor-keyboard-trap-help-4'
+ });
+
+ // Focus the editor when clicking on its label.
+ $( '#' + control.fields.content[0].id + '-label' ).on( 'click', function() {
+ control.editor.codemirror.focus();
+ });
+
+ control.fields.content.on( 'change', function() {
+ if ( this.value !== control.editor.codemirror.getValue() ) {
+ control.editor.codemirror.setValue( this.value );
+ }
+ });
+ control.editor.codemirror.on( 'change', function() {
+ var value = control.editor.codemirror.getValue();
+ if ( value !== control.fields.content.val() ) {
+ control.fields.content.val( value ).trigger( 'change' );
+ }
+ });
+
+ // Make sure the editor gets updated if the content was updated on the server (sanitization) but not updated in the editor since it was focused.
+ control.editor.codemirror.on( 'blur', function() {
+ if ( control.contentUpdateBypassed ) {
+ control.syncContainer.find( '.sync-input.content' ).trigger( 'change' );
+ }
+ });
+
+ // Prevent hitting Esc from collapsing the widget control.
+ if ( wp.customize ) {
+ control.editor.codemirror.on( 'keydown', function onKeydown( codemirror, event ) {
+ var escKeyCode = 27;
+ if ( escKeyCode === event.keyCode ) {
+ event.stopPropagation();
+ }
+ });
+ }
+ }
+ });
+
+ /**
+ * Mapping of widget ID to instances of CustomHtmlWidgetControl subclasses.
+ *
+ * @alias wp.customHtmlWidgets.widgetControls
+ *
+ * @type {Object.<string, wp.textWidgets.CustomHtmlWidgetControl>}
+ */
+ component.widgetControls = {};
+
+ /**
+ * Handle widget being added or initialized for the first time at the widget-added event.
+ *
+ * @alias wp.customHtmlWidgets.handleWidgetAdded
+ *
+ * @param {jQuery.Event} event - Event.
+ * @param {jQuery} widgetContainer - Widget container element.
+ *
+ * @returns {void}
+ */
+ component.handleWidgetAdded = function handleWidgetAdded( event, widgetContainer ) {
+ var widgetForm, idBase, widgetControl, widgetId, animatedCheckDelay = 50, renderWhenAnimationDone, fieldContainer, syncContainer;
+ widgetForm = widgetContainer.find( '> .widget-inside > .form, > .widget-inside > form' ); // Note: '.form' appears in the customizer, whereas 'form' on the widgets admin screen.
+
+ idBase = widgetForm.find( '> .id_base' ).val();
+ if ( -1 === component.idBases.indexOf( idBase ) ) {
+ return;
+ }
+
+ // Prevent initializing already-added widgets.
+ widgetId = widgetForm.find( '.widget-id' ).val();
+ if ( component.widgetControls[ widgetId ] ) {
+ return;
+ }
+
+ /*
+ * Create a container element for the widget control fields.
+ * This is inserted into the DOM immediately before the the .widget-content
+ * element because the contents of this element are essentially "managed"
+ * by PHP, where each widget update cause the entire element to be emptied
+ * and replaced with the rendered output of WP_Widget::form() which is
+ * sent back in Ajax request made to save/update the widget instance.
+ * To prevent a "flash of replaced DOM elements and re-initialized JS
+ * components", the JS template is rendered outside of the normal form
+ * container.
+ */
+ fieldContainer = $( '<div></div>' );
+ syncContainer = widgetContainer.find( '.widget-content:first' );
+ syncContainer.before( fieldContainer );
+
+ widgetControl = new component.CustomHtmlWidgetControl({
+ el: fieldContainer,
+ syncContainer: syncContainer
+ });
+
+ component.widgetControls[ widgetId ] = widgetControl;
+
+ /*
+ * Render the widget once the widget parent's container finishes animating,
+ * as the widget-added event fires with a slideDown of the container.
+ * This ensures that the textarea is visible and the editor can be initialized.
+ */
+ renderWhenAnimationDone = function() {
+ if ( ! ( wp.customize ? widgetContainer.parent().hasClass( 'expanded' ) : widgetContainer.hasClass( 'open' ) ) ) { // Core merge: The wp.customize condition can be eliminated with this change being in core: https://github.com/xwp/wordpress-develop/pull/247/commits/5322387d
+ setTimeout( renderWhenAnimationDone, animatedCheckDelay );
+ } else {
+ widgetControl.initializeEditor();
+ }
+ };
+ renderWhenAnimationDone();
+ };
+
+ /**
+ * Setup widget in accessibility mode.
+ *
+ * @alias wp.customHtmlWidgets.setupAccessibleMode
+ *
+ * @returns {void}
+ */
+ component.setupAccessibleMode = function setupAccessibleMode() {
+ var widgetForm, idBase, widgetControl, fieldContainer, syncContainer;
+ widgetForm = $( '.editwidget > form' );
+ if ( 0 === widgetForm.length ) {
+ return;
+ }
+
+ idBase = widgetForm.find( '> .widget-control-actions > .id_base' ).val();
+ if ( -1 === component.idBases.indexOf( idBase ) ) {
+ return;
+ }
+
+ fieldContainer = $( '<div></div>' );
+ syncContainer = widgetForm.find( '> .widget-inside' );
+ syncContainer.before( fieldContainer );
+
+ widgetControl = new component.CustomHtmlWidgetControl({
+ el: fieldContainer,
+ syncContainer: syncContainer
+ });
+
+ widgetControl.initializeEditor();
+ };
+
+ /**
+ * Sync widget instance data sanitized from server back onto widget model.
+ *
+ * This gets called via the 'widget-updated' event when saving a widget from
+ * the widgets admin screen and also via the 'widget-synced' event when making
+ * a change to a widget in the customizer.
+ *
+ * @alias wp.customHtmlWidgets.handleWidgetUpdated
+ *
+ * @param {jQuery.Event} event - Event.
+ * @param {jQuery} widgetContainer - Widget container element.
+ * @returns {void}
+ */
+ component.handleWidgetUpdated = function handleWidgetUpdated( event, widgetContainer ) {
+ var widgetForm, widgetId, widgetControl, idBase;
+ widgetForm = widgetContainer.find( '> .widget-inside > .form, > .widget-inside > form' );
+
+ idBase = widgetForm.find( '> .id_base' ).val();
+ if ( -1 === component.idBases.indexOf( idBase ) ) {
+ return;
+ }
+
+ widgetId = widgetForm.find( '> .widget-id' ).val();
+ widgetControl = component.widgetControls[ widgetId ];
+ if ( ! widgetControl ) {
+ return;
+ }
+
+ widgetControl.updateFields();
+ };
+
+ /**
+ * Initialize functionality.
+ *
+ * This function exists to prevent the JS file from having to boot itself.
+ * When WordPress enqueues this script, it should have an inline script
+ * attached which calls wp.textWidgets.init().
+ *
+ * @alias wp.customHtmlWidgets.init
+ *
+ * @param {object} settings - Options for code editor, exported from PHP.
+ *
+ * @returns {void}
+ */
+ component.init = function init( settings ) {
+ var $document = $( document );
+ _.extend( component.codeEditorSettings, settings );
+
+ $document.on( 'widget-added', component.handleWidgetAdded );
+ $document.on( 'widget-synced widget-updated', component.handleWidgetUpdated );
+
+ /*
+ * Manually trigger widget-added events for media widgets on the admin
+ * screen once they are expanded. The widget-added event is not triggered
+ * for each pre-existing widget on the widgets admin screen like it is
+ * on the customizer. Likewise, the customizer only triggers widget-added
+ * when the widget is expanded to just-in-time construct the widget form
+ * when it is actually going to be displayed. So the following implements
+ * the same for the widgets admin screen, to invoke the widget-added
+ * handler when a pre-existing media widget is expanded.
+ */
+ $( function initializeExistingWidgetContainers() {
+ var widgetContainers;
+ if ( 'widgets' !== window.pagenow ) {
+ return;
+ }
+ widgetContainers = $( '.widgets-holder-wrap:not(#available-widgets)' ).find( 'div.widget' );
+ widgetContainers.one( 'click.toggle-widget-expanded', function toggleWidgetExpanded() {
+ var widgetContainer = $( this );
+ component.handleWidgetAdded( new jQuery.Event( 'widget-added' ), widgetContainer );
+ });
+
+ // Accessibility mode.
+ $( window ).on( 'load', function() {
+ component.setupAccessibleMode();
+ });
+ });
+ };
+
+ return component;
+})( jQuery );
diff --git a/www/crm/wp-admin/js/widgets/custom-html-widgets.min.js b/www/crm/wp-admin/js/widgets/custom-html-widgets.min.js
new file mode 100644
index 00000000..285d018d
--- /dev/null
+++ b/www/crm/wp-admin/js/widgets/custom-html-widgets.min.js
@@ -0,0 +1 @@
+wp.customHtmlWidgets=function(a){"use strict";var b={idBases:["custom_html"],codeEditorSettings:{},l10n:{errorNotice:{singular:"",plural:""}}};return b.CustomHtmlWidgetControl=Backbone.View.extend({events:{},initialize:function(a){var c=this;if(!a.el)throw new Error("Missing options.el");if(!a.syncContainer)throw new Error("Missing options.syncContainer");Backbone.View.prototype.initialize.call(c,a),c.syncContainer=a.syncContainer,c.widgetIdBase=c.syncContainer.parent().find(".id_base").val(),c.widgetNumber=c.syncContainer.parent().find(".widget_number").val(),c.customizeSettingId="widget_"+c.widgetIdBase+"["+String(c.widgetNumber)+"]",c.$el.addClass("custom-html-widget-fields"),c.$el.html(wp.template("widget-custom-html-control-fields")({codeEditorDisabled:b.codeEditorSettings.disabled})),c.errorNoticeContainer=c.$el.find(".code-editor-error-container"),c.currentErrorAnnotations=[],c.saveButton=c.syncContainer.add(c.syncContainer.parent().find(".widget-control-actions")).find(".widget-control-save, #savewidget"),c.saveButton.addClass("custom-html-widget-save-button"),c.fields={title:c.$el.find(".title"),content:c.$el.find(".content")},_.each(c.fields,function(a,b){a.on("input change",function(){var d=c.syncContainer.find(".sync-input."+b);d.val()!==a.val()&&(d.val(a.val()),d.trigger("change"))}),a.val(c.syncContainer.find(".sync-input."+b).val())})},updateFields:function(){var a,b=this;b.fields.title.is(document.activeElement)||(a=b.syncContainer.find(".sync-input.title"),b.fields.title.val(a.val())),b.contentUpdateBypassed=b.fields.content.is(document.activeElement)||b.editor&&b.editor.codemirror.state.focused||0!==b.currentErrorAnnotations.length,b.contentUpdateBypassed||(a=b.syncContainer.find(".sync-input.content"),b.fields.content.val(a.val()))},updateErrorNotice:function(c){var d,e,f=this,g="";1===c.length?g=b.l10n.errorNotice.singular.replace("%d","1"):c.length>1&&(g=b.l10n.errorNotice.plural.replace("%d",String(c.length))),f.fields.content[0].setCustomValidity&&f.fields.content[0].setCustomValidity(g),wp.customize&&wp.customize.has(f.customizeSettingId)?(e=wp.customize(f.customizeSettingId),e.notifications.remove("htmlhint_error"),0!==c.length&&e.notifications.add("htmlhint_error",new wp.customize.Notification("htmlhint_error",{message:g,type:"error"}))):0!==c.length?(d=a('<div class="inline notice notice-error notice-alt"></div>'),d.append(a("<p></p>",{text:g})),f.errorNoticeContainer.empty(),f.errorNoticeContainer.append(d),f.errorNoticeContainer.slideDown("fast"),wp.a11y.speak(g)):f.errorNoticeContainer.slideUp("fast")},initializeEditor:function(){var c,d=this;b.codeEditorSettings.disabled||(c=_.extend({},b.codeEditorSettings,{onTabPrevious:function(){d.fields.title.focus()},onTabNext:function(){var a=d.syncContainer.add(d.syncContainer.parent().find(".widget-position, .widget-control-actions")).find(":tabbable");a.first().focus()},onChangeLintingErrors:function(a){d.currentErrorAnnotations=a},onUpdateErrorNotice:function(a){d.saveButton.toggleClass("validation-blocked disabled",a.length>0),d.updateErrorNotice(a)}}),d.editor=wp.codeEditor.initialize(d.fields.content,c),a(d.editor.codemirror.display.lineDiv).attr({role:"textbox","aria-multiline":"true","aria-labelledby":d.fields.content[0].id+"-label","aria-describedby":"editor-keyboard-trap-help-1 editor-keyboard-trap-help-2 editor-keyboard-trap-help-3 editor-keyboard-trap-help-4"}),a("#"+d.fields.content[0].id+"-label").on("click",function(){d.editor.codemirror.focus()}),d.fields.content.on("change",function(){this.value!==d.editor.codemirror.getValue()&&d.editor.codemirror.setValue(this.value)}),d.editor.codemirror.on("change",function(){var a=d.editor.codemirror.getValue();a!==d.fields.content.val()&&d.fields.content.val(a).trigger("change")}),d.editor.codemirror.on("blur",function(){d.contentUpdateBypassed&&d.syncContainer.find(".sync-input.content").trigger("change")}),wp.customize&&d.editor.codemirror.on("keydown",function(a,b){var c=27;c===b.keyCode&&b.stopPropagation()}))}}),b.widgetControls={},b.handleWidgetAdded=function(c,d){var e,f,g,h,i,j,k,l=50;e=d.find("> .widget-inside > .form, > .widget-inside > form"),f=e.find("> .id_base").val(),-1!==b.idBases.indexOf(f)&&(h=e.find(".widget-id").val(),b.widgetControls[h]||(j=a("<div></div>"),k=d.find(".widget-content:first"),k.before(j),g=new b.CustomHtmlWidgetControl({el:j,syncContainer:k}),b.widgetControls[h]=g,(i=function(){(wp.customize?d.parent().hasClass("expanded"):d.hasClass("open"))?g.initializeEditor():setTimeout(i,l)})()))},b.setupAccessibleMode=function(){var c,d,e,f,g;c=a(".editwidget > form"),0!==c.length&&(d=c.find("> .widget-control-actions > .id_base").val(),-1!==b.idBases.indexOf(d)&&(f=a("<div></div>"),g=c.find("> .widget-inside"),g.before(f),e=new b.CustomHtmlWidgetControl({el:f,syncContainer:g}),e.initializeEditor()))},b.handleWidgetUpdated=function(a,c){var d,e,f,g;d=c.find("> .widget-inside > .form, > .widget-inside > form"),g=d.find("> .id_base").val(),-1!==b.idBases.indexOf(g)&&(e=d.find("> .widget-id").val(),f=b.widgetControls[e],f&&f.updateFields())},b.init=function(c){var d=a(document);_.extend(b.codeEditorSettings,c),d.on("widget-added",b.handleWidgetAdded),d.on("widget-synced widget-updated",b.handleWidgetUpdated),a(function(){var c;"widgets"===window.pagenow&&(c=a(".widgets-holder-wrap:not(#available-widgets)").find("div.widget"),c.one("click.toggle-widget-expanded",function(){var c=a(this);b.handleWidgetAdded(new jQuery.Event("widget-added"),c)}),a(window).on("load",function(){b.setupAccessibleMode()}))})},b}(jQuery); \ No newline at end of file
diff --git a/www/crm/wp-admin/js/widgets/media-audio-widget.js b/www/crm/wp-admin/js/widgets/media-audio-widget.js
new file mode 100644
index 00000000..e050c30a
--- /dev/null
+++ b/www/crm/wp-admin/js/widgets/media-audio-widget.js
@@ -0,0 +1,154 @@
+/**
+ * @output wp-admin/js/widgets/media-audio-widget.js
+ */
+
+/* eslint consistent-this: [ "error", "control" ] */
+(function( component ) {
+ 'use strict';
+
+ var AudioWidgetModel, AudioWidgetControl, AudioDetailsMediaFrame;
+
+ /**
+ * Custom audio details frame that removes the replace-audio state.
+ *
+ * @class wp.mediaWidgets.controlConstructors~AudioDetailsMediaFrame
+ * @augments wp.media.view.MediaFrame.AudioDetails
+ */
+ AudioDetailsMediaFrame = wp.media.view.MediaFrame.AudioDetails.extend(/** @lends wp.mediaWidgets.controlConstructors~AudioDetailsMediaFrame.prototype */{
+
+ /**
+ * Create the default states.
+ *
+ * @returns {void}
+ */
+ createStates: function createStates() {
+ this.states.add([
+ new wp.media.controller.AudioDetails({
+ media: this.media
+ }),
+
+ new wp.media.controller.MediaLibrary({
+ type: 'audio',
+ id: 'add-audio-source',
+ title: wp.media.view.l10n.audioAddSourceTitle,
+ toolbar: 'add-audio-source',
+ media: this.media,
+ menu: false
+ })
+ ]);
+ }
+ });
+
+ /**
+ * Audio widget model.
+ *
+ * See WP_Widget_Audio::enqueue_admin_scripts() for amending prototype from PHP exports.
+ *
+ * @class wp.mediaWidgets.modelConstructors.media_audio
+ * @augments wp.mediaWidgets.MediaWidgetModel
+ */
+ AudioWidgetModel = component.MediaWidgetModel.extend({});
+
+ /**
+ * Audio widget control.
+ *
+ * See WP_Widget_Audio::enqueue_admin_scripts() for amending prototype from PHP exports.
+ *
+ * @class wp.mediaWidgets.controlConstructors.media_audio
+ * @augments wp.mediaWidgets.MediaWidgetControl
+ */
+ AudioWidgetControl = component.MediaWidgetControl.extend(/** @lends wp.mediaWidgets.controlConstructors.media_audio.prototype */{
+
+ /**
+ * Show display settings.
+ *
+ * @type {boolean}
+ */
+ showDisplaySettings: false,
+
+ /**
+ * Map model props to media frame props.
+ *
+ * @param {Object} modelProps - Model props.
+ * @returns {Object} Media frame props.
+ */
+ mapModelToMediaFrameProps: function mapModelToMediaFrameProps( modelProps ) {
+ var control = this, mediaFrameProps;
+ mediaFrameProps = component.MediaWidgetControl.prototype.mapModelToMediaFrameProps.call( control, modelProps );
+ mediaFrameProps.link = 'embed';
+ return mediaFrameProps;
+ },
+
+ /**
+ * Render preview.
+ *
+ * @returns {void}
+ */
+ renderPreview: function renderPreview() {
+ var control = this, previewContainer, previewTemplate, attachmentId, attachmentUrl;
+ attachmentId = control.model.get( 'attachment_id' );
+ attachmentUrl = control.model.get( 'url' );
+
+ if ( ! attachmentId && ! attachmentUrl ) {
+ return;
+ }
+
+ previewContainer = control.$el.find( '.media-widget-preview' );
+ previewTemplate = wp.template( 'wp-media-widget-audio-preview' );
+
+ previewContainer.html( previewTemplate({
+ model: {
+ attachment_id: control.model.get( 'attachment_id' ),
+ src: attachmentUrl
+ },
+ error: control.model.get( 'error' )
+ }));
+ wp.mediaelement.initialize();
+ },
+
+ /**
+ * Open the media audio-edit frame to modify the selected item.
+ *
+ * @returns {void}
+ */
+ editMedia: function editMedia() {
+ var control = this, mediaFrame, metadata, updateCallback;
+
+ metadata = control.mapModelToMediaFrameProps( control.model.toJSON() );
+
+ // Set up the media frame.
+ mediaFrame = new AudioDetailsMediaFrame({
+ frame: 'audio',
+ state: 'audio-details',
+ metadata: metadata
+ });
+ wp.media.frame = mediaFrame;
+ mediaFrame.$el.addClass( 'media-widget' );
+
+ updateCallback = function( mediaFrameProps ) {
+
+ // Update cached attachment object to avoid having to re-fetch. This also triggers re-rendering of preview.
+ control.selectedAttachment.set( mediaFrameProps );
+
+ control.model.set( _.extend(
+ control.model.defaults(),
+ control.mapMediaToModelProps( mediaFrameProps ),
+ { error: false }
+ ) );
+ };
+
+ mediaFrame.state( 'audio-details' ).on( 'update', updateCallback );
+ mediaFrame.state( 'replace-audio' ).on( 'replace', updateCallback );
+ mediaFrame.on( 'close', function() {
+ mediaFrame.detach();
+ });
+
+ mediaFrame.open();
+ }
+ });
+
+ // Exports.
+ component.controlConstructors.media_audio = AudioWidgetControl;
+ component.modelConstructors.media_audio = AudioWidgetModel;
+
+})( wp.mediaWidgets );
diff --git a/www/crm/wp-admin/js/widgets/media-audio-widget.min.js b/www/crm/wp-admin/js/widgets/media-audio-widget.min.js
new file mode 100644
index 00000000..d816f516
--- /dev/null
+++ b/www/crm/wp-admin/js/widgets/media-audio-widget.min.js
@@ -0,0 +1 @@
+!function(a){"use strict";var b,c,d;d=wp.media.view.MediaFrame.AudioDetails.extend({createStates:function(){this.states.add([new wp.media.controller.AudioDetails({media:this.media}),new wp.media.controller.MediaLibrary({type:"audio",id:"add-audio-source",title:wp.media.view.l10n.audioAddSourceTitle,toolbar:"add-audio-source",media:this.media,menu:!1})])}}),b=a.MediaWidgetModel.extend({}),c=a.MediaWidgetControl.extend({showDisplaySettings:!1,mapModelToMediaFrameProps:function(b){var c,d=this;return c=a.MediaWidgetControl.prototype.mapModelToMediaFrameProps.call(d,b),c.link="embed",c},renderPreview:function(){var a,b,c,d,e=this;c=e.model.get("attachment_id"),d=e.model.get("url"),(c||d)&&(a=e.$el.find(".media-widget-preview"),b=wp.template("wp-media-widget-audio-preview"),a.html(b({model:{attachment_id:e.model.get("attachment_id"),src:d},error:e.model.get("error")})),wp.mediaelement.initialize())},editMedia:function(){var a,b,c,e=this;b=e.mapModelToMediaFrameProps(e.model.toJSON()),a=new d({frame:"audio",state:"audio-details",metadata:b}),wp.media.frame=a,a.$el.addClass("media-widget"),c=function(a){e.selectedAttachment.set(a),e.model.set(_.extend(e.model.defaults(),e.mapMediaToModelProps(a),{error:!1}))},a.state("audio-details").on("update",c),a.state("replace-audio").on("replace",c),a.on("close",function(){a.detach()}),a.open()}}),a.controlConstructors.media_audio=c,a.modelConstructors.media_audio=b}(wp.mediaWidgets); \ No newline at end of file
diff --git a/www/crm/wp-admin/js/widgets/media-gallery-widget.js b/www/crm/wp-admin/js/widgets/media-gallery-widget.js
new file mode 100644
index 00000000..45671e7e
--- /dev/null
+++ b/www/crm/wp-admin/js/widgets/media-gallery-widget.js
@@ -0,0 +1,341 @@
+/**
+ * @output wp-admin/js/widgets/media-gallery-widget.js
+ */
+
+/* eslint consistent-this: [ "error", "control" ] */
+(function( component ) {
+ 'use strict';
+
+ var GalleryWidgetModel, GalleryWidgetControl, GalleryDetailsMediaFrame;
+
+ /**
+ * Custom gallery details frame.
+ *
+ * @since 4.9.0
+ * @class wp.mediaWidgets~GalleryDetailsMediaFrame
+ * @augments wp.media.view.MediaFrame.Post
+ */
+ GalleryDetailsMediaFrame = wp.media.view.MediaFrame.Post.extend(/** @lends wp.mediaWidgets~GalleryDetailsMediaFrame.prototype */{
+
+ /**
+ * Create the default states.
+ *
+ * @since 4.9.0
+ * @returns {void}
+ */
+ createStates: function createStates() {
+ this.states.add([
+ new wp.media.controller.Library({
+ id: 'gallery',
+ title: wp.media.view.l10n.createGalleryTitle,
+ priority: 40,
+ toolbar: 'main-gallery',
+ filterable: 'uploaded',
+ multiple: 'add',
+ editable: true,
+
+ library: wp.media.query( _.defaults({
+ type: 'image'
+ }, this.options.library ) )
+ }),
+
+ // Gallery states.
+ new wp.media.controller.GalleryEdit({
+ library: this.options.selection,
+ editing: this.options.editing,
+ menu: 'gallery'
+ }),
+
+ new wp.media.controller.GalleryAdd()
+ ]);
+ }
+ } );
+
+ /**
+ * Gallery widget model.
+ *
+ * See WP_Widget_Gallery::enqueue_admin_scripts() for amending prototype from PHP exports.
+ *
+ * @since 4.9.0
+ *
+ * @class wp.mediaWidgets.modelConstructors.media_gallery
+ * @augments wp.mediaWidgets.MediaWidgetModel
+ */
+ GalleryWidgetModel = component.MediaWidgetModel.extend(/** @lends wp.mediaWidgets.modelConstructors.media_gallery.prototype */{} );
+
+ GalleryWidgetControl = component.MediaWidgetControl.extend(/** @lends wp.mediaWidgets.controlConstructors.media_gallery.prototype */{
+
+ /**
+ * View events.
+ *
+ * @since 4.9.0
+ * @type {object}
+ */
+ events: _.extend( {}, component.MediaWidgetControl.prototype.events, {
+ 'click .media-widget-gallery-preview': 'editMedia'
+ } ),
+
+ /**
+ * Gallery widget control.
+ *
+ * See WP_Widget_Gallery::enqueue_admin_scripts() for amending prototype from PHP exports.
+ *
+ * @constructs wp.mediaWidgets.controlConstructors.media_gallery
+ * @augments wp.mediaWidgets.MediaWidgetControl
+ *
+ * @since 4.9.0
+ * @param {Object} options - Options.
+ * @param {Backbone.Model} options.model - Model.
+ * @param {jQuery} options.el - Control field container element.
+ * @param {jQuery} options.syncContainer - Container element where fields are synced for the server.
+ * @returns {void}
+ */
+ initialize: function initialize( options ) {
+ var control = this;
+
+ component.MediaWidgetControl.prototype.initialize.call( control, options );
+
+ _.bindAll( control, 'updateSelectedAttachments', 'handleAttachmentDestroy' );
+ control.selectedAttachments = new wp.media.model.Attachments();
+ control.model.on( 'change:ids', control.updateSelectedAttachments );
+ control.selectedAttachments.on( 'change', control.renderPreview );
+ control.selectedAttachments.on( 'reset', control.renderPreview );
+ control.updateSelectedAttachments();
+
+ /*
+ * Refresh a Gallery widget partial when the user modifies one of the selected attachments.
+ * This ensures that when an attachment's caption is updated in the media modal the Gallery
+ * widget in the preview will then be refreshed to show the change. Normally doing this
+ * would not be necessary because all of the state should be contained inside the changeset,
+ * as everything done in the Customizer should not make a change to the site unless the
+ * changeset itself is published. Attachments are a current exception to this rule.
+ * For a proposal to include attachments in the customized state, see #37887.
+ */
+ if ( wp.customize && wp.customize.previewer ) {
+ control.selectedAttachments.on( 'change', function() {
+ wp.customize.previewer.send( 'refresh-widget-partial', control.model.get( 'widget_id' ) );
+ } );
+ }
+ },
+
+ /**
+ * Update the selected attachments if necessary.
+ *
+ * @since 4.9.0
+ * @returns {void}
+ */
+ updateSelectedAttachments: function updateSelectedAttachments() {
+ var control = this, newIds, oldIds, removedIds, addedIds, addedQuery;
+
+ newIds = control.model.get( 'ids' );
+ oldIds = _.pluck( control.selectedAttachments.models, 'id' );
+
+ removedIds = _.difference( oldIds, newIds );
+ _.each( removedIds, function( removedId ) {
+ control.selectedAttachments.remove( control.selectedAttachments.get( removedId ) );
+ });
+
+ addedIds = _.difference( newIds, oldIds );
+ if ( addedIds.length ) {
+ addedQuery = wp.media.query({
+ order: 'ASC',
+ orderby: 'post__in',
+ perPage: -1,
+ post__in: newIds,
+ query: true,
+ type: 'image'
+ });
+ addedQuery.more().done( function() {
+ control.selectedAttachments.reset( addedQuery.models );
+ });
+ }
+ },
+
+ /**
+ * Render preview.
+ *
+ * @since 4.9.0
+ * @returns {void}
+ */
+ renderPreview: function renderPreview() {
+ var control = this, previewContainer, previewTemplate, data;
+
+ previewContainer = control.$el.find( '.media-widget-preview' );
+ previewTemplate = wp.template( 'wp-media-widget-gallery-preview' );
+
+ data = control.previewTemplateProps.toJSON();
+ data.attachments = {};
+ control.selectedAttachments.each( function( attachment ) {
+ data.attachments[ attachment.id ] = attachment.toJSON();
+ } );
+
+ previewContainer.html( previewTemplate( data ) );
+ },
+
+ /**
+ * Determine whether there are selected attachments.
+ *
+ * @since 4.9.0
+ * @returns {boolean} Selected.
+ */
+ isSelected: function isSelected() {
+ var control = this;
+
+ if ( control.model.get( 'error' ) ) {
+ return false;
+ }
+
+ return control.model.get( 'ids' ).length > 0;
+ },
+
+ /**
+ * Open the media select frame to edit images.
+ *
+ * @since 4.9.0
+ * @returns {void}
+ */
+ editMedia: function editMedia() {
+ var control = this, selection, mediaFrame, mediaFrameProps;
+
+ selection = new wp.media.model.Selection( control.selectedAttachments.models, {
+ multiple: true
+ });
+
+ mediaFrameProps = control.mapModelToMediaFrameProps( control.model.toJSON() );
+ selection.gallery = new Backbone.Model( mediaFrameProps );
+ if ( mediaFrameProps.size ) {
+ control.displaySettings.set( 'size', mediaFrameProps.size );
+ }
+ mediaFrame = new GalleryDetailsMediaFrame({
+ frame: 'manage',
+ text: control.l10n.add_to_widget,
+ selection: selection,
+ mimeType: control.mime_type,
+ selectedDisplaySettings: control.displaySettings,
+ showDisplaySettings: control.showDisplaySettings,
+ metadata: mediaFrameProps,
+ editing: true,
+ multiple: true,
+ state: 'gallery-edit'
+ });
+ wp.media.frame = mediaFrame; // See wp.media().
+
+ // Handle selection of a media item.
+ mediaFrame.on( 'update', function onUpdate( newSelection ) {
+ var state = mediaFrame.state(), resultSelection;
+
+ resultSelection = newSelection || state.get( 'selection' );
+ if ( ! resultSelection ) {
+ return;
+ }
+
+ // Copy orderby_random from gallery state.
+ if ( resultSelection.gallery ) {
+ control.model.set( control.mapMediaToModelProps( resultSelection.gallery.toJSON() ) );
+ }
+
+ // Directly update selectedAttachments to prevent needing to do additional request.
+ control.selectedAttachments.reset( resultSelection.models );
+
+ // Update models in the widget instance.
+ control.model.set( {
+ ids: _.pluck( resultSelection.models, 'id' )
+ } );
+ } );
+
+ mediaFrame.$el.addClass( 'media-widget' );
+ mediaFrame.open();
+
+ if ( selection ) {
+ selection.on( 'destroy', control.handleAttachmentDestroy );
+ }
+ },
+
+ /**
+ * Open the media select frame to chose an item.
+ *
+ * @since 4.9.0
+ * @returns {void}
+ */
+ selectMedia: function selectMedia() {
+ var control = this, selection, mediaFrame, mediaFrameProps;
+ selection = new wp.media.model.Selection( control.selectedAttachments.models, {
+ multiple: true
+ });
+
+ mediaFrameProps = control.mapModelToMediaFrameProps( control.model.toJSON() );
+ if ( mediaFrameProps.size ) {
+ control.displaySettings.set( 'size', mediaFrameProps.size );
+ }
+ mediaFrame = new GalleryDetailsMediaFrame({
+ frame: 'select',
+ text: control.l10n.add_to_widget,
+ selection: selection,
+ mimeType: control.mime_type,
+ selectedDisplaySettings: control.displaySettings,
+ showDisplaySettings: control.showDisplaySettings,
+ metadata: mediaFrameProps,
+ state: 'gallery'
+ });
+ wp.media.frame = mediaFrame; // See wp.media().
+
+ // Handle selection of a media item.
+ mediaFrame.on( 'update', function onUpdate( newSelection ) {
+ var state = mediaFrame.state(), resultSelection;
+
+ resultSelection = newSelection || state.get( 'selection' );
+ if ( ! resultSelection ) {
+ return;
+ }
+
+ // Copy orderby_random from gallery state.
+ if ( resultSelection.gallery ) {
+ control.model.set( control.mapMediaToModelProps( resultSelection.gallery.toJSON() ) );
+ }
+
+ // Directly update selectedAttachments to prevent needing to do additional request.
+ control.selectedAttachments.reset( resultSelection.models );
+
+ // Update widget instance.
+ control.model.set( {
+ ids: _.pluck( resultSelection.models, 'id' )
+ } );
+ } );
+
+ mediaFrame.$el.addClass( 'media-widget' );
+ mediaFrame.open();
+
+ if ( selection ) {
+ selection.on( 'destroy', control.handleAttachmentDestroy );
+ }
+
+ /*
+ * Make sure focus is set inside of modal so that hitting Esc will close
+ * the modal and not inadvertently cause the widget to collapse in the customizer.
+ */
+ mediaFrame.$el.find( ':focusable:first' ).focus();
+ },
+
+ /**
+ * Clear the selected attachment when it is deleted in the media select frame.
+ *
+ * @since 4.9.0
+ * @param {wp.media.models.Attachment} attachment - Attachment.
+ * @returns {void}
+ */
+ handleAttachmentDestroy: function handleAttachmentDestroy( attachment ) {
+ var control = this;
+ control.model.set( {
+ ids: _.difference(
+ control.model.get( 'ids' ),
+ [ attachment.id ]
+ )
+ } );
+ }
+ } );
+
+ // Exports.
+ component.controlConstructors.media_gallery = GalleryWidgetControl;
+ component.modelConstructors.media_gallery = GalleryWidgetModel;
+
+})( wp.mediaWidgets );
diff --git a/www/crm/wp-admin/js/widgets/media-gallery-widget.min.js b/www/crm/wp-admin/js/widgets/media-gallery-widget.min.js
new file mode 100644
index 00000000..ec64b7d3
--- /dev/null
+++ b/www/crm/wp-admin/js/widgets/media-gallery-widget.min.js
@@ -0,0 +1 @@
+!function(a){"use strict";var b,c,d;d=wp.media.view.MediaFrame.Post.extend({createStates:function(){this.states.add([new wp.media.controller.Library({id:"gallery",title:wp.media.view.l10n.createGalleryTitle,priority:40,toolbar:"main-gallery",filterable:"uploaded",multiple:"add",editable:!0,library:wp.media.query(_.defaults({type:"image"},this.options.library))}),new wp.media.controller.GalleryEdit({library:this.options.selection,editing:this.options.editing,menu:"gallery"}),new wp.media.controller.GalleryAdd])}}),b=a.MediaWidgetModel.extend({}),c=a.MediaWidgetControl.extend({events:_.extend({},a.MediaWidgetControl.prototype.events,{"click .media-widget-gallery-preview":"editMedia"}),initialize:function(b){var c=this;a.MediaWidgetControl.prototype.initialize.call(c,b),_.bindAll(c,"updateSelectedAttachments","handleAttachmentDestroy"),c.selectedAttachments=new wp.media.model.Attachments,c.model.on("change:ids",c.updateSelectedAttachments),c.selectedAttachments.on("change",c.renderPreview),c.selectedAttachments.on("reset",c.renderPreview),c.updateSelectedAttachments(),wp.customize&&wp.customize.previewer&&c.selectedAttachments.on("change",function(){wp.customize.previewer.send("refresh-widget-partial",c.model.get("widget_id"))})},updateSelectedAttachments:function(){var a,b,c,d,e,f=this;a=f.model.get("ids"),b=_.pluck(f.selectedAttachments.models,"id"),c=_.difference(b,a),_.each(c,function(a){f.selectedAttachments.remove(f.selectedAttachments.get(a))}),d=_.difference(a,b),d.length&&(e=wp.media.query({order:"ASC",orderby:"post__in",perPage:-1,post__in:a,query:!0,type:"image"}),e.more().done(function(){f.selectedAttachments.reset(e.models)}))},renderPreview:function(){var a,b,c,d=this;a=d.$el.find(".media-widget-preview"),b=wp.template("wp-media-widget-gallery-preview"),c=d.previewTemplateProps.toJSON(),c.attachments={},d.selectedAttachments.each(function(a){c.attachments[a.id]=a.toJSON()}),a.html(b(c))},isSelected:function(){var a=this;return!a.model.get("error")&&a.model.get("ids").length>0},editMedia:function(){var a,b,c,e=this;a=new wp.media.model.Selection(e.selectedAttachments.models,{multiple:!0}),c=e.mapModelToMediaFrameProps(e.model.toJSON()),a.gallery=new Backbone.Model(c),c.size&&e.displaySettings.set("size",c.size),b=new d({frame:"manage",text:e.l10n.add_to_widget,selection:a,mimeType:e.mime_type,selectedDisplaySettings:e.displaySettings,showDisplaySettings:e.showDisplaySettings,metadata:c,editing:!0,multiple:!0,state:"gallery-edit"}),wp.media.frame=b,b.on("update",function(a){var c,d=b.state();c=a||d.get("selection"),c&&(c.gallery&&e.model.set(e.mapMediaToModelProps(c.gallery.toJSON())),e.selectedAttachments.reset(c.models),e.model.set({ids:_.pluck(c.models,"id")}))}),b.$el.addClass("media-widget"),b.open(),a&&a.on("destroy",e.handleAttachmentDestroy)},selectMedia:function(){var a,b,c,e=this;a=new wp.media.model.Selection(e.selectedAttachments.models,{multiple:!0}),c=e.mapModelToMediaFrameProps(e.model.toJSON()),c.size&&e.displaySettings.set("size",c.size),b=new d({frame:"select",text:e.l10n.add_to_widget,selection:a,mimeType:e.mime_type,selectedDisplaySettings:e.displaySettings,showDisplaySettings:e.showDisplaySettings,metadata:c,state:"gallery"}),wp.media.frame=b,b.on("update",function(a){var c,d=b.state();c=a||d.get("selection"),c&&(c.gallery&&e.model.set(e.mapMediaToModelProps(c.gallery.toJSON())),e.selectedAttachments.reset(c.models),e.model.set({ids:_.pluck(c.models,"id")}))}),b.$el.addClass("media-widget"),b.open(),a&&a.on("destroy",e.handleAttachmentDestroy),b.$el.find(":focusable:first").focus()},handleAttachmentDestroy:function(a){var b=this;b.model.set({ids:_.difference(b.model.get("ids"),[a.id])})}}),a.controlConstructors.media_gallery=c,a.modelConstructors.media_gallery=b}(wp.mediaWidgets); \ No newline at end of file
diff --git a/www/crm/wp-admin/js/widgets/media-image-widget.js b/www/crm/wp-admin/js/widgets/media-image-widget.js
new file mode 100644
index 00000000..3ea4f9be
--- /dev/null
+++ b/www/crm/wp-admin/js/widgets/media-image-widget.js
@@ -0,0 +1,170 @@
+/**
+ * @output wp-admin/js/widgets/media-image-widget.js
+ */
+
+/* eslint consistent-this: [ "error", "control" ] */
+(function( component, $ ) {
+ 'use strict';
+
+ var ImageWidgetModel, ImageWidgetControl;
+
+ /**
+ * Image widget model.
+ *
+ * See WP_Widget_Media_Image::enqueue_admin_scripts() for amending prototype from PHP exports.
+ *
+ * @class wp.mediaWidgets.modelConstructors.media_image
+ * @augments wp.mediaWidgets.MediaWidgetModel
+ */
+ ImageWidgetModel = component.MediaWidgetModel.extend({});
+
+ /**
+ * Image widget control.
+ *
+ * See WP_Widget_Media_Image::enqueue_admin_scripts() for amending prototype from PHP exports.
+ *
+ * @class wp.mediaWidgets.controlConstructors.media_audio
+ * @augments wp.mediaWidgets.MediaWidgetControl
+ */
+ ImageWidgetControl = component.MediaWidgetControl.extend(/** @lends wp.mediaWidgets.controlConstructors.media_image.prototype */{
+
+ /**
+ * View events.
+ *
+ * @type {object}
+ */
+ events: _.extend( {}, component.MediaWidgetControl.prototype.events, {
+ 'click .media-widget-preview.populated': 'editMedia'
+ } ),
+
+ /**
+ * Render preview.
+ *
+ * @returns {void}
+ */
+ renderPreview: function renderPreview() {
+ var control = this, previewContainer, previewTemplate, fieldsContainer, fieldsTemplate, linkInput;
+ if ( ! control.model.get( 'attachment_id' ) && ! control.model.get( 'url' ) ) {
+ return;
+ }
+
+ previewContainer = control.$el.find( '.media-widget-preview' );
+ previewTemplate = wp.template( 'wp-media-widget-image-preview' );
+ previewContainer.html( previewTemplate( control.previewTemplateProps.toJSON() ) );
+ previewContainer.addClass( 'populated' );
+
+ linkInput = control.$el.find( '.link' );
+ if ( ! linkInput.is( document.activeElement ) ) {
+ fieldsContainer = control.$el.find( '.media-widget-fields' );
+ fieldsTemplate = wp.template( 'wp-media-widget-image-fields' );
+ fieldsContainer.html( fieldsTemplate( control.previewTemplateProps.toJSON() ) );
+ }
+ },
+
+ /**
+ * Open the media image-edit frame to modify the selected item.
+ *
+ * @returns {void}
+ */
+ editMedia: function editMedia() {
+ var control = this, mediaFrame, updateCallback, defaultSync, metadata;
+
+ metadata = control.mapModelToMediaFrameProps( control.model.toJSON() );
+
+ // Needed or else none will not be selected if linkUrl is not also empty.
+ if ( 'none' === metadata.link ) {
+ metadata.linkUrl = '';
+ }
+
+ // Set up the media frame.
+ mediaFrame = wp.media({
+ frame: 'image',
+ state: 'image-details',
+ metadata: metadata
+ });
+ mediaFrame.$el.addClass( 'media-widget' );
+
+ updateCallback = function() {
+ var mediaProps, linkType;
+
+ // Update cached attachment object to avoid having to re-fetch. This also triggers re-rendering of preview.
+ mediaProps = mediaFrame.state().attributes.image.toJSON();
+ linkType = mediaProps.link;
+ mediaProps.link = mediaProps.linkUrl;
+ control.selectedAttachment.set( mediaProps );
+ control.displaySettings.set( 'link', linkType );
+
+ control.model.set( _.extend(
+ control.mapMediaToModelProps( mediaProps ),
+ { error: false }
+ ) );
+ };
+
+ mediaFrame.state( 'image-details' ).on( 'update', updateCallback );
+ mediaFrame.state( 'replace-image' ).on( 'replace', updateCallback );
+
+ // Disable syncing of attachment changes back to server. See <https://core.trac.wordpress.org/ticket/40403>.
+ defaultSync = wp.media.model.Attachment.prototype.sync;
+ wp.media.model.Attachment.prototype.sync = function rejectedSync() {
+ return $.Deferred().rejectWith( this ).promise();
+ };
+ mediaFrame.on( 'close', function onClose() {
+ mediaFrame.detach();
+ wp.media.model.Attachment.prototype.sync = defaultSync;
+ });
+
+ mediaFrame.open();
+ },
+
+ /**
+ * Get props which are merged on top of the model when an embed is chosen (as opposed to an attachment).
+ *
+ * @returns {Object} Reset/override props.
+ */
+ getEmbedResetProps: function getEmbedResetProps() {
+ return _.extend(
+ component.MediaWidgetControl.prototype.getEmbedResetProps.call( this ),
+ {
+ size: 'full',
+ width: 0,
+ height: 0
+ }
+ );
+ },
+
+ /**
+ * Get the instance props from the media selection frame.
+ *
+ * Prevent the image_title attribute from being initially set when adding an image from the media library.
+ *
+ * @param {wp.media.view.MediaFrame.Select} mediaFrame - Select frame.
+ * @returns {Object} Props.
+ */
+ getModelPropsFromMediaFrame: function getModelPropsFromMediaFrame( mediaFrame ) {
+ var control = this;
+ return _.omit(
+ component.MediaWidgetControl.prototype.getModelPropsFromMediaFrame.call( control, mediaFrame ),
+ 'image_title'
+ );
+ },
+
+ /**
+ * Map model props to preview template props.
+ *
+ * @returns {Object} Preview template props.
+ */
+ mapModelToPreviewTemplateProps: function mapModelToPreviewTemplateProps() {
+ var control = this, previewTemplateProps, url;
+ url = control.model.get( 'url' );
+ previewTemplateProps = component.MediaWidgetControl.prototype.mapModelToPreviewTemplateProps.call( control );
+ previewTemplateProps.currentFilename = url ? url.replace( /\?.*$/, '' ).replace( /^.+\//, '' ) : '';
+ previewTemplateProps.link_url = control.model.get( 'link_url' );
+ return previewTemplateProps;
+ }
+ });
+
+ // Exports.
+ component.controlConstructors.media_image = ImageWidgetControl;
+ component.modelConstructors.media_image = ImageWidgetModel;
+
+})( wp.mediaWidgets, jQuery );
diff --git a/www/crm/wp-admin/js/widgets/media-image-widget.min.js b/www/crm/wp-admin/js/widgets/media-image-widget.min.js
new file mode 100644
index 00000000..901d5c41
--- /dev/null
+++ b/www/crm/wp-admin/js/widgets/media-image-widget.min.js
@@ -0,0 +1 @@
+!function(a,b){"use strict";var c,d;c=a.MediaWidgetModel.extend({}),d=a.MediaWidgetControl.extend({events:_.extend({},a.MediaWidgetControl.prototype.events,{"click .media-widget-preview.populated":"editMedia"}),renderPreview:function(){var a,b,c,d,e,f=this;(f.model.get("attachment_id")||f.model.get("url"))&&(a=f.$el.find(".media-widget-preview"),b=wp.template("wp-media-widget-image-preview"),a.html(b(f.previewTemplateProps.toJSON())),a.addClass("populated"),e=f.$el.find(".link"),e.is(document.activeElement)||(c=f.$el.find(".media-widget-fields"),d=wp.template("wp-media-widget-image-fields"),c.html(d(f.previewTemplateProps.toJSON()))))},editMedia:function(){var a,c,d,e,f=this;e=f.mapModelToMediaFrameProps(f.model.toJSON()),"none"===e.link&&(e.linkUrl=""),a=wp.media({frame:"image",state:"image-details",metadata:e}),a.$el.addClass("media-widget"),c=function(){var b,c;b=a.state().attributes.image.toJSON(),c=b.link,b.link=b.linkUrl,f.selectedAttachment.set(b),f.displaySettings.set("link",c),f.model.set(_.extend(f.mapMediaToModelProps(b),{error:!1}))},a.state("image-details").on("update",c),a.state("replace-image").on("replace",c),d=wp.media.model.Attachment.prototype.sync,wp.media.model.Attachment.prototype.sync=function(){return b.Deferred().rejectWith(this).promise()},a.on("close",function(){a.detach(),wp.media.model.Attachment.prototype.sync=d}),a.open()},getEmbedResetProps:function(){return _.extend(a.MediaWidgetControl.prototype.getEmbedResetProps.call(this),{size:"full",width:0,height:0})},getModelPropsFromMediaFrame:function(b){var c=this;return _.omit(a.MediaWidgetControl.prototype.getModelPropsFromMediaFrame.call(c,b),"image_title")},mapModelToPreviewTemplateProps:function(){var b,c,d=this;return c=d.model.get("url"),b=a.MediaWidgetControl.prototype.mapModelToPreviewTemplateProps.call(d),b.currentFilename=c?c.replace(/\?.*$/,"").replace(/^.+\//,""):"",b.link_url=d.model.get("link_url"),b}}),a.controlConstructors.media_image=d,a.modelConstructors.media_image=c}(wp.mediaWidgets,jQuery); \ No newline at end of file
diff --git a/www/crm/wp-admin/js/widgets/media-video-widget.js b/www/crm/wp-admin/js/widgets/media-video-widget.js
new file mode 100644
index 00000000..b716cce4
--- /dev/null
+++ b/www/crm/wp-admin/js/widgets/media-video-widget.js
@@ -0,0 +1,256 @@
+/**
+ * @output wp-admin/js/widgets/media-video-widget.js
+ */
+
+/* eslint consistent-this: [ "error", "control" ] */
+(function( component ) {
+ 'use strict';
+
+ var VideoWidgetModel, VideoWidgetControl, VideoDetailsMediaFrame;
+
+ /**
+ * Custom video details frame that removes the replace-video state.
+ *
+ * @class wp.mediaWidgets.controlConstructors~VideoDetailsMediaFrame
+ * @augments wp.media.view.MediaFrame.VideoDetails
+ *
+ * @private
+ */
+ VideoDetailsMediaFrame = wp.media.view.MediaFrame.VideoDetails.extend(/** @lends wp.mediaWidgets.controlConstructors~VideoDetailsMediaFrame.prototype */{
+
+ /**
+ * Create the default states.
+ *
+ * @returns {void}
+ */
+ createStates: function createStates() {
+ this.states.add([
+ new wp.media.controller.VideoDetails({
+ media: this.media
+ }),
+
+ new wp.media.controller.MediaLibrary({
+ type: 'video',
+ id: 'add-video-source',
+ title: wp.media.view.l10n.videoAddSourceTitle,
+ toolbar: 'add-video-source',
+ media: this.media,
+ menu: false
+ }),
+
+ new wp.media.controller.MediaLibrary({
+ type: 'text',
+ id: 'add-track',
+ title: wp.media.view.l10n.videoAddTrackTitle,
+ toolbar: 'add-track',
+ media: this.media,
+ menu: 'video-details'
+ })
+ ]);
+ }
+ });
+
+ /**
+ * Video widget model.
+ *
+ * See WP_Widget_Video::enqueue_admin_scripts() for amending prototype from PHP exports.
+ *
+ * @class wp.mediaWidgets.modelConstructors.media_video
+ * @augments wp.mediaWidgets.MediaWidgetModel
+ */
+ VideoWidgetModel = component.MediaWidgetModel.extend({});
+
+ /**
+ * Video widget control.
+ *
+ * See WP_Widget_Video::enqueue_admin_scripts() for amending prototype from PHP exports.
+ *
+ * @class wp.mediaWidgets.controlConstructors.media_video
+ * @augments wp.mediaWidgets.MediaWidgetControl
+ */
+ VideoWidgetControl = component.MediaWidgetControl.extend(/** @lends wp.mediaWidgets.controlConstructors.media_video.prototype */{
+
+ /**
+ * Show display settings.
+ *
+ * @type {boolean}
+ */
+ showDisplaySettings: false,
+
+ /**
+ * Cache of oembed responses.
+ *
+ * @type {Object}
+ */
+ oembedResponses: {},
+
+ /**
+ * Map model props to media frame props.
+ *
+ * @param {Object} modelProps - Model props.
+ * @returns {Object} Media frame props.
+ */
+ mapModelToMediaFrameProps: function mapModelToMediaFrameProps( modelProps ) {
+ var control = this, mediaFrameProps;
+ mediaFrameProps = component.MediaWidgetControl.prototype.mapModelToMediaFrameProps.call( control, modelProps );
+ mediaFrameProps.link = 'embed';
+ return mediaFrameProps;
+ },
+
+ /**
+ * Fetches embed data for external videos.
+ *
+ * @returns {void}
+ */
+ fetchEmbed: function fetchEmbed() {
+ var control = this, url;
+ url = control.model.get( 'url' );
+
+ // If we already have a local cache of the embed response, return.
+ if ( control.oembedResponses[ url ] ) {
+ return;
+ }
+
+ // If there is an in-flight embed request, abort it.
+ if ( control.fetchEmbedDfd && 'pending' === control.fetchEmbedDfd.state() ) {
+ control.fetchEmbedDfd.abort();
+ }
+
+ control.fetchEmbedDfd = wp.apiRequest({
+ url: wp.media.view.settings.oEmbedProxyUrl,
+ data: {
+ url: control.model.get( 'url' ),
+ maxwidth: control.model.get( 'width' ),
+ maxheight: control.model.get( 'height' ),
+ discover: false
+ },
+ type: 'GET',
+ dataType: 'json',
+ context: control
+ });
+
+ control.fetchEmbedDfd.done( function( response ) {
+ control.oembedResponses[ url ] = response;
+ control.renderPreview();
+ });
+
+ control.fetchEmbedDfd.fail( function() {
+ control.oembedResponses[ url ] = null;
+ });
+ },
+
+ /**
+ * Whether a url is a supported external host.
+ *
+ * @deprecated since 4.9.
+ *
+ * @returns {boolean} Whether url is a supported video host.
+ */
+ isHostedVideo: function isHostedVideo() {
+ return true;
+ },
+
+ /**
+ * Render preview.
+ *
+ * @returns {void}
+ */
+ renderPreview: function renderPreview() {
+ var control = this, previewContainer, previewTemplate, attachmentId, attachmentUrl, poster, html = '', isOEmbed = false, mime, error, urlParser, matches;
+ attachmentId = control.model.get( 'attachment_id' );
+ attachmentUrl = control.model.get( 'url' );
+ error = control.model.get( 'error' );
+
+ if ( ! attachmentId && ! attachmentUrl ) {
+ return;
+ }
+
+ // Verify the selected attachment mime is supported.
+ mime = control.selectedAttachment.get( 'mime' );
+ if ( mime && attachmentId ) {
+ if ( ! _.contains( _.values( wp.media.view.settings.embedMimes ), mime ) ) {
+ error = 'unsupported_file_type';
+ }
+ } else if ( ! attachmentId ) {
+ urlParser = document.createElement( 'a' );
+ urlParser.href = attachmentUrl;
+ matches = urlParser.pathname.toLowerCase().match( /\.(\w+)$/ );
+ if ( matches ) {
+ if ( ! _.contains( _.keys( wp.media.view.settings.embedMimes ), matches[1] ) ) {
+ error = 'unsupported_file_type';
+ }
+ } else {
+ isOEmbed = true;
+ }
+ }
+
+ if ( isOEmbed ) {
+ control.fetchEmbed();
+ if ( control.oembedResponses[ attachmentUrl ] ) {
+ poster = control.oembedResponses[ attachmentUrl ].thumbnail_url;
+ html = control.oembedResponses[ attachmentUrl ].html.replace( /\swidth="\d+"/, ' width="100%"' ).replace( /\sheight="\d+"/, '' );
+ }
+ }
+
+ previewContainer = control.$el.find( '.media-widget-preview' );
+ previewTemplate = wp.template( 'wp-media-widget-video-preview' );
+
+ previewContainer.html( previewTemplate({
+ model: {
+ attachment_id: attachmentId,
+ html: html,
+ src: attachmentUrl,
+ poster: poster
+ },
+ is_oembed: isOEmbed,
+ error: error
+ }));
+ wp.mediaelement.initialize();
+ },
+
+ /**
+ * Open the media image-edit frame to modify the selected item.
+ *
+ * @returns {void}
+ */
+ editMedia: function editMedia() {
+ var control = this, mediaFrame, metadata, updateCallback;
+
+ metadata = control.mapModelToMediaFrameProps( control.model.toJSON() );
+
+ // Set up the media frame.
+ mediaFrame = new VideoDetailsMediaFrame({
+ frame: 'video',
+ state: 'video-details',
+ metadata: metadata
+ });
+ wp.media.frame = mediaFrame;
+ mediaFrame.$el.addClass( 'media-widget' );
+
+ updateCallback = function( mediaFrameProps ) {
+
+ // Update cached attachment object to avoid having to re-fetch. This also triggers re-rendering of preview.
+ control.selectedAttachment.set( mediaFrameProps );
+
+ control.model.set( _.extend(
+ _.omit( control.model.defaults(), 'title' ),
+ control.mapMediaToModelProps( mediaFrameProps ),
+ { error: false }
+ ) );
+ };
+
+ mediaFrame.state( 'video-details' ).on( 'update', updateCallback );
+ mediaFrame.state( 'replace-video' ).on( 'replace', updateCallback );
+ mediaFrame.on( 'close', function() {
+ mediaFrame.detach();
+ });
+
+ mediaFrame.open();
+ }
+ });
+
+ // Exports.
+ component.controlConstructors.media_video = VideoWidgetControl;
+ component.modelConstructors.media_video = VideoWidgetModel;
+
+})( wp.mediaWidgets );
diff --git a/www/crm/wp-admin/js/widgets/media-video-widget.min.js b/www/crm/wp-admin/js/widgets/media-video-widget.min.js
new file mode 100644
index 00000000..0df82322
--- /dev/null
+++ b/www/crm/wp-admin/js/widgets/media-video-widget.min.js
@@ -0,0 +1 @@
+!function(a){"use strict";var b,c,d;d=wp.media.view.MediaFrame.VideoDetails.extend({createStates:function(){this.states.add([new wp.media.controller.VideoDetails({media:this.media}),new wp.media.controller.MediaLibrary({type:"video",id:"add-video-source",title:wp.media.view.l10n.videoAddSourceTitle,toolbar:"add-video-source",media:this.media,menu:!1}),new wp.media.controller.MediaLibrary({type:"text",id:"add-track",title:wp.media.view.l10n.videoAddTrackTitle,toolbar:"add-track",media:this.media,menu:"video-details"})])}}),b=a.MediaWidgetModel.extend({}),c=a.MediaWidgetControl.extend({showDisplaySettings:!1,oembedResponses:{},mapModelToMediaFrameProps:function(b){var c,d=this;return c=a.MediaWidgetControl.prototype.mapModelToMediaFrameProps.call(d,b),c.link="embed",c},fetchEmbed:function(){var a,b=this;a=b.model.get("url"),b.oembedResponses[a]||(b.fetchEmbedDfd&&"pending"===b.fetchEmbedDfd.state()&&b.fetchEmbedDfd.abort(),b.fetchEmbedDfd=wp.apiRequest({url:wp.media.view.settings.oEmbedProxyUrl,data:{url:b.model.get("url"),maxwidth:b.model.get("width"),maxheight:b.model.get("height"),discover:!1},type:"GET",dataType:"json",context:b}),b.fetchEmbedDfd.done(function(c){b.oembedResponses[a]=c,b.renderPreview()}),b.fetchEmbedDfd.fail(function(){b.oembedResponses[a]=null}))},isHostedVideo:function(){return!0},renderPreview:function(){var a,b,c,d,e,f,g,h,i,j=this,k="",l=!1;c=j.model.get("attachment_id"),d=j.model.get("url"),g=j.model.get("error"),(c||d)&&(f=j.selectedAttachment.get("mime"),f&&c?_.contains(_.values(wp.media.view.settings.embedMimes),f)||(g="unsupported_file_type"):c||(h=document.createElement("a"),h.href=d,i=h.pathname.toLowerCase().match(/\.(\w+)$/),i?_.contains(_.keys(wp.media.view.settings.embedMimes),i[1])||(g="unsupported_file_type"):l=!0),l&&(j.fetchEmbed(),j.oembedResponses[d]&&(e=j.oembedResponses[d].thumbnail_url,k=j.oembedResponses[d].html.replace(/\swidth="\d+"/,' width="100%"').replace(/\sheight="\d+"/,""))),a=j.$el.find(".media-widget-preview"),b=wp.template("wp-media-widget-video-preview"),a.html(b({model:{attachment_id:c,html:k,src:d,poster:e},is_oembed:l,error:g})),wp.mediaelement.initialize())},editMedia:function(){var a,b,c,e=this;b=e.mapModelToMediaFrameProps(e.model.toJSON()),a=new d({frame:"video",state:"video-details",metadata:b}),wp.media.frame=a,a.$el.addClass("media-widget"),c=function(a){e.selectedAttachment.set(a),e.model.set(_.extend(_.omit(e.model.defaults(),"title"),e.mapMediaToModelProps(a),{error:!1}))},a.state("video-details").on("update",c),a.state("replace-video").on("replace",c),a.on("close",function(){a.detach()}),a.open()}}),a.controlConstructors.media_video=c,a.modelConstructors.media_video=b}(wp.mediaWidgets); \ No newline at end of file
diff --git a/www/crm/wp-admin/js/widgets/media-widgets.js b/www/crm/wp-admin/js/widgets/media-widgets.js
new file mode 100644
index 00000000..31d093b4
--- /dev/null
+++ b/www/crm/wp-admin/js/widgets/media-widgets.js
@@ -0,0 +1,1334 @@
+/**
+ * @output wp-admin/js/widgets/media-widgets.js
+ */
+
+/* eslint consistent-this: [ "error", "control" ] */
+
+/**
+ * @namespace wp.mediaWidgets
+ * @memberOf wp
+ */
+wp.mediaWidgets = ( function( $ ) {
+ 'use strict';
+
+ var component = {};
+
+ /**
+ * Widget control (view) constructors, mapping widget id_base to subclass of MediaWidgetControl.
+ *
+ * Media widgets register themselves by assigning subclasses of MediaWidgetControl onto this object by widget ID base.
+ *
+ * @memberOf wp.mediaWidgets
+ *
+ * @type {Object.<string, wp.mediaWidgets.MediaWidgetModel>}
+ */
+ component.controlConstructors = {};
+
+ /**
+ * Widget model constructors, mapping widget id_base to subclass of MediaWidgetModel.
+ *
+ * Media widgets register themselves by assigning subclasses of MediaWidgetControl onto this object by widget ID base.
+ *
+ * @memberOf wp.mediaWidgets
+ *
+ * @type {Object.<string, wp.mediaWidgets.MediaWidgetModel>}
+ */
+ component.modelConstructors = {};
+
+ component.PersistentDisplaySettingsLibrary = wp.media.controller.Library.extend(/** @lends wp.mediaWidgets.PersistentDisplaySettingsLibrary.prototype */{
+
+ /**
+ * Library which persists the customized display settings across selections.
+ *
+ * @constructs wp.mediaWidgets.PersistentDisplaySettingsLibrary
+ * @augments wp.media.controller.Library
+ *
+ * @param {Object} options - Options.
+ *
+ * @returns {void}
+ */
+ initialize: function initialize( options ) {
+ _.bindAll( this, 'handleDisplaySettingChange' );
+ wp.media.controller.Library.prototype.initialize.call( this, options );
+ },
+
+ /**
+ * Sync changes to the current display settings back into the current customized.
+ *
+ * @param {Backbone.Model} displaySettings - Modified display settings.
+ * @returns {void}
+ */
+ handleDisplaySettingChange: function handleDisplaySettingChange( displaySettings ) {
+ this.get( 'selectedDisplaySettings' ).set( displaySettings.attributes );
+ },
+
+ /**
+ * Get the display settings model.
+ *
+ * Model returned is updated with the current customized display settings,
+ * and an event listener is added so that changes made to the settings
+ * will sync back into the model storing the session's customized display
+ * settings.
+ *
+ * @param {Backbone.Model} model - Display settings model.
+ * @returns {Backbone.Model} Display settings model.
+ */
+ display: function getDisplaySettingsModel( model ) {
+ var display, selectedDisplaySettings = this.get( 'selectedDisplaySettings' );
+ display = wp.media.controller.Library.prototype.display.call( this, model );
+
+ display.off( 'change', this.handleDisplaySettingChange ); // Prevent duplicated event handlers.
+ display.set( selectedDisplaySettings.attributes );
+ if ( 'custom' === selectedDisplaySettings.get( 'link_type' ) ) {
+ display.linkUrl = selectedDisplaySettings.get( 'link_url' );
+ }
+ display.on( 'change', this.handleDisplaySettingChange );
+ return display;
+ }
+ });
+
+ /**
+ * Extended view for managing the embed UI.
+ *
+ * @class wp.mediaWidgets.MediaEmbedView
+ * @augments wp.media.view.Embed
+ */
+ component.MediaEmbedView = wp.media.view.Embed.extend(/** @lends wp.mediaWidgets.MediaEmbedView.prototype */{
+
+ /**
+ * Initialize.
+ *
+ * @since 4.9.0
+ *
+ * @param {object} options - Options.
+ * @returns {void}
+ */
+ initialize: function( options ) {
+ var view = this, embedController; // eslint-disable-line consistent-this
+ wp.media.view.Embed.prototype.initialize.call( view, options );
+ if ( 'image' !== view.controller.options.mimeType ) {
+ embedController = view.controller.states.get( 'embed' );
+ embedController.off( 'scan', embedController.scanImage, embedController );
+ }
+ },
+
+ /**
+ * Refresh embed view.
+ *
+ * Forked override of {wp.media.view.Embed#refresh()} to suppress irrelevant "link text" field.
+ *
+ * @returns {void}
+ */
+ refresh: function refresh() {
+ /**
+ * @class wp.mediaWidgets~Constructor
+ */
+ var Constructor;
+
+ if ( 'image' === this.controller.options.mimeType ) {
+ Constructor = wp.media.view.EmbedImage;
+ } else {
+
+ // This should be eliminated once #40450 lands of when this is merged into core.
+ Constructor = wp.media.view.EmbedLink.extend(/** @lends wp.mediaWidgets~Constructor.prototype */{
+
+ /**
+ * Set the disabled state on the Add to Widget button.
+ *
+ * @param {boolean} disabled - Disabled.
+ * @returns {void}
+ */
+ setAddToWidgetButtonDisabled: function setAddToWidgetButtonDisabled( disabled ) {
+ this.views.parent.views.parent.views.get( '.media-frame-toolbar' )[0].$el.find( '.media-button-select' ).prop( 'disabled', disabled );
+ },
+
+ /**
+ * Set or clear an error notice.
+ *
+ * @param {string} notice - Notice.
+ * @returns {void}
+ */
+ setErrorNotice: function setErrorNotice( notice ) {
+ var embedLinkView = this, noticeContainer; // eslint-disable-line consistent-this
+
+ noticeContainer = embedLinkView.views.parent.$el.find( '> .notice:first-child' );
+ if ( ! notice ) {
+ if ( noticeContainer.length ) {
+ noticeContainer.slideUp( 'fast' );
+ }
+ } else {
+ if ( ! noticeContainer.length ) {
+ noticeContainer = $( '<div class="media-widget-embed-notice notice notice-error notice-alt"></div>' );
+ noticeContainer.hide();
+ embedLinkView.views.parent.$el.prepend( noticeContainer );
+ }
+ noticeContainer.empty();
+ noticeContainer.append( $( '<p>', {
+ html: notice
+ }));
+ noticeContainer.slideDown( 'fast' );
+ }
+ },
+
+ /**
+ * Update oEmbed.
+ *
+ * @since 4.9.0
+ *
+ * @returns {void}
+ */
+ updateoEmbed: function() {
+ var embedLinkView = this, url; // eslint-disable-line consistent-this
+
+ url = embedLinkView.model.get( 'url' );
+
+ // Abort if the URL field was emptied out.
+ if ( ! url ) {
+ embedLinkView.setErrorNotice( '' );
+ embedLinkView.setAddToWidgetButtonDisabled( true );
+ return;
+ }
+
+ if ( ! url.match( /^(http|https):\/\/.+\// ) ) {
+ embedLinkView.controller.$el.find( '#embed-url-field' ).addClass( 'invalid' );
+ embedLinkView.setAddToWidgetButtonDisabled( true );
+ }
+
+ wp.media.view.EmbedLink.prototype.updateoEmbed.call( embedLinkView );
+ },
+
+ /**
+ * Fetch media.
+ *
+ * @returns {void}
+ */
+ fetch: function() {
+ var embedLinkView = this, fetchSuccess, matches, fileExt, urlParser, url, re, youTubeEmbedMatch; // eslint-disable-line consistent-this
+ url = embedLinkView.model.get( 'url' );
+
+ if ( embedLinkView.dfd && 'pending' === embedLinkView.dfd.state() ) {
+ embedLinkView.dfd.abort();
+ }
+
+ fetchSuccess = function( response ) {
+ embedLinkView.renderoEmbed({
+ data: {
+ body: response
+ }
+ });
+
+ embedLinkView.controller.$el.find( '#embed-url-field' ).removeClass( 'invalid' );
+ embedLinkView.setErrorNotice( '' );
+ embedLinkView.setAddToWidgetButtonDisabled( false );
+ };
+
+ urlParser = document.createElement( 'a' );
+ urlParser.href = url;
+ matches = urlParser.pathname.toLowerCase().match( /\.(\w+)$/ );
+ if ( matches ) {
+ fileExt = matches[1];
+ if ( ! wp.media.view.settings.embedMimes[ fileExt ] ) {
+ embedLinkView.renderFail();
+ } else if ( 0 !== wp.media.view.settings.embedMimes[ fileExt ].indexOf( embedLinkView.controller.options.mimeType ) ) {
+ embedLinkView.renderFail();
+ } else {
+ fetchSuccess( '<!--success-->' );
+ }
+ return;
+ }
+
+ // Support YouTube embed links.
+ re = /https?:\/\/www\.youtube\.com\/embed\/([^/]+)/;
+ youTubeEmbedMatch = re.exec( url );
+ if ( youTubeEmbedMatch ) {
+ url = 'https://www.youtube.com/watch?v=' + youTubeEmbedMatch[ 1 ];
+ // silently change url to proper oembed-able version.
+ embedLinkView.model.attributes.url = url;
+ }
+
+ embedLinkView.dfd = wp.apiRequest({
+ url: wp.media.view.settings.oEmbedProxyUrl,
+ data: {
+ url: url,
+ maxwidth: embedLinkView.model.get( 'width' ),
+ maxheight: embedLinkView.model.get( 'height' ),
+ discover: false
+ },
+ type: 'GET',
+ dataType: 'json',
+ context: embedLinkView
+ });
+
+ embedLinkView.dfd.done( function( response ) {
+ if ( embedLinkView.controller.options.mimeType !== response.type ) {
+ embedLinkView.renderFail();
+ return;
+ }
+ fetchSuccess( response.html );
+ });
+ embedLinkView.dfd.fail( _.bind( embedLinkView.renderFail, embedLinkView ) );
+ },
+
+ /**
+ * Handle render failure.
+ *
+ * Overrides the {EmbedLink#renderFail()} method to prevent showing the "Link Text" field.
+ * The element is getting display:none in the stylesheet, but the underlying method uses
+ * uses {jQuery.fn.show()} which adds an inline style. This avoids the need for !important.
+ *
+ * @returns {void}
+ */
+ renderFail: function renderFail() {
+ var embedLinkView = this; // eslint-disable-line consistent-this
+ embedLinkView.controller.$el.find( '#embed-url-field' ).addClass( 'invalid' );
+ embedLinkView.setErrorNotice( embedLinkView.controller.options.invalidEmbedTypeError || 'ERROR' );
+ embedLinkView.setAddToWidgetButtonDisabled( true );
+ }
+ });
+ }
+
+ this.settings( new Constructor({
+ controller: this.controller,
+ model: this.model.props,
+ priority: 40
+ }));
+ }
+ });
+
+ /**
+ * Custom media frame for selecting uploaded media or providing media by URL.
+ *
+ * @class wp.mediaWidgets.MediaFrameSelect
+ * @augments wp.media.view.MediaFrame.Post
+ */
+ component.MediaFrameSelect = wp.media.view.MediaFrame.Post.extend(/** @lends wp.mediaWidgets.MediaFrameSelect.prototype */{
+
+ /**
+ * Create the default states.
+ *
+ * @returns {void}
+ */
+ createStates: function createStates() {
+ var mime = this.options.mimeType, specificMimes = [];
+ _.each( wp.media.view.settings.embedMimes, function( embedMime ) {
+ if ( 0 === embedMime.indexOf( mime ) ) {
+ specificMimes.push( embedMime );
+ }
+ });
+ if ( specificMimes.length > 0 ) {
+ mime = specificMimes;
+ }
+
+ this.states.add([
+
+ // Main states.
+ new component.PersistentDisplaySettingsLibrary({
+ id: 'insert',
+ title: this.options.title,
+ selection: this.options.selection,
+ priority: 20,
+ toolbar: 'main-insert',
+ filterable: 'dates',
+ library: wp.media.query({
+ type: mime
+ }),
+ multiple: false,
+ editable: true,
+
+ selectedDisplaySettings: this.options.selectedDisplaySettings,
+ displaySettings: _.isUndefined( this.options.showDisplaySettings ) ? true : this.options.showDisplaySettings,
+ displayUserSettings: false // We use the display settings from the current/default widget instance props.
+ }),
+
+ new wp.media.controller.EditImage({ model: this.options.editImage }),
+
+ // Embed states.
+ new wp.media.controller.Embed({
+ metadata: this.options.metadata,
+ type: 'image' === this.options.mimeType ? 'image' : 'link',
+ invalidEmbedTypeError: this.options.invalidEmbedTypeError
+ })
+ ]);
+ },
+
+ /**
+ * Main insert toolbar.
+ *
+ * Forked override of {wp.media.view.MediaFrame.Post#mainInsertToolbar()} to override text.
+ *
+ * @param {wp.Backbone.View} view - Toolbar view.
+ * @this {wp.media.controller.Library}
+ * @returns {void}
+ */
+ mainInsertToolbar: function mainInsertToolbar( view ) {
+ var controller = this; // eslint-disable-line consistent-this
+ view.set( 'insert', {
+ style: 'primary',
+ priority: 80,
+ text: controller.options.text, // The whole reason for the fork.
+ requires: { selection: true },
+
+ /**
+ * Handle click.
+ *
+ * @ignore
+ *
+ * @fires wp.media.controller.State#insert()
+ * @returns {void}
+ */
+ click: function onClick() {
+ var state = controller.state(),
+ selection = state.get( 'selection' );
+
+ controller.close();
+ state.trigger( 'insert', selection ).reset();
+ }
+ });
+ },
+
+ /**
+ * Main embed toolbar.
+ *
+ * Forked override of {wp.media.view.MediaFrame.Post#mainEmbedToolbar()} to override text.
+ *
+ * @param {wp.Backbone.View} toolbar - Toolbar view.
+ * @this {wp.media.controller.Library}
+ * @returns {void}
+ */
+ mainEmbedToolbar: function mainEmbedToolbar( toolbar ) {
+ toolbar.view = new wp.media.view.Toolbar.Embed({
+ controller: this,
+ text: this.options.text,
+ event: 'insert'
+ });
+ },
+
+ /**
+ * Embed content.
+ *
+ * Forked override of {wp.media.view.MediaFrame.Post#embedContent()} to suppress irrelevant "link text" field.
+ *
+ * @returns {void}
+ */
+ embedContent: function embedContent() {
+ var view = new component.MediaEmbedView({
+ controller: this,
+ model: this.state()
+ }).render();
+
+ this.content.set( view );
+
+ if ( ! wp.media.isTouchDevice ) {
+ view.url.focus();
+ }
+ }
+ });
+
+ component.MediaWidgetControl = Backbone.View.extend(/** @lends wp.mediaWidgets.MediaWidgetControl.prototype */{
+
+ /**
+ * Translation strings.
+ *
+ * The mapping of translation strings is handled by media widget subclasses,
+ * exported from PHP to JS such as is done in WP_Widget_Media_Image::enqueue_admin_scripts().
+ *
+ * @type {Object}
+ */
+ l10n: {
+ add_to_widget: '{{add_to_widget}}',
+ add_media: '{{add_media}}'
+ },
+
+ /**
+ * Widget ID base.
+ *
+ * This may be defined by the subclass. It may be exported from PHP to JS
+ * such as is done in WP_Widget_Media_Image::enqueue_admin_scripts(). If not,
+ * it will attempt to be discovered by looking to see if this control
+ * instance extends each member of component.controlConstructors, and if
+ * it does extend one, will use the key as the id_base.
+ *
+ * @type {string}
+ */
+ id_base: '',
+
+ /**
+ * Mime type.
+ *
+ * This must be defined by the subclass. It may be exported from PHP to JS
+ * such as is done in WP_Widget_Media_Image::enqueue_admin_scripts().
+ *
+ * @type {string}
+ */
+ mime_type: '',
+
+ /**
+ * View events.
+ *
+ * @type {Object}
+ */
+ events: {
+ 'click .notice-missing-attachment a': 'handleMediaLibraryLinkClick',
+ 'click .select-media': 'selectMedia',
+ 'click .placeholder': 'selectMedia',
+ 'click .edit-media': 'editMedia'
+ },
+
+ /**
+ * Show display settings.
+ *
+ * @type {boolean}
+ */
+ showDisplaySettings: true,
+
+ /**
+ * Media Widget Control.
+ *
+ * @constructs wp.mediaWidgets.MediaWidgetControl
+ * @augments Backbone.View
+ * @abstract
+ *
+ * @param {Object} options - Options.
+ * @param {Backbone.Model} options.model - Model.
+ * @param {jQuery} options.el - Control field container element.
+ * @param {jQuery} options.syncContainer - Container element where fields are synced for the server.
+ *
+ * @returns {void}
+ */
+ initialize: function initialize( options ) {
+ var control = this;
+
+ Backbone.View.prototype.initialize.call( control, options );
+
+ if ( ! ( control.model instanceof component.MediaWidgetModel ) ) {
+ throw new Error( 'Missing options.model' );
+ }
+ if ( ! options.el ) {
+ throw new Error( 'Missing options.el' );
+ }
+ if ( ! options.syncContainer ) {
+ throw new Error( 'Missing options.syncContainer' );
+ }
+
+ control.syncContainer = options.syncContainer;
+
+ control.$el.addClass( 'media-widget-control' );
+
+ // Allow methods to be passed in with control context preserved.
+ _.bindAll( control, 'syncModelToInputs', 'render', 'updateSelectedAttachment', 'renderPreview' );
+
+ if ( ! control.id_base ) {
+ _.find( component.controlConstructors, function( Constructor, idBase ) {
+ if ( control instanceof Constructor ) {
+ control.id_base = idBase;
+ return true;
+ }
+ return false;
+ });
+ if ( ! control.id_base ) {
+ throw new Error( 'Missing id_base.' );
+ }
+ }
+
+ // Track attributes needed to renderPreview in it's own model.
+ control.previewTemplateProps = new Backbone.Model( control.mapModelToPreviewTemplateProps() );
+
+ // Re-render the preview when the attachment changes.
+ control.selectedAttachment = new wp.media.model.Attachment();
+ control.renderPreview = _.debounce( control.renderPreview );
+ control.listenTo( control.previewTemplateProps, 'change', control.renderPreview );
+
+ // Make sure a copy of the selected attachment is always fetched.
+ control.model.on( 'change:attachment_id', control.updateSelectedAttachment );
+ control.model.on( 'change:url', control.updateSelectedAttachment );
+ control.updateSelectedAttachment();
+
+ /*
+ * Sync the widget instance model attributes onto the hidden inputs that widgets currently use to store the state.
+ * In the future, when widgets are JS-driven, the underlying widget instance data should be exposed as a model
+ * from the start, without having to sync with hidden fields. See <https://core.trac.wordpress.org/ticket/33507>.
+ */
+ control.listenTo( control.model, 'change', control.syncModelToInputs );
+ control.listenTo( control.model, 'change', control.syncModelToPreviewProps );
+ control.listenTo( control.model, 'change', control.render );
+
+ // Update the title.
+ control.$el.on( 'input change', '.title', function updateTitle() {
+ control.model.set({
+ title: $.trim( $( this ).val() )
+ });
+ });
+
+ // Update link_url attribute.
+ control.$el.on( 'input change', '.link', function updateLinkUrl() {
+ var linkUrl = $.trim( $( this ).val() ), linkType = 'custom';
+ if ( control.selectedAttachment.get( 'linkUrl' ) === linkUrl || control.selectedAttachment.get( 'link' ) === linkUrl ) {
+ linkType = 'post';
+ } else if ( control.selectedAttachment.get( 'url' ) === linkUrl ) {
+ linkType = 'file';
+ }
+ control.model.set( {
+ link_url: linkUrl,
+ link_type: linkType
+ });
+
+ // Update display settings for the next time the user opens to select from the media library.
+ control.displaySettings.set( {
+ link: linkType,
+ linkUrl: linkUrl
+ });
+ });
+
+ /*
+ * Copy current display settings from the widget model to serve as basis
+ * of customized display settings for the current media frame session.
+ * Changes to display settings will be synced into this model, and
+ * when a new selection is made, the settings from this will be synced
+ * into that AttachmentDisplay's model to persist the setting changes.
+ */
+ control.displaySettings = new Backbone.Model( _.pick(
+ control.mapModelToMediaFrameProps(
+ _.extend( control.model.defaults(), control.model.toJSON() )
+ ),
+ _.keys( wp.media.view.settings.defaultProps )
+ ) );
+ },
+
+ /**
+ * Update the selected attachment if necessary.
+ *
+ * @returns {void}
+ */
+ updateSelectedAttachment: function updateSelectedAttachment() {
+ var control = this, attachment;
+
+ if ( 0 === control.model.get( 'attachment_id' ) ) {
+ control.selectedAttachment.clear();
+ control.model.set( 'error', false );
+ } else if ( control.model.get( 'attachment_id' ) !== control.selectedAttachment.get( 'id' ) ) {
+ attachment = new wp.media.model.Attachment({
+ id: control.model.get( 'attachment_id' )
+ });
+ attachment.fetch()
+ .done( function done() {
+ control.model.set( 'error', false );
+ control.selectedAttachment.set( attachment.toJSON() );
+ })
+ .fail( function fail() {
+ control.model.set( 'error', 'missing_attachment' );
+ });
+ }
+ },
+
+ /**
+ * Sync the model attributes to the hidden inputs, and update previewTemplateProps.
+ *
+ * @returns {void}
+ */
+ syncModelToPreviewProps: function syncModelToPreviewProps() {
+ var control = this;
+ control.previewTemplateProps.set( control.mapModelToPreviewTemplateProps() );
+ },
+
+ /**
+ * Sync the model attributes to the hidden inputs, and update previewTemplateProps.
+ *
+ * @returns {void}
+ */
+ syncModelToInputs: function syncModelToInputs() {
+ var control = this;
+ control.syncContainer.find( '.media-widget-instance-property' ).each( function() {
+ var input = $( this ), value, propertyName;
+ propertyName = input.data( 'property' );
+ value = control.model.get( propertyName );
+ if ( _.isUndefined( value ) ) {
+ return;
+ }
+
+ if ( 'array' === control.model.schema[ propertyName ].type && _.isArray( value ) ) {
+ value = value.join( ',' );
+ } else if ( 'boolean' === control.model.schema[ propertyName ].type ) {
+ value = value ? '1' : ''; // Because in PHP, strval( true ) === '1' && strval( false ) === ''.
+ } else {
+ value = String( value );
+ }
+
+ if ( input.val() !== value ) {
+ input.val( value );
+ input.trigger( 'change' );
+ }
+ });
+ },
+
+ /**
+ * Get template.
+ *
+ * @returns {Function} Template.
+ */
+ template: function template() {
+ var control = this;
+ if ( ! $( '#tmpl-widget-media-' + control.id_base + '-control' ).length ) {
+ throw new Error( 'Missing widget control template for ' + control.id_base );
+ }
+ return wp.template( 'widget-media-' + control.id_base + '-control' );
+ },
+
+ /**
+ * Render template.
+ *
+ * @returns {void}
+ */
+ render: function render() {
+ var control = this, titleInput;
+
+ if ( ! control.templateRendered ) {
+ control.$el.html( control.template()( control.model.toJSON() ) );
+ control.renderPreview(); // Hereafter it will re-render when control.selectedAttachment changes.
+ control.templateRendered = true;
+ }
+
+ titleInput = control.$el.find( '.title' );
+ if ( ! titleInput.is( document.activeElement ) ) {
+ titleInput.val( control.model.get( 'title' ) );
+ }
+
+ control.$el.toggleClass( 'selected', control.isSelected() );
+ },
+
+ /**
+ * Render media preview.
+ *
+ * @abstract
+ * @returns {void}
+ */
+ renderPreview: function renderPreview() {
+ throw new Error( 'renderPreview must be implemented' );
+ },
+
+ /**
+ * Whether a media item is selected.
+ *
+ * @returns {boolean} Whether selected and no error.
+ */
+ isSelected: function isSelected() {
+ var control = this;
+
+ if ( control.model.get( 'error' ) ) {
+ return false;
+ }
+
+ return Boolean( control.model.get( 'attachment_id' ) || control.model.get( 'url' ) );
+ },
+
+ /**
+ * Handle click on link to Media Library to open modal, such as the link that appears when in the missing attachment error notice.
+ *
+ * @param {jQuery.Event} event - Event.
+ * @returns {void}
+ */
+ handleMediaLibraryLinkClick: function handleMediaLibraryLinkClick( event ) {
+ var control = this;
+ event.preventDefault();
+ control.selectMedia();
+ },
+
+ /**
+ * Open the media select frame to chose an item.
+ *
+ * @returns {void}
+ */
+ selectMedia: function selectMedia() {
+ var control = this, selection, mediaFrame, defaultSync, mediaFrameProps, selectionModels = [];
+
+ if ( control.isSelected() && 0 !== control.model.get( 'attachment_id' ) ) {
+ selectionModels.push( control.selectedAttachment );
+ }
+
+ selection = new wp.media.model.Selection( selectionModels, { multiple: false } );
+
+ mediaFrameProps = control.mapModelToMediaFrameProps( control.model.toJSON() );
+ if ( mediaFrameProps.size ) {
+ control.displaySettings.set( 'size', mediaFrameProps.size );
+ }
+
+ mediaFrame = new component.MediaFrameSelect({
+ title: control.l10n.add_media,
+ frame: 'post',
+ text: control.l10n.add_to_widget,
+ selection: selection,
+ mimeType: control.mime_type,
+ selectedDisplaySettings: control.displaySettings,
+ showDisplaySettings: control.showDisplaySettings,
+ metadata: mediaFrameProps,
+ state: control.isSelected() && 0 === control.model.get( 'attachment_id' ) ? 'embed' : 'insert',
+ invalidEmbedTypeError: control.l10n.unsupported_file_type
+ });
+ wp.media.frame = mediaFrame; // See wp.media().
+
+ // Handle selection of a media item.
+ mediaFrame.on( 'insert', function onInsert() {
+ var attachment = {}, state = mediaFrame.state();
+
+ // Update cached attachment object to avoid having to re-fetch. This also triggers re-rendering of preview.
+ if ( 'embed' === state.get( 'id' ) ) {
+ _.extend( attachment, { id: 0 }, state.props.toJSON() );
+ } else {
+ _.extend( attachment, state.get( 'selection' ).first().toJSON() );
+ }
+
+ control.selectedAttachment.set( attachment );
+ control.model.set( 'error', false );
+
+ // Update widget instance.
+ control.model.set( control.getModelPropsFromMediaFrame( mediaFrame ) );
+ });
+
+ // Disable syncing of attachment changes back to server (except for deletions). See <https://core.trac.wordpress.org/ticket/40403>.
+ defaultSync = wp.media.model.Attachment.prototype.sync;
+ wp.media.model.Attachment.prototype.sync = function( method ) {
+ if ( 'delete' === method ) {
+ return defaultSync.apply( this, arguments );
+ } else {
+ return $.Deferred().rejectWith( this ).promise();
+ }
+ };
+ mediaFrame.on( 'close', function onClose() {
+ wp.media.model.Attachment.prototype.sync = defaultSync;
+ });
+
+ mediaFrame.$el.addClass( 'media-widget' );
+ mediaFrame.open();
+
+ // Clear the selected attachment when it is deleted in the media select frame.
+ if ( selection ) {
+ selection.on( 'destroy', function onDestroy( attachment ) {
+ if ( control.model.get( 'attachment_id' ) === attachment.get( 'id' ) ) {
+ control.model.set({
+ attachment_id: 0,
+ url: ''
+ });
+ }
+ });
+ }
+
+ /*
+ * Make sure focus is set inside of modal so that hitting Esc will close
+ * the modal and not inadvertently cause the widget to collapse in the customizer.
+ */
+ mediaFrame.$el.find( '.media-frame-menu .media-menu-item.active' ).focus();
+ },
+
+ /**
+ * Get the instance props from the media selection frame.
+ *
+ * @param {wp.media.view.MediaFrame.Select} mediaFrame - Select frame.
+ * @returns {Object} Props.
+ */
+ getModelPropsFromMediaFrame: function getModelPropsFromMediaFrame( mediaFrame ) {
+ var control = this, state, mediaFrameProps, modelProps;
+
+ state = mediaFrame.state();
+ if ( 'insert' === state.get( 'id' ) ) {
+ mediaFrameProps = state.get( 'selection' ).first().toJSON();
+ mediaFrameProps.postUrl = mediaFrameProps.link;
+
+ if ( control.showDisplaySettings ) {
+ _.extend(
+ mediaFrameProps,
+ mediaFrame.content.get( '.attachments-browser' ).sidebar.get( 'display' ).model.toJSON()
+ );
+ }
+ if ( mediaFrameProps.sizes && mediaFrameProps.size && mediaFrameProps.sizes[ mediaFrameProps.size ] ) {
+ mediaFrameProps.url = mediaFrameProps.sizes[ mediaFrameProps.size ].url;
+ }
+ } else if ( 'embed' === state.get( 'id' ) ) {
+ mediaFrameProps = _.extend(
+ state.props.toJSON(),
+ { attachment_id: 0 }, // Because some media frames use `attachment_id` not `id`.
+ control.model.getEmbedResetProps()
+ );
+ } else {
+ throw new Error( 'Unexpected state: ' + state.get( 'id' ) );
+ }
+
+ if ( mediaFrameProps.id ) {
+ mediaFrameProps.attachment_id = mediaFrameProps.id;
+ }
+
+ modelProps = control.mapMediaToModelProps( mediaFrameProps );
+
+ // Clear the extension prop so sources will be reset for video and audio media.
+ _.each( wp.media.view.settings.embedExts, function( ext ) {
+ if ( ext in control.model.schema && modelProps.url !== modelProps[ ext ] ) {
+ modelProps[ ext ] = '';
+ }
+ });
+
+ return modelProps;
+ },
+
+ /**
+ * Map media frame props to model props.
+ *
+ * @param {Object} mediaFrameProps - Media frame props.
+ * @returns {Object} Model props.
+ */
+ mapMediaToModelProps: function mapMediaToModelProps( mediaFrameProps ) {
+ var control = this, mediaFramePropToModelPropMap = {}, modelProps = {}, extension;
+ _.each( control.model.schema, function( fieldSchema, modelProp ) {
+
+ // Ignore widget title attribute.
+ if ( 'title' === modelProp ) {
+ return;
+ }
+ mediaFramePropToModelPropMap[ fieldSchema.media_prop || modelProp ] = modelProp;
+ });
+
+ _.each( mediaFrameProps, function( value, mediaProp ) {
+ var propName = mediaFramePropToModelPropMap[ mediaProp ] || mediaProp;
+ if ( control.model.schema[ propName ] ) {
+ modelProps[ propName ] = value;
+ }
+ });
+
+ if ( 'custom' === mediaFrameProps.size ) {
+ modelProps.width = mediaFrameProps.customWidth;
+ modelProps.height = mediaFrameProps.customHeight;
+ }
+
+ if ( 'post' === mediaFrameProps.link ) {
+ modelProps.link_url = mediaFrameProps.postUrl || mediaFrameProps.linkUrl;
+ } else if ( 'file' === mediaFrameProps.link ) {
+ modelProps.link_url = mediaFrameProps.url;
+ }
+
+ // Because some media frames use `id` instead of `attachment_id`.
+ if ( ! mediaFrameProps.attachment_id && mediaFrameProps.id ) {
+ modelProps.attachment_id = mediaFrameProps.id;
+ }
+
+ if ( mediaFrameProps.url ) {
+ extension = mediaFrameProps.url.replace( /#.*$/, '' ).replace( /\?.*$/, '' ).split( '.' ).pop().toLowerCase();
+ if ( extension in control.model.schema ) {
+ modelProps[ extension ] = mediaFrameProps.url;
+ }
+ }
+
+ // Always omit the titles derived from mediaFrameProps.
+ return _.omit( modelProps, 'title' );
+ },
+
+ /**
+ * Map model props to media frame props.
+ *
+ * @param {Object} modelProps - Model props.
+ * @returns {Object} Media frame props.
+ */
+ mapModelToMediaFrameProps: function mapModelToMediaFrameProps( modelProps ) {
+ var control = this, mediaFrameProps = {};
+
+ _.each( modelProps, function( value, modelProp ) {
+ var fieldSchema = control.model.schema[ modelProp ] || {};
+ mediaFrameProps[ fieldSchema.media_prop || modelProp ] = value;
+ });
+
+ // Some media frames use attachment_id.
+ mediaFrameProps.attachment_id = mediaFrameProps.id;
+
+ if ( 'custom' === mediaFrameProps.size ) {
+ mediaFrameProps.customWidth = control.model.get( 'width' );
+ mediaFrameProps.customHeight = control.model.get( 'height' );
+ }
+
+ return mediaFrameProps;
+ },
+
+ /**
+ * Map model props to previewTemplateProps.
+ *
+ * @returns {Object} Preview Template Props.
+ */
+ mapModelToPreviewTemplateProps: function mapModelToPreviewTemplateProps() {
+ var control = this, previewTemplateProps = {};
+ _.each( control.model.schema, function( value, prop ) {
+ if ( ! value.hasOwnProperty( 'should_preview_update' ) || value.should_preview_update ) {
+ previewTemplateProps[ prop ] = control.model.get( prop );
+ }
+ });
+
+ // Templates need to be aware of the error.
+ previewTemplateProps.error = control.model.get( 'error' );
+ return previewTemplateProps;
+ },
+
+ /**
+ * Open the media frame to modify the selected item.
+ *
+ * @abstract
+ * @returns {void}
+ */
+ editMedia: function editMedia() {
+ throw new Error( 'editMedia not implemented' );
+ }
+ });
+
+ /**
+ * Media widget model.
+ *
+ * @class wp.mediaWidgets.MediaWidgetModel
+ * @augments Backbone.Model
+ */
+ component.MediaWidgetModel = Backbone.Model.extend(/** @lends wp.mediaWidgets.MediaWidgetModel.prototype */{
+
+ /**
+ * Id attribute.
+ *
+ * @type {string}
+ */
+ idAttribute: 'widget_id',
+
+ /**
+ * Instance schema.
+ *
+ * This adheres to JSON Schema and subclasses should have their schema
+ * exported from PHP to JS such as is done in WP_Widget_Media_Image::enqueue_admin_scripts().
+ *
+ * @type {Object.<string, Object>}
+ */
+ schema: {
+ title: {
+ type: 'string',
+ 'default': ''
+ },
+ attachment_id: {
+ type: 'integer',
+ 'default': 0
+ },
+ url: {
+ type: 'string',
+ 'default': ''
+ }
+ },
+
+ /**
+ * Get default attribute values.
+ *
+ * @returns {Object} Mapping of property names to their default values.
+ */
+ defaults: function() {
+ var defaults = {};
+ _.each( this.schema, function( fieldSchema, field ) {
+ defaults[ field ] = fieldSchema['default'];
+ });
+ return defaults;
+ },
+
+ /**
+ * Set attribute value(s).
+ *
+ * This is a wrapped version of Backbone.Model#set() which allows us to
+ * cast the attribute values from the hidden inputs' string values into
+ * the appropriate data types (integers or booleans).
+ *
+ * @param {string|Object} key - Attribute name or attribute pairs.
+ * @param {mixed|Object} [val] - Attribute value or options object.
+ * @param {Object} [options] - Options when attribute name and value are passed separately.
+ * @returns {wp.mediaWidgets.MediaWidgetModel} This model.
+ */
+ set: function set( key, val, options ) {
+ var model = this, attrs, opts, castedAttrs; // eslint-disable-line consistent-this
+ if ( null === key ) {
+ return model;
+ }
+ if ( 'object' === typeof key ) {
+ attrs = key;
+ opts = val;
+ } else {
+ attrs = {};
+ attrs[ key ] = val;
+ opts = options;
+ }
+
+ castedAttrs = {};
+ _.each( attrs, function( value, name ) {
+ var type;
+ if ( ! model.schema[ name ] ) {
+ castedAttrs[ name ] = value;
+ return;
+ }
+ type = model.schema[ name ].type;
+ if ( 'array' === type ) {
+ castedAttrs[ name ] = value;
+ if ( ! _.isArray( castedAttrs[ name ] ) ) {
+ castedAttrs[ name ] = castedAttrs[ name ].split( /,/ ); // Good enough for parsing an ID list.
+ }
+ if ( model.schema[ name ].items && 'integer' === model.schema[ name ].items.type ) {
+ castedAttrs[ name ] = _.filter(
+ _.map( castedAttrs[ name ], function( id ) {
+ return parseInt( id, 10 );
+ },
+ function( id ) {
+ return 'number' === typeof id;
+ }
+ ) );
+ }
+ } else if ( 'integer' === type ) {
+ castedAttrs[ name ] = parseInt( value, 10 );
+ } else if ( 'boolean' === type ) {
+ castedAttrs[ name ] = ! ( ! value || '0' === value || 'false' === value );
+ } else {
+ castedAttrs[ name ] = value;
+ }
+ });
+
+ return Backbone.Model.prototype.set.call( this, castedAttrs, opts );
+ },
+
+ /**
+ * Get props which are merged on top of the model when an embed is chosen (as opposed to an attachment).
+ *
+ * @returns {Object} Reset/override props.
+ */
+ getEmbedResetProps: function getEmbedResetProps() {
+ return {
+ id: 0
+ };
+ }
+ });
+
+ /**
+ * Collection of all widget model instances.
+ *
+ * @memberOf wp.mediaWidgets
+ *
+ * @type {Backbone.Collection}
+ */
+ component.modelCollection = new ( Backbone.Collection.extend( {
+ model: component.MediaWidgetModel
+ }) )();
+
+ /**
+ * Mapping of widget ID to instances of MediaWidgetControl subclasses.
+ *
+ * @memberOf wp.mediaWidgets
+ *
+ * @type {Object.<string, wp.mediaWidgets.MediaWidgetControl>}
+ */
+ component.widgetControls = {};
+
+ /**
+ * Handle widget being added or initialized for the first time at the widget-added event.
+ *
+ * @memberOf wp.mediaWidgets
+ *
+ * @param {jQuery.Event} event - Event.
+ * @param {jQuery} widgetContainer - Widget container element.
+ *
+ * @returns {void}
+ */
+ component.handleWidgetAdded = function handleWidgetAdded( event, widgetContainer ) {
+ var fieldContainer, syncContainer, widgetForm, idBase, ControlConstructor, ModelConstructor, modelAttributes, widgetControl, widgetModel, widgetId, animatedCheckDelay = 50, renderWhenAnimationDone;
+ widgetForm = widgetContainer.find( '> .widget-inside > .form, > .widget-inside > form' ); // Note: '.form' appears in the customizer, whereas 'form' on the widgets admin screen.
+ idBase = widgetForm.find( '> .id_base' ).val();
+ widgetId = widgetForm.find( '> .widget-id' ).val();
+
+ // Prevent initializing already-added widgets.
+ if ( component.widgetControls[ widgetId ] ) {
+ return;
+ }
+
+ ControlConstructor = component.controlConstructors[ idBase ];
+ if ( ! ControlConstructor ) {
+ return;
+ }
+
+ ModelConstructor = component.modelConstructors[ idBase ] || component.MediaWidgetModel;
+
+ /*
+ * Create a container element for the widget control (Backbone.View).
+ * This is inserted into the DOM immediately before the .widget-content
+ * element because the contents of this element are essentially "managed"
+ * by PHP, where each widget update cause the entire element to be emptied
+ * and replaced with the rendered output of WP_Widget::form() which is
+ * sent back in Ajax request made to save/update the widget instance.
+ * To prevent a "flash of replaced DOM elements and re-initialized JS
+ * components", the JS template is rendered outside of the normal form
+ * container.
+ */
+ fieldContainer = $( '<div></div>' );
+ syncContainer = widgetContainer.find( '.widget-content:first' );
+ syncContainer.before( fieldContainer );
+
+ /*
+ * Sync the widget instance model attributes onto the hidden inputs that widgets currently use to store the state.
+ * In the future, when widgets are JS-driven, the underlying widget instance data should be exposed as a model
+ * from the start, without having to sync with hidden fields. See <https://core.trac.wordpress.org/ticket/33507>.
+ */
+ modelAttributes = {};
+ syncContainer.find( '.media-widget-instance-property' ).each( function() {
+ var input = $( this );
+ modelAttributes[ input.data( 'property' ) ] = input.val();
+ });
+ modelAttributes.widget_id = widgetId;
+
+ widgetModel = new ModelConstructor( modelAttributes );
+
+ widgetControl = new ControlConstructor({
+ el: fieldContainer,
+ syncContainer: syncContainer,
+ model: widgetModel
+ });
+
+ /*
+ * Render the widget once the widget parent's container finishes animating,
+ * as the widget-added event fires with a slideDown of the container.
+ * This ensures that the container's dimensions are fixed so that ME.js
+ * can initialize with the proper dimensions.
+ */
+ renderWhenAnimationDone = function() {
+ if ( ! widgetContainer.hasClass( 'open' ) ) {
+ setTimeout( renderWhenAnimationDone, animatedCheckDelay );
+ } else {
+ widgetControl.render();
+ }
+ };
+ renderWhenAnimationDone();
+
+ /*
+ * Note that the model and control currently won't ever get garbage-collected
+ * when a widget gets removed/deleted because there is no widget-removed event.
+ */
+ component.modelCollection.add( [ widgetModel ] );
+ component.widgetControls[ widgetModel.get( 'widget_id' ) ] = widgetControl;
+ };
+
+ /**
+ * Setup widget in accessibility mode.
+ *
+ * @memberOf wp.mediaWidgets
+ *
+ * @returns {void}
+ */
+ component.setupAccessibleMode = function setupAccessibleMode() {
+ var widgetForm, widgetId, idBase, widgetControl, ControlConstructor, ModelConstructor, modelAttributes, fieldContainer, syncContainer;
+ widgetForm = $( '.editwidget > form' );
+ if ( 0 === widgetForm.length ) {
+ return;
+ }
+
+ idBase = widgetForm.find( '> .widget-control-actions > .id_base' ).val();
+
+ ControlConstructor = component.controlConstructors[ idBase ];
+ if ( ! ControlConstructor ) {
+ return;
+ }
+
+ widgetId = widgetForm.find( '> .widget-control-actions > .widget-id' ).val();
+
+ ModelConstructor = component.modelConstructors[ idBase ] || component.MediaWidgetModel;
+ fieldContainer = $( '<div></div>' );
+ syncContainer = widgetForm.find( '> .widget-inside' );
+ syncContainer.before( fieldContainer );
+
+ modelAttributes = {};
+ syncContainer.find( '.media-widget-instance-property' ).each( function() {
+ var input = $( this );
+ modelAttributes[ input.data( 'property' ) ] = input.val();
+ });
+ modelAttributes.widget_id = widgetId;
+
+ widgetControl = new ControlConstructor({
+ el: fieldContainer,
+ syncContainer: syncContainer,
+ model: new ModelConstructor( modelAttributes )
+ });
+
+ component.modelCollection.add( [ widgetControl.model ] );
+ component.widgetControls[ widgetControl.model.get( 'widget_id' ) ] = widgetControl;
+
+ widgetControl.render();
+ };
+
+ /**
+ * Sync widget instance data sanitized from server back onto widget model.
+ *
+ * This gets called via the 'widget-updated' event when saving a widget from
+ * the widgets admin screen and also via the 'widget-synced' event when making
+ * a change to a widget in the customizer.
+ *
+ * @memberOf wp.mediaWidgets
+ *
+ * @param {jQuery.Event} event - Event.
+ * @param {jQuery} widgetContainer - Widget container element.
+ *
+ * @returns {void}
+ */
+ component.handleWidgetUpdated = function handleWidgetUpdated( event, widgetContainer ) {
+ var widgetForm, widgetContent, widgetId, widgetControl, attributes = {};
+ widgetForm = widgetContainer.find( '> .widget-inside > .form, > .widget-inside > form' );
+ widgetId = widgetForm.find( '> .widget-id' ).val();
+
+ widgetControl = component.widgetControls[ widgetId ];
+ if ( ! widgetControl ) {
+ return;
+ }
+
+ // Make sure the server-sanitized values get synced back into the model.
+ widgetContent = widgetForm.find( '> .widget-content' );
+ widgetContent.find( '.media-widget-instance-property' ).each( function() {
+ var property = $( this ).data( 'property' );
+ attributes[ property ] = $( this ).val();
+ });
+
+ // Suspend syncing model back to inputs when syncing from inputs to model, preventing infinite loop.
+ widgetControl.stopListening( widgetControl.model, 'change', widgetControl.syncModelToInputs );
+ widgetControl.model.set( attributes );
+ widgetControl.listenTo( widgetControl.model, 'change', widgetControl.syncModelToInputs );
+ };
+
+ /**
+ * Initialize functionality.
+ *
+ * This function exists to prevent the JS file from having to boot itself.
+ * When WordPress enqueues this script, it should have an inline script
+ * attached which calls wp.mediaWidgets.init().
+ *
+ * @memberOf wp.mediaWidgets
+ *
+ * @returns {void}
+ */
+ component.init = function init() {
+ var $document = $( document );
+ $document.on( 'widget-added', component.handleWidgetAdded );
+ $document.on( 'widget-synced widget-updated', component.handleWidgetUpdated );
+
+ /*
+ * Manually trigger widget-added events for media widgets on the admin
+ * screen once they are expanded. The widget-added event is not triggered
+ * for each pre-existing widget on the widgets admin screen like it is
+ * on the customizer. Likewise, the customizer only triggers widget-added
+ * when the widget is expanded to just-in-time construct the widget form
+ * when it is actually going to be displayed. So the following implements
+ * the same for the widgets admin screen, to invoke the widget-added
+ * handler when a pre-existing media widget is expanded.
+ */
+ $( function initializeExistingWidgetContainers() {
+ var widgetContainers;
+ if ( 'widgets' !== window.pagenow ) {
+ return;
+ }
+ widgetContainers = $( '.widgets-holder-wrap:not(#available-widgets)' ).find( 'div.widget' );
+ widgetContainers.one( 'click.toggle-widget-expanded', function toggleWidgetExpanded() {
+ var widgetContainer = $( this );
+ component.handleWidgetAdded( new jQuery.Event( 'widget-added' ), widgetContainer );
+ });
+
+ // Accessibility mode.
+ $( window ).on( 'load', function() {
+ component.setupAccessibleMode();
+ });
+ });
+ };
+
+ return component;
+})( jQuery );
diff --git a/www/crm/wp-admin/js/widgets/media-widgets.min.js b/www/crm/wp-admin/js/widgets/media-widgets.min.js
new file mode 100644
index 00000000..94b0ac54
--- /dev/null
+++ b/www/crm/wp-admin/js/widgets/media-widgets.min.js
@@ -0,0 +1 @@
+wp.mediaWidgets=function(a){"use strict";var b={};return b.controlConstructors={},b.modelConstructors={},b.PersistentDisplaySettingsLibrary=wp.media.controller.Library.extend({initialize:function(a){_.bindAll(this,"handleDisplaySettingChange"),wp.media.controller.Library.prototype.initialize.call(this,a)},handleDisplaySettingChange:function(a){this.get("selectedDisplaySettings").set(a.attributes)},display:function(a){var b,c=this.get("selectedDisplaySettings");return b=wp.media.controller.Library.prototype.display.call(this,a),b.off("change",this.handleDisplaySettingChange),b.set(c.attributes),"custom"===c.get("link_type")&&(b.linkUrl=c.get("link_url")),b.on("change",this.handleDisplaySettingChange),b}}),b.MediaEmbedView=wp.media.view.Embed.extend({initialize:function(a){var b,c=this;wp.media.view.Embed.prototype.initialize.call(c,a),"image"!==c.controller.options.mimeType&&(b=c.controller.states.get("embed"),b.off("scan",b.scanImage,b))},refresh:function(){var b;b="image"===this.controller.options.mimeType?wp.media.view.EmbedImage:wp.media.view.EmbedLink.extend({setAddToWidgetButtonDisabled:function(a){this.views.parent.views.parent.views.get(".media-frame-toolbar")[0].$el.find(".media-button-select").prop("disabled",a)},setErrorNotice:function(b){var c,d=this;c=d.views.parent.$el.find("> .notice:first-child"),b?(c.length||(c=a('<div class="media-widget-embed-notice notice notice-error notice-alt"></div>'),c.hide(),d.views.parent.$el.prepend(c)),c.empty(),c.append(a("<p>",{html:b})),c.slideDown("fast")):c.length&&c.slideUp("fast")},updateoEmbed:function(){var a,b=this;return(a=b.model.get("url"))?(a.match(/^(http|https):\/\/.+\//)||(b.controller.$el.find("#embed-url-field").addClass("invalid"),b.setAddToWidgetButtonDisabled(!0)),void wp.media.view.EmbedLink.prototype.updateoEmbed.call(b)):(b.setErrorNotice(""),void b.setAddToWidgetButtonDisabled(!0))},fetch:function(){var a,b,c,d,e,f,g,h=this;return e=h.model.get("url"),h.dfd&&"pending"===h.dfd.state()&&h.dfd.abort(),a=function(a){h.renderoEmbed({data:{body:a}}),h.controller.$el.find("#embed-url-field").removeClass("invalid"),h.setErrorNotice(""),h.setAddToWidgetButtonDisabled(!1)},d=document.createElement("a"),d.href=e,(b=d.pathname.toLowerCase().match(/\.(\w+)$/))?(c=b[1],void(wp.media.view.settings.embedMimes[c]?0!==wp.media.view.settings.embedMimes[c].indexOf(h.controller.options.mimeType)?h.renderFail():a("<!--success-->"):h.renderFail())):(f=/https?:\/\/www\.youtube\.com\/embed\/([^\/]+)/,g=f.exec(e),g&&(e="https://www.youtube.com/watch?v="+g[1],h.model.attributes.url=e),h.dfd=wp.apiRequest({url:wp.media.view.settings.oEmbedProxyUrl,data:{url:e,maxwidth:h.model.get("width"),maxheight:h.model.get("height"),discover:!1},type:"GET",dataType:"json",context:h}),h.dfd.done(function(b){return h.controller.options.mimeType!==b.type?void h.renderFail():void a(b.html)}),void h.dfd.fail(_.bind(h.renderFail,h)))},renderFail:function(){var a=this;a.controller.$el.find("#embed-url-field").addClass("invalid"),a.setErrorNotice(a.controller.options.invalidEmbedTypeError||"ERROR"),a.setAddToWidgetButtonDisabled(!0)}}),this.settings(new b({controller:this.controller,model:this.model.props,priority:40}))}}),b.MediaFrameSelect=wp.media.view.MediaFrame.Post.extend({createStates:function(){var a=this.options.mimeType,c=[];_.each(wp.media.view.settings.embedMimes,function(b){0===b.indexOf(a)&&c.push(b)}),c.length>0&&(a=c),this.states.add([new b.PersistentDisplaySettingsLibrary({id:"insert",title:this.options.title,selection:this.options.selection,priority:20,toolbar:"main-insert",filterable:"dates",library:wp.media.query({type:a}),multiple:!1,editable:!0,selectedDisplaySettings:this.options.selectedDisplaySettings,displaySettings:!!_.isUndefined(this.options.showDisplaySettings)||this.options.showDisplaySettings,displayUserSettings:!1}),new wp.media.controller.EditImage({model:this.options.editImage}),new wp.media.controller.Embed({metadata:this.options.metadata,type:"image"===this.options.mimeType?"image":"link",invalidEmbedTypeError:this.options.invalidEmbedTypeError})])},mainInsertToolbar:function(a){var b=this;a.set("insert",{style:"primary",priority:80,text:b.options.text,requires:{selection:!0},click:function(){var a=b.state(),c=a.get("selection");b.close(),a.trigger("insert",c).reset()}})},mainEmbedToolbar:function(a){a.view=new wp.media.view.Toolbar.Embed({controller:this,text:this.options.text,event:"insert"})},embedContent:function(){var a=new b.MediaEmbedView({controller:this,model:this.state()}).render();this.content.set(a),wp.media.isTouchDevice||a.url.focus()}}),b.MediaWidgetControl=Backbone.View.extend({l10n:{add_to_widget:"{{add_to_widget}}",add_media:"{{add_media}}"},id_base:"",mime_type:"",events:{"click .notice-missing-attachment a":"handleMediaLibraryLinkClick","click .select-media":"selectMedia","click .placeholder":"selectMedia","click .edit-media":"editMedia"},showDisplaySettings:!0,initialize:function(c){var d=this;if(Backbone.View.prototype.initialize.call(d,c),!(d.model instanceof b.MediaWidgetModel))throw new Error("Missing options.model");if(!c.el)throw new Error("Missing options.el");if(!c.syncContainer)throw new Error("Missing options.syncContainer");if(d.syncContainer=c.syncContainer,d.$el.addClass("media-widget-control"),_.bindAll(d,"syncModelToInputs","render","updateSelectedAttachment","renderPreview"),!d.id_base&&(_.find(b.controlConstructors,function(a,b){return d instanceof a&&(d.id_base=b,!0)}),!d.id_base))throw new Error("Missing id_base.");d.previewTemplateProps=new Backbone.Model(d.mapModelToPreviewTemplateProps()),d.selectedAttachment=new wp.media.model.Attachment,d.renderPreview=_.debounce(d.renderPreview),d.listenTo(d.previewTemplateProps,"change",d.renderPreview),d.model.on("change:attachment_id",d.updateSelectedAttachment),d.model.on("change:url",d.updateSelectedAttachment),d.updateSelectedAttachment(),d.listenTo(d.model,"change",d.syncModelToInputs),d.listenTo(d.model,"change",d.syncModelToPreviewProps),d.listenTo(d.model,"change",d.render),d.$el.on("input change",".title",function(){d.model.set({title:a.trim(a(this).val())})}),d.$el.on("input change",".link",function(){var b=a.trim(a(this).val()),c="custom";d.selectedAttachment.get("linkUrl")===b||d.selectedAttachment.get("link")===b?c="post":d.selectedAttachment.get("url")===b&&(c="file"),d.model.set({link_url:b,link_type:c}),d.displaySettings.set({link:c,linkUrl:b})}),d.displaySettings=new Backbone.Model(_.pick(d.mapModelToMediaFrameProps(_.extend(d.model.defaults(),d.model.toJSON())),_.keys(wp.media.view.settings.defaultProps)))},updateSelectedAttachment:function(){var a,b=this;0===b.model.get("attachment_id")?(b.selectedAttachment.clear(),b.model.set("error",!1)):b.model.get("attachment_id")!==b.selectedAttachment.get("id")&&(a=new wp.media.model.Attachment({id:b.model.get("attachment_id")}),a.fetch().done(function(){b.model.set("error",!1),b.selectedAttachment.set(a.toJSON())}).fail(function(){b.model.set("error","missing_attachment")}))},syncModelToPreviewProps:function(){var a=this;a.previewTemplateProps.set(a.mapModelToPreviewTemplateProps())},syncModelToInputs:function(){var b=this;b.syncContainer.find(".media-widget-instance-property").each(function(){var c,d,e=a(this);d=e.data("property"),c=b.model.get(d),_.isUndefined(c)||(c="array"===b.model.schema[d].type&&_.isArray(c)?c.join(","):"boolean"===b.model.schema[d].type?c?"1":"":String(c),e.val()!==c&&(e.val(c),e.trigger("change")))})},template:function(){var b=this;if(!a("#tmpl-widget-media-"+b.id_base+"-control").length)throw new Error("Missing widget control template for "+b.id_base);return wp.template("widget-media-"+b.id_base+"-control")},render:function(){var a,b=this;b.templateRendered||(b.$el.html(b.template()(b.model.toJSON())),b.renderPreview(),b.templateRendered=!0),a=b.$el.find(".title"),a.is(document.activeElement)||a.val(b.model.get("title")),b.$el.toggleClass("selected",b.isSelected())},renderPreview:function(){throw new Error("renderPreview must be implemented")},isSelected:function(){var a=this;return!a.model.get("error")&&Boolean(a.model.get("attachment_id")||a.model.get("url"))},handleMediaLibraryLinkClick:function(a){var b=this;a.preventDefault(),b.selectMedia()},selectMedia:function(){var c,d,e,f,g=this,h=[];g.isSelected()&&0!==g.model.get("attachment_id")&&h.push(g.selectedAttachment),c=new wp.media.model.Selection(h,{multiple:!1}),f=g.mapModelToMediaFrameProps(g.model.toJSON()),f.size&&g.displaySettings.set("size",f.size),d=new b.MediaFrameSelect({title:g.l10n.add_media,frame:"post",text:g.l10n.add_to_widget,selection:c,mimeType:g.mime_type,selectedDisplaySettings:g.displaySettings,showDisplaySettings:g.showDisplaySettings,metadata:f,state:g.isSelected()&&0===g.model.get("attachment_id")?"embed":"insert",invalidEmbedTypeError:g.l10n.unsupported_file_type}),wp.media.frame=d,d.on("insert",function(){var a={},b=d.state();"embed"===b.get("id")?_.extend(a,{id:0},b.props.toJSON()):_.extend(a,b.get("selection").first().toJSON()),g.selectedAttachment.set(a),g.model.set("error",!1),g.model.set(g.getModelPropsFromMediaFrame(d))}),e=wp.media.model.Attachment.prototype.sync,wp.media.model.Attachment.prototype.sync=function(b){return"delete"===b?e.apply(this,arguments):a.Deferred().rejectWith(this).promise()},d.on("close",function(){wp.media.model.Attachment.prototype.sync=e}),d.$el.addClass("media-widget"),d.open(),c&&c.on("destroy",function(a){g.model.get("attachment_id")===a.get("id")&&g.model.set({attachment_id:0,url:""})}),d.$el.find(".media-frame-menu .media-menu-item.active").focus()},getModelPropsFromMediaFrame:function(a){var b,c,d,e=this;if(b=a.state(),"insert"===b.get("id"))c=b.get("selection").first().toJSON(),c.postUrl=c.link,e.showDisplaySettings&&_.extend(c,a.content.get(".attachments-browser").sidebar.get("display").model.toJSON()),c.sizes&&c.size&&c.sizes[c.size]&&(c.url=c.sizes[c.size].url);else{if("embed"!==b.get("id"))throw new Error("Unexpected state: "+b.get("id"));c=_.extend(b.props.toJSON(),{attachment_id:0},e.model.getEmbedResetProps())}return c.id&&(c.attachment_id=c.id),d=e.mapMediaToModelProps(c),_.each(wp.media.view.settings.embedExts,function(a){a in e.model.schema&&d.url!==d[a]&&(d[a]="")}),d},mapMediaToModelProps:function(a){var b,c=this,d={},e={};return _.each(c.model.schema,function(a,b){"title"!==b&&(d[a.media_prop||b]=b)}),_.each(a,function(a,b){var f=d[b]||b;c.model.schema[f]&&(e[f]=a)}),"custom"===a.size&&(e.width=a.customWidth,e.height=a.customHeight),"post"===a.link?e.link_url=a.postUrl||a.linkUrl:"file"===a.link&&(e.link_url=a.url),!a.attachment_id&&a.id&&(e.attachment_id=a.id),a.url&&(b=a.url.replace(/#.*$/,"").replace(/\?.*$/,"").split(".").pop().toLowerCase(),b in c.model.schema&&(e[b]=a.url)),_.omit(e,"title")},mapModelToMediaFrameProps:function(a){var b=this,c={};return _.each(a,function(a,d){var e=b.model.schema[d]||{};c[e.media_prop||d]=a}),c.attachment_id=c.id,"custom"===c.size&&(c.customWidth=b.model.get("width"),c.customHeight=b.model.get("height")),c},mapModelToPreviewTemplateProps:function(){var a=this,b={};return _.each(a.model.schema,function(c,d){c.hasOwnProperty("should_preview_update")&&!c.should_preview_update||(b[d]=a.model.get(d))}),b.error=a.model.get("error"),b},editMedia:function(){throw new Error("editMedia not implemented")}}),b.MediaWidgetModel=Backbone.Model.extend({idAttribute:"widget_id",schema:{title:{type:"string","default":""},attachment_id:{type:"integer","default":0},url:{type:"string","default":""}},defaults:function(){var a={};return _.each(this.schema,function(b,c){a[c]=b["default"]}),a},set:function(a,b,c){var d,e,f,g=this;return null===a?g:("object"==typeof a?(d=a,e=b):(d={},d[a]=b,e=c),f={},_.each(d,function(a,b){var c;return g.schema[b]?(c=g.schema[b].type,void("array"===c?(f[b]=a,_.isArray(f[b])||(f[b]=f[b].split(/,/)),g.schema[b].items&&"integer"===g.schema[b].items.type&&(f[b]=_.filter(_.map(f[b],function(a){return parseInt(a,10)},function(a){return"number"==typeof a})))):"integer"===c?f[b]=parseInt(a,10):"boolean"===c?f[b]=!(!a||"0"===a||"false"===a):f[b]=a)):void(f[b]=a)}),Backbone.Model.prototype.set.call(this,f,e))},getEmbedResetProps:function(){return{id:0}}}),b.modelCollection=new(Backbone.Collection.extend({model:b.MediaWidgetModel})),b.widgetControls={},b.handleWidgetAdded=function(c,d){var e,f,g,h,i,j,k,l,m,n,o,p=50;g=d.find("> .widget-inside > .form, > .widget-inside > form"),h=g.find("> .id_base").val(),n=g.find("> .widget-id").val(),b.widgetControls[n]||(i=b.controlConstructors[h],i&&(j=b.modelConstructors[h]||b.MediaWidgetModel,e=a("<div></div>"),f=d.find(".widget-content:first"),f.before(e),k={},f.find(".media-widget-instance-property").each(function(){var b=a(this);k[b.data("property")]=b.val()}),k.widget_id=n,m=new j(k),l=new i({el:e,syncContainer:f,model:m}),o=function(){d.hasClass("open")?l.render():setTimeout(o,p)},o(),b.modelCollection.add([m]),b.widgetControls[m.get("widget_id")]=l))},b.setupAccessibleMode=function(){var c,d,e,f,g,h,i,j,k;c=a(".editwidget > form"),0!==c.length&&(e=c.find("> .widget-control-actions > .id_base").val(),g=b.controlConstructors[e],g&&(d=c.find("> .widget-control-actions > .widget-id").val(),h=b.modelConstructors[e]||b.MediaWidgetModel,j=a("<div></div>"),k=c.find("> .widget-inside"),k.before(j),i={},k.find(".media-widget-instance-property").each(function(){var b=a(this);i[b.data("property")]=b.val()}),i.widget_id=d,f=new g({el:j,syncContainer:k,model:new h(i)}),b.modelCollection.add([f.model]),b.widgetControls[f.model.get("widget_id")]=f,f.render()))},b.handleWidgetUpdated=function(c,d){var e,f,g,h,i={};e=d.find("> .widget-inside > .form, > .widget-inside > form"),g=e.find("> .widget-id").val(),h=b.widgetControls[g],h&&(f=e.find("> .widget-content"),f.find(".media-widget-instance-property").each(function(){var b=a(this).data("property");i[b]=a(this).val()}),h.stopListening(h.model,"change",h.syncModelToInputs),h.model.set(i),h.listenTo(h.model,"change",h.syncModelToInputs))},b.init=function(){var c=a(document);c.on("widget-added",b.handleWidgetAdded),c.on("widget-synced widget-updated",b.handleWidgetUpdated),a(function(){var c;"widgets"===window.pagenow&&(c=a(".widgets-holder-wrap:not(#available-widgets)").find("div.widget"),c.one("click.toggle-widget-expanded",function(){var c=a(this);b.handleWidgetAdded(new jQuery.Event("widget-added"),c)}),a(window).on("load",function(){b.setupAccessibleMode()}))})},b}(jQuery); \ No newline at end of file
diff --git a/www/crm/wp-admin/js/widgets/text-widgets.js b/www/crm/wp-admin/js/widgets/text-widgets.js
new file mode 100644
index 00000000..184e7242
--- /dev/null
+++ b/www/crm/wp-admin/js/widgets/text-widgets.js
@@ -0,0 +1,552 @@
+/**
+ * @output wp-admin/js/widgets/text-widgets.js
+ */
+
+/* global tinymce, switchEditors */
+/* eslint consistent-this: [ "error", "control" ] */
+
+/**
+ * @namespace wp.textWidgets
+ */
+wp.textWidgets = ( function( $ ) {
+ 'use strict';
+
+ var component = {
+ dismissedPointers: [],
+ idBases: [ 'text' ]
+ };
+
+ component.TextWidgetControl = Backbone.View.extend(/** @lends wp.textWidgets.TextWidgetControl.prototype */{
+
+ /**
+ * View events.
+ *
+ * @type {Object}
+ */
+ events: {},
+
+ /**
+ * Text widget control.
+ *
+ * @constructs wp.textWidgets.TextWidgetControl
+ * @augments Backbone.View
+ * @abstract
+ *
+ * @param {Object} options - Options.
+ * @param {jQuery} options.el - Control field container element.
+ * @param {jQuery} options.syncContainer - Container element where fields are synced for the server.
+ *
+ * @returns {void}
+ */
+ initialize: function initialize( options ) {
+ var control = this;
+
+ if ( ! options.el ) {
+ throw new Error( 'Missing options.el' );
+ }
+ if ( ! options.syncContainer ) {
+ throw new Error( 'Missing options.syncContainer' );
+ }
+
+ Backbone.View.prototype.initialize.call( control, options );
+ control.syncContainer = options.syncContainer;
+
+ control.$el.addClass( 'text-widget-fields' );
+ control.$el.html( wp.template( 'widget-text-control-fields' ) );
+
+ control.customHtmlWidgetPointer = control.$el.find( '.wp-pointer.custom-html-widget-pointer' );
+ if ( control.customHtmlWidgetPointer.length ) {
+ control.customHtmlWidgetPointer.find( '.close' ).on( 'click', function( event ) {
+ event.preventDefault();
+ control.customHtmlWidgetPointer.hide();
+ $( '#' + control.fields.text.attr( 'id' ) + '-html' ).focus();
+ control.dismissPointers( [ 'text_widget_custom_html' ] );
+ });
+ control.customHtmlWidgetPointer.find( '.add-widget' ).on( 'click', function( event ) {
+ event.preventDefault();
+ control.customHtmlWidgetPointer.hide();
+ control.openAvailableWidgetsPanel();
+ });
+ }
+
+ control.pasteHtmlPointer = control.$el.find( '.wp-pointer.paste-html-pointer' );
+ if ( control.pasteHtmlPointer.length ) {
+ control.pasteHtmlPointer.find( '.close' ).on( 'click', function( event ) {
+ event.preventDefault();
+ control.pasteHtmlPointer.hide();
+ control.editor.focus();
+ control.dismissPointers( [ 'text_widget_custom_html', 'text_widget_paste_html' ] );
+ });
+ }
+
+ control.fields = {
+ title: control.$el.find( '.title' ),
+ text: control.$el.find( '.text' )
+ };
+
+ // Sync input fields to hidden sync fields which actually get sent to the server.
+ _.each( control.fields, function( fieldInput, fieldName ) {
+ fieldInput.on( 'input change', function updateSyncField() {
+ var syncInput = control.syncContainer.find( '.sync-input.' + fieldName );
+ if ( syncInput.val() !== fieldInput.val() ) {
+ syncInput.val( fieldInput.val() );
+ syncInput.trigger( 'change' );
+ }
+ });
+
+ // Note that syncInput cannot be re-used because it will be destroyed with each widget-updated event.
+ fieldInput.val( control.syncContainer.find( '.sync-input.' + fieldName ).val() );
+ });
+ },
+
+ /**
+ * Dismiss pointers for Custom HTML widget.
+ *
+ * @since 4.8.1
+ *
+ * @param {Array} pointers Pointer IDs to dismiss.
+ * @returns {void}
+ */
+ dismissPointers: function dismissPointers( pointers ) {
+ _.each( pointers, function( pointer ) {
+ wp.ajax.post( 'dismiss-wp-pointer', {
+ pointer: pointer
+ });
+ component.dismissedPointers.push( pointer );
+ });
+ },
+
+ /**
+ * Open available widgets panel.
+ *
+ * @since 4.8.1
+ * @returns {void}
+ */
+ openAvailableWidgetsPanel: function openAvailableWidgetsPanel() {
+ var sidebarControl;
+ wp.customize.section.each( function( section ) {
+ if ( section.extended( wp.customize.Widgets.SidebarSection ) && section.expanded() ) {
+ sidebarControl = wp.customize.control( 'sidebars_widgets[' + section.params.sidebarId + ']' );
+ }
+ });
+ if ( ! sidebarControl ) {
+ return;
+ }
+ setTimeout( function() { // Timeout to prevent click event from causing panel to immediately collapse.
+ wp.customize.Widgets.availableWidgetsPanel.open( sidebarControl );
+ wp.customize.Widgets.availableWidgetsPanel.$search.val( 'HTML' ).trigger( 'keyup' );
+ });
+ },
+
+ /**
+ * Update input fields from the sync fields.
+ *
+ * This function is called at the widget-updated and widget-synced events.
+ * A field will only be updated if it is not currently focused, to avoid
+ * overwriting content that the user is entering.
+ *
+ * @returns {void}
+ */
+ updateFields: function updateFields() {
+ var control = this, syncInput;
+
+ if ( ! control.fields.title.is( document.activeElement ) ) {
+ syncInput = control.syncContainer.find( '.sync-input.title' );
+ control.fields.title.val( syncInput.val() );
+ }
+
+ syncInput = control.syncContainer.find( '.sync-input.text' );
+ if ( control.fields.text.is( ':visible' ) ) {
+ if ( ! control.fields.text.is( document.activeElement ) ) {
+ control.fields.text.val( syncInput.val() );
+ }
+ } else if ( control.editor && ! control.editorFocused && syncInput.val() !== control.fields.text.val() ) {
+ control.editor.setContent( wp.editor.autop( syncInput.val() ) );
+ }
+ },
+
+ /**
+ * Initialize editor.
+ *
+ * @returns {void}
+ */
+ initializeEditor: function initializeEditor() {
+ var control = this, changeDebounceDelay = 1000, id, textarea, triggerChangeIfDirty, restoreTextMode = false, needsTextareaChangeTrigger = false, previousValue;
+ textarea = control.fields.text;
+ id = textarea.attr( 'id' );
+ previousValue = textarea.val();
+
+ /**
+ * Trigger change if dirty.
+ *
+ * @returns {void}
+ */
+ triggerChangeIfDirty = function() {
+ var updateWidgetBuffer = 300; // See wp.customize.Widgets.WidgetControl._setupUpdateUI() which uses 250ms for updateWidgetDebounced.
+ if ( control.editor.isDirty() ) {
+
+ /*
+ * Account for race condition in customizer where user clicks Save & Publish while
+ * focus was just previously given to the editor. Since updates to the editor
+ * are debounced at 1 second and since widget input changes are only synced to
+ * settings after 250ms, the customizer needs to be put into the processing
+ * state during the time between the change event is triggered and updateWidget
+ * logic starts. Note that the debounced update-widget request should be able
+ * to be removed with the removal of the update-widget request entirely once
+ * widgets are able to mutate their own instance props directly in JS without
+ * having to make server round-trips to call the respective WP_Widget::update()
+ * callbacks. See <https://core.trac.wordpress.org/ticket/33507>.
+ */
+ if ( wp.customize && wp.customize.state ) {
+ wp.customize.state( 'processing' ).set( wp.customize.state( 'processing' ).get() + 1 );
+ _.delay( function() {
+ wp.customize.state( 'processing' ).set( wp.customize.state( 'processing' ).get() - 1 );
+ }, updateWidgetBuffer );
+ }
+
+ if ( ! control.editor.isHidden() ) {
+ control.editor.save();
+ }
+ }
+
+ // Trigger change on textarea when it has changed so the widget can enter a dirty state.
+ if ( needsTextareaChangeTrigger && previousValue !== textarea.val() ) {
+ textarea.trigger( 'change' );
+ needsTextareaChangeTrigger = false;
+ previousValue = textarea.val();
+ }
+ };
+
+ // Just-in-time force-update the hidden input fields.
+ control.syncContainer.closest( '.widget' ).find( '[name=savewidget]:first' ).on( 'click', function onClickSaveButton() {
+ triggerChangeIfDirty();
+ });
+
+ /**
+ * Build (or re-build) the visual editor.
+ *
+ * @returns {void}
+ */
+ function buildEditor() {
+ var editor, onInit, showPointerElement;
+
+ // Abort building if the textarea is gone, likely due to the widget having been deleted entirely.
+ if ( ! document.getElementById( id ) ) {
+ return;
+ }
+
+ // The user has disabled TinyMCE.
+ if ( typeof window.tinymce === 'undefined' ) {
+ wp.editor.initialize( id, {
+ quicktags: true,
+ mediaButtons: true
+ });
+
+ return;
+ }
+
+ // Destroy any existing editor so that it can be re-initialized after a widget-updated event.
+ if ( tinymce.get( id ) ) {
+ restoreTextMode = tinymce.get( id ).isHidden();
+ wp.editor.remove( id );
+ }
+
+ // Add or enable the `wpview` plugin.
+ $( document ).one( 'wp-before-tinymce-init.text-widget-init', function( event, init ) {
+ // If somebody has removed all plugins, they must have a good reason.
+ // Keep it that way.
+ if ( ! init.plugins ) {
+ return;
+ } else if ( ! /\bwpview\b/.test( init.plugins ) ) {
+ init.plugins += ',wpview';
+ }
+ } );
+
+ wp.editor.initialize( id, {
+ tinymce: {
+ wpautop: true
+ },
+ quicktags: true,
+ mediaButtons: true
+ });
+
+ /**
+ * Show a pointer, focus on dismiss, and speak the contents for a11y.
+ *
+ * @param {jQuery} pointerElement Pointer element.
+ * @returns {void}
+ */
+ showPointerElement = function( pointerElement ) {
+ pointerElement.show();
+ pointerElement.find( '.close' ).focus();
+ wp.a11y.speak( pointerElement.find( 'h3, p' ).map( function() {
+ return $( this ).text();
+ } ).get().join( '\n\n' ) );
+ };
+
+ editor = window.tinymce.get( id );
+ if ( ! editor ) {
+ throw new Error( 'Failed to initialize editor' );
+ }
+ onInit = function() {
+
+ // When a widget is moved in the DOM the dynamically-created TinyMCE iframe will be destroyed and has to be re-built.
+ $( editor.getWin() ).on( 'unload', function() {
+ _.defer( buildEditor );
+ });
+
+ // If a prior mce instance was replaced, and it was in text mode, toggle to text mode.
+ if ( restoreTextMode ) {
+ switchEditors.go( id, 'html' );
+ }
+
+ // Show the pointer.
+ $( '#' + id + '-html' ).on( 'click', function() {
+ control.pasteHtmlPointer.hide(); // Hide the HTML pasting pointer.
+
+ if ( -1 !== component.dismissedPointers.indexOf( 'text_widget_custom_html' ) ) {
+ return;
+ }
+ showPointerElement( control.customHtmlWidgetPointer );
+ });
+
+ // Hide the pointer when switching tabs.
+ $( '#' + id + '-tmce' ).on( 'click', function() {
+ control.customHtmlWidgetPointer.hide();
+ });
+
+ // Show pointer when pasting HTML.
+ editor.on( 'pastepreprocess', function( event ) {
+ var content = event.content;
+ if ( -1 !== component.dismissedPointers.indexOf( 'text_widget_paste_html' ) || ! content || ! /&lt;\w+.*?&gt;/.test( content ) ) {
+ return;
+ }
+
+ // Show the pointer after a slight delay so the user sees what they pasted.
+ _.delay( function() {
+ showPointerElement( control.pasteHtmlPointer );
+ }, 250 );
+ });
+ };
+
+ if ( editor.initialized ) {
+ onInit();
+ } else {
+ editor.on( 'init', onInit );
+ }
+
+ control.editorFocused = false;
+
+ editor.on( 'focus', function onEditorFocus() {
+ control.editorFocused = true;
+ });
+ editor.on( 'paste', function onEditorPaste() {
+ editor.setDirty( true ); // Because pasting doesn't currently set the dirty state.
+ triggerChangeIfDirty();
+ });
+ editor.on( 'NodeChange', function onNodeChange() {
+ needsTextareaChangeTrigger = true;
+ });
+ editor.on( 'NodeChange', _.debounce( triggerChangeIfDirty, changeDebounceDelay ) );
+ editor.on( 'blur hide', function onEditorBlur() {
+ control.editorFocused = false;
+ triggerChangeIfDirty();
+ });
+
+ control.editor = editor;
+ }
+
+ buildEditor();
+ }
+ });
+
+ /**
+ * Mapping of widget ID to instances of TextWidgetControl subclasses.
+ *
+ * @memberOf wp.textWidgets
+ *
+ * @type {Object.<string, wp.textWidgets.TextWidgetControl>}
+ */
+ component.widgetControls = {};
+
+ /**
+ * Handle widget being added or initialized for the first time at the widget-added event.
+ *
+ * @memberOf wp.textWidgets
+ *
+ * @param {jQuery.Event} event - Event.
+ * @param {jQuery} widgetContainer - Widget container element.
+ *
+ * @returns {void}
+ */
+ component.handleWidgetAdded = function handleWidgetAdded( event, widgetContainer ) {
+ var widgetForm, idBase, widgetControl, widgetId, animatedCheckDelay = 50, renderWhenAnimationDone, fieldContainer, syncContainer;
+ widgetForm = widgetContainer.find( '> .widget-inside > .form, > .widget-inside > form' ); // Note: '.form' appears in the customizer, whereas 'form' on the widgets admin screen.
+
+ idBase = widgetForm.find( '> .id_base' ).val();
+ if ( -1 === component.idBases.indexOf( idBase ) ) {
+ return;
+ }
+
+ // Prevent initializing already-added widgets.
+ widgetId = widgetForm.find( '.widget-id' ).val();
+ if ( component.widgetControls[ widgetId ] ) {
+ return;
+ }
+
+ // Bypass using TinyMCE when widget is in legacy mode.
+ if ( ! widgetForm.find( '.visual' ).val() ) {
+ return;
+ }
+
+ /*
+ * Create a container element for the widget control fields.
+ * This is inserted into the DOM immediately before the .widget-content
+ * element because the contents of this element are essentially "managed"
+ * by PHP, where each widget update cause the entire element to be emptied
+ * and replaced with the rendered output of WP_Widget::form() which is
+ * sent back in Ajax request made to save/update the widget instance.
+ * To prevent a "flash of replaced DOM elements and re-initialized JS
+ * components", the JS template is rendered outside of the normal form
+ * container.
+ */
+ fieldContainer = $( '<div></div>' );
+ syncContainer = widgetContainer.find( '.widget-content:first' );
+ syncContainer.before( fieldContainer );
+
+ widgetControl = new component.TextWidgetControl({
+ el: fieldContainer,
+ syncContainer: syncContainer
+ });
+
+ component.widgetControls[ widgetId ] = widgetControl;
+
+ /*
+ * Render the widget once the widget parent's container finishes animating,
+ * as the widget-added event fires with a slideDown of the container.
+ * This ensures that the textarea is visible and an iframe can be embedded
+ * with TinyMCE being able to set contenteditable on it.
+ */
+ renderWhenAnimationDone = function() {
+ if ( ! widgetContainer.hasClass( 'open' ) ) {
+ setTimeout( renderWhenAnimationDone, animatedCheckDelay );
+ } else {
+ widgetControl.initializeEditor();
+ }
+ };
+ renderWhenAnimationDone();
+ };
+
+ /**
+ * Setup widget in accessibility mode.
+ *
+ * @memberOf wp.textWidgets
+ *
+ * @returns {void}
+ */
+ component.setupAccessibleMode = function setupAccessibleMode() {
+ var widgetForm, idBase, widgetControl, fieldContainer, syncContainer;
+ widgetForm = $( '.editwidget > form' );
+ if ( 0 === widgetForm.length ) {
+ return;
+ }
+
+ idBase = widgetForm.find( '> .widget-control-actions > .id_base' ).val();
+ if ( -1 === component.idBases.indexOf( idBase ) ) {
+ return;
+ }
+
+ // Bypass using TinyMCE when widget is in legacy mode.
+ if ( ! widgetForm.find( '.visual' ).val() ) {
+ return;
+ }
+
+ fieldContainer = $( '<div></div>' );
+ syncContainer = widgetForm.find( '> .widget-inside' );
+ syncContainer.before( fieldContainer );
+
+ widgetControl = new component.TextWidgetControl({
+ el: fieldContainer,
+ syncContainer: syncContainer
+ });
+
+ widgetControl.initializeEditor();
+ };
+
+ /**
+ * Sync widget instance data sanitized from server back onto widget model.
+ *
+ * This gets called via the 'widget-updated' event when saving a widget from
+ * the widgets admin screen and also via the 'widget-synced' event when making
+ * a change to a widget in the customizer.
+ *
+ * @memberOf wp.textWidgets
+ *
+ * @param {jQuery.Event} event - Event.
+ * @param {jQuery} widgetContainer - Widget container element.
+ * @returns {void}
+ */
+ component.handleWidgetUpdated = function handleWidgetUpdated( event, widgetContainer ) {
+ var widgetForm, widgetId, widgetControl, idBase;
+ widgetForm = widgetContainer.find( '> .widget-inside > .form, > .widget-inside > form' );
+
+ idBase = widgetForm.find( '> .id_base' ).val();
+ if ( -1 === component.idBases.indexOf( idBase ) ) {
+ return;
+ }
+
+ widgetId = widgetForm.find( '> .widget-id' ).val();
+ widgetControl = component.widgetControls[ widgetId ];
+ if ( ! widgetControl ) {
+ return;
+ }
+
+ widgetControl.updateFields();
+ };
+
+ /**
+ * Initialize functionality.
+ *
+ * This function exists to prevent the JS file from having to boot itself.
+ * When WordPress enqueues this script, it should have an inline script
+ * attached which calls wp.textWidgets.init().
+ *
+ * @memberOf wp.textWidgets
+ *
+ * @returns {void}
+ */
+ component.init = function init() {
+ var $document = $( document );
+ $document.on( 'widget-added', component.handleWidgetAdded );
+ $document.on( 'widget-synced widget-updated', component.handleWidgetUpdated );
+
+ /*
+ * Manually trigger widget-added events for media widgets on the admin
+ * screen once they are expanded. The widget-added event is not triggered
+ * for each pre-existing widget on the widgets admin screen like it is
+ * on the customizer. Likewise, the customizer only triggers widget-added
+ * when the widget is expanded to just-in-time construct the widget form
+ * when it is actually going to be displayed. So the following implements
+ * the same for the widgets admin screen, to invoke the widget-added
+ * handler when a pre-existing media widget is expanded.
+ */
+ $( function initializeExistingWidgetContainers() {
+ var widgetContainers;
+ if ( 'widgets' !== window.pagenow ) {
+ return;
+ }
+ widgetContainers = $( '.widgets-holder-wrap:not(#available-widgets)' ).find( 'div.widget' );
+ widgetContainers.one( 'click.toggle-widget-expanded', function toggleWidgetExpanded() {
+ var widgetContainer = $( this );
+ component.handleWidgetAdded( new jQuery.Event( 'widget-added' ), widgetContainer );
+ });
+
+ // Accessibility mode.
+ $( window ).on( 'load', function() {
+ component.setupAccessibleMode();
+ });
+ });
+ };
+
+ return component;
+})( jQuery );
diff --git a/www/crm/wp-admin/js/widgets/text-widgets.min.js b/www/crm/wp-admin/js/widgets/text-widgets.min.js
new file mode 100644
index 00000000..98e40d26
--- /dev/null
+++ b/www/crm/wp-admin/js/widgets/text-widgets.min.js
@@ -0,0 +1 @@
+wp.textWidgets=function(a){"use strict";var b={dismissedPointers:[],idBases:["text"]};return b.TextWidgetControl=Backbone.View.extend({events:{},initialize:function(b){var c=this;if(!b.el)throw new Error("Missing options.el");if(!b.syncContainer)throw new Error("Missing options.syncContainer");Backbone.View.prototype.initialize.call(c,b),c.syncContainer=b.syncContainer,c.$el.addClass("text-widget-fields"),c.$el.html(wp.template("widget-text-control-fields")),c.customHtmlWidgetPointer=c.$el.find(".wp-pointer.custom-html-widget-pointer"),c.customHtmlWidgetPointer.length&&(c.customHtmlWidgetPointer.find(".close").on("click",function(b){b.preventDefault(),c.customHtmlWidgetPointer.hide(),a("#"+c.fields.text.attr("id")+"-html").focus(),c.dismissPointers(["text_widget_custom_html"])}),c.customHtmlWidgetPointer.find(".add-widget").on("click",function(a){a.preventDefault(),c.customHtmlWidgetPointer.hide(),c.openAvailableWidgetsPanel()})),c.pasteHtmlPointer=c.$el.find(".wp-pointer.paste-html-pointer"),c.pasteHtmlPointer.length&&c.pasteHtmlPointer.find(".close").on("click",function(a){a.preventDefault(),c.pasteHtmlPointer.hide(),c.editor.focus(),c.dismissPointers(["text_widget_custom_html","text_widget_paste_html"])}),c.fields={title:c.$el.find(".title"),text:c.$el.find(".text")},_.each(c.fields,function(a,b){a.on("input change",function(){var d=c.syncContainer.find(".sync-input."+b);d.val()!==a.val()&&(d.val(a.val()),d.trigger("change"))}),a.val(c.syncContainer.find(".sync-input."+b).val())})},dismissPointers:function(a){_.each(a,function(a){wp.ajax.post("dismiss-wp-pointer",{pointer:a}),b.dismissedPointers.push(a)})},openAvailableWidgetsPanel:function(){var a;wp.customize.section.each(function(b){b.extended(wp.customize.Widgets.SidebarSection)&&b.expanded()&&(a=wp.customize.control("sidebars_widgets["+b.params.sidebarId+"]"))}),a&&setTimeout(function(){wp.customize.Widgets.availableWidgetsPanel.open(a),wp.customize.Widgets.availableWidgetsPanel.$search.val("HTML").trigger("keyup")})},updateFields:function(){var a,b=this;b.fields.title.is(document.activeElement)||(a=b.syncContainer.find(".sync-input.title"),b.fields.title.val(a.val())),a=b.syncContainer.find(".sync-input.text"),b.fields.text.is(":visible")?b.fields.text.is(document.activeElement)||b.fields.text.val(a.val()):b.editor&&!b.editorFocused&&a.val()!==b.fields.text.val()&&b.editor.setContent(wp.editor.autop(a.val()))},initializeEditor:function(){function c(){var e,g,l;if(document.getElementById(d)){if("undefined"==typeof window.tinymce)return void wp.editor.initialize(d,{quicktags:!0,mediaButtons:!0});if(tinymce.get(d)&&(j=tinymce.get(d).isHidden(),wp.editor.remove(d)),a(document).one("wp-before-tinymce-init.text-widget-init",function(a,b){b.plugins&&(/\bwpview\b/.test(b.plugins)||(b.plugins+=",wpview"))}),wp.editor.initialize(d,{tinymce:{wpautop:!0},quicktags:!0,mediaButtons:!0}),l=function(b){b.show(),b.find(".close").focus(),wp.a11y.speak(b.find("h3, p").map(function(){return a(this).text()}).get().join("\n\n"))},e=window.tinymce.get(d),!e)throw new Error("Failed to initialize editor");g=function(){a(e.getWin()).on("unload",function(){_.defer(c)}),j&&switchEditors.go(d,"html"),a("#"+d+"-html").on("click",function(){h.pasteHtmlPointer.hide(),-1===b.dismissedPointers.indexOf("text_widget_custom_html")&&l(h.customHtmlWidgetPointer)}),a("#"+d+"-tmce").on("click",function(){h.customHtmlWidgetPointer.hide()}),e.on("pastepreprocess",function(a){var c=a.content;-1===b.dismissedPointers.indexOf("text_widget_paste_html")&&c&&/&lt;\w+.*?&gt;/.test(c)&&_.delay(function(){l(h.pasteHtmlPointer)},250)})},e.initialized?g():e.on("init",g),h.editorFocused=!1,e.on("focus",function(){h.editorFocused=!0}),e.on("paste",function(){e.setDirty(!0),f()}),e.on("NodeChange",function(){k=!0}),e.on("NodeChange",_.debounce(f,i)),e.on("blur hide",function(){h.editorFocused=!1,f()}),h.editor=e}}var d,e,f,g,h=this,i=1e3,j=!1,k=!1;e=h.fields.text,d=e.attr("id"),g=e.val(),f=function(){var a=300;h.editor.isDirty()&&(wp.customize&&wp.customize.state&&(wp.customize.state("processing").set(wp.customize.state("processing").get()+1),_.delay(function(){wp.customize.state("processing").set(wp.customize.state("processing").get()-1)},a)),h.editor.isHidden()||h.editor.save()),k&&g!==e.val()&&(e.trigger("change"),k=!1,g=e.val())},h.syncContainer.closest(".widget").find("[name=savewidget]:first").on("click",function(){f()}),c()}}),b.widgetControls={},b.handleWidgetAdded=function(c,d){var e,f,g,h,i,j,k,l=50;e=d.find("> .widget-inside > .form, > .widget-inside > form"),f=e.find("> .id_base").val(),-1!==b.idBases.indexOf(f)&&(h=e.find(".widget-id").val(),b.widgetControls[h]||e.find(".visual").val()&&(j=a("<div></div>"),k=d.find(".widget-content:first"),k.before(j),g=new b.TextWidgetControl({el:j,syncContainer:k}),b.widgetControls[h]=g,(i=function(){d.hasClass("open")?g.initializeEditor():setTimeout(i,l)})()))},b.setupAccessibleMode=function(){var c,d,e,f,g;c=a(".editwidget > form"),0!==c.length&&(d=c.find("> .widget-control-actions > .id_base").val(),-1!==b.idBases.indexOf(d)&&c.find(".visual").val()&&(f=a("<div></div>"),g=c.find("> .widget-inside"),g.before(f),e=new b.TextWidgetControl({el:f,syncContainer:g}),e.initializeEditor()))},b.handleWidgetUpdated=function(a,c){var d,e,f,g;d=c.find("> .widget-inside > .form, > .widget-inside > form"),g=d.find("> .id_base").val(),-1!==b.idBases.indexOf(g)&&(e=d.find("> .widget-id").val(),f=b.widgetControls[e],f&&f.updateFields())},b.init=function(){var c=a(document);c.on("widget-added",b.handleWidgetAdded),c.on("widget-synced widget-updated",b.handleWidgetUpdated),a(function(){var c;"widgets"===window.pagenow&&(c=a(".widgets-holder-wrap:not(#available-widgets)").find("div.widget"),c.one("click.toggle-widget-expanded",function(){var c=a(this);b.handleWidgetAdded(new jQuery.Event("widget-added"),c)}),a(window).on("load",function(){b.setupAccessibleMode()}))})},b}(jQuery); \ No newline at end of file
diff --git a/www/crm/wp-admin/js/word-count.js b/www/crm/wp-admin/js/word-count.js
new file mode 100644
index 00000000..999a42c5
--- /dev/null
+++ b/www/crm/wp-admin/js/word-count.js
@@ -0,0 +1,218 @@
+/**
+ * Word or character counting functionality. Count words or characters in a
+ * provided text string.
+ *
+ * @namespace wp.utils
+ * @since 2.6.0
+ * @output wp-admin/js/word-count.js
+ */
+
+( function() {
+ /**
+ * Word counting utility
+ *
+ * @namespace wp.utils.wordcounter
+ * @memberof wp.utils
+ *
+ * @class
+ *
+ * @param {Object} settings Optional. Key-value object containing overrides for
+ * settings.
+ * @param {RegExp} settings.HTMLRegExp Optional. Regular expression to find HTML elements.
+ * @param {RegExp} settings.HTMLcommentRegExp Optional. Regular expression to find HTML comments.
+ * @param {RegExp} settings.spaceRegExp Optional. Regular expression to find irregular space
+ * characters.
+ * @param {RegExp} settings.HTMLEntityRegExp Optional. Regular expression to find HTML entities.
+ * @param {RegExp} settings.connectorRegExp Optional. Regular expression to find connectors that
+ * split words.
+ * @param {RegExp} settings.removeRegExp Optional. Regular expression to find remove unwanted
+ * characters to reduce false-positives.
+ * @param {RegExp} settings.astralRegExp Optional. Regular expression to find unwanted
+ * characters when searching for non-words.
+ * @param {RegExp} settings.wordsRegExp Optional. Regular expression to find words by spaces.
+ * @param {RegExp} settings.characters_excluding_spacesRegExp Optional. Regular expression to find characters which
+ * are non-spaces.
+ * @param {RegExp} settings.characters_including_spacesRegExp Optional. Regular expression to find characters
+ * including spaces.
+ * @param {RegExp} settings.shortcodesRegExp Optional. Regular expression to find shortcodes.
+ * @param {Object} settings.l10n Optional. Localization object containing specific
+ * configuration for the current localization.
+ * @param {String} settings.l10n.type Optional. Method of finding words to count.
+ * @param {Array} settings.l10n.shortcodes Optional. Array of shortcodes that should be removed
+ * from the text.
+ *
+ * @return void
+ */
+ function WordCounter( settings ) {
+ var key,
+ shortcodes;
+
+ // Apply provided settings to object settings.
+ if ( settings ) {
+ for ( key in settings ) {
+
+ // Only apply valid settings.
+ if ( settings.hasOwnProperty( key ) ) {
+ this.settings[ key ] = settings[ key ];
+ }
+ }
+ }
+
+ shortcodes = this.settings.l10n.shortcodes;
+
+ // If there are any localization shortcodes, add this as type in the settings.
+ if ( shortcodes && shortcodes.length ) {
+ this.settings.shortcodesRegExp = new RegExp( '\\[\\/?(?:' + shortcodes.join( '|' ) + ')[^\\]]*?\\]', 'g' );
+ }
+ }
+
+ // Default settings.
+ WordCounter.prototype.settings = {
+ HTMLRegExp: /<\/?[a-z][^>]*?>/gi,
+ HTMLcommentRegExp: /<!--[\s\S]*?-->/g,
+ spaceRegExp: /&nbsp;|&#160;/gi,
+ HTMLEntityRegExp: /&\S+?;/g,
+
+ // \u2014 = em-dash
+ connectorRegExp: /--|\u2014/g,
+
+ // Characters to be removed from input text.
+ removeRegExp: new RegExp( [
+ '[',
+
+ // Basic Latin (extract)
+ '\u0021-\u0040\u005B-\u0060\u007B-\u007E',
+
+ // Latin-1 Supplement (extract)
+ '\u0080-\u00BF\u00D7\u00F7',
+
+ /*
+ * The following range consists of:
+ * General Punctuation
+ * Superscripts and Subscripts
+ * Currency Symbols
+ * Combining Diacritical Marks for Symbols
+ * Letterlike Symbols
+ * Number Forms
+ * Arrows
+ * Mathematical Operators
+ * Miscellaneous Technical
+ * Control Pictures
+ * Optical Character Recognition
+ * Enclosed Alphanumerics
+ * Box Drawing
+ * Block Elements
+ * Geometric Shapes
+ * Miscellaneous Symbols
+ * Dingbats
+ * Miscellaneous Mathematical Symbols-A
+ * Supplemental Arrows-A
+ * Braille Patterns
+ * Supplemental Arrows-B
+ * Miscellaneous Mathematical Symbols-B
+ * Supplemental Mathematical Operators
+ * Miscellaneous Symbols and Arrows
+ */
+ '\u2000-\u2BFF',
+
+ // Supplemental Punctuation
+ '\u2E00-\u2E7F',
+ ']'
+ ].join( '' ), 'g' ),
+
+ // Remove UTF-16 surrogate points, see https://en.wikipedia.org/wiki/UTF-16#U.2BD800_to_U.2BDFFF
+ astralRegExp: /[\uD800-\uDBFF][\uDC00-\uDFFF]/g,
+ wordsRegExp: /\S\s+/g,
+ characters_excluding_spacesRegExp: /\S/g,
+
+ /*
+ * Match anything that is not a formatting character, excluding:
+ * \f = form feed
+ * \n = new line
+ * \r = carriage return
+ * \t = tab
+ * \v = vertical tab
+ * \u00AD = soft hyphen
+ * \u2028 = line separator
+ * \u2029 = paragraph separator
+ */
+ characters_including_spacesRegExp: /[^\f\n\r\t\v\u00AD\u2028\u2029]/g,
+ l10n: window.wordCountL10n || {}
+ };
+
+ /**
+ * Counts the number of words (or other specified type) in the specified text.
+ *
+ * @since 2.6.0
+ * @memberof wp.utils.wordcounter
+ *
+ * @param {String} text Text to count elements in.
+ * @param {String} type Optional. Specify type to use.
+ *
+ * @return {Number} The number of items counted.
+ */
+ WordCounter.prototype.count = function( text, type ) {
+ var count = 0;
+
+ // Use default type if none was provided.
+ type = type || this.settings.l10n.type;
+
+ // Sanitize type to one of three possibilities: 'words', 'characters_excluding_spaces' or 'characters_including_spaces'.
+ if ( type !== 'characters_excluding_spaces' && type !== 'characters_including_spaces' ) {
+ type = 'words';
+ }
+
+ // If we have any text at all.
+ if ( text ) {
+ text = text + '\n';
+
+ // Replace all HTML with a new-line.
+ text = text.replace( this.settings.HTMLRegExp, '\n' );
+
+ // Remove all HTML comments.
+ text = text.replace( this.settings.HTMLcommentRegExp, '' );
+
+ // If a shortcode regular expression has been provided use it to remove shortcodes.
+ if ( this.settings.shortcodesRegExp ) {
+ text = text.replace( this.settings.shortcodesRegExp, '\n' );
+ }
+
+ // Normalize non-breaking space to a normal space.
+ text = text.replace( this.settings.spaceRegExp, ' ' );
+
+ if ( type === 'words' ) {
+
+ // Remove HTML Entities.
+ text = text.replace( this.settings.HTMLEntityRegExp, '' );
+
+ // Convert connectors to spaces to count attached text as words.
+ text = text.replace( this.settings.connectorRegExp, ' ' );
+
+ // Remove unwanted characters.
+ text = text.replace( this.settings.removeRegExp, '' );
+ } else {
+
+ // Convert HTML Entities to "a".
+ text = text.replace( this.settings.HTMLEntityRegExp, 'a' );
+
+ // Remove surrogate points.
+ text = text.replace( this.settings.astralRegExp, 'a' );
+ }
+
+ // Match with the selected type regular expression to count the items.
+ text = text.match( this.settings[ type + 'RegExp' ] );
+
+ // If we have any matches, set the count to the number of items found.
+ if ( text ) {
+ count = text.length;
+ }
+ }
+
+ return count;
+ };
+
+ // Add the WordCounter to the WP Utils.
+ window.wp = window.wp || {};
+ window.wp.utils = window.wp.utils || {};
+ window.wp.utils.WordCounter = WordCounter;
+} )();
diff --git a/www/crm/wp-admin/js/word-count.min.js b/www/crm/wp-admin/js/word-count.min.js
new file mode 100644
index 00000000..296ef257
--- /dev/null
+++ b/www/crm/wp-admin/js/word-count.min.js
@@ -0,0 +1 @@
+!function(){function a(a){var b,c;if(a)for(b in a)a.hasOwnProperty(b)&&(this.settings[b]=a[b]);c=this.settings.l10n.shortcodes,c&&c.length&&(this.settings.shortcodesRegExp=new RegExp("\\[\\/?(?:"+c.join("|")+")[^\\]]*?\\]","g"))}a.prototype.settings={HTMLRegExp:/<\/?[a-z][^>]*?>/gi,HTMLcommentRegExp:/<!--[\s\S]*?-->/g,spaceRegExp:/&nbsp;|&#160;/gi,HTMLEntityRegExp:/&\S+?;/g,connectorRegExp:/--|\u2014/g,removeRegExp:new RegExp(["[","!-@[-`{-~","\x80-\xbf\xd7\xf7","\u2000-\u2bff","\u2e00-\u2e7f","]"].join(""),"g"),astralRegExp:/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,wordsRegExp:/\S\s+/g,characters_excluding_spacesRegExp:/\S/g,characters_including_spacesRegExp:/[^\f\n\r\t\v\u00AD\u2028\u2029]/g,l10n:window.wordCountL10n||{}},a.prototype.count=function(a,b){var c=0;return b=b||this.settings.l10n.type,"characters_excluding_spaces"!==b&&"characters_including_spaces"!==b&&(b="words"),a&&(a+="\n",a=a.replace(this.settings.HTMLRegExp,"\n"),a=a.replace(this.settings.HTMLcommentRegExp,""),this.settings.shortcodesRegExp&&(a=a.replace(this.settings.shortcodesRegExp,"\n")),a=a.replace(this.settings.spaceRegExp," "),"words"===b?(a=a.replace(this.settings.HTMLEntityRegExp,""),a=a.replace(this.settings.connectorRegExp," "),a=a.replace(this.settings.removeRegExp,"")):(a=a.replace(this.settings.HTMLEntityRegExp,"a"),a=a.replace(this.settings.astralRegExp,"a")),a=a.match(this.settings[b+"RegExp"]),a&&(c=a.length)),c},window.wp=window.wp||{},window.wp.utils=window.wp.utils||{},window.wp.utils.WordCounter=a}(); \ No newline at end of file
diff --git a/www/crm/wp-admin/js/wp-fullscreen-stub.js b/www/crm/wp-admin/js/wp-fullscreen-stub.js
new file mode 100644
index 00000000..490d18d0
--- /dev/null
+++ b/www/crm/wp-admin/js/wp-fullscreen-stub.js
@@ -0,0 +1,40 @@
+/**
+ * Distraction-Free Writing (wp-fullscreen) backward compatibility stub.
+ *
+ * @deprecated 4.1
+ * @removed 4.3.
+ * @output wp-admin/js/wp-fullscreen-stub.js
+ */
+( function() {
+ var noop = function(){};
+
+ window.wp = window.wp || {};
+ window.wp.editor = window.wp.editor || {};
+ window.wp.editor.fullscreen = {
+ bind_resize: noop,
+ dfwWidth: noop,
+ off: noop,
+ on: noop,
+ refreshButtons: noop,
+ resizeTextarea: noop,
+ save: noop,
+ switchmode: noop,
+ toggleUI: noop,
+
+ settings: {},
+ pubsub: {
+ publish: noop,
+ subscribe: noop,
+ unsubscribe: noop,
+ topics: {}
+ },
+ fade: {
+ In: noop,
+ Out: noop
+ },
+ ui: {
+ fade: noop,
+ init: noop
+ }
+ };
+}());
diff --git a/www/crm/wp-admin/js/wp-fullscreen-stub.min.js b/www/crm/wp-admin/js/wp-fullscreen-stub.min.js
new file mode 100644
index 00000000..11f3357e
--- /dev/null
+++ b/www/crm/wp-admin/js/wp-fullscreen-stub.min.js
@@ -0,0 +1 @@
+!function(){var a=function(){};window.wp=window.wp||{},window.wp.editor=window.wp.editor||{},window.wp.editor.fullscreen={bind_resize:a,dfwWidth:a,off:a,on:a,refreshButtons:a,resizeTextarea:a,save:a,switchmode:a,toggleUI:a,settings:{},pubsub:{publish:a,subscribe:a,unsubscribe:a,topics:{}},fade:{In:a,Out:a},ui:{fade:a,init:a}}}(); \ No newline at end of file
diff --git a/www/crm/wp-admin/js/xfn.js b/www/crm/wp-admin/js/xfn.js
new file mode 100644
index 00000000..61605a32
--- /dev/null
+++ b/www/crm/wp-admin/js/xfn.js
@@ -0,0 +1,279 @@
+/**
+ * Generates the XHTML Friends Network 'rel' string from the inputs.
+ *
+ * @deprecated 3.5.0
+ * @output wp-admin/js/xfn.js
+ */
+jQuery( document ).ready(function( $ ) {
+ $( '#link_rel' ).prop( 'readonly', true );
+ $( '#linkxfndiv input' ).bind( 'click keyup', function() {
+ var isMe = $( '#me' ).is( ':checked' ), inputs = '';
+ $( 'input.valinp' ).each( function() {
+ if ( isMe ) {
+ $( this ).prop( 'disabled', true ).parent().addClass( 'disabled' );
+ } else {
+ $( this ).removeAttr( 'disabled' ).parent().removeClass( 'disabled' );
+ if ( $( this ).is( ':checked' ) && $( this ).val() !== '') {
+ inputs += $( this ).val() + ' ';
+ }
+ }
+ });
+ $( '#link_rel' ).val( ( isMe ) ? 'me' : inputs.substr( 0,inputs.length - 1 ) );
+ });
+});
+
+// Privacy request action handling
+jQuery( document ).ready( function( $ ) {
+ var strings = window.privacyToolsL10n || {};
+
+ function setActionState( $action, state ) {
+ $action.children().hide();
+ $action.children( '.' + state ).show();
+ }
+
+ function clearResultsAfterRow( $requestRow ) {
+ $requestRow.removeClass( 'has-request-results' );
+
+ if ( $requestRow.next().hasClass( 'request-results' ) ) {
+ $requestRow.next().remove();
+ }
+ }
+
+ function appendResultsAfterRow( $requestRow, classes, summaryMessage, additionalMessages ) {
+ var itemList = '',
+ resultRowClasses = 'request-results';
+
+ clearResultsAfterRow( $requestRow );
+
+ if ( additionalMessages.length ) {
+ $.each( additionalMessages, function( index, value ) {
+ itemList = itemList + '<li>' + value + '</li>';
+ });
+ itemList = '<ul>' + itemList + '</ul>';
+ }
+
+ $requestRow.addClass( 'has-request-results' );
+
+ if ( $requestRow.hasClass( 'status-request-confirmed' ) ) {
+ resultRowClasses = resultRowClasses + ' status-request-confirmed';
+ }
+
+ if ( $requestRow.hasClass( 'status-request-failed' ) ) {
+ resultRowClasses = resultRowClasses + ' status-request-failed';
+ }
+
+ $requestRow.after( function() {
+ return '<tr class="' + resultRowClasses + '"><th colspan="5">' +
+ '<div class="notice inline notice-alt ' + classes + '">' +
+ '<p>' + summaryMessage + '</p>' +
+ itemList +
+ '</div>' +
+ '</td>' +
+ '</tr>';
+ });
+ }
+
+ $( '.export-personal-data-handle' ).click( function( event ) {
+
+ var $this = $( this ),
+ $action = $this.parents( '.export-personal-data' ),
+ $requestRow = $this.parents( 'tr' ),
+ requestID = $action.data( 'request-id' ),
+ nonce = $action.data( 'nonce' ),
+ exportersCount = $action.data( 'exporters-count' ),
+ sendAsEmail = $action.data( 'send-as-email' ) ? true : false;
+
+ event.preventDefault();
+ event.stopPropagation();
+
+ $action.blur();
+ clearResultsAfterRow( $requestRow );
+
+ function onExportDoneSuccess( zipUrl ) {
+ setActionState( $action, 'export-personal-data-success' );
+ if ( 'undefined' !== typeof zipUrl ) {
+ window.location = zipUrl;
+ } else if ( ! sendAsEmail ) {
+ onExportFailure( strings.noExportFile );
+ }
+ }
+
+ function onExportFailure( errorMessage ) {
+ setActionState( $action, 'export-personal-data-failed' );
+ if ( errorMessage ) {
+ appendResultsAfterRow( $requestRow, 'notice-error', strings.exportError, [ errorMessage ] );
+ }
+ }
+
+ function doNextExport( exporterIndex, pageIndex ) {
+ $.ajax(
+ {
+ url: window.ajaxurl,
+ data: {
+ action: 'wp-privacy-export-personal-data',
+ exporter: exporterIndex,
+ id: requestID,
+ page: pageIndex,
+ security: nonce,
+ sendAsEmail: sendAsEmail
+ },
+ method: 'post'
+ }
+ ).done( function( response ) {
+ var responseData = response.data;
+
+ if ( ! response.success ) {
+
+ // e.g. invalid request ID
+ onExportFailure( response.data );
+ return;
+ }
+
+ if ( ! responseData.done ) {
+ setTimeout( doNextExport( exporterIndex, pageIndex + 1 ) );
+ } else {
+ if ( exporterIndex < exportersCount ) {
+ setTimeout( doNextExport( exporterIndex + 1, 1 ) );
+ } else {
+ onExportDoneSuccess( responseData.url );
+ }
+ }
+ }).fail( function( jqxhr, textStatus, error ) {
+
+ // e.g. Nonce failure
+ onExportFailure( error );
+ });
+ }
+
+ // And now, let's begin
+ setActionState( $action, 'export-personal-data-processing' );
+ doNextExport( 1, 1 );
+ });
+
+ $( '.remove-personal-data-handle' ).click( function( event ) {
+
+ var $this = $( this ),
+ $action = $this.parents( '.remove-personal-data' ),
+ $requestRow = $this.parents( 'tr' ),
+ requestID = $action.data( 'request-id' ),
+ nonce = $action.data( 'nonce' ),
+ erasersCount = $action.data( 'erasers-count' ),
+ hasRemoved = false,
+ hasRetained = false,
+ messages = [];
+
+ event.stopPropagation();
+
+ $action.blur();
+ clearResultsAfterRow( $requestRow );
+
+ function onErasureDoneSuccess() {
+ var summaryMessage = strings.noDataFound;
+ var classes = 'notice-success';
+
+ setActionState( $action, 'remove-personal-data-idle' );
+
+ if ( false === hasRemoved ) {
+ if ( false === hasRetained ) {
+ summaryMessage = strings.noDataFound;
+ } else {
+ summaryMessage = strings.noneRemoved;
+ classes = 'notice-warning';
+ }
+ } else {
+ if ( false === hasRetained ) {
+ summaryMessage = strings.foundAndRemoved;
+ } else {
+ summaryMessage = strings.someNotRemoved;
+ classes = 'notice-warning';
+ }
+ }
+ appendResultsAfterRow( $requestRow, 'notice-success', summaryMessage, messages );
+ }
+
+ function onErasureFailure() {
+ setActionState( $action, 'remove-personal-data-failed' );
+ appendResultsAfterRow( $requestRow, 'notice-error', strings.removalError, [] );
+ }
+
+ function doNextErasure( eraserIndex, pageIndex ) {
+ $.ajax({
+ url: window.ajaxurl,
+ data: {
+ action: 'wp-privacy-erase-personal-data',
+ eraser: eraserIndex,
+ id: requestID,
+ page: pageIndex,
+ security: nonce
+ },
+ method: 'post'
+ }).done( function( response ) {
+ var responseData = response.data;
+
+ if ( ! response.success ) {
+ onErasureFailure();
+ return;
+ }
+ if ( responseData.items_removed ) {
+ hasRemoved = hasRemoved || responseData.items_removed;
+ }
+ if ( responseData.items_retained ) {
+ hasRetained = hasRetained || responseData.items_retained;
+ }
+ if ( responseData.messages ) {
+ messages = messages.concat( responseData.messages );
+ }
+ if ( ! responseData.done ) {
+ setTimeout( doNextErasure( eraserIndex, pageIndex + 1 ) );
+ } else {
+ if ( eraserIndex < erasersCount ) {
+ setTimeout( doNextErasure( eraserIndex + 1, 1 ) );
+ } else {
+ onErasureDoneSuccess();
+ }
+ }
+ }).fail( function() {
+ onErasureFailure();
+ });
+ }
+
+ // And now, let's begin
+ setActionState( $action, 'remove-personal-data-processing' );
+
+ doNextErasure( 1, 1 );
+ });
+});
+
+( function( $ ) {
+
+ // Privacy policy page, copy button.
+ $( document ).on( 'click', function( event ) {
+ var $target = $( event.target );
+ var $parent, $container, range;
+
+ if ( $target.is( 'button.privacy-text-copy' ) ) {
+ $parent = $target.parent().parent();
+ $container = $parent.find( 'div.wp-suggested-text' );
+
+ if ( ! $container.length ) {
+ $container = $parent.find( 'div.policy-text' );
+ }
+
+ if ( $container.length ) {
+ try {
+ window.getSelection().removeAllRanges();
+ range = document.createRange();
+ $container.addClass( 'hide-privacy-policy-tutorial' );
+
+ range.selectNodeContents( $container[0] );
+ window.getSelection().addRange( range );
+ document.execCommand( 'copy' );
+
+ $container.removeClass( 'hide-privacy-policy-tutorial' );
+ window.getSelection().removeAllRanges();
+ } catch ( er ) {}
+ }
+ }
+ });
+
+} ( jQuery ) );
diff --git a/www/crm/wp-admin/js/xfn.min.js b/www/crm/wp-admin/js/xfn.min.js
new file mode 100644
index 00000000..53250bb7
--- /dev/null
+++ b/www/crm/wp-admin/js/xfn.min.js
@@ -0,0 +1 @@
+jQuery(document).ready(function(a){a("#link_rel").prop("readonly",!0),a("#linkxfndiv input").bind("click keyup",function(){var b=a("#me").is(":checked"),c="";a("input.valinp").each(function(){b?a(this).prop("disabled",!0).parent().addClass("disabled"):(a(this).removeAttr("disabled").parent().removeClass("disabled"),a(this).is(":checked")&&""!==a(this).val()&&(c+=a(this).val()+" "))}),a("#link_rel").val(b?"me":c.substr(0,c.length-1))})}),jQuery(document).ready(function(a){function b(a,b){a.children().hide(),a.children("."+b).show()}function c(a){a.removeClass("has-request-results"),a.next().hasClass("request-results")&&a.next().remove()}function d(b,d,e,f){var g="",h="request-results";c(b),f.length&&(a.each(f,function(a,b){g=g+"<li>"+b+"</li>"}),g="<ul>"+g+"</ul>"),b.addClass("has-request-results"),b.hasClass("status-request-confirmed")&&(h+=" status-request-confirmed"),b.hasClass("status-request-failed")&&(h+=" status-request-failed"),b.after(function(){return'<tr class="'+h+'"><th colspan="5"><div class="notice inline notice-alt '+d+'"><p>'+e+"</p>"+g+"</div></td></tr>"})}var e=window.privacyToolsL10n||{};a(".export-personal-data-handle").click(function(f){function g(a){b(k,"export-personal-data-success"),"undefined"!=typeof a?window.location=a:p||h(e.noExportFile)}function h(a){b(k,"export-personal-data-failed"),a&&d(l,"notice-error",e.exportError,[a])}function i(b,c){a.ajax({url:window.ajaxurl,data:{action:"wp-privacy-export-personal-data",exporter:b,id:m,page:c,security:n,sendAsEmail:p},method:"post"}).done(function(a){var d=a.data;return a.success?void(d.done?b<o?setTimeout(i(b+1,1)):g(d.url):setTimeout(i(b,c+1))):void h(a.data)}).fail(function(a,b,c){h(c)})}var j=a(this),k=j.parents(".export-personal-data"),l=j.parents("tr"),m=k.data("request-id"),n=k.data("nonce"),o=k.data("exporters-count"),p=!!k.data("send-as-email");f.preventDefault(),f.stopPropagation(),k.blur(),c(l),b(k,"export-personal-data-processing"),i(1,1)}),a(".remove-personal-data-handle").click(function(f){function g(){var a=e.noDataFound,c="notice-success";b(k,"remove-personal-data-idle"),!1===p?!1===q?a=e.noDataFound:(a=e.noneRemoved,c="notice-warning"):!1===q?a=e.foundAndRemoved:(a=e.someNotRemoved,c="notice-warning"),d(l,"notice-success",a,r)}function h(){b(k,"remove-personal-data-failed"),d(l,"notice-error",e.removalError,[])}function i(b,c){a.ajax({url:window.ajaxurl,data:{action:"wp-privacy-erase-personal-data",eraser:b,id:m,page:c,security:n},method:"post"}).done(function(a){var d=a.data;return a.success?(d.items_removed&&(p=p||d.items_removed),d.items_retained&&(q=q||d.items_retained),d.messages&&(r=r.concat(d.messages)),void(d.done?b<o?setTimeout(i(b+1,1)):g():setTimeout(i(b,c+1)))):void h()}).fail(function(){h()})}var j=a(this),k=j.parents(".remove-personal-data"),l=j.parents("tr"),m=k.data("request-id"),n=k.data("nonce"),o=k.data("erasers-count"),p=!1,q=!1,r=[];f.stopPropagation(),k.blur(),c(l),b(k,"remove-personal-data-processing"),i(1,1)})}),function(a){a(document).on("click",function(b){var c,d,e,f=a(b.target);if(f.is("button.privacy-text-copy")&&(c=f.parent().parent(),d=c.find("div.wp-suggested-text"),d.length||(d=c.find("div.policy-text")),d.length))try{window.getSelection().removeAllRanges(),e=document.createRange(),d.addClass("hide-privacy-policy-tutorial"),e.selectNodeContents(d[0]),window.getSelection().addRange(e),document.execCommand("copy"),d.removeClass("hide-privacy-policy-tutorial"),window.getSelection().removeAllRanges()}catch(g){}})}(jQuery); \ No newline at end of file
diff --git a/www/crm/wp-admin/link-add.php b/www/crm/wp-admin/link-add.php
new file mode 100644
index 00000000..ff617d57
--- /dev/null
+++ b/www/crm/wp-admin/link-add.php
@@ -0,0 +1,31 @@
+<?php
+/**
+ * Add Link Administration Screen.
+ *
+ * @package WordPress
+ * @subpackage Administration
+ */
+
+/** Load WordPress Administration Bootstrap */
+require_once( dirname( __FILE__ ) . '/admin.php' );
+
+if ( ! current_user_can( 'manage_links' ) ) {
+ wp_die( __( 'Sorry, you are not allowed to add links to this site.' ) );
+}
+
+$title = __( 'Add New Link' );
+$parent_file = 'link-manager.php';
+
+wp_reset_vars( array( 'action', 'cat_id', 'link_id' ) );
+
+wp_enqueue_script( 'link' );
+wp_enqueue_script( 'xfn' );
+
+if ( wp_is_mobile() ) {
+ wp_enqueue_script( 'jquery-touch-punch' );
+}
+
+$link = get_default_link_to_edit();
+include( ABSPATH . 'wp-admin/edit-link-form.php' );
+
+require( ABSPATH . 'wp-admin/admin-footer.php' );
diff --git a/www/crm/wp-admin/link-manager.php b/www/crm/wp-admin/link-manager.php
new file mode 100644
index 00000000..656c2865
--- /dev/null
+++ b/www/crm/wp-admin/link-manager.php
@@ -0,0 +1,129 @@
+<?php
+/**
+ * Link Management Administration Screen.
+ *
+ * @package WordPress
+ * @subpackage Administration
+ */
+
+/** Load WordPress Administration Bootstrap */
+require_once( dirname( __FILE__ ) . '/admin.php' );
+if ( ! current_user_can( 'manage_links' ) ) {
+ wp_die( __( 'Sorry, you are not allowed to edit the links for this site.' ) );
+}
+
+$wp_list_table = _get_list_table( 'WP_Links_List_Table' );
+
+// Handle bulk deletes
+$doaction = $wp_list_table->current_action();
+
+if ( $doaction && isset( $_REQUEST['linkcheck'] ) ) {
+ check_admin_referer( 'bulk-bookmarks' );
+
+ $redirect_to = admin_url( 'link-manager.php' );
+ $bulklinks = (array) $_REQUEST['linkcheck'];
+
+ if ( 'delete' == $doaction ) {
+ foreach ( $bulklinks as $link_id ) {
+ $link_id = (int) $link_id;
+
+ wp_delete_link( $link_id );
+ }
+
+ $redirect_to = add_query_arg( 'deleted', count( $bulklinks ), $redirect_to );
+ } else {
+ /** This action is documented in wp-admin/edit-comments.php */
+ $redirect_to = apply_filters( 'handle_bulk_actions-' . get_current_screen()->id, $redirect_to, $doaction, $bulklinks );
+ }
+ wp_redirect( $redirect_to );
+ exit;
+} elseif ( ! empty( $_GET['_wp_http_referer'] ) ) {
+ wp_redirect( remove_query_arg( array( '_wp_http_referer', '_wpnonce' ), wp_unslash( $_SERVER['REQUEST_URI'] ) ) );
+ exit;
+}
+
+$wp_list_table->prepare_items();
+
+$title = __( 'Links' );
+$this_file = $parent_file = 'link-manager.php';
+
+get_current_screen()->add_help_tab(
+ array(
+ 'id' => 'overview',
+ 'title' => __( 'Overview' ),
+ 'content' =>
+ '<p>' . sprintf( __( 'You can add links here to be displayed on your site, usually using <a href="%s">Widgets</a>. By default, links to several sites in the WordPress community are included as examples.' ), 'widgets.php' ) . '</p>' .
+ '<p>' . __( 'Links may be separated into Link Categories; these are different than the categories used on your posts.' ) . '</p>' .
+ '<p>' . __( 'You can customize the display of this screen using the Screen Options tab and/or the dropdown filters above the links table.' ) . '</p>',
+ )
+);
+get_current_screen()->add_help_tab(
+ array(
+ 'id' => 'deleting-links',
+ 'title' => __( 'Deleting Links' ),
+ 'content' =>
+ '<p>' . __( 'If you delete a link, it will be removed permanently, as Links do not have a Trash function yet.' ) . '</p>',
+ )
+);
+
+get_current_screen()->set_help_sidebar(
+ '<p><strong>' . __( 'For more information:' ) . '</strong></p>' .
+ '<p>' . __( '<a href="https://codex.wordpress.org/Links_Screen">Documentation on Managing Links</a>' ) . '</p>' .
+ '<p>' . __( '<a href="https://wordpress.org/support/">Support</a>' ) . '</p>'
+);
+
+get_current_screen()->set_screen_reader_content(
+ array(
+ 'heading_list' => __( 'Links list' ),
+ )
+);
+
+include_once( ABSPATH . 'wp-admin/admin-header.php' );
+
+if ( ! current_user_can( 'manage_links' ) ) {
+ wp_die( __( 'Sorry, you are not allowed to edit the links for this site.' ) );
+}
+
+?>
+
+<div class="wrap nosubsub">
+<h1 class="wp-heading-inline">
+<?php
+echo esc_html( $title );
+?>
+</h1>
+
+<a href="link-add.php" class="page-title-action"><?php echo esc_html_x( 'Add New', 'link' ); ?></a>
+
+<?php
+if ( isset( $_REQUEST['s'] ) && strlen( $_REQUEST['s'] ) ) {
+ /* translators: %s: search keywords */
+ printf( '<span class="subtitle">' . __( 'Search results for &#8220;%s&#8221;' ) . '</span>', esc_html( wp_unslash( $_REQUEST['s'] ) ) );
+}
+?>
+
+<hr class="wp-header-end">
+
+<?php
+if ( isset( $_REQUEST['deleted'] ) ) {
+ echo '<div id="message" class="updated notice is-dismissible"><p>';
+ $deleted = (int) $_REQUEST['deleted'];
+ printf( _n( '%s link deleted.', '%s links deleted', $deleted ), $deleted );
+ echo '</p></div>';
+ $_SERVER['REQUEST_URI'] = remove_query_arg( array( 'deleted' ), $_SERVER['REQUEST_URI'] );
+}
+?>
+
+<form id="posts-filter" method="get">
+
+<?php $wp_list_table->search_box( __( 'Search Links' ), 'link' ); ?>
+
+<?php $wp_list_table->display(); ?>
+
+<div id="ajax-response"></div>
+</form>
+
+</div>
+
+<?php
+include( ABSPATH . 'wp-admin/admin-footer.php' );
diff --git a/www/crm/wp-admin/link-parse-opml.php b/www/crm/wp-admin/link-parse-opml.php
new file mode 100644
index 00000000..287d66c5
--- /dev/null
+++ b/www/crm/wp-admin/link-parse-opml.php
@@ -0,0 +1,96 @@
+<?php
+/**
+ * Parse OPML XML files and store in globals.
+ *
+ * @package WordPress
+ * @subpackage Administration
+ */
+
+if ( ! defined( 'ABSPATH' ) ) {
+ die();
+}
+
+/**
+ * @global string $opml
+ */
+global $opml;
+
+/**
+ * XML callback function for the start of a new XML tag.
+ *
+ * @since 0.71
+ * @access private
+ *
+ * @global array $names
+ * @global array $urls
+ * @global array $targets
+ * @global array $descriptions
+ * @global array $feeds
+ *
+ * @param mixed $parser XML Parser resource.
+ * @param string $tagName XML element name.
+ * @param array $attrs XML element attributes.
+ */
+function startElement( $parser, $tagName, $attrs ) {
+ global $names, $urls, $targets, $descriptions, $feeds;
+
+ if ( 'OUTLINE' === $tagName ) {
+ $name = '';
+ if ( isset( $attrs['TEXT'] ) ) {
+ $name = $attrs['TEXT'];
+ }
+ if ( isset( $attrs['TITLE'] ) ) {
+ $name = $attrs['TITLE'];
+ }
+ $url = '';
+ if ( isset( $attrs['URL'] ) ) {
+ $url = $attrs['URL'];
+ }
+ if ( isset( $attrs['HTMLURL'] ) ) {
+ $url = $attrs['HTMLURL'];
+ }
+
+ // Save the data away.
+ $names[] = $name;
+ $urls[] = $url;
+ $targets[] = isset( $attrs['TARGET'] ) ? $attrs['TARGET'] : '';
+ $feeds[] = isset( $attrs['XMLURL'] ) ? $attrs['XMLURL'] : '';
+ $descriptions[] = isset( $attrs['DESCRIPTION'] ) ? $attrs['DESCRIPTION'] : '';
+ } // End if outline.
+}
+
+/**
+ * XML callback function that is called at the end of a XML tag.
+ *
+ * @since 0.71
+ * @access private
+ *
+ * @param mixed $parser XML Parser resource.
+ * @param string $tagName XML tag name.
+ */
+function endElement( $parser, $tagName ) {
+ // Nothing to do.
+}
+
+// Create an XML parser
+if ( ! function_exists( 'xml_parser_create' ) ) {
+ trigger_error( __( "PHP's XML extension is not available. Please contact your hosting provider to enable PHP's XML extension." ) );
+ wp_die( __( "PHP's XML extension is not available. Please contact your hosting provider to enable PHP's XML extension." ) );
+}
+
+$xml_parser = xml_parser_create();
+
+// Set the functions to handle opening and closing tags
+xml_set_element_handler( $xml_parser, 'startElement', 'endElement' );
+
+if ( ! xml_parse( $xml_parser, $opml, true ) ) {
+ printf(
+ /* translators: 1: error message, 2: line number */
+ __( 'XML Error: %1$s at line %2$s' ),
+ xml_error_string( xml_get_error_code( $xml_parser ) ),
+ xml_get_current_line_number( $xml_parser )
+ );
+}
+
+// Free up memory used by the XML parser
+xml_parser_free( $xml_parser );
diff --git a/www/crm/wp-admin/link.php b/www/crm/wp-admin/link.php
new file mode 100644
index 00000000..ed293bc8
--- /dev/null
+++ b/www/crm/wp-admin/link.php
@@ -0,0 +1,125 @@
+<?php
+/**
+ * Manage link administration actions.
+ *
+ * This page is accessed by the link management pages and handles the forms and
+ * Ajax processes for link actions.
+ *
+ * @package WordPress
+ * @subpackage Administration
+ */
+
+/** Load WordPress Administration Bootstrap */
+require_once( dirname( __FILE__ ) . '/admin.php' );
+
+wp_reset_vars( array( 'action', 'cat_id', 'link_id' ) );
+
+if ( ! current_user_can( 'manage_links' ) ) {
+ wp_link_manager_disabled_message();
+}
+
+if ( ! empty( $_POST['deletebookmarks'] ) ) {
+ $action = 'deletebookmarks';
+}
+if ( ! empty( $_POST['move'] ) ) {
+ $action = 'move';
+}
+if ( ! empty( $_POST['linkcheck'] ) ) {
+ $linkcheck = $_POST['linkcheck'];
+}
+
+$this_file = admin_url( 'link-manager.php' );
+
+switch ( $action ) {
+ case 'deletebookmarks':
+ check_admin_referer( 'bulk-bookmarks' );
+
+ // For each link id (in $linkcheck[]) change category to selected value.
+ if ( count( $linkcheck ) == 0 ) {
+ wp_redirect( $this_file );
+ exit;
+ }
+
+ $deleted = 0;
+ foreach ( $linkcheck as $link_id ) {
+ $link_id = (int) $link_id;
+
+ if ( wp_delete_link( $link_id ) ) {
+ $deleted++;
+ }
+ }
+
+ wp_redirect( "$this_file?deleted=$deleted" );
+ exit;
+
+ case 'move':
+ check_admin_referer( 'bulk-bookmarks' );
+
+ // For each link id (in $linkcheck[]) change category to selected value.
+ if ( count( $linkcheck ) == 0 ) {
+ wp_redirect( $this_file );
+ exit;
+ }
+ $all_links = join( ',', $linkcheck );
+ /*
+ * Should now have an array of links we can change:
+ * $q = $wpdb->query("update $wpdb->links SET link_category='$category' WHERE link_id IN ($all_links)");
+ */
+
+ wp_redirect( $this_file );
+ exit;
+
+ case 'add':
+ check_admin_referer( 'add-bookmark' );
+
+ $redir = wp_get_referer();
+ if ( add_link() ) {
+ $redir = add_query_arg( 'added', 'true', $redir );
+ }
+
+ wp_redirect( $redir );
+ exit;
+
+ case 'save':
+ $link_id = (int) $_POST['link_id'];
+ check_admin_referer( 'update-bookmark_' . $link_id );
+
+ edit_link( $link_id );
+
+ wp_redirect( $this_file );
+ exit;
+
+ case 'delete':
+ $link_id = (int) $_GET['link_id'];
+ check_admin_referer( 'delete-bookmark_' . $link_id );
+
+ wp_delete_link( $link_id );
+
+ wp_redirect( $this_file );
+ exit;
+
+ case 'edit':
+ wp_enqueue_script( 'link' );
+ wp_enqueue_script( 'xfn' );
+
+ if ( wp_is_mobile() ) {
+ wp_enqueue_script( 'jquery-touch-punch' );
+ }
+
+ $parent_file = 'link-manager.php';
+ $submenu_file = 'link-manager.php';
+ $title = __( 'Edit Link' );
+
+ $link_id = (int) $_GET['link_id'];
+
+ if ( ! $link = get_link_to_edit( $link_id ) ) {
+ wp_die( __( 'Link not found.' ) );
+ }
+
+ include( ABSPATH . 'wp-admin/edit-link-form.php' );
+ include( ABSPATH . 'wp-admin/admin-footer.php' );
+ break;
+
+ default:
+ break;
+}
diff --git a/www/crm/wp-admin/load-scripts.php b/www/crm/wp-admin/load-scripts.php
new file mode 100644
index 00000000..b2e63b43
--- /dev/null
+++ b/www/crm/wp-admin/load-scripts.php
@@ -0,0 +1,65 @@
+<?php
+
+/**
+ * Disable error reporting
+ *
+ * Set this to error_reporting( -1 ) for debugging.
+ */
+error_reporting( 0 );
+
+/** Set ABSPATH for execution */
+if ( ! defined( 'ABSPATH' ) ) {
+ define( 'ABSPATH', dirname( dirname( __FILE__ ) ) . '/' );
+}
+
+define( 'WPINC', 'wp-includes' );
+
+$load = $_GET['load'];
+if ( is_array( $load ) ) {
+ $load = implode( '', $load );
+}
+
+$load = preg_replace( '/[^a-z0-9,_-]+/i', '', $load );
+$load = array_unique( explode( ',', $load ) );
+
+if ( empty( $load ) ) {
+ exit;
+}
+
+require( ABSPATH . 'wp-admin/includes/noop.php' );
+require( ABSPATH . WPINC . '/script-loader.php' );
+require( ABSPATH . WPINC . '/version.php' );
+
+$expires_offset = 31536000; // 1 year
+$out = '';
+
+$wp_scripts = new WP_Scripts();
+wp_default_scripts( $wp_scripts );
+wp_default_packages_vendor( $wp_scripts );
+wp_default_packages_scripts( $wp_scripts );
+
+if ( isset( $_SERVER['HTTP_IF_NONE_MATCH'] ) && stripslashes( $_SERVER['HTTP_IF_NONE_MATCH'] ) === $wp_version ) {
+ $protocol = $_SERVER['SERVER_PROTOCOL'];
+ if ( ! in_array( $protocol, array( 'HTTP/1.1', 'HTTP/2', 'HTTP/2.0' ) ) ) {
+ $protocol = 'HTTP/1.0';
+ }
+ header( "$protocol 304 Not Modified" );
+ exit();
+}
+
+foreach ( $load as $handle ) {
+ if ( ! array_key_exists( $handle, $wp_scripts->registered ) ) {
+ continue;
+ }
+
+ $path = ABSPATH . $wp_scripts->registered[ $handle ]->src;
+ $out .= get_file( $path ) . "\n";
+}
+
+header( "Etag: $wp_version" );
+header( 'Content-Type: application/javascript; charset=UTF-8' );
+header( 'Expires: ' . gmdate( 'D, d M Y H:i:s', time() + $expires_offset ) . ' GMT' );
+header( "Cache-Control: public, max-age=$expires_offset" );
+
+echo $out;
+exit;
diff --git a/www/crm/wp-admin/load-styles.php b/www/crm/wp-admin/load-styles.php
new file mode 100644
index 00000000..d6c5afc3
--- /dev/null
+++ b/www/crm/wp-admin/load-styles.php
@@ -0,0 +1,84 @@
+<?php
+
+/**
+ * Disable error reporting
+ *
+ * Set this to error_reporting( -1 ) for debugging
+ */
+error_reporting( 0 );
+
+/** Set ABSPATH for execution */
+if ( ! defined( 'ABSPATH' ) ) {
+ define( 'ABSPATH', dirname( dirname( __FILE__ ) ) . '/' );
+}
+
+define( 'WPINC', 'wp-includes' );
+
+require( ABSPATH . 'wp-admin/includes/noop.php' );
+require( ABSPATH . WPINC . '/script-loader.php' );
+require( ABSPATH . WPINC . '/version.php' );
+
+$load = $_GET['load'];
+if ( is_array( $load ) ) {
+ $load = implode( '', $load );
+}
+$load = preg_replace( '/[^a-z0-9,_-]+/i', '', $load );
+$load = array_unique( explode( ',', $load ) );
+
+if ( empty( $load ) ) {
+ exit;
+}
+
+$rtl = ( isset( $_GET['dir'] ) && 'rtl' == $_GET['dir'] );
+$expires_offset = 31536000; // 1 year
+$out = '';
+
+$wp_styles = new WP_Styles();
+wp_default_styles( $wp_styles );
+
+if ( isset( $_SERVER['HTTP_IF_NONE_MATCH'] ) && stripslashes( $_SERVER['HTTP_IF_NONE_MATCH'] ) === $wp_version ) {
+ $protocol = $_SERVER['SERVER_PROTOCOL'];
+ if ( ! in_array( $protocol, array( 'HTTP/1.1', 'HTTP/2', 'HTTP/2.0' ) ) ) {
+ $protocol = 'HTTP/1.0';
+ }
+ header( "$protocol 304 Not Modified" );
+ exit();
+}
+
+foreach ( $load as $handle ) {
+ if ( ! array_key_exists( $handle, $wp_styles->registered ) ) {
+ continue;
+ }
+
+ $style = $wp_styles->registered[ $handle ];
+
+ if ( empty( $style->src ) ) {
+ continue;
+ }
+
+ $path = ABSPATH . $style->src;
+
+ if ( $rtl && ! empty( $style->extra['rtl'] ) ) {
+ // All default styles have fully independent RTL files.
+ $path = str_replace( '.min.css', '-rtl.min.css', $path );
+ }
+
+ $content = get_file( $path ) . "\n";
+
+ if ( strpos( $style->src, '/' . WPINC . '/css/' ) === 0 ) {
+ $content = str_replace( '../images/', '../' . WPINC . '/images/', $content );
+ $content = str_replace( '../js/tinymce/', '../' . WPINC . '/js/tinymce/', $content );
+ $content = str_replace( '../fonts/', '../' . WPINC . '/fonts/', $content );
+ $out .= $content;
+ } else {
+ $out .= str_replace( '../images/', 'images/', $content );
+ }
+}
+
+header( "Etag: $wp_version" );
+header( 'Content-Type: text/css; charset=UTF-8' );
+header( 'Expires: ' . gmdate( 'D, d M Y H:i:s', time() + $expires_offset ) . ' GMT' );
+header( "Cache-Control: public, max-age=$expires_offset" );
+
+echo $out;
+exit;
diff --git a/www/crm/wp-admin/maint/repair.php b/www/crm/wp-admin/maint/repair.php
new file mode 100644
index 00000000..bbf22ed0
--- /dev/null
+++ b/www/crm/wp-admin/maint/repair.php
@@ -0,0 +1,170 @@
+<?php
+/**
+ * Database Repair and Optimization Script.
+ *
+ * @package WordPress
+ * @subpackage Database
+ */
+define( 'WP_REPAIRING', true );
+
+require_once( dirname( dirname( dirname( __FILE__ ) ) ) . '/wp-load.php' );
+
+header( 'Content-Type: text/html; charset=utf-8' );
+?>
+<!DOCTYPE html>
+<html xmlns="http://www.w3.org/1999/xhtml" <?php language_attributes(); ?>>
+<head>
+ <meta name="viewport" content="width=device-width" />
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+ <meta name="robots" content="noindex,nofollow" />
+ <title><?php _e( 'WordPress &rsaquo; Database Repair' ); ?></title>
+ <?php wp_admin_css( 'install', true ); ?>
+</head>
+<body class="wp-core-ui">
+<p id="logo"><a href="<?php echo esc_url( __( 'https://wordpress.org/' ) ); ?>"><?php _e( 'WordPress' ); ?></a></p>
+
+<?php
+
+if ( ! defined( 'WP_ALLOW_REPAIR' ) || ! WP_ALLOW_REPAIR ) {
+
+ echo '<h1 class="screen-reader-text">' . __( 'Allow automatic database repair' ) . '</h1>';
+
+ echo '<p>';
+ printf(
+ /* translators: %s: wp-config.php */
+ __( 'To allow use of this page to automatically repair database problems, please add the following line to your %s file. Once this line is added to your config, reload this page.' ),
+ '<code>wp-config.php</code>'
+ );
+ echo "</p><p><code>define('WP_ALLOW_REPAIR', true);</code></p>";
+
+ $default_key = 'put your unique phrase here';
+ $missing_key = false;
+ $duplicated_keys = array();
+
+ foreach ( array( 'AUTH_KEY', 'SECURE_AUTH_KEY', 'LOGGED_IN_KEY', 'NONCE_KEY', 'AUTH_SALT', 'SECURE_AUTH_SALT', 'LOGGED_IN_SALT', 'NONCE_SALT' ) as $key ) {
+ if ( defined( $key ) ) {
+ // Check for unique values of each key.
+ $duplicated_keys[ constant( $key ) ] = isset( $duplicated_keys[ constant( $key ) ] );
+ } else {
+ // If a constant is not defined, it's missing.
+ $missing_key = true;
+ }
+ }
+
+ // If at least one key uses the default value, consider it duplicated.
+ if ( isset( $duplicated_keys[ $default_key ] ) ) {
+ $duplicated_keys[ $default_key ] = true;
+ }
+
+ // Weed out all unique, non-default values.
+ $duplicated_keys = array_filter( $duplicated_keys );
+
+ if ( $duplicated_keys || $missing_key ) {
+
+ echo '<h2 class="screen-reader-text">' . __( 'Check secret keys' ) . '</h2>';
+
+ /* translators: 1: wp-config.php, 2: secret key service URL */
+ echo '<p>' . sprintf( __( 'While you are editing your %1$s file, take a moment to make sure you have all 8 keys and that they are unique. You can generate these using the <a href="%2$s">WordPress.org secret key service</a>.' ), '<code>wp-config.php</code>', 'https://api.wordpress.org/secret-key/1.1/salt/' ) . '</p>';
+ }
+} elseif ( isset( $_GET['repair'] ) ) {
+
+ echo '<h1 class="screen-reader-text">' . __( 'Database repair results' ) . '</h1>';
+
+ $optimize = 2 == $_GET['repair'];
+ $okay = true;
+ $problems = array();
+
+ $tables = $wpdb->tables();
+
+ // Sitecategories may not exist if global terms are disabled.
+ $query = $wpdb->prepare( 'SHOW TABLES LIKE %s', $wpdb->esc_like( $wpdb->sitecategories ) );
+ if ( is_multisite() && ! $wpdb->get_var( $query ) ) {
+ unset( $tables['sitecategories'] );
+ }
+
+ /**
+ * Filters additional database tables to repair.
+ *
+ * @since 3.0.0
+ *
+ * @param string[] $tables Array of prefixed table names to be repaired.
+ */
+ $tables = array_merge( $tables, (array) apply_filters( 'tables_to_repair', array() ) );
+
+ // Loop over the tables, checking and repairing as needed.
+ foreach ( $tables as $table ) {
+ $check = $wpdb->get_row( "CHECK TABLE $table" );
+
+ echo '<p>';
+ if ( 'OK' == $check->Msg_text ) {
+ /* translators: %s: table name */
+ printf( __( 'The %s table is okay.' ), "<code>$table</code>" );
+ } else {
+ /* translators: 1: table name, 2: error message, */
+ printf( __( 'The %1$s table is not okay. It is reporting the following error: %2$s. WordPress will attempt to repair this table&hellip;' ), "<code>$table</code>", "<code>$check->Msg_text</code>" );
+
+ $repair = $wpdb->get_row( "REPAIR TABLE $table" );
+
+ echo '<br />&nbsp;&nbsp;&nbsp;&nbsp;';
+ if ( 'OK' == $check->Msg_text ) {
+ /* translators: %s: table name */
+ printf( __( 'Successfully repaired the %s table.' ), "<code>$table</code>" );
+ } else {
+ /* translators: 1: table name, 2: error message, */
+ echo sprintf( __( 'Failed to repair the %1$s table. Error: %2$s' ), "<code>$table</code>", "<code>$check->Msg_text</code>" ) . '<br />';
+ $problems[ $table ] = $check->Msg_text;
+ $okay = false;
+ }
+ }
+
+ if ( $okay && $optimize ) {
+ $check = $wpdb->get_row( "ANALYZE TABLE $table" );
+
+ echo '<br />&nbsp;&nbsp;&nbsp;&nbsp;';
+ if ( 'Table is already up to date' == $check->Msg_text ) {
+ /* translators: %s: table name */
+ printf( __( 'The %s table is already optimized.' ), "<code>$table</code>" );
+ } else {
+ $check = $wpdb->get_row( "OPTIMIZE TABLE $table" );
+
+ echo '<br />&nbsp;&nbsp;&nbsp;&nbsp;';
+ if ( 'OK' == $check->Msg_text || 'Table is already up to date' == $check->Msg_text ) {
+ /* translators: %s: table name */
+ printf( __( 'Successfully optimized the %s table.' ), "<code>$table</code>" );
+ } else {
+ /* translators: 1: table name, 2: error message, */
+ printf( __( 'Failed to optimize the %1$s table. Error: %2$s' ), "<code>$table</code>", "<code>$check->Msg_text</code>" );
+ }
+ }
+ }
+ echo '</p>';
+ }
+
+ if ( $problems ) {
+ printf( '<p>' . __( 'Some database problems could not be repaired. Please copy-and-paste the following list of errors to the <a href="%s">WordPress support forums</a> to get additional assistance.' ) . '</p>', __( 'https://wordpress.org/support/forum/how-to-and-troubleshooting' ) );
+ $problem_output = '';
+ foreach ( $problems as $table => $problem ) {
+ $problem_output .= "$table: $problem\n";
+ }
+ echo '<p><textarea name="errors" id="errors" rows="20" cols="60">' . esc_textarea( $problem_output ) . '</textarea></p>';
+ } else {
+ echo '<p>' . __( 'Repairs complete. Please remove the following line from wp-config.php to prevent this page from being used by unauthorized users.' ) . "</p><p><code>define('WP_ALLOW_REPAIR', true);</code></p>";
+ }
+} else {
+
+ echo '<h1 class="screen-reader-text">' . __( 'WordPress database repair' ) . '</h1>';
+
+ if ( isset( $_GET['referrer'] ) && 'is_blog_installed' == $_GET['referrer'] ) {
+ echo '<p>' . __( 'One or more database tables are unavailable. To allow WordPress to attempt to repair these tables, press the &#8220;Repair Database&#8221; button. Repairing can take a while, so please be patient.' ) . '</p>';
+ } else {
+ echo '<p>' . __( 'WordPress can automatically look for some common database problems and repair them. Repairing can take a while, so please be patient.' ) . '</p>';
+ }
+ ?>
+ <p class="step"><a class="button button-large" href="repair.php?repair=1"><?php _e( 'Repair Database' ); ?></a></p>
+ <p><?php _e( 'WordPress can also attempt to optimize the database. This improves performance in some situations. Repairing and optimizing the database can take a long time and the database will be locked while optimizing.' ); ?></p>
+ <p class="step"><a class="button button-large" href="repair.php?repair=2"><?php _e( 'Repair and Optimize Database' ); ?></a></p>
+ <?php
+}
+?>
+</body>
+</html>
diff --git a/www/crm/wp-admin/media-new.php b/www/crm/wp-admin/media-new.php
new file mode 100644
index 00000000..c60601cc
--- /dev/null
+++ b/www/crm/wp-admin/media-new.php
@@ -0,0 +1,89 @@
+<?php
+/**
+ * Manage media uploaded file.
+ *
+ * There are many filters in here for media. Plugins can extend functionality
+ * by hooking into the filters.
+ *
+ * @package WordPress
+ * @subpackage Administration
+ */
+
+/** Load WordPress Administration Bootstrap */
+require_once( dirname( __FILE__ ) . '/admin.php' );
+
+if ( ! current_user_can( 'upload_files' ) ) {
+ wp_die( __( 'Sorry, you are not allowed to upload files.' ) );
+}
+
+wp_enqueue_script( 'plupload-handlers' );
+
+$post_id = 0;
+if ( isset( $_REQUEST['post_id'] ) ) {
+ $post_id = absint( $_REQUEST['post_id'] );
+ if ( ! get_post( $post_id ) || ! current_user_can( 'edit_post', $post_id ) ) {
+ $post_id = 0;
+ }
+}
+
+if ( $_POST ) {
+ if ( isset( $_POST['html-upload'] ) && ! empty( $_FILES ) ) {
+ check_admin_referer( 'media-form' );
+ // Upload File button was clicked
+ $upload_id = media_handle_upload( 'async-upload', $post_id );
+ if ( is_wp_error( $upload_id ) ) {
+ wp_die( $upload_id );
+ }
+ }
+ wp_redirect( admin_url( 'upload.php' ) );
+ exit;
+}
+
+$title = __( 'Upload New Media' );
+$parent_file = 'upload.php';
+
+get_current_screen()->add_help_tab(
+ array(
+ 'id' => 'overview',
+ 'title' => __( 'Overview' ),
+ 'content' =>
+ '<p>' . __( 'You can upload media files here without creating a post first. This allows you to upload files to use with posts and pages later and/or to get a web link for a particular file that you can share. There are three options for uploading files:' ) . '</p>' .
+ '<ul>' .
+ '<li>' . __( '<strong>Drag and drop</strong> your files into the area below. Multiple files are allowed.' ) . '</li>' .
+ '<li>' . __( 'Clicking <strong>Select Files</strong> opens a navigation window showing you files in your operating system. Selecting <strong>Open</strong> after clicking on the file you want activates a progress bar on the uploader screen.' ) . '</li>' .
+ '<li>' . __( 'Revert to the <strong>Browser Uploader</strong> by clicking the link below the drag and drop box.' ) . '</li>' .
+ '</ul>',
+ )
+);
+get_current_screen()->set_help_sidebar(
+ '<p><strong>' . __( 'For more information:' ) . '</strong></p>' .
+ '<p>' . __( '<a href="https://codex.wordpress.org/Media_Add_New_Screen">Documentation on Uploading Media Files</a>' ) . '</p>' .
+ '<p>' . __( '<a href="https://wordpress.org/support/">Support</a>' ) . '</p>'
+);
+
+require_once( ABSPATH . 'wp-admin/admin-header.php' );
+
+$form_class = 'media-upload-form type-form validate';
+
+if ( get_user_setting( 'uploader' ) || isset( $_GET['browser-uploader'] ) ) {
+ $form_class .= ' html-uploader';
+}
+?>
+<div class="wrap">
+ <h1><?php echo esc_html( $title ); ?></h1>
+
+ <form enctype="multipart/form-data" method="post" action="<?php echo admin_url( 'media-new.php' ); ?>" class="<?php echo esc_attr( $form_class ); ?>" id="file-form">
+
+ <?php media_upload_form(); ?>
+
+ <script type="text/javascript">
+ var post_id = <?php echo $post_id; ?>, shortform = 3;
+ </script>
+ <input type="hidden" name="post_id" id="post_id" value="<?php echo $post_id; ?>" />
+ <?php wp_nonce_field( 'media-form' ); ?>
+ <div id="media-items" class="hide-if-no-js"></div>
+ </form>
+</div>
+
+<?php
+include( ABSPATH . 'wp-admin/admin-footer.php' );
diff --git a/www/crm/wp-admin/media-upload.php b/www/crm/wp-admin/media-upload.php
new file mode 100644
index 00000000..322fcf5a
--- /dev/null
+++ b/www/crm/wp-admin/media-upload.php
@@ -0,0 +1,113 @@
+<?php
+/**
+ * Manage media uploaded file.
+ *
+ * There are many filters in here for media. Plugins can extend functionality
+ * by hooking into the filters.
+ *
+ * @package WordPress
+ * @subpackage Administration
+ */
+
+if ( ! isset( $_GET['inline'] ) ) {
+ define( 'IFRAME_REQUEST', true );
+}
+
+/** Load WordPress Administration Bootstrap */
+require_once( dirname( __FILE__ ) . '/admin.php' );
+
+if ( ! current_user_can( 'upload_files' ) ) {
+ wp_die( __( 'Sorry, you are not allowed to upload files.' ), 403 );
+}
+
+wp_enqueue_script( 'plupload-handlers' );
+wp_enqueue_script( 'image-edit' );
+wp_enqueue_script( 'set-post-thumbnail' );
+wp_enqueue_style( 'imgareaselect' );
+wp_enqueue_script( 'media-gallery' );
+
+@header( 'Content-Type: ' . get_option( 'html_type' ) . '; charset=' . get_option( 'blog_charset' ) );
+
+// IDs should be integers
+$ID = isset( $ID ) ? (int) $ID : 0;
+$post_id = isset( $post_id ) ? (int) $post_id : 0;
+
+// Require an ID for the edit screen.
+if ( isset( $action ) && $action == 'edit' && ! $ID ) {
+ wp_die(
+ '<h1>' . __( 'Something went wrong.' ) . '</h1>' .
+ '<p>' . __( 'Invalid item ID.' ) . '</p>',
+ 403
+ );
+}
+
+if ( ! empty( $_REQUEST['post_id'] ) && ! current_user_can( 'edit_post', $_REQUEST['post_id'] ) ) {
+ wp_die(
+ '<h1>' . __( 'You need a higher level of permission.' ) . '</h1>' .
+ '<p>' . __( 'Sorry, you are not allowed to edit this item.' ) . '</p>',
+ 403
+ );
+}
+
+// Upload type: image, video, file, ..?
+if ( isset( $_GET['type'] ) ) {
+ $type = strval( $_GET['type'] );
+} else {
+ /**
+ * Filters the default media upload type in the legacy (pre-3.5.0) media popup.
+ *
+ * @since 2.5.0
+ *
+ * @param string $type The default media upload type. Possible values include
+ * 'image', 'audio', 'video', 'file', etc. Default 'file'.
+ */
+ $type = apply_filters( 'media_upload_default_type', 'file' );
+}
+
+// Tab: gallery, library, or type-specific.
+if ( isset( $_GET['tab'] ) ) {
+ $tab = strval( $_GET['tab'] );
+} else {
+ /**
+ * Filters the default tab in the legacy (pre-3.5.0) media popup.
+ *
+ * @since 2.5.0
+ *
+ * @param string $type The default media popup tab. Default 'type' (From Computer).
+ */
+ $tab = apply_filters( 'media_upload_default_tab', 'type' );
+}
+
+$body_id = 'media-upload';
+
+// Let the action code decide how to handle the request.
+if ( $tab == 'type' || $tab == 'type_url' || ! array_key_exists( $tab, media_upload_tabs() ) ) {
+ /**
+ * Fires inside specific upload-type views in the legacy (pre-3.5.0)
+ * media popup based on the current tab.
+ *
+ * The dynamic portion of the hook name, `$type`, refers to the specific
+ * media upload type. Possible values include 'image', 'audio', 'video',
+ * 'file', etc.
+ *
+ * The hook only fires if the current `$tab` is 'type' (From Computer),
+ * 'type_url' (From URL), or, if the tab does not exist (i.e., has not
+ * been registered via the {@see 'media_upload_tabs'} filter.
+ *
+ * @since 2.5.0
+ */
+ do_action( "media_upload_{$type}" );
+} else {
+ /**
+ * Fires inside limited and specific upload-tab views in the legacy
+ * (pre-3.5.0) media popup.
+ *
+ * The dynamic portion of the hook name, `$tab`, refers to the specific
+ * media upload tab. Possible values include 'library' (Media Library),
+ * or any custom tab registered via the {@see 'media_upload_tabs'} filter.
+ *
+ * @since 2.5.0
+ */
+ do_action( "media_upload_{$tab}" );
+}
+
diff --git a/www/crm/wp-admin/media.php b/www/crm/wp-admin/media.php
new file mode 100644
index 00000000..480eac7c
--- /dev/null
+++ b/www/crm/wp-admin/media.php
@@ -0,0 +1,176 @@
+<?php
+/**
+ * Media management action handler.
+ *
+ * @package WordPress
+ * @subpackage Administration
+ */
+
+/** Load WordPress Administration Bootstrap */
+require_once( dirname( __FILE__ ) . '/admin.php' );
+
+$parent_file = 'upload.php';
+$submenu_file = 'upload.php';
+
+wp_reset_vars( array( 'action' ) );
+
+switch ( $action ) {
+ case 'editattachment':
+ $attachment_id = (int) $_POST['attachment_id'];
+ check_admin_referer( 'media-form' );
+
+ if ( ! current_user_can( 'edit_post', $attachment_id ) ) {
+ wp_die( __( 'Sorry, you are not allowed to edit this attachment.' ) );
+ }
+
+ $errors = media_upload_form_handler();
+
+ if ( empty( $errors ) ) {
+ $location = 'media.php';
+ if ( $referer = wp_get_original_referer() ) {
+ if ( false !== strpos( $referer, 'upload.php' ) || ( url_to_postid( $referer ) == $attachment_id ) ) {
+ $location = $referer;
+ }
+ }
+ if ( false !== strpos( $location, 'upload.php' ) ) {
+ $location = remove_query_arg( 'message', $location );
+ $location = add_query_arg( 'posted', $attachment_id, $location );
+ } elseif ( false !== strpos( $location, 'media.php' ) ) {
+ $location = add_query_arg( 'message', 'updated', $location );
+ }
+ wp_redirect( $location );
+ exit;
+ }
+
+ // No break.
+ case 'edit':
+ $title = __( 'Edit Media' );
+
+ if ( empty( $errors ) ) {
+ $errors = null;
+ }
+
+ if ( empty( $_GET['attachment_id'] ) ) {
+ wp_redirect( admin_url( 'upload.php' ) );
+ exit();
+ }
+ $att_id = (int) $_GET['attachment_id'];
+
+ if ( ! current_user_can( 'edit_post', $att_id ) ) {
+ wp_die( __( 'Sorry, you are not allowed to edit this attachment.' ) );
+ }
+
+ $att = get_post( $att_id );
+
+ if ( empty( $att->ID ) ) {
+ wp_die( __( 'You attempted to edit an attachment that doesn&#8217;t exist. Perhaps it was deleted?' ) );
+ }
+ if ( 'attachment' !== $att->post_type ) {
+ wp_die( __( 'You attempted to edit an item that isn&#8217;t an attachment. Please go back and try again.' ) );
+ }
+ if ( $att->post_status == 'trash' ) {
+ wp_die( __( 'You can&#8217;t edit this attachment because it is in the Trash. Please move it out of the Trash and try again.' ) );
+ }
+
+ add_filter( 'attachment_fields_to_edit', 'media_single_attachment_fields_to_edit', 10, 2 );
+
+ wp_enqueue_script( 'wp-ajax-response' );
+ wp_enqueue_script( 'image-edit' );
+ wp_enqueue_style( 'imgareaselect' );
+
+ get_current_screen()->add_help_tab(
+ array(
+ 'id' => 'overview',
+ 'title' => __( 'Overview' ),
+ 'content' =>
+ '<p>' . __( 'This screen allows you to edit five fields for metadata in a file within the media library.' ) . '</p>' .
+ '<p>' . __( 'For images only, you can click on Edit Image under the thumbnail to expand out an inline image editor with icons for cropping, rotating, or flipping the image as well as for undoing and redoing. The boxes on the right give you more options for scaling the image, for cropping it, and for cropping the thumbnail in a different way than you crop the original image. You can click on Help in those boxes to get more information.' ) . '</p>' .
+ '<p>' . __( 'Note that you crop the image by clicking on it (the Crop icon is already selected) and dragging the cropping frame to select the desired part. Then click Save to retain the cropping.' ) . '</p>' .
+ '<p>' . __( 'Remember to click Update Media to save metadata entered or changed.' ) . '</p>',
+ )
+ );
+
+ get_current_screen()->set_help_sidebar(
+ '<p><strong>' . __( 'For more information:' ) . '</strong></p>' .
+ '<p>' . __( '<a href="https://codex.wordpress.org/Media_Add_New_Screen#Edit_Media">Documentation on Edit Media</a>' ) . '</p>' .
+ '<p>' . __( '<a href="https://wordpress.org/support/">Support</a>' ) . '</p>'
+ );
+
+ require( ABSPATH . 'wp-admin/admin-header.php' );
+
+ $parent_file = 'upload.php';
+ $message = '';
+ $class = '';
+ if ( isset( $_GET['message'] ) ) {
+ switch ( $_GET['message'] ) {
+ case 'updated':
+ $message = __( 'Media file updated.' );
+ $class = 'updated';
+ break;
+ }
+ }
+ if ( $message ) {
+ echo "<div id='message' class='$class'><p>$message</p></div>\n";
+ }
+
+ ?>
+
+ <div class="wrap">
+ <h1 class="wp-heading-inline">
+ <?php
+ echo esc_html( $title );
+ ?>
+</h1>
+
+ <?php
+ if ( current_user_can( 'upload_files' ) ) {
+ ?>
+ <a href="media-new.php" class="page-title-action"><?php echo esc_html_x( 'Add New', 'file' ); ?></a>
+<?php } ?>
+
+ <hr class="wp-header-end">
+
+ <form method="post" class="media-upload-form" id="media-single-form">
+ <p class="submit" style="padding-bottom: 0;">
+ <?php submit_button( __( 'Update Media' ), 'primary', 'save', false ); ?>
+ </p>
+
+ <div class="media-single">
+ <div id="media-item-<?php echo $att_id; ?>" class="media-item">
+ <?php
+ echo get_media_item(
+ $att_id,
+ array(
+ 'toggle' => false,
+ 'send' => false,
+ 'delete' => false,
+ 'show_title' => false,
+ 'errors' => ! empty( $errors[ $att_id ] ) ? $errors[ $att_id ] : null,
+ )
+ );
+ ?>
+ </div>
+ </div>
+
+ <?php submit_button( __( 'Update Media' ), 'primary', 'save' ); ?>
+ <input type="hidden" name="post_id" id="post_id" value="<?php echo isset( $post_id ) ? esc_attr( $post_id ) : ''; ?>" />
+ <input type="hidden" name="attachment_id" id="attachment_id" value="<?php echo esc_attr( $att_id ); ?>" />
+ <input type="hidden" name="action" value="editattachment" />
+ <?php wp_original_referer_field( true, 'previous' ); ?>
+ <?php wp_nonce_field( 'media-form' ); ?>
+
+ </form>
+
+ </div>
+
+ <?php
+
+ require( ABSPATH . 'wp-admin/admin-footer.php' );
+
+ exit;
+
+ default:
+ wp_redirect( admin_url( 'upload.php' ) );
+ exit;
+
+}
diff --git a/www/crm/wp-admin/menu-header.php b/www/crm/wp-admin/menu-header.php
new file mode 100644
index 00000000..fee5d3db
--- /dev/null
+++ b/www/crm/wp-admin/menu-header.php
@@ -0,0 +1,283 @@
+<?php
+/**
+ * Displays Administration Menu.
+ *
+ * @package WordPress
+ * @subpackage Administration
+ */
+
+/**
+ * The current page.
+ *
+ * @global string $self
+ */
+$self = preg_replace( '|^.*/wp-admin/network/|i', '', $_SERVER['PHP_SELF'] );
+$self = preg_replace( '|^.*/wp-admin/|i', '', $self );
+$self = preg_replace( '|^.*/plugins/|i', '', $self );
+$self = preg_replace( '|^.*/mu-plugins/|i', '', $self );
+
+/**
+ * For when admin-header is included from within a function.
+ *
+ * @global array $menu
+ * @global array $submenu
+ * @global string $parent_file
+ * @global string $submenu_file
+ */
+global $menu, $submenu, $parent_file, $submenu_file;
+
+/**
+ * Filters the parent file of an admin menu sub-menu item.
+ *
+ * Allows plugins to move sub-menu items around.
+ *
+ * @since MU (3.0.0)
+ *
+ * @param string $parent_file The parent file.
+ */
+$parent_file = apply_filters( 'parent_file', $parent_file );
+
+/**
+ * Filters the file of an admin menu sub-menu item.
+ *
+ * @since 4.4.0
+ *
+ * @param string $submenu_file The submenu file.
+ * @param string $parent_file The submenu item's parent file.
+ */
+$submenu_file = apply_filters( 'submenu_file', $submenu_file, $parent_file );
+
+get_admin_page_parent();
+
+/**
+ * Display menu.
+ *
+ * @access private
+ * @since 2.7.0
+ *
+ * @global string $self
+ * @global string $parent_file
+ * @global string $submenu_file
+ * @global string $plugin_page
+ * @global string $typenow
+ *
+ * @param array $menu
+ * @param array $submenu
+ * @param bool $submenu_as_parent
+ */
+function _wp_menu_output( $menu, $submenu, $submenu_as_parent = true ) {
+ global $self, $parent_file, $submenu_file, $plugin_page, $typenow;
+
+ $first = true;
+ // 0 = menu_title, 1 = capability, 2 = menu_slug, 3 = page_title, 4 = classes, 5 = hookname, 6 = icon_url
+ foreach ( $menu as $key => $item ) {
+ $admin_is_parent = false;
+ $class = array();
+ $aria_attributes = '';
+ $aria_hidden = '';
+ $is_separator = false;
+
+ if ( $first ) {
+ $class[] = 'wp-first-item';
+ $first = false;
+ }
+
+ $submenu_items = array();
+ if ( ! empty( $submenu[ $item[2] ] ) ) {
+ $class[] = 'wp-has-submenu';
+ $submenu_items = $submenu[ $item[2] ];
+ }
+
+ if ( ( $parent_file && $item[2] == $parent_file ) || ( empty( $typenow ) && $self == $item[2] ) ) {
+ if ( ! empty( $submenu_items ) ) {
+ $class[] = 'wp-has-current-submenu wp-menu-open';
+ } else {
+ $class[] = 'current';
+ $aria_attributes .= 'aria-current="page"';
+ }
+ } else {
+ $class[] = 'wp-not-current-submenu';
+ if ( ! empty( $submenu_items ) ) {
+ $aria_attributes .= 'aria-haspopup="true"';
+ }
+ }
+
+ if ( ! empty( $item[4] ) ) {
+ $class[] = esc_attr( $item[4] );
+ }
+
+ $class = $class ? ' class="' . join( ' ', $class ) . '"' : '';
+ $id = ! empty( $item[5] ) ? ' id="' . preg_replace( '|[^a-zA-Z0-9_:.]|', '-', $item[5] ) . '"' : '';
+ $img = $img_style = '';
+ $img_class = ' dashicons-before';
+
+ if ( false !== strpos( $class, 'wp-menu-separator' ) ) {
+ $is_separator = true;
+ }
+
+ /*
+ * If the string 'none' (previously 'div') is passed instead of a URL, don't output
+ * the default menu image so an icon can be added to div.wp-menu-image as background
+ * with CSS. Dashicons and base64-encoded data:image/svg_xml URIs are also handled
+ * as special cases.
+ */
+ if ( ! empty( $item[6] ) ) {
+ $img = '<img src="' . $item[6] . '" alt="" />';
+
+ if ( 'none' === $item[6] || 'div' === $item[6] ) {
+ $img = '<br />';
+ } elseif ( 0 === strpos( $item[6], 'data:image/svg+xml;base64,' ) ) {
+ $img = '<br />';
+ $img_style = ' style="background-image:url(\'' . esc_attr( $item[6] ) . '\')"';
+ $img_class = ' svg';
+ } elseif ( 0 === strpos( $item[6], 'dashicons-' ) ) {
+ $img = '<br />';
+ $img_class = ' dashicons-before ' . sanitize_html_class( $item[6] );
+ }
+ }
+ $arrow = '<div class="wp-menu-arrow"><div></div></div>';
+
+ $title = wptexturize( $item[0] );
+
+ // Hide separators from screen readers.
+ if ( $is_separator ) {
+ $aria_hidden = ' aria-hidden="true"';
+ }
+
+ echo "\n\t<li$class$id$aria_hidden>";
+
+ if ( $is_separator ) {
+ echo '<div class="separator"></div>';
+ } elseif ( $submenu_as_parent && ! empty( $submenu_items ) ) {
+ $submenu_items = array_values( $submenu_items ); // Re-index.
+ $menu_hook = get_plugin_page_hook( $submenu_items[0][2], $item[2] );
+ $menu_file = $submenu_items[0][2];
+ if ( false !== ( $pos = strpos( $menu_file, '?' ) ) ) {
+ $menu_file = substr( $menu_file, 0, $pos );
+ }
+ if ( ! empty( $menu_hook ) || ( ( 'index.php' != $submenu_items[0][2] ) && file_exists( WP_PLUGIN_DIR . "/$menu_file" ) && ! file_exists( ABSPATH . "/wp-admin/$menu_file" ) ) ) {
+ $admin_is_parent = true;
+ echo "<a href='admin.php?page={$submenu_items[0][2]}'$class $aria_attributes>$arrow<div class='wp-menu-image$img_class'$img_style>$img</div><div class='wp-menu-name'>$title</div></a>";
+ } else {
+ echo "\n\t<a href='{$submenu_items[0][2]}'$class $aria_attributes>$arrow<div class='wp-menu-image$img_class'$img_style>$img</div><div class='wp-menu-name'>$title</div></a>";
+ }
+ } elseif ( ! empty( $item[2] ) && current_user_can( $item[1] ) ) {
+ $menu_hook = get_plugin_page_hook( $item[2], 'admin.php' );
+ $menu_file = $item[2];
+ if ( false !== ( $pos = strpos( $menu_file, '?' ) ) ) {
+ $menu_file = substr( $menu_file, 0, $pos );
+ }
+ if ( ! empty( $menu_hook ) || ( ( 'index.php' != $item[2] ) && file_exists( WP_PLUGIN_DIR . "/$menu_file" ) && ! file_exists( ABSPATH . "/wp-admin/$menu_file" ) ) ) {
+ $admin_is_parent = true;
+ echo "\n\t<a href='admin.php?page={$item[2]}'$class $aria_attributes>$arrow<div class='wp-menu-image$img_class'$img_style>$img</div><div class='wp-menu-name'>{$item[0]}</div></a>";
+ } else {
+ echo "\n\t<a href='{$item[2]}'$class $aria_attributes>$arrow<div class='wp-menu-image$img_class'$img_style>$img</div><div class='wp-menu-name'>{$item[0]}</div></a>";
+ }
+ }
+
+ if ( ! empty( $submenu_items ) ) {
+ echo "\n\t<ul class='wp-submenu wp-submenu-wrap'>";
+ echo "<li class='wp-submenu-head' aria-hidden='true'>{$item[0]}</li>";
+
+ $first = true;
+
+ // 0 = menu_title, 1 = capability, 2 = menu_slug, 3 = page_title, 4 = classes
+ foreach ( $submenu_items as $sub_key => $sub_item ) {
+ if ( ! current_user_can( $sub_item[1] ) ) {
+ continue;
+ }
+
+ $class = array();
+ $aria_attributes = '';
+ if ( $first ) {
+ $class[] = 'wp-first-item';
+ $first = false;
+ }
+
+ $menu_file = $item[2];
+
+ if ( false !== ( $pos = strpos( $menu_file, '?' ) ) ) {
+ $menu_file = substr( $menu_file, 0, $pos );
+ }
+
+ // Handle current for post_type=post|page|foo pages, which won't match $self.
+ $self_type = ! empty( $typenow ) ? $self . '?post_type=' . $typenow : 'nothing';
+
+ if ( isset( $submenu_file ) ) {
+ if ( $submenu_file == $sub_item[2] ) {
+ $class[] = 'current';
+ $aria_attributes .= ' aria-current="page"';
+ }
+ // If plugin_page is set the parent must either match the current page or not physically exist.
+ // This allows plugin pages with the same hook to exist under different parents.
+ } elseif (
+ ( ! isset( $plugin_page ) && $self == $sub_item[2] ) ||
+ ( isset( $plugin_page ) && $plugin_page == $sub_item[2] && ( $item[2] == $self_type || $item[2] == $self || file_exists( $menu_file ) === false ) )
+ ) {
+ $class[] = 'current';
+ $aria_attributes .= ' aria-current="page"';
+ }
+
+ if ( ! empty( $sub_item[4] ) ) {
+ $class[] = esc_attr( $sub_item[4] );
+ }
+
+ $class = $class ? ' class="' . join( ' ', $class ) . '"' : '';
+
+ $menu_hook = get_plugin_page_hook( $sub_item[2], $item[2] );
+ $sub_file = $sub_item[2];
+ if ( false !== ( $pos = strpos( $sub_file, '?' ) ) ) {
+ $sub_file = substr( $sub_file, 0, $pos );
+ }
+
+ $title = wptexturize( $sub_item[0] );
+
+ if ( ! empty( $menu_hook ) || ( ( 'index.php' != $sub_item[2] ) && file_exists( WP_PLUGIN_DIR . "/$sub_file" ) && ! file_exists( ABSPATH . "/wp-admin/$sub_file" ) ) ) {
+ // If admin.php is the current page or if the parent exists as a file in the plugins or admin dir
+ if ( ( ! $admin_is_parent && file_exists( WP_PLUGIN_DIR . "/$menu_file" ) && ! is_dir( WP_PLUGIN_DIR . "/{$item[2]}" ) ) || file_exists( $menu_file ) ) {
+ $sub_item_url = add_query_arg( array( 'page' => $sub_item[2] ), $item[2] );
+ } else {
+ $sub_item_url = add_query_arg( array( 'page' => $sub_item[2] ), 'admin.php' );
+ }
+
+ $sub_item_url = esc_url( $sub_item_url );
+ echo "<li$class><a href='$sub_item_url'$class$aria_attributes>$title</a></li>";
+ } else {
+ echo "<li$class><a href='{$sub_item[2]}'$class$aria_attributes>$title</a></li>";
+ }
+ }
+ echo '</ul>';
+ }
+ echo '</li>';
+ }
+
+ echo '<li id="collapse-menu" class="hide-if-no-js">' .
+ '<button type="button" id="collapse-button" aria-label="' . esc_attr__( 'Collapse Main menu' ) . '" aria-expanded="true">' .
+ '<span class="collapse-button-icon" aria-hidden="true"></span>' .
+ '<span class="collapse-button-label">' . __( 'Collapse menu' ) . '</span>' .
+ '</button></li>';
+}
+
+?>
+
+<div id="adminmenumain" role="navigation" aria-label="<?php esc_attr_e( 'Main menu' ); ?>">
+<a href="#wpbody-content" class="screen-reader-shortcut"><?php _e( 'Skip to main content' ); ?></a>
+<a href="#wp-toolbar" class="screen-reader-shortcut"><?php _e( 'Skip to toolbar' ); ?></a>
+<div id="adminmenuback"></div>
+<div id="adminmenuwrap">
+<ul id="adminmenu">
+
+<?php
+
+_wp_menu_output( $menu, $submenu );
+/**
+ * Fires after the admin menu has been output.
+ *
+ * @since 2.5.0
+ */
+do_action( 'adminmenu' );
+
+?>
+</ul>
+</div>
+</div>
diff --git a/www/crm/wp-admin/menu.php b/www/crm/wp-admin/menu.php
new file mode 100644
index 00000000..5ccf37f6
--- /dev/null
+++ b/www/crm/wp-admin/menu.php
@@ -0,0 +1,309 @@
+<?php
+/**
+ * Build Administration Menu.
+ *
+ * @package WordPress
+ * @subpackage Administration
+ */
+
+/**
+ * Constructs the admin menu.
+ *
+ * The elements in the array are :
+ * 0: Menu item name
+ * 1: Minimum level or capability required.
+ * 2: The URL of the item's file
+ * 3: Class
+ * 4: ID
+ * 5: Icon for top level menu
+ *
+ * @global array $menu
+ */
+
+$menu[2] = array( __( 'Dashboard' ), 'read', 'index.php', '', 'menu-top menu-top-first menu-icon-dashboard', 'menu-dashboard', 'dashicons-dashboard' );
+
+$submenu['index.php'][0] = array( __( 'Home' ), 'read', 'index.php' );
+
+if ( is_multisite() ) {
+ $submenu['index.php'][5] = array( __( 'My Sites' ), 'read', 'my-sites.php' );
+}
+
+if ( ! is_multisite() || current_user_can( 'update_core' ) ) {
+ $update_data = wp_get_update_data();
+}
+
+if ( ! is_multisite() ) {
+ if ( current_user_can( 'update_core' ) ) {
+ $cap = 'update_core';
+ } elseif ( current_user_can( 'update_plugins' ) ) {
+ $cap = 'update_plugins';
+ } elseif ( current_user_can( 'update_themes' ) ) {
+ $cap = 'update_themes';
+ } else {
+ $cap = 'update_languages';
+ }
+ /* translators: %s: number of pending updates */
+ $submenu['index.php'][10] = array( sprintf( __( 'Updates %s' ), "<span class='update-plugins count-{$update_data['counts']['total']}'><span class='update-count'>" . number_format_i18n( $update_data['counts']['total'] ) . '</span></span>' ), $cap, 'update-core.php' );
+ unset( $cap );
+}
+
+$menu[4] = array( '', 'read', 'separator1', '', 'wp-menu-separator' );
+
+// $menu[5] = Posts
+
+$menu[10] = array( __( 'Media' ), 'upload_files', 'upload.php', '', 'menu-top menu-icon-media', 'menu-media', 'dashicons-admin-media' );
+ $submenu['upload.php'][5] = array( __( 'Library' ), 'upload_files', 'upload.php' );
+ /* translators: add new file */
+ $submenu['upload.php'][10] = array( _x( 'Add New', 'file' ), 'upload_files', 'media-new.php' );
+ $i = 15;
+foreach ( get_taxonomies_for_attachments( 'objects' ) as $tax ) {
+ if ( ! $tax->show_ui || ! $tax->show_in_menu ) {
+ continue;
+ }
+
+ $submenu['upload.php'][ $i++ ] = array( esc_attr( $tax->labels->menu_name ), $tax->cap->manage_terms, 'edit-tags.php?taxonomy=' . $tax->name . '&amp;post_type=attachment' );
+}
+ unset( $tax, $i );
+
+$menu[15] = array( __( 'Links' ), 'manage_links', 'link-manager.php', '', 'menu-top menu-icon-links', 'menu-links', 'dashicons-admin-links' );
+ $submenu['link-manager.php'][5] = array( _x( 'All Links', 'admin menu' ), 'manage_links', 'link-manager.php' );
+ /* translators: add new links */
+ $submenu['link-manager.php'][10] = array( _x( 'Add New', 'link' ), 'manage_links', 'link-add.php' );
+ $submenu['link-manager.php'][15] = array( __( 'Link Categories' ), 'manage_categories', 'edit-tags.php?taxonomy=link_category' );
+
+// $menu[20] = Pages
+
+// Avoid the comment count query for users who cannot edit_posts.
+if ( current_user_can( 'edit_posts' ) ) {
+ $awaiting_mod = wp_count_comments();
+ $awaiting_mod = $awaiting_mod->moderated;
+ $awaiting_mod_i18n = number_format_i18n( $awaiting_mod );
+ /* translators: %s: number of comments in moderation */
+ $awaiting_mod_text = sprintf( _n( '%s Comment in moderation', '%s Comments in moderation', $awaiting_mod ), $awaiting_mod_i18n );
+
+ $menu[25] = array(
+ /* translators: %s: number of comments in moderation */
+ sprintf( __( 'Comments %s' ), '<span class="awaiting-mod count-' . absint( $awaiting_mod ) . '"><span class="pending-count" aria-hidden="true">' . $awaiting_mod_i18n . '</span><span class="comments-in-moderation-text screen-reader-text">' . $awaiting_mod_text . '</span></span>' ),
+ 'edit_posts',
+ 'edit-comments.php',
+ '',
+ 'menu-top menu-icon-comments',
+ 'menu-comments',
+ 'dashicons-admin-comments',
+ );
+ unset( $awaiting_mod );
+}
+
+$submenu['edit-comments.php'][0] = array( __( 'All Comments' ), 'edit_posts', 'edit-comments.php' );
+
+$_wp_last_object_menu = 25; // The index of the last top-level menu in the object menu group
+
+$types = (array) get_post_types(
+ array(
+ 'show_ui' => true,
+ '_builtin' => false,
+ 'show_in_menu' => true,
+ )
+);
+$builtin = array( 'post', 'page' );
+foreach ( array_merge( $builtin, $types ) as $ptype ) {
+ $ptype_obj = get_post_type_object( $ptype );
+ // Check if it should be a submenu.
+ if ( $ptype_obj->show_in_menu !== true ) {
+ continue;
+ }
+ $ptype_menu_position = is_int( $ptype_obj->menu_position ) ? $ptype_obj->menu_position : ++$_wp_last_object_menu; // If we're to use $_wp_last_object_menu, increment it first.
+ $ptype_for_id = sanitize_html_class( $ptype );
+
+ $menu_icon = 'dashicons-admin-post';
+ if ( is_string( $ptype_obj->menu_icon ) ) {
+ // Special handling for data:image/svg+xml and Dashicons.
+ if ( 0 === strpos( $ptype_obj->menu_icon, 'data:image/svg+xml;base64,' ) || 0 === strpos( $ptype_obj->menu_icon, 'dashicons-' ) ) {
+ $menu_icon = $ptype_obj->menu_icon;
+ } else {
+ $menu_icon = esc_url( $ptype_obj->menu_icon );
+ }
+ } elseif ( in_array( $ptype, $builtin ) ) {
+ $menu_icon = 'dashicons-admin-' . $ptype;
+ }
+
+ $menu_class = 'menu-top menu-icon-' . $ptype_for_id;
+ // 'post' special case
+ if ( 'post' === $ptype ) {
+ $menu_class .= ' open-if-no-js';
+ $ptype_file = 'edit.php';
+ $post_new_file = 'post-new.php';
+ $edit_tags_file = 'edit-tags.php?taxonomy=%s';
+ } else {
+ $ptype_file = "edit.php?post_type=$ptype";
+ $post_new_file = "post-new.php?post_type=$ptype";
+ $edit_tags_file = "edit-tags.php?taxonomy=%s&amp;post_type=$ptype";
+ }
+
+ if ( in_array( $ptype, $builtin ) ) {
+ $ptype_menu_id = 'menu-' . $ptype_for_id . 's';
+ } else {
+ $ptype_menu_id = 'menu-posts-' . $ptype_for_id;
+ }
+ /*
+ * If $ptype_menu_position is already populated or will be populated
+ * by a hard-coded value below, increment the position.
+ */
+ $core_menu_positions = array( 59, 60, 65, 70, 75, 80, 85, 99 );
+ while ( isset( $menu[ $ptype_menu_position ] ) || in_array( $ptype_menu_position, $core_menu_positions ) ) {
+ $ptype_menu_position++;
+ }
+
+ $menu[ $ptype_menu_position ] = array( esc_attr( $ptype_obj->labels->menu_name ), $ptype_obj->cap->edit_posts, $ptype_file, '', $menu_class, $ptype_menu_id, $menu_icon );
+ $submenu[ $ptype_file ][5] = array( $ptype_obj->labels->all_items, $ptype_obj->cap->edit_posts, $ptype_file );
+ $submenu[ $ptype_file ][10] = array( $ptype_obj->labels->add_new, $ptype_obj->cap->create_posts, $post_new_file );
+
+ $i = 15;
+ foreach ( get_taxonomies( array(), 'objects' ) as $tax ) {
+ if ( ! $tax->show_ui || ! $tax->show_in_menu || ! in_array( $ptype, (array) $tax->object_type, true ) ) {
+ continue;
+ }
+
+ $submenu[ $ptype_file ][ $i++ ] = array( esc_attr( $tax->labels->menu_name ), $tax->cap->manage_terms, sprintf( $edit_tags_file, $tax->name ) );
+ }
+}
+unset( $ptype, $ptype_obj, $ptype_for_id, $ptype_menu_position, $menu_icon, $i, $tax, $post_new_file );
+
+$menu[59] = array( '', 'read', 'separator2', '', 'wp-menu-separator' );
+
+$appearance_cap = current_user_can( 'switch_themes' ) ? 'switch_themes' : 'edit_theme_options';
+
+$menu[60] = array( __( 'Appearance' ), $appearance_cap, 'themes.php', '', 'menu-top menu-icon-appearance', 'menu-appearance', 'dashicons-admin-appearance' );
+ $submenu['themes.php'][5] = array( __( 'Themes' ), $appearance_cap, 'themes.php' );
+
+ $customize_url = add_query_arg( 'return', urlencode( remove_query_arg( wp_removable_query_args(), wp_unslash( $_SERVER['REQUEST_URI'] ) ) ), 'customize.php' );
+ $submenu['themes.php'][6] = array( __( 'Customize' ), 'customize', esc_url( $customize_url ), '', 'hide-if-no-customize' );
+
+if ( current_theme_supports( 'menus' ) || current_theme_supports( 'widgets' ) ) {
+ $submenu['themes.php'][10] = array( __( 'Menus' ), 'edit_theme_options', 'nav-menus.php' );
+}
+
+if ( current_theme_supports( 'custom-header' ) && current_user_can( 'customize' ) ) {
+ $customize_header_url = add_query_arg( array( 'autofocus' => array( 'control' => 'header_image' ) ), $customize_url );
+ $submenu['themes.php'][15] = array( __( 'Header' ), $appearance_cap, esc_url( $customize_header_url ), '', 'hide-if-no-customize' );
+}
+
+if ( current_theme_supports( 'custom-background' ) && current_user_can( 'customize' ) ) {
+ $customize_background_url = add_query_arg( array( 'autofocus' => array( 'control' => 'background_image' ) ), $customize_url );
+ $submenu['themes.php'][20] = array( __( 'Background' ), $appearance_cap, esc_url( $customize_background_url ), '', 'hide-if-no-customize' );
+}
+
+ unset( $customize_url );
+
+unset( $appearance_cap );
+
+// Add 'Editor' to the bottom of the Appearance menu.
+if ( ! is_multisite() ) {
+ add_action( 'admin_menu', '_add_themes_utility_last', 101 );
+}
+/**
+ * Adds the (theme) 'Editor' link to the bottom of the Appearance menu.
+ *
+ * @access private
+ * @since 3.0.0
+ */
+function _add_themes_utility_last() {
+ // Must use API on the admin_menu hook, direct modification is only possible on/before the _admin_menu hook
+ add_submenu_page( 'themes.php', __( 'Theme Editor' ), __( 'Theme Editor' ), 'edit_themes', 'theme-editor.php' );
+}
+
+$count = '';
+if ( ! is_multisite() && current_user_can( 'update_plugins' ) ) {
+ if ( ! isset( $update_data ) ) {
+ $update_data = wp_get_update_data();
+ }
+ $count = "<span class='update-plugins count-{$update_data['counts']['plugins']}'><span class='plugin-count'>" . number_format_i18n( $update_data['counts']['plugins'] ) . '</span></span>';
+}
+
+/* translators: %s: number of pending plugin updates */
+$menu[65] = array( sprintf( __( 'Plugins %s' ), $count ), 'activate_plugins', 'plugins.php', '', 'menu-top menu-icon-plugins', 'menu-plugins', 'dashicons-admin-plugins' );
+
+$submenu['plugins.php'][5] = array( __( 'Installed Plugins' ), 'activate_plugins', 'plugins.php' );
+
+if ( ! is_multisite() ) {
+ /* translators: add new plugin */
+ $submenu['plugins.php'][10] = array( _x( 'Add New', 'plugin' ), 'install_plugins', 'plugin-install.php' );
+ $submenu['plugins.php'][15] = array( __( 'Plugin Editor' ), 'edit_plugins', 'plugin-editor.php' );
+}
+
+unset( $update_data );
+
+if ( current_user_can( 'list_users' ) ) {
+ $menu[70] = array( __( 'Users' ), 'list_users', 'users.php', '', 'menu-top menu-icon-users', 'menu-users', 'dashicons-admin-users' );
+} else {
+ $menu[70] = array( __( 'Profile' ), 'read', 'profile.php', '', 'menu-top menu-icon-users', 'menu-users', 'dashicons-admin-users' );
+}
+
+if ( current_user_can( 'list_users' ) ) {
+ $_wp_real_parent_file['profile.php'] = 'users.php'; // Back-compat for plugins adding submenus to profile.php.
+ $submenu['users.php'][5] = array( __( 'All Users' ), 'list_users', 'users.php' );
+ if ( current_user_can( 'create_users' ) ) {
+ $submenu['users.php'][10] = array( _x( 'Add New', 'user' ), 'create_users', 'user-new.php' );
+ } elseif ( is_multisite() ) {
+ $submenu['users.php'][10] = array( _x( 'Add New', 'user' ), 'promote_users', 'user-new.php' );
+ }
+
+ $submenu['users.php'][15] = array( __( 'Your Profile' ), 'read', 'profile.php' );
+} else {
+ $_wp_real_parent_file['users.php'] = 'profile.php';
+ $submenu['profile.php'][5] = array( __( 'Your Profile' ), 'read', 'profile.php' );
+ if ( current_user_can( 'create_users' ) ) {
+ $submenu['profile.php'][10] = array( __( 'Add New User' ), 'create_users', 'user-new.php' );
+ } elseif ( is_multisite() ) {
+ $submenu['profile.php'][10] = array( __( 'Add New User' ), 'promote_users', 'user-new.php' );
+ }
+}
+
+$menu[75] = array( __( 'Tools' ), 'edit_posts', 'tools.php', '', 'menu-top menu-icon-tools', 'menu-tools', 'dashicons-admin-tools' );
+ $submenu['tools.php'][5] = array( __( 'Available Tools' ), 'edit_posts', 'tools.php' );
+ $submenu['tools.php'][10] = array( __( 'Import' ), 'import', 'import.php' );
+ $submenu['tools.php'][15] = array( __( 'Export' ), 'export', 'export.php' );
+ $submenu['tools.php'][20] = array( __( 'Site Health' ), 'view_site_health_checks', 'site-health.php' );
+if ( is_multisite() && ! is_main_site() ) {
+ $submenu['tools.php'][25] = array( __( 'Delete Site' ), 'delete_site', 'ms-delete-site.php' );
+}
+if ( ! is_multisite() && defined( 'WP_ALLOW_MULTISITE' ) && WP_ALLOW_MULTISITE ) {
+ $submenu['tools.php'][50] = array( __( 'Network Setup' ), 'setup_network', 'network.php' );
+}
+
+$menu[80] = array( __( 'Settings' ), 'manage_options', 'options-general.php', '', 'menu-top menu-icon-settings', 'menu-settings', 'dashicons-admin-settings' );
+ $submenu['options-general.php'][10] = array( _x( 'General', 'settings screen' ), 'manage_options', 'options-general.php' );
+ $submenu['options-general.php'][15] = array( __( 'Writing' ), 'manage_options', 'options-writing.php' );
+ $submenu['options-general.php'][20] = array( __( 'Reading' ), 'manage_options', 'options-reading.php' );
+ $submenu['options-general.php'][25] = array( __( 'Discussion' ), 'manage_options', 'options-discussion.php' );
+ $submenu['options-general.php'][30] = array( __( 'Media' ), 'manage_options', 'options-media.php' );
+ $submenu['options-general.php'][40] = array( __( 'Permalinks' ), 'manage_options', 'options-permalink.php' );
+ $submenu['options-general.php'][45] = array( __( 'Privacy' ), 'manage_privacy_options', 'privacy.php' );
+
+$_wp_last_utility_menu = 80; // The index of the last top-level menu in the utility menu group
+
+$menu[99] = array( '', 'read', 'separator-last', '', 'wp-menu-separator' );
+
+// Back-compat for old top-levels
+$_wp_real_parent_file['post.php'] = 'edit.php';
+$_wp_real_parent_file['post-new.php'] = 'edit.php';
+$_wp_real_parent_file['edit-pages.php'] = 'edit.php?post_type=page';
+$_wp_real_parent_file['page-new.php'] = 'edit.php?post_type=page';
+$_wp_real_parent_file['wpmu-admin.php'] = 'tools.php';
+$_wp_real_parent_file['ms-admin.php'] = 'tools.php';
+
+// Ensure backward compatibility.
+$compat = array(
+ 'index' => 'dashboard',
+ 'edit' => 'posts',
+ 'post' => 'posts',
+ 'upload' => 'media',
+ 'link-manager' => 'links',
+ 'edit-pages' => 'pages',
+ 'page' => 'pages',
+ 'edit-comments' => 'comments',
+ 'options-general' => 'settings',
+ 'themes' => 'appearance',
+);
+
+require_once( ABSPATH . 'wp-admin/includes/menu.php' );
diff --git a/www/crm/wp-admin/moderation.php b/www/crm/wp-admin/moderation.php
new file mode 100644
index 00000000..ae375df3
--- /dev/null
+++ b/www/crm/wp-admin/moderation.php
@@ -0,0 +1,12 @@
+<?php
+/**
+ * Comment Moderation Administration Screen.
+ *
+ * Redirects to edit-comments.php?comment_status=moderated.
+ *
+ * @package WordPress
+ * @subpackage Administration
+ */
+require_once( dirname( dirname( __FILE__ ) ) . '/wp-load.php' );
+wp_redirect( admin_url( 'edit-comments.php?comment_status=moderated' ) );
+exit;
diff --git a/www/crm/wp-admin/ms-admin.php b/www/crm/wp-admin/ms-admin.php
new file mode 100644
index 00000000..35e21e97
--- /dev/null
+++ b/www/crm/wp-admin/ms-admin.php
@@ -0,0 +1,13 @@
+<?php
+/**
+ * Multisite administration panel.
+ *
+ * @package WordPress
+ * @subpackage Multisite
+ * @since 3.0.0
+ */
+
+require_once( dirname( __FILE__ ) . '/admin.php' );
+
+wp_redirect( network_admin_url() );
+exit;
diff --git a/www/crm/wp-admin/ms-delete-site.php b/www/crm/wp-admin/ms-delete-site.php
new file mode 100644
index 00000000..b4498038
--- /dev/null
+++ b/www/crm/wp-admin/ms-delete-site.php
@@ -0,0 +1,114 @@
+<?php
+/**
+ * Multisite delete site panel.
+ *
+ * @package WordPress
+ * @subpackage Multisite
+ * @since 3.0.0
+ */
+
+require_once( dirname( __FILE__ ) . '/admin.php' );
+
+if ( ! is_multisite() ) {
+ wp_die( __( 'Multisite support is not enabled.' ) );
+}
+
+if ( ! current_user_can( 'delete_site' ) ) {
+ wp_die( __( 'Sorry, you are not allowed to delete this site.' ) );
+}
+
+if ( isset( $_GET['h'] ) && $_GET['h'] != '' && get_option( 'delete_blog_hash' ) != false ) {
+ if ( hash_equals( get_option( 'delete_blog_hash' ), $_GET['h'] ) ) {
+ wpmu_delete_blog( get_current_blog_id() );
+ wp_die( sprintf( __( 'Thank you for using %s, your site has been deleted. Happy trails to you until we meet again.' ), get_network()->site_name ) );
+ } else {
+ wp_die( __( 'Sorry, the link you clicked is stale. Please select another option.' ) );
+ }
+}
+
+$blog = get_site();
+$user = wp_get_current_user();
+
+$title = __( 'Delete Site' );
+$parent_file = 'tools.php';
+require_once( ABSPATH . 'wp-admin/admin-header.php' );
+
+echo '<div class="wrap">';
+echo '<h1>' . esc_html( $title ) . '</h1>';
+
+if ( isset( $_POST['action'] ) && $_POST['action'] == 'deleteblog' && isset( $_POST['confirmdelete'] ) && $_POST['confirmdelete'] == '1' ) {
+ check_admin_referer( 'delete-blog' );
+
+ $hash = wp_generate_password( 20, false );
+ update_option( 'delete_blog_hash', $hash );
+
+ $url_delete = esc_url( admin_url( 'ms-delete-site.php?h=' . $hash ) );
+
+ $switched_locale = switch_to_locale( get_locale() );
+
+ /* translators: Do not translate USERNAME, URL_DELETE, SITE_NAME: those are placeholders. */
+ $content = __(
+ "Howdy ###USERNAME###,
+
+You recently clicked the 'Delete Site' link on your site and filled in a
+form on that page.
+
+If you really want to delete your site, click the link below. You will not
+be asked to confirm again so only click this link if you are absolutely certain:
+###URL_DELETE###
+
+If you delete your site, please consider opening a new site here
+some time in the future! (But remember your current site and username
+are gone forever.)
+
+Thanks for using the site,
+Webmaster
+###SITE_NAME###"
+ );
+ /**
+ * Filters the email content sent when a site in a Multisite network is deleted.
+ *
+ * @since 3.0.0
+ *
+ * @param string $content The email content that will be sent to the user who deleted a site in a Multisite network.
+ */
+ $content = apply_filters( 'delete_site_email_content', $content );
+
+ $content = str_replace( '###USERNAME###', $user->user_login, $content );
+ $content = str_replace( '###URL_DELETE###', $url_delete, $content );
+ $content = str_replace( '###SITE_NAME###', get_network()->site_name, $content );
+
+ wp_mail( get_option( 'admin_email' ), '[ ' . wp_specialchars_decode( get_option( 'blogname' ) ) . ' ] ' . __( 'Delete My Site' ), $content );
+
+ if ( $switched_locale ) {
+ restore_previous_locale();
+ }
+ ?>
+
+ <p><?php _e( 'Thank you. Please check your email for a link to confirm your action. Your site will not be deleted until this link is clicked.' ); ?></p>
+
+ <?php
+} else {
+ ?>
+ <p><?php printf( __( 'If you do not want to use your %s site any more, you can delete it using the form below. When you click <strong>Delete My Site Permanently</strong> you will be sent an email with a link in it. Click on this link to delete your site.' ), get_network()->site_name ); ?></p>
+ <p><?php _e( 'Remember, once deleted your site cannot be restored.' ); ?></p>
+
+ <form method="post" name="deletedirect">
+ <?php wp_nonce_field( 'delete-blog' ); ?>
+ <input type="hidden" name="action" value="deleteblog" />
+ <p><input id="confirmdelete" type="checkbox" name="confirmdelete" value="1" /> <label for="confirmdelete"><strong>
+ <?php
+ printf(
+ /* translators: %s: site address */
+ __( "I'm sure I want to permanently disable my site, and I am aware I can never get it back or use %s again." ),
+ $blog->domain . $blog->path
+ );
+ ?>
+ </strong></label></p>
+ <?php submit_button( __( 'Delete My Site Permanently' ) ); ?>
+ </form>
+ <?php
+}
+echo '</div>';
+
+include( ABSPATH . 'wp-admin/admin-footer.php' );
diff --git a/www/crm/wp-admin/ms-edit.php b/www/crm/wp-admin/ms-edit.php
new file mode 100644
index 00000000..5c405e6f
--- /dev/null
+++ b/www/crm/wp-admin/ms-edit.php
@@ -0,0 +1,13 @@
+<?php
+/**
+ * Action handler for Multisite administration panels.
+ *
+ * @package WordPress
+ * @subpackage Multisite
+ * @since 3.0.0
+ */
+
+require_once( dirname( __FILE__ ) . '/admin.php' );
+
+wp_redirect( network_admin_url() );
+exit;
diff --git a/www/crm/wp-admin/ms-options.php b/www/crm/wp-admin/ms-options.php
new file mode 100644
index 00000000..6bf5eb6b
--- /dev/null
+++ b/www/crm/wp-admin/ms-options.php
@@ -0,0 +1,12 @@
+<?php
+/**
+ * Multisite network settings administration panel.
+ *
+ * @package WordPress
+ * @subpackage Multisite
+ * @since 3.0.0
+ */
+
+require_once( dirname( __FILE__ ) . '/admin.php' );
+
+wp_redirect( network_admin_url( 'settings.php' ) );
diff --git a/www/crm/wp-admin/ms-sites.php b/www/crm/wp-admin/ms-sites.php
new file mode 100644
index 00000000..79602cb0
--- /dev/null
+++ b/www/crm/wp-admin/ms-sites.php
@@ -0,0 +1,13 @@
+<?php
+/**
+ * Multisite sites administration panel.
+ *
+ * @package WordPress
+ * @subpackage Multisite
+ * @since 3.0.0
+ */
+
+require_once( dirname( __FILE__ ) . '/admin.php' );
+
+wp_redirect( network_admin_url( 'sites.php' ) );
+exit;
diff --git a/www/crm/wp-admin/ms-themes.php b/www/crm/wp-admin/ms-themes.php
new file mode 100644
index 00000000..4b86ac96
--- /dev/null
+++ b/www/crm/wp-admin/ms-themes.php
@@ -0,0 +1,13 @@
+<?php
+/**
+ * Multisite themes administration panel.
+ *
+ * @package WordPress
+ * @subpackage Multisite
+ * @since 3.0.0
+ */
+
+require_once( dirname( __FILE__ ) . '/admin.php' );
+
+wp_redirect( network_admin_url( 'themes.php' ) );
+exit;
diff --git a/www/crm/wp-admin/ms-upgrade-network.php b/www/crm/wp-admin/ms-upgrade-network.php
new file mode 100644
index 00000000..892ab964
--- /dev/null
+++ b/www/crm/wp-admin/ms-upgrade-network.php
@@ -0,0 +1,13 @@
+<?php
+/**
+ * Multisite upgrade administration panel.
+ *
+ * @package WordPress
+ * @subpackage Multisite
+ * @since 3.0.0
+ */
+
+require_once( dirname( __FILE__ ) . '/admin.php' );
+
+wp_redirect( network_admin_url( 'upgrade.php' ) );
+exit;
diff --git a/www/crm/wp-admin/ms-users.php b/www/crm/wp-admin/ms-users.php
new file mode 100644
index 00000000..1b00514e
--- /dev/null
+++ b/www/crm/wp-admin/ms-users.php
@@ -0,0 +1,13 @@
+<?php
+/**
+ * Multisite users administration panel.
+ *
+ * @package WordPress
+ * @subpackage Multisite
+ * @since 3.0.0
+ */
+
+require_once( dirname( __FILE__ ) . '/admin.php' );
+
+wp_redirect( network_admin_url( 'users.php' ) );
+exit;
diff --git a/www/crm/wp-admin/my-sites.php b/www/crm/wp-admin/my-sites.php
new file mode 100644
index 00000000..0d925b41
--- /dev/null
+++ b/www/crm/wp-admin/my-sites.php
@@ -0,0 +1,160 @@
+<?php
+/**
+ * My Sites dashboard.
+ *
+ * @package WordPress
+ * @subpackage Multisite
+ * @since 3.0.0
+ */
+
+require_once( dirname( __FILE__ ) . '/admin.php' );
+
+if ( ! is_multisite() ) {
+ wp_die( __( 'Multisite support is not enabled.' ) );
+}
+
+if ( ! current_user_can( 'read' ) ) {
+ wp_die( __( 'Sorry, you are not allowed to access this page.' ) );
+}
+
+$action = isset( $_POST['action'] ) ? $_POST['action'] : 'splash';
+
+$blogs = get_blogs_of_user( $current_user->ID );
+
+$updated = false;
+if ( 'updateblogsettings' == $action && isset( $_POST['primary_blog'] ) ) {
+ check_admin_referer( 'update-my-sites' );
+
+ $blog = get_site( (int) $_POST['primary_blog'] );
+ if ( $blog && isset( $blog->domain ) ) {
+ update_user_option( $current_user->ID, 'primary_blog', (int) $_POST['primary_blog'], true );
+ $updated = true;
+ } else {
+ wp_die( __( 'The primary site you chose does not exist.' ) );
+ }
+}
+
+$title = __( 'My Sites' );
+$parent_file = 'index.php';
+
+get_current_screen()->add_help_tab(
+ array(
+ 'id' => 'overview',
+ 'title' => __( 'Overview' ),
+ 'content' =>
+ '<p>' . __( 'This screen shows an individual user all of their sites in this network, and also allows that user to set a primary site. They can use the links under each site to visit either the front end or the dashboard for that site.' ) . '</p>',
+ )
+);
+
+get_current_screen()->set_help_sidebar(
+ '<p><strong>' . __( 'For more information:' ) . '</strong></p>' .
+ '<p>' . __( '<a href="https://codex.wordpress.org/Dashboard_My_Sites_Screen">Documentation on My Sites</a>' ) . '</p>' .
+ '<p>' . __( '<a href="https://wordpress.org/support/">Support</a>' ) . '</p>'
+);
+
+require_once( ABSPATH . 'wp-admin/admin-header.php' );
+
+if ( $updated ) { ?>
+ <div id="message" class="updated notice is-dismissible"><p><strong><?php _e( 'Settings saved.' ); ?></strong></p></div>
+<?php } ?>
+
+<div class="wrap">
+<h1 class="wp-heading-inline">
+<?php
+echo esc_html( $title );
+?>
+</h1>
+
+<?php
+if ( in_array( get_site_option( 'registration' ), array( 'all', 'blog' ) ) ) {
+ /** This filter is documented in wp-login.php */
+ $sign_up_url = apply_filters( 'wp_signup_location', network_site_url( 'wp-signup.php' ) );
+ printf( ' <a href="%s" class="page-title-action">%s</a>', esc_url( $sign_up_url ), esc_html_x( 'Add New', 'site' ) );
+}
+
+if ( empty( $blogs ) ) :
+ echo '<p>';
+ _e( 'You must be a member of at least one site to use this page.' );
+ echo '</p>';
+else :
+ ?>
+
+<hr class="wp-header-end">
+
+<form id="myblogs" method="post">
+ <?php
+ choose_primary_blog();
+ /**
+ * Fires before the sites list on the My Sites screen.
+ *
+ * @since 3.0.0
+ */
+ do_action( 'myblogs_allblogs_options' );
+ ?>
+ <br clear="all" />
+ <ul class="my-sites striped">
+ <?php
+ /**
+ * Enable the Global Settings section on the My Sites screen.
+ *
+ * By default, the Global Settings section is hidden. Passing a non-empty
+ * string to this filter will enable the section, and allow new settings
+ * to be added, either globally or for specific sites.
+ *
+ * @since MU (3.0.0)
+ *
+ * @param string $settings_html The settings HTML markup. Default empty.
+ * @param object $context Context of the setting (global or site-specific). Default 'global'.
+ */
+ $settings_html = apply_filters( 'myblogs_options', '', 'global' );
+ if ( $settings_html != '' ) {
+ echo '<h3>' . __( 'Global Settings' ) . '</h3>';
+ echo $settings_html;
+ }
+ reset( $blogs );
+
+ foreach ( $blogs as $user_blog ) {
+ switch_to_blog( $user_blog->userblog_id );
+
+ echo '<li>';
+ echo "<h3>{$user_blog->blogname}</h3>";
+
+ $actions = "<a href='" . esc_url( home_url() ) . "'>" . __( 'Visit' ) . '</a>';
+
+ if ( current_user_can( 'read' ) ) {
+ $actions .= " | <a href='" . esc_url( admin_url() ) . "'>" . __( 'Dashboard' ) . '</a>';
+ }
+
+ /**
+ * Filters the row links displayed for each site on the My Sites screen.
+ *
+ * @since MU (3.0.0)
+ *
+ * @param string $actions The HTML site link markup.
+ * @param object $user_blog An object containing the site data.
+ */
+ $actions = apply_filters( 'myblogs_blog_actions', $actions, $user_blog );
+ echo "<p class='my-sites-actions'>" . $actions . '</p>';
+
+ /** This filter is documented in wp-admin/my-sites.php */
+ echo apply_filters( 'myblogs_options', '', $user_blog );
+ echo '</li>';
+
+ restore_current_blog();
+ }
+ ?>
+ </ul>
+ <?php
+ if ( count( $blogs ) > 1 || has_action( 'myblogs_allblogs_options' ) || has_filter( 'myblogs_options' ) ) {
+ ?>
+ <input type="hidden" name="action" value="updateblogsettings" />
+ <?php
+ wp_nonce_field( 'update-my-sites' );
+ submit_button();
+ }
+ ?>
+ </form>
+<?php endif; ?>
+ </div>
+<?php
+include( ABSPATH . 'wp-admin/admin-footer.php' );
diff --git a/www/crm/wp-admin/nav-menus.php b/www/crm/wp-admin/nav-menus.php
new file mode 100644
index 00000000..b7fc810a
--- /dev/null
+++ b/www/crm/wp-admin/nav-menus.php
@@ -0,0 +1,1014 @@
+<?php
+/**
+ * WordPress Administration for Navigation Menus
+ * Interface functions
+ *
+ * @version 2.0.0
+ *
+ * @package WordPress
+ * @subpackage Administration
+ */
+
+/** Load WordPress Administration Bootstrap */
+require_once( dirname( __FILE__ ) . '/admin.php' );
+
+// Load all the nav menu interface functions
+require_once( ABSPATH . 'wp-admin/includes/nav-menu.php' );
+
+if ( ! current_theme_supports( 'menus' ) && ! current_theme_supports( 'widgets' ) ) {
+ wp_die( __( 'Your theme does not support navigation menus or widgets.' ) );
+}
+
+// Permissions Check
+if ( ! current_user_can( 'edit_theme_options' ) ) {
+ wp_die(
+ '<h1>' . __( 'You need a higher level of permission.' ) . '</h1>' .
+ '<p>' . __( 'Sorry, you are not allowed to edit theme options on this site.' ) . '</p>',
+ 403
+ );
+}
+
+wp_enqueue_script( 'nav-menu' );
+
+if ( wp_is_mobile() ) {
+ wp_enqueue_script( 'jquery-touch-punch' );
+}
+
+// Container for any messages displayed to the user
+$messages = array();
+
+// Container that stores the name of the active menu
+$nav_menu_selected_title = '';
+
+// The menu id of the current menu being edited
+$nav_menu_selected_id = isset( $_REQUEST['menu'] ) ? (int) $_REQUEST['menu'] : 0;
+
+// Get existing menu locations assignments
+$locations = get_registered_nav_menus();
+$menu_locations = get_nav_menu_locations();
+$num_locations = count( array_keys( $locations ) );
+
+// Allowed actions: add, update, delete
+$action = isset( $_REQUEST['action'] ) ? $_REQUEST['action'] : 'edit';
+
+/*
+ * If a JSON blob of navigation menu data is found, expand it and inject it
+ * into `$_POST` to avoid PHP `max_input_vars` limitations. See #14134.
+ */
+_wp_expand_nav_menu_post_data();
+
+switch ( $action ) {
+ case 'add-menu-item':
+ check_admin_referer( 'add-menu_item', 'menu-settings-column-nonce' );
+ if ( isset( $_REQUEST['nav-menu-locations'] ) ) {
+ set_theme_mod( 'nav_menu_locations', array_map( 'absint', $_REQUEST['menu-locations'] ) );
+ } elseif ( isset( $_REQUEST['menu-item'] ) ) {
+ wp_save_nav_menu_items( $nav_menu_selected_id, $_REQUEST['menu-item'] );
+ }
+ break;
+ case 'move-down-menu-item':
+ // Moving down a menu item is the same as moving up the next in order.
+ check_admin_referer( 'move-menu_item' );
+ $menu_item_id = isset( $_REQUEST['menu-item'] ) ? (int) $_REQUEST['menu-item'] : 0;
+ if ( is_nav_menu_item( $menu_item_id ) ) {
+ $menus = isset( $_REQUEST['menu'] ) ? array( (int) $_REQUEST['menu'] ) : wp_get_object_terms( $menu_item_id, 'nav_menu', array( 'fields' => 'ids' ) );
+ if ( ! is_wp_error( $menus ) && ! empty( $menus[0] ) ) {
+ $menu_id = (int) $menus[0];
+ $ordered_menu_items = wp_get_nav_menu_items( $menu_id );
+ $menu_item_data = (array) wp_setup_nav_menu_item( get_post( $menu_item_id ) );
+
+ // Set up the data we need in one pass through the array of menu items.
+ $dbids_to_orders = array();
+ $orders_to_dbids = array();
+ foreach ( (array) $ordered_menu_items as $ordered_menu_item_object ) {
+ if ( isset( $ordered_menu_item_object->ID ) ) {
+ if ( isset( $ordered_menu_item_object->menu_order ) ) {
+ $dbids_to_orders[ $ordered_menu_item_object->ID ] = $ordered_menu_item_object->menu_order;
+ $orders_to_dbids[ $ordered_menu_item_object->menu_order ] = $ordered_menu_item_object->ID;
+ }
+ }
+ }
+
+ // Get next in order.
+ if (
+ isset( $orders_to_dbids[ $dbids_to_orders[ $menu_item_id ] + 1 ] )
+ ) {
+ $next_item_id = $orders_to_dbids[ $dbids_to_orders[ $menu_item_id ] + 1 ];
+ $next_item_data = (array) wp_setup_nav_menu_item( get_post( $next_item_id ) );
+
+ // If not siblings of same parent, bubble menu item up but keep order.
+ if (
+ ! empty( $menu_item_data['menu_item_parent'] ) &&
+ (
+ empty( $next_item_data['menu_item_parent'] ) ||
+ $next_item_data['menu_item_parent'] != $menu_item_data['menu_item_parent']
+ )
+ ) {
+
+ $parent_db_id = in_array( $menu_item_data['menu_item_parent'], $orders_to_dbids ) ? (int) $menu_item_data['menu_item_parent'] : 0;
+
+ $parent_object = wp_setup_nav_menu_item( get_post( $parent_db_id ) );
+
+ if ( ! is_wp_error( $parent_object ) ) {
+ $parent_data = (array) $parent_object;
+ $menu_item_data['menu_item_parent'] = $parent_data['menu_item_parent'];
+ update_post_meta( $menu_item_data['ID'], '_menu_item_menu_item_parent', (int) $menu_item_data['menu_item_parent'] );
+
+ }
+
+ // Make menu item a child of its next sibling.
+ } else {
+ $next_item_data['menu_order'] = $next_item_data['menu_order'] - 1;
+ $menu_item_data['menu_order'] = $menu_item_data['menu_order'] + 1;
+
+ $menu_item_data['menu_item_parent'] = $next_item_data['ID'];
+ update_post_meta( $menu_item_data['ID'], '_menu_item_menu_item_parent', (int) $menu_item_data['menu_item_parent'] );
+
+ wp_update_post( $menu_item_data );
+ wp_update_post( $next_item_data );
+ }
+
+ // The item is last but still has a parent, so bubble up.
+ } elseif (
+ ! empty( $menu_item_data['menu_item_parent'] ) &&
+ in_array( $menu_item_data['menu_item_parent'], $orders_to_dbids )
+ ) {
+ $menu_item_data['menu_item_parent'] = (int) get_post_meta( $menu_item_data['menu_item_parent'], '_menu_item_menu_item_parent', true );
+ update_post_meta( $menu_item_data['ID'], '_menu_item_menu_item_parent', (int) $menu_item_data['menu_item_parent'] );
+ }
+ }
+ }
+
+ break;
+ case 'move-up-menu-item':
+ check_admin_referer( 'move-menu_item' );
+ $menu_item_id = isset( $_REQUEST['menu-item'] ) ? (int) $_REQUEST['menu-item'] : 0;
+ if ( is_nav_menu_item( $menu_item_id ) ) {
+ $menus = isset( $_REQUEST['menu'] ) ? array( (int) $_REQUEST['menu'] ) : wp_get_object_terms( $menu_item_id, 'nav_menu', array( 'fields' => 'ids' ) );
+ if ( ! is_wp_error( $menus ) && ! empty( $menus[0] ) ) {
+ $menu_id = (int) $menus[0];
+ $ordered_menu_items = wp_get_nav_menu_items( $menu_id );
+ $menu_item_data = (array) wp_setup_nav_menu_item( get_post( $menu_item_id ) );
+
+ // Set up the data we need in one pass through the array of menu items.
+ $dbids_to_orders = array();
+ $orders_to_dbids = array();
+ foreach ( (array) $ordered_menu_items as $ordered_menu_item_object ) {
+ if ( isset( $ordered_menu_item_object->ID ) ) {
+ if ( isset( $ordered_menu_item_object->menu_order ) ) {
+ $dbids_to_orders[ $ordered_menu_item_object->ID ] = $ordered_menu_item_object->menu_order;
+ $orders_to_dbids[ $ordered_menu_item_object->menu_order ] = $ordered_menu_item_object->ID;
+ }
+ }
+ }
+
+ // If this menu item is not first.
+ if ( ! empty( $dbids_to_orders[ $menu_item_id ] ) && ! empty( $orders_to_dbids[ $dbids_to_orders[ $menu_item_id ] - 1 ] ) ) {
+
+ // If this menu item is a child of the previous.
+ if (
+ ! empty( $menu_item_data['menu_item_parent'] ) &&
+ in_array( $menu_item_data['menu_item_parent'], array_keys( $dbids_to_orders ) ) &&
+ isset( $orders_to_dbids[ $dbids_to_orders[ $menu_item_id ] - 1 ] ) &&
+ ( $menu_item_data['menu_item_parent'] == $orders_to_dbids[ $dbids_to_orders[ $menu_item_id ] - 1 ] )
+ ) {
+ $parent_db_id = in_array( $menu_item_data['menu_item_parent'], $orders_to_dbids ) ? (int) $menu_item_data['menu_item_parent'] : 0;
+ $parent_object = wp_setup_nav_menu_item( get_post( $parent_db_id ) );
+
+ if ( ! is_wp_error( $parent_object ) ) {
+ $parent_data = (array) $parent_object;
+
+ /*
+ * If there is something before the parent and parent a child of it,
+ * make menu item a child also of it.
+ */
+ if (
+ ! empty( $dbids_to_orders[ $parent_db_id ] ) &&
+ ! empty( $orders_to_dbids[ $dbids_to_orders[ $parent_db_id ] - 1 ] ) &&
+ ! empty( $parent_data['menu_item_parent'] )
+ ) {
+ $menu_item_data['menu_item_parent'] = $parent_data['menu_item_parent'];
+
+ /*
+ * Else if there is something before parent and parent not a child of it,
+ * make menu item a child of that something's parent
+ */
+ } elseif (
+ ! empty( $dbids_to_orders[ $parent_db_id ] ) &&
+ ! empty( $orders_to_dbids[ $dbids_to_orders[ $parent_db_id ] - 1 ] )
+ ) {
+ $_possible_parent_id = (int) get_post_meta( $orders_to_dbids[ $dbids_to_orders[ $parent_db_id ] - 1 ], '_menu_item_menu_item_parent', true );
+ if ( in_array( $_possible_parent_id, array_keys( $dbids_to_orders ) ) ) {
+ $menu_item_data['menu_item_parent'] = $_possible_parent_id;
+ } else {
+ $menu_item_data['menu_item_parent'] = 0;
+ }
+
+ // Else there isn't something before the parent.
+ } else {
+ $menu_item_data['menu_item_parent'] = 0;
+ }
+
+ // Set former parent's [menu_order] to that of menu-item's.
+ $parent_data['menu_order'] = $parent_data['menu_order'] + 1;
+
+ // Set menu-item's [menu_order] to that of former parent.
+ $menu_item_data['menu_order'] = $menu_item_data['menu_order'] - 1;
+
+ // Save changes.
+ update_post_meta( $menu_item_data['ID'], '_menu_item_menu_item_parent', (int) $menu_item_data['menu_item_parent'] );
+ wp_update_post( $menu_item_data );
+ wp_update_post( $parent_data );
+ }
+
+ // Else this menu item is not a child of the previous.
+ } elseif (
+ empty( $menu_item_data['menu_order'] ) ||
+ empty( $menu_item_data['menu_item_parent'] ) ||
+ ! in_array( $menu_item_data['menu_item_parent'], array_keys( $dbids_to_orders ) ) ||
+ empty( $orders_to_dbids[ $dbids_to_orders[ $menu_item_id ] - 1 ] ) ||
+ $orders_to_dbids[ $dbids_to_orders[ $menu_item_id ] - 1 ] != $menu_item_data['menu_item_parent']
+ ) {
+ // Just make it a child of the previous; keep the order.
+ $menu_item_data['menu_item_parent'] = (int) $orders_to_dbids[ $dbids_to_orders[ $menu_item_id ] - 1 ];
+ update_post_meta( $menu_item_data['ID'], '_menu_item_menu_item_parent', (int) $menu_item_data['menu_item_parent'] );
+ wp_update_post( $menu_item_data );
+ }
+ }
+ }
+ }
+ break;
+
+ case 'delete-menu-item':
+ $menu_item_id = (int) $_REQUEST['menu-item'];
+
+ check_admin_referer( 'delete-menu_item_' . $menu_item_id );
+
+ if ( is_nav_menu_item( $menu_item_id ) && wp_delete_post( $menu_item_id, true ) ) {
+ $messages[] = '<div id="message" class="updated notice is-dismissible"><p>' . __( 'The menu item has been successfully deleted.' ) . '</p></div>';
+ }
+ break;
+
+ case 'delete':
+ check_admin_referer( 'delete-nav_menu-' . $nav_menu_selected_id );
+ if ( is_nav_menu( $nav_menu_selected_id ) ) {
+ $deletion = wp_delete_nav_menu( $nav_menu_selected_id );
+ } else {
+ // Reset the selected menu.
+ $nav_menu_selected_id = 0;
+ unset( $_REQUEST['menu'] );
+ }
+
+ if ( ! isset( $deletion ) ) {
+ break;
+ }
+
+ if ( is_wp_error( $deletion ) ) {
+ $messages[] = '<div id="message" class="error notice is-dismissible"><p>' . $deletion->get_error_message() . '</p></div>';
+ } else {
+ $messages[] = '<div id="message" class="updated notice is-dismissible"><p>' . __( 'The menu has been successfully deleted.' ) . '</p></div>';
+ }
+ break;
+
+ case 'delete_menus':
+ check_admin_referer( 'nav_menus_bulk_actions' );
+ foreach ( $_REQUEST['delete_menus'] as $menu_id_to_delete ) {
+ if ( ! is_nav_menu( $menu_id_to_delete ) ) {
+ continue;
+ }
+
+ $deletion = wp_delete_nav_menu( $menu_id_to_delete );
+ if ( is_wp_error( $deletion ) ) {
+ $messages[] = '<div id="message" class="error notice is-dismissible"><p>' . $deletion->get_error_message() . '</p></div>';
+ $deletion_error = true;
+ }
+ }
+
+ if ( empty( $deletion_error ) ) {
+ $messages[] = '<div id="message" class="updated notice is-dismissible"><p>' . __( 'Selected menus have been successfully deleted.' ) . '</p></div>';
+ }
+ break;
+
+ case 'update':
+ check_admin_referer( 'update-nav_menu', 'update-nav-menu-nonce' );
+
+ // Remove menu locations that have been unchecked.
+ foreach ( $locations as $location => $description ) {
+ if ( ( empty( $_POST['menu-locations'] ) || empty( $_POST['menu-locations'][ $location ] ) ) && isset( $menu_locations[ $location ] ) && $menu_locations[ $location ] == $nav_menu_selected_id ) {
+ unset( $menu_locations[ $location ] );
+ }
+ }
+
+ // Merge new and existing menu locations if any new ones are set.
+ if ( isset( $_POST['menu-locations'] ) ) {
+ $new_menu_locations = array_map( 'absint', $_POST['menu-locations'] );
+ $menu_locations = array_merge( $menu_locations, $new_menu_locations );
+ }
+
+ // Set menu locations.
+ set_theme_mod( 'nav_menu_locations', $menu_locations );
+
+ // Add Menu.
+ if ( 0 == $nav_menu_selected_id ) {
+ $new_menu_title = trim( esc_html( $_POST['menu-name'] ) );
+
+ if ( $new_menu_title ) {
+ $_nav_menu_selected_id = wp_update_nav_menu_object( 0, array( 'menu-name' => $new_menu_title ) );
+
+ if ( is_wp_error( $_nav_menu_selected_id ) ) {
+ $messages[] = '<div id="message" class="error notice is-dismissible"><p>' . $_nav_menu_selected_id->get_error_message() . '</p></div>';
+ } else {
+ $_menu_object = wp_get_nav_menu_object( $_nav_menu_selected_id );
+ $nav_menu_selected_id = $_nav_menu_selected_id;
+ $nav_menu_selected_title = $_menu_object->name;
+ if ( isset( $_REQUEST['menu-item'] ) ) {
+ wp_save_nav_menu_items( $nav_menu_selected_id, absint( $_REQUEST['menu-item'] ) );
+ }
+ if ( isset( $_REQUEST['zero-menu-state'] ) ) {
+ // If there are menu items, add them
+ wp_nav_menu_update_menu_items( $nav_menu_selected_id, $nav_menu_selected_title );
+ // Auto-save nav_menu_locations
+ $locations = get_nav_menu_locations();
+ foreach ( $locations as $location => $menu_id ) {
+ $locations[ $location ] = $nav_menu_selected_id;
+ break; // There should only be 1
+ }
+ set_theme_mod( 'nav_menu_locations', $locations );
+ }
+ if ( isset( $_REQUEST['use-location'] ) ) {
+ $locations = get_registered_nav_menus();
+ $menu_locations = get_nav_menu_locations();
+ if ( isset( $locations[ $_REQUEST['use-location'] ] ) ) {
+ $menu_locations[ $_REQUEST['use-location'] ] = $nav_menu_selected_id;
+ }
+ set_theme_mod( 'nav_menu_locations', $menu_locations );
+ }
+
+ // $messages[] = '<div id="message" class="updated"><p>' . sprintf( __( '<strong>%s</strong> has been created.' ), $nav_menu_selected_title ) . '</p></div>';
+ wp_redirect( admin_url( 'nav-menus.php?menu=' . $_nav_menu_selected_id ) );
+ exit();
+ }
+ } else {
+ $messages[] = '<div id="message" class="error notice is-dismissible"><p>' . __( 'Please enter a valid menu name.' ) . '</p></div>';
+ }
+
+ // Update existing menu.
+ } else {
+
+ $_menu_object = wp_get_nav_menu_object( $nav_menu_selected_id );
+
+ $menu_title = trim( esc_html( $_POST['menu-name'] ) );
+ if ( ! $menu_title ) {
+ $messages[] = '<div id="message" class="error notice is-dismissible"><p>' . __( 'Please enter a valid menu name.' ) . '</p></div>';
+ $menu_title = $_menu_object->name;
+ }
+
+ if ( ! is_wp_error( $_menu_object ) ) {
+ $_nav_menu_selected_id = wp_update_nav_menu_object( $nav_menu_selected_id, array( 'menu-name' => $menu_title ) );
+ if ( is_wp_error( $_nav_menu_selected_id ) ) {
+ $_menu_object = $_nav_menu_selected_id;
+ $messages[] = '<div id="message" class="error notice is-dismissible"><p>' . $_nav_menu_selected_id->get_error_message() . '</p></div>';
+ } else {
+ $_menu_object = wp_get_nav_menu_object( $_nav_menu_selected_id );
+ $nav_menu_selected_title = $_menu_object->name;
+ }
+ }
+
+ // Update menu items.
+ if ( ! is_wp_error( $_menu_object ) ) {
+ $messages = array_merge( $messages, wp_nav_menu_update_menu_items( $_nav_menu_selected_id, $nav_menu_selected_title ) );
+
+ // If the menu ID changed, redirect to the new URL.
+ if ( $nav_menu_selected_id != $_nav_menu_selected_id ) {
+ wp_redirect( admin_url( 'nav-menus.php?menu=' . intval( $_nav_menu_selected_id ) ) );
+ exit();
+ }
+ }
+ }
+ break;
+ case 'locations':
+ if ( ! $num_locations ) {
+ wp_redirect( admin_url( 'nav-menus.php' ) );
+ exit();
+ }
+
+ add_filter( 'screen_options_show_screen', '__return_false' );
+
+ if ( isset( $_POST['menu-locations'] ) ) {
+ check_admin_referer( 'save-menu-locations' );
+
+ $new_menu_locations = array_map( 'absint', $_POST['menu-locations'] );
+ $menu_locations = array_merge( $menu_locations, $new_menu_locations );
+ // Set menu locations
+ set_theme_mod( 'nav_menu_locations', $menu_locations );
+
+ $messages[] = '<div id="message" class="updated notice is-dismissible"><p>' . __( 'Menu locations updated.' ) . '</p></div>';
+ }
+ break;
+}
+
+// Get all nav menus.
+$nav_menus = wp_get_nav_menus();
+$menu_count = count( $nav_menus );
+
+// Are we on the add new screen?
+$add_new_screen = ( isset( $_GET['menu'] ) && 0 == $_GET['menu'] ) ? true : false;
+
+$locations_screen = ( isset( $_GET['action'] ) && 'locations' == $_GET['action'] ) ? true : false;
+
+/*
+ * If we have one theme location, and zero menus, we take them right
+ * into editing their first menu.
+ */
+$page_count = wp_count_posts( 'page' );
+$one_theme_location_no_menus = ( 1 == count( get_registered_nav_menus() ) && ! $add_new_screen && empty( $nav_menus ) && ! empty( $page_count->publish ) ) ? true : false;
+
+$nav_menus_l10n = array(
+ 'oneThemeLocationNoMenus' => $one_theme_location_no_menus,
+ 'moveUp' => __( 'Move up one' ),
+ 'moveDown' => __( 'Move down one' ),
+ 'moveToTop' => __( 'Move to the top' ),
+ /* translators: %s: previous item name */
+ 'moveUnder' => __( 'Move under %s' ),
+ /* translators: %s: previous item name */
+ 'moveOutFrom' => __( 'Move out from under %s' ),
+ /* translators: %s: previous item name */
+ 'under' => __( 'Under %s' ),
+ /* translators: %s: previous item name */
+ 'outFrom' => __( 'Out from under %s' ),
+ /* translators: 1: item name, 2: item position, 3: total number of items */
+ 'menuFocus' => __( '%1$s. Menu item %2$d of %3$d.' ),
+ /* translators: 1: item name, 2: item position, 3: parent item name */
+ 'subMenuFocus' => __( '%1$s. Sub item number %2$d under %3$s.' ),
+);
+wp_localize_script( 'nav-menu', 'menus', $nav_menus_l10n );
+
+/*
+ * Redirect to add screen if there are no menus and this users has either zero,
+ * or more than 1 theme locations.
+ */
+if ( 0 == $menu_count && ! $add_new_screen && ! $one_theme_location_no_menus ) {
+ wp_redirect( admin_url( 'nav-menus.php?action=edit&menu=0' ) );
+}
+
+// Get recently edited nav menu.
+$recently_edited = absint( get_user_option( 'nav_menu_recently_edited' ) );
+if ( empty( $recently_edited ) && is_nav_menu( $nav_menu_selected_id ) ) {
+ $recently_edited = $nav_menu_selected_id;
+}
+
+// Use $recently_edited if none are selected.
+if ( empty( $nav_menu_selected_id ) && ! isset( $_GET['menu'] ) && is_nav_menu( $recently_edited ) ) {
+ $nav_menu_selected_id = $recently_edited;
+}
+
+// On deletion of menu, if another menu exists, show it.
+if ( ! $add_new_screen && 0 < $menu_count && isset( $_GET['action'] ) && 'delete' == $_GET['action'] ) {
+ $nav_menu_selected_id = $nav_menus[0]->term_id;
+}
+
+// Set $nav_menu_selected_id to 0 if no menus.
+if ( $one_theme_location_no_menus ) {
+ $nav_menu_selected_id = 0;
+} elseif ( empty( $nav_menu_selected_id ) && ! empty( $nav_menus ) && ! $add_new_screen ) {
+ // if we have no selection yet, and we have menus, set to the first one in the list.
+ $nav_menu_selected_id = $nav_menus[0]->term_id;
+}
+
+// Update the user's setting.
+if ( $nav_menu_selected_id != $recently_edited && is_nav_menu( $nav_menu_selected_id ) ) {
+ update_user_meta( $current_user->ID, 'nav_menu_recently_edited', $nav_menu_selected_id );
+}
+
+// If there's a menu, get its name.
+if ( ! $nav_menu_selected_title && is_nav_menu( $nav_menu_selected_id ) ) {
+ $_menu_object = wp_get_nav_menu_object( $nav_menu_selected_id );
+ $nav_menu_selected_title = ! is_wp_error( $_menu_object ) ? $_menu_object->name : '';
+}
+
+// Generate truncated menu names.
+foreach ( (array) $nav_menus as $key => $_nav_menu ) {
+ $nav_menus[ $key ]->truncated_name = wp_html_excerpt( $_nav_menu->name, 40, '&hellip;' );
+}
+
+// Retrieve menu locations.
+if ( current_theme_supports( 'menus' ) ) {
+ $locations = get_registered_nav_menus();
+ $menu_locations = get_nav_menu_locations();
+}
+
+/*
+ * Ensure the user will be able to scroll horizontally
+ * by adding a class for the max menu depth.
+ *
+ * @global int $_wp_nav_menu_max_depth
+ */
+global $_wp_nav_menu_max_depth;
+$_wp_nav_menu_max_depth = 0;
+
+// Calling wp_get_nav_menu_to_edit generates $_wp_nav_menu_max_depth.
+if ( is_nav_menu( $nav_menu_selected_id ) ) {
+ $menu_items = wp_get_nav_menu_items( $nav_menu_selected_id, array( 'post_status' => 'any' ) );
+ $edit_markup = wp_get_nav_menu_to_edit( $nav_menu_selected_id );
+}
+
+/**
+ * @global int $_wp_nav_menu_max_depth
+ *
+ * @param string $classes
+ * @return string
+ */
+function wp_nav_menu_max_depth( $classes ) {
+ global $_wp_nav_menu_max_depth;
+ return "$classes menu-max-depth-$_wp_nav_menu_max_depth";
+}
+
+add_filter( 'admin_body_class', 'wp_nav_menu_max_depth' );
+
+wp_nav_menu_setup();
+wp_initial_nav_menu_meta_boxes();
+
+if ( ! current_theme_supports( 'menus' ) && ! $num_locations ) {
+ $messages[] = '<div id="message" class="updated"><p>' . sprintf( __( 'Your theme does not natively support menus, but you can use them in sidebars by adding a &#8220;Navigation Menu&#8221; widget on the <a href="%s">Widgets</a> screen.' ), admin_url( 'widgets.php' ) ) . '</p></div>';
+}
+
+if ( ! $locations_screen ) : // Main tab
+ $overview = '<p>' . __( 'This screen is used for managing your navigation menus.' ) . '</p>';
+ /* translators: 1: Widgets admin screen URL, 2 and 3: The name of the default themes */
+ $overview .= '<p>' . sprintf( __( 'Menus can be displayed in locations defined by your theme, even used in sidebars by adding a &#8220;Navigation Menu&#8221; widget on the <a href="%1$s">Widgets</a> screen. If your theme does not support the navigation menus feature (the default themes, %2$s and %3$s, do), you can learn about adding this support by following the Documentation link to the side.' ), admin_url( 'widgets.php' ), 'Twenty Seventeen', 'Twenty Nineteen' ) . '</p>';
+ $overview .= '<p>' . __( 'From this screen you can:' ) . '</p>';
+ $overview .= '<ul><li>' . __( 'Create, edit, and delete menus' ) . '</li>';
+ $overview .= '<li>' . __( 'Add, organize, and modify individual menu items' ) . '</li></ul>';
+
+ get_current_screen()->add_help_tab(
+ array(
+ 'id' => 'overview',
+ 'title' => __( 'Overview' ),
+ 'content' => $overview,
+ )
+ );
+
+ $menu_management = '<p>' . __( 'The menu management box at the top of the screen is used to control which menu is opened in the editor below.' ) . '</p>';
+ $menu_management .= '<ul><li>' . __( 'To edit an existing menu, <strong>choose a menu from the drop down and click Select</strong>' ) . '</li>';
+ $menu_management .= '<li>' . __( 'If you haven&#8217;t yet created any menus, <strong>click the &#8217;create a new menu&#8217; link</strong> to get started' ) . '</li></ul>';
+ $menu_management .= '<p>' . __( 'You can assign theme locations to individual menus by <strong>selecting the desired settings</strong> at the bottom of the menu editor. To assign menus to all theme locations at once, <strong>visit the Manage Locations tab</strong> at the top of the screen.' ) . '</p>';
+
+ get_current_screen()->add_help_tab(
+ array(
+ 'id' => 'menu-management',
+ 'title' => __( 'Menu Management' ),
+ 'content' => $menu_management,
+ )
+ );
+
+ $editing_menus = '<p>' . __( 'Each navigation menu may contain a mix of links to pages, categories, custom URLs or other content types. Menu links are added by selecting items from the expanding boxes in the left-hand column below.' ) . '</p>';
+ $editing_menus .= '<p>' . __( '<strong>Clicking the arrow to the right of any menu item</strong> in the editor will reveal a standard group of settings. Additional settings such as link target, CSS classes, link relationships, and link descriptions can be enabled and disabled via the Screen Options tab.' ) . '</p>';
+ $editing_menus .= '<ul><li>' . __( 'Add one or several items at once by <strong>selecting the checkbox next to each item and clicking Add to Menu</strong>' ) . '</li>';
+ $editing_menus .= '<li>' . __( 'To add a custom link, <strong>expand the Custom Links section, enter a URL and link text, and click Add to Menu</strong>' ) . '</li>';
+ $editing_menus .= '<li>' . __( 'To reorganize menu items, <strong>drag and drop items with your mouse or use your keyboard</strong>. Drag or move a menu item a little to the right to make it a submenu' ) . '</li>';
+ $editing_menus .= '<li>' . __( 'Delete a menu item by <strong>expanding it and clicking the Remove link</strong>' ) . '</li></ul>';
+
+ get_current_screen()->add_help_tab(
+ array(
+ 'id' => 'editing-menus',
+ 'title' => __( 'Editing Menus' ),
+ 'content' => $editing_menus,
+ )
+ );
+else : // Locations Tab.
+ $locations_overview = '<p>' . __( 'This screen is used for globally assigning menus to locations defined by your theme.' ) . '</p>';
+ $locations_overview .= '<ul><li>' . __( 'To assign menus to one or more theme locations, <strong>select a menu from each location&#8217;s drop down.</strong> When you&#8217;re finished, <strong>click Save Changes</strong>' ) . '</li>';
+ $locations_overview .= '<li>' . __( 'To edit a menu currently assigned to a theme location, <strong>click the adjacent &#8217;Edit&#8217; link</strong>' ) . '</li>';
+ $locations_overview .= '<li>' . __( 'To add a new menu instead of assigning an existing one, <strong>click the &#8217;Use new menu&#8217; link</strong>. Your new menu will be automatically assigned to that theme location' ) . '</li></ul>';
+
+ get_current_screen()->add_help_tab(
+ array(
+ 'id' => 'locations-overview',
+ 'title' => __( 'Overview' ),
+ 'content' => $locations_overview,
+ )
+ );
+endif;
+
+get_current_screen()->set_help_sidebar(
+ '<p><strong>' . __( 'For more information:' ) . '</strong></p>' .
+ '<p>' . __( '<a href="https://codex.wordpress.org/Appearance_Menus_Screen">Documentation on Menus</a>' ) . '</p>' .
+ '<p>' . __( '<a href="https://wordpress.org/support/">Support</a>' ) . '</p>'
+);
+
+// Get the admin header.
+require_once( ABSPATH . 'wp-admin/admin-header.php' );
+?>
+<div class="wrap">
+ <h1 class="wp-heading-inline"><?php echo esc_html( __( 'Menus' ) ); ?></h1>
+ <?php
+ if ( current_user_can( 'customize' ) ) :
+ $focus = $locations_screen ? array( 'section' => 'menu_locations' ) : array( 'panel' => 'nav_menus' );
+ printf(
+ ' <a class="page-title-action hide-if-no-customize" href="%1$s">%2$s</a>',
+ esc_url(
+ add_query_arg(
+ array(
+ array( 'autofocus' => $focus ),
+ 'return' => urlencode( remove_query_arg( wp_removable_query_args(), wp_unslash( $_SERVER['REQUEST_URI'] ) ) ),
+ ),
+ admin_url( 'customize.php' )
+ )
+ ),
+ __( 'Manage with Live Preview' )
+ );
+ endif;
+
+ $nav_tab_active_class = '';
+ $nav_aria_current = '';
+ if ( ! isset( $_GET['action'] ) || isset( $_GET['action'] ) && 'locations' != $_GET['action'] ) {
+ $nav_tab_active_class = ' nav-tab-active';
+ $nav_aria_current = ' aria-current="page"';
+ }
+ ?>
+
+ <hr class="wp-header-end">
+
+ <nav class="nav-tab-wrapper wp-clearfix" aria-label="<?php esc_attr_e( 'Secondary menu' ); ?>">
+ <a href="<?php echo admin_url( 'nav-menus.php' ); ?>" class="nav-tab<?php echo $nav_tab_active_class; ?>"<?php echo $nav_aria_current; ?>><?php esc_html_e( 'Edit Menus' ); ?></a>
+ <?php
+ if ( $num_locations && $menu_count ) {
+ $active_tab_class = '';
+ $aria_current = '';
+ if ( $locations_screen ) {
+ $active_tab_class = ' nav-tab-active';
+ $aria_current = ' aria-current="page"';
+ }
+ ?>
+ <a href="<?php echo esc_url( add_query_arg( array( 'action' => 'locations' ), admin_url( 'nav-menus.php' ) ) ); ?>" class="nav-tab<?php echo $active_tab_class; ?>"<?php echo $aria_current; ?>><?php esc_html_e( 'Manage Locations' ); ?></a>
+ <?php
+ }
+ ?>
+ </nav>
+ <?php
+ foreach ( $messages as $message ) :
+ echo $message . "\n";
+ endforeach;
+ ?>
+ <?php
+ if ( $locations_screen ) :
+ if ( 1 == $num_locations ) {
+ echo '<p>' . __( 'Your theme supports one menu. Select which menu you would like to use.' ) . '</p>';
+ } else {
+ echo '<p>' . sprintf( _n( 'Your theme supports %s menu. Select which menu appears in each location.', 'Your theme supports %s menus. Select which menu appears in each location.', $num_locations ), number_format_i18n( $num_locations ) ) . '</p>';
+ }
+ ?>
+ <div id="menu-locations-wrap">
+ <form method="post" action="<?php echo esc_url( add_query_arg( array( 'action' => 'locations' ), admin_url( 'nav-menus.php' ) ) ); ?>">
+ <table class="widefat fixed" id="menu-locations-table">
+ <thead>
+ <tr>
+ <th scope="col" class="manage-column column-locations"><?php _e( 'Theme Location' ); ?></th>
+ <th scope="col" class="manage-column column-menus"><?php _e( 'Assigned Menu' ); ?></th>
+ </tr>
+ </thead>
+ <tbody class="menu-locations">
+ <?php foreach ( $locations as $_location => $_name ) { ?>
+ <tr class="menu-locations-row">
+ <td class="menu-location-title"><label for="locations-<?php echo $_location; ?>"><?php echo $_name; ?></label></td>
+ <td class="menu-location-menus">
+ <select name="menu-locations[<?php echo $_location; ?>]" id="locations-<?php echo $_location; ?>">
+ <option value="0"><?php printf( '&mdash; %s &mdash;', esc_html__( 'Select a Menu' ) ); ?></option>
+ <?php
+ foreach ( $nav_menus as $menu ) :
+ $data_orig = '';
+ $selected = isset( $menu_locations[ $_location ] ) && $menu_locations[ $_location ] == $menu->term_id;
+ if ( $selected ) {
+ $data_orig = 'data-orig="true"';
+ }
+ ?>
+ <option <?php echo $data_orig; ?> <?php selected( $selected ); ?> value="<?php echo $menu->term_id; ?>">
+ <?php echo wp_html_excerpt( $menu->name, 40, '&hellip;' ); ?>
+ </option>
+ <?php endforeach; ?>
+ </select>
+ <div class="locations-row-links">
+ <?php if ( isset( $menu_locations[ $_location ] ) && 0 != $menu_locations[ $_location ] ) : ?>
+ <span class="locations-edit-menu-link">
+ <a href="
+ <?php
+ echo esc_url(
+ add_query_arg(
+ array(
+ 'action' => 'edit',
+ 'menu' => $menu_locations[ $_location ],
+ ),
+ admin_url( 'nav-menus.php' )
+ )
+ );
+ ?>
+ ">
+ <span aria-hidden="true"><?php _ex( 'Edit', 'menu' ); ?></span><span class="screen-reader-text"><?php _e( 'Edit selected menu' ); ?></span>
+ </a>
+ </span>
+ <?php endif; ?>
+ <span class="locations-add-menu-link">
+ <a href="
+ <?php
+ echo esc_url(
+ add_query_arg(
+ array(
+ 'action' => 'edit',
+ 'menu' => 0,
+ 'use-location' => $_location,
+ ),
+ admin_url( 'nav-menus.php' )
+ )
+ );
+ ?>
+ ">
+ <?php _ex( 'Use new menu', 'menu' ); ?>
+ </a>
+ </span>
+ </div><!-- .locations-row-links -->
+ </td><!-- .menu-location-menus -->
+ </tr><!-- .menu-locations-row -->
+ <?php } // foreach ?>
+ </tbody>
+ </table>
+ <p class="button-controls wp-clearfix"><?php submit_button( __( 'Save Changes' ), 'primary left', 'nav-menu-locations', false ); ?></p>
+ <?php wp_nonce_field( 'save-menu-locations' ); ?>
+ <input type="hidden" name="menu" id="nav-menu-meta-object-id" value="<?php echo esc_attr( $nav_menu_selected_id ); ?>" />
+ </form>
+ </div><!-- #menu-locations-wrap -->
+ <?php
+ /**
+ * Fires after the menu locations table is displayed.
+ *
+ * @since 3.6.0
+ */
+ do_action( 'after_menu_locations_table' );
+ ?>
+ <?php else : ?>
+ <div class="manage-menus">
+ <?php if ( $menu_count < 1 ) : ?>
+ <span class="first-menu-message">
+ <?php _e( 'Create your first menu below.' ); ?>
+ <span class="screen-reader-text"><?php _e( 'Fill in the Menu Name and click the Create Menu button to create your first menu.' ); ?></span>
+ </span><!-- /first-menu-message -->
+ <?php elseif ( $menu_count < 2 ) : ?>
+ <span class="add-edit-menu-action">
+ <?php
+ printf(
+ __( 'Edit your menu below, or <a href="%s">create a new menu</a>. Don&#8217;t forget to save your changes!' ),
+ esc_url(
+ add_query_arg(
+ array(
+ 'action' => 'edit',
+ 'menu' => 0,
+ ),
+ admin_url( 'nav-menus.php' )
+ )
+ )
+ );
+ ?>
+ <span class="screen-reader-text"><?php _e( 'Click the Save Menu button to save your changes.' ); ?></span>
+ </span><!-- /add-edit-menu-action -->
+ <?php else : ?>
+ <form method="get" action="<?php echo admin_url( 'nav-menus.php' ); ?>">
+ <input type="hidden" name="action" value="edit" />
+ <label for="select-menu-to-edit" class="selected-menu"><?php _e( 'Select a menu to edit:' ); ?></label>
+ <select name="menu" id="select-menu-to-edit">
+ <?php if ( $add_new_screen ) : ?>
+ <option value="0" selected="selected"><?php _e( '&mdash; Select &mdash;' ); ?></option>
+ <?php endif; ?>
+ <?php foreach ( (array) $nav_menus as $_nav_menu ) : ?>
+ <option value="<?php echo esc_attr( $_nav_menu->term_id ); ?>" <?php selected( $_nav_menu->term_id, $nav_menu_selected_id ); ?>>
+ <?php
+ echo esc_html( $_nav_menu->truncated_name );
+
+ if ( ! empty( $menu_locations ) && in_array( $_nav_menu->term_id, $menu_locations ) ) {
+ $locations_assigned_to_this_menu = array();
+ foreach ( array_keys( $menu_locations, $_nav_menu->term_id ) as $menu_location_key ) {
+ if ( isset( $locations[ $menu_location_key ] ) ) {
+ $locations_assigned_to_this_menu[] = $locations[ $menu_location_key ];
+ }
+ }
+
+ /**
+ * Filters the number of locations listed per menu in the drop-down select.
+ *
+ * @since 3.6.0
+ *
+ * @param int $locations Number of menu locations to list. Default 3.
+ */
+ $assigned_locations = array_slice( $locations_assigned_to_this_menu, 0, absint( apply_filters( 'wp_nav_locations_listed_per_menu', 3 ) ) );
+
+ // Adds ellipses following the number of locations defined in $assigned_locations.
+ if ( ! empty( $assigned_locations ) ) {
+ printf(
+ ' (%1$s%2$s)',
+ implode( ', ', $assigned_locations ),
+ count( $locations_assigned_to_this_menu ) > count( $assigned_locations ) ? ' &hellip;' : ''
+ );
+ }
+ }
+ ?>
+ </option>
+ <?php endforeach; ?>
+ </select>
+ <span class="submit-btn"><input type="submit" class="button" value="<?php esc_attr_e( 'Select' ); ?>"></span>
+ <span class="add-new-menu-action">
+ <?php
+ printf(
+ __( 'or <a href="%s">create a new menu</a>. Don&#8217;t forget to save your changes!' ),
+ esc_url(
+ add_query_arg(
+ array(
+ 'action' => 'edit',
+ 'menu' => 0,
+ ),
+ admin_url( 'nav-menus.php' )
+ )
+ )
+ );
+ ?>
+ <span class="screen-reader-text"><?php _e( 'Click the Save Menu button to save your changes.' ); ?></span>
+ </span><!-- /add-new-menu-action -->
+ </form>
+ <?php
+ endif;
+
+ $metabox_holder_disabled_class = '';
+ if ( isset( $_GET['menu'] ) && '0' == $_GET['menu'] ) {
+ $metabox_holder_disabled_class = ' metabox-holder-disabled';
+ }
+ ?>
+ </div><!-- /manage-menus -->
+ <div id="nav-menus-frame" class="wp-clearfix">
+ <div id="menu-settings-column" class="metabox-holder<?php echo $metabox_holder_disabled_class; ?>">
+
+ <div class="clear"></div>
+
+ <form id="nav-menu-meta" class="nav-menu-meta" method="post" enctype="multipart/form-data">
+ <input type="hidden" name="menu" id="nav-menu-meta-object-id" value="<?php echo esc_attr( $nav_menu_selected_id ); ?>" />
+ <input type="hidden" name="action" value="add-menu-item" />
+ <?php wp_nonce_field( 'add-menu_item', 'menu-settings-column-nonce' ); ?>
+ <h2><?php _e( 'Add menu items' ); ?></h2>
+ <?php do_accordion_sections( 'nav-menus', 'side', null ); ?>
+ </form>
+
+ </div><!-- /#menu-settings-column -->
+ <div id="menu-management-liquid">
+ <div id="menu-management">
+ <form id="update-nav-menu" method="post" enctype="multipart/form-data">
+ <?php
+ $new_screen_class = '';
+ if ( $add_new_screen ) {
+ $new_screen_class = 'blank-slate';
+ }
+ ?>
+ <h2><?php _e( 'Menu structure' ); ?></h2>
+ <div class="menu-edit <?php echo $new_screen_class; ?>">
+ <input type="hidden" name="nav-menu-data">
+ <?php
+ wp_nonce_field( 'closedpostboxes', 'closedpostboxesnonce', false );
+ wp_nonce_field( 'meta-box-order', 'meta-box-order-nonce', false );
+ wp_nonce_field( 'update-nav_menu', 'update-nav-menu-nonce' );
+
+ $menu_name_aria_desc = $add_new_screen ? ' aria-describedby="menu-name-desc"' : '';
+
+ if ( $one_theme_location_no_menus ) {
+ $menu_name_val = 'value="' . esc_attr( 'Menu 1' ) . '"';
+ ?>
+ <input type="hidden" name="zero-menu-state" value="true" />
+ <?php
+ } else {
+ $menu_name_val = 'value="' . esc_attr( $nav_menu_selected_title ) . '"';
+ }
+ ?>
+ <input type="hidden" name="action" value="update" />
+ <input type="hidden" name="menu" id="menu" value="<?php echo esc_attr( $nav_menu_selected_id ); ?>" />
+ <div id="nav-menu-header">
+ <div class="major-publishing-actions wp-clearfix">
+ <label class="menu-name-label" for="menu-name"><?php _e( 'Menu Name' ); ?></label>
+ <input name="menu-name" id="menu-name" type="text" class="menu-name regular-text menu-item-textbox" <?php echo $menu_name_val . $menu_name_aria_desc; ?> />
+ <div class="publishing-action">
+ <?php submit_button( empty( $nav_menu_selected_id ) ? __( 'Create Menu' ) : __( 'Save Menu' ), 'primary large menu-save', 'save_menu', false, array( 'id' => 'save_menu_header' ) ); ?>
+ </div><!-- END .publishing-action -->
+ </div><!-- END .major-publishing-actions -->
+ </div><!-- END .nav-menu-header -->
+ <div id="post-body">
+ <div id="post-body-content" class="wp-clearfix">
+ <?php if ( ! $add_new_screen ) : ?>
+ <?php
+ $hide_style = '';
+ if ( isset( $menu_items ) && 0 == count( $menu_items ) ) {
+ $hide_style = 'style="display: none;"';
+ }
+ $starter_copy = ( $one_theme_location_no_menus ) ? __( 'Edit your default menu by adding or removing items. Drag each item into the order you prefer. Click Create Menu to save your changes.' ) : __( 'Drag each item into the order you prefer. Click the arrow on the right of the item to reveal additional configuration options.' );
+ ?>
+ <div class="drag-instructions post-body-plain" <?php echo $hide_style; ?>>
+ <p><?php echo $starter_copy; ?></p>
+ </div>
+ <?php
+ if ( isset( $edit_markup ) && ! is_wp_error( $edit_markup ) ) {
+ echo $edit_markup;
+ } else {
+ ?>
+ <ul class="menu" id="menu-to-edit"></ul>
+ <?php } ?>
+ <?php endif; ?>
+ <?php if ( $add_new_screen ) : ?>
+ <p class="post-body-plain" id="menu-name-desc"><?php _e( 'Give your menu a name, then click Create Menu.' ); ?></p>
+ <?php if ( isset( $_GET['use-location'] ) ) : ?>
+ <input type="hidden" name="use-location" value="<?php echo esc_attr( $_GET['use-location'] ); ?>" />
+ <?php endif; ?>
+ <?php
+ endif;
+
+ $no_menus_style = '';
+ if ( $one_theme_location_no_menus ) {
+ $no_menus_style = 'style="display: none;"';
+ }
+ ?>
+ <div class="menu-settings" <?php echo $no_menus_style; ?>>
+ <h3><?php _e( 'Menu Settings' ); ?></h3>
+ <?php
+ if ( ! isset( $auto_add ) ) {
+ $auto_add = get_option( 'nav_menu_options' );
+ if ( ! isset( $auto_add['auto_add'] ) ) {
+ $auto_add = false;
+ } elseif ( false !== array_search( $nav_menu_selected_id, $auto_add['auto_add'] ) ) {
+ $auto_add = true;
+ } else {
+ $auto_add = false;
+ }
+ }
+ ?>
+
+ <fieldset class="menu-settings-group auto-add-pages">
+ <legend class="menu-settings-group-name howto"><?php _e( 'Auto add pages' ); ?></legend>
+ <div class="menu-settings-input checkbox-input">
+ <input type="checkbox"<?php checked( $auto_add ); ?> name="auto-add-pages" id="auto-add-pages" value="1" /> <label for="auto-add-pages"><?php printf( __( 'Automatically add new top-level pages to this menu' ), esc_url( admin_url( 'edit.php?post_type=page' ) ) ); ?></label>
+ </div>
+ </fieldset>
+
+ <?php if ( current_theme_supports( 'menus' ) ) : ?>
+
+ <fieldset class="menu-settings-group menu-theme-locations">
+ <legend class="menu-settings-group-name howto"><?php _e( 'Display location' ); ?></legend>
+ <?php foreach ( $locations as $location => $description ) : ?>
+ <div class="menu-settings-input checkbox-input">
+ <input type="checkbox"<?php checked( isset( $menu_locations[ $location ] ) && $menu_locations[ $location ] == $nav_menu_selected_id ); ?> name="menu-locations[<?php echo esc_attr( $location ); ?>]" id="locations-<?php echo esc_attr( $location ); ?>" value="<?php echo esc_attr( $nav_menu_selected_id ); ?>" />
+ <label for="locations-<?php echo esc_attr( $location ); ?>"><?php echo $description; ?></label>
+ <?php if ( ! empty( $menu_locations[ $location ] ) && $menu_locations[ $location ] != $nav_menu_selected_id ) : ?>
+ <span class="theme-location-set">
+ <?php
+ printf(
+ /* translators: %s: menu name */
+ _x( '(Currently set to: %s)', 'menu location' ),
+ wp_get_nav_menu_object( $menu_locations[ $location ] )->name
+ );
+ ?>
+ </span>
+ <?php endif; ?>
+ </div>
+ <?php endforeach; ?>
+ </fieldset>
+
+ <?php endif; ?>
+
+ </div>
+ </div><!-- /#post-body-content -->
+ </div><!-- /#post-body -->
+ <div id="nav-menu-footer">
+ <div class="major-publishing-actions wp-clearfix">
+ <?php if ( 0 != $menu_count && ! $add_new_screen ) : ?>
+ <span class="delete-action">
+ <a class="submitdelete deletion menu-delete" href="
+ <?php
+ echo esc_url(
+ wp_nonce_url(
+ add_query_arg(
+ array(
+ 'action' => 'delete',
+ 'menu' => $nav_menu_selected_id,
+ ),
+ admin_url( 'nav-menus.php' )
+ ),
+ 'delete-nav_menu-' . $nav_menu_selected_id
+ )
+ );
+ ?>
+ "><?php _e( 'Delete Menu' ); ?></a>
+ </span><!-- END .delete-action -->
+ <?php endif; ?>
+ <div class="publishing-action">
+ <?php submit_button( empty( $nav_menu_selected_id ) ? __( 'Create Menu' ) : __( 'Save Menu' ), 'primary large menu-save', 'save_menu', false, array( 'id' => 'save_menu_footer' ) ); ?>
+ </div><!-- END .publishing-action -->
+ </div><!-- END .major-publishing-actions -->
+ </div><!-- /#nav-menu-footer -->
+ </div><!-- /.menu-edit -->
+ </form><!-- /#update-nav-menu -->
+ </div><!-- /#menu-management -->
+ </div><!-- /#menu-management-liquid -->
+ </div><!-- /#nav-menus-frame -->
+ <?php endif; ?>
+</div><!-- /.wrap-->
+<?php include( ABSPATH . 'wp-admin/admin-footer.php' ); ?>
diff --git a/www/crm/wp-admin/network.php b/www/crm/wp-admin/network.php
new file mode 100644
index 00000000..928be2d8
--- /dev/null
+++ b/www/crm/wp-admin/network.php
@@ -0,0 +1,121 @@
+<?php
+/**
+ * Network installation administration panel.
+ *
+ * A multi-step process allowing the user to enable a network of WordPress sites.
+ *
+ * @since 3.0.0
+ *
+ * @package WordPress
+ * @subpackage Administration
+ */
+
+define( 'WP_INSTALLING_NETWORK', true );
+
+/** WordPress Administration Bootstrap */
+require_once( dirname( __FILE__ ) . '/admin.php' );
+
+if ( ! current_user_can( 'setup_network' ) ) {
+ wp_die( __( 'Sorry, you are not allowed to manage options for this site.' ) );
+}
+
+if ( is_multisite() ) {
+ if ( ! is_network_admin() ) {
+ wp_redirect( network_admin_url( 'setup.php' ) );
+ exit;
+ }
+
+ if ( ! defined( 'MULTISITE' ) ) {
+ wp_die( __( 'The Network creation panel is not for WordPress MU networks.' ) );
+ }
+}
+
+require_once( dirname( __FILE__ ) . '/includes/network.php' );
+
+// We need to create references to ms global tables to enable Network.
+foreach ( $wpdb->tables( 'ms_global' ) as $table => $prefixed_table ) {
+ $wpdb->$table = $prefixed_table;
+}
+
+if ( ! network_domain_check() && ( ! defined( 'WP_ALLOW_MULTISITE' ) || ! WP_ALLOW_MULTISITE ) ) {
+ wp_die(
+ printf(
+ /* translators: 1: WP_ALLOW_MULTISITE 2: wp-config.php */
+ __( 'You must define the %1$s constant as true in your %2$s file to allow creation of a Network.' ),
+ '<code>WP_ALLOW_MULTISITE</code>',
+ '<code>wp-config.php</code>'
+ )
+ );
+}
+
+if ( is_network_admin() ) {
+ $title = __( 'Network Setup' );
+ $parent_file = 'settings.php';
+} else {
+ $title = __( 'Create a Network of WordPress Sites' );
+ $parent_file = 'tools.php';
+}
+
+$network_help = '<p>' . __( 'This screen allows you to configure a network as having subdomains (<code>site1.example.com</code>) or subdirectories (<code>example.com/site1</code>). Subdomains require wildcard subdomains to be enabled in Apache and DNS records, if your host allows it.' ) . '</p>' .
+ '<p>' . __( 'Choose subdomains or subdirectories; this can only be switched afterwards by reconfiguring your installation. Fill out the network details, and click Install. If this does not work, you may have to add a wildcard DNS record (for subdomains) or change to another setting in Permalinks (for subdirectories).' ) . '</p>' .
+ '<p>' . __( 'The next screen for Network Setup will give you individually-generated lines of code to add to your wp-config.php and .htaccess files. Make sure the settings of your FTP client make files starting with a dot visible, so that you can find .htaccess; you may have to create this file if it really is not there. Make backup copies of those two files.' ) . '</p>' .
+ '<p>' . __( 'Add the designated lines of code to wp-config.php (just before <code>/*...stop editing...*/</code>) and <code>.htaccess</code> (replacing the existing WordPress rules).' ) . '</p>' .
+ '<p>' . __( 'Once you add this code and refresh your browser, multisite should be enabled. This screen, now in the Network Admin navigation menu, will keep an archive of the added code. You can toggle between Network Admin and Site Admin by clicking on the Network Admin or an individual site name under the My Sites dropdown in the Toolbar.' ) . '</p>' .
+ '<p>' . __( 'The choice of subdirectory sites is disabled if this setup is more than a month old because of permalink problems with &#8220;/blog/&#8221; from the main site. This disabling will be addressed in a future version.' ) . '</p>' .
+ '<p><strong>' . __( 'For more information:' ) . '</strong></p>' .
+ '<p>' . __( '<a href="https://codex.wordpress.org/Create_A_Network">Documentation on Creating a Network</a>' ) . '</p>' .
+ '<p>' . __( '<a href="https://codex.wordpress.org/Tools_Network_Screen">Documentation on the Network Screen</a>' ) . '</p>';
+
+get_current_screen()->add_help_tab(
+ array(
+ 'id' => 'network',
+ 'title' => __( 'Network' ),
+ 'content' => $network_help,
+ )
+);
+
+get_current_screen()->set_help_sidebar(
+ '<p><strong>' . __( 'For more information:' ) . '</strong></p>' .
+ '<p>' . __( '<a href="https://codex.wordpress.org/Create_A_Network">Documentation on Creating a Network</a>' ) . '</p>' .
+ '<p>' . __( '<a href="https://codex.wordpress.org/Tools_Network_Screen">Documentation on the Network Screen</a>' ) . '</p>' .
+ '<p>' . __( '<a href="https://wordpress.org/support/">Support</a>' ) . '</p>'
+);
+
+include( ABSPATH . 'wp-admin/admin-header.php' );
+?>
+<div class="wrap">
+<h1><?php echo esc_html( $title ); ?></h1>
+
+<?php
+if ( $_POST ) {
+
+ check_admin_referer( 'install-network-1' );
+
+ require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
+ // Create network tables.
+ install_network();
+ $base = parse_url( trailingslashit( get_option( 'home' ) ), PHP_URL_PATH );
+ $subdomain_install = allow_subdomain_install() ? ! empty( $_POST['subdomain_install'] ) : false;
+ if ( ! network_domain_check() ) {
+ $result = populate_network( 1, get_clean_basedomain(), sanitize_email( $_POST['email'] ), wp_unslash( $_POST['sitename'] ), $base, $subdomain_install );
+ if ( is_wp_error( $result ) ) {
+ if ( 1 == count( $result->get_error_codes() ) && 'no_wildcard_dns' == $result->get_error_code() ) {
+ network_step2( $result );
+ } else {
+ network_step1( $result );
+ }
+ } else {
+ network_step2();
+ }
+ } else {
+ network_step2();
+ }
+} elseif ( is_multisite() || network_domain_check() ) {
+ network_step2();
+} else {
+ network_step1();
+}
+?>
+</div>
+
+<?php include( ABSPATH . 'wp-admin/admin-footer.php' ); ?>
diff --git a/www/crm/wp-admin/network/about.php b/www/crm/wp-admin/network/about.php
new file mode 100644
index 00000000..829fa1be
--- /dev/null
+++ b/www/crm/wp-admin/network/about.php
@@ -0,0 +1,13 @@
+<?php
+/**
+ * Network About administration panel.
+ *
+ * @package WordPress
+ * @subpackage Multisite
+ * @since 3.4.0
+ */
+
+/** Load WordPress Administration Bootstrap */
+require_once( dirname( __FILE__ ) . '/admin.php' );
+
+require( ABSPATH . 'wp-admin/about.php' );
diff --git a/www/crm/wp-admin/network/admin.php b/www/crm/wp-admin/network/admin.php
new file mode 100644
index 00000000..693fa5aa
--- /dev/null
+++ b/www/crm/wp-admin/network/admin.php
@@ -0,0 +1,34 @@
+<?php
+/**
+ * WordPress Network Administration Bootstrap
+ *
+ * @package WordPress
+ * @subpackage Multisite
+ * @since 3.1.0
+ */
+
+define( 'WP_NETWORK_ADMIN', true );
+
+/** Load WordPress Administration Bootstrap */
+require_once( dirname( dirname( __FILE__ ) ) . '/admin.php' );
+
+// Do not remove this check. It is required by individual network admin pages.
+if ( ! is_multisite() ) {
+ wp_die( __( 'Multisite support is not enabled.' ) );
+}
+
+$redirect_network_admin_request = 0 !== strcasecmp( $current_blog->domain, $current_site->domain ) || 0 !== strcasecmp( $current_blog->path, $current_site->path );
+
+/**
+ * Filters whether to redirect the request to the Network Admin.
+ *
+ * @since 3.2.0
+ *
+ * @param bool $redirect_network_admin_request Whether the request should be redirected.
+ */
+$redirect_network_admin_request = apply_filters( 'redirect_network_admin_request', $redirect_network_admin_request );
+if ( $redirect_network_admin_request ) {
+ wp_redirect( network_admin_url() );
+ exit;
+}
+unset( $redirect_network_admin_request );
diff --git a/www/crm/wp-admin/network/credits.php b/www/crm/wp-admin/network/credits.php
new file mode 100644
index 00000000..75ee6e73
--- /dev/null
+++ b/www/crm/wp-admin/network/credits.php
@@ -0,0 +1,13 @@
+<?php
+/**
+ * Network Credits administration panel.
+ *
+ * @package WordPress
+ * @subpackage Multisite
+ * @since 3.4.0
+ */
+
+/** Load WordPress Administration Bootstrap */
+require_once( dirname( __FILE__ ) . '/admin.php' );
+
+require( ABSPATH . 'wp-admin/credits.php' );
diff --git a/www/crm/wp-admin/network/edit.php b/www/crm/wp-admin/network/edit.php
new file mode 100644
index 00000000..51381e40
--- /dev/null
+++ b/www/crm/wp-admin/network/edit.php
@@ -0,0 +1,41 @@
+<?php
+/**
+ * Action handler for Multisite administration panels.
+ *
+ * @package WordPress
+ * @subpackage Multisite
+ * @since 3.0.0
+ */
+
+/** Load WordPress Administration Bootstrap */
+require_once( dirname( __FILE__ ) . '/admin.php' );
+
+$action = ( isset( $_GET['action'] ) ) ? $_GET['action'] : '';
+
+if ( empty( $action ) ) {
+ wp_redirect( network_admin_url() );
+ exit;
+}
+
+/**
+ * Fires just before the action handler in several Network Admin screens.
+ *
+ * This hook fires on multiple screens in the Multisite Network Admin,
+ * including Users, Network Settings, and Site Settings.
+ *
+ * @since 3.0.0
+ */
+do_action( 'wpmuadminedit' );
+
+/**
+ * Fires the requested handler action.
+ *
+ * The dynamic portion of the hook name, `$action`, refers to the name
+ * of the requested action derived from the `GET` request.
+ *
+ * @since 3.1.0
+ */
+do_action( "network_admin_edit_{$action}" );
+
+wp_redirect( network_admin_url() );
+exit();
diff --git a/www/crm/wp-admin/network/freedoms.php b/www/crm/wp-admin/network/freedoms.php
new file mode 100644
index 00000000..9afbe82f
--- /dev/null
+++ b/www/crm/wp-admin/network/freedoms.php
@@ -0,0 +1,13 @@
+<?php
+/**
+ * Network Freedoms administration panel.
+ *
+ * @package WordPress
+ * @subpackage Multisite
+ * @since 3.4.0
+ */
+
+/** Load WordPress Administration Bootstrap */
+require_once( dirname( __FILE__ ) . '/admin.php' );
+
+require( ABSPATH . 'wp-admin/freedoms.php' );
diff --git a/www/crm/wp-admin/network/index.php b/www/crm/wp-admin/network/index.php
new file mode 100644
index 00000000..829a7eb7
--- /dev/null
+++ b/www/crm/wp-admin/network/index.php
@@ -0,0 +1,83 @@
+<?php
+/**
+ * Multisite administration panel.
+ *
+ * @package WordPress
+ * @subpackage Multisite
+ * @since 3.0.0
+ */
+
+/** Load WordPress Administration Bootstrap */
+require_once( dirname( __FILE__ ) . '/admin.php' );
+
+/** Load WordPress dashboard API */
+require_once( ABSPATH . 'wp-admin/includes/dashboard.php' );
+
+if ( ! current_user_can( 'manage_network' ) ) {
+ wp_die( __( 'Sorry, you are not allowed to access this page.' ), 403 );
+}
+
+$title = __( 'Dashboard' );
+$parent_file = 'index.php';
+
+$overview = '<p>' . __( 'Welcome to your Network Admin. This area of the Administration Screens is used for managing all aspects of your Multisite Network.' ) . '</p>';
+$overview .= '<p>' . __( 'From here you can:' ) . '</p>';
+$overview .= '<ul><li>' . __( 'Add and manage sites or users' ) . '</li>';
+$overview .= '<li>' . __( 'Install and activate themes or plugins' ) . '</li>';
+$overview .= '<li>' . __( 'Update your network' ) . '</li>';
+$overview .= '<li>' . __( 'Modify global network settings' ) . '</li></ul>';
+
+get_current_screen()->add_help_tab(
+ array(
+ 'id' => 'overview',
+ 'title' => __( 'Overview' ),
+ 'content' => $overview,
+ )
+);
+
+$quick_tasks = '<p>' . __( 'The Right Now widget on this screen provides current user and site counts on your network.' ) . '</p>';
+$quick_tasks .= '<ul><li>' . __( 'To add a new user, <strong>click Create a New User</strong>.' ) . '</li>';
+$quick_tasks .= '<li>' . __( 'To add a new site, <strong>click Create a New Site</strong>.' ) . '</li></ul>';
+$quick_tasks .= '<p>' . __( 'To search for a user or site, use the search boxes.' ) . '</p>';
+$quick_tasks .= '<ul><li>' . __( 'To search for a user, <strong>enter an email address or username</strong>. Use a wildcard to search for a partial username, such as user&#42;.' ) . '</li>';
+$quick_tasks .= '<li>' . __( 'To search for a site, <strong>enter the path or domain</strong>.' ) . '</li></ul>';
+
+get_current_screen()->add_help_tab(
+ array(
+ 'id' => 'quick-tasks',
+ 'title' => __( 'Quick Tasks' ),
+ 'content' => $quick_tasks,
+ )
+);
+
+get_current_screen()->set_help_sidebar(
+ '<p><strong>' . __( 'For more information:' ) . '</strong></p>' .
+ '<p>' . __( '<a href="https://codex.wordpress.org/Network_Admin">Documentation on the Network Admin</a>' ) . '</p>' .
+ '<p>' . __( '<a href="https://wordpress.org/support/forum/multisite/">Support Forums</a>' ) . '</p>'
+);
+
+wp_dashboard_setup();
+
+wp_enqueue_script( 'dashboard' );
+wp_enqueue_script( 'plugin-install' );
+add_thickbox();
+
+require_once( ABSPATH . 'wp-admin/admin-header.php' );
+
+?>
+
+<div class="wrap">
+<h1><?php echo esc_html( $title ); ?></h1>
+
+<div id="dashboard-widgets-wrap">
+
+<?php wp_dashboard(); ?>
+
+<div class="clear"></div>
+</div><!-- dashboard-widgets-wrap -->
+
+</div><!-- wrap -->
+
+<?php
+wp_print_community_events_templates();
+include( ABSPATH . 'wp-admin/admin-footer.php' );
diff --git a/www/crm/wp-admin/network/menu.php b/www/crm/wp-admin/network/menu.php
new file mode 100644
index 00000000..dbd77fd7
--- /dev/null
+++ b/www/crm/wp-admin/network/menu.php
@@ -0,0 +1,74 @@
+<?php
+/**
+ * Build Network Administration Menu.
+ *
+ * @package WordPress
+ * @subpackage Multisite
+ * @since 3.1.0
+ */
+
+/* translators: Network menu item */
+$menu[2] = array( __( 'Dashboard' ), 'manage_network', 'index.php', '', 'menu-top menu-top-first menu-icon-dashboard', 'menu-dashboard', 'dashicons-dashboard' );
+
+$submenu['index.php'][0] = array( __( 'Home' ), 'read', 'index.php' );
+
+if ( current_user_can( 'update_core' ) ) {
+ $cap = 'update_core';
+} elseif ( current_user_can( 'update_plugins' ) ) {
+ $cap = 'update_plugins';
+} elseif ( current_user_can( 'update_themes' ) ) {
+ $cap = 'update_themes';
+} else {
+ $cap = 'update_languages';
+}
+
+$update_data = wp_get_update_data();
+if ( $update_data['counts']['total'] ) {
+ $submenu['index.php'][10] = array( sprintf( __( 'Updates %s' ), "<span class='update-plugins count-{$update_data['counts']['total']}'><span class='update-count'>" . number_format_i18n( $update_data['counts']['total'] ) . '</span></span>' ), $cap, 'update-core.php' );
+} else {
+ $submenu['index.php'][10] = array( __( 'Updates' ), $cap, 'update-core.php' );
+}
+
+unset( $cap );
+
+$submenu['index.php'][15] = array( __( 'Upgrade Network' ), 'upgrade_network', 'upgrade.php' );
+
+$menu[4] = array( '', 'read', 'separator1', '', 'wp-menu-separator' );
+
+/* translators: Sites menu item */
+$menu[5] = array( __( 'Sites' ), 'manage_sites', 'sites.php', '', 'menu-top menu-icon-site', 'menu-site', 'dashicons-admin-multisite' );
+$submenu['sites.php'][5] = array( __( 'All Sites' ), 'manage_sites', 'sites.php' );
+$submenu['sites.php'][10] = array( _x( 'Add New', 'site' ), 'create_sites', 'site-new.php' );
+
+$menu[10] = array( __( 'Users' ), 'manage_network_users', 'users.php', '', 'menu-top menu-icon-users', 'menu-users', 'dashicons-admin-users' );
+$submenu['users.php'][5] = array( __( 'All Users' ), 'manage_network_users', 'users.php' );
+$submenu['users.php'][10] = array( _x( 'Add New', 'user' ), 'create_users', 'user-new.php' );
+
+if ( current_user_can( 'update_themes' ) && $update_data['counts']['themes'] ) {
+ $menu[15] = array( sprintf( __( 'Themes %s' ), "<span class='update-plugins count-{$update_data['counts']['themes']}'><span class='theme-count'>" . number_format_i18n( $update_data['counts']['themes'] ) . '</span></span>' ), 'manage_network_themes', 'themes.php', '', 'menu-top menu-icon-appearance', 'menu-appearance', 'dashicons-admin-appearance' );
+} else {
+ $menu[15] = array( __( 'Themes' ), 'manage_network_themes', 'themes.php', '', 'menu-top menu-icon-appearance', 'menu-appearance', 'dashicons-admin-appearance' );
+}
+$submenu['themes.php'][5] = array( __( 'Installed Themes' ), 'manage_network_themes', 'themes.php' );
+$submenu['themes.php'][10] = array( _x( 'Add New', 'theme' ), 'install_themes', 'theme-install.php' );
+$submenu['themes.php'][15] = array( __( 'Theme Editor' ), 'edit_themes', 'theme-editor.php' );
+
+if ( current_user_can( 'update_plugins' ) && $update_data['counts']['plugins'] ) {
+ $menu[20] = array( sprintf( __( 'Plugins %s' ), "<span class='update-plugins count-{$update_data['counts']['plugins']}'><span class='plugin-count'>" . number_format_i18n( $update_data['counts']['plugins'] ) . '</span></span>' ), 'manage_network_plugins', 'plugins.php', '', 'menu-top menu-icon-plugins', 'menu-plugins', 'dashicons-admin-plugins' );
+} else {
+ $menu[20] = array( __( 'Plugins' ), 'manage_network_plugins', 'plugins.php', '', 'menu-top menu-icon-plugins', 'menu-plugins', 'dashicons-admin-plugins' );
+}
+$submenu['plugins.php'][5] = array( __( 'Installed Plugins' ), 'manage_network_plugins', 'plugins.php' );
+$submenu['plugins.php'][10] = array( _x( 'Add New', 'plugin' ), 'install_plugins', 'plugin-install.php' );
+$submenu['plugins.php'][15] = array( __( 'Plugin Editor' ), 'edit_plugins', 'plugin-editor.php' );
+
+$menu[25] = array( __( 'Settings' ), 'manage_network_options', 'settings.php', '', 'menu-top menu-icon-settings', 'menu-settings', 'dashicons-admin-settings' );
+if ( defined( 'MULTISITE' ) && defined( 'WP_ALLOW_MULTISITE' ) && WP_ALLOW_MULTISITE ) {
+ $submenu['settings.php'][5] = array( __( 'Network Settings' ), 'manage_network_options', 'settings.php' );
+ $submenu['settings.php'][10] = array( __( 'Network Setup' ), 'setup_network', 'setup.php' );
+}
+unset( $update_data );
+
+$menu[99] = array( '', 'exist', 'separator-last', '', 'wp-menu-separator' );
+
+require_once( ABSPATH . 'wp-admin/includes/menu.php' );
diff --git a/www/crm/wp-admin/network/plugin-editor.php b/www/crm/wp-admin/network/plugin-editor.php
new file mode 100644
index 00000000..7171e725
--- /dev/null
+++ b/www/crm/wp-admin/network/plugin-editor.php
@@ -0,0 +1,13 @@
+<?php
+/**
+ * Plugin editor network administration panel.
+ *
+ * @package WordPress
+ * @subpackage Multisite
+ * @since 3.1.0
+ */
+
+/** Load WordPress Administration Bootstrap */
+require_once( dirname( __FILE__ ) . '/admin.php' );
+
+require( ABSPATH . 'wp-admin/plugin-editor.php' );
diff --git a/www/crm/wp-admin/network/plugin-install.php b/www/crm/wp-admin/network/plugin-install.php
new file mode 100644
index 00000000..f771f63a
--- /dev/null
+++ b/www/crm/wp-admin/network/plugin-install.php
@@ -0,0 +1,17 @@
+<?php
+/**
+ * Install plugin network administration panel.
+ *
+ * @package WordPress
+ * @subpackage Multisite
+ * @since 3.1.0
+ */
+
+if ( isset( $_GET['tab'] ) && ( 'plugin-information' == $_GET['tab'] ) ) {
+ define( 'IFRAME_REQUEST', true );
+}
+
+/** Load WordPress Administration Bootstrap */
+require_once( dirname( __FILE__ ) . '/admin.php' );
+
+require( ABSPATH . 'wp-admin/plugin-install.php' );
diff --git a/www/crm/wp-admin/network/plugins.php b/www/crm/wp-admin/network/plugins.php
new file mode 100644
index 00000000..56c3debd
--- /dev/null
+++ b/www/crm/wp-admin/network/plugins.php
@@ -0,0 +1,13 @@
+<?php
+/**
+ * Network Plugins administration panel.
+ *
+ * @package WordPress
+ * @subpackage Multisite
+ * @since 3.1.0
+ */
+
+/** Load WordPress Administration Bootstrap */
+require_once( dirname( __FILE__ ) . '/admin.php' );
+
+require( ABSPATH . 'wp-admin/plugins.php' );
diff --git a/www/crm/wp-admin/network/privacy.php b/www/crm/wp-admin/network/privacy.php
new file mode 100644
index 00000000..5cba05d3
--- /dev/null
+++ b/www/crm/wp-admin/network/privacy.php
@@ -0,0 +1,13 @@
+<?php
+/**
+ * Network Privacy administration panel.
+ *
+ * @package WordPress
+ * @subpackage Multisite
+ * @since 4.9.0
+ */
+
+/** Load WordPress Administration Bootstrap */
+require_once( dirname( __FILE__ ) . '/admin.php' );
+
+require( ABSPATH . 'wp-admin/privacy.php' );
diff --git a/www/crm/wp-admin/network/profile.php b/www/crm/wp-admin/network/profile.php
new file mode 100644
index 00000000..240ef980
--- /dev/null
+++ b/www/crm/wp-admin/network/profile.php
@@ -0,0 +1,13 @@
+<?php
+/**
+ * User profile network administration panel.
+ *
+ * @package WordPress
+ * @subpackage Multisite
+ * @since 3.1.0
+ */
+
+/** Load WordPress Administration Bootstrap */
+require_once( dirname( __FILE__ ) . '/admin.php' );
+
+require( ABSPATH . 'wp-admin/profile.php' );
diff --git a/www/crm/wp-admin/network/settings.php b/www/crm/wp-admin/network/settings.php
new file mode 100644
index 00000000..375367a2
--- /dev/null
+++ b/www/crm/wp-admin/network/settings.php
@@ -0,0 +1,481 @@
+<?php
+/**
+ * Multisite network settings administration panel.
+ *
+ * @package WordPress
+ * @subpackage Multisite
+ * @since 3.0.0
+ */
+
+/** Load WordPress Administration Bootstrap */
+require_once( dirname( __FILE__ ) . '/admin.php' );
+
+/** WordPress Translation Installation API */
+require_once( ABSPATH . 'wp-admin/includes/translation-install.php' );
+
+if ( ! current_user_can( 'manage_network_options' ) ) {
+ wp_die( __( 'Sorry, you are not allowed to access this page.' ), 403 );
+}
+
+$title = __( 'Network Settings' );
+$parent_file = 'settings.php';
+
+// Handle network admin email change requests
+if ( ! empty( $_GET['network_admin_hash'] ) ) {
+ $new_admin_details = get_site_option( 'network_admin_hash' );
+ $redirect = 'settings.php?updated=false';
+ if ( is_array( $new_admin_details ) && hash_equals( $new_admin_details['hash'], $_GET['network_admin_hash'] ) && ! empty( $new_admin_details['newemail'] ) ) {
+ update_site_option( 'admin_email', $new_admin_details['newemail'] );
+ delete_site_option( 'network_admin_hash' );
+ delete_site_option( 'new_admin_email' );
+ $redirect = 'settings.php?updated=true';
+ }
+ wp_redirect( network_admin_url( $redirect ) );
+ exit;
+} elseif ( ! empty( $_GET['dismiss'] ) && 'new_network_admin_email' == $_GET['dismiss'] ) {
+ check_admin_referer( 'dismiss_new_network_admin_email' );
+ delete_site_option( 'network_admin_hash' );
+ delete_site_option( 'new_admin_email' );
+ wp_redirect( network_admin_url( 'settings.php?updated=true' ) );
+ exit;
+}
+
+add_action( 'admin_head', 'network_settings_add_js' );
+
+get_current_screen()->add_help_tab(
+ array(
+ 'id' => 'overview',
+ 'title' => __( 'Overview' ),
+ 'content' =>
+ '<p>' . __( 'This screen sets and changes options for the network as a whole. The first site is the main site in the network and network options are pulled from that original site&#8217;s options.' ) . '</p>' .
+ '<p>' . __( 'Operational settings has fields for the network&#8217;s name and admin email.' ) . '</p>' .
+ '<p>' . __( 'Registration settings can disable/enable public signups. If you let others sign up for a site, install spam plugins. Spaces, not commas, should separate names banned as sites for this network.' ) . '</p>' .
+ '<p>' . __( 'New site settings are defaults applied when a new site is created in the network. These include welcome email for when a new site or user account is registered, and what&#8127;s put in the first post, page, comment, comment author, and comment URL.' ) . '</p>' .
+ '<p>' . __( 'Upload settings control the size of the uploaded files and the amount of available upload space for each site. You can change the default value for specific sites when you edit a particular site. Allowed file types are also listed (space separated only).' ) . '</p>' .
+ '<p>' . __( 'You can set the language, and the translation files will be automatically downloaded and installed (available if your filesystem is writable).' ) . '</p>' .
+ '<p>' . __( 'Menu setting enables/disables the plugin menus from appearing for non super admins, so that only super admins, not site admins, have access to activate plugins.' ) . '</p>' .
+ '<p>' . __( 'Super admins can no longer be added on the Options screen. You must now go to the list of existing users on Network Admin > Users and click on Username or the Edit action link below that name. This goes to an Edit User page where you can check a box to grant super admin privileges.' ) . '</p>',
+ )
+);
+
+get_current_screen()->set_help_sidebar(
+ '<p><strong>' . __( 'For more information:' ) . '</strong></p>' .
+ '<p>' . __( '<a href="https://codex.wordpress.org/Network_Admin_Settings_Screen">Documentation on Network Settings</a>' ) . '</p>' .
+ '<p>' . __( '<a href="https://wordpress.org/support/">Support</a>' ) . '</p>'
+);
+
+if ( $_POST ) {
+ /** This action is documented in wp-admin/network/edit.php */
+ do_action( 'wpmuadminedit' );
+
+ check_admin_referer( 'siteoptions' );
+
+ $checked_options = array(
+ 'menu_items' => array(),
+ 'registrationnotification' => 'no',
+ 'upload_space_check_disabled' => 1,
+ 'add_new_users' => 0,
+ );
+ foreach ( $checked_options as $option_name => $option_unchecked_value ) {
+ if ( ! isset( $_POST[ $option_name ] ) ) {
+ $_POST[ $option_name ] = $option_unchecked_value;
+ }
+ }
+
+ $options = array(
+ 'registrationnotification',
+ 'registration',
+ 'add_new_users',
+ 'menu_items',
+ 'upload_space_check_disabled',
+ 'blog_upload_space',
+ 'upload_filetypes',
+ 'site_name',
+ 'first_post',
+ 'first_page',
+ 'first_comment',
+ 'first_comment_url',
+ 'first_comment_author',
+ 'welcome_email',
+ 'welcome_user_email',
+ 'fileupload_maxk',
+ 'global_terms_enabled',
+ 'illegal_names',
+ 'limited_email_domains',
+ 'banned_email_domains',
+ 'WPLANG',
+ 'new_admin_email',
+ 'first_comment_email',
+ );
+
+ // Handle translation installation.
+ if ( ! empty( $_POST['WPLANG'] ) && current_user_can( 'install_languages' ) && wp_can_install_language_pack() ) {
+ $language = wp_download_language_pack( $_POST['WPLANG'] );
+ if ( $language ) {
+ $_POST['WPLANG'] = $language;
+ }
+ }
+
+ foreach ( $options as $option_name ) {
+ if ( ! isset( $_POST[ $option_name ] ) ) {
+ continue;
+ }
+ $value = wp_unslash( $_POST[ $option_name ] );
+ update_site_option( $option_name, $value );
+ }
+
+ /**
+ * Fires after the network options are updated.
+ *
+ * @since MU (3.0.0)
+ */
+ do_action( 'update_wpmu_options' );
+
+ wp_redirect( add_query_arg( 'updated', 'true', network_admin_url( 'settings.php' ) ) );
+ exit();
+}
+
+include( ABSPATH . 'wp-admin/admin-header.php' );
+
+if ( isset( $_GET['updated'] ) ) {
+ ?><div id="message" class="updated notice is-dismissible"><p><?php _e( 'Settings saved.' ); ?></p></div>
+ <?php
+}
+?>
+
+<div class="wrap">
+ <h1><?php echo esc_html( $title ); ?></h1>
+ <form method="post" action="settings.php" novalidate="novalidate">
+ <?php wp_nonce_field( 'siteoptions' ); ?>
+ <h2><?php _e( 'Operational Settings' ); ?></h2>
+ <table class="form-table" role="presentation">
+ <tr>
+ <th scope="row"><label for="site_name"><?php _e( 'Network Title' ); ?></label></th>
+ <td>
+ <input name="site_name" type="text" id="site_name" class="regular-text" value="<?php echo esc_attr( get_network()->site_name ); ?>" />
+ </td>
+ </tr>
+
+ <tr>
+ <th scope="row"><label for="admin_email"><?php _e( 'Network Admin Email' ); ?></label></th>
+ <td>
+ <input name="new_admin_email" type="email" id="admin_email" aria-describedby="admin-email-desc" class="regular-text" value="<?php echo esc_attr( get_site_option( 'admin_email' ) ); ?>" />
+ <p class="description" id="admin-email-desc">
+ <?php _e( 'This address is used for admin purposes. If you change this we will send you an email at your new address to confirm it. <strong>The new address will not become active until confirmed.</strong>' ); ?>
+ </p>
+ <?php
+ $new_admin_email = get_site_option( 'new_admin_email' );
+ if ( $new_admin_email && $new_admin_email != get_site_option( 'admin_email' ) ) :
+ ?>
+ <div class="updated inline">
+ <p>
+ <?php
+ printf(
+ /* translators: %s: new network admin email */
+ __( 'There is a pending change of the network admin email to %s.' ),
+ '<code>' . esc_html( $new_admin_email ) . '</code>'
+ );
+ printf(
+ ' <a href="%1$s">%2$s</a>',
+ esc_url( wp_nonce_url( network_admin_url( 'settings.php?dismiss=new_network_admin_email' ), 'dismiss_new_network_admin_email' ) ),
+ __( 'Cancel' )
+ );
+ ?>
+ </p>
+ </div>
+ <?php endif; ?>
+ </td>
+ </tr>
+ </table>
+ <h2><?php _e( 'Registration Settings' ); ?></h2>
+ <table class="form-table" role="presentation">
+ <tr>
+ <th scope="row"><?php _e( 'Allow new registrations' ); ?></th>
+ <?php
+ if ( ! get_site_option( 'registration' ) ) {
+ update_site_option( 'registration', 'none' );
+ }
+ $reg = get_site_option( 'registration' );
+ ?>
+ <td>
+ <fieldset>
+ <legend class="screen-reader-text"><?php _e( 'New registrations settings' ); ?></legend>
+ <label><input name="registration" type="radio" id="registration1" value="none"<?php checked( $reg, 'none' ); ?> /> <?php _e( 'Registration is disabled' ); ?></label><br />
+ <label><input name="registration" type="radio" id="registration2" value="user"<?php checked( $reg, 'user' ); ?> /> <?php _e( 'User accounts may be registered' ); ?></label><br />
+ <label><input name="registration" type="radio" id="registration3" value="blog"<?php checked( $reg, 'blog' ); ?> /> <?php _e( 'Logged in users may register new sites' ); ?></label><br />
+ <label><input name="registration" type="radio" id="registration4" value="all"<?php checked( $reg, 'all' ); ?> /> <?php _e( 'Both sites and user accounts can be registered' ); ?></label>
+ <?php
+ if ( is_subdomain_install() ) {
+ echo '<p class="description">';
+ /* translators: 1: NOBLOGREDIRECT, 2: wp-config.php */
+ printf(
+ __( 'If registration is disabled, please set %1$s in %2$s to a URL you will redirect visitors to if they visit a non-existent site.' ),
+ '<code>NOBLOGREDIRECT</code>',
+ '<code>wp-config.php</code>'
+ );
+ echo '</p>';
+ }
+ ?>
+ </fieldset>
+ </td>
+ </tr>
+
+ <tr>
+ <th scope="row"><?php _e( 'Registration notification' ); ?></th>
+ <?php
+ if ( ! get_site_option( 'registrationnotification' ) ) {
+ update_site_option( 'registrationnotification', 'yes' );
+ }
+ ?>
+ <td>
+ <label><input name="registrationnotification" type="checkbox" id="registrationnotification" value="yes"<?php checked( get_site_option( 'registrationnotification' ), 'yes' ); ?> /> <?php _e( 'Send the network admin an email notification every time someone registers a site or user account' ); ?></label>
+ </td>
+ </tr>
+
+ <tr id="addnewusers">
+ <th scope="row"><?php _e( 'Add New Users' ); ?></th>
+ <td>
+ <label><input name="add_new_users" type="checkbox" id="add_new_users" value="1"<?php checked( get_site_option( 'add_new_users' ) ); ?> /> <?php _e( 'Allow site administrators to add new users to their site via the "Users &rarr; Add New" page' ); ?></label>
+ </td>
+ </tr>
+
+ <tr>
+ <th scope="row"><label for="illegal_names"><?php _e( 'Banned Names' ); ?></label></th>
+ <td>
+ <input name="illegal_names" type="text" id="illegal_names" aria-describedby="illegal-names-desc" class="large-text" value="<?php echo esc_attr( implode( ' ', (array) get_site_option( 'illegal_names' ) ) ); ?>" size="45" />
+ <p class="description" id="illegal-names-desc">
+ <?php _e( 'Users are not allowed to register these sites. Separate names by spaces.' ); ?>
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <th scope="row"><label for="limited_email_domains"><?php _e( 'Limited Email Registrations' ); ?></label></th>
+ <td>
+ <?php
+ $limited_email_domains = get_site_option( 'limited_email_domains' );
+ $limited_email_domains = str_replace( ' ', "\n", $limited_email_domains );
+ ?>
+ <textarea name="limited_email_domains" id="limited_email_domains" aria-describedby="limited-email-domains-desc" cols="45" rows="5">
+<?php echo esc_textarea( $limited_email_domains == '' ? '' : implode( "\n", (array) $limited_email_domains ) ); ?></textarea>
+ <p class="description" id="limited-email-domains-desc">
+ <?php _e( 'If you want to limit site registrations to certain domains. One domain per line.' ); ?>
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <th scope="row"><label for="banned_email_domains"><?php _e( 'Banned Email Domains' ); ?></label></th>
+ <td>
+ <textarea name="banned_email_domains" id="banned_email_domains" aria-describedby="banned-email-domains-desc" cols="45" rows="5">
+<?php echo esc_textarea( get_site_option( 'banned_email_domains' ) == '' ? '' : implode( "\n", (array) get_site_option( 'banned_email_domains' ) ) ); ?></textarea>
+ <p class="description" id="banned-email-domains-desc">
+ <?php _e( 'If you want to ban domains from site registrations. One domain per line.' ); ?>
+ </p>
+ </td>
+ </tr>
+
+ </table>
+ <h2><?php _e( 'New Site Settings' ); ?></h2>
+ <table class="form-table" role="presentation">
+
+ <tr>
+ <th scope="row"><label for="welcome_email"><?php _e( 'Welcome Email' ); ?></label></th>
+ <td>
+ <textarea name="welcome_email" id="welcome_email" aria-describedby="welcome-email-desc" rows="5" cols="45" class="large-text">
+<?php echo esc_textarea( get_site_option( 'welcome_email' ) ); ?></textarea>
+ <p class="description" id="welcome-email-desc">
+ <?php _e( 'The welcome email sent to new site owners.' ); ?>
+ </p>
+ </td>
+ </tr>
+ <tr>
+ <th scope="row"><label for="welcome_user_email"><?php _e( 'Welcome User Email' ); ?></label></th>
+ <td>
+ <textarea name="welcome_user_email" id="welcome_user_email" aria-describedby="welcome-user-email-desc" rows="5" cols="45" class="large-text">
+<?php echo esc_textarea( get_site_option( 'welcome_user_email' ) ); ?></textarea>
+ <p class="description" id="welcome-user-email-desc">
+ <?php _e( 'The welcome email sent to new users.' ); ?>
+ </p>
+ </td>
+ </tr>
+ <tr>
+ <th scope="row"><label for="first_post"><?php _e( 'First Post' ); ?></label></th>
+ <td>
+ <textarea name="first_post" id="first_post" aria-describedby="first-post-desc" rows="5" cols="45" class="large-text">
+<?php echo esc_textarea( get_site_option( 'first_post' ) ); ?></textarea>
+ <p class="description" id="first-post-desc">
+ <?php _e( 'The first post on a new site.' ); ?>
+ </p>
+ </td>
+ </tr>
+ <tr>
+ <th scope="row"><label for="first_page"><?php _e( 'First Page' ); ?></label></th>
+ <td>
+ <textarea name="first_page" id="first_page" aria-describedby="first-page-desc" rows="5" cols="45" class="large-text">
+<?php echo esc_textarea( get_site_option( 'first_page' ) ); ?></textarea>
+ <p class="description" id="first-page-desc">
+ <?php _e( 'The first page on a new site.' ); ?>
+ </p>
+ </td>
+ </tr>
+ <tr>
+ <th scope="row"><label for="first_comment"><?php _e( 'First Comment' ); ?></label></th>
+ <td>
+ <textarea name="first_comment" id="first_comment" aria-describedby="first-comment-desc" rows="5" cols="45" class="large-text">
+<?php echo esc_textarea( get_site_option( 'first_comment' ) ); ?></textarea>
+ <p class="description" id="first-comment-desc">
+ <?php _e( 'The first comment on a new site.' ); ?>
+ </p>
+ </td>
+ </tr>
+ <tr>
+ <th scope="row"><label for="first_comment_author"><?php _e( 'First Comment Author' ); ?></label></th>
+ <td>
+ <input type="text" size="40" name="first_comment_author" id="first_comment_author" aria-describedby="first-comment-author-desc" value="<?php echo esc_attr( get_site_option( 'first_comment_author' ) ); ?>" />
+ <p class="description" id="first-comment-author-desc">
+ <?php _e( 'The author of the first comment on a new site.' ); ?>
+ </p>
+ </td>
+ </tr>
+ <tr>
+ <th scope="row"><label for="first_comment_email"><?php _e( 'First Comment Email' ); ?></label></th>
+ <td>
+ <input type="text" size="40" name="first_comment_email" id="first_comment_email" aria-describedby="first-comment-email-desc" value="<?php echo esc_attr( get_site_option( 'first_comment_email' ) ); ?>" />
+ <p class="description" id="first-comment-email-desc">
+ <?php _e( 'The email address of the first comment author on a new site.' ); ?>
+ </p>
+ </td>
+ </tr>
+ <tr>
+ <th scope="row"><label for="first_comment_url"><?php _e( 'First Comment URL' ); ?></label></th>
+ <td>
+ <input type="text" size="40" name="first_comment_url" id="first_comment_url" aria-describedby="first-comment-url-desc" value="<?php echo esc_attr( get_site_option( 'first_comment_url' ) ); ?>" />
+ <p class="description" id="first-comment-url-desc">
+ <?php _e( 'The URL for the first comment on a new site.' ); ?>
+ </p>
+ </td>
+ </tr>
+ </table>
+ <h2><?php _e( 'Upload Settings' ); ?></h2>
+ <table class="form-table" role="presentation">
+ <tr>
+ <th scope="row"><?php _e( 'Site upload space' ); ?></th>
+ <td>
+ <label><input type="checkbox" id="upload_space_check_disabled" name="upload_space_check_disabled" value="0"<?php checked( (bool) get_site_option( 'upload_space_check_disabled' ), false ); ?>/> <?php printf( __( 'Limit total size of files uploaded to %s MB' ), '</label><label><input name="blog_upload_space" type="number" min="0" style="width: 100px" id="blog_upload_space" aria-describedby="blog-upload-space-desc" value="' . esc_attr( get_site_option( 'blog_upload_space', 100 ) ) . '" />' ); ?></label><br />
+ <p class="screen-reader-text" id="blog-upload-space-desc">
+ <?php _e( 'Size in megabytes' ); ?>
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <th scope="row"><label for="upload_filetypes"><?php _e( 'Upload file types' ); ?></label></th>
+ <td>
+ <input name="upload_filetypes" type="text" id="upload_filetypes" aria-describedby="upload-filetypes-desc" class="large-text" value="<?php echo esc_attr( get_site_option( 'upload_filetypes', 'jpg jpeg png gif' ) ); ?>" size="45" />
+ <p class="description" id="upload-filetypes-desc">
+ <?php _e( 'Allowed file types. Separate types by spaces.' ); ?>
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <th scope="row"><label for="fileupload_maxk"><?php _e( 'Max upload file size' ); ?></label></th>
+ <td>
+ <?php
+ printf(
+ /* translators: %s: File size in kilobytes */
+ __( '%s KB' ),
+ '<input name="fileupload_maxk" type="number" min="0" style="width: 100px" id="fileupload_maxk" aria-describedby="fileupload-maxk-desc" value="' . esc_attr( get_site_option( 'fileupload_maxk', 300 ) ) . '" />'
+ );
+ ?>
+ <p class="screen-reader-text" id="fileupload-maxk-desc">
+ <?php _e( 'Size in kilobytes' ); ?>
+ </p>
+ </td>
+ </tr>
+ </table>
+
+ <?php
+ $languages = get_available_languages();
+ $translations = wp_get_available_translations();
+ if ( ! empty( $languages ) || ! empty( $translations ) ) {
+ ?>
+ <h2><?php _e( 'Language Settings' ); ?></h2>
+ <table class="form-table" role="presentation">
+ <tr>
+ <th><label for="WPLANG"><?php _e( 'Default Language' ); ?></label></th>
+ <td>
+ <?php
+ $lang = get_site_option( 'WPLANG' );
+ if ( ! in_array( $lang, $languages ) ) {
+ $lang = '';
+ }
+
+ wp_dropdown_languages(
+ array(
+ 'name' => 'WPLANG',
+ 'id' => 'WPLANG',
+ 'selected' => $lang,
+ 'languages' => $languages,
+ 'translations' => $translations,
+ 'show_available_translations' => current_user_can( 'install_languages' ) && wp_can_install_language_pack(),
+ )
+ );
+ ?>
+ </td>
+ </tr>
+ </table>
+ <?php
+ }
+ ?>
+
+ <h2><?php _e( 'Menu Settings' ); ?></h2>
+ <table id="menu" class="form-table">
+ <tr>
+ <th scope="row"><?php _e( 'Enable administration menus' ); ?></th>
+ <td>
+ <?php
+ $menu_perms = get_site_option( 'menu_items' );
+ /**
+ * Filters available network-wide administration menu options.
+ *
+ * Options returned to this filter are output as individual checkboxes that, when selected,
+ * enable site administrator access to the specified administration menu in certain contexts.
+ *
+ * Adding options for specific menus here hinges on the appropriate checks and capabilities
+ * being in place in the site dashboard on the other side. For instance, when the single
+ * default option, 'plugins' is enabled, site administrators are granted access to the Plugins
+ * screen in their individual sites' dashboards.
+ *
+ * @since MU (3.0.0)
+ *
+ * @param string[] $admin_menus Associative array of the menu items available.
+ */
+ $menu_items = apply_filters( 'mu_menu_items', array( 'plugins' => __( 'Plugins' ) ) );
+
+ echo '<fieldset><legend class="screen-reader-text">' . __( 'Enable menus' ) . '</legend>';
+
+ foreach ( (array) $menu_items as $key => $val ) {
+ echo "<label><input type='checkbox' name='menu_items[" . $key . "]' value='1'" . ( isset( $menu_perms[ $key ] ) ? checked( $menu_perms[ $key ], '1', false ) : '' ) . ' /> ' . esc_html( $val ) . '</label><br/>';
+ }
+
+ echo '</fieldset>';
+ ?>
+ </td>
+ </tr>
+ </table>
+
+ <?php
+ /**
+ * Fires at the end of the Network Settings form, before the submit button.
+ *
+ * @since MU (3.0.0)
+ */
+ do_action( 'wpmu_options' );
+ ?>
+ <?php submit_button(); ?>
+ </form>
+</div>
+
+<?php include( ABSPATH . 'wp-admin/admin-footer.php' ); ?>
diff --git a/www/crm/wp-admin/network/setup.php b/www/crm/wp-admin/network/setup.php
new file mode 100644
index 00000000..9a642bbb
--- /dev/null
+++ b/www/crm/wp-admin/network/setup.php
@@ -0,0 +1,13 @@
+<?php
+/**
+ * Network Setup administration panel.
+ *
+ * @package WordPress
+ * @subpackage Multisite
+ * @since 3.1.0
+ */
+
+/** Load WordPress Administration Bootstrap */
+require_once( dirname( __FILE__ ) . '/admin.php' );
+
+require( ABSPATH . 'wp-admin/network.php' );
diff --git a/www/crm/wp-admin/network/site-info.php b/www/crm/wp-admin/network/site-info.php
new file mode 100644
index 00000000..c8b86e5f
--- /dev/null
+++ b/www/crm/wp-admin/network/site-info.php
@@ -0,0 +1,209 @@
+<?php
+/**
+ * Edit Site Info Administration Screen
+ *
+ * @package WordPress
+ * @subpackage Multisite
+ * @since 3.1.0
+ */
+
+/** Load WordPress Administration Bootstrap */
+require_once( dirname( __FILE__ ) . '/admin.php' );
+
+if ( ! current_user_can( 'manage_sites' ) ) {
+ wp_die( __( 'Sorry, you are not allowed to edit this site.' ) );
+}
+
+get_current_screen()->add_help_tab( get_site_screen_help_tab_args() );
+get_current_screen()->set_help_sidebar( get_site_screen_help_sidebar_content() );
+
+$id = isset( $_REQUEST['id'] ) ? intval( $_REQUEST['id'] ) : 0;
+
+if ( ! $id ) {
+ wp_die( __( 'Invalid site ID.' ) );
+}
+
+$details = get_site( $id );
+if ( ! $details ) {
+ wp_die( __( 'The requested site does not exist.' ) );
+}
+
+if ( ! can_edit_network( $details->site_id ) ) {
+ wp_die( __( 'Sorry, you are not allowed to access this page.' ), 403 );
+}
+
+$parsed_scheme = parse_url( $details->siteurl, PHP_URL_SCHEME );
+$is_main_site = is_main_site( $id );
+
+if ( isset( $_REQUEST['action'] ) && 'update-site' == $_REQUEST['action'] ) {
+ check_admin_referer( 'edit-site' );
+
+ switch_to_blog( $id );
+
+ // Rewrite rules can't be flushed during switch to blog.
+ delete_option( 'rewrite_rules' );
+
+ $blog_data = wp_unslash( $_POST['blog'] );
+ $blog_data['scheme'] = $parsed_scheme;
+
+ if ( $is_main_site ) {
+ // On the network's main site, don't allow the domain or path to change.
+ $blog_data['domain'] = $details->domain;
+ $blog_data['path'] = $details->path;
+ } else {
+ // For any other site, the scheme, domain, and path can all be changed. We first
+ // need to ensure a scheme has been provided, otherwise fallback to the existing.
+ $new_url_scheme = parse_url( $blog_data['url'], PHP_URL_SCHEME );
+
+ if ( ! $new_url_scheme ) {
+ $blog_data['url'] = esc_url( $parsed_scheme . '://' . $blog_data['url'] );
+ }
+ $update_parsed_url = parse_url( $blog_data['url'] );
+
+ // If a path is not provided, use the default of `/`.
+ if ( ! isset( $update_parsed_url['path'] ) ) {
+ $update_parsed_url['path'] = '/';
+ }
+
+ $blog_data['scheme'] = $update_parsed_url['scheme'];
+ $blog_data['domain'] = $update_parsed_url['host'];
+ $blog_data['path'] = $update_parsed_url['path'];
+ }
+
+ $existing_details = get_site( $id );
+ $blog_data_checkboxes = array( 'public', 'archived', 'spam', 'mature', 'deleted' );
+ foreach ( $blog_data_checkboxes as $c ) {
+ if ( ! in_array( $existing_details->$c, array( 0, 1 ) ) ) {
+ $blog_data[ $c ] = $existing_details->$c;
+ } else {
+ $blog_data[ $c ] = isset( $_POST['blog'][ $c ] ) ? 1 : 0;
+ }
+ }
+
+ update_blog_details( $id, $blog_data );
+
+ // Maybe update home and siteurl options.
+ $new_details = get_site( $id );
+
+ $old_home_url = trailingslashit( esc_url( get_option( 'home' ) ) );
+ $old_home_parsed = parse_url( $old_home_url );
+
+ if ( $old_home_parsed['host'] === $existing_details->domain && $old_home_parsed['path'] === $existing_details->path ) {
+ $new_home_url = untrailingslashit( esc_url_raw( $blog_data['scheme'] . '://' . $new_details->domain . $new_details->path ) );
+ update_option( 'home', $new_home_url );
+ }
+
+ $old_site_url = trailingslashit( esc_url( get_option( 'siteurl' ) ) );
+ $old_site_parsed = parse_url( $old_site_url );
+
+ if ( $old_site_parsed['host'] === $existing_details->domain && $old_site_parsed['path'] === $existing_details->path ) {
+ $new_site_url = untrailingslashit( esc_url_raw( $blog_data['scheme'] . '://' . $new_details->domain . $new_details->path ) );
+ update_option( 'siteurl', $new_site_url );
+ }
+
+ restore_current_blog();
+ wp_redirect(
+ add_query_arg(
+ array(
+ 'update' => 'updated',
+ 'id' => $id,
+ ),
+ 'site-info.php'
+ )
+ );
+ exit;
+}
+
+if ( isset( $_GET['update'] ) ) {
+ $messages = array();
+ if ( 'updated' == $_GET['update'] ) {
+ $messages[] = __( 'Site info updated.' );
+ }
+}
+
+/* translators: %s: site name */
+$title = sprintf( __( 'Edit Site: %s' ), esc_html( $details->blogname ) );
+
+$parent_file = 'sites.php';
+$submenu_file = 'sites.php';
+
+require( ABSPATH . 'wp-admin/admin-header.php' );
+
+?>
+
+<div class="wrap">
+<h1 id="edit-site"><?php echo $title; ?></h1>
+<p class="edit-site-actions"><a href="<?php echo esc_url( get_home_url( $id, '/' ) ); ?>"><?php _e( 'Visit' ); ?></a> | <a href="<?php echo esc_url( get_admin_url( $id ) ); ?>"><?php _e( 'Dashboard' ); ?></a></p>
+<?php
+
+network_edit_site_nav(
+ array(
+ 'blog_id' => $id,
+ 'selected' => 'site-info',
+ )
+);
+
+if ( ! empty( $messages ) ) {
+ foreach ( $messages as $msg ) {
+ echo '<div id="message" class="updated notice is-dismissible"><p>' . $msg . '</p></div>';
+ }
+}
+?>
+<form method="post" action="site-info.php?action=update-site">
+ <?php wp_nonce_field( 'edit-site' ); ?>
+ <input type="hidden" name="id" value="<?php echo esc_attr( $id ); ?>" />
+ <table class="form-table" role="presentation">
+ <?php
+ // The main site of the network should not be updated on this page.
+ if ( $is_main_site ) :
+ ?>
+ <tr class="form-field">
+ <th scope="row"><?php _e( 'Site Address (URL)' ); ?></th>
+ <td><?php echo esc_url( $parsed_scheme . '://' . $details->domain . $details->path ); ?></td>
+ </tr>
+ <?php
+ // For any other site, the scheme, domain, and path can all be changed.
+ else :
+ ?>
+ <tr class="form-field form-required">
+ <th scope="row"><label for="url"><?php _e( 'Site Address (URL)' ); ?></label></th>
+ <td><input name="blog[url]" type="text" id="url" value="<?php echo $parsed_scheme . '://' . esc_attr( $details->domain ) . esc_attr( $details->path ); ?>" /></td>
+ </tr>
+ <?php endif; ?>
+
+ <tr class="form-field">
+ <th scope="row"><label for="blog_registered"><?php _ex( 'Registered', 'site' ); ?></label></th>
+ <td><input name="blog[registered]" type="text" id="blog_registered" value="<?php echo esc_attr( $details->registered ); ?>" /></td>
+ </tr>
+ <tr class="form-field">
+ <th scope="row"><label for="blog_last_updated"><?php _e( 'Last Updated' ); ?></label></th>
+ <td><input name="blog[last_updated]" type="text" id="blog_last_updated" value="<?php echo esc_attr( $details->last_updated ); ?>" /></td>
+ </tr>
+ <?php
+ $attribute_fields = array( 'public' => __( 'Public' ) );
+ if ( ! $is_main_site ) {
+ $attribute_fields['archived'] = __( 'Archived' );
+ $attribute_fields['spam'] = _x( 'Spam', 'site' );
+ $attribute_fields['deleted'] = __( 'Deleted' );
+ }
+ $attribute_fields['mature'] = __( 'Mature' );
+ ?>
+ <tr>
+ <th scope="row"><?php _e( 'Attributes' ); ?></th>
+ <td>
+ <fieldset>
+ <legend class="screen-reader-text"><?php _e( 'Set site attributes' ); ?></legend>
+ <?php foreach ( $attribute_fields as $field_key => $field_label ) : ?>
+ <label><input type="checkbox" name="blog[<?php echo $field_key; ?>]" value="1" <?php checked( (bool) $details->$field_key, true ); ?> <?php disabled( ! in_array( $details->$field_key, array( 0, 1 ) ) ); ?> />
+ <?php echo $field_label; ?></label><br/>
+ <?php endforeach; ?>
+ <fieldset>
+ </td>
+ </tr>
+ </table>
+ <?php submit_button(); ?>
+</form>
+
+</div>
+<?php
+require( ABSPATH . 'wp-admin/admin-footer.php' );
diff --git a/www/crm/wp-admin/network/site-new.php b/www/crm/wp-admin/network/site-new.php
new file mode 100644
index 00000000..318c7b44
--- /dev/null
+++ b/www/crm/wp-admin/network/site-new.php
@@ -0,0 +1,301 @@
+<?php
+/**
+ * Add Site Administration Screen
+ *
+ * @package WordPress
+ * @subpackage Multisite
+ * @since 3.1.0
+ */
+
+/** Load WordPress Administration Bootstrap */
+require_once( dirname( __FILE__ ) . '/admin.php' );
+
+/** WordPress Translation Installation API */
+require_once( ABSPATH . 'wp-admin/includes/translation-install.php' );
+
+if ( ! current_user_can( 'create_sites' ) ) {
+ wp_die( __( 'Sorry, you are not allowed to add sites to this network.' ) );
+}
+
+get_current_screen()->add_help_tab(
+ array(
+ 'id' => 'overview',
+ 'title' => __( 'Overview' ),
+ 'content' =>
+ '<p>' . __( 'This screen is for Super Admins to add new sites to the network. This is not affected by the registration settings.' ) . '</p>' .
+ '<p>' . __( 'If the admin email for the new site does not exist in the database, a new user will also be created.' ) . '</p>',
+ )
+);
+
+get_current_screen()->set_help_sidebar(
+ '<p><strong>' . __( 'For more information:' ) . '</strong></p>' .
+ '<p>' . __( '<a href="https://codex.wordpress.org/Network_Admin_Sites_Screen">Documentation on Site Management</a>' ) . '</p>' .
+ '<p>' . __( '<a href="https://wordpress.org/support/forum/multisite/">Support Forums</a>' ) . '</p>'
+);
+
+if ( isset( $_REQUEST['action'] ) && 'add-site' == $_REQUEST['action'] ) {
+ check_admin_referer( 'add-blog', '_wpnonce_add-blog' );
+
+ if ( ! is_array( $_POST['blog'] ) ) {
+ wp_die( __( 'Can&#8217;t create an empty site.' ) );
+ }
+
+ $blog = $_POST['blog'];
+ $domain = '';
+ if ( preg_match( '|^([a-zA-Z0-9-])+$|', $blog['domain'] ) ) {
+ $domain = strtolower( $blog['domain'] );
+ }
+
+ // If not a subdomain installation, make sure the domain isn't a reserved word
+ if ( ! is_subdomain_install() ) {
+ $subdirectory_reserved_names = get_subdirectory_reserved_names();
+
+ if ( in_array( $domain, $subdirectory_reserved_names ) ) {
+ wp_die(
+ /* translators: %s: reserved names list */
+ sprintf(
+ __( 'The following words are reserved for use by WordPress functions and cannot be used as blog names: %s' ),
+ '<code>' . implode( '</code>, <code>', $subdirectory_reserved_names ) . '</code>'
+ )
+ );
+ }
+ }
+
+ $title = $blog['title'];
+
+ $meta = array(
+ 'public' => 1,
+ );
+
+ // Handle translation installation for the new site.
+ if ( isset( $_POST['WPLANG'] ) ) {
+ if ( '' === $_POST['WPLANG'] ) {
+ $meta['WPLANG'] = ''; // en_US
+ } elseif ( in_array( $_POST['WPLANG'], get_available_languages() ) ) {
+ $meta['WPLANG'] = $_POST['WPLANG'];
+ } elseif ( current_user_can( 'install_languages' ) && wp_can_install_language_pack() ) {
+ $language = wp_download_language_pack( wp_unslash( $_POST['WPLANG'] ) );
+ if ( $language ) {
+ $meta['WPLANG'] = $language;
+ }
+ }
+ }
+
+ if ( empty( $domain ) ) {
+ wp_die( __( 'Missing or invalid site address.' ) );
+ }
+
+ if ( isset( $blog['email'] ) && '' === trim( $blog['email'] ) ) {
+ wp_die( __( 'Missing email address.' ) );
+ }
+
+ $email = sanitize_email( $blog['email'] );
+ if ( ! is_email( $email ) ) {
+ wp_die( __( 'Invalid email address.' ) );
+ }
+
+ if ( is_subdomain_install() ) {
+ $newdomain = $domain . '.' . preg_replace( '|^www\.|', '', get_network()->domain );
+ $path = get_network()->path;
+ } else {
+ $newdomain = get_network()->domain;
+ $path = get_network()->path . $domain . '/';
+ }
+
+ $password = 'N/A';
+ $user_id = email_exists( $email );
+ if ( ! $user_id ) { // Create a new user with a random password
+ /**
+ * Fires immediately before a new user is created via the network site-new.php page.
+ *
+ * @since 4.5.0
+ *
+ * @param string $email Email of the non-existent user.
+ */
+ do_action( 'pre_network_site_new_created_user', $email );
+
+ $user_id = username_exists( $domain );
+ if ( $user_id ) {
+ wp_die( __( 'The domain or path entered conflicts with an existing username.' ) );
+ }
+ $password = wp_generate_password( 12, false );
+ $user_id = wpmu_create_user( $domain, $password, $email );
+ if ( false === $user_id ) {
+ wp_die( __( 'There was an error creating the user.' ) );
+ }
+
+ /**
+ * Fires after a new user has been created via the network site-new.php page.
+ *
+ * @since 4.4.0
+ *
+ * @param int $user_id ID of the newly created user.
+ */
+ do_action( 'network_site_new_created_user', $user_id );
+ }
+
+ $wpdb->hide_errors();
+ $id = wpmu_create_blog( $newdomain, $path, $title, $user_id, $meta, get_current_network_id() );
+ $wpdb->show_errors();
+ if ( ! is_wp_error( $id ) ) {
+ if ( ! is_super_admin( $user_id ) && ! get_user_option( 'primary_blog', $user_id ) ) {
+ update_user_option( $user_id, 'primary_blog', $id, true );
+ }
+
+ wp_mail(
+ get_site_option( 'admin_email' ),
+ sprintf(
+ /* translators: %s: network name */
+ __( '[%s] New Site Created' ),
+ get_network()->site_name
+ ),
+ sprintf(
+ /* translators: 1: user login, 2: site url, 3: site name/title */
+ __(
+ 'New site created by %1$s
+
+Address: %2$s
+Name: %3$s'
+ ),
+ $current_user->user_login,
+ get_site_url( $id ),
+ wp_unslash( $title )
+ ),
+ sprintf(
+ 'From: "%1$s" <%2$s>',
+ _x( 'Site Admin', 'email "From" field' ),
+ get_site_option( 'admin_email' )
+ )
+ );
+ wpmu_welcome_notification( $id, $user_id, $password, $title, array( 'public' => 1 ) );
+ wp_redirect(
+ add_query_arg(
+ array(
+ 'update' => 'added',
+ 'id' => $id,
+ ),
+ 'site-new.php'
+ )
+ );
+ exit;
+ } else {
+ wp_die( $id->get_error_message() );
+ }
+}
+
+if ( isset( $_GET['update'] ) ) {
+ $messages = array();
+ if ( 'added' == $_GET['update'] ) {
+ $messages[] = sprintf(
+ /* translators: 1: dashboard url, 2: network admin edit url */
+ __( 'Site added. <a href="%1$s">Visit Dashboard</a> or <a href="%2$s">Edit Site</a>' ),
+ esc_url( get_admin_url( absint( $_GET['id'] ) ) ),
+ network_admin_url( 'site-info.php?id=' . absint( $_GET['id'] ) )
+ );
+ }
+}
+
+$title = __( 'Add New Site' );
+$parent_file = 'sites.php';
+
+wp_enqueue_script( 'user-suggest' );
+
+require( ABSPATH . 'wp-admin/admin-header.php' );
+
+?>
+
+<div class="wrap">
+<h1 id="add-new-site"><?php _e( 'Add New Site' ); ?></h1>
+<?php
+if ( ! empty( $messages ) ) {
+ foreach ( $messages as $msg ) {
+ echo '<div id="message" class="updated notice is-dismissible"><p>' . $msg . '</p></div>';
+ }
+}
+?>
+<p>
+<?php
+printf(
+ /* translators: %s: asterisk to mark required form fields. */
+ __( 'Required fields are marked %s' ),
+ '<span class="required">*</span>'
+);
+?>
+</p>
+<form method="post" action="<?php echo network_admin_url( 'site-new.php?action=add-site' ); ?>" novalidate="novalidate">
+<?php wp_nonce_field( 'add-blog', '_wpnonce_add-blog' ); ?>
+ <table class="form-table" role="presentation">
+ <tr class="form-field form-required">
+ <th scope="row"><label for="site-address"><?php _e( 'Site Address (URL)' ); ?> <span class="required">*</span></label></th>
+ <td>
+ <?php if ( is_subdomain_install() ) { ?>
+ <input name="blog[domain]" type="text" class="regular-text" id="site-address" aria-describedby="site-address-desc" autocapitalize="none" autocorrect="off" required /><span class="no-break">.<?php echo preg_replace( '|^www\.|', '', get_network()->domain ); ?></span>
+ <?php
+ } else {
+ echo get_network()->domain . get_network()->path
+ ?>
+ <input name="blog[domain]" type="text" class="regular-text" id="site-address" aria-describedby="site-address-desc" autocapitalize="none" autocorrect="off" required />
+ <?php
+ }
+ echo '<p class="description" id="site-address-desc">' . __( 'Only lowercase letters (a-z), numbers, and hyphens are allowed.' ) . '</p>';
+ ?>
+ </td>
+ </tr>
+ <tr class="form-field form-required">
+ <th scope="row"><label for="site-title"><?php _e( 'Site Title' ); ?> <span class="required">*</span></label></th>
+ <td><input name="blog[title]" type="text" class="regular-text" id="site-title" required /></td>
+ </tr>
+ <?php
+ $languages = get_available_languages();
+ $translations = wp_get_available_translations();
+ if ( ! empty( $languages ) || ! empty( $translations ) ) :
+ ?>
+ <tr class="form-field form-required">
+ <th scope="row"><label for="site-language"><?php _e( 'Site Language' ); ?></label></th>
+ <td>
+ <?php
+ // Network default.
+ $lang = get_site_option( 'WPLANG' );
+
+ // Use English if the default isn't available.
+ if ( ! in_array( $lang, $languages ) ) {
+ $lang = '';
+ }
+
+ wp_dropdown_languages(
+ array(
+ 'name' => 'WPLANG',
+ 'id' => 'site-language',
+ 'selected' => $lang,
+ 'languages' => $languages,
+ 'translations' => $translations,
+ 'show_available_translations' => current_user_can( 'install_languages' ) && wp_can_install_language_pack(),
+ )
+ );
+ ?>
+ </td>
+ </tr>
+ <?php endif; // Languages. ?>
+ <tr class="form-field form-required">
+ <th scope="row"><label for="admin-email"><?php _e( 'Admin Email' ); ?> <span class="required">*</span></label></th>
+ <td><input name="blog[email]" type="email" class="regular-text wp-suggest-user" id="admin-email" data-autocomplete-type="search" data-autocomplete-field="user_email" aria-describedby="site-admin-email" required /></td>
+ </tr>
+ <tr class="form-field">
+ <td colspan="2" class="td-full"><p id="site-admin-email"><?php _e( 'A new user will be created if the above email address is not in the database.' ); ?><br /><?php _e( 'The username and a link to set the password will be mailed to this email address.' ); ?></p></td>
+ </tr>
+ </table>
+
+ <?php
+ /**
+ * Fires at the end of the new site form in network admin.
+ *
+ * @since 4.5.0
+ */
+ do_action( 'network_site_new_form' );
+
+ submit_button( __( 'Add Site' ), 'primary', 'add-site' );
+ ?>
+ </form>
+</div>
+<?php
+require( ABSPATH . 'wp-admin/admin-footer.php' );
diff --git a/www/crm/wp-admin/network/site-settings.php b/www/crm/wp-admin/network/site-settings.php
new file mode 100644
index 00000000..ab694ec8
--- /dev/null
+++ b/www/crm/wp-admin/network/site-settings.php
@@ -0,0 +1,176 @@
+<?php
+/**
+ * Edit Site Settings Administration Screen
+ *
+ * @package WordPress
+ * @subpackage Multisite
+ * @since 3.1.0
+ */
+
+/** Load WordPress Administration Bootstrap */
+require_once( dirname( __FILE__ ) . '/admin.php' );
+
+if ( ! current_user_can( 'manage_sites' ) ) {
+ wp_die( __( 'Sorry, you are not allowed to edit this site.' ) );
+}
+
+get_current_screen()->add_help_tab( get_site_screen_help_tab_args() );
+get_current_screen()->set_help_sidebar( get_site_screen_help_sidebar_content() );
+
+$id = isset( $_REQUEST['id'] ) ? intval( $_REQUEST['id'] ) : 0;
+
+if ( ! $id ) {
+ wp_die( __( 'Invalid site ID.' ) );
+}
+
+$details = get_site( $id );
+if ( ! $details ) {
+ wp_die( __( 'The requested site does not exist.' ) );
+}
+
+if ( ! can_edit_network( $details->site_id ) ) {
+ wp_die( __( 'Sorry, you are not allowed to access this page.' ), 403 );
+}
+
+$is_main_site = is_main_site( $id );
+
+if ( isset( $_REQUEST['action'] ) && 'update-site' == $_REQUEST['action'] && is_array( $_POST['option'] ) ) {
+ check_admin_referer( 'edit-site' );
+
+ switch_to_blog( $id );
+
+ $skip_options = array( 'allowedthemes' ); // Don't update these options since they are handled elsewhere in the form.
+ foreach ( (array) $_POST['option'] as $key => $val ) {
+ $key = wp_unslash( $key );
+ $val = wp_unslash( $val );
+ if ( $key === 0 || is_array( $val ) || in_array( $key, $skip_options ) ) {
+ continue; // Avoids "0 is a protected WP option and may not be modified" error when edit blog options
+ }
+ update_option( $key, $val );
+ }
+
+ /**
+ * Fires after the site options are updated.
+ *
+ * @since 3.0.0
+ * @since 4.4.0 Added `$id` parameter.
+ *
+ * @param int $id The ID of the site being updated.
+ */
+ do_action( 'wpmu_update_blog_options', $id );
+
+ restore_current_blog();
+ wp_redirect(
+ add_query_arg(
+ array(
+ 'update' => 'updated',
+ 'id' => $id,
+ ),
+ 'site-settings.php'
+ )
+ );
+ exit;
+}
+
+if ( isset( $_GET['update'] ) ) {
+ $messages = array();
+ if ( 'updated' == $_GET['update'] ) {
+ $messages[] = __( 'Site options updated.' );
+ }
+}
+
+/* translators: %s: site name */
+$title = sprintf( __( 'Edit Site: %s' ), esc_html( $details->blogname ) );
+
+$parent_file = 'sites.php';
+$submenu_file = 'sites.php';
+
+require( ABSPATH . 'wp-admin/admin-header.php' );
+
+?>
+
+<div class="wrap">
+<h1 id="edit-site"><?php echo $title; ?></h1>
+<p class="edit-site-actions"><a href="<?php echo esc_url( get_home_url( $id, '/' ) ); ?>"><?php _e( 'Visit' ); ?></a> | <a href="<?php echo esc_url( get_admin_url( $id ) ); ?>"><?php _e( 'Dashboard' ); ?></a></p>
+
+<?php
+
+network_edit_site_nav(
+ array(
+ 'blog_id' => $id,
+ 'selected' => 'site-settings',
+ )
+);
+
+if ( ! empty( $messages ) ) {
+ foreach ( $messages as $msg ) {
+ echo '<div id="message" class="updated notice is-dismissible"><p>' . $msg . '</p></div>';
+ }
+}
+?>
+<form method="post" action="site-settings.php?action=update-site">
+ <?php wp_nonce_field( 'edit-site' ); ?>
+ <input type="hidden" name="id" value="<?php echo esc_attr( $id ); ?>" />
+ <table class="form-table" role="presentation">
+ <?php
+ $blog_prefix = $wpdb->get_blog_prefix( $id );
+ $sql = "SELECT * FROM {$blog_prefix}options
+ WHERE option_name NOT LIKE %s
+ AND option_name NOT LIKE %s";
+ $query = $wpdb->prepare(
+ $sql,
+ $wpdb->esc_like( '_' ) . '%',
+ '%' . $wpdb->esc_like( 'user_roles' )
+ );
+ $options = $wpdb->get_results( $query );
+ foreach ( $options as $option ) {
+ if ( $option->option_name == 'default_role' ) {
+ $editblog_default_role = $option->option_value;
+ }
+ $disabled = false;
+ $class = 'all-options';
+ if ( is_serialized( $option->option_value ) ) {
+ if ( is_serialized_string( $option->option_value ) ) {
+ $option->option_value = esc_html( maybe_unserialize( $option->option_value ) );
+ } else {
+ $option->option_value = 'SERIALIZED DATA';
+ $disabled = true;
+ $class = 'all-options disabled';
+ }
+ }
+ if ( strpos( $option->option_value, "\n" ) !== false ) {
+ ?>
+ <tr class="form-field">
+ <th scope="row"><label for="<?php echo esc_attr( $option->option_name ); ?>"><?php echo ucwords( str_replace( '_', ' ', $option->option_name ) ); ?></label></th>
+ <td><textarea class="<?php echo $class; ?>" rows="5" cols="40" name="option[<?php echo esc_attr( $option->option_name ); ?>]" id="<?php echo esc_attr( $option->option_name ); ?>"<?php disabled( $disabled ); ?>><?php echo esc_textarea( $option->option_value ); ?></textarea></td>
+ </tr>
+ <?php
+ } else {
+ ?>
+ <tr class="form-field">
+ <th scope="row"><label for="<?php echo esc_attr( $option->option_name ); ?>"><?php echo esc_html( ucwords( str_replace( '_', ' ', $option->option_name ) ) ); ?></label></th>
+ <?php if ( $is_main_site && in_array( $option->option_name, array( 'siteurl', 'home' ) ) ) { ?>
+ <td><code><?php echo esc_html( $option->option_value ); ?></code></td>
+ <?php } else { ?>
+ <td><input class="<?php echo $class; ?>" name="option[<?php echo esc_attr( $option->option_name ); ?>]" type="text" id="<?php echo esc_attr( $option->option_name ); ?>" value="<?php echo esc_attr( $option->option_value ); ?>" size="40" <?php disabled( $disabled ); ?> /></td>
+ <?php } ?>
+ </tr>
+ <?php
+ }
+ } // End foreach
+ /**
+ * Fires at the end of the Edit Site form, before the submit button.
+ *
+ * @since 3.0.0
+ *
+ * @param int $id Site ID.
+ */
+ do_action( 'wpmueditblogaction', $id );
+ ?>
+ </table>
+ <?php submit_button(); ?>
+</form>
+
+</div>
+<?php
+require( ABSPATH . 'wp-admin/admin-footer.php' );
diff --git a/www/crm/wp-admin/network/site-themes.php b/www/crm/wp-admin/network/site-themes.php
new file mode 100644
index 00000000..2e533764
--- /dev/null
+++ b/www/crm/wp-admin/network/site-themes.php
@@ -0,0 +1,227 @@
+<?php
+/**
+ * Edit Site Themes Administration Screen
+ *
+ * @package WordPress
+ * @subpackage Multisite
+ * @since 3.1.0
+ */
+
+/** Load WordPress Administration Bootstrap */
+require_once( dirname( __FILE__ ) . '/admin.php' );
+
+if ( ! current_user_can( 'manage_sites' ) ) {
+ wp_die( __( 'Sorry, you are not allowed to manage themes for this site.' ) );
+}
+
+get_current_screen()->add_help_tab( get_site_screen_help_tab_args() );
+get_current_screen()->set_help_sidebar( get_site_screen_help_sidebar_content() );
+
+get_current_screen()->set_screen_reader_content(
+ array(
+ 'heading_views' => __( 'Filter site themes list' ),
+ 'heading_pagination' => __( 'Site themes list navigation' ),
+ 'heading_list' => __( 'Site themes list' ),
+ )
+);
+
+$wp_list_table = _get_list_table( 'WP_MS_Themes_List_Table' );
+
+$action = $wp_list_table->current_action();
+
+$s = isset( $_REQUEST['s'] ) ? $_REQUEST['s'] : '';
+
+// Clean up request URI from temporary args for screen options/paging uri's to work as expected.
+$temp_args = array( 'enabled', 'disabled', 'error' );
+$_SERVER['REQUEST_URI'] = remove_query_arg( $temp_args, $_SERVER['REQUEST_URI'] );
+$referer = remove_query_arg( $temp_args, wp_get_referer() );
+
+if ( ! empty( $_REQUEST['paged'] ) ) {
+ $referer = add_query_arg( 'paged', (int) $_REQUEST['paged'], $referer );
+}
+
+$id = isset( $_REQUEST['id'] ) ? intval( $_REQUEST['id'] ) : 0;
+
+if ( ! $id ) {
+ wp_die( __( 'Invalid site ID.' ) );
+}
+
+$wp_list_table->prepare_items();
+
+$details = get_site( $id );
+if ( ! $details ) {
+ wp_die( __( 'The requested site does not exist.' ) );
+}
+
+if ( ! can_edit_network( $details->site_id ) ) {
+ wp_die( __( 'Sorry, you are not allowed to access this page.' ), 403 );
+}
+
+$is_main_site = is_main_site( $id );
+
+if ( $action ) {
+ switch_to_blog( $id );
+ $allowed_themes = get_option( 'allowedthemes' );
+
+ switch ( $action ) {
+ case 'enable':
+ check_admin_referer( 'enable-theme_' . $_GET['theme'] );
+ $theme = $_GET['theme'];
+ $action = 'enabled';
+ $n = 1;
+ if ( ! $allowed_themes ) {
+ $allowed_themes = array( $theme => true );
+ } else {
+ $allowed_themes[ $theme ] = true;
+ }
+ break;
+ case 'disable':
+ check_admin_referer( 'disable-theme_' . $_GET['theme'] );
+ $theme = $_GET['theme'];
+ $action = 'disabled';
+ $n = 1;
+ if ( ! $allowed_themes ) {
+ $allowed_themes = array();
+ } else {
+ unset( $allowed_themes[ $theme ] );
+ }
+ break;
+ case 'enable-selected':
+ check_admin_referer( 'bulk-themes' );
+ if ( isset( $_POST['checked'] ) ) {
+ $themes = (array) $_POST['checked'];
+ $action = 'enabled';
+ $n = count( $themes );
+ foreach ( (array) $themes as $theme ) {
+ $allowed_themes[ $theme ] = true;
+ }
+ } else {
+ $action = 'error';
+ $n = 'none';
+ }
+ break;
+ case 'disable-selected':
+ check_admin_referer( 'bulk-themes' );
+ if ( isset( $_POST['checked'] ) ) {
+ $themes = (array) $_POST['checked'];
+ $action = 'disabled';
+ $n = count( $themes );
+ foreach ( (array) $themes as $theme ) {
+ unset( $allowed_themes[ $theme ] );
+ }
+ } else {
+ $action = 'error';
+ $n = 'none';
+ }
+ break;
+ default:
+ if ( isset( $_POST['checked'] ) ) {
+ check_admin_referer( 'bulk-themes' );
+ $themes = (array) $_POST['checked'];
+ $n = count( $themes );
+ $screen = get_current_screen()->id;
+
+ /**
+ * Fires when a custom bulk action should be handled.
+ *
+ * The redirect link should be modified with success or failure feedback
+ * from the action to be used to display feedback to the user.
+ *
+ * The dynamic portion of the hook name, `$screen`, refers to the current screen ID.
+ *
+ * @since 4.7.0
+ *
+ * @param string $redirect_url The redirect URL.
+ * @param string $action The action being taken.
+ * @param array $items The items to take the action on.
+ * @param int $site_id The site ID.
+ */
+ $referer = apply_filters( "handle_network_bulk_actions-{$screen}", $referer, $action, $themes, $id );
+ } else {
+ $action = 'error';
+ $n = 'none';
+ }
+ }
+
+ update_option( 'allowedthemes', $allowed_themes );
+ restore_current_blog();
+
+ wp_safe_redirect(
+ add_query_arg(
+ array(
+ 'id' => $id,
+ $action => $n,
+ ),
+ $referer
+ )
+ );
+ exit;
+}
+
+if ( isset( $_GET['action'] ) && 'update-site' == $_GET['action'] ) {
+ wp_safe_redirect( $referer );
+ exit();
+}
+
+add_thickbox();
+add_screen_option( 'per_page' );
+
+/* translators: %s: site name */
+$title = sprintf( __( 'Edit Site: %s' ), esc_html( $details->blogname ) );
+
+$parent_file = 'sites.php';
+$submenu_file = 'sites.php';
+
+require( ABSPATH . 'wp-admin/admin-header.php' ); ?>
+
+<div class="wrap">
+<h1 id="edit-site"><?php echo $title; ?></h1>
+<p class="edit-site-actions"><a href="<?php echo esc_url( get_home_url( $id, '/' ) ); ?>"><?php _e( 'Visit' ); ?></a> | <a href="<?php echo esc_url( get_admin_url( $id ) ); ?>"><?php _e( 'Dashboard' ); ?></a></p>
+<?php
+
+network_edit_site_nav(
+ array(
+ 'blog_id' => $id,
+ 'selected' => 'site-themes',
+ )
+);
+
+if ( isset( $_GET['enabled'] ) ) {
+ $enabled = absint( $_GET['enabled'] );
+ if ( 1 == $enabled ) {
+ $message = __( 'Theme enabled.' );
+ } else {
+ $message = _n( '%s theme enabled.', '%s themes enabled.', $enabled );
+ }
+ echo '<div id="message" class="updated notice is-dismissible"><p>' . sprintf( $message, number_format_i18n( $enabled ) ) . '</p></div>';
+} elseif ( isset( $_GET['disabled'] ) ) {
+ $disabled = absint( $_GET['disabled'] );
+ if ( 1 == $disabled ) {
+ $message = __( 'Theme disabled.' );
+ } else {
+ $message = _n( '%s theme disabled.', '%s themes disabled.', $disabled );
+ }
+ echo '<div id="message" class="updated notice is-dismissible"><p>' . sprintf( $message, number_format_i18n( $disabled ) ) . '</p></div>';
+} elseif ( isset( $_GET['error'] ) && 'none' == $_GET['error'] ) {
+ echo '<div id="message" class="error notice is-dismissible"><p>' . __( 'No theme selected.' ) . '</p></div>';
+}
+?>
+
+<p><?php _e( 'Network enabled themes are not shown on this screen.' ); ?></p>
+
+<form method="get">
+<?php $wp_list_table->search_box( __( 'Search Installed Themes' ), 'theme' ); ?>
+<input type="hidden" name="id" value="<?php echo esc_attr( $id ); ?>" />
+</form>
+
+<?php $wp_list_table->views(); ?>
+
+<form method="post" action="site-themes.php?action=update-site">
+ <input type="hidden" name="id" value="<?php echo esc_attr( $id ); ?>" />
+
+<?php $wp_list_table->display(); ?>
+
+</form>
+
+</div>
+<?php include( ABSPATH . 'wp-admin/admin-footer.php' ); ?>
diff --git a/www/crm/wp-admin/network/site-users.php b/www/crm/wp-admin/network/site-users.php
new file mode 100644
index 00000000..06dd68c2
--- /dev/null
+++ b/www/crm/wp-admin/network/site-users.php
@@ -0,0 +1,366 @@
+<?php
+/**
+ * Edit Site Users Administration Screen
+ *
+ * @package WordPress
+ * @subpackage Multisite
+ * @since 3.1.0
+ */
+
+/** Load WordPress Administration Bootstrap */
+require_once( dirname( __FILE__ ) . '/admin.php' );
+
+if ( ! current_user_can( 'manage_sites' ) ) {
+ wp_die( __( 'Sorry, you are not allowed to edit this site.' ), 403 );
+}
+
+$wp_list_table = _get_list_table( 'WP_Users_List_Table' );
+$wp_list_table->prepare_items();
+
+get_current_screen()->add_help_tab( get_site_screen_help_tab_args() );
+get_current_screen()->set_help_sidebar( get_site_screen_help_sidebar_content() );
+
+get_current_screen()->set_screen_reader_content(
+ array(
+ 'heading_views' => __( 'Filter site users list' ),
+ 'heading_pagination' => __( 'Site users list navigation' ),
+ 'heading_list' => __( 'Site users list' ),
+ )
+);
+
+$_SERVER['REQUEST_URI'] = remove_query_arg( 'update', $_SERVER['REQUEST_URI'] );
+$referer = remove_query_arg( 'update', wp_get_referer() );
+
+if ( ! empty( $_REQUEST['paged'] ) ) {
+ $referer = add_query_arg( 'paged', (int) $_REQUEST['paged'], $referer );
+}
+
+$id = isset( $_REQUEST['id'] ) ? intval( $_REQUEST['id'] ) : 0;
+
+if ( ! $id ) {
+ wp_die( __( 'Invalid site ID.' ) );
+}
+
+$details = get_site( $id );
+if ( ! $details ) {
+ wp_die( __( 'The requested site does not exist.' ) );
+}
+
+if ( ! can_edit_network( $details->site_id ) ) {
+ wp_die( __( 'Sorry, you are not allowed to access this page.' ), 403 );
+}
+
+$is_main_site = is_main_site( $id );
+
+switch_to_blog( $id );
+
+$action = $wp_list_table->current_action();
+
+if ( $action ) {
+
+ switch ( $action ) {
+ case 'newuser':
+ check_admin_referer( 'add-user', '_wpnonce_add-new-user' );
+ $user = $_POST['user'];
+ if ( ! is_array( $_POST['user'] ) || empty( $user['username'] ) || empty( $user['email'] ) ) {
+ $update = 'err_new';
+ } else {
+ $password = wp_generate_password( 12, false );
+ $user_id = wpmu_create_user( esc_html( strtolower( $user['username'] ) ), $password, esc_html( $user['email'] ) );
+
+ if ( false === $user_id ) {
+ $update = 'err_new_dup';
+ } else {
+ $result = add_user_to_blog( $id, $user_id, $_POST['new_role'] );
+
+ if ( is_wp_error( $result ) ) {
+ $update = 'err_add_fail';
+ } else {
+ $update = 'newuser';
+ /**
+ * Fires after a user has been created via the network site-users.php page.
+ *
+ * @since 4.4.0
+ *
+ * @param int $user_id ID of the newly created user.
+ */
+ do_action( 'network_site_users_created_user', $user_id );
+ }
+ }
+ }
+ break;
+
+ case 'adduser':
+ check_admin_referer( 'add-user', '_wpnonce_add-user' );
+ if ( ! empty( $_POST['newuser'] ) ) {
+ $update = 'adduser';
+ $newuser = $_POST['newuser'];
+ $user = get_user_by( 'login', $newuser );
+ if ( $user && $user->exists() ) {
+ if ( ! is_user_member_of_blog( $user->ID, $id ) ) {
+ $result = add_user_to_blog( $id, $user->ID, $_POST['new_role'] );
+
+ if ( is_wp_error( $result ) ) {
+ $update = 'err_add_fail';
+ }
+ } else {
+ $update = 'err_add_member';
+ }
+ } else {
+ $update = 'err_add_notfound';
+ }
+ } else {
+ $update = 'err_add_notfound';
+ }
+ break;
+
+ case 'remove':
+ if ( ! current_user_can( 'remove_users' ) ) {
+ wp_die( __( 'Sorry, you are not allowed to remove users.' ), 403 );
+ }
+
+ check_admin_referer( 'bulk-users' );
+
+ $update = 'remove';
+ if ( isset( $_REQUEST['users'] ) ) {
+ $userids = $_REQUEST['users'];
+
+ foreach ( $userids as $user_id ) {
+ $user_id = (int) $user_id;
+ remove_user_from_blog( $user_id, $id );
+ }
+ } elseif ( isset( $_GET['user'] ) ) {
+ remove_user_from_blog( $_GET['user'] );
+ } else {
+ $update = 'err_remove';
+ }
+ break;
+
+ case 'promote':
+ check_admin_referer( 'bulk-users' );
+ $editable_roles = get_editable_roles();
+ $role = false;
+ if ( ! empty( $_REQUEST['new_role2'] ) ) {
+ $role = $_REQUEST['new_role2'];
+ } elseif ( ! empty( $_REQUEST['new_role'] ) ) {
+ $role = $_REQUEST['new_role'];
+ }
+
+ if ( empty( $editable_roles[ $role ] ) ) {
+ wp_die( __( 'Sorry, you are not allowed to give users that role.' ), 403 );
+ }
+
+ if ( isset( $_REQUEST['users'] ) ) {
+ $userids = $_REQUEST['users'];
+ $update = 'promote';
+ foreach ( $userids as $user_id ) {
+ $user_id = (int) $user_id;
+
+ // If the user doesn't already belong to the blog, bail.
+ if ( ! is_user_member_of_blog( $user_id ) ) {
+ wp_die(
+ '<h1>' . __( 'Something went wrong.' ) . '</h1>' .
+ '<p>' . __( 'One of the selected users is not a member of this site.' ) . '</p>',
+ 403
+ );
+ }
+
+ $user = get_userdata( $user_id );
+ $user->set_role( $role );
+ }
+ } else {
+ $update = 'err_promote';
+ }
+ break;
+ default:
+ if ( ! isset( $_REQUEST['users'] ) ) {
+ break;
+ }
+ check_admin_referer( 'bulk-users' );
+ $userids = $_REQUEST['users'];
+ /** This action is documented in wp-admin/network/site-themes.php */
+ $referer = apply_filters( 'handle_network_bulk_actions-' . get_current_screen()->id, $referer, $action, $userids, $id );
+ $update = $action;
+ break;
+ }
+
+ wp_safe_redirect( add_query_arg( 'update', $update, $referer ) );
+ exit();
+}
+
+restore_current_blog();
+
+if ( isset( $_GET['action'] ) && 'update-site' == $_GET['action'] ) {
+ wp_safe_redirect( $referer );
+ exit();
+}
+
+add_screen_option( 'per_page' );
+
+/* translators: %s: site name */
+$title = sprintf( __( 'Edit Site: %s' ), esc_html( $details->blogname ) );
+
+$parent_file = 'sites.php';
+$submenu_file = 'sites.php';
+
+/**
+ * Filters whether to show the Add Existing User form on the Multisite Users screen.
+ *
+ * @since 3.1.0
+ *
+ * @param bool $bool Whether to show the Add Existing User form. Default true.
+ */
+if ( ! wp_is_large_network( 'users' ) && apply_filters( 'show_network_site_users_add_existing_form', true ) ) {
+ wp_enqueue_script( 'user-suggest' );
+}
+
+require( ABSPATH . 'wp-admin/admin-header.php' ); ?>
+
+<script type="text/javascript">
+var current_site_id = <?php echo $id; ?>;
+</script>
+
+
+<div class="wrap">
+<h1 id="edit-site"><?php echo $title; ?></h1>
+<p class="edit-site-actions"><a href="<?php echo esc_url( get_home_url( $id, '/' ) ); ?>"><?php _e( 'Visit' ); ?></a> | <a href="<?php echo esc_url( get_admin_url( $id ) ); ?>"><?php _e( 'Dashboard' ); ?></a></p>
+<?php
+
+network_edit_site_nav(
+ array(
+ 'blog_id' => $id,
+ 'selected' => 'site-users',
+ )
+);
+
+if ( isset( $_GET['update'] ) ) :
+ switch ( $_GET['update'] ) {
+ case 'adduser':
+ echo '<div id="message" class="updated notice is-dismissible"><p>' . __( 'User added.' ) . '</p></div>';
+ break;
+ case 'err_add_member':
+ echo '<div id="message" class="error notice is-dismissible"><p>' . __( 'User is already a member of this site.' ) . '</p></div>';
+ break;
+ case 'err_add_fail':
+ echo '<div id="message" class="error notice is-dismissible"><p>' . __( 'User could not be added to this site.' ) . '</p></div>';
+ break;
+ case 'err_add_notfound':
+ echo '<div id="message" class="error notice is-dismissible"><p>' . __( 'Enter the username of an existing user.' ) . '</p></div>';
+ break;
+ case 'promote':
+ echo '<div id="message" class="updated notice is-dismissible"><p>' . __( 'Changed roles.' ) . '</p></div>';
+ break;
+ case 'err_promote':
+ echo '<div id="message" class="error notice is-dismissible"><p>' . __( 'Select a user to change role.' ) . '</p></div>';
+ break;
+ case 'remove':
+ echo '<div id="message" class="updated notice is-dismissible"><p>' . __( 'User removed from this site.' ) . '</p></div>';
+ break;
+ case 'err_remove':
+ echo '<div id="message" class="error notice is-dismissible"><p>' . __( 'Select a user to remove.' ) . '</p></div>';
+ break;
+ case 'newuser':
+ echo '<div id="message" class="updated notice is-dismissible"><p>' . __( 'User created.' ) . '</p></div>';
+ break;
+ case 'err_new':
+ echo '<div id="message" class="error notice is-dismissible"><p>' . __( 'Enter the username and email.' ) . '</p></div>';
+ break;
+ case 'err_new_dup':
+ echo '<div id="message" class="error notice is-dismissible"><p>' . __( 'Duplicated username or email address.' ) . '</p></div>';
+ break;
+ }
+endif;
+?>
+
+<form class="search-form" method="get">
+<?php $wp_list_table->search_box( __( 'Search Users' ), 'user' ); ?>
+<input type="hidden" name="id" value="<?php echo esc_attr( $id ); ?>" />
+</form>
+
+<?php $wp_list_table->views(); ?>
+
+<form method="post" action="site-users.php?action=update-site">
+ <input type="hidden" name="id" value="<?php echo esc_attr( $id ); ?>" />
+
+<?php $wp_list_table->display(); ?>
+
+</form>
+
+<?php
+/**
+ * Fires after the list table on the Users screen in the Multisite Network Admin.
+ *
+ * @since 3.1.0
+ */
+do_action( 'network_site_users_after_list_table' );
+
+/** This filter is documented in wp-admin/network/site-users.php */
+if ( current_user_can( 'promote_users' ) && apply_filters( 'show_network_site_users_add_existing_form', true ) ) :
+ ?>
+<h2 id="add-existing-user"><?php _e( 'Add Existing User' ); ?></h2>
+<form action="site-users.php?action=adduser" id="adduser" method="post">
+ <input type="hidden" name="id" value="<?php echo esc_attr( $id ); ?>" />
+ <table class="form-table" role="presentation">
+ <tr>
+ <th scope="row"><label for="newuser"><?php _e( 'Username' ); ?></label></th>
+ <td><input type="text" class="regular-text wp-suggest-user" name="newuser" id="newuser" /></td>
+ </tr>
+ <tr>
+ <th scope="row"><label for="new_role_adduser"><?php _e( 'Role' ); ?></label></th>
+ <td><select name="new_role" id="new_role_adduser">
+ <?php
+ switch_to_blog( $id );
+ wp_dropdown_roles( get_option( 'default_role' ) );
+ restore_current_blog();
+ ?>
+ </select></td>
+ </tr>
+ </table>
+ <?php wp_nonce_field( 'add-user', '_wpnonce_add-user' ); ?>
+ <?php submit_button( __( 'Add User' ), 'primary', 'add-user', true, array( 'id' => 'submit-add-existing-user' ) ); ?>
+</form>
+<?php endif; ?>
+
+<?php
+/**
+ * Filters whether to show the Add New User form on the Multisite Users screen.
+ *
+ * @since 3.1.0
+ *
+ * @param bool $bool Whether to show the Add New User form. Default true.
+ */
+if ( current_user_can( 'create_users' ) && apply_filters( 'show_network_site_users_add_new_form', true ) ) :
+ ?>
+<h2 id="add-new-user"><?php _e( 'Add New User' ); ?></h2>
+<form action="<?php echo network_admin_url( 'site-users.php?action=newuser' ); ?>" id="newuser" method="post">
+ <input type="hidden" name="id" value="<?php echo esc_attr( $id ); ?>" />
+ <table class="form-table" role="presentation">
+ <tr>
+ <th scope="row"><label for="user_username"><?php _e( 'Username' ); ?></label></th>
+ <td><input type="text" class="regular-text" name="user[username]" id="user_username" /></td>
+ </tr>
+ <tr>
+ <th scope="row"><label for="user_email"><?php _e( 'Email' ); ?></label></th>
+ <td><input type="text" class="regular-text" name="user[email]" id="user_email" /></td>
+ </tr>
+ <tr>
+ <th scope="row"><label for="new_role_newuser"><?php _e( 'Role' ); ?></label></th>
+ <td><select name="new_role" id="new_role_newuser">
+ <?php
+ switch_to_blog( $id );
+ wp_dropdown_roles( get_option( 'default_role' ) );
+ restore_current_blog();
+ ?>
+ </select></td>
+ </tr>
+ <tr class="form-field">
+ <td colspan="2" class="td-full"><?php _e( 'A password reset link will be sent to the user via email.' ); ?></td>
+ </tr>
+ </table>
+ <?php wp_nonce_field( 'add-user', '_wpnonce_add-new-user' ); ?>
+ <?php submit_button( __( 'Add New User' ), 'primary', 'add-user', true, array( 'id' => 'submit-add-user' ) ); ?>
+</form>
+<?php endif; ?>
+</div>
+<?php
+require( ABSPATH . 'wp-admin/admin-footer.php' );
diff --git a/www/crm/wp-admin/network/sites.php b/www/crm/wp-admin/network/sites.php
new file mode 100644
index 00000000..6c2de158
--- /dev/null
+++ b/www/crm/wp-admin/network/sites.php
@@ -0,0 +1,371 @@
+<?php
+/**
+ * Multisite sites administration panel.
+ *
+ * @package WordPress
+ * @subpackage Multisite
+ * @since 3.0.0
+ */
+
+/** Load WordPress Administration Bootstrap */
+require_once( dirname( __FILE__ ) . '/admin.php' );
+
+if ( ! current_user_can( 'manage_sites' ) ) {
+ wp_die( __( 'Sorry, you are not allowed to access this page.' ), 403 );
+}
+
+$wp_list_table = _get_list_table( 'WP_MS_Sites_List_Table' );
+$pagenum = $wp_list_table->get_pagenum();
+
+$title = __( 'Sites' );
+$parent_file = 'sites.php';
+
+add_screen_option( 'per_page' );
+
+get_current_screen()->add_help_tab(
+ array(
+ 'id' => 'overview',
+ 'title' => __( 'Overview' ),
+ 'content' =>
+ '<p>' . __( 'Add New takes you to the Add New Site screen. You can search for a site by Name, ID number, or IP address. Screen Options allows you to choose how many sites to display on one page.' ) . '</p>' .
+ '<p>' . __( 'This is the main table of all sites on this network. Switch between list and excerpt views by using the icons above the right side of the table.' ) . '</p>' .
+ '<p>' . __( 'Hovering over each site reveals seven options (three for the primary site):' ) . '</p>' .
+ '<ul><li>' . __( 'An Edit link to a separate Edit Site screen.' ) . '</li>' .
+ '<li>' . __( 'Dashboard leads to the Dashboard for that site.' ) . '</li>' .
+ '<li>' . __( 'Deactivate, Archive, and Spam which lead to confirmation screens. These actions can be reversed later.' ) . '</li>' .
+ '<li>' . __( 'Delete which is a permanent action after the confirmation screens.' ) . '</li>' .
+ '<li>' . __( 'Visit to go to the front-end site live.' ) . '</li></ul>' .
+ '<p>' . __( 'The site ID is used internally, and is not shown on the front end of the site or to users/viewers.' ) . '</p>' .
+ '<p>' . __( 'Clicking on bold headings can re-sort this table.' ) . '</p>',
+ )
+);
+
+get_current_screen()->set_help_sidebar(
+ '<p><strong>' . __( 'For more information:' ) . '</strong></p>' .
+ '<p>' . __( '<a href="https://codex.wordpress.org/Network_Admin_Sites_Screen">Documentation on Site Management</a>' ) . '</p>' .
+ '<p>' . __( '<a href="https://wordpress.org/support/forum/multisite/">Support Forums</a>' ) . '</p>'
+);
+
+get_current_screen()->set_screen_reader_content(
+ array(
+ 'heading_pagination' => __( 'Sites list navigation' ),
+ 'heading_list' => __( 'Sites list' ),
+ )
+);
+
+$id = isset( $_REQUEST['id'] ) ? intval( $_REQUEST['id'] ) : 0;
+
+if ( isset( $_GET['action'] ) ) {
+ /** This action is documented in wp-admin/network/edit.php */
+ do_action( 'wpmuadminedit' );
+
+ // A list of valid actions and their associated messaging for confirmation output.
+ $manage_actions = array(
+ 'activateblog' => __( 'You are about to activate the site %s.' ),
+ 'deactivateblog' => __( 'You are about to deactivate the site %s.' ),
+ 'unarchiveblog' => __( 'You are about to unarchive the site %s.' ),
+ 'archiveblog' => __( 'You are about to archive the site %s.' ),
+ 'unspamblog' => __( 'You are about to unspam the site %s.' ),
+ 'spamblog' => __( 'You are about to mark the site %s as spam.' ),
+ 'deleteblog' => __( 'You are about to delete the site %s.' ),
+ 'unmatureblog' => __( 'You are about to mark the site %s as mature.' ),
+ 'matureblog' => __( 'You are about to mark the site %s as not mature.' ),
+ );
+
+ if ( 'confirm' === $_GET['action'] ) {
+ // The action2 parameter contains the action being taken on the site.
+ $site_action = $_GET['action2'];
+
+ if ( ! array_key_exists( $site_action, $manage_actions ) ) {
+ wp_die( __( 'The requested action is not valid.' ) );
+ }
+
+ // The mature/unmature UI exists only as external code. Check the "confirm" nonce for backward compatibility.
+ if ( 'matureblog' === $site_action || 'unmatureblog' === $site_action ) {
+ check_admin_referer( 'confirm' );
+ } else {
+ check_admin_referer( $site_action . '_' . $id );
+ }
+
+ if ( ! headers_sent() ) {
+ nocache_headers();
+ header( 'Content-Type: text/html; charset=utf-8' );
+ }
+
+ if ( get_network()->site_id == $id ) {
+ wp_die( __( 'Sorry, you are not allowed to change the current site.' ) );
+ }
+
+ $site_details = get_site( $id );
+ $site_address = untrailingslashit( $site_details->domain . $site_details->path );
+
+ require_once( ABSPATH . 'wp-admin/admin-header.php' );
+ ?>
+ <div class="wrap">
+ <h1><?php _e( 'Confirm your action' ); ?></h1>
+ <form action="sites.php?action=<?php echo esc_attr( $site_action ); ?>" method="post">
+ <input type="hidden" name="action" value="<?php echo esc_attr( $site_action ); ?>" />
+ <input type="hidden" name="id" value="<?php echo esc_attr( $id ); ?>" />
+ <input type="hidden" name="_wp_http_referer" value="<?php echo esc_attr( wp_get_referer() ); ?>" />
+ <?php wp_nonce_field( $site_action . '_' . $id, '_wpnonce', false ); ?>
+ <p><?php echo sprintf( $manage_actions[ $site_action ], $site_address ); ?></p>
+ <?php submit_button( __( 'Confirm' ), 'primary' ); ?>
+ </form>
+ </div>
+ <?php
+ require_once( ABSPATH . 'wp-admin/admin-footer.php' );
+ exit();
+ } elseif ( array_key_exists( $_GET['action'], $manage_actions ) ) {
+ $action = $_GET['action'];
+ check_admin_referer( $action . '_' . $id );
+ } elseif ( 'allblogs' === $_GET['action'] ) {
+ check_admin_referer( 'bulk-sites' );
+ }
+
+ $updated_action = '';
+
+ switch ( $_GET['action'] ) {
+
+ case 'deleteblog':
+ if ( ! current_user_can( 'delete_sites' ) ) {
+ wp_die( __( 'Sorry, you are not allowed to access this page.' ), '', array( 'response' => 403 ) );
+ }
+
+ $updated_action = 'not_deleted';
+ if ( $id != '0' && $id != get_network()->site_id && current_user_can( 'delete_site', $id ) ) {
+ wpmu_delete_blog( $id, true );
+ $updated_action = 'delete';
+ }
+ break;
+
+ case 'delete_sites':
+ check_admin_referer( 'ms-delete-sites' );
+
+ foreach ( (array) $_POST['site_ids'] as $site_id ) {
+ $site_id = (int) $site_id;
+
+ if ( $site_id == get_network()->site_id ) {
+ continue;
+ }
+
+ if ( ! current_user_can( 'delete_site', $site_id ) ) {
+ $site = get_site( $site_id );
+ $site_address = untrailingslashit( $site->domain . $site->path );
+
+ wp_die( sprintf( __( 'Sorry, you are not allowed to delete the site %s.' ), $site_address ), 403 );
+ }
+
+ $updated_action = 'all_delete';
+ wpmu_delete_blog( $site_id, true );
+ }
+ break;
+
+ case 'allblogs':
+ if ( ( isset( $_POST['action'] ) || isset( $_POST['action2'] ) ) && isset( $_POST['allblogs'] ) ) {
+ $doaction = $_POST['action'] != -1 ? $_POST['action'] : $_POST['action2'];
+
+ foreach ( (array) $_POST['allblogs'] as $key => $val ) {
+ if ( $val != '0' && $val != get_network()->site_id ) {
+ switch ( $doaction ) {
+ case 'delete':
+ require_once( ABSPATH . 'wp-admin/admin-header.php' );
+ ?>
+ <div class="wrap">
+ <h1><?php _e( 'Confirm your action' ); ?></h1>
+ <form action="sites.php?action=delete_sites" method="post">
+ <input type="hidden" name="action" value="delete_sites" />
+ <input type="hidden" name="_wp_http_referer" value="<?php echo esc_attr( wp_get_referer() ); ?>" />
+ <?php wp_nonce_field( 'ms-delete-sites', '_wpnonce', false ); ?>
+ <p><?php _e( 'You are about to delete the following sites:' ); ?></p>
+ <ul class="ul-disc">
+ <?php
+ foreach ( $_POST['allblogs'] as $site_id ) :
+ $site = get_site( $site_id );
+ $site_address = untrailingslashit( $site->domain . $site->path );
+ ?>
+ <li>
+ <?php echo $site_address; ?>
+ <input type="hidden" name="site_ids[]" value="<?php echo (int) $site_id; ?>" />
+ </li>
+ <?php endforeach; ?>
+ </ul>
+ <?php submit_button( __( 'Confirm' ), 'primary' ); ?>
+ </form>
+ </div>
+ <?php
+ require_once( ABSPATH . 'wp-admin/admin-footer.php' );
+ exit();
+ break;
+
+ case 'spam':
+ case 'notspam':
+ $updated_action = ( 'spam' === $doaction ) ? 'all_spam' : 'all_notspam';
+ update_blog_status( $val, 'spam', ( 'spam' === $doaction ) ? '1' : '0' );
+ break;
+ }
+ } else {
+ wp_die( __( 'Sorry, you are not allowed to change the current site.' ) );
+ }
+ }
+ if ( ! in_array( $doaction, array( 'delete', 'spam', 'notspam' ), true ) ) {
+ $redirect_to = wp_get_referer();
+ $blogs = (array) $_POST['allblogs'];
+ /** This action is documented in wp-admin/network/site-themes.php */
+ $redirect_to = apply_filters( 'handle_network_bulk_actions-' . get_current_screen()->id, $redirect_to, $doaction, $blogs, $id );
+ wp_safe_redirect( $redirect_to );
+ exit();
+ }
+ } else {
+ $location = network_admin_url( 'sites.php' );
+ if ( ! empty( $_REQUEST['paged'] ) ) {
+ $location = add_query_arg( 'paged', (int) $_REQUEST['paged'], $location );
+ }
+ wp_redirect( $location );
+ exit();
+ }
+ break;
+
+ case 'archiveblog':
+ case 'unarchiveblog':
+ update_blog_status( $id, 'archived', ( 'archiveblog' === $_GET['action'] ) ? '1' : '0' );
+ break;
+
+ case 'activateblog':
+ update_blog_status( $id, 'deleted', '0' );
+
+ /**
+ * Fires after a network site is activated.
+ *
+ * @since MU (3.0.0)
+ *
+ * @param string $id The ID of the activated site.
+ */
+ do_action( 'activate_blog', $id );
+ break;
+
+ case 'deactivateblog':
+ /**
+ * Fires before a network site is deactivated.
+ *
+ * @since MU (3.0.0)
+ *
+ * @param string $id The ID of the site being deactivated.
+ */
+ do_action( 'deactivate_blog', $id );
+ update_blog_status( $id, 'deleted', '1' );
+ break;
+
+ case 'unspamblog':
+ case 'spamblog':
+ update_blog_status( $id, 'spam', ( 'spamblog' === $_GET['action'] ) ? '1' : '0' );
+ break;
+
+ case 'unmatureblog':
+ case 'matureblog':
+ update_blog_status( $id, 'mature', ( 'matureblog' === $_GET['action'] ) ? '1' : '0' );
+ break;
+ }
+
+ if ( empty( $updated_action ) && array_key_exists( $_GET['action'], $manage_actions ) ) {
+ $updated_action = $_GET['action'];
+ }
+
+ if ( ! empty( $updated_action ) ) {
+ wp_safe_redirect( add_query_arg( array( 'updated' => $updated_action ), wp_get_referer() ) );
+ exit();
+ }
+}
+
+$msg = '';
+if ( isset( $_GET['updated'] ) ) {
+ $action = $_GET['updated'];
+
+ switch ( $action ) {
+ case 'all_notspam':
+ $msg = __( 'Sites removed from spam.' );
+ break;
+ case 'all_spam':
+ $msg = __( 'Sites marked as spam.' );
+ break;
+ case 'all_delete':
+ $msg = __( 'Sites deleted.' );
+ break;
+ case 'delete':
+ $msg = __( 'Site deleted.' );
+ break;
+ case 'not_deleted':
+ $msg = __( 'Sorry, you are not allowed to delete that site.' );
+ break;
+ case 'archiveblog':
+ $msg = __( 'Site archived.' );
+ break;
+ case 'unarchiveblog':
+ $msg = __( 'Site unarchived.' );
+ break;
+ case 'activateblog':
+ $msg = __( 'Site activated.' );
+ break;
+ case 'deactivateblog':
+ $msg = __( 'Site deactivated.' );
+ break;
+ case 'unspamblog':
+ $msg = __( 'Site removed from spam.' );
+ break;
+ case 'spamblog':
+ $msg = __( 'Site marked as spam.' );
+ break;
+ default:
+ /**
+ * Filters a specific, non-default, site-updated message in the Network admin.
+ *
+ * The dynamic portion of the hook name, `$action`, refers to the non-default
+ * site update action.
+ *
+ * @since 3.1.0
+ *
+ * @param string $msg The update message. Default 'Settings saved'.
+ */
+ $msg = apply_filters( "network_sites_updated_message_{$action}", __( 'Settings saved.' ) );
+ break;
+ }
+
+ if ( ! empty( $msg ) ) {
+ $msg = '<div id="message" class="updated notice is-dismissible"><p>' . $msg . '</p></div>';
+ }
+}
+
+$wp_list_table->prepare_items();
+
+require_once( ABSPATH . 'wp-admin/admin-header.php' );
+?>
+
+<div class="wrap">
+<h1 class="wp-heading-inline"><?php _e( 'Sites' ); ?></h1>
+
+<?php if ( current_user_can( 'create_sites' ) ) : ?>
+ <a href="<?php echo network_admin_url( 'site-new.php' ); ?>" class="page-title-action"><?php echo esc_html_x( 'Add New', 'site' ); ?></a>
+<?php endif; ?>
+
+<?php
+if ( isset( $_REQUEST['s'] ) && strlen( $_REQUEST['s'] ) ) {
+ /* translators: %s: search keywords */
+ printf( '<span class="subtitle">' . __( 'Search results for &#8220;%s&#8221;' ) . '</span>', esc_html( $s ) );
+}
+?>
+
+<hr class="wp-header-end">
+
+<?php echo $msg; ?>
+
+<form method="get" id="ms-search" class="wp-clearfix">
+<?php $wp_list_table->search_box( __( 'Search Sites' ), 'site' ); ?>
+<input type="hidden" name="action" value="blogs" />
+</form>
+
+<form id="form-site-list" action="sites.php?action=allblogs" method="post">
+ <?php $wp_list_table->display(); ?>
+</form>
+</div>
+<?php
+
+require_once( ABSPATH . 'wp-admin/admin-footer.php' ); ?>
diff --git a/www/crm/wp-admin/network/theme-editor.php b/www/crm/wp-admin/network/theme-editor.php
new file mode 100644
index 00000000..c28c9675
--- /dev/null
+++ b/www/crm/wp-admin/network/theme-editor.php
@@ -0,0 +1,13 @@
+<?php
+/**
+ * Theme editor network administration panel.
+ *
+ * @package WordPress
+ * @subpackage Multisite
+ * @since 3.1.0
+ */
+
+/** Load WordPress Administration Bootstrap */
+require_once( dirname( __FILE__ ) . '/admin.php' );
+
+require( ABSPATH . 'wp-admin/theme-editor.php' );
diff --git a/www/crm/wp-admin/network/theme-install.php b/www/crm/wp-admin/network/theme-install.php
new file mode 100644
index 00000000..486c7478
--- /dev/null
+++ b/www/crm/wp-admin/network/theme-install.php
@@ -0,0 +1,17 @@
+<?php
+/**
+ * Install theme network administration panel.
+ *
+ * @package WordPress
+ * @subpackage Multisite
+ * @since 3.1.0
+ */
+
+if ( isset( $_GET['tab'] ) && ( 'theme-information' == $_GET['tab'] ) ) {
+ define( 'IFRAME_REQUEST', true );
+}
+
+/** Load WordPress Administration Bootstrap */
+require_once( dirname( __FILE__ ) . '/admin.php' );
+
+require( ABSPATH . 'wp-admin/theme-install.php' );
diff --git a/www/crm/wp-admin/network/themes.php b/www/crm/wp-admin/network/themes.php
new file mode 100644
index 00000000..f12a5a7b
--- /dev/null
+++ b/www/crm/wp-admin/network/themes.php
@@ -0,0 +1,343 @@
+<?php
+/**
+ * Multisite themes administration panel.
+ *
+ * @package WordPress
+ * @subpackage Multisite
+ * @since 3.1.0
+ */
+
+/** Load WordPress Administration Bootstrap */
+require_once( dirname( __FILE__ ) . '/admin.php' );
+
+if ( ! current_user_can( 'manage_network_themes' ) ) {
+ wp_die( __( 'Sorry, you are not allowed to manage network themes.' ) );
+}
+
+$wp_list_table = _get_list_table( 'WP_MS_Themes_List_Table' );
+$pagenum = $wp_list_table->get_pagenum();
+
+$action = $wp_list_table->current_action();
+
+$s = isset( $_REQUEST['s'] ) ? $_REQUEST['s'] : '';
+
+// Clean up request URI from temporary args for screen options/paging uri's to work as expected.
+$temp_args = array( 'enabled', 'disabled', 'deleted', 'error' );
+$_SERVER['REQUEST_URI'] = remove_query_arg( $temp_args, $_SERVER['REQUEST_URI'] );
+$referer = remove_query_arg( $temp_args, wp_get_referer() );
+
+if ( $action ) {
+ switch ( $action ) {
+ case 'enable':
+ check_admin_referer( 'enable-theme_' . $_GET['theme'] );
+ WP_Theme::network_enable_theme( $_GET['theme'] );
+ if ( false === strpos( $referer, '/network/themes.php' ) ) {
+ wp_redirect( network_admin_url( 'themes.php?enabled=1' ) );
+ } else {
+ wp_safe_redirect( add_query_arg( 'enabled', 1, $referer ) );
+ }
+ exit;
+ case 'disable':
+ check_admin_referer( 'disable-theme_' . $_GET['theme'] );
+ WP_Theme::network_disable_theme( $_GET['theme'] );
+ wp_safe_redirect( add_query_arg( 'disabled', '1', $referer ) );
+ exit;
+ case 'enable-selected':
+ check_admin_referer( 'bulk-themes' );
+ $themes = isset( $_POST['checked'] ) ? (array) $_POST['checked'] : array();
+ if ( empty( $themes ) ) {
+ wp_safe_redirect( add_query_arg( 'error', 'none', $referer ) );
+ exit;
+ }
+ WP_Theme::network_enable_theme( (array) $themes );
+ wp_safe_redirect( add_query_arg( 'enabled', count( $themes ), $referer ) );
+ exit;
+ case 'disable-selected':
+ check_admin_referer( 'bulk-themes' );
+ $themes = isset( $_POST['checked'] ) ? (array) $_POST['checked'] : array();
+ if ( empty( $themes ) ) {
+ wp_safe_redirect( add_query_arg( 'error', 'none', $referer ) );
+ exit;
+ }
+ WP_Theme::network_disable_theme( (array) $themes );
+ wp_safe_redirect( add_query_arg( 'disabled', count( $themes ), $referer ) );
+ exit;
+ case 'update-selected':
+ check_admin_referer( 'bulk-themes' );
+
+ if ( isset( $_GET['themes'] ) ) {
+ $themes = explode( ',', $_GET['themes'] );
+ } elseif ( isset( $_POST['checked'] ) ) {
+ $themes = (array) $_POST['checked'];
+ } else {
+ $themes = array();
+ }
+
+ $title = __( 'Update Themes' );
+ $parent_file = 'themes.php';
+
+ require_once( ABSPATH . 'wp-admin/admin-header.php' );
+
+ echo '<div class="wrap">';
+ echo '<h1>' . esc_html( $title ) . '</h1>';
+
+ $url = self_admin_url( 'update.php?action=update-selected-themes&amp;themes=' . urlencode( join( ',', $themes ) ) );
+ $url = wp_nonce_url( $url, 'bulk-update-themes' );
+
+ echo "<iframe src='$url' style='width: 100%; height:100%; min-height:850px;'></iframe>";
+ echo '</div>';
+ require_once( ABSPATH . 'wp-admin/admin-footer.php' );
+ exit;
+ case 'delete-selected':
+ if ( ! current_user_can( 'delete_themes' ) ) {
+ wp_die( __( 'Sorry, you are not allowed to delete themes for this site.' ) );
+ }
+
+ check_admin_referer( 'bulk-themes' );
+
+ $themes = isset( $_REQUEST['checked'] ) ? (array) $_REQUEST['checked'] : array();
+
+ if ( empty( $themes ) ) {
+ wp_safe_redirect( add_query_arg( 'error', 'none', $referer ) );
+ exit;
+ }
+
+ $themes = array_diff( $themes, array( get_option( 'stylesheet' ), get_option( 'template' ) ) );
+
+ if ( empty( $themes ) ) {
+ wp_safe_redirect( add_query_arg( 'error', 'main', $referer ) );
+ exit;
+ }
+
+ $theme_info = array();
+ foreach ( $themes as $key => $theme ) {
+ $theme_info[ $theme ] = wp_get_theme( $theme );
+ }
+
+ include( ABSPATH . 'wp-admin/update.php' );
+
+ $parent_file = 'themes.php';
+
+ if ( ! isset( $_REQUEST['verify-delete'] ) ) {
+ wp_enqueue_script( 'jquery' );
+ require_once( ABSPATH . 'wp-admin/admin-header.php' );
+ $themes_to_delete = count( $themes );
+ ?>
+ <div class="wrap">
+ <?php if ( 1 == $themes_to_delete ) : ?>
+ <h1><?php _e( 'Delete Theme' ); ?></h1>
+ <div class="error"><p><strong><?php _e( 'Caution:' ); ?></strong> <?php _e( 'This theme may be active on other sites in the network.' ); ?></p></div>
+ <p><?php _e( 'You are about to remove the following theme:' ); ?></p>
+ <?php else : ?>
+ <h1><?php _e( 'Delete Themes' ); ?></h1>
+ <div class="error"><p><strong><?php _e( 'Caution:' ); ?></strong> <?php _e( 'These themes may be active on other sites in the network.' ); ?></p></div>
+ <p><?php _e( 'You are about to remove the following themes:' ); ?></p>
+ <?php endif; ?>
+ <ul class="ul-disc">
+ <?php
+ foreach ( $theme_info as $theme ) {
+ echo '<li>' . sprintf(
+ /* translators: 1: theme name, 2: theme author */
+ _x( '%1$s by %2$s', 'theme' ),
+ '<strong>' . $theme->display( 'Name' ) . '</strong>',
+ '<em>' . $theme->display( 'Author' ) . '</em>'
+ ) . '</li>';
+ }
+ ?>
+ </ul>
+ <?php if ( 1 == $themes_to_delete ) : ?>
+ <p><?php _e( 'Are you sure you wish to delete this theme?' ); ?></p>
+ <?php else : ?>
+ <p><?php _e( 'Are you sure you wish to delete these themes?' ); ?></p>
+ <?php endif; ?>
+ <form method="post" action="<?php echo esc_url( $_SERVER['REQUEST_URI'] ); ?>" style="display:inline;">
+ <input type="hidden" name="verify-delete" value="1" />
+ <input type="hidden" name="action" value="delete-selected" />
+ <?php
+ foreach ( (array) $themes as $theme ) {
+ echo '<input type="hidden" name="checked[]" value="' . esc_attr( $theme ) . '" />';
+ }
+
+ wp_nonce_field( 'bulk-themes' );
+
+ if ( 1 == $themes_to_delete ) {
+ submit_button( __( 'Yes, delete this theme' ), '', 'submit', false );
+ } else {
+ submit_button( __( 'Yes, delete these themes' ), '', 'submit', false );
+ }
+ ?>
+ </form>
+ <?php
+ $referer = wp_get_referer();
+ ?>
+ <form method="post" action="<?php echo $referer ? esc_url( $referer ) : ''; ?>" style="display:inline;">
+ <?php submit_button( __( 'No, return me to the theme list' ), '', 'submit', false ); ?>
+ </form>
+ </div>
+ <?php
+ require_once( ABSPATH . 'wp-admin/admin-footer.php' );
+ exit;
+ } // Endif verify-delete
+
+ foreach ( $themes as $theme ) {
+ $delete_result = delete_theme(
+ $theme,
+ esc_url(
+ add_query_arg(
+ array(
+ 'verify-delete' => 1,
+ 'action' => 'delete-selected',
+ 'checked' => $_REQUEST['checked'],
+ '_wpnonce' => $_REQUEST['_wpnonce'],
+ ),
+ network_admin_url( 'themes.php' )
+ )
+ )
+ );
+ }
+
+ $paged = ( $_REQUEST['paged'] ) ? $_REQUEST['paged'] : 1;
+ wp_redirect(
+ add_query_arg(
+ array(
+ 'deleted' => count( $themes ),
+ 'paged' => $paged,
+ 's' => $s,
+ ),
+ network_admin_url( 'themes.php' )
+ )
+ );
+ exit;
+ default:
+ $themes = isset( $_POST['checked'] ) ? (array) $_POST['checked'] : array();
+ if ( empty( $themes ) ) {
+ wp_safe_redirect( add_query_arg( 'error', 'none', $referer ) );
+ exit;
+ }
+ check_admin_referer( 'bulk-themes' );
+
+ /** This action is documented in wp-admin/network/site-themes.php */
+ $referer = apply_filters( 'handle_network_bulk_actions-' . get_current_screen()->id, $referer, $action, $themes );
+
+ wp_safe_redirect( $referer );
+ exit;
+ }
+}
+
+$wp_list_table->prepare_items();
+
+add_thickbox();
+
+add_screen_option( 'per_page' );
+
+get_current_screen()->add_help_tab(
+ array(
+ 'id' => 'overview',
+ 'title' => __( 'Overview' ),
+ 'content' =>
+ '<p>' . __( 'This screen enables and disables the inclusion of themes available to choose in the Appearance menu for each site. It does not activate or deactivate which theme a site is currently using.' ) . '</p>' .
+ '<p>' . __( 'If the network admin disables a theme that is in use, it can still remain selected on that site. If another theme is chosen, the disabled theme will not appear in the site&#8217;s Appearance > Themes screen.' ) . '</p>' .
+ '<p>' . __( 'Themes can be enabled on a site by site basis by the network admin on the Edit Site screen (which has a Themes tab); get there via the Edit action link on the All Sites screen. Only network admins are able to install or edit themes.' ) . '</p>',
+ )
+);
+
+get_current_screen()->set_help_sidebar(
+ '<p><strong>' . __( 'For more information:' ) . '</strong></p>' .
+ '<p>' . __( '<a href="https://codex.wordpress.org/Network_Admin_Themes_Screen">Documentation on Network Themes</a>' ) . '</p>' .
+ '<p>' . __( '<a href="https://wordpress.org/support/">Support</a>' ) . '</p>'
+);
+
+get_current_screen()->set_screen_reader_content(
+ array(
+ 'heading_views' => __( 'Filter themes list' ),
+ 'heading_pagination' => __( 'Themes list navigation' ),
+ 'heading_list' => __( 'Themes list' ),
+ )
+);
+
+$title = __( 'Themes' );
+$parent_file = 'themes.php';
+
+wp_enqueue_script( 'updates' );
+wp_enqueue_script( 'theme-preview' );
+
+require_once( ABSPATH . 'wp-admin/admin-header.php' );
+
+?>
+
+<div class="wrap">
+<h1 class="wp-heading-inline"><?php echo esc_html( $title ); ?></h1>
+
+<?php if ( current_user_can( 'install_themes' ) ) : ?>
+ <a href="theme-install.php" class="page-title-action"><?php echo esc_html_x( 'Add New', 'theme' ); ?></a>
+<?php endif; ?>
+
+<?php
+if ( isset( $_REQUEST['s'] ) && strlen( $_REQUEST['s'] ) ) {
+ /* translators: %s: search keywords */
+ printf( '<span class="subtitle">' . __( 'Search results for &#8220;%s&#8221;' ) . '</span>', esc_html( $s ) );
+}
+?>
+
+<hr class="wp-header-end">
+
+<?php
+if ( isset( $_GET['enabled'] ) ) {
+ $enabled = absint( $_GET['enabled'] );
+ if ( 1 == $enabled ) {
+ $message = __( 'Theme enabled.' );
+ } else {
+ $message = _n( '%s theme enabled.', '%s themes enabled.', $enabled );
+ }
+ echo '<div id="message" class="updated notice is-dismissible"><p>' . sprintf( $message, number_format_i18n( $enabled ) ) . '</p></div>';
+} elseif ( isset( $_GET['disabled'] ) ) {
+ $disabled = absint( $_GET['disabled'] );
+ if ( 1 == $disabled ) {
+ $message = __( 'Theme disabled.' );
+ } else {
+ $message = _n( '%s theme disabled.', '%s themes disabled.', $disabled );
+ }
+ echo '<div id="message" class="updated notice is-dismissible"><p>' . sprintf( $message, number_format_i18n( $disabled ) ) . '</p></div>';
+} elseif ( isset( $_GET['deleted'] ) ) {
+ $deleted = absint( $_GET['deleted'] );
+ if ( 1 == $deleted ) {
+ $message = __( 'Theme deleted.' );
+ } else {
+ $message = _n( '%s theme deleted.', '%s themes deleted.', $deleted );
+ }
+ echo '<div id="message" class="updated notice is-dismissible"><p>' . sprintf( $message, number_format_i18n( $deleted ) ) . '</p></div>';
+} elseif ( isset( $_GET['error'] ) && 'none' == $_GET['error'] ) {
+ echo '<div id="message" class="error notice is-dismissible"><p>' . __( 'No theme selected.' ) . '</p></div>';
+} elseif ( isset( $_GET['error'] ) && 'main' == $_GET['error'] ) {
+ echo '<div class="error notice is-dismissible"><p>' . __( 'You cannot delete a theme while it is active on the main site.' ) . '</p></div>';
+}
+
+?>
+
+<form method="get">
+<?php $wp_list_table->search_box( __( 'Search Installed Themes' ), 'theme' ); ?>
+</form>
+
+<?php
+$wp_list_table->views();
+
+if ( 'broken' == $status ) {
+ echo '<p class="clear">' . __( 'The following themes are installed but incomplete.' ) . '</p>';
+}
+?>
+
+<form id="bulk-action-form" method="post">
+<input type="hidden" name="theme_status" value="<?php echo esc_attr( $status ); ?>" />
+<input type="hidden" name="paged" value="<?php echo esc_attr( $page ); ?>" />
+
+<?php $wp_list_table->display(); ?>
+</form>
+
+</div>
+
+<?php
+wp_print_request_filesystem_credentials_modal();
+wp_print_admin_notice_templates();
+wp_print_update_row_templates();
+
+include( ABSPATH . 'wp-admin/admin-footer.php' );
diff --git a/www/crm/wp-admin/network/update-core.php b/www/crm/wp-admin/network/update-core.php
new file mode 100644
index 00000000..55f2aca3
--- /dev/null
+++ b/www/crm/wp-admin/network/update-core.php
@@ -0,0 +1,13 @@
+<?php
+/**
+ * Updates network administration panel.
+ *
+ * @package WordPress
+ * @subpackage Multisite
+ * @since 3.1.0
+ */
+
+/** Load WordPress Administration Bootstrap */
+require_once( dirname( __FILE__ ) . '/admin.php' );
+
+require( ABSPATH . 'wp-admin/update-core.php' );
diff --git a/www/crm/wp-admin/network/update.php b/www/crm/wp-admin/network/update.php
new file mode 100644
index 00000000..62dc7a96
--- /dev/null
+++ b/www/crm/wp-admin/network/update.php
@@ -0,0 +1,17 @@
+<?php
+/**
+ * Update/Install Plugin/Theme network administration panel.
+ *
+ * @package WordPress
+ * @subpackage Multisite
+ * @since 3.1.0
+ */
+
+if ( isset( $_GET['action'] ) && in_array( $_GET['action'], array( 'update-selected', 'activate-plugin', 'update-selected-themes' ) ) ) {
+ define( 'IFRAME_REQUEST', true );
+}
+
+/** Load WordPress Administration Bootstrap */
+require_once( dirname( __FILE__ ) . '/admin.php' );
+
+require( ABSPATH . 'wp-admin/update.php' );
diff --git a/www/crm/wp-admin/network/upgrade.php b/www/crm/wp-admin/network/upgrade.php
new file mode 100644
index 00000000..e391b2ff
--- /dev/null
+++ b/www/crm/wp-admin/network/upgrade.php
@@ -0,0 +1,155 @@
+<?php
+/**
+ * Multisite upgrade administration panel.
+ *
+ * @package WordPress
+ * @subpackage Multisite
+ * @since 3.0.0
+ */
+
+/** Load WordPress Administration Bootstrap */
+require_once( dirname( __FILE__ ) . '/admin.php' );
+
+require_once( ABSPATH . WPINC . '/http.php' );
+
+$title = __( 'Upgrade Network' );
+$parent_file = 'upgrade.php';
+
+get_current_screen()->add_help_tab(
+ array(
+ 'id' => 'overview',
+ 'title' => __( 'Overview' ),
+ 'content' =>
+ '<p>' . __( 'Only use this screen once you have updated to a new version of WordPress through Updates/Available Updates (via the Network Administration navigation menu or the Toolbar). Clicking the Upgrade Network button will step through each site in the network, five at a time, and make sure any database updates are applied.' ) . '</p>' .
+ '<p>' . __( 'If a version update to core has not happened, clicking this button won&#8217;t affect anything.' ) . '</p>' .
+ '<p>' . __( 'If this process fails for any reason, users logging in to their sites will force the same update.' ) . '</p>',
+ )
+);
+
+get_current_screen()->set_help_sidebar(
+ '<p><strong>' . __( 'For more information:' ) . '</strong></p>' .
+ '<p>' . __( '<a href="https://codex.wordpress.org/Network_Admin_Updates_Screen">Documentation on Upgrade Network</a>' ) . '</p>' .
+ '<p>' . __( '<a href="https://wordpress.org/support/">Support</a>' ) . '</p>'
+);
+
+require_once( ABSPATH . 'wp-admin/admin-header.php' );
+
+if ( ! current_user_can( 'upgrade_network' ) ) {
+ wp_die( __( 'Sorry, you are not allowed to access this page.' ), 403 );
+}
+
+echo '<div class="wrap">';
+echo '<h1>' . __( 'Upgrade Network' ) . '</h1>';
+
+$action = isset( $_GET['action'] ) ? $_GET['action'] : 'show';
+
+switch ( $action ) {
+ case 'upgrade':
+ $n = ( isset( $_GET['n'] ) ) ? intval( $_GET['n'] ) : 0;
+
+ if ( $n < 5 ) {
+ /**
+ * @global string $wp_db_version
+ */
+ global $wp_db_version;
+ update_site_option( 'wpmu_upgrade_site', $wp_db_version );
+ }
+
+ $site_ids = get_sites(
+ array(
+ 'spam' => 0,
+ 'deleted' => 0,
+ 'archived' => 0,
+ 'network_id' => get_current_network_id(),
+ 'number' => 5,
+ 'offset' => $n,
+ 'fields' => 'ids',
+ 'order' => 'DESC',
+ 'orderby' => 'id',
+ 'update_site_meta_cache' => false,
+ )
+ );
+ if ( empty( $site_ids ) ) {
+ echo '<p>' . __( 'All done!' ) . '</p>';
+ break;
+ }
+ echo '<ul>';
+ foreach ( (array) $site_ids as $site_id ) {
+ switch_to_blog( $site_id );
+ $siteurl = site_url();
+ $upgrade_url = admin_url( 'upgrade.php?step=upgrade_db' );
+ restore_current_blog();
+
+ echo "<li>$siteurl</li>";
+
+ $response = wp_remote_get(
+ $upgrade_url,
+ array(
+ 'timeout' => 120,
+ 'httpversion' => '1.1',
+ 'sslverify' => false,
+ )
+ );
+ if ( is_wp_error( $response ) ) {
+ wp_die(
+ sprintf(
+ /* translators: 1: site url, 2: server error message */
+ __( 'Warning! Problem updating %1$s. Your server may not be able to connect to sites running on it. Error message: %2$s' ),
+ $siteurl,
+ '<em>' . $response->get_error_message() . '</em>'
+ )
+ );
+ }
+
+ /**
+ * Fires after the Multisite DB upgrade for each site is complete.
+ *
+ * @since MU (3.0.0)
+ *
+ * @param array|WP_Error $response The upgrade response array or WP_Error on failure.
+ */
+ do_action( 'after_mu_upgrade', $response );
+ /**
+ * Fires after each site has been upgraded.
+ *
+ * @since MU (3.0.0)
+ *
+ * @param int $site_id The Site ID.
+ */
+ do_action( 'wpmu_upgrade_site', $site_id );
+ }
+ echo '</ul>';
+ ?><p><?php _e( 'If your browser doesn&#8217;t start loading the next page automatically, click this link:' ); ?> <a class="button" href="upgrade.php?action=upgrade&amp;n=<?php echo ( $n + 5 ); ?>"><?php _e( 'Next Sites' ); ?></a></p>
+ <script type="text/javascript">
+ <!--
+ function nextpage() {
+ location.href = "upgrade.php?action=upgrade&n=<?php echo ( $n + 5 ); ?>";
+ }
+ setTimeout( "nextpage()", 250 );
+ //-->
+ </script>
+ <?php
+ break;
+ case 'show':
+ default:
+ if ( get_site_option( 'wpmu_upgrade_site' ) != $GLOBALS['wp_db_version'] ) :
+ ?>
+ <h2><?php _e( 'Database Update Required' ); ?></h2>
+ <p><?php _e( 'WordPress has been updated! Before we send you on your way, we need to individually upgrade the sites in your network.' ); ?></p>
+ <?php endif; ?>
+
+ <p><?php _e( 'The database update process may take a little while, so please be patient.' ); ?></p>
+ <p><a class="button button-primary" href="upgrade.php?action=upgrade"><?php _e( 'Upgrade Network' ); ?></a></p>
+ <?php
+ /**
+ * Fires before the footer on the network upgrade screen.
+ *
+ * @since MU (3.0.0)
+ */
+ do_action( 'wpmu_upgrade_page' );
+ break;
+}
+?>
+</div>
+
+<?php include( ABSPATH . 'wp-admin/admin-footer.php' ); ?>
diff --git a/www/crm/wp-admin/network/user-edit.php b/www/crm/wp-admin/network/user-edit.php
new file mode 100644
index 00000000..ef3c2720
--- /dev/null
+++ b/www/crm/wp-admin/network/user-edit.php
@@ -0,0 +1,13 @@
+<?php
+/**
+ * Edit user network administration panel.
+ *
+ * @package WordPress
+ * @subpackage Multisite
+ * @since 3.1.0
+ */
+
+/** Load WordPress Administration Bootstrap */
+require_once( dirname( __FILE__ ) . '/admin.php' );
+
+require( ABSPATH . 'wp-admin/user-edit.php' );
diff --git a/www/crm/wp-admin/network/user-new.php b/www/crm/wp-admin/network/user-new.php
new file mode 100644
index 00000000..73a4021b
--- /dev/null
+++ b/www/crm/wp-admin/network/user-new.php
@@ -0,0 +1,150 @@
+<?php
+/**
+ * Add New User network administration panel.
+ *
+ * @package WordPress
+ * @subpackage Multisite
+ * @since 3.1.0
+ */
+
+/** Load WordPress Administration Bootstrap */
+require_once( dirname( __FILE__ ) . '/admin.php' );
+
+if ( ! current_user_can( 'create_users' ) ) {
+ wp_die( __( 'Sorry, you are not allowed to add users to this network.' ) );
+}
+
+get_current_screen()->add_help_tab(
+ array(
+ 'id' => 'overview',
+ 'title' => __( 'Overview' ),
+ 'content' =>
+ '<p>' . __( 'Add User will set up a new user account on the network and send that person an email with username and password.' ) . '</p>' .
+ '<p>' . __( 'Users who are signed up to the network without a site are added as subscribers to the main or primary dashboard site, giving them profile pages to manage their accounts. These users will only see Dashboard and My Sites in the main navigation until a site is created for them.' ) . '</p>',
+ )
+);
+
+get_current_screen()->set_help_sidebar(
+ '<p><strong>' . __( 'For more information:' ) . '</strong></p>' .
+ '<p>' . __( '<a href="https://codex.wordpress.org/Network_Admin_Users_Screen">Documentation on Network Users</a>' ) . '</p>' .
+ '<p>' . __( '<a href="https://wordpress.org/support/forum/multisite/">Support Forums</a>' ) . '</p>'
+);
+
+if ( isset( $_REQUEST['action'] ) && 'add-user' == $_REQUEST['action'] ) {
+ check_admin_referer( 'add-user', '_wpnonce_add-user' );
+
+ if ( ! current_user_can( 'manage_network_users' ) ) {
+ wp_die( __( 'Sorry, you are not allowed to access this page.' ), 403 );
+ }
+
+ if ( ! is_array( $_POST['user'] ) ) {
+ wp_die( __( 'Cannot create an empty user.' ) );
+ }
+
+ $user = wp_unslash( $_POST['user'] );
+
+ $user_details = wpmu_validate_user_signup( $user['username'], $user['email'] );
+ if ( is_wp_error( $user_details['errors'] ) && $user_details['errors']->has_errors() ) {
+ $add_user_errors = $user_details['errors'];
+ } else {
+ $password = wp_generate_password( 12, false );
+ $user_id = wpmu_create_user( esc_html( strtolower( $user['username'] ) ), $password, sanitize_email( $user['email'] ) );
+
+ if ( ! $user_id ) {
+ $add_user_errors = new WP_Error( 'add_user_fail', __( 'Cannot add user.' ) );
+ } else {
+ /**
+ * Fires after a new user has been created via the network user-new.php page.
+ *
+ * @since 4.4.0
+ *
+ * @param int $user_id ID of the newly created user.
+ */
+ do_action( 'network_user_new_created_user', $user_id );
+ wp_redirect(
+ add_query_arg(
+ array(
+ 'update' => 'added',
+ 'user_id' => $user_id,
+ ),
+ 'user-new.php'
+ )
+ );
+ exit;
+ }
+ }
+}
+
+if ( isset( $_GET['update'] ) ) {
+ $messages = array();
+ if ( 'added' == $_GET['update'] ) {
+ $edit_link = '';
+ if ( isset( $_GET['user_id'] ) ) {
+ $user_id_new = absint( $_GET['user_id'] );
+ if ( $user_id_new ) {
+ $edit_link = esc_url( add_query_arg( 'wp_http_referer', urlencode( wp_unslash( $_SERVER['REQUEST_URI'] ) ), get_edit_user_link( $user_id_new ) ) );
+ }
+ }
+
+ if ( empty( $edit_link ) ) {
+ $messages[] = __( 'User added.' );
+ } else {
+ /* translators: %s: edit page url */
+ $messages[] = sprintf( __( 'User added. <a href="%s">Edit user</a>' ), $edit_link );
+ }
+ }
+}
+
+$title = __( 'Add New User' );
+$parent_file = 'users.php';
+
+require( ABSPATH . 'wp-admin/admin-header.php' ); ?>
+
+<div class="wrap">
+<h1 id="add-new-user"><?php _e( 'Add New User' ); ?></h1>
+<?php
+if ( ! empty( $messages ) ) {
+ foreach ( $messages as $msg ) {
+ echo '<div id="message" class="updated notice is-dismissible"><p>' . $msg . '</p></div>';
+ }
+}
+
+if ( isset( $add_user_errors ) && is_wp_error( $add_user_errors ) ) {
+ ?>
+ <div class="error">
+ <?php
+ foreach ( $add_user_errors->get_error_messages() as $message ) {
+ echo "<p>$message</p>";
+ }
+ ?>
+ </div>
+<?php } ?>
+ <form action="<?php echo network_admin_url( 'user-new.php?action=add-user' ); ?>" id="adduser" method="post" novalidate="novalidate">
+ <table class="form-table" role="presentation">
+ <tr class="form-field form-required">
+ <th scope="row"><label for="username"><?php _e( 'Username' ); ?></label></th>
+ <td><input type="text" class="regular-text" name="user[username]" id="username" autocapitalize="none" autocorrect="off" maxlength="60" /></td>
+ </tr>
+ <tr class="form-field form-required">
+ <th scope="row"><label for="email"><?php _e( 'Email' ); ?></label></th>
+ <td><input type="email" class="regular-text" name="user[email]" id="email"/></td>
+ </tr>
+ <tr class="form-field">
+ <td colspan="2" class="td-full"><?php _e( 'A password reset link will be sent to the user via email.' ); ?></td>
+ </tr>
+ </table>
+ <?php
+ /**
+ * Fires at the end of the new user form in network admin.
+ *
+ * @since 4.5.0
+ */
+ do_action( 'network_user_new_form' );
+
+ wp_nonce_field( 'add-user', '_wpnonce_add-user' );
+ submit_button( __( 'Add User' ), 'primary', 'add-user' );
+ ?>
+ </form>
+</div>
+<?php
+require( ABSPATH . 'wp-admin/admin-footer.php' );
diff --git a/www/crm/wp-admin/network/users.php b/www/crm/wp-admin/network/users.php
new file mode 100644
index 00000000..7f212329
--- /dev/null
+++ b/www/crm/wp-admin/network/users.php
@@ -0,0 +1,280 @@
+<?php
+/**
+ * Multisite users administration panel.
+ *
+ * @package WordPress
+ * @subpackage Multisite
+ * @since 3.0.0
+ */
+
+/** Load WordPress Administration Bootstrap */
+require_once( dirname( __FILE__ ) . '/admin.php' );
+
+if ( ! current_user_can( 'manage_network_users' ) ) {
+ wp_die( __( 'Sorry, you are not allowed to access this page.' ), 403 );
+}
+
+if ( isset( $_GET['action'] ) ) {
+ /** This action is documented in wp-admin/network/edit.php */
+ do_action( 'wpmuadminedit' );
+
+ switch ( $_GET['action'] ) {
+ case 'deleteuser':
+ if ( ! current_user_can( 'manage_network_users' ) ) {
+ wp_die( __( 'Sorry, you are not allowed to access this page.' ), 403 );
+ }
+
+ check_admin_referer( 'deleteuser' );
+
+ $id = intval( $_GET['id'] );
+ if ( $id != '0' && $id != '1' ) {
+ $_POST['allusers'] = array( $id ); // confirm_delete_users() can only handle with arrays
+ $title = __( 'Users' );
+ $parent_file = 'users.php';
+ require_once( ABSPATH . 'wp-admin/admin-header.php' );
+ echo '<div class="wrap">';
+ confirm_delete_users( $_POST['allusers'] );
+ echo '</div>';
+ require_once( ABSPATH . 'wp-admin/admin-footer.php' );
+ } else {
+ wp_redirect( network_admin_url( 'users.php' ) );
+ }
+ exit();
+
+ case 'allusers':
+ if ( ! current_user_can( 'manage_network_users' ) ) {
+ wp_die( __( 'Sorry, you are not allowed to access this page.' ), 403 );
+ }
+
+ if ( ( isset( $_POST['action'] ) || isset( $_POST['action2'] ) ) && isset( $_POST['allusers'] ) ) {
+ check_admin_referer( 'bulk-users-network' );
+
+ $doaction = $_POST['action'] != -1 ? $_POST['action'] : $_POST['action2'];
+ $userfunction = '';
+
+ foreach ( (array) $_POST['allusers'] as $user_id ) {
+ if ( ! empty( $user_id ) ) {
+ switch ( $doaction ) {
+ case 'delete':
+ if ( ! current_user_can( 'delete_users' ) ) {
+ wp_die( __( 'Sorry, you are not allowed to access this page.' ), 403 );
+ }
+ $title = __( 'Users' );
+ $parent_file = 'users.php';
+ require_once( ABSPATH . 'wp-admin/admin-header.php' );
+ echo '<div class="wrap">';
+ confirm_delete_users( $_POST['allusers'] );
+ echo '</div>';
+ require_once( ABSPATH . 'wp-admin/admin-footer.php' );
+ exit();
+
+ case 'spam':
+ $user = get_userdata( $user_id );
+ if ( is_super_admin( $user->ID ) ) {
+ wp_die( sprintf( __( 'Warning! User cannot be modified. The user %s is a network administrator.' ), esc_html( $user->user_login ) ) );
+ }
+
+ $userfunction = 'all_spam';
+ $blogs = get_blogs_of_user( $user_id, true );
+ foreach ( (array) $blogs as $details ) {
+ if ( $details->userblog_id != get_network()->site_id ) { // main blog not a spam !
+ update_blog_status( $details->userblog_id, 'spam', '1' );
+ }
+ }
+ update_user_status( $user_id, 'spam', '1' );
+ break;
+
+ case 'notspam':
+ $userfunction = 'all_notspam';
+ $blogs = get_blogs_of_user( $user_id, true );
+ foreach ( (array) $blogs as $details ) {
+ update_blog_status( $details->userblog_id, 'spam', '0' );
+ }
+
+ update_user_status( $user_id, 'spam', '0' );
+ break;
+ }
+ }
+ }
+
+ if ( ! in_array( $doaction, array( 'delete', 'spam', 'notspam' ), true ) ) {
+ $sendback = wp_get_referer();
+
+ $user_ids = (array) $_POST['allusers'];
+ /** This action is documented in wp-admin/network/site-themes.php */
+ $sendback = apply_filters( 'handle_network_bulk_actions-' . get_current_screen()->id, $sendback, $doaction, $user_ids );
+
+ wp_safe_redirect( $sendback );
+ exit();
+ }
+
+ wp_safe_redirect(
+ add_query_arg(
+ array(
+ 'updated' => 'true',
+ 'action' => $userfunction,
+ ),
+ wp_get_referer()
+ )
+ );
+ } else {
+ $location = network_admin_url( 'users.php' );
+
+ if ( ! empty( $_REQUEST['paged'] ) ) {
+ $location = add_query_arg( 'paged', (int) $_REQUEST['paged'], $location );
+ }
+ wp_redirect( $location );
+ }
+ exit();
+
+ case 'dodelete':
+ check_admin_referer( 'ms-users-delete' );
+ if ( ! ( current_user_can( 'manage_network_users' ) && current_user_can( 'delete_users' ) ) ) {
+ wp_die( __( 'Sorry, you are not allowed to access this page.' ), 403 );
+ }
+
+ if ( ! empty( $_POST['blog'] ) && is_array( $_POST['blog'] ) ) {
+ foreach ( $_POST['blog'] as $id => $users ) {
+ foreach ( $users as $blogid => $user_id ) {
+ if ( ! current_user_can( 'delete_user', $id ) ) {
+ continue;
+ }
+
+ if ( ! empty( $_POST['delete'] ) && 'reassign' == $_POST['delete'][ $blogid ][ $id ] ) {
+ remove_user_from_blog( $id, $blogid, $user_id );
+ } else {
+ remove_user_from_blog( $id, $blogid );
+ }
+ }
+ }
+ }
+ $i = 0;
+ if ( is_array( $_POST['user'] ) && ! empty( $_POST['user'] ) ) {
+ foreach ( $_POST['user'] as $id ) {
+ if ( ! current_user_can( 'delete_user', $id ) ) {
+ continue;
+ }
+ wpmu_delete_user( $id );
+ $i++;
+ }
+ }
+
+ if ( $i == 1 ) {
+ $deletefunction = 'delete';
+ } else {
+ $deletefunction = 'all_delete';
+ }
+
+ wp_redirect(
+ add_query_arg(
+ array(
+ 'updated' => 'true',
+ 'action' => $deletefunction,
+ ),
+ network_admin_url( 'users.php' )
+ )
+ );
+ exit();
+ }
+}
+
+$wp_list_table = _get_list_table( 'WP_MS_Users_List_Table' );
+$pagenum = $wp_list_table->get_pagenum();
+$wp_list_table->prepare_items();
+$total_pages = $wp_list_table->get_pagination_arg( 'total_pages' );
+
+if ( $pagenum > $total_pages && $total_pages > 0 ) {
+ wp_redirect( add_query_arg( 'paged', $total_pages ) );
+ exit;
+}
+$title = __( 'Users' );
+$parent_file = 'users.php';
+
+add_screen_option( 'per_page' );
+
+get_current_screen()->add_help_tab(
+ array(
+ 'id' => 'overview',
+ 'title' => __( 'Overview' ),
+ 'content' =>
+ '<p>' . __( 'This table shows all users across the network and the sites to which they are assigned.' ) . '</p>' .
+ '<p>' . __( 'Hover over any user on the list to make the edit links appear. The Edit link on the left will take you to their Edit User profile page; the Edit link on the right by any site name goes to an Edit Site screen for that site.' ) . '</p>' .
+ '<p>' . __( 'You can also go to the user&#8217;s profile page by clicking on the individual username.' ) . '</p>' .
+ '<p>' . __( 'You can sort the table by clicking on any of the table headings and switch between list and excerpt views by using the icons above the users list.' ) . '</p>' .
+ '<p>' . __( 'The bulk action will permanently delete selected users, or mark/unmark those selected as spam. Spam users will have posts removed and will be unable to sign up again with the same email addresses.' ) . '</p>' .
+ '<p>' . __( 'You can make an existing user an additional super admin by going to the Edit User profile page and checking the box to grant that privilege.' ) . '</p>',
+ )
+);
+
+get_current_screen()->set_help_sidebar(
+ '<p><strong>' . __( 'For more information:' ) . '</strong></p>' .
+ '<p>' . __( '<a href="https://codex.wordpress.org/Network_Admin_Users_Screen">Documentation on Network Users</a>' ) . '</p>' .
+ '<p>' . __( '<a href="https://wordpress.org/support/forum/multisite/">Support Forums</a>' ) . '</p>'
+);
+
+get_current_screen()->set_screen_reader_content(
+ array(
+ 'heading_views' => __( 'Filter users list' ),
+ 'heading_pagination' => __( 'Users list navigation' ),
+ 'heading_list' => __( 'Users list' ),
+ )
+);
+
+require_once( ABSPATH . 'wp-admin/admin-header.php' );
+
+if ( isset( $_REQUEST['updated'] ) && $_REQUEST['updated'] == 'true' && ! empty( $_REQUEST['action'] ) ) {
+ ?>
+ <div id="message" class="updated notice is-dismissible"><p>
+ <?php
+ switch ( $_REQUEST['action'] ) {
+ case 'delete':
+ _e( 'User deleted.' );
+ break;
+ case 'all_spam':
+ _e( 'Users marked as spam.' );
+ break;
+ case 'all_notspam':
+ _e( 'Users removed from spam.' );
+ break;
+ case 'all_delete':
+ _e( 'Users deleted.' );
+ break;
+ case 'add':
+ _e( 'User added.' );
+ break;
+ }
+ ?>
+ </p></div>
+ <?php
+}
+?>
+<div class="wrap">
+ <h1 class="wp-heading-inline"><?php esc_html_e( 'Users' ); ?></h1>
+
+ <?php
+ if ( current_user_can( 'create_users' ) ) :
+ ?>
+ <a href="<?php echo network_admin_url( 'user-new.php' ); ?>" class="page-title-action"><?php echo esc_html_x( 'Add New', 'user' ); ?></a>
+ <?php
+ endif;
+
+ if ( strlen( $usersearch ) ) {
+ /* translators: %s: search keywords */
+ printf( '<span class="subtitle">' . __( 'Search results for &#8220;%s&#8221;' ) . '</span>', esc_html( $usersearch ) );
+ }
+ ?>
+
+ <hr class="wp-header-end">
+
+ <?php $wp_list_table->views(); ?>
+
+ <form method="get" class="search-form">
+ <?php $wp_list_table->search_box( __( 'Search Users' ), 'all-user' ); ?>
+ </form>
+
+ <form id="form-user-list" action="users.php?action=allusers" method="post">
+ <?php $wp_list_table->display(); ?>
+ </form>
+</div>
+
+<?php require_once( ABSPATH . 'wp-admin/admin-footer.php' ); ?>
diff --git a/www/crm/wp-admin/options-discussion.php b/www/crm/wp-admin/options-discussion.php
new file mode 100644
index 00000000..1f742ea1
--- /dev/null
+++ b/www/crm/wp-admin/options-discussion.php
@@ -0,0 +1,320 @@
+<?php
+/**
+ * Discussion settings administration panel.
+ *
+ * @package WordPress
+ * @subpackage Administration
+ */
+/** WordPress Administration Bootstrap */
+require_once( dirname( __FILE__ ) . '/admin.php' );
+
+if ( ! current_user_can( 'manage_options' ) ) {
+ wp_die( __( 'Sorry, you are not allowed to manage options for this site.' ) );
+}
+
+$title = __( 'Discussion Settings' );
+$parent_file = 'options-general.php';
+
+add_action( 'admin_print_footer_scripts', 'options_discussion_add_js' );
+
+get_current_screen()->add_help_tab(
+ array(
+ 'id' => 'overview',
+ 'title' => __( 'Overview' ),
+ 'content' => '<p>' . __( 'This screen provides many options for controlling the management and display of comments and links to your posts/pages. So many, in fact, they won&#8217;t all fit here! :) Use the documentation links to get information on what each discussion setting does.' ) . '</p>' .
+ '<p>' . __( 'You must click the Save Changes button at the bottom of the screen for new settings to take effect.' ) . '</p>',
+ )
+);
+
+get_current_screen()->set_help_sidebar(
+ '<p><strong>' . __( 'For more information:' ) . '</strong></p>' .
+ '<p>' . __( '<a href="https://codex.wordpress.org/Settings_Discussion_Screen">Documentation on Discussion Settings</a>' ) . '</p>' .
+ '<p>' . __( '<a href="https://wordpress.org/support/">Support</a>' ) . '</p>'
+);
+
+include( ABSPATH . 'wp-admin/admin-header.php' );
+?>
+
+<div class="wrap">
+<h1><?php echo esc_html( $title ); ?></h1>
+
+<form method="post" action="options.php">
+<?php settings_fields( 'discussion' ); ?>
+
+<table class="form-table" role="presentation">
+<tr>
+<th scope="row"><?php _e( 'Default article settings' ); ?></th>
+<td><fieldset><legend class="screen-reader-text"><span><?php _e( 'Default article settings' ); ?></span></legend>
+<label for="default_pingback_flag">
+<input name="default_pingback_flag" type="checkbox" id="default_pingback_flag" value="1" <?php checked( '1', get_option( 'default_pingback_flag' ) ); ?> />
+<?php _e( 'Attempt to notify any blogs linked to from the article' ); ?></label>
+<br />
+<label for="default_ping_status">
+<input name="default_ping_status" type="checkbox" id="default_ping_status" value="open" <?php checked( 'open', get_option( 'default_ping_status' ) ); ?> />
+<?php _e( 'Allow link notifications from other blogs (pingbacks and trackbacks) on new articles' ); ?></label>
+<br />
+<label for="default_comment_status">
+<input name="default_comment_status" type="checkbox" id="default_comment_status" value="open" <?php checked( 'open', get_option( 'default_comment_status' ) ); ?> />
+<?php _e( 'Allow people to post comments on new articles' ); ?></label>
+<br />
+<p class="description"><?php echo '(' . __( 'These settings may be overridden for individual articles.' ) . ')'; ?></p>
+</fieldset></td>
+</tr>
+<tr>
+<th scope="row"><?php _e( 'Other comment settings' ); ?></th>
+<td><fieldset><legend class="screen-reader-text"><span><?php _e( 'Other comment settings' ); ?></span></legend>
+<label for="require_name_email"><input type="checkbox" name="require_name_email" id="require_name_email" value="1" <?php checked( '1', get_option( 'require_name_email' ) ); ?> /> <?php _e( 'Comment author must fill out name and email' ); ?></label>
+<br />
+<label for="comment_registration">
+<input name="comment_registration" type="checkbox" id="comment_registration" value="1" <?php checked( '1', get_option( 'comment_registration' ) ); ?> />
+<?php _e( 'Users must be registered and logged in to comment' ); ?>
+<?php
+if ( ! get_option( 'users_can_register' ) && is_multisite() ) {
+ echo ' ' . __( '(Signup has been disabled. Only members of this site can comment.)' );}
+?>
+</label>
+<br />
+
+<label for="close_comments_for_old_posts">
+<input name="close_comments_for_old_posts" type="checkbox" id="close_comments_for_old_posts" value="1" <?php checked( '1', get_option( 'close_comments_for_old_posts' ) ); ?> />
+<?php
+printf(
+ __( 'Automatically close comments on articles older than %s days' ),
+ '</label> <label for="close_comments_days_old"><input name="close_comments_days_old" type="number" min="0" step="1" id="close_comments_days_old" value="' . esc_attr( get_option( 'close_comments_days_old' ) ) . '" class="small-text" />'
+);
+?>
+</label>
+<br />
+
+<label for="show_comments_cookies_opt_in">
+<input name="show_comments_cookies_opt_in" type="checkbox" id="show_comments_cookies_opt_in" value="1" <?php checked( '1', get_option( 'show_comments_cookies_opt_in' ) ); ?> />
+<?php _e( 'Show comments cookies opt-in checkbox, allowing comment author cookies to be set.' ); ?>
+</label>
+<br />
+
+<label for="thread_comments">
+<input name="thread_comments" type="checkbox" id="thread_comments" value="1" <?php checked( '1', get_option( 'thread_comments' ) ); ?> />
+<?php
+/**
+ * Filters the maximum depth of threaded/nested comments.
+ *
+ * @since 2.7.0
+ *
+ * @param int $max_depth The maximum depth of threaded comments. Default 10.
+ */
+$maxdeep = (int) apply_filters( 'thread_comments_depth_max', 10 );
+
+$thread_comments_depth = '</label> <label for="thread_comments_depth"><select name="thread_comments_depth" id="thread_comments_depth">';
+for ( $i = 2; $i <= $maxdeep; $i++ ) {
+ $thread_comments_depth .= "<option value='" . esc_attr( $i ) . "'";
+ if ( get_option( 'thread_comments_depth' ) == $i ) {
+ $thread_comments_depth .= " selected='selected'";
+ }
+ $thread_comments_depth .= ">$i</option>";
+}
+$thread_comments_depth .= '</select>';
+
+printf( __( 'Enable threaded (nested) comments %s levels deep' ), $thread_comments_depth );
+
+?>
+</label>
+<br />
+<label for="page_comments">
+<input name="page_comments" type="checkbox" id="page_comments" value="1" <?php checked( '1', get_option( 'page_comments' ) ); ?> />
+<?php
+$default_comments_page = '</label> <label for="default_comments_page"><select name="default_comments_page" id="default_comments_page"><option value="newest"';
+if ( 'newest' == get_option( 'default_comments_page' ) ) {
+ $default_comments_page .= ' selected="selected"';
+}
+$default_comments_page .= '>' . __( 'last' ) . '</option><option value="oldest"';
+if ( 'oldest' == get_option( 'default_comments_page' ) ) {
+ $default_comments_page .= ' selected="selected"';
+}
+$default_comments_page .= '>' . __( 'first' ) . '</option></select>';
+printf(
+ /* translators: 1: Form field control for number of top level comments per page, 2: Form field control for the 'first' or 'last' page */
+ __( 'Break comments into pages with %1$s top level comments per page and the %2$s page displayed by default' ),
+ '</label> <label for="comments_per_page"><input name="comments_per_page" type="number" step="1" min="0" id="comments_per_page" value="' . esc_attr( get_option( 'comments_per_page' ) ) . '" class="small-text" />',
+ $default_comments_page
+);
+?>
+</label>
+<br />
+<label for="comment_order">
+<?php
+
+$comment_order = '<select name="comment_order" id="comment_order"><option value="asc"';
+if ( 'asc' == get_option( 'comment_order' ) ) {
+ $comment_order .= ' selected="selected"';
+}
+$comment_order .= '>' . __( 'older' ) . '</option><option value="desc"';
+if ( 'desc' == get_option( 'comment_order' ) ) {
+ $comment_order .= ' selected="selected"';
+}
+$comment_order .= '>' . __( 'newer' ) . '</option></select>';
+
+printf( __( 'Comments should be displayed with the %s comments at the top of each page' ), $comment_order );
+
+?>
+</label>
+</fieldset></td>
+</tr>
+<tr>
+<th scope="row"><?php _e( 'Email me whenever' ); ?></th>
+<td><fieldset><legend class="screen-reader-text"><span><?php _e( 'Email me whenever' ); ?></span></legend>
+<label for="comments_notify">
+<input name="comments_notify" type="checkbox" id="comments_notify" value="1" <?php checked( '1', get_option( 'comments_notify' ) ); ?> />
+<?php _e( 'Anyone posts a comment' ); ?> </label>
+<br />
+<label for="moderation_notify">
+<input name="moderation_notify" type="checkbox" id="moderation_notify" value="1" <?php checked( '1', get_option( 'moderation_notify' ) ); ?> />
+<?php _e( 'A comment is held for moderation' ); ?> </label>
+</fieldset></td>
+</tr>
+<tr>
+<th scope="row"><?php _e( 'Before a comment appears' ); ?></th>
+<td><fieldset><legend class="screen-reader-text"><span><?php _e( 'Before a comment appears' ); ?></span></legend>
+<label for="comment_moderation">
+<input name="comment_moderation" type="checkbox" id="comment_moderation" value="1" <?php checked( '1', get_option( 'comment_moderation' ) ); ?> />
+<?php _e( 'Comment must be manually approved' ); ?> </label>
+<br />
+<label for="comment_whitelist"><input type="checkbox" name="comment_whitelist" id="comment_whitelist" value="1" <?php checked( '1', get_option( 'comment_whitelist' ) ); ?> /> <?php _e( 'Comment author must have a previously approved comment' ); ?></label>
+</fieldset></td>
+</tr>
+<tr>
+<th scope="row"><?php _e( 'Comment Moderation' ); ?></th>
+<td><fieldset><legend class="screen-reader-text"><span><?php _e( 'Comment Moderation' ); ?></span></legend>
+<p><label for="comment_max_links"><?php printf( __( 'Hold a comment in the queue if it contains %s or more links. (A common characteristic of comment spam is a large number of hyperlinks.)' ), '<input name="comment_max_links" type="number" step="1" min="0" id="comment_max_links" value="' . esc_attr( get_option( 'comment_max_links' ) ) . '" class="small-text" />' ); ?></label></p>
+
+<p><label for="moderation_keys"><?php _e( 'When a comment contains any of these words in its content, name, URL, email, or IP address, it will be held in the <a href="edit-comments.php?comment_status=moderated">moderation queue</a>. One word or IP address per line. It will match inside words, so &#8220;press&#8221; will match &#8220;WordPress&#8221;.' ); ?></label></p>
+<p>
+<textarea name="moderation_keys" rows="10" cols="50" id="moderation_keys" class="large-text code"><?php echo esc_textarea( get_option( 'moderation_keys' ) ); ?></textarea>
+</p>
+</fieldset></td>
+</tr>
+<tr>
+<th scope="row"><?php _e( 'Comment Blacklist' ); ?></th>
+<td><fieldset><legend class="screen-reader-text"><span><?php _e( 'Comment Blacklist' ); ?></span></legend>
+<p><label for="blacklist_keys"><?php _e( 'When a comment contains any of these words in its content, name, URL, email, or IP address, it will be put in the trash. One word or IP address per line. It will match inside words, so &#8220;press&#8221; will match &#8220;WordPress&#8221;.' ); ?></label></p>
+<p>
+<textarea name="blacklist_keys" rows="10" cols="50" id="blacklist_keys" class="large-text code"><?php echo esc_textarea( get_option( 'blacklist_keys' ) ); ?></textarea>
+</p>
+</fieldset></td>
+</tr>
+<?php do_settings_fields( 'discussion', 'default' ); ?>
+</table>
+
+<h2 class="title"><?php _e( 'Avatars' ); ?></h2>
+
+<p><?php _e( 'An avatar is an image that follows you from weblog to weblog appearing beside your name when you comment on avatar enabled sites. Here you can enable the display of avatars for people who comment on your site.' ); ?></p>
+
+<?php
+// the above would be a good place to link to codex documentation on the gravatar functions, for putting it in themes. anything like that?
+
+$show_avatars = get_option( 'show_avatars' );
+$show_avatars_class = '';
+if ( ! $show_avatars ) {
+ $show_avatars_class = ' hide-if-js';
+}
+?>
+
+<table class="form-table" role="presentation">
+<tr>
+<th scope="row"><?php _e( 'Avatar Display' ); ?></th>
+<td>
+ <label for="show_avatars">
+ <input type="checkbox" id="show_avatars" name="show_avatars" value="1" <?php checked( $show_avatars, 1 ); ?> />
+ <?php _e( 'Show Avatars' ); ?>
+ </label>
+</td>
+</tr>
+<tr class="avatar-settings<?php echo $show_avatars_class; ?>">
+<th scope="row"><?php _e( 'Maximum Rating' ); ?></th>
+<td><fieldset><legend class="screen-reader-text"><span><?php _e( 'Maximum Rating' ); ?></span></legend>
+
+<?php
+$ratings = array(
+ /* translators: Content suitability rating: https://en.wikipedia.org/wiki/Motion_Picture_Association_of_America_film_rating_system */
+ 'G' => __( 'G &#8212; Suitable for all audiences' ),
+ /* translators: Content suitability rating: https://en.wikipedia.org/wiki/Motion_Picture_Association_of_America_film_rating_system */
+ 'PG' => __( 'PG &#8212; Possibly offensive, usually for audiences 13 and above' ),
+ /* translators: Content suitability rating: https://en.wikipedia.org/wiki/Motion_Picture_Association_of_America_film_rating_system */
+ 'R' => __( 'R &#8212; Intended for adult audiences above 17' ),
+ /* translators: Content suitability rating: https://en.wikipedia.org/wiki/Motion_Picture_Association_of_America_film_rating_system */
+ 'X' => __( 'X &#8212; Even more mature than above' ),
+);
+foreach ( $ratings as $key => $rating ) :
+ $selected = ( get_option( 'avatar_rating' ) == $key ) ? 'checked="checked"' : '';
+ echo "\n\t<label><input type='radio' name='avatar_rating' value='" . esc_attr( $key ) . "' $selected/> $rating</label><br />";
+endforeach;
+?>
+
+</fieldset></td>
+</tr>
+<tr class="avatar-settings<?php echo $show_avatars_class; ?>">
+<th scope="row"><?php _e( 'Default Avatar' ); ?></th>
+<td class="defaultavatarpicker"><fieldset><legend class="screen-reader-text"><span><?php _e( 'Default Avatar' ); ?></span></legend>
+
+<p>
+<?php _e( 'For users without a custom avatar of their own, you can either display a generic logo or a generated one based on their email address.' ); ?><br />
+</p>
+
+<?php
+$avatar_defaults = array(
+ 'mystery' => __( 'Mystery Person' ),
+ 'blank' => __( 'Blank' ),
+ 'gravatar_default' => __( 'Gravatar Logo' ),
+ 'identicon' => __( 'Identicon (Generated)' ),
+ 'wavatar' => __( 'Wavatar (Generated)' ),
+ 'monsterid' => __( 'MonsterID (Generated)' ),
+ 'retro' => __( 'Retro (Generated)' ),
+);
+/**
+ * Filters the default avatars.
+ *
+ * Avatars are stored in key/value pairs, where the key is option value,
+ * and the name is the displayed avatar name.
+ *
+ * @since 2.6.0
+ *
+ * @param string[] $avatar_defaults Associative array of default avatars.
+ */
+$avatar_defaults = apply_filters( 'avatar_defaults', $avatar_defaults );
+$default = get_option( 'avatar_default', 'mystery' );
+$avatar_list = '';
+
+// Force avatars on to display these choices
+add_filter( 'pre_option_show_avatars', '__return_true', 100 );
+
+foreach ( $avatar_defaults as $default_key => $default_name ) {
+ $selected = ( $default == $default_key ) ? 'checked="checked" ' : '';
+ $avatar_list .= "\n\t<label><input type='radio' name='avatar_default' id='avatar_{$default_key}' value='" . esc_attr( $default_key ) . "' {$selected}/> ";
+ $avatar_list .= get_avatar( $user_email, 32, $default_key, '', array( 'force_default' => true ) );
+ $avatar_list .= ' ' . $default_name . '</label>';
+ $avatar_list .= '<br />';
+}
+
+remove_filter( 'pre_option_show_avatars', '__return_true', 100 );
+
+/**
+ * Filters the HTML output of the default avatar list.
+ *
+ * @since 2.6.0
+ *
+ * @param string $avatar_list HTML markup of the avatar list.
+ */
+echo apply_filters( 'default_avatar_select', $avatar_list );
+?>
+
+</fieldset></td>
+</tr>
+<?php do_settings_fields( 'discussion', 'avatars' ); ?>
+</table>
+
+<?php do_settings_sections( 'discussion' ); ?>
+
+<?php submit_button(); ?>
+</form>
+</div>
+
+<?php include( ABSPATH . 'wp-admin/admin-footer.php' ); ?>
diff --git a/www/crm/wp-admin/options-general.php b/www/crm/wp-admin/options-general.php
new file mode 100644
index 00000000..62dd4951
--- /dev/null
+++ b/www/crm/wp-admin/options-general.php
@@ -0,0 +1,411 @@
+<?php
+/**
+ * General settings administration panel.
+ *
+ * @package WordPress
+ * @subpackage Administration
+ */
+
+/** WordPress Administration Bootstrap */
+require_once( dirname( __FILE__ ) . '/admin.php' );
+
+/** WordPress Translation Installation API */
+require_once( ABSPATH . 'wp-admin/includes/translation-install.php' );
+
+if ( ! current_user_can( 'manage_options' ) ) {
+ wp_die( __( 'Sorry, you are not allowed to manage options for this site.' ) );
+}
+
+$title = __( 'General Settings' );
+$parent_file = 'options-general.php';
+/* translators: date and time format for exact current time, mainly about timezones, see https://secure.php.net/date */
+$timezone_format = _x( 'Y-m-d H:i:s', 'timezone date format' );
+
+add_action( 'admin_head', 'options_general_add_js' );
+
+$options_help = '<p>' . __( 'The fields on this screen determine some of the basics of your site setup.' ) . '</p>' .
+ '<p>' . __( 'Most themes display the site title at the top of every page, in the title bar of the browser, and as the identifying name for syndicated feeds. The tagline is also displayed by many themes.' ) . '</p>';
+
+if ( ! is_multisite() ) {
+ $options_help .= '<p>' . __( 'The WordPress URL and the Site URL can be the same (example.com) or different; for example, having the WordPress core files (example.com/wordpress) in a subdirectory instead of the root directory.' ) . '</p>' .
+ '<p>' . __( 'If you want site visitors to be able to register themselves, as opposed to by the site administrator, check the membership box. A default user role can be set for all new users, whether self-registered or registered by the site admin.' ) . '</p>';
+}
+
+$options_help .= '<p>' . __( 'You can set the language, and the translation files will be automatically downloaded and installed (available if your filesystem is writable).' ) . '</p>' .
+ '<p>' . __( 'UTC means Coordinated Universal Time.' ) . '</p>' .
+ '<p>' . __( 'You must click the Save Changes button at the bottom of the screen for new settings to take effect.' ) . '</p>';
+
+get_current_screen()->add_help_tab(
+ array(
+ 'id' => 'overview',
+ 'title' => __( 'Overview' ),
+ 'content' => $options_help,
+ )
+);
+
+get_current_screen()->set_help_sidebar(
+ '<p><strong>' . __( 'For more information:' ) . '</strong></p>' .
+ '<p>' . __( '<a href="https://codex.wordpress.org/Settings_General_Screen">Documentation on General Settings</a>' ) . '</p>' .
+ '<p>' . __( '<a href="https://wordpress.org/support/">Support</a>' ) . '</p>'
+);
+
+include( ABSPATH . 'wp-admin/admin-header.php' );
+?>
+
+<div class="wrap">
+<h1><?php echo esc_html( $title ); ?></h1>
+
+<form method="post" action="options.php" novalidate="novalidate">
+<?php settings_fields( 'general' ); ?>
+
+<table class="form-table" role="presentation">
+
+<tr>
+<th scope="row"><label for="blogname"><?php _e( 'Site Title' ); ?></label></th>
+<td><input name="blogname" type="text" id="blogname" value="<?php form_option( 'blogname' ); ?>" class="regular-text" /></td>
+</tr>
+
+<tr>
+<th scope="row"><label for="blogdescription"><?php _e( 'Tagline' ); ?></label></th>
+<td><input name="blogdescription" type="text" id="blogdescription" aria-describedby="tagline-description" value="<?php form_option( 'blogdescription' ); ?>" class="regular-text" />
+<p class="description" id="tagline-description"><?php _e( 'In a few words, explain what this site is about.' ); ?></p></td>
+</tr>
+
+<?php
+if ( ! is_multisite() ) {
+ $wp_site_url_class = $wp_home_class = '';
+ if ( defined( 'WP_SITEURL' ) ) {
+ $wp_site_url_class = ' disabled';
+ }
+ if ( defined( 'WP_HOME' ) ) {
+ $wp_home_class = ' disabled';
+ }
+ ?>
+
+<tr>
+<th scope="row"><label for="siteurl"><?php _e( 'WordPress Address (URL)' ); ?></label></th>
+<td><input name="siteurl" type="url" id="siteurl" value="<?php form_option( 'siteurl' ); ?>"<?php disabled( defined( 'WP_SITEURL' ) ); ?> class="regular-text code<?php echo $wp_site_url_class; ?>" /></td>
+</tr>
+
+<tr>
+<th scope="row"><label for="home"><?php _e( 'Site Address (URL)' ); ?></label></th>
+<td><input name="home" type="url" id="home" aria-describedby="home-description" value="<?php form_option( 'home' ); ?>"<?php disabled( defined( 'WP_HOME' ) ); ?> class="regular-text code<?php echo $wp_home_class; ?>" />
+ <?php if ( ! defined( 'WP_HOME' ) ) : ?>
+<p class="description" id="home-description">
+ <?php
+ printf(
+ /* translators: %s: Codex URL */
+ __( 'Enter the address here if you <a href="%s">want your site home page to be different from your WordPress installation directory</a>.' ),
+ __( 'https://codex.wordpress.org/Giving_WordPress_Its_Own_Directory' )
+ );
+ ?>
+</p>
+<?php endif; ?>
+</td>
+</tr>
+
+<?php } ?>
+
+<tr>
+<th scope="row"><label for="new_admin_email"><?php _e( 'Email Address' ); ?></label></th>
+<td><input name="new_admin_email" type="email" id="new_admin_email" aria-describedby="new-admin-email-description" value="<?php form_option( 'admin_email' ); ?>" class="regular-text ltr" />
+<p class="description" id="new-admin-email-description"><?php _e( 'This address is used for admin purposes. If you change this we will send you an email at your new address to confirm it. <strong>The new address will not become active until confirmed.</strong>' ); ?></p>
+<?php
+$new_admin_email = get_option( 'new_admin_email' );
+if ( $new_admin_email && $new_admin_email != get_option( 'admin_email' ) ) :
+ ?>
+ <div class="updated inline">
+ <p>
+ <?php
+ printf(
+ /* translators: %s: new admin email */
+ __( 'There is a pending change of the admin email to %s.' ),
+ '<code>' . esc_html( $new_admin_email ) . '</code>'
+ );
+ printf(
+ ' <a href="%1$s">%2$s</a>',
+ esc_url( wp_nonce_url( admin_url( 'options.php?dismiss=new_admin_email' ), 'dismiss-' . get_current_blog_id() . '-new_admin_email' ) ),
+ __( 'Cancel' )
+ );
+ ?>
+ </p>
+ </div>
+<?php endif; ?>
+</td>
+</tr>
+
+<?php if ( ! is_multisite() ) { ?>
+
+<tr>
+<th scope="row"><?php _e( 'Membership' ); ?></th>
+<td> <fieldset><legend class="screen-reader-text"><span><?php _e( 'Membership' ); ?></span></legend><label for="users_can_register">
+<input name="users_can_register" type="checkbox" id="users_can_register" value="1" <?php checked( '1', get_option( 'users_can_register' ) ); ?> />
+ <?php _e( 'Anyone can register' ); ?></label>
+</fieldset></td>
+</tr>
+
+<tr>
+<th scope="row"><label for="default_role"><?php _e( 'New User Default Role' ); ?></label></th>
+<td>
+<select name="default_role" id="default_role"><?php wp_dropdown_roles( get_option( 'default_role' ) ); ?></select>
+</td>
+</tr>
+
+ <?php
+}
+
+$languages = get_available_languages();
+$translations = wp_get_available_translations();
+if ( ! is_multisite() && defined( 'WPLANG' ) && '' !== WPLANG && 'en_US' !== WPLANG && ! in_array( WPLANG, $languages ) ) {
+ $languages[] = WPLANG;
+}
+if ( ! empty( $languages ) || ! empty( $translations ) ) {
+ ?>
+ <tr>
+ <th scope="row"><label for="WPLANG"><?php _e( 'Site Language' ); ?></label></th>
+ <td>
+ <?php
+ $locale = get_locale();
+ if ( ! in_array( $locale, $languages ) ) {
+ $locale = '';
+ }
+
+ wp_dropdown_languages(
+ array(
+ 'name' => 'WPLANG',
+ 'id' => 'WPLANG',
+ 'selected' => $locale,
+ 'languages' => $languages,
+ 'translations' => $translations,
+ 'show_available_translations' => current_user_can( 'install_languages' ) && wp_can_install_language_pack(),
+ )
+ );
+
+ // Add note about deprecated WPLANG constant.
+ if ( defined( 'WPLANG' ) && ( '' !== WPLANG ) && $locale !== WPLANG ) {
+ _deprecated_argument( 'define()', '4.0.0', sprintf( __( 'The %1$s constant in your %2$s file is no longer needed.' ), 'WPLANG', 'wp-config.php' ) );
+ }
+ ?>
+ </td>
+ </tr>
+ <?php
+}
+?>
+<tr>
+<?php
+$current_offset = get_option( 'gmt_offset' );
+$tzstring = get_option( 'timezone_string' );
+
+$check_zone_info = true;
+
+// Remove old Etc mappings. Fallback to gmt_offset.
+if ( false !== strpos( $tzstring, 'Etc/GMT' ) ) {
+ $tzstring = '';
+}
+
+if ( empty( $tzstring ) ) { // Create a UTC+- zone if no timezone string exists
+ $check_zone_info = false;
+ if ( 0 == $current_offset ) {
+ $tzstring = 'UTC+0';
+ } elseif ( $current_offset < 0 ) {
+ $tzstring = 'UTC' . $current_offset;
+ } else {
+ $tzstring = 'UTC+' . $current_offset;
+ }
+}
+
+?>
+<th scope="row"><label for="timezone_string"><?php _e( 'Timezone' ); ?></label></th>
+<td>
+
+<select id="timezone_string" name="timezone_string" aria-describedby="timezone-description">
+ <?php echo wp_timezone_choice( $tzstring, get_user_locale() ); ?>
+</select>
+
+<p class="description" id="timezone-description"><?php _e( 'Choose either a city in the same timezone as you or a UTC timezone offset.' ); ?></p>
+
+<p class="timezone-info">
+ <span id="utc-time">
+ <?php
+ /* translators: 1: UTC abbreviation, 2: UTC time */
+ printf(
+ __( 'Universal time (%1$s) is %2$s.' ),
+ '<abbr>' . __( 'UTC' ) . '</abbr>',
+ '<code>' . date_i18n( $timezone_format, false, true ) . '</code>'
+ );
+ ?>
+ </span>
+<?php if ( get_option( 'timezone_string' ) || ! empty( $current_offset ) ) : ?>
+ <span id="local-time">
+ <?php
+ /* translators: %s: local time */
+ printf(
+ __( 'Local time is %s.' ),
+ '<code>' . date_i18n( $timezone_format ) . '</code>'
+ );
+ ?>
+ </span>
+<?php endif; ?>
+</p>
+
+<?php if ( $check_zone_info && $tzstring ) : ?>
+<p class="timezone-info">
+<span>
+ <?php
+ // Set TZ so localtime works.
+ date_default_timezone_set( $tzstring );
+ $now = localtime( time(), true );
+ if ( $now['tm_isdst'] ) {
+ _e( 'This timezone is currently in daylight saving time.' );
+ } else {
+ _e( 'This timezone is currently in standard time.' );
+ }
+ ?>
+ <br />
+ <?php
+ $allowed_zones = timezone_identifiers_list();
+
+ if ( in_array( $tzstring, $allowed_zones ) ) {
+ $found = false;
+ $date_time_zone_selected = new DateTimeZone( $tzstring );
+ $tz_offset = timezone_offset_get( $date_time_zone_selected, date_create() );
+ $right_now = time();
+ foreach ( timezone_transitions_get( $date_time_zone_selected ) as $tr ) {
+ if ( $tr['ts'] > $right_now ) {
+ $found = true;
+ break;
+ }
+ }
+
+ if ( $found ) {
+ echo ' ';
+ $message = $tr['isdst'] ?
+ /* translators: %s: date and time */
+ __( 'Daylight saving time begins on: %s.' ) :
+ /* translators: %s: date and time */
+ __( 'Standard time begins on: %s.' );
+ // Add the difference between the current offset and the new offset to ts to get the correct transition time from date_i18n().
+ printf(
+ $message,
+ '<code>' . date_i18n(
+ __( 'F j, Y' ) . ' ' . __( 'g:i a' ),
+ $tr['ts'] + ( $tz_offset - $tr['offset'] )
+ ) . '</code>'
+ );
+ } else {
+ _e( 'This timezone does not observe daylight saving time.' );
+ }
+ }
+ // Set back to UTC.
+ date_default_timezone_set( 'UTC' );
+ ?>
+ </span>
+</p>
+<?php endif; ?>
+</td>
+
+</tr>
+<tr>
+<th scope="row"><?php _e( 'Date Format' ); ?></th>
+<td>
+ <fieldset><legend class="screen-reader-text"><span><?php _e( 'Date Format' ); ?></span></legend>
+<?php
+ /**
+ * Filters the default date formats.
+ *
+ * @since 2.7.0
+ * @since 4.0.0 Added ISO date standard YYYY-MM-DD format.
+ *
+ * @param string[] $default_date_formats Array of default date formats.
+ */
+ $date_formats = array_unique( apply_filters( 'date_formats', array( __( 'F j, Y' ), 'Y-m-d', 'm/d/Y', 'd/m/Y' ) ) );
+
+ $custom = true;
+
+foreach ( $date_formats as $format ) {
+ echo "\t<label><input type='radio' name='date_format' value='" . esc_attr( $format ) . "'";
+ if ( get_option( 'date_format' ) === $format ) { // checked() uses "==" rather than "==="
+ echo " checked='checked'";
+ $custom = false;
+ }
+ echo ' /> <span class="date-time-text format-i18n">' . date_i18n( $format ) . '</span><code>' . esc_html( $format ) . "</code></label><br />\n";
+}
+
+ echo '<label><input type="radio" name="date_format" id="date_format_custom_radio" value="\c\u\s\t\o\m"';
+ checked( $custom );
+ echo '/> <span class="date-time-text date-time-custom-text">' . __( 'Custom:' ) . '<span class="screen-reader-text"> ' . __( 'enter a custom date format in the following field' ) . '</span></span></label>' .
+ '<label for="date_format_custom" class="screen-reader-text">' . __( 'Custom date format:' ) . '</label>' .
+ '<input type="text" name="date_format_custom" id="date_format_custom" value="' . esc_attr( get_option( 'date_format' ) ) . '" class="small-text" />' .
+ '<br />' .
+ '<p><strong>' . __( 'Preview:' ) . '</strong> <span class="example">' . date_i18n( get_option( 'date_format' ) ) . '</span>' .
+ "<span class='spinner'></span>\n" . '</p>';
+?>
+ </fieldset>
+</td>
+</tr>
+<tr>
+<th scope="row"><?php _e( 'Time Format' ); ?></th>
+<td>
+ <fieldset><legend class="screen-reader-text"><span><?php _e( 'Time Format' ); ?></span></legend>
+<?php
+ /**
+ * Filters the default time formats.
+ *
+ * @since 2.7.0
+ *
+ * @param string[] $default_time_formats Array of default time formats.
+ */
+ $time_formats = array_unique( apply_filters( 'time_formats', array( __( 'g:i a' ), 'g:i A', 'H:i' ) ) );
+
+ $custom = true;
+
+foreach ( $time_formats as $format ) {
+ echo "\t<label><input type='radio' name='time_format' value='" . esc_attr( $format ) . "'";
+ if ( get_option( 'time_format' ) === $format ) { // checked() uses "==" rather than "==="
+ echo " checked='checked'";
+ $custom = false;
+ }
+ echo ' /> <span class="date-time-text format-i18n">' . date_i18n( $format ) . '</span><code>' . esc_html( $format ) . "</code></label><br />\n";
+}
+
+ echo '<label><input type="radio" name="time_format" id="time_format_custom_radio" value="\c\u\s\t\o\m"';
+ checked( $custom );
+ echo '/> <span class="date-time-text date-time-custom-text">' . __( 'Custom:' ) . '<span class="screen-reader-text"> ' . __( 'enter a custom time format in the following field' ) . '</span></span></label>' .
+ '<label for="time_format_custom" class="screen-reader-text">' . __( 'Custom time format:' ) . '</label>' .
+ '<input type="text" name="time_format_custom" id="time_format_custom" value="' . esc_attr( get_option( 'time_format' ) ) . '" class="small-text" />' .
+ '<br />' .
+ '<p><strong>' . __( 'Preview:' ) . '</strong> <span class="example">' . date_i18n( get_option( 'time_format' ) ) . '</span>' .
+ "<span class='spinner'></span>\n" . '</p>';
+
+ echo "\t<p class='date-time-doc'>" . __( '<a href="https://codex.wordpress.org/Formatting_Date_and_Time">Documentation on date and time formatting</a>.' ) . "</p>\n";
+?>
+ </fieldset>
+</td>
+</tr>
+<tr>
+<th scope="row"><label for="start_of_week"><?php _e( 'Week Starts On' ); ?></label></th>
+<td><select name="start_of_week" id="start_of_week">
+<?php
+/**
+ * @global WP_Locale $wp_locale
+ */
+global $wp_locale;
+
+for ( $day_index = 0; $day_index <= 6; $day_index++ ) :
+ $selected = ( get_option( 'start_of_week' ) == $day_index ) ? 'selected="selected"' : '';
+ echo "\n\t<option value='" . esc_attr( $day_index ) . "' $selected>" . $wp_locale->get_weekday( $day_index ) . '</option>';
+endfor;
+?>
+</select></td>
+</tr>
+<?php do_settings_fields( 'general', 'default' ); ?>
+</table>
+
+<?php do_settings_sections( 'general' ); ?>
+
+<?php submit_button(); ?>
+</form>
+
+</div>
+
+<?php include( ABSPATH . 'wp-admin/admin-footer.php' ); ?>
diff --git a/www/crm/wp-admin/options-head.php b/www/crm/wp-admin/options-head.php
new file mode 100644
index 00000000..a0e3a330
--- /dev/null
+++ b/www/crm/wp-admin/options-head.php
@@ -0,0 +1,18 @@
+<?php
+/**
+ * WordPress Options Header.
+ *
+ * Displays updated message, if updated variable is part of the URL query.
+ *
+ * @package WordPress
+ * @subpackage Administration
+ */
+
+wp_reset_vars( array( 'action' ) );
+
+if ( isset( $_GET['updated'] ) && isset( $_GET['page'] ) ) {
+ // For back-compat with plugins that don't use the Settings API and just set updated=1 in the redirect.
+ add_settings_error( 'general', 'settings_updated', __( 'Settings saved.' ), 'updated' );
+}
+
+settings_errors();
diff --git a/www/crm/wp-admin/options-media.php b/www/crm/wp-admin/options-media.php
new file mode 100644
index 00000000..7373cb5d
--- /dev/null
+++ b/www/crm/wp-admin/options-media.php
@@ -0,0 +1,156 @@
+<?php
+/**
+ * Media settings administration panel.
+ *
+ * @package WordPress
+ * @subpackage Administration
+ */
+
+/** WordPress Administration Bootstrap */
+require_once( dirname( __FILE__ ) . '/admin.php' );
+
+if ( ! current_user_can( 'manage_options' ) ) {
+ wp_die( __( 'Sorry, you are not allowed to manage options for this site.' ) );
+}
+
+$title = __( 'Media Settings' );
+$parent_file = 'options-general.php';
+
+$media_options_help = '<p>' . __( 'You can set maximum sizes for images inserted into your written content; you can also insert an image as Full Size.' ) . '</p>';
+
+if ( ! is_multisite() && ( get_option( 'upload_url_path' ) || ( get_option( 'upload_path' ) != 'wp-content/uploads' && get_option( 'upload_path' ) ) ) ) {
+ $media_options_help .= '<p>' . __( 'Uploading Files allows you to choose the folder and path for storing your uploaded files.' ) . '</p>';
+}
+
+$media_options_help .= '<p>' . __( 'You must click the Save Changes button at the bottom of the screen for new settings to take effect.' ) . '</p>';
+
+get_current_screen()->add_help_tab(
+ array(
+ 'id' => 'overview',
+ 'title' => __( 'Overview' ),
+ 'content' => $media_options_help,
+ )
+);
+
+get_current_screen()->set_help_sidebar(
+ '<p><strong>' . __( 'For more information:' ) . '</strong></p>' .
+ '<p>' . __( '<a href="https://codex.wordpress.org/Settings_Media_Screen">Documentation on Media Settings</a>' ) . '</p>' .
+ '<p>' . __( '<a href="https://wordpress.org/support/">Support</a>' ) . '</p>'
+);
+
+include( ABSPATH . 'wp-admin/admin-header.php' );
+
+?>
+
+<div class="wrap">
+<h1><?php echo esc_html( $title ); ?></h1>
+
+<form action="options.php" method="post">
+<?php settings_fields( 'media' ); ?>
+
+<h2 class="title"><?php _e( 'Image sizes' ); ?></h2>
+<p><?php _e( 'The sizes listed below determine the maximum dimensions in pixels to use when adding an image to the Media Library.' ); ?></p>
+
+<table class="form-table" role="presentation">
+<tr>
+<th scope="row"><?php _e( 'Thumbnail size' ); ?></th>
+<td><fieldset><legend class="screen-reader-text"><span><?php _e( 'Thumbnail size' ); ?></span></legend>
+<label for="thumbnail_size_w"><?php _e( 'Width' ); ?></label>
+<input name="thumbnail_size_w" type="number" step="1" min="0" id="thumbnail_size_w" value="<?php form_option( 'thumbnail_size_w' ); ?>" class="small-text" />
+<br />
+<label for="thumbnail_size_h"><?php _e( 'Height' ); ?></label>
+<input name="thumbnail_size_h" type="number" step="1" min="0" id="thumbnail_size_h" value="<?php form_option( 'thumbnail_size_h' ); ?>" class="small-text" />
+</fieldset>
+<input name="thumbnail_crop" type="checkbox" id="thumbnail_crop" value="1" <?php checked( '1', get_option( 'thumbnail_crop' ) ); ?>/>
+<label for="thumbnail_crop"><?php _e( 'Crop thumbnail to exact dimensions (normally thumbnails are proportional)' ); ?></label>
+</td>
+</tr>
+
+<tr>
+<th scope="row"><?php _e( 'Medium size' ); ?></th>
+<td><fieldset><legend class="screen-reader-text"><span><?php _e( 'Medium size' ); ?></span></legend>
+<label for="medium_size_w"><?php _e( 'Max Width' ); ?></label>
+<input name="medium_size_w" type="number" step="1" min="0" id="medium_size_w" value="<?php form_option( 'medium_size_w' ); ?>" class="small-text" />
+<br />
+<label for="medium_size_h"><?php _e( 'Max Height' ); ?></label>
+<input name="medium_size_h" type="number" step="1" min="0" id="medium_size_h" value="<?php form_option( 'medium_size_h' ); ?>" class="small-text" />
+</fieldset></td>
+</tr>
+
+<tr>
+<th scope="row"><?php _e( 'Large size' ); ?></th>
+<td><fieldset><legend class="screen-reader-text"><span><?php _e( 'Large size' ); ?></span></legend>
+<label for="large_size_w"><?php _e( 'Max Width' ); ?></label>
+<input name="large_size_w" type="number" step="1" min="0" id="large_size_w" value="<?php form_option( 'large_size_w' ); ?>" class="small-text" />
+<br />
+<label for="large_size_h"><?php _e( 'Max Height' ); ?></label>
+<input name="large_size_h" type="number" step="1" min="0" id="large_size_h" value="<?php form_option( 'large_size_h' ); ?>" class="small-text" />
+</fieldset></td>
+</tr>
+
+<?php do_settings_fields( 'media', 'default' ); ?>
+</table>
+
+<?php
+/**
+ * @global array $wp_settings
+ */
+if ( isset( $GLOBALS['wp_settings']['media']['embeds'] ) ) :
+ ?>
+<h2 class="title"><?php _e( 'Embeds' ); ?></h2>
+<table class="form-table" role="presentation">
+ <?php do_settings_fields( 'media', 'embeds' ); ?>
+</table>
+<?php endif; ?>
+
+<?php if ( ! is_multisite() ) : ?>
+<h2 class="title"><?php _e( 'Uploading Files' ); ?></h2>
+<table class="form-table" role="presentation">
+ <?php
+ // If upload_url_path is not the default (empty), and upload_path is not the default ('wp-content/uploads' or empty)
+ if ( get_option( 'upload_url_path' ) || ( get_option( 'upload_path' ) != 'wp-content/uploads' && get_option( 'upload_path' ) ) ) :
+ ?>
+<tr>
+<th scope="row"><label for="upload_path"><?php _e( 'Store uploads in this folder' ); ?></label></th>
+<td><input name="upload_path" type="text" id="upload_path" value="<?php echo esc_attr( get_option( 'upload_path' ) ); ?>" class="regular-text code" />
+<p class="description">
+ <?php
+ /* translators: %s: wp-content/uploads */
+ printf( __( 'Default is %s' ), '<code>wp-content/uploads</code>' );
+ ?>
+</p>
+</td>
+</tr>
+
+<tr>
+<th scope="row"><label for="upload_url_path"><?php _e( 'Full URL path to files' ); ?></label></th>
+<td><input name="upload_url_path" type="text" id="upload_url_path" value="<?php echo esc_attr( get_option( 'upload_url_path' ) ); ?>" class="regular-text code" />
+<p class="description"><?php _e( 'Configuring this is optional. By default, it should be blank.' ); ?></p>
+</td>
+</tr>
+<tr>
+<td colspan="2" class="td-full">
+<?php else : ?>
+<tr>
+<td class="td-full">
+<?php endif; ?>
+<label for="uploads_use_yearmonth_folders">
+<input name="uploads_use_yearmonth_folders" type="checkbox" id="uploads_use_yearmonth_folders" value="1"<?php checked( '1', get_option( 'uploads_use_yearmonth_folders' ) ); ?> />
+ <?php _e( 'Organize my uploads into month- and year-based folders' ); ?>
+</label>
+</td>
+</tr>
+
+ <?php do_settings_fields( 'media', 'uploads' ); ?>
+</table>
+<?php endif; ?>
+
+<?php do_settings_sections( 'media' ); ?>
+
+<?php submit_button(); ?>
+
+</form>
+
+</div>
+
+<?php include( ABSPATH . 'wp-admin/admin-footer.php' ); ?>
diff --git a/www/crm/wp-admin/options-permalink.php b/www/crm/wp-admin/options-permalink.php
new file mode 100644
index 00000000..8e064fae
--- /dev/null
+++ b/www/crm/wp-admin/options-permalink.php
@@ -0,0 +1,404 @@
+<?php
+/**
+ * Permalink Settings Administration Screen.
+ *
+ * @package WordPress
+ * @subpackage Administration
+ */
+
+/** WordPress Administration Bootstrap */
+require_once( dirname( __FILE__ ) . '/admin.php' );
+
+if ( ! current_user_can( 'manage_options' ) ) {
+ wp_die( __( 'Sorry, you are not allowed to manage options for this site.' ) );
+}
+
+$title = __( 'Permalink Settings' );
+$parent_file = 'options-general.php';
+
+get_current_screen()->add_help_tab(
+ array(
+ 'id' => 'overview',
+ 'title' => __( 'Overview' ),
+ 'content' => '<p>' . __( 'Permalinks are the permanent URLs to your individual pages and blog posts, as well as your category and tag archives. A permalink is the web address used to link to your content. The URL to each post should be permanent, and never change &#8212; hence the name permalink.' ) . '</p>' .
+ '<p>' . __( 'This screen allows you to choose your permalink structure. You can choose from common settings or create custom URL structures.' ) . '</p>' .
+ '<p>' . __( 'You must click the Save Changes button at the bottom of the screen for new settings to take effect.' ) . '</p>',
+ )
+);
+
+get_current_screen()->add_help_tab(
+ array(
+ 'id' => 'permalink-settings',
+ 'title' => __( 'Permalink Settings' ),
+ 'content' => '<p>' . __( 'Permalinks can contain useful information, such as the post date, title, or other elements. You can choose from any of the suggested permalink formats, or you can craft your own if you select Custom Structure.' ) . '</p>' .
+ '<p>' . __( 'If you pick an option other than Plain, your general URL path with structure tags (terms surrounded by <code>%</code>) will also appear in the custom structure field and your path can be further modified there.' ) . '</p>' .
+ '<p>' . __( 'When you assign multiple categories or tags to a post, only one can show up in the permalink: the lowest numbered category. This applies if your custom structure includes <code>%category%</code> or <code>%tag%</code>.' ) . '</p>' .
+ '<p>' . __( 'You must click the Save Changes button at the bottom of the screen for new settings to take effect.' ) . '</p>',
+ )
+);
+
+get_current_screen()->add_help_tab(
+ array(
+ 'id' => 'custom-structures',
+ 'title' => __( 'Custom Structures' ),
+ 'content' => '<p>' . __( 'The Optional fields let you customize the &#8220;category&#8221; and &#8220;tag&#8221; base names that will appear in archive URLs. For example, the page listing all posts in the &#8220;Uncategorized&#8221; category could be <code>/topics/uncategorized</code> instead of <code>/category/uncategorized</code>.' ) . '</p>' .
+ '<p>' . __( 'You must click the Save Changes button at the bottom of the screen for new settings to take effect.' ) . '</p>',
+ )
+);
+
+get_current_screen()->set_help_sidebar(
+ '<p><strong>' . __( 'For more information:' ) . '</strong></p>' .
+ '<p>' . __( '<a href="https://codex.wordpress.org/Settings_Permalinks_Screen">Documentation on Permalinks Settings</a>' ) . '</p>' .
+ '<p>' . __( '<a href="https://codex.wordpress.org/Using_Permalinks">Documentation on Using Permalinks</a>' ) . '</p>' .
+ '<p>' . __( '<a href="https://wordpress.org/support/">Support</a>' ) . '</p>'
+);
+
+$home_path = get_home_path();
+$iis7_permalinks = iis7_supports_permalinks();
+$permalink_structure = get_option( 'permalink_structure' );
+
+$prefix = $blog_prefix = '';
+if ( ! got_url_rewrite() ) {
+ $prefix = '/index.php';
+}
+
+/**
+ * In a subdirectory configuration of multisite, the `/blog` prefix is used by
+ * default on the main site to avoid collisions with other sites created on that
+ * network. If the `permalink_structure` option has been changed to remove this
+ * base prefix, WordPress core can no longer account for the possible collision.
+ */
+if ( is_multisite() && ! is_subdomain_install() && is_main_site() && 0 === strpos( $permalink_structure, '/blog/' ) ) {
+ $blog_prefix = '/blog';
+}
+
+$category_base = get_option( 'category_base' );
+$tag_base = get_option( 'tag_base' );
+$update_required = false;
+
+if ( $iis7_permalinks ) {
+ if ( ( ! file_exists( $home_path . 'web.config' ) && win_is_writable( $home_path ) ) || win_is_writable( $home_path . 'web.config' ) ) {
+ $writable = true;
+ } else {
+ $writable = false;
+ }
+} elseif ( $is_nginx ) {
+ $writable = false;
+} else {
+ if ( ( ! file_exists( $home_path . '.htaccess' ) && is_writable( $home_path ) ) || is_writable( $home_path . '.htaccess' ) ) {
+ $writable = true;
+ } else {
+ $writable = false;
+ $existing_rules = array_filter( extract_from_markers( $home_path . '.htaccess', 'WordPress' ) );
+ $new_rules = array_filter( explode( "\n", $wp_rewrite->mod_rewrite_rules() ) );
+ $update_required = ( $new_rules !== $existing_rules );
+ }
+}
+
+$using_index_permalinks = $wp_rewrite->using_index_permalinks();
+
+if ( isset( $_POST['permalink_structure'] ) || isset( $_POST['category_base'] ) ) {
+ check_admin_referer( 'update-permalink' );
+
+ if ( isset( $_POST['permalink_structure'] ) ) {
+ if ( isset( $_POST['selection'] ) && 'custom' != $_POST['selection'] ) {
+ $permalink_structure = $_POST['selection'];
+ } else {
+ $permalink_structure = $_POST['permalink_structure'];
+ }
+
+ if ( ! empty( $permalink_structure ) ) {
+ $permalink_structure = preg_replace( '#/+#', '/', '/' . str_replace( '#', '', $permalink_structure ) );
+ if ( $prefix && $blog_prefix ) {
+ $permalink_structure = $prefix . preg_replace( '#^/?index\.php#', '', $permalink_structure );
+ } else {
+ $permalink_structure = $blog_prefix . $permalink_structure;
+ }
+ }
+
+ $permalink_structure = sanitize_option( 'permalink_structure', $permalink_structure );
+
+ $wp_rewrite->set_permalink_structure( $permalink_structure );
+ }
+
+ if ( isset( $_POST['category_base'] ) ) {
+ $category_base = $_POST['category_base'];
+ if ( ! empty( $category_base ) ) {
+ $category_base = $blog_prefix . preg_replace( '#/+#', '/', '/' . str_replace( '#', '', $category_base ) );
+ }
+ $wp_rewrite->set_category_base( $category_base );
+ }
+
+ if ( isset( $_POST['tag_base'] ) ) {
+ $tag_base = $_POST['tag_base'];
+ if ( ! empty( $tag_base ) ) {
+ $tag_base = $blog_prefix . preg_replace( '#/+#', '/', '/' . str_replace( '#', '', $tag_base ) );
+ }
+ $wp_rewrite->set_tag_base( $tag_base );
+ }
+
+ $message = __( 'Permalink structure updated.' );
+
+ if ( $iis7_permalinks ) {
+ if ( $permalink_structure && ! $using_index_permalinks && ! $writable ) {
+ $message = __( 'You should update your web.config now.' );
+ } elseif ( $permalink_structure && ! $using_index_permalinks && $writable ) {
+ $message = __( 'Permalink structure updated. Remove write access on web.config file now!' );
+ }
+ } elseif ( ! $is_nginx && $permalink_structure && ! $using_index_permalinks && ! $writable && $update_required ) {
+ $message = __( 'You should update your .htaccess now.' );
+ }
+
+ if ( ! get_settings_errors() ) {
+ add_settings_error( 'general', 'settings_updated', $message, 'updated' );
+ }
+
+ set_transient( 'settings_errors', get_settings_errors(), 30 );
+
+ wp_redirect( admin_url( 'options-permalink.php?settings-updated=true' ) );
+ exit;
+}
+
+flush_rewrite_rules();
+
+require( ABSPATH . 'wp-admin/admin-header.php' );
+?>
+<div class="wrap">
+<h1><?php echo esc_html( $title ); ?></h1>
+
+<form name="form" action="options-permalink.php" method="post">
+<?php wp_nonce_field( 'update-permalink' ); ?>
+
+ <p>
+ <?php
+ printf(
+ /* translators: %s: Codex URL */
+ __( 'WordPress offers you the ability to create a custom URL structure for your permalinks and archives. Custom URL structures can improve the aesthetics, usability, and forward-compatibility of your links. A <a href="%s">number of tags are available</a>, and here are some examples to get you started.' ),
+ __( 'https://codex.wordpress.org/Using_Permalinks' )
+ );
+ ?>
+ </p>
+
+<?php
+if ( is_multisite() && ! is_subdomain_install() && is_main_site() && 0 === strpos( $permalink_structure, '/blog/' ) ) {
+ $permalink_structure = preg_replace( '|^/?blog|', '', $permalink_structure );
+ $category_base = preg_replace( '|^/?blog|', '', $category_base );
+ $tag_base = preg_replace( '|^/?blog|', '', $tag_base );
+}
+
+$structures = array(
+ 0 => '',
+ 1 => $prefix . '/%year%/%monthnum%/%day%/%postname%/',
+ 2 => $prefix . '/%year%/%monthnum%/%postname%/',
+ 3 => $prefix . '/' . _x( 'archives', 'sample permalink base' ) . '/%post_id%',
+ 4 => $prefix . '/%postname%/',
+);
+?>
+<h2 class="title"><?php _e( 'Common Settings' ); ?></h2>
+<table class="form-table permalink-structure">
+ <tr>
+ <th scope="row"><label><input name="selection" type="radio" value="" <?php checked( '', $permalink_structure ); ?> /> <?php _e( 'Plain' ); ?></label></th>
+ <td><code><?php echo get_option( 'home' ); ?>/?p=123</code></td>
+ </tr>
+ <tr>
+ <th scope="row"><label><input name="selection" type="radio" value="<?php echo esc_attr( $structures[1] ); ?>" <?php checked( $structures[1], $permalink_structure ); ?> /> <?php _e( 'Day and name' ); ?></label></th>
+ <td><code><?php echo get_option( 'home' ) . $blog_prefix . $prefix . '/' . date( 'Y' ) . '/' . date( 'm' ) . '/' . date( 'd' ) . '/' . _x( 'sample-post', 'sample permalink structure' ) . '/'; ?></code></td>
+ </tr>
+ <tr>
+ <th scope="row"><label><input name="selection" type="radio" value="<?php echo esc_attr( $structures[2] ); ?>" <?php checked( $structures[2], $permalink_structure ); ?> /> <?php _e( 'Month and name' ); ?></label></th>
+ <td><code><?php echo get_option( 'home' ) . $blog_prefix . $prefix . '/' . date( 'Y' ) . '/' . date( 'm' ) . '/' . _x( 'sample-post', 'sample permalink structure' ) . '/'; ?></code></td>
+ </tr>
+ <tr>
+ <th scope="row"><label><input name="selection" type="radio" value="<?php echo esc_attr( $structures[3] ); ?>" <?php checked( $structures[3], $permalink_structure ); ?> /> <?php _e( 'Numeric' ); ?></label></th>
+ <td><code><?php echo get_option( 'home' ) . $blog_prefix . $prefix . '/' . _x( 'archives', 'sample permalink base' ) . '/123'; ?></code></td>
+ </tr>
+ <tr>
+ <th scope="row"><label><input name="selection" type="radio" value="<?php echo esc_attr( $structures[4] ); ?>" <?php checked( $structures[4], $permalink_structure ); ?> /> <?php _e( 'Post name' ); ?></label></th>
+ <td><code><?php echo get_option( 'home' ) . $blog_prefix . $prefix . '/' . _x( 'sample-post', 'sample permalink structure' ) . '/'; ?></code></td>
+ </tr>
+ <tr>
+ <th scope="row">
+ <label><input name="selection" id="custom_selection" type="radio" value="custom" <?php checked( ! in_array( $permalink_structure, $structures ) ); ?> />
+ <?php _e( 'Custom Structure' ); ?>
+ </label>
+ </th>
+ <td>
+ <code><?php echo get_option( 'home' ) . $blog_prefix; ?></code>
+ <input name="permalink_structure" id="permalink_structure" type="text" value="<?php echo esc_attr( $permalink_structure ); ?>" class="regular-text code" />
+ <div class="available-structure-tags hide-if-no-js">
+ <div id="custom_selection_updated" aria-live="assertive" class="screen-reader-text"></div>
+ <?php
+ $available_tags = array(
+ /* translators: %s: permalink structure tag */
+ 'year' => __( '%s (The year of the post, four digits, for example 2004.)' ),
+ /* translators: %s: permalink structure tag */
+ 'monthnum' => __( '%s (Month of the year, for example 05.)' ),
+ /* translators: %s: permalink structure tag */
+ 'day' => __( '%s (Day of the month, for example 28.)' ),
+ /* translators: %s: permalink structure tag */
+ 'hour' => __( '%s (Hour of the day, for example 15.)' ),
+ /* translators: %s: permalink structure tag */
+ 'minute' => __( '%s (Minute of the hour, for example 43.)' ),
+ /* translators: %s: permalink structure tag */
+ 'second' => __( '%s (Second of the minute, for example 33.)' ),
+ /* translators: %s: permalink structure tag */
+ 'post_id' => __( '%s (The unique ID of the post, for example 423.)' ),
+ /* translators: %s: permalink structure tag */
+ 'postname' => __( '%s (The sanitized post title (slug).)' ),
+ /* translators: %s: permalink structure tag */
+ 'category' => __( '%s (Category slug. Nested sub-categories appear as nested directories in the URL.)' ),
+ /* translators: %s: permalink structure tag */
+ 'author' => __( '%s (A sanitized version of the author name.)' ),
+ );
+
+ /**
+ * Filters the list of available permalink structure tags on the Permalinks settings page.
+ *
+ * @since 4.8.0
+ *
+ * @param string[] $available_tags An array of key => value pairs of available permalink structure tags.
+ */
+ $available_tags = apply_filters( 'available_permalink_structure_tags', $available_tags );
+
+ /* translators: %s: permalink structure tag */
+ $structure_tag_added = __( '%s added to permalink structure' );
+
+ /* translators: %s: permalink structure tag */
+ $structure_tag_already_used = __( '%s (already used in permalink structure)' );
+
+ if ( ! empty( $available_tags ) ) :
+ ?>
+ <p><?php _e( 'Available tags:' ); ?></p>
+ <ul role="list">
+ <?php
+ foreach ( $available_tags as $tag => $explanation ) {
+ ?>
+ <li>
+ <button type="button"
+ class="button button-secondary"
+ aria-label="<?php echo esc_attr( sprintf( $explanation, $tag ) ); ?>"
+ data-added="<?php echo esc_attr( sprintf( $structure_tag_added, $tag ) ); ?>"
+ data-used="<?php echo esc_attr( sprintf( $structure_tag_already_used, $tag ) ); ?>">
+ <?php echo '%' . $tag . '%'; ?>
+ </button>
+ </li>
+ <?php
+ }
+ ?>
+ </ul>
+ <?php endif; ?>
+ </div>
+ </td>
+ </tr>
+</table>
+
+<h2 class="title"><?php _e( 'Optional' ); ?></h2>
+<p>
+<?php
+/* translators: %s: placeholder that must come at the start of the URL */
+printf( __( 'If you like, you may enter custom structures for your category and tag URLs here. For example, using <code>topics</code> as your category base would make your category links like <code>%s/topics/uncategorized/</code>. If you leave these blank the defaults will be used.' ), get_option( 'home' ) . $blog_prefix . $prefix );
+?>
+</p>
+
+<table class="form-table" role="presentation">
+ <tr>
+ <th><label for="category_base"><?php /* translators: prefix for category permalinks */ _e( 'Category base' ); ?></label></th>
+ <td><?php echo $blog_prefix; ?> <input name="category_base" id="category_base" type="text" value="<?php echo esc_attr( $category_base ); ?>" class="regular-text code" /></td>
+ </tr>
+ <tr>
+ <th><label for="tag_base"><?php _e( 'Tag base' ); ?></label></th>
+ <td><?php echo $blog_prefix; ?> <input name="tag_base" id="tag_base" type="text" value="<?php echo esc_attr( $tag_base ); ?>" class="regular-text code" /></td>
+ </tr>
+ <?php do_settings_fields( 'permalink', 'optional' ); ?>
+</table>
+
+<?php do_settings_sections( 'permalink' ); ?>
+
+<?php submit_button(); ?>
+</form>
+<?php if ( ! is_multisite() ) { ?>
+ <?php
+ if ( $iis7_permalinks ) :
+ if ( isset( $_POST['submit'] ) && $permalink_structure && ! $using_index_permalinks && ! $writable ) :
+ if ( file_exists( $home_path . 'web.config' ) ) :
+ ?>
+<p>
+ <?php
+ printf(
+ /* translators: 1: web.config, 2: Codex URL, 3: CTRL + a, 4: element code */
+ __( 'If your %1$s file was <a href="%2$s">writable</a>, we could do this automatically, but it isn&#8217;t so this is the url rewrite rule you should have in your %1$s file. Click in the field and press %3$s to select all. Then insert this rule inside of the %4$s element in %1$s file.' ),
+ '<code>web.config</code>',
+ __( 'https://codex.wordpress.org/Changing_File_Permissions' ),
+ '<kbd>CTRL + a</kbd>',
+ '<code>/&lt;configuration&gt;/&lt;system.webServer&gt;/&lt;rewrite&gt;/&lt;rules&gt;</code>'
+ );
+ ?>
+</p>
+<form action="options-permalink.php" method="post">
+ <?php wp_nonce_field( 'update-permalink' ); ?>
+ <p><textarea rows="9" class="large-text readonly" name="rules" id="rules" readonly="readonly"><?php echo esc_textarea( $wp_rewrite->iis7_url_rewrite_rules() ); ?></textarea></p>
+</form>
+<p>
+ <?php
+ printf(
+ /* translators: %s: web.config */
+ __( 'If you temporarily make your %s file writable for us to generate rewrite rules automatically, do not forget to revert the permissions after rule has been saved.' ),
+ '<code>web.config</code>'
+ );
+ ?>
+</p>
+ <?php else : ?>
+<p>
+ <?php
+ printf(
+ /* translators: 1: Codex URL, 2: web.config, 3: CTRL + a */
+ __( 'If the root directory of your site was <a href="%1$s">writable</a>, we could do this automatically, but it isn&#8217;t so this is the url rewrite rule you should have in your %2$s file. Create a new file, called %2$s in the root directory of your site. Click in the field and press %3$s to select all. Then insert this code into the %2$s file.' ),
+ __( 'https://codex.wordpress.org/Changing_File_Permissions' ),
+ '<code>web.config</code>',
+ '<kbd>CTRL + a</kbd>'
+ );
+ ?>
+</p>
+<form action="options-permalink.php" method="post">
+ <?php wp_nonce_field( 'update-permalink' ); ?>
+ <p><textarea rows="18" class="large-text readonly" name="rules" id="rules" readonly="readonly"><?php echo esc_textarea( $wp_rewrite->iis7_url_rewrite_rules( true ) ); ?></textarea></p>
+</form>
+<p>
+ <?php
+ printf(
+ /* translators: %s: web.config */
+ __( 'If you temporarily make your site&#8217;s root directory writable for us to generate the %s file automatically, do not forget to revert the permissions after the file has been created.' ),
+ '<code>web.config</code>'
+ );
+ ?>
+</p>
+ <?php endif; ?>
+ <?php endif; ?>
+<?php elseif ( $is_nginx ) : ?>
+ <p><?php _e( '<a href="https://codex.wordpress.org/Nginx">Documentation on Nginx configuration</a>.' ); ?></p>
+ <?php
+else :
+ if ( $permalink_structure && ! $using_index_permalinks && ! $writable && $update_required ) :
+ ?>
+<p>
+ <?php
+ printf(
+ /* translators: 1: .htaccess, 2: Codex URL, 3: CTRL + a */
+ __( 'If your %1$s file was <a href="%2$s">writable</a>, we could do this automatically, but it isn&#8217;t so these are the mod_rewrite rules you should have in your %1$s file. Click in the field and press %3$s to select all.' ),
+ '<code>.htaccess</code>',
+ __( 'https://codex.wordpress.org/Changing_File_Permissions' ),
+ '<kbd>CTRL + a</kbd>'
+ );
+ ?>
+</p>
+<form action="options-permalink.php" method="post">
+ <?php wp_nonce_field( 'update-permalink' ); ?>
+ <p><textarea rows="6" class="large-text readonly" name="rules" id="rules" readonly="readonly"><?php echo esc_textarea( $wp_rewrite->mod_rewrite_rules() ); ?></textarea></p>
+</form>
+ <?php endif; ?>
+<?php endif; ?>
+<?php } // multisite ?>
+
+</div>
+
+<?php require( ABSPATH . 'wp-admin/admin-footer.php' ); ?>
diff --git a/www/crm/wp-admin/options-reading.php b/www/crm/wp-admin/options-reading.php
new file mode 100644
index 00000000..5921e86e
--- /dev/null
+++ b/www/crm/wp-admin/options-reading.php
@@ -0,0 +1,188 @@
+<?php
+/**
+ * Reading settings administration panel.
+ *
+ * @package WordPress
+ * @subpackage Administration
+ */
+
+/** WordPress Administration Bootstrap */
+require_once( dirname( __FILE__ ) . '/admin.php' );
+
+if ( ! current_user_can( 'manage_options' ) ) {
+ wp_die( __( 'Sorry, you are not allowed to manage options for this site.' ) );
+}
+
+$title = __( 'Reading Settings' );
+$parent_file = 'options-general.php';
+
+add_action( 'admin_head', 'options_reading_add_js' );
+
+get_current_screen()->add_help_tab(
+ array(
+ 'id' => 'overview',
+ 'title' => __( 'Overview' ),
+ 'content' => '<p>' . __( 'This screen contains the settings that affect the display of your content.' ) . '</p>' .
+ '<p>' . sprintf( __( 'You can choose what&#8217;s displayed on the homepage of your site. It can be posts in reverse chronological order (classic blog), or a fixed/static page. To set a static homepage, you first need to create two <a href="%s">Pages</a>. One will become the homepage, and the other will be where your posts are displayed.' ), 'post-new.php?post_type=page' ) . '</p>' .
+ '<p>' . __( 'You can also control the display of your content in RSS feeds, including the maximum number of posts to display and whether to show full text or a summary.' ) . '</p>' .
+ '<p>' . __( 'You must click the Save Changes button at the bottom of the screen for new settings to take effect.' ) . '</p>',
+ )
+);
+
+get_current_screen()->add_help_tab(
+ array(
+ 'id' => 'site-visibility',
+ 'title' => has_action( 'blog_privacy_selector' ) ? __( 'Site Visibility' ) : __( 'Search Engine Visibility' ),
+ 'content' => '<p>' . __( 'You can choose whether or not your site will be crawled by robots, ping services, and spiders. If you want those services to ignore your site, click the checkbox next to &#8220;Discourage search engines from indexing this site&#8221; and click the Save Changes button at the bottom of the screen. Note that your privacy is not complete; your site is still visible on the web.' ) . '</p>' .
+ '<p>' . __( 'When this setting is in effect, a reminder is shown in the At a Glance box of the Dashboard that says, &#8220;Search Engines Discouraged,&#8221; to remind you that your site is not being crawled.' ) . '</p>',
+ )
+);
+
+get_current_screen()->set_help_sidebar(
+ '<p><strong>' . __( 'For more information:' ) . '</strong></p>' .
+ '<p>' . __( '<a href="https://codex.wordpress.org/Settings_Reading_Screen">Documentation on Reading Settings</a>' ) . '</p>' .
+ '<p>' . __( '<a href="https://wordpress.org/support/">Support</a>' ) . '</p>'
+);
+
+include( ABSPATH . 'wp-admin/admin-header.php' );
+?>
+
+<div class="wrap">
+<h1><?php echo esc_html( $title ); ?></h1>
+
+<form method="post" action="options.php">
+<?php
+settings_fields( 'reading' );
+
+if ( ! in_array( get_option( 'blog_charset' ), array( 'utf8', 'utf-8', 'UTF8', 'UTF-8' ) ) ) {
+ add_settings_field( 'blog_charset', __( 'Encoding for pages and feeds' ), 'options_reading_blog_charset', 'reading', 'default', array( 'label_for' => 'blog_charset' ) );
+}
+?>
+
+<?php if ( ! get_pages() ) : ?>
+<input name="show_on_front" type="hidden" value="posts" />
+<table class="form-table" role="presentation">
+ <?php
+ if ( 'posts' != get_option( 'show_on_front' ) ) :
+ update_option( 'show_on_front', 'posts' );
+ endif;
+
+else :
+ if ( 'page' == get_option( 'show_on_front' ) && ! get_option( 'page_on_front' ) && ! get_option( 'page_for_posts' ) ) {
+ update_option( 'show_on_front', 'posts' );
+ }
+ ?>
+<table class="form-table" role="presentation">
+<tr>
+<th scope="row"><?php _e( 'Your homepage displays' ); ?></th>
+<td id="front-static-pages"><fieldset><legend class="screen-reader-text"><span><?php _e( 'Your homepage displays' ); ?></span></legend>
+ <p><label>
+ <input name="show_on_front" type="radio" value="posts" class="tog" <?php checked( 'posts', get_option( 'show_on_front' ) ); ?> />
+ <?php _e( 'Your latest posts' ); ?>
+ </label>
+ </p>
+ <p><label>
+ <input name="show_on_front" type="radio" value="page" class="tog" <?php checked( 'page', get_option( 'show_on_front' ) ); ?> />
+ <?php printf( __( 'A <a href="%s">static page</a> (select below)' ), 'edit.php?post_type=page' ); ?>
+ </label>
+ </p>
+<ul>
+ <li><label for="page_on_front">
+ <?php
+ printf(
+ __( 'Homepage: %s' ),
+ wp_dropdown_pages(
+ array(
+ 'name' => 'page_on_front',
+ 'echo' => 0,
+ 'show_option_none' => __( '&mdash; Select &mdash;' ),
+ 'option_none_value' => '0',
+ 'selected' => get_option( 'page_on_front' ),
+ )
+ )
+ );
+ ?>
+</label></li>
+ <li><label for="page_for_posts">
+ <?php
+ printf(
+ __( 'Posts page: %s' ),
+ wp_dropdown_pages(
+ array(
+ 'name' => 'page_for_posts',
+ 'echo' => 0,
+ 'show_option_none' => __( '&mdash; Select &mdash;' ),
+ 'option_none_value' => '0',
+ 'selected' => get_option( 'page_for_posts' ),
+ )
+ )
+ );
+ ?>
+</label></li>
+</ul>
+ <?php if ( 'page' == get_option( 'show_on_front' ) && get_option( 'page_for_posts' ) == get_option( 'page_on_front' ) ) : ?>
+<div id="front-page-warning" class="error inline"><p><?php _e( '<strong>Warning:</strong> these pages should not be the same!' ); ?></p></div>
+<?php endif; ?>
+</fieldset></td>
+</tr>
+<?php endif; ?>
+<tr>
+<th scope="row"><label for="posts_per_page"><?php _e( 'Blog pages show at most' ); ?></label></th>
+<td>
+<input name="posts_per_page" type="number" step="1" min="1" id="posts_per_page" value="<?php form_option( 'posts_per_page' ); ?>" class="small-text" /> <?php _e( 'posts' ); ?>
+</td>
+</tr>
+<tr>
+<th scope="row"><label for="posts_per_rss"><?php _e( 'Syndication feeds show the most recent' ); ?></label></th>
+<td><input name="posts_per_rss" type="number" step="1" min="1" id="posts_per_rss" value="<?php form_option( 'posts_per_rss' ); ?>" class="small-text" /> <?php _e( 'items' ); ?></td>
+</tr>
+<tr>
+<th scope="row"><?php _e( 'For each article in a feed, show' ); ?> </th>
+<td><fieldset><legend class="screen-reader-text"><span><?php _e( 'For each article in a feed, show' ); ?> </span></legend>
+<p><label><input name="rss_use_excerpt" type="radio" value="0" <?php checked( 0, get_option( 'rss_use_excerpt' ) ); ?> /> <?php _e( 'Full text' ); ?></label><br />
+<label><input name="rss_use_excerpt" type="radio" value="1" <?php checked( 1, get_option( 'rss_use_excerpt' ) ); ?> /> <?php _e( 'Summary' ); ?></label></p>
+</fieldset></td>
+</tr>
+
+<tr class="option-site-visibility">
+<th scope="row"><?php has_action( 'blog_privacy_selector' ) ? _e( 'Site Visibility' ) : _e( 'Search Engine Visibility' ); ?> </th>
+<td><fieldset><legend class="screen-reader-text"><span><?php has_action( 'blog_privacy_selector' ) ? _e( 'Site Visibility' ) : _e( 'Search Engine Visibility' ); ?> </span></legend>
+<?php if ( has_action( 'blog_privacy_selector' ) ) : ?>
+ <input id="blog-public" type="radio" name="blog_public" value="1" <?php checked( '1', get_option( 'blog_public' ) ); ?> />
+ <label for="blog-public"><?php _e( 'Allow search engines to index this site' ); ?></label><br/>
+ <input id="blog-norobots" type="radio" name="blog_public" value="0" <?php checked( '0', get_option( 'blog_public' ) ); ?> />
+ <label for="blog-norobots"><?php _e( 'Discourage search engines from indexing this site' ); ?></label>
+ <p class="description"><?php _e( 'Note: Neither of these options blocks access to your site &mdash; it is up to search engines to honor your request.' ); ?></p>
+ <?php
+ /**
+ * Enable the legacy 'Site Visibility' privacy options.
+ *
+ * By default the privacy options form displays a single checkbox to 'discourage' search
+ * engines from indexing the site. Hooking to this action serves a dual purpose:
+ * 1. Disable the single checkbox in favor of a multiple-choice list of radio buttons.
+ * 2. Open the door to adding additional radio button choices to the list.
+ *
+ * Hooking to this action also converts the 'Search Engine Visibility' heading to the more
+ * open-ended 'Site Visibility' heading.
+ *
+ * @since 2.1.0
+ */
+ do_action( 'blog_privacy_selector' );
+ ?>
+<?php else : ?>
+ <label for="blog_public"><input name="blog_public" type="checkbox" id="blog_public" value="0" <?php checked( '0', get_option( 'blog_public' ) ); ?> />
+ <?php _e( 'Discourage search engines from indexing this site' ); ?></label>
+ <p class="description"><?php _e( 'It is up to search engines to honor this request.' ); ?></p>
+<?php endif; ?>
+</fieldset></td>
+</tr>
+
+<?php do_settings_fields( 'reading', 'default' ); ?>
+</table>
+
+<?php do_settings_sections( 'reading' ); ?>
+
+<?php submit_button(); ?>
+</form>
+</div>
+<?php include( ABSPATH . 'wp-admin/admin-footer.php' ); ?>
diff --git a/www/crm/wp-admin/options-writing.php b/www/crm/wp-admin/options-writing.php
new file mode 100644
index 00000000..a5207a32
--- /dev/null
+++ b/www/crm/wp-admin/options-writing.php
@@ -0,0 +1,239 @@
+<?php
+/**
+ * Writing settings administration panel.
+ *
+ * @package WordPress
+ * @subpackage Administration
+ */
+
+/** WordPress Administration Bootstrap */
+require_once( dirname( __FILE__ ) . '/admin.php' );
+
+if ( ! current_user_can( 'manage_options' ) ) {
+ wp_die( __( 'Sorry, you are not allowed to manage options for this site.' ) );
+}
+
+$title = __( 'Writing Settings' );
+$parent_file = 'options-general.php';
+
+get_current_screen()->add_help_tab(
+ array(
+ 'id' => 'overview',
+ 'title' => __( 'Overview' ),
+ 'content' => '<p>' . __( 'You can submit content in several different ways; this screen holds the settings for all of them. The top section controls the editor within the dashboard, while the rest control external publishing methods. For more information on any of these methods, use the documentation links.' ) . '</p>' .
+ '<p>' . __( 'You must click the Save Changes button at the bottom of the screen for new settings to take effect.' ) . '</p>',
+ )
+);
+
+/** This filter is documented in wp-admin/options.php */
+if ( apply_filters( 'enable_post_by_email_configuration', true ) ) {
+ get_current_screen()->add_help_tab(
+ array(
+ 'id' => 'options-postemail',
+ 'title' => __( 'Post Via Email' ),
+ 'content' => '<p>' . __( 'Post via email settings allow you to send your WordPress installation an email with the content of your post. You must set up a secret email account with POP3 access to use this, and any mail received at this address will be posted, so it&#8217;s a good idea to keep this address very secret.' ) . '</p>',
+ )
+ );
+}
+
+/** This filter is documented in wp-admin/options-writing.php */
+if ( apply_filters( 'enable_update_services_configuration', true ) ) {
+ get_current_screen()->add_help_tab(
+ array(
+ 'id' => 'options-services',
+ 'title' => __( 'Update Services' ),
+ 'content' => '<p>' . __( 'If desired, WordPress will automatically alert various services of your new posts.' ) . '</p>',
+ )
+ );
+}
+
+get_current_screen()->set_help_sidebar(
+ '<p><strong>' . __( 'For more information:' ) . '</strong></p>' .
+ '<p>' . __( '<a href="https://codex.wordpress.org/Settings_Writing_Screen">Documentation on Writing Settings</a>' ) . '</p>' .
+ '<p>' . __( '<a href="https://wordpress.org/support/">Support</a>' ) . '</p>'
+);
+
+include( ABSPATH . 'wp-admin/admin-header.php' );
+?>
+
+<div class="wrap">
+<h1><?php echo esc_html( $title ); ?></h1>
+
+<form method="post" action="options.php">
+<?php settings_fields( 'writing' ); ?>
+
+<table class="form-table" role="presentation">
+<?php if ( get_site_option( 'initial_db_version' ) < 32453 ) : ?>
+<tr>
+<th scope="row"><?php _e( 'Formatting' ); ?></th>
+<td><fieldset><legend class="screen-reader-text"><span><?php _e( 'Formatting' ); ?></span></legend>
+<label for="use_smilies">
+<input name="use_smilies" type="checkbox" id="use_smilies" value="1" <?php checked( '1', get_option( 'use_smilies' ) ); ?> />
+ <?php _e( 'Convert emoticons like <code>:-)</code> and <code>:-P</code> to graphics on display' ); ?></label><br />
+<label for="use_balanceTags"><input name="use_balanceTags" type="checkbox" id="use_balanceTags" value="1" <?php checked( '1', get_option( 'use_balanceTags' ) ); ?> /> <?php _e( 'WordPress should correct invalidly nested XHTML automatically' ); ?></label>
+</fieldset></td>
+</tr>
+<?php endif; ?>
+<tr>
+<th scope="row"><label for="default_category"><?php _e( 'Default Post Category' ); ?></label></th>
+<td>
+<?php
+wp_dropdown_categories(
+ array(
+ 'hide_empty' => 0,
+ 'name' => 'default_category',
+ 'orderby' => 'name',
+ 'selected' => get_option( 'default_category' ),
+ 'hierarchical' => true,
+ )
+);
+?>
+</td>
+</tr>
+<?php
+$post_formats = get_post_format_strings();
+unset( $post_formats['standard'] );
+?>
+<tr>
+<th scope="row"><label for="default_post_format"><?php _e( 'Default Post Format' ); ?></label></th>
+<td>
+ <select name="default_post_format" id="default_post_format">
+ <option value="0"><?php echo get_post_format_string( 'standard' ); ?></option>
+<?php foreach ( $post_formats as $format_slug => $format_name ) : ?>
+ <option<?php selected( get_option( 'default_post_format' ), $format_slug ); ?> value="<?php echo esc_attr( $format_slug ); ?>"><?php echo esc_html( $format_name ); ?></option>
+<?php endforeach; ?>
+ </select>
+</td>
+</tr>
+<?php
+if ( get_option( 'link_manager_enabled' ) ) :
+ ?>
+<tr>
+<th scope="row"><label for="default_link_category"><?php _e( 'Default Link Category' ); ?></label></th>
+<td>
+ <?php
+ wp_dropdown_categories(
+ array(
+ 'hide_empty' => 0,
+ 'name' => 'default_link_category',
+ 'orderby' => 'name',
+ 'selected' => get_option( 'default_link_category' ),
+ 'hierarchical' => true,
+ 'taxonomy' => 'link_category',
+ )
+ );
+ ?>
+</td>
+</tr>
+<?php endif; ?>
+
+<?php
+do_settings_fields( 'writing', 'default' );
+do_settings_fields( 'writing', 'remote_publishing' ); // A deprecated section.
+?>
+</table>
+
+<?php
+/** This filter is documented in wp-admin/options.php */
+if ( apply_filters( 'enable_post_by_email_configuration', true ) ) {
+ ?>
+<h2 class="title"><?php _e( 'Post via email' ); ?></h2>
+<p>
+ <?php
+ printf(
+ /* translators: 1, 2, 3: examples of random email addresses */
+ __( 'To post to WordPress by email you must set up a secret email account with POP3 access. Any mail received at this address will be posted, so it&#8217;s a good idea to keep this address very secret. Here are three random strings you could use: %1$s, %2$s, %3$s.' ),
+ sprintf( '<kbd>%s</kbd>', wp_generate_password( 8, false ) ),
+ sprintf( '<kbd>%s</kbd>', wp_generate_password( 8, false ) ),
+ sprintf( '<kbd>%s</kbd>', wp_generate_password( 8, false ) )
+ );
+ ?>
+</p>
+
+<table class="form-table" role="presentation">
+<tr>
+<th scope="row"><label for="mailserver_url"><?php _e( 'Mail Server' ); ?></label></th>
+<td><input name="mailserver_url" type="text" id="mailserver_url" value="<?php form_option( 'mailserver_url' ); ?>" class="regular-text code" />
+<label for="mailserver_port"><?php _e( 'Port' ); ?></label>
+<input name="mailserver_port" type="text" id="mailserver_port" value="<?php form_option( 'mailserver_port' ); ?>" class="small-text" />
+</td>
+</tr>
+<tr>
+<th scope="row"><label for="mailserver_login"><?php _e( 'Login Name' ); ?></label></th>
+<td><input name="mailserver_login" type="text" id="mailserver_login" value="<?php form_option( 'mailserver_login' ); ?>" class="regular-text ltr" /></td>
+</tr>
+<tr>
+<th scope="row"><label for="mailserver_pass"><?php _e( 'Password' ); ?></label></th>
+<td>
+<input name="mailserver_pass" type="text" id="mailserver_pass" value="<?php form_option( 'mailserver_pass' ); ?>" class="regular-text ltr" />
+</td>
+</tr>
+<tr>
+<th scope="row"><label for="default_email_category"><?php _e( 'Default Mail Category' ); ?></label></th>
+<td>
+ <?php
+ wp_dropdown_categories(
+ array(
+ 'hide_empty' => 0,
+ 'name' => 'default_email_category',
+ 'orderby' => 'name',
+ 'selected' => get_option( 'default_email_category' ),
+ 'hierarchical' => true,
+ )
+ );
+ ?>
+</td>
+</tr>
+ <?php do_settings_fields( 'writing', 'post_via_email' ); ?>
+</table>
+<?php } ?>
+
+<?php
+/**
+ * Filters whether to enable the Update Services section in the Writing settings screen.
+ *
+ * @since 3.0.0
+ *
+ * @param bool $enable Whether to enable the Update Services settings area. Default true.
+ */
+if ( apply_filters( 'enable_update_services_configuration', true ) ) {
+ ?>
+<h2 class="title"><?php _e( 'Update Services' ); ?></h2>
+
+ <?php if ( 1 == get_option( 'blog_public' ) ) : ?>
+
+ <p><label for="ping_sites">
+ <?php
+ printf(
+ /* translators: %s: Codex URL */
+ __( 'When you publish a new post, WordPress automatically notifies the following site update services. For more about this, see <a href="%s">Update Services</a> on the Codex. Separate multiple service URLs with line breaks.' ),
+ __( 'https://codex.wordpress.org/Update_Services' )
+ );
+ ?>
+ </label></p>
+
+ <textarea name="ping_sites" id="ping_sites" class="large-text code" rows="3"><?php echo esc_textarea( get_option( 'ping_sites' ) ); ?></textarea>
+
+ <?php else : ?>
+
+ <p>
+ <?php
+ printf(
+ /* translators: 1: Codex URL, 2: Reading Settings URL */
+ __( 'WordPress is not notifying any <a href="%1$s">Update Services</a> because of your site&#8217;s <a href="%2$s">visibility settings</a>.' ),
+ __( 'https://codex.wordpress.org/Update_Services' ),
+ 'options-reading.php'
+ );
+ ?>
+ </p>
+
+ <?php endif; ?>
+<?php } // enable_update_services_configuration ?>
+
+<?php do_settings_sections( 'writing' ); ?>
+
+<?php submit_button(); ?>
+</form>
+</div>
+
+<?php include( ABSPATH . 'wp-admin/admin-footer.php' ); ?>
diff --git a/www/crm/wp-admin/options.php b/www/crm/wp-admin/options.php
new file mode 100644
index 00000000..c0780105
--- /dev/null
+++ b/www/crm/wp-admin/options.php
@@ -0,0 +1,370 @@
+<?php
+/**
+ * Options Management Administration Screen.
+ *
+ * If accessed directly in a browser this page shows a list of all saved options
+ * along with editable fields for their values. Serialized data is not supported
+ * and there is no way to remove options via this page. It is not linked to from
+ * anywhere else in the admin.
+ *
+ * This file is also the target of the forms in core and custom options pages
+ * that use the Settings API. In this case it saves the new option values
+ * and returns the user to their page of origin.
+ *
+ * @package WordPress
+ * @subpackage Administration
+ */
+
+/** WordPress Administration Bootstrap */
+require_once( dirname( __FILE__ ) . '/admin.php' );
+
+$title = __( 'Settings' );
+$this_file = 'options.php';
+$parent_file = 'options-general.php';
+
+wp_reset_vars( array( 'action', 'option_page' ) );
+
+$capability = 'manage_options';
+
+// This is for back compat and will eventually be removed.
+if ( empty( $option_page ) ) {
+ $option_page = 'options';
+} else {
+
+ /**
+ * Filters the capability required when using the Settings API.
+ *
+ * By default, the options groups for all registered settings require the manage_options capability.
+ * This filter is required to change the capability required for a certain options page.
+ *
+ * @since 3.2.0
+ *
+ * @param string $capability The capability used for the page, which is manage_options by default.
+ */
+ $capability = apply_filters( "option_page_capability_{$option_page}", $capability );
+}
+
+if ( ! current_user_can( $capability ) ) {
+ wp_die(
+ '<h1>' . __( 'You need a higher level of permission.' ) . '</h1>' .
+ '<p>' . __( 'Sorry, you are not allowed to manage these options.' ) . '</p>',
+ 403
+ );
+}
+
+// Handle admin email change requests
+if ( ! empty( $_GET['adminhash'] ) ) {
+ $new_admin_details = get_option( 'adminhash' );
+ $redirect = 'options-general.php?updated=false';
+ if ( is_array( $new_admin_details ) && hash_equals( $new_admin_details['hash'], $_GET['adminhash'] ) && ! empty( $new_admin_details['newemail'] ) ) {
+ update_option( 'admin_email', $new_admin_details['newemail'] );
+ delete_option( 'adminhash' );
+ delete_option( 'new_admin_email' );
+ $redirect = 'options-general.php?updated=true';
+ }
+ wp_redirect( admin_url( $redirect ) );
+ exit;
+} elseif ( ! empty( $_GET['dismiss'] ) && 'new_admin_email' == $_GET['dismiss'] ) {
+ check_admin_referer( 'dismiss-' . get_current_blog_id() . '-new_admin_email' );
+ delete_option( 'adminhash' );
+ delete_option( 'new_admin_email' );
+ wp_redirect( admin_url( 'options-general.php?updated=true' ) );
+ exit;
+}
+
+if ( is_multisite() && ! current_user_can( 'manage_network_options' ) && 'update' != $action ) {
+ wp_die(
+ '<h1>' . __( 'You need a higher level of permission.' ) . '</h1>' .
+ '<p>' . __( 'Sorry, you are not allowed to delete these items.' ) . '</p>',
+ 403
+ );
+}
+
+$whitelist_options = array(
+ 'general' => array(
+ 'blogname',
+ 'blogdescription',
+ 'gmt_offset',
+ 'date_format',
+ 'time_format',
+ 'start_of_week',
+ 'timezone_string',
+ 'WPLANG',
+ 'new_admin_email',
+ ),
+ 'discussion' => array(
+ 'default_pingback_flag',
+ 'default_ping_status',
+ 'default_comment_status',
+ 'comments_notify',
+ 'moderation_notify',
+ 'comment_moderation',
+ 'require_name_email',
+ 'comment_whitelist',
+ 'comment_max_links',
+ 'moderation_keys',
+ 'blacklist_keys',
+ 'show_avatars',
+ 'avatar_rating',
+ 'avatar_default',
+ 'close_comments_for_old_posts',
+ 'close_comments_days_old',
+ 'thread_comments',
+ 'thread_comments_depth',
+ 'page_comments',
+ 'comments_per_page',
+ 'default_comments_page',
+ 'comment_order',
+ 'comment_registration',
+ 'show_comments_cookies_opt_in',
+ ),
+ 'media' => array(
+ 'thumbnail_size_w',
+ 'thumbnail_size_h',
+ 'thumbnail_crop',
+ 'medium_size_w',
+ 'medium_size_h',
+ 'large_size_w',
+ 'large_size_h',
+ 'image_default_size',
+ 'image_default_align',
+ 'image_default_link_type',
+ ),
+ 'reading' => array(
+ 'posts_per_page',
+ 'posts_per_rss',
+ 'rss_use_excerpt',
+ 'show_on_front',
+ 'page_on_front',
+ 'page_for_posts',
+ 'blog_public',
+ ),
+ 'writing' => array(
+ 'default_category',
+ 'default_email_category',
+ 'default_link_category',
+ 'default_post_format',
+ ),
+);
+$whitelist_options['misc'] = $whitelist_options['options'] = $whitelist_options['privacy'] = array();
+
+$mail_options = array( 'mailserver_url', 'mailserver_port', 'mailserver_login', 'mailserver_pass' );
+
+if ( ! in_array( get_option( 'blog_charset' ), array( 'utf8', 'utf-8', 'UTF8', 'UTF-8' ) ) ) {
+ $whitelist_options['reading'][] = 'blog_charset';
+}
+
+if ( get_site_option( 'initial_db_version' ) < 32453 ) {
+ $whitelist_options['writing'][] = 'use_smilies';
+ $whitelist_options['writing'][] = 'use_balanceTags';
+}
+
+if ( ! is_multisite() ) {
+ if ( ! defined( 'WP_SITEURL' ) ) {
+ $whitelist_options['general'][] = 'siteurl';
+ }
+ if ( ! defined( 'WP_HOME' ) ) {
+ $whitelist_options['general'][] = 'home';
+ }
+
+ $whitelist_options['general'][] = 'users_can_register';
+ $whitelist_options['general'][] = 'default_role';
+
+ $whitelist_options['writing'] = array_merge( $whitelist_options['writing'], $mail_options );
+ $whitelist_options['writing'][] = 'ping_sites';
+
+ $whitelist_options['media'][] = 'uploads_use_yearmonth_folders';
+
+ // If upload_url_path and upload_path are both default values, they're locked.
+ if ( get_option( 'upload_url_path' ) || ( get_option( 'upload_path' ) != 'wp-content/uploads' && get_option( 'upload_path' ) ) ) {
+ $whitelist_options['media'][] = 'upload_path';
+ $whitelist_options['media'][] = 'upload_url_path';
+ }
+} else {
+ /**
+ * Filters whether the post-by-email functionality is enabled.
+ *
+ * @since 3.0.0
+ *
+ * @param bool $enabled Whether post-by-email configuration is enabled. Default true.
+ */
+ if ( apply_filters( 'enable_post_by_email_configuration', true ) ) {
+ $whitelist_options['writing'] = array_merge( $whitelist_options['writing'], $mail_options );
+ }
+}
+
+/**
+ * Filters the options white list.
+ *
+ * @since 2.7.0
+ *
+ * @param array $whitelist_options White list options.
+ */
+$whitelist_options = apply_filters( 'whitelist_options', $whitelist_options );
+
+/*
+ * If $_GET['action'] == 'update' we are saving settings sent from a settings page
+ */
+if ( 'update' == $action ) {
+ if ( 'options' == $option_page && ! isset( $_POST['option_page'] ) ) { // This is for back compat and will eventually be removed.
+ $unregistered = true;
+ check_admin_referer( 'update-options' );
+ } else {
+ $unregistered = false;
+ check_admin_referer( $option_page . '-options' );
+ }
+
+ if ( ! isset( $whitelist_options[ $option_page ] ) ) {
+ wp_die( __( '<strong>ERROR</strong>: options page not found.' ) );
+ }
+
+ if ( 'options' == $option_page ) {
+ if ( is_multisite() && ! current_user_can( 'manage_network_options' ) ) {
+ wp_die( __( 'Sorry, you are not allowed to modify unregistered settings for this site.' ) );
+ }
+ $options = explode( ',', wp_unslash( $_POST['page_options'] ) );
+ } else {
+ $options = $whitelist_options[ $option_page ];
+ }
+
+ if ( 'general' == $option_page ) {
+ // Handle custom date/time formats.
+ if ( ! empty( $_POST['date_format'] ) && isset( $_POST['date_format_custom'] ) && '\c\u\s\t\o\m' == wp_unslash( $_POST['date_format'] ) ) {
+ $_POST['date_format'] = $_POST['date_format_custom'];
+ }
+ if ( ! empty( $_POST['time_format'] ) && isset( $_POST['time_format_custom'] ) && '\c\u\s\t\o\m' == wp_unslash( $_POST['time_format'] ) ) {
+ $_POST['time_format'] = $_POST['time_format_custom'];
+ }
+ // Map UTC+- timezones to gmt_offsets and set timezone_string to empty.
+ if ( ! empty( $_POST['timezone_string'] ) && preg_match( '/^UTC[+-]/', $_POST['timezone_string'] ) ) {
+ $_POST['gmt_offset'] = $_POST['timezone_string'];
+ $_POST['gmt_offset'] = preg_replace( '/UTC\+?/', '', $_POST['gmt_offset'] );
+ $_POST['timezone_string'] = '';
+ }
+
+ // Handle translation installation.
+ if ( ! empty( $_POST['WPLANG'] ) && current_user_can( 'install_languages' ) ) {
+ require_once( ABSPATH . 'wp-admin/includes/translation-install.php' );
+
+ if ( wp_can_install_language_pack() ) {
+ $language = wp_download_language_pack( $_POST['WPLANG'] );
+ if ( $language ) {
+ $_POST['WPLANG'] = $language;
+ }
+ }
+ }
+ }
+
+ if ( $options ) {
+ $user_language_old = get_user_locale();
+
+ foreach ( $options as $option ) {
+ if ( $unregistered ) {
+ _deprecated_argument(
+ 'options.php',
+ '2.7.0',
+ sprintf(
+ /* translators: %s: the option/setting */
+ __( 'The %s setting is unregistered. Unregistered settings are deprecated. See https://codex.wordpress.org/Settings_API' ),
+ '<code>' . $option . '</code>'
+ )
+ );
+ }
+
+ $option = trim( $option );
+ $value = null;
+ if ( isset( $_POST[ $option ] ) ) {
+ $value = $_POST[ $option ];
+ if ( ! is_array( $value ) ) {
+ $value = trim( $value );
+ }
+ $value = wp_unslash( $value );
+ }
+ update_option( $option, $value );
+ }
+
+ /*
+ * Switch translation in case WPLANG was changed.
+ * The global $locale is used in get_locale() which is
+ * used as a fallback in get_user_locale().
+ */
+ unset( $GLOBALS['locale'] );
+ $user_language_new = get_user_locale();
+ if ( $user_language_old !== $user_language_new ) {
+ load_default_textdomain( $user_language_new );
+ }
+ }
+
+ /**
+ * Handle settings errors and return to options page
+ */
+ // If no settings errors were registered add a general 'updated' message.
+ if ( ! count( get_settings_errors() ) ) {
+ add_settings_error( 'general', 'settings_updated', __( 'Settings saved.' ), 'updated' );
+ }
+ set_transient( 'settings_errors', get_settings_errors(), 30 );
+
+ /**
+ * Redirect back to the settings page that was submitted
+ */
+ $goback = add_query_arg( 'settings-updated', 'true', wp_get_referer() );
+ wp_redirect( $goback );
+ exit;
+}
+
+include( ABSPATH . 'wp-admin/admin-header.php' ); ?>
+
+<div class="wrap">
+ <h1><?php esc_html_e( 'All Settings' ); ?></h1>
+ <form name="form" action="options.php" method="post" id="all-options">
+ <?php wp_nonce_field( 'options-options' ); ?>
+ <input type="hidden" name="action" value="update" />
+ <input type="hidden" name="option_page" value="options" />
+ <table class="form-table" role="presentation">
+<?php
+$options = $wpdb->get_results( "SELECT * FROM $wpdb->options ORDER BY option_name" );
+
+foreach ( (array) $options as $option ) :
+ $disabled = false;
+ if ( $option->option_name == '' ) {
+ continue;
+ }
+ if ( is_serialized( $option->option_value ) ) {
+ if ( is_serialized_string( $option->option_value ) ) {
+ // This is a serialized string, so we should display it.
+ $value = maybe_unserialize( $option->option_value );
+ $options_to_update[] = $option->option_name;
+ $class = 'all-options';
+ } else {
+ $value = 'SERIALIZED DATA';
+ $disabled = true;
+ $class = 'all-options disabled';
+ }
+ } else {
+ $value = $option->option_value;
+ $options_to_update[] = $option->option_name;
+ $class = 'all-options';
+ }
+ $name = esc_attr( $option->option_name );
+ ?>
+<tr>
+ <th scope="row"><label for="<?php echo $name; ?>"><?php echo esc_html( $option->option_name ); ?></label></th>
+<td>
+ <?php if ( strpos( $value, "\n" ) !== false ) : ?>
+ <textarea class="<?php echo $class; ?>" name="<?php echo $name; ?>" id="<?php echo $name; ?>" cols="30" rows="5"><?php echo esc_textarea( $value ); ?></textarea>
+ <?php else : ?>
+ <input class="regular-text <?php echo $class; ?>" type="text" name="<?php echo $name; ?>" id="<?php echo $name; ?>" value="<?php echo esc_attr( $value ); ?>"<?php disabled( $disabled, true ); ?> />
+ <?php endif ?></td>
+</tr>
+<?php endforeach; ?>
+</table>
+
+<input type="hidden" name="page_options" value="<?php echo esc_attr( implode( ',', $options_to_update ) ); ?>" />
+
+<?php submit_button( __( 'Save Changes' ), 'primary', 'Update' ); ?>
+
+</form>
+</div>
+
+<?php
+include( ABSPATH . 'wp-admin/admin-footer.php' );
diff --git a/www/crm/wp-admin/plugin-editor.php b/www/crm/wp-admin/plugin-editor.php
new file mode 100644
index 00000000..a38dd39f
--- /dev/null
+++ b/www/crm/wp-admin/plugin-editor.php
@@ -0,0 +1,321 @@
+<?php
+/**
+ * Edit plugin editor administration panel.
+ *
+ * @package WordPress
+ * @subpackage Administration
+ */
+
+/** WordPress Administration Bootstrap */
+require_once( dirname( __FILE__ ) . '/admin.php' );
+
+if ( is_multisite() && ! is_network_admin() ) {
+ wp_redirect( network_admin_url( 'plugin-editor.php' ) );
+ exit();
+}
+
+if ( ! current_user_can( 'edit_plugins' ) ) {
+ wp_die( __( 'Sorry, you are not allowed to edit plugins for this site.' ) );
+}
+
+$title = __( 'Edit Plugins' );
+$parent_file = 'plugins.php';
+
+$plugins = get_plugins();
+
+if ( empty( $plugins ) ) {
+ include( ABSPATH . 'wp-admin/admin-header.php' );
+ ?>
+ <div class="wrap">
+ <h1><?php echo esc_html( $title ); ?></h1>
+ <div id="message" class="error"><p><?php _e( 'You do not appear to have any plugins available at this time.' ); ?></p></div>
+ </div>
+ <?php
+ include( ABSPATH . 'wp-admin/admin-footer.php' );
+ exit;
+}
+
+$file = '';
+$plugin = '';
+if ( isset( $_REQUEST['file'] ) ) {
+ $file = wp_unslash( $_REQUEST['file'] );
+}
+
+if ( isset( $_REQUEST['plugin'] ) ) {
+ $plugin = wp_unslash( $_REQUEST['plugin'] );
+}
+
+if ( empty( $plugin ) ) {
+ if ( $file ) {
+
+ // Locate the plugin for a given plugin file being edited.
+ $file_dirname = dirname( $file );
+ foreach ( array_keys( $plugins ) as $plugin_candidate ) {
+ if ( $plugin_candidate === $file || ( '.' !== $file_dirname && dirname( $plugin_candidate ) === $file_dirname ) ) {
+ $plugin = $plugin_candidate;
+ break;
+ }
+ }
+
+ // Fallback to the file as the plugin.
+ if ( empty( $plugin ) ) {
+ $plugin = $file;
+ }
+ } else {
+ $plugin = array_keys( $plugins );
+ $plugin = $plugin[0];
+ }
+}
+
+$plugin_files = get_plugin_files( $plugin );
+
+if ( empty( $file ) ) {
+ $file = $plugin_files[0];
+}
+
+$file = validate_file_to_edit( $file, $plugin_files );
+$real_file = WP_PLUGIN_DIR . '/' . $file;
+
+// Handle fallback editing of file when JavaScript is not available.
+$edit_error = null;
+$posted_content = null;
+if ( 'POST' === $_SERVER['REQUEST_METHOD'] ) {
+ $r = wp_edit_theme_plugin_file( wp_unslash( $_POST ) );
+ if ( is_wp_error( $r ) ) {
+ $edit_error = $r;
+ if ( check_ajax_referer( 'edit-plugin_' . $file, 'nonce', false ) && isset( $_POST['newcontent'] ) ) {
+ $posted_content = wp_unslash( $_POST['newcontent'] );
+ }
+ } else {
+ wp_redirect(
+ add_query_arg(
+ array(
+ 'a' => 1, // This means "success" for some reason.
+ 'plugin' => $plugin,
+ 'file' => $file,
+ ),
+ admin_url( 'plugin-editor.php' )
+ )
+ );
+ exit;
+ }
+}
+
+ // List of allowable extensions
+ $editable_extensions = wp_get_plugin_file_editable_extensions( $plugin );
+
+if ( ! is_file( $real_file ) ) {
+ wp_die( sprintf( '<p>%s</p>', __( 'No such file exists! Double check the name and try again.' ) ) );
+} else {
+ // Get the extension of the file
+ if ( preg_match( '/\.([^.]+)$/', $real_file, $matches ) ) {
+ $ext = strtolower( $matches[1] );
+ // If extension is not in the acceptable list, skip it
+ if ( ! in_array( $ext, $editable_extensions ) ) {
+ wp_die( sprintf( '<p>%s</p>', __( 'Files of this type are not editable.' ) ) );
+ }
+ }
+}
+
+ get_current_screen()->add_help_tab(
+ array(
+ 'id' => 'overview',
+ 'title' => __( 'Overview' ),
+ 'content' =>
+ '<p>' . __( 'You can use the plugin editor to make changes to any of your plugins&#8217; individual PHP files. Be aware that if you make changes, plugins updates will overwrite your customizations.' ) . '</p>' .
+ '<p>' . __( 'Choose a plugin to edit from the dropdown menu and click the Select button. Click once on any file name to load it in the editor, and make your changes. Don&#8217;t forget to save your changes (Update File) when you&#8217;re finished.' ) . '</p>' .
+ '<p>' . __( 'The Documentation menu below the editor lists the PHP functions recognized in the plugin file. Clicking Look Up takes you to a web page about that particular function.' ) . '</p>' .
+ '<p id="editor-keyboard-trap-help-1">' . __( 'When using a keyboard to navigate:' ) . '</p>' .
+ '<ul>' .
+ '<li id="editor-keyboard-trap-help-2">' . __( 'In the editing area, the Tab key enters a tab character.' ) . '</li>' .
+ '<li id="editor-keyboard-trap-help-3">' . __( 'To move away from this area, press the Esc key followed by the Tab key.' ) . '</li>' .
+ '<li id="editor-keyboard-trap-help-4">' . __( 'Screen reader users: when in forms mode, you may need to press the Esc key twice.' ) . '</li>' .
+ '</ul>' .
+ '<p>' . __( 'If you want to make changes but don&#8217;t want them to be overwritten when the plugin is updated, you may be ready to think about writing your own plugin. For information on how to edit plugins, write your own from scratch, or just better understand their anatomy, check out the links below.' ) . '</p>' .
+ ( is_network_admin() ? '<p>' . __( 'Any edits to files from this screen will be reflected on all sites in the network.' ) . '</p>' : '' ),
+ )
+ );
+
+ get_current_screen()->set_help_sidebar(
+ '<p><strong>' . __( 'For more information:' ) . '</strong></p>' .
+ '<p>' . __( '<a href="https://codex.wordpress.org/Plugins_Editor_Screen">Documentation on Editing Plugins</a>' ) . '</p>' .
+ '<p>' . __( '<a href="https://codex.wordpress.org/Writing_a_Plugin">Documentation on Writing Plugins</a>' ) . '</p>' .
+ '<p>' . __( '<a href="https://wordpress.org/support/">Support</a>' ) . '</p>'
+ );
+
+ $settings = array(
+ 'codeEditor' => wp_enqueue_code_editor( array( 'file' => $real_file ) ),
+ );
+ wp_enqueue_script( 'wp-theme-plugin-editor' );
+ wp_add_inline_script( 'wp-theme-plugin-editor', sprintf( 'jQuery( function( $ ) { wp.themePluginEditor.init( $( "#template" ), %s ); } )', wp_json_encode( $settings ) ) );
+ wp_add_inline_script( 'wp-theme-plugin-editor', sprintf( 'wp.themePluginEditor.themeOrPlugin = "plugin";' ) );
+
+ require_once( ABSPATH . 'wp-admin/admin-header.php' );
+
+ update_recently_edited( WP_PLUGIN_DIR . '/' . $file );
+
+ if ( ! empty( $posted_content ) ) {
+ $content = $posted_content;
+ } else {
+ $content = file_get_contents( $real_file );
+ }
+
+ if ( '.php' == substr( $real_file, strrpos( $real_file, '.' ) ) ) {
+ $functions = wp_doc_link_parse( $content );
+
+ if ( ! empty( $functions ) ) {
+ $docs_select = '<select name="docs-list" id="docs-list">';
+ $docs_select .= '<option value="">' . __( 'Function Name&hellip;' ) . '</option>';
+ foreach ( $functions as $function ) {
+ $docs_select .= '<option value="' . esc_attr( $function ) . '">' . esc_html( $function ) . '()</option>';
+ }
+ $docs_select .= '</select>';
+ }
+ }
+
+ $content = esc_textarea( $content );
+ ?>
+<div class="wrap">
+<h1><?php echo esc_html( $title ); ?></h1>
+
+<?php if ( isset( $_GET['a'] ) ) : ?>
+ <div id="message" class="updated notice is-dismissible">
+ <p><?php _e( 'File edited successfully.' ); ?></p>
+ </div>
+<?php elseif ( is_wp_error( $edit_error ) ) : ?>
+ <div id="message" class="notice notice-error">
+ <p><?php _e( 'There was an error while trying to update the file. You may need to fix something and try updating again.' ); ?></p>
+ <pre><?php echo esc_html( $edit_error->get_error_message() ? $edit_error->get_error_message() : $edit_error->get_error_code() ); ?></pre>
+ </div>
+<?php endif; ?>
+
+<div class="fileedit-sub">
+<div class="alignleft">
+<h2>
+ <?php
+ if ( is_plugin_active( $plugin ) ) {
+ if ( is_writeable( $real_file ) ) {
+ /* translators: %s: plugin file name */
+ echo sprintf( __( 'Editing %s (active)' ), '<strong>' . esc_html( $file ) . '</strong>' );
+ } else {
+ /* translators: %s: plugin file name */
+ echo sprintf( __( 'Browsing %s (active)' ), '<strong>' . esc_html( $file ) . '</strong>' );
+ }
+ } else {
+ if ( is_writeable( $real_file ) ) {
+ /* translators: %s: plugin file name */
+ echo sprintf( __( 'Editing %s (inactive)' ), '<strong>' . esc_html( $file ) . '</strong>' );
+ } else {
+ /* translators: %s: plugin file name */
+ echo sprintf( __( 'Browsing %s (inactive)' ), '<strong>' . esc_html( $file ) . '</strong>' );
+ }
+ }
+ ?>
+</h2>
+</div>
+<div class="alignright">
+ <form action="plugin-editor.php" method="get">
+ <strong><label for="plugin"><?php _e( 'Select plugin to edit:' ); ?> </label></strong>
+ <select name="plugin" id="plugin">
+<?php
+foreach ( $plugins as $plugin_key => $a_plugin ) {
+ $plugin_name = $a_plugin['Name'];
+ if ( $plugin_key == $plugin ) {
+ $selected = " selected='selected'";
+ } else {
+ $selected = '';
+ }
+ $plugin_name = esc_attr( $plugin_name );
+ $plugin_key = esc_attr( $plugin_key );
+ echo "\n\t<option value=\"$plugin_key\" $selected>$plugin_name</option>";
+}
+?>
+ </select>
+ <?php submit_button( __( 'Select' ), '', 'Submit', false ); ?>
+ </form>
+</div>
+<br class="clear" />
+</div>
+
+<div id="templateside">
+ <h2 id="plugin-files-label"><?php _e( 'Plugin Files' ); ?></h2>
+
+ <?php
+ $plugin_editable_files = array();
+ foreach ( $plugin_files as $plugin_file ) {
+ if ( preg_match( '/\.([^.]+)$/', $plugin_file, $matches ) && in_array( $matches[1], $editable_extensions ) ) {
+ $plugin_editable_files[] = $plugin_file;
+ }
+ }
+ ?>
+ <ul role="tree" aria-labelledby="plugin-files-label">
+ <li role="treeitem" tabindex="-1" aria-expanded="true" aria-level="1" aria-posinset="1" aria-setsize="1">
+ <ul role="group">
+ <?php wp_print_plugin_file_tree( wp_make_plugin_file_tree( $plugin_editable_files ) ); ?>
+ </ul>
+ </ul>
+</div>
+<form name="template" id="template" action="plugin-editor.php" method="post">
+ <?php wp_nonce_field( 'edit-plugin_' . $file, 'nonce' ); ?>
+ <div>
+ <label for="newcontent" id="theme-plugin-editor-label"><?php _e( 'Selected file content:' ); ?></label>
+ <textarea cols="70" rows="25" name="newcontent" id="newcontent" aria-describedby="editor-keyboard-trap-help-1 editor-keyboard-trap-help-2 editor-keyboard-trap-help-3 editor-keyboard-trap-help-4"><?php echo $content; ?></textarea>
+ <input type="hidden" name="action" value="update" />
+ <input type="hidden" name="file" value="<?php echo esc_attr( $file ); ?>" />
+ <input type="hidden" name="plugin" value="<?php echo esc_attr( $plugin ); ?>" />
+ </div>
+ <?php if ( ! empty( $docs_select ) ) : ?>
+ <div id="documentation" class="hide-if-no-js"><label for="docs-list"><?php _e( 'Documentation:' ); ?></label> <?php echo $docs_select; ?> <input disabled id="docs-lookup" type="button" class="button" value="<?php esc_attr_e( 'Look Up' ); ?> " onclick="if ( '' != jQuery('#docs-list').val() ) { window.open( 'https://api.wordpress.org/core/handbook/1.0/?function=' + escape( jQuery( '#docs-list' ).val() ) + '&amp;locale=<?php echo urlencode( get_user_locale() ); ?>&amp;version=<?php echo urlencode( get_bloginfo( 'version' ) ); ?>&amp;redirect=true'); }" /></div>
+ <?php endif; ?>
+<?php if ( is_writeable( $real_file ) ) : ?>
+ <div class="editor-notices">
+ <?php if ( in_array( $plugin, (array) get_option( 'active_plugins', array() ) ) ) { ?>
+ <div class="notice notice-warning inline active-plugin-edit-warning">
+ <p><?php _e( '<strong>Warning:</strong> Making changes to active plugins is not recommended.' ); ?></p>
+ </div>
+ <?php } ?>
+ </div>
+ <p class="submit">
+ <?php submit_button( __( 'Update File' ), 'primary', 'submit', false ); ?>
+ <span class="spinner"></span>
+ </p>
+<?php else : ?>
+ <p><em><?php _e( 'You need to make this file writable before you can save your changes. See <a href="https://codex.wordpress.org/Changing_File_Permissions">the Codex</a> for more information.' ); ?></em></p>
+<?php endif; ?>
+<?php wp_print_file_editor_templates(); ?>
+</form>
+<br class="clear" />
+</div>
+<?php
+$dismissed_pointers = explode( ',', (string) get_user_meta( get_current_user_id(), 'dismissed_wp_pointers', true ) );
+if ( ! in_array( 'plugin_editor_notice', $dismissed_pointers, true ) ) :
+ // Get a back URL
+ $referer = wp_get_referer();
+ $excluded_referer_basenames = array( 'plugin-editor.php', 'wp-login.php' );
+
+ if ( $referer && ! in_array( basename( parse_url( $referer, PHP_URL_PATH ) ), $excluded_referer_basenames, true ) ) {
+ $return_url = $referer;
+ } else {
+ $return_url = admin_url( '/' );
+ }
+ ?>
+<div id="file-editor-warning" class="notification-dialog-wrap file-editor-warning hide-if-no-js hidden">
+ <div class="notification-dialog-background"></div>
+ <div class="notification-dialog">
+ <div class="file-editor-warning-content">
+ <div class="file-editor-warning-message">
+ <h1><?php _e( 'Heads up!' ); ?></h1>
+ <p><?php _e( 'You appear to be making direct edits to your plugin in the WordPress dashboard. We recommend that you don&#8217;t! Editing plugins directly may introduce incompatibilities that break your site and your changes may be lost in future updates.' ); ?></p>
+ <p><?php _e( 'If you absolutely have to make direct edits to this plugin, use a file manager to create a copy with a new name and hang on to the original. That way, you can re-enable a functional version if something goes wrong.' ); ?></p>
+ </div>
+ <p>
+ <a class="button file-editor-warning-go-back" href="<?php echo esc_url( $return_url ); ?>"><?php _e( 'Go back' ); ?></a>
+ <button type="button" class="file-editor-warning-dismiss button button-primary"><?php _e( 'I understand' ); ?></button>
+ </p>
+ </div>
+ </div>
+</div>
+ <?php
+endif; // Editor warning notice.
+
+include( ABSPATH . 'wp-admin/admin-footer.php' );
diff --git a/www/crm/wp-admin/plugin-install.php b/www/crm/wp-admin/plugin-install.php
new file mode 100644
index 00000000..d4f678c9
--- /dev/null
+++ b/www/crm/wp-admin/plugin-install.php
@@ -0,0 +1,183 @@
+<?php
+/**
+ * Install plugin administration panel.
+ *
+ * @package WordPress
+ * @subpackage Administration
+ */
+// TODO route this pages via a specific iframe handler instead of the do_action below
+if ( ! defined( 'IFRAME_REQUEST' ) && isset( $_GET['tab'] ) && ( 'plugin-information' == $_GET['tab'] ) ) {
+ define( 'IFRAME_REQUEST', true );
+}
+
+/**
+ * WordPress Administration Bootstrap.
+ */
+require_once( dirname( __FILE__ ) . '/admin.php' );
+
+if ( ! current_user_can( 'install_plugins' ) ) {
+ wp_die( __( 'Sorry, you are not allowed to install plugins on this site.' ) );
+}
+
+if ( is_multisite() && ! is_network_admin() ) {
+ wp_redirect( network_admin_url( 'plugin-install.php' ) );
+ exit();
+}
+
+$wp_list_table = _get_list_table( 'WP_Plugin_Install_List_Table' );
+$pagenum = $wp_list_table->get_pagenum();
+
+if ( ! empty( $_REQUEST['_wp_http_referer'] ) ) {
+ $location = remove_query_arg( '_wp_http_referer', wp_unslash( $_SERVER['REQUEST_URI'] ) );
+
+ if ( ! empty( $_REQUEST['paged'] ) ) {
+ $location = add_query_arg( 'paged', (int) $_REQUEST['paged'], $location );
+ }
+
+ wp_redirect( $location );
+ exit;
+}
+
+$wp_list_table->prepare_items();
+
+$total_pages = $wp_list_table->get_pagination_arg( 'total_pages' );
+
+if ( $pagenum > $total_pages && $total_pages > 0 ) {
+ wp_redirect( add_query_arg( 'paged', $total_pages ) );
+ exit;
+}
+
+$title = __( 'Add Plugins' );
+$parent_file = 'plugins.php';
+
+wp_enqueue_script( 'plugin-install' );
+if ( 'plugin-information' != $tab ) {
+ add_thickbox();
+}
+
+$body_id = $tab;
+
+wp_enqueue_script( 'updates' );
+
+/**
+ * Fires before each tab on the Install Plugins screen is loaded.
+ *
+ * The dynamic portion of the action hook, `$tab`, allows for targeting
+ * individual tabs, for instance 'install_plugins_pre_plugin-information'.
+ *
+ * @since 2.7.0
+ */
+do_action( "install_plugins_pre_{$tab}" );
+
+/*
+ * Call the pre upload action on every non-upload plugin installation screen
+ * because the form is always displayed on these screens.
+ */
+if ( 'upload' !== $tab ) {
+ /** This action is documented in wp-admin/plugin-install.php */
+ do_action( 'install_plugins_pre_upload' );
+}
+
+get_current_screen()->add_help_tab(
+ array(
+ 'id' => 'overview',
+ 'title' => __( 'Overview' ),
+ 'content' =>
+ '<p>' . sprintf( __( 'Plugins hook into WordPress to extend its functionality with custom features. Plugins are developed independently from the core WordPress application by thousands of developers all over the world. All plugins in the official <a href="%s">WordPress Plugin Directory</a> are compatible with the license WordPress uses.' ), __( 'https://wordpress.org/plugins/' ) ) . '</p>' .
+ '<p>' . __( 'You can find new plugins to install by searching or browsing the directory right here in your own Plugins section.' ) . ' <span id="live-search-desc" class="hide-if-no-js">' . __( 'The search results will be updated as you type.' ) . '</span></p>',
+
+ )
+);
+get_current_screen()->add_help_tab(
+ array(
+ 'id' => 'adding-plugins',
+ 'title' => __( 'Adding Plugins' ),
+ 'content' =>
+ '<p>' . __( 'If you know what you&#8217;re looking for, Search is your best bet. The Search screen has options to search the WordPress Plugin Directory for a particular Term, Author, or Tag. You can also search the directory by selecting popular tags. Tags in larger type mean more plugins have been labeled with that tag.' ) . '</p>' .
+ '<p>' . __( 'If you just want to get an idea of what&#8217;s available, you can browse Featured and Popular plugins by using the links above the plugins list. These sections rotate regularly.' ) . '</p>' .
+ '<p>' . __( 'You can also browse a user&#8217;s favorite plugins, by using the Favorites link above the plugins list and entering their WordPress.org username.' ) . '</p>' .
+ '<p>' . __( 'If you want to install a plugin that you&#8217;ve downloaded elsewhere, click the Upload Plugin button above the plugins list. You will be prompted to upload the .zip package, and once uploaded, you can activate the new plugin.' ) . '</p>',
+ )
+);
+
+get_current_screen()->set_help_sidebar(
+ '<p><strong>' . __( 'For more information:' ) . '</strong></p>' .
+ '<p>' . __( '<a href="https://codex.wordpress.org/Plugins_Add_New_Screen">Documentation on Installing Plugins</a>' ) . '</p>' .
+ '<p>' . __( '<a href="https://wordpress.org/support/">Support</a>' ) . '</p>'
+);
+
+get_current_screen()->set_screen_reader_content(
+ array(
+ 'heading_views' => __( 'Filter plugins list' ),
+ 'heading_pagination' => __( 'Plugins list navigation' ),
+ 'heading_list' => __( 'Plugins list' ),
+ )
+);
+
+/**
+ * WordPress Administration Template Header.
+ */
+include( ABSPATH . 'wp-admin/admin-header.php' );
+?>
+<div class="wrap <?php echo esc_attr( "plugin-install-tab-$tab" ); ?>">
+<h1 class="wp-heading-inline">
+<?php
+echo esc_html( $title );
+?>
+</h1>
+
+<?php
+if ( ! empty( $tabs['upload'] ) && current_user_can( 'upload_plugins' ) ) {
+ printf(
+ ' <a href="%s" class="upload-view-toggle page-title-action"><span class="upload">%s</span><span class="browse">%s</span></a>',
+ ( 'upload' === $tab ) ? self_admin_url( 'plugin-install.php' ) : self_admin_url( 'plugin-install.php?tab=upload' ),
+ __( 'Upload Plugin' ),
+ __( 'Browse Plugins' )
+ );
+}
+?>
+
+<hr class="wp-header-end">
+
+<?php
+/*
+ * Output the upload plugin form on every non-upload plugin installation screen, so it can be
+ * displayed via JavaScript rather then opening up the devoted upload plugin page.
+ */
+if ( 'upload' !== $tab ) {
+ ?>
+ <div class="upload-plugin-wrap">
+ <?php
+ /** This action is documented in wp-admin/plugin-install.php */
+ do_action( 'install_plugins_upload' );
+ ?>
+ </div>
+ <?php
+ $wp_list_table->views();
+ echo '<br class="clear" />';
+}
+
+/**
+ * Fires after the plugins list table in each tab of the Install Plugins screen.
+ *
+ * The dynamic portion of the action hook, `$tab`, allows for targeting
+ * individual tabs, for instance 'install_plugins_plugin-information'.
+ *
+ * @since 2.7.0
+ *
+ * @param int $paged The current page number of the plugins list table.
+ */
+do_action( "install_plugins_{$tab}", $paged );
+?>
+
+ <span class="spinner"></span>
+</div>
+
+<?php
+wp_print_request_filesystem_credentials_modal();
+wp_print_admin_notice_templates();
+
+/**
+ * WordPress Administration Template Footer.
+ */
+include( ABSPATH . 'wp-admin/admin-footer.php' );
diff --git a/www/crm/wp-admin/plugins.php b/www/crm/wp-admin/plugins.php
new file mode 100644
index 00000000..8c8249ac
--- /dev/null
+++ b/www/crm/wp-admin/plugins.php
@@ -0,0 +1,630 @@
+<?php
+/**
+ * Plugins administration panel.
+ *
+ * @package WordPress
+ * @subpackage Administration
+ */
+
+/** WordPress Administration Bootstrap */
+require_once( dirname( __FILE__ ) . '/admin.php' );
+
+if ( ! current_user_can( 'activate_plugins' ) ) {
+ wp_die( __( 'Sorry, you are not allowed to manage plugins for this site.' ) );
+}
+
+$wp_list_table = _get_list_table( 'WP_Plugins_List_Table' );
+$pagenum = $wp_list_table->get_pagenum();
+
+$action = $wp_list_table->current_action();
+
+$plugin = isset( $_REQUEST['plugin'] ) ? wp_unslash( $_REQUEST['plugin'] ) : '';
+$s = isset( $_REQUEST['s'] ) ? urlencode( wp_unslash( $_REQUEST['s'] ) ) : '';
+
+// Clean up request URI from temporary args for screen options/paging uri's to work as expected.
+$_SERVER['REQUEST_URI'] = remove_query_arg( array( 'error', 'deleted', 'activate', 'activate-multi', 'deactivate', 'deactivate-multi', '_error_nonce' ), $_SERVER['REQUEST_URI'] );
+
+wp_enqueue_script( 'updates' );
+
+if ( $action ) {
+
+ switch ( $action ) {
+ case 'activate':
+ if ( ! current_user_can( 'activate_plugin', $plugin ) ) {
+ wp_die( __( 'Sorry, you are not allowed to activate this plugin.' ) );
+ }
+
+ if ( is_multisite() && ! is_network_admin() && is_network_only_plugin( $plugin ) ) {
+ wp_redirect( self_admin_url( "plugins.php?plugin_status=$status&paged=$page&s=$s" ) );
+ exit;
+ }
+
+ check_admin_referer( 'activate-plugin_' . $plugin );
+
+ $result = activate_plugin( $plugin, self_admin_url( 'plugins.php?error=true&plugin=' . urlencode( $plugin ) ), is_network_admin() );
+ if ( is_wp_error( $result ) ) {
+ if ( 'unexpected_output' == $result->get_error_code() ) {
+ $redirect = self_admin_url( 'plugins.php?error=true&charsout=' . strlen( $result->get_error_data() ) . '&plugin=' . urlencode( $plugin ) . "&plugin_status=$status&paged=$page&s=$s" );
+ wp_redirect( add_query_arg( '_error_nonce', wp_create_nonce( 'plugin-activation-error_' . $plugin ), $redirect ) );
+ exit;
+ } else {
+ wp_die( $result );
+ }
+ }
+
+ if ( ! is_network_admin() ) {
+ $recent = (array) get_option( 'recently_activated' );
+ unset( $recent[ $plugin ] );
+ update_option( 'recently_activated', $recent );
+ } else {
+ $recent = (array) get_site_option( 'recently_activated' );
+ unset( $recent[ $plugin ] );
+ update_site_option( 'recently_activated', $recent );
+ }
+
+ if ( isset( $_GET['from'] ) && 'import' == $_GET['from'] ) {
+ wp_redirect( self_admin_url( 'import.php?import=' . str_replace( '-importer', '', dirname( $plugin ) ) ) ); // overrides the ?error=true one above and redirects to the Imports page, stripping the -importer suffix
+ } elseif ( isset( $_GET['from'] ) && 'press-this' == $_GET['from'] ) {
+ wp_redirect( self_admin_url( 'press-this.php' ) );
+ } else {
+ wp_redirect( self_admin_url( "plugins.php?activate=true&plugin_status=$status&paged=$page&s=$s" ) ); // overrides the ?error=true one above
+ }
+ exit;
+
+ case 'activate-selected':
+ if ( ! current_user_can( 'activate_plugins' ) ) {
+ wp_die( __( 'Sorry, you are not allowed to activate plugins for this site.' ) );
+ }
+
+ check_admin_referer( 'bulk-plugins' );
+
+ $plugins = isset( $_POST['checked'] ) ? (array) wp_unslash( $_POST['checked'] ) : array();
+
+ if ( is_network_admin() ) {
+ foreach ( $plugins as $i => $plugin ) {
+ // Only activate plugins which are not already network activated.
+ if ( is_plugin_active_for_network( $plugin ) ) {
+ unset( $plugins[ $i ] );
+ }
+ }
+ } else {
+ foreach ( $plugins as $i => $plugin ) {
+ // Only activate plugins which are not already active and are not network-only when on Multisite.
+ if ( is_plugin_active( $plugin ) || ( is_multisite() && is_network_only_plugin( $plugin ) ) ) {
+ unset( $plugins[ $i ] );
+ }
+ // Only activate plugins which the user can activate.
+ if ( ! current_user_can( 'activate_plugin', $plugin ) ) {
+ unset( $plugins[ $i ] );
+ }
+ }
+ }
+
+ if ( empty( $plugins ) ) {
+ wp_redirect( self_admin_url( "plugins.php?plugin_status=$status&paged=$page&s=$s" ) );
+ exit;
+ }
+
+ activate_plugins( $plugins, self_admin_url( 'plugins.php?error=true' ), is_network_admin() );
+
+ if ( ! is_network_admin() ) {
+ $recent = (array) get_option( 'recently_activated' );
+ } else {
+ $recent = (array) get_site_option( 'recently_activated' );
+ }
+
+ foreach ( $plugins as $plugin ) {
+ unset( $recent[ $plugin ] );
+ }
+
+ if ( ! is_network_admin() ) {
+ update_option( 'recently_activated', $recent );
+ } else {
+ update_site_option( 'recently_activated', $recent );
+ }
+
+ wp_redirect( self_admin_url( "plugins.php?activate-multi=true&plugin_status=$status&paged=$page&s=$s" ) );
+ exit;
+
+ case 'update-selected':
+ check_admin_referer( 'bulk-plugins' );
+
+ if ( isset( $_GET['plugins'] ) ) {
+ $plugins = explode( ',', wp_unslash( $_GET['plugins'] ) );
+ } elseif ( isset( $_POST['checked'] ) ) {
+ $plugins = (array) wp_unslash( $_POST['checked'] );
+ } else {
+ $plugins = array();
+ }
+
+ $title = __( 'Update Plugins' );
+ $parent_file = 'plugins.php';
+
+ wp_enqueue_script( 'updates' );
+ require_once( ABSPATH . 'wp-admin/admin-header.php' );
+
+ echo '<div class="wrap">';
+ echo '<h1>' . esc_html( $title ) . '</h1>';
+
+ $url = self_admin_url( 'update.php?action=update-selected&amp;plugins=' . urlencode( join( ',', $plugins ) ) );
+ $url = wp_nonce_url( $url, 'bulk-update-plugins' );
+
+ echo "<iframe src='$url' style='width: 100%; height:100%; min-height:850px;'></iframe>";
+ echo '</div>';
+ require_once( ABSPATH . 'wp-admin/admin-footer.php' );
+ exit;
+
+ case 'error_scrape':
+ if ( ! current_user_can( 'activate_plugin', $plugin ) ) {
+ wp_die( __( 'Sorry, you are not allowed to activate this plugin.' ) );
+ }
+
+ check_admin_referer( 'plugin-activation-error_' . $plugin );
+
+ $valid = validate_plugin( $plugin );
+ if ( is_wp_error( $valid ) ) {
+ wp_die( $valid );
+ }
+
+ if ( ! WP_DEBUG ) {
+ error_reporting( E_CORE_ERROR | E_CORE_WARNING | E_COMPILE_ERROR | E_ERROR | E_WARNING | E_PARSE | E_USER_ERROR | E_USER_WARNING | E_RECOVERABLE_ERROR );
+ }
+
+ @ini_set( 'display_errors', true ); //Ensure that Fatal errors are displayed.
+ // Go back to "sandbox" scope so we get the same errors as before
+ plugin_sandbox_scrape( $plugin );
+ /** This action is documented in wp-admin/includes/plugin.php */
+ do_action( "activate_{$plugin}" );
+ exit;
+
+ case 'deactivate':
+ if ( ! current_user_can( 'deactivate_plugin', $plugin ) ) {
+ wp_die( __( 'Sorry, you are not allowed to deactivate this plugin.' ) );
+ }
+
+ check_admin_referer( 'deactivate-plugin_' . $plugin );
+
+ if ( ! is_network_admin() && is_plugin_active_for_network( $plugin ) ) {
+ wp_redirect( self_admin_url( "plugins.php?plugin_status=$status&paged=$page&s=$s" ) );
+ exit;
+ }
+
+ deactivate_plugins( $plugin, false, is_network_admin() );
+
+ if ( ! is_network_admin() ) {
+ update_option( 'recently_activated', array( $plugin => time() ) + (array) get_option( 'recently_activated' ) );
+ } else {
+ update_site_option( 'recently_activated', array( $plugin => time() ) + (array) get_site_option( 'recently_activated' ) );
+ }
+
+ if ( headers_sent() ) {
+ echo "<meta http-equiv='refresh' content='" . esc_attr( "0;url=plugins.php?deactivate=true&plugin_status=$status&paged=$page&s=$s" ) . "' />";
+ } else {
+ wp_redirect( self_admin_url( "plugins.php?deactivate=true&plugin_status=$status&paged=$page&s=$s" ) );
+ }
+ exit;
+
+ case 'deactivate-selected':
+ if ( ! current_user_can( 'deactivate_plugins' ) ) {
+ wp_die( __( 'Sorry, you are not allowed to deactivate plugins for this site.' ) );
+ }
+
+ check_admin_referer( 'bulk-plugins' );
+
+ $plugins = isset( $_POST['checked'] ) ? (array) wp_unslash( $_POST['checked'] ) : array();
+ // Do not deactivate plugins which are already deactivated.
+ if ( is_network_admin() ) {
+ $plugins = array_filter( $plugins, 'is_plugin_active_for_network' );
+ } else {
+ $plugins = array_filter( $plugins, 'is_plugin_active' );
+ $plugins = array_diff( $plugins, array_filter( $plugins, 'is_plugin_active_for_network' ) );
+
+ foreach ( $plugins as $i => $plugin ) {
+ // Only deactivate plugins which the user can deactivate.
+ if ( ! current_user_can( 'deactivate_plugin', $plugin ) ) {
+ unset( $plugins[ $i ] );
+ }
+ }
+ }
+ if ( empty( $plugins ) ) {
+ wp_redirect( self_admin_url( "plugins.php?plugin_status=$status&paged=$page&s=$s" ) );
+ exit;
+ }
+
+ deactivate_plugins( $plugins, false, is_network_admin() );
+
+ $deactivated = array();
+ foreach ( $plugins as $plugin ) {
+ $deactivated[ $plugin ] = time();
+ }
+
+ if ( ! is_network_admin() ) {
+ update_option( 'recently_activated', $deactivated + (array) get_option( 'recently_activated' ) );
+ } else {
+ update_site_option( 'recently_activated', $deactivated + (array) get_site_option( 'recently_activated' ) );
+ }
+
+ wp_redirect( self_admin_url( "plugins.php?deactivate-multi=true&plugin_status=$status&paged=$page&s=$s" ) );
+ exit;
+
+ case 'delete-selected':
+ if ( ! current_user_can( 'delete_plugins' ) ) {
+ wp_die( __( 'Sorry, you are not allowed to delete plugins for this site.' ) );
+ }
+
+ check_admin_referer( 'bulk-plugins' );
+
+ //$_POST = from the plugin form; $_GET = from the FTP details screen.
+ $plugins = isset( $_REQUEST['checked'] ) ? (array) wp_unslash( $_REQUEST['checked'] ) : array();
+ if ( empty( $plugins ) ) {
+ wp_redirect( self_admin_url( "plugins.php?plugin_status=$status&paged=$page&s=$s" ) );
+ exit;
+ }
+
+ $plugins = array_filter( $plugins, 'is_plugin_inactive' ); // Do not allow to delete Activated plugins.
+ if ( empty( $plugins ) ) {
+ wp_redirect( self_admin_url( "plugins.php?error=true&main=true&plugin_status=$status&paged=$page&s=$s" ) );
+ exit;
+ }
+
+ // Bail on all if any paths are invalid.
+ // validate_file() returns truthy for invalid files
+ $invalid_plugin_files = array_filter( $plugins, 'validate_file' );
+ if ( $invalid_plugin_files ) {
+ wp_redirect( self_admin_url( "plugins.php?plugin_status=$status&paged=$page&s=$s" ) );
+ exit;
+ }
+
+ include( ABSPATH . 'wp-admin/update.php' );
+
+ $parent_file = 'plugins.php';
+
+ if ( ! isset( $_REQUEST['verify-delete'] ) ) {
+ wp_enqueue_script( 'jquery' );
+ require_once( ABSPATH . 'wp-admin/admin-header.php' );
+ ?>
+ <div class="wrap">
+ <?php
+ $plugin_info = array();
+ $have_non_network_plugins = false;
+ foreach ( (array) $plugins as $plugin ) {
+ $plugin_slug = dirname( $plugin );
+
+ if ( '.' == $plugin_slug ) {
+ if ( $data = get_plugin_data( WP_PLUGIN_DIR . '/' . $plugin ) ) {
+ $plugin_info[ $plugin ] = $data;
+ $plugin_info[ $plugin ]['is_uninstallable'] = is_uninstallable_plugin( $plugin );
+ if ( ! $plugin_info[ $plugin ]['Network'] ) {
+ $have_non_network_plugins = true;
+ }
+ }
+ } else {
+ // Get plugins list from that folder.
+ if ( $folder_plugins = get_plugins( '/' . $plugin_slug ) ) {
+ foreach ( $folder_plugins as $plugin_file => $data ) {
+ $plugin_info[ $plugin_file ] = _get_plugin_data_markup_translate( $plugin_file, $data );
+ $plugin_info[ $plugin_file ]['is_uninstallable'] = is_uninstallable_plugin( $plugin );
+ if ( ! $plugin_info[ $plugin_file ]['Network'] ) {
+ $have_non_network_plugins = true;
+ }
+ }
+ }
+ }
+ }
+ $plugins_to_delete = count( $plugin_info );
+ ?>
+ <?php if ( 1 == $plugins_to_delete ) : ?>
+ <h1><?php _e( 'Delete Plugin' ); ?></h1>
+ <?php if ( $have_non_network_plugins && is_network_admin() ) : ?>
+ <div class="error"><p><strong><?php _e( 'Caution:' ); ?></strong> <?php _e( 'This plugin may be active on other sites in the network.' ); ?></p></div>
+ <?php endif; ?>
+ <p><?php _e( 'You are about to remove the following plugin:' ); ?></p>
+ <?php else : ?>
+ <h1><?php _e( 'Delete Plugins' ); ?></h1>
+ <?php if ( $have_non_network_plugins && is_network_admin() ) : ?>
+ <div class="error"><p><strong><?php _e( 'Caution:' ); ?></strong> <?php _e( 'These plugins may be active on other sites in the network.' ); ?></p></div>
+ <?php endif; ?>
+ <p><?php _e( 'You are about to remove the following plugins:' ); ?></p>
+ <?php endif; ?>
+ <ul class="ul-disc">
+ <?php
+ $data_to_delete = false;
+ foreach ( $plugin_info as $plugin ) {
+ if ( $plugin['is_uninstallable'] ) {
+ /* translators: 1: plugin name, 2: plugin author */
+ echo '<li>', sprintf( __( '%1$s by %2$s (will also <strong>delete its data</strong>)' ), '<strong>' . $plugin['Name'] . '</strong>', '<em>' . $plugin['AuthorName'] . '</em>' ), '</li>';
+ $data_to_delete = true;
+ } else {
+ /* translators: 1: plugin name, 2: plugin author */
+ echo '<li>', sprintf( _x( '%1$s by %2$s', 'plugin' ), '<strong>' . $plugin['Name'] . '</strong>', '<em>' . $plugin['AuthorName'] ) . '</em>', '</li>';
+ }
+ }
+ ?>
+ </ul>
+ <p>
+ <?php
+ if ( $data_to_delete ) {
+ _e( 'Are you sure you wish to delete these files and data?' );
+ } else {
+ _e( 'Are you sure you wish to delete these files?' );
+ }
+ ?>
+ </p>
+ <form method="post" action="<?php echo esc_url( $_SERVER['REQUEST_URI'] ); ?>" style="display:inline;">
+ <input type="hidden" name="verify-delete" value="1" />
+ <input type="hidden" name="action" value="delete-selected" />
+ <?php
+ foreach ( (array) $plugins as $plugin ) {
+ echo '<input type="hidden" name="checked[]" value="' . esc_attr( $plugin ) . '" />';
+ }
+ ?>
+ <?php wp_nonce_field( 'bulk-plugins' ); ?>
+ <?php submit_button( $data_to_delete ? __( 'Yes, delete these files and data' ) : __( 'Yes, delete these files' ), '', 'submit', false ); ?>
+ </form>
+ <?php
+ $referer = wp_get_referer();
+ ?>
+ <form method="post" action="<?php echo $referer ? esc_url( $referer ) : ''; ?>" style="display:inline;">
+ <?php submit_button( __( 'No, return me to the plugin list' ), '', 'submit', false ); ?>
+ </form>
+ </div>
+ <?php
+ require_once( ABSPATH . 'wp-admin/admin-footer.php' );
+ exit;
+ } else {
+ $plugins_to_delete = count( $plugins );
+ } // endif verify-delete
+
+ $delete_result = delete_plugins( $plugins );
+
+ set_transient( 'plugins_delete_result_' . $user_ID, $delete_result ); //Store the result in a cache rather than a URL param due to object type & length
+ wp_redirect( self_admin_url( "plugins.php?deleted=$plugins_to_delete&plugin_status=$status&paged=$page&s=$s" ) );
+ exit;
+
+ case 'clear-recent-list':
+ if ( ! is_network_admin() ) {
+ update_option( 'recently_activated', array() );
+ } else {
+ update_site_option( 'recently_activated', array() );
+ }
+ break;
+
+ case 'resume':
+ if ( is_multisite() ) {
+ return;
+ }
+
+ if ( ! current_user_can( 'resume_plugin', $plugin ) ) {
+ wp_die( __( 'Sorry, you are not allowed to resume this plugin.' ) );
+ }
+
+ check_admin_referer( 'resume-plugin_' . $plugin );
+
+ $result = resume_plugin( $plugin, self_admin_url( "plugins.php?error=resuming&plugin_status=$status&paged=$page&s=$s" ) );
+
+ if ( is_wp_error( $result ) ) {
+ wp_die( $result );
+ }
+
+ wp_redirect( self_admin_url( "plugins.php?resume=true&plugin_status=$status&paged=$page&s=$s" ) );
+ exit;
+
+ default:
+ if ( isset( $_POST['checked'] ) ) {
+ check_admin_referer( 'bulk-plugins' );
+ $plugins = isset( $_POST['checked'] ) ? (array) wp_unslash( $_POST['checked'] ) : array();
+ $sendback = wp_get_referer();
+
+ /** This action is documented in wp-admin/edit-comments.php */
+ $sendback = apply_filters( 'handle_bulk_actions-' . get_current_screen()->id, $sendback, $action, $plugins );
+ wp_safe_redirect( $sendback );
+ exit;
+ }
+ break;
+ }
+}
+
+$wp_list_table->prepare_items();
+
+wp_enqueue_script( 'plugin-install' );
+add_thickbox();
+
+add_screen_option( 'per_page', array( 'default' => 999 ) );
+
+get_current_screen()->add_help_tab(
+ array(
+ 'id' => 'overview',
+ 'title' => __( 'Overview' ),
+ 'content' =>
+ '<p>' . __( 'Plugins extend and expand the functionality of WordPress. Once a plugin is installed, you may activate it or deactivate it here.' ) . '</p>' .
+ '<p>' . __( 'The search for installed plugins will search for terms in their name, description, or author.' ) . ' <span id="live-search-desc" class="hide-if-no-js">' . __( 'The search results will be updated as you type.' ) . '</span></p>' .
+ '<p>' . sprintf(
+ /* translators: %s: WordPress Plugin Directory URL */
+ __( 'If you would like to see more plugins to choose from, click on the &#8220;Add New&#8221; button and you will be able to browse or search for additional plugins from the <a href="%s">WordPress Plugin Directory</a>. Plugins in the WordPress Plugin Directory are designed and developed by third parties, and are compatible with the license WordPress uses. Oh, and they&#8217;re free!' ),
+ __( 'https://wordpress.org/plugins/' )
+ ) . '</p>',
+ )
+);
+get_current_screen()->add_help_tab(
+ array(
+ 'id' => 'compatibility-problems',
+ 'title' => __( 'Troubleshooting' ),
+ 'content' =>
+ '<p>' . __( 'Most of the time, plugins play nicely with the core of WordPress and with other plugins. Sometimes, though, a plugin&#8217;s code will get in the way of another plugin, causing compatibility issues. If your site starts doing strange things, this may be the problem. Try deactivating all your plugins and re-activating them in various combinations until you isolate which one(s) caused the issue.' ) . '</p>' .
+ '<p>' . sprintf(
+ /* translators: WP_PLUGIN_DIR constant value */
+ __( 'If something goes wrong with a plugin and you can&#8217;t use WordPress, delete or rename that file in the %s directory and it will be automatically deactivated.' ),
+ '<code>' . WP_PLUGIN_DIR . '</code>'
+ ) . '</p>',
+ )
+);
+
+get_current_screen()->set_help_sidebar(
+ '<p><strong>' . __( 'For more information:' ) . '</strong></p>' .
+ '<p>' . __( '<a href="https://codex.wordpress.org/Managing_Plugins#Plugin_Management">Documentation on Managing Plugins</a>' ) . '</p>' .
+ '<p>' . __( '<a href="https://wordpress.org/support/">Support</a>' ) . '</p>'
+);
+
+get_current_screen()->set_screen_reader_content(
+ array(
+ 'heading_views' => __( 'Filter plugins list' ),
+ 'heading_pagination' => __( 'Plugins list navigation' ),
+ 'heading_list' => __( 'Plugins list' ),
+ )
+);
+
+$title = __( 'Plugins' );
+$parent_file = 'plugins.php';
+
+require_once( ABSPATH . 'wp-admin/admin-header.php' );
+
+$invalid = validate_active_plugins();
+if ( ! empty( $invalid ) ) {
+ foreach ( $invalid as $plugin_file => $error ) {
+ echo '<div id="message" class="error"><p>';
+ printf(
+ /* translators: 1: plugin file, 2: error message */
+ __( 'The plugin %1$s has been <strong>deactivated</strong> due to an error: %2$s' ),
+ '<code>' . esc_html( $plugin_file ) . '</code>',
+ $error->get_error_message()
+ );
+ echo '</p></div>';
+ }
+}
+?>
+
+<?php
+if ( isset( $_GET['error'] ) ) :
+
+ if ( isset( $_GET['main'] ) ) {
+ $errmsg = __( 'You cannot delete a plugin while it is active on the main site.' );
+ } elseif ( isset( $_GET['charsout'] ) ) {
+ $errmsg = sprintf(
+ _n(
+ 'The plugin generated %d character of <strong>unexpected output</strong> during activation.',
+ 'The plugin generated %d characters of <strong>unexpected output</strong> during activation.',
+ $_GET['charsout']
+ ),
+ $_GET['charsout']
+ );
+ $errmsg .= ' ' . __( 'If you notice &#8220;headers already sent&#8221; messages, problems with syndication feeds or other issues, try deactivating or removing this plugin.' );
+ } elseif ( 'resuming' === $_GET['error'] ) {
+ $errmsg = __( 'Plugin could not be resumed because it triggered a <strong>fatal error</strong>.' );
+ } else {
+ $errmsg = __( 'Plugin could not be activated because it triggered a <strong>fatal error</strong>.' );
+ }
+ ?>
+ <div id="message" class="error"><p><?php echo $errmsg; ?></p>
+ <?php
+ if ( ! isset( $_GET['main'] ) && ! isset( $_GET['charsout'] ) && wp_verify_nonce( $_GET['_error_nonce'], 'plugin-activation-error_' . $plugin ) ) {
+ $iframe_url = add_query_arg(
+ array(
+ 'action' => 'error_scrape',
+ 'plugin' => urlencode( $plugin ),
+ '_wpnonce' => urlencode( $_GET['_error_nonce'] ),
+ ),
+ admin_url( 'plugins.php' )
+ );
+ ?>
+ <iframe style="border:0" width="100%" height="70px" src="<?php echo esc_url( $iframe_url ); ?>"></iframe>
+ <?php
+ }
+ ?>
+ </div>
+ <?php
+elseif ( isset( $_GET['deleted'] ) ) :
+ $delete_result = get_transient( 'plugins_delete_result_' . $user_ID );
+ // Delete it once we're done.
+ delete_transient( 'plugins_delete_result_' . $user_ID );
+
+ if ( is_wp_error( $delete_result ) ) :
+ ?>
+ <div id="message" class="error notice is-dismissible"><p><?php printf( __( 'Plugin could not be deleted due to an error: %s' ), $delete_result->get_error_message() ); ?></p></div>
+ <?php else : ?>
+ <div id="message" class="updated notice is-dismissible">
+ <p>
+ <?php
+ if ( 1 == (int) $_GET['deleted'] ) {
+ _e( 'The selected plugin has been <strong>deleted</strong>.' );
+ } else {
+ _e( 'The selected plugins have been <strong>deleted</strong>.' );
+ }
+ ?>
+ </p>
+ </div>
+ <?php endif; ?>
+<?php elseif ( isset( $_GET['activate'] ) ) : ?>
+ <div id="message" class="updated notice is-dismissible"><p><?php _e( 'Plugin <strong>activated</strong>.' ); ?></p></div>
+<?php elseif ( isset( $_GET['activate-multi'] ) ) : ?>
+ <div id="message" class="updated notice is-dismissible"><p><?php _e( 'Selected plugins <strong>activated</strong>.' ); ?></p></div>
+<?php elseif ( isset( $_GET['deactivate'] ) ) : ?>
+ <div id="message" class="updated notice is-dismissible"><p><?php _e( 'Plugin <strong>deactivated</strong>.' ); ?></p></div>
+<?php elseif ( isset( $_GET['deactivate-multi'] ) ) : ?>
+ <div id="message" class="updated notice is-dismissible"><p><?php _e( 'Selected plugins <strong>deactivated</strong>.' ); ?></p></div>
+<?php elseif ( 'update-selected' == $action ) : ?>
+ <div id="message" class="updated notice is-dismissible"><p><?php _e( 'All selected plugins are up to date.' ); ?></p></div>
+<?php elseif ( isset( $_GET['resume'] ) ) : ?>
+ <div id="message" class="updated notice is-dismissible"><p><?php _e( 'Plugin <strong>resumed</strong>.' ); ?></p></div>
+<?php endif; ?>
+
+<div class="wrap">
+<h1 class="wp-heading-inline">
+<?php
+echo esc_html( $title );
+?>
+</h1>
+
+<?php
+if ( ( ! is_multisite() || is_network_admin() ) && current_user_can( 'install_plugins' ) ) {
+ ?>
+ <a href="<?php echo self_admin_url( 'plugin-install.php' ); ?>" class="page-title-action"><?php echo esc_html_x( 'Add New', 'plugin' ); ?></a>
+ <?php
+}
+
+if ( strlen( $s ) ) {
+ /* translators: %s: search keywords */
+ printf( '<span class="subtitle">' . __( 'Search results for &#8220;%s&#8221;' ) . '</span>', esc_html( urldecode( $s ) ) );
+}
+?>
+
+<hr class="wp-header-end">
+
+<?php
+/**
+ * Fires before the plugins list table is rendered.
+ *
+ * This hook also fires before the plugins list table is rendered in the Network Admin.
+ *
+ * Please note: The 'active' portion of the hook name does not refer to whether the current
+ * view is for active plugins, but rather all plugins actively-installed.
+ *
+ * @since 3.0.0
+ *
+ * @param array[] $plugins_all An array of arrays containing information on all installed plugins.
+ */
+do_action( 'pre_current_active_plugins', $plugins['all'] );
+?>
+
+<?php $wp_list_table->views(); ?>
+
+<form class="search-form search-plugins" method="get">
+<?php $wp_list_table->search_box( __( 'Search Installed Plugins' ), 'plugin' ); ?>
+</form>
+
+<form method="post" id="bulk-action-form">
+
+<input type="hidden" name="plugin_status" value="<?php echo esc_attr( $status ); ?>" />
+<input type="hidden" name="paged" value="<?php echo esc_attr( $page ); ?>" />
+
+<?php $wp_list_table->display(); ?>
+</form>
+
+ <span class="spinner"></span>
+</div>
+
+<?php
+wp_print_request_filesystem_credentials_modal();
+wp_print_admin_notice_templates();
+wp_print_update_row_templates();
+
+include( ABSPATH . 'wp-admin/admin-footer.php' );
diff --git a/www/crm/wp-admin/post-new.php b/www/crm/wp-admin/post-new.php
new file mode 100644
index 00000000..afc0c3bc
--- /dev/null
+++ b/www/crm/wp-admin/post-new.php
@@ -0,0 +1,83 @@
+<?php
+/**
+ * New Post Administration Screen.
+ *
+ * @package WordPress
+ * @subpackage Administration
+ */
+
+/** Load WordPress Administration Bootstrap */
+require_once( dirname( __FILE__ ) . '/admin.php' );
+
+/**
+ * @global string $post_type
+ * @global object $post_type_object
+ * @global WP_Post $post
+ */
+global $post_type, $post_type_object, $post;
+
+if ( ! isset( $_GET['post_type'] ) ) {
+ $post_type = 'post';
+} elseif ( in_array( $_GET['post_type'], get_post_types( array( 'show_ui' => true ) ) ) ) {
+ $post_type = $_GET['post_type'];
+} else {
+ wp_die( __( 'Invalid post type.' ) );
+}
+$post_type_object = get_post_type_object( $post_type );
+
+if ( 'post' == $post_type ) {
+ $parent_file = 'edit.php';
+ $submenu_file = 'post-new.php';
+} elseif ( 'attachment' == $post_type ) {
+ if ( wp_redirect( admin_url( 'media-new.php' ) ) ) {
+ exit;
+ }
+} else {
+ $submenu_file = "post-new.php?post_type=$post_type";
+ if ( isset( $post_type_object ) && $post_type_object->show_in_menu && $post_type_object->show_in_menu !== true ) {
+ $parent_file = $post_type_object->show_in_menu;
+ // What if there isn't a post-new.php item for this post type?
+ if ( ! isset( $_registered_pages[ get_plugin_page_hookname( "post-new.php?post_type=$post_type", $post_type_object->show_in_menu ) ] ) ) {
+ if ( isset( $_registered_pages[ get_plugin_page_hookname( "edit.php?post_type=$post_type", $post_type_object->show_in_menu ) ] ) ) {
+ // Fall back to edit.php for that post type, if it exists
+ $submenu_file = "edit.php?post_type=$post_type";
+ } else {
+ // Otherwise, give up and highlight the parent
+ $submenu_file = $parent_file;
+ }
+ }
+ } else {
+ $parent_file = "edit.php?post_type=$post_type";
+ }
+}
+
+$title = $post_type_object->labels->add_new_item;
+
+$editing = true;
+
+if ( ! current_user_can( $post_type_object->cap->edit_posts ) || ! current_user_can( $post_type_object->cap->create_posts ) ) {
+ wp_die(
+ '<h1>' . __( 'You need a higher level of permission.' ) . '</h1>' .
+ '<p>' . __( 'Sorry, you are not allowed to create posts as this user.' ) . '</p>',
+ 403
+ );
+}
+
+$post = get_default_post_to_edit( $post_type, true );
+$post_ID = $post->ID;
+
+/** This filter is documented in wp-admin/post.php */
+if ( apply_filters( 'replace_editor', false, $post ) !== true ) {
+ if ( use_block_editor_for_post( $post ) ) {
+ include( ABSPATH . 'wp-admin/edit-form-blocks.php' );
+ } else {
+ wp_enqueue_script( 'autosave' );
+ include( ABSPATH . 'wp-admin/edit-form-advanced.php' );
+ }
+} else {
+ // Flag that we're not loading the block editor.
+ $current_screen = get_current_screen();
+ $current_screen->is_block_editor( false );
+}
+
+include( ABSPATH . 'wp-admin/admin-footer.php' );
diff --git a/www/crm/wp-admin/post.php b/www/crm/wp-admin/post.php
new file mode 100644
index 00000000..22624dfc
--- /dev/null
+++ b/www/crm/wp-admin/post.php
@@ -0,0 +1,350 @@
+<?php
+/**
+ * Edit post administration panel.
+ *
+ * Manage Post actions: post, edit, delete, etc.
+ *
+ * @package WordPress
+ * @subpackage Administration
+ */
+
+/** WordPress Administration Bootstrap */
+require_once( dirname( __FILE__ ) . '/admin.php' );
+
+$parent_file = 'edit.php';
+$submenu_file = 'edit.php';
+
+wp_reset_vars( array( 'action' ) );
+
+if ( isset( $_GET['post'] ) && isset( $_POST['post_ID'] ) && (int) $_GET['post'] !== (int) $_POST['post_ID'] ) {
+ wp_die( __( 'A post ID mismatch has been detected.' ), __( 'Sorry, you are not allowed to edit this item.' ), 400 );
+} elseif ( isset( $_GET['post'] ) ) {
+ $post_id = $post_ID = (int) $_GET['post'];
+} elseif ( isset( $_POST['post_ID'] ) ) {
+ $post_id = $post_ID = (int) $_POST['post_ID'];
+} else {
+ $post_id = $post_ID = 0;
+}
+
+/**
+ * @global string $post_type
+ * @global object $post_type_object
+ * @global WP_Post $post
+ */
+global $post_type, $post_type_object, $post;
+
+if ( $post_id ) {
+ $post = get_post( $post_id );
+}
+
+if ( $post ) {
+ $post_type = $post->post_type;
+ $post_type_object = get_post_type_object( $post_type );
+}
+
+if ( isset( $_POST['post_type'] ) && $post && $post_type !== $_POST['post_type'] ) {
+ wp_die( __( 'A post type mismatch has been detected.' ), __( 'Sorry, you are not allowed to edit this item.' ), 400 );
+}
+
+if ( isset( $_POST['deletepost'] ) ) {
+ $action = 'delete';
+} elseif ( isset( $_POST['wp-preview'] ) && 'dopreview' == $_POST['wp-preview'] ) {
+ $action = 'preview';
+}
+
+$sendback = wp_get_referer();
+if ( ! $sendback ||
+ strpos( $sendback, 'post.php' ) !== false ||
+ strpos( $sendback, 'post-new.php' ) !== false ) {
+ if ( 'attachment' == $post_type ) {
+ $sendback = admin_url( 'upload.php' );
+ } else {
+ $sendback = admin_url( 'edit.php' );
+ if ( ! empty( $post_type ) ) {
+ $sendback = add_query_arg( 'post_type', $post_type, $sendback );
+ }
+ }
+} else {
+ $sendback = remove_query_arg( array( 'trashed', 'untrashed', 'deleted', 'ids' ), $sendback );
+}
+
+switch ( $action ) {
+ case 'post-quickdraft-save':
+ // Check nonce and capabilities
+ $nonce = $_REQUEST['_wpnonce'];
+ $error_msg = false;
+
+ // For output of the quickdraft dashboard widget
+ require_once ABSPATH . 'wp-admin/includes/dashboard.php';
+
+ if ( ! wp_verify_nonce( $nonce, 'add-post' ) ) {
+ $error_msg = __( 'Unable to submit this form, please refresh and try again.' );
+ }
+
+ if ( ! current_user_can( get_post_type_object( 'post' )->cap->create_posts ) ) {
+ exit;
+ }
+
+ if ( $error_msg ) {
+ return wp_dashboard_quick_press( $error_msg );
+ }
+
+ $post = get_post( $_REQUEST['post_ID'] );
+ check_admin_referer( 'add-' . $post->post_type );
+
+ $_POST['comment_status'] = get_default_comment_status( $post->post_type );
+ $_POST['ping_status'] = get_default_comment_status( $post->post_type, 'pingback' );
+
+ edit_post();
+ wp_dashboard_quick_press();
+ exit;
+
+ case 'postajaxpost':
+ case 'post':
+ check_admin_referer( 'add-' . $post_type );
+ $post_id = 'postajaxpost' == $action ? edit_post() : write_post();
+ redirect_post( $post_id );
+ exit();
+
+ case 'edit':
+ $editing = true;
+
+ if ( empty( $post_id ) ) {
+ wp_redirect( admin_url( 'post.php' ) );
+ exit();
+ }
+
+ if ( ! $post ) {
+ wp_die( __( 'You attempted to edit an item that doesn&#8217;t exist. Perhaps it was deleted?' ) );
+ }
+
+ if ( ! $post_type_object ) {
+ wp_die( __( 'Invalid post type.' ) );
+ }
+
+ if ( ! in_array( $typenow, get_post_types( array( 'show_ui' => true ) ) ) ) {
+ wp_die( __( 'Sorry, you are not allowed to edit posts in this post type.' ) );
+ }
+
+ if ( ! current_user_can( 'edit_post', $post_id ) ) {
+ wp_die( __( 'Sorry, you are not allowed to edit this item.' ) );
+ }
+
+ if ( 'trash' == $post->post_status ) {
+ wp_die( __( 'You can&#8217;t edit this item because it is in the Trash. Please restore it and try again.' ) );
+ }
+
+ if ( ! empty( $_GET['get-post-lock'] ) ) {
+ check_admin_referer( 'lock-post_' . $post_id );
+ wp_set_post_lock( $post_id );
+ wp_redirect( get_edit_post_link( $post_id, 'url' ) );
+ exit();
+ }
+
+ $post_type = $post->post_type;
+ if ( 'post' == $post_type ) {
+ $parent_file = 'edit.php';
+ $submenu_file = 'edit.php';
+ $post_new_file = 'post-new.php';
+ } elseif ( 'attachment' == $post_type ) {
+ $parent_file = 'upload.php';
+ $submenu_file = 'upload.php';
+ $post_new_file = 'media-new.php';
+ } else {
+ if ( isset( $post_type_object ) && $post_type_object->show_in_menu && $post_type_object->show_in_menu !== true ) {
+ $parent_file = $post_type_object->show_in_menu;
+ } else {
+ $parent_file = "edit.php?post_type=$post_type";
+ }
+ $submenu_file = "edit.php?post_type=$post_type";
+ $post_new_file = "post-new.php?post_type=$post_type";
+ }
+
+ $title = $post_type_object->labels->edit_item;
+
+ /**
+ * Allows replacement of the editor.
+ *
+ * @since 4.9.0
+ *
+ * @param boolean Whether to replace the editor. Default false.
+ * @param object $post Post object.
+ */
+ if ( apply_filters( 'replace_editor', false, $post ) === true ) {
+ break;
+ }
+
+ if ( use_block_editor_for_post( $post ) ) {
+ include( ABSPATH . 'wp-admin/edit-form-blocks.php' );
+ break;
+ }
+
+ if ( ! wp_check_post_lock( $post->ID ) ) {
+ $active_post_lock = wp_set_post_lock( $post->ID );
+
+ if ( 'attachment' !== $post_type ) {
+ wp_enqueue_script( 'autosave' );
+ }
+ }
+
+ $post = get_post( $post_id, OBJECT, 'edit' );
+
+ if ( post_type_supports( $post_type, 'comments' ) ) {
+ wp_enqueue_script( 'admin-comments' );
+ enqueue_comment_hotkeys_js();
+ }
+
+ include( ABSPATH . 'wp-admin/edit-form-advanced.php' );
+
+ break;
+
+ case 'editattachment':
+ check_admin_referer( 'update-post_' . $post_id );
+
+ // Don't let these be changed
+ unset( $_POST['guid'] );
+ $_POST['post_type'] = 'attachment';
+
+ // Update the thumbnail filename
+ $newmeta = wp_get_attachment_metadata( $post_id, true );
+ $newmeta['thumb'] = wp_basename( $_POST['thumb'] );
+
+ wp_update_attachment_metadata( $post_id, $newmeta );
+
+ // Intentional fall-through to trigger the edit_post() call.
+ case 'editpost':
+ check_admin_referer( 'update-post_' . $post_id );
+
+ $post_id = edit_post();
+
+ // Session cookie flag that the post was saved
+ if ( isset( $_COOKIE['wp-saving-post'] ) && $_COOKIE['wp-saving-post'] === $post_id . '-check' ) {
+ setcookie( 'wp-saving-post', $post_id . '-saved', time() + DAY_IN_SECONDS, ADMIN_COOKIE_PATH, COOKIE_DOMAIN, is_ssl() );
+ }
+
+ redirect_post( $post_id ); // Send user on their way while we keep working
+
+ exit();
+
+ case 'trash':
+ check_admin_referer( 'trash-post_' . $post_id );
+
+ if ( ! $post ) {
+ wp_die( __( 'The item you are trying to move to the Trash no longer exists.' ) );
+ }
+
+ if ( ! $post_type_object ) {
+ wp_die( __( 'Invalid post type.' ) );
+ }
+
+ if ( ! current_user_can( 'delete_post', $post_id ) ) {
+ wp_die( __( 'Sorry, you are not allowed to move this item to the Trash.' ) );
+ }
+
+ if ( $user_id = wp_check_post_lock( $post_id ) ) {
+ $user = get_userdata( $user_id );
+ wp_die( sprintf( __( 'You cannot move this item to the Trash. %s is currently editing.' ), $user->display_name ) );
+ }
+
+ if ( ! wp_trash_post( $post_id ) ) {
+ wp_die( __( 'Error in moving to Trash.' ) );
+ }
+
+ wp_redirect(
+ add_query_arg(
+ array(
+ 'trashed' => 1,
+ 'ids' => $post_id,
+ ),
+ $sendback
+ )
+ );
+ exit();
+
+ case 'untrash':
+ check_admin_referer( 'untrash-post_' . $post_id );
+
+ if ( ! $post ) {
+ wp_die( __( 'The item you are trying to restore from the Trash no longer exists.' ) );
+ }
+
+ if ( ! $post_type_object ) {
+ wp_die( __( 'Invalid post type.' ) );
+ }
+
+ if ( ! current_user_can( 'delete_post', $post_id ) ) {
+ wp_die( __( 'Sorry, you are not allowed to restore this item from the Trash.' ) );
+ }
+
+ if ( ! wp_untrash_post( $post_id ) ) {
+ wp_die( __( 'Error in restoring from Trash.' ) );
+ }
+
+ wp_redirect( add_query_arg( 'untrashed', 1, $sendback ) );
+ exit();
+
+ case 'delete':
+ check_admin_referer( 'delete-post_' . $post_id );
+
+ if ( ! $post ) {
+ wp_die( __( 'This item has already been deleted.' ) );
+ }
+
+ if ( ! $post_type_object ) {
+ wp_die( __( 'Invalid post type.' ) );
+ }
+
+ if ( ! current_user_can( 'delete_post', $post_id ) ) {
+ wp_die( __( 'Sorry, you are not allowed to delete this item.' ) );
+ }
+
+ if ( $post->post_type == 'attachment' ) {
+ $force = ( ! MEDIA_TRASH );
+ if ( ! wp_delete_attachment( $post_id, $force ) ) {
+ wp_die( __( 'Error in deleting.' ) );
+ }
+ } else {
+ if ( ! wp_delete_post( $post_id, true ) ) {
+ wp_die( __( 'Error in deleting.' ) );
+ }
+ }
+
+ wp_redirect( add_query_arg( 'deleted', 1, $sendback ) );
+ exit();
+
+ case 'preview':
+ check_admin_referer( 'update-post_' . $post_id );
+
+ $url = post_preview();
+
+ wp_redirect( $url );
+ exit();
+
+ case 'toggle-custom-fields':
+ check_admin_referer( 'toggle-custom-fields' );
+
+ $current_user_id = get_current_user_id();
+ if ( $current_user_id ) {
+ $enable_custom_fields = (bool) get_user_meta( $current_user_id, 'enable_custom_fields', true );
+ update_user_meta( $current_user_id, 'enable_custom_fields', ! $enable_custom_fields );
+ }
+
+ wp_safe_redirect( wp_get_referer() );
+ exit();
+
+ default:
+ /**
+ * Fires for a given custom post action request.
+ *
+ * The dynamic portion of the hook name, `$action`, refers to the custom post action.
+ *
+ * @since 4.6.0
+ *
+ * @param int $post_id Post ID sent with the request.
+ */
+ do_action( "post_action_{$action}", $post_id );
+
+ wp_redirect( admin_url( 'edit.php' ) );
+ exit();
+} // end switch
+include( ABSPATH . 'wp-admin/admin-footer.php' );
diff --git a/www/crm/wp-admin/press-this.php b/www/crm/wp-admin/press-this.php
new file mode 100644
index 00000000..666e42b7
--- /dev/null
+++ b/www/crm/wp-admin/press-this.php
@@ -0,0 +1,87 @@
+<?php
+/**
+ * Press This Display and Handler.
+ *
+ * @package WordPress
+ * @subpackage Press_This
+ */
+
+define( 'IFRAME_REQUEST', true );
+
+/** WordPress Administration Bootstrap */
+require_once( dirname( __FILE__ ) . '/admin.php' );
+
+function wp_load_press_this() {
+ $plugin_slug = 'press-this';
+ $plugin_file = 'press-this/press-this-plugin.php';
+
+ if ( ! current_user_can( 'edit_posts' ) || ! current_user_can( get_post_type_object( 'post' )->cap->create_posts ) ) {
+ wp_die(
+ __( 'Sorry, you are not allowed to create posts as this user.' ),
+ __( 'You need a higher level of permission.' ),
+ 403
+ );
+ } elseif ( is_plugin_active( $plugin_file ) ) {
+ include( WP_PLUGIN_DIR . '/press-this/class-wp-press-this-plugin.php' );
+ $wp_press_this = new WP_Press_This_Plugin();
+ $wp_press_this->html();
+ } elseif ( current_user_can( 'activate_plugins' ) ) {
+ if ( file_exists( WP_PLUGIN_DIR . '/' . $plugin_file ) ) {
+ $url = wp_nonce_url(
+ add_query_arg(
+ array(
+ 'action' => 'activate',
+ 'plugin' => $plugin_file,
+ 'from' => 'press-this',
+ ),
+ admin_url( 'plugins.php' )
+ ),
+ 'activate-plugin_' . $plugin_file
+ );
+ $action = sprintf(
+ '<a href="%1$s" aria-label="%2$s">%2$s</a>',
+ esc_url( $url ),
+ __( 'Activate Press This' )
+ );
+ } else {
+ if ( is_main_site() ) {
+ $url = wp_nonce_url(
+ add_query_arg(
+ array(
+ 'action' => 'install-plugin',
+ 'plugin' => $plugin_slug,
+ 'from' => 'press-this',
+ ),
+ self_admin_url( 'update.php' )
+ ),
+ 'install-plugin_' . $plugin_slug
+ );
+ $action = sprintf(
+ '<a href="%1$s" class="install-now" data-slug="%2$s" data-name="%2$s" aria-label="%3$s">%3$s</a>',
+ esc_url( $url ),
+ esc_attr( $plugin_slug ),
+ __( 'Install Now' )
+ );
+ } else {
+ $action = sprintf(
+ /* translators: URL to wp-admin/press-this.php */
+ __( 'Press This is not installed. Please install Press This from <a href="%s">the main site</a>.' ),
+ get_admin_url( get_current_network_id(), 'press-this.php' )
+ );
+ }
+ }
+ wp_die(
+ __( 'The Press This plugin is required.' ) . '<br />' . $action,
+ __( 'Installation Required' ),
+ 200
+ );
+ } else {
+ wp_die(
+ __( 'Press This is not available. Please contact your site administrator.' ),
+ __( 'Installation Required' ),
+ 200
+ );
+ }
+}
+
+wp_load_press_this();
diff --git a/www/crm/wp-admin/privacy.php b/www/crm/wp-admin/privacy.php
new file mode 100644
index 00000000..3b0a6b31
--- /dev/null
+++ b/www/crm/wp-admin/privacy.php
@@ -0,0 +1,263 @@
+<?php
+/**
+ * Privacy Settings Screen.
+ *
+ * @package WordPress
+ * @subpackage Administration
+ */
+
+/** WordPress Administration Bootstrap */
+require_once( dirname( __FILE__ ) . '/admin.php' );
+
+if ( ! current_user_can( 'manage_privacy_options' ) ) {
+ wp_die( __( 'Sorry, you are not allowed to manage privacy on this site.' ) );
+}
+
+$action = isset( $_POST['action'] ) ? $_POST['action'] : '';
+
+if ( ! empty( $action ) ) {
+ check_admin_referer( $action );
+
+ if ( 'set-privacy-page' === $action ) {
+ $privacy_policy_page_id = isset( $_POST['page_for_privacy_policy'] ) ? (int) $_POST['page_for_privacy_policy'] : 0;
+ update_option( 'wp_page_for_privacy_policy', $privacy_policy_page_id );
+
+ $privacy_page_updated_message = __( 'Privacy Policy page updated successfully.' );
+
+ if ( $privacy_policy_page_id ) {
+ /*
+ * Don't always link to the menu customizer:
+ *
+ * - Unpublished pages can't be selected by default.
+ * - `WP_Customize_Nav_Menus::__construct()` checks the user's capabilities.
+ * - Themes might not "officially" support menus.
+ */
+ if (
+ 'publish' === get_post_status( $privacy_policy_page_id )
+ && current_user_can( 'edit_theme_options' )
+ && current_theme_supports( 'menus' )
+ ) {
+ $privacy_page_updated_message = sprintf(
+ /* translators: %s: URL to Customizer -> Menus */
+ __( 'Privacy Policy page setting updated successfully. Remember to <a href="%s">update your menus</a>!' ),
+ esc_url( add_query_arg( 'autofocus[panel]', 'nav_menus', admin_url( 'customize.php' ) ) )
+ );
+ }
+ }
+
+ add_settings_error(
+ 'page_for_privacy_policy',
+ 'page_for_privacy_policy',
+ $privacy_page_updated_message,
+ 'updated'
+ );
+ } elseif ( 'create-privacy-page' === $action ) {
+
+ if ( ! class_exists( 'WP_Privacy_Policy_Content' ) ) {
+ require_once( ABSPATH . 'wp-admin/includes/misc.php' );
+ }
+
+ $privacy_policy_page_content = WP_Privacy_Policy_Content::get_default_content();
+ $privacy_policy_page_id = wp_insert_post(
+ array(
+ 'post_title' => __( 'Privacy Policy' ),
+ 'post_status' => 'draft',
+ 'post_type' => 'page',
+ 'post_content' => $privacy_policy_page_content,
+ ),
+ true
+ );
+
+ if ( is_wp_error( $privacy_policy_page_id ) ) {
+ add_settings_error(
+ 'page_for_privacy_policy',
+ 'page_for_privacy_policy',
+ __( 'Unable to create a Privacy Policy page.' ),
+ 'error'
+ );
+ } else {
+ update_option( 'wp_page_for_privacy_policy', $privacy_policy_page_id );
+
+ wp_redirect( admin_url( 'post.php?post=' . $privacy_policy_page_id . '&action=edit' ) );
+ exit;
+ }
+ }
+}
+
+// If a Privacy Policy page ID is available, make sure the page actually exists. If not, display an error.
+$privacy_policy_page_exists = false;
+$privacy_policy_page_id = (int) get_option( 'wp_page_for_privacy_policy' );
+
+if ( ! empty( $privacy_policy_page_id ) ) {
+
+ $privacy_policy_page = get_post( $privacy_policy_page_id );
+
+ if ( ! $privacy_policy_page instanceof WP_Post ) {
+ add_settings_error(
+ 'page_for_privacy_policy',
+ 'page_for_privacy_policy',
+ __( 'The currently selected Privacy Policy page does not exist. Please create or select a new page.' ),
+ 'error'
+ );
+ } else {
+ if ( 'trash' === $privacy_policy_page->post_status ) {
+ add_settings_error(
+ 'page_for_privacy_policy',
+ 'page_for_privacy_policy',
+ sprintf(
+ /* translators: URL to Pages Trash */
+ __( 'The currently selected Privacy Policy page is in the trash. Please create or select a new Privacy Policy page or <a href="%s">restore the current page</a>.' ),
+ 'edit.php?post_status=trash&post_type=page'
+ ),
+ 'error'
+ );
+ } else {
+ $privacy_policy_page_exists = true;
+ }
+ }
+}
+
+$title = __( 'Privacy Settings' );
+$parent_file = 'options-general.php';
+
+require_once( ABSPATH . 'wp-admin/admin-header.php' );
+
+?>
+<div class="wrap">
+ <h1><?php echo $title; ?></h1>
+ <h2><?php _e( 'Privacy Policy page' ); ?></h2>
+ <p>
+ <?php _e( 'As a website owner, you may need to follow national or international privacy laws. For example, you may need to create and display a Privacy Policy.' ); ?>
+ <?php _e( 'If you already have a Privacy Policy page, please select it below. If not, please create one.' ); ?>
+ </p>
+ <p>
+ <?php _e( 'The new page will include help and suggestions for your Privacy Policy.' ); ?>
+ <?php _e( 'However, it is your responsibility to use those resources correctly, to provide the information that your Privacy Policy requires, and to keep that information current and accurate.' ); ?>
+ </p>
+ <p>
+ <?php _e( 'After your Privacy Policy page is set, we suggest that you edit it.' ); ?>
+ <?php _e( 'We would also suggest reviewing your Privacy Policy from time to time, especially after installing or updating any themes or plugins. There may be changes or new suggested information for you to consider adding to your policy.' ); ?>
+ </p>
+ <?php
+
+ if ( $privacy_policy_page_exists ) {
+ $edit_href = add_query_arg(
+ array(
+ 'post' => $privacy_policy_page_id,
+ 'action' => 'edit',
+ ),
+ admin_url( 'post.php' )
+ );
+
+ $view_href = get_permalink( $privacy_policy_page_id );
+
+ ?>
+ <p class="tools-privacy-edit"><strong>
+ <?php
+
+ if ( 'publish' === get_post_status( $privacy_policy_page_id ) ) {
+ printf(
+ /* translators: 1: URL to edit Privacy Policy page, 2: URL to view Privacy Policy page */
+ __( '<a href="%1$s">Edit</a> or <a href="%2$s">view</a> your Privacy Policy page content.' ),
+ esc_url( $edit_href ),
+ esc_url( $view_href )
+ );
+ } else {
+ printf(
+ /* translators: 1: URL to edit Privacy Policy page, 2: URL to preview Privacy Policy page */
+ __( '<a href="%1$s">Edit</a> or <a href="%2$s">preview</a> your Privacy Policy page content.' ),
+ esc_url( $edit_href ),
+ esc_url( $view_href )
+ );
+ }
+
+ ?>
+ </strong></p>
+ <?php
+ }
+ ?>
+ <p>
+ <?php
+
+ printf(
+ /* translators: 1: Privacy Policy guide URL, 2: additional link attributes, 3: accessibility text */
+ __( 'Need help putting together your new Privacy Policy page? <a href="%1$s" %2$s>Check out our guide%3$s</a> for recommendations on what content to include, along with policies suggested by your plugins and theme.' ),
+ esc_url( admin_url( 'tools.php?wp-privacy-policy-guide=1' ) ),
+ '',
+ ''
+ );
+
+ ?>
+ </p>
+
+ <hr>
+ <table class="form-table tools-privacy-policy-page" role="presentation">
+ <tr>
+ <th scope="row"><label for="page_for_privacy_policy">
+ <?php
+ if ( $privacy_policy_page_exists ) {
+ _e( 'Change your Privacy Policy page' );
+ } else {
+ _e( 'Select a Privacy Policy page' );
+ }
+ ?>
+ </label></th>
+ <td>
+ <?php
+ $has_pages = (bool) get_posts(
+ array(
+ 'post_type' => 'page',
+ 'posts_per_page' => 1,
+ 'post_status' => array(
+ 'publish',
+ 'draft',
+ ),
+ )
+ );
+
+ if ( $has_pages ) :
+ ?>
+ <form method="post" action="">
+ <input type="hidden" name="action" value="set-privacy-page" />
+ <?php
+ wp_dropdown_pages(
+ array(
+ 'name' => 'page_for_privacy_policy',
+ 'show_option_none' => __( '&mdash; Select &mdash;' ),
+ 'option_none_value' => '0',
+ 'selected' => $privacy_policy_page_id,
+ 'post_status' => array( 'draft', 'publish' ),
+ )
+ );
+
+ wp_nonce_field( 'set-privacy-page' );
+
+ submit_button( __( 'Use This Page' ), 'primary', 'submit', false, array( 'id' => 'set-page' ) );
+ ?>
+ </form>
+ <?php endif; ?>
+
+ <form class="wp-create-privacy-page" method="post" action="">
+ <input type="hidden" name="action" value="create-privacy-page" />
+ <span>
+ <?php
+ if ( $has_pages ) {
+ _e( 'Or:' );
+ } else {
+ _e( 'There are no pages.' );
+ }
+ ?>
+ </span>
+ <?php
+ wp_nonce_field( 'create-privacy-page' );
+
+ submit_button( __( 'Create New Page' ), 'primary', 'submit', false, array( 'id' => 'create-page' ) );
+ ?>
+ </form>
+ </td>
+ </tr>
+ </table>
+</div>
+<?php
+
+include( ABSPATH . 'wp-admin/admin-footer.php' );
diff --git a/www/crm/wp-admin/profile.php b/www/crm/wp-admin/profile.php
new file mode 100644
index 00000000..577925ab
--- /dev/null
+++ b/www/crm/wp-admin/profile.php
@@ -0,0 +1,18 @@
+<?php
+/**
+ * User Profile Administration Screen.
+ *
+ * @package WordPress
+ * @subpackage Administration
+ */
+
+/**
+ * This is a profile page.
+ *
+ * @since 2.5.0
+ * @var bool
+ */
+define( 'IS_PROFILE_PAGE', true );
+
+/** Load User Editing Page */
+require_once( dirname( __FILE__ ) . '/user-edit.php' );
diff --git a/www/crm/wp-admin/revision.php b/www/crm/wp-admin/revision.php
new file mode 100644
index 00000000..79338d63
--- /dev/null
+++ b/www/crm/wp-admin/revision.php
@@ -0,0 +1,155 @@
+<?php
+/**
+ * Revisions administration panel
+ *
+ * Requires wp-admin/includes/revision.php.
+ *
+ * @package WordPress
+ * @subpackage Administration
+ * @since 2.6.0
+ */
+
+/** WordPress Administration Bootstrap */
+require_once( dirname( __FILE__ ) . '/admin.php' );
+
+require ABSPATH . 'wp-admin/includes/revision.php';
+
+/**
+ * @global int $revision Optional. The revision ID.
+ * @global string $action The action to take.
+ * Accepts 'restore', 'view' or 'edit'.
+ * @global int $from The revision to compare from.
+ * @global int $to Optional, required if revision missing. The revision to compare to.
+ */
+wp_reset_vars( array( 'revision', 'action', 'from', 'to' ) );
+
+$revision_id = absint( $revision );
+
+$from = is_numeric( $from ) ? absint( $from ) : null;
+if ( ! $revision_id ) {
+ $revision_id = absint( $to );
+}
+$redirect = 'edit.php';
+
+switch ( $action ) {
+ case 'restore':
+ if ( ! $revision = wp_get_post_revision( $revision_id ) ) {
+ break;
+ }
+
+ if ( ! current_user_can( 'edit_post', $revision->post_parent ) ) {
+ break;
+ }
+
+ if ( ! $post = get_post( $revision->post_parent ) ) {
+ break;
+ }
+
+ // Restore if revisions are enabled or this is an autosave.
+ if ( ! wp_revisions_enabled( $post ) && ! wp_is_post_autosave( $revision ) ) {
+ $redirect = 'edit.php?post_type=' . $post->post_type;
+ break;
+ }
+
+ // Don't allow revision restore when post is locked
+ if ( wp_check_post_lock( $post->ID ) ) {
+ break;
+ }
+
+ check_admin_referer( "restore-post_{$revision->ID}" );
+
+ wp_restore_post_revision( $revision->ID );
+ $redirect = add_query_arg(
+ array(
+ 'message' => 5,
+ 'revision' => $revision->ID,
+ ),
+ get_edit_post_link( $post->ID, 'url' )
+ );
+ break;
+ case 'view':
+ case 'edit':
+ default:
+ if ( ! $revision = wp_get_post_revision( $revision_id ) ) {
+ break;
+ }
+ if ( ! $post = get_post( $revision->post_parent ) ) {
+ break;
+ }
+
+ if ( ! current_user_can( 'read_post', $revision->ID ) || ! current_user_can( 'edit_post', $revision->post_parent ) ) {
+ break;
+ }
+
+ // Revisions disabled and we're not looking at an autosave
+ if ( ! wp_revisions_enabled( $post ) && ! wp_is_post_autosave( $revision ) ) {
+ $redirect = 'edit.php?post_type=' . $post->post_type;
+ break;
+ }
+
+ $post_edit_link = get_edit_post_link();
+ $post_title = '<a href="' . $post_edit_link . '">' . _draft_or_post_title() . '</a>';
+ /* translators: %s: post title */
+ $h1 = sprintf( __( 'Compare Revisions of &#8220;%s&#8221;' ), $post_title );
+ $return_to_post = '<a href="' . $post_edit_link . '">' . __( '&larr; Return to editor' ) . '</a>';
+ $title = __( 'Revisions' );
+
+ $redirect = false;
+ break;
+}
+
+// Empty post_type means either malformed object found, or no valid parent was found.
+if ( ! $redirect && empty( $post->post_type ) ) {
+ $redirect = 'edit.php';
+}
+
+if ( ! empty( $redirect ) ) {
+ wp_redirect( $redirect );
+ exit;
+}
+
+// This is so that the correct "Edit" menu item is selected.
+if ( ! empty( $post->post_type ) && 'post' != $post->post_type ) {
+ $parent_file = $submenu_file = 'edit.php?post_type=' . $post->post_type;
+} else {
+ $parent_file = $submenu_file = 'edit.php';
+}
+
+wp_enqueue_script( 'revisions' );
+wp_localize_script( 'revisions', '_wpRevisionsSettings', wp_prepare_revisions_for_js( $post, $revision_id, $from ) );
+
+/* Revisions Help Tab */
+
+$revisions_overview = '<p>' . __( 'This screen is used for managing your content revisions.' ) . '</p>';
+$revisions_overview .= '<p>' . __( 'Revisions are saved copies of your post or page, which are periodically created as you update your content. The red text on the left shows the content that was removed. The green text on the right shows the content that was added.' ) . '</p>';
+$revisions_overview .= '<p>' . __( 'From this screen you can review, compare, and restore revisions:' ) . '</p>';
+$revisions_overview .= '<ul><li>' . __( 'To navigate between revisions, <strong>drag the slider handle left or right</strong> or <strong>use the Previous or Next buttons</strong>.' ) . '</li>';
+$revisions_overview .= '<li>' . __( 'Compare two different revisions by <strong>selecting the &#8220;Compare any two revisions&#8221; box</strong> to the side.' ) . '</li>';
+$revisions_overview .= '<li>' . __( 'To restore a revision, <strong>click Restore This Revision</strong>.' ) . '</li></ul>';
+
+get_current_screen()->add_help_tab(
+ array(
+ 'id' => 'revisions-overview',
+ 'title' => __( 'Overview' ),
+ 'content' => $revisions_overview,
+ )
+);
+
+$revisions_sidebar = '<p><strong>' . __( 'For more information:' ) . '</strong></p>';
+$revisions_sidebar .= '<p>' . __( '<a href="https://codex.wordpress.org/Revision_Management">Revisions Management</a>' ) . '</p>';
+$revisions_sidebar .= '<p>' . __( '<a href="https://wordpress.org/support/">Support</a>' ) . '</p>';
+
+get_current_screen()->set_help_sidebar( $revisions_sidebar );
+
+require_once( ABSPATH . 'wp-admin/admin-header.php' );
+
+?>
+
+<div class="wrap">
+ <h1 class="long-header"><?php echo $h1; ?></h1>
+ <?php echo $return_to_post; ?>
+</div>
+<?php
+wp_print_revision_templates();
+
+require_once( ABSPATH . 'wp-admin/admin-footer.php' );
diff --git a/www/crm/wp-admin/setup-config.php b/www/crm/wp-admin/setup-config.php
new file mode 100644
index 00000000..428c3353
--- /dev/null
+++ b/www/crm/wp-admin/setup-config.php
@@ -0,0 +1,454 @@
+<?php
+/**
+ * Retrieves and creates the wp-config.php file.
+ *
+ * The permissions for the base directory must allow for writing files in order
+ * for the wp-config.php to be created using this page.
+ *
+ * @package WordPress
+ * @subpackage Administration
+ */
+
+/**
+ * We are installing.
+ */
+define( 'WP_INSTALLING', true );
+
+/**
+ * We are blissfully unaware of anything.
+ */
+define( 'WP_SETUP_CONFIG', true );
+
+/**
+ * Disable error reporting
+ *
+ * Set this to error_reporting( -1 ) for debugging
+ */
+error_reporting( 0 );
+
+if ( ! defined( 'ABSPATH' ) ) {
+ define( 'ABSPATH', dirname( dirname( __FILE__ ) ) . '/' );
+}
+
+require( ABSPATH . 'wp-settings.php' );
+
+/** Load WordPress Administration Upgrade API */
+require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
+
+/** Load WordPress Translation Installation API */
+require_once( ABSPATH . 'wp-admin/includes/translation-install.php' );
+
+nocache_headers();
+
+// Support wp-config-sample.php one level up, for the develop repo.
+if ( file_exists( ABSPATH . 'wp-config-sample.php' ) ) {
+ $config_file = file( ABSPATH . 'wp-config-sample.php' );
+} elseif ( file_exists( dirname( ABSPATH ) . '/wp-config-sample.php' ) ) {
+ $config_file = file( dirname( ABSPATH ) . '/wp-config-sample.php' );
+} else {
+ wp_die(
+ sprintf(
+ /* translators: %s: wp-config-sample.php */
+ __( 'Sorry, I need a %s file to work from. Please re-upload this file to your WordPress installation.' ),
+ '<code>wp-config-sample.php</code>'
+ )
+ );
+}
+
+// Check if wp-config.php has been created
+if ( file_exists( ABSPATH . 'wp-config.php' ) ) {
+ wp_die(
+ '<p>' . sprintf(
+ /* translators: 1: wp-config.php, 2: install.php */
+ __( 'The file %1$s already exists. If you need to reset any of the configuration items in this file, please delete it first. You may try <a href="%2$s">installing now</a>.' ),
+ '<code>wp-config.php</code>',
+ 'install.php'
+ ) . '</p>'
+ );
+}
+
+// Check if wp-config.php exists above the root directory but is not part of another installation
+if ( @file_exists( ABSPATH . '../wp-config.php' ) && ! @file_exists( ABSPATH . '../wp-settings.php' ) ) {
+ wp_die(
+ '<p>' . sprintf(
+ /* translators: 1: wp-config.php, 2: install.php */
+ __( 'The file %1$s already exists one level above your WordPress installation. If you need to reset any of the configuration items in this file, please delete it first. You may try <a href="%2$s">installing now</a>.' ),
+ '<code>wp-config.php</code>',
+ 'install.php'
+ ) . '</p>'
+ );
+}
+
+$step = isset( $_GET['step'] ) ? (int) $_GET['step'] : -1;
+
+/**
+ * Display setup wp-config.php file header.
+ *
+ * @ignore
+ * @since 2.3.0
+ *
+ * @global string $wp_local_package
+ * @global WP_Locale $wp_locale
+ *
+ * @param string|array $body_classes
+ */
+function setup_config_display_header( $body_classes = array() ) {
+ $body_classes = (array) $body_classes;
+ $body_classes[] = 'wp-core-ui';
+ $dir_attr = '';
+ if ( is_rtl() ) {
+ $body_classes[] = 'rtl';
+ $dir_attr = ' dir="rtl"';
+ }
+
+ header( 'Content-Type: text/html; charset=utf-8' );
+ ?>
+<!DOCTYPE html>
+<html xmlns="http://www.w3.org/1999/xhtml"<?php echo $dir_attr; ?>>
+<head>
+ <meta name="viewport" content="width=device-width" />
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+ <meta name="robots" content="noindex,nofollow" />
+ <title><?php _e( 'WordPress &rsaquo; Setup Configuration File' ); ?></title>
+ <?php wp_admin_css( 'install', true ); ?>
+</head>
+<body class="<?php echo implode( ' ', $body_classes ); ?>">
+<p id="logo"><a href="<?php echo esc_url( __( 'https://wordpress.org/' ) ); ?>"><?php _e( 'WordPress' ); ?></a></p>
+ <?php
+} // end function setup_config_display_header();
+
+$language = '';
+if ( ! empty( $_REQUEST['language'] ) ) {
+ $language = preg_replace( '/[^a-zA-Z0-9_]/', '', $_REQUEST['language'] );
+} elseif ( isset( $GLOBALS['wp_local_package'] ) ) {
+ $language = $GLOBALS['wp_local_package'];
+}
+
+switch ( $step ) {
+ case -1:
+ if ( wp_can_install_language_pack() && empty( $language ) && ( $languages = wp_get_available_translations() ) ) {
+ setup_config_display_header( 'language-chooser' );
+ echo '<h1 class="screen-reader-text">Select a default language</h1>';
+ echo '<form id="setup" method="post" action="?step=0">';
+ wp_install_language_form( $languages );
+ echo '</form>';
+ break;
+ }
+
+ // Deliberately fall through if we can't reach the translations API.
+
+ case 0:
+ if ( ! empty( $language ) ) {
+ $loaded_language = wp_download_language_pack( $language );
+ if ( $loaded_language ) {
+ load_default_textdomain( $loaded_language );
+ $GLOBALS['wp_locale'] = new WP_Locale();
+ }
+ }
+
+ setup_config_display_header();
+ $step_1 = 'setup-config.php?step=1';
+ if ( isset( $_REQUEST['noapi'] ) ) {
+ $step_1 .= '&amp;noapi';
+ }
+ if ( ! empty( $loaded_language ) ) {
+ $step_1 .= '&amp;language=' . $loaded_language;
+ }
+ ?>
+<h1 class="screen-reader-text"><?php _e( 'Before getting started' ); ?></h1>
+<p><?php _e( 'Welcome to WordPress. Before getting started, we need some information on the database. You will need to know the following items before proceeding.' ); ?></p>
+<ol>
+ <li><?php _e( 'Database name' ); ?></li>
+ <li><?php _e( 'Database username' ); ?></li>
+ <li><?php _e( 'Database password' ); ?></li>
+ <li><?php _e( 'Database host' ); ?></li>
+ <li><?php _e( 'Table prefix (if you want to run more than one WordPress in a single database)' ); ?></li>
+</ol>
+<p>
+ <?php
+ /* translators: %s: wp-config.php */
+ printf(
+ __( 'We&#8217;re going to use this information to create a %s file.' ),
+ '<code>wp-config.php</code>'
+ );
+ ?>
+ <strong>
+ <?php
+ /* translators: 1: wp-config-sample.php, 2: wp-config.php */
+ printf(
+ __( 'If for any reason this automatic file creation doesn&#8217;t work, don&#8217;t worry. All this does is fill in the database information to a configuration file. You may also simply open %1$s in a text editor, fill in your information, and save it as %2$s.' ),
+ '<code>wp-config-sample.php</code>',
+ '<code>wp-config.php</code>'
+ );
+ ?>
+ </strong>
+ <?php
+ /* translators: %s: Codex URL */
+ printf(
+ __( 'Need more help? <a href="%s">We got it</a>.' ),
+ __( 'https://codex.wordpress.org/Editing_wp-config.php' )
+ );
+ ?>
+</p>
+<p><?php _e( 'In all likelihood, these items were supplied to you by your Web Host. If you don&#8217;t have this information, then you will need to contact them before you can continue. If you&#8217;re all ready&hellip;' ); ?></p>
+
+<p class="step"><a href="<?php echo $step_1; ?>" class="button button-large"><?php _e( 'Let&#8217;s go!' ); ?></a></p>
+ <?php
+ break;
+
+ case 1:
+ load_default_textdomain( $language );
+ $GLOBALS['wp_locale'] = new WP_Locale();
+
+ setup_config_display_header();
+
+ $autofocus = wp_is_mobile() ? '' : ' autofocus';
+ ?>
+<h1 class="screen-reader-text"><?php _e( 'Set up your database connection' ); ?></h1>
+<form method="post" action="setup-config.php?step=2">
+ <p><?php _e( 'Below you should enter your database connection details. If you&#8217;re not sure about these, contact your host.' ); ?></p>
+ <table class="form-table" role="presentation">
+ <tr>
+ <th scope="row"><label for="dbname"><?php _e( 'Database Name' ); ?></label></th>
+ <td><input name="dbname" id="dbname" type="text" aria-describedby="dbname-desc" size="25" value="wordpress"<?php echo $autofocus; ?>/></td>
+ <td id="dbname-desc"><?php _e( 'The name of the database you want to use with WordPress.' ); ?></td>
+ </tr>
+ <tr>
+ <th scope="row"><label for="uname"><?php _e( 'Username' ); ?></label></th>
+ <td><input name="uname" id="uname" type="text" aria-describedby="uname-desc" size="25" value="<?php echo htmlspecialchars( _x( 'username', 'example username' ), ENT_QUOTES ); ?>" /></td>
+ <td id="uname-desc"><?php _e( 'Your database username.' ); ?></td>
+ </tr>
+ <tr>
+ <th scope="row"><label for="pwd"><?php _e( 'Password' ); ?></label></th>
+ <td><input name="pwd" id="pwd" type="text" aria-describedby="pwd-desc" size="25" value="<?php echo htmlspecialchars( _x( 'password', 'example password' ), ENT_QUOTES ); ?>" autocomplete="off" /></td>
+ <td id="pwd-desc"><?php _e( 'Your database password.' ); ?></td>
+ </tr>
+ <tr>
+ <th scope="row"><label for="dbhost"><?php _e( 'Database Host' ); ?></label></th>
+ <td><input name="dbhost" id="dbhost" type="text" aria-describedby="dbhost-desc" size="25" value="localhost" /></td>
+ <td id="dbhost-desc">
+ <?php
+ /* translators: %s: localhost */
+ printf( __( 'You should be able to get this info from your web host, if %s doesn&#8217;t work.' ), '<code>localhost</code>' );
+ ?>
+ </td>
+ </tr>
+ <tr>
+ <th scope="row"><label for="prefix"><?php _e( 'Table Prefix' ); ?></label></th>
+ <td><input name="prefix" id="prefix" type="text" aria-describedby="prefix-desc" value="wp_" size="25" /></td>
+ <td id="prefix-desc"><?php _e( 'If you want to run multiple WordPress installations in a single database, change this.' ); ?></td>
+ </tr>
+ </table>
+ <?php
+ if ( isset( $_GET['noapi'] ) ) {
+ ?>
+<input name="noapi" type="hidden" value="1" /><?php } ?>
+ <input type="hidden" name="language" value="<?php echo esc_attr( $language ); ?>" />
+ <p class="step"><input name="submit" type="submit" value="<?php echo htmlspecialchars( __( 'Submit' ), ENT_QUOTES ); ?>" class="button button-large" /></p>
+</form>
+ <?php
+ break;
+
+ case 2:
+ load_default_textdomain( $language );
+ $GLOBALS['wp_locale'] = new WP_Locale();
+
+ $dbname = trim( wp_unslash( $_POST['dbname'] ) );
+ $uname = trim( wp_unslash( $_POST['uname'] ) );
+ $pwd = trim( wp_unslash( $_POST['pwd'] ) );
+ $dbhost = trim( wp_unslash( $_POST['dbhost'] ) );
+ $prefix = trim( wp_unslash( $_POST['prefix'] ) );
+
+ $step_1 = 'setup-config.php?step=1';
+ $install = 'install.php';
+ if ( isset( $_REQUEST['noapi'] ) ) {
+ $step_1 .= '&amp;noapi';
+ }
+
+ if ( ! empty( $language ) ) {
+ $step_1 .= '&amp;language=' . $language;
+ $install .= '?language=' . $language;
+ } else {
+ $install .= '?language=en_US';
+ }
+
+ $tryagain_link = '</p><p class="step"><a href="' . $step_1 . '" onclick="javascript:history.go(-1);return false;" class="button button-large">' . __( 'Try again' ) . '</a>';
+
+ if ( empty( $prefix ) ) {
+ wp_die( __( '<strong>ERROR</strong>: "Table Prefix" must not be empty.' ) . $tryagain_link );
+ }
+
+ // Validate $prefix: it can only contain letters, numbers and underscores.
+ if ( preg_match( '|[^a-z0-9_]|i', $prefix ) ) {
+ wp_die( __( '<strong>ERROR</strong>: "Table Prefix" can only contain numbers, letters, and underscores.' ) . $tryagain_link );
+ }
+
+ // Test the db connection.
+ /**#@+
+ *
+ * @ignore
+ */
+ define( 'DB_NAME', $dbname );
+ define( 'DB_USER', $uname );
+ define( 'DB_PASSWORD', $pwd );
+ define( 'DB_HOST', $dbhost );
+ /**#@-*/
+
+ // Re-construct $wpdb with these new values.
+ unset( $wpdb );
+ require_wp_db();
+
+ /*
+ * The wpdb constructor bails when WP_SETUP_CONFIG is set, so we must
+ * fire this manually. We'll fail here if the values are no good.
+ */
+ $wpdb->db_connect();
+
+ if ( ! empty( $wpdb->error ) ) {
+ wp_die( $wpdb->error->get_error_message() . $tryagain_link );
+ }
+
+ $errors = $wpdb->hide_errors();
+ $wpdb->query( "SELECT $prefix" );
+ $wpdb->show_errors( $errors );
+ if ( ! $wpdb->last_error ) {
+ // MySQL was able to parse the prefix as a value, which we don't want. Bail.
+ wp_die( __( '<strong>ERROR</strong>: "Table Prefix" is invalid.' ) );
+ }
+
+ // Generate keys and salts using secure CSPRNG; fallback to API if enabled; further fallback to original wp_generate_password().
+ try {
+ $chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_ []{}<>~`+=,.;:/?|';
+ $max = strlen( $chars ) - 1;
+ for ( $i = 0; $i < 8; $i++ ) {
+ $key = '';
+ for ( $j = 0; $j < 64; $j++ ) {
+ $key .= substr( $chars, random_int( 0, $max ), 1 );
+ }
+ $secret_keys[] = $key;
+ }
+ } catch ( Exception $ex ) {
+ $no_api = isset( $_POST['noapi'] );
+
+ if ( ! $no_api ) {
+ $secret_keys = wp_remote_get( 'https://api.wordpress.org/secret-key/1.1/salt/' );
+ }
+
+ if ( $no_api || is_wp_error( $secret_keys ) ) {
+ $secret_keys = array();
+ for ( $i = 0; $i < 8; $i++ ) {
+ $secret_keys[] = wp_generate_password( 64, true, true );
+ }
+ } else {
+ $secret_keys = explode( "\n", wp_remote_retrieve_body( $secret_keys ) );
+ foreach ( $secret_keys as $k => $v ) {
+ $secret_keys[ $k ] = substr( $v, 28, 64 );
+ }
+ }
+ }
+
+ $key = 0;
+ foreach ( $config_file as $line_num => $line ) {
+ if ( '$table_prefix =' == substr( $line, 0, 15 ) ) {
+ $config_file[ $line_num ] = '$table_prefix = \'' . addcslashes( $prefix, "\\'" ) . "';\r\n";
+ continue;
+ }
+
+ if ( ! preg_match( '/^define\(\s*\'([A-Z_]+)\',([ ]+)/', $line, $match ) ) {
+ continue;
+ }
+
+ $constant = $match[1];
+ $padding = $match[2];
+
+ switch ( $constant ) {
+ case 'DB_NAME':
+ case 'DB_USER':
+ case 'DB_PASSWORD':
+ case 'DB_HOST':
+ $config_file[ $line_num ] = "define( '" . $constant . "'," . $padding . "'" . addcslashes( constant( $constant ), "\\'" ) . "' );\r\n";
+ break;
+ case 'DB_CHARSET':
+ if ( 'utf8mb4' === $wpdb->charset || ( ! $wpdb->charset && $wpdb->has_cap( 'utf8mb4' ) ) ) {
+ $config_file[ $line_num ] = "define( '" . $constant . "'," . $padding . "'utf8mb4' );\r\n";
+ }
+ break;
+ case 'AUTH_KEY':
+ case 'SECURE_AUTH_KEY':
+ case 'LOGGED_IN_KEY':
+ case 'NONCE_KEY':
+ case 'AUTH_SALT':
+ case 'SECURE_AUTH_SALT':
+ case 'LOGGED_IN_SALT':
+ case 'NONCE_SALT':
+ $config_file[ $line_num ] = "define( '" . $constant . "'," . $padding . "'" . $secret_keys[ $key++ ] . "' );\r\n";
+ break;
+ }
+ }
+ unset( $line );
+
+ if ( ! is_writable( ABSPATH ) ) :
+ setup_config_display_header();
+ ?>
+ <p>
+ <?php
+ /* translators: %s: wp-config.php */
+ printf( __( 'Sorry, but I can&#8217;t write the %s file.' ), '<code>wp-config.php</code>' );
+ ?>
+</p>
+<p>
+ <?php
+ /* translators: %s: wp-config.php */
+ printf( __( 'You can create the %s file manually and paste the following text into it.' ), '<code>wp-config.php</code>' );
+
+ $config_text = '';
+
+ foreach ( $config_file as $line ) {
+ $config_text .= htmlentities( $line, ENT_COMPAT, 'UTF-8' );
+ }
+ ?>
+</p>
+<textarea id="wp-config" cols="98" rows="15" class="code" readonly="readonly"><?php echo $config_text; ?></textarea>
+<p><?php _e( 'After you&#8217;ve done that, click &#8220;Run the installation.&#8221;' ); ?></p>
+<p class="step"><a href="<?php echo $install; ?>" class="button button-large"><?php _e( 'Run the installation' ); ?></a></p>
+<script>
+(function(){
+if ( ! /iPad|iPod|iPhone/.test( navigator.userAgent ) ) {
+ var el = document.getElementById('wp-config');
+ el.focus();
+ el.select();
+}
+})();
+</script>
+ <?php
+ else :
+ /*
+ * If this file doesn't exist, then we are using the wp-config-sample.php
+ * file one level up, which is for the develop repo.
+ */
+ if ( file_exists( ABSPATH . 'wp-config-sample.php' ) ) {
+ $path_to_wp_config = ABSPATH . 'wp-config.php';
+ } else {
+ $path_to_wp_config = dirname( ABSPATH ) . '/wp-config.php';
+ }
+
+ $handle = fopen( $path_to_wp_config, 'w' );
+ foreach ( $config_file as $line ) {
+ fwrite( $handle, $line );
+ }
+ fclose( $handle );
+ chmod( $path_to_wp_config, 0666 );
+ setup_config_display_header();
+ ?>
+<h1 class="screen-reader-text"><?php _e( 'Successful database connection' ); ?></h1>
+<p><?php _e( 'All right, sparky! You&#8217;ve made it through this part of the installation. WordPress can now communicate with your database. If you are ready, time now to&hellip;' ); ?></p>
+
+<p class="step"><a href="<?php echo $install; ?>" class="button button-large"><?php _e( 'Run the installation' ); ?></a></p>
+ <?php
+ endif;
+ break;
+}
+?>
+<?php wp_print_scripts( 'language-chooser' ); ?>
+</body>
+</html>
diff --git a/www/crm/wp-admin/site-health-info.php b/www/crm/wp-admin/site-health-info.php
new file mode 100644
index 00000000..d65581d9
--- /dev/null
+++ b/www/crm/wp-admin/site-health-info.php
@@ -0,0 +1,178 @@
+<?php
+/**
+ * Tools Administration Screen.
+ *
+ * @package WordPress
+ * @subpackage Administration
+ */
+
+/** WordPress Administration Bootstrap */
+require_once( dirname( __FILE__ ) . '/admin.php' );
+
+$title = __( 'Site Health Info' );
+
+if ( ! current_user_can( 'view_site_health_checks' ) ) {
+ wp_die( __( 'Sorry, you are not allowed to access the debug data.' ), '', 403 );
+}
+
+wp_enqueue_style( 'site-health' );
+wp_enqueue_script( 'site-health' );
+
+if ( ! class_exists( 'WP_Debug_Data' ) ) {
+ require_once( ABSPATH . 'wp-admin/includes/class-wp-debug-data.php' );
+}
+if ( ! class_exists( 'WP_Site_Health' ) ) {
+ require_once( ABSPATH . 'wp-admin/includes/class-wp-site-health.php' );
+}
+
+$health_check_site_status = new WP_Site_Health();
+
+require_once( ABSPATH . 'wp-admin/admin-header.php' );
+?>
+<div class="health-check-header">
+ <div class="health-check-title-section">
+ <h1>
+ <?php _e( 'Site Health' ); ?>
+ </h1>
+
+ <div class="site-health-progress hide-if-no-js loading">
+ <svg role="img" aria-hidden="true" focusable="false" width="100%" height="100%" viewBox="0 0 200 200" version="1.1" xmlns="http://www.w3.org/2000/svg">
+ <circle r="90" cx="100" cy="100" fill="transparent" stroke-dasharray="565.48" stroke-dashoffset="0"></circle>
+ <circle id="bar" r="90" cx="100" cy="100" fill="transparent" stroke-dasharray="565.48" stroke-dashoffset="0"></circle>
+ </svg>
+ <span class="screen-reader-text"><?php _e( 'Current health score:' ); ?></span>
+ <span class="site-health-progress-count"></span>
+ </div>
+ </div>
+
+ <nav class="health-check-tabs-wrapper hide-if-no-js" aria-label="<?php esc_attr_e( 'Secondary menu' ); ?>">
+ <a href="<?php echo esc_url( admin_url( 'site-health.php' ) ); ?>" class="health-check-tab">
+ <?php
+ /* translators: tab heading for Site Health Status page */
+ _ex( 'Status', 'Site Health' );
+ ?>
+ </a>
+
+ <a href="<?php echo esc_url( admin_url( 'site-health.php?tab=debug' ) ); ?>" class="health-check-tab active" aria-current="true">
+ <?php
+ /* translators: tab heading for Site Health Info page */
+ _ex( 'Info', 'Site Health' );
+ ?>
+ </a>
+ </nav>
+</div>
+
+<hr class="wp-header-end">
+
+<div class="notice notice-error hide-if-js">
+ <p><?php _e( 'The Site Health check requires JavaScript.' ); ?></p>
+</div>
+
+<div class="health-check-body health-check-debug-tab hide-if-no-js">
+ <?php
+
+ WP_Debug_Data::check_for_updates();
+
+ $info = WP_Debug_Data::debug_data();
+
+ ?>
+
+ <h2>
+ <?php _e( 'Site Health Info' ); ?>
+ </h2>
+
+ <p>
+ <?php _e( 'This page can show you every detail about the configuration of your WordPress website. If we see anything here that could be improved, we will let you know on the Site Health Status page.' ); ?>
+ </p>
+ <p>
+ <?php _e( 'If you want to export a handy list of all the information on this page, you can use the button below to copy it to the clipboard. You can then paste it in a text file and save it to your harddrive, or paste it in an email exchange with a support engineer or theme/plugin developer for example.' ); ?>
+ </p>
+
+ <div class="site-health-copy-buttons">
+ <div class="copy-button-wrapper">
+ <button type="button" class="button copy-button" data-clipboard-text="<?php echo esc_attr( WP_Debug_Data::format( $info, 'debug' ) ); ?>">
+ <?php _e( 'Copy site info to clipboard' ); ?>
+ </button>
+ <span class="success" aria-hidden="true"><?php _e( 'Copied!' ); ?></span>
+ </div>
+ </div>
+
+ <div id="health-check-debug" class="health-check-accordion">
+
+ <?php
+
+ $sizes_fields = array( 'uploads_size', 'themes_size', 'plugins_size', 'wordpress_size', 'database_size', 'total_size' );
+
+ foreach ( $info as $section => $details ) {
+ if ( ! isset( $details['fields'] ) || empty( $details['fields'] ) ) {
+ continue;
+ }
+
+ ?>
+ <h3 class="health-check-accordion-heading">
+ <button aria-expanded="false" class="health-check-accordion-trigger" aria-controls="health-check-accordion-block-<?php echo esc_attr( $section ); ?>" type="button">
+ <span class="title">
+ <?php echo esc_html( $details['label'] ); ?>
+ <?php
+
+ if ( isset( $details['show_count'] ) && $details['show_count'] ) {
+ printf( '(%d)', count( $details['fields'] ) );
+ }
+
+ ?>
+ </span>
+ <?php
+
+ if ( 'wp-paths-sizes' === $section ) {
+ ?>
+ <span class="health-check-wp-paths-sizes spinner"></span>
+ <?php
+ }
+
+ ?>
+ <span class="icon"></span>
+ </button>
+ </h3>
+
+ <div id="health-check-accordion-block-<?php echo esc_attr( $section ); ?>" class="health-check-accordion-panel" hidden="hidden">
+ <?php
+
+ if ( isset( $details['description'] ) && ! empty( $details['description'] ) ) {
+ printf( '<p>%s</p>', $details['description'] );
+ }
+
+ ?>
+ <table class="widefat striped health-check-table" role="presentation">
+ <tbody>
+ <?php
+
+ foreach ( $details['fields'] as $field_name => $field ) {
+ if ( is_array( $field['value'] ) ) {
+ $values = '<ul>';
+
+ foreach ( $field['value'] as $name => $value ) {
+ $values .= sprintf( '<li>%s: %s</li>', esc_html( $name ), esc_html( $value ) );
+ }
+
+ $values .= '</ul>';
+ } else {
+ $values = esc_html( $field['value'] );
+ }
+
+ if ( in_array( $field_name, $sizes_fields, true ) ) {
+ printf( '<tr><td>%s</td><td class="%s">%s</td></tr>', esc_html( $field['label'] ), esc_attr( $field_name ), $values );
+ } else {
+ printf( '<tr><td>%s</td><td>%s</td></tr>', esc_html( $field['label'] ), $values );
+ }
+ }
+
+ ?>
+ </tbody>
+ </table>
+ </div>
+ <?php } ?>
+ </div>
+</div>
+
+<?php
+include( ABSPATH . 'wp-admin/admin-footer.php' );
diff --git a/www/crm/wp-admin/site-health.php b/www/crm/wp-admin/site-health.php
new file mode 100644
index 00000000..5f19ebee
--- /dev/null
+++ b/www/crm/wp-admin/site-health.php
@@ -0,0 +1,157 @@
+<?php
+/**
+ * Tools Administration Screen.
+ *
+ * @package WordPress
+ * @subpackage Administration
+ */
+
+if ( isset( $_GET['tab'] ) && 'debug' === $_GET['tab'] ) {
+ require_once( dirname( __FILE__ ) . '/site-health-info.php' );
+ return;
+}
+
+/** WordPress Administration Bootstrap */
+require_once( dirname( __FILE__ ) . '/admin.php' );
+
+$title = __( 'Site Health Status' );
+
+if ( ! current_user_can( 'view_site_health_checks' ) ) {
+ wp_die( __( 'Sorry, you are not allowed to access site health information.' ), '', 403 );
+}
+
+wp_enqueue_style( 'site-health' );
+wp_enqueue_script( 'site-health' );
+
+if ( ! class_exists( 'WP_Site_Health' ) ) {
+ require_once( ABSPATH . 'wp-admin/includes/class-wp-site-health.php' );
+}
+
+$health_check_site_status = new WP_Site_Health();
+
+// Start by checking if this is a special request checking for the existence of certain filters.
+$health_check_site_status->check_wp_version_check_exists();
+
+require_once( ABSPATH . 'wp-admin/admin-header.php' );
+?>
+<div class="health-check-header">
+ <div class="health-check-title-section">
+ <h1>
+ <?php _e( 'Site Health' ); ?>
+ </h1>
+
+ <div class="site-health-progress hide-if-no-js loading">
+ <svg role="img" aria-hidden="true" focusable="false" width="100%" height="100%" viewBox="0 0 200 200" version="1.1" xmlns="http://www.w3.org/2000/svg">
+ <circle r="90" cx="100" cy="100" fill="transparent" stroke-dasharray="565.48" stroke-dashoffset="0"></circle>
+ <circle id="bar" r="90" cx="100" cy="100" fill="transparent" stroke-dasharray="565.48" stroke-dashoffset="0"></circle>
+ </svg>
+ <span class="screen-reader-text"><?php _e( 'Current health score:' ); ?></span>
+ <span class="site-health-progress-count"></span>
+ </div>
+ </div>
+
+ <nav class="health-check-tabs-wrapper hide-if-no-js" aria-label="<?php esc_attr_e( 'Secondary menu' ); ?>">
+ <a href="<?php echo esc_url( admin_url( 'site-health.php' ) ); ?>" class="health-check-tab active" aria-current="true">
+ <?php
+ /* translators: tab heading for Site Health Status page */
+ _ex( 'Status', 'Site Health' );
+ ?>
+ </a>
+
+ <a href="<?php echo esc_url( admin_url( 'site-health.php?tab=debug' ) ); ?>" class="health-check-tab">
+ <?php
+ /* translators: tab heading for Site Health Info page */
+ _ex( 'Info', 'Site Health' );
+ ?>
+ </a>
+ </nav>
+</div>
+
+<hr class="wp-header-end">
+
+<div class="notice notice-error hide-if-js">
+ <p><?php _e( 'The Site Health check requires JavaScript.' ); ?></p>
+</div>
+
+<div class="health-check-body hide-if-no-js">
+ <div class="site-status-all-clear hide">
+ <p class="icon">
+ <span class="dashicons dashicons-yes"></span>
+ </p>
+
+ <p class="encouragement">
+ <?php _e( 'Great job!' ); ?>
+ </p>
+
+ <p>
+ <?php _e( 'Everything is running smoothly here.' ); ?>
+ </p>
+ </div>
+
+ <div class="site-status-has-issues">
+ <h2>
+ <?php _e( 'Site Health Status' ); ?>
+ </h2>
+
+ <p><?php _e( 'The site health check shows critical information about your WordPress configuration and items that require your attention.' ); ?></p>
+
+ <div class="site-health-issues-wrapper" id="health-check-issues-critical">
+ <h3 class="site-health-issue-count-title">
+ <?php
+ /* translators: %s: number of critical issues found */
+ printf( _n( '%s Critical issue', '%s Critical issues', 0 ), '<span class="issue-count">0</span>' );
+ ?>
+ </h3>
+
+ <div id="health-check-site-status-critical" class="health-check-accordion issues"></div>
+ </div>
+
+ <div class="site-health-issues-wrapper" id="health-check-issues-recommended">
+ <h3 class="site-health-issue-count-title">
+ <?php
+ /* translators: %s: number of recommended improvements */
+ printf( _n( '%s Recommended improvement', '%s Recommended improvements', 0 ), '<span class="issue-count">0</span>' );
+ ?>
+ </h3>
+
+ <div id="health-check-site-status-recommended" class="health-check-accordion issues"></div>
+ </div>
+ </div>
+
+ <div class="site-health-view-more">
+ <button type="button" class="button site-health-view-passed" aria-expanded="false" aria-controls="health-check-issues-good">
+ <?php _e( 'Passed tests' ); ?>
+ <span class="icon"></span>
+ </button>
+ </div>
+
+ <div class="site-health-issues-wrapper hidden" id="health-check-issues-good">
+ <h3 class="site-health-issue-count-title">
+ <?php
+ /* translators: %s: number of items with no issues */
+ printf( _n( '%s Item with no issues detected', '%s Items with no issues detected', 0 ), '<span class="issue-count">0</span>' );
+ ?>
+ </h3>
+
+ <div id="health-check-site-status-good" class="health-check-accordion issues"></div>
+ </div>
+</div>
+
+<script id="tmpl-health-check-issue" type="text/template">
+ <h4 class="health-check-accordion-heading">
+ <button aria-expanded="false" class="health-check-accordion-trigger" aria-controls="health-check-accordion-block-{{ data.test }}" type="button">
+ <span class="title">{{ data.label }}</span>
+ <span class="badge {{ data.badge.color }}">{{ data.badge.label }}</span>
+ <span class="icon"></span>
+ </button>
+ </h4>
+ <div id="health-check-accordion-block-{{ data.test }}" class="health-check-accordion-panel" hidden="hidden">
+ {{{ data.description }}}
+ <div class="actions">
+ <p class="button-container">{{{ data.actions }}}</p>
+ </div>
+ </div>
+</script>
+
+<?php
+include( ABSPATH . 'wp-admin/admin-footer.php' );
diff --git a/www/crm/wp-admin/term.php b/www/crm/wp-admin/term.php
new file mode 100644
index 00000000..ec8b359d
--- /dev/null
+++ b/www/crm/wp-admin/term.php
@@ -0,0 +1,70 @@
+<?php
+/**
+ * Edit Term Administration Screen.
+ *
+ * @package WordPress
+ * @subpackage Administration
+ * @since 4.5.0
+ */
+
+/** WordPress Administration Bootstrap */
+require_once( dirname( __FILE__ ) . '/admin.php' );
+
+if ( empty( $_REQUEST['tag_ID'] ) ) {
+ $sendback = admin_url( 'edit-tags.php' );
+ if ( ! empty( $taxnow ) ) {
+ $sendback = add_query_arg( array( 'taxonomy' => $taxnow ), $sendback );
+ }
+ wp_redirect( esc_url( $sendback ) );
+ exit;
+}
+
+$tag_ID = absint( $_REQUEST['tag_ID'] );
+$tag = get_term( $tag_ID, $taxnow, OBJECT, 'edit' );
+
+if ( ! $tag instanceof WP_Term ) {
+ wp_die( __( 'You attempted to edit an item that doesn&#8217;t exist. Perhaps it was deleted?' ) );
+}
+
+$tax = get_taxonomy( $tag->taxonomy );
+$taxonomy = $tax->name;
+$title = $tax->labels->edit_item;
+
+if ( ! in_array( $taxonomy, get_taxonomies( array( 'show_ui' => true ) ) ) ||
+ ! current_user_can( 'edit_term', $tag->term_id ) ) {
+
+ wp_die(
+ '<h1>' . __( 'You need a higher level of permission.' ) . '</h1>' .
+ '<p>' . __( 'Sorry, you are not allowed to edit this item.' ) . '</p>',
+ 403
+ );
+}
+
+$post_type = get_current_screen()->post_type;
+
+// Default to the first object_type associated with the taxonomy if no post type was passed.
+if ( empty( $post_type ) ) {
+ $post_type = reset( $tax->object_type );
+}
+
+if ( 'post' != $post_type ) {
+ $parent_file = ( 'attachment' == $post_type ) ? 'upload.php' : "edit.php?post_type=$post_type";
+ $submenu_file = "edit-tags.php?taxonomy=$taxonomy&amp;post_type=$post_type";
+} elseif ( 'link_category' == $taxonomy ) {
+ $parent_file = 'link-manager.php';
+ $submenu_file = 'edit-tags.php?taxonomy=link_category';
+} else {
+ $parent_file = 'edit.php';
+ $submenu_file = "edit-tags.php?taxonomy=$taxonomy";
+}
+
+get_current_screen()->set_screen_reader_content(
+ array(
+ 'heading_pagination' => $tax->labels->items_list_navigation,
+ 'heading_list' => $tax->labels->items_list,
+ )
+);
+wp_enqueue_script( 'admin-tags' );
+require_once( ABSPATH . 'wp-admin/admin-header.php' );
+include( ABSPATH . 'wp-admin/edit-tag-form.php' );
+include( ABSPATH . 'wp-admin/admin-footer.php' );
diff --git a/www/crm/wp-admin/theme-editor.php b/www/crm/wp-admin/theme-editor.php
new file mode 100644
index 00000000..25769b2e
--- /dev/null
+++ b/www/crm/wp-admin/theme-editor.php
@@ -0,0 +1,365 @@
+<?php
+/**
+ * Theme editor administration panel.
+ *
+ * @package WordPress
+ * @subpackage Administration
+ */
+
+/** WordPress Administration Bootstrap */
+require_once( dirname( __FILE__ ) . '/admin.php' );
+
+if ( is_multisite() && ! is_network_admin() ) {
+ wp_redirect( network_admin_url( 'theme-editor.php' ) );
+ exit();
+}
+
+if ( ! current_user_can( 'edit_themes' ) ) {
+ wp_die( '<p>' . __( 'Sorry, you are not allowed to edit templates for this site.' ) . '</p>' );
+}
+
+$title = __( 'Edit Themes' );
+$parent_file = 'themes.php';
+
+get_current_screen()->add_help_tab(
+ array(
+ 'id' => 'overview',
+ 'title' => __( 'Overview' ),
+ 'content' =>
+ '<p>' . __( 'You can use the theme editor to edit the individual CSS and PHP files which make up your theme.' ) . '</p>' .
+ '<p>' . __( 'Begin by choosing a theme to edit from the dropdown menu and clicking the Select button. A list then appears of the theme&#8217;s template files. Clicking once on any file name causes the file to appear in the large Editor box.' ) . '</p>' .
+ '<p>' . __( 'For PHP files, you can use the Documentation dropdown to select from functions recognized in that file. Look Up takes you to a web page with reference material about that particular function.' ) . '</p>' .
+ '<p id="editor-keyboard-trap-help-1">' . __( 'When using a keyboard to navigate:' ) . '</p>' .
+ '<ul>' .
+ '<li id="editor-keyboard-trap-help-2">' . __( 'In the editing area, the Tab key enters a tab character.' ) . '</li>' .
+ '<li id="editor-keyboard-trap-help-3">' . __( 'To move away from this area, press the Esc key followed by the Tab key.' ) . '</li>' .
+ '<li id="editor-keyboard-trap-help-4">' . __( 'Screen reader users: when in forms mode, you may need to press the Esc key twice.' ) . '</li>' .
+ '</ul>' .
+ '<p>' . __( 'After typing in your edits, click Update File.' ) . '</p>' .
+ '<p>' . __( '<strong>Advice:</strong> Think very carefully about your site crashing if you are live-editing the theme currently in use.' ) . '</p>' .
+ '<p>' . sprintf(
+ /* translators: %s: link to documentation on child themes */
+ __( 'Upgrading to a newer version of the same theme will override changes made here. To avoid this, consider creating a <a href="%s">child theme</a> instead.' ),
+ __( 'https://developer.wordpress.org/themes/advanced-topics/child-themes/' )
+ ) . '</p>' .
+ ( is_network_admin() ? '<p>' . __( 'Any edits to files from this screen will be reflected on all sites in the network.' ) . '</p>' : '' ),
+ )
+);
+
+get_current_screen()->set_help_sidebar(
+ '<p><strong>' . __( 'For more information:' ) . '</strong></p>' .
+ '<p>' . __( '<a href="https://codex.wordpress.org/Theme_Development">Documentation on Theme Development</a>' ) . '</p>' .
+ '<p>' . __( '<a href="https://codex.wordpress.org/Using_Themes">Documentation on Using Themes</a>' ) . '</p>' .
+ '<p>' . __( '<a href="https://codex.wordpress.org/Editing_Files">Documentation on Editing Files</a>' ) . '</p>' .
+ '<p>' . __( '<a href="https://codex.wordpress.org/Template_Tags">Documentation on Template Tags</a>' ) . '</p>' .
+ '<p>' . __( '<a href="https://wordpress.org/support/">Support</a>' ) . '</p>'
+);
+
+wp_reset_vars( array( 'action', 'error', 'file', 'theme' ) );
+
+if ( $theme ) {
+ $stylesheet = $theme;
+} else {
+ $stylesheet = get_stylesheet();
+}
+
+$theme = wp_get_theme( $stylesheet );
+
+if ( ! $theme->exists() ) {
+ wp_die( __( 'The requested theme does not exist.' ) );
+}
+
+if ( $theme->errors() && 'theme_no_stylesheet' == $theme->errors()->get_error_code() ) {
+ wp_die( __( 'The requested theme does not exist.' ) . ' ' . $theme->errors()->get_error_message() );
+}
+
+$allowed_files = $style_files = array();
+$has_templates = false;
+
+$file_types = wp_get_theme_file_editable_extensions( $theme );
+
+foreach ( $file_types as $type ) {
+ switch ( $type ) {
+ case 'php':
+ $allowed_files += $theme->get_files( 'php', -1 );
+ $has_templates = ! empty( $allowed_files );
+ break;
+ case 'css':
+ $style_files = $theme->get_files( 'css', -1 );
+ $allowed_files['style.css'] = $style_files['style.css'];
+ $allowed_files += $style_files;
+ break;
+ default:
+ $allowed_files += $theme->get_files( $type, -1 );
+ break;
+ }
+}
+
+// Move functions.php and style.css to the top.
+if ( isset( $allowed_files['functions.php'] ) ) {
+ $allowed_files = array( 'functions.php' => $allowed_files['functions.php'] ) + $allowed_files;
+}
+if ( isset( $allowed_files['style.css'] ) ) {
+ $allowed_files = array( 'style.css' => $allowed_files['style.css'] ) + $allowed_files;
+}
+
+if ( empty( $file ) ) {
+ $relative_file = 'style.css';
+ $file = $allowed_files['style.css'];
+} else {
+ $relative_file = wp_unslash( $file );
+ $file = $theme->get_stylesheet_directory() . '/' . $relative_file;
+}
+
+validate_file_to_edit( $file, $allowed_files );
+
+// Handle fallback editing of file when JavaScript is not available.
+$edit_error = null;
+$posted_content = null;
+if ( 'POST' === $_SERVER['REQUEST_METHOD'] ) {
+ $r = wp_edit_theme_plugin_file( wp_unslash( $_POST ) );
+ if ( is_wp_error( $r ) ) {
+ $edit_error = $r;
+ if ( check_ajax_referer( 'edit-theme_' . $stylesheet . '_' . $relative_file, 'nonce', false ) && isset( $_POST['newcontent'] ) ) {
+ $posted_content = wp_unslash( $_POST['newcontent'] );
+ }
+ } else {
+ wp_redirect(
+ add_query_arg(
+ array(
+ 'a' => 1, // This means "success" for some reason.
+ 'theme' => $stylesheet,
+ 'file' => $relative_file,
+ ),
+ admin_url( 'theme-editor.php' )
+ )
+ );
+ exit;
+ }
+}
+
+ $settings = array(
+ 'codeEditor' => wp_enqueue_code_editor( compact( 'file' ) ),
+ );
+ wp_enqueue_script( 'wp-theme-plugin-editor' );
+ wp_add_inline_script( 'wp-theme-plugin-editor', sprintf( 'jQuery( function( $ ) { wp.themePluginEditor.init( $( "#template" ), %s ); } )', wp_json_encode( $settings ) ) );
+ wp_add_inline_script( 'wp-theme-plugin-editor', 'wp.themePluginEditor.themeOrPlugin = "theme";' );
+
+ require_once( ABSPATH . 'wp-admin/admin-header.php' );
+
+ update_recently_edited( $file );
+
+ if ( ! is_file( $file ) ) {
+ $error = true;
+ }
+
+ $content = '';
+ if ( ! empty( $posted_content ) ) {
+ $content = $posted_content;
+ } elseif ( ! $error && filesize( $file ) > 0 ) {
+ $f = fopen( $file, 'r' );
+ $content = fread( $f, filesize( $file ) );
+
+ if ( '.php' == substr( $file, strrpos( $file, '.' ) ) ) {
+ $functions = wp_doc_link_parse( $content );
+
+ $docs_select = '<select name="docs-list" id="docs-list">';
+ $docs_select .= '<option value="">' . esc_attr__( 'Function Name&hellip;' ) . '</option>';
+ foreach ( $functions as $function ) {
+ $docs_select .= '<option value="' . esc_attr( urlencode( $function ) ) . '">' . htmlspecialchars( $function ) . '()</option>';
+ }
+ $docs_select .= '</select>';
+ }
+
+ $content = esc_textarea( $content );
+ }
+
+ $file_description = get_file_description( $relative_file );
+ $file_show = array_search( $file, array_filter( $allowed_files ) );
+ $description = esc_html( $file_description );
+ if ( $file_description != $file_show ) {
+ $description .= ' <span>(' . esc_html( $file_show ) . ')</span>';
+ }
+ ?>
+<div class="wrap">
+<h1><?php echo esc_html( $title ); ?></h1>
+
+<?php if ( isset( $_GET['a'] ) ) : ?>
+ <div id="message" class="updated notice is-dismissible">
+ <p><?php _e( 'File edited successfully.' ); ?></p>
+ </div>
+<?php elseif ( is_wp_error( $edit_error ) ) : ?>
+ <div id="message" class="notice notice-error">
+ <p><?php _e( 'There was an error while trying to update the file. You may need to fix something and try updating again.' ); ?></p>
+ <pre><?php echo esc_html( $edit_error->get_error_message() ? $edit_error->get_error_message() : $edit_error->get_error_code() ); ?></pre>
+ </div>
+<?php endif; ?>
+<?php if ( preg_match( '/\.css$/', $file ) ) : ?>
+ <div id="message" class="notice-info notice">
+ <p><strong><?php _e( 'Did you know?' ); ?></strong></p>
+ <p>
+ <?php
+ echo sprintf(
+ /* translators: %s: link to Custom CSS section in the Customizer */
+ __( 'There&#8217;s no need to change your CSS here &mdash; you can edit and live preview CSS changes in the <a href="%s">built-in CSS editor</a>.' ),
+ esc_url( add_query_arg( 'autofocus[section]', 'custom_css', admin_url( 'customize.php' ) ) )
+ );
+ ?>
+ </p>
+ </div>
+<?php endif; ?>
+
+<div class="fileedit-sub">
+<div class="alignleft">
+<h2>
+<?php
+echo $theme->display( 'Name' );
+if ( $description ) {
+ echo ': ' . $description;}
+?>
+</h2>
+</div>
+<div class="alignright">
+ <form action="theme-editor.php" method="get">
+ <strong><label for="theme"><?php _e( 'Select theme to edit:' ); ?> </label></strong>
+ <select name="theme" id="theme">
+<?php
+foreach ( wp_get_themes( array( 'errors' => null ) ) as $a_stylesheet => $a_theme ) {
+ if ( $a_theme->errors() && 'theme_no_stylesheet' == $a_theme->errors()->get_error_code() ) {
+ continue;
+ }
+
+ $selected = $a_stylesheet == $stylesheet ? ' selected="selected"' : '';
+ echo "\n\t" . '<option value="' . esc_attr( $a_stylesheet ) . '"' . $selected . '>' . $a_theme->display( 'Name' ) . '</option>';
+}
+?>
+ </select>
+ <?php submit_button( __( 'Select' ), '', 'Submit', false ); ?>
+ </form>
+</div>
+<br class="clear" />
+</div>
+<?php
+if ( $theme->errors() ) {
+ echo '<div class="error"><p><strong>' . __( 'This theme is broken.' ) . '</strong> ' . $theme->errors()->get_error_message() . '</p></div>';
+}
+?>
+<div id="templateside">
+ <h2 id="theme-files-label"><?php _e( 'Theme Files' ); ?></h2>
+ <ul role="tree" aria-labelledby="theme-files-label">
+ <?php if ( ( $has_templates || $theme->parent() ) && $theme->parent() ) : ?>
+ <li class="howto">
+ <?php
+ /* translators: %s: link to edit parent theme */
+ echo sprintf(
+ __( 'This child theme inherits templates from a parent theme, %s.' ),
+ sprintf(
+ '<a href="%s">%s</a>',
+ self_admin_url( 'theme-editor.php?theme=' . urlencode( $theme->get_template() ) ),
+ $theme->parent()->display( 'Name' )
+ )
+ );
+ ?>
+ </li>
+ <?php endif; ?>
+ <li role="treeitem" tabindex="-1" aria-expanded="true" aria-level="1" aria-posinset="1" aria-setsize="1">
+ <ul role="group">
+ <?php wp_print_theme_file_tree( wp_make_theme_file_tree( $allowed_files ) ); ?>
+ </ul>
+ </li>
+ </ul>
+</div>
+
+<?php
+if ( $error ) :
+ echo '<div class="error"><p>' . __( 'Oops, no such file exists! Double check the name and try again, merci.' ) . '</p></div>';
+else :
+ ?>
+ <form name="template" id="template" action="theme-editor.php" method="post">
+ <?php wp_nonce_field( 'edit-theme_' . $stylesheet . '_' . $relative_file, 'nonce' ); ?>
+ <div>
+ <label for="newcontent" id="theme-plugin-editor-label"><?php _e( 'Selected file content:' ); ?></label>
+ <textarea cols="70" rows="30" name="newcontent" id="newcontent" aria-describedby="editor-keyboard-trap-help-1 editor-keyboard-trap-help-2 editor-keyboard-trap-help-3 editor-keyboard-trap-help-4"><?php echo $content; ?></textarea>
+ <input type="hidden" name="action" value="update" />
+ <input type="hidden" name="file" value="<?php echo esc_attr( $relative_file ); ?>" />
+ <input type="hidden" name="theme" value="<?php echo esc_attr( $theme->get_stylesheet() ); ?>" />
+ </div>
+ <?php if ( ! empty( $functions ) ) : ?>
+ <div id="documentation" class="hide-if-no-js">
+ <label for="docs-list"><?php _e( 'Documentation:' ); ?></label>
+ <?php echo $docs_select; ?>
+ <input disabled id="docs-lookup" type="button" class="button" value="<?php esc_attr_e( 'Look Up' ); ?>" onclick="if ( '' != jQuery('#docs-list').val() ) { window.open( 'https://api.wordpress.org/core/handbook/1.0/?function=' + escape( jQuery( '#docs-list' ).val() ) + '&amp;locale=<?php echo urlencode( get_user_locale() ); ?>&amp;version=<?php echo urlencode( get_bloginfo( 'version' ) ); ?>&amp;redirect=true'); }" />
+ </div>
+ <?php endif; ?>
+
+ <div>
+ <div class="editor-notices">
+ <?php if ( is_child_theme() && $theme->get_stylesheet() == get_template() ) : ?>
+ <div class="notice notice-warning inline">
+ <p>
+ <?php
+ if ( is_writeable( $file ) ) {
+ ?>
+ <strong><?php _e( 'Caution:' ); ?></strong><?php } ?>
+ <?php _e( 'This is a file in your current parent theme.' ); ?>
+ </p>
+ </div>
+ <?php endif; ?>
+ </div>
+ <?php if ( is_writeable( $file ) ) : ?>
+ <p class="submit">
+ <?php submit_button( __( 'Update File' ), 'primary', 'submit', false ); ?>
+ <span class="spinner"></span>
+ </p>
+ <?php else : ?>
+ <p><em><?php _e( 'You need to make this file writable before you can save your changes. See <a href="https://codex.wordpress.org/Changing_File_Permissions">the Codex</a> for more information.' ); ?></em></p>
+ <?php endif; ?>
+ </div>
+ <?php wp_print_file_editor_templates(); ?>
+ </form>
+ <?php
+endif; // $error
+?>
+<br class="clear" />
+</div>
+<?php
+$dismissed_pointers = explode( ',', (string) get_user_meta( get_current_user_id(), 'dismissed_wp_pointers', true ) );
+if ( ! in_array( 'theme_editor_notice', $dismissed_pointers, true ) ) :
+ // Get a back URL
+ $referer = wp_get_referer();
+ $excluded_referer_basenames = array( 'theme-editor.php', 'wp-login.php' );
+
+ if ( $referer && ! in_array( basename( parse_url( $referer, PHP_URL_PATH ) ), $excluded_referer_basenames, true ) ) {
+ $return_url = $referer;
+ } else {
+ $return_url = admin_url( '/' );
+ }
+ ?>
+<div id="file-editor-warning" class="notification-dialog-wrap file-editor-warning hide-if-no-js hidden">
+ <div class="notification-dialog-background"></div>
+ <div class="notification-dialog">
+ <div class="file-editor-warning-content">
+ <div class="file-editor-warning-message">
+ <h1><?php _e( 'Heads up!' ); ?></h1>
+ <p>
+ <?php
+ echo sprintf(
+ /* translators: %s: link to documentation on child themes */
+ __( 'You appear to be making direct edits to your theme in the WordPress dashboard. We recommend that you don&#8217;t! Editing your theme directly could break your site and your changes may be lost in future updates. If you need to tweak more than your theme&#8217;s CSS, you might want to try <a href="%s">making a child theme</a>.' ),
+ esc_url( __( 'https://developer.wordpress.org/themes/advanced-topics/child-themes/' ) )
+ );
+ ?>
+ </p>
+ <p><?php _e( 'If you decide to go ahead with direct edits anyway, use a file manager to create a copy with a new name and hang on to the original. That way, you can re-enable a functional version if something goes wrong.' ); ?></p>
+ </div>
+ <p>
+ <a class="button file-editor-warning-go-back" href="<?php echo esc_url( $return_url ); ?>"><?php _e( 'Go back' ); ?></a>
+ <button type="button" class="file-editor-warning-dismiss button button-primary"><?php _e( 'I understand' ); ?></button>
+ </p>
+ </div>
+ </div>
+</div>
+ <?php
+endif; // editor warning notice
+
+include( ABSPATH . 'wp-admin/admin-footer.php' );
diff --git a/www/crm/wp-admin/theme-install.php b/www/crm/wp-admin/theme-install.php
new file mode 100644
index 00000000..81842979
--- /dev/null
+++ b/www/crm/wp-admin/theme-install.php
@@ -0,0 +1,374 @@
+<?php
+/**
+ * Install theme administration panel.
+ *
+ * @package WordPress
+ * @subpackage Administration
+ */
+
+/** WordPress Administration Bootstrap */
+require_once( dirname( __FILE__ ) . '/admin.php' );
+require( ABSPATH . 'wp-admin/includes/theme-install.php' );
+
+wp_reset_vars( array( 'tab' ) );
+
+if ( ! current_user_can( 'install_themes' ) ) {
+ wp_die( __( 'Sorry, you are not allowed to install themes on this site.' ) );
+}
+
+if ( is_multisite() && ! is_network_admin() ) {
+ wp_redirect( network_admin_url( 'theme-install.php' ) );
+ exit();
+}
+
+$title = __( 'Add Themes' );
+$parent_file = 'themes.php';
+
+if ( ! is_network_admin() ) {
+ $submenu_file = 'themes.php';
+}
+
+$installed_themes = search_theme_directories();
+
+if ( false === $installed_themes ) {
+ $installed_themes = array();
+}
+
+foreach ( $installed_themes as $k => $v ) {
+ if ( false !== strpos( $k, '/' ) ) {
+ unset( $installed_themes[ $k ] );
+ }
+}
+
+wp_localize_script(
+ 'theme',
+ '_wpThemeSettings',
+ array(
+ 'themes' => false,
+ 'settings' => array(
+ 'isInstall' => true,
+ 'canInstall' => current_user_can( 'install_themes' ),
+ 'installURI' => current_user_can( 'install_themes' ) ? self_admin_url( 'theme-install.php' ) : null,
+ 'adminUrl' => parse_url( self_admin_url(), PHP_URL_PATH ),
+ ),
+ 'l10n' => array(
+ 'addNew' => __( 'Add New Theme' ),
+ 'search' => __( 'Search Themes' ),
+ 'searchPlaceholder' => __( 'Search themes...' ), // placeholder (no ellipsis)
+ 'upload' => __( 'Upload Theme' ),
+ 'back' => __( 'Back' ),
+ 'error' => sprintf(
+ /* translators: %s: support forums URL */
+ __( 'An unexpected error occurred. Something may be wrong with WordPress.org or this server&#8217;s configuration. If you continue to have problems, please try the <a href="%s">support forums</a>.' ),
+ __( 'https://wordpress.org/support/' )
+ ),
+ 'tryAgain' => __( 'Try Again' ),
+ 'themesFound' => __( 'Number of Themes found: %d' ),
+ 'noThemesFound' => __( 'No themes found. Try a different search.' ),
+ 'collapseSidebar' => __( 'Collapse Sidebar' ),
+ 'expandSidebar' => __( 'Expand Sidebar' ),
+ /* translators: accessibility text */
+ 'selectFeatureFilter' => __( 'Select one or more Theme features to filter by' ),
+ ),
+ 'installedThemes' => array_keys( $installed_themes ),
+ )
+);
+
+wp_enqueue_script( 'theme' );
+wp_enqueue_script( 'updates' );
+
+if ( $tab ) {
+ /**
+ * Fires before each of the tabs are rendered on the Install Themes page.
+ *
+ * The dynamic portion of the hook name, `$tab`, refers to the current
+ * theme installation tab. Possible values are 'dashboard', 'search', 'upload',
+ * 'featured', 'new', or 'updated'.
+ *
+ * @since 2.8.0
+ */
+ do_action( "install_themes_pre_{$tab}" );
+}
+
+$help_overview =
+ '<p>' . sprintf(
+ /* translators: %s: Theme Directory URL */
+ __( 'You can find additional themes for your site by using the Theme Browser/Installer on this screen, which will display themes from the <a href="%s">WordPress Theme Directory</a>. These themes are designed and developed by third parties, are available free of charge, and are compatible with the license WordPress uses.' ),
+ __( 'https://wordpress.org/themes/' )
+ ) . '</p>' .
+ '<p>' . __( 'You can Search for themes by keyword, author, or tag, or can get more specific and search by criteria listed in the feature filter.' ) . ' <span id="live-search-desc">' . __( 'The search results will be updated as you type.' ) . '</span></p>' .
+ '<p>' . __( 'Alternately, you can browse the themes that are Featured, Popular, or Latest. When you find a theme you like, you can preview it or install it.' ) . '</p>' .
+ '<p>' . sprintf(
+ /* translators: %s: /wp-content/themes */
+ __( 'You can Upload a theme manually if you have already downloaded its ZIP archive onto your computer (make sure it is from a trusted and original source). You can also do it the old-fashioned way and copy a downloaded theme&#8217;s folder via FTP into your %s directory.' ),
+ '<code>/wp-content/themes</code>'
+ ) . '</p>';
+
+get_current_screen()->add_help_tab(
+ array(
+ 'id' => 'overview',
+ 'title' => __( 'Overview' ),
+ 'content' => $help_overview,
+ )
+);
+
+$help_installing =
+ '<p>' . __( 'Once you have generated a list of themes, you can preview and install any of them. Click on the thumbnail of the theme you&#8217;re interested in previewing. It will open up in a full-screen Preview page to give you a better idea of how that theme will look.' ) . '</p>' .
+ '<p>' . __( 'To install the theme so you can preview it with your site&#8217;s content and customize its theme options, click the "Install" button at the top of the left-hand pane. The theme files will be downloaded to your website automatically. When this is complete, the theme is now available for activation, which you can do by clicking the "Activate" link, or by navigating to your Manage Themes screen and clicking the "Live Preview" link under any installed theme&#8217;s thumbnail image.' ) . '</p>';
+
+get_current_screen()->add_help_tab(
+ array(
+ 'id' => 'installing',
+ 'title' => __( 'Previewing and Installing' ),
+ 'content' => $help_installing,
+ )
+);
+
+get_current_screen()->set_help_sidebar(
+ '<p><strong>' . __( 'For more information:' ) . '</strong></p>' .
+ '<p>' . __( '<a href="https://codex.wordpress.org/Using_Themes#Adding_New_Themes">Documentation on Adding New Themes</a>' ) . '</p>' .
+ '<p>' . __( '<a href="https://wordpress.org/support/">Support</a>' ) . '</p>'
+);
+
+include( ABSPATH . 'wp-admin/admin-header.php' );
+
+?>
+<div class="wrap">
+ <h1 class="wp-heading-inline"><?php echo esc_html( $title ); ?></h1>
+
+ <?php
+
+ /**
+ * Filters the tabs shown on the Add Themes screen.
+ *
+ * This filter is for backward compatibility only, for the suppression of the upload tab.
+ *
+ * @since 2.8.0
+ *
+ * @param string[] $tabs Associative array of the tabs shown on the Add Themes screen. Default is 'upload'.
+ */
+ $tabs = apply_filters( 'install_themes_tabs', array( 'upload' => __( 'Upload Theme' ) ) );
+ if ( ! empty( $tabs['upload'] ) && current_user_can( 'upload_themes' ) ) {
+ echo ' <button type="button" class="upload-view-toggle page-title-action hide-if-no-js" aria-expanded="false">' . __( 'Upload Theme' ) . '</button>';
+ }
+ ?>
+
+ <hr class="wp-header-end">
+
+ <div class="error hide-if-js">
+ <p><?php _e( 'The Theme Installer screen requires JavaScript.' ); ?></p>
+ </div>
+
+ <div class="upload-theme">
+ <?php install_themes_upload(); ?>
+ </div>
+
+ <h2 class="screen-reader-text hide-if-no-js"><?php _e( 'Filter themes list' ); ?></h2>
+
+ <div class="wp-filter hide-if-no-js">
+ <div class="filter-count">
+ <span class="count theme-count"></span>
+ </div>
+
+ <ul class="filter-links">
+ <li><a href="#" data-sort="featured"><?php _ex( 'Featured', 'themes' ); ?></a></li>
+ <li><a href="#" data-sort="popular"><?php _ex( 'Popular', 'themes' ); ?></a></li>
+ <li><a href="#" data-sort="new"><?php _ex( 'Latest', 'themes' ); ?></a></li>
+ <li><a href="#" data-sort="favorites"><?php _ex( 'Favorites', 'themes' ); ?></a></li>
+ </ul>
+
+ <button type="button" class="button drawer-toggle" aria-expanded="false"><?php _e( 'Feature Filter' ); ?></button>
+
+ <form class="search-form"></form>
+
+ <div class="favorites-form">
+ <?php
+ $action = 'save_wporg_username_' . get_current_user_id();
+ if ( isset( $_GET['_wpnonce'] ) && wp_verify_nonce( wp_unslash( $_GET['_wpnonce'] ), $action ) ) {
+ $user = isset( $_GET['user'] ) ? wp_unslash( $_GET['user'] ) : get_user_option( 'wporg_favorites' );
+ update_user_meta( get_current_user_id(), 'wporg_favorites', $user );
+ } else {
+ $user = get_user_option( 'wporg_favorites' );
+ }
+ ?>
+ <p class="install-help"><?php _e( 'If you have marked themes as favorites on WordPress.org, you can browse them here.' ); ?></p>
+
+ <p>
+ <label for="wporg-username-input"><?php _e( 'Your WordPress.org username:' ); ?></label>
+ <input type="hidden" id="wporg-username-nonce" name="_wpnonce" value="<?php echo esc_attr( wp_create_nonce( $action ) ); ?>" />
+ <input type="search" id="wporg-username-input" value="<?php echo esc_attr( $user ); ?>" />
+ <input type="button" class="button favorites-form-submit" value="<?php esc_attr_e( 'Get Favorites' ); ?>" />
+ </p>
+ </div>
+
+ <div class="filter-drawer">
+ <div class="buttons">
+ <button type="button" class="apply-filters button"><?php _e( 'Apply Filters' ); ?><span></span></button>
+ <button type="button" class="clear-filters button" aria-label="<?php esc_attr_e( 'Clear current filters' ); ?>"><?php _e( 'Clear' ); ?></button>
+ </div>
+ <?php
+ $feature_list = get_theme_feature_list( false ); // Use the core list, rather than the .org API, due to inconsistencies and to ensure tags are translated.
+ foreach ( $feature_list as $feature_name => $features ) {
+ echo '<fieldset class="filter-group">';
+ $feature_name = esc_html( $feature_name );
+ echo '<legend>' . $feature_name . '</legend>';
+ echo '<div class="filter-group-feature">';
+ foreach ( $features as $feature => $feature_name ) {
+ $feature = esc_attr( $feature );
+ echo '<input type="checkbox" id="filter-id-' . $feature . '" value="' . $feature . '" /> ';
+ echo '<label for="filter-id-' . $feature . '">' . $feature_name . '</label>';
+ }
+ echo '</div>';
+ echo '</fieldset>';
+ }
+ ?>
+ <div class="buttons">
+ <button type="button" class="apply-filters button"><?php _e( 'Apply Filters' ); ?><span></span></button>
+ <button type="button" class="clear-filters button" aria-label="<?php esc_attr_e( 'Clear current filters' ); ?>"><?php _e( 'Clear' ); ?></button>
+ </div>
+ <div class="filtered-by">
+ <span><?php _e( 'Filtering by:' ); ?></span>
+ <div class="tags"></div>
+ <button type="button" class="button-link edit-filters"><?php _e( 'Edit Filters' ); ?></button>
+ </div>
+ </div>
+ </div>
+ <h2 class="screen-reader-text hide-if-no-js"><?php _e( 'Themes list' ); ?></h2>
+ <div class="theme-browser content-filterable"></div>
+ <div class="theme-install-overlay wp-full-overlay expanded"></div>
+
+ <p class="no-themes"><?php _e( 'No themes found. Try a different search.' ); ?></p>
+ <span class="spinner"></span>
+
+<?php
+if ( $tab ) {
+ /**
+ * Fires at the top of each of the tabs on the Install Themes page.
+ *
+ * The dynamic portion of the hook name, `$tab`, refers to the current
+ * theme installation tab. Possible values are 'dashboard', 'search', 'upload',
+ * 'featured', 'new', or 'updated'.
+ *
+ * @since 2.8.0
+ *
+ * @param int $paged Number of the current page of results being viewed.
+ */
+ do_action( "install_themes_{$tab}", $paged );
+}
+?>
+</div>
+
+<script id="tmpl-theme" type="text/template">
+ <# if ( data.screenshot_url ) { #>
+ <div class="theme-screenshot">
+ <img src="{{ data.screenshot_url }}" alt="" />
+ </div>
+ <# } else { #>
+ <div class="theme-screenshot blank"></div>
+ <# } #>
+ <span class="more-details"><?php _ex( 'Details &amp; Preview', 'theme' ); ?></span>
+ <div class="theme-author">
+ <?php
+ /* translators: %s: Theme author name */
+ printf( __( 'By %s' ), '{{ data.author }}' );
+ ?>
+ </div>
+
+ <div class="theme-id-container">
+ <h3 class="theme-name">{{ data.name }}</h3>
+
+ <div class="theme-actions">
+ <# if ( data.installed ) { #>
+ <?php
+ /* translators: %s: Theme name */
+ $aria_label = sprintf( _x( 'Activate %s', 'theme' ), '{{ data.name }}' );
+ ?>
+ <# if ( data.activate_url ) { #>
+ <a class="button button-primary activate" href="{{ data.activate_url }}" aria-label="<?php echo esc_attr( $aria_label ); ?>"><?php _e( 'Activate' ); ?></a>
+ <# } #>
+ <# if ( data.customize_url ) { #>
+ <a class="button load-customize" href="{{ data.customize_url }}"><?php _e( 'Live Preview' ); ?></a>
+ <# } else { #>
+ <button class="button preview install-theme-preview"><?php _e( 'Preview' ); ?></button>
+ <# } #>
+ <# } else { #>
+ <?php
+ /* translators: %s: Theme name */
+ $aria_label = sprintf( __( 'Install %s' ), '{{ data.name }}' );
+ ?>
+ <a class="button button-primary theme-install" data-name="{{ data.name }}" data-slug="{{ data.id }}" href="{{ data.install_url }}" aria-label="<?php echo esc_attr( $aria_label ); ?>"><?php _e( 'Install' ); ?></a>
+ <button class="button preview install-theme-preview"><?php _e( 'Preview' ); ?></button>
+ <# } #>
+ </div>
+ </div>
+
+ <# if ( data.installed ) { #>
+ <div class="notice notice-success notice-alt"><p><?php _ex( 'Installed', 'theme' ); ?></p></div>
+ <# } #>
+</script>
+
+<script id="tmpl-theme-preview" type="text/template">
+ <div class="wp-full-overlay-sidebar">
+ <div class="wp-full-overlay-header">
+ <button class="close-full-overlay"><span class="screen-reader-text"><?php _e( 'Close' ); ?></span></button>
+ <button class="previous-theme"><span class="screen-reader-text"><?php _e( 'Previous theme' ); ?></span></button>
+ <button class="next-theme"><span class="screen-reader-text"><?php _e( 'Next theme' ); ?></span></button>
+ <# if ( data.installed ) { #>
+ <a class="button button-primary activate" href="{{ data.activate_url }}"><?php _e( 'Activate' ); ?></a>
+ <# } else { #>
+ <a href="{{ data.install_url }}" class="button button-primary theme-install" data-name="{{ data.name }}" data-slug="{{ data.id }}"><?php _e( 'Install' ); ?></a>
+ <# } #>
+ </div>
+ <div class="wp-full-overlay-sidebar-content">
+ <div class="install-theme-info">
+ <h3 class="theme-name">{{ data.name }}</h3>
+ <span class="theme-by">
+ <?php
+ /* translators: %s: Theme author name */
+ printf( __( 'By %s' ), '{{ data.author }}' );
+ ?>
+ </span>
+
+ <img class="theme-screenshot" src="{{ data.screenshot_url }}" alt="" />
+
+ <div class="theme-details">
+ <# if ( data.rating ) { #>
+ <div class="theme-rating">
+ {{{ data.stars }}}
+ <a class="num-ratings" href="{{ data.reviews_url }}">
+ <?php
+ /* translators: %s: number of ratings */
+ echo sprintf( __( '(%s ratings)' ), '{{ data.num_ratings }}' );
+ ?>
+ </a>
+ </div>
+ <# } else { #>
+ <span class="no-rating"><?php _e( 'This theme has not been rated yet.' ); ?></span>
+ <# } #>
+ <div class="theme-version">
+ <?php
+ /* translators: %s: Theme version */
+ printf( __( 'Version: %s' ), '{{ data.version }}' );
+ ?>
+ </div>
+ <div class="theme-description">{{{ data.description }}}</div>
+ </div>
+ </div>
+ </div>
+ <div class="wp-full-overlay-footer">
+ <button type="button" class="collapse-sidebar button" aria-expanded="true" aria-label="<?php esc_attr_e( 'Collapse Sidebar' ); ?>">
+ <span class="collapse-sidebar-arrow"></span>
+ <span class="collapse-sidebar-label"><?php _e( 'Collapse' ); ?></span>
+ </button>
+ </div>
+ </div>
+ <div class="wp-full-overlay-main">
+ <iframe src="{{ data.preview_url }}" title="<?php esc_attr_e( 'Preview' ); ?>"></iframe>
+ </div>
+</script>
+
+<?php
+wp_print_request_filesystem_credentials_modal();
+wp_print_admin_notice_templates();
+
+include( ABSPATH . 'wp-admin/admin-footer.php' );
diff --git a/www/crm/wp-admin/themes.php b/www/crm/wp-admin/themes.php
new file mode 100644
index 00000000..9561cfe6
--- /dev/null
+++ b/www/crm/wp-admin/themes.php
@@ -0,0 +1,604 @@
+<?php
+/**
+ * Themes administration panel.
+ *
+ * @package WordPress
+ * @subpackage Administration
+ */
+
+/** WordPress Administration Bootstrap */
+require_once( dirname( __FILE__ ) . '/admin.php' );
+
+if ( ! current_user_can( 'switch_themes' ) && ! current_user_can( 'edit_theme_options' ) ) {
+ wp_die(
+ '<h1>' . __( 'You need a higher level of permission.' ) . '</h1>' .
+ '<p>' . __( 'Sorry, you are not allowed to edit theme options on this site.' ) . '</p>',
+ 403
+ );
+}
+
+if ( current_user_can( 'switch_themes' ) && isset( $_GET['action'] ) ) {
+ if ( 'activate' == $_GET['action'] ) {
+ check_admin_referer( 'switch-theme_' . $_GET['stylesheet'] );
+ $theme = wp_get_theme( $_GET['stylesheet'] );
+
+ if ( ! $theme->exists() || ! $theme->is_allowed() ) {
+ wp_die(
+ '<h1>' . __( 'Something went wrong.' ) . '</h1>' .
+ '<p>' . __( 'The requested theme does not exist.' ) . '</p>',
+ 403
+ );
+ }
+
+ switch_theme( $theme->get_stylesheet() );
+ wp_redirect( admin_url( 'themes.php?activated=true' ) );
+ exit;
+ } elseif ( 'resume' === $_GET['action'] ) {
+ check_admin_referer( 'resume-theme_' . $_GET['stylesheet'] );
+ $theme = wp_get_theme( $_GET['stylesheet'] );
+
+ if ( ! current_user_can( 'resume_theme', $_GET['stylesheet'] ) ) {
+ wp_die(
+ '<h1>' . __( 'You need a higher level of permission.' ) . '</h1>' .
+ '<p>' . __( 'Sorry, you are not allowed to resume this theme.' ) . '</p>',
+ 403
+ );
+ }
+
+ $result = resume_theme( $theme->get_stylesheet(), self_admin_url( 'themes.php?error=resuming' ) );
+
+ if ( is_wp_error( $result ) ) {
+ wp_die( $result );
+ }
+
+ wp_redirect( admin_url( 'themes.php?resumed=true' ) );
+ exit;
+ } elseif ( 'delete' == $_GET['action'] ) {
+ check_admin_referer( 'delete-theme_' . $_GET['stylesheet'] );
+ $theme = wp_get_theme( $_GET['stylesheet'] );
+
+ if ( ! current_user_can( 'delete_themes' ) ) {
+ wp_die(
+ '<h1>' . __( 'You need a higher level of permission.' ) . '</h1>' .
+ '<p>' . __( 'Sorry, you are not allowed to delete this item.' ) . '</p>',
+ 403
+ );
+ }
+
+ if ( ! $theme->exists() ) {
+ wp_die(
+ '<h1>' . __( 'Something went wrong.' ) . '</h1>' .
+ '<p>' . __( 'The requested theme does not exist.' ) . '</p>',
+ 403
+ );
+ }
+
+ $active = wp_get_theme();
+ if ( $active->get( 'Template' ) == $_GET['stylesheet'] ) {
+ wp_redirect( admin_url( 'themes.php?delete-active-child=true' ) );
+ } else {
+ delete_theme( $_GET['stylesheet'] );
+ wp_redirect( admin_url( 'themes.php?deleted=true' ) );
+ }
+ exit;
+ }
+}
+
+$title = __( 'Manage Themes' );
+$parent_file = 'themes.php';
+
+// Help tab: Overview
+if ( current_user_can( 'switch_themes' ) ) {
+ $help_overview = '<p>' . __( 'This screen is used for managing your installed themes. Aside from the default theme(s) included with your WordPress installation, themes are designed and developed by third parties.' ) . '</p>' .
+ '<p>' . __( 'From this screen you can:' ) . '</p>' .
+ '<ul><li>' . __( 'Hover or tap to see Activate and Live Preview buttons' ) . '</li>' .
+ '<li>' . __( 'Click on the theme to see the theme name, version, author, description, tags, and the Delete link' ) . '</li>' .
+ '<li>' . __( 'Click Customize for the current theme or Live Preview for any other theme to see a live preview' ) . '</li></ul>' .
+ '<p>' . __( 'The current theme is displayed highlighted as the first theme.' ) . '</p>' .
+ '<p>' . __( 'The search for installed themes will search for terms in their name, description, author, or tag.' ) . ' <span id="live-search-desc">' . __( 'The search results will be updated as you type.' ) . '</span></p>';
+
+ get_current_screen()->add_help_tab(
+ array(
+ 'id' => 'overview',
+ 'title' => __( 'Overview' ),
+ 'content' => $help_overview,
+ )
+ );
+} // switch_themes
+
+// Help tab: Adding Themes
+if ( current_user_can( 'install_themes' ) ) {
+ if ( is_multisite() ) {
+ $help_install = '<p>' . __( 'Installing themes on Multisite can only be done from the Network Admin section.' ) . '</p>';
+ } else {
+ $help_install = '<p>' . sprintf( __( 'If you would like to see more themes to choose from, click on the &#8220;Add New&#8221; button and you will be able to browse or search for additional themes from the <a href="%s">WordPress Theme Directory</a>. Themes in the WordPress Theme Directory are designed and developed by third parties, and are compatible with the license WordPress uses. Oh, and they&#8217;re free!' ), __( 'https://wordpress.org/themes/' ) ) . '</p>';
+ }
+
+ get_current_screen()->add_help_tab(
+ array(
+ 'id' => 'adding-themes',
+ 'title' => __( 'Adding Themes' ),
+ 'content' => $help_install,
+ )
+ );
+} // install_themes
+
+// Help tab: Previewing and Customizing
+if ( current_user_can( 'edit_theme_options' ) && current_user_can( 'customize' ) ) {
+ $help_customize =
+ '<p>' . __( 'Tap or hover on any theme then click the Live Preview button to see a live preview of that theme and change theme options in a separate, full-screen view. You can also find a Live Preview button at the bottom of the theme details screen. Any installed theme can be previewed and customized in this way.' ) . '</p>' .
+ '<p>' . __( 'The theme being previewed is fully interactive &mdash; navigate to different pages to see how the theme handles posts, archives, and other page templates. The settings may differ depending on what theme features the theme being previewed supports. To accept the new settings and activate the theme all in one step, click the Publish &amp; Activate button above the menu.' ) . '</p>' .
+ '<p>' . __( 'When previewing on smaller monitors, you can use the collapse icon at the bottom of the left-hand pane. This will hide the pane, giving you more room to preview your site in the new theme. To bring the pane back, click on the collapse icon again.' ) . '</p>';
+
+ get_current_screen()->add_help_tab(
+ array(
+ 'id' => 'customize-preview-themes',
+ 'title' => __( 'Previewing and Customizing' ),
+ 'content' => $help_customize,
+ )
+ );
+} // edit_theme_options && customize
+
+get_current_screen()->set_help_sidebar(
+ '<p><strong>' . __( 'For more information:' ) . '</strong></p>' .
+ '<p>' . __( '<a href="https://codex.wordpress.org/Using_Themes">Documentation on Using Themes</a>' ) . '</p>' .
+ '<p>' . __( '<a href="https://wordpress.org/support/">Support</a>' ) . '</p>'
+);
+
+if ( current_user_can( 'switch_themes' ) ) {
+ $themes = wp_prepare_themes_for_js();
+} else {
+ $themes = wp_prepare_themes_for_js( array( wp_get_theme() ) );
+}
+wp_reset_vars( array( 'theme', 'search' ) );
+
+wp_localize_script(
+ 'theme',
+ '_wpThemeSettings',
+ array(
+ 'themes' => $themes,
+ 'settings' => array(
+ 'canInstall' => ( ! is_multisite() && current_user_can( 'install_themes' ) ),
+ 'installURI' => ( ! is_multisite() && current_user_can( 'install_themes' ) ) ? admin_url( 'theme-install.php' ) : null,
+ 'confirmDelete' => __( "Are you sure you want to delete this theme?\n\nClick 'Cancel' to go back, 'OK' to confirm the delete." ),
+ 'adminUrl' => parse_url( admin_url(), PHP_URL_PATH ),
+ ),
+ 'l10n' => array(
+ 'addNew' => __( 'Add New Theme' ),
+ 'search' => __( 'Search Installed Themes' ),
+ 'searchPlaceholder' => __( 'Search installed themes...' ), // placeholder (no ellipsis)
+ 'themesFound' => __( 'Number of Themes found: %d' ),
+ 'noThemesFound' => __( 'No themes found. Try a different search.' ),
+ ),
+ )
+);
+
+add_thickbox();
+wp_enqueue_script( 'theme' );
+wp_enqueue_script( 'updates' );
+
+require_once( ABSPATH . 'wp-admin/admin-header.php' );
+?>
+
+<div class="wrap">
+ <h1 class="wp-heading-inline"><?php esc_html_e( 'Themes' ); ?>
+ <span class="title-count theme-count"><?php echo ! empty( $_GET['search'] ) ? __( '&hellip;' ) : count( $themes ); ?></span>
+ </h1>
+
+ <?php if ( ! is_multisite() && current_user_can( 'install_themes' ) ) : ?>
+ <a href="<?php echo admin_url( 'theme-install.php' ); ?>" class="hide-if-no-js page-title-action"><?php echo esc_html_x( 'Add New', 'Add new theme' ); ?></a>
+ <?php endif; ?>
+
+ <form class="search-form"></form>
+
+ <hr class="wp-header-end">
+<?php
+if ( ! validate_current_theme() || isset( $_GET['broken'] ) ) {
+ ?>
+ <div id="message1" class="updated notice is-dismissible"><p><?php _e( 'The active theme is broken. Reverting to the default theme.' ); ?></p></div>
+ <?php
+} elseif ( isset( $_GET['activated'] ) ) {
+ if ( isset( $_GET['previewed'] ) ) {
+ ?>
+ <div id="message2" class="updated notice is-dismissible"><p><?php _e( 'Settings saved and theme activated.' ); ?> <a href="<?php echo home_url( '/' ); ?>"><?php _e( 'Visit site' ); ?></a></p></div>
+ <?php
+ } else {
+ ?>
+ <div id="message2" class="updated notice is-dismissible"><p><?php _e( 'New theme activated.' ); ?> <a href="<?php echo home_url( '/' ); ?>"><?php _e( 'Visit site' ); ?></a></p></div>
+ <?php
+ }
+} elseif ( isset( $_GET['deleted'] ) ) {
+ ?>
+ <div id="message3" class="updated notice is-dismissible"><p><?php _e( 'Theme deleted.' ); ?></p></div>
+ <?php
+} elseif ( isset( $_GET['delete-active-child'] ) ) {
+ ?>
+ <div id="message4" class="error"><p><?php _e( 'You cannot delete a theme while it has an active child theme.' ); ?></p></div>
+ <?php
+} elseif ( isset( $_GET['resumed'] ) ) {
+ ?>
+ <div id="message5" class="updated notice is-dismissible"><p><?php _e( 'Theme resumed.' ); ?></p></div>
+ <?php
+} elseif ( isset( $_GET['error'] ) && 'resuming' === $_GET['error'] ) {
+ ?>
+ <div id="message6" class="error"><p><?php _e( 'Theme could not be resumed because it triggered a <strong>fatal error</strong>.' ); ?></p></div>
+ <?php
+}
+
+$ct = wp_get_theme();
+
+if ( $ct->errors() && ( ! is_multisite() || current_user_can( 'manage_network_themes' ) ) ) {
+ echo '<div class="error"><p>' . __( 'ERROR:' ) . ' ' . $ct->errors()->get_error_message() . '</p></div>';
+}
+
+/*
+// Certain error codes are less fatal than others. We can still display theme information in most cases.
+if ( ! $ct->errors() || ( 1 == count( $ct->errors()->get_error_codes() )
+ && in_array( $ct->errors()->get_error_code(), array( 'theme_no_parent', 'theme_parent_invalid', 'theme_no_index' ) ) ) ) : ?>
+*/
+
+ // Pretend you didn't see this.
+ $current_theme_actions = array();
+if ( is_array( $submenu ) && isset( $submenu['themes.php'] ) ) {
+ foreach ( (array) $submenu['themes.php'] as $item ) {
+ $class = '';
+ if ( 'themes.php' == $item[2] || 'theme-editor.php' == $item[2] || 0 === strpos( $item[2], 'customize.php' ) ) {
+ continue;
+ }
+ // 0 = name, 1 = capability, 2 = file
+ if ( ( strcmp( $self, $item[2] ) == 0 && empty( $parent_file ) ) || ( $parent_file && ( $item[2] == $parent_file ) ) ) {
+ $class = ' current';
+ }
+ if ( ! empty( $submenu[ $item[2] ] ) ) {
+ $submenu[ $item[2] ] = array_values( $submenu[ $item[2] ] ); // Re-index.
+ $menu_hook = get_plugin_page_hook( $submenu[ $item[2] ][0][2], $item[2] );
+ if ( file_exists( WP_PLUGIN_DIR . "/{$submenu[$item[2]][0][2]}" ) || ! empty( $menu_hook ) ) {
+ $current_theme_actions[] = "<a class='button$class' href='admin.php?page={$submenu[$item[2]][0][2]}'>{$item[0]}</a>";
+ } else {
+ $current_theme_actions[] = "<a class='button$class' href='{$submenu[$item[2]][0][2]}'>{$item[0]}</a>";
+ }
+ } elseif ( ! empty( $item[2] ) && current_user_can( $item[1] ) ) {
+ $menu_file = $item[2];
+
+ if ( current_user_can( 'customize' ) ) {
+ if ( 'custom-header' === $menu_file ) {
+ $current_theme_actions[] = "<a class='button hide-if-no-customize$class' href='customize.php?autofocus[control]=header_image'>{$item[0]}</a>";
+ } elseif ( 'custom-background' === $menu_file ) {
+ $current_theme_actions[] = "<a class='button hide-if-no-customize$class' href='customize.php?autofocus[control]=background_image'>{$item[0]}</a>";
+ }
+ }
+
+ if ( false !== ( $pos = strpos( $menu_file, '?' ) ) ) {
+ $menu_file = substr( $menu_file, 0, $pos );
+ }
+
+ if ( file_exists( ABSPATH . "wp-admin/$menu_file" ) ) {
+ $current_theme_actions[] = "<a class='button$class' href='{$item[2]}'>{$item[0]}</a>";
+ } else {
+ $current_theme_actions[] = "<a class='button$class' href='themes.php?page={$item[2]}'>{$item[0]}</a>";
+ }
+ }
+ }
+}
+
+?>
+
+<?php
+$class_name = 'theme-browser';
+if ( ! empty( $_GET['search'] ) ) {
+ $class_name .= ' search-loading';
+}
+?>
+<div class="<?php echo esc_attr( $class_name ); ?>">
+ <div class="themes wp-clearfix">
+
+<?php
+/*
+ * This PHP is synchronized with the tmpl-theme template below!
+ */
+
+foreach ( $themes as $theme ) :
+ $aria_action = esc_attr( $theme['id'] . '-action' );
+ $aria_name = esc_attr( $theme['id'] . '-name' );
+
+ $active_class = '';
+ if ( $theme['active'] ) {
+ $active_class = ' active';
+ }
+ ?>
+<div class="theme<?php echo $active_class; ?>" tabindex="0" aria-describedby="<?php echo $aria_action . ' ' . $aria_name; ?>">
+ <?php if ( ! empty( $theme['screenshot'][0] ) ) { ?>
+ <div class="theme-screenshot">
+ <img src="<?php echo $theme['screenshot'][0]; ?>" alt="" />
+ </div>
+ <?php } else { ?>
+ <div class="theme-screenshot blank"></div>
+ <?php } ?>
+
+ <?php if ( $theme['hasUpdate'] ) : ?>
+ <div class="update-message notice inline notice-warning notice-alt">
+ <?php if ( $theme['hasPackage'] ) : ?>
+ <p><?php _e( 'New version available. <button class="button-link" type="button">Update now</button>' ); ?></p>
+ <?php else : ?>
+ <p><?php _e( 'New version available.' ); ?></p>
+ <?php endif; ?>
+ </div>
+ <?php endif; ?>
+
+ <span class="more-details" id="<?php echo $aria_action; ?>"><?php _e( 'Theme Details' ); ?></span>
+ <div class="theme-author"><?php printf( __( 'By %s' ), $theme['author'] ); ?></div>
+
+ <div class="theme-id-container">
+ <?php if ( $theme['active'] ) { ?>
+ <h2 class="theme-name" id="<?php echo $aria_name; ?>">
+ <?php
+ /* translators: %s: theme name */
+ printf( __( '<span>Active:</span> %s' ), $theme['name'] );
+ ?>
+ </h2>
+ <?php } else { ?>
+ <h2 class="theme-name" id="<?php echo $aria_name; ?>"><?php echo $theme['name']; ?></h2>
+ <?php } ?>
+
+ <div class="theme-actions">
+ <?php if ( $theme['active'] ) { ?>
+ <?php if ( $theme['actions']['customize'] && current_user_can( 'edit_theme_options' ) && current_user_can( 'customize' ) ) { ?>
+ <a class="button button-primary customize load-customize hide-if-no-customize" href="<?php echo $theme['actions']['customize']; ?>"><?php _e( 'Customize' ); ?></a>
+ <?php } ?>
+ <?php } else { ?>
+ <?php
+ /* translators: %s: Theme name */
+ $aria_label = sprintf( _x( 'Activate %s', 'theme' ), '{{ data.name }}' );
+ ?>
+ <a class="button activate" href="<?php echo $theme['actions']['activate']; ?>" aria-label="<?php echo esc_attr( $aria_label ); ?>"><?php _e( 'Activate' ); ?></a>
+ <?php if ( current_user_can( 'edit_theme_options' ) && current_user_can( 'customize' ) ) { ?>
+ <a class="button button-primary load-customize hide-if-no-customize" href="<?php echo $theme['actions']['customize']; ?>"><?php _e( 'Live Preview' ); ?></a>
+ <?php } ?>
+ <?php } ?>
+
+ </div>
+ </div>
+</div>
+<?php endforeach; ?>
+ </div>
+</div>
+<div class="theme-overlay" tabindex="0" role="dialog" aria-label="<?php esc_attr_e( 'Theme Details' ); ?>"></div>
+
+<p class="no-themes"><?php _e( 'No themes found. Try a different search.' ); ?></p>
+
+<?php
+// List broken themes, if any.
+if ( ! is_multisite() && current_user_can( 'edit_themes' ) && $broken_themes = wp_get_themes( array( 'errors' => true ) ) ) {
+ ?>
+
+<div class="broken-themes">
+<h3><?php _e( 'Broken Themes' ); ?></h3>
+<p><?php _e( 'The following themes are installed but incomplete.' ); ?></p>
+
+ <?php
+ $can_resume = current_user_can( 'resume_themes' );
+ $can_delete = current_user_can( 'delete_themes' );
+ $can_install = current_user_can( 'install_themes' );
+ ?>
+<table>
+ <tr>
+ <th><?php _ex( 'Name', 'theme name' ); ?></th>
+ <th><?php _e( 'Description' ); ?></th>
+ <?php if ( $can_resume ) { ?>
+ <td></td>
+ <?php } ?>
+ <?php if ( $can_delete ) { ?>
+ <td></td>
+ <?php } ?>
+ <?php if ( $can_install ) { ?>
+ <td></td>
+ <?php } ?>
+ </tr>
+ <?php foreach ( $broken_themes as $broken_theme ) : ?>
+ <tr>
+ <td><?php echo $broken_theme->get( 'Name' ) ? $broken_theme->display( 'Name' ) : $broken_theme->get_stylesheet(); ?></td>
+ <td><?php echo $broken_theme->errors()->get_error_message(); ?></td>
+ <?php
+ if ( $can_resume ) {
+ if ( 'theme_paused' === $broken_theme->errors()->get_error_code() ) {
+ $stylesheet = $broken_theme->get_stylesheet();
+ $resume_url = add_query_arg(
+ array(
+ 'action' => 'resume',
+ 'stylesheet' => urlencode( $stylesheet ),
+ ),
+ admin_url( 'themes.php' )
+ );
+ $resume_url = wp_nonce_url( $resume_url, 'resume-theme_' . $stylesheet );
+ ?>
+ <td><a href="<?php echo esc_url( $resume_url ); ?>" class="button resume-theme"><?php _e( 'Resume' ); ?></a></td>
+ <?php
+ } else {
+ ?>
+ <td></td>
+ <?php
+ }
+ }
+
+ if ( $can_delete ) {
+ $stylesheet = $broken_theme->get_stylesheet();
+ $delete_url = add_query_arg(
+ array(
+ 'action' => 'delete',
+ 'stylesheet' => urlencode( $stylesheet ),
+ ),
+ admin_url( 'themes.php' )
+ );
+ $delete_url = wp_nonce_url( $delete_url, 'delete-theme_' . $stylesheet );
+ ?>
+ <td><a href="<?php echo esc_url( $delete_url ); ?>" class="button delete-theme"><?php _e( 'Delete' ); ?></a></td>
+ <?php
+ }
+
+ if ( $can_install && 'theme_no_parent' === $broken_theme->errors()->get_error_code() ) {
+ $parent_theme_name = $broken_theme->get( 'Template' );
+ $parent_theme = themes_api( 'theme_information', array( 'slug' => urlencode( $parent_theme_name ) ) );
+
+ if ( ! is_wp_error( $parent_theme ) ) {
+ $install_url = add_query_arg(
+ array(
+ 'action' => 'install-theme',
+ 'theme' => urlencode( $parent_theme_name ),
+ ),
+ admin_url( 'update.php' )
+ );
+ $install_url = wp_nonce_url( $install_url, 'install-theme_' . $parent_theme_name );
+ ?>
+ <td><a href="<?php echo esc_url( $install_url ); ?>" class="button install-theme"><?php _e( 'Install Parent Theme' ); ?></a></td>
+ <?php
+ }
+ }
+ ?>
+ </tr>
+ <?php endforeach; ?>
+</table>
+</div>
+
+ <?php
+}
+?>
+</div><!-- .wrap -->
+
+<?php
+/*
+ * The tmpl-theme template is synchronized with PHP above!
+ */
+?>
+<script id="tmpl-theme" type="text/template">
+ <# if ( data.screenshot[0] ) { #>
+ <div class="theme-screenshot">
+ <img src="{{ data.screenshot[0] }}" alt="" />
+ </div>
+ <# } else { #>
+ <div class="theme-screenshot blank"></div>
+ <# } #>
+
+ <# if ( data.hasUpdate ) { #>
+ <# if ( data.hasPackage ) { #>
+ <div class="update-message notice inline notice-warning notice-alt"><p><?php _e( 'New version available. <button class="button-link" type="button">Update now</button>' ); ?></p></div>
+ <# } else { #>
+ <div class="update-message notice inline notice-warning notice-alt"><p><?php _e( 'New version available.' ); ?></p></div>
+ <# } #>
+ <# } #>
+
+ <span class="more-details" id="{{ data.id }}-action"><?php _e( 'Theme Details' ); ?></span>
+ <div class="theme-author">
+ <?php
+ /* translators: %s: Theme author name */
+ printf( __( 'By %s' ), '{{{ data.author }}}' );
+ ?>
+ </div>
+
+ <div class="theme-id-container">
+ <# if ( data.active ) { #>
+ <h2 class="theme-name" id="{{ data.id }}-name">
+ <?php
+ /* translators: %s: Theme name */
+ printf( __( '<span>Active:</span> %s' ), '{{{ data.name }}}' );
+ ?>
+ </h2>
+ <# } else { #>
+ <h2 class="theme-name" id="{{ data.id }}-name">{{{ data.name }}}</h2>
+ <# } #>
+
+ <div class="theme-actions">
+ <# if ( data.active ) { #>
+ <# if ( data.actions.customize ) { #>
+ <a class="button button-primary customize load-customize hide-if-no-customize" href="{{{ data.actions.customize }}}"><?php _e( 'Customize' ); ?></a>
+ <# } #>
+ <# } else { #>
+ <?php
+ /* translators: %s: Theme name */
+ $aria_label = sprintf( _x( 'Activate %s', 'theme' ), '{{ data.name }}' );
+ ?>
+ <a class="button activate" href="{{{ data.actions.activate }}}" aria-label="<?php echo $aria_label; ?>"><?php _e( 'Activate' ); ?></a>
+ <a class="button button-primary load-customize hide-if-no-customize" href="{{{ data.actions.customize }}}"><?php _e( 'Live Preview' ); ?></a>
+ <# } #>
+ </div>
+ </div>
+</script>
+
+<script id="tmpl-theme-single" type="text/template">
+ <div class="theme-backdrop"></div>
+ <div class="theme-wrap wp-clearfix" role="document">
+ <div class="theme-header">
+ <button class="left dashicons dashicons-no"><span class="screen-reader-text"><?php _e( 'Show previous theme' ); ?></span></button>
+ <button class="right dashicons dashicons-no"><span class="screen-reader-text"><?php _e( 'Show next theme' ); ?></span></button>
+ <button class="close dashicons dashicons-no"><span class="screen-reader-text"><?php _e( 'Close details dialog' ); ?></span></button>
+ </div>
+ <div class="theme-about wp-clearfix">
+ <div class="theme-screenshots">
+ <# if ( data.screenshot[0] ) { #>
+ <div class="screenshot"><img src="{{ data.screenshot[0] }}" alt="" /></div>
+ <# } else { #>
+ <div class="screenshot blank"></div>
+ <# } #>
+ </div>
+
+ <div class="theme-info">
+ <# if ( data.active ) { #>
+ <span class="current-label"><?php _e( 'Current Theme' ); ?></span>
+ <# } #>
+ <h2 class="theme-name">{{{ data.name }}}<span class="theme-version"><?php printf( __( 'Version: %s' ), '{{ data.version }}' ); ?></span></h2>
+ <p class="theme-author"><?php printf( __( 'By %s' ), '{{{ data.authorAndUri }}}' ); ?></p>
+
+ <# if ( data.hasUpdate ) { #>
+ <div class="notice notice-warning notice-alt notice-large">
+ <h3 class="notice-title"><?php _e( 'Update Available' ); ?></h3>
+ {{{ data.update }}}
+ </div>
+ <# } #>
+ <p class="theme-description">{{{ data.description }}}</p>
+
+ <# if ( data.parent ) { #>
+ <p class="parent-theme"><?php printf( __( 'This is a child theme of %s.' ), '<strong>{{{ data.parent }}}</strong>' ); ?></p>
+ <# } #>
+
+ <# if ( data.tags ) { #>
+ <p class="theme-tags"><span><?php _e( 'Tags:' ); ?></span> {{{ data.tags }}}</p>
+ <# } #>
+ </div>
+ </div>
+
+ <div class="theme-actions">
+ <div class="active-theme">
+ <a href="{{{ data.actions.customize }}}" class="button button-primary customize load-customize hide-if-no-customize"><?php _e( 'Customize' ); ?></a>
+ <?php echo implode( ' ', $current_theme_actions ); ?>
+ </div>
+ <div class="inactive-theme">
+ <?php
+ /* translators: %s: Theme name */
+ $aria_label = sprintf( _x( 'Activate %s', 'theme' ), '{{ data.name }}' );
+ ?>
+ <# if ( data.actions.activate ) { #>
+ <a href="{{{ data.actions.activate }}}" class="button activate" aria-label="<?php echo $aria_label; ?>"><?php _e( 'Activate' ); ?></a>
+ <# } #>
+ <a href="{{{ data.actions.customize }}}" class="button button-primary load-customize hide-if-no-customize"><?php _e( 'Live Preview' ); ?></a>
+ </div>
+
+ <# if ( ! data.active && data.actions['delete'] ) { #>
+ <a href="{{{ data.actions['delete'] }}}" class="button delete-theme"><?php _e( 'Delete' ); ?></a>
+ <# } #>
+ </div>
+ </div>
+</script>
+
+<?php
+wp_print_request_filesystem_credentials_modal();
+wp_print_admin_notice_templates();
+wp_print_update_row_templates();
+
+wp_localize_script(
+ 'updates',
+ '_wpUpdatesItemCounts',
+ array(
+ 'totals' => wp_get_update_data(),
+ )
+);
+
+require( ABSPATH . 'wp-admin/admin-footer.php' );
diff --git a/www/crm/wp-admin/tools.php b/www/crm/wp-admin/tools.php
new file mode 100644
index 00000000..c188e3f5
--- /dev/null
+++ b/www/crm/wp-admin/tools.php
@@ -0,0 +1,79 @@
+<?php
+/**
+ * Tools Administration Screen.
+ *
+ * @package WordPress
+ * @subpackage Administration
+ */
+
+/** WordPress Administration Bootstrap */
+require_once( dirname( __FILE__ ) . '/admin.php' );
+
+$is_privacy_guide = ( isset( $_GET['wp-privacy-policy-guide'] ) && current_user_can( 'manage_privacy_options' ) );
+
+if ( $is_privacy_guide ) {
+ $title = __( 'Privacy Policy Guide' );
+
+ // "Borrow" xfn.js for now so we don't have to create new files.
+ wp_enqueue_script( 'xfn' );
+
+} else {
+
+ $title = __( 'Tools' );
+
+ get_current_screen()->add_help_tab(
+ array(
+ 'id' => 'converter',
+ 'title' => __( 'Categories and Tags Converter' ),
+ 'content' => '<p>' . __( 'Categories have hierarchy, meaning that you can nest sub-categories. Tags do not have hierarchy and cannot be nested. Sometimes people start out using one on their posts, then later realize that the other would work better for their content.' ) . '</p>' .
+ '<p>' . __( 'The Categories and Tags Converter link on this screen will take you to the Import screen, where that Converter is one of the plugins you can install. Once that plugin is installed, the Activate Plugin &amp; Run Importer link will take you to a screen where you can choose to convert tags into categories or vice versa.' ) . '</p>',
+ )
+ );
+
+ get_current_screen()->set_help_sidebar(
+ '<p><strong>' . __( 'For more information:' ) . '</strong></p>' .
+ '<p>' . __( '<a href="https://codex.wordpress.org/Tools_Screen">Documentation on Tools</a>' ) . '</p>' .
+ '<p>' . __( '<a href="https://wordpress.org/support/">Support</a>' ) . '</p>'
+ );
+}
+
+require_once( ABSPATH . 'wp-admin/admin-header.php' );
+
+?>
+<div class="wrap">
+<h1><?php echo esc_html( $title ); ?></h1>
+<?php
+
+if ( $is_privacy_guide ) {
+ ?>
+ <div class="wp-privacy-policy-guide">
+ <?php WP_Privacy_Policy_Content::privacy_policy_guide(); ?>
+ </div>
+ <?php
+
+} else {
+
+ if ( current_user_can( 'import' ) ) :
+ $cats = get_taxonomy( 'category' );
+ $tags = get_taxonomy( 'post_tag' );
+ if ( current_user_can( $cats->cap->manage_terms ) || current_user_can( $tags->cap->manage_terms ) ) :
+ ?>
+ <div class="card">
+ <h2 class="title"><?php _e( 'Categories and Tags Converter' ); ?></h2>
+ <p><?php printf( __( 'If you want to convert your categories to tags (or vice versa), use the <a href="%s">Categories and Tags Converter</a> available from the Import screen.' ), 'import.php' ); ?></p>
+ </div>
+ <?php
+ endif;
+ endif;
+
+ /**
+ * Fires at the end of the Tools Administration screen.
+ *
+ * @since 2.8.0
+ */
+ do_action( 'tool_box' );
+}
+?>
+</div>
+<?php
+include( ABSPATH . 'wp-admin/admin-footer.php' );
diff --git a/www/crm/wp-admin/update-core.php b/www/crm/wp-admin/update-core.php
new file mode 100644
index 00000000..cf202264
--- /dev/null
+++ b/www/crm/wp-admin/update-core.php
@@ -0,0 +1,879 @@
+<?php
+/**
+ * Update Core administration panel.
+ *
+ * @package WordPress
+ * @subpackage Administration
+ */
+
+/** WordPress Administration Bootstrap */
+require_once( dirname( __FILE__ ) . '/admin.php' );
+
+wp_enqueue_style( 'plugin-install' );
+wp_enqueue_script( 'plugin-install' );
+wp_enqueue_script( 'updates' );
+add_thickbox();
+
+if ( is_multisite() && ! is_network_admin() ) {
+ wp_redirect( network_admin_url( 'update-core.php' ) );
+ exit();
+}
+
+if ( ! current_user_can( 'update_core' ) && ! current_user_can( 'update_themes' ) && ! current_user_can( 'update_plugins' ) && ! current_user_can( 'update_languages' ) ) {
+ wp_die( __( 'Sorry, you are not allowed to update this site.' ) );
+}
+
+/**
+ * @global string $wp_local_package
+ * @global wpdb $wpdb
+ *
+ * @staticvar bool $first_pass
+ *
+ * @param object $update
+ */
+function list_core_update( $update ) {
+ global $wp_local_package, $wpdb;
+ static $first_pass = true;
+
+ $wp_version = get_bloginfo( 'version' );
+
+ if ( 'en_US' == $update->locale && 'en_US' == get_locale() ) {
+ $version_string = $update->current;
+ } elseif ( 'en_US' == $update->locale && $update->packages->partial && $wp_version == $update->partial_version && ( $updates = get_core_updates() ) && 1 == count( $updates ) ) {
+ // If the only available update is a partial builds, it doesn't need a language-specific version string.
+ $version_string = $update->current;
+ } else {
+ $version_string = sprintf( '%s&ndash;<strong>%s</strong>', $update->current, $update->locale );
+ }
+
+ $current = false;
+ if ( ! isset( $update->response ) || 'latest' == $update->response ) {
+ $current = true;
+ }
+ $submit = __( 'Update Now' );
+ $form_action = 'update-core.php?action=do-core-upgrade';
+ $php_version = phpversion();
+ $mysql_version = $wpdb->db_version();
+ $show_buttons = true;
+ if ( 'development' == $update->response ) {
+ $message = __( 'You are using a development version of WordPress. You can update to the latest nightly build automatically:' );
+ } else {
+ if ( $current ) {
+ $message = sprintf( __( 'If you need to re-install version %s, you can do so here:' ), $version_string );
+ $submit = __( 'Re-install Now' );
+ $form_action = 'update-core.php?action=do-core-reinstall';
+ } else {
+ $php_compat = version_compare( $php_version, $update->php_version, '>=' );
+ if ( file_exists( WP_CONTENT_DIR . '/db.php' ) && empty( $wpdb->is_mysql ) ) {
+ $mysql_compat = true;
+ } else {
+ $mysql_compat = version_compare( $mysql_version, $update->mysql_version, '>=' );
+ }
+
+ $version_url = sprintf(
+ /* translators: %s: WordPress version */
+ esc_url( __( 'https://wordpress.org/support/wordpress-version/version-%s/' ) ),
+ sanitize_title( $update->current )
+ );
+
+ /* translators: %s: Update PHP page URL */
+ $php_update_message = '</p><p>' . sprintf( __( '<a href="%s">Learn more about updating PHP</a>.' ), esc_url( wp_get_update_php_url() ) );
+
+ $annotation = wp_get_update_php_annotation();
+ if ( $annotation ) {
+ $php_update_message .= '</p><p><em>' . $annotation . '</em>';
+ }
+
+ if ( ! $mysql_compat && ! $php_compat ) {
+ /* translators: 1: URL to WordPress release notes, 2: WordPress version number, 3: Minimum required PHP version number, 4: Minimum required MySQL version number, 5: Current PHP version number, 6: Current MySQL version number */
+ $message = sprintf( __( 'You cannot update because <a href="%1$s">WordPress %2$s</a> requires PHP version %3$s or higher and MySQL version %4$s or higher. You are running PHP version %5$s and MySQL version %6$s.' ), $version_url, $update->current, $update->php_version, $update->mysql_version, $php_version, $mysql_version ) . $php_update_message;
+ } elseif ( ! $php_compat ) {
+ /* translators: 1: URL to WordPress release notes, 2: WordPress version number, 3: Minimum required PHP version number, 4: Current PHP version number */
+ $message = sprintf( __( 'You cannot update because <a href="%1$s">WordPress %2$s</a> requires PHP version %3$s or higher. You are running version %4$s.' ), $version_url, $update->current, $update->php_version, $php_version ) . $php_update_message;
+ } elseif ( ! $mysql_compat ) {
+ /* translators: 1: URL to WordPress release notes, 2: WordPress version number, 3: Minimum required MySQL version number, 4: Current MySQL version number */
+ $message = sprintf( __( 'You cannot update because <a href="%1$s">WordPress %2$s</a> requires MySQL version %3$s or higher. You are running version %4$s.' ), $version_url, $update->current, $update->mysql_version, $mysql_version );
+ } else {
+ /* translators: 1: URL to WordPress release notes, 2: WordPress version number including locale if necessary */
+ $message = sprintf( __( 'You can update to <a href="%1$s">WordPress %2$s</a> automatically:' ), $version_url, $version_string );
+ }
+ if ( ! $mysql_compat || ! $php_compat ) {
+ $show_buttons = false;
+ }
+ }
+ }
+
+ echo '<p>';
+ echo $message;
+ echo '</p>';
+ echo '<form method="post" action="' . $form_action . '" name="upgrade" class="upgrade">';
+ wp_nonce_field( 'upgrade-core' );
+ echo '<p>';
+ echo '<input name="version" value="' . esc_attr( $update->current ) . '" type="hidden"/>';
+ echo '<input name="locale" value="' . esc_attr( $update->locale ) . '" type="hidden"/>';
+ if ( $show_buttons ) {
+ if ( $first_pass ) {
+ submit_button( $submit, $current ? '' : 'primary regular', 'upgrade', false );
+ $first_pass = false;
+ } else {
+ submit_button( $submit, '', 'upgrade', false );
+ }
+ }
+ if ( 'en_US' != $update->locale ) {
+ if ( ! isset( $update->dismissed ) || ! $update->dismissed ) {
+ submit_button( __( 'Hide this update' ), '', 'dismiss', false );
+ } else {
+ submit_button( __( 'Bring back this update' ), '', 'undismiss', false );
+ }
+ }
+ echo '</p>';
+ if ( 'en_US' != $update->locale && ( ! isset( $wp_local_package ) || $wp_local_package != $update->locale ) ) {
+ echo '<p class="hint">' . __( 'This localized version contains both the translation and various other localization fixes. You can skip upgrading if you want to keep your current translation.' ) . '</p>';
+ } elseif ( 'en_US' == $update->locale && get_locale() != 'en_US' && ( ! $update->packages->partial && $wp_version == $update->partial_version ) ) {
+ // Partial builds don't need language-specific warnings.
+ echo '<p class="hint">' . sprintf( __( 'You are about to install WordPress %s <strong>in English (US).</strong> There is a chance this update will break your translation. You may prefer to wait for the localized version to be released.' ), $update->response != 'development' ? $update->current : '' ) . '</p>';
+ }
+ echo '</form>';
+
+}
+
+/**
+ * @since 2.7.0
+ */
+function dismissed_updates() {
+ $dismissed = get_core_updates(
+ array(
+ 'dismissed' => true,
+ 'available' => false,
+ )
+ );
+ if ( $dismissed ) {
+
+ $show_text = esc_js( __( 'Show hidden updates' ) );
+ $hide_text = esc_js( __( 'Hide hidden updates' ) );
+ ?>
+ <script type="text/javascript">
+ jQuery(function( $ ) {
+ $( 'dismissed-updates' ).show();
+ $( '#show-dismissed' ).toggle( function() { $( this ).text( '<?php echo $hide_text; ?>' ).attr( 'aria-expanded', 'true' ); }, function() { $( this ).text( '<?php echo $show_text; ?>' ).attr( 'aria-expanded', 'false' ); } );
+ $( '#show-dismissed' ).click( function() { $( '#dismissed-updates' ).toggle( 'fast' ); } );
+ });
+ </script>
+ <?php
+ echo '<p class="hide-if-no-js"><button type="button" class="button" id="show-dismissed" aria-expanded="false">' . __( 'Show hidden updates' ) . '</button></p>';
+ echo '<ul id="dismissed-updates" class="core-updates dismissed">';
+ foreach ( (array) $dismissed as $update ) {
+ echo '<li>';
+ list_core_update( $update );
+ echo '</li>';
+ }
+ echo '</ul>';
+ }
+}
+
+/**
+ * Display upgrade WordPress for downloading latest or upgrading automatically form.
+ *
+ * @since 2.7.0
+ *
+ * @global string $required_php_version
+ * @global string $required_mysql_version
+ */
+function core_upgrade_preamble() {
+ global $required_php_version, $required_mysql_version;
+
+ $wp_version = get_bloginfo( 'version' );
+ $updates = get_core_updates();
+
+ if ( ! isset( $updates[0]->response ) || 'latest' == $updates[0]->response ) {
+ echo '<h2>';
+ _e( 'You have the latest version of WordPress.' );
+
+ if ( wp_http_supports( array( 'ssl' ) ) ) {
+ require_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';
+ $upgrader = new WP_Automatic_Updater;
+ $future_minor_update = (object) array(
+ 'current' => $wp_version . '.1.next.minor',
+ 'version' => $wp_version . '.1.next.minor',
+ 'php_version' => $required_php_version,
+ 'mysql_version' => $required_mysql_version,
+ );
+ $should_auto_update = $upgrader->should_update( 'core', $future_minor_update, ABSPATH );
+ if ( $should_auto_update ) {
+ echo ' ' . __( 'Future security updates will be applied automatically.' );
+ }
+ }
+ echo '</h2>';
+ } else {
+ echo '<div class="notice notice-warning"><p>';
+ _e( '<strong>Important:</strong> Before updating, please <a href="https://codex.wordpress.org/WordPress_Backups">back up your database and files</a>. For help with updates, visit the <a href="https://codex.wordpress.org/Updating_WordPress">Updating WordPress</a> Codex page.' );
+ echo '</p></div>';
+
+ echo '<h2 class="response">';
+ _e( 'An updated version of WordPress is available.' );
+ echo '</h2>';
+ }
+
+ if ( isset( $updates[0] ) && $updates[0]->response == 'development' ) {
+ require_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';
+ $upgrader = new WP_Automatic_Updater;
+ if ( wp_http_supports( 'ssl' ) && $upgrader->should_update( 'core', $updates[0], ABSPATH ) ) {
+ echo '<div class="updated inline"><p>';
+ echo '<strong>' . __( 'BETA TESTERS:' ) . '</strong> ' . __( 'This site is set up to install updates of future beta versions automatically.' );
+ echo '</p></div>';
+ }
+ }
+
+ echo '<ul class="core-updates">';
+ foreach ( (array) $updates as $update ) {
+ echo '<li>';
+ list_core_update( $update );
+ echo '</li>';
+ }
+ echo '</ul>';
+ // Don't show the maintenance mode notice when we are only showing a single re-install option.
+ if ( $updates && ( count( $updates ) > 1 || $updates[0]->response != 'latest' ) ) {
+ echo '<p>' . __( 'While your site is being updated, it will be in maintenance mode. As soon as your updates are complete, your site will return to normal.' ) . '</p>';
+ } elseif ( ! $updates ) {
+ list( $normalized_version ) = explode( '-', $wp_version );
+ echo '<p>' . sprintf( __( '<a href="%1$s">Learn more about WordPress %2$s</a>.' ), esc_url( self_admin_url( 'about.php' ) ), $normalized_version ) . '</p>';
+ }
+ dismissed_updates();
+}
+
+function list_plugin_updates() {
+ $wp_version = get_bloginfo( 'version' );
+ $cur_wp_version = preg_replace( '/-.*$/', '', $wp_version );
+
+ require_once( ABSPATH . 'wp-admin/includes/plugin-install.php' );
+ $plugins = get_plugin_updates();
+ if ( empty( $plugins ) ) {
+ echo '<h2>' . __( 'Plugins' ) . '</h2>';
+ echo '<p>' . __( 'Your plugins are all up to date.' ) . '</p>';
+ return;
+ }
+ $form_action = 'update-core.php?action=do-plugin-upgrade';
+
+ $core_updates = get_core_updates();
+ if ( ! isset( $core_updates[0]->response ) || 'latest' == $core_updates[0]->response || 'development' == $core_updates[0]->response || version_compare( $core_updates[0]->current, $cur_wp_version, '=' ) ) {
+ $core_update_version = false;
+ } else {
+ $core_update_version = $core_updates[0]->current;
+ }
+ ?>
+<h2><?php _e( 'Plugins' ); ?></h2>
+<p><?php _e( 'The following plugins have new versions available. Check the ones you want to update and then click &#8220;Update Plugins&#8221;.' ); ?></p>
+<form method="post" action="<?php echo esc_url( $form_action ); ?>" name="upgrade-plugins" class="upgrade">
+ <?php wp_nonce_field( 'upgrade-core' ); ?>
+<p><input id="upgrade-plugins" class="button" type="submit" value="<?php esc_attr_e( 'Update Plugins' ); ?>" name="upgrade" /></p>
+<table class="widefat updates-table" id="update-plugins-table">
+ <thead>
+ <tr>
+ <td class="manage-column check-column"><input type="checkbox" id="plugins-select-all" /></td>
+ <td class="manage-column"><label for="plugins-select-all"><?php _e( 'Select All' ); ?></label></td>
+ </tr>
+ </thead>
+
+ <tbody class="plugins">
+ <?php
+ foreach ( (array) $plugins as $plugin_file => $plugin_data ) {
+ $plugin_data = (object) _get_plugin_data_markup_translate( $plugin_file, (array) $plugin_data, false, true );
+
+ $icon = '<span class="dashicons dashicons-admin-plugins"></span>';
+ $preferred_icons = array( 'svg', '2x', '1x', 'default' );
+ foreach ( $preferred_icons as $preferred_icon ) {
+ if ( ! empty( $plugin_data->update->icons[ $preferred_icon ] ) ) {
+ $icon = '<img src="' . esc_url( $plugin_data->update->icons[ $preferred_icon ] ) . '" alt="" />';
+ break;
+ }
+ }
+
+ // Get plugin compat for running version of WordPress.
+ if ( isset( $plugin_data->update->tested ) && version_compare( $plugin_data->update->tested, $cur_wp_version, '>=' ) ) {
+ $compat = '<br />' . sprintf( __( 'Compatibility with WordPress %1$s: 100%% (according to its author)' ), $cur_wp_version );
+ } else {
+ $compat = '<br />' . sprintf( __( 'Compatibility with WordPress %1$s: Unknown' ), $cur_wp_version );
+ }
+ // Get plugin compat for updated version of WordPress.
+ if ( $core_update_version ) {
+ if ( isset( $plugin_data->update->tested ) && version_compare( $plugin_data->update->tested, $core_update_version, '>=' ) ) {
+ $compat .= '<br />' . sprintf( __( 'Compatibility with WordPress %1$s: 100%% (according to its author)' ), $core_update_version );
+ } else {
+ $compat .= '<br />' . sprintf( __( 'Compatibility with WordPress %1$s: Unknown' ), $core_update_version );
+ }
+ }
+
+ $requires_php = isset( $plugin_data->update->requires_php ) ? $plugin_data->update->requires_php : null;
+ $compatible_php = is_php_version_compatible( $requires_php );
+
+ if ( ! $compatible_php && current_user_can( 'update_php' ) ) {
+ $compat .= '<br>' . __( 'This update doesn&#8217;t work with your version of PHP.' ) . '&nbsp;';
+ /* translators: %s: Update PHP page URL */
+ $compat .= sprintf(
+ __( '<a href="%s">Learn more about updating PHP</a>.' ),
+ esc_url( wp_get_update_php_url() )
+ );
+
+ $annotation = wp_get_update_php_annotation();
+
+ if ( $annotation ) {
+ $compat .= '</p><p><em>' . $annotation . '</em>';
+ }
+ }
+
+ // Get the upgrade notice for the new plugin version.
+ if ( isset( $plugin_data->update->upgrade_notice ) ) {
+ $upgrade_notice = '<br />' . strip_tags( $plugin_data->update->upgrade_notice );
+ } else {
+ $upgrade_notice = '';
+ }
+
+ $details_url = self_admin_url( 'plugin-install.php?tab=plugin-information&plugin=' . $plugin_data->update->slug . '&section=changelog&TB_iframe=true&width=640&height=662' );
+ $details = sprintf(
+ '<a href="%1$s" class="thickbox open-plugin-details-modal" aria-label="%2$s">%3$s</a>',
+ esc_url( $details_url ),
+ /* translators: 1: plugin name, 2: version number */
+ esc_attr( sprintf( __( 'View %1$s version %2$s details' ), $plugin_data->Name, $plugin_data->update->new_version ) ),
+ /* translators: %s: plugin version */
+ sprintf( __( 'View version %s details.' ), $plugin_data->update->new_version )
+ );
+
+ $checkbox_id = 'checkbox_' . md5( $plugin_data->Name );
+ ?>
+ <tr>
+ <td class="check-column">
+ <?php if ( $compatible_php ) : ?>
+ <input type="checkbox" name="checked[]" id="<?php echo $checkbox_id; ?>" value="<?php echo esc_attr( $plugin_file ); ?>" />
+ <label for="<?php echo $checkbox_id; ?>" class="screen-reader-text">
+ <?php
+ /* translators: %s: plugin name */
+ printf(
+ __( 'Select %s' ),
+ $plugin_data->Name
+ );
+ ?>
+ </label>
+ <?php endif; ?>
+ </td>
+ <td class="plugin-title"><p>
+ <?php echo $icon; ?>
+ <strong><?php echo $plugin_data->Name; ?></strong>
+ <?php
+ /* translators: 1: plugin version, 2: new version */
+ printf(
+ __( 'You have version %1$s installed. Update to %2$s.' ),
+ $plugin_data->Version,
+ $plugin_data->update->new_version
+ );
+ echo ' ' . $details . $compat . $upgrade_notice;
+ ?>
+ </p></td>
+ </tr>
+ <?php
+ }
+ ?>
+ </tbody>
+
+ <tfoot>
+ <tr>
+ <td class="manage-column check-column"><input type="checkbox" id="plugins-select-all-2" /></td>
+ <td class="manage-column"><label for="plugins-select-all-2"><?php _e( 'Select All' ); ?></label></td>
+ </tr>
+ </tfoot>
+</table>
+<p><input id="upgrade-plugins-2" class="button" type="submit" value="<?php esc_attr_e( 'Update Plugins' ); ?>" name="upgrade" /></p>
+</form>
+ <?php
+}
+
+/**
+ * @since 2.9.0
+ */
+function list_theme_updates() {
+ $themes = get_theme_updates();
+ if ( empty( $themes ) ) {
+ echo '<h2>' . __( 'Themes' ) . '</h2>';
+ echo '<p>' . __( 'Your themes are all up to date.' ) . '</p>';
+ return;
+ }
+
+ $form_action = 'update-core.php?action=do-theme-upgrade';
+ ?>
+<h2><?php _e( 'Themes' ); ?></h2>
+<p><?php _e( 'The following themes have new versions available. Check the ones you want to update and then click &#8220;Update Themes&#8221;.' ); ?></p>
+<p>
+ <?php
+ printf(
+ /* translators: %s: link to documentation on child themes */
+ __( '<strong>Please Note:</strong> Any customizations you have made to theme files will be lost. Please consider using <a href="%s">child themes</a> for modifications.' ),
+ __( 'https://developer.wordpress.org/themes/advanced-topics/child-themes/' )
+ );
+ ?>
+</p>
+<form method="post" action="<?php echo esc_url( $form_action ); ?>" name="upgrade-themes" class="upgrade">
+ <?php wp_nonce_field( 'upgrade-core' ); ?>
+<p><input id="upgrade-themes" class="button" type="submit" value="<?php esc_attr_e( 'Update Themes' ); ?>" name="upgrade" /></p>
+<table class="widefat updates-table" id="update-themes-table">
+ <thead>
+ <tr>
+ <td class="manage-column check-column"><input type="checkbox" id="themes-select-all" /></td>
+ <td class="manage-column"><label for="themes-select-all"><?php _e( 'Select All' ); ?></label></td>
+ </tr>
+ </thead>
+
+ <tbody class="plugins">
+ <?php
+ foreach ( $themes as $stylesheet => $theme ) {
+ $checkbox_id = 'checkbox_' . md5( $theme->get( 'Name' ) );
+ ?>
+ <tr>
+ <td class="check-column">
+ <input type="checkbox" name="checked[]" id="<?php echo $checkbox_id; ?>" value="<?php echo esc_attr( $stylesheet ); ?>" />
+ <label for="<?php echo $checkbox_id; ?>" class="screen-reader-text">
+ <?php
+ /* translators: %s: theme name */
+ printf(
+ __( 'Select %s' ),
+ $theme->display( 'Name' )
+ );
+ ?>
+ </label>
+ </td>
+ <td class="plugin-title"><p>
+ <img src="<?php echo esc_url( $theme->get_screenshot() ); ?>" width="85" height="64" class="updates-table-screenshot" alt="" />
+ <strong><?php echo $theme->display( 'Name' ); ?></strong>
+ <?php
+ /* translators: 1: theme version, 2: new version */
+ printf(
+ __( 'You have version %1$s installed. Update to %2$s.' ),
+ $theme->display( 'Version' ),
+ $theme->update['new_version']
+ );
+ ?>
+ </p></td>
+ </tr>
+ <?php
+ }
+ ?>
+ </tbody>
+
+ <tfoot>
+ <tr>
+ <td class="manage-column check-column"><input type="checkbox" id="themes-select-all-2" /></td>
+ <td class="manage-column"><label for="themes-select-all-2"><?php _e( 'Select All' ); ?></label></td>
+ </tr>
+ </tfoot>
+</table>
+<p><input id="upgrade-themes-2" class="button" type="submit" value="<?php esc_attr_e( 'Update Themes' ); ?>" name="upgrade" /></p>
+</form>
+ <?php
+}
+
+/**
+ * @since 3.7.0
+ */
+function list_translation_updates() {
+ $updates = wp_get_translation_updates();
+ if ( ! $updates ) {
+ if ( 'en_US' != get_locale() ) {
+ echo '<h2>' . __( 'Translations' ) . '</h2>';
+ echo '<p>' . __( 'Your translations are all up to date.' ) . '</p>';
+ }
+ return;
+ }
+
+ $form_action = 'update-core.php?action=do-translation-upgrade';
+ ?>
+ <h2><?php _e( 'Translations' ); ?></h2>
+ <form method="post" action="<?php echo esc_url( $form_action ); ?>" name="upgrade-translations" class="upgrade">
+ <p><?php _e( 'New translations are available.' ); ?></p>
+ <?php wp_nonce_field( 'upgrade-translations' ); ?>
+ <p><input class="button" type="submit" value="<?php esc_attr_e( 'Update Translations' ); ?>" name="upgrade" /></p>
+ </form>
+ <?php
+}
+
+/**
+ * Upgrade WordPress core display.
+ *
+ * @since 2.7.0
+ *
+ * @global WP_Filesystem_Base $wp_filesystem WordPress filesystem subclass.
+ *
+ * @param bool $reinstall
+ */
+function do_core_upgrade( $reinstall = false ) {
+ global $wp_filesystem;
+
+ include_once( ABSPATH . 'wp-admin/includes/class-wp-upgrader.php' );
+
+ if ( $reinstall ) {
+ $url = 'update-core.php?action=do-core-reinstall';
+ } else {
+ $url = 'update-core.php?action=do-core-upgrade';
+ }
+ $url = wp_nonce_url( $url, 'upgrade-core' );
+
+ $version = isset( $_POST['version'] ) ? $_POST['version'] : false;
+ $locale = isset( $_POST['locale'] ) ? $_POST['locale'] : 'en_US';
+ $update = find_core_update( $version, $locale );
+ if ( ! $update ) {
+ return;
+ }
+
+ // Allow relaxed file ownership writes for User-initiated upgrades when the API specifies
+ // that it's safe to do so. This only happens when there are no new files to create.
+ $allow_relaxed_file_ownership = ! $reinstall && isset( $update->new_files ) && ! $update->new_files;
+
+ ?>
+ <div class="wrap">
+ <h1><?php _e( 'Update WordPress' ); ?></h1>
+ <?php
+
+ if ( false === ( $credentials = request_filesystem_credentials( $url, '', false, ABSPATH, array( 'version', 'locale' ), $allow_relaxed_file_ownership ) ) ) {
+ echo '</div>';
+ return;
+ }
+
+ if ( ! WP_Filesystem( $credentials, ABSPATH, $allow_relaxed_file_ownership ) ) {
+ // Failed to connect, Error and request again
+ request_filesystem_credentials( $url, '', true, ABSPATH, array( 'version', 'locale' ), $allow_relaxed_file_ownership );
+ echo '</div>';
+ return;
+ }
+
+ if ( $wp_filesystem->errors->has_errors() ) {
+ foreach ( $wp_filesystem->errors->get_error_messages() as $message ) {
+ show_message( $message );
+ }
+ echo '</div>';
+ return;
+ }
+
+ if ( $reinstall ) {
+ $update->response = 'reinstall';
+ }
+
+ add_filter( 'update_feedback', 'show_message' );
+
+ $upgrader = new Core_Upgrader();
+ $result = $upgrader->upgrade(
+ $update,
+ array(
+ 'allow_relaxed_file_ownership' => $allow_relaxed_file_ownership,
+ )
+ );
+
+ if ( is_wp_error( $result ) ) {
+ show_message( $result );
+ if ( 'up_to_date' != $result->get_error_code() && 'locked' != $result->get_error_code() ) {
+ show_message( __( 'Installation Failed' ) );
+ }
+ echo '</div>';
+ return;
+ }
+
+ show_message( __( 'WordPress updated successfully' ) );
+ show_message( '<span class="hide-if-no-js">' . sprintf( __( 'Welcome to WordPress %1$s. You will be redirected to the About WordPress screen. If not, click <a href="%2$s">here</a>.' ), $result, esc_url( self_admin_url( 'about.php?updated' ) ) ) . '</span>' );
+ show_message( '<span class="hide-if-js">' . sprintf( __( 'Welcome to WordPress %1$s. <a href="%2$s">Learn more</a>.' ), $result, esc_url( self_admin_url( 'about.php?updated' ) ) ) . '</span>' );
+ ?>
+ </div>
+ <script type="text/javascript">
+ window.location = '<?php echo self_admin_url( 'about.php?updated' ); ?>';
+ </script>
+ <?php
+}
+
+/**
+ * @since 2.7.0
+ */
+function do_dismiss_core_update() {
+ $version = isset( $_POST['version'] ) ? $_POST['version'] : false;
+ $locale = isset( $_POST['locale'] ) ? $_POST['locale'] : 'en_US';
+ $update = find_core_update( $version, $locale );
+ if ( ! $update ) {
+ return;
+ }
+ dismiss_core_update( $update );
+ wp_redirect( wp_nonce_url( 'update-core.php?action=upgrade-core', 'upgrade-core' ) );
+ exit;
+}
+
+/**
+ * @since 2.7.0
+ */
+function do_undismiss_core_update() {
+ $version = isset( $_POST['version'] ) ? $_POST['version'] : false;
+ $locale = isset( $_POST['locale'] ) ? $_POST['locale'] : 'en_US';
+ $update = find_core_update( $version, $locale );
+ if ( ! $update ) {
+ return;
+ }
+ undismiss_core_update( $version, $locale );
+ wp_redirect( wp_nonce_url( 'update-core.php?action=upgrade-core', 'upgrade-core' ) );
+ exit;
+}
+
+$action = isset( $_GET['action'] ) ? $_GET['action'] : 'upgrade-core';
+
+$upgrade_error = false;
+if ( ( 'do-theme-upgrade' == $action || ( 'do-plugin-upgrade' == $action && ! isset( $_GET['plugins'] ) ) )
+ && ! isset( $_POST['checked'] ) ) {
+ $upgrade_error = $action == 'do-theme-upgrade' ? 'themes' : 'plugins';
+ $action = 'upgrade-core';
+}
+
+$title = __( 'WordPress Updates' );
+$parent_file = 'index.php';
+
+$updates_overview = '<p>' . __( 'On this screen, you can update to the latest version of WordPress, as well as update your themes, plugins, and translations from the WordPress.org repositories.' ) . '</p>';
+$updates_overview .= '<p>' . __( 'If an update is available, you&#8127;ll see a notification appear in the Toolbar and navigation menu.' ) . ' ' . __( 'Keeping your site updated is important for security. It also makes the internet a safer place for you and your readers.' ) . '</p>';
+
+get_current_screen()->add_help_tab(
+ array(
+ 'id' => 'overview',
+ 'title' => __( 'Overview' ),
+ 'content' => $updates_overview,
+ )
+);
+
+$updates_howto = '<p>' . __( '<strong>WordPress</strong> &mdash; Updating your WordPress installation is a simple one-click procedure: just <strong>click on the &#8220;Update Now&#8221; button</strong> when you are notified that a new version is available.' ) . ' ' . __( 'In most cases, WordPress will automatically apply maintenance and security updates in the background for you.' ) . '</p>';
+$updates_howto .= '<p>' . __( '<strong>Themes and Plugins</strong> &mdash; To update individual themes or plugins from this screen, use the checkboxes to make your selection, then <strong>click on the appropriate &#8220;Update&#8221; button</strong>. To update all of your themes or plugins at once, you can check the box at the top of the section to select all before clicking the update button.' ) . '</p>';
+
+if ( 'en_US' != get_locale() ) {
+ $updates_howto .= '<p>' . __( '<strong>Translations</strong> &mdash; The files translating WordPress into your language are updated for you whenever any other updates occur. But if these files are out of date, you can <strong>click the &#8220;Update Translations&#8221;</strong> button.' ) . '</p>';
+}
+
+get_current_screen()->add_help_tab(
+ array(
+ 'id' => 'how-to-update',
+ 'title' => __( 'How to Update' ),
+ 'content' => $updates_howto,
+ )
+);
+
+get_current_screen()->set_help_sidebar(
+ '<p><strong>' . __( 'For more information:' ) . '</strong></p>' .
+ '<p>' . __( '<a href="https://codex.wordpress.org/Dashboard_Updates_Screen">Documentation on Updating WordPress</a>' ) . '</p>' .
+ '<p>' . __( '<a href="https://wordpress.org/support/">Support</a>' ) . '</p>'
+);
+
+if ( 'upgrade-core' == $action ) {
+ // Force a update check when requested
+ $force_check = ! empty( $_GET['force-check'] );
+ wp_version_check( array(), $force_check );
+
+ require_once( ABSPATH . 'wp-admin/admin-header.php' );
+ ?>
+ <div class="wrap">
+ <h1><?php _e( 'WordPress Updates' ); ?></h1>
+ <?php
+ if ( $upgrade_error ) {
+ echo '<div class="error"><p>';
+ if ( $upgrade_error == 'themes' ) {
+ _e( 'Please select one or more themes to update.' );
+ } else {
+ _e( 'Please select one or more plugins to update.' );
+ }
+ echo '</p></div>';
+ }
+
+ $last_update_check = false;
+ $current = get_site_transient( 'update_core' );
+
+ if ( $current && isset( $current->last_checked ) ) {
+ $last_update_check = $current->last_checked + get_option( 'gmt_offset' ) * HOUR_IN_SECONDS;
+ }
+
+ echo '<p>';
+ /* translators: 1: date, 2: time */
+ printf( __( 'Last checked on %1$s at %2$s.' ), date_i18n( __( 'F j, Y' ), $last_update_check ), date_i18n( __( 'g:i a' ), $last_update_check ) );
+ echo ' &nbsp; <a class="button" href="' . esc_url( self_admin_url( 'update-core.php?force-check=1' ) ) . '">' . __( 'Check Again' ) . '</a>';
+ echo '</p>';
+
+ if ( current_user_can( 'update_core' ) ) {
+ core_upgrade_preamble();
+ }
+ if ( current_user_can( 'update_plugins' ) ) {
+ list_plugin_updates();
+ }
+ if ( current_user_can( 'update_themes' ) ) {
+ list_theme_updates();
+ }
+ if ( current_user_can( 'update_languages' ) ) {
+ list_translation_updates();
+ }
+
+ /**
+ * Fires after the core, plugin, and theme update tables.
+ *
+ * @since 2.9.0
+ */
+ do_action( 'core_upgrade_preamble' );
+ echo '</div>';
+
+ wp_localize_script(
+ 'updates',
+ '_wpUpdatesItemCounts',
+ array(
+ 'totals' => wp_get_update_data(),
+ )
+ );
+
+ include( ABSPATH . 'wp-admin/admin-footer.php' );
+
+} elseif ( 'do-core-upgrade' == $action || 'do-core-reinstall' == $action ) {
+
+ if ( ! current_user_can( 'update_core' ) ) {
+ wp_die( __( 'Sorry, you are not allowed to update this site.' ) );
+ }
+
+ check_admin_referer( 'upgrade-core' );
+
+ // Do the (un)dismiss actions before headers, so that they can redirect.
+ if ( isset( $_POST['dismiss'] ) ) {
+ do_dismiss_core_update();
+ } elseif ( isset( $_POST['undismiss'] ) ) {
+ do_undismiss_core_update();
+ }
+
+ require_once( ABSPATH . 'wp-admin/admin-header.php' );
+ if ( 'do-core-reinstall' == $action ) {
+ $reinstall = true;
+ } else {
+ $reinstall = false;
+ }
+
+ if ( isset( $_POST['upgrade'] ) ) {
+ do_core_upgrade( $reinstall );
+ }
+
+ wp_localize_script(
+ 'updates',
+ '_wpUpdatesItemCounts',
+ array(
+ 'totals' => wp_get_update_data(),
+ )
+ );
+
+ include( ABSPATH . 'wp-admin/admin-footer.php' );
+
+} elseif ( 'do-plugin-upgrade' == $action ) {
+
+ if ( ! current_user_can( 'update_plugins' ) ) {
+ wp_die( __( 'Sorry, you are not allowed to update this site.' ) );
+ }
+
+ check_admin_referer( 'upgrade-core' );
+
+ if ( isset( $_GET['plugins'] ) ) {
+ $plugins = explode( ',', $_GET['plugins'] );
+ } elseif ( isset( $_POST['checked'] ) ) {
+ $plugins = (array) $_POST['checked'];
+ } else {
+ wp_redirect( admin_url( 'update-core.php' ) );
+ exit;
+ }
+
+ $url = 'update.php?action=update-selected&plugins=' . urlencode( implode( ',', $plugins ) );
+ $url = wp_nonce_url( $url, 'bulk-update-plugins' );
+
+ $title = __( 'Update Plugins' );
+
+ require_once( ABSPATH . 'wp-admin/admin-header.php' );
+ echo '<div class="wrap">';
+ echo '<h1>' . __( 'Update Plugins' ) . '</h1>';
+ echo '<iframe src="', $url, '" style="width: 100%; height: 100%; min-height: 750px;" frameborder="0" title="' . esc_attr__( 'Update progress' ) . '"></iframe>';
+ echo '</div>';
+
+ wp_localize_script(
+ 'updates',
+ '_wpUpdatesItemCounts',
+ array(
+ 'totals' => wp_get_update_data(),
+ )
+ );
+
+ include( ABSPATH . 'wp-admin/admin-footer.php' );
+
+} elseif ( 'do-theme-upgrade' == $action ) {
+
+ if ( ! current_user_can( 'update_themes' ) ) {
+ wp_die( __( 'Sorry, you are not allowed to update this site.' ) );
+ }
+
+ check_admin_referer( 'upgrade-core' );
+
+ if ( isset( $_GET['themes'] ) ) {
+ $themes = explode( ',', $_GET['themes'] );
+ } elseif ( isset( $_POST['checked'] ) ) {
+ $themes = (array) $_POST['checked'];
+ } else {
+ wp_redirect( admin_url( 'update-core.php' ) );
+ exit;
+ }
+
+ $url = 'update.php?action=update-selected-themes&themes=' . urlencode( implode( ',', $themes ) );
+ $url = wp_nonce_url( $url, 'bulk-update-themes' );
+
+ $title = __( 'Update Themes' );
+
+ require_once( ABSPATH . 'wp-admin/admin-header.php' );
+ ?>
+ <div class="wrap">
+ <h1><?php _e( 'Update Themes' ); ?></h1>
+ <iframe src="<?php echo $url; ?>" style="width: 100%; height: 100%; min-height: 750px;" frameborder="0" title="<?php esc_attr_e( 'Update progress' ); ?>"></iframe>
+ </div>
+ <?php
+
+ wp_localize_script(
+ 'updates',
+ '_wpUpdatesItemCounts',
+ array(
+ 'totals' => wp_get_update_data(),
+ )
+ );
+
+ include( ABSPATH . 'wp-admin/admin-footer.php' );
+
+} elseif ( 'do-translation-upgrade' == $action ) {
+
+ if ( ! current_user_can( 'update_languages' ) ) {
+ wp_die( __( 'Sorry, you are not allowed to update this site.' ) );
+ }
+
+ check_admin_referer( 'upgrade-translations' );
+
+ require_once( ABSPATH . 'wp-admin/admin-header.php' );
+ include_once( ABSPATH . 'wp-admin/includes/class-wp-upgrader.php' );
+
+ $url = 'update-core.php?action=do-translation-upgrade';
+ $nonce = 'upgrade-translations';
+ $title = __( 'Update Translations' );
+ $context = WP_LANG_DIR;
+
+ $upgrader = new Language_Pack_Upgrader( new Language_Pack_Upgrader_Skin( compact( 'url', 'nonce', 'title', 'context' ) ) );
+ $result = $upgrader->bulk_upgrade();
+
+ wp_localize_script(
+ 'updates',
+ '_wpUpdatesItemCounts',
+ array(
+ 'totals' => wp_get_update_data(),
+ )
+ );
+
+ require_once( ABSPATH . 'wp-admin/admin-footer.php' );
+
+} else {
+ /**
+ * Fires for each custom update action on the WordPress Updates screen.
+ *
+ * The dynamic portion of the hook name, `$action`, refers to the
+ * passed update action. The hook fires in lieu of all available
+ * default update actions.
+ *
+ * @since 3.2.0
+ */
+ do_action( "update-core-custom_{$action}" );
+}
diff --git a/www/crm/wp-admin/update.php b/www/crm/wp-admin/update.php
new file mode 100644
index 00000000..556ff6e1
--- /dev/null
+++ b/www/crm/wp-admin/update.php
@@ -0,0 +1,300 @@
+<?php
+/**
+ * Update/Install Plugin/Theme administration panel.
+ *
+ * @package WordPress
+ * @subpackage Administration
+ */
+
+if ( ! defined( 'IFRAME_REQUEST' ) && isset( $_GET['action'] ) && in_array( $_GET['action'], array( 'update-selected', 'activate-plugin', 'update-selected-themes' ) ) ) {
+ define( 'IFRAME_REQUEST', true );
+}
+
+/** WordPress Administration Bootstrap */
+require_once( dirname( __FILE__ ) . '/admin.php' );
+
+include_once( ABSPATH . 'wp-admin/includes/class-wp-upgrader.php' );
+
+if ( isset( $_GET['action'] ) ) {
+ $plugin = isset( $_REQUEST['plugin'] ) ? trim( $_REQUEST['plugin'] ) : '';
+ $theme = isset( $_REQUEST['theme'] ) ? urldecode( $_REQUEST['theme'] ) : '';
+ $action = isset( $_REQUEST['action'] ) ? $_REQUEST['action'] : '';
+
+ if ( 'update-selected' == $action ) {
+ if ( ! current_user_can( 'update_plugins' ) ) {
+ wp_die( __( 'Sorry, you are not allowed to update plugins for this site.' ) );
+ }
+
+ check_admin_referer( 'bulk-update-plugins' );
+
+ if ( isset( $_GET['plugins'] ) ) {
+ $plugins = explode( ',', stripslashes( $_GET['plugins'] ) );
+ } elseif ( isset( $_POST['checked'] ) ) {
+ $plugins = (array) $_POST['checked'];
+ } else {
+ $plugins = array();
+ }
+
+ $plugins = array_map( 'urldecode', $plugins );
+
+ $url = 'update.php?action=update-selected&amp;plugins=' . urlencode( implode( ',', $plugins ) );
+ $nonce = 'bulk-update-plugins';
+
+ wp_enqueue_script( 'updates' );
+ iframe_header();
+
+ $upgrader = new Plugin_Upgrader( new Bulk_Plugin_Upgrader_Skin( compact( 'nonce', 'url' ) ) );
+ $upgrader->bulk_upgrade( $plugins );
+
+ iframe_footer();
+
+ } elseif ( 'upgrade-plugin' == $action ) {
+ if ( ! current_user_can( 'update_plugins' ) ) {
+ wp_die( __( 'Sorry, you are not allowed to update plugins for this site.' ) );
+ }
+
+ check_admin_referer( 'upgrade-plugin_' . $plugin );
+
+ $title = __( 'Update Plugin' );
+ $parent_file = 'plugins.php';
+ $submenu_file = 'plugins.php';
+
+ wp_enqueue_script( 'updates' );
+ require_once( ABSPATH . 'wp-admin/admin-header.php' );
+
+ $nonce = 'upgrade-plugin_' . $plugin;
+ $url = 'update.php?action=upgrade-plugin&plugin=' . urlencode( $plugin );
+
+ $upgrader = new Plugin_Upgrader( new Plugin_Upgrader_Skin( compact( 'title', 'nonce', 'url', 'plugin' ) ) );
+ $upgrader->upgrade( $plugin );
+
+ include( ABSPATH . 'wp-admin/admin-footer.php' );
+
+ } elseif ( 'activate-plugin' == $action ) {
+ if ( ! current_user_can( 'update_plugins' ) ) {
+ wp_die( __( 'Sorry, you are not allowed to update plugins for this site.' ) );
+ }
+
+ check_admin_referer( 'activate-plugin_' . $plugin );
+ if ( ! isset( $_GET['failure'] ) && ! isset( $_GET['success'] ) ) {
+ wp_redirect( admin_url( 'update.php?action=activate-plugin&failure=true&plugin=' . urlencode( $plugin ) . '&_wpnonce=' . $_GET['_wpnonce'] ) );
+ activate_plugin( $plugin, '', ! empty( $_GET['networkwide'] ), true );
+ wp_redirect( admin_url( 'update.php?action=activate-plugin&success=true&plugin=' . urlencode( $plugin ) . '&_wpnonce=' . $_GET['_wpnonce'] ) );
+ die();
+ }
+ iframe_header( __( 'Plugin Reactivation' ), true );
+ if ( isset( $_GET['success'] ) ) {
+ echo '<p>' . __( 'Plugin reactivated successfully.' ) . '</p>';
+ }
+
+ if ( isset( $_GET['failure'] ) ) {
+ echo '<p>' . __( 'Plugin failed to reactivate due to a fatal error.' ) . '</p>';
+
+ error_reporting( E_CORE_ERROR | E_CORE_WARNING | E_COMPILE_ERROR | E_ERROR | E_WARNING | E_PARSE | E_USER_ERROR | E_USER_WARNING | E_RECOVERABLE_ERROR );
+ @ini_set( 'display_errors', true ); //Ensure that Fatal errors are displayed.
+ wp_register_plugin_realpath( WP_PLUGIN_DIR . '/' . $plugin );
+ include( WP_PLUGIN_DIR . '/' . $plugin );
+ }
+ iframe_footer();
+ } elseif ( 'install-plugin' == $action ) {
+
+ if ( ! current_user_can( 'install_plugins' ) ) {
+ wp_die( __( 'Sorry, you are not allowed to install plugins on this site.' ) );
+ }
+
+ include_once( ABSPATH . 'wp-admin/includes/plugin-install.php' ); //for plugins_api..
+
+ check_admin_referer( 'install-plugin_' . $plugin );
+ $api = plugins_api(
+ 'plugin_information',
+ array(
+ 'slug' => $plugin,
+ 'fields' => array(
+ 'sections' => false,
+ ),
+ )
+ );
+
+ if ( is_wp_error( $api ) ) {
+ wp_die( $api );
+ }
+
+ $title = __( 'Plugin Installation' );
+ $parent_file = 'plugins.php';
+ $submenu_file = 'plugin-install.php';
+ require_once( ABSPATH . 'wp-admin/admin-header.php' );
+
+ $title = sprintf( __( 'Installing Plugin: %s' ), $api->name . ' ' . $api->version );
+ $nonce = 'install-plugin_' . $plugin;
+ $url = 'update.php?action=install-plugin&plugin=' . urlencode( $plugin );
+ if ( isset( $_GET['from'] ) ) {
+ $url .= '&from=' . urlencode( stripslashes( $_GET['from'] ) );
+ }
+
+ $type = 'web'; //Install plugin type, From Web or an Upload.
+
+ $upgrader = new Plugin_Upgrader( new Plugin_Installer_Skin( compact( 'title', 'url', 'nonce', 'plugin', 'api' ) ) );
+ $upgrader->install( $api->download_link );
+
+ include( ABSPATH . 'wp-admin/admin-footer.php' );
+
+ } elseif ( 'upload-plugin' == $action ) {
+
+ if ( ! current_user_can( 'upload_plugins' ) ) {
+ wp_die( __( 'Sorry, you are not allowed to install plugins on this site.' ) );
+ }
+
+ check_admin_referer( 'plugin-upload' );
+
+ $file_upload = new File_Upload_Upgrader( 'pluginzip', 'package' );
+
+ $title = __( 'Upload Plugin' );
+ $parent_file = 'plugins.php';
+ $submenu_file = 'plugin-install.php';
+ require_once( ABSPATH . 'wp-admin/admin-header.php' );
+
+ $title = sprintf( __( 'Installing Plugin from uploaded file: %s' ), esc_html( basename( $file_upload->filename ) ) );
+ $nonce = 'plugin-upload';
+ $url = add_query_arg( array( 'package' => $file_upload->id ), 'update.php?action=upload-plugin' );
+ $type = 'upload'; //Install plugin type, From Web or an Upload.
+
+ $upgrader = new Plugin_Upgrader( new Plugin_Installer_Skin( compact( 'type', 'title', 'nonce', 'url' ) ) );
+ $result = $upgrader->install( $file_upload->package );
+
+ if ( $result || is_wp_error( $result ) ) {
+ $file_upload->cleanup();
+ }
+
+ include( ABSPATH . 'wp-admin/admin-footer.php' );
+
+ } elseif ( 'upgrade-theme' == $action ) {
+
+ if ( ! current_user_can( 'update_themes' ) ) {
+ wp_die( __( 'Sorry, you are not allowed to update themes for this site.' ) );
+ }
+
+ check_admin_referer( 'upgrade-theme_' . $theme );
+
+ wp_enqueue_script( 'updates' );
+
+ $title = __( 'Update Theme' );
+ $parent_file = 'themes.php';
+ $submenu_file = 'themes.php';
+ require_once( ABSPATH . 'wp-admin/admin-header.php' );
+
+ $nonce = 'upgrade-theme_' . $theme;
+ $url = 'update.php?action=upgrade-theme&theme=' . urlencode( $theme );
+
+ $upgrader = new Theme_Upgrader( new Theme_Upgrader_Skin( compact( 'title', 'nonce', 'url', 'theme' ) ) );
+ $upgrader->upgrade( $theme );
+
+ include( ABSPATH . 'wp-admin/admin-footer.php' );
+ } elseif ( 'update-selected-themes' == $action ) {
+ if ( ! current_user_can( 'update_themes' ) ) {
+ wp_die( __( 'Sorry, you are not allowed to update themes for this site.' ) );
+ }
+
+ check_admin_referer( 'bulk-update-themes' );
+
+ if ( isset( $_GET['themes'] ) ) {
+ $themes = explode( ',', stripslashes( $_GET['themes'] ) );
+ } elseif ( isset( $_POST['checked'] ) ) {
+ $themes = (array) $_POST['checked'];
+ } else {
+ $themes = array();
+ }
+
+ $themes = array_map( 'urldecode', $themes );
+
+ $url = 'update.php?action=update-selected-themes&amp;themes=' . urlencode( implode( ',', $themes ) );
+ $nonce = 'bulk-update-themes';
+
+ wp_enqueue_script( 'updates' );
+ iframe_header();
+
+ $upgrader = new Theme_Upgrader( new Bulk_Theme_Upgrader_Skin( compact( 'nonce', 'url' ) ) );
+ $upgrader->bulk_upgrade( $themes );
+
+ iframe_footer();
+ } elseif ( 'install-theme' == $action ) {
+
+ if ( ! current_user_can( 'install_themes' ) ) {
+ wp_die( __( 'Sorry, you are not allowed to install themes on this site.' ) );
+ }
+
+ include_once( ABSPATH . 'wp-admin/includes/class-wp-upgrader.php' ); //for themes_api..
+
+ check_admin_referer( 'install-theme_' . $theme );
+ $api = themes_api(
+ 'theme_information',
+ array(
+ 'slug' => $theme,
+ 'fields' => array(
+ 'sections' => false,
+ 'tags' => false,
+ ),
+ )
+ ); //Save on a bit of bandwidth.
+
+ if ( is_wp_error( $api ) ) {
+ wp_die( $api );
+ }
+
+ $title = __( 'Install Themes' );
+ $parent_file = 'themes.php';
+ $submenu_file = 'themes.php';
+ require_once( ABSPATH . 'wp-admin/admin-header.php' );
+
+ $title = sprintf( __( 'Installing Theme: %s' ), $api->name . ' ' . $api->version );
+ $nonce = 'install-theme_' . $theme;
+ $url = 'update.php?action=install-theme&theme=' . urlencode( $theme );
+ $type = 'web'; //Install theme type, From Web or an Upload.
+
+ $upgrader = new Theme_Upgrader( new Theme_Installer_Skin( compact( 'title', 'url', 'nonce', 'plugin', 'api' ) ) );
+ $upgrader->install( $api->download_link );
+
+ include( ABSPATH . 'wp-admin/admin-footer.php' );
+
+ } elseif ( 'upload-theme' == $action ) {
+
+ if ( ! current_user_can( 'upload_themes' ) ) {
+ wp_die( __( 'Sorry, you are not allowed to install themes on this site.' ) );
+ }
+
+ check_admin_referer( 'theme-upload' );
+
+ $file_upload = new File_Upload_Upgrader( 'themezip', 'package' );
+
+ $title = __( 'Upload Theme' );
+ $parent_file = 'themes.php';
+ $submenu_file = 'theme-install.php';
+
+ require_once( ABSPATH . 'wp-admin/admin-header.php' );
+
+ $title = sprintf( __( 'Installing Theme from uploaded file: %s' ), esc_html( basename( $file_upload->filename ) ) );
+ $nonce = 'theme-upload';
+ $url = add_query_arg( array( 'package' => $file_upload->id ), 'update.php?action=upload-theme' );
+ $type = 'upload'; //Install plugin type, From Web or an Upload.
+
+ $upgrader = new Theme_Upgrader( new Theme_Installer_Skin( compact( 'type', 'title', 'nonce', 'url' ) ) );
+ $result = $upgrader->install( $file_upload->package );
+
+ if ( $result || is_wp_error( $result ) ) {
+ $file_upload->cleanup();
+ }
+
+ include( ABSPATH . 'wp-admin/admin-footer.php' );
+
+ } else {
+ /**
+ * Fires when a custom plugin or theme update request is received.
+ *
+ * The dynamic portion of the hook name, `$action`, refers to the action
+ * provided in the request for wp-admin/update.php. Can be used to
+ * provide custom update functionality for themes and plugins.
+ *
+ * @since 2.8.0
+ */
+ do_action( "update-custom_{$action}" );
+ }
+}
diff --git a/www/crm/wp-admin/upgrade-functions.php b/www/crm/wp-admin/upgrade-functions.php
new file mode 100644
index 00000000..0669ead7
--- /dev/null
+++ b/www/crm/wp-admin/upgrade-functions.php
@@ -0,0 +1,12 @@
+<?php
+/**
+ * WordPress Upgrade Functions. Old file, must not be used. Include
+ * wp-admin/includes/upgrade.php instead.
+ *
+ * @deprecated 2.5.0
+ * @package WordPress
+ * @subpackage Administration
+ */
+
+_deprecated_file( basename( __FILE__ ), '2.5.0', 'wp-admin/includes/upgrade.php' );
+require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
diff --git a/www/crm/wp-admin/upgrade.php b/www/crm/wp-admin/upgrade.php
new file mode 100644
index 00000000..2047c168
--- /dev/null
+++ b/www/crm/wp-admin/upgrade.php
@@ -0,0 +1,150 @@
+<?php
+/**
+ * Upgrade WordPress Page.
+ *
+ * @package WordPress
+ * @subpackage Administration
+ */
+
+/**
+ * We are upgrading WordPress.
+ *
+ * @since 1.5.1
+ * @var bool
+ */
+define( 'WP_INSTALLING', true );
+
+/** Load WordPress Bootstrap */
+require( dirname( dirname( __FILE__ ) ) . '/wp-load.php' );
+
+nocache_headers();
+
+timer_start();
+require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
+
+delete_site_transient( 'update_core' );
+
+if ( isset( $_GET['step'] ) ) {
+ $step = $_GET['step'];
+} else {
+ $step = 0;
+}
+
+// Do it. No output.
+if ( 'upgrade_db' === $step ) {
+ wp_upgrade();
+ die( '0' );
+}
+
+/**
+ * @global string $wp_version
+ * @global string $required_php_version
+ * @global string $required_mysql_version
+ */
+global $wp_version, $required_php_version, $required_mysql_version;
+
+$step = (int) $step;
+
+$php_version = phpversion();
+$mysql_version = $wpdb->db_version();
+$php_compat = version_compare( $php_version, $required_php_version, '>=' );
+if ( file_exists( WP_CONTENT_DIR . '/db.php' ) && empty( $wpdb->is_mysql ) ) {
+ $mysql_compat = true;
+} else {
+ $mysql_compat = version_compare( $mysql_version, $required_mysql_version, '>=' );
+}
+
+@header( 'Content-Type: ' . get_option( 'html_type' ) . '; charset=' . get_option( 'blog_charset' ) );
+?>
+<!DOCTYPE html>
+<html xmlns="http://www.w3.org/1999/xhtml" <?php language_attributes(); ?>>
+<head>
+ <meta name="viewport" content="width=device-width" />
+ <meta http-equiv="Content-Type" content="<?php bloginfo( 'html_type' ); ?>; charset=<?php echo get_option( 'blog_charset' ); ?>" />
+ <meta name="robots" content="noindex,nofollow" />
+ <title><?php _e( 'WordPress &rsaquo; Update' ); ?></title>
+ <?php
+ wp_admin_css( 'install', true );
+ wp_admin_css( 'ie', true );
+ ?>
+</head>
+<body class="wp-core-ui">
+<p id="logo"><a href="<?php echo esc_url( __( 'https://wordpress.org/' ) ); ?>"><?php _e( 'WordPress' ); ?></a></p>
+
+<?php if ( get_option( 'db_version' ) == $wp_db_version || ! is_blog_installed() ) : ?>
+
+<h1><?php _e( 'No Update Required' ); ?></h1>
+<p><?php _e( 'Your WordPress database is already up-to-date!' ); ?></p>
+<p class="step"><a class="button button-large" href="<?php echo get_option( 'home' ); ?>/"><?php _e( 'Continue' ); ?></a></p>
+
+ <?php
+elseif ( ! $php_compat || ! $mysql_compat ) :
+ $version_url = sprintf(
+ /* translators: %s: WordPress version */
+ esc_url( __( 'https://wordpress.org/support/wordpress-version/version-%s/' ) ),
+ sanitize_title( $wp_version )
+ );
+
+ /* translators: %s: Update PHP page URL */
+ $php_update_message = '</p><p>' . sprintf( __( '<a href="%s">Learn more about updating PHP</a>.' ), esc_url( wp_get_update_php_url() ) );
+
+ $annotation = wp_get_update_php_annotation();
+ if ( $annotation ) {
+ $php_update_message .= '</p><p><em>' . $annotation . '</em>';
+ }
+
+ if ( ! $mysql_compat && ! $php_compat ) {
+ /* translators: 1: URL to WordPress release notes, 2: WordPress version number, 3: Minimum required PHP version number, 4: Minimum required MySQL version number, 5: Current PHP version number, 6: Current MySQL version number */
+ $message = sprintf( __( 'You cannot update because <a href="%1$s">WordPress %2$s</a> requires PHP version %3$s or higher and MySQL version %4$s or higher. You are running PHP version %5$s and MySQL version %6$s.' ), $version_url, $wp_version, $required_php_version, $required_mysql_version, $php_version, $mysql_version ) . $php_update_message;
+ } elseif ( ! $php_compat ) {
+ /* translators: 1: URL to WordPress release notes, 2: WordPress version number, 3: Minimum required PHP version number, 4: Current PHP version number */
+ $message = sprintf( __( 'You cannot update because <a href="%1$s">WordPress %2$s</a> requires PHP version %3$s or higher. You are running version %4$s.' ), $version_url, $wp_version, $required_php_version, $php_version ) . $php_update_message;
+ } elseif ( ! $mysql_compat ) {
+ /* translators: 1: URL to WordPress release notes, 2: WordPress version number, 3: Minimum required MySQL version number, 4: Current MySQL version number */
+ $message = sprintf( __( 'You cannot update because <a href="%1$s">WordPress %2$s</a> requires MySQL version %3$s or higher. You are running version %4$s.' ), $version_url, $wp_version, $required_mysql_version, $mysql_version );
+ }
+
+ echo '<p>' . $message . '</p>';
+ ?>
+ <?php
+else :
+ switch ( $step ) :
+ case 0:
+ $goback = wp_get_referer();
+ if ( $goback ) {
+ $goback = esc_url_raw( $goback );
+ $goback = urlencode( $goback );
+ }
+ ?>
+ <h1><?php _e( 'Database Update Required' ); ?></h1>
+<p><?php _e( 'WordPress has been updated! Before we send you on your way, we have to update your database to the newest version.' ); ?></p>
+<p><?php _e( 'The database update process may take a little while, so please be patient.' ); ?></p>
+<p class="step"><a class="button button-large button-primary" href="upgrade.php?step=1&amp;backto=<?php echo $goback; ?>"><?php _e( 'Update WordPress Database' ); ?></a></p>
+ <?php
+ break;
+ case 1:
+ wp_upgrade();
+
+ $backto = ! empty( $_GET['backto'] ) ? wp_unslash( urldecode( $_GET['backto'] ) ) : __get_option( 'home' ) . '/';
+ $backto = esc_url( $backto );
+ $backto = wp_validate_redirect( $backto, __get_option( 'home' ) . '/' );
+ ?>
+ <h1><?php _e( 'Update Complete' ); ?></h1>
+ <p><?php _e( 'Your WordPress database has been successfully updated!' ); ?></p>
+ <p class="step"><a class="button button-large" href="<?php echo $backto; ?>"><?php _e( 'Continue' ); ?></a></p>
+
+<!--
+<pre>
+ <?php printf( __( '%s queries' ), $wpdb->num_queries ); ?>
+
+ <?php printf( __( '%s seconds' ), timer_stop( 0 ) ); ?>
+</pre>
+-->
+
+ <?php
+ break;
+endswitch;
+endif;
+?>
+</body>
+</html>
diff --git a/www/crm/wp-admin/upload.php b/www/crm/wp-admin/upload.php
new file mode 100644
index 00000000..c2c59c7f
--- /dev/null
+++ b/www/crm/wp-admin/upload.php
@@ -0,0 +1,373 @@
+<?php
+/**
+ * Media Library administration panel.
+ *
+ * @package WordPress
+ * @subpackage Administration
+ */
+
+/** WordPress Administration Bootstrap */
+require_once( dirname( __FILE__ ) . '/admin.php' );
+
+if ( ! current_user_can( 'upload_files' ) ) {
+ wp_die( __( 'Sorry, you are not allowed to upload files.' ) );
+}
+
+$mode = get_user_option( 'media_library_mode', get_current_user_id() ) ? get_user_option( 'media_library_mode', get_current_user_id() ) : 'grid';
+$modes = array( 'grid', 'list' );
+
+if ( isset( $_GET['mode'] ) && in_array( $_GET['mode'], $modes ) ) {
+ $mode = $_GET['mode'];
+ update_user_option( get_current_user_id(), 'media_library_mode', $mode );
+}
+
+if ( 'grid' === $mode ) {
+ wp_enqueue_media();
+ wp_enqueue_script( 'media-grid' );
+ wp_enqueue_script( 'media' );
+
+ remove_action( 'admin_head', 'wp_admin_canonical_url' );
+
+ $q = $_GET;
+ // let JS handle this
+ unset( $q['s'] );
+ $vars = wp_edit_attachments_query_vars( $q );
+ $ignore = array( 'mode', 'post_type', 'post_status', 'posts_per_page' );
+ foreach ( $vars as $key => $value ) {
+ if ( ! $value || in_array( $key, $ignore ) ) {
+ unset( $vars[ $key ] );
+ }
+ }
+
+ wp_localize_script(
+ 'media-grid',
+ '_wpMediaGridSettings',
+ array(
+ 'adminUrl' => parse_url( self_admin_url(), PHP_URL_PATH ),
+ 'queryVars' => (object) $vars,
+ )
+ );
+
+ get_current_screen()->add_help_tab(
+ array(
+ 'id' => 'overview',
+ 'title' => __( 'Overview' ),
+ 'content' =>
+ '<p>' . __( 'All the files you&#8217;ve uploaded are listed in the Media Library, with the most recent uploads listed first.' ) . '</p>' .
+ '<p>' . __( 'You can view your media in a simple visual grid or a list with columns. Switch between these views using the icons to the left above the media.' ) . '</p>' .
+ '<p>' . __( 'To delete media items, click the Bulk Select button at the top of the screen. Select any items you wish to delete, then click the Delete Selected button. Clicking the Cancel Selection button takes you back to viewing your media.' ) . '</p>',
+ )
+ );
+
+ get_current_screen()->add_help_tab(
+ array(
+ 'id' => 'attachment-details',
+ 'title' => __( 'Attachment Details' ),
+ 'content' =>
+ '<p>' . __( 'Clicking an item will display an Attachment Details dialog, which allows you to preview media and make quick edits. Any changes you make to the attachment details will be automatically saved.' ) . '</p>' .
+ '<p>' . __( 'Use the arrow buttons at the top of the dialog, or the left and right arrow keys on your keyboard, to navigate between media items quickly.' ) . '</p>' .
+ '<p>' . __( 'You can also delete individual items and access the extended edit screen from the details dialog.' ) . '</p>',
+ )
+ );
+
+ get_current_screen()->set_help_sidebar(
+ '<p><strong>' . __( 'For more information:' ) . '</strong></p>' .
+ '<p>' . __( '<a href="https://codex.wordpress.org/Media_Library_Screen">Documentation on Media Library</a>' ) . '</p>' .
+ '<p>' . __( '<a href="https://wordpress.org/support/">Support</a>' ) . '</p>'
+ );
+
+ $title = __( 'Media Library' );
+ $parent_file = 'upload.php';
+
+ require_once( ABSPATH . 'wp-admin/admin-header.php' );
+ ?>
+ <div class="wrap" id="wp-media-grid" data-search="<?php _admin_search_query(); ?>">
+ <h1 class="wp-heading-inline"><?php echo esc_html( $title ); ?></h1>
+
+ <?php
+ if ( current_user_can( 'upload_files' ) ) {
+ ?>
+ <a href="<?php echo admin_url( 'media-new.php' ); ?>" class="page-title-action aria-button-if-js"><?php echo esc_html_x( 'Add New', 'file' ); ?></a>
+ <?php
+ }
+ ?>
+
+ <hr class="wp-header-end">
+
+ <div class="error hide-if-js">
+ <p>
+ <?php
+ printf(
+ /* translators: %s: list view URL */
+ __( 'The grid view for the Media Library requires JavaScript. <a href="%s">Switch to the list view</a>.' ),
+ 'upload.php?mode=list'
+ );
+ ?>
+ </p>
+ </div>
+ </div>
+ <?php
+ include( ABSPATH . 'wp-admin/admin-footer.php' );
+ exit;
+}
+
+$wp_list_table = _get_list_table( 'WP_Media_List_Table' );
+$pagenum = $wp_list_table->get_pagenum();
+
+// Handle bulk actions
+$doaction = $wp_list_table->current_action();
+
+if ( $doaction ) {
+ check_admin_referer( 'bulk-media' );
+
+ if ( 'delete_all' == $doaction ) {
+ $post_ids = $wpdb->get_col( "SELECT ID FROM $wpdb->posts WHERE post_type='attachment' AND post_status = 'trash'" );
+ $doaction = 'delete';
+ } elseif ( isset( $_REQUEST['media'] ) ) {
+ $post_ids = $_REQUEST['media'];
+ } elseif ( isset( $_REQUEST['ids'] ) ) {
+ $post_ids = explode( ',', $_REQUEST['ids'] );
+ }
+
+ $location = 'upload.php';
+ if ( $referer = wp_get_referer() ) {
+ if ( false !== strpos( $referer, 'upload.php' ) ) {
+ $location = remove_query_arg( array( 'trashed', 'untrashed', 'deleted', 'message', 'ids', 'posted' ), $referer );
+ }
+ }
+
+ switch ( $doaction ) {
+ case 'detach':
+ wp_media_attach_action( $_REQUEST['parent_post_id'], 'detach' );
+ break;
+
+ case 'attach':
+ wp_media_attach_action( $_REQUEST['found_post_id'] );
+ break;
+
+ case 'trash':
+ if ( ! isset( $post_ids ) ) {
+ break;
+ }
+ foreach ( (array) $post_ids as $post_id ) {
+ if ( ! current_user_can( 'delete_post', $post_id ) ) {
+ wp_die( __( 'Sorry, you are not allowed to move this item to the Trash.' ) );
+ }
+
+ if ( ! wp_trash_post( $post_id ) ) {
+ wp_die( __( 'Error in moving to Trash.' ) );
+ }
+ }
+ $location = add_query_arg(
+ array(
+ 'trashed' => count( $post_ids ),
+ 'ids' => join( ',', $post_ids ),
+ ),
+ $location
+ );
+ break;
+ case 'untrash':
+ if ( ! isset( $post_ids ) ) {
+ break;
+ }
+ foreach ( (array) $post_ids as $post_id ) {
+ if ( ! current_user_can( 'delete_post', $post_id ) ) {
+ wp_die( __( 'Sorry, you are not allowed to restore this item from the Trash.' ) );
+ }
+
+ if ( ! wp_untrash_post( $post_id ) ) {
+ wp_die( __( 'Error in restoring from Trash.' ) );
+ }
+ }
+ $location = add_query_arg( 'untrashed', count( $post_ids ), $location );
+ break;
+ case 'delete':
+ if ( ! isset( $post_ids ) ) {
+ break;
+ }
+ foreach ( (array) $post_ids as $post_id_del ) {
+ if ( ! current_user_can( 'delete_post', $post_id_del ) ) {
+ wp_die( __( 'Sorry, you are not allowed to delete this item.' ) );
+ }
+
+ if ( ! wp_delete_attachment( $post_id_del ) ) {
+ wp_die( __( 'Error in deleting.' ) );
+ }
+ }
+ $location = add_query_arg( 'deleted', count( $post_ids ), $location );
+ break;
+ default:
+ /** This action is documented in wp-admin/edit-comments.php */
+ $location = apply_filters( 'handle_bulk_actions-' . get_current_screen()->id, $location, $doaction, $post_ids );
+ }
+
+ wp_redirect( $location );
+ exit;
+} elseif ( ! empty( $_GET['_wp_http_referer'] ) ) {
+ wp_redirect( remove_query_arg( array( '_wp_http_referer', '_wpnonce' ), wp_unslash( $_SERVER['REQUEST_URI'] ) ) );
+ exit;
+}
+
+$wp_list_table->prepare_items();
+
+$title = __( 'Media Library' );
+$parent_file = 'upload.php';
+
+wp_enqueue_script( 'media' );
+
+add_screen_option( 'per_page' );
+
+get_current_screen()->add_help_tab(
+ array(
+ 'id' => 'overview',
+ 'title' => __( 'Overview' ),
+ 'content' =>
+ '<p>' . __( 'All the files you&#8217;ve uploaded are listed in the Media Library, with the most recent uploads listed first. You can use the Screen Options tab to customize the display of this screen.' ) . '</p>' .
+ '<p>' . __( 'You can narrow the list by file type/status or by date using the dropdown menus above the media table.' ) . '</p>' .
+ '<p>' . __( 'You can view your media in a simple visual grid or a list with columns. Switch between these views using the icons to the left above the media.' ) . '</p>',
+ )
+);
+get_current_screen()->add_help_tab(
+ array(
+ 'id' => 'actions-links',
+ 'title' => __( 'Available Actions' ),
+ 'content' =>
+ '<p>' . __( 'Hovering over a row reveals action links: Edit, Delete Permanently, and View. Clicking Edit or on the media file&#8217;s name displays a simple screen to edit that individual file&#8217;s metadata. Clicking Delete Permanently will delete the file from the media library (as well as from any posts to which it is currently attached). View will take you to the display page for that file.' ) . '</p>',
+ )
+);
+get_current_screen()->add_help_tab(
+ array(
+ 'id' => 'attaching-files',
+ 'title' => __( 'Attaching Files' ),
+ 'content' =>
+ '<p>' . __( 'If a media file has not been attached to any content, you will see that in the Uploaded To column, and can click on Attach to launch a small popup that will allow you to search for existing content and attach the file.' ) . '</p>',
+ )
+);
+
+get_current_screen()->set_help_sidebar(
+ '<p><strong>' . __( 'For more information:' ) . '</strong></p>' .
+ '<p>' . __( '<a href="https://codex.wordpress.org/Media_Library_Screen">Documentation on Media Library</a>' ) . '</p>' .
+ '<p>' . __( '<a href="https://wordpress.org/support/">Support</a>' ) . '</p>'
+);
+
+get_current_screen()->set_screen_reader_content(
+ array(
+ 'heading_views' => __( 'Filter media items list' ),
+ 'heading_pagination' => __( 'Media items list navigation' ),
+ 'heading_list' => __( 'Media items list' ),
+ )
+);
+
+require_once( ABSPATH . 'wp-admin/admin-header.php' );
+?>
+
+<div class="wrap">
+<h1 class="wp-heading-inline"><?php echo esc_html( $title ); ?></h1>
+
+<?php
+if ( current_user_can( 'upload_files' ) ) {
+ ?>
+ <a href="<?php echo admin_url( 'media-new.php' ); ?>" class="page-title-action"><?php echo esc_html_x( 'Add New', 'file' ); ?></a>
+ <?php
+}
+
+if ( isset( $_REQUEST['s'] ) && strlen( $_REQUEST['s'] ) ) {
+ /* translators: %s: search keywords */
+ printf( '<span class="subtitle">' . __( 'Search results for &#8220;%s&#8221;' ) . '</span>', get_search_query() );
+}
+?>
+
+<hr class="wp-header-end">
+
+<?php
+$message = '';
+if ( ! empty( $_GET['posted'] ) ) {
+ $message = __( 'Media file updated.' );
+ $_SERVER['REQUEST_URI'] = remove_query_arg( array( 'posted' ), $_SERVER['REQUEST_URI'] );
+}
+
+if ( ! empty( $_GET['attached'] ) && $attached = absint( $_GET['attached'] ) ) {
+ if ( 1 == $attached ) {
+ $message = __( 'Media file attached.' );
+ } else {
+ /* translators: %s: number of media files */
+ $message = _n( '%s media file attached.', '%s media files attached.', $attached );
+ }
+ $message = sprintf( $message, number_format_i18n( $attached ) );
+ $_SERVER['REQUEST_URI'] = remove_query_arg( array( 'detach', 'attached' ), $_SERVER['REQUEST_URI'] );
+}
+
+if ( ! empty( $_GET['detach'] ) && $detached = absint( $_GET['detach'] ) ) {
+ if ( 1 == $detached ) {
+ $message = __( 'Media file detached.' );
+ } else {
+ /* translators: %s: number of media files */
+ $message = _n( '%s media file detached.', '%s media files detached.', $detached );
+ }
+ $message = sprintf( $message, number_format_i18n( $detached ) );
+ $_SERVER['REQUEST_URI'] = remove_query_arg( array( 'detach', 'attached' ), $_SERVER['REQUEST_URI'] );
+}
+
+if ( ! empty( $_GET['deleted'] ) && $deleted = absint( $_GET['deleted'] ) ) {
+ if ( 1 == $deleted ) {
+ $message = __( 'Media file permanently deleted.' );
+ } else {
+ /* translators: %s: number of media files */
+ $message = _n( '%s media file permanently deleted.', '%s media files permanently deleted.', $deleted );
+ }
+ $message = sprintf( $message, number_format_i18n( $deleted ) );
+ $_SERVER['REQUEST_URI'] = remove_query_arg( array( 'deleted' ), $_SERVER['REQUEST_URI'] );
+}
+
+if ( ! empty( $_GET['trashed'] ) && $trashed = absint( $_GET['trashed'] ) ) {
+ if ( 1 == $trashed ) {
+ $message = __( 'Media file moved to the trash.' );
+ } else {
+ /* translators: %s: number of media files */
+ $message = _n( '%s media file moved to the trash.', '%s media files moved to the trash.', $trashed );
+ }
+ $message = sprintf( $message, number_format_i18n( $trashed ) );
+ $message .= ' <a href="' . esc_url( wp_nonce_url( 'upload.php?doaction=undo&action=untrash&ids=' . ( isset( $_GET['ids'] ) ? $_GET['ids'] : '' ), 'bulk-media' ) ) . '">' . __( 'Undo' ) . '</a>';
+ $_SERVER['REQUEST_URI'] = remove_query_arg( array( 'trashed' ), $_SERVER['REQUEST_URI'] );
+}
+
+if ( ! empty( $_GET['untrashed'] ) && $untrashed = absint( $_GET['untrashed'] ) ) {
+ if ( 1 == $untrashed ) {
+ $message = __( 'Media file restored from the trash.' );
+ } else {
+ /* translators: %s: number of media files */
+ $message = _n( '%s media file restored from the trash.', '%s media files restored from the trash.', $untrashed );
+ }
+ $message = sprintf( $message, number_format_i18n( $untrashed ) );
+ $_SERVER['REQUEST_URI'] = remove_query_arg( array( 'untrashed' ), $_SERVER['REQUEST_URI'] );
+}
+
+$messages[1] = __( 'Media file updated.' );
+$messages[2] = __( 'Media file permanently deleted.' );
+$messages[3] = __( 'Error saving media file.' );
+$messages[4] = __( 'Media file moved to the trash.' ) . ' <a href="' . esc_url( wp_nonce_url( 'upload.php?doaction=undo&action=untrash&ids=' . ( isset( $_GET['ids'] ) ? $_GET['ids'] : '' ), 'bulk-media' ) ) . '">' . __( 'Undo' ) . '</a>';
+$messages[5] = __( 'Media file restored from the trash.' );
+
+if ( ! empty( $_GET['message'] ) && isset( $messages[ $_GET['message'] ] ) ) {
+ $message = $messages[ $_GET['message'] ];
+ $_SERVER['REQUEST_URI'] = remove_query_arg( array( 'message' ), $_SERVER['REQUEST_URI'] );
+}
+
+if ( ! empty( $message ) ) {
+ ?>
+<div id="message" class="updated notice is-dismissible"><p><?php echo $message; ?></p></div>
+<?php } ?>
+
+<form id="posts-filter" method="get">
+
+<?php $wp_list_table->views(); ?>
+
+<?php $wp_list_table->display(); ?>
+
+<div id="ajax-response"></div>
+<?php find_posts_div(); ?>
+</form>
+</div>
+
+<?php
+include( ABSPATH . 'wp-admin/admin-footer.php' );
diff --git a/www/crm/wp-admin/user-edit.php b/www/crm/wp-admin/user-edit.php
new file mode 100644
index 00000000..e08dfed5
--- /dev/null
+++ b/www/crm/wp-admin/user-edit.php
@@ -0,0 +1,769 @@
+<?php
+/**
+ * Edit user administration panel.
+ *
+ * @package WordPress
+ * @subpackage Administration
+ */
+
+/** WordPress Administration Bootstrap */
+require_once( dirname( __FILE__ ) . '/admin.php' );
+
+wp_reset_vars( array( 'action', 'user_id', 'wp_http_referer' ) );
+
+$user_id = (int) $user_id;
+$current_user = wp_get_current_user();
+if ( ! defined( 'IS_PROFILE_PAGE' ) ) {
+ define( 'IS_PROFILE_PAGE', ( $user_id == $current_user->ID ) );
+}
+
+if ( ! $user_id && IS_PROFILE_PAGE ) {
+ $user_id = $current_user->ID;
+} elseif ( ! $user_id && ! IS_PROFILE_PAGE ) {
+ wp_die( __( 'Invalid user ID.' ) );
+} elseif ( ! get_userdata( $user_id ) ) {
+ wp_die( __( 'Invalid user ID.' ) );
+}
+
+wp_enqueue_script( 'user-profile' );
+
+if ( IS_PROFILE_PAGE ) {
+ $title = __( 'Profile' );
+} else {
+ /* translators: %s: user's display name */
+ $title = __( 'Edit User %s' );
+}
+
+if ( current_user_can( 'edit_users' ) && ! IS_PROFILE_PAGE ) {
+ $submenu_file = 'users.php';
+} else {
+ $submenu_file = 'profile.php';
+}
+
+if ( current_user_can( 'edit_users' ) && ! is_user_admin() ) {
+ $parent_file = 'users.php';
+} else {
+ $parent_file = 'profile.php';
+}
+
+$profile_help = '<p>' . __( 'Your profile contains information about you (your &#8220;account&#8221;) as well as some personal options related to using WordPress.' ) . '</p>' .
+ '<p>' . __( 'You can change your password, turn on keyboard shortcuts, change the color scheme of your WordPress administration screens, and turn off the WYSIWYG (Visual) editor, among other things. You can hide the Toolbar (formerly called the Admin Bar) from the front end of your site, however it cannot be disabled on the admin screens.' ) . '</p>' .
+ '<p>' . __( 'You can select the language you wish to use while using the WordPress administration screen without affecting the language site visitors see.' ) . '</p>' .
+ '<p>' . __( 'Your username cannot be changed, but you can use other fields to enter your real name or a nickname, and change which name to display on your posts.' ) . '</p>' .
+ '<p>' . __( 'You can log out of other devices, such as your phone or a public computer, by clicking the Log Out Everywhere Else button.' ) . '</p>' .
+ '<p>' . __( 'Required fields are indicated; the rest are optional. Profile information will only be displayed if your theme is set up to do so.' ) . '</p>' .
+ '<p>' . __( 'Remember to click the Update Profile button when you are finished.' ) . '</p>';
+
+get_current_screen()->add_help_tab(
+ array(
+ 'id' => 'overview',
+ 'title' => __( 'Overview' ),
+ 'content' => $profile_help,
+ )
+);
+
+get_current_screen()->set_help_sidebar(
+ '<p><strong>' . __( 'For more information:' ) . '</strong></p>' .
+ '<p>' . __( '<a href="https://codex.wordpress.org/Users_Your_Profile_Screen">Documentation on User Profiles</a>' ) . '</p>' .
+ '<p>' . __( '<a href="https://wordpress.org/support/">Support</a>' ) . '</p>'
+);
+
+$wp_http_referer = remove_query_arg( array( 'update', 'delete_count', 'user_id' ), $wp_http_referer );
+
+$user_can_edit = current_user_can( 'edit_posts' ) || current_user_can( 'edit_pages' );
+
+/**
+ * Filters whether to allow administrators on Multisite to edit every user.
+ *
+ * Enabling the user editing form via this filter also hinges on the user holding
+ * the 'manage_network_users' cap, and the logged-in user not matching the user
+ * profile open for editing.
+ *
+ * The filter was introduced to replace the EDIT_ANY_USER constant.
+ *
+ * @since 3.0.0
+ *
+ * @param bool $allow Whether to allow editing of any user. Default true.
+ */
+if ( is_multisite()
+ && ! current_user_can( 'manage_network_users' )
+ && $user_id != $current_user->ID
+ && ! apply_filters( 'enable_edit_any_user_configuration', true )
+) {
+ wp_die( __( 'Sorry, you are not allowed to edit this user.' ) );
+}
+
+// Execute confirmed email change. See send_confirmation_on_profile_email().
+if ( IS_PROFILE_PAGE && isset( $_GET['newuseremail'] ) && $current_user->ID ) {
+ $new_email = get_user_meta( $current_user->ID, '_new_email', true );
+ if ( $new_email && hash_equals( $new_email['hash'], $_GET['newuseremail'] ) ) {
+ $user = new stdClass;
+ $user->ID = $current_user->ID;
+ $user->user_email = esc_html( trim( $new_email['newemail'] ) );
+ if ( is_multisite() && $wpdb->get_var( $wpdb->prepare( "SELECT user_login FROM {$wpdb->signups} WHERE user_login = %s", $current_user->user_login ) ) ) {
+ $wpdb->query( $wpdb->prepare( "UPDATE {$wpdb->signups} SET user_email = %s WHERE user_login = %s", $user->user_email, $current_user->user_login ) );
+ }
+ wp_update_user( $user );
+ delete_user_meta( $current_user->ID, '_new_email' );
+ wp_redirect( add_query_arg( array( 'updated' => 'true' ), self_admin_url( 'profile.php' ) ) );
+ die();
+ } else {
+ wp_redirect( add_query_arg( array( 'error' => 'new-email' ), self_admin_url( 'profile.php' ) ) );
+ }
+} elseif ( IS_PROFILE_PAGE && ! empty( $_GET['dismiss'] ) && $current_user->ID . '_new_email' === $_GET['dismiss'] ) {
+ check_admin_referer( 'dismiss-' . $current_user->ID . '_new_email' );
+ delete_user_meta( $current_user->ID, '_new_email' );
+ wp_redirect( add_query_arg( array( 'updated' => 'true' ), self_admin_url( 'profile.php' ) ) );
+ die();
+}
+
+switch ( $action ) {
+ case 'update':
+ check_admin_referer( 'update-user_' . $user_id );
+
+ if ( ! current_user_can( 'edit_user', $user_id ) ) {
+ wp_die( __( 'Sorry, you are not allowed to edit this user.' ) );
+ }
+
+ if ( IS_PROFILE_PAGE ) {
+ /**
+ * Fires before the page loads on the 'Your Profile' editing screen.
+ *
+ * The action only fires if the current user is editing their own profile.
+ *
+ * @since 2.0.0
+ *
+ * @param int $user_id The user ID.
+ */
+ do_action( 'personal_options_update', $user_id );
+ } else {
+ /**
+ * Fires before the page loads on the 'Edit User' screen.
+ *
+ * @since 2.7.0
+ *
+ * @param int $user_id The user ID.
+ */
+ do_action( 'edit_user_profile_update', $user_id );
+ }
+
+ // Update the email address in signups, if present.
+ if ( is_multisite() ) {
+ $user = get_userdata( $user_id );
+
+ if ( $user->user_login && isset( $_POST['email'] ) && is_email( $_POST['email'] ) && $wpdb->get_var( $wpdb->prepare( "SELECT user_login FROM {$wpdb->signups} WHERE user_login = %s", $user->user_login ) ) ) {
+ $wpdb->query( $wpdb->prepare( "UPDATE {$wpdb->signups} SET user_email = %s WHERE user_login = %s", $_POST['email'], $user_login ) );
+ }
+ }
+
+ // Update the user.
+ $errors = edit_user( $user_id );
+
+ // Grant or revoke super admin status if requested.
+ if ( is_multisite() && is_network_admin() && ! IS_PROFILE_PAGE && current_user_can( 'manage_network_options' ) && ! isset( $super_admins ) && empty( $_POST['super_admin'] ) == is_super_admin( $user_id ) ) {
+ empty( $_POST['super_admin'] ) ? revoke_super_admin( $user_id ) : grant_super_admin( $user_id );
+ }
+
+ if ( ! is_wp_error( $errors ) ) {
+ $redirect = add_query_arg( 'updated', true, get_edit_user_link( $user_id ) );
+ if ( $wp_http_referer ) {
+ $redirect = add_query_arg( 'wp_http_referer', urlencode( $wp_http_referer ), $redirect );
+ }
+ wp_redirect( $redirect );
+ exit;
+ }
+
+ // Intentional fall-through to display $errors.
+ default:
+ $profileuser = get_user_to_edit( $user_id );
+
+ if ( ! current_user_can( 'edit_user', $user_id ) ) {
+ wp_die( __( 'Sorry, you are not allowed to edit this user.' ) );
+ }
+
+ $title = sprintf( $title, $profileuser->display_name );
+ $sessions = WP_Session_Tokens::get_instance( $profileuser->ID );
+
+ include( ABSPATH . 'wp-admin/admin-header.php' );
+ ?>
+
+ <?php if ( ! IS_PROFILE_PAGE && is_super_admin( $profileuser->ID ) && current_user_can( 'manage_network_options' ) ) { ?>
+ <div class="notice notice-info"><p><strong><?php _e( 'Important:' ); ?></strong> <?php _e( 'This user has super admin privileges.' ); ?></p></div>
+<?php } ?>
+ <?php if ( isset( $_GET['updated'] ) ) : ?>
+<div id="message" class="updated notice is-dismissible">
+ <?php if ( IS_PROFILE_PAGE ) : ?>
+ <p><strong><?php _e( 'Profile updated.' ); ?></strong></p>
+ <?php else : ?>
+ <p><strong><?php _e( 'User updated.' ); ?></strong></p>
+ <?php endif; ?>
+ <?php if ( $wp_http_referer && false === strpos( $wp_http_referer, 'user-new.php' ) && ! IS_PROFILE_PAGE ) : ?>
+ <p><a href="<?php echo esc_url( wp_validate_redirect( esc_url_raw( $wp_http_referer ), self_admin_url( 'users.php' ) ) ); ?>"><?php _e( '&larr; Back to Users' ); ?></a></p>
+ <?php endif; ?>
+</div>
+ <?php endif; ?>
+ <?php if ( isset( $_GET['error'] ) ) : ?>
+<div class="notice notice-error">
+ <?php if ( 'new-email' == $_GET['error'] ) : ?>
+ <p><?php _e( 'Error while saving the new email address. Please try again.' ); ?></p>
+ <?php endif; ?>
+</div>
+ <?php endif; ?>
+ <?php if ( isset( $errors ) && is_wp_error( $errors ) ) : ?>
+<div class="error"><p><?php echo implode( "</p>\n<p>", $errors->get_error_messages() ); ?></p></div>
+ <?php endif; ?>
+
+<div class="wrap" id="profile-page">
+<h1 class="wp-heading-inline">
+ <?php
+ echo esc_html( $title );
+ ?>
+</h1>
+
+ <?php
+ if ( ! IS_PROFILE_PAGE ) {
+ if ( current_user_can( 'create_users' ) ) {
+ ?>
+ <a href="user-new.php" class="page-title-action"><?php echo esc_html_x( 'Add New', 'user' ); ?></a>
+ <?php } elseif ( is_multisite() && current_user_can( 'promote_users' ) ) { ?>
+ <a href="user-new.php" class="page-title-action"><?php echo esc_html_x( 'Add Existing', 'user' ); ?></a>
+ <?php
+ }
+ }
+ ?>
+
+<hr class="wp-header-end">
+
+<form id="your-profile" action="<?php echo esc_url( self_admin_url( IS_PROFILE_PAGE ? 'profile.php' : 'user-edit.php' ) ); ?>" method="post" novalidate="novalidate"
+ <?php
+ /**
+ * Fires inside the your-profile form tag on the user editing screen.
+ *
+ * @since 3.0.0
+ */
+ do_action( 'user_edit_form_tag' );
+ ?>
+ >
+ <?php wp_nonce_field( 'update-user_' . $user_id ); ?>
+ <?php if ( $wp_http_referer ) : ?>
+ <input type="hidden" name="wp_http_referer" value="<?php echo esc_url( $wp_http_referer ); ?>" />
+ <?php endif; ?>
+<p>
+<input type="hidden" name="from" value="profile" />
+<input type="hidden" name="checkuser_id" value="<?php echo get_current_user_id(); ?>" />
+</p>
+
+<h2><?php _e( 'Personal Options' ); ?></h2>
+
+<table class="form-table" role="presentation">
+ <?php if ( ! ( IS_PROFILE_PAGE && ! $user_can_edit ) ) : ?>
+ <tr class="user-rich-editing-wrap">
+ <th scope="row"><?php _e( 'Visual Editor' ); ?></th>
+ <td><label for="rich_editing"><input name="rich_editing" type="checkbox" id="rich_editing" value="false" <?php checked( 'false', $profileuser->rich_editing ); ?> /> <?php _e( 'Disable the visual editor when writing' ); ?></label></td>
+ </tr>
+ <?php endif; ?>
+ <?php
+ $show_syntax_highlighting_preference = (
+ // For Custom HTML widget and Additional CSS in Customizer.
+ user_can( $profileuser, 'edit_theme_options' )
+ ||
+ // Edit plugins.
+ user_can( $profileuser, 'edit_plugins' )
+ ||
+ // Edit themes.
+ user_can( $profileuser, 'edit_themes' )
+ );
+ ?>
+ <?php if ( $show_syntax_highlighting_preference ) : ?>
+ <tr class="user-syntax-highlighting-wrap">
+ <th scope="row"><?php _e( 'Syntax Highlighting' ); ?></th>
+ <td>
+ <label for="syntax_highlighting"><input name="syntax_highlighting" type="checkbox" id="syntax_highlighting" value="false" <?php checked( 'false', $profileuser->syntax_highlighting ); ?> /> <?php _e( 'Disable syntax highlighting when editing code' ); ?></label>
+ </td>
+ </tr>
+<?php endif; ?>
+ <?php if ( count( $_wp_admin_css_colors ) > 1 && has_action( 'admin_color_scheme_picker' ) ) : ?>
+<tr class="user-admin-color-wrap">
+<th scope="row"><?php _e( 'Admin Color Scheme' ); ?></th>
+<td>
+ <?php
+ /**
+ * Fires in the 'Admin Color Scheme' section of the user editing screen.
+ *
+ * The section is only enabled if a callback is hooked to the action,
+ * and if there is more than one defined color scheme for the admin.
+ *
+ * @since 3.0.0
+ * @since 3.8.1 Added `$user_id` parameter.
+ *
+ * @param int $user_id The user ID.
+ */
+ do_action( 'admin_color_scheme_picker', $user_id );
+ ?>
+</td>
+</tr>
+ <?php
+endif; // $_wp_admin_css_colors
+ if ( ! ( IS_PROFILE_PAGE && ! $user_can_edit ) ) :
+ ?>
+<tr class="user-comment-shortcuts-wrap">
+<th scope="row"><?php _e( 'Keyboard Shortcuts' ); ?></th>
+<td><label for="comment_shortcuts"><input type="checkbox" name="comment_shortcuts" id="comment_shortcuts" value="true" <?php checked( 'true', $profileuser->comment_shortcuts ); ?> /> <?php _e( 'Enable keyboard shortcuts for comment moderation.' ); ?></label> <?php _e( '<a href="https://codex.wordpress.org/Keyboard_Shortcuts" target="_blank">More information</a>' ); ?></td>
+</tr>
+ <?php endif; ?>
+<tr class="show-admin-bar user-admin-bar-front-wrap">
+<th scope="row"><?php _e( 'Toolbar' ); ?></th>
+<td>
+<label for="admin_bar_front">
+<input name="admin_bar_front" type="checkbox" id="admin_bar_front" value="1"<?php checked( _get_admin_bar_pref( 'front', $profileuser->ID ) ); ?> />
+ <?php _e( 'Show Toolbar when viewing site' ); ?></label><br />
+</td>
+</tr>
+
+ <?php
+ $languages = get_available_languages();
+ if ( $languages ) :
+ ?>
+<tr class="user-language-wrap">
+ <th scope="row">
+ <?php /* translators: The user language selection field label */ ?>
+ <label for="locale"><?php _e( 'Language' ); ?></label>
+ </th>
+ <td>
+ <?php
+ $user_locale = $profileuser->locale;
+
+ if ( 'en_US' === $user_locale ) {
+ $user_locale = '';
+ } elseif ( '' === $user_locale || ! in_array( $user_locale, $languages, true ) ) {
+ $user_locale = 'site-default';
+ }
+
+ wp_dropdown_languages(
+ array(
+ 'name' => 'locale',
+ 'id' => 'locale',
+ 'selected' => $user_locale,
+ 'languages' => $languages,
+ 'show_available_translations' => false,
+ 'show_option_site_default' => true,
+ )
+ );
+ ?>
+ </td>
+</tr>
+ <?php
+endif;
+ ?>
+
+ <?php
+ /**
+ * Fires at the end of the 'Personal Options' settings table on the user editing screen.
+ *
+ * @since 2.7.0
+ *
+ * @param WP_User $profileuser The current WP_User object.
+ */
+ do_action( 'personal_options', $profileuser );
+ ?>
+
+</table>
+ <?php
+ if ( IS_PROFILE_PAGE ) {
+ /**
+ * Fires after the 'Personal Options' settings table on the 'Your Profile' editing screen.
+ *
+ * The action only fires if the current user is editing their own profile.
+ *
+ * @since 2.0.0
+ *
+ * @param WP_User $profileuser The current WP_User object.
+ */
+ do_action( 'profile_personal_options', $profileuser );
+ }
+ ?>
+
+<h2><?php _e( 'Name' ); ?></h2>
+
+<table class="form-table" role="presentation">
+ <tr class="user-user-login-wrap">
+ <th><label for="user_login"><?php _e( 'Username' ); ?></label></th>
+ <td><input type="text" name="user_login" id="user_login" value="<?php echo esc_attr( $profileuser->user_login ); ?>" disabled="disabled" class="regular-text" /> <span class="description"><?php _e( 'Usernames cannot be changed.' ); ?></span></td>
+ </tr>
+
+ <?php if ( ! IS_PROFILE_PAGE && ! is_network_admin() && current_user_can( 'promote_user', $profileuser->ID ) ) : ?>
+<tr class="user-role-wrap"><th><label for="role"><?php _e( 'Role' ); ?></label></th>
+<td><select name="role" id="role">
+ <?php
+ // Compare user role against currently editable roles
+ $user_roles = array_intersect( array_values( $profileuser->roles ), array_keys( get_editable_roles() ) );
+ $user_role = reset( $user_roles );
+
+ // print the full list of roles with the primary one selected.
+ wp_dropdown_roles( $user_role );
+
+ // print the 'no role' option. Make it selected if the user has no role yet.
+ if ( $user_role ) {
+ echo '<option value="">' . __( '&mdash; No role for this site &mdash;' ) . '</option>';
+ } else {
+ echo '<option value="" selected="selected">' . __( '&mdash; No role for this site &mdash;' ) . '</option>';
+ }
+ ?>
+</select></td></tr>
+ <?php
+endif; //!IS_PROFILE_PAGE
+
+ if ( is_multisite() && is_network_admin() && ! IS_PROFILE_PAGE && current_user_can( 'manage_network_options' ) && ! isset( $super_admins ) ) {
+ ?>
+<tr class="user-super-admin-wrap"><th><?php _e( 'Super Admin' ); ?></th>
+<td>
+ <?php if ( $profileuser->user_email != get_site_option( 'admin_email' ) || ! is_super_admin( $profileuser->ID ) ) : ?>
+<p><label><input type="checkbox" id="super_admin" name="super_admin"<?php checked( is_super_admin( $profileuser->ID ) ); ?> /> <?php _e( 'Grant this user super admin privileges for the Network.' ); ?></label></p>
+<?php else : ?>
+<p><?php _e( 'Super admin privileges cannot be removed because this user has the network admin email.' ); ?></p>
+<?php endif; ?>
+</td></tr>
+ <?php } ?>
+
+<tr class="user-first-name-wrap">
+ <th><label for="first_name"><?php _e( 'First Name' ); ?></label></th>
+ <td><input type="text" name="first_name" id="first_name" value="<?php echo esc_attr( $profileuser->first_name ); ?>" class="regular-text" /></td>
+</tr>
+
+<tr class="user-last-name-wrap">
+ <th><label for="last_name"><?php _e( 'Last Name' ); ?></label></th>
+ <td><input type="text" name="last_name" id="last_name" value="<?php echo esc_attr( $profileuser->last_name ); ?>" class="regular-text" /></td>
+</tr>
+
+<tr class="user-nickname-wrap">
+ <th><label for="nickname"><?php _e( 'Nickname' ); ?> <span class="description"><?php _e( '(required)' ); ?></span></label></th>
+ <td><input type="text" name="nickname" id="nickname" value="<?php echo esc_attr( $profileuser->nickname ); ?>" class="regular-text" /></td>
+</tr>
+
+<tr class="user-display-name-wrap">
+ <th><label for="display_name"><?php _e( 'Display name publicly as' ); ?></label></th>
+ <td>
+ <select name="display_name" id="display_name">
+ <?php
+ $public_display = array();
+ $public_display['display_nickname'] = $profileuser->nickname;
+ $public_display['display_username'] = $profileuser->user_login;
+
+ if ( ! empty( $profileuser->first_name ) ) {
+ $public_display['display_firstname'] = $profileuser->first_name;
+ }
+
+ if ( ! empty( $profileuser->last_name ) ) {
+ $public_display['display_lastname'] = $profileuser->last_name;
+ }
+
+ if ( ! empty( $profileuser->first_name ) && ! empty( $profileuser->last_name ) ) {
+ $public_display['display_firstlast'] = $profileuser->first_name . ' ' . $profileuser->last_name;
+ $public_display['display_lastfirst'] = $profileuser->last_name . ' ' . $profileuser->first_name;
+ }
+
+ if ( ! in_array( $profileuser->display_name, $public_display ) ) { // Only add this if it isn't duplicated elsewhere
+ $public_display = array( 'display_displayname' => $profileuser->display_name ) + $public_display;
+ }
+
+ $public_display = array_map( 'trim', $public_display );
+ $public_display = array_unique( $public_display );
+
+ foreach ( $public_display as $id => $item ) {
+ ?>
+ <option <?php selected( $profileuser->display_name, $item ); ?>><?php echo $item; ?></option>
+ <?php
+ }
+ ?>
+ </select>
+ </td>
+ </tr>
+ </table>
+
+ <h2><?php _e( 'Contact Info' ); ?></h2>
+
+ <table class="form-table" role="presentation">
+ <tr class="user-email-wrap">
+ <th><label for="email"><?php _e( 'Email' ); ?> <span class="description"><?php _e( '(required)' ); ?></span></label></th>
+ <td><input type="email" name="email" id="email" aria-describedby="email-description" value="<?php echo esc_attr( $profileuser->user_email ); ?>" class="regular-text ltr" />
+ <?php
+ if ( $profileuser->ID == $current_user->ID ) :
+ ?>
+ <p class="description" id="email-description">
+ <?php _e( 'If you change this we will send you an email at your new address to confirm it. <strong>The new address will not become active until confirmed.</strong>' ); ?>
+ </p>
+ <?php
+ endif;
+
+ $new_email = get_user_meta( $current_user->ID, '_new_email', true );
+ if ( $new_email && $new_email['newemail'] != $current_user->user_email && $profileuser->ID == $current_user->ID ) :
+ ?>
+ <div class="updated inline">
+ <p>
+ <?php
+ printf(
+ /* translators: %s: new email */
+ __( 'There is a pending change of your email to %s.' ),
+ '<code>' . esc_html( $new_email['newemail'] ) . '</code>'
+ );
+ printf(
+ ' <a href="%1$s">%2$s</a>',
+ esc_url( wp_nonce_url( self_admin_url( 'profile.php?dismiss=' . $current_user->ID . '_new_email' ), 'dismiss-' . $current_user->ID . '_new_email' ) ),
+ __( 'Cancel' )
+ );
+ ?>
+ </p>
+ </div>
+ <?php endif; ?>
+ </td>
+ </tr>
+
+ <tr class="user-url-wrap">
+ <th><label for="url"><?php _e( 'Website' ); ?></label></th>
+ <td><input type="url" name="url" id="url" value="<?php echo esc_attr( $profileuser->user_url ); ?>" class="regular-text code" /></td>
+ </tr>
+
+ <?php
+ foreach ( wp_get_user_contact_methods( $profileuser ) as $name => $desc ) {
+ ?>
+ <tr class="user-<?php echo $name; ?>-wrap">
+<th><label for="<?php echo $name; ?>">
+ <?php
+ /**
+ * Filters a user contactmethod label.
+ *
+ * The dynamic portion of the filter hook, `$name`, refers to
+ * each of the keys in the contactmethods array.
+ *
+ * @since 2.9.0
+ *
+ * @param string $desc The translatable label for the contactmethod.
+ */
+ echo apply_filters( "user_{$name}_label", $desc );
+ ?>
+ </label></th>
+ <td><input type="text" name="<?php echo $name; ?>" id="<?php echo $name; ?>" value="<?php echo esc_attr( $profileuser->$name ); ?>" class="regular-text" /></td>
+ </tr>
+ <?php
+ }
+ ?>
+ </table>
+
+ <h2><?php IS_PROFILE_PAGE ? _e( 'About Yourself' ) : _e( 'About the user' ); ?></h2>
+
+<table class="form-table" role="presentation">
+<tr class="user-description-wrap">
+ <th><label for="description"><?php _e( 'Biographical Info' ); ?></label></th>
+ <td><textarea name="description" id="description" rows="5" cols="30"><?php echo $profileuser->description; // textarea_escaped ?></textarea>
+ <p class="description"><?php _e( 'Share a little biographical information to fill out your profile. This may be shown publicly.' ); ?></p></td>
+</tr>
+
+ <?php if ( get_option( 'show_avatars' ) ) : ?>
+<tr class="user-profile-picture">
+ <th><?php _e( 'Profile Picture' ); ?></th>
+ <td>
+ <?php echo get_avatar( $user_id ); ?>
+ <p class="description">
+ <?php
+ if ( IS_PROFILE_PAGE ) {
+ /* translators: %s: Gravatar URL */
+ $description = sprintf(
+ __( '<a href="%s">You can change your profile picture on Gravatar</a>.' ),
+ __( 'https://en.gravatar.com/' )
+ );
+ } else {
+ $description = '';
+ }
+
+ /**
+ * Filters the user profile picture description displayed under the Gravatar.
+ *
+ * @since 4.4.0
+ * @since 4.7.0 Added the `$profileuser` parameter.
+ *
+ * @param string $description The description that will be printed.
+ * @param WP_User $profileuser The current WP_User object.
+ */
+ echo apply_filters( 'user_profile_picture_description', $description, $profileuser );
+ ?>
+ </p>
+ </td>
+</tr>
+<?php endif; ?>
+
+ <?php
+ /**
+ * Filters the display of the password fields.
+ *
+ * @since 1.5.1
+ * @since 2.8.0 Added the `$profileuser` parameter.
+ * @since 4.4.0 Now evaluated only in user-edit.php.
+ *
+ * @param bool $show Whether to show the password fields. Default true.
+ * @param WP_User $profileuser User object for the current user to edit.
+ */
+ if ( $show_password_fields = apply_filters( 'show_password_fields', true, $profileuser ) ) :
+ ?>
+ </table>
+
+ <h2><?php _e( 'Account Management' ); ?></h2>
+<table class="form-table" role="presentation">
+<tr id="password" class="user-pass1-wrap">
+ <th><label for="pass1"><?php _e( 'New Password' ); ?></label></th>
+ <td>
+ <input class="hidden" value=" " /><!-- #24364 workaround -->
+ <button type="button" class="button wp-generate-pw hide-if-no-js"><?php _e( 'Generate Password' ); ?></button>
+ <div class="wp-pwd hide-if-js">
+ <span class="password-input-wrapper">
+ <input type="password" name="pass1" id="pass1" class="regular-text" value="" autocomplete="off" data-pw="<?php echo esc_attr( wp_generate_password( 24 ) ); ?>" aria-describedby="pass-strength-result" />
+ </span>
+ <button type="button" class="button wp-hide-pw hide-if-no-js" data-toggle="0" aria-label="<?php esc_attr_e( 'Hide password' ); ?>">
+ <span class="dashicons dashicons-hidden" aria-hidden="true"></span>
+ <span class="text"><?php _e( 'Hide' ); ?></span>
+ </button>
+ <button type="button" class="button wp-cancel-pw hide-if-no-js" data-toggle="0" aria-label="<?php esc_attr_e( 'Cancel password change' ); ?>">
+ <span class="dashicons dashicons-no" aria-hidden="true"></span>
+ <span class="text"><?php _e( 'Cancel' ); ?></span>
+ </button>
+ <div style="display:none" id="pass-strength-result" aria-live="polite"></div>
+ </div>
+ </td>
+</tr>
+<tr class="user-pass2-wrap hide-if-js">
+ <th scope="row"><label for="pass2"><?php _e( 'Repeat New Password' ); ?></label></th>
+ <td>
+ <input name="pass2" type="password" id="pass2" class="regular-text" value="" autocomplete="off" />
+ <p class="description"><?php _e( 'Type your new password again.' ); ?></p>
+ </td>
+</tr>
+<tr class="pw-weak">
+ <th><?php _e( 'Confirm Password' ); ?></th>
+ <td>
+ <label>
+ <input type="checkbox" name="pw_weak" class="pw-checkbox" />
+ <span id="pw-weak-text-label"><?php _e( 'Confirm use of potentially weak password' ); ?></span>
+ </label>
+ </td>
+</tr>
+ <?php endif; ?>
+
+ <?php
+ if ( IS_PROFILE_PAGE && count( $sessions->get_all() ) === 1 ) :
+ ?>
+ <tr class="user-sessions-wrap hide-if-no-js">
+ <th><?php _e( 'Sessions' ); ?></th>
+ <td aria-live="assertive">
+ <div class="destroy-sessions"><button type="button" disabled class="button"><?php _e( 'Log Out Everywhere Else' ); ?></button></div>
+ <p class="description">
+ <?php _e( 'You are only logged in at this location.' ); ?>
+ </p>
+ </td>
+ </tr>
+<?php elseif ( IS_PROFILE_PAGE && count( $sessions->get_all() ) > 1 ) : ?>
+ <tr class="user-sessions-wrap hide-if-no-js">
+ <th><?php _e( 'Sessions' ); ?></th>
+ <td aria-live="assertive">
+ <div class="destroy-sessions"><button type="button" class="button" id="destroy-sessions"><?php _e( 'Log Out Everywhere Else' ); ?></button></div>
+ <p class="description">
+ <?php _e( 'Did you lose your phone or leave your account logged in at a public computer? You can log out everywhere else, and stay logged in here.' ); ?>
+ </p>
+ </td>
+ </tr>
+<?php elseif ( ! IS_PROFILE_PAGE && $sessions->get_all() ) : ?>
+ <tr class="user-sessions-wrap hide-if-no-js">
+ <th><?php _e( 'Sessions' ); ?></th>
+ <td>
+ <p><button type="button" class="button" id="destroy-sessions"><?php _e( 'Log Out Everywhere' ); ?></button></p>
+ <p class="description">
+ <?php
+ /* translators: %s: user's display name */
+ printf( __( 'Log %s out of all locations.' ), $profileuser->display_name );
+ ?>
+ </p>
+ </td>
+ </tr>
+<?php endif; ?>
+
+ </table>
+
+ <?php
+ if ( IS_PROFILE_PAGE ) {
+ /**
+ * Fires after the 'About Yourself' settings table on the 'Your Profile' editing screen.
+ *
+ * The action only fires if the current user is editing their own profile.
+ *
+ * @since 2.0.0
+ *
+ * @param WP_User $profileuser The current WP_User object.
+ */
+ do_action( 'show_user_profile', $profileuser );
+ } else {
+ /**
+ * Fires after the 'About the User' settings table on the 'Edit User' screen.
+ *
+ * @since 2.0.0
+ *
+ * @param WP_User $profileuser The current WP_User object.
+ */
+ do_action( 'edit_user_profile', $profileuser );
+ }
+ ?>
+
+ <?php
+ /**
+ * Filters whether to display additional capabilities for the user.
+ *
+ * The 'Additional Capabilities' section will only be enabled if
+ * the number of the user's capabilities exceeds their number of
+ * roles.
+ *
+ * @since 2.8.0
+ *
+ * @param bool $enable Whether to display the capabilities. Default true.
+ * @param WP_User $profileuser The current WP_User object.
+ */
+ if ( count( $profileuser->caps ) > count( $profileuser->roles )
+ && apply_filters( 'additional_capabilities_display', true, $profileuser )
+ ) :
+ ?>
+ <h2><?php _e( 'Additional Capabilities' ); ?></h2>
+<table class="form-table" role="presentation">
+<tr class="user-capabilities-wrap">
+ <th scope="row"><?php _e( 'Capabilities' ); ?></th>
+ <td>
+ <?php
+ $output = '';
+ foreach ( $profileuser->caps as $cap => $value ) {
+ if ( ! $wp_roles->is_role( $cap ) ) {
+ if ( '' != $output ) {
+ $output .= ', ';
+ }
+ $output .= $value ? $cap : sprintf( __( 'Denied: %s' ), $cap );
+ }
+ }
+ echo $output;
+ ?>
+ </td>
+</tr>
+</table>
+ <?php endif; ?>
+
+<input type="hidden" name="action" value="update" />
+<input type="hidden" name="user_id" id="user_id" value="<?php echo esc_attr( $user_id ); ?>" />
+
+ <?php submit_button( IS_PROFILE_PAGE ? __( 'Update Profile' ) : __( 'Update User' ) ); ?>
+
+</form>
+</div>
+ <?php
+ break;
+}
+?>
+<script type="text/javascript">
+ if (window.location.hash == '#password') {
+ document.getElementById('pass1').focus();
+ }
+</script>
+<?php
+include( ABSPATH . 'wp-admin/admin-footer.php' );
diff --git a/www/crm/wp-admin/user-new.php b/www/crm/wp-admin/user-new.php
new file mode 100644
index 00000000..0d374380
--- /dev/null
+++ b/www/crm/wp-admin/user-new.php
@@ -0,0 +1,571 @@
+<?php
+/**
+ * New User Administration Screen.
+ *
+ * @package WordPress
+ * @subpackage Administration
+ */
+
+/** WordPress Administration Bootstrap */
+require_once( dirname( __FILE__ ) . '/admin.php' );
+
+if ( is_multisite() ) {
+ if ( ! current_user_can( 'create_users' ) && ! current_user_can( 'promote_users' ) ) {
+ wp_die(
+ '<h1>' . __( 'You need a higher level of permission.' ) . '</h1>' .
+ '<p>' . __( 'Sorry, you are not allowed to add users to this network.' ) . '</p>',
+ 403
+ );
+ }
+} elseif ( ! current_user_can( 'create_users' ) ) {
+ wp_die(
+ '<h1>' . __( 'You need a higher level of permission.' ) . '</h1>' .
+ '<p>' . __( 'Sorry, you are not allowed to create users.' ) . '</p>',
+ 403
+ );
+}
+
+if ( is_multisite() ) {
+ add_filter( 'wpmu_signup_user_notification_email', 'admin_created_user_email' );
+}
+
+if ( isset( $_REQUEST['action'] ) && 'adduser' == $_REQUEST['action'] ) {
+ check_admin_referer( 'add-user', '_wpnonce_add-user' );
+
+ $user_details = null;
+ $user_email = wp_unslash( $_REQUEST['email'] );
+ if ( false !== strpos( $user_email, '@' ) ) {
+ $user_details = get_user_by( 'email', $user_email );
+ } else {
+ if ( current_user_can( 'manage_network_users' ) ) {
+ $user_details = get_user_by( 'login', $user_email );
+ } else {
+ wp_redirect( add_query_arg( array( 'update' => 'enter_email' ), 'user-new.php' ) );
+ die();
+ }
+ }
+
+ if ( ! $user_details ) {
+ wp_redirect( add_query_arg( array( 'update' => 'does_not_exist' ), 'user-new.php' ) );
+ die();
+ }
+
+ if ( ! current_user_can( 'promote_user', $user_details->ID ) ) {
+ wp_die(
+ '<h1>' . __( 'You need a higher level of permission.' ) . '</h1>' .
+ '<p>' . __( 'Sorry, you are not allowed to add users to this network.' ) . '</p>',
+ 403
+ );
+ }
+
+ // Adding an existing user to this blog
+ $new_user_email = $user_details->user_email;
+ $redirect = 'user-new.php';
+ $username = $user_details->user_login;
+ $user_id = $user_details->ID;
+ if ( $username != null && array_key_exists( $blog_id, get_blogs_of_user( $user_id ) ) ) {
+ $redirect = add_query_arg( array( 'update' => 'addexisting' ), 'user-new.php' );
+ } else {
+ if ( isset( $_POST['noconfirmation'] ) && current_user_can( 'manage_network_users' ) ) {
+ $result = add_existing_user_to_blog(
+ array(
+ 'user_id' => $user_id,
+ 'role' => $_REQUEST['role'],
+ )
+ );
+
+ if ( ! is_wp_error( $result ) ) {
+ $redirect = add_query_arg(
+ array(
+ 'update' => 'addnoconfirmation',
+ 'user_id' => $user_id,
+ ),
+ 'user-new.php'
+ );
+ } else {
+ $redirect = add_query_arg( array( 'update' => 'could_not_add' ), 'user-new.php' );
+ }
+ } else {
+ $newuser_key = wp_generate_password( 20, false );
+ add_option(
+ 'new_user_' . $newuser_key,
+ array(
+ 'user_id' => $user_id,
+ 'email' => $user_details->user_email,
+ 'role' => $_REQUEST['role'],
+ )
+ );
+
+ $roles = get_editable_roles();
+ $role = $roles[ $_REQUEST['role'] ];
+
+ /**
+ * Fires immediately after a user is invited to join a site, but before the notification is sent.
+ *
+ * @since 4.4.0
+ *
+ * @param int $user_id The invited user's ID.
+ * @param array $role The role of invited user.
+ * @param string $newuser_key The key of the invitation.
+ */
+ do_action( 'invite_user', $user_id, $role, $newuser_key );
+
+ $switched_locale = switch_to_locale( get_user_locale( $user_details ) );
+
+ /* translators: 1: Site name, 2: site URL, 3: role, 4: activation URL */
+ $message = __(
+ 'Hi,
+
+You\'ve been invited to join \'%1$s\' at
+%2$s with the role of %3$s.
+
+Please click the following link to confirm the invite:
+%4$s'
+ );
+
+ /* translators: Joining confirmation notification email subject. %s: Site title */
+ wp_mail( $new_user_email, sprintf( __( '[%s] Joining Confirmation' ), wp_specialchars_decode( get_option( 'blogname' ) ) ), sprintf( $message, get_option( 'blogname' ), home_url(), wp_specialchars_decode( translate_user_role( $role['name'] ) ), home_url( "/newbloguser/$newuser_key/" ) ) );
+
+ if ( $switched_locale ) {
+ restore_previous_locale();
+ }
+
+ $redirect = add_query_arg( array( 'update' => 'add' ), 'user-new.php' );
+ }
+ }
+ wp_redirect( $redirect );
+ die();
+} elseif ( isset( $_REQUEST['action'] ) && 'createuser' == $_REQUEST['action'] ) {
+ check_admin_referer( 'create-user', '_wpnonce_create-user' );
+
+ if ( ! current_user_can( 'create_users' ) ) {
+ wp_die(
+ '<h1>' . __( 'You need a higher level of permission.' ) . '</h1>' .
+ '<p>' . __( 'Sorry, you are not allowed to create users.' ) . '</p>',
+ 403
+ );
+ }
+
+ if ( ! is_multisite() ) {
+ $user_id = edit_user();
+
+ if ( is_wp_error( $user_id ) ) {
+ $add_user_errors = $user_id;
+ } else {
+ if ( current_user_can( 'list_users' ) ) {
+ $redirect = 'users.php?update=add&id=' . $user_id;
+ } else {
+ $redirect = add_query_arg( 'update', 'add', 'user-new.php' );
+ }
+ wp_redirect( $redirect );
+ die();
+ }
+ } else {
+ // Adding a new user to this site
+ $new_user_email = wp_unslash( $_REQUEST['email'] );
+ $user_details = wpmu_validate_user_signup( $_REQUEST['user_login'], $new_user_email );
+ if ( is_wp_error( $user_details['errors'] ) && $user_details['errors']->has_errors() ) {
+ $add_user_errors = $user_details['errors'];
+ } else {
+ /** This filter is documented in wp-includes/user.php */
+ $new_user_login = apply_filters( 'pre_user_login', sanitize_user( wp_unslash( $_REQUEST['user_login'] ), true ) );
+ if ( isset( $_POST['noconfirmation'] ) && current_user_can( 'manage_network_users' ) ) {
+ add_filter( 'wpmu_signup_user_notification', '__return_false' ); // Disable confirmation email
+ add_filter( 'wpmu_welcome_user_notification', '__return_false' ); // Disable welcome email
+ }
+ wpmu_signup_user(
+ $new_user_login,
+ $new_user_email,
+ array(
+ 'add_to_blog' => get_current_blog_id(),
+ 'new_role' => $_REQUEST['role'],
+ )
+ );
+ if ( isset( $_POST['noconfirmation'] ) && current_user_can( 'manage_network_users' ) ) {
+ $key = $wpdb->get_var( $wpdb->prepare( "SELECT activation_key FROM {$wpdb->signups} WHERE user_login = %s AND user_email = %s", $new_user_login, $new_user_email ) );
+ $new_user = wpmu_activate_signup( $key );
+ if ( is_wp_error( $new_user ) ) {
+ $redirect = add_query_arg( array( 'update' => 'addnoconfirmation' ), 'user-new.php' );
+ } elseif ( ! is_user_member_of_blog( $new_user['user_id'] ) ) {
+ $redirect = add_query_arg( array( 'update' => 'created_could_not_add' ), 'user-new.php' );
+ } else {
+ $redirect = add_query_arg(
+ array(
+ 'update' => 'addnoconfirmation',
+ 'user_id' => $new_user['user_id'],
+ ),
+ 'user-new.php'
+ );
+ }
+ } else {
+ $redirect = add_query_arg( array( 'update' => 'newuserconfirmation' ), 'user-new.php' );
+ }
+ wp_redirect( $redirect );
+ die();
+ }
+ }
+}
+
+$title = __( 'Add New User' );
+$parent_file = 'users.php';
+
+$do_both = false;
+if ( is_multisite() && current_user_can( 'promote_users' ) && current_user_can( 'create_users' ) ) {
+ $do_both = true;
+}
+
+$help = '<p>' . __( 'To add a new user to your site, fill in the form on this screen and click the Add New User button at the bottom.' ) . '</p>';
+
+if ( is_multisite() ) {
+ $help .= '<p>' . __( 'Because this is a multisite installation, you may add accounts that already exist on the Network by specifying a username or email, and defining a role. For more options, such as specifying a password, you have to be a Network Administrator and use the hover link under an existing user&#8217;s name to Edit the user profile under Network Admin > All Users.' ) . '</p>' .
+ '<p>' . __( 'New users will receive an email letting them know they&#8217;ve been added as a user for your site. This email will also contain their password. Check the box if you don&#8217;t want the user to receive a welcome email.' ) . '</p>';
+} else {
+ $help .= '<p>' . __( 'New users are automatically assigned a password, which they can change after logging in. You can view or edit the assigned password by clicking the Show Password button. The username cannot be changed once the user has been added.' ) . '</p>' .
+
+ '<p>' . __( 'By default, new users will receive an email letting them know they&#8217;ve been added as a user for your site. This email will also contain a password reset link. Uncheck the box if you don&#8217;t want to send the new user a welcome email.' ) . '</p>';
+}
+
+$help .= '<p>' . __( 'Remember to click the Add New User button at the bottom of this screen when you are finished.' ) . '</p>';
+
+get_current_screen()->add_help_tab(
+ array(
+ 'id' => 'overview',
+ 'title' => __( 'Overview' ),
+ 'content' => $help,
+ )
+);
+
+get_current_screen()->add_help_tab(
+ array(
+ 'id' => 'user-roles',
+ 'title' => __( 'User Roles' ),
+ 'content' => '<p>' . __( 'Here is a basic overview of the different user roles and the permissions associated with each one:' ) . '</p>' .
+ '<ul>' .
+ '<li>' . __( 'Subscribers can read comments/comment/receive newsletters, etc. but cannot create regular site content.' ) . '</li>' .
+ '<li>' . __( 'Contributors can write and manage their posts but not publish posts or upload media files.' ) . '</li>' .
+ '<li>' . __( 'Authors can publish and manage their own posts, and are able to upload files.' ) . '</li>' .
+ '<li>' . __( 'Editors can publish posts, manage posts as well as manage other people&#8217;s posts, etc.' ) . '</li>' .
+ '<li>' . __( 'Administrators have access to all the administration features.' ) . '</li>' .
+ '</ul>',
+ )
+);
+
+get_current_screen()->set_help_sidebar(
+ '<p><strong>' . __( 'For more information:' ) . '</strong></p>' .
+ '<p>' . __( '<a href="https://codex.wordpress.org/Users_Add_New_Screen">Documentation on Adding New Users</a>' ) . '</p>' .
+ '<p>' . __( '<a href="https://wordpress.org/support/">Support</a>' ) . '</p>'
+);
+
+wp_enqueue_script( 'wp-ajax-response' );
+wp_enqueue_script( 'user-profile' );
+
+/**
+ * Filters whether to enable user auto-complete for non-super admins in Multisite.
+ *
+ * @since 3.4.0
+ *
+ * @param bool $enable Whether to enable auto-complete for non-super admins. Default false.
+ */
+if ( is_multisite() && current_user_can( 'promote_users' ) && ! wp_is_large_network( 'users' )
+ && ( current_user_can( 'manage_network_users' ) || apply_filters( 'autocomplete_users_for_site_admins', false ) )
+) {
+ wp_enqueue_script( 'user-suggest' );
+}
+
+require_once( ABSPATH . 'wp-admin/admin-header.php' );
+
+if ( isset( $_GET['update'] ) ) {
+ $messages = array();
+ if ( is_multisite() ) {
+ $edit_link = '';
+ if ( ( isset( $_GET['user_id'] ) ) ) {
+ $user_id_new = absint( $_GET['user_id'] );
+ if ( $user_id_new ) {
+ $edit_link = esc_url( add_query_arg( 'wp_http_referer', urlencode( wp_unslash( $_SERVER['REQUEST_URI'] ) ), get_edit_user_link( $user_id_new ) ) );
+ }
+ }
+
+ switch ( $_GET['update'] ) {
+ case 'newuserconfirmation':
+ $messages[] = __( 'Invitation email sent to new user. A confirmation link must be clicked before their account is created.' );
+ break;
+ case 'add':
+ $messages[] = __( 'Invitation email sent to user. A confirmation link must be clicked for them to be added to your site.' );
+ break;
+ case 'addnoconfirmation':
+ if ( empty( $edit_link ) ) {
+ $messages[] = __( 'User has been added to your site.' );
+ } else {
+ /* translators: %s: edit page url */
+ $messages[] = sprintf( __( 'User has been added to your site. <a href="%s">Edit user</a>' ), $edit_link );
+ }
+ break;
+ case 'addexisting':
+ $messages[] = __( 'That user is already a member of this site.' );
+ break;
+ case 'could_not_add':
+ $add_user_errors = new WP_Error( 'could_not_add', __( 'That user could not be added to this site.' ) );
+ break;
+ case 'created_could_not_add':
+ $add_user_errors = new WP_Error( 'created_could_not_add', __( 'User has been created, but could not be added to this site.' ) );
+ break;
+ case 'does_not_exist':
+ $add_user_errors = new WP_Error( 'does_not_exist', __( 'The requested user does not exist.' ) );
+ break;
+ case 'enter_email':
+ $add_user_errors = new WP_Error( 'enter_email', __( 'Please enter a valid email address.' ) );
+ break;
+ }
+ } else {
+ if ( 'add' == $_GET['update'] ) {
+ $messages[] = __( 'User added.' );
+ }
+ }
+}
+?>
+<div class="wrap">
+<h1 id="add-new-user">
+<?php
+if ( current_user_can( 'create_users' ) ) {
+ _e( 'Add New User' );
+} elseif ( current_user_can( 'promote_users' ) ) {
+ _e( 'Add Existing User' );
+}
+?>
+</h1>
+
+<?php if ( isset( $errors ) && is_wp_error( $errors ) ) : ?>
+ <div class="error">
+ <ul>
+ <?php
+ foreach ( $errors->get_error_messages() as $err ) {
+ echo "<li>$err</li>\n";
+ }
+ ?>
+ </ul>
+ </div>
+ <?php
+endif;
+
+if ( ! empty( $messages ) ) {
+ foreach ( $messages as $msg ) {
+ echo '<div id="message" class="updated notice is-dismissible"><p>' . $msg . '</p></div>';
+ }
+}
+?>
+
+<?php if ( isset( $add_user_errors ) && is_wp_error( $add_user_errors ) ) : ?>
+ <div class="error">
+ <?php
+ foreach ( $add_user_errors->get_error_messages() as $message ) {
+ echo "<p>$message</p>";
+ }
+ ?>
+ </div>
+<?php endif; ?>
+<div id="ajax-response"></div>
+
+<?php
+if ( is_multisite() && current_user_can( 'promote_users' ) ) {
+ if ( $do_both ) {
+ echo '<h2 id="add-existing-user">' . __( 'Add Existing User' ) . '</h2>';
+ }
+ if ( ! current_user_can( 'manage_network_users' ) ) {
+ echo '<p>' . __( 'Enter the email address of an existing user on this network to invite them to this site. That person will be sent an email asking them to confirm the invite.' ) . '</p>';
+ $label = __( 'Email' );
+ $type = 'email';
+ } else {
+ echo '<p>' . __( 'Enter the email address or username of an existing user on this network to invite them to this site. That person will be sent an email asking them to confirm the invite.' ) . '</p>';
+ $label = __( 'Email or Username' );
+ $type = 'text';
+ }
+ ?>
+<form method="post" name="adduser" id="adduser" class="validate" novalidate="novalidate"
+ <?php
+ /**
+ * Fires inside the adduser form tag.
+ *
+ * @since 3.0.0
+ */
+ do_action( 'user_new_form_tag' );
+ ?>
+>
+<input name="action" type="hidden" value="adduser" />
+ <?php wp_nonce_field( 'add-user', '_wpnonce_add-user' ); ?>
+
+<table class="form-table" role="presentation">
+ <tr class="form-field form-required">
+ <th scope="row"><label for="adduser-email"><?php echo $label; ?></label></th>
+ <td><input name="email" type="<?php echo $type; ?>" id="adduser-email" class="wp-suggest-user" value="" /></td>
+ </tr>
+ <tr class="form-field">
+ <th scope="row"><label for="adduser-role"><?php _e( 'Role' ); ?></label></th>
+ <td><select name="role" id="adduser-role">
+ <?php wp_dropdown_roles( get_option( 'default_role' ) ); ?>
+ </select>
+ </td>
+ </tr>
+ <?php if ( current_user_can( 'manage_network_users' ) ) { ?>
+ <tr>
+ <th scope="row"><?php _e( 'Skip Confirmation Email' ); ?></th>
+ <td>
+ <input type="checkbox" name="noconfirmation" id="adduser-noconfirmation" value="1" />
+ <label for="adduser-noconfirmation"><?php _e( 'Add the user without sending an email that requires their confirmation.' ); ?></label>
+ </td>
+ </tr>
+<?php } ?>
+</table>
+ <?php
+ /**
+ * Fires at the end of the new user form.
+ *
+ * Passes a contextual string to make both types of new user forms
+ * uniquely targetable. Contexts are 'add-existing-user' (Multisite),
+ * and 'add-new-user' (single site and network admin).
+ *
+ * @since 3.7.0
+ *
+ * @param string $type A contextual string specifying which type of new user form the hook follows.
+ */
+ do_action( 'user_new_form', 'add-existing-user' );
+ ?>
+ <?php submit_button( __( 'Add Existing User' ), 'primary', 'adduser', true, array( 'id' => 'addusersub' ) ); ?>
+</form>
+ <?php
+} // is_multisite()
+
+if ( current_user_can( 'create_users' ) ) {
+ if ( $do_both ) {
+ echo '<h2 id="create-new-user">' . __( 'Add New User' ) . '</h2>';
+ }
+ ?>
+<p><?php _e( 'Create a brand new user and add them to this site.' ); ?></p>
+<form method="post" name="createuser" id="createuser" class="validate" novalidate="novalidate"
+ <?php
+ /** This action is documented in wp-admin/user-new.php */
+ do_action( 'user_new_form_tag' );
+ ?>
+>
+<input name="action" type="hidden" value="createuser" />
+ <?php wp_nonce_field( 'create-user', '_wpnonce_create-user' ); ?>
+ <?php
+ // Load up the passed data, else set to a default.
+ $creating = isset( $_POST['createuser'] );
+
+ $new_user_login = $creating && isset( $_POST['user_login'] ) ? wp_unslash( $_POST['user_login'] ) : '';
+ $new_user_firstname = $creating && isset( $_POST['first_name'] ) ? wp_unslash( $_POST['first_name'] ) : '';
+ $new_user_lastname = $creating && isset( $_POST['last_name'] ) ? wp_unslash( $_POST['last_name'] ) : '';
+ $new_user_email = $creating && isset( $_POST['email'] ) ? wp_unslash( $_POST['email'] ) : '';
+ $new_user_uri = $creating && isset( $_POST['url'] ) ? wp_unslash( $_POST['url'] ) : '';
+ $new_user_role = $creating && isset( $_POST['role'] ) ? wp_unslash( $_POST['role'] ) : '';
+ $new_user_send_notification = $creating && ! isset( $_POST['send_user_notification'] ) ? false : true;
+ $new_user_ignore_pass = $creating && isset( $_POST['noconfirmation'] ) ? wp_unslash( $_POST['noconfirmation'] ) : '';
+
+ ?>
+<table class="form-table" role="presentation">
+ <tr class="form-field form-required">
+ <th scope="row"><label for="user_login"><?php _e( 'Username' ); ?> <span class="description"><?php _e( '(required)' ); ?></span></label></th>
+ <td><input name="user_login" type="text" id="user_login" value="<?php echo esc_attr( $new_user_login ); ?>" aria-required="true" autocapitalize="none" autocorrect="off" maxlength="60" /></td>
+ </tr>
+ <tr class="form-field form-required">
+ <th scope="row"><label for="email"><?php _e( 'Email' ); ?> <span class="description"><?php _e( '(required)' ); ?></span></label></th>
+ <td><input name="email" type="email" id="email" value="<?php echo esc_attr( $new_user_email ); ?>" /></td>
+ </tr>
+ <?php if ( ! is_multisite() ) { ?>
+ <tr class="form-field">
+ <th scope="row"><label for="first_name"><?php _e( 'First Name' ); ?> </label></th>
+ <td><input name="first_name" type="text" id="first_name" value="<?php echo esc_attr( $new_user_firstname ); ?>" /></td>
+ </tr>
+ <tr class="form-field">
+ <th scope="row"><label for="last_name"><?php _e( 'Last Name' ); ?> </label></th>
+ <td><input name="last_name" type="text" id="last_name" value="<?php echo esc_attr( $new_user_lastname ); ?>" /></td>
+ </tr>
+ <tr class="form-field">
+ <th scope="row"><label for="url"><?php _e( 'Website' ); ?></label></th>
+ <td><input name="url" type="url" id="url" class="code" value="<?php echo esc_attr( $new_user_uri ); ?>" /></td>
+ </tr>
+ <tr class="form-field form-required user-pass1-wrap">
+ <th scope="row">
+ <label for="pass1">
+ <?php _e( 'Password' ); ?>
+ <span class="description hide-if-js"><?php _e( '(required)' ); ?></span>
+ </label>
+ </th>
+ <td>
+ <input class="hidden" value=" " /><!-- #24364 workaround -->
+ <button type="button" class="button wp-generate-pw hide-if-no-js"><?php _e( 'Show password' ); ?></button>
+ <div class="wp-pwd hide-if-js">
+ <?php $initial_password = wp_generate_password( 24 ); ?>
+ <span class="password-input-wrapper">
+ <input type="password" name="pass1" id="pass1" class="regular-text" autocomplete="off" data-reveal="1" data-pw="<?php echo esc_attr( $initial_password ); ?>" aria-describedby="pass-strength-result" />
+ </span>
+ <button type="button" class="button wp-hide-pw hide-if-no-js" data-toggle="0" aria-label="<?php esc_attr_e( 'Hide password' ); ?>">
+ <span class="dashicons dashicons-hidden" aria-hidden="true"></span>
+ <span class="text"><?php _e( 'Hide' ); ?></span>
+ </button>
+ <button type="button" class="button wp-cancel-pw hide-if-no-js" data-toggle="0" aria-label="<?php esc_attr_e( 'Cancel password change' ); ?>">
+ <span class="dashicons dashicons-no" aria-hidden="true"></span>
+ <span class="text"><?php _e( 'Cancel' ); ?></span>
+ </button>
+ <div style="display:none" id="pass-strength-result" aria-live="polite"></div>
+ </div>
+ </td>
+ </tr>
+ <tr class="form-field form-required user-pass2-wrap hide-if-js">
+ <th scope="row"><label for="pass2"><?php _e( 'Repeat Password' ); ?> <span class="description"><?php _e( '(required)' ); ?></span></label></th>
+ <td>
+ <input name="pass2" type="password" id="pass2" autocomplete="off" />
+ </td>
+ </tr>
+ <tr class="pw-weak">
+ <th><?php _e( 'Confirm Password' ); ?></th>
+ <td>
+ <label>
+ <input type="checkbox" name="pw_weak" class="pw-checkbox" />
+ <?php _e( 'Confirm use of weak password' ); ?>
+ </label>
+ </td>
+ </tr>
+ <tr>
+ <th scope="row"><?php _e( 'Send User Notification' ); ?></th>
+ <td>
+ <input type="checkbox" name="send_user_notification" id="send_user_notification" value="1" <?php checked( $new_user_send_notification ); ?> />
+ <label for="send_user_notification"><?php _e( 'Send the new user an email about their account.' ); ?></label>
+ </td>
+ </tr>
+<?php } // !is_multisite ?>
+ <tr class="form-field">
+ <th scope="row"><label for="role"><?php _e( 'Role' ); ?></label></th>
+ <td><select name="role" id="role">
+ <?php
+ if ( ! $new_user_role ) {
+ $new_user_role = ! empty( $current_role ) ? $current_role : get_option( 'default_role' );
+ }
+ wp_dropdown_roles( $new_user_role );
+ ?>
+ </select>
+ </td>
+ </tr>
+ <?php if ( is_multisite() && current_user_can( 'manage_network_users' ) ) { ?>
+ <tr>
+ <th scope="row"><?php _e( 'Skip Confirmation Email' ); ?></th>
+ <td>
+ <input type="checkbox" name="noconfirmation" id="noconfirmation" value="1" <?php checked( $new_user_ignore_pass ); ?> />
+ <label for="noconfirmation"><?php _e( 'Add the user without sending an email that requires their confirmation.' ); ?></label>
+ </td>
+ </tr>
+ <?php } ?>
+</table>
+
+ <?php
+ /** This action is documented in wp-admin/user-new.php */
+ do_action( 'user_new_form', 'add-new-user' );
+ ?>
+
+ <?php submit_button( __( 'Add New User' ), 'primary', 'createuser', true, array( 'id' => 'createusersub' ) ); ?>
+
+</form>
+<?php } // current_user_can('create_users') ?>
+</div>
+<?php
+include( ABSPATH . 'wp-admin/admin-footer.php' );
diff --git a/www/crm/wp-admin/user/about.php b/www/crm/wp-admin/user/about.php
new file mode 100644
index 00000000..b7943550
--- /dev/null
+++ b/www/crm/wp-admin/user/about.php
@@ -0,0 +1,13 @@
+<?php
+/**
+ * User Dashboard About administration panel.
+ *
+ * @package WordPress
+ * @subpackage Administration
+ * @since 3.4.0
+ */
+
+/** Load WordPress Administration Bootstrap */
+require_once( dirname( __FILE__ ) . '/admin.php' );
+
+require( ABSPATH . 'wp-admin/about.php' );
diff --git a/www/crm/wp-admin/user/admin.php b/www/crm/wp-admin/user/admin.php
new file mode 100644
index 00000000..9df8f202
--- /dev/null
+++ b/www/crm/wp-admin/user/admin.php
@@ -0,0 +1,32 @@
+<?php
+/**
+ * WordPress User Administration Bootstrap
+ *
+ * @package WordPress
+ * @subpackage Administration
+ * @since 3.1.0
+ */
+
+define( 'WP_USER_ADMIN', true );
+
+require_once( dirname( dirname( __FILE__ ) ) . '/admin.php' );
+
+if ( ! is_multisite() ) {
+ wp_redirect( admin_url() );
+ exit;
+}
+
+$redirect_user_admin_request = ( ( $current_blog->domain != $current_site->domain ) || ( $current_blog->path != $current_site->path ) );
+/**
+ * Filters whether to redirect the request to the User Admin in Multisite.
+ *
+ * @since 3.2.0
+ *
+ * @param bool $redirect_user_admin_request Whether the request should be redirected.
+ */
+$redirect_user_admin_request = apply_filters( 'redirect_user_admin_request', $redirect_user_admin_request );
+if ( $redirect_user_admin_request ) {
+ wp_redirect( user_admin_url() );
+ exit;
+}
+unset( $redirect_user_admin_request );
diff --git a/www/crm/wp-admin/user/credits.php b/www/crm/wp-admin/user/credits.php
new file mode 100644
index 00000000..2b4021ac
--- /dev/null
+++ b/www/crm/wp-admin/user/credits.php
@@ -0,0 +1,13 @@
+<?php
+/**
+ * User Dashboard Credits administration panel.
+ *
+ * @package WordPress
+ * @subpackage Administration
+ * @since 3.4.0
+ */
+
+/** Load WordPress Administration Bootstrap */
+require_once( dirname( __FILE__ ) . '/admin.php' );
+
+require( ABSPATH . 'wp-admin/credits.php' );
diff --git a/www/crm/wp-admin/user/freedoms.php b/www/crm/wp-admin/user/freedoms.php
new file mode 100644
index 00000000..d2b77b56
--- /dev/null
+++ b/www/crm/wp-admin/user/freedoms.php
@@ -0,0 +1,13 @@
+<?php
+/**
+ * User Dashboard Freedoms administration panel.
+ *
+ * @package WordPress
+ * @subpackage Administration
+ * @since 3.4.0
+ */
+
+/** Load WordPress Administration Bootstrap */
+require_once( dirname( __FILE__ ) . '/admin.php' );
+
+require( ABSPATH . 'wp-admin/freedoms.php' );
diff --git a/www/crm/wp-admin/user/index.php b/www/crm/wp-admin/user/index.php
new file mode 100644
index 00000000..7cff6a70
--- /dev/null
+++ b/www/crm/wp-admin/user/index.php
@@ -0,0 +1,13 @@
+<?php
+/**
+ * User Dashboard Administration Screen
+ *
+ * @package WordPress
+ * @subpackage Administration
+ * @since 3.1.0
+ */
+
+/** Load WordPress Administration Bootstrap */
+require_once( dirname( __FILE__ ) . '/admin.php' );
+
+require( ABSPATH . 'wp-admin/index.php' );
diff --git a/www/crm/wp-admin/user/menu.php b/www/crm/wp-admin/user/menu.php
new file mode 100644
index 00000000..47ef7842
--- /dev/null
+++ b/www/crm/wp-admin/user/menu.php
@@ -0,0 +1,22 @@
+<?php
+/**
+ * Build User Administration Menu.
+ *
+ * @package WordPress
+ * @subpackage Administration
+ * @since 3.1.0
+ */
+
+$menu[2] = array( __( 'Dashboard' ), 'exist', 'index.php', '', 'menu-top menu-top-first menu-icon-dashboard', 'menu-dashboard', 'dashicons-dashboard' );
+
+$menu[4] = array( '', 'exist', 'separator1', '', 'wp-menu-separator' );
+
+$menu[70] = array( __( 'Profile' ), 'exist', 'profile.php', '', 'menu-top menu-icon-users', 'menu-users', 'dashicons-admin-users' );
+
+$menu[99] = array( '', 'exist', 'separator-last', '', 'wp-menu-separator' );
+
+$_wp_real_parent_file['users.php'] = 'profile.php';
+$compat = array();
+$submenu = array();
+
+require_once( ABSPATH . 'wp-admin/includes/menu.php' );
diff --git a/www/crm/wp-admin/user/privacy.php b/www/crm/wp-admin/user/privacy.php
new file mode 100644
index 00000000..8b28eea6
--- /dev/null
+++ b/www/crm/wp-admin/user/privacy.php
@@ -0,0 +1,13 @@
+<?php
+/**
+ * User Dashboard Privacy administration panel.
+ *
+ * @package WordPress
+ * @subpackage Administration
+ * @since 4.9.0
+ */
+
+/** Load WordPress Administration Bootstrap */
+require_once( dirname( __FILE__ ) . '/admin.php' );
+
+require( ABSPATH . 'wp-admin/privacy.php' );
diff --git a/www/crm/wp-admin/user/profile.php b/www/crm/wp-admin/user/profile.php
new file mode 100644
index 00000000..2f707099
--- /dev/null
+++ b/www/crm/wp-admin/user/profile.php
@@ -0,0 +1,13 @@
+<?php
+/**
+ * User Profile Administration Screen.
+ *
+ * @package WordPress
+ * @subpackage Administration
+ * @since 3.1.0
+ */
+
+/** Load WordPress Administration Bootstrap */
+require_once( dirname( __FILE__ ) . '/admin.php' );
+
+require( ABSPATH . 'wp-admin/profile.php' );
diff --git a/www/crm/wp-admin/user/user-edit.php b/www/crm/wp-admin/user/user-edit.php
new file mode 100644
index 00000000..0819573f
--- /dev/null
+++ b/www/crm/wp-admin/user/user-edit.php
@@ -0,0 +1,13 @@
+<?php
+/**
+ * Edit user administration panel.
+ *
+ * @package WordPress
+ * @subpackage Administration
+ * @since 3.1.0
+ */
+
+/** Load WordPress Administration Bootstrap */
+require_once( dirname( __FILE__ ) . '/admin.php' );
+
+require( ABSPATH . 'wp-admin/user-edit.php' );
diff --git a/www/crm/wp-admin/users.php b/www/crm/wp-admin/users.php
new file mode 100644
index 00000000..8827b73b
--- /dev/null
+++ b/www/crm/wp-admin/users.php
@@ -0,0 +1,588 @@
+<?php
+/**
+ * User administration panel
+ *
+ * @package WordPress
+ * @subpackage Administration
+ * @since 1.0.0
+ */
+
+/** WordPress Administration Bootstrap */
+require_once( dirname( __FILE__ ) . '/admin.php' );
+
+if ( ! current_user_can( 'list_users' ) ) {
+ wp_die(
+ '<h1>' . __( 'You need a higher level of permission.' ) . '</h1>' .
+ '<p>' . __( 'Sorry, you are not allowed to list users.' ) . '</p>',
+ 403
+ );
+}
+
+$wp_list_table = _get_list_table( 'WP_Users_List_Table' );
+$pagenum = $wp_list_table->get_pagenum();
+$title = __( 'Users' );
+$parent_file = 'users.php';
+
+add_screen_option( 'per_page' );
+
+// contextual help - choose Help on the top right of admin panel to preview this.
+get_current_screen()->add_help_tab(
+ array(
+ 'id' => 'overview',
+ 'title' => __( 'Overview' ),
+ 'content' => '<p>' . __( 'This screen lists all the existing users for your site. Each user has one of five defined roles as set by the site admin: Site Administrator, Editor, Author, Contributor, or Subscriber. Users with roles other than Administrator will see fewer options in the dashboard navigation when they are logged in, based on their role.' ) . '</p>' .
+ '<p>' . __( 'To add a new user for your site, click the Add New button at the top of the screen or Add New in the Users menu section.' ) . '</p>',
+ )
+);
+
+get_current_screen()->add_help_tab(
+ array(
+ 'id' => 'screen-content',
+ 'title' => __( 'Screen Content' ),
+ 'content' => '<p>' . __( 'You can customize the display of this screen in a number of ways:' ) . '</p>' .
+ '<ul>' .
+ '<li>' . __( 'You can hide/display columns based on your needs and decide how many users to list per screen using the Screen Options tab.' ) . '</li>' .
+ '<li>' . __( 'You can filter the list of users by User Role using the text links above the users list to show All, Administrator, Editor, Author, Contributor, or Subscriber. The default view is to show all users. Unused User Roles are not listed.' ) . '</li>' .
+ '<li>' . __( 'You can view all posts made by a user by clicking on the number under the Posts column.' ) . '</li>' .
+ '</ul>',
+ )
+);
+
+$help = '<p>' . __( 'Hovering over a row in the users list will display action links that allow you to manage users. You can perform the following actions:' ) . '</p>' .
+ '<ul>' .
+ '<li>' . __( '<strong>Edit</strong> takes you to the editable profile screen for that user. You can also reach that screen by clicking on the username.' ) . '</li>';
+
+if ( is_multisite() ) {
+ $help .= '<li>' . __( '<strong>Remove</strong> allows you to remove a user from your site. It does not delete their content. You can also remove multiple users at once by using Bulk Actions.' ) . '</li>';
+} else {
+ $help .= '<li>' . __( '<strong>Delete</strong> brings you to the Delete Users screen for confirmation, where you can permanently remove a user from your site and delete their content. You can also delete multiple users at once by using Bulk Actions.' ) . '</li>';
+}
+
+$help .= '</ul>';
+
+get_current_screen()->add_help_tab(
+ array(
+ 'id' => 'action-links',
+ 'title' => __( 'Available Actions' ),
+ 'content' => $help,
+ )
+);
+unset( $help );
+
+get_current_screen()->set_help_sidebar(
+ '<p><strong>' . __( 'For more information:' ) . '</strong></p>' .
+ '<p>' . __( '<a href="https://codex.wordpress.org/Users_Screen">Documentation on Managing Users</a>' ) . '</p>' .
+ '<p>' . __( '<a href="https://codex.wordpress.org/Roles_and_Capabilities">Descriptions of Roles and Capabilities</a>' ) . '</p>' .
+ '<p>' . __( '<a href="https://wordpress.org/support/">Support</a>' ) . '</p>'
+);
+
+get_current_screen()->set_screen_reader_content(
+ array(
+ 'heading_views' => __( 'Filter users list' ),
+ 'heading_pagination' => __( 'Users list navigation' ),
+ 'heading_list' => __( 'Users list' ),
+ )
+);
+
+if ( empty( $_REQUEST ) ) {
+ $referer = '<input type="hidden" name="wp_http_referer" value="' . esc_attr( wp_unslash( $_SERVER['REQUEST_URI'] ) ) . '" />';
+} elseif ( isset( $_REQUEST['wp_http_referer'] ) ) {
+ $redirect = remove_query_arg( array( 'wp_http_referer', 'updated', 'delete_count' ), wp_unslash( $_REQUEST['wp_http_referer'] ) );
+ $referer = '<input type="hidden" name="wp_http_referer" value="' . esc_attr( $redirect ) . '" />';
+} else {
+ $redirect = 'users.php';
+ $referer = '';
+}
+
+$update = '';
+
+switch ( $wp_list_table->current_action() ) {
+
+ /* Bulk Dropdown menu Role changes */
+ case 'promote':
+ check_admin_referer( 'bulk-users' );
+
+ if ( ! current_user_can( 'promote_users' ) ) {
+ wp_die( __( 'Sorry, you are not allowed to edit this user.' ), 403 );
+ }
+
+ if ( empty( $_REQUEST['users'] ) ) {
+ wp_redirect( $redirect );
+ exit();
+ }
+
+ $editable_roles = get_editable_roles();
+ $role = false;
+ if ( ! empty( $_REQUEST['new_role2'] ) ) {
+ $role = $_REQUEST['new_role2'];
+ } elseif ( ! empty( $_REQUEST['new_role'] ) ) {
+ $role = $_REQUEST['new_role'];
+ }
+
+ if ( ! $role || empty( $editable_roles[ $role ] ) ) {
+ wp_die( __( 'Sorry, you are not allowed to give users that role.' ), 403 );
+ }
+
+ $userids = $_REQUEST['users'];
+ $update = 'promote';
+ foreach ( $userids as $id ) {
+ $id = (int) $id;
+
+ if ( ! current_user_can( 'promote_user', $id ) ) {
+ wp_die( __( 'Sorry, you are not allowed to edit this user.' ), 403 );
+ }
+ // The new role of the current user must also have the promote_users cap or be a multisite super admin
+ if ( $id == $current_user->ID && ! $wp_roles->role_objects[ $role ]->has_cap( 'promote_users' )
+ && ! ( is_multisite() && current_user_can( 'manage_network_users' ) ) ) {
+ $update = 'err_admin_role';
+ continue;
+ }
+
+ // If the user doesn't already belong to the blog, bail.
+ if ( is_multisite() && ! is_user_member_of_blog( $id ) ) {
+ wp_die(
+ '<h1>' . __( 'Something went wrong.' ) . '</h1>' .
+ '<p>' . __( 'One of the selected users is not a member of this site.' ) . '</p>',
+ 403
+ );
+ }
+
+ $user = get_userdata( $id );
+ $user->set_role( $role );
+ }
+
+ wp_redirect( add_query_arg( 'update', $update, $redirect ) );
+ exit();
+
+ case 'dodelete':
+ if ( is_multisite() ) {
+ wp_die( __( 'User deletion is not allowed from this screen.' ), 400 );
+ }
+
+ check_admin_referer( 'delete-users' );
+
+ if ( empty( $_REQUEST['users'] ) ) {
+ wp_redirect( $redirect );
+ exit();
+ }
+
+ $userids = array_map( 'intval', (array) $_REQUEST['users'] );
+
+ if ( empty( $_REQUEST['delete_option'] ) ) {
+ $url = self_admin_url( 'users.php?action=delete&users[]=' . implode( '&users[]=', $userids ) . '&error=true' );
+ $url = str_replace( '&amp;', '&', wp_nonce_url( $url, 'bulk-users' ) );
+ wp_redirect( $url );
+ exit;
+ }
+
+ if ( ! current_user_can( 'delete_users' ) ) {
+ wp_die( __( 'Sorry, you are not allowed to delete users.' ), 403 );
+ }
+
+ $update = 'del';
+ $delete_count = 0;
+
+ foreach ( $userids as $id ) {
+ if ( ! current_user_can( 'delete_user', $id ) ) {
+ wp_die( __( 'Sorry, you are not allowed to delete that user.' ), 403 );
+ }
+
+ if ( $id == $current_user->ID ) {
+ $update = 'err_admin_del';
+ continue;
+ }
+ switch ( $_REQUEST['delete_option'] ) {
+ case 'delete':
+ wp_delete_user( $id );
+ break;
+ case 'reassign':
+ wp_delete_user( $id, $_REQUEST['reassign_user'] );
+ break;
+ }
+ ++$delete_count;
+ }
+
+ $redirect = add_query_arg(
+ array(
+ 'delete_count' => $delete_count,
+ 'update' => $update,
+ ),
+ $redirect
+ );
+ wp_redirect( $redirect );
+ exit();
+
+ case 'delete':
+ if ( is_multisite() ) {
+ wp_die( __( 'User deletion is not allowed from this screen.' ), 400 );
+ }
+
+ check_admin_referer( 'bulk-users' );
+
+ if ( empty( $_REQUEST['users'] ) && empty( $_REQUEST['user'] ) ) {
+ wp_redirect( $redirect );
+ exit();
+ }
+
+ if ( ! current_user_can( 'delete_users' ) ) {
+ $errors = new WP_Error( 'edit_users', __( 'Sorry, you are not allowed to delete users.' ) );
+ }
+
+ if ( empty( $_REQUEST['users'] ) ) {
+ $userids = array( intval( $_REQUEST['user'] ) );
+ } else {
+ $userids = array_map( 'intval', (array) $_REQUEST['users'] );
+ }
+
+ /**
+ * Filters whether the users being deleted have additional content
+ * associated with them outside of the `post_author` and `link_owner` relationships.
+ *
+ * @since 5.2.0
+ *
+ * @param boolean $users_have_additional_content Whether the users have additional content. Default false.
+ * @param int[] $userids Array of IDs for users being deleted.
+ */
+ $users_have_content = (bool) apply_filters( 'users_have_additional_content', false, $userids );
+
+ if ( ! $users_have_content ) {
+ if ( $wpdb->get_var( "SELECT ID FROM {$wpdb->posts} WHERE post_author IN( " . implode( ',', $userids ) . ' ) LIMIT 1' ) ) {
+ $users_have_content = true;
+ } elseif ( $wpdb->get_var( "SELECT link_id FROM {$wpdb->links} WHERE link_owner IN( " . implode( ',', $userids ) . ' ) LIMIT 1' ) ) {
+ $users_have_content = true;
+ }
+ }
+
+ if ( $users_have_content ) {
+ add_action( 'admin_head', 'delete_users_add_js' );
+ }
+
+ include( ABSPATH . 'wp-admin/admin-header.php' );
+ ?>
+ <form method="post" name="updateusers" id="updateusers">
+ <?php wp_nonce_field( 'delete-users' ); ?>
+ <?php echo $referer; ?>
+
+<div class="wrap">
+<h1><?php _e( 'Delete Users' ); ?></h1>
+ <?php if ( isset( $_REQUEST['error'] ) ) : ?>
+ <div class="error">
+ <p><strong><?php _e( 'ERROR:' ); ?></strong> <?php _e( 'Please select an option.' ); ?></p>
+ </div>
+ <?php endif; ?>
+
+ <?php if ( 1 == count( $userids ) ) : ?>
+ <p><?php _e( 'You have specified this user for deletion:' ); ?></p>
+ <?php else : ?>
+ <p><?php _e( 'You have specified these users for deletion:' ); ?></p>
+ <?php endif; ?>
+
+<ul>
+ <?php
+ $go_delete = 0;
+ foreach ( $userids as $id ) {
+ $user = get_userdata( $id );
+ if ( $id == $current_user->ID ) {
+ /* translators: 1: user id, 2: user login */
+ echo '<li>' . sprintf( __( 'ID #%1$s: %2$s <strong>The current user will not be deleted.</strong>' ), $id, $user->user_login ) . "</li>\n";
+ } else {
+ /* translators: 1: user id, 2: user login */
+ echo '<li><input type="hidden" name="users[]" value="' . esc_attr( $id ) . '" />' . sprintf( __( 'ID #%1$s: %2$s' ), $id, $user->user_login ) . "</li>\n";
+ $go_delete++;
+ }
+ }
+ ?>
+ </ul>
+ <?php
+ if ( $go_delete ) :
+
+ if ( ! $users_have_content ) :
+ ?>
+ <input type="hidden" name="delete_option" value="delete" />
+ <?php else : ?>
+ <?php if ( 1 == $go_delete ) : ?>
+ <fieldset><p><legend><?php _e( 'What should be done with content owned by this user?' ); ?></legend></p>
+ <?php else : ?>
+ <fieldset><p><legend><?php _e( 'What should be done with content owned by these users?' ); ?></legend></p>
+ <?php endif; ?>
+ <ul style="list-style:none;">
+ <li><label><input type="radio" id="delete_option0" name="delete_option" value="delete" />
+ <?php _e( 'Delete all content.' ); ?></label></li>
+ <li><input type="radio" id="delete_option1" name="delete_option" value="reassign" />
+ <?php
+ echo '<label for="delete_option1">' . __( 'Attribute all content to:' ) . '</label> ';
+ wp_dropdown_users(
+ array(
+ 'name' => 'reassign_user',
+ 'exclude' => array_diff( $userids, array( $current_user->ID ) ),
+ 'show' => 'display_name_with_login',
+ )
+ );
+ ?>
+ </li>
+ </ul></fieldset>
+ <?php
+ endif;
+ /**
+ * Fires at the end of the delete users form prior to the confirm button.
+ *
+ * @since 4.0.0
+ * @since 4.5.0 The `$userids` parameter was added.
+ *
+ * @param WP_User $current_user WP_User object for the current user.
+ * @param int[] $userids Array of IDs for users being deleted.
+ */
+ do_action( 'delete_user_form', $current_user, $userids );
+ ?>
+ <input type="hidden" name="action" value="dodelete" />
+ <?php submit_button( __( 'Confirm Deletion' ), 'primary' ); ?>
+ <?php else : ?>
+ <p><?php _e( 'There are no valid users selected for deletion.' ); ?></p>
+ <?php endif; ?>
+ </div>
+ </form>
+ <?php
+
+ break;
+
+ case 'doremove':
+ check_admin_referer( 'remove-users' );
+
+ if ( ! is_multisite() ) {
+ wp_die( __( 'You can&#8217;t remove users.' ), 400 );
+ }
+
+ if ( empty( $_REQUEST['users'] ) ) {
+ wp_redirect( $redirect );
+ exit;
+ }
+
+ if ( ! current_user_can( 'remove_users' ) ) {
+ wp_die( __( 'Sorry, you are not allowed to remove users.' ), 403 );
+ }
+
+ $userids = $_REQUEST['users'];
+
+ $update = 'remove';
+ foreach ( $userids as $id ) {
+ $id = (int) $id;
+ if ( ! current_user_can( 'remove_user', $id ) ) {
+ $update = 'err_admin_remove';
+ continue;
+ }
+ remove_user_from_blog( $id, $blog_id );
+ }
+
+ $redirect = add_query_arg( array( 'update' => $update ), $redirect );
+ wp_redirect( $redirect );
+ exit;
+
+ case 'remove':
+ check_admin_referer( 'bulk-users' );
+
+ if ( ! is_multisite() ) {
+ wp_die( __( 'You can&#8217;t remove users.' ), 400 );
+ }
+
+ if ( empty( $_REQUEST['users'] ) && empty( $_REQUEST['user'] ) ) {
+ wp_redirect( $redirect );
+ exit();
+ }
+
+ if ( ! current_user_can( 'remove_users' ) ) {
+ $error = new WP_Error( 'edit_users', __( 'Sorry, you are not allowed to remove users.' ) );
+ }
+
+ if ( empty( $_REQUEST['users'] ) ) {
+ $userids = array( intval( $_REQUEST['user'] ) );
+ } else {
+ $userids = $_REQUEST['users'];
+ }
+
+ include( ABSPATH . 'wp-admin/admin-header.php' );
+ ?>
+ <form method="post" name="updateusers" id="updateusers">
+ <?php wp_nonce_field( 'remove-users' ); ?>
+ <?php echo $referer; ?>
+
+<div class="wrap">
+<h1><?php _e( 'Remove Users from Site' ); ?></h1>
+
+ <?php if ( 1 == count( $userids ) ) : ?>
+ <p><?php _e( 'You have specified this user for removal:' ); ?></p>
+ <?php else : ?>
+ <p><?php _e( 'You have specified these users for removal:' ); ?></p>
+ <?php endif; ?>
+
+<ul>
+ <?php
+ $go_remove = false;
+ foreach ( $userids as $id ) {
+ $id = (int) $id;
+ $user = get_userdata( $id );
+ if ( ! current_user_can( 'remove_user', $id ) ) {
+ /* translators: 1: user id, 2: user login */
+ echo '<li>' . sprintf( __( 'ID #%1$s: %2$s <strong>Sorry, you are not allowed to remove this user.</strong>' ), $id, $user->user_login ) . "</li>\n";
+ } else {
+ /* translators: 1: user id, 2: user login */
+ echo "<li><input type=\"hidden\" name=\"users[]\" value=\"{$id}\" />" . sprintf( __( 'ID #%1$s: %2$s' ), $id, $user->user_login ) . "</li>\n";
+ $go_remove = true;
+ }
+ }
+ ?>
+ </ul>
+ <?php if ( $go_remove ) : ?>
+ <input type="hidden" name="action" value="doremove" />
+ <?php submit_button( __( 'Confirm Removal' ), 'primary' ); ?>
+ <?php else : ?>
+ <p><?php _e( 'There are no valid users selected for removal.' ); ?></p>
+ <?php endif; ?>
+ </div>
+ </form>
+ <?php
+
+ break;
+
+ default:
+ if ( ! empty( $_GET['_wp_http_referer'] ) ) {
+ wp_redirect( remove_query_arg( array( '_wp_http_referer', '_wpnonce' ), wp_unslash( $_SERVER['REQUEST_URI'] ) ) );
+ exit;
+ }
+
+ if ( $wp_list_table->current_action() && ! empty( $_REQUEST['users'] ) ) {
+ $userids = $_REQUEST['users'];
+ $sendback = wp_get_referer();
+
+ /** This action is documented in wp-admin/edit-comments.php */
+ $sendback = apply_filters( 'handle_bulk_actions-' . get_current_screen()->id, $sendback, $wp_list_table->current_action(), $userids );
+
+ wp_safe_redirect( $sendback );
+ exit;
+ }
+
+ $wp_list_table->prepare_items();
+ $total_pages = $wp_list_table->get_pagination_arg( 'total_pages' );
+ if ( $pagenum > $total_pages && $total_pages > 0 ) {
+ wp_redirect( add_query_arg( 'paged', $total_pages ) );
+ exit;
+ }
+
+ include( ABSPATH . 'wp-admin/admin-header.php' );
+
+ $messages = array();
+ if ( isset( $_GET['update'] ) ) :
+ switch ( $_GET['update'] ) {
+ case 'del':
+ case 'del_many':
+ $delete_count = isset( $_GET['delete_count'] ) ? (int) $_GET['delete_count'] : 0;
+ if ( 1 == $delete_count ) {
+ $message = __( 'User deleted.' );
+ } else {
+ $message = _n( '%s user deleted.', '%s users deleted.', $delete_count );
+ }
+ $messages[] = '<div id="message" class="updated notice is-dismissible"><p>' . sprintf( $message, number_format_i18n( $delete_count ) ) . '</p></div>';
+ break;
+ case 'add':
+ if ( isset( $_GET['id'] ) && ( $user_id = $_GET['id'] ) && current_user_can( 'edit_user', $user_id ) ) {
+ /* translators: %s: edit page url */
+ $messages[] = '<div id="message" class="updated notice is-dismissible"><p>' . sprintf(
+ __( 'New user created. <a href="%s">Edit user</a>' ),
+ esc_url(
+ add_query_arg(
+ 'wp_http_referer',
+ urlencode( wp_unslash( $_SERVER['REQUEST_URI'] ) ),
+ self_admin_url( 'user-edit.php?user_id=' . $user_id )
+ )
+ )
+ ) . '</p></div>';
+ } else {
+ $messages[] = '<div id="message" class="updated notice is-dismissible"><p>' . __( 'New user created.' ) . '</p></div>';
+ }
+ break;
+ case 'promote':
+ $messages[] = '<div id="message" class="updated notice is-dismissible"><p>' . __( 'Changed roles.' ) . '</p></div>';
+ break;
+ case 'err_admin_role':
+ $messages[] = '<div id="message" class="error notice is-dismissible"><p>' . __( 'The current user&#8217;s role must have user editing capabilities.' ) . '</p></div>';
+ $messages[] = '<div id="message" class="updated notice is-dismissible"><p>' . __( 'Other user roles have been changed.' ) . '</p></div>';
+ break;
+ case 'err_admin_del':
+ $messages[] = '<div id="message" class="error notice is-dismissible"><p>' . __( 'You can&#8217;t delete the current user.' ) . '</p></div>';
+ $messages[] = '<div id="message" class="updated notice is-dismissible"><p>' . __( 'Other users have been deleted.' ) . '</p></div>';
+ break;
+ case 'remove':
+ $messages[] = '<div id="message" class="updated notice is-dismissible fade"><p>' . __( 'User removed from this site.' ) . '</p></div>';
+ break;
+ case 'err_admin_remove':
+ $messages[] = '<div id="message" class="error notice is-dismissible"><p>' . __( "You can't remove the current user." ) . '</p></div>';
+ $messages[] = '<div id="message" class="updated notice is-dismissible fade"><p>' . __( 'Other users have been removed.' ) . '</p></div>';
+ break;
+ }
+ endif;
+ ?>
+
+ <?php if ( isset( $errors ) && is_wp_error( $errors ) ) : ?>
+ <div class="error">
+ <ul>
+ <?php
+ foreach ( $errors->get_error_messages() as $err ) {
+ echo "<li>$err</li>\n";
+ }
+ ?>
+ </ul>
+ </div>
+ <?php
+ endif;
+
+ if ( ! empty( $messages ) ) {
+ foreach ( $messages as $msg ) {
+ echo $msg;
+ }
+ }
+ ?>
+
+ <div class="wrap">
+ <h1 class="wp-heading-inline">
+ <?php
+ echo esc_html( $title );
+ ?>
+</h1>
+
+ <?php
+ if ( current_user_can( 'create_users' ) ) {
+ ?>
+ <a href="<?php echo admin_url( 'user-new.php' ); ?>" class="page-title-action"><?php echo esc_html_x( 'Add New', 'user' ); ?></a>
+<?php } elseif ( is_multisite() && current_user_can( 'promote_users' ) ) { ?>
+ <a href="<?php echo admin_url( 'user-new.php' ); ?>" class="page-title-action"><?php echo esc_html_x( 'Add Existing', 'user' ); ?></a>
+ <?php
+}
+
+if ( strlen( $usersearch ) ) {
+ /* translators: %s: search keywords */
+ printf( '<span class="subtitle">' . __( 'Search results for &#8220;%s&#8221;' ) . '</span>', esc_html( $usersearch ) );
+}
+?>
+
+<hr class="wp-header-end">
+
+ <?php $wp_list_table->views(); ?>
+
+<form method="get">
+
+ <?php $wp_list_table->search_box( __( 'Search Users' ), 'user' ); ?>
+
+ <?php if ( ! empty( $_REQUEST['role'] ) ) { ?>
+<input type="hidden" name="role" value="<?php echo esc_attr( $_REQUEST['role'] ); ?>" />
+<?php } ?>
+
+ <?php $wp_list_table->display(); ?>
+</form>
+
+<br class="clear" />
+</div>
+ <?php
+ break;
+
+} // end of the $doaction switch
+
+include( ABSPATH . 'wp-admin/admin-footer.php' );
diff --git a/www/crm/wp-admin/widgets.php b/www/crm/wp-admin/widgets.php
new file mode 100644
index 00000000..eacdbb08
--- /dev/null
+++ b/www/crm/wp-admin/widgets.php
@@ -0,0 +1,568 @@
+<?php
+/**
+ * Widget administration panel
+ *
+ * @package WordPress
+ * @subpackage Administration
+ */
+
+/** WordPress Administration Bootstrap */
+require_once( dirname( __FILE__ ) . '/admin.php' );
+
+/** WordPress Administration Widgets API */
+require_once( ABSPATH . 'wp-admin/includes/widgets.php' );
+
+if ( ! current_user_can( 'edit_theme_options' ) ) {
+ wp_die(
+ '<h1>' . __( 'You need a higher level of permission.' ) . '</h1>' .
+ '<p>' . __( 'Sorry, you are not allowed to edit theme options on this site.' ) . '</p>',
+ 403
+ );
+}
+
+$widgets_access = get_user_setting( 'widgets_access' );
+if ( isset( $_GET['widgets-access'] ) ) {
+ check_admin_referer( 'widgets-access' );
+
+ $widgets_access = 'on' == $_GET['widgets-access'] ? 'on' : 'off';
+ set_user_setting( 'widgets_access', $widgets_access );
+}
+
+if ( 'on' == $widgets_access ) {
+ add_filter( 'admin_body_class', 'wp_widgets_access_body_class' );
+} else {
+ wp_enqueue_script( 'admin-widgets' );
+
+ if ( wp_is_mobile() ) {
+ wp_enqueue_script( 'jquery-touch-punch' );
+ }
+}
+
+/**
+ * Fires early before the Widgets administration screen loads,
+ * after scripts are enqueued.
+ *
+ * @since 2.2.0
+ */
+do_action( 'sidebar_admin_setup' );
+
+$title = __( 'Widgets' );
+$parent_file = 'themes.php';
+
+get_current_screen()->add_help_tab(
+ array(
+ 'id' => 'overview',
+ 'title' => __( 'Overview' ),
+ 'content' =>
+ '<p>' . __( 'Widgets are independent sections of content that can be placed into any widgetized area provided by your theme (commonly called sidebars). To populate your sidebars/widget areas with individual widgets, drag and drop the title bars into the desired area. By default, only the first widget area is expanded. To populate additional widget areas, click on their title bars to expand them.' ) . '</p>
+ <p>' . __( 'The Available Widgets section contains all the widgets you can choose from. Once you drag a widget into a sidebar, it will open to allow you to configure its settings. When you are happy with the widget settings, click the Save button and the widget will go live on your site. If you click Delete, it will remove the widget.' ) . '</p>',
+ )
+);
+get_current_screen()->add_help_tab(
+ array(
+ 'id' => 'removing-reusing',
+ 'title' => __( 'Removing and Reusing' ),
+ 'content' =>
+ '<p>' . __( 'If you want to remove the widget but save its setting for possible future use, just drag it into the Inactive Widgets area. You can add them back anytime from there. This is especially helpful when you switch to a theme with fewer or different widget areas.' ) . '</p>
+ <p>' . __( 'Widgets may be used multiple times. You can give each widget a title, to display on your site, but it&#8217;s not required.' ) . '</p>
+ <p>' . __( 'Enabling Accessibility Mode, via Screen Options, allows you to use Add and Edit buttons instead of using drag and drop.' ) . '</p>',
+ )
+);
+get_current_screen()->add_help_tab(
+ array(
+ 'id' => 'missing-widgets',
+ 'title' => __( 'Missing Widgets' ),
+ 'content' =>
+ '<p>' . __( 'Many themes show some sidebar widgets by default until you edit your sidebars, but they are not automatically displayed in your sidebar management tool. After you make your first widget change, you can re-add the default widgets by adding them from the Available Widgets area.' ) . '</p>' .
+ '<p>' . __( 'When changing themes, there is often some variation in the number and setup of widget areas/sidebars and sometimes these conflicts make the transition a bit less smooth. If you changed themes and seem to be missing widgets, scroll down on this screen to the Inactive Widgets area, where all of your widgets and their settings will have been saved.' ) . '</p>',
+ )
+);
+
+get_current_screen()->set_help_sidebar(
+ '<p><strong>' . __( 'For more information:' ) . '</strong></p>' .
+ '<p>' . __( '<a href="https://codex.wordpress.org/Appearance_Widgets_Screen">Documentation on Widgets</a>' ) . '</p>' .
+ '<p>' . __( '<a href="https://wordpress.org/support/">Support</a>' ) . '</p>'
+);
+
+if ( ! current_theme_supports( 'widgets' ) ) {
+ wp_die( __( 'The theme you are currently using isn&#8217;t widget-aware, meaning that it has no sidebars that you are able to change. For information on making your theme widget-aware, please <a href="https://codex.wordpress.org/Widgetizing_Themes">follow these instructions</a>.' ) );
+}
+
+// These are the widgets grouped by sidebar
+$sidebars_widgets = wp_get_sidebars_widgets();
+
+if ( empty( $sidebars_widgets ) ) {
+ $sidebars_widgets = wp_get_widget_defaults();
+}
+
+foreach ( $sidebars_widgets as $sidebar_id => $widgets ) {
+ if ( 'wp_inactive_widgets' == $sidebar_id ) {
+ continue;
+ }
+
+ if ( ! is_registered_sidebar( $sidebar_id ) ) {
+ if ( ! empty( $widgets ) ) { // register the inactive_widgets area as sidebar
+ register_sidebar(
+ array(
+ 'name' => __( 'Inactive Sidebar (not used)' ),
+ 'id' => $sidebar_id,
+ 'class' => 'inactive-sidebar orphan-sidebar',
+ 'description' => __( 'This sidebar is no longer available and does not show anywhere on your site. Remove each of the widgets below to fully remove this inactive sidebar.' ),
+ 'before_widget' => '',
+ 'after_widget' => '',
+ 'before_title' => '',
+ 'after_title' => '',
+ )
+ );
+ } else {
+ unset( $sidebars_widgets[ $sidebar_id ] );
+ }
+ }
+}
+
+// register the inactive_widgets area as sidebar
+register_sidebar(
+ array(
+ 'name' => __( 'Inactive Widgets' ),
+ 'id' => 'wp_inactive_widgets',
+ 'class' => 'inactive-sidebar',
+ 'description' => __( 'Drag widgets here to remove them from the sidebar but keep their settings.' ),
+ 'before_widget' => '',
+ 'after_widget' => '',
+ 'before_title' => '',
+ 'after_title' => '',
+ )
+);
+
+retrieve_widgets();
+
+// We're saving a widget without js
+if ( isset( $_POST['savewidget'] ) || isset( $_POST['removewidget'] ) ) {
+ $widget_id = $_POST['widget-id'];
+ check_admin_referer( "save-delete-widget-$widget_id" );
+
+ $number = isset( $_POST['multi_number'] ) ? (int) $_POST['multi_number'] : '';
+ if ( $number ) {
+ foreach ( $_POST as $key => $val ) {
+ if ( is_array( $val ) && preg_match( '/__i__|%i%/', key( $val ) ) ) {
+ $_POST[ $key ] = array( $number => array_shift( $val ) );
+ break;
+ }
+ }
+ }
+
+ $sidebar_id = $_POST['sidebar'];
+ $position = isset( $_POST[ $sidebar_id . '_position' ] ) ? (int) $_POST[ $sidebar_id . '_position' ] - 1 : 0;
+
+ $id_base = $_POST['id_base'];
+ $sidebar = isset( $sidebars_widgets[ $sidebar_id ] ) ? $sidebars_widgets[ $sidebar_id ] : array();
+
+ // Delete.
+ if ( isset( $_POST['removewidget'] ) && $_POST['removewidget'] ) {
+
+ if ( ! in_array( $widget_id, $sidebar, true ) ) {
+ wp_redirect( admin_url( 'widgets.php?error=0' ) );
+ exit;
+ }
+
+ $sidebar = array_diff( $sidebar, array( $widget_id ) );
+ $_POST = array(
+ 'sidebar' => $sidebar_id,
+ 'widget-' . $id_base => array(),
+ 'the-widget-id' => $widget_id,
+ 'delete_widget' => '1',
+ );
+
+ /**
+ * Fires immediately after a widget has been marked for deletion.
+ *
+ * @since 4.4.0
+ *
+ * @param string $widget_id ID of the widget marked for deletion.
+ * @param string $sidebar_id ID of the sidebar the widget was deleted from.
+ * @param string $id_base ID base for the widget.
+ */
+ do_action( 'delete_widget', $widget_id, $sidebar_id, $id_base );
+ }
+
+ $_POST['widget-id'] = $sidebar;
+
+ foreach ( (array) $wp_registered_widget_updates as $name => $control ) {
+ if ( $name != $id_base || ! is_callable( $control['callback'] ) ) {
+ continue;
+ }
+
+ ob_start();
+ call_user_func_array( $control['callback'], $control['params'] );
+ ob_end_clean();
+
+ break;
+ }
+
+ $sidebars_widgets[ $sidebar_id ] = $sidebar;
+
+ // Remove old position.
+ if ( ! isset( $_POST['delete_widget'] ) ) {
+ foreach ( $sidebars_widgets as $key => $sb ) {
+ if ( is_array( $sb ) ) {
+ $sidebars_widgets[ $key ] = array_diff( $sb, array( $widget_id ) );
+ }
+ }
+ array_splice( $sidebars_widgets[ $sidebar_id ], $position, 0, $widget_id );
+ }
+
+ wp_set_sidebars_widgets( $sidebars_widgets );
+ wp_redirect( admin_url( 'widgets.php?message=0' ) );
+ exit;
+}
+
+// Remove inactive widgets without js
+if ( isset( $_POST['removeinactivewidgets'] ) ) {
+ check_admin_referer( 'remove-inactive-widgets', '_wpnonce_remove_inactive_widgets' );
+
+ if ( $_POST['removeinactivewidgets'] ) {
+ foreach ( $sidebars_widgets['wp_inactive_widgets'] as $key => $widget_id ) {
+ $pieces = explode( '-', $widget_id );
+ $multi_number = array_pop( $pieces );
+ $id_base = implode( '-', $pieces );
+ $widget = get_option( 'widget_' . $id_base );
+ unset( $widget[ $multi_number ] );
+ update_option( 'widget_' . $id_base, $widget );
+ unset( $sidebars_widgets['wp_inactive_widgets'][ $key ] );
+ }
+
+ wp_set_sidebars_widgets( $sidebars_widgets );
+ }
+
+ wp_redirect( admin_url( 'widgets.php?message=0' ) );
+ exit;
+}
+
+// Output the widget form without js
+if ( isset( $_GET['editwidget'] ) && $_GET['editwidget'] ) {
+ $widget_id = $_GET['editwidget'];
+
+ if ( isset( $_GET['addnew'] ) ) {
+ // Default to the first sidebar
+ $keys = array_keys( $wp_registered_sidebars );
+ $sidebar = reset( $keys );
+
+ if ( isset( $_GET['base'] ) && isset( $_GET['num'] ) ) { // multi-widget
+ // Copy minimal info from an existing instance of this widget to a new instance
+ foreach ( $wp_registered_widget_controls as $control ) {
+ if ( $_GET['base'] === $control['id_base'] ) {
+ $control_callback = $control['callback'];
+ $multi_number = (int) $_GET['num'];
+ $control['params'][0]['number'] = -1;
+ $widget_id = $control['id'] = $control['id_base'] . '-' . $multi_number;
+ $wp_registered_widget_controls[ $control['id'] ] = $control;
+ break;
+ }
+ }
+ }
+ }
+
+ if ( isset( $wp_registered_widget_controls[ $widget_id ] ) && ! isset( $control ) ) {
+ $control = $wp_registered_widget_controls[ $widget_id ];
+ $control_callback = $control['callback'];
+ } elseif ( ! isset( $wp_registered_widget_controls[ $widget_id ] ) && isset( $wp_registered_widgets[ $widget_id ] ) ) {
+ $name = esc_html( strip_tags( $wp_registered_widgets[ $widget_id ]['name'] ) );
+ }
+
+ if ( ! isset( $name ) ) {
+ $name = esc_html( strip_tags( $control['name'] ) );
+ }
+
+ if ( ! isset( $sidebar ) ) {
+ $sidebar = isset( $_GET['sidebar'] ) ? $_GET['sidebar'] : 'wp_inactive_widgets';
+ }
+
+ if ( ! isset( $multi_number ) ) {
+ $multi_number = isset( $control['params'][0]['number'] ) ? $control['params'][0]['number'] : '';
+ }
+
+ $id_base = isset( $control['id_base'] ) ? $control['id_base'] : $control['id'];
+
+ // Show the widget form.
+ $width = ' style="width:' . max( $control['width'], 350 ) . 'px"';
+ $key = isset( $_GET['key'] ) ? (int) $_GET['key'] : 0;
+
+ require_once( ABSPATH . 'wp-admin/admin-header.php' ); ?>
+ <div class="wrap">
+ <h1><?php echo esc_html( $title ); ?></h1>
+ <div class="editwidget"<?php echo $width; ?>>
+ <h2><?php printf( __( 'Widget %s' ), $name ); ?></h2>
+
+ <form action="widgets.php" method="post">
+ <div class="widget-inside">
+ <?php
+ if ( is_callable( $control_callback ) ) {
+ call_user_func_array( $control_callback, $control['params'] );
+ } else {
+ echo '<p>' . __( 'There are no options for this widget.' ) . "</p>\n";
+ }
+ ?>
+ </div>
+
+ <p class="describe"><?php _e( 'Select both the sidebar for this widget and the position of the widget in that sidebar.' ); ?></p>
+ <div class="widget-position">
+ <table class="widefat"><thead><tr><th><?php _e( 'Sidebar' ); ?></th><th><?php _e( 'Position' ); ?></th></tr></thead><tbody>
+ <?php
+ foreach ( $wp_registered_sidebars as $sbname => $sbvalue ) {
+ echo "\t\t<tr><td><label><input type='radio' name='sidebar' value='" . esc_attr( $sbname ) . "'" . checked( $sbname, $sidebar, false ) . " /> $sbvalue[name]</label></td><td>";
+ if ( 'wp_inactive_widgets' == $sbname || 'orphaned_widgets' == substr( $sbname, 0, 16 ) ) {
+ echo '&nbsp;';
+ } else {
+ if ( ! isset( $sidebars_widgets[ $sbname ] ) || ! is_array( $sidebars_widgets[ $sbname ] ) ) {
+ $j = 1;
+ $sidebars_widgets[ $sbname ] = array();
+ } else {
+ $j = count( $sidebars_widgets[ $sbname ] );
+ if ( isset( $_GET['addnew'] ) || ! in_array( $widget_id, $sidebars_widgets[ $sbname ], true ) ) {
+ $j++;
+ }
+ }
+ $selected = '';
+ echo "\t\t<select name='{$sbname}_position'>\n";
+ echo "\t\t<option value=''>" . __( '&mdash; Select &mdash;' ) . "</option>\n";
+ for ( $i = 1; $i <= $j; $i++ ) {
+ if ( in_array( $widget_id, $sidebars_widgets[ $sbname ], true ) ) {
+ $selected = selected( $i, $key + 1, false );
+ }
+ echo "\t\t<option value='$i'$selected> $i </option>\n";
+ }
+ echo "\t\t</select>\n";
+ }
+ echo "</td></tr>\n";
+ }
+ ?>
+ </tbody></table>
+ </div>
+
+ <div class="widget-control-actions">
+ <?php
+ if ( isset( $_GET['addnew'] ) ) {
+ ?>
+ <a href="widgets.php" class="button alignleft"><?php _e( 'Cancel' ); ?></a>
+ <?php
+ } else {
+ submit_button( __( 'Delete' ), 'alignleft', 'removewidget', false );
+ }
+ submit_button( __( 'Save Widget' ), 'primary alignright', 'savewidget', false );
+ ?>
+ <input type="hidden" name="widget-id" class="widget-id" value="<?php echo esc_attr( $widget_id ); ?>" />
+ <input type="hidden" name="id_base" class="id_base" value="<?php echo esc_attr( $id_base ); ?>" />
+ <input type="hidden" name="multi_number" class="multi_number" value="<?php echo esc_attr( $multi_number ); ?>" />
+ <?php wp_nonce_field( "save-delete-widget-$widget_id" ); ?>
+ <br class="clear" />
+ </div>
+ </form>
+ </div>
+ </div>
+ <?php
+ require_once( ABSPATH . 'wp-admin/admin-footer.php' );
+ exit;
+}
+
+$messages = array(
+ __( 'Changes saved.' ),
+);
+
+$errors = array(
+ __( 'Error while saving.' ),
+ __( 'Error in displaying the widget settings form.' ),
+);
+
+require_once( ABSPATH . 'wp-admin/admin-header.php' );
+?>
+
+<div class="wrap">
+<h1 class="wp-heading-inline">
+<?php
+echo esc_html( $title );
+?>
+</h1>
+
+<?php
+if ( current_user_can( 'customize' ) ) {
+ printf(
+ ' <a class="page-title-action hide-if-no-customize" href="%1$s">%2$s</a>',
+ esc_url(
+ add_query_arg(
+ array(
+ array( 'autofocus' => array( 'panel' => 'widgets' ) ),
+ 'return' => urlencode( remove_query_arg( wp_removable_query_args(), wp_unslash( $_SERVER['REQUEST_URI'] ) ) ),
+ ),
+ admin_url( 'customize.php' )
+ )
+ ),
+ __( 'Manage with Live Preview' )
+ );
+}
+
+$nonce = wp_create_nonce( 'widgets-access' );
+?>
+<div class="widget-access-link">
+ <a id="access-on" href="widgets.php?widgets-access=on&_wpnonce=<?php echo urlencode( $nonce ); ?>"><?php _e( 'Enable accessibility mode' ); ?></a><a id="access-off" href="widgets.php?widgets-access=off&_wpnonce=<?php echo urlencode( $nonce ); ?>"><?php _e( 'Disable accessibility mode' ); ?></a>
+</div>
+
+<hr class="wp-header-end">
+
+<?php if ( isset( $_GET['message'] ) && isset( $messages[ $_GET['message'] ] ) ) { ?>
+<div id="message" class="updated notice is-dismissible"><p><?php echo $messages[ $_GET['message'] ]; ?></p></div>
+<?php } ?>
+<?php if ( isset( $_GET['error'] ) && isset( $errors[ $_GET['error'] ] ) ) { ?>
+<div id="message" class="error"><p><?php echo $errors[ $_GET['error'] ]; ?></p></div>
+<?php } ?>
+
+<?php
+/**
+ * Fires before the Widgets administration page content loads.
+ *
+ * @since 3.0.0
+ */
+do_action( 'widgets_admin_page' );
+?>
+
+<div class="widget-liquid-left">
+<div id="widgets-left">
+ <div id="available-widgets" class="widgets-holder-wrap">
+ <div class="sidebar-name">
+ <button type="button" class="handlediv hide-if-no-js" aria-expanded="true">
+ <span class="screen-reader-text"><?php _e( 'Available Widgets' ); ?></span>
+ <span class="toggle-indicator" aria-hidden="true"></span>
+ </button>
+ <h2><?php _e( 'Available Widgets' ); ?> <span id="removing-widget"><?php _ex( 'Deactivate', 'removing-widget' ); ?> <span></span></span></h2>
+ </div>
+ <div class="widget-holder">
+ <div class="sidebar-description">
+ <p class="description"><?php _e( 'To activate a widget drag it to a sidebar or click on it. To deactivate a widget and delete its settings, drag it back.' ); ?></p>
+ </div>
+ <div id="widget-list">
+ <?php wp_list_widgets(); ?>
+ </div>
+ <br class='clear' />
+ </div>
+ <br class="clear" />
+ </div>
+
+<?php
+
+$theme_sidebars = array();
+foreach ( $wp_registered_sidebars as $sidebar => $registered_sidebar ) {
+ if ( false !== strpos( $registered_sidebar['class'], 'inactive-sidebar' ) || 'orphaned_widgets' == substr( $sidebar, 0, 16 ) ) {
+ $wrap_class = 'widgets-holder-wrap';
+ if ( ! empty( $registered_sidebar['class'] ) ) {
+ $wrap_class .= ' ' . $registered_sidebar['class'];
+ }
+
+ $is_inactive_widgets = 'wp_inactive_widgets' == $registered_sidebar['id'];
+ ?>
+ <div class="<?php echo esc_attr( $wrap_class ); ?>">
+ <div class="widget-holder inactive">
+ <?php wp_list_widget_controls( $registered_sidebar['id'], $registered_sidebar['name'] ); ?>
+
+ <?php if ( $is_inactive_widgets ) { ?>
+ <div class="remove-inactive-widgets">
+ <form action="" method="post">
+ <p>
+ <?php
+ $attributes = array( 'id' => 'inactive-widgets-control-remove' );
+
+ if ( empty( $sidebars_widgets['wp_inactive_widgets'] ) ) {
+ $attributes['disabled'] = '';
+ }
+
+ submit_button( __( 'Clear Inactive Widgets' ), 'delete', 'removeinactivewidgets', false, $attributes );
+ ?>
+ <span class="spinner"></span>
+ </p>
+ <?php wp_nonce_field( 'remove-inactive-widgets', '_wpnonce_remove_inactive_widgets' ); ?>
+ </form>
+ </div>
+ <?php } ?>
+ </div>
+ <?php if ( $is_inactive_widgets ) { ?>
+ <p class="description"><?php _e( 'This will clear all items from the inactive widgets list. You will not be able to restore any customizations.' ); ?></p>
+ <?php } ?>
+ </div>
+ <?php
+
+ } else {
+ $theme_sidebars[ $sidebar ] = $registered_sidebar;
+ }
+}
+
+?>
+</div>
+</div>
+<?php
+
+$i = $split = 0;
+$single_sidebar_class = '';
+$sidebars_count = count( $theme_sidebars );
+
+if ( $sidebars_count > 1 ) {
+ $split = ceil( $sidebars_count / 2 );
+} else {
+ $single_sidebar_class = ' single-sidebar';
+}
+
+?>
+<div class="widget-liquid-right">
+<div id="widgets-right" class="wp-clearfix<?php echo $single_sidebar_class; ?>">
+<div class="sidebars-column-1">
+<?php
+
+foreach ( $theme_sidebars as $sidebar => $registered_sidebar ) {
+ $wrap_class = 'widgets-holder-wrap';
+ if ( ! empty( $registered_sidebar['class'] ) ) {
+ $wrap_class .= ' sidebar-' . $registered_sidebar['class'];
+ }
+
+ if ( $i > 0 ) {
+ $wrap_class .= ' closed';
+ }
+
+ if ( $split && $i == $split ) {
+ ?>
+ </div><div class="sidebars-column-2">
+ <?php
+ }
+
+ ?>
+ <div class="<?php echo esc_attr( $wrap_class ); ?>">
+ <?php wp_list_widget_controls( $sidebar, $registered_sidebar['name'] ); // Show the control forms for each of the widgets in this sidebar ?>
+ </div>
+ <?php
+
+ $i++;
+}
+
+?>
+</div>
+</div>
+</div>
+<form method="post">
+<?php wp_nonce_field( 'save-sidebar-widgets', '_wpnonce_widgets', false ); ?>
+</form>
+<br class="clear" />
+</div>
+
+<div class="widgets-chooser">
+ <ul class="widgets-chooser-sidebars"></ul>
+ <div class="widgets-chooser-actions">
+ <button class="button widgets-chooser-cancel"><?php _e( 'Cancel' ); ?></button>
+ <button class="button button-primary widgets-chooser-add"><?php _e( 'Add Widget' ); ?></button>
+ </div>
+</div>
+
+<?php
+
+/**
+ * Fires after the available widgets and sidebars have loaded, before the admin footer.
+ *
+ * @since 2.2.0
+ */
+do_action( 'sidebar_admin_page' );
+require_once( ABSPATH . 'wp-admin/admin-footer.php' );